@air/api-rest 0.5.1 → 0.7.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 +44 -0
- package/dist/index.d.cts +89 -2
- package/dist/index.d.ts +89 -2
- package/dist/index.js +44 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -22,6 +22,7 @@ npm install @air/api-rest
|
|
|
22
22
|
|
|
23
23
|
- Resource classes: `BoardsResource`, `AssetsResource`, `TagsResource`, `CustomFieldsResource`, `UploadsResource`, `ImportsResource`, `RolesResource`
|
|
24
24
|
- Asset CDN link helpers: `listCdnLinks`, `createCdnLink`, and `updateCdnLink`
|
|
25
|
+
- Share links: `listShareLinks`, `createShareLink`, and `updateShareLink` on assets and boards
|
|
25
26
|
- Full TypeScript types for all API request/response shapes
|
|
26
27
|
- `AirApi` client class that composes all resources
|
|
27
28
|
|
package/dist/index.cjs
CHANGED
|
@@ -171,6 +171,30 @@ var Assets = class {
|
|
|
171
171
|
path: `/assets/${assetId}/versions/${versionId}/tags/${tagId}`
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
|
+
listShareLinks(assetId, params = {}) {
|
|
175
|
+
const query = {
|
|
176
|
+
limit: params.limit,
|
|
177
|
+
cursor: params.cursor
|
|
178
|
+
};
|
|
179
|
+
return this.client.requestCursorPage(
|
|
180
|
+
{ method: "GET", path: `/assets/${assetId}/share-links`, query },
|
|
181
|
+
query
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
async createShareLink(assetId, params) {
|
|
185
|
+
return this.client.request({
|
|
186
|
+
method: "POST",
|
|
187
|
+
path: `/assets/${assetId}/share-links`,
|
|
188
|
+
body: params
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
async updateShareLink(assetId, shareLinkId, params) {
|
|
192
|
+
return this.client.request({
|
|
193
|
+
method: "PATCH",
|
|
194
|
+
path: `/assets/${assetId}/share-links/${shareLinkId}`,
|
|
195
|
+
body: params
|
|
196
|
+
});
|
|
197
|
+
}
|
|
174
198
|
listBoards(assetId, params = {}) {
|
|
175
199
|
const query = {
|
|
176
200
|
limit: params.limit,
|
|
@@ -251,6 +275,26 @@ var Boards = class {
|
|
|
251
275
|
body: params
|
|
252
276
|
});
|
|
253
277
|
}
|
|
278
|
+
async listShareLinks(boardId) {
|
|
279
|
+
return this.client.request({
|
|
280
|
+
method: "GET",
|
|
281
|
+
path: `/boards/${boardId}/share-links`
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
async createShareLink(boardId, params = {}) {
|
|
285
|
+
return this.client.request({
|
|
286
|
+
method: "POST",
|
|
287
|
+
path: `/boards/${boardId}/share-links`,
|
|
288
|
+
body: params
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
async updateShareLink(boardId, shareLinkId, params) {
|
|
292
|
+
return this.client.request({
|
|
293
|
+
method: "PATCH",
|
|
294
|
+
path: `/boards/${boardId}/share-links/${shareLinkId}`,
|
|
295
|
+
body: params
|
|
296
|
+
});
|
|
297
|
+
}
|
|
254
298
|
async addGuest(boardId, params) {
|
|
255
299
|
return this.client.request({
|
|
256
300
|
method: "POST",
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CursorPageParams, AirBase, PagePromise, AirBaseOptions } from '@air/api-core';
|
|
1
|
+
import { CursorPageParams, CursorPageResponse, AirBase, PagePromise, AirBaseOptions } from '@air/api-core';
|
|
2
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 {
|
|
@@ -188,6 +188,87 @@ interface GuestListResponse {
|
|
|
188
188
|
data: Guest[];
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
/** Visitor comment access on a share link. */
|
|
192
|
+
type ShareLinkCommentsAccess = "hidden" | "read_only" | "allowed";
|
|
193
|
+
/** Visitor custom field access on a share link. */
|
|
194
|
+
type ShareLinkCustomFieldsAccess = "hidden" | "read_only" | "editable";
|
|
195
|
+
/**
|
|
196
|
+
* Public share link fields shared by assets and boards.
|
|
197
|
+
* `url` is the link to give to people. The password is never returned;
|
|
198
|
+
* `hasPassword` says whether one is set. Disabled links are included
|
|
199
|
+
* with `active: false`.
|
|
200
|
+
*/
|
|
201
|
+
interface ShareLink {
|
|
202
|
+
id: string;
|
|
203
|
+
url: string;
|
|
204
|
+
active: boolean;
|
|
205
|
+
hasPassword: boolean;
|
|
206
|
+
expiresAt: string | null;
|
|
207
|
+
requireAccount: boolean;
|
|
208
|
+
allowDownload: boolean;
|
|
209
|
+
comments: ShareLinkCommentsAccess;
|
|
210
|
+
customFields: ShareLinkCustomFieldsAccess;
|
|
211
|
+
createdAt: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Asset share link. An asset can have one link that follows the current
|
|
215
|
+
* version and one link per pinned version. `versionId` is present only
|
|
216
|
+
* when the link is pinned to a version.
|
|
217
|
+
*/
|
|
218
|
+
type AssetShareLink = (ShareLink & {
|
|
219
|
+
followsDefaultVersion: true;
|
|
220
|
+
versionId?: never;
|
|
221
|
+
showAllVersions: boolean;
|
|
222
|
+
}) | (ShareLink & {
|
|
223
|
+
followsDefaultVersion: false;
|
|
224
|
+
versionId: string;
|
|
225
|
+
showAllVersions: boolean;
|
|
226
|
+
});
|
|
227
|
+
/** Board share link. A board has at most one. */
|
|
228
|
+
type BoardShareLink = ShareLink;
|
|
229
|
+
/**
|
|
230
|
+
* Pagination for `GET /assets/:assetId/share-links`.
|
|
231
|
+
* The API defaults `limit` to 12 and caps it at 200.
|
|
232
|
+
*/
|
|
233
|
+
type AssetShareLinkListParams = CursorPageParams;
|
|
234
|
+
/**
|
|
235
|
+
* Response for `GET /boards/:boardId/share-links`.
|
|
236
|
+
* `data` holds the board's share link, or is empty when the board has none.
|
|
237
|
+
*/
|
|
238
|
+
interface BoardShareLinkListResponse extends CursorPageResponse<BoardShareLink> {
|
|
239
|
+
total: number;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Settings accepted on share-link create and update.
|
|
243
|
+
* Omitted fields follow the workspace Share Link Defaults on create,
|
|
244
|
+
* and stay unchanged on update.
|
|
245
|
+
*/
|
|
246
|
+
interface ShareLinkWriteSettings {
|
|
247
|
+
active?: boolean;
|
|
248
|
+
allowDownload?: boolean;
|
|
249
|
+
}
|
|
250
|
+
/** Asset links also accept `showAllVersions`. */
|
|
251
|
+
interface AssetShareLinkWriteSettings extends ShareLinkWriteSettings {
|
|
252
|
+
showAllVersions?: boolean;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Body for `POST /assets/:assetId/share-links`.
|
|
256
|
+
* Exactly one of `followsDefaultVersion: true` or `versionId`.
|
|
257
|
+
*/
|
|
258
|
+
type AssetShareLinkCreateParams = AssetShareLinkWriteSettings & ({
|
|
259
|
+
followsDefaultVersion: true;
|
|
260
|
+
versionId?: never;
|
|
261
|
+
} | {
|
|
262
|
+
versionId: string;
|
|
263
|
+
followsDefaultVersion?: never;
|
|
264
|
+
});
|
|
265
|
+
/** Body for `PATCH /assets/:assetId/share-links/:shareLinkId`. */
|
|
266
|
+
type AssetShareLinkUpdateParams = AssetShareLinkWriteSettings;
|
|
267
|
+
/** Body for `POST /boards/:boardId/share-links`. */
|
|
268
|
+
type BoardShareLinkCreateParams = ShareLinkWriteSettings;
|
|
269
|
+
/** Body for `PATCH /boards/:boardId/share-links/:shareLinkId`. */
|
|
270
|
+
type BoardShareLinkUpdateParams = ShareLinkWriteSettings;
|
|
271
|
+
|
|
191
272
|
declare class Assets {
|
|
192
273
|
private client;
|
|
193
274
|
constructor(client: AirBase);
|
|
@@ -204,6 +285,9 @@ declare class Assets {
|
|
|
204
285
|
getVersionDownloadUrl(assetId: string, versionId: string): Promise<AssetVersionDownloadUrl>;
|
|
205
286
|
addVersionTag(assetId: string, versionId: string, params: AddVersionTagParams): Promise<AssetVersion>;
|
|
206
287
|
removeVersionTag(assetId: string, versionId: string, tagId: string): Promise<void>;
|
|
288
|
+
listShareLinks(assetId: string, params?: AssetShareLinkListParams): PagePromise<AssetShareLink>;
|
|
289
|
+
createShareLink(assetId: string, params: AssetShareLinkCreateParams): Promise<AssetShareLink>;
|
|
290
|
+
updateShareLink(assetId: string, shareLinkId: string, params: AssetShareLinkUpdateParams): Promise<void>;
|
|
207
291
|
listBoards(assetId: string, params?: AssetBoardListParams): PagePromise<Board>;
|
|
208
292
|
}
|
|
209
293
|
|
|
@@ -218,6 +302,9 @@ declare class Boards {
|
|
|
218
302
|
addAssets(boardId: string, params: AddBoardAssetsParams): Promise<void>;
|
|
219
303
|
removeAsset(boardId: string, assetId: string): Promise<void>;
|
|
220
304
|
setCustomField(boardId: string, customFieldId: string, params: SetBoardCustomFieldParams): Promise<void>;
|
|
305
|
+
listShareLinks(boardId: string): Promise<BoardShareLinkListResponse>;
|
|
306
|
+
createShareLink(boardId: string, params?: BoardShareLinkCreateParams): Promise<BoardShareLink>;
|
|
307
|
+
updateShareLink(boardId: string, shareLinkId: string, params: BoardShareLinkUpdateParams): Promise<void>;
|
|
221
308
|
addGuest(boardId: string, params: AddGuestParams): Promise<Guest>;
|
|
222
309
|
listGuests(boardId: string, params?: GuestListParams): Promise<Guest[]>;
|
|
223
310
|
updateGuest(boardId: string, guestId: string, params: UpdateGuestParams): Promise<void>;
|
|
@@ -514,4 +601,4 @@ declare class AirApi extends AirBase {
|
|
|
514
601
|
constructor(options?: AirApiOptions);
|
|
515
602
|
}
|
|
516
603
|
|
|
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 };
|
|
604
|
+
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 AssetShareLink, type AssetShareLinkCreateParams, type AssetShareLinkListParams, type AssetShareLinkUpdateParams, type AssetShareLinkWriteSettings, type AssetVersion, type AssetVersionDownloadUrl, type AssetVersionListResponse, type AssetVersionUpdateParams, type AssetVersionUrls, Assets, type Board, type BoardCreateParams, type BoardListParams, type BoardShareLink, type BoardShareLinkCreateParams, type BoardShareLinkListResponse, type BoardShareLinkUpdateParams, 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 ShareLink, type ShareLinkCommentsAccess, type ShareLinkCustomFieldsAccess, type ShareLinkWriteSettings, 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,4 +1,4 @@
|
|
|
1
|
-
import { CursorPageParams, AirBase, PagePromise, AirBaseOptions } from '@air/api-core';
|
|
1
|
+
import { CursorPageParams, CursorPageResponse, AirBase, PagePromise, AirBaseOptions } from '@air/api-core';
|
|
2
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 {
|
|
@@ -188,6 +188,87 @@ interface GuestListResponse {
|
|
|
188
188
|
data: Guest[];
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
/** Visitor comment access on a share link. */
|
|
192
|
+
type ShareLinkCommentsAccess = "hidden" | "read_only" | "allowed";
|
|
193
|
+
/** Visitor custom field access on a share link. */
|
|
194
|
+
type ShareLinkCustomFieldsAccess = "hidden" | "read_only" | "editable";
|
|
195
|
+
/**
|
|
196
|
+
* Public share link fields shared by assets and boards.
|
|
197
|
+
* `url` is the link to give to people. The password is never returned;
|
|
198
|
+
* `hasPassword` says whether one is set. Disabled links are included
|
|
199
|
+
* with `active: false`.
|
|
200
|
+
*/
|
|
201
|
+
interface ShareLink {
|
|
202
|
+
id: string;
|
|
203
|
+
url: string;
|
|
204
|
+
active: boolean;
|
|
205
|
+
hasPassword: boolean;
|
|
206
|
+
expiresAt: string | null;
|
|
207
|
+
requireAccount: boolean;
|
|
208
|
+
allowDownload: boolean;
|
|
209
|
+
comments: ShareLinkCommentsAccess;
|
|
210
|
+
customFields: ShareLinkCustomFieldsAccess;
|
|
211
|
+
createdAt: string;
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* Asset share link. An asset can have one link that follows the current
|
|
215
|
+
* version and one link per pinned version. `versionId` is present only
|
|
216
|
+
* when the link is pinned to a version.
|
|
217
|
+
*/
|
|
218
|
+
type AssetShareLink = (ShareLink & {
|
|
219
|
+
followsDefaultVersion: true;
|
|
220
|
+
versionId?: never;
|
|
221
|
+
showAllVersions: boolean;
|
|
222
|
+
}) | (ShareLink & {
|
|
223
|
+
followsDefaultVersion: false;
|
|
224
|
+
versionId: string;
|
|
225
|
+
showAllVersions: boolean;
|
|
226
|
+
});
|
|
227
|
+
/** Board share link. A board has at most one. */
|
|
228
|
+
type BoardShareLink = ShareLink;
|
|
229
|
+
/**
|
|
230
|
+
* Pagination for `GET /assets/:assetId/share-links`.
|
|
231
|
+
* The API defaults `limit` to 12 and caps it at 200.
|
|
232
|
+
*/
|
|
233
|
+
type AssetShareLinkListParams = CursorPageParams;
|
|
234
|
+
/**
|
|
235
|
+
* Response for `GET /boards/:boardId/share-links`.
|
|
236
|
+
* `data` holds the board's share link, or is empty when the board has none.
|
|
237
|
+
*/
|
|
238
|
+
interface BoardShareLinkListResponse extends CursorPageResponse<BoardShareLink> {
|
|
239
|
+
total: number;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Settings accepted on share-link create and update.
|
|
243
|
+
* Omitted fields follow the workspace Share Link Defaults on create,
|
|
244
|
+
* and stay unchanged on update.
|
|
245
|
+
*/
|
|
246
|
+
interface ShareLinkWriteSettings {
|
|
247
|
+
active?: boolean;
|
|
248
|
+
allowDownload?: boolean;
|
|
249
|
+
}
|
|
250
|
+
/** Asset links also accept `showAllVersions`. */
|
|
251
|
+
interface AssetShareLinkWriteSettings extends ShareLinkWriteSettings {
|
|
252
|
+
showAllVersions?: boolean;
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* Body for `POST /assets/:assetId/share-links`.
|
|
256
|
+
* Exactly one of `followsDefaultVersion: true` or `versionId`.
|
|
257
|
+
*/
|
|
258
|
+
type AssetShareLinkCreateParams = AssetShareLinkWriteSettings & ({
|
|
259
|
+
followsDefaultVersion: true;
|
|
260
|
+
versionId?: never;
|
|
261
|
+
} | {
|
|
262
|
+
versionId: string;
|
|
263
|
+
followsDefaultVersion?: never;
|
|
264
|
+
});
|
|
265
|
+
/** Body for `PATCH /assets/:assetId/share-links/:shareLinkId`. */
|
|
266
|
+
type AssetShareLinkUpdateParams = AssetShareLinkWriteSettings;
|
|
267
|
+
/** Body for `POST /boards/:boardId/share-links`. */
|
|
268
|
+
type BoardShareLinkCreateParams = ShareLinkWriteSettings;
|
|
269
|
+
/** Body for `PATCH /boards/:boardId/share-links/:shareLinkId`. */
|
|
270
|
+
type BoardShareLinkUpdateParams = ShareLinkWriteSettings;
|
|
271
|
+
|
|
191
272
|
declare class Assets {
|
|
192
273
|
private client;
|
|
193
274
|
constructor(client: AirBase);
|
|
@@ -204,6 +285,9 @@ declare class Assets {
|
|
|
204
285
|
getVersionDownloadUrl(assetId: string, versionId: string): Promise<AssetVersionDownloadUrl>;
|
|
205
286
|
addVersionTag(assetId: string, versionId: string, params: AddVersionTagParams): Promise<AssetVersion>;
|
|
206
287
|
removeVersionTag(assetId: string, versionId: string, tagId: string): Promise<void>;
|
|
288
|
+
listShareLinks(assetId: string, params?: AssetShareLinkListParams): PagePromise<AssetShareLink>;
|
|
289
|
+
createShareLink(assetId: string, params: AssetShareLinkCreateParams): Promise<AssetShareLink>;
|
|
290
|
+
updateShareLink(assetId: string, shareLinkId: string, params: AssetShareLinkUpdateParams): Promise<void>;
|
|
207
291
|
listBoards(assetId: string, params?: AssetBoardListParams): PagePromise<Board>;
|
|
208
292
|
}
|
|
209
293
|
|
|
@@ -218,6 +302,9 @@ declare class Boards {
|
|
|
218
302
|
addAssets(boardId: string, params: AddBoardAssetsParams): Promise<void>;
|
|
219
303
|
removeAsset(boardId: string, assetId: string): Promise<void>;
|
|
220
304
|
setCustomField(boardId: string, customFieldId: string, params: SetBoardCustomFieldParams): Promise<void>;
|
|
305
|
+
listShareLinks(boardId: string): Promise<BoardShareLinkListResponse>;
|
|
306
|
+
createShareLink(boardId: string, params?: BoardShareLinkCreateParams): Promise<BoardShareLink>;
|
|
307
|
+
updateShareLink(boardId: string, shareLinkId: string, params: BoardShareLinkUpdateParams): Promise<void>;
|
|
221
308
|
addGuest(boardId: string, params: AddGuestParams): Promise<Guest>;
|
|
222
309
|
listGuests(boardId: string, params?: GuestListParams): Promise<Guest[]>;
|
|
223
310
|
updateGuest(boardId: string, guestId: string, params: UpdateGuestParams): Promise<void>;
|
|
@@ -514,4 +601,4 @@ declare class AirApi extends AirBase {
|
|
|
514
601
|
constructor(options?: AirApiOptions);
|
|
515
602
|
}
|
|
516
603
|
|
|
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 };
|
|
604
|
+
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 AssetShareLink, type AssetShareLinkCreateParams, type AssetShareLinkListParams, type AssetShareLinkUpdateParams, type AssetShareLinkWriteSettings, type AssetVersion, type AssetVersionDownloadUrl, type AssetVersionListResponse, type AssetVersionUpdateParams, type AssetVersionUrls, Assets, type Board, type BoardCreateParams, type BoardListParams, type BoardShareLink, type BoardShareLinkCreateParams, type BoardShareLinkListResponse, type BoardShareLinkUpdateParams, 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 ShareLink, type ShareLinkCommentsAccess, type ShareLinkCustomFieldsAccess, type ShareLinkWriteSettings, 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
|
@@ -110,6 +110,30 @@ var Assets = class {
|
|
|
110
110
|
path: `/assets/${assetId}/versions/${versionId}/tags/${tagId}`
|
|
111
111
|
});
|
|
112
112
|
}
|
|
113
|
+
listShareLinks(assetId, params = {}) {
|
|
114
|
+
const query = {
|
|
115
|
+
limit: params.limit,
|
|
116
|
+
cursor: params.cursor
|
|
117
|
+
};
|
|
118
|
+
return this.client.requestCursorPage(
|
|
119
|
+
{ method: "GET", path: `/assets/${assetId}/share-links`, query },
|
|
120
|
+
query
|
|
121
|
+
);
|
|
122
|
+
}
|
|
123
|
+
async createShareLink(assetId, params) {
|
|
124
|
+
return this.client.request({
|
|
125
|
+
method: "POST",
|
|
126
|
+
path: `/assets/${assetId}/share-links`,
|
|
127
|
+
body: params
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
async updateShareLink(assetId, shareLinkId, params) {
|
|
131
|
+
return this.client.request({
|
|
132
|
+
method: "PATCH",
|
|
133
|
+
path: `/assets/${assetId}/share-links/${shareLinkId}`,
|
|
134
|
+
body: params
|
|
135
|
+
});
|
|
136
|
+
}
|
|
113
137
|
listBoards(assetId, params = {}) {
|
|
114
138
|
const query = {
|
|
115
139
|
limit: params.limit,
|
|
@@ -190,6 +214,26 @@ var Boards = class {
|
|
|
190
214
|
body: params
|
|
191
215
|
});
|
|
192
216
|
}
|
|
217
|
+
async listShareLinks(boardId) {
|
|
218
|
+
return this.client.request({
|
|
219
|
+
method: "GET",
|
|
220
|
+
path: `/boards/${boardId}/share-links`
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
async createShareLink(boardId, params = {}) {
|
|
224
|
+
return this.client.request({
|
|
225
|
+
method: "POST",
|
|
226
|
+
path: `/boards/${boardId}/share-links`,
|
|
227
|
+
body: params
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
async updateShareLink(boardId, shareLinkId, params) {
|
|
231
|
+
return this.client.request({
|
|
232
|
+
method: "PATCH",
|
|
233
|
+
path: `/boards/${boardId}/share-links/${shareLinkId}`,
|
|
234
|
+
body: params
|
|
235
|
+
});
|
|
236
|
+
}
|
|
193
237
|
async addGuest(boardId, params) {
|
|
194
238
|
return this.client.request({
|
|
195
239
|
method: "POST",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@air/api-rest",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.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.7.0"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|
|
35
35
|
"node": ">=18"
|