@athenaintel/sdk 4.3.2141 → 4.3.2142

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.
Files changed (30) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/assets/client/Client.d.ts +16 -1
  3. package/dist/cjs/api/resources/assets/client/Client.js +77 -1
  4. package/dist/cjs/api/resources/assets/client/requests/CollabTokenRequest.d.ts +19 -0
  5. package/dist/cjs/api/resources/assets/client/requests/CollabTokenRequest.js +12 -0
  6. package/dist/cjs/api/resources/assets/client/requests/index.d.ts +1 -0
  7. package/dist/cjs/api/types/CollabTokenResponse.d.ts +26 -0
  8. package/dist/cjs/api/types/CollabTokenResponse.js +12 -0
  9. package/dist/cjs/api/types/CreatableAssetType.d.ts +1 -0
  10. package/dist/cjs/api/types/CreatableAssetType.js +1 -0
  11. package/dist/cjs/api/types/index.d.ts +1 -0
  12. package/dist/cjs/api/types/index.js +1 -0
  13. package/dist/cjs/version.d.ts +1 -1
  14. package/dist/cjs/version.js +1 -1
  15. package/dist/esm/BaseClient.mjs +2 -2
  16. package/dist/esm/api/resources/assets/client/Client.d.mts +16 -1
  17. package/dist/esm/api/resources/assets/client/Client.mjs +77 -1
  18. package/dist/esm/api/resources/assets/client/requests/CollabTokenRequest.d.mts +19 -0
  19. package/dist/esm/api/resources/assets/client/requests/CollabTokenRequest.mjs +9 -0
  20. package/dist/esm/api/resources/assets/client/requests/index.d.mts +1 -0
  21. package/dist/esm/api/types/CollabTokenResponse.d.mts +26 -0
  22. package/dist/esm/api/types/CollabTokenResponse.mjs +9 -0
  23. package/dist/esm/api/types/CreatableAssetType.d.mts +1 -0
  24. package/dist/esm/api/types/CreatableAssetType.mjs +1 -0
  25. package/dist/esm/api/types/index.d.mts +1 -0
  26. package/dist/esm/api/types/index.mjs +1 -0
  27. package/dist/esm/version.d.mts +1 -1
  28. package/dist/esm/version.mjs +1 -1
  29. package/package.json +1 -1
  30. package/reference.md +66 -1
@@ -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.2141",
47
- "User-Agent": "@athenaintel/sdk/4.3.2141",
46
+ "X-Fern-SDK-Version": "4.3.2142",
47
+ "User-Agent": "@athenaintel/sdk/4.3.2142",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -48,7 +48,7 @@ export declare class AssetsClient {
48
48
  convertExcelToSheet(request: AthenaIntelligence.ConvertExcelToSheetRequestIn, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ConvertExcelToSheetResponseOut>;
49
49
  private __convertExcelToSheet;
50
50
  /**
51
- * Create a new asset such as a spreadsheet, document, folder, database, or computer in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration. Computer assets return 202 after the initializing asset is committed; runtime provisioning continues asynchronously.
51
+ * Create a new asset such as a spreadsheet, document, folder, database, computer, or generic doc (admin-only) in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration. Computer assets return 202 after the initializing asset is committed; runtime provisioning continues asynchronously.
52
52
  *
53
53
  * @param {AthenaIntelligence.CreateAssetRequestIn} request
54
54
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -235,6 +235,21 @@ export declare class AssetsClient {
235
235
  */
236
236
  archive(request: AthenaIntelligence.ArchiveAssetsRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ArchiveAssetResponseOut>;
237
237
  private __archive;
238
+ /**
239
+ * Admin only. Mint a short-lived Keryx capability token for a Generic Doc asset, enabling live collaborative reads (and, with edit permission, writes) over WebSocket and REST. Only generic_doc assets are eligible — Athena-managed asset types are never reachable through this endpoint. The requested access is a ceiling clamped by the caller's permission on the asset.
240
+ *
241
+ * @param {AthenaIntelligence.CollabTokenRequest} request
242
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
243
+ *
244
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
245
+ *
246
+ * @example
247
+ * await client.assets.createCollabToken({
248
+ * asset_id: "asset_id"
249
+ * })
250
+ */
251
+ createCollabToken(request: AthenaIntelligence.CollabTokenRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.CollabTokenResponse>;
252
+ private __createCollabToken;
238
253
  /**
239
254
  * 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.
240
255
  * @throws {@link AthenaIntelligence.BadRequestError}
@@ -244,7 +244,7 @@ class AssetsClient {
244
244
  });
245
245
  }
246
246
  /**
247
- * Create a new asset such as a spreadsheet, document, folder, database, or computer in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration. Computer assets return 202 after the initializing asset is committed; runtime provisioning continues asynchronously.
247
+ * Create a new asset such as a spreadsheet, document, folder, database, computer, or generic doc (admin-only) in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration. Computer assets return 202 after the initializing asset is committed; runtime provisioning continues asynchronously.
248
248
  *
249
249
  * @param {AthenaIntelligence.CreateAssetRequestIn} request
250
250
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -1028,6 +1028,82 @@ class AssetsClient {
1028
1028
  }
1029
1029
  });
1030
1030
  }
1031
+ /**
1032
+ * Admin only. Mint a short-lived Keryx capability token for a Generic Doc asset, enabling live collaborative reads (and, with edit permission, writes) over WebSocket and REST. Only generic_doc assets are eligible — Athena-managed asset types are never reachable through this endpoint. The requested access is a ceiling clamped by the caller's permission on the asset.
1033
+ *
1034
+ * @param {AthenaIntelligence.CollabTokenRequest} request
1035
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
1036
+ *
1037
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
1038
+ *
1039
+ * @example
1040
+ * await client.assets.createCollabToken({
1041
+ * asset_id: "asset_id"
1042
+ * })
1043
+ */
1044
+ createCollabToken(request, requestOptions) {
1045
+ return core.HttpResponsePromise.fromPromise(this.__createCollabToken(request, requestOptions));
1046
+ }
1047
+ __createCollabToken(request, requestOptions) {
1048
+ return __awaiter(this, void 0, void 0, function* () {
1049
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1050
+ const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
1051
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1052
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1053
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1054
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/assets/${core.url.encodePathParam(assetId)}/collab-token`),
1055
+ method: "POST",
1056
+ headers: _headers,
1057
+ contentType: "application/json",
1058
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1059
+ requestType: "json",
1060
+ body: _body,
1061
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1062
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1063
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1064
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1065
+ logging: this._options.logging,
1066
+ });
1067
+ if (_response.ok) {
1068
+ return {
1069
+ data: _response.body,
1070
+ rawResponse: _response.rawResponse,
1071
+ };
1072
+ }
1073
+ if (_response.error.reason === "status-code") {
1074
+ switch (_response.error.statusCode) {
1075
+ case 422:
1076
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
1077
+ default:
1078
+ throw new errors.AthenaIntelligenceError({
1079
+ statusCode: _response.error.statusCode,
1080
+ body: _response.error.body,
1081
+ rawResponse: _response.rawResponse,
1082
+ });
1083
+ }
1084
+ }
1085
+ switch (_response.error.reason) {
1086
+ case "non-json":
1087
+ throw new errors.AthenaIntelligenceError({
1088
+ statusCode: _response.error.statusCode,
1089
+ body: _response.error.rawBody,
1090
+ rawResponse: _response.rawResponse,
1091
+ });
1092
+ case "body-is-null":
1093
+ throw new errors.AthenaIntelligenceError({
1094
+ statusCode: _response.error.statusCode,
1095
+ rawResponse: _response.rawResponse,
1096
+ });
1097
+ case "timeout":
1098
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/assets/{asset_id}/collab-token.");
1099
+ case "unknown":
1100
+ throw new errors.AthenaIntelligenceError({
1101
+ message: _response.error.errorMessage,
1102
+ rawResponse: _response.rawResponse,
1103
+ });
1104
+ }
1105
+ });
1106
+ }
1031
1107
  /**
1032
1108
  * 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.
1033
1109
  * @throws {@link AthenaIntelligence.BadRequestError}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * asset_id: "asset_id"
5
+ * }
6
+ */
7
+ export interface CollabTokenRequest {
8
+ asset_id: string;
9
+ /** Requested access ceiling. This is a ceiling, not a grant: 'edit' is clamped to read-only unless the caller has edit permission on the asset. */
10
+ access?: CollabTokenRequest.Access;
11
+ }
12
+ export declare namespace CollabTokenRequest {
13
+ /** Requested access ceiling. This is a ceiling, not a grant: 'edit' is clamped to read-only unless the caller has edit permission on the asset. */
14
+ const Access: {
15
+ readonly View: "view";
16
+ readonly Edit: "edit";
17
+ };
18
+ type Access = (typeof Access)[keyof typeof Access];
19
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CollabTokenRequest = void 0;
5
+ var CollabTokenRequest;
6
+ (function (CollabTokenRequest) {
7
+ /** Requested access ceiling. This is a ceiling, not a grant: 'edit' is clamped to read-only unless the caller has edit permission on the asset. */
8
+ CollabTokenRequest.Access = {
9
+ View: "view",
10
+ Edit: "edit",
11
+ };
12
+ })(CollabTokenRequest || (exports.CollabTokenRequest = CollabTokenRequest = {}));
@@ -1,5 +1,6 @@
1
1
  export type { ArchiveAssetsRequest } from "./ArchiveAssetsRequest.js";
2
2
  export type { AssetActivityDeltaBatchRequestIn } from "./AssetActivityDeltaBatchRequestIn.js";
3
+ export type { CollabTokenRequest } from "./CollabTokenRequest.js";
3
4
  export type { ConvertExcelToSheetRequestIn } from "./ConvertExcelToSheetRequestIn.js";
4
5
  export type { CreateAssetRequestIn } from "./CreateAssetRequestIn.js";
5
6
  export type { CreateProjectRequestIn } from "./CreateProjectRequestIn.js";
@@ -0,0 +1,26 @@
1
+ export interface CollabTokenResponse {
2
+ /** Granted access: r = read + live subscribe, rw = read-write. */
3
+ access_type: CollabTokenResponse.AccessType;
4
+ /** Document branch. */
5
+ branch?: string;
6
+ /** Keryx document id within the org. */
7
+ doc_id: string;
8
+ /** Token expiry in epoch milliseconds. Re-mint before this passes; the @athenaintel/react collab client does so automatically. */
9
+ expires_at_ms: number;
10
+ /** Keryx org (room namespace) for the document. */
11
+ org: string;
12
+ /** REST base URL. Endpoints follow {rest_url}/{name}/v1/{org}/{doc_id} (ydoc, activity, changeset). */
13
+ rest_url: string;
14
+ /** Keryx capability token (yauth). Pass as the yauth query parameter on the WebSocket upgrade and REST requests. Room-bound: valid only for this asset's document. */
15
+ token: string;
16
+ /** WebSocket base URL. Connect to {ws_url}/{org}/{doc_id}?yauth={token}. */
17
+ ws_url: string;
18
+ }
19
+ export declare namespace CollabTokenResponse {
20
+ /** Granted access: r = read + live subscribe, rw = read-write. */
21
+ const AccessType: {
22
+ readonly R: "r";
23
+ readonly Rw: "rw";
24
+ };
25
+ type AccessType = (typeof AccessType)[keyof typeof AccessType];
26
+ }
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.CollabTokenResponse = void 0;
5
+ var CollabTokenResponse;
6
+ (function (CollabTokenResponse) {
7
+ /** Granted access: r = read + live subscribe, rw = read-write. */
8
+ CollabTokenResponse.AccessType = {
9
+ R: "r",
10
+ Rw: "rw",
11
+ };
12
+ })(CollabTokenResponse || (exports.CollabTokenResponse = CollabTokenResponse = {}));
@@ -5,5 +5,6 @@ export declare const CreatableAssetType: {
5
5
  readonly Folder: "folder";
6
6
  readonly Database: "database";
7
7
  readonly Computer: "computer";
8
+ readonly GenericDoc: "generic_doc";
8
9
  };
9
10
  export type CreatableAssetType = (typeof CreatableAssetType)[keyof typeof CreatableAssetType];
@@ -9,4 +9,5 @@ exports.CreatableAssetType = {
9
9
  Folder: "folder",
10
10
  Database: "database",
11
11
  Computer: "computer",
12
+ GenericDoc: "generic_doc",
12
13
  };
@@ -28,6 +28,7 @@ export * from "./Chunk.js";
28
28
  export * from "./ChunkContentItem.js";
29
29
  export * from "./ChunkResult.js";
30
30
  export * from "./CollabAgentSendMessageResponseOut.js";
31
+ export * from "./CollabTokenResponse.js";
31
32
  export * from "./ConversationAssetInfo.js";
32
33
  export * from "./ConversationMessage.js";
33
34
  export * from "./ConversationResult.js";
@@ -44,6 +44,7 @@ __exportStar(require("./Chunk.js"), exports);
44
44
  __exportStar(require("./ChunkContentItem.js"), exports);
45
45
  __exportStar(require("./ChunkResult.js"), exports);
46
46
  __exportStar(require("./CollabAgentSendMessageResponseOut.js"), exports);
47
+ __exportStar(require("./CollabTokenResponse.js"), exports);
47
48
  __exportStar(require("./ConversationAssetInfo.js"), exports);
48
49
  __exportStar(require("./ConversationMessage.js"), exports);
49
50
  __exportStar(require("./ConversationResult.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.2141";
1
+ export declare const SDK_VERSION = "4.3.2142";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "4.3.2141";
4
+ exports.SDK_VERSION = "4.3.2142";
@@ -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.2141",
10
- "User-Agent": "@athenaintel/sdk/4.3.2141",
9
+ "X-Fern-SDK-Version": "4.3.2142",
10
+ "User-Agent": "@athenaintel/sdk/4.3.2142",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  }, options === null || options === void 0 ? void 0 : options.headers);
@@ -48,7 +48,7 @@ export declare class AssetsClient {
48
48
  convertExcelToSheet(request: AthenaIntelligence.ConvertExcelToSheetRequestIn, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ConvertExcelToSheetResponseOut>;
49
49
  private __convertExcelToSheet;
50
50
  /**
51
- * Create a new asset such as a spreadsheet, document, folder, database, or computer in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration. Computer assets return 202 after the initializing asset is committed; runtime provisioning continues asynchronously.
51
+ * Create a new asset such as a spreadsheet, document, folder, database, computer, or generic doc (admin-only) in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration. Computer assets return 202 after the initializing asset is committed; runtime provisioning continues asynchronously.
52
52
  *
53
53
  * @param {AthenaIntelligence.CreateAssetRequestIn} request
54
54
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -235,6 +235,21 @@ export declare class AssetsClient {
235
235
  */
236
236
  archive(request: AthenaIntelligence.ArchiveAssetsRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.ArchiveAssetResponseOut>;
237
237
  private __archive;
238
+ /**
239
+ * Admin only. Mint a short-lived Keryx capability token for a Generic Doc asset, enabling live collaborative reads (and, with edit permission, writes) over WebSocket and REST. Only generic_doc assets are eligible — Athena-managed asset types are never reachable through this endpoint. The requested access is a ceiling clamped by the caller's permission on the asset.
240
+ *
241
+ * @param {AthenaIntelligence.CollabTokenRequest} request
242
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
243
+ *
244
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
245
+ *
246
+ * @example
247
+ * await client.assets.createCollabToken({
248
+ * asset_id: "asset_id"
249
+ * })
250
+ */
251
+ createCollabToken(request: AthenaIntelligence.CollabTokenRequest, requestOptions?: AssetsClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.CollabTokenResponse>;
252
+ private __createCollabToken;
238
253
  /**
239
254
  * 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.
240
255
  * @throws {@link AthenaIntelligence.BadRequestError}
@@ -208,7 +208,7 @@ export class AssetsClient {
208
208
  });
209
209
  }
210
210
  /**
211
- * Create a new asset such as a spreadsheet, document, folder, database, or computer in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration. Computer assets return 202 after the initializing asset is committed; runtime provisioning continues asynchronously.
211
+ * Create a new asset such as a spreadsheet, document, folder, database, computer, or generic doc (admin-only) in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration. Computer assets return 202 after the initializing asset is committed; runtime provisioning continues asynchronously.
212
212
  *
213
213
  * @param {AthenaIntelligence.CreateAssetRequestIn} request
214
214
  * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -992,6 +992,82 @@ export class AssetsClient {
992
992
  }
993
993
  });
994
994
  }
995
+ /**
996
+ * Admin only. Mint a short-lived Keryx capability token for a Generic Doc asset, enabling live collaborative reads (and, with edit permission, writes) over WebSocket and REST. Only generic_doc assets are eligible — Athena-managed asset types are never reachable through this endpoint. The requested access is a ceiling clamped by the caller's permission on the asset.
997
+ *
998
+ * @param {AthenaIntelligence.CollabTokenRequest} request
999
+ * @param {AssetsClient.RequestOptions} requestOptions - Request-specific configuration.
1000
+ *
1001
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
1002
+ *
1003
+ * @example
1004
+ * await client.assets.createCollabToken({
1005
+ * asset_id: "asset_id"
1006
+ * })
1007
+ */
1008
+ createCollabToken(request, requestOptions) {
1009
+ return core.HttpResponsePromise.fromPromise(this.__createCollabToken(request, requestOptions));
1010
+ }
1011
+ __createCollabToken(request, requestOptions) {
1012
+ return __awaiter(this, void 0, void 0, function* () {
1013
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
1014
+ const { asset_id: assetId } = request, _body = __rest(request, ["asset_id"]);
1015
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
1016
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
1017
+ const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
1018
+ url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.AthenaIntelligenceEnvironment.Production, `api/v0/assets/${core.url.encodePathParam(assetId)}/collab-token`),
1019
+ method: "POST",
1020
+ headers: _headers,
1021
+ contentType: "application/json",
1022
+ queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
1023
+ requestType: "json",
1024
+ body: _body,
1025
+ timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
1026
+ maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
1027
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
1028
+ fetchFn: (_k = this._options) === null || _k === void 0 ? void 0 : _k.fetch,
1029
+ logging: this._options.logging,
1030
+ });
1031
+ if (_response.ok) {
1032
+ return {
1033
+ data: _response.body,
1034
+ rawResponse: _response.rawResponse,
1035
+ };
1036
+ }
1037
+ if (_response.error.reason === "status-code") {
1038
+ switch (_response.error.statusCode) {
1039
+ case 422:
1040
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
1041
+ default:
1042
+ throw new errors.AthenaIntelligenceError({
1043
+ statusCode: _response.error.statusCode,
1044
+ body: _response.error.body,
1045
+ rawResponse: _response.rawResponse,
1046
+ });
1047
+ }
1048
+ }
1049
+ switch (_response.error.reason) {
1050
+ case "non-json":
1051
+ throw new errors.AthenaIntelligenceError({
1052
+ statusCode: _response.error.statusCode,
1053
+ body: _response.error.rawBody,
1054
+ rawResponse: _response.rawResponse,
1055
+ });
1056
+ case "body-is-null":
1057
+ throw new errors.AthenaIntelligenceError({
1058
+ statusCode: _response.error.statusCode,
1059
+ rawResponse: _response.rawResponse,
1060
+ });
1061
+ case "timeout":
1062
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling POST /api/v0/assets/{asset_id}/collab-token.");
1063
+ case "unknown":
1064
+ throw new errors.AthenaIntelligenceError({
1065
+ message: _response.error.errorMessage,
1066
+ rawResponse: _response.rawResponse,
1067
+ });
1068
+ }
1069
+ });
1070
+ }
995
1071
  /**
996
1072
  * 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.
997
1073
  * @throws {@link AthenaIntelligence.BadRequestError}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * asset_id: "asset_id"
5
+ * }
6
+ */
7
+ export interface CollabTokenRequest {
8
+ asset_id: string;
9
+ /** Requested access ceiling. This is a ceiling, not a grant: 'edit' is clamped to read-only unless the caller has edit permission on the asset. */
10
+ access?: CollabTokenRequest.Access;
11
+ }
12
+ export declare namespace CollabTokenRequest {
13
+ /** Requested access ceiling. This is a ceiling, not a grant: 'edit' is clamped to read-only unless the caller has edit permission on the asset. */
14
+ const Access: {
15
+ readonly View: "view";
16
+ readonly Edit: "edit";
17
+ };
18
+ type Access = (typeof Access)[keyof typeof Access];
19
+ }
@@ -0,0 +1,9 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var CollabTokenRequest;
3
+ (function (CollabTokenRequest) {
4
+ /** Requested access ceiling. This is a ceiling, not a grant: 'edit' is clamped to read-only unless the caller has edit permission on the asset. */
5
+ CollabTokenRequest.Access = {
6
+ View: "view",
7
+ Edit: "edit",
8
+ };
9
+ })(CollabTokenRequest || (CollabTokenRequest = {}));
@@ -1,5 +1,6 @@
1
1
  export type { ArchiveAssetsRequest } from "./ArchiveAssetsRequest.mjs";
2
2
  export type { AssetActivityDeltaBatchRequestIn } from "./AssetActivityDeltaBatchRequestIn.mjs";
3
+ export type { CollabTokenRequest } from "./CollabTokenRequest.mjs";
3
4
  export type { ConvertExcelToSheetRequestIn } from "./ConvertExcelToSheetRequestIn.mjs";
4
5
  export type { CreateAssetRequestIn } from "./CreateAssetRequestIn.mjs";
5
6
  export type { CreateProjectRequestIn } from "./CreateProjectRequestIn.mjs";
@@ -0,0 +1,26 @@
1
+ export interface CollabTokenResponse {
2
+ /** Granted access: r = read + live subscribe, rw = read-write. */
3
+ access_type: CollabTokenResponse.AccessType;
4
+ /** Document branch. */
5
+ branch?: string;
6
+ /** Keryx document id within the org. */
7
+ doc_id: string;
8
+ /** Token expiry in epoch milliseconds. Re-mint before this passes; the @athenaintel/react collab client does so automatically. */
9
+ expires_at_ms: number;
10
+ /** Keryx org (room namespace) for the document. */
11
+ org: string;
12
+ /** REST base URL. Endpoints follow {rest_url}/{name}/v1/{org}/{doc_id} (ydoc, activity, changeset). */
13
+ rest_url: string;
14
+ /** Keryx capability token (yauth). Pass as the yauth query parameter on the WebSocket upgrade and REST requests. Room-bound: valid only for this asset's document. */
15
+ token: string;
16
+ /** WebSocket base URL. Connect to {ws_url}/{org}/{doc_id}?yauth={token}. */
17
+ ws_url: string;
18
+ }
19
+ export declare namespace CollabTokenResponse {
20
+ /** Granted access: r = read + live subscribe, rw = read-write. */
21
+ const AccessType: {
22
+ readonly R: "r";
23
+ readonly Rw: "rw";
24
+ };
25
+ type AccessType = (typeof AccessType)[keyof typeof AccessType];
26
+ }
@@ -0,0 +1,9 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export var CollabTokenResponse;
3
+ (function (CollabTokenResponse) {
4
+ /** Granted access: r = read + live subscribe, rw = read-write. */
5
+ CollabTokenResponse.AccessType = {
6
+ R: "r",
7
+ Rw: "rw",
8
+ };
9
+ })(CollabTokenResponse || (CollabTokenResponse = {}));
@@ -5,5 +5,6 @@ export declare const CreatableAssetType: {
5
5
  readonly Folder: "folder";
6
6
  readonly Database: "database";
7
7
  readonly Computer: "computer";
8
+ readonly GenericDoc: "generic_doc";
8
9
  };
9
10
  export type CreatableAssetType = (typeof CreatableAssetType)[keyof typeof CreatableAssetType];
@@ -6,4 +6,5 @@ export const CreatableAssetType = {
6
6
  Folder: "folder",
7
7
  Database: "database",
8
8
  Computer: "computer",
9
+ GenericDoc: "generic_doc",
9
10
  };
@@ -28,6 +28,7 @@ export * from "./Chunk.mjs";
28
28
  export * from "./ChunkContentItem.mjs";
29
29
  export * from "./ChunkResult.mjs";
30
30
  export * from "./CollabAgentSendMessageResponseOut.mjs";
31
+ export * from "./CollabTokenResponse.mjs";
31
32
  export * from "./ConversationAssetInfo.mjs";
32
33
  export * from "./ConversationMessage.mjs";
33
34
  export * from "./ConversationResult.mjs";
@@ -28,6 +28,7 @@ export * from "./Chunk.mjs";
28
28
  export * from "./ChunkContentItem.mjs";
29
29
  export * from "./ChunkResult.mjs";
30
30
  export * from "./CollabAgentSendMessageResponseOut.mjs";
31
+ export * from "./CollabTokenResponse.mjs";
31
32
  export * from "./ConversationAssetInfo.mjs";
32
33
  export * from "./ConversationMessage.mjs";
33
34
  export * from "./ConversationResult.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.2141";
1
+ export declare const SDK_VERSION = "4.3.2142";
@@ -1 +1 @@
1
- export const SDK_VERSION = "4.3.2141";
1
+ export const SDK_VERSION = "4.3.2142";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenaintel/sdk",
3
- "version": "4.3.2141",
3
+ "version": "4.3.2142",
4
4
  "private": false,
5
5
  "repository": "github:Athena-Intel/athena-typescript",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -568,7 +568,7 @@ await client.assets.convertExcelToSheet({
568
568
  <dl>
569
569
  <dd>
570
570
 
571
- Create a new asset such as a spreadsheet, document, folder, database, or computer in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration. Computer assets return 202 after the initializing asset is committed; runtime provisioning continues asynchronously.
571
+ Create a new asset such as a spreadsheet, document, folder, database, computer, or generic doc (admin-only) in your workspace. This endpoint uses internal GraphQL mutations to create assets with proper permissions and workspace integration. Computer assets return 202 after the initializing asset is committed; runtime provisioning continues asynchronously.
572
572
  </dd>
573
573
  </dl>
574
574
  </dd>
@@ -1162,6 +1162,71 @@ await client.assets.archive({
1162
1162
  </dl>
1163
1163
 
1164
1164
 
1165
+ </dd>
1166
+ </dl>
1167
+ </details>
1168
+
1169
+ <details><summary><code>client.assets.<a href="/src/api/resources/assets/client/Client.ts">createCollabToken</a>({ ...params }) -> AthenaIntelligence.CollabTokenResponse</code></summary>
1170
+ <dl>
1171
+ <dd>
1172
+
1173
+ #### 📝 Description
1174
+
1175
+ <dl>
1176
+ <dd>
1177
+
1178
+ <dl>
1179
+ <dd>
1180
+
1181
+ Admin only. Mint a short-lived Keryx capability token for a Generic Doc asset, enabling live collaborative reads (and, with edit permission, writes) over WebSocket and REST. Only generic_doc assets are eligible — Athena-managed asset types are never reachable through this endpoint. The requested access is a ceiling clamped by the caller's permission on the asset.
1182
+ </dd>
1183
+ </dl>
1184
+ </dd>
1185
+ </dl>
1186
+
1187
+ #### 🔌 Usage
1188
+
1189
+ <dl>
1190
+ <dd>
1191
+
1192
+ <dl>
1193
+ <dd>
1194
+
1195
+ ```typescript
1196
+ await client.assets.createCollabToken({
1197
+ asset_id: "asset_id"
1198
+ });
1199
+
1200
+ ```
1201
+ </dd>
1202
+ </dl>
1203
+ </dd>
1204
+ </dl>
1205
+
1206
+ #### ⚙️ Parameters
1207
+
1208
+ <dl>
1209
+ <dd>
1210
+
1211
+ <dl>
1212
+ <dd>
1213
+
1214
+ **request:** `AthenaIntelligence.CollabTokenRequest`
1215
+
1216
+ </dd>
1217
+ </dl>
1218
+
1219
+ <dl>
1220
+ <dd>
1221
+
1222
+ **requestOptions:** `AssetsClient.RequestOptions`
1223
+
1224
+ </dd>
1225
+ </dl>
1226
+ </dd>
1227
+ </dl>
1228
+
1229
+
1165
1230
  </dd>
1166
1231
  </dl>
1167
1232
  </details>