@wix/auto_sdk_online-programs_participants 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  import { HttpClient, NonNullablePaths, EventDefinition, MaybeContext, BuildRESTFunction, BuildEventDefinition } from '@wix/sdk-types';
2
- import { Participant, BulkCreateParticipantOptions, BulkCreateParticipantResponse, BulkAddAllToProgramOptions, BulkAddAllToProgramResponse, IssueCertificateResponse, GetCompletionStatsResponse, GetPremiumStatsResponse, ParticipantsQueryBuilder, GetAccessStatusResponse, BulkInviteToProgramOptions, BulkInviteToProgramResponse, BulkInviteAllToProgramOptions, BulkInviteAllToProgramResponse, BulkAddToProgramOptions, BulkAddToProgramResponse, BulkApproveParticipantOptions, BulkApproveParticipantResponse, BulkApproveAllParticipantOptions, BulkApproveAllParticipantResponse, ParticipantAddedEnvelope, ParticipantApprovedEnvelope, ParticipantInvitedEnvelope } from './index.typings.mjs';
3
- export { ActionEvent, ApplicationError, BaseEventMetadata, Behavior, BehaviorBehaviorOneOf, Benefit, BenefitNotification, BenefitType, BenefitTypeWithLiterals, BulkActionMetadata, BulkAddAllToProgramRequest, BulkAddToProgramRequest, BulkAddToProgramResult, BulkApproveAllParticipantRequest, BulkApproveParticipantRequest, BulkApproveParticipantResult, BulkCreateParticipantRequest, BulkInviteAllToProgramRequest, BulkInviteToProgramRequest, BulkInviteToProgramResult, BulkParticipantResult, Certificate, CommonBulkActionMetadata, CommonItemMetadata, CreateParticipantRequest, CreateParticipantResponse, CursorPaging, CursorPagingMetadata, CursorQuery, CursorQueryPagingMethodOneOf, Cursors, DeleteParticipantRequest, DeleteParticipantResponse, Discount, DiscountDiscountOneOf, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EntryPass, Event, EventMetadata, EventWithLiterals, ExportParticipantsStatsRequest, ExportParticipantsStatsResponse, ExtendedFields, GetAccessStatusRequest, GetCompletionStatsRequest, GetParticipantRequest, GetParticipantResponse, GetPremiumStatsRequest, IdentificationData, IdentificationDataIdOneOf, IssueCertificateRequest, ItemMetadata, JoinPath, JoinPathWithLiterals, JoinedInfo, Member, MessageEnvelope, ParticipantAdded, ParticipantApproved, ParticipantExportsFinished, ParticipantInvited, ParticipantsQueryResult, PaymentInfo, Progress, QueryParticipantsRequest, QueryParticipantsResponse, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, State, StateWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.mjs';
2
+ import { Participant, BulkCreateParticipantOptions, BulkCreateParticipantResponse, BulkAddAllToProgramOptions, BulkAddAllToProgramResponse, IssueCertificateResponse, GetCompletionStatsResponse, GetPremiumStatsResponse, GetAccessStatusResponse, BulkInviteToProgramOptions, BulkInviteToProgramResponse, BulkInviteAllToProgramOptions, BulkInviteAllToProgramResponse, BulkAddToProgramOptions, BulkAddToProgramResponse, BulkApproveParticipantOptions, BulkApproveParticipantResponse, BulkApproveAllParticipantOptions, BulkApproveAllParticipantResponse, ParticipantAddedEnvelope, ParticipantApprovedEnvelope, ParticipantInvitedEnvelope, ParticipantsQueryBuilder, CursorQuery, typedQueryParticipants } from './index.typings.mjs';
3
+ export { ActionEvent, ApplicationError, BaseEventMetadata, Behavior, BehaviorBehaviorOneOf, Benefit, BenefitNotification, BenefitType, BenefitTypeWithLiterals, BulkActionMetadata, BulkAddAllToProgramRequest, BulkAddToProgramRequest, BulkAddToProgramResult, BulkApproveAllParticipantRequest, BulkApproveParticipantRequest, BulkApproveParticipantResult, BulkCreateParticipantRequest, BulkInviteAllToProgramRequest, BulkInviteToProgramRequest, BulkInviteToProgramResult, BulkParticipantResult, Certificate, CommonBulkActionMetadata, CommonItemMetadata, CreateParticipantRequest, CreateParticipantResponse, CursorPaging, CursorPagingMetadata, CursorQueryPagingMethodOneOf, Cursors, DeleteParticipantRequest, DeleteParticipantResponse, Discount, DiscountDiscountOneOf, DomainEvent, DomainEventBodyOneOf, Empty, EntityCreatedEvent, EntityDeletedEvent, EntityUpdatedEvent, EntryPass, Event, EventMetadata, EventWithLiterals, ExportParticipantsStatsRequest, ExportParticipantsStatsResponse, ExtendedFields, GetAccessStatusRequest, GetCompletionStatsRequest, GetParticipantRequest, GetParticipantResponse, GetPremiumStatsRequest, IdentificationData, IdentificationDataIdOneOf, IssueCertificateRequest, ItemMetadata, JoinPath, JoinPathWithLiterals, JoinedInfo, Member, MessageEnvelope, ParticipantAdded, ParticipantApproved, ParticipantExportsFinished, ParticipantInvited, ParticipantsQueryResult, PaymentInfo, Progress, QueryParticipantsRequest, QueryParticipantsResponse, RestoreInfo, SortOrder, SortOrderWithLiterals, Sorting, State, StateWithLiterals, WebhookIdentityType, WebhookIdentityTypeWithLiterals } from './index.typings.mjs';
4
4
 
5
5
  declare function createParticipant$1(httpClient: HttpClient): CreateParticipantSignature;
6
6
  interface CreateParticipantSignature {
@@ -69,13 +69,6 @@ interface GetParticipantSignature {
69
69
  */
70
70
  (participantId: string): Promise<NonNullablePaths<Participant, `memberId` | `programId` | `progress.totalStepsCompleted` | `progress.totalStepsAvailable` | `progress.completionPercentage` | `state` | `joinedInfo.timeZone` | `joinedInfo.startDate` | `joinedInfo.joinPath` | `member.contactId`, 3>>;
71
71
  }
72
- declare function queryParticipants$1(httpClient: HttpClient): QueryParticipantsSignature;
73
- interface QueryParticipantsSignature {
74
- /**
75
- * Query existing participants
76
- */
77
- (): ParticipantsQueryBuilder;
78
- }
79
72
  declare function getAccessStatus$1(httpClient: HttpClient): GetAccessStatusSignature;
80
73
  interface GetAccessStatusSignature {
81
74
  /**
@@ -133,6 +126,10 @@ declare const onParticipantAdded$1: EventDefinition<ParticipantAddedEnvelope, "w
133
126
  declare const onParticipantApproved$1: EventDefinition<ParticipantApprovedEnvelope, "wix.online_programs.v3.participant_participant_approved">;
134
127
  declare const onParticipantInvited$1: EventDefinition<ParticipantInvitedEnvelope, "wix.online_programs.v3.participant_participant_invited">;
135
128
 
129
+ declare function customQueryParticipants(httpClient: HttpClient): {
130
+ (): ParticipantsQueryBuilder;
131
+ (query: CursorQuery): ReturnType<typeof typedQueryParticipants>;
132
+ };
136
133
  declare const createParticipant: MaybeContext<BuildRESTFunction<typeof createParticipant$1> & typeof createParticipant$1>;
137
134
  declare const bulkCreateParticipant: MaybeContext<BuildRESTFunction<typeof bulkCreateParticipant$1> & typeof bulkCreateParticipant$1>;
138
135
  declare const bulkAddAllToProgram: MaybeContext<BuildRESTFunction<typeof bulkAddAllToProgram$1> & typeof bulkAddAllToProgram$1>;
@@ -141,13 +138,13 @@ declare const issueCertificate: MaybeContext<BuildRESTFunction<typeof issueCerti
141
138
  declare const getCompletionStats: MaybeContext<BuildRESTFunction<typeof getCompletionStats$1> & typeof getCompletionStats$1>;
142
139
  declare const getPremiumStats: MaybeContext<BuildRESTFunction<typeof getPremiumStats$1> & typeof getPremiumStats$1>;
143
140
  declare const getParticipant: MaybeContext<BuildRESTFunction<typeof getParticipant$1> & typeof getParticipant$1>;
144
- declare const queryParticipants: MaybeContext<BuildRESTFunction<typeof queryParticipants$1> & typeof queryParticipants$1>;
145
141
  declare const getAccessStatus: MaybeContext<BuildRESTFunction<typeof getAccessStatus$1> & typeof getAccessStatus$1>;
146
142
  declare const bulkInviteToProgram: MaybeContext<BuildRESTFunction<typeof bulkInviteToProgram$1> & typeof bulkInviteToProgram$1>;
147
143
  declare const bulkInviteAllToProgram: MaybeContext<BuildRESTFunction<typeof bulkInviteAllToProgram$1> & typeof bulkInviteAllToProgram$1>;
148
144
  declare const bulkAddToProgram: MaybeContext<BuildRESTFunction<typeof bulkAddToProgram$1> & typeof bulkAddToProgram$1>;
149
145
  declare const bulkApproveParticipant: MaybeContext<BuildRESTFunction<typeof bulkApproveParticipant$1> & typeof bulkApproveParticipant$1>;
150
146
  declare const bulkApproveAllParticipant: MaybeContext<BuildRESTFunction<typeof bulkApproveAllParticipant$1> & typeof bulkApproveAllParticipant$1>;
147
+ declare const queryParticipants: MaybeContext<BuildRESTFunction<typeof customQueryParticipants> & typeof customQueryParticipants>;
151
148
  /** */
152
149
  declare const onParticipantAdded: BuildEventDefinition<typeof onParticipantAdded$1> & typeof onParticipantAdded$1;
153
150
  /** */
@@ -155,4 +152,4 @@ declare const onParticipantApproved: BuildEventDefinition<typeof onParticipantAp
155
152
  /** */
156
153
  declare const onParticipantInvited: BuildEventDefinition<typeof onParticipantInvited$1> & typeof onParticipantInvited$1;
157
154
 
158
- export { BulkAddAllToProgramOptions, BulkAddAllToProgramResponse, BulkAddToProgramOptions, BulkAddToProgramResponse, BulkApproveAllParticipantOptions, BulkApproveAllParticipantResponse, BulkApproveParticipantOptions, BulkApproveParticipantResponse, BulkCreateParticipantOptions, BulkCreateParticipantResponse, BulkInviteAllToProgramOptions, BulkInviteAllToProgramResponse, BulkInviteToProgramOptions, BulkInviteToProgramResponse, GetAccessStatusResponse, GetCompletionStatsResponse, GetPremiumStatsResponse, IssueCertificateResponse, Participant, ParticipantAddedEnvelope, ParticipantApprovedEnvelope, ParticipantInvitedEnvelope, ParticipantsQueryBuilder, bulkAddAllToProgram, bulkAddToProgram, bulkApproveAllParticipant, bulkApproveParticipant, bulkCreateParticipant, bulkInviteAllToProgram, bulkInviteToProgram, createParticipant, deleteParticipant, getAccessStatus, getCompletionStats, getParticipant, getPremiumStats, issueCertificate, onParticipantAdded, onParticipantApproved, onParticipantInvited, queryParticipants };
155
+ export { BulkAddAllToProgramOptions, BulkAddAllToProgramResponse, BulkAddToProgramOptions, BulkAddToProgramResponse, BulkApproveAllParticipantOptions, BulkApproveAllParticipantResponse, BulkApproveParticipantOptions, BulkApproveParticipantResponse, BulkCreateParticipantOptions, BulkCreateParticipantResponse, BulkInviteAllToProgramOptions, BulkInviteAllToProgramResponse, BulkInviteToProgramOptions, BulkInviteToProgramResponse, CursorQuery, GetAccessStatusResponse, GetCompletionStatsResponse, GetPremiumStatsResponse, IssueCertificateResponse, Participant, ParticipantAddedEnvelope, ParticipantApprovedEnvelope, ParticipantInvitedEnvelope, ParticipantsQueryBuilder, bulkAddAllToProgram, bulkAddToProgram, bulkApproveAllParticipant, bulkApproveParticipant, bulkCreateParticipant, bulkInviteAllToProgram, bulkInviteToProgram, createParticipant, deleteParticipant, getAccessStatus, getCompletionStats, getParticipant, getPremiumStats, issueCertificate, onParticipantAdded, onParticipantApproved, onParticipantInvited, queryParticipants };
@@ -1016,6 +1016,29 @@ function queryParticipants2() {
1016
1016
  transformationPaths: {}
1017
1017
  });
1018
1018
  }
1019
+ async function typedQueryParticipants(query) {
1020
+ const { httpClient, sideEffects } = arguments[1];
1021
+ const payload = renameKeysFromSDKRequestToRESTRequest({ query });
1022
+ const reqOpts = queryParticipants(payload);
1023
+ sideEffects?.onSiteCall?.();
1024
+ try {
1025
+ const result = await httpClient.request(reqOpts);
1026
+ sideEffects?.onSuccess?.(result);
1027
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
1028
+ } catch (err) {
1029
+ const transformedError = sdkTransformError(
1030
+ err,
1031
+ {
1032
+ spreadPathsToArguments: {},
1033
+ explicitPathsToArguments: { query: "$[0]" },
1034
+ singleArgumentUnchanged: false
1035
+ },
1036
+ ["query"]
1037
+ );
1038
+ sideEffects?.onError?.(err);
1039
+ throw transformedError;
1040
+ }
1041
+ }
1019
1042
  async function getAccessStatus2() {
1020
1043
  const { httpClient, sideEffects } = arguments[0];
1021
1044
  const payload = renameKeysFromSDKRequestToRESTRequest({});
@@ -1279,6 +1302,13 @@ function queryParticipants3(httpClient) {
1279
1302
  { httpClient }
1280
1303
  );
1281
1304
  }
1305
+ function typedQueryParticipants2(httpClient) {
1306
+ return (query) => typedQueryParticipants(
1307
+ query,
1308
+ // @ts-ignore
1309
+ { httpClient }
1310
+ );
1311
+ }
1282
1312
  function getAccessStatus3(httpClient) {
1283
1313
  return () => getAccessStatus2(
1284
1314
  // @ts-ignore
@@ -1371,6 +1401,18 @@ var onParticipantInvited = EventDefinition(
1371
1401
  // src/online-programs-v3-participant-participants.context.ts
1372
1402
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1373
1403
  import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
1404
+ import { createQueryOverloadRouter } from "@wix/sdk-runtime/query-method-router";
1405
+ function customQueryParticipants(httpClient) {
1406
+ const router = createQueryOverloadRouter({
1407
+ builderQueryFunction: () => queryParticipants3(httpClient)(),
1408
+ typedQueryFunction: (query) => typedQueryParticipants2(httpClient)(query),
1409
+ hasOptionsParameter: false
1410
+ });
1411
+ function overloadedQuery(query) {
1412
+ return router(...arguments);
1413
+ }
1414
+ return overloadedQuery;
1415
+ }
1374
1416
  var createParticipant4 = /* @__PURE__ */ createRESTModule(createParticipant3);
1375
1417
  var bulkCreateParticipant4 = /* @__PURE__ */ createRESTModule(bulkCreateParticipant3);
1376
1418
  var bulkAddAllToProgram4 = /* @__PURE__ */ createRESTModule(bulkAddAllToProgram3);
@@ -1379,7 +1421,6 @@ var issueCertificate4 = /* @__PURE__ */ createRESTModule(issueCertificate3);
1379
1421
  var getCompletionStats4 = /* @__PURE__ */ createRESTModule(getCompletionStats3);
1380
1422
  var getPremiumStats4 = /* @__PURE__ */ createRESTModule(getPremiumStats3);
1381
1423
  var getParticipant4 = /* @__PURE__ */ createRESTModule(getParticipant3);
1382
- var queryParticipants4 = /* @__PURE__ */ createRESTModule(queryParticipants3);
1383
1424
  var getAccessStatus4 = /* @__PURE__ */ createRESTModule(getAccessStatus3);
1384
1425
  var bulkInviteToProgram4 = /* @__PURE__ */ createRESTModule(bulkInviteToProgram3);
1385
1426
  var bulkInviteAllToProgram4 = /* @__PURE__ */ createRESTModule(bulkInviteAllToProgram3);
@@ -1387,6 +1428,7 @@ var bulkAddToProgram4 = /* @__PURE__ */ createRESTModule(bulkAddToProgram3);
1387
1428
  var bulkApproveParticipant4 = /* @__PURE__ */ createRESTModule(bulkApproveParticipant3);
1388
1429
  var bulkApproveAllParticipant4 = /* @__PURE__ */ createRESTModule(bulkApproveAllParticipant3);
1389
1430
  var exportParticipantsStats4 = /* @__PURE__ */ createRESTModule(exportParticipantsStats3);
1431
+ var queryParticipants4 = /* @__PURE__ */ createRESTModule(customQueryParticipants);
1390
1432
  var onParticipantAdded2 = createEventModule(onParticipantAdded);
1391
1433
  var onParticipantApproved2 = createEventModule(
1392
1434
  onParticipantApproved