@wix/motion 1.0.40 → 1.0.42

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.
@@ -2,6 +2,12 @@ interface AlarmMessage {
2
2
  _id?: string;
3
3
  seconds?: number;
4
4
  }
5
+ interface AlarmRequest {
6
+ seconds: number;
7
+ someString?: string;
8
+ someOtherString?: string;
9
+ someOtherField?: string;
10
+ }
5
11
  interface AlarmResponse {
6
12
  time?: Date;
7
13
  }
@@ -11,10 +17,93 @@ interface AlarmSnoozed {
11
17
  }
12
18
  interface AlarmDeleted {
13
19
  }
20
+ interface UpdateAlarmRequest {
21
+ alarm: AlarmMessage;
22
+ }
14
23
  interface UpdateAlarmResponse {
15
24
  alarm?: AlarmMessage;
16
25
  }
17
- interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
26
+ interface DomainEvent$2 extends DomainEventBodyOneOf$2 {
27
+ createdEvent?: EntityCreatedEvent$2;
28
+ updatedEvent?: EntityUpdatedEvent$2;
29
+ deletedEvent?: EntityDeletedEvent$2;
30
+ actionEvent?: ActionEvent$2;
31
+ /**
32
+ * Unique event ID.
33
+ * Allows clients to ignore duplicate webhooks.
34
+ */
35
+ _id?: string;
36
+ /**
37
+ * Assumes actions are also always typed to an entity_type
38
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
39
+ */
40
+ entityFqdn?: string;
41
+ /**
42
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
43
+ * This is although the created/updated/deleted notion is duplication of the oneof types
44
+ * Example: created/updated/deleted/started/completed/email_opened
45
+ */
46
+ slug?: string;
47
+ /** ID of the entity associated with the event. */
48
+ entityId?: string;
49
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
50
+ eventTime?: Date;
51
+ /**
52
+ * Whether the event was triggered as a result of a privacy regulation application
53
+ * (for example, GDPR).
54
+ */
55
+ triggeredByAnonymizeRequest?: boolean | null;
56
+ /** If present, indicates the action that triggered the event. */
57
+ originatedFrom?: string | null;
58
+ /**
59
+ * A sequence number defining the order of updates to the underlying entity.
60
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
61
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
62
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
63
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
64
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
65
+ */
66
+ entityEventSequence?: string | null;
67
+ }
68
+ /** @oneof */
69
+ interface DomainEventBodyOneOf$2 {
70
+ createdEvent?: EntityCreatedEvent$2;
71
+ updatedEvent?: EntityUpdatedEvent$2;
72
+ deletedEvent?: EntityDeletedEvent$2;
73
+ actionEvent?: ActionEvent$2;
74
+ }
75
+ interface EntityCreatedEvent$2 {
76
+ entity?: string;
77
+ }
78
+ interface RestoreInfo$2 {
79
+ deletedDate?: Date;
80
+ }
81
+ interface EntityUpdatedEvent$2 {
82
+ /**
83
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
84
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
85
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
86
+ */
87
+ currentEntity?: string;
88
+ }
89
+ interface EntityDeletedEvent$2 {
90
+ /** Entity that was deleted */
91
+ deletedEntity?: string | null;
92
+ }
93
+ interface ActionEvent$2 {
94
+ body?: string;
95
+ }
96
+ interface MessageEnvelope$2 {
97
+ /** App instance ID. */
98
+ instanceId?: string | null;
99
+ /** Event type. */
100
+ eventType?: string;
101
+ /** The identification type and identity data. */
102
+ identity?: IdentificationData$2;
103
+ /** Stringify payload. */
104
+ data?: string;
105
+ }
106
+ interface IdentificationData$2 extends IdentificationDataIdOneOf$2 {
18
107
  /** ID of a site visitor that has not logged in to the site. */
19
108
  anonymousVisitorId?: string;
20
109
  /** ID of a site visitor that has logged in to the site. */
@@ -24,10 +113,10 @@ interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
24
113
  /** ID of an app. */
25
114
  appId?: string;
26
115
  /** @readonly */
27
- identityType?: WebhookIdentityType$1;
116
+ identityType?: WebhookIdentityType$2;
28
117
  }
29
118
  /** @oneof */
30
- interface IdentificationDataIdOneOf$1 {
119
+ interface IdentificationDataIdOneOf$2 {
31
120
  /** ID of a site visitor that has not logged in to the site. */
32
121
  anonymousVisitorId?: string;
33
122
  /** ID of a site visitor that has logged in to the site. */
@@ -37,26 +126,35 @@ interface IdentificationDataIdOneOf$1 {
37
126
  /** ID of an app. */
38
127
  appId?: string;
39
128
  }
40
- declare enum WebhookIdentityType$1 {
129
+ declare enum WebhookIdentityType$2 {
41
130
  UNKNOWN = "UNKNOWN",
42
131
  ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
43
132
  MEMBER = "MEMBER",
44
133
  WIX_USER = "WIX_USER",
45
134
  APP = "APP"
46
135
  }
47
- interface UpdateAlarmResponseNonNullableFields {
48
- alarm?: {
136
+ interface AlarmRequestRequiredFields {
137
+ seconds: number;
138
+ }
139
+ interface UpdateAlarmRequestRequiredFields {
140
+ alarm: {
49
141
  _id: string;
50
- seconds: number;
51
142
  };
52
143
  }
144
+ interface AlarmMessageNonNullableFields {
145
+ _id: string;
146
+ seconds: number;
147
+ }
148
+ interface UpdateAlarmResponseNonNullableFields {
149
+ alarm?: AlarmMessageNonNullableFields;
150
+ }
53
151
  interface BaseEventMetadata$1 {
54
152
  /** App instance ID. */
55
153
  instanceId?: string | null;
56
154
  /** Event type. */
57
155
  eventType?: string;
58
156
  /** The identification type and identity data. */
59
- identity?: IdentificationData$1;
157
+ identity?: IdentificationData$2;
60
158
  }
61
159
  interface EventMetadata$1 extends BaseEventMetadata$1 {
62
160
  /**
@@ -77,7 +175,7 @@ interface EventMetadata$1 extends BaseEventMetadata$1 {
77
175
  slug?: string;
78
176
  /** ID of the entity associated with the event. */
79
177
  entityId?: string;
80
- /** Event timestamp. */
178
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
81
179
  eventTime?: Date;
82
180
  /**
83
181
  * Whether the event was triggered as a result of a privacy regulation application
@@ -121,6 +219,8 @@ interface UpdateAlarm {
121
219
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
122
220
  interface HttpClient {
123
221
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
222
+ fetchWithAuth: typeof fetch;
223
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
124
224
  }
125
225
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
126
226
  type HttpResponse<T = any> = {
@@ -146,91 +246,160 @@ type EventDefinition<Payload = unknown, Type extends string = string> = {
146
246
  __type: 'event-definition';
147
247
  type: Type;
148
248
  isDomainEvent?: boolean;
149
- transformations?: unknown;
249
+ transformations?: (envelope: unknown) => Payload;
150
250
  __payload: Payload;
151
251
  };
152
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
252
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
153
253
  type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
154
254
  type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
155
255
 
156
- /**
157
- * Creates a booking.
158
- *
159
- *
160
- * To create a booking for an appointment or a session of a class, pass a booking with the relevant `slot`.
161
- *
162
- * To create a booking for the entire course, pass a booking with the relevant `schedule`.
163
- * You can use Query Availability to check the availability beforehand.
164
- *
165
- * If you create a booking for an existing session, we recommend that you only pass `slot.sessionId`.
166
- * Then, any specified slot details are calculated.
167
- *
168
- * If you create a booking for a new session, we recommend to call Query Availability first.
169
- * Then, pass the retrieved `availability.slot` object as the BookedEntity.Slot of the booking in the request.
170
- *
171
- * Bookings are created with a status of `CREATED`.
172
- * `CREATED` bookings don't appear on the business calendar and don't affect a related schedule's availability.
173
- *
174
- * To create a booking with a given status, pass a booking with the wanted status.
175
- * This is only permitted for site Owners.
176
- *
177
- * You can pass a `participantNotification.message` to notify the customer of the booking with a message.
178
- * It's also necessary to pass `participantNotification.notifyParticipants`as `true` to send the message.
179
- *
180
- * You can pass `sendSmsReminder` as `true`, if you want an SMS reminder to be sent to the phone number specified in the ContactDetails, 24 hours before the session starts.
181
- *
182
- * When creating a booking you must pass either `participantsChoices` or `totalParticipants`. If you pass `participantsChoices`, all the
183
- * provided choices must exist for the service, otherwise the call returns an `INVALID_SERVICE_CHOICES` error.
184
- *
185
- * When creating a booking, you can pass `selectedPaymentOption`.
186
- * This specifies which payment method the customer plans to use.
187
- * But it's possible for them to later use another supported payment method.
188
- *
189
- * You can skip the checkout and payment flow if you call Confirm Or Decline Booking otherwise, after you create the booking, you can use the
190
- * Wix eCommerce APIs (coming soon) for the checkout and payment flow or use a different service for checkout.
191
- * @param booking - The booking to create.
192
- * @public
193
- * @documentationMaturity preview
194
- * @requiredField booking
195
- * @requiredField booking.additionalFields._id
196
- * @requiredField booking.bookedEntity
197
- * @permissionScope Manage Bookings
198
- * @permissionScopeId SCOPE.DC-BOOKINGS.MANAGE-BOOKINGS
199
- * @permissionScope Manage Bookings - all permissions
200
- * @permissionScopeId SCOPE.DC-BOOKINGS-MEGA.MANAGE-BOOKINGS
201
- * @applicableIdentity APP
202
- * @applicableIdentity MEMBER
203
- * @applicableIdentity VISITOR
204
- */
205
- declare function alarm$1(httpClient: HttpClient): (seconds: number, options?: AlarmOptions) => Promise<AlarmResponse>;
206
- /**
207
- * Another thing
208
- */
209
- declare function updateAlarm$1(httpClient: HttpClient): (_id: string, alarm: UpdateAlarm) => Promise<UpdateAlarmResponse & UpdateAlarmResponseNonNullableFields>;
210
- declare const onAlarmTriggered$1: EventDefinition<AlarmTriggeredEnvelope, "wix.alarm.v1.alarm_alarm_triggered">;
211
- declare const onAlarmSnoozed$1: EventDefinition<AlarmSnoozedEnvelope, "wix.alarm.v1.alarm_alarm_snoozed">;
212
- declare const onAlarmDeleted$1: EventDefinition<AlarmDeletedEnvelope, "wix.alarm.v1.alarm_alarm_deleted">;
256
+ declare global {
257
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
258
+ interface SymbolConstructor {
259
+ readonly observable: symbol;
260
+ }
261
+ }
262
+
263
+ declare function createRESTModule$2<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
213
264
 
214
- declare const alarm: BuildRESTFunction<typeof alarm$1>;
215
- declare const updateAlarm: BuildRESTFunction<typeof updateAlarm$1>;
216
- declare const onAlarmTriggered: BuildEventDefinition<typeof onAlarmTriggered$1>;
217
- declare const onAlarmSnoozed: BuildEventDefinition<typeof onAlarmSnoozed$1>;
218
- declare const onAlarmDeleted: BuildEventDefinition<typeof onAlarmDeleted$1>;
265
+ declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
219
266
 
267
+ declare const alarm: ReturnType<typeof createRESTModule$2<typeof publicAlarm>>;
268
+ declare const updateAlarm: ReturnType<typeof createRESTModule$2<typeof publicUpdateAlarm>>;
269
+ declare const onAlarmTriggered: ReturnType<typeof createEventModule$1<typeof publicOnAlarmTriggered>>;
270
+ declare const onAlarmSnoozed: ReturnType<typeof createEventModule$1<typeof publicOnAlarmSnoozed>>;
271
+ declare const onAlarmDeleted: ReturnType<typeof createEventModule$1<typeof publicOnAlarmDeleted>>;
272
+
273
+ type context$2_AlarmDeleted = AlarmDeleted;
274
+ type context$2_AlarmDeletedEnvelope = AlarmDeletedEnvelope;
275
+ type context$2_AlarmMessage = AlarmMessage;
276
+ type context$2_AlarmOptions = AlarmOptions;
277
+ type context$2_AlarmRequest = AlarmRequest;
278
+ type context$2_AlarmRequestRequiredFields = AlarmRequestRequiredFields;
279
+ type context$2_AlarmResponse = AlarmResponse;
280
+ type context$2_AlarmSnoozed = AlarmSnoozed;
281
+ type context$2_AlarmSnoozedEnvelope = AlarmSnoozedEnvelope;
282
+ type context$2_AlarmTriggered = AlarmTriggered;
283
+ type context$2_AlarmTriggeredEnvelope = AlarmTriggeredEnvelope;
284
+ type context$2_UpdateAlarm = UpdateAlarm;
285
+ type context$2_UpdateAlarmRequest = UpdateAlarmRequest;
286
+ type context$2_UpdateAlarmRequestRequiredFields = UpdateAlarmRequestRequiredFields;
287
+ type context$2_UpdateAlarmResponse = UpdateAlarmResponse;
288
+ type context$2_UpdateAlarmResponseNonNullableFields = UpdateAlarmResponseNonNullableFields;
220
289
  declare const context$2_alarm: typeof alarm;
221
290
  declare const context$2_onAlarmDeleted: typeof onAlarmDeleted;
222
291
  declare const context$2_onAlarmSnoozed: typeof onAlarmSnoozed;
223
292
  declare const context$2_onAlarmTriggered: typeof onAlarmTriggered;
224
293
  declare const context$2_updateAlarm: typeof updateAlarm;
225
294
  declare namespace context$2 {
226
- export { context$2_alarm as alarm, context$2_onAlarmDeleted as onAlarmDeleted, context$2_onAlarmSnoozed as onAlarmSnoozed, context$2_onAlarmTriggered as onAlarmTriggered, context$2_updateAlarm as updateAlarm };
295
+ export { type ActionEvent$2 as ActionEvent, type context$2_AlarmDeleted as AlarmDeleted, type context$2_AlarmDeletedEnvelope as AlarmDeletedEnvelope, type context$2_AlarmMessage as AlarmMessage, type context$2_AlarmOptions as AlarmOptions, type context$2_AlarmRequest as AlarmRequest, type context$2_AlarmRequestRequiredFields as AlarmRequestRequiredFields, type context$2_AlarmResponse as AlarmResponse, type context$2_AlarmSnoozed as AlarmSnoozed, type context$2_AlarmSnoozedEnvelope as AlarmSnoozedEnvelope, type context$2_AlarmTriggered as AlarmTriggered, type context$2_AlarmTriggeredEnvelope as AlarmTriggeredEnvelope, type BaseEventMetadata$1 as BaseEventMetadata, type DomainEvent$2 as DomainEvent, type DomainEventBodyOneOf$2 as DomainEventBodyOneOf, type EntityCreatedEvent$2 as EntityCreatedEvent, type EntityDeletedEvent$2 as EntityDeletedEvent, type EntityUpdatedEvent$2 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type IdentificationData$2 as IdentificationData, type IdentificationDataIdOneOf$2 as IdentificationDataIdOneOf, type MessageEnvelope$2 as MessageEnvelope, type RestoreInfo$2 as RestoreInfo, type context$2_UpdateAlarm as UpdateAlarm, type context$2_UpdateAlarmRequest as UpdateAlarmRequest, type context$2_UpdateAlarmRequestRequiredFields as UpdateAlarmRequestRequiredFields, type context$2_UpdateAlarmResponse as UpdateAlarmResponse, type context$2_UpdateAlarmResponseNonNullableFields as UpdateAlarmResponseNonNullableFields, WebhookIdentityType$2 as WebhookIdentityType, context$2_alarm as alarm, context$2_onAlarmDeleted as onAlarmDeleted, context$2_onAlarmSnoozed as onAlarmSnoozed, context$2_onAlarmTriggered as onAlarmTriggered, context$2_updateAlarm as updateAlarm };
227
296
  }
228
297
 
298
+ interface MessageItem {
299
+ /** inner_message comment from EchoMessage proto def */
300
+ innerMessage?: string;
301
+ }
302
+ interface EchoRequest {
303
+ /** 1st part of the message */
304
+ arg1: string;
305
+ /** 2nd part of the message */
306
+ arg2?: string;
307
+ /** this field test translatable annotation */
308
+ titleField?: string;
309
+ someInt32?: number;
310
+ someDate?: Date;
311
+ }
312
+ interface EchoResponse {
313
+ /** message result as EchoMessage */
314
+ echoMessage?: EchoMessage;
315
+ /** messge reseult as string */
316
+ message?: string;
317
+ }
229
318
  interface Dispatched {
230
319
  /** the message someone says */
231
320
  echo?: EchoMessage;
232
321
  }
233
- interface IdentificationData extends IdentificationDataIdOneOf {
322
+ interface DomainEvent$1 extends DomainEventBodyOneOf$1 {
323
+ createdEvent?: EntityCreatedEvent$1;
324
+ updatedEvent?: EntityUpdatedEvent$1;
325
+ deletedEvent?: EntityDeletedEvent$1;
326
+ actionEvent?: ActionEvent$1;
327
+ /**
328
+ * Unique event ID.
329
+ * Allows clients to ignore duplicate webhooks.
330
+ */
331
+ _id?: string;
332
+ /**
333
+ * Assumes actions are also always typed to an entity_type
334
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
335
+ */
336
+ entityFqdn?: string;
337
+ /**
338
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
339
+ * This is although the created/updated/deleted notion is duplication of the oneof types
340
+ * Example: created/updated/deleted/started/completed/email_opened
341
+ */
342
+ slug?: string;
343
+ /** ID of the entity associated with the event. */
344
+ entityId?: string;
345
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
346
+ eventTime?: Date;
347
+ /**
348
+ * Whether the event was triggered as a result of a privacy regulation application
349
+ * (for example, GDPR).
350
+ */
351
+ triggeredByAnonymizeRequest?: boolean | null;
352
+ /** If present, indicates the action that triggered the event. */
353
+ originatedFrom?: string | null;
354
+ /**
355
+ * A sequence number defining the order of updates to the underlying entity.
356
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
357
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
358
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
359
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
360
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
361
+ */
362
+ entityEventSequence?: string | null;
363
+ }
364
+ /** @oneof */
365
+ interface DomainEventBodyOneOf$1 {
366
+ createdEvent?: EntityCreatedEvent$1;
367
+ updatedEvent?: EntityUpdatedEvent$1;
368
+ deletedEvent?: EntityDeletedEvent$1;
369
+ actionEvent?: ActionEvent$1;
370
+ }
371
+ interface EntityCreatedEvent$1 {
372
+ entity?: string;
373
+ }
374
+ interface RestoreInfo$1 {
375
+ deletedDate?: Date;
376
+ }
377
+ interface EntityUpdatedEvent$1 {
378
+ /**
379
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
380
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
381
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
382
+ */
383
+ currentEntity?: string;
384
+ }
385
+ interface EntityDeletedEvent$1 {
386
+ /** Entity that was deleted */
387
+ deletedEntity?: string | null;
388
+ }
389
+ interface ActionEvent$1 {
390
+ body?: string;
391
+ }
392
+ interface MessageEnvelope$1 {
393
+ /** App instance ID. */
394
+ instanceId?: string | null;
395
+ /** Event type. */
396
+ eventType?: string;
397
+ /** The identification type and identity data. */
398
+ identity?: IdentificationData$1;
399
+ /** Stringify payload. */
400
+ data?: string;
401
+ }
402
+ interface IdentificationData$1 extends IdentificationDataIdOneOf$1 {
234
403
  /** ID of a site visitor that has not logged in to the site. */
235
404
  anonymousVisitorId?: string;
236
405
  /** ID of a site visitor that has logged in to the site. */
@@ -240,10 +409,10 @@ interface IdentificationData extends IdentificationDataIdOneOf {
240
409
  /** ID of an app. */
241
410
  appId?: string;
242
411
  /** @readonly */
243
- identityType?: WebhookIdentityType;
412
+ identityType?: WebhookIdentityType$1;
244
413
  }
245
414
  /** @oneof */
246
- interface IdentificationDataIdOneOf {
415
+ interface IdentificationDataIdOneOf$1 {
247
416
  /** ID of a site visitor that has not logged in to the site. */
248
417
  anonymousVisitorId?: string;
249
418
  /** ID of a site visitor that has logged in to the site. */
@@ -253,13 +422,28 @@ interface IdentificationDataIdOneOf {
253
422
  /** ID of an app. */
254
423
  appId?: string;
255
424
  }
256
- declare enum WebhookIdentityType {
425
+ declare enum WebhookIdentityType$1 {
257
426
  UNKNOWN = "UNKNOWN",
258
427
  ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
259
428
  MEMBER = "MEMBER",
260
429
  WIX_USER = "WIX_USER",
261
430
  APP = "APP"
262
431
  }
432
+ interface EchoRequestRequiredFields {
433
+ arg1: string;
434
+ }
435
+ interface MessageItemNonNullableFields {
436
+ innerMessage: string;
437
+ }
438
+ interface EchoMessageNonNullableFields {
439
+ message: string;
440
+ messagesList: MessageItemNonNullableFields[];
441
+ _id: string;
442
+ }
443
+ interface EchoResponseNonNullableFields {
444
+ echoMessage?: EchoMessageNonNullableFields;
445
+ message: string;
446
+ }
263
447
  interface EchoMessage {
264
448
  veloMessage: string;
265
449
  id: string;
@@ -270,7 +454,7 @@ interface BaseEventMetadata {
270
454
  /** Event type. */
271
455
  eventType?: string;
272
456
  /** The identification type and identity data. */
273
- identity?: IdentificationData;
457
+ identity?: IdentificationData$1;
274
458
  }
275
459
  interface EventMetadata extends BaseEventMetadata {
276
460
  /**
@@ -291,7 +475,7 @@ interface EventMetadata extends BaseEventMetadata {
291
475
  slug?: string;
292
476
  /** ID of the entity associated with the event. */
293
477
  entityId?: string;
294
- /** Event timestamp. */
478
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
295
479
  eventTime?: Date;
296
480
  /**
297
481
  * Whether the event was triggered as a result of a privacy regulation application
@@ -323,16 +507,28 @@ interface EchoOptions {
323
507
  someDate?: Date;
324
508
  }
325
509
 
326
- declare function echo$1(httpClient: HttpClient): (arg1: string, options?: EchoOptions) => Promise<string>;
327
- declare const onEchoDispatched$1: EventDefinition<EchoDispatchedEnvelope, "wix.metroinspector.v1.echo_dispatched">;
510
+ declare function createRESTModule$1<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
511
+
512
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
328
513
 
329
- declare const echo: BuildRESTFunction<typeof echo$1>;
330
- declare const onEchoDispatched: BuildEventDefinition<typeof onEchoDispatched$1>;
514
+ declare const echo: ReturnType<typeof createRESTModule$1<typeof publicEcho>>;
515
+ declare const onEchoDispatched: ReturnType<typeof createEventModule<typeof publicOnEchoDispatched>>;
331
516
 
517
+ type context$1_BaseEventMetadata = BaseEventMetadata;
518
+ type context$1_Dispatched = Dispatched;
519
+ type context$1_EchoDispatchedEnvelope = EchoDispatchedEnvelope;
520
+ type context$1_EchoMessage = EchoMessage;
521
+ type context$1_EchoOptions = EchoOptions;
522
+ type context$1_EchoRequest = EchoRequest;
523
+ type context$1_EchoRequestRequiredFields = EchoRequestRequiredFields;
524
+ type context$1_EchoResponse = EchoResponse;
525
+ type context$1_EchoResponseNonNullableFields = EchoResponseNonNullableFields;
526
+ type context$1_EventMetadata = EventMetadata;
527
+ type context$1_MessageItem = MessageItem;
332
528
  declare const context$1_echo: typeof echo;
333
529
  declare const context$1_onEchoDispatched: typeof onEchoDispatched;
334
530
  declare namespace context$1 {
335
- export { context$1_echo as echo, context$1_onEchoDispatched as onEchoDispatched };
531
+ export { type ActionEvent$1 as ActionEvent, type context$1_BaseEventMetadata as BaseEventMetadata, type context$1_Dispatched as Dispatched, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type context$1_EchoDispatchedEnvelope as EchoDispatchedEnvelope, type context$1_EchoMessage as EchoMessage, type context$1_EchoOptions as EchoOptions, type context$1_EchoRequest as EchoRequest, type context$1_EchoRequestRequiredFields as EchoRequestRequiredFields, type context$1_EchoResponse as EchoResponse, type context$1_EchoResponseNonNullableFields as EchoResponseNonNullableFields, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type context$1_EventMetadata as EventMetadata, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type MessageEnvelope$1 as MessageEnvelope, type context$1_MessageItem as MessageItem, type RestoreInfo$1 as RestoreInfo, WebhookIdentityType$1 as WebhookIdentityType, context$1_echo as echo, context$1_onEchoDispatched as onEchoDispatched };
336
532
  }
337
533
 
338
534
  /** Physical address */
@@ -365,6 +561,48 @@ interface StreetAddress {
365
561
  /** Street name. */
366
562
  name?: string;
367
563
  }
564
+ interface AddressLocation {
565
+ /** Address latitude. */
566
+ latitude?: number | null;
567
+ /** Address longitude. */
568
+ longitude?: number | null;
569
+ }
570
+ interface Subdivision {
571
+ /** Short subdivision code. */
572
+ code?: string;
573
+ /** Subdivision full name. */
574
+ name?: string;
575
+ }
576
+ declare enum SubdivisionType {
577
+ UNKNOWN_SUBDIVISION_TYPE = "UNKNOWN_SUBDIVISION_TYPE",
578
+ /** State */
579
+ ADMINISTRATIVE_AREA_LEVEL_1 = "ADMINISTRATIVE_AREA_LEVEL_1",
580
+ /** County */
581
+ ADMINISTRATIVE_AREA_LEVEL_2 = "ADMINISTRATIVE_AREA_LEVEL_2",
582
+ /** City/town */
583
+ ADMINISTRATIVE_AREA_LEVEL_3 = "ADMINISTRATIVE_AREA_LEVEL_3",
584
+ /** Neighborhood/quarter */
585
+ ADMINISTRATIVE_AREA_LEVEL_4 = "ADMINISTRATIVE_AREA_LEVEL_4",
586
+ /** Street/block */
587
+ ADMINISTRATIVE_AREA_LEVEL_5 = "ADMINISTRATIVE_AREA_LEVEL_5",
588
+ /** ADMINISTRATIVE_AREA_LEVEL_0. Indicates the national political entity, and is typically the highest order type returned by the Geocoder. */
589
+ COUNTRY = "COUNTRY"
590
+ }
591
+ /** Subdivision Concordance values */
592
+ interface StandardDetails {
593
+ /** subdivision iso-3166-2 code according to [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2). e.g. US-NY, GB-SCT, NO-30 */
594
+ iso31662?: string | null;
595
+ }
596
+ interface VideoResolution {
597
+ /** Video URL. */
598
+ url?: string;
599
+ /** Video height. */
600
+ height?: number;
601
+ /** Video width. */
602
+ width?: number;
603
+ /** Video format for example, mp4, hls. */
604
+ format?: string;
605
+ }
368
606
  interface PageLink {
369
607
  /** The page id we want from the site */
370
608
  pageId?: string;
@@ -402,15 +640,131 @@ interface MyAddress {
402
640
  postalCode?: string | null;
403
641
  streetAddress?: StreetAddress;
404
642
  }
643
+ interface CreateProductRequest {
644
+ product?: Product;
645
+ }
646
+ interface CreateProductResponse {
647
+ product?: Product;
648
+ }
649
+ interface DeleteProductRequest {
650
+ productId: string;
651
+ }
652
+ interface DeleteProductResponse {
653
+ }
654
+ interface UpdateProductRequest {
655
+ productId: string;
656
+ product?: Product;
657
+ }
658
+ interface UpdateProductResponse {
659
+ product?: Product;
660
+ }
661
+ interface GetProductRequest {
662
+ productId: string;
663
+ }
664
+ interface GetProductResponse {
665
+ product?: Product;
666
+ }
667
+ interface GetProductsStartWithRequest {
668
+ title: string;
669
+ addressLine2?: string | null;
670
+ }
405
671
  interface GetProductsStartWithResponse {
406
672
  products?: Product[];
407
673
  }
674
+ interface QueryProductsRequest {
675
+ query?: QueryV2;
676
+ /** Whether variants should be included in the response. */
677
+ includeVariants?: boolean;
678
+ /** Whether hidden products should be included in the response. Requires permissions to manage products. */
679
+ includeHiddenProducts?: boolean;
680
+ /** Whether merchant specific data should be included in the response. Requires permissions to manage products. */
681
+ includeMerchantSpecificData?: boolean;
682
+ }
683
+ interface QueryV2 extends QueryV2PagingMethodOneOf {
684
+ /** Paging options to limit and skip the number of items. */
685
+ paging?: Paging;
686
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
687
+ cursorPaging?: CursorPaging;
688
+ /**
689
+ * Filter object in the following format:
690
+ * `"filter" : {
691
+ * "fieldName1": "value1",
692
+ * "fieldName2":{"$operator":"value2"}
693
+ * }`
694
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
695
+ */
696
+ filter?: Record<string, any> | null;
697
+ /**
698
+ * Sort object in the following format:
699
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
700
+ */
701
+ sort?: Sorting[];
702
+ /** Array of projected fields. A list of specific field names to return. If `fieldsets` are also specified, the union of `fieldsets` and `fields` is returned. */
703
+ fields?: string[];
704
+ /** Array of named, predefined sets of projected fields. A array of predefined named sets of fields to be returned. Specifying multiple `fieldsets` will return the union of fields from all sets. If `fields` are also specified, the union of `fieldsets` and `fields` is returned. */
705
+ fieldsets?: string[];
706
+ }
707
+ /** @oneof */
708
+ interface QueryV2PagingMethodOneOf {
709
+ /** Paging options to limit and skip the number of items. */
710
+ paging?: Paging;
711
+ /** Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`. */
712
+ cursorPaging?: CursorPaging;
713
+ }
714
+ interface Sorting {
715
+ /** Name of the field to sort by. */
716
+ fieldName?: string;
717
+ /** Sort order. */
718
+ order?: SortOrder;
719
+ }
720
+ declare enum SortOrder {
721
+ ASC = "ASC",
722
+ DESC = "DESC"
723
+ }
724
+ interface Paging {
725
+ /** Number of items to load. */
726
+ limit?: number | null;
727
+ /** Number of items to skip in the current sort order. */
728
+ offset?: number | null;
729
+ }
730
+ interface CursorPaging {
731
+ /** Maximum number of items to return in the results. */
732
+ limit?: number | null;
733
+ /**
734
+ * Pointer to the next or previous page in the list of results.
735
+ *
736
+ * Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
737
+ * Not relevant for the first request.
738
+ */
739
+ cursor?: string | null;
740
+ }
741
+ interface QueryProductsResponse {
742
+ products?: Product[];
743
+ metadata?: PagingMetadataV2;
744
+ }
745
+ interface PagingMetadataV2 {
746
+ /** Number of items returned in the response. */
747
+ count?: number | null;
748
+ /** Offset that was requested. */
749
+ offset?: number | null;
750
+ /** Total number of items that match the query. Returned if offset paging is used and the `tooManyToCount` flag is not set. */
751
+ total?: number | null;
752
+ /** Flag that indicates the server failed to calculate the `total` field. */
753
+ tooManyToCount?: boolean | null;
754
+ /** Cursors to navigate through the result pages using `next` and `prev`. Returned if cursor paging is used. */
755
+ cursors?: Cursors;
756
+ }
408
757
  interface Cursors {
409
758
  /** Cursor string pointing to the next page in the list of results. */
410
759
  next?: string | null;
411
760
  /** Cursor pointing to the previous page in the list of results. */
412
761
  prev?: string | null;
413
762
  }
763
+ interface BulkCreateProductsRequest {
764
+ products: Product[];
765
+ /** set to `true` if you wish to receive back the created products in the response */
766
+ returnEntity?: boolean;
767
+ }
414
768
  interface BulkCreateProductsResponse {
415
769
  results?: BulkProductResult[];
416
770
  bulkActionMetadata?: BulkActionMetadata;
@@ -447,6 +801,11 @@ interface BulkActionMetadata {
447
801
  /** Number of failures without details because detailed failure threshold was exceeded. */
448
802
  undetailedFailures?: number;
449
803
  }
804
+ interface BulkUpdateProductsRequest {
805
+ products: MaskedProduct[];
806
+ /** set to `true` if you wish to receive back the updated products in the response */
807
+ returnEntity?: boolean;
808
+ }
450
809
  interface MaskedProduct {
451
810
  /** Product to be updated, may be partial */
452
811
  product?: Product;
@@ -460,6 +819,9 @@ interface BulkUpdateProductsResponseBulkProductResult {
460
819
  /** Only exists if `returnEntity` was set to true in the request */
461
820
  item?: Product;
462
821
  }
822
+ interface BulkDeleteProductsRequest {
823
+ productIds: string[];
824
+ }
463
825
  interface BulkDeleteProductsResponse {
464
826
  results?: BulkDeleteProductsResponseBulkProductResult[];
465
827
  bulkActionMetadata?: BulkActionMetadata;
@@ -467,127 +829,234 @@ interface BulkDeleteProductsResponse {
467
829
  interface BulkDeleteProductsResponseBulkProductResult {
468
830
  itemMetadata?: ItemMetadata;
469
831
  }
470
- interface GetProductsStartWithResponseNonNullableFields {
471
- products: {
832
+ interface ResetProductsDbRequest {
833
+ }
834
+ interface ResetProductsDbResponse {
835
+ }
836
+ interface DomainEvent extends DomainEventBodyOneOf {
837
+ createdEvent?: EntityCreatedEvent;
838
+ updatedEvent?: EntityUpdatedEvent;
839
+ deletedEvent?: EntityDeletedEvent;
840
+ actionEvent?: ActionEvent;
841
+ /**
842
+ * Unique event ID.
843
+ * Allows clients to ignore duplicate webhooks.
844
+ */
845
+ _id?: string;
846
+ /**
847
+ * Assumes actions are also always typed to an entity_type
848
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
849
+ */
850
+ entityFqdn?: string;
851
+ /**
852
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
853
+ * This is although the created/updated/deleted notion is duplication of the oneof types
854
+ * Example: created/updated/deleted/started/completed/email_opened
855
+ */
856
+ slug?: string;
857
+ /** ID of the entity associated with the event. */
858
+ entityId?: string;
859
+ /** Event timestamp in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format and UTC time. For example: 2020-04-26T13:57:50.699Z */
860
+ eventTime?: Date;
861
+ /**
862
+ * Whether the event was triggered as a result of a privacy regulation application
863
+ * (for example, GDPR).
864
+ */
865
+ triggeredByAnonymizeRequest?: boolean | null;
866
+ /** If present, indicates the action that triggered the event. */
867
+ originatedFrom?: string | null;
868
+ /**
869
+ * A sequence number defining the order of updates to the underlying entity.
870
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
871
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
872
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
873
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
874
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
875
+ */
876
+ entityEventSequence?: string | null;
877
+ }
878
+ /** @oneof */
879
+ interface DomainEventBodyOneOf {
880
+ createdEvent?: EntityCreatedEvent;
881
+ updatedEvent?: EntityUpdatedEvent;
882
+ deletedEvent?: EntityDeletedEvent;
883
+ actionEvent?: ActionEvent;
884
+ }
885
+ interface EntityCreatedEvent {
886
+ entity?: string;
887
+ }
888
+ interface RestoreInfo {
889
+ deletedDate?: Date;
890
+ }
891
+ interface EntityUpdatedEvent {
892
+ /**
893
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
894
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
895
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
896
+ */
897
+ currentEntity?: string;
898
+ }
899
+ interface EntityDeletedEvent {
900
+ /** Entity that was deleted */
901
+ deletedEntity?: string | null;
902
+ }
903
+ interface ActionEvent {
904
+ body?: string;
905
+ }
906
+ interface MessageEnvelope {
907
+ /** App instance ID. */
908
+ instanceId?: string | null;
909
+ /** Event type. */
910
+ eventType?: string;
911
+ /** The identification type and identity data. */
912
+ identity?: IdentificationData;
913
+ /** Stringify payload. */
914
+ data?: string;
915
+ }
916
+ interface IdentificationData extends IdentificationDataIdOneOf {
917
+ /** ID of a site visitor that has not logged in to the site. */
918
+ anonymousVisitorId?: string;
919
+ /** ID of a site visitor that has logged in to the site. */
920
+ memberId?: string;
921
+ /** ID of a Wix user (site owner, contributor, etc.). */
922
+ wixUserId?: string;
923
+ /** ID of an app. */
924
+ appId?: string;
925
+ /** @readonly */
926
+ identityType?: WebhookIdentityType;
927
+ }
928
+ /** @oneof */
929
+ interface IdentificationDataIdOneOf {
930
+ /** ID of a site visitor that has not logged in to the site. */
931
+ anonymousVisitorId?: string;
932
+ /** ID of a site visitor that has logged in to the site. */
933
+ memberId?: string;
934
+ /** ID of a Wix user (site owner, contributor, etc.). */
935
+ wixUserId?: string;
936
+ /** ID of an app. */
937
+ appId?: string;
938
+ }
939
+ declare enum WebhookIdentityType {
940
+ UNKNOWN = "UNKNOWN",
941
+ ANONYMOUS_VISITOR = "ANONYMOUS_VISITOR",
942
+ MEMBER = "MEMBER",
943
+ WIX_USER = "WIX_USER",
944
+ APP = "APP"
945
+ }
946
+ interface CreateProductRequestRequiredFields {
947
+ product?: {
948
+ title: string;
949
+ };
950
+ }
951
+ interface StreetAddressNonNullableFields {
952
+ number: string;
953
+ name: string;
954
+ apt: string;
955
+ }
956
+ interface AddressNonNullableFields {
957
+ streetAddress?: StreetAddressNonNullableFields;
958
+ }
959
+ interface PageLinkNonNullableFields {
960
+ pageId: string;
961
+ rel: LinkRel[];
962
+ }
963
+ interface VariantNonNullableFields {
964
+ name: string;
965
+ value: string;
966
+ image: string;
967
+ }
968
+ interface MyAddressNonNullableFields {
969
+ streetAddress?: StreetAddressNonNullableFields;
970
+ }
971
+ interface ProductNonNullableFields {
972
+ _id: string;
973
+ collectionId: string;
974
+ image: string;
975
+ address?: AddressNonNullableFields;
976
+ document: string;
977
+ video: string;
978
+ pageLink?: PageLinkNonNullableFields;
979
+ audio: string;
980
+ variants: VariantNonNullableFields[];
981
+ mainVariant?: VariantNonNullableFields;
982
+ customAddress?: MyAddressNonNullableFields;
983
+ guid: string;
984
+ }
985
+ interface CreateProductResponseNonNullableFields {
986
+ product?: ProductNonNullableFields;
987
+ }
988
+ interface DeleteProductRequestRequiredFields {
989
+ productId: string;
990
+ }
991
+ interface UpdateProductRequestRequiredFields {
992
+ product?: {
472
993
  _id: string;
473
- collectionId: string;
474
- image: string;
475
- document: string;
476
- video: string;
477
- pageLink?: {
478
- pageId: string;
479
- rel: LinkRel[];
480
- };
481
- audio: string;
482
- variants: {
483
- name: string;
484
- value: string;
485
- image: string;
486
- }[];
487
- mainVariant?: {
488
- name: string;
489
- value: string;
490
- image: string;
491
- };
492
- guid: string;
493
- }[];
994
+ };
995
+ productId: string;
996
+ }
997
+ interface UpdateProductResponseNonNullableFields {
998
+ product?: ProductNonNullableFields;
999
+ }
1000
+ interface GetProductRequestRequiredFields {
1001
+ productId: string;
1002
+ }
1003
+ interface GetProductResponseNonNullableFields {
1004
+ product?: ProductNonNullableFields;
1005
+ }
1006
+ interface GetProductsStartWithRequestRequiredFields {
1007
+ title: string;
1008
+ }
1009
+ interface GetProductsStartWithResponseNonNullableFields {
1010
+ products: ProductNonNullableFields[];
1011
+ }
1012
+ interface QueryProductsResponseNonNullableFields {
1013
+ products: ProductNonNullableFields[];
1014
+ }
1015
+ interface BulkCreateProductsRequestRequiredFields {
1016
+ products: Product[];
1017
+ }
1018
+ interface ApplicationErrorNonNullableFields {
1019
+ code: string;
1020
+ description: string;
1021
+ }
1022
+ interface ItemMetadataNonNullableFields {
1023
+ originalIndex: number;
1024
+ success: boolean;
1025
+ error?: ApplicationErrorNonNullableFields;
1026
+ }
1027
+ interface BulkProductResultNonNullableFields {
1028
+ itemMetadata?: ItemMetadataNonNullableFields;
1029
+ item?: ProductNonNullableFields;
1030
+ }
1031
+ interface BulkActionMetadataNonNullableFields {
1032
+ totalSuccesses: number;
1033
+ totalFailures: number;
1034
+ undetailedFailures: number;
494
1035
  }
495
1036
  interface BulkCreateProductsResponseNonNullableFields {
496
- results: {
497
- itemMetadata?: {
498
- originalIndex: number;
499
- success: boolean;
500
- error?: {
501
- code: string;
502
- description: string;
503
- };
504
- };
505
- item?: {
506
- _id: string;
507
- collectionId: string;
508
- image: string;
509
- document: string;
510
- video: string;
511
- pageLink?: {
512
- pageId: string;
513
- rel: LinkRel[];
514
- };
515
- audio: string;
516
- variants: {
517
- name: string;
518
- value: string;
519
- image: string;
520
- }[];
521
- mainVariant?: {
522
- name: string;
523
- value: string;
524
- image: string;
525
- };
526
- guid: string;
527
- };
528
- }[];
529
- bulkActionMetadata?: {
530
- totalSuccesses: number;
531
- totalFailures: number;
532
- undetailedFailures: number;
533
- };
1037
+ results: BulkProductResultNonNullableFields[];
1038
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields;
1039
+ }
1040
+ interface BulkUpdateProductsRequestRequiredFields {
1041
+ products: MaskedProduct[];
1042
+ }
1043
+ interface BulkUpdateProductsResponseBulkProductResultNonNullableFields {
1044
+ itemMetadata?: ItemMetadataNonNullableFields;
1045
+ item?: ProductNonNullableFields;
534
1046
  }
535
1047
  interface BulkUpdateProductsResponseNonNullableFields {
536
- results: {
537
- itemMetadata?: {
538
- originalIndex: number;
539
- success: boolean;
540
- error?: {
541
- code: string;
542
- description: string;
543
- };
544
- };
545
- item?: {
546
- _id: string;
547
- collectionId: string;
548
- image: string;
549
- document: string;
550
- video: string;
551
- pageLink?: {
552
- pageId: string;
553
- rel: LinkRel[];
554
- };
555
- audio: string;
556
- variants: {
557
- name: string;
558
- value: string;
559
- image: string;
560
- }[];
561
- mainVariant?: {
562
- name: string;
563
- value: string;
564
- image: string;
565
- };
566
- guid: string;
567
- };
568
- }[];
569
- bulkActionMetadata?: {
570
- totalSuccesses: number;
571
- totalFailures: number;
572
- undetailedFailures: number;
573
- };
1048
+ results: BulkUpdateProductsResponseBulkProductResultNonNullableFields[];
1049
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields;
1050
+ }
1051
+ interface BulkDeleteProductsRequestRequiredFields {
1052
+ productIds: string[];
1053
+ }
1054
+ interface BulkDeleteProductsResponseBulkProductResultNonNullableFields {
1055
+ itemMetadata?: ItemMetadataNonNullableFields;
574
1056
  }
575
1057
  interface BulkDeleteProductsResponseNonNullableFields {
576
- results: {
577
- itemMetadata?: {
578
- originalIndex: number;
579
- success: boolean;
580
- error?: {
581
- code: string;
582
- description: string;
583
- };
584
- };
585
- }[];
586
- bulkActionMetadata?: {
587
- totalSuccesses: number;
588
- totalFailures: number;
589
- undetailedFailures: number;
590
- };
1058
+ results: BulkDeleteProductsResponseBulkProductResultNonNullableFields[];
1059
+ bulkActionMetadata?: BulkActionMetadataNonNullableFields;
591
1060
  }
592
1061
  interface Product {
593
1062
  _id: string;
@@ -703,92 +1172,108 @@ interface BulkUpdateProductsOptions {
703
1172
  returnEntity?: boolean;
704
1173
  }
705
1174
 
706
- declare function createProduct$1(httpClient: HttpClient): (options?: CreateProductOptions & CreateProductOptionsRequiredFields) => Promise<Product & {
707
- _id: string;
708
- collectionId: string;
709
- image: string;
710
- document: string;
711
- video: string;
712
- pageLink?: {
713
- pageId: string;
714
- rel: LinkRel[];
715
- } | undefined;
716
- audio: string;
717
- variants: {
718
- name: string;
719
- value: string;
720
- image: string;
721
- }[];
722
- mainVariant?: {
723
- name: string;
724
- value: string;
725
- image: string;
726
- } | undefined;
727
- guid: string;
728
- }>;
729
- declare function deleteProduct$1(httpClient: HttpClient): (productId: string) => Promise<void>;
730
- declare function updateProduct$1(httpClient: HttpClient): (productId: string, options?: UpdateProductOptions & UpdateProductOptionsRequiredFields) => Promise<Product & {
731
- _id: string;
732
- collectionId: string;
733
- image: string;
734
- document: string;
735
- video: string;
736
- pageLink?: {
737
- pageId: string;
738
- rel: LinkRel[];
739
- } | undefined;
740
- audio: string;
741
- variants: {
742
- name: string;
743
- value: string;
744
- image: string;
745
- }[];
746
- mainVariant?: {
747
- name: string;
748
- value: string;
749
- image: string;
750
- } | undefined;
751
- guid: string;
752
- }>;
753
- declare function getProduct$1(httpClient: HttpClient): (productId: string) => Promise<Product & {
754
- _id: string;
755
- collectionId: string;
756
- image: string;
757
- document: string;
758
- video: string;
759
- pageLink?: {
760
- pageId: string;
761
- rel: LinkRel[];
762
- } | undefined;
763
- audio: string;
764
- variants: {
765
- name: string;
766
- value: string;
767
- image: string;
768
- }[];
769
- mainVariant?: {
770
- name: string;
771
- value: string;
772
- image: string;
773
- } | undefined;
774
- guid: string;
775
- }>;
776
- declare function getProductsStartWith$1(httpClient: HttpClient): (title: string, options?: GetProductsStartWithOptions) => Promise<GetProductsStartWithResponse & GetProductsStartWithResponseNonNullableFields>;
777
- declare function queryProducts$1(httpClient: HttpClient): (options?: QueryProductsOptions) => ProductsQueryBuilder;
778
- declare function bulkCreateProducts$1(httpClient: HttpClient): (products: Product[], options?: BulkCreateProductsOptions) => Promise<BulkCreateProductsResponse & BulkCreateProductsResponseNonNullableFields>;
779
- declare function bulkUpdateProducts$1(httpClient: HttpClient): (products: MaskedProduct[], options?: BulkUpdateProductsOptions) => Promise<BulkUpdateProductsResponse & BulkUpdateProductsResponseNonNullableFields>;
780
- declare function bulkDeleteProducts$1(httpClient: HttpClient): (productIds: string[]) => Promise<BulkDeleteProductsResponse & BulkDeleteProductsResponseNonNullableFields>;
1175
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
781
1176
 
782
- declare const createProduct: BuildRESTFunction<typeof createProduct$1>;
783
- declare const deleteProduct: BuildRESTFunction<typeof deleteProduct$1>;
784
- declare const updateProduct: BuildRESTFunction<typeof updateProduct$1>;
785
- declare const getProduct: BuildRESTFunction<typeof getProduct$1>;
786
- declare const getProductsStartWith: BuildRESTFunction<typeof getProductsStartWith$1>;
787
- declare const queryProducts: BuildRESTFunction<typeof queryProducts$1>;
788
- declare const bulkCreateProducts: BuildRESTFunction<typeof bulkCreateProducts$1>;
789
- declare const bulkUpdateProducts: BuildRESTFunction<typeof bulkUpdateProducts$1>;
790
- declare const bulkDeleteProducts: BuildRESTFunction<typeof bulkDeleteProducts$1>;
1177
+ declare const createProduct: ReturnType<typeof createRESTModule<typeof publicCreateProduct>>;
1178
+ declare const deleteProduct: ReturnType<typeof createRESTModule<typeof publicDeleteProduct>>;
1179
+ declare const updateProduct: ReturnType<typeof createRESTModule<typeof publicUpdateProduct>>;
1180
+ declare const getProduct: ReturnType<typeof createRESTModule<typeof publicGetProduct>>;
1181
+ declare const getProductsStartWith: ReturnType<typeof createRESTModule<typeof publicGetProductsStartWith>>;
1182
+ declare const queryProducts: ReturnType<typeof createRESTModule<typeof publicQueryProducts>>;
1183
+ declare const bulkCreateProducts: ReturnType<typeof createRESTModule<typeof publicBulkCreateProducts>>;
1184
+ declare const bulkUpdateProducts: ReturnType<typeof createRESTModule<typeof publicBulkUpdateProducts>>;
1185
+ declare const bulkDeleteProducts: ReturnType<typeof createRESTModule<typeof publicBulkDeleteProducts>>;
791
1186
 
1187
+ type context_ActionEvent = ActionEvent;
1188
+ type context_Address = Address;
1189
+ type context_AddressLocation = AddressLocation;
1190
+ type context_AddressStreetOneOf = AddressStreetOneOf;
1191
+ type context_ApplicationError = ApplicationError;
1192
+ type context_BulkActionMetadata = BulkActionMetadata;
1193
+ type context_BulkCreateProductsOptions = BulkCreateProductsOptions;
1194
+ type context_BulkCreateProductsRequest = BulkCreateProductsRequest;
1195
+ type context_BulkCreateProductsRequestRequiredFields = BulkCreateProductsRequestRequiredFields;
1196
+ type context_BulkCreateProductsResponse = BulkCreateProductsResponse;
1197
+ type context_BulkCreateProductsResponseNonNullableFields = BulkCreateProductsResponseNonNullableFields;
1198
+ type context_BulkDeleteProductsRequest = BulkDeleteProductsRequest;
1199
+ type context_BulkDeleteProductsRequestRequiredFields = BulkDeleteProductsRequestRequiredFields;
1200
+ type context_BulkDeleteProductsResponse = BulkDeleteProductsResponse;
1201
+ type context_BulkDeleteProductsResponseBulkProductResult = BulkDeleteProductsResponseBulkProductResult;
1202
+ type context_BulkDeleteProductsResponseNonNullableFields = BulkDeleteProductsResponseNonNullableFields;
1203
+ type context_BulkProductResult = BulkProductResult;
1204
+ type context_BulkUpdateProductsOptions = BulkUpdateProductsOptions;
1205
+ type context_BulkUpdateProductsRequest = BulkUpdateProductsRequest;
1206
+ type context_BulkUpdateProductsRequestRequiredFields = BulkUpdateProductsRequestRequiredFields;
1207
+ type context_BulkUpdateProductsResponse = BulkUpdateProductsResponse;
1208
+ type context_BulkUpdateProductsResponseBulkProductResult = BulkUpdateProductsResponseBulkProductResult;
1209
+ type context_BulkUpdateProductsResponseNonNullableFields = BulkUpdateProductsResponseNonNullableFields;
1210
+ type context_CreateProductOptions = CreateProductOptions;
1211
+ type context_CreateProductOptionsRequiredFields = CreateProductOptionsRequiredFields;
1212
+ type context_CreateProductRequest = CreateProductRequest;
1213
+ type context_CreateProductRequestRequiredFields = CreateProductRequestRequiredFields;
1214
+ type context_CreateProductResponse = CreateProductResponse;
1215
+ type context_CreateProductResponseNonNullableFields = CreateProductResponseNonNullableFields;
1216
+ type context_CursorPaging = CursorPaging;
1217
+ type context_Cursors = Cursors;
1218
+ type context_DeleteProductRequest = DeleteProductRequest;
1219
+ type context_DeleteProductRequestRequiredFields = DeleteProductRequestRequiredFields;
1220
+ type context_DeleteProductResponse = DeleteProductResponse;
1221
+ type context_DomainEvent = DomainEvent;
1222
+ type context_DomainEventBodyOneOf = DomainEventBodyOneOf;
1223
+ type context_EntityCreatedEvent = EntityCreatedEvent;
1224
+ type context_EntityDeletedEvent = EntityDeletedEvent;
1225
+ type context_EntityUpdatedEvent = EntityUpdatedEvent;
1226
+ type context_GetProductRequest = GetProductRequest;
1227
+ type context_GetProductRequestRequiredFields = GetProductRequestRequiredFields;
1228
+ type context_GetProductResponse = GetProductResponse;
1229
+ type context_GetProductResponseNonNullableFields = GetProductResponseNonNullableFields;
1230
+ type context_GetProductsStartWithOptions = GetProductsStartWithOptions;
1231
+ type context_GetProductsStartWithRequest = GetProductsStartWithRequest;
1232
+ type context_GetProductsStartWithRequestRequiredFields = GetProductsStartWithRequestRequiredFields;
1233
+ type context_GetProductsStartWithResponse = GetProductsStartWithResponse;
1234
+ type context_GetProductsStartWithResponseNonNullableFields = GetProductsStartWithResponseNonNullableFields;
1235
+ type context_IdentificationData = IdentificationData;
1236
+ type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
1237
+ type context_ItemMetadata = ItemMetadata;
1238
+ type context_LinkRel = LinkRel;
1239
+ declare const context_LinkRel: typeof LinkRel;
1240
+ type context_MaskedProduct = MaskedProduct;
1241
+ type context_MessageEnvelope = MessageEnvelope;
1242
+ type context_MyAddress = MyAddress;
1243
+ type context_PageLink = PageLink;
1244
+ type context_Paging = Paging;
1245
+ type context_PagingMetadataV2 = PagingMetadataV2;
1246
+ type context_Product = Product;
1247
+ type context_ProductNonNullableFields = ProductNonNullableFields;
1248
+ type context_ProductsQueryBuilder = ProductsQueryBuilder;
1249
+ type context_ProductsQueryResult = ProductsQueryResult;
1250
+ type context_QueryProductsOptions = QueryProductsOptions;
1251
+ type context_QueryProductsRequest = QueryProductsRequest;
1252
+ type context_QueryProductsResponse = QueryProductsResponse;
1253
+ type context_QueryProductsResponseNonNullableFields = QueryProductsResponseNonNullableFields;
1254
+ type context_QueryV2 = QueryV2;
1255
+ type context_QueryV2PagingMethodOneOf = QueryV2PagingMethodOneOf;
1256
+ type context_ResetProductsDbRequest = ResetProductsDbRequest;
1257
+ type context_ResetProductsDbResponse = ResetProductsDbResponse;
1258
+ type context_RestoreInfo = RestoreInfo;
1259
+ type context_SortOrder = SortOrder;
1260
+ declare const context_SortOrder: typeof SortOrder;
1261
+ type context_Sorting = Sorting;
1262
+ type context_StandardDetails = StandardDetails;
1263
+ type context_StreetAddress = StreetAddress;
1264
+ type context_Subdivision = Subdivision;
1265
+ type context_SubdivisionType = SubdivisionType;
1266
+ declare const context_SubdivisionType: typeof SubdivisionType;
1267
+ type context_UpdateProductOptions = UpdateProductOptions;
1268
+ type context_UpdateProductOptionsRequiredFields = UpdateProductOptionsRequiredFields;
1269
+ type context_UpdateProductRequest = UpdateProductRequest;
1270
+ type context_UpdateProductRequestRequiredFields = UpdateProductRequestRequiredFields;
1271
+ type context_UpdateProductResponse = UpdateProductResponse;
1272
+ type context_UpdateProductResponseNonNullableFields = UpdateProductResponseNonNullableFields;
1273
+ type context_Variant = Variant;
1274
+ type context_VideoResolution = VideoResolution;
1275
+ type context_WebhookIdentityType = WebhookIdentityType;
1276
+ declare const context_WebhookIdentityType: typeof WebhookIdentityType;
792
1277
  declare const context_bulkCreateProducts: typeof bulkCreateProducts;
793
1278
  declare const context_bulkDeleteProducts: typeof bulkDeleteProducts;
794
1279
  declare const context_bulkUpdateProducts: typeof bulkUpdateProducts;
@@ -799,7 +1284,7 @@ declare const context_getProductsStartWith: typeof getProductsStartWith;
799
1284
  declare const context_queryProducts: typeof queryProducts;
800
1285
  declare const context_updateProduct: typeof updateProduct;
801
1286
  declare namespace context {
802
- export { context_bulkCreateProducts as bulkCreateProducts, context_bulkDeleteProducts as bulkDeleteProducts, context_bulkUpdateProducts as bulkUpdateProducts, context_createProduct as createProduct, context_deleteProduct as deleteProduct, context_getProduct as getProduct, context_getProductsStartWith as getProductsStartWith, context_queryProducts as queryProducts, context_updateProduct as updateProduct };
1287
+ export { type context_ActionEvent as ActionEvent, type context_Address as Address, type context_AddressLocation as AddressLocation, type context_AddressStreetOneOf as AddressStreetOneOf, type context_ApplicationError as ApplicationError, type context_BulkActionMetadata as BulkActionMetadata, type context_BulkCreateProductsOptions as BulkCreateProductsOptions, type context_BulkCreateProductsRequest as BulkCreateProductsRequest, type context_BulkCreateProductsRequestRequiredFields as BulkCreateProductsRequestRequiredFields, type context_BulkCreateProductsResponse as BulkCreateProductsResponse, type context_BulkCreateProductsResponseNonNullableFields as BulkCreateProductsResponseNonNullableFields, type context_BulkDeleteProductsRequest as BulkDeleteProductsRequest, type context_BulkDeleteProductsRequestRequiredFields as BulkDeleteProductsRequestRequiredFields, type context_BulkDeleteProductsResponse as BulkDeleteProductsResponse, type context_BulkDeleteProductsResponseBulkProductResult as BulkDeleteProductsResponseBulkProductResult, type context_BulkDeleteProductsResponseNonNullableFields as BulkDeleteProductsResponseNonNullableFields, type context_BulkProductResult as BulkProductResult, type context_BulkUpdateProductsOptions as BulkUpdateProductsOptions, type context_BulkUpdateProductsRequest as BulkUpdateProductsRequest, type context_BulkUpdateProductsRequestRequiredFields as BulkUpdateProductsRequestRequiredFields, type context_BulkUpdateProductsResponse as BulkUpdateProductsResponse, type context_BulkUpdateProductsResponseBulkProductResult as BulkUpdateProductsResponseBulkProductResult, type context_BulkUpdateProductsResponseNonNullableFields as BulkUpdateProductsResponseNonNullableFields, type context_CreateProductOptions as CreateProductOptions, type context_CreateProductOptionsRequiredFields as CreateProductOptionsRequiredFields, type context_CreateProductRequest as CreateProductRequest, type context_CreateProductRequestRequiredFields as CreateProductRequestRequiredFields, type context_CreateProductResponse as CreateProductResponse, type context_CreateProductResponseNonNullableFields as CreateProductResponseNonNullableFields, type context_CursorPaging as CursorPaging, type context_Cursors as Cursors, type context_DeleteProductRequest as DeleteProductRequest, type context_DeleteProductRequestRequiredFields as DeleteProductRequestRequiredFields, type context_DeleteProductResponse as DeleteProductResponse, type context_DomainEvent as DomainEvent, type context_DomainEventBodyOneOf as DomainEventBodyOneOf, type context_EntityCreatedEvent as EntityCreatedEvent, type context_EntityDeletedEvent as EntityDeletedEvent, type context_EntityUpdatedEvent as EntityUpdatedEvent, type context_GetProductRequest as GetProductRequest, type context_GetProductRequestRequiredFields as GetProductRequestRequiredFields, type context_GetProductResponse as GetProductResponse, type context_GetProductResponseNonNullableFields as GetProductResponseNonNullableFields, type context_GetProductsStartWithOptions as GetProductsStartWithOptions, type context_GetProductsStartWithRequest as GetProductsStartWithRequest, type context_GetProductsStartWithRequestRequiredFields as GetProductsStartWithRequestRequiredFields, type context_GetProductsStartWithResponse as GetProductsStartWithResponse, type context_GetProductsStartWithResponseNonNullableFields as GetProductsStartWithResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type context_ItemMetadata as ItemMetadata, context_LinkRel as LinkRel, type context_MaskedProduct as MaskedProduct, type context_MessageEnvelope as MessageEnvelope, type context_MyAddress as MyAddress, type context_PageLink as PageLink, type context_Paging as Paging, type context_PagingMetadataV2 as PagingMetadataV2, type context_Product as Product, type context_ProductNonNullableFields as ProductNonNullableFields, type context_ProductsQueryBuilder as ProductsQueryBuilder, type context_ProductsQueryResult as ProductsQueryResult, type context_QueryProductsOptions as QueryProductsOptions, type context_QueryProductsRequest as QueryProductsRequest, type context_QueryProductsResponse as QueryProductsResponse, type context_QueryProductsResponseNonNullableFields as QueryProductsResponseNonNullableFields, type context_QueryV2 as QueryV2, type context_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, type context_ResetProductsDbRequest as ResetProductsDbRequest, type context_ResetProductsDbResponse as ResetProductsDbResponse, type context_RestoreInfo as RestoreInfo, context_SortOrder as SortOrder, type context_Sorting as Sorting, type context_StandardDetails as StandardDetails, type context_StreetAddress as StreetAddress, type context_Subdivision as Subdivision, context_SubdivisionType as SubdivisionType, type context_UpdateProductOptions as UpdateProductOptions, type context_UpdateProductOptionsRequiredFields as UpdateProductOptionsRequiredFields, type context_UpdateProductRequest as UpdateProductRequest, type context_UpdateProductRequestRequiredFields as UpdateProductRequestRequiredFields, type context_UpdateProductResponse as UpdateProductResponse, type context_UpdateProductResponseNonNullableFields as UpdateProductResponseNonNullableFields, type context_Variant as Variant, type context_VideoResolution as VideoResolution, context_WebhookIdentityType as WebhookIdentityType, context_bulkCreateProducts as bulkCreateProducts, context_bulkDeleteProducts as bulkDeleteProducts, context_bulkUpdateProducts as bulkUpdateProducts, context_createProduct as createProduct, context_deleteProduct as deleteProduct, context_getProduct as getProduct, context_getProductsStartWith as getProductsStartWith, context_queryProducts as queryProducts, context_updateProduct as updateProduct };
803
1288
  }
804
1289
 
805
1290
  export { context$2 as alarms, context$1 as metroinspector, context as products };