@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.js';
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.js';
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.js';
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.js';
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
  /**
@@ -142,6 +135,10 @@ declare const onParticipantAdded$1: EventDefinition<ParticipantAddedEnvelope, "w
142
135
  declare const onParticipantApproved$1: EventDefinition<ParticipantApprovedEnvelope, "wix.online_programs.v3.participant_participant_approved">;
143
136
  declare const onParticipantInvited$1: EventDefinition<ParticipantInvitedEnvelope, "wix.online_programs.v3.participant_participant_invited">;
144
137
 
138
+ declare function customQueryParticipants(httpClient: HttpClient): {
139
+ (): ParticipantsQueryBuilder;
140
+ (query: CursorQuery): ReturnType<typeof typedQueryParticipants>;
141
+ };
145
142
  declare const createParticipant: MaybeContext<BuildRESTFunction<typeof createParticipant$1> & typeof createParticipant$1>;
146
143
  declare const bulkCreateParticipant: MaybeContext<BuildRESTFunction<typeof bulkCreateParticipant$1> & typeof bulkCreateParticipant$1>;
147
144
  declare const bulkAddAllToProgram: MaybeContext<BuildRESTFunction<typeof bulkAddAllToProgram$1> & typeof bulkAddAllToProgram$1>;
@@ -150,7 +147,6 @@ declare const issueCertificate: MaybeContext<BuildRESTFunction<typeof issueCerti
150
147
  declare const getCompletionStats: MaybeContext<BuildRESTFunction<typeof getCompletionStats$1> & typeof getCompletionStats$1>;
151
148
  declare const getPremiumStats: MaybeContext<BuildRESTFunction<typeof getPremiumStats$1> & typeof getPremiumStats$1>;
152
149
  declare const getParticipant: MaybeContext<BuildRESTFunction<typeof getParticipant$1> & typeof getParticipant$1>;
153
- declare const queryParticipants: MaybeContext<BuildRESTFunction<typeof queryParticipants$1> & typeof queryParticipants$1>;
154
150
  declare const getAccessStatus: MaybeContext<BuildRESTFunction<typeof getAccessStatus$1> & typeof getAccessStatus$1>;
155
151
  declare const bulkInviteToProgram: MaybeContext<BuildRESTFunction<typeof bulkInviteToProgram$1> & typeof bulkInviteToProgram$1>;
156
152
  declare const bulkInviteAllToProgram: MaybeContext<BuildRESTFunction<typeof bulkInviteAllToProgram$1> & typeof bulkInviteAllToProgram$1>;
@@ -159,6 +155,7 @@ declare const bulkApproveParticipant: MaybeContext<BuildRESTFunction<typeof bulk
159
155
  declare const bulkApproveAllParticipant: MaybeContext<BuildRESTFunction<typeof bulkApproveAllParticipant$1> & typeof bulkApproveAllParticipant$1>;
160
156
  /** @internal */
161
157
  declare const exportParticipantsStats: MaybeContext<BuildRESTFunction<typeof exportParticipantsStats$1> & typeof exportParticipantsStats$1>;
158
+ declare const queryParticipants: MaybeContext<BuildRESTFunction<typeof customQueryParticipants> & typeof customQueryParticipants>;
162
159
  /** */
163
160
  declare const onParticipantAdded: BuildEventDefinition<typeof onParticipantAdded$1> & typeof onParticipantAdded$1;
164
161
  /** */
@@ -166,4 +163,4 @@ declare const onParticipantApproved: BuildEventDefinition<typeof onParticipantAp
166
163
  /** */
167
164
  declare const onParticipantInvited: BuildEventDefinition<typeof onParticipantInvited$1> & typeof onParticipantInvited$1;
168
165
 
169
- 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, exportParticipantsStats, getAccessStatus, getCompletionStats, getParticipant, getPremiumStats, issueCertificate, onParticipantAdded, onParticipantApproved, onParticipantInvited, queryParticipants };
166
+ 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, exportParticipantsStats, getAccessStatus, getCompletionStats, getParticipant, getPremiumStats, issueCertificate, onParticipantAdded, onParticipantApproved, onParticipantInvited, queryParticipants };
@@ -1063,6 +1063,29 @@ function queryParticipants2() {
1063
1063
  transformationPaths: {}
1064
1064
  });
1065
1065
  }
1066
+ async function typedQueryParticipants(query) {
1067
+ const { httpClient, sideEffects } = arguments[1];
1068
+ const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
1069
+ const reqOpts = queryParticipants(payload);
1070
+ sideEffects?.onSiteCall?.();
1071
+ try {
1072
+ const result = await httpClient.request(reqOpts);
1073
+ sideEffects?.onSuccess?.(result);
1074
+ return (0, import_rename_all_nested_keys.renameKeysFromRESTResponseToSDKResponse)(result.data);
1075
+ } catch (err) {
1076
+ const transformedError = (0, import_transform_error.transformError)(
1077
+ err,
1078
+ {
1079
+ spreadPathsToArguments: {},
1080
+ explicitPathsToArguments: { query: "$[0]" },
1081
+ singleArgumentUnchanged: false
1082
+ },
1083
+ ["query"]
1084
+ );
1085
+ sideEffects?.onError?.(err);
1086
+ throw transformedError;
1087
+ }
1088
+ }
1066
1089
  async function getAccessStatus2() {
1067
1090
  const { httpClient, sideEffects } = arguments[0];
1068
1091
  const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({});
@@ -1326,6 +1349,13 @@ function queryParticipants3(httpClient) {
1326
1349
  { httpClient }
1327
1350
  );
1328
1351
  }
1352
+ function typedQueryParticipants2(httpClient) {
1353
+ return (query) => typedQueryParticipants(
1354
+ query,
1355
+ // @ts-ignore
1356
+ { httpClient }
1357
+ );
1358
+ }
1329
1359
  function getAccessStatus3(httpClient) {
1330
1360
  return () => getAccessStatus2(
1331
1361
  // @ts-ignore
@@ -1418,6 +1448,18 @@ var onParticipantInvited = (0, import_sdk_types.EventDefinition)(
1418
1448
  // src/online-programs-v3-participant-participants.context.ts
1419
1449
  var import_rest_modules3 = require("@wix/sdk-runtime/rest-modules");
1420
1450
  var import_event_definition_modules = require("@wix/sdk-runtime/event-definition-modules");
1451
+ var import_query_method_router = require("@wix/sdk-runtime/query-method-router");
1452
+ function customQueryParticipants(httpClient) {
1453
+ const router = (0, import_query_method_router.createQueryOverloadRouter)({
1454
+ builderQueryFunction: () => queryParticipants3(httpClient)(),
1455
+ typedQueryFunction: (query) => typedQueryParticipants2(httpClient)(query),
1456
+ hasOptionsParameter: false
1457
+ });
1458
+ function overloadedQuery(query) {
1459
+ return router(...arguments);
1460
+ }
1461
+ return overloadedQuery;
1462
+ }
1421
1463
  var createParticipant4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(createParticipant3);
1422
1464
  var bulkCreateParticipant4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkCreateParticipant3);
1423
1465
  var bulkAddAllToProgram4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkAddAllToProgram3);
@@ -1426,7 +1468,6 @@ var issueCertificate4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModul
1426
1468
  var getCompletionStats4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getCompletionStats3);
1427
1469
  var getPremiumStats4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getPremiumStats3);
1428
1470
  var getParticipant4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getParticipant3);
1429
- var queryParticipants4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(queryParticipants3);
1430
1471
  var getAccessStatus4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(getAccessStatus3);
1431
1472
  var bulkInviteToProgram4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkInviteToProgram3);
1432
1473
  var bulkInviteAllToProgram4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkInviteAllToProgram3);
@@ -1434,6 +1475,7 @@ var bulkAddToProgram4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModul
1434
1475
  var bulkApproveParticipant4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkApproveParticipant3);
1435
1476
  var bulkApproveAllParticipant4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(bulkApproveAllParticipant3);
1436
1477
  var exportParticipantsStats4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(exportParticipantsStats3);
1478
+ var queryParticipants4 = /* @__PURE__ */ (0, import_rest_modules3.createRESTModule)(customQueryParticipants);
1437
1479
  var onParticipantAdded2 = (0, import_event_definition_modules.createEventModule)(onParticipantAdded);
1438
1480
  var onParticipantApproved2 = (0, import_event_definition_modules.createEventModule)(
1439
1481
  onParticipantApproved