@wix/payments 1.0.2 → 1.0.4

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/payments",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -18,10 +18,9 @@
18
18
  "type-bundles"
19
19
  ],
20
20
  "dependencies": {
21
- "@wix/payments_refunds": "1.0.2"
21
+ "@wix/payments_refunds": "1.0.4"
22
22
  },
23
23
  "devDependencies": {
24
- "@wix/sdk": "https://cdn.dev.wixpress.com/@wix/sdk/02e8069ab2fd783e0e6a080fc7d590e76cb26ab93c8389574286305b.tar.gz",
25
24
  "glob": "^10.4.1",
26
25
  "rollup": "^4.18.0",
27
26
  "rollup-plugin-dts": "^6.1.1",
@@ -43,5 +42,5 @@
43
42
  "fqdn": ""
44
43
  }
45
44
  },
46
- "falconPackageHash": "0f14b67dab0b7bdac29b3944c929fb968832b9acceeae0060751c5ab"
45
+ "falconPackageHash": "135b055a9e99a38f39f6b1db3c9d7f265a0ca085769e6150eba411cb"
47
46
  }
@@ -117,6 +117,12 @@ declare enum Status {
117
117
  */
118
118
  REVERSED = "REVERSED"
119
119
  }
120
+ declare enum Initiator {
121
+ UNKNOWN_INITIATOR = "UNKNOWN_INITIATOR",
122
+ WIX = "WIX",
123
+ API = "API",
124
+ PROVIDER = "PROVIDER"
125
+ }
120
126
  interface StatusInfo {
121
127
  /**
122
128
  * Reason code.
@@ -126,16 +132,159 @@ interface StatusInfo {
126
132
  /** Free-text description. */
127
133
  description?: string | null;
128
134
  }
135
+ interface SyncRefundRequest {
136
+ /** Refund ID. */
137
+ refundId?: string | null;
138
+ /** ID of the refund on the PSP side. */
139
+ providerRefundId?: string | null;
140
+ /** ID of charge for which the funds are returned by this refund. */
141
+ chargeId?: string | null;
142
+ /**
143
+ * Status of the refund.
144
+ * Read more about statuses in this [article](<https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#lifecycle-of-a-refund>).
145
+ */
146
+ status?: Status;
147
+ /**
148
+ * Status code.
149
+ * [Read more about reason codes.](https://dev.wix.com/docs/rest/api-reference/payment-provider-spi/reason-codes)
150
+ */
151
+ statusCode?: string | null;
152
+ /** Currency of refund, should be the same as currency of charge. */
153
+ currency?: string | null;
154
+ /**
155
+ * Amount of refund in base units, what's returned to the customer.
156
+ * E.g. "12.95".
157
+ */
158
+ amount?: string | null;
159
+ /**
160
+ * Application fee returned to merchant from Wix.
161
+ * Having this as a separate field since Refund.returned_application_fee is readOnly.
162
+ */
163
+ returnedApplicationFee?: string | null;
164
+ /** Reason why this refund was issued. */
165
+ reason?: string | null;
166
+ /** Optional free-text note about this refund. */
167
+ note?: string | null;
168
+ }
169
+ interface SyncRefundResponse {
170
+ /** Created/updated refund. */
171
+ refund?: Refund;
172
+ }
173
+ interface CreateRefundRequest {
174
+ /** Refund to be created. */
175
+ refund: Refund;
176
+ /**
177
+ * Optional parameter used to prevent unintended refunds.
178
+ * Used to check previously refunded amount according to the client
179
+ * against the amount from server perspective.
180
+ * If they don't match, error with code `PREVIOUSLY_REFUNDED_AMOUNT_MISMATCH` is returned.
181
+ *
182
+ * Read more about preventing unintended refunds in this
183
+ * [article](<https://dev.wix.com/docs/rest/business-management/payments/refunds/introduction#preventing-unintended-refunds>).
184
+ */
185
+ previouslyRefundedAmount?: string | null;
186
+ }
187
+ interface CreateRefundResponse {
188
+ /** The created refund. */
189
+ refund?: Refund;
190
+ }
191
+ interface GetRefundRequest {
192
+ /** ID of the refund to retrieve. */
193
+ refundId: string;
194
+ }
195
+ interface GetRefundResponse {
196
+ /** The requested refund. */
197
+ refund?: Refund;
198
+ }
199
+ interface QueryRefundsRequest {
200
+ /** WQL expression. */
201
+ query?: CursorQuery;
202
+ }
203
+ interface CursorQuery extends CursorQueryPagingMethodOneOf {
204
+ /** 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`. */
205
+ cursorPaging?: CursorPaging;
206
+ /**
207
+ * Filter object in the following format:
208
+ * `"filter" : {
209
+ * "fieldName1": "value1",
210
+ * "fieldName2":{"$operator":"value2"}
211
+ * }`
212
+ * Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
213
+ */
214
+ filter?: Record<string, any> | null;
215
+ /**
216
+ * Sort object in the following format:
217
+ * `[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
218
+ */
219
+ sort?: Sorting[];
220
+ }
221
+ /** @oneof */
222
+ interface CursorQueryPagingMethodOneOf {
223
+ /** 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`. */
224
+ cursorPaging?: CursorPaging;
225
+ }
226
+ interface Sorting {
227
+ /** Name of the field to sort by. */
228
+ fieldName?: string;
229
+ /** Sort order. */
230
+ order?: SortOrder;
231
+ }
232
+ declare enum SortOrder {
233
+ ASC = "ASC",
234
+ DESC = "DESC"
235
+ }
236
+ interface CursorPaging {
237
+ /** Number of items to load. */
238
+ limit?: number | null;
239
+ /**
240
+ * Pointer to the next or previous page in the list of results.
241
+ *
242
+ * You can get the relevant cursor token
243
+ * from the `pagingMetadata` object in the previous call's response.
244
+ * Not relevant for the first request.
245
+ */
246
+ cursor?: string | null;
247
+ }
248
+ interface QueryRefundsResponse {
249
+ /** List of refunds. */
250
+ refunds?: Refund[];
251
+ /** Paging metadata */
252
+ pagingMetadata?: CursorPagingMetadata;
253
+ }
254
+ interface CursorPagingMetadata {
255
+ /** Number of items returned in the response. */
256
+ count?: number | null;
257
+ /** Offset that was requested. */
258
+ cursors?: Cursors;
259
+ /**
260
+ * Indicates if there are more results after the current page.
261
+ * If `true`, another page of results can be retrieved.
262
+ * If `false`, this is the last page.
263
+ */
264
+ hasNext?: boolean | null;
265
+ }
129
266
  interface Cursors {
130
267
  /** Cursor pointing to next page in the list of results. */
131
268
  next?: string | null;
132
269
  /** Cursor pointing to previous page in the list of results. */
133
270
  prev?: string | null;
134
271
  }
272
+ interface UpdateExtendedFieldsRequest {
273
+ /** ID of the entity to update. */
274
+ _id: string;
275
+ /** Identifier for the app whose extended fields are being updated. */
276
+ namespace: string;
277
+ /** Data to update. Structured according to the [schema](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields#json-schema-for-extended-fields) defined when the extended fields were configured. */
278
+ namespaceData: Record<string, any> | null;
279
+ }
135
280
  interface UpdateExtendedFieldsResponse {
136
281
  /** Updated refund. */
137
282
  refund?: Refund;
138
283
  }
284
+ interface GetRefundabilityRequest {
285
+ /** ID of the charge for which refundability will be calculated. */
286
+ chargeId: string;
287
+ }
139
288
  interface GetRefundabilityResponse {
140
289
  /** Refundability for the charge. */
141
290
  refundability?: Refundability;
@@ -223,6 +372,83 @@ declare enum RejectionReason {
223
372
  /** Logged in merchant has no permission to refund this charge. */
224
373
  NOT_AUTHORIZED = "NOT_AUTHORIZED"
225
374
  }
375
+ interface DomainEvent extends DomainEventBodyOneOf {
376
+ createdEvent?: EntityCreatedEvent;
377
+ updatedEvent?: EntityUpdatedEvent;
378
+ deletedEvent?: EntityDeletedEvent;
379
+ actionEvent?: ActionEvent;
380
+ /**
381
+ * Unique event ID.
382
+ * Allows clients to ignore duplicate webhooks.
383
+ */
384
+ _id?: string;
385
+ /**
386
+ * Assumes actions are also always typed to an entity_type
387
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
388
+ */
389
+ entityFqdn?: string;
390
+ /**
391
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
392
+ * This is although the created/updated/deleted notion is duplication of the oneof types
393
+ * Example: created/updated/deleted/started/completed/email_opened
394
+ */
395
+ slug?: string;
396
+ /** ID of the entity associated with the event. */
397
+ entityId?: string;
398
+ /** Event timestamp. */
399
+ eventTime?: Date;
400
+ /**
401
+ * Whether the event was triggered as a result of a privacy regulation application
402
+ * (for example, GDPR).
403
+ */
404
+ triggeredByAnonymizeRequest?: boolean | null;
405
+ /** If present, indicates the action that triggered the event. */
406
+ originatedFrom?: string | null;
407
+ /**
408
+ * A sequence number defining the order of updates to the underlying entity.
409
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
410
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
411
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
412
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
413
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
414
+ */
415
+ entityEventSequence?: string | null;
416
+ }
417
+ /** @oneof */
418
+ interface DomainEventBodyOneOf {
419
+ createdEvent?: EntityCreatedEvent;
420
+ updatedEvent?: EntityUpdatedEvent;
421
+ deletedEvent?: EntityDeletedEvent;
422
+ actionEvent?: ActionEvent;
423
+ }
424
+ interface EntityCreatedEvent {
425
+ entity?: string;
426
+ }
427
+ interface EntityUpdatedEvent {
428
+ /**
429
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
430
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
431
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
432
+ */
433
+ currentEntity?: string;
434
+ }
435
+ interface EntityDeletedEvent {
436
+ /** Entity that was deleted */
437
+ deletedEntity?: string | null;
438
+ }
439
+ interface ActionEvent {
440
+ body?: string;
441
+ }
442
+ interface MessageEnvelope {
443
+ /** App instance ID. */
444
+ instanceId?: string | null;
445
+ /** Event type. */
446
+ eventType?: string;
447
+ /** The identification type and identity data. */
448
+ identity?: IdentificationData;
449
+ /** Stringify payload. */
450
+ data?: string;
451
+ }
226
452
  interface IdentificationData extends IdentificationDataIdOneOf {
227
453
  /** ID of a site visitor that has not logged in to the site. */
228
454
  anonymousVisitorId?: string;
@@ -253,6 +479,30 @@ declare enum WebhookIdentityType {
253
479
  WIX_USER = "WIX_USER",
254
480
  APP = "APP"
255
481
  }
482
+ interface CreateRefundResponseNonNullableFields {
483
+ refund?: {
484
+ status: Status;
485
+ statusInfo?: {
486
+ code: string;
487
+ };
488
+ };
489
+ }
490
+ interface GetRefundResponseNonNullableFields {
491
+ refund?: {
492
+ status: Status;
493
+ statusInfo?: {
494
+ code: string;
495
+ };
496
+ };
497
+ }
498
+ interface QueryRefundsResponseNonNullableFields {
499
+ refunds: {
500
+ status: Status;
501
+ statusInfo?: {
502
+ code: string;
503
+ };
504
+ }[];
505
+ }
256
506
  interface UpdateExtendedFieldsResponseNonNullableFields {
257
507
  refund?: {
258
508
  status: Status;
@@ -375,6 +625,8 @@ interface UpdateExtendedFieldsOptions {
375
625
  type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
376
626
  interface HttpClient {
377
627
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
628
+ fetchWithAuth: typeof fetch;
629
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
378
630
  }
379
631
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
380
632
  type HttpResponse<T = any> = {
@@ -400,39 +652,89 @@ type EventDefinition<Payload = unknown, Type extends string = string> = {
400
652
  __type: 'event-definition';
401
653
  type: Type;
402
654
  isDomainEvent?: boolean;
403
- transformations?: unknown;
655
+ transformations?: (envelope: unknown) => Payload;
404
656
  __payload: Payload;
405
657
  };
406
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
658
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
407
659
  type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
408
660
  type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
409
661
 
410
- declare function createRefund$1(httpClient: HttpClient): (refund: Refund, options?: CreateRefundOptions) => Promise<Refund & {
411
- status: Status;
412
- statusInfo?: {
413
- code: string;
414
- } | undefined;
415
- }>;
416
- declare function getRefund$1(httpClient: HttpClient): (refundId: string) => Promise<Refund & {
417
- status: Status;
418
- statusInfo?: {
419
- code: string;
420
- } | undefined;
421
- }>;
422
- declare function queryRefunds$1(httpClient: HttpClient): () => RefundsQueryBuilder;
423
- declare function updateExtendedFields$1(httpClient: HttpClient): (_id: string, namespace: string, options: UpdateExtendedFieldsOptions) => Promise<UpdateExtendedFieldsResponse & UpdateExtendedFieldsResponseNonNullableFields>;
424
- declare function getRefundability$1(httpClient: HttpClient): (chargeId: string) => Promise<GetRefundabilityResponse & GetRefundabilityResponseNonNullableFields>;
425
- declare const onRefundCreated$1: EventDefinition<RefundCreatedEnvelope, "wix.payments.refunds.v1.refund_created">;
426
- declare const onRefundUpdated$1: EventDefinition<RefundUpdatedEnvelope, "wix.payments.refunds.v1.refund_updated">;
662
+ declare global {
663
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
664
+ interface SymbolConstructor {
665
+ readonly observable: symbol;
666
+ }
667
+ }
668
+
669
+ declare function createRESTModule<T extends RESTFunctionDescriptor>(descriptor: T, elevated?: boolean): BuildRESTFunction<T> & T;
670
+
671
+ declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
427
672
 
428
- declare const createRefund: BuildRESTFunction<typeof createRefund$1>;
429
- declare const getRefund: BuildRESTFunction<typeof getRefund$1>;
430
- declare const queryRefunds: BuildRESTFunction<typeof queryRefunds$1>;
431
- declare const updateExtendedFields: BuildRESTFunction<typeof updateExtendedFields$1>;
432
- declare const getRefundability: BuildRESTFunction<typeof getRefundability$1>;
433
- declare const onRefundCreated: BuildEventDefinition<typeof onRefundCreated$1>;
434
- declare const onRefundUpdated: BuildEventDefinition<typeof onRefundUpdated$1>;
673
+ declare const createRefund: ReturnType<typeof createRESTModule<typeof publicCreateRefund>>;
674
+ declare const getRefund: ReturnType<typeof createRESTModule<typeof publicGetRefund>>;
675
+ declare const queryRefunds: ReturnType<typeof createRESTModule<typeof publicQueryRefunds>>;
676
+ declare const updateExtendedFields: ReturnType<typeof createRESTModule<typeof publicUpdateExtendedFields>>;
677
+ declare const getRefundability: ReturnType<typeof createRESTModule<typeof publicGetRefundability>>;
678
+ declare const onRefundCreated: ReturnType<typeof createEventModule<typeof publicOnRefundCreated>>;
679
+ declare const onRefundUpdated: ReturnType<typeof createEventModule<typeof publicOnRefundUpdated>>;
435
680
 
681
+ type context_ActionEvent = ActionEvent;
682
+ type context_BaseEventMetadata = BaseEventMetadata;
683
+ type context_CreateRefundOptions = CreateRefundOptions;
684
+ type context_CreateRefundRequest = CreateRefundRequest;
685
+ type context_CreateRefundResponse = CreateRefundResponse;
686
+ type context_CreateRefundResponseNonNullableFields = CreateRefundResponseNonNullableFields;
687
+ type context_CursorPaging = CursorPaging;
688
+ type context_CursorPagingMetadata = CursorPagingMetadata;
689
+ type context_CursorQuery = CursorQuery;
690
+ type context_CursorQueryPagingMethodOneOf = CursorQueryPagingMethodOneOf;
691
+ type context_Cursors = Cursors;
692
+ type context_DomainEvent = DomainEvent;
693
+ type context_DomainEventBodyOneOf = DomainEventBodyOneOf;
694
+ type context_EntityCreatedEvent = EntityCreatedEvent;
695
+ type context_EntityDeletedEvent = EntityDeletedEvent;
696
+ type context_EntityUpdatedEvent = EntityUpdatedEvent;
697
+ type context_EventMetadata = EventMetadata;
698
+ type context_ExtendedFields = ExtendedFields;
699
+ type context_GetRefundRequest = GetRefundRequest;
700
+ type context_GetRefundResponse = GetRefundResponse;
701
+ type context_GetRefundResponseNonNullableFields = GetRefundResponseNonNullableFields;
702
+ type context_GetRefundabilityRequest = GetRefundabilityRequest;
703
+ type context_GetRefundabilityResponse = GetRefundabilityResponse;
704
+ type context_GetRefundabilityResponseNonNullableFields = GetRefundabilityResponseNonNullableFields;
705
+ type context_IdentificationData = IdentificationData;
706
+ type context_IdentificationDataIdOneOf = IdentificationDataIdOneOf;
707
+ type context_Initiator = Initiator;
708
+ declare const context_Initiator: typeof Initiator;
709
+ type context_MessageEnvelope = MessageEnvelope;
710
+ type context_QueryRefundsRequest = QueryRefundsRequest;
711
+ type context_QueryRefundsResponse = QueryRefundsResponse;
712
+ type context_QueryRefundsResponseNonNullableFields = QueryRefundsResponseNonNullableFields;
713
+ type context_Refund = Refund;
714
+ type context_RefundCreatedEnvelope = RefundCreatedEnvelope;
715
+ type context_RefundOptions = RefundOptions;
716
+ type context_RefundUpdatedEnvelope = RefundUpdatedEnvelope;
717
+ type context_Refundability = Refundability;
718
+ type context_RefundabilityDetailsOneOf = RefundabilityDetailsOneOf;
719
+ type context_RefundsQueryBuilder = RefundsQueryBuilder;
720
+ type context_RefundsQueryResult = RefundsQueryResult;
721
+ type context_Rejection = Rejection;
722
+ type context_RejectionReason = RejectionReason;
723
+ declare const context_RejectionReason: typeof RejectionReason;
724
+ type context_SortOrder = SortOrder;
725
+ declare const context_SortOrder: typeof SortOrder;
726
+ type context_Sorting = Sorting;
727
+ type context_Status = Status;
728
+ declare const context_Status: typeof Status;
729
+ type context_StatusInfo = StatusInfo;
730
+ type context_SyncRefundRequest = SyncRefundRequest;
731
+ type context_SyncRefundResponse = SyncRefundResponse;
732
+ type context_UpdateExtendedFieldsOptions = UpdateExtendedFieldsOptions;
733
+ type context_UpdateExtendedFieldsRequest = UpdateExtendedFieldsRequest;
734
+ type context_UpdateExtendedFieldsResponse = UpdateExtendedFieldsResponse;
735
+ type context_UpdateExtendedFieldsResponseNonNullableFields = UpdateExtendedFieldsResponseNonNullableFields;
736
+ type context_WebhookIdentityType = WebhookIdentityType;
737
+ declare const context_WebhookIdentityType: typeof WebhookIdentityType;
436
738
  declare const context_createRefund: typeof createRefund;
437
739
  declare const context_getRefund: typeof getRefund;
438
740
  declare const context_getRefundability: typeof getRefundability;
@@ -441,7 +743,7 @@ declare const context_onRefundUpdated: typeof onRefundUpdated;
441
743
  declare const context_queryRefunds: typeof queryRefunds;
442
744
  declare const context_updateExtendedFields: typeof updateExtendedFields;
443
745
  declare namespace context {
444
- export { context_createRefund as createRefund, context_getRefund as getRefund, context_getRefundability as getRefundability, context_onRefundCreated as onRefundCreated, context_onRefundUpdated as onRefundUpdated, context_queryRefunds as queryRefunds, context_updateExtendedFields as updateExtendedFields };
746
+ export { type context_ActionEvent as ActionEvent, type context_BaseEventMetadata as BaseEventMetadata, type context_CreateRefundOptions as CreateRefundOptions, type context_CreateRefundRequest as CreateRefundRequest, type context_CreateRefundResponse as CreateRefundResponse, type context_CreateRefundResponseNonNullableFields as CreateRefundResponseNonNullableFields, type context_CursorPaging as CursorPaging, type context_CursorPagingMetadata as CursorPagingMetadata, type context_CursorQuery as CursorQuery, type context_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type context_Cursors as Cursors, 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_EventMetadata as EventMetadata, type context_ExtendedFields as ExtendedFields, type context_GetRefundRequest as GetRefundRequest, type context_GetRefundResponse as GetRefundResponse, type context_GetRefundResponseNonNullableFields as GetRefundResponseNonNullableFields, type context_GetRefundabilityRequest as GetRefundabilityRequest, type context_GetRefundabilityResponse as GetRefundabilityResponse, type context_GetRefundabilityResponseNonNullableFields as GetRefundabilityResponseNonNullableFields, type context_IdentificationData as IdentificationData, type context_IdentificationDataIdOneOf as IdentificationDataIdOneOf, context_Initiator as Initiator, type context_MessageEnvelope as MessageEnvelope, type context_QueryRefundsRequest as QueryRefundsRequest, type context_QueryRefundsResponse as QueryRefundsResponse, type context_QueryRefundsResponseNonNullableFields as QueryRefundsResponseNonNullableFields, type context_Refund as Refund, type context_RefundCreatedEnvelope as RefundCreatedEnvelope, type context_RefundOptions as RefundOptions, type context_RefundUpdatedEnvelope as RefundUpdatedEnvelope, type context_Refundability as Refundability, type context_RefundabilityDetailsOneOf as RefundabilityDetailsOneOf, type context_RefundsQueryBuilder as RefundsQueryBuilder, type context_RefundsQueryResult as RefundsQueryResult, type context_Rejection as Rejection, context_RejectionReason as RejectionReason, context_SortOrder as SortOrder, type context_Sorting as Sorting, context_Status as Status, type context_StatusInfo as StatusInfo, type context_SyncRefundRequest as SyncRefundRequest, type context_SyncRefundResponse as SyncRefundResponse, type context_UpdateExtendedFieldsOptions as UpdateExtendedFieldsOptions, type context_UpdateExtendedFieldsRequest as UpdateExtendedFieldsRequest, type context_UpdateExtendedFieldsResponse as UpdateExtendedFieldsResponse, type context_UpdateExtendedFieldsResponseNonNullableFields as UpdateExtendedFieldsResponseNonNullableFields, context_WebhookIdentityType as WebhookIdentityType, context_createRefund as createRefund, context_getRefund as getRefund, context_getRefundability as getRefundability, context_onRefundCreated as onRefundCreated, context_onRefundUpdated as onRefundUpdated, context_queryRefunds as queryRefunds, context_updateExtendedFields as updateExtendedFields };
445
747
  }
446
748
 
447
749
  export { context as refunds };
@@ -624,6 +624,8 @@ interface UpdateExtendedFieldsOptions {
624
624
 
625
625
  interface HttpClient {
626
626
  request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
627
+ fetchWithAuth: typeof fetch;
628
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
627
629
  }
628
630
  type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
629
631
  type HttpResponse<T = any> = {
@@ -648,10 +650,17 @@ type EventDefinition<Payload = unknown, Type extends string = string> = {
648
650
  __type: 'event-definition';
649
651
  type: Type;
650
652
  isDomainEvent?: boolean;
651
- transformations?: unknown;
653
+ transformations?: (envelope: unknown) => Payload;
652
654
  __payload: Payload;
653
655
  };
654
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, _transformations?: unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
656
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
657
+
658
+ declare global {
659
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
660
+ interface SymbolConstructor {
661
+ readonly observable: symbol;
662
+ }
663
+ }
655
664
 
656
665
  declare const __metadata: {
657
666
  PACKAGE_NAME: string;