@37signals/basecamp 0.24.0 → 0.26.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 -0
- package/dist/client.d.ts +5 -2
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +5 -2
- package/dist/client.js.map +1 -1
- package/dist/generated/metadata.d.ts.map +1 -1
- package/dist/generated/metadata.js +48 -1
- package/dist/generated/metadata.js.map +1 -1
- package/dist/generated/metadata.ts +48 -1
- package/dist/generated/openapi-stripped.json +541 -20
- package/dist/generated/path-mapping.d.ts.map +1 -1
- package/dist/generated/path-mapping.js +4 -0
- package/dist/generated/path-mapping.js.map +1 -1
- package/dist/generated/path-mapping.ts +4 -0
- package/dist/generated/person-id-sites.d.ts.map +1 -1
- package/dist/generated/person-id-sites.js +12 -0
- package/dist/generated/person-id-sites.js.map +1 -1
- package/dist/generated/person-id-sites.ts +12 -0
- package/dist/generated/schema.d.ts +482 -23
- package/dist/generated/services/boosts.d.ts +22 -2
- package/dist/generated/services/boosts.d.ts.map +1 -1
- package/dist/generated/services/boosts.js +34 -2
- package/dist/generated/services/boosts.js.map +1 -1
- package/dist/generated/services/boosts.ts +47 -2
- package/dist/generated/services/card-columns.d.ts +7 -4
- package/dist/generated/services/card-columns.d.ts.map +1 -1
- package/dist/generated/services/card-columns.js +1 -1
- package/dist/generated/services/card-columns.js.map +1 -1
- package/dist/generated/services/card-columns.ts +7 -4
- package/dist/generated/services/cards.d.ts +3 -2
- package/dist/generated/services/cards.d.ts.map +1 -1
- package/dist/generated/services/cards.js +1 -1
- package/dist/generated/services/cards.js.map +1 -1
- package/dist/generated/services/cards.ts +3 -2
- package/dist/generated/services/checkins.d.ts +2 -4
- package/dist/generated/services/checkins.d.ts.map +1 -1
- package/dist/generated/services/checkins.js +1 -2
- package/dist/generated/services/checkins.js.map +1 -1
- package/dist/generated/services/checkins.ts +2 -5
- 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/lineup.d.ts +8 -8
- package/dist/generated/services/lineup.d.ts.map +1 -1
- package/dist/generated/services/lineup.js +10 -8
- package/dist/generated/services/lineup.js.map +1 -1
- package/dist/generated/services/lineup.ts +12 -10
- package/dist/generated/services/my-notifications.d.ts +1 -1
- package/dist/generated/services/my-notifications.js +1 -1
- package/dist/generated/services/my-notifications.ts +1 -1
- package/dist/generated/services/pings.d.ts +59 -0
- package/dist/generated/services/pings.d.ts.map +1 -0
- package/dist/generated/services/pings.js +89 -0
- package/dist/generated/services/pings.js.map +1 -0
- package/dist/generated/services/pings.ts +125 -0
- package/dist/generated/services/wormholes.d.ts +3 -3
- package/dist/generated/services/wormholes.js +3 -3
- package/dist/generated/services/wormholes.ts +3 -3
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/services/recordings-extensions.d.ts +8 -7
- package/dist/services/recordings-extensions.d.ts.map +1 -1
- package/dist/services/recordings-extensions.js +63 -18
- package/dist/services/recordings-extensions.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/metadata.ts +48 -1
- package/src/generated/openapi-stripped.json +541 -20
- package/src/generated/path-mapping.ts +4 -0
- package/src/generated/person-id-sites.ts +12 -0
- package/src/generated/schema.d.ts +482 -23
- package/src/generated/services/boosts.ts +47 -2
- package/src/generated/services/card-columns.ts +7 -4
- package/src/generated/services/cards.ts +3 -2
- package/src/generated/services/checkins.ts +2 -5
- package/src/generated/services/index.ts +1 -0
- package/src/generated/services/lineup.ts +12 -10
- package/src/generated/services/my-notifications.ts +1 -1
- package/src/generated/services/pings.ts +125 -0
- package/src/generated/services/wormholes.ts +3 -3
|
@@ -17,6 +17,14 @@ import { Errors } from "../../errors.js";
|
|
|
17
17
|
/** Boost entity from the Basecamp API. */
|
|
18
18
|
export type Boost = components["schemas"]["Boost"];
|
|
19
19
|
|
|
20
|
+
/**
|
|
21
|
+
* Request parameters for update.
|
|
22
|
+
*/
|
|
23
|
+
export interface UpdateBoostRequest {
|
|
24
|
+
/** Text content */
|
|
25
|
+
content: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
20
28
|
/**
|
|
21
29
|
* Options for listForRecording.
|
|
22
30
|
*/
|
|
@@ -89,6 +97,43 @@ export class BoostsService extends BaseService {
|
|
|
89
97
|
return response;
|
|
90
98
|
}
|
|
91
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Replace the content of a boost. Only the boost's creator may update it: an
|
|
102
|
+
* @param boostId - The boost ID
|
|
103
|
+
* @param req - Boost update parameters
|
|
104
|
+
* @returns The Boost
|
|
105
|
+
* @throws {BasecampError} If the resource is not found or fields are invalid
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* const result = await client.boosts.update(123, { content: "Hello world" });
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
async update(boostId: number, req: UpdateBoostRequest): Promise<Boost> {
|
|
113
|
+
if (!req.content) {
|
|
114
|
+
throw Errors.validation("Content is required");
|
|
115
|
+
}
|
|
116
|
+
const response = await this.request(
|
|
117
|
+
{
|
|
118
|
+
service: "Boosts",
|
|
119
|
+
operation: "UpdateBoost",
|
|
120
|
+
resourceType: "boost",
|
|
121
|
+
isMutation: true,
|
|
122
|
+
resourceId: boostId,
|
|
123
|
+
},
|
|
124
|
+
() =>
|
|
125
|
+
this.client.PUT("/boosts/{boostId}", {
|
|
126
|
+
params: {
|
|
127
|
+
path: { boostId },
|
|
128
|
+
},
|
|
129
|
+
body: {
|
|
130
|
+
content: req.content,
|
|
131
|
+
},
|
|
132
|
+
})
|
|
133
|
+
);
|
|
134
|
+
return response;
|
|
135
|
+
}
|
|
136
|
+
|
|
92
137
|
/**
|
|
93
138
|
* Delete a boost
|
|
94
139
|
* @param boostId - The boost ID
|
|
@@ -190,7 +235,7 @@ export class BoostsService extends BaseService {
|
|
|
190
235
|
}
|
|
191
236
|
|
|
192
237
|
/**
|
|
193
|
-
* List boosts on a specific event within a recording
|
|
238
|
+
* List boosts on a specific event within a recording. Only boostable events carry boosts: those whose action is completed, adopted, column_changed or moved_in (their JSON includes boosts_count and boosts_url). Any other event answers 403 Forbidden; an event on a recording the person cannot see answers 404.
|
|
194
239
|
* @param recordingId - The recording ID
|
|
195
240
|
* @param eventId - The event ID
|
|
196
241
|
* @param options - Optional query parameters
|
|
@@ -225,7 +270,7 @@ export class BoostsService extends BaseService {
|
|
|
225
270
|
}
|
|
226
271
|
|
|
227
272
|
/**
|
|
228
|
-
* Create a boost on a specific event within a recording
|
|
273
|
+
* Create a boost on a specific event within a recording. Only boostable events accept one: those whose action is completed, adopted, column_changed or moved_in (their JSON includes boosts_count and boosts_url). Any other event answers 403 Forbidden, as does an event on a recording whose comments are closed; an event on a recording the person cannot see answers 404.
|
|
229
274
|
* @param recordingId - The recording ID
|
|
230
275
|
* @param eventId - The event ID
|
|
231
276
|
* @param req - Event_boost creation parameters
|
|
@@ -47,11 +47,14 @@ export interface CreateCardColumnRequest {
|
|
|
47
47
|
* Request parameters for move.
|
|
48
48
|
*/
|
|
49
49
|
export interface MoveCardColumnRequest {
|
|
50
|
-
/**
|
|
50
|
+
/** The column to move. */
|
|
51
51
|
sourceId: number;
|
|
52
|
-
/**
|
|
52
|
+
/** The card table the column moves within: the same id as `cardTableId`.
|
|
53
|
+
Basecamp refuses any other destination, a column included, with 422. */
|
|
53
54
|
targetId: number;
|
|
54
|
-
/**
|
|
55
|
+
/** 1-based slot among the card table's columns, not counting Triage,
|
|
56
|
+
Not Now or Done. 1 puts the column first; a slot past the last puts it
|
|
57
|
+
last. Default: 1. */
|
|
55
58
|
position?: number;
|
|
56
59
|
}
|
|
57
60
|
|
|
@@ -330,7 +333,7 @@ export class CardColumnsService extends BaseService {
|
|
|
330
333
|
}
|
|
331
334
|
|
|
332
335
|
/**
|
|
333
|
-
* Move a column
|
|
336
|
+
* Move a column to a slot within its card table. target_id is the card table's own id (the same as cardTableId), not a column; position is the 1-based slot among the columns, not counting Triage, Not Now or Done.
|
|
334
337
|
* @param cardTableId - The card table ID
|
|
335
338
|
* @param req - Card_column request parameters
|
|
336
339
|
* @returns void
|
|
@@ -35,7 +35,8 @@ export interface UpdateVerbatimCardRequest {
|
|
|
35
35
|
* Request parameters for move.
|
|
36
36
|
*/
|
|
37
37
|
export interface MoveCardRequest {
|
|
38
|
-
/**
|
|
38
|
+
/** Any column in the card's project, on this or another card table, or a
|
|
39
|
+
wormhole id to send the card to another project. */
|
|
39
40
|
columnId: number;
|
|
40
41
|
/** 1-indexed position within the destination column. Defaults to 1 (top). */
|
|
41
42
|
position?: number;
|
|
@@ -144,7 +145,7 @@ export class CardsService extends BaseService {
|
|
|
144
145
|
}
|
|
145
146
|
|
|
146
147
|
/**
|
|
147
|
-
* Move a card to a
|
|
148
|
+
* Move a card to any column in its project, including on another card table there, or through a linked wormhole to another project (queued: the card gets a new id, and position, if sent, must still be positive but doesn't set placement).
|
|
148
149
|
* @param cardId - The card ID
|
|
149
150
|
* @param req - Card request parameters
|
|
150
151
|
* @returns void
|
|
@@ -65,12 +65,10 @@ export interface CreateQuestionCheckinRequest {
|
|
|
65
65
|
* Request parameters for updateQuestion.
|
|
66
66
|
*/
|
|
67
67
|
export interface UpdateQuestionCheckinRequest {
|
|
68
|
-
/**
|
|
68
|
+
/** The question text. An update carries a title, a schedule or both. */
|
|
69
69
|
title?: string;
|
|
70
70
|
/** Schedule */
|
|
71
71
|
schedule?: components["schemas"]["QuestionScheduleInput"];
|
|
72
|
-
/** Paused */
|
|
73
|
-
paused?: boolean;
|
|
74
72
|
}
|
|
75
73
|
|
|
76
74
|
/**
|
|
@@ -361,7 +359,7 @@ export class CheckinsService extends BaseService {
|
|
|
361
359
|
}
|
|
362
360
|
|
|
363
361
|
/**
|
|
364
|
-
* Update an existing question
|
|
362
|
+
* Update an existing question's title, schedule or both. A schedule replaces the whole schedule, so send every part of it: one without frequency or time_of_day is refused, and one without start_date re-anchors the recurrence on today. Pausing and resuming are PauseQuestion and ResumeQuestion.
|
|
365
363
|
* @param questionId - The question ID
|
|
366
364
|
* @param req - Question update parameters
|
|
367
365
|
* @returns The Question
|
|
@@ -389,7 +387,6 @@ export class CheckinsService extends BaseService {
|
|
|
389
387
|
body: {
|
|
390
388
|
title: req.title,
|
|
391
389
|
schedule: req.schedule,
|
|
392
|
-
paused: req.paused,
|
|
393
390
|
},
|
|
394
391
|
})
|
|
395
392
|
);
|
|
@@ -19,6 +19,7 @@ export { CardsService } from "./cards.js";
|
|
|
19
19
|
export { CardStepsService } from "./card-steps.js";
|
|
20
20
|
export { CardTablesService } from "./card-tables.js";
|
|
21
21
|
export { EverythingService } from "./everything.js";
|
|
22
|
+
export { PingsService } from "./pings.js";
|
|
22
23
|
export { PeopleService } from "./people.js";
|
|
23
24
|
export { CommentsService } from "./comments.js";
|
|
24
25
|
export { DocumentsService } from "./documents.js";
|
|
@@ -70,24 +70,24 @@ export class LineupService extends BaseService {
|
|
|
70
70
|
}
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
* Create a new lineup marker
|
|
73
|
+
* Create a new lineup marker. Returns the created marker.
|
|
74
74
|
* @param req - Lineup_marker creation parameters
|
|
75
|
-
* @returns
|
|
75
|
+
* @returns The LineupMarker
|
|
76
76
|
* @throws {BasecampError} If required fields are missing or invalid
|
|
77
77
|
*
|
|
78
78
|
* @example
|
|
79
79
|
* ```ts
|
|
80
|
-
* await client.lineup.create({ name: "My example", date: "example" });
|
|
80
|
+
* const result = await client.lineup.create({ name: "My example", date: "example" });
|
|
81
81
|
* ```
|
|
82
82
|
*/
|
|
83
|
-
async create(req: CreateLineupRequest): Promise<
|
|
83
|
+
async create(req: CreateLineupRequest): Promise<LineupMarker> {
|
|
84
84
|
if (!req.name) {
|
|
85
85
|
throw Errors.validation("Name is required");
|
|
86
86
|
}
|
|
87
87
|
if (!req.date) {
|
|
88
88
|
throw Errors.validation("Date is required");
|
|
89
89
|
}
|
|
90
|
-
await this.request(
|
|
90
|
+
const response = await this.request(
|
|
91
91
|
{
|
|
92
92
|
service: "Lineup",
|
|
93
93
|
operation: "CreateLineupMarker",
|
|
@@ -102,22 +102,23 @@ export class LineupService extends BaseService {
|
|
|
102
102
|
},
|
|
103
103
|
})
|
|
104
104
|
);
|
|
105
|
+
return response;
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
/**
|
|
108
|
-
* Update an existing lineup marker
|
|
109
|
+
* Update an existing lineup marker. Returns the updated marker.
|
|
109
110
|
* @param markerId - The marker ID
|
|
110
111
|
* @param req - Lineup_marker update parameters
|
|
111
|
-
* @returns
|
|
112
|
+
* @returns The LineupMarker
|
|
112
113
|
* @throws {BasecampError} If the resource is not found or fields are invalid
|
|
113
114
|
*
|
|
114
115
|
* @example
|
|
115
116
|
* ```ts
|
|
116
|
-
* await client.lineup.update(123, { });
|
|
117
|
+
* const result = await client.lineup.update(123, { });
|
|
117
118
|
* ```
|
|
118
119
|
*/
|
|
119
|
-
async update(markerId: number, req: UpdateLineupRequest): Promise<
|
|
120
|
-
await this.request(
|
|
120
|
+
async update(markerId: number, req: UpdateLineupRequest): Promise<LineupMarker> {
|
|
121
|
+
const response = await this.request(
|
|
121
122
|
{
|
|
122
123
|
service: "Lineup",
|
|
123
124
|
operation: "UpdateLineupMarker",
|
|
@@ -136,6 +137,7 @@ export class LineupService extends BaseService {
|
|
|
136
137
|
},
|
|
137
138
|
})
|
|
138
139
|
);
|
|
140
|
+
return response;
|
|
139
141
|
}
|
|
140
142
|
|
|
141
143
|
/**
|
|
@@ -60,7 +60,7 @@ At most 500 per request. */
|
|
|
60
60
|
export class MyNotificationsService extends BaseService {
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
|
-
* Get the current user's
|
|
63
|
+
* Get the current user's notifications (the "Hey!" menu in Basecamp 4).
|
|
64
64
|
* @param options - Optional query parameters
|
|
65
65
|
* @returns The my_notification
|
|
66
66
|
*
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pings 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 { Errors } from "../../errors.js";
|
|
10
|
+
|
|
11
|
+
// =============================================================================
|
|
12
|
+
// Types
|
|
13
|
+
// =============================================================================
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Request parameters for create.
|
|
18
|
+
*/
|
|
19
|
+
export interface CreatePingRequest {
|
|
20
|
+
/** Person ids of the people to ping. People the caller cannot reach are
|
|
21
|
+
dropped. */
|
|
22
|
+
userIds: number[];
|
|
23
|
+
/** Create a new group even when a Ping with exactly these people exists. */
|
|
24
|
+
newGroup?: boolean;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
// =============================================================================
|
|
29
|
+
// Service
|
|
30
|
+
// =============================================================================
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Service for Pings operations.
|
|
34
|
+
*/
|
|
35
|
+
export class PingsService extends BaseService {
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Get Pings: the caller's active Pings that have a line in them, most
|
|
39
|
+
* @returns Array of results
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const result = await client.pings.list();
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
async list(): Promise<components["schemas"]["ListPingsResponseContent"]> {
|
|
47
|
+
const response = await this.request(
|
|
48
|
+
{
|
|
49
|
+
service: "Pings",
|
|
50
|
+
operation: "ListPings",
|
|
51
|
+
resourceType: "ping",
|
|
52
|
+
isMutation: false,
|
|
53
|
+
},
|
|
54
|
+
() =>
|
|
55
|
+
this.client.GET("/circles.json", {
|
|
56
|
+
})
|
|
57
|
+
);
|
|
58
|
+
return response ?? [];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Create a Ping with people, or return the one that already holds exactly
|
|
63
|
+
* @param req - Ping creation parameters
|
|
64
|
+
* @returns The ping
|
|
65
|
+
* @throws {BasecampError} If required fields are missing or invalid
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const result = await client.pings.create({ userIds: [1234] });
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
async create(req: CreatePingRequest): Promise<components["schemas"]["CreatePingResponseContent"]> {
|
|
73
|
+
if (!req.userIds) {
|
|
74
|
+
throw Errors.validation("User ids is required");
|
|
75
|
+
}
|
|
76
|
+
const response = await this.request(
|
|
77
|
+
{
|
|
78
|
+
service: "Pings",
|
|
79
|
+
operation: "CreatePing",
|
|
80
|
+
resourceType: "ping",
|
|
81
|
+
isMutation: true,
|
|
82
|
+
},
|
|
83
|
+
() =>
|
|
84
|
+
this.client.POST("/circles.json", {
|
|
85
|
+
body: {
|
|
86
|
+
user_ids: req.userIds,
|
|
87
|
+
new_group: req.newGroup,
|
|
88
|
+
},
|
|
89
|
+
})
|
|
90
|
+
);
|
|
91
|
+
return response;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Get a Ping by its id, which is its bucket's id.
|
|
96
|
+
* @param pingId - A Ping's id is the id of the bucket that holds it (the bucket type is
|
|
97
|
+
"Circle", which is also the wire path), so the `bucket.id` a Ping's
|
|
98
|
+
recordings carry is the id GetPing takes.
|
|
99
|
+
* @returns The ping
|
|
100
|
+
* @throws {BasecampError} If the resource is not found
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
* ```ts
|
|
104
|
+
* const result = await client.pings.get(123);
|
|
105
|
+
* ```
|
|
106
|
+
*/
|
|
107
|
+
async get(pingId: number): Promise<components["schemas"]["GetPingResponseContent"]> {
|
|
108
|
+
const response = await this.request(
|
|
109
|
+
{
|
|
110
|
+
service: "Pings",
|
|
111
|
+
operation: "GetPing",
|
|
112
|
+
resourceType: "ping",
|
|
113
|
+
isMutation: false,
|
|
114
|
+
resourceId: pingId,
|
|
115
|
+
},
|
|
116
|
+
() =>
|
|
117
|
+
this.client.GET("/circles/{pingId}", {
|
|
118
|
+
params: {
|
|
119
|
+
path: { pingId },
|
|
120
|
+
},
|
|
121
|
+
})
|
|
122
|
+
);
|
|
123
|
+
return response;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
@@ -41,7 +41,7 @@ export interface CreateWormholeRequest {
|
|
|
41
41
|
export class WormholesService extends BaseService {
|
|
42
42
|
|
|
43
43
|
/**
|
|
44
|
-
*
|
|
44
|
+
* Point a card table's wormhole, its shortcut for sending cards to another card table, at a different destination column
|
|
45
45
|
* @param bucketId - The bucket ID
|
|
46
46
|
* @param wormholeId - The wormhole ID
|
|
47
47
|
* @param req - Wormhole update parameters
|
|
@@ -77,7 +77,7 @@ export class WormholesService extends BaseService {
|
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
|
-
*
|
|
80
|
+
* Permanently delete a card table's wormhole, the shortcut that sends cards to another card table.
|
|
81
81
|
* @param bucketId - The bucket ID
|
|
82
82
|
* @param wormholeId - The wormhole ID
|
|
83
83
|
* @returns void
|
|
@@ -108,7 +108,7 @@ export class WormholesService extends BaseService {
|
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
/**
|
|
111
|
-
*
|
|
111
|
+
* Add a wormhole to a card table: a standing shortcut that sends cards to a column on another card table, usually in another project.
|
|
112
112
|
* @param bucketId - The bucket ID
|
|
113
113
|
* @param cardTableId - The card table ID
|
|
114
114
|
* @param req - Wormhole creation parameters
|