@37signals/basecamp 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (179) hide show
  1. package/README.md +1 -0
  2. package/dist/client.d.ts +5 -2
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +5 -2
  5. package/dist/client.js.map +1 -1
  6. package/dist/generated/metadata.d.ts.map +1 -1
  7. package/dist/generated/metadata.js +176 -2
  8. package/dist/generated/metadata.js.map +1 -1
  9. package/dist/generated/metadata.ts +176 -2
  10. package/dist/generated/openapi-stripped.json +2882 -1276
  11. package/dist/generated/path-mapping.d.ts.map +1 -1
  12. package/dist/generated/path-mapping.js +15 -1
  13. package/dist/generated/path-mapping.js.map +1 -1
  14. package/dist/generated/path-mapping.ts +15 -1
  15. package/dist/generated/person-id-sites.d.ts.map +1 -1
  16. package/dist/generated/person-id-sites.js +61 -2
  17. package/dist/generated/person-id-sites.js.map +1 -1
  18. package/dist/generated/person-id-sites.ts +61 -2
  19. package/dist/generated/schema.d.ts +1406 -92
  20. package/dist/generated/services/bookmarks.d.ts +1 -1
  21. package/dist/generated/services/bookmarks.js +1 -1
  22. package/dist/generated/services/bookmarks.ts +1 -1
  23. package/dist/generated/services/boosts.d.ts +2 -2
  24. package/dist/generated/services/boosts.js +2 -2
  25. package/dist/generated/services/boosts.ts +2 -2
  26. package/dist/generated/services/campfires.d.ts +4 -4
  27. package/dist/generated/services/campfires.js +4 -4
  28. package/dist/generated/services/campfires.ts +4 -4
  29. package/dist/generated/services/card-steps.d.ts +15 -11
  30. package/dist/generated/services/card-steps.d.ts.map +1 -1
  31. package/dist/generated/services/card-steps.js +4 -4
  32. package/dist/generated/services/card-steps.js.map +1 -1
  33. package/dist/generated/services/card-steps.ts +15 -11
  34. package/dist/generated/services/cards.d.ts +1 -1
  35. package/dist/generated/services/cards.js +1 -1
  36. package/dist/generated/services/cards.ts +1 -1
  37. package/dist/generated/services/checkins.d.ts +9 -8
  38. package/dist/generated/services/checkins.d.ts.map +1 -1
  39. package/dist/generated/services/checkins.js +6 -6
  40. package/dist/generated/services/checkins.js.map +1 -1
  41. package/dist/generated/services/checkins.ts +11 -10
  42. package/dist/generated/services/client-approvals.d.ts +1 -1
  43. package/dist/generated/services/client-approvals.js +1 -1
  44. package/dist/generated/services/client-approvals.ts +1 -1
  45. package/dist/generated/services/client-correspondences.d.ts +1 -1
  46. package/dist/generated/services/client-correspondences.js +1 -1
  47. package/dist/generated/services/client-correspondences.ts +1 -1
  48. package/dist/generated/services/client-replies.d.ts +1 -1
  49. package/dist/generated/services/client-replies.js +1 -1
  50. package/dist/generated/services/client-replies.ts +1 -1
  51. package/dist/generated/services/comments.d.ts +1 -1
  52. package/dist/generated/services/comments.js +1 -1
  53. package/dist/generated/services/comments.ts +1 -1
  54. package/dist/generated/services/documents.d.ts +1 -1
  55. package/dist/generated/services/documents.js +1 -1
  56. package/dist/generated/services/documents.ts +1 -1
  57. package/dist/generated/services/drafts.d.ts +1 -1
  58. package/dist/generated/services/drafts.js +1 -1
  59. package/dist/generated/services/drafts.ts +1 -1
  60. package/dist/generated/services/events.d.ts +1 -1
  61. package/dist/generated/services/events.js +1 -1
  62. package/dist/generated/services/events.ts +1 -1
  63. package/dist/generated/services/everything.d.ts +14 -14
  64. package/dist/generated/services/everything.js +14 -14
  65. package/dist/generated/services/everything.ts +14 -14
  66. package/dist/generated/services/forwards.d.ts +2 -2
  67. package/dist/generated/services/forwards.js +2 -2
  68. package/dist/generated/services/forwards.ts +2 -2
  69. package/dist/generated/services/index.d.ts +2 -1
  70. package/dist/generated/services/index.d.ts.map +1 -1
  71. package/dist/generated/services/index.js +2 -1
  72. package/dist/generated/services/index.js.map +1 -1
  73. package/dist/generated/services/index.ts +2 -1
  74. package/dist/generated/services/message-types.d.ts +1 -1
  75. package/dist/generated/services/message-types.js +1 -1
  76. package/dist/generated/services/message-types.ts +1 -1
  77. package/dist/generated/services/messages.d.ts +1 -1
  78. package/dist/generated/services/messages.js +1 -1
  79. package/dist/generated/services/messages.ts +1 -1
  80. package/dist/generated/services/my-notifications.d.ts +3 -2
  81. package/dist/generated/services/my-notifications.d.ts.map +1 -1
  82. package/dist/generated/services/my-notifications.js +1 -1
  83. package/dist/generated/services/my-notifications.js.map +1 -1
  84. package/dist/generated/services/my-notifications.ts +3 -2
  85. package/dist/generated/services/people.d.ts +3 -3
  86. package/dist/generated/services/people.js +3 -3
  87. package/dist/generated/services/people.ts +3 -3
  88. package/dist/generated/services/projects.d.ts +1 -1
  89. package/dist/generated/services/projects.js +1 -1
  90. package/dist/generated/services/projects.ts +1 -1
  91. package/dist/generated/services/recordings.d.ts +27 -3
  92. package/dist/generated/services/recordings.d.ts.map +1 -1
  93. package/dist/generated/services/recordings.js +32 -3
  94. package/dist/generated/services/recordings.js.map +1 -1
  95. package/dist/generated/services/recordings.ts +49 -3
  96. package/dist/generated/services/reports.d.ts +1 -1
  97. package/dist/generated/services/reports.js +1 -1
  98. package/dist/generated/services/reports.ts +1 -1
  99. package/dist/generated/services/schedules.d.ts +1 -1
  100. package/dist/generated/services/schedules.js +1 -1
  101. package/dist/generated/services/schedules.ts +1 -1
  102. package/dist/generated/services/subtasks.d.ts +157 -0
  103. package/dist/generated/services/subtasks.d.ts.map +1 -0
  104. package/dist/generated/services/subtasks.js +240 -0
  105. package/dist/generated/services/subtasks.js.map +1 -0
  106. package/dist/generated/services/subtasks.ts +336 -0
  107. package/dist/generated/services/templates.d.ts +114 -10
  108. package/dist/generated/services/templates.d.ts.map +1 -1
  109. package/dist/generated/services/templates.js +147 -10
  110. package/dist/generated/services/templates.js.map +1 -1
  111. package/dist/generated/services/templates.ts +220 -13
  112. package/dist/generated/services/timeline.d.ts +1 -1
  113. package/dist/generated/services/timeline.js +1 -1
  114. package/dist/generated/services/timeline.ts +1 -1
  115. package/dist/generated/services/timesheets.d.ts +3 -3
  116. package/dist/generated/services/timesheets.js +3 -3
  117. package/dist/generated/services/timesheets.ts +3 -3
  118. package/dist/generated/services/todolist-groups.d.ts +1 -1
  119. package/dist/generated/services/todolist-groups.js +1 -1
  120. package/dist/generated/services/todolist-groups.ts +1 -1
  121. package/dist/generated/services/todolists.d.ts +1 -1
  122. package/dist/generated/services/todolists.js +1 -1
  123. package/dist/generated/services/todolists.ts +1 -1
  124. package/dist/generated/services/todos.d.ts +1 -1
  125. package/dist/generated/services/todos.js +1 -1
  126. package/dist/generated/services/todos.ts +1 -1
  127. package/dist/generated/services/uploads.d.ts +2 -2
  128. package/dist/generated/services/uploads.js +2 -2
  129. package/dist/generated/services/uploads.ts +2 -2
  130. package/dist/generated/services/vaults.d.ts +1 -1
  131. package/dist/generated/services/vaults.js +1 -1
  132. package/dist/generated/services/vaults.ts +1 -1
  133. package/dist/generated/services/webhooks.d.ts +1 -1
  134. package/dist/generated/services/webhooks.js +1 -1
  135. package/dist/generated/services/webhooks.ts +1 -1
  136. package/dist/index.d.ts +3 -2
  137. package/dist/index.d.ts.map +1 -1
  138. package/dist/index.js +3 -0
  139. package/dist/index.js.map +1 -1
  140. package/package.json +3 -3
  141. package/src/generated/metadata.ts +176 -2
  142. package/src/generated/openapi-stripped.json +2882 -1276
  143. package/src/generated/path-mapping.ts +15 -1
  144. package/src/generated/person-id-sites.ts +61 -2
  145. package/src/generated/schema.d.ts +1406 -92
  146. package/src/generated/services/bookmarks.ts +1 -1
  147. package/src/generated/services/boosts.ts +2 -2
  148. package/src/generated/services/campfires.ts +4 -4
  149. package/src/generated/services/card-steps.ts +15 -11
  150. package/src/generated/services/cards.ts +1 -1
  151. package/src/generated/services/checkins.ts +11 -10
  152. package/src/generated/services/client-approvals.ts +1 -1
  153. package/src/generated/services/client-correspondences.ts +1 -1
  154. package/src/generated/services/client-replies.ts +1 -1
  155. package/src/generated/services/comments.ts +1 -1
  156. package/src/generated/services/documents.ts +1 -1
  157. package/src/generated/services/drafts.ts +1 -1
  158. package/src/generated/services/events.ts +1 -1
  159. package/src/generated/services/everything.ts +14 -14
  160. package/src/generated/services/forwards.ts +2 -2
  161. package/src/generated/services/index.ts +2 -1
  162. package/src/generated/services/message-types.ts +1 -1
  163. package/src/generated/services/messages.ts +1 -1
  164. package/src/generated/services/my-notifications.ts +3 -2
  165. package/src/generated/services/people.ts +3 -3
  166. package/src/generated/services/projects.ts +1 -1
  167. package/src/generated/services/recordings.ts +49 -3
  168. package/src/generated/services/reports.ts +1 -1
  169. package/src/generated/services/schedules.ts +1 -1
  170. package/src/generated/services/subtasks.ts +336 -0
  171. package/src/generated/services/templates.ts +220 -13
  172. package/src/generated/services/timeline.ts +1 -1
  173. package/src/generated/services/timesheets.ts +3 -3
  174. package/src/generated/services/todolist-groups.ts +1 -1
  175. package/src/generated/services/todolists.ts +1 -1
  176. package/src/generated/services/todos.ts +1 -1
  177. package/src/generated/services/uploads.ts +2 -2
  178. package/src/generated/services/vaults.ts +1 -1
  179. package/src/generated/services/webhooks.ts +1 -1
@@ -0,0 +1,336 @@
1
+ /**
2
+ * Subtasks service for the Basecamp API.
3
+ *
4
+ * @generated from OpenAPI spec - do not edit directly
5
+ */
6
+
7
+ import { BaseService } from "../../services/base.js";
8
+ import type { components } from "../schema.js";
9
+ import { ListResult } from "../../pagination.js";
10
+ import type { PaginationOptions } from "../../pagination.js";
11
+ import { Errors } from "../../errors.js";
12
+
13
+ // =============================================================================
14
+ // Types
15
+ // =============================================================================
16
+
17
+ /** Subtask entity from the Basecamp API. */
18
+ export type Subtask = components["schemas"]["Subtask"];
19
+ /** @deprecated renamed to Subtask, the same Kanban::Step record. */
20
+ export type CardStep = Subtask;
21
+
22
+ /**
23
+ * Options for list.
24
+ */
25
+ export interface ListSubtaskOptions extends PaginationOptions {
26
+ /** Page number for paginating through results. Defaults to 1. A positive value selects exactly that page, not a starting offset; see SPEC section 8. */
27
+ page?: number;
28
+ }
29
+
30
+ /**
31
+ * Request parameters for create.
32
+ */
33
+ export interface CreateSubtaskRequest {
34
+ /** Title */
35
+ title: string;
36
+ /** Due date (YYYY-MM-DD) */
37
+ dueOn?: string;
38
+ /** Person IDs to assign to */
39
+ assigneeIds?: number[];
40
+ }
41
+
42
+ /**
43
+ * Request parameters for update.
44
+ */
45
+ export interface UpdateSubtaskRequest {
46
+ /** Title */
47
+ title?: string;
48
+ /** Due date (YYYY-MM-DD) */
49
+ dueOn?: string;
50
+ /** Person IDs to assign to */
51
+ assigneeIds?: number[];
52
+ }
53
+
54
+ /**
55
+ * Request parameters for reposition.
56
+ */
57
+ export interface RepositionSubtaskRequest {
58
+ /** The 1-based position to move it to */
59
+ position: number;
60
+ }
61
+
62
+
63
+ // =============================================================================
64
+ // Service
65
+ // =============================================================================
66
+
67
+ /**
68
+ * Service for Subtasks operations.
69
+ */
70
+ export class SubtasksService extends BaseService {
71
+
72
+ /**
73
+ * List a recording's subtasks, in position order
74
+ * @param recordingId - The recording ID
75
+ * @param options - Optional query parameters
76
+ * @returns Every Subtask across all pages, with .meta.totalCount
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const result = await client.subtasks.list(123);
81
+ *
82
+ * // With options
83
+ * const filtered = await client.subtasks.list(123, { page: 1 });
84
+ * ```
85
+ */
86
+ async list(recordingId: number, options?: ListSubtaskOptions): Promise<ListResult<Subtask>> {
87
+ return this.requestPaginated(
88
+ {
89
+ service: "Subtasks",
90
+ operation: "ListSubtasks",
91
+ resourceType: "subtask",
92
+ isMutation: false,
93
+ resourceId: recordingId,
94
+ },
95
+ () =>
96
+ this.client.GET("/recordings/{recordingId}/subtasks.json", {
97
+ params: {
98
+ path: { recordingId },
99
+ query: { page: options?.page },
100
+ },
101
+ })
102
+ , options
103
+ );
104
+ }
105
+
106
+ /**
107
+ * Create a subtask under a to-do or a card
108
+ * @param recordingId - The recording ID
109
+ * @param req - Subtask creation parameters
110
+ * @returns The Subtask
111
+ * @throws {BasecampError} If required fields are missing or invalid
112
+ *
113
+ * @example
114
+ * ```ts
115
+ * const result = await client.subtasks.create(123, { title: "example" });
116
+ * ```
117
+ */
118
+ async create(recordingId: number, req: CreateSubtaskRequest): Promise<Subtask> {
119
+ if (!req.title) {
120
+ throw Errors.validation("Title is required");
121
+ }
122
+ if (req.dueOn && !/^\d{4}-\d{2}-\d{2}$/.test(req.dueOn)) {
123
+ throw Errors.validation("Due on must be in YYYY-MM-DD format");
124
+ }
125
+ const response = await this.request(
126
+ {
127
+ service: "Subtasks",
128
+ operation: "CreateSubtask",
129
+ resourceType: "subtask",
130
+ isMutation: true,
131
+ resourceId: recordingId,
132
+ },
133
+ () =>
134
+ this.client.POST("/recordings/{recordingId}/subtasks.json", {
135
+ params: {
136
+ path: { recordingId },
137
+ },
138
+ body: {
139
+ title: req.title,
140
+ due_on: req.dueOn,
141
+ assignee_ids: req.assigneeIds,
142
+ },
143
+ })
144
+ );
145
+ return response;
146
+ }
147
+
148
+ /**
149
+ * Get a subtask by ID
150
+ * @param subtaskId - The subtask ID
151
+ * @returns The Subtask
152
+ * @throws {BasecampError} If the resource is not found
153
+ *
154
+ * @example
155
+ * ```ts
156
+ * const result = await client.subtasks.get(123);
157
+ * ```
158
+ */
159
+ async get(subtaskId: number): Promise<Subtask> {
160
+ const response = await this.request(
161
+ {
162
+ service: "Subtasks",
163
+ operation: "GetSubtask",
164
+ resourceType: "subtask",
165
+ isMutation: false,
166
+ resourceId: subtaskId,
167
+ },
168
+ () =>
169
+ this.client.GET("/subtasks/{subtaskId}", {
170
+ params: {
171
+ path: { subtaskId },
172
+ },
173
+ })
174
+ );
175
+ return response;
176
+ }
177
+
178
+ /**
179
+ * Update a subtask
180
+ * @param subtaskId - The subtask ID
181
+ * @param req - Subtask update parameters
182
+ * @returns The Subtask
183
+ * @throws {BasecampError} If the resource is not found or fields are invalid
184
+ *
185
+ * @example
186
+ * ```ts
187
+ * const result = await client.subtasks.update(123, { });
188
+ * ```
189
+ */
190
+ async update(subtaskId: number, req: UpdateSubtaskRequest): Promise<Subtask> {
191
+ if (req.dueOn && !/^\d{4}-\d{2}-\d{2}$/.test(req.dueOn)) {
192
+ throw Errors.validation("Due on must be in YYYY-MM-DD format");
193
+ }
194
+ const response = await this.request(
195
+ {
196
+ service: "Subtasks",
197
+ operation: "UpdateSubtask",
198
+ resourceType: "subtask",
199
+ isMutation: true,
200
+ resourceId: subtaskId,
201
+ },
202
+ () =>
203
+ this.client.PUT("/subtasks/{subtaskId}", {
204
+ params: {
205
+ path: { subtaskId },
206
+ },
207
+ body: {
208
+ title: req.title,
209
+ due_on: req.dueOn,
210
+ assignee_ids: req.assigneeIds,
211
+ },
212
+ })
213
+ );
214
+ return response;
215
+ }
216
+
217
+ /**
218
+ * Delete a subtask
219
+ * @param subtaskId - The subtask ID
220
+ * @returns void
221
+ * @throws {BasecampError} If the request fails
222
+ *
223
+ * @example
224
+ * ```ts
225
+ * await client.subtasks.delete(123);
226
+ * ```
227
+ */
228
+ async delete(subtaskId: number): Promise<void> {
229
+ await this.request(
230
+ {
231
+ service: "Subtasks",
232
+ operation: "DeleteSubtask",
233
+ resourceType: "subtask",
234
+ isMutation: true,
235
+ resourceId: subtaskId,
236
+ },
237
+ () =>
238
+ this.client.DELETE("/subtasks/{subtaskId}", {
239
+ params: {
240
+ path: { subtaskId },
241
+ },
242
+ })
243
+ );
244
+ }
245
+
246
+ /**
247
+ * Mark a subtask as completed
248
+ * @param subtaskId - The subtask ID
249
+ * @returns void
250
+ * @throws {BasecampError} If the request fails
251
+ *
252
+ * @example
253
+ * ```ts
254
+ * await client.subtasks.complete(123);
255
+ * ```
256
+ */
257
+ async complete(subtaskId: number): Promise<void> {
258
+ await this.request(
259
+ {
260
+ service: "Subtasks",
261
+ operation: "CompleteSubtask",
262
+ resourceType: "subtask",
263
+ isMutation: true,
264
+ resourceId: subtaskId,
265
+ },
266
+ () =>
267
+ this.client.POST("/subtasks/{subtaskId}/completion.json", {
268
+ params: {
269
+ path: { subtaskId },
270
+ },
271
+ })
272
+ );
273
+ }
274
+
275
+ /**
276
+ * Mark a subtask as not completed
277
+ * @param subtaskId - The subtask ID
278
+ * @returns void
279
+ * @throws {BasecampError} If the request fails
280
+ *
281
+ * @example
282
+ * ```ts
283
+ * await client.subtasks.uncomplete(123);
284
+ * ```
285
+ */
286
+ async uncomplete(subtaskId: number): Promise<void> {
287
+ await this.request(
288
+ {
289
+ service: "Subtasks",
290
+ operation: "UncompleteSubtask",
291
+ resourceType: "subtask",
292
+ isMutation: true,
293
+ resourceId: subtaskId,
294
+ },
295
+ () =>
296
+ this.client.DELETE("/subtasks/{subtaskId}/completion.json", {
297
+ params: {
298
+ path: { subtaskId },
299
+ },
300
+ })
301
+ );
302
+ }
303
+
304
+ /**
305
+ * Move a subtask to a new position among its siblings
306
+ * @param subtaskId - The subtask ID
307
+ * @param req - Subtask request parameters
308
+ * @returns void
309
+ * @throws {BasecampError} If the request fails
310
+ *
311
+ * @example
312
+ * ```ts
313
+ * await client.subtasks.reposition(123, { position: 1 });
314
+ * ```
315
+ */
316
+ async reposition(subtaskId: number, req: RepositionSubtaskRequest): Promise<void> {
317
+ await this.request(
318
+ {
319
+ service: "Subtasks",
320
+ operation: "RepositionSubtask",
321
+ resourceType: "subtask",
322
+ isMutation: true,
323
+ resourceId: subtaskId,
324
+ },
325
+ () =>
326
+ this.client.PUT("/subtasks/{subtaskId}/position.json", {
327
+ params: {
328
+ path: { subtaskId },
329
+ },
330
+ body: {
331
+ position: req.position,
332
+ },
333
+ })
334
+ );
335
+ }
336
+ }
@@ -14,21 +14,65 @@ import { Errors } from "../../errors.js";
14
14
  // Types
15
15
  // =============================================================================
16
16
 
17
+ /** CardTable entity from the Basecamp API. */
18
+ export type CardTable = components["schemas"]["CardTable"];
19
+ /** Todolist entity from the Basecamp API. */
20
+ export type Todolist = components["schemas"]["Todolist"];
17
21
  /** Template entity from the Basecamp API. */
18
22
  export type Template = components["schemas"]["Template"];
19
23
 
24
+ /**
25
+ * Request parameters for createTemplatification.
26
+ */
27
+ export interface CreateTemplatificationTemplateRequest {
28
+ /** What to call the template. Defaults to the source recording's own title. */
29
+ templateName?: string;
30
+ /** Carry the comments across. */
31
+ copyComments?: boolean;
32
+ /** Carry assignees and the people involved across, adding them to the library
33
+ if they are not already there. */
34
+ copyAssignments?: boolean;
35
+ /** Gather the cards into Triage. Card tables only, and ignored otherwise. */
36
+ moveCardsToTriage?: boolean;
37
+ }
38
+
39
+ /**
40
+ * Request parameters for createLibraryCardTable.
41
+ */
42
+ export interface CreateLibraryCardTableTemplateRequest {
43
+ /** The template's name. Write-only: the response carries it as `title`. */
44
+ name: string;
45
+ }
46
+
20
47
  /**
21
48
  * Request parameters for createLibraryCopy.
22
49
  */
23
50
  export interface CreateLibraryCopyTemplateRequest {
24
- /** Template recording id */
51
+ /** The to-do list or card table in the library to copy. */
25
52
  templateRecordingId: number;
26
- /** Destination parent id */
27
- destinationParentId: number;
53
+ /** The destination project. Basecamp resolves the container from the
54
+ template's kind, so a caller naming a project needs to know nothing about
55
+ docks or to-do sets. Supply this or destination_parent_id; if both are
56
+ sent, destination_parent_id wins. */
57
+ destinationProjectId?: number;
58
+ /** The container to copy into, for a caller that already holds one: the
59
+ project's to-do set for a to-do list template, or its dock for a card
60
+ table. A caller who may not edit it gets 404, not 403. */
61
+ destinationParentId?: number;
28
62
  /** Confirm granting destination-project access to people referenced by the template. */
29
63
  addingPeopleConfirmed?: boolean;
30
64
  }
31
65
 
66
+ /**
67
+ * Request parameters for createLibraryTodolist.
68
+ */
69
+ export interface CreateLibraryTodolistTemplateRequest {
70
+ /** What to call the template. */
71
+ name: string;
72
+ /** Rich text describing the template. */
73
+ description?: string;
74
+ }
75
+
32
76
  /**
33
77
  * Options for list.
34
78
  */
@@ -78,39 +122,143 @@ export interface CreateProjectTemplateRequest {
78
122
  export class TemplatesService extends BaseService {
79
123
 
80
124
  /**
81
- * Get the account's to-do list template library
82
- * @returns The template_library
125
+ * Templatify a to-do list or card table
126
+ * @param bucketId - The bucket ID
127
+ * @param recordingId - The to-do list or card table to templatify. Anything else is a 403.
128
+ * @param req - Templatification creation parameters
129
+ * @returns The templatification
130
+ * @throws {BasecampError} If required fields are missing or invalid
131
+ *
132
+ * @example
133
+ * ```ts
134
+ * const result = await client.templates.createTemplatification(123, 123, { });
135
+ * ```
136
+ */
137
+ async createTemplatification(bucketId: number, recordingId: number, req: CreateTemplatificationTemplateRequest): Promise<components["schemas"]["CreateTemplatificationResponseContent"]> {
138
+ const response = await this.request(
139
+ {
140
+ service: "Templates",
141
+ operation: "CreateTemplatification",
142
+ resourceType: "templatification",
143
+ isMutation: true,
144
+ projectId: bucketId,
145
+ resourceId: recordingId,
146
+ },
147
+ () =>
148
+ this.client.POST("/buckets/{bucketId}/recordings/{recordingId}/templatifications.json", {
149
+ params: {
150
+ path: { bucketId, recordingId },
151
+ },
152
+ body: {
153
+ template_name: req.templateName,
154
+ copy_comments: req.copyComments,
155
+ copy_assignments: req.copyAssignments,
156
+ move_cards_to_triage: req.moveCardsToTriage,
157
+ },
158
+ })
159
+ );
160
+ return response;
161
+ }
162
+
163
+ /**
164
+ * Get a templatification
165
+ * @param bucketId - The bucket ID
166
+ * @param recordingId - The recording ID
167
+ * @param templatificationId - The templatification ID
168
+ * @returns The templatification
83
169
  * @throws {BasecampError} If the resource is not found
84
170
  *
85
171
  * @example
86
172
  * ```ts
87
- * const result = await client.templates.getLibrary();
173
+ * const result = await client.templates.getTemplatification(123, 123, 123);
88
174
  * ```
89
175
  */
90
- async getLibrary(): Promise<components["schemas"]["GetTemplateLibraryResponseContent"]> {
176
+ async getTemplatification(bucketId: number, recordingId: number, templatificationId: number): Promise<components["schemas"]["GetTemplatificationResponseContent"]> {
91
177
  const response = await this.request(
92
178
  {
93
179
  service: "Templates",
94
- operation: "GetTemplateLibrary",
95
- resourceType: "template_library",
180
+ operation: "GetTemplatification",
181
+ resourceType: "templatification",
96
182
  isMutation: false,
183
+ projectId: bucketId,
184
+ resourceId: templatificationId,
185
+ },
186
+ () =>
187
+ this.client.GET("/buckets/{bucketId}/recordings/{recordingId}/templatifications/{templatificationId}", {
188
+ params: {
189
+ path: { bucketId, recordingId, templatificationId },
190
+ },
191
+ })
192
+ );
193
+ return response;
194
+ }
195
+
196
+ /**
197
+ * Get the account's card table templates
198
+ * @returns The template_library_card_table
199
+ * @throws {BasecampError} If the resource is not found
200
+ *
201
+ * @example
202
+ * ```ts
203
+ * const result = await client.templates.getLibraryCardTables();
204
+ * ```
205
+ */
206
+ async getLibraryCardTables(): Promise<components["schemas"]["GetTemplateLibraryCardTablesResponseContent"]> {
207
+ const response = await this.request(
208
+ {
209
+ service: "Templates",
210
+ operation: "GetTemplateLibraryCardTables",
211
+ resourceType: "template_library_card_table",
212
+ isMutation: false,
213
+ },
214
+ () =>
215
+ this.client.GET("/template_library/card_tables.json", {
216
+ })
217
+ );
218
+ return response;
219
+ }
220
+
221
+ /**
222
+ * Create a card table template with the default columns
223
+ * @param req - Template_library_card_table creation parameters
224
+ * @returns The CardTable
225
+ * @throws {BasecampError} If required fields are missing or invalid
226
+ *
227
+ * @example
228
+ * ```ts
229
+ * const result = await client.templates.createLibraryCardTable({ name: "My example" });
230
+ * ```
231
+ */
232
+ async createLibraryCardTable(req: CreateLibraryCardTableTemplateRequest): Promise<CardTable> {
233
+ if (!req.name) {
234
+ throw Errors.validation("Name is required");
235
+ }
236
+ const response = await this.request(
237
+ {
238
+ service: "Templates",
239
+ operation: "CreateTemplateLibraryCardTable",
240
+ resourceType: "template_library_card_table",
241
+ isMutation: true,
97
242
  },
98
243
  () =>
99
- this.client.GET("/template_library.json", {
244
+ this.client.POST("/template_library/card_tables.json", {
245
+ body: {
246
+ name: req.name,
247
+ },
100
248
  })
101
249
  );
102
250
  return response;
103
251
  }
104
252
 
105
253
  /**
106
- * Start copying a to-do list template into a project
254
+ * Start copying a to-do list or card table template into a project
107
255
  * @param req - Template_library_copy creation parameters
108
256
  * @returns The template_library_copy
109
257
  * @throws {BasecampError} If required fields are missing or invalid
110
258
  *
111
259
  * @example
112
260
  * ```ts
113
- * const result = await client.templates.createLibraryCopy({ templateRecordingId: 1, destinationParentId: 1 });
261
+ * const result = await client.templates.createLibraryCopy({ templateRecordingId: 1 });
114
262
  * ```
115
263
  */
116
264
  async createLibraryCopy(req: CreateLibraryCopyTemplateRequest): Promise<components["schemas"]["CreateTemplateLibraryCopyResponseContent"]> {
@@ -125,6 +273,7 @@ export class TemplatesService extends BaseService {
125
273
  this.client.POST("/template_library/copies.json", {
126
274
  body: {
127
275
  template_recording_id: req.templateRecordingId,
276
+ destination_project_id: req.destinationProjectId,
128
277
  destination_parent_id: req.destinationParentId,
129
278
  adding_people_confirmed: req.addingPeopleConfirmed,
130
279
  },
@@ -163,10 +312,68 @@ export class TemplatesService extends BaseService {
163
312
  return response;
164
313
  }
165
314
 
315
+ /**
316
+ * Get the account's to-do list templates
317
+ * @returns The template_library_todolist
318
+ * @throws {BasecampError} If the resource is not found
319
+ *
320
+ * @example
321
+ * ```ts
322
+ * const result = await client.templates.getLibraryTodolists();
323
+ * ```
324
+ */
325
+ async getLibraryTodolists(): Promise<components["schemas"]["GetTemplateLibraryTodolistsResponseContent"]> {
326
+ const response = await this.request(
327
+ {
328
+ service: "Templates",
329
+ operation: "GetTemplateLibraryTodolists",
330
+ resourceType: "template_library_todolist",
331
+ isMutation: false,
332
+ },
333
+ () =>
334
+ this.client.GET("/template_library/todolists.json", {
335
+ })
336
+ );
337
+ return response;
338
+ }
339
+
340
+ /**
341
+ * Create an empty to-do list template
342
+ * @param req - Template_library_todolist creation parameters
343
+ * @returns The Todolist
344
+ * @throws {BasecampError} If required fields are missing or invalid
345
+ *
346
+ * @example
347
+ * ```ts
348
+ * const result = await client.templates.createLibraryTodolist({ name: "My example" });
349
+ * ```
350
+ */
351
+ async createLibraryTodolist(req: CreateLibraryTodolistTemplateRequest): Promise<Todolist> {
352
+ if (!req.name) {
353
+ throw Errors.validation("Name is required");
354
+ }
355
+ const response = await this.request(
356
+ {
357
+ service: "Templates",
358
+ operation: "CreateTemplateLibraryTodolist",
359
+ resourceType: "template_library_todolist",
360
+ isMutation: true,
361
+ },
362
+ () =>
363
+ this.client.POST("/template_library/todolists.json", {
364
+ body: {
365
+ name: req.name,
366
+ description: req.description,
367
+ },
368
+ })
369
+ );
370
+ return response;
371
+ }
372
+
166
373
  /**
167
374
  * List all templates visible to the current user
168
375
  * @param options - Optional query parameters
169
- * @returns All Template across all pages, with .meta.totalCount
376
+ * @returns Every Template across all pages, with .meta.totalCount
170
377
  *
171
378
  * @example
172
379
  * ```ts
@@ -38,7 +38,7 @@ export class TimelineService extends BaseService {
38
38
  * Get project timeline
39
39
  * @param projectId - The project ID
40
40
  * @param options - Optional query parameters
41
- * @returns All TimelineEvent across all pages, with .meta.totalCount
41
+ * @returns Every TimelineEvent across all pages, with .meta.totalCount
42
42
  *
43
43
  * @example
44
44
  * ```ts
@@ -99,7 +99,7 @@ export class TimesheetsService extends BaseService {
99
99
  * Get timesheet for a specific project
100
100
  * @param projectId - The project ID
101
101
  * @param options - Optional query parameters
102
- * @returns All TimesheetEntry across all pages, with .meta.totalCount
102
+ * @returns Every TimesheetEntry across all pages, with .meta.totalCount
103
103
  *
104
104
  * @example
105
105
  * ```ts
@@ -130,7 +130,7 @@ export class TimesheetsService extends BaseService {
130
130
  * Get timesheet for a specific recording
131
131
  * @param recordingId - The recording ID
132
132
  * @param options - Optional query parameters
133
- * @returns All TimesheetEntry across all pages, with .meta.totalCount
133
+ * @returns Every TimesheetEntry across all pages, with .meta.totalCount
134
134
  *
135
135
  * @example
136
136
  * ```ts
@@ -296,7 +296,7 @@ export class TimesheetsService extends BaseService {
296
296
  }
297
297
 
298
298
  /**
299
- * Permanently delete a timesheet entry; answers 403 when the caller may not archive or trash it.
299
+ * Permanently delete a timesheet entry, which never appears in the trash and cannot be restored; this is the only way to remove one, since bc3 answers 403 to TrashRecording and ArchiveRecording for every timesheet entry, and it answers 403 when the caller may not remove the entry.
300
300
  * @param entryId - The entry ID
301
301
  * @returns void
302
302
  * @throws {BasecampError} If the request fails
@@ -88,7 +88,7 @@ export class TodolistGroupsService extends BaseService {
88
88
  * List groups in a todolist
89
89
  * @param todolistId - The todolist ID
90
90
  * @param options - Optional query parameters
91
- * @returns All Todolist across all pages, with .meta.totalCount
91
+ * @returns Every Todolist across all pages, with .meta.totalCount
92
92
  *
93
93
  * @example
94
94
  * ```ts
@@ -172,7 +172,7 @@ export class TodolistsService extends BaseService {
172
172
  * List todolists in a todoset
173
173
  * @param todosetId - The todoset ID
174
174
  * @param options - Optional query parameters
175
- * @returns All Todolist across all pages, with .meta.totalCount
175
+ * @returns Every Todolist across all pages, with .meta.totalCount
176
176
  *
177
177
  * @example
178
178
  * ```ts
@@ -164,7 +164,7 @@ export class TodosService extends BaseService {
164
164
  * List todos in a todolist
165
165
  * @param todolistId - The todolist ID
166
166
  * @param options - Optional query parameters
167
- * @returns All Todo across all pages, with .meta.totalCount
167
+ * @returns Every Todo across all pages, with .meta.totalCount
168
168
  *
169
169
  * @example
170
170
  * ```ts