Skip to content

Commit

Permalink
fix: add missing typedefs
Browse files Browse the repository at this point in the history
  • Loading branch information
pheekus committed Mar 6, 2024
1 parent 4c7bf0d commit 776e1d5
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 8 deletions.
6 changes: 6 additions & 0 deletions src/backend/Graph/coupon.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ export interface Coupon extends Graph {
exclude_line_item_discounts: boolean;
/** 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. */
is_taxable: boolean;
/** Set to true to enable auto-apply functionality. */
customer_auto_apply: boolean;
/** Auto-apply coupons only. This coupon will be automatically applied when a customer record matches this query. Example: `attributes:name[auto_apply_coupons]=1`. */
customer_attribute_restrictions: string;
/** 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`. */
customer_subscription_restrictions: string;
/** The date this resource was created. */
date_created: string | null;
/** The date this resource was last modified. */
Expand Down
2 changes: 2 additions & 0 deletions src/backend/Graph/hosted_payment_gateways_helper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export interface HostedPaymentGatewaysHelper extends Graph {
test_third_party_key: string;
/** The description of the third party key field for this hosted gateway. */
third_party_key_description: string;
/** Marks hosted payment gateways that are no longer supported. */
is_deprecated: boolean;
/** If this hosted gateway requires additional information, this will contain details about the data which needs to be collected to configure this hosted gateway. */
additional_fields: null | {
blocks: {
Expand Down
2 changes: 2 additions & 0 deletions src/backend/Graph/payment_gateways_helper.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export interface PaymentGatewaysHelper extends Graph {
test_third_party_key: string;
/** The description of the third party key field for this gateway. */
third_party_key_description: string;
/** Marks payment gateways that are no longer supported. */
is_deprecated: boolean;
/** If this gateway requires additional information, this will contain details about the data which needs to be collected to configure this gateway. */
additional_fields: null | {
blocks: {
Expand Down
3 changes: 3 additions & 0 deletions src/backend/Graph/store.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import type { TemplateSets } from './template_sets';
import type { Transactions } from './transactions';
import type { UserAccesses } from './user_accesses';
import type { Users } from './users';
import type { StoreShippingMethods } from './store_shipping_methods';

export interface Store extends Graph {
curie: 'fx:store';
Expand Down Expand Up @@ -81,6 +82,8 @@ export interface Store extends Graph {
'fx:subscription_settings': SubscriptionSettings;
/** List of cart include templates available in this store. */
'fx:cart_include_templates': CartIncludeTemplates;
/** List of shipping methods supported by this store. */
'fx:store_shipping_methods': StoreShippingMethods;
/** List of hosted payment gateways enabled for this store. */
'fx:hosted_payment_gateways': HostedPaymentGateways;
/** Configuration of this store's customer portal. */
Expand Down
10 changes: 10 additions & 0 deletions src/backend/Graph/store_shipping_methods.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { CollectionGraphLinks, CollectionGraphProps } from '../../core/defaults';
import type { StoreShippingMethod } from './store_shipping_method';
import type { Graph } from '../../core';

export interface StoreShippingMethods extends Graph {
curie: 'fx:store_shipping_methods';
links: CollectionGraphLinks<StoreShippingMethods>;
props: CollectionGraphProps;
child: StoreShippingMethod;
}
48 changes: 46 additions & 2 deletions src/backend/Graph/transaction.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ import type { Shipments } from './shipments';
import type { Store } from './store';
import type { TransactionLogs } from './transaction_logs';
import type { Void } from './void';
import type { GiftCardCodeLog } from './gift_card_code_log';
import type { TransactionLog } from './transaction_log';
import type { TransactionJournalEntry } from './transaction_journal_entry';
import type { TransactionJournalEntries } from './transaction_journal_entries';
import type { GiftCardCodeLogs } from './gift_card_code_logs';
import type { Subscription } from './subscription';

export interface Transaction extends Graph {
curie: 'fx:transaction';
Expand Down Expand Up @@ -48,6 +54,8 @@ export interface Transaction extends Graph {
'fx:attributes': Attributes;
/** POST here to resend emails for this transaction. */
'fx:send_emails': SendEmails;
/** If this transaction has a subscription, it will be linked here. */
'fx:subscription': Subscription;
/** List of taxes applied to this transaction. */
'fx:applied_taxes': AppliedTaxes;
/** List of custom fields on this transaction. */
Expand All @@ -60,6 +68,10 @@ export interface Transaction extends Graph {
'fx:billing_addresses': BillingAddresses;
/** POST here to resend transaction to the webhooks. */
'fx:native_integrations': NativeIntegrations;
/** List of all gift card codes applied to this transaction. */
'fx:applied_gift_card_codes': GiftCardCodeLogs;
/** Journal entries for this transaction. */
'fx:transaction_journal_entries': TransactionJournalEntries;
};

props: {
Expand Down Expand Up @@ -98,21 +110,53 @@ export interface Transaction extends Graph {
/** Total amount of this transaction including all items, taxes, shipping costs and discounts. */
total_order: number;
/** 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. */
status: 'approved' | 'authorized' | 'declined' | 'pending' | 'rejected';
status:
| ''
| 'capturing'
| 'captured'
| 'approved'
| 'authorized'
| 'pending'
| 'completed'
| 'problem'
| 'pending_fraud_review'
| 'rejected'
| 'declined'
| 'refunding'
| 'refunded'
| 'voided'
| 'verified';
/** The type of transaction that has occurred. */
type: 'updateinfo' | 'subscription_modification' | 'subscription_renewal' | 'subscription_cancellation';
type: '' | 'updateinfo' | 'subscription_modification' | 'subscription_renewal' | 'subscription_cancellation';
/** The 3 character ISO code for the currency. */
currency_code: string;
/** The currency symbol, such as $, £, €, etc. */
currency_symbol: string;
/** The UA string of a browser that customer used on checkout. May contain a special UA for subscription processing. */
user_agent: string;
/** 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). */
display_id: string | number;
/** The source of transaction that has occurred. CIT/MIT. */
source:
| 'cit_ecommerce'
| 'mit_uoe'
| 'mit_api'
| 'mit_recurring'
| 'mit_recurring_reattempt_automated'
| 'mit_recurring_reattempt_manual'
| 'cit_recurring_cancellation'
| 'mit_recurring_cancellation';
/** The date this resource was created. */
date_created: string | null;
/** The date this resource was last modified. */
date_modified: string | null;
};

zooms: {
transaction_journal_entries?: TransactionJournalEntry;
applied_gift_card_codes?: GiftCardCodeLog;
billing_addresses?: BillingAddresses;
transaction_logs?: TransactionLog;
applied_taxes?: AppliedTaxes;
custom_fields?: CustomFields;
attributes: Attributes;
Expand Down
10 changes: 10 additions & 0 deletions src/backend/Graph/transaction_journal_entries.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import type { CollectionGraphLinks, CollectionGraphProps } from '../../core/defaults';
import type { TransactionJournalEntry } from './transaction_journal_entry';
import type { Graph } from '../../core';

export interface TransactionJournalEntries extends Graph {
curie: 'fx:transaction_journal_entries';
links: CollectionGraphLinks<TransactionJournalEntries>;
props: CollectionGraphProps;
child: TransactionJournalEntry;
}
32 changes: 32 additions & 0 deletions src/backend/Graph/transaction_journal_entry.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { TransactionLog } from './transaction_log';
import type { Transaction } from './transaction';
import type { Graph } from '../../core';
import type { Store } from './store';

export interface TransactionJournalEntry extends Graph {
curie: 'fx:transaction_journal_entry';

links: {
/** This resource. */
'self': TransactionJournalEntry;
/** Relared store resource. */
'fx:store': Store;
/** Related transaction resource. */
'fx:transaction': Transaction;
/** Related transaction log. */
'fx:transaction_log': TransactionLog;
};

props: {
/** 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. */
amount: number;
/** 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). */
display_id: string | number;
/** The date this resource was created. */
date_created: string | null;
};

zooms: {
transaction_logs?: TransactionLog;
};
}
3 changes: 3 additions & 0 deletions src/backend/Rels.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export * from './Graph/shipping_service';
export * from './Graph/shipping_services';
export * from './Graph/store';
export * from './Graph/store_shipping_method';
export * from './Graph/store_shipping_methods';
export * from './Graph/store_shipping_service';
export * from './Graph/store_shipping_services';
export * from './Graph/store_version';
Expand All @@ -146,6 +147,8 @@ export * from './Graph/template_config';
export * from './Graph/template_set';
export * from './Graph/template_sets';
export * from './Graph/timezones';
export * from './Graph/transaction_journal_entries';
export * from './Graph/transaction_journal_entry';
export * from './Graph/transaction';
export * from './Graph/transaction_log';
export * from './Graph/transaction_log_detail';
Expand Down
27 changes: 21 additions & 6 deletions src/customer/Graph/transaction.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ export interface Transaction extends Graph {
links: {
/** This resource. */
'self': Transaction;
/** List of items in this transaction. */
'fx:items': Items;
/** Open this link in a browser to see a receipt for this transaction. */
'fx:receipt': Receipt;
/** Related customer resource. */
Expand All @@ -18,15 +20,13 @@ export interface Transaction extends Graph {
'fx:attributes': Attributes;
/** List of custom fields on this transaction. */
'fx:custom_fields': CustomFields;
/** List of items for this transaction. */
'fx:items': Items;
};

props: {
/** The order number. */
id: number;
/** The order number for display (usually same as id). */
display_id: number;
/** 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). */
display_id: string | number;
/** True if this transaction was a test transaction and not run against a live payment gateway. */
is_test: boolean;
/** Set this to true to hide it in the FoxyCart admin. */
Expand Down Expand Up @@ -60,9 +60,24 @@ export interface Transaction extends Graph {
/** Total amount of this transaction including all items, taxes, shipping costs and discounts. */
total_order: number;
/** 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. */
status: 'approved' | 'authorized' | 'declined' | 'pending' | 'rejected';
status:
| ''
| 'capturing'
| 'captured'
| 'approved'
| 'authorized'
| 'pending'
| 'completed'
| 'problem'
| 'pending_fraud_review'
| 'rejected'
| 'declined'
| 'refunding'
| 'refunded'
| 'voided'
| 'verified';
/** The type of transaction that has occurred. */
type: 'updateinfo' | 'subscription_modification' | 'subscription_renewal' | 'subscription_cancellation';
type: '' | 'updateinfo' | 'subscription_modification' | 'subscription_renewal' | 'subscription_cancellation';
/** The 3 character ISO code for the currency. */
currency_code: string;
/** The currency symbol, such as $, £, €, etc. */
Expand Down

0 comments on commit 776e1d5

Please sign in to comment.