@wix/auto_sdk_calendar_events 1.0.30 → 1.0.31

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.
@@ -74,7 +74,120 @@ function resolveWixCalendarEventsV3EventsServiceUrl(opts) {
74
74
  };
75
75
  return resolveUrl(Object.assign(opts, { domainToMappings }));
76
76
  }
77
+ function resolveWixCalendarParticipanteventsV3ParticipantEventsServiceUrl(opts) {
78
+ const domainToMappings = {
79
+ "api._api_base_domain_": [
80
+ {
81
+ srcPath: "/participant-events-3",
82
+ destPath: ""
83
+ }
84
+ ],
85
+ "manage._base_domain_": [
86
+ {
87
+ srcPath: "/_api/calendar/v3/events/memberId",
88
+ destPath: "/v3/events/memberId"
89
+ },
90
+ {
91
+ srcPath: "/_api/calendar/v3/events/contactId",
92
+ destPath: "/v3/events/contactId"
93
+ }
94
+ ],
95
+ "www.wixapis.com": [
96
+ {
97
+ srcPath: "/calendar/v3/events/contactId",
98
+ destPath: "/v3/events/contactId"
99
+ },
100
+ {
101
+ srcPath: "/calendar/v3/events/memberId",
102
+ destPath: "/v3/events/memberId"
103
+ }
104
+ ],
105
+ _: [
106
+ {
107
+ srcPath: "/_api/calendar/v3/events/memberId",
108
+ destPath: "/v3/events/memberId"
109
+ }
110
+ ],
111
+ "*.dev.wix-code.com": [
112
+ {
113
+ srcPath: "/_api/calendar/v3/events/memberId",
114
+ destPath: "/v3/events/memberId"
115
+ },
116
+ {
117
+ srcPath: "/_api/calendar/v3/events/contactId",
118
+ destPath: "/v3/events/contactId"
119
+ }
120
+ ]
121
+ };
122
+ return resolveUrl(Object.assign(opts, { domainToMappings }));
123
+ }
77
124
  var PACKAGE_NAME = "@wix/auto_sdk_calendar_events";
125
+ function listEventsByContactId(payload) {
126
+ function __listEventsByContactId({ host }) {
127
+ const metadata = {
128
+ entityFqdn: "wix.calendar.v3.event",
129
+ method: "GET",
130
+ methodFqn: "wix.calendar.participantevents.v3.ParticipantEventsService.ListEventsByContactId",
131
+ packageName: PACKAGE_NAME,
132
+ url: resolveWixCalendarParticipanteventsV3ParticipantEventsServiceUrl({
133
+ protoPath: "/v3/events/contactId/{contactId}",
134
+ data: payload,
135
+ host
136
+ }),
137
+ params: toURLSearchParams(payload),
138
+ transformResponse: (payload2) => transformPaths(payload2, [
139
+ {
140
+ transformFn: transformRESTTimestampToSDKTimestamp,
141
+ paths: [
142
+ { path: "events.createdDate" },
143
+ { path: "events.updatedDate" },
144
+ { path: "events.start.utcDate" },
145
+ { path: "events.end.utcDate" },
146
+ { path: "events.adjustedStart.utcDate" },
147
+ { path: "events.adjustedEnd.utcDate" },
148
+ { path: "events.recurrenceRule.until.utcDate" },
149
+ { path: "events.recurrenceRule.adjustedUntil.utcDate" }
150
+ ]
151
+ }
152
+ ])
153
+ };
154
+ return metadata;
155
+ }
156
+ return __listEventsByContactId;
157
+ }
158
+ function listEventsByMemberId(payload) {
159
+ function __listEventsByMemberId({ host }) {
160
+ const metadata = {
161
+ entityFqdn: "wix.calendar.v3.event",
162
+ method: "GET",
163
+ methodFqn: "wix.calendar.participantevents.v3.ParticipantEventsService.ListEventsByMemberId",
164
+ packageName: PACKAGE_NAME,
165
+ url: resolveWixCalendarParticipanteventsV3ParticipantEventsServiceUrl({
166
+ protoPath: "/v3/events/memberId/{memberId}",
167
+ data: payload,
168
+ host
169
+ }),
170
+ params: toURLSearchParams(payload),
171
+ transformResponse: (payload2) => transformPaths(payload2, [
172
+ {
173
+ transformFn: transformRESTTimestampToSDKTimestamp,
174
+ paths: [
175
+ { path: "events.createdDate" },
176
+ { path: "events.updatedDate" },
177
+ { path: "events.start.utcDate" },
178
+ { path: "events.end.utcDate" },
179
+ { path: "events.adjustedStart.utcDate" },
180
+ { path: "events.adjustedEnd.utcDate" },
181
+ { path: "events.recurrenceRule.until.utcDate" },
182
+ { path: "events.recurrenceRule.adjustedUntil.utcDate" }
183
+ ]
184
+ }
185
+ ])
186
+ };
187
+ return metadata;
188
+ }
189
+ return __listEventsByMemberId;
190
+ }
78
191
  function getEvent(payload) {
79
192
  function __getEvent({ host }) {
80
193
  const metadata = {
@@ -618,25 +731,6 @@ var IdentityType = /* @__PURE__ */ ((IdentityType2) => {
618
731
  IdentityType2["WIX_USER"] = "WIX_USER";
619
732
  return IdentityType2;
620
733
  })(IdentityType || {});
621
- var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
622
- WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
623
- WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
624
- WebhookIdentityType2["MEMBER"] = "MEMBER";
625
- WebhookIdentityType2["WIX_USER"] = "WIX_USER";
626
- WebhookIdentityType2["APP"] = "APP";
627
- return WebhookIdentityType2;
628
- })(WebhookIdentityType || {});
629
- var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
630
- RequestedFields2["UNKNOWN_REQUESTED_FIELDS"] = "UNKNOWN_REQUESTED_FIELDS";
631
- RequestedFields2["PI_FIELDS"] = "PI_FIELDS";
632
- RequestedFields2["OWN_PI_FIELDS"] = "OWN_PI_FIELDS";
633
- return RequestedFields2;
634
- })(RequestedFields || {});
635
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
636
- SortOrder2["ASC"] = "ASC";
637
- SortOrder2["DESC"] = "DESC";
638
- return SortOrder2;
639
- })(SortOrder || {});
640
734
  var PlacementType = /* @__PURE__ */ ((PlacementType2) => {
641
735
  PlacementType2["BEFORE"] = "BEFORE";
642
736
  PlacementType2["AFTER"] = "AFTER";
@@ -659,6 +753,101 @@ var ResolutionMethod = /* @__PURE__ */ ((ResolutionMethod2) => {
659
753
  ResolutionMethod2["SUBDIRECTORY"] = "SUBDIRECTORY";
660
754
  return ResolutionMethod2;
661
755
  })(ResolutionMethod || {});
756
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
757
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
758
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
759
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
760
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
761
+ WebhookIdentityType2["APP"] = "APP";
762
+ return WebhookIdentityType2;
763
+ })(WebhookIdentityType || {});
764
+ var RequestedFields = /* @__PURE__ */ ((RequestedFields2) => {
765
+ RequestedFields2["UNKNOWN_REQUESTED_FIELDS"] = "UNKNOWN_REQUESTED_FIELDS";
766
+ RequestedFields2["PI_FIELDS"] = "PI_FIELDS";
767
+ RequestedFields2["OWN_PI_FIELDS"] = "OWN_PI_FIELDS";
768
+ return RequestedFields2;
769
+ })(RequestedFields || {});
770
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
771
+ SortOrder2["ASC"] = "ASC";
772
+ SortOrder2["DESC"] = "DESC";
773
+ return SortOrder2;
774
+ })(SortOrder || {});
775
+ async function listEventsByContactId2(contactId, options) {
776
+ const { httpClient, sideEffects } = arguments[2];
777
+ const payload = renameKeysFromSDKRequestToRESTRequest({
778
+ contactId,
779
+ fromLocalDate: options?.fromLocalDate,
780
+ toLocalDate: options?.toLocalDate,
781
+ timeZone: options?.timeZone,
782
+ appId: options?.appId,
783
+ cursorPaging: options?.cursorPaging
784
+ });
785
+ const reqOpts = listEventsByContactId(payload);
786
+ sideEffects?.onSiteCall?.();
787
+ try {
788
+ const result = await httpClient.request(reqOpts);
789
+ sideEffects?.onSuccess?.(result);
790
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
791
+ } catch (err) {
792
+ const transformedError = sdkTransformError(
793
+ err,
794
+ {
795
+ spreadPathsToArguments: {},
796
+ explicitPathsToArguments: {
797
+ contactId: "$[0]",
798
+ fromLocalDate: "$[1].fromLocalDate",
799
+ toLocalDate: "$[1].toLocalDate",
800
+ timeZone: "$[1].timeZone",
801
+ appId: "$[1].appId",
802
+ cursorPaging: "$[1].cursorPaging"
803
+ },
804
+ singleArgumentUnchanged: false
805
+ },
806
+ ["contactId", "options"]
807
+ );
808
+ sideEffects?.onError?.(err);
809
+ throw transformedError;
810
+ }
811
+ }
812
+ async function listEventsByMemberId2(memberId, options) {
813
+ const { httpClient, sideEffects } = arguments[2];
814
+ const payload = renameKeysFromSDKRequestToRESTRequest({
815
+ memberId,
816
+ fromLocalDate: options?.fromLocalDate,
817
+ toLocalDate: options?.toLocalDate,
818
+ timeZone: options?.timeZone,
819
+ appId: options?.appId,
820
+ cursorPaging: options?.cursorPaging,
821
+ eventIds: options?.eventIds
822
+ });
823
+ const reqOpts = listEventsByMemberId(payload);
824
+ sideEffects?.onSiteCall?.();
825
+ try {
826
+ const result = await httpClient.request(reqOpts);
827
+ sideEffects?.onSuccess?.(result);
828
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
829
+ } catch (err) {
830
+ const transformedError = sdkTransformError(
831
+ err,
832
+ {
833
+ spreadPathsToArguments: {},
834
+ explicitPathsToArguments: {
835
+ memberId: "$[0]",
836
+ fromLocalDate: "$[1].fromLocalDate",
837
+ toLocalDate: "$[1].toLocalDate",
838
+ timeZone: "$[1].timeZone",
839
+ appId: "$[1].appId",
840
+ cursorPaging: "$[1].cursorPaging",
841
+ eventIds: "$[1].eventIds"
842
+ },
843
+ singleArgumentUnchanged: false
844
+ },
845
+ ["memberId", "options"]
846
+ );
847
+ sideEffects?.onError?.(err);
848
+ throw transformedError;
849
+ }
850
+ }
662
851
  async function getEvent2(eventId, options) {
663
852
  const { httpClient, sideEffects } = arguments[2];
664
853
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -1025,6 +1214,22 @@ async function bulkCancelEvent2(eventIds, options) {
1025
1214
  }
1026
1215
 
1027
1216
  // src/calendar-v3-event-events.public.ts
1217
+ function listEventsByContactId3(httpClient) {
1218
+ return (contactId, options) => listEventsByContactId2(
1219
+ contactId,
1220
+ options,
1221
+ // @ts-ignore
1222
+ { httpClient }
1223
+ );
1224
+ }
1225
+ function listEventsByMemberId3(httpClient) {
1226
+ return (memberId, options) => listEventsByMemberId2(
1227
+ memberId,
1228
+ options,
1229
+ // @ts-ignore
1230
+ { httpClient }
1231
+ );
1232
+ }
1028
1233
  function getEvent3(httpClient) {
1029
1234
  return (eventId, options) => getEvent2(
1030
1235
  eventId,
@@ -1233,6 +1438,8 @@ var onEventUpdated = EventDefinition(
1233
1438
  // src/calendar-v3-event-events.context.ts
1234
1439
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1235
1440
  import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
1441
+ var listEventsByContactId4 = /* @__PURE__ */ createRESTModule(listEventsByContactId3);
1442
+ var listEventsByMemberId4 = /* @__PURE__ */ createRESTModule(listEventsByMemberId3);
1236
1443
  var getEvent4 = /* @__PURE__ */ createRESTModule(getEvent3);
1237
1444
  var listEvents4 = /* @__PURE__ */ createRESTModule(listEvents3);
1238
1445
  var queryEvents4 = /* @__PURE__ */ createRESTModule(queryEvents3);
@@ -1273,6 +1480,8 @@ export {
1273
1480
  createEvent4 as createEvent,
1274
1481
  getEvent4 as getEvent,
1275
1482
  listEvents4 as listEvents,
1483
+ listEventsByContactId4 as listEventsByContactId,
1484
+ listEventsByMemberId4 as listEventsByMemberId,
1276
1485
  onEventCancelled2 as onEventCancelled,
1277
1486
  onEventCreated2 as onEventCreated,
1278
1487
  onEventRecurringSplit2 as onEventRecurringSplit,