@athenaintel/sdk 4.3.2242 → 4.3.2243
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/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/assets/client/Client.d.ts +20 -0
- package/dist/cjs/api/resources/assets/client/Client.js +90 -0
- package/dist/cjs/api/resources/assets/client/requests/ConvertToUserInterfaceAssetsRequest.d.ts +10 -0
- package/dist/cjs/api/resources/assets/client/requests/ConvertToUserInterfaceAssetsRequest.js +3 -0
- package/dist/cjs/api/resources/assets/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/ConvertToUserInterfaceResponseOut.d.ts +17 -0
- package/dist/cjs/api/types/ConvertToUserInterfaceResponseOut.js +3 -0
- package/dist/cjs/api/types/index.d.ts +1 -0
- package/dist/cjs/api/types/index.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/assets/client/Client.d.mts +20 -0
- package/dist/esm/api/resources/assets/client/Client.mjs +90 -0
- package/dist/esm/api/resources/assets/client/requests/ConvertToUserInterfaceAssetsRequest.d.mts +10 -0
- package/dist/esm/api/resources/assets/client/requests/ConvertToUserInterfaceAssetsRequest.mjs +2 -0
- package/dist/esm/api/resources/assets/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/ConvertToUserInterfaceResponseOut.d.mts +17 -0
- package/dist/esm/api/types/ConvertToUserInterfaceResponseOut.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +1 -0
- package/dist/esm/api/types/index.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +65 -0
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
|
|
|
43
43
|
const headers = (0, headers_js_1.mergeHeaders)({
|
|
44
44
|
"X-Fern-Language": "JavaScript",
|
|
45
45
|
"X-Fern-SDK-Name": "@athenaintel/sdk",
|
|
46
|
-
"X-Fern-SDK-Version": "4.3.
|
|
47
|
-
"User-Agent": "@athenaintel/sdk/4.3.
|
|
46
|
+
"X-Fern-SDK-Version": "4.3.2243",
|
|
47
|
+
"User-Agent": "@athenaintel/sdk/4.3.2243",
|
|
48
48
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
49
49
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
50
50
|
"X-Athena-Session-Credential": options === null || options === void 0 ? void 0 : options.sessionCredential,
|
|
@@ -254,6 +254,26 @@ export declare class AssetsClient {
|
|
|
254
254
|
*/
|
|
255
255
|
createCollabToken(request: AthenaIntelligence.CollabTokenRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.CollabTokenResponse>;
|
|
256
256
|
private __createCollabToken;
|
|
257
|
+
/**
|
|
258
|
+
* Turn an uploaded HTML file into a user interface (an app) under its own id — the conversion the Athena app's Convert to user interface performs. The asset keeps its id, folder, links and sharing (its title drops the .html extension), and no second asset is created. An uploaded HTML file stays a file until a request like this one asks: nothing converts on its own. The switch is one-way; the original upload stays downloadable from the asset's Versions pane. Requires edit access to the file. Idempotent: an asset that already is a user interface is answered as it is, with converted false. A refused conversion answers with a detail object: code CONVERSION_REFUSED, the reason, and a message saying why.
|
|
259
|
+
*
|
|
260
|
+
* @param {AthenaIntelligence.ConvertToUserInterfaceAssetsRequest} request
|
|
261
|
+
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
262
|
+
*
|
|
263
|
+
* @throws {@link AthenaIntelligence.BadRequestError}
|
|
264
|
+
* @throws {@link AthenaIntelligence.ForbiddenError}
|
|
265
|
+
* @throws {@link AthenaIntelligence.NotFoundError}
|
|
266
|
+
* @throws {@link AthenaIntelligence.ConflictError}
|
|
267
|
+
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
268
|
+
* @throws {@link AthenaIntelligence.ServiceUnavailableError}
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* await client.assets.convertToUserInterface({
|
|
272
|
+
* asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
|
|
273
|
+
* })
|
|
274
|
+
*/
|
|
275
|
+
convertToUserInterface(request: AthenaIntelligence.ConvertToUserInterfaceAssetsRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ConvertToUserInterfaceResponseOut>;
|
|
276
|
+
private __convertToUserInterface;
|
|
257
277
|
/**
|
|
258
278
|
* Download an asset's file exactly as Athena stores or serves it — no type coercion, no pagination. Native collaborative assets are converted from live content to their canonical Office format: Athena documents download as .docx, spreadsheets as .xlsx (round-trip faithful — string identifiers, leading zeros, and number formats are preserved), PPTX Studio presentations and Word documents export their live studio content as .pptx/.docx. Uploaded files stream their original bytes. The response sets Content-Disposition with a filename derived from the asset title and media type. With `live_sync=true`, a spreadsheet's .xlsx, a PPTX Studio presentation's .pptx or a Word document's .docx also carries the Athena for Microsoft 365 add-in's link record, so opening it in Excel, PowerPoint or Word with the add-in installed starts syncing it with the asset; other asset types ignore the flag.
|
|
259
279
|
* @throws {@link AthenaIntelligence.BadRequestError}
|
|
@@ -1138,6 +1138,96 @@ class AssetsClient {
|
|
|
1138
1138
|
}
|
|
1139
1139
|
});
|
|
1140
1140
|
}
|
|
1141
|
+
/**
|
|
1142
|
+
* Turn an uploaded HTML file into a user interface (an app) under its own id — the conversion the Athena app's Convert to user interface performs. The asset keeps its id, folder, links and sharing (its title drops the .html extension), and no second asset is created. An uploaded HTML file stays a file until a request like this one asks: nothing converts on its own. The switch is one-way; the original upload stays downloadable from the asset's Versions pane. Requires edit access to the file. Idempotent: an asset that already is a user interface is answered as it is, with converted false. A refused conversion answers with a detail object: code CONVERSION_REFUSED, the reason, and a message saying why.
|
|
1143
|
+
*
|
|
1144
|
+
* @param {AthenaIntelligence.ConvertToUserInterfaceAssetsRequest} request
|
|
1145
|
+
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1146
|
+
*
|
|
1147
|
+
* @throws {@link AthenaIntelligence.BadRequestError}
|
|
1148
|
+
* @throws {@link AthenaIntelligence.ForbiddenError}
|
|
1149
|
+
* @throws {@link AthenaIntelligence.NotFoundError}
|
|
1150
|
+
* @throws {@link AthenaIntelligence.ConflictError}
|
|
1151
|
+
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
1152
|
+
* @throws {@link AthenaIntelligence.ServiceUnavailableError}
|
|
1153
|
+
*
|
|
1154
|
+
* @example
|
|
1155
|
+
* await client.assets.convertToUserInterface({
|
|
1156
|
+
* asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
|
|
1157
|
+
* })
|
|
1158
|
+
*/
|
|
1159
|
+
convertToUserInterface(request, requestOptions) {
|
|
1160
|
+
return core.HttpResponsePromise.fromPromise(this.__convertToUserInterface(request, requestOptions));
|
|
1161
|
+
}
|
|
1162
|
+
__convertToUserInterface(request, requestOptions) {
|
|
1163
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1164
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1165
|
+
const { asset_id: assetId } = request;
|
|
1166
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1167
|
+
const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
|
|
1168
|
+
"X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
|
|
1169
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1170
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
1171
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/assets/${core.url.encodePathParam(assetId)}/convert-to-user-interface`),
|
|
1172
|
+
method: "POST",
|
|
1173
|
+
headers: _headers,
|
|
1174
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1175
|
+
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1176
|
+
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1177
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1178
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1179
|
+
logging: this._options.logging,
|
|
1180
|
+
});
|
|
1181
|
+
if (_response.ok) {
|
|
1182
|
+
return {
|
|
1183
|
+
data: _response.body,
|
|
1184
|
+
rawResponse: _response.rawResponse,
|
|
1185
|
+
};
|
|
1186
|
+
}
|
|
1187
|
+
if (_response.error.reason === "status-code") {
|
|
1188
|
+
switch (_response.error.statusCode) {
|
|
1189
|
+
case 400:
|
|
1190
|
+
throw new AthenaIntelligence.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1191
|
+
case 403:
|
|
1192
|
+
throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1193
|
+
case 404:
|
|
1194
|
+
throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1195
|
+
case 409:
|
|
1196
|
+
throw new AthenaIntelligence.ConflictError(_response.error.body, _response.rawResponse);
|
|
1197
|
+
case 422:
|
|
1198
|
+
throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1199
|
+
case 503:
|
|
1200
|
+
throw new AthenaIntelligence.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
1201
|
+
default:
|
|
1202
|
+
throw new errors.AthenaIntelligenceError({
|
|
1203
|
+
statusCode: _response.error.statusCode,
|
|
1204
|
+
body: _response.error.body,
|
|
1205
|
+
rawResponse: _response.rawResponse,
|
|
1206
|
+
});
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
switch (_response.error.reason) {
|
|
1210
|
+
case "non-json":
|
|
1211
|
+
throw new errors.AthenaIntelligenceError({
|
|
1212
|
+
statusCode: _response.error.statusCode,
|
|
1213
|
+
body: _response.error.rawBody,
|
|
1214
|
+
rawResponse: _response.rawResponse,
|
|
1215
|
+
});
|
|
1216
|
+
case "body-is-null":
|
|
1217
|
+
throw new errors.AthenaIntelligenceError({
|
|
1218
|
+
statusCode: _response.error.statusCode,
|
|
1219
|
+
rawResponse: _response.rawResponse,
|
|
1220
|
+
});
|
|
1221
|
+
case "timeout":
|
|
1222
|
+
throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/assets/{asset_id}/convert-to-user-interface.");
|
|
1223
|
+
case "unknown":
|
|
1224
|
+
throw new errors.AthenaIntelligenceError({
|
|
1225
|
+
message: _response.error.errorMessage,
|
|
1226
|
+
rawResponse: _response.rawResponse,
|
|
1227
|
+
});
|
|
1228
|
+
}
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1141
1231
|
/**
|
|
1142
1232
|
* Download an asset's file exactly as Athena stores or serves it — no type coercion, no pagination. Native collaborative assets are converted from live content to their canonical Office format: Athena documents download as .docx, spreadsheets as .xlsx (round-trip faithful — string identifiers, leading zeros, and number formats are preserved), PPTX Studio presentations and Word documents export their live studio content as .pptx/.docx. Uploaded files stream their original bytes. The response sets Content-Disposition with a filename derived from the asset title and media type. With `live_sync=true`, a spreadsheet's .xlsx, a PPTX Studio presentation's .pptx or a Word document's .docx also carries the Athena for Microsoft 365 add-in's link record, so opening it in Excel, PowerPoint or Word with the add-in installed starts syncing it with the asset; other asset types ignore the flag.
|
|
1143
1233
|
* @throws {@link AthenaIntelligence.BadRequestError}
|
|
@@ -2,6 +2,7 @@ export type { ArchiveAssetsRequest } from "./ArchiveAssetsRequest.js";
|
|
|
2
2
|
export type { AssetActivityDeltaBatchRequestIn } from "./AssetActivityDeltaBatchRequestIn.js";
|
|
3
3
|
export type { CollabTokenRequest } from "./CollabTokenRequest.js";
|
|
4
4
|
export type { ConvertExcelToSheetRequestIn } from "./ConvertExcelToSheetRequestIn.js";
|
|
5
|
+
export type { ConvertToUserInterfaceAssetsRequest } from "./ConvertToUserInterfaceAssetsRequest.js";
|
|
5
6
|
export type { CreateAssetRequestIn } from "./CreateAssetRequestIn.js";
|
|
6
7
|
export type { CreateProjectRequestIn } from "./CreateProjectRequestIn.js";
|
|
7
8
|
export type { DownloadAssetsRequest } from "./DownloadAssetsRequest.js";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response model for turning an uploaded HTML file into a user interface.
|
|
3
|
+
*/
|
|
4
|
+
export interface ConvertToUserInterfaceResponseOut {
|
|
5
|
+
/** ID of the user interface: the HTML file's own id, which it keeps (no second asset is created) */
|
|
6
|
+
asset_id: string;
|
|
7
|
+
/** Type of the asset after the request: user_interface */
|
|
8
|
+
asset_type: string;
|
|
9
|
+
/** True when this request converted the file; false when the asset already was a user interface, in which case nothing changed */
|
|
10
|
+
converted: boolean;
|
|
11
|
+
/** ID of the asset's parent folder, which the conversion keeps */
|
|
12
|
+
parent_folder_id?: string | null;
|
|
13
|
+
/** Title of the user interface */
|
|
14
|
+
title: string;
|
|
15
|
+
/** ID of the workspace that owns the asset */
|
|
16
|
+
workspace_id?: string | null;
|
|
17
|
+
}
|
|
@@ -45,6 +45,7 @@ export * from "./ConversationAssetInfo.js";
|
|
|
45
45
|
export * from "./ConversationMessage.js";
|
|
46
46
|
export * from "./ConversationResult.js";
|
|
47
47
|
export * from "./ConvertExcelToSheetResponseOut.js";
|
|
48
|
+
export * from "./ConvertToUserInterfaceResponseOut.js";
|
|
48
49
|
export * from "./CreatableAssetType.js";
|
|
49
50
|
export * from "./CreateAssetResponseOut.js";
|
|
50
51
|
export * from "./CreateNewSheetTabResponse.js";
|
|
@@ -61,6 +61,7 @@ __exportStar(require("./ConversationAssetInfo.js"), exports);
|
|
|
61
61
|
__exportStar(require("./ConversationMessage.js"), exports);
|
|
62
62
|
__exportStar(require("./ConversationResult.js"), exports);
|
|
63
63
|
__exportStar(require("./ConvertExcelToSheetResponseOut.js"), exports);
|
|
64
|
+
__exportStar(require("./ConvertToUserInterfaceResponseOut.js"), exports);
|
|
64
65
|
__exportStar(require("./CreatableAssetType.js"), exports);
|
|
65
66
|
__exportStar(require("./CreateAssetResponseOut.js"), exports);
|
|
66
67
|
__exportStar(require("./CreateNewSheetTabResponse.js"), exports);
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.3.
|
|
1
|
+
export declare const SDK_VERSION = "4.3.2243";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
|
|
|
6
6
|
const headers = mergeHeaders({
|
|
7
7
|
"X-Fern-Language": "JavaScript",
|
|
8
8
|
"X-Fern-SDK-Name": "@athenaintel/sdk",
|
|
9
|
-
"X-Fern-SDK-Version": "4.3.
|
|
10
|
-
"User-Agent": "@athenaintel/sdk/4.3.
|
|
9
|
+
"X-Fern-SDK-Version": "4.3.2243",
|
|
10
|
+
"User-Agent": "@athenaintel/sdk/4.3.2243",
|
|
11
11
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
12
12
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
13
13
|
"X-Athena-Session-Credential": options === null || options === void 0 ? void 0 : options.sessionCredential,
|
|
@@ -254,6 +254,26 @@ export declare class AssetsClient {
|
|
|
254
254
|
*/
|
|
255
255
|
createCollabToken(request: AthenaIntelligence.CollabTokenRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.CollabTokenResponse>;
|
|
256
256
|
private __createCollabToken;
|
|
257
|
+
/**
|
|
258
|
+
* Turn an uploaded HTML file into a user interface (an app) under its own id — the conversion the Athena app's Convert to user interface performs. The asset keeps its id, folder, links and sharing (its title drops the .html extension), and no second asset is created. An uploaded HTML file stays a file until a request like this one asks: nothing converts on its own. The switch is one-way; the original upload stays downloadable from the asset's Versions pane. Requires edit access to the file. Idempotent: an asset that already is a user interface is answered as it is, with converted false. A refused conversion answers with a detail object: code CONVERSION_REFUSED, the reason, and a message saying why.
|
|
259
|
+
*
|
|
260
|
+
* @param {AthenaIntelligence.ConvertToUserInterfaceAssetsRequest} request
|
|
261
|
+
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
262
|
+
*
|
|
263
|
+
* @throws {@link AthenaIntelligence.BadRequestError}
|
|
264
|
+
* @throws {@link AthenaIntelligence.ForbiddenError}
|
|
265
|
+
* @throws {@link AthenaIntelligence.NotFoundError}
|
|
266
|
+
* @throws {@link AthenaIntelligence.ConflictError}
|
|
267
|
+
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
268
|
+
* @throws {@link AthenaIntelligence.ServiceUnavailableError}
|
|
269
|
+
*
|
|
270
|
+
* @example
|
|
271
|
+
* await client.assets.convertToUserInterface({
|
|
272
|
+
* asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
|
|
273
|
+
* })
|
|
274
|
+
*/
|
|
275
|
+
convertToUserInterface(request: AthenaIntelligence.ConvertToUserInterfaceAssetsRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ConvertToUserInterfaceResponseOut>;
|
|
276
|
+
private __convertToUserInterface;
|
|
257
277
|
/**
|
|
258
278
|
* Download an asset's file exactly as Athena stores or serves it — no type coercion, no pagination. Native collaborative assets are converted from live content to their canonical Office format: Athena documents download as .docx, spreadsheets as .xlsx (round-trip faithful — string identifiers, leading zeros, and number formats are preserved), PPTX Studio presentations and Word documents export their live studio content as .pptx/.docx. Uploaded files stream their original bytes. The response sets Content-Disposition with a filename derived from the asset title and media type. With `live_sync=true`, a spreadsheet's .xlsx, a PPTX Studio presentation's .pptx or a Word document's .docx also carries the Athena for Microsoft 365 add-in's link record, so opening it in Excel, PowerPoint or Word with the add-in installed starts syncing it with the asset; other asset types ignore the flag.
|
|
259
279
|
* @throws {@link AthenaIntelligence.BadRequestError}
|
|
@@ -1102,6 +1102,96 @@ export class AssetsClient {
|
|
|
1102
1102
|
}
|
|
1103
1103
|
});
|
|
1104
1104
|
}
|
|
1105
|
+
/**
|
|
1106
|
+
* Turn an uploaded HTML file into a user interface (an app) under its own id — the conversion the Athena app's Convert to user interface performs. The asset keeps its id, folder, links and sharing (its title drops the .html extension), and no second asset is created. An uploaded HTML file stays a file until a request like this one asks: nothing converts on its own. The switch is one-way; the original upload stays downloadable from the asset's Versions pane. Requires edit access to the file. Idempotent: an asset that already is a user interface is answered as it is, with converted false. A refused conversion answers with a detail object: code CONVERSION_REFUSED, the reason, and a message saying why.
|
|
1107
|
+
*
|
|
1108
|
+
* @param {AthenaIntelligence.ConvertToUserInterfaceAssetsRequest} request
|
|
1109
|
+
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
1110
|
+
*
|
|
1111
|
+
* @throws {@link AthenaIntelligence.BadRequestError}
|
|
1112
|
+
* @throws {@link AthenaIntelligence.ForbiddenError}
|
|
1113
|
+
* @throws {@link AthenaIntelligence.NotFoundError}
|
|
1114
|
+
* @throws {@link AthenaIntelligence.ConflictError}
|
|
1115
|
+
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
1116
|
+
* @throws {@link AthenaIntelligence.ServiceUnavailableError}
|
|
1117
|
+
*
|
|
1118
|
+
* @example
|
|
1119
|
+
* await client.assets.convertToUserInterface({
|
|
1120
|
+
* asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
|
|
1121
|
+
* })
|
|
1122
|
+
*/
|
|
1123
|
+
convertToUserInterface(request, requestOptions) {
|
|
1124
|
+
return core.HttpResponsePromise.fromPromise(this.__convertToUserInterface(request, requestOptions));
|
|
1125
|
+
}
|
|
1126
|
+
__convertToUserInterface(request, requestOptions) {
|
|
1127
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
1128
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
1129
|
+
const { asset_id: assetId } = request;
|
|
1130
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
1131
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
1132
|
+
"X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
|
|
1133
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
1134
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
1135
|
+
url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/assets/${core.url.encodePathParam(assetId)}/convert-to-user-interface`),
|
|
1136
|
+
method: "POST",
|
|
1137
|
+
headers: _headers,
|
|
1138
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
1139
|
+
timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
|
|
1140
|
+
maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
|
|
1141
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1142
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
1143
|
+
logging: this._options.logging,
|
|
1144
|
+
});
|
|
1145
|
+
if (_response.ok) {
|
|
1146
|
+
return {
|
|
1147
|
+
data: _response.body,
|
|
1148
|
+
rawResponse: _response.rawResponse,
|
|
1149
|
+
};
|
|
1150
|
+
}
|
|
1151
|
+
if (_response.error.reason === "status-code") {
|
|
1152
|
+
switch (_response.error.statusCode) {
|
|
1153
|
+
case 400:
|
|
1154
|
+
throw new AthenaIntelligence.BadRequestError(_response.error.body, _response.rawResponse);
|
|
1155
|
+
case 403:
|
|
1156
|
+
throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
1157
|
+
case 404:
|
|
1158
|
+
throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
|
|
1159
|
+
case 409:
|
|
1160
|
+
throw new AthenaIntelligence.ConflictError(_response.error.body, _response.rawResponse);
|
|
1161
|
+
case 422:
|
|
1162
|
+
throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
1163
|
+
case 503:
|
|
1164
|
+
throw new AthenaIntelligence.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
1165
|
+
default:
|
|
1166
|
+
throw new errors.AthenaIntelligenceError({
|
|
1167
|
+
statusCode: _response.error.statusCode,
|
|
1168
|
+
body: _response.error.body,
|
|
1169
|
+
rawResponse: _response.rawResponse,
|
|
1170
|
+
});
|
|
1171
|
+
}
|
|
1172
|
+
}
|
|
1173
|
+
switch (_response.error.reason) {
|
|
1174
|
+
case "non-json":
|
|
1175
|
+
throw new errors.AthenaIntelligenceError({
|
|
1176
|
+
statusCode: _response.error.statusCode,
|
|
1177
|
+
body: _response.error.rawBody,
|
|
1178
|
+
rawResponse: _response.rawResponse,
|
|
1179
|
+
});
|
|
1180
|
+
case "body-is-null":
|
|
1181
|
+
throw new errors.AthenaIntelligenceError({
|
|
1182
|
+
statusCode: _response.error.statusCode,
|
|
1183
|
+
rawResponse: _response.rawResponse,
|
|
1184
|
+
});
|
|
1185
|
+
case "timeout":
|
|
1186
|
+
throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/assets/{asset_id}/convert-to-user-interface.");
|
|
1187
|
+
case "unknown":
|
|
1188
|
+
throw new errors.AthenaIntelligenceError({
|
|
1189
|
+
message: _response.error.errorMessage,
|
|
1190
|
+
rawResponse: _response.rawResponse,
|
|
1191
|
+
});
|
|
1192
|
+
}
|
|
1193
|
+
});
|
|
1194
|
+
}
|
|
1105
1195
|
/**
|
|
1106
1196
|
* Download an asset's file exactly as Athena stores or serves it — no type coercion, no pagination. Native collaborative assets are converted from live content to their canonical Office format: Athena documents download as .docx, spreadsheets as .xlsx (round-trip faithful — string identifiers, leading zeros, and number formats are preserved), PPTX Studio presentations and Word documents export their live studio content as .pptx/.docx. Uploaded files stream their original bytes. The response sets Content-Disposition with a filename derived from the asset title and media type. With `live_sync=true`, a spreadsheet's .xlsx, a PPTX Studio presentation's .pptx or a Word document's .docx also carries the Athena for Microsoft 365 add-in's link record, so opening it in Excel, PowerPoint or Word with the add-in installed starts syncing it with the asset; other asset types ignore the flag.
|
|
1107
1197
|
* @throws {@link AthenaIntelligence.BadRequestError}
|
|
@@ -2,6 +2,7 @@ export type { ArchiveAssetsRequest } from "./ArchiveAssetsRequest.mjs";
|
|
|
2
2
|
export type { AssetActivityDeltaBatchRequestIn } from "./AssetActivityDeltaBatchRequestIn.mjs";
|
|
3
3
|
export type { CollabTokenRequest } from "./CollabTokenRequest.mjs";
|
|
4
4
|
export type { ConvertExcelToSheetRequestIn } from "./ConvertExcelToSheetRequestIn.mjs";
|
|
5
|
+
export type { ConvertToUserInterfaceAssetsRequest } from "./ConvertToUserInterfaceAssetsRequest.mjs";
|
|
5
6
|
export type { CreateAssetRequestIn } from "./CreateAssetRequestIn.mjs";
|
|
6
7
|
export type { CreateProjectRequestIn } from "./CreateProjectRequestIn.mjs";
|
|
7
8
|
export type { DownloadAssetsRequest } from "./DownloadAssetsRequest.mjs";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Response model for turning an uploaded HTML file into a user interface.
|
|
3
|
+
*/
|
|
4
|
+
export interface ConvertToUserInterfaceResponseOut {
|
|
5
|
+
/** ID of the user interface: the HTML file's own id, which it keeps (no second asset is created) */
|
|
6
|
+
asset_id: string;
|
|
7
|
+
/** Type of the asset after the request: user_interface */
|
|
8
|
+
asset_type: string;
|
|
9
|
+
/** True when this request converted the file; false when the asset already was a user interface, in which case nothing changed */
|
|
10
|
+
converted: boolean;
|
|
11
|
+
/** ID of the asset's parent folder, which the conversion keeps */
|
|
12
|
+
parent_folder_id?: string | null;
|
|
13
|
+
/** Title of the user interface */
|
|
14
|
+
title: string;
|
|
15
|
+
/** ID of the workspace that owns the asset */
|
|
16
|
+
workspace_id?: string | null;
|
|
17
|
+
}
|
|
@@ -45,6 +45,7 @@ export * from "./ConversationAssetInfo.mjs";
|
|
|
45
45
|
export * from "./ConversationMessage.mjs";
|
|
46
46
|
export * from "./ConversationResult.mjs";
|
|
47
47
|
export * from "./ConvertExcelToSheetResponseOut.mjs";
|
|
48
|
+
export * from "./ConvertToUserInterfaceResponseOut.mjs";
|
|
48
49
|
export * from "./CreatableAssetType.mjs";
|
|
49
50
|
export * from "./CreateAssetResponseOut.mjs";
|
|
50
51
|
export * from "./CreateNewSheetTabResponse.mjs";
|
|
@@ -45,6 +45,7 @@ export * from "./ConversationAssetInfo.mjs";
|
|
|
45
45
|
export * from "./ConversationMessage.mjs";
|
|
46
46
|
export * from "./ConversationResult.mjs";
|
|
47
47
|
export * from "./ConvertExcelToSheetResponseOut.mjs";
|
|
48
|
+
export * from "./ConvertToUserInterfaceResponseOut.mjs";
|
|
48
49
|
export * from "./CreatableAssetType.mjs";
|
|
49
50
|
export * from "./CreateAssetResponseOut.mjs";
|
|
50
51
|
export * from "./CreateNewSheetTabResponse.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "4.3.
|
|
1
|
+
export declare const SDK_VERSION = "4.3.2243";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.3.
|
|
1
|
+
export const SDK_VERSION = "4.3.2243";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -1307,6 +1307,71 @@ await client.assets.createCollabToken({
|
|
|
1307
1307
|
</dl>
|
|
1308
1308
|
|
|
1309
1309
|
|
|
1310
|
+
</dd>
|
|
1311
|
+
</dl>
|
|
1312
|
+
</details>
|
|
1313
|
+
|
|
1314
|
+
<details><summary><code>client.assets.<a href="/src/api/resources/assets/client/Client.ts">convertToUserInterface</a>({ ...params }) -> AthenaIntelligence.ConvertToUserInterfaceResponseOut</code></summary>
|
|
1315
|
+
<dl>
|
|
1316
|
+
<dd>
|
|
1317
|
+
|
|
1318
|
+
#### 📝 Description
|
|
1319
|
+
|
|
1320
|
+
<dl>
|
|
1321
|
+
<dd>
|
|
1322
|
+
|
|
1323
|
+
<dl>
|
|
1324
|
+
<dd>
|
|
1325
|
+
|
|
1326
|
+
Turn an uploaded HTML file into a user interface (an app) under its own id — the conversion the Athena app's Convert to user interface performs. The asset keeps its id, folder, links and sharing (its title drops the .html extension), and no second asset is created. An uploaded HTML file stays a file until a request like this one asks: nothing converts on its own. The switch is one-way; the original upload stays downloadable from the asset's Versions pane. Requires edit access to the file. Idempotent: an asset that already is a user interface is answered as it is, with converted false. A refused conversion answers with a detail object: code CONVERSION_REFUSED, the reason, and a message saying why.
|
|
1327
|
+
</dd>
|
|
1328
|
+
</dl>
|
|
1329
|
+
</dd>
|
|
1330
|
+
</dl>
|
|
1331
|
+
|
|
1332
|
+
#### 🔌 Usage
|
|
1333
|
+
|
|
1334
|
+
<dl>
|
|
1335
|
+
<dd>
|
|
1336
|
+
|
|
1337
|
+
<dl>
|
|
1338
|
+
<dd>
|
|
1339
|
+
|
|
1340
|
+
```typescript
|
|
1341
|
+
await client.assets.convertToUserInterface({
|
|
1342
|
+
asset_id: "asset_92492920-d118-42d3-95b4-00eccfe0754f"
|
|
1343
|
+
});
|
|
1344
|
+
|
|
1345
|
+
```
|
|
1346
|
+
</dd>
|
|
1347
|
+
</dl>
|
|
1348
|
+
</dd>
|
|
1349
|
+
</dl>
|
|
1350
|
+
|
|
1351
|
+
#### ⚙️ Parameters
|
|
1352
|
+
|
|
1353
|
+
<dl>
|
|
1354
|
+
<dd>
|
|
1355
|
+
|
|
1356
|
+
<dl>
|
|
1357
|
+
<dd>
|
|
1358
|
+
|
|
1359
|
+
**request:** `AthenaIntelligence.ConvertToUserInterfaceAssetsRequest`
|
|
1360
|
+
|
|
1361
|
+
</dd>
|
|
1362
|
+
</dl>
|
|
1363
|
+
|
|
1364
|
+
<dl>
|
|
1365
|
+
<dd>
|
|
1366
|
+
|
|
1367
|
+
**requestOptions:** `AssetsClient.RequestOptions`
|
|
1368
|
+
|
|
1369
|
+
</dd>
|
|
1370
|
+
</dl>
|
|
1371
|
+
</dd>
|
|
1372
|
+
</dl>
|
|
1373
|
+
|
|
1374
|
+
|
|
1310
1375
|
</dd>
|
|
1311
1376
|
</dl>
|
|
1312
1377
|
</details>
|