basecamp-client 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,3209 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+
20
+ // src/index.ts
21
+ var index_exports = {};
22
+ __export(index_exports, {
23
+ buildClient: () => buildClient,
24
+ contract: () => contract,
25
+ getBearerToken: () => getBearerToken
26
+ });
27
+ module.exports = __toCommonJS(index_exports);
28
+
29
+ // src/buildClient.ts
30
+ var import_core3 = require("@ts-rest/core");
31
+
32
+ // src/contract/index.ts
33
+ var import_zod59 = require("zod");
34
+
35
+ // src/contract/c.ts
36
+ var import_core = require("@ts-rest/core");
37
+ var c = (0, import_core.initContract)();
38
+
39
+ // src/contract/resources/communications/message-boards.ts
40
+ var import_zod3 = require("zod");
41
+
42
+ // src/contract/schemas/common.ts
43
+ var import_zod = require("zod");
44
+ var BasecampIdSchema = import_zod.z.number().int().nonnegative();
45
+ var BasecampIdParamSchema = import_zod.z.coerce.number().int().nonnegative();
46
+ var IsoDateTimeSchema = import_zod.z.string().datetime({ offset: true });
47
+ var IsoDateSchema = import_zod.z.string().regex(/^\d{4}-\d{2}-\d{2}$/, "Date must be formatted as YYYY-MM-DD");
48
+ var RecordingStatusSchema = import_zod.z.enum(["active", "trashed"]).or(import_zod.z.string());
49
+ var HtmlStringSchema = import_zod.z.string().min(0);
50
+ var BucketRefSchema = import_zod.z.object({
51
+ id: BasecampIdSchema,
52
+ name: import_zod.z.string(),
53
+ type: import_zod.z.string()
54
+ });
55
+ var RecordingRefSchema = import_zod.z.object({
56
+ id: BasecampIdSchema,
57
+ title: import_zod.z.string(),
58
+ type: import_zod.z.string(),
59
+ url: import_zod.z.string().url(),
60
+ app_url: import_zod.z.string().url()
61
+ });
62
+ var PersonSummarySchema = import_zod.z.object({
63
+ id: BasecampIdSchema,
64
+ attachable_sgid: import_zod.z.string().min(1),
65
+ name: import_zod.z.string(),
66
+ email_address: import_zod.z.string().email().nullable(),
67
+ personable_type: import_zod.z.string(),
68
+ title: import_zod.z.string().nullable(),
69
+ bio: import_zod.z.string().nullable(),
70
+ location: import_zod.z.string().nullable(),
71
+ created_at: IsoDateTimeSchema,
72
+ updated_at: IsoDateTimeSchema,
73
+ admin: import_zod.z.boolean(),
74
+ owner: import_zod.z.boolean(),
75
+ client: import_zod.z.boolean(),
76
+ employee: import_zod.z.boolean(),
77
+ time_zone: import_zod.z.string(),
78
+ avatar_url: import_zod.z.string().url(),
79
+ company: import_zod.z.object({
80
+ id: BasecampIdSchema,
81
+ name: import_zod.z.string()
82
+ }).optional(),
83
+ can_manage_projects: import_zod.z.boolean(),
84
+ can_manage_people: import_zod.z.boolean()
85
+ });
86
+
87
+ // src/contract/schemas/communications/message-boards.ts
88
+ var import_zod2 = require("zod");
89
+ var MessageBoardRecordingCoreSchema = import_zod2.z.object({
90
+ id: BasecampIdSchema,
91
+ status: RecordingStatusSchema,
92
+ visible_to_clients: import_zod2.z.boolean(),
93
+ created_at: IsoDateTimeSchema,
94
+ updated_at: IsoDateTimeSchema,
95
+ title: import_zod2.z.string(),
96
+ inherits_status: import_zod2.z.boolean(),
97
+ type: import_zod2.z.string(),
98
+ url: import_zod2.z.string().url(),
99
+ app_url: import_zod2.z.string().url(),
100
+ bookmark_url: import_zod2.z.string().url().optional(),
101
+ position: import_zod2.z.number().int().nonnegative().optional(),
102
+ bucket: BucketRefSchema,
103
+ creator: PersonSummarySchema
104
+ });
105
+ var MessageBoardSchema = MessageBoardRecordingCoreSchema.extend({
106
+ messages_count: import_zod2.z.number().int().nonnegative(),
107
+ messages_url: import_zod2.z.string().url(),
108
+ app_messages_url: import_zod2.z.string().url()
109
+ });
110
+ var MessageBoardsResponseSchema = import_zod2.z.array(MessageBoardSchema);
111
+
112
+ // src/contract/resources/communications/message-boards.ts
113
+ var bucketAndMessageBoardPathParams = import_zod3.z.object({
114
+ bucketId: BasecampIdParamSchema,
115
+ messageBoardId: BasecampIdParamSchema
116
+ });
117
+ var projectPathParams = import_zod3.z.object({
118
+ projectId: BasecampIdParamSchema
119
+ });
120
+ var messageBoardsRouter = c.router({
121
+ get: {
122
+ summary: "Get a message board",
123
+ description: "Return a message board container for a project.",
124
+ metadata: {
125
+ tag: "Message Boards",
126
+ operationId: "messageBoards.get",
127
+ docsPath: "/docs/basecamp-api-specs/sections/message_boards.md#get-message-board"
128
+ },
129
+ method: "GET",
130
+ path: "/buckets/:bucketId/message_boards/:messageBoardId",
131
+ pathParams: bucketAndMessageBoardPathParams,
132
+ responses: {
133
+ 200: MessageBoardSchema
134
+ }
135
+ },
136
+ listForProject: {
137
+ summary: "List message boards for a project",
138
+ description: "Return message boards available for a project.",
139
+ metadata: {
140
+ tag: "Message Boards",
141
+ operationId: "messageBoards.listForProject",
142
+ docsPath: "/docs/basecamp-api-specs/sections/message_boards.md#get-message-board"
143
+ },
144
+ method: "GET",
145
+ path: "/projects/:projectId/message_boards",
146
+ pathParams: projectPathParams,
147
+ responses: {
148
+ 200: MessageBoardsResponseSchema
149
+ }
150
+ }
151
+ });
152
+
153
+ // src/contract/resources/communications/message-types.ts
154
+ var import_zod5 = require("zod");
155
+
156
+ // src/contract/schemas/communications/message-types.ts
157
+ var import_zod4 = require("zod");
158
+ var MessageTypeSchema = import_zod4.z.object({
159
+ id: BasecampIdSchema,
160
+ name: import_zod4.z.string(),
161
+ icon: import_zod4.z.string(),
162
+ created_at: IsoDateTimeSchema,
163
+ updated_at: IsoDateTimeSchema
164
+ });
165
+ var MessageTypesResponseSchema = import_zod4.z.array(MessageTypeSchema);
166
+ var MessageTypeCreateBodySchema = import_zod4.z.object({
167
+ name: import_zod4.z.string().min(1),
168
+ icon: import_zod4.z.string().min(1)
169
+ });
170
+ var MessageTypeUpdateBodySchema = import_zod4.z.object({
171
+ name: import_zod4.z.string().min(1).optional(),
172
+ icon: import_zod4.z.string().min(1).optional()
173
+ });
174
+
175
+ // src/contract/resources/communications/message-types.ts
176
+ var bucketPathParams = import_zod5.z.object({
177
+ bucketId: BasecampIdParamSchema
178
+ });
179
+ var bucketAndCategoryPathParams = bucketPathParams.extend({
180
+ categoryId: BasecampIdParamSchema
181
+ });
182
+ var messageTypesRouter = c.router({
183
+ list: {
184
+ summary: "List message types",
185
+ description: "Return all message types (categories) available in a project.",
186
+ metadata: {
187
+ tag: "Message Types",
188
+ operationId: "messageTypes.list",
189
+ docsPath: "/docs/basecamp-api-specs/sections/message_types.md#get-message-types"
190
+ },
191
+ method: "GET",
192
+ path: "/buckets/:bucketId/categories",
193
+ pathParams: bucketPathParams,
194
+ responses: {
195
+ 200: MessageTypesResponseSchema
196
+ }
197
+ },
198
+ get: {
199
+ summary: "Get a message type",
200
+ description: "Return a specific message type by its ID.",
201
+ metadata: {
202
+ tag: "Message Types",
203
+ operationId: "messageTypes.get",
204
+ docsPath: "/docs/basecamp-api-specs/sections/message_types.md#get-a-message-type"
205
+ },
206
+ method: "GET",
207
+ path: "/buckets/:bucketId/categories/:categoryId",
208
+ pathParams: bucketAndCategoryPathParams,
209
+ responses: {
210
+ 200: MessageTypeSchema
211
+ }
212
+ },
213
+ create: {
214
+ summary: "Create a message type",
215
+ description: "Create a new message type in a project.",
216
+ metadata: {
217
+ tag: "Message Types",
218
+ operationId: "messageTypes.create",
219
+ docsPath: "/docs/basecamp-api-specs/sections/message_types.md#create-a-message-type"
220
+ },
221
+ method: "POST",
222
+ path: "/buckets/:bucketId/categories",
223
+ pathParams: bucketPathParams,
224
+ body: MessageTypeCreateBodySchema,
225
+ responses: {
226
+ 201: MessageTypeSchema
227
+ }
228
+ },
229
+ update: {
230
+ summary: "Update a message type",
231
+ description: "Update an existing message type.",
232
+ metadata: {
233
+ tag: "Message Types",
234
+ operationId: "messageTypes.update",
235
+ docsPath: "/docs/basecamp-api-specs/sections/message_types.md#update-a-message-type"
236
+ },
237
+ method: "PUT",
238
+ path: "/buckets/:bucketId/categories/:categoryId",
239
+ pathParams: bucketAndCategoryPathParams,
240
+ body: MessageTypeUpdateBodySchema,
241
+ responses: {
242
+ 200: MessageTypeSchema
243
+ }
244
+ },
245
+ destroy: {
246
+ summary: "Delete a message type",
247
+ description: "Delete a message type from a project.",
248
+ metadata: {
249
+ tag: "Message Types",
250
+ operationId: "messageTypes.destroy",
251
+ docsPath: "/docs/basecamp-api-specs/sections/message_types.md#destroy-a-message-type"
252
+ },
253
+ method: "DELETE",
254
+ path: "/buckets/:bucketId/categories/:categoryId",
255
+ pathParams: bucketAndCategoryPathParams,
256
+ body: c.noBody(),
257
+ responses: {
258
+ 204: c.noBody()
259
+ }
260
+ }
261
+ });
262
+
263
+ // src/contract/resources/communications/messages.ts
264
+ var import_zod7 = require("zod");
265
+
266
+ // src/contract/schemas/communications/messages.ts
267
+ var import_zod6 = require("zod");
268
+ var MessageCoreSchema = import_zod6.z.object({
269
+ id: BasecampIdSchema,
270
+ status: RecordingStatusSchema,
271
+ visible_to_clients: import_zod6.z.boolean(),
272
+ created_at: IsoDateTimeSchema,
273
+ updated_at: IsoDateTimeSchema,
274
+ inherits_status: import_zod6.z.boolean(),
275
+ type: import_zod6.z.string(),
276
+ url: import_zod6.z.string().url(),
277
+ app_url: import_zod6.z.string().url(),
278
+ bookmark_url: import_zod6.z.string().url().optional(),
279
+ subscription_url: import_zod6.z.string().url().optional(),
280
+ comments_count: import_zod6.z.number().int().nonnegative().optional(),
281
+ comments_url: import_zod6.z.string().url().optional(),
282
+ parent: RecordingRefSchema.optional(),
283
+ bucket: BucketRefSchema,
284
+ creator: PersonSummarySchema
285
+ });
286
+ var MessageSummarySchema = MessageCoreSchema.extend({
287
+ title: import_zod6.z.string(),
288
+ content: HtmlStringSchema.optional()
289
+ });
290
+ var MessageSchema = MessageSummarySchema.extend({
291
+ subject: import_zod6.z.string()
292
+ });
293
+ var MessageListResponseSchema = import_zod6.z.array(MessageSummarySchema);
294
+ var MessageListQuerySchema = import_zod6.z.object({
295
+ page: import_zod6.z.coerce.number().int().positive().optional()
296
+ });
297
+ var MessageCreateBodySchema = import_zod6.z.object({
298
+ subject: import_zod6.z.string().min(1),
299
+ status: import_zod6.z.enum(["active", "draft"]).or(import_zod6.z.string()),
300
+ content: HtmlStringSchema.optional(),
301
+ category_id: BasecampIdSchema.optional(),
302
+ subscriptions: import_zod6.z.array(BasecampIdSchema).optional()
303
+ });
304
+ var MessageUpdateBodySchema = import_zod6.z.object({
305
+ subject: import_zod6.z.string().min(1).optional(),
306
+ content: HtmlStringSchema.optional(),
307
+ category_id: BasecampIdSchema.optional()
308
+ }).refine(
309
+ (value) => Object.keys(value).length > 0,
310
+ "At least one field must be provided to update a message."
311
+ );
312
+
313
+ // src/contract/resources/communications/messages.ts
314
+ var bucketAndBoardPathParams = import_zod7.z.object({
315
+ bucketId: BasecampIdParamSchema,
316
+ messageBoardId: BasecampIdParamSchema
317
+ });
318
+ var bucketAndMessagePathParams = import_zod7.z.object({
319
+ bucketId: BasecampIdParamSchema,
320
+ messageId: BasecampIdParamSchema
321
+ });
322
+ var messagesRouter = c.router({
323
+ list: {
324
+ summary: "List message board messages",
325
+ description: "Returns the messages currently visible on a message board. Pagination data is available via the Link and X-Total-Count headers.",
326
+ metadata: {
327
+ tag: "Messages",
328
+ operationId: "messages.list",
329
+ docsPath: "/docs/basecamp-api-specs/sections/messages.md#get-messages"
330
+ },
331
+ method: "GET",
332
+ path: "/buckets/:bucketId/message_boards/:messageBoardId/messages",
333
+ pathParams: bucketAndBoardPathParams,
334
+ query: MessageListQuerySchema,
335
+ responses: {
336
+ 200: MessageListResponseSchema
337
+ }
338
+ },
339
+ get: {
340
+ summary: "Get a message",
341
+ description: "Fetch the full representation of a single message.",
342
+ metadata: {
343
+ tag: "Messages",
344
+ operationId: "messages.get",
345
+ docsPath: "/docs/basecamp-api-specs/sections/messages.md#get-a-message"
346
+ },
347
+ method: "GET",
348
+ path: "/buckets/:bucketId/messages/:messageId",
349
+ pathParams: bucketAndMessagePathParams,
350
+ responses: {
351
+ 200: MessageSchema
352
+ }
353
+ },
354
+ create: {
355
+ summary: "Create a message",
356
+ description: 'Publish a message to a specific message board. Setting status to "active" makes the message visible immediately.',
357
+ metadata: {
358
+ tag: "Messages",
359
+ operationId: "messages.create",
360
+ docsPath: "/docs/basecamp-api-specs/sections/messages.md#create-a-message"
361
+ },
362
+ method: "POST",
363
+ path: "/buckets/:bucketId/message_boards/:messageBoardId/messages",
364
+ pathParams: bucketAndBoardPathParams,
365
+ body: MessageCreateBodySchema,
366
+ responses: {
367
+ 201: MessageSchema
368
+ }
369
+ },
370
+ update: {
371
+ summary: "Update a message",
372
+ description: "Update the subject, content, or category of an existing message.",
373
+ metadata: {
374
+ tag: "Messages",
375
+ operationId: "messages.update",
376
+ docsPath: "/docs/basecamp-api-specs/sections/messages.md#update-a-message"
377
+ },
378
+ method: "PUT",
379
+ path: "/buckets/:bucketId/messages/:messageId",
380
+ pathParams: bucketAndMessagePathParams,
381
+ body: MessageUpdateBodySchema,
382
+ responses: {
383
+ 200: MessageSchema
384
+ }
385
+ },
386
+ pin: {
387
+ summary: "Pin a message",
388
+ description: "Pin a message recording. The same endpoint is used to pin other recording types.",
389
+ metadata: {
390
+ tag: "Messages",
391
+ operationId: "messages.pin",
392
+ docsPath: "/docs/basecamp-api-specs/sections/messages.md#pin-a-message"
393
+ },
394
+ method: "POST",
395
+ path: "/buckets/:bucketId/recordings/:messageId/pin",
396
+ pathParams: bucketAndMessagePathParams,
397
+ body: c.noBody(),
398
+ responses: {
399
+ 204: c.noBody()
400
+ }
401
+ },
402
+ unpin: {
403
+ summary: "Unpin a message",
404
+ description: "Remove a pinned message. Returns no content on success.",
405
+ metadata: {
406
+ tag: "Messages",
407
+ operationId: "messages.unpin",
408
+ docsPath: "/docs/basecamp-api-specs/sections/messages.md#pin-a-message"
409
+ },
410
+ method: "DELETE",
411
+ path: "/buckets/:bucketId/recordings/:messageId/pin",
412
+ pathParams: bucketAndMessagePathParams,
413
+ body: c.noBody(),
414
+ responses: {
415
+ 204: c.noBody()
416
+ }
417
+ },
418
+ trash: {
419
+ summary: "Trash a message",
420
+ description: "Move a message recording to the trash. Trashed items can be restored via the UI.",
421
+ metadata: {
422
+ tag: "Messages",
423
+ operationId: "messages.trash",
424
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#trash-a-recording"
425
+ },
426
+ method: "PUT",
427
+ path: "/buckets/:bucketId/recordings/:messageId/status/trashed",
428
+ pathParams: bucketAndMessagePathParams,
429
+ body: c.noBody(),
430
+ responses: {
431
+ 204: c.noBody()
432
+ }
433
+ }
434
+ });
435
+
436
+ // src/contract/resources/communications/comments.ts
437
+ var import_zod9 = require("zod");
438
+
439
+ // src/contract/schemas/communications/comments.ts
440
+ var import_zod8 = require("zod");
441
+ var CommentRecordingCoreSchema = import_zod8.z.object({
442
+ id: BasecampIdSchema,
443
+ status: RecordingStatusSchema,
444
+ visible_to_clients: import_zod8.z.boolean(),
445
+ created_at: IsoDateTimeSchema,
446
+ updated_at: IsoDateTimeSchema,
447
+ title: import_zod8.z.string(),
448
+ inherits_status: import_zod8.z.boolean(),
449
+ type: import_zod8.z.string(),
450
+ url: import_zod8.z.string().url(),
451
+ app_url: import_zod8.z.string().url(),
452
+ bookmark_url: import_zod8.z.string().url().optional(),
453
+ parent: RecordingRefSchema.optional(),
454
+ bucket: BucketRefSchema,
455
+ creator: PersonSummarySchema
456
+ });
457
+ var CommentSchema = CommentRecordingCoreSchema.extend({
458
+ content: HtmlStringSchema
459
+ });
460
+ var CommentsResponseSchema = import_zod8.z.array(CommentSchema);
461
+ var CommentListQuerySchema = import_zod8.z.object({
462
+ page: import_zod8.z.coerce.number().int().positive().optional()
463
+ });
464
+ var CommentCreateBodySchema = import_zod8.z.object({
465
+ content: HtmlStringSchema.min(1)
466
+ });
467
+ var CommentUpdateBodySchema = import_zod8.z.object({
468
+ content: HtmlStringSchema.min(1)
469
+ });
470
+
471
+ // src/contract/resources/communications/comments.ts
472
+ var bucketAndRecordingPathParams = import_zod9.z.object({
473
+ bucketId: BasecampIdParamSchema,
474
+ recordingId: BasecampIdParamSchema
475
+ });
476
+ var bucketAndCommentPathParams = import_zod9.z.object({
477
+ bucketId: BasecampIdParamSchema,
478
+ commentId: BasecampIdParamSchema
479
+ });
480
+ var commentsRouter = c.router({
481
+ list: {
482
+ summary: "List comments",
483
+ description: "Return paginated comments for a recording.",
484
+ metadata: {
485
+ tag: "Comments",
486
+ operationId: "comments.list",
487
+ docsPath: "/docs/basecamp-api-specs/sections/comments.md#get-comments"
488
+ },
489
+ method: "GET",
490
+ path: "/buckets/:bucketId/recordings/:recordingId/comments",
491
+ pathParams: bucketAndRecordingPathParams,
492
+ query: CommentListQuerySchema,
493
+ responses: {
494
+ 200: CommentsResponseSchema
495
+ }
496
+ },
497
+ get: {
498
+ summary: "Get a comment",
499
+ description: "Return a specific comment by its ID.",
500
+ metadata: {
501
+ tag: "Comments",
502
+ operationId: "comments.get",
503
+ docsPath: "/docs/basecamp-api-specs/sections/comments.md#get-a-comment"
504
+ },
505
+ method: "GET",
506
+ path: "/buckets/:bucketId/comments/:commentId",
507
+ pathParams: bucketAndCommentPathParams,
508
+ responses: {
509
+ 200: CommentSchema
510
+ }
511
+ },
512
+ create: {
513
+ summary: "Create a comment",
514
+ description: "Create a new comment on a recording.",
515
+ metadata: {
516
+ tag: "Comments",
517
+ operationId: "comments.create",
518
+ docsPath: "/docs/basecamp-api-specs/sections/comments.md#create-a-comment"
519
+ },
520
+ method: "POST",
521
+ path: "/buckets/:bucketId/recordings/:recordingId/comments",
522
+ pathParams: bucketAndRecordingPathParams,
523
+ body: CommentCreateBodySchema,
524
+ responses: {
525
+ 201: CommentSchema
526
+ }
527
+ },
528
+ update: {
529
+ summary: "Update a comment",
530
+ description: "Update an existing comment.",
531
+ metadata: {
532
+ tag: "Comments",
533
+ operationId: "comments.update",
534
+ docsPath: "/docs/basecamp-api-specs/sections/comments.md#update-a-comment"
535
+ },
536
+ method: "PUT",
537
+ path: "/buckets/:bucketId/comments/:commentId",
538
+ pathParams: bucketAndCommentPathParams,
539
+ body: CommentUpdateBodySchema,
540
+ responses: {
541
+ 200: CommentSchema
542
+ }
543
+ },
544
+ trash: {
545
+ summary: "Trash a comment",
546
+ description: "Move a comment to the trash.",
547
+ metadata: {
548
+ tag: "Comments",
549
+ operationId: "comments.trash",
550
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#trash-a-recording"
551
+ },
552
+ method: "PUT",
553
+ path: "/buckets/:bucketId/recordings/:commentId/status/trashed",
554
+ pathParams: bucketAndCommentPathParams,
555
+ body: c.noBody(),
556
+ responses: {
557
+ 204: c.noBody()
558
+ }
559
+ }
560
+ });
561
+
562
+ // src/contract/resources/communications/campfires.ts
563
+ var import_zod11 = require("zod");
564
+
565
+ // src/contract/schemas/communications/campfires.ts
566
+ var import_zod10 = require("zod");
567
+ var CampfireSchema = import_zod10.z.object({
568
+ id: BasecampIdSchema,
569
+ status: RecordingStatusSchema,
570
+ visible_to_clients: import_zod10.z.boolean(),
571
+ created_at: IsoDateTimeSchema,
572
+ updated_at: IsoDateTimeSchema,
573
+ title: import_zod10.z.string(),
574
+ inherits_status: import_zod10.z.boolean(),
575
+ type: import_zod10.z.string(),
576
+ url: import_zod10.z.string().url(),
577
+ app_url: import_zod10.z.string().url(),
578
+ bookmark_url: import_zod10.z.string().url().optional(),
579
+ subscription_url: import_zod10.z.string().url().optional(),
580
+ position: import_zod10.z.number().int().optional(),
581
+ topic: import_zod10.z.string(),
582
+ lines_url: import_zod10.z.string().url(),
583
+ bucket: BucketRefSchema,
584
+ creator: PersonSummarySchema
585
+ });
586
+ var CampfireListResponseSchema = import_zod10.z.array(CampfireSchema);
587
+ var CampfireListQuerySchema = import_zod10.z.object({
588
+ page: import_zod10.z.coerce.number().int().positive().optional()
589
+ });
590
+ var CampfireLineSchema = import_zod10.z.object({
591
+ id: BasecampIdSchema,
592
+ status: RecordingStatusSchema,
593
+ visible_to_clients: import_zod10.z.boolean(),
594
+ created_at: IsoDateTimeSchema,
595
+ updated_at: IsoDateTimeSchema,
596
+ title: import_zod10.z.string(),
597
+ inherits_status: import_zod10.z.boolean(),
598
+ type: import_zod10.z.string(),
599
+ url: import_zod10.z.string().url(),
600
+ app_url: import_zod10.z.string().url(),
601
+ bookmark_url: import_zod10.z.string().url().optional(),
602
+ parent: RecordingRefSchema,
603
+ bucket: BucketRefSchema,
604
+ creator: PersonSummarySchema,
605
+ content: import_zod10.z.string()
606
+ });
607
+ var CampfireLineListResponseSchema = import_zod10.z.array(CampfireLineSchema);
608
+ var CampfireLineListQuerySchema = import_zod10.z.object({
609
+ page: import_zod10.z.coerce.number().int().positive().optional()
610
+ });
611
+ var CampfireLineCreateBodySchema = import_zod10.z.object({
612
+ content: import_zod10.z.string().min(1)
613
+ });
614
+
615
+ // src/contract/resources/communications/campfires.ts
616
+ var CampfirePathParamsSchema = import_zod11.z.object({
617
+ bucketId: BasecampIdParamSchema,
618
+ campfireId: BasecampIdParamSchema
619
+ });
620
+ var CampfireLinePathParamsSchema = CampfirePathParamsSchema.extend({
621
+ lineId: BasecampIdParamSchema
622
+ });
623
+ var campfiresRouter = c.router({
624
+ list: {
625
+ summary: "List Campfires",
626
+ description: "Returns the Campfires visible to the authenticated user. Results are paginated via Link headers.",
627
+ metadata: {
628
+ tag: "Campfires",
629
+ operationId: "campfires.list",
630
+ docsPath: "/docs/basecamp-api-specs/sections/campfires.md#get-campfires"
631
+ },
632
+ method: "GET",
633
+ path: "/chats",
634
+ query: CampfireListQuerySchema,
635
+ responses: {
636
+ 200: CampfireListResponseSchema
637
+ }
638
+ },
639
+ get: {
640
+ summary: "Get a Campfire",
641
+ description: "Fetch a single Campfire transcript for a project.",
642
+ metadata: {
643
+ tag: "Campfires",
644
+ operationId: "campfires.get",
645
+ docsPath: "/docs/basecamp-api-specs/sections/campfires.md#get-a-campfire"
646
+ },
647
+ method: "GET",
648
+ path: "/buckets/:bucketId/chats/:campfireId",
649
+ pathParams: CampfirePathParamsSchema,
650
+ responses: {
651
+ 200: CampfireSchema
652
+ }
653
+ },
654
+ listLines: {
655
+ summary: "List Campfire lines",
656
+ description: "Return paginated chat lines for a Campfire transcript.",
657
+ metadata: {
658
+ tag: "Campfires",
659
+ operationId: "campfires.listLines",
660
+ docsPath: "/docs/basecamp-api-specs/sections/campfires.md#get-campfire-lines"
661
+ },
662
+ method: "GET",
663
+ path: "/buckets/:bucketId/chats/:campfireId/lines",
664
+ pathParams: CampfirePathParamsSchema,
665
+ query: CampfireLineListQuerySchema,
666
+ responses: {
667
+ 200: CampfireLineListResponseSchema
668
+ }
669
+ },
670
+ getLine: {
671
+ summary: "Get a Campfire line",
672
+ description: "Fetch a single Campfire line by identifier.",
673
+ metadata: {
674
+ tag: "Campfires",
675
+ operationId: "campfires.getLine",
676
+ docsPath: "/docs/basecamp-api-specs/sections/campfires.md#get-a-campfire-line"
677
+ },
678
+ method: "GET",
679
+ path: "/buckets/:bucketId/chats/:campfireId/lines/:lineId",
680
+ pathParams: CampfireLinePathParamsSchema,
681
+ responses: {
682
+ 200: CampfireLineSchema
683
+ }
684
+ },
685
+ createLine: {
686
+ summary: "Create a Campfire line",
687
+ description: "Post a new line of chat to a Campfire transcript.",
688
+ metadata: {
689
+ tag: "Campfires",
690
+ operationId: "campfires.createLine",
691
+ docsPath: "/docs/basecamp-api-specs/sections/campfires.md#create-a-campfire-line"
692
+ },
693
+ method: "POST",
694
+ path: "/buckets/:bucketId/chats/:campfireId/lines",
695
+ pathParams: CampfirePathParamsSchema,
696
+ body: CampfireLineCreateBodySchema,
697
+ responses: {
698
+ 201: CampfireLineSchema
699
+ }
700
+ },
701
+ deleteLine: {
702
+ summary: "Delete a Campfire line",
703
+ description: "Delete a Campfire line permanently.",
704
+ metadata: {
705
+ tag: "Campfires",
706
+ operationId: "campfires.deleteLine",
707
+ docsPath: "/docs/basecamp-api-specs/sections/campfires.md#delete-a-campfire-line"
708
+ },
709
+ method: "DELETE",
710
+ path: "/buckets/:bucketId/chats/:campfireId/lines/:lineId",
711
+ pathParams: CampfireLinePathParamsSchema,
712
+ body: c.noBody(),
713
+ responses: {
714
+ 204: c.noBody()
715
+ }
716
+ }
717
+ });
718
+
719
+ // src/contract/resources/communications/inboxes.ts
720
+ var import_zod13 = require("zod");
721
+
722
+ // src/contract/schemas/communications/inboxes.ts
723
+ var import_zod12 = require("zod");
724
+ var InboxSchema = import_zod12.z.object({
725
+ id: BasecampIdSchema,
726
+ status: RecordingStatusSchema,
727
+ visible_to_clients: import_zod12.z.boolean(),
728
+ created_at: IsoDateTimeSchema,
729
+ updated_at: IsoDateTimeSchema,
730
+ title: import_zod12.z.string(),
731
+ inherits_status: import_zod12.z.boolean(),
732
+ type: import_zod12.z.string(),
733
+ url: import_zod12.z.string().url(),
734
+ app_url: import_zod12.z.string().url(),
735
+ bookmark_url: import_zod12.z.string().url().optional(),
736
+ position: import_zod12.z.number().int().optional(),
737
+ forwards_count: import_zod12.z.number().int().nonnegative().optional(),
738
+ forwards_url: import_zod12.z.string().url().optional(),
739
+ bucket: BucketRefSchema,
740
+ creator: PersonSummarySchema
741
+ });
742
+
743
+ // src/contract/resources/communications/inboxes.ts
744
+ var InboxPathParamsSchema = import_zod13.z.object({
745
+ bucketId: BasecampIdParamSchema,
746
+ inboxId: BasecampIdParamSchema
747
+ });
748
+ var inboxesRouter = c.router({
749
+ get: {
750
+ summary: "Get an inbox",
751
+ description: "Return the inbox container for a project. Use the forwards endpoint to list mail forwards associated with the inbox.",
752
+ metadata: {
753
+ tag: "Inboxes",
754
+ operationId: "inboxes.get",
755
+ docsPath: "/docs/basecamp-api-specs/sections/inboxes.md#get-inbox"
756
+ },
757
+ method: "GET",
758
+ path: "/buckets/:bucketId/inboxes/:inboxId",
759
+ pathParams: InboxPathParamsSchema,
760
+ responses: {
761
+ 200: InboxSchema
762
+ }
763
+ }
764
+ });
765
+
766
+ // src/contract/resources/communications/forwards.ts
767
+ var import_zod15 = require("zod");
768
+
769
+ // src/contract/schemas/communications/forwards.ts
770
+ var import_zod14 = require("zod");
771
+ var ForwardSchema = import_zod14.z.object({
772
+ id: BasecampIdSchema,
773
+ status: RecordingStatusSchema,
774
+ visible_to_clients: import_zod14.z.boolean(),
775
+ created_at: IsoDateTimeSchema,
776
+ updated_at: IsoDateTimeSchema,
777
+ title: import_zod14.z.string(),
778
+ inherits_status: import_zod14.z.boolean(),
779
+ type: import_zod14.z.string(),
780
+ url: import_zod14.z.string().url(),
781
+ app_url: import_zod14.z.string().url(),
782
+ bookmark_url: import_zod14.z.string().url().optional(),
783
+ subscription_url: import_zod14.z.string().url().optional(),
784
+ parent: RecordingRefSchema,
785
+ bucket: BucketRefSchema,
786
+ creator: PersonSummarySchema,
787
+ content: import_zod14.z.string(),
788
+ subject: import_zod14.z.string(),
789
+ from: import_zod14.z.string().nullable().optional(),
790
+ replies_count: import_zod14.z.number().int().nonnegative(),
791
+ replies_url: import_zod14.z.string().url()
792
+ });
793
+ var ForwardListResponseSchema = import_zod14.z.array(ForwardSchema);
794
+ var ForwardListQuerySchema = import_zod14.z.object({
795
+ page: import_zod14.z.coerce.number().int().positive().optional()
796
+ });
797
+
798
+ // src/contract/resources/communications/forwards.ts
799
+ var ForwardListPathParamsSchema = import_zod15.z.object({
800
+ bucketId: BasecampIdParamSchema,
801
+ inboxId: BasecampIdParamSchema
802
+ });
803
+ var ForwardPathParamsSchema = import_zod15.z.object({
804
+ bucketId: BasecampIdParamSchema,
805
+ forwardId: BasecampIdParamSchema
806
+ });
807
+ var forwardsRouter = c.router({
808
+ list: {
809
+ summary: "List forwards",
810
+ description: "Returns the email forwards that live under a project inbox. Results are paginated via Link headers.",
811
+ metadata: {
812
+ tag: "Forwards",
813
+ operationId: "forwards.list",
814
+ docsPath: "/docs/basecamp-api-specs/sections/forwards.md#get-forwards"
815
+ },
816
+ method: "GET",
817
+ path: "/buckets/:bucketId/inboxes/:inboxId/forwards",
818
+ pathParams: ForwardListPathParamsSchema,
819
+ query: ForwardListQuerySchema,
820
+ responses: {
821
+ 200: ForwardListResponseSchema
822
+ }
823
+ },
824
+ get: {
825
+ summary: "Get a forward",
826
+ description: "Fetch a single email forward recording.",
827
+ metadata: {
828
+ tag: "Forwards",
829
+ operationId: "forwards.get",
830
+ docsPath: "/docs/basecamp-api-specs/sections/forwards.md#get-a-forward"
831
+ },
832
+ method: "GET",
833
+ path: "/buckets/:bucketId/inbox_forwards/:forwardId",
834
+ pathParams: ForwardPathParamsSchema,
835
+ responses: {
836
+ 200: ForwardSchema
837
+ }
838
+ },
839
+ trash: {
840
+ summary: "Trash a forward",
841
+ description: "Move a forward to the trash. Trashed forwards can be restored from the Basecamp UI if needed.",
842
+ metadata: {
843
+ tag: "Forwards",
844
+ operationId: "forwards.trash",
845
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#trash-a-recording"
846
+ },
847
+ method: "PUT",
848
+ path: "/buckets/:bucketId/recordings/:forwardId/status/trashed",
849
+ pathParams: ForwardPathParamsSchema,
850
+ body: c.noBody(),
851
+ responses: {
852
+ 204: c.noBody()
853
+ }
854
+ }
855
+ });
856
+
857
+ // src/contract/resources/communications/inbox-replies.ts
858
+ var import_zod17 = require("zod");
859
+
860
+ // src/contract/schemas/communications/inbox-replies.ts
861
+ var import_zod16 = require("zod");
862
+ var InboxReplySchema = import_zod16.z.object({
863
+ id: BasecampIdSchema,
864
+ status: RecordingStatusSchema,
865
+ visible_to_clients: import_zod16.z.boolean(),
866
+ created_at: IsoDateTimeSchema,
867
+ updated_at: IsoDateTimeSchema,
868
+ title: import_zod16.z.string(),
869
+ inherits_status: import_zod16.z.boolean(),
870
+ type: import_zod16.z.string(),
871
+ url: import_zod16.z.string().url(),
872
+ app_url: import_zod16.z.string().url(),
873
+ bookmark_url: import_zod16.z.string().url().optional(),
874
+ parent: RecordingRefSchema,
875
+ bucket: BucketRefSchema,
876
+ creator: PersonSummarySchema,
877
+ content: HtmlStringSchema
878
+ });
879
+ var InboxReplyListResponseSchema = import_zod16.z.array(InboxReplySchema);
880
+ var InboxReplyListQuerySchema = import_zod16.z.object({
881
+ page: import_zod16.z.coerce.number().int().positive().optional()
882
+ });
883
+
884
+ // src/contract/resources/communications/inbox-replies.ts
885
+ var InboxReplyListPathParamsSchema = import_zod17.z.object({
886
+ bucketId: BasecampIdParamSchema,
887
+ forwardId: BasecampIdParamSchema
888
+ });
889
+ var InboxReplyPathParamsSchema = InboxReplyListPathParamsSchema.extend({
890
+ replyId: BasecampIdParamSchema
891
+ });
892
+ var inboxRepliesRouter = c.router({
893
+ list: {
894
+ summary: "List inbox replies",
895
+ description: "Returns replies that were posted on a forwarded email.",
896
+ metadata: {
897
+ tag: "Inbox Replies",
898
+ operationId: "inboxReplies.list",
899
+ docsPath: "/docs/basecamp-api-specs/sections/inbox_replies.md#get-inbox-replies"
900
+ },
901
+ method: "GET",
902
+ path: "/buckets/:bucketId/inbox_forwards/:forwardId/replies",
903
+ pathParams: InboxReplyListPathParamsSchema,
904
+ query: InboxReplyListQuerySchema,
905
+ responses: {
906
+ 200: InboxReplyListResponseSchema
907
+ }
908
+ },
909
+ get: {
910
+ summary: "Get an inbox reply",
911
+ description: "Fetch a single reply posted to a forwarded email.",
912
+ metadata: {
913
+ tag: "Inbox Replies",
914
+ operationId: "inboxReplies.get",
915
+ docsPath: "/docs/basecamp-api-specs/sections/inbox_replies.md#get-an-inbox-reply"
916
+ },
917
+ method: "GET",
918
+ path: "/buckets/:bucketId/inbox_forwards/:forwardId/replies/:replyId",
919
+ pathParams: InboxReplyPathParamsSchema,
920
+ responses: {
921
+ 200: InboxReplySchema
922
+ }
923
+ }
924
+ });
925
+
926
+ // src/contract/resources/communications/client-approvals.ts
927
+ var import_zod19 = require("zod");
928
+
929
+ // src/contract/schemas/communications/client-approvals.ts
930
+ var import_zod18 = require("zod");
931
+ var ApprovalStatusEnum = import_zod18.z.enum(["pending", "approved", "rejected"]).or(import_zod18.z.string());
932
+ var ClientApprovalResponseSchema = import_zod18.z.object({
933
+ id: BasecampIdSchema,
934
+ status: RecordingStatusSchema,
935
+ visible_to_clients: import_zod18.z.boolean(),
936
+ created_at: IsoDateTimeSchema,
937
+ updated_at: IsoDateTimeSchema,
938
+ title: import_zod18.z.string(),
939
+ inherits_status: import_zod18.z.boolean(),
940
+ type: import_zod18.z.string(),
941
+ url: import_zod18.z.string().url().optional(),
942
+ app_url: import_zod18.z.string().url(),
943
+ bookmark_url: import_zod18.z.string().url().optional(),
944
+ parent: RecordingRefSchema,
945
+ bucket: BucketRefSchema,
946
+ creator: PersonSummarySchema,
947
+ content: HtmlStringSchema,
948
+ approved: import_zod18.z.boolean().optional()
949
+ });
950
+ var ClientApprovalSchema = import_zod18.z.object({
951
+ id: BasecampIdSchema,
952
+ status: RecordingStatusSchema,
953
+ visible_to_clients: import_zod18.z.boolean(),
954
+ created_at: IsoDateTimeSchema,
955
+ updated_at: IsoDateTimeSchema,
956
+ title: import_zod18.z.string(),
957
+ inherits_status: import_zod18.z.boolean(),
958
+ type: import_zod18.z.string(),
959
+ url: import_zod18.z.string().url(),
960
+ app_url: import_zod18.z.string().url(),
961
+ bookmark_url: import_zod18.z.string().url().optional(),
962
+ subscription_url: import_zod18.z.string().url().optional(),
963
+ parent: RecordingRefSchema,
964
+ bucket: BucketRefSchema,
965
+ creator: PersonSummarySchema,
966
+ content: HtmlStringSchema,
967
+ subject: import_zod18.z.string(),
968
+ due_on: IsoDateSchema.nullable(),
969
+ replies_count: import_zod18.z.number().int().nonnegative(),
970
+ replies_url: import_zod18.z.string().url(),
971
+ approval_status: ApprovalStatusEnum,
972
+ approver: PersonSummarySchema.optional(),
973
+ responses: import_zod18.z.array(ClientApprovalResponseSchema).optional()
974
+ });
975
+ var ClientApprovalListResponseSchema = import_zod18.z.array(ClientApprovalSchema);
976
+ var ClientApprovalListQuerySchema = import_zod18.z.object({
977
+ page: import_zod18.z.coerce.number().int().positive().optional()
978
+ });
979
+
980
+ // src/contract/resources/communications/client-approvals.ts
981
+ var ClientApprovalListPathParamsSchema = import_zod19.z.object({
982
+ bucketId: BasecampIdParamSchema
983
+ });
984
+ var ClientApprovalPathParamsSchema = ClientApprovalListPathParamsSchema.extend({
985
+ approvalId: BasecampIdParamSchema
986
+ });
987
+ var clientApprovalsRouter = c.router({
988
+ list: {
989
+ summary: "List client approvals",
990
+ description: "Returns the client approvals that have been posted in a project. Results are paginated.",
991
+ metadata: {
992
+ tag: "Client Approvals",
993
+ operationId: "clientApprovals.list",
994
+ docsPath: "/docs/basecamp-api-specs/sections/client_approvals.md#get-client-approvals"
995
+ },
996
+ method: "GET",
997
+ path: "/buckets/:bucketId/client/approvals",
998
+ pathParams: ClientApprovalListPathParamsSchema,
999
+ query: ClientApprovalListQuerySchema,
1000
+ responses: {
1001
+ 200: ClientApprovalListResponseSchema
1002
+ }
1003
+ },
1004
+ get: {
1005
+ summary: "Get a client approval",
1006
+ description: "Fetch a specific client approval recording.",
1007
+ metadata: {
1008
+ tag: "Client Approvals",
1009
+ operationId: "clientApprovals.get",
1010
+ docsPath: "/docs/basecamp-api-specs/sections/client_approvals.md#get-a-client-approval"
1011
+ },
1012
+ method: "GET",
1013
+ path: "/buckets/:bucketId/client/approvals/:approvalId",
1014
+ pathParams: ClientApprovalPathParamsSchema,
1015
+ responses: {
1016
+ 200: ClientApprovalSchema
1017
+ }
1018
+ }
1019
+ });
1020
+
1021
+ // src/contract/resources/communications/client-correspondences.ts
1022
+ var import_zod21 = require("zod");
1023
+
1024
+ // src/contract/schemas/communications/client-correspondences.ts
1025
+ var import_zod20 = require("zod");
1026
+ var ClientCorrespondenceSchema = import_zod20.z.object({
1027
+ id: BasecampIdSchema,
1028
+ status: RecordingStatusSchema,
1029
+ visible_to_clients: import_zod20.z.boolean(),
1030
+ created_at: IsoDateTimeSchema,
1031
+ updated_at: IsoDateTimeSchema,
1032
+ title: import_zod20.z.string(),
1033
+ inherits_status: import_zod20.z.boolean(),
1034
+ type: import_zod20.z.string(),
1035
+ url: import_zod20.z.string().url(),
1036
+ app_url: import_zod20.z.string().url(),
1037
+ bookmark_url: import_zod20.z.string().url().optional(),
1038
+ subscription_url: import_zod20.z.string().url().optional(),
1039
+ parent: RecordingRefSchema,
1040
+ bucket: BucketRefSchema,
1041
+ creator: PersonSummarySchema,
1042
+ content: HtmlStringSchema,
1043
+ subject: import_zod20.z.string(),
1044
+ replies_count: import_zod20.z.number().int().nonnegative(),
1045
+ replies_url: import_zod20.z.string().url()
1046
+ });
1047
+ var ClientCorrespondenceListResponseSchema = import_zod20.z.array(ClientCorrespondenceSchema);
1048
+ var ClientCorrespondenceListQuerySchema = import_zod20.z.object({
1049
+ page: import_zod20.z.coerce.number().int().positive().optional()
1050
+ });
1051
+
1052
+ // src/contract/resources/communications/client-correspondences.ts
1053
+ var ClientCorrespondenceListPathParamsSchema = import_zod21.z.object({
1054
+ bucketId: BasecampIdParamSchema
1055
+ });
1056
+ var ClientCorrespondencePathParamsSchema = ClientCorrespondenceListPathParamsSchema.extend({
1057
+ correspondenceId: BasecampIdParamSchema
1058
+ });
1059
+ var clientCorrespondencesRouter = c.router({
1060
+ list: {
1061
+ summary: "List client correspondences",
1062
+ description: "Returns the client correspondences posted in a project.",
1063
+ metadata: {
1064
+ tag: "Client Correspondences",
1065
+ operationId: "clientCorrespondences.list",
1066
+ docsPath: "/docs/basecamp-api-specs/sections/client_correspondences.md#get-client-correspondences"
1067
+ },
1068
+ method: "GET",
1069
+ path: "/buckets/:bucketId/client/correspondences",
1070
+ pathParams: ClientCorrespondenceListPathParamsSchema,
1071
+ query: ClientCorrespondenceListQuerySchema,
1072
+ responses: {
1073
+ 200: ClientCorrespondenceListResponseSchema
1074
+ }
1075
+ },
1076
+ get: {
1077
+ summary: "Get a client correspondence",
1078
+ description: "Fetch a specific client correspondence recording.",
1079
+ metadata: {
1080
+ tag: "Client Correspondences",
1081
+ operationId: "clientCorrespondences.get",
1082
+ docsPath: "/docs/basecamp-api-specs/sections/client_correspondences.md#get-a-client-correspondence"
1083
+ },
1084
+ method: "GET",
1085
+ path: "/buckets/:bucketId/client/correspondences/:correspondenceId",
1086
+ pathParams: ClientCorrespondencePathParamsSchema,
1087
+ responses: {
1088
+ 200: ClientCorrespondenceSchema
1089
+ }
1090
+ }
1091
+ });
1092
+
1093
+ // src/contract/resources/communications/client-replies.ts
1094
+ var import_zod23 = require("zod");
1095
+
1096
+ // src/contract/schemas/communications/client-replies.ts
1097
+ var import_zod22 = require("zod");
1098
+ var ClientReplySchema = import_zod22.z.object({
1099
+ id: BasecampIdSchema,
1100
+ status: RecordingStatusSchema,
1101
+ visible_to_clients: import_zod22.z.boolean(),
1102
+ created_at: IsoDateTimeSchema,
1103
+ updated_at: IsoDateTimeSchema,
1104
+ title: import_zod22.z.string(),
1105
+ inherits_status: import_zod22.z.boolean(),
1106
+ type: import_zod22.z.string(),
1107
+ url: import_zod22.z.string().url(),
1108
+ app_url: import_zod22.z.string().url(),
1109
+ bookmark_url: import_zod22.z.string().url().optional(),
1110
+ parent: RecordingRefSchema,
1111
+ bucket: BucketRefSchema,
1112
+ creator: PersonSummarySchema,
1113
+ content: HtmlStringSchema
1114
+ });
1115
+ var ClientReplyListResponseSchema = import_zod22.z.array(ClientReplySchema);
1116
+ var ClientReplyListQuerySchema = import_zod22.z.object({
1117
+ page: import_zod22.z.coerce.number().int().positive().optional()
1118
+ });
1119
+
1120
+ // src/contract/resources/communications/client-replies.ts
1121
+ var ClientReplyListPathParamsSchema = import_zod23.z.object({
1122
+ bucketId: BasecampIdParamSchema,
1123
+ recordingId: BasecampIdParamSchema
1124
+ });
1125
+ var ClientReplyPathParamsSchema = ClientReplyListPathParamsSchema.extend({
1126
+ replyId: BasecampIdParamSchema
1127
+ });
1128
+ var clientRepliesRouter = c.router({
1129
+ list: {
1130
+ summary: "List client replies",
1131
+ description: "Returns replies that clients posted to client correspondences or client approvals.",
1132
+ metadata: {
1133
+ tag: "Client Replies",
1134
+ operationId: "clientReplies.list",
1135
+ docsPath: "/docs/basecamp-api-specs/sections/client_replies.md#get-client-replies"
1136
+ },
1137
+ method: "GET",
1138
+ path: "/buckets/:bucketId/client/recordings/:recordingId/replies",
1139
+ pathParams: ClientReplyListPathParamsSchema,
1140
+ query: ClientReplyListQuerySchema,
1141
+ responses: {
1142
+ 200: ClientReplyListResponseSchema
1143
+ }
1144
+ },
1145
+ get: {
1146
+ summary: "Get a client reply",
1147
+ description: "Fetch a single reply posted by a client.",
1148
+ metadata: {
1149
+ tag: "Client Replies",
1150
+ operationId: "clientReplies.get",
1151
+ docsPath: "/docs/basecamp-api-specs/sections/client_replies.md#get-a-client-reply"
1152
+ },
1153
+ method: "GET",
1154
+ path: "/buckets/:bucketId/client/recordings/:recordingId/replies/:replyId",
1155
+ pathParams: ClientReplyPathParamsSchema,
1156
+ responses: {
1157
+ 200: ClientReplySchema
1158
+ }
1159
+ }
1160
+ });
1161
+
1162
+ // src/contract/resources/communications/client-visibility.ts
1163
+ var import_zod26 = require("zod");
1164
+
1165
+ // src/contract/schemas/communications/client-visibility.ts
1166
+ var import_zod25 = require("zod");
1167
+
1168
+ // src/contract/schemas/recordings.ts
1169
+ var import_zod24 = require("zod");
1170
+ var KnownRecordingTypeSchema = import_zod24.z.enum([
1171
+ "Comment",
1172
+ "Document",
1173
+ "Kanban::Card",
1174
+ "Kanban::Step",
1175
+ "Message",
1176
+ "Question::Answer",
1177
+ "Schedule::Entry",
1178
+ "Todo",
1179
+ "Todolist",
1180
+ "Upload",
1181
+ "Vault"
1182
+ ]);
1183
+ var RecordingTypeSchema = KnownRecordingTypeSchema.or(import_zod24.z.string());
1184
+ var RecordingSummarySchema = import_zod24.z.object({
1185
+ id: BasecampIdSchema,
1186
+ type: import_zod24.z.string(),
1187
+ status: RecordingStatusSchema.optional(),
1188
+ title: import_zod24.z.string().optional(),
1189
+ created_at: IsoDateTimeSchema.optional(),
1190
+ updated_at: IsoDateTimeSchema.optional(),
1191
+ url: import_zod24.z.string().url(),
1192
+ app_url: import_zod24.z.string().url(),
1193
+ bucket: BucketRefSchema.optional(),
1194
+ parent: RecordingRefSchema.optional(),
1195
+ creator: PersonSummarySchema.optional()
1196
+ }).passthrough();
1197
+ var RecordingListResponseSchema = import_zod24.z.array(RecordingSummarySchema);
1198
+ var RecordingListQuerySchema = import_zod24.z.object({
1199
+ type: RecordingTypeSchema,
1200
+ bucket: import_zod24.z.string().optional(),
1201
+ status: RecordingStatusSchema.optional(),
1202
+ sort: import_zod24.z.enum(["created_at", "updated_at"]).or(import_zod24.z.string()).optional(),
1203
+ direction: import_zod24.z.enum(["asc", "desc"]).or(import_zod24.z.string()).optional(),
1204
+ page: import_zod24.z.coerce.number().int().positive().optional()
1205
+ });
1206
+
1207
+ // src/contract/schemas/communications/client-visibility.ts
1208
+ var ClientVisibilityUpdateBodySchema = import_zod25.z.object({
1209
+ visible_to_clients: import_zod25.z.boolean()
1210
+ });
1211
+ var ClientVisibilityRecordingSchema = RecordingSummarySchema.extend({
1212
+ visible_to_clients: import_zod25.z.boolean().optional()
1213
+ });
1214
+
1215
+ // src/contract/resources/communications/client-visibility.ts
1216
+ var ClientVisibilityPathParamsSchema = import_zod26.z.object({
1217
+ bucketId: BasecampIdParamSchema,
1218
+ recordingId: BasecampIdParamSchema
1219
+ });
1220
+ var clientVisibilityRouter = c.router({
1221
+ update: {
1222
+ summary: "Toggle client visibility",
1223
+ description: "Update whether a recording is visible to clients. Only recordings that control their own visibility can be toggled.",
1224
+ metadata: {
1225
+ tag: "Client Visibility",
1226
+ operationId: "clientVisibility.update",
1227
+ docsPath: "/docs/basecamp-api-specs/sections/client_visibility.md#toggle-client-visibility"
1228
+ },
1229
+ method: "PUT",
1230
+ path: "/buckets/:bucketId/recordings/:recordingId/client_visibility",
1231
+ pathParams: ClientVisibilityPathParamsSchema,
1232
+ body: ClientVisibilityUpdateBodySchema,
1233
+ responses: {
1234
+ 200: ClientVisibilityRecordingSchema
1235
+ }
1236
+ }
1237
+ });
1238
+
1239
+ // src/contract/resources/documents/documents.ts
1240
+ var import_zod31 = require("zod");
1241
+
1242
+ // src/contract/schemas/documents/documents.ts
1243
+ var import_zod27 = require("zod");
1244
+ var DocumentCoreSchema = import_zod27.z.object({
1245
+ id: BasecampIdSchema,
1246
+ status: RecordingStatusSchema,
1247
+ visible_to_clients: import_zod27.z.boolean(),
1248
+ created_at: IsoDateTimeSchema,
1249
+ updated_at: IsoDateTimeSchema,
1250
+ title: import_zod27.z.string(),
1251
+ inherits_status: import_zod27.z.boolean(),
1252
+ type: import_zod27.z.literal("Document"),
1253
+ url: import_zod27.z.string().url(),
1254
+ app_url: import_zod27.z.string().url(),
1255
+ bookmark_url: import_zod27.z.string().url(),
1256
+ subscription_url: import_zod27.z.string().url(),
1257
+ comments_count: import_zod27.z.number().int().nonnegative(),
1258
+ comments_url: import_zod27.z.string().url(),
1259
+ position: import_zod27.z.number().int().nonnegative(),
1260
+ parent: RecordingRefSchema,
1261
+ bucket: BucketRefSchema,
1262
+ creator: PersonSummarySchema
1263
+ });
1264
+ var DocumentSchema = DocumentCoreSchema.extend({
1265
+ content: HtmlStringSchema
1266
+ });
1267
+ var DocumentListResponseSchema = import_zod27.z.array(DocumentSchema);
1268
+ var DocumentListQuerySchema = import_zod27.z.object({
1269
+ page: import_zod27.z.coerce.number().int().positive().optional()
1270
+ });
1271
+ var DocumentCreateBodySchema = import_zod27.z.object({
1272
+ title: import_zod27.z.string().min(1),
1273
+ content: HtmlStringSchema,
1274
+ status: import_zod27.z.enum(["active", "draft"]).or(import_zod27.z.string()).optional()
1275
+ });
1276
+ var DocumentUpdateBodySchema = import_zod27.z.object({
1277
+ title: import_zod27.z.string().min(1).optional(),
1278
+ content: HtmlStringSchema.optional()
1279
+ }).refine(
1280
+ (value) => Object.keys(value).length > 0,
1281
+ "At least one field must be provided to update a document."
1282
+ );
1283
+
1284
+ // src/contract/schemas/documents/vaults.ts
1285
+ var import_zod28 = require("zod");
1286
+ var VaultCoreSchema = import_zod28.z.object({
1287
+ id: BasecampIdSchema,
1288
+ status: RecordingStatusSchema,
1289
+ visible_to_clients: import_zod28.z.boolean(),
1290
+ created_at: IsoDateTimeSchema,
1291
+ updated_at: IsoDateTimeSchema,
1292
+ title: import_zod28.z.string(),
1293
+ inherits_status: import_zod28.z.boolean(),
1294
+ type: import_zod28.z.literal("Vault"),
1295
+ url: import_zod28.z.string().url(),
1296
+ app_url: import_zod28.z.string().url(),
1297
+ bookmark_url: import_zod28.z.string().url(),
1298
+ position: import_zod28.z.number().int().nonnegative(),
1299
+ parent: RecordingRefSchema.optional(),
1300
+ bucket: BucketRefSchema,
1301
+ creator: PersonSummarySchema
1302
+ });
1303
+ var VaultSchema = VaultCoreSchema.extend({
1304
+ documents_count: import_zod28.z.number().int().nonnegative(),
1305
+ documents_url: import_zod28.z.string().url(),
1306
+ uploads_count: import_zod28.z.number().int().nonnegative(),
1307
+ uploads_url: import_zod28.z.string().url(),
1308
+ vaults_count: import_zod28.z.number().int().nonnegative(),
1309
+ vaults_url: import_zod28.z.string().url()
1310
+ });
1311
+ var VaultListResponseSchema = import_zod28.z.array(VaultSchema);
1312
+ var VaultListQuerySchema = import_zod28.z.object({
1313
+ page: import_zod28.z.coerce.number().int().positive().optional()
1314
+ });
1315
+ var VaultCreateBodySchema = import_zod28.z.object({
1316
+ title: import_zod28.z.string().min(1)
1317
+ });
1318
+ var VaultUpdateBodySchema = import_zod28.z.object({
1319
+ title: import_zod28.z.string().min(1)
1320
+ });
1321
+
1322
+ // src/contract/schemas/documents/uploads.ts
1323
+ var import_zod29 = require("zod");
1324
+ var UploadCoreSchema = import_zod29.z.object({
1325
+ id: BasecampIdSchema,
1326
+ status: RecordingStatusSchema,
1327
+ visible_to_clients: import_zod29.z.boolean(),
1328
+ created_at: IsoDateTimeSchema,
1329
+ updated_at: IsoDateTimeSchema,
1330
+ title: import_zod29.z.string(),
1331
+ inherits_status: import_zod29.z.boolean(),
1332
+ type: import_zod29.z.literal("Upload"),
1333
+ url: import_zod29.z.string().url(),
1334
+ app_url: import_zod29.z.string().url(),
1335
+ bookmark_url: import_zod29.z.string().url(),
1336
+ subscription_url: import_zod29.z.string().url(),
1337
+ comments_count: import_zod29.z.number().int().nonnegative(),
1338
+ comments_url: import_zod29.z.string().url(),
1339
+ position: import_zod29.z.number().int().nonnegative(),
1340
+ parent: RecordingRefSchema,
1341
+ bucket: BucketRefSchema,
1342
+ creator: PersonSummarySchema
1343
+ });
1344
+ var UploadSchema = UploadCoreSchema.extend({
1345
+ description: HtmlStringSchema.optional(),
1346
+ content_type: import_zod29.z.string(),
1347
+ byte_size: import_zod29.z.number().int().nonnegative(),
1348
+ filename: import_zod29.z.string(),
1349
+ download_url: import_zod29.z.string().url(),
1350
+ app_download_url: import_zod29.z.string().url(),
1351
+ width: import_zod29.z.number().int().nonnegative().optional(),
1352
+ height: import_zod29.z.number().int().nonnegative().optional()
1353
+ });
1354
+ var UploadListResponseSchema = import_zod29.z.array(UploadSchema);
1355
+ var UploadListQuerySchema = import_zod29.z.object({
1356
+ page: import_zod29.z.coerce.number().int().positive().optional()
1357
+ });
1358
+ var UploadCreateBodySchema = import_zod29.z.object({
1359
+ attachable_sgid: import_zod29.z.string().min(1),
1360
+ description: HtmlStringSchema.optional(),
1361
+ base_name: import_zod29.z.string().optional()
1362
+ });
1363
+ var UploadUpdateBodySchema = import_zod29.z.object({
1364
+ description: HtmlStringSchema.optional(),
1365
+ base_name: import_zod29.z.string().optional()
1366
+ }).refine(
1367
+ (value) => Object.keys(value).length > 0,
1368
+ "At least one field must be provided to update an upload."
1369
+ );
1370
+
1371
+ // src/contract/schemas/documents/attachments.ts
1372
+ var import_zod30 = require("zod");
1373
+ var AttachmentResponseSchema = import_zod30.z.object({
1374
+ attachable_sgid: import_zod30.z.string().min(1)
1375
+ });
1376
+ var AttachmentCreateQuerySchema = import_zod30.z.object({
1377
+ name: import_zod30.z.string().min(1)
1378
+ });
1379
+
1380
+ // src/contract/resources/documents/documents.ts
1381
+ var bucketAndVaultPathParams = import_zod31.z.object({
1382
+ bucketId: BasecampIdParamSchema,
1383
+ vaultId: BasecampIdParamSchema
1384
+ });
1385
+ var bucketAndDocumentPathParams = import_zod31.z.object({
1386
+ bucketId: BasecampIdParamSchema,
1387
+ documentId: BasecampIdParamSchema
1388
+ });
1389
+ var documentsRouter = c.router({
1390
+ list: {
1391
+ summary: "List documents",
1392
+ description: "Returns a paginated list of active documents in a vault. Pagination data is available via the Link and X-Total-Count headers.",
1393
+ metadata: {
1394
+ tag: "Documents",
1395
+ operationId: "documents.list",
1396
+ docsPath: "/docs/basecamp-api-specs/sections/documents.md#get-documents"
1397
+ },
1398
+ method: "GET",
1399
+ path: "/buckets/:bucketId/vaults/:vaultId/documents",
1400
+ pathParams: bucketAndVaultPathParams,
1401
+ query: DocumentListQuerySchema,
1402
+ responses: {
1403
+ 200: DocumentListResponseSchema
1404
+ }
1405
+ },
1406
+ get: {
1407
+ summary: "Get a document",
1408
+ description: "Fetch the full representation of a single document.",
1409
+ metadata: {
1410
+ tag: "Documents",
1411
+ operationId: "documents.get",
1412
+ docsPath: "/docs/basecamp-api-specs/sections/documents.md#get-a-document"
1413
+ },
1414
+ method: "GET",
1415
+ path: "/buckets/:bucketId/documents/:documentId",
1416
+ pathParams: bucketAndDocumentPathParams,
1417
+ responses: {
1418
+ 200: DocumentSchema
1419
+ }
1420
+ },
1421
+ create: {
1422
+ summary: "Create a document",
1423
+ description: 'Publish a document in a vault. Setting status to "active" makes the document visible immediately.',
1424
+ metadata: {
1425
+ tag: "Documents",
1426
+ operationId: "documents.create",
1427
+ docsPath: "/docs/basecamp-api-specs/sections/documents.md#create-a-document"
1428
+ },
1429
+ method: "POST",
1430
+ path: "/buckets/:bucketId/vaults/:vaultId/documents",
1431
+ pathParams: bucketAndVaultPathParams,
1432
+ body: DocumentCreateBodySchema,
1433
+ responses: {
1434
+ 201: DocumentSchema
1435
+ }
1436
+ },
1437
+ update: {
1438
+ summary: "Update a document",
1439
+ description: "Update the title or content of an existing document.",
1440
+ metadata: {
1441
+ tag: "Documents",
1442
+ operationId: "documents.update",
1443
+ docsPath: "/docs/basecamp-api-specs/sections/documents.md#update-a-document"
1444
+ },
1445
+ method: "PUT",
1446
+ path: "/buckets/:bucketId/documents/:documentId",
1447
+ pathParams: bucketAndDocumentPathParams,
1448
+ body: DocumentUpdateBodySchema,
1449
+ responses: {
1450
+ 200: DocumentSchema
1451
+ }
1452
+ },
1453
+ trash: {
1454
+ summary: "Trash a document",
1455
+ description: "Move a document recording to the trash. Trashed items can be restored via the UI.",
1456
+ metadata: {
1457
+ tag: "Documents",
1458
+ operationId: "documents.trash",
1459
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#trash-a-recording"
1460
+ },
1461
+ method: "PUT",
1462
+ path: "/buckets/:bucketId/recordings/:documentId/status/trashed",
1463
+ pathParams: bucketAndDocumentPathParams,
1464
+ body: c.noBody(),
1465
+ responses: {
1466
+ 204: c.noBody()
1467
+ }
1468
+ }
1469
+ });
1470
+
1471
+ // src/contract/resources/documents/vaults.ts
1472
+ var import_zod32 = require("zod");
1473
+ var bucketAndVaultPathParams2 = import_zod32.z.object({
1474
+ bucketId: BasecampIdParamSchema,
1475
+ vaultId: BasecampIdParamSchema
1476
+ });
1477
+ var bucketAndParentVaultPathParams = import_zod32.z.object({
1478
+ bucketId: BasecampIdParamSchema,
1479
+ parentVaultId: BasecampIdParamSchema
1480
+ });
1481
+ var vaultsRouter = c.router({
1482
+ list: {
1483
+ summary: "List vaults",
1484
+ description: "Returns a paginated list of vaults nested under a parent vault. Pagination data is available via the Link and X-Total-Count headers.",
1485
+ metadata: {
1486
+ tag: "Vaults",
1487
+ operationId: "vaults.list",
1488
+ docsPath: "/docs/basecamp-api-specs/sections/vaults.md#get-vaults"
1489
+ },
1490
+ method: "GET",
1491
+ path: "/buckets/:bucketId/vaults/:parentVaultId/vaults",
1492
+ pathParams: bucketAndParentVaultPathParams,
1493
+ query: VaultListQuerySchema,
1494
+ responses: {
1495
+ 200: VaultListResponseSchema
1496
+ }
1497
+ },
1498
+ get: {
1499
+ summary: "Get a vault",
1500
+ description: "Fetch the full representation of a single vault.",
1501
+ metadata: {
1502
+ tag: "Vaults",
1503
+ operationId: "vaults.get",
1504
+ docsPath: "/docs/basecamp-api-specs/sections/vaults.md#get-a-vault"
1505
+ },
1506
+ method: "GET",
1507
+ path: "/buckets/:bucketId/vaults/:vaultId",
1508
+ pathParams: bucketAndVaultPathParams2,
1509
+ responses: {
1510
+ 200: VaultSchema
1511
+ }
1512
+ },
1513
+ create: {
1514
+ summary: "Create a vault",
1515
+ description: "Create a new vault nested under a parent vault.",
1516
+ metadata: {
1517
+ tag: "Vaults",
1518
+ operationId: "vaults.create",
1519
+ docsPath: "/docs/basecamp-api-specs/sections/vaults.md#create-a-vault"
1520
+ },
1521
+ method: "POST",
1522
+ path: "/buckets/:bucketId/vaults/:parentVaultId/vaults",
1523
+ pathParams: bucketAndParentVaultPathParams,
1524
+ body: VaultCreateBodySchema,
1525
+ responses: {
1526
+ 201: VaultSchema
1527
+ }
1528
+ },
1529
+ update: {
1530
+ summary: "Update a vault",
1531
+ description: "Update the title of an existing vault.",
1532
+ metadata: {
1533
+ tag: "Vaults",
1534
+ operationId: "vaults.update",
1535
+ docsPath: "/docs/basecamp-api-specs/sections/vaults.md#update-a-vault"
1536
+ },
1537
+ method: "PUT",
1538
+ path: "/buckets/:bucketId/vaults/:vaultId",
1539
+ pathParams: bucketAndVaultPathParams2,
1540
+ body: VaultUpdateBodySchema,
1541
+ responses: {
1542
+ 200: VaultSchema
1543
+ }
1544
+ },
1545
+ trash: {
1546
+ summary: "Trash a vault",
1547
+ description: "Move a vault recording to the trash. Trashed items can be restored via the UI.",
1548
+ metadata: {
1549
+ tag: "Vaults",
1550
+ operationId: "vaults.trash",
1551
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#trash-a-recording"
1552
+ },
1553
+ method: "PUT",
1554
+ path: "/buckets/:bucketId/recordings/:vaultId/status/trashed",
1555
+ pathParams: bucketAndVaultPathParams2,
1556
+ body: c.noBody(),
1557
+ responses: {
1558
+ 204: c.noBody()
1559
+ }
1560
+ }
1561
+ });
1562
+
1563
+ // src/contract/resources/documents/uploads.ts
1564
+ var import_zod33 = require("zod");
1565
+ var bucketAndVaultPathParams3 = import_zod33.z.object({
1566
+ bucketId: BasecampIdParamSchema,
1567
+ vaultId: BasecampIdParamSchema
1568
+ });
1569
+ var bucketAndUploadPathParams = import_zod33.z.object({
1570
+ bucketId: BasecampIdParamSchema,
1571
+ uploadId: BasecampIdParamSchema
1572
+ });
1573
+ var uploadsRouter = c.router({
1574
+ list: {
1575
+ summary: "List uploads",
1576
+ description: "Returns a paginated list of active uploads in a vault. Pagination data is available via the Link and X-Total-Count headers.",
1577
+ metadata: {
1578
+ tag: "Uploads",
1579
+ operationId: "uploads.list",
1580
+ docsPath: "/docs/basecamp-api-specs/sections/uploads.md#get-uploads"
1581
+ },
1582
+ method: "GET",
1583
+ path: "/buckets/:bucketId/vaults/:vaultId/uploads",
1584
+ pathParams: bucketAndVaultPathParams3,
1585
+ query: UploadListQuerySchema,
1586
+ responses: {
1587
+ 200: UploadListResponseSchema
1588
+ }
1589
+ },
1590
+ get: {
1591
+ summary: "Get an upload",
1592
+ description: "Fetch the full representation of a single upload.",
1593
+ metadata: {
1594
+ tag: "Uploads",
1595
+ operationId: "uploads.get",
1596
+ docsPath: "/docs/basecamp-api-specs/sections/uploads.md#get-an-upload"
1597
+ },
1598
+ method: "GET",
1599
+ path: "/buckets/:bucketId/uploads/:uploadId",
1600
+ pathParams: bucketAndUploadPathParams,
1601
+ responses: {
1602
+ 200: UploadSchema
1603
+ }
1604
+ },
1605
+ create: {
1606
+ summary: "Create an upload",
1607
+ description: "Create an upload in a vault using a previously obtained attachable_sgid from the attachments endpoint.",
1608
+ metadata: {
1609
+ tag: "Uploads",
1610
+ operationId: "uploads.create",
1611
+ docsPath: "/docs/basecamp-api-specs/sections/uploads.md#create-an-upload"
1612
+ },
1613
+ method: "POST",
1614
+ path: "/buckets/:bucketId/vaults/:vaultId/uploads",
1615
+ pathParams: bucketAndVaultPathParams3,
1616
+ body: UploadCreateBodySchema,
1617
+ responses: {
1618
+ 201: UploadSchema
1619
+ }
1620
+ },
1621
+ update: {
1622
+ summary: "Update an upload",
1623
+ description: "Update the description or base name of an existing upload.",
1624
+ metadata: {
1625
+ tag: "Uploads",
1626
+ operationId: "uploads.update",
1627
+ docsPath: "/docs/basecamp-api-specs/sections/uploads.md#update-an-upload"
1628
+ },
1629
+ method: "PUT",
1630
+ path: "/buckets/:bucketId/uploads/:uploadId",
1631
+ pathParams: bucketAndUploadPathParams,
1632
+ body: UploadUpdateBodySchema,
1633
+ responses: {
1634
+ 200: UploadSchema
1635
+ }
1636
+ },
1637
+ trash: {
1638
+ summary: "Trash an upload",
1639
+ description: "Move an upload recording to the trash. Trashed items can be restored via the UI.",
1640
+ metadata: {
1641
+ tag: "Uploads",
1642
+ operationId: "uploads.trash",
1643
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#trash-a-recording"
1644
+ },
1645
+ method: "PUT",
1646
+ path: "/buckets/:bucketId/recordings/:uploadId/status/trashed",
1647
+ pathParams: bucketAndUploadPathParams,
1648
+ body: c.noBody(),
1649
+ responses: {
1650
+ 204: c.noBody()
1651
+ }
1652
+ }
1653
+ });
1654
+
1655
+ // src/contract/resources/documents/attachments.ts
1656
+ var attachmentsRouter = c.router({
1657
+ create: {
1658
+ summary: "Create an attachment",
1659
+ description: "Upload a file to get an attachable_sgid that can be used in subsequent requests to create uploads or documents. The request body should be the raw binary file data. Note: Content-Type and Content-Length headers must be set by the caller.",
1660
+ metadata: {
1661
+ tag: "Attachments",
1662
+ operationId: "attachments.create",
1663
+ docsPath: "/docs/basecamp-api-specs/sections/attachments.md#create-an-attachment"
1664
+ },
1665
+ method: "POST",
1666
+ path: "/attachments",
1667
+ query: AttachmentCreateQuerySchema,
1668
+ body: c.type(),
1669
+ responses: {
1670
+ 201: AttachmentResponseSchema
1671
+ }
1672
+ }
1673
+ });
1674
+
1675
+ // src/contract/resources/events.ts
1676
+ var import_zod35 = require("zod");
1677
+
1678
+ // src/contract/schemas/events.ts
1679
+ var import_zod34 = require("zod");
1680
+ var EventDetailsSchema = import_zod34.z.object({}).passthrough();
1681
+ var RecordingEventSchema = import_zod34.z.object({
1682
+ id: BasecampIdSchema,
1683
+ recording_id: BasecampIdSchema,
1684
+ action: import_zod34.z.string(),
1685
+ details: EventDetailsSchema,
1686
+ created_at: IsoDateTimeSchema,
1687
+ creator: PersonSummarySchema
1688
+ });
1689
+ var RecordingEventListResponseSchema = import_zod34.z.array(RecordingEventSchema);
1690
+ var RecordingEventListQuerySchema = import_zod34.z.object({
1691
+ page: import_zod34.z.coerce.number().int().positive().optional()
1692
+ });
1693
+
1694
+ // src/contract/resources/events.ts
1695
+ var RecordingEventsPathParamsSchema = import_zod35.z.object({
1696
+ bucketId: BasecampIdParamSchema,
1697
+ recordingId: BasecampIdParamSchema
1698
+ });
1699
+ var eventsRouter = c.router({
1700
+ listForRecording: {
1701
+ summary: "List recording events",
1702
+ description: "Returns the event history for a specific recording. Pagination data is available via Link headers.",
1703
+ metadata: {
1704
+ tag: "Events",
1705
+ operationId: "events.listForRecording",
1706
+ docsPath: "/docs/basecamp-api-specs/sections/events.md#get-events"
1707
+ },
1708
+ method: "GET",
1709
+ path: "/buckets/:bucketId/recordings/:recordingId/events",
1710
+ pathParams: RecordingEventsPathParamsSchema,
1711
+ query: RecordingEventListQuerySchema.optional(),
1712
+ responses: {
1713
+ 200: RecordingEventListResponseSchema
1714
+ }
1715
+ }
1716
+ });
1717
+
1718
+ // src/contract/resources/lineup-markers.ts
1719
+ var import_zod37 = require("zod");
1720
+
1721
+ // src/contract/schemas/lineup-markers.ts
1722
+ var import_zod36 = require("zod");
1723
+ var LineupMarkerCreateBodySchema = import_zod36.z.object({
1724
+ name: import_zod36.z.string().min(1),
1725
+ date: IsoDateSchema
1726
+ });
1727
+ var LineupMarkerUpdateBodySchema = import_zod36.z.object({
1728
+ name: import_zod36.z.string().min(1).optional(),
1729
+ date: IsoDateSchema.optional()
1730
+ }).refine((value) => value.name !== void 0 || value.date !== void 0, {
1731
+ message: "Either name or date must be provided."
1732
+ });
1733
+
1734
+ // src/contract/resources/lineup-markers.ts
1735
+ var LineupMarkerPathParamsSchema = import_zod37.z.object({
1736
+ markerId: BasecampIdParamSchema
1737
+ });
1738
+ var lineupMarkersRouter = c.router({
1739
+ create: {
1740
+ summary: "Create a lineup marker",
1741
+ description: "Create an account-wide lineup marker that appears on the Lineup timeline.",
1742
+ metadata: {
1743
+ tag: "LineupMarkers",
1744
+ operationId: "lineupMarkers.create",
1745
+ docsPath: "/docs/basecamp-api-specs/sections/lineup_markers.md#create-a-marker"
1746
+ },
1747
+ method: "POST",
1748
+ path: "/lineup/markers",
1749
+ body: LineupMarkerCreateBodySchema,
1750
+ responses: {
1751
+ 201: c.noBody()
1752
+ }
1753
+ },
1754
+ update: {
1755
+ summary: "Update a lineup marker",
1756
+ description: "Update the name or date of an existing lineup marker.",
1757
+ metadata: {
1758
+ tag: "LineupMarkers",
1759
+ operationId: "lineupMarkers.update",
1760
+ docsPath: "/docs/basecamp-api-specs/sections/lineup_markers.md#update-a-marker"
1761
+ },
1762
+ method: "PUT",
1763
+ path: "/lineup/markers/:markerId",
1764
+ pathParams: LineupMarkerPathParamsSchema,
1765
+ body: LineupMarkerUpdateBodySchema,
1766
+ responses: {
1767
+ 200: c.noBody()
1768
+ }
1769
+ },
1770
+ destroy: {
1771
+ summary: "Destroy a lineup marker",
1772
+ description: "Permanently delete a lineup marker immediately.",
1773
+ metadata: {
1774
+ tag: "LineupMarkers",
1775
+ operationId: "lineupMarkers.destroy",
1776
+ docsPath: "/docs/basecamp-api-specs/sections/lineup_markers.md#destroy-a-marker"
1777
+ },
1778
+ method: "DELETE",
1779
+ path: "/lineup/markers/:markerId",
1780
+ pathParams: LineupMarkerPathParamsSchema,
1781
+ body: c.noBody(),
1782
+ responses: {
1783
+ 204: c.noBody()
1784
+ }
1785
+ }
1786
+ });
1787
+
1788
+ // src/contract/resources/people.ts
1789
+ var import_zod39 = require("zod");
1790
+
1791
+ // src/contract/schemas/people.ts
1792
+ var import_zod38 = require("zod");
1793
+ var PersonSchema = PersonSummarySchema;
1794
+ var PeopleListQuerySchema = import_zod38.z.object({
1795
+ page: import_zod38.z.coerce.number().int().positive().optional()
1796
+ });
1797
+ var PeopleListResponseSchema = import_zod38.z.array(PersonSchema);
1798
+ var ProjectAccessCreateEntrySchema = import_zod38.z.object({
1799
+ name: import_zod38.z.string().min(1),
1800
+ email_address: import_zod38.z.string().email(),
1801
+ title: import_zod38.z.string().optional(),
1802
+ company_name: import_zod38.z.string().optional()
1803
+ });
1804
+ var ProjectPeopleAccessBodySchema = import_zod38.z.object({
1805
+ grant: import_zod38.z.array(BasecampIdSchema).min(1).optional(),
1806
+ revoke: import_zod38.z.array(BasecampIdSchema).min(1).optional(),
1807
+ create: import_zod38.z.array(ProjectAccessCreateEntrySchema).min(1).optional()
1808
+ }).refine(
1809
+ (value) => value.grant !== void 0 || value.revoke !== void 0 || value.create !== void 0,
1810
+ {
1811
+ message: "At least one of grant, revoke, or create must be provided.",
1812
+ path: ["grant"]
1813
+ }
1814
+ );
1815
+ var ProjectPeopleAccessResponseSchema = import_zod38.z.object({
1816
+ granted: import_zod38.z.array(PersonSchema),
1817
+ revoked: import_zod38.z.array(PersonSchema)
1818
+ });
1819
+
1820
+ // src/contract/resources/people.ts
1821
+ var ProjectPathParamsSchema = import_zod39.z.object({
1822
+ projectId: BasecampIdParamSchema
1823
+ });
1824
+ var PersonPathParamsSchema = import_zod39.z.object({
1825
+ personId: BasecampIdParamSchema
1826
+ });
1827
+ var peopleRouter = c.router({
1828
+ list: {
1829
+ summary: "List people",
1830
+ description: "Returns the people visible to the authenticated user across the entire Basecamp account. Pagination data is provided through Link headers when the dataset exceeds a single page.",
1831
+ metadata: {
1832
+ tag: "People",
1833
+ operationId: "people.list",
1834
+ docsPath: "/docs/basecamp-api-specs/sections/people.md#get-all-people"
1835
+ },
1836
+ method: "GET",
1837
+ path: "/people",
1838
+ query: PeopleListQuerySchema.optional(),
1839
+ responses: {
1840
+ 200: PeopleListResponseSchema
1841
+ }
1842
+ },
1843
+ listForProject: {
1844
+ summary: "List project people",
1845
+ description: "Returns the active people on a specific project.",
1846
+ metadata: {
1847
+ tag: "People",
1848
+ operationId: "people.listForProject",
1849
+ docsPath: "/docs/basecamp-api-specs/sections/people.md#get-people-on-a-project"
1850
+ },
1851
+ method: "GET",
1852
+ path: "/projects/:projectId/people",
1853
+ pathParams: ProjectPathParamsSchema,
1854
+ responses: {
1855
+ 200: PeopleListResponseSchema
1856
+ }
1857
+ },
1858
+ updateProjectAccess: {
1859
+ summary: "Update project access",
1860
+ description: "Grant, revoke, or create people directly on a project. At least one of grant, revoke, or create must be present in the request body.",
1861
+ metadata: {
1862
+ tag: "People",
1863
+ operationId: "people.updateProjectAccess",
1864
+ docsPath: "/docs/basecamp-api-specs/sections/people.md#update-who-can-access-a-project"
1865
+ },
1866
+ method: "PUT",
1867
+ path: "/projects/:projectId/people/users",
1868
+ pathParams: ProjectPathParamsSchema,
1869
+ body: ProjectPeopleAccessBodySchema,
1870
+ responses: {
1871
+ 200: ProjectPeopleAccessResponseSchema
1872
+ }
1873
+ },
1874
+ listPingable: {
1875
+ summary: "List pingable people",
1876
+ description: "Returns the people who can be pinged by the authenticated user. The endpoint is not paginated.",
1877
+ metadata: {
1878
+ tag: "People",
1879
+ operationId: "people.listPingable",
1880
+ docsPath: "/docs/basecamp-api-specs/sections/people.md#get-pingable-people"
1881
+ },
1882
+ method: "GET",
1883
+ path: "/circles/people",
1884
+ responses: {
1885
+ 200: PeopleListResponseSchema
1886
+ }
1887
+ },
1888
+ get: {
1889
+ summary: "Get a person",
1890
+ description: "Fetch the profile for a person by identifier.",
1891
+ metadata: {
1892
+ tag: "People",
1893
+ operationId: "people.get",
1894
+ docsPath: "/docs/basecamp-api-specs/sections/people.md#get-person"
1895
+ },
1896
+ method: "GET",
1897
+ path: "/people/:personId",
1898
+ pathParams: PersonPathParamsSchema,
1899
+ responses: {
1900
+ 200: PersonSchema
1901
+ }
1902
+ },
1903
+ me: {
1904
+ summary: "Get my personal info",
1905
+ description: "Fetch the profile for the authenticated user.",
1906
+ metadata: {
1907
+ tag: "People",
1908
+ operationId: "people.me",
1909
+ docsPath: "/docs/basecamp-api-specs/sections/people.md#get-my-personal-info"
1910
+ },
1911
+ method: "GET",
1912
+ path: "/my/profile",
1913
+ responses: {
1914
+ 200: PersonSchema
1915
+ }
1916
+ }
1917
+ });
1918
+
1919
+ // src/contract/resources/projects.ts
1920
+ var import_zod41 = require("zod");
1921
+
1922
+ // src/contract/schemas/projects.ts
1923
+ var import_zod40 = require("zod");
1924
+ var ProjectDockEntrySchema = import_zod40.z.object({
1925
+ id: BasecampIdSchema,
1926
+ title: import_zod40.z.string(),
1927
+ name: import_zod40.z.string(),
1928
+ enabled: import_zod40.z.boolean(),
1929
+ position: import_zod40.z.number().int().nullable(),
1930
+ url: import_zod40.z.string().url(),
1931
+ app_url: import_zod40.z.string().url()
1932
+ });
1933
+ var ProjectClientCompanySchema = import_zod40.z.object({
1934
+ id: BasecampIdSchema,
1935
+ name: import_zod40.z.string()
1936
+ });
1937
+ var ProjectClientsideSchema = import_zod40.z.object({
1938
+ url: import_zod40.z.string().url(),
1939
+ app_url: import_zod40.z.string().url()
1940
+ });
1941
+ var ProjectStatusSchema = import_zod40.z.enum(["active", "archived", "trashed"]).or(import_zod40.z.string());
1942
+ var ProjectCoreSchema = import_zod40.z.object({
1943
+ id: BasecampIdSchema,
1944
+ status: ProjectStatusSchema,
1945
+ created_at: IsoDateTimeSchema,
1946
+ updated_at: IsoDateTimeSchema,
1947
+ name: import_zod40.z.string(),
1948
+ description: HtmlStringSchema.nullable().optional(),
1949
+ purpose: import_zod40.z.string(),
1950
+ clients_enabled: import_zod40.z.boolean(),
1951
+ bookmark_url: import_zod40.z.string().url(),
1952
+ url: import_zod40.z.string().url(),
1953
+ app_url: import_zod40.z.string().url(),
1954
+ dock: import_zod40.z.array(ProjectDockEntrySchema),
1955
+ client_company: ProjectClientCompanySchema.optional(),
1956
+ clientside: ProjectClientsideSchema.optional()
1957
+ });
1958
+ var ProjectSchema = ProjectCoreSchema.extend({
1959
+ bookmarked: import_zod40.z.boolean().optional()
1960
+ });
1961
+ var ProjectListResponseSchema = import_zod40.z.array(ProjectSchema);
1962
+ var ProjectListQuerySchema = import_zod40.z.object({
1963
+ status: import_zod40.z.enum(["active", "archived", "trashed"]).or(import_zod40.z.string()).optional(),
1964
+ page: import_zod40.z.coerce.number().int().positive().optional()
1965
+ });
1966
+ var ProjectCreateBodySchema = import_zod40.z.object({
1967
+ name: import_zod40.z.string().min(1),
1968
+ description: HtmlStringSchema.nullable().optional()
1969
+ });
1970
+ var ScheduleAttributesSchema = import_zod40.z.object({
1971
+ start_date: import_zod40.z.string().date().optional(),
1972
+ end_date: import_zod40.z.string().date().optional()
1973
+ }).refine(
1974
+ (value) => value.start_date === void 0 && value.end_date === void 0 || value.start_date !== void 0 && value.end_date !== void 0,
1975
+ {
1976
+ message: "Both start_date and end_date must be provided together.",
1977
+ path: ["end_date"]
1978
+ }
1979
+ );
1980
+ var ProjectUpdateBodySchema = import_zod40.z.object({
1981
+ name: import_zod40.z.string().min(1),
1982
+ description: HtmlStringSchema.nullable().optional(),
1983
+ admissions: import_zod40.z.enum(["invite", "employee", "team"]).or(import_zod40.z.string()).optional(),
1984
+ schedule_attributes: ScheduleAttributesSchema.optional()
1985
+ });
1986
+
1987
+ // src/contract/resources/projects.ts
1988
+ var ProjectPathParamsSchema2 = import_zod41.z.object({
1989
+ projectId: BasecampIdParamSchema
1990
+ });
1991
+ var projectsRouter = c.router({
1992
+ list: {
1993
+ summary: "List projects",
1994
+ description: "Returns active projects visible to the authenticated user. Pagination data is exposed via standard Link headers.",
1995
+ metadata: {
1996
+ tag: "Projects",
1997
+ operationId: "projects.list",
1998
+ docsPath: "/docs/basecamp-api-specs/sections/projects.md#get-projects"
1999
+ },
2000
+ method: "GET",
2001
+ path: "/projects",
2002
+ query: ProjectListQuerySchema.optional(),
2003
+ responses: {
2004
+ 200: ProjectListResponseSchema
2005
+ }
2006
+ },
2007
+ get: {
2008
+ summary: "Get a project",
2009
+ description: "Fetch the full representation of a single project by its identifier.",
2010
+ metadata: {
2011
+ tag: "Projects",
2012
+ operationId: "projects.get",
2013
+ docsPath: "/docs/basecamp-api-specs/sections/projects.md#get-a-project"
2014
+ },
2015
+ method: "GET",
2016
+ path: "/projects/:projectId",
2017
+ pathParams: ProjectPathParamsSchema2,
2018
+ responses: {
2019
+ 200: ProjectSchema
2020
+ }
2021
+ },
2022
+ create: {
2023
+ summary: "Create a project",
2024
+ description: "Create a new project with an optional description.",
2025
+ metadata: {
2026
+ tag: "Projects",
2027
+ operationId: "projects.create",
2028
+ docsPath: "/docs/basecamp-api-specs/sections/projects.md#create-a-project"
2029
+ },
2030
+ method: "POST",
2031
+ path: "/projects",
2032
+ body: ProjectCreateBodySchema,
2033
+ responses: {
2034
+ 201: ProjectSchema,
2035
+ 507: import_zod41.z.object({
2036
+ error: import_zod41.z.string()
2037
+ })
2038
+ }
2039
+ },
2040
+ update: {
2041
+ summary: "Update a project",
2042
+ description: "Update a project name, description, admissions policy, or schedule dates. Basecamp requires the name to be present in every update request.",
2043
+ metadata: {
2044
+ tag: "Projects",
2045
+ operationId: "projects.update",
2046
+ docsPath: "/docs/basecamp-api-specs/sections/projects.md#update-a-project"
2047
+ },
2048
+ method: "PUT",
2049
+ path: "/projects/:projectId",
2050
+ pathParams: ProjectPathParamsSchema2,
2051
+ body: ProjectUpdateBodySchema,
2052
+ responses: {
2053
+ 200: ProjectSchema
2054
+ }
2055
+ },
2056
+ trash: {
2057
+ summary: "Trash a project",
2058
+ description: "Move a project to the trash. The project will be permanently deleted after 30 days unless restored via the UI.",
2059
+ metadata: {
2060
+ tag: "Projects",
2061
+ operationId: "projects.trash",
2062
+ docsPath: "/docs/basecamp-api-specs/sections/projects.md#trash-a-project"
2063
+ },
2064
+ method: "DELETE",
2065
+ path: "/projects/:projectId",
2066
+ pathParams: ProjectPathParamsSchema2,
2067
+ body: c.noBody(),
2068
+ responses: {
2069
+ 204: c.noBody()
2070
+ }
2071
+ }
2072
+ });
2073
+
2074
+ // src/contract/resources/recordings.ts
2075
+ var import_zod42 = require("zod");
2076
+ var BucketRecordingPathParamsSchema = import_zod42.z.object({
2077
+ bucketId: BasecampIdParamSchema,
2078
+ recordingId: BasecampIdParamSchema
2079
+ });
2080
+ var recordingsRouter = c.router({
2081
+ list: {
2082
+ summary: "List recordings",
2083
+ description: "Returns a paginated list of recordings filtered by type and optional bucket or status filters. Use this endpoint to enumerate cross-project activity for a specific recording type.",
2084
+ metadata: {
2085
+ tag: "Recordings",
2086
+ operationId: "recordings.list",
2087
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#get-recordings"
2088
+ },
2089
+ method: "GET",
2090
+ path: "/projects/recordings",
2091
+ query: RecordingListQuerySchema,
2092
+ responses: {
2093
+ 200: RecordingListResponseSchema
2094
+ }
2095
+ },
2096
+ trash: {
2097
+ summary: "Trash a recording",
2098
+ description: "Mark a recording as trashed. Trashed recordings can be restored via the UI.",
2099
+ metadata: {
2100
+ tag: "Recordings",
2101
+ operationId: "recordings.trash",
2102
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#trash-a-recording"
2103
+ },
2104
+ method: "PUT",
2105
+ path: "/buckets/:bucketId/recordings/:recordingId/status/trashed",
2106
+ pathParams: BucketRecordingPathParamsSchema,
2107
+ body: c.noBody(),
2108
+ responses: {
2109
+ 204: c.noBody()
2110
+ }
2111
+ },
2112
+ archive: {
2113
+ summary: "Archive a recording",
2114
+ description: "Mark a recording as archived. Archived recordings remain available but hidden.",
2115
+ metadata: {
2116
+ tag: "Recordings",
2117
+ operationId: "recordings.archive",
2118
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#archive-a-recording"
2119
+ },
2120
+ method: "PUT",
2121
+ path: "/buckets/:bucketId/recordings/:recordingId/status/archived",
2122
+ pathParams: BucketRecordingPathParamsSchema,
2123
+ body: c.noBody(),
2124
+ responses: {
2125
+ 204: c.noBody()
2126
+ }
2127
+ },
2128
+ activate: {
2129
+ summary: "Unarchive a recording",
2130
+ description: "Mark a recording as active to reverse a previous archive action.",
2131
+ metadata: {
2132
+ tag: "Recordings",
2133
+ operationId: "recordings.activate",
2134
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#unarchive-a-recording"
2135
+ },
2136
+ method: "PUT",
2137
+ path: "/buckets/:bucketId/recordings/:recordingId/status/active",
2138
+ pathParams: BucketRecordingPathParamsSchema,
2139
+ body: c.noBody(),
2140
+ responses: {
2141
+ 204: c.noBody()
2142
+ }
2143
+ }
2144
+ });
2145
+
2146
+ // src/contract/resources/scheduling/schedules.ts
2147
+ var import_zod44 = require("zod");
2148
+
2149
+ // src/contract/schemas/scheduling/schedules.ts
2150
+ var import_zod43 = require("zod");
2151
+ var ScheduleSchema = import_zod43.z.object({
2152
+ id: BasecampIdSchema,
2153
+ status: RecordingStatusSchema,
2154
+ visible_to_clients: import_zod43.z.boolean(),
2155
+ created_at: IsoDateTimeSchema,
2156
+ updated_at: IsoDateTimeSchema,
2157
+ title: import_zod43.z.string(),
2158
+ inherits_status: import_zod43.z.boolean(),
2159
+ type: import_zod43.z.literal("Schedule"),
2160
+ url: import_zod43.z.string().url(),
2161
+ app_url: import_zod43.z.string().url(),
2162
+ bookmark_url: import_zod43.z.string().url(),
2163
+ position: import_zod43.z.number().int(),
2164
+ bucket: BucketRefSchema,
2165
+ creator: PersonSummarySchema,
2166
+ include_due_assignments: import_zod43.z.boolean(),
2167
+ entries_count: import_zod43.z.number().int(),
2168
+ entries_url: import_zod43.z.string().url()
2169
+ });
2170
+ var ScheduleUpdateBodySchema = import_zod43.z.object({
2171
+ include_due_assignments: import_zod43.z.boolean()
2172
+ });
2173
+
2174
+ // src/contract/resources/scheduling/schedules.ts
2175
+ var bucketAndSchedulePathParams = import_zod44.z.object({
2176
+ bucketId: BasecampIdParamSchema,
2177
+ scheduleId: BasecampIdParamSchema
2178
+ });
2179
+ var schedulesRouter = c.router({
2180
+ get: {
2181
+ summary: "Get schedule",
2182
+ description: "Returns the schedule for a project. All schedule entries under a project are children of this resource.",
2183
+ metadata: {
2184
+ tag: "Schedules",
2185
+ operationId: "schedules.get",
2186
+ docsPath: "/docs/basecamp-api-specs/sections/schedules.md#get-schedule"
2187
+ },
2188
+ method: "GET",
2189
+ path: "/buckets/:bucketId/schedules/:scheduleId",
2190
+ pathParams: bucketAndSchedulePathParams,
2191
+ responses: {
2192
+ 200: ScheduleSchema
2193
+ }
2194
+ },
2195
+ update: {
2196
+ summary: "Update a schedule",
2197
+ description: "Update whether the schedule should include due dates from to-dos, cards, and steps.",
2198
+ metadata: {
2199
+ tag: "Schedules",
2200
+ operationId: "schedules.update",
2201
+ docsPath: "/docs/basecamp-api-specs/sections/schedules.md#update-a-schedule"
2202
+ },
2203
+ method: "PUT",
2204
+ path: "/buckets/:bucketId/schedules/:scheduleId",
2205
+ pathParams: bucketAndSchedulePathParams,
2206
+ body: ScheduleUpdateBodySchema,
2207
+ responses: {
2208
+ 200: ScheduleSchema
2209
+ }
2210
+ }
2211
+ });
2212
+
2213
+ // src/contract/resources/scheduling/schedule-entries.ts
2214
+ var import_zod46 = require("zod");
2215
+
2216
+ // src/contract/schemas/scheduling/schedule-entries.ts
2217
+ var import_zod45 = require("zod");
2218
+ var RecurrenceScheduleSchema = import_zod45.z.object({
2219
+ frequency: import_zod45.z.string(),
2220
+ days: import_zod45.z.array(import_zod45.z.number().int()),
2221
+ hour: import_zod45.z.number().int(),
2222
+ minute: import_zod45.z.number().int(),
2223
+ week_instance: import_zod45.z.number().int().nullable(),
2224
+ week_interval: import_zod45.z.number().int().nullable(),
2225
+ month_interval: import_zod45.z.number().int().nullable(),
2226
+ start_date: import_zod45.z.string(),
2227
+ end_date: import_zod45.z.string().nullable()
2228
+ });
2229
+ var ScheduleEntrySchema = import_zod45.z.object({
2230
+ id: BasecampIdSchema,
2231
+ status: RecordingStatusSchema,
2232
+ visible_to_clients: import_zod45.z.boolean(),
2233
+ created_at: IsoDateTimeSchema,
2234
+ updated_at: IsoDateTimeSchema,
2235
+ title: import_zod45.z.string(),
2236
+ inherits_status: import_zod45.z.boolean(),
2237
+ type: import_zod45.z.literal("Schedule::Entry"),
2238
+ url: import_zod45.z.string().url(),
2239
+ app_url: import_zod45.z.string().url(),
2240
+ bookmark_url: import_zod45.z.string().url(),
2241
+ subscription_url: import_zod45.z.string().url(),
2242
+ comments_count: import_zod45.z.number().int(),
2243
+ comments_url: import_zod45.z.string().url(),
2244
+ parent: RecordingRefSchema,
2245
+ bucket: BucketRefSchema,
2246
+ creator: PersonSummarySchema,
2247
+ description: HtmlStringSchema,
2248
+ summary: import_zod45.z.string(),
2249
+ all_day: import_zod45.z.boolean(),
2250
+ starts_at: import_zod45.z.string(),
2251
+ ends_at: import_zod45.z.string(),
2252
+ participants: import_zod45.z.array(PersonSummarySchema),
2253
+ recurrence_schedule: RecurrenceScheduleSchema.optional()
2254
+ });
2255
+ var ScheduleEntryListResponseSchema = import_zod45.z.array(ScheduleEntrySchema);
2256
+ var ScheduleEntryListQuerySchema = import_zod45.z.object({
2257
+ status: RecordingStatusSchema.optional(),
2258
+ page: import_zod45.z.coerce.number().int().positive().optional()
2259
+ });
2260
+ var ScheduleEntryCreateBodySchema = import_zod45.z.object({
2261
+ summary: import_zod45.z.string(),
2262
+ starts_at: import_zod45.z.string(),
2263
+ ends_at: import_zod45.z.string(),
2264
+ description: HtmlStringSchema.optional(),
2265
+ participant_ids: import_zod45.z.array(BasecampIdSchema).optional(),
2266
+ all_day: import_zod45.z.boolean().optional(),
2267
+ notify: import_zod45.z.boolean().optional()
2268
+ });
2269
+ var ScheduleEntryUpdateBodySchema = import_zod45.z.object({
2270
+ summary: import_zod45.z.string().optional(),
2271
+ starts_at: import_zod45.z.string().optional(),
2272
+ ends_at: import_zod45.z.string().optional(),
2273
+ description: HtmlStringSchema.optional(),
2274
+ participant_ids: import_zod45.z.array(BasecampIdSchema).optional(),
2275
+ all_day: import_zod45.z.boolean().optional(),
2276
+ notify: import_zod45.z.boolean().optional()
2277
+ });
2278
+
2279
+ // src/contract/resources/scheduling/schedule-entries.ts
2280
+ var bucketAndSchedulePathParams2 = import_zod46.z.object({
2281
+ bucketId: BasecampIdParamSchema,
2282
+ scheduleId: BasecampIdParamSchema
2283
+ });
2284
+ var bucketAndEntryPathParams = import_zod46.z.object({
2285
+ bucketId: BasecampIdParamSchema,
2286
+ scheduleEntryId: BasecampIdParamSchema
2287
+ });
2288
+ var bucketEntryOccurrencePathParams = import_zod46.z.object({
2289
+ bucketId: BasecampIdParamSchema,
2290
+ scheduleEntryId: BasecampIdParamSchema,
2291
+ occurrenceDate: import_zod46.z.string()
2292
+ });
2293
+ var scheduleEntriesRouter = c.router({
2294
+ list: {
2295
+ summary: "List schedule entries",
2296
+ description: "Returns a paginated list of schedule entries in a schedule. Use status filter to get archived or trashed entries.",
2297
+ metadata: {
2298
+ tag: "Schedule Entries",
2299
+ operationId: "scheduleEntries.list",
2300
+ docsPath: "/docs/basecamp-api-specs/sections/schedule_entries.md#get-schedule-entries"
2301
+ },
2302
+ method: "GET",
2303
+ path: "/buckets/:bucketId/schedules/:scheduleId/entries",
2304
+ pathParams: bucketAndSchedulePathParams2,
2305
+ query: ScheduleEntryListQuerySchema,
2306
+ responses: {
2307
+ 200: ScheduleEntryListResponseSchema
2308
+ }
2309
+ },
2310
+ get: {
2311
+ summary: "Get a schedule entry",
2312
+ description: "Returns a schedule entry. For recurring entries, this redirects to the first occurrence.",
2313
+ metadata: {
2314
+ tag: "Schedule Entries",
2315
+ operationId: "scheduleEntries.get",
2316
+ docsPath: "/docs/basecamp-api-specs/sections/schedule_entries.md#get-a-schedule-entry"
2317
+ },
2318
+ method: "GET",
2319
+ path: "/buckets/:bucketId/schedule_entries/:scheduleEntryId",
2320
+ pathParams: bucketAndEntryPathParams,
2321
+ responses: {
2322
+ 200: ScheduleEntrySchema
2323
+ }
2324
+ },
2325
+ getOccurrence: {
2326
+ summary: "Get a specific occurrence of a recurring schedule entry",
2327
+ description: "Returns a specific occurrence of a recurring schedule entry (e.g., 20190218 for February 18, 2019).",
2328
+ metadata: {
2329
+ tag: "Schedule Entries",
2330
+ operationId: "scheduleEntries.getOccurrence",
2331
+ docsPath: "/docs/basecamp-api-specs/sections/schedule_entries.md#get-a-schedule-entry"
2332
+ },
2333
+ method: "GET",
2334
+ path: "/buckets/:bucketId/schedule_entries/:scheduleEntryId/occurrences/:occurrenceDate",
2335
+ pathParams: bucketEntryOccurrencePathParams,
2336
+ responses: {
2337
+ 200: ScheduleEntrySchema
2338
+ }
2339
+ },
2340
+ create: {
2341
+ summary: "Create a schedule entry",
2342
+ description: "Creates a new schedule entry in a schedule. Required fields: summary, starts_at, and ends_at.",
2343
+ metadata: {
2344
+ tag: "Schedule Entries",
2345
+ operationId: "scheduleEntries.create",
2346
+ docsPath: "/docs/basecamp-api-specs/sections/schedule_entries.md#create-a-schedule-entry"
2347
+ },
2348
+ method: "POST",
2349
+ path: "/buckets/:bucketId/schedules/:scheduleId/entries",
2350
+ pathParams: bucketAndSchedulePathParams2,
2351
+ body: ScheduleEntryCreateBodySchema,
2352
+ responses: {
2353
+ 201: ScheduleEntrySchema
2354
+ }
2355
+ },
2356
+ update: {
2357
+ summary: "Update a schedule entry",
2358
+ description: "Updates an existing schedule entry. Any create parameters can be changed.",
2359
+ metadata: {
2360
+ tag: "Schedule Entries",
2361
+ operationId: "scheduleEntries.update",
2362
+ docsPath: "/docs/basecamp-api-specs/sections/schedule_entries.md#update-a-schedule-entry"
2363
+ },
2364
+ method: "PUT",
2365
+ path: "/buckets/:bucketId/schedule_entries/:scheduleEntryId",
2366
+ pathParams: bucketAndEntryPathParams,
2367
+ body: ScheduleEntryUpdateBodySchema,
2368
+ responses: {
2369
+ 200: ScheduleEntrySchema
2370
+ }
2371
+ },
2372
+ trash: {
2373
+ summary: "Trash a schedule entry",
2374
+ description: "Moves a schedule entry to the trash. Trashed items can be restored via the UI.",
2375
+ metadata: {
2376
+ tag: "Schedule Entries",
2377
+ operationId: "scheduleEntries.trash",
2378
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#trash-a-recording"
2379
+ },
2380
+ method: "PUT",
2381
+ path: "/buckets/:bucketId/recordings/:scheduleEntryId/status/trashed",
2382
+ pathParams: bucketAndEntryPathParams,
2383
+ body: c.noBody(),
2384
+ responses: {
2385
+ 204: c.noBody()
2386
+ }
2387
+ }
2388
+ });
2389
+
2390
+ // src/contract/resources/scheduling/questionnaires.ts
2391
+ var import_zod48 = require("zod");
2392
+
2393
+ // src/contract/schemas/scheduling/questionnaires.ts
2394
+ var import_zod47 = require("zod");
2395
+ var QuestionnaireSchema = import_zod47.z.object({
2396
+ id: BasecampIdSchema,
2397
+ status: RecordingStatusSchema,
2398
+ visible_to_clients: import_zod47.z.boolean(),
2399
+ created_at: IsoDateTimeSchema,
2400
+ updated_at: IsoDateTimeSchema,
2401
+ title: import_zod47.z.string(),
2402
+ inherits_status: import_zod47.z.boolean(),
2403
+ type: import_zod47.z.literal("Questionnaire"),
2404
+ url: import_zod47.z.string().url(),
2405
+ app_url: import_zod47.z.string().url(),
2406
+ bookmark_url: import_zod47.z.string().url(),
2407
+ bucket: BucketRefSchema,
2408
+ creator: PersonSummarySchema,
2409
+ name: import_zod47.z.string(),
2410
+ questions_count: import_zod47.z.number().int(),
2411
+ questions_url: import_zod47.z.string().url()
2412
+ });
2413
+
2414
+ // src/contract/resources/scheduling/questionnaires.ts
2415
+ var bucketAndQuestionnairePathParams = import_zod48.z.object({
2416
+ bucketId: BasecampIdParamSchema,
2417
+ questionnaireId: BasecampIdParamSchema
2418
+ });
2419
+ var questionnairesRouter = c.router({
2420
+ get: {
2421
+ summary: "Get questionnaire",
2422
+ description: "Returns the questionnaire for a project. All automatic check-in questions are children of this resource.",
2423
+ metadata: {
2424
+ tag: "Questionnaires",
2425
+ operationId: "questionnaires.get",
2426
+ docsPath: "/docs/basecamp-api-specs/sections/questionnaires.md#get-questionnaire"
2427
+ },
2428
+ method: "GET",
2429
+ path: "/buckets/:bucketId/questionnaires/:questionnaireId",
2430
+ pathParams: bucketAndQuestionnairePathParams,
2431
+ responses: {
2432
+ 200: QuestionnaireSchema
2433
+ }
2434
+ }
2435
+ });
2436
+
2437
+ // src/contract/resources/scheduling/questions.ts
2438
+ var import_zod50 = require("zod");
2439
+
2440
+ // src/contract/schemas/scheduling/questions.ts
2441
+ var import_zod49 = require("zod");
2442
+ var QuestionScheduleSchema = import_zod49.z.object({
2443
+ frequency: import_zod49.z.string(),
2444
+ days: import_zod49.z.array(import_zod49.z.number().int()),
2445
+ hour: import_zod49.z.number().int(),
2446
+ minute: import_zod49.z.number().int(),
2447
+ week_instance: import_zod49.z.number().int().nullable(),
2448
+ week_interval: import_zod49.z.number().int().nullable(),
2449
+ month_interval: import_zod49.z.number().int().nullable(),
2450
+ start_date: import_zod49.z.string(),
2451
+ end_date: import_zod49.z.string().nullable()
2452
+ });
2453
+ var QuestionSchema = import_zod49.z.object({
2454
+ id: BasecampIdSchema,
2455
+ status: RecordingStatusSchema,
2456
+ visible_to_clients: import_zod49.z.boolean(),
2457
+ created_at: IsoDateTimeSchema,
2458
+ updated_at: IsoDateTimeSchema,
2459
+ title: import_zod49.z.string(),
2460
+ inherits_status: import_zod49.z.boolean(),
2461
+ type: import_zod49.z.literal("Question"),
2462
+ url: import_zod49.z.string().url(),
2463
+ app_url: import_zod49.z.string().url(),
2464
+ bookmark_url: import_zod49.z.string().url(),
2465
+ subscription_url: import_zod49.z.string().url(),
2466
+ parent: RecordingRefSchema,
2467
+ bucket: BucketRefSchema,
2468
+ creator: PersonSummarySchema,
2469
+ paused: import_zod49.z.boolean(),
2470
+ schedule: QuestionScheduleSchema,
2471
+ answers_count: import_zod49.z.number().int(),
2472
+ answers_url: import_zod49.z.string().url()
2473
+ });
2474
+ var QuestionListResponseSchema = import_zod49.z.array(QuestionSchema);
2475
+ var QuestionListQuerySchema = import_zod49.z.object({
2476
+ page: import_zod49.z.coerce.number().int().positive().optional()
2477
+ });
2478
+
2479
+ // src/contract/resources/scheduling/questions.ts
2480
+ var bucketAndQuestionnairePathParams2 = import_zod50.z.object({
2481
+ bucketId: BasecampIdParamSchema,
2482
+ questionnaireId: BasecampIdParamSchema
2483
+ });
2484
+ var bucketAndQuestionPathParams = import_zod50.z.object({
2485
+ bucketId: BasecampIdParamSchema,
2486
+ questionId: BasecampIdParamSchema
2487
+ });
2488
+ var questionsRouter = c.router({
2489
+ list: {
2490
+ summary: "List questions",
2491
+ description: "Returns a paginated list of questions in a questionnaire (automatic check-ins).",
2492
+ metadata: {
2493
+ tag: "Questions",
2494
+ operationId: "questions.list",
2495
+ docsPath: "/docs/basecamp-api-specs/sections/questions.md#get-questions"
2496
+ },
2497
+ method: "GET",
2498
+ path: "/buckets/:bucketId/questionnaires/:questionnaireId/questions",
2499
+ pathParams: bucketAndQuestionnairePathParams2,
2500
+ query: QuestionListQuerySchema,
2501
+ responses: {
2502
+ 200: QuestionListResponseSchema
2503
+ }
2504
+ },
2505
+ get: {
2506
+ summary: "Get a question",
2507
+ description: "Returns a single automatic check-in question with its schedule and metadata.",
2508
+ metadata: {
2509
+ tag: "Questions",
2510
+ operationId: "questions.get",
2511
+ docsPath: "/docs/basecamp-api-specs/sections/questions.md#get-a-question"
2512
+ },
2513
+ method: "GET",
2514
+ path: "/buckets/:bucketId/questions/:questionId",
2515
+ pathParams: bucketAndQuestionPathParams,
2516
+ responses: {
2517
+ 200: QuestionSchema
2518
+ }
2519
+ }
2520
+ });
2521
+
2522
+ // src/contract/resources/tasks/todosets.ts
2523
+ var import_zod52 = require("zod");
2524
+
2525
+ // src/contract/schemas/tasks/todosets.ts
2526
+ var import_zod51 = require("zod");
2527
+ var TodoRecordingCoreSchema = import_zod51.z.object({
2528
+ id: BasecampIdSchema,
2529
+ status: RecordingStatusSchema,
2530
+ visible_to_clients: import_zod51.z.boolean(),
2531
+ created_at: IsoDateTimeSchema,
2532
+ updated_at: IsoDateTimeSchema,
2533
+ title: import_zod51.z.string(),
2534
+ inherits_status: import_zod51.z.boolean(),
2535
+ type: import_zod51.z.string(),
2536
+ url: import_zod51.z.string().url(),
2537
+ app_url: import_zod51.z.string().url(),
2538
+ bookmark_url: import_zod51.z.string().url().optional(),
2539
+ subscription_url: import_zod51.z.string().url().optional(),
2540
+ comments_count: import_zod51.z.number().int().nonnegative().optional(),
2541
+ comments_url: import_zod51.z.string().url().optional(),
2542
+ position: import_zod51.z.number().int().nonnegative().optional(),
2543
+ parent: RecordingRefSchema.optional(),
2544
+ bucket: BucketRefSchema,
2545
+ creator: PersonSummarySchema
2546
+ });
2547
+ var TodoSetSchema = TodoRecordingCoreSchema.omit({
2548
+ subscription_url: true,
2549
+ comments_count: true,
2550
+ comments_url: true
2551
+ }).extend({
2552
+ completed: import_zod51.z.boolean(),
2553
+ completed_ratio: import_zod51.z.string(),
2554
+ name: import_zod51.z.string(),
2555
+ todolists_count: import_zod51.z.number().int().nonnegative(),
2556
+ todolists_url: import_zod51.z.string().url(),
2557
+ app_todoslists_url: import_zod51.z.string().url()
2558
+ });
2559
+
2560
+ // src/contract/resources/tasks/todosets.ts
2561
+ var bucketPathParams2 = import_zod52.z.object({
2562
+ bucketId: BasecampIdParamSchema
2563
+ });
2564
+ var bucketAndTodoSetPathParams = bucketPathParams2.extend({
2565
+ todosetId: BasecampIdParamSchema
2566
+ });
2567
+ var todoSetsRouter = c.router({
2568
+ get: {
2569
+ summary: "Get a to-do set",
2570
+ description: "Return the to-do set container for a project. Use this to discover to-do lists and their groups.",
2571
+ metadata: {
2572
+ tag: "Todo Sets",
2573
+ operationId: "todoSets.get",
2574
+ docsPath: "/docs/basecamp-api-specs/sections/todosets.md#get-to-do-set"
2575
+ },
2576
+ method: "GET",
2577
+ path: "/buckets/:bucketId/todosets/:todosetId",
2578
+ pathParams: bucketAndTodoSetPathParams,
2579
+ responses: {
2580
+ 200: TodoSetSchema
2581
+ }
2582
+ }
2583
+ });
2584
+
2585
+ // src/contract/resources/tasks/todolists.ts
2586
+ var import_zod54 = require("zod");
2587
+
2588
+ // src/contract/schemas/tasks/todolists.ts
2589
+ var import_zod53 = require("zod");
2590
+ var TodoRecordingCoreSchema2 = import_zod53.z.object({
2591
+ id: BasecampIdSchema,
2592
+ status: RecordingStatusSchema,
2593
+ visible_to_clients: import_zod53.z.boolean(),
2594
+ created_at: IsoDateTimeSchema,
2595
+ updated_at: IsoDateTimeSchema,
2596
+ title: import_zod53.z.string(),
2597
+ inherits_status: import_zod53.z.boolean(),
2598
+ type: import_zod53.z.string(),
2599
+ url: import_zod53.z.string().url(),
2600
+ app_url: import_zod53.z.string().url(),
2601
+ bookmark_url: import_zod53.z.string().url().optional(),
2602
+ subscription_url: import_zod53.z.string().url().optional(),
2603
+ comments_count: import_zod53.z.number().int().nonnegative().optional(),
2604
+ comments_url: import_zod53.z.string().url().optional(),
2605
+ position: import_zod53.z.number().int().nonnegative().optional(),
2606
+ parent: RecordingRefSchema.optional(),
2607
+ bucket: BucketRefSchema,
2608
+ creator: PersonSummarySchema
2609
+ });
2610
+ var TodoListBaseSchema = TodoRecordingCoreSchema2.extend({
2611
+ description: HtmlStringSchema.optional(),
2612
+ completed: import_zod53.z.boolean(),
2613
+ completed_ratio: import_zod53.z.string(),
2614
+ name: import_zod53.z.string(),
2615
+ todos_url: import_zod53.z.string().url(),
2616
+ app_todos_url: import_zod53.z.string().url()
2617
+ });
2618
+ var TodoTopLevelListSchema = TodoListBaseSchema.extend({
2619
+ groups_url: import_zod53.z.string().url()
2620
+ });
2621
+ var TodoListGroupSchema = TodoListBaseSchema.extend({
2622
+ group_position_url: import_zod53.z.string().url()
2623
+ });
2624
+ var TodoListSchema = import_zod53.z.union([TodoTopLevelListSchema, TodoListGroupSchema]);
2625
+ var TodoListsResponseSchema = import_zod53.z.array(TodoTopLevelListSchema);
2626
+ var TodoListQuerySchema = import_zod53.z.object({
2627
+ status: import_zod53.z.enum(["active", "archived", "trashed"]).or(import_zod53.z.string()).optional(),
2628
+ page: import_zod53.z.coerce.number().int().positive().optional()
2629
+ });
2630
+ var TodoListCreateBodySchema = import_zod53.z.object({
2631
+ name: import_zod53.z.string().min(1),
2632
+ description: HtmlStringSchema.nullable().optional()
2633
+ });
2634
+ var TodoListUpdateBodySchema = import_zod53.z.object({
2635
+ name: import_zod53.z.string().min(1),
2636
+ description: HtmlStringSchema.nullable().optional()
2637
+ });
2638
+
2639
+ // src/contract/resources/tasks/todolists.ts
2640
+ var bucketPathParams3 = import_zod54.z.object({
2641
+ bucketId: BasecampIdParamSchema
2642
+ });
2643
+ var bucketAndTodoSetPathParams2 = bucketPathParams3.extend({
2644
+ todosetId: BasecampIdParamSchema
2645
+ });
2646
+ var bucketAndTodoListPathParams = bucketPathParams3.extend({
2647
+ todolistId: BasecampIdParamSchema
2648
+ });
2649
+ var todoListsRouter = c.router({
2650
+ list: {
2651
+ summary: "List to-do lists",
2652
+ description: "List active to-do lists within a to-do set. Pagination metadata is exposed via Link headers.",
2653
+ metadata: {
2654
+ tag: "Todo Lists",
2655
+ operationId: "todoLists.list",
2656
+ docsPath: "/docs/basecamp-api-specs/sections/todolists.md#get-to-do-lists"
2657
+ },
2658
+ method: "GET",
2659
+ path: "/buckets/:bucketId/todosets/:todosetId/todolists",
2660
+ pathParams: bucketAndTodoSetPathParams2,
2661
+ query: TodoListQuerySchema.optional(),
2662
+ responses: {
2663
+ 200: TodoListsResponseSchema
2664
+ }
2665
+ },
2666
+ get: {
2667
+ summary: "Get a to-do list",
2668
+ description: "Fetch a to-do list or group. When the list represents a group, the payload includes a group_position_url instead of groups_url.",
2669
+ metadata: {
2670
+ tag: "Todo Lists",
2671
+ operationId: "todoLists.get",
2672
+ docsPath: "/docs/basecamp-api-specs/sections/todolists.md#get-a-to-do-list"
2673
+ },
2674
+ method: "GET",
2675
+ path: "/buckets/:bucketId/todolists/:todolistId",
2676
+ pathParams: bucketAndTodoListPathParams,
2677
+ responses: {
2678
+ 200: TodoListSchema
2679
+ }
2680
+ },
2681
+ create: {
2682
+ summary: "Create a to-do list",
2683
+ description: "Create a new to-do list inside a to-do set. Descriptions accept rich text HTML.",
2684
+ metadata: {
2685
+ tag: "Todo Lists",
2686
+ operationId: "todoLists.create",
2687
+ docsPath: "/docs/basecamp-api-specs/sections/todolists.md#create-a-to-do-list"
2688
+ },
2689
+ method: "POST",
2690
+ path: "/buckets/:bucketId/todosets/:todosetId/todolists",
2691
+ pathParams: bucketAndTodoSetPathParams2,
2692
+ body: TodoListCreateBodySchema,
2693
+ responses: {
2694
+ 201: TodoTopLevelListSchema
2695
+ }
2696
+ },
2697
+ update: {
2698
+ summary: "Update a to-do list",
2699
+ description: "Update the name or description of an existing to-do list. Basecamp requires the name to be present on every update.",
2700
+ metadata: {
2701
+ tag: "Todo Lists",
2702
+ operationId: "todoLists.update",
2703
+ docsPath: "/docs/basecamp-api-specs/sections/todolists.md#update-a-to-do-list"
2704
+ },
2705
+ method: "PUT",
2706
+ path: "/buckets/:bucketId/todolists/:todolistId",
2707
+ pathParams: bucketAndTodoListPathParams,
2708
+ body: TodoListUpdateBodySchema,
2709
+ responses: {
2710
+ 200: TodoListSchema
2711
+ }
2712
+ },
2713
+ trash: {
2714
+ summary: "Trash a to-do list",
2715
+ description: "Move a to-do list or group to the trash. Trashed items can be restored from the Basecamp UI.",
2716
+ metadata: {
2717
+ tag: "Todo Lists",
2718
+ operationId: "todoLists.trash",
2719
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#trash-a-recording"
2720
+ },
2721
+ method: "PUT",
2722
+ path: "/buckets/:bucketId/recordings/:todolistId/status/trashed",
2723
+ pathParams: bucketAndTodoListPathParams,
2724
+ body: c.noBody(),
2725
+ responses: {
2726
+ 204: c.noBody()
2727
+ }
2728
+ }
2729
+ });
2730
+
2731
+ // src/contract/resources/tasks/todolist-groups.ts
2732
+ var import_zod56 = require("zod");
2733
+
2734
+ // src/contract/schemas/tasks/todolist-groups.ts
2735
+ var import_zod55 = require("zod");
2736
+ var TodoRecordingCoreSchema3 = import_zod55.z.object({
2737
+ id: BasecampIdSchema,
2738
+ status: RecordingStatusSchema,
2739
+ visible_to_clients: import_zod55.z.boolean(),
2740
+ created_at: IsoDateTimeSchema,
2741
+ updated_at: IsoDateTimeSchema,
2742
+ title: import_zod55.z.string(),
2743
+ inherits_status: import_zod55.z.boolean(),
2744
+ type: import_zod55.z.string(),
2745
+ url: import_zod55.z.string().url(),
2746
+ app_url: import_zod55.z.string().url(),
2747
+ bookmark_url: import_zod55.z.string().url().optional(),
2748
+ subscription_url: import_zod55.z.string().url().optional(),
2749
+ comments_count: import_zod55.z.number().int().nonnegative().optional(),
2750
+ comments_url: import_zod55.z.string().url().optional(),
2751
+ position: import_zod55.z.number().int().nonnegative().optional(),
2752
+ parent: RecordingRefSchema.optional(),
2753
+ bucket: BucketRefSchema,
2754
+ creator: PersonSummarySchema
2755
+ });
2756
+ var TodoListBaseSchema2 = TodoRecordingCoreSchema3.extend({
2757
+ description: HtmlStringSchema.optional(),
2758
+ completed: import_zod55.z.boolean(),
2759
+ completed_ratio: import_zod55.z.string(),
2760
+ name: import_zod55.z.string(),
2761
+ todos_url: import_zod55.z.string().url(),
2762
+ app_todos_url: import_zod55.z.string().url()
2763
+ });
2764
+ var TodoListGroupSchema2 = TodoListBaseSchema2.extend({
2765
+ group_position_url: import_zod55.z.string().url()
2766
+ });
2767
+ var TodoListSchema2 = TodoListGroupSchema2;
2768
+ var TodoListGroupsResponseSchema = import_zod55.z.array(TodoListGroupSchema2);
2769
+ var TodoListGroupQuerySchema = import_zod55.z.object({
2770
+ status: import_zod55.z.enum(["active", "archived", "trashed"]).or(import_zod55.z.string()).optional(),
2771
+ page: import_zod55.z.coerce.number().int().positive().optional()
2772
+ });
2773
+ var TodoListGroupCreateBodySchema = import_zod55.z.object({
2774
+ name: import_zod55.z.string().min(1),
2775
+ color: import_zod55.z.enum([
2776
+ "white",
2777
+ "red",
2778
+ "orange",
2779
+ "yellow",
2780
+ "green",
2781
+ "blue",
2782
+ "aqua",
2783
+ "purple",
2784
+ "gray",
2785
+ "pink",
2786
+ "brown"
2787
+ ]).or(import_zod55.z.string()).optional()
2788
+ });
2789
+ var TodoListGroupRepositionBodySchema = import_zod55.z.object({
2790
+ position: import_zod55.z.number().int().gte(1)
2791
+ });
2792
+
2793
+ // src/contract/resources/tasks/todolist-groups.ts
2794
+ var bucketPathParams4 = import_zod56.z.object({
2795
+ bucketId: BasecampIdParamSchema
2796
+ });
2797
+ var bucketAndTodoListPathParams2 = bucketPathParams4.extend({
2798
+ todolistId: BasecampIdParamSchema
2799
+ });
2800
+ var bucketAndGroupPathParams = bucketPathParams4.extend({
2801
+ groupId: BasecampIdParamSchema
2802
+ });
2803
+ var todoListGroupsRouter = c.router({
2804
+ list: {
2805
+ summary: "List to-do list groups",
2806
+ description: "List the to-do list groups contained within a to-do list. Use the status filter to browse archived or trashed groups.",
2807
+ metadata: {
2808
+ tag: "Todo Groups",
2809
+ operationId: "todoListGroups.list",
2810
+ docsPath: "/docs/basecamp-api-specs/sections/todolist_groups.md#list-to-do-list-groups"
2811
+ },
2812
+ method: "GET",
2813
+ path: "/buckets/:bucketId/todolists/:todolistId/groups",
2814
+ pathParams: bucketAndTodoListPathParams2,
2815
+ query: TodoListGroupQuerySchema.optional(),
2816
+ responses: {
2817
+ 200: TodoListGroupsResponseSchema
2818
+ }
2819
+ },
2820
+ create: {
2821
+ summary: "Create a to-do list group",
2822
+ description: "Create a nested group inside a to-do list. Groups share the same representation as to-do lists.",
2823
+ metadata: {
2824
+ tag: "Todo Groups",
2825
+ operationId: "todoListGroups.create",
2826
+ docsPath: "/docs/basecamp-api-specs/sections/todolist_groups.md#create-a-to-do-list-group"
2827
+ },
2828
+ method: "POST",
2829
+ path: "/buckets/:bucketId/todolists/:todolistId/groups",
2830
+ pathParams: bucketAndTodoListPathParams2,
2831
+ body: TodoListGroupCreateBodySchema,
2832
+ responses: {
2833
+ 201: TodoListSchema2
2834
+ }
2835
+ },
2836
+ reposition: {
2837
+ summary: "Reposition a to-do list group",
2838
+ description: "Change the position of a to-do list group within its parent list.",
2839
+ metadata: {
2840
+ tag: "Todo Groups",
2841
+ operationId: "todoListGroups.reposition",
2842
+ docsPath: "/docs/basecamp-api-specs/sections/todolist_groups.md#reposition-a-to-do-list-group"
2843
+ },
2844
+ method: "PUT",
2845
+ path: "/buckets/:bucketId/todolists/groups/:groupId/position",
2846
+ pathParams: bucketAndGroupPathParams,
2847
+ body: TodoListGroupRepositionBodySchema,
2848
+ responses: {
2849
+ 204: c.noBody()
2850
+ }
2851
+ }
2852
+ });
2853
+
2854
+ // src/contract/resources/tasks/todos.ts
2855
+ var import_zod58 = require("zod");
2856
+
2857
+ // src/contract/schemas/tasks/todos.ts
2858
+ var import_zod57 = require("zod");
2859
+ var TodoCompletionSchema = import_zod57.z.object({
2860
+ created_at: IsoDateTimeSchema,
2861
+ creator: PersonSummarySchema
2862
+ });
2863
+ var TodoRecordingCoreSchema4 = import_zod57.z.object({
2864
+ id: BasecampIdSchema,
2865
+ status: RecordingStatusSchema,
2866
+ visible_to_clients: import_zod57.z.boolean(),
2867
+ created_at: IsoDateTimeSchema,
2868
+ updated_at: IsoDateTimeSchema,
2869
+ title: import_zod57.z.string(),
2870
+ inherits_status: import_zod57.z.boolean(),
2871
+ type: import_zod57.z.string(),
2872
+ url: import_zod57.z.string().url(),
2873
+ app_url: import_zod57.z.string().url(),
2874
+ bookmark_url: import_zod57.z.string().url().optional(),
2875
+ subscription_url: import_zod57.z.string().url().optional(),
2876
+ comments_count: import_zod57.z.number().int().nonnegative().optional(),
2877
+ comments_url: import_zod57.z.string().url().optional(),
2878
+ position: import_zod57.z.number().int().nonnegative().optional(),
2879
+ parent: RecordingRefSchema.optional(),
2880
+ bucket: BucketRefSchema,
2881
+ creator: PersonSummarySchema
2882
+ });
2883
+ var TodoSchema = TodoRecordingCoreSchema4.extend({
2884
+ description: HtmlStringSchema.optional(),
2885
+ completed: import_zod57.z.boolean(),
2886
+ completion: TodoCompletionSchema.optional(),
2887
+ content: import_zod57.z.string(),
2888
+ starts_on: import_zod57.z.string().date().nullable().optional(),
2889
+ due_on: import_zod57.z.string().date().nullable().optional(),
2890
+ assignees: import_zod57.z.array(PersonSummarySchema),
2891
+ completion_subscribers: import_zod57.z.array(PersonSummarySchema),
2892
+ completion_url: import_zod57.z.string().url()
2893
+ });
2894
+ var TodoCollectionResponseSchema = import_zod57.z.array(TodoSchema);
2895
+ var TodoQuerySchema = import_zod57.z.object({
2896
+ status: import_zod57.z.enum(["active", "archived", "trashed"]).or(import_zod57.z.string()).optional(),
2897
+ completed: import_zod57.z.coerce.boolean().optional(),
2898
+ page: import_zod57.z.coerce.number().int().positive().optional()
2899
+ });
2900
+ var TodoCreateBodySchema = import_zod57.z.object({
2901
+ content: import_zod57.z.string().min(1),
2902
+ description: HtmlStringSchema.nullable().optional(),
2903
+ assignee_ids: import_zod57.z.array(BasecampIdSchema).optional(),
2904
+ completion_subscriber_ids: import_zod57.z.array(BasecampIdSchema).optional(),
2905
+ notify: import_zod57.z.boolean().optional(),
2906
+ due_on: import_zod57.z.string().date().nullable().optional(),
2907
+ starts_on: import_zod57.z.string().date().nullable().optional()
2908
+ });
2909
+ var TodoUpdateBodySchema = import_zod57.z.object({
2910
+ content: import_zod57.z.string().min(1),
2911
+ description: HtmlStringSchema.nullable().optional(),
2912
+ assignee_ids: import_zod57.z.array(BasecampIdSchema).optional(),
2913
+ completion_subscriber_ids: import_zod57.z.array(BasecampIdSchema).optional(),
2914
+ notify: import_zod57.z.boolean().optional(),
2915
+ due_on: import_zod57.z.string().date().nullable().optional(),
2916
+ starts_on: import_zod57.z.string().date().nullable().optional()
2917
+ });
2918
+ var TodoRepositionBodySchema = import_zod57.z.object({
2919
+ position: import_zod57.z.number().int().gte(1)
2920
+ });
2921
+
2922
+ // src/contract/resources/tasks/todos.ts
2923
+ var bucketPathParams5 = import_zod58.z.object({
2924
+ bucketId: BasecampIdParamSchema
2925
+ });
2926
+ var bucketAndTodoListPathParams3 = bucketPathParams5.extend({
2927
+ todolistId: BasecampIdParamSchema
2928
+ });
2929
+ var bucketAndTodoPathParams = bucketPathParams5.extend({
2930
+ todoId: BasecampIdParamSchema
2931
+ });
2932
+ var todosRouter = c.router({
2933
+ list: {
2934
+ summary: "List to-dos",
2935
+ description: "List pending or completed to-dos within a to-do list. Use the status and completed filters to target archived or finished items.",
2936
+ metadata: {
2937
+ tag: "Todos",
2938
+ operationId: "todos.list",
2939
+ docsPath: "/docs/basecamp-api-specs/sections/todos.md#get-to-dos"
2940
+ },
2941
+ method: "GET",
2942
+ path: "/buckets/:bucketId/todolists/:todolistId/todos",
2943
+ pathParams: bucketAndTodoListPathParams3,
2944
+ query: TodoQuerySchema.optional(),
2945
+ responses: {
2946
+ 200: TodoCollectionResponseSchema
2947
+ }
2948
+ },
2949
+ get: {
2950
+ summary: "Get a to-do",
2951
+ description: "Fetch a single to-do item by its identifier.",
2952
+ metadata: {
2953
+ tag: "Todos",
2954
+ operationId: "todos.get",
2955
+ docsPath: "/docs/basecamp-api-specs/sections/todos.md#get-a-to-do"
2956
+ },
2957
+ method: "GET",
2958
+ path: "/buckets/:bucketId/todos/:todoId",
2959
+ pathParams: bucketAndTodoPathParams,
2960
+ responses: {
2961
+ 200: TodoSchema
2962
+ }
2963
+ },
2964
+ create: {
2965
+ summary: "Create a to-do",
2966
+ description: "Create a to-do inside a to-do list. Rich text HTML is accepted in the description.",
2967
+ metadata: {
2968
+ tag: "Todos",
2969
+ operationId: "todos.create",
2970
+ docsPath: "/docs/basecamp-api-specs/sections/todos.md#create-a-to-do"
2971
+ },
2972
+ method: "POST",
2973
+ path: "/buckets/:bucketId/todolists/:todolistId/todos",
2974
+ pathParams: bucketAndTodoListPathParams3,
2975
+ body: TodoCreateBodySchema,
2976
+ responses: {
2977
+ 201: TodoSchema
2978
+ }
2979
+ },
2980
+ update: {
2981
+ summary: "Update a to-do",
2982
+ description: "Update the content, description, assignees, or scheduling fields of an existing to-do. The content field must always be provided.",
2983
+ metadata: {
2984
+ tag: "Todos",
2985
+ operationId: "todos.update",
2986
+ docsPath: "/docs/basecamp-api-specs/sections/todos.md#update-a-to-do"
2987
+ },
2988
+ method: "PUT",
2989
+ path: "/buckets/:bucketId/todos/:todoId",
2990
+ pathParams: bucketAndTodoPathParams,
2991
+ body: TodoUpdateBodySchema,
2992
+ responses: {
2993
+ 200: TodoSchema
2994
+ }
2995
+ },
2996
+ complete: {
2997
+ summary: "Complete a to-do",
2998
+ description: "Mark a to-do as completed.",
2999
+ metadata: {
3000
+ tag: "Todos",
3001
+ operationId: "todos.complete",
3002
+ docsPath: "/docs/basecamp-api-specs/sections/todos.md#complete-a-to-do"
3003
+ },
3004
+ method: "POST",
3005
+ path: "/buckets/:bucketId/todos/:todoId/completion",
3006
+ pathParams: bucketAndTodoPathParams,
3007
+ body: c.noBody(),
3008
+ responses: {
3009
+ 204: c.noBody()
3010
+ }
3011
+ },
3012
+ uncomplete: {
3013
+ summary: "Uncomplete a to-do",
3014
+ description: "Remove the completion mark from a to-do.",
3015
+ metadata: {
3016
+ tag: "Todos",
3017
+ operationId: "todos.uncomplete",
3018
+ docsPath: "/docs/basecamp-api-specs/sections/todos.md#uncomplete-a-to-do"
3019
+ },
3020
+ method: "DELETE",
3021
+ path: "/buckets/:bucketId/todos/:todoId/completion",
3022
+ pathParams: bucketAndTodoPathParams,
3023
+ body: c.noBody(),
3024
+ responses: {
3025
+ 204: c.noBody()
3026
+ }
3027
+ },
3028
+ reposition: {
3029
+ summary: "Reposition a to-do",
3030
+ description: "Change the position of a to-do within its list.",
3031
+ metadata: {
3032
+ tag: "Todos",
3033
+ operationId: "todos.reposition",
3034
+ docsPath: "/docs/basecamp-api-specs/sections/todos.md#reposition-a-to-do"
3035
+ },
3036
+ method: "PUT",
3037
+ path: "/buckets/:bucketId/todos/:todoId/position",
3038
+ pathParams: bucketAndTodoPathParams,
3039
+ body: TodoRepositionBodySchema,
3040
+ responses: {
3041
+ 204: c.noBody()
3042
+ }
3043
+ },
3044
+ trash: {
3045
+ summary: "Trash a to-do",
3046
+ description: "Move a to-do to the trash queue.",
3047
+ metadata: {
3048
+ tag: "Todos",
3049
+ operationId: "todos.trash",
3050
+ docsPath: "/docs/basecamp-api-specs/sections/recordings.md#trash-a-recording"
3051
+ },
3052
+ method: "PUT",
3053
+ path: "/buckets/:bucketId/recordings/:todoId/status/trashed",
3054
+ pathParams: bucketAndTodoPathParams,
3055
+ body: c.noBody(),
3056
+ responses: {
3057
+ 204: c.noBody()
3058
+ }
3059
+ }
3060
+ });
3061
+
3062
+ // src/contract/index.ts
3063
+ var contract = c.router(
3064
+ {
3065
+ projects: projectsRouter,
3066
+ people: peopleRouter,
3067
+ recordings: recordingsRouter,
3068
+ events: eventsRouter,
3069
+ lineupMarkers: lineupMarkersRouter,
3070
+ todoSets: todoSetsRouter,
3071
+ todoLists: todoListsRouter,
3072
+ todoListGroups: todoListGroupsRouter,
3073
+ todos: todosRouter,
3074
+ messageBoards: messageBoardsRouter,
3075
+ messageTypes: messageTypesRouter,
3076
+ messages: messagesRouter,
3077
+ comments: commentsRouter,
3078
+ campfires: campfiresRouter,
3079
+ inboxes: inboxesRouter,
3080
+ forwards: forwardsRouter,
3081
+ inboxReplies: inboxRepliesRouter,
3082
+ clientApprovals: clientApprovalsRouter,
3083
+ clientCorrespondences: clientCorrespondencesRouter,
3084
+ clientReplies: clientRepliesRouter,
3085
+ clientVisibility: clientVisibilityRouter,
3086
+ schedules: schedulesRouter,
3087
+ scheduleEntries: scheduleEntriesRouter,
3088
+ questionnaires: questionnairesRouter,
3089
+ questions: questionsRouter,
3090
+ documents: documentsRouter,
3091
+ vaults: vaultsRouter,
3092
+ uploads: uploadsRouter,
3093
+ attachments: attachmentsRouter
3094
+ },
3095
+ {
3096
+ strictStatusCodes: true,
3097
+ baseHeaders: import_zod59.z.object({
3098
+ Authorization: import_zod59.z.string().min(1),
3099
+ "User-Agent": import_zod59.z.string().min(1),
3100
+ Accept: import_zod59.z.literal("application/json").optional()
3101
+ })
3102
+ }
3103
+ );
3104
+
3105
+ // src/fetcher.ts
3106
+ var import_core2 = require("@ts-rest/core");
3107
+ var MAX_RETRIES = 20;
3108
+ var BASE_DELAY_MS = 500;
3109
+ var JITTER_MS = 250;
3110
+ var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
3111
+ var parseRetryAfterHeader = (headers) => {
3112
+ const retryAfter = headers.get("Retry-After");
3113
+ if (!retryAfter) {
3114
+ return void 0;
3115
+ }
3116
+ const asSeconds = Number(retryAfter);
3117
+ if (!Number.isNaN(asSeconds)) {
3118
+ return Math.max(0, asSeconds * 1e3);
3119
+ }
3120
+ const parsedDate = Date.parse(retryAfter);
3121
+ if (!Number.isNaN(parsedDate)) {
3122
+ return Math.max(0, parsedDate - Date.now());
3123
+ }
3124
+ return void 0;
3125
+ };
3126
+ var computeBackoffDelay = (attempt, retryAfterMs) => {
3127
+ const linearDelay = BASE_DELAY_MS * attempt;
3128
+ const jitter = Math.random() * JITTER_MS;
3129
+ const computed = linearDelay + jitter;
3130
+ if (retryAfterMs === void 0) {
3131
+ return computed;
3132
+ }
3133
+ return Math.max(computed, retryAfterMs);
3134
+ };
3135
+ async function fetcher(args) {
3136
+ const url = new URL(args.path);
3137
+ if (!url.pathname.endsWith(".json")) {
3138
+ url.pathname = `${url.pathname}.json`;
3139
+ }
3140
+ const pathWithSuffix = url.toString();
3141
+ for (let attempt = 0; attempt <= MAX_RETRIES; attempt += 1) {
3142
+ const response = await (0, import_core2.tsRestFetchApi)({
3143
+ ...args,
3144
+ path: pathWithSuffix
3145
+ });
3146
+ if (response.status !== 429) {
3147
+ return response;
3148
+ }
3149
+ if (attempt === MAX_RETRIES) {
3150
+ return response;
3151
+ }
3152
+ const retryAfterMs = parseRetryAfterHeader(response.headers);
3153
+ const delay = computeBackoffDelay(attempt + 1, retryAfterMs);
3154
+ if (delay > 0) {
3155
+ await sleep(delay);
3156
+ }
3157
+ }
3158
+ throw new Error("Exceeded retry attempts for Basecamp API request.");
3159
+ }
3160
+
3161
+ // src/buildClient.ts
3162
+ function buildClient(options) {
3163
+ return (0, import_core3.initClient)(contract, {
3164
+ baseUrl: `https://3.basecampapi.com/${options.accountId}`,
3165
+ baseHeaders: {
3166
+ Authorization: `Bearer ${options.bearerToken}`,
3167
+ "User-Agent": options.userAgent,
3168
+ Accept: "application/json",
3169
+ "Content-Type": "application/json"
3170
+ },
3171
+ throwOnUnknownStatus: true,
3172
+ api: fetcher
3173
+ });
3174
+ }
3175
+
3176
+ // src/getBearerToken.ts
3177
+ async function getBearerToken({
3178
+ clientId,
3179
+ clientSecret,
3180
+ refreshToken,
3181
+ userAgent
3182
+ }) {
3183
+ const response = await fetch("https://launchpad.37signals.com/authorization/token", {
3184
+ method: "POST",
3185
+ headers: {
3186
+ "Content-Type": "application/json",
3187
+ "User-Agent": userAgent
3188
+ },
3189
+ body: JSON.stringify({
3190
+ type: "refresh",
3191
+ client_id: clientId,
3192
+ client_secret: clientSecret,
3193
+ refresh_token: refreshToken
3194
+ })
3195
+ });
3196
+ if (!response.ok) {
3197
+ const errorBody = await response.text();
3198
+ throw new Error(`Failed to obtain access token (${response.status}): ${errorBody}`);
3199
+ }
3200
+ const payload = await response.json();
3201
+ return payload.access_token;
3202
+ }
3203
+ // Annotate the CommonJS export names for ESM import in node:
3204
+ 0 && (module.exports = {
3205
+ buildClient,
3206
+ contract,
3207
+ getBearerToken
3208
+ });
3209
+ //# sourceMappingURL=index.js.map