@credal/sdk 0.1.11 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/BaseClient.d.ts +2 -1
- package/dist/cjs/BaseClient.js +47 -0
- package/dist/cjs/Client.d.ts +16 -16
- package/dist/cjs/Client.js +8 -49
- package/dist/cjs/api/resources/copilots/client/Client.d.ts +21 -21
- package/dist/cjs/api/resources/copilots/client/Client.js +14 -13
- package/dist/cjs/api/resources/documentCatalog/client/Client.d.ts +12 -12
- package/dist/cjs/api/resources/documentCatalog/client/Client.js +10 -9
- package/dist/cjs/api/resources/documentCollections/client/Client.d.ts +18 -18
- package/dist/cjs/api/resources/documentCollections/client/Client.js +13 -12
- package/dist/cjs/api/resources/search/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/search/client/Client.js +7 -6
- package/dist/cjs/api/resources/users/client/Client.d.ts +6 -6
- package/dist/cjs/api/resources/users/client/Client.js +7 -6
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +2 -1
- package/dist/esm/BaseClient.mjs +13 -1
- package/dist/esm/Client.d.mts +16 -16
- package/dist/esm/Client.mjs +13 -21
- package/dist/esm/api/resources/copilots/client/Client.d.mts +21 -21
- package/dist/esm/api/resources/copilots/client/Client.mjs +12 -11
- package/dist/esm/api/resources/documentCatalog/client/Client.d.mts +12 -12
- package/dist/esm/api/resources/documentCatalog/client/Client.mjs +8 -7
- package/dist/esm/api/resources/documentCollections/client/Client.d.mts +18 -18
- package/dist/esm/api/resources/documentCollections/client/Client.mjs +11 -10
- package/dist/esm/api/resources/search/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/search/client/Client.mjs +5 -4
- package/dist/esm/api/resources/users/client/Client.d.mts +6 -6
- package/dist/esm/api/resources/users/client/Client.mjs +5 -4
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +21 -21
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import * as core from "../../../../core/index.js";
|
|
3
3
|
import type * as Credal from "../../../index.js";
|
|
4
|
-
export declare namespace
|
|
4
|
+
export declare namespace DocumentCollectionsClient {
|
|
5
5
|
interface Options extends BaseClientOptions {
|
|
6
6
|
}
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
10
|
+
export declare class DocumentCollectionsClient {
|
|
11
|
+
protected readonly _options: DocumentCollectionsClient.Options;
|
|
12
|
+
constructor(options?: DocumentCollectionsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Add documents to a document collection. Note that the documents must already exist in the document catalog to use this endpoint. If you want to upload a new document to a collection, use the `uploadDocumentContents` endpoint.
|
|
15
15
|
*
|
|
16
16
|
* @param {Credal.AddDocumentsToCollectionRequest} request
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* await client.documentCollections.addDocumentsToCollection({
|
|
@@ -30,13 +30,13 @@ export declare class DocumentCollections {
|
|
|
30
30
|
* }]
|
|
31
31
|
* })
|
|
32
32
|
*/
|
|
33
|
-
addDocumentsToCollection(request: Credal.AddDocumentsToCollectionRequest, requestOptions?:
|
|
33
|
+
addDocumentsToCollection(request: Credal.AddDocumentsToCollectionRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
34
34
|
private __addDocumentsToCollection;
|
|
35
35
|
/**
|
|
36
36
|
* Remove documents from a collection
|
|
37
37
|
*
|
|
38
38
|
* @param {Credal.RemoveDocumentsFromCollectionRequest} request
|
|
39
|
-
* @param {
|
|
39
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
40
40
|
*
|
|
41
41
|
* @example
|
|
42
42
|
* await client.documentCollections.removeDocumentsFromCollection({
|
|
@@ -52,26 +52,26 @@ export declare class DocumentCollections {
|
|
|
52
52
|
* }]
|
|
53
53
|
* })
|
|
54
54
|
*/
|
|
55
|
-
removeDocumentsFromCollection(request: Credal.RemoveDocumentsFromCollectionRequest, requestOptions?:
|
|
55
|
+
removeDocumentsFromCollection(request: Credal.RemoveDocumentsFromCollectionRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
56
56
|
private __removeDocumentsFromCollection;
|
|
57
57
|
/**
|
|
58
58
|
* List documents in a collection
|
|
59
59
|
*
|
|
60
60
|
* @param {Credal.ListDocumentsInCollectionRequest} request
|
|
61
|
-
* @param {
|
|
61
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
62
62
|
*
|
|
63
63
|
* @example
|
|
64
64
|
* await client.documentCollections.listDocumentsInCollection({
|
|
65
65
|
* collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24"
|
|
66
66
|
* })
|
|
67
67
|
*/
|
|
68
|
-
listDocumentsInCollection(request: Credal.ListDocumentsInCollectionRequest, requestOptions?:
|
|
68
|
+
listDocumentsInCollection(request: Credal.ListDocumentsInCollectionRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<Credal.ListDocumentsInCollectionResponse>;
|
|
69
69
|
private __listDocumentsInCollection;
|
|
70
70
|
/**
|
|
71
71
|
* Create a new collection. The API key used will be added to the collection for future Requests
|
|
72
72
|
*
|
|
73
73
|
* @param {Credal.CreateCollectionRequest} request
|
|
74
|
-
* @param {
|
|
74
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
75
75
|
*
|
|
76
76
|
* @example
|
|
77
77
|
* await client.documentCollections.createCollection({
|
|
@@ -83,26 +83,26 @@ export declare class DocumentCollections {
|
|
|
83
83
|
* }]
|
|
84
84
|
* })
|
|
85
85
|
*/
|
|
86
|
-
createCollection(request: Credal.CreateCollectionRequest, requestOptions?:
|
|
86
|
+
createCollection(request: Credal.CreateCollectionRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<Credal.CreateCollectionResponse>;
|
|
87
87
|
private __createCollection;
|
|
88
88
|
/**
|
|
89
89
|
* Delete the collection.
|
|
90
90
|
*
|
|
91
91
|
* @param {Credal.DeleteCollectionRequest} request
|
|
92
|
-
* @param {
|
|
92
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
93
93
|
*
|
|
94
94
|
* @example
|
|
95
95
|
* await client.documentCollections.deleteCollection({
|
|
96
96
|
* collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
|
|
97
97
|
* })
|
|
98
98
|
*/
|
|
99
|
-
deleteCollection(request: Credal.DeleteCollectionRequest, requestOptions?:
|
|
99
|
+
deleteCollection(request: Credal.DeleteCollectionRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<Credal.DeleteCollectionResponse>;
|
|
100
100
|
private __deleteCollection;
|
|
101
101
|
/**
|
|
102
102
|
* Credal lets you easily sync your MongoDB data for use in Collections and Agents. Create a new sync from a MongoDB collection to a Credal collection.
|
|
103
103
|
*
|
|
104
104
|
* @param {Credal.CreateMongoCollectionSyncRequest} request
|
|
105
|
-
* @param {
|
|
105
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
106
106
|
*
|
|
107
107
|
* @example
|
|
108
108
|
* await client.documentCollections.createMongoCollectionSync({
|
|
@@ -125,13 +125,13 @@ export declare class DocumentCollections {
|
|
|
125
125
|
* }
|
|
126
126
|
* })
|
|
127
127
|
*/
|
|
128
|
-
createMongoCollectionSync(request: Credal.CreateMongoCollectionSyncRequest, requestOptions?:
|
|
128
|
+
createMongoCollectionSync(request: Credal.CreateMongoCollectionSyncRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<Credal.MongoCollectionSyncResponse>;
|
|
129
129
|
private __createMongoCollectionSync;
|
|
130
130
|
/**
|
|
131
131
|
* Credal lets you easily sync your MongoDB data for use in Collections and Agents. Update an existing sync from a MongoDB collection to a Credal collection via the `mongoCredentialId`, to disambiguate between multiple potential syncs to a given collection.
|
|
132
132
|
*
|
|
133
133
|
* @param {Credal.UpdateMongoCollectionSyncRequest} request
|
|
134
|
-
* @param {
|
|
134
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
135
135
|
*
|
|
136
136
|
* @example
|
|
137
137
|
* await client.documentCollections.updateMongoCollectionSync({
|
|
@@ -154,7 +154,7 @@ export declare class DocumentCollections {
|
|
|
154
154
|
* }
|
|
155
155
|
* })
|
|
156
156
|
*/
|
|
157
|
-
updateMongoCollectionSync(request: Credal.UpdateMongoCollectionSyncRequest, requestOptions?:
|
|
157
|
+
updateMongoCollectionSync(request: Credal.UpdateMongoCollectionSyncRequest, requestOptions?: DocumentCollectionsClient.RequestOptions): core.HttpResponsePromise<Credal.MongoCollectionSyncResponse>;
|
|
158
158
|
private __updateMongoCollectionSync;
|
|
159
159
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
160
160
|
}
|
|
@@ -43,20 +43,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.
|
|
46
|
+
exports.DocumentCollectionsClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
47
48
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
49
|
const core = __importStar(require("../../../../core/index.js"));
|
|
49
50
|
const environments = __importStar(require("../../../../environments.js"));
|
|
50
51
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
|
-
class
|
|
52
|
-
constructor(
|
|
53
|
-
this._options =
|
|
52
|
+
class DocumentCollectionsClient {
|
|
53
|
+
constructor(options = {}) {
|
|
54
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
56
57
|
* Add documents to a document collection. Note that the documents must already exist in the document catalog to use this endpoint. If you want to upload a new document to a collection, use the `uploadDocumentContents` endpoint.
|
|
57
58
|
*
|
|
58
59
|
* @param {Credal.AddDocumentsToCollectionRequest} request
|
|
59
|
-
* @param {
|
|
60
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
61
|
*
|
|
61
62
|
* @example
|
|
62
63
|
* await client.documentCollections.addDocumentsToCollection({
|
|
@@ -124,7 +125,7 @@ class DocumentCollections {
|
|
|
124
125
|
* Remove documents from a collection
|
|
125
126
|
*
|
|
126
127
|
* @param {Credal.RemoveDocumentsFromCollectionRequest} request
|
|
127
|
-
* @param {
|
|
128
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
128
129
|
*
|
|
129
130
|
* @example
|
|
130
131
|
* await client.documentCollections.removeDocumentsFromCollection({
|
|
@@ -192,7 +193,7 @@ class DocumentCollections {
|
|
|
192
193
|
* List documents in a collection
|
|
193
194
|
*
|
|
194
195
|
* @param {Credal.ListDocumentsInCollectionRequest} request
|
|
195
|
-
* @param {
|
|
196
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
196
197
|
*
|
|
197
198
|
* @example
|
|
198
199
|
* await client.documentCollections.listDocumentsInCollection({
|
|
@@ -254,7 +255,7 @@ class DocumentCollections {
|
|
|
254
255
|
* Create a new collection. The API key used will be added to the collection for future Requests
|
|
255
256
|
*
|
|
256
257
|
* @param {Credal.CreateCollectionRequest} request
|
|
257
|
-
* @param {
|
|
258
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
258
259
|
*
|
|
259
260
|
* @example
|
|
260
261
|
* await client.documentCollections.createCollection({
|
|
@@ -318,7 +319,7 @@ class DocumentCollections {
|
|
|
318
319
|
* Delete the collection.
|
|
319
320
|
*
|
|
320
321
|
* @param {Credal.DeleteCollectionRequest} request
|
|
321
|
-
* @param {
|
|
322
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
322
323
|
*
|
|
323
324
|
* @example
|
|
324
325
|
* await client.documentCollections.deleteCollection({
|
|
@@ -377,7 +378,7 @@ class DocumentCollections {
|
|
|
377
378
|
* Credal lets you easily sync your MongoDB data for use in Collections and Agents. Create a new sync from a MongoDB collection to a Credal collection.
|
|
378
379
|
*
|
|
379
380
|
* @param {Credal.CreateMongoCollectionSyncRequest} request
|
|
380
|
-
* @param {
|
|
381
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
381
382
|
*
|
|
382
383
|
* @example
|
|
383
384
|
* await client.documentCollections.createMongoCollectionSync({
|
|
@@ -452,7 +453,7 @@ class DocumentCollections {
|
|
|
452
453
|
* Credal lets you easily sync your MongoDB data for use in Collections and Agents. Update an existing sync from a MongoDB collection to a Credal collection via the `mongoCredentialId`, to disambiguate between multiple potential syncs to a given collection.
|
|
453
454
|
*
|
|
454
455
|
* @param {Credal.UpdateMongoCollectionSyncRequest} request
|
|
455
|
-
* @param {
|
|
456
|
+
* @param {DocumentCollectionsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
456
457
|
*
|
|
457
458
|
* @example
|
|
458
459
|
* await client.documentCollections.updateMongoCollectionSync({
|
|
@@ -536,4 +537,4 @@ class DocumentCollections {
|
|
|
536
537
|
});
|
|
537
538
|
}
|
|
538
539
|
}
|
|
539
|
-
exports.
|
|
540
|
+
exports.DocumentCollectionsClient = DocumentCollectionsClient;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import * as core from "../../../../core/index.js";
|
|
3
3
|
import type * as Credal from "../../../index.js";
|
|
4
|
-
export declare namespace
|
|
4
|
+
export declare namespace SearchClient {
|
|
5
5
|
interface Options extends BaseClientOptions {
|
|
6
6
|
}
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
10
|
+
export declare class SearchClient {
|
|
11
|
+
protected readonly _options: SearchClient.Options;
|
|
12
|
+
constructor(options?: SearchClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Search across all documents in a document collection using the document metadata and contents.
|
|
15
15
|
*
|
|
16
16
|
* @param {Credal.SearchDocumentCollectionRequest} request
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* await client.search.searchDocumentCollection({
|
|
@@ -36,7 +36,7 @@ export declare class Search {
|
|
|
36
36
|
* }
|
|
37
37
|
* })
|
|
38
38
|
*/
|
|
39
|
-
searchDocumentCollection(request: Credal.SearchDocumentCollectionRequest, requestOptions?:
|
|
39
|
+
searchDocumentCollection(request: Credal.SearchDocumentCollectionRequest, requestOptions?: SearchClient.RequestOptions): core.HttpResponsePromise<Credal.SearchDocumentCollectionResponse>;
|
|
40
40
|
private __searchDocumentCollection;
|
|
41
41
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
42
42
|
}
|
|
@@ -43,20 +43,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.
|
|
46
|
+
exports.SearchClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
47
48
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
49
|
const core = __importStar(require("../../../../core/index.js"));
|
|
49
50
|
const environments = __importStar(require("../../../../environments.js"));
|
|
50
51
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
|
-
class
|
|
52
|
-
constructor(
|
|
53
|
-
this._options =
|
|
52
|
+
class SearchClient {
|
|
53
|
+
constructor(options = {}) {
|
|
54
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
56
57
|
* Search across all documents in a document collection using the document metadata and contents.
|
|
57
58
|
*
|
|
58
59
|
* @param {Credal.SearchDocumentCollectionRequest} request
|
|
59
|
-
* @param {
|
|
60
|
+
* @param {SearchClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
61
|
*
|
|
61
62
|
* @example
|
|
62
63
|
* await client.search.searchDocumentCollection({
|
|
@@ -142,4 +143,4 @@ class Search {
|
|
|
142
143
|
});
|
|
143
144
|
}
|
|
144
145
|
}
|
|
145
|
-
exports.
|
|
146
|
+
exports.SearchClient = SearchClient;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import * as core from "../../../../core/index.js";
|
|
3
3
|
import type * as Credal from "../../../index.js";
|
|
4
|
-
export declare namespace
|
|
4
|
+
export declare namespace UsersClient {
|
|
5
5
|
interface Options extends BaseClientOptions {
|
|
6
6
|
}
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
10
|
+
export declare class UsersClient {
|
|
11
|
+
protected readonly _options: UsersClient.Options;
|
|
12
|
+
constructor(options?: UsersClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Bulk patch metadata for users
|
|
15
15
|
*
|
|
16
16
|
* @param {Credal.UserMetadataPatch[]} request
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* await client.users.metadata([{
|
|
@@ -31,7 +31,7 @@ export declare class Users {
|
|
|
31
31
|
* userEmail: "jack@credal.ai"
|
|
32
32
|
* }])
|
|
33
33
|
*/
|
|
34
|
-
metadata(request: Credal.UserMetadataPatch[], requestOptions?:
|
|
34
|
+
metadata(request: Credal.UserMetadataPatch[], requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
35
35
|
private __metadata;
|
|
36
36
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
37
37
|
}
|
|
@@ -43,20 +43,21 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
});
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
|
-
exports.
|
|
46
|
+
exports.UsersClient = void 0;
|
|
47
|
+
const BaseClient_js_1 = require("../../../../BaseClient.js");
|
|
47
48
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
49
|
const core = __importStar(require("../../../../core/index.js"));
|
|
49
50
|
const environments = __importStar(require("../../../../environments.js"));
|
|
50
51
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
|
-
class
|
|
52
|
-
constructor(
|
|
53
|
-
this._options =
|
|
52
|
+
class UsersClient {
|
|
53
|
+
constructor(options = {}) {
|
|
54
|
+
this._options = (0, BaseClient_js_1.normalizeClientOptions)(options);
|
|
54
55
|
}
|
|
55
56
|
/**
|
|
56
57
|
* Bulk patch metadata for users
|
|
57
58
|
*
|
|
58
59
|
* @param {Credal.UserMetadataPatch[]} request
|
|
59
|
-
* @param {
|
|
60
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
60
61
|
*
|
|
61
62
|
* @example
|
|
62
63
|
* await client.users.metadata([{
|
|
@@ -134,4 +135,4 @@ class Users {
|
|
|
134
135
|
});
|
|
135
136
|
}
|
|
136
137
|
}
|
|
137
|
-
exports.
|
|
138
|
+
exports.UsersClient = UsersClient;
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.12";
|
package/dist/cjs/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as core from "./core/index.mjs";
|
|
2
2
|
import type * as environments from "./environments.mjs";
|
|
3
3
|
export interface BaseClientOptions {
|
|
4
4
|
environment?: core.Supplier<environments.CredalEnvironment | string>;
|
|
@@ -29,3 +29,4 @@ export interface BaseRequestOptions {
|
|
|
29
29
|
/** Additional headers to include in the request. */
|
|
30
30
|
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
31
31
|
}
|
|
32
|
+
export declare function normalizeClientOptions<T extends BaseClientOptions>(options: T): T;
|
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -1,2 +1,14 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
|
|
2
|
+
import { mergeHeaders } from "./core/headers.mjs";
|
|
3
|
+
import * as core from "./core/index.mjs";
|
|
4
|
+
export function normalizeClientOptions(options) {
|
|
5
|
+
const headers = mergeHeaders({
|
|
6
|
+
"X-Fern-Language": "JavaScript",
|
|
7
|
+
"X-Fern-SDK-Name": "@credal/sdk",
|
|
8
|
+
"X-Fern-SDK-Version": "0.1.12",
|
|
9
|
+
"User-Agent": "@credal/sdk/0.1.12",
|
|
10
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
11
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
12
|
+
}, options === null || options === void 0 ? void 0 : options.headers);
|
|
13
|
+
return Object.assign(Object.assign({}, options), { logging: core.logging.createLogger(options === null || options === void 0 ? void 0 : options.logging), headers });
|
|
14
|
+
}
|
package/dist/esm/Client.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { CopilotsClient } from "./api/resources/copilots/client/Client.mjs";
|
|
2
|
+
import { DocumentCatalogClient } from "./api/resources/documentCatalog/client/Client.mjs";
|
|
3
|
+
import { DocumentCollectionsClient } from "./api/resources/documentCollections/client/Client.mjs";
|
|
4
|
+
import { SearchClient } from "./api/resources/search/client/Client.mjs";
|
|
5
|
+
import { UsersClient } from "./api/resources/users/client/Client.mjs";
|
|
6
6
|
import type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
7
7
|
export declare namespace CredalClient {
|
|
8
8
|
interface Options extends BaseClientOptions {
|
|
@@ -12,15 +12,15 @@ export declare namespace CredalClient {
|
|
|
12
12
|
}
|
|
13
13
|
export declare class CredalClient {
|
|
14
14
|
protected readonly _options: CredalClient.Options;
|
|
15
|
-
protected _copilots:
|
|
16
|
-
protected _documentCatalog:
|
|
17
|
-
protected _documentCollections:
|
|
18
|
-
protected _search:
|
|
19
|
-
protected _users:
|
|
20
|
-
constructor(
|
|
21
|
-
get copilots():
|
|
22
|
-
get documentCatalog():
|
|
23
|
-
get documentCollections():
|
|
24
|
-
get search():
|
|
25
|
-
get users():
|
|
15
|
+
protected _copilots: CopilotsClient | undefined;
|
|
16
|
+
protected _documentCatalog: DocumentCatalogClient | undefined;
|
|
17
|
+
protected _documentCollections: DocumentCollectionsClient | undefined;
|
|
18
|
+
protected _search: SearchClient | undefined;
|
|
19
|
+
protected _users: UsersClient | undefined;
|
|
20
|
+
constructor(options?: CredalClient.Options);
|
|
21
|
+
get copilots(): CopilotsClient;
|
|
22
|
+
get documentCatalog(): DocumentCatalogClient;
|
|
23
|
+
get documentCollections(): DocumentCollectionsClient;
|
|
24
|
+
get search(): SearchClient;
|
|
25
|
+
get users(): UsersClient;
|
|
26
26
|
}
|
package/dist/esm/Client.mjs
CHANGED
|
@@ -1,40 +1,32 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import * as core from "./core/index.mjs";
|
|
2
|
+
import { CopilotsClient } from "./api/resources/copilots/client/Client.mjs";
|
|
3
|
+
import { DocumentCatalogClient } from "./api/resources/documentCatalog/client/Client.mjs";
|
|
4
|
+
import { DocumentCollectionsClient } from "./api/resources/documentCollections/client/Client.mjs";
|
|
5
|
+
import { SearchClient } from "./api/resources/search/client/Client.mjs";
|
|
6
|
+
import { UsersClient } from "./api/resources/users/client/Client.mjs";
|
|
7
|
+
import { normalizeClientOptions } from "./BaseClient.mjs";
|
|
9
8
|
export class CredalClient {
|
|
10
|
-
constructor(
|
|
11
|
-
this._options =
|
|
12
|
-
"X-Fern-Language": "JavaScript",
|
|
13
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
14
|
-
"X-Fern-SDK-Version": "0.1.11",
|
|
15
|
-
"User-Agent": "@credal/sdk/0.1.11",
|
|
16
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
17
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
18
|
-
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
9
|
+
constructor(options = {}) {
|
|
10
|
+
this._options = normalizeClientOptions(options);
|
|
19
11
|
}
|
|
20
12
|
get copilots() {
|
|
21
13
|
var _a;
|
|
22
|
-
return ((_a = this._copilots) !== null && _a !== void 0 ? _a : (this._copilots = new
|
|
14
|
+
return ((_a = this._copilots) !== null && _a !== void 0 ? _a : (this._copilots = new CopilotsClient(this._options)));
|
|
23
15
|
}
|
|
24
16
|
get documentCatalog() {
|
|
25
17
|
var _a;
|
|
26
|
-
return ((_a = this._documentCatalog) !== null && _a !== void 0 ? _a : (this._documentCatalog = new
|
|
18
|
+
return ((_a = this._documentCatalog) !== null && _a !== void 0 ? _a : (this._documentCatalog = new DocumentCatalogClient(this._options)));
|
|
27
19
|
}
|
|
28
20
|
get documentCollections() {
|
|
29
21
|
var _a;
|
|
30
|
-
return ((_a = this._documentCollections) !== null && _a !== void 0 ? _a : (this._documentCollections = new
|
|
22
|
+
return ((_a = this._documentCollections) !== null && _a !== void 0 ? _a : (this._documentCollections = new DocumentCollectionsClient(this._options)));
|
|
31
23
|
}
|
|
32
24
|
get search() {
|
|
33
25
|
var _a;
|
|
34
|
-
return ((_a = this._search) !== null && _a !== void 0 ? _a : (this._search = new
|
|
26
|
+
return ((_a = this._search) !== null && _a !== void 0 ? _a : (this._search = new SearchClient(this._options)));
|
|
35
27
|
}
|
|
36
28
|
get users() {
|
|
37
29
|
var _a;
|
|
38
|
-
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new
|
|
30
|
+
return ((_a = this._users) !== null && _a !== void 0 ? _a : (this._users = new UsersClient(this._options)));
|
|
39
31
|
}
|
|
40
32
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs";
|
|
2
2
|
import * as core from "../../../../core/index.mjs";
|
|
3
3
|
import type * as Credal from "../../../index.mjs";
|
|
4
|
-
export declare namespace
|
|
4
|
+
export declare namespace CopilotsClient {
|
|
5
5
|
interface Options extends BaseClientOptions {
|
|
6
6
|
}
|
|
7
7
|
interface RequestOptions extends BaseRequestOptions {
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
|
-
export declare class
|
|
11
|
-
protected readonly _options:
|
|
12
|
-
constructor(
|
|
10
|
+
export declare class CopilotsClient {
|
|
11
|
+
protected readonly _options: CopilotsClient.Options;
|
|
12
|
+
constructor(options?: CopilotsClient.Options);
|
|
13
13
|
/**
|
|
14
14
|
* Create a new agent. The API key used will be added to the agent for future Requests
|
|
15
15
|
*
|
|
16
16
|
* @param {Credal.CreateCopilotRequest} request
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
18
|
*
|
|
19
19
|
* @example
|
|
20
20
|
* await client.copilots.createCopilot({
|
|
@@ -26,13 +26,13 @@ export declare class Copilots {
|
|
|
26
26
|
* }]
|
|
27
27
|
* })
|
|
28
28
|
*/
|
|
29
|
-
createCopilot(request: Credal.CreateCopilotRequest, requestOptions?:
|
|
29
|
+
createCopilot(request: Credal.CreateCopilotRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<Credal.CreateCopilotResponse>;
|
|
30
30
|
private __createCopilot;
|
|
31
31
|
/**
|
|
32
32
|
* OPTIONAL. Create a new conversation with the Agent. The conversation ID can be used in the `sendMessage` endpoint. The `sendMessage` endpoint automatically creates new conversations upon first request, but calling this endpoint can simplify certain use cases where it is helpful for the application to have the conversation ID before the first message is sent.
|
|
33
33
|
*
|
|
34
34
|
* @param {Credal.CreateConversationRequest} request
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
36
36
|
*
|
|
37
37
|
* @example
|
|
38
38
|
* await client.copilots.createConversation({
|
|
@@ -40,11 +40,11 @@ export declare class Copilots {
|
|
|
40
40
|
* userEmail: "ravin@credal.ai"
|
|
41
41
|
* })
|
|
42
42
|
*/
|
|
43
|
-
createConversation(request: Credal.CreateConversationRequest, requestOptions?:
|
|
43
|
+
createConversation(request: Credal.CreateConversationRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<Credal.CreateConversationResponse>;
|
|
44
44
|
private __createConversation;
|
|
45
45
|
/**
|
|
46
46
|
* @param {Credal.ProvideMessageFeedbackRequest} request
|
|
47
|
-
* @param {
|
|
47
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
48
|
*
|
|
49
49
|
* @example
|
|
50
50
|
* await client.copilots.provideMessageFeedback({
|
|
@@ -58,11 +58,11 @@ export declare class Copilots {
|
|
|
58
58
|
* }
|
|
59
59
|
* })
|
|
60
60
|
*/
|
|
61
|
-
provideMessageFeedback(request: Credal.ProvideMessageFeedbackRequest, requestOptions?:
|
|
61
|
+
provideMessageFeedback(request: Credal.ProvideMessageFeedbackRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
62
62
|
private __provideMessageFeedback;
|
|
63
63
|
/**
|
|
64
64
|
* @param {Credal.SendMessageRequest} request
|
|
65
|
-
* @param {
|
|
65
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
66
|
*
|
|
67
67
|
* @example
|
|
68
68
|
* await client.copilots.sendMessage({
|
|
@@ -78,18 +78,18 @@ export declare class Copilots {
|
|
|
78
78
|
* }]
|
|
79
79
|
* })
|
|
80
80
|
*/
|
|
81
|
-
sendMessage(request: Credal.SendMessageRequest, requestOptions?:
|
|
81
|
+
sendMessage(request: Credal.SendMessageRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<Credal.SendAgentMessageResponse>;
|
|
82
82
|
private __sendMessage;
|
|
83
83
|
/**
|
|
84
84
|
* This endpoint allows you to send a message to a specific agent and get the response back as a streamed set of Server-Sent Events.
|
|
85
85
|
*/
|
|
86
|
-
streamMessage(request: Credal.StreamMessageRequest, requestOptions?:
|
|
86
|
+
streamMessage(request: Credal.StreamMessageRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<core.Stream<Credal.StreamingChunk>>;
|
|
87
87
|
private __streamMessage;
|
|
88
88
|
/**
|
|
89
89
|
* Link a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
|
|
90
90
|
*
|
|
91
91
|
* @param {Credal.AddCollectionToCopilotRequest} request
|
|
92
|
-
* @param {
|
|
92
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
93
93
|
*
|
|
94
94
|
* @example
|
|
95
95
|
* await client.copilots.addCollectionToCopilot({
|
|
@@ -97,13 +97,13 @@ export declare class Copilots {
|
|
|
97
97
|
* collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
|
|
98
98
|
* })
|
|
99
99
|
*/
|
|
100
|
-
addCollectionToCopilot(request: Credal.AddCollectionToCopilotRequest, requestOptions?:
|
|
100
|
+
addCollectionToCopilot(request: Credal.AddCollectionToCopilotRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
101
101
|
private __addCollectionToCopilot;
|
|
102
102
|
/**
|
|
103
103
|
* Unlink a collection with a agent. The API Key used must be added to both the collection and the agent beforehand.
|
|
104
104
|
*
|
|
105
105
|
* @param {Credal.RemoveCollectionFromCopilotRequest} request
|
|
106
|
-
* @param {
|
|
106
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
107
107
|
*
|
|
108
108
|
* @example
|
|
109
109
|
* await client.copilots.removeCollectionFromCopilot({
|
|
@@ -111,13 +111,13 @@ export declare class Copilots {
|
|
|
111
111
|
* collectionId: "def1055f-83c5-43d6-b558-f7a38e7b299e"
|
|
112
112
|
* })
|
|
113
113
|
*/
|
|
114
|
-
removeCollectionFromCopilot(request: Credal.RemoveCollectionFromCopilotRequest, requestOptions?:
|
|
114
|
+
removeCollectionFromCopilot(request: Credal.RemoveCollectionFromCopilotRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
115
115
|
private __removeCollectionFromCopilot;
|
|
116
116
|
/**
|
|
117
117
|
* Update the configuration for a agent
|
|
118
118
|
*
|
|
119
119
|
* @param {Credal.UpdateConfigurationRequest} request
|
|
120
|
-
* @param {
|
|
120
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
121
121
|
*
|
|
122
122
|
* @example
|
|
123
123
|
* await client.copilots.updateConfiguration({
|
|
@@ -133,18 +133,18 @@ export declare class Copilots {
|
|
|
133
133
|
* }
|
|
134
134
|
* })
|
|
135
135
|
*/
|
|
136
|
-
updateConfiguration(request: Credal.UpdateConfigurationRequest, requestOptions?:
|
|
136
|
+
updateConfiguration(request: Credal.UpdateConfigurationRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
137
137
|
private __updateConfiguration;
|
|
138
138
|
/**
|
|
139
139
|
* @param {Credal.DeleteCopilotRequest} request
|
|
140
|
-
* @param {
|
|
140
|
+
* @param {CopilotsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
141
141
|
*
|
|
142
142
|
* @example
|
|
143
143
|
* await client.copilots.deleteCopilot({
|
|
144
144
|
* id: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
|
|
145
145
|
* })
|
|
146
146
|
*/
|
|
147
|
-
deleteCopilot(request: Credal.DeleteCopilotRequest, requestOptions?:
|
|
147
|
+
deleteCopilot(request: Credal.DeleteCopilotRequest, requestOptions?: CopilotsClient.RequestOptions): core.HttpResponsePromise<Credal.DeleteCopilotResponse>;
|
|
148
148
|
private __deleteCopilot;
|
|
149
149
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
150
150
|
}
|