@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
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
11
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
12
|
+
var m = o[Symbol.asyncIterator], i;
|
|
13
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
14
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
15
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
16
|
+
};
|
|
17
|
+
import { toMultipartDataPart } from "../../core/file/index.mjs";
|
|
18
|
+
import { toJson } from "../../core/json.mjs";
|
|
19
|
+
import { RUNTIME } from "../runtime/index.mjs";
|
|
20
|
+
export function newFormData() {
|
|
21
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
22
|
+
return new FormDataWrapper();
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
export class FormDataWrapper {
|
|
26
|
+
constructor() {
|
|
27
|
+
this.fd = new FormData();
|
|
28
|
+
}
|
|
29
|
+
setup() {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
// noop
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
append(key, value) {
|
|
35
|
+
this.fd.append(key, String(value));
|
|
36
|
+
}
|
|
37
|
+
appendFile(key, value) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const { data, filename, contentType } = yield toMultipartDataPart(value);
|
|
40
|
+
const blob = yield convertToBlob(data, contentType);
|
|
41
|
+
if (filename) {
|
|
42
|
+
this.fd.append(key, blob, filename);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
this.fd.append(key, blob);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
getRequest() {
|
|
50
|
+
return {
|
|
51
|
+
body: this.fd,
|
|
52
|
+
headers: {},
|
|
53
|
+
duplex: "half",
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function isStreamLike(value) {
|
|
58
|
+
return typeof value === "object" && value != null && ("read" in value || "pipe" in value);
|
|
59
|
+
}
|
|
60
|
+
function isReadableStream(value) {
|
|
61
|
+
return typeof value === "object" && value != null && "getReader" in value;
|
|
62
|
+
}
|
|
63
|
+
function isBuffer(value) {
|
|
64
|
+
return typeof Buffer !== "undefined" && Buffer.isBuffer && Buffer.isBuffer(value);
|
|
65
|
+
}
|
|
66
|
+
function isArrayBufferView(value) {
|
|
67
|
+
return ArrayBuffer.isView(value);
|
|
68
|
+
}
|
|
69
|
+
function streamToBuffer(stream) {
|
|
70
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
+
var _a, stream_1, stream_1_1;
|
|
72
|
+
var _b, e_1, _c, _d;
|
|
73
|
+
if (RUNTIME.type === "node") {
|
|
74
|
+
const { Readable } = yield import("stream");
|
|
75
|
+
if (stream instanceof Readable) {
|
|
76
|
+
const chunks = [];
|
|
77
|
+
try {
|
|
78
|
+
for (_a = true, stream_1 = __asyncValues(stream); stream_1_1 = yield stream_1.next(), _b = stream_1_1.done, !_b; _a = true) {
|
|
79
|
+
_d = stream_1_1.value;
|
|
80
|
+
_a = false;
|
|
81
|
+
const chunk = _d;
|
|
82
|
+
chunks.push(Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
86
|
+
finally {
|
|
87
|
+
try {
|
|
88
|
+
if (!_a && !_b && (_c = stream_1.return)) yield _c.call(stream_1);
|
|
89
|
+
}
|
|
90
|
+
finally { if (e_1) throw e_1.error; }
|
|
91
|
+
}
|
|
92
|
+
return Buffer.concat(chunks);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
if (isReadableStream(stream)) {
|
|
96
|
+
const reader = stream.getReader();
|
|
97
|
+
const chunks = [];
|
|
98
|
+
try {
|
|
99
|
+
while (true) {
|
|
100
|
+
const { done, value } = yield reader.read();
|
|
101
|
+
if (done)
|
|
102
|
+
break;
|
|
103
|
+
chunks.push(value);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
finally {
|
|
107
|
+
reader.releaseLock();
|
|
108
|
+
}
|
|
109
|
+
const totalLength = chunks.reduce((sum, chunk) => sum + chunk.length, 0);
|
|
110
|
+
const result = new Uint8Array(totalLength);
|
|
111
|
+
let offset = 0;
|
|
112
|
+
for (const chunk of chunks) {
|
|
113
|
+
result.set(chunk, offset);
|
|
114
|
+
offset += chunk.length;
|
|
115
|
+
}
|
|
116
|
+
return Buffer.from(result);
|
|
117
|
+
}
|
|
118
|
+
throw new Error(`Unsupported stream type: ${typeof stream}. Expected Node.js Readable stream or Web ReadableStream.`);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function convertToBlob(value, contentType) {
|
|
122
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
123
|
+
if (isStreamLike(value) || isReadableStream(value)) {
|
|
124
|
+
const buffer = yield streamToBuffer(value);
|
|
125
|
+
return new Blob([buffer], { type: contentType });
|
|
126
|
+
}
|
|
127
|
+
if (value instanceof Blob) {
|
|
128
|
+
return value;
|
|
129
|
+
}
|
|
130
|
+
if (isBuffer(value)) {
|
|
131
|
+
return new Blob([value], { type: contentType });
|
|
132
|
+
}
|
|
133
|
+
if (value instanceof ArrayBuffer) {
|
|
134
|
+
return new Blob([value], { type: contentType });
|
|
135
|
+
}
|
|
136
|
+
if (isArrayBufferView(value)) {
|
|
137
|
+
return new Blob([value], { type: contentType });
|
|
138
|
+
}
|
|
139
|
+
if (typeof value === "string") {
|
|
140
|
+
return new Blob([value], { type: contentType });
|
|
141
|
+
}
|
|
142
|
+
if (typeof value === "object" && value !== null) {
|
|
143
|
+
return new Blob([toJson(value)], { type: contentType !== null && contentType !== void 0 ? contentType : "application/json" });
|
|
144
|
+
}
|
|
145
|
+
return new Blob([String(value)], { type: contentType });
|
|
146
|
+
});
|
|
147
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function encodeAsFormParameter(value: unknown): Record<string, string>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { toQueryString } from "../url/qs.mjs";
|
|
2
|
+
export function encodeAsFormParameter(value) {
|
|
3
|
+
const stringified = toQueryString(value, { encode: false });
|
|
4
|
+
const keyValuePairs = stringified.split("&").map((pair) => {
|
|
5
|
+
const [key, value] = pair.split("=");
|
|
6
|
+
return [key, value];
|
|
7
|
+
});
|
|
8
|
+
return Object.fromEntries(keyValuePairs);
|
|
9
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export * from "./fetcher/index.mjs";
|
|
2
|
-
export * from "./runtime/index.mjs";
|
|
3
|
-
export * as url from "./url/index.mjs";
|
|
4
1
|
export * from "./auth/index.mjs";
|
|
5
2
|
export * from "./base64.mjs";
|
|
3
|
+
export * from "./fetcher/index.mjs";
|
|
4
|
+
export * as file from "./file/index.mjs";
|
|
5
|
+
export * from "./form-data-utils/index.mjs";
|
|
6
|
+
export * from "./runtime/index.mjs";
|
|
6
7
|
export * from "./stream/index.mjs";
|
|
8
|
+
export * as url from "./url/index.mjs";
|
package/dist/esm/core/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export * from "./fetcher/index.mjs";
|
|
2
|
-
export * from "./runtime/index.mjs";
|
|
3
|
-
export * as url from "./url/index.mjs";
|
|
4
1
|
export * from "./auth/index.mjs";
|
|
5
2
|
export * from "./base64.mjs";
|
|
3
|
+
export * from "./fetcher/index.mjs";
|
|
4
|
+
export * as file from "./file/index.mjs";
|
|
5
|
+
export * from "./form-data-utils/index.mjs";
|
|
6
|
+
export * from "./runtime/index.mjs";
|
|
6
7
|
export * from "./stream/index.mjs";
|
|
8
|
+
export * as url from "./url/index.mjs";
|
|
@@ -33,6 +33,7 @@ export declare class Stream<T> implements AsyncIterable<T> {
|
|
|
33
33
|
private messageTerminator;
|
|
34
34
|
private streamTerminator;
|
|
35
35
|
private controller;
|
|
36
|
+
private decoder;
|
|
36
37
|
constructor({ stream, parse, eventShape, signal }: Stream.Args & {
|
|
37
38
|
parse: (val: unknown) => Promise<T>;
|
|
38
39
|
});
|
|
@@ -43,6 +43,10 @@ export class Stream {
|
|
|
43
43
|
this.messageTerminator = eventShape.messageTerminator;
|
|
44
44
|
}
|
|
45
45
|
signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", () => this.controller.abort());
|
|
46
|
+
// Initialize shared TextDecoder
|
|
47
|
+
if (typeof TextDecoder !== "undefined") {
|
|
48
|
+
this.decoder = new TextDecoder("utf-8");
|
|
49
|
+
}
|
|
46
50
|
}
|
|
47
51
|
iterMessages() {
|
|
48
52
|
return __asyncGenerator(this, arguments, function* iterMessages_1() {
|
|
@@ -59,7 +63,7 @@ export class Stream {
|
|
|
59
63
|
buf += this.decodeChunk(chunk);
|
|
60
64
|
let terminatorIndex;
|
|
61
65
|
while ((terminatorIndex = buf.indexOf(this.messageTerminator)) >= 0) {
|
|
62
|
-
let line = buf.slice(0, terminatorIndex
|
|
66
|
+
let line = buf.slice(0, terminatorIndex);
|
|
63
67
|
buf = buf.slice(terminatorIndex + this.messageTerminator.length);
|
|
64
68
|
if (!line.trim()) {
|
|
65
69
|
continue;
|
|
@@ -112,10 +116,9 @@ export class Stream {
|
|
|
112
116
|
}
|
|
113
117
|
decodeChunk(chunk) {
|
|
114
118
|
let decoded = "";
|
|
115
|
-
// If TextDecoder is
|
|
116
|
-
if (
|
|
117
|
-
|
|
118
|
-
decoded += decoder.decode(chunk);
|
|
119
|
+
// If TextDecoder is available, use the streaming decoder instance
|
|
120
|
+
if (this.decoder != null) {
|
|
121
|
+
decoded += this.decoder.decode(chunk, { stream: true });
|
|
119
122
|
}
|
|
120
123
|
// Buffer is present in Node.js environment
|
|
121
124
|
else if (RUNTIME.type === "node" && typeof chunk !== "undefined") {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function encodePathParam(param: unknown): string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function encodePathParam(param) {
|
|
2
|
+
if (param === null) {
|
|
3
|
+
return "null";
|
|
4
|
+
}
|
|
5
|
+
const typeofParam = typeof param;
|
|
6
|
+
switch (typeofParam) {
|
|
7
|
+
case "undefined":
|
|
8
|
+
return "undefined";
|
|
9
|
+
case "string":
|
|
10
|
+
case "number":
|
|
11
|
+
case "boolean":
|
|
12
|
+
break;
|
|
13
|
+
default:
|
|
14
|
+
param = String(param);
|
|
15
|
+
break;
|
|
16
|
+
}
|
|
17
|
+
return encodeURIComponent(param);
|
|
18
|
+
}
|
|
@@ -15,7 +15,7 @@ export function join(base, ...segments) {
|
|
|
15
15
|
return joinPath(base, ...segments);
|
|
16
16
|
}
|
|
17
17
|
const lastSegment = segments[segments.length - 1];
|
|
18
|
-
const shouldPreserveTrailingSlash = lastSegment
|
|
18
|
+
const shouldPreserveTrailingSlash = lastSegment === null || lastSegment === void 0 ? void 0 : lastSegment.endsWith("/");
|
|
19
19
|
for (const segment of segments) {
|
|
20
20
|
const cleanSegment = trimSlashes(segment);
|
|
21
21
|
if (cleanSegment) {
|
|
@@ -35,7 +35,7 @@ function joinPath(base, ...segments) {
|
|
|
35
35
|
}
|
|
36
36
|
let result = base;
|
|
37
37
|
const lastSegment = segments[segments.length - 1];
|
|
38
|
-
const shouldPreserveTrailingSlash = lastSegment
|
|
38
|
+
const shouldPreserveTrailingSlash = lastSegment === null || lastSegment === void 0 ? void 0 : lastSegment.endsWith("/");
|
|
39
39
|
for (const segment of segments) {
|
|
40
40
|
const cleanSegment = trimSlashes(segment);
|
|
41
41
|
if (cleanSegment) {
|
|
@@ -51,7 +51,7 @@ function joinPathSegments(left, right) {
|
|
|
51
51
|
if (left.endsWith("/")) {
|
|
52
52
|
return left + right;
|
|
53
53
|
}
|
|
54
|
-
return left
|
|
54
|
+
return `${left}/${right}`;
|
|
55
55
|
}
|
|
56
56
|
function trimSlashes(str) {
|
|
57
57
|
if (!str)
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
-
import * as core from "../core/index.mjs";
|
|
3
2
|
import { toJson } from "../core/json.mjs";
|
|
4
3
|
export class CredalError extends Error {
|
|
5
4
|
constructor({ message, statusCode, body, rawResponse, }) {
|
|
@@ -11,7 +10,7 @@ export class CredalError extends Error {
|
|
|
11
10
|
}
|
|
12
11
|
}
|
|
13
12
|
function buildMessage({ message, statusCode, body, }) {
|
|
14
|
-
|
|
13
|
+
const lines = [];
|
|
15
14
|
if (message != null) {
|
|
16
15
|
lines.push(message);
|
|
17
16
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core/exports.mjs";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./core/exports.mjs";
|
package/dist/esm/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * as Credal from "./api/index.mjs";
|
|
2
|
-
export {
|
|
3
|
-
export { type BaseClientOptions, type BaseRequestOptions } from "./BaseClient.mjs";
|
|
2
|
+
export type { BaseClientOptions, BaseRequestOptions } from "./BaseClient.mjs";
|
|
4
3
|
export { CredalClient } from "./Client.mjs";
|
|
5
4
|
export { CredalEnvironment } from "./environments.mjs";
|
|
5
|
+
export { CredalError, CredalTimeoutError } from "./errors/index.mjs";
|
|
6
|
+
export * from "./exports.mjs";
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * as Credal from "./api/index.mjs";
|
|
2
|
-
export { CredalError, CredalTimeoutError } from "./errors/index.mjs";
|
|
3
|
-
export {} from "./BaseClient.mjs";
|
|
4
2
|
export { CredalClient } from "./Client.mjs";
|
|
5
3
|
export { CredalEnvironment } from "./environments.mjs";
|
|
4
|
+
export { CredalError, CredalTimeoutError } from "./errors/index.mjs";
|
|
5
|
+
export * from "./exports.mjs";
|
package/dist/esm/version.d.mts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.1.
|
|
1
|
+
export declare const SDK_VERSION = "0.1.10";
|
package/dist/esm/version.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.1.
|
|
1
|
+
export const SDK_VERSION = "0.1.10";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@credal/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"repository": "github:credal-ai/credal-typescript-sdk",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -29,7 +29,12 @@
|
|
|
29
29
|
"LICENSE"
|
|
30
30
|
],
|
|
31
31
|
"scripts": {
|
|
32
|
-
"format": "
|
|
32
|
+
"format": "biome format --write --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
33
|
+
"format:check": "biome format --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
34
|
+
"lint": "biome lint --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
35
|
+
"lint:fix": "biome lint --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
36
|
+
"check": "biome check --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
37
|
+
"check:fix": "biome check --fix --unsafe --skip-parse-errors --no-errors-on-unmatched --max-diagnostics=none",
|
|
33
38
|
"build": "pnpm build:cjs && pnpm build:esm",
|
|
34
39
|
"build:cjs": "tsc --project ./tsconfig.cjs.json",
|
|
35
40
|
"build:esm": "tsc --project ./tsconfig.esm.json && node scripts/rename-to-esm-files.js dist/esm",
|
|
@@ -43,8 +48,8 @@
|
|
|
43
48
|
"vitest": "^3.2.4",
|
|
44
49
|
"msw": "2.11.2",
|
|
45
50
|
"@types/node": "^18.19.70",
|
|
46
|
-
"
|
|
47
|
-
"
|
|
51
|
+
"typescript": "~5.7.2",
|
|
52
|
+
"@biomejs/biome": "2.3.1"
|
|
48
53
|
},
|
|
49
54
|
"browser": {
|
|
50
55
|
"fs": false,
|