@air/api-rest 0.1.3 → 0.2.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
@@ -50,7 +50,11 @@ __export(index_exports, {
50
50
  Tags: () => Tags,
51
51
  TimeoutError: () => import_api_core2.TimeoutError,
52
52
  Uploads: () => Uploads,
53
- VERSION: () => import_api_core2.VERSION
53
+ VERSION: () => import_api_core2.VERSION,
54
+ Workspaces: () => Workspaces,
55
+ buildAuthorizationUrl: () => import_api_core2.buildAuthorizationUrl,
56
+ exchangeAuthorizationCode: () => import_api_core2.exchangeAuthorizationCode,
57
+ generatePKCEChallenge: () => import_api_core2.generatePKCEChallenge
54
58
  });
55
59
  module.exports = __toCommonJS(index_exports);
56
60
 
@@ -620,6 +624,20 @@ function guessMime(ext) {
620
624
  return mimeMap[ext.toLowerCase()] ?? "application/octet-stream";
621
625
  }
622
626
 
627
+ // src/resources/workspaces.ts
628
+ var Workspaces = class {
629
+ constructor(client) {
630
+ this.client = client;
631
+ }
632
+ async list() {
633
+ const response = await this.client.request({
634
+ method: "GET",
635
+ path: "/workspaces"
636
+ });
637
+ return response.data;
638
+ }
639
+ };
640
+
623
641
  // src/api.ts
624
642
  var AirApi = class extends import_api_core.AirBase {
625
643
  assets;
@@ -629,6 +647,7 @@ var AirApi = class extends import_api_core.AirBase {
629
647
  roles;
630
648
  imports;
631
649
  uploads;
650
+ workspaces;
632
651
  constructor(options = {}) {
633
652
  super(options);
634
653
  this.assets = new Assets(this);
@@ -638,6 +657,7 @@ var AirApi = class extends import_api_core.AirBase {
638
657
  this.roles = new Roles(this);
639
658
  this.imports = new Imports(this);
640
659
  this.uploads = new Uploads(this);
660
+ this.workspaces = new Workspaces(this);
641
661
  }
642
662
  };
643
663
 
@@ -665,5 +685,9 @@ var import_api_core2 = require("@air/api-core");
665
685
  Tags,
666
686
  TimeoutError,
667
687
  Uploads,
668
- VERSION
688
+ VERSION,
689
+ Workspaces,
690
+ buildAuthorizationUrl,
691
+ exchangeAuthorizationCode,
692
+ generatePKCEChallenge
669
693
  });
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CursorPageParams, AirBase, PagePromise, AirBaseOptions } from '@air/api-core';
2
- export { APIError, AirBase, AirBaseOptions, AuthenticationError, BadRequestError, ConnectionError, CursorPage, CursorPageParams, CursorPageResponse, InternalServerError, NotFoundError, PagePromise, PermissionError, RateLimitError, RequestOptions, TimeoutError, VERSION } from '@air/api-core';
2
+ export { APIError, AirBase, AirBaseOptions, AuthenticationError, BadRequestError, BuildAuthorizationUrlOptions, ConnectionError, CursorPage, CursorPageParams, CursorPageResponse, ExchangeAuthorizationCodeOptions, InternalServerError, NotFoundError, OAuthAccessToken, OAuthClientAuthMethod, PKCEChallenge, PagePromise, PermissionError, RateLimitError, RequestOptions, TimeoutError, VERSION, buildAuthorizationUrl, exchangeAuthorizationCode, generatePKCEChallenge } from '@air/api-core';
3
3
 
4
4
  interface Tag {
5
5
  id: string;
@@ -401,6 +401,20 @@ declare class Uploads {
401
401
  private _uploadLargeFile;
402
402
  }
403
403
 
404
+ interface Workspace {
405
+ id: string;
406
+ name: string;
407
+ }
408
+ interface WorkspaceListResponse {
409
+ data: Workspace[];
410
+ }
411
+
412
+ declare class Workspaces {
413
+ private client;
414
+ constructor(client: AirBase);
415
+ list(): Promise<Workspace[]>;
416
+ }
417
+
404
418
  interface AirApiOptions extends AirBaseOptions {
405
419
  }
406
420
  declare class AirApi extends AirBase {
@@ -411,7 +425,8 @@ declare class AirApi extends AirBase {
411
425
  readonly roles: Roles;
412
426
  readonly imports: Imports;
413
427
  readonly uploads: Uploads;
428
+ readonly workspaces: Workspaces;
414
429
  constructor(options?: AirApiOptions);
415
430
  }
416
431
 
417
- 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 };
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 };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CursorPageParams, AirBase, PagePromise, AirBaseOptions } from '@air/api-core';
2
- export { APIError, AirBase, AirBaseOptions, AuthenticationError, BadRequestError, ConnectionError, CursorPage, CursorPageParams, CursorPageResponse, InternalServerError, NotFoundError, PagePromise, PermissionError, RateLimitError, RequestOptions, TimeoutError, VERSION } from '@air/api-core';
2
+ export { APIError, AirBase, AirBaseOptions, AuthenticationError, BadRequestError, BuildAuthorizationUrlOptions, ConnectionError, CursorPage, CursorPageParams, CursorPageResponse, ExchangeAuthorizationCodeOptions, InternalServerError, NotFoundError, OAuthAccessToken, OAuthClientAuthMethod, PKCEChallenge, PagePromise, PermissionError, RateLimitError, RequestOptions, TimeoutError, VERSION, buildAuthorizationUrl, exchangeAuthorizationCode, generatePKCEChallenge } from '@air/api-core';
3
3
 
4
4
  interface Tag {
5
5
  id: string;
@@ -401,6 +401,20 @@ declare class Uploads {
401
401
  private _uploadLargeFile;
402
402
  }
403
403
 
404
+ interface Workspace {
405
+ id: string;
406
+ name: string;
407
+ }
408
+ interface WorkspaceListResponse {
409
+ data: Workspace[];
410
+ }
411
+
412
+ declare class Workspaces {
413
+ private client;
414
+ constructor(client: AirBase);
415
+ list(): Promise<Workspace[]>;
416
+ }
417
+
404
418
  interface AirApiOptions extends AirBaseOptions {
405
419
  }
406
420
  declare class AirApi extends AirBase {
@@ -411,7 +425,8 @@ declare class AirApi extends AirBase {
411
425
  readonly roles: Roles;
412
426
  readonly imports: Imports;
413
427
  readonly uploads: Uploads;
428
+ readonly workspaces: Workspaces;
414
429
  constructor(options?: AirApiOptions);
415
430
  }
416
431
 
417
- 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 };
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 };
package/dist/index.js CHANGED
@@ -564,6 +564,20 @@ function guessMime(ext) {
564
564
  return mimeMap[ext.toLowerCase()] ?? "application/octet-stream";
565
565
  }
566
566
 
567
+ // src/resources/workspaces.ts
568
+ var Workspaces = class {
569
+ constructor(client) {
570
+ this.client = client;
571
+ }
572
+ async list() {
573
+ const response = await this.client.request({
574
+ method: "GET",
575
+ path: "/workspaces"
576
+ });
577
+ return response.data;
578
+ }
579
+ };
580
+
567
581
  // src/api.ts
568
582
  var AirApi = class extends AirBase {
569
583
  assets;
@@ -573,6 +587,7 @@ var AirApi = class extends AirBase {
573
587
  roles;
574
588
  imports;
575
589
  uploads;
590
+ workspaces;
576
591
  constructor(options = {}) {
577
592
  super(options);
578
593
  this.assets = new Assets(this);
@@ -582,6 +597,7 @@ var AirApi = class extends AirBase {
582
597
  this.roles = new Roles(this);
583
598
  this.imports = new Imports(this);
584
599
  this.uploads = new Uploads(this);
600
+ this.workspaces = new Workspaces(this);
585
601
  }
586
602
  };
587
603
 
@@ -599,7 +615,10 @@ import {
599
615
  TimeoutError,
600
616
  CursorPage,
601
617
  PagePromise,
602
- VERSION
618
+ VERSION,
619
+ buildAuthorizationUrl,
620
+ exchangeAuthorizationCode,
621
+ generatePKCEChallenge
603
622
  } from "@air/api-core";
604
623
  export {
605
624
  APIError,
@@ -622,5 +641,9 @@ export {
622
641
  Tags,
623
642
  TimeoutError,
624
643
  Uploads,
625
- VERSION
644
+ VERSION,
645
+ Workspaces,
646
+ buildAuthorizationUrl,
647
+ exchangeAuthorizationCode,
648
+ generatePKCEChallenge
626
649
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@air/api-rest",
3
- "version": "0.1.3",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "description": "Typed REST client for Air API",
6
6
  "main": "./dist/index.cjs",
@@ -26,10 +26,10 @@
26
26
  "build": "tsup",
27
27
  "test": "vitest run",
28
28
  "typecheck": "tsc -b",
29
- "clean": "rm -rf dist tsconfig.tsbuildinfo"
29
+ "clean": "rm -rf dist .tsc-out tsconfig.tsbuildinfo"
30
30
  },
31
31
  "dependencies": {
32
- "@air/api-core": "0.1.2"
32
+ "@air/api-core": "0.2.0"
33
33
  },
34
34
  "engines": {
35
35
  "node": ">=18"