@37signals/basecamp 0.6.0 → 0.7.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/dist/client.d.ts +16 -1
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +25 -1
- package/dist/client.js.map +1 -1
- package/dist/generated/metadata.json +319 -1
- package/dist/generated/openapi-stripped.json +5073 -1916
- package/dist/generated/path-mapping.d.ts.map +1 -1
- package/dist/generated/path-mapping.js +26 -2
- package/dist/generated/path-mapping.js.map +1 -1
- package/dist/generated/path-mapping.ts +27 -3
- package/dist/generated/schema.d.ts +2268 -150
- package/dist/generated/services/account.d.ts +66 -0
- package/dist/generated/services/account.d.ts.map +1 -0
- package/dist/generated/services/account.js +101 -0
- package/dist/generated/services/account.js.map +1 -0
- package/dist/generated/services/account.ts +144 -0
- package/dist/generated/services/campfires.d.ts +14 -0
- package/dist/generated/services/campfires.d.ts.map +1 -1
- package/dist/generated/services/campfires.js +8 -0
- package/dist/generated/services/campfires.js.map +1 -1
- package/dist/generated/services/campfires.ts +16 -0
- package/dist/generated/services/cards.d.ts +2 -0
- package/dist/generated/services/cards.d.ts.map +1 -1
- package/dist/generated/services/cards.js +1 -0
- package/dist/generated/services/cards.js.map +1 -1
- package/dist/generated/services/cards.ts +3 -0
- package/dist/generated/services/client-approvals.d.ts +7 -0
- package/dist/generated/services/client-approvals.d.ts.map +1 -1
- package/dist/generated/services/client-approvals.js +8 -1
- package/dist/generated/services/client-approvals.js.map +1 -1
- package/dist/generated/services/client-approvals.ts +10 -0
- package/dist/generated/services/client-correspondences.d.ts +7 -0
- package/dist/generated/services/client-correspondences.d.ts.map +1 -1
- package/dist/generated/services/client-correspondences.js +8 -1
- package/dist/generated/services/client-correspondences.js.map +1 -1
- package/dist/generated/services/client-correspondences.ts +10 -0
- package/dist/generated/services/forwards.d.ts +7 -0
- package/dist/generated/services/forwards.d.ts.map +1 -1
- package/dist/generated/services/forwards.js +4 -0
- package/dist/generated/services/forwards.js.map +1 -1
- package/dist/generated/services/forwards.ts +8 -0
- package/dist/generated/services/gauges.d.ts +140 -0
- package/dist/generated/services/gauges.d.ts.map +1 -0
- package/dist/generated/services/gauges.js +207 -0
- package/dist/generated/services/gauges.js.map +1 -0
- package/dist/generated/services/gauges.ts +298 -0
- package/dist/generated/services/hill-charts.d.ts +47 -0
- package/dist/generated/services/hill-charts.d.ts.map +1 -0
- package/dist/generated/services/hill-charts.js +70 -0
- package/dist/generated/services/hill-charts.js.map +1 -0
- package/dist/generated/services/hill-charts.ts +99 -0
- package/dist/generated/services/index.d.ts +5 -0
- package/dist/generated/services/index.d.ts.map +1 -1
- package/dist/generated/services/index.js +5 -0
- package/dist/generated/services/index.js.map +1 -1
- package/dist/generated/services/index.ts +5 -0
- package/dist/generated/services/my-assignments.d.ts +52 -0
- package/dist/generated/services/my-assignments.d.ts.map +1 -0
- package/dist/generated/services/my-assignments.js +74 -0
- package/dist/generated/services/my-assignments.js.map +1 -0
- package/dist/generated/services/my-assignments.ts +109 -0
- package/dist/generated/services/my-notifications.d.ts +50 -0
- package/dist/generated/services/my-notifications.d.ts.map +1 -0
- package/dist/generated/services/my-notifications.js +65 -0
- package/dist/generated/services/my-notifications.js.map +1 -0
- package/dist/generated/services/my-notifications.ts +100 -0
- package/dist/generated/services/people.d.ts +105 -0
- package/dist/generated/services/people.d.ts.map +1 -1
- package/dist/generated/services/people.js +156 -0
- package/dist/generated/services/people.js.map +1 -1
- package/dist/generated/services/people.ts +225 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/services/base.d.ts +19 -1
- package/dist/services/base.d.ts.map +1 -1
- package/dist/services/base.js +110 -1
- package/dist/services/base.js.map +1 -1
- package/package.json +1 -1
- package/src/generated/metadata.json +319 -1
- package/src/generated/openapi-stripped.json +5073 -1916
- package/src/generated/path-mapping.ts +27 -3
- package/src/generated/schema.d.ts +2268 -150
- package/src/generated/services/account.ts +144 -0
- package/src/generated/services/campfires.ts +16 -0
- package/src/generated/services/cards.ts +3 -0
- package/src/generated/services/client-approvals.ts +10 -0
- package/src/generated/services/client-correspondences.ts +10 -0
- package/src/generated/services/forwards.ts +8 -0
- package/src/generated/services/gauges.ts +298 -0
- package/src/generated/services/hill-charts.ts +99 -0
- package/src/generated/services/index.ts +5 -0
- package/src/generated/services/my-assignments.ts +109 -0
- package/src/generated/services/my-notifications.ts +100 -0
- package/src/generated/services/people.ts +225 -0
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Account 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 updateAccountName.
|
|
18
|
+
*/
|
|
19
|
+
export interface UpdateAccountNameAccountRequest {
|
|
20
|
+
/** Display name */
|
|
21
|
+
name: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
// =============================================================================
|
|
26
|
+
// Service
|
|
27
|
+
// =============================================================================
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Service for Account operations.
|
|
31
|
+
*/
|
|
32
|
+
export class AccountService extends BaseService {
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get the account for the current access token
|
|
36
|
+
* @returns The account
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const result = await client.account.account();
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
async account(): Promise<components["schemas"]["GetAccountResponseContent"]> {
|
|
44
|
+
const response = await this.request(
|
|
45
|
+
{
|
|
46
|
+
service: "Account",
|
|
47
|
+
operation: "GetAccount",
|
|
48
|
+
resourceType: "account",
|
|
49
|
+
isMutation: false,
|
|
50
|
+
},
|
|
51
|
+
() =>
|
|
52
|
+
this.client.GET("/account.json", {
|
|
53
|
+
})
|
|
54
|
+
);
|
|
55
|
+
return response;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Upload or replace the account logo.
|
|
60
|
+
* @param file - File or Blob to upload
|
|
61
|
+
* @param filename - Display name for the uploaded file
|
|
62
|
+
* @returns void
|
|
63
|
+
* @throws {BasecampError} If the resource is not found or fields are invalid
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* await client.account.updateAccountLogo();
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
async updateAccountLogo(file: Blob | File, filename?: string): Promise<void> {
|
|
71
|
+
const url = `${this.baseUrl}` +
|
|
72
|
+
`/account/logo.json`;
|
|
73
|
+
return this.requestMultipartUpload(
|
|
74
|
+
{
|
|
75
|
+
service: "Account",
|
|
76
|
+
operation: "UpdateAccountLogo",
|
|
77
|
+
resourceType: "account_logo",
|
|
78
|
+
isMutation: true,
|
|
79
|
+
},
|
|
80
|
+
url,
|
|
81
|
+
"PUT",
|
|
82
|
+
file,
|
|
83
|
+
"logo",
|
|
84
|
+
filename,
|
|
85
|
+
);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Remove the account logo. Only administrators and account owners can use this endpoint.
|
|
91
|
+
* @returns void
|
|
92
|
+
* @throws {BasecampError} If the request fails
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```ts
|
|
96
|
+
* await client.account.removeAccountLogo();
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
async removeAccountLogo(): Promise<void> {
|
|
100
|
+
await this.request(
|
|
101
|
+
{
|
|
102
|
+
service: "Account",
|
|
103
|
+
operation: "RemoveAccountLogo",
|
|
104
|
+
resourceType: "resource",
|
|
105
|
+
isMutation: true,
|
|
106
|
+
},
|
|
107
|
+
() =>
|
|
108
|
+
this.client.DELETE("/account/logo.json", {
|
|
109
|
+
})
|
|
110
|
+
);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* Rename the current account. Only account owners can use this endpoint.
|
|
115
|
+
* @param req - Account_name update parameters
|
|
116
|
+
* @returns The account_name
|
|
117
|
+
* @throws {BasecampError} If the resource is not found or fields are invalid
|
|
118
|
+
*
|
|
119
|
+
* @example
|
|
120
|
+
* ```ts
|
|
121
|
+
* const result = await client.account.updateAccountName({ name: "My example" });
|
|
122
|
+
* ```
|
|
123
|
+
*/
|
|
124
|
+
async updateAccountName(req: UpdateAccountNameAccountRequest): Promise<components["schemas"]["UpdateAccountNameResponseContent"]> {
|
|
125
|
+
if (!req.name) {
|
|
126
|
+
throw Errors.validation("Name is required");
|
|
127
|
+
}
|
|
128
|
+
const response = await this.request(
|
|
129
|
+
{
|
|
130
|
+
service: "Account",
|
|
131
|
+
operation: "UpdateAccountName",
|
|
132
|
+
resourceType: "account_name",
|
|
133
|
+
isMutation: true,
|
|
134
|
+
},
|
|
135
|
+
() =>
|
|
136
|
+
this.client.PUT("/account/name.json", {
|
|
137
|
+
body: {
|
|
138
|
+
name: req.name,
|
|
139
|
+
},
|
|
140
|
+
})
|
|
141
|
+
);
|
|
142
|
+
return response;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
@@ -57,6 +57,10 @@ export interface UpdateChatbotCampfireRequest {
|
|
|
57
57
|
* Options for listLines.
|
|
58
58
|
*/
|
|
59
59
|
export interface ListLinesCampfireOptions extends PaginationOptions {
|
|
60
|
+
/** Filter by sort */
|
|
61
|
+
sort?: "created_at" | "updated_at";
|
|
62
|
+
/** Filter by direction */
|
|
63
|
+
direction?: "asc" | "desc";
|
|
60
64
|
}
|
|
61
65
|
|
|
62
66
|
/**
|
|
@@ -73,6 +77,10 @@ export interface CreateLineCampfireRequest {
|
|
|
73
77
|
* Options for listUploads.
|
|
74
78
|
*/
|
|
75
79
|
export interface ListUploadsCampfireOptions extends PaginationOptions {
|
|
80
|
+
/** Filter by sort */
|
|
81
|
+
sort?: "created_at" | "updated_at";
|
|
82
|
+
/** Filter by direction */
|
|
83
|
+
direction?: "asc" | "desc";
|
|
76
84
|
}
|
|
77
85
|
|
|
78
86
|
|
|
@@ -317,6 +325,9 @@ export class CampfiresService extends BaseService {
|
|
|
317
325
|
* @example
|
|
318
326
|
* ```ts
|
|
319
327
|
* const result = await client.campfires.listLines(123);
|
|
328
|
+
*
|
|
329
|
+
* // With options
|
|
330
|
+
* const filtered = await client.campfires.listLines(123, { sort: "created_at" });
|
|
320
331
|
* ```
|
|
321
332
|
*/
|
|
322
333
|
async listLines(campfireId: number, options?: ListLinesCampfireOptions): Promise<ListResult<CampfireLine>> {
|
|
@@ -332,6 +343,7 @@ export class CampfiresService extends BaseService {
|
|
|
332
343
|
this.client.GET("/chats/{campfireId}/lines.json", {
|
|
333
344
|
params: {
|
|
334
345
|
path: { campfireId },
|
|
346
|
+
query: { sort: options?.sort, direction: options?.direction },
|
|
335
347
|
},
|
|
336
348
|
})
|
|
337
349
|
, options
|
|
@@ -446,6 +458,9 @@ export class CampfiresService extends BaseService {
|
|
|
446
458
|
* @example
|
|
447
459
|
* ```ts
|
|
448
460
|
* const result = await client.campfires.listUploads(123);
|
|
461
|
+
*
|
|
462
|
+
* // With options
|
|
463
|
+
* const filtered = await client.campfires.listUploads(123, { sort: "created_at" });
|
|
449
464
|
* ```
|
|
450
465
|
*/
|
|
451
466
|
async listUploads(campfireId: number, options?: ListUploadsCampfireOptions): Promise<ListResult<CampfireLine>> {
|
|
@@ -461,6 +476,7 @@ export class CampfiresService extends BaseService {
|
|
|
461
476
|
this.client.GET("/chats/{campfireId}/uploads.json", {
|
|
462
477
|
params: {
|
|
463
478
|
path: { campfireId },
|
|
479
|
+
query: { sort: options?.sort, direction: options?.direction },
|
|
464
480
|
},
|
|
465
481
|
})
|
|
466
482
|
, options
|
|
@@ -37,6 +37,8 @@ export interface UpdateCardRequest {
|
|
|
37
37
|
export interface MoveCardRequest {
|
|
38
38
|
/** Column id */
|
|
39
39
|
columnId: number;
|
|
40
|
+
/** 1-indexed position within the destination column. Defaults to 1 (top). */
|
|
41
|
+
position?: number;
|
|
40
42
|
}
|
|
41
43
|
|
|
42
44
|
/**
|
|
@@ -167,6 +169,7 @@ export class CardsService extends BaseService {
|
|
|
167
169
|
},
|
|
168
170
|
body: {
|
|
169
171
|
column_id: req.columnId,
|
|
172
|
+
position: req.position,
|
|
170
173
|
},
|
|
171
174
|
})
|
|
172
175
|
);
|
|
@@ -20,6 +20,10 @@ export type ClientApproval = components["schemas"]["ClientApproval"];
|
|
|
20
20
|
* Options for list.
|
|
21
21
|
*/
|
|
22
22
|
export interface ListClientApprovalOptions extends PaginationOptions {
|
|
23
|
+
/** Filter by sort */
|
|
24
|
+
sort?: "created_at" | "updated_at";
|
|
25
|
+
/** Filter by direction */
|
|
26
|
+
direction?: "asc" | "desc";
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
|
|
@@ -40,6 +44,9 @@ export class ClientApprovalsService extends BaseService {
|
|
|
40
44
|
* @example
|
|
41
45
|
* ```ts
|
|
42
46
|
* const result = await client.clientApprovals.list();
|
|
47
|
+
*
|
|
48
|
+
* // With options
|
|
49
|
+
* const filtered = await client.clientApprovals.list({ sort: "created_at" });
|
|
43
50
|
* ```
|
|
44
51
|
*/
|
|
45
52
|
async list(options?: ListClientApprovalOptions): Promise<ListResult<ClientApproval>> {
|
|
@@ -52,6 +59,9 @@ export class ClientApprovalsService extends BaseService {
|
|
|
52
59
|
},
|
|
53
60
|
() =>
|
|
54
61
|
this.client.GET("/client/approvals.json", {
|
|
62
|
+
params: {
|
|
63
|
+
query: { sort: options?.sort, direction: options?.direction },
|
|
64
|
+
},
|
|
55
65
|
})
|
|
56
66
|
, options
|
|
57
67
|
);
|
|
@@ -20,6 +20,10 @@ export type ClientCorrespondence = components["schemas"]["ClientCorrespondence"]
|
|
|
20
20
|
* Options for list.
|
|
21
21
|
*/
|
|
22
22
|
export interface ListClientCorrespondenceOptions extends PaginationOptions {
|
|
23
|
+
/** Filter by sort */
|
|
24
|
+
sort?: "created_at" | "updated_at";
|
|
25
|
+
/** Filter by direction */
|
|
26
|
+
direction?: "asc" | "desc";
|
|
23
27
|
}
|
|
24
28
|
|
|
25
29
|
|
|
@@ -40,6 +44,9 @@ export class ClientCorrespondencesService extends BaseService {
|
|
|
40
44
|
* @example
|
|
41
45
|
* ```ts
|
|
42
46
|
* const result = await client.clientCorrespondences.list();
|
|
47
|
+
*
|
|
48
|
+
* // With options
|
|
49
|
+
* const filtered = await client.clientCorrespondences.list({ sort: "created_at" });
|
|
43
50
|
* ```
|
|
44
51
|
*/
|
|
45
52
|
async list(options?: ListClientCorrespondenceOptions): Promise<ListResult<ClientCorrespondence>> {
|
|
@@ -52,6 +59,9 @@ export class ClientCorrespondencesService extends BaseService {
|
|
|
52
59
|
},
|
|
53
60
|
() =>
|
|
54
61
|
this.client.GET("/client/correspondences.json", {
|
|
62
|
+
params: {
|
|
63
|
+
query: { sort: options?.sort, direction: options?.direction },
|
|
64
|
+
},
|
|
55
65
|
})
|
|
56
66
|
, options
|
|
57
67
|
);
|
|
@@ -39,6 +39,10 @@ export interface CreateReplyForwardRequest {
|
|
|
39
39
|
* Options for list.
|
|
40
40
|
*/
|
|
41
41
|
export interface ListForwardOptions extends PaginationOptions {
|
|
42
|
+
/** Filter by sort */
|
|
43
|
+
sort?: "created_at" | "updated_at";
|
|
44
|
+
/** Filter by direction */
|
|
45
|
+
direction?: "asc" | "desc";
|
|
42
46
|
}
|
|
43
47
|
|
|
44
48
|
|
|
@@ -218,6 +222,9 @@ export class ForwardsService extends BaseService {
|
|
|
218
222
|
* @example
|
|
219
223
|
* ```ts
|
|
220
224
|
* const result = await client.forwards.list(123);
|
|
225
|
+
*
|
|
226
|
+
* // With options
|
|
227
|
+
* const filtered = await client.forwards.list(123, { sort: "created_at" });
|
|
221
228
|
* ```
|
|
222
229
|
*/
|
|
223
230
|
async list(inboxId: number, options?: ListForwardOptions): Promise<ListResult<Forward>> {
|
|
@@ -233,6 +240,7 @@ export class ForwardsService extends BaseService {
|
|
|
233
240
|
this.client.GET("/inboxes/{inboxId}/forwards.json", {
|
|
234
241
|
params: {
|
|
235
242
|
path: { inboxId },
|
|
243
|
+
query: { sort: options?.sort, direction: options?.direction },
|
|
236
244
|
},
|
|
237
245
|
})
|
|
238
246
|
, options
|
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gauges 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
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Request parameters for updateGaugeNeedle.
|
|
20
|
+
*/
|
|
21
|
+
export interface UpdateGaugeNeedleGaugeRequest {
|
|
22
|
+
/** Gauge needle */
|
|
23
|
+
gaugeNeedle?: components["schemas"]["GaugeNeedleUpdatePayload"];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Request parameters for toggleGauge.
|
|
28
|
+
*/
|
|
29
|
+
export interface ToggleGaugeGaugeRequest {
|
|
30
|
+
/** Gauge */
|
|
31
|
+
gauge: components["schemas"]["GaugeTogglePayload"];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Options for listGaugeNeedles.
|
|
36
|
+
*/
|
|
37
|
+
export interface ListGaugeNeedlesGaugeOptions extends PaginationOptions {
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Request parameters for createGaugeNeedle.
|
|
42
|
+
*/
|
|
43
|
+
export interface CreateGaugeNeedleGaugeRequest {
|
|
44
|
+
/** Gauge needle */
|
|
45
|
+
gaugeNeedle: components["schemas"]["GaugeNeedlePayload"];
|
|
46
|
+
/** Who to notify: "everyone", "working_on", "custom", or omit for nobody */
|
|
47
|
+
notify?: string;
|
|
48
|
+
/** Array of people IDs to notify (only used when notify is "custom") */
|
|
49
|
+
subscriptions?: number[];
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Options for listGauges.
|
|
54
|
+
*/
|
|
55
|
+
export interface ListGaugesGaugeOptions extends PaginationOptions {
|
|
56
|
+
/** Comma-separated list of project IDs. When provided, results are returned
|
|
57
|
+
in the order specified instead of by risk level. */
|
|
58
|
+
bucketIds?: string;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
// =============================================================================
|
|
63
|
+
// Service
|
|
64
|
+
// =============================================================================
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Service for Gauges operations.
|
|
68
|
+
*/
|
|
69
|
+
export class GaugesService extends BaseService {
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* Get a gauge needle by ID
|
|
73
|
+
* @param needleId - The needle ID
|
|
74
|
+
* @returns The gauge_needle
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const result = await client.gauges.gaugeNeedle(123);
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
async gaugeNeedle(needleId: number): Promise<components["schemas"]["GetGaugeNeedleResponseContent"]> {
|
|
82
|
+
const response = await this.request(
|
|
83
|
+
{
|
|
84
|
+
service: "Gauges",
|
|
85
|
+
operation: "GetGaugeNeedle",
|
|
86
|
+
resourceType: "gauge_needle",
|
|
87
|
+
isMutation: false,
|
|
88
|
+
resourceId: needleId,
|
|
89
|
+
},
|
|
90
|
+
() =>
|
|
91
|
+
this.client.GET("/gauge_needles/{needleId}", {
|
|
92
|
+
params: {
|
|
93
|
+
path: { needleId },
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
);
|
|
97
|
+
return response;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Update a gauge needle's description. Position and color are immutable.
|
|
102
|
+
* @param needleId - The needle ID
|
|
103
|
+
* @param req - Gauge_needle update parameters
|
|
104
|
+
* @returns The gauge_needle
|
|
105
|
+
* @throws {BasecampError} If the resource is not found or fields are invalid
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* const result = await client.gauges.updateGaugeNeedle(123, { });
|
|
110
|
+
* ```
|
|
111
|
+
*/
|
|
112
|
+
async updateGaugeNeedle(needleId: number, req: UpdateGaugeNeedleGaugeRequest): Promise<components["schemas"]["UpdateGaugeNeedleResponseContent"]> {
|
|
113
|
+
const response = await this.request(
|
|
114
|
+
{
|
|
115
|
+
service: "Gauges",
|
|
116
|
+
operation: "UpdateGaugeNeedle",
|
|
117
|
+
resourceType: "gauge_needle",
|
|
118
|
+
isMutation: true,
|
|
119
|
+
resourceId: needleId,
|
|
120
|
+
},
|
|
121
|
+
() =>
|
|
122
|
+
this.client.PUT("/gauge_needles/{needleId}", {
|
|
123
|
+
params: {
|
|
124
|
+
path: { needleId },
|
|
125
|
+
},
|
|
126
|
+
body: {
|
|
127
|
+
gauge_needle: req.gaugeNeedle,
|
|
128
|
+
},
|
|
129
|
+
})
|
|
130
|
+
);
|
|
131
|
+
return response;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Destroy a gauge needle
|
|
136
|
+
* @param needleId - The needle ID
|
|
137
|
+
* @returns void
|
|
138
|
+
* @throws {BasecampError} If the request fails
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* await client.gauges.destroyGaugeNeedle(123);
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
async destroyGaugeNeedle(needleId: number): Promise<void> {
|
|
146
|
+
await this.request(
|
|
147
|
+
{
|
|
148
|
+
service: "Gauges",
|
|
149
|
+
operation: "DestroyGaugeNeedle",
|
|
150
|
+
resourceType: "resource",
|
|
151
|
+
isMutation: true,
|
|
152
|
+
resourceId: needleId,
|
|
153
|
+
},
|
|
154
|
+
() =>
|
|
155
|
+
this.client.DELETE("/gauge_needles/{needleId}", {
|
|
156
|
+
params: {
|
|
157
|
+
path: { needleId },
|
|
158
|
+
},
|
|
159
|
+
})
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/**
|
|
164
|
+
* Enable or disable the gauge for a project. Only project admins can toggle gauges.
|
|
165
|
+
* @param projectId - The project ID
|
|
166
|
+
* @param req - Resource request parameters
|
|
167
|
+
* @returns void
|
|
168
|
+
* @throws {BasecampError} If the request fails
|
|
169
|
+
*
|
|
170
|
+
* @example
|
|
171
|
+
* ```ts
|
|
172
|
+
* await client.gauges.toggleGauge(123, { gauge: "example" });
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
175
|
+
async toggleGauge(projectId: number, req: ToggleGaugeGaugeRequest): Promise<void> {
|
|
176
|
+
if (!req.gauge) {
|
|
177
|
+
throw Errors.validation("Gauge is required");
|
|
178
|
+
}
|
|
179
|
+
await this.request(
|
|
180
|
+
{
|
|
181
|
+
service: "Gauges",
|
|
182
|
+
operation: "ToggleGauge",
|
|
183
|
+
resourceType: "resource",
|
|
184
|
+
isMutation: true,
|
|
185
|
+
projectId,
|
|
186
|
+
},
|
|
187
|
+
() =>
|
|
188
|
+
this.client.PUT("/projects/{projectId}/gauge.json", {
|
|
189
|
+
params: {
|
|
190
|
+
path: { projectId },
|
|
191
|
+
},
|
|
192
|
+
body: {
|
|
193
|
+
gauge: req.gauge,
|
|
194
|
+
},
|
|
195
|
+
})
|
|
196
|
+
);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* List gauge needles for a project, ordered newest first.
|
|
201
|
+
* @param projectId - The project ID
|
|
202
|
+
* @param options - Optional query parameters
|
|
203
|
+
* @returns All results across all pages, with .meta.totalCount
|
|
204
|
+
*
|
|
205
|
+
* @example
|
|
206
|
+
* ```ts
|
|
207
|
+
* const result = await client.gauges.listGaugeNeedles(123);
|
|
208
|
+
* ```
|
|
209
|
+
*/
|
|
210
|
+
async listGaugeNeedles(projectId: number, options?: ListGaugeNeedlesGaugeOptions): Promise<components["schemas"]["ListGaugeNeedlesResponseContent"]> {
|
|
211
|
+
return this.requestPaginated(
|
|
212
|
+
{
|
|
213
|
+
service: "Gauges",
|
|
214
|
+
operation: "ListGaugeNeedles",
|
|
215
|
+
resourceType: "gauge_needle",
|
|
216
|
+
isMutation: false,
|
|
217
|
+
projectId,
|
|
218
|
+
},
|
|
219
|
+
() =>
|
|
220
|
+
this.client.GET("/projects/{projectId}/gauge/needles.json", {
|
|
221
|
+
params: {
|
|
222
|
+
path: { projectId },
|
|
223
|
+
},
|
|
224
|
+
})
|
|
225
|
+
, options
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Create a gauge needle (progress update) for a project
|
|
231
|
+
* @param projectId - The project ID
|
|
232
|
+
* @param req - Gauge_needle creation parameters
|
|
233
|
+
* @returns The gauge_needle
|
|
234
|
+
* @throws {BasecampError} If required fields are missing or invalid
|
|
235
|
+
*
|
|
236
|
+
* @example
|
|
237
|
+
* ```ts
|
|
238
|
+
* const result = await client.gauges.createGaugeNeedle(123, { gaugeNeedle: "example" });
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
async createGaugeNeedle(projectId: number, req: CreateGaugeNeedleGaugeRequest): Promise<components["schemas"]["CreateGaugeNeedleResponseContent"]> {
|
|
242
|
+
if (!req.gaugeNeedle) {
|
|
243
|
+
throw Errors.validation("Gauge needle is required");
|
|
244
|
+
}
|
|
245
|
+
const response = await this.request(
|
|
246
|
+
{
|
|
247
|
+
service: "Gauges",
|
|
248
|
+
operation: "CreateGaugeNeedle",
|
|
249
|
+
resourceType: "gauge_needle",
|
|
250
|
+
isMutation: true,
|
|
251
|
+
projectId,
|
|
252
|
+
},
|
|
253
|
+
() =>
|
|
254
|
+
this.client.POST("/projects/{projectId}/gauge/needles.json", {
|
|
255
|
+
params: {
|
|
256
|
+
path: { projectId },
|
|
257
|
+
},
|
|
258
|
+
body: {
|
|
259
|
+
gauge_needle: req.gaugeNeedle,
|
|
260
|
+
notify: req.notify,
|
|
261
|
+
subscriptions: req.subscriptions,
|
|
262
|
+
},
|
|
263
|
+
})
|
|
264
|
+
);
|
|
265
|
+
return response;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* List gauges across all projects the authenticated user has access to.
|
|
270
|
+
* @param options - Optional query parameters
|
|
271
|
+
* @returns All results across all pages, with .meta.totalCount
|
|
272
|
+
*
|
|
273
|
+
* @example
|
|
274
|
+
* ```ts
|
|
275
|
+
* const result = await client.gauges.listGauges();
|
|
276
|
+
*
|
|
277
|
+
* // With options
|
|
278
|
+
* const filtered = await client.gauges.listGauges({ bucketIds: "example" });
|
|
279
|
+
* ```
|
|
280
|
+
*/
|
|
281
|
+
async listGauges(options?: ListGaugesGaugeOptions): Promise<components["schemas"]["ListGaugesResponseContent"]> {
|
|
282
|
+
return this.requestPaginated(
|
|
283
|
+
{
|
|
284
|
+
service: "Gauges",
|
|
285
|
+
operation: "ListGauges",
|
|
286
|
+
resourceType: "gauge",
|
|
287
|
+
isMutation: false,
|
|
288
|
+
},
|
|
289
|
+
() =>
|
|
290
|
+
this.client.GET("/reports/gauges.json", {
|
|
291
|
+
params: {
|
|
292
|
+
query: { "bucket_ids": options?.bucketIds },
|
|
293
|
+
},
|
|
294
|
+
})
|
|
295
|
+
, options
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HillCharts 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 updateSettings.
|
|
17
|
+
*/
|
|
18
|
+
export interface UpdateSettingsHillChartRequest {
|
|
19
|
+
/** Tracked */
|
|
20
|
+
tracked?: number[];
|
|
21
|
+
/** Untracked */
|
|
22
|
+
untracked?: number[];
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
// =============================================================================
|
|
27
|
+
// Service
|
|
28
|
+
// =============================================================================
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Service for HillCharts operations.
|
|
32
|
+
*/
|
|
33
|
+
export class HillChartsService extends BaseService {
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* Get the hill chart for a todoset
|
|
37
|
+
* @param todosetId - The todoset ID
|
|
38
|
+
* @returns The hill_chart
|
|
39
|
+
* @throws {BasecampError} If the resource is not found
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const result = await client.hillCharts.get(123);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
async get(todosetId: number): Promise<components["schemas"]["GetHillChartResponseContent"]> {
|
|
47
|
+
const response = await this.request(
|
|
48
|
+
{
|
|
49
|
+
service: "HillCharts",
|
|
50
|
+
operation: "GetHillChart",
|
|
51
|
+
resourceType: "hill_chart",
|
|
52
|
+
isMutation: false,
|
|
53
|
+
resourceId: todosetId,
|
|
54
|
+
},
|
|
55
|
+
() =>
|
|
56
|
+
this.client.GET("/todosets/{todosetId}/hill.json", {
|
|
57
|
+
params: {
|
|
58
|
+
path: { todosetId },
|
|
59
|
+
},
|
|
60
|
+
})
|
|
61
|
+
);
|
|
62
|
+
return response;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Track or untrack todolists on a hill chart
|
|
67
|
+
* @param todosetId - The todoset ID
|
|
68
|
+
* @param req - Hill_chart update parameters
|
|
69
|
+
* @returns The hill_chart
|
|
70
|
+
* @throws {BasecampError} If the resource is not found or fields are invalid
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* const result = await client.hillCharts.updateSettings(123, { });
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
async updateSettings(todosetId: number, req: UpdateSettingsHillChartRequest): Promise<components["schemas"]["UpdateHillChartSettingsResponseContent"]> {
|
|
78
|
+
const response = await this.request(
|
|
79
|
+
{
|
|
80
|
+
service: "HillCharts",
|
|
81
|
+
operation: "UpdateHillChartSettings",
|
|
82
|
+
resourceType: "hill_chart",
|
|
83
|
+
isMutation: true,
|
|
84
|
+
resourceId: todosetId,
|
|
85
|
+
},
|
|
86
|
+
() =>
|
|
87
|
+
this.client.PUT("/todosets/{todosetId}/hills/settings.json", {
|
|
88
|
+
params: {
|
|
89
|
+
path: { todosetId },
|
|
90
|
+
},
|
|
91
|
+
body: {
|
|
92
|
+
tracked: req.tracked,
|
|
93
|
+
untracked: req.untracked,
|
|
94
|
+
},
|
|
95
|
+
})
|
|
96
|
+
);
|
|
97
|
+
return response;
|
|
98
|
+
}
|
|
99
|
+
}
|