@credal/sdk 0.0.10 → 0.0.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/api/resources/common/types/Collaborator.d.ts +8 -0
- package/api/resources/common/types/Collaborator.js +5 -0
- package/api/resources/common/types/Role.d.ts +8 -0
- package/api/resources/common/types/Role.js +10 -0
- package/api/resources/common/types/index.d.ts +2 -0
- package/api/resources/common/types/index.js +2 -0
- package/api/resources/copilots/client/Client.d.ts +75 -1
- package/api/resources/copilots/client/Client.js +309 -4
- package/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +22 -0
- package/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +5 -0
- package/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +1 -1
- package/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +32 -0
- package/api/resources/copilots/client/requests/CreateCopilotRequest.js +5 -0
- package/api/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +13 -0
- package/api/resources/copilots/client/requests/DeleteCopilotRequest.js +5 -0
- package/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -1
- package/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +22 -0
- package/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +5 -0
- package/api/resources/copilots/client/requests/SendMessageRequest.d.ts +1 -1
- package/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +27 -0
- package/api/resources/copilots/client/requests/UpdateConfigurationRequest.js +5 -0
- package/api/resources/copilots/client/requests/index.d.ts +5 -0
- package/api/resources/copilots/types/AiEndpointConfiguration.d.ts +7 -0
- package/api/resources/copilots/types/AiEndpointConfiguration.js +5 -0
- package/api/resources/copilots/types/Configuration.d.ts +10 -0
- package/api/resources/copilots/types/Configuration.js +5 -0
- package/api/resources/copilots/types/CreateCopilotResponse.d.ts +6 -0
- package/api/resources/copilots/types/CreateCopilotResponse.js +5 -0
- package/api/resources/copilots/types/DeleteCopilotResponse.d.ts +6 -0
- package/api/resources/copilots/types/DeleteCopilotResponse.js +5 -0
- package/api/resources/copilots/types/index.d.ts +4 -0
- package/api/resources/copilots/types/index.js +4 -0
- package/api/resources/documentCatalog/client/Client.js +2 -2
- package/api/resources/documentCollections/client/Client.d.ts +107 -1
- package/api/resources/documentCollections/client/Client.js +349 -2
- package/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -1
- package/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +32 -0
- package/api/resources/documentCollections/client/requests/CreateCollectionRequest.js +5 -0
- package/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +31 -0
- package/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +5 -0
- package/api/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
- package/api/resources/documentCollections/client/requests/DeleteCollectionRequest.js +5 -0
- package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +28 -0
- package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +5 -0
- package/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +31 -0
- package/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +5 -0
- package/api/resources/documentCollections/client/requests/index.d.ts +5 -0
- package/api/resources/documentCollections/index.d.ts +1 -0
- package/api/resources/documentCollections/index.js +1 -0
- package/api/resources/documentCollections/types/CreateCollectionResponse.d.ts +6 -0
- package/api/resources/documentCollections/types/CreateCollectionResponse.js +5 -0
- package/api/resources/documentCollections/types/DeleteCollectionResponse.d.ts +6 -0
- package/api/resources/documentCollections/types/DeleteCollectionResponse.js +5 -0
- package/api/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +10 -0
- package/api/resources/documentCollections/types/MongoCollectionSyncConfig.js +5 -0
- package/api/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +8 -0
- package/api/resources/documentCollections/types/MongoCollectionSyncResponse.js +5 -0
- package/api/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +9 -0
- package/api/resources/documentCollections/types/MongoSourceFieldsConfig.js +5 -0
- package/api/resources/documentCollections/types/index.d.ts +5 -0
- package/api/resources/documentCollections/types/index.js +21 -0
- package/api/resources/index.d.ts +2 -1
- package/api/resources/index.js +3 -2
- package/api/resources/permissionsService/client/Client.js +3 -3
- package/api/resources/search/client/Client.js +1 -1
- package/api/resources/users/client/Client.js +1 -1
- package/dist/api/resources/common/types/Collaborator.d.ts +8 -0
- package/dist/api/resources/common/types/Collaborator.js +5 -0
- package/dist/api/resources/common/types/Role.d.ts +8 -0
- package/dist/api/resources/common/types/Role.js +10 -0
- package/dist/api/resources/common/types/index.d.ts +2 -0
- package/dist/api/resources/common/types/index.js +2 -0
- package/dist/api/resources/copilots/client/Client.d.ts +75 -1
- package/dist/api/resources/copilots/client/Client.js +309 -4
- package/dist/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +22 -0
- package/dist/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +5 -0
- package/dist/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +1 -1
- package/dist/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +32 -0
- package/dist/api/resources/copilots/client/requests/CreateCopilotRequest.js +5 -0
- package/dist/api/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +13 -0
- package/dist/api/resources/copilots/client/requests/DeleteCopilotRequest.js +5 -0
- package/dist/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -1
- package/dist/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +22 -0
- package/dist/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +5 -0
- package/dist/api/resources/copilots/client/requests/SendMessageRequest.d.ts +1 -1
- package/dist/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +27 -0
- package/dist/api/resources/copilots/client/requests/UpdateConfigurationRequest.js +5 -0
- package/dist/api/resources/copilots/client/requests/index.d.ts +5 -0
- package/dist/api/resources/copilots/types/AiEndpointConfiguration.d.ts +7 -0
- package/dist/api/resources/copilots/types/AiEndpointConfiguration.js +5 -0
- package/dist/api/resources/copilots/types/Configuration.d.ts +10 -0
- package/dist/api/resources/copilots/types/Configuration.js +5 -0
- package/dist/api/resources/copilots/types/CreateCopilotResponse.d.ts +6 -0
- package/dist/api/resources/copilots/types/CreateCopilotResponse.js +5 -0
- package/dist/api/resources/copilots/types/DeleteCopilotResponse.d.ts +6 -0
- package/dist/api/resources/copilots/types/DeleteCopilotResponse.js +5 -0
- package/dist/api/resources/copilots/types/index.d.ts +4 -0
- package/dist/api/resources/copilots/types/index.js +4 -0
- package/dist/api/resources/documentCatalog/client/Client.js +2 -2
- package/dist/api/resources/documentCollections/client/Client.d.ts +107 -1
- package/dist/api/resources/documentCollections/client/Client.js +349 -2
- package/dist/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -1
- package/dist/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +32 -0
- package/dist/api/resources/documentCollections/client/requests/CreateCollectionRequest.js +5 -0
- package/dist/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +31 -0
- package/dist/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +5 -0
- package/dist/api/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
- package/dist/api/resources/documentCollections/client/requests/DeleteCollectionRequest.js +5 -0
- package/dist/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +28 -0
- package/dist/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +5 -0
- package/dist/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +31 -0
- package/dist/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +5 -0
- package/dist/api/resources/documentCollections/client/requests/index.d.ts +5 -0
- package/dist/api/resources/documentCollections/index.d.ts +1 -0
- package/dist/api/resources/documentCollections/index.js +1 -0
- package/dist/api/resources/documentCollections/types/CreateCollectionResponse.d.ts +6 -0
- package/dist/api/resources/documentCollections/types/CreateCollectionResponse.js +5 -0
- package/dist/api/resources/documentCollections/types/DeleteCollectionResponse.d.ts +6 -0
- package/dist/api/resources/documentCollections/types/DeleteCollectionResponse.js +5 -0
- package/dist/api/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +10 -0
- package/dist/api/resources/documentCollections/types/MongoCollectionSyncConfig.js +5 -0
- package/dist/api/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +8 -0
- package/dist/api/resources/documentCollections/types/MongoCollectionSyncResponse.js +5 -0
- package/dist/api/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +9 -0
- package/dist/api/resources/documentCollections/types/MongoSourceFieldsConfig.js +5 -0
- package/dist/api/resources/documentCollections/types/index.d.ts +5 -0
- package/dist/api/resources/documentCollections/types/index.js +21 -0
- package/dist/api/resources/index.d.ts +2 -1
- package/dist/api/resources/index.js +3 -2
- package/dist/api/resources/permissionsService/client/Client.js +3 -3
- package/dist/api/resources/search/client/Client.js +1 -1
- package/dist/api/resources/users/client/Client.js +1 -1
- package/dist/serialization/resources/common/types/Collaborator.d.ts +14 -0
- package/dist/serialization/resources/common/types/Collaborator.js +35 -0
- package/dist/serialization/resources/common/types/Role.d.ts +10 -0
- package/dist/serialization/resources/common/types/Role.js +34 -0
- package/dist/serialization/resources/common/types/index.d.ts +2 -0
- package/dist/serialization/resources/common/types/index.js +2 -0
- package/dist/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +13 -0
- package/dist/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +34 -0
- package/dist/serialization/resources/copilots/client/requests/CreateCopilotRequest.d.ts +15 -0
- package/dist/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +36 -0
- package/dist/serialization/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +12 -0
- package/dist/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +33 -0
- package/dist/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +13 -0
- package/dist/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +34 -0
- package/dist/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +14 -0
- package/dist/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +35 -0
- package/dist/serialization/resources/copilots/client/requests/index.d.ts +5 -0
- package/dist/serialization/resources/copilots/client/requests/index.js +11 -1
- package/dist/serialization/resources/copilots/types/AiEndpointConfiguration.d.ts +13 -0
- package/dist/serialization/resources/copilots/types/AiEndpointConfiguration.js +34 -0
- package/dist/serialization/resources/copilots/types/Configuration.d.ts +16 -0
- package/dist/serialization/resources/copilots/types/Configuration.js +37 -0
- package/dist/serialization/resources/copilots/types/CreateCopilotResponse.d.ts +12 -0
- package/dist/serialization/resources/copilots/types/CreateCopilotResponse.js +33 -0
- package/dist/serialization/resources/copilots/types/DeleteCopilotResponse.d.ts +12 -0
- package/dist/serialization/resources/copilots/types/DeleteCopilotResponse.js +33 -0
- package/dist/serialization/resources/copilots/types/index.d.ts +4 -0
- package/dist/serialization/resources/copilots/types/index.js +4 -0
- package/dist/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +15 -0
- package/dist/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +36 -0
- package/dist/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +15 -0
- package/dist/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +36 -0
- package/dist/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
- package/dist/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +33 -0
- package/dist/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +14 -0
- package/dist/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +35 -0
- package/dist/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +15 -0
- package/dist/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +36 -0
- package/dist/serialization/resources/documentCollections/client/requests/index.d.ts +5 -0
- package/dist/serialization/resources/documentCollections/client/requests/index.js +11 -1
- package/dist/serialization/resources/documentCollections/index.d.ts +1 -0
- package/dist/serialization/resources/documentCollections/index.js +1 -0
- package/dist/serialization/resources/documentCollections/types/CreateCollectionResponse.d.ts +12 -0
- package/dist/serialization/resources/documentCollections/types/CreateCollectionResponse.js +33 -0
- package/dist/serialization/resources/documentCollections/types/DeleteCollectionResponse.d.ts +12 -0
- package/dist/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +33 -0
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +16 -0
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +37 -0
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +14 -0
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +35 -0
- package/dist/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +15 -0
- package/dist/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +36 -0
- package/dist/serialization/resources/documentCollections/types/index.d.ts +5 -0
- package/dist/serialization/resources/documentCollections/types/index.js +21 -0
- package/dist/serialization/resources/index.d.ts +2 -1
- package/dist/serialization/resources/index.js +3 -2
- package/package.json +1 -1
- package/reference.md +959 -60
- package/serialization/resources/common/types/Collaborator.d.ts +14 -0
- package/serialization/resources/common/types/Collaborator.js +35 -0
- package/serialization/resources/common/types/Role.d.ts +10 -0
- package/serialization/resources/common/types/Role.js +34 -0
- package/serialization/resources/common/types/index.d.ts +2 -0
- package/serialization/resources/common/types/index.js +2 -0
- package/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +13 -0
- package/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +34 -0
- package/serialization/resources/copilots/client/requests/CreateCopilotRequest.d.ts +15 -0
- package/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +36 -0
- package/serialization/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +12 -0
- package/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +33 -0
- package/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +13 -0
- package/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +34 -0
- package/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +14 -0
- package/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +35 -0
- package/serialization/resources/copilots/client/requests/index.d.ts +5 -0
- package/serialization/resources/copilots/client/requests/index.js +11 -1
- package/serialization/resources/copilots/types/AiEndpointConfiguration.d.ts +13 -0
- package/serialization/resources/copilots/types/AiEndpointConfiguration.js +34 -0
- package/serialization/resources/copilots/types/Configuration.d.ts +16 -0
- package/serialization/resources/copilots/types/Configuration.js +37 -0
- package/serialization/resources/copilots/types/CreateCopilotResponse.d.ts +12 -0
- package/serialization/resources/copilots/types/CreateCopilotResponse.js +33 -0
- package/serialization/resources/copilots/types/DeleteCopilotResponse.d.ts +12 -0
- package/serialization/resources/copilots/types/DeleteCopilotResponse.js +33 -0
- package/serialization/resources/copilots/types/index.d.ts +4 -0
- package/serialization/resources/copilots/types/index.js +4 -0
- package/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +15 -0
- package/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +36 -0
- package/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +15 -0
- package/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +36 -0
- package/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +12 -0
- package/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +33 -0
- package/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +14 -0
- package/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +35 -0
- package/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +15 -0
- package/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +36 -0
- package/serialization/resources/documentCollections/client/requests/index.d.ts +5 -0
- package/serialization/resources/documentCollections/client/requests/index.js +11 -1
- package/serialization/resources/documentCollections/index.d.ts +1 -0
- package/serialization/resources/documentCollections/index.js +1 -0
- package/serialization/resources/documentCollections/types/CreateCollectionResponse.d.ts +12 -0
- package/serialization/resources/documentCollections/types/CreateCollectionResponse.js +33 -0
- package/serialization/resources/documentCollections/types/DeleteCollectionResponse.d.ts +12 -0
- package/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +33 -0
- package/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +16 -0
- package/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +37 -0
- package/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +14 -0
- package/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +35 -0
- package/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +15 -0
- package/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +36 -0
- package/serialization/resources/documentCollections/types/index.d.ts +5 -0
- package/serialization/resources/documentCollections/types/index.js +21 -0
- package/serialization/resources/index.d.ts +2 -1
- package/serialization/resources/index.js +3 -2
|
@@ -20,7 +20,7 @@ export declare class DocumentCollections {
|
|
|
20
20
|
protected readonly _options: DocumentCollections.Options;
|
|
21
21
|
constructor(_options?: DocumentCollections.Options);
|
|
22
22
|
/**
|
|
23
|
-
* 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.
|
|
23
|
+
* 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.
|
|
24
24
|
*
|
|
25
25
|
* @param {Credal.AddDocumentsToCollectionRequest} request
|
|
26
26
|
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -40,5 +40,111 @@ export declare class DocumentCollections {
|
|
|
40
40
|
* })
|
|
41
41
|
*/
|
|
42
42
|
addDocumentsToCollection(request: Credal.AddDocumentsToCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<void>;
|
|
43
|
+
/**
|
|
44
|
+
* Remove documents from a collection
|
|
45
|
+
*
|
|
46
|
+
* @param {Credal.RemoveDocumentsFromCollectionRequest} request
|
|
47
|
+
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* await credal.documentCollections.removeDocumentsFromCollection({
|
|
51
|
+
* collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
52
|
+
* resourceIdentifiers: [{
|
|
53
|
+
* type: "external-resource-id",
|
|
54
|
+
* externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
|
|
55
|
+
* resourceType: Credal.ResourceType.GoogleDriveItem
|
|
56
|
+
* }, {
|
|
57
|
+
* type: "external-resource-id",
|
|
58
|
+
* externalResourceId: "398KAHdfkjsdf09r54UvyslPVWkQFOA0lOiu34in923",
|
|
59
|
+
* resourceType: Credal.ResourceType.GoogleDriveItem
|
|
60
|
+
* }]
|
|
61
|
+
* })
|
|
62
|
+
*/
|
|
63
|
+
removeDocumentsFromCollection(request: Credal.RemoveDocumentsFromCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<void>;
|
|
64
|
+
/**
|
|
65
|
+
* Create a new copilot. The API key used will be added to the copilot for future Requests
|
|
66
|
+
*
|
|
67
|
+
* @param {Credal.CreateCollectionRequest} request
|
|
68
|
+
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* await credal.documentCollections.createCollection({
|
|
72
|
+
* name: "Customer Collection",
|
|
73
|
+
* description: "This collection is used to answer customer requests based on internal documentation.",
|
|
74
|
+
* collaborators: [{
|
|
75
|
+
* email: "test@gmail.com",
|
|
76
|
+
* role: Credal.Role.Editor
|
|
77
|
+
* }]
|
|
78
|
+
* })
|
|
79
|
+
*/
|
|
80
|
+
createCollection(request: Credal.CreateCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<Credal.CreateCollectionResponse>;
|
|
81
|
+
/**
|
|
82
|
+
* Delete the collection.
|
|
83
|
+
*
|
|
84
|
+
* @param {Credal.DeleteCollectionRequest} request
|
|
85
|
+
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* await credal.documentCollections.deleteCollection({
|
|
89
|
+
* collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
|
|
90
|
+
* })
|
|
91
|
+
*/
|
|
92
|
+
deleteCollection(request: Credal.DeleteCollectionRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<Credal.DeleteCollectionResponse>;
|
|
93
|
+
/**
|
|
94
|
+
* Credal lets you easily sync your MongoDB data for use in Collections and Copilots. Create a new sync from a MongoDB collection to a Credal collection.
|
|
95
|
+
*
|
|
96
|
+
* @param {Credal.CreateMongoCollectionSyncRequest} request
|
|
97
|
+
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* await credal.documentCollections.createMongoCollectionSync({
|
|
101
|
+
* mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
|
|
102
|
+
* collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a",
|
|
103
|
+
* config: {
|
|
104
|
+
* syncName: "My sales transcripts",
|
|
105
|
+
* collectionName: "myCollection",
|
|
106
|
+
* filterExpression: {
|
|
107
|
+
* "status": {
|
|
108
|
+
* "$ne": "disabled"
|
|
109
|
+
* }
|
|
110
|
+
* },
|
|
111
|
+
* sourceFields: {
|
|
112
|
+
* body: "body",
|
|
113
|
+
* sourceName: "meetingName",
|
|
114
|
+
* sourceSystemUpdated: "transcriptDatetime",
|
|
115
|
+
* sourceUrl: "link"
|
|
116
|
+
* }
|
|
117
|
+
* }
|
|
118
|
+
* })
|
|
119
|
+
*/
|
|
120
|
+
createMongoCollectionSync(request: Credal.CreateMongoCollectionSyncRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<Credal.MongoCollectionSyncResponse>;
|
|
121
|
+
/**
|
|
122
|
+
* Credal lets you easily sync your MongoDB data for use in Collections and Copilots. 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.
|
|
123
|
+
*
|
|
124
|
+
* @param {Credal.UpdateMongoCollectionSyncRequest} request
|
|
125
|
+
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
126
|
+
*
|
|
127
|
+
* @example
|
|
128
|
+
* await credal.documentCollections.updateMongoCollectionSync({
|
|
129
|
+
* mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
|
|
130
|
+
* mongoCredentialId: "5988ed76-6ee1-11ef-97dd-1fca54b7c4bc",
|
|
131
|
+
* config: {
|
|
132
|
+
* syncName: "My recent summarized sales transcripts",
|
|
133
|
+
* collectionName: "myCollection",
|
|
134
|
+
* filterExpression: {
|
|
135
|
+
* "transcriptDatetime": {
|
|
136
|
+
* "$gt": "2023-01-01T00:00:00.000Z"
|
|
137
|
+
* }
|
|
138
|
+
* },
|
|
139
|
+
* sourceFields: {
|
|
140
|
+
* body: "transcriptSummary",
|
|
141
|
+
* sourceName: "meetingName",
|
|
142
|
+
* sourceSystemUpdated: "transcriptDatetime",
|
|
143
|
+
* sourceUrl: "link"
|
|
144
|
+
* }
|
|
145
|
+
* }
|
|
146
|
+
* })
|
|
147
|
+
*/
|
|
148
|
+
updateMongoCollectionSync(request: Credal.UpdateMongoCollectionSyncRequest, requestOptions?: DocumentCollections.RequestOptions): Promise<Credal.MongoCollectionSyncResponse>;
|
|
43
149
|
protected _getAuthorizationHeader(): Promise<string>;
|
|
44
150
|
}
|
|
@@ -49,7 +49,7 @@ class DocumentCollections {
|
|
|
49
49
|
this._options = _options;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
|
-
* 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.
|
|
52
|
+
* 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.
|
|
53
53
|
*
|
|
54
54
|
* @param {Credal.AddDocumentsToCollectionRequest} request
|
|
55
55
|
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -78,7 +78,7 @@ class DocumentCollections {
|
|
|
78
78
|
Authorization: yield this._getAuthorizationHeader(),
|
|
79
79
|
"X-Fern-Language": "JavaScript",
|
|
80
80
|
"X-Fern-SDK-Name": "@credal/sdk",
|
|
81
|
-
"X-Fern-SDK-Version": "0.0.
|
|
81
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
82
82
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
83
83
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
84
84
|
},
|
|
@@ -114,6 +114,353 @@ class DocumentCollections {
|
|
|
114
114
|
}
|
|
115
115
|
});
|
|
116
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Remove documents from a collection
|
|
119
|
+
*
|
|
120
|
+
* @param {Credal.RemoveDocumentsFromCollectionRequest} request
|
|
121
|
+
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* await credal.documentCollections.removeDocumentsFromCollection({
|
|
125
|
+
* collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
126
|
+
* resourceIdentifiers: [{
|
|
127
|
+
* type: "external-resource-id",
|
|
128
|
+
* externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
|
|
129
|
+
* resourceType: Credal.ResourceType.GoogleDriveItem
|
|
130
|
+
* }, {
|
|
131
|
+
* type: "external-resource-id",
|
|
132
|
+
* externalResourceId: "398KAHdfkjsdf09r54UvyslPVWkQFOA0lOiu34in923",
|
|
133
|
+
* resourceType: Credal.ResourceType.GoogleDriveItem
|
|
134
|
+
* }]
|
|
135
|
+
* })
|
|
136
|
+
*/
|
|
137
|
+
removeDocumentsFromCollection(request, requestOptions) {
|
|
138
|
+
var _a, _b;
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
141
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/documentCollections/removeDocumentsFromCollection"),
|
|
142
|
+
method: "DELETE",
|
|
143
|
+
headers: {
|
|
144
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
145
|
+
"X-Fern-Language": "JavaScript",
|
|
146
|
+
"X-Fern-SDK-Name": "@credal/sdk",
|
|
147
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
148
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
149
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
150
|
+
},
|
|
151
|
+
contentType: "application/json",
|
|
152
|
+
body: yield serializers.RemoveDocumentsFromCollectionRequest.jsonOrThrow(request, {
|
|
153
|
+
unrecognizedObjectKeys: "strip",
|
|
154
|
+
}),
|
|
155
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
156
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
157
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
158
|
+
});
|
|
159
|
+
if (_response.ok) {
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (_response.error.reason === "status-code") {
|
|
163
|
+
throw new errors.CredalError({
|
|
164
|
+
statusCode: _response.error.statusCode,
|
|
165
|
+
body: _response.error.body,
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
switch (_response.error.reason) {
|
|
169
|
+
case "non-json":
|
|
170
|
+
throw new errors.CredalError({
|
|
171
|
+
statusCode: _response.error.statusCode,
|
|
172
|
+
body: _response.error.rawBody,
|
|
173
|
+
});
|
|
174
|
+
case "timeout":
|
|
175
|
+
throw new errors.CredalTimeoutError();
|
|
176
|
+
case "unknown":
|
|
177
|
+
throw new errors.CredalError({
|
|
178
|
+
message: _response.error.errorMessage,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Create a new copilot. The API key used will be added to the copilot for future Requests
|
|
185
|
+
*
|
|
186
|
+
* @param {Credal.CreateCollectionRequest} request
|
|
187
|
+
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
188
|
+
*
|
|
189
|
+
* @example
|
|
190
|
+
* await credal.documentCollections.createCollection({
|
|
191
|
+
* name: "Customer Collection",
|
|
192
|
+
* description: "This collection is used to answer customer requests based on internal documentation.",
|
|
193
|
+
* collaborators: [{
|
|
194
|
+
* email: "test@gmail.com",
|
|
195
|
+
* role: Credal.Role.Editor
|
|
196
|
+
* }]
|
|
197
|
+
* })
|
|
198
|
+
*/
|
|
199
|
+
createCollection(request, requestOptions) {
|
|
200
|
+
var _a, _b;
|
|
201
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
202
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
203
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/documentCollections/createCollection"),
|
|
204
|
+
method: "POST",
|
|
205
|
+
headers: {
|
|
206
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
207
|
+
"X-Fern-Language": "JavaScript",
|
|
208
|
+
"X-Fern-SDK-Name": "@credal/sdk",
|
|
209
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
210
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
211
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
212
|
+
},
|
|
213
|
+
contentType: "application/json",
|
|
214
|
+
body: yield serializers.CreateCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
215
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
216
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
217
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
218
|
+
});
|
|
219
|
+
if (_response.ok) {
|
|
220
|
+
return yield serializers.CreateCollectionResponse.parseOrThrow(_response.body, {
|
|
221
|
+
unrecognizedObjectKeys: "passthrough",
|
|
222
|
+
allowUnrecognizedUnionMembers: true,
|
|
223
|
+
allowUnrecognizedEnumValues: true,
|
|
224
|
+
breadcrumbsPrefix: ["response"],
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
if (_response.error.reason === "status-code") {
|
|
228
|
+
throw new errors.CredalError({
|
|
229
|
+
statusCode: _response.error.statusCode,
|
|
230
|
+
body: _response.error.body,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
switch (_response.error.reason) {
|
|
234
|
+
case "non-json":
|
|
235
|
+
throw new errors.CredalError({
|
|
236
|
+
statusCode: _response.error.statusCode,
|
|
237
|
+
body: _response.error.rawBody,
|
|
238
|
+
});
|
|
239
|
+
case "timeout":
|
|
240
|
+
throw new errors.CredalTimeoutError();
|
|
241
|
+
case "unknown":
|
|
242
|
+
throw new errors.CredalError({
|
|
243
|
+
message: _response.error.errorMessage,
|
|
244
|
+
});
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Delete the collection.
|
|
250
|
+
*
|
|
251
|
+
* @param {Credal.DeleteCollectionRequest} request
|
|
252
|
+
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
253
|
+
*
|
|
254
|
+
* @example
|
|
255
|
+
* await credal.documentCollections.deleteCollection({
|
|
256
|
+
* collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a"
|
|
257
|
+
* })
|
|
258
|
+
*/
|
|
259
|
+
deleteCollection(request, requestOptions) {
|
|
260
|
+
var _a, _b;
|
|
261
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
262
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
263
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/documentCollections/deleteCollection"),
|
|
264
|
+
method: "DELETE",
|
|
265
|
+
headers: {
|
|
266
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
267
|
+
"X-Fern-Language": "JavaScript",
|
|
268
|
+
"X-Fern-SDK-Name": "@credal/sdk",
|
|
269
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
270
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
271
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
272
|
+
},
|
|
273
|
+
contentType: "application/json",
|
|
274
|
+
body: yield serializers.DeleteCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
275
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
276
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
277
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
278
|
+
});
|
|
279
|
+
if (_response.ok) {
|
|
280
|
+
return yield serializers.DeleteCollectionResponse.parseOrThrow(_response.body, {
|
|
281
|
+
unrecognizedObjectKeys: "passthrough",
|
|
282
|
+
allowUnrecognizedUnionMembers: true,
|
|
283
|
+
allowUnrecognizedEnumValues: true,
|
|
284
|
+
breadcrumbsPrefix: ["response"],
|
|
285
|
+
});
|
|
286
|
+
}
|
|
287
|
+
if (_response.error.reason === "status-code") {
|
|
288
|
+
throw new errors.CredalError({
|
|
289
|
+
statusCode: _response.error.statusCode,
|
|
290
|
+
body: _response.error.body,
|
|
291
|
+
});
|
|
292
|
+
}
|
|
293
|
+
switch (_response.error.reason) {
|
|
294
|
+
case "non-json":
|
|
295
|
+
throw new errors.CredalError({
|
|
296
|
+
statusCode: _response.error.statusCode,
|
|
297
|
+
body: _response.error.rawBody,
|
|
298
|
+
});
|
|
299
|
+
case "timeout":
|
|
300
|
+
throw new errors.CredalTimeoutError();
|
|
301
|
+
case "unknown":
|
|
302
|
+
throw new errors.CredalError({
|
|
303
|
+
message: _response.error.errorMessage,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Credal lets you easily sync your MongoDB data for use in Collections and Copilots. Create a new sync from a MongoDB collection to a Credal collection.
|
|
310
|
+
*
|
|
311
|
+
* @param {Credal.CreateMongoCollectionSyncRequest} request
|
|
312
|
+
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* await credal.documentCollections.createMongoCollectionSync({
|
|
316
|
+
* mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
|
|
317
|
+
* collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a",
|
|
318
|
+
* config: {
|
|
319
|
+
* syncName: "My sales transcripts",
|
|
320
|
+
* collectionName: "myCollection",
|
|
321
|
+
* filterExpression: {
|
|
322
|
+
* "status": {
|
|
323
|
+
* "$ne": "disabled"
|
|
324
|
+
* }
|
|
325
|
+
* },
|
|
326
|
+
* sourceFields: {
|
|
327
|
+
* body: "body",
|
|
328
|
+
* sourceName: "meetingName",
|
|
329
|
+
* sourceSystemUpdated: "transcriptDatetime",
|
|
330
|
+
* sourceUrl: "link"
|
|
331
|
+
* }
|
|
332
|
+
* }
|
|
333
|
+
* })
|
|
334
|
+
*/
|
|
335
|
+
createMongoCollectionSync(request, requestOptions) {
|
|
336
|
+
var _a, _b;
|
|
337
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
338
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
339
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/documentCollections/mongodb/createMongoSync"),
|
|
340
|
+
method: "POST",
|
|
341
|
+
headers: {
|
|
342
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
343
|
+
"X-Fern-Language": "JavaScript",
|
|
344
|
+
"X-Fern-SDK-Name": "@credal/sdk",
|
|
345
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
346
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
347
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
348
|
+
},
|
|
349
|
+
contentType: "application/json",
|
|
350
|
+
body: yield serializers.CreateMongoCollectionSyncRequest.jsonOrThrow(request, {
|
|
351
|
+
unrecognizedObjectKeys: "strip",
|
|
352
|
+
}),
|
|
353
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
354
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
355
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
356
|
+
});
|
|
357
|
+
if (_response.ok) {
|
|
358
|
+
return yield serializers.MongoCollectionSyncResponse.parseOrThrow(_response.body, {
|
|
359
|
+
unrecognizedObjectKeys: "passthrough",
|
|
360
|
+
allowUnrecognizedUnionMembers: true,
|
|
361
|
+
allowUnrecognizedEnumValues: true,
|
|
362
|
+
breadcrumbsPrefix: ["response"],
|
|
363
|
+
});
|
|
364
|
+
}
|
|
365
|
+
if (_response.error.reason === "status-code") {
|
|
366
|
+
throw new errors.CredalError({
|
|
367
|
+
statusCode: _response.error.statusCode,
|
|
368
|
+
body: _response.error.body,
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
switch (_response.error.reason) {
|
|
372
|
+
case "non-json":
|
|
373
|
+
throw new errors.CredalError({
|
|
374
|
+
statusCode: _response.error.statusCode,
|
|
375
|
+
body: _response.error.rawBody,
|
|
376
|
+
});
|
|
377
|
+
case "timeout":
|
|
378
|
+
throw new errors.CredalTimeoutError();
|
|
379
|
+
case "unknown":
|
|
380
|
+
throw new errors.CredalError({
|
|
381
|
+
message: _response.error.errorMessage,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
/**
|
|
387
|
+
* Credal lets you easily sync your MongoDB data for use in Collections and Copilots. 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.
|
|
388
|
+
*
|
|
389
|
+
* @param {Credal.UpdateMongoCollectionSyncRequest} request
|
|
390
|
+
* @param {DocumentCollections.RequestOptions} requestOptions - Request-specific configuration.
|
|
391
|
+
*
|
|
392
|
+
* @example
|
|
393
|
+
* await credal.documentCollections.updateMongoCollectionSync({
|
|
394
|
+
* mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
|
|
395
|
+
* mongoCredentialId: "5988ed76-6ee1-11ef-97dd-1fca54b7c4bc",
|
|
396
|
+
* config: {
|
|
397
|
+
* syncName: "My recent summarized sales transcripts",
|
|
398
|
+
* collectionName: "myCollection",
|
|
399
|
+
* filterExpression: {
|
|
400
|
+
* "transcriptDatetime": {
|
|
401
|
+
* "$gt": "2023-01-01T00:00:00.000Z"
|
|
402
|
+
* }
|
|
403
|
+
* },
|
|
404
|
+
* sourceFields: {
|
|
405
|
+
* body: "transcriptSummary",
|
|
406
|
+
* sourceName: "meetingName",
|
|
407
|
+
* sourceSystemUpdated: "transcriptDatetime",
|
|
408
|
+
* sourceUrl: "link"
|
|
409
|
+
* }
|
|
410
|
+
* }
|
|
411
|
+
* })
|
|
412
|
+
*/
|
|
413
|
+
updateMongoCollectionSync(request, requestOptions) {
|
|
414
|
+
var _a, _b;
|
|
415
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
416
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
417
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.CredalEnvironment.Production, "/v0/documentCollections/mongodb/updateMongoSync"),
|
|
418
|
+
method: "POST",
|
|
419
|
+
headers: {
|
|
420
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
421
|
+
"X-Fern-Language": "JavaScript",
|
|
422
|
+
"X-Fern-SDK-Name": "@credal/sdk",
|
|
423
|
+
"X-Fern-SDK-Version": "0.0.12",
|
|
424
|
+
"X-Fern-Runtime": core.RUNTIME.type,
|
|
425
|
+
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
426
|
+
},
|
|
427
|
+
contentType: "application/json",
|
|
428
|
+
body: yield serializers.UpdateMongoCollectionSyncRequest.jsonOrThrow(request, {
|
|
429
|
+
unrecognizedObjectKeys: "strip",
|
|
430
|
+
}),
|
|
431
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
432
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
433
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
434
|
+
});
|
|
435
|
+
if (_response.ok) {
|
|
436
|
+
return yield serializers.MongoCollectionSyncResponse.parseOrThrow(_response.body, {
|
|
437
|
+
unrecognizedObjectKeys: "passthrough",
|
|
438
|
+
allowUnrecognizedUnionMembers: true,
|
|
439
|
+
allowUnrecognizedEnumValues: true,
|
|
440
|
+
breadcrumbsPrefix: ["response"],
|
|
441
|
+
});
|
|
442
|
+
}
|
|
443
|
+
if (_response.error.reason === "status-code") {
|
|
444
|
+
throw new errors.CredalError({
|
|
445
|
+
statusCode: _response.error.statusCode,
|
|
446
|
+
body: _response.error.body,
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
switch (_response.error.reason) {
|
|
450
|
+
case "non-json":
|
|
451
|
+
throw new errors.CredalError({
|
|
452
|
+
statusCode: _response.error.statusCode,
|
|
453
|
+
body: _response.error.rawBody,
|
|
454
|
+
});
|
|
455
|
+
case "timeout":
|
|
456
|
+
throw new errors.CredalTimeoutError();
|
|
457
|
+
case "unknown":
|
|
458
|
+
throw new errors.CredalError({
|
|
459
|
+
message: _response.error.errorMessage,
|
|
460
|
+
});
|
|
461
|
+
}
|
|
462
|
+
});
|
|
463
|
+
}
|
|
117
464
|
_getAuthorizationHeader() {
|
|
118
465
|
var _a;
|
|
119
466
|
return __awaiter(this, void 0, void 0, function* () {
|
package/dist/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts
CHANGED
|
@@ -21,7 +21,7 @@ export interface AddDocumentsToCollectionRequest {
|
|
|
21
21
|
/** The ID of the document collection you want to add to. */
|
|
22
22
|
collectionId: string;
|
|
23
23
|
/**
|
|
24
|
-
* The set of resource identifier for which you want to
|
|
24
|
+
* The set of resource identifier for which you want to add to the collection.
|
|
25
25
|
*
|
|
26
26
|
*/
|
|
27
27
|
resourceIdentifiers: Credal.ResourceIdentifier[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Credal from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* name: "Customer Collection",
|
|
9
|
+
* description: "This collection is used to answer customer requests based on internal documentation.",
|
|
10
|
+
* collaborators: [{
|
|
11
|
+
* email: "test@gmail.com",
|
|
12
|
+
* role: Credal.Role.Editor
|
|
13
|
+
* }]
|
|
14
|
+
* }
|
|
15
|
+
*/
|
|
16
|
+
export interface CreateCollectionRequest {
|
|
17
|
+
/**
|
|
18
|
+
* A descriptive name for the collection.
|
|
19
|
+
*
|
|
20
|
+
*/
|
|
21
|
+
name: string;
|
|
22
|
+
/**
|
|
23
|
+
* An in depth name for the copilot's function. Useful for routing requests to the right copilot.
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
description: string;
|
|
27
|
+
/**
|
|
28
|
+
* A list of collaborator emails and roles that will have access to the copilot.
|
|
29
|
+
*
|
|
30
|
+
*/
|
|
31
|
+
collaborators: Credal.Collaborator[];
|
|
32
|
+
}
|
package/dist/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Credal from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
|
|
9
|
+
* collectionId: "ac20e6ba-0bae-11ef-b25a-efca73df4c3a",
|
|
10
|
+
* config: {
|
|
11
|
+
* syncName: "My sales transcripts",
|
|
12
|
+
* collectionName: "myCollection",
|
|
13
|
+
* filterExpression: {
|
|
14
|
+
* "status": {
|
|
15
|
+
* "$ne": "disabled"
|
|
16
|
+
* }
|
|
17
|
+
* },
|
|
18
|
+
* sourceFields: {
|
|
19
|
+
* body: "body",
|
|
20
|
+
* sourceName: "meetingName",
|
|
21
|
+
* sourceSystemUpdated: "transcriptDatetime",
|
|
22
|
+
* sourceUrl: "link"
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
*/
|
|
27
|
+
export interface CreateMongoCollectionSyncRequest {
|
|
28
|
+
collectionId: string;
|
|
29
|
+
mongoUri: string;
|
|
30
|
+
config: Credal.MongoCollectionSyncConfig;
|
|
31
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Credal from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* collectionId: "82e4b12a-6990-45d4-8ebd-85c00e030c24",
|
|
9
|
+
* resourceIdentifiers: [{
|
|
10
|
+
* type: "external-resource-id",
|
|
11
|
+
* externalResourceId: "170NrBm0Do7gdzvr54UvyslPVWkQFOA0lgNycFmdZJQr",
|
|
12
|
+
* resourceType: Credal.ResourceType.GoogleDriveItem
|
|
13
|
+
* }, {
|
|
14
|
+
* type: "external-resource-id",
|
|
15
|
+
* externalResourceId: "398KAHdfkjsdf09r54UvyslPVWkQFOA0lOiu34in923",
|
|
16
|
+
* resourceType: Credal.ResourceType.GoogleDriveItem
|
|
17
|
+
* }]
|
|
18
|
+
* }
|
|
19
|
+
*/
|
|
20
|
+
export interface RemoveDocumentsFromCollectionRequest {
|
|
21
|
+
/** The ID of the document collection you want to add to. */
|
|
22
|
+
collectionId: string;
|
|
23
|
+
/**
|
|
24
|
+
* The set of resource identifier for which you want to remove from the collection
|
|
25
|
+
*
|
|
26
|
+
*/
|
|
27
|
+
resourceIdentifiers: Credal.ResourceIdentifier[];
|
|
28
|
+
}
|
package/dist/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Credal from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* mongoUri: "mongodb+srv://cluster0.hzwklqn.mongodb.net/Cluster0?retryWrites=true&w=majority",
|
|
9
|
+
* mongoCredentialId: "5988ed76-6ee1-11ef-97dd-1fca54b7c4bc",
|
|
10
|
+
* config: {
|
|
11
|
+
* syncName: "My recent summarized sales transcripts",
|
|
12
|
+
* collectionName: "myCollection",
|
|
13
|
+
* filterExpression: {
|
|
14
|
+
* "transcriptDatetime": {
|
|
15
|
+
* "$gt": "2023-01-01T00:00:00.000Z"
|
|
16
|
+
* }
|
|
17
|
+
* },
|
|
18
|
+
* sourceFields: {
|
|
19
|
+
* body: "transcriptSummary",
|
|
20
|
+
* sourceName: "meetingName",
|
|
21
|
+
* sourceSystemUpdated: "transcriptDatetime",
|
|
22
|
+
* sourceUrl: "link"
|
|
23
|
+
* }
|
|
24
|
+
* }
|
|
25
|
+
* }
|
|
26
|
+
*/
|
|
27
|
+
export interface UpdateMongoCollectionSyncRequest {
|
|
28
|
+
mongoCredentialId: string;
|
|
29
|
+
mongoUri: string;
|
|
30
|
+
config: Credal.MongoCollectionSyncConfig;
|
|
31
|
+
}
|