@wix/auto_sdk_ecom_memberships 1.0.0 → 1.0.2

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.
@@ -1,10 +1,15 @@
1
1
  export interface ListEligibleMembershipsRequest {
2
- /** The line items for which to list eligible memberships. */
2
+ /**
3
+ * The line items for which to list eligible memberships.
4
+ * @minSize 1
5
+ * @maxSize 300
6
+ */
3
7
  lineItems: LineItem[];
4
8
  /**
5
9
  * Member ID.
6
10
  *
7
11
  * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.
12
+ * @format GUID
8
13
  */
9
14
  memberId: string;
10
15
  /**
@@ -16,7 +21,11 @@ export interface ListEligibleMembershipsRequest {
16
21
  selectedMemberships?: SelectedMemberships;
17
22
  }
18
23
  export interface LineItem {
19
- /** Line item ID. */
24
+ /**
25
+ * Line item ID.
26
+ * @minLength 1
27
+ * @maxLength 100
28
+ */
20
29
  _id?: string;
21
30
  /** Catalog and item reference info. */
22
31
  catalogReference?: CatalogReference;
@@ -28,12 +37,18 @@ export interface LineItem {
28
37
  * The value will usually be the same as `catalogReference.catalogItemId`.
29
38
  * In cases when these are not the same, this field will return the actual ID of the item in the catalog.
30
39
  * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.
40
+ * @minLength 1
41
+ * @maxLength 36
31
42
  */
32
43
  rootCatalogItemId?: string | null;
33
44
  }
34
45
  /** Used for grouping line items. Sent when an item is added to a cart, checkout, or order. */
35
46
  export interface CatalogReference {
36
- /** ID of the item within the catalog it belongs to. */
47
+ /**
48
+ * ID of the item within the catalog it belongs to.
49
+ * @minLength 1
50
+ * @maxLength 36
51
+ */
37
52
  catalogItemId?: string;
38
53
  /**
39
54
  * ID of the app providing the catalog.
@@ -44,12 +59,13 @@ export interface CatalogReference {
44
59
  * + Wix Stores: `"215238eb-22a5-4c36-9e7b-e7c08025e04e"`
45
60
  * + Wix Bookings: `"13d21c63-b5ec-5912-8397-c3a5ddb27a97"`
46
61
  * + Wix Restaurants: `"9a5d83fd-8570-482e-81ab-cfa88942ee60"`
62
+ * @minLength 1
47
63
  */
48
64
  appId?: string;
49
65
  /**
50
66
  * Additional item details in key:value pairs. Use this optional field to provide more specificity with item selection. The `options` field values differ depending on which catalog is providing the items.
51
67
  *
52
- * For products and variants from a Wix Stores catalog, learn more about [eCommerce integration](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration).
68
+ * For products and variants from a Wix Stores catalog, learn more about eCommerce integration ([SDK](https://dev.wix.com/docs/sdk/backend-modules/stores/catalog-v3/e-commerce-integration) | [REST](https://dev.wix.com/docs/rest/business-solutions/stores/catalog/e-commerce-integration)).
53
69
  */
54
70
  options?: Record<string, any> | null;
55
71
  }
@@ -59,33 +75,69 @@ export interface ServiceProperties {
59
75
  * For example, the start time of a class.
60
76
  */
61
77
  scheduledDate?: Date | null;
62
- /** The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room. */
78
+ /**
79
+ * The number of people participating in the service. For example, the number of people attending a class or the number of people per hotel room.
80
+ * @min 1
81
+ * @max 10000
82
+ */
63
83
  numberOfParticipants?: number | null;
64
84
  }
65
85
  export interface SelectedMemberships {
66
- /** Selected memberships. */
86
+ /**
87
+ * Selected memberships.
88
+ * @maxSize 300
89
+ */
67
90
  memberships?: SelectedMembership[];
68
91
  }
69
92
  export interface SelectedMembership {
70
- /** Membership ID. */
93
+ /**
94
+ * Membership ID.
95
+ * @minLength 1
96
+ * @maxLength 100
97
+ */
71
98
  _id?: string;
72
- /** IDs of the line items this membership applies to. */
99
+ /**
100
+ * IDs of the line items this membership applies to.
101
+ * @minSize 1
102
+ * @maxSize 300
103
+ * @minLength 1
104
+ * @maxLength 100
105
+ */
73
106
  lineItemIds?: string[];
74
107
  }
75
108
  export interface ListEligibleMembershipsResponse {
76
- /** List of memberships that are eligible for the given member and line items. */
109
+ /**
110
+ * List of memberships that are eligible for the given member and line items.
111
+ * @maxSize 300
112
+ */
77
113
  eligibleMemberships?: Membership[];
78
- /** List of memberships owned by the member, but cannot be used due to the reason provided. */
114
+ /**
115
+ * List of memberships owned by the member, but cannot be used due to the reason provided.
116
+ * @maxSize 300
117
+ */
79
118
  invalidMemberships?: InvalidMembership[];
80
- /** List of selected memberships and which line items they apply to. */
119
+ /**
120
+ * List of selected memberships and which line items they apply to.
121
+ * @maxSize 300
122
+ */
81
123
  selectedMemberships?: SelectedMembership[];
82
124
  }
83
125
  export interface Membership {
84
- /** Membership ID. */
126
+ /**
127
+ * Membership ID.
128
+ * @minLength 1
129
+ * @maxLength 100
130
+ */
85
131
  _id?: string;
86
132
  /** Membership name. */
87
133
  name?: MembershipName;
88
- /** Line item IDs this membership applies to. */
134
+ /**
135
+ * Line item IDs this membership applies to.
136
+ * @minSize 1
137
+ * @maxSize 300
138
+ * @minLength 1
139
+ * @maxLength 100
140
+ */
89
141
  lineItemIds?: string[];
90
142
  /** Total and remaining membership credits. */
91
143
  credits?: MembershipPaymentCredits;
@@ -95,13 +147,22 @@ export interface Membership {
95
147
  additionalData?: Record<string, any> | null;
96
148
  }
97
149
  export interface MembershipName {
98
- /** Membership name. */
150
+ /**
151
+ * Membership name.
152
+ * @maxLength 100
153
+ */
99
154
  original?: string;
100
- /** Translated membership name. Defaults to `original` when not provided. */
155
+ /**
156
+ * Translated membership name. Defaults to `original` when not provided.
157
+ * @maxLength 100
158
+ */
101
159
  translated?: string | null;
102
160
  }
103
161
  export interface MembershipPaymentCredits {
104
- /** Membership's total amount of credits. */
162
+ /**
163
+ * Membership's total amount of credits.
164
+ * @min 1
165
+ */
105
166
  total?: number;
106
167
  /** Membership's remaining amount of credits. */
107
168
  remaining?: number;
@@ -109,11 +170,18 @@ export interface MembershipPaymentCredits {
109
170
  export interface InvalidMembership {
110
171
  /** The membership that is invalid and cannot be used. */
111
172
  membership?: Membership;
112
- /** Reason why this membership is invalid. */
173
+ /**
174
+ * Reason why this membership is invalid.
175
+ * @minLength 1
176
+ * @maxLength 200
177
+ */
113
178
  reason?: string;
114
179
  }
115
180
  export interface MembershipInvalidSelectionErrors {
116
- /** Error details for invalid memberships. */
181
+ /**
182
+ * Error details for invalid memberships.
183
+ * @maxSize 300
184
+ */
117
185
  membershipInvalidSelectionErrors?: MembershipInvalidSelectionError[];
118
186
  }
119
187
  export interface MembershipInvalidSelectionError extends MembershipInvalidSelectionErrorErrorDataOneOf {
@@ -121,9 +189,15 @@ export interface MembershipInvalidSelectionError extends MembershipInvalidSelect
121
189
  lineItemNotFoundInfo?: LineItemNotFoundInfo;
122
190
  /** Error details for line items that cannot be used with this membership. */
123
191
  membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;
124
- /** Reason why this membership selection is invalid. */
192
+ /**
193
+ * Reason why this membership selection is invalid.
194
+ * @maxLength 1000
195
+ */
125
196
  membershipSelectionInvalidReason?: string | null;
126
- /** Membership ID. */
197
+ /**
198
+ * Membership ID.
199
+ * @format GUID
200
+ */
127
201
  membershipId?: string;
128
202
  /** Error type. */
129
203
  errorType?: MembershipErrorType;
@@ -134,7 +208,10 @@ export interface MembershipInvalidSelectionErrorErrorDataOneOf {
134
208
  lineItemNotFoundInfo?: LineItemNotFoundInfo;
135
209
  /** Error details for line items that cannot be used with this membership. */
136
210
  membershipCannotBeUsedForLineItemsInfo?: MembershipCannotBeUsedForLineItemsInfo;
137
- /** Reason why this membership selection is invalid. */
211
+ /**
212
+ * Reason why this membership selection is invalid.
213
+ * @maxLength 1000
214
+ */
138
215
  membershipSelectionInvalidReason?: string | null;
139
216
  }
140
217
  export declare enum MembershipErrorType {
@@ -149,17 +226,32 @@ export declare enum MembershipErrorType {
149
226
  MEMBERSHIP_SELECTION_INVALID = "MEMBERSHIP_SELECTION_INVALID"
150
227
  }
151
228
  export interface LineItemNotFoundInfo {
152
- /** Line item IDs that were missing. */
229
+ /**
230
+ * Line item IDs that were missing.
231
+ * @maxSize 300
232
+ * @minLength 1
233
+ * @maxLength 100
234
+ */
153
235
  lineItemIds?: string[];
154
236
  }
155
237
  export interface MembershipCannotBeUsedForLineItemsInfo {
156
- /** Line items that cannot be used with this membership, and the reason why. */
238
+ /**
239
+ * Line items that cannot be used with this membership, and the reason why.
240
+ * @maxSize 300
241
+ */
157
242
  lineItems?: MembershipCannotBeUsedForLineItemInfo[];
158
243
  }
159
244
  export interface MembershipCannotBeUsedForLineItemInfo {
160
- /** Line item ID. */
245
+ /**
246
+ * Line item ID.
247
+ * @minLength 1
248
+ * @maxLength 100
249
+ */
161
250
  lineItemId?: string;
162
- /** Reason why this line item cannot be used with this membership. */
251
+ /**
252
+ * Reason why this line item cannot be used with this membership.
253
+ * @maxLength 1000
254
+ */
163
255
  reason?: string;
164
256
  }
165
257
  export interface ChargeMembershipRequest {
@@ -167,13 +259,20 @@ export interface ChargeMembershipRequest {
167
259
  * Member ID.
168
260
  *
169
261
  * Do not retrieve this from the request context. In some cases the caller is not a member, but a user who is using the membership on behalf of a member.
262
+ * @format GUID
170
263
  */
171
264
  memberId: string;
172
- /** Membership ID, as returned from the List Eligible Memberships call. */
265
+ /**
266
+ * Membership ID, as returned from the List Eligible Memberships call.
267
+ * @minLength 1
268
+ * @maxLength 100
269
+ */
173
270
  membershipId: string;
174
271
  /**
175
272
  * Idempotency key to avoid duplicate charge.
176
273
  * The value will usually would be the same as `membershipId` + `orderId` + `rootCatalogItemId`.
274
+ * @minLength 1
275
+ * @maxLength 200
177
276
  */
178
277
  idempotencyKey: string;
179
278
  /**
@@ -190,6 +289,8 @@ export interface ChargeMembershipRequest {
190
289
  * The value will usually be the same as `catalogReference.catalogItemId`.
191
290
  * In cases when these are not the same, this field will return the actual ID of the item in the catalog.
192
291
  * For example, for Wix bookings, the value of `catalogReference.catalogItemId` is the booking ID, but `rootCatalogItemId` is set to the service ID.
292
+ * @minLength 1
293
+ * @maxLength 36
193
294
  */
194
295
  rootCatalogItemId?: string | null;
195
296
  /** Additional data about this charge. */
@@ -200,6 +301,8 @@ export interface ChargeMembershipResponse {
200
301
  * The transaction ID for this charge.
201
302
  *
202
303
  * Use this ID to void the charge.
304
+ * @minLength 1
305
+ * @maxLength 100
203
306
  */
204
307
  transactionId?: string;
205
308
  }
@@ -247,21 +350,37 @@ export interface Ended {
247
350
  endDate?: Date | null;
248
351
  }
249
352
  export interface MembershipAlreadyChargedError {
250
- /** ID of the transaction that was already used for membership charge. */
353
+ /**
354
+ * ID of the transaction that was already used for membership charge.
355
+ * @minLength 1
356
+ * @maxLength 100
357
+ */
251
358
  transactionId?: string;
252
359
  }
253
360
  export interface GetMembershipVoidabilityRequest {
254
- /** Transaction ID to check if it can be voided. */
361
+ /**
362
+ * Transaction ID to check if it can be voided.
363
+ * @minLength 1
364
+ * @maxLength 100
365
+ */
255
366
  transactionId: string;
256
367
  }
257
368
  export interface GetMembershipVoidabilityResponse {
258
369
  /** Whether the membership charge can be voided. */
259
370
  voidable?: boolean;
260
- /** Reason why the membership charge cannot be voided. */
371
+ /**
372
+ * Reason why the membership charge cannot be voided.
373
+ * @minLength 1
374
+ * @maxLength 200
375
+ */
261
376
  reason?: string | null;
262
377
  }
263
378
  export interface VoidMembershipChargeRequest {
264
- /** Transaction ID to void. */
379
+ /**
380
+ * Transaction ID to void.
381
+ * @minLength 1
382
+ * @maxLength 100
383
+ */
265
384
  transactionId: string;
266
385
  }
267
386
  export interface VoidMembershipChargeResponse {
@@ -270,9 +389,15 @@ export interface MembershipsSPIConfig {
270
389
  /**
271
390
  * The base URI where the endpoints are called. Wix eCommerce appends the endpoint path to the base URI.
272
391
  * For example, to call the Charge Membership endpoint at https://my-memberships.com/v1/charge-membership, the base URI you provide here is https://my-memberships.com/.
392
+ * @format WEB_URL
273
393
  */
274
394
  deploymentUri?: string;
275
- /** The app IDs of the catalogs your app supports. */
395
+ /**
396
+ * The app IDs of the catalogs your app supports.
397
+ * @minSize 1
398
+ * @maxSize 300
399
+ * @format GUID
400
+ */
276
401
  catalogAppDefIds?: string[];
277
402
  }
278
403
  /**
@@ -291,13 +416,19 @@ export interface MembershipsSPIConfig {
291
416
  export interface Context {
292
417
  /** A unique identifier of the request. You may print this ID to your logs to help with future debugging and easier correlation with Wix's logs. */
293
418
  requestId?: string | null;
294
- /** [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code. */
419
+ /**
420
+ * [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) 3-letter currency code.
421
+ * @format CURRENCY
422
+ */
295
423
  currency?: string | null;
296
424
  /** An object that describes the identity that triggered this request. */
297
425
  identity?: IdentificationData;
298
426
  /** A string representing a language and region in the format of `"xx-XX"`. First 2 letters represent the language code according to ISO 639-1. This is followed by a dash "-", and then a by 2 capital letters representing the region according to ISO 3166-2. For example, `"en-US"`. */
299
427
  languages?: string[];
300
- /** The service provider app's instance ID. */
428
+ /**
429
+ * The service provider app's instance ID.
430
+ * @format GUID
431
+ */
301
432
  instanceId?: string | null;
302
433
  }
303
434
  export declare enum IdentityType {
@@ -308,25 +439,49 @@ export declare enum IdentityType {
308
439
  APP = "APP"
309
440
  }
310
441
  export interface IdentificationData extends IdentificationDataIdOneOf {
311
- /** ID of a site visitor that has not logged in to the site. */
442
+ /**
443
+ * ID of a site visitor that has not logged in to the site.
444
+ * @format GUID
445
+ */
312
446
  anonymousVisitorId?: string;
313
- /** ID of a site visitor that has logged in to the site. */
447
+ /**
448
+ * ID of a site visitor that has logged in to the site.
449
+ * @format GUID
450
+ */
314
451
  memberId?: string;
315
- /** ID of a Wix user (site owner, contributor, etc.). */
452
+ /**
453
+ * ID of a Wix user (site owner, contributor, etc.).
454
+ * @format GUID
455
+ */
316
456
  wixUserId?: string;
317
- /** ID of an app. */
457
+ /**
458
+ * ID of an app.
459
+ * @format GUID
460
+ */
318
461
  appId?: string;
319
462
  /** @readonly */
320
463
  identityType?: IdentityType;
321
464
  }
322
465
  /** @oneof */
323
466
  export interface IdentificationDataIdOneOf {
324
- /** ID of a site visitor that has not logged in to the site. */
467
+ /**
468
+ * ID of a site visitor that has not logged in to the site.
469
+ * @format GUID
470
+ */
325
471
  anonymousVisitorId?: string;
326
- /** ID of a site visitor that has logged in to the site. */
472
+ /**
473
+ * ID of a site visitor that has logged in to the site.
474
+ * @format GUID
475
+ */
327
476
  memberId?: string;
328
- /** ID of a Wix user (site owner, contributor, etc.). */
477
+ /**
478
+ * ID of a Wix user (site owner, contributor, etc.).
479
+ * @format GUID
480
+ */
329
481
  wixUserId?: string;
330
- /** ID of an app. */
482
+ /**
483
+ * ID of an app.
484
+ * @format GUID
485
+ */
331
486
  appId?: string;
332
487
  }
@@ -1 +1 @@
1
- {"version":3,"file":"service-plugins-types.js","sourceRoot":"","sources":["../../../src/service-plugins-types.ts"],"names":[],"mappings":";;;AA0JA,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,4BAA4B;IAC5B,oEAA6C,CAAA;IAC7C,mEAAmE;IACnE,kEAA2C,CAAA;IAC3C,0EAA0E;IAC1E,4GAAqF,CAAA;IACrF,sGAAsG;IACtG,oFAA6D,CAAA;AAC/D,CAAC,EAVW,mBAAmB,mCAAnB,mBAAmB,QAU9B;AAoFD,IAAY,6BASX;AATD,WAAY,6BAA6B;IACvC,oFAAoF;IACpF,kEAAiC,CAAA;IACjC,4CAA4C;IAC5C,oEAAmC,CAAA;IACnC,uCAAuC;IACvC,gDAAe,CAAA;IACf,gDAAgD;IAChD,sHAAqF,CAAA;AACvF,CAAC,EATW,6BAA6B,6CAA7B,6BAA6B,QASxC;AA+ED,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,uDAAuC,CAAA;IACvC,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,2BAAW,CAAA;AACb,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB"}
1
+ {"version":3,"file":"service-plugins-types.js","sourceRoot":"","sources":["../../../src/service-plugins-types.ts"],"names":[],"mappings":";;;AAuOA,IAAY,mBAUX;AAVD,WAAY,mBAAmB;IAC7B,0CAAmB,CAAA;IACnB,4BAA4B;IAC5B,oEAA6C,CAAA;IAC7C,mEAAmE;IACnE,kEAA2C,CAAA;IAC3C,0EAA0E;IAC1E,4GAAqF,CAAA;IACrF,sGAAsG;IACtG,oFAA6D,CAAA;AAC/D,CAAC,EAVW,mBAAmB,mCAAnB,mBAAmB,QAU9B;AA8GD,IAAY,6BASX;AATD,WAAY,6BAA6B;IACvC,oFAAoF;IACpF,kEAAiC,CAAA;IACjC,4CAA4C;IAC5C,oEAAmC,CAAA;IACnC,uCAAuC;IACvC,gDAAe,CAAA;IACf,gDAAgD;IAChD,sHAAqF,CAAA;AACvF,CAAC,EATW,6BAA6B,6CAA7B,6BAA6B,QASxC;AA2GD,IAAY,YAMX;AAND,WAAY,YAAY;IACtB,mCAAmB,CAAA;IACnB,uDAAuC,CAAA;IACvC,iCAAiB,CAAA;IACjB,qCAAqB,CAAA;IACrB,2BAAW,CAAA;AACb,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB"}