@clientcasa/sdk 0.7.0 → 0.7.2

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 +7 -0
  2. package/esm/funcs/payments-list.js +1 -0
  3. package/esm/funcs/payments-list.js.map +1 -1
  4. package/esm/funcs/sales-get.d.ts +16 -0
  5. package/esm/funcs/sales-get.d.ts.map +1 -0
  6. package/esm/funcs/sales-get.js +107 -0
  7. package/esm/funcs/sales-get.js.map +1 -0
  8. package/esm/funcs/sales-list.d.ts +18 -0
  9. package/esm/funcs/sales-list.d.ts.map +1 -0
  10. package/esm/funcs/sales-list.js +141 -0
  11. package/esm/funcs/sales-list.js.map +1 -0
  12. package/esm/lib/config.d.ts +3 -3
  13. package/esm/lib/config.js +3 -3
  14. package/esm/lib/config.js.map +1 -1
  15. package/esm/models/api-error.d.ts +1 -0
  16. package/esm/models/api-error.d.ts.map +1 -1
  17. package/esm/models/api-error.js +1 -0
  18. package/esm/models/api-error.js.map +1 -1
  19. package/esm/models/index.d.ts +2 -0
  20. package/esm/models/index.d.ts.map +1 -1
  21. package/esm/models/index.js +2 -0
  22. package/esm/models/index.js.map +1 -1
  23. package/esm/models/operations/get-sale.d.ts +27 -0
  24. package/esm/models/operations/get-sale.d.ts.map +1 -0
  25. package/esm/models/operations/get-sale.js +20 -0
  26. package/esm/models/operations/get-sale.js.map +1 -0
  27. package/esm/models/operations/index.d.ts +2 -0
  28. package/esm/models/operations/index.d.ts.map +1 -1
  29. package/esm/models/operations/index.js +2 -0
  30. package/esm/models/operations/index.js.map +1 -1
  31. package/esm/models/operations/list-payments.d.ts +5 -0
  32. package/esm/models/operations/list-payments.d.ts.map +1 -1
  33. package/esm/models/operations/list-payments.js +1 -0
  34. package/esm/models/operations/list-payments.js.map +1 -1
  35. package/esm/models/operations/list-sales.d.ts +75 -0
  36. package/esm/models/operations/list-sales.d.ts.map +1 -0
  37. package/esm/models/operations/list-sales.js +60 -0
  38. package/esm/models/operations/list-sales.js.map +1 -0
  39. package/esm/models/operations/list-webhooks.d.ts +15 -2
  40. package/esm/models/operations/list-webhooks.d.ts.map +1 -1
  41. package/esm/models/operations/list-webhooks.js +15 -2
  42. package/esm/models/operations/list-webhooks.js.map +1 -1
  43. package/esm/models/payment.d.ts +4 -0
  44. package/esm/models/payment.d.ts.map +1 -1
  45. package/esm/models/payment.js +1 -0
  46. package/esm/models/payment.js.map +1 -1
  47. package/esm/models/sale-list.d.ts +13 -0
  48. package/esm/models/sale-list.d.ts.map +1 -0
  49. package/esm/models/sale-list.js +17 -0
  50. package/esm/models/sale-list.js.map +1 -0
  51. package/esm/models/sale.d.ts +76 -0
  52. package/esm/models/sale.d.ts.map +1 -0
  53. package/esm/models/sale.js +58 -0
  54. package/esm/models/sale.js.map +1 -0
  55. package/esm/models/webhook-create.d.ts +15 -2
  56. package/esm/models/webhook-create.d.ts.map +1 -1
  57. package/esm/models/webhook-create.js +15 -2
  58. package/esm/models/webhook-create.js.map +1 -1
  59. package/esm/models/webhook-update.d.ts +15 -2
  60. package/esm/models/webhook-update.d.ts.map +1 -1
  61. package/esm/models/webhook-update.js +15 -2
  62. package/esm/models/webhook-update.js.map +1 -1
  63. package/esm/models/webhook.d.ts +15 -2
  64. package/esm/models/webhook.d.ts.map +1 -1
  65. package/esm/models/webhook.js +15 -2
  66. package/esm/models/webhook.js.map +1 -1
  67. package/esm/sdk/sales.d.ts +17 -0
  68. package/esm/sdk/sales.d.ts.map +1 -0
  69. package/esm/sdk/sales.js +23 -0
  70. package/esm/sdk/sales.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 +5 -0
  74. package/esm/sdk/sdk.js.map +1 -1
  75. package/jsr.json +1 -1
  76. package/package.json +1 -1
  77. package/src/funcs/payments-list.ts +1 -0
  78. package/src/funcs/sales-get.ts +202 -0
  79. package/src/funcs/sales-list.ts +277 -0
  80. package/src/lib/config.ts +3 -3
  81. package/src/models/api-error.ts +1 -0
  82. package/src/models/index.ts +2 -0
  83. package/src/models/operations/get-sale.ts +55 -0
  84. package/src/models/operations/index.ts +2 -0
  85. package/src/models/operations/list-payments.ts +6 -0
  86. package/src/models/operations/list-sales.ts +159 -0
  87. package/src/models/operations/list-webhooks.ts +15 -2
  88. package/src/models/payment.ts +5 -0
  89. package/src/models/sale-list.ts +35 -0
  90. package/src/models/sale.ts +124 -0
  91. package/src/models/webhook-create.ts +15 -2
  92. package/src/models/webhook-update.ts +15 -2
  93. package/src/models/webhook.ts +15 -2
  94. package/src/sdk/sales.ts +45 -0
  95. package/src/sdk/sdk.ts +6 -0
@@ -0,0 +1,202 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { ClientCasaCore } from "../core.js";
7
+ import { encodeSimple } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { resolveSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import { ClientCasaError } from "../models/errors/client-casa-error.js";
16
+ import {
17
+ ConnectionError,
18
+ InvalidRequestError,
19
+ RequestAbortedError,
20
+ RequestTimeoutError,
21
+ UnexpectedClientError,
22
+ } from "../models/errors/http-client-errors.js";
23
+ import * as errors from "../models/errors/index.js";
24
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
25
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
26
+ import * as models from "../models/index.js";
27
+ import * as operations from "../models/operations/index.js";
28
+ import { APICall, APIPromise } from "../types/async.js";
29
+ import { Result } from "../types/fp.js";
30
+
31
+ /**
32
+ * Get a sale
33
+ */
34
+ export function salesGet(
35
+ client: ClientCasaCore,
36
+ security: operations.GetSaleSecurity,
37
+ request: operations.GetSaleRequest,
38
+ options?: RequestOptions,
39
+ ): APIPromise<
40
+ Result<
41
+ models.Sale,
42
+ | errors.ApiError
43
+ | ClientCasaError
44
+ | ResponseValidationError
45
+ | ConnectionError
46
+ | RequestAbortedError
47
+ | RequestTimeoutError
48
+ | InvalidRequestError
49
+ | UnexpectedClientError
50
+ | SDKValidationError
51
+ >
52
+ > {
53
+ return new APIPromise($do(
54
+ client,
55
+ security,
56
+ request,
57
+ options,
58
+ ));
59
+ }
60
+
61
+ async function $do(
62
+ client: ClientCasaCore,
63
+ security: operations.GetSaleSecurity,
64
+ request: operations.GetSaleRequest,
65
+ options?: RequestOptions,
66
+ ): Promise<
67
+ [
68
+ Result<
69
+ models.Sale,
70
+ | errors.ApiError
71
+ | ClientCasaError
72
+ | ResponseValidationError
73
+ | ConnectionError
74
+ | RequestAbortedError
75
+ | RequestTimeoutError
76
+ | InvalidRequestError
77
+ | UnexpectedClientError
78
+ | SDKValidationError
79
+ >,
80
+ APICall,
81
+ ]
82
+ > {
83
+ const parsed = safeParse(
84
+ request,
85
+ (value) => z.parse(operations.GetSaleRequest$outboundSchema, value),
86
+ "Input validation failed",
87
+ );
88
+ if (!parsed.ok) {
89
+ return [parsed, { status: "invalid" }];
90
+ }
91
+ const payload = parsed.value;
92
+ const body = null;
93
+
94
+ const pathParams = {
95
+ id: encodeSimple("id", payload.id, {
96
+ explode: false,
97
+ charEncoding: "percent",
98
+ }),
99
+ };
100
+ const path = pathToFunc("/api/v1/sales/{id}")(pathParams);
101
+
102
+ const headers = new Headers(compactMap({
103
+ Accept: "application/json",
104
+ }));
105
+
106
+ const requestSecurity = resolveSecurity(
107
+ [
108
+ {
109
+ fieldName: "x-api-key",
110
+ type: "apiKey:header",
111
+ value: security?.apiKey,
112
+ },
113
+ ],
114
+ [
115
+ {
116
+ fieldName: "Authorization",
117
+ type: "http:bearer",
118
+ value: security?.bearer,
119
+ },
120
+ ],
121
+ );
122
+
123
+ const context = {
124
+ options: client._options,
125
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
126
+ operationID: "getSale",
127
+ oAuth2Scopes: null,
128
+
129
+ resolvedSecurity: requestSecurity,
130
+
131
+ securitySource: security,
132
+ retryConfig: options?.retries
133
+ || client._options.retryConfig
134
+ || {
135
+ strategy: "backoff",
136
+ backoff: {
137
+ initialInterval: 500,
138
+ maxInterval: 30000,
139
+ exponent: 1.5,
140
+ maxElapsedTime: 30000,
141
+ },
142
+ retryConnectionErrors: true,
143
+ }
144
+ || { strategy: "none" },
145
+ retryCodes: options?.retryCodes || ["429", "5XX"],
146
+ };
147
+
148
+ const requestRes = client._createRequest(context, {
149
+ security: requestSecurity,
150
+ method: "GET",
151
+ baseURL: options?.serverURL,
152
+ path: path,
153
+ headers: headers,
154
+ body: body,
155
+ userAgent: client._options.userAgent,
156
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
157
+ }, options);
158
+ if (!requestRes.ok) {
159
+ return [requestRes, { status: "invalid" }];
160
+ }
161
+ const req = requestRes.value;
162
+
163
+ const doResult = await client._do(req, {
164
+ context,
165
+ isErrorStatusCode: (statusCode: number) =>
166
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
167
+ retryConfig: context.retryConfig,
168
+ retryCodes: context.retryCodes,
169
+ });
170
+ if (!doResult.ok) {
171
+ return [doResult, { status: "request-error", request: req }];
172
+ }
173
+ const response = doResult.value;
174
+
175
+ const responseFields = {
176
+ HttpMeta: { Response: response, Request: req },
177
+ };
178
+
179
+ const [result] = await M.match<
180
+ models.Sale,
181
+ | errors.ApiError
182
+ | ClientCasaError
183
+ | ResponseValidationError
184
+ | ConnectionError
185
+ | RequestAbortedError
186
+ | RequestTimeoutError
187
+ | InvalidRequestError
188
+ | UnexpectedClientError
189
+ | SDKValidationError
190
+ >(
191
+ M.json(200, models.Sale$inboundSchema),
192
+ M.jsonErr([401, 403, 404, 429], errors.ApiError$inboundSchema),
193
+ M.jsonErr(500, errors.ApiError$inboundSchema),
194
+ M.fail("4XX"),
195
+ M.fail("5XX"),
196
+ )(response, req, { extraFields: responseFields });
197
+ if (!result.ok) {
198
+ return [result, { status: "complete", request: req, response }];
199
+ }
200
+
201
+ return [result, { status: "complete", request: req, response }];
202
+ }
@@ -0,0 +1,277 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+ import { ClientCasaCore } from "../core.js";
7
+ import { encodeFormQuery } from "../lib/encodings.js";
8
+ import { matchStatusCode } from "../lib/http.js";
9
+ import * as M from "../lib/matchers.js";
10
+ import { compactMap } from "../lib/primitives.js";
11
+ import { safeParse } from "../lib/schemas.js";
12
+ import { RequestOptions } from "../lib/sdks.js";
13
+ import { resolveSecurity } from "../lib/security.js";
14
+ import { pathToFunc } from "../lib/url.js";
15
+ import { ClientCasaError } from "../models/errors/client-casa-error.js";
16
+ import {
17
+ ConnectionError,
18
+ InvalidRequestError,
19
+ RequestAbortedError,
20
+ RequestTimeoutError,
21
+ UnexpectedClientError,
22
+ } from "../models/errors/http-client-errors.js";
23
+ import * as errors from "../models/errors/index.js";
24
+ import { ResponseValidationError } from "../models/errors/response-validation-error.js";
25
+ import { SDKValidationError } from "../models/errors/sdk-validation-error.js";
26
+ import * as operations from "../models/operations/index.js";
27
+ import { APICall, APIPromise } from "../types/async.js";
28
+ import { Result } from "../types/fp.js";
29
+ import {
30
+ createPageIterator,
31
+ haltIterator,
32
+ PageIterator,
33
+ Paginator,
34
+ } from "../types/operations.js";
35
+
36
+ /**
37
+ * List sales
38
+ */
39
+ export function salesList(
40
+ client: ClientCasaCore,
41
+ security: operations.ListSalesSecurity,
42
+ request?: operations.ListSalesRequest | undefined,
43
+ options?: RequestOptions,
44
+ ): APIPromise<
45
+ PageIterator<
46
+ Result<
47
+ operations.ListSalesResponse,
48
+ | errors.ApiError
49
+ | ClientCasaError
50
+ | ResponseValidationError
51
+ | ConnectionError
52
+ | RequestAbortedError
53
+ | RequestTimeoutError
54
+ | InvalidRequestError
55
+ | UnexpectedClientError
56
+ | SDKValidationError
57
+ >,
58
+ { page: number }
59
+ >
60
+ > {
61
+ return new APIPromise($do(
62
+ client,
63
+ security,
64
+ request,
65
+ options,
66
+ ));
67
+ }
68
+
69
+ async function $do(
70
+ client: ClientCasaCore,
71
+ security: operations.ListSalesSecurity,
72
+ request?: operations.ListSalesRequest | undefined,
73
+ options?: RequestOptions,
74
+ ): Promise<
75
+ [
76
+ PageIterator<
77
+ Result<
78
+ operations.ListSalesResponse,
79
+ | errors.ApiError
80
+ | ClientCasaError
81
+ | ResponseValidationError
82
+ | ConnectionError
83
+ | RequestAbortedError
84
+ | RequestTimeoutError
85
+ | InvalidRequestError
86
+ | UnexpectedClientError
87
+ | SDKValidationError
88
+ >,
89
+ { page: number }
90
+ >,
91
+ APICall,
92
+ ]
93
+ > {
94
+ const parsed = safeParse(
95
+ request,
96
+ (value) =>
97
+ z.parse(z.optional(operations.ListSalesRequest$outboundSchema), value),
98
+ "Input validation failed",
99
+ );
100
+ if (!parsed.ok) {
101
+ return [haltIterator(parsed), { status: "invalid" }];
102
+ }
103
+ const payload = parsed.value;
104
+ const body = null;
105
+
106
+ const path = pathToFunc("/api/v1/sales")();
107
+
108
+ const query = encodeFormQuery({
109
+ "businessId": payload?.businessId,
110
+ "channel": payload?.channel,
111
+ "clientId": payload?.clientId,
112
+ "page": payload?.page,
113
+ "pageSize": payload?.pageSize,
114
+ "saleDateFrom": payload?.saleDateFrom,
115
+ "saleDateTo": payload?.saleDateTo,
116
+ "status": payload?.status,
117
+ });
118
+
119
+ const headers = new Headers(compactMap({
120
+ Accept: "application/json",
121
+ }));
122
+
123
+ const requestSecurity = resolveSecurity(
124
+ [
125
+ {
126
+ fieldName: "x-api-key",
127
+ type: "apiKey:header",
128
+ value: security?.apiKey,
129
+ },
130
+ ],
131
+ [
132
+ {
133
+ fieldName: "Authorization",
134
+ type: "http:bearer",
135
+ value: security?.bearer,
136
+ },
137
+ ],
138
+ );
139
+
140
+ const context = {
141
+ options: client._options,
142
+ baseURL: options?.serverURL ?? client._baseURL ?? "",
143
+ operationID: "listSales",
144
+ oAuth2Scopes: null,
145
+
146
+ resolvedSecurity: requestSecurity,
147
+
148
+ securitySource: security,
149
+ retryConfig: options?.retries
150
+ || client._options.retryConfig
151
+ || {
152
+ strategy: "backoff",
153
+ backoff: {
154
+ initialInterval: 500,
155
+ maxInterval: 30000,
156
+ exponent: 1.5,
157
+ maxElapsedTime: 30000,
158
+ },
159
+ retryConnectionErrors: true,
160
+ }
161
+ || { strategy: "none" },
162
+ retryCodes: options?.retryCodes || ["429", "5XX"],
163
+ };
164
+
165
+ const requestRes = client._createRequest(context, {
166
+ security: requestSecurity,
167
+ method: "GET",
168
+ baseURL: options?.serverURL,
169
+ path: path,
170
+ headers: headers,
171
+ query: query,
172
+ body: body,
173
+ userAgent: client._options.userAgent,
174
+ timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
175
+ }, options);
176
+ if (!requestRes.ok) {
177
+ return [haltIterator(requestRes), { status: "invalid" }];
178
+ }
179
+ const req = requestRes.value;
180
+
181
+ const doResult = await client._do(req, {
182
+ context,
183
+ isErrorStatusCode: (statusCode: number) =>
184
+ matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
185
+ retryConfig: context.retryConfig,
186
+ retryCodes: context.retryCodes,
187
+ });
188
+ if (!doResult.ok) {
189
+ return [haltIterator(doResult), { status: "request-error", request: req }];
190
+ }
191
+ const response = doResult.value;
192
+
193
+ const responseFields = {
194
+ HttpMeta: { Response: response, Request: req },
195
+ };
196
+
197
+ const [result, raw] = await M.match<
198
+ operations.ListSalesResponse,
199
+ | errors.ApiError
200
+ | ClientCasaError
201
+ | ResponseValidationError
202
+ | ConnectionError
203
+ | RequestAbortedError
204
+ | RequestTimeoutError
205
+ | InvalidRequestError
206
+ | UnexpectedClientError
207
+ | SDKValidationError
208
+ >(
209
+ M.json(200, operations.ListSalesResponse$inboundSchema, { key: "Result" }),
210
+ M.jsonErr([400, 401, 403, 429], errors.ApiError$inboundSchema),
211
+ M.jsonErr(500, errors.ApiError$inboundSchema),
212
+ M.fail("4XX"),
213
+ M.fail("5XX"),
214
+ )(response, req, { extraFields: responseFields });
215
+ if (!result.ok) {
216
+ return [haltIterator(result), {
217
+ status: "complete",
218
+ request: req,
219
+ response,
220
+ }];
221
+ }
222
+
223
+ const nextFunc = (
224
+ responseData: unknown,
225
+ ): {
226
+ next: Paginator<
227
+ Result<
228
+ operations.ListSalesResponse,
229
+ | errors.ApiError
230
+ | ClientCasaError
231
+ | ResponseValidationError
232
+ | ConnectionError
233
+ | RequestAbortedError
234
+ | RequestTimeoutError
235
+ | InvalidRequestError
236
+ | UnexpectedClientError
237
+ | SDKValidationError
238
+ >
239
+ >;
240
+ "~next"?: { page: number };
241
+ } => {
242
+ const page = request?.page ?? 1;
243
+ const nextPage = page + 1;
244
+
245
+ if (!responseData) {
246
+ return { next: () => null };
247
+ }
248
+ const results = (responseData as { data: unknown }).data;
249
+ if (!Array.isArray(results) || !results.length) {
250
+ return { next: () => null };
251
+ }
252
+ const limit = request?.pageSize ?? 25;
253
+ if (results.length < limit) {
254
+ return { next: () => null };
255
+ }
256
+
257
+ const nextVal = () =>
258
+ salesList(
259
+ client,
260
+ security,
261
+ {
262
+ ...request!,
263
+ page: nextPage,
264
+ },
265
+ options,
266
+ );
267
+
268
+ return { next: nextVal, "~next": { page: nextPage } };
269
+ };
270
+
271
+ const page = { ...result, ...nextFunc(raw) };
272
+ return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
273
+ status: "complete",
274
+ request: req,
275
+ response,
276
+ }];
277
+ }
package/src/lib/config.ts CHANGED
@@ -61,7 +61,7 @@ export function serverURLFromOptions(options: SDKOptions): URL | null {
61
61
  export const SDK_METADATA = {
62
62
  language: "typescript",
63
63
  openapiDocVersion: "1.0.0",
64
- sdkVersion: "0.7.0",
65
- genVersion: "2.932.15",
66
- userAgent: "speakeasy-sdk/typescript 0.7.0 2.932.15 1.0.0 @clientcasa/sdk",
64
+ sdkVersion: "0.7.2",
65
+ genVersion: "2.933.0",
66
+ userAgent: "speakeasy-sdk/typescript 0.7.2 2.933.0 1.0.0 @clientcasa/sdk",
67
67
  } as const;
@@ -36,6 +36,7 @@ export const DetailsCode = {
36
36
  CrossOrganization: "cross_organization",
37
37
  RateLimited: "rate_limited",
38
38
  RevenueOnInternalProject: "revenue_on_internal_project",
39
+ NumberSeriesUnlocked: "number_series_unlocked",
39
40
  } as const;
40
41
  export type DetailsCode = OpenEnum<typeof DetailsCode>;
41
42
 
@@ -64,6 +64,8 @@ export * from "./project-create.js";
64
64
  export * from "./project-list.js";
65
65
  export * from "./project-update.js";
66
66
  export * from "./project.js";
67
+ export * from "./sale-list.js";
68
+ export * from "./sale.js";
67
69
  export * from "./security.js";
68
70
  export * from "./time-entry-create.js";
69
71
  export * from "./time-entry-list.js";
@@ -0,0 +1,55 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v4-mini";
6
+
7
+ export type GetSaleSecurity = {
8
+ apiKey?: string | undefined;
9
+ bearer?: string | undefined;
10
+ };
11
+
12
+ export type GetSaleRequest = {
13
+ /**
14
+ * UUID v4
15
+ */
16
+ id: string;
17
+ };
18
+
19
+ /** @internal */
20
+ export type GetSaleSecurity$Outbound = {
21
+ apiKey?: string | undefined;
22
+ bearer?: string | undefined;
23
+ };
24
+
25
+ /** @internal */
26
+ export const GetSaleSecurity$outboundSchema: z.ZodMiniType<
27
+ GetSaleSecurity$Outbound,
28
+ GetSaleSecurity
29
+ > = z.object({
30
+ apiKey: z.optional(z.string()),
31
+ bearer: z.optional(z.string()),
32
+ });
33
+
34
+ export function getSaleSecurityToJSON(
35
+ getSaleSecurity: GetSaleSecurity,
36
+ ): string {
37
+ return JSON.stringify(GetSaleSecurity$outboundSchema.parse(getSaleSecurity));
38
+ }
39
+
40
+ /** @internal */
41
+ export type GetSaleRequest$Outbound = {
42
+ id: string;
43
+ };
44
+
45
+ /** @internal */
46
+ export const GetSaleRequest$outboundSchema: z.ZodMiniType<
47
+ GetSaleRequest$Outbound,
48
+ GetSaleRequest
49
+ > = z.object({
50
+ id: z.string(),
51
+ });
52
+
53
+ export function getSaleRequestToJSON(getSaleRequest: GetSaleRequest): string {
54
+ return JSON.stringify(GetSaleRequest$outboundSchema.parse(getSaleRequest));
55
+ }
@@ -52,6 +52,7 @@ export * from "./get-milestone.js";
52
52
  export * from "./get-payment.js";
53
53
  export * from "./get-payout.js";
54
54
  export * from "./get-project.js";
55
+ export * from "./get-sale.js";
55
56
  export * from "./get-time-entry.js";
56
57
  export * from "./get-timeline-item.js";
57
58
  export * from "./get-transaction.js";
@@ -74,6 +75,7 @@ export * from "./list-milestones.js";
74
75
  export * from "./list-payments.js";
75
76
  export * from "./list-payouts.js";
76
77
  export * from "./list-projects.js";
78
+ export * from "./list-sales.js";
77
79
  export * from "./list-time-entries.js";
78
80
  export * from "./list-timeline-items.js";
79
81
  export * from "./list-transactions.js";
@@ -43,6 +43,10 @@ export type ListPaymentsRequest = {
43
43
  * UUID v4
44
44
  */
45
45
  invoiceId?: string | undefined;
46
+ /**
47
+ * UUID v4
48
+ */
49
+ saleId?: string | undefined;
46
50
  status?: ListPaymentsStatus | undefined;
47
51
  kind?: ListPaymentsKind | undefined;
48
52
  };
@@ -90,6 +94,7 @@ export type ListPaymentsRequest$Outbound = {
90
94
  pageSize: number;
91
95
  clientId?: string | undefined;
92
96
  invoiceId?: string | undefined;
97
+ saleId?: string | undefined;
93
98
  status?: string | undefined;
94
99
  kind?: string | undefined;
95
100
  };
@@ -103,6 +108,7 @@ export const ListPaymentsRequest$outboundSchema: z.ZodMiniType<
103
108
  pageSize: z._default(z.int(), 25),
104
109
  clientId: z.optional(z.string()),
105
110
  invoiceId: z.optional(z.string()),
111
+ saleId: z.optional(z.string()),
106
112
  status: z.optional(ListPaymentsStatus$outboundSchema),
107
113
  kind: z.optional(ListPaymentsKind$outboundSchema),
108
114
  });