ce-storefront 0.15.3 → 0.15.6

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.
Files changed (95) hide show
  1. package/README.md +15 -2
  2. package/docs/sdks/auth/README.md +10 -0
  3. package/docs/sdks/carts/README.md +12 -0
  4. package/docs/sdks/catalog/README.md +11 -0
  5. package/docs/sdks/common/README.md +1 -0
  6. package/docs/sdks/customers/README.md +7 -0
  7. package/docs/sdks/orders/README.md +7 -0
  8. package/docs/sdks/pos/README.md +397 -0
  9. package/docs/sdks/shipping/README.md +1 -0
  10. package/esm/funcs/posCreatePosCart.d.ts +17 -0
  11. package/esm/funcs/posCreatePosCart.d.ts.map +1 -0
  12. package/esm/funcs/posCreatePosCart.js +80 -0
  13. package/esm/funcs/posCreatePosCart.js.map +1 -0
  14. package/esm/funcs/posLoginToPosDevice.d.ts +17 -0
  15. package/esm/funcs/posLoginToPosDevice.d.ts.map +1 -0
  16. package/esm/funcs/posLoginToPosDevice.js +84 -0
  17. package/esm/funcs/posLoginToPosDevice.js.map +1 -0
  18. package/esm/funcs/posPairPosDevice.d.ts +17 -0
  19. package/esm/funcs/posPairPosDevice.d.ts.map +1 -0
  20. package/esm/funcs/posPairPosDevice.js +84 -0
  21. package/esm/funcs/posPairPosDevice.js.map +1 -0
  22. package/esm/funcs/posRefreshPosAccessToken.d.ts +17 -0
  23. package/esm/funcs/posRefreshPosAccessToken.d.ts.map +1 -0
  24. package/esm/funcs/posRefreshPosAccessToken.js +81 -0
  25. package/esm/funcs/posRefreshPosAccessToken.js.map +1 -0
  26. package/esm/funcs/posUpdatePosCart.d.ts +17 -0
  27. package/esm/funcs/posUpdatePosCart.d.ts.map +1 -0
  28. package/esm/funcs/posUpdatePosCart.js +84 -0
  29. package/esm/funcs/posUpdatePosCart.js.map +1 -0
  30. package/esm/lib/base64.d.ts +2 -2
  31. package/esm/lib/base64.d.ts.map +1 -1
  32. package/esm/lib/config.d.ts +3 -3
  33. package/esm/lib/config.js +3 -3
  34. package/esm/lib/encodings.d.ts.map +1 -1
  35. package/esm/models/components/index.d.ts +1 -0
  36. package/esm/models/components/index.d.ts.map +1 -1
  37. package/esm/models/components/index.js +1 -0
  38. package/esm/models/components/index.js.map +1 -1
  39. package/esm/models/components/posuser.d.ts +124 -0
  40. package/esm/models/components/posuser.d.ts.map +1 -0
  41. package/esm/models/components/posuser.js +139 -0
  42. package/esm/models/components/posuser.js.map +1 -0
  43. package/esm/models/operations/createposcart.d.ts +90 -0
  44. package/esm/models/operations/createposcart.d.ts.map +1 -0
  45. package/esm/models/operations/createposcart.js +86 -0
  46. package/esm/models/operations/createposcart.js.map +1 -0
  47. package/esm/models/operations/index.d.ts +5 -0
  48. package/esm/models/operations/index.d.ts.map +1 -1
  49. package/esm/models/operations/index.js +5 -0
  50. package/esm/models/operations/index.js.map +1 -1
  51. package/esm/models/operations/logintoposdevice.d.ts +118 -0
  52. package/esm/models/operations/logintoposdevice.d.ts.map +1 -0
  53. package/esm/models/operations/logintoposdevice.js +146 -0
  54. package/esm/models/operations/logintoposdevice.js.map +1 -0
  55. package/esm/models/operations/pairposdevice.d.ts +115 -0
  56. package/esm/models/operations/pairposdevice.d.ts.map +1 -0
  57. package/esm/models/operations/pairposdevice.js +141 -0
  58. package/esm/models/operations/pairposdevice.js.map +1 -0
  59. package/esm/models/operations/refreshposaccesstoken.d.ts +88 -0
  60. package/esm/models/operations/refreshposaccesstoken.d.ts.map +1 -0
  61. package/esm/models/operations/refreshposaccesstoken.js +106 -0
  62. package/esm/models/operations/refreshposaccesstoken.js.map +1 -0
  63. package/esm/models/operations/updateposcart.d.ts +120 -0
  64. package/esm/models/operations/updateposcart.d.ts.map +1 -0
  65. package/esm/models/operations/updateposcart.js +122 -0
  66. package/esm/models/operations/updateposcart.js.map +1 -0
  67. package/esm/sdk/pos.d.ts +40 -0
  68. package/esm/sdk/pos.d.ts.map +1 -0
  69. package/esm/sdk/pos.js +58 -0
  70. package/esm/sdk/pos.js.map +1 -0
  71. package/esm/sdk/sdk.d.ts +3 -0
  72. package/esm/sdk/sdk.d.ts.map +1 -1
  73. package/esm/sdk/sdk.js +4 -0
  74. package/esm/sdk/sdk.js.map +1 -1
  75. package/examples/README.md +5 -0
  76. package/examples/catalogListProducts.example.ts +2 -0
  77. package/examples/package-lock.json +6 -7
  78. package/jsr.json +1 -1
  79. package/package.json +5 -6
  80. package/src/funcs/posCreatePosCart.ts +165 -0
  81. package/src/funcs/posLoginToPosDevice.ts +174 -0
  82. package/src/funcs/posPairPosDevice.ts +174 -0
  83. package/src/funcs/posRefreshPosAccessToken.ts +164 -0
  84. package/src/funcs/posUpdatePosCart.ts +167 -0
  85. package/src/lib/config.ts +3 -3
  86. package/src/models/components/index.ts +1 -0
  87. package/src/models/components/posuser.ts +263 -0
  88. package/src/models/operations/createposcart.ts +197 -0
  89. package/src/models/operations/index.ts +5 -0
  90. package/src/models/operations/logintoposdevice.ts +297 -0
  91. package/src/models/operations/pairposdevice.ts +286 -0
  92. package/src/models/operations/refreshposaccesstoken.ts +223 -0
  93. package/src/models/operations/updateposcart.ts +271 -0
  94. package/src/sdk/pos.ts +103 -0
  95. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,223 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
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 RefreshPosAccessTokenRequestBody = {
12
+ refreshToken: string;
13
+ };
14
+
15
+ export type RefreshPosAccessTokenContent = {
16
+ accessToken?: string | undefined;
17
+ refreshToken?: string | undefined;
18
+ };
19
+
20
+ /**
21
+ * OK
22
+ */
23
+ export type RefreshPosAccessTokenResponseBody = {
24
+ message?: string | undefined;
25
+ success?: string | undefined;
26
+ content?: RefreshPosAccessTokenContent | undefined;
27
+ };
28
+
29
+ /** @internal */
30
+ export const RefreshPosAccessTokenRequestBody$inboundSchema: z.ZodType<
31
+ RefreshPosAccessTokenRequestBody,
32
+ z.ZodTypeDef,
33
+ unknown
34
+ > = z.object({
35
+ refresh_token: z.string(),
36
+ }).transform((v) => {
37
+ return remap$(v, {
38
+ "refresh_token": "refreshToken",
39
+ });
40
+ });
41
+
42
+ /** @internal */
43
+ export type RefreshPosAccessTokenRequestBody$Outbound = {
44
+ refresh_token: string;
45
+ };
46
+
47
+ /** @internal */
48
+ export const RefreshPosAccessTokenRequestBody$outboundSchema: z.ZodType<
49
+ RefreshPosAccessTokenRequestBody$Outbound,
50
+ z.ZodTypeDef,
51
+ RefreshPosAccessTokenRequestBody
52
+ > = z.object({
53
+ refreshToken: z.string(),
54
+ }).transform((v) => {
55
+ return remap$(v, {
56
+ refreshToken: "refresh_token",
57
+ });
58
+ });
59
+
60
+ /**
61
+ * @internal
62
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
63
+ */
64
+ export namespace RefreshPosAccessTokenRequestBody$ {
65
+ /** @deprecated use `RefreshPosAccessTokenRequestBody$inboundSchema` instead. */
66
+ export const inboundSchema = RefreshPosAccessTokenRequestBody$inboundSchema;
67
+ /** @deprecated use `RefreshPosAccessTokenRequestBody$outboundSchema` instead. */
68
+ export const outboundSchema = RefreshPosAccessTokenRequestBody$outboundSchema;
69
+ /** @deprecated use `RefreshPosAccessTokenRequestBody$Outbound` instead. */
70
+ export type Outbound = RefreshPosAccessTokenRequestBody$Outbound;
71
+ }
72
+
73
+ export function refreshPosAccessTokenRequestBodyToJSON(
74
+ refreshPosAccessTokenRequestBody: RefreshPosAccessTokenRequestBody,
75
+ ): string {
76
+ return JSON.stringify(
77
+ RefreshPosAccessTokenRequestBody$outboundSchema.parse(
78
+ refreshPosAccessTokenRequestBody,
79
+ ),
80
+ );
81
+ }
82
+
83
+ export function refreshPosAccessTokenRequestBodyFromJSON(
84
+ jsonString: string,
85
+ ): SafeParseResult<RefreshPosAccessTokenRequestBody, SDKValidationError> {
86
+ return safeParse(
87
+ jsonString,
88
+ (x) => RefreshPosAccessTokenRequestBody$inboundSchema.parse(JSON.parse(x)),
89
+ `Failed to parse 'RefreshPosAccessTokenRequestBody' from JSON`,
90
+ );
91
+ }
92
+
93
+ /** @internal */
94
+ export const RefreshPosAccessTokenContent$inboundSchema: z.ZodType<
95
+ RefreshPosAccessTokenContent,
96
+ z.ZodTypeDef,
97
+ unknown
98
+ > = z.object({
99
+ access_token: z.string().optional(),
100
+ refresh_token: z.string().optional(),
101
+ }).transform((v) => {
102
+ return remap$(v, {
103
+ "access_token": "accessToken",
104
+ "refresh_token": "refreshToken",
105
+ });
106
+ });
107
+
108
+ /** @internal */
109
+ export type RefreshPosAccessTokenContent$Outbound = {
110
+ access_token?: string | undefined;
111
+ refresh_token?: string | undefined;
112
+ };
113
+
114
+ /** @internal */
115
+ export const RefreshPosAccessTokenContent$outboundSchema: z.ZodType<
116
+ RefreshPosAccessTokenContent$Outbound,
117
+ z.ZodTypeDef,
118
+ RefreshPosAccessTokenContent
119
+ > = z.object({
120
+ accessToken: z.string().optional(),
121
+ refreshToken: z.string().optional(),
122
+ }).transform((v) => {
123
+ return remap$(v, {
124
+ accessToken: "access_token",
125
+ refreshToken: "refresh_token",
126
+ });
127
+ });
128
+
129
+ /**
130
+ * @internal
131
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
132
+ */
133
+ export namespace RefreshPosAccessTokenContent$ {
134
+ /** @deprecated use `RefreshPosAccessTokenContent$inboundSchema` instead. */
135
+ export const inboundSchema = RefreshPosAccessTokenContent$inboundSchema;
136
+ /** @deprecated use `RefreshPosAccessTokenContent$outboundSchema` instead. */
137
+ export const outboundSchema = RefreshPosAccessTokenContent$outboundSchema;
138
+ /** @deprecated use `RefreshPosAccessTokenContent$Outbound` instead. */
139
+ export type Outbound = RefreshPosAccessTokenContent$Outbound;
140
+ }
141
+
142
+ export function refreshPosAccessTokenContentToJSON(
143
+ refreshPosAccessTokenContent: RefreshPosAccessTokenContent,
144
+ ): string {
145
+ return JSON.stringify(
146
+ RefreshPosAccessTokenContent$outboundSchema.parse(
147
+ refreshPosAccessTokenContent,
148
+ ),
149
+ );
150
+ }
151
+
152
+ export function refreshPosAccessTokenContentFromJSON(
153
+ jsonString: string,
154
+ ): SafeParseResult<RefreshPosAccessTokenContent, SDKValidationError> {
155
+ return safeParse(
156
+ jsonString,
157
+ (x) => RefreshPosAccessTokenContent$inboundSchema.parse(JSON.parse(x)),
158
+ `Failed to parse 'RefreshPosAccessTokenContent' from JSON`,
159
+ );
160
+ }
161
+
162
+ /** @internal */
163
+ export const RefreshPosAccessTokenResponseBody$inboundSchema: z.ZodType<
164
+ RefreshPosAccessTokenResponseBody,
165
+ z.ZodTypeDef,
166
+ unknown
167
+ > = z.object({
168
+ message: z.string().optional(),
169
+ success: z.string().optional(),
170
+ content: z.lazy(() => RefreshPosAccessTokenContent$inboundSchema).optional(),
171
+ });
172
+
173
+ /** @internal */
174
+ export type RefreshPosAccessTokenResponseBody$Outbound = {
175
+ message?: string | undefined;
176
+ success?: string | undefined;
177
+ content?: RefreshPosAccessTokenContent$Outbound | undefined;
178
+ };
179
+
180
+ /** @internal */
181
+ export const RefreshPosAccessTokenResponseBody$outboundSchema: z.ZodType<
182
+ RefreshPosAccessTokenResponseBody$Outbound,
183
+ z.ZodTypeDef,
184
+ RefreshPosAccessTokenResponseBody
185
+ > = z.object({
186
+ message: z.string().optional(),
187
+ success: z.string().optional(),
188
+ content: z.lazy(() => RefreshPosAccessTokenContent$outboundSchema).optional(),
189
+ });
190
+
191
+ /**
192
+ * @internal
193
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
194
+ */
195
+ export namespace RefreshPosAccessTokenResponseBody$ {
196
+ /** @deprecated use `RefreshPosAccessTokenResponseBody$inboundSchema` instead. */
197
+ export const inboundSchema = RefreshPosAccessTokenResponseBody$inboundSchema;
198
+ /** @deprecated use `RefreshPosAccessTokenResponseBody$outboundSchema` instead. */
199
+ export const outboundSchema =
200
+ RefreshPosAccessTokenResponseBody$outboundSchema;
201
+ /** @deprecated use `RefreshPosAccessTokenResponseBody$Outbound` instead. */
202
+ export type Outbound = RefreshPosAccessTokenResponseBody$Outbound;
203
+ }
204
+
205
+ export function refreshPosAccessTokenResponseBodyToJSON(
206
+ refreshPosAccessTokenResponseBody: RefreshPosAccessTokenResponseBody,
207
+ ): string {
208
+ return JSON.stringify(
209
+ RefreshPosAccessTokenResponseBody$outboundSchema.parse(
210
+ refreshPosAccessTokenResponseBody,
211
+ ),
212
+ );
213
+ }
214
+
215
+ export function refreshPosAccessTokenResponseBodyFromJSON(
216
+ jsonString: string,
217
+ ): SafeParseResult<RefreshPosAccessTokenResponseBody, SDKValidationError> {
218
+ return safeParse(
219
+ jsonString,
220
+ (x) => RefreshPosAccessTokenResponseBody$inboundSchema.parse(JSON.parse(x)),
221
+ `Failed to parse 'RefreshPosAccessTokenResponseBody' from JSON`,
222
+ );
223
+ }
@@ -0,0 +1,271 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod";
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 * as components from "../components/index.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type UpdatePosCartRequestBody = {
13
+ items?: Array<components.UpdateCartItem> | undefined;
14
+ };
15
+
16
+ export type UpdatePosCartRequest = {
17
+ /**
18
+ * cart id
19
+ */
20
+ id: string;
21
+ requestBody?: UpdatePosCartRequestBody | undefined;
22
+ };
23
+
24
+ export type UpdatePosCartContent = {
25
+ /**
26
+ * This cart model is structured to capture a wide range of details, facilitating accurate representation and management of user shopping carts in an e-commerce platform.
27
+ */
28
+ cart?: components.Cart | undefined;
29
+ };
30
+
31
+ /**
32
+ * OK
33
+ */
34
+ export type UpdatePosCartResponseBody = {
35
+ message?: string | undefined;
36
+ success?: string | undefined;
37
+ content?: UpdatePosCartContent | undefined;
38
+ };
39
+
40
+ /** @internal */
41
+ export const UpdatePosCartRequestBody$inboundSchema: z.ZodType<
42
+ UpdatePosCartRequestBody,
43
+ z.ZodTypeDef,
44
+ unknown
45
+ > = z.object({
46
+ items: z.array(components.UpdateCartItem$inboundSchema).optional(),
47
+ });
48
+
49
+ /** @internal */
50
+ export type UpdatePosCartRequestBody$Outbound = {
51
+ items?: Array<components.UpdateCartItem$Outbound> | undefined;
52
+ };
53
+
54
+ /** @internal */
55
+ export const UpdatePosCartRequestBody$outboundSchema: z.ZodType<
56
+ UpdatePosCartRequestBody$Outbound,
57
+ z.ZodTypeDef,
58
+ UpdatePosCartRequestBody
59
+ > = z.object({
60
+ items: z.array(components.UpdateCartItem$outboundSchema).optional(),
61
+ });
62
+
63
+ /**
64
+ * @internal
65
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
66
+ */
67
+ export namespace UpdatePosCartRequestBody$ {
68
+ /** @deprecated use `UpdatePosCartRequestBody$inboundSchema` instead. */
69
+ export const inboundSchema = UpdatePosCartRequestBody$inboundSchema;
70
+ /** @deprecated use `UpdatePosCartRequestBody$outboundSchema` instead. */
71
+ export const outboundSchema = UpdatePosCartRequestBody$outboundSchema;
72
+ /** @deprecated use `UpdatePosCartRequestBody$Outbound` instead. */
73
+ export type Outbound = UpdatePosCartRequestBody$Outbound;
74
+ }
75
+
76
+ export function updatePosCartRequestBodyToJSON(
77
+ updatePosCartRequestBody: UpdatePosCartRequestBody,
78
+ ): string {
79
+ return JSON.stringify(
80
+ UpdatePosCartRequestBody$outboundSchema.parse(updatePosCartRequestBody),
81
+ );
82
+ }
83
+
84
+ export function updatePosCartRequestBodyFromJSON(
85
+ jsonString: string,
86
+ ): SafeParseResult<UpdatePosCartRequestBody, SDKValidationError> {
87
+ return safeParse(
88
+ jsonString,
89
+ (x) => UpdatePosCartRequestBody$inboundSchema.parse(JSON.parse(x)),
90
+ `Failed to parse 'UpdatePosCartRequestBody' from JSON`,
91
+ );
92
+ }
93
+
94
+ /** @internal */
95
+ export const UpdatePosCartRequest$inboundSchema: z.ZodType<
96
+ UpdatePosCartRequest,
97
+ z.ZodTypeDef,
98
+ unknown
99
+ > = z.object({
100
+ id: z.string(),
101
+ RequestBody: z.lazy(() => UpdatePosCartRequestBody$inboundSchema).optional(),
102
+ }).transform((v) => {
103
+ return remap$(v, {
104
+ "RequestBody": "requestBody",
105
+ });
106
+ });
107
+
108
+ /** @internal */
109
+ export type UpdatePosCartRequest$Outbound = {
110
+ id: string;
111
+ RequestBody?: UpdatePosCartRequestBody$Outbound | undefined;
112
+ };
113
+
114
+ /** @internal */
115
+ export const UpdatePosCartRequest$outboundSchema: z.ZodType<
116
+ UpdatePosCartRequest$Outbound,
117
+ z.ZodTypeDef,
118
+ UpdatePosCartRequest
119
+ > = z.object({
120
+ id: z.string(),
121
+ requestBody: z.lazy(() => UpdatePosCartRequestBody$outboundSchema).optional(),
122
+ }).transform((v) => {
123
+ return remap$(v, {
124
+ requestBody: "RequestBody",
125
+ });
126
+ });
127
+
128
+ /**
129
+ * @internal
130
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
131
+ */
132
+ export namespace UpdatePosCartRequest$ {
133
+ /** @deprecated use `UpdatePosCartRequest$inboundSchema` instead. */
134
+ export const inboundSchema = UpdatePosCartRequest$inboundSchema;
135
+ /** @deprecated use `UpdatePosCartRequest$outboundSchema` instead. */
136
+ export const outboundSchema = UpdatePosCartRequest$outboundSchema;
137
+ /** @deprecated use `UpdatePosCartRequest$Outbound` instead. */
138
+ export type Outbound = UpdatePosCartRequest$Outbound;
139
+ }
140
+
141
+ export function updatePosCartRequestToJSON(
142
+ updatePosCartRequest: UpdatePosCartRequest,
143
+ ): string {
144
+ return JSON.stringify(
145
+ UpdatePosCartRequest$outboundSchema.parse(updatePosCartRequest),
146
+ );
147
+ }
148
+
149
+ export function updatePosCartRequestFromJSON(
150
+ jsonString: string,
151
+ ): SafeParseResult<UpdatePosCartRequest, SDKValidationError> {
152
+ return safeParse(
153
+ jsonString,
154
+ (x) => UpdatePosCartRequest$inboundSchema.parse(JSON.parse(x)),
155
+ `Failed to parse 'UpdatePosCartRequest' from JSON`,
156
+ );
157
+ }
158
+
159
+ /** @internal */
160
+ export const UpdatePosCartContent$inboundSchema: z.ZodType<
161
+ UpdatePosCartContent,
162
+ z.ZodTypeDef,
163
+ unknown
164
+ > = z.object({
165
+ cart: components.Cart$inboundSchema.optional(),
166
+ });
167
+
168
+ /** @internal */
169
+ export type UpdatePosCartContent$Outbound = {
170
+ cart?: components.Cart$Outbound | undefined;
171
+ };
172
+
173
+ /** @internal */
174
+ export const UpdatePosCartContent$outboundSchema: z.ZodType<
175
+ UpdatePosCartContent$Outbound,
176
+ z.ZodTypeDef,
177
+ UpdatePosCartContent
178
+ > = z.object({
179
+ cart: components.Cart$outboundSchema.optional(),
180
+ });
181
+
182
+ /**
183
+ * @internal
184
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
185
+ */
186
+ export namespace UpdatePosCartContent$ {
187
+ /** @deprecated use `UpdatePosCartContent$inboundSchema` instead. */
188
+ export const inboundSchema = UpdatePosCartContent$inboundSchema;
189
+ /** @deprecated use `UpdatePosCartContent$outboundSchema` instead. */
190
+ export const outboundSchema = UpdatePosCartContent$outboundSchema;
191
+ /** @deprecated use `UpdatePosCartContent$Outbound` instead. */
192
+ export type Outbound = UpdatePosCartContent$Outbound;
193
+ }
194
+
195
+ export function updatePosCartContentToJSON(
196
+ updatePosCartContent: UpdatePosCartContent,
197
+ ): string {
198
+ return JSON.stringify(
199
+ UpdatePosCartContent$outboundSchema.parse(updatePosCartContent),
200
+ );
201
+ }
202
+
203
+ export function updatePosCartContentFromJSON(
204
+ jsonString: string,
205
+ ): SafeParseResult<UpdatePosCartContent, SDKValidationError> {
206
+ return safeParse(
207
+ jsonString,
208
+ (x) => UpdatePosCartContent$inboundSchema.parse(JSON.parse(x)),
209
+ `Failed to parse 'UpdatePosCartContent' from JSON`,
210
+ );
211
+ }
212
+
213
+ /** @internal */
214
+ export const UpdatePosCartResponseBody$inboundSchema: z.ZodType<
215
+ UpdatePosCartResponseBody,
216
+ z.ZodTypeDef,
217
+ unknown
218
+ > = z.object({
219
+ message: z.string().optional(),
220
+ success: z.string().optional(),
221
+ content: z.lazy(() => UpdatePosCartContent$inboundSchema).optional(),
222
+ });
223
+
224
+ /** @internal */
225
+ export type UpdatePosCartResponseBody$Outbound = {
226
+ message?: string | undefined;
227
+ success?: string | undefined;
228
+ content?: UpdatePosCartContent$Outbound | undefined;
229
+ };
230
+
231
+ /** @internal */
232
+ export const UpdatePosCartResponseBody$outboundSchema: z.ZodType<
233
+ UpdatePosCartResponseBody$Outbound,
234
+ z.ZodTypeDef,
235
+ UpdatePosCartResponseBody
236
+ > = z.object({
237
+ message: z.string().optional(),
238
+ success: z.string().optional(),
239
+ content: z.lazy(() => UpdatePosCartContent$outboundSchema).optional(),
240
+ });
241
+
242
+ /**
243
+ * @internal
244
+ * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
245
+ */
246
+ export namespace UpdatePosCartResponseBody$ {
247
+ /** @deprecated use `UpdatePosCartResponseBody$inboundSchema` instead. */
248
+ export const inboundSchema = UpdatePosCartResponseBody$inboundSchema;
249
+ /** @deprecated use `UpdatePosCartResponseBody$outboundSchema` instead. */
250
+ export const outboundSchema = UpdatePosCartResponseBody$outboundSchema;
251
+ /** @deprecated use `UpdatePosCartResponseBody$Outbound` instead. */
252
+ export type Outbound = UpdatePosCartResponseBody$Outbound;
253
+ }
254
+
255
+ export function updatePosCartResponseBodyToJSON(
256
+ updatePosCartResponseBody: UpdatePosCartResponseBody,
257
+ ): string {
258
+ return JSON.stringify(
259
+ UpdatePosCartResponseBody$outboundSchema.parse(updatePosCartResponseBody),
260
+ );
261
+ }
262
+
263
+ export function updatePosCartResponseBodyFromJSON(
264
+ jsonString: string,
265
+ ): SafeParseResult<UpdatePosCartResponseBody, SDKValidationError> {
266
+ return safeParse(
267
+ jsonString,
268
+ (x) => UpdatePosCartResponseBody$inboundSchema.parse(JSON.parse(x)),
269
+ `Failed to parse 'UpdatePosCartResponseBody' from JSON`,
270
+ );
271
+ }
package/src/sdk/pos.ts ADDED
@@ -0,0 +1,103 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import { posCreatePosCart } from "../funcs/posCreatePosCart.js";
6
+ import { posLoginToPosDevice } from "../funcs/posLoginToPosDevice.js";
7
+ import { posPairPosDevice } from "../funcs/posPairPosDevice.js";
8
+ import { posRefreshPosAccessToken } from "../funcs/posRefreshPosAccessToken.js";
9
+ import { posUpdatePosCart } from "../funcs/posUpdatePosCart.js";
10
+ import { ClientSDK, RequestOptions } from "../lib/sdks.js";
11
+ import * as operations from "../models/operations/index.js";
12
+ import { unwrapAsync } from "../types/fp.js";
13
+
14
+ export class Pos extends ClientSDK {
15
+ /**
16
+ * Pair POS device
17
+ *
18
+ * @remarks
19
+ * Pair POS device
20
+ */
21
+ async pairPosDevice(
22
+ security: operations.PairPosDeviceSecurity,
23
+ request?: operations.PairPosDeviceRequestBody | undefined,
24
+ options?: RequestOptions,
25
+ ): Promise<operations.PairPosDeviceResponseBody> {
26
+ return unwrapAsync(posPairPosDevice(
27
+ this,
28
+ security,
29
+ request,
30
+ options,
31
+ ));
32
+ }
33
+
34
+ /**
35
+ * Login to POS device
36
+ *
37
+ * @remarks
38
+ * Login to POS device
39
+ */
40
+ async loginToPosDevice(
41
+ security: operations.LoginToPosDeviceSecurity,
42
+ request?: operations.LoginToPosDeviceRequestBody | undefined,
43
+ options?: RequestOptions,
44
+ ): Promise<operations.LoginToPosDeviceResponseBody> {
45
+ return unwrapAsync(posLoginToPosDevice(
46
+ this,
47
+ security,
48
+ request,
49
+ options,
50
+ ));
51
+ }
52
+
53
+ /**
54
+ * Refresh POS access token
55
+ *
56
+ * @remarks
57
+ * Refresh POS access token
58
+ */
59
+ async refreshPosAccessToken(
60
+ request?: operations.RefreshPosAccessTokenRequestBody | undefined,
61
+ options?: RequestOptions,
62
+ ): Promise<operations.RefreshPosAccessTokenResponseBody> {
63
+ return unwrapAsync(posRefreshPosAccessToken(
64
+ this,
65
+ request,
66
+ options,
67
+ ));
68
+ }
69
+
70
+ /**
71
+ * Create cart
72
+ *
73
+ * @remarks
74
+ * Create cart from POS device
75
+ */
76
+ async createPosCart(
77
+ request?: operations.CreatePosCartRequestBody | undefined,
78
+ options?: RequestOptions,
79
+ ): Promise<operations.CreatePosCartResponseBody> {
80
+ return unwrapAsync(posCreatePosCart(
81
+ this,
82
+ request,
83
+ options,
84
+ ));
85
+ }
86
+
87
+ /**
88
+ * Add/update/delete cart item
89
+ *
90
+ * @remarks
91
+ * Add/update item to cart. To delete item from cart, pass quantity = 0
92
+ */
93
+ async updatePosCart(
94
+ request: operations.UpdatePosCartRequest,
95
+ options?: RequestOptions,
96
+ ): Promise<operations.UpdatePosCartResponseBody> {
97
+ return unwrapAsync(posUpdatePosCart(
98
+ this,
99
+ request,
100
+ options,
101
+ ));
102
+ }
103
+ }
package/src/sdk/sdk.ts CHANGED
@@ -9,6 +9,7 @@ import { Catalog } from "./catalog.js";
9
9
  import { Common } from "./common.js";
10
10
  import { Customers } from "./customers.js";
11
11
  import { Orders } from "./orders.js";
12
+ import { Pos } from "./pos.js";
12
13
  import { Shipping } from "./shipping.js";
13
14
 
14
15
  export class CeStorefront extends ClientSDK {
@@ -46,4 +47,9 @@ export class CeStorefront extends ClientSDK {
46
47
  get common(): Common {
47
48
  return (this._common ??= new Common(this._options));
48
49
  }
50
+
51
+ private _pos?: Pos;
52
+ get pos(): Pos {
53
+ return (this._pos ??= new Pos(this._options));
54
+ }
49
55
  }