Skip to content

Commit d7fb104

Browse files
authored
Merge pull request #39 from Foxy/bugfix/typedef-and-node-updates
fix: typedef and node updates
2 parents 89f4628 + 8c90335 commit d7fb104

12 files changed

+904
-1265
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
release:
99
name: Release
10-
runs-on: ubuntu-18.04
10+
runs-on: ubuntu-20.04
1111
steps:
1212
- name: Checkout
1313
uses: actions/checkout@v2
@@ -16,7 +16,7 @@ jobs:
1616
- name: Setup Node.js
1717
uses: actions/setup-node@v1
1818
with:
19-
node-version: 14
19+
node-version: 18
2020
- name: Install dependencies
2121
run: npm ci
2222
- name: Release

.github/workflows/s3cdn.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,26 @@ name: S3CDN upload
33
on:
44
push:
55
tags:
6-
- "*"
6+
- '*'
77
jobs:
88
test:
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-20.04
1010
steps:
1111
- name: Checkout Foxy/foxy-elements
1212
uses: actions/checkout@v2
13-
- name: Install & Build
14-
run: |
15-
npm install
16-
npm run prepack
13+
- name: Setup Node.js
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: 18
17+
- name: Install dependencies
18+
run: npm ci
19+
- name: Build
20+
run: npm run prepack
1721
- uses: Foxy/foxy-github-action-s3cdn@main
1822
with:
1923
package-name: sdk # optional: Default is repo name.
2024
env:
2125
AWS_S3_CDN_BUCKET_NAME: ${{ secrets.AWS_S3_CDN_BUCKET_NAME }}
2226
AWS_S3_CDN_KEY_ID: ${{ secrets.AWS_S3_CDN_KEY_ID }}
2327
AWS_S3_CDN_KEY_SECRET: ${{ secrets.AWS_S3_CDN_KEY_SECRET }}
24-
SOURCE_DIR: "dist/cdn" # optional: defaults to `dist` directory
28+
SOURCE_DIR: 'dist/cdn' # optional: defaults to `dist` directory

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
18

package-lock.json

Lines changed: 854 additions & 1242 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
"backend.d.ts"
3232
],
3333
"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",
3636
"lint": "npm run lint:eslint && npm run lint:prettier",
3737
"lint:eslint": "eslint --ext .ts,.html . --ignore-path .gitignore",
3838
"lint:prettier": "prettier \"**/*.ts\" --check --ignore-path .gitignore",
@@ -85,17 +85,17 @@
8585
"rimraf": "^3.0.2",
8686
"semantic-release": "^17.3.0",
8787
"ts-jest": "^26.4.4",
88-
"ts-loader": "^8.0.9",
88+
"ts-loader": "^8.4.0",
8989
"ts-node": "^9.1.1",
90-
"ttypescript": "^1.5.12",
90+
"ttypescript": "^1.5.15",
9191
"typedoc": "^0.22.18",
9292
"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",
9595
"webpack-node-externals": "^2.5.2"
9696
},
9797
"engines": {
98-
"node": ">=10 <=15"
98+
"node": ">=10 <=18"
9999
},
100100
"eslintConfig": {
101101
"extends": [

src/backend/Graph/applied_coupon_code.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@ export interface AppliedCouponCode extends Graph {
2323
props: {
2424
/** The coupon code applied to this cart. */
2525
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;
2628
/** The date this resource was created. */
2729
date_created: string | null;
2830
/** The date this resource was last modified. */

src/backend/Graph/cart.d.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,20 @@ export interface Cart extends Graph {
113113
template_set_uri: string;
114114
/** The language defined by the template set being used. */
115115
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;
116120
/** Total amount of the items in this cart. */
117-
total_item_price: string;
121+
total_item_price: number;
118122
/** Total amount of the taxes for this cart. */
119-
total_tax: string;
123+
total_tax: number;
120124
/** Total amount of the shipping costs for this cart. */
121-
total_shipping: string;
125+
total_shipping: number;
122126
/** 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;
124128
/** Total order amount of this cart including all items, taxes, shipping costs and discounts. */
125-
total_order: string;
129+
total_order: number;
126130
/** The date this resource was created. */
127131
date_created: string | null;
128132
/** The date this resource was last modified. */

src/backend/Graph/hosted_payment_gateways_helper.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export interface HostedPaymentGatewaysHelper extends Graph {
4747
type: string;
4848
description?: string;
4949
default_value: string;
50+
options?: { name: string; value: string }[];
5051
}[];
5152
}[];
5253
};

src/backend/Graph/item.d.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
import type { Attributes } from './attributes';
2+
import type { Cart } from './cart';
23
import type { CouponDetails } from './coupon_details';
34
import type { DiscountDetails } from './discount_details';
45
import type { Graph } from '../../core';
56
import type { ItemCategory } from './item_category';
67
import type { ItemOptions } from './item_options';
78
import type { Shipment } from './shipment';
89
import type { Store } from './store';
10+
import type { Subscription } from './subscription';
911
import type { Transaction } from './transaction';
1012

1113
export interface Item extends Graph {
@@ -16,12 +18,16 @@ export interface Item extends Graph {
1618
'self': Item;
1719
/** Store this item belongs to. */
1820
'fx:store': Store;
19-
/** Related shipment info. */
21+
/** Related shipment info. This link is available in purchased items only. */
2022
'fx:shipment': Shipment;
2123
/** Custom attributes linked to this item. */
2224
'fx:attributes': Attributes;
23-
/** Related transaction info. */
25+
/** Related transaction info. This link is available in transaction items only. */
2426
'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;
2531
/** Various custom options for this item. */
2632
'fx:item_options': ItemOptions;
2733
/** Category this item belongs in. */

src/backend/Graph/payment_gateways_helper.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export interface PaymentGatewaysHelper extends Graph {
4747
type: string;
4848
description?: string;
4949
default_value: string;
50+
options?: { name: string; value: string }[];
5051
}[];
5152
}[];
5253
};
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import type { Graph } from '../../core';
2+
3+
export interface SubModificationUrl extends Graph {
4+
curie: 'fx:sub_modification_url';
5+
}

src/backend/Graph/subscription.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import type { Graph } from '../../core';
44
import type { LastTransaction } from './last_transaction';
55
import type { OriginalTransaction } from './original_transaction';
66
import type { Store } from './store';
7+
import type { SubModificationUrl } from './sub_modification_url';
78
import type { SubTokenUrl } from './sub_token_url';
89
import type { TransactionTemplate } from './transaction_template';
910
import type { Transactions } from './transactions';
@@ -28,6 +29,8 @@ export interface Subscription extends Graph {
2829
'fx:transaction_template': TransactionTemplate;
2930
/** Open this link in browser to load up the subscription template into a full HTML cart for the store. */
3031
'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;
3134
};
3235

3336
props: {

0 commit comments

Comments
 (0)