@unified-api/typescript-sdk 2.80.7 → 2.80.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/README.md +12 -0
- package/examples/package-lock.json +1 -1
- package/funcs/commerceCreateCommerceSaleschannel.d.ts +15 -0
- package/funcs/commerceCreateCommerceSaleschannel.d.ts.map +1 -0
- package/funcs/commerceCreateCommerceSaleschannel.js +124 -0
- package/funcs/commerceCreateCommerceSaleschannel.js.map +1 -0
- package/funcs/commerceGetCommerceSaleschannel.d.ts +15 -0
- package/funcs/commerceGetCommerceSaleschannel.d.ts.map +1 -0
- package/funcs/commerceGetCommerceSaleschannel.js +125 -0
- package/funcs/commerceGetCommerceSaleschannel.js.map +1 -0
- package/funcs/commerceListCommerceCollections.js +1 -0
- package/funcs/commerceListCommerceCollections.js.map +1 -1
- package/funcs/commerceListCommerceSaleschannels.d.ts +15 -0
- package/funcs/commerceListCommerceSaleschannels.d.ts.map +1 -0
- package/funcs/commerceListCommerceSaleschannels.js +128 -0
- package/funcs/commerceListCommerceSaleschannels.js.map +1 -0
- package/funcs/commercePatchCommerceSaleschannel.d.ts +15 -0
- package/funcs/commercePatchCommerceSaleschannel.d.ts.map +1 -0
- package/funcs/commercePatchCommerceSaleschannel.js +128 -0
- package/funcs/commercePatchCommerceSaleschannel.js.map +1 -0
- package/funcs/commerceRemoveCommerceSaleschannel.d.ts +14 -0
- package/funcs/commerceRemoveCommerceSaleschannel.d.ts.map +1 -0
- package/funcs/commerceRemoveCommerceSaleschannel.js +122 -0
- package/funcs/commerceRemoveCommerceSaleschannel.js.map +1 -0
- package/funcs/commerceUpdateCommerceSaleschannel.d.ts +15 -0
- package/funcs/commerceUpdateCommerceSaleschannel.d.ts.map +1 -0
- package/funcs/commerceUpdateCommerceSaleschannel.js +128 -0
- package/funcs/commerceUpdateCommerceSaleschannel.js.map +1 -0
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/package.json +1 -1
- package/sdk/commerce.d.ts +24 -0
- package/sdk/commerce.d.ts.map +1 -1
- package/sdk/commerce.js +42 -0
- package/sdk/commerce.js.map +1 -1
- package/sdk/models/operations/createcommercesaleschannel.d.ts +28 -0
- package/sdk/models/operations/createcommercesaleschannel.d.ts.map +1 -0
- package/sdk/models/operations/createcommercesaleschannel.js +59 -0
- package/sdk/models/operations/createcommercesaleschannel.js.map +1 -0
- package/sdk/models/operations/getcommercesaleschannel.d.ts +30 -0
- package/sdk/models/operations/getcommercesaleschannel.d.ts.map +1 -0
- package/sdk/models/operations/getcommercesaleschannel.js +57 -0
- package/sdk/models/operations/getcommercesaleschannel.js.map +1 -0
- package/sdk/models/operations/index.d.ts +6 -0
- package/sdk/models/operations/index.d.ts.map +1 -1
- package/sdk/models/operations/index.js +6 -0
- package/sdk/models/operations/index.js.map +1 -1
- package/sdk/models/operations/listcommercecollections.d.ts +5 -0
- package/sdk/models/operations/listcommercecollections.d.ts.map +1 -1
- package/sdk/models/operations/listcommercecollections.js +2 -0
- package/sdk/models/operations/listcommercecollections.js.map +1 -1
- package/sdk/models/operations/listcommercesaleschannels.d.ts +43 -0
- package/sdk/models/operations/listcommercesaleschannels.d.ts.map +1 -0
- package/sdk/models/operations/listcommercesaleschannels.js +63 -0
- package/sdk/models/operations/listcommercesaleschannels.js.map +1 -0
- package/sdk/models/operations/patchcommercesaleschannel.d.ts +33 -0
- package/sdk/models/operations/patchcommercesaleschannel.d.ts.map +1 -0
- package/sdk/models/operations/patchcommercesaleschannel.js +60 -0
- package/sdk/models/operations/patchcommercesaleschannel.js.map +1 -0
- package/sdk/models/operations/removecommercesaleschannel.d.ts +30 -0
- package/sdk/models/operations/removecommercesaleschannel.d.ts.map +1 -0
- package/sdk/models/operations/removecommercesaleschannel.js +68 -0
- package/sdk/models/operations/removecommercesaleschannel.js.map +1 -0
- package/sdk/models/operations/updatecommercesaleschannel.d.ts +33 -0
- package/sdk/models/operations/updatecommercesaleschannel.d.ts.map +1 -0
- package/sdk/models/operations/updatecommercesaleschannel.js +60 -0
- package/sdk/models/operations/updatecommercesaleschannel.js.map +1 -0
- package/sdk/models/shared/accountinglineitem.d.ts +2 -0
- package/sdk/models/shared/accountinglineitem.d.ts.map +1 -1
- package/sdk/models/shared/accountinglineitem.js +4 -0
- package/sdk/models/shared/accountinglineitem.js.map +1 -1
- package/sdk/models/shared/commercecollection.d.ts +0 -5
- package/sdk/models/shared/commercecollection.d.ts.map +1 -1
- package/sdk/models/shared/commercecollection.js +0 -4
- package/sdk/models/shared/commercecollection.js.map +1 -1
- package/sdk/models/shared/commercemetadata.d.ts +0 -4
- package/sdk/models/shared/commercemetadata.d.ts.map +1 -1
- package/sdk/models/shared/commercemetadata.js +0 -4
- package/sdk/models/shared/commercemetadata.js.map +1 -1
- package/sdk/models/shared/commercereference.d.ts +19 -0
- package/sdk/models/shared/commercereference.d.ts.map +1 -0
- package/sdk/models/shared/commercereference.js +60 -0
- package/sdk/models/shared/commercereference.js.map +1 -0
- package/sdk/models/shared/commercesaleschannel.d.ts +42 -0
- package/sdk/models/shared/commercesaleschannel.d.ts.map +1 -0
- package/sdk/models/shared/commercesaleschannel.js +93 -0
- package/sdk/models/shared/commercesaleschannel.js.map +1 -0
- package/sdk/models/shared/index.d.ts +2 -0
- package/sdk/models/shared/index.d.ts.map +1 -1
- package/sdk/models/shared/index.js +2 -0
- package/sdk/models/shared/index.js.map +1 -1
- package/sdk/models/shared/integrationsupport.d.ts +27 -0
- package/sdk/models/shared/integrationsupport.d.ts.map +1 -1
- package/sdk/models/shared/integrationsupport.js +33 -5
- package/sdk/models/shared/integrationsupport.js.map +1 -1
- package/sdk/models/shared/propertyconnectionpermissions.d.ts +2 -0
- package/sdk/models/shared/propertyconnectionpermissions.d.ts.map +1 -1
- package/sdk/models/shared/propertyconnectionpermissions.js +2 -0
- package/sdk/models/shared/propertyconnectionpermissions.js.map +1 -1
- package/sdk/models/shared/webhook.d.ts +1 -0
- package/sdk/models/shared/webhook.d.ts.map +1 -1
- package/sdk/models/shared/webhook.js +1 -0
- package/sdk/models/shared/webhook.js.map +1 -1
- package/sdk/saleschannel.d.ts +30 -0
- package/sdk/saleschannel.d.ts.map +1 -0
- package/sdk/saleschannel.js +54 -0
- package/sdk/saleschannel.js.map +1 -0
- package/sdk/sdk.d.ts +3 -0
- package/sdk/sdk.d.ts.map +1 -1
- package/sdk/sdk.js +4 -0
- package/sdk/sdk.js.map +1 -1
- package/sdk/types/enums.d.ts +1 -8
- package/sdk/types/enums.d.ts.map +1 -1
- package/sdk/types/enums.js +3 -21
- package/sdk/types/enums.js.map +1 -1
- package/sdk/types/index.d.ts +2 -1
- package/sdk/types/index.d.ts.map +1 -1
- package/sdk/types/index.js +15 -0
- package/sdk/types/index.js.map +1 -1
- package/sdk/types/unrecognized.d.ts +10 -0
- package/sdk/types/unrecognized.d.ts.map +1 -0
- package/sdk/types/unrecognized.js +26 -0
- package/sdk/types/unrecognized.js.map +1 -0
- package/src/funcs/commerceCreateCommerceSaleschannel.ts +173 -0
- package/src/funcs/commerceGetCommerceSaleschannel.ts +176 -0
- package/src/funcs/commerceListCommerceCollections.ts +1 -0
- package/src/funcs/commerceListCommerceSaleschannels.ts +177 -0
- package/src/funcs/commercePatchCommerceSaleschannel.ts +179 -0
- package/src/funcs/commerceRemoveCommerceSaleschannel.ts +181 -0
- package/src/funcs/commerceUpdateCommerceSaleschannel.ts +179 -0
- package/src/lib/config.ts +3 -3
- package/src/sdk/commerce.ts +90 -0
- package/src/sdk/models/operations/createcommercesaleschannel.ts +58 -0
- package/src/sdk/models/operations/getcommercesaleschannel.ts +59 -0
- package/src/sdk/models/operations/index.ts +6 -0
- package/src/sdk/models/operations/listcommercecollections.ts +7 -0
- package/src/sdk/models/operations/listcommercesaleschannels.ts +78 -0
- package/src/sdk/models/operations/patchcommercesaleschannel.ts +64 -0
- package/src/sdk/models/operations/removecommercesaleschannel.ts +78 -0
- package/src/sdk/models/operations/updatecommercesaleschannel.ts +64 -0
- package/src/sdk/models/shared/accountinglineitem.ts +6 -0
- package/src/sdk/models/shared/commercecollection.ts +0 -9
- package/src/sdk/models/shared/commercemetadata.ts +0 -8
- package/src/sdk/models/shared/commercereference.ts +55 -0
- package/src/sdk/models/shared/commercesaleschannel.ts +115 -0
- package/src/sdk/models/shared/index.ts +2 -0
- package/src/sdk/models/shared/integrationsupport.ts +54 -0
- package/src/sdk/models/shared/propertyconnectionpermissions.ts +2 -0
- package/src/sdk/models/shared/webhook.ts +1 -0
- package/src/sdk/saleschannel.ts +100 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/types/enums.ts +1 -21
- package/src/sdk/types/index.ts +2 -1
- package/src/sdk/types/unrecognized.ts +27 -0
|
@@ -24,6 +24,7 @@ export type AccountingLineitem = {
|
|
|
24
24
|
itemId?: string | undefined;
|
|
25
25
|
itemName?: string | undefined;
|
|
26
26
|
itemSku?: string | undefined;
|
|
27
|
+
itemVariants?: Array<AccountingReference> | undefined;
|
|
27
28
|
locations?: Array<AccountingReference> | undefined;
|
|
28
29
|
notes?: string | undefined;
|
|
29
30
|
refundAmount?: number | undefined;
|
|
@@ -52,6 +53,7 @@ export const AccountingLineitem$inboundSchema: z.ZodType<
|
|
|
52
53
|
item_id: z.string().optional(),
|
|
53
54
|
item_name: z.string().optional(),
|
|
54
55
|
item_sku: z.string().optional(),
|
|
56
|
+
item_variants: z.array(AccountingReference$inboundSchema).optional(),
|
|
55
57
|
locations: z.array(AccountingReference$inboundSchema).optional(),
|
|
56
58
|
notes: z.string().optional(),
|
|
57
59
|
refund_amount: z.number().optional(),
|
|
@@ -74,6 +76,7 @@ export const AccountingLineitem$inboundSchema: z.ZodType<
|
|
|
74
76
|
"item_id": "itemId",
|
|
75
77
|
"item_name": "itemName",
|
|
76
78
|
"item_sku": "itemSku",
|
|
79
|
+
"item_variants": "itemVariants",
|
|
77
80
|
"refund_amount": "refundAmount",
|
|
78
81
|
"refunded_at": "refundedAt",
|
|
79
82
|
"tax_amount": "taxAmount",
|
|
@@ -95,6 +98,7 @@ export type AccountingLineitem$Outbound = {
|
|
|
95
98
|
item_id?: string | undefined;
|
|
96
99
|
item_name?: string | undefined;
|
|
97
100
|
item_sku?: string | undefined;
|
|
101
|
+
item_variants?: Array<AccountingReference$Outbound> | undefined;
|
|
98
102
|
locations?: Array<AccountingReference$Outbound> | undefined;
|
|
99
103
|
notes?: string | undefined;
|
|
100
104
|
refund_amount?: number | undefined;
|
|
@@ -122,6 +126,7 @@ export const AccountingLineitem$outboundSchema: z.ZodType<
|
|
|
122
126
|
itemId: z.string().optional(),
|
|
123
127
|
itemName: z.string().optional(),
|
|
124
128
|
itemSku: z.string().optional(),
|
|
129
|
+
itemVariants: z.array(AccountingReference$outboundSchema).optional(),
|
|
125
130
|
locations: z.array(AccountingReference$outboundSchema).optional(),
|
|
126
131
|
notes: z.string().optional(),
|
|
127
132
|
refundAmount: z.number().optional(),
|
|
@@ -142,6 +147,7 @@ export const AccountingLineitem$outboundSchema: z.ZodType<
|
|
|
142
147
|
itemId: "item_id",
|
|
143
148
|
itemName: "item_name",
|
|
144
149
|
itemSku: "item_sku",
|
|
150
|
+
itemVariants: "item_variants",
|
|
145
151
|
refundAmount: "refund_amount",
|
|
146
152
|
refundedAt: "refunded_at",
|
|
147
153
|
taxAmount: "tax_amount",
|
|
@@ -39,10 +39,6 @@ export type CommerceCollection = {
|
|
|
39
39
|
isActive?: boolean | undefined;
|
|
40
40
|
isFeatured?: boolean | undefined;
|
|
41
41
|
isVisible?: boolean | undefined;
|
|
42
|
-
/**
|
|
43
|
-
* includes the list of metadata_metadata required to create a commerce_item under the respective commerce_collection
|
|
44
|
-
*/
|
|
45
|
-
itemMetadata?: Array<CommerceMetadata> | undefined;
|
|
46
42
|
media?: Array<CommerceItemMedia> | undefined;
|
|
47
43
|
metadata?: Array<CommerceMetadata> | undefined;
|
|
48
44
|
name: string;
|
|
@@ -81,7 +77,6 @@ export const CommerceCollection$inboundSchema: z.ZodType<
|
|
|
81
77
|
is_active: z.boolean().optional(),
|
|
82
78
|
is_featured: z.boolean().optional(),
|
|
83
79
|
is_visible: z.boolean().optional(),
|
|
84
|
-
item_metadata: z.array(CommerceMetadata$inboundSchema).optional(),
|
|
85
80
|
media: z.array(CommerceItemMedia$inboundSchema).optional(),
|
|
86
81
|
metadata: z.array(CommerceMetadata$inboundSchema).optional(),
|
|
87
82
|
name: z.string(),
|
|
@@ -99,7 +94,6 @@ export const CommerceCollection$inboundSchema: z.ZodType<
|
|
|
99
94
|
"is_active": "isActive",
|
|
100
95
|
"is_featured": "isFeatured",
|
|
101
96
|
"is_visible": "isVisible",
|
|
102
|
-
"item_metadata": "itemMetadata",
|
|
103
97
|
"parent_id": "parentId",
|
|
104
98
|
"public_description": "publicDescription",
|
|
105
99
|
"public_name": "publicName",
|
|
@@ -114,7 +108,6 @@ export type CommerceCollection$Outbound = {
|
|
|
114
108
|
is_active?: boolean | undefined;
|
|
115
109
|
is_featured?: boolean | undefined;
|
|
116
110
|
is_visible?: boolean | undefined;
|
|
117
|
-
item_metadata?: Array<CommerceMetadata$Outbound> | undefined;
|
|
118
111
|
media?: Array<CommerceItemMedia$Outbound> | undefined;
|
|
119
112
|
metadata?: Array<CommerceMetadata$Outbound> | undefined;
|
|
120
113
|
name: string;
|
|
@@ -139,7 +132,6 @@ export const CommerceCollection$outboundSchema: z.ZodType<
|
|
|
139
132
|
isActive: z.boolean().optional(),
|
|
140
133
|
isFeatured: z.boolean().optional(),
|
|
141
134
|
isVisible: z.boolean().optional(),
|
|
142
|
-
itemMetadata: z.array(CommerceMetadata$outboundSchema).optional(),
|
|
143
135
|
media: z.array(CommerceItemMedia$outboundSchema).optional(),
|
|
144
136
|
metadata: z.array(CommerceMetadata$outboundSchema).optional(),
|
|
145
137
|
name: z.string(),
|
|
@@ -156,7 +148,6 @@ export const CommerceCollection$outboundSchema: z.ZodType<
|
|
|
156
148
|
isActive: "is_active",
|
|
157
149
|
isFeatured: "is_featured",
|
|
158
150
|
isVisible: "is_visible",
|
|
159
|
-
itemMetadata: "item_metadata",
|
|
160
151
|
parentId: "parent_id",
|
|
161
152
|
publicDescription: "public_description",
|
|
162
153
|
publicName: "public_name",
|
|
@@ -54,7 +54,6 @@ export type CommerceMetadataValue =
|
|
|
54
54
|
| Array<CommerceMetadataSchemas1 | string | number | boolean>;
|
|
55
55
|
|
|
56
56
|
export type CommerceMetadata = {
|
|
57
|
-
description?: string | undefined;
|
|
58
57
|
extraData?:
|
|
59
58
|
| { [k: string]: any }
|
|
60
59
|
| string
|
|
@@ -66,7 +65,6 @@ export type CommerceMetadata = {
|
|
|
66
65
|
id?: string | undefined;
|
|
67
66
|
key?: string | undefined;
|
|
68
67
|
namespace?: string | undefined;
|
|
69
|
-
required?: boolean | undefined;
|
|
70
68
|
slug?: string | undefined;
|
|
71
69
|
type?: string | undefined;
|
|
72
70
|
value?:
|
|
@@ -385,7 +383,6 @@ export const CommerceMetadata$inboundSchema: z.ZodType<
|
|
|
385
383
|
z.ZodTypeDef,
|
|
386
384
|
unknown
|
|
387
385
|
> = z.object({
|
|
388
|
-
description: z.string().optional(),
|
|
389
386
|
extra_data: z.union([
|
|
390
387
|
z.record(z.any()),
|
|
391
388
|
z.string(),
|
|
@@ -404,7 +401,6 @@ export const CommerceMetadata$inboundSchema: z.ZodType<
|
|
|
404
401
|
id: z.string().optional(),
|
|
405
402
|
key: z.string().optional(),
|
|
406
403
|
namespace: z.string().optional(),
|
|
407
|
-
required: z.boolean().optional(),
|
|
408
404
|
slug: z.string().optional(),
|
|
409
405
|
type: z.string().optional(),
|
|
410
406
|
value: z.union([
|
|
@@ -428,7 +424,6 @@ export const CommerceMetadata$inboundSchema: z.ZodType<
|
|
|
428
424
|
});
|
|
429
425
|
/** @internal */
|
|
430
426
|
export type CommerceMetadata$Outbound = {
|
|
431
|
-
description?: string | undefined;
|
|
432
427
|
extra_data?:
|
|
433
428
|
| { [k: string]: any }
|
|
434
429
|
| string
|
|
@@ -440,7 +435,6 @@ export type CommerceMetadata$Outbound = {
|
|
|
440
435
|
id?: string | undefined;
|
|
441
436
|
key?: string | undefined;
|
|
442
437
|
namespace?: string | undefined;
|
|
443
|
-
required?: boolean | undefined;
|
|
444
438
|
slug?: string | undefined;
|
|
445
439
|
type?: string | undefined;
|
|
446
440
|
value?:
|
|
@@ -458,7 +452,6 @@ export const CommerceMetadata$outboundSchema: z.ZodType<
|
|
|
458
452
|
z.ZodTypeDef,
|
|
459
453
|
CommerceMetadata
|
|
460
454
|
> = z.object({
|
|
461
|
-
description: z.string().optional(),
|
|
462
455
|
extraData: z.union([
|
|
463
456
|
z.record(z.any()),
|
|
464
457
|
z.string(),
|
|
@@ -477,7 +470,6 @@ export const CommerceMetadata$outboundSchema: z.ZodType<
|
|
|
477
470
|
id: z.string().optional(),
|
|
478
471
|
key: z.string().optional(),
|
|
479
472
|
namespace: z.string().optional(),
|
|
480
|
-
required: z.boolean().optional(),
|
|
481
473
|
slug: z.string().optional(),
|
|
482
474
|
type: z.string().optional(),
|
|
483
475
|
value: z.union([
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { safeParse } from "../../../lib/schemas.js";
|
|
7
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
8
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
9
|
+
|
|
10
|
+
export type CommerceReference = {
|
|
11
|
+
id?: string | undefined;
|
|
12
|
+
name?: string | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const CommerceReference$inboundSchema: z.ZodType<
|
|
17
|
+
CommerceReference,
|
|
18
|
+
z.ZodTypeDef,
|
|
19
|
+
unknown
|
|
20
|
+
> = z.object({
|
|
21
|
+
id: z.string().optional(),
|
|
22
|
+
name: z.string().optional(),
|
|
23
|
+
});
|
|
24
|
+
/** @internal */
|
|
25
|
+
export type CommerceReference$Outbound = {
|
|
26
|
+
id?: string | undefined;
|
|
27
|
+
name?: string | undefined;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export const CommerceReference$outboundSchema: z.ZodType<
|
|
32
|
+
CommerceReference$Outbound,
|
|
33
|
+
z.ZodTypeDef,
|
|
34
|
+
CommerceReference
|
|
35
|
+
> = z.object({
|
|
36
|
+
id: z.string().optional(),
|
|
37
|
+
name: z.string().optional(),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export function commerceReferenceToJSON(
|
|
41
|
+
commerceReference: CommerceReference,
|
|
42
|
+
): string {
|
|
43
|
+
return JSON.stringify(
|
|
44
|
+
CommerceReference$outboundSchema.parse(commerceReference),
|
|
45
|
+
);
|
|
46
|
+
}
|
|
47
|
+
export function commerceReferenceFromJSON(
|
|
48
|
+
jsonString: string,
|
|
49
|
+
): SafeParseResult<CommerceReference, SDKValidationError> {
|
|
50
|
+
return safeParse(
|
|
51
|
+
jsonString,
|
|
52
|
+
(x) => CommerceReference$inboundSchema.parse(JSON.parse(x)),
|
|
53
|
+
`Failed to parse 'CommerceReference' from JSON`,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v3";
|
|
6
|
+
import { remap as remap$ } from "../../../lib/primitives.js";
|
|
7
|
+
import { safeParse } from "../../../lib/schemas.js";
|
|
8
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
9
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
10
|
+
import {
|
|
11
|
+
CommerceMetadata,
|
|
12
|
+
CommerceMetadata$inboundSchema,
|
|
13
|
+
CommerceMetadata$Outbound,
|
|
14
|
+
CommerceMetadata$outboundSchema,
|
|
15
|
+
} from "./commercemetadata.js";
|
|
16
|
+
import {
|
|
17
|
+
CommerceReference,
|
|
18
|
+
CommerceReference$inboundSchema,
|
|
19
|
+
CommerceReference$Outbound,
|
|
20
|
+
CommerceReference$outboundSchema,
|
|
21
|
+
} from "./commercereference.js";
|
|
22
|
+
|
|
23
|
+
export type CommerceSaleschannel = {
|
|
24
|
+
/**
|
|
25
|
+
* points to a CommerceCollection
|
|
26
|
+
*/
|
|
27
|
+
collections?: Array<CommerceReference> | undefined;
|
|
28
|
+
createdAt?: Date | undefined;
|
|
29
|
+
description?: string | undefined;
|
|
30
|
+
id?: string | undefined;
|
|
31
|
+
isActive?: boolean | undefined;
|
|
32
|
+
itemMetadata?: Array<CommerceMetadata> | undefined;
|
|
33
|
+
raw?: { [k: string]: any } | undefined;
|
|
34
|
+
slug?: string | undefined;
|
|
35
|
+
updatedAt?: Date | undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const CommerceSaleschannel$inboundSchema: z.ZodType<
|
|
40
|
+
CommerceSaleschannel,
|
|
41
|
+
z.ZodTypeDef,
|
|
42
|
+
unknown
|
|
43
|
+
> = z.object({
|
|
44
|
+
collections: z.array(CommerceReference$inboundSchema).optional(),
|
|
45
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
46
|
+
.optional(),
|
|
47
|
+
description: z.string().optional(),
|
|
48
|
+
id: z.string().optional(),
|
|
49
|
+
is_active: z.boolean().optional(),
|
|
50
|
+
item_metadata: z.array(CommerceMetadata$inboundSchema).optional(),
|
|
51
|
+
raw: z.record(z.any()).optional(),
|
|
52
|
+
slug: z.string().optional(),
|
|
53
|
+
updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
54
|
+
.optional(),
|
|
55
|
+
}).transform((v) => {
|
|
56
|
+
return remap$(v, {
|
|
57
|
+
"created_at": "createdAt",
|
|
58
|
+
"is_active": "isActive",
|
|
59
|
+
"item_metadata": "itemMetadata",
|
|
60
|
+
"updated_at": "updatedAt",
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
/** @internal */
|
|
64
|
+
export type CommerceSaleschannel$Outbound = {
|
|
65
|
+
collections?: Array<CommerceReference$Outbound> | undefined;
|
|
66
|
+
created_at?: string | undefined;
|
|
67
|
+
description?: string | undefined;
|
|
68
|
+
id?: string | undefined;
|
|
69
|
+
is_active?: boolean | undefined;
|
|
70
|
+
item_metadata?: Array<CommerceMetadata$Outbound> | undefined;
|
|
71
|
+
raw?: { [k: string]: any } | undefined;
|
|
72
|
+
slug?: string | undefined;
|
|
73
|
+
updated_at?: string | undefined;
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
/** @internal */
|
|
77
|
+
export const CommerceSaleschannel$outboundSchema: z.ZodType<
|
|
78
|
+
CommerceSaleschannel$Outbound,
|
|
79
|
+
z.ZodTypeDef,
|
|
80
|
+
CommerceSaleschannel
|
|
81
|
+
> = z.object({
|
|
82
|
+
collections: z.array(CommerceReference$outboundSchema).optional(),
|
|
83
|
+
createdAt: z.date().transform(v => v.toISOString()).optional(),
|
|
84
|
+
description: z.string().optional(),
|
|
85
|
+
id: z.string().optional(),
|
|
86
|
+
isActive: z.boolean().optional(),
|
|
87
|
+
itemMetadata: z.array(CommerceMetadata$outboundSchema).optional(),
|
|
88
|
+
raw: z.record(z.any()).optional(),
|
|
89
|
+
slug: z.string().optional(),
|
|
90
|
+
updatedAt: z.date().transform(v => v.toISOString()).optional(),
|
|
91
|
+
}).transform((v) => {
|
|
92
|
+
return remap$(v, {
|
|
93
|
+
createdAt: "created_at",
|
|
94
|
+
isActive: "is_active",
|
|
95
|
+
itemMetadata: "item_metadata",
|
|
96
|
+
updatedAt: "updated_at",
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export function commerceSaleschannelToJSON(
|
|
101
|
+
commerceSaleschannel: CommerceSaleschannel,
|
|
102
|
+
): string {
|
|
103
|
+
return JSON.stringify(
|
|
104
|
+
CommerceSaleschannel$outboundSchema.parse(commerceSaleschannel),
|
|
105
|
+
);
|
|
106
|
+
}
|
|
107
|
+
export function commerceSaleschannelFromJSON(
|
|
108
|
+
jsonString: string,
|
|
109
|
+
): SafeParseResult<CommerceSaleschannel, SDKValidationError> {
|
|
110
|
+
return safeParse(
|
|
111
|
+
jsonString,
|
|
112
|
+
(x) => CommerceSaleschannel$inboundSchema.parse(JSON.parse(x)),
|
|
113
|
+
`Failed to parse 'CommerceSaleschannel' from JSON`,
|
|
114
|
+
);
|
|
115
|
+
}
|
|
@@ -83,8 +83,10 @@ export * from "./commerceitemprice.js";
|
|
|
83
83
|
export * from "./commerceitemvariant.js";
|
|
84
84
|
export * from "./commercelocation.js";
|
|
85
85
|
export * from "./commercemetadata.js";
|
|
86
|
+
export * from "./commercereference.js";
|
|
86
87
|
export * from "./commercereview.js";
|
|
87
88
|
export * from "./commercereviewcomment.js";
|
|
89
|
+
export * from "./commercesaleschannel.js";
|
|
88
90
|
export * from "./connection.js";
|
|
89
91
|
export * from "./crmcompany.js";
|
|
90
92
|
export * from "./crmcontact.js";
|
|
@@ -35,6 +35,13 @@ export const ListApplicationId = {
|
|
|
35
35
|
} as const;
|
|
36
36
|
export type ListApplicationId = OpenEnum<typeof ListApplicationId>;
|
|
37
37
|
|
|
38
|
+
export const ListBenefitId = {
|
|
39
|
+
SupportedRequired: "supported-required",
|
|
40
|
+
Supported: "supported",
|
|
41
|
+
NotSupported: "not-supported",
|
|
42
|
+
} as const;
|
|
43
|
+
export type ListBenefitId = OpenEnum<typeof ListBenefitId>;
|
|
44
|
+
|
|
38
45
|
export const ListBranchId = {
|
|
39
46
|
SupportedRequired: "supported-required",
|
|
40
47
|
Supported: "supported",
|
|
@@ -345,6 +352,13 @@ export const ListRootId = {
|
|
|
345
352
|
} as const;
|
|
346
353
|
export type ListRootId = OpenEnum<typeof ListRootId>;
|
|
347
354
|
|
|
355
|
+
export const ListSaleschannelId = {
|
|
356
|
+
SupportedRequired: "supported-required",
|
|
357
|
+
Supported: "supported",
|
|
358
|
+
NotSupported: "not-supported",
|
|
359
|
+
} as const;
|
|
360
|
+
export type ListSaleschannelId = OpenEnum<typeof ListSaleschannelId>;
|
|
361
|
+
|
|
348
362
|
export const ListSortByCreatedAt = {
|
|
349
363
|
SupportedRequired: "supported-required",
|
|
350
364
|
Supported: "supported",
|
|
@@ -746,6 +760,15 @@ export const VirtualWebhookRepoId = {
|
|
|
746
760
|
} as const;
|
|
747
761
|
export type VirtualWebhookRepoId = OpenEnum<typeof VirtualWebhookRepoId>;
|
|
748
762
|
|
|
763
|
+
export const VirtualWebhookSaleschannelId = {
|
|
764
|
+
SupportedRequired: "supported-required",
|
|
765
|
+
Supported: "supported",
|
|
766
|
+
NotSupported: "not-supported",
|
|
767
|
+
} as const;
|
|
768
|
+
export type VirtualWebhookSaleschannelId = OpenEnum<
|
|
769
|
+
typeof VirtualWebhookSaleschannelId
|
|
770
|
+
>;
|
|
771
|
+
|
|
749
772
|
export const VirtualWebhookSpaceId = {
|
|
750
773
|
SupportedRequired: "supported-required",
|
|
751
774
|
Supported: "supported",
|
|
@@ -818,6 +841,7 @@ export type IntegrationSupport = {
|
|
|
818
841
|
inboundFields?: { [k: string]: string } | undefined;
|
|
819
842
|
listAccountId?: ListAccountId | undefined;
|
|
820
843
|
listApplicationId?: ListApplicationId | undefined;
|
|
844
|
+
listBenefitId?: ListBenefitId | undefined;
|
|
821
845
|
listBranchId?: ListBranchId | undefined;
|
|
822
846
|
listCalendarId?: ListCalendarId | undefined;
|
|
823
847
|
listCallId?: ListCallId | undefined;
|
|
@@ -862,6 +886,7 @@ export type IntegrationSupport = {
|
|
|
862
886
|
listRawFields?: ListRawFields | undefined;
|
|
863
887
|
listRepoId?: ListRepoId | undefined;
|
|
864
888
|
listRootId?: ListRootId | undefined;
|
|
889
|
+
listSaleschannelId?: ListSaleschannelId | undefined;
|
|
865
890
|
listSortByCreatedAt?: ListSortByCreatedAt | undefined;
|
|
866
891
|
listSortByName?: ListSortByName | undefined;
|
|
867
892
|
listSortByUpdatedAt?: ListSortByUpdatedAt | undefined;
|
|
@@ -924,6 +949,7 @@ export type IntegrationSupport = {
|
|
|
924
949
|
virtualWebhookPipelineId?: VirtualWebhookPipelineId | undefined;
|
|
925
950
|
virtualWebhookProjectId?: VirtualWebhookProjectId | undefined;
|
|
926
951
|
virtualWebhookRepoId?: VirtualWebhookRepoId | undefined;
|
|
952
|
+
virtualWebhookSaleschannelId?: VirtualWebhookSaleschannelId | undefined;
|
|
927
953
|
virtualWebhookSpaceId?: VirtualWebhookSpaceId | undefined;
|
|
928
954
|
virtualWebhookStartGte?: VirtualWebhookStartGte | undefined;
|
|
929
955
|
virtualWebhookStatus?: VirtualWebhookStatus | undefined;
|
|
@@ -957,6 +983,13 @@ export const ListApplicationId$inboundSchema: z.ZodType<
|
|
|
957
983
|
unknown
|
|
958
984
|
> = openEnums.inboundSchema(ListApplicationId);
|
|
959
985
|
|
|
986
|
+
/** @internal */
|
|
987
|
+
export const ListBenefitId$inboundSchema: z.ZodType<
|
|
988
|
+
ListBenefitId,
|
|
989
|
+
z.ZodTypeDef,
|
|
990
|
+
unknown
|
|
991
|
+
> = openEnums.inboundSchema(ListBenefitId);
|
|
992
|
+
|
|
960
993
|
/** @internal */
|
|
961
994
|
export const ListBranchId$inboundSchema: z.ZodType<
|
|
962
995
|
ListBranchId,
|
|
@@ -1265,6 +1298,13 @@ export const ListRootId$inboundSchema: z.ZodType<
|
|
|
1265
1298
|
unknown
|
|
1266
1299
|
> = openEnums.inboundSchema(ListRootId);
|
|
1267
1300
|
|
|
1301
|
+
/** @internal */
|
|
1302
|
+
export const ListSaleschannelId$inboundSchema: z.ZodType<
|
|
1303
|
+
ListSaleschannelId,
|
|
1304
|
+
z.ZodTypeDef,
|
|
1305
|
+
unknown
|
|
1306
|
+
> = openEnums.inboundSchema(ListSaleschannelId);
|
|
1307
|
+
|
|
1268
1308
|
/** @internal */
|
|
1269
1309
|
export const ListSortByCreatedAt$inboundSchema: z.ZodType<
|
|
1270
1310
|
ListSortByCreatedAt,
|
|
@@ -1650,6 +1690,13 @@ export const VirtualWebhookRepoId$inboundSchema: z.ZodType<
|
|
|
1650
1690
|
unknown
|
|
1651
1691
|
> = openEnums.inboundSchema(VirtualWebhookRepoId);
|
|
1652
1692
|
|
|
1693
|
+
/** @internal */
|
|
1694
|
+
export const VirtualWebhookSaleschannelId$inboundSchema: z.ZodType<
|
|
1695
|
+
VirtualWebhookSaleschannelId,
|
|
1696
|
+
z.ZodTypeDef,
|
|
1697
|
+
unknown
|
|
1698
|
+
> = openEnums.inboundSchema(VirtualWebhookSaleschannelId);
|
|
1699
|
+
|
|
1653
1700
|
/** @internal */
|
|
1654
1701
|
export const VirtualWebhookSpaceId$inboundSchema: z.ZodType<
|
|
1655
1702
|
VirtualWebhookSpaceId,
|
|
@@ -1723,6 +1770,7 @@ export const IntegrationSupport$inboundSchema: z.ZodType<
|
|
|
1723
1770
|
inbound_fields: z.record(z.string()).optional(),
|
|
1724
1771
|
list_account_id: ListAccountId$inboundSchema.optional(),
|
|
1725
1772
|
list_application_id: ListApplicationId$inboundSchema.optional(),
|
|
1773
|
+
list_benefit_id: ListBenefitId$inboundSchema.optional(),
|
|
1726
1774
|
list_branch_id: ListBranchId$inboundSchema.optional(),
|
|
1727
1775
|
list_calendar_id: ListCalendarId$inboundSchema.optional(),
|
|
1728
1776
|
list_call_id: ListCallId$inboundSchema.optional(),
|
|
@@ -1768,6 +1816,7 @@ export const IntegrationSupport$inboundSchema: z.ZodType<
|
|
|
1768
1816
|
list_raw_fields: ListRawFields$inboundSchema.optional(),
|
|
1769
1817
|
list_repo_id: ListRepoId$inboundSchema.optional(),
|
|
1770
1818
|
list_root_id: ListRootId$inboundSchema.optional(),
|
|
1819
|
+
list_saleschannel_id: ListSaleschannelId$inboundSchema.optional(),
|
|
1771
1820
|
list_sort_by_created_at: ListSortByCreatedAt$inboundSchema.optional(),
|
|
1772
1821
|
list_sort_by_name: ListSortByName$inboundSchema.optional(),
|
|
1773
1822
|
list_sort_by_updated_at: ListSortByUpdatedAt$inboundSchema.optional(),
|
|
@@ -1835,6 +1884,8 @@ export const IntegrationSupport$inboundSchema: z.ZodType<
|
|
|
1835
1884
|
.optional(),
|
|
1836
1885
|
virtual_webhook_project_id: VirtualWebhookProjectId$inboundSchema.optional(),
|
|
1837
1886
|
virtual_webhook_repo_id: VirtualWebhookRepoId$inboundSchema.optional(),
|
|
1887
|
+
virtual_webhook_saleschannel_id: VirtualWebhookSaleschannelId$inboundSchema
|
|
1888
|
+
.optional(),
|
|
1838
1889
|
virtual_webhook_space_id: VirtualWebhookSpaceId$inboundSchema.optional(),
|
|
1839
1890
|
virtual_webhook_start_gte: VirtualWebhookStartGte$inboundSchema.optional(),
|
|
1840
1891
|
virtual_webhook_status: VirtualWebhookStatus$inboundSchema.optional(),
|
|
@@ -1854,6 +1905,7 @@ export const IntegrationSupport$inboundSchema: z.ZodType<
|
|
|
1854
1905
|
"inbound_fields": "inboundFields",
|
|
1855
1906
|
"list_account_id": "listAccountId",
|
|
1856
1907
|
"list_application_id": "listApplicationId",
|
|
1908
|
+
"list_benefit_id": "listBenefitId",
|
|
1857
1909
|
"list_branch_id": "listBranchId",
|
|
1858
1910
|
"list_calendar_id": "listCalendarId",
|
|
1859
1911
|
"list_call_id": "listCallId",
|
|
@@ -1898,6 +1950,7 @@ export const IntegrationSupport$inboundSchema: z.ZodType<
|
|
|
1898
1950
|
"list_raw_fields": "listRawFields",
|
|
1899
1951
|
"list_repo_id": "listRepoId",
|
|
1900
1952
|
"list_root_id": "listRootId",
|
|
1953
|
+
"list_saleschannel_id": "listSaleschannelId",
|
|
1901
1954
|
"list_sort_by_created_at": "listSortByCreatedAt",
|
|
1902
1955
|
"list_sort_by_name": "listSortByName",
|
|
1903
1956
|
"list_sort_by_updated_at": "listSortByUpdatedAt",
|
|
@@ -1956,6 +2009,7 @@ export const IntegrationSupport$inboundSchema: z.ZodType<
|
|
|
1956
2009
|
"virtual_webhook_pipeline_id": "virtualWebhookPipelineId",
|
|
1957
2010
|
"virtual_webhook_project_id": "virtualWebhookProjectId",
|
|
1958
2011
|
"virtual_webhook_repo_id": "virtualWebhookRepoId",
|
|
2012
|
+
"virtual_webhook_saleschannel_id": "virtualWebhookSaleschannelId",
|
|
1959
2013
|
"virtual_webhook_space_id": "virtualWebhookSpaceId",
|
|
1960
2014
|
"virtual_webhook_start_gte": "virtualWebhookStartGte",
|
|
1961
2015
|
"virtual_webhook_status": "virtualWebhookStatus",
|
|
@@ -62,6 +62,8 @@ export const PropertyConnectionPermissions = {
|
|
|
62
62
|
CommerceLocationWrite: "commerce_location_write",
|
|
63
63
|
CommerceReviewRead: "commerce_review_read",
|
|
64
64
|
CommerceReviewWrite: "commerce_review_write",
|
|
65
|
+
CommerceSaleschannelRead: "commerce_saleschannel_read",
|
|
66
|
+
CommerceSaleschannelWrite: "commerce_saleschannel_write",
|
|
65
67
|
VerificationPackageRead: "verification_package_read",
|
|
66
68
|
VerificationRequestRead: "verification_request_read",
|
|
67
69
|
VerificationRequestWrite: "verification_request_write",
|
|
@@ -56,6 +56,7 @@ export const ObjectType = {
|
|
|
56
56
|
CommerceInventory: "commerce_inventory",
|
|
57
57
|
CommerceLocation: "commerce_location",
|
|
58
58
|
CommerceReview: "commerce_review",
|
|
59
|
+
CommerceSaleschannel: "commerce_saleschannel",
|
|
59
60
|
VerificationPackage: "verification_package",
|
|
60
61
|
VerificationRequest: "verification_request",
|
|
61
62
|
AtsActivity: "ats_activity",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { commerceCreateCommerceSaleschannel } from "../funcs/commerceCreateCommerceSaleschannel.js";
|
|
6
|
+
import { commerceGetCommerceSaleschannel } from "../funcs/commerceGetCommerceSaleschannel.js";
|
|
7
|
+
import { commerceListCommerceSaleschannels } from "../funcs/commerceListCommerceSaleschannels.js";
|
|
8
|
+
import { commercePatchCommerceSaleschannel } from "../funcs/commercePatchCommerceSaleschannel.js";
|
|
9
|
+
import { commerceRemoveCommerceSaleschannel } from "../funcs/commerceRemoveCommerceSaleschannel.js";
|
|
10
|
+
import { commerceUpdateCommerceSaleschannel } from "../funcs/commerceUpdateCommerceSaleschannel.js";
|
|
11
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
12
|
+
import * as operations from "./models/operations/index.js";
|
|
13
|
+
import * as shared from "./models/shared/index.js";
|
|
14
|
+
import { unwrapAsync } from "./types/fp.js";
|
|
15
|
+
|
|
16
|
+
export class Saleschannel extends ClientSDK {
|
|
17
|
+
/**
|
|
18
|
+
* Create a saleschannel
|
|
19
|
+
*/
|
|
20
|
+
async createCommerceSaleschannel(
|
|
21
|
+
request: operations.CreateCommerceSaleschannelRequest,
|
|
22
|
+
options?: RequestOptions,
|
|
23
|
+
): Promise<shared.CommerceSaleschannel> {
|
|
24
|
+
return unwrapAsync(commerceCreateCommerceSaleschannel(
|
|
25
|
+
this,
|
|
26
|
+
request,
|
|
27
|
+
options,
|
|
28
|
+
));
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Retrieve a saleschannel
|
|
33
|
+
*/
|
|
34
|
+
async getCommerceSaleschannel(
|
|
35
|
+
request: operations.GetCommerceSaleschannelRequest,
|
|
36
|
+
options?: RequestOptions,
|
|
37
|
+
): Promise<shared.CommerceSaleschannel> {
|
|
38
|
+
return unwrapAsync(commerceGetCommerceSaleschannel(
|
|
39
|
+
this,
|
|
40
|
+
request,
|
|
41
|
+
options,
|
|
42
|
+
));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* List all saleschannels
|
|
47
|
+
*/
|
|
48
|
+
async listCommerceSaleschannels(
|
|
49
|
+
request: operations.ListCommerceSaleschannelsRequest,
|
|
50
|
+
options?: RequestOptions,
|
|
51
|
+
): Promise<Array<shared.CommerceSaleschannel>> {
|
|
52
|
+
return unwrapAsync(commerceListCommerceSaleschannels(
|
|
53
|
+
this,
|
|
54
|
+
request,
|
|
55
|
+
options,
|
|
56
|
+
));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Update a saleschannel
|
|
61
|
+
*/
|
|
62
|
+
async patchCommerceSaleschannel(
|
|
63
|
+
request: operations.PatchCommerceSaleschannelRequest,
|
|
64
|
+
options?: RequestOptions,
|
|
65
|
+
): Promise<shared.CommerceSaleschannel> {
|
|
66
|
+
return unwrapAsync(commercePatchCommerceSaleschannel(
|
|
67
|
+
this,
|
|
68
|
+
request,
|
|
69
|
+
options,
|
|
70
|
+
));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Remove a saleschannel
|
|
75
|
+
*/
|
|
76
|
+
async removeCommerceSaleschannel(
|
|
77
|
+
request: operations.RemoveCommerceSaleschannelRequest,
|
|
78
|
+
options?: RequestOptions,
|
|
79
|
+
): Promise<operations.RemoveCommerceSaleschannelResponse | undefined> {
|
|
80
|
+
return unwrapAsync(commerceRemoveCommerceSaleschannel(
|
|
81
|
+
this,
|
|
82
|
+
request,
|
|
83
|
+
options,
|
|
84
|
+
));
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Update a saleschannel
|
|
89
|
+
*/
|
|
90
|
+
async updateCommerceSaleschannel(
|
|
91
|
+
request: operations.UpdateCommerceSaleschannelRequest,
|
|
92
|
+
options?: RequestOptions,
|
|
93
|
+
): Promise<shared.CommerceSaleschannel> {
|
|
94
|
+
return unwrapAsync(commerceUpdateCommerceSaleschannel(
|
|
95
|
+
this,
|
|
96
|
+
request,
|
|
97
|
+
options,
|
|
98
|
+
));
|
|
99
|
+
}
|
|
100
|
+
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -93,6 +93,7 @@ import { Report } from "./report.js";
|
|
|
93
93
|
import { Repository } from "./repository.js";
|
|
94
94
|
import { RequestT } from "./request.js";
|
|
95
95
|
import { Review } from "./review.js";
|
|
96
|
+
import { Saleschannel } from "./saleschannel.js";
|
|
96
97
|
import { Salesorder } from "./salesorder.js";
|
|
97
98
|
import { Scim } from "./scim.js";
|
|
98
99
|
import { Scorecard } from "./scorecard.js";
|
|
@@ -320,6 +321,11 @@ export class UnifiedTo extends ClientSDK {
|
|
|
320
321
|
return (this._review ??= new Review(this._options));
|
|
321
322
|
}
|
|
322
323
|
|
|
324
|
+
private _saleschannel?: Saleschannel;
|
|
325
|
+
get saleschannel(): Saleschannel {
|
|
326
|
+
return (this._saleschannel ??= new Saleschannel(this._options));
|
|
327
|
+
}
|
|
328
|
+
|
|
323
329
|
private _crm?: Crm;
|
|
324
330
|
get crm(): Crm {
|
|
325
331
|
return (this._crm ??= new Crm(this._options));
|
package/src/sdk/types/enums.ts
CHANGED
|
@@ -3,34 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
import * as z from "zod/v3";
|
|
6
|
+
import { Unrecognized, unrecognized } from "./unrecognized.js";
|
|
6
7
|
|
|
7
|
-
declare const __brand: unique symbol;
|
|
8
|
-
export type Unrecognized<T> = T & { [__brand]: "unrecognized" };
|
|
9
8
|
export type ClosedEnum<T extends Readonly<Record<string, string | number>>> =
|
|
10
9
|
T[keyof T];
|
|
11
10
|
export type OpenEnum<T extends Readonly<Record<string, string | number>>> =
|
|
12
11
|
| T[keyof T]
|
|
13
12
|
| Unrecognized<T[keyof T] extends number ? number : string>;
|
|
14
13
|
|
|
15
|
-
function unrecognized<T>(value: T): Unrecognized<T> {
|
|
16
|
-
unrecognizedCount++;
|
|
17
|
-
return value as Unrecognized<T>;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
let unrecognizedCount = 0;
|
|
21
|
-
let refCount = 0;
|
|
22
|
-
export function unrecognizedCounter() {
|
|
23
|
-
refCount++;
|
|
24
|
-
const start = unrecognizedCount;
|
|
25
|
-
return {
|
|
26
|
-
count: () => {
|
|
27
|
-
const count = unrecognizedCount - start;
|
|
28
|
-
if (--refCount === 0) unrecognizedCount = 0;
|
|
29
|
-
return count;
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
|
|
34
14
|
export function inboundSchema<T extends Record<string, string>>(
|
|
35
15
|
enumObj: T,
|
|
36
16
|
): z.ZodType<OpenEnum<T>, z.ZodTypeDef, unknown> {
|
package/src/sdk/types/index.ts
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
export { blobLikeSchema, isBlobLike } from "./blobs.js";
|
|
6
|
-
export type { ClosedEnum, OpenEnum
|
|
6
|
+
export type { ClosedEnum, OpenEnum } from "./enums.js";
|
|
7
7
|
export type { Result } from "./fp.js";
|
|
8
8
|
export type { PageIterator, Paginator } from "./operations.js";
|
|
9
9
|
export { createPageIterator } from "./operations.js";
|
|
10
10
|
export { RFCDate } from "./rfcdate.js";
|
|
11
|
+
export * from "./unrecognized.js";
|