@air/api-rest 0.4.0 → 0.5.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/README.md +1 -0
- package/dist/index.cjs +20 -0
- package/dist/index.d.cts +32 -1
- package/dist/index.d.ts +32 -1
- package/dist/index.js +20 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -21,6 +21,7 @@ npm install @air/api-rest
|
|
|
21
21
|
## What's included
|
|
22
22
|
|
|
23
23
|
- Resource classes: `BoardsResource`, `AssetsResource`, `TagsResource`, `CustomFieldsResource`, `UploadsResource`, `ImportsResource`, `RolesResource`
|
|
24
|
+
- Asset CDN link helpers: `listCdnLinks`, `createCdnLink`, and `updateCdnLink`
|
|
24
25
|
- Full TypeScript types for all API request/response shapes
|
|
25
26
|
- `AirApi` client class that composes all resources
|
|
26
27
|
|
package/dist/index.cjs
CHANGED
|
@@ -106,6 +106,26 @@ var Assets = class {
|
|
|
106
106
|
path: `/assets/${assetId}`
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
|
+
async listCdnLinks(assetId) {
|
|
110
|
+
return this.client.request({
|
|
111
|
+
method: "GET",
|
|
112
|
+
path: `/assets/${assetId}/cdnLinks`
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
async createCdnLink(assetId, params) {
|
|
116
|
+
return this.client.request({
|
|
117
|
+
method: "POST",
|
|
118
|
+
path: `/assets/${assetId}/cdnLinks`,
|
|
119
|
+
body: params
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
async updateCdnLink(assetId, cdnLinkId, params) {
|
|
123
|
+
return this.client.request({
|
|
124
|
+
method: "PATCH",
|
|
125
|
+
path: `/assets/${assetId}/cdnLinks/${cdnLinkId}`,
|
|
126
|
+
body: params
|
|
127
|
+
});
|
|
128
|
+
}
|
|
109
129
|
async setCustomField(assetId, customFieldId, params) {
|
|
110
130
|
return this.client.request({
|
|
111
131
|
method: "PUT",
|
package/dist/index.d.cts
CHANGED
|
@@ -88,6 +88,34 @@ interface AddVersionTagParams {
|
|
|
88
88
|
interface AssetVersionDownloadUrl {
|
|
89
89
|
url: string;
|
|
90
90
|
}
|
|
91
|
+
interface CdnLinkBase {
|
|
92
|
+
id: string;
|
|
93
|
+
url: string;
|
|
94
|
+
assetId: string;
|
|
95
|
+
active: boolean;
|
|
96
|
+
createdAt: string;
|
|
97
|
+
updatedAt: string;
|
|
98
|
+
}
|
|
99
|
+
type CdnLink = (CdnLinkBase & {
|
|
100
|
+
followsDefaultVersion: true;
|
|
101
|
+
versionId?: never;
|
|
102
|
+
}) | (CdnLinkBase & {
|
|
103
|
+
followsDefaultVersion: false;
|
|
104
|
+
versionId: string;
|
|
105
|
+
});
|
|
106
|
+
type AssetCdnLinkCreateParams = {
|
|
107
|
+
followsDefaultVersion: true;
|
|
108
|
+
versionId?: never;
|
|
109
|
+
} | {
|
|
110
|
+
versionId: string;
|
|
111
|
+
followsDefaultVersion?: never;
|
|
112
|
+
};
|
|
113
|
+
interface AssetCdnLinkUpdateParams {
|
|
114
|
+
active: boolean;
|
|
115
|
+
}
|
|
116
|
+
interface AssetCdnLinkListResponse {
|
|
117
|
+
data: CdnLink[];
|
|
118
|
+
}
|
|
91
119
|
interface AssetBoardListParams extends CursorPageParams {
|
|
92
120
|
includeCustomFields?: boolean;
|
|
93
121
|
}
|
|
@@ -166,6 +194,9 @@ declare class Assets {
|
|
|
166
194
|
list(params?: AssetListParams): PagePromise<Asset>;
|
|
167
195
|
get(assetId: string): Promise<Asset>;
|
|
168
196
|
delete(assetId: string): Promise<void>;
|
|
197
|
+
listCdnLinks(assetId: string): Promise<AssetCdnLinkListResponse>;
|
|
198
|
+
createCdnLink(assetId: string, params: AssetCdnLinkCreateParams): Promise<CdnLink>;
|
|
199
|
+
updateCdnLink(assetId: string, cdnLinkId: string, params: AssetCdnLinkUpdateParams): Promise<void>;
|
|
169
200
|
setCustomField(assetId: string, customFieldId: string, params: SetCustomFieldParams): Promise<void>;
|
|
170
201
|
listVersions(assetId: string): Promise<AssetVersionListResponse>;
|
|
171
202
|
getVersion(assetId: string, versionId: string): Promise<AssetVersion>;
|
|
@@ -483,4 +514,4 @@ declare class AirApi extends AirBase {
|
|
|
483
514
|
constructor(options?: AirApiOptions);
|
|
484
515
|
}
|
|
485
516
|
|
|
486
|
-
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 };
|
|
517
|
+
export { type AddBoardAssetsParams, type AddGuestParams, type AddVersionTagParams, AirApi, type AirApiOptions, type Asset, type AssetBoardListParams, type AssetCdnLinkCreateParams, type AssetCdnLinkListResponse, type AssetCdnLinkUpdateParams, 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 CdnLink, 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
|
@@ -88,6 +88,34 @@ interface AddVersionTagParams {
|
|
|
88
88
|
interface AssetVersionDownloadUrl {
|
|
89
89
|
url: string;
|
|
90
90
|
}
|
|
91
|
+
interface CdnLinkBase {
|
|
92
|
+
id: string;
|
|
93
|
+
url: string;
|
|
94
|
+
assetId: string;
|
|
95
|
+
active: boolean;
|
|
96
|
+
createdAt: string;
|
|
97
|
+
updatedAt: string;
|
|
98
|
+
}
|
|
99
|
+
type CdnLink = (CdnLinkBase & {
|
|
100
|
+
followsDefaultVersion: true;
|
|
101
|
+
versionId?: never;
|
|
102
|
+
}) | (CdnLinkBase & {
|
|
103
|
+
followsDefaultVersion: false;
|
|
104
|
+
versionId: string;
|
|
105
|
+
});
|
|
106
|
+
type AssetCdnLinkCreateParams = {
|
|
107
|
+
followsDefaultVersion: true;
|
|
108
|
+
versionId?: never;
|
|
109
|
+
} | {
|
|
110
|
+
versionId: string;
|
|
111
|
+
followsDefaultVersion?: never;
|
|
112
|
+
};
|
|
113
|
+
interface AssetCdnLinkUpdateParams {
|
|
114
|
+
active: boolean;
|
|
115
|
+
}
|
|
116
|
+
interface AssetCdnLinkListResponse {
|
|
117
|
+
data: CdnLink[];
|
|
118
|
+
}
|
|
91
119
|
interface AssetBoardListParams extends CursorPageParams {
|
|
92
120
|
includeCustomFields?: boolean;
|
|
93
121
|
}
|
|
@@ -166,6 +194,9 @@ declare class Assets {
|
|
|
166
194
|
list(params?: AssetListParams): PagePromise<Asset>;
|
|
167
195
|
get(assetId: string): Promise<Asset>;
|
|
168
196
|
delete(assetId: string): Promise<void>;
|
|
197
|
+
listCdnLinks(assetId: string): Promise<AssetCdnLinkListResponse>;
|
|
198
|
+
createCdnLink(assetId: string, params: AssetCdnLinkCreateParams): Promise<CdnLink>;
|
|
199
|
+
updateCdnLink(assetId: string, cdnLinkId: string, params: AssetCdnLinkUpdateParams): Promise<void>;
|
|
169
200
|
setCustomField(assetId: string, customFieldId: string, params: SetCustomFieldParams): Promise<void>;
|
|
170
201
|
listVersions(assetId: string): Promise<AssetVersionListResponse>;
|
|
171
202
|
getVersion(assetId: string, versionId: string): Promise<AssetVersion>;
|
|
@@ -483,4 +514,4 @@ declare class AirApi extends AirBase {
|
|
|
483
514
|
constructor(options?: AirApiOptions);
|
|
484
515
|
}
|
|
485
516
|
|
|
486
|
-
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 };
|
|
517
|
+
export { type AddBoardAssetsParams, type AddGuestParams, type AddVersionTagParams, AirApi, type AirApiOptions, type Asset, type AssetBoardListParams, type AssetCdnLinkCreateParams, type AssetCdnLinkListResponse, type AssetCdnLinkUpdateParams, 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 CdnLink, 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
|
@@ -45,6 +45,26 @@ var Assets = class {
|
|
|
45
45
|
path: `/assets/${assetId}`
|
|
46
46
|
});
|
|
47
47
|
}
|
|
48
|
+
async listCdnLinks(assetId) {
|
|
49
|
+
return this.client.request({
|
|
50
|
+
method: "GET",
|
|
51
|
+
path: `/assets/${assetId}/cdnLinks`
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
async createCdnLink(assetId, params) {
|
|
55
|
+
return this.client.request({
|
|
56
|
+
method: "POST",
|
|
57
|
+
path: `/assets/${assetId}/cdnLinks`,
|
|
58
|
+
body: params
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async updateCdnLink(assetId, cdnLinkId, params) {
|
|
62
|
+
return this.client.request({
|
|
63
|
+
method: "PATCH",
|
|
64
|
+
path: `/assets/${assetId}/cdnLinks/${cdnLinkId}`,
|
|
65
|
+
body: params
|
|
66
|
+
});
|
|
67
|
+
}
|
|
48
68
|
async setCustomField(assetId, customFieldId, params) {
|
|
49
69
|
return this.client.request({
|
|
50
70
|
method: "PUT",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@air/api-rest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.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.
|
|
32
|
+
"@air/api-core": "0.5.0"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
35
|
"node": ">=18"
|