@linebundle-sdk/ts 1.0.0-rc.4 → 1.0.0-rc.40

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 (72) hide show
  1. package/README.md +79 -27
  2. package/esm/index.d.ts +14428 -3
  3. package/esm/index.js +2969 -2
  4. package/esm/index.js.map +1 -1
  5. package/package.json +27 -18
  6. package/tsup.config.ts +11 -0
  7. package/esm/client/client.gen.d.ts +0 -3
  8. package/esm/client/client.gen.d.ts.map +0 -1
  9. package/esm/client/client.gen.js +0 -236
  10. package/esm/client/client.gen.js.map +0 -1
  11. package/esm/client/index.d.ts +0 -9
  12. package/esm/client/index.d.ts.map +0 -1
  13. package/esm/client/index.js +0 -7
  14. package/esm/client/index.js.map +0 -1
  15. package/esm/client/types.gen.d.ts +0 -118
  16. package/esm/client/types.gen.d.ts.map +0 -1
  17. package/esm/client/types.gen.js +0 -3
  18. package/esm/client/types.gen.js.map +0 -1
  19. package/esm/client/utils.gen.d.ts +0 -34
  20. package/esm/client/utils.gen.d.ts.map +0 -1
  21. package/esm/client/utils.gen.js +0 -231
  22. package/esm/client/utils.gen.js.map +0 -1
  23. package/esm/client.gen.d.ts +0 -13
  24. package/esm/client.gen.d.ts.map +0 -1
  25. package/esm/client.gen.js +0 -4
  26. package/esm/client.gen.js.map +0 -1
  27. package/esm/core/auth.gen.d.ts +0 -19
  28. package/esm/core/auth.gen.d.ts.map +0 -1
  29. package/esm/core/auth.gen.js +0 -15
  30. package/esm/core/auth.gen.js.map +0 -1
  31. package/esm/core/bodySerializer.gen.d.ts +0 -26
  32. package/esm/core/bodySerializer.gen.d.ts.map +0 -1
  33. package/esm/core/bodySerializer.gen.js +0 -58
  34. package/esm/core/bodySerializer.gen.js.map +0 -1
  35. package/esm/core/params.gen.d.ts +0 -44
  36. package/esm/core/params.gen.d.ts.map +0 -1
  37. package/esm/core/params.gen.js +0 -101
  38. package/esm/core/params.gen.js.map +0 -1
  39. package/esm/core/pathSerializer.gen.d.ts +0 -34
  40. package/esm/core/pathSerializer.gen.d.ts.map +0 -1
  41. package/esm/core/pathSerializer.gen.js +0 -107
  42. package/esm/core/pathSerializer.gen.js.map +0 -1
  43. package/esm/core/queryKeySerializer.gen.d.ts +0 -19
  44. package/esm/core/queryKeySerializer.gen.d.ts.map +0 -1
  45. package/esm/core/queryKeySerializer.gen.js +0 -93
  46. package/esm/core/queryKeySerializer.gen.js.map +0 -1
  47. package/esm/core/serverSentEvents.gen.d.ts +0 -72
  48. package/esm/core/serverSentEvents.gen.d.ts.map +0 -1
  49. package/esm/core/serverSentEvents.gen.js +0 -134
  50. package/esm/core/serverSentEvents.gen.js.map +0 -1
  51. package/esm/core/types.gen.d.ts +0 -79
  52. package/esm/core/types.gen.d.ts.map +0 -1
  53. package/esm/core/types.gen.js +0 -3
  54. package/esm/core/types.gen.js.map +0 -1
  55. package/esm/core/utils.gen.d.ts +0 -20
  56. package/esm/core/utils.gen.d.ts.map +0 -1
  57. package/esm/core/utils.gen.js +0 -88
  58. package/esm/core/utils.gen.js.map +0 -1
  59. package/esm/index.d.ts.map +0 -1
  60. package/esm/sdk.gen.d.ts +0 -1854
  61. package/esm/sdk.gen.d.ts.map +0 -1
  62. package/esm/sdk.gen.js +0 -3875
  63. package/esm/sdk.gen.js.map +0 -1
  64. package/esm/types.gen.d.ts +0 -12463
  65. package/esm/types.gen.d.ts.map +0 -1
  66. package/esm/types.gen.js +0 -3
  67. package/esm/types.gen.js.map +0 -1
  68. package/esm/zod.gen.d.ts +0 -8634
  69. package/esm/zod.gen.d.ts.map +0 -1
  70. package/esm/zod.gen.js +0 -4430
  71. package/esm/zod.gen.js.map +0 -1
  72. package/scripts/fix-esm-extensions.mjs +0 -31
package/esm/index.js CHANGED
@@ -1,3 +1,2970 @@
1
- // This file is auto-generated by @hey-api/openapi-ts
2
- export { AI, AiAgent, AiAgent2, AiAgents, AiWorkflows, Analytic, AuditLogs, AuthContexts, AutomationCron, AutomationMetadata, AutomationRules, Booking, Bookings, ChatMessages, ChatRooms, Contacts, CustomRoles, Event_, EventAttendees, EventDocuments, EventLocation, Events, EventTimeline, EventTimezones, Features, Health, HealthNotifications, Integration, IntegrationUser, Linebundle, Metrics, Organizations, Permissions, Place, Places, Realtime, Roles, Sentry, Space, SpaceContacts, SpaceDocuments, SpaceEvents, SpaceRoles, Spaces, User, Users } from './sdk.gen.js';
1
+ var __defProp = Object.defineProperty;
2
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
+ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
+
5
+ // src/hey-api.ts
6
+ var createClientConfig = (config) => ({
7
+ ...config,
8
+ baseUrl: config.baseUrl ?? "https://api.linebundle.com"
9
+ });
10
+
11
+ // src/generated/core/bodySerializer.gen.ts
12
+ var jsonBodySerializer = {
13
+ bodySerializer: (body) => JSON.stringify(body, (_key, value) => typeof value === "bigint" ? value.toString() : value)
14
+ };
15
+
16
+ // src/generated/core/serverSentEvents.gen.ts
17
+ var createSseClient = ({
18
+ onRequest,
19
+ onSseError,
20
+ onSseEvent,
21
+ responseTransformer,
22
+ responseValidator,
23
+ sseDefaultRetryDelay,
24
+ sseMaxRetryAttempts,
25
+ sseMaxRetryDelay,
26
+ sseSleepFn,
27
+ url,
28
+ ...options
29
+ }) => {
30
+ let lastEventId;
31
+ const sleep = sseSleepFn ?? ((ms) => new Promise((resolve) => setTimeout(resolve, ms)));
32
+ const createStream = async function* () {
33
+ let retryDelay = sseDefaultRetryDelay ?? 3e3;
34
+ let attempt = 0;
35
+ const signal = options.signal ?? new AbortController().signal;
36
+ while (true) {
37
+ if (signal.aborted) break;
38
+ attempt++;
39
+ const headers = options.headers instanceof Headers ? options.headers : new Headers(options.headers);
40
+ if (lastEventId !== void 0) {
41
+ headers.set("Last-Event-ID", lastEventId);
42
+ }
43
+ try {
44
+ const requestInit = {
45
+ redirect: "follow",
46
+ ...options,
47
+ body: options.serializedBody,
48
+ headers,
49
+ signal
50
+ };
51
+ let request = new Request(url, requestInit);
52
+ if (onRequest) {
53
+ request = await onRequest(url, requestInit);
54
+ }
55
+ const _fetch = options.fetch ?? globalThis.fetch;
56
+ const response = await _fetch(request);
57
+ if (!response.ok) throw new Error(`SSE failed: ${response.status} ${response.statusText}`);
58
+ if (!response.body) throw new Error("No body in SSE response");
59
+ const reader = response.body.pipeThrough(new TextDecoderStream()).getReader();
60
+ let buffer = "";
61
+ const abortHandler = () => {
62
+ try {
63
+ reader.cancel();
64
+ } catch {
65
+ }
66
+ };
67
+ signal.addEventListener("abort", abortHandler);
68
+ try {
69
+ while (true) {
70
+ const { done, value } = await reader.read();
71
+ if (done) break;
72
+ buffer += value;
73
+ buffer = buffer.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
74
+ const chunks = buffer.split("\n\n");
75
+ buffer = chunks.pop() ?? "";
76
+ for (const chunk of chunks) {
77
+ const lines = chunk.split("\n");
78
+ const dataLines = [];
79
+ let eventName;
80
+ for (const line of lines) {
81
+ if (line.startsWith("data:")) {
82
+ dataLines.push(line.replace(/^data:\s*/, ""));
83
+ } else if (line.startsWith("event:")) {
84
+ eventName = line.replace(/^event:\s*/, "");
85
+ } else if (line.startsWith("id:")) {
86
+ lastEventId = line.replace(/^id:\s*/, "");
87
+ } else if (line.startsWith("retry:")) {
88
+ const parsed = Number.parseInt(line.replace(/^retry:\s*/, ""), 10);
89
+ if (!Number.isNaN(parsed)) {
90
+ retryDelay = parsed;
91
+ }
92
+ }
93
+ }
94
+ let data;
95
+ let parsedJson = false;
96
+ if (dataLines.length) {
97
+ const rawData = dataLines.join("\n");
98
+ try {
99
+ data = JSON.parse(rawData);
100
+ parsedJson = true;
101
+ } catch {
102
+ data = rawData;
103
+ }
104
+ }
105
+ if (parsedJson) {
106
+ if (responseValidator) {
107
+ await responseValidator(data);
108
+ }
109
+ if (responseTransformer) {
110
+ data = await responseTransformer(data);
111
+ }
112
+ }
113
+ onSseEvent?.({
114
+ data,
115
+ event: eventName,
116
+ id: lastEventId,
117
+ retry: retryDelay
118
+ });
119
+ if (dataLines.length) {
120
+ yield data;
121
+ }
122
+ }
123
+ }
124
+ } finally {
125
+ signal.removeEventListener("abort", abortHandler);
126
+ reader.releaseLock();
127
+ }
128
+ break;
129
+ } catch (error) {
130
+ onSseError?.(error);
131
+ if (sseMaxRetryAttempts !== void 0 && attempt >= sseMaxRetryAttempts) {
132
+ break;
133
+ }
134
+ const backoff = Math.min(retryDelay * 2 ** (attempt - 1), sseMaxRetryDelay ?? 3e4);
135
+ await sleep(backoff);
136
+ }
137
+ }
138
+ };
139
+ const stream = createStream();
140
+ return { stream };
141
+ };
142
+
143
+ // src/generated/core/pathSerializer.gen.ts
144
+ var separatorArrayExplode = (style) => {
145
+ switch (style) {
146
+ case "label":
147
+ return ".";
148
+ case "matrix":
149
+ return ";";
150
+ case "simple":
151
+ return ",";
152
+ default:
153
+ return "&";
154
+ }
155
+ };
156
+ var separatorArrayNoExplode = (style) => {
157
+ switch (style) {
158
+ case "form":
159
+ return ",";
160
+ case "pipeDelimited":
161
+ return "|";
162
+ case "spaceDelimited":
163
+ return "%20";
164
+ default:
165
+ return ",";
166
+ }
167
+ };
168
+ var separatorObjectExplode = (style) => {
169
+ switch (style) {
170
+ case "label":
171
+ return ".";
172
+ case "matrix":
173
+ return ";";
174
+ case "simple":
175
+ return ",";
176
+ default:
177
+ return "&";
178
+ }
179
+ };
180
+ var serializeArrayParam = ({
181
+ allowReserved,
182
+ explode,
183
+ name,
184
+ style,
185
+ value
186
+ }) => {
187
+ if (!explode) {
188
+ const joinedValues2 = (allowReserved ? value : value.map((v2) => encodeURIComponent(v2))).join(separatorArrayNoExplode(style));
189
+ switch (style) {
190
+ case "label":
191
+ return `.${joinedValues2}`;
192
+ case "matrix":
193
+ return `;${name}=${joinedValues2}`;
194
+ case "simple":
195
+ return joinedValues2;
196
+ default:
197
+ return `${name}=${joinedValues2}`;
198
+ }
199
+ }
200
+ const separator = separatorArrayExplode(style);
201
+ const joinedValues = value.map((v2) => {
202
+ if (style === "label" || style === "simple") {
203
+ return allowReserved ? v2 : encodeURIComponent(v2);
204
+ }
205
+ return serializePrimitiveParam({
206
+ allowReserved,
207
+ name,
208
+ value: v2
209
+ });
210
+ }).join(separator);
211
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
212
+ };
213
+ var serializePrimitiveParam = ({
214
+ allowReserved,
215
+ name,
216
+ value
217
+ }) => {
218
+ if (value === void 0 || value === null) {
219
+ return "";
220
+ }
221
+ if (typeof value === "object") {
222
+ throw new Error(
223
+ "Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these."
224
+ );
225
+ }
226
+ return `${name}=${allowReserved ? value : encodeURIComponent(value)}`;
227
+ };
228
+ var serializeObjectParam = ({
229
+ allowReserved,
230
+ explode,
231
+ name,
232
+ style,
233
+ value,
234
+ valueOnly
235
+ }) => {
236
+ if (value instanceof Date) {
237
+ return valueOnly ? value.toISOString() : `${name}=${value.toISOString()}`;
238
+ }
239
+ if (style !== "deepObject" && !explode) {
240
+ let values = [];
241
+ Object.entries(value).forEach(([key, v2]) => {
242
+ values = [...values, key, allowReserved ? v2 : encodeURIComponent(v2)];
243
+ });
244
+ const joinedValues2 = values.join(",");
245
+ switch (style) {
246
+ case "form":
247
+ return `${name}=${joinedValues2}`;
248
+ case "label":
249
+ return `.${joinedValues2}`;
250
+ case "matrix":
251
+ return `;${name}=${joinedValues2}`;
252
+ default:
253
+ return joinedValues2;
254
+ }
255
+ }
256
+ const separator = separatorObjectExplode(style);
257
+ const joinedValues = Object.entries(value).map(
258
+ ([key, v2]) => serializePrimitiveParam({
259
+ allowReserved,
260
+ name: style === "deepObject" ? `${name}[${key}]` : key,
261
+ value: v2
262
+ })
263
+ ).join(separator);
264
+ return style === "label" || style === "matrix" ? separator + joinedValues : joinedValues;
265
+ };
266
+
267
+ // src/generated/core/utils.gen.ts
268
+ var PATH_PARAM_RE = /\{[^{}]+\}/g;
269
+ var defaultPathSerializer = ({ path, url: _url }) => {
270
+ let url = _url;
271
+ const matches = _url.match(PATH_PARAM_RE);
272
+ if (matches) {
273
+ for (const match of matches) {
274
+ let explode = false;
275
+ let name = match.substring(1, match.length - 1);
276
+ let style = "simple";
277
+ if (name.endsWith("*")) {
278
+ explode = true;
279
+ name = name.substring(0, name.length - 1);
280
+ }
281
+ if (name.startsWith(".")) {
282
+ name = name.substring(1);
283
+ style = "label";
284
+ } else if (name.startsWith(";")) {
285
+ name = name.substring(1);
286
+ style = "matrix";
287
+ }
288
+ const value = path[name];
289
+ if (value === void 0 || value === null) {
290
+ continue;
291
+ }
292
+ if (Array.isArray(value)) {
293
+ url = url.replace(match, serializeArrayParam({ explode, name, style, value }));
294
+ continue;
295
+ }
296
+ if (typeof value === "object") {
297
+ url = url.replace(
298
+ match,
299
+ serializeObjectParam({
300
+ explode,
301
+ name,
302
+ style,
303
+ value,
304
+ valueOnly: true
305
+ })
306
+ );
307
+ continue;
308
+ }
309
+ if (style === "matrix") {
310
+ url = url.replace(
311
+ match,
312
+ `;${serializePrimitiveParam({
313
+ name,
314
+ value
315
+ })}`
316
+ );
317
+ continue;
318
+ }
319
+ const replaceValue = encodeURIComponent(
320
+ style === "label" ? `.${value}` : value
321
+ );
322
+ url = url.replace(match, replaceValue);
323
+ }
324
+ }
325
+ return url;
326
+ };
327
+ var getUrl = ({
328
+ baseUrl,
329
+ path,
330
+ query,
331
+ querySerializer,
332
+ url: _url
333
+ }) => {
334
+ const pathUrl = _url.startsWith("/") ? _url : `/${_url}`;
335
+ let url = (baseUrl ?? "") + pathUrl;
336
+ if (path) {
337
+ url = defaultPathSerializer({ path, url });
338
+ }
339
+ let search = query ? querySerializer(query) : "";
340
+ if (search.startsWith("?")) {
341
+ search = search.substring(1);
342
+ }
343
+ if (search) {
344
+ url += `?${search}`;
345
+ }
346
+ return url;
347
+ };
348
+ function getValidRequestBody(options) {
349
+ const hasBody = options.body !== void 0;
350
+ const isSerializedBody = hasBody && options.bodySerializer;
351
+ if (isSerializedBody) {
352
+ if ("serializedBody" in options) {
353
+ const hasSerializedBody = options.serializedBody !== void 0 && options.serializedBody !== "";
354
+ return hasSerializedBody ? options.serializedBody : null;
355
+ }
356
+ return options.body !== "" ? options.body : null;
357
+ }
358
+ if (hasBody) {
359
+ return options.body;
360
+ }
361
+ return void 0;
362
+ }
363
+
364
+ // src/generated/core/auth.gen.ts
365
+ var getAuthToken = async (auth, callback) => {
366
+ const token = typeof callback === "function" ? await callback(auth) : callback;
367
+ if (!token) {
368
+ return;
369
+ }
370
+ if (auth.scheme === "bearer") {
371
+ return `Bearer ${token}`;
372
+ }
373
+ if (auth.scheme === "basic") {
374
+ return `Basic ${btoa(token)}`;
375
+ }
376
+ return token;
377
+ };
378
+
379
+ // src/generated/client/utils.gen.ts
380
+ var createQuerySerializer = ({
381
+ parameters = {},
382
+ ...args
383
+ } = {}) => {
384
+ const querySerializer = (queryParams) => {
385
+ const search = [];
386
+ if (queryParams && typeof queryParams === "object") {
387
+ for (const name in queryParams) {
388
+ const value = queryParams[name];
389
+ if (value === void 0 || value === null) {
390
+ continue;
391
+ }
392
+ const options = parameters[name] || args;
393
+ if (Array.isArray(value)) {
394
+ const serializedArray = serializeArrayParam({
395
+ allowReserved: options.allowReserved,
396
+ explode: true,
397
+ name,
398
+ style: "form",
399
+ value,
400
+ ...options.array
401
+ });
402
+ if (serializedArray) search.push(serializedArray);
403
+ } else if (typeof value === "object") {
404
+ const serializedObject = serializeObjectParam({
405
+ allowReserved: options.allowReserved,
406
+ explode: true,
407
+ name,
408
+ style: "deepObject",
409
+ value,
410
+ ...options.object
411
+ });
412
+ if (serializedObject) search.push(serializedObject);
413
+ } else {
414
+ const serializedPrimitive = serializePrimitiveParam({
415
+ allowReserved: options.allowReserved,
416
+ name,
417
+ value
418
+ });
419
+ if (serializedPrimitive) search.push(serializedPrimitive);
420
+ }
421
+ }
422
+ }
423
+ return search.join("&");
424
+ };
425
+ return querySerializer;
426
+ };
427
+ var getParseAs = (contentType) => {
428
+ if (!contentType) {
429
+ return "stream";
430
+ }
431
+ const cleanContent = contentType.split(";")[0]?.trim();
432
+ if (!cleanContent) {
433
+ return;
434
+ }
435
+ if (cleanContent.startsWith("application/json") || cleanContent.endsWith("+json")) {
436
+ return "json";
437
+ }
438
+ if (cleanContent === "multipart/form-data") {
439
+ return "formData";
440
+ }
441
+ if (["application/", "audio/", "image/", "video/"].some((type) => cleanContent.startsWith(type))) {
442
+ return "blob";
443
+ }
444
+ if (cleanContent.startsWith("text/")) {
445
+ return "text";
446
+ }
447
+ return;
448
+ };
449
+ var checkForExistence = (options, name) => {
450
+ if (!name) {
451
+ return false;
452
+ }
453
+ if (options.headers.has(name) || options.query?.[name] || options.headers.get("Cookie")?.includes(`${name}=`)) {
454
+ return true;
455
+ }
456
+ return false;
457
+ };
458
+ var setAuthParams = async ({
459
+ security,
460
+ ...options
461
+ }) => {
462
+ for (const auth of security) {
463
+ if (checkForExistence(options, auth.name)) {
464
+ continue;
465
+ }
466
+ const token = await getAuthToken(auth, options.auth);
467
+ if (!token) {
468
+ continue;
469
+ }
470
+ const name = auth.name ?? "Authorization";
471
+ switch (auth.in) {
472
+ case "query":
473
+ if (!options.query) {
474
+ options.query = {};
475
+ }
476
+ options.query[name] = token;
477
+ break;
478
+ case "cookie":
479
+ options.headers.append("Cookie", `${name}=${token}`);
480
+ break;
481
+ case "header":
482
+ default:
483
+ options.headers.set(name, token);
484
+ break;
485
+ }
486
+ }
487
+ };
488
+ var buildUrl = (options) => getUrl({
489
+ baseUrl: options.baseUrl,
490
+ path: options.path,
491
+ query: options.query,
492
+ querySerializer: typeof options.querySerializer === "function" ? options.querySerializer : createQuerySerializer(options.querySerializer),
493
+ url: options.url
494
+ });
495
+ var mergeConfigs = (a, b) => {
496
+ const config = { ...a, ...b };
497
+ if (config.baseUrl?.endsWith("/")) {
498
+ config.baseUrl = config.baseUrl.substring(0, config.baseUrl.length - 1);
499
+ }
500
+ config.headers = mergeHeaders(a.headers, b.headers);
501
+ return config;
502
+ };
503
+ var headersEntries = (headers) => {
504
+ const entries = [];
505
+ headers.forEach((value, key) => {
506
+ entries.push([key, value]);
507
+ });
508
+ return entries;
509
+ };
510
+ var mergeHeaders = (...headers) => {
511
+ const mergedHeaders = new Headers();
512
+ for (const header of headers) {
513
+ if (!header) {
514
+ continue;
515
+ }
516
+ const iterator = header instanceof Headers ? headersEntries(header) : Object.entries(header);
517
+ for (const [key, value] of iterator) {
518
+ if (value === null) {
519
+ mergedHeaders.delete(key);
520
+ } else if (Array.isArray(value)) {
521
+ for (const v2 of value) {
522
+ mergedHeaders.append(key, v2);
523
+ }
524
+ } else if (value !== void 0) {
525
+ mergedHeaders.set(
526
+ key,
527
+ typeof value === "object" ? JSON.stringify(value) : value
528
+ );
529
+ }
530
+ }
531
+ }
532
+ return mergedHeaders;
533
+ };
534
+ var Interceptors = class {
535
+ constructor() {
536
+ this.fns = [];
537
+ }
538
+ clear() {
539
+ this.fns = [];
540
+ }
541
+ eject(id) {
542
+ const index = this.getInterceptorIndex(id);
543
+ if (this.fns[index]) {
544
+ this.fns[index] = null;
545
+ }
546
+ }
547
+ exists(id) {
548
+ const index = this.getInterceptorIndex(id);
549
+ return Boolean(this.fns[index]);
550
+ }
551
+ getInterceptorIndex(id) {
552
+ if (typeof id === "number") {
553
+ return this.fns[id] ? id : -1;
554
+ }
555
+ return this.fns.indexOf(id);
556
+ }
557
+ update(id, fn) {
558
+ const index = this.getInterceptorIndex(id);
559
+ if (this.fns[index]) {
560
+ this.fns[index] = fn;
561
+ return id;
562
+ }
563
+ return false;
564
+ }
565
+ use(fn) {
566
+ this.fns.push(fn);
567
+ return this.fns.length - 1;
568
+ }
569
+ };
570
+ var createInterceptors = () => ({
571
+ error: new Interceptors(),
572
+ request: new Interceptors(),
573
+ response: new Interceptors()
574
+ });
575
+ var defaultQuerySerializer = createQuerySerializer({
576
+ allowReserved: false,
577
+ array: {
578
+ explode: true,
579
+ style: "form"
580
+ },
581
+ object: {
582
+ explode: true,
583
+ style: "deepObject"
584
+ }
585
+ });
586
+ var defaultHeaders = {
587
+ "Content-Type": "application/json"
588
+ };
589
+ var createConfig = (override = {}) => ({
590
+ ...jsonBodySerializer,
591
+ headers: defaultHeaders,
592
+ parseAs: "auto",
593
+ querySerializer: defaultQuerySerializer,
594
+ ...override
595
+ });
596
+
597
+ // src/generated/client/client.gen.ts
598
+ var createClient = (config = {}) => {
599
+ let _config = mergeConfigs(createConfig(), config);
600
+ const getConfig = () => ({ ..._config });
601
+ const setConfig = (config2) => {
602
+ _config = mergeConfigs(_config, config2);
603
+ return getConfig();
604
+ };
605
+ const interceptors = createInterceptors();
606
+ const beforeRequest = async (options) => {
607
+ const opts = {
608
+ ..._config,
609
+ ...options,
610
+ fetch: options.fetch ?? _config.fetch ?? globalThis.fetch,
611
+ headers: mergeHeaders(_config.headers, options.headers),
612
+ serializedBody: void 0
613
+ };
614
+ if (opts.security) {
615
+ await setAuthParams({
616
+ ...opts,
617
+ security: opts.security
618
+ });
619
+ }
620
+ if (opts.requestValidator) {
621
+ await opts.requestValidator(opts);
622
+ }
623
+ if (opts.body !== void 0 && opts.bodySerializer) {
624
+ opts.serializedBody = opts.bodySerializer(opts.body);
625
+ }
626
+ if (opts.body === void 0 || opts.serializedBody === "") {
627
+ opts.headers.delete("Content-Type");
628
+ }
629
+ const resolvedOpts = opts;
630
+ const url = buildUrl(resolvedOpts);
631
+ return { opts: resolvedOpts, url };
632
+ };
633
+ const request = async (options) => {
634
+ const { opts, url } = await beforeRequest(options);
635
+ const requestInit = {
636
+ redirect: "follow",
637
+ ...opts,
638
+ body: getValidRequestBody(opts)
639
+ };
640
+ let request2 = new Request(url, requestInit);
641
+ for (const fn of interceptors.request.fns) {
642
+ if (fn) {
643
+ request2 = await fn(request2, opts);
644
+ }
645
+ }
646
+ const _fetch = opts.fetch;
647
+ let response;
648
+ try {
649
+ response = await _fetch(request2);
650
+ } catch (error2) {
651
+ let finalError2 = error2;
652
+ for (const fn of interceptors.error.fns) {
653
+ if (fn) {
654
+ finalError2 = await fn(error2, void 0, request2, opts);
655
+ }
656
+ }
657
+ finalError2 = finalError2 || {};
658
+ if (opts.throwOnError) {
659
+ throw finalError2;
660
+ }
661
+ return opts.responseStyle === "data" ? void 0 : {
662
+ error: finalError2,
663
+ request: request2,
664
+ response: void 0
665
+ };
666
+ }
667
+ for (const fn of interceptors.response.fns) {
668
+ if (fn) {
669
+ response = await fn(response, request2, opts);
670
+ }
671
+ }
672
+ const result = {
673
+ request: request2,
674
+ response
675
+ };
676
+ if (response.ok) {
677
+ const parseAs = (opts.parseAs === "auto" ? getParseAs(response.headers.get("Content-Type")) : opts.parseAs) ?? "json";
678
+ if (response.status === 204 || response.headers.get("Content-Length") === "0") {
679
+ let emptyData;
680
+ switch (parseAs) {
681
+ case "arrayBuffer":
682
+ case "blob":
683
+ case "text":
684
+ emptyData = await response[parseAs]();
685
+ break;
686
+ case "formData":
687
+ emptyData = new FormData();
688
+ break;
689
+ case "stream":
690
+ emptyData = response.body;
691
+ break;
692
+ case "json":
693
+ default:
694
+ emptyData = {};
695
+ break;
696
+ }
697
+ return opts.responseStyle === "data" ? emptyData : {
698
+ data: emptyData,
699
+ ...result
700
+ };
701
+ }
702
+ let data;
703
+ switch (parseAs) {
704
+ case "arrayBuffer":
705
+ case "blob":
706
+ case "formData":
707
+ case "text":
708
+ data = await response[parseAs]();
709
+ break;
710
+ case "json": {
711
+ const text = await response.text();
712
+ data = text ? JSON.parse(text) : {};
713
+ break;
714
+ }
715
+ case "stream":
716
+ return opts.responseStyle === "data" ? response.body : {
717
+ data: response.body,
718
+ ...result
719
+ };
720
+ }
721
+ if (parseAs === "json") {
722
+ if (opts.responseValidator) {
723
+ await opts.responseValidator(data);
724
+ }
725
+ if (opts.responseTransformer) {
726
+ data = await opts.responseTransformer(data);
727
+ }
728
+ }
729
+ return opts.responseStyle === "data" ? data : {
730
+ data,
731
+ ...result
732
+ };
733
+ }
734
+ const textError = await response.text();
735
+ let jsonError;
736
+ try {
737
+ jsonError = JSON.parse(textError);
738
+ } catch {
739
+ }
740
+ const error = jsonError ?? textError;
741
+ let finalError = error;
742
+ for (const fn of interceptors.error.fns) {
743
+ if (fn) {
744
+ finalError = await fn(error, response, request2, opts);
745
+ }
746
+ }
747
+ finalError = finalError || {};
748
+ if (opts.throwOnError) {
749
+ throw finalError;
750
+ }
751
+ return opts.responseStyle === "data" ? void 0 : {
752
+ error: finalError,
753
+ ...result
754
+ };
755
+ };
756
+ const makeMethodFn = (method) => (options) => request({ ...options, method });
757
+ const makeSseFn = (method) => async (options) => {
758
+ const { opts, url } = await beforeRequest(options);
759
+ return createSseClient({
760
+ ...opts,
761
+ body: opts.body,
762
+ headers: opts.headers,
763
+ method,
764
+ onRequest: async (url2, init) => {
765
+ let request2 = new Request(url2, init);
766
+ for (const fn of interceptors.request.fns) {
767
+ if (fn) {
768
+ request2 = await fn(request2, opts);
769
+ }
770
+ }
771
+ return request2;
772
+ },
773
+ serializedBody: getValidRequestBody(opts),
774
+ url
775
+ });
776
+ };
777
+ const _buildUrl = (options) => buildUrl({ ..._config, ...options });
778
+ return {
779
+ buildUrl: _buildUrl,
780
+ connect: makeMethodFn("CONNECT"),
781
+ delete: makeMethodFn("DELETE"),
782
+ get: makeMethodFn("GET"),
783
+ getConfig,
784
+ head: makeMethodFn("HEAD"),
785
+ interceptors,
786
+ options: makeMethodFn("OPTIONS"),
787
+ patch: makeMethodFn("PATCH"),
788
+ post: makeMethodFn("POST"),
789
+ put: makeMethodFn("PUT"),
790
+ request,
791
+ setConfig,
792
+ sse: {
793
+ connect: makeSseFn("CONNECT"),
794
+ delete: makeSseFn("DELETE"),
795
+ get: makeSseFn("GET"),
796
+ head: makeSseFn("HEAD"),
797
+ options: makeSseFn("OPTIONS"),
798
+ patch: makeSseFn("PATCH"),
799
+ post: makeSseFn("POST"),
800
+ put: makeSseFn("PUT"),
801
+ trace: makeSseFn("TRACE")
802
+ },
803
+ trace: makeMethodFn("TRACE")
804
+ };
805
+ };
806
+
807
+ // src/generated/client.gen.ts
808
+ var client = createClient(createClientConfig(createConfig({ baseUrl: "https://api.linebundle.com" })));
809
+
810
+ // src/generated/sdk.gen.ts
811
+ var HeyApiClient = class {
812
+ constructor(args) {
813
+ this.client = args?.client ?? client;
814
+ }
815
+ };
816
+ var HeyApiRegistry = class {
817
+ constructor() {
818
+ this.defaultKey = "default";
819
+ this.instances = /* @__PURE__ */ new Map();
820
+ }
821
+ get(key) {
822
+ const instance = this.instances.get(key ?? this.defaultKey);
823
+ if (!instance) {
824
+ throw new Error(`No SDK client found. Create one with "new Linebundle()" to fix this error.`);
825
+ }
826
+ return instance;
827
+ }
828
+ set(value, key) {
829
+ this.instances.set(key ?? this.defaultKey, value);
830
+ }
831
+ };
832
+ var Analytics = class extends HeyApiClient {
833
+ /**
834
+ * Get entity counts for the org
835
+ */
836
+ counts(options) {
837
+ return (options?.client ?? this.client).get({ url: "/api/v1/analytics/counts", ...options });
838
+ }
839
+ /**
840
+ * Get the org dashboard
841
+ */
842
+ dashboard(options) {
843
+ return (options?.client ?? this.client).get({ url: "/api/v1/analytics/dashboard", ...options });
844
+ }
845
+ /**
846
+ * Get the overview screen payload
847
+ */
848
+ overview(options) {
849
+ return (options?.client ?? this.client).get({ url: "/api/v1/analytics/overview", ...options });
850
+ }
851
+ };
852
+ var Announcements = class extends HeyApiClient {
853
+ /**
854
+ * List announcements
855
+ */
856
+ list(options) {
857
+ return (options?.client ?? this.client).get({ url: "/api/v1/announcements", ...options });
858
+ }
859
+ /**
860
+ * Create an announcement
861
+ */
862
+ create(options) {
863
+ return (options.client ?? this.client).post({
864
+ url: "/api/v1/announcements",
865
+ ...options,
866
+ headers: {
867
+ "Content-Type": "application/json",
868
+ ...options.headers
869
+ }
870
+ });
871
+ }
872
+ /**
873
+ * Delete an announcement
874
+ */
875
+ delete(options) {
876
+ return (options.client ?? this.client).delete({ url: "/api/v1/announcements/{id}", ...options });
877
+ }
878
+ /**
879
+ * Get an announcement
880
+ */
881
+ get(options) {
882
+ return (options.client ?? this.client).get({ url: "/api/v1/announcements/{id}", ...options });
883
+ }
884
+ /**
885
+ * Partially update an announcement
886
+ */
887
+ patch(options) {
888
+ return (options.client ?? this.client).patch({
889
+ url: "/api/v1/announcements/{id}",
890
+ ...options,
891
+ headers: {
892
+ "Content-Type": "application/json",
893
+ ...options.headers
894
+ }
895
+ });
896
+ }
897
+ /**
898
+ * Upload announcement cover image (multipart/form-data, field: file)
899
+ */
900
+ uploadCover(options) {
901
+ return (options.client ?? this.client).put({
902
+ bodySerializer: null,
903
+ url: "/api/v1/announcements/{id}/cover",
904
+ ...options,
905
+ headers: {
906
+ "Content-Type": "application/octet-stream",
907
+ ...options.headers
908
+ }
909
+ });
910
+ }
911
+ /**
912
+ * Publish an announcement (queues email delivery)
913
+ */
914
+ publish(options) {
915
+ return (options.client ?? this.client).post({
916
+ url: "/api/v1/announcements/{id}/publish",
917
+ ...options,
918
+ headers: {
919
+ "Content-Type": "application/json",
920
+ ...options.headers
921
+ }
922
+ });
923
+ }
924
+ };
925
+ var Audit = class extends HeyApiClient {
926
+ /**
927
+ * List audit log entries for the organisation
928
+ */
929
+ list(options) {
930
+ return (options?.client ?? this.client).get({ url: "/api/v1/audit-logs", ...options });
931
+ }
932
+ };
933
+ var Auth = class extends HeyApiClient {
934
+ /**
935
+ * Get the authenticated caller's identity and permissions
936
+ */
937
+ context(options) {
938
+ return (options?.client ?? this.client).get({ url: "/api/v1/auth/context", ...options });
939
+ }
940
+ /**
941
+ * Get the authenticated caller's identity and permissions
942
+ */
943
+ me(options) {
944
+ return (options?.client ?? this.client).get({ url: "/api/v1/auth/me", ...options });
945
+ }
946
+ };
947
+ var Automation = class extends HeyApiClient {
948
+ /**
949
+ * List available native automation action types
950
+ */
951
+ listActions(options) {
952
+ return (options?.client ?? this.client).get({ url: "/api/v1/automation/actions", ...options });
953
+ }
954
+ /**
955
+ * List automation rules
956
+ */
957
+ listRules(options) {
958
+ return (options?.client ?? this.client).get({ url: "/api/v1/automation/rules", ...options });
959
+ }
960
+ /**
961
+ * Create an automation rule
962
+ */
963
+ createRule(options) {
964
+ return (options.client ?? this.client).post({
965
+ url: "/api/v1/automation/rules",
966
+ ...options,
967
+ headers: {
968
+ "Content-Type": "application/json",
969
+ ...options.headers
970
+ }
971
+ });
972
+ }
973
+ /**
974
+ * Delete an automation rule
975
+ */
976
+ deleteRule(options) {
977
+ return (options.client ?? this.client).delete({ url: "/api/v1/automation/rules/{id}", ...options });
978
+ }
979
+ /**
980
+ * Get an automation rule
981
+ */
982
+ getRule(options) {
983
+ return (options.client ?? this.client).get({ url: "/api/v1/automation/rules/{id}", ...options });
984
+ }
985
+ /**
986
+ * Update an automation rule
987
+ */
988
+ updateRule(options) {
989
+ return (options.client ?? this.client).put({
990
+ url: "/api/v1/automation/rules/{id}",
991
+ ...options,
992
+ headers: {
993
+ "Content-Type": "application/json",
994
+ ...options.headers
995
+ }
996
+ });
997
+ }
998
+ /**
999
+ * Manually trigger an automation rule
1000
+ */
1001
+ executeRule(options) {
1002
+ return (options.client ?? this.client).post({ url: "/api/v1/automation/rules/{id}/execute", ...options });
1003
+ }
1004
+ /**
1005
+ * List execution history for a rule
1006
+ */
1007
+ listExecutions(options) {
1008
+ return (options.client ?? this.client).get({ url: "/api/v1/automation/rules/{id}/executions", ...options });
1009
+ }
1010
+ /**
1011
+ * List available automation trigger types
1012
+ */
1013
+ listTriggers(options) {
1014
+ return (options?.client ?? this.client).get({ url: "/api/v1/automation/triggers", ...options });
1015
+ }
1016
+ };
1017
+ var Bookings = class extends HeyApiClient {
1018
+ /**
1019
+ * List bookings
1020
+ */
1021
+ list(options) {
1022
+ return (options?.client ?? this.client).get({ url: "/api/v1/bookings", ...options });
1023
+ }
1024
+ /**
1025
+ * Create a booking
1026
+ */
1027
+ create(options) {
1028
+ return (options.client ?? this.client).post({
1029
+ url: "/api/v1/bookings",
1030
+ ...options,
1031
+ headers: {
1032
+ "Content-Type": "application/json",
1033
+ ...options.headers
1034
+ }
1035
+ });
1036
+ }
1037
+ /**
1038
+ * Check place availability for a time slot
1039
+ */
1040
+ checkAvailability(options) {
1041
+ return (options.client ?? this.client).post({
1042
+ url: "/api/v1/bookings/check-availability",
1043
+ ...options,
1044
+ headers: {
1045
+ "Content-Type": "application/json",
1046
+ ...options.headers
1047
+ }
1048
+ });
1049
+ }
1050
+ /**
1051
+ * Get all bookings for a place within a date range
1052
+ */
1053
+ placeSchedule(options) {
1054
+ return (options.client ?? this.client).get({ url: "/api/v1/bookings/places/{place_id}/schedule", ...options });
1055
+ }
1056
+ /**
1057
+ * Delete a booking
1058
+ */
1059
+ delete(options) {
1060
+ return (options.client ?? this.client).delete({ url: "/api/v1/bookings/{id}", ...options });
1061
+ }
1062
+ /**
1063
+ * Get a booking by ID
1064
+ */
1065
+ get(options) {
1066
+ return (options.client ?? this.client).get({ url: "/api/v1/bookings/{id}", ...options });
1067
+ }
1068
+ /**
1069
+ * Update a booking
1070
+ */
1071
+ update(options) {
1072
+ return (options.client ?? this.client).put({
1073
+ url: "/api/v1/bookings/{id}",
1074
+ ...options,
1075
+ headers: {
1076
+ "Content-Type": "application/json",
1077
+ ...options.headers
1078
+ }
1079
+ });
1080
+ }
1081
+ };
1082
+ var Contacts = class extends HeyApiClient {
1083
+ /**
1084
+ * List contacts
1085
+ */
1086
+ list(options) {
1087
+ return (options?.client ?? this.client).get({ url: "/api/v1/contacts", ...options });
1088
+ }
1089
+ /**
1090
+ * Create a contact
1091
+ */
1092
+ create(options) {
1093
+ return (options.client ?? this.client).post({
1094
+ url: "/api/v1/contacts",
1095
+ ...options,
1096
+ headers: {
1097
+ "Content-Type": "application/json",
1098
+ ...options.headers
1099
+ }
1100
+ });
1101
+ }
1102
+ /**
1103
+ * Search contacts
1104
+ */
1105
+ search(options) {
1106
+ return (options?.client ?? this.client).get({ url: "/api/v1/contacts/search", ...options });
1107
+ }
1108
+ /**
1109
+ * Delete a contact
1110
+ */
1111
+ delete(options) {
1112
+ return (options.client ?? this.client).delete({ url: "/api/v1/contacts/{id}", ...options });
1113
+ }
1114
+ /**
1115
+ * Get a contact
1116
+ */
1117
+ get(options) {
1118
+ return (options.client ?? this.client).get({ url: "/api/v1/contacts/{id}", ...options });
1119
+ }
1120
+ /**
1121
+ * Update a contact
1122
+ */
1123
+ update(options) {
1124
+ return (options.client ?? this.client).put({
1125
+ url: "/api/v1/contacts/{id}",
1126
+ ...options,
1127
+ headers: {
1128
+ "Content-Type": "application/json",
1129
+ ...options.headers
1130
+ }
1131
+ });
1132
+ }
1133
+ /**
1134
+ * Toggle contact favorite
1135
+ */
1136
+ toggleFavorite(options) {
1137
+ return (options.client ?? this.client).patch({
1138
+ url: "/api/v1/contacts/{id}/favorite",
1139
+ ...options,
1140
+ headers: {
1141
+ "Content-Type": "application/json",
1142
+ ...options.headers
1143
+ }
1144
+ });
1145
+ }
1146
+ /**
1147
+ * List integration-linked fields for a contact
1148
+ */
1149
+ listIntegrationFields(options) {
1150
+ return (options.client ?? this.client).get({ url: "/api/v1/contacts/{id}/integration-fields", ...options });
1151
+ }
1152
+ /**
1153
+ * Create or update an integration-linked field on a contact
1154
+ */
1155
+ upsertIntegrationField(options) {
1156
+ return (options.client ?? this.client).put({
1157
+ url: "/api/v1/contacts/{id}/integration-fields",
1158
+ ...options,
1159
+ headers: {
1160
+ "Content-Type": "application/json",
1161
+ ...options.headers
1162
+ }
1163
+ });
1164
+ }
1165
+ /**
1166
+ * Remove an integration-linked field from a contact
1167
+ */
1168
+ deleteIntegrationField(options) {
1169
+ return (options.client ?? this.client).delete({ url: "/api/v1/contacts/{id}/integration-fields/{app_id}/{field_key}", ...options });
1170
+ }
1171
+ };
1172
+ var Credentials = class extends HeyApiClient {
1173
+ /**
1174
+ * List machine credentials
1175
+ */
1176
+ list(options) {
1177
+ return (options?.client ?? this.client).get({ url: "/api/v1/credentials", ...options });
1178
+ }
1179
+ /**
1180
+ * Create a machine credential
1181
+ */
1182
+ create(options) {
1183
+ return (options.client ?? this.client).post({
1184
+ url: "/api/v1/credentials",
1185
+ ...options,
1186
+ headers: {
1187
+ "Content-Type": "application/json",
1188
+ ...options.headers
1189
+ }
1190
+ });
1191
+ }
1192
+ /**
1193
+ * Revoke a machine credential
1194
+ */
1195
+ revoke(options) {
1196
+ return (options.client ?? this.client).delete({ url: "/api/v1/credentials/{id}", ...options });
1197
+ }
1198
+ /**
1199
+ * Get a machine credential
1200
+ */
1201
+ get(options) {
1202
+ return (options.client ?? this.client).get({ url: "/api/v1/credentials/{id}", ...options });
1203
+ }
1204
+ };
1205
+ var Events = class extends HeyApiClient {
1206
+ /**
1207
+ * List events
1208
+ */
1209
+ list(options) {
1210
+ return (options?.client ?? this.client).get({ url: "/api/v1/events", ...options });
1211
+ }
1212
+ /**
1213
+ * Create an event
1214
+ */
1215
+ create(options) {
1216
+ return (options.client ?? this.client).post({
1217
+ url: "/api/v1/events",
1218
+ ...options,
1219
+ headers: {
1220
+ "Content-Type": "application/json",
1221
+ ...options.headers
1222
+ }
1223
+ });
1224
+ }
1225
+ /**
1226
+ * List events overlapping a date range (calendar view)
1227
+ */
1228
+ calendar(options) {
1229
+ return (options.client ?? this.client).get({ url: "/api/v1/events/calendar", ...options });
1230
+ }
1231
+ /**
1232
+ * List all assignable event manager permissions
1233
+ */
1234
+ managerPermissions(options) {
1235
+ return (options?.client ?? this.client).get({ url: "/api/v1/events/manager-permissions", ...options });
1236
+ }
1237
+ /**
1238
+ * Accept an event manager invite via token
1239
+ */
1240
+ acceptManagerInvite(options) {
1241
+ return (options.client ?? this.client).post({
1242
+ url: "/api/v1/events/managers/accept",
1243
+ ...options,
1244
+ headers: {
1245
+ "Content-Type": "application/json",
1246
+ ...options.headers
1247
+ }
1248
+ });
1249
+ }
1250
+ /**
1251
+ * List pending event manager invites for the current user
1252
+ */
1253
+ listPendingManagerInvites(options) {
1254
+ return (options?.client ?? this.client).get({ url: "/api/v1/events/managers/pending", ...options });
1255
+ }
1256
+ /**
1257
+ * Create an event and optionally a recurring series in one atomic call
1258
+ *
1259
+ * If series.freq is provided the event is converted into the anchor of a new recurring series. On series creation failure the event is rolled back.
1260
+ */
1261
+ createWithSeries(options) {
1262
+ return (options.client ?? this.client).post({
1263
+ url: "/api/v1/events/with-series",
1264
+ ...options,
1265
+ headers: {
1266
+ "Content-Type": "application/json",
1267
+ ...options.headers
1268
+ }
1269
+ });
1270
+ }
1271
+ /**
1272
+ * Delete an event
1273
+ */
1274
+ delete(options) {
1275
+ return (options.client ?? this.client).delete({ url: "/api/v1/events/{id}", ...options });
1276
+ }
1277
+ /**
1278
+ * Get an event
1279
+ */
1280
+ get(options) {
1281
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}", ...options });
1282
+ }
1283
+ /**
1284
+ * Partial-update an event (merge-patch)
1285
+ *
1286
+ * Updates only the fields present in the request body. Absent fields are left unchanged. Allows individual form sections to auto-save without submitting the full event payload.
1287
+ */
1288
+ patch(options) {
1289
+ return (options.client ?? this.client).patch({
1290
+ url: "/api/v1/events/{id}",
1291
+ ...options,
1292
+ headers: {
1293
+ "Content-Type": "application/json",
1294
+ ...options.headers
1295
+ }
1296
+ });
1297
+ }
1298
+ /**
1299
+ * Update an event
1300
+ */
1301
+ update(options) {
1302
+ return (options.client ?? this.client).put({
1303
+ url: "/api/v1/events/{id}",
1304
+ ...options,
1305
+ headers: {
1306
+ "Content-Type": "application/json",
1307
+ ...options.headers
1308
+ }
1309
+ });
1310
+ }
1311
+ /**
1312
+ * Archive an event
1313
+ */
1314
+ archive(options) {
1315
+ return (options.client ?? this.client).post({ url: "/api/v1/events/{id}/archive", ...options });
1316
+ }
1317
+ /**
1318
+ * List event attendees
1319
+ */
1320
+ listAttendees(options) {
1321
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/attendees", ...options });
1322
+ }
1323
+ /**
1324
+ * Add an attendee to an event
1325
+ */
1326
+ addAttendee(options) {
1327
+ return (options.client ?? this.client).post({
1328
+ url: "/api/v1/events/{id}/attendees",
1329
+ ...options,
1330
+ headers: {
1331
+ "Content-Type": "application/json",
1332
+ ...options.headers
1333
+ }
1334
+ });
1335
+ }
1336
+ /**
1337
+ * Bulk remove attendees from an event
1338
+ */
1339
+ bulkRemoveAttendees(options) {
1340
+ return (options.client ?? this.client).delete({
1341
+ url: "/api/v1/events/{id}/attendees/bulk",
1342
+ ...options,
1343
+ headers: {
1344
+ "Content-Type": "application/json",
1345
+ ...options.headers
1346
+ }
1347
+ });
1348
+ }
1349
+ /**
1350
+ * Bulk add attendees to an event
1351
+ */
1352
+ bulkAddAttendees(options) {
1353
+ return (options.client ?? this.client).post({
1354
+ url: "/api/v1/events/{id}/attendees/bulk",
1355
+ ...options,
1356
+ headers: {
1357
+ "Content-Type": "application/json",
1358
+ ...options.headers
1359
+ }
1360
+ });
1361
+ }
1362
+ /**
1363
+ * Bulk update attendee statuses
1364
+ */
1365
+ bulkUpdateAttendeeStatus(options) {
1366
+ return (options.client ?? this.client).patch({
1367
+ url: "/api/v1/events/{id}/attendees/bulk/status",
1368
+ ...options,
1369
+ headers: {
1370
+ "Content-Type": "application/json",
1371
+ ...options.headers
1372
+ }
1373
+ });
1374
+ }
1375
+ /**
1376
+ * Remove an attendee from an event
1377
+ */
1378
+ removeAttendee(options) {
1379
+ return (options.client ?? this.client).delete({ url: "/api/v1/events/{id}/attendees/{contact_id}", ...options });
1380
+ }
1381
+ /**
1382
+ * Update attendee status
1383
+ */
1384
+ updateAttendeeStatus(options) {
1385
+ return (options.client ?? this.client).patch({
1386
+ url: "/api/v1/events/{id}/attendees/{contact_id}",
1387
+ ...options,
1388
+ headers: {
1389
+ "Content-Type": "application/json",
1390
+ ...options.headers
1391
+ }
1392
+ });
1393
+ }
1394
+ /**
1395
+ * Check in an attendee
1396
+ */
1397
+ checkInAttendee(options) {
1398
+ return (options.client ?? this.client).post({
1399
+ url: "/api/v1/events/{id}/attendees/{contact_id}/check-in",
1400
+ ...options,
1401
+ headers: {
1402
+ "Content-Type": "application/json",
1403
+ ...options.headers
1404
+ }
1405
+ });
1406
+ }
1407
+ /**
1408
+ * List automations attached to an event
1409
+ */
1410
+ listAutomations(options) {
1411
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/automations", ...options });
1412
+ }
1413
+ /**
1414
+ * Create an automation attached to an event
1415
+ */
1416
+ createAutomation(options) {
1417
+ return (options.client ?? this.client).post({
1418
+ url: "/api/v1/events/{id}/automations",
1419
+ ...options,
1420
+ headers: {
1421
+ "Content-Type": "application/json",
1422
+ ...options.headers
1423
+ }
1424
+ });
1425
+ }
1426
+ /**
1427
+ * List event automation templates
1428
+ */
1429
+ automationTemplates(options) {
1430
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/automations/templates", ...options });
1431
+ }
1432
+ /**
1433
+ * Delete an event automation
1434
+ */
1435
+ deleteAutomation(options) {
1436
+ return (options.client ?? this.client).delete({ url: "/api/v1/events/{id}/automations/{rule_id}", ...options });
1437
+ }
1438
+ /**
1439
+ * Get an event automation
1440
+ */
1441
+ getAutomation(options) {
1442
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/automations/{rule_id}", ...options });
1443
+ }
1444
+ /**
1445
+ * Update an event automation
1446
+ */
1447
+ updateAutomation(options) {
1448
+ return (options.client ?? this.client).put({
1449
+ url: "/api/v1/events/{id}/automations/{rule_id}",
1450
+ ...options,
1451
+ headers: {
1452
+ "Content-Type": "application/json",
1453
+ ...options.headers
1454
+ }
1455
+ });
1456
+ }
1457
+ /**
1458
+ * Run an event automation now
1459
+ */
1460
+ executeAutomation(options) {
1461
+ return (options.client ?? this.client).post({ url: "/api/v1/events/{id}/automations/{rule_id}/execute", ...options });
1462
+ }
1463
+ /**
1464
+ * List execution history for an event automation
1465
+ */
1466
+ listAutomationExecutions(options) {
1467
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/automations/{rule_id}/executions", ...options });
1468
+ }
1469
+ /**
1470
+ * Upload event cover image (multipart/form-data, field: file)
1471
+ */
1472
+ uploadCover(options) {
1473
+ return (options.client ?? this.client).put({
1474
+ bodySerializer: null,
1475
+ url: "/api/v1/events/{id}/cover",
1476
+ ...options,
1477
+ headers: {
1478
+ "Content-Type": "application/octet-stream",
1479
+ ...options.headers
1480
+ }
1481
+ });
1482
+ }
1483
+ /**
1484
+ * Discard draft, keep published version
1485
+ */
1486
+ discard(options) {
1487
+ return (options.client ?? this.client).post({ url: "/api/v1/events/{id}/discard", ...options });
1488
+ }
1489
+ /**
1490
+ * List documents linked to an event
1491
+ */
1492
+ listDocuments(options) {
1493
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/documents", ...options });
1494
+ }
1495
+ /**
1496
+ * Unlink a document from an event
1497
+ */
1498
+ removeDocument(options) {
1499
+ return (options.client ?? this.client).delete({ url: "/api/v1/events/{id}/documents/{document_id}", ...options });
1500
+ }
1501
+ /**
1502
+ * Link a document to an event
1503
+ */
1504
+ addDocument(options) {
1505
+ return (options.client ?? this.client).post({
1506
+ url: "/api/v1/events/{id}/documents/{document_id}",
1507
+ ...options,
1508
+ headers: {
1509
+ "Content-Type": "application/json",
1510
+ ...options.headers
1511
+ }
1512
+ });
1513
+ }
1514
+ /**
1515
+ * Get draft version of an event
1516
+ */
1517
+ getDraft(options) {
1518
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/draft", ...options });
1519
+ }
1520
+ /**
1521
+ * Start editing (creates draft clone)
1522
+ */
1523
+ startEdit(options) {
1524
+ return (options.client ?? this.client).post({ url: "/api/v1/events/{id}/edit", ...options });
1525
+ }
1526
+ /**
1527
+ * List cross-reference links for this event
1528
+ */
1529
+ listLinks(options) {
1530
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/links", ...options });
1531
+ }
1532
+ /**
1533
+ * Link another event as a cross-reference
1534
+ */
1535
+ addLink(options) {
1536
+ return (options.client ?? this.client).post({
1537
+ url: "/api/v1/events/{id}/links",
1538
+ ...options,
1539
+ headers: {
1540
+ "Content-Type": "application/json",
1541
+ ...options.headers
1542
+ }
1543
+ });
1544
+ }
1545
+ /**
1546
+ * Remove a cross-reference link
1547
+ */
1548
+ removeLink(options) {
1549
+ return (options.client ?? this.client).delete({ url: "/api/v1/events/{id}/links/{target_id}", ...options });
1550
+ }
1551
+ /**
1552
+ * List managers for an event
1553
+ */
1554
+ listManagers(options) {
1555
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/managers", ...options });
1556
+ }
1557
+ /**
1558
+ * Add a manager to an event
1559
+ */
1560
+ addManager(options) {
1561
+ return (options.client ?? this.client).post({
1562
+ url: "/api/v1/events/{id}/managers",
1563
+ ...options,
1564
+ headers: {
1565
+ "Content-Type": "application/json",
1566
+ ...options.headers
1567
+ }
1568
+ });
1569
+ }
1570
+ /**
1571
+ * Invite a manager to an event by email
1572
+ */
1573
+ inviteManager(options) {
1574
+ return (options.client ?? this.client).post({
1575
+ url: "/api/v1/events/{id}/managers/invite",
1576
+ ...options,
1577
+ headers: {
1578
+ "Content-Type": "application/json",
1579
+ ...options.headers
1580
+ }
1581
+ });
1582
+ }
1583
+ /**
1584
+ * Remove a manager from an event
1585
+ */
1586
+ removeManager(options) {
1587
+ return (options.client ?? this.client).delete({ url: "/api/v1/events/{id}/managers/{user_id}", ...options });
1588
+ }
1589
+ /**
1590
+ * Get a single event manager
1591
+ */
1592
+ getManager(options) {
1593
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/managers/{user_id}", ...options });
1594
+ }
1595
+ /**
1596
+ * Update an event manager's permissions
1597
+ */
1598
+ updateManager(options) {
1599
+ return (options.client ?? this.client).put({
1600
+ url: "/api/v1/events/{id}/managers/{user_id}",
1601
+ ...options,
1602
+ headers: {
1603
+ "Content-Type": "application/json",
1604
+ ...options.headers
1605
+ }
1606
+ });
1607
+ }
1608
+ /**
1609
+ * List milestones for an event
1610
+ */
1611
+ listMilestones(options) {
1612
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/milestones", ...options });
1613
+ }
1614
+ /**
1615
+ * Add a milestone event to a base event
1616
+ */
1617
+ addMilestone(options) {
1618
+ return (options.client ?? this.client).post({
1619
+ url: "/api/v1/events/{id}/milestones",
1620
+ ...options,
1621
+ headers: {
1622
+ "Content-Type": "application/json",
1623
+ ...options.headers
1624
+ }
1625
+ });
1626
+ }
1627
+ /**
1628
+ * Remove a milestone from an event
1629
+ */
1630
+ removeMilestone(options) {
1631
+ return (options.client ?? this.client).delete({ url: "/api/v1/events/{id}/milestones/{milestone_event_id}", ...options });
1632
+ }
1633
+ /**
1634
+ * Update milestone lifecycle status or reset to automatic mode
1635
+ */
1636
+ patchMilestoneLifecycle(options) {
1637
+ return (options.client ?? this.client).patch({
1638
+ url: "/api/v1/events/{id}/milestones/{milestone_event_id}",
1639
+ ...options,
1640
+ headers: {
1641
+ "Content-Type": "application/json",
1642
+ ...options.headers
1643
+ }
1644
+ });
1645
+ }
1646
+ /**
1647
+ * Update milestone sequence
1648
+ */
1649
+ updateMilestone(options) {
1650
+ return (options.client ?? this.client).put({
1651
+ url: "/api/v1/events/{id}/milestones/{milestone_event_id}",
1652
+ ...options,
1653
+ headers: {
1654
+ "Content-Type": "application/json",
1655
+ ...options.headers
1656
+ }
1657
+ });
1658
+ }
1659
+ /**
1660
+ * Publish an event
1661
+ *
1662
+ * Publishes a new draft or promotes the current draft changes for a published event. Optionally sends a notification to the creator by providing a JSON body with notification options.
1663
+ */
1664
+ publish(options) {
1665
+ return (options.client ?? this.client).post({
1666
+ url: "/api/v1/events/{id}/publish",
1667
+ ...options,
1668
+ headers: {
1669
+ "Content-Type": "application/json",
1670
+ ...options.headers
1671
+ }
1672
+ });
1673
+ }
1674
+ /**
1675
+ * Remove from series (scope: this | future | all)
1676
+ */
1677
+ deleteSeries(options) {
1678
+ return (options.client ?? this.client).delete({ url: "/api/v1/events/{id}/series", ...options });
1679
+ }
1680
+ /**
1681
+ * Get series rule and all occurrences for a recurring event
1682
+ */
1683
+ getSeries(options) {
1684
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/series", ...options });
1685
+ }
1686
+ /**
1687
+ * Update series fields. Cascades to occurrences without overrides.
1688
+ */
1689
+ patchSeries(options) {
1690
+ return (options.client ?? this.client).patch({
1691
+ url: "/api/v1/events/{id}/series",
1692
+ ...options,
1693
+ headers: {
1694
+ "Content-Type": "application/json",
1695
+ ...options.headers
1696
+ }
1697
+ });
1698
+ }
1699
+ /**
1700
+ * Convert an event into the anchor of a new recurring series
1701
+ */
1702
+ createSeries(options) {
1703
+ return (options.client ?? this.client).post({
1704
+ url: "/api/v1/events/{id}/series",
1705
+ ...options,
1706
+ headers: {
1707
+ "Content-Type": "application/json",
1708
+ ...options.headers
1709
+ }
1710
+ });
1711
+ }
1712
+ /**
1713
+ * Invite series manager
1714
+ *
1715
+ * Invites a user as series manager by email. Only the series owner can do this.
1716
+ */
1717
+ inviteSeriesManager(options) {
1718
+ return (options.client ?? this.client).post({
1719
+ url: "/api/v1/events/{id}/series/manager",
1720
+ ...options,
1721
+ headers: {
1722
+ "Content-Type": "application/json",
1723
+ ...options.headers
1724
+ }
1725
+ });
1726
+ }
1727
+ /**
1728
+ * List occurrences of the series this event belongs to (paginated)
1729
+ */
1730
+ listOccurrences(options) {
1731
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/series/occurrences", ...options });
1732
+ }
1733
+ /**
1734
+ * Publish series
1735
+ *
1736
+ * Publishes a series and all its occurrences. Optionally sends a notification to attendees.
1737
+ */
1738
+ publishSeries(options) {
1739
+ return (options.client ?? this.client).post({
1740
+ url: "/api/v1/events/{id}/series/publish",
1741
+ ...options,
1742
+ headers: {
1743
+ "Content-Type": "application/json",
1744
+ ...options.headers
1745
+ }
1746
+ });
1747
+ }
1748
+ /**
1749
+ * List spaces this event belongs to
1750
+ */
1751
+ listSpaces(options) {
1752
+ return (options.client ?? this.client).get({ url: "/api/v1/events/{id}/spaces", ...options });
1753
+ }
1754
+ /**
1755
+ * Add event to a space
1756
+ */
1757
+ addSpace(options) {
1758
+ return (options.client ?? this.client).post({
1759
+ url: "/api/v1/events/{id}/spaces",
1760
+ ...options,
1761
+ headers: {
1762
+ "Content-Type": "application/json",
1763
+ ...options.headers
1764
+ }
1765
+ });
1766
+ }
1767
+ /**
1768
+ * Remove event from a space
1769
+ */
1770
+ removeSpace(options) {
1771
+ return (options.client ?? this.client).delete({ url: "/api/v1/events/{id}/spaces/{space_id}", ...options });
1772
+ }
1773
+ };
1774
+ var Zitadel = class extends HeyApiClient {
1775
+ /**
1776
+ * Zitadel event webhook
1777
+ *
1778
+ * Receives Zitadel Actions v2 lifecycle events (user.human.added, user.removed, …). Secured by HMAC-SHA256 (ZITADEL-Signature header). Excluded from OIDC and tenant middleware — authentication is the signature itself.
1779
+ */
1780
+ webhook(options) {
1781
+ return (options.client ?? this.client).post({
1782
+ bodySerializer: null,
1783
+ url: "/api/v1/integrations/zitadel/webhook",
1784
+ ...options,
1785
+ headers: {
1786
+ "Content-Type": "application/octet-stream",
1787
+ ...options.headers
1788
+ }
1789
+ });
1790
+ }
1791
+ };
1792
+ var Integrations = class extends HeyApiClient {
1793
+ get zitadel() {
1794
+ return this._zitadel ?? (this._zitadel = new Zitadel({ client: this.client }));
1795
+ }
1796
+ };
1797
+ var Invites = class extends HeyApiClient {
1798
+ /**
1799
+ * List pending invites
1800
+ */
1801
+ list(options) {
1802
+ return (options.client ?? this.client).get({ url: "/api/v1/organizations/{id}/invites", ...options });
1803
+ }
1804
+ /**
1805
+ * Send an invite
1806
+ */
1807
+ create(options) {
1808
+ return (options.client ?? this.client).post({
1809
+ url: "/api/v1/organizations/{id}/invites",
1810
+ ...options,
1811
+ headers: {
1812
+ "Content-Type": "application/json",
1813
+ ...options.headers
1814
+ }
1815
+ });
1816
+ }
1817
+ /**
1818
+ * Revoke an invite
1819
+ */
1820
+ delete(options) {
1821
+ return (options.client ?? this.client).delete({ url: "/api/v1/organizations/{id}/invites/{inviteId}", ...options });
1822
+ }
1823
+ };
1824
+ var Organizations = class extends HeyApiClient {
1825
+ /**
1826
+ * List user's organizations
1827
+ */
1828
+ list(options) {
1829
+ return (options?.client ?? this.client).get({ url: "/api/v1/organizations", ...options });
1830
+ }
1831
+ /**
1832
+ * Create an organization
1833
+ */
1834
+ create(options) {
1835
+ return (options.client ?? this.client).post({
1836
+ url: "/api/v1/organizations",
1837
+ ...options,
1838
+ headers: {
1839
+ "Content-Type": "application/json",
1840
+ ...options.headers
1841
+ }
1842
+ });
1843
+ }
1844
+ /**
1845
+ * Archive (soft-delete) an organization
1846
+ */
1847
+ archive(options) {
1848
+ return (options.client ?? this.client).delete({ url: "/api/v1/organizations/{id}", ...options });
1849
+ }
1850
+ /**
1851
+ * Get an organization
1852
+ */
1853
+ get(options) {
1854
+ return (options.client ?? this.client).get({ url: "/api/v1/organizations/{id}", ...options });
1855
+ }
1856
+ /**
1857
+ * Update an organization
1858
+ */
1859
+ update(options) {
1860
+ return (options.client ?? this.client).put({
1861
+ url: "/api/v1/organizations/{id}",
1862
+ ...options,
1863
+ headers: {
1864
+ "Content-Type": "application/json",
1865
+ ...options.headers
1866
+ }
1867
+ });
1868
+ }
1869
+ get invites() {
1870
+ return this._invites ?? (this._invites = new Invites({ client: this.client }));
1871
+ }
1872
+ };
1873
+ var Permissions = class extends HeyApiClient {
1874
+ /**
1875
+ * List all assignable role bundles
1876
+ *
1877
+ * Returns every role bundle (org / event_manager / space_manager / token) with its permissions. UI uses this to render permission/bundle pickers without hardcoding lists.
1878
+ */
1879
+ listRoles(options) {
1880
+ return (options?.client ?? this.client).get({ url: "/api/v1/permissions/roles", ...options });
1881
+ }
1882
+ };
1883
+ var Places = class extends HeyApiClient {
1884
+ /**
1885
+ * List places
1886
+ */
1887
+ list(options) {
1888
+ return (options?.client ?? this.client).get({ url: "/api/v1/places", ...options });
1889
+ }
1890
+ /**
1891
+ * Create a place
1892
+ */
1893
+ create(options) {
1894
+ return (options.client ?? this.client).post({
1895
+ url: "/api/v1/places",
1896
+ ...options,
1897
+ headers: {
1898
+ "Content-Type": "application/json",
1899
+ ...options.headers
1900
+ }
1901
+ });
1902
+ }
1903
+ /**
1904
+ * Delete a place
1905
+ */
1906
+ delete(options) {
1907
+ return (options.client ?? this.client).delete({ url: "/api/v1/places/{id}", ...options });
1908
+ }
1909
+ /**
1910
+ * Get a place
1911
+ */
1912
+ get(options) {
1913
+ return (options.client ?? this.client).get({ url: "/api/v1/places/{id}", ...options });
1914
+ }
1915
+ /**
1916
+ * Update a place
1917
+ */
1918
+ update(options) {
1919
+ return (options.client ?? this.client).put({
1920
+ url: "/api/v1/places/{id}",
1921
+ ...options,
1922
+ headers: {
1923
+ "Content-Type": "application/json",
1924
+ ...options.headers
1925
+ }
1926
+ });
1927
+ }
1928
+ /**
1929
+ * Archive a place
1930
+ */
1931
+ archive(options) {
1932
+ return (options.client ?? this.client).patch({ url: "/api/v1/places/{id}/archive", ...options });
1933
+ }
1934
+ /**
1935
+ * Publish a place
1936
+ */
1937
+ publish(options) {
1938
+ return (options.client ?? this.client).patch({ url: "/api/v1/places/{id}/publish", ...options });
1939
+ }
1940
+ };
1941
+ var Me = class extends HeyApiClient {
1942
+ /**
1943
+ * Get own profile
1944
+ */
1945
+ get(options) {
1946
+ return (options?.client ?? this.client).get({ url: "/api/v1/profiles/me", ...options });
1947
+ }
1948
+ /**
1949
+ * Update own profile
1950
+ */
1951
+ update(options) {
1952
+ return (options.client ?? this.client).put({
1953
+ url: "/api/v1/profiles/me",
1954
+ ...options,
1955
+ headers: {
1956
+ "Content-Type": "application/json",
1957
+ ...options.headers
1958
+ }
1959
+ });
1960
+ }
1961
+ /**
1962
+ * Accept terms of service
1963
+ */
1964
+ acceptTerms(options) {
1965
+ return (options?.client ?? this.client).post({ url: "/api/v1/profiles/me/terms", ...options });
1966
+ }
1967
+ };
1968
+ var Profiles = class extends HeyApiClient {
1969
+ /**
1970
+ * List all profiles (admin only)
1971
+ */
1972
+ list(options) {
1973
+ return (options?.client ?? this.client).get({ url: "/api/v1/profiles", ...options });
1974
+ }
1975
+ /**
1976
+ * Search profiles by username or email
1977
+ */
1978
+ search(options) {
1979
+ return (options?.client ?? this.client).get({ url: "/api/v1/profiles/search", ...options });
1980
+ }
1981
+ /**
1982
+ * Get a profile by ID
1983
+ */
1984
+ get(options) {
1985
+ return (options.client ?? this.client).get({ url: "/api/v1/profiles/{id}", ...options });
1986
+ }
1987
+ get me() {
1988
+ return this._me ?? (this._me = new Me({ client: this.client }));
1989
+ }
1990
+ };
1991
+ var Announcements2 = class extends HeyApiClient {
1992
+ /**
1993
+ * List public announcements
1994
+ *
1995
+ * Returns published announcements from all spaces that the owning organisation has made publicly visible. No authentication required.
1996
+ */
1997
+ list(options) {
1998
+ return (options?.client ?? this.client).get({ url: "/api/v1/public/announcements", ...options });
1999
+ }
2000
+ };
2001
+ var Events2 = class extends HeyApiClient {
2002
+ /**
2003
+ * List public events
2004
+ *
2005
+ * Returns published events that the owning organisation has made publicly visible. No authentication required.
2006
+ */
2007
+ list(options) {
2008
+ return (options?.client ?? this.client).get({ url: "/api/v1/public/events", ...options });
2009
+ }
2010
+ /**
2011
+ * Get a public event
2012
+ *
2013
+ * Returns a single published public event. Returns 404 if the event is not found or is not publicly visible.
2014
+ */
2015
+ get(options) {
2016
+ return (options.client ?? this.client).get({ url: "/api/v1/public/events/{id}", ...options });
2017
+ }
2018
+ };
2019
+ var Spaces = class extends HeyApiClient {
2020
+ /**
2021
+ * List public spaces
2022
+ *
2023
+ * Returns published spaces that the owning organisation has made publicly visible. No authentication required.
2024
+ */
2025
+ list(options) {
2026
+ return (options?.client ?? this.client).get({ url: "/api/v1/public/spaces", ...options });
2027
+ }
2028
+ /**
2029
+ * Get public spaces as a hierarchical tree
2030
+ *
2031
+ * Returns all publicly visible spaces (visibility=40, status=published) arranged as a multi-root hierarchy. No authentication required. Use this to render collapsible space filter UIs.
2032
+ */
2033
+ tree(options) {
2034
+ return (options?.client ?? this.client).get({ url: "/api/v1/public/spaces/tree", ...options });
2035
+ }
2036
+ /**
2037
+ * Get a public space
2038
+ *
2039
+ * Returns the public live-space page payload. Returns 404 if the space is not found or is not publicly visible.
2040
+ */
2041
+ get(options) {
2042
+ return (options.client ?? this.client).get({ url: "/api/v1/public/spaces/{id}", ...options });
2043
+ }
2044
+ };
2045
+ var Public = class extends HeyApiClient {
2046
+ get announcements() {
2047
+ return this._announcements ?? (this._announcements = new Announcements2({ client: this.client }));
2048
+ }
2049
+ get events() {
2050
+ return this._events ?? (this._events = new Events2({ client: this.client }));
2051
+ }
2052
+ get spaces() {
2053
+ return this._spaces ?? (this._spaces = new Spaces({ client: this.client }));
2054
+ }
2055
+ };
2056
+ var Series = class extends HeyApiClient {
2057
+ /**
2058
+ * Accept series manager invite
2059
+ *
2060
+ * Accepts a pending series manager invite by token.
2061
+ */
2062
+ acceptManagerInvite(options) {
2063
+ return (options.client ?? this.client).post({
2064
+ url: "/api/v1/series/accept-manager-invite",
2065
+ ...options,
2066
+ headers: {
2067
+ "Content-Type": "application/json",
2068
+ ...options.headers
2069
+ }
2070
+ });
2071
+ }
2072
+ /**
2073
+ * List pending series manager invites
2074
+ *
2075
+ * Lists pending series manager invites for the current user.
2076
+ */
2077
+ listPendingManagerInvites(options) {
2078
+ return (options?.client ?? this.client).get({ url: "/api/v1/series/pending-manager-invites", ...options });
2079
+ }
2080
+ /**
2081
+ * Get series by ID with all occurrences
2082
+ */
2083
+ getById(options) {
2084
+ return (options.client ?? this.client).get({ url: "/api/v1/series/{id}", ...options });
2085
+ }
2086
+ /**
2087
+ * List series attendees
2088
+ */
2089
+ listAttendees(options) {
2090
+ return (options.client ?? this.client).get({ url: "/api/v1/series/{id}/attendees", ...options });
2091
+ }
2092
+ /**
2093
+ * Add attendee to series
2094
+ */
2095
+ addAttendee(options) {
2096
+ return (options.client ?? this.client).post({
2097
+ url: "/api/v1/series/{id}/attendees",
2098
+ ...options,
2099
+ headers: {
2100
+ "Content-Type": "application/json",
2101
+ ...options.headers
2102
+ }
2103
+ });
2104
+ }
2105
+ /**
2106
+ * Bulk add attendees to series
2107
+ */
2108
+ bulkAddAttendees(options) {
2109
+ return (options.client ?? this.client).post({
2110
+ url: "/api/v1/series/{id}/attendees/bulk",
2111
+ ...options,
2112
+ headers: {
2113
+ "Content-Type": "application/json",
2114
+ ...options.headers
2115
+ }
2116
+ });
2117
+ }
2118
+ /**
2119
+ * Remove attendee from series
2120
+ */
2121
+ removeAttendee(options) {
2122
+ return (options.client ?? this.client).delete({ url: "/api/v1/series/{id}/attendees/{contact_id}", ...options });
2123
+ }
2124
+ /**
2125
+ * Update series attendee status
2126
+ */
2127
+ updateAttendeeStatus(options) {
2128
+ return (options.client ?? this.client).patch({
2129
+ url: "/api/v1/series/{id}/attendees/{contact_id}",
2130
+ ...options,
2131
+ headers: {
2132
+ "Content-Type": "application/json",
2133
+ ...options.headers
2134
+ }
2135
+ });
2136
+ }
2137
+ /**
2138
+ * Check in a series attendee
2139
+ */
2140
+ checkInAttendee(options) {
2141
+ return (options.client ?? this.client).post({
2142
+ url: "/api/v1/series/{id}/attendees/{contact_id}/check-in",
2143
+ ...options,
2144
+ headers: {
2145
+ "Content-Type": "application/json",
2146
+ ...options.headers
2147
+ }
2148
+ });
2149
+ }
2150
+ /**
2151
+ * List documents linked to series
2152
+ */
2153
+ listDocuments(options) {
2154
+ return (options.client ?? this.client).get({ url: "/api/v1/series/{id}/documents", ...options });
2155
+ }
2156
+ /**
2157
+ * Unlink document from series
2158
+ */
2159
+ removeDocument(options) {
2160
+ return (options.client ?? this.client).delete({ url: "/api/v1/series/{id}/documents/{document_id}", ...options });
2161
+ }
2162
+ /**
2163
+ * Link document to series
2164
+ */
2165
+ addDocument(options) {
2166
+ return (options.client ?? this.client).post({
2167
+ url: "/api/v1/series/{id}/documents/{document_id}",
2168
+ ...options,
2169
+ headers: {
2170
+ "Content-Type": "application/json",
2171
+ ...options.headers
2172
+ }
2173
+ });
2174
+ }
2175
+ /**
2176
+ * List cross-reference links for series
2177
+ */
2178
+ listLinks(options) {
2179
+ return (options.client ?? this.client).get({ url: "/api/v1/series/{id}/links", ...options });
2180
+ }
2181
+ /**
2182
+ * Link event to series
2183
+ */
2184
+ addLink(options) {
2185
+ return (options.client ?? this.client).post({
2186
+ url: "/api/v1/series/{id}/links",
2187
+ ...options,
2188
+ headers: {
2189
+ "Content-Type": "application/json",
2190
+ ...options.headers
2191
+ }
2192
+ });
2193
+ }
2194
+ /**
2195
+ * Remove cross-reference link from series
2196
+ */
2197
+ removeLink(options) {
2198
+ return (options.client ?? this.client).delete({ url: "/api/v1/series/{id}/links/{target_id}", ...options });
2199
+ }
2200
+ /**
2201
+ * List series milestones
2202
+ */
2203
+ listMilestones(options) {
2204
+ return (options.client ?? this.client).get({ url: "/api/v1/series/{id}/milestones", ...options });
2205
+ }
2206
+ /**
2207
+ * Add milestone to series
2208
+ */
2209
+ addMilestone(options) {
2210
+ return (options.client ?? this.client).post({
2211
+ url: "/api/v1/series/{id}/milestones",
2212
+ ...options,
2213
+ headers: {
2214
+ "Content-Type": "application/json",
2215
+ ...options.headers
2216
+ }
2217
+ });
2218
+ }
2219
+ /**
2220
+ * Remove milestone from series
2221
+ */
2222
+ removeMilestone(options) {
2223
+ return (options.client ?? this.client).delete({ url: "/api/v1/series/{id}/milestones/{milestone_event_id}", ...options });
2224
+ }
2225
+ /**
2226
+ * Update series milestone lifecycle
2227
+ */
2228
+ patchMilestoneLifecycle(options) {
2229
+ return (options.client ?? this.client).patch({
2230
+ url: "/api/v1/series/{id}/milestones/{milestone_event_id}",
2231
+ ...options,
2232
+ headers: {
2233
+ "Content-Type": "application/json",
2234
+ ...options.headers
2235
+ }
2236
+ });
2237
+ }
2238
+ /**
2239
+ * Update series milestone sequence
2240
+ */
2241
+ updateMilestone(options) {
2242
+ return (options.client ?? this.client).put({
2243
+ url: "/api/v1/series/{id}/milestones/{milestone_event_id}",
2244
+ ...options,
2245
+ headers: {
2246
+ "Content-Type": "application/json",
2247
+ ...options.headers
2248
+ }
2249
+ });
2250
+ }
2251
+ };
2252
+ var Spaces2 = class extends HeyApiClient {
2253
+ /**
2254
+ * List spaces
2255
+ */
2256
+ list(options) {
2257
+ return (options?.client ?? this.client).get({ url: "/api/v1/spaces", ...options });
2258
+ }
2259
+ /**
2260
+ * Create a space
2261
+ */
2262
+ create(options) {
2263
+ return (options.client ?? this.client).post({
2264
+ url: "/api/v1/spaces",
2265
+ ...options,
2266
+ headers: {
2267
+ "Content-Type": "application/json",
2268
+ ...options.headers
2269
+ }
2270
+ });
2271
+ }
2272
+ /**
2273
+ * List all assignable space manager permissions
2274
+ */
2275
+ managerPermissions(options) {
2276
+ return (options?.client ?? this.client).get({ url: "/api/v1/spaces/manager-permissions", ...options });
2277
+ }
2278
+ /**
2279
+ * Accept a space manager invitation
2280
+ */
2281
+ acceptManagerInvite(options) {
2282
+ return (options.client ?? this.client).post({
2283
+ url: "/api/v1/spaces/managers/accept",
2284
+ ...options,
2285
+ headers: {
2286
+ "Content-Type": "application/json",
2287
+ ...options.headers
2288
+ }
2289
+ });
2290
+ }
2291
+ /**
2292
+ * List pending space manager invitations for the current user
2293
+ */
2294
+ listPendingManagerInvites(options) {
2295
+ return (options?.client ?? this.client).get({ url: "/api/v1/spaces/managers/pending", ...options });
2296
+ }
2297
+ /**
2298
+ * Get spaces as a hierarchical tree
2299
+ *
2300
+ * Returns all published spaces arranged as a multi-root hierarchy. Each node may have children nested under it. Because spaces support multiple parents, a space can appear under more than one parent node.
2301
+ */
2302
+ tree(options) {
2303
+ return (options?.client ?? this.client).get({ url: "/api/v1/spaces/tree", ...options });
2304
+ }
2305
+ /**
2306
+ * Delete a space
2307
+ */
2308
+ delete(options) {
2309
+ return (options.client ?? this.client).delete({ url: "/api/v1/spaces/{id}", ...options });
2310
+ }
2311
+ /**
2312
+ * Get a space
2313
+ */
2314
+ get(options) {
2315
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}", ...options });
2316
+ }
2317
+ /**
2318
+ * Partially update a space (merge-patch)
2319
+ */
2320
+ patch(options) {
2321
+ return (options.client ?? this.client).patch({
2322
+ url: "/api/v1/spaces/{id}",
2323
+ ...options,
2324
+ headers: {
2325
+ "Content-Type": "application/json",
2326
+ ...options.headers
2327
+ }
2328
+ });
2329
+ }
2330
+ /**
2331
+ * Update a space
2332
+ */
2333
+ update(options) {
2334
+ return (options.client ?? this.client).put({
2335
+ url: "/api/v1/spaces/{id}",
2336
+ ...options,
2337
+ headers: {
2338
+ "Content-Type": "application/json",
2339
+ ...options.headers
2340
+ }
2341
+ });
2342
+ }
2343
+ /**
2344
+ * List recent activity in a space
2345
+ */
2346
+ listActivity(options) {
2347
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/activity", ...options });
2348
+ }
2349
+ /**
2350
+ * List date-paginated activity logs in a space
2351
+ */
2352
+ listActivityLog(options) {
2353
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/activity-log", ...options });
2354
+ }
2355
+ /**
2356
+ * Get analytics for a space
2357
+ */
2358
+ getAnalytics(options) {
2359
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/analytics", ...options });
2360
+ }
2361
+ /**
2362
+ * List announcements in a space
2363
+ */
2364
+ listAnnouncements(options) {
2365
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/announcements", ...options });
2366
+ }
2367
+ /**
2368
+ * Link an announcement to a space
2369
+ */
2370
+ addAnnouncement(options) {
2371
+ return (options.client ?? this.client).post({
2372
+ url: "/api/v1/spaces/{id}/announcements",
2373
+ ...options,
2374
+ headers: {
2375
+ "Content-Type": "application/json",
2376
+ ...options.headers
2377
+ }
2378
+ });
2379
+ }
2380
+ /**
2381
+ * Remove an announcement from a space
2382
+ */
2383
+ removeAnnouncement(options) {
2384
+ return (options.client ?? this.client).delete({ url: "/api/v1/spaces/{id}/announcements/{announcement_id}", ...options });
2385
+ }
2386
+ /**
2387
+ * Archive a space
2388
+ */
2389
+ archive(options) {
2390
+ return (options.client ?? this.client).post({ url: "/api/v1/spaces/{id}/archive", ...options });
2391
+ }
2392
+ /**
2393
+ * List child spaces (sub-spaces) of a space
2394
+ */
2395
+ listChildren(options) {
2396
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/children", ...options });
2397
+ }
2398
+ /**
2399
+ * List contacts in a space
2400
+ */
2401
+ listContacts(options) {
2402
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/contacts", ...options });
2403
+ }
2404
+ /**
2405
+ * Add a contact to a space
2406
+ */
2407
+ addContact(options) {
2408
+ return (options.client ?? this.client).post({
2409
+ url: "/api/v1/spaces/{id}/contacts",
2410
+ ...options,
2411
+ headers: {
2412
+ "Content-Type": "application/json",
2413
+ ...options.headers
2414
+ }
2415
+ });
2416
+ }
2417
+ /**
2418
+ * Remove a contact from a space
2419
+ */
2420
+ removeContact(options) {
2421
+ return (options.client ?? this.client).delete({ url: "/api/v1/spaces/{id}/contacts/{contact_id}", ...options });
2422
+ }
2423
+ /**
2424
+ * Discard draft, keep published version
2425
+ */
2426
+ discard(options) {
2427
+ return (options.client ?? this.client).post({ url: "/api/v1/spaces/{id}/discard", ...options });
2428
+ }
2429
+ /**
2430
+ * Get draft version of a space
2431
+ */
2432
+ getDraft(options) {
2433
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/draft", ...options });
2434
+ }
2435
+ /**
2436
+ * Start editing (creates draft clone)
2437
+ */
2438
+ startEdit(options) {
2439
+ return (options.client ?? this.client).post({ url: "/api/v1/spaces/{id}/edit", ...options });
2440
+ }
2441
+ /**
2442
+ * List events in a space
2443
+ */
2444
+ listEvents(options) {
2445
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/events", ...options });
2446
+ }
2447
+ /**
2448
+ * Add an event to a space
2449
+ */
2450
+ addEvent(options) {
2451
+ return (options.client ?? this.client).post({
2452
+ url: "/api/v1/spaces/{id}/events",
2453
+ ...options,
2454
+ headers: {
2455
+ "Content-Type": "application/json",
2456
+ ...options.headers
2457
+ }
2458
+ });
2459
+ }
2460
+ /**
2461
+ * Remove an event from a space
2462
+ */
2463
+ removeEvent(options) {
2464
+ return (options.client ?? this.client).delete({ url: "/api/v1/spaces/{id}/events/{event_id}", ...options });
2465
+ }
2466
+ /**
2467
+ * List managers for a space
2468
+ */
2469
+ listManagers(options) {
2470
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/managers", ...options });
2471
+ }
2472
+ /**
2473
+ * Add a manager to a space
2474
+ */
2475
+ addManager(options) {
2476
+ return (options.client ?? this.client).post({
2477
+ url: "/api/v1/spaces/{id}/managers",
2478
+ ...options,
2479
+ headers: {
2480
+ "Content-Type": "application/json",
2481
+ ...options.headers
2482
+ }
2483
+ });
2484
+ }
2485
+ /**
2486
+ * Invite a user to become a space manager by email
2487
+ */
2488
+ inviteManager(options) {
2489
+ return (options.client ?? this.client).post({
2490
+ url: "/api/v1/spaces/{id}/managers/invite",
2491
+ ...options,
2492
+ headers: {
2493
+ "Content-Type": "application/json",
2494
+ ...options.headers
2495
+ }
2496
+ });
2497
+ }
2498
+ /**
2499
+ * Remove a manager from a space
2500
+ */
2501
+ removeManager(options) {
2502
+ return (options.client ?? this.client).delete({ url: "/api/v1/spaces/{id}/managers/{user_id}", ...options });
2503
+ }
2504
+ /**
2505
+ * Get a single space manager
2506
+ */
2507
+ getManager(options) {
2508
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/managers/{user_id}", ...options });
2509
+ }
2510
+ /**
2511
+ * Update a space manager's permissions
2512
+ */
2513
+ updateManager(options) {
2514
+ return (options.client ?? this.client).put({
2515
+ url: "/api/v1/spaces/{id}/managers/{user_id}",
2516
+ ...options,
2517
+ headers: {
2518
+ "Content-Type": "application/json",
2519
+ ...options.headers
2520
+ }
2521
+ });
2522
+ }
2523
+ /**
2524
+ * List space members
2525
+ */
2526
+ listMembers(options) {
2527
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/members", ...options });
2528
+ }
2529
+ /**
2530
+ * Add a member to a space
2531
+ */
2532
+ addMember(options) {
2533
+ return (options.client ?? this.client).post({
2534
+ url: "/api/v1/spaces/{id}/members",
2535
+ ...options,
2536
+ headers: {
2537
+ "Content-Type": "application/json",
2538
+ ...options.headers
2539
+ }
2540
+ });
2541
+ }
2542
+ /**
2543
+ * Remove a member from a space
2544
+ */
2545
+ removeMember(options) {
2546
+ return (options.client ?? this.client).delete({ url: "/api/v1/spaces/{id}/members/{user_id}", ...options });
2547
+ }
2548
+ /**
2549
+ * List parent spaces of a space
2550
+ */
2551
+ listParents(options) {
2552
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/parents", ...options });
2553
+ }
2554
+ /**
2555
+ * Add a parent to a space
2556
+ */
2557
+ addParent(options) {
2558
+ return (options.client ?? this.client).post({
2559
+ url: "/api/v1/spaces/{id}/parents",
2560
+ ...options,
2561
+ headers: {
2562
+ "Content-Type": "application/json",
2563
+ ...options.headers
2564
+ }
2565
+ });
2566
+ }
2567
+ /**
2568
+ * Remove a parent from a space
2569
+ */
2570
+ removeParent(options) {
2571
+ return (options.client ?? this.client).delete({ url: "/api/v1/spaces/{id}/parents/{parent_id}", ...options });
2572
+ }
2573
+ /**
2574
+ * Publish a space
2575
+ *
2576
+ * Publishes a new draft or promotes the current draft changes for a published space. Optionally sends a notification to the creator by providing a JSON body with notification options.
2577
+ */
2578
+ publish(options) {
2579
+ return (options.client ?? this.client).post({
2580
+ url: "/api/v1/spaces/{id}/publish",
2581
+ ...options,
2582
+ headers: {
2583
+ "Content-Type": "application/json",
2584
+ ...options.headers
2585
+ }
2586
+ });
2587
+ }
2588
+ /**
2589
+ * Get settings for a space
2590
+ */
2591
+ getSettings(options) {
2592
+ return (options.client ?? this.client).get({ url: "/api/v1/spaces/{id}/settings", ...options });
2593
+ }
2594
+ /**
2595
+ * Partially update settings for a space
2596
+ */
2597
+ patchSettings(options) {
2598
+ return (options.client ?? this.client).patch({
2599
+ url: "/api/v1/spaces/{id}/settings",
2600
+ ...options,
2601
+ headers: {
2602
+ "Content-Type": "application/json",
2603
+ ...options.headers
2604
+ }
2605
+ });
2606
+ }
2607
+ };
2608
+ var _Linebundle = class _Linebundle extends HeyApiClient {
2609
+ constructor(args) {
2610
+ super(args);
2611
+ _Linebundle.__registry.set(this, args?.key);
2612
+ }
2613
+ /**
2614
+ * Liveness check
2615
+ *
2616
+ * Returns 200 if the process is running.
2617
+ */
2618
+ liveness(options) {
2619
+ return (options?.client ?? this.client).get({ url: "/health", ...options });
2620
+ }
2621
+ /**
2622
+ * Readiness check
2623
+ *
2624
+ * Returns 200 if all downstream dependencies are healthy.
2625
+ */
2626
+ readiness(options) {
2627
+ return (options?.client ?? this.client).get({ url: "/health/ready", ...options });
2628
+ }
2629
+ get analytics() {
2630
+ return this._analytics ?? (this._analytics = new Analytics({ client: this.client }));
2631
+ }
2632
+ get announcements() {
2633
+ return this._announcements ?? (this._announcements = new Announcements({ client: this.client }));
2634
+ }
2635
+ get audit() {
2636
+ return this._audit ?? (this._audit = new Audit({ client: this.client }));
2637
+ }
2638
+ get auth() {
2639
+ return this._auth ?? (this._auth = new Auth({ client: this.client }));
2640
+ }
2641
+ get automation() {
2642
+ return this._automation ?? (this._automation = new Automation({ client: this.client }));
2643
+ }
2644
+ get bookings() {
2645
+ return this._bookings ?? (this._bookings = new Bookings({ client: this.client }));
2646
+ }
2647
+ get contacts() {
2648
+ return this._contacts ?? (this._contacts = new Contacts({ client: this.client }));
2649
+ }
2650
+ get credentials() {
2651
+ return this._credentials ?? (this._credentials = new Credentials({ client: this.client }));
2652
+ }
2653
+ get events() {
2654
+ return this._events ?? (this._events = new Events({ client: this.client }));
2655
+ }
2656
+ get integrations() {
2657
+ return this._integrations ?? (this._integrations = new Integrations({ client: this.client }));
2658
+ }
2659
+ get organizations() {
2660
+ return this._organizations ?? (this._organizations = new Organizations({ client: this.client }));
2661
+ }
2662
+ get permissions() {
2663
+ return this._permissions ?? (this._permissions = new Permissions({ client: this.client }));
2664
+ }
2665
+ get places() {
2666
+ return this._places ?? (this._places = new Places({ client: this.client }));
2667
+ }
2668
+ get profiles() {
2669
+ return this._profiles ?? (this._profiles = new Profiles({ client: this.client }));
2670
+ }
2671
+ get public() {
2672
+ return this._public ?? (this._public = new Public({ client: this.client }));
2673
+ }
2674
+ get series() {
2675
+ return this._series ?? (this._series = new Series({ client: this.client }));
2676
+ }
2677
+ get spaces() {
2678
+ return this._spaces ?? (this._spaces = new Spaces2({ client: this.client }));
2679
+ }
2680
+ };
2681
+ _Linebundle.__registry = new HeyApiRegistry();
2682
+ var Linebundle = _Linebundle;
2683
+
2684
+ // node_modules/@hey-api/client-fetch/dist/index.js
2685
+ var A = async (s, r) => {
2686
+ let e = typeof r == "function" ? await r(s) : r;
2687
+ if (e) return s.scheme === "bearer" ? `Bearer ${e}` : s.scheme === "basic" ? `Basic ${btoa(e)}` : e;
2688
+ };
2689
+ var O = { bodySerializer: (s) => JSON.stringify(s, (r, e) => typeof e == "bigint" ? e.toString() : e) };
2690
+ var U = { $body_: "body", $headers_: "headers", $path_: "path", $query_: "query" };
2691
+ var D = Object.entries(U);
2692
+ var B = (s) => {
2693
+ switch (s) {
2694
+ case "label":
2695
+ return ".";
2696
+ case "matrix":
2697
+ return ";";
2698
+ case "simple":
2699
+ return ",";
2700
+ default:
2701
+ return "&";
2702
+ }
2703
+ };
2704
+ var N = (s) => {
2705
+ switch (s) {
2706
+ case "form":
2707
+ return ",";
2708
+ case "pipeDelimited":
2709
+ return "|";
2710
+ case "spaceDelimited":
2711
+ return "%20";
2712
+ default:
2713
+ return ",";
2714
+ }
2715
+ };
2716
+ var Q = (s) => {
2717
+ switch (s) {
2718
+ case "label":
2719
+ return ".";
2720
+ case "matrix":
2721
+ return ";";
2722
+ case "simple":
2723
+ return ",";
2724
+ default:
2725
+ return "&";
2726
+ }
2727
+ };
2728
+ var S = ({ allowReserved: s, explode: r, name: e, style: a, value: i }) => {
2729
+ if (!r) {
2730
+ let t = (s ? i : i.map((l) => encodeURIComponent(l))).join(N(a));
2731
+ switch (a) {
2732
+ case "label":
2733
+ return `.${t}`;
2734
+ case "matrix":
2735
+ return `;${e}=${t}`;
2736
+ case "simple":
2737
+ return t;
2738
+ default:
2739
+ return `${e}=${t}`;
2740
+ }
2741
+ }
2742
+ let o = B(a), n = i.map((t) => a === "label" || a === "simple" ? s ? t : encodeURIComponent(t) : m({ allowReserved: s, name: e, value: t })).join(o);
2743
+ return a === "label" || a === "matrix" ? o + n : n;
2744
+ };
2745
+ var m = ({ allowReserved: s, name: r, value: e }) => {
2746
+ if (e == null) return "";
2747
+ if (typeof e == "object") throw new Error("Deeply-nested arrays/objects aren\u2019t supported. Provide your own `querySerializer()` to handle these.");
2748
+ return `${r}=${s ? e : encodeURIComponent(e)}`;
2749
+ };
2750
+ var q = ({ allowReserved: s, explode: r, name: e, style: a, value: i, valueOnly: o }) => {
2751
+ if (i instanceof Date) return o ? i.toISOString() : `${e}=${i.toISOString()}`;
2752
+ if (a !== "deepObject" && !r) {
2753
+ let l = [];
2754
+ Object.entries(i).forEach(([p, d]) => {
2755
+ l = [...l, p, s ? d : encodeURIComponent(d)];
2756
+ });
2757
+ let u = l.join(",");
2758
+ switch (a) {
2759
+ case "form":
2760
+ return `${e}=${u}`;
2761
+ case "label":
2762
+ return `.${u}`;
2763
+ case "matrix":
2764
+ return `;${e}=${u}`;
2765
+ default:
2766
+ return u;
2767
+ }
2768
+ }
2769
+ let n = Q(a), t = Object.entries(i).map(([l, u]) => m({ allowReserved: s, name: a === "deepObject" ? `${e}[${l}]` : l, value: u })).join(n);
2770
+ return a === "label" || a === "matrix" ? n + t : t;
2771
+ };
2772
+ var J = /\{[^{}]+\}/g;
2773
+ var M = ({ path: s, url: r }) => {
2774
+ let e = r, a = r.match(J);
2775
+ if (a) for (let i of a) {
2776
+ let o = false, n = i.substring(1, i.length - 1), t = "simple";
2777
+ n.endsWith("*") && (o = true, n = n.substring(0, n.length - 1)), n.startsWith(".") ? (n = n.substring(1), t = "label") : n.startsWith(";") && (n = n.substring(1), t = "matrix");
2778
+ let l = s[n];
2779
+ if (l == null) continue;
2780
+ if (Array.isArray(l)) {
2781
+ e = e.replace(i, S({ explode: o, name: n, style: t, value: l }));
2782
+ continue;
2783
+ }
2784
+ if (typeof l == "object") {
2785
+ e = e.replace(i, q({ explode: o, name: n, style: t, value: l, valueOnly: true }));
2786
+ continue;
2787
+ }
2788
+ if (t === "matrix") {
2789
+ e = e.replace(i, `;${m({ name: n, value: l })}`);
2790
+ continue;
2791
+ }
2792
+ let u = encodeURIComponent(t === "label" ? `.${l}` : l);
2793
+ e = e.replace(i, u);
2794
+ }
2795
+ return e;
2796
+ };
2797
+ var k = ({ allowReserved: s, array: r, object: e } = {}) => (i) => {
2798
+ let o = [];
2799
+ if (i && typeof i == "object") for (let n in i) {
2800
+ let t = i[n];
2801
+ if (t != null) if (Array.isArray(t)) {
2802
+ let l = S({ allowReserved: s, explode: true, name: n, style: "form", value: t, ...r });
2803
+ l && o.push(l);
2804
+ } else if (typeof t == "object") {
2805
+ let l = q({ allowReserved: s, explode: true, name: n, style: "deepObject", value: t, ...e });
2806
+ l && o.push(l);
2807
+ } else {
2808
+ let l = m({ allowReserved: s, name: n, value: t });
2809
+ l && o.push(l);
2810
+ }
2811
+ }
2812
+ return o.join("&");
2813
+ };
2814
+ var E = (s) => {
2815
+ if (!s) return "stream";
2816
+ let r = s.split(";")[0]?.trim();
2817
+ if (r) {
2818
+ if (r.startsWith("application/json") || r.endsWith("+json")) return "json";
2819
+ if (r === "multipart/form-data") return "formData";
2820
+ if (["application/", "audio/", "image/", "video/"].some((e) => r.startsWith(e))) return "blob";
2821
+ if (r.startsWith("text/")) return "text";
2822
+ }
2823
+ };
2824
+ var $ = async ({ security: s, ...r }) => {
2825
+ for (let e of s) {
2826
+ let a = await A(e, r.auth);
2827
+ if (!a) continue;
2828
+ let i = e.name ?? "Authorization";
2829
+ switch (e.in) {
2830
+ case "query":
2831
+ r.query || (r.query = {}), r.query[i] = a;
2832
+ break;
2833
+ case "cookie":
2834
+ r.headers.append("Cookie", `${i}=${a}`);
2835
+ break;
2836
+ case "header":
2837
+ default:
2838
+ r.headers.set(i, a);
2839
+ break;
2840
+ }
2841
+ return;
2842
+ }
2843
+ };
2844
+ var C = (s) => L({ baseUrl: s.baseUrl, path: s.path, query: s.query, querySerializer: typeof s.querySerializer == "function" ? s.querySerializer : k(s.querySerializer), url: s.url });
2845
+ var L = ({ baseUrl: s, path: r, query: e, querySerializer: a, url: i }) => {
2846
+ let o = i.startsWith("/") ? i : `/${i}`, n = (s ?? "") + o;
2847
+ r && (n = M({ path: r, url: n }));
2848
+ let t = e ? a(e) : "";
2849
+ return t.startsWith("?") && (t = t.substring(1)), t && (n += `?${t}`), n;
2850
+ };
2851
+ var x = (s, r) => {
2852
+ let e = { ...s, ...r };
2853
+ return e.baseUrl?.endsWith("/") && (e.baseUrl = e.baseUrl.substring(0, e.baseUrl.length - 1)), e.headers = j(s.headers, r.headers), e;
2854
+ };
2855
+ var j = (...s) => {
2856
+ let r = new Headers();
2857
+ for (let e of s) {
2858
+ if (!e || typeof e != "object") continue;
2859
+ let a = e instanceof Headers ? e.entries() : Object.entries(e);
2860
+ for (let [i, o] of a) if (o === null) r.delete(i);
2861
+ else if (Array.isArray(o)) for (let n of o) r.append(i, n);
2862
+ else o !== void 0 && r.set(i, typeof o == "object" ? JSON.stringify(o) : o);
2863
+ }
2864
+ return r;
2865
+ };
2866
+ var g = class {
2867
+ constructor() {
2868
+ __publicField(this, "_fns");
2869
+ this._fns = [];
2870
+ }
2871
+ clear() {
2872
+ this._fns = [];
2873
+ }
2874
+ getInterceptorIndex(r) {
2875
+ return typeof r == "number" ? this._fns[r] ? r : -1 : this._fns.indexOf(r);
2876
+ }
2877
+ exists(r) {
2878
+ let e = this.getInterceptorIndex(r);
2879
+ return !!this._fns[e];
2880
+ }
2881
+ eject(r) {
2882
+ let e = this.getInterceptorIndex(r);
2883
+ this._fns[e] && (this._fns[e] = null);
2884
+ }
2885
+ update(r, e) {
2886
+ let a = this.getInterceptorIndex(r);
2887
+ return this._fns[a] ? (this._fns[a] = e, r) : false;
2888
+ }
2889
+ use(r) {
2890
+ return this._fns = [...this._fns, r], this._fns.length - 1;
2891
+ }
2892
+ };
2893
+ var v = () => ({ error: new g(), request: new g(), response: new g() });
2894
+ var V = k({ allowReserved: false, array: { explode: true, style: "form" }, object: { explode: true, style: "deepObject" } });
2895
+ var F = { "Content-Type": "application/json" };
2896
+ var w = (s = {}) => ({ ...O, headers: F, parseAs: "auto", querySerializer: V, ...s });
2897
+ var G = (s = {}) => {
2898
+ let r = x(w(), s), e = () => ({ ...r }), a = (n) => (r = x(r, n), e()), i = v(), o = async (n) => {
2899
+ let t = { ...r, ...n, fetch: n.fetch ?? r.fetch ?? globalThis.fetch, headers: j(r.headers, n.headers) };
2900
+ t.security && await $({ ...t, security: t.security }), t.body && t.bodySerializer && (t.body = t.bodySerializer(t.body)), (t.body === void 0 || t.body === "") && t.headers.delete("Content-Type");
2901
+ let l = C(t), u = { redirect: "follow", ...t }, p = new Request(l, u);
2902
+ for (let f of i.request._fns) f && (p = await f(p, t));
2903
+ let d = t.fetch, c = await d(p);
2904
+ for (let f of i.response._fns) f && (c = await f(c, p, t));
2905
+ let b = { request: p, response: c };
2906
+ if (c.ok) {
2907
+ if (c.status === 204 || c.headers.get("Content-Length") === "0") return t.responseStyle === "data" ? {} : { data: {}, ...b };
2908
+ let f = (t.parseAs === "auto" ? E(c.headers.get("Content-Type")) : t.parseAs) ?? "json";
2909
+ if (f === "stream") return t.responseStyle === "data" ? c.body : { data: c.body, ...b };
2910
+ let h = await c[f]();
2911
+ return f === "json" && (t.responseValidator && await t.responseValidator(h), t.responseTransformer && (h = await t.responseTransformer(h))), t.responseStyle === "data" ? h : { data: h, ...b };
2912
+ }
2913
+ let R = await c.text();
2914
+ try {
2915
+ R = JSON.parse(R);
2916
+ } catch {
2917
+ }
2918
+ let y = R;
2919
+ for (let f of i.error._fns) f && (y = await f(R, c, p, t));
2920
+ if (y = y || {}, t.throwOnError) throw y;
2921
+ return t.responseStyle === "data" ? void 0 : { error: y, ...b };
2922
+ };
2923
+ return { buildUrl: C, connect: (n) => o({ ...n, method: "CONNECT" }), delete: (n) => o({ ...n, method: "DELETE" }), get: (n) => o({ ...n, method: "GET" }), getConfig: e, head: (n) => o({ ...n, method: "HEAD" }), interceptors: i, options: (n) => o({ ...n, method: "OPTIONS" }), patch: (n) => o({ ...n, method: "PATCH" }), post: (n) => o({ ...n, method: "POST" }), put: (n) => o({ ...n, method: "PUT" }), request: o, setConfig: a, trace: (n) => o({ ...n, method: "TRACE" }) };
2924
+ };
2925
+
2926
+ // src/create.ts
2927
+ function createLinebundle({
2928
+ token,
2929
+ orgId,
2930
+ baseUrl
2931
+ }) {
2932
+ return new Linebundle({
2933
+ client: G({
2934
+ baseUrl: baseUrl ?? "https://api.linebundle.com",
2935
+ headers: {
2936
+ Authorization: `Bearer ${token}`,
2937
+ ...orgId ? { "X-Org-ID": orgId } : {}
2938
+ }
2939
+ })
2940
+ });
2941
+ }
2942
+ export {
2943
+ Analytics,
2944
+ Announcements,
2945
+ Announcements2,
2946
+ Audit,
2947
+ Auth,
2948
+ Automation,
2949
+ Bookings,
2950
+ Contacts,
2951
+ Credentials,
2952
+ Events,
2953
+ Events2,
2954
+ Integrations,
2955
+ Invites,
2956
+ Linebundle,
2957
+ Me,
2958
+ Organizations,
2959
+ Permissions,
2960
+ Places,
2961
+ Profiles,
2962
+ Public,
2963
+ Series,
2964
+ Spaces,
2965
+ Spaces2,
2966
+ Zitadel,
2967
+ client,
2968
+ createLinebundle
2969
+ };
3
2970
  //# sourceMappingURL=index.js.map