@credal/sdk 0.1.8 → 0.1.10
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 -2
- package/dist/cjs/Client.d.ts +1 -1
- package/dist/cjs/Client.js +4 -4
- package/dist/cjs/api/resources/common/types/Collaborator.d.ts +1 -1
- package/dist/cjs/api/resources/common/types/ExternalResourceId.d.ts +1 -1
- package/dist/cjs/api/resources/common/types/ResourceIdentifier.d.ts +1 -1
- package/dist/cjs/api/resources/common/types/index.d.ts +5 -5
- package/dist/cjs/api/resources/common/types/index.js +5 -5
- package/dist/cjs/api/resources/copilots/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/client/Client.js +12 -12
- package/dist/cjs/api/resources/copilots/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/client/requests/SendMessageRequest.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/client/requests/StreamMessageRequest.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/client/requests/index.d.ts +9 -9
- package/dist/cjs/api/resources/copilots/index.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/index.js +1 -1
- package/dist/cjs/api/resources/copilots/types/CollectionFilteredData.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/Configuration.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/DataFilter.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/DatetimeFieldSchema.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/EndOfMessageChunk.d.ts +1 -2
- package/dist/cjs/api/resources/copilots/types/ErrorChunk.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/Filter.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/FinalChunk.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/InitialChunk.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/MessageBlocked.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/MessageFeedback.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/MessageReply.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/NumberFieldSchema.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/ReferencedSource.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/SendAgentMessageResponse.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/SendMessageResponse.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/StreamingChunk.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/StringFieldSchema.d.ts +1 -1
- package/dist/cjs/api/resources/copilots/types/index.d.ts +24 -24
- package/dist/cjs/api/resources/copilots/types/index.js +24 -24
- package/dist/cjs/api/resources/documentCatalog/client/Client.d.ts +9 -1
- package/dist/cjs/api/resources/documentCatalog/client/Client.js +90 -6
- package/dist/cjs/api/resources/documentCatalog/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +1 -1
- package/dist/cjs/api/resources/documentCatalog/client/requests/UploadFileRequest.d.ts +27 -0
- package/dist/cjs/api/resources/documentCatalog/client/requests/UploadFileRequest.js +3 -0
- package/dist/cjs/api/resources/documentCatalog/client/requests/index.d.ts +2 -1
- package/dist/cjs/api/resources/documentCatalog/index.d.ts +1 -1
- package/dist/cjs/api/resources/documentCatalog/index.js +1 -1
- package/dist/cjs/api/resources/documentCatalog/types/DocumentMetadataPatch.d.ts +1 -1
- package/dist/cjs/api/resources/documentCatalog/types/DocumentMetadataPatchRequest.d.ts +1 -1
- package/dist/cjs/api/resources/documentCatalog/types/index.d.ts +1 -1
- package/dist/cjs/api/resources/documentCatalog/types/index.js +1 -1
- package/dist/cjs/api/resources/documentCollections/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/documentCollections/client/Client.js +11 -11
- package/dist/cjs/api/resources/documentCollections/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -1
- package/dist/cjs/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +1 -1
- package/dist/cjs/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +1 -1
- package/dist/cjs/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +1 -1
- package/dist/cjs/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +1 -1
- package/dist/cjs/api/resources/documentCollections/client/requests/index.d.ts +7 -7
- package/dist/cjs/api/resources/documentCollections/index.d.ts +1 -1
- package/dist/cjs/api/resources/documentCollections/index.js +1 -1
- package/dist/cjs/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.d.ts +1 -1
- package/dist/cjs/api/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +1 -1
- package/dist/cjs/api/resources/documentCollections/types/index.d.ts +1 -1
- package/dist/cjs/api/resources/documentCollections/types/index.js +1 -1
- package/dist/cjs/api/resources/index.d.ts +4 -4
- package/dist/cjs/api/resources/index.js +4 -4
- package/dist/cjs/api/resources/search/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/search/client/Client.js +4 -4
- package/dist/cjs/api/resources/search/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +1 -1
- package/dist/cjs/api/resources/search/client/requests/index.d.ts +1 -1
- package/dist/cjs/api/resources/search/index.d.ts +1 -1
- package/dist/cjs/api/resources/search/index.js +1 -1
- package/dist/cjs/api/resources/search/types/DocumentCollectionSearchResult.d.ts +1 -1
- package/dist/cjs/api/resources/search/types/SearchDocumentCollectionResponse.d.ts +1 -1
- package/dist/cjs/api/resources/search/types/SingleFieldFilter.d.ts +1 -1
- package/dist/cjs/api/resources/search/types/index.d.ts +1 -1
- package/dist/cjs/api/resources/search/types/index.js +1 -1
- package/dist/cjs/api/resources/users/client/Client.d.ts +1 -1
- package/dist/cjs/api/resources/users/client/Client.js +4 -4
- package/dist/cjs/api/resources/users/index.d.ts +1 -1
- package/dist/cjs/api/resources/users/index.js +1 -1
- package/dist/cjs/core/exports.d.ts +1 -0
- package/dist/cjs/core/exports.js +17 -0
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +1 -1
- package/dist/cjs/core/fetcher/Fetcher.js +2 -1
- package/dist/cjs/core/fetcher/getErrorResponseBody.js +2 -1
- package/dist/cjs/core/fetcher/getResponseBody.js +3 -3
- package/dist/cjs/core/fetcher/makeRequest.js +2 -2
- package/dist/cjs/core/fetcher/requestWithRetries.js +3 -3
- package/dist/cjs/core/file/exports.d.ts +1 -0
- package/dist/cjs/core/file/exports.js +2 -0
- package/dist/cjs/core/file/file.d.ts +10 -0
- package/dist/cjs/core/file/file.js +221 -0
- package/dist/cjs/core/file/index.d.ts +2 -0
- package/dist/cjs/core/file/index.js +18 -0
- package/dist/cjs/core/file/types.d.ts +66 -0
- package/dist/cjs/core/file/types.js +2 -0
- package/dist/cjs/core/form-data-utils/FormDataWrapper.d.ts +15 -0
- package/dist/cjs/core/form-data-utils/FormDataWrapper.js +185 -0
- package/dist/cjs/core/form-data-utils/encodeAsFormParameter.d.ts +1 -0
- package/dist/cjs/core/form-data-utils/encodeAsFormParameter.js +12 -0
- package/dist/cjs/core/form-data-utils/index.d.ts +2 -0
- package/dist/cjs/core/form-data-utils/index.js +20 -0
- package/dist/cjs/core/index.d.ts +5 -3
- package/dist/cjs/core/index.js +6 -4
- package/dist/cjs/core/stream/Stream.d.ts +1 -0
- package/dist/cjs/core/stream/Stream.js +8 -5
- package/dist/cjs/core/url/encodePathParam.d.ts +1 -0
- package/dist/cjs/core/url/encodePathParam.js +21 -0
- package/dist/cjs/core/url/index.d.ts +1 -0
- package/dist/cjs/core/url/index.js +3 -1
- package/dist/cjs/core/url/join.js +3 -3
- package/dist/cjs/errors/CredalError.d.ts +1 -1
- package/dist/cjs/errors/CredalError.js +1 -1
- package/dist/cjs/exports.d.ts +1 -0
- package/dist/cjs/exports.js +17 -0
- package/dist/cjs/index.d.ts +3 -2
- package/dist/cjs/index.js +8 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +2 -2
- package/dist/esm/BaseClient.mjs +1 -2
- package/dist/esm/Client.d.mts +1 -1
- package/dist/esm/Client.mjs +4 -5
- package/dist/esm/api/resources/common/types/Collaborator.d.mts +1 -1
- package/dist/esm/api/resources/common/types/Collaborator.mjs +1 -1
- package/dist/esm/api/resources/common/types/ExternalResourceId.d.mts +1 -1
- package/dist/esm/api/resources/common/types/ExternalResourceId.mjs +1 -1
- package/dist/esm/api/resources/common/types/ResourceIdentifier.d.mts +1 -1
- package/dist/esm/api/resources/common/types/ResourceIdentifier.mjs +1 -1
- package/dist/esm/api/resources/common/types/index.d.mts +5 -5
- package/dist/esm/api/resources/common/types/index.mjs +5 -5
- package/dist/esm/api/resources/copilots/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/copilots/client/Client.mjs +12 -13
- package/dist/esm/api/resources/copilots/client/index.d.mts +0 -1
- package/dist/esm/api/resources/copilots/client/index.mjs +0 -1
- package/dist/esm/api/resources/copilots/client/requests/CreateCopilotRequest.d.mts +1 -1
- package/dist/esm/api/resources/copilots/client/requests/CreateCopilotRequest.mjs +1 -1
- package/dist/esm/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.mts +1 -1
- package/dist/esm/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.mjs +1 -1
- package/dist/esm/api/resources/copilots/client/requests/SendMessageRequest.d.mts +1 -1
- package/dist/esm/api/resources/copilots/client/requests/SendMessageRequest.mjs +1 -1
- package/dist/esm/api/resources/copilots/client/requests/StreamMessageRequest.d.mts +1 -1
- package/dist/esm/api/resources/copilots/client/requests/StreamMessageRequest.mjs +1 -1
- package/dist/esm/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.mts +1 -1
- package/dist/esm/api/resources/copilots/client/requests/UpdateConfigurationRequest.mjs +1 -1
- package/dist/esm/api/resources/copilots/client/requests/index.d.mts +9 -9
- package/dist/esm/api/resources/copilots/client/requests/index.mjs +1 -9
- package/dist/esm/api/resources/copilots/index.d.mts +1 -1
- package/dist/esm/api/resources/copilots/index.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/CollectionFilteredData.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/CollectionFilteredData.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/Configuration.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/Configuration.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/DataFilter.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/DataFilter.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/DatetimeFieldSchema.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/DatetimeFieldSchema.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/EndOfMessageChunk.d.mts +1 -2
- package/dist/esm/api/resources/copilots/types/ErrorChunk.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/ErrorChunk.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/Filter.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/Filter.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/FinalChunk.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/FinalChunk.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/InitialChunk.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/InitialChunk.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/MessageBlocked.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/MessageBlocked.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/MessageFeedback.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/MessageFeedback.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/MessageReply.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/MessageReply.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/NumberFieldSchema.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/NumberFieldSchema.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/ReferencedSource.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/ReferencedSource.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/SendAgentMessageResponse.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/SendAgentMessageResponse.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/SendMessageResponse.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/SendMessageResponse.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/StreamingChunk.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/StreamingChunk.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/StringFieldSchema.d.mts +1 -1
- package/dist/esm/api/resources/copilots/types/StringFieldSchema.mjs +1 -1
- package/dist/esm/api/resources/copilots/types/index.d.mts +24 -24
- package/dist/esm/api/resources/copilots/types/index.mjs +24 -24
- package/dist/esm/api/resources/documentCatalog/client/Client.d.mts +9 -1
- package/dist/esm/api/resources/documentCatalog/client/Client.mjs +90 -7
- package/dist/esm/api/resources/documentCatalog/client/index.d.mts +0 -1
- package/dist/esm/api/resources/documentCatalog/client/index.mjs +0 -1
- package/dist/esm/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.mts +1 -1
- package/dist/esm/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.mjs +1 -1
- package/dist/esm/api/resources/documentCatalog/client/requests/UploadFileRequest.d.mts +27 -0
- package/dist/esm/api/resources/documentCatalog/client/requests/UploadFileRequest.mjs +2 -0
- package/dist/esm/api/resources/documentCatalog/client/requests/index.d.mts +2 -1
- package/dist/esm/api/resources/documentCatalog/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/documentCatalog/index.d.mts +1 -1
- package/dist/esm/api/resources/documentCatalog/index.mjs +1 -1
- package/dist/esm/api/resources/documentCatalog/types/DocumentMetadataPatch.d.mts +1 -1
- package/dist/esm/api/resources/documentCatalog/types/DocumentMetadataPatch.mjs +1 -1
- package/dist/esm/api/resources/documentCatalog/types/DocumentMetadataPatchRequest.d.mts +1 -1
- package/dist/esm/api/resources/documentCatalog/types/DocumentMetadataPatchRequest.mjs +1 -1
- package/dist/esm/api/resources/documentCatalog/types/index.d.mts +1 -1
- package/dist/esm/api/resources/documentCatalog/types/index.mjs +1 -1
- package/dist/esm/api/resources/documentCollections/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/documentCollections/client/Client.mjs +11 -12
- package/dist/esm/api/resources/documentCollections/client/index.d.mts +0 -1
- package/dist/esm/api/resources/documentCollections/client/index.mjs +0 -1
- package/dist/esm/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.mts +1 -1
- package/dist/esm/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.mjs +1 -1
- package/dist/esm/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.mts +1 -1
- package/dist/esm/api/resources/documentCollections/client/requests/CreateCollectionRequest.mjs +1 -1
- package/dist/esm/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.mts +1 -1
- package/dist/esm/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.mjs +1 -1
- package/dist/esm/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.mts +1 -1
- package/dist/esm/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.mjs +1 -1
- package/dist/esm/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.mts +1 -1
- package/dist/esm/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.mjs +1 -1
- package/dist/esm/api/resources/documentCollections/client/requests/index.d.mts +7 -7
- package/dist/esm/api/resources/documentCollections/client/requests/index.mjs +1 -7
- package/dist/esm/api/resources/documentCollections/index.d.mts +1 -1
- package/dist/esm/api/resources/documentCollections/index.mjs +1 -1
- package/dist/esm/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.d.mts +1 -1
- package/dist/esm/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.mjs +1 -1
- package/dist/esm/api/resources/documentCollections/types/MongoCollectionSyncConfig.d.mts +1 -1
- package/dist/esm/api/resources/documentCollections/types/MongoCollectionSyncConfig.mjs +1 -1
- package/dist/esm/api/resources/documentCollections/types/index.d.mts +1 -1
- package/dist/esm/api/resources/documentCollections/types/index.mjs +1 -1
- package/dist/esm/api/resources/index.d.mts +4 -4
- package/dist/esm/api/resources/index.mjs +4 -4
- package/dist/esm/api/resources/search/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/search/client/Client.mjs +4 -5
- package/dist/esm/api/resources/search/client/index.d.mts +0 -1
- package/dist/esm/api/resources/search/client/index.mjs +0 -1
- package/dist/esm/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.mts +1 -1
- package/dist/esm/api/resources/search/client/requests/SearchDocumentCollectionRequest.mjs +1 -1
- package/dist/esm/api/resources/search/client/requests/index.d.mts +1 -1
- package/dist/esm/api/resources/search/client/requests/index.mjs +1 -1
- package/dist/esm/api/resources/search/index.d.mts +1 -1
- package/dist/esm/api/resources/search/index.mjs +1 -1
- package/dist/esm/api/resources/search/types/DocumentCollectionSearchResult.d.mts +1 -1
- package/dist/esm/api/resources/search/types/DocumentCollectionSearchResult.mjs +1 -1
- package/dist/esm/api/resources/search/types/SearchDocumentCollectionResponse.d.mts +1 -1
- package/dist/esm/api/resources/search/types/SearchDocumentCollectionResponse.mjs +1 -1
- package/dist/esm/api/resources/search/types/SingleFieldFilter.d.mts +1 -1
- package/dist/esm/api/resources/search/types/SingleFieldFilter.mjs +1 -1
- package/dist/esm/api/resources/search/types/index.d.mts +1 -1
- package/dist/esm/api/resources/search/types/index.mjs +1 -1
- package/dist/esm/api/resources/users/client/Client.d.mts +1 -1
- package/dist/esm/api/resources/users/client/Client.mjs +4 -5
- package/dist/esm/api/resources/users/index.d.mts +1 -1
- package/dist/esm/api/resources/users/index.mjs +1 -1
- package/dist/esm/core/exports.d.mts +1 -0
- package/dist/esm/core/exports.mjs +1 -0
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +1 -1
- package/dist/esm/core/fetcher/EndpointSupplier.mjs +0 -1
- package/dist/esm/core/fetcher/Fetcher.mjs +2 -1
- package/dist/esm/core/fetcher/getErrorResponseBody.mjs +2 -1
- package/dist/esm/core/fetcher/getResponseBody.mjs +3 -3
- package/dist/esm/core/fetcher/makeRequest.mjs +2 -2
- package/dist/esm/core/fetcher/requestWithRetries.mjs +3 -3
- package/dist/esm/core/file/exports.d.mts +1 -0
- package/dist/esm/core/file/exports.mjs +1 -0
- package/dist/esm/core/file/file.d.mts +10 -0
- package/dist/esm/core/file/file.mjs +184 -0
- package/dist/esm/core/file/index.d.mts +2 -0
- package/dist/esm/core/file/index.mjs +2 -0
- package/dist/esm/core/file/types.d.mts +66 -0
- package/dist/esm/core/file/types.mjs +1 -0
- package/dist/esm/core/form-data-utils/FormDataWrapper.d.mts +15 -0
- package/dist/esm/core/form-data-utils/FormDataWrapper.mjs +147 -0
- package/dist/esm/core/form-data-utils/encodeAsFormParameter.d.mts +1 -0
- package/dist/esm/core/form-data-utils/encodeAsFormParameter.mjs +9 -0
- package/dist/esm/core/form-data-utils/index.d.mts +2 -0
- package/dist/esm/core/form-data-utils/index.mjs +2 -0
- package/dist/esm/core/index.d.mts +5 -3
- package/dist/esm/core/index.mjs +5 -3
- package/dist/esm/core/stream/Stream.d.mts +1 -0
- package/dist/esm/core/stream/Stream.mjs +8 -5
- package/dist/esm/core/url/encodePathParam.d.mts +1 -0
- package/dist/esm/core/url/encodePathParam.mjs +18 -0
- package/dist/esm/core/url/index.d.mts +1 -0
- package/dist/esm/core/url/index.mjs +1 -0
- package/dist/esm/core/url/join.mjs +3 -3
- package/dist/esm/errors/CredalError.d.mts +1 -1
- package/dist/esm/errors/CredalError.mjs +1 -2
- package/dist/esm/exports.d.mts +1 -0
- package/dist/esm/exports.mjs +1 -0
- package/dist/esm/index.d.mts +3 -2
- package/dist/esm/index.mjs +2 -2
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +9 -4
- package/reference.md +203 -229
|
@@ -44,9 +44,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.DocumentCatalog = void 0;
|
|
47
|
-
const environments = __importStar(require("../../../../environments.js"));
|
|
48
|
-
const core = __importStar(require("../../../../core/index.js"));
|
|
49
47
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
49
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
50
50
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
51
|
class DocumentCatalog {
|
|
52
52
|
constructor(_options = {}) {
|
|
@@ -71,7 +71,7 @@ class DocumentCatalog {
|
|
|
71
71
|
__uploadDocumentContents(request, requestOptions) {
|
|
72
72
|
return __awaiter(this, void 0, void 0, function* () {
|
|
73
73
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
74
|
-
|
|
74
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
75
75
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
76
76
|
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"),
|
|
77
77
|
method: "POST",
|
|
@@ -111,6 +111,90 @@ class DocumentCatalog {
|
|
|
111
111
|
}
|
|
112
112
|
});
|
|
113
113
|
}
|
|
114
|
+
/**
|
|
115
|
+
* Upload a file (PDF, Word, Excel, CSV, PowerPoint) to Credal. Unlike uploadDocumentContents which requires pre-parsed text, this endpoint accepts actual file uploads and automatically parses them using Credal's parsing service.
|
|
116
|
+
*
|
|
117
|
+
* @param {Credal.UploadFileRequest} request
|
|
118
|
+
* @param {DocumentCatalog.RequestOptions} requestOptions - Request-specific configuration.
|
|
119
|
+
*/
|
|
120
|
+
uploadFile(request, requestOptions) {
|
|
121
|
+
return core.HttpResponsePromise.fromPromise(this.__uploadFile(request, requestOptions));
|
|
122
|
+
}
|
|
123
|
+
__uploadFile(request, requestOptions) {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
125
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
126
|
+
const _request = yield core.newFormData();
|
|
127
|
+
yield _request.appendFile("file", request.file);
|
|
128
|
+
if (request.documentName != null) {
|
|
129
|
+
_request.append("documentName", request.documentName);
|
|
130
|
+
}
|
|
131
|
+
_request.append("uploadAsUserEmail", request.uploadAsUserEmail);
|
|
132
|
+
_request.append("documentExternalId", request.documentExternalId);
|
|
133
|
+
if (request.allowedUsersEmailAddresses != null) {
|
|
134
|
+
_request.append("allowedUsersEmailAddresses", request.allowedUsersEmailAddresses);
|
|
135
|
+
}
|
|
136
|
+
if (request.documentExternalUrl != null) {
|
|
137
|
+
_request.append("documentExternalUrl", request.documentExternalUrl);
|
|
138
|
+
}
|
|
139
|
+
if (request.customMetadata != null) {
|
|
140
|
+
_request.append("customMetadata", request.customMetadata);
|
|
141
|
+
}
|
|
142
|
+
if (request.collectionId != null) {
|
|
143
|
+
_request.append("collectionId", request.collectionId);
|
|
144
|
+
}
|
|
145
|
+
if (request.forceUpdate != null) {
|
|
146
|
+
_request.append("forceUpdate", request.forceUpdate);
|
|
147
|
+
}
|
|
148
|
+
if (request.internalPublic != null) {
|
|
149
|
+
_request.append("internalPublic", request.internalPublic);
|
|
150
|
+
}
|
|
151
|
+
if (request.sourceSystemUpdated != null) {
|
|
152
|
+
_request.append("sourceSystemUpdated", request.sourceSystemUpdated);
|
|
153
|
+
}
|
|
154
|
+
if (request.awaitVectorStoreSync != null) {
|
|
155
|
+
_request.append("awaitVectorStoreSync", request.awaitVectorStoreSync);
|
|
156
|
+
}
|
|
157
|
+
const _maybeEncodedRequest = yield _request.getRequest();
|
|
158
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({ Authorization: yield this._getAuthorizationHeader() }, _maybeEncodedRequest.headers)), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
159
|
+
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
160
|
+
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/uploadFile"),
|
|
161
|
+
method: "POST",
|
|
162
|
+
headers: _headers,
|
|
163
|
+
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
164
|
+
requestType: "file",
|
|
165
|
+
duplex: _maybeEncodedRequest.duplex,
|
|
166
|
+
body: _maybeEncodedRequest.body,
|
|
167
|
+
timeoutMs: ((_g = (_e = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _e !== void 0 ? _e : (_f = this._options) === null || _f === void 0 ? void 0 : _f.timeoutInSeconds) !== null && _g !== void 0 ? _g : 60) * 1000,
|
|
168
|
+
maxRetries: (_h = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _h !== void 0 ? _h : (_j = this._options) === null || _j === void 0 ? void 0 : _j.maxRetries,
|
|
169
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
170
|
+
});
|
|
171
|
+
if (_response.ok) {
|
|
172
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
173
|
+
}
|
|
174
|
+
if (_response.error.reason === "status-code") {
|
|
175
|
+
throw new errors.CredalError({
|
|
176
|
+
statusCode: _response.error.statusCode,
|
|
177
|
+
body: _response.error.body,
|
|
178
|
+
rawResponse: _response.rawResponse,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
switch (_response.error.reason) {
|
|
182
|
+
case "non-json":
|
|
183
|
+
throw new errors.CredalError({
|
|
184
|
+
statusCode: _response.error.statusCode,
|
|
185
|
+
body: _response.error.rawBody,
|
|
186
|
+
rawResponse: _response.rawResponse,
|
|
187
|
+
});
|
|
188
|
+
case "timeout":
|
|
189
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/catalog/uploadFile.");
|
|
190
|
+
case "unknown":
|
|
191
|
+
throw new errors.CredalError({
|
|
192
|
+
message: _response.error.errorMessage,
|
|
193
|
+
rawResponse: _response.rawResponse,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
});
|
|
197
|
+
}
|
|
114
198
|
/**
|
|
115
199
|
* Sync a document from a source URL. Does not support recursive web search. Reach out to a Credal representative for access.
|
|
116
200
|
*
|
|
@@ -129,7 +213,7 @@ class DocumentCatalog {
|
|
|
129
213
|
__syncSourceByUrl(request, requestOptions) {
|
|
130
214
|
return __awaiter(this, void 0, void 0, function* () {
|
|
131
215
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
132
|
-
|
|
216
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
133
217
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
134
218
|
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"),
|
|
135
219
|
method: "POST",
|
|
@@ -207,7 +291,7 @@ class DocumentCatalog {
|
|
|
207
291
|
__metadata(request, requestOptions) {
|
|
208
292
|
return __awaiter(this, void 0, void 0, function* () {
|
|
209
293
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
210
|
-
|
|
294
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
211
295
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
212
296
|
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"),
|
|
213
297
|
method: "PATCH",
|
|
@@ -250,7 +334,7 @@ class DocumentCatalog {
|
|
|
250
334
|
_getAuthorizationHeader() {
|
|
251
335
|
return __awaiter(this, void 0, void 0, function* () {
|
|
252
336
|
var _a;
|
|
253
|
-
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env
|
|
337
|
+
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env.CREDAL_API_KEY;
|
|
254
338
|
if (bearer == null) {
|
|
255
339
|
throw new errors.CredalError({
|
|
256
340
|
message: "Please specify a bearer by either passing it in to the constructor or initializing a CREDAL_API_KEY environment variable",
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type * as core from "../../../../../core/index.js";
|
|
2
|
+
export interface UploadFileRequest {
|
|
3
|
+
/** The file to upload. Supported formats: PDF (.pdf), Word (.docx), Excel (.xlsx, .xls), PowerPoint (.pptx, .ppt), CSV (.csv), and text files. */
|
|
4
|
+
file: core.file.Uploadable;
|
|
5
|
+
/** The name of the document you want to upload. If not provided, the original filename will be used. */
|
|
6
|
+
documentName?: string;
|
|
7
|
+
/** [Legacy] The user on behalf of whom the document should be uploaded. In most cases, this can simply be the email of the developer making the API call. This field will be removed in the future in favor of purely specifying permissions via allowedUsersEmailAddresses. */
|
|
8
|
+
uploadAsUserEmail: string;
|
|
9
|
+
/** The external ID of the document. This is typically the ID as it exists in its original external system. Uploads to the same external ID will update the document in Credal. */
|
|
10
|
+
documentExternalId: string;
|
|
11
|
+
/** Users allowed to access the document. Can be provided as a JSON array string (e.g., ["user1@example.com","user2@example.com"]) or comma-separated list (e.g., "user1@example.com,user2@example.com"). Unlike Credal's out of the box connectors which reconcile various permissions models from 3rd party software, for custom uploads the caller is responsible for specifying who can access the document and currently flattening groups if applicable. Documents can also be marked as internal public. */
|
|
12
|
+
allowedUsersEmailAddresses?: string;
|
|
13
|
+
/** The external URL of the document you want to upload. If provided Credal will link to this URL. */
|
|
14
|
+
documentExternalUrl?: string;
|
|
15
|
+
/** Optional JSON string representing any custom metadata for this document (e.g., '{"key1":"value1","key2":"value2"}'). */
|
|
16
|
+
customMetadata?: string;
|
|
17
|
+
/** If specified, the document will also be added to the provided document collection. This operation is eventually consistent, meaning the document does not immediately start appearing in searches of that collection due to an asynchronous embedding process. To achieve strong consistency use the `awaitVectorStoreSync` parameter. */
|
|
18
|
+
collectionId?: string;
|
|
19
|
+
/** If set to "true", document contents will be re-uploaded and re-embedded even if the document already exists in Credal. */
|
|
20
|
+
forceUpdate?: string;
|
|
21
|
+
/** If set to "true", document will be accessible to everyone within the organization of the uploader. */
|
|
22
|
+
internalPublic?: string;
|
|
23
|
+
/** ISO 8601 date string indicating when the document was last updated in the source system (e.g., "2025-11-03T21:15:00Z"). */
|
|
24
|
+
sourceSystemUpdated?: string;
|
|
25
|
+
/** Document uploads are eventually consistent by default. If set to "true" 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. */
|
|
26
|
+
awaitVectorStoreSync?: string;
|
|
27
|
+
}
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { UploadDocumentContentsRequest } from "./UploadDocumentContentsRequest.js";
|
|
2
|
+
export type { UploadFileRequest } from "./UploadFileRequest.js";
|
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types/index.js"), exports);
|
|
18
17
|
__exportStar(require("./client/index.js"), exports);
|
|
18
|
+
__exportStar(require("./types/index.js"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from "./UploadDocumentResponse.js";
|
|
2
1
|
export * from "./DocumentMetadataPatch.js";
|
|
3
2
|
export * from "./DocumentMetadataPatchRequest.js";
|
|
4
3
|
export * from "./SyncSourceByUrlRequest.js";
|
|
5
4
|
export * from "./SyncSourceByUrlResponse.js";
|
|
5
|
+
export * from "./UploadDocumentResponse.js";
|
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./UploadDocumentResponse.js"), exports);
|
|
18
17
|
__exportStar(require("./DocumentMetadataPatch.js"), exports);
|
|
19
18
|
__exportStar(require("./DocumentMetadataPatchRequest.js"), exports);
|
|
20
19
|
__exportStar(require("./SyncSourceByUrlRequest.js"), exports);
|
|
21
20
|
__exportStar(require("./SyncSourceByUrlResponse.js"), exports);
|
|
21
|
+
__exportStar(require("./UploadDocumentResponse.js"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import * as core from "../../../../core/index.js";
|
|
3
|
-
import * as Credal from "../../../index.js";
|
|
3
|
+
import type * as Credal from "../../../index.js";
|
|
4
4
|
export declare namespace DocumentCollections {
|
|
5
5
|
interface Options extends BaseClientOptions {
|
|
6
6
|
}
|
|
@@ -44,9 +44,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.DocumentCollections = void 0;
|
|
47
|
-
const environments = __importStar(require("../../../../environments.js"));
|
|
48
|
-
const core = __importStar(require("../../../../core/index.js"));
|
|
49
47
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
49
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
50
50
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
51
|
class DocumentCollections {
|
|
52
52
|
constructor(_options = {}) {
|
|
@@ -78,7 +78,7 @@ class DocumentCollections {
|
|
|
78
78
|
__addDocumentsToCollection(request, requestOptions) {
|
|
79
79
|
return __awaiter(this, void 0, void 0, function* () {
|
|
80
80
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
81
|
-
|
|
81
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
82
82
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
83
83
|
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"),
|
|
84
84
|
method: "POST",
|
|
@@ -144,7 +144,7 @@ class DocumentCollections {
|
|
|
144
144
|
__removeDocumentsFromCollection(request, requestOptions) {
|
|
145
145
|
return __awaiter(this, void 0, void 0, function* () {
|
|
146
146
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
147
|
-
|
|
147
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
148
148
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
149
149
|
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"),
|
|
150
150
|
method: "DELETE",
|
|
@@ -203,8 +203,8 @@ class DocumentCollections {
|
|
|
203
203
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
204
204
|
const { collectionId } = request;
|
|
205
205
|
const _queryParams = {};
|
|
206
|
-
_queryParams
|
|
207
|
-
|
|
206
|
+
_queryParams.collectionId = collectionId;
|
|
207
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
208
208
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
209
209
|
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"),
|
|
210
210
|
method: "GET",
|
|
@@ -266,7 +266,7 @@ class DocumentCollections {
|
|
|
266
266
|
__createCollection(request, requestOptions) {
|
|
267
267
|
return __awaiter(this, void 0, void 0, function* () {
|
|
268
268
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
269
|
-
|
|
269
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
270
270
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
271
271
|
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"),
|
|
272
272
|
method: "POST",
|
|
@@ -323,7 +323,7 @@ class DocumentCollections {
|
|
|
323
323
|
__deleteCollection(request, requestOptions) {
|
|
324
324
|
return __awaiter(this, void 0, void 0, function* () {
|
|
325
325
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
326
|
-
|
|
326
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
327
327
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
328
328
|
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"),
|
|
329
329
|
method: "DELETE",
|
|
@@ -396,7 +396,7 @@ class DocumentCollections {
|
|
|
396
396
|
__createMongoCollectionSync(request, requestOptions) {
|
|
397
397
|
return __awaiter(this, void 0, void 0, function* () {
|
|
398
398
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
399
|
-
|
|
399
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
400
400
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
401
401
|
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"),
|
|
402
402
|
method: "POST",
|
|
@@ -469,7 +469,7 @@ class DocumentCollections {
|
|
|
469
469
|
__updateMongoCollectionSync(request, requestOptions) {
|
|
470
470
|
return __awaiter(this, void 0, void 0, function* () {
|
|
471
471
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
472
|
-
|
|
472
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
473
473
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
474
474
|
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"),
|
|
475
475
|
method: "POST",
|
|
@@ -512,7 +512,7 @@ class DocumentCollections {
|
|
|
512
512
|
_getAuthorizationHeader() {
|
|
513
513
|
return __awaiter(this, void 0, void 0, function* () {
|
|
514
514
|
var _a;
|
|
515
|
-
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env
|
|
515
|
+
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env.CREDAL_API_KEY;
|
|
516
516
|
if (bearer == null) {
|
|
517
517
|
throw new errors.CredalError({
|
|
518
518
|
message: "Please specify a bearer by either passing it in to the constructor or initializing a CREDAL_API_KEY environment variable",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
1
|
+
export type { AddDocumentsToCollectionRequest } from "./AddDocumentsToCollectionRequest.js";
|
|
2
|
+
export type { CreateCollectionRequest } from "./CreateCollectionRequest.js";
|
|
3
|
+
export type { CreateMongoCollectionSyncRequest } from "./CreateMongoCollectionSyncRequest.js";
|
|
4
|
+
export type { DeleteCollectionRequest } from "./DeleteCollectionRequest.js";
|
|
5
|
+
export type { ListDocumentsInCollectionRequest } from "./ListDocumentsInCollectionRequest.js";
|
|
6
|
+
export type { RemoveDocumentsFromCollectionRequest } from "./RemoveDocumentsFromCollectionRequest.js";
|
|
7
|
+
export type { UpdateMongoCollectionSyncRequest } from "./UpdateMongoCollectionSyncRequest.js";
|
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types/index.js"), exports);
|
|
18
17
|
__exportStar(require("./client/index.js"), exports);
|
|
18
|
+
__exportStar(require("./types/index.js"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export * from "./CreateCollectionResponse.js";
|
|
2
2
|
export * from "./DeleteCollectionResponse.js";
|
|
3
3
|
export * from "./ListDocumentsInCollectionResponse.js";
|
|
4
|
-
export * from "./MongoSourceFieldsConfig.js";
|
|
5
4
|
export * from "./MongoCollectionSyncConfig.js";
|
|
6
5
|
export * from "./MongoCollectionSyncResponse.js";
|
|
6
|
+
export * from "./MongoSourceFieldsConfig.js";
|
|
@@ -17,6 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./CreateCollectionResponse.js"), exports);
|
|
18
18
|
__exportStar(require("./DeleteCollectionResponse.js"), exports);
|
|
19
19
|
__exportStar(require("./ListDocumentsInCollectionResponse.js"), exports);
|
|
20
|
-
__exportStar(require("./MongoSourceFieldsConfig.js"), exports);
|
|
21
20
|
__exportStar(require("./MongoCollectionSyncConfig.js"), exports);
|
|
22
21
|
__exportStar(require("./MongoCollectionSyncResponse.js"), exports);
|
|
22
|
+
__exportStar(require("./MongoSourceFieldsConfig.js"), exports);
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
export * as common from "./common/index.js";
|
|
2
2
|
export * from "./common/types/index.js";
|
|
3
|
+
export * from "./copilots/client/requests/index.js";
|
|
3
4
|
export * as copilots from "./copilots/index.js";
|
|
4
5
|
export * from "./copilots/types/index.js";
|
|
6
|
+
export * from "./documentCatalog/client/requests/index.js";
|
|
5
7
|
export * as documentCatalog from "./documentCatalog/index.js";
|
|
6
8
|
export * from "./documentCatalog/types/index.js";
|
|
9
|
+
export * from "./documentCollections/client/requests/index.js";
|
|
7
10
|
export * as documentCollections from "./documentCollections/index.js";
|
|
8
11
|
export * from "./documentCollections/types/index.js";
|
|
12
|
+
export * from "./search/client/requests/index.js";
|
|
9
13
|
export * as search from "./search/index.js";
|
|
10
14
|
export * from "./search/types/index.js";
|
|
11
15
|
export * as users from "./users/index.js";
|
|
12
16
|
export * from "./users/types/index.js";
|
|
13
|
-
export * from "./copilots/client/requests/index.js";
|
|
14
|
-
export * from "./documentCatalog/client/requests/index.js";
|
|
15
|
-
export * from "./documentCollections/client/requests/index.js";
|
|
16
|
-
export * from "./search/client/requests/index.js";
|
|
@@ -39,17 +39,17 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
39
39
|
exports.users = exports.search = exports.documentCollections = exports.documentCatalog = exports.copilots = exports.common = void 0;
|
|
40
40
|
exports.common = __importStar(require("./common/index.js"));
|
|
41
41
|
__exportStar(require("./common/types/index.js"), exports);
|
|
42
|
+
__exportStar(require("./copilots/client/requests/index.js"), exports);
|
|
42
43
|
exports.copilots = __importStar(require("./copilots/index.js"));
|
|
43
44
|
__exportStar(require("./copilots/types/index.js"), exports);
|
|
45
|
+
__exportStar(require("./documentCatalog/client/requests/index.js"), exports);
|
|
44
46
|
exports.documentCatalog = __importStar(require("./documentCatalog/index.js"));
|
|
45
47
|
__exportStar(require("./documentCatalog/types/index.js"), exports);
|
|
48
|
+
__exportStar(require("./documentCollections/client/requests/index.js"), exports);
|
|
46
49
|
exports.documentCollections = __importStar(require("./documentCollections/index.js"));
|
|
47
50
|
__exportStar(require("./documentCollections/types/index.js"), exports);
|
|
51
|
+
__exportStar(require("./search/client/requests/index.js"), exports);
|
|
48
52
|
exports.search = __importStar(require("./search/index.js"));
|
|
49
53
|
__exportStar(require("./search/types/index.js"), exports);
|
|
50
54
|
exports.users = __importStar(require("./users/index.js"));
|
|
51
55
|
__exportStar(require("./users/types/index.js"), exports);
|
|
52
|
-
__exportStar(require("./copilots/client/requests/index.js"), exports);
|
|
53
|
-
__exportStar(require("./documentCatalog/client/requests/index.js"), exports);
|
|
54
|
-
__exportStar(require("./documentCollections/client/requests/index.js"), exports);
|
|
55
|
-
__exportStar(require("./search/client/requests/index.js"), exports);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
2
|
import * as core from "../../../../core/index.js";
|
|
3
|
-
import * as Credal from "../../../index.js";
|
|
3
|
+
import type * as Credal from "../../../index.js";
|
|
4
4
|
export declare namespace Search {
|
|
5
5
|
interface Options extends BaseClientOptions {
|
|
6
6
|
}
|
|
@@ -44,9 +44,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
44
44
|
};
|
|
45
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
46
|
exports.Search = void 0;
|
|
47
|
-
const environments = __importStar(require("../../../../environments.js"));
|
|
48
|
-
const core = __importStar(require("../../../../core/index.js"));
|
|
49
47
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
49
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
50
50
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
51
51
|
class Search {
|
|
52
52
|
constructor(_options = {}) {
|
|
@@ -84,7 +84,7 @@ class Search {
|
|
|
84
84
|
__searchDocumentCollection(request, requestOptions) {
|
|
85
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
86
86
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
87
|
-
|
|
87
|
+
const _headers = (0, headers_js_1.mergeHeaders)((_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({ Authorization: yield this._getAuthorizationHeader() }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
|
|
88
88
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
89
89
|
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"),
|
|
90
90
|
method: "POST",
|
|
@@ -130,7 +130,7 @@ class Search {
|
|
|
130
130
|
_getAuthorizationHeader() {
|
|
131
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
132
|
var _a;
|
|
133
|
-
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env
|
|
133
|
+
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env.CREDAL_API_KEY;
|
|
134
134
|
if (bearer == null) {
|
|
135
135
|
throw new errors.CredalError({
|
|
136
136
|
message: "Please specify a bearer by either passing it in to the constructor or initializing a CREDAL_API_KEY environment variable",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export type { SearchDocumentCollectionRequest } from "./SearchDocumentCollectionRequest.js";
|
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./types/index.js"), exports);
|
|
18
17
|
__exportStar(require("./client/index.js"), exports);
|
|
18
|
+
__exportStar(require("./types/index.js"), exports);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "./DocumentCollectionSearchOptions.js";
|
|
2
|
-
export * from "./SearchDocumentCollectionResponse.js";
|
|
3
2
|
export * from "./DocumentCollectionSearchResult.js";
|
|
3
|
+
export * from "./SearchDocumentCollectionResponse.js";
|
|
4
4
|
export * from "./SearchResultChunk.js";
|
|
5
5
|
export * from "./SingleFieldFilter.js";
|
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./DocumentCollectionSearchOptions.js"), exports);
|
|
18
|
-
__exportStar(require("./SearchDocumentCollectionResponse.js"), exports);
|
|
19
18
|
__exportStar(require("./DocumentCollectionSearchResult.js"), exports);
|
|
19
|
+
__exportStar(require("./SearchDocumentCollectionResponse.js"), exports);
|
|
20
20
|
__exportStar(require("./SearchResultChunk.js"), exports);
|
|
21
21
|
__exportStar(require("./SingleFieldFilter.js"), exports);
|