@air/api-rest 0.1.3 → 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 +77 -3
- package/dist/index.d.cts +64 -2
- package/dist/index.d.ts +64 -2
- package/dist/index.js +75 -3
- package/package.json +3 -3
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,
|
|
@@ -50,7 +51,11 @@ __export(index_exports, {
|
|
|
50
51
|
Tags: () => Tags,
|
|
51
52
|
TimeoutError: () => import_api_core2.TimeoutError,
|
|
52
53
|
Uploads: () => Uploads,
|
|
53
|
-
VERSION: () => import_api_core2.VERSION
|
|
54
|
+
VERSION: () => import_api_core2.VERSION,
|
|
55
|
+
Workspaces: () => Workspaces,
|
|
56
|
+
buildAuthorizationUrl: () => import_api_core2.buildAuthorizationUrl,
|
|
57
|
+
exchangeAuthorizationCode: () => import_api_core2.exchangeAuthorizationCode,
|
|
58
|
+
generatePKCEChallenge: () => import_api_core2.generatePKCEChallenge
|
|
54
59
|
});
|
|
55
60
|
module.exports = __toCommonJS(index_exports);
|
|
56
61
|
|
|
@@ -168,7 +173,9 @@ var Boards = class {
|
|
|
168
173
|
limit: params.limit,
|
|
169
174
|
cursor: params.cursor,
|
|
170
175
|
name: params.name,
|
|
171
|
-
parentBoardId: params.parentBoardId
|
|
176
|
+
parentBoardId: params.parentBoardId,
|
|
177
|
+
libraryId: params.libraryId,
|
|
178
|
+
inGeneralLibrary: params.inGeneralLibrary
|
|
172
179
|
};
|
|
173
180
|
if (params.customField) {
|
|
174
181
|
query.customField = params.customField;
|
|
@@ -334,6 +341,50 @@ var Imports = class {
|
|
|
334
341
|
}
|
|
335
342
|
};
|
|
336
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
|
+
|
|
337
388
|
// src/resources/roles.ts
|
|
338
389
|
var Roles = class {
|
|
339
390
|
constructor(client) {
|
|
@@ -620,24 +671,42 @@ function guessMime(ext) {
|
|
|
620
671
|
return mimeMap[ext.toLowerCase()] ?? "application/octet-stream";
|
|
621
672
|
}
|
|
622
673
|
|
|
674
|
+
// src/resources/workspaces.ts
|
|
675
|
+
var Workspaces = class {
|
|
676
|
+
constructor(client) {
|
|
677
|
+
this.client = client;
|
|
678
|
+
}
|
|
679
|
+
async list() {
|
|
680
|
+
const response = await this.client.request({
|
|
681
|
+
method: "GET",
|
|
682
|
+
path: "/workspaces"
|
|
683
|
+
});
|
|
684
|
+
return response.data;
|
|
685
|
+
}
|
|
686
|
+
};
|
|
687
|
+
|
|
623
688
|
// src/api.ts
|
|
624
689
|
var AirApi = class extends import_api_core.AirBase {
|
|
625
690
|
assets;
|
|
626
691
|
boards;
|
|
692
|
+
libraries;
|
|
627
693
|
tags;
|
|
628
694
|
customFields;
|
|
629
695
|
roles;
|
|
630
696
|
imports;
|
|
631
697
|
uploads;
|
|
698
|
+
workspaces;
|
|
632
699
|
constructor(options = {}) {
|
|
633
700
|
super(options);
|
|
634
701
|
this.assets = new Assets(this);
|
|
635
702
|
this.boards = new Boards(this);
|
|
703
|
+
this.libraries = new Libraries(this);
|
|
636
704
|
this.tags = new Tags(this);
|
|
637
705
|
this.customFields = new CustomFields(this);
|
|
638
706
|
this.roles = new Roles(this);
|
|
639
707
|
this.imports = new Imports(this);
|
|
640
708
|
this.uploads = new Uploads(this);
|
|
709
|
+
this.workspaces = new Workspaces(this);
|
|
641
710
|
}
|
|
642
711
|
};
|
|
643
712
|
|
|
@@ -657,6 +726,7 @@ var import_api_core2 = require("@air/api-core");
|
|
|
657
726
|
CustomFields,
|
|
658
727
|
Imports,
|
|
659
728
|
InternalServerError,
|
|
729
|
+
Libraries,
|
|
660
730
|
NotFoundError,
|
|
661
731
|
PagePromise,
|
|
662
732
|
PermissionError,
|
|
@@ -665,5 +735,9 @@ var import_api_core2 = require("@air/api-core");
|
|
|
665
735
|
Tags,
|
|
666
736
|
TimeoutError,
|
|
667
737
|
Uploads,
|
|
668
|
-
VERSION
|
|
738
|
+
VERSION,
|
|
739
|
+
Workspaces,
|
|
740
|
+
buildAuthorizationUrl,
|
|
741
|
+
exchangeAuthorizationCode,
|
|
742
|
+
generatePKCEChallenge
|
|
669
743
|
});
|
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;
|
|
@@ -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;
|
|
@@ -401,17 +447,33 @@ declare class Uploads {
|
|
|
401
447
|
private _uploadLargeFile;
|
|
402
448
|
}
|
|
403
449
|
|
|
450
|
+
interface Workspace {
|
|
451
|
+
id: string;
|
|
452
|
+
name: string;
|
|
453
|
+
}
|
|
454
|
+
interface WorkspaceListResponse {
|
|
455
|
+
data: Workspace[];
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
declare class Workspaces {
|
|
459
|
+
private client;
|
|
460
|
+
constructor(client: AirBase);
|
|
461
|
+
list(): Promise<Workspace[]>;
|
|
462
|
+
}
|
|
463
|
+
|
|
404
464
|
interface AirApiOptions extends AirBaseOptions {
|
|
405
465
|
}
|
|
406
466
|
declare class AirApi extends AirBase {
|
|
407
467
|
readonly assets: Assets;
|
|
408
468
|
readonly boards: Boards;
|
|
469
|
+
readonly libraries: Libraries;
|
|
409
470
|
readonly tags: Tags;
|
|
410
471
|
readonly customFields: CustomFields;
|
|
411
472
|
readonly roles: Roles;
|
|
412
473
|
readonly imports: Imports;
|
|
413
474
|
readonly uploads: Uploads;
|
|
475
|
+
readonly workspaces: Workspaces;
|
|
414
476
|
constructor(options?: AirApiOptions);
|
|
415
477
|
}
|
|
416
478
|
|
|
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 };
|
|
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
|
@@ -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;
|
|
@@ -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;
|
|
@@ -401,17 +447,33 @@ declare class Uploads {
|
|
|
401
447
|
private _uploadLargeFile;
|
|
402
448
|
}
|
|
403
449
|
|
|
450
|
+
interface Workspace {
|
|
451
|
+
id: string;
|
|
452
|
+
name: string;
|
|
453
|
+
}
|
|
454
|
+
interface WorkspaceListResponse {
|
|
455
|
+
data: Workspace[];
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
declare class Workspaces {
|
|
459
|
+
private client;
|
|
460
|
+
constructor(client: AirBase);
|
|
461
|
+
list(): Promise<Workspace[]>;
|
|
462
|
+
}
|
|
463
|
+
|
|
404
464
|
interface AirApiOptions extends AirBaseOptions {
|
|
405
465
|
}
|
|
406
466
|
declare class AirApi extends AirBase {
|
|
407
467
|
readonly assets: Assets;
|
|
408
468
|
readonly boards: Boards;
|
|
469
|
+
readonly libraries: Libraries;
|
|
409
470
|
readonly tags: Tags;
|
|
410
471
|
readonly customFields: CustomFields;
|
|
411
472
|
readonly roles: Roles;
|
|
412
473
|
readonly imports: Imports;
|
|
413
474
|
readonly uploads: Uploads;
|
|
475
|
+
readonly workspaces: Workspaces;
|
|
414
476
|
constructor(options?: AirApiOptions);
|
|
415
477
|
}
|
|
416
478
|
|
|
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 };
|
|
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) {
|
|
@@ -564,24 +610,42 @@ function guessMime(ext) {
|
|
|
564
610
|
return mimeMap[ext.toLowerCase()] ?? "application/octet-stream";
|
|
565
611
|
}
|
|
566
612
|
|
|
613
|
+
// src/resources/workspaces.ts
|
|
614
|
+
var Workspaces = class {
|
|
615
|
+
constructor(client) {
|
|
616
|
+
this.client = client;
|
|
617
|
+
}
|
|
618
|
+
async list() {
|
|
619
|
+
const response = await this.client.request({
|
|
620
|
+
method: "GET",
|
|
621
|
+
path: "/workspaces"
|
|
622
|
+
});
|
|
623
|
+
return response.data;
|
|
624
|
+
}
|
|
625
|
+
};
|
|
626
|
+
|
|
567
627
|
// src/api.ts
|
|
568
628
|
var AirApi = class extends AirBase {
|
|
569
629
|
assets;
|
|
570
630
|
boards;
|
|
631
|
+
libraries;
|
|
571
632
|
tags;
|
|
572
633
|
customFields;
|
|
573
634
|
roles;
|
|
574
635
|
imports;
|
|
575
636
|
uploads;
|
|
637
|
+
workspaces;
|
|
576
638
|
constructor(options = {}) {
|
|
577
639
|
super(options);
|
|
578
640
|
this.assets = new Assets(this);
|
|
579
641
|
this.boards = new Boards(this);
|
|
642
|
+
this.libraries = new Libraries(this);
|
|
580
643
|
this.tags = new Tags(this);
|
|
581
644
|
this.customFields = new CustomFields(this);
|
|
582
645
|
this.roles = new Roles(this);
|
|
583
646
|
this.imports = new Imports(this);
|
|
584
647
|
this.uploads = new Uploads(this);
|
|
648
|
+
this.workspaces = new Workspaces(this);
|
|
585
649
|
}
|
|
586
650
|
};
|
|
587
651
|
|
|
@@ -599,7 +663,10 @@ import {
|
|
|
599
663
|
TimeoutError,
|
|
600
664
|
CursorPage,
|
|
601
665
|
PagePromise,
|
|
602
|
-
VERSION
|
|
666
|
+
VERSION,
|
|
667
|
+
buildAuthorizationUrl,
|
|
668
|
+
exchangeAuthorizationCode,
|
|
669
|
+
generatePKCEChallenge
|
|
603
670
|
} from "@air/api-core";
|
|
604
671
|
export {
|
|
605
672
|
APIError,
|
|
@@ -614,6 +681,7 @@ export {
|
|
|
614
681
|
CustomFields,
|
|
615
682
|
Imports,
|
|
616
683
|
InternalServerError,
|
|
684
|
+
Libraries,
|
|
617
685
|
NotFoundError,
|
|
618
686
|
PagePromise,
|
|
619
687
|
PermissionError,
|
|
@@ -622,5 +690,9 @@ export {
|
|
|
622
690
|
Tags,
|
|
623
691
|
TimeoutError,
|
|
624
692
|
Uploads,
|
|
625
|
-
VERSION
|
|
693
|
+
VERSION,
|
|
694
|
+
Workspaces,
|
|
695
|
+
buildAuthorizationUrl,
|
|
696
|
+
exchangeAuthorizationCode,
|
|
697
|
+
generatePKCEChallenge
|
|
626
698
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@air/api-rest",
|
|
3
|
-
"version": "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",
|
|
@@ -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.
|
|
32
|
+
"@air/api-core": "0.3.0"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
35
|
"node": ">=18"
|