Skip to content

Commit 50e2c17

Browse files
authored
Merge pull request #46 from Foxy/bugfix/fixes-for-typedefs
fix: add missing typedefs
2 parents 4c7bf0d + 776e1d5 commit 50e2c17

10 files changed

+135
-8
lines changed

src/backend/Graph/coupon.d.ts

+6
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,12 @@ export interface Coupon extends Graph {
5151
exclude_line_item_discounts: boolean;
5252
/** Set to true to apply taxes before this coupon's discount is applied. Check with your tax professional if you have questions about how you should calculate taxes. */
5353
is_taxable: boolean;
54+
/** Set to true to enable auto-apply functionality. */
55+
customer_auto_apply: boolean;
56+
/** Auto-apply coupons only. This coupon will be automatically applied when a customer record matches this query. Example: `attributes:name[auto_apply_coupons]=1`. */
57+
customer_attribute_restrictions: string;
58+
/** Auto-apply coupons only. This coupon will be automatically applied when a subscription includes a product with one of the codes in the list. Wildcards are allowed just like in product code restrictions. Example: `code_1,code_2,sku_*,abc`. */
59+
customer_subscription_restrictions: string;
5460
/** The date this resource was created. */
5561
date_created: string | null;
5662
/** The date this resource was last modified. */

src/backend/Graph/hosted_payment_gateways_helper.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export interface HostedPaymentGatewaysHelper extends Graph {
3535
test_third_party_key: string;
3636
/** The description of the third party key field for this hosted gateway. */
3737
third_party_key_description: string;
38+
/** Marks hosted payment gateways that are no longer supported. */
39+
is_deprecated: boolean;
3840
/** If this hosted gateway requires additional information, this will contain details about the data which needs to be collected to configure this hosted gateway. */
3941
additional_fields: null | {
4042
blocks: {

src/backend/Graph/payment_gateways_helper.d.ts

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ export interface PaymentGatewaysHelper extends Graph {
3535
test_third_party_key: string;
3636
/** The description of the third party key field for this gateway. */
3737
third_party_key_description: string;
38+
/** Marks payment gateways that are no longer supported. */
39+
is_deprecated: boolean;
3840
/** If this gateway requires additional information, this will contain details about the data which needs to be collected to configure this gateway. */
3941
additional_fields: null | {
4042
blocks: {

src/backend/Graph/store.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import type { TemplateSets } from './template_sets';
2626
import type { Transactions } from './transactions';
2727
import type { UserAccesses } from './user_accesses';
2828
import type { Users } from './users';
29+
import type { StoreShippingMethods } from './store_shipping_methods';
2930

3031
export interface Store extends Graph {
3132
curie: 'fx:store';
@@ -81,6 +82,8 @@ export interface Store extends Graph {
8182
'fx:subscription_settings': SubscriptionSettings;
8283
/** List of cart include templates available in this store. */
8384
'fx:cart_include_templates': CartIncludeTemplates;
85+
/** List of shipping methods supported by this store. */
86+
'fx:store_shipping_methods': StoreShippingMethods;
8487
/** List of hosted payment gateways enabled for this store. */
8588
'fx:hosted_payment_gateways': HostedPaymentGateways;
8689
/** Configuration of this store's customer portal. */
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { CollectionGraphLinks, CollectionGraphProps } from '../../core/defaults';
2+
import type { StoreShippingMethod } from './store_shipping_method';
3+
import type { Graph } from '../../core';
4+
5+
export interface StoreShippingMethods extends Graph {
6+
curie: 'fx:store_shipping_methods';
7+
links: CollectionGraphLinks<StoreShippingMethods>;
8+
props: CollectionGraphProps;
9+
child: StoreShippingMethod;
10+
}

src/backend/Graph/transaction.d.ts

+46-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ import type { Shipments } from './shipments';
1717
import type { Store } from './store';
1818
import type { TransactionLogs } from './transaction_logs';
1919
import type { Void } from './void';
20+
import type { GiftCardCodeLog } from './gift_card_code_log';
21+
import type { TransactionLog } from './transaction_log';
22+
import type { TransactionJournalEntry } from './transaction_journal_entry';
23+
import type { TransactionJournalEntries } from './transaction_journal_entries';
24+
import type { GiftCardCodeLogs } from './gift_card_code_logs';
25+
import type { Subscription } from './subscription';
2026

2127
export interface Transaction extends Graph {
2228
curie: 'fx:transaction';
@@ -48,6 +54,8 @@ export interface Transaction extends Graph {
4854
'fx:attributes': Attributes;
4955
/** POST here to resend emails for this transaction. */
5056
'fx:send_emails': SendEmails;
57+
/** If this transaction has a subscription, it will be linked here. */
58+
'fx:subscription': Subscription;
5159
/** List of taxes applied to this transaction. */
5260
'fx:applied_taxes': AppliedTaxes;
5361
/** List of custom fields on this transaction. */
@@ -60,6 +68,10 @@ export interface Transaction extends Graph {
6068
'fx:billing_addresses': BillingAddresses;
6169
/** POST here to resend transaction to the webhooks. */
6270
'fx:native_integrations': NativeIntegrations;
71+
/** List of all gift card codes applied to this transaction. */
72+
'fx:applied_gift_card_codes': GiftCardCodeLogs;
73+
/** Journal entries for this transaction. */
74+
'fx:transaction_journal_entries': TransactionJournalEntries;
6375
};
6476

6577
props: {
@@ -98,21 +110,53 @@ export interface Transaction extends Graph {
98110
/** Total amount of this transaction including all items, taxes, shipping costs and discounts. */
99111
total_order: number;
100112
/** Used for transactions processed with a hosted payment gateway which can change the status of the transaction after it is originally posted. If the status is empty, a normal payment gateway was used and the transaction should be considered completed. */
101-
status: 'approved' | 'authorized' | 'declined' | 'pending' | 'rejected';
113+
status:
114+
| ''
115+
| 'capturing'
116+
| 'captured'
117+
| 'approved'
118+
| 'authorized'
119+
| 'pending'
120+
| 'completed'
121+
| 'problem'
122+
| 'pending_fraud_review'
123+
| 'rejected'
124+
| 'declined'
125+
| 'refunding'
126+
| 'refunded'
127+
| 'voided'
128+
| 'verified';
102129
/** The type of transaction that has occurred. */
103-
type: 'updateinfo' | 'subscription_modification' | 'subscription_renewal' | 'subscription_cancellation';
130+
type: '' | 'updateinfo' | 'subscription_modification' | 'subscription_renewal' | 'subscription_cancellation';
104131
/** The 3 character ISO code for the currency. */
105132
currency_code: string;
106133
/** The currency symbol, such as $, £, €, etc. */
107134
currency_symbol: string;
135+
/** The UA string of a browser that customer used on checkout. May contain a special UA for subscription processing. */
136+
user_agent: string;
137+
/** If custom transaction IDs, prefixes, or suffixes have been configured, this value will contain the custom ID (which may be a string). Otherwise it will be identical to the id value (an integer). */
138+
display_id: string | number;
139+
/** The source of transaction that has occurred. CIT/MIT. */
140+
source:
141+
| 'cit_ecommerce'
142+
| 'mit_uoe'
143+
| 'mit_api'
144+
| 'mit_recurring'
145+
| 'mit_recurring_reattempt_automated'
146+
| 'mit_recurring_reattempt_manual'
147+
| 'cit_recurring_cancellation'
148+
| 'mit_recurring_cancellation';
108149
/** The date this resource was created. */
109150
date_created: string | null;
110151
/** The date this resource was last modified. */
111152
date_modified: string | null;
112153
};
113154

114155
zooms: {
156+
transaction_journal_entries?: TransactionJournalEntry;
157+
applied_gift_card_codes?: GiftCardCodeLog;
115158
billing_addresses?: BillingAddresses;
159+
transaction_logs?: TransactionLog;
116160
applied_taxes?: AppliedTaxes;
117161
custom_fields?: CustomFields;
118162
attributes: Attributes;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { CollectionGraphLinks, CollectionGraphProps } from '../../core/defaults';
2+
import type { TransactionJournalEntry } from './transaction_journal_entry';
3+
import type { Graph } from '../../core';
4+
5+
export interface TransactionJournalEntries extends Graph {
6+
curie: 'fx:transaction_journal_entries';
7+
links: CollectionGraphLinks<TransactionJournalEntries>;
8+
props: CollectionGraphProps;
9+
child: TransactionJournalEntry;
10+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import type { TransactionLog } from './transaction_log';
2+
import type { Transaction } from './transaction';
3+
import type { Graph } from '../../core';
4+
import type { Store } from './store';
5+
6+
export interface TransactionJournalEntry extends Graph {
7+
curie: 'fx:transaction_journal_entry';
8+
9+
links: {
10+
/** This resource. */
11+
'self': TransactionJournalEntry;
12+
/** Relared store resource. */
13+
'fx:store': Store;
14+
/** Related transaction resource. */
15+
'fx:transaction': Transaction;
16+
/** Related transaction log. */
17+
'fx:transaction_log': TransactionLog;
18+
};
19+
20+
props: {
21+
/** The value of money that should be transferred to or from the merchant's bank account (or comparable). Note that voids or refunds will result in a negative number. */
22+
amount: number;
23+
/** If custom transaction IDs, prefixes, or suffixes have been configured, this value will contain the custom ID (which may be a string). Otherwise it will be identical to the id value (an integer). */
24+
display_id: string | number;
25+
/** The date this resource was created. */
26+
date_created: string | null;
27+
};
28+
29+
zooms: {
30+
transaction_logs?: TransactionLog;
31+
};
32+
}

src/backend/Rels.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ export * from './Graph/shipping_service';
129129
export * from './Graph/shipping_services';
130130
export * from './Graph/store';
131131
export * from './Graph/store_shipping_method';
132+
export * from './Graph/store_shipping_methods';
132133
export * from './Graph/store_shipping_service';
133134
export * from './Graph/store_shipping_services';
134135
export * from './Graph/store_version';
@@ -146,6 +147,8 @@ export * from './Graph/template_config';
146147
export * from './Graph/template_set';
147148
export * from './Graph/template_sets';
148149
export * from './Graph/timezones';
150+
export * from './Graph/transaction_journal_entries';
151+
export * from './Graph/transaction_journal_entry';
149152
export * from './Graph/transaction';
150153
export * from './Graph/transaction_log';
151154
export * from './Graph/transaction_log_detail';

src/customer/Graph/transaction.d.ts

+21-6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ export interface Transaction extends Graph {
1010
links: {
1111
/** This resource. */
1212
'self': Transaction;
13+
/** List of items in this transaction. */
14+
'fx:items': Items;
1315
/** Open this link in a browser to see a receipt for this transaction. */
1416
'fx:receipt': Receipt;
1517
/** Related customer resource. */
@@ -18,15 +20,13 @@ export interface Transaction extends Graph {
1820
'fx:attributes': Attributes;
1921
/** List of custom fields on this transaction. */
2022
'fx:custom_fields': CustomFields;
21-
/** List of items for this transaction. */
22-
'fx:items': Items;
2323
};
2424

2525
props: {
2626
/** The order number. */
2727
id: number;
28-
/** The order number for display (usually same as id). */
29-
display_id: number;
28+
/** If custom transaction IDs, prefixes, or suffixes have been configured, this value will contain the custom ID (which may be a string). Otherwise it will be identical to the id value (an integer). */
29+
display_id: string | number;
3030
/** True if this transaction was a test transaction and not run against a live payment gateway. */
3131
is_test: boolean;
3232
/** Set this to true to hide it in the FoxyCart admin. */
@@ -60,9 +60,24 @@ export interface Transaction extends Graph {
6060
/** Total amount of this transaction including all items, taxes, shipping costs and discounts. */
6161
total_order: number;
6262
/** Used for transactions processed with a hosted payment gateway which can change the status of the transaction after it is originally posted. If the status is empty, a normal payment gateway was used and the transaction should be considered completed. */
63-
status: 'approved' | 'authorized' | 'declined' | 'pending' | 'rejected';
63+
status:
64+
| ''
65+
| 'capturing'
66+
| 'captured'
67+
| 'approved'
68+
| 'authorized'
69+
| 'pending'
70+
| 'completed'
71+
| 'problem'
72+
| 'pending_fraud_review'
73+
| 'rejected'
74+
| 'declined'
75+
| 'refunding'
76+
| 'refunded'
77+
| 'voided'
78+
| 'verified';
6479
/** The type of transaction that has occurred. */
65-
type: 'updateinfo' | 'subscription_modification' | 'subscription_renewal' | 'subscription_cancellation';
80+
type: '' | 'updateinfo' | 'subscription_modification' | 'subscription_renewal' | 'subscription_cancellation';
6681
/** The 3 character ISO code for the currency. */
6782
currency_code: string;
6883
/** The currency symbol, such as $, £, €, etc. */

0 commit comments

Comments
 (0)