@shop-on/theme-server 0.5.0 → 0.6.0

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.
@@ -3708,7 +3708,7 @@ export type introspection_types = {
3708
3708
  };
3709
3709
  'CurrencyEnum': {
3710
3710
  name: 'CurrencyEnum';
3711
- enumValues: 'MNT';
3711
+ enumValues: 'CNY' | 'EUR' | 'GBP' | 'JPY' | 'KRW' | 'MNT' | 'RUB' | 'USD';
3712
3712
  };
3713
3713
  'CustomerAddressCreateInput': {
3714
3714
  kind: 'INPUT_OBJECT';
@@ -4419,6 +4419,10 @@ export type introspection_types = {
4419
4419
  defaultValue: null;
4420
4420
  }];
4421
4421
  };
4422
+ 'DigitalFileKind': {
4423
+ name: 'DigitalFileKind';
4424
+ enumValues: 'FILE' | 'LINK';
4425
+ };
4422
4426
  'DiscountApplicationSourceEnum': {
4423
4427
  name: 'DiscountApplicationSourceEnum';
4424
4428
  enumValues: 'AUTOMATIC' | 'CODE' | 'MANUAL';
@@ -4427,6 +4431,164 @@ export type introspection_types = {
4427
4431
  name: 'DiscountTargetTypeEnum';
4428
4432
  enumValues: 'LINE_ITEM' | 'ORDER' | 'SHIPPING';
4429
4433
  };
4434
+ 'DownloadGrant': {
4435
+ kind: 'OBJECT';
4436
+ name: 'DownloadGrant';
4437
+ fields: {
4438
+ 'byteSize': {
4439
+ name: 'byteSize';
4440
+ type: {
4441
+ kind: 'SCALAR';
4442
+ name: 'BigInt';
4443
+ ofType: null;
4444
+ };
4445
+ };
4446
+ 'downloadsRemaining': {
4447
+ name: 'downloadsRemaining';
4448
+ type: {
4449
+ kind: 'SCALAR';
4450
+ name: 'Int';
4451
+ ofType: null;
4452
+ };
4453
+ };
4454
+ 'filename': {
4455
+ name: 'filename';
4456
+ type: {
4457
+ kind: 'SCALAR';
4458
+ name: 'String';
4459
+ ofType: null;
4460
+ };
4461
+ };
4462
+ 'kind': {
4463
+ name: 'kind';
4464
+ type: {
4465
+ kind: 'NON_NULL';
4466
+ name: never;
4467
+ ofType: {
4468
+ kind: 'ENUM';
4469
+ name: 'DigitalFileKind';
4470
+ ofType: null;
4471
+ };
4472
+ };
4473
+ };
4474
+ 'orderName': {
4475
+ name: 'orderName';
4476
+ type: {
4477
+ kind: 'NON_NULL';
4478
+ name: never;
4479
+ ofType: {
4480
+ kind: 'SCALAR';
4481
+ name: 'String';
4482
+ ofType: null;
4483
+ };
4484
+ };
4485
+ };
4486
+ 'state': {
4487
+ name: 'state';
4488
+ type: {
4489
+ kind: 'NON_NULL';
4490
+ name: never;
4491
+ ofType: {
4492
+ kind: 'ENUM';
4493
+ name: 'DownloadGrantState';
4494
+ ofType: null;
4495
+ };
4496
+ };
4497
+ };
4498
+ 'title': {
4499
+ name: 'title';
4500
+ type: {
4501
+ kind: 'NON_NULL';
4502
+ name: never;
4503
+ ofType: {
4504
+ kind: 'SCALAR';
4505
+ name: 'String';
4506
+ ofType: null;
4507
+ };
4508
+ };
4509
+ };
4510
+ 'url': {
4511
+ name: 'url';
4512
+ type: {
4513
+ kind: 'SCALAR';
4514
+ name: 'String';
4515
+ ofType: null;
4516
+ };
4517
+ };
4518
+ };
4519
+ };
4520
+ 'DownloadGrantConsumeInput': {
4521
+ kind: 'INPUT_OBJECT';
4522
+ name: 'DownloadGrantConsumeInput';
4523
+ isOneOf: false;
4524
+ inputFields: [{
4525
+ name: 'clientMutationId';
4526
+ type: {
4527
+ kind: 'SCALAR';
4528
+ name: 'String';
4529
+ ofType: null;
4530
+ };
4531
+ defaultValue: null;
4532
+ }, {
4533
+ name: 'signedId';
4534
+ type: {
4535
+ kind: 'NON_NULL';
4536
+ name: never;
4537
+ ofType: {
4538
+ kind: 'SCALAR';
4539
+ name: 'String';
4540
+ ofType: null;
4541
+ };
4542
+ };
4543
+ defaultValue: null;
4544
+ }];
4545
+ };
4546
+ 'DownloadGrantConsumePayload': {
4547
+ kind: 'OBJECT';
4548
+ name: 'DownloadGrantConsumePayload';
4549
+ fields: {
4550
+ 'clientMutationId': {
4551
+ name: 'clientMutationId';
4552
+ type: {
4553
+ kind: 'SCALAR';
4554
+ name: 'String';
4555
+ ofType: null;
4556
+ };
4557
+ };
4558
+ 'url': {
4559
+ name: 'url';
4560
+ type: {
4561
+ kind: 'SCALAR';
4562
+ name: 'String';
4563
+ ofType: null;
4564
+ };
4565
+ };
4566
+ 'userErrors': {
4567
+ name: 'userErrors';
4568
+ type: {
4569
+ kind: 'NON_NULL';
4570
+ name: never;
4571
+ ofType: {
4572
+ kind: 'LIST';
4573
+ name: never;
4574
+ ofType: {
4575
+ kind: 'NON_NULL';
4576
+ name: never;
4577
+ ofType: {
4578
+ kind: 'OBJECT';
4579
+ name: 'UserError';
4580
+ ofType: null;
4581
+ };
4582
+ };
4583
+ };
4584
+ };
4585
+ };
4586
+ };
4587
+ };
4588
+ 'DownloadGrantState': {
4589
+ name: 'DownloadGrantState';
4590
+ enumValues: 'ACTIVE' | 'EXHAUSTED' | 'HELD' | 'REVOKED';
4591
+ };
4430
4592
  'DraftOrderAddressInput': {
4431
4593
  kind: 'INPUT_OBJECT';
4432
4594
  name: 'DraftOrderAddressInput';
@@ -5935,6 +6097,14 @@ export type introspection_types = {
5935
6097
  name: 'MarketingAttributionInput';
5936
6098
  isOneOf: false;
5937
6099
  inputFields: [{
6100
+ name: 'cookies';
6101
+ type: {
6102
+ kind: 'SCALAR';
6103
+ name: 'String';
6104
+ ofType: null;
6105
+ };
6106
+ defaultValue: null;
6107
+ }, {
5938
6108
  name: 'fbc';
5939
6109
  type: {
5940
6110
  kind: 'SCALAR';
@@ -5976,6 +6146,36 @@ export type introspection_types = {
5976
6146
  name: 'MenuItemTypeEnum';
5977
6147
  enumValues: 'ARTICLE' | 'BLOG' | 'COLLECTION' | 'HTTP' | 'PAGE' | 'POLICY' | 'PRODUCT';
5978
6148
  };
6149
+ 'MetafieldKeyInput': {
6150
+ kind: 'INPUT_OBJECT';
6151
+ name: 'MetafieldKeyInput';
6152
+ isOneOf: false;
6153
+ inputFields: [{
6154
+ name: 'key';
6155
+ type: {
6156
+ kind: 'NON_NULL';
6157
+ name: never;
6158
+ ofType: {
6159
+ kind: 'SCALAR';
6160
+ name: 'String';
6161
+ ofType: null;
6162
+ };
6163
+ };
6164
+ defaultValue: null;
6165
+ }, {
6166
+ name: 'namespace';
6167
+ type: {
6168
+ kind: 'NON_NULL';
6169
+ name: never;
6170
+ ofType: {
6171
+ kind: 'SCALAR';
6172
+ name: 'String';
6173
+ ofType: null;
6174
+ };
6175
+ };
6176
+ defaultValue: null;
6177
+ }];
6178
+ };
5979
6179
  'MetaobjectDefinitionFilter': {
5980
6180
  kind: 'INPUT_OBJECT';
5981
6181
  name: 'MetaobjectDefinitionFilter';
@@ -6294,6 +6494,14 @@ export type introspection_types = {
6294
6494
  ofType: null;
6295
6495
  };
6296
6496
  };
6497
+ 'downloadGrantConsume': {
6498
+ name: 'downloadGrantConsume';
6499
+ type: {
6500
+ kind: 'OBJECT';
6501
+ name: 'DownloadGrantConsumePayload';
6502
+ ofType: null;
6503
+ };
6504
+ };
6297
6505
  'draftOrderInvoiceComplete': {
6298
6506
  name: 'draftOrderInvoiceComplete';
6299
6507
  type: {
@@ -7293,6 +7501,14 @@ export type introspection_types = {
7293
7501
  };
7294
7502
  };
7295
7503
  };
7504
+ 'downloadGrant': {
7505
+ name: 'downloadGrant';
7506
+ type: {
7507
+ kind: 'OBJECT';
7508
+ name: 'DownloadGrant';
7509
+ ofType: null;
7510
+ };
7511
+ };
7296
7512
  'draftOrderInvoice': {
7297
7513
  name: 'draftOrderInvoice';
7298
7514
  type: {
@@ -9553,6 +9769,26 @@ export type introspection_types = {
9553
9769
  };
9554
9770
  };
9555
9771
  };
9772
+ 'metafield': {
9773
+ name: 'metafield';
9774
+ type: {
9775
+ kind: 'OBJECT';
9776
+ name: 'ShopMetafield';
9777
+ ofType: null;
9778
+ };
9779
+ };
9780
+ 'metafields': {
9781
+ name: 'metafields';
9782
+ type: {
9783
+ kind: 'NON_NULL';
9784
+ name: never;
9785
+ ofType: {
9786
+ kind: 'OBJECT';
9787
+ name: 'ShopMetafieldConnection';
9788
+ ofType: null;
9789
+ };
9790
+ };
9791
+ };
9556
9792
  'publishedAt': {
9557
9793
  name: 'publishedAt';
9558
9794
  type: {
@@ -9833,6 +10069,26 @@ export type introspection_types = {
9833
10069
  };
9834
10070
  };
9835
10071
  };
10072
+ 'metafield': {
10073
+ name: 'metafield';
10074
+ type: {
10075
+ kind: 'OBJECT';
10076
+ name: 'ShopMetafield';
10077
+ ofType: null;
10078
+ };
10079
+ };
10080
+ 'metafields': {
10081
+ name: 'metafields';
10082
+ type: {
10083
+ kind: 'NON_NULL';
10084
+ name: never;
10085
+ ofType: {
10086
+ kind: 'OBJECT';
10087
+ name: 'ShopMetafieldConnection';
10088
+ ofType: null;
10089
+ };
10090
+ };
10091
+ };
9836
10092
  'tags': {
9837
10093
  name: 'tags';
9838
10094
  type: {
@@ -10617,6 +10873,18 @@ export type introspection_types = {
10617
10873
  ofType: null;
10618
10874
  };
10619
10875
  };
10876
+ 'emailRequired': {
10877
+ name: 'emailRequired';
10878
+ type: {
10879
+ kind: 'NON_NULL';
10880
+ name: never;
10881
+ ofType: {
10882
+ kind: 'SCALAR';
10883
+ name: 'Boolean';
10884
+ ofType: null;
10885
+ };
10886
+ };
10887
+ };
10620
10888
  'enteredDiscountCode': {
10621
10889
  name: 'enteredDiscountCode';
10622
10890
  type: {
@@ -11241,6 +11509,26 @@ export type introspection_types = {
11241
11509
  ofType: null;
11242
11510
  };
11243
11511
  };
11512
+ 'metafield': {
11513
+ name: 'metafield';
11514
+ type: {
11515
+ kind: 'OBJECT';
11516
+ name: 'ShopMetafield';
11517
+ ofType: null;
11518
+ };
11519
+ };
11520
+ 'metafields': {
11521
+ name: 'metafields';
11522
+ type: {
11523
+ kind: 'NON_NULL';
11524
+ name: never;
11525
+ ofType: {
11526
+ kind: 'OBJECT';
11527
+ name: 'ShopMetafieldConnection';
11528
+ ofType: null;
11529
+ };
11530
+ };
11531
+ };
11244
11532
  'priceRange': {
11245
11533
  name: 'priceRange';
11246
11534
  type: {
@@ -14390,6 +14678,18 @@ export type introspection_types = {
14390
14678
  };
14391
14679
  };
14392
14680
  };
14681
+ 'downloadsAwaitingRelease': {
14682
+ name: 'downloadsAwaitingRelease';
14683
+ type: {
14684
+ kind: 'NON_NULL';
14685
+ name: never;
14686
+ ofType: {
14687
+ kind: 'SCALAR';
14688
+ name: 'Boolean';
14689
+ ofType: null;
14690
+ };
14691
+ };
14692
+ };
14393
14693
  'email': {
14394
14694
  name: 'email';
14395
14695
  type: {
@@ -14430,6 +14730,18 @@ export type introspection_types = {
14430
14730
  };
14431
14731
  };
14432
14732
  };
14733
+ 'hasDownloads': {
14734
+ name: 'hasDownloads';
14735
+ type: {
14736
+ kind: 'NON_NULL';
14737
+ name: never;
14738
+ ofType: {
14739
+ kind: 'SCALAR';
14740
+ name: 'Boolean';
14741
+ ofType: null;
14742
+ };
14743
+ };
14744
+ };
14433
14745
  'id': {
14434
14746
  name: 'id';
14435
14747
  type: {
@@ -14776,6 +15088,26 @@ export type introspection_types = {
14776
15088
  };
14777
15089
  };
14778
15090
  };
15091
+ 'downloads': {
15092
+ name: 'downloads';
15093
+ type: {
15094
+ kind: 'NON_NULL';
15095
+ name: never;
15096
+ ofType: {
15097
+ kind: 'LIST';
15098
+ name: never;
15099
+ ofType: {
15100
+ kind: 'NON_NULL';
15101
+ name: never;
15102
+ ofType: {
15103
+ kind: 'OBJECT';
15104
+ name: 'DownloadGrant';
15105
+ ofType: null;
15106
+ };
15107
+ };
15108
+ };
15109
+ };
15110
+ };
14779
15111
  'giftCard': {
14780
15112
  name: 'giftCard';
14781
15113
  type: {
@@ -15070,6 +15402,18 @@ export type introspection_types = {
15070
15402
  ofType: null;
15071
15403
  };
15072
15404
  };
15405
+ 'downloadsAwaitingRelease': {
15406
+ name: 'downloadsAwaitingRelease';
15407
+ type: {
15408
+ kind: 'NON_NULL';
15409
+ name: never;
15410
+ ofType: {
15411
+ kind: 'SCALAR';
15412
+ name: 'Boolean';
15413
+ ofType: null;
15414
+ };
15415
+ };
15416
+ };
15073
15417
  'financialStatus': {
15074
15418
  name: 'financialStatus';
15075
15419
  type: {
@@ -15262,6 +15606,26 @@ export type introspection_types = {
15262
15606
  };
15263
15607
  };
15264
15608
  };
15609
+ 'downloads': {
15610
+ name: 'downloads';
15611
+ type: {
15612
+ kind: 'NON_NULL';
15613
+ name: never;
15614
+ ofType: {
15615
+ kind: 'LIST';
15616
+ name: never;
15617
+ ofType: {
15618
+ kind: 'NON_NULL';
15619
+ name: never;
15620
+ ofType: {
15621
+ kind: 'OBJECT';
15622
+ name: 'DownloadGrant';
15623
+ ofType: null;
15624
+ };
15625
+ };
15626
+ };
15627
+ };
15628
+ };
15265
15629
  'lineGroup': {
15266
15630
  name: 'lineGroup';
15267
15631
  type: {
@@ -15452,6 +15816,26 @@ export type introspection_types = {
15452
15816
  };
15453
15817
  };
15454
15818
  };
15819
+ 'metafield': {
15820
+ name: 'metafield';
15821
+ type: {
15822
+ kind: 'OBJECT';
15823
+ name: 'ShopMetafield';
15824
+ ofType: null;
15825
+ };
15826
+ };
15827
+ 'metafields': {
15828
+ name: 'metafields';
15829
+ type: {
15830
+ kind: 'NON_NULL';
15831
+ name: never;
15832
+ ofType: {
15833
+ kind: 'OBJECT';
15834
+ name: 'ShopMetafieldConnection';
15835
+ ofType: null;
15836
+ };
15837
+ };
15838
+ };
15455
15839
  'publishedAt': {
15456
15840
  name: 'publishedAt';
15457
15841
  type: {
@@ -16254,16 +16638,12 @@ export type introspection_types = {
16254
16638
  };
16255
16639
  };
16256
16640
  };
16257
- 'price': {
16258
- name: 'price';
16641
+ 'priceRange': {
16642
+ name: 'priceRange';
16259
16643
  type: {
16260
- kind: 'NON_NULL';
16261
- name: never;
16262
- ofType: {
16263
- kind: 'SCALAR';
16264
- name: 'Float';
16265
- ofType: null;
16266
- };
16644
+ kind: 'OBJECT';
16645
+ name: 'ShopProductPriceRange';
16646
+ ofType: null;
16267
16647
  };
16268
16648
  };
16269
16649
  'productType': {
@@ -16716,6 +17096,36 @@ export type introspection_types = {
16716
17096
  };
16717
17097
  };
16718
17098
  };
17099
+ 'ShopProductPriceRange': {
17100
+ kind: 'OBJECT';
17101
+ name: 'ShopProductPriceRange';
17102
+ fields: {
17103
+ 'maxVariantPrice': {
17104
+ name: 'maxVariantPrice';
17105
+ type: {
17106
+ kind: 'NON_NULL';
17107
+ name: never;
17108
+ ofType: {
17109
+ kind: 'OBJECT';
17110
+ name: 'Money';
17111
+ ofType: null;
17112
+ };
17113
+ };
17114
+ };
17115
+ 'minVariantPrice': {
17116
+ name: 'minVariantPrice';
17117
+ type: {
17118
+ kind: 'NON_NULL';
17119
+ name: never;
17120
+ ofType: {
17121
+ kind: 'OBJECT';
17122
+ name: 'Money';
17123
+ ofType: null;
17124
+ };
17125
+ };
17126
+ };
17127
+ };
17128
+ };
16719
17129
  'ShopProductReview': {
16720
17130
  kind: 'OBJECT';
16721
17131
  name: 'ShopProductReview';
@@ -17518,18 +17928,6 @@ export type introspection_types = {
17518
17928
  };
17519
17929
  };
17520
17930
  };
17521
- 'compareAt': {
17522
- name: 'compareAt';
17523
- type: {
17524
- kind: 'NON_NULL';
17525
- name: never;
17526
- ofType: {
17527
- kind: 'SCALAR';
17528
- name: 'Float';
17529
- ofType: null;
17530
- };
17531
- };
17532
- };
17533
17931
  'compareAtV2': {
17534
17932
  name: 'compareAtV2';
17535
17933
  type: {
@@ -17606,26 +18004,34 @@ export type introspection_types = {
17606
18004
  };
17607
18005
  };
17608
18006
  };
17609
- 'position': {
17610
- name: 'position';
18007
+ 'metafield': {
18008
+ name: 'metafield';
18009
+ type: {
18010
+ kind: 'OBJECT';
18011
+ name: 'ShopMetafield';
18012
+ ofType: null;
18013
+ };
18014
+ };
18015
+ 'metafields': {
18016
+ name: 'metafields';
17611
18017
  type: {
17612
18018
  kind: 'NON_NULL';
17613
18019
  name: never;
17614
18020
  ofType: {
17615
- kind: 'SCALAR';
17616
- name: 'Int';
18021
+ kind: 'OBJECT';
18022
+ name: 'ShopMetafieldConnection';
17617
18023
  ofType: null;
17618
18024
  };
17619
18025
  };
17620
18026
  };
17621
- 'price': {
17622
- name: 'price';
18027
+ 'position': {
18028
+ name: 'position';
17623
18029
  type: {
17624
18030
  kind: 'NON_NULL';
17625
18031
  name: never;
17626
18032
  ofType: {
17627
18033
  kind: 'SCALAR';
17628
- name: 'Float';
18034
+ name: 'Int';
17629
18035
  ofType: null;
17630
18036
  };
17631
18037
  };
package/dist/graphql.js CHANGED
@@ -16,6 +16,7 @@ let mintHoldError = null;
16
16
  const MINT_FAILURE_HOLD_MS = 2e3;
17
17
  const MINT_THROTTLE_FALLBACK_HOLD_MS = 15e3;
18
18
  const MINT_HOLD_MAX_MS = 6e4;
19
+ const GRAPHQL_TIMEOUT_MS = 8e3;
19
20
  var MintError = class extends Error {
20
21
  holdMs;
21
22
  constructor(message, holdMs) {
@@ -157,7 +158,11 @@ function invalidateToken(used) {
157
158
  if (cached?.accessToken === used) cached = null;
158
159
  }
159
160
  async function executeSingle(document, variables, options, trace) {
160
- const send = async (token) => await buildClient(bearerHeaders(token, options, trace)).request(document, variables);
161
+ const send = async (token) => await buildClient(bearerHeaders(token, options, trace)).request({
162
+ document,
163
+ variables,
164
+ signal: AbortSignal.timeout(GRAPHQL_TIMEOUT_MS)
165
+ });
161
166
  const token = await getToken();
162
167
  try {
163
168
  return await send(token);
@@ -236,7 +241,8 @@ async function executeBatchChunk(chunk, options, trace) {
236
241
  "Content-Type": "application/json",
237
242
  ...bearerHeaders(token, options, trace)
238
243
  },
239
- body
244
+ body,
245
+ signal: AbortSignal.timeout(GRAPHQL_TIMEOUT_MS)
240
246
  }));
241
247
  if (!res.ok) throw batchClientError({
242
248
  status: res.status,
@@ -1,13 +1,15 @@
1
1
  //#region src/marketing-cookies.d.ts
2
- /** Attribution ids read off the request cookies. A key is absent, never empty. */
2
+ /** Attribution read off the request cookies. A key is absent, never empty. */
3
3
  export interface MarketingCookies {
4
4
  fbp?: string;
5
5
  fbc?: string;
6
+ /** Every allowlisted cookie as `name=value; …`, for Rails to parse. */
7
+ cookies?: string;
6
8
  }
7
9
  /**
8
- * Parse `_fbp` / `_fbc` out of a raw `Cookie` header. Returns `{}` when the
9
- * header is missing or carries neither — the caller then sends no attribution at
10
- * all rather than a hash of nulls.
10
+ * Parse the attribution cookies out of a raw `Cookie` header. Returns `{}` when
11
+ * the header is missing or carries none — the caller then sends no attribution
12
+ * at all rather than a hash of nulls.
11
13
  */
12
14
  export declare function parseMarketingCookies(cookie: string | null | undefined): MarketingCookies;
13
15
  //#endregion