@clientcasa/sdk 0.6.5 → 0.7.1

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 (182) 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/funcs/transactions-create.d.ts +3 -0
  13. package/esm/funcs/transactions-create.d.ts.map +1 -1
  14. package/esm/funcs/transactions-create.js +3 -0
  15. package/esm/funcs/transactions-create.js.map +1 -1
  16. package/esm/funcs/transactions-update.d.ts +1 -1
  17. package/esm/funcs/transactions-update.js +1 -1
  18. package/esm/lib/config.d.ts +3 -3
  19. package/esm/lib/config.js +3 -3
  20. package/esm/lib/encodings.d.ts +10 -9
  21. package/esm/lib/encodings.d.ts.map +1 -1
  22. package/esm/lib/encodings.js +29 -13
  23. package/esm/lib/encodings.js.map +1 -1
  24. package/esm/models/api-error.d.ts +25 -3
  25. package/esm/models/api-error.d.ts.map +1 -1
  26. package/esm/models/api-error.js +25 -1
  27. package/esm/models/api-error.js.map +1 -1
  28. package/esm/models/catalog-item-create.d.ts +5 -0
  29. package/esm/models/catalog-item-create.d.ts.map +1 -1
  30. package/esm/models/catalog-item-create.js +1 -0
  31. package/esm/models/catalog-item-create.js.map +1 -1
  32. package/esm/models/catalog-item-update.d.ts +4 -4
  33. package/esm/models/catalog-item-update.d.ts.map +1 -1
  34. package/esm/models/catalog-item-update.js +4 -4
  35. package/esm/models/catalog-item-update.js.map +1 -1
  36. package/esm/models/catalog-item.d.ts +4 -0
  37. package/esm/models/catalog-item.d.ts.map +1 -1
  38. package/esm/models/catalog-item.js +1 -0
  39. package/esm/models/catalog-item.js.map +1 -1
  40. package/esm/models/client-create.d.ts +5 -0
  41. package/esm/models/client-create.d.ts.map +1 -1
  42. package/esm/models/client-create.js +1 -0
  43. package/esm/models/client-create.js.map +1 -1
  44. package/esm/models/client-update.d.ts +1 -1
  45. package/esm/models/client-update.d.ts.map +1 -1
  46. package/esm/models/client-update.js +1 -1
  47. package/esm/models/client-update.js.map +1 -1
  48. package/esm/models/client.d.ts +4 -0
  49. package/esm/models/client.d.ts.map +1 -1
  50. package/esm/models/client.js +1 -0
  51. package/esm/models/client.js.map +1 -1
  52. package/esm/models/contact-update.d.ts +2 -2
  53. package/esm/models/contact-update.d.ts.map +1 -1
  54. package/esm/models/contact-update.js +2 -2
  55. package/esm/models/contact-update.js.map +1 -1
  56. package/esm/models/index.d.ts +2 -0
  57. package/esm/models/index.d.ts.map +1 -1
  58. package/esm/models/index.js +2 -0
  59. package/esm/models/index.js.map +1 -1
  60. package/esm/models/operations/get-sale.d.ts +27 -0
  61. package/esm/models/operations/get-sale.d.ts.map +1 -0
  62. package/esm/models/operations/get-sale.js +20 -0
  63. package/esm/models/operations/get-sale.js.map +1 -0
  64. package/esm/models/operations/index.d.ts +2 -0
  65. package/esm/models/operations/index.d.ts.map +1 -1
  66. package/esm/models/operations/index.js +2 -0
  67. package/esm/models/operations/index.js.map +1 -1
  68. package/esm/models/operations/list-payments.d.ts +5 -0
  69. package/esm/models/operations/list-payments.d.ts.map +1 -1
  70. package/esm/models/operations/list-payments.js +1 -0
  71. package/esm/models/operations/list-payments.js.map +1 -1
  72. package/esm/models/operations/list-sales.d.ts +75 -0
  73. package/esm/models/operations/list-sales.d.ts.map +1 -0
  74. package/esm/models/operations/list-sales.js +60 -0
  75. package/esm/models/operations/list-sales.js.map +1 -0
  76. package/esm/models/operations/list-webhooks.d.ts +15 -2
  77. package/esm/models/operations/list-webhooks.d.ts.map +1 -1
  78. package/esm/models/operations/list-webhooks.js +15 -2
  79. package/esm/models/operations/list-webhooks.js.map +1 -1
  80. package/esm/models/payment.d.ts +5 -1
  81. package/esm/models/payment.d.ts.map +1 -1
  82. package/esm/models/payment.js +2 -1
  83. package/esm/models/payment.js.map +1 -1
  84. package/esm/models/project-update.d.ts +1 -1
  85. package/esm/models/project-update.d.ts.map +1 -1
  86. package/esm/models/project-update.js +1 -1
  87. package/esm/models/project-update.js.map +1 -1
  88. package/esm/models/project.d.ts +5 -1
  89. package/esm/models/project.d.ts.map +1 -1
  90. package/esm/models/project.js +2 -1
  91. package/esm/models/project.js.map +1 -1
  92. package/esm/models/sale-list.d.ts +13 -0
  93. package/esm/models/sale-list.d.ts.map +1 -0
  94. package/esm/models/sale-list.js +17 -0
  95. package/esm/models/sale-list.js.map +1 -0
  96. package/esm/models/sale.d.ts +76 -0
  97. package/esm/models/sale.d.ts.map +1 -0
  98. package/esm/models/sale.js +58 -0
  99. package/esm/models/sale.js.map +1 -0
  100. package/esm/models/time-entry-update.d.ts +2 -2
  101. package/esm/models/time-entry-update.d.ts.map +1 -1
  102. package/esm/models/time-entry-update.js +2 -2
  103. package/esm/models/time-entry-update.js.map +1 -1
  104. package/esm/models/time-entry.d.ts +3 -3
  105. package/esm/models/time-entry.d.ts.map +1 -1
  106. package/esm/models/time-entry.js +3 -3
  107. package/esm/models/time-entry.js.map +1 -1
  108. package/esm/models/transaction-create.d.ts +5 -0
  109. package/esm/models/transaction-create.d.ts.map +1 -1
  110. package/esm/models/transaction-create.js +1 -0
  111. package/esm/models/transaction-create.js.map +1 -1
  112. package/esm/models/transaction-update.d.ts +3 -3
  113. package/esm/models/transaction-update.d.ts.map +1 -1
  114. package/esm/models/transaction-update.js +3 -3
  115. package/esm/models/transaction-update.js.map +1 -1
  116. package/esm/models/transaction.d.ts +4 -0
  117. package/esm/models/transaction.d.ts.map +1 -1
  118. package/esm/models/transaction.js +1 -0
  119. package/esm/models/transaction.js.map +1 -1
  120. package/esm/models/webhook-create.d.ts +15 -2
  121. package/esm/models/webhook-create.d.ts.map +1 -1
  122. package/esm/models/webhook-create.js +15 -2
  123. package/esm/models/webhook-create.js.map +1 -1
  124. package/esm/models/webhook-update.d.ts +15 -2
  125. package/esm/models/webhook-update.d.ts.map +1 -1
  126. package/esm/models/webhook-update.js +15 -2
  127. package/esm/models/webhook-update.js.map +1 -1
  128. package/esm/models/webhook.d.ts +15 -2
  129. package/esm/models/webhook.d.ts.map +1 -1
  130. package/esm/models/webhook.js +15 -2
  131. package/esm/models/webhook.js.map +1 -1
  132. package/esm/sdk/sales.d.ts +17 -0
  133. package/esm/sdk/sales.d.ts.map +1 -0
  134. package/esm/sdk/sales.js +23 -0
  135. package/esm/sdk/sales.js.map +1 -0
  136. package/esm/sdk/sdk.d.ts +3 -0
  137. package/esm/sdk/sdk.d.ts.map +1 -1
  138. package/esm/sdk/sdk.js +5 -0
  139. package/esm/sdk/sdk.js.map +1 -1
  140. package/esm/sdk/transactions.d.ts +4 -1
  141. package/esm/sdk/transactions.d.ts.map +1 -1
  142. package/esm/sdk/transactions.js +4 -1
  143. package/esm/sdk/transactions.js.map +1 -1
  144. package/jsr.json +1 -1
  145. package/package.json +2 -2
  146. package/src/funcs/payments-list.ts +1 -0
  147. package/src/funcs/sales-get.ts +202 -0
  148. package/src/funcs/sales-list.ts +277 -0
  149. package/src/funcs/transactions-create.ts +3 -0
  150. package/src/funcs/transactions-update.ts +1 -1
  151. package/src/lib/config.ts +3 -3
  152. package/src/lib/encodings.ts +58 -23
  153. package/src/models/api-error.ts +46 -2
  154. package/src/models/catalog-item-create.ts +6 -0
  155. package/src/models/catalog-item-update.ts +8 -9
  156. package/src/models/catalog-item.ts +5 -0
  157. package/src/models/client-create.ts +6 -0
  158. package/src/models/client-update.ts +2 -2
  159. package/src/models/client.ts +5 -0
  160. package/src/models/contact-update.ts +4 -4
  161. package/src/models/index.ts +2 -0
  162. package/src/models/operations/get-sale.ts +55 -0
  163. package/src/models/operations/index.ts +2 -0
  164. package/src/models/operations/list-payments.ts +6 -0
  165. package/src/models/operations/list-sales.ts +159 -0
  166. package/src/models/operations/list-webhooks.ts +15 -2
  167. package/src/models/payment.ts +7 -2
  168. package/src/models/project-update.ts +2 -2
  169. package/src/models/project.ts +7 -2
  170. package/src/models/sale-list.ts +35 -0
  171. package/src/models/sale.ts +124 -0
  172. package/src/models/time-entry-update.ts +4 -4
  173. package/src/models/time-entry.ts +6 -6
  174. package/src/models/transaction-create.ts +6 -0
  175. package/src/models/transaction-update.ts +6 -6
  176. package/src/models/transaction.ts +5 -0
  177. package/src/models/webhook-create.ts +15 -2
  178. package/src/models/webhook-update.ts +15 -2
  179. package/src/models/webhook.ts +15 -2
  180. package/src/sdk/sales.ts +45 -0
  181. package/src/sdk/sdk.ts +6 -0
  182. package/src/sdk/transactions.ts +4 -1
@@ -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
+ }
@@ -30,6 +30,9 @@ import { Result } from "../types/fp.js";
30
30
 
31
31
  /**
32
32
  * Create a transaction (expense or charge)
33
+ *
34
+ * @remarks
35
+ * A `global` transaction applies org-wide (all clients for revenue, overhead for cost), so it cannot carry `assignments` — send an empty array, or use mode `each`/`split` to scope it. This constraint is enforced by the server but cannot be expressed in JSON Schema, so generated SDKs will surface it as a 400 rather than a compile error.
33
36
  */
34
37
  export function transactionsCreate(
35
38
  client: ClientCasaCore,
@@ -32,7 +32,7 @@ import { Result } from "../types/fp.js";
32
32
  * Update a transaction
33
33
  *
34
34
  * @remarks
35
- * Transactions billed to a sent/paid invoice may be frozen — the server will return 409 if so.
35
+ * Transactions billed to a sent/paid invoice may be frozen — the server will return 409 if so. A `global` transaction applies org-wide (all clients for revenue, overhead for cost), so it cannot carry `assignments` — send an empty array, or use mode `each`/`split` to scope it. This constraint is enforced by the server but cannot be expressed in JSON Schema, so generated SDKs will surface it as a 400 rather than a compile error.
36
36
  */
37
37
  export function transactionsUpdate(
38
38
  client: ClientCasaCore,
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.6.5",
65
- genVersion: "2.918.4",
66
- userAgent: "speakeasy-sdk/typescript 0.6.5 2.918.4 1.0.0 @clientcasa/sdk",
64
+ sdkVersion: "0.7.1",
65
+ genVersion: "2.933.0",
66
+ userAgent: "speakeasy-sdk/typescript 0.7.1 2.933.0 1.0.0 @clientcasa/sdk",
67
67
  } as const;