@37signals/basecamp 0.11.0 → 0.12.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 (80) hide show
  1. package/dist/client.d.ts +14 -2
  2. package/dist/client.d.ts.map +1 -1
  3. package/dist/client.js +200 -162
  4. package/dist/client.js.map +1 -1
  5. package/dist/errors.d.ts +1 -1
  6. package/dist/errors.js +1 -1
  7. package/dist/generated/metadata.d.ts.map +1 -1
  8. package/dist/generated/metadata.js +172 -1
  9. package/dist/generated/metadata.js.map +1 -1
  10. package/dist/generated/metadata.ts +172 -1
  11. package/dist/generated/openapi-stripped.json +2074 -134
  12. package/dist/generated/path-mapping.d.ts.map +1 -1
  13. package/dist/generated/path-mapping.js +13 -0
  14. package/dist/generated/path-mapping.js.map +1 -1
  15. package/dist/generated/path-mapping.ts +13 -0
  16. package/dist/generated/schema.d.ts +1361 -25
  17. package/dist/generated/services/bookmarks.d.ts +76 -0
  18. package/dist/generated/services/bookmarks.d.ts.map +1 -0
  19. package/dist/generated/services/bookmarks.js +114 -0
  20. package/dist/generated/services/bookmarks.js.map +1 -0
  21. package/dist/generated/services/bookmarks.ts +158 -0
  22. package/dist/generated/services/calendars.d.ts +47 -0
  23. package/dist/generated/services/calendars.d.ts.map +1 -0
  24. package/dist/generated/services/calendars.js +73 -0
  25. package/dist/generated/services/calendars.js.map +1 -0
  26. package/dist/generated/services/calendars.ts +102 -0
  27. package/dist/generated/services/drafts.d.ts +38 -0
  28. package/dist/generated/services/drafts.d.ts.map +1 -0
  29. package/dist/generated/services/drafts.js +40 -0
  30. package/dist/generated/services/drafts.js.map +1 -0
  31. package/dist/generated/services/drafts.ts +67 -0
  32. package/dist/generated/services/everything.d.ts +69 -2
  33. package/dist/generated/services/everything.d.ts.map +1 -1
  34. package/dist/generated/services/everything.js +23 -13
  35. package/dist/generated/services/everything.js.map +1 -1
  36. package/dist/generated/services/everything.ts +86 -11
  37. package/dist/generated/services/index.d.ts +5 -1
  38. package/dist/generated/services/index.d.ts.map +1 -1
  39. package/dist/generated/services/index.js +5 -1
  40. package/dist/generated/services/index.js.map +1 -1
  41. package/dist/generated/services/index.ts +5 -1
  42. package/dist/generated/services/my-assignments.d.ts +52 -0
  43. package/dist/generated/services/my-assignments.d.ts.map +1 -1
  44. package/dist/generated/services/my-assignments.js +71 -0
  45. package/dist/generated/services/my-assignments.js.map +1 -1
  46. package/dist/generated/services/my-assignments.ts +104 -0
  47. package/dist/generated/services/my-notes.d.ts +45 -0
  48. package/dist/generated/services/my-notes.d.ts.map +1 -0
  49. package/dist/generated/services/my-notes.js +62 -0
  50. package/dist/generated/services/my-notes.js.map +1 -0
  51. package/dist/generated/services/my-notes.ts +92 -0
  52. package/dist/generated/services/todos.d.ts +33 -0
  53. package/dist/generated/services/todos.d.ts.map +1 -1
  54. package/dist/generated/services/todos.js +46 -0
  55. package/dist/generated/services/todos.js.map +1 -1
  56. package/dist/generated/services/todos.ts +71 -0
  57. package/dist/hooks/otel.d.ts +1 -1
  58. package/dist/hooks/otel.js +1 -1
  59. package/dist/index.d.ts +6 -2
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +5 -1
  62. package/dist/index.js.map +1 -1
  63. package/dist/oauth/discovery.d.ts.map +1 -1
  64. package/dist/oauth/discovery.js +1 -0
  65. package/dist/oauth/discovery.js.map +1 -1
  66. package/dist/pagination.d.ts +1 -1
  67. package/dist/pagination.js +1 -1
  68. package/package.json +1 -1
  69. package/src/generated/metadata.ts +172 -1
  70. package/src/generated/openapi-stripped.json +2074 -134
  71. package/src/generated/path-mapping.ts +13 -0
  72. package/src/generated/schema.d.ts +1361 -25
  73. package/src/generated/services/bookmarks.ts +158 -0
  74. package/src/generated/services/calendars.ts +102 -0
  75. package/src/generated/services/drafts.ts +67 -0
  76. package/src/generated/services/everything.ts +86 -11
  77. package/src/generated/services/index.ts +5 -1
  78. package/src/generated/services/my-assignments.ts +104 -0
  79. package/src/generated/services/my-notes.ts +92 -0
  80. package/src/generated/services/todos.ts +71 -0
@@ -0,0 +1,76 @@
1
+ /**
2
+ * Bookmarks 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
+ import { ListResult } from "../../pagination.js";
9
+ import type { PaginationOptions } from "../../pagination.js";
10
+ /** Bookmark entity from the Basecamp API. */
11
+ export type Bookmark = components["schemas"]["Bookmark"];
12
+ /** BookmarkStatus entity from the Basecamp API. */
13
+ export type BookmarkStatus = components["schemas"]["BookmarkStatus"];
14
+ /**
15
+ * Options for listMyBookmarks.
16
+ */
17
+ export interface ListMyBookmarksBookmarkOptions extends PaginationOptions {
18
+ /** Page number for paginating through results. Defaults to 1. */
19
+ page?: number;
20
+ }
21
+ /**
22
+ * Service for Bookmarks operations.
23
+ */
24
+ export declare class BookmarksService extends BaseService {
25
+ /**
26
+ * List the current user's bookmarks, most recently bookmarked first (paginated).
27
+ * @param options - Optional query parameters
28
+ * @returns All Bookmark across all pages, with .meta.totalCount
29
+ *
30
+ * @example
31
+ * ```ts
32
+ * const result = await client.bookmarks.listMyBookmarks();
33
+ *
34
+ * // With options
35
+ * const filtered = await client.bookmarks.listMyBookmarks({ page: 1 });
36
+ * ```
37
+ */
38
+ listMyBookmarks(options?: ListMyBookmarksBookmarkOptions): Promise<ListResult<Bookmark>>;
39
+ /**
40
+ * Report whether the current user has bookmarked the recording.
41
+ * @param recordingId - The recording ID
42
+ * @returns The BookmarkStatus
43
+ * @throws {BasecampError} If the resource is not found
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const result = await client.bookmarks.getBookmark(123);
48
+ * ```
49
+ */
50
+ getBookmark(recordingId: number): Promise<BookmarkStatus>;
51
+ /**
52
+ * Bookmark a recording for the current user.
53
+ * @param recordingId - The recording ID
54
+ * @returns The Bookmark
55
+ * @throws {BasecampError} If required fields are missing or invalid
56
+ *
57
+ * @example
58
+ * ```ts
59
+ * const result = await client.bookmarks.createBookmark(123);
60
+ * ```
61
+ */
62
+ createBookmark(recordingId: number): Promise<Bookmark>;
63
+ /**
64
+ * Remove the current user's bookmark from a recording.
65
+ * @param recordingId - The recording ID
66
+ * @returns void
67
+ * @throws {BasecampError} If the request fails
68
+ *
69
+ * @example
70
+ * ```ts
71
+ * await client.bookmarks.deleteBookmark(123);
72
+ * ```
73
+ */
74
+ deleteBookmark(recordingId: number): Promise<void>;
75
+ }
76
+ //# sourceMappingURL=bookmarks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bookmarks.d.ts","sourceRoot":"","sources":["../../../src/generated/services/bookmarks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAM7D,6CAA6C;AAC7C,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;AACzD,mDAAmD;AACnD,MAAM,MAAM,cAAc,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,CAAC;AAErE;;GAEG;AACH,MAAM,WAAW,8BAA+B,SAAQ,iBAAiB;IACvE,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAOD;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAE/C;;;;;;;;;;;;OAYG;IACG,eAAe,CAAC,OAAO,CAAC,EAAE,8BAA8B,GAAG,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;IAkB9F;;;;;;;;;;OAUG;IACG,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAmB/D;;;;;;;;;;OAUG;IACG,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAmB5D;;;;;;;;;;OAUG;IACG,cAAc,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAiBzD"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Bookmarks 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 Bookmarks operations.
12
+ */
13
+ export class BookmarksService extends BaseService {
14
+ /**
15
+ * List the current user's bookmarks, most recently bookmarked first (paginated).
16
+ * @param options - Optional query parameters
17
+ * @returns All Bookmark across all pages, with .meta.totalCount
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const result = await client.bookmarks.listMyBookmarks();
22
+ *
23
+ * // With options
24
+ * const filtered = await client.bookmarks.listMyBookmarks({ page: 1 });
25
+ * ```
26
+ */
27
+ async listMyBookmarks(options) {
28
+ return this.requestPaginated({
29
+ service: "Bookmarks",
30
+ operation: "ListMyBookmarks",
31
+ resourceType: "bookmark",
32
+ isMutation: false,
33
+ }, () => this.client.GET("/my/bookmarks.json", {
34
+ params: {
35
+ query: { page: options?.page },
36
+ },
37
+ }), options);
38
+ }
39
+ /**
40
+ * Report whether the current user has bookmarked the recording.
41
+ * @param recordingId - The recording ID
42
+ * @returns The BookmarkStatus
43
+ * @throws {BasecampError} If the resource is not found
44
+ *
45
+ * @example
46
+ * ```ts
47
+ * const result = await client.bookmarks.getBookmark(123);
48
+ * ```
49
+ */
50
+ async getBookmark(recordingId) {
51
+ const response = await this.request({
52
+ service: "Bookmarks",
53
+ operation: "GetBookmark",
54
+ resourceType: "bookmark",
55
+ isMutation: false,
56
+ resourceId: recordingId,
57
+ }, () => this.client.GET("/recordings/{recordingId}/bookmark.json", {
58
+ params: {
59
+ path: { recordingId },
60
+ },
61
+ }));
62
+ return response;
63
+ }
64
+ /**
65
+ * Bookmark a recording for the current user.
66
+ * @param recordingId - The recording ID
67
+ * @returns The Bookmark
68
+ * @throws {BasecampError} If required fields are missing or invalid
69
+ *
70
+ * @example
71
+ * ```ts
72
+ * const result = await client.bookmarks.createBookmark(123);
73
+ * ```
74
+ */
75
+ async createBookmark(recordingId) {
76
+ const response = await this.request({
77
+ service: "Bookmarks",
78
+ operation: "CreateBookmark",
79
+ resourceType: "bookmark",
80
+ isMutation: true,
81
+ resourceId: recordingId,
82
+ }, () => this.client.POST("/recordings/{recordingId}/bookmark.json", {
83
+ params: {
84
+ path: { recordingId },
85
+ },
86
+ }));
87
+ return response;
88
+ }
89
+ /**
90
+ * Remove the current user's bookmark from a recording.
91
+ * @param recordingId - The recording ID
92
+ * @returns void
93
+ * @throws {BasecampError} If the request fails
94
+ *
95
+ * @example
96
+ * ```ts
97
+ * await client.bookmarks.deleteBookmark(123);
98
+ * ```
99
+ */
100
+ async deleteBookmark(recordingId) {
101
+ await this.request({
102
+ service: "Bookmarks",
103
+ operation: "DeleteBookmark",
104
+ resourceType: "bookmark",
105
+ isMutation: true,
106
+ resourceId: recordingId,
107
+ }, () => this.client.DELETE("/recordings/{recordingId}/bookmark.json", {
108
+ params: {
109
+ path: { recordingId },
110
+ },
111
+ }));
112
+ }
113
+ }
114
+ //# sourceMappingURL=bookmarks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bookmarks.js","sourceRoot":"","sources":["../../../src/generated/services/bookmarks.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAuBrD,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAE/C;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,eAAe,CAAC,OAAwC;QAC5D,OAAO,IAAI,CAAC,gBAAgB,CAC1B;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,iBAAiB;YAC5B,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,KAAK;SAClB,EACD,GAAG,EAAE,CACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,oBAAoB,EAAE;YACpC,MAAM,EAAE;gBACN,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;aAC/B;SACF,CAAC,EACF,OAAO,CACV,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,WAAW,CAAC,WAAmB;QACnC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,aAAa;YACxB,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,WAAW;SACxB,EACD,GAAG,EAAE,CACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,yCAAyC,EAAE;YACzD,MAAM,EAAE;gBACN,IAAI,EAAE,EAAE,WAAW,EAAE;aACtB;SACF,CAAC,CACL,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,cAAc,CAAC,WAAmB;QACtC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,gBAAgB;YAC3B,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,WAAW;SACxB,EACD,GAAG,EAAE,CACH,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,yCAAyC,EAAE;YAC1D,MAAM,EAAE;gBACN,IAAI,EAAE,EAAE,WAAW,EAAE;aACtB;SACF,CAAC,CACL,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,cAAc,CAAC,WAAmB;QACtC,MAAM,IAAI,CAAC,OAAO,CAChB;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,gBAAgB;YAC3B,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,WAAW;SACxB,EACD,GAAG,EAAE,CACH,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,yCAAyC,EAAE;YAC5D,MAAM,EAAE;gBACN,IAAI,EAAE,EAAE,WAAW,EAAE;aACtB;SACF,CAAC,CACL,CAAC;IACJ,CAAC;CACF"}
@@ -0,0 +1,158 @@
1
+ /**
2
+ * Bookmarks 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
+
12
+ // =============================================================================
13
+ // Types
14
+ // =============================================================================
15
+
16
+ /** Bookmark entity from the Basecamp API. */
17
+ export type Bookmark = components["schemas"]["Bookmark"];
18
+ /** BookmarkStatus entity from the Basecamp API. */
19
+ export type BookmarkStatus = components["schemas"]["BookmarkStatus"];
20
+
21
+ /**
22
+ * Options for listMyBookmarks.
23
+ */
24
+ export interface ListMyBookmarksBookmarkOptions extends PaginationOptions {
25
+ /** Page number for paginating through results. Defaults to 1. */
26
+ page?: number;
27
+ }
28
+
29
+
30
+ // =============================================================================
31
+ // Service
32
+ // =============================================================================
33
+
34
+ /**
35
+ * Service for Bookmarks operations.
36
+ */
37
+ export class BookmarksService extends BaseService {
38
+
39
+ /**
40
+ * List the current user's bookmarks, most recently bookmarked first (paginated).
41
+ * @param options - Optional query parameters
42
+ * @returns All Bookmark across all pages, with .meta.totalCount
43
+ *
44
+ * @example
45
+ * ```ts
46
+ * const result = await client.bookmarks.listMyBookmarks();
47
+ *
48
+ * // With options
49
+ * const filtered = await client.bookmarks.listMyBookmarks({ page: 1 });
50
+ * ```
51
+ */
52
+ async listMyBookmarks(options?: ListMyBookmarksBookmarkOptions): Promise<ListResult<Bookmark>> {
53
+ return this.requestPaginated(
54
+ {
55
+ service: "Bookmarks",
56
+ operation: "ListMyBookmarks",
57
+ resourceType: "bookmark",
58
+ isMutation: false,
59
+ },
60
+ () =>
61
+ this.client.GET("/my/bookmarks.json", {
62
+ params: {
63
+ query: { page: options?.page },
64
+ },
65
+ })
66
+ , options
67
+ );
68
+ }
69
+
70
+ /**
71
+ * Report whether the current user has bookmarked the recording.
72
+ * @param recordingId - The recording ID
73
+ * @returns The BookmarkStatus
74
+ * @throws {BasecampError} If the resource is not found
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * const result = await client.bookmarks.getBookmark(123);
79
+ * ```
80
+ */
81
+ async getBookmark(recordingId: number): Promise<BookmarkStatus> {
82
+ const response = await this.request(
83
+ {
84
+ service: "Bookmarks",
85
+ operation: "GetBookmark",
86
+ resourceType: "bookmark",
87
+ isMutation: false,
88
+ resourceId: recordingId,
89
+ },
90
+ () =>
91
+ this.client.GET("/recordings/{recordingId}/bookmark.json", {
92
+ params: {
93
+ path: { recordingId },
94
+ },
95
+ })
96
+ );
97
+ return response;
98
+ }
99
+
100
+ /**
101
+ * Bookmark a recording for the current user.
102
+ * @param recordingId - The recording ID
103
+ * @returns The Bookmark
104
+ * @throws {BasecampError} If required fields are missing or invalid
105
+ *
106
+ * @example
107
+ * ```ts
108
+ * const result = await client.bookmarks.createBookmark(123);
109
+ * ```
110
+ */
111
+ async createBookmark(recordingId: number): Promise<Bookmark> {
112
+ const response = await this.request(
113
+ {
114
+ service: "Bookmarks",
115
+ operation: "CreateBookmark",
116
+ resourceType: "bookmark",
117
+ isMutation: true,
118
+ resourceId: recordingId,
119
+ },
120
+ () =>
121
+ this.client.POST("/recordings/{recordingId}/bookmark.json", {
122
+ params: {
123
+ path: { recordingId },
124
+ },
125
+ })
126
+ );
127
+ return response;
128
+ }
129
+
130
+ /**
131
+ * Remove the current user's bookmark from a recording.
132
+ * @param recordingId - The recording ID
133
+ * @returns void
134
+ * @throws {BasecampError} If the request fails
135
+ *
136
+ * @example
137
+ * ```ts
138
+ * await client.bookmarks.deleteBookmark(123);
139
+ * ```
140
+ */
141
+ async deleteBookmark(recordingId: number): Promise<void> {
142
+ await this.request(
143
+ {
144
+ service: "Bookmarks",
145
+ operation: "DeleteBookmark",
146
+ resourceType: "bookmark",
147
+ isMutation: true,
148
+ resourceId: recordingId,
149
+ },
150
+ () =>
151
+ this.client.DELETE("/recordings/{recordingId}/bookmark.json", {
152
+ params: {
153
+ path: { recordingId },
154
+ },
155
+ })
156
+ );
157
+ }
158
+ }
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Calendars 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
+ /** Calendar entity from the Basecamp API. */
9
+ export type Calendar = components["schemas"]["Calendar"];
10
+ /**
11
+ * Request parameters for updateCalendar.
12
+ */
13
+ export interface UpdateCalendarCalendarRequest {
14
+ /** Calendar */
15
+ calendar: components["schemas"]["CalendarAttributes"];
16
+ }
17
+ /**
18
+ * Service for Calendars operations.
19
+ */
20
+ export declare class CalendarsService extends BaseService {
21
+ /**
22
+ * Get a calendar by its bucket id. A Calendar is a top-level BC5 bucketable
23
+ * @param calendarId - The calendar ID
24
+ * @returns The Calendar
25
+ * @throws {BasecampError} If the resource is not found
26
+ *
27
+ * @example
28
+ * ```ts
29
+ * const result = await client.calendars.getCalendar(123);
30
+ * ```
31
+ */
32
+ getCalendar(calendarId: number): Promise<Calendar>;
33
+ /**
34
+ * Update a calendar's display color. An unknown color returns 422 with a JSON
35
+ * @param calendarId - The calendar ID
36
+ * @param req - Calendar update parameters
37
+ * @returns The Calendar
38
+ * @throws {BasecampError} If the resource is not found or fields are invalid
39
+ *
40
+ * @example
41
+ * ```ts
42
+ * const result = await client.calendars.updateCalendar(123, { calendar: { color: "example" } });
43
+ * ```
44
+ */
45
+ updateCalendar(calendarId: number, req: UpdateCalendarCalendarRequest): Promise<Calendar>;
46
+ }
47
+ //# sourceMappingURL=calendars.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendars.d.ts","sourceRoot":"","sources":["../../../src/generated/services/calendars.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAO/C,6CAA6C;AAC7C,MAAM,MAAM,QAAQ,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;AAEzD;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C,eAAe;IACf,QAAQ,EAAE,UAAU,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAAC,CAAC;CACvD;AAOD;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,WAAW;IAE/C;;;;;;;;;;OAUG;IACG,WAAW,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAmBxD;;;;;;;;;;;OAWG;IACG,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,6BAA6B,GAAG,OAAO,CAAC,QAAQ,CAAC;CAwBhG"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Calendars 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 { Errors } from "../../errors.js";
8
+ // =============================================================================
9
+ // Service
10
+ // =============================================================================
11
+ /**
12
+ * Service for Calendars operations.
13
+ */
14
+ export class CalendarsService extends BaseService {
15
+ /**
16
+ * Get a calendar by its bucket id. A Calendar is a top-level BC5 bucketable
17
+ * @param calendarId - The calendar ID
18
+ * @returns The Calendar
19
+ * @throws {BasecampError} If the resource is not found
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const result = await client.calendars.getCalendar(123);
24
+ * ```
25
+ */
26
+ async getCalendar(calendarId) {
27
+ const response = await this.request({
28
+ service: "Calendars",
29
+ operation: "GetCalendar",
30
+ resourceType: "calendar",
31
+ isMutation: false,
32
+ resourceId: calendarId,
33
+ }, () => this.client.GET("/calendars/{calendarId}", {
34
+ params: {
35
+ path: { calendarId },
36
+ },
37
+ }));
38
+ return response;
39
+ }
40
+ /**
41
+ * Update a calendar's display color. An unknown color returns 422 with a JSON
42
+ * @param calendarId - The calendar ID
43
+ * @param req - Calendar update parameters
44
+ * @returns The Calendar
45
+ * @throws {BasecampError} If the resource is not found or fields are invalid
46
+ *
47
+ * @example
48
+ * ```ts
49
+ * const result = await client.calendars.updateCalendar(123, { calendar: { color: "example" } });
50
+ * ```
51
+ */
52
+ async updateCalendar(calendarId, req) {
53
+ if (!req.calendar) {
54
+ throw Errors.validation("Calendar is required");
55
+ }
56
+ const response = await this.request({
57
+ service: "Calendars",
58
+ operation: "UpdateCalendar",
59
+ resourceType: "calendar",
60
+ isMutation: true,
61
+ resourceId: calendarId,
62
+ }, () => this.client.PUT("/calendars/{calendarId}", {
63
+ params: {
64
+ path: { calendarId },
65
+ },
66
+ body: {
67
+ calendar: req.calendar,
68
+ },
69
+ }));
70
+ return response;
71
+ }
72
+ }
73
+ //# sourceMappingURL=calendars.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"calendars.js","sourceRoot":"","sources":["../../../src/generated/services/calendars.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAkBzC,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;IAE/C;;;;;;;;;;OAUG;IACH,KAAK,CAAC,WAAW,CAAC,UAAkB;QAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,aAAa;YACxB,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,KAAK;YACjB,UAAU,EAAE,UAAU;SACvB,EACD,GAAG,EAAE,CACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,EAAE;YACzC,MAAM,EAAE;gBACN,IAAI,EAAE,EAAE,UAAU,EAAE;aACrB;SACF,CAAC,CACL,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,cAAc,CAAC,UAAkB,EAAE,GAAkC;QACzE,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC;YAClB,MAAM,MAAM,CAAC,UAAU,CAAC,sBAAsB,CAAC,CAAC;QAClD,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CACjC;YACE,OAAO,EAAE,WAAW;YACpB,SAAS,EAAE,gBAAgB;YAC3B,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,IAAI;YAChB,UAAU,EAAE,UAAU;SACvB,EACD,GAAG,EAAE,CACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,yBAAyB,EAAE;YACzC,MAAM,EAAE;gBACN,IAAI,EAAE,EAAE,UAAU,EAAE;aACrB;YACD,IAAI,EAAE;gBACJ,QAAQ,EAAE,GAAG,CAAC,QAAQ;aACvB;SACF,CAAC,CACL,CAAC;QACF,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Calendars 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
+ /** Calendar entity from the Basecamp API. */
16
+ export type Calendar = components["schemas"]["Calendar"];
17
+
18
+ /**
19
+ * Request parameters for updateCalendar.
20
+ */
21
+ export interface UpdateCalendarCalendarRequest {
22
+ /** Calendar */
23
+ calendar: components["schemas"]["CalendarAttributes"];
24
+ }
25
+
26
+
27
+ // =============================================================================
28
+ // Service
29
+ // =============================================================================
30
+
31
+ /**
32
+ * Service for Calendars operations.
33
+ */
34
+ export class CalendarsService extends BaseService {
35
+
36
+ /**
37
+ * Get a calendar by its bucket id. A Calendar is a top-level BC5 bucketable
38
+ * @param calendarId - The calendar ID
39
+ * @returns The Calendar
40
+ * @throws {BasecampError} If the resource is not found
41
+ *
42
+ * @example
43
+ * ```ts
44
+ * const result = await client.calendars.getCalendar(123);
45
+ * ```
46
+ */
47
+ async getCalendar(calendarId: number): Promise<Calendar> {
48
+ const response = await this.request(
49
+ {
50
+ service: "Calendars",
51
+ operation: "GetCalendar",
52
+ resourceType: "calendar",
53
+ isMutation: false,
54
+ resourceId: calendarId,
55
+ },
56
+ () =>
57
+ this.client.GET("/calendars/{calendarId}", {
58
+ params: {
59
+ path: { calendarId },
60
+ },
61
+ })
62
+ );
63
+ return response;
64
+ }
65
+
66
+ /**
67
+ * Update a calendar's display color. An unknown color returns 422 with a JSON
68
+ * @param calendarId - The calendar ID
69
+ * @param req - Calendar update parameters
70
+ * @returns The Calendar
71
+ * @throws {BasecampError} If the resource is not found or fields are invalid
72
+ *
73
+ * @example
74
+ * ```ts
75
+ * const result = await client.calendars.updateCalendar(123, { calendar: { color: "example" } });
76
+ * ```
77
+ */
78
+ async updateCalendar(calendarId: number, req: UpdateCalendarCalendarRequest): Promise<Calendar> {
79
+ if (!req.calendar) {
80
+ throw Errors.validation("Calendar is required");
81
+ }
82
+ const response = await this.request(
83
+ {
84
+ service: "Calendars",
85
+ operation: "UpdateCalendar",
86
+ resourceType: "calendar",
87
+ isMutation: true,
88
+ resourceId: calendarId,
89
+ },
90
+ () =>
91
+ this.client.PUT("/calendars/{calendarId}", {
92
+ params: {
93
+ path: { calendarId },
94
+ },
95
+ body: {
96
+ calendar: req.calendar,
97
+ },
98
+ })
99
+ );
100
+ return response;
101
+ }
102
+ }
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Drafts 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
+ import { ListResult } from "../../pagination.js";
9
+ import type { PaginationOptions } from "../../pagination.js";
10
+ /** Draft entity from the Basecamp API. */
11
+ export type Draft = components["schemas"]["Draft"];
12
+ /**
13
+ * Options for listMyDrafts.
14
+ */
15
+ export interface ListMyDraftsDraftOptions extends PaginationOptions {
16
+ /** Page number for paginating through results. Defaults to 1. */
17
+ page?: number;
18
+ }
19
+ /**
20
+ * Service for Drafts operations.
21
+ */
22
+ export declare class DraftsService extends BaseService {
23
+ /**
24
+ * List the current user's drafts across their active projects, most recently
25
+ * @param options - Optional query parameters
26
+ * @returns All Draft across all pages, with .meta.totalCount
27
+ *
28
+ * @example
29
+ * ```ts
30
+ * const result = await client.drafts.listMyDrafts();
31
+ *
32
+ * // With options
33
+ * const filtered = await client.drafts.listMyDrafts({ page: 1 });
34
+ * ```
35
+ */
36
+ listMyDrafts(options?: ListMyDraftsDraftOptions): Promise<ListResult<Draft>>;
37
+ }
38
+ //# sourceMappingURL=drafts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drafts.d.ts","sourceRoot":"","sources":["../../../src/generated/services/drafts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAM7D,0CAA0C;AAC1C,MAAM,MAAM,KAAK,GAAG,UAAU,CAAC,SAAS,CAAC,CAAC,OAAO,CAAC,CAAC;AAEnD;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,iBAAiB;IACjE,iEAAiE;IACjE,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAOD;;GAEG;AACH,qBAAa,aAAc,SAAQ,WAAW;IAE5C;;;;;;;;;;;;OAYG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;CAiBnF"}
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Drafts 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 Drafts operations.
12
+ */
13
+ export class DraftsService extends BaseService {
14
+ /**
15
+ * List the current user's drafts across their active projects, most recently
16
+ * @param options - Optional query parameters
17
+ * @returns All Draft across all pages, with .meta.totalCount
18
+ *
19
+ * @example
20
+ * ```ts
21
+ * const result = await client.drafts.listMyDrafts();
22
+ *
23
+ * // With options
24
+ * const filtered = await client.drafts.listMyDrafts({ page: 1 });
25
+ * ```
26
+ */
27
+ async listMyDrafts(options) {
28
+ return this.requestPaginated({
29
+ service: "Drafts",
30
+ operation: "ListMyDrafts",
31
+ resourceType: "my_draft",
32
+ isMutation: false,
33
+ }, () => this.client.GET("/my/drafts.json", {
34
+ params: {
35
+ query: { page: options?.page },
36
+ },
37
+ }), options);
38
+ }
39
+ }
40
+ //# sourceMappingURL=drafts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"drafts.js","sourceRoot":"","sources":["../../../src/generated/services/drafts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAqBrD,gFAAgF;AAChF,UAAU;AACV,gFAAgF;AAEhF;;GAEG;AACH,MAAM,OAAO,aAAc,SAAQ,WAAW;IAE5C;;;;;;;;;;;;OAYG;IACH,KAAK,CAAC,YAAY,CAAC,OAAkC;QACnD,OAAO,IAAI,CAAC,gBAAgB,CAC1B;YACE,OAAO,EAAE,QAAQ;YACjB,SAAS,EAAE,cAAc;YACzB,YAAY,EAAE,UAAU;YACxB,UAAU,EAAE,KAAK;SAClB,EACD,GAAG,EAAE,CACH,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,iBAAiB,EAAE;YACjC,MAAM,EAAE;gBACN,KAAK,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE;aAC/B;SACF,CAAC,EACF,OAAO,CACV,CAAC;IACJ,CAAC;CACF"}