@athenaintel/sdk 4.3.2268 → 4.3.2270
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 -1
- package/dist/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/errors/ContentTooLargeError.d.ts +1 -2
- package/dist/cjs/api/resources/assets/client/Client.d.ts +23 -1
- package/dist/cjs/api/resources/assets/client/Client.js +111 -1
- package/dist/cjs/api/resources/assets/client/requests/BodyCreateAssetFromFilePublicApiV0AssetsCreateFromFilePost.d.ts +19 -0
- package/dist/cjs/api/resources/assets/client/requests/CreateAssetRequestIn.d.ts +1 -1
- package/dist/cjs/api/resources/assets/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/resources/tools/resources/email/client/Client.d.ts +24 -0
- package/dist/cjs/api/resources/tools/resources/email/client/Client.js +98 -0
- package/dist/cjs/api/resources/tools/resources/email/client/requests/GetMessageEmailRequest.d.ts +12 -0
- package/dist/cjs/api/resources/tools/resources/email/client/requests/GetMessageEmailRequest.js +3 -0
- package/dist/cjs/api/resources/tools/resources/email/client/requests/index.d.ts +1 -0
- package/dist/cjs/api/types/CreatableAssetType.d.ts +2 -0
- package/dist/cjs/api/types/CreatableAssetType.js +2 -0
- package/dist/cjs/api/types/EmailMessageResponseOut.d.ts +33 -0
- package/dist/cjs/api/types/EmailMessageResponseOut.js +3 -0
- package/dist/cjs/api/types/index.d.ts +1 -1
- package/dist/cjs/api/types/index.js +1 -1
- 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/errors/ContentTooLargeError.d.mts +1 -2
- package/dist/esm/api/resources/assets/client/Client.d.mts +23 -1
- package/dist/esm/api/resources/assets/client/Client.mjs +111 -1
- package/dist/esm/api/resources/assets/client/requests/BodyCreateAssetFromFilePublicApiV0AssetsCreateFromFilePost.d.mts +19 -0
- package/dist/esm/api/resources/assets/client/requests/CreateAssetRequestIn.d.mts +1 -1
- package/dist/esm/api/resources/assets/client/requests/index.d.mts +1 -0
- package/dist/esm/api/resources/tools/resources/email/client/Client.d.mts +24 -0
- package/dist/esm/api/resources/tools/resources/email/client/Client.mjs +98 -0
- package/dist/esm/api/resources/tools/resources/email/client/requests/GetMessageEmailRequest.d.mts +12 -0
- package/dist/esm/api/resources/tools/resources/email/client/requests/GetMessageEmailRequest.mjs +2 -0
- package/dist/esm/api/resources/tools/resources/email/client/requests/index.d.mts +1 -0
- package/dist/esm/api/types/CreatableAssetType.d.mts +2 -0
- package/dist/esm/api/types/CreatableAssetType.mjs +2 -0
- package/dist/esm/api/types/EmailMessageResponseOut.d.mts +33 -0
- package/dist/esm/api/types/EmailMessageResponseOut.mjs +2 -0
- package/dist/esm/api/types/index.d.mts +1 -1
- package/dist/esm/api/types/index.mjs +1 -1
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +135 -1
- package/dist/cjs/api/types/FileTooLargeError.d.ts +0 -3
- package/dist/esm/api/types/FileTooLargeError.d.mts +0 -3
- /package/dist/cjs/api/{types/FileTooLargeError.js → resources/assets/client/requests/BodyCreateAssetFromFilePublicApiV0AssetsCreateFromFilePost.js} +0 -0
- /package/dist/esm/api/{types/FileTooLargeError.mjs → resources/assets/client/requests/BodyCreateAssetFromFilePublicApiV0AssetsCreateFromFilePost.mjs} +0 -0
|
@@ -219,7 +219,7 @@ export class AssetsClient {
|
|
|
219
219
|
});
|
|
220
220
|
}
|
|
221
221
|
/**
|
|
222
|
-
* Create a new asset such as a spreadsheet, document, folder, database, computer, user interface, skill, collab agent, figure, or generic doc (admin-only) in your workspace with your current permissions. Computer assets return 202 after durable submission, which commits the asset and initialization delivery intent together. Runtime provisioning continues asynchronously. Inspect the returned asset ID for progress instead of repeating creation. Computers accept the same configuration as the Athena UI's creation dialog: template, provider, cpu, memory (GiB), disk (GiB) and env_vars. Sizes must be offered by the environment's computer resource policy, and only admins may pick a size other than the template default (403 otherwise). In capability enforce mode, computer creation requires computer.create and returns 403 when denied. Databases accept suspend_timeout_seconds, the auto-suspend window from the database's Settings in Athena: 0 keeps the database running (it never suspends, and keeps using capacity), otherwise 60 to 86400 seconds. A database is provisioned in the background: poll GET /api/v0/databases/{asset_id}/compute-status until it reports running or suspended. Figures take figure_config, a FigureSpec (kind, rendered and provenance, plus spec or chart), validated as the Athena UI's figures are. Without workspace_id the asset is created in the workspace of parent_folder_id when one is given, otherwise in your current workspace; you must be a member of that workspace.
|
|
222
|
+
* Create a new asset such as a spreadsheet, document, folder, database, computer, user interface, skill, collab agent, figure, Word document, presentation, or generic doc (admin-only) in your workspace with your current permissions. Computer assets return 202 after durable submission, which commits the asset and initialization delivery intent together. Runtime provisioning continues asynchronously. Inspect the returned asset ID for progress instead of repeating creation. Computers accept the same configuration as the Athena UI's creation dialog: template, provider, cpu, memory (GiB), disk (GiB) and env_vars. Sizes must be offered by the environment's computer resource policy, and only admins may pick a size other than the template default (403 otherwise). In capability enforce mode, computer creation requires computer.create and returns 403 when denied. Databases accept suspend_timeout_seconds, the auto-suspend window from the database's Settings in Athena: 0 keeps the database running (it never suspends, and keeps using capacity), otherwise 60 to 86400 seconds. A database is provisioned in the background: poll GET /api/v0/databases/{asset_id}/compute-status until it reports running or suspended. Figures take figure_config, a FigureSpec (kind, rendered and provenance, plus spec or chart), validated as the Athena UI's figures are. A word_document is a Word document holding Athena's default template, and a presentation is a blank widescreen PPTX Studio deck (the workspace's default template is not applied): Athena creates each with its own studio credential, as your write, and answers once the studio has seeded it (502, keeping nothing, when PPTX Studio could not seed a deck). Edit them through DOCX Studio or PPTX Studio with a token from POST /api/v0/assets/{asset_id}/studio-token. From an agent run (a verified X-Athena-Session-Credential), their first write also records the run, and a presentation takes the create_presentation_pptx_studio tool policy. Without workspace_id the asset is created in the workspace of parent_folder_id when one is given, otherwise in your current workspace; you must be a member of that workspace.
|
|
223
223
|
*
|
|
224
224
|
* @param {AthenaIntelligence.CreateAssetRequestIn} request
|
|
225
225
|
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -229,6 +229,7 @@ export class AssetsClient {
|
|
|
229
229
|
* @throws {@link AthenaIntelligence.GoneError}
|
|
230
230
|
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
231
231
|
* @throws {@link AthenaIntelligence.InternalServerError}
|
|
232
|
+
* @throws {@link AthenaIntelligence.BadGatewayError}
|
|
232
233
|
* @throws {@link AthenaIntelligence.ServiceUnavailableError}
|
|
233
234
|
*
|
|
234
235
|
* @example
|
|
@@ -280,6 +281,8 @@ export class AssetsClient {
|
|
|
280
281
|
throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
281
282
|
case 500:
|
|
282
283
|
throw new AthenaIntelligence.InternalServerError(_response.error.body, _response.rawResponse);
|
|
284
|
+
case 502:
|
|
285
|
+
throw new AthenaIntelligence.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
283
286
|
case 503:
|
|
284
287
|
throw new AthenaIntelligence.ServiceUnavailableError(_response.error.body, _response.rawResponse);
|
|
285
288
|
default:
|
|
@@ -312,6 +315,113 @@ export class AssetsClient {
|
|
|
312
315
|
}
|
|
313
316
|
});
|
|
314
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Create a Word document from a .docx file, or a presentation from a .pptx or .potx file, holding that file's content: the asset Athena makes when you create one from a file in the app. Athena imports the file through DOCX Studio or PPTX Studio with its own studio credential, as your write, and answers once the asset is ready (a large deck can take a few minutes). Nothing is left behind when the import fails. The file's name decides the type; the title defaults to the name without its extension. Gates are those of POST /api/v0/assets/create: membership in the workspace (workspace_id, else parent_folder_id's, else your current one) and EDIT on parent_folder_id. With source_asset_id (an asset you can read, for example the document the file was exported from) and no parent_folder_id, the new asset goes into the source's folder when you may create there, otherwise at your root. Unlike POST /api/v0/tools/file/save, which stores the file itself and turns an Office upload into its editable type in the background, this makes the editable asset in the request and keeps no file asset. A Word file may be up to 18.75 MiB, a PowerPoint file up to 100 MiB. From an agent run (a verified X-Athena-Session-Credential), a Word document's first write also records the run, and a presentation takes the create_presentation_pptx_studio tool policy.
|
|
320
|
+
*
|
|
321
|
+
* @param {AthenaIntelligence.BodyCreateAssetFromFilePublicApiV0AssetsCreateFromFilePost} request
|
|
322
|
+
* @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
323
|
+
*
|
|
324
|
+
* @throws {@link AthenaIntelligence.BadRequestError}
|
|
325
|
+
* @throws {@link AthenaIntelligence.ForbiddenError}
|
|
326
|
+
* @throws {@link AthenaIntelligence.NotFoundError}
|
|
327
|
+
* @throws {@link AthenaIntelligence.ContentTooLargeError}
|
|
328
|
+
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
329
|
+
* @throws {@link AthenaIntelligence.BadGatewayError}
|
|
330
|
+
*
|
|
331
|
+
* @example
|
|
332
|
+
* import { createReadStream } from "fs";
|
|
333
|
+
* await client.assets.createFromFile({
|
|
334
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
335
|
+
* })
|
|
336
|
+
*/
|
|
337
|
+
createFromFile(request, requestOptions) {
|
|
338
|
+
return core.HttpResponsePromise.fromPromise(this.__createFromFile(request, requestOptions));
|
|
339
|
+
}
|
|
340
|
+
__createFromFile(request, requestOptions) {
|
|
341
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
342
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
343
|
+
const _queryParams = {};
|
|
344
|
+
if (request.title !== undefined) {
|
|
345
|
+
_queryParams.title = request.title;
|
|
346
|
+
}
|
|
347
|
+
if (request.parent_folder_id !== undefined) {
|
|
348
|
+
_queryParams.parent_folder_id = request.parent_folder_id;
|
|
349
|
+
}
|
|
350
|
+
if (request.workspace_id !== undefined) {
|
|
351
|
+
_queryParams.workspace_id = request.workspace_id;
|
|
352
|
+
}
|
|
353
|
+
if (request.source_asset_id !== undefined) {
|
|
354
|
+
_queryParams.source_asset_id = request.source_asset_id;
|
|
355
|
+
}
|
|
356
|
+
const _request = yield core.newFormData();
|
|
357
|
+
yield _request.appendFile("file", request.file);
|
|
358
|
+
const _maybeEncodedRequest = yield _request.getRequest();
|
|
359
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
360
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders(Object.assign({ "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 }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
361
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
362
|
+
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/create-from-file"),
|
|
363
|
+
method: "POST",
|
|
364
|
+
headers: _headers,
|
|
365
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
366
|
+
requestType: "file",
|
|
367
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
368
|
+
body: _maybeEncodedRequest.body,
|
|
369
|
+
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,
|
|
370
|
+
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,
|
|
371
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
372
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
373
|
+
logging: this._options.logging,
|
|
374
|
+
});
|
|
375
|
+
if (_response.ok) {
|
|
376
|
+
return {
|
|
377
|
+
data: _response.body,
|
|
378
|
+
rawResponse: _response.rawResponse,
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
if (_response.error.reason === "status-code") {
|
|
382
|
+
switch (_response.error.statusCode) {
|
|
383
|
+
case 400:
|
|
384
|
+
throw new AthenaIntelligence.BadRequestError(_response.error.body, _response.rawResponse);
|
|
385
|
+
case 403:
|
|
386
|
+
throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
387
|
+
case 404:
|
|
388
|
+
throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
|
|
389
|
+
case 413:
|
|
390
|
+
throw new AthenaIntelligence.ContentTooLargeError(_response.error.body, _response.rawResponse);
|
|
391
|
+
case 422:
|
|
392
|
+
throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
393
|
+
case 502:
|
|
394
|
+
throw new AthenaIntelligence.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
395
|
+
default:
|
|
396
|
+
throw new errors.AthenaIntelligenceError({
|
|
397
|
+
statusCode: _response.error.statusCode,
|
|
398
|
+
body: _response.error.body,
|
|
399
|
+
rawResponse: _response.rawResponse,
|
|
400
|
+
});
|
|
401
|
+
}
|
|
402
|
+
}
|
|
403
|
+
switch (_response.error.reason) {
|
|
404
|
+
case "non-json":
|
|
405
|
+
throw new errors.AthenaIntelligenceError({
|
|
406
|
+
statusCode: _response.error.statusCode,
|
|
407
|
+
body: _response.error.rawBody,
|
|
408
|
+
rawResponse: _response.rawResponse,
|
|
409
|
+
});
|
|
410
|
+
case "body-is-null":
|
|
411
|
+
throw new errors.AthenaIntelligenceError({
|
|
412
|
+
statusCode: _response.error.statusCode,
|
|
413
|
+
rawResponse: _response.rawResponse,
|
|
414
|
+
});
|
|
415
|
+
case "timeout":
|
|
416
|
+
throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/assets/create-from-file.");
|
|
417
|
+
case "unknown":
|
|
418
|
+
throw new errors.AthenaIntelligenceError({
|
|
419
|
+
message: _response.error.errorMessage,
|
|
420
|
+
rawResponse: _response.rawResponse,
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
}
|
|
315
425
|
/**
|
|
316
426
|
* Create a new project with custom metadata. Projects can be typed (e.g., 'candidate', 'user', 'company') and include flexible custom metadata for storing additional information.
|
|
317
427
|
*
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type * as core from "../../../../../core/index.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* @example
|
|
4
|
+
* {
|
|
5
|
+
* file: fs.createReadStream("/path/to/your/file")
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface BodyCreateAssetFromFilePublicApiV0AssetsCreateFromFilePost {
|
|
9
|
+
/** Title for the new asset; defaults to the file's name */
|
|
10
|
+
title?: string | null;
|
|
11
|
+
/** ID of the folder to create the asset in */
|
|
12
|
+
parent_folder_id?: string | null;
|
|
13
|
+
/** ID of the workspace to create the asset in; defaults to the workspace of parent_folder_id, else your current workspace */
|
|
14
|
+
workspace_id?: string | null;
|
|
15
|
+
/** An asset you can read that the file came from; without parent_folder_id the new asset goes next to it when you may create there */
|
|
16
|
+
source_asset_id?: string | null;
|
|
17
|
+
/** The .docx, .pptx or .potx file to create the asset from */
|
|
18
|
+
file: core.file.Uploadable;
|
|
19
|
+
}
|
|
@@ -10,7 +10,7 @@ import type * as AthenaIntelligence from "../../../../index.mjs";
|
|
|
10
10
|
export interface CreateAssetRequestIn {
|
|
11
11
|
/** collab_agent only. Initial agent configuration. Created as a draft; publish it with POST /api/v0/assets/{asset_id}/publish. */
|
|
12
12
|
agent_config?: AthenaIntelligence.PublicCollabAgentConfigIn | null;
|
|
13
|
-
/** Type of asset to create. Supported types: 'spreadsheet' (or 'sheet'), 'document' (or 'doc'), 'folder', 'database' (or 'db'), 'computer', 'generic_doc', 'user_interface' (or 'ui'), 'skill', 'collab_agent' (or 'agent'), 'figure' */
|
|
13
|
+
/** Type of asset to create. Supported types: 'spreadsheet' (or 'sheet'), 'document' (or 'doc'), 'folder', 'database' (or 'db'), 'computer', 'generic_doc', 'user_interface' (or 'ui'), 'skill', 'collab_agent' (or 'agent'), 'figure', 'word_document' (or 'word'), 'presentation' (or 'deck'). 'document' is Athena's rich-text document; a Word document is 'word_document'. */
|
|
14
14
|
asset_type: AthenaIntelligence.CreatableAssetType;
|
|
15
15
|
/** Computer only. vCPU count. Defaults to the template's default. Must be a size the environment's computer resource policy offers; sizes other than the template default require an admin. */
|
|
16
16
|
cpu?: number | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export type { ArchiveAssetsRequest } from "./ArchiveAssetsRequest.mjs";
|
|
2
2
|
export type { AssetActivityDeltaBatchRequestIn } from "./AssetActivityDeltaBatchRequestIn.mjs";
|
|
3
|
+
export type { BodyCreateAssetFromFilePublicApiV0AssetsCreateFromFilePost } from "./BodyCreateAssetFromFilePublicApiV0AssetsCreateFromFilePost.mjs";
|
|
3
4
|
export type { CollabTokenRequest } from "./CollabTokenRequest.mjs";
|
|
4
5
|
export type { ConvertExcelToSheetRequestIn } from "./ConvertExcelToSheetRequestIn.mjs";
|
|
5
6
|
export type { ConvertToUserInterfaceAssetsRequest } from "./ConvertToUserInterfaceAssetsRequest.mjs";
|
|
@@ -39,6 +39,30 @@ export declare class EmailClient {
|
|
|
39
39
|
*/
|
|
40
40
|
createDraft(request: AthenaIntelligence.tools.EmailDraftRequestIn, requestOptions?: EmailClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.EmailDraftResponseOut>;
|
|
41
41
|
private __createDraft;
|
|
42
|
+
/**
|
|
43
|
+
* Read one message from the caller's connected Gmail or Outlook mailbox.
|
|
44
|
+
*
|
|
45
|
+
* Returns its headers and its body as plain text, so an agent can keep the
|
|
46
|
+
* whole email (in a CRM timeline, for example) rather than the search
|
|
47
|
+
* snippet. Read-only; attachments are not returned.
|
|
48
|
+
*
|
|
49
|
+
* @param {AthenaIntelligence.tools.GetMessageEmailRequest} request
|
|
50
|
+
* @param {EmailClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
51
|
+
*
|
|
52
|
+
* @throws {@link AthenaIntelligence.BadRequestError}
|
|
53
|
+
* @throws {@link AthenaIntelligence.ForbiddenError}
|
|
54
|
+
* @throws {@link AthenaIntelligence.NotFoundError}
|
|
55
|
+
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
56
|
+
* @throws {@link AthenaIntelligence.TooManyRequestsError}
|
|
57
|
+
* @throws {@link AthenaIntelligence.BadGatewayError}
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* await client.tools.email.getMessage({
|
|
61
|
+
* message_id: "18f2a7c3b9d4e5f6"
|
|
62
|
+
* })
|
|
63
|
+
*/
|
|
64
|
+
getMessage(request: AthenaIntelligence.tools.GetMessageEmailRequest, requestOptions?: EmailClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.EmailMessageResponseOut>;
|
|
65
|
+
private __getMessage;
|
|
42
66
|
/**
|
|
43
67
|
* Search the caller's connected Gmail or Outlook mailbox.
|
|
44
68
|
*
|
|
@@ -118,6 +118,104 @@ export class EmailClient {
|
|
|
118
118
|
}
|
|
119
119
|
});
|
|
120
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* Read one message from the caller's connected Gmail or Outlook mailbox.
|
|
123
|
+
*
|
|
124
|
+
* Returns its headers and its body as plain text, so an agent can keep the
|
|
125
|
+
* whole email (in a CRM timeline, for example) rather than the search
|
|
126
|
+
* snippet. Read-only; attachments are not returned.
|
|
127
|
+
*
|
|
128
|
+
* @param {AthenaIntelligence.tools.GetMessageEmailRequest} request
|
|
129
|
+
* @param {EmailClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
130
|
+
*
|
|
131
|
+
* @throws {@link AthenaIntelligence.BadRequestError}
|
|
132
|
+
* @throws {@link AthenaIntelligence.ForbiddenError}
|
|
133
|
+
* @throws {@link AthenaIntelligence.NotFoundError}
|
|
134
|
+
* @throws {@link AthenaIntelligence.UnprocessableEntityError}
|
|
135
|
+
* @throws {@link AthenaIntelligence.TooManyRequestsError}
|
|
136
|
+
* @throws {@link AthenaIntelligence.BadGatewayError}
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* await client.tools.email.getMessage({
|
|
140
|
+
* message_id: "18f2a7c3b9d4e5f6"
|
|
141
|
+
* })
|
|
142
|
+
*/
|
|
143
|
+
getMessage(request, requestOptions) {
|
|
144
|
+
return core.HttpResponsePromise.fromPromise(this.__getMessage(request, requestOptions));
|
|
145
|
+
}
|
|
146
|
+
__getMessage(request, requestOptions) {
|
|
147
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
148
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
|
|
149
|
+
const { message_id: messageId, catalog_id: catalogId } = request;
|
|
150
|
+
const _queryParams = {};
|
|
151
|
+
if (catalogId !== undefined) {
|
|
152
|
+
_queryParams.catalog_id = catalogId;
|
|
153
|
+
}
|
|
154
|
+
const _authRequest = yield this._options.authProvider.getAuthRequest();
|
|
155
|
+
const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
|
|
156
|
+
"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,
|
|
157
|
+
}), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
158
|
+
const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
|
|
159
|
+
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/tools/email/messages/${core.url.encodePathParam(messageId)}`),
|
|
160
|
+
method: "GET",
|
|
161
|
+
headers: _headers,
|
|
162
|
+
queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
|
|
163
|
+
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,
|
|
164
|
+
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,
|
|
165
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
166
|
+
fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
|
|
167
|
+
logging: this._options.logging,
|
|
168
|
+
});
|
|
169
|
+
if (_response.ok) {
|
|
170
|
+
return {
|
|
171
|
+
data: _response.body,
|
|
172
|
+
rawResponse: _response.rawResponse,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
if (_response.error.reason === "status-code") {
|
|
176
|
+
switch (_response.error.statusCode) {
|
|
177
|
+
case 400:
|
|
178
|
+
throw new AthenaIntelligence.BadRequestError(_response.error.body, _response.rawResponse);
|
|
179
|
+
case 403:
|
|
180
|
+
throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
181
|
+
case 404:
|
|
182
|
+
throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
|
|
183
|
+
case 422:
|
|
184
|
+
throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
|
|
185
|
+
case 429:
|
|
186
|
+
throw new AthenaIntelligence.TooManyRequestsError(_response.error.body, _response.rawResponse);
|
|
187
|
+
case 502:
|
|
188
|
+
throw new AthenaIntelligence.BadGatewayError(_response.error.body, _response.rawResponse);
|
|
189
|
+
default:
|
|
190
|
+
throw new errors.AthenaIntelligenceError({
|
|
191
|
+
statusCode: _response.error.statusCode,
|
|
192
|
+
body: _response.error.body,
|
|
193
|
+
rawResponse: _response.rawResponse,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
switch (_response.error.reason) {
|
|
198
|
+
case "non-json":
|
|
199
|
+
throw new errors.AthenaIntelligenceError({
|
|
200
|
+
statusCode: _response.error.statusCode,
|
|
201
|
+
body: _response.error.rawBody,
|
|
202
|
+
rawResponse: _response.rawResponse,
|
|
203
|
+
});
|
|
204
|
+
case "body-is-null":
|
|
205
|
+
throw new errors.AthenaIntelligenceError({
|
|
206
|
+
statusCode: _response.error.statusCode,
|
|
207
|
+
rawResponse: _response.rawResponse,
|
|
208
|
+
});
|
|
209
|
+
case "timeout":
|
|
210
|
+
throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling GET /api/v0/tools/email/messages/{message_id}.");
|
|
211
|
+
case "unknown":
|
|
212
|
+
throw new errors.AthenaIntelligenceError({
|
|
213
|
+
message: _response.error.errorMessage,
|
|
214
|
+
rawResponse: _response.rawResponse,
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
}
|
|
121
219
|
/**
|
|
122
220
|
* Search the caller's connected Gmail or Outlook mailbox.
|
|
123
221
|
*
|
package/dist/esm/api/resources/tools/resources/email/client/requests/GetMessageEmailRequest.d.mts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* message_id: "18f2a7c3b9d4e5f6"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface GetMessageEmailRequest {
|
|
8
|
+
/** Provider message id, as `GET /tools/email/search` returns it in `results[].id`. */
|
|
9
|
+
message_id: string;
|
|
10
|
+
/** Connected email account to use, as the catalog asset id returned by the Athena UI or the assets API. Defaults to the caller's default email account. An id that is not one of the caller's own connected accounts in the current workspace is a 404. */
|
|
11
|
+
catalog_id?: string | null;
|
|
12
|
+
}
|
|
@@ -10,5 +10,7 @@ export declare const CreatableAssetType: {
|
|
|
10
10
|
readonly Skill: "skill";
|
|
11
11
|
readonly CollabAgent: "collab_agent";
|
|
12
12
|
readonly Figure: "figure";
|
|
13
|
+
readonly WordDocument: "word_document";
|
|
14
|
+
readonly Presentation: "presentation";
|
|
13
15
|
};
|
|
14
16
|
export type CreatableAssetType = (typeof CreatableAssetType)[keyof typeof CreatableAssetType];
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One message's headers and plain-text body.
|
|
3
|
+
*/
|
|
4
|
+
export interface EmailMessageResponseOut {
|
|
5
|
+
/** The message body as plain text, HTML converted. At most 50,000 characters; see `truncated`. */
|
|
6
|
+
body_text?: string;
|
|
7
|
+
/** The connected account the message was read from. */
|
|
8
|
+
catalog_id: string;
|
|
9
|
+
/** Cc recipients, comma-separated as the provider reports them. */
|
|
10
|
+
cc?: string;
|
|
11
|
+
/** Microsoft Graph conversation id. Outlook accounts only. */
|
|
12
|
+
conversation_id?: string | null;
|
|
13
|
+
/** Sent or received timestamp, in the provider's format. */
|
|
14
|
+
date?: string;
|
|
15
|
+
/** Provider draft id, when the provider exposes one for a draft. */
|
|
16
|
+
draft_id?: string | null;
|
|
17
|
+
/** Sender, as the provider reports it. */
|
|
18
|
+
from?: string;
|
|
19
|
+
/** Provider message id, as `GET /tools/email/search` returns it and `reply_to_message_id` accepts. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** True when the message is an unsent draft sitting in the mailbox. */
|
|
22
|
+
is_draft?: boolean;
|
|
23
|
+
/** Account provider as Athena reports it: `gmail` or `outlook` for accounts connected through the Integrations page; `google` or `microsoft365` for directly-connected accounts. */
|
|
24
|
+
provider: string;
|
|
25
|
+
/** Subject line. */
|
|
26
|
+
subject?: string;
|
|
27
|
+
/** Gmail thread id. Gmail accounts only. */
|
|
28
|
+
thread_id?: string | null;
|
|
29
|
+
/** Recipients, comma-separated as the provider reports them. */
|
|
30
|
+
to?: string;
|
|
31
|
+
/** True when `body_text` was cut to its maximum length. */
|
|
32
|
+
truncated?: boolean;
|
|
33
|
+
}
|
|
@@ -72,9 +72,9 @@ export * from "./DeployComputerResponseOut.mjs";
|
|
|
72
72
|
export * from "./DimensionProperties.mjs";
|
|
73
73
|
export * from "./DuplicateAssetResponseOut.mjs";
|
|
74
74
|
export * from "./EmailDraftResponseOut.mjs";
|
|
75
|
+
export * from "./EmailMessageResponseOut.mjs";
|
|
75
76
|
export * from "./EmailSearchResponseOut.mjs";
|
|
76
77
|
export * from "./EmailSearchResultOut.mjs";
|
|
77
|
-
export * from "./FileTooLargeError.mjs";
|
|
78
78
|
export * from "./FolderResponse.mjs";
|
|
79
79
|
export * from "./GeneralAgentAsyncInvokeResponseOut.mjs";
|
|
80
80
|
export * from "./GeneralAgentConfig.mjs";
|
|
@@ -72,9 +72,9 @@ export * from "./DeployComputerResponseOut.mjs";
|
|
|
72
72
|
export * from "./DimensionProperties.mjs";
|
|
73
73
|
export * from "./DuplicateAssetResponseOut.mjs";
|
|
74
74
|
export * from "./EmailDraftResponseOut.mjs";
|
|
75
|
+
export * from "./EmailMessageResponseOut.mjs";
|
|
75
76
|
export * from "./EmailSearchResponseOut.mjs";
|
|
76
77
|
export * from "./EmailSearchResultOut.mjs";
|
|
77
|
-
export * from "./FileTooLargeError.mjs";
|
|
78
78
|
export * from "./FolderResponse.mjs";
|
|
79
79
|
export * from "./GeneralAgentAsyncInvokeResponseOut.mjs";
|
|
80
80
|
export * from "./GeneralAgentConfig.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.2270";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "4.3.
|
|
1
|
+
export const SDK_VERSION = "4.3.2270";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -648,7 +648,7 @@ await client.assets.convertExcelToSheet({
|
|
|
648
648
|
<dl>
|
|
649
649
|
<dd>
|
|
650
650
|
|
|
651
|
-
Create a new asset such as a spreadsheet, document, folder, database, computer, user interface, skill, collab agent, figure, or generic doc (admin-only) in your workspace with your current permissions. Computer assets return 202 after durable submission, which commits the asset and initialization delivery intent together. Runtime provisioning continues asynchronously. Inspect the returned asset ID for progress instead of repeating creation. Computers accept the same configuration as the Athena UI's creation dialog: template, provider, cpu, memory (GiB), disk (GiB) and env_vars. Sizes must be offered by the environment's computer resource policy, and only admins may pick a size other than the template default (403 otherwise). In capability enforce mode, computer creation requires computer.create and returns 403 when denied. Databases accept suspend_timeout_seconds, the auto-suspend window from the database's Settings in Athena: 0 keeps the database running (it never suspends, and keeps using capacity), otherwise 60 to 86400 seconds. A database is provisioned in the background: poll GET /api/v0/databases/{asset_id}/compute-status until it reports running or suspended. Figures take figure_config, a FigureSpec (kind, rendered and provenance, plus spec or chart), validated as the Athena UI's figures are. Without workspace_id the asset is created in the workspace of parent_folder_id when one is given, otherwise in your current workspace; you must be a member of that workspace.
|
|
651
|
+
Create a new asset such as a spreadsheet, document, folder, database, computer, user interface, skill, collab agent, figure, Word document, presentation, or generic doc (admin-only) in your workspace with your current permissions. Computer assets return 202 after durable submission, which commits the asset and initialization delivery intent together. Runtime provisioning continues asynchronously. Inspect the returned asset ID for progress instead of repeating creation. Computers accept the same configuration as the Athena UI's creation dialog: template, provider, cpu, memory (GiB), disk (GiB) and env_vars. Sizes must be offered by the environment's computer resource policy, and only admins may pick a size other than the template default (403 otherwise). In capability enforce mode, computer creation requires computer.create and returns 403 when denied. Databases accept suspend_timeout_seconds, the auto-suspend window from the database's Settings in Athena: 0 keeps the database running (it never suspends, and keeps using capacity), otherwise 60 to 86400 seconds. A database is provisioned in the background: poll GET /api/v0/databases/{asset_id}/compute-status until it reports running or suspended. Figures take figure_config, a FigureSpec (kind, rendered and provenance, plus spec or chart), validated as the Athena UI's figures are. A word_document is a Word document holding Athena's default template, and a presentation is a blank widescreen PPTX Studio deck (the workspace's default template is not applied): Athena creates each with its own studio credential, as your write, and answers once the studio has seeded it (502, keeping nothing, when PPTX Studio could not seed a deck). Edit them through DOCX Studio or PPTX Studio with a token from POST /api/v0/assets/{asset_id}/studio-token. From an agent run (a verified X-Athena-Session-Credential), their first write also records the run, and a presentation takes the create_presentation_pptx_studio tool policy. Without workspace_id the asset is created in the workspace of parent_folder_id when one is given, otherwise in your current workspace; you must be a member of that workspace.
|
|
652
652
|
</dd>
|
|
653
653
|
</dl>
|
|
654
654
|
</dd>
|
|
@@ -699,6 +699,71 @@ await client.assets.create({
|
|
|
699
699
|
</dl>
|
|
700
700
|
|
|
701
701
|
|
|
702
|
+
</dd>
|
|
703
|
+
</dl>
|
|
704
|
+
</details>
|
|
705
|
+
|
|
706
|
+
<details><summary><code>client.assets.<a href="/src/api/resources/assets/client/Client.ts">createFromFile</a>({ ...params }) -> AthenaIntelligence.CreateAssetResponseOut</code></summary>
|
|
707
|
+
<dl>
|
|
708
|
+
<dd>
|
|
709
|
+
|
|
710
|
+
#### 📝 Description
|
|
711
|
+
|
|
712
|
+
<dl>
|
|
713
|
+
<dd>
|
|
714
|
+
|
|
715
|
+
<dl>
|
|
716
|
+
<dd>
|
|
717
|
+
|
|
718
|
+
Create a Word document from a .docx file, or a presentation from a .pptx or .potx file, holding that file's content: the asset Athena makes when you create one from a file in the app. Athena imports the file through DOCX Studio or PPTX Studio with its own studio credential, as your write, and answers once the asset is ready (a large deck can take a few minutes). Nothing is left behind when the import fails. The file's name decides the type; the title defaults to the name without its extension. Gates are those of POST /api/v0/assets/create: membership in the workspace (workspace_id, else parent_folder_id's, else your current one) and EDIT on parent_folder_id. With source_asset_id (an asset you can read, for example the document the file was exported from) and no parent_folder_id, the new asset goes into the source's folder when you may create there, otherwise at your root. Unlike POST /api/v0/tools/file/save, which stores the file itself and turns an Office upload into its editable type in the background, this makes the editable asset in the request and keeps no file asset. A Word file may be up to 18.75 MiB, a PowerPoint file up to 100 MiB. From an agent run (a verified X-Athena-Session-Credential), a Word document's first write also records the run, and a presentation takes the create_presentation_pptx_studio tool policy.
|
|
719
|
+
</dd>
|
|
720
|
+
</dl>
|
|
721
|
+
</dd>
|
|
722
|
+
</dl>
|
|
723
|
+
|
|
724
|
+
#### 🔌 Usage
|
|
725
|
+
|
|
726
|
+
<dl>
|
|
727
|
+
<dd>
|
|
728
|
+
|
|
729
|
+
<dl>
|
|
730
|
+
<dd>
|
|
731
|
+
|
|
732
|
+
```typescript
|
|
733
|
+
await client.assets.createFromFile({
|
|
734
|
+
file: fs.createReadStream("/path/to/your/file")
|
|
735
|
+
});
|
|
736
|
+
|
|
737
|
+
```
|
|
738
|
+
</dd>
|
|
739
|
+
</dl>
|
|
740
|
+
</dd>
|
|
741
|
+
</dl>
|
|
742
|
+
|
|
743
|
+
#### ⚙️ Parameters
|
|
744
|
+
|
|
745
|
+
<dl>
|
|
746
|
+
<dd>
|
|
747
|
+
|
|
748
|
+
<dl>
|
|
749
|
+
<dd>
|
|
750
|
+
|
|
751
|
+
**request:** `AthenaIntelligence.BodyCreateAssetFromFilePublicApiV0AssetsCreateFromFilePost`
|
|
752
|
+
|
|
753
|
+
</dd>
|
|
754
|
+
</dl>
|
|
755
|
+
|
|
756
|
+
<dl>
|
|
757
|
+
<dd>
|
|
758
|
+
|
|
759
|
+
**requestOptions:** `AssetsClient.RequestOptions`
|
|
760
|
+
|
|
761
|
+
</dd>
|
|
762
|
+
</dl>
|
|
763
|
+
</dd>
|
|
764
|
+
</dl>
|
|
765
|
+
|
|
766
|
+
|
|
702
767
|
</dd>
|
|
703
768
|
</dl>
|
|
704
769
|
</details>
|
|
@@ -6673,6 +6738,75 @@ await client.tools.email.createDraft({
|
|
|
6673
6738
|
</dl>
|
|
6674
6739
|
|
|
6675
6740
|
|
|
6741
|
+
</dd>
|
|
6742
|
+
</dl>
|
|
6743
|
+
</details>
|
|
6744
|
+
|
|
6745
|
+
<details><summary><code>client.tools.email.<a href="/src/api/resources/tools/resources/email/client/Client.ts">getMessage</a>({ ...params }) -> AthenaIntelligence.EmailMessageResponseOut</code></summary>
|
|
6746
|
+
<dl>
|
|
6747
|
+
<dd>
|
|
6748
|
+
|
|
6749
|
+
#### 📝 Description
|
|
6750
|
+
|
|
6751
|
+
<dl>
|
|
6752
|
+
<dd>
|
|
6753
|
+
|
|
6754
|
+
<dl>
|
|
6755
|
+
<dd>
|
|
6756
|
+
|
|
6757
|
+
Read one message from the caller's connected Gmail or Outlook mailbox.
|
|
6758
|
+
|
|
6759
|
+
Returns its headers and its body as plain text, so an agent can keep the
|
|
6760
|
+
whole email (in a CRM timeline, for example) rather than the search
|
|
6761
|
+
snippet. Read-only; attachments are not returned.
|
|
6762
|
+
</dd>
|
|
6763
|
+
</dl>
|
|
6764
|
+
</dd>
|
|
6765
|
+
</dl>
|
|
6766
|
+
|
|
6767
|
+
#### 🔌 Usage
|
|
6768
|
+
|
|
6769
|
+
<dl>
|
|
6770
|
+
<dd>
|
|
6771
|
+
|
|
6772
|
+
<dl>
|
|
6773
|
+
<dd>
|
|
6774
|
+
|
|
6775
|
+
```typescript
|
|
6776
|
+
await client.tools.email.getMessage({
|
|
6777
|
+
message_id: "18f2a7c3b9d4e5f6"
|
|
6778
|
+
});
|
|
6779
|
+
|
|
6780
|
+
```
|
|
6781
|
+
</dd>
|
|
6782
|
+
</dl>
|
|
6783
|
+
</dd>
|
|
6784
|
+
</dl>
|
|
6785
|
+
|
|
6786
|
+
#### ⚙️ Parameters
|
|
6787
|
+
|
|
6788
|
+
<dl>
|
|
6789
|
+
<dd>
|
|
6790
|
+
|
|
6791
|
+
<dl>
|
|
6792
|
+
<dd>
|
|
6793
|
+
|
|
6794
|
+
**request:** `AthenaIntelligence.tools.GetMessageEmailRequest`
|
|
6795
|
+
|
|
6796
|
+
</dd>
|
|
6797
|
+
</dl>
|
|
6798
|
+
|
|
6799
|
+
<dl>
|
|
6800
|
+
<dd>
|
|
6801
|
+
|
|
6802
|
+
**requestOptions:** `EmailClient.RequestOptions`
|
|
6803
|
+
|
|
6804
|
+
</dd>
|
|
6805
|
+
</dl>
|
|
6806
|
+
</dd>
|
|
6807
|
+
</dl>
|
|
6808
|
+
|
|
6809
|
+
|
|
6676
6810
|
</dd>
|
|
6677
6811
|
</dl>
|
|
6678
6812
|
</details>
|
|
File without changes
|