@wix/auto_sdk_benefit-programs_pool-definition-items 1.0.8 → 1.0.9
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 +5 -14
- package/build/cjs/index.js +8 -312
- package/build/cjs/index.js.map +1 -1
- package/build/cjs/index.typings.d.ts +2 -188
- package/build/cjs/index.typings.js +4 -282
- package/build/cjs/index.typings.js.map +1 -1
- package/build/cjs/meta.d.ts +2 -3
- package/build/cjs/meta.js +0 -52
- package/build/cjs/meta.js.map +1 -1
- package/build/cjs/schemas.d.ts +1 -52
- package/build/cjs/schemas.js +0 -101
- package/build/cjs/schemas.js.map +1 -1
- package/build/es/index.d.mts +5 -14
- package/build/es/index.mjs +8 -303
- package/build/es/index.mjs.map +1 -1
- package/build/es/index.typings.d.mts +2 -188
- package/build/es/index.typings.mjs +4 -272
- package/build/es/index.typings.mjs.map +1 -1
- package/build/es/meta.d.mts +2 -3
- package/build/es/meta.mjs +0 -51
- package/build/es/meta.mjs.map +1 -1
- package/build/es/schemas.d.mts +1 -52
- package/build/es/schemas.mjs +0 -99
- package/build/es/schemas.mjs.map +1 -1
- package/build/internal/cjs/index.d.ts +5 -14
- package/build/internal/cjs/index.js +8 -312
- package/build/internal/cjs/index.js.map +1 -1
- package/build/internal/cjs/index.typings.d.ts +2 -188
- package/build/internal/cjs/index.typings.js +4 -282
- package/build/internal/cjs/index.typings.js.map +1 -1
- package/build/internal/cjs/meta.d.ts +2 -3
- package/build/internal/cjs/meta.js +0 -52
- package/build/internal/cjs/meta.js.map +1 -1
- package/build/internal/cjs/schemas.d.ts +1 -52
- package/build/internal/cjs/schemas.js +0 -101
- package/build/internal/cjs/schemas.js.map +1 -1
- package/build/internal/es/index.d.mts +5 -14
- package/build/internal/es/index.mjs +8 -303
- package/build/internal/es/index.mjs.map +1 -1
- package/build/internal/es/index.typings.d.mts +2 -188
- package/build/internal/es/index.typings.mjs +4 -272
- package/build/internal/es/index.typings.mjs.map +1 -1
- package/build/internal/es/meta.d.mts +2 -3
- package/build/internal/es/meta.mjs +0 -51
- package/build/internal/es/meta.mjs.map +1 -1
- package/build/internal/es/schemas.d.mts +1 -52
- package/build/internal/es/schemas.mjs +0 -99
- package/build/internal/es/schemas.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { QuerySpec, Query, NonNullablePaths } from '@wix/sdk-types';
|
|
1
|
+
import { NonNullablePaths } from '@wix/sdk-types';
|
|
3
2
|
|
|
4
3
|
interface PoolDefinitionItem {
|
|
5
4
|
/**
|
|
@@ -492,191 +491,6 @@ interface AccountInfo {
|
|
|
492
491
|
*/
|
|
493
492
|
siteId?: string | null;
|
|
494
493
|
}
|
|
495
|
-
/**
|
|
496
|
-
* Creates a query to retrieve a list of poolDefinitionItems.
|
|
497
|
-
*
|
|
498
|
-
* The `queryPoolDefinitionItems()` method builds a query to retrieve a list of poolDefinitionItems and returns a `PoolDefinitionItemsQueryBuilder` object.
|
|
499
|
-
*
|
|
500
|
-
* The returned object contains the query definition, which is used to run the query using the [`find()`](/poolDefinitionItems/poolDefinitionItems-query-builder/find) function.
|
|
501
|
-
*
|
|
502
|
-
* You can refine the query by chaining `PoolDefinitionItemsQueryBuilder` methods onto the query. `PoolDefinitionItemsQueryBuilder` methods enable you to filter, sort, and control the results that `queryPoolDefinitionItems()` returns.
|
|
503
|
-
*
|
|
504
|
-
* The following `PoolDefinitionItemsQueryBuilder` functions are supported for `queryPoolDefinitionItems()`. For a full description of the item object, see the object returned for the [`poolDefinitionItems`](/poolDefinitionItems/poolDefinitionItems-query-result/poolDefinitionItems) property in `PoolDefinitionItemsQueryResult`.
|
|
505
|
-
* @public
|
|
506
|
-
* @documentationMaturity preview
|
|
507
|
-
* @permissionId benefit_programs:v1:pool_definition_item:query_pool_definition_items
|
|
508
|
-
* @applicableIdentity APP
|
|
509
|
-
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems
|
|
510
|
-
*/
|
|
511
|
-
declare function queryPoolDefinitionItems(options?: QueryPoolDefinitionItemsOptions): PoolDefinitionItemsQueryBuilder;
|
|
512
|
-
interface QueryPoolDefinitionItemsOptions {
|
|
513
|
-
/**
|
|
514
|
-
* Fields to be included in the response.
|
|
515
|
-
* @maxSize 4
|
|
516
|
-
*/
|
|
517
|
-
fields?: RequestedFieldsWithLiterals[] | undefined;
|
|
518
|
-
}
|
|
519
|
-
interface QueryCursorResult {
|
|
520
|
-
cursors: Cursors;
|
|
521
|
-
hasNext: () => boolean;
|
|
522
|
-
hasPrev: () => boolean;
|
|
523
|
-
length: number;
|
|
524
|
-
pageSize: number;
|
|
525
|
-
}
|
|
526
|
-
interface PoolDefinitionItemsQueryResult extends QueryCursorResult {
|
|
527
|
-
items: PoolDefinitionItem[];
|
|
528
|
-
query: PoolDefinitionItemsQueryBuilder;
|
|
529
|
-
next: () => Promise<PoolDefinitionItemsQueryResult>;
|
|
530
|
-
prev: () => Promise<PoolDefinitionItemsQueryResult>;
|
|
531
|
-
}
|
|
532
|
-
interface PoolDefinitionItemsQueryBuilder {
|
|
533
|
-
/** @param propertyName - Property whose value is compared with `value`.
|
|
534
|
-
* @param value - Value to compare against.
|
|
535
|
-
* @documentationMaturity preview
|
|
536
|
-
*/
|
|
537
|
-
eq: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
538
|
-
/** @param propertyName - Property whose value is compared with `value`.
|
|
539
|
-
* @param value - Value to compare against.
|
|
540
|
-
* @documentationMaturity preview
|
|
541
|
-
*/
|
|
542
|
-
ne: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
543
|
-
/** @param propertyName - Property whose value is compared with `value`.
|
|
544
|
-
* @param value - Value to compare against.
|
|
545
|
-
* @documentationMaturity preview
|
|
546
|
-
*/
|
|
547
|
-
ge: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
548
|
-
/** @param propertyName - Property whose value is compared with `value`.
|
|
549
|
-
* @param value - Value to compare against.
|
|
550
|
-
* @documentationMaturity preview
|
|
551
|
-
*/
|
|
552
|
-
gt: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
553
|
-
/** @param propertyName - Property whose value is compared with `value`.
|
|
554
|
-
* @param value - Value to compare against.
|
|
555
|
-
* @documentationMaturity preview
|
|
556
|
-
*/
|
|
557
|
-
le: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
558
|
-
/** @param propertyName - Property whose value is compared with `value`.
|
|
559
|
-
* @param value - Value to compare against.
|
|
560
|
-
* @documentationMaturity preview
|
|
561
|
-
*/
|
|
562
|
-
lt: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
563
|
-
/** @param propertyName - Property whose value is compared with `string`.
|
|
564
|
-
* @param string - String to compare against. Case-insensitive.
|
|
565
|
-
* @documentationMaturity preview
|
|
566
|
-
*/
|
|
567
|
-
startsWith: (propertyName: '_id' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: string) => PoolDefinitionItemsQueryBuilder;
|
|
568
|
-
/** @param propertyName - Property whose value is compared with `values`.
|
|
569
|
-
* @param values - List of values to compare against.
|
|
570
|
-
* @documentationMaturity preview
|
|
571
|
-
*/
|
|
572
|
-
hasSome: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any[]) => PoolDefinitionItemsQueryBuilder;
|
|
573
|
-
/** @documentationMaturity preview */
|
|
574
|
-
in: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: any) => PoolDefinitionItemsQueryBuilder;
|
|
575
|
-
/** @documentationMaturity preview */
|
|
576
|
-
exists: (propertyName: '_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey', value: boolean) => PoolDefinitionItemsQueryBuilder;
|
|
577
|
-
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
578
|
-
* @documentationMaturity preview
|
|
579
|
-
*/
|
|
580
|
-
ascending: (...propertyNames: Array<'_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey'>) => PoolDefinitionItemsQueryBuilder;
|
|
581
|
-
/** @param propertyNames - Properties used in the sort. To sort by multiple properties, pass properties as additional arguments.
|
|
582
|
-
* @documentationMaturity preview
|
|
583
|
-
*/
|
|
584
|
-
descending: (...propertyNames: Array<'_id' | '_createdDate' | 'externalId' | 'category' | 'providerAppId' | 'namespace' | 'poolDefinitionId' | 'itemSetId' | 'programDefinitions.id' | 'programDefinitions.externalId' | 'benefitKey'>) => PoolDefinitionItemsQueryBuilder;
|
|
585
|
-
/** @param limit - Number of items to return, which is also the `pageSize` of the results object.
|
|
586
|
-
* @documentationMaturity preview
|
|
587
|
-
*/
|
|
588
|
-
limit: (limit: number) => PoolDefinitionItemsQueryBuilder;
|
|
589
|
-
/** @param cursor - A pointer to specific record
|
|
590
|
-
* @documentationMaturity preview
|
|
591
|
-
*/
|
|
592
|
-
skipTo: (cursor: string) => PoolDefinitionItemsQueryBuilder;
|
|
593
|
-
/** @documentationMaturity preview */
|
|
594
|
-
find: () => Promise<PoolDefinitionItemsQueryResult>;
|
|
595
|
-
}
|
|
596
|
-
/**
|
|
597
|
-
* @hidden
|
|
598
|
-
* @fqn wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems
|
|
599
|
-
* @requiredField query
|
|
600
|
-
*/
|
|
601
|
-
declare function typedQueryPoolDefinitionItems(query: PoolDefinitionItemQuery, options?: QueryPoolDefinitionItemsOptions): Promise<NonNullablePaths<QueryPoolDefinitionItemsResponse, `poolDefinitionItems` | `poolDefinitionItems.${number}._id` | `poolDefinitionItems.${number}.externalId` | `poolDefinitionItems.${number}.category` | `poolDefinitionItems.${number}.providerAppId` | `poolDefinitionItems.${number}.namespace` | `poolDefinitionItems.${number}.poolDefinitionId` | `poolDefinitionItems.${number}.itemSetId` | `poolDefinitionItems.${number}.itemId` | `poolDefinitionItems.${number}.benefitKey`, 4>>;
|
|
602
|
-
interface PoolDefinitionItemQuerySpec extends QuerySpec {
|
|
603
|
-
paging: 'cursor';
|
|
604
|
-
wql: [
|
|
605
|
-
{
|
|
606
|
-
fields: ['programDefinitions._id', 'programDefinitions.externalId'];
|
|
607
|
-
operators: ['$hasAll', '$hasSome'];
|
|
608
|
-
sort: 'BOTH';
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
fields: [
|
|
612
|
-
'_createdDate',
|
|
613
|
-
'_id',
|
|
614
|
-
'benefitKey',
|
|
615
|
-
'category',
|
|
616
|
-
'externalId',
|
|
617
|
-
'itemSetId',
|
|
618
|
-
'namespace',
|
|
619
|
-
'poolDefinitionId',
|
|
620
|
-
'providerAppId'
|
|
621
|
-
];
|
|
622
|
-
operators: '*';
|
|
623
|
-
sort: 'BOTH';
|
|
624
|
-
}
|
|
625
|
-
];
|
|
626
|
-
}
|
|
627
|
-
type CommonQueryWithEntityContext = Query<PoolDefinitionItem, PoolDefinitionItemQuerySpec>;
|
|
628
|
-
type PoolDefinitionItemQuery = {
|
|
629
|
-
/**
|
|
630
|
-
Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`.
|
|
631
|
-
*/
|
|
632
|
-
cursorPaging?: {
|
|
633
|
-
/**
|
|
634
|
-
Maximum number of items to return in the results.
|
|
635
|
-
@max: 1000
|
|
636
|
-
*/
|
|
637
|
-
limit?: NonNullable<CommonQueryWithEntityContext['cursorPaging']>['limit'] | null;
|
|
638
|
-
/**
|
|
639
|
-
Pointer to the next or previous page in the list of results.
|
|
640
|
-
|
|
641
|
-
Pass the relevant cursor token from the `pagingMetadata` object in the previous call's response.
|
|
642
|
-
Not relevant for the first request.
|
|
643
|
-
@maxLength: 16000
|
|
644
|
-
*/
|
|
645
|
-
cursor?: NonNullable<CommonQueryWithEntityContext['cursorPaging']>['cursor'] | null;
|
|
646
|
-
};
|
|
647
|
-
/**
|
|
648
|
-
Filter object in the following format:
|
|
649
|
-
`"filter" : {
|
|
650
|
-
"fieldName1": "value1",
|
|
651
|
-
"fieldName2":{"$operator":"value2"}
|
|
652
|
-
}`
|
|
653
|
-
Example of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`
|
|
654
|
-
*/
|
|
655
|
-
filter?: CommonQueryWithEntityContext['filter'] | null;
|
|
656
|
-
/**
|
|
657
|
-
Sort object in the following format:
|
|
658
|
-
`[{"fieldName":"sortField1","order":"ASC"},{"fieldName":"sortField2","order":"DESC"}]`
|
|
659
|
-
@maxSize: 5
|
|
660
|
-
*/
|
|
661
|
-
sort?: {
|
|
662
|
-
/**
|
|
663
|
-
Name of the field to sort by.
|
|
664
|
-
@maxLength: 512
|
|
665
|
-
*/
|
|
666
|
-
fieldName?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['fieldName'];
|
|
667
|
-
/**
|
|
668
|
-
Sort order.
|
|
669
|
-
*/
|
|
670
|
-
order?: NonNullable<CommonQueryWithEntityContext['sort']>[number]['order'];
|
|
671
|
-
}[];
|
|
672
|
-
};
|
|
673
|
-
declare const utils: {
|
|
674
|
-
query: {
|
|
675
|
-
QueryBuilder: () => _wix_sdk_types.QueryBuilder<PoolDefinitionItem, PoolDefinitionItemQuerySpec, PoolDefinitionItemQuery>;
|
|
676
|
-
Filter: _wix_sdk_types.FilterFactory<PoolDefinitionItem, PoolDefinitionItemQuerySpec>;
|
|
677
|
-
Sort: _wix_sdk_types.SortFactory<PoolDefinitionItemQuerySpec>;
|
|
678
|
-
};
|
|
679
|
-
};
|
|
680
494
|
/**
|
|
681
495
|
* Removes items from a benefit's item set, resolved by pool definition ID and benefit key.
|
|
682
496
|
* @param itemReferences - Items to remove from the benefit's item set.
|
|
@@ -732,4 +546,4 @@ interface AddItemsToBenefitOptions {
|
|
|
732
546
|
benefitKey: string;
|
|
733
547
|
}
|
|
734
548
|
|
|
735
|
-
export { type AccountInfo, type ActionEvent, type AddItemsToBenefitOptions, type AddItemsToBenefitRequest, type AddItemsToBenefitResponse, type BenefitInfo, type
|
|
549
|
+
export { type AccountInfo, type ActionEvent, type AddItemsToBenefitOptions, type AddItemsToBenefitRequest, type AddItemsToBenefitResponse, type BenefitInfo, type CreditConfiguration, type CursorPaging, type CursorPagingMetadata, type CursorQuery, type CursorQueryPagingMethodOneOf, type Cursors, type DomainEvent, type DomainEventBodyOneOf, type EntityCreatedEvent, type EntityDeletedEvent, type EntityUpdatedEvent, type IdentificationData, type IdentificationDataIdOneOf, type InvalidatePoolDefinitionItemsRequest, type InvalidatePoolDefinitionItemsResponse, type ItemInfo, type ItemReference, type MessageEnvelope, type PoolDefinitionInfo, type PoolDefinitionItem, type PoolDefinitionItemDeactivated, type ProgramDefinitionInfo, type QueryPoolDefinitionItemsRequest, type QueryPoolDefinitionItemsResponse, type RemoveItemsFromBenefitOptions, type RemoveItemsFromBenefitRequest, type RemoveItemsFromBenefitResponse, RequestedFields, type RequestedFieldsWithLiterals, type RestoreInfo, SortOrder, type SortOrderWithLiterals, type Sorting, WebhookIdentityType, type WebhookIdentityTypeWithLiterals, addItemsToBenefit, removeItemsFromBenefit };
|
|
@@ -1,14 +1,8 @@
|
|
|
1
1
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.universal.ts
|
|
2
2
|
import { transformError as sdkTransformError } from "@wix/sdk-runtime/transform-error";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
renameKeysFromSDKRequestToRESTRequest,
|
|
6
|
-
renameKeysFromRESTResponseToSDKResponse
|
|
7
|
-
} from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
3
|
+
import { renameKeysFromSDKRequestToRESTRequest } from "@wix/sdk-runtime/rename-all-nested-keys";
|
|
8
4
|
|
|
9
5
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.http.ts
|
|
10
|
-
import { transformRESTTimestampToSDKTimestamp } from "@wix/sdk-runtime/transformations/timestamp";
|
|
11
|
-
import { transformPaths } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
12
6
|
import { resolveUrl } from "@wix/sdk-runtime/rest-modules";
|
|
13
7
|
function resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(opts) {
|
|
14
8
|
const domainToMappings = {
|
|
@@ -34,34 +28,6 @@ function resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceU
|
|
|
34
28
|
return resolveUrl(Object.assign(opts, { domainToMappings }));
|
|
35
29
|
}
|
|
36
30
|
var PACKAGE_NAME = "@wix/auto_sdk_benefit-programs_pool-definition-items";
|
|
37
|
-
function queryPoolDefinitionItems(payload) {
|
|
38
|
-
function __queryPoolDefinitionItems({ host }) {
|
|
39
|
-
const metadata = {
|
|
40
|
-
entityFqdn: "wix.benefit_programs.v1.pool_definition_item",
|
|
41
|
-
method: "POST",
|
|
42
|
-
methodFqn: "wix.benefit_programs.v1.pool_definition_item.PoolDefinitionItemService.QueryPoolDefinitionItems",
|
|
43
|
-
packageName: PACKAGE_NAME,
|
|
44
|
-
migrationOptions: {
|
|
45
|
-
optInTransformResponse: true
|
|
46
|
-
},
|
|
47
|
-
url: resolveWixBenefitProgramsV1PoolDefinitionItemPoolDefinitionItemServiceUrl(
|
|
48
|
-
{ protoPath: "/v1/pool-definition-items/query", data: payload, host }
|
|
49
|
-
),
|
|
50
|
-
data: payload,
|
|
51
|
-
transformResponse: (payload2) => transformPaths(payload2, [
|
|
52
|
-
{
|
|
53
|
-
transformFn: transformRESTTimestampToSDKTimestamp,
|
|
54
|
-
paths: [
|
|
55
|
-
{ path: "poolDefinitionItems.createdDate" },
|
|
56
|
-
{ path: "poolDefinitionItems.updatedDate" }
|
|
57
|
-
]
|
|
58
|
-
}
|
|
59
|
-
])
|
|
60
|
-
};
|
|
61
|
-
return metadata;
|
|
62
|
-
}
|
|
63
|
-
return __queryPoolDefinitionItems;
|
|
64
|
-
}
|
|
65
31
|
function removeItemsFromBenefit(payload) {
|
|
66
32
|
function __removeItemsFromBenefit({ host }) {
|
|
67
33
|
const metadata = {
|
|
@@ -110,148 +76,6 @@ function addItemsToBenefit(payload) {
|
|
|
110
76
|
}
|
|
111
77
|
|
|
112
78
|
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.universal.ts
|
|
113
|
-
import { transformPaths as transformPaths2 } from "@wix/sdk-runtime/transformations/transform-paths";
|
|
114
|
-
|
|
115
|
-
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.schemas.ts
|
|
116
|
-
import * as z from "zod";
|
|
117
|
-
var QueryPoolDefinitionItemsRequest = z.object({
|
|
118
|
-
query: z.intersection(
|
|
119
|
-
z.object({
|
|
120
|
-
filter: z.record(z.string(), z.any()).describe(
|
|
121
|
-
'Filter object in the following format:\n`"filter" : {\n"fieldName1": "value1",\n"fieldName2":{"$operator":"value2"}\n}`\nExample of operators: `$eq`, `$ne`, `$lt`, `$lte`, `$gt`, `$gte`, `$in`, `$hasSome`, `$hasAll`, `$startsWith`, `$contains`'
|
|
122
|
-
).optional().nullable(),
|
|
123
|
-
sort: z.array(
|
|
124
|
-
z.object({
|
|
125
|
-
fieldName: z.string().describe("Name of the field to sort by.").max(512).optional(),
|
|
126
|
-
order: z.enum(["ASC", "DESC"]).optional()
|
|
127
|
-
})
|
|
128
|
-
).max(5).optional()
|
|
129
|
-
}),
|
|
130
|
-
z.xor([
|
|
131
|
-
z.object({ cursorPaging: z.never().optional() }),
|
|
132
|
-
z.object({
|
|
133
|
-
cursorPaging: z.object({
|
|
134
|
-
limit: z.number().int().describe("Maximum number of items to return in the results.").min(0).max(1e3).optional().nullable(),
|
|
135
|
-
cursor: z.string().describe(
|
|
136
|
-
"Pointer to the next or previous page in the list of results.\n\nPass the relevant cursor token from the `pagingMetadata` object in the previous call's response.\nNot relevant for the first request."
|
|
137
|
-
).max(16e3).optional().nullable()
|
|
138
|
-
}).describe(
|
|
139
|
-
"Cursor token pointing to a page of results. Not used in the first request. Following requests use the cursor token and not `filter` or `sort`."
|
|
140
|
-
)
|
|
141
|
-
})
|
|
142
|
-
])
|
|
143
|
-
).describe("Query to select benefit items."),
|
|
144
|
-
options: z.object({
|
|
145
|
-
fields: z.array(
|
|
146
|
-
z.enum(["POOL_DEFINITION", "PROGRAM_DEFINITION", "BENEFIT", "ITEM"])
|
|
147
|
-
).max(4).optional()
|
|
148
|
-
}).optional()
|
|
149
|
-
});
|
|
150
|
-
var QueryPoolDefinitionItemsResponse = z.object({
|
|
151
|
-
poolDefinitionItems: z.array(
|
|
152
|
-
z.object({
|
|
153
|
-
_id: z.string().describe("Benefit item ID.").regex(
|
|
154
|
-
/^[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}$/,
|
|
155
|
-
"Must be a valid GUID"
|
|
156
|
-
).optional(),
|
|
157
|
-
revision: z.string().regex(/^-?\d+$/, "Must be a valid Int64 string").describe(
|
|
158
|
-
"Revision number, which increments by 1 each time the benefit item is updated.\nTo prevent conflicting changes, the current revision must be passed when updating the item.\n\nIgnored when creating an item."
|
|
159
|
-
).optional().nullable(),
|
|
160
|
-
_createdDate: z.date().describe("Date and time the item was created.").optional().nullable(),
|
|
161
|
-
_updatedDate: z.date().describe("Date and time the item was updated.").optional().nullable(),
|
|
162
|
-
externalId: z.string().describe(
|
|
163
|
-
"External item ID assigned by the provider of the items.\n\nFor example, if the benefit items are products, this ID corresponds to the specific product ID in the supplier's system."
|
|
164
|
-
).regex(
|
|
165
|
-
/^[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}$/,
|
|
166
|
-
"Must be a valid GUID"
|
|
167
|
-
).optional(),
|
|
168
|
-
category: z.string().describe(
|
|
169
|
-
"Item category. Groups benefit items together for organization and management purposes. For example, classes, posts, groups."
|
|
170
|
-
).max(20).optional(),
|
|
171
|
-
providerAppId: z.string().describe(
|
|
172
|
-
"ID of the application providing the benefit item.\n\nID of the external application supplying the items. Each item's external ID is unique to its respective provider's application."
|
|
173
|
-
).regex(
|
|
174
|
-
/^[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}$/,
|
|
175
|
-
"Must be a valid GUID"
|
|
176
|
-
).optional(),
|
|
177
|
-
namespace: z.string().describe(
|
|
178
|
-
"Module name of the item provider's application that originated the items.\n\nFor example, `store-inventory` or `fitness-resources`."
|
|
179
|
-
).min(1).max(20).optional(),
|
|
180
|
-
poolDefinitionId: z.string().describe("Pool definition id").regex(
|
|
181
|
-
/^[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}$/,
|
|
182
|
-
"Must be a valid GUID"
|
|
183
|
-
).optional(),
|
|
184
|
-
itemSetId: z.string().describe("Item set ID.").regex(
|
|
185
|
-
/^[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}$/,
|
|
186
|
-
"Must be a valid GUID"
|
|
187
|
-
).optional(),
|
|
188
|
-
itemId: z.string().describe("Item set ID.").regex(
|
|
189
|
-
/^[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}$/,
|
|
190
|
-
"Must be a valid GUID"
|
|
191
|
-
).optional(),
|
|
192
|
-
benefitKey: z.string().describe(
|
|
193
|
-
"Unique identifier for the benefit associated with this item."
|
|
194
|
-
).max(64).optional()
|
|
195
|
-
})
|
|
196
|
-
).optional(),
|
|
197
|
-
metadata: z.object({
|
|
198
|
-
count: z.number().int().describe("Number of items returned in the response.").optional().nullable(),
|
|
199
|
-
cursors: z.object({
|
|
200
|
-
next: z.string().describe(
|
|
201
|
-
"Cursor string pointing to the next page in the list of results."
|
|
202
|
-
).max(16e3).optional().nullable(),
|
|
203
|
-
prev: z.string().describe(
|
|
204
|
-
"Cursor pointing to the previous page in the list of results."
|
|
205
|
-
).max(16e3).optional().nullable()
|
|
206
|
-
}).describe(
|
|
207
|
-
"Cursor strings that point to the next page, previous page, or both."
|
|
208
|
-
).optional(),
|
|
209
|
-
hasNext: z.boolean().describe(
|
|
210
|
-
"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."
|
|
211
|
-
).optional().nullable()
|
|
212
|
-
}).describe("Metadata for paginated results.").optional()
|
|
213
|
-
});
|
|
214
|
-
var RemoveItemsFromBenefitRequest = z.object({
|
|
215
|
-
itemReferences: z.array(
|
|
216
|
-
z.object({
|
|
217
|
-
externalId: z.string().describe("External item ID assigned by the provider.").regex(
|
|
218
|
-
/^[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}$/,
|
|
219
|
-
"Must be a valid GUID"
|
|
220
|
-
),
|
|
221
|
-
category: z.string().describe("Item category.").max(20).optional()
|
|
222
|
-
})
|
|
223
|
-
).min(1).max(100),
|
|
224
|
-
options: z.object({
|
|
225
|
-
poolDefinitionId: z.string().describe("ID of the pool definition associated with the benefit.").regex(
|
|
226
|
-
/^[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}$/,
|
|
227
|
-
"Must be a valid GUID"
|
|
228
|
-
),
|
|
229
|
-
benefitKey: z.string().describe("Key identifying the benefit within the pool definition.").max(64)
|
|
230
|
-
})
|
|
231
|
-
});
|
|
232
|
-
var RemoveItemsFromBenefitResponse = z.object({});
|
|
233
|
-
var AddItemsToBenefitRequest = z.object({
|
|
234
|
-
itemReferences: z.array(
|
|
235
|
-
z.object({
|
|
236
|
-
externalId: z.string().describe("External item ID assigned by the provider.").regex(
|
|
237
|
-
/^[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}$/,
|
|
238
|
-
"Must be a valid GUID"
|
|
239
|
-
),
|
|
240
|
-
category: z.string().describe("Item category.").max(20).optional()
|
|
241
|
-
})
|
|
242
|
-
).min(1).max(100),
|
|
243
|
-
options: z.object({
|
|
244
|
-
poolDefinitionId: z.string().describe("ID of the pool definition associated with the benefit.").regex(
|
|
245
|
-
/^[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}$/,
|
|
246
|
-
"Must be a valid GUID"
|
|
247
|
-
),
|
|
248
|
-
benefitKey: z.string().describe("Key identifying the benefit within the pool definition.").max(64)
|
|
249
|
-
})
|
|
250
|
-
});
|
|
251
|
-
var AddItemsToBenefitResponse = z.object({});
|
|
252
|
-
|
|
253
|
-
// src/benefit-programs-v1-pool-definition-item-pool-definition-items.universal.ts
|
|
254
|
-
import { createQueryUtils } from "@wix/sdk-runtime/query-builder-utils";
|
|
255
79
|
var SortOrder = /* @__PURE__ */ ((SortOrder2) => {
|
|
256
80
|
SortOrder2["ASC"] = "ASC";
|
|
257
81
|
SortOrder2["DESC"] = "DESC";
|
|
@@ -272,94 +96,8 @@ var WebhookIdentityType = /* @__PURE__ */ ((WebhookIdentityType2) => {
|
|
|
272
96
|
WebhookIdentityType2["APP"] = "APP";
|
|
273
97
|
return WebhookIdentityType2;
|
|
274
98
|
})(WebhookIdentityType || {});
|
|
275
|
-
function queryPoolDefinitionItems2(options) {
|
|
276
|
-
const { httpClient, sideEffects } = arguments[1];
|
|
277
|
-
return queryBuilder({
|
|
278
|
-
func: async (payload) => {
|
|
279
|
-
const reqOpts = queryPoolDefinitionItems(
|
|
280
|
-
{ ...payload, ...options ?? {} }
|
|
281
|
-
);
|
|
282
|
-
sideEffects?.onSiteCall?.();
|
|
283
|
-
try {
|
|
284
|
-
const result = await httpClient.request(reqOpts);
|
|
285
|
-
sideEffects?.onSuccess?.(result);
|
|
286
|
-
return result;
|
|
287
|
-
} catch (err) {
|
|
288
|
-
sideEffects?.onError?.(err);
|
|
289
|
-
throw err;
|
|
290
|
-
}
|
|
291
|
-
},
|
|
292
|
-
requestTransformer: (query) => {
|
|
293
|
-
const args = [query, options];
|
|
294
|
-
return renameKeysFromSDKRequestToRESTRequest({
|
|
295
|
-
...args?.[1],
|
|
296
|
-
query: args?.[0]
|
|
297
|
-
});
|
|
298
|
-
},
|
|
299
|
-
responseTransformer: ({
|
|
300
|
-
data
|
|
301
|
-
}) => {
|
|
302
|
-
const transformedData = renameKeysFromRESTResponseToSDKResponse(
|
|
303
|
-
transformPaths2(data, [])
|
|
304
|
-
);
|
|
305
|
-
return {
|
|
306
|
-
items: transformedData?.poolDefinitionItems,
|
|
307
|
-
pagingMetadata: transformedData?.metadata
|
|
308
|
-
};
|
|
309
|
-
},
|
|
310
|
-
errorTransformer: (err) => {
|
|
311
|
-
const transformedError = sdkTransformError(err, {
|
|
312
|
-
spreadPathsToArguments: {},
|
|
313
|
-
explicitPathsToArguments: { query: "$[0]" },
|
|
314
|
-
singleArgumentUnchanged: false
|
|
315
|
-
});
|
|
316
|
-
throw transformedError;
|
|
317
|
-
},
|
|
318
|
-
pagingMethod: "CURSOR",
|
|
319
|
-
transformationPaths: {}
|
|
320
|
-
});
|
|
321
|
-
}
|
|
322
|
-
async function typedQueryPoolDefinitionItems(query, options) {
|
|
323
|
-
const { httpClient, sideEffects, validateRequestSchema } = arguments[2];
|
|
324
|
-
if (validateRequestSchema) {
|
|
325
|
-
QueryPoolDefinitionItemsRequest.parse({ query, options });
|
|
326
|
-
}
|
|
327
|
-
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
328
|
-
query,
|
|
329
|
-
...options
|
|
330
|
-
});
|
|
331
|
-
const reqOpts = queryPoolDefinitionItems(
|
|
332
|
-
payload
|
|
333
|
-
);
|
|
334
|
-
sideEffects?.onSiteCall?.();
|
|
335
|
-
try {
|
|
336
|
-
const result = await httpClient.request(reqOpts);
|
|
337
|
-
sideEffects?.onSuccess?.(result);
|
|
338
|
-
return renameKeysFromRESTResponseToSDKResponse(result.data);
|
|
339
|
-
} catch (err) {
|
|
340
|
-
const transformedError = sdkTransformError(
|
|
341
|
-
err,
|
|
342
|
-
{
|
|
343
|
-
spreadPathsToArguments: {},
|
|
344
|
-
explicitPathsToArguments: { query: "$[0]" },
|
|
345
|
-
singleArgumentUnchanged: false
|
|
346
|
-
},
|
|
347
|
-
["query", "options"]
|
|
348
|
-
);
|
|
349
|
-
sideEffects?.onError?.(err);
|
|
350
|
-
throw transformedError;
|
|
351
|
-
}
|
|
352
|
-
}
|
|
353
|
-
var utils = {
|
|
354
|
-
query: {
|
|
355
|
-
...createQueryUtils()
|
|
356
|
-
}
|
|
357
|
-
};
|
|
358
99
|
async function removeItemsFromBenefit2(itemReferences, options) {
|
|
359
|
-
const { httpClient, sideEffects
|
|
360
|
-
if (validateRequestSchema) {
|
|
361
|
-
RemoveItemsFromBenefitRequest.parse({ itemReferences, options });
|
|
362
|
-
}
|
|
100
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
363
101
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
364
102
|
itemReferences,
|
|
365
103
|
poolDefinitionId: options?.poolDefinitionId,
|
|
@@ -391,10 +129,7 @@ async function removeItemsFromBenefit2(itemReferences, options) {
|
|
|
391
129
|
}
|
|
392
130
|
}
|
|
393
131
|
async function addItemsToBenefit2(itemReferences, options) {
|
|
394
|
-
const { httpClient, sideEffects
|
|
395
|
-
if (validateRequestSchema) {
|
|
396
|
-
AddItemsToBenefitRequest.parse({ itemReferences, options });
|
|
397
|
-
}
|
|
132
|
+
const { httpClient, sideEffects } = arguments[2];
|
|
398
133
|
const payload = renameKeysFromSDKRequestToRESTRequest({
|
|
399
134
|
itemReferences,
|
|
400
135
|
poolDefinitionId: options?.poolDefinitionId,
|
|
@@ -428,9 +163,6 @@ export {
|
|
|
428
163
|
SortOrder,
|
|
429
164
|
WebhookIdentityType,
|
|
430
165
|
addItemsToBenefit2 as addItemsToBenefit,
|
|
431
|
-
|
|
432
|
-
removeItemsFromBenefit2 as removeItemsFromBenefit,
|
|
433
|
-
typedQueryPoolDefinitionItems,
|
|
434
|
-
utils
|
|
166
|
+
removeItemsFromBenefit2 as removeItemsFromBenefit
|
|
435
167
|
};
|
|
436
168
|
//# sourceMappingURL=index.typings.mjs.map
|