@shoplygg/node 0.11.5 → 0.12.1

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.
@@ -298,6 +298,7 @@ export type StoreEmailSettingsResult = {
298
298
  emailResellersEnabled: boolean;
299
299
  emailPaymentSetupEnabled: boolean;
300
300
  emailDiscordSetupEnabled: boolean;
301
+ emailDomainEnabled: boolean;
301
302
  emailDisputeOpenedEnabled: boolean;
302
303
  emailDisputeClosedEnabled: boolean;
303
304
  testEmailEvery: {
@@ -392,6 +393,7 @@ export type PaymentMethodsListResult = Array<{
392
393
  }>;
393
394
  unpaidHours: unknown;
394
395
  updatedAt: unknown;
396
+ version: unknown;
395
397
  }>;
396
398
 
397
399
  /** What switch a payment method on or off takes: `paymentMethods.setEnabled`. */
@@ -467,6 +469,7 @@ export type PaymentMethodsSetBalanceResult = Array<{
467
469
  }>;
468
470
  unpaidHours: unknown;
469
471
  updatedAt: unknown;
472
+ version: unknown;
470
473
  }>;
471
474
 
472
475
  /** What set how long an unpaid order is kept takes: `paymentMethods.setUnpaidHours`. */
@@ -524,6 +527,7 @@ export type PaymentMethodsSetUnpaidHoursResult = Array<{
524
527
  }>;
525
528
  unpaidHours: unknown;
526
529
  updatedAt: string;
530
+ version: string;
527
531
  }>;
528
532
 
529
533
  /** What set a payment method's own time for an unpaid order takes: `paymentMethods.setMethodUnpaidHours`. */
@@ -581,6 +585,7 @@ export type PaymentMethodsSetMethodUnpaidHoursResult = Array<{
581
585
  }>;
582
586
  unpaidHours: number;
583
587
  updatedAt: string;
588
+ version: string;
584
589
  }>;
585
590
 
586
591
  /** What get the overview takes: `analytics.overview`. */
@@ -2524,6 +2529,7 @@ export type ProductsListItem = {
2524
2529
  maxQuantity: number;
2525
2530
  stock: number;
2526
2531
  keyCount: number;
2532
+ fileCount: number;
2527
2533
  deliveryMethods: string[];
2528
2534
  deliveryType: string;
2529
2535
  deliveryInstructions: string;
@@ -2732,6 +2738,7 @@ export type ProductsCreateResult = {
2732
2738
  maxQuantity: number;
2733
2739
  stock: number;
2734
2740
  keyCount: number;
2741
+ fileCount: number;
2735
2742
  deliveryMethods: string[];
2736
2743
  deliveryType: string;
2737
2744
  deliveryInstructions: string;
@@ -2802,6 +2809,7 @@ export type ProductsShowResult = {
2802
2809
  maxQuantity: number;
2803
2810
  stock: number;
2804
2811
  keyCount: number;
2812
+ fileCount: number;
2805
2813
  deliveryMethods: string[];
2806
2814
  deliveryType: string;
2807
2815
  deliveryInstructions: string;
@@ -3012,6 +3020,7 @@ export type ProductsUpdateResult = {
3012
3020
  maxQuantity: number;
3013
3021
  stock: number;
3014
3022
  keyCount: number;
3023
+ fileCount: number;
3015
3024
  deliveryMethods: string[];
3016
3025
  deliveryType: string;
3017
3026
  deliveryInstructions: string;
@@ -3129,6 +3138,12 @@ export type StockListKeysItem = {
3129
3138
  export interface StockAddKeysParams {
3130
3139
  /** The keys, one an entry, each up to 500 characters with no line break in it. */
3131
3140
  keys: string[];
3141
+ /**
3142
+ * What to do with a key that would go to more than one buyer. `ask` refuses the request with `duplicate_keys`.
3143
+ *
3144
+ * Left out, it is "ask".
3145
+ */
3146
+ duplicates?: "ask" | "skip" | "keep";
3132
3147
  }
3133
3148
 
3134
3149
  /** What add license keys answers: `stock.addKeys`. */
@@ -3136,6 +3151,7 @@ export type StockAddKeysResult = {
3136
3151
  added: number;
3137
3152
  skipped: number;
3138
3153
  duplicates: number;
3154
+ leftOut: number;
3139
3155
  available: number;
3140
3156
  };
3141
3157
 
@@ -3145,6 +3161,14 @@ export interface StockReplaceKeysParams {
3145
3161
  keys: string[];
3146
3162
  /** How many unsold keys you last read. Sent, the change is refused with `stale_write` if that number has changed, so a key sold in the meantime is not put back. */
3147
3163
  expectedAvailable?: number;
3164
+ /** The `stock` a list of the variant's keys answered beside its first page, read with no search (in `meta`). Sent, the change is refused with `stale_write` if any of those keys was sold or removed, or another added, since: a sale and an addition together leave the count the same. */
3165
+ expectedStock?: string;
3166
+ /**
3167
+ * What to do with a key that would go to more than one buyer. `ask` refuses the request with `duplicate_keys`.
3168
+ *
3169
+ * Left out, it is "ask".
3170
+ */
3171
+ duplicates?: "ask" | "skip" | "keep";
3148
3172
  }
3149
3173
 
3150
3174
  /** What replace a variant's license keys answers: `stock.replaceKeys`. */
@@ -3182,6 +3206,17 @@ export type StockAddFileResult = unknown;
3182
3206
  /** What finish a file upload answers: `stock.finishFile`. */
3183
3207
  export type StockFinishFileResult = unknown;
3184
3208
 
3209
+ /** What start replacing a file takes: `stock.replaceFile`. */
3210
+ export interface StockReplaceFileParams {
3211
+ /** The new version's name, with its ending. Buyers download it under this name from then on. */
3212
+ name: string;
3213
+ /** Its size in bytes. */
3214
+ size: number;
3215
+ }
3216
+
3217
+ /** What start replacing a file answers: `stock.replaceFile`. */
3218
+ export type StockReplaceFileResult = unknown;
3219
+
3185
3220
  /** What delete a file answers: `stock.deleteFile`. */
3186
3221
  export type StockDeleteFileResult = unknown;
3187
3222
 
@@ -3618,6 +3653,8 @@ export interface UpsellsUpdateParams {
3618
3653
  * Left out, it is true.
3619
3654
  */
3620
3655
  enabled?: boolean;
3656
+ /** The `updatedAt` you last read. Sent, the change is refused with `stale_write` if the record has changed since. Left out, it is saved whatever happened in between. */
3657
+ expectedUpdatedAt?: string;
3621
3658
  }
3622
3659
 
3623
3660
  /** What update an upsell answers: `upsells.update`. */
@@ -3810,6 +3847,8 @@ export interface SubscriptionsUpdateSettingsParams {
3810
3847
  cardChangeOn?: boolean;
3811
3848
  /** How many times a declined card is tried, one a day while the grace days last, from 1 to 5. */
3812
3849
  chargeTries?: number;
3850
+ /** The settings' `version` you last read. Sent, the change is refused with `stale_write` if any of them has changed since. Left out, it is saved whatever happened in between. */
3851
+ expectedVersion?: string;
3813
3852
  }
3814
3853
 
3815
3854
  /** What change subscription settings answers: `subscriptions.updateSettings`. */
@@ -3855,6 +3894,8 @@ export interface SubscriptionsSavePlansParams {
3855
3894
  /** What it renews by. */
3856
3895
  unit: "day" | "week" | "month" | "year";
3857
3896
  }>;
3897
+ /** For a change to one option that is a plan already: that plan's `version` you last read. Sent, the change is refused with `stale_write` if the plan has changed since. Left out, it is saved whatever happened in between. */
3898
+ expectedVersion?: string;
3858
3899
  }
3859
3900
 
3860
3901
  /** What sell options as subscriptions answers: `subscriptions.savePlans`. */
@@ -4389,6 +4430,7 @@ export type OrdersShowResult = {
4389
4430
  available: boolean;
4390
4431
  why: string;
4391
4432
  };
4433
+ subscription: unknown;
4392
4434
  };
4393
4435
  productSlug: string;
4394
4436
  imageUrl: unknown;
@@ -4459,6 +4501,12 @@ export interface OrdersRefundParams {
4459
4501
  reason: "requested" | "duplicate" | "fraudulent" | "other";
4460
4502
  /** For `balance` only: how much to credit, from 0.01 up to what was paid, with at most 2 decimals. Left out, all of it. */
4461
4503
  amount?: number;
4504
+ /**
4505
+ * Also cancel the running subscription this order started or renews, now, once the refund has gone through. Needs the `subscriptions.write` permission as well, asked before anything is refunded. `subscriptionCancelled` in the answer says whether one was.
4506
+ *
4507
+ * Left out, it is false.
4508
+ */
4509
+ cancelSubscription?: boolean;
4462
4510
  }
4463
4511
 
4464
4512
  /** What refund an order answers: `orders.refund`. */
@@ -4466,6 +4514,7 @@ export type OrdersRefundResult = {
4466
4514
  id: string;
4467
4515
  status: string;
4468
4516
  destination: string;
4517
+ subscriptionCancelled: boolean;
4469
4518
  };
4470
4519
 
4471
4520
  /** What deliver an order again takes: `orders.redeliver`. */
@@ -5096,6 +5145,8 @@ export interface CouponCategoriesUpdateParams {
5096
5145
  name: string;
5097
5146
  /** A note for whoever manages the store. */
5098
5147
  description?: string;
5148
+ /** The `updatedAt` you last read. Sent, the change is refused with `stale_write` if the record has changed since. Left out, it is saved whatever happened in between. */
5149
+ expectedUpdatedAt?: string;
5099
5150
  }
5100
5151
 
5101
5152
  /** What update a coupon category answers: `couponCategories.update`. */
@@ -5179,6 +5230,8 @@ export interface CouponPopupUpdateParams {
5179
5230
  * Left out, it is "visit".
5180
5231
  */
5181
5232
  frequency?: "page" | "visit" | "browser";
5233
+ /** The `updatedAt` you last read. Sent, the change is refused with `stale_write` if the record has changed since. Left out, it is saved whatever happened in between. */
5234
+ expectedUpdatedAt?: string;
5182
5235
  }
5183
5236
 
5184
5237
  /** What update the coupon pop-up answers: `couponPopup.update`. */
@@ -5382,6 +5435,8 @@ export interface SalesUpdateParams {
5382
5435
  * Left out, it is true.
5383
5436
  */
5384
5437
  showBar?: boolean;
5438
+ /** The `updatedAt` you last read. Sent, the change is refused with `stale_write` if the record has changed since. Left out, it is saved whatever happened in between. */
5439
+ expectedUpdatedAt?: string;
5385
5440
  }
5386
5441
 
5387
5442
  /** What update a sale answers: `sales.update`. */
@@ -6296,6 +6351,7 @@ export type EmailTemplatesShowResult = {
6296
6351
  css: unknown;
6297
6352
  subject: unknown;
6298
6353
  updatedAt: unknown;
6354
+ version: string;
6299
6355
  shared: unknown;
6300
6356
  baseCss: string;
6301
6357
  accent: string;
@@ -6309,6 +6365,8 @@ export interface EmailTemplatesUpdateParams {
6309
6365
  css?: string;
6310
6366
  /** Its subject, or null for the original. */
6311
6367
  subject?: string;
6368
+ /** The `version` you read. Sent, the change is refused with `stale_write` if its HTML, CSS or subject has changed since, a subject set by Change Cart Recovery or Change Win-Back included. Use it rather than `expectedUpdatedAt`, which neither of those moves. */
6369
+ expectedVersion?: string;
6312
6370
  /** The `updatedAt` you read; a template changed since is refused with `stale_write`. */
6313
6371
  expectedUpdatedAt?: string;
6314
6372
  }
@@ -6336,6 +6394,7 @@ export type EmailTemplatesUpdateResult = {
6336
6394
  css: string;
6337
6395
  subject: string;
6338
6396
  updatedAt: string;
6397
+ version: string;
6339
6398
  shared: unknown;
6340
6399
  baseCss: string;
6341
6400
  accent: string;
@@ -6408,6 +6467,7 @@ export type EmailTemplatesRevertResult = {
6408
6467
  css: unknown;
6409
6468
  subject: unknown;
6410
6469
  updatedAt: unknown;
6470
+ version: string;
6411
6471
  shared: unknown;
6412
6472
  baseCss: string;
6413
6473
  accent: string;
@@ -7571,15 +7631,12 @@ export interface TeamActivityParams {
7571
7631
  export type TeamActivityItem = {
7572
7632
  id: string;
7573
7633
  userId: string;
7574
- name: string;
7634
+ name: unknown;
7575
7635
  email: string;
7576
- team: string;
7636
+ team: unknown;
7577
7637
  area: string;
7578
7638
  summary: string;
7579
- subject: {
7580
- kind: string;
7581
- id: string;
7582
- };
7639
+ subject: unknown;
7583
7640
  at: string;
7584
7641
  };
7585
7642
 
@@ -7810,12 +7867,15 @@ export type ResellerProductsListResult = {
7810
7867
  dailyCap: number;
7811
7868
  maxDiscount: unknown;
7812
7869
  enabled: boolean;
7870
+ held: boolean;
7813
7871
  }[];
7814
7872
 
7815
7873
  /** What sell products on the panel takes: `resellerProducts.save`. */
7816
7874
  export interface ResellerProductsSaveParams {
7817
7875
  /** One a product option: `variantId`; `price`, its Reseller Price, above 0 and up to 1,000,000; `minQty`, the fewest bought at once, 1 to 1,000 (1 when left out); `dailyCap`, the most one reseller may buy of it in a day, or null for no cap; `maxDiscount`, the most off it in percent, or null for no limit (left out, as it was); `enabled`, whether it is on sale (true when left out). */
7818
7876
  rows: Record<string, unknown>[];
7877
+ /** The `version` of the panel's products you last read. Sent, the change is refused with `stale_write` if a row has changed since. Left out, it is saved whatever happened in between. */
7878
+ expectedVersion?: string;
7819
7879
  }
7820
7880
 
7821
7881
  /** What sell products on the panel answers: `resellerProducts.save`. */
@@ -7832,6 +7892,7 @@ export type ResellerProductsSaveResult = {
7832
7892
  dailyCap: number;
7833
7893
  maxDiscount: unknown;
7834
7894
  enabled: boolean;
7895
+ held: boolean;
7835
7896
  }[];
7836
7897
 
7837
7898
  /** What list what the panel can sell answers: `resellerProducts.pickable`. */
@@ -7857,7 +7918,7 @@ export interface ResellerProductsBadgesParams {
7857
7918
 
7858
7919
  /** What set a product's status and labels on the panel answers: `resellerProducts.badges`. */
7859
7920
  export type ResellerProductsBadgesResult = {
7860
- "7502259b-6fc7-41f3-9052-c8675b99433a": {
7921
+ "e4d31280-6335-4561-8cd8-312acfcdde7f": {
7861
7922
  label: string;
7862
7923
  color: string;
7863
7924
  kind: string;
@@ -7898,6 +7959,8 @@ export interface ResellerTiersUpdateParams {
7898
7959
  name: string;
7899
7960
  /** What it takes off every Reseller Price, in percent: 0.01 to 99.99. */
7900
7961
  discount: number;
7962
+ /** The tier's `version` you last read. Sent, the change is refused with `stale_write` if it has changed since. Left out, it is saved whatever happened in between. */
7963
+ expectedVersion?: string;
7901
7964
  }
7902
7965
 
7903
7966
  /** What update a tier answers: `resellerTiers.update`. */
@@ -11480,6 +11543,7 @@ export type RequestsShowResult = {
11480
11543
  createdAt: string;
11481
11544
  requestBody: unknown;
11482
11545
  responseBody: string;
11546
+ bodiesWithheld: boolean;
11483
11547
  };
11484
11548
 
11485
11549
  /** What list webhook endpoints answers: `webhooks.list`. */
@@ -11495,6 +11559,7 @@ export type WebhooksListResult = Array<{
11495
11559
  lastStatus: unknown;
11496
11560
  dateCreated: string;
11497
11561
  updatedAt: string;
11562
+ version: string;
11498
11563
  recentDeliveries: unknown[] | Record<string, unknown>;
11499
11564
  }>;
11500
11565
 
@@ -11521,6 +11586,7 @@ export type WebhooksCreateResult = {
11521
11586
  lastStatus: unknown;
11522
11587
  dateCreated: string;
11523
11588
  updatedAt: string;
11589
+ version: string;
11524
11590
  secret: string;
11525
11591
  };
11526
11592
 
@@ -11537,6 +11603,7 @@ export type WebhooksShowResult = {
11537
11603
  lastStatus: unknown;
11538
11604
  dateCreated: string;
11539
11605
  updatedAt: string;
11606
+ version: string;
11540
11607
  };
11541
11608
 
11542
11609
  /** What update a webhook endpoint takes: `webhooks.update`. */
@@ -11549,6 +11616,8 @@ export interface WebhooksUpdateParams {
11549
11616
  description?: string;
11550
11617
  /** Whether events are sent to it. Switched off, nothing is sent, and what happens meanwhile is not kept for it. */
11551
11618
  enabled?: boolean;
11619
+ /** The endpoint's `version` you last read. Sent, the change is refused with `stale_write` if its address, events, note or switch has changed since. Left out, it is saved whatever happened in between. */
11620
+ expectedVersion?: string;
11552
11621
  }
11553
11622
 
11554
11623
  /** What update a webhook endpoint answers: `webhooks.update`. */
@@ -11564,6 +11633,7 @@ export type WebhooksUpdateResult = {
11564
11633
  lastStatus: unknown;
11565
11634
  dateCreated: string;
11566
11635
  updatedAt: string;
11636
+ version: string;
11567
11637
  };
11568
11638
 
11569
11639
  /** What delete a webhook endpoint answers: `webhooks.delete`. */
@@ -12832,7 +12902,7 @@ export interface ShoplyResourcesStorefronts {
12832
12902
  /**
12833
12903
  * **Publish a storefront's code**
12834
12904
  *
12835
- * Puts the draft live, its files and its design together, and makes this storefront the one buyers see, as Publish in the code studio does. Send `rev` and `version` from "Get a storefront's code" as you last read it: if either has moved since (somebody saved in the meantime) it is refused with `draft_conflict`, so you never publish what you have not seen. A mistake in a template refuses it with `code_problems`, the mistakes listed in `problems`.
12905
+ * Puts the draft live, its files and its design together, and makes this storefront the one buyers see, as Publish in the code studio does. Send `rev` and `version` from "Get a storefront's code" as you last read it: if either has moved since (somebody saved in the meantime) it is refused with `draft_conflict`, so you never publish what you have not seen. A mistake in a template refuses it with `code_problems`, the mistakes listed in `problems`. Making another storefront the one buyers see is the owner's: a key or a CLI sign-in somebody on the store's team made publishes only the storefront that is live already, and is refused another with `team_permission`.
12836
12906
  *
12837
12907
  * Needs the `storefronts.write` permission (Change Storefronts).
12838
12908
  *
@@ -13073,7 +13143,7 @@ export interface ShoplyResourcesProducts {
13073
13143
  /**
13074
13144
  * **Update a product**
13075
13145
  *
13076
- * Saves the product whole, as its editor does: send every field as it should be. `variants` is the complete list. An entry with an `id` changes that variant, an entry without one is added, and a variant left out is removed with its unsold stock. A variant buyers have received license keys from cannot be removed.
13146
+ * Saves the product whole, as its editor does: send every field as it should be. `variants` is the complete list. An entry with an `id` changes that variant, an entry without one is added, and a variant left out is removed with its unsold stock, which needs the `stock.write` permission as well where it holds unsold keys or files. Buyers keep what they paid for: the keys delivered to them stay with their orders, and the files they bought stay on their orders to download.
13077
13147
  *
13078
13148
  * Read the product first and send it back changed. The fields that say "stay as they are" are the only ones that may be left out.
13079
13149
  *
@@ -13085,7 +13155,7 @@ export interface ShoplyResourcesProducts {
13085
13155
  /**
13086
13156
  * **Delete a product**
13087
13157
  *
13088
- * Removes the product with its variants, pictures and unsold stock. Refused for a product buyers have received license keys from, since those keys are part of their orders: set its visibility to `private` instead.
13158
+ * Removes the product with its variants, pictures and unsold stock, which needs the `stock.write` permission as well where it holds unsold keys or files. Buyers keep what they paid for: the keys delivered to them stay with their orders, and the files they bought stay on their orders to download.
13089
13159
  *
13090
13160
  * Needs the `products.write` permission (Change Products).
13091
13161
  *
@@ -13125,7 +13195,7 @@ export interface ShoplyResourcesProducts {
13125
13195
  /**
13126
13196
  * **Delete many products**
13127
13197
  *
13128
- * Deletes each product as deleting one does. A product buyers have received license keys from is kept, and the answer names the ones that stayed.
13198
+ * Deletes each product as deleting one does, and none of them without the `stock.write` permission where any holds unsold keys or files. `kept` in the answer is always empty: nothing is kept since November 24, 2026.
13129
13199
  *
13130
13200
  * Needs the `products.write` permission (Change Products).
13131
13201
  *
@@ -13183,7 +13253,7 @@ export interface ShoplyResourcesStock {
13183
13253
  *
13184
13254
  * Adds license keys to a variant's stock, up to 5,000 in one request. A variant and a store each hold as many unsold keys as the store's plan does.
13185
13255
  *
13186
- * A key sent twice is stocked twice, which is how one key is sold to several buyers. `duplicates` in the answer counts the ones that matched stock the variant already had, so sending the same batch a second time by mistake shows.
13256
+ * A key that would go to more than one buyer is a duplicate: one the variant delivered before, one it has in stock, or one sent twice in the same request. A request with any is refused with `duplicate_keys`, which counts each kind (`sold`, `inStock`, `repeated`), and nothing is added, unless `duplicates` says what to do. `skip` adds the rest and leaves them out; `keep` stocks every one, which is how one key is sold to several buyers. In the answer, `duplicates` counts the ones stocked and `leftOut` the ones left out.
13187
13257
  *
13188
13258
  * Needs the `stock.write` permission (Change Stock).
13189
13259
  *
@@ -13195,6 +13265,8 @@ export interface ShoplyResourcesStock {
13195
13265
  *
13196
13266
  * Makes the variant's unsold stock exactly the keys sent. Keys already delivered are not touched: they are order history, not stock. Up to 5,000 keys, and only for a variant with no more than that in stock: one with more is refused with `validation_error`, and its keys are added and deleted instead.
13197
13267
  *
13268
+ * A key the variant delivered before, or one sent twice, would go to more than one buyer, and is refused with `duplicate_keys` as Add license keys refuses it, unless `duplicates` says `skip` or `keep`. A key that is in the stock being replaced is not one.
13269
+ *
13198
13270
  * Needs the `stock.write` permission (Change Stock).
13199
13271
  *
13200
13272
  * @see https://docs.shoply.gg/api-reference/stock/replace-a-variants-license-keys
@@ -13245,17 +13317,29 @@ export interface ShoplyResourcesStock {
13245
13317
  /**
13246
13318
  * **Finish a file upload**
13247
13319
  *
13248
- * The last step of adding a file: says the file has been sent. Shoply checks it arrived and is the size that was said, and from then on buyers of the variant receive it.
13320
+ * The last step of adding a file: says the file has been sent. Shoply checks it arrived and is the size that was said, and from then on buyers of the variant receive it. For a new version started with "Start replacing a file", the answer is the file it replaced, under that file's own `id`, now with the new version's name and size.
13249
13321
  *
13250
13322
  * Needs the `stock.write` permission (Change Stock).
13251
13323
  *
13252
13324
  * @see https://docs.shoply.gg/api-reference/stock/finish-a-file-upload
13253
13325
  */
13254
13326
  finishFile(variantId: string, fileId: string, options?: RequestOptions): Promise<StockFinishFileResult>;
13327
+ /**
13328
+ * **Start replacing a file**
13329
+ *
13330
+ * The first of three steps to put a new version of a file in its place, the same three as adding one: this one says what the new version is and answers a signed address to send it to, then send it there with a `PUT`, then call "Finish a file upload" with the `id` this step answered.
13331
+ *
13332
+ * Once it is finished, everybody who bought the file downloads the new version, buyers of past orders too. The file keeps its own `id`, and every download link already sent goes on working. Until then they download the old one, so an upload that fails or is never finished changes nothing. It takes the old file's place rather than one more, so it counts against the variant's and the store's files as the old one did, and against the store's storage by the difference in size.
13333
+ *
13334
+ * Needs the `stock.write` permission (Change Stock).
13335
+ *
13336
+ * @see https://docs.shoply.gg/api-reference/stock/start-replacing-a-file
13337
+ */
13338
+ replaceFile(variantId: string, fileId: string, params: StockReplaceFileParams, options?: RequestOptions): Promise<StockReplaceFileResult>;
13255
13339
  /**
13256
13340
  * **Delete a file**
13257
13341
  *
13258
- * Removes a file from the variant. Buyers who already have a link to it can no longer download it.
13342
+ * Takes a file off the variant: buyers from now on are not sent it. Buyers who already paid for it keep downloading it, and it still counts against the store's file storage while they do. To give everybody a new version instead, use "Start replacing a file".
13259
13343
  *
13260
13344
  * Needs the `stock.write` permission (Change Stock).
13261
13345
  *
@@ -13613,6 +13697,8 @@ export interface ShoplyResourcesOrders {
13613
13697
  *
13614
13698
  * Send an `Idempotency-Key` with this request. The order is marked refunded only once the payment provider has said the money is on its way, or the buyer has been credited.
13615
13699
  *
13700
+ * A refund does not end a subscription the order started or renews: it carries on and renews as before, unless `cancelSubscription` says to cancel it too. Which subscription that is, while it is running, is `refund.subscription` on the order.
13701
+ *
13616
13702
  * Needs the `orders.refund` permission (Refund Orders).
13617
13703
  *
13618
13704
  * @see https://docs.shoply.gg/api-reference/orders/refund-an-order
@@ -14908,7 +14994,7 @@ export interface ShoplyResourcesTeam {
14908
14994
  /**
14909
14995
  * **List activity**
14910
14996
  *
14911
- * Who did what at the store on the dashboard, the newest first, fifty a page: each line's `summary` ("Refunded order ..."), who did it as they were then (`name`, `email`, `team`, which is null for the owner), its `area` of the dashboard, and what it was about (`subject`). Every change and every export is a line, the owner's included; what a key does is not, and is in List API requests. Kept 365 days.
14997
+ * Who did what at the store on the dashboard, the newest first, fifty a page: each line's `summary` ("Refunded order ..."), who did it as they were then (`name`, `email`, `team`, which is null for the owner), its `area` of the dashboard, and what it was about (`subject`). Every change and every export is a line, the owner's included. What a key does is not, and is in List API requests, except a change to the team, which is a line under whoever made the key, saying which key. Kept 365 days.
14912
14998
  *
14913
14999
  * Needs the `team.read` permission (Read the Team).
14914
15000
  *
@@ -14948,7 +15034,7 @@ export interface ShoplyResourcesTeam {
14948
15034
  /**
14949
15035
  * **Move somebody to another team**
14950
15036
  *
14951
- * They can do what the other team can from their next request. Not onto a team that holds a sensitive permission: do that on the dashboard.
15037
+ * They can do what the other team can from their next request. The API keys and CLI sign-ins a person on the team made lose what their team no longer holds, and are revoked when nothing is left or the team does not hold `dev.keys`; an app they connected is disconnected when the team does not hold all it was given, or `dev.apps`. Not onto a team that holds a sensitive permission: do that on the dashboard.
14952
15038
  *
14953
15039
  * Needs the `team.write` permission (Manage the Team).
14954
15040
  *
@@ -14958,7 +15044,7 @@ export interface ShoplyResourcesTeam {
14958
15044
  /**
14959
15045
  * **Remove somebody from the team**
14960
15046
  *
14961
- * They can no longer reach the store. The API keys they made and the apps they connected stop working with them (`keysStopped` says how many), and the webhooks those made are deleted.
15047
+ * They can no longer reach the store. The API keys they made and the apps they connected stop working with them (`keysStopped` says how many), the webhooks those made and the ones they added on the dashboard are deleted, and the invites they sent and nobody has taken up are cancelled.
14962
15048
  *
14963
15049
  * Needs the `team.write` permission (Manage the Team).
14964
15050
  *
@@ -14971,7 +15057,7 @@ export interface ShoplyResourcesTeams {
14971
15057
  /**
14972
15058
  * **Create a team**
14973
15059
  *
14974
- * A store holds as many teams as its plan does (`limits.teams` in Get the team). A permission marked `sensitive` that the team did not hold before cannot be given with a key: give it on the dashboard, which asks the person to confirm it is them.
15060
+ * A store holds as many teams as its plan does (`limits.teams` in Get the team). A key does this as whoever made it: a key somebody on the store's team made gives, takes away and changes only what their own team holds, as they can on the dashboard, and is refused with `team_beyond` otherwise. A permission marked `sensitive` that the team did not hold before cannot be given with a key: give it on the dashboard, which asks the person to confirm it is them.
14975
15061
  *
14976
15062
  * Needs the `team.write` permission (Manage the Team).
14977
15063
  *
@@ -14981,7 +15067,7 @@ export interface ShoplyResourcesTeams {
14981
15067
  /**
14982
15068
  * **Update a team**
14983
15069
  *
14984
- * Saves the team whole: its name and its permissions. Its people can do what it now holds from their next request. A permission marked `sensitive` that the team did not hold before cannot be given with a key: give it on the dashboard, which asks the person to confirm it is them.
15070
+ * Saves the team whole: its name and its permissions. Its people can do what it now holds from their next request. The API keys and CLI sign-ins a person on the team made lose what their team no longer holds, and are revoked when nothing is left or the team does not hold `dev.keys`; an app they connected is disconnected when the team does not hold all it was given, or `dev.apps`. A key does this as whoever made it: a key somebody on the store's team made gives, takes away and changes only what their own team holds, as they can on the dashboard, and is refused with `team_beyond` otherwise. A permission marked `sensitive` that the team did not hold before cannot be given with a key: give it on the dashboard, which asks the person to confirm it is them.
14985
15071
  *
14986
15072
  * Needs the `team.write` permission (Manage the Team).
14987
15073
  *
@@ -16148,7 +16234,7 @@ export interface ShoplyResourcesRequests {
16148
16234
  /**
16149
16235
  * **Get an API request**
16150
16236
  *
16151
- * One request, with what was sent and what came back. Long bodies are cut short, and values that are secrets or goods (a password, license keys going into stock) are not kept. A request's ID is the `X-Request-Id` header of its answer.
16237
+ * One request, with what was sent and what came back. Long bodies are cut short, and values that are secrets or goods (a password, license keys going into stock) are not kept. The two bodies are answered only to a key that holds the scope of what the request did, and `bodiesWithheld` is true where they were kept back. A request's ID is the `X-Request-Id` header of its answer.
16152
16238
  *
16153
16239
  * Needs the `logs.read` permission (Read API Requests).
16154
16240
  *
@@ -78,6 +78,7 @@ export const OPERATIONS = [
78
78
  {"id":"stock.listFiles","name":"stock.listFiles","method":"GET","path":"/stores/{storeId}/variants/{variantId}/files","params":["variantId"],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":false},
79
79
  {"id":"stock.addFile","name":"stock.addFile","method":"POST","path":"/stores/{storeId}/variants/{variantId}/files","params":["variantId"],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
80
80
  {"id":"stock.finishFile","name":"stock.finishFile","method":"POST","path":"/stores/{storeId}/variants/{variantId}/files/{fileId}/complete","params":["variantId","fileId"],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
81
+ {"id":"stock.replaceFile","name":"stock.replaceFile","method":"POST","path":"/stores/{storeId}/variants/{variantId}/files/{fileId}/replace","params":["variantId","fileId"],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
81
82
  {"id":"stock.deleteFile","name":"stock.deleteFile","method":"DELETE","path":"/stores/{storeId}/variants/{variantId}/files/{fileId}","params":["variantId","fileId"],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
82
83
  {"id":"categories.list","name":"categories.list","method":"GET","path":"/stores/{storeId}/categories","params":[],"query":["visibility"],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":false},
83
84
  {"id":"categories.create","name":"categories.create","method":"POST","path":"/stores/{storeId}/categories","params":[],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
package/index.js CHANGED
@@ -14,7 +14,7 @@
14
14
 
15
15
  import { EVENTS, OPERATIONS } from "./generated/operations.js";
16
16
 
17
- export const VERSION = "0.11.5";
17
+ export const VERSION = "0.12.1";
18
18
 
19
19
  const API = "https://api.shoply.gg/v1";
20
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shoplygg/node",
3
- "version": "0.11.5",
3
+ "version": "0.12.1",
4
4
  "description": "Shoply's API from your own server: every route as a typed method, safe retries, pages, checking webhooks, and OAuth for apps.",
5
5
  "keywords": ["shoply", "api", "sdk", "ecommerce", "webhooks", "digital-goods"],
6
6
  "homepage": "https://docs.shoply.gg/api-reference/node",