@wix/auto_sdk_benefit-programs_program-definitions 1.0.48 → 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 +15 -5
- package/build/cjs/index.js +388 -20
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +4 -2
- package/build/cjs/index.typings.js +374 -6
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +4 -2
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +3 -3
- package/build/es/index.d.mts +15 -5
- package/build/es/index.mjs +378 -20
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +4 -2
- package/build/es/index.typings.mjs +364 -6
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +4 -2
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +3 -3
- package/build/internal/cjs/index.d.ts +15 -5
- package/build/internal/cjs/index.js +388 -20
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +4 -2
- package/build/internal/cjs/index.typings.js +374 -6
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +4 -2
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +3 -3
- package/build/internal/es/index.d.mts +15 -5
- package/build/internal/es/index.mjs +378 -20
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +4 -2
- package/build/internal/es/index.typings.mjs +364 -6
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +4 -2
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +3 -3
- package/package.json +2 -2
package/build/es/index.mjs
CHANGED
|
@@ -313,6 +313,340 @@ function queryProgramDefinitions(payload) {
|
|
|
313
313
|
|
|
314
314
|
// src/benefit-programs-v1-program-definition-program-definitions.universal.ts
|
|
315
315
|
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
316
|
+
|
|
317
|
+
// src/benefit-programs-v1-program-definition-program-definitions.schemas.ts
|
|
318
|
+
import * as z from "zod";
|
|
319
|
+
var CreateProgramDefinitionRequest = z.object({
|
|
320
|
+
programDefinition: z.object({
|
|
321
|
+
_id: z.string().describe("Program definition ID.").regex(
|
|
322
|
+
/^[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}$/,
|
|
323
|
+
"Must be a valid GUID"
|
|
324
|
+
).optional().nullable(),
|
|
325
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
326
|
+
"Revision number, which increments by 1 each time the program definition is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the program definition.\n\nIgnored when creating a program definition."
|
|
327
|
+
).optional().nullable(),
|
|
328
|
+
_createdDate: z.date().describe("Date and time the program definition was created.").optional().nullable(),
|
|
329
|
+
_updatedDate: z.date().describe("Date and time the program definition was updated.").optional().nullable(),
|
|
330
|
+
displayName: z.string().describe("Program definition name.").max(64).optional().nullable(),
|
|
331
|
+
namespace: z.string().describe(
|
|
332
|
+
"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."
|
|
333
|
+
).min(1).max(20),
|
|
334
|
+
extendedFields: z.object({
|
|
335
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
336
|
+
"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)."
|
|
337
|
+
).optional()
|
|
338
|
+
}).describe(
|
|
339
|
+
"Custom field data for the program definition 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."
|
|
340
|
+
).optional(),
|
|
341
|
+
externalId: z.string().describe(
|
|
342
|
+
"ID for the program definition defined by you. You can use `externalId` to filter queries."
|
|
343
|
+
).regex(
|
|
344
|
+
/^[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}$/,
|
|
345
|
+
"Must be a valid GUID"
|
|
346
|
+
)
|
|
347
|
+
}).describe("Program definition to create.")
|
|
348
|
+
});
|
|
349
|
+
var CreateProgramDefinitionResponse = z.object({
|
|
350
|
+
_id: z.string().describe("Program definition ID.").regex(
|
|
351
|
+
/^[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}$/,
|
|
352
|
+
"Must be a valid GUID"
|
|
353
|
+
).optional().nullable(),
|
|
354
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
355
|
+
"Revision number, which increments by 1 each time the program definition is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the program definition.\n\nIgnored when creating a program definition."
|
|
356
|
+
).optional().nullable(),
|
|
357
|
+
_createdDate: z.date().describe("Date and time the program definition was created.").optional().nullable(),
|
|
358
|
+
_updatedDate: z.date().describe("Date and time the program definition was updated.").optional().nullable(),
|
|
359
|
+
displayName: z.string().describe("Program definition name.").max(64).optional().nullable(),
|
|
360
|
+
namespace: z.string().describe(
|
|
361
|
+
"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."
|
|
362
|
+
).min(1).max(20).optional().nullable(),
|
|
363
|
+
extendedFields: z.object({
|
|
364
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
365
|
+
"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)."
|
|
366
|
+
).optional()
|
|
367
|
+
}).describe(
|
|
368
|
+
"Custom field data for the program definition 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."
|
|
369
|
+
).optional(),
|
|
370
|
+
externalId: z.string().describe(
|
|
371
|
+
"ID for the program definition defined by you. You can use `externalId` to filter queries."
|
|
372
|
+
).regex(
|
|
373
|
+
/^[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}$/,
|
|
374
|
+
"Must be a valid GUID"
|
|
375
|
+
).optional().nullable()
|
|
376
|
+
});
|
|
377
|
+
var UpdateProgramDefinitionRequest = z.object({
|
|
378
|
+
_id: z.string().describe("Program definition ID.").regex(
|
|
379
|
+
/^[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}$/,
|
|
380
|
+
"Must be a valid GUID"
|
|
381
|
+
),
|
|
382
|
+
programDefinition: z.object({
|
|
383
|
+
_id: z.string().describe("Program definition ID.").regex(
|
|
384
|
+
/^[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}$/,
|
|
385
|
+
"Must be a valid GUID"
|
|
386
|
+
).optional().nullable(),
|
|
387
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
388
|
+
"Revision number, which increments by 1 each time the program definition is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the program definition.\n\nIgnored when creating a program definition."
|
|
389
|
+
),
|
|
390
|
+
_createdDate: z.date().describe("Date and time the program definition was created.").optional().nullable(),
|
|
391
|
+
_updatedDate: z.date().describe("Date and time the program definition was updated.").optional().nullable(),
|
|
392
|
+
displayName: z.string().describe("Program definition name.").max(64).optional().nullable(),
|
|
393
|
+
namespace: z.string().describe(
|
|
394
|
+
"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."
|
|
395
|
+
).min(1).max(20).optional().nullable(),
|
|
396
|
+
extendedFields: z.object({
|
|
397
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
398
|
+
"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)."
|
|
399
|
+
).optional()
|
|
400
|
+
}).describe(
|
|
401
|
+
"Custom field data for the program definition 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."
|
|
402
|
+
).optional(),
|
|
403
|
+
externalId: z.string().describe(
|
|
404
|
+
"ID for the program definition defined by you. You can use `externalId` to filter queries."
|
|
405
|
+
).regex(
|
|
406
|
+
/^[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}$/,
|
|
407
|
+
"Must be a valid GUID"
|
|
408
|
+
).optional().nullable()
|
|
409
|
+
}).describe("Program definition to update.")
|
|
410
|
+
});
|
|
411
|
+
var UpdateProgramDefinitionResponse = z.object({
|
|
412
|
+
_id: z.string().describe("Program definition ID.").regex(
|
|
413
|
+
/^[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}$/,
|
|
414
|
+
"Must be a valid GUID"
|
|
415
|
+
).optional().nullable(),
|
|
416
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
417
|
+
"Revision number, which increments by 1 each time the program definition is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the program definition.\n\nIgnored when creating a program definition."
|
|
418
|
+
).optional().nullable(),
|
|
419
|
+
_createdDate: z.date().describe("Date and time the program definition was created.").optional().nullable(),
|
|
420
|
+
_updatedDate: z.date().describe("Date and time the program definition was updated.").optional().nullable(),
|
|
421
|
+
displayName: z.string().describe("Program definition name.").max(64).optional().nullable(),
|
|
422
|
+
namespace: z.string().describe(
|
|
423
|
+
"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."
|
|
424
|
+
).min(1).max(20).optional().nullable(),
|
|
425
|
+
extendedFields: z.object({
|
|
426
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
427
|
+
"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)."
|
|
428
|
+
).optional()
|
|
429
|
+
}).describe(
|
|
430
|
+
"Custom field data for the program definition 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."
|
|
431
|
+
).optional(),
|
|
432
|
+
externalId: z.string().describe(
|
|
433
|
+
"ID for the program definition defined by you. You can use `externalId` to filter queries."
|
|
434
|
+
).regex(
|
|
435
|
+
/^[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}$/,
|
|
436
|
+
"Must be a valid GUID"
|
|
437
|
+
).optional().nullable()
|
|
438
|
+
});
|
|
439
|
+
var DeleteProgramDefinitionRequest = z.object({
|
|
440
|
+
programDefinitionId: z.string().describe("ID of the program definition to delete.").regex(
|
|
441
|
+
/^[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}$/,
|
|
442
|
+
"Must be a valid GUID"
|
|
443
|
+
),
|
|
444
|
+
options: z.object({
|
|
445
|
+
cascadeType: z.enum([
|
|
446
|
+
"UNKNOWN_CASCADE",
|
|
447
|
+
"IMMEDIATELY",
|
|
448
|
+
"NEXT_RENEWAL",
|
|
449
|
+
"FUTURE_PROVISIONS"
|
|
450
|
+
]).optional()
|
|
451
|
+
}).optional()
|
|
452
|
+
});
|
|
453
|
+
var DeleteProgramDefinitionResponse = z.object({});
|
|
454
|
+
var GetProgramDefinitionRequest = z.object({
|
|
455
|
+
programDefinitionId: z.string().describe("ID of the program definition to retrieve.").regex(
|
|
456
|
+
/^[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}$/,
|
|
457
|
+
"Must be a valid GUID"
|
|
458
|
+
)
|
|
459
|
+
});
|
|
460
|
+
var GetProgramDefinitionResponse = z.object({
|
|
461
|
+
_id: z.string().describe("Program definition ID.").regex(
|
|
462
|
+
/^[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}$/,
|
|
463
|
+
"Must be a valid GUID"
|
|
464
|
+
).optional().nullable(),
|
|
465
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
466
|
+
"Revision number, which increments by 1 each time the program definition is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the program definition.\n\nIgnored when creating a program definition."
|
|
467
|
+
).optional().nullable(),
|
|
468
|
+
_createdDate: z.date().describe("Date and time the program definition was created.").optional().nullable(),
|
|
469
|
+
_updatedDate: z.date().describe("Date and time the program definition was updated.").optional().nullable(),
|
|
470
|
+
displayName: z.string().describe("Program definition name.").max(64).optional().nullable(),
|
|
471
|
+
namespace: z.string().describe(
|
|
472
|
+
"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."
|
|
473
|
+
).min(1).max(20).optional().nullable(),
|
|
474
|
+
extendedFields: z.object({
|
|
475
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
476
|
+
"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)."
|
|
477
|
+
).optional()
|
|
478
|
+
}).describe(
|
|
479
|
+
"Custom field data for the program definition 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."
|
|
480
|
+
).optional(),
|
|
481
|
+
externalId: z.string().describe(
|
|
482
|
+
"ID for the program definition defined by you. You can use `externalId` to filter queries."
|
|
483
|
+
).regex(
|
|
484
|
+
/^[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}$/,
|
|
485
|
+
"Must be a valid GUID"
|
|
486
|
+
).optional().nullable()
|
|
487
|
+
});
|
|
488
|
+
var GetProgramDefinitionByExternalIdAndNamespaceRequest = z.object({
|
|
489
|
+
namespace: z.string().describe(
|
|
490
|
+
"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."
|
|
491
|
+
).min(1).max(20),
|
|
492
|
+
options: z.object({
|
|
493
|
+
externalId: z.string().describe("Program definition external ID.").regex(
|
|
494
|
+
/^[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}$/,
|
|
495
|
+
"Must be a valid GUID"
|
|
496
|
+
)
|
|
497
|
+
})
|
|
498
|
+
});
|
|
499
|
+
var GetProgramDefinitionByExternalIdAndNamespaceResponse = z.object({
|
|
500
|
+
programDefinition: z.object({
|
|
501
|
+
_id: z.string().describe("Program definition ID.").regex(
|
|
502
|
+
/^[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}$/,
|
|
503
|
+
"Must be a valid GUID"
|
|
504
|
+
).optional().nullable(),
|
|
505
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
506
|
+
"Revision number, which increments by 1 each time the program definition is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the program definition.\n\nIgnored when creating a program definition."
|
|
507
|
+
).optional().nullable(),
|
|
508
|
+
_createdDate: z.date().describe("Date and time the program definition was created.").optional().nullable(),
|
|
509
|
+
_updatedDate: z.date().describe("Date and time the program definition was updated.").optional().nullable(),
|
|
510
|
+
displayName: z.string().describe("Program definition name.").max(64).optional().nullable(),
|
|
511
|
+
namespace: z.string().describe(
|
|
512
|
+
"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."
|
|
513
|
+
).min(1).max(20).optional().nullable(),
|
|
514
|
+
extendedFields: z.object({
|
|
515
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
516
|
+
"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)."
|
|
517
|
+
).optional()
|
|
518
|
+
}).describe(
|
|
519
|
+
"Custom field data for the program definition 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."
|
|
520
|
+
).optional(),
|
|
521
|
+
externalId: z.string().describe(
|
|
522
|
+
"ID for the program definition defined by you. You can use `externalId` to filter queries."
|
|
523
|
+
).regex(
|
|
524
|
+
/^[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}$/,
|
|
525
|
+
"Must be a valid GUID"
|
|
526
|
+
).optional().nullable()
|
|
527
|
+
}).describe("Retrieved program definition.").optional()
|
|
528
|
+
});
|
|
529
|
+
var QueryProgramDefinitionsRequest = z.object({
|
|
530
|
+
query: z.object({
|
|
531
|
+
filter: z.object({
|
|
532
|
+
_id: z.object({
|
|
533
|
+
$eq: z.string(),
|
|
534
|
+
$exists: z.boolean(),
|
|
535
|
+
$gt: z.string(),
|
|
536
|
+
$gte: z.string(),
|
|
537
|
+
$hasAll: z.array(z.string()),
|
|
538
|
+
$hasSome: z.array(z.string()),
|
|
539
|
+
$in: z.array(z.string()),
|
|
540
|
+
$lt: z.string(),
|
|
541
|
+
$lte: z.string(),
|
|
542
|
+
$ne: z.string(),
|
|
543
|
+
$nin: z.array(z.string()),
|
|
544
|
+
$startsWith: z.string()
|
|
545
|
+
}).partial().strict().optional(),
|
|
546
|
+
namespace: z.object({
|
|
547
|
+
$eq: z.string(),
|
|
548
|
+
$exists: z.boolean(),
|
|
549
|
+
$gt: z.string(),
|
|
550
|
+
$gte: z.string(),
|
|
551
|
+
$hasAll: z.array(z.string()),
|
|
552
|
+
$hasSome: z.array(z.string()),
|
|
553
|
+
$in: z.array(z.string()),
|
|
554
|
+
$lt: z.string(),
|
|
555
|
+
$lte: z.string(),
|
|
556
|
+
$ne: z.string(),
|
|
557
|
+
$nin: z.array(z.string()),
|
|
558
|
+
$startsWith: z.string()
|
|
559
|
+
}).partial().strict().optional(),
|
|
560
|
+
externalId: z.object({
|
|
561
|
+
$eq: z.string(),
|
|
562
|
+
$exists: z.boolean(),
|
|
563
|
+
$gt: z.string(),
|
|
564
|
+
$gte: z.string(),
|
|
565
|
+
$hasAll: z.array(z.string()),
|
|
566
|
+
$hasSome: z.array(z.string()),
|
|
567
|
+
$in: z.array(z.string()),
|
|
568
|
+
$lt: z.string(),
|
|
569
|
+
$lte: z.string(),
|
|
570
|
+
$ne: z.string(),
|
|
571
|
+
$nin: z.array(z.string()),
|
|
572
|
+
$startsWith: z.string()
|
|
573
|
+
}).partial().strict().optional(),
|
|
574
|
+
_createdDate: z.object({
|
|
575
|
+
$eq: z.string(),
|
|
576
|
+
$exists: z.boolean(),
|
|
577
|
+
$gt: z.string(),
|
|
578
|
+
$gte: z.string(),
|
|
579
|
+
$hasAll: z.array(z.string()),
|
|
580
|
+
$hasSome: z.array(z.string()),
|
|
581
|
+
$in: z.array(z.string()),
|
|
582
|
+
$lt: z.string(),
|
|
583
|
+
$lte: z.string(),
|
|
584
|
+
$ne: z.string(),
|
|
585
|
+
$nin: z.array(z.string()),
|
|
586
|
+
$startsWith: z.string()
|
|
587
|
+
}).partial().strict().optional(),
|
|
588
|
+
$and: z.array(z.any()).optional(),
|
|
589
|
+
$or: z.array(z.any()).optional(),
|
|
590
|
+
$not: z.any().optional()
|
|
591
|
+
}).strict().optional(),
|
|
592
|
+
sort: z.array(
|
|
593
|
+
z.object({
|
|
594
|
+
fieldName: z.enum(["_id", "namespace", "externalId", "_createdDate"]).optional(),
|
|
595
|
+
order: z.enum(["ASC", "DESC"]).optional()
|
|
596
|
+
})
|
|
597
|
+
).optional()
|
|
598
|
+
}).catchall(z.any()).describe("Filter, sort, and paging to apply to the query.")
|
|
599
|
+
});
|
|
600
|
+
var QueryProgramDefinitionsResponse = z.object({
|
|
601
|
+
programDefinitions: z.array(
|
|
602
|
+
z.object({
|
|
603
|
+
_id: z.string().describe("Program definition ID.").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
|
+
).optional().nullable(),
|
|
607
|
+
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
608
|
+
"Revision number, which increments by 1 each time the program definition is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the program definition.\n\nIgnored when creating a program definition."
|
|
609
|
+
).optional().nullable(),
|
|
610
|
+
_createdDate: z.date().describe("Date and time the program definition was created.").optional().nullable(),
|
|
611
|
+
_updatedDate: z.date().describe("Date and time the program definition was updated.").optional().nullable(),
|
|
612
|
+
displayName: z.string().describe("Program definition name.").max(64).optional().nullable(),
|
|
613
|
+
namespace: z.string().describe(
|
|
614
|
+
"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."
|
|
615
|
+
).min(1).max(20).optional().nullable(),
|
|
616
|
+
extendedFields: z.object({
|
|
617
|
+
namespaces: z.record(z.string(), z.record(z.string(), z.any())).describe(
|
|
618
|
+
"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)."
|
|
619
|
+
).optional()
|
|
620
|
+
}).describe(
|
|
621
|
+
"Custom field data for the program definition 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."
|
|
622
|
+
).optional(),
|
|
623
|
+
externalId: z.string().describe(
|
|
624
|
+
"ID for the program definition defined by you. You can use `externalId` to filter queries."
|
|
625
|
+
).regex(
|
|
626
|
+
/^[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}$/,
|
|
627
|
+
"Must be a valid GUID"
|
|
628
|
+
).optional().nullable()
|
|
629
|
+
})
|
|
630
|
+
).optional(),
|
|
631
|
+
metadata: z.object({
|
|
632
|
+
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
633
|
+
cursors: z.object({
|
|
634
|
+
next: z.string().describe(
|
|
635
|
+
"Cursor string pointing to the next page in the list of results."
|
|
636
|
+
).max(16e3).optional().nullable(),
|
|
637
|
+
prev: z.string().describe(
|
|
638
|
+
"Cursor pointing to the previous page in the list of results."
|
|
639
|
+
).max(16e3).optional().nullable()
|
|
640
|
+
}).describe(
|
|
641
|
+
"Cursor strings that point to the next page, previous page, or both."
|
|
642
|
+
).optional(),
|
|
643
|
+
hasNext: z.boolean().describe(
|
|
644
|
+
"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."
|
|
645
|
+
).optional().nullable()
|
|
646
|
+
}).describe("Metadata for the paginated results.").optional()
|
|
647
|
+
});
|
|
648
|
+
|
|
649
|
+
// src/benefit-programs-v1-program-definition-program-definitions.universal.ts
|
|
316
650
|
import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
|
|
317
651
|
var Cascade = /* @__PURE__ */ ((Cascade2) => {
|
|
318
652
|
Cascade2["UNKNOWN_CASCADE"] = "UNKNOWN_CASCADE";
|
|
@@ -335,7 +669,10 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
|
335
669
|
return WebhookIdentityType2;
|
|
336
670
|
})(WebhookIdentityType || {});
|
|
337
671
|
async function createProgramDefinition2(programDefinition) {
|
|
338
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
672
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
673
|
+
if (validateRequestSchema) {
|
|
674
|
+
CreateProgramDefinitionRequest.parse({ programDefinition });
|
|
675
|
+
}
|
|
339
676
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
340
677
|
programDefinition
|
|
341
678
|
});
|
|
@@ -362,7 +699,10 @@ async function createProgramDefinition2(programDefinition) {
|
|
|
362
699
|
}
|
|
363
700
|
}
|
|
364
701
|
async function updateProgramDefinition2(_id, programDefinition) {
|
|
365
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
702
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
703
|
+
if (validateRequestSchema) {
|
|
704
|
+
UpdateProgramDefinitionRequest.parse({ _id, programDefinition });
|
|
705
|
+
}
|
|
366
706
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
367
707
|
programDefinition: { ...programDefinition, id: _id }
|
|
368
708
|
});
|
|
@@ -389,7 +729,13 @@ async function updateProgramDefinition2(_id, programDefinition) {
|
|
|
389
729
|
}
|
|
390
730
|
}
|
|
391
731
|
async function deleteProgramDefinition2(programDefinitionId, options) {
|
|
392
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
732
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
733
|
+
if (validateRequestSchema) {
|
|
734
|
+
DeleteProgramDefinitionRequest.parse({
|
|
735
|
+
programDefinitionId,
|
|
736
|
+
options
|
|
737
|
+
});
|
|
738
|
+
}
|
|
393
739
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
394
740
|
programDefinitionId,
|
|
395
741
|
cascadeType: options?.cascadeType
|
|
@@ -419,7 +765,10 @@ async function deleteProgramDefinition2(programDefinitionId, options) {
|
|
|
419
765
|
}
|
|
420
766
|
}
|
|
421
767
|
async function getProgramDefinition2(programDefinitionId) {
|
|
422
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
768
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
769
|
+
if (validateRequestSchema) {
|
|
770
|
+
GetProgramDefinitionRequest.parse({ programDefinitionId });
|
|
771
|
+
}
|
|
423
772
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
424
773
|
programDefinitionId
|
|
425
774
|
});
|
|
@@ -446,7 +795,13 @@ async function getProgramDefinition2(programDefinitionId) {
|
|
|
446
795
|
}
|
|
447
796
|
}
|
|
448
797
|
async function getProgramDefinitionByExternalIdAndNamespace2(namespace, options) {
|
|
449
|
-
const { httpClient, sideEffects } = arguments[2];
|
|
798
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
799
|
+
if (validateRequestSchema) {
|
|
800
|
+
GetProgramDefinitionByExternalIdAndNamespaceRequest.parse({
|
|
801
|
+
namespace,
|
|
802
|
+
options
|
|
803
|
+
});
|
|
804
|
+
}
|
|
450
805
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
451
806
|
namespace,
|
|
452
807
|
externalId: options?.externalId
|
|
@@ -524,7 +879,10 @@ function queryProgramDefinitions2() {
|
|
|
524
879
|
});
|
|
525
880
|
}
|
|
526
881
|
async function typedQueryProgramDefinitions(query) {
|
|
527
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
882
|
+
const { httpClient, sideEffects, validateRequestSchema } = arguments[1];
|
|
883
|
+
if (validateRequestSchema) {
|
|
884
|
+
QueryProgramDefinitionsRequest.parse({ query });
|
|
885
|
+
}
|
|
528
886
|
const payload = renameKeysFromSDKRequestToRESTRequest({ query });
|
|
529
887
|
const reqOpts = queryProgramDefinitions(
|
|
530
888
|
payload
|
|
@@ -555,55 +913,55 @@ var utils = {
|
|
|
555
913
|
};
|
|
556
914
|
|
|
557
915
|
// src/benefit-programs-v1-program-definition-program-definitions.public.ts
|
|
558
|
-
function createProgramDefinition3(httpClient) {
|
|
916
|
+
function createProgramDefinition3(httpClient, __options) {
|
|
559
917
|
return (programDefinition) => createProgramDefinition2(
|
|
560
918
|
programDefinition,
|
|
561
919
|
// @ts-ignore
|
|
562
|
-
{ httpClient }
|
|
920
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
563
921
|
);
|
|
564
922
|
}
|
|
565
|
-
function updateProgramDefinition3(httpClient) {
|
|
923
|
+
function updateProgramDefinition3(httpClient, __options) {
|
|
566
924
|
return (_id, programDefinition) => updateProgramDefinition2(
|
|
567
925
|
_id,
|
|
568
926
|
programDefinition,
|
|
569
927
|
// @ts-ignore
|
|
570
|
-
{ httpClient }
|
|
928
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
571
929
|
);
|
|
572
930
|
}
|
|
573
|
-
function deleteProgramDefinition3(httpClient) {
|
|
931
|
+
function deleteProgramDefinition3(httpClient, __options) {
|
|
574
932
|
return (programDefinitionId, options) => deleteProgramDefinition2(
|
|
575
933
|
programDefinitionId,
|
|
576
934
|
options,
|
|
577
935
|
// @ts-ignore
|
|
578
|
-
{ httpClient }
|
|
936
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
579
937
|
);
|
|
580
938
|
}
|
|
581
|
-
function getProgramDefinition3(httpClient) {
|
|
939
|
+
function getProgramDefinition3(httpClient, __options) {
|
|
582
940
|
return (programDefinitionId) => getProgramDefinition2(
|
|
583
941
|
programDefinitionId,
|
|
584
942
|
// @ts-ignore
|
|
585
|
-
{ httpClient }
|
|
943
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
586
944
|
);
|
|
587
945
|
}
|
|
588
|
-
function getProgramDefinitionByExternalIdAndNamespace3(httpClient) {
|
|
946
|
+
function getProgramDefinitionByExternalIdAndNamespace3(httpClient, __options) {
|
|
589
947
|
return (namespace, options) => getProgramDefinitionByExternalIdAndNamespace2(
|
|
590
948
|
namespace,
|
|
591
949
|
options,
|
|
592
950
|
// @ts-ignore
|
|
593
|
-
{ httpClient }
|
|
951
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
594
952
|
);
|
|
595
953
|
}
|
|
596
|
-
function queryProgramDefinitions3(httpClient) {
|
|
954
|
+
function queryProgramDefinitions3(httpClient, __options) {
|
|
597
955
|
return () => queryProgramDefinitions2(
|
|
598
956
|
// @ts-ignore
|
|
599
|
-
{ httpClient }
|
|
957
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
600
958
|
);
|
|
601
959
|
}
|
|
602
|
-
function typedQueryProgramDefinitions2(httpClient) {
|
|
960
|
+
function typedQueryProgramDefinitions2(httpClient, __options) {
|
|
603
961
|
return (query) => typedQueryProgramDefinitions(
|
|
604
962
|
query,
|
|
605
963
|
// @ts-ignore
|
|
606
|
-
{ httpClient }
|
|
964
|
+
{ httpClient, validateRequestSchema: __options?.validateRequestSchema }
|
|
607
965
|
);
|
|
608
966
|
}
|
|
609
967
|
|