@foxy.io/sdk 1.9.3 → 1.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -38,7 +38,7 @@ const optionsV8N = v8n_1.default().schema({
38
38
  *
39
39
  * @example
40
40
  *
41
- * const url = FoxyApi.sso.createUrl({
41
+ * const url = FoxySDK.Backend.createSSOURL({
42
42
  * customer: 123,
43
43
  * secret: "...",
44
44
  * domain: "https://yourdomain.foxycart.com"
@@ -34,7 +34,7 @@ exports.machine = xstate_1.createMachine({
34
34
  id: 'nucleon',
35
35
  initial: 'init',
36
36
  on: {
37
- DELETE: { actions: ['clearData', 'clearEdits', 'clearErrors'], target: '#nucleon.busy.deleting' },
37
+ DELETE: { target: '#nucleon.busy.deleting' },
38
38
  FETCH: { actions: ['clearData', 'clearEdits', 'clearErrors'], target: '#nucleon.busy.fetching' },
39
39
  REFRESH: { target: '#nucleon.busy.fetching' },
40
40
  SET_DATA: { actions: ['setData', 'clearEdits', 'clearErrors'], target: '#nucleon.init' },
@@ -13,7 +13,7 @@ const optionsV8N = v8n().schema({
13
13
  *
14
14
  * @example
15
15
  *
16
- * const url = FoxyApi.sso.createUrl({
16
+ * const url = FoxySDK.Backend.createSSOURL({
17
17
  * customer: 123,
18
18
  * secret: "...",
19
19
  * domain: "https://yourdomain.foxycart.com"
@@ -12,7 +12,7 @@ export const machine = createMachine({
12
12
  id: 'nucleon',
13
13
  initial: 'init',
14
14
  on: {
15
- DELETE: { actions: ['clearData', 'clearEdits', 'clearErrors'], target: '#nucleon.busy.deleting' },
15
+ DELETE: { target: '#nucleon.busy.deleting' },
16
16
  FETCH: { actions: ['clearData', 'clearEdits', 'clearErrors'], target: '#nucleon.busy.fetching' },
17
17
  REFRESH: { target: '#nucleon.busy.fetching' },
18
18
  SET_DATA: { actions: ['setData', 'clearEdits', 'clearErrors'], target: '#nucleon.init' },
@@ -23,6 +23,8 @@ export interface AppliedCouponCode extends Graph {
23
23
  props: {
24
24
  /** The coupon code applied to this cart. */
25
25
  code: string;
26
+ /** Allow the coupon to be added to the cart, even if it has expired or the number of uses per coupon, code or customer has reached their maximums. This value is available only in POST request body. */
27
+ ignore_usage_limits?: boolean;
26
28
  /** The date this resource was created. */
27
29
  date_created: string | null;
28
30
  /** The date this resource was last modified. */
@@ -113,16 +113,20 @@ export interface Cart extends Graph {
113
113
  template_set_uri: string;
114
114
  /** The language defined by the template set being used. */
115
115
  language: string;
116
+ /** The 3 character ISO code for the currency. This value may be unavailable in some carts. */
117
+ currency_code?: string;
118
+ /** The currency symbol, such as $, £, €, etc. This value may be unavailable in some carts. */
119
+ currency_symbol?: string;
116
120
  /** Total amount of the items in this cart. */
117
- total_item_price: string;
121
+ total_item_price: number;
118
122
  /** Total amount of the taxes for this cart. */
119
- total_tax: string;
123
+ total_tax: number;
120
124
  /** Total amount of the shipping costs for this cart. */
121
- total_shipping: string;
125
+ total_shipping: number;
122
126
  /** If this cart has any shippable subscription items which will process in the future, this will be the total amount of shipping costs for those items. */
123
- total_future_shipping: string;
127
+ total_future_shipping: number;
124
128
  /** Total order amount of this cart including all items, taxes, shipping costs and discounts. */
125
- total_order: string;
129
+ total_order: number;
126
130
  /** The date this resource was created. */
127
131
  date_created: string | null;
128
132
  /** The date this resource was last modified. */
@@ -47,6 +47,7 @@ export interface HostedPaymentGatewaysHelper extends Graph {
47
47
  type: string;
48
48
  description?: string;
49
49
  default_value: string;
50
+ options?: { name: string; value: string }[];
50
51
  }[];
51
52
  }[];
52
53
  };
@@ -1,4 +1,5 @@
1
1
  import type { Attributes } from './attributes';
2
+ import type { Cart } from './cart';
2
3
  import type { CouponDetails } from './coupon_details';
3
4
  import type { DiscountDetails } from './discount_details';
4
5
  import type { Graph } from '../../core';
@@ -6,6 +7,7 @@ import type { ItemCategory } from './item_category';
6
7
  import type { ItemOptions } from './item_options';
7
8
  import type { Shipment } from './shipment';
8
9
  import type { Store } from './store';
10
+ import type { Subscription } from './subscription';
9
11
  import type { Transaction } from './transaction';
10
12
 
11
13
  export interface Item extends Graph {
@@ -16,12 +18,16 @@ export interface Item extends Graph {
16
18
  'self': Item;
17
19
  /** Store this item belongs to. */
18
20
  'fx:store': Store;
19
- /** Related shipment info. */
21
+ /** Related shipment info. This link is available in purchased items only. */
20
22
  'fx:shipment': Shipment;
21
23
  /** Custom attributes linked to this item. */
22
24
  'fx:attributes': Attributes;
23
- /** Related transaction info. */
25
+ /** Related transaction info. This link is available in transaction items only. */
24
26
  'fx:transaction': Transaction;
27
+ /** Related subscription info. This link is available only when this item is part of a subscription. */
28
+ 'fx:subscription': Subscription;
29
+ /** Related cart info. This link is available in cart items only. */
30
+ 'fx:cart': Cart;
25
31
  /** Various custom options for this item. */
26
32
  'fx:item_options': ItemOptions;
27
33
  /** Category this item belongs in. */
@@ -15,6 +15,6 @@ export interface LanguageStrings extends Graph {
15
15
  /** A small, human readable explanation of this property helper. */
16
16
  message: string;
17
17
  /** JSON objects with the language strings supported. The key values match the language property and each pair represents the language_override `code` and `custom_value`. */
18
- values: Record<string, Record<string, string>>;
18
+ values: Record<string, Record<string, string | Record<string, Record<string, string>>>>;
19
19
  };
20
20
  }
@@ -47,6 +47,7 @@ export interface PaymentGatewaysHelper extends Graph {
47
47
  type: string;
48
48
  description?: string;
49
49
  default_value: string;
50
+ options?: { name: string; value: string }[];
50
51
  }[];
51
52
  }[];
52
53
  };
@@ -107,9 +107,9 @@ export interface Store extends Graph {
107
107
  /** Used for when you want to specify a different from email than your store's email address or when your store_email has a list of email addresses. */
108
108
  from_email: string;
109
109
  /** Set this to true if you would like each receipt sent to your customer to also be blind carbon copied to your store's email address. */
110
- bcc_on_receipt_email: string;
110
+ bcc_on_receipt_email: boolean;
111
111
  /** Set this to true if you have set up your DNS settings to include and spf record for FoxyCart. See the {@link http://wiki.foxycart.com/v/1.1/emails FoxyCart documentation} for more details. */
112
- use_email_dns: string;
112
+ use_email_dns: boolean;
113
113
  /** If you'd like to configure your own SMTP server for sending transaction receipt emails, you can do so here. The JSON supports the following fields: `username`,`password`,`host`,`port`,`security`. The security value can be blank, `ssl`, or `tls` */
114
114
  smtp_config: string;
115
115
  /** The postal code of your store. This will be used for calculating shipping costs if you sell shippable items. */
@@ -0,0 +1,5 @@
1
+ import type { Graph } from '../../core';
2
+
3
+ export interface SubModificationUrl extends Graph {
4
+ curie: 'fx:sub_modification_url';
5
+ }
@@ -4,6 +4,7 @@ import type { Graph } from '../../core';
4
4
  import type { LastTransaction } from './last_transaction';
5
5
  import type { OriginalTransaction } from './original_transaction';
6
6
  import type { Store } from './store';
7
+ import type { SubModificationUrl } from './sub_modification_url';
7
8
  import type { SubTokenUrl } from './sub_token_url';
8
9
  import type { TransactionTemplate } from './transaction_template';
9
10
  import type { Transactions } from './transactions';
@@ -28,6 +29,8 @@ export interface Subscription extends Graph {
28
29
  'fx:transaction_template': TransactionTemplate;
29
30
  /** Open this link in browser to load up the subscription template into a full HTML cart for the store. */
30
31
  'fx:sub_token_url': SubTokenUrl;
32
+ /** URL of the page where the customer can modify this subscription. This link is available only when configured in subscription settings. */
33
+ 'fx:sub_modification_url': SubModificationUrl;
31
34
  };
32
35
 
33
36
  props: {
@@ -21,7 +21,7 @@ export interface TaxItemCategory extends Graph {
21
21
  /** A full API URI of the item category resource used in this relationship. When working with hypermedia, it's important to save URIs and not just numeric ids. */
22
22
  item_category_uri: string;
23
23
  /** A full API URI of the tax resource used in this relationship. When working with hypermedia, it's important to save URIs and not just numeric ids. */
24
- store_uri: string;
24
+ tax_uri: string;
25
25
  /** The date this resource was created. */
26
26
  date_created: string | null;
27
27
  /** The date this resource was last modified. */
@@ -6,6 +6,7 @@ import type { Graph } from '../../core';
6
6
  import type { LanguageOverrides } from './language_overrides';
7
7
  import type { ReceiptTemplate } from './receipt_template';
8
8
  import type { Store } from './store';
9
+ import type { TemplateConfig } from './template_config';
9
10
 
10
11
  export interface TemplateSet extends Graph {
11
12
  curie: 'fx:template_set';
@@ -27,6 +28,8 @@ export interface TemplateSet extends Graph {
27
28
  'fx:language_overrides': LanguageOverrides;
28
29
  /** Cart include template for this template set. */
29
30
  'fx:cart_include_template': CartIncludeTemplate;
31
+ /** Template config for this template set. */
32
+ 'fx:template_config': TemplateConfig;
30
33
  };
31
34
 
32
35
  props: {
@@ -48,7 +48,7 @@ interface Options {
48
48
  *
49
49
  * @example
50
50
  *
51
- * const url = FoxyApi.sso.createUrl({
51
+ * const url = FoxySDK.Backend.createSSOURL({
52
52
  * customer: 123,
53
53
  * secret: "...",
54
54
  * domain: "https://yourdomain.foxycart.com"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@foxy.io/sdk",
3
3
  "type": "commonjs",
4
- "version": "1.9.3",
4
+ "version": "1.9.5",
5
5
  "description": "Universal SDK for a full server-side and a limited in-browser access to Foxy hAPI.",
6
6
  "main": "dist/cjs/index.js",
7
7
  "module": "dist/esm/index.js",
@@ -31,8 +31,8 @@
31
31
  "backend.d.ts"
32
32
  ],
33
33
  "scripts": {
34
- "test": "jest",
35
- "test:watch": "jest --watch",
34
+ "test": "NODE_OPTIONS=--no-experimental-fetch jest",
35
+ "test:watch": "NODE_OPTIONS=--no-experimental-fetch jest --watch",
36
36
  "lint": "npm run lint:eslint && npm run lint:prettier",
37
37
  "lint:eslint": "eslint --ext .ts,.html . --ignore-path .gitignore",
38
38
  "lint:prettier": "prettier \"**/*.ts\" --check --ignore-path .gitignore",
@@ -85,17 +85,17 @@
85
85
  "rimraf": "^3.0.2",
86
86
  "semantic-release": "^17.3.0",
87
87
  "ts-jest": "^26.4.4",
88
- "ts-loader": "^8.0.9",
88
+ "ts-loader": "^8.4.0",
89
89
  "ts-node": "^9.1.1",
90
- "ttypescript": "^1.5.12",
90
+ "ttypescript": "^1.5.15",
91
91
  "typedoc": "^0.22.18",
92
92
  "typescript": "^4.0.3",
93
- "webpack": "^5.4.0",
94
- "webpack-cli": "^4.2.0",
93
+ "webpack": "^5.75.0",
94
+ "webpack-cli": "^4.10.0",
95
95
  "webpack-node-externals": "^2.5.2"
96
96
  },
97
97
  "engines": {
98
- "node": ">=10 <=15"
98
+ "node": ">=10 <=18"
99
99
  },
100
100
  "eslintConfig": {
101
101
  "extends": [