@37signals/basecamp 0.25.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.
Files changed (61) hide show
  1. package/README.md +1 -0
  2. package/dist/client.d.ts +5 -2
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +5 -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 +48 -1
  8. package/dist/generated/metadata.js.map +1 -1
  9. package/dist/generated/metadata.ts +48 -1
  10. package/dist/generated/openapi-stripped.json +500 -6
  11. package/dist/generated/path-mapping.d.ts.map +1 -1
  12. package/dist/generated/path-mapping.js +4 -0
  13. package/dist/generated/path-mapping.js.map +1 -1
  14. package/dist/generated/path-mapping.ts +4 -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 +439 -9
  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/index.d.ts +1 -0
  31. package/dist/generated/services/index.d.ts.map +1 -1
  32. package/dist/generated/services/index.js +1 -0
  33. package/dist/generated/services/index.js.map +1 -1
  34. package/dist/generated/services/index.ts +1 -0
  35. package/dist/generated/services/pings.d.ts +59 -0
  36. package/dist/generated/services/pings.d.ts.map +1 -0
  37. package/dist/generated/services/pings.js +89 -0
  38. package/dist/generated/services/pings.js.map +1 -0
  39. package/dist/generated/services/pings.ts +125 -0
  40. package/dist/generated/services/wormholes.d.ts +3 -3
  41. package/dist/generated/services/wormholes.js +3 -3
  42. package/dist/generated/services/wormholes.ts +3 -3
  43. package/dist/index.d.ts +2 -1
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +2 -0
  46. package/dist/index.js.map +1 -1
  47. package/dist/services/recordings-extensions.d.ts +8 -7
  48. package/dist/services/recordings-extensions.d.ts.map +1 -1
  49. package/dist/services/recordings-extensions.js +63 -18
  50. package/dist/services/recordings-extensions.js.map +1 -1
  51. package/package.json +1 -1
  52. package/src/generated/metadata.ts +48 -1
  53. package/src/generated/openapi-stripped.json +500 -6
  54. package/src/generated/path-mapping.ts +4 -0
  55. package/src/generated/person-id-sites.ts +12 -0
  56. package/src/generated/schema.d.ts +439 -9
  57. package/src/generated/services/boosts.ts +45 -0
  58. package/src/generated/services/cards.ts +3 -2
  59. package/src/generated/services/index.ts +1 -0
  60. package/src/generated/services/pings.ts +125 -0
  61. package/src/generated/services/wormholes.ts +3 -3
@@ -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