@37signals/basecamp 0.21.0 → 0.23.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.
@@ -17308,6 +17308,106 @@
17308
17308
  }
17309
17309
  }
17310
17310
  },
17311
+ "/recordings/{recordingId}/filing.json": {
17312
+ "post": {
17313
+ "description": "Move a document, upload or vault into another vault in its project, or reorder it in its own vault.\n\nPassing the vault it is already in changes only its position. The\nrecording moves in place: its id, comments, bookmarks and history stay with\nit, and a vault takes everything inside it along. A destination in another\nproject is 404; moves to another project are not this operation. 404, 403 and\nsome 422s carry no body.\n\n403 when the caller may not move the recording (an account can restrict moves\nto admins and creators). 422 when position is not a positive whole number, the\ndestination is not a vault or is not active, the recording is not active, or a\nvault would move into one of its own vaults; only the position and vault-cycle\nrefusals carry an `error` message.",
17314
+ "operationId": "MoveRecordingToVault",
17315
+ "requestBody": {
17316
+ "content": {
17317
+ "application/json": {
17318
+ "schema": {
17319
+ "$ref": "#/components/schemas/MoveRecordingToVaultRequestContent"
17320
+ }
17321
+ }
17322
+ },
17323
+ "required": true
17324
+ },
17325
+ "parameters": [
17326
+ {
17327
+ "name": "recordingId",
17328
+ "in": "path",
17329
+ "schema": {
17330
+ "type": "integer",
17331
+ "format": "int64"
17332
+ },
17333
+ "required": true
17334
+ }
17335
+ ],
17336
+ "responses": {
17337
+ "204": {
17338
+ "description": "MoveRecordingToVault 204 response"
17339
+ },
17340
+ "400": {
17341
+ "description": "BadRequestError 400 response",
17342
+ "content": {
17343
+ "application/json": {
17344
+ "schema": {
17345
+ "$ref": "#/components/schemas/BadRequestErrorResponseContent"
17346
+ }
17347
+ }
17348
+ }
17349
+ },
17350
+ "401": {
17351
+ "description": "UnauthorizedError 401 response",
17352
+ "content": {
17353
+ "application/json": {
17354
+ "schema": {
17355
+ "$ref": "#/components/schemas/UnauthorizedErrorResponseContent"
17356
+ }
17357
+ }
17358
+ }
17359
+ },
17360
+ "403": {
17361
+ "description": "BareForbiddenError 403 response"
17362
+ },
17363
+ "404": {
17364
+ "description": "BareNotFoundError 404 response"
17365
+ },
17366
+ "422": {
17367
+ "description": "ValidationError 422 response",
17368
+ "content": {
17369
+ "application/json": {
17370
+ "schema": {
17371
+ "$ref": "#/components/schemas/ValidationErrorResponseContent"
17372
+ }
17373
+ }
17374
+ }
17375
+ },
17376
+ "429": {
17377
+ "description": "RateLimitError 429 response",
17378
+ "content": {
17379
+ "application/json": {
17380
+ "schema": {
17381
+ "$ref": "#/components/schemas/RateLimitErrorResponseContent"
17382
+ }
17383
+ }
17384
+ }
17385
+ },
17386
+ "500": {
17387
+ "description": "InternalServerError 500 response",
17388
+ "content": {
17389
+ "application/json": {
17390
+ "schema": {
17391
+ "$ref": "#/components/schemas/InternalServerErrorResponseContent"
17392
+ }
17393
+ }
17394
+ }
17395
+ }
17396
+ },
17397
+ "tags": [
17398
+ "Recordings"
17399
+ ],
17400
+ "x-basecamp-retry": {
17401
+ "maxAttempts": 2,
17402
+ "baseDelayMs": 1000,
17403
+ "backoff": "exponential",
17404
+ "retryOn": [
17405
+ 429,
17406
+ 503
17407
+ ]
17408
+ }
17409
+ }
17410
+ },
17311
17411
  "/recordings/{recordingId}/spotlight.json": {
17312
17412
  "delete": {
17313
17413
  "description": "Remove a recording from the spotlight area.\nIdempotent: removing an absent spotlight also returns 204.",
@@ -28807,7 +28907,7 @@
28807
28907
  "type": "string"
28808
28908
  },
28809
28909
  "schedule": {
28810
- "$ref": "#/components/schemas/QuestionSchedule"
28910
+ "$ref": "#/components/schemas/QuestionScheduleInput"
28811
28911
  },
28812
28912
  "visible_to_clients": {
28813
28913
  "type": "boolean"
@@ -32045,6 +32145,24 @@
32045
32145
  "column_id"
32046
32146
  ]
32047
32147
  },
32148
+ "MoveRecordingToVaultRequestContent": {
32149
+ "type": "object",
32150
+ "properties": {
32151
+ "parent_id": {
32152
+ "type": "integer",
32153
+ "description": "The destination vault. The recording's current vault keeps it where it is\nand changes only its position.",
32154
+ "format": "int64"
32155
+ },
32156
+ "position": {
32157
+ "type": "integer",
32158
+ "description": "1-indexed position within the destination vault. Defaults to 1 (first); a\nposition past the end places it last.",
32159
+ "format": "int32"
32160
+ }
32161
+ },
32162
+ "required": [
32163
+ "parent_id"
32164
+ ]
32165
+ },
32048
32166
  "MyAssignment": {
32049
32167
  "type": "object",
32050
32168
  "properties": {
@@ -33215,7 +33333,8 @@
33215
33333
  "items": {
33216
33334
  "type": "integer",
33217
33335
  "format": "int32"
33218
- }
33336
+ },
33337
+ "x-go-type-skip-optional-pointer": true
33219
33338
  },
33220
33339
  "hour": {
33221
33340
  "type": "integer",
@@ -33245,6 +33364,32 @@
33245
33364
  }
33246
33365
  }
33247
33366
  },
33367
+ "QuestionScheduleInput": {
33368
+ "type": "object",
33369
+ "description": "The schedule a question is created or updated with. BC3 reads the time of\nday as a string (\"5:00pm\"); hour and minute appear only in responses.",
33370
+ "properties": {
33371
+ "frequency": {
33372
+ "type": "string"
33373
+ },
33374
+ "days": {
33375
+ "type": "array",
33376
+ "items": {
33377
+ "type": "integer",
33378
+ "format": "int32"
33379
+ }
33380
+ },
33381
+ "time_of_day": {
33382
+ "type": "string"
33383
+ },
33384
+ "week_instance": {
33385
+ "type": "integer",
33386
+ "format": "int32"
33387
+ },
33388
+ "start_date": {
33389
+ "type": "string"
33390
+ }
33391
+ }
33392
+ },
33248
33393
  "Questionnaire": {
33249
33394
  "type": "object",
33250
33395
  "properties": {
@@ -36552,13 +36697,13 @@
36552
36697
  "UpdateQuestionNotificationSettingsRequestContent": {
36553
36698
  "type": "object",
36554
36699
  "properties": {
36555
- "notify_on_answer": {
36700
+ "responding": {
36556
36701
  "type": "boolean",
36557
- "description": "Notify when someone answers"
36702
+ "description": "Whether the authenticated user is asked this question. Omit to leave it unchanged.\nTurning it on also subscribes the user unless `subscribed: false` is sent with it."
36558
36703
  },
36559
- "digest_include_unanswered": {
36704
+ "subscribed": {
36560
36705
  "type": "boolean",
36561
- "description": "Include unanswered in digest"
36706
+ "description": "Whether the authenticated user is notified when someone answers. Omit to leave it unchanged."
36562
36707
  }
36563
36708
  }
36564
36709
  },
@@ -36580,7 +36725,7 @@
36580
36725
  "type": "string"
36581
36726
  },
36582
36727
  "schedule": {
36583
- "$ref": "#/components/schemas/QuestionSchedule"
36728
+ "$ref": "#/components/schemas/QuestionScheduleInput"
36584
36729
  },
36585
36730
  "paused": {
36586
36731
  "type": "boolean"
@@ -137,6 +137,7 @@ export const PATH_TO_OPERATION: Record<string, string> = {
137
137
  "PUT:/{accountId}/recordings/{recordingId}/client_visibility.json": "SetClientVisibility",
138
138
  "GET:/{accountId}/recordings/{recordingId}/comments.json": "ListComments",
139
139
  "POST:/{accountId}/recordings/{recordingId}/comments.json": "CreateComment",
140
+ "POST:/{accountId}/recordings/{recordingId}/filing.json": "MoveRecordingToVault",
140
141
  "DELETE:/{accountId}/recordings/{recordingId}/spotlight.json": "UnspotlightRecording",
141
142
  "POST:/{accountId}/recordings/{recordingId}/spotlight.json": "SpotlightRecording",
142
143
  "PUT:/{accountId}/recordings/{recordingId}/status/active.json": "UnarchiveRecording",
@@ -2660,6 +2660,37 @@ export interface paths {
2660
2660
  patch?: never;
2661
2661
  trace?: never;
2662
2662
  };
2663
+ "/recordings/{recordingId}/filing.json": {
2664
+ parameters: {
2665
+ query?: never;
2666
+ header?: never;
2667
+ path?: never;
2668
+ cookie?: never;
2669
+ };
2670
+ get?: never;
2671
+ put?: never;
2672
+ /**
2673
+ * @description Move a document, upload or vault into another vault in its project, or reorder it in its own vault.
2674
+ *
2675
+ * Passing the vault it is already in changes only its position. The
2676
+ * recording moves in place: its id, comments, bookmarks and history stay with
2677
+ * it, and a vault takes everything inside it along. A destination in another
2678
+ * project is 404; moves to another project are not this operation. 404, 403 and
2679
+ * some 422s carry no body.
2680
+ *
2681
+ * 403 when the caller may not move the recording (an account can restrict moves
2682
+ * to admins and creators). 422 when position is not a positive whole number, the
2683
+ * destination is not a vault or is not active, the recording is not active, or a
2684
+ * vault would move into one of its own vaults; only the position and vault-cycle
2685
+ * refusals carry an `error` message.
2686
+ */
2687
+ post: operations["MoveRecordingToVault"];
2688
+ delete?: never;
2689
+ options?: never;
2690
+ head?: never;
2691
+ patch?: never;
2692
+ trace?: never;
2693
+ };
2663
2694
  "/recordings/{recordingId}/spotlight.json": {
2664
2695
  parameters: {
2665
2696
  query?: never;
@@ -4639,7 +4670,7 @@ export interface components {
4639
4670
  CreateProjectResponseContent: components["schemas"]["Project"];
4640
4671
  CreateQuestionRequestContent: {
4641
4672
  title: string;
4642
- schedule: components["schemas"]["QuestionSchedule"];
4673
+ schedule: components["schemas"]["QuestionScheduleInput"];
4643
4674
  visible_to_clients?: boolean;
4644
4675
  };
4645
4676
  CreateQuestionResponseContent: components["schemas"]["Question"];
@@ -5840,6 +5871,20 @@ export interface components {
5840
5871
  */
5841
5872
  position?: number;
5842
5873
  };
5874
+ MoveRecordingToVaultRequestContent: {
5875
+ /**
5876
+ * Format: int64
5877
+ * @description The destination vault. The recording's current vault keeps it where it is
5878
+ * and changes only its position.
5879
+ */
5880
+ parent_id: number;
5881
+ /**
5882
+ * Format: int32
5883
+ * @description 1-indexed position within the destination vault. Defaults to 1 (first); a
5884
+ * position past the end places it last.
5885
+ */
5886
+ position?: number;
5887
+ };
5843
5888
  MyAssignment: {
5844
5889
  /** Format: int64 */
5845
5890
  id: number;
@@ -6282,6 +6327,18 @@ export interface components {
6282
6327
  start_date?: string;
6283
6328
  end_date?: string;
6284
6329
  };
6330
+ /**
6331
+ * @description The schedule a question is created or updated with. BC3 reads the time of
6332
+ * day as a string ("5:00pm"); hour and minute appear only in responses.
6333
+ */
6334
+ QuestionScheduleInput: {
6335
+ frequency?: string;
6336
+ days?: number[];
6337
+ time_of_day?: string;
6338
+ /** Format: int32 */
6339
+ week_instance?: number;
6340
+ start_date?: string;
6341
+ };
6285
6342
  Questionnaire: {
6286
6343
  /** Format: int64 */
6287
6344
  id: number;
@@ -7951,10 +8008,13 @@ export interface components {
7951
8008
  };
7952
8009
  UpdateProjectResponseContent: components["schemas"]["Project"];
7953
8010
  UpdateQuestionNotificationSettingsRequestContent: {
7954
- /** @description Notify when someone answers */
7955
- notify_on_answer?: boolean;
7956
- /** @description Include unanswered in digest */
7957
- digest_include_unanswered?: boolean;
8011
+ /**
8012
+ * @description Whether the authenticated user is asked this question. Omit to leave it unchanged.
8013
+ * Turning it on also subscribes the user unless `subscribed: false` is sent with it.
8014
+ */
8015
+ responding?: boolean;
8016
+ /** @description Whether the authenticated user is notified when someone answers. Omit to leave it unchanged. */
8017
+ subscribed?: boolean;
7958
8018
  };
7959
8019
  UpdateQuestionNotificationSettingsResponseContent: {
7960
8020
  responding?: boolean;
@@ -7962,7 +8022,7 @@ export interface components {
7962
8022
  };
7963
8023
  UpdateQuestionRequestContent: {
7964
8024
  title?: string;
7965
- schedule?: components["schemas"]["QuestionSchedule"];
8025
+ schedule?: components["schemas"]["QuestionScheduleInput"];
7966
8026
  paused?: boolean;
7967
8027
  };
7968
8028
  UpdateQuestionResponseContent: components["schemas"]["Question"];
@@ -20001,6 +20061,89 @@ export interface operations {
20001
20061
  };
20002
20062
  };
20003
20063
  };
20064
+ MoveRecordingToVault: {
20065
+ parameters: {
20066
+ query?: never;
20067
+ header?: never;
20068
+ path: {
20069
+ recordingId: number;
20070
+ };
20071
+ cookie?: never;
20072
+ };
20073
+ requestBody: {
20074
+ content: {
20075
+ "application/json": components["schemas"]["MoveRecordingToVaultRequestContent"];
20076
+ };
20077
+ };
20078
+ responses: {
20079
+ /** @description MoveRecordingToVault 204 response */
20080
+ 204: {
20081
+ headers: {
20082
+ [name: string]: unknown;
20083
+ };
20084
+ content?: never;
20085
+ };
20086
+ /** @description BadRequestError 400 response */
20087
+ 400: {
20088
+ headers: {
20089
+ [name: string]: unknown;
20090
+ };
20091
+ content: {
20092
+ "application/json": components["schemas"]["BadRequestErrorResponseContent"];
20093
+ };
20094
+ };
20095
+ /** @description UnauthorizedError 401 response */
20096
+ 401: {
20097
+ headers: {
20098
+ [name: string]: unknown;
20099
+ };
20100
+ content: {
20101
+ "application/json": components["schemas"]["UnauthorizedErrorResponseContent"];
20102
+ };
20103
+ };
20104
+ /** @description BareForbiddenError 403 response */
20105
+ 403: {
20106
+ headers: {
20107
+ [name: string]: unknown;
20108
+ };
20109
+ content?: never;
20110
+ };
20111
+ /** @description BareNotFoundError 404 response */
20112
+ 404: {
20113
+ headers: {
20114
+ [name: string]: unknown;
20115
+ };
20116
+ content?: never;
20117
+ };
20118
+ /** @description ValidationError 422 response */
20119
+ 422: {
20120
+ headers: {
20121
+ [name: string]: unknown;
20122
+ };
20123
+ content: {
20124
+ "application/json": components["schemas"]["ValidationErrorResponseContent"];
20125
+ };
20126
+ };
20127
+ /** @description RateLimitError 429 response */
20128
+ 429: {
20129
+ headers: {
20130
+ [name: string]: unknown;
20131
+ };
20132
+ content: {
20133
+ "application/json": components["schemas"]["RateLimitErrorResponseContent"];
20134
+ };
20135
+ };
20136
+ /** @description InternalServerError 500 response */
20137
+ 500: {
20138
+ headers: {
20139
+ [name: string]: unknown;
20140
+ };
20141
+ content: {
20142
+ "application/json": components["schemas"]["InternalServerErrorResponseContent"];
20143
+ };
20144
+ };
20145
+ };
20146
+ };
20004
20147
  SpotlightRecording: {
20005
20148
  parameters: {
20006
20149
  query?: never;
@@ -56,7 +56,7 @@ export interface CreateQuestionCheckinRequest {
56
56
  /** Title */
57
57
  title: string;
58
58
  /** Schedule */
59
- schedule: components["schemas"]["QuestionSchedule"];
59
+ schedule: components["schemas"]["QuestionScheduleInput"];
60
60
  /** Visible to clients */
61
61
  visibleToClients?: boolean;
62
62
  }
@@ -68,7 +68,7 @@ export interface UpdateQuestionCheckinRequest {
68
68
  /** Title */
69
69
  title?: string;
70
70
  /** Schedule */
71
- schedule?: components["schemas"]["QuestionSchedule"];
71
+ schedule?: components["schemas"]["QuestionScheduleInput"];
72
72
  /** Paused */
73
73
  paused?: boolean;
74
74
  }
@@ -109,10 +109,11 @@ export interface ByPersonCheckinOptions extends PaginationOptions {
109
109
  * Request parameters for updateNotificationSettings.
110
110
  */
111
111
  export interface UpdateNotificationSettingsCheckinRequest {
112
- /** Notify when someone answers */
113
- notifyOnAnswer?: boolean;
114
- /** Include unanswered in digest */
115
- digestIncludeUnanswered?: boolean;
112
+ /** Whether the authenticated user is asked this question. Omit to leave it unchanged.
113
+ Turning it on also subscribes the user unless `subscribed: false` is sent with it. */
114
+ responding?: boolean;
115
+ /** Whether the authenticated user is notified when someone answers. Omit to leave it unchanged. */
116
+ subscribed?: boolean;
116
117
  }
117
118
 
118
119
 
@@ -559,8 +560,8 @@ export class CheckinsService extends BaseService {
559
560
  path: { questionId },
560
561
  },
561
562
  body: {
562
- notify_on_answer: req.notifyOnAnswer,
563
- digest_include_unanswered: req.digestIncludeUnanswered,
563
+ responding: req.responding,
564
+ subscribed: req.subscribed,
564
565
  },
565
566
  })
566
567
  );
@@ -32,6 +32,18 @@ export interface ListRecordingOptions extends PaginationOptions {
32
32
  page?: number;
33
33
  }
34
34
 
35
+ /**
36
+ * Request parameters for moveToVault.
37
+ */
38
+ export interface MoveToVaultRecordingRequest {
39
+ /** The destination vault. The recording's current vault keeps it where it is
40
+ and changes only its position. */
41
+ parentId: number;
42
+ /** 1-indexed position within the destination vault. Defaults to 1 (first); a
43
+ position past the end places it last. */
44
+ position?: number;
45
+ }
46
+
35
47
 
36
48
  // =============================================================================
37
49
  // Service
@@ -74,6 +86,40 @@ export class RecordingsService extends BaseService {
74
86
  );
75
87
  }
76
88
 
89
+ /**
90
+ * Move a document, upload or vault into another vault in its project, or reorder it in its own vault.
91
+ * @param recordingId - The recording ID
92
+ * @param req - Recording request parameters
93
+ * @returns void
94
+ * @throws {BasecampError} If the request fails
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * await client.recordings.moveToVault(123, { parentId: 1 });
99
+ * ```
100
+ */
101
+ async moveToVault(recordingId: number, req: MoveToVaultRecordingRequest): Promise<void> {
102
+ await this.request(
103
+ {
104
+ service: "Recordings",
105
+ operation: "MoveRecordingToVault",
106
+ resourceType: "recording",
107
+ isMutation: true,
108
+ resourceId: recordingId,
109
+ },
110
+ () =>
111
+ this.client.POST("/recordings/{recordingId}/filing.json", {
112
+ params: {
113
+ path: { recordingId },
114
+ },
115
+ body: {
116
+ parent_id: req.parentId,
117
+ position: req.position,
118
+ },
119
+ })
120
+ );
121
+ }
122
+
77
123
  /**
78
124
  * Put a recording's card in the spotlight area on its project or template home page.
79
125
  * @param recordingId - The recording ID