@credal/sdk 0.1.3 → 0.1.5
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/Client.d.ts +0 -3
- package/dist/cjs/Client.js +6 -11
- package/dist/cjs/api/resources/{permissionsService/types/Group.d.ts → common/types/CustomMetadataValue.d.ts} +1 -4
- package/dist/cjs/api/resources/common/types/index.d.ts +1 -0
- package/dist/cjs/api/resources/common/types/index.js +1 -0
- package/dist/cjs/api/resources/copilots/client/Client.js +9 -9
- package/dist/cjs/api/resources/documentCatalog/client/Client.js +3 -3
- package/dist/cjs/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +5 -2
- package/dist/cjs/api/resources/documentCollections/client/Client.js +7 -7
- package/dist/cjs/api/resources/index.d.ts +0 -3
- package/dist/cjs/api/resources/index.js +1 -4
- package/dist/cjs/api/resources/search/client/Client.js +1 -1
- package/dist/cjs/api/resources/users/client/Client.js +1 -1
- package/dist/cjs/core/auth/index.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.js +2 -2
- package/dist/cjs/core/fetcher/index.d.ts +5 -5
- package/dist/cjs/core/fetcher/index.js +5 -5
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/Client.d.mts +0 -3
- package/dist/esm/Client.mjs +2 -7
- package/dist/esm/api/resources/{permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.mjs → common/types/CustomMetadataValue.d.mts} +1 -1
- package/dist/esm/api/resources/common/types/index.d.mts +1 -0
- package/dist/esm/api/resources/common/types/index.mjs +1 -0
- package/dist/esm/api/resources/copilots/client/Client.mjs +9 -9
- package/dist/esm/api/resources/documentCatalog/client/Client.mjs +3 -3
- package/dist/esm/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.mts +5 -2
- package/dist/esm/api/resources/documentCollections/client/Client.mjs +7 -7
- package/dist/esm/api/resources/index.d.mts +0 -3
- package/dist/esm/api/resources/index.mjs +0 -3
- package/dist/esm/api/resources/search/client/Client.mjs +1 -1
- package/dist/esm/api/resources/users/client/Client.mjs +1 -1
- package/dist/esm/core/auth/index.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.mjs +2 -2
- package/dist/esm/core/fetcher/index.d.mts +5 -5
- package/dist/esm/core/fetcher/index.mjs +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +0 -213
- package/dist/cjs/api/resources/permissionsService/client/Client.d.ts +0 -86
- package/dist/cjs/api/resources/permissionsService/client/Client.js +0 -260
- package/dist/cjs/api/resources/permissionsService/client/index.d.ts +0 -2
- package/dist/cjs/api/resources/permissionsService/client/index.js +0 -17
- package/dist/cjs/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +0 -26
- package/dist/cjs/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +0 -23
- package/dist/cjs/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.js +0 -5
- package/dist/cjs/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.ts +0 -20
- package/dist/cjs/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.js +0 -5
- package/dist/cjs/api/resources/permissionsService/client/requests/index.d.ts +0 -3
- package/dist/cjs/api/resources/permissionsService/client/requests/index.js +0 -2
- package/dist/cjs/api/resources/permissionsService/index.d.ts +0 -2
- package/dist/cjs/api/resources/permissionsService/index.js +0 -18
- package/dist/cjs/api/resources/permissionsService/types/Action.d.ts +0 -7
- package/dist/cjs/api/resources/permissionsService/types/Action.js +0 -9
- package/dist/cjs/api/resources/permissionsService/types/AuthorizedResource.d.ts +0 -8
- package/dist/cjs/api/resources/permissionsService/types/AuthorizedResource.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/AuthorizedResourceListPage.d.ts +0 -5
- package/dist/cjs/api/resources/permissionsService/types/AuthorizedResourceListPage.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.ts +0 -5
- package/dist/cjs/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.d.ts +0 -6
- package/dist/cjs/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/Group.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/Principal.d.ts +0 -13
- package/dist/cjs/api/resources/permissionsService/types/Principal.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/PrincipalListPage.d.ts +0 -8
- package/dist/cjs/api/resources/permissionsService/types/PrincipalListPage.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/ResourceAuthorizationResult.d.ts +0 -9
- package/dist/cjs/api/resources/permissionsService/types/ResourceAuthorizationResult.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/User.d.ts +0 -8
- package/dist/cjs/api/resources/permissionsService/types/User.js +0 -5
- package/dist/cjs/api/resources/permissionsService/types/index.d.ts +0 -10
- package/dist/cjs/api/resources/permissionsService/types/index.js +0 -26
- package/dist/esm/api/resources/permissionsService/client/Client.d.mts +0 -86
- package/dist/esm/api/resources/permissionsService/client/Client.mjs +0 -223
- package/dist/esm/api/resources/permissionsService/client/index.d.mts +0 -2
- package/dist/esm/api/resources/permissionsService/client/index.mjs +0 -1
- package/dist/esm/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.mts +0 -26
- package/dist/esm/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.mts +0 -23
- package/dist/esm/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.mts +0 -20
- package/dist/esm/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/client/requests/index.d.mts +0 -3
- package/dist/esm/api/resources/permissionsService/client/requests/index.mjs +0 -1
- package/dist/esm/api/resources/permissionsService/index.d.mts +0 -2
- package/dist/esm/api/resources/permissionsService/index.mjs +0 -2
- package/dist/esm/api/resources/permissionsService/types/Action.d.mts +0 -7
- package/dist/esm/api/resources/permissionsService/types/Action.mjs +0 -6
- package/dist/esm/api/resources/permissionsService/types/AuthorizedResource.d.mts +0 -8
- package/dist/esm/api/resources/permissionsService/types/AuthorizedResource.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/AuthorizedResourceListPage.d.mts +0 -5
- package/dist/esm/api/resources/permissionsService/types/AuthorizedResourceListPage.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.mts +0 -5
- package/dist/esm/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.d.mts +0 -6
- package/dist/esm/api/resources/permissionsService/types/CheckResourceAuthorizationResponse.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/Group.d.mts +0 -7
- package/dist/esm/api/resources/permissionsService/types/Group.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/Principal.d.mts +0 -13
- package/dist/esm/api/resources/permissionsService/types/Principal.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/PrincipalListPage.d.mts +0 -8
- package/dist/esm/api/resources/permissionsService/types/PrincipalListPage.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/ResourceAuthorizationResult.d.mts +0 -9
- package/dist/esm/api/resources/permissionsService/types/ResourceAuthorizationResult.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/User.d.mts +0 -8
- package/dist/esm/api/resources/permissionsService/types/User.mjs +0 -4
- package/dist/esm/api/resources/permissionsService/types/index.d.mts +0 -10
- package/dist/esm/api/resources/permissionsService/types/index.mjs +0 -10
- /package/dist/cjs/api/resources/{permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.js → common/types/CustomMetadataValue.js} +0 -0
- /package/dist/esm/api/resources/{permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.mjs → common/types/CustomMetadataValue.mjs} +0 -0
|
@@ -37,7 +37,7 @@ export class DocumentCatalog {
|
|
|
37
37
|
__uploadDocumentContents(request, requestOptions) {
|
|
38
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
39
|
var _a, _b, _c, _d;
|
|
40
|
-
|
|
40
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
41
41
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
42
42
|
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.CredalEnvironment.Production, "/v0/catalog/uploadDocumentContents"),
|
|
43
43
|
method: "POST",
|
|
@@ -95,7 +95,7 @@ export class DocumentCatalog {
|
|
|
95
95
|
__syncSourceByUrl(request, requestOptions) {
|
|
96
96
|
return __awaiter(this, void 0, void 0, function* () {
|
|
97
97
|
var _a, _b, _c, _d;
|
|
98
|
-
|
|
98
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
99
99
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
100
100
|
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.CredalEnvironment.Production, "/v0/catalog/syncSourceByUrl"),
|
|
101
101
|
method: "POST",
|
|
@@ -173,7 +173,7 @@ export class DocumentCatalog {
|
|
|
173
173
|
__metadata(request, requestOptions) {
|
|
174
174
|
return __awaiter(this, void 0, void 0, function* () {
|
|
175
175
|
var _a, _b, _c, _d;
|
|
176
|
-
|
|
176
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
177
177
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
178
178
|
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.CredalEnvironment.Production, "/v0/catalog/metadata"),
|
|
179
179
|
method: "PATCH",
|
package/dist/esm/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
+
import * as Credal from "../../../../index.mjs";
|
|
4
5
|
/**
|
|
5
6
|
* @example
|
|
6
7
|
* {
|
|
@@ -25,11 +26,13 @@ export interface UploadDocumentContentsRequest {
|
|
|
25
26
|
/** The external URL of the document you want to upload. If provided Credal will link to this URL. */
|
|
26
27
|
documentExternalUrl?: string;
|
|
27
28
|
/** Optional JSON representing any custom metadata for this document */
|
|
28
|
-
customMetadata?: Record<string,
|
|
29
|
-
/** If specified, document will also be added to
|
|
29
|
+
customMetadata?: Record<string, Credal.CustomMetadataValue>;
|
|
30
|
+
/** If specified, the document will also be added to the provided document collection. The document does not immediately start appearing in searches of that collection due to an asynchronous embedding process. To await this process and have this endpoint return only when that embedding process is complete, use the `awaitVectorStoreSync` parameter. */
|
|
30
31
|
collectionId?: string;
|
|
31
32
|
/** If specified, document contents will be re-uploaded and re-embedded even if the document already exists in Credal */
|
|
32
33
|
forceUpdate?: boolean;
|
|
33
34
|
/** If specified, document will be accessible to everyone within the organization of the uploader */
|
|
34
35
|
internalPublic?: boolean;
|
|
36
|
+
/** If specified, the API will wait for the vector store to be updated before returning. This is useful if you want to ensure that the document is immediately searchable after this call returns. */
|
|
37
|
+
awaitVectorStoreSync?: boolean;
|
|
35
38
|
}
|
|
@@ -44,7 +44,7 @@ export class DocumentCollections {
|
|
|
44
44
|
__addDocumentsToCollection(request, requestOptions) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
var _a, _b, _c, _d;
|
|
47
|
-
|
|
47
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
48
48
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
49
49
|
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.CredalEnvironment.Production, "/v0/documentCollections/addDocumentsToCollection"),
|
|
50
50
|
method: "POST",
|
|
@@ -110,7 +110,7 @@ export class DocumentCollections {
|
|
|
110
110
|
__removeDocumentsFromCollection(request, requestOptions) {
|
|
111
111
|
return __awaiter(this, void 0, void 0, function* () {
|
|
112
112
|
var _a, _b, _c, _d;
|
|
113
|
-
|
|
113
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
114
114
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
115
115
|
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.CredalEnvironment.Production, "/v0/documentCollections/removeDocumentsFromCollection"),
|
|
116
116
|
method: "DELETE",
|
|
@@ -170,7 +170,7 @@ export class DocumentCollections {
|
|
|
170
170
|
const { collectionId } = request;
|
|
171
171
|
const _queryParams = {};
|
|
172
172
|
_queryParams["collectionId"] = collectionId;
|
|
173
|
-
|
|
173
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
174
174
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
175
175
|
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.CredalEnvironment.Production, "/v0/documentCollections/listDocumentsInCollection"),
|
|
176
176
|
method: "GET",
|
|
@@ -232,7 +232,7 @@ export class DocumentCollections {
|
|
|
232
232
|
__createCollection(request, requestOptions) {
|
|
233
233
|
return __awaiter(this, void 0, void 0, function* () {
|
|
234
234
|
var _a, _b, _c, _d;
|
|
235
|
-
|
|
235
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
236
236
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
237
237
|
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.CredalEnvironment.Production, "/v0/documentCollections/createCollection"),
|
|
238
238
|
method: "POST",
|
|
@@ -289,7 +289,7 @@ export class DocumentCollections {
|
|
|
289
289
|
__deleteCollection(request, requestOptions) {
|
|
290
290
|
return __awaiter(this, void 0, void 0, function* () {
|
|
291
291
|
var _a, _b, _c, _d;
|
|
292
|
-
|
|
292
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
293
293
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
294
294
|
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.CredalEnvironment.Production, "/v0/documentCollections/deleteCollection"),
|
|
295
295
|
method: "DELETE",
|
|
@@ -362,7 +362,7 @@ export class DocumentCollections {
|
|
|
362
362
|
__createMongoCollectionSync(request, requestOptions) {
|
|
363
363
|
return __awaiter(this, void 0, void 0, function* () {
|
|
364
364
|
var _a, _b, _c, _d;
|
|
365
|
-
|
|
365
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
366
366
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
367
367
|
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.CredalEnvironment.Production, "/v0/documentCollections/mongodb/createMongoSync"),
|
|
368
368
|
method: "POST",
|
|
@@ -435,7 +435,7 @@ export class DocumentCollections {
|
|
|
435
435
|
__updateMongoCollectionSync(request, requestOptions) {
|
|
436
436
|
return __awaiter(this, void 0, void 0, function* () {
|
|
437
437
|
var _a, _b, _c, _d;
|
|
438
|
-
|
|
438
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
439
439
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
440
440
|
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.CredalEnvironment.Production, "/v0/documentCollections/mongodb/updateMongoSync"),
|
|
441
441
|
method: "POST",
|
|
@@ -6,8 +6,6 @@ export * as documentCatalog from "./documentCatalog/index.mjs";
|
|
|
6
6
|
export * from "./documentCatalog/types/index.mjs";
|
|
7
7
|
export * as documentCollections from "./documentCollections/index.mjs";
|
|
8
8
|
export * from "./documentCollections/types/index.mjs";
|
|
9
|
-
export * as permissionsService from "./permissionsService/index.mjs";
|
|
10
|
-
export * from "./permissionsService/types/index.mjs";
|
|
11
9
|
export * as search from "./search/index.mjs";
|
|
12
10
|
export * from "./search/types/index.mjs";
|
|
13
11
|
export * as users from "./users/index.mjs";
|
|
@@ -15,5 +13,4 @@ export * from "./users/types/index.mjs";
|
|
|
15
13
|
export * from "./copilots/client/requests/index.mjs";
|
|
16
14
|
export * from "./documentCatalog/client/requests/index.mjs";
|
|
17
15
|
export * from "./documentCollections/client/requests/index.mjs";
|
|
18
|
-
export * from "./permissionsService/client/requests/index.mjs";
|
|
19
16
|
export * from "./search/client/requests/index.mjs";
|
|
@@ -6,8 +6,6 @@ export * as documentCatalog from "./documentCatalog/index.mjs";
|
|
|
6
6
|
export * from "./documentCatalog/types/index.mjs";
|
|
7
7
|
export * as documentCollections from "./documentCollections/index.mjs";
|
|
8
8
|
export * from "./documentCollections/types/index.mjs";
|
|
9
|
-
export * as permissionsService from "./permissionsService/index.mjs";
|
|
10
|
-
export * from "./permissionsService/types/index.mjs";
|
|
11
9
|
export * as search from "./search/index.mjs";
|
|
12
10
|
export * from "./search/types/index.mjs";
|
|
13
11
|
export * as users from "./users/index.mjs";
|
|
@@ -15,5 +13,4 @@ export * from "./users/types/index.mjs";
|
|
|
15
13
|
export * from "./copilots/client/requests/index.mjs";
|
|
16
14
|
export * from "./documentCatalog/client/requests/index.mjs";
|
|
17
15
|
export * from "./documentCollections/client/requests/index.mjs";
|
|
18
|
-
export * from "./permissionsService/client/requests/index.mjs";
|
|
19
16
|
export * from "./search/client/requests/index.mjs";
|
|
@@ -50,7 +50,7 @@ export class Search {
|
|
|
50
50
|
__searchDocumentCollection(request, requestOptions) {
|
|
51
51
|
return __awaiter(this, void 0, void 0, function* () {
|
|
52
52
|
var _a, _b, _c, _d;
|
|
53
|
-
|
|
53
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
54
54
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
55
55
|
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.CredalEnvironment.Production, "/v0/search/searchDocumentCollection"),
|
|
56
56
|
method: "POST",
|
|
@@ -45,7 +45,7 @@ export class Users {
|
|
|
45
45
|
__metadata(request, requestOptions) {
|
|
46
46
|
return __awaiter(this, void 0, void 0, function* () {
|
|
47
47
|
var _a, _b, _c, _d;
|
|
48
|
-
|
|
48
|
+
let _headers = mergeHeaders((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
49
49
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
50
50
|
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.CredalEnvironment.Production, "/v0/users/metadata"),
|
|
51
51
|
method: "PATCH",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
+
export { AuthProvider } from "./AuthProvider.mjs";
|
|
2
|
+
export { type AuthRequest } from "./AuthRequest.mjs";
|
|
1
3
|
export { BasicAuth } from "./BasicAuth.mjs";
|
|
2
4
|
export { BearerToken } from "./BearerToken.mjs";
|
|
3
|
-
export { type AuthRequest } from "./AuthRequest.mjs";
|
|
4
|
-
export { AuthProvider } from "./AuthProvider.mjs";
|
|
@@ -8,15 +8,15 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
10
|
import { toJson } from "../json.mjs";
|
|
11
|
-
import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
12
|
-
import { Supplier } from "./Supplier.mjs";
|
|
13
11
|
import { createRequestUrl } from "./createRequestUrl.mjs";
|
|
14
12
|
import { getErrorResponseBody } from "./getErrorResponseBody.mjs";
|
|
15
13
|
import { getFetchFn } from "./getFetchFn.mjs";
|
|
16
14
|
import { getRequestBody } from "./getRequestBody.mjs";
|
|
17
15
|
import { getResponseBody } from "./getResponseBody.mjs";
|
|
18
16
|
import { makeRequest } from "./makeRequest.mjs";
|
|
17
|
+
import { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
19
18
|
import { requestWithRetries } from "./requestWithRetries.mjs";
|
|
19
|
+
import { Supplier } from "./Supplier.mjs";
|
|
20
20
|
function getHeaders(args) {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
const newHeaders = {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type { APIResponse } from "./APIResponse.mjs";
|
|
2
|
-
export {
|
|
2
|
+
export type { BinaryResponse } from "./BinaryResponse.mjs";
|
|
3
3
|
export type { Fetcher, FetchFunction } from "./Fetcher.mjs";
|
|
4
|
+
export { fetcher } from "./Fetcher.mjs";
|
|
4
5
|
export { getHeader } from "./getHeader.mjs";
|
|
5
|
-
export { Supplier } from "./Supplier.mjs";
|
|
6
|
-
export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
7
|
-
export type { RawResponse, WithRawResponse } from "./RawResponse.mjs";
|
|
8
6
|
export { HttpResponsePromise } from "./HttpResponsePromise.mjs";
|
|
9
|
-
export type {
|
|
7
|
+
export type { RawResponse, WithRawResponse } from "./RawResponse.mjs";
|
|
8
|
+
export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
9
|
+
export { Supplier } from "./Supplier.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { fetcher } from "./Fetcher.mjs";
|
|
2
2
|
export { getHeader } from "./getHeader.mjs";
|
|
3
|
-
export { Supplier } from "./Supplier.mjs";
|
|
4
|
-
export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
5
3
|
export { HttpResponsePromise } from "./HttpResponsePromise.mjs";
|
|
4
|
+
export { abortRawResponse, toRawResponse, unknownRawResponse } from "./RawResponse.mjs";
|
|
5
|
+
export { Supplier } from "./Supplier.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.5";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.1.
|
|
1
|
+
export const SDK_VERSION = "0.1.5";
|
package/package.json
CHANGED
package/reference.md
CHANGED
|
@@ -1326,219 +1326,6 @@ await client.documentCollections.updateMongoCollectionSync({
|
|
|
1326
1326
|
</dl>
|
|
1327
1327
|
</details>
|
|
1328
1328
|
|
|
1329
|
-
## PermissionsService
|
|
1330
|
-
|
|
1331
|
-
<details><summary><code>client.permissionsService.<a href="/src/api/resources/permissionsService/client/Client.ts">checkResourceAuthorizationForUser</a>({ ...params }) -> Credal.CheckResourceAuthorizationResponse</code></summary>
|
|
1332
|
-
<dl>
|
|
1333
|
-
<dd>
|
|
1334
|
-
|
|
1335
|
-
#### 📝 Description
|
|
1336
|
-
|
|
1337
|
-
<dl>
|
|
1338
|
-
<dd>
|
|
1339
|
-
|
|
1340
|
-
<dl>
|
|
1341
|
-
<dd>
|
|
1342
|
-
|
|
1343
|
-
Admin endpoint to check whether the specified user is authorized to read the specified resource.
|
|
1344
|
-
|
|
1345
|
-
</dd>
|
|
1346
|
-
</dl>
|
|
1347
|
-
</dd>
|
|
1348
|
-
</dl>
|
|
1349
|
-
|
|
1350
|
-
#### 🔌 Usage
|
|
1351
|
-
|
|
1352
|
-
<dl>
|
|
1353
|
-
<dd>
|
|
1354
|
-
|
|
1355
|
-
<dl>
|
|
1356
|
-
<dd>
|
|
1357
|
-
|
|
1358
|
-
```typescript
|
|
1359
|
-
await client.permissionsService.checkResourceAuthorizationForUser({
|
|
1360
|
-
resourceIdentifier: {
|
|
1361
|
-
type: "external-resource-id",
|
|
1362
|
-
externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
|
|
1363
|
-
resourceType: "GOOGLE_DRIVE_ITEM",
|
|
1364
|
-
},
|
|
1365
|
-
userEmail: "john.smith@foo.com",
|
|
1366
|
-
});
|
|
1367
|
-
```
|
|
1368
|
-
|
|
1369
|
-
</dd>
|
|
1370
|
-
</dl>
|
|
1371
|
-
</dd>
|
|
1372
|
-
</dl>
|
|
1373
|
-
|
|
1374
|
-
#### ⚙️ Parameters
|
|
1375
|
-
|
|
1376
|
-
<dl>
|
|
1377
|
-
<dd>
|
|
1378
|
-
|
|
1379
|
-
<dl>
|
|
1380
|
-
<dd>
|
|
1381
|
-
|
|
1382
|
-
**request:** `Credal.CheckResourceAuthorizationForUserRequest`
|
|
1383
|
-
|
|
1384
|
-
</dd>
|
|
1385
|
-
</dl>
|
|
1386
|
-
|
|
1387
|
-
<dl>
|
|
1388
|
-
<dd>
|
|
1389
|
-
|
|
1390
|
-
**requestOptions:** `PermissionsService.RequestOptions`
|
|
1391
|
-
|
|
1392
|
-
</dd>
|
|
1393
|
-
</dl>
|
|
1394
|
-
</dd>
|
|
1395
|
-
</dl>
|
|
1396
|
-
|
|
1397
|
-
</dd>
|
|
1398
|
-
</dl>
|
|
1399
|
-
</details>
|
|
1400
|
-
|
|
1401
|
-
<details><summary><code>client.permissionsService.<a href="/src/api/resources/permissionsService/client/Client.ts">checkBulkResourcesAuthorizationForUser</a>({ ...params }) -> Credal.CheckBulkResourcesAuthorizationResponse</code></summary>
|
|
1402
|
-
<dl>
|
|
1403
|
-
<dd>
|
|
1404
|
-
|
|
1405
|
-
#### 📝 Description
|
|
1406
|
-
|
|
1407
|
-
<dl>
|
|
1408
|
-
<dd>
|
|
1409
|
-
|
|
1410
|
-
<dl>
|
|
1411
|
-
<dd>
|
|
1412
|
-
|
|
1413
|
-
Admin endpoint to check whether the specified user is authorized to read the specified set of resources.
|
|
1414
|
-
|
|
1415
|
-
</dd>
|
|
1416
|
-
</dl>
|
|
1417
|
-
</dd>
|
|
1418
|
-
</dl>
|
|
1419
|
-
|
|
1420
|
-
#### 🔌 Usage
|
|
1421
|
-
|
|
1422
|
-
<dl>
|
|
1423
|
-
<dd>
|
|
1424
|
-
|
|
1425
|
-
<dl>
|
|
1426
|
-
<dd>
|
|
1427
|
-
|
|
1428
|
-
```typescript
|
|
1429
|
-
await client.permissionsService.checkBulkResourcesAuthorizationForUser({
|
|
1430
|
-
resourceIdentifiers: [
|
|
1431
|
-
{
|
|
1432
|
-
type: "url",
|
|
1433
|
-
url: "https://docs.google.com/document/d/170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr/edit",
|
|
1434
|
-
},
|
|
1435
|
-
{
|
|
1436
|
-
type: "external-resource-id",
|
|
1437
|
-
externalResourceId: "sfsdfvr54UvyslPVWkQFOA0dfsdfsdflgNycFmdZJQr",
|
|
1438
|
-
resourceType: "ZENDESK_TICKET",
|
|
1439
|
-
},
|
|
1440
|
-
],
|
|
1441
|
-
userEmail: "john.smith@foo.com",
|
|
1442
|
-
});
|
|
1443
|
-
```
|
|
1444
|
-
|
|
1445
|
-
</dd>
|
|
1446
|
-
</dl>
|
|
1447
|
-
</dd>
|
|
1448
|
-
</dl>
|
|
1449
|
-
|
|
1450
|
-
#### ⚙️ Parameters
|
|
1451
|
-
|
|
1452
|
-
<dl>
|
|
1453
|
-
<dd>
|
|
1454
|
-
|
|
1455
|
-
<dl>
|
|
1456
|
-
<dd>
|
|
1457
|
-
|
|
1458
|
-
**request:** `Credal.CheckBulkResourcesAuthorizationForUserRequest`
|
|
1459
|
-
|
|
1460
|
-
</dd>
|
|
1461
|
-
</dl>
|
|
1462
|
-
|
|
1463
|
-
<dl>
|
|
1464
|
-
<dd>
|
|
1465
|
-
|
|
1466
|
-
**requestOptions:** `PermissionsService.RequestOptions`
|
|
1467
|
-
|
|
1468
|
-
</dd>
|
|
1469
|
-
</dl>
|
|
1470
|
-
</dd>
|
|
1471
|
-
</dl>
|
|
1472
|
-
|
|
1473
|
-
</dd>
|
|
1474
|
-
</dl>
|
|
1475
|
-
</details>
|
|
1476
|
-
|
|
1477
|
-
<details><summary><code>client.permissionsService.<a href="/src/api/resources/permissionsService/client/Client.ts">listCachedAuthorizedResourcesForUser</a>({ ...params }) -> Credal.AuthorizedResourceListPage</code></summary>
|
|
1478
|
-
<dl>
|
|
1479
|
-
<dd>
|
|
1480
|
-
|
|
1481
|
-
#### 📝 Description
|
|
1482
|
-
|
|
1483
|
-
<dl>
|
|
1484
|
-
<dd>
|
|
1485
|
-
|
|
1486
|
-
<dl>
|
|
1487
|
-
<dd>
|
|
1488
|
-
|
|
1489
|
-
Admin endpoint to list all resources that the specified user is authorized to read. Note this endpoint returns cached results and may not be up-to-date. You can use the checkResourceAuthorizationForUser endpoint with disableCache set to true to get the most up-to-date results.
|
|
1490
|
-
|
|
1491
|
-
</dd>
|
|
1492
|
-
</dl>
|
|
1493
|
-
</dd>
|
|
1494
|
-
</dl>
|
|
1495
|
-
|
|
1496
|
-
#### 🔌 Usage
|
|
1497
|
-
|
|
1498
|
-
<dl>
|
|
1499
|
-
<dd>
|
|
1500
|
-
|
|
1501
|
-
<dl>
|
|
1502
|
-
<dd>
|
|
1503
|
-
|
|
1504
|
-
```typescript
|
|
1505
|
-
await client.permissionsService.listCachedAuthorizedResourcesForUser({
|
|
1506
|
-
userEmail: "john.smith@foo.com",
|
|
1507
|
-
});
|
|
1508
|
-
```
|
|
1509
|
-
|
|
1510
|
-
</dd>
|
|
1511
|
-
</dl>
|
|
1512
|
-
</dd>
|
|
1513
|
-
</dl>
|
|
1514
|
-
|
|
1515
|
-
#### ⚙️ Parameters
|
|
1516
|
-
|
|
1517
|
-
<dl>
|
|
1518
|
-
<dd>
|
|
1519
|
-
|
|
1520
|
-
<dl>
|
|
1521
|
-
<dd>
|
|
1522
|
-
|
|
1523
|
-
**request:** `Credal.ListCachedAuthorizedResourcesForUserRequest`
|
|
1524
|
-
|
|
1525
|
-
</dd>
|
|
1526
|
-
</dl>
|
|
1527
|
-
|
|
1528
|
-
<dl>
|
|
1529
|
-
<dd>
|
|
1530
|
-
|
|
1531
|
-
**requestOptions:** `PermissionsService.RequestOptions`
|
|
1532
|
-
|
|
1533
|
-
</dd>
|
|
1534
|
-
</dl>
|
|
1535
|
-
</dd>
|
|
1536
|
-
</dl>
|
|
1537
|
-
|
|
1538
|
-
</dd>
|
|
1539
|
-
</dl>
|
|
1540
|
-
</details>
|
|
1541
|
-
|
|
1542
1329
|
## Search
|
|
1543
1330
|
|
|
1544
1331
|
<details><summary><code>client.search.<a href="/src/api/resources/search/client/Client.ts">searchDocumentCollection</a>({ ...params }) -> Credal.SearchDocumentCollectionResponse</code></summary>
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as environments from "../../../../environments.js";
|
|
5
|
-
import * as core from "../../../../core/index.js";
|
|
6
|
-
import * as Credal from "../../../index.js";
|
|
7
|
-
export declare namespace PermissionsService {
|
|
8
|
-
interface Options {
|
|
9
|
-
environment?: core.Supplier<environments.CredalEnvironment | string>;
|
|
10
|
-
/** Specify a custom URL to connect the client to. */
|
|
11
|
-
baseUrl?: core.Supplier<string>;
|
|
12
|
-
apiKey?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
-
/** Additional headers to include in requests. */
|
|
14
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
15
|
-
fetcher?: core.FetchFunction;
|
|
16
|
-
}
|
|
17
|
-
interface RequestOptions {
|
|
18
|
-
/** The maximum time to wait for a response in seconds. */
|
|
19
|
-
timeoutInSeconds?: number;
|
|
20
|
-
/** The number of times to retry the request. Defaults to 2. */
|
|
21
|
-
maxRetries?: number;
|
|
22
|
-
/** A hook to abort the request. */
|
|
23
|
-
abortSignal?: AbortSignal;
|
|
24
|
-
/** Additional query string parameters to include in the request. */
|
|
25
|
-
queryParams?: Record<string, unknown>;
|
|
26
|
-
/** Additional headers to include in the request. */
|
|
27
|
-
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export declare class PermissionsService {
|
|
31
|
-
protected readonly _options: PermissionsService.Options;
|
|
32
|
-
constructor(_options?: PermissionsService.Options);
|
|
33
|
-
/**
|
|
34
|
-
* Admin endpoint to check whether the specified user is authorized to read the specified resource.
|
|
35
|
-
*
|
|
36
|
-
* @param {Credal.CheckResourceAuthorizationForUserRequest} request
|
|
37
|
-
* @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
|
|
38
|
-
*
|
|
39
|
-
* @example
|
|
40
|
-
* await client.permissionsService.checkResourceAuthorizationForUser({
|
|
41
|
-
* resourceIdentifier: {
|
|
42
|
-
* type: "external-resource-id",
|
|
43
|
-
* externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
|
|
44
|
-
* resourceType: "GOOGLE_DRIVE_ITEM"
|
|
45
|
-
* },
|
|
46
|
-
* userEmail: "john.smith@foo.com"
|
|
47
|
-
* })
|
|
48
|
-
*/
|
|
49
|
-
checkResourceAuthorizationForUser(request: Credal.CheckResourceAuthorizationForUserRequest, requestOptions?: PermissionsService.RequestOptions): core.HttpResponsePromise<Credal.CheckResourceAuthorizationResponse>;
|
|
50
|
-
private __checkResourceAuthorizationForUser;
|
|
51
|
-
/**
|
|
52
|
-
* Admin endpoint to check whether the specified user is authorized to read the specified set of resources.
|
|
53
|
-
*
|
|
54
|
-
* @param {Credal.CheckBulkResourcesAuthorizationForUserRequest} request
|
|
55
|
-
* @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
|
|
56
|
-
*
|
|
57
|
-
* @example
|
|
58
|
-
* await client.permissionsService.checkBulkResourcesAuthorizationForUser({
|
|
59
|
-
* resourceIdentifiers: [{
|
|
60
|
-
* type: "url",
|
|
61
|
-
* url: "https://docs.google.com/document/d/170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr/edit"
|
|
62
|
-
* }, {
|
|
63
|
-
* type: "external-resource-id",
|
|
64
|
-
* externalResourceId: "sfsdfvr54UvyslPVWkQFOA0dfsdfsdflgNycFmdZJQr",
|
|
65
|
-
* resourceType: "ZENDESK_TICKET"
|
|
66
|
-
* }],
|
|
67
|
-
* userEmail: "john.smith@foo.com"
|
|
68
|
-
* })
|
|
69
|
-
*/
|
|
70
|
-
checkBulkResourcesAuthorizationForUser(request: Credal.CheckBulkResourcesAuthorizationForUserRequest, requestOptions?: PermissionsService.RequestOptions): core.HttpResponsePromise<Credal.CheckBulkResourcesAuthorizationResponse>;
|
|
71
|
-
private __checkBulkResourcesAuthorizationForUser;
|
|
72
|
-
/**
|
|
73
|
-
* Admin endpoint to list all resources that the specified user is authorized to read. Note this endpoint returns cached results and may not be up-to-date. You can use the checkResourceAuthorizationForUser endpoint with disableCache set to true to get the most up-to-date results.
|
|
74
|
-
*
|
|
75
|
-
* @param {Credal.ListCachedAuthorizedResourcesForUserRequest} request
|
|
76
|
-
* @param {PermissionsService.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
|
-
*
|
|
78
|
-
* @example
|
|
79
|
-
* await client.permissionsService.listCachedAuthorizedResourcesForUser({
|
|
80
|
-
* userEmail: "john.smith@foo.com"
|
|
81
|
-
* })
|
|
82
|
-
*/
|
|
83
|
-
listCachedAuthorizedResourcesForUser(request: Credal.ListCachedAuthorizedResourcesForUserRequest, requestOptions?: PermissionsService.RequestOptions): core.HttpResponsePromise<Credal.AuthorizedResourceListPage>;
|
|
84
|
-
private __listCachedAuthorizedResourcesForUser;
|
|
85
|
-
protected _getAuthorizationHeader(): Promise<string>;
|
|
86
|
-
}
|