@wix/auto_sdk_online-programs_participants 1.0.3 → 1.0.5

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 (37) hide show
  1. package/build/cjs/index.d.ts +70 -99
  2. package/build/cjs/index.js +447 -705
  3. package/build/cjs/index.js.map +1 -1
  4. package/build/cjs/index.typings.d.ts +291 -911
  5. package/build/cjs/index.typings.js +358 -514
  6. package/build/cjs/index.typings.js.map +1 -1
  7. package/build/cjs/meta.d.ts +213 -752
  8. package/build/cjs/meta.js +277 -418
  9. package/build/cjs/meta.js.map +1 -1
  10. package/build/es/index.d.mts +70 -99
  11. package/build/es/index.mjs +440 -682
  12. package/build/es/index.mjs.map +1 -1
  13. package/build/es/index.typings.d.mts +291 -911
  14. package/build/es/index.typings.mjs +379 -523
  15. package/build/es/index.typings.mjs.map +1 -1
  16. package/build/es/meta.d.mts +213 -752
  17. package/build/es/meta.mjs +261 -390
  18. package/build/es/meta.mjs.map +1 -1
  19. package/build/internal/cjs/index.d.ts +70 -99
  20. package/build/internal/cjs/index.js +447 -705
  21. package/build/internal/cjs/index.js.map +1 -1
  22. package/build/internal/cjs/index.typings.d.ts +291 -911
  23. package/build/internal/cjs/index.typings.js +358 -514
  24. package/build/internal/cjs/index.typings.js.map +1 -1
  25. package/build/internal/cjs/meta.d.ts +213 -752
  26. package/build/internal/cjs/meta.js +277 -418
  27. package/build/internal/cjs/meta.js.map +1 -1
  28. package/build/internal/es/index.d.mts +70 -99
  29. package/build/internal/es/index.mjs +440 -682
  30. package/build/internal/es/index.mjs.map +1 -1
  31. package/build/internal/es/index.typings.d.mts +291 -911
  32. package/build/internal/es/index.typings.mjs +379 -523
  33. package/build/internal/es/index.typings.mjs.map +1 -1
  34. package/build/internal/es/meta.d.mts +213 -752
  35. package/build/internal/es/meta.mjs +261 -390
  36. package/build/internal/es/meta.mjs.map +1 -1
  37. package/package.json +2 -2
@@ -1,6 +1,5 @@
1
1
  // src/online-programs-v3-participant-participants.public.ts
2
2
  import { renameKeysFromRESTResponseToSDKResponse as renameKeysFromRESTResponseToSDKResponse2 } from "@wix/sdk-runtime/rename-all-nested-keys";
3
- import { transformRESTFloatToSDKFloat as transformRESTFloatToSDKFloat2 } from "@wix/sdk-runtime/transformations/float";
4
3
  import { transformRESTTimestampToSDKTimestamp as transformRESTTimestampToSDKTimestamp2 } from "@wix/sdk-runtime/transformations/timestamp";
5
4
  import { transformPaths as transformPaths3 } from "@wix/sdk-runtime/transformations/transform-paths";
6
5
  import { EventDefinition } from "@wix/sdk-types";
@@ -15,7 +14,9 @@ import {
15
14
 
16
15
  // src/online-programs-v3-participant-participants.http.ts
17
16
  import { toURLSearchParams } from "@wix/sdk-runtime/rest-modules";
17
+ import { transformSDKFloatToRESTFloat } from "@wix/sdk-runtime/transformations/float";
18
18
  import { transformRESTFloatToSDKFloat } from "@wix/sdk-runtime/transformations/float";
19
+ import { transformSDKTimestampToRESTTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
19
20
  import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
20
21
  import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
21
22
  import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
@@ -215,29 +216,47 @@ function resolveWixOnlineprogramsParticipantsV3ParticipantsServiceUrl(opts) {
215
216
  return resolveUrl(Object.assign(opts, { domainToMappings }));
216
217
  }
217
218
  var PACKAGE_NAME = "@wix/auto_sdk_online-programs_participants";
218
- function joinProgram(payload) {
219
- function __joinProgram({ host }) {
219
+ function createParticipant(payload) {
220
+ function __createParticipant({ host }) {
221
+ const serializedData = transformPaths(payload, [
222
+ {
223
+ transformFn: transformSDKTimestampToRESTTimestamp,
224
+ paths: [
225
+ { path: "participant.createdDate" },
226
+ { path: "participant.updatedDate" },
227
+ { path: "participant.lastActivityDate" },
228
+ { path: "participant.certificate.issuedDate" },
229
+ { path: "participant.joinedInfo.joinedAt" }
230
+ ]
231
+ },
232
+ {
233
+ transformFn: transformSDKFloatToRESTFloat,
234
+ paths: [{ path: "participant.progress.completionPercentage" }]
235
+ }
236
+ ]);
220
237
  const metadata = {
221
238
  entityFqdn: "wix.online_programs.v3.participant",
222
239
  method: "POST",
223
- methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.JoinProgram",
240
+ methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.CreateParticipant",
224
241
  packageName: PACKAGE_NAME,
225
242
  migrationOptions: {
226
243
  optInTransformResponse: true
227
244
  },
228
245
  url: resolveWixOnlineprogramsParticipantsV3ParticipantsServiceUrl({
229
- protoPath: "/v3/participants/join",
230
- data: payload,
246
+ protoPath: "/v3/participants",
247
+ data: serializedData,
231
248
  host
232
249
  }),
233
- data: payload,
250
+ data: serializedData,
234
251
  transformResponse: (payload2) => transformPaths(payload2, [
235
252
  {
236
253
  transformFn: transformRESTTimestampToSDKTimestamp,
237
254
  paths: [
238
255
  { path: "participant.createdDate" },
239
256
  { path: "participant.updatedDate" },
240
- { path: "participant.certificate.issuedDate" }
257
+ { path: "participant.lastActivityDate" },
258
+ { path: "participant.certificate.issuedDate" },
259
+ { path: "participant.joinedInfo.joinedAt" }
241
260
  ]
242
261
  },
243
262
  {
@@ -248,55 +267,73 @@ function joinProgram(payload) {
248
267
  };
249
268
  return metadata;
250
269
  }
251
- return __joinProgram;
270
+ return __createParticipant;
252
271
  }
253
- function getParticipant(payload) {
254
- function __getParticipant({ host }) {
272
+ function bulkCreateParticipant(payload) {
273
+ function __bulkCreateParticipant({ host }) {
274
+ const serializedData = transformPaths(payload, [
275
+ {
276
+ transformFn: transformSDKTimestampToRESTTimestamp,
277
+ paths: [
278
+ { path: "participants.createdDate" },
279
+ { path: "participants.updatedDate" },
280
+ { path: "participants.lastActivityDate" },
281
+ { path: "participants.certificate.issuedDate" },
282
+ { path: "participants.joinedInfo.joinedAt" }
283
+ ]
284
+ },
285
+ {
286
+ transformFn: transformSDKFloatToRESTFloat,
287
+ paths: [{ path: "participants.progress.completionPercentage" }]
288
+ }
289
+ ]);
255
290
  const metadata = {
256
291
  entityFqdn: "wix.online_programs.v3.participant",
257
- method: "GET",
258
- methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.GetParticipant",
292
+ method: "POST",
293
+ methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.BulkCreateParticipant",
259
294
  packageName: PACKAGE_NAME,
260
295
  migrationOptions: {
261
296
  optInTransformResponse: true
262
297
  },
263
298
  url: resolveWixOnlineprogramsParticipantsV3ParticipantsServiceUrl({
264
- protoPath: "/v3/participants/{participantId}",
265
- data: payload,
299
+ protoPath: "/v3/bulk/participants/create",
300
+ data: serializedData,
266
301
  host
267
302
  }),
268
- params: toURLSearchParams(payload),
303
+ data: serializedData,
269
304
  transformResponse: (payload2) => transformPaths(payload2, [
270
305
  {
271
306
  transformFn: transformRESTTimestampToSDKTimestamp,
272
307
  paths: [
273
- { path: "participant.createdDate" },
274
- { path: "participant.updatedDate" },
275
- { path: "participant.certificate.issuedDate" }
308
+ { path: "results.item.createdDate" },
309
+ { path: "results.item.updatedDate" },
310
+ { path: "results.item.lastActivityDate" },
311
+ { path: "results.item.certificate.issuedDate" },
312
+ { path: "results.item.joinedInfo.joinedAt" }
276
313
  ]
277
314
  },
278
315
  {
279
316
  transformFn: transformRESTFloatToSDKFloat,
280
- paths: [{ path: "participant.progress.completionPercentage" }]
317
+ paths: [{ path: "results.item.progress.completionPercentage" }]
281
318
  }
282
319
  ])
283
320
  };
284
321
  return metadata;
285
322
  }
286
- return __getParticipant;
323
+ return __bulkCreateParticipant;
287
324
  }
288
- function leaveProgram(payload) {
289
- function __leaveProgram({ host }) {
325
+ function bulkAddAllToProgram(payload) {
326
+ function __bulkAddAllToProgram({ host }) {
290
327
  const metadata = {
291
328
  entityFqdn: "wix.online_programs.v3.participant",
292
329
  method: "POST",
293
- methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.LeaveProgram",
330
+ methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.BulkAddAllToProgram",
294
331
  packageName: PACKAGE_NAME,
295
332
  migrationOptions: {
296
333
  optInTransformResponse: true
297
334
  },
298
335
  url: resolveWixOnlineprogramsParticipantsV3ParticipantsServiceUrl({
299
- protoPath: "/v3/participants/{participantId}/leave",
336
+ protoPath: "/v3/bulk/participants/add-all",
300
337
  data: payload,
301
338
  host
302
339
  }),
@@ -304,20 +341,41 @@ function leaveProgram(payload) {
304
341
  };
305
342
  return metadata;
306
343
  }
307
- return __leaveProgram;
344
+ return __bulkAddAllToProgram;
308
345
  }
309
- function queryParticipants(payload) {
310
- function __queryParticipants({ host }) {
346
+ function deleteParticipant(payload) {
347
+ function __deleteParticipant({ host }) {
348
+ const metadata = {
349
+ entityFqdn: "wix.online_programs.v3.participant",
350
+ method: "DELETE",
351
+ methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.DeleteParticipant",
352
+ packageName: PACKAGE_NAME,
353
+ migrationOptions: {
354
+ optInTransformResponse: true
355
+ },
356
+ url: resolveWixOnlineprogramsParticipantsV3ParticipantsServiceUrl({
357
+ protoPath: "/v3/participants/{participantId}",
358
+ data: payload,
359
+ host
360
+ }),
361
+ params: toURLSearchParams(payload)
362
+ };
363
+ return metadata;
364
+ }
365
+ return __deleteParticipant;
366
+ }
367
+ function issueCertificate(payload) {
368
+ function __issueCertificate({ host }) {
311
369
  const metadata = {
312
370
  entityFqdn: "wix.online_programs.v3.participant",
313
371
  method: "POST",
314
- methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.QueryParticipants",
372
+ methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.IssueCertificate",
315
373
  packageName: PACKAGE_NAME,
316
374
  migrationOptions: {
317
375
  optInTransformResponse: true
318
376
  },
319
377
  url: resolveWixOnlineprogramsParticipantsV3ParticipantsServiceUrl({
320
- protoPath: "/v3/participants/query",
378
+ protoPath: "/v3/participants/{participantId}/issue-certificate",
321
379
  data: payload,
322
380
  host
323
381
  }),
@@ -326,33 +384,62 @@ function queryParticipants(payload) {
326
384
  {
327
385
  transformFn: transformRESTTimestampToSDKTimestamp,
328
386
  paths: [
329
- { path: "participants.createdDate" },
330
- { path: "participants.updatedDate" },
331
- { path: "participants.certificate.issuedDate" }
387
+ { path: "participant.createdDate" },
388
+ { path: "participant.updatedDate" },
389
+ { path: "participant.lastActivityDate" },
390
+ { path: "participant.certificate.issuedDate" },
391
+ { path: "participant.joinedInfo.joinedAt" }
332
392
  ]
333
393
  },
334
394
  {
335
395
  transformFn: transformRESTFloatToSDKFloat,
336
- paths: [{ path: "participants.progress.completionPercentage" }]
396
+ paths: [{ path: "participant.progress.completionPercentage" }]
337
397
  }
338
398
  ])
339
399
  };
340
400
  return metadata;
341
401
  }
342
- return __queryParticipants;
402
+ return __issueCertificate;
343
403
  }
344
- function getAccessStatus(payload) {
345
- function __getAccessStatus({ host }) {
404
+ function getCompletionStats(payload) {
405
+ function __getCompletionStats({ host }) {
346
406
  const metadata = {
347
407
  entityFqdn: "wix.online_programs.v3.participant",
348
408
  method: "GET",
349
- methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.GetAccessStatus",
409
+ methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.GetCompletionStats",
350
410
  packageName: PACKAGE_NAME,
351
411
  migrationOptions: {
352
412
  optInTransformResponse: true
353
413
  },
354
414
  url: resolveWixOnlineprogramsParticipantsV3ParticipantsServiceUrl({
355
- protoPath: "/v3/participants/access",
415
+ protoPath: "/v3/stats/completion/{programId}",
416
+ data: payload,
417
+ host
418
+ }),
419
+ params: toURLSearchParams(payload),
420
+ transformResponse: (payload2) => transformPaths(payload2, [
421
+ {
422
+ transformFn: transformRESTFloatToSDKFloat,
423
+ paths: [{ path: "completionRate" }]
424
+ }
425
+ ])
426
+ };
427
+ return metadata;
428
+ }
429
+ return __getCompletionStats;
430
+ }
431
+ function getPremiumStats(payload) {
432
+ function __getPremiumStats({ host }) {
433
+ const metadata = {
434
+ entityFqdn: "wix.online_programs.v3.participant",
435
+ method: "GET",
436
+ methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.GetPremiumStats",
437
+ packageName: PACKAGE_NAME,
438
+ migrationOptions: {
439
+ optInTransformResponse: true
440
+ },
441
+ url: resolveWixOnlineprogramsParticipantsV3ParticipantsServiceUrl({
442
+ protoPath: "/v3/stats/premium",
356
443
  data: payload,
357
444
  host
358
445
  }),
@@ -360,65 +447,102 @@ function getAccessStatus(payload) {
360
447
  };
361
448
  return metadata;
362
449
  }
363
- return __getAccessStatus;
450
+ return __getPremiumStats;
364
451
  }
365
- function applyCoupon(payload) {
366
- function __applyCoupon({ host }) {
452
+ function getParticipant(payload) {
453
+ function __getParticipant({ host }) {
367
454
  const metadata = {
368
455
  entityFqdn: "wix.online_programs.v3.participant",
369
- method: "POST",
370
- methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.ApplyCoupon",
456
+ method: "GET",
457
+ methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.GetParticipant",
371
458
  packageName: PACKAGE_NAME,
372
459
  migrationOptions: {
373
460
  optInTransformResponse: true
374
461
  },
375
462
  url: resolveWixOnlineprogramsParticipantsV3ParticipantsServiceUrl({
376
- protoPath: "/v3/participants/{participantId}/coupons/{couponCode}/apply",
463
+ protoPath: "/v3/participants/{participantId}",
377
464
  data: payload,
378
465
  host
379
466
  }),
380
- data: payload,
467
+ params: toURLSearchParams(payload),
381
468
  transformResponse: (payload2) => transformPaths(payload2, [
382
469
  {
383
- transformFn: transformRESTFloatToSDKFloat,
470
+ transformFn: transformRESTTimestampToSDKTimestamp,
384
471
  paths: [
385
- { path: "subTotal" },
386
- { path: "discount" },
387
- { path: "total" }
472
+ { path: "participant.createdDate" },
473
+ { path: "participant.updatedDate" },
474
+ { path: "participant.lastActivityDate" },
475
+ { path: "participant.certificate.issuedDate" },
476
+ { path: "participant.joinedInfo.joinedAt" }
388
477
  ]
478
+ },
479
+ {
480
+ transformFn: transformRESTFloatToSDKFloat,
481
+ paths: [{ path: "participant.progress.completionPercentage" }]
389
482
  }
390
483
  ])
391
484
  };
392
485
  return metadata;
393
486
  }
394
- return __applyCoupon;
487
+ return __getParticipant;
395
488
  }
396
- function revertCoupon(payload) {
397
- function __revertCoupon({ host }) {
489
+ function queryParticipants(payload) {
490
+ function __queryParticipants({ host }) {
398
491
  const metadata = {
399
492
  entityFqdn: "wix.online_programs.v3.participant",
400
493
  method: "POST",
401
- methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.RevertCoupon",
494
+ methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.QueryParticipants",
402
495
  packageName: PACKAGE_NAME,
403
496
  migrationOptions: {
404
497
  optInTransformResponse: true
405
498
  },
406
499
  url: resolveWixOnlineprogramsParticipantsV3ParticipantsServiceUrl({
407
- protoPath: "/v3/participants/{participantId}/coupons/{couponId}/revert",
500
+ protoPath: "/v3/participants/query",
408
501
  data: payload,
409
502
  host
410
503
  }),
411
504
  data: payload,
412
505
  transformResponse: (payload2) => transformPaths(payload2, [
506
+ {
507
+ transformFn: transformRESTTimestampToSDKTimestamp,
508
+ paths: [
509
+ { path: "participants.createdDate" },
510
+ { path: "participants.updatedDate" },
511
+ { path: "participants.lastActivityDate" },
512
+ { path: "participants.certificate.issuedDate" },
513
+ { path: "participants.joinedInfo.joinedAt" }
514
+ ]
515
+ },
413
516
  {
414
517
  transformFn: transformRESTFloatToSDKFloat,
415
- paths: [{ path: "total" }]
518
+ paths: [{ path: "participants.progress.completionPercentage" }]
416
519
  }
417
520
  ])
418
521
  };
419
522
  return metadata;
420
523
  }
421
- return __revertCoupon;
524
+ return __queryParticipants;
525
+ }
526
+ function getAccessStatus(payload) {
527
+ function __getAccessStatus({ host }) {
528
+ const metadata = {
529
+ entityFqdn: "wix.online_programs.v3.participant",
530
+ method: "GET",
531
+ methodFqn: "wix.onlineprograms.participants.v3.ParticipantsService.GetAccessStatus",
532
+ packageName: PACKAGE_NAME,
533
+ migrationOptions: {
534
+ optInTransformResponse: true
535
+ },
536
+ url: resolveWixOnlineprogramsParticipantsV3ParticipantsServiceUrl({
537
+ protoPath: "/v3/participants/access",
538
+ data: payload,
539
+ host
540
+ }),
541
+ params: toURLSearchParams(payload)
542
+ };
543
+ return metadata;
544
+ }
545
+ return __getAccessStatus;
422
546
  }
423
547
  function bulkInviteToProgram(payload) {
424
548
  function __bulkInviteToProgram({ host }) {
@@ -442,7 +566,9 @@ function bulkInviteToProgram(payload) {
442
566
  paths: [
443
567
  { path: "results.item.createdDate" },
444
568
  { path: "results.item.updatedDate" },
445
- { path: "results.item.certificate.issuedDate" }
569
+ { path: "results.item.lastActivityDate" },
570
+ { path: "results.item.certificate.issuedDate" },
571
+ { path: "results.item.joinedInfo.joinedAt" }
446
572
  ]
447
573
  },
448
574
  {
@@ -498,7 +624,9 @@ function bulkAddToProgram(payload) {
498
624
  paths: [
499
625
  { path: "results.item.createdDate" },
500
626
  { path: "results.item.updatedDate" },
501
- { path: "results.item.certificate.issuedDate" }
627
+ { path: "results.item.lastActivityDate" },
628
+ { path: "results.item.certificate.issuedDate" },
629
+ { path: "results.item.joinedInfo.joinedAt" }
502
630
  ]
503
631
  },
504
632
  {
@@ -511,27 +639,6 @@ function bulkAddToProgram(payload) {
511
639
  }
512
640
  return __bulkAddToProgram;
513
641
  }
514
- function bulkAddAllToProgram(payload) {
515
- function __bulkAddAllToProgram({ host }) {
516
- const metadata = {
517
- entityFqdn: "wix.online_programs.v3.participant",
518
- method: "POST",
519
- methodFqn: "wix.onlineprograms.participants.v3.ManageParticipantsService.BulkAddAllToProgram",
520
- packageName: PACKAGE_NAME,
521
- migrationOptions: {
522
- optInTransformResponse: true
523
- },
524
- url: resolveWixOnlineprogramsParticipantsV3ManageParticipantsServiceUrl({
525
- protoPath: "/v3/bulk/participants/add-all",
526
- data: payload,
527
- host
528
- }),
529
- data: payload
530
- };
531
- return metadata;
532
- }
533
- return __bulkAddAllToProgram;
534
- }
535
642
  function bulkApproveParticipant(payload) {
536
643
  function __bulkApproveParticipant({ host }) {
537
644
  const metadata = {
@@ -554,7 +661,9 @@ function bulkApproveParticipant(payload) {
554
661
  paths: [
555
662
  { path: "results.item.createdDate" },
556
663
  { path: "results.item.updatedDate" },
557
- { path: "results.item.certificate.issuedDate" }
664
+ { path: "results.item.lastActivityDate" },
665
+ { path: "results.item.certificate.issuedDate" },
666
+ { path: "results.item.joinedInfo.joinedAt" }
558
667
  ]
559
668
  },
560
669
  {
@@ -588,18 +697,18 @@ function bulkApproveAllParticipant(payload) {
588
697
  }
589
698
  return __bulkApproveAllParticipant;
590
699
  }
591
- function deleteParticipant(payload) {
592
- function __deleteParticipant({ host }) {
700
+ function exportParticipantsStats(payload) {
701
+ function __exportParticipantsStats({ host }) {
593
702
  const metadata = {
594
703
  entityFqdn: "wix.online_programs.v3.participant",
595
- method: "DELETE",
596
- methodFqn: "wix.onlineprograms.participants.v3.ManageParticipantsService.DeleteParticipant",
704
+ method: "GET",
705
+ methodFqn: "wix.onlineprograms.participants.v3.ParticipantExportsService.ExportParticipantsStats",
597
706
  packageName: PACKAGE_NAME,
598
707
  migrationOptions: {
599
708
  optInTransformResponse: true
600
709
  },
601
- url: resolveWixOnlineprogramsParticipantsV3ManageParticipantsServiceUrl({
602
- protoPath: "/v3/participants/{participantId}",
710
+ url: resolveWixOnlineprogramsParticipantsV3ParticipantExportsServiceUrl({
711
+ protoPath: "/v3/participants/export/{programId}",
603
712
  data: payload,
604
713
  host
605
714
  }),
@@ -607,247 +716,194 @@ function deleteParticipant(payload) {
607
716
  };
608
717
  return metadata;
609
718
  }
610
- return __deleteParticipant;
719
+ return __exportParticipantsStats;
611
720
  }
612
- function issueCertificate(payload) {
613
- function __issueCertificate({ host }) {
614
- const metadata = {
615
- entityFqdn: "wix.online_programs.v3.participant",
616
- method: "POST",
617
- methodFqn: "wix.onlineprograms.participants.v3.ManageParticipantsService.IssueCertificate",
618
- packageName: PACKAGE_NAME,
619
- migrationOptions: {
620
- optInTransformResponse: true
721
+
722
+ // src/online-programs-v3-participant-participants.universal.ts
723
+ import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
724
+ var JoinPath = /* @__PURE__ */ ((JoinPath2) => {
725
+ JoinPath2["UNKNOWN_JOIN_PATH"] = "UNKNOWN_JOIN_PATH";
726
+ JoinPath2["FREE"] = "FREE";
727
+ JoinPath2["ADDED"] = "ADDED";
728
+ JoinPath2["SINGLE_PAYMENT"] = "SINGLE_PAYMENT";
729
+ JoinPath2["PAID_PLAN"] = "PAID_PLAN";
730
+ JoinPath2["FREE_COUPON"] = "FREE_COUPON";
731
+ return JoinPath2;
732
+ })(JoinPath || {});
733
+ var State = /* @__PURE__ */ ((State2) => {
734
+ State2["UNKNOWN_STATE"] = "UNKNOWN_STATE";
735
+ State2["JOINED"] = "JOINED";
736
+ State2["COMPLETED"] = "COMPLETED";
737
+ State2["FAILED"] = "FAILED";
738
+ State2["SUSPENDED"] = "SUSPENDED";
739
+ State2["AUTO_REMOVED"] = "AUTO_REMOVED";
740
+ State2["REMOVED"] = "REMOVED";
741
+ State2["LEFT"] = "LEFT";
742
+ return State2;
743
+ })(State || {});
744
+ var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
745
+ SortOrder2["ASC"] = "ASC";
746
+ SortOrder2["DESC"] = "DESC";
747
+ return SortOrder2;
748
+ })(SortOrder || {});
749
+ var BenefitType = /* @__PURE__ */ ((BenefitType2) => {
750
+ BenefitType2["UNDEFINED"] = "UNDEFINED";
751
+ BenefitType2["LIMITED"] = "LIMITED";
752
+ BenefitType2["UNLIMITED"] = "UNLIMITED";
753
+ return BenefitType2;
754
+ })(BenefitType || {});
755
+ var Event = /* @__PURE__ */ ((Event2) => {
756
+ Event2["Updated"] = "Updated";
757
+ Event2["Deleted"] = "Deleted";
758
+ Event2["Created"] = "Created";
759
+ return Event2;
760
+ })(Event || {});
761
+ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
762
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
763
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
764
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
765
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
766
+ WebhookIdentityType2["APP"] = "APP";
767
+ return WebhookIdentityType2;
768
+ })(WebhookIdentityType || {});
769
+ async function createParticipant2(participant) {
770
+ const { httpClient, sideEffects } = arguments[1];
771
+ const payload = renameKeysFromSDKRequestToRESTRequest({
772
+ participant
773
+ });
774
+ const reqOpts = createParticipant(payload);
775
+ sideEffects?.onSiteCall?.();
776
+ try {
777
+ const result = await httpClient.request(reqOpts);
778
+ sideEffects?.onSuccess?.(result);
779
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.participant;
780
+ } catch (err) {
781
+ const transformedError = sdkTransformError(
782
+ err,
783
+ {
784
+ spreadPathsToArguments: {},
785
+ explicitPathsToArguments: { participant: "$[0]" },
786
+ singleArgumentUnchanged: false
621
787
  },
622
- url: resolveWixOnlineprogramsParticipantsV3ManageParticipantsServiceUrl({
623
- protoPath: "/v3/participants/{participantId}/issue-certificate",
624
- data: payload,
625
- host
626
- }),
627
- data: payload,
628
- transformResponse: (payload2) => transformPaths(payload2, [
629
- {
630
- transformFn: transformRESTTimestampToSDKTimestamp,
631
- paths: [
632
- { path: "participant.createdDate" },
633
- { path: "participant.updatedDate" },
634
- { path: "participant.certificate.issuedDate" }
635
- ]
788
+ ["participant"]
789
+ );
790
+ sideEffects?.onError?.(err);
791
+ throw transformedError;
792
+ }
793
+ }
794
+ async function bulkCreateParticipant2(participants, options) {
795
+ const { httpClient, sideEffects } = arguments[2];
796
+ const payload = renameKeysFromSDKRequestToRESTRequest({
797
+ participants,
798
+ returnEntity: options?.returnEntity
799
+ });
800
+ const reqOpts = bulkCreateParticipant(payload);
801
+ sideEffects?.onSiteCall?.();
802
+ try {
803
+ const result = await httpClient.request(reqOpts);
804
+ sideEffects?.onSuccess?.(result);
805
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
806
+ } catch (err) {
807
+ const transformedError = sdkTransformError(
808
+ err,
809
+ {
810
+ spreadPathsToArguments: {},
811
+ explicitPathsToArguments: {
812
+ participants: "$[0]",
813
+ returnEntity: "$[1].returnEntity"
636
814
  },
637
- {
638
- transformFn: transformRESTFloatToSDKFloat,
639
- paths: [{ path: "participant.progress.completionPercentage" }]
640
- }
641
- ])
642
- };
643
- return metadata;
815
+ singleArgumentUnchanged: false
816
+ },
817
+ ["participants", "options"]
818
+ );
819
+ sideEffects?.onError?.(err);
820
+ throw transformedError;
644
821
  }
645
- return __issueCertificate;
646
822
  }
647
- function getCompletionStats(payload) {
648
- function __getCompletionStats({ host }) {
649
- const metadata = {
650
- entityFqdn: "wix.online_programs.v3.participant",
651
- method: "GET",
652
- methodFqn: "wix.onlineprograms.participants.v3.ManageParticipantsService.GetCompletionStats",
653
- packageName: PACKAGE_NAME,
654
- migrationOptions: {
655
- optInTransformResponse: true
823
+ async function bulkAddAllToProgram2(programId, options) {
824
+ const { httpClient, sideEffects } = arguments[2];
825
+ const payload = renameKeysFromSDKRequestToRESTRequest({
826
+ programId,
827
+ excludeMemberIds: options?.excludeMemberIds
828
+ });
829
+ const reqOpts = bulkAddAllToProgram(payload);
830
+ sideEffects?.onSiteCall?.();
831
+ try {
832
+ const result = await httpClient.request(reqOpts);
833
+ sideEffects?.onSuccess?.(result);
834
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
835
+ } catch (err) {
836
+ const transformedError = sdkTransformError(
837
+ err,
838
+ {
839
+ spreadPathsToArguments: {},
840
+ explicitPathsToArguments: {
841
+ programId: "$[0]",
842
+ excludeMemberIds: "$[1].excludeMemberIds"
843
+ },
844
+ singleArgumentUnchanged: false
656
845
  },
657
- url: resolveWixOnlineprogramsParticipantsV3ManageParticipantsServiceUrl({
658
- protoPath: "/v3/stats/completion/{programId}",
659
- data: payload,
660
- host
661
- }),
662
- params: toURLSearchParams(payload),
663
- transformResponse: (payload2) => transformPaths(payload2, [
664
- {
665
- transformFn: transformRESTFloatToSDKFloat,
666
- paths: [{ path: "completionRate" }]
667
- }
668
- ])
669
- };
670
- return metadata;
846
+ ["programId", "options"]
847
+ );
848
+ sideEffects?.onError?.(err);
849
+ throw transformedError;
671
850
  }
672
- return __getCompletionStats;
673
851
  }
674
- function getPremiumStats(payload) {
675
- function __getPremiumStats({ host }) {
676
- const metadata = {
677
- entityFqdn: "wix.online_programs.v3.participant",
678
- method: "GET",
679
- methodFqn: "wix.onlineprograms.participants.v3.ManageParticipantsService.GetPremiumStats",
680
- packageName: PACKAGE_NAME,
681
- migrationOptions: {
682
- optInTransformResponse: true
852
+ async function deleteParticipant2(participantId) {
853
+ const { httpClient, sideEffects } = arguments[1];
854
+ const payload = renameKeysFromSDKRequestToRESTRequest({
855
+ participantId
856
+ });
857
+ const reqOpts = deleteParticipant(payload);
858
+ sideEffects?.onSiteCall?.();
859
+ try {
860
+ const result = await httpClient.request(reqOpts);
861
+ sideEffects?.onSuccess?.(result);
862
+ } catch (err) {
863
+ const transformedError = sdkTransformError(
864
+ err,
865
+ {
866
+ spreadPathsToArguments: {},
867
+ explicitPathsToArguments: { participantId: "$[0]" },
868
+ singleArgumentUnchanged: false
683
869
  },
684
- url: resolveWixOnlineprogramsParticipantsV3ManageParticipantsServiceUrl({
685
- protoPath: "/v3/stats/premium",
686
- data: payload,
687
- host
688
- }),
689
- params: toURLSearchParams(payload)
690
- };
691
- return metadata;
870
+ ["participantId"]
871
+ );
872
+ sideEffects?.onError?.(err);
873
+ throw transformedError;
692
874
  }
693
- return __getPremiumStats;
694
875
  }
695
- function exportParticipantsStats(payload) {
696
- function __exportParticipantsStats({ host }) {
697
- const metadata = {
698
- entityFqdn: "wix.online_programs.v3.participant",
699
- method: "GET",
700
- methodFqn: "wix.onlineprograms.participants.v3.ParticipantExportsService.ExportParticipantsStats",
701
- packageName: PACKAGE_NAME,
702
- migrationOptions: {
703
- optInTransformResponse: true
876
+ async function issueCertificate2(participantId) {
877
+ const { httpClient, sideEffects } = arguments[1];
878
+ const payload = renameKeysFromSDKRequestToRESTRequest({
879
+ participantId
880
+ });
881
+ const reqOpts = issueCertificate(payload);
882
+ sideEffects?.onSiteCall?.();
883
+ try {
884
+ const result = await httpClient.request(reqOpts);
885
+ sideEffects?.onSuccess?.(result);
886
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
887
+ } catch (err) {
888
+ const transformedError = sdkTransformError(
889
+ err,
890
+ {
891
+ spreadPathsToArguments: {},
892
+ explicitPathsToArguments: { participantId: "$[0]" },
893
+ singleArgumentUnchanged: false
704
894
  },
705
- url: resolveWixOnlineprogramsParticipantsV3ParticipantExportsServiceUrl({
706
- protoPath: "/v3/participants/export/{programId}",
707
- data: payload,
708
- host
709
- }),
710
- params: toURLSearchParams(payload)
711
- };
712
- return metadata;
895
+ ["participantId"]
896
+ );
897
+ sideEffects?.onError?.(err);
898
+ throw transformedError;
713
899
  }
714
- return __exportParticipantsStats;
715
900
  }
716
-
717
- // src/online-programs-v3-participant-participants.universal.ts
718
- import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
719
- var JoinPath = /* @__PURE__ */ ((JoinPath2) => {
720
- JoinPath2["UNKNOWN_JOIN_PATH"] = "UNKNOWN_JOIN_PATH";
721
- JoinPath2["FREE"] = "FREE";
722
- JoinPath2["ADDED"] = "ADDED";
723
- JoinPath2["SINGLE_PAYMENT"] = "SINGLE_PAYMENT";
724
- JoinPath2["PAID_PLAN"] = "PAID_PLAN";
725
- JoinPath2["FREE_COUPON"] = "FREE_COUPON";
726
- return JoinPath2;
727
- })(JoinPath || {});
728
- var State = /* @__PURE__ */ ((State2) => {
729
- State2["UNKNOWN_STATE"] = "UNKNOWN_STATE";
730
- State2["INVITED"] = "INVITED";
731
- State2["APPROVAL_PENDING"] = "APPROVAL_PENDING";
732
- State2["PAYMENT_PENDING"] = "PAYMENT_PENDING";
733
- State2["JOINED"] = "JOINED";
734
- State2["COMPLETED"] = "COMPLETED";
735
- State2["FAILED"] = "FAILED";
736
- State2["SUSPENDED"] = "SUSPENDED";
737
- State2["AUTO_REMOVED"] = "AUTO_REMOVED";
738
- return State2;
739
- })(State || {});
740
- var RemovalReason = /* @__PURE__ */ ((RemovalReason2) => {
741
- RemovalReason2["UNKNOWN_REMOVAL_REASON"] = "UNKNOWN_REMOVAL_REASON";
742
- RemovalReason2["LEGITIMATE_LEAVE"] = "LEGITIMATE_LEAVE";
743
- RemovalReason2["CLEANUP_FOR_REJOIN"] = "CLEANUP_FOR_REJOIN";
744
- RemovalReason2["CLEANUP_FOR_MANUAL_ADD"] = "CLEANUP_FOR_MANUAL_ADD";
745
- return RemovalReason2;
746
- })(RemovalReason || {});
747
- var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
748
- SortOrder2["ASC"] = "ASC";
749
- SortOrder2["DESC"] = "DESC";
750
- return SortOrder2;
751
- })(SortOrder || {});
752
- var EventType = /* @__PURE__ */ ((EventType2) => {
753
- EventType2["UNDEFINED"] = "UNDEFINED";
754
- EventType2["TRANSACTION_STATUS_CHANGED"] = "TRANSACTION_STATUS_CHANGED";
755
- EventType2["REFUND_STATUS_CHANGED"] = "REFUND_STATUS_CHANGED";
756
- EventType2["RECURRING_PAYMENT_STATUS_CHANGED"] = "RECURRING_PAYMENT_STATUS_CHANGED";
757
- EventType2["TRANSACTION_UPDATED"] = "TRANSACTION_UPDATED";
758
- EventType2["TRANSACTION_CREATED"] = "TRANSACTION_CREATED";
759
- return EventType2;
760
- })(EventType || {});
761
- var OrderItemCategory = /* @__PURE__ */ ((OrderItemCategory2) => {
762
- OrderItemCategory2["UNDEFINED"] = "UNDEFINED";
763
- OrderItemCategory2["PHYSICAL"] = "PHYSICAL";
764
- OrderItemCategory2["DIGITAL"] = "DIGITAL";
765
- return OrderItemCategory2;
766
- })(OrderItemCategory || {});
767
- var SubdivisionType = /* @__PURE__ */ ((SubdivisionType2) => {
768
- SubdivisionType2["UNKNOWN_SUBDIVISION_TYPE"] = "UNKNOWN_SUBDIVISION_TYPE";
769
- SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_1"] = "ADMINISTRATIVE_AREA_LEVEL_1";
770
- SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_2"] = "ADMINISTRATIVE_AREA_LEVEL_2";
771
- SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_3"] = "ADMINISTRATIVE_AREA_LEVEL_3";
772
- SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_4"] = "ADMINISTRATIVE_AREA_LEVEL_4";
773
- SubdivisionType2["ADMINISTRATIVE_AREA_LEVEL_5"] = "ADMINISTRATIVE_AREA_LEVEL_5";
774
- SubdivisionType2["COUNTRY"] = "COUNTRY";
775
- return SubdivisionType2;
776
- })(SubdivisionType || {});
777
- var VatType = /* @__PURE__ */ ((VatType2) => {
778
- VatType2["UNSPECIFIED"] = "UNSPECIFIED";
779
- VatType2["CPF"] = "CPF";
780
- VatType2["CNPJ"] = "CNPJ";
781
- return VatType2;
782
- })(VatType || {});
783
- var TransactionStatus = /* @__PURE__ */ ((TransactionStatus2) => {
784
- TransactionStatus2["UNDEFINED"] = "UNDEFINED";
785
- TransactionStatus2["APPROVED"] = "APPROVED";
786
- TransactionStatus2["PENDING"] = "PENDING";
787
- TransactionStatus2["PENDING_MERCHANT"] = "PENDING_MERCHANT";
788
- TransactionStatus2["CANCELED"] = "CANCELED";
789
- TransactionStatus2["DECLINED"] = "DECLINED";
790
- TransactionStatus2["REFUNDED"] = "REFUNDED";
791
- TransactionStatus2["PARTIALLY_REFUNDED"] = "PARTIALLY_REFUNDED";
792
- TransactionStatus2["AUTHORIZED"] = "AUTHORIZED";
793
- TransactionStatus2["VOIDED"] = "VOIDED";
794
- return TransactionStatus2;
795
- })(TransactionStatus || {});
796
- var ScheduledActionType = /* @__PURE__ */ ((ScheduledActionType2) => {
797
- ScheduledActionType2["VOID"] = "VOID";
798
- ScheduledActionType2["CAPTURE"] = "CAPTURE";
799
- return ScheduledActionType2;
800
- })(ScheduledActionType || {});
801
- var RefundStatus = /* @__PURE__ */ ((RefundStatus2) => {
802
- RefundStatus2["UNDEFINED"] = "UNDEFINED";
803
- RefundStatus2["APPROVED"] = "APPROVED";
804
- RefundStatus2["PENDING"] = "PENDING";
805
- RefundStatus2["DECLINED"] = "DECLINED";
806
- return RefundStatus2;
807
- })(RefundStatus || {});
808
- var Status = /* @__PURE__ */ ((Status2) => {
809
- Status2["UNDEFINED"] = "UNDEFINED";
810
- Status2["PENDING"] = "PENDING";
811
- Status2["ACTIVE"] = "ACTIVE";
812
- Status2["CANCELLED"] = "CANCELLED";
813
- Status2["FINISHED"] = "FINISHED";
814
- Status2["SUSPENDED"] = "SUSPENDED";
815
- return Status2;
816
- })(Status || {});
817
- var Initiator = /* @__PURE__ */ ((Initiator2) => {
818
- Initiator2["UNDEFINED"] = "UNDEFINED";
819
- Initiator2["BUYER"] = "BUYER";
820
- Initiator2["MERCHANT"] = "MERCHANT";
821
- Initiator2["PAYMENT"] = "PAYMENT";
822
- Initiator2["SETUP"] = "SETUP";
823
- return Initiator2;
824
- })(Initiator || {});
825
- var BenefitType = /* @__PURE__ */ ((BenefitType2) => {
826
- BenefitType2["UNDEFINED"] = "UNDEFINED";
827
- BenefitType2["LIMITED"] = "LIMITED";
828
- BenefitType2["UNLIMITED"] = "UNLIMITED";
829
- return BenefitType2;
830
- })(BenefitType || {});
831
- var Event = /* @__PURE__ */ ((Event2) => {
832
- Event2["Updated"] = "Updated";
833
- Event2["Deleted"] = "Deleted";
834
- Event2["Created"] = "Created";
835
- return Event2;
836
- })(Event || {});
837
- var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
838
- WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
839
- WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
840
- WebhookIdentityType2["MEMBER"] = "MEMBER";
841
- WebhookIdentityType2["WIX_USER"] = "WIX_USER";
842
- WebhookIdentityType2["APP"] = "APP";
843
- return WebhookIdentityType2;
844
- })(WebhookIdentityType || {});
845
- async function joinProgram2(programId) {
901
+ async function getCompletionStats2(programId) {
846
902
  const { httpClient, sideEffects } = arguments[1];
847
903
  const payload = renameKeysFromSDKRequestToRESTRequest({
848
904
  programId
849
905
  });
850
- const reqOpts = joinProgram(payload);
906
+ const reqOpts = getCompletionStats(payload);
851
907
  sideEffects?.onSiteCall?.();
852
908
  try {
853
909
  const result = await httpClient.request(reqOpts);
@@ -867,41 +923,40 @@ async function joinProgram2(programId) {
867
923
  throw transformedError;
868
924
  }
869
925
  }
870
- async function getParticipant2(participantId) {
871
- const { httpClient, sideEffects } = arguments[1];
872
- const payload = renameKeysFromSDKRequestToRESTRequest({
873
- participantId
874
- });
875
- const reqOpts = getParticipant(payload);
926
+ async function getPremiumStats2() {
927
+ const { httpClient, sideEffects } = arguments[0];
928
+ const payload = renameKeysFromSDKRequestToRESTRequest({});
929
+ const reqOpts = getPremiumStats(payload);
876
930
  sideEffects?.onSiteCall?.();
877
931
  try {
878
932
  const result = await httpClient.request(reqOpts);
879
933
  sideEffects?.onSuccess?.(result);
880
- return renameKeysFromRESTResponseToSDKResponse(result.data)?.participant;
934
+ return renameKeysFromRESTResponseToSDKResponse(result.data);
881
935
  } catch (err) {
882
936
  const transformedError = sdkTransformError(
883
937
  err,
884
938
  {
885
939
  spreadPathsToArguments: {},
886
- explicitPathsToArguments: { participantId: "$[0]" },
940
+ explicitPathsToArguments: {},
887
941
  singleArgumentUnchanged: false
888
942
  },
889
- ["participantId"]
943
+ []
890
944
  );
891
945
  sideEffects?.onError?.(err);
892
946
  throw transformedError;
893
947
  }
894
948
  }
895
- async function leaveProgram2(participantId) {
949
+ async function getParticipant2(participantId) {
896
950
  const { httpClient, sideEffects } = arguments[1];
897
951
  const payload = renameKeysFromSDKRequestToRESTRequest({
898
952
  participantId
899
953
  });
900
- const reqOpts = leaveProgram(payload);
954
+ const reqOpts = getParticipant(payload);
901
955
  sideEffects?.onSiteCall?.();
902
956
  try {
903
957
  const result = await httpClient.request(reqOpts);
904
958
  sideEffects?.onSuccess?.(result);
959
+ return renameKeysFromRESTResponseToSDKResponse(result.data)?.participant;
905
960
  } catch (err) {
906
961
  const transformedError = sdkTransformError(
907
962
  err,
@@ -984,106 +1039,14 @@ async function getAccessStatus2() {
984
1039
  throw transformedError;
985
1040
  }
986
1041
  }
987
- async function applyCoupon2(identifiers, orderId) {
988
- const { httpClient, sideEffects } = arguments[2];
989
- const payload = renameKeysFromSDKRequestToRESTRequest({
990
- participantId: identifiers?.participantId,
991
- couponCode: identifiers?.couponCode,
992
- orderId
993
- });
994
- const reqOpts = applyCoupon(payload);
995
- sideEffects?.onSiteCall?.();
996
- try {
997
- const result = await httpClient.request(reqOpts);
998
- sideEffects?.onSuccess?.(result);
999
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1000
- } catch (err) {
1001
- const transformedError = sdkTransformError(
1002
- err,
1003
- {
1004
- spreadPathsToArguments: {},
1005
- explicitPathsToArguments: {
1006
- participantId: "$[0].participantId",
1007
- couponCode: "$[0].couponCode",
1008
- orderId: "$[1]"
1009
- },
1010
- singleArgumentUnchanged: false
1011
- },
1012
- ["identifiers", "orderId"]
1013
- );
1014
- sideEffects?.onError?.(err);
1015
- throw transformedError;
1016
- }
1017
- }
1018
- async function revertCoupon2(identifiers, orderId) {
1019
- const { httpClient, sideEffects } = arguments[2];
1020
- const payload = renameKeysFromSDKRequestToRESTRequest({
1021
- participantId: identifiers?.participantId,
1022
- couponId: identifiers?.couponId,
1023
- orderId
1024
- });
1025
- const reqOpts = revertCoupon(payload);
1026
- sideEffects?.onSiteCall?.();
1027
- try {
1028
- const result = await httpClient.request(reqOpts);
1029
- sideEffects?.onSuccess?.(result);
1030
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1031
- } catch (err) {
1032
- const transformedError = sdkTransformError(
1033
- err,
1034
- {
1035
- spreadPathsToArguments: {},
1036
- explicitPathsToArguments: {
1037
- participantId: "$[0].participantId",
1038
- couponId: "$[0].couponId",
1039
- orderId: "$[1]"
1040
- },
1041
- singleArgumentUnchanged: false
1042
- },
1043
- ["identifiers", "orderId"]
1044
- );
1045
- sideEffects?.onError?.(err);
1046
- throw transformedError;
1047
- }
1048
- }
1049
1042
  async function bulkInviteToProgram2(programId, options) {
1050
1043
  const { httpClient, sideEffects } = arguments[2];
1051
1044
  const payload = renameKeysFromSDKRequestToRESTRequest({
1052
1045
  programId,
1053
- memberIds: options?.memberIds,
1054
- returnEntity: options?.returnEntity
1055
- });
1056
- const reqOpts = bulkInviteToProgram(payload);
1057
- sideEffects?.onSiteCall?.();
1058
- try {
1059
- const result = await httpClient.request(reqOpts);
1060
- sideEffects?.onSuccess?.(result);
1061
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1062
- } catch (err) {
1063
- const transformedError = sdkTransformError(
1064
- err,
1065
- {
1066
- spreadPathsToArguments: {},
1067
- explicitPathsToArguments: {
1068
- programId: "$[0]",
1069
- memberIds: "$[1].memberIds",
1070
- returnEntity: "$[1].returnEntity"
1071
- },
1072
- singleArgumentUnchanged: false
1073
- },
1074
- ["programId", "options"]
1075
- );
1076
- sideEffects?.onError?.(err);
1077
- throw transformedError;
1078
- }
1079
- }
1080
- async function bulkInviteAllToProgram2(programId, options) {
1081
- const { httpClient, sideEffects } = arguments[2];
1082
- const payload = renameKeysFromSDKRequestToRESTRequest({
1083
- programId,
1084
- excludeMemberIds: options?.excludeMemberIds
1046
+ memberIds: options?.memberIds,
1047
+ returnEntity: options?.returnEntity
1085
1048
  });
1086
- const reqOpts = bulkInviteAllToProgram(payload);
1049
+ const reqOpts = bulkInviteToProgram(payload);
1087
1050
  sideEffects?.onSiteCall?.();
1088
1051
  try {
1089
1052
  const result = await httpClient.request(reqOpts);
@@ -1096,7 +1059,8 @@ async function bulkInviteAllToProgram2(programId, options) {
1096
1059
  spreadPathsToArguments: {},
1097
1060
  explicitPathsToArguments: {
1098
1061
  programId: "$[0]",
1099
- excludeMemberIds: "$[1].excludeMemberIds"
1062
+ memberIds: "$[1].memberIds",
1063
+ returnEntity: "$[1].returnEntity"
1100
1064
  },
1101
1065
  singleArgumentUnchanged: false
1102
1066
  },
@@ -1106,14 +1070,13 @@ async function bulkInviteAllToProgram2(programId, options) {
1106
1070
  throw transformedError;
1107
1071
  }
1108
1072
  }
1109
- async function bulkAddToProgram2(programId, options) {
1073
+ async function bulkInviteAllToProgram2(programId, options) {
1110
1074
  const { httpClient, sideEffects } = arguments[2];
1111
1075
  const payload = renameKeysFromSDKRequestToRESTRequest({
1112
1076
  programId,
1113
- memberIds: options?.memberIds,
1114
- returnEntity: options?.returnEntity
1077
+ excludeMemberIds: options?.excludeMemberIds
1115
1078
  });
1116
- const reqOpts = bulkAddToProgram(payload);
1079
+ const reqOpts = bulkInviteAllToProgram(payload);
1117
1080
  sideEffects?.onSiteCall?.();
1118
1081
  try {
1119
1082
  const result = await httpClient.request(reqOpts);
@@ -1126,8 +1089,7 @@ async function bulkAddToProgram2(programId, options) {
1126
1089
  spreadPathsToArguments: {},
1127
1090
  explicitPathsToArguments: {
1128
1091
  programId: "$[0]",
1129
- memberIds: "$[1].memberIds",
1130
- returnEntity: "$[1].returnEntity"
1092
+ excludeMemberIds: "$[1].excludeMemberIds"
1131
1093
  },
1132
1094
  singleArgumentUnchanged: false
1133
1095
  },
@@ -1137,13 +1099,14 @@ async function bulkAddToProgram2(programId, options) {
1137
1099
  throw transformedError;
1138
1100
  }
1139
1101
  }
1140
- async function bulkAddAllToProgram2(programId, options) {
1102
+ async function bulkAddToProgram2(programId, options) {
1141
1103
  const { httpClient, sideEffects } = arguments[2];
1142
1104
  const payload = renameKeysFromSDKRequestToRESTRequest({
1143
1105
  programId,
1144
- excludeMemberIds: options?.excludeMemberIds
1106
+ memberIds: options?.memberIds,
1107
+ returnEntity: options?.returnEntity
1145
1108
  });
1146
- const reqOpts = bulkAddAllToProgram(payload);
1109
+ const reqOpts = bulkAddToProgram(payload);
1147
1110
  sideEffects?.onSiteCall?.();
1148
1111
  try {
1149
1112
  const result = await httpClient.request(reqOpts);
@@ -1156,7 +1119,8 @@ async function bulkAddAllToProgram2(programId, options) {
1156
1119
  spreadPathsToArguments: {},
1157
1120
  explicitPathsToArguments: {
1158
1121
  programId: "$[0]",
1159
- excludeMemberIds: "$[1].excludeMemberIds"
1122
+ memberIds: "$[1].memberIds",
1123
+ returnEntity: "$[1].returnEntity"
1160
1124
  },
1161
1125
  singleArgumentUnchanged: false
1162
1126
  },
@@ -1226,103 +1190,6 @@ async function bulkApproveAllParticipant2(options) {
1226
1190
  throw transformedError;
1227
1191
  }
1228
1192
  }
1229
- async function deleteParticipant2(participantId) {
1230
- const { httpClient, sideEffects } = arguments[1];
1231
- const payload = renameKeysFromSDKRequestToRESTRequest({
1232
- participantId
1233
- });
1234
- const reqOpts = deleteParticipant(payload);
1235
- sideEffects?.onSiteCall?.();
1236
- try {
1237
- const result = await httpClient.request(reqOpts);
1238
- sideEffects?.onSuccess?.(result);
1239
- } catch (err) {
1240
- const transformedError = sdkTransformError(
1241
- err,
1242
- {
1243
- spreadPathsToArguments: {},
1244
- explicitPathsToArguments: { participantId: "$[0]" },
1245
- singleArgumentUnchanged: false
1246
- },
1247
- ["participantId"]
1248
- );
1249
- sideEffects?.onError?.(err);
1250
- throw transformedError;
1251
- }
1252
- }
1253
- async function issueCertificate2(participantId) {
1254
- const { httpClient, sideEffects } = arguments[1];
1255
- const payload = renameKeysFromSDKRequestToRESTRequest({
1256
- participantId
1257
- });
1258
- const reqOpts = issueCertificate(payload);
1259
- sideEffects?.onSiteCall?.();
1260
- try {
1261
- const result = await httpClient.request(reqOpts);
1262
- sideEffects?.onSuccess?.(result);
1263
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1264
- } catch (err) {
1265
- const transformedError = sdkTransformError(
1266
- err,
1267
- {
1268
- spreadPathsToArguments: {},
1269
- explicitPathsToArguments: { participantId: "$[0]" },
1270
- singleArgumentUnchanged: false
1271
- },
1272
- ["participantId"]
1273
- );
1274
- sideEffects?.onError?.(err);
1275
- throw transformedError;
1276
- }
1277
- }
1278
- async function getCompletionStats2(programId) {
1279
- const { httpClient, sideEffects } = arguments[1];
1280
- const payload = renameKeysFromSDKRequestToRESTRequest({
1281
- programId
1282
- });
1283
- const reqOpts = getCompletionStats(payload);
1284
- sideEffects?.onSiteCall?.();
1285
- try {
1286
- const result = await httpClient.request(reqOpts);
1287
- sideEffects?.onSuccess?.(result);
1288
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1289
- } catch (err) {
1290
- const transformedError = sdkTransformError(
1291
- err,
1292
- {
1293
- spreadPathsToArguments: {},
1294
- explicitPathsToArguments: { programId: "$[0]" },
1295
- singleArgumentUnchanged: false
1296
- },
1297
- ["programId"]
1298
- );
1299
- sideEffects?.onError?.(err);
1300
- throw transformedError;
1301
- }
1302
- }
1303
- async function getPremiumStats2() {
1304
- const { httpClient, sideEffects } = arguments[0];
1305
- const payload = renameKeysFromSDKRequestToRESTRequest({});
1306
- const reqOpts = getPremiumStats(payload);
1307
- sideEffects?.onSiteCall?.();
1308
- try {
1309
- const result = await httpClient.request(reqOpts);
1310
- sideEffects?.onSuccess?.(result);
1311
- return renameKeysFromRESTResponseToSDKResponse(result.data);
1312
- } catch (err) {
1313
- const transformedError = sdkTransformError(
1314
- err,
1315
- {
1316
- spreadPathsToArguments: {},
1317
- explicitPathsToArguments: {},
1318
- singleArgumentUnchanged: false
1319
- },
1320
- []
1321
- );
1322
- sideEffects?.onError?.(err);
1323
- throw transformedError;
1324
- }
1325
- }
1326
1193
  async function exportParticipantsStats2(programId) {
1327
1194
  const { httpClient, sideEffects } = arguments[1];
1328
1195
  const payload = renameKeysFromSDKRequestToRESTRequest({
@@ -1349,51 +1216,71 @@ async function exportParticipantsStats2(programId) {
1349
1216
  }
1350
1217
 
1351
1218
  // src/online-programs-v3-participant-participants.public.ts
1352
- function joinProgram3(httpClient) {
1353
- return (programId) => joinProgram2(
1219
+ function createParticipant3(httpClient) {
1220
+ return (participant) => createParticipant2(
1221
+ participant,
1222
+ // @ts-ignore
1223
+ { httpClient }
1224
+ );
1225
+ }
1226
+ function bulkCreateParticipant3(httpClient) {
1227
+ return (participants, options) => bulkCreateParticipant2(
1228
+ participants,
1229
+ options,
1230
+ // @ts-ignore
1231
+ { httpClient }
1232
+ );
1233
+ }
1234
+ function bulkAddAllToProgram3(httpClient) {
1235
+ return (programId, options) => bulkAddAllToProgram2(
1354
1236
  programId,
1237
+ options,
1355
1238
  // @ts-ignore
1356
1239
  { httpClient }
1357
1240
  );
1358
1241
  }
1359
- function getParticipant3(httpClient) {
1360
- return (participantId) => getParticipant2(
1242
+ function deleteParticipant3(httpClient) {
1243
+ return (participantId) => deleteParticipant2(
1361
1244
  participantId,
1362
1245
  // @ts-ignore
1363
1246
  { httpClient }
1364
1247
  );
1365
1248
  }
1366
- function leaveProgram3(httpClient) {
1367
- return (participantId) => leaveProgram2(
1249
+ function issueCertificate3(httpClient) {
1250
+ return (participantId) => issueCertificate2(
1368
1251
  participantId,
1369
1252
  // @ts-ignore
1370
1253
  { httpClient }
1371
1254
  );
1372
1255
  }
1373
- function queryParticipants3(httpClient) {
1374
- return () => queryParticipants2(
1256
+ function getCompletionStats3(httpClient) {
1257
+ return (programId) => getCompletionStats2(
1258
+ programId,
1375
1259
  // @ts-ignore
1376
1260
  { httpClient }
1377
1261
  );
1378
1262
  }
1379
- function getAccessStatus3(httpClient) {
1380
- return () => getAccessStatus2(
1263
+ function getPremiumStats3(httpClient) {
1264
+ return () => getPremiumStats2(
1265
+ // @ts-ignore
1266
+ { httpClient }
1267
+ );
1268
+ }
1269
+ function getParticipant3(httpClient) {
1270
+ return (participantId) => getParticipant2(
1271
+ participantId,
1381
1272
  // @ts-ignore
1382
1273
  { httpClient }
1383
1274
  );
1384
1275
  }
1385
- function applyCoupon3(httpClient) {
1386
- return (identifiers, orderId) => applyCoupon2(
1387
- identifiers,
1388
- orderId,
1276
+ function queryParticipants3(httpClient) {
1277
+ return () => queryParticipants2(
1389
1278
  // @ts-ignore
1390
1279
  { httpClient }
1391
1280
  );
1392
1281
  }
1393
- function revertCoupon3(httpClient) {
1394
- return (identifiers, orderId) => revertCoupon2(
1395
- identifiers,
1396
- orderId,
1282
+ function getAccessStatus3(httpClient) {
1283
+ return () => getAccessStatus2(
1397
1284
  // @ts-ignore
1398
1285
  { httpClient }
1399
1286
  );
@@ -1422,14 +1309,6 @@ function bulkAddToProgram3(httpClient) {
1422
1309
  { httpClient }
1423
1310
  );
1424
1311
  }
1425
- function bulkAddAllToProgram3(httpClient) {
1426
- return (programId, options) => bulkAddAllToProgram2(
1427
- programId,
1428
- options,
1429
- // @ts-ignore
1430
- { httpClient }
1431
- );
1432
- }
1433
1312
  function bulkApproveParticipant3(httpClient) {
1434
1313
  return (participantIds, options) => bulkApproveParticipant2(
1435
1314
  participantIds,
@@ -1445,33 +1324,6 @@ function bulkApproveAllParticipant3(httpClient) {
1445
1324
  { httpClient }
1446
1325
  );
1447
1326
  }
1448
- function deleteParticipant3(httpClient) {
1449
- return (participantId) => deleteParticipant2(
1450
- participantId,
1451
- // @ts-ignore
1452
- { httpClient }
1453
- );
1454
- }
1455
- function issueCertificate3(httpClient) {
1456
- return (participantId) => issueCertificate2(
1457
- participantId,
1458
- // @ts-ignore
1459
- { httpClient }
1460
- );
1461
- }
1462
- function getCompletionStats3(httpClient) {
1463
- return (programId) => getCompletionStats2(
1464
- programId,
1465
- // @ts-ignore
1466
- { httpClient }
1467
- );
1468
- }
1469
- function getPremiumStats3(httpClient) {
1470
- return () => getPremiumStats2(
1471
- // @ts-ignore
1472
- { httpClient }
1473
- );
1474
- }
1475
1327
  function exportParticipantsStats3(httpClient) {
1476
1328
  return (programId) => exportParticipantsStats2(
1477
1329
  programId,
@@ -1479,62 +1331,8 @@ function exportParticipantsStats3(httpClient) {
1479
1331
  { httpClient }
1480
1332
  );
1481
1333
  }
1482
- var onParticipantJoined = EventDefinition(
1483
- "wix.online_programs.v3.participant_participant_joined",
1484
- true,
1485
- (event) => renameKeysFromRESTResponseToSDKResponse2(
1486
- transformPaths3(event, [
1487
- {
1488
- transformFn: transformRESTTimestampToSDKTimestamp2,
1489
- paths: [
1490
- { path: "data.participant.createdDate" },
1491
- { path: "data.participant.updatedDate" },
1492
- { path: "data.participant.certificate.issuedDate" },
1493
- { path: "metadata.eventTime" }
1494
- ]
1495
- },
1496
- {
1497
- transformFn: transformRESTFloatToSDKFloat2,
1498
- paths: [{ path: "data.participant.progress.completionPercentage" }]
1499
- }
1500
- ])
1501
- )
1502
- )();
1503
- var onParticipantLeft = EventDefinition(
1504
- "wix.online_programs.v3.participant_participant_left",
1505
- true,
1506
- (event) => renameKeysFromRESTResponseToSDKResponse2(
1507
- transformPaths3(event, [
1508
- {
1509
- transformFn: transformRESTTimestampToSDKTimestamp2,
1510
- paths: [{ path: "metadata.eventTime" }]
1511
- }
1512
- ])
1513
- )
1514
- )();
1515
- var onParticipantDeleted = EventDefinition(
1516
- "wix.online_programs.v3.participant_deleted",
1517
- true,
1518
- (event) => renameKeysFromRESTResponseToSDKResponse2(
1519
- transformPaths3(event, [
1520
- {
1521
- transformFn: transformRESTTimestampToSDKTimestamp2,
1522
- paths: [
1523
- { path: "entity.createdDate" },
1524
- { path: "entity.updatedDate" },
1525
- { path: "entity.certificate.issuedDate" },
1526
- { path: "metadata.eventTime" }
1527
- ]
1528
- },
1529
- {
1530
- transformFn: transformRESTFloatToSDKFloat2,
1531
- paths: [{ path: "entity.progress.completionPercentage" }]
1532
- }
1533
- ])
1534
- )
1535
- )();
1536
1334
  var onParticipantAdded = EventDefinition(
1537
- "wix.online_programs.v3.participant_participant_added",
1335
+ "wix.online_programs.v3.participant_added",
1538
1336
  true,
1539
1337
  (event) => renameKeysFromRESTResponseToSDKResponse2(
1540
1338
  transformPaths3(event, [
@@ -1569,47 +1367,26 @@ var onParticipantInvited = EventDefinition(
1569
1367
  ])
1570
1368
  )
1571
1369
  )();
1572
- var onParticipantRejected = EventDefinition(
1573
- "wix.online_programs.v3.participant_participant_rejected",
1574
- true,
1575
- (event) => renameKeysFromRESTResponseToSDKResponse2(
1576
- transformPaths3(event, [
1577
- {
1578
- transformFn: transformRESTTimestampToSDKTimestamp2,
1579
- paths: [{ path: "metadata.eventTime" }]
1580
- }
1581
- ])
1582
- )
1583
- )();
1584
1370
 
1585
1371
  // src/online-programs-v3-participant-participants.context.ts
1586
1372
  import { createRESTModule } from "@wix/sdk-runtime/rest-modules";
1587
1373
  import { createEventModule } from "@wix/sdk-runtime/event-definition-modules";
1588
- var joinProgram4 = /* @__PURE__ */ createRESTModule(joinProgram3);
1374
+ var createParticipant4 = /* @__PURE__ */ createRESTModule(createParticipant3);
1375
+ var bulkCreateParticipant4 = /* @__PURE__ */ createRESTModule(bulkCreateParticipant3);
1376
+ var bulkAddAllToProgram4 = /* @__PURE__ */ createRESTModule(bulkAddAllToProgram3);
1377
+ var deleteParticipant4 = /* @__PURE__ */ createRESTModule(deleteParticipant3);
1378
+ var issueCertificate4 = /* @__PURE__ */ createRESTModule(issueCertificate3);
1379
+ var getCompletionStats4 = /* @__PURE__ */ createRESTModule(getCompletionStats3);
1380
+ var getPremiumStats4 = /* @__PURE__ */ createRESTModule(getPremiumStats3);
1589
1381
  var getParticipant4 = /* @__PURE__ */ createRESTModule(getParticipant3);
1590
- var leaveProgram4 = /* @__PURE__ */ createRESTModule(leaveProgram3);
1591
1382
  var queryParticipants4 = /* @__PURE__ */ createRESTModule(queryParticipants3);
1592
1383
  var getAccessStatus4 = /* @__PURE__ */ createRESTModule(getAccessStatus3);
1593
- var applyCoupon4 = /* @__PURE__ */ createRESTModule(applyCoupon3);
1594
- var revertCoupon4 = /* @__PURE__ */ createRESTModule(revertCoupon3);
1595
1384
  var bulkInviteToProgram4 = /* @__PURE__ */ createRESTModule(bulkInviteToProgram3);
1596
1385
  var bulkInviteAllToProgram4 = /* @__PURE__ */ createRESTModule(bulkInviteAllToProgram3);
1597
1386
  var bulkAddToProgram4 = /* @__PURE__ */ createRESTModule(bulkAddToProgram3);
1598
- var bulkAddAllToProgram4 = /* @__PURE__ */ createRESTModule(bulkAddAllToProgram3);
1599
1387
  var bulkApproveParticipant4 = /* @__PURE__ */ createRESTModule(bulkApproveParticipant3);
1600
1388
  var bulkApproveAllParticipant4 = /* @__PURE__ */ createRESTModule(bulkApproveAllParticipant3);
1601
- var deleteParticipant4 = /* @__PURE__ */ createRESTModule(deleteParticipant3);
1602
- var issueCertificate4 = /* @__PURE__ */ createRESTModule(issueCertificate3);
1603
- var getCompletionStats4 = /* @__PURE__ */ createRESTModule(getCompletionStats3);
1604
- var getPremiumStats4 = /* @__PURE__ */ createRESTModule(getPremiumStats3);
1605
1389
  var exportParticipantsStats4 = /* @__PURE__ */ createRESTModule(exportParticipantsStats3);
1606
- var onParticipantJoined2 = createEventModule(
1607
- onParticipantJoined
1608
- );
1609
- var onParticipantLeft2 = createEventModule(onParticipantLeft);
1610
- var onParticipantDeleted2 = createEventModule(
1611
- onParticipantDeleted
1612
- );
1613
1390
  var onParticipantAdded2 = createEventModule(onParticipantAdded);
1614
1391
  var onParticipantApproved2 = createEventModule(
1615
1392
  onParticipantApproved
@@ -1617,33 +1394,21 @@ var onParticipantApproved2 = createEventModule(
1617
1394
  var onParticipantInvited2 = createEventModule(
1618
1395
  onParticipantInvited
1619
1396
  );
1620
- var onParticipantRejected2 = createEventModule(
1621
- onParticipantRejected
1622
- );
1623
1397
  export {
1624
1398
  BenefitType,
1625
1399
  Event,
1626
- EventType,
1627
- Initiator,
1628
1400
  JoinPath,
1629
- OrderItemCategory,
1630
- RefundStatus,
1631
- RemovalReason,
1632
- ScheduledActionType,
1633
1401
  SortOrder,
1634
1402
  State,
1635
- Status,
1636
- SubdivisionType,
1637
- TransactionStatus,
1638
- VatType,
1639
1403
  WebhookIdentityType,
1640
- applyCoupon4 as applyCoupon,
1641
1404
  bulkAddAllToProgram4 as bulkAddAllToProgram,
1642
1405
  bulkAddToProgram4 as bulkAddToProgram,
1643
1406
  bulkApproveAllParticipant4 as bulkApproveAllParticipant,
1644
1407
  bulkApproveParticipant4 as bulkApproveParticipant,
1408
+ bulkCreateParticipant4 as bulkCreateParticipant,
1645
1409
  bulkInviteAllToProgram4 as bulkInviteAllToProgram,
1646
1410
  bulkInviteToProgram4 as bulkInviteToProgram,
1411
+ createParticipant4 as createParticipant,
1647
1412
  deleteParticipant4 as deleteParticipant,
1648
1413
  exportParticipantsStats4 as exportParticipantsStats,
1649
1414
  getAccessStatus4 as getAccessStatus,
@@ -1651,16 +1416,9 @@ export {
1651
1416
  getParticipant4 as getParticipant,
1652
1417
  getPremiumStats4 as getPremiumStats,
1653
1418
  issueCertificate4 as issueCertificate,
1654
- joinProgram4 as joinProgram,
1655
- leaveProgram4 as leaveProgram,
1656
1419
  onParticipantAdded2 as onParticipantAdded,
1657
1420
  onParticipantApproved2 as onParticipantApproved,
1658
- onParticipantDeleted2 as onParticipantDeleted,
1659
1421
  onParticipantInvited2 as onParticipantInvited,
1660
- onParticipantJoined2 as onParticipantJoined,
1661
- onParticipantLeft2 as onParticipantLeft,
1662
- onParticipantRejected2 as onParticipantRejected,
1663
- queryParticipants4 as queryParticipants,
1664
- revertCoupon4 as revertCoupon
1422
+ queryParticipants4 as queryParticipants
1665
1423
  };
1666
1424
  //# sourceMappingURL=index.mjs.map