@clientcasa/sdk 0.6.2 → 0.6.4
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 +13 -0
- package/esm/funcs/venues-create.d.ts +16 -0
- package/esm/funcs/venues-create.d.ts.map +1 -0
- package/esm/funcs/venues-create.js +93 -0
- package/esm/funcs/venues-create.js.map +1 -0
- package/esm/funcs/venues-delete.d.ts +15 -0
- package/esm/funcs/venues-delete.d.ts.map +1 -0
- package/esm/funcs/venues-delete.js +106 -0
- package/esm/funcs/venues-delete.js.map +1 -0
- package/esm/funcs/venues-get.d.ts +16 -0
- package/esm/funcs/venues-get.d.ts.map +1 -0
- package/esm/funcs/venues-get.js +107 -0
- package/esm/funcs/venues-get.js.map +1 -0
- package/esm/funcs/venues-list.d.ts +18 -0
- package/esm/funcs/venues-list.d.ts.map +1 -0
- package/esm/funcs/venues-list.js +136 -0
- package/esm/funcs/venues-list.js.map +1 -0
- package/esm/funcs/venues-update.d.ts +16 -0
- package/esm/funcs/venues-update.d.ts.map +1 -0
- package/esm/funcs/venues-update.js +108 -0
- package/esm/funcs/venues-update.js.map +1 -0
- package/esm/lib/config.d.ts +3 -3
- package/esm/lib/config.js +3 -3
- package/esm/models/api-error.d.ts +1 -0
- package/esm/models/api-error.d.ts.map +1 -1
- package/esm/models/api-error.js +1 -0
- package/esm/models/api-error.js.map +1 -1
- package/esm/models/event-day-create.d.ts +0 -6
- package/esm/models/event-day-create.d.ts.map +1 -1
- package/esm/models/event-day-create.js +0 -3
- package/esm/models/event-day-create.js.map +1 -1
- package/esm/models/event-day-update.d.ts +0 -6
- package/esm/models/event-day-update.d.ts.map +1 -1
- package/esm/models/event-day-update.js +0 -3
- package/esm/models/event-day-update.js.map +1 -1
- package/esm/models/index.d.ts +4 -0
- package/esm/models/index.d.ts.map +1 -1
- package/esm/models/index.js +4 -0
- package/esm/models/index.js.map +1 -1
- package/esm/models/operations/create-venue.d.ts +30 -0
- package/esm/models/operations/create-venue.d.ts.map +1 -0
- package/esm/models/operations/create-venue.js +27 -0
- package/esm/models/operations/create-venue.js.map +1 -0
- package/esm/models/operations/delete-venue.d.ts +27 -0
- package/esm/models/operations/delete-venue.d.ts.map +1 -0
- package/esm/models/operations/delete-venue.js +20 -0
- package/esm/models/operations/delete-venue.js.map +1 -0
- package/esm/models/operations/get-venue.d.ts +27 -0
- package/esm/models/operations/get-venue.d.ts.map +1 -0
- package/esm/models/operations/get-venue.js +20 -0
- package/esm/models/operations/get-venue.js.map +1 -0
- package/esm/models/operations/index.d.ts +5 -0
- package/esm/models/operations/index.d.ts.map +1 -1
- package/esm/models/operations/index.js +5 -0
- package/esm/models/operations/index.js.map +1 -1
- package/esm/models/operations/list-venues.d.ts +45 -0
- package/esm/models/operations/list-venues.d.ts.map +1 -0
- package/esm/models/operations/list-venues.js +42 -0
- package/esm/models/operations/list-venues.js.map +1 -0
- package/esm/models/operations/update-venue.d.ts +30 -0
- package/esm/models/operations/update-venue.d.ts.map +1 -0
- package/esm/models/operations/update-venue.js +22 -0
- package/esm/models/operations/update-venue.js.map +1 -0
- package/esm/models/timeline-item-create.d.ts +10 -0
- package/esm/models/timeline-item-create.d.ts.map +1 -1
- package/esm/models/timeline-item-create.js +4 -0
- package/esm/models/timeline-item-create.js.map +1 -1
- package/esm/models/timeline-item-update.d.ts +10 -0
- package/esm/models/timeline-item-update.d.ts.map +1 -1
- package/esm/models/timeline-item-update.js +4 -0
- package/esm/models/timeline-item-update.js.map +1 -1
- package/esm/models/timeline-item.d.ts +10 -0
- package/esm/models/timeline-item.d.ts.map +1 -1
- package/esm/models/timeline-item.js +4 -0
- package/esm/models/timeline-item.js.map +1 -1
- package/esm/models/venue-address.d.ts +0 -2
- package/esm/models/venue-address.d.ts.map +1 -1
- package/esm/models/venue-address.js +0 -2
- package/esm/models/venue-address.js.map +1 -1
- package/esm/models/venue-create.d.ts +84 -0
- package/esm/models/venue-create.d.ts.map +1 -0
- package/esm/models/venue-create.js +56 -0
- package/esm/models/venue-create.js.map +1 -0
- package/esm/models/venue-list.d.ts +13 -0
- package/esm/models/venue-list.d.ts.map +1 -0
- package/esm/models/venue-list.js +17 -0
- package/esm/models/venue-list.js.map +1 -0
- package/esm/models/venue-update.d.ts +84 -0
- package/esm/models/venue-update.d.ts.map +1 -0
- package/esm/models/venue-update.js +56 -0
- package/esm/models/venue-update.js.map +1 -0
- package/esm/models/venue.d.ts +65 -0
- package/esm/models/venue.d.ts.map +1 -0
- package/esm/models/venue.js +63 -0
- package/esm/models/venue.js.map +1 -0
- package/esm/sdk/sdk.d.ts +3 -0
- package/esm/sdk/sdk.d.ts.map +1 -1
- package/esm/sdk/sdk.js +5 -0
- package/esm/sdk/sdk.js.map +1 -1
- package/esm/sdk/venues.d.ts +29 -0
- package/esm/sdk/venues.d.ts.map +1 -0
- package/esm/sdk/venues.js +44 -0
- package/esm/sdk/venues.js.map +1 -0
- package/jsr.json +1 -1
- package/package.json +1 -1
- package/src/funcs/venues-create.ts +192 -0
- package/src/funcs/venues-delete.ts +201 -0
- package/src/funcs/venues-get.ts +202 -0
- package/src/funcs/venues-list.ts +272 -0
- package/src/funcs/venues-update.ts +203 -0
- package/src/lib/config.ts +3 -3
- package/src/models/api-error.ts +1 -0
- package/src/models/event-day-create.ts +0 -9
- package/src/models/event-day-update.ts +0 -9
- package/src/models/index.ts +4 -0
- package/src/models/operations/create-venue.ts +73 -0
- package/src/models/operations/delete-venue.ts +61 -0
- package/src/models/operations/get-venue.ts +59 -0
- package/src/models/operations/index.ts +5 -0
- package/src/models/operations/list-venues.ts +110 -0
- package/src/models/operations/update-venue.ts +65 -0
- package/src/models/timeline-item-create.ts +10 -0
- package/src/models/timeline-item-update.ts +10 -0
- package/src/models/timeline-item.ts +10 -0
- package/src/models/venue-address.ts +0 -4
- package/src/models/venue-create.ts +166 -0
- package/src/models/venue-list.ts +35 -0
- package/src/models/venue-update.ts +166 -0
- package/src/models/venue.ts +151 -0
- package/src/sdk/sdk.ts +6 -0
- package/src/sdk/venues.ts +96 -0
|
@@ -0,0 +1,272 @@
|
|
|
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 venues
|
|
38
|
+
*/
|
|
39
|
+
export function venuesList(
|
|
40
|
+
client: ClientCasaCore,
|
|
41
|
+
security: operations.ListVenuesSecurity,
|
|
42
|
+
request?: operations.ListVenuesRequest | undefined,
|
|
43
|
+
options?: RequestOptions,
|
|
44
|
+
): APIPromise<
|
|
45
|
+
PageIterator<
|
|
46
|
+
Result<
|
|
47
|
+
operations.ListVenuesResponse,
|
|
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.ListVenuesSecurity,
|
|
72
|
+
request?: operations.ListVenuesRequest | undefined,
|
|
73
|
+
options?: RequestOptions,
|
|
74
|
+
): Promise<
|
|
75
|
+
[
|
|
76
|
+
PageIterator<
|
|
77
|
+
Result<
|
|
78
|
+
operations.ListVenuesResponse,
|
|
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.ListVenuesRequest$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/venues")();
|
|
107
|
+
|
|
108
|
+
const query = encodeFormQuery({
|
|
109
|
+
"page": payload?.page,
|
|
110
|
+
"pageSize": payload?.pageSize,
|
|
111
|
+
"status": payload?.status,
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
const headers = new Headers(compactMap({
|
|
115
|
+
Accept: "application/json",
|
|
116
|
+
}));
|
|
117
|
+
|
|
118
|
+
const requestSecurity = resolveSecurity(
|
|
119
|
+
[
|
|
120
|
+
{
|
|
121
|
+
fieldName: "x-api-key",
|
|
122
|
+
type: "apiKey:header",
|
|
123
|
+
value: security?.apiKey,
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
[
|
|
127
|
+
{
|
|
128
|
+
fieldName: "Authorization",
|
|
129
|
+
type: "http:bearer",
|
|
130
|
+
value: security?.bearer,
|
|
131
|
+
},
|
|
132
|
+
],
|
|
133
|
+
);
|
|
134
|
+
|
|
135
|
+
const context = {
|
|
136
|
+
options: client._options,
|
|
137
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
138
|
+
operationID: "listVenues",
|
|
139
|
+
oAuth2Scopes: null,
|
|
140
|
+
|
|
141
|
+
resolvedSecurity: requestSecurity,
|
|
142
|
+
|
|
143
|
+
securitySource: security,
|
|
144
|
+
retryConfig: options?.retries
|
|
145
|
+
|| client._options.retryConfig
|
|
146
|
+
|| {
|
|
147
|
+
strategy: "backoff",
|
|
148
|
+
backoff: {
|
|
149
|
+
initialInterval: 500,
|
|
150
|
+
maxInterval: 30000,
|
|
151
|
+
exponent: 1.5,
|
|
152
|
+
maxElapsedTime: 30000,
|
|
153
|
+
},
|
|
154
|
+
retryConnectionErrors: true,
|
|
155
|
+
}
|
|
156
|
+
|| { strategy: "none" },
|
|
157
|
+
retryCodes: options?.retryCodes || ["429", "5XX"],
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
const requestRes = client._createRequest(context, {
|
|
161
|
+
security: requestSecurity,
|
|
162
|
+
method: "GET",
|
|
163
|
+
baseURL: options?.serverURL,
|
|
164
|
+
path: path,
|
|
165
|
+
headers: headers,
|
|
166
|
+
query: query,
|
|
167
|
+
body: body,
|
|
168
|
+
userAgent: client._options.userAgent,
|
|
169
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
170
|
+
}, options);
|
|
171
|
+
if (!requestRes.ok) {
|
|
172
|
+
return [haltIterator(requestRes), { status: "invalid" }];
|
|
173
|
+
}
|
|
174
|
+
const req = requestRes.value;
|
|
175
|
+
|
|
176
|
+
const doResult = await client._do(req, {
|
|
177
|
+
context,
|
|
178
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
179
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
180
|
+
retryConfig: context.retryConfig,
|
|
181
|
+
retryCodes: context.retryCodes,
|
|
182
|
+
});
|
|
183
|
+
if (!doResult.ok) {
|
|
184
|
+
return [haltIterator(doResult), { status: "request-error", request: req }];
|
|
185
|
+
}
|
|
186
|
+
const response = doResult.value;
|
|
187
|
+
|
|
188
|
+
const responseFields = {
|
|
189
|
+
HttpMeta: { Response: response, Request: req },
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
const [result, raw] = await M.match<
|
|
193
|
+
operations.ListVenuesResponse,
|
|
194
|
+
| errors.ApiError
|
|
195
|
+
| ClientCasaError
|
|
196
|
+
| ResponseValidationError
|
|
197
|
+
| ConnectionError
|
|
198
|
+
| RequestAbortedError
|
|
199
|
+
| RequestTimeoutError
|
|
200
|
+
| InvalidRequestError
|
|
201
|
+
| UnexpectedClientError
|
|
202
|
+
| SDKValidationError
|
|
203
|
+
>(
|
|
204
|
+
M.json(200, operations.ListVenuesResponse$inboundSchema, { key: "Result" }),
|
|
205
|
+
M.jsonErr([400, 401, 403, 429], errors.ApiError$inboundSchema),
|
|
206
|
+
M.jsonErr(500, errors.ApiError$inboundSchema),
|
|
207
|
+
M.fail("4XX"),
|
|
208
|
+
M.fail("5XX"),
|
|
209
|
+
)(response, req, { extraFields: responseFields });
|
|
210
|
+
if (!result.ok) {
|
|
211
|
+
return [haltIterator(result), {
|
|
212
|
+
status: "complete",
|
|
213
|
+
request: req,
|
|
214
|
+
response,
|
|
215
|
+
}];
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
const nextFunc = (
|
|
219
|
+
responseData: unknown,
|
|
220
|
+
): {
|
|
221
|
+
next: Paginator<
|
|
222
|
+
Result<
|
|
223
|
+
operations.ListVenuesResponse,
|
|
224
|
+
| errors.ApiError
|
|
225
|
+
| ClientCasaError
|
|
226
|
+
| ResponseValidationError
|
|
227
|
+
| ConnectionError
|
|
228
|
+
| RequestAbortedError
|
|
229
|
+
| RequestTimeoutError
|
|
230
|
+
| InvalidRequestError
|
|
231
|
+
| UnexpectedClientError
|
|
232
|
+
| SDKValidationError
|
|
233
|
+
>
|
|
234
|
+
>;
|
|
235
|
+
"~next"?: { page: number };
|
|
236
|
+
} => {
|
|
237
|
+
const page = request?.page ?? 1;
|
|
238
|
+
const nextPage = page + 1;
|
|
239
|
+
|
|
240
|
+
if (!responseData) {
|
|
241
|
+
return { next: () => null };
|
|
242
|
+
}
|
|
243
|
+
const results = (responseData as { data: unknown }).data;
|
|
244
|
+
if (!Array.isArray(results) || !results.length) {
|
|
245
|
+
return { next: () => null };
|
|
246
|
+
}
|
|
247
|
+
const limit = request?.pageSize ?? 25;
|
|
248
|
+
if (results.length < limit) {
|
|
249
|
+
return { next: () => null };
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
const nextVal = () =>
|
|
253
|
+
venuesList(
|
|
254
|
+
client,
|
|
255
|
+
security,
|
|
256
|
+
{
|
|
257
|
+
...request!,
|
|
258
|
+
page: nextPage,
|
|
259
|
+
},
|
|
260
|
+
options,
|
|
261
|
+
);
|
|
262
|
+
|
|
263
|
+
return { next: nextVal, "~next": { page: nextPage } };
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
const page = { ...result, ...nextFunc(raw) };
|
|
267
|
+
return [{ ...page, ...createPageIterator(page, (v) => !v.ok) }, {
|
|
268
|
+
status: "complete",
|
|
269
|
+
request: req,
|
|
270
|
+
response,
|
|
271
|
+
}];
|
|
272
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
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 { encodeJSON, 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
|
+
* Update a venue
|
|
33
|
+
*/
|
|
34
|
+
export function venuesUpdate(
|
|
35
|
+
client: ClientCasaCore,
|
|
36
|
+
security: operations.UpdateVenueSecurity,
|
|
37
|
+
request: operations.UpdateVenueRequest,
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<
|
|
40
|
+
Result<
|
|
41
|
+
models.Venue,
|
|
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.UpdateVenueSecurity,
|
|
64
|
+
request: operations.UpdateVenueRequest,
|
|
65
|
+
options?: RequestOptions,
|
|
66
|
+
): Promise<
|
|
67
|
+
[
|
|
68
|
+
Result<
|
|
69
|
+
models.Venue,
|
|
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.UpdateVenueRequest$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 = encodeJSON("body", payload.body, { explode: true });
|
|
93
|
+
|
|
94
|
+
const pathParams = {
|
|
95
|
+
id: encodeSimple("id", payload.id, {
|
|
96
|
+
explode: false,
|
|
97
|
+
charEncoding: "percent",
|
|
98
|
+
}),
|
|
99
|
+
};
|
|
100
|
+
const path = pathToFunc("/api/v1/venues/{id}")(pathParams);
|
|
101
|
+
|
|
102
|
+
const headers = new Headers(compactMap({
|
|
103
|
+
"Content-Type": "application/json",
|
|
104
|
+
Accept: "application/json",
|
|
105
|
+
}));
|
|
106
|
+
|
|
107
|
+
const requestSecurity = resolveSecurity(
|
|
108
|
+
[
|
|
109
|
+
{
|
|
110
|
+
fieldName: "x-api-key",
|
|
111
|
+
type: "apiKey:header",
|
|
112
|
+
value: security?.apiKey,
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
[
|
|
116
|
+
{
|
|
117
|
+
fieldName: "Authorization",
|
|
118
|
+
type: "http:bearer",
|
|
119
|
+
value: security?.bearer,
|
|
120
|
+
},
|
|
121
|
+
],
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
const context = {
|
|
125
|
+
options: client._options,
|
|
126
|
+
baseURL: options?.serverURL ?? client._baseURL ?? "",
|
|
127
|
+
operationID: "updateVenue",
|
|
128
|
+
oAuth2Scopes: null,
|
|
129
|
+
|
|
130
|
+
resolvedSecurity: requestSecurity,
|
|
131
|
+
|
|
132
|
+
securitySource: security,
|
|
133
|
+
retryConfig: options?.retries
|
|
134
|
+
|| client._options.retryConfig
|
|
135
|
+
|| {
|
|
136
|
+
strategy: "backoff",
|
|
137
|
+
backoff: {
|
|
138
|
+
initialInterval: 500,
|
|
139
|
+
maxInterval: 30000,
|
|
140
|
+
exponent: 1.5,
|
|
141
|
+
maxElapsedTime: 30000,
|
|
142
|
+
},
|
|
143
|
+
retryConnectionErrors: true,
|
|
144
|
+
}
|
|
145
|
+
|| { strategy: "none" },
|
|
146
|
+
retryCodes: options?.retryCodes || ["429", "5XX"],
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
const requestRes = client._createRequest(context, {
|
|
150
|
+
security: requestSecurity,
|
|
151
|
+
method: "PATCH",
|
|
152
|
+
baseURL: options?.serverURL,
|
|
153
|
+
path: path,
|
|
154
|
+
headers: headers,
|
|
155
|
+
body: body,
|
|
156
|
+
userAgent: client._options.userAgent,
|
|
157
|
+
timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1,
|
|
158
|
+
}, options);
|
|
159
|
+
if (!requestRes.ok) {
|
|
160
|
+
return [requestRes, { status: "invalid" }];
|
|
161
|
+
}
|
|
162
|
+
const req = requestRes.value;
|
|
163
|
+
|
|
164
|
+
const doResult = await client._do(req, {
|
|
165
|
+
context,
|
|
166
|
+
isErrorStatusCode: (statusCode: number) =>
|
|
167
|
+
matchStatusCode({ status: statusCode } as Response, ["4XX", "5XX"]),
|
|
168
|
+
retryConfig: context.retryConfig,
|
|
169
|
+
retryCodes: context.retryCodes,
|
|
170
|
+
});
|
|
171
|
+
if (!doResult.ok) {
|
|
172
|
+
return [doResult, { status: "request-error", request: req }];
|
|
173
|
+
}
|
|
174
|
+
const response = doResult.value;
|
|
175
|
+
|
|
176
|
+
const responseFields = {
|
|
177
|
+
HttpMeta: { Response: response, Request: req },
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
const [result] = await M.match<
|
|
181
|
+
models.Venue,
|
|
182
|
+
| errors.ApiError
|
|
183
|
+
| ClientCasaError
|
|
184
|
+
| ResponseValidationError
|
|
185
|
+
| ConnectionError
|
|
186
|
+
| RequestAbortedError
|
|
187
|
+
| RequestTimeoutError
|
|
188
|
+
| InvalidRequestError
|
|
189
|
+
| UnexpectedClientError
|
|
190
|
+
| SDKValidationError
|
|
191
|
+
>(
|
|
192
|
+
M.json(200, models.Venue$inboundSchema),
|
|
193
|
+
M.jsonErr([400, 401, 403, 404, 429], errors.ApiError$inboundSchema),
|
|
194
|
+
M.jsonErr(500, errors.ApiError$inboundSchema),
|
|
195
|
+
M.fail("4XX"),
|
|
196
|
+
M.fail("5XX"),
|
|
197
|
+
)(response, req, { extraFields: responseFields });
|
|
198
|
+
if (!result.ok) {
|
|
199
|
+
return [result, { status: "complete", request: req, response }];
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
return [result, { status: "complete", request: req, response }];
|
|
203
|
+
}
|
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.
|
|
65
|
-
genVersion: "2.
|
|
66
|
-
userAgent: "speakeasy-sdk/typescript 0.6.
|
|
64
|
+
sdkVersion: "0.6.4",
|
|
65
|
+
genVersion: "2.915.1",
|
|
66
|
+
userAgent: "speakeasy-sdk/typescript 0.6.4 2.915.1 1.0.0 @clientcasa/sdk",
|
|
67
67
|
} as const;
|
package/src/models/api-error.ts
CHANGED
|
@@ -19,8 +19,6 @@ export type EventDayCreateVenueAddress = {
|
|
|
19
19
|
state?: string | undefined;
|
|
20
20
|
zip?: string | undefined;
|
|
21
21
|
country?: string | undefined;
|
|
22
|
-
lat?: number | undefined;
|
|
23
|
-
lng?: number | undefined;
|
|
24
22
|
};
|
|
25
23
|
|
|
26
24
|
export type EventDayCreateCustomAnchor = {
|
|
@@ -43,7 +41,6 @@ export type EventDayCreate = {
|
|
|
43
41
|
clientId?: string | undefined;
|
|
44
42
|
ceremonyTime?: string | undefined;
|
|
45
43
|
eventStartTime?: string | undefined;
|
|
46
|
-
venueTimezone?: string | undefined;
|
|
47
44
|
venueAddress?: EventDayCreateVenueAddress | undefined;
|
|
48
45
|
venueNotes?: string | undefined;
|
|
49
46
|
dayStartMinute?: number | undefined;
|
|
@@ -66,8 +63,6 @@ export type EventDayCreateVenueAddress$Outbound = {
|
|
|
66
63
|
state?: string | undefined;
|
|
67
64
|
zip?: string | undefined;
|
|
68
65
|
country?: string | undefined;
|
|
69
|
-
lat?: number | undefined;
|
|
70
|
-
lng?: number | undefined;
|
|
71
66
|
};
|
|
72
67
|
|
|
73
68
|
/** @internal */
|
|
@@ -81,8 +76,6 @@ export const EventDayCreateVenueAddress$outboundSchema: z.ZodMiniType<
|
|
|
81
76
|
state: z.optional(z.string()),
|
|
82
77
|
zip: z.optional(z.string()),
|
|
83
78
|
country: z.optional(z.string()),
|
|
84
|
-
lat: z.optional(z.number()),
|
|
85
|
-
lng: z.optional(z.number()),
|
|
86
79
|
});
|
|
87
80
|
|
|
88
81
|
export function eventDayCreateVenueAddressToJSON(
|
|
@@ -127,7 +120,6 @@ export type EventDayCreate$Outbound = {
|
|
|
127
120
|
clientId?: string | undefined;
|
|
128
121
|
ceremonyTime?: string | undefined;
|
|
129
122
|
eventStartTime?: string | undefined;
|
|
130
|
-
venueTimezone?: string | undefined;
|
|
131
123
|
venueAddress?: EventDayCreateVenueAddress$Outbound | undefined;
|
|
132
124
|
venueNotes?: string | undefined;
|
|
133
125
|
dayStartMinute?: number | undefined;
|
|
@@ -152,7 +144,6 @@ export const EventDayCreate$outboundSchema: z.ZodMiniType<
|
|
|
152
144
|
clientId: z.optional(z.string()),
|
|
153
145
|
ceremonyTime: z.optional(z.string()),
|
|
154
146
|
eventStartTime: z.optional(z.string()),
|
|
155
|
-
venueTimezone: z.optional(z.string()),
|
|
156
147
|
venueAddress: z.optional(
|
|
157
148
|
z.lazy(() => EventDayCreateVenueAddress$outboundSchema),
|
|
158
149
|
),
|
|
@@ -19,8 +19,6 @@ export type EventDayUpdateVenueAddress = {
|
|
|
19
19
|
state?: string | undefined;
|
|
20
20
|
zip?: string | undefined;
|
|
21
21
|
country?: string | undefined;
|
|
22
|
-
lat?: number | undefined;
|
|
23
|
-
lng?: number | undefined;
|
|
24
22
|
};
|
|
25
23
|
|
|
26
24
|
export type EventDayUpdateCustomAnchor = {
|
|
@@ -43,7 +41,6 @@ export type EventDayUpdate = {
|
|
|
43
41
|
clientId?: string | null | undefined;
|
|
44
42
|
ceremonyTime?: string | null | undefined;
|
|
45
43
|
eventStartTime?: string | null | undefined;
|
|
46
|
-
venueTimezone?: string | null | undefined;
|
|
47
44
|
venueAddress?: EventDayUpdateVenueAddress | undefined;
|
|
48
45
|
venueNotes?: string | null | undefined;
|
|
49
46
|
dayStartMinute?: number | undefined;
|
|
@@ -66,8 +63,6 @@ export type EventDayUpdateVenueAddress$Outbound = {
|
|
|
66
63
|
state?: string | undefined;
|
|
67
64
|
zip?: string | undefined;
|
|
68
65
|
country?: string | undefined;
|
|
69
|
-
lat?: number | undefined;
|
|
70
|
-
lng?: number | undefined;
|
|
71
66
|
};
|
|
72
67
|
|
|
73
68
|
/** @internal */
|
|
@@ -81,8 +76,6 @@ export const EventDayUpdateVenueAddress$outboundSchema: z.ZodMiniType<
|
|
|
81
76
|
state: z.optional(z.string()),
|
|
82
77
|
zip: z.optional(z.string()),
|
|
83
78
|
country: z.optional(z.string()),
|
|
84
|
-
lat: z.optional(z.number()),
|
|
85
|
-
lng: z.optional(z.number()),
|
|
86
79
|
});
|
|
87
80
|
|
|
88
81
|
export function eventDayUpdateVenueAddressToJSON(
|
|
@@ -127,7 +120,6 @@ export type EventDayUpdate$Outbound = {
|
|
|
127
120
|
clientId?: string | null | undefined;
|
|
128
121
|
ceremonyTime?: string | null | undefined;
|
|
129
122
|
eventStartTime?: string | null | undefined;
|
|
130
|
-
venueTimezone?: string | null | undefined;
|
|
131
123
|
venueAddress?: EventDayUpdateVenueAddress$Outbound | undefined;
|
|
132
124
|
venueNotes?: string | null | undefined;
|
|
133
125
|
dayStartMinute?: number | undefined;
|
|
@@ -154,7 +146,6 @@ export const EventDayUpdate$outboundSchema: z.ZodMiniType<
|
|
|
154
146
|
clientId: z.optional(z.nullable(z.string())),
|
|
155
147
|
ceremonyTime: z.optional(z.nullable(z.string())),
|
|
156
148
|
eventStartTime: z.optional(z.nullable(z.string())),
|
|
157
|
-
venueTimezone: z.optional(z.nullable(z.string())),
|
|
158
149
|
venueAddress: z.optional(
|
|
159
150
|
z.lazy(() => EventDayUpdateVenueAddress$outboundSchema),
|
|
160
151
|
),
|
package/src/models/index.ts
CHANGED
|
@@ -82,6 +82,10 @@ export * from "./vendor-list.js";
|
|
|
82
82
|
export * from "./vendor-update.js";
|
|
83
83
|
export * from "./vendor.js";
|
|
84
84
|
export * from "./venue-address.js";
|
|
85
|
+
export * from "./venue-create.js";
|
|
86
|
+
export * from "./venue-list.js";
|
|
87
|
+
export * from "./venue-update.js";
|
|
88
|
+
export * from "./venue.js";
|
|
85
89
|
export * from "./webhook-create.js";
|
|
86
90
|
export * from "./webhook-list.js";
|
|
87
91
|
export * from "./webhook-update.js";
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
import * as z from "zod/v4-mini";
|
|
6
|
+
import { remap as remap$ } from "../../lib/primitives.js";
|
|
7
|
+
import * as models from "../index.js";
|
|
8
|
+
|
|
9
|
+
export type CreateVenueSecurity = {
|
|
10
|
+
apiKey?: string | undefined;
|
|
11
|
+
bearer?: string | undefined;
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export type CreateVenueRequest = {
|
|
15
|
+
/**
|
|
16
|
+
* Optional unique key that makes this create safely retryable. Replaying the same key returns the original response instead of creating a duplicate; reusing a key with a different request body returns 409.
|
|
17
|
+
*/
|
|
18
|
+
idempotencyKey?: string | undefined;
|
|
19
|
+
body: models.VenueCreate;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @internal */
|
|
23
|
+
export type CreateVenueSecurity$Outbound = {
|
|
24
|
+
apiKey?: string | undefined;
|
|
25
|
+
bearer?: string | undefined;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
/** @internal */
|
|
29
|
+
export const CreateVenueSecurity$outboundSchema: z.ZodMiniType<
|
|
30
|
+
CreateVenueSecurity$Outbound,
|
|
31
|
+
CreateVenueSecurity
|
|
32
|
+
> = z.object({
|
|
33
|
+
apiKey: z.optional(z.string()),
|
|
34
|
+
bearer: z.optional(z.string()),
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export function createVenueSecurityToJSON(
|
|
38
|
+
createVenueSecurity: CreateVenueSecurity,
|
|
39
|
+
): string {
|
|
40
|
+
return JSON.stringify(
|
|
41
|
+
CreateVenueSecurity$outboundSchema.parse(createVenueSecurity),
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/** @internal */
|
|
46
|
+
export type CreateVenueRequest$Outbound = {
|
|
47
|
+
"Idempotency-Key"?: string | undefined;
|
|
48
|
+
body: models.VenueCreate$Outbound;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** @internal */
|
|
52
|
+
export const CreateVenueRequest$outboundSchema: z.ZodMiniType<
|
|
53
|
+
CreateVenueRequest$Outbound,
|
|
54
|
+
CreateVenueRequest
|
|
55
|
+
> = z.pipe(
|
|
56
|
+
z.object({
|
|
57
|
+
idempotencyKey: z.optional(z.string()),
|
|
58
|
+
body: models.VenueCreate$outboundSchema,
|
|
59
|
+
}),
|
|
60
|
+
z.transform((v) => {
|
|
61
|
+
return remap$(v, {
|
|
62
|
+
idempotencyKey: "Idempotency-Key",
|
|
63
|
+
});
|
|
64
|
+
}),
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
export function createVenueRequestToJSON(
|
|
68
|
+
createVenueRequest: CreateVenueRequest,
|
|
69
|
+
): string {
|
|
70
|
+
return JSON.stringify(
|
|
71
|
+
CreateVenueRequest$outboundSchema.parse(createVenueRequest),
|
|
72
|
+
);
|
|
73
|
+
}
|