@37signals/basecamp 0.18.0 → 0.20.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 (94) hide show
  1. package/README.md +94 -2
  2. package/dist/client.d.ts +6 -6
  3. package/dist/client.d.ts.map +1 -1
  4. package/dist/client.js +11 -7
  5. package/dist/client.js.map +1 -1
  6. package/dist/download.js +1 -1
  7. package/dist/errors.d.ts +10 -1
  8. package/dist/errors.d.ts.map +1 -1
  9. package/dist/errors.js +42 -13
  10. package/dist/errors.js.map +1 -1
  11. package/dist/generated/metadata.d.ts +1 -2
  12. package/dist/generated/metadata.d.ts.map +1 -1
  13. package/dist/generated/metadata.js +47 -1
  14. package/dist/generated/metadata.js.map +1 -1
  15. package/dist/generated/metadata.ts +48 -3
  16. package/dist/generated/openapi-stripped.json +816 -60
  17. package/dist/generated/path-mapping.d.ts.map +1 -1
  18. package/dist/generated/path-mapping.js +7 -4
  19. package/dist/generated/path-mapping.js.map +1 -1
  20. package/dist/generated/path-mapping.ts +8 -5
  21. package/dist/generated/person-id-sites.d.ts +2 -0
  22. package/dist/generated/person-id-sites.d.ts.map +1 -0
  23. package/dist/generated/person-id-sites.js +689 -0
  24. package/dist/generated/person-id-sites.js.map +1 -0
  25. package/dist/generated/person-id-sites.ts +690 -0
  26. package/dist/generated/schema.d.ts +643 -12
  27. package/dist/generated/services/event-feed.d.ts +92 -0
  28. package/dist/generated/services/event-feed.d.ts.map +1 -0
  29. package/dist/generated/services/event-feed.js +80 -0
  30. package/dist/generated/services/event-feed.js.map +1 -0
  31. package/dist/generated/services/event-feed.ts +153 -0
  32. package/dist/generated/services/gauges.d.ts +7 -3
  33. package/dist/generated/services/gauges.d.ts.map +1 -1
  34. package/dist/generated/services/gauges.js +4 -1
  35. package/dist/generated/services/gauges.js.map +1 -1
  36. package/dist/generated/services/gauges.ts +10 -3
  37. package/dist/generated/services/index.d.ts +1 -1
  38. package/dist/generated/services/index.d.ts.map +1 -1
  39. package/dist/generated/services/index.js +1 -1
  40. package/dist/generated/services/index.js.map +1 -1
  41. package/dist/generated/services/index.ts +1 -1
  42. package/dist/generated/services/lineup.d.ts +13 -0
  43. package/dist/generated/services/lineup.d.ts.map +1 -1
  44. package/dist/generated/services/lineup.js +18 -0
  45. package/dist/generated/services/lineup.js.map +1 -1
  46. package/dist/generated/services/lineup.ts +26 -0
  47. package/dist/index.d.ts +7 -4
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +12 -6
  50. package/dist/index.js.map +1 -1
  51. package/dist/person-id.d.ts +133 -0
  52. package/dist/person-id.d.ts.map +1 -0
  53. package/dist/person-id.js +163 -0
  54. package/dist/person-id.js.map +1 -0
  55. package/dist/retry.d.ts +2 -1
  56. package/dist/retry.d.ts.map +1 -1
  57. package/dist/retry.js +21 -11
  58. package/dist/retry.js.map +1 -1
  59. package/dist/services/base.d.ts +35 -0
  60. package/dist/services/base.d.ts.map +1 -1
  61. package/dist/services/base.js +387 -55
  62. package/dist/services/base.js.map +1 -1
  63. package/dist/services/comments-extensions.d.ts +89 -0
  64. package/dist/services/comments-extensions.d.ts.map +1 -0
  65. package/dist/services/comments-extensions.js +166 -0
  66. package/dist/services/comments-extensions.js.map +1 -0
  67. package/dist/services/mentions.d.ts +255 -0
  68. package/dist/services/mentions.d.ts.map +1 -0
  69. package/dist/services/mentions.js +1431 -0
  70. package/dist/services/mentions.js.map +1 -0
  71. package/dist/services/merge-safe.d.ts +13 -5
  72. package/dist/services/merge-safe.d.ts.map +1 -1
  73. package/dist/services/merge-safe.js +71 -13
  74. package/dist/services/merge-safe.js.map +1 -1
  75. package/dist/services/recordings-extensions.d.ts +354 -0
  76. package/dist/services/recordings-extensions.d.ts.map +1 -0
  77. package/dist/services/recordings-extensions.js +1940 -0
  78. package/dist/services/recordings-extensions.js.map +1 -0
  79. package/package.json +4 -4
  80. package/src/generated/metadata.ts +48 -3
  81. package/src/generated/openapi-stripped.json +816 -60
  82. package/src/generated/path-mapping.ts +8 -5
  83. package/src/generated/person-id-sites.ts +690 -0
  84. package/src/generated/schema.d.ts +643 -12
  85. package/src/generated/services/event-feed.ts +153 -0
  86. package/src/generated/services/gauges.ts +10 -3
  87. package/src/generated/services/index.ts +1 -1
  88. package/src/generated/services/lineup.ts +26 -0
  89. package/dist/generated/services/automation.d.ts +0 -25
  90. package/dist/generated/services/automation.d.ts.map +0 -1
  91. package/dist/generated/services/automation.js +0 -33
  92. package/dist/generated/services/automation.js.map +0 -1
  93. package/dist/generated/services/automation.ts +0 -49
  94. package/src/generated/services/automation.ts +0 -49
@@ -0,0 +1,153 @@
1
+ /**
2
+ * EventFeed 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
+ * Options for pollEvents.
17
+ */
18
+ export interface PollEventsEventFeedOptions {
19
+ /** Entry point: a decimal event id (start after it; `0` replays served
20
+ history back to the epoch), or the literal `now` (skip history). Mutually
21
+ exclusive with `position` in practice; omit both to enter at the present. */
22
+ since?: string;
23
+ /** Resume token from a previous page's `position`. Opaque and signed; never
24
+ constructed or parsed client-side. */
25
+ position?: string;
26
+ /** Comma-separated event types from the catalog (e.g. `message.created,comment.created`). */
27
+ types?: string;
28
+ /** Comma-separated bucket (project) ids, at most 100. */
29
+ buckets?: string;
30
+ /** Comma-separated creator person ids, at most 100. */
31
+ creators?: string;
32
+ /** Comma-separated effective-performer ids (the agent on a delegated action,
33
+ else the creator), at most 100. The literal `self` means the request's own
34
+ effective actor and is resolved server-side before filtering. */
35
+ performers?: string;
36
+ /** Comma-separated effective-performer ids to exclude, at most 100; `self`
37
+ as on `performers`. `exclude_performers=self` is the loop guard for an
38
+ agent that acts on what it hears. */
39
+ excludePerformers?: string;
40
+ /** Comma-separated actor kinds: `agent`, `person`, or both. A filter, not a
41
+ default — agent activity is real account activity. */
42
+ actorTypes?: string;
43
+ }
44
+
45
+ /**
46
+ * Options for pollInbox.
47
+ */
48
+ export interface PollInboxEventFeedOptions {
49
+ /** Entry point: `0` (earliest retained), `now` (present), or a decimal item
50
+ id to start after. */
51
+ since?: string;
52
+ /** Resume token from a previous inbox page's `position`. */
53
+ position?: string;
54
+ /** Comma-separated addressing reasons: `mentioned`, `assigned`, `subscribed`,
55
+ `watched`, `pinged`, `boosted`. */
56
+ reasons?: string;
57
+ /** Comma-separated event types, as a narrowing filter. */
58
+ types?: string;
59
+ /** Comma-separated bucket ids, as a narrowing filter (at most 100). */
60
+ buckets?: string;
61
+ }
62
+
63
+
64
+ // =============================================================================
65
+ // Service
66
+ // =============================================================================
67
+
68
+ /**
69
+ * Service for EventFeed operations.
70
+ */
71
+ export class EventFeedService extends BaseService {
72
+
73
+ /**
74
+ * Poll the account event feed for events after a position (oldest first, strict event-id order, up to 100 per page).
75
+ * @param options - Optional query parameters
76
+ * @returns The feed_event
77
+ *
78
+ * @example
79
+ * ```ts
80
+ * const result = await client.eventFeed.pollEvents();
81
+ * ```
82
+ */
83
+ async pollEvents(options?: PollEventsEventFeedOptions): Promise<components["schemas"]["PollEventsResponseContent"]> {
84
+ const response = await this.request(
85
+ {
86
+ service: "EventFeed",
87
+ operation: "PollEvents",
88
+ resourceType: "feed_event",
89
+ isMutation: false,
90
+ },
91
+ () =>
92
+ this.client.GET("/events.json", {
93
+ params: {
94
+ query: { since: options?.since, position: options?.position, types: options?.types, buckets: options?.buckets, creators: options?.creators, performers: options?.performers, "exclude_performers": options?.excludePerformers, "actor_types": options?.actorTypes },
95
+ },
96
+ })
97
+ );
98
+ return response;
99
+ }
100
+
101
+ /**
102
+ * Mint a short-lived stream ticket and the exact WebSocket URL to open a live event stream with.
103
+ * @returns The stream_ticket
104
+ * @throws {BasecampError} If required fields are missing or invalid
105
+ *
106
+ * @example
107
+ * ```ts
108
+ * const result = await client.eventFeed.createStreamTicket();
109
+ * ```
110
+ */
111
+ async createStreamTicket(): Promise<components["schemas"]["CreateStreamTicketResponseContent"]> {
112
+ const response = await this.request(
113
+ {
114
+ service: "EventFeed",
115
+ operation: "CreateStreamTicket",
116
+ resourceType: "stream_ticket",
117
+ isMutation: true,
118
+ },
119
+ () =>
120
+ this.client.POST("/events/stream_ticket.json", {
121
+ })
122
+ );
123
+ return response;
124
+ }
125
+
126
+ /**
127
+ * Poll the authenticated agent's inbox for the items that addressed it (oldest first, strict item-id order); people receive 403.
128
+ * @param options - Optional query parameters
129
+ * @returns The inbox_item
130
+ *
131
+ * @example
132
+ * ```ts
133
+ * const result = await client.eventFeed.pollInbox();
134
+ * ```
135
+ */
136
+ async pollInbox(options?: PollInboxEventFeedOptions): Promise<components["schemas"]["PollInboxResponseContent"]> {
137
+ const response = await this.request(
138
+ {
139
+ service: "EventFeed",
140
+ operation: "PollInbox",
141
+ resourceType: "inbox_item",
142
+ isMutation: false,
143
+ },
144
+ () =>
145
+ this.client.GET("/inbox.json", {
146
+ params: {
147
+ query: { since: options?.since, position: options?.position, reasons: options?.reasons, types: options?.types, buckets: options?.buckets },
148
+ },
149
+ })
150
+ );
151
+ return response;
152
+ }
153
+ }
@@ -20,7 +20,7 @@ import { Errors } from "../../errors.js";
20
20
  */
21
21
  export interface UpdateGaugeNeedleGaugeRequest {
22
22
  /** Gauge needle */
23
- gaugeNeedle?: components["schemas"]["GaugeNeedleUpdatePayload"];
23
+ gaugeNeedle: components["schemas"]["GaugeNeedleUpdatePayload"];
24
24
  }
25
25
 
26
26
  /**
@@ -45,7 +45,11 @@ export interface ListGaugeNeedlesGaugeOptions extends PaginationOptions {
45
45
  export interface CreateGaugeNeedleGaugeRequest {
46
46
  /** Gauge needle */
47
47
  gaugeNeedle: components["schemas"]["GaugeNeedlePayload"];
48
- /** Who to notify: "everyone", "working_on", "custom", or omit for nobody */
48
+ /** Who to notify: "everyone", "default" (the project's existing
49
+ subscribers), or "custom" (the people in `subscriptions`). Omit for
50
+ nobody: bc3 defaults `notify` to "custom", which with no `subscriptions`
51
+ notifies no one, and any unrecognized value (`Subscribers#find_subscribers`
52
+ accepts exactly these three) falls through to nobody as well. */
49
53
  notify?: string;
50
54
  /** Array of people IDs to notify (only used when notify is "custom") */
51
55
  subscriptions?: number[];
@@ -110,10 +114,13 @@ export class GaugesService extends BaseService {
110
114
  *
111
115
  * @example
112
116
  * ```ts
113
- * const result = await client.gauges.updateGaugeNeedle(123, { });
117
+ * const result = await client.gauges.updateGaugeNeedle(123, { gaugeNeedle: { description: "Details here" } });
114
118
  * ```
115
119
  */
116
120
  async updateGaugeNeedle(needleId: number, req: UpdateGaugeNeedleGaugeRequest): Promise<components["schemas"]["UpdateGaugeNeedleResponseContent"]> {
121
+ if (!req.gaugeNeedle) {
122
+ throw Errors.validation("Gauge needle is required");
123
+ }
117
124
  const response = await this.request(
118
125
  {
119
126
  service: "Gauges",
@@ -21,9 +21,9 @@ export { EverythingService } from "./everything.js";
21
21
  export { PeopleService } from "./people.js";
22
22
  export { CommentsService } from "./comments.js";
23
23
  export { DocumentsService } from "./documents.js";
24
+ export { EventFeedService } from "./event-feed.js";
24
25
  export { GaugesService } from "./gauges.js";
25
26
  export { ForwardsService } from "./forwards.js";
26
- export { AutomationService } from "./automation.js";
27
27
  export { LineupService } from "./lineup.js";
28
28
  export { MessageBoardsService } from "./message-boards.js";
29
29
  export { MessagesService } from "./messages.js";
@@ -12,6 +12,8 @@ import { Errors } from "../../errors.js";
12
12
  // Types
13
13
  // =============================================================================
14
14
 
15
+ /** LineupMarker entity from the Basecamp API. */
16
+ export type LineupMarker = components["schemas"]["LineupMarker"];
15
17
 
16
18
  /**
17
19
  * Request parameters for create.
@@ -43,6 +45,30 @@ export interface UpdateLineupRequest {
43
45
  */
44
46
  export class LineupService extends BaseService {
45
47
 
48
+ /**
49
+ * List all lineup markers for the account
50
+ * @returns Array of LineupMarker
51
+ *
52
+ * @example
53
+ * ```ts
54
+ * const result = await client.lineup.listLineupMarkers();
55
+ * ```
56
+ */
57
+ async listLineupMarkers(): Promise<LineupMarker[]> {
58
+ const response = await this.request(
59
+ {
60
+ service: "Lineup",
61
+ operation: "ListLineupMarkers",
62
+ resourceType: "lineup_marker",
63
+ isMutation: false,
64
+ },
65
+ () =>
66
+ this.client.GET("/lineup/markers.json", {
67
+ })
68
+ );
69
+ return response ?? [];
70
+ }
71
+
46
72
  /**
47
73
  * Create a new lineup marker
48
74
  * @param req - Lineup_marker creation parameters
@@ -1,25 +0,0 @@
1
- /**
2
- * Automation service for the Basecamp API.
3
- *
4
- * @generated from OpenAPI spec - do not edit directly
5
- */
6
- import { BaseService } from "../../services/base.js";
7
- import type { components } from "../schema.js";
8
- /** LineupMarker entity from the Basecamp API. */
9
- export type LineupMarker = components["schemas"]["LineupMarker"];
10
- /**
11
- * Service for Automation operations.
12
- */
13
- export declare class AutomationService extends BaseService {
14
- /**
15
- * List all lineup markers for the account
16
- * @returns Array of LineupMarker
17
- *
18
- * @example
19
- * ```ts
20
- * const result = await client.automation.listLineupMarkers();
21
- * ```
22
- */
23
- listLineupMarkers(): Promise<LineupMarker[]>;
24
- }
25
- //# sourceMappingURL=automation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"automation.d.ts","sourceRoot":"","sources":["../../../src/generated/services/automation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAM/C,iDAAiD;AACjD,MAAM,MAAM,YAAY,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,cAAc,CAAC,CAAC;AAMjE;;GAEG;AACH,qBAAa,iBAAkB,SAAQ,WAAW;IAEhD;;;;;;;;OAQG;IACG,iBAAiB,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;CAcnD"}
@@ -1,33 +0,0 @@
1
- /**
2
- * Automation service for the Basecamp API.
3
- *
4
- * @generated from OpenAPI spec - do not edit directly
5
- */
6
- import { BaseService } from "../../services/base.js";
7
- // =============================================================================
8
- // Service
9
- // =============================================================================
10
- /**
11
- * Service for Automation operations.
12
- */
13
- export class AutomationService extends BaseService {
14
- /**
15
- * List all lineup markers for the account
16
- * @returns Array of LineupMarker
17
- *
18
- * @example
19
- * ```ts
20
- * const result = await client.automation.listLineupMarkers();
21
- * ```
22
- */
23
- async listLineupMarkers() {
24
- const response = await this.request({
25
- service: "Automation",
26
- operation: "ListLineupMarkers",
27
- resourceType: "lineup_marker",
28
- isMutation: false,
29
- }, () => this.client.GET("/lineup/markers.json", {}));
30
- return response ?? [];
31
- }
32
- }
33
- //# sourceMappingURL=automation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"automation.js","sourceRoot":"","sources":["../../../src/generated/services/automation.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAUrD,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;GAEG;AACH,MAAM,OAAO,iBAAkB,SAAQ,WAAW;IAEhD;;;;;;;;OAQG;IACH,KAAK,CAAC,iBAAiB;QACrB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC;YACE,OAAO,EAAE,YAAY;YACrB,SAAS,EAAE,mBAAmB;YAC9B,YAAY,EAAE,eAAe;YAC7B,UAAU,EAAE,KAAK;SAClB,EACD,GAAG,EAAE,CACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,sBAAsB,EAAE,EACvC,CAAC,CACL,CAAC;QACF,OAAO,QAAQ,IAAI,EAAE,CAAC;IACxB,CAAC;CACF"}
@@ -1,49 +0,0 @@
1
- /**
2
- * Automation 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
- /** LineupMarker entity from the Basecamp API. */
15
- export type LineupMarker = components["schemas"]["LineupMarker"];
16
-
17
- // =============================================================================
18
- // Service
19
- // =============================================================================
20
-
21
- /**
22
- * Service for Automation operations.
23
- */
24
- export class AutomationService extends BaseService {
25
-
26
- /**
27
- * List all lineup markers for the account
28
- * @returns Array of LineupMarker
29
- *
30
- * @example
31
- * ```ts
32
- * const result = await client.automation.listLineupMarkers();
33
- * ```
34
- */
35
- async listLineupMarkers(): Promise<LineupMarker[]> {
36
- const response = await this.request(
37
- {
38
- service: "Automation",
39
- operation: "ListLineupMarkers",
40
- resourceType: "lineup_marker",
41
- isMutation: false,
42
- },
43
- () =>
44
- this.client.GET("/lineup/markers.json", {
45
- })
46
- );
47
- return response ?? [];
48
- }
49
- }
@@ -1,49 +0,0 @@
1
- /**
2
- * Automation 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
- /** LineupMarker entity from the Basecamp API. */
15
- export type LineupMarker = components["schemas"]["LineupMarker"];
16
-
17
- // =============================================================================
18
- // Service
19
- // =============================================================================
20
-
21
- /**
22
- * Service for Automation operations.
23
- */
24
- export class AutomationService extends BaseService {
25
-
26
- /**
27
- * List all lineup markers for the account
28
- * @returns Array of LineupMarker
29
- *
30
- * @example
31
- * ```ts
32
- * const result = await client.automation.listLineupMarkers();
33
- * ```
34
- */
35
- async listLineupMarkers(): Promise<LineupMarker[]> {
36
- const response = await this.request(
37
- {
38
- service: "Automation",
39
- operation: "ListLineupMarkers",
40
- resourceType: "lineup_marker",
41
- isMutation: false,
42
- },
43
- () =>
44
- this.client.GET("/lineup/markers.json", {
45
- })
46
- );
47
- return response ?? [];
48
- }
49
- }