@37signals/basecamp 0.25.0 → 0.27.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 (67) hide show
  1. package/README.md +2 -0
  2. package/dist/client.d.ts +7 -2
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +7 -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 +72 -1
  8. package/dist/generated/metadata.js.map +1 -1
  9. package/dist/generated/metadata.ts +72 -1
  10. package/dist/generated/openapi-stripped.json +766 -20
  11. package/dist/generated/path-mapping.d.ts.map +1 -1
  12. package/dist/generated/path-mapping.js +6 -0
  13. package/dist/generated/path-mapping.js.map +1 -1
  14. package/dist/generated/path-mapping.ts +6 -0
  15. package/dist/generated/person-id-sites.d.ts.map +1 -1
  16. package/dist/generated/person-id-sites.js +12 -0
  17. package/dist/generated/person-id-sites.js.map +1 -1
  18. package/dist/generated/person-id-sites.ts +12 -0
  19. package/dist/generated/schema.d.ts +707 -40
  20. package/dist/generated/services/boosts.d.ts +20 -0
  21. package/dist/generated/services/boosts.d.ts.map +1 -1
  22. package/dist/generated/services/boosts.js +32 -0
  23. package/dist/generated/services/boosts.js.map +1 -1
  24. package/dist/generated/services/boosts.ts +45 -0
  25. package/dist/generated/services/cards.d.ts +3 -2
  26. package/dist/generated/services/cards.d.ts.map +1 -1
  27. package/dist/generated/services/cards.js +1 -1
  28. package/dist/generated/services/cards.js.map +1 -1
  29. package/dist/generated/services/cards.ts +3 -2
  30. package/dist/generated/services/embeds.d.ts +44 -0
  31. package/dist/generated/services/embeds.d.ts.map +1 -0
  32. package/dist/generated/services/embeds.js +67 -0
  33. package/dist/generated/services/embeds.js.map +1 -0
  34. package/dist/generated/services/embeds.ts +94 -0
  35. package/dist/generated/services/index.d.ts +2 -0
  36. package/dist/generated/services/index.d.ts.map +1 -1
  37. package/dist/generated/services/index.js +2 -0
  38. package/dist/generated/services/index.js.map +1 -1
  39. package/dist/generated/services/index.ts +2 -0
  40. package/dist/generated/services/pings.d.ts +59 -0
  41. package/dist/generated/services/pings.d.ts.map +1 -0
  42. package/dist/generated/services/pings.js +89 -0
  43. package/dist/generated/services/pings.js.map +1 -0
  44. package/dist/generated/services/pings.ts +125 -0
  45. package/dist/generated/services/wormholes.d.ts +3 -3
  46. package/dist/generated/services/wormholes.js +3 -3
  47. package/dist/generated/services/wormholes.ts +3 -3
  48. package/dist/index.d.ts +3 -1
  49. package/dist/index.d.ts.map +1 -1
  50. package/dist/index.js +3 -0
  51. package/dist/index.js.map +1 -1
  52. package/dist/services/recordings-extensions.d.ts +8 -7
  53. package/dist/services/recordings-extensions.d.ts.map +1 -1
  54. package/dist/services/recordings-extensions.js +63 -18
  55. package/dist/services/recordings-extensions.js.map +1 -1
  56. package/package.json +1 -1
  57. package/src/generated/metadata.ts +72 -1
  58. package/src/generated/openapi-stripped.json +766 -20
  59. package/src/generated/path-mapping.ts +6 -0
  60. package/src/generated/person-id-sites.ts +12 -0
  61. package/src/generated/schema.d.ts +707 -40
  62. package/src/generated/services/boosts.ts +45 -0
  63. package/src/generated/services/cards.ts +3 -2
  64. package/src/generated/services/embeds.ts +94 -0
  65. package/src/generated/services/index.ts +2 -0
  66. package/src/generated/services/pings.ts +125 -0
  67. 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
@@ -35,7 +35,8 @@ export interface UpdateVerbatimCardRequest {
35
35
  * Request parameters for move.
36
36
  */
37
37
  export interface MoveCardRequest {
38
- /** Column id */
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 different column
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
@@ -0,0 +1,94 @@
1
+ /**
2
+ * Embeds 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 CreateEmbedRequest {
20
+ /** The URL of the content to embed. */
21
+ url: string;
22
+ }
23
+
24
+
25
+ // =============================================================================
26
+ // Service
27
+ // =============================================================================
28
+
29
+ /**
30
+ * Service for Embeds operations.
31
+ */
32
+ export class EmbedsService extends BaseService {
33
+
34
+ /**
35
+ * Create an embed for a URL, or return the one Basecamp already has for it.
36
+ * @param req - Embed creation parameters
37
+ * @returns The embed
38
+ * @throws {BasecampError} If required fields are missing or invalid
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const result = await client.embeds.create({ url: "example" });
43
+ * ```
44
+ */
45
+ async create(req: CreateEmbedRequest): Promise<components["schemas"]["CreateEmbedResponseContent"]> {
46
+ if (!req.url) {
47
+ throw Errors.validation("Url is required");
48
+ }
49
+ const response = await this.request(
50
+ {
51
+ service: "Embeds",
52
+ operation: "CreateEmbed",
53
+ resourceType: "embed",
54
+ isMutation: true,
55
+ },
56
+ () =>
57
+ this.client.POST("/embeds.json", {
58
+ body: {
59
+ url: req.url,
60
+ },
61
+ })
62
+ );
63
+ return response;
64
+ }
65
+
66
+ /**
67
+ * Get an embed by its sgid.
68
+ * @param sgid - An embed's signed global id, an opaque string.
69
+ * @returns The embed
70
+ * @throws {BasecampError} If the resource is not found
71
+ *
72
+ * @example
73
+ * ```ts
74
+ * const result = await client.embeds.get("example");
75
+ * ```
76
+ */
77
+ async get(sgid: string): Promise<components["schemas"]["GetEmbedResponseContent"]> {
78
+ const response = await this.request(
79
+ {
80
+ service: "Embeds",
81
+ operation: "GetEmbed",
82
+ resourceType: "embed",
83
+ isMutation: false,
84
+ },
85
+ () =>
86
+ this.client.GET("/embeds/{sgid}", {
87
+ params: {
88
+ path: { sgid },
89
+ },
90
+ })
91
+ );
92
+ return response;
93
+ }
94
+ }
@@ -19,9 +19,11 @@ 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";
26
+ export { EmbedsService } from "./embeds.js";
25
27
  export { EventFeedService } from "./event-feed.js";
26
28
  export { GaugesService } from "./gauges.js";
27
29
  export { ForwardsService } from "./forwards.js";
@@ -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
- * Update a wormhole's destination column
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
- * Delete a wormhole
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
- * Create a wormhole linking this card table to a column on another card table.
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