@37signals/basecamp 0.14.0 → 0.16.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.
- package/README.md +1 -1
- package/dist/client.d.ts +5 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +4 -2
- package/dist/client.js.map +1 -1
- package/dist/download.d.ts +3 -1
- package/dist/download.d.ts.map +1 -1
- package/dist/download.js +87 -23
- package/dist/download.js.map +1 -1
- package/dist/errors.d.ts +40 -0
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +132 -15
- package/dist/errors.js.map +1 -1
- package/dist/generated/metadata.d.ts.map +1 -1
- package/dist/generated/metadata.js +115 -1
- package/dist/generated/metadata.js.map +1 -1
- package/dist/generated/metadata.ts +115 -1
- package/dist/generated/openapi-stripped.json +1412 -209
- package/dist/generated/path-mapping.d.ts.map +1 -1
- package/dist/generated/path-mapping.js +9 -0
- package/dist/generated/path-mapping.js.map +1 -1
- package/dist/generated/path-mapping.ts +9 -0
- package/dist/generated/schema.d.ts +1136 -85
- package/dist/generated/services/bubble-ups.d.ts +48 -0
- package/dist/generated/services/bubble-ups.d.ts.map +1 -0
- package/dist/generated/services/bubble-ups.js +67 -0
- package/dist/generated/services/bubble-ups.js.map +1 -0
- package/dist/generated/services/bubble-ups.ts +98 -0
- package/dist/generated/services/checkins.d.ts +1 -1
- package/dist/generated/services/checkins.d.ts.map +1 -1
- package/dist/generated/services/checkins.ts +1 -1
- package/dist/generated/services/gauges.d.ts +3 -2
- package/dist/generated/services/gauges.d.ts.map +1 -1
- package/dist/generated/services/gauges.ts +2 -2
- package/dist/generated/services/index.d.ts +1 -0
- package/dist/generated/services/index.d.ts.map +1 -1
- package/dist/generated/services/index.js +1 -0
- package/dist/generated/services/index.js.map +1 -1
- package/dist/generated/services/index.ts +1 -0
- package/dist/generated/services/projects.d.ts +22 -0
- package/dist/generated/services/projects.d.ts.map +1 -1
- package/dist/generated/services/projects.js +42 -0
- package/dist/generated/services/projects.js.map +1 -1
- package/dist/generated/services/projects.ts +53 -0
- package/dist/generated/services/recordings.d.ts +24 -0
- package/dist/generated/services/recordings.d.ts.map +1 -1
- package/dist/generated/services/recordings.js +49 -0
- package/dist/generated/services/recordings.js.map +1 -1
- package/dist/generated/services/recordings.ts +59 -0
- package/dist/generated/services/search.d.ts +2 -1
- package/dist/generated/services/search.d.ts.map +1 -1
- package/dist/generated/services/search.ts +1 -1
- package/dist/generated/services/templates.d.ts +46 -0
- package/dist/generated/services/templates.d.ts.map +1 -1
- package/dist/generated/services/templates.js +70 -0
- package/dist/generated/services/templates.js.map +1 -1
- package/dist/generated/services/templates.ts +98 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/oauth/authorization-document.d.ts +18 -11
- package/dist/oauth/authorization-document.d.ts.map +1 -1
- package/dist/oauth/authorization-document.js +16 -11
- package/dist/oauth/authorization-document.js.map +1 -1
- package/dist/oauth/device.d.ts.map +1 -1
- package/dist/oauth/device.js +9 -71
- package/dist/oauth/device.js.map +1 -1
- package/dist/oauth/exchange.d.ts.map +1 -1
- package/dist/oauth/exchange.js +55 -16
- package/dist/oauth/exchange.js.map +1 -1
- package/dist/oauth/limits.d.ts +33 -2
- package/dist/oauth/limits.d.ts.map +1 -1
- package/dist/oauth/limits.js +76 -2
- package/dist/oauth/limits.js.map +1 -1
- package/dist/retry.d.ts +23 -0
- package/dist/retry.d.ts.map +1 -1
- package/dist/retry.js +45 -10
- package/dist/retry.js.map +1 -1
- package/dist/services/base.d.ts +25 -2
- package/dist/services/base.d.ts.map +1 -1
- package/dist/services/base.js +85 -15
- package/dist/services/base.js.map +1 -1
- package/package.json +6 -4
- package/src/generated/metadata.ts +115 -1
- package/src/generated/openapi-stripped.json +1412 -209
- package/src/generated/path-mapping.ts +9 -0
- package/src/generated/schema.d.ts +1136 -85
- package/src/generated/services/bubble-ups.ts +98 -0
- package/src/generated/services/checkins.ts +1 -1
- package/src/generated/services/gauges.ts +2 -2
- package/src/generated/services/index.ts +1 -0
- package/src/generated/services/projects.ts +53 -0
- package/src/generated/services/recordings.ts +59 -0
- package/src/generated/services/search.ts +1 -1
- package/src/generated/services/templates.ts +98 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* BubbleUps 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
|
+
|
|
10
|
+
// =============================================================================
|
|
11
|
+
// Types
|
|
12
|
+
// =============================================================================
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Request parameters for createBubbleUp.
|
|
17
|
+
*/
|
|
18
|
+
export interface CreateBubbleUpBubbleUpRequest {
|
|
19
|
+
/** Timing for the bubble-up. `"now"` bubbles up immediately; a scheduling
|
|
20
|
+
keyword (`"today"`, `"tomorrow"`, `"weekend"`, `"next_week"`) or an ISO8601
|
|
21
|
+
date (e.g. `"2026-09-10"`) schedules it to resurface later. bc3 requires a
|
|
22
|
+
value — omitting `at` errors server-side (`Date.iso8601(nil)`) — so send
|
|
23
|
+
`"now"` for the immediate case. */
|
|
24
|
+
at?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
// =============================================================================
|
|
29
|
+
// Service
|
|
30
|
+
// =============================================================================
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Service for BubbleUps operations.
|
|
34
|
+
*/
|
|
35
|
+
export class BubbleUpsService extends BaseService {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Bubble up a recording for the current user, resurfacing it in the current
|
|
39
|
+
* @param recordingId - The recording ID
|
|
40
|
+
* @param req - Bubble_up creation parameters
|
|
41
|
+
* @returns void
|
|
42
|
+
* @throws {BasecampError} If required fields are missing or invalid
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* await client.bubbleUps.createBubbleUp(123, { });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
async createBubbleUp(recordingId: number, req: CreateBubbleUpBubbleUpRequest): Promise<void> {
|
|
50
|
+
await this.request(
|
|
51
|
+
{
|
|
52
|
+
service: "BubbleUps",
|
|
53
|
+
operation: "CreateBubbleUp",
|
|
54
|
+
resourceType: "bubble_up",
|
|
55
|
+
isMutation: true,
|
|
56
|
+
resourceId: recordingId,
|
|
57
|
+
},
|
|
58
|
+
() =>
|
|
59
|
+
this.client.POST("/recordings/{recordingId}/bubble_up.json", {
|
|
60
|
+
params: {
|
|
61
|
+
path: { recordingId },
|
|
62
|
+
},
|
|
63
|
+
body: {
|
|
64
|
+
at: req.at,
|
|
65
|
+
},
|
|
66
|
+
})
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Remove the current user's bubble-up from a recording.
|
|
72
|
+
* @param recordingId - The recording ID
|
|
73
|
+
* @returns void
|
|
74
|
+
* @throws {BasecampError} If the request fails
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* await client.bubbleUps.deleteBubbleUp(123);
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
async deleteBubbleUp(recordingId: number): Promise<void> {
|
|
82
|
+
await this.request(
|
|
83
|
+
{
|
|
84
|
+
service: "BubbleUps",
|
|
85
|
+
operation: "DeleteBubbleUp",
|
|
86
|
+
resourceType: "bubble_up",
|
|
87
|
+
isMutation: true,
|
|
88
|
+
resourceId: recordingId,
|
|
89
|
+
},
|
|
90
|
+
() =>
|
|
91
|
+
this.client.DELETE("/recordings/{recordingId}/bubble_up.json", {
|
|
92
|
+
params: {
|
|
93
|
+
path: { recordingId },
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
@@ -135,7 +135,7 @@ export class CheckinsService extends BaseService {
|
|
|
135
135
|
* const result = await client.checkins.reminders();
|
|
136
136
|
* ```
|
|
137
137
|
*/
|
|
138
|
-
async reminders(options?: RemindersCheckinOptions): Promise<components["schemas"]["
|
|
138
|
+
async reminders(options?: RemindersCheckinOptions): Promise<ListResult<components["schemas"]["QuestionReminder"]>> {
|
|
139
139
|
return this.requestPaginated(
|
|
140
140
|
{
|
|
141
141
|
service: "Checkins",
|
|
@@ -214,7 +214,7 @@ export class GaugesService extends BaseService {
|
|
|
214
214
|
* const filtered = await client.gauges.listGaugeNeedles(123, { page: 1 });
|
|
215
215
|
* ```
|
|
216
216
|
*/
|
|
217
|
-
async listGaugeNeedles(projectId: number, options?: ListGaugeNeedlesGaugeOptions): Promise<components["schemas"]["
|
|
217
|
+
async listGaugeNeedles(projectId: number, options?: ListGaugeNeedlesGaugeOptions): Promise<ListResult<components["schemas"]["GaugeNeedle"]>> {
|
|
218
218
|
return this.requestPaginated(
|
|
219
219
|
{
|
|
220
220
|
service: "Gauges",
|
|
@@ -286,7 +286,7 @@ export class GaugesService extends BaseService {
|
|
|
286
286
|
* const filtered = await client.gauges.listGauges({ bucketIds: "example" });
|
|
287
287
|
* ```
|
|
288
288
|
*/
|
|
289
|
-
async listGauges(options?: ListGaugesGaugeOptions): Promise<components["schemas"]["
|
|
289
|
+
async listGauges(options?: ListGaugesGaugeOptions): Promise<ListResult<components["schemas"]["Gauge"]>> {
|
|
290
290
|
return this.requestPaginated(
|
|
291
291
|
{
|
|
292
292
|
service: "Gauges",
|
|
@@ -37,6 +37,7 @@ export { ProjectsService } from "./projects.js";
|
|
|
37
37
|
export { RecordingsService } from "./recordings.js";
|
|
38
38
|
export { TimelineService } from "./timeline.js";
|
|
39
39
|
export { TimesheetsService } from "./timesheets.js";
|
|
40
|
+
export { BubbleUpsService } from "./bubble-ups.js";
|
|
40
41
|
export { ClientVisibilityService } from "./client-visibility.js";
|
|
41
42
|
export { EventsService } from "./events.js";
|
|
42
43
|
export { SubscriptionsService } from "./subscriptions.js";
|
|
@@ -61,6 +61,30 @@ export interface UpdateProjectRequest {
|
|
|
61
61
|
*/
|
|
62
62
|
export class ProjectsService extends BaseService {
|
|
63
63
|
|
|
64
|
+
/**
|
|
65
|
+
* List the projects the current user has most recently visited, most recent visit first.
|
|
66
|
+
* @returns Array of Project
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* const result = await client.projects.listRecentProjects();
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
async listRecentProjects(): Promise<Project[]> {
|
|
74
|
+
const response = await this.request(
|
|
75
|
+
{
|
|
76
|
+
service: "Projects",
|
|
77
|
+
operation: "ListRecentProjects",
|
|
78
|
+
resourceType: "project",
|
|
79
|
+
isMutation: false,
|
|
80
|
+
},
|
|
81
|
+
() =>
|
|
82
|
+
this.client.GET("/my/recent_projects.json", {
|
|
83
|
+
})
|
|
84
|
+
);
|
|
85
|
+
return response ?? [];
|
|
86
|
+
}
|
|
87
|
+
|
|
64
88
|
/**
|
|
65
89
|
* List projects (active by default; optionally archived/trashed)
|
|
66
90
|
* @param options - Optional query parameters
|
|
@@ -224,6 +248,35 @@ export class ProjectsService extends BaseService {
|
|
|
224
248
|
);
|
|
225
249
|
}
|
|
226
250
|
|
|
251
|
+
/**
|
|
252
|
+
* Record that the current user visited a project, moving it to the front of ListRecentProjects.
|
|
253
|
+
* @param projectId - The project ID
|
|
254
|
+
* @returns void
|
|
255
|
+
* @throws {BasecampError} If the request fails
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```ts
|
|
259
|
+
* await client.projects.recordProjectVisit(123);
|
|
260
|
+
* ```
|
|
261
|
+
*/
|
|
262
|
+
async recordProjectVisit(projectId: number): Promise<void> {
|
|
263
|
+
await this.request(
|
|
264
|
+
{
|
|
265
|
+
service: "Projects",
|
|
266
|
+
operation: "RecordProjectVisit",
|
|
267
|
+
resourceType: "project",
|
|
268
|
+
isMutation: true,
|
|
269
|
+
projectId,
|
|
270
|
+
},
|
|
271
|
+
() =>
|
|
272
|
+
this.client.POST("/projects/{projectId}/recent_visit.json", {
|
|
273
|
+
params: {
|
|
274
|
+
path: { projectId },
|
|
275
|
+
},
|
|
276
|
+
})
|
|
277
|
+
);
|
|
278
|
+
}
|
|
279
|
+
|
|
227
280
|
/**
|
|
228
281
|
* Restore a project to active status from trash as well as from the archive.
|
|
229
282
|
* @param projectId - The project ID
|
|
@@ -74,6 +74,65 @@ export class RecordingsService extends BaseService {
|
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
/**
|
|
78
|
+
* Put a recording's card in the spotlight area on its project or template home page.
|
|
79
|
+
* @param recordingId - The recording ID
|
|
80
|
+
* @returns The Recording
|
|
81
|
+
* @throws {BasecampError} If the request fails
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* const result = await client.recordings.spotlight(123);
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
async spotlight(recordingId: number): Promise<Recording> {
|
|
89
|
+
const response = await this.request(
|
|
90
|
+
{
|
|
91
|
+
service: "Recordings",
|
|
92
|
+
operation: "SpotlightRecording",
|
|
93
|
+
resourceType: "recording",
|
|
94
|
+
isMutation: true,
|
|
95
|
+
resourceId: recordingId,
|
|
96
|
+
},
|
|
97
|
+
() =>
|
|
98
|
+
this.client.POST("/recordings/{recordingId}/spotlight.json", {
|
|
99
|
+
params: {
|
|
100
|
+
path: { recordingId },
|
|
101
|
+
},
|
|
102
|
+
})
|
|
103
|
+
);
|
|
104
|
+
return response;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Remove a recording from the spotlight area.
|
|
109
|
+
* @param recordingId - The recording ID
|
|
110
|
+
* @returns void
|
|
111
|
+
* @throws {BasecampError} If the request fails
|
|
112
|
+
*
|
|
113
|
+
* @example
|
|
114
|
+
* ```ts
|
|
115
|
+
* await client.recordings.unspotlight(123);
|
|
116
|
+
* ```
|
|
117
|
+
*/
|
|
118
|
+
async unspotlight(recordingId: number): Promise<void> {
|
|
119
|
+
await this.request(
|
|
120
|
+
{
|
|
121
|
+
service: "Recordings",
|
|
122
|
+
operation: "UnspotlightRecording",
|
|
123
|
+
resourceType: "recording",
|
|
124
|
+
isMutation: true,
|
|
125
|
+
resourceId: recordingId,
|
|
126
|
+
},
|
|
127
|
+
() =>
|
|
128
|
+
this.client.DELETE("/recordings/{recordingId}/spotlight.json", {
|
|
129
|
+
params: {
|
|
130
|
+
path: { recordingId },
|
|
131
|
+
},
|
|
132
|
+
})
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
77
136
|
/**
|
|
78
137
|
* Unarchive a recording (restore to active status)
|
|
79
138
|
* @param recordingId - The recording ID
|
|
@@ -74,7 +74,7 @@ export class SearchService extends BaseService {
|
|
|
74
74
|
* const result = await client.search.search("q");
|
|
75
75
|
* ```
|
|
76
76
|
*/
|
|
77
|
-
async search(q: string, options?: SearchSearchOptions): Promise<components["schemas"]["
|
|
77
|
+
async search(q: string, options?: SearchSearchOptions): Promise<ListResult<components["schemas"]["SearchResult"]>> {
|
|
78
78
|
return this.requestPaginated(
|
|
79
79
|
{
|
|
80
80
|
service: "Search",
|
|
@@ -17,6 +17,18 @@ import { Errors } from "../../errors.js";
|
|
|
17
17
|
/** Template entity from the Basecamp API. */
|
|
18
18
|
export type Template = components["schemas"]["Template"];
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Request parameters for createLibraryCopy.
|
|
22
|
+
*/
|
|
23
|
+
export interface CreateLibraryCopyTemplateRequest {
|
|
24
|
+
/** Template recording id */
|
|
25
|
+
templateRecordingId: number;
|
|
26
|
+
/** Destination parent id */
|
|
27
|
+
destinationParentId: number;
|
|
28
|
+
/** Confirm granting destination-project access to people referenced by the template. */
|
|
29
|
+
addingPeopleConfirmed?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
20
32
|
/**
|
|
21
33
|
* Options for list.
|
|
22
34
|
*/
|
|
@@ -65,6 +77,92 @@ export interface CreateProjectTemplateRequest {
|
|
|
65
77
|
*/
|
|
66
78
|
export class TemplatesService extends BaseService {
|
|
67
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Get the account's to-do list template library
|
|
82
|
+
* @returns The template_library
|
|
83
|
+
* @throws {BasecampError} If the resource is not found
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* ```ts
|
|
87
|
+
* const result = await client.templates.getLibrary();
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
async getLibrary(): Promise<components["schemas"]["GetTemplateLibraryResponseContent"]> {
|
|
91
|
+
const response = await this.request(
|
|
92
|
+
{
|
|
93
|
+
service: "Templates",
|
|
94
|
+
operation: "GetTemplateLibrary",
|
|
95
|
+
resourceType: "template_library",
|
|
96
|
+
isMutation: false,
|
|
97
|
+
},
|
|
98
|
+
() =>
|
|
99
|
+
this.client.GET("/template_library.json", {
|
|
100
|
+
})
|
|
101
|
+
);
|
|
102
|
+
return response;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Start copying a to-do list template into a project
|
|
107
|
+
* @param req - Template_library_copy creation parameters
|
|
108
|
+
* @returns The template_library_copy
|
|
109
|
+
* @throws {BasecampError} If required fields are missing or invalid
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* const result = await client.templates.createLibraryCopy({ templateRecordingId: 1, destinationParentId: 1 });
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
async createLibraryCopy(req: CreateLibraryCopyTemplateRequest): Promise<components["schemas"]["CreateTemplateLibraryCopyResponseContent"]> {
|
|
117
|
+
const response = await this.request(
|
|
118
|
+
{
|
|
119
|
+
service: "Templates",
|
|
120
|
+
operation: "CreateTemplateLibraryCopy",
|
|
121
|
+
resourceType: "template_library_copy",
|
|
122
|
+
isMutation: true,
|
|
123
|
+
},
|
|
124
|
+
() =>
|
|
125
|
+
this.client.POST("/template_library/copies.json", {
|
|
126
|
+
body: {
|
|
127
|
+
template_recording_id: req.templateRecordingId,
|
|
128
|
+
destination_parent_id: req.destinationParentId,
|
|
129
|
+
adding_people_confirmed: req.addingPeopleConfirmed,
|
|
130
|
+
},
|
|
131
|
+
})
|
|
132
|
+
);
|
|
133
|
+
return response;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Get the current status of a to-do list template copy
|
|
138
|
+
* @param copyId - The copy ID
|
|
139
|
+
* @returns The template_library_copy
|
|
140
|
+
* @throws {BasecampError} If the resource is not found
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* const result = await client.templates.getLibraryCopy(123);
|
|
145
|
+
* ```
|
|
146
|
+
*/
|
|
147
|
+
async getLibraryCopy(copyId: number): Promise<components["schemas"]["GetTemplateLibraryCopyResponseContent"]> {
|
|
148
|
+
const response = await this.request(
|
|
149
|
+
{
|
|
150
|
+
service: "Templates",
|
|
151
|
+
operation: "GetTemplateLibraryCopy",
|
|
152
|
+
resourceType: "template_library_copy",
|
|
153
|
+
isMutation: false,
|
|
154
|
+
resourceId: copyId,
|
|
155
|
+
},
|
|
156
|
+
() =>
|
|
157
|
+
this.client.GET("/template_library/copies/{copyId}", {
|
|
158
|
+
params: {
|
|
159
|
+
path: { copyId },
|
|
160
|
+
},
|
|
161
|
+
})
|
|
162
|
+
);
|
|
163
|
+
return response;
|
|
164
|
+
}
|
|
165
|
+
|
|
68
166
|
/**
|
|
69
167
|
* List all templates visible to the current user
|
|
70
168
|
* @param options - Optional query parameters
|