@shoplygg/node 0.4.0 → 0.5.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.
@@ -659,6 +659,7 @@ export type AnalyticsOverviewResult = {
659
659
  refunded: number;
660
660
  cancelled: number;
661
661
  chargeback: number;
662
+ imported: number;
662
663
  };
663
664
  statusTotals: {
664
665
  completed: {
@@ -681,6 +682,10 @@ export type AnalyticsOverviewResult = {
681
682
  orders: number;
682
683
  amount: number;
683
684
  };
685
+ imported: {
686
+ orders: number;
687
+ amount: number;
688
+ };
684
689
  };
685
690
  week: number[][];
686
691
  topCountries: {
@@ -2357,7 +2362,7 @@ export type CustomMethodsDeleteIconResult = unknown;
2357
2362
  /** What list products takes: `products.list`. */
2358
2363
  export interface ProductsListParams {
2359
2364
  /** Only products with this visibility. */
2360
- visibility?: "public" | "unlisted" | "private";
2365
+ visibility?: "public" | "unlisted" | "private" | "on_hold";
2361
2366
  /** Only products whose name contains this. */
2362
2367
  search?: string;
2363
2368
  }
@@ -2436,11 +2441,11 @@ export interface ProductsCreateParams {
2436
2441
  /** What the product page says. Plain text with a few marks: a line that starts with `#` is a heading, one that starts with `-` is a point of a list, a blank line ends a paragraph, and `**bold**` and backticks for code work inside a line. */
2437
2442
  description?: string;
2438
2443
  /**
2439
- * `public` is listed and can be bought. `unlisted` can be bought by whoever has its link. `private` cannot be bought.
2444
+ * `public` is listed and can be bought. `unlisted` can be bought by whoever has its link. `private` cannot be bought. `on_hold` is listed as a public product is and cannot be bought: its page says it is on hold, and every checkout refuses it.
2440
2445
  *
2441
2446
  * Left out, it is "public".
2442
2447
  */
2443
- visibility?: "public" | "unlisted" | "private";
2448
+ visibility?: "public" | "unlisted" | "private" | "on_hold";
2444
2449
  /** The product's options, 1 to 100 of them, in the order buyers see them. A variant of the product that is not in this list is removed. */
2445
2450
  variants: Array<{
2446
2451
  /** An existing variant's ID, to keep it and change it. Left out, the entry is a new variant. */
@@ -2696,11 +2701,11 @@ export interface ProductsUpdateParams {
2696
2701
  /** What the product page says. Plain text with a few marks: a line that starts with `#` is a heading, one that starts with `-` is a point of a list, a blank line ends a paragraph, and `**bold**` and backticks for code work inside a line. */
2697
2702
  description?: string;
2698
2703
  /**
2699
- * `public` is listed and can be bought. `unlisted` can be bought by whoever has its link. `private` cannot be bought.
2704
+ * `public` is listed and can be bought. `unlisted` can be bought by whoever has its link. `private` cannot be bought. `on_hold` is listed as a public product is and cannot be bought: its page says it is on hold, and every checkout refuses it.
2700
2705
  *
2701
2706
  * Left out, it is "public".
2702
2707
  */
2703
- visibility?: "public" | "unlisted" | "private";
2708
+ visibility?: "public" | "unlisted" | "private" | "on_hold";
2704
2709
  /** The product's options, 1 to 100 of them, in the order buyers see them. A variant of the product that is not in this list is removed. */
2705
2710
  variants: Array<{
2706
2711
  /** An existing variant's ID, to keep it and change it. Left out, the entry is a new variant. */
@@ -2890,7 +2895,7 @@ export type ProductsDeleteResult = unknown;
2890
2895
  /** What set a product's visibility takes: `products.setVisibility`. */
2891
2896
  export interface ProductsSetVisibilityParams {
2892
2897
  /** The new visibility. */
2893
- visibility: "public" | "unlisted" | "private";
2898
+ visibility: "public" | "unlisted" | "private" | "on_hold";
2894
2899
  }
2895
2900
 
2896
2901
  /** What set a product's visibility answers: `products.setVisibility`. */
@@ -2915,7 +2920,7 @@ export interface ProductsBulkUpdateParams {
2915
2920
  /** The products, by ID. Up to 250. */
2916
2921
  productIds: string[];
2917
2922
  /** A visibility for all of them. */
2918
- visibility?: "public" | "unlisted" | "private";
2923
+ visibility?: "public" | "unlisted" | "private" | "on_hold";
2919
2924
  /** Whether all of them are marked as best sellers. */
2920
2925
  isBestSeller?: boolean;
2921
2926
  /** A payment method's name, and `block` or `allow`. `block` adds the method to each product's blocked list. `allow` takes it off the product and off every variant of it. */
@@ -3999,10 +4004,10 @@ export interface OrdersListParams {
3999
4004
  */
4000
4005
  perPage?: number;
4001
4006
  /** Only orders in this status. */
4002
- status?: "pending" | "completed" | "refunded" | "cancelled" | "chargeback";
4007
+ status?: "pending" | "completed" | "refunded" | "cancelled" | "chargeback" | "imported";
4003
4008
  /** Only orders paid with this payment method, by its name in the payment methods list. */
4004
4009
  gateway?: string;
4005
- /** An order's ID, or part of a buyer's email. */
4010
+ /** An order's ID, an imported order's ID on the platform it came from, or part of a buyer's email. */
4006
4011
  search?: string;
4007
4012
  /**
4008
4013
  * What the list is ordered by.
@@ -4067,6 +4072,7 @@ export type OrdersListItem = {
4067
4072
  paidAt: unknown;
4068
4073
  note: string;
4069
4074
  customFields: unknown[] | Record<string, unknown>;
4075
+ imported: unknown;
4070
4076
  emailState: string;
4071
4077
  emailError: string;
4072
4078
  emailAttempts: number;
@@ -4106,10 +4112,10 @@ export type OrdersListItem = {
4106
4112
  /** What export orders takes: `orders.export`. */
4107
4113
  export interface OrdersExportParams {
4108
4114
  /** Only orders in this status. */
4109
- status?: "pending" | "completed" | "refunded" | "cancelled" | "chargeback";
4115
+ status?: "pending" | "completed" | "refunded" | "cancelled" | "chargeback" | "imported";
4110
4116
  /** Only orders paid with this payment method, by its name in the payment methods list. */
4111
4117
  gateway?: string;
4112
- /** An order's ID, or part of a buyer's email. */
4118
+ /** An order's ID, an imported order's ID on the platform it came from, or part of a buyer's email. */
4113
4119
  search?: string;
4114
4120
  /**
4115
4121
  * What the list is ordered by.
@@ -4182,6 +4188,7 @@ export type OrdersShowResult = {
4182
4188
  paidAt: string;
4183
4189
  note: string;
4184
4190
  customFields: unknown[] | Record<string, unknown>;
4191
+ imported: unknown;
4185
4192
  emailState: string;
4186
4193
  emailError: string;
4187
4194
  emailAttempts: number;
@@ -4252,6 +4259,10 @@ export type OrdersShowResult = {
4252
4259
  kind: string;
4253
4260
  detail: string;
4254
4261
  actor: string;
4262
+ by: {
4263
+ name: string;
4264
+ kind: string;
4265
+ };
4255
4266
  at: string;
4256
4267
  }[];
4257
4268
  testPayment: boolean;
@@ -4564,6 +4575,7 @@ export type ReviewsListItem = {
4564
4575
  rating: number;
4565
4576
  message: string;
4566
4577
  automatic: boolean;
4578
+ imported: boolean;
4567
4579
  dateCreated: string;
4568
4580
  items: {
4569
4581
  productId: string;
@@ -4625,6 +4637,7 @@ export type CouponsListItem = {
4625
4637
  active: boolean;
4626
4638
  appliesTo: string;
4627
4639
  targets: unknown[] | Record<string, unknown>;
4640
+ customerTag: unknown;
4628
4641
  sort: number;
4629
4642
  discountGiven: number;
4630
4643
  revenue: number;
@@ -4681,6 +4694,8 @@ export interface CouponsCreateParams {
4681
4694
  /** One variant of it. Left out, every variant. */
4682
4695
  variantId?: string;
4683
4696
  }[];
4697
+ /** Who may use it: empty for anybody with the code, `vip`, or the ID of one of the store's tags. The buyer's email has to wear the tag when the code is applied and when they pay. */
4698
+ customerTag?: string;
4684
4699
  }
4685
4700
 
4686
4701
  /** What create a coupon answers: `coupons.create`. */
@@ -4699,6 +4714,7 @@ export type CouponsCreateResult = {
4699
4714
  active: boolean;
4700
4715
  appliesTo: string;
4701
4716
  targets: unknown[] | Record<string, unknown>;
4717
+ customerTag: unknown;
4702
4718
  sort: number;
4703
4719
  discountGiven: number;
4704
4720
  revenue: number;
@@ -4755,6 +4771,8 @@ export interface CouponsUpdateParams {
4755
4771
  /** One variant of it. Left out, every variant. */
4756
4772
  variantId?: string;
4757
4773
  }[];
4774
+ /** Who may use it: empty for anybody with the code, `vip`, or the ID of one of the store's tags. The buyer's email has to wear the tag when the code is applied and when they pay. */
4775
+ customerTag?: string;
4758
4776
  /** 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. */
4759
4777
  expectedUpdatedAt?: string;
4760
4778
  }
@@ -4775,6 +4793,7 @@ export type CouponsUpdateResult = {
4775
4793
  active: boolean;
4776
4794
  appliesTo: string;
4777
4795
  targets: unknown[] | Record<string, unknown>;
4796
+ customerTag: unknown;
4778
4797
  sort: number;
4779
4798
  discountGiven: number;
4780
4799
  revenue: number;
@@ -5633,19 +5652,19 @@ export interface CartRecoveryUpdateParams {
5633
5652
  firstOn?: boolean;
5634
5653
  /** Minutes after the buyer left. One of 30, 60, 120, 240. */
5635
5654
  firstMinutes?: number;
5636
- /** Its subject, up to 150 characters. */
5655
+ /** Its subject, up to 150 characters. It may hold the email's variables, such as `{{ store.name }}`; one whose marks cannot be read is refused. */
5637
5656
  firstSubject?: string;
5638
5657
  /** Whether the declined card email takes the first one's place after a card was turned down. */
5639
5658
  declinedOn?: boolean;
5640
5659
  /** Minutes after the decline. One of 5, 15, 30, 60. */
5641
5660
  declinedMinutes?: number;
5642
- /** Its subject, up to 150 characters. */
5661
+ /** Its subject, up to 150 characters. It may hold the email's variables, such as `{{ store.name }}`; one whose marks cannot be read is refused. */
5643
5662
  declinedSubject?: string;
5644
5663
  /** Whether the second email is sent. */
5645
5664
  secondOn?: boolean;
5646
5665
  /** Minutes after the buyer left. One of 720, 1200, 1440, 2880. */
5647
5666
  secondMinutes?: number;
5648
- /** Its subject, up to 150 characters. */
5667
+ /** Its subject, up to 150 characters. It may hold the email's variables, such as `{{ store.name }}`; one whose marks cannot be read is refused. */
5649
5668
  secondSubject?: string;
5650
5669
  /** The percent off its coupon. One of 0, 5, 10, 15, 20, 25. 0 sends it with no coupon. */
5651
5670
  secondPercent?: number;
@@ -5769,13 +5788,13 @@ export interface WinBackUpdateParams {
5769
5788
  firstOn?: boolean;
5770
5789
  /** Days after a buyer's last order. One of 14, 21, 30, 45, 60, 90. */
5771
5790
  firstDays?: number;
5772
- /** Its subject, up to 150 characters. */
5791
+ /** Its subject, up to 150 characters. It may hold the email's variables, such as `{{ store.name }}`; one whose marks cannot be read is refused. */
5773
5792
  firstSubject?: string;
5774
5793
  /** Whether the second email is sent. */
5775
5794
  secondOn?: boolean;
5776
5795
  /** Days after the first. One of 3, 7, 14, 21, 30. */
5777
5796
  secondDays?: number;
5778
- /** Its subject, up to 150 characters. */
5797
+ /** Its subject, up to 150 characters. It may hold the email's variables, such as `{{ store.name }}`; one whose marks cannot be read is refused. */
5779
5798
  secondSubject?: string;
5780
5799
  /** The percent off its coupon. One of 0, 5, 10, 15, 20, 25. 0 sends it with no coupon. */
5781
5800
  secondPercent?: number;
@@ -5972,6 +5991,181 @@ export type SubscribersUnsubscribeResult = {
5972
5991
  unsubscribedBy: string;
5973
5992
  };
5974
5993
 
5994
+ /** What list email templates answers: `emailTemplates.list`. */
5995
+ export type EmailTemplatesListResult = {
5996
+ kind: string;
5997
+ group: string;
5998
+ name: string;
5999
+ when: string;
6000
+ edited: boolean;
6001
+ html: boolean;
6002
+ css: boolean;
6003
+ subject: boolean;
6004
+ updatedAt: unknown;
6005
+ }[];
6006
+
6007
+ /** What get the shared email CSS answers: `emailTemplates.shared`. */
6008
+ export type EmailTemplatesSharedResult = {
6009
+ css: string;
6010
+ updatedAt: string;
6011
+ baseCss: string;
6012
+ };
6013
+
6014
+ /** What change the shared email CSS takes: `emailTemplates.saveShared`. */
6015
+ export interface EmailTemplatesSaveSharedParams {
6016
+ /** The whole look, or null for Shoply's. */
6017
+ css: string;
6018
+ /** The `updatedAt` you read; one changed since is refused with `stale_write`. */
6019
+ expectedUpdatedAt?: string;
6020
+ }
6021
+
6022
+ /** What change the shared email CSS answers: `emailTemplates.saveShared`. */
6023
+ export type EmailTemplatesSaveSharedResult = {
6024
+ css: string;
6025
+ updatedAt: string;
6026
+ baseCss: string;
6027
+ };
6028
+
6029
+ /** What get an email template answers: `emailTemplates.show`. */
6030
+ export type EmailTemplatesShowResult = {
6031
+ kind: string;
6032
+ group: string;
6033
+ name: string;
6034
+ when: string;
6035
+ marketing: boolean;
6036
+ required: string[];
6037
+ variables: {
6038
+ name: string;
6039
+ about: string;
6040
+ }[];
6041
+ parts: {
6042
+ name: string;
6043
+ about: string;
6044
+ }[];
6045
+ original: string;
6046
+ originalSubject: string;
6047
+ originalSubjectSource: string;
6048
+ html: unknown;
6049
+ css: unknown;
6050
+ subject: unknown;
6051
+ updatedAt: unknown;
6052
+ shared: unknown;
6053
+ baseCss: string;
6054
+ accent: string;
6055
+ };
6056
+
6057
+ /** What change an email template takes: `emailTemplates.update`. */
6058
+ export interface EmailTemplatesUpdateParams {
6059
+ /** The email's HTML, or null for the original. */
6060
+ html?: string;
6061
+ /** Its whole look, or null to follow the shared CSS. The look it would get anyway is saved as null. */
6062
+ css?: string;
6063
+ /** Its subject, or null for the original. */
6064
+ subject?: string;
6065
+ /** The `updatedAt` you read; a template changed since is refused with `stale_write`. */
6066
+ expectedUpdatedAt?: string;
6067
+ }
6068
+
6069
+ /** What change an email template answers: `emailTemplates.update`. */
6070
+ export type EmailTemplatesUpdateResult = {
6071
+ kind: string;
6072
+ group: string;
6073
+ name: string;
6074
+ when: string;
6075
+ marketing: boolean;
6076
+ required: string[];
6077
+ variables: {
6078
+ name: string;
6079
+ about: string;
6080
+ }[];
6081
+ parts: {
6082
+ name: string;
6083
+ about: string;
6084
+ }[];
6085
+ original: string;
6086
+ originalSubject: string;
6087
+ originalSubjectSource: string;
6088
+ html: unknown;
6089
+ css: string;
6090
+ subject: string;
6091
+ updatedAt: string;
6092
+ shared: unknown;
6093
+ baseCss: string;
6094
+ accent: string;
6095
+ };
6096
+
6097
+ /** What preview an email template takes: `emailTemplates.preview`. */
6098
+ export interface EmailTemplatesPreviewParams {
6099
+ /** HTML to preview in place of what is saved; null for the original. */
6100
+ html?: string;
6101
+ /** Its whole look, to preview in place of what is saved. */
6102
+ css?: string;
6103
+ /** A subject to preview in place of what is saved. */
6104
+ subject?: string;
6105
+ /** The look every email gets, in place of what is saved. */
6106
+ shared?: string;
6107
+ }
6108
+
6109
+ /** What preview an email template answers: `emailTemplates.preview`. */
6110
+ export type EmailTemplatesPreviewResult = {
6111
+ subject: string;
6112
+ html: string;
6113
+ text: string;
6114
+ parts: {
6115
+ delivery: string;
6116
+ buttons: string;
6117
+ summary: string;
6118
+ reply_note: string;
6119
+ };
6120
+ values: {
6121
+ "store.name": string;
6122
+ "store.url": string;
6123
+ "store.panel_url": string;
6124
+ "buyer.email": string;
6125
+ "order.id": string;
6126
+ "order.paid_at": string;
6127
+ "order.total": string;
6128
+ "order.paid_with": string;
6129
+ "order.invoice_attached": boolean;
6130
+ "links.order": string;
6131
+ "links.review": string;
6132
+ year: string;
6133
+ };
6134
+ problems: {
6135
+ html: unknown[] | Record<string, unknown>;
6136
+ css: unknown[] | Record<string, unknown>;
6137
+ subject: unknown[] | Record<string, unknown>;
6138
+ };
6139
+ };
6140
+
6141
+ /** What revert an email template answers: `emailTemplates.revert`. */
6142
+ export type EmailTemplatesRevertResult = {
6143
+ kind: string;
6144
+ group: string;
6145
+ name: string;
6146
+ when: string;
6147
+ marketing: boolean;
6148
+ required: string[];
6149
+ variables: {
6150
+ name: string;
6151
+ about: string;
6152
+ }[];
6153
+ parts: {
6154
+ name: string;
6155
+ about: string;
6156
+ }[];
6157
+ original: string;
6158
+ originalSubject: string;
6159
+ originalSubjectSource: string;
6160
+ html: unknown;
6161
+ css: unknown;
6162
+ subject: unknown;
6163
+ updatedAt: unknown;
6164
+ shared: unknown;
6165
+ baseCss: string;
6166
+ accent: string;
6167
+ };
6168
+
5975
6169
  /** What list customers takes: `customers.list`. */
5976
6170
  export interface CustomersListParams {
5977
6171
  /**
@@ -6282,6 +6476,7 @@ export type CustomerTagsListResult = {
6282
6476
  tone: string;
6283
6477
  automatic: boolean;
6284
6478
  customers: number;
6479
+ coupons: number;
6285
6480
  }[];
6286
6481
 
6287
6482
  /** What add a customer tag takes: `customerTags.create`. */
@@ -6325,6 +6520,7 @@ export type CustomerTagsAutomaticResult = {
6325
6520
  tone: string;
6326
6521
  automatic: boolean;
6327
6522
  customers: number;
6523
+ coupons: number;
6328
6524
  }[];
6329
6525
 
6330
6526
  /** What change a customer tag takes: `customerTags.update`. */
@@ -6738,6 +6934,7 @@ export type TicketsGetResult = {
6738
6934
  id: string;
6739
6935
  from: string;
6740
6936
  body: string;
6937
+ html: string;
6741
6938
  pictures: unknown[] | Record<string, unknown>;
6742
6939
  createdAt: string;
6743
6940
  }>;
@@ -6805,6 +7002,7 @@ export type TicketsReplyResult = {
6805
7002
  id: string;
6806
7003
  from: string;
6807
7004
  body: string;
7005
+ html: string;
6808
7006
  pictures: unknown[] | Record<string, unknown>;
6809
7007
  createdAt: string;
6810
7008
  }>;
@@ -6860,6 +7058,7 @@ export type TicketsResolveResult = {
6860
7058
  id: string;
6861
7059
  from: string;
6862
7060
  body: string;
7061
+ html: string;
6863
7062
  pictures: unknown[] | Record<string, unknown>;
6864
7063
  createdAt: string;
6865
7064
  }>;
@@ -6915,6 +7114,7 @@ export type TicketsReopenResult = {
6915
7114
  id: string;
6916
7115
  from: string;
6917
7116
  body: string;
7117
+ html: string;
6918
7118
  pictures: unknown[] | Record<string, unknown>;
6919
7119
  createdAt: string;
6920
7120
  }>;
@@ -6946,6 +7146,236 @@ export type TicketsReopenResult = {
6946
7146
  on: boolean;
6947
7147
  };
6948
7148
 
7149
+ /** What get the team answers: `team.get`. */
7150
+ export type TeamGetResult = {
7151
+ teams: {
7152
+ id: string;
7153
+ name: string;
7154
+ permissions: string[];
7155
+ sensitive: number;
7156
+ reach: string[];
7157
+ people: {
7158
+ id: string;
7159
+ userId: string;
7160
+ teamId: string;
7161
+ name: string;
7162
+ email: string;
7163
+ avatarUrl: unknown;
7164
+ invitedBy: string;
7165
+ joinedAt: string;
7166
+ lastSeenAt: unknown;
7167
+ keys: number;
7168
+ me: boolean;
7169
+ }[];
7170
+ waiting: number;
7171
+ createdAt: string;
7172
+ updatedAt: string;
7173
+ }[];
7174
+ invites: {
7175
+ id: string;
7176
+ kind: string;
7177
+ email: string;
7178
+ teamId: string;
7179
+ team: string;
7180
+ invitedBy: string;
7181
+ sends: number;
7182
+ sentAt: string;
7183
+ expiresAt: string;
7184
+ expired: boolean;
7185
+ }[];
7186
+ owner: {
7187
+ userId: string;
7188
+ name: unknown;
7189
+ email: string;
7190
+ avatarUrl: unknown;
7191
+ };
7192
+ me: {
7193
+ role: string;
7194
+ teamId: unknown;
7195
+ permissions: string[];
7196
+ };
7197
+ permissions: {
7198
+ groups: {
7199
+ id: string;
7200
+ title: string;
7201
+ permissions: {
7202
+ id: unknown;
7203
+ label: unknown;
7204
+ about: unknown;
7205
+ sensitive: unknown;
7206
+ needs: unknown;
7207
+ }[];
7208
+ }[];
7209
+ presets: {
7210
+ id: string;
7211
+ name: string;
7212
+ about: string;
7213
+ permissions: string[];
7214
+ }[];
7215
+ };
7216
+ limits: {
7217
+ teams: number;
7218
+ people: number;
7219
+ name: number;
7220
+ perInvite: number;
7221
+ inviteDays: number;
7222
+ };
7223
+ };
7224
+
7225
+ /** What list activity takes: `team.activity`. */
7226
+ export interface TeamActivityParams {
7227
+ /** Only one person's, by their `userId`. */
7228
+ person?: string;
7229
+ /** Only one part of the dashboard, by its group's `id` in Get the team's `permissions`. */
7230
+ area?: string;
7231
+ /**
7232
+ * Which page of the list. The first is 1.
7233
+ *
7234
+ * Left out, it is 1.
7235
+ */
7236
+ page?: number;
7237
+ }
7238
+
7239
+ /** A row of what list activity lists: `team.activity`. */
7240
+ export type TeamActivityItem = {
7241
+ id: string;
7242
+ userId: string;
7243
+ name: string;
7244
+ email: string;
7245
+ team: string;
7246
+ area: string;
7247
+ summary: string;
7248
+ subject: {
7249
+ kind: string;
7250
+ id: string;
7251
+ };
7252
+ at: string;
7253
+ };
7254
+
7255
+ /** What create a team takes: `teams.create`. */
7256
+ export interface TeamsCreateParams {
7257
+ /** What the team is called, up to 40 characters, once a store. */
7258
+ name: string;
7259
+ /** What its people may do, by name (List the team answers every permission in `permissions`). What a permission leans on is added with it: `stock.edit` brings `stock.view` and `products.view`. */
7260
+ permissions: string[];
7261
+ }
7262
+
7263
+ /** What create a team answers: `teams.create`. */
7264
+ export type TeamsCreateResult = {
7265
+ id: string;
7266
+ name: string;
7267
+ permissions: string[];
7268
+ sensitive: number;
7269
+ reach: string[];
7270
+ people: unknown[] | Record<string, unknown>;
7271
+ waiting: number;
7272
+ createdAt: string;
7273
+ updatedAt: string;
7274
+ };
7275
+
7276
+ /** What update a team takes: `teams.update`. */
7277
+ export interface TeamsUpdateParams {
7278
+ /** What the team is called, up to 40 characters, once a store. */
7279
+ name: string;
7280
+ /** What its people may do, by name (List the team answers every permission in `permissions`). What a permission leans on is added with it: `stock.edit` brings `stock.view` and `products.view`. */
7281
+ permissions: string[];
7282
+ }
7283
+
7284
+ /** What update a team answers: `teams.update`. */
7285
+ export type TeamsUpdateResult = {
7286
+ id: string;
7287
+ name: string;
7288
+ permissions: string[];
7289
+ sensitive: number;
7290
+ reach: string[];
7291
+ people: unknown[] | Record<string, unknown>;
7292
+ waiting: number;
7293
+ createdAt: string;
7294
+ updatedAt: string;
7295
+ };
7296
+
7297
+ /** What delete a team answers: `teams.delete`. */
7298
+ export type TeamsDeleteResult = {
7299
+ deleted: string;
7300
+ };
7301
+
7302
+ /** What invite people takes: `team.invite`. */
7303
+ export interface TeamInviteParams {
7304
+ /** The team they join. */
7305
+ teamId: string;
7306
+ /** The addresses to invite. */
7307
+ emails?: string[];
7308
+ /**
7309
+ * `link` for a one-time link in place of emails.
7310
+ *
7311
+ * Left out, it is "email".
7312
+ */
7313
+ kind?: "email" | "link";
7314
+ }
7315
+
7316
+ /** What invite people answers: `team.invite`. */
7317
+ export type TeamInviteResult = {
7318
+ invites: {
7319
+ id: string;
7320
+ kind: string;
7321
+ email: string;
7322
+ teamId: string;
7323
+ team: string;
7324
+ invitedBy: string;
7325
+ sends: number;
7326
+ sentAt: string;
7327
+ expiresAt: string;
7328
+ expired: boolean;
7329
+ }[];
7330
+ skipped: unknown[] | Record<string, unknown>;
7331
+ };
7332
+
7333
+ /** What send an invite again answers: `team.resendInvite`. */
7334
+ export type TeamResendInviteResult = {
7335
+ id: string;
7336
+ kind: string;
7337
+ email: string;
7338
+ teamId: string;
7339
+ team: string;
7340
+ invitedBy: string;
7341
+ sends: number;
7342
+ sentAt: string;
7343
+ expiresAt: string;
7344
+ expired: boolean;
7345
+ };
7346
+
7347
+ /** What cancel an invite answers: `team.cancelInvite`. */
7348
+ export type TeamCancelInviteResult = {
7349
+ deleted: string;
7350
+ };
7351
+
7352
+ /** What move somebody to another team takes: `team.moveMember`. */
7353
+ export interface TeamMoveMemberParams {
7354
+ /** The team they move to. */
7355
+ teamId: string;
7356
+ }
7357
+
7358
+ /** What move somebody to another team answers: `team.moveMember`. */
7359
+ export type TeamMoveMemberResult = {
7360
+ id: string;
7361
+ userId: string;
7362
+ teamId: string;
7363
+ name: string;
7364
+ email: string;
7365
+ avatarUrl: unknown;
7366
+ invitedBy: string;
7367
+ joinedAt: string;
7368
+ lastSeenAt: unknown;
7369
+ keys: number;
7370
+ me: boolean;
7371
+ };
7372
+
7373
+ /** What remove somebody from the team answers: `team.removeMember`. */
7374
+ export type TeamRemoveMemberResult = {
7375
+ deleted: string;
7376
+ keysStopped: number;
7377
+ };
7378
+
6949
7379
  /** What list blacklist rules takes: `blacklist.list`. */
6950
7380
  export interface BlacklistListParams {
6951
7381
  /**
@@ -9925,8 +10355,24 @@ export type CustomerShowResult = {
9925
10355
  buttons: unknown[] | Record<string, unknown>;
9926
10356
  guideUrl: string;
9927
10357
  files: unknown[] | Record<string, unknown>;
9928
- instructions: unknown[] | Record<string, unknown>;
10358
+ instructions: {
10359
+ productName: string;
10360
+ variantName: string;
10361
+ text: string;
10362
+ }[];
9929
10363
  general: string;
10364
+ orders: Array<{
10365
+ id: string;
10366
+ dateCreated: string;
10367
+ products: string[];
10368
+ imageUrl: unknown;
10369
+ files: unknown[] | Record<string, unknown>;
10370
+ instructions: {
10371
+ productName: unknown;
10372
+ variantName: unknown;
10373
+ text: unknown;
10374
+ }[];
10375
+ }>;
9930
10376
  };
9931
10377
  supportUrl: string;
9932
10378
  };
@@ -10538,6 +10984,7 @@ export type CustomerTicketsCreateResult = {
10538
10984
  id: string;
10539
10985
  from: string;
10540
10986
  body: string;
10987
+ html: string;
10541
10988
  pictures: unknown[] | Record<string, unknown>;
10542
10989
  createdAt: string;
10543
10990
  }>;
@@ -10575,6 +11022,7 @@ export type CustomerTicketsShowResult = {
10575
11022
  id: string;
10576
11023
  from: string;
10577
11024
  body: string;
11025
+ html: string;
10578
11026
  pictures: unknown[] | Record<string, unknown>;
10579
11027
  createdAt: string;
10580
11028
  }>;
@@ -10618,6 +11066,7 @@ export type CustomerTicketsReplyResult = {
10618
11066
  id: string;
10619
11067
  from: string;
10620
11068
  body: string;
11069
+ html: string;
10621
11070
  pictures: unknown[] | Record<string, unknown>;
10622
11071
  createdAt: string;
10623
11072
  }>;
@@ -10655,6 +11104,7 @@ export type CustomerTicketsResolveResult = {
10655
11104
  id: string;
10656
11105
  from: string;
10657
11106
  body: string;
11107
+ html: string;
10658
11108
  pictures: unknown[] | Record<string, unknown>;
10659
11109
  createdAt: string;
10660
11110
  }>;
@@ -11781,7 +12231,7 @@ export interface ShoplyResourcesOrders {
11781
12231
  /**
11782
12232
  * **Get an order**
11783
12233
  *
11784
- * One order with everything its page shows: its lines and what each delivered, its payments, the buyer, its timeline, where it came from, `refund`, which says which ways it can be refunded, and `requests`: what Shoply sent your servers about it, each try of each webhook about the order and each line's dynamic delivery, newest first, with the first 300 characters of what came back. `customPayment` is for an order paid with one of your custom payment methods, and null for any other: the method's name, `status` (`open`, `review` while it waits for you to approve or reject it, `paid` or `rejected`), the amount, and `proof`, what the buyer sent when they said they paid (the reference, whether a proof of payment was sent, and when).
12234
+ * One order with everything its page shows: its lines and what each delivered, its payments, the buyer, its timeline, where it came from, `refund`, which says which ways it can be refunded, and `requests`: what Shoply sent your servers about it, each try of each webhook about the order and each line's dynamic delivery, newest first, with the first 300 characters of what came back. `customPayment` is for an order paid with one of your custom payment methods, and null for any other: the method's name, `status` (`open`, `review` while it waits for you to approve or reject it, `paid` or `rejected`), the amount, and `proof`, what the buyer sent when they said they paid (the reference, whether a proof of payment was sent, and when). An order brought across by Platform Migration is found by its ID on the platform it came from as well, and answers with its own `id`; what it delivered there is in its items' `deliveredKeys`, a line of it each, where that platform says.
11785
12235
  *
11786
12236
  * Needs the `orders.read` permission (Read Orders).
11787
12237
  *
@@ -12018,7 +12468,7 @@ export interface ShoplyResourcesCoupons {
12018
12468
  /**
12019
12469
  * **Update a coupon**
12020
12470
  *
12021
- * Saves the coupon whole: send every field as it should be, not only what changed. A field left out goes back to its default. The exceptions are `appliesTo` and `targets`, which stay as they are when `appliesTo` is left out.
12471
+ * Saves the coupon whole: send every field as it should be, not only what changed. A field left out goes back to its default. The exceptions are `appliesTo` and `targets`, which stay as they are when `appliesTo` is left out, and `customerTag`, which stays as it is when left out.
12022
12472
  *
12023
12473
  * Needs the `coupons.write` permission (Change Coupons).
12024
12474
  *
@@ -12606,6 +13056,79 @@ export interface ShoplyResourcesSubscribers {
12606
13056
  unsubscribe(params: SubscribersUnsubscribeParams, options?: RequestOptions): Promise<SubscribersUnsubscribeResult>;
12607
13057
  }
12608
13058
 
13059
+ export interface ShoplyResourcesEmailTemplates {
13060
+ /**
13061
+ * **List email templates**
13062
+ *
13063
+ * Every email a store can write, in the order the dashboard lists them: its `kind`, `group`, `name`, `when` it is sent, whether the store has `edited` it (and which of `html`, `css` and `subject`), and `updatedAt`. `meta.shared` is the CSS every email gets (`css`, null where it is Shoply's look, `baseCss`), and `meta.sendable` whether the store can send email at all.
13064
+ *
13065
+ * Needs the `emails.read` permission (Read Email Templates).
13066
+ *
13067
+ * @see https://docs.shoply.gg/api-reference/email-templates/list-email-templates
13068
+ */
13069
+ list(options?: RequestOptions): Promise<EmailTemplatesListResult>;
13070
+ /**
13071
+ * **Get the shared email CSS**
13072
+ *
13073
+ * The look every email gets but one with a `css` of its own, as `css` (null where it is Shoply's look), `updatedAt`, and Shoply's look as `baseCss`, `var(--accent)` in it for the shop's colour.
13074
+ *
13075
+ * Needs the `emails.read` permission (Read Email Templates).
13076
+ *
13077
+ * @see https://docs.shoply.gg/api-reference/email-templates/get-the-shared-email-css
13078
+ */
13079
+ shared(options?: RequestOptions): Promise<EmailTemplatesSharedResult>;
13080
+ /**
13081
+ * **Change the shared email CSS**
13082
+ *
13083
+ * The look every email gets but one with a `css` of its own, a whole sheet, checked as an email's own is; empty, null or `baseCss` as it is for none, which is Shoply's look. Saving one draws every email from its template, Shoply's original where the store has not written one.
13084
+ *
13085
+ * Needs the `emails.write` permission (Change Email Templates).
13086
+ *
13087
+ * @see https://docs.shoply.gg/api-reference/email-templates/change-the-shared-email-css
13088
+ */
13089
+ saveShared(params: EmailTemplatesSaveSharedParams, options?: RequestOptions): Promise<EmailTemplatesSaveSharedResult>;
13090
+ /**
13091
+ * **Get an email template**
13092
+ *
13093
+ * One email: what it is, its `variables` and `parts` (each a `name` and what it is), the marks it must hold (`required`), its `original` HTML, what the store has saved, `shared` (the CSS every email gets), `baseCss` (Shoply's look for the classes the originals are written with) and `accent` (the shop's colour, which `var(--accent)` is). The email is drawn with `css`, else `shared`, else `baseCss`. Each of `html`, `css` and `subject` is the store's own, or null where it is Shoply's original. A CSS is a whole look, never rules over another: an email is drawn with its own `css`, else the shared CSS, else Shoply's look (`baseCss`), where `var(--accent)` is the shop's colour. The HTML is the email's card and the lines under it, with Liquid's marks for what changes from one buyer to the next: `{{ order.id }}` prints a value, escaped, and `{{ parts.delivery }}` a part only Shoply writes. `variables` and `parts` say which an email has. Shoply writes the page round it, its dark look, and a last line under it, "Sent with Shoply", which no template changes. `originalSubject` is the original subject as a sample buyer would get it, and `originalSubjectSource` the same written with its variables.
13094
+ *
13095
+ * Needs the `emails.read` permission (Read Email Templates).
13096
+ *
13097
+ * @see https://docs.shoply.gg/api-reference/email-templates/get-an-email-template
13098
+ */
13099
+ show(kind: string, options?: RequestOptions): Promise<EmailTemplatesShowResult>;
13100
+ /**
13101
+ * **Change an email template**
13102
+ *
13103
+ * Changes each of `html`, `css` and `subject` sent, and keeps the rest; null, an empty string, or the original's own HTML puts that one back to the original. Answers the email as Get an email template does. Refused with `template_problems` while anything would stop it, `problems` saying what and on which line, for `html`, `css` and `subject`. The HTML may hold the tags an email is made of, never a script, a form, a frame or <style>, and its links go to https, http, mailto or #, its pictures to https; up to 64 KB. Comments are taken out when it is sent, which `problems` says as a warning. The CSS is the email's whole look, and the shared CSS no longer changes an email that has one: start from `shared`, or `baseCss` where it is null. It sets how things look, with type, class, id and attribute selectors, and @media; no url(), no position, and no < or backslash; up to 32 KB. A subject is one line of up to 150 characters, and may hold the email's variables. Before it is saved the email is drawn for a sample buyer, and refused where it closes a <div> it never opened, where a mark it must hold is in its code but not in what it draws (inside a comment, or under a condition that is false), or where its subject comes out empty. Cart Recovery's and Win-Back's emails must hold `{{ links.unsubscribe }}`, and their subjects are those Change Cart Recovery and Change Win-Back set.
13104
+ *
13105
+ * Needs the `emails.write` permission (Change Email Templates).
13106
+ *
13107
+ * @see https://docs.shoply.gg/api-reference/email-templates/change-an-email-template
13108
+ */
13109
+ update(kind: string, params?: EmailTemplatesUpdateParams, options?: RequestOptions): Promise<EmailTemplatesUpdateResult>;
13110
+ /**
13111
+ * **Preview an email template**
13112
+ *
13113
+ * The email for a sample buyer as it would be sent with what you send in place of what is saved: its `subject`, the whole page as `html`, its plain `text`, the `values` its variables had, and `problems` as Change an email template would say them. Nothing is saved and nothing is sent.
13114
+ *
13115
+ * Needs the `emails.read` permission (Read Email Templates).
13116
+ *
13117
+ * @see https://docs.shoply.gg/api-reference/email-templates/preview-an-email-template
13118
+ */
13119
+ preview(kind: string, params?: EmailTemplatesPreviewParams, options?: RequestOptions): Promise<EmailTemplatesPreviewResult>;
13120
+ /**
13121
+ * **Revert an email template**
13122
+ *
13123
+ * Puts the email back as Shoply wrote it: its HTML, CSS and subject. Answers it as Get an email template does.
13124
+ *
13125
+ * Needs the `emails.write` permission (Change Email Templates).
13126
+ *
13127
+ * @see https://docs.shoply.gg/api-reference/email-templates/revert-an-email-template
13128
+ */
13129
+ revert(kind: string, options?: RequestOptions): Promise<EmailTemplatesRevertResult>;
13130
+ }
13131
+
12609
13132
  export interface ShoplyResourcesCustomers {
12610
13133
  /**
12611
13134
  * **List customers**
@@ -12944,7 +13467,7 @@ export interface ShoplyResourcesTickets {
12944
13467
  /**
12945
13468
  * **Get a support ticket**
12946
13469
  *
12947
- * A ticket with its `conversation`, oldest first: each message's `from` (`buyer` or `store`), `body`, `pictures` (each one's `name` and the `url` the dashboard reads it at; read it with Get a ticket's picture) and `createdAt`. `customer` is who wrote it, with their tags, `order` the order it is about, `orders` their five latest, and `canReopenUntil` the last moment the buyer can open a resolved ticket again by writing on it. Reading a ticket marks it read, as opening it on the dashboard does.
13470
+ * A ticket with its `conversation`, oldest first: each message's `from` (`buyer` or `store`), `body` (Markdown, as written), `html` (the body as Markdown draws it, escaped: links only to the web or an email, each opening in a new tab, and a picture written in Markdown a link, never loaded), `pictures` (each one's `name` and the `url` the dashboard reads it at; read it with Get a ticket's picture) and `createdAt`. `customer` is who wrote it, with their tags, `order` the order it is about, `orders` their five latest, and `canReopenUntil` the last moment the buyer can open a resolved ticket again by writing on it. Reading a ticket marks it read, as opening it on the dashboard does.
12948
13471
  *
12949
13472
  * Needs the `tickets.read` permission (Read Support Tickets).
12950
13473
  *
@@ -12993,6 +13516,112 @@ export interface ShoplyResourcesTickets {
12993
13516
  picture(ticketId: string, name: string, options?: RequestOptions): Promise<Response>;
12994
13517
  }
12995
13518
 
13519
+ export interface ShoplyResourcesTeam {
13520
+ /**
13521
+ * **Get the team**
13522
+ *
13523
+ * The store's teams, each with its `permissions`, how many of them are `sensitive`, the parts of the dashboard it `reach`es, its `people` and how many invites are `waiting`; every `invite` not yet taken up; the store's `owner`, who is on no team and can do everything; and `permissions`, every permission there is in its `groups`, each with its `label`, what it lets a person do (`about`), whether it is `sensitive` and what it `needs`, and the `presets` a team can start from. `limits` says how many teams a store and people a team may have (10 and 30, invites not yet taken up counted among the people), how long a team's `name` may be, how many addresses one invite takes (`perInvite`) and how many days an invite lasts (`inviteDays`).
13524
+ *
13525
+ * Needs the `team.read` permission (Read the Team).
13526
+ *
13527
+ * @see https://docs.shoply.gg/api-reference/teams/get-the-team
13528
+ */
13529
+ get(options?: RequestOptions): Promise<TeamGetResult>;
13530
+ /**
13531
+ * **List activity**
13532
+ *
13533
+ * 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.
13534
+ *
13535
+ * Needs the `team.read` permission (Read the Team).
13536
+ *
13537
+ * @see https://docs.shoply.gg/api-reference/teams/list-activity
13538
+ */
13539
+ activity(params?: TeamActivityParams, options?: RequestOptions): PagePromise<TeamActivityItem>;
13540
+ /**
13541
+ * **Invite people**
13542
+ *
13543
+ * Emails an invite to each address in `emails`, up to 10 at a time, from Shoply. An invite is taken up only by an account with that address, which they sign in with or make, and the store is then in their store switcher. Each runs out in 7 days. `skipped` names an address left out and why: the owner's, one on the team already, or one invited already. With `kind` set to `link` instead, it makes a one-time link anybody can take up, answered in `url` here and never again. Not to a team that holds a sensitive permission: invite to one of those on the dashboard. The store's owner is emailed when somebody joins.
13544
+ *
13545
+ * Needs the `team.write` permission (Manage the Team). It sends an email, and is counted against a budget of its own: 60 in ten minutes for each key.
13546
+ *
13547
+ * @see https://docs.shoply.gg/api-reference/teams/invite-people
13548
+ */
13549
+ invite(params: TeamInviteParams, options?: RequestOptions): Promise<TeamInviteResult>;
13550
+ /**
13551
+ * **Send an invite again**
13552
+ *
13553
+ * Sends an email invite again, or makes a link again (answered in `meta.url`), with 7 days from now. The address or link sent before stops working.
13554
+ *
13555
+ * Needs the `team.write` permission (Manage the Team). It sends an email, and is counted against a budget of its own: 60 in ten minutes for each key.
13556
+ *
13557
+ * @see https://docs.shoply.gg/api-reference/teams/send-an-invite-again
13558
+ */
13559
+ resendInvite(inviteId: string, options?: RequestOptions): Promise<TeamResendInviteResult>;
13560
+ /**
13561
+ * **Cancel an invite**
13562
+ *
13563
+ * Takes an invite back. Its email or link stops working.
13564
+ *
13565
+ * Needs the `team.write` permission (Manage the Team).
13566
+ *
13567
+ * @see https://docs.shoply.gg/api-reference/teams/cancel-an-invite
13568
+ */
13569
+ cancelInvite(inviteId: string, options?: RequestOptions): Promise<TeamCancelInviteResult>;
13570
+ /**
13571
+ * **Move somebody to another team**
13572
+ *
13573
+ * 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.
13574
+ *
13575
+ * Needs the `team.write` permission (Manage the Team).
13576
+ *
13577
+ * @see https://docs.shoply.gg/api-reference/teams/move-somebody-to-another-team
13578
+ */
13579
+ moveMember(memberId: string, params: TeamMoveMemberParams, options?: RequestOptions): Promise<TeamMoveMemberResult>;
13580
+ /**
13581
+ * **Remove somebody from the team**
13582
+ *
13583
+ * 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.
13584
+ *
13585
+ * Needs the `team.write` permission (Manage the Team).
13586
+ *
13587
+ * @see https://docs.shoply.gg/api-reference/teams/remove-somebody-from-the-team
13588
+ */
13589
+ removeMember(memberId: string, options?: RequestOptions): Promise<TeamRemoveMemberResult>;
13590
+ }
13591
+
13592
+ export interface ShoplyResourcesTeams {
13593
+ /**
13594
+ * **Create a team**
13595
+ *
13596
+ * A store holds up to 10 teams. 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.
13597
+ *
13598
+ * Needs the `team.write` permission (Manage the Team).
13599
+ *
13600
+ * @see https://docs.shoply.gg/api-reference/teams/create-a-team
13601
+ */
13602
+ create(params: TeamsCreateParams, options?: RequestOptions): Promise<TeamsCreateResult>;
13603
+ /**
13604
+ * **Update a team**
13605
+ *
13606
+ * 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.
13607
+ *
13608
+ * Needs the `team.write` permission (Manage the Team).
13609
+ *
13610
+ * @see https://docs.shoply.gg/api-reference/teams/update-a-team
13611
+ */
13612
+ update(teamId: string, params: TeamsUpdateParams, options?: RequestOptions): Promise<TeamsUpdateResult>;
13613
+ /**
13614
+ * **Delete a team**
13615
+ *
13616
+ * Refused with `team_not_empty` while anybody is on it: move or remove them first. Its invites not yet taken up go with it.
13617
+ *
13618
+ * Needs the `team.write` permission (Manage the Team).
13619
+ *
13620
+ * @see https://docs.shoply.gg/api-reference/teams/delete-a-team
13621
+ */
13622
+ delete(teamId: string, options?: RequestOptions): Promise<TeamsDeleteResult>;
13623
+ }
13624
+
12996
13625
  export interface ShoplyResourcesBlacklist {
12997
13626
  /**
12998
13627
  * **List blacklist rules**
@@ -13804,11 +14433,14 @@ export interface ShoplyResources {
13804
14433
  cartRecovery: ShoplyResourcesCartRecovery;
13805
14434
  winBack: ShoplyResourcesWinBack;
13806
14435
  subscribers: ShoplyResourcesSubscribers;
14436
+ emailTemplates: ShoplyResourcesEmailTemplates;
13807
14437
  customers: ShoplyResourcesCustomers;
13808
14438
  customerTags: ShoplyResourcesCustomerTags;
13809
14439
  affiliates: ShoplyResourcesAffiliates;
13810
14440
  affiliateProgramme: ShoplyResourcesAffiliateProgramme;
13811
14441
  tickets: ShoplyResourcesTickets;
14442
+ team: ShoplyResourcesTeam;
14443
+ teams: ShoplyResourcesTeams;
13812
14444
  blacklist: ShoplyResourcesBlacklist;
13813
14445
  fraudEvents: ShoplyResourcesFraudEvents;
13814
14446
  fraudSettings: ShoplyResourcesFraudSettings;
@@ -14023,7 +14655,7 @@ export interface ShoplyCustomerResourcesTickets {
14023
14655
  /**
14024
14656
  * **Get a support ticket**
14025
14657
  *
14026
- * A ticket with its `conversation`, oldest first: each message's `from` (`buyer` or `store`), `body`, `pictures` and `createdAt`. A picture is named here and shown in the customer panel. `canReopenUntil` is the last moment writing on a resolved ticket opens it again.
14658
+ * A ticket with its `conversation`, oldest first: each message's `from` (`buyer` or `store`), `body` (Markdown, as written), `html` (the body as Markdown draws it, escaped, which is safe to show as it is), `pictures` and `createdAt`. A picture is named here and shown in the customer panel. `canReopenUntil` is the last moment writing on a resolved ticket opens it again.
14027
14659
  *
14028
14660
  * Needs the buyer's token: `Authorization: Bearer shoply_ct_...`, from Sign in with the code.
14029
14661
  *
@@ -14096,6 +14728,8 @@ export interface ShoplyCustomerResources {
14096
14728
  *
14097
14729
  * Everything the customer panel's first page shows: the buyer's email, what they have spent, their store balance, their 200 newest orders, and the downloads, files and setup instructions their paid orders hand over.
14098
14730
  *
14731
+ * `downloads.files` and `downloads.instructions` are every paid order's together. `downloads.orders` is the same an order at a time, newest first, as the customer panel shows it: each with what it bought, its own files and its own instructions. The store's `buttons` and `general` notes go with every order.
14732
+ *
14099
14733
  * `affiliate` is null unless the store has an affiliate programme the buyer is in or may join, and `subscriptions` says whether they have ever had one. Keys are not listed here: Get an order has them.
14100
14734
  *
14101
14735
  * Needs the buyer's token: `Authorization: Bearer shoply_ct_...`, from Sign in with the code.
@@ -14188,6 +14822,12 @@ export type WebhookEventName =
14188
14822
  | "ticket.message"
14189
14823
  | "ticket.resolved"
14190
14824
  | "ticket.reopened"
14825
+ | "team.created"
14826
+ | "team.updated"
14827
+ | "team.deleted"
14828
+ | "team.member_joined"
14829
+ | "team.member_moved"
14830
+ | "team.member_left"
14191
14831
  | "fraud.checkout_blocked"
14192
14832
  | "webhook.test";
14193
14833
 
@@ -14523,6 +15163,42 @@ export interface WebhookEventData {
14523
15163
  * `data`: The ticket, as [Get a support ticket](https://docs.shoply.gg/api-reference/support-tickets/get-a-support-ticket) answers it without its conversation: `status` is `open` (the buyer wrote last), `answered` or `resolved`, and `resolvedBy` says who resolved it (`store`, `buyer` or `auto`). `ticket.message` adds `message`: its `id`, `from` (`buyer` or `store`), `body`, `pictures` (each one's `name`, read with a key) and `createdAt`.
14524
15164
  */
14525
15165
  "ticket.reopened": TicketsGetResult & Record<string, unknown>;
15166
+ /**
15167
+ * A team was made at the store, with what its people may do.
15168
+ *
15169
+ * `data`: For `team.created` and `team.updated` the team as [Get the team](https://docs.shoply.gg/api-reference/teams/get-the-team) answers it in `teams`, without its `people`; `team.deleted` has its `id` and `name`. The three `team.member_` events have the person as Get the team answers them on a team (`id`, `teamId`, `name`, `email`, `joinedAt`), with `team`, the team they are on now or were on, by `id` and `name`; `team.member_moved` adds `from`, the team they left, and `team.member_left` adds `reason` (`removed` or `left`) and `keysStopped`.
15170
+ */
15171
+ "team.created": Record<string, unknown>;
15172
+ /**
15173
+ * A team was renamed or given other permissions. Its people can do what it now holds from their next request.
15174
+ *
15175
+ * `data`: For `team.created` and `team.updated` the team as [Get the team](https://docs.shoply.gg/api-reference/teams/get-the-team) answers it in `teams`, without its `people`; `team.deleted` has its `id` and `name`. The three `team.member_` events have the person as Get the team answers them on a team (`id`, `teamId`, `name`, `email`, `joinedAt`), with `team`, the team they are on now or were on, by `id` and `name`; `team.member_moved` adds `from`, the team they left, and `team.member_left` adds `reason` (`removed` or `left`) and `keysStopped`.
15176
+ */
15177
+ "team.updated": Record<string, unknown>;
15178
+ /**
15179
+ * A team with nobody on it was deleted, with its invites not yet taken up.
15180
+ *
15181
+ * `data`: For `team.created` and `team.updated` the team as [Get the team](https://docs.shoply.gg/api-reference/teams/get-the-team) answers it in `teams`, without its `people`; `team.deleted` has its `id` and `name`. The three `team.member_` events have the person as Get the team answers them on a team (`id`, `teamId`, `name`, `email`, `joinedAt`), with `team`, the team they are on now or were on, by `id` and `name`; `team.member_moved` adds `from`, the team they left, and `team.member_left` adds `reason` (`removed` or `left`) and `keysStopped`.
15182
+ */
15183
+ "team.deleted": Record<string, unknown>;
15184
+ /**
15185
+ * Somebody took up an invite and can now reach the store from their store switcher.
15186
+ *
15187
+ * `data`: For `team.created` and `team.updated` the team as [Get the team](https://docs.shoply.gg/api-reference/teams/get-the-team) answers it in `teams`, without its `people`; `team.deleted` has its `id` and `name`. The three `team.member_` events have the person as Get the team answers them on a team (`id`, `teamId`, `name`, `email`, `joinedAt`), with `team`, the team they are on now or were on, by `id` and `name`; `team.member_moved` adds `from`, the team they left, and `team.member_left` adds `reason` (`removed` or `left`) and `keysStopped`.
15188
+ */
15189
+ "team.member_joined": Record<string, unknown>;
15190
+ /**
15191
+ * Somebody on the team was moved to another team, and can do what that team holds.
15192
+ *
15193
+ * `data`: For `team.created` and `team.updated` the team as [Get the team](https://docs.shoply.gg/api-reference/teams/get-the-team) answers it in `teams`, without its `people`; `team.deleted` has its `id` and `name`. The three `team.member_` events have the person as Get the team answers them on a team (`id`, `teamId`, `name`, `email`, `joinedAt`), with `team`, the team they are on now or were on, by `id` and `name`; `team.member_moved` adds `from`, the team they left, and `team.member_left` adds `reason` (`removed` or `left`) and `keysStopped`.
15194
+ */
15195
+ "team.member_moved": Record<string, unknown>;
15196
+ /**
15197
+ * Somebody can no longer reach the store: they were removed, or they left. The API keys they made and the apps they connected stopped working with them.
15198
+ *
15199
+ * `data`: For `team.created` and `team.updated` the team as [Get the team](https://docs.shoply.gg/api-reference/teams/get-the-team) answers it in `teams`, without its `people`; `team.deleted` has its `id` and `name`. The three `team.member_` events have the person as Get the team answers them on a team (`id`, `teamId`, `name`, `email`, `joinedAt`), with `team`, the team they are on now or were on, by `id` and `name`; `team.member_moved` adds `from`, the team they left, and `team.member_left` adds `reason` (`removed` or `left`) and `keysStopped`.
15200
+ */
15201
+ "team.member_left": Record<string, unknown>;
14526
15202
  /**
14527
15203
  * A checkout was turned away by the blacklist, a blocked country, the VPN rule or the limit on unpaid orders. The same buyer turned away again for the same reason within ten minutes is not sent again.
14528
15204
  *
@@ -182,6 +182,13 @@ export const OPERATIONS = [
182
182
  {"id":"subscribers.list","name":"subscribers.list","method":"GET","path":"/stores/{storeId}/subscribers","params":[],"query":["show","search","page"],"body":false,"upload":null,"file":false,"paged":true,"customer":false,"signedIn":true,"idempotent":false},
183
183
  {"id":"subscribers.export","name":"subscribers.export","method":"GET","path":"/stores/{storeId}/subscribers/export","params":[],"query":["show","search","check"],"body":false,"upload":null,"file":true,"paged":false,"customer":false,"signedIn":true,"idempotent":false},
184
184
  {"id":"subscribers.unsubscribe","name":"subscribers.unsubscribe","method":"POST","path":"/stores/{storeId}/subscribers/unsubscribe","params":[],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
185
+ {"id":"emailTemplates.list","name":"emailTemplates.list","method":"GET","path":"/stores/{storeId}/email-templates","params":[],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":false},
186
+ {"id":"emailTemplates.shared","name":"emailTemplates.shared","method":"GET","path":"/stores/{storeId}/email-templates/shared","params":[],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":false},
187
+ {"id":"emailTemplates.saveShared","name":"emailTemplates.saveShared","method":"PUT","path":"/stores/{storeId}/email-templates/shared","params":[],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
188
+ {"id":"emailTemplates.show","name":"emailTemplates.show","method":"GET","path":"/stores/{storeId}/email-templates/{kind}","params":["kind"],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":false},
189
+ {"id":"emailTemplates.update","name":"emailTemplates.update","method":"PUT","path":"/stores/{storeId}/email-templates/{kind}","params":["kind"],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
190
+ {"id":"emailTemplates.preview","name":"emailTemplates.preview","method":"POST","path":"/stores/{storeId}/email-templates/{kind}/preview","params":["kind"],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
191
+ {"id":"emailTemplates.revert","name":"emailTemplates.revert","method":"POST","path":"/stores/{storeId}/email-templates/{kind}/revert","params":["kind"],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
185
192
  {"id":"customers.list","name":"customers.list","method":"GET","path":"/stores/{storeId}/customers","params":[],"query":["page","perPage","search","sort","only","tag","range","from","to","tz"],"body":false,"upload":null,"file":false,"paged":true,"customer":false,"signedIn":true,"idempotent":false},
186
193
  {"id":"customers.create","name":"customers.create","method":"POST","path":"/stores/{storeId}/customers","params":[],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
187
194
  {"id":"customers.export","name":"customers.export","method":"GET","path":"/stores/{storeId}/customers/export","params":[],"query":["search","sort","only","tag","check","range","from","to","tz"],"body":false,"upload":null,"file":true,"paged":false,"customer":false,"signedIn":true,"idempotent":false},
@@ -219,6 +226,16 @@ export const OPERATIONS = [
219
226
  {"id":"tickets.resolve","name":"tickets.resolve","method":"POST","path":"/stores/{storeId}/support-tickets/{ticketId}/resolve","params":["ticketId"],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
220
227
  {"id":"tickets.reopen","name":"tickets.reopen","method":"POST","path":"/stores/{storeId}/support-tickets/{ticketId}/reopen","params":["ticketId"],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
221
228
  {"id":"tickets.picture","name":"tickets.picture","method":"GET","path":"/stores/{storeId}/support-tickets/{ticketId}/pictures/{name}","params":["ticketId","name"],"query":[],"body":false,"upload":null,"file":true,"paged":false,"customer":false,"signedIn":true,"idempotent":false},
229
+ {"id":"team.get","name":"team.get","method":"GET","path":"/stores/{storeId}/team","params":[],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":false},
230
+ {"id":"team.activity","name":"team.activity","method":"GET","path":"/stores/{storeId}/team/activity","params":[],"query":["person","area","page"],"body":false,"upload":null,"file":false,"paged":true,"customer":false,"signedIn":true,"idempotent":false},
231
+ {"id":"teams.create","name":"teams.create","method":"POST","path":"/stores/{storeId}/teams","params":[],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
232
+ {"id":"teams.update","name":"teams.update","method":"PUT","path":"/stores/{storeId}/teams/{teamId}","params":["teamId"],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
233
+ {"id":"teams.delete","name":"teams.delete","method":"DELETE","path":"/stores/{storeId}/teams/{teamId}","params":["teamId"],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
234
+ {"id":"team.invite","name":"team.invite","method":"POST","path":"/stores/{storeId}/team/invites","params":[],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
235
+ {"id":"team.resendInvite","name":"team.resendInvite","method":"POST","path":"/stores/{storeId}/team/invites/{inviteId}/resend","params":["inviteId"],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
236
+ {"id":"team.cancelInvite","name":"team.cancelInvite","method":"DELETE","path":"/stores/{storeId}/team/invites/{inviteId}","params":["inviteId"],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
237
+ {"id":"team.moveMember","name":"team.moveMember","method":"PUT","path":"/stores/{storeId}/team/members/{memberId}","params":["memberId"],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
238
+ {"id":"team.removeMember","name":"team.removeMember","method":"DELETE","path":"/stores/{storeId}/team/members/{memberId}","params":["memberId"],"query":[],"body":false,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
222
239
  {"id":"blacklist.list","name":"blacklist.list","method":"GET","path":"/stores/{storeId}/blacklist","params":[],"query":["page","perPage","status","type","search"],"body":false,"upload":null,"file":false,"paged":true,"customer":false,"signedIn":true,"idempotent":false},
223
240
  {"id":"blacklist.create","name":"blacklist.create","method":"POST","path":"/stores/{storeId}/blacklist","params":[],"query":[],"body":true,"upload":null,"file":false,"paged":false,"customer":false,"signedIn":true,"idempotent":true},
224
241
  {"id":"blacklist.export","name":"blacklist.export","method":"GET","path":"/stores/{storeId}/blacklist/export","params":[],"query":["status","type","search","check"],"body":false,"upload":null,"file":true,"paged":false,"customer":false,"signedIn":true,"idempotent":false},
@@ -319,4 +336,4 @@ export const OPERATIONS = [
319
336
  ];
320
337
 
321
338
  /** Every webhook event, by name. */
322
- export const EVENTS = ["order.created","order.payment_started","order.paid","order.delivered","order.redelivered","order.email_failed","order.cancelled","order.refunded","order.disputed","order.chargeback","order.payment_submitted","order.rerouted","review.created","review.removed","review.flag_declined","stock.low","stock.out","product.created","product.updated","product.deleted","customer.created","customer.balance_changed","customer.tagged","customer.untagged","affiliate.created","affiliate.payout_requested","affiliate.payout_answered","affiliate.balance_changed","subscription.started","subscription.renewed","subscription.cancelled","subscription.ended","subscription.paused","subscription.resumed","subscription.charge_failed","cart.email_sent","cart.recovered","cart.unsubscribed","winback.email_sent","winback.won_back","subscriber.subscribed","subscriber.unsubscribed","routing.processor_paused","routing.processor_resumed","dispute.opened","dispute.updated","dispute.won","dispute.lost","dispute.closed","app.connected","app.disconnected","ticket.opened","ticket.message","ticket.resolved","ticket.reopened","fraud.checkout_blocked","webhook.test"];
339
+ export const EVENTS = ["order.created","order.payment_started","order.paid","order.delivered","order.redelivered","order.email_failed","order.cancelled","order.refunded","order.disputed","order.chargeback","order.payment_submitted","order.rerouted","review.created","review.removed","review.flag_declined","stock.low","stock.out","product.created","product.updated","product.deleted","customer.created","customer.balance_changed","customer.tagged","customer.untagged","affiliate.created","affiliate.payout_requested","affiliate.payout_answered","affiliate.balance_changed","subscription.started","subscription.renewed","subscription.cancelled","subscription.ended","subscription.paused","subscription.resumed","subscription.charge_failed","cart.email_sent","cart.recovered","cart.unsubscribed","winback.email_sent","winback.won_back","subscriber.subscribed","subscriber.unsubscribed","routing.processor_paused","routing.processor_resumed","dispute.opened","dispute.updated","dispute.won","dispute.lost","dispute.closed","app.connected","app.disconnected","ticket.opened","ticket.message","ticket.resolved","ticket.reopened","team.created","team.updated","team.deleted","team.member_joined","team.member_moved","team.member_left","fraud.checkout_blocked","webhook.test"];
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.4.0";
17
+ export const VERSION = "0.5.0";
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.4.0",
3
+ "version": "0.5.0",
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",