@air/api-rest 0.2.0 → 0.3.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.
package/dist/index.cjs CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  CustomFields: () => CustomFields,
43
43
  Imports: () => Imports,
44
44
  InternalServerError: () => import_api_core2.InternalServerError,
45
+ Libraries: () => Libraries,
45
46
  NotFoundError: () => import_api_core2.NotFoundError,
46
47
  PagePromise: () => import_api_core2.PagePromise,
47
48
  PermissionError: () => import_api_core2.PermissionError,
@@ -172,7 +173,9 @@ var Boards = class {
172
173
  limit: params.limit,
173
174
  cursor: params.cursor,
174
175
  name: params.name,
175
- parentBoardId: params.parentBoardId
176
+ parentBoardId: params.parentBoardId,
177
+ libraryId: params.libraryId,
178
+ inGeneralLibrary: params.inGeneralLibrary
176
179
  };
177
180
  if (params.customField) {
178
181
  query.customField = params.customField;
@@ -338,6 +341,50 @@ var Imports = class {
338
341
  }
339
342
  };
340
343
 
344
+ // src/resources/libraries.ts
345
+ var Libraries = class {
346
+ constructor(client) {
347
+ this.client = client;
348
+ }
349
+ list(params = {}) {
350
+ const query = {
351
+ limit: params.limit,
352
+ cursor: params.cursor,
353
+ search: params.search
354
+ };
355
+ return this.client.requestCursorPage(
356
+ { method: "GET", path: "/libraries", query },
357
+ query
358
+ );
359
+ }
360
+ async get(libraryId) {
361
+ return this.client.request({
362
+ method: "GET",
363
+ path: `/libraries/${libraryId}`
364
+ });
365
+ }
366
+ async create(params) {
367
+ return this.client.request({
368
+ method: "POST",
369
+ path: "/libraries",
370
+ body: params
371
+ });
372
+ }
373
+ async update(libraryId, params) {
374
+ return this.client.request({
375
+ method: "PATCH",
376
+ path: `/libraries/${libraryId}`,
377
+ body: params
378
+ });
379
+ }
380
+ async delete(libraryId) {
381
+ return this.client.request({
382
+ method: "DELETE",
383
+ path: `/libraries/${libraryId}`
384
+ });
385
+ }
386
+ };
387
+
341
388
  // src/resources/roles.ts
342
389
  var Roles = class {
343
390
  constructor(client) {
@@ -642,6 +689,7 @@ var Workspaces = class {
642
689
  var AirApi = class extends import_api_core.AirBase {
643
690
  assets;
644
691
  boards;
692
+ libraries;
645
693
  tags;
646
694
  customFields;
647
695
  roles;
@@ -652,6 +700,7 @@ var AirApi = class extends import_api_core.AirBase {
652
700
  super(options);
653
701
  this.assets = new Assets(this);
654
702
  this.boards = new Boards(this);
703
+ this.libraries = new Libraries(this);
655
704
  this.tags = new Tags(this);
656
705
  this.customFields = new CustomFields(this);
657
706
  this.roles = new Roles(this);
@@ -677,6 +726,7 @@ var import_api_core2 = require("@air/api-core");
677
726
  CustomFields,
678
727
  Imports,
679
728
  InternalServerError,
729
+ Libraries,
680
730
  NotFoundError,
681
731
  PagePromise,
682
732
  PermissionError,
package/dist/index.d.cts CHANGED
@@ -102,6 +102,17 @@ interface BoardListParams extends CursorPageParams {
102
102
  name?: string;
103
103
  parentBoardId?: string;
104
104
  customField?: string | string[];
105
+ /**
106
+ * Only return boards in this library. Mutually exclusive with
107
+ * `inGeneralLibrary` — passing both results in a `400` (BadRequestError).
108
+ */
109
+ libraryId?: string;
110
+ /**
111
+ * Only return boards in the General library (boards not in any real library).
112
+ * Mutually exclusive with `libraryId` — passing both results in a `400`
113
+ * (BadRequestError).
114
+ */
115
+ inGeneralLibrary?: boolean;
105
116
  }
106
117
  interface BoardCreateParams {
107
118
  title: string;
@@ -264,6 +275,41 @@ declare class Imports {
264
275
  getStatus(importId: string): Promise<ImportStatusResponse>;
265
276
  }
266
277
 
278
+ interface Library {
279
+ id: string;
280
+ title: string;
281
+ accessibility: "public" | "private";
282
+ visibility: "workspaceMembers" | "libraryMembers";
283
+ createdAt: string;
284
+ updatedAt: string;
285
+ description?: string;
286
+ }
287
+ interface LibraryListParams extends CursorPageParams {
288
+ search?: string;
289
+ }
290
+ interface LibraryCreateParams {
291
+ title: string;
292
+ description?: string;
293
+ accessibility?: "public" | "private";
294
+ visibility?: "workspaceMembers" | "libraryMembers";
295
+ }
296
+ interface LibraryUpdateParams {
297
+ title?: string;
298
+ description?: string | null;
299
+ accessibility?: "public" | "private";
300
+ visibility?: "workspaceMembers" | "libraryMembers";
301
+ }
302
+
303
+ declare class Libraries {
304
+ private client;
305
+ constructor(client: AirBase);
306
+ list(params?: LibraryListParams): PagePromise<Library>;
307
+ get(libraryId: string): Promise<Library>;
308
+ create(params: LibraryCreateParams): Promise<Library>;
309
+ update(libraryId: string, params: LibraryUpdateParams): Promise<void>;
310
+ delete(libraryId: string): Promise<void>;
311
+ }
312
+
267
313
  interface Role {
268
314
  id: string;
269
315
  name: string;
@@ -420,6 +466,7 @@ interface AirApiOptions extends AirBaseOptions {
420
466
  declare class AirApi extends AirBase {
421
467
  readonly assets: Assets;
422
468
  readonly boards: Boards;
469
+ readonly libraries: Libraries;
423
470
  readonly tags: Tags;
424
471
  readonly customFields: CustomFields;
425
472
  readonly roles: Roles;
@@ -429,4 +476,4 @@ declare class AirApi extends AirBase {
429
476
  constructor(options?: AirApiOptions);
430
477
  }
431
478
 
432
- export { type AddBoardAssetsParams, type AddGuestParams, type AddVersionTagParams, AirApi, type AirApiOptions, type Asset, type AssetBoardListParams, type AssetCustomFieldValue, type AssetListParams, type AssetVersion, type AssetVersionDownloadUrl, type AssetVersionListResponse, type AssetVersionUpdateParams, type AssetVersionUrls, Assets, type Board, type BoardCreateParams, type BoardListParams, type BoardUpdateParams, Boards, type CompleteMultipartParams, type CustomField, type CustomFieldCreateParams, type CustomFieldListParams, type CustomFieldType, type CustomFieldUpdateParams, type CustomFieldValue, type CustomFieldValueCreateParams, type CustomFieldValueUpdateParams, CustomFields, type FileMeta, type FileSource, type GetPartUploadUrlParams, type GetPartUploadUrlResponse, type Guest, type GuestListParams, type GuestListResponse, type ImportCreateParams, type ImportCreateResponse, type ImportStatus, type ImportStatusResponse, Imports, type LargeUploadResponse, type Role, type RoleListParams, type RoleListResponse, Roles, type SetBoardCustomFieldParams, type SetCustomFieldParams, type SmallUploadResponse, type SmartTag, type Tag, type TagCreateParams, type TagListParams, type TagUpdateParams, Tags, type UpdateGuestParams, type UploadCreateParams, type UploadCreateResponse, type UploadFileOptions, type UploadFileParams, type UploadFileResponse, Uploads, type Workspace, type WorkspaceListResponse, Workspaces };
479
+ export { type AddBoardAssetsParams, type AddGuestParams, type AddVersionTagParams, AirApi, type AirApiOptions, type Asset, type AssetBoardListParams, type AssetCustomFieldValue, type AssetListParams, type AssetVersion, type AssetVersionDownloadUrl, type AssetVersionListResponse, type AssetVersionUpdateParams, type AssetVersionUrls, Assets, type Board, type BoardCreateParams, type BoardListParams, type BoardUpdateParams, Boards, type CompleteMultipartParams, type CustomField, type CustomFieldCreateParams, type CustomFieldListParams, type CustomFieldType, type CustomFieldUpdateParams, type CustomFieldValue, type CustomFieldValueCreateParams, type CustomFieldValueUpdateParams, CustomFields, type FileMeta, type FileSource, type GetPartUploadUrlParams, type GetPartUploadUrlResponse, type Guest, type GuestListParams, type GuestListResponse, type ImportCreateParams, type ImportCreateResponse, type ImportStatus, type ImportStatusResponse, Imports, type LargeUploadResponse, Libraries, type Library, type LibraryCreateParams, type LibraryListParams, type LibraryUpdateParams, type Role, type RoleListParams, type RoleListResponse, Roles, type SetBoardCustomFieldParams, type SetCustomFieldParams, type SmallUploadResponse, type SmartTag, type Tag, type TagCreateParams, type TagListParams, type TagUpdateParams, Tags, type UpdateGuestParams, type UploadCreateParams, type UploadCreateResponse, type UploadFileOptions, type UploadFileParams, type UploadFileResponse, Uploads, type Workspace, type WorkspaceListResponse, Workspaces };
package/dist/index.d.ts CHANGED
@@ -102,6 +102,17 @@ interface BoardListParams extends CursorPageParams {
102
102
  name?: string;
103
103
  parentBoardId?: string;
104
104
  customField?: string | string[];
105
+ /**
106
+ * Only return boards in this library. Mutually exclusive with
107
+ * `inGeneralLibrary` — passing both results in a `400` (BadRequestError).
108
+ */
109
+ libraryId?: string;
110
+ /**
111
+ * Only return boards in the General library (boards not in any real library).
112
+ * Mutually exclusive with `libraryId` — passing both results in a `400`
113
+ * (BadRequestError).
114
+ */
115
+ inGeneralLibrary?: boolean;
105
116
  }
106
117
  interface BoardCreateParams {
107
118
  title: string;
@@ -264,6 +275,41 @@ declare class Imports {
264
275
  getStatus(importId: string): Promise<ImportStatusResponse>;
265
276
  }
266
277
 
278
+ interface Library {
279
+ id: string;
280
+ title: string;
281
+ accessibility: "public" | "private";
282
+ visibility: "workspaceMembers" | "libraryMembers";
283
+ createdAt: string;
284
+ updatedAt: string;
285
+ description?: string;
286
+ }
287
+ interface LibraryListParams extends CursorPageParams {
288
+ search?: string;
289
+ }
290
+ interface LibraryCreateParams {
291
+ title: string;
292
+ description?: string;
293
+ accessibility?: "public" | "private";
294
+ visibility?: "workspaceMembers" | "libraryMembers";
295
+ }
296
+ interface LibraryUpdateParams {
297
+ title?: string;
298
+ description?: string | null;
299
+ accessibility?: "public" | "private";
300
+ visibility?: "workspaceMembers" | "libraryMembers";
301
+ }
302
+
303
+ declare class Libraries {
304
+ private client;
305
+ constructor(client: AirBase);
306
+ list(params?: LibraryListParams): PagePromise<Library>;
307
+ get(libraryId: string): Promise<Library>;
308
+ create(params: LibraryCreateParams): Promise<Library>;
309
+ update(libraryId: string, params: LibraryUpdateParams): Promise<void>;
310
+ delete(libraryId: string): Promise<void>;
311
+ }
312
+
267
313
  interface Role {
268
314
  id: string;
269
315
  name: string;
@@ -420,6 +466,7 @@ interface AirApiOptions extends AirBaseOptions {
420
466
  declare class AirApi extends AirBase {
421
467
  readonly assets: Assets;
422
468
  readonly boards: Boards;
469
+ readonly libraries: Libraries;
423
470
  readonly tags: Tags;
424
471
  readonly customFields: CustomFields;
425
472
  readonly roles: Roles;
@@ -429,4 +476,4 @@ declare class AirApi extends AirBase {
429
476
  constructor(options?: AirApiOptions);
430
477
  }
431
478
 
432
- export { type AddBoardAssetsParams, type AddGuestParams, type AddVersionTagParams, AirApi, type AirApiOptions, type Asset, type AssetBoardListParams, type AssetCustomFieldValue, type AssetListParams, type AssetVersion, type AssetVersionDownloadUrl, type AssetVersionListResponse, type AssetVersionUpdateParams, type AssetVersionUrls, Assets, type Board, type BoardCreateParams, type BoardListParams, type BoardUpdateParams, Boards, type CompleteMultipartParams, type CustomField, type CustomFieldCreateParams, type CustomFieldListParams, type CustomFieldType, type CustomFieldUpdateParams, type CustomFieldValue, type CustomFieldValueCreateParams, type CustomFieldValueUpdateParams, CustomFields, type FileMeta, type FileSource, type GetPartUploadUrlParams, type GetPartUploadUrlResponse, type Guest, type GuestListParams, type GuestListResponse, type ImportCreateParams, type ImportCreateResponse, type ImportStatus, type ImportStatusResponse, Imports, type LargeUploadResponse, type Role, type RoleListParams, type RoleListResponse, Roles, type SetBoardCustomFieldParams, type SetCustomFieldParams, type SmallUploadResponse, type SmartTag, type Tag, type TagCreateParams, type TagListParams, type TagUpdateParams, Tags, type UpdateGuestParams, type UploadCreateParams, type UploadCreateResponse, type UploadFileOptions, type UploadFileParams, type UploadFileResponse, Uploads, type Workspace, type WorkspaceListResponse, Workspaces };
479
+ export { type AddBoardAssetsParams, type AddGuestParams, type AddVersionTagParams, AirApi, type AirApiOptions, type Asset, type AssetBoardListParams, type AssetCustomFieldValue, type AssetListParams, type AssetVersion, type AssetVersionDownloadUrl, type AssetVersionListResponse, type AssetVersionUpdateParams, type AssetVersionUrls, Assets, type Board, type BoardCreateParams, type BoardListParams, type BoardUpdateParams, Boards, type CompleteMultipartParams, type CustomField, type CustomFieldCreateParams, type CustomFieldListParams, type CustomFieldType, type CustomFieldUpdateParams, type CustomFieldValue, type CustomFieldValueCreateParams, type CustomFieldValueUpdateParams, CustomFields, type FileMeta, type FileSource, type GetPartUploadUrlParams, type GetPartUploadUrlResponse, type Guest, type GuestListParams, type GuestListResponse, type ImportCreateParams, type ImportCreateResponse, type ImportStatus, type ImportStatusResponse, Imports, type LargeUploadResponse, Libraries, type Library, type LibraryCreateParams, type LibraryListParams, type LibraryUpdateParams, type Role, type RoleListParams, type RoleListResponse, Roles, type SetBoardCustomFieldParams, type SetCustomFieldParams, type SmallUploadResponse, type SmartTag, type Tag, type TagCreateParams, type TagListParams, type TagUpdateParams, Tags, type UpdateGuestParams, type UploadCreateParams, type UploadCreateResponse, type UploadFileOptions, type UploadFileParams, type UploadFileResponse, Uploads, type Workspace, type WorkspaceListResponse, Workspaces };
package/dist/index.js CHANGED
@@ -112,7 +112,9 @@ var Boards = class {
112
112
  limit: params.limit,
113
113
  cursor: params.cursor,
114
114
  name: params.name,
115
- parentBoardId: params.parentBoardId
115
+ parentBoardId: params.parentBoardId,
116
+ libraryId: params.libraryId,
117
+ inGeneralLibrary: params.inGeneralLibrary
116
118
  };
117
119
  if (params.customField) {
118
120
  query.customField = params.customField;
@@ -278,6 +280,50 @@ var Imports = class {
278
280
  }
279
281
  };
280
282
 
283
+ // src/resources/libraries.ts
284
+ var Libraries = class {
285
+ constructor(client) {
286
+ this.client = client;
287
+ }
288
+ list(params = {}) {
289
+ const query = {
290
+ limit: params.limit,
291
+ cursor: params.cursor,
292
+ search: params.search
293
+ };
294
+ return this.client.requestCursorPage(
295
+ { method: "GET", path: "/libraries", query },
296
+ query
297
+ );
298
+ }
299
+ async get(libraryId) {
300
+ return this.client.request({
301
+ method: "GET",
302
+ path: `/libraries/${libraryId}`
303
+ });
304
+ }
305
+ async create(params) {
306
+ return this.client.request({
307
+ method: "POST",
308
+ path: "/libraries",
309
+ body: params
310
+ });
311
+ }
312
+ async update(libraryId, params) {
313
+ return this.client.request({
314
+ method: "PATCH",
315
+ path: `/libraries/${libraryId}`,
316
+ body: params
317
+ });
318
+ }
319
+ async delete(libraryId) {
320
+ return this.client.request({
321
+ method: "DELETE",
322
+ path: `/libraries/${libraryId}`
323
+ });
324
+ }
325
+ };
326
+
281
327
  // src/resources/roles.ts
282
328
  var Roles = class {
283
329
  constructor(client) {
@@ -582,6 +628,7 @@ var Workspaces = class {
582
628
  var AirApi = class extends AirBase {
583
629
  assets;
584
630
  boards;
631
+ libraries;
585
632
  tags;
586
633
  customFields;
587
634
  roles;
@@ -592,6 +639,7 @@ var AirApi = class extends AirBase {
592
639
  super(options);
593
640
  this.assets = new Assets(this);
594
641
  this.boards = new Boards(this);
642
+ this.libraries = new Libraries(this);
595
643
  this.tags = new Tags(this);
596
644
  this.customFields = new CustomFields(this);
597
645
  this.roles = new Roles(this);
@@ -633,6 +681,7 @@ export {
633
681
  CustomFields,
634
682
  Imports,
635
683
  InternalServerError,
684
+ Libraries,
636
685
  NotFoundError,
637
686
  PagePromise,
638
687
  PermissionError,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@air/api-rest",
3
- "version": "0.2.0",
3
+ "version": "0.3.0",
4
4
  "type": "module",
5
5
  "description": "Typed REST client for Air API",
6
6
  "main": "./dist/index.cjs",
@@ -29,7 +29,7 @@
29
29
  "clean": "rm -rf dist .tsc-out tsconfig.tsbuildinfo"
30
30
  },
31
31
  "dependencies": {
32
- "@air/api-core": "0.2.0"
32
+ "@air/api-core": "0.3.0"
33
33
  },
34
34
  "engines": {
35
35
  "node": ">=18"