@wix/redirects 1.0.32 → 1.0.34

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.
Files changed (28) hide show
  1. package/build/cjs/index.js +5 -1
  2. package/build/cjs/index.js.map +1 -1
  3. package/build/cjs/index.typings.js +5 -1
  4. package/build/cjs/index.typings.js.map +1 -1
  5. package/build/cjs/meta.js +5 -1
  6. package/build/cjs/meta.js.map +1 -1
  7. package/build/cjs/src/headless-v1-redirect-session.http.js +2 -10
  8. package/build/cjs/src/headless-v1-redirect-session.http.js.map +1 -1
  9. package/build/cjs/src/headless-v1-redirect-session.meta.d.ts +1 -1
  10. package/build/cjs/src/headless-v1-redirect-session.meta.js +5 -1
  11. package/build/cjs/src/headless-v1-redirect-session.meta.js.map +1 -1
  12. package/build/cjs/src/headless-v1-redirect-session.public.d.ts +2 -2
  13. package/build/cjs/src/headless-v1-redirect-session.types.d.ts +87 -0
  14. package/build/cjs/src/headless-v1-redirect-session.types.js +4 -4
  15. package/build/cjs/src/headless-v1-redirect-session.types.js.map +1 -1
  16. package/build/cjs/src/headless-v1-redirect-session.universal.d.ts +87 -0
  17. package/build/cjs/src/headless-v1-redirect-session.universal.js +25 -8
  18. package/build/cjs/src/headless-v1-redirect-session.universal.js.map +1 -1
  19. package/build/es/src/headless-v1-redirect-session.http.js +2 -10
  20. package/build/es/src/headless-v1-redirect-session.http.js.map +1 -1
  21. package/build/es/src/headless-v1-redirect-session.meta.d.ts +1 -1
  22. package/build/es/src/headless-v1-redirect-session.public.d.ts +2 -2
  23. package/build/es/src/headless-v1-redirect-session.types.d.ts +87 -0
  24. package/build/es/src/headless-v1-redirect-session.types.js.map +1 -1
  25. package/build/es/src/headless-v1-redirect-session.universal.d.ts +87 -0
  26. package/build/es/src/headless-v1-redirect-session.universal.js +17 -4
  27. package/build/es/src/headless-v1-redirect-session.universal.js.map +1 -1
  28. package/package.json +7 -3
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,uFAAuE"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uFAAuE"}
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,0FAA0E"}
1
+ {"version":3,"file":"index.typings.js","sourceRoot":"","sources":["../../index.typings.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,0FAA0E"}
package/build/cjs/meta.js CHANGED
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,qFAAqE"}
1
+ {"version":3,"file":"meta.js","sourceRoot":"","sources":["../../meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qFAAqE"}
@@ -1,10 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createRedirectSession = void 0;
4
- const ambassador_1 = require("@wix/metro-runtime/ambassador");
5
4
  const metro_runtime_1 = require("@wix/metro-runtime");
6
- const _createRedirectSessionRequest = {};
7
- const _createRedirectSessionResponse = {};
8
5
  function resolveWixHeadlessV1RedirectSessionServiceUrl(opts) {
9
6
  const domainToMappings = {
10
7
  'www._base_domain_': [
@@ -40,25 +37,20 @@ function resolveWixHeadlessV1RedirectSessionServiceUrl(opts) {
40
37
  * 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow.
41
38
  */
42
39
  function createRedirectSession(payload) {
43
- const { toJSON: toReq, fromJSON: fromReq } = (0, ambassador_1.serializer)(_createRedirectSessionRequest, {});
44
- const { fromJSON: fromRes } = (0, ambassador_1.serializer)(_createRedirectSessionResponse, {});
45
40
  function __createRedirectSession({ host }) {
46
- const serializedData = toReq(payload);
47
41
  const metadata = {
48
42
  entityFqdn: 'wix.headless.v1.redirect_session',
49
43
  method: 'POST',
50
44
  methodFqn: 'wix.headless.v1.RedirectSessionService.CreateRedirectSession',
51
45
  url: resolveWixHeadlessV1RedirectSessionServiceUrl({
52
46
  protoPath: '/v1/redirect-session',
53
- data: serializedData,
47
+ data: payload,
54
48
  host,
55
49
  }),
56
- data: serializedData,
57
- transformResponse: fromRes,
50
+ data: payload,
58
51
  };
59
52
  return metadata;
60
53
  }
61
- __createRedirectSession.fromReq = fromReq;
62
54
  return __createRedirectSession;
63
55
  }
64
56
  exports.createRedirectSession = createRedirectSession;
@@ -1 +1 @@
1
- {"version":3,"file":"headless-v1-redirect-session.http.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.http.ts"],"names":[],"mappings":";;;AAAA,8DAA2D;AAC3D,sDAAgD;AAShD,MAAM,6BAA6B,GAAG,EAAE,CAAC;AACzC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAE1C,SAAS,6CAA6C,CACpD,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,mBAAmB;gBAC5B,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,IAAA,0BAAU,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,qBAAqB,CACnC,OAAqC;IAIrC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAA,uBAAU,EACrD,6BAA6B,EAC7B,EAAE,CACH,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,IAAA,uBAAU,EAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC;IAE7E,SAAS,uBAAuB,CAAC,EAAE,IAAI,EAAO;QAC5C,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,kCAAkC;YAC9C,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,8DAA8D;YACzE,GAAG,EAAE,6CAA6C,CAAC;gBACjD,SAAS,EAAE,sBAAsB;gBACjC,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,uBAAuB,CAAC,OAAO,GAAG,OAAO,CAAC;IAE1C,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAhCD,sDAgCC"}
1
+ {"version":3,"file":"headless-v1-redirect-session.http.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.http.ts"],"names":[],"mappings":";;;AAAA,sDAAgD;AAShD,SAAS,6CAA6C,CACpD,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,mBAAmB;gBAC5B,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,IAAA,0BAAU,EAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAgB,qBAAqB,CACnC,OAAqC;IAIrC,SAAS,uBAAuB,CAAC,EAAE,IAAI,EAAO;QAC5C,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,kCAAkC;YAC9C,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,8DAA8D;YACzE,GAAG,EAAE,6CAA6C,CAAC;gBACjD,SAAS,EAAE,sBAAsB;gBACjC,IAAI,EAAE,OAAO;gBACb,IAAI;aACL,CAAC;YACF,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAtBD,sDAsBC"}
@@ -1,6 +1,6 @@
1
1
  import * as ambassadorWixHeadlessV1RedirectSessionTypes from './headless-v1-redirect-session.types';
2
2
  import * as ambassadorWixHeadlessV1RedirectSessionUniversalTypes from './headless-v1-redirect-session.universal';
3
- export declare type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
3
+ export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4
4
  getUrl: (context: any) => string;
5
5
  httpMethod: K;
6
6
  path: string;
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -1 +1 @@
1
- {"version":3,"file":"headless-v1-redirect-session.meta.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA,4GAA8F;AAsB9F,SAAgB,qBAAqB;IAUnC,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,sCAAsC,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAExE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,sBAAsB;QAC5B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA9BD,sDA8BC"}
1
+ {"version":3,"file":"headless-v1-redirect-session.meta.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.meta.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,4GAA8F;AAsB9F,SAAgB,qBAAqB;IAUnC,MAAM,OAAO,GAAG,EAAS,CAAC;IAE1B,MAAM,iBAAiB,GACrB,sCAAsC,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;IAExE,MAAM,MAAM,GAAG,CAAC,OAAY,EAAU,EAAE;QACtC,MAAM,EAAE,GAAG,EAAE,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAC3C,OAAO,GAAI,CAAC;IACd,CAAC,CAAC;IAEF,OAAO;QACL,MAAM;QACN,UAAU,EAAE,MAAM;QAClB,IAAI,EAAE,sBAAsB;QAC5B,UAAU,EAAE,EAAE;QACd,aAAa,EAAE,IAAW;QAC1B,qBAAqB,EAAE,IAAW;QAClC,cAAc,EAAE,IAAW;QAC3B,sBAAsB,EAAE,IAAW;KACpC,CAAC;AACJ,CAAC;AA9BD,sDA8BC"}
@@ -3,6 +3,6 @@ import { CreateRedirectSessionOptions } from './headless-v1-redirect-session.uni
3
3
  export declare const __metadata: {
4
4
  PACKAGE_NAME: string;
5
5
  };
6
- export declare function createRedirectSession(httpClient: HttpClient): (options?: CreateRedirectSessionOptions | undefined) => Promise<import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponse & import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponseNonNullableFields>;
6
+ export declare function createRedirectSession(httpClient: HttpClient): (options?: CreateRedirectSessionOptions) => Promise<import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponse & import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponseNonNullableFields>;
7
7
  export { LocationType, Prompt, MembersAccountSection, CallbackType, } from './headless-v1-redirect-session.universal';
8
- export { RedirectSession, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, NestedTimeSlot, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionAuthParams, AuthorizeRequest, RedirectSessionMembersAccountParams, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, CreateRedirectSessionResponseNonNullableFields, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
8
+ export { RedirectSession, URLDetails, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, NestedTimeSlot, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionAuthParams, AuthorizeRequest, RedirectSessionMembersAccountParams, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, CreateRedirectSessionResponseNonNullableFields, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
@@ -7,6 +7,23 @@ export interface RedirectSession {
7
7
  * @readonly
8
8
  */
9
9
  fullUrl?: string;
10
+ /** Details about the URL of the RedirectSession */
11
+ urlDetails?: URLDetails;
12
+ /**
13
+ * The session token to pass to the Wix page to maintain the visitor's identity.
14
+ * @readonly
15
+ */
16
+ sessionToken?: string | null;
17
+ }
18
+ export interface URLDetails {
19
+ /**
20
+ * The endpoint of the url (includes the base url and the path to the endpoint, without the query parameters)
21
+ * For example: `https://mysite.com/_api/oauth2/authorize`
22
+ * @readonly
23
+ */
24
+ endpoint?: string;
25
+ /** The query parameters of the url */
26
+ searchParams?: Record<string, string>;
10
27
  }
11
28
  export interface CreateRedirectSessionRequest extends CreateRedirectSessionRequestIntentOneOf {
12
29
  /** Information required for generating a custom URL for a Wix Bookings checkout. */
@@ -421,9 +438,79 @@ export interface SignInURLResponse {
421
438
  /** The Wix URL details to redirect into */
422
439
  redirectSession?: RedirectSession;
423
440
  }
441
+ export interface DomainEvent extends DomainEventBodyOneOf {
442
+ createdEvent?: EntityCreatedEvent;
443
+ updatedEvent?: EntityUpdatedEvent;
444
+ deletedEvent?: EntityDeletedEvent;
445
+ actionEvent?: ActionEvent;
446
+ /**
447
+ * Unique event ID.
448
+ * Allows clients to ignore duplicate webhooks.
449
+ */
450
+ id?: string;
451
+ /**
452
+ * Assumes actions are also always typed to an entity_type
453
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
454
+ */
455
+ entityFqdn?: string;
456
+ /**
457
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
458
+ * This is although the created/updated/deleted notion is duplication of the oneof types
459
+ * Example: created/updated/deleted/started/completed/email_opened
460
+ */
461
+ slug?: string;
462
+ /** ID of the entity associated with the event. */
463
+ entityId?: string;
464
+ /** Event timestamp. */
465
+ eventTime?: Date;
466
+ /**
467
+ * Whether the event was triggered as a result of a privacy regulation application
468
+ * (for example, GDPR).
469
+ */
470
+ triggeredByAnonymizeRequest?: boolean | null;
471
+ /** If present, indicates the action that triggered the event. */
472
+ originatedFrom?: string | null;
473
+ /**
474
+ * A sequence number defining the order of updates to the underlying entity.
475
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
476
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
477
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
478
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
479
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
480
+ */
481
+ entityEventSequence?: string | null;
482
+ }
483
+ /** @oneof */
484
+ export interface DomainEventBodyOneOf {
485
+ createdEvent?: EntityCreatedEvent;
486
+ updatedEvent?: EntityUpdatedEvent;
487
+ deletedEvent?: EntityDeletedEvent;
488
+ actionEvent?: ActionEvent;
489
+ }
490
+ export interface EntityCreatedEvent {
491
+ entityAsJson?: string;
492
+ }
493
+ export interface EntityUpdatedEvent {
494
+ /**
495
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
496
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
497
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
498
+ */
499
+ currentEntityAsJson?: string;
500
+ }
501
+ export interface EntityDeletedEvent {
502
+ /** Entity that was deleted */
503
+ deletedEntityAsJson?: string | null;
504
+ }
505
+ export interface ActionEvent {
506
+ bodyAsJson?: string;
507
+ }
424
508
  export interface CreateRedirectSessionResponseNonNullableFields {
425
509
  redirectSession?: {
426
510
  id: string;
427
511
  fullUrl: string;
512
+ urlDetails?: {
513
+ endpoint: string;
514
+ };
428
515
  };
429
516
  }
@@ -7,7 +7,7 @@ var LocationType;
7
7
  LocationType["OWNER_BUSINESS"] = "OWNER_BUSINESS";
8
8
  LocationType["OWNER_CUSTOM"] = "OWNER_CUSTOM";
9
9
  LocationType["CUSTOM"] = "CUSTOM";
10
- })(LocationType = exports.LocationType || (exports.LocationType = {}));
10
+ })(LocationType || (exports.LocationType = LocationType = {}));
11
11
  /** Currently only `none` and `login` are supported. */
12
12
  var Prompt;
13
13
  (function (Prompt) {
@@ -15,7 +15,7 @@ var Prompt;
15
15
  Prompt["none"] = "none";
16
16
  Prompt["consent"] = "consent";
17
17
  Prompt["select_account"] = "select_account";
18
- })(Prompt = exports.Prompt || (exports.Prompt = {}));
18
+ })(Prompt || (exports.Prompt = Prompt = {}));
19
19
  var MembersAccountSection;
20
20
  (function (MembersAccountSection) {
21
21
  /** default - account info section in "my account" */
@@ -28,7 +28,7 @@ var MembersAccountSection;
28
28
  MembersAccountSection["SUBSCRIPTIONS"] = "SUBSCRIPTIONS";
29
29
  /** Events section in "my account" */
30
30
  MembersAccountSection["EVENTS"] = "EVENTS";
31
- })(MembersAccountSection = exports.MembersAccountSection || (exports.MembersAccountSection = {}));
31
+ })(MembersAccountSection || (exports.MembersAccountSection = MembersAccountSection = {}));
32
32
  var CallbackType;
33
33
  (function (CallbackType) {
34
34
  /** Invalid value - default */
@@ -39,5 +39,5 @@ var CallbackType;
39
39
  CallbackType["CHECKOUT"] = "CHECKOUT";
40
40
  /** The callback URL is used for the authorize flow */
41
41
  CallbackType["AUTHORIZE"] = "AUTHORIZE";
42
- })(CallbackType = exports.CallbackType || (exports.CallbackType = {}));
42
+ })(CallbackType || (exports.CallbackType = CallbackType = {}));
43
43
  //# sourceMappingURL=headless-v1-redirect-session.types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"headless-v1-redirect-session.types.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.types.ts"],"names":[],"mappings":";;;AA8KA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AA2HD,uDAAuD;AACvD,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,uBAAa,CAAA;IACb,6BAAmB,CAAA;IACnB,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,GAAN,cAAM,KAAN,cAAM,QAKjB;AAWD,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAC/B,qDAAqD;IACrD,sDAA6B,CAAA;IAC7B,0CAA0C;IAC1C,8CAAqB,CAAA;IACrB,wCAAwC;IACxC,0CAAiB,CAAA;IACjB,4CAA4C;IAC5C,wDAA+B,CAAA;IAC/B,qCAAqC;IACrC,0CAAiB,CAAA;AACnB,CAAC,EAXW,qBAAqB,GAArB,6BAAqB,KAArB,6BAAqB,QAWhC;AAkGD,IAAY,YASX;AATD,WAAY,YAAY;IACtB,8BAA8B;IAC9B,mCAAmB,CAAA;IACnB,mDAAmD;IACnD,iCAAiB,CAAA;IACjB,mDAAmD;IACnD,qCAAqB,CAAA;IACrB,sDAAsD;IACtD,uCAAuB,CAAA;AACzB,CAAC,EATW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QASvB"}
1
+ {"version":3,"file":"headless-v1-redirect-session.types.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.types.ts"],"names":[],"mappings":";;;AAgMA,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,4BAAZ,YAAY,QAKvB;AA2HD,uDAAuD;AACvD,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,uBAAa,CAAA;IACb,6BAAmB,CAAA;IACnB,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,sBAAN,MAAM,QAKjB;AAWD,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAC/B,qDAAqD;IACrD,sDAA6B,CAAA;IAC7B,0CAA0C;IAC1C,8CAAqB,CAAA;IACrB,wCAAwC;IACxC,0CAAiB,CAAA;IACjB,4CAA4C;IAC5C,wDAA+B,CAAA;IAC/B,qCAAqC;IACrC,0CAAiB,CAAA;AACnB,CAAC,EAXW,qBAAqB,qCAArB,qBAAqB,QAWhC;AAkGD,IAAY,YASX;AATD,WAAY,YAAY;IACtB,8BAA8B;IAC9B,mCAAmB,CAAA;IACnB,mDAAmD;IACnD,iCAAiB,CAAA;IACjB,mDAAmD;IACnD,qCAAqB,CAAA;IACrB,sDAAsD;IACtD,uCAAuB,CAAA;AACzB,CAAC,EATW,YAAY,4BAAZ,YAAY,QASvB"}
@@ -13,6 +13,23 @@ export interface RedirectSession {
13
13
  * @readonly
14
14
  */
15
15
  fullUrl?: string;
16
+ /** Details about the URL of the RedirectSession */
17
+ urlDetails?: URLDetails;
18
+ /**
19
+ * The session token to pass to the Wix page to maintain the visitor's identity.
20
+ * @readonly
21
+ */
22
+ sessionToken?: string | null;
23
+ }
24
+ export interface URLDetails {
25
+ /**
26
+ * The endpoint of the url (includes the base url and the path to the endpoint, without the query parameters)
27
+ * For example: `https://mysite.com/_api/oauth2/authorize`
28
+ * @readonly
29
+ */
30
+ endpoint?: string;
31
+ /** The query parameters of the url */
32
+ searchParams?: Record<string, string>;
16
33
  }
17
34
  export interface CreateRedirectSessionRequest extends CreateRedirectSessionRequestIntentOneOf {
18
35
  /** Information required for generating a custom URL for a Wix Bookings checkout. */
@@ -424,10 +441,80 @@ export interface SignInURLResponse {
424
441
  /** The Wix URL details to redirect into */
425
442
  redirectSession?: RedirectSession;
426
443
  }
444
+ export interface DomainEvent extends DomainEventBodyOneOf {
445
+ createdEvent?: EntityCreatedEvent;
446
+ updatedEvent?: EntityUpdatedEvent;
447
+ deletedEvent?: EntityDeletedEvent;
448
+ actionEvent?: ActionEvent;
449
+ /**
450
+ * Unique event ID.
451
+ * Allows clients to ignore duplicate webhooks.
452
+ */
453
+ _id?: string;
454
+ /**
455
+ * Assumes actions are also always typed to an entity_type
456
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
457
+ */
458
+ entityFqdn?: string;
459
+ /**
460
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
461
+ * This is although the created/updated/deleted notion is duplication of the oneof types
462
+ * Example: created/updated/deleted/started/completed/email_opened
463
+ */
464
+ slug?: string;
465
+ /** ID of the entity associated with the event. */
466
+ entityId?: string;
467
+ /** Event timestamp. */
468
+ eventTime?: Date;
469
+ /**
470
+ * Whether the event was triggered as a result of a privacy regulation application
471
+ * (for example, GDPR).
472
+ */
473
+ triggeredByAnonymizeRequest?: boolean | null;
474
+ /** If present, indicates the action that triggered the event. */
475
+ originatedFrom?: string | null;
476
+ /**
477
+ * A sequence number defining the order of updates to the underlying entity.
478
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
479
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
480
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
481
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
482
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
483
+ */
484
+ entityEventSequence?: string | null;
485
+ }
486
+ /** @oneof */
487
+ export interface DomainEventBodyOneOf {
488
+ createdEvent?: EntityCreatedEvent;
489
+ updatedEvent?: EntityUpdatedEvent;
490
+ deletedEvent?: EntityDeletedEvent;
491
+ actionEvent?: ActionEvent;
492
+ }
493
+ export interface EntityCreatedEvent {
494
+ entityAsJson?: string;
495
+ }
496
+ export interface EntityUpdatedEvent {
497
+ /**
498
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
499
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
500
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
501
+ */
502
+ currentEntityAsJson?: string;
503
+ }
504
+ export interface EntityDeletedEvent {
505
+ /** Entity that was deleted */
506
+ deletedEntityAsJson?: string | null;
507
+ }
508
+ export interface ActionEvent {
509
+ bodyAsJson?: string;
510
+ }
427
511
  export interface CreateRedirectSessionResponseNonNullableFields {
428
512
  redirectSession?: {
429
513
  _id: string;
430
514
  fullUrl: string;
515
+ urlDetails?: {
516
+ endpoint: string;
517
+ };
431
518
  };
432
519
  }
433
520
  /**
@@ -1,7 +1,11 @@
1
1
  "use strict";
2
2
  var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
3
  if (k2 === undefined) k2 = k;
4
- Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
5
9
  }) : (function(o, m, k, k2) {
6
10
  if (k2 === undefined) k2 = k;
7
11
  o[k2] = m[k];
@@ -30,6 +34,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
30
34
  Object.defineProperty(exports, "__esModule", { value: true });
31
35
  exports.createRedirectSession = exports.CallbackType = exports.MembersAccountSection = exports.Prompt = exports.LocationType = exports.__debug = void 0;
32
36
  const velo_1 = require("@wix/metro-runtime/velo");
37
+ const transform_error_1 = require("@wix/sdk-runtime/transform-error");
33
38
  const ambassadorWixHeadlessV1RedirectSession = __importStar(require("./headless-v1-redirect-session.http"));
34
39
  let __verbose = false;
35
40
  function __log(...args) {
@@ -52,7 +57,7 @@ var LocationType;
52
57
  LocationType["OWNER_BUSINESS"] = "OWNER_BUSINESS";
53
58
  LocationType["OWNER_CUSTOM"] = "OWNER_CUSTOM";
54
59
  LocationType["CUSTOM"] = "CUSTOM";
55
- })(LocationType = exports.LocationType || (exports.LocationType = {}));
60
+ })(LocationType || (exports.LocationType = LocationType = {}));
56
61
  /** Currently only `none` and `login` are supported. */
57
62
  var Prompt;
58
63
  (function (Prompt) {
@@ -60,7 +65,7 @@ var Prompt;
60
65
  Prompt["none"] = "none";
61
66
  Prompt["consent"] = "consent";
62
67
  Prompt["select_account"] = "select_account";
63
- })(Prompt = exports.Prompt || (exports.Prompt = {}));
68
+ })(Prompt || (exports.Prompt = Prompt = {}));
64
69
  var MembersAccountSection;
65
70
  (function (MembersAccountSection) {
66
71
  /** default - account info section in "my account" */
@@ -73,7 +78,7 @@ var MembersAccountSection;
73
78
  MembersAccountSection["SUBSCRIPTIONS"] = "SUBSCRIPTIONS";
74
79
  /** Events section in "my account" */
75
80
  MembersAccountSection["EVENTS"] = "EVENTS";
76
- })(MembersAccountSection = exports.MembersAccountSection || (exports.MembersAccountSection = {}));
81
+ })(MembersAccountSection || (exports.MembersAccountSection = MembersAccountSection = {}));
77
82
  var CallbackType;
78
83
  (function (CallbackType) {
79
84
  /** Invalid value - default */
@@ -84,7 +89,7 @@ var CallbackType;
84
89
  CallbackType["CHECKOUT"] = "CHECKOUT";
85
90
  /** The callback URL is used for the authorize flow */
86
91
  CallbackType["AUTHORIZE"] = "AUTHORIZE";
87
- })(CallbackType = exports.CallbackType || (exports.CallbackType = {}));
92
+ })(CallbackType || (exports.CallbackType = CallbackType = {}));
88
93
  const _createRedirectSessionRequest = {};
89
94
  const _createRedirectSessionResponse = {};
90
95
  /**
@@ -150,9 +155,21 @@ function createRedirectSession(options) {
150
155
  return fromJSON(result.data);
151
156
  }
152
157
  catch (err) {
153
- const transformedError = (0, velo_1.transformError)(err, requestTransformation, [
154
- 'options',
155
- ]);
158
+ const transformedError = (0, transform_error_1.transformError)(err, {
159
+ spreadPathsToArguments: {},
160
+ explicitPathsToArguments: {
161
+ bookingsCheckout: '$[0].bookingsCheckout',
162
+ ecomCheckout: '$[0].ecomCheckout',
163
+ eventsCheckout: '$[0].eventsCheckout',
164
+ paidPlansCheckout: '$[0].paidPlansCheckout',
165
+ login: '$[0].login',
166
+ logout: '$[0].logout',
167
+ auth: '$[0].auth',
168
+ callbacks: '$[0].callbacks',
169
+ preferences: '$[0].preferences',
170
+ },
171
+ singleArgumentUnchanged: false,
172
+ }, ['options']);
156
173
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
157
174
  throw transformedError;
158
175
  }
@@ -1 +1 @@
1
- {"version":3,"file":"headless-v1-redirect-session.universal.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.universal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAqE;AAErE,4GAA8F;AAE9F,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAEY,QAAA,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AA8K5B,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,GAAZ,oBAAY,KAAZ,oBAAY,QAKvB;AA2HD,uDAAuD;AACvD,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,uBAAa,CAAA;IACb,6BAAmB,CAAA;IACnB,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,GAAN,cAAM,KAAN,cAAM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EH,MAAM,OAAO,GAAG,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAE/C,MAAM,OAAO,GACX,sCAAsC,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAExE,KAAK,CAAC,iDAAiD,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAE7E,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,2DAAI,CAAC;QAC5B,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,4DAAG,MAAM,CAAC,CAAC;YAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;QACtC,CAAC;QAAC,OAAO,GAAQ,EAAE,CAAC;YAClB,MAAM,gBAAgB,GAAG,IAAA,gCAAiB,EACxC,GAAG,EACH;gBACE,sBAAsB,EAAE,EAAE;gBAC1B,wBAAwB,EAAE;oBACxB,gBAAgB,EAAE,uBAAuB;oBACzC,YAAY,EAAE,mBAAmB;oBACjC,cAAc,EAAE,qBAAqB;oBACrC,iBAAiB,EAAE,wBAAwB;oBAC3C,KAAK,EAAE,YAAY;oBACnB,MAAM,EAAE,aAAa;oBACrB,IAAI,EAAE,WAAW;oBACjB,SAAS,EAAE,gBAAgB;oBAC3B,WAAW,EAAE,kBAAkB;iBAChC;gBACD,uBAAuB,EAAE,KAAK;aAC/B,EACD,CAAC,SAAS,CAAC,CACZ,CAAC;YACF,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,4DAAG,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;QACzB,CAAC;;CACF;AAjFD,sDAiFC"}
@@ -1,7 +1,4 @@
1
- import { serializer } from '@wix/metro-runtime/ambassador';
2
1
  import { resolveUrl } from '@wix/metro-runtime';
3
- const _createRedirectSessionRequest = {};
4
- const _createRedirectSessionResponse = {};
5
2
  function resolveWixHeadlessV1RedirectSessionServiceUrl(opts) {
6
3
  const domainToMappings = {
7
4
  'www._base_domain_': [
@@ -37,25 +34,20 @@ function resolveWixHeadlessV1RedirectSessionServiceUrl(opts) {
37
34
  * 1. Make sure the pages at the callback URLs you provided take care of the next stages in your visitor flow.
38
35
  */
39
36
  export function createRedirectSession(payload) {
40
- const { toJSON: toReq, fromJSON: fromReq } = serializer(_createRedirectSessionRequest, {});
41
- const { fromJSON: fromRes } = serializer(_createRedirectSessionResponse, {});
42
37
  function __createRedirectSession({ host }) {
43
- const serializedData = toReq(payload);
44
38
  const metadata = {
45
39
  entityFqdn: 'wix.headless.v1.redirect_session',
46
40
  method: 'POST',
47
41
  methodFqn: 'wix.headless.v1.RedirectSessionService.CreateRedirectSession',
48
42
  url: resolveWixHeadlessV1RedirectSessionServiceUrl({
49
43
  protoPath: '/v1/redirect-session',
50
- data: serializedData,
44
+ data: payload,
51
45
  host,
52
46
  }),
53
- data: serializedData,
54
- transformResponse: fromRes,
47
+ data: payload,
55
48
  };
56
49
  return metadata;
57
50
  }
58
- __createRedirectSession.fromReq = fromReq;
59
51
  return __createRedirectSession;
60
52
  }
61
53
  //# sourceMappingURL=headless-v1-redirect-session.http.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"headless-v1-redirect-session.http.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAShD,MAAM,6BAA6B,GAAG,EAAE,CAAC;AACzC,MAAM,8BAA8B,GAAG,EAAE,CAAC;AAE1C,SAAS,6CAA6C,CACpD,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,mBAAmB;gBAC5B,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAqC;IAIrC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CACrD,6BAA6B,EAC7B,EAAE,CACH,CAAC;IACF,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,UAAU,CAAC,8BAA8B,EAAE,EAAE,CAAC,CAAC;IAE7E,SAAS,uBAAuB,CAAC,EAAE,IAAI,EAAO;QAC5C,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,CAAC;QACtC,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,kCAAkC;YAC9C,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,8DAA8D;YACzE,GAAG,EAAE,6CAA6C,CAAC;gBACjD,SAAS,EAAE,sBAAsB;gBACjC,IAAI,EAAE,cAAc;gBACpB,IAAI;aACL,CAAC;YACF,IAAI,EAAE,cAAc;YACpB,iBAAiB,EAAE,OAAO;SAC3B,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,uBAAuB,CAAC,OAAO,GAAG,OAAO,CAAC;IAE1C,OAAO,uBAAuB,CAAC;AACjC,CAAC"}
1
+ {"version":3,"file":"headless-v1-redirect-session.http.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAShD,SAAS,6CAA6C,CACpD,IAA8C;IAE9C,MAAM,gBAAgB,GAAG;QACvB,mBAAmB,EAAE;YACnB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;SACF;QACD,iBAAiB,EAAE;YACjB;gBACE,OAAO,EAAE,qBAAqB;gBAC9B,QAAQ,EAAE,EAAE;aACb;YACD;gBACE,OAAO,EAAE,mBAAmB;gBAC5B,QAAQ,EAAE,EAAE;aACb;SACF;KACF,CAAC;IAEF,OAAO,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,gBAAgB,EAAE,CAAC,CAAC,CAAC;AAC/D,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CACnC,OAAqC;IAIrC,SAAS,uBAAuB,CAAC,EAAE,IAAI,EAAO;QAC5C,MAAM,QAAQ,GAAG;YACf,UAAU,EAAE,kCAAkC;YAC9C,MAAM,EAAE,MAAa;YACrB,SAAS,EAAE,8DAA8D;YACzE,GAAG,EAAE,6CAA6C,CAAC;gBACjD,SAAS,EAAE,sBAAsB;gBACjC,IAAI,EAAE,OAAO;gBACb,IAAI;aACL,CAAC;YACF,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import * as ambassadorWixHeadlessV1RedirectSessionTypes from './headless-v1-redirect-session.types';
2
2
  import * as ambassadorWixHeadlessV1RedirectSessionUniversalTypes from './headless-v1-redirect-session.universal';
3
- export declare type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
3
+ export type __PublicMethodMetaInfo<K = string, M = unknown, T = unknown, S = unknown, Q = unknown, R = unknown> = {
4
4
  getUrl: (context: any) => string;
5
5
  httpMethod: K;
6
6
  path: string;
@@ -3,6 +3,6 @@ import { CreateRedirectSessionOptions } from './headless-v1-redirect-session.uni
3
3
  export declare const __metadata: {
4
4
  PACKAGE_NAME: string;
5
5
  };
6
- export declare function createRedirectSession(httpClient: HttpClient): (options?: CreateRedirectSessionOptions | undefined) => Promise<import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponse & import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponseNonNullableFields>;
6
+ export declare function createRedirectSession(httpClient: HttpClient): (options?: CreateRedirectSessionOptions) => Promise<import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponse & import("./headless-v1-redirect-session.universal").CreateRedirectSessionResponseNonNullableFields>;
7
7
  export { LocationType, Prompt, MembersAccountSection, CallbackType, } from './headless-v1-redirect-session.universal';
8
- export { RedirectSession, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, NestedTimeSlot, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionAuthParams, AuthorizeRequest, RedirectSessionMembersAccountParams, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, CreateRedirectSessionResponseNonNullableFields, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
8
+ export { RedirectSession, URLDetails, CreateRedirectSessionRequest, CreateRedirectSessionRequestIntentOneOf, RedirectSessionBookingsCheckoutParams, SlotAvailability, Slot, SlotResource, Location, WaitingList, BookingPolicyViolations, NestedTimeSlot, RedirectSessionEcomCheckoutParams, RedirectSessionEventsCheckoutParams, RedirectSessionPaidPlansCheckoutParams, RedirectSessionLoginParams, RedirectSessionLogoutParams, RedirectSessionAuthParams, AuthorizeRequest, RedirectSessionMembersAccountParams, CallbackParams, RedirectSessionPreferences, CustomMemberPaths, CreateRedirectSessionResponse, ValidateCallbackURLRequest, ValidateCallbackURLResponse, SignInURLRequest, SignInURLResponse, DomainEvent, DomainEventBodyOneOf, EntityCreatedEvent, EntityUpdatedEvent, EntityDeletedEvent, ActionEvent, CreateRedirectSessionResponseNonNullableFields, CreateRedirectSessionOptions, } from './headless-v1-redirect-session.universal';
@@ -7,6 +7,23 @@ export interface RedirectSession {
7
7
  * @readonly
8
8
  */
9
9
  fullUrl?: string;
10
+ /** Details about the URL of the RedirectSession */
11
+ urlDetails?: URLDetails;
12
+ /**
13
+ * The session token to pass to the Wix page to maintain the visitor's identity.
14
+ * @readonly
15
+ */
16
+ sessionToken?: string | null;
17
+ }
18
+ export interface URLDetails {
19
+ /**
20
+ * The endpoint of the url (includes the base url and the path to the endpoint, without the query parameters)
21
+ * For example: `https://mysite.com/_api/oauth2/authorize`
22
+ * @readonly
23
+ */
24
+ endpoint?: string;
25
+ /** The query parameters of the url */
26
+ searchParams?: Record<string, string>;
10
27
  }
11
28
  export interface CreateRedirectSessionRequest extends CreateRedirectSessionRequestIntentOneOf {
12
29
  /** Information required for generating a custom URL for a Wix Bookings checkout. */
@@ -421,9 +438,79 @@ export interface SignInURLResponse {
421
438
  /** The Wix URL details to redirect into */
422
439
  redirectSession?: RedirectSession;
423
440
  }
441
+ export interface DomainEvent extends DomainEventBodyOneOf {
442
+ createdEvent?: EntityCreatedEvent;
443
+ updatedEvent?: EntityUpdatedEvent;
444
+ deletedEvent?: EntityDeletedEvent;
445
+ actionEvent?: ActionEvent;
446
+ /**
447
+ * Unique event ID.
448
+ * Allows clients to ignore duplicate webhooks.
449
+ */
450
+ id?: string;
451
+ /**
452
+ * Assumes actions are also always typed to an entity_type
453
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
454
+ */
455
+ entityFqdn?: string;
456
+ /**
457
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
458
+ * This is although the created/updated/deleted notion is duplication of the oneof types
459
+ * Example: created/updated/deleted/started/completed/email_opened
460
+ */
461
+ slug?: string;
462
+ /** ID of the entity associated with the event. */
463
+ entityId?: string;
464
+ /** Event timestamp. */
465
+ eventTime?: Date;
466
+ /**
467
+ * Whether the event was triggered as a result of a privacy regulation application
468
+ * (for example, GDPR).
469
+ */
470
+ triggeredByAnonymizeRequest?: boolean | null;
471
+ /** If present, indicates the action that triggered the event. */
472
+ originatedFrom?: string | null;
473
+ /**
474
+ * A sequence number defining the order of updates to the underlying entity.
475
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
476
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
477
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
478
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
479
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
480
+ */
481
+ entityEventSequence?: string | null;
482
+ }
483
+ /** @oneof */
484
+ export interface DomainEventBodyOneOf {
485
+ createdEvent?: EntityCreatedEvent;
486
+ updatedEvent?: EntityUpdatedEvent;
487
+ deletedEvent?: EntityDeletedEvent;
488
+ actionEvent?: ActionEvent;
489
+ }
490
+ export interface EntityCreatedEvent {
491
+ entityAsJson?: string;
492
+ }
493
+ export interface EntityUpdatedEvent {
494
+ /**
495
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
496
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
497
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
498
+ */
499
+ currentEntityAsJson?: string;
500
+ }
501
+ export interface EntityDeletedEvent {
502
+ /** Entity that was deleted */
503
+ deletedEntityAsJson?: string | null;
504
+ }
505
+ export interface ActionEvent {
506
+ bodyAsJson?: string;
507
+ }
424
508
  export interface CreateRedirectSessionResponseNonNullableFields {
425
509
  redirectSession?: {
426
510
  id: string;
427
511
  fullUrl: string;
512
+ urlDetails?: {
513
+ endpoint: string;
514
+ };
428
515
  };
429
516
  }
@@ -1 +1 @@
1
- {"version":3,"file":"headless-v1-redirect-session.types.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.types.ts"],"names":[],"mappings":"AA8KA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AA2HD,uDAAuD;AACvD,MAAM,CAAN,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,uBAAa,CAAA;IACb,6BAAmB,CAAA;IACnB,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,KAAN,MAAM,QAKjB;AAWD,MAAM,CAAN,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAC/B,qDAAqD;IACrD,sDAA6B,CAAA;IAC7B,0CAA0C;IAC1C,8CAAqB,CAAA;IACrB,wCAAwC;IACxC,0CAAiB,CAAA;IACjB,4CAA4C;IAC5C,wDAA+B,CAAA;IAC/B,qCAAqC;IACrC,0CAAiB,CAAA;AACnB,CAAC,EAXW,qBAAqB,KAArB,qBAAqB,QAWhC;AAkGD,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB,8BAA8B;IAC9B,mCAAmB,CAAA;IACnB,mDAAmD;IACnD,iCAAiB,CAAA;IACjB,mDAAmD;IACnD,qCAAqB,CAAA;IACrB,sDAAsD;IACtD,uCAAuB,CAAA;AACzB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB"}
1
+ {"version":3,"file":"headless-v1-redirect-session.types.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.types.ts"],"names":[],"mappings":"AAgMA,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AA2HD,uDAAuD;AACvD,MAAM,CAAN,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,uBAAa,CAAA;IACb,6BAAmB,CAAA;IACnB,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,KAAN,MAAM,QAKjB;AAWD,MAAM,CAAN,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAC/B,qDAAqD;IACrD,sDAA6B,CAAA;IAC7B,0CAA0C;IAC1C,8CAAqB,CAAA;IACrB,wCAAwC;IACxC,0CAAiB,CAAA;IACjB,4CAA4C;IAC5C,wDAA+B,CAAA;IAC/B,qCAAqC;IACrC,0CAAiB,CAAA;AACnB,CAAC,EAXW,qBAAqB,KAArB,qBAAqB,QAWhC;AAkGD,MAAM,CAAN,IAAY,YASX;AATD,WAAY,YAAY;IACtB,8BAA8B;IAC9B,mCAAmB,CAAA;IACnB,mDAAmD;IACnD,iCAAiB,CAAA;IACjB,mDAAmD;IACnD,qCAAqB,CAAA;IACrB,sDAAsD;IACtD,uCAAuB,CAAA;AACzB,CAAC,EATW,YAAY,KAAZ,YAAY,QASvB"}
@@ -13,6 +13,23 @@ export interface RedirectSession {
13
13
  * @readonly
14
14
  */
15
15
  fullUrl?: string;
16
+ /** Details about the URL of the RedirectSession */
17
+ urlDetails?: URLDetails;
18
+ /**
19
+ * The session token to pass to the Wix page to maintain the visitor's identity.
20
+ * @readonly
21
+ */
22
+ sessionToken?: string | null;
23
+ }
24
+ export interface URLDetails {
25
+ /**
26
+ * The endpoint of the url (includes the base url and the path to the endpoint, without the query parameters)
27
+ * For example: `https://mysite.com/_api/oauth2/authorize`
28
+ * @readonly
29
+ */
30
+ endpoint?: string;
31
+ /** The query parameters of the url */
32
+ searchParams?: Record<string, string>;
16
33
  }
17
34
  export interface CreateRedirectSessionRequest extends CreateRedirectSessionRequestIntentOneOf {
18
35
  /** Information required for generating a custom URL for a Wix Bookings checkout. */
@@ -424,10 +441,80 @@ export interface SignInURLResponse {
424
441
  /** The Wix URL details to redirect into */
425
442
  redirectSession?: RedirectSession;
426
443
  }
444
+ export interface DomainEvent extends DomainEventBodyOneOf {
445
+ createdEvent?: EntityCreatedEvent;
446
+ updatedEvent?: EntityUpdatedEvent;
447
+ deletedEvent?: EntityDeletedEvent;
448
+ actionEvent?: ActionEvent;
449
+ /**
450
+ * Unique event ID.
451
+ * Allows clients to ignore duplicate webhooks.
452
+ */
453
+ _id?: string;
454
+ /**
455
+ * Assumes actions are also always typed to an entity_type
456
+ * Example: wix.stores.catalog.product, wix.bookings.session, wix.payments.transaction
457
+ */
458
+ entityFqdn?: string;
459
+ /**
460
+ * This is top level to ease client code dispatching of messages (switch on entity_fqdn+slug)
461
+ * This is although the created/updated/deleted notion is duplication of the oneof types
462
+ * Example: created/updated/deleted/started/completed/email_opened
463
+ */
464
+ slug?: string;
465
+ /** ID of the entity associated with the event. */
466
+ entityId?: string;
467
+ /** Event timestamp. */
468
+ eventTime?: Date;
469
+ /**
470
+ * Whether the event was triggered as a result of a privacy regulation application
471
+ * (for example, GDPR).
472
+ */
473
+ triggeredByAnonymizeRequest?: boolean | null;
474
+ /** If present, indicates the action that triggered the event. */
475
+ originatedFrom?: string | null;
476
+ /**
477
+ * A sequence number defining the order of updates to the underlying entity.
478
+ * For example, given that some entity was updated at 16:00 and than again at 16:01,
479
+ * it is guaranteed that the sequence number of the second update is strictly higher than the first.
480
+ * As the consumer, you can use this value to ensure that you handle messages in the correct order.
481
+ * To do so, you will need to persist this number on your end, and compare the sequence number from the
482
+ * message against the one you have stored. Given that the stored number is higher, you should ignore the message.
483
+ */
484
+ entityEventSequence?: string | null;
485
+ }
486
+ /** @oneof */
487
+ export interface DomainEventBodyOneOf {
488
+ createdEvent?: EntityCreatedEvent;
489
+ updatedEvent?: EntityUpdatedEvent;
490
+ deletedEvent?: EntityDeletedEvent;
491
+ actionEvent?: ActionEvent;
492
+ }
493
+ export interface EntityCreatedEvent {
494
+ entityAsJson?: string;
495
+ }
496
+ export interface EntityUpdatedEvent {
497
+ /**
498
+ * Since platformized APIs only expose PATCH and not PUT we can't assume that the fields sent from the client are the actual diff.
499
+ * This means that to generate a list of changed fields (as opposed to sent fields) one needs to traverse both objects.
500
+ * We don't want to impose this on all developers and so we leave this traversal to the notification recipients which need it.
501
+ */
502
+ currentEntityAsJson?: string;
503
+ }
504
+ export interface EntityDeletedEvent {
505
+ /** Entity that was deleted */
506
+ deletedEntityAsJson?: string | null;
507
+ }
508
+ export interface ActionEvent {
509
+ bodyAsJson?: string;
510
+ }
427
511
  export interface CreateRedirectSessionResponseNonNullableFields {
428
512
  redirectSession?: {
429
513
  _id: string;
430
514
  fullUrl: string;
515
+ urlDetails?: {
516
+ endpoint: string;
517
+ };
431
518
  };
432
519
  }
433
520
  /**
@@ -7,7 +7,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
- import { serializer, transformError } from '@wix/metro-runtime/velo';
10
+ import { serializer } from '@wix/metro-runtime/velo';
11
+ import { transformError as sdkTransformError } from '@wix/sdk-runtime/transform-error';
11
12
  import * as ambassadorWixHeadlessV1RedirectSession from './headless-v1-redirect-session.http';
12
13
  let __verbose = false;
13
14
  function __log(...args) {
@@ -128,9 +129,21 @@ export function createRedirectSession(options) {
128
129
  return fromJSON(result.data);
129
130
  }
130
131
  catch (err) {
131
- const transformedError = transformError(err, requestTransformation, [
132
- 'options',
133
- ]);
132
+ const transformedError = sdkTransformError(err, {
133
+ spreadPathsToArguments: {},
134
+ explicitPathsToArguments: {
135
+ bookingsCheckout: '$[0].bookingsCheckout',
136
+ ecomCheckout: '$[0].ecomCheckout',
137
+ eventsCheckout: '$[0].eventsCheckout',
138
+ paidPlansCheckout: '$[0].paidPlansCheckout',
139
+ login: '$[0].login',
140
+ logout: '$[0].logout',
141
+ auth: '$[0].auth',
142
+ callbacks: '$[0].callbacks',
143
+ preferences: '$[0].preferences',
144
+ },
145
+ singleArgumentUnchanged: false,
146
+ }, ['options']);
134
147
  (_c = sideEffects === null || sideEffects === void 0 ? void 0 : sideEffects.onError) === null || _c === void 0 ? void 0 : _c.call(sideEffects, err);
135
148
  throw transformedError;
136
149
  }
@@ -1 +1 @@
1
- {"version":3,"file":"headless-v1-redirect-session.universal.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAErE,OAAO,KAAK,sCAAsC,MAAM,qCAAqC,CAAC;AAE9F,IAAI,SAAS,GAAG,KAAK,CAAC;AAEtB,SAAS,KAAK,CAAC,GAAG,IAAW;IAC3B,SAAS,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;AACpC,CAAC;AAED,SAAS,SAAS,CAAC,GAAQ;IACzB,OAAO,GAAG,CAAC;AACb,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,cAAc,EAAE;QACd,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,IAAI,CAAC;QAC5B,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,SAAS,GAAG,KAAK,CAAC;KAC/B;CACF,CAAC;AACF,MAAM,aAAa,GAAG,GAAG,CAAC;AAC1B,MAAM,eAAe,GAAG,GAAG,CAAC;AA8K5B,MAAM,CAAN,IAAY,YAKX;AALD,WAAY,YAAY;IACtB,uCAAuB,CAAA;IACvB,iDAAiC,CAAA;IACjC,6CAA6B,CAAA;IAC7B,iCAAiB,CAAA;AACnB,CAAC,EALW,YAAY,KAAZ,YAAY,QAKvB;AA2HD,uDAAuD;AACvD,MAAM,CAAN,IAAY,MAKX;AALD,WAAY,MAAM;IAChB,yBAAe,CAAA;IACf,uBAAa,CAAA;IACb,6BAAmB,CAAA;IACnB,2CAAiC,CAAA;AACnC,CAAC,EALW,MAAM,KAAN,MAAM,QAKjB;AAWD,MAAM,CAAN,IAAY,qBAWX;AAXD,WAAY,qBAAqB;IAC/B,qDAAqD;IACrD,sDAA6B,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AQ,EAAE,GAAG,UAAU,CAAC;YAC9B,UAAU,EAAE,8BAA8B;YAC1C,UAAU,EAAE,EAAE;YACd,kBAAkB,EAAE;gBAClB,KAAK,EAAE,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;gBAC/B,cAAc,EAAE,aAAa;aAC9B;YACD,oBAAoB,EAAE,sBAAsB;SAC7C,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,mBAAmB,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAE/C,MAAM,OAAO,GACX,sCAAsC,CAAC,qBAAqB,CAAC,OAAO,CAAC,CAAC;QAExE,KAAK,CAAC,iDAAiD,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QAE7E,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,UAAU,+CAAvB,WAAW,CAAgB,CAAC;QAC5B,IAAI;YACF,MAAM,MAAM,GAAG,MAAM,UAAU,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;YACjD,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,SAAS,+CAAtB,WAAW,EAAc,MAAM,CAAC,CAAC;YAEjC,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAQ,CAAC;SACrC;QAAC,OAAO,GAAQ,EAAE;YACjB,MAAM,gBAAgB,GAAG,cAAc,CAAC,GAAG,EAAE,qBAAqB,EAAE;gBAClE,SAAS;aACV,CAAC,CAAC;YACH,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,+CAApB,WAAW,EAAY,GAAG,CAAC,CAAC;YAE5B,MAAM,gBAAgB,CAAC;SACxB;;CACF"}
1
+ {"version":3,"file":"headless-v1-redirect-session.universal.js","sourceRoot":"","sources":["../../../src/headless-v1-redirect-session.universal.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,cAAc,IAAI,iBAAiB,EAAE,MAAM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": "https://registry.npmjs.org/",
6
6
  "access": "public"
@@ -16,9 +16,13 @@
16
16
  ],
17
17
  "dependencies": {
18
18
  "@wix/metro-runtime": "^1.1528.0",
19
- "@wix/sdk-types": "^1.3.0",
19
+ "@wix/sdk-types": "^1.5.3",
20
+ "@wix/sdk-runtime": "^0.2.7",
20
21
  "@wix/motion-edm-autogen-query-wrapper": "^1.0.37"
21
22
  },
23
+ "devDependencies": {
24
+ "typescript": "^5.3.2"
25
+ },
22
26
  "scripts": {
23
27
  "build": "tsc -b tsconfig.json tsconfig.esm.json",
24
28
  "test": ":"
@@ -29,5 +33,5 @@
29
33
  "groupId": "com.wixpress.public-sdk-autogen"
30
34
  }
31
35
  },
32
- "falconPackageHash": "7f8abbaa7df652b939ea0b4204b666fa86f3776b9f12e3cee65fdd4e"
36
+ "falconPackageHash": "a265233e89b94f520830a9413cc1485adc6dcd0d0b3c417d8a8beb1e"
33
37
  }