ce-storefront 0.0.4 → 0.0.5
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 +6 -0
- package/docs/sdks/customersapi/README.md +234 -0
- package/funcs/customersAPIGetCustomersId.d.ts +15 -0
- package/funcs/customersAPIGetCustomersId.d.ts.map +1 -0
- package/funcs/customersAPIGetCustomersId.js +93 -0
- package/funcs/customersAPIGetCustomersId.js.map +1 -0
- package/funcs/customersAPIPostCustomers.d.ts +17 -0
- package/funcs/customersAPIPostCustomers.d.ts.map +1 -0
- package/funcs/customersAPIPostCustomers.js +96 -0
- package/funcs/customersAPIPostCustomers.js.map +1 -0
- package/funcs/customersAPIPutCustomersId.d.ts +16 -0
- package/funcs/customersAPIPutCustomersId.d.ts.map +1 -0
- package/funcs/customersAPIPutCustomersId.js +98 -0
- package/funcs/customersAPIPutCustomersId.js.map +1 -0
- package/lib/config.d.ts +2 -2
- package/lib/config.js +2 -2
- package/models/components/business.d.ts +31 -0
- package/models/components/business.d.ts.map +1 -0
- package/models/components/business.js +71 -0
- package/models/components/business.js.map +1 -0
- package/models/components/cart.d.ts +1 -1
- package/models/components/cart.d.ts.map +1 -1
- package/models/components/cart.js +5 -5
- package/models/components/cart.js.map +1 -1
- package/models/components/createcustomer.d.ts +29 -0
- package/models/components/createcustomer.d.ts.map +1 -0
- package/models/components/createcustomer.js +54 -0
- package/models/components/createcustomer.js.map +1 -0
- package/models/components/{customeraddress.d.ts → customeraddressinput.d.ts} +29 -29
- package/models/components/customeraddressinput.d.ts.map +1 -0
- package/models/components/{customeraddress.js → customeraddressinput.js} +30 -30
- package/models/components/customeraddressinput.js.map +1 -0
- package/models/components/customerdetail.d.ts +51 -0
- package/models/components/customerdetail.d.ts.map +1 -0
- package/models/components/customerdetail.js +88 -0
- package/models/components/customerdetail.js.map +1 -0
- package/models/components/index.d.ts +5 -1
- package/models/components/index.d.ts.map +1 -1
- package/models/components/index.js +5 -1
- package/models/components/index.js.map +1 -1
- package/models/components/orderdetail.d.ts +1 -1
- package/models/components/orderdetail.d.ts.map +1 -1
- package/models/components/orderdetail.js +5 -5
- package/models/components/orderdetail.js.map +1 -1
- package/models/components/updatecustomer.d.ts +26 -0
- package/models/components/updatecustomer.d.ts.map +1 -0
- package/models/components/updatecustomer.js +51 -0
- package/models/components/updatecustomer.js.map +1 -0
- package/models/operations/getcustomersid.d.ts +82 -0
- package/models/operations/getcustomersid.d.ts.map +1 -0
- package/models/operations/getcustomersid.js +106 -0
- package/models/operations/getcustomersid.js.map +1 -0
- package/models/operations/index.d.ts +3 -0
- package/models/operations/index.d.ts.map +1 -1
- package/models/operations/index.js +3 -0
- package/models/operations/index.js.map +1 -1
- package/models/operations/postcustomers.d.ts +56 -0
- package/models/operations/postcustomers.d.ts.map +1 -0
- package/models/operations/postcustomers.js +87 -0
- package/models/operations/postcustomers.js.map +1 -0
- package/models/operations/putcustomersid.d.ts +84 -0
- package/models/operations/putcustomersid.d.ts.map +1 -0
- package/models/operations/putcustomersid.js +120 -0
- package/models/operations/putcustomersid.js.map +1 -0
- package/package.json +1 -1
- package/sdk/customersapi.d.ts +22 -0
- package/sdk/customersapi.d.ts.map +1 -1
- package/sdk/customersapi.js +30 -0
- package/sdk/customersapi.js.map +1 -1
- package/src/funcs/customersAPIGetCustomersId.ts +124 -0
- package/src/funcs/customersAPIPostCustomers.ts +133 -0
- package/src/funcs/customersAPIPutCustomersId.ts +136 -0
- package/src/lib/config.ts +2 -2
- package/src/models/components/business.ts +64 -0
- package/src/models/components/cart.ts +1 -1
- package/src/models/components/createcustomer.ts +58 -0
- package/src/models/components/customerdetail.ts +109 -0
- package/src/models/components/index.ts +5 -1
- package/src/models/components/orderdetail.ts +1 -1
- package/src/models/components/updatecustomer.ts +48 -0
- package/src/models/operations/getcustomersid.ts +153 -0
- package/src/models/operations/index.ts +3 -0
- package/src/models/operations/postcustomers.ts +110 -0
- package/src/models/operations/putcustomersid.ts +169 -0
- package/src/sdk/customersapi.ts +43 -0
- package/models/components/customeraddress.d.ts.map +0 -1
- package/models/components/customeraddress.js.map +0 -1
- package/src/models/components/{customeraddress.ts → customeraddressinput.ts} +46 -46
package/sdk/customersapi.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customersapi.js","sourceRoot":"","sources":["../src/sdk/customersapi.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,0GAAoG;AACpG,4CAA2D;
|
|
1
|
+
{"version":3,"file":"customersapi.js","sourceRoot":"","sources":["../src/sdk/customersapi.ts"],"names":[],"mappings":";AAAA;;GAEG;;;AAEH,0FAAoF;AACpF,0GAAoG;AACpG,wFAAkF;AAClF,0FAAoF;AACpF,4CAA2D;AAG3D,0CAA6C;AAE7C,MAAa,YAAa,SAAQ,mBAAS;IACvC;;;;;OAKG;IACH,KAAK,CAAC,sBAAsB,CACxB,OAAiD,EACjD,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,0EAAkC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IACnF,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,aAAa,CACf,OAA+C,EAC/C,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,wDAAyB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAChB,OAAyC,EACzC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,0DAA0B,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3E,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,cAAc,CAChB,OAAyC,EACzC,OAAwB;QAExB,OAAO,IAAA,mBAAW,EAAC,IAAA,0DAA0B,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;IAC3E,CAAC;CACJ;AApDD,oCAoDC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CeStorefrontCore } from "../core.js";
|
|
6
|
+
import { encodeSimple as encodeSimple$ } from "../lib/encodings.js";
|
|
7
|
+
import * as m$ from "../lib/matchers.js";
|
|
8
|
+
import * as schemas$ from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../models/errors/httpclienterrors.js";
|
|
19
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
20
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
21
|
+
import * as operations from "../models/operations/index.js";
|
|
22
|
+
import { Result } from "../types/fp.js";
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Retrieve customer detail
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Retrieve customer detail.
|
|
29
|
+
*/
|
|
30
|
+
export async function customersAPIGetCustomersId(
|
|
31
|
+
client$: CeStorefrontCore,
|
|
32
|
+
request: operations.GetCustomersIdRequest,
|
|
33
|
+
options?: RequestOptions
|
|
34
|
+
): Promise<
|
|
35
|
+
Result<
|
|
36
|
+
operations.GetCustomersIdResponseBody,
|
|
37
|
+
| SDKError
|
|
38
|
+
| SDKValidationError
|
|
39
|
+
| UnexpectedClientError
|
|
40
|
+
| InvalidRequestError
|
|
41
|
+
| RequestAbortedError
|
|
42
|
+
| RequestTimeoutError
|
|
43
|
+
| ConnectionError
|
|
44
|
+
>
|
|
45
|
+
> {
|
|
46
|
+
const input$ = request;
|
|
47
|
+
|
|
48
|
+
const parsed$ = schemas$.safeParse(
|
|
49
|
+
input$,
|
|
50
|
+
(value$) => operations.GetCustomersIdRequest$outboundSchema.parse(value$),
|
|
51
|
+
"Input validation failed"
|
|
52
|
+
);
|
|
53
|
+
if (!parsed$.ok) {
|
|
54
|
+
return parsed$;
|
|
55
|
+
}
|
|
56
|
+
const payload$ = parsed$.value;
|
|
57
|
+
const body$ = null;
|
|
58
|
+
|
|
59
|
+
const pathParams$ = {
|
|
60
|
+
id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }),
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const path$ = pathToFunc("/customers/{id}")(pathParams$);
|
|
64
|
+
|
|
65
|
+
const headers$ = new Headers({
|
|
66
|
+
Accept: "application/json",
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
const authorization$ = await extractSecurity(client$.options$.authorization);
|
|
70
|
+
const security$ = authorization$ == null ? {} : { authorization: authorization$ };
|
|
71
|
+
const context = {
|
|
72
|
+
operationID: "get-customers-id",
|
|
73
|
+
oAuth2Scopes: [],
|
|
74
|
+
securitySource: client$.options$.authorization,
|
|
75
|
+
};
|
|
76
|
+
const securitySettings$ = resolveGlobalSecurity(security$);
|
|
77
|
+
|
|
78
|
+
const requestRes = client$.createRequest$(
|
|
79
|
+
context,
|
|
80
|
+
{
|
|
81
|
+
security: securitySettings$,
|
|
82
|
+
method: "GET",
|
|
83
|
+
path: path$,
|
|
84
|
+
headers: headers$,
|
|
85
|
+
body: body$,
|
|
86
|
+
timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
|
|
87
|
+
},
|
|
88
|
+
options
|
|
89
|
+
);
|
|
90
|
+
if (!requestRes.ok) {
|
|
91
|
+
return requestRes;
|
|
92
|
+
}
|
|
93
|
+
const request$ = requestRes.value;
|
|
94
|
+
|
|
95
|
+
const doResult = await client$.do$(request$, {
|
|
96
|
+
context,
|
|
97
|
+
errorCodes: ["4XX", "5XX"],
|
|
98
|
+
retryConfig: options?.retries || client$.options$.retryConfig,
|
|
99
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
100
|
+
});
|
|
101
|
+
if (!doResult.ok) {
|
|
102
|
+
return doResult;
|
|
103
|
+
}
|
|
104
|
+
const response = doResult.value;
|
|
105
|
+
|
|
106
|
+
const [result$] = await m$.match<
|
|
107
|
+
operations.GetCustomersIdResponseBody,
|
|
108
|
+
| SDKError
|
|
109
|
+
| SDKValidationError
|
|
110
|
+
| UnexpectedClientError
|
|
111
|
+
| InvalidRequestError
|
|
112
|
+
| RequestAbortedError
|
|
113
|
+
| RequestTimeoutError
|
|
114
|
+
| ConnectionError
|
|
115
|
+
>(
|
|
116
|
+
m$.json(200, operations.GetCustomersIdResponseBody$inboundSchema),
|
|
117
|
+
m$.fail(["4XX", "5XX"])
|
|
118
|
+
)(response);
|
|
119
|
+
if (!result$.ok) {
|
|
120
|
+
return result$;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return result$;
|
|
124
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CeStorefrontCore } from "../core.js";
|
|
6
|
+
import { encodeJSON as encodeJSON$ } from "../lib/encodings.js";
|
|
7
|
+
import * as m$ from "../lib/matchers.js";
|
|
8
|
+
import * as schemas$ from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import * as components from "../models/components/index.js";
|
|
13
|
+
import {
|
|
14
|
+
ConnectionError,
|
|
15
|
+
InvalidRequestError,
|
|
16
|
+
RequestAbortedError,
|
|
17
|
+
RequestTimeoutError,
|
|
18
|
+
UnexpectedClientError,
|
|
19
|
+
} from "../models/errors/httpclienterrors.js";
|
|
20
|
+
import * as errors from "../models/errors/index.js";
|
|
21
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
22
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
23
|
+
import * as operations from "../models/operations/index.js";
|
|
24
|
+
import { Result } from "../types/fp.js";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Create customer
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* Create customer
|
|
31
|
+
*/
|
|
32
|
+
export async function customersAPIPostCustomers(
|
|
33
|
+
client$: CeStorefrontCore,
|
|
34
|
+
request?: components.CreateCustomer | undefined,
|
|
35
|
+
options?: RequestOptions
|
|
36
|
+
): Promise<
|
|
37
|
+
Result<
|
|
38
|
+
operations.PostCustomersResponseBody,
|
|
39
|
+
| errors.BadRequest
|
|
40
|
+
| errors.Unauthorized
|
|
41
|
+
| SDKError
|
|
42
|
+
| SDKValidationError
|
|
43
|
+
| UnexpectedClientError
|
|
44
|
+
| InvalidRequestError
|
|
45
|
+
| RequestAbortedError
|
|
46
|
+
| RequestTimeoutError
|
|
47
|
+
| ConnectionError
|
|
48
|
+
>
|
|
49
|
+
> {
|
|
50
|
+
const input$ = request;
|
|
51
|
+
|
|
52
|
+
const parsed$ = schemas$.safeParse(
|
|
53
|
+
input$,
|
|
54
|
+
(value$) => components.CreateCustomer$outboundSchema.optional().parse(value$),
|
|
55
|
+
"Input validation failed"
|
|
56
|
+
);
|
|
57
|
+
if (!parsed$.ok) {
|
|
58
|
+
return parsed$;
|
|
59
|
+
}
|
|
60
|
+
const payload$ = parsed$.value;
|
|
61
|
+
const body$ = payload$ === undefined ? null : encodeJSON$("body", payload$, { explode: true });
|
|
62
|
+
|
|
63
|
+
const path$ = pathToFunc("/customers")();
|
|
64
|
+
|
|
65
|
+
const headers$ = new Headers({
|
|
66
|
+
"Content-Type": "application/json",
|
|
67
|
+
Accept: "application/json",
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
const authorization$ = await extractSecurity(client$.options$.authorization);
|
|
71
|
+
const security$ = authorization$ == null ? {} : { authorization: authorization$ };
|
|
72
|
+
const context = {
|
|
73
|
+
operationID: "post-customers",
|
|
74
|
+
oAuth2Scopes: [],
|
|
75
|
+
securitySource: client$.options$.authorization,
|
|
76
|
+
};
|
|
77
|
+
const securitySettings$ = resolveGlobalSecurity(security$);
|
|
78
|
+
|
|
79
|
+
const requestRes = client$.createRequest$(
|
|
80
|
+
context,
|
|
81
|
+
{
|
|
82
|
+
security: securitySettings$,
|
|
83
|
+
method: "POST",
|
|
84
|
+
path: path$,
|
|
85
|
+
headers: headers$,
|
|
86
|
+
body: body$,
|
|
87
|
+
timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
|
|
88
|
+
},
|
|
89
|
+
options
|
|
90
|
+
);
|
|
91
|
+
if (!requestRes.ok) {
|
|
92
|
+
return requestRes;
|
|
93
|
+
}
|
|
94
|
+
const request$ = requestRes.value;
|
|
95
|
+
|
|
96
|
+
const doResult = await client$.do$(request$, {
|
|
97
|
+
context,
|
|
98
|
+
errorCodes: ["400", "401", "4XX", "5XX"],
|
|
99
|
+
retryConfig: options?.retries || client$.options$.retryConfig,
|
|
100
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
101
|
+
});
|
|
102
|
+
if (!doResult.ok) {
|
|
103
|
+
return doResult;
|
|
104
|
+
}
|
|
105
|
+
const response = doResult.value;
|
|
106
|
+
|
|
107
|
+
const responseFields$ = {
|
|
108
|
+
HttpMeta: { Response: response, Request: request$ },
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const [result$] = await m$.match<
|
|
112
|
+
operations.PostCustomersResponseBody,
|
|
113
|
+
| errors.BadRequest
|
|
114
|
+
| errors.Unauthorized
|
|
115
|
+
| SDKError
|
|
116
|
+
| SDKValidationError
|
|
117
|
+
| UnexpectedClientError
|
|
118
|
+
| InvalidRequestError
|
|
119
|
+
| RequestAbortedError
|
|
120
|
+
| RequestTimeoutError
|
|
121
|
+
| ConnectionError
|
|
122
|
+
>(
|
|
123
|
+
m$.json(200, operations.PostCustomersResponseBody$inboundSchema),
|
|
124
|
+
m$.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
125
|
+
m$.jsonErr(401, errors.Unauthorized$inboundSchema),
|
|
126
|
+
m$.fail(["4XX", "5XX"])
|
|
127
|
+
)(response, { extraFields: responseFields$ });
|
|
128
|
+
if (!result$.ok) {
|
|
129
|
+
return result$;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
return result$;
|
|
133
|
+
}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { CeStorefrontCore } from "../core.js";
|
|
6
|
+
import { encodeJSON as encodeJSON$, encodeSimple as encodeSimple$ } from "../lib/encodings.js";
|
|
7
|
+
import * as m$ from "../lib/matchers.js";
|
|
8
|
+
import * as schemas$ from "../lib/schemas.js";
|
|
9
|
+
import { RequestOptions } from "../lib/sdks.js";
|
|
10
|
+
import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js";
|
|
11
|
+
import { pathToFunc } from "../lib/url.js";
|
|
12
|
+
import {
|
|
13
|
+
ConnectionError,
|
|
14
|
+
InvalidRequestError,
|
|
15
|
+
RequestAbortedError,
|
|
16
|
+
RequestTimeoutError,
|
|
17
|
+
UnexpectedClientError,
|
|
18
|
+
} from "../models/errors/httpclienterrors.js";
|
|
19
|
+
import * as errors from "../models/errors/index.js";
|
|
20
|
+
import { SDKError } from "../models/errors/sdkerror.js";
|
|
21
|
+
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
|
|
22
|
+
import * as operations from "../models/operations/index.js";
|
|
23
|
+
import { Result } from "../types/fp.js";
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Update customer detail
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Update customer detail
|
|
30
|
+
*/
|
|
31
|
+
export async function customersAPIPutCustomersId(
|
|
32
|
+
client$: CeStorefrontCore,
|
|
33
|
+
request: operations.PutCustomersIdRequest,
|
|
34
|
+
options?: RequestOptions
|
|
35
|
+
): Promise<
|
|
36
|
+
Result<
|
|
37
|
+
operations.PutCustomersIdResponseBody,
|
|
38
|
+
| errors.BadRequest
|
|
39
|
+
| errors.Unauthorized
|
|
40
|
+
| SDKError
|
|
41
|
+
| SDKValidationError
|
|
42
|
+
| UnexpectedClientError
|
|
43
|
+
| InvalidRequestError
|
|
44
|
+
| RequestAbortedError
|
|
45
|
+
| RequestTimeoutError
|
|
46
|
+
| ConnectionError
|
|
47
|
+
>
|
|
48
|
+
> {
|
|
49
|
+
const input$ = request;
|
|
50
|
+
|
|
51
|
+
const parsed$ = schemas$.safeParse(
|
|
52
|
+
input$,
|
|
53
|
+
(value$) => operations.PutCustomersIdRequest$outboundSchema.parse(value$),
|
|
54
|
+
"Input validation failed"
|
|
55
|
+
);
|
|
56
|
+
if (!parsed$.ok) {
|
|
57
|
+
return parsed$;
|
|
58
|
+
}
|
|
59
|
+
const payload$ = parsed$.value;
|
|
60
|
+
const body$ = encodeJSON$("body", payload$.UpdateCustomer, { explode: true });
|
|
61
|
+
|
|
62
|
+
const pathParams$ = {
|
|
63
|
+
id: encodeSimple$("id", payload$.id, { explode: false, charEncoding: "percent" }),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
const path$ = pathToFunc("/customers/{id}")(pathParams$);
|
|
67
|
+
|
|
68
|
+
const headers$ = new Headers({
|
|
69
|
+
"Content-Type": "application/json",
|
|
70
|
+
Accept: "application/json",
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
const authorization$ = await extractSecurity(client$.options$.authorization);
|
|
74
|
+
const security$ = authorization$ == null ? {} : { authorization: authorization$ };
|
|
75
|
+
const context = {
|
|
76
|
+
operationID: "put-customers-id",
|
|
77
|
+
oAuth2Scopes: [],
|
|
78
|
+
securitySource: client$.options$.authorization,
|
|
79
|
+
};
|
|
80
|
+
const securitySettings$ = resolveGlobalSecurity(security$);
|
|
81
|
+
|
|
82
|
+
const requestRes = client$.createRequest$(
|
|
83
|
+
context,
|
|
84
|
+
{
|
|
85
|
+
security: securitySettings$,
|
|
86
|
+
method: "PUT",
|
|
87
|
+
path: path$,
|
|
88
|
+
headers: headers$,
|
|
89
|
+
body: body$,
|
|
90
|
+
timeoutMs: options?.timeoutMs || client$.options$.timeoutMs || -1,
|
|
91
|
+
},
|
|
92
|
+
options
|
|
93
|
+
);
|
|
94
|
+
if (!requestRes.ok) {
|
|
95
|
+
return requestRes;
|
|
96
|
+
}
|
|
97
|
+
const request$ = requestRes.value;
|
|
98
|
+
|
|
99
|
+
const doResult = await client$.do$(request$, {
|
|
100
|
+
context,
|
|
101
|
+
errorCodes: ["400", "401", "4XX", "5XX"],
|
|
102
|
+
retryConfig: options?.retries || client$.options$.retryConfig,
|
|
103
|
+
retryCodes: options?.retryCodes || ["429", "500", "502", "503", "504"],
|
|
104
|
+
});
|
|
105
|
+
if (!doResult.ok) {
|
|
106
|
+
return doResult;
|
|
107
|
+
}
|
|
108
|
+
const response = doResult.value;
|
|
109
|
+
|
|
110
|
+
const responseFields$ = {
|
|
111
|
+
HttpMeta: { Response: response, Request: request$ },
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const [result$] = await m$.match<
|
|
115
|
+
operations.PutCustomersIdResponseBody,
|
|
116
|
+
| errors.BadRequest
|
|
117
|
+
| errors.Unauthorized
|
|
118
|
+
| SDKError
|
|
119
|
+
| SDKValidationError
|
|
120
|
+
| UnexpectedClientError
|
|
121
|
+
| InvalidRequestError
|
|
122
|
+
| RequestAbortedError
|
|
123
|
+
| RequestTimeoutError
|
|
124
|
+
| ConnectionError
|
|
125
|
+
>(
|
|
126
|
+
m$.json(200, operations.PutCustomersIdResponseBody$inboundSchema),
|
|
127
|
+
m$.jsonErr(400, errors.BadRequest$inboundSchema),
|
|
128
|
+
m$.jsonErr(401, errors.Unauthorized$inboundSchema),
|
|
129
|
+
m$.fail(["4XX", "5XX"])
|
|
130
|
+
)(response, { extraFields: responseFields$ });
|
|
131
|
+
if (!result$.ok) {
|
|
132
|
+
return result$;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
return result$;
|
|
136
|
+
}
|
package/src/lib/config.ts
CHANGED
|
@@ -74,7 +74,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
|
|
|
74
74
|
export const SDK_METADATA = {
|
|
75
75
|
language: "typescript",
|
|
76
76
|
openapiDocVersion: "1.0",
|
|
77
|
-
sdkVersion: "0.0.
|
|
77
|
+
sdkVersion: "0.0.5",
|
|
78
78
|
genVersion: "2.404.3",
|
|
79
|
-
userAgent: "speakeasy-sdk/typescript 0.0.
|
|
79
|
+
userAgent: "speakeasy-sdk/typescript 0.0.5 2.404.3 1.0 ce-storefront",
|
|
80
80
|
} as const;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
import * as z from "zod";
|
|
7
|
+
|
|
8
|
+
export type Business = {
|
|
9
|
+
businessType: string;
|
|
10
|
+
name: string;
|
|
11
|
+
panNumber: string;
|
|
12
|
+
gstin?: string | null | undefined;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/** @internal */
|
|
16
|
+
export const Business$inboundSchema: z.ZodType<Business, z.ZodTypeDef, unknown> = z
|
|
17
|
+
.object({
|
|
18
|
+
business_type: z.string(),
|
|
19
|
+
name: z.string(),
|
|
20
|
+
pan_number: z.string(),
|
|
21
|
+
gstin: z.nullable(z.string()).optional(),
|
|
22
|
+
})
|
|
23
|
+
.transform((v) => {
|
|
24
|
+
return remap$(v, {
|
|
25
|
+
business_type: "businessType",
|
|
26
|
+
pan_number: "panNumber",
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
/** @internal */
|
|
31
|
+
export type Business$Outbound = {
|
|
32
|
+
business_type: string;
|
|
33
|
+
name: string;
|
|
34
|
+
pan_number: string;
|
|
35
|
+
gstin?: string | null | undefined;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
/** @internal */
|
|
39
|
+
export const Business$outboundSchema: z.ZodType<Business$Outbound, z.ZodTypeDef, Business> = z
|
|
40
|
+
.object({
|
|
41
|
+
businessType: z.string(),
|
|
42
|
+
name: z.string(),
|
|
43
|
+
panNumber: z.string(),
|
|
44
|
+
gstin: z.nullable(z.string()).optional(),
|
|
45
|
+
})
|
|
46
|
+
.transform((v) => {
|
|
47
|
+
return remap$(v, {
|
|
48
|
+
businessType: "business_type",
|
|
49
|
+
panNumber: "pan_number",
|
|
50
|
+
});
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* @internal
|
|
55
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
56
|
+
*/
|
|
57
|
+
export namespace Business$ {
|
|
58
|
+
/** @deprecated use `Business$inboundSchema` instead. */
|
|
59
|
+
export const inboundSchema = Business$inboundSchema;
|
|
60
|
+
/** @deprecated use `Business$outboundSchema` instead. */
|
|
61
|
+
export const outboundSchema = Business$outboundSchema;
|
|
62
|
+
/** @deprecated use `Business$Outbound` instead. */
|
|
63
|
+
export type Outbound = Business$Outbound;
|
|
64
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
Business,
|
|
7
|
+
Business$inboundSchema,
|
|
8
|
+
Business$Outbound,
|
|
9
|
+
Business$outboundSchema,
|
|
10
|
+
} from "./business.js";
|
|
11
|
+
import {
|
|
12
|
+
CustomerAddressInput,
|
|
13
|
+
CustomerAddressInput$inboundSchema,
|
|
14
|
+
CustomerAddressInput$Outbound,
|
|
15
|
+
CustomerAddressInput$outboundSchema,
|
|
16
|
+
} from "./customeraddressinput.js";
|
|
17
|
+
import * as z from "zod";
|
|
18
|
+
|
|
19
|
+
export type CreateCustomer = {
|
|
20
|
+
business?: Business | undefined;
|
|
21
|
+
address?: CustomerAddressInput | null | undefined;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/** @internal */
|
|
25
|
+
export const CreateCustomer$inboundSchema: z.ZodType<CreateCustomer, z.ZodTypeDef, unknown> =
|
|
26
|
+
z.object({
|
|
27
|
+
business: Business$inboundSchema.optional(),
|
|
28
|
+
address: z.nullable(CustomerAddressInput$inboundSchema).optional(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
/** @internal */
|
|
32
|
+
export type CreateCustomer$Outbound = {
|
|
33
|
+
business?: Business$Outbound | undefined;
|
|
34
|
+
address?: CustomerAddressInput$Outbound | null | undefined;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/** @internal */
|
|
38
|
+
export const CreateCustomer$outboundSchema: z.ZodType<
|
|
39
|
+
CreateCustomer$Outbound,
|
|
40
|
+
z.ZodTypeDef,
|
|
41
|
+
CreateCustomer
|
|
42
|
+
> = z.object({
|
|
43
|
+
business: Business$outboundSchema.optional(),
|
|
44
|
+
address: z.nullable(CustomerAddressInput$outboundSchema).optional(),
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* @internal
|
|
49
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
50
|
+
*/
|
|
51
|
+
export namespace CreateCustomer$ {
|
|
52
|
+
/** @deprecated use `CreateCustomer$inboundSchema` instead. */
|
|
53
|
+
export const inboundSchema = CreateCustomer$inboundSchema;
|
|
54
|
+
/** @deprecated use `CreateCustomer$outboundSchema` instead. */
|
|
55
|
+
export const outboundSchema = CreateCustomer$outboundSchema;
|
|
56
|
+
/** @deprecated use `CreateCustomer$Outbound` instead. */
|
|
57
|
+
export type Outbound = CreateCustomer$Outbound;
|
|
58
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
6
|
+
import {
|
|
7
|
+
Business,
|
|
8
|
+
Business$inboundSchema,
|
|
9
|
+
Business$Outbound,
|
|
10
|
+
Business$outboundSchema,
|
|
11
|
+
} from "./business.js";
|
|
12
|
+
import * as z from "zod";
|
|
13
|
+
|
|
14
|
+
export type CustomerDetail = {
|
|
15
|
+
id?: string | undefined;
|
|
16
|
+
firstName?: string | undefined;
|
|
17
|
+
lastName?: string | undefined;
|
|
18
|
+
/**
|
|
19
|
+
* Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
*
|
|
23
|
+
*/
|
|
24
|
+
countryCode?: string | undefined;
|
|
25
|
+
/**
|
|
26
|
+
* 10 digit phone number without country code.
|
|
27
|
+
*/
|
|
28
|
+
phone?: string | undefined;
|
|
29
|
+
email?: string | undefined;
|
|
30
|
+
isPhoneVerified?: boolean | undefined;
|
|
31
|
+
isEmailVerified?: boolean | undefined;
|
|
32
|
+
business?: Business | undefined;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** @internal */
|
|
36
|
+
export const CustomerDetail$inboundSchema: z.ZodType<CustomerDetail, z.ZodTypeDef, unknown> = z
|
|
37
|
+
.object({
|
|
38
|
+
id: z.string().optional(),
|
|
39
|
+
first_name: z.string().optional(),
|
|
40
|
+
last_name: z.string().optional(),
|
|
41
|
+
country_code: z.string().optional(),
|
|
42
|
+
phone: z.string().optional(),
|
|
43
|
+
email: z.string().optional(),
|
|
44
|
+
is_phone_verified: z.boolean().optional(),
|
|
45
|
+
is_email_verified: z.boolean().optional(),
|
|
46
|
+
business: Business$inboundSchema.optional(),
|
|
47
|
+
})
|
|
48
|
+
.transform((v) => {
|
|
49
|
+
return remap$(v, {
|
|
50
|
+
first_name: "firstName",
|
|
51
|
+
last_name: "lastName",
|
|
52
|
+
country_code: "countryCode",
|
|
53
|
+
is_phone_verified: "isPhoneVerified",
|
|
54
|
+
is_email_verified: "isEmailVerified",
|
|
55
|
+
});
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
/** @internal */
|
|
59
|
+
export type CustomerDetail$Outbound = {
|
|
60
|
+
id?: string | undefined;
|
|
61
|
+
first_name?: string | undefined;
|
|
62
|
+
last_name?: string | undefined;
|
|
63
|
+
country_code?: string | undefined;
|
|
64
|
+
phone?: string | undefined;
|
|
65
|
+
email?: string | undefined;
|
|
66
|
+
is_phone_verified?: boolean | undefined;
|
|
67
|
+
is_email_verified?: boolean | undefined;
|
|
68
|
+
business?: Business$Outbound | undefined;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
/** @internal */
|
|
72
|
+
export const CustomerDetail$outboundSchema: z.ZodType<
|
|
73
|
+
CustomerDetail$Outbound,
|
|
74
|
+
z.ZodTypeDef,
|
|
75
|
+
CustomerDetail
|
|
76
|
+
> = z
|
|
77
|
+
.object({
|
|
78
|
+
id: z.string().optional(),
|
|
79
|
+
firstName: z.string().optional(),
|
|
80
|
+
lastName: z.string().optional(),
|
|
81
|
+
countryCode: z.string().optional(),
|
|
82
|
+
phone: z.string().optional(),
|
|
83
|
+
email: z.string().optional(),
|
|
84
|
+
isPhoneVerified: z.boolean().optional(),
|
|
85
|
+
isEmailVerified: z.boolean().optional(),
|
|
86
|
+
business: Business$outboundSchema.optional(),
|
|
87
|
+
})
|
|
88
|
+
.transform((v) => {
|
|
89
|
+
return remap$(v, {
|
|
90
|
+
firstName: "first_name",
|
|
91
|
+
lastName: "last_name",
|
|
92
|
+
countryCode: "country_code",
|
|
93
|
+
isPhoneVerified: "is_phone_verified",
|
|
94
|
+
isEmailVerified: "is_email_verified",
|
|
95
|
+
});
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* @internal
|
|
100
|
+
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
|
|
101
|
+
*/
|
|
102
|
+
export namespace CustomerDetail$ {
|
|
103
|
+
/** @deprecated use `CustomerDetail$inboundSchema` instead. */
|
|
104
|
+
export const inboundSchema = CustomerDetail$inboundSchema;
|
|
105
|
+
/** @deprecated use `CustomerDetail$outboundSchema` instead. */
|
|
106
|
+
export const outboundSchema = CustomerDetail$outboundSchema;
|
|
107
|
+
/** @deprecated use `CustomerDetail$Outbound` instead. */
|
|
108
|
+
export type Outbound = CustomerDetail$Outbound;
|
|
109
|
+
}
|
|
@@ -4,15 +4,18 @@
|
|
|
4
4
|
|
|
5
5
|
export * from "./analyticsevent.js";
|
|
6
6
|
export * from "./banktransfer.js";
|
|
7
|
+
export * from "./business.js";
|
|
7
8
|
export * from "./cardpayment.js";
|
|
8
9
|
export * from "./cart.js";
|
|
9
10
|
export * from "./cartitem.js";
|
|
10
11
|
export * from "./country.js";
|
|
11
12
|
export * from "./countrystate.js";
|
|
12
13
|
export * from "./coupon.js";
|
|
14
|
+
export * from "./createcustomer.js";
|
|
13
15
|
export * from "./createreview.js";
|
|
14
16
|
export * from "./currency.js";
|
|
15
|
-
export * from "./
|
|
17
|
+
export * from "./customeraddressinput.js";
|
|
18
|
+
export * from "./customerdetail.js";
|
|
16
19
|
export * from "./customerloyalty.js";
|
|
17
20
|
export * from "./customerreadyforreview.js";
|
|
18
21
|
export * from "./customerreview.js";
|
|
@@ -51,6 +54,7 @@ export * from "./security.js";
|
|
|
51
54
|
export * from "./seo.js";
|
|
52
55
|
export * from "./shipmentitem.js";
|
|
53
56
|
export * from "./skuinfo.js";
|
|
57
|
+
export * from "./updatecustomer.js";
|
|
54
58
|
export * from "./upipayment.js";
|
|
55
59
|
export * from "./user.js";
|
|
56
60
|
export * from "./userinput.js";
|