@unified-api/typescript-sdk 2.86.8 → 2.86.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/FUNCTIONS.md +2 -2
- package/README.md +16 -12
- package/dist/commonjs/funcs/commerceGetCommerceReturn.d.ts +18 -0
- package/dist/commonjs/funcs/commerceGetCommerceReturn.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerceGetCommerceReturn.js +129 -0
- package/dist/commonjs/funcs/commerceGetCommerceReturn.js.map +1 -0
- package/dist/commonjs/funcs/commerceListCommerceReturns.d.ts +18 -0
- package/dist/commonjs/funcs/commerceListCommerceReturns.d.ts.map +1 -0
- package/dist/commonjs/funcs/commerceListCommerceReturns.js +133 -0
- package/dist/commonjs/funcs/commerceListCommerceReturns.js.map +1 -0
- package/dist/commonjs/lib/config.d.ts +2 -2
- package/dist/commonjs/lib/config.js +2 -2
- package/dist/commonjs/sdk/commerce.d.ts +14 -0
- package/dist/commonjs/sdk/commerce.d.ts.map +1 -1
- package/dist/commonjs/sdk/commerce.js +20 -0
- package/dist/commonjs/sdk/commerce.js.map +1 -1
- package/dist/commonjs/sdk/models/operations/getcommercereturn.d.ts +50 -0
- package/dist/commonjs/sdk/models/operations/getcommercereturn.d.ts.map +1 -0
- package/dist/commonjs/sdk/models/operations/getcommercereturn.js +75 -0
- package/dist/commonjs/sdk/models/operations/getcommercereturn.js.map +1 -0
- package/dist/commonjs/sdk/models/operations/index.d.ts +2 -0
- package/dist/commonjs/sdk/models/operations/index.d.ts.map +1 -1
- package/dist/commonjs/sdk/models/operations/index.js +2 -0
- package/dist/commonjs/sdk/models/operations/index.js.map +1 -1
- package/dist/commonjs/sdk/models/operations/listcommercereturns.d.ts +68 -0
- package/dist/commonjs/sdk/models/operations/listcommercereturns.d.ts.map +1 -0
- package/dist/commonjs/sdk/models/operations/listcommercereturns.js +84 -0
- package/dist/commonjs/sdk/models/operations/listcommercereturns.js.map +1 -0
- package/dist/commonjs/sdk/models/shared/commercecollection.d.ts +3 -0
- package/dist/commonjs/sdk/models/shared/commercecollection.d.ts.map +1 -1
- package/dist/commonjs/sdk/models/shared/commercecollection.js.map +1 -1
- package/dist/commonjs/sdk/models/shared/commerceitem.d.ts +3 -0
- package/dist/commonjs/sdk/models/shared/commerceitem.d.ts.map +1 -1
- package/dist/commonjs/sdk/models/shared/commerceitem.js.map +1 -1
- package/dist/commonjs/sdk/models/shared/commercereturn.d.ts +49 -0
- package/dist/commonjs/sdk/models/shared/commercereturn.d.ts.map +1 -0
- package/dist/commonjs/sdk/models/shared/commercereturn.js +90 -0
- package/dist/commonjs/sdk/models/shared/commercereturn.js.map +1 -0
- package/dist/commonjs/sdk/models/shared/commercereturnlineitem.d.ts +24 -0
- package/dist/commonjs/sdk/models/shared/commercereturnlineitem.d.ts.map +1 -0
- package/dist/commonjs/sdk/models/shared/commercereturnlineitem.js +66 -0
- package/dist/commonjs/sdk/models/shared/commercereturnlineitem.js.map +1 -0
- package/dist/commonjs/sdk/models/shared/index.d.ts +2 -0
- package/dist/commonjs/sdk/models/shared/index.d.ts.map +1 -1
- package/dist/commonjs/sdk/models/shared/index.js +2 -0
- package/dist/commonjs/sdk/models/shared/index.js.map +1 -1
- package/dist/commonjs/sdk/models/shared/propertyconnectionpermissions.d.ts +2 -0
- package/dist/commonjs/sdk/models/shared/propertyconnectionpermissions.d.ts.map +1 -1
- package/dist/commonjs/sdk/models/shared/propertyconnectionpermissions.js +2 -0
- package/dist/commonjs/sdk/models/shared/propertyconnectionpermissions.js.map +1 -1
- package/dist/commonjs/sdk/models/shared/webhook.d.ts +1 -0
- package/dist/commonjs/sdk/models/shared/webhook.d.ts.map +1 -1
- package/dist/commonjs/sdk/models/shared/webhook.js +1 -0
- package/dist/commonjs/sdk/models/shared/webhook.js.map +1 -1
- package/dist/commonjs/sdk/return.d.ts +20 -0
- package/dist/commonjs/sdk/return.d.ts.map +1 -0
- package/dist/commonjs/sdk/return.js +32 -0
- package/dist/commonjs/sdk/return.js.map +1 -0
- package/dist/commonjs/sdk/sdk.d.ts +3 -0
- package/dist/commonjs/sdk/sdk.d.ts.map +1 -1
- package/dist/commonjs/sdk/sdk.js +4 -0
- package/dist/commonjs/sdk/sdk.js.map +1 -1
- package/dist/esm/funcs/commerceGetCommerceReturn.d.ts +18 -0
- package/dist/esm/funcs/commerceGetCommerceReturn.d.ts.map +1 -0
- package/dist/esm/funcs/commerceGetCommerceReturn.js +93 -0
- package/dist/esm/funcs/commerceGetCommerceReturn.js.map +1 -0
- package/dist/esm/funcs/commerceListCommerceReturns.d.ts +18 -0
- package/dist/esm/funcs/commerceListCommerceReturns.d.ts.map +1 -0
- package/dist/esm/funcs/commerceListCommerceReturns.js +97 -0
- package/dist/esm/funcs/commerceListCommerceReturns.js.map +1 -0
- package/dist/esm/lib/config.d.ts +2 -2
- package/dist/esm/lib/config.js +2 -2
- package/dist/esm/sdk/commerce.d.ts +14 -0
- package/dist/esm/sdk/commerce.d.ts.map +1 -1
- package/dist/esm/sdk/commerce.js +20 -0
- package/dist/esm/sdk/commerce.js.map +1 -1
- package/dist/esm/sdk/models/operations/getcommercereturn.d.ts +50 -0
- package/dist/esm/sdk/models/operations/getcommercereturn.d.ts.map +1 -0
- package/dist/esm/sdk/models/operations/getcommercereturn.js +38 -0
- package/dist/esm/sdk/models/operations/getcommercereturn.js.map +1 -0
- package/dist/esm/sdk/models/operations/index.d.ts +2 -0
- package/dist/esm/sdk/models/operations/index.d.ts.map +1 -1
- package/dist/esm/sdk/models/operations/index.js +2 -0
- package/dist/esm/sdk/models/operations/index.js.map +1 -1
- package/dist/esm/sdk/models/operations/listcommercereturns.d.ts +68 -0
- package/dist/esm/sdk/models/operations/listcommercereturns.d.ts.map +1 -0
- package/dist/esm/sdk/models/operations/listcommercereturns.js +47 -0
- package/dist/esm/sdk/models/operations/listcommercereturns.js.map +1 -0
- package/dist/esm/sdk/models/shared/commercecollection.d.ts +3 -0
- package/dist/esm/sdk/models/shared/commercecollection.d.ts.map +1 -1
- package/dist/esm/sdk/models/shared/commercecollection.js.map +1 -1
- package/dist/esm/sdk/models/shared/commerceitem.d.ts +3 -0
- package/dist/esm/sdk/models/shared/commerceitem.d.ts.map +1 -1
- package/dist/esm/sdk/models/shared/commerceitem.js.map +1 -1
- package/dist/esm/sdk/models/shared/commercereturn.d.ts +49 -0
- package/dist/esm/sdk/models/shared/commercereturn.d.ts.map +1 -0
- package/dist/esm/sdk/models/shared/commercereturn.js +53 -0
- package/dist/esm/sdk/models/shared/commercereturn.js.map +1 -0
- package/dist/esm/sdk/models/shared/commercereturnlineitem.d.ts +24 -0
- package/dist/esm/sdk/models/shared/commercereturnlineitem.d.ts.map +1 -0
- package/dist/esm/sdk/models/shared/commercereturnlineitem.js +29 -0
- package/dist/esm/sdk/models/shared/commercereturnlineitem.js.map +1 -0
- package/dist/esm/sdk/models/shared/index.d.ts +2 -0
- package/dist/esm/sdk/models/shared/index.d.ts.map +1 -1
- package/dist/esm/sdk/models/shared/index.js +2 -0
- package/dist/esm/sdk/models/shared/index.js.map +1 -1
- package/dist/esm/sdk/models/shared/propertyconnectionpermissions.d.ts +2 -0
- package/dist/esm/sdk/models/shared/propertyconnectionpermissions.d.ts.map +1 -1
- package/dist/esm/sdk/models/shared/propertyconnectionpermissions.js +2 -0
- package/dist/esm/sdk/models/shared/propertyconnectionpermissions.js.map +1 -1
- package/dist/esm/sdk/models/shared/webhook.d.ts +1 -0
- package/dist/esm/sdk/models/shared/webhook.d.ts.map +1 -1
- package/dist/esm/sdk/models/shared/webhook.js +1 -0
- package/dist/esm/sdk/models/shared/webhook.js.map +1 -1
- package/dist/esm/sdk/return.d.ts +20 -0
- package/dist/esm/sdk/return.d.ts.map +1 -0
- package/dist/esm/sdk/return.js +28 -0
- package/dist/esm/sdk/return.js.map +1 -0
- package/dist/esm/sdk/sdk.d.ts +3 -0
- package/dist/esm/sdk/sdk.d.ts.map +1 -1
- package/dist/esm/sdk/sdk.js +4 -0
- package/dist/esm/sdk/sdk.js.map +1 -1
- package/examples/accountingCreateAccountingAccount.example.ts +2 -2
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/commerceGetCommerceReturn.ts +177 -0
- package/src/funcs/commerceListCommerceReturns.ts +182 -0
- package/src/lib/config.ts +2 -2
- package/src/sdk/commerce.ts +36 -0
- package/src/sdk/models/operations/getcommercereturn.ts +83 -0
- package/src/sdk/models/operations/index.ts +2 -0
- package/src/sdk/models/operations/listcommercereturns.ts +111 -0
- package/src/sdk/models/shared/commercecollection.ts +3 -0
- package/src/sdk/models/shared/commerceitem.ts +3 -0
- package/src/sdk/models/shared/commercereturn.ts +109 -0
- package/src/sdk/models/shared/commercereturnlineitem.ts +59 -0
- package/src/sdk/models/shared/index.ts +2 -0
- package/src/sdk/models/shared/propertyconnectionpermissions.ts +2 -0
- package/src/sdk/models/shared/webhook.ts +1 -0
- package/src/sdk/return.ts +46 -0
- package/src/sdk/sdk.ts +6 -0
|
@@ -0,0 +1,83 @@
|
|
|
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 { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const GetCommerceReturnQueryParamFields = {
|
|
10
|
+
Id: "id",
|
|
11
|
+
CreatedAt: "created_at",
|
|
12
|
+
UpdatedAt: "updated_at",
|
|
13
|
+
OrderId: "order_id",
|
|
14
|
+
Status: "status",
|
|
15
|
+
Type: "type",
|
|
16
|
+
Currency: "currency",
|
|
17
|
+
TotalRefundAmount: "total_refund_amount",
|
|
18
|
+
CustomerEmail: "customer_email",
|
|
19
|
+
CustomerName: "customer_name",
|
|
20
|
+
ReturnByAt: "return_by_at",
|
|
21
|
+
Lineitems: "lineitems",
|
|
22
|
+
Metadata: "metadata",
|
|
23
|
+
Raw: "raw",
|
|
24
|
+
} as const;
|
|
25
|
+
export type GetCommerceReturnQueryParamFields = ClosedEnum<
|
|
26
|
+
typeof GetCommerceReturnQueryParamFields
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
export type GetCommerceReturnRequest = {
|
|
30
|
+
/**
|
|
31
|
+
* ID of the connection
|
|
32
|
+
*/
|
|
33
|
+
connectionId: string;
|
|
34
|
+
/**
|
|
35
|
+
* Fields to return
|
|
36
|
+
*/
|
|
37
|
+
fields?: Array<GetCommerceReturnQueryParamFields> | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* ID of the Return
|
|
40
|
+
*/
|
|
41
|
+
id: string;
|
|
42
|
+
/**
|
|
43
|
+
* Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar
|
|
44
|
+
*/
|
|
45
|
+
raw?: string | undefined;
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
/** @internal */
|
|
49
|
+
export const GetCommerceReturnQueryParamFields$outboundSchema: z.ZodNativeEnum<
|
|
50
|
+
typeof GetCommerceReturnQueryParamFields
|
|
51
|
+
> = z.nativeEnum(GetCommerceReturnQueryParamFields);
|
|
52
|
+
|
|
53
|
+
/** @internal */
|
|
54
|
+
export type GetCommerceReturnRequest$Outbound = {
|
|
55
|
+
connection_id: string;
|
|
56
|
+
fields?: Array<string> | undefined;
|
|
57
|
+
id: string;
|
|
58
|
+
raw?: string | undefined;
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
/** @internal */
|
|
62
|
+
export const GetCommerceReturnRequest$outboundSchema: z.ZodType<
|
|
63
|
+
GetCommerceReturnRequest$Outbound,
|
|
64
|
+
z.ZodTypeDef,
|
|
65
|
+
GetCommerceReturnRequest
|
|
66
|
+
> = z.object({
|
|
67
|
+
connectionId: z.string(),
|
|
68
|
+
fields: z.array(GetCommerceReturnQueryParamFields$outboundSchema).optional(),
|
|
69
|
+
id: z.string(),
|
|
70
|
+
raw: z.string().optional(),
|
|
71
|
+
}).transform((v) => {
|
|
72
|
+
return remap$(v, {
|
|
73
|
+
connectionId: "connection_id",
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export function getCommerceReturnRequestToJSON(
|
|
78
|
+
getCommerceReturnRequest: GetCommerceReturnRequest,
|
|
79
|
+
): string {
|
|
80
|
+
return JSON.stringify(
|
|
81
|
+
GetCommerceReturnRequest$outboundSchema.parse(getCommerceReturnRequest),
|
|
82
|
+
);
|
|
83
|
+
}
|
|
@@ -242,6 +242,7 @@ export * from "./getcommerceitem.js";
|
|
|
242
242
|
export * from "./getcommerceitemvariant.js";
|
|
243
243
|
export * from "./getcommercelocation.js";
|
|
244
244
|
export * from "./getcommercereservation.js";
|
|
245
|
+
export * from "./getcommercereturn.js";
|
|
245
246
|
export * from "./getcommercereview.js";
|
|
246
247
|
export * from "./getcommercesaleschannel.js";
|
|
247
248
|
export * from "./getcomputedeployment.js";
|
|
@@ -465,6 +466,7 @@ export * from "./listcommerceitems.js";
|
|
|
465
466
|
export * from "./listcommerceitemvariants.js";
|
|
466
467
|
export * from "./listcommercelocations.js";
|
|
467
468
|
export * from "./listcommercereservations.js";
|
|
469
|
+
export * from "./listcommercereturns.js";
|
|
468
470
|
export * from "./listcommercereviews.js";
|
|
469
471
|
export * from "./listcommercesaleschannels.js";
|
|
470
472
|
export * from "./listcomputedeployments.js";
|
|
@@ -0,0 +1,111 @@
|
|
|
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 { ClosedEnum } from "../../types/enums.js";
|
|
8
|
+
|
|
9
|
+
export const ListCommerceReturnsQueryParamFields = {
|
|
10
|
+
Id: "id",
|
|
11
|
+
CreatedAt: "created_at",
|
|
12
|
+
UpdatedAt: "updated_at",
|
|
13
|
+
OrderId: "order_id",
|
|
14
|
+
Status: "status",
|
|
15
|
+
Type: "type",
|
|
16
|
+
Currency: "currency",
|
|
17
|
+
TotalRefundAmount: "total_refund_amount",
|
|
18
|
+
CustomerEmail: "customer_email",
|
|
19
|
+
CustomerName: "customer_name",
|
|
20
|
+
ReturnByAt: "return_by_at",
|
|
21
|
+
Lineitems: "lineitems",
|
|
22
|
+
Metadata: "metadata",
|
|
23
|
+
Raw: "raw",
|
|
24
|
+
} as const;
|
|
25
|
+
export type ListCommerceReturnsQueryParamFields = ClosedEnum<
|
|
26
|
+
typeof ListCommerceReturnsQueryParamFields
|
|
27
|
+
>;
|
|
28
|
+
|
|
29
|
+
export type ListCommerceReturnsRequest = {
|
|
30
|
+
/**
|
|
31
|
+
* ID of the connection
|
|
32
|
+
*/
|
|
33
|
+
connectionId: string;
|
|
34
|
+
/**
|
|
35
|
+
* Fields to return
|
|
36
|
+
*/
|
|
37
|
+
fields?: Array<ListCommerceReturnsQueryParamFields> | undefined;
|
|
38
|
+
limit?: number | undefined;
|
|
39
|
+
offset?: number | undefined;
|
|
40
|
+
order?: string | undefined;
|
|
41
|
+
/**
|
|
42
|
+
* The AccountingOrder ID to filter by
|
|
43
|
+
*/
|
|
44
|
+
orderId?: string | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Query string to search. eg. email address or name
|
|
47
|
+
*/
|
|
48
|
+
query?: string | undefined;
|
|
49
|
+
/**
|
|
50
|
+
* Raw parameters to include in the 3rd-party request. Encoded as a URL component. eg. raw parameters: foo=bar&zoo=bar -> raw=foo%3Dbar%26zoo%3Dbar
|
|
51
|
+
*/
|
|
52
|
+
raw?: string | undefined;
|
|
53
|
+
sort?: string | undefined;
|
|
54
|
+
/**
|
|
55
|
+
* Return only results whose updated date is equal or greater to this value (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
|
|
56
|
+
*/
|
|
57
|
+
updatedGte?: string | undefined;
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
/** @internal */
|
|
61
|
+
export const ListCommerceReturnsQueryParamFields$outboundSchema:
|
|
62
|
+
z.ZodNativeEnum<typeof ListCommerceReturnsQueryParamFields> = z.nativeEnum(
|
|
63
|
+
ListCommerceReturnsQueryParamFields,
|
|
64
|
+
);
|
|
65
|
+
|
|
66
|
+
/** @internal */
|
|
67
|
+
export type ListCommerceReturnsRequest$Outbound = {
|
|
68
|
+
connection_id: string;
|
|
69
|
+
fields?: Array<string> | undefined;
|
|
70
|
+
limit?: number | undefined;
|
|
71
|
+
offset?: number | undefined;
|
|
72
|
+
order?: string | undefined;
|
|
73
|
+
order_id?: string | undefined;
|
|
74
|
+
query?: string | undefined;
|
|
75
|
+
raw?: string | undefined;
|
|
76
|
+
sort?: string | undefined;
|
|
77
|
+
updated_gte?: string | undefined;
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/** @internal */
|
|
81
|
+
export const ListCommerceReturnsRequest$outboundSchema: z.ZodType<
|
|
82
|
+
ListCommerceReturnsRequest$Outbound,
|
|
83
|
+
z.ZodTypeDef,
|
|
84
|
+
ListCommerceReturnsRequest
|
|
85
|
+
> = z.object({
|
|
86
|
+
connectionId: z.string(),
|
|
87
|
+
fields: z.array(ListCommerceReturnsQueryParamFields$outboundSchema)
|
|
88
|
+
.optional(),
|
|
89
|
+
limit: z.number().optional(),
|
|
90
|
+
offset: z.number().optional(),
|
|
91
|
+
order: z.string().optional(),
|
|
92
|
+
orderId: z.string().optional(),
|
|
93
|
+
query: z.string().optional(),
|
|
94
|
+
raw: z.string().optional(),
|
|
95
|
+
sort: z.string().optional(),
|
|
96
|
+
updatedGte: z.string().optional(),
|
|
97
|
+
}).transform((v) => {
|
|
98
|
+
return remap$(v, {
|
|
99
|
+
connectionId: "connection_id",
|
|
100
|
+
orderId: "order_id",
|
|
101
|
+
updatedGte: "updated_gte",
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
export function listCommerceReturnsRequestToJSON(
|
|
106
|
+
listCommerceReturnsRequest: ListCommerceReturnsRequest,
|
|
107
|
+
): string {
|
|
108
|
+
return JSON.stringify(
|
|
109
|
+
ListCommerceReturnsRequest$outboundSchema.parse(listCommerceReturnsRequest),
|
|
110
|
+
);
|
|
111
|
+
}
|
|
@@ -45,6 +45,9 @@ export type CommerceCollection = {
|
|
|
45
45
|
itemMetadata?: Array<CommerceMetadata> | undefined;
|
|
46
46
|
media?: Array<CommerceItemMedia> | undefined;
|
|
47
47
|
metadata?: Array<CommerceMetadata> | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* The collection's name
|
|
50
|
+
*/
|
|
48
51
|
name: string;
|
|
49
52
|
parentId?: string | undefined;
|
|
50
53
|
publicDescription?: string | undefined;
|
|
@@ -73,6 +73,9 @@ export type CommerceItem = {
|
|
|
73
73
|
locationId?: string | undefined;
|
|
74
74
|
media?: Array<CommerceItemMedia> | undefined;
|
|
75
75
|
metadata?: Array<CommerceMetadata> | undefined;
|
|
76
|
+
/**
|
|
77
|
+
* The item's (product's) name
|
|
78
|
+
*/
|
|
76
79
|
name?: string | undefined;
|
|
77
80
|
prices?: Array<CommerceItemPrice> | undefined;
|
|
78
81
|
publicDescription?: string | undefined;
|
|
@@ -0,0 +1,109 @@
|
|
|
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 * as openEnums from "../../types/enums.js";
|
|
9
|
+
import { OpenEnum } from "../../types/enums.js";
|
|
10
|
+
import { Result as SafeParseResult } from "../../types/fp.js";
|
|
11
|
+
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
|
|
12
|
+
import {
|
|
13
|
+
CommerceMetadata,
|
|
14
|
+
CommerceMetadata$inboundSchema,
|
|
15
|
+
} from "./commercemetadata.js";
|
|
16
|
+
import {
|
|
17
|
+
CommerceReturnLineitem,
|
|
18
|
+
CommerceReturnLineitem$inboundSchema,
|
|
19
|
+
} from "./commercereturnlineitem.js";
|
|
20
|
+
|
|
21
|
+
export const CommerceReturnStatus = {
|
|
22
|
+
Requested: "REQUESTED",
|
|
23
|
+
Open: "OPEN",
|
|
24
|
+
Approved: "APPROVED",
|
|
25
|
+
Rejected: "REJECTED",
|
|
26
|
+
Closed: "CLOSED",
|
|
27
|
+
Cancelled: "CANCELLED",
|
|
28
|
+
Other: "OTHER",
|
|
29
|
+
} as const;
|
|
30
|
+
export type CommerceReturnStatus = OpenEnum<typeof CommerceReturnStatus>;
|
|
31
|
+
|
|
32
|
+
export type CommerceReturn = {
|
|
33
|
+
/**
|
|
34
|
+
* (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
|
|
35
|
+
*/
|
|
36
|
+
createdAt?: Date | undefined;
|
|
37
|
+
currency?: string | undefined;
|
|
38
|
+
customerEmail?: string | undefined;
|
|
39
|
+
customerName?: string | undefined;
|
|
40
|
+
id?: string | undefined;
|
|
41
|
+
lineitems?: Array<CommerceReturnLineitem> | undefined;
|
|
42
|
+
metadata?: Array<CommerceMetadata> | undefined;
|
|
43
|
+
orderId?: string | undefined;
|
|
44
|
+
raw?: { [k: string]: any } | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
|
|
47
|
+
*/
|
|
48
|
+
returnByAt?: Date | undefined;
|
|
49
|
+
status?: CommerceReturnStatus | undefined;
|
|
50
|
+
totalRefundAmount?: number | undefined;
|
|
51
|
+
type?: string | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* (ISO-8601 / YYYY-MM-DDTHH:MM:SSZ format)
|
|
54
|
+
*/
|
|
55
|
+
updatedAt?: Date | undefined;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export const CommerceReturnStatus$inboundSchema: z.ZodType<
|
|
60
|
+
CommerceReturnStatus,
|
|
61
|
+
z.ZodTypeDef,
|
|
62
|
+
unknown
|
|
63
|
+
> = openEnums.inboundSchema(CommerceReturnStatus);
|
|
64
|
+
|
|
65
|
+
/** @internal */
|
|
66
|
+
export const CommerceReturn$inboundSchema: z.ZodType<
|
|
67
|
+
CommerceReturn,
|
|
68
|
+
z.ZodTypeDef,
|
|
69
|
+
unknown
|
|
70
|
+
> = z.object({
|
|
71
|
+
created_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
72
|
+
.optional(),
|
|
73
|
+
currency: z.string().optional(),
|
|
74
|
+
customer_email: z.string().optional(),
|
|
75
|
+
customer_name: z.string().optional(),
|
|
76
|
+
id: z.string().optional(),
|
|
77
|
+
lineitems: z.array(CommerceReturnLineitem$inboundSchema).optional(),
|
|
78
|
+
metadata: z.array(CommerceMetadata$inboundSchema).optional(),
|
|
79
|
+
order_id: z.string().optional(),
|
|
80
|
+
raw: z.record(z.any()).optional(),
|
|
81
|
+
return_by_at: z.string().datetime({ offset: true }).transform(v =>
|
|
82
|
+
new Date(v)
|
|
83
|
+
).optional(),
|
|
84
|
+
status: CommerceReturnStatus$inboundSchema.optional(),
|
|
85
|
+
total_refund_amount: z.number().optional(),
|
|
86
|
+
type: z.string().optional(),
|
|
87
|
+
updated_at: z.string().datetime({ offset: true }).transform(v => new Date(v))
|
|
88
|
+
.optional(),
|
|
89
|
+
}).transform((v) => {
|
|
90
|
+
return remap$(v, {
|
|
91
|
+
"created_at": "createdAt",
|
|
92
|
+
"customer_email": "customerEmail",
|
|
93
|
+
"customer_name": "customerName",
|
|
94
|
+
"order_id": "orderId",
|
|
95
|
+
"return_by_at": "returnByAt",
|
|
96
|
+
"total_refund_amount": "totalRefundAmount",
|
|
97
|
+
"updated_at": "updatedAt",
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
export function commerceReturnFromJSON(
|
|
102
|
+
jsonString: string,
|
|
103
|
+
): SafeParseResult<CommerceReturn, SDKValidationError> {
|
|
104
|
+
return safeParse(
|
|
105
|
+
jsonString,
|
|
106
|
+
(x) => CommerceReturn$inboundSchema.parse(JSON.parse(x)),
|
|
107
|
+
`Failed to parse 'CommerceReturn' from JSON`,
|
|
108
|
+
);
|
|
109
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
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
|
+
|
|
11
|
+
export type CommerceReturnLineitem = {
|
|
12
|
+
id?: string | undefined;
|
|
13
|
+
/**
|
|
14
|
+
* (reference to CommerceItem)
|
|
15
|
+
*/
|
|
16
|
+
itemId?: string | undefined;
|
|
17
|
+
name?: string | undefined;
|
|
18
|
+
orderLineId?: string | undefined;
|
|
19
|
+
quantity?: number | undefined;
|
|
20
|
+
raw?: { [k: string]: any } | undefined;
|
|
21
|
+
reason?: string | undefined;
|
|
22
|
+
refundAmount?: number | undefined;
|
|
23
|
+
sku?: string | undefined;
|
|
24
|
+
status?: string | undefined;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
/** @internal */
|
|
28
|
+
export const CommerceReturnLineitem$inboundSchema: z.ZodType<
|
|
29
|
+
CommerceReturnLineitem,
|
|
30
|
+
z.ZodTypeDef,
|
|
31
|
+
unknown
|
|
32
|
+
> = z.object({
|
|
33
|
+
id: z.string().optional(),
|
|
34
|
+
item_id: z.string().optional(),
|
|
35
|
+
name: z.string().optional(),
|
|
36
|
+
order_line_id: z.string().optional(),
|
|
37
|
+
quantity: z.number().optional(),
|
|
38
|
+
raw: z.record(z.any()).optional(),
|
|
39
|
+
reason: z.string().optional(),
|
|
40
|
+
refund_amount: z.number().optional(),
|
|
41
|
+
sku: z.string().optional(),
|
|
42
|
+
status: z.string().optional(),
|
|
43
|
+
}).transform((v) => {
|
|
44
|
+
return remap$(v, {
|
|
45
|
+
"item_id": "itemId",
|
|
46
|
+
"order_line_id": "orderLineId",
|
|
47
|
+
"refund_amount": "refundAmount",
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
export function commerceReturnLineitemFromJSON(
|
|
52
|
+
jsonString: string,
|
|
53
|
+
): SafeParseResult<CommerceReturnLineitem, SDKValidationError> {
|
|
54
|
+
return safeParse(
|
|
55
|
+
jsonString,
|
|
56
|
+
(x) => CommerceReturnLineitem$inboundSchema.parse(JSON.parse(x)),
|
|
57
|
+
`Failed to parse 'CommerceReturnLineitem' from JSON`,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -162,6 +162,8 @@ export * from "./commercelocation.js";
|
|
|
162
162
|
export * from "./commercemetadata.js";
|
|
163
163
|
export * from "./commercereference.js";
|
|
164
164
|
export * from "./commercereservation.js";
|
|
165
|
+
export * from "./commercereturn.js";
|
|
166
|
+
export * from "./commercereturnlineitem.js";
|
|
165
167
|
export * from "./commercereview.js";
|
|
166
168
|
export * from "./commercereviewcomment.js";
|
|
167
169
|
export * from "./commercesaleschannel.js";
|
|
@@ -86,6 +86,8 @@ export const PropertyConnectionPermissions = {
|
|
|
86
86
|
CommerceItemvariantWrite: "commerce_itemvariant_write",
|
|
87
87
|
CommerceReservationRead: "commerce_reservation_read",
|
|
88
88
|
CommerceReservationWrite: "commerce_reservation_write",
|
|
89
|
+
CommerceReturnRead: "commerce_return_read",
|
|
90
|
+
CommerceReturnWrite: "commerce_return_write",
|
|
89
91
|
CommerceAvailabilityRead: "commerce_availability_read",
|
|
90
92
|
CommerceAvailabilityWrite: "commerce_availability_write",
|
|
91
93
|
VerificationPackageRead: "verification_package_read",
|
|
@@ -80,6 +80,7 @@ export const WebhookObjectType = {
|
|
|
80
80
|
CommerceSaleschannel: "commerce_saleschannel",
|
|
81
81
|
CommerceItemvariant: "commerce_itemvariant",
|
|
82
82
|
CommerceReservation: "commerce_reservation",
|
|
83
|
+
CommerceReturn: "commerce_return",
|
|
83
84
|
CommerceAvailability: "commerce_availability",
|
|
84
85
|
VerificationPackage: "verification_package",
|
|
85
86
|
VerificationRequest: "verification_request",
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { commerceGetCommerceReturn } from "../funcs/commerceGetCommerceReturn.js";
|
|
6
|
+
import { commerceListCommerceReturns } from "../funcs/commerceListCommerceReturns.js";
|
|
7
|
+
import { ClientSDK, RequestOptions } from "../lib/sdks.js";
|
|
8
|
+
import * as operations from "./models/operations/index.js";
|
|
9
|
+
import * as shared from "./models/shared/index.js";
|
|
10
|
+
import { unwrapAsync } from "./types/fp.js";
|
|
11
|
+
|
|
12
|
+
export class Return extends ClientSDK {
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve a return
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Retrieves a single CommerceReturn by its `id`. Obtain `id` values from the corresponding list endpoint. Use `fields` to return only the fields you need.
|
|
18
|
+
*/
|
|
19
|
+
async getCommerceReturn(
|
|
20
|
+
request: operations.GetCommerceReturnRequest,
|
|
21
|
+
options?: RequestOptions,
|
|
22
|
+
): Promise<shared.CommerceReturn> {
|
|
23
|
+
return unwrapAsync(commerceGetCommerceReturn(
|
|
24
|
+
this,
|
|
25
|
+
request,
|
|
26
|
+
options,
|
|
27
|
+
));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* List all returns
|
|
32
|
+
*
|
|
33
|
+
* @remarks
|
|
34
|
+
* Returns a list of CommerceReturns. Narrow the results with the query parameters before paging, then page through them with `limit` and `offset` (the default and maximum page size depend on the integration). Use `fields` to return only the fields you need and reduce the response size. When the integration supports a total count, it is returned in the `X-Total-Count` response header. Use each item's `id` to retrieve, update, or delete it where those operations are supported.
|
|
35
|
+
*/
|
|
36
|
+
async listCommerceReturns(
|
|
37
|
+
request: operations.ListCommerceReturnsRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): Promise<Array<shared.CommerceReturn>> {
|
|
40
|
+
return unwrapAsync(commerceListCommerceReturns(
|
|
41
|
+
this,
|
|
42
|
+
request,
|
|
43
|
+
options,
|
|
44
|
+
));
|
|
45
|
+
}
|
|
46
|
+
}
|
package/src/sdk/sdk.ts
CHANGED
|
@@ -170,6 +170,7 @@ import { Report } from "./report.js";
|
|
|
170
170
|
import { Repository } from "./repository.js";
|
|
171
171
|
import { RequestT } from "./request.js";
|
|
172
172
|
import { Reservation } from "./reservation.js";
|
|
173
|
+
import { Return } from "./return.js";
|
|
173
174
|
import { Review } from "./review.js";
|
|
174
175
|
import { Room } from "./room.js";
|
|
175
176
|
import { Saleschannel } from "./saleschannel.js";
|
|
@@ -621,6 +622,11 @@ export class UnifiedTo extends ClientSDK {
|
|
|
621
622
|
return (this._reservation ??= new Reservation(this._options));
|
|
622
623
|
}
|
|
623
624
|
|
|
625
|
+
private _return?: Return;
|
|
626
|
+
get return(): Return {
|
|
627
|
+
return (this._return ??= new Return(this._options));
|
|
628
|
+
}
|
|
629
|
+
|
|
624
630
|
private _review?: Review;
|
|
625
631
|
get review(): Review {
|
|
626
632
|
return (this._review ??= new Review(this._options));
|