@bundleup/sdk 0.0.14 → 0.0.16

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/index.d.mts CHANGED
@@ -128,9 +128,8 @@ interface Params {
128
128
  interface Response$1<T> {
129
129
  data: T;
130
130
  _raw?: any;
131
- pageInfo: {
131
+ metadata: {
132
132
  next: string | null;
133
- limit: number;
134
133
  };
135
134
  }
136
135
  declare abstract class Base {
@@ -147,7 +146,7 @@ declare abstract class Base {
147
146
  declare class Chat extends Base {
148
147
  protected namespace: string;
149
148
  /**
150
- * Fetch chat channels with optional query parameters.
149
+ * Fetch chat channels
151
150
  * @param limit - Maximum number of channels to retrieve.
152
151
  * @param after - Cursor for pagination.
153
152
  * @param includeRaw - Whether to include raw response data.
@@ -165,7 +164,7 @@ interface RepoParams extends Params {
165
164
  declare class Git extends Base {
166
165
  protected namespace: string;
167
166
  /**
168
- * Fetch repositories with optional query parameters.
167
+ * Fetch repositories
169
168
  * @param limit - Maximum number of repositories to retrieve.
170
169
  * @param after - Cursor for pagination.
171
170
  * @param includeRaw - Whether to include raw response data.
@@ -176,8 +175,10 @@ declare class Git extends Base {
176
175
  name: string;
177
176
  full_name: string;
178
177
  description: string | null;
178
+ url: string;
179
179
  created_at: string;
180
180
  updated_at: string;
181
+ pushed_at: string;
181
182
  }[]>>;
182
183
  /**
183
184
  * Fetch pull requests for a specific repository.
@@ -192,7 +193,11 @@ declare class Git extends Base {
192
193
  id: string;
193
194
  number: number;
194
195
  title: string;
196
+ description: string | null;
197
+ draft: boolean;
195
198
  state: string;
199
+ url: string;
200
+ user: string;
196
201
  created_at: string;
197
202
  updated_at: string;
198
203
  merged_at: string | null;
@@ -210,6 +215,45 @@ declare class Git extends Base {
210
215
  name: string;
211
216
  commit_sha: string;
212
217
  }[]>>;
218
+ /**
219
+ * Fetch releases for a specific repository.
220
+ * @param repoName - The name of the repository.
221
+ * @param limit - Maximum number of releases to retrieve.
222
+ * @param after - Cursor for pagination.
223
+ * @param includeRaw - Whether to include raw response data.
224
+ * @returns A promise that resolves to the fetch response.
225
+ * @throws If repoName is not provided.
226
+ */
227
+ releases({ repoName, limit, after, includeRaw }: RepoParams): Promise<Response$1<{
228
+ id: string;
229
+ name: string;
230
+ tag_name: string;
231
+ description: string | null;
232
+ prerelease: boolean;
233
+ url: string;
234
+ created_at: string;
235
+ released_at: string | null;
236
+ }[]>>;
237
+ }
238
+
239
+ declare class PM extends Base {
240
+ protected namespace: string;
241
+ /**
242
+ * Fetch issues
243
+ * @param limit - Maximum number of issues to retrieve.
244
+ * @param after - Cursor for pagination.
245
+ * @param includeRaw - Whether to include raw response data.
246
+ * @returns A promise that resolves to the fetch response.
247
+ */
248
+ issues({ limit, after, includeRaw }?: Params): Promise<Response$1<{
249
+ id: string;
250
+ url: string;
251
+ title: string;
252
+ status: string;
253
+ description: string | null;
254
+ created_at: string;
255
+ updated_at: string;
256
+ }[]>>;
213
257
  }
214
258
 
215
259
  declare class BundleUp {
@@ -245,6 +289,7 @@ declare class BundleUp {
245
289
  unify(connectionId: string): {
246
290
  chat: Chat;
247
291
  git: Git;
292
+ pm: PM;
248
293
  };
249
294
  }
250
295
 
package/dist/index.d.ts CHANGED
@@ -128,9 +128,8 @@ interface Params {
128
128
  interface Response$1<T> {
129
129
  data: T;
130
130
  _raw?: any;
131
- pageInfo: {
131
+ metadata: {
132
132
  next: string | null;
133
- limit: number;
134
133
  };
135
134
  }
136
135
  declare abstract class Base {
@@ -147,7 +146,7 @@ declare abstract class Base {
147
146
  declare class Chat extends Base {
148
147
  protected namespace: string;
149
148
  /**
150
- * Fetch chat channels with optional query parameters.
149
+ * Fetch chat channels
151
150
  * @param limit - Maximum number of channels to retrieve.
152
151
  * @param after - Cursor for pagination.
153
152
  * @param includeRaw - Whether to include raw response data.
@@ -165,7 +164,7 @@ interface RepoParams extends Params {
165
164
  declare class Git extends Base {
166
165
  protected namespace: string;
167
166
  /**
168
- * Fetch repositories with optional query parameters.
167
+ * Fetch repositories
169
168
  * @param limit - Maximum number of repositories to retrieve.
170
169
  * @param after - Cursor for pagination.
171
170
  * @param includeRaw - Whether to include raw response data.
@@ -176,8 +175,10 @@ declare class Git extends Base {
176
175
  name: string;
177
176
  full_name: string;
178
177
  description: string | null;
178
+ url: string;
179
179
  created_at: string;
180
180
  updated_at: string;
181
+ pushed_at: string;
181
182
  }[]>>;
182
183
  /**
183
184
  * Fetch pull requests for a specific repository.
@@ -192,7 +193,11 @@ declare class Git extends Base {
192
193
  id: string;
193
194
  number: number;
194
195
  title: string;
196
+ description: string | null;
197
+ draft: boolean;
195
198
  state: string;
199
+ url: string;
200
+ user: string;
196
201
  created_at: string;
197
202
  updated_at: string;
198
203
  merged_at: string | null;
@@ -210,6 +215,45 @@ declare class Git extends Base {
210
215
  name: string;
211
216
  commit_sha: string;
212
217
  }[]>>;
218
+ /**
219
+ * Fetch releases for a specific repository.
220
+ * @param repoName - The name of the repository.
221
+ * @param limit - Maximum number of releases to retrieve.
222
+ * @param after - Cursor for pagination.
223
+ * @param includeRaw - Whether to include raw response data.
224
+ * @returns A promise that resolves to the fetch response.
225
+ * @throws If repoName is not provided.
226
+ */
227
+ releases({ repoName, limit, after, includeRaw }: RepoParams): Promise<Response$1<{
228
+ id: string;
229
+ name: string;
230
+ tag_name: string;
231
+ description: string | null;
232
+ prerelease: boolean;
233
+ url: string;
234
+ created_at: string;
235
+ released_at: string | null;
236
+ }[]>>;
237
+ }
238
+
239
+ declare class PM extends Base {
240
+ protected namespace: string;
241
+ /**
242
+ * Fetch issues
243
+ * @param limit - Maximum number of issues to retrieve.
244
+ * @param after - Cursor for pagination.
245
+ * @param includeRaw - Whether to include raw response data.
246
+ * @returns A promise that resolves to the fetch response.
247
+ */
248
+ issues({ limit, after, includeRaw }?: Params): Promise<Response$1<{
249
+ id: string;
250
+ url: string;
251
+ title: string;
252
+ status: string;
253
+ description: string | null;
254
+ created_at: string;
255
+ updated_at: string;
256
+ }[]>>;
213
257
  }
214
258
 
215
259
  declare class BundleUp {
@@ -245,6 +289,7 @@ declare class BundleUp {
245
289
  unify(connectionId: string): {
246
290
  chat: Chat;
247
291
  git: Git;
292
+ pm: PM;
248
293
  };
249
294
  }
250
295
 
package/dist/index.js CHANGED
@@ -370,7 +370,7 @@ var Chat = class extends Base2 {
370
370
  this.namespace = "chat";
371
371
  }
372
372
  /**
373
- * Fetch chat channels with optional query parameters.
373
+ * Fetch chat channels
374
374
  * @param limit - Maximum number of channels to retrieve.
375
375
  * @param after - Cursor for pagination.
376
376
  * @param includeRaw - Whether to include raw response data.
@@ -401,7 +401,7 @@ var Git = class extends Base2 {
401
401
  this.namespace = "git";
402
402
  }
403
403
  /**
404
- * Fetch repositories with optional query parameters.
404
+ * Fetch repositories
405
405
  * @param limit - Maximum number of repositories to retrieve.
406
406
  * @param after - Cursor for pagination.
407
407
  * @param includeRaw - Whether to include raw response data.
@@ -485,6 +485,71 @@ var Git = class extends Base2 {
485
485
  const data = await response.json();
486
486
  return data;
487
487
  }
488
+ /**
489
+ * Fetch releases for a specific repository.
490
+ * @param repoName - The name of the repository.
491
+ * @param limit - Maximum number of releases to retrieve.
492
+ * @param after - Cursor for pagination.
493
+ * @param includeRaw - Whether to include raw response data.
494
+ * @returns A promise that resolves to the fetch response.
495
+ * @throws If repoName is not provided.
496
+ */
497
+ async releases({ repoName, limit = 100, after, includeRaw }) {
498
+ if (!repoName) {
499
+ throw new Error("repoName is required to fetch releases.");
500
+ }
501
+ const url = this.buildUrl(
502
+ `repos/${encodeURIComponent(repoName)}/releases`,
503
+ {
504
+ limit,
505
+ after
506
+ }
507
+ );
508
+ const response = await fetch(url, {
509
+ headers: {
510
+ ...this.headers,
511
+ "BU-Include-Raw": includeRaw ? "true" : "false"
512
+ }
513
+ });
514
+ if (!response.ok) {
515
+ throw new Error(
516
+ `Failed to fetch ${url.toString()}: ${response.statusText}`
517
+ );
518
+ }
519
+ const data = await response.json();
520
+ return data;
521
+ }
522
+ };
523
+
524
+ // src/unify/pm.ts
525
+ var PM = class extends Base2 {
526
+ constructor() {
527
+ super(...arguments);
528
+ this.namespace = "pm";
529
+ }
530
+ /**
531
+ * Fetch issues
532
+ * @param limit - Maximum number of issues to retrieve.
533
+ * @param after - Cursor for pagination.
534
+ * @param includeRaw - Whether to include raw response data.
535
+ * @returns A promise that resolves to the fetch response.
536
+ */
537
+ async issues({ limit = 100, after, includeRaw } = {}) {
538
+ const url = this.buildUrl("issues", { limit, after });
539
+ const response = await fetch(url, {
540
+ headers: {
541
+ ...this.headers,
542
+ "BU-Include-Raw": includeRaw ? "true" : "false"
543
+ }
544
+ });
545
+ if (!response.ok) {
546
+ throw new Error(
547
+ `Failed to fetch ${url.toString()}: ${response.statusText}`
548
+ );
549
+ }
550
+ const data = await response.json();
551
+ return data;
552
+ }
488
553
  };
489
554
 
490
555
  // src/index.ts
@@ -541,7 +606,8 @@ var BundleUp = class {
541
606
  }
542
607
  return {
543
608
  chat: new Chat(this.apiKey, connectionId),
544
- git: new Git(this.apiKey, connectionId)
609
+ git: new Git(this.apiKey, connectionId),
610
+ pm: new PM(this.apiKey, connectionId)
545
611
  };
546
612
  }
547
613
  };
package/dist/index.mjs CHANGED
@@ -344,7 +344,7 @@ var Chat = class extends Base2 {
344
344
  this.namespace = "chat";
345
345
  }
346
346
  /**
347
- * Fetch chat channels with optional query parameters.
347
+ * Fetch chat channels
348
348
  * @param limit - Maximum number of channels to retrieve.
349
349
  * @param after - Cursor for pagination.
350
350
  * @param includeRaw - Whether to include raw response data.
@@ -375,7 +375,7 @@ var Git = class extends Base2 {
375
375
  this.namespace = "git";
376
376
  }
377
377
  /**
378
- * Fetch repositories with optional query parameters.
378
+ * Fetch repositories
379
379
  * @param limit - Maximum number of repositories to retrieve.
380
380
  * @param after - Cursor for pagination.
381
381
  * @param includeRaw - Whether to include raw response data.
@@ -459,6 +459,71 @@ var Git = class extends Base2 {
459
459
  const data = await response.json();
460
460
  return data;
461
461
  }
462
+ /**
463
+ * Fetch releases for a specific repository.
464
+ * @param repoName - The name of the repository.
465
+ * @param limit - Maximum number of releases to retrieve.
466
+ * @param after - Cursor for pagination.
467
+ * @param includeRaw - Whether to include raw response data.
468
+ * @returns A promise that resolves to the fetch response.
469
+ * @throws If repoName is not provided.
470
+ */
471
+ async releases({ repoName, limit = 100, after, includeRaw }) {
472
+ if (!repoName) {
473
+ throw new Error("repoName is required to fetch releases.");
474
+ }
475
+ const url = this.buildUrl(
476
+ `repos/${encodeURIComponent(repoName)}/releases`,
477
+ {
478
+ limit,
479
+ after
480
+ }
481
+ );
482
+ const response = await fetch(url, {
483
+ headers: {
484
+ ...this.headers,
485
+ "BU-Include-Raw": includeRaw ? "true" : "false"
486
+ }
487
+ });
488
+ if (!response.ok) {
489
+ throw new Error(
490
+ `Failed to fetch ${url.toString()}: ${response.statusText}`
491
+ );
492
+ }
493
+ const data = await response.json();
494
+ return data;
495
+ }
496
+ };
497
+
498
+ // src/unify/pm.ts
499
+ var PM = class extends Base2 {
500
+ constructor() {
501
+ super(...arguments);
502
+ this.namespace = "pm";
503
+ }
504
+ /**
505
+ * Fetch issues
506
+ * @param limit - Maximum number of issues to retrieve.
507
+ * @param after - Cursor for pagination.
508
+ * @param includeRaw - Whether to include raw response data.
509
+ * @returns A promise that resolves to the fetch response.
510
+ */
511
+ async issues({ limit = 100, after, includeRaw } = {}) {
512
+ const url = this.buildUrl("issues", { limit, after });
513
+ const response = await fetch(url, {
514
+ headers: {
515
+ ...this.headers,
516
+ "BU-Include-Raw": includeRaw ? "true" : "false"
517
+ }
518
+ });
519
+ if (!response.ok) {
520
+ throw new Error(
521
+ `Failed to fetch ${url.toString()}: ${response.statusText}`
522
+ );
523
+ }
524
+ const data = await response.json();
525
+ return data;
526
+ }
462
527
  };
463
528
 
464
529
  // src/index.ts
@@ -515,7 +580,8 @@ var BundleUp = class {
515
580
  }
516
581
  return {
517
582
  chat: new Chat(this.apiKey, connectionId),
518
- git: new Git(this.apiKey, connectionId)
583
+ git: new Git(this.apiKey, connectionId),
584
+ pm: new PM(this.apiKey, connectionId)
519
585
  };
520
586
  }
521
587
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bundleup/sdk",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "description": "SDK package for BundleUp",
5
5
  "exports": {
6
6
  ".": {