@wix/auto_sdk_benefit-programs_programs 1.0.49 → 1.0.50
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.
- package/build/cjs/index.d.ts +8 -24
- package/build/cjs/index.js +29 -912
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.js +9 -892
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/schemas.d.ts +1 -1
- package/build/es/index.d.mts +8 -24
- package/build/es/index.mjs +29 -902
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.mjs +9 -882
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/schemas.d.mts +1 -1
- package/build/internal/cjs/index.d.ts +8 -24
- package/build/internal/cjs/index.js +29 -912
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.js +9 -892
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +1 -1
- package/build/internal/es/index.d.mts +8 -24
- package/build/internal/es/index.mjs +29 -902
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.mjs +9 -882
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// index.typings.ts
|
|
@@ -402,849 +392,6 @@ function getProgramByExternalIdAndNamespace(payload) {
|
|
|
402
392
|
|
|
403
393
|
// src/benefit-programs-v1-program-programs.universal.ts
|
|
404
394
|
var import_transform_paths2 = require("@wix/sdk-runtime/transformations/transform-paths");
|
|
405
|
-
|
|
406
|
-
// src/benefit-programs-v1-program-programs.schemas.ts
|
|
407
|
-
var z = __toESM(require("zod"));
|
|
408
|
-
var ProvisionProgramRequest = z.object({
|
|
409
|
-
poolDefinitionLookupId: z.intersection(
|
|
410
|
-
z.object({}),
|
|
411
|
-
z.xor([
|
|
412
|
-
z.object({
|
|
413
|
-
poolDefinitionId: z.never().optional(),
|
|
414
|
-
programDefinitionId: z.never().optional()
|
|
415
|
-
}),
|
|
416
|
-
z.object({
|
|
417
|
-
programDefinitionId: z.never().optional(),
|
|
418
|
-
poolDefinitionId: z.string().describe("Pool definition ID.").regex(
|
|
419
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
420
|
-
"Must be a valid GUID"
|
|
421
|
-
)
|
|
422
|
-
}),
|
|
423
|
-
z.object({
|
|
424
|
-
poolDefinitionId: z.never().optional(),
|
|
425
|
-
programDefinitionId: z.string().describe("Program definition ID.").regex(
|
|
426
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
427
|
-
"Must be a valid GUID"
|
|
428
|
-
)
|
|
429
|
-
})
|
|
430
|
-
])
|
|
431
|
-
).describe(
|
|
432
|
-
"The program definition or pool definition to use to provision the program."
|
|
433
|
-
),
|
|
434
|
-
options: z.object({
|
|
435
|
-
beneficiary: z.intersection(
|
|
436
|
-
z.object({}),
|
|
437
|
-
z.xor([
|
|
438
|
-
z.object({
|
|
439
|
-
anonymousVisitorId: z.never().optional(),
|
|
440
|
-
memberId: z.never().optional(),
|
|
441
|
-
wixUserId: z.never().optional()
|
|
442
|
-
}),
|
|
443
|
-
z.object({
|
|
444
|
-
memberId: z.never().optional(),
|
|
445
|
-
wixUserId: z.never().optional(),
|
|
446
|
-
anonymousVisitorId: z.string().describe(
|
|
447
|
-
"ID of a site visitor that hasn't logged in to the site."
|
|
448
|
-
).regex(
|
|
449
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
450
|
-
"Must be a valid GUID"
|
|
451
|
-
)
|
|
452
|
-
}),
|
|
453
|
-
z.object({
|
|
454
|
-
anonymousVisitorId: z.never().optional(),
|
|
455
|
-
wixUserId: z.never().optional(),
|
|
456
|
-
memberId: z.string().describe("ID of a site member.").regex(
|
|
457
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
458
|
-
"Must be a valid GUID"
|
|
459
|
-
)
|
|
460
|
-
}),
|
|
461
|
-
z.object({
|
|
462
|
-
anonymousVisitorId: z.never().optional(),
|
|
463
|
-
memberId: z.never().optional(),
|
|
464
|
-
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
465
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
466
|
-
"Must be a valid GUID"
|
|
467
|
-
)
|
|
468
|
-
})
|
|
469
|
-
])
|
|
470
|
-
).describe("Program beneficiary."),
|
|
471
|
-
programStatus: z.enum(["ACTIVE", "PAUSED"]).optional(),
|
|
472
|
-
namespace: z.string().describe(
|
|
473
|
-
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
474
|
-
).min(1).max(20),
|
|
475
|
-
displayName: z.string().describe(
|
|
476
|
-
"Program name.\n\nIf you're provisioning the program from a program definition, you may want to use the same name that was used for the program definition."
|
|
477
|
-
).max(64).optional().nullable(),
|
|
478
|
-
externalProgramId: z.string().describe(
|
|
479
|
-
"ID for the program defined by you. You can use `externalId` to filter queries."
|
|
480
|
-
).regex(
|
|
481
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
482
|
-
"Must be a valid GUID"
|
|
483
|
-
)
|
|
484
|
-
})
|
|
485
|
-
});
|
|
486
|
-
var ProvisionProgramResponse = z.object({
|
|
487
|
-
jobId: z.string().describe(
|
|
488
|
-
"Job ID of the provisioning of the program. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
|
|
489
|
-
).regex(
|
|
490
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
491
|
-
"Must be a valid GUID"
|
|
492
|
-
).optional(),
|
|
493
|
-
program: z.object({
|
|
494
|
-
_id: z.string().describe("Program ID.").regex(
|
|
495
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
496
|
-
"Must be a valid GUID"
|
|
497
|
-
).optional().nullable(),
|
|
498
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
499
|
-
"Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
|
|
500
|
-
).optional().nullable(),
|
|
501
|
-
_createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
|
|
502
|
-
_updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
|
|
503
|
-
programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
|
|
504
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
505
|
-
"Must be a valid GUID"
|
|
506
|
-
).optional().nullable(),
|
|
507
|
-
status: z.enum([
|
|
508
|
-
"ACTIVE",
|
|
509
|
-
"PAUSED",
|
|
510
|
-
"ENDED",
|
|
511
|
-
"PROVISIONING",
|
|
512
|
-
"PAUSING",
|
|
513
|
-
"RESUMING",
|
|
514
|
-
"ENDING"
|
|
515
|
-
]).describe("Program status.").optional(),
|
|
516
|
-
beneficiary: z.intersection(
|
|
517
|
-
z.object({}),
|
|
518
|
-
z.xor([
|
|
519
|
-
z.object({
|
|
520
|
-
anonymousVisitorId: z.never().optional(),
|
|
521
|
-
memberId: z.never().optional(),
|
|
522
|
-
wixUserId: z.never().optional()
|
|
523
|
-
}),
|
|
524
|
-
z.object({
|
|
525
|
-
memberId: z.never().optional(),
|
|
526
|
-
wixUserId: z.never().optional(),
|
|
527
|
-
anonymousVisitorId: z.string().describe(
|
|
528
|
-
"ID of a site visitor that hasn't logged in to the site."
|
|
529
|
-
).regex(
|
|
530
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
531
|
-
"Must be a valid GUID"
|
|
532
|
-
)
|
|
533
|
-
}),
|
|
534
|
-
z.object({
|
|
535
|
-
anonymousVisitorId: z.never().optional(),
|
|
536
|
-
wixUserId: z.never().optional(),
|
|
537
|
-
memberId: z.string().describe("ID of a site member.").regex(
|
|
538
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
539
|
-
"Must be a valid GUID"
|
|
540
|
-
)
|
|
541
|
-
}),
|
|
542
|
-
z.object({
|
|
543
|
-
anonymousVisitorId: z.never().optional(),
|
|
544
|
-
memberId: z.never().optional(),
|
|
545
|
-
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
546
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
547
|
-
"Must be a valid GUID"
|
|
548
|
-
)
|
|
549
|
-
})
|
|
550
|
-
])
|
|
551
|
-
).describe("Program beneficiary.").optional(),
|
|
552
|
-
displayName: z.string().describe(
|
|
553
|
-
"Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
|
|
554
|
-
).max(64).optional().nullable(),
|
|
555
|
-
namespace: z.string().describe(
|
|
556
|
-
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
557
|
-
).min(1).max(20).optional().nullable(),
|
|
558
|
-
extendedFields: z.object({
|
|
559
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
560
|
-
"Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
|
|
561
|
-
).optional()
|
|
562
|
-
}).describe(
|
|
563
|
-
"Custom field data for the program object.\n\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
|
|
564
|
-
).optional(),
|
|
565
|
-
externalId: z.string().describe(
|
|
566
|
-
"ID for the program defined by you. You can use `externalId` to filter queries."
|
|
567
|
-
).regex(
|
|
568
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
569
|
-
"Must be a valid GUID"
|
|
570
|
-
).optional().nullable(),
|
|
571
|
-
programDefinition: z.object({
|
|
572
|
-
_id: z.string().describe("Program definition ID.").regex(
|
|
573
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
574
|
-
"Must be a valid GUID"
|
|
575
|
-
).optional(),
|
|
576
|
-
externalId: z.string().describe("Program definition external ID.").regex(
|
|
577
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
578
|
-
"Must be a valid GUID"
|
|
579
|
-
).optional().nullable()
|
|
580
|
-
}).describe("Associated program definition information.").optional()
|
|
581
|
-
}).describe("Provisioned program.").optional()
|
|
582
|
-
});
|
|
583
|
-
var RenewProgramRequest = z.object({
|
|
584
|
-
programId: z.string().describe("ID of the program to renew.").regex(
|
|
585
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
586
|
-
"Must be a valid GUID"
|
|
587
|
-
),
|
|
588
|
-
options: z.object({
|
|
589
|
-
idempotencyKey: z.string().describe(
|
|
590
|
-
"Idempotency key to ensure that the request is processed only once."
|
|
591
|
-
).max(64)
|
|
592
|
-
})
|
|
593
|
-
});
|
|
594
|
-
var RenewProgramResponse = z.object({
|
|
595
|
-
jobId: z.string().describe(
|
|
596
|
-
"Job ID of the program renewal. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
|
|
597
|
-
).regex(
|
|
598
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
599
|
-
"Must be a valid GUID"
|
|
600
|
-
).optional()
|
|
601
|
-
});
|
|
602
|
-
var PauseProgramRequest = z.object({
|
|
603
|
-
programId: z.string().describe("ID of the program to pause.").regex(
|
|
604
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
605
|
-
"Must be a valid GUID"
|
|
606
|
-
),
|
|
607
|
-
options: z.object({
|
|
608
|
-
idempotencyKey: z.string().describe(
|
|
609
|
-
"Idempotency key to ensure that the request is processed only once."
|
|
610
|
-
).max(64)
|
|
611
|
-
})
|
|
612
|
-
});
|
|
613
|
-
var PauseProgramResponse = z.object({
|
|
614
|
-
jobId: z.string().describe(
|
|
615
|
-
"Job ID of the pausing of the program. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
|
|
616
|
-
).regex(
|
|
617
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
618
|
-
"Must be a valid GUID"
|
|
619
|
-
).optional()
|
|
620
|
-
});
|
|
621
|
-
var ResumeProgramRequest = z.object({
|
|
622
|
-
programId: z.string().describe("ID of program to resume.").regex(
|
|
623
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
624
|
-
"Must be a valid GUID"
|
|
625
|
-
),
|
|
626
|
-
options: z.object({
|
|
627
|
-
idempotencyKey: z.string().describe(
|
|
628
|
-
"Idempotency key to ensure that the request is processed only once."
|
|
629
|
-
).max(64)
|
|
630
|
-
})
|
|
631
|
-
});
|
|
632
|
-
var ResumeProgramResponse = z.object({
|
|
633
|
-
jobId: z.string().describe(
|
|
634
|
-
"Job ID of the resuming of the program. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
|
|
635
|
-
).regex(
|
|
636
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
637
|
-
"Must be a valid GUID"
|
|
638
|
-
).optional()
|
|
639
|
-
});
|
|
640
|
-
var EndProgramRequest = z.object({
|
|
641
|
-
programId: z.string().describe("ID of the program to end.").regex(
|
|
642
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
643
|
-
"Must be a valid GUID"
|
|
644
|
-
)
|
|
645
|
-
});
|
|
646
|
-
var EndProgramResponse = z.object({
|
|
647
|
-
jobId: z.string().describe(
|
|
648
|
-
"Job ID of the ending of the program. Retrieve job details using the [Async Job API](https://dev.wix.com/docs/rest/business-management/async-job/introduction)."
|
|
649
|
-
).regex(
|
|
650
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
651
|
-
"Must be a valid GUID"
|
|
652
|
-
).optional()
|
|
653
|
-
});
|
|
654
|
-
var UpdateProgramRequest = z.object({
|
|
655
|
-
_id: z.string().describe("Program ID.").regex(
|
|
656
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
657
|
-
"Must be a valid GUID"
|
|
658
|
-
),
|
|
659
|
-
program: z.object({
|
|
660
|
-
_id: z.string().describe("Program ID.").regex(
|
|
661
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
662
|
-
"Must be a valid GUID"
|
|
663
|
-
).optional().nullable(),
|
|
664
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
665
|
-
"Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
|
|
666
|
-
),
|
|
667
|
-
_createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
|
|
668
|
-
_updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
|
|
669
|
-
programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
|
|
670
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
671
|
-
"Must be a valid GUID"
|
|
672
|
-
).optional().nullable(),
|
|
673
|
-
status: z.enum([
|
|
674
|
-
"ACTIVE",
|
|
675
|
-
"PAUSED",
|
|
676
|
-
"ENDED",
|
|
677
|
-
"PROVISIONING",
|
|
678
|
-
"PAUSING",
|
|
679
|
-
"RESUMING",
|
|
680
|
-
"ENDING"
|
|
681
|
-
]).optional(),
|
|
682
|
-
beneficiary: z.intersection(
|
|
683
|
-
z.object({}),
|
|
684
|
-
z.xor([
|
|
685
|
-
z.object({
|
|
686
|
-
anonymousVisitorId: z.never().optional(),
|
|
687
|
-
memberId: z.never().optional(),
|
|
688
|
-
wixUserId: z.never().optional()
|
|
689
|
-
}),
|
|
690
|
-
z.object({
|
|
691
|
-
memberId: z.never().optional(),
|
|
692
|
-
wixUserId: z.never().optional(),
|
|
693
|
-
anonymousVisitorId: z.string().describe(
|
|
694
|
-
"ID of a site visitor that hasn't logged in to the site."
|
|
695
|
-
).regex(
|
|
696
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
697
|
-
"Must be a valid GUID"
|
|
698
|
-
)
|
|
699
|
-
}),
|
|
700
|
-
z.object({
|
|
701
|
-
anonymousVisitorId: z.never().optional(),
|
|
702
|
-
wixUserId: z.never().optional(),
|
|
703
|
-
memberId: z.string().describe("ID of a site member.").regex(
|
|
704
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
705
|
-
"Must be a valid GUID"
|
|
706
|
-
)
|
|
707
|
-
}),
|
|
708
|
-
z.object({
|
|
709
|
-
anonymousVisitorId: z.never().optional(),
|
|
710
|
-
memberId: z.never().optional(),
|
|
711
|
-
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
712
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
713
|
-
"Must be a valid GUID"
|
|
714
|
-
)
|
|
715
|
-
})
|
|
716
|
-
])
|
|
717
|
-
).describe("Program beneficiary.").optional(),
|
|
718
|
-
displayName: z.string().describe(
|
|
719
|
-
"Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
|
|
720
|
-
).max(64).optional().nullable(),
|
|
721
|
-
namespace: z.string().describe(
|
|
722
|
-
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
723
|
-
).min(1).max(20).optional().nullable(),
|
|
724
|
-
extendedFields: z.object({
|
|
725
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
726
|
-
"Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
|
|
727
|
-
).optional()
|
|
728
|
-
}).describe(
|
|
729
|
-
"Custom field data for the program object.\n\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
|
|
730
|
-
).optional(),
|
|
731
|
-
externalId: z.string().describe(
|
|
732
|
-
"ID for the program defined by you. You can use `externalId` to filter queries."
|
|
733
|
-
).regex(
|
|
734
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
735
|
-
"Must be a valid GUID"
|
|
736
|
-
).optional().nullable(),
|
|
737
|
-
programDefinition: z.object({
|
|
738
|
-
_id: z.string().describe("Program definition ID.").regex(
|
|
739
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
740
|
-
"Must be a valid GUID"
|
|
741
|
-
).optional(),
|
|
742
|
-
externalId: z.string().describe("Program definition external ID.").regex(
|
|
743
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
744
|
-
"Must be a valid GUID"
|
|
745
|
-
).optional().nullable()
|
|
746
|
-
}).describe("Associated program definition information.").optional()
|
|
747
|
-
}).describe("Program to update.")
|
|
748
|
-
});
|
|
749
|
-
var UpdateProgramResponse = z.object({
|
|
750
|
-
_id: z.string().describe("Program ID.").regex(
|
|
751
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
752
|
-
"Must be a valid GUID"
|
|
753
|
-
).optional().nullable(),
|
|
754
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
755
|
-
"Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
|
|
756
|
-
).optional().nullable(),
|
|
757
|
-
_createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
|
|
758
|
-
_updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
|
|
759
|
-
programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
|
|
760
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
761
|
-
"Must be a valid GUID"
|
|
762
|
-
).optional().nullable(),
|
|
763
|
-
status: z.enum([
|
|
764
|
-
"ACTIVE",
|
|
765
|
-
"PAUSED",
|
|
766
|
-
"ENDED",
|
|
767
|
-
"PROVISIONING",
|
|
768
|
-
"PAUSING",
|
|
769
|
-
"RESUMING",
|
|
770
|
-
"ENDING"
|
|
771
|
-
]).describe("Program status.").optional(),
|
|
772
|
-
beneficiary: z.intersection(
|
|
773
|
-
z.object({}),
|
|
774
|
-
z.xor([
|
|
775
|
-
z.object({
|
|
776
|
-
anonymousVisitorId: z.never().optional(),
|
|
777
|
-
memberId: z.never().optional(),
|
|
778
|
-
wixUserId: z.never().optional()
|
|
779
|
-
}),
|
|
780
|
-
z.object({
|
|
781
|
-
memberId: z.never().optional(),
|
|
782
|
-
wixUserId: z.never().optional(),
|
|
783
|
-
anonymousVisitorId: z.string().describe("ID of a site visitor that hasn't logged in to the site.").regex(
|
|
784
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
785
|
-
"Must be a valid GUID"
|
|
786
|
-
)
|
|
787
|
-
}),
|
|
788
|
-
z.object({
|
|
789
|
-
anonymousVisitorId: z.never().optional(),
|
|
790
|
-
wixUserId: z.never().optional(),
|
|
791
|
-
memberId: z.string().describe("ID of a site member.").regex(
|
|
792
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
793
|
-
"Must be a valid GUID"
|
|
794
|
-
)
|
|
795
|
-
}),
|
|
796
|
-
z.object({
|
|
797
|
-
anonymousVisitorId: z.never().optional(),
|
|
798
|
-
memberId: z.never().optional(),
|
|
799
|
-
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
800
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
801
|
-
"Must be a valid GUID"
|
|
802
|
-
)
|
|
803
|
-
})
|
|
804
|
-
])
|
|
805
|
-
).describe("Program beneficiary.").optional(),
|
|
806
|
-
displayName: z.string().describe(
|
|
807
|
-
"Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
|
|
808
|
-
).max(64).optional().nullable(),
|
|
809
|
-
namespace: z.string().describe(
|
|
810
|
-
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
811
|
-
).min(1).max(20).optional().nullable(),
|
|
812
|
-
extendedFields: z.object({
|
|
813
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
814
|
-
"Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
|
|
815
|
-
).optional()
|
|
816
|
-
}).describe(
|
|
817
|
-
"Custom field data for the program object.\n\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
|
|
818
|
-
).optional(),
|
|
819
|
-
externalId: z.string().describe(
|
|
820
|
-
"ID for the program defined by you. You can use `externalId` to filter queries."
|
|
821
|
-
).regex(
|
|
822
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
823
|
-
"Must be a valid GUID"
|
|
824
|
-
).optional().nullable(),
|
|
825
|
-
programDefinition: z.object({
|
|
826
|
-
_id: z.string().describe("Program definition ID.").regex(
|
|
827
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
828
|
-
"Must be a valid GUID"
|
|
829
|
-
).optional(),
|
|
830
|
-
externalId: z.string().describe("Program definition external ID.").regex(
|
|
831
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
832
|
-
"Must be a valid GUID"
|
|
833
|
-
).optional().nullable()
|
|
834
|
-
}).describe("Associated program definition information.").optional()
|
|
835
|
-
});
|
|
836
|
-
var GetProgramRequest = z.object({
|
|
837
|
-
programId: z.string().describe("ID of the program to retrieve.").regex(
|
|
838
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
839
|
-
"Must be a valid GUID"
|
|
840
|
-
)
|
|
841
|
-
});
|
|
842
|
-
var GetProgramResponse = z.object({
|
|
843
|
-
_id: z.string().describe("Program ID.").regex(
|
|
844
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
845
|
-
"Must be a valid GUID"
|
|
846
|
-
).optional().nullable(),
|
|
847
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
848
|
-
"Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
|
|
849
|
-
).optional().nullable(),
|
|
850
|
-
_createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
|
|
851
|
-
_updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
|
|
852
|
-
programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
|
|
853
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
854
|
-
"Must be a valid GUID"
|
|
855
|
-
).optional().nullable(),
|
|
856
|
-
status: z.enum([
|
|
857
|
-
"ACTIVE",
|
|
858
|
-
"PAUSED",
|
|
859
|
-
"ENDED",
|
|
860
|
-
"PROVISIONING",
|
|
861
|
-
"PAUSING",
|
|
862
|
-
"RESUMING",
|
|
863
|
-
"ENDING"
|
|
864
|
-
]).describe("Program status.").optional(),
|
|
865
|
-
beneficiary: z.intersection(
|
|
866
|
-
z.object({}),
|
|
867
|
-
z.xor([
|
|
868
|
-
z.object({
|
|
869
|
-
anonymousVisitorId: z.never().optional(),
|
|
870
|
-
memberId: z.never().optional(),
|
|
871
|
-
wixUserId: z.never().optional()
|
|
872
|
-
}),
|
|
873
|
-
z.object({
|
|
874
|
-
memberId: z.never().optional(),
|
|
875
|
-
wixUserId: z.never().optional(),
|
|
876
|
-
anonymousVisitorId: z.string().describe("ID of a site visitor that hasn't logged in to the site.").regex(
|
|
877
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
878
|
-
"Must be a valid GUID"
|
|
879
|
-
)
|
|
880
|
-
}),
|
|
881
|
-
z.object({
|
|
882
|
-
anonymousVisitorId: z.never().optional(),
|
|
883
|
-
wixUserId: z.never().optional(),
|
|
884
|
-
memberId: z.string().describe("ID of a site member.").regex(
|
|
885
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
886
|
-
"Must be a valid GUID"
|
|
887
|
-
)
|
|
888
|
-
}),
|
|
889
|
-
z.object({
|
|
890
|
-
anonymousVisitorId: z.never().optional(),
|
|
891
|
-
memberId: z.never().optional(),
|
|
892
|
-
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
893
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
894
|
-
"Must be a valid GUID"
|
|
895
|
-
)
|
|
896
|
-
})
|
|
897
|
-
])
|
|
898
|
-
).describe("Program beneficiary.").optional(),
|
|
899
|
-
displayName: z.string().describe(
|
|
900
|
-
"Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
|
|
901
|
-
).max(64).optional().nullable(),
|
|
902
|
-
namespace: z.string().describe(
|
|
903
|
-
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
904
|
-
).min(1).max(20).optional().nullable(),
|
|
905
|
-
extendedFields: z.object({
|
|
906
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
907
|
-
"Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
|
|
908
|
-
).optional()
|
|
909
|
-
}).describe(
|
|
910
|
-
"Custom field data for the program object.\n\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
|
|
911
|
-
).optional(),
|
|
912
|
-
externalId: z.string().describe(
|
|
913
|
-
"ID for the program defined by you. You can use `externalId` to filter queries."
|
|
914
|
-
).regex(
|
|
915
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
916
|
-
"Must be a valid GUID"
|
|
917
|
-
).optional().nullable(),
|
|
918
|
-
programDefinition: z.object({
|
|
919
|
-
_id: z.string().describe("Program definition ID.").regex(
|
|
920
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
921
|
-
"Must be a valid GUID"
|
|
922
|
-
).optional(),
|
|
923
|
-
externalId: z.string().describe("Program definition external ID.").regex(
|
|
924
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
925
|
-
"Must be a valid GUID"
|
|
926
|
-
).optional().nullable()
|
|
927
|
-
}).describe("Associated program definition information.").optional()
|
|
928
|
-
});
|
|
929
|
-
var QueryProgramsRequest = z.object({
|
|
930
|
-
query: z.object({
|
|
931
|
-
filter: z.object({
|
|
932
|
-
_id: z.object({
|
|
933
|
-
$eq: z.string(),
|
|
934
|
-
$exists: z.boolean(),
|
|
935
|
-
$gt: z.string(),
|
|
936
|
-
$gte: z.string(),
|
|
937
|
-
$hasAll: z.array(z.string()),
|
|
938
|
-
$hasSome: z.array(z.string()),
|
|
939
|
-
$in: z.array(z.string()),
|
|
940
|
-
$lt: z.string(),
|
|
941
|
-
$lte: z.string(),
|
|
942
|
-
$ne: z.string(),
|
|
943
|
-
$nin: z.array(z.string()),
|
|
944
|
-
$startsWith: z.string()
|
|
945
|
-
}).partial().strict().optional(),
|
|
946
|
-
namespace: z.object({
|
|
947
|
-
$eq: z.string(),
|
|
948
|
-
$exists: z.boolean(),
|
|
949
|
-
$gt: z.string(),
|
|
950
|
-
$gte: z.string(),
|
|
951
|
-
$hasAll: z.array(z.string()),
|
|
952
|
-
$hasSome: z.array(z.string()),
|
|
953
|
-
$in: z.array(z.string()),
|
|
954
|
-
$lt: z.string(),
|
|
955
|
-
$lte: z.string(),
|
|
956
|
-
$ne: z.string(),
|
|
957
|
-
$nin: z.array(z.string()),
|
|
958
|
-
$startsWith: z.string()
|
|
959
|
-
}).partial().strict().optional(),
|
|
960
|
-
externalId: z.object({
|
|
961
|
-
$eq: z.string(),
|
|
962
|
-
$exists: z.boolean(),
|
|
963
|
-
$gt: z.string(),
|
|
964
|
-
$gte: z.string(),
|
|
965
|
-
$hasAll: z.array(z.string()),
|
|
966
|
-
$hasSome: z.array(z.string()),
|
|
967
|
-
$in: z.array(z.string()),
|
|
968
|
-
$lt: z.string(),
|
|
969
|
-
$lte: z.string(),
|
|
970
|
-
$ne: z.string(),
|
|
971
|
-
$nin: z.array(z.string()),
|
|
972
|
-
$startsWith: z.string()
|
|
973
|
-
}).partial().strict().optional(),
|
|
974
|
-
programDefinitionId: z.object({
|
|
975
|
-
$eq: z.string(),
|
|
976
|
-
$exists: z.boolean(),
|
|
977
|
-
$gt: z.string(),
|
|
978
|
-
$gte: z.string(),
|
|
979
|
-
$hasAll: z.array(z.string()),
|
|
980
|
-
$hasSome: z.array(z.string()),
|
|
981
|
-
$in: z.array(z.string()),
|
|
982
|
-
$lt: z.string(),
|
|
983
|
-
$lte: z.string(),
|
|
984
|
-
$ne: z.string(),
|
|
985
|
-
$nin: z.array(z.string()),
|
|
986
|
-
$startsWith: z.string()
|
|
987
|
-
}).partial().strict().optional(),
|
|
988
|
-
status: z.object({
|
|
989
|
-
$eq: z.string(),
|
|
990
|
-
$exists: z.boolean(),
|
|
991
|
-
$gt: z.string(),
|
|
992
|
-
$gte: z.string(),
|
|
993
|
-
$hasAll: z.array(z.string()),
|
|
994
|
-
$hasSome: z.array(z.string()),
|
|
995
|
-
$in: z.array(z.string()),
|
|
996
|
-
$lt: z.string(),
|
|
997
|
-
$lte: z.string(),
|
|
998
|
-
$ne: z.string(),
|
|
999
|
-
$nin: z.array(z.string()),
|
|
1000
|
-
$startsWith: z.string()
|
|
1001
|
-
}).partial().strict().optional(),
|
|
1002
|
-
_createdDate: z.object({
|
|
1003
|
-
$eq: z.string(),
|
|
1004
|
-
$exists: z.boolean(),
|
|
1005
|
-
$gt: z.string(),
|
|
1006
|
-
$gte: z.string(),
|
|
1007
|
-
$hasAll: z.array(z.string()),
|
|
1008
|
-
$hasSome: z.array(z.string()),
|
|
1009
|
-
$in: z.array(z.string()),
|
|
1010
|
-
$lt: z.string(),
|
|
1011
|
-
$lte: z.string(),
|
|
1012
|
-
$ne: z.string(),
|
|
1013
|
-
$nin: z.array(z.string()),
|
|
1014
|
-
$startsWith: z.string()
|
|
1015
|
-
}).partial().strict().optional(),
|
|
1016
|
-
$and: z.array(z.any()).optional(),
|
|
1017
|
-
$or: z.array(z.any()).optional(),
|
|
1018
|
-
$not: z.any().optional()
|
|
1019
|
-
}).strict().optional(),
|
|
1020
|
-
sort: z.array(
|
|
1021
|
-
z.object({
|
|
1022
|
-
fieldName: z.enum([
|
|
1023
|
-
"_id",
|
|
1024
|
-
"namespace",
|
|
1025
|
-
"externalId",
|
|
1026
|
-
"programDefinitionId",
|
|
1027
|
-
"status",
|
|
1028
|
-
"_createdDate"
|
|
1029
|
-
]).optional(),
|
|
1030
|
-
order: z.enum(["ASC", "DESC"]).optional()
|
|
1031
|
-
})
|
|
1032
|
-
).optional()
|
|
1033
|
-
}).catchall(z.any()).describe("Filter, sort, and paging to apply to the query.")
|
|
1034
|
-
});
|
|
1035
|
-
var QueryProgramsResponse = z.object({
|
|
1036
|
-
programs: z.array(
|
|
1037
|
-
z.object({
|
|
1038
|
-
_id: z.string().describe("Program ID.").regex(
|
|
1039
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1040
|
-
"Must be a valid GUID"
|
|
1041
|
-
).optional().nullable(),
|
|
1042
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1043
|
-
"Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
|
|
1044
|
-
).optional().nullable(),
|
|
1045
|
-
_createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
|
|
1046
|
-
_updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
|
|
1047
|
-
programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
|
|
1048
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1049
|
-
"Must be a valid GUID"
|
|
1050
|
-
).optional().nullable(),
|
|
1051
|
-
status: z.enum([
|
|
1052
|
-
"ACTIVE",
|
|
1053
|
-
"PAUSED",
|
|
1054
|
-
"ENDED",
|
|
1055
|
-
"PROVISIONING",
|
|
1056
|
-
"PAUSING",
|
|
1057
|
-
"RESUMING",
|
|
1058
|
-
"ENDING"
|
|
1059
|
-
]).describe("Program status.").optional(),
|
|
1060
|
-
beneficiary: z.intersection(
|
|
1061
|
-
z.object({}),
|
|
1062
|
-
z.xor([
|
|
1063
|
-
z.object({
|
|
1064
|
-
anonymousVisitorId: z.never().optional(),
|
|
1065
|
-
memberId: z.never().optional(),
|
|
1066
|
-
wixUserId: z.never().optional()
|
|
1067
|
-
}),
|
|
1068
|
-
z.object({
|
|
1069
|
-
memberId: z.never().optional(),
|
|
1070
|
-
wixUserId: z.never().optional(),
|
|
1071
|
-
anonymousVisitorId: z.string().describe(
|
|
1072
|
-
"ID of a site visitor that hasn't logged in to the site."
|
|
1073
|
-
).regex(
|
|
1074
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1075
|
-
"Must be a valid GUID"
|
|
1076
|
-
)
|
|
1077
|
-
}),
|
|
1078
|
-
z.object({
|
|
1079
|
-
anonymousVisitorId: z.never().optional(),
|
|
1080
|
-
wixUserId: z.never().optional(),
|
|
1081
|
-
memberId: z.string().describe("ID of a site member.").regex(
|
|
1082
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1083
|
-
"Must be a valid GUID"
|
|
1084
|
-
)
|
|
1085
|
-
}),
|
|
1086
|
-
z.object({
|
|
1087
|
-
anonymousVisitorId: z.never().optional(),
|
|
1088
|
-
memberId: z.never().optional(),
|
|
1089
|
-
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
1090
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1091
|
-
"Must be a valid GUID"
|
|
1092
|
-
)
|
|
1093
|
-
})
|
|
1094
|
-
])
|
|
1095
|
-
).describe("Program beneficiary.").optional(),
|
|
1096
|
-
displayName: z.string().describe(
|
|
1097
|
-
"Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
|
|
1098
|
-
).max(64).optional().nullable(),
|
|
1099
|
-
namespace: z.string().describe(
|
|
1100
|
-
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
1101
|
-
).min(1).max(20).optional().nullable(),
|
|
1102
|
-
extendedFields: z.object({
|
|
1103
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
1104
|
-
"Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
|
|
1105
|
-
).optional()
|
|
1106
|
-
}).describe(
|
|
1107
|
-
"Custom field data for the program object.\n\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
|
|
1108
|
-
).optional(),
|
|
1109
|
-
externalId: z.string().describe(
|
|
1110
|
-
"ID for the program defined by you. You can use `externalId` to filter queries."
|
|
1111
|
-
).regex(
|
|
1112
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1113
|
-
"Must be a valid GUID"
|
|
1114
|
-
).optional().nullable(),
|
|
1115
|
-
programDefinition: z.object({
|
|
1116
|
-
_id: z.string().describe("Program definition ID.").regex(
|
|
1117
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1118
|
-
"Must be a valid GUID"
|
|
1119
|
-
).optional(),
|
|
1120
|
-
externalId: z.string().describe("Program definition external ID.").regex(
|
|
1121
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1122
|
-
"Must be a valid GUID"
|
|
1123
|
-
).optional().nullable()
|
|
1124
|
-
}).describe("Associated program definition information.").optional()
|
|
1125
|
-
})
|
|
1126
|
-
).optional(),
|
|
1127
|
-
metadata: z.object({
|
|
1128
|
-
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
1129
|
-
cursors: z.object({
|
|
1130
|
-
next: z.string().describe(
|
|
1131
|
-
"Cursor string pointing to the next page in the list of results."
|
|
1132
|
-
).max(16e3).optional().nullable(),
|
|
1133
|
-
prev: z.string().describe(
|
|
1134
|
-
"Cursor pointing to the previous page in the list of results."
|
|
1135
|
-
).max(16e3).optional().nullable()
|
|
1136
|
-
}).describe(
|
|
1137
|
-
"Cursor strings that point to the next page, previous page, or both."
|
|
1138
|
-
).optional(),
|
|
1139
|
-
hasNext: z.boolean().describe(
|
|
1140
|
-
"Whether there are more pages to retrieve following the current page.\n\n+ `true`: Another page of results can be retrieved.\n+ `false`: This is the last page."
|
|
1141
|
-
).optional().nullable()
|
|
1142
|
-
}).describe("Metadata for the paginated results.").optional()
|
|
1143
|
-
});
|
|
1144
|
-
var GetProgramByExternalIdAndNamespaceRequest = z.object({
|
|
1145
|
-
namespace: z.string().describe(
|
|
1146
|
-
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
1147
|
-
).min(1).max(20),
|
|
1148
|
-
options: z.object({
|
|
1149
|
-
externalId: z.string().describe("Program's external ID.").regex(
|
|
1150
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1151
|
-
"Must be a valid GUID"
|
|
1152
|
-
)
|
|
1153
|
-
})
|
|
1154
|
-
});
|
|
1155
|
-
var GetProgramByExternalIdAndNamespaceResponse = z.object({
|
|
1156
|
-
program: z.object({
|
|
1157
|
-
_id: z.string().describe("Program ID.").regex(
|
|
1158
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1159
|
-
"Must be a valid GUID"
|
|
1160
|
-
).optional().nullable(),
|
|
1161
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
1162
|
-
"Revision number, which increments by 1 each time the program is updated.\nTo prevent conflicting changes, the current revision must be specified when updating the program.\n\nIgnored when creating a program."
|
|
1163
|
-
).optional().nullable(),
|
|
1164
|
-
_createdDate: z.date().describe("Date and time the program was created.").optional().nullable(),
|
|
1165
|
-
_updatedDate: z.date().describe("Date and time the program was updated.").optional().nullable(),
|
|
1166
|
-
programDefinitionId: z.string().describe("ID of the associated program definition.").regex(
|
|
1167
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1168
|
-
"Must be a valid GUID"
|
|
1169
|
-
).optional().nullable(),
|
|
1170
|
-
status: z.enum([
|
|
1171
|
-
"ACTIVE",
|
|
1172
|
-
"PAUSED",
|
|
1173
|
-
"ENDED",
|
|
1174
|
-
"PROVISIONING",
|
|
1175
|
-
"PAUSING",
|
|
1176
|
-
"RESUMING",
|
|
1177
|
-
"ENDING"
|
|
1178
|
-
]).describe("Program status.").optional(),
|
|
1179
|
-
beneficiary: z.intersection(
|
|
1180
|
-
z.object({}),
|
|
1181
|
-
z.xor([
|
|
1182
|
-
z.object({
|
|
1183
|
-
anonymousVisitorId: z.never().optional(),
|
|
1184
|
-
memberId: z.never().optional(),
|
|
1185
|
-
wixUserId: z.never().optional()
|
|
1186
|
-
}),
|
|
1187
|
-
z.object({
|
|
1188
|
-
memberId: z.never().optional(),
|
|
1189
|
-
wixUserId: z.never().optional(),
|
|
1190
|
-
anonymousVisitorId: z.string().describe(
|
|
1191
|
-
"ID of a site visitor that hasn't logged in to the site."
|
|
1192
|
-
).regex(
|
|
1193
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1194
|
-
"Must be a valid GUID"
|
|
1195
|
-
)
|
|
1196
|
-
}),
|
|
1197
|
-
z.object({
|
|
1198
|
-
anonymousVisitorId: z.never().optional(),
|
|
1199
|
-
wixUserId: z.never().optional(),
|
|
1200
|
-
memberId: z.string().describe("ID of a site member.").regex(
|
|
1201
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1202
|
-
"Must be a valid GUID"
|
|
1203
|
-
)
|
|
1204
|
-
}),
|
|
1205
|
-
z.object({
|
|
1206
|
-
anonymousVisitorId: z.never().optional(),
|
|
1207
|
-
memberId: z.never().optional(),
|
|
1208
|
-
wixUserId: z.string().describe("ID of a Wix user.").regex(
|
|
1209
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1210
|
-
"Must be a valid GUID"
|
|
1211
|
-
)
|
|
1212
|
-
})
|
|
1213
|
-
])
|
|
1214
|
-
).describe("Program beneficiary.").optional(),
|
|
1215
|
-
displayName: z.string().describe(
|
|
1216
|
-
"Program name.\n\nYou may want to use the same name that's used in the associated program definition, if it exists."
|
|
1217
|
-
).max(64).optional().nullable(),
|
|
1218
|
-
namespace: z.string().describe(
|
|
1219
|
-
"Namespace for your app or site's benefit programs. Namespaces allow you to distinguish between entities that you created and entities that other apps created."
|
|
1220
|
-
).min(1).max(20).optional().nullable(),
|
|
1221
|
-
extendedFields: z.object({
|
|
1222
|
-
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
1223
|
-
"Extended field data. Each key corresponds to the namespace of the app that created the extended fields.\nThe value of each key is structured according to the schema defined when the extended fields were configured.\n\nYou can only access fields for which you have the appropriate permissions.\n\nLearn more about [extended fields](https://dev.wix.com/docs/rest/articles/getting-started/extended-fields)."
|
|
1224
|
-
).optional()
|
|
1225
|
-
}).describe(
|
|
1226
|
-
"Custom field data for the program object.\n\n[Extended fields](https://dev.wix.com/docs/build-apps/develop-your-app/extensions/backend-extensions/schema-plugins/about-schema-plugin-extensions) must be configured in the app dashboard before they can be accessed with API calls."
|
|
1227
|
-
).optional(),
|
|
1228
|
-
externalId: z.string().describe(
|
|
1229
|
-
"ID for the program defined by you. You can use `externalId` to filter queries."
|
|
1230
|
-
).regex(
|
|
1231
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1232
|
-
"Must be a valid GUID"
|
|
1233
|
-
).optional().nullable(),
|
|
1234
|
-
programDefinition: z.object({
|
|
1235
|
-
_id: z.string().describe("Program definition ID.").regex(
|
|
1236
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1237
|
-
"Must be a valid GUID"
|
|
1238
|
-
).optional(),
|
|
1239
|
-
externalId: z.string().describe("Program definition external ID.").regex(
|
|
1240
|
-
/^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,
|
|
1241
|
-
"Must be a valid GUID"
|
|
1242
|
-
).optional().nullable()
|
|
1243
|
-
}).describe("Associated program definition information.").optional()
|
|
1244
|
-
}).describe("Retrieved program.").optional()
|
|
1245
|
-
});
|
|
1246
|
-
|
|
1247
|
-
// src/benefit-programs-v1-program-programs.universal.ts
|
|
1248
395
|
var import_query_builder_utils = require("@wix/sdk-runtime/query-builder-utils");
|
|
1249
396
|
var ProgramStatus = /* @__PURE__ */ ((ProgramStatus2) => {
|
|
1250
397
|
ProgramStatus2["ACTIVE"] = "ACTIVE";
|
|
@@ -1289,10 +436,7 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
|
1289
436
|
return WebhookIdentityType2;
|
|
1290
437
|
})(WebhookIdentityType || {});
|
|
1291
438
|
async function provisionProgram2(poolDefinitionLookupId, options) {
|
|
1292
|
-
const { httpClient, sideEffects
|
|
1293
|
-
if (validateRequestSchema) {
|
|
1294
|
-
ProvisionProgramRequest.parse({ poolDefinitionLookupId, options });
|
|
1295
|
-
}
|
|
439
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1296
440
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1297
441
|
poolDefinitionLookupId,
|
|
1298
442
|
beneficiary: options?.beneficiary,
|
|
@@ -1329,10 +473,7 @@ async function provisionProgram2(poolDefinitionLookupId, options) {
|
|
|
1329
473
|
}
|
|
1330
474
|
}
|
|
1331
475
|
async function renewProgram2(programId, options) {
|
|
1332
|
-
const { httpClient, sideEffects
|
|
1333
|
-
if (validateRequestSchema) {
|
|
1334
|
-
RenewProgramRequest.parse({ programId, options });
|
|
1335
|
-
}
|
|
476
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1336
477
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1337
478
|
programId,
|
|
1338
479
|
idempotencyKey: options?.idempotencyKey
|
|
@@ -1361,10 +502,7 @@ async function renewProgram2(programId, options) {
|
|
|
1361
502
|
}
|
|
1362
503
|
}
|
|
1363
504
|
async function pauseProgram2(programId, options) {
|
|
1364
|
-
const { httpClient, sideEffects
|
|
1365
|
-
if (validateRequestSchema) {
|
|
1366
|
-
PauseProgramRequest.parse({ programId, options });
|
|
1367
|
-
}
|
|
505
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1368
506
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1369
507
|
programId,
|
|
1370
508
|
idempotencyKey: options?.idempotencyKey
|
|
@@ -1393,10 +531,7 @@ async function pauseProgram2(programId, options) {
|
|
|
1393
531
|
}
|
|
1394
532
|
}
|
|
1395
533
|
async function resumeProgram2(programId, options) {
|
|
1396
|
-
const { httpClient, sideEffects
|
|
1397
|
-
if (validateRequestSchema) {
|
|
1398
|
-
ResumeProgramRequest.parse({ programId, options });
|
|
1399
|
-
}
|
|
534
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1400
535
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1401
536
|
programId,
|
|
1402
537
|
idempotencyKey: options?.idempotencyKey
|
|
@@ -1425,10 +560,7 @@ async function resumeProgram2(programId, options) {
|
|
|
1425
560
|
}
|
|
1426
561
|
}
|
|
1427
562
|
async function endProgram2(programId) {
|
|
1428
|
-
const { httpClient, sideEffects
|
|
1429
|
-
if (validateRequestSchema) {
|
|
1430
|
-
EndProgramRequest.parse({ programId });
|
|
1431
|
-
}
|
|
563
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1432
564
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1433
565
|
programId
|
|
1434
566
|
});
|
|
@@ -1453,10 +585,7 @@ async function endProgram2(programId) {
|
|
|
1453
585
|
}
|
|
1454
586
|
}
|
|
1455
587
|
async function updateProgram2(_id, program) {
|
|
1456
|
-
const { httpClient, sideEffects
|
|
1457
|
-
if (validateRequestSchema) {
|
|
1458
|
-
UpdateProgramRequest.parse({ _id, program });
|
|
1459
|
-
}
|
|
588
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1460
589
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1461
590
|
program: { ...program, id: _id }
|
|
1462
591
|
});
|
|
@@ -1481,10 +610,7 @@ async function updateProgram2(_id, program) {
|
|
|
1481
610
|
}
|
|
1482
611
|
}
|
|
1483
612
|
async function getProgram2(programId) {
|
|
1484
|
-
const { httpClient, sideEffects
|
|
1485
|
-
if (validateRequestSchema) {
|
|
1486
|
-
GetProgramRequest.parse({ programId });
|
|
1487
|
-
}
|
|
613
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1488
614
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1489
615
|
programId
|
|
1490
616
|
});
|
|
@@ -1552,10 +678,7 @@ function queryPrograms2() {
|
|
|
1552
678
|
});
|
|
1553
679
|
}
|
|
1554
680
|
async function typedQueryPrograms(query) {
|
|
1555
|
-
const { httpClient, sideEffects
|
|
1556
|
-
if (validateRequestSchema) {
|
|
1557
|
-
QueryProgramsRequest.parse({ query });
|
|
1558
|
-
}
|
|
681
|
+
const { httpClient, sideEffects } = arguments[1];
|
|
1559
682
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({ query });
|
|
1560
683
|
const reqOpts = queryPrograms(payload);
|
|
1561
684
|
sideEffects?.onSiteCall?.();
|
|
@@ -1583,13 +706,7 @@ var utils = {
|
|
|
1583
706
|
}
|
|
1584
707
|
};
|
|
1585
708
|
async function getProgramByExternalIdAndNamespace2(namespace, options) {
|
|
1586
|
-
const { httpClient, sideEffects
|
|
1587
|
-
if (validateRequestSchema) {
|
|
1588
|
-
GetProgramByExternalIdAndNamespaceRequest.parse({
|
|
1589
|
-
namespace,
|
|
1590
|
-
options
|
|
1591
|
-
});
|
|
1592
|
-
}
|
|
709
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
1593
710
|
const payload = (0, import_rename_all_nested_keys.renameKeysFromSDKRequestToRESTRequest)({
|
|
1594
711
|
namespace,
|
|
1595
712
|
externalId: options?.externalId
|