@credal/sdk 0.1.7 → 0.1.9
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 +27 -0
- package/dist/cjs/{api/resources/copilots/types/PolicyTrigger.js → BaseClient.js} +1 -3
- package/dist/cjs/Client.d.ts +3 -24
- package/dist/cjs/Client.js +5 -7
- package/dist/cjs/api/resources/common/types/Collaborator.d.ts +1 -4
- package/dist/cjs/api/resources/common/types/Collaborator.js +1 -3
- package/dist/cjs/api/resources/common/types/CustomMetadataValue.d.ts +0 -3
- package/dist/cjs/api/resources/common/types/CustomMetadataValue.js +1 -3
- package/dist/cjs/api/resources/common/types/ExternalResourceId.d.ts +1 -4
- package/dist/cjs/api/resources/common/types/ExternalResourceId.js +1 -3
- package/dist/cjs/api/resources/common/types/Operator.d.ts +1 -4
- package/dist/cjs/api/resources/common/types/Operator.js +1 -3
- package/dist/cjs/api/resources/common/types/ResourceIdentifier.d.ts +1 -4
- package/dist/cjs/api/resources/common/types/ResourceIdentifier.js +1 -3
- package/dist/cjs/api/resources/common/types/ResourceType.d.ts +1 -4
- package/dist/cjs/api/resources/common/types/ResourceType.js +1 -3
- package/dist/cjs/api/resources/common/types/Role.d.ts +1 -4
- package/dist/cjs/api/resources/common/types/Role.js +1 -3
- package/dist/cjs/api/resources/common/types/Url.d.ts +0 -3
- package/dist/cjs/api/resources/common/types/Url.js +1 -3
- 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 +4 -24
- package/dist/cjs/api/resources/copilots/client/Client.js +40 -42
- package/dist/cjs/api/resources/copilots/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +1 -3
- package/dist/cjs/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/client/requests/CreateConversationRequest.js +1 -3
- package/dist/cjs/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/client/requests/CreateCopilotRequest.js +1 -3
- package/dist/cjs/api/resources/copilots/client/requests/DeleteCopilotRequest.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/client/requests/DeleteCopilotRequest.js +1 -3
- package/dist/cjs/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.js +1 -3
- package/dist/cjs/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +1 -3
- package/dist/cjs/api/resources/copilots/client/requests/SendMessageRequest.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/client/requests/SendMessageRequest.js +1 -3
- package/dist/cjs/api/resources/copilots/client/requests/StreamMessageRequest.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/client/requests/StreamMessageRequest.js +1 -3
- package/dist/cjs/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/client/requests/UpdateConfigurationRequest.js +1 -3
- 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/AiEndpointConfiguration.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/types/AiEndpointConfiguration.js +1 -3
- package/dist/cjs/api/resources/copilots/types/BlockedChunk.d.ts +0 -5
- package/dist/cjs/api/resources/copilots/types/BlockedChunk.js +1 -3
- package/dist/cjs/api/resources/copilots/types/BooleanFieldSchema.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/types/BooleanFieldSchema.js +1 -3
- package/dist/cjs/api/resources/copilots/types/CollectionFilteredData.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/CollectionFilteredData.js +1 -3
- package/dist/cjs/api/resources/copilots/types/Configuration.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/Configuration.js +1 -3
- package/dist/cjs/api/resources/copilots/types/CreateConversationResponse.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/types/CreateConversationResponse.js +1 -3
- package/dist/cjs/api/resources/copilots/types/CreateCopilotResponse.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/types/CreateCopilotResponse.js +1 -3
- package/dist/cjs/api/resources/copilots/types/DataChunk.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/types/DataChunk.js +1 -3
- package/dist/cjs/api/resources/copilots/types/DataFilter.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/DataFilter.js +1 -3
- package/dist/cjs/api/resources/copilots/types/DatetimeFieldSchema.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/DatetimeFieldSchema.js +1 -3
- package/dist/cjs/api/resources/copilots/types/DeleteCopilotResponse.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/types/DeleteCopilotResponse.js +1 -3
- package/dist/cjs/api/resources/copilots/types/EndOfMessageChunk.d.ts +1 -5
- package/dist/cjs/api/resources/copilots/types/EndOfMessageChunk.js +1 -3
- package/dist/cjs/api/resources/copilots/types/ErrorChunk.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/ErrorChunk.js +1 -3
- package/dist/cjs/api/resources/copilots/types/ErrorChunkData.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/types/ErrorChunkData.js +1 -3
- package/dist/cjs/api/resources/copilots/types/FeedbackEnum.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/FeedbackEnum.js +1 -3
- package/dist/cjs/api/resources/copilots/types/Filter.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/Filter.js +1 -3
- package/dist/cjs/api/resources/copilots/types/FinalChunk.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/FinalChunk.js +1 -3
- package/dist/cjs/api/resources/copilots/types/InitialChunk.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/InitialChunk.js +1 -3
- package/dist/cjs/api/resources/copilots/types/InputVariable.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/types/InputVariable.js +1 -3
- package/dist/cjs/api/resources/copilots/types/InsertedAuditLog.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/types/InsertedAuditLog.js +1 -3
- package/dist/cjs/api/resources/copilots/types/MessageBlocked.d.ts +1 -5
- package/dist/cjs/api/resources/copilots/types/MessageBlocked.js +1 -3
- package/dist/cjs/api/resources/copilots/types/MessageFeedback.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/MessageFeedback.js +1 -3
- package/dist/cjs/api/resources/copilots/types/MessageReply.d.ts +1 -5
- package/dist/cjs/api/resources/copilots/types/MessageReply.js +1 -3
- package/dist/cjs/api/resources/copilots/types/NumberFieldSchema.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/NumberFieldSchema.js +1 -3
- package/dist/cjs/api/resources/copilots/types/ReferencedSource.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/ReferencedSource.js +1 -3
- package/dist/cjs/api/resources/copilots/types/ResponseChunk.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/types/ResponseChunk.js +1 -3
- package/dist/cjs/api/resources/copilots/types/SendAgentMessageResponse.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/SendAgentMessageResponse.js +1 -3
- package/dist/cjs/api/resources/copilots/types/SendMessageResponse.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/SendMessageResponse.js +1 -3
- package/dist/cjs/api/resources/copilots/types/StreamingChunk.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/StreamingChunk.js +1 -3
- package/dist/cjs/api/resources/copilots/types/StringFieldSchema.d.ts +1 -4
- package/dist/cjs/api/resources/copilots/types/StringFieldSchema.js +1 -3
- package/dist/cjs/api/resources/copilots/types/WebSearchResult.d.ts +0 -3
- package/dist/cjs/api/resources/copilots/types/WebSearchResult.js +1 -3
- package/dist/cjs/api/resources/copilots/types/index.d.ts +24 -25
- package/dist/cjs/api/resources/copilots/types/index.js +24 -25
- package/dist/cjs/api/resources/documentCatalog/client/Client.d.ts +4 -24
- package/dist/cjs/api/resources/documentCatalog/client/Client.js +16 -18
- package/dist/cjs/api/resources/documentCatalog/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +1 -4
- package/dist/cjs/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.js +1 -3
- package/dist/cjs/api/resources/documentCatalog/client/requests/index.d.ts +1 -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 -4
- package/dist/cjs/api/resources/documentCatalog/types/DocumentMetadataPatch.js +1 -3
- package/dist/cjs/api/resources/documentCatalog/types/DocumentMetadataPatchRequest.d.ts +1 -4
- package/dist/cjs/api/resources/documentCatalog/types/DocumentMetadataPatchRequest.js +1 -3
- package/dist/cjs/api/resources/documentCatalog/types/SyncSourceByUrlRequest.d.ts +0 -3
- package/dist/cjs/api/resources/documentCatalog/types/SyncSourceByUrlRequest.js +1 -3
- package/dist/cjs/api/resources/documentCatalog/types/SyncSourceByUrlResponse.d.ts +0 -3
- package/dist/cjs/api/resources/documentCatalog/types/SyncSourceByUrlResponse.js +1 -3
- package/dist/cjs/api/resources/documentCatalog/types/UploadDocumentResponse.d.ts +0 -3
- package/dist/cjs/api/resources/documentCatalog/types/UploadDocumentResponse.js +1 -3
- 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 +4 -24
- package/dist/cjs/api/resources/documentCollections/client/Client.js +33 -35
- package/dist/cjs/api/resources/documentCollections/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -4
- package/dist/cjs/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.js +1 -3
- package/dist/cjs/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +1 -4
- package/dist/cjs/api/resources/documentCollections/client/requests/CreateCollectionRequest.js +1 -3
- package/dist/cjs/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.ts +1 -4
- package/dist/cjs/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +1 -3
- package/dist/cjs/api/resources/documentCollections/client/requests/DeleteCollectionRequest.d.ts +0 -3
- package/dist/cjs/api/resources/documentCollections/client/requests/DeleteCollectionRequest.js +1 -3
- package/dist/cjs/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.d.ts +0 -3
- package/dist/cjs/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.js +1 -3
- package/dist/cjs/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +1 -4
- package/dist/cjs/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +1 -3
- package/dist/cjs/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.ts +1 -4
- package/dist/cjs/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +1 -3
- 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/CreateCollectionResponse.d.ts +0 -3
- package/dist/cjs/api/resources/documentCollections/types/CreateCollectionResponse.js +1 -3
- package/dist/cjs/api/resources/documentCollections/types/DeleteCollectionResponse.d.ts +0 -3
- package/dist/cjs/api/resources/documentCollections/types/DeleteCollectionResponse.js +1 -3
- package/dist/cjs/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.d.ts +1 -4
- package/dist/cjs/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.js +1 -3
- package/dist/cjs/api/resources/documentCollections/types/MongoCollectionSyncConfig.d.ts +1 -4
- package/dist/cjs/api/resources/documentCollections/types/MongoCollectionSyncConfig.js +1 -3
- package/dist/cjs/api/resources/documentCollections/types/MongoCollectionSyncResponse.d.ts +0 -3
- package/dist/cjs/api/resources/documentCollections/types/MongoCollectionSyncResponse.js +1 -3
- package/dist/cjs/api/resources/documentCollections/types/MongoSourceFieldsConfig.d.ts +0 -3
- package/dist/cjs/api/resources/documentCollections/types/MongoSourceFieldsConfig.js +1 -3
- 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 +4 -24
- package/dist/cjs/api/resources/search/client/Client.js +8 -10
- package/dist/cjs/api/resources/search/client/index.d.ts +0 -1
- package/dist/cjs/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +1 -4
- package/dist/cjs/api/resources/search/client/requests/SearchDocumentCollectionRequest.js +1 -3
- 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/DocumentCollectionSearchOptions.d.ts +0 -3
- package/dist/cjs/api/resources/search/types/DocumentCollectionSearchOptions.js +1 -3
- package/dist/cjs/api/resources/search/types/DocumentCollectionSearchResult.d.ts +1 -4
- package/dist/cjs/api/resources/search/types/DocumentCollectionSearchResult.js +1 -3
- package/dist/cjs/api/resources/search/types/SearchDocumentCollectionResponse.d.ts +1 -4
- package/dist/cjs/api/resources/search/types/SearchDocumentCollectionResponse.js +1 -3
- package/dist/cjs/api/resources/search/types/SearchResultChunk.d.ts +0 -3
- package/dist/cjs/api/resources/search/types/SearchResultChunk.js +1 -3
- package/dist/cjs/api/resources/search/types/SingleFieldFilter.d.ts +1 -4
- package/dist/cjs/api/resources/search/types/SingleFieldFilter.js +1 -3
- 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 +4 -24
- package/dist/cjs/api/resources/users/client/Client.js +8 -10
- package/dist/cjs/api/resources/users/index.d.ts +1 -1
- package/dist/cjs/api/resources/users/index.js +1 -1
- package/dist/cjs/api/resources/users/types/UserMetadataPatch.d.ts +0 -3
- package/dist/cjs/api/resources/users/types/UserMetadataPatch.js +1 -3
- package/dist/cjs/core/auth/AuthProvider.d.ts +1 -1
- package/dist/cjs/core/auth/BasicAuth.js +2 -1
- package/dist/cjs/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/cjs/core/fetcher/BinaryResponse.d.ts +1 -1
- package/dist/cjs/core/fetcher/EndpointSupplier.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.d.ts +2 -2
- package/dist/cjs/core/fetcher/Fetcher.js +2 -1
- package/dist/cjs/core/fetcher/HttpResponsePromise.d.ts +1 -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/index.d.ts +3 -3
- package/dist/cjs/core/index.js +3 -3
- 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/environments.d.ts +0 -3
- package/dist/cjs/environments.js +1 -3
- package/dist/cjs/errors/CredalError.d.ts +1 -4
- package/dist/cjs/errors/CredalError.js +2 -4
- package/dist/cjs/errors/CredalTimeoutError.d.ts +0 -3
- package/dist/cjs/errors/CredalTimeoutError.js +1 -3
- package/dist/cjs/index.d.ts +2 -1
- package/dist/cjs/index.js +4 -4
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.d.mts +27 -0
- package/dist/esm/BaseClient.mjs +2 -0
- package/dist/esm/Client.d.mts +3 -24
- package/dist/esm/Client.mjs +5 -7
- package/dist/esm/api/resources/common/types/Collaborator.d.mts +1 -4
- package/dist/esm/api/resources/common/types/Collaborator.mjs +1 -3
- package/dist/esm/api/resources/common/types/CustomMetadataValue.d.mts +0 -3
- package/dist/esm/api/resources/common/types/CustomMetadataValue.mjs +1 -3
- package/dist/esm/api/resources/common/types/ExternalResourceId.d.mts +1 -4
- package/dist/esm/api/resources/common/types/ExternalResourceId.mjs +1 -3
- package/dist/esm/api/resources/common/types/Operator.d.mts +1 -4
- package/dist/esm/api/resources/common/types/Operator.mjs +1 -3
- package/dist/esm/api/resources/common/types/ResourceIdentifier.d.mts +1 -4
- package/dist/esm/api/resources/common/types/ResourceIdentifier.mjs +1 -3
- package/dist/esm/api/resources/common/types/ResourceType.d.mts +1 -4
- package/dist/esm/api/resources/common/types/ResourceType.mjs +1 -3
- package/dist/esm/api/resources/common/types/Role.d.mts +1 -4
- package/dist/esm/api/resources/common/types/Role.mjs +1 -3
- package/dist/esm/api/resources/common/types/Url.d.mts +0 -3
- package/dist/esm/api/resources/common/types/Url.mjs +1 -3
- 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 +4 -24
- package/dist/esm/api/resources/copilots/client/Client.mjs +40 -42
- package/dist/esm/api/resources/copilots/client/index.d.mts +0 -1
- package/dist/esm/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.mts +0 -3
- package/dist/esm/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.mjs +1 -3
- package/dist/esm/api/resources/copilots/client/requests/CreateConversationRequest.d.mts +0 -3
- package/dist/esm/api/resources/copilots/client/requests/CreateConversationRequest.mjs +1 -3
- package/dist/esm/api/resources/copilots/client/requests/CreateCopilotRequest.d.mts +1 -4
- package/dist/esm/api/resources/copilots/client/requests/CreateCopilotRequest.mjs +1 -3
- package/dist/esm/api/resources/copilots/client/requests/DeleteCopilotRequest.d.mts +0 -3
- package/dist/esm/api/resources/copilots/client/requests/DeleteCopilotRequest.mjs +1 -3
- package/dist/esm/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.mts +1 -4
- package/dist/esm/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.mjs +1 -3
- package/dist/esm/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.mts +0 -3
- package/dist/esm/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.mjs +1 -3
- package/dist/esm/api/resources/copilots/client/requests/SendMessageRequest.d.mts +1 -4
- package/dist/esm/api/resources/copilots/client/requests/SendMessageRequest.mjs +1 -3
- package/dist/esm/api/resources/copilots/client/requests/StreamMessageRequest.d.mts +1 -4
- package/dist/esm/api/resources/copilots/client/requests/StreamMessageRequest.mjs +1 -3
- package/dist/esm/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.mts +1 -4
- package/dist/esm/api/resources/copilots/client/requests/UpdateConfigurationRequest.mjs +1 -3
- package/dist/esm/api/resources/copilots/client/requests/index.d.mts +9 -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/AiEndpointConfiguration.d.mts +0 -3
- package/dist/esm/api/resources/copilots/types/AiEndpointConfiguration.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/BlockedChunk.d.mts +0 -5
- package/dist/esm/api/resources/copilots/types/BlockedChunk.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/BooleanFieldSchema.d.mts +0 -3
- package/dist/esm/api/resources/copilots/types/BooleanFieldSchema.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/CollectionFilteredData.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/CollectionFilteredData.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/Configuration.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/Configuration.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/CreateConversationResponse.d.mts +0 -3
- package/dist/esm/api/resources/copilots/types/CreateConversationResponse.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/CreateCopilotResponse.d.mts +0 -3
- package/dist/esm/api/resources/copilots/types/CreateCopilotResponse.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/DataChunk.d.mts +0 -3
- package/dist/esm/api/resources/copilots/types/DataChunk.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/DataFilter.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/DataFilter.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/DatetimeFieldSchema.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/DatetimeFieldSchema.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/DeleteCopilotResponse.d.mts +0 -3
- package/dist/esm/api/resources/copilots/types/DeleteCopilotResponse.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/EndOfMessageChunk.d.mts +1 -5
- package/dist/esm/api/resources/copilots/types/EndOfMessageChunk.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/ErrorChunk.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/ErrorChunk.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/ErrorChunkData.d.mts +0 -3
- package/dist/esm/api/resources/copilots/types/ErrorChunkData.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/FeedbackEnum.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/FeedbackEnum.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/Filter.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/Filter.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/FinalChunk.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/FinalChunk.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/InitialChunk.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/InitialChunk.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/InputVariable.d.mts +0 -3
- package/dist/esm/api/resources/copilots/types/InputVariable.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/InsertedAuditLog.d.mts +0 -3
- package/dist/esm/api/resources/copilots/types/InsertedAuditLog.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/MessageBlocked.d.mts +1 -5
- package/dist/esm/api/resources/copilots/types/MessageBlocked.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/MessageFeedback.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/MessageFeedback.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/MessageReply.d.mts +1 -5
- package/dist/esm/api/resources/copilots/types/MessageReply.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/NumberFieldSchema.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/NumberFieldSchema.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/ReferencedSource.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/ReferencedSource.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/ResponseChunk.d.mts +0 -3
- package/dist/esm/api/resources/copilots/types/ResponseChunk.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/SendAgentMessageResponse.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/SendAgentMessageResponse.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/SendMessageResponse.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/SendMessageResponse.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/StreamingChunk.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/StreamingChunk.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/StringFieldSchema.d.mts +1 -4
- package/dist/esm/api/resources/copilots/types/StringFieldSchema.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/WebSearchResult.d.mts +0 -3
- package/dist/esm/api/resources/copilots/types/WebSearchResult.mjs +1 -3
- package/dist/esm/api/resources/copilots/types/index.d.mts +24 -25
- package/dist/esm/api/resources/copilots/types/index.mjs +24 -25
- package/dist/esm/api/resources/documentCatalog/client/Client.d.mts +4 -24
- package/dist/esm/api/resources/documentCatalog/client/Client.mjs +16 -18
- package/dist/esm/api/resources/documentCatalog/client/index.d.mts +0 -1
- package/dist/esm/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.mts +1 -4
- package/dist/esm/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.mjs +1 -3
- package/dist/esm/api/resources/documentCatalog/client/requests/index.d.mts +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 -4
- package/dist/esm/api/resources/documentCatalog/types/DocumentMetadataPatch.mjs +1 -3
- package/dist/esm/api/resources/documentCatalog/types/DocumentMetadataPatchRequest.d.mts +1 -4
- package/dist/esm/api/resources/documentCatalog/types/DocumentMetadataPatchRequest.mjs +1 -3
- package/dist/esm/api/resources/documentCatalog/types/SyncSourceByUrlRequest.d.mts +0 -3
- package/dist/esm/api/resources/documentCatalog/types/SyncSourceByUrlRequest.mjs +1 -3
- package/dist/esm/api/resources/documentCatalog/types/SyncSourceByUrlResponse.d.mts +0 -3
- package/dist/esm/api/resources/documentCatalog/types/SyncSourceByUrlResponse.mjs +1 -3
- package/dist/esm/api/resources/documentCatalog/types/UploadDocumentResponse.d.mts +0 -3
- package/dist/esm/api/resources/documentCatalog/types/UploadDocumentResponse.mjs +1 -3
- 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 +4 -24
- package/dist/esm/api/resources/documentCollections/client/Client.mjs +33 -35
- package/dist/esm/api/resources/documentCollections/client/index.d.mts +0 -1
- package/dist/esm/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.mts +1 -4
- package/dist/esm/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.mts +1 -4
- package/dist/esm/api/resources/documentCollections/client/requests/CreateCollectionRequest.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.d.mts +1 -4
- package/dist/esm/api/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/client/requests/DeleteCollectionRequest.d.mts +0 -3
- package/dist/esm/api/resources/documentCollections/client/requests/DeleteCollectionRequest.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.d.mts +0 -3
- package/dist/esm/api/resources/documentCollections/client/requests/ListDocumentsInCollectionRequest.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.mts +1 -4
- package/dist/esm/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.d.mts +1 -4
- package/dist/esm/api/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/client/requests/index.d.mts +7 -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/CreateCollectionResponse.d.mts +0 -3
- package/dist/esm/api/resources/documentCollections/types/CreateCollectionResponse.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/types/DeleteCollectionResponse.d.mts +0 -3
- package/dist/esm/api/resources/documentCollections/types/DeleteCollectionResponse.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.d.mts +1 -4
- package/dist/esm/api/resources/documentCollections/types/ListDocumentsInCollectionResponse.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/types/MongoCollectionSyncConfig.d.mts +1 -4
- package/dist/esm/api/resources/documentCollections/types/MongoCollectionSyncConfig.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/types/MongoCollectionSyncResponse.d.mts +0 -3
- package/dist/esm/api/resources/documentCollections/types/MongoCollectionSyncResponse.mjs +1 -3
- package/dist/esm/api/resources/documentCollections/types/MongoSourceFieldsConfig.d.mts +0 -3
- package/dist/esm/api/resources/documentCollections/types/MongoSourceFieldsConfig.mjs +1 -3
- 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 +4 -24
- package/dist/esm/api/resources/search/client/Client.mjs +8 -10
- package/dist/esm/api/resources/search/client/index.d.mts +0 -1
- package/dist/esm/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.mts +1 -4
- package/dist/esm/api/resources/search/client/requests/SearchDocumentCollectionRequest.mjs +1 -3
- package/dist/esm/api/resources/search/client/requests/index.d.mts +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/DocumentCollectionSearchOptions.d.mts +0 -3
- package/dist/esm/api/resources/search/types/DocumentCollectionSearchOptions.mjs +1 -3
- package/dist/esm/api/resources/search/types/DocumentCollectionSearchResult.d.mts +1 -4
- package/dist/esm/api/resources/search/types/DocumentCollectionSearchResult.mjs +1 -3
- package/dist/esm/api/resources/search/types/SearchDocumentCollectionResponse.d.mts +1 -4
- package/dist/esm/api/resources/search/types/SearchDocumentCollectionResponse.mjs +1 -3
- package/dist/esm/api/resources/search/types/SearchResultChunk.d.mts +0 -3
- package/dist/esm/api/resources/search/types/SearchResultChunk.mjs +1 -3
- package/dist/esm/api/resources/search/types/SingleFieldFilter.d.mts +1 -4
- package/dist/esm/api/resources/search/types/SingleFieldFilter.mjs +1 -3
- 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 +4 -24
- package/dist/esm/api/resources/users/client/Client.mjs +8 -10
- package/dist/esm/api/resources/users/index.d.mts +1 -1
- package/dist/esm/api/resources/users/index.mjs +1 -1
- package/dist/esm/api/resources/users/types/UserMetadataPatch.d.mts +0 -3
- package/dist/esm/api/resources/users/types/UserMetadataPatch.mjs +1 -3
- package/dist/esm/core/auth/AuthProvider.d.mts +1 -1
- package/dist/esm/core/auth/BasicAuth.mjs +2 -1
- package/dist/esm/core/fetcher/APIResponse.d.mts +1 -1
- package/dist/esm/core/fetcher/BinaryResponse.d.mts +1 -1
- package/dist/esm/core/fetcher/EndpointSupplier.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.d.mts +2 -2
- package/dist/esm/core/fetcher/Fetcher.mjs +2 -1
- package/dist/esm/core/fetcher/HttpResponsePromise.d.mts +1 -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/index.d.mts +3 -3
- package/dist/esm/core/index.mjs +3 -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/environments.d.mts +0 -3
- package/dist/esm/environments.mjs +1 -3
- package/dist/esm/errors/CredalError.d.mts +1 -4
- package/dist/esm/errors/CredalError.mjs +2 -4
- package/dist/esm/errors/CredalTimeoutError.d.mts +0 -3
- package/dist/esm/errors/CredalTimeoutError.mjs +1 -3
- package/dist/esm/index.d.mts +2 -1
- package/dist/esm/index.mjs +1 -1
- 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
- package/dist/cjs/api/resources/copilots/types/PolicyTrigger.d.ts +0 -8
- package/dist/esm/api/resources/copilots/types/PolicyTrigger.d.mts +0 -8
- package/dist/esm/api/resources/copilots/types/PolicyTrigger.mjs +0 -4
|
@@ -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,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as Credal from "../../../index.js";
|
|
1
|
+
import type * as Credal from "../../../index.js";
|
|
5
2
|
export interface DocumentCollectionSearchResult {
|
|
6
3
|
documentId: string;
|
|
7
4
|
documentName: string;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as Credal from "../../../index.js";
|
|
1
|
+
import type * as Credal from "../../../index.js";
|
|
5
2
|
export interface SearchDocumentCollectionResponse {
|
|
6
3
|
searchTermsUsed: string[];
|
|
7
4
|
structuredFiltersApplied: Credal.SingleFieldFilter[];
|
|
@@ -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);
|
|
@@ -1,30 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as environments from "../../../../environments.js";
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
5
2
|
import * as core from "../../../../core/index.js";
|
|
6
|
-
import * as Credal from "../../../index.js";
|
|
3
|
+
import type * as Credal from "../../../index.js";
|
|
7
4
|
export declare namespace Users {
|
|
8
|
-
interface Options {
|
|
9
|
-
environment?: core.Supplier<environments.CredalEnvironment | string>;
|
|
10
|
-
/** Specify a custom URL to connect the client to. */
|
|
11
|
-
baseUrl?: core.Supplier<string>;
|
|
12
|
-
apiKey?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
-
/** Additional headers to include in requests. */
|
|
14
|
-
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
15
|
-
fetcher?: core.FetchFunction;
|
|
5
|
+
interface Options extends BaseClientOptions {
|
|
16
6
|
}
|
|
17
|
-
interface RequestOptions {
|
|
18
|
-
/** The maximum time to wait for a response in seconds. */
|
|
19
|
-
timeoutInSeconds?: number;
|
|
20
|
-
/** The number of times to retry the request. Defaults to 2. */
|
|
21
|
-
maxRetries?: number;
|
|
22
|
-
/** A hook to abort the request. */
|
|
23
|
-
abortSignal?: AbortSignal;
|
|
24
|
-
/** Additional query string parameters to include in the request. */
|
|
25
|
-
queryParams?: Record<string, unknown>;
|
|
26
|
-
/** Additional headers to include in the request. */
|
|
27
|
-
headers?: Record<string, string | core.Supplier<string | null | undefined> | null | undefined>;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
28
8
|
}
|
|
29
9
|
}
|
|
30
10
|
export declare class Users {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
-
*/
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
5
3
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
6
4
|
if (k2 === undefined) k2 = k;
|
|
7
5
|
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
@@ -46,9 +44,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
46
44
|
};
|
|
47
45
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
46
|
exports.Users = void 0;
|
|
49
|
-
const environments = __importStar(require("../../../../environments.js"));
|
|
50
|
-
const core = __importStar(require("../../../../core/index.js"));
|
|
51
47
|
const headers_js_1 = require("../../../../core/headers.js");
|
|
48
|
+
const core = __importStar(require("../../../../core/index.js"));
|
|
49
|
+
const environments = __importStar(require("../../../../environments.js"));
|
|
52
50
|
const errors = __importStar(require("../../../../errors/index.js"));
|
|
53
51
|
class Users {
|
|
54
52
|
constructor(_options = {}) {
|
|
@@ -80,8 +78,8 @@ class Users {
|
|
|
80
78
|
}
|
|
81
79
|
__metadata(request, requestOptions) {
|
|
82
80
|
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
-
var _a, _b, _c, _d;
|
|
84
|
-
|
|
81
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
82
|
+
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);
|
|
85
83
|
const _response = yield ((_b = this._options.fetcher) !== null && _b !== void 0 ? _b : core.fetcher)({
|
|
86
84
|
url: core.url.join((_d = (_c = (yield core.Supplier.get(this._options.baseUrl))) !== null && _c !== void 0 ? _c : (yield core.Supplier.get(this._options.environment))) !== null && _d !== void 0 ? _d : environments.CredalEnvironment.Production, "/v0/users/metadata"),
|
|
87
85
|
method: "PATCH",
|
|
@@ -90,8 +88,8 @@ class Users {
|
|
|
90
88
|
queryParameters: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams,
|
|
91
89
|
requestType: "json",
|
|
92
90
|
body: request,
|
|
93
|
-
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds)
|
|
94
|
-
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
91
|
+
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,
|
|
92
|
+
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,
|
|
95
93
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
96
94
|
});
|
|
97
95
|
if (_response.ok) {
|
|
@@ -124,7 +122,7 @@ class Users {
|
|
|
124
122
|
_getAuthorizationHeader() {
|
|
125
123
|
return __awaiter(this, void 0, void 0, function* () {
|
|
126
124
|
var _a;
|
|
127
|
-
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env
|
|
125
|
+
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;
|
|
128
126
|
if (bearer == null) {
|
|
129
127
|
throw new errors.CredalError({
|
|
130
128
|
message: "Please specify a bearer by either passing it in to the constructor or initializing a CREDAL_API_KEY environment variable",
|
|
@@ -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,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
1
|
export interface UserMetadataPatch {
|
|
5
2
|
userEmail: string;
|
|
6
3
|
/** Key-value object of metadata for user. Keys will be merged with any existing values but can also be set to `null` to effectively remove */
|
|
@@ -14,7 +14,8 @@ exports.BasicAuth = {
|
|
|
14
14
|
fromAuthorizationHeader: (header) => {
|
|
15
15
|
const credentials = header.replace(BASIC_AUTH_HEADER_PREFIX, "");
|
|
16
16
|
const decoded = (0, base64_js_1.base64Decode)(credentials);
|
|
17
|
-
const [username,
|
|
17
|
+
const [username, ...passwordParts] = decoded.split(":");
|
|
18
|
+
const password = passwordParts.length > 0 ? passwordParts.join(":") : undefined;
|
|
18
19
|
if (username == null || password == null) {
|
|
19
20
|
throw new Error("Invalid basic auth");
|
|
20
21
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EndpointMetadata } from "./EndpointMetadata.js";
|
|
2
|
-
import { Supplier } from "./Supplier.js";
|
|
1
|
+
import type { EndpointMetadata } from "./EndpointMetadata.js";
|
|
2
|
+
import type { Supplier } from "./Supplier.js";
|
|
3
3
|
type EndpointSupplierFn<T> = (arg: {
|
|
4
4
|
endpointMetadata: EndpointMetadata;
|
|
5
5
|
}) => T | Promise<T>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { APIResponse } from "./APIResponse.js";
|
|
2
|
-
import { EndpointMetadata } from "./EndpointMetadata.js";
|
|
1
|
+
import type { APIResponse } from "./APIResponse.js";
|
|
2
|
+
import type { EndpointMetadata } from "./EndpointMetadata.js";
|
|
3
3
|
import { EndpointSupplier } from "./EndpointSupplier.js";
|
|
4
4
|
export type FetchFunction = <R = unknown>(args: Fetcher.Args) => Promise<APIResponse<R, Fetcher.Error>>;
|
|
5
5
|
export declare namespace Fetcher {
|
|
@@ -47,6 +47,7 @@ function getHeaders(args) {
|
|
|
47
47
|
}
|
|
48
48
|
function fetcherImpl(args) {
|
|
49
49
|
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
var _a;
|
|
50
51
|
const url = (0, createRequestUrl_js_1.createRequestUrl)(args.url, args.queryParameters);
|
|
51
52
|
const requestBody = yield (0, getRequestBody_js_1.getRequestBody)({
|
|
52
53
|
body: args.body,
|
|
@@ -78,7 +79,7 @@ function fetcherImpl(args) {
|
|
|
78
79
|
}
|
|
79
80
|
}
|
|
80
81
|
catch (error) {
|
|
81
|
-
if (args.abortSignal
|
|
82
|
+
if ((_a = args.abortSignal) === null || _a === void 0 ? void 0 : _a.aborted) {
|
|
82
83
|
return {
|
|
83
84
|
ok: false,
|
|
84
85
|
error: {
|
|
@@ -28,9 +28,10 @@ function getErrorResponseBody(response) {
|
|
|
28
28
|
case "application/ld+json":
|
|
29
29
|
case "application/problem+json":
|
|
30
30
|
case "application/vnd.api+json":
|
|
31
|
-
case "text/json":
|
|
31
|
+
case "text/json": {
|
|
32
32
|
const text = yield response.text();
|
|
33
33
|
return text.length > 0 ? (0, json_js_1.fromJson)(text) : undefined;
|
|
34
|
+
}
|
|
34
35
|
default:
|
|
35
36
|
if (contentType.startsWith("application/vnd.") && contentType.endsWith("+json")) {
|
|
36
37
|
const text = yield response.text();
|
|
@@ -10,9 +10,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.getResponseBody = getResponseBody;
|
|
13
|
+
const json_js_1 = require("../json.js");
|
|
13
14
|
const BinaryResponse_js_1 = require("./BinaryResponse.js");
|
|
14
15
|
const ResponseWithBody_js_1 = require("./ResponseWithBody.js");
|
|
15
|
-
const json_js_1 = require("../json.js");
|
|
16
16
|
function getResponseBody(response, responseType) {
|
|
17
17
|
return __awaiter(this, void 0, void 0, function* () {
|
|
18
18
|
if (!(0, ResponseWithBody_js_1.isResponseWithBody)(response)) {
|
|
@@ -36,10 +36,10 @@ function getResponseBody(response, responseType) {
|
|
|
36
36
|
const text = yield response.text();
|
|
37
37
|
if (text.length > 0) {
|
|
38
38
|
try {
|
|
39
|
-
|
|
39
|
+
const responseBody = (0, json_js_1.fromJson)(text);
|
|
40
40
|
return responseBody;
|
|
41
41
|
}
|
|
42
|
-
catch (
|
|
42
|
+
catch (_err) {
|
|
43
43
|
return {
|
|
44
44
|
ok: false,
|
|
45
45
|
error: {
|
|
@@ -14,7 +14,7 @@ const signals_js_1 = require("./signals.js");
|
|
|
14
14
|
const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abortSignal, withCredentials, duplex) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
15
|
const signals = [];
|
|
16
16
|
// Add timeout signal
|
|
17
|
-
let timeoutAbortId
|
|
17
|
+
let timeoutAbortId;
|
|
18
18
|
if (timeoutMs != null) {
|
|
19
19
|
const { signal, abortId } = (0, signals_js_1.getTimeoutSignal)(timeoutMs);
|
|
20
20
|
timeoutAbortId = abortId;
|
|
@@ -24,7 +24,7 @@ const makeRequest = (fetchFn, url, method, headers, requestBody, timeoutMs, abor
|
|
|
24
24
|
if (abortSignal != null) {
|
|
25
25
|
signals.push(abortSignal);
|
|
26
26
|
}
|
|
27
|
-
|
|
27
|
+
const newSignals = (0, signals_js_1.anySignal)(signals);
|
|
28
28
|
const response = yield fetchFn(url, {
|
|
29
29
|
method: method,
|
|
30
30
|
headers,
|
|
@@ -30,12 +30,12 @@ function getRetryDelayFromHeaders(response, retryAttempt) {
|
|
|
30
30
|
if (retryAfter) {
|
|
31
31
|
// Parse as number of seconds...
|
|
32
32
|
const retryAfterSeconds = parseInt(retryAfter, 10);
|
|
33
|
-
if (!isNaN(retryAfterSeconds) && retryAfterSeconds > 0) {
|
|
33
|
+
if (!Number.isNaN(retryAfterSeconds) && retryAfterSeconds > 0) {
|
|
34
34
|
return Math.min(retryAfterSeconds * 1000, MAX_RETRY_DELAY);
|
|
35
35
|
}
|
|
36
36
|
// ...or as an HTTP date; both are valid
|
|
37
37
|
const retryAfterDate = new Date(retryAfter);
|
|
38
|
-
if (!isNaN(retryAfterDate.getTime())) {
|
|
38
|
+
if (!Number.isNaN(retryAfterDate.getTime())) {
|
|
39
39
|
const delay = retryAfterDate.getTime() - Date.now();
|
|
40
40
|
if (delay > 0) {
|
|
41
41
|
return Math.min(Math.max(delay, 0), MAX_RETRY_DELAY);
|
|
@@ -46,7 +46,7 @@ function getRetryDelayFromHeaders(response, retryAttempt) {
|
|
|
46
46
|
const rateLimitReset = response.headers.get("X-RateLimit-Reset");
|
|
47
47
|
if (rateLimitReset) {
|
|
48
48
|
const resetTime = parseInt(rateLimitReset, 10);
|
|
49
|
-
if (!isNaN(resetTime)) {
|
|
49
|
+
if (!Number.isNaN(resetTime)) {
|
|
50
50
|
// Assume Unix timestamp in epoch seconds
|
|
51
51
|
const delay = resetTime * 1000 - Date.now();
|
|
52
52
|
if (delay > 0) {
|
package/dist/cjs/core/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./fetcher/index.js";
|
|
2
|
-
export * from "./runtime/index.js";
|
|
3
|
-
export * as url from "./url/index.js";
|
|
4
1
|
export * from "./auth/index.js";
|
|
5
2
|
export * from "./base64.js";
|
|
3
|
+
export * from "./fetcher/index.js";
|
|
4
|
+
export * from "./runtime/index.js";
|
|
6
5
|
export * from "./stream/index.js";
|
|
6
|
+
export * as url from "./url/index.js";
|
package/dist/cjs/core/index.js
CHANGED
|
@@ -37,9 +37,9 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.url = void 0;
|
|
40
|
-
__exportStar(require("./fetcher/index.js"), exports);
|
|
41
|
-
__exportStar(require("./runtime/index.js"), exports);
|
|
42
|
-
exports.url = __importStar(require("./url/index.js"));
|
|
43
40
|
__exportStar(require("./auth/index.js"), exports);
|
|
44
41
|
__exportStar(require("./base64.js"), exports);
|
|
42
|
+
__exportStar(require("./fetcher/index.js"), exports);
|
|
43
|
+
__exportStar(require("./runtime/index.js"), exports);
|
|
45
44
|
__exportStar(require("./stream/index.js"), exports);
|
|
45
|
+
exports.url = __importStar(require("./url/index.js"));
|
|
@@ -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
|
});
|
|
@@ -47,6 +47,10 @@ class Stream {
|
|
|
47
47
|
this.messageTerminator = eventShape.messageTerminator;
|
|
48
48
|
}
|
|
49
49
|
signal === null || signal === void 0 ? void 0 : signal.addEventListener("abort", () => this.controller.abort());
|
|
50
|
+
// Initialize shared TextDecoder
|
|
51
|
+
if (typeof TextDecoder !== "undefined") {
|
|
52
|
+
this.decoder = new TextDecoder("utf-8");
|
|
53
|
+
}
|
|
50
54
|
}
|
|
51
55
|
iterMessages() {
|
|
52
56
|
return __asyncGenerator(this, arguments, function* iterMessages_1() {
|
|
@@ -63,7 +67,7 @@ class Stream {
|
|
|
63
67
|
buf += this.decodeChunk(chunk);
|
|
64
68
|
let terminatorIndex;
|
|
65
69
|
while ((terminatorIndex = buf.indexOf(this.messageTerminator)) >= 0) {
|
|
66
|
-
let line = buf.slice(0, terminatorIndex
|
|
70
|
+
let line = buf.slice(0, terminatorIndex);
|
|
67
71
|
buf = buf.slice(terminatorIndex + this.messageTerminator.length);
|
|
68
72
|
if (!line.trim()) {
|
|
69
73
|
continue;
|
|
@@ -116,10 +120,9 @@ class Stream {
|
|
|
116
120
|
}
|
|
117
121
|
decodeChunk(chunk) {
|
|
118
122
|
let decoded = "";
|
|
119
|
-
// If TextDecoder is
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
decoded += decoder.decode(chunk);
|
|
123
|
+
// If TextDecoder is available, use the streaming decoder instance
|
|
124
|
+
if (this.decoder != null) {
|
|
125
|
+
decoded += this.decoder.decode(chunk, { stream: true });
|
|
123
126
|
}
|
|
124
127
|
// Buffer is present in Node.js environment
|
|
125
128
|
else if (index_js_1.RUNTIME.type === "node" && typeof chunk !== "undefined") {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function encodePathParam(param: unknown): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.encodePathParam = encodePathParam;
|
|
4
|
+
function encodePathParam(param) {
|
|
5
|
+
if (param === null) {
|
|
6
|
+
return "null";
|
|
7
|
+
}
|
|
8
|
+
const typeofParam = typeof param;
|
|
9
|
+
switch (typeofParam) {
|
|
10
|
+
case "undefined":
|
|
11
|
+
return "undefined";
|
|
12
|
+
case "string":
|
|
13
|
+
case "number":
|
|
14
|
+
case "boolean":
|
|
15
|
+
break;
|
|
16
|
+
default:
|
|
17
|
+
param = String(param);
|
|
18
|
+
break;
|
|
19
|
+
}
|
|
20
|
+
return encodeURIComponent(param);
|
|
21
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toQueryString = exports.join = void 0;
|
|
3
|
+
exports.toQueryString = exports.join = exports.encodePathParam = void 0;
|
|
4
|
+
var encodePathParam_js_1 = require("./encodePathParam.js");
|
|
5
|
+
Object.defineProperty(exports, "encodePathParam", { enumerable: true, get: function () { return encodePathParam_js_1.encodePathParam; } });
|
|
4
6
|
var join_js_1 = require("./join.js");
|
|
5
7
|
Object.defineProperty(exports, "join", { enumerable: true, get: function () { return join_js_1.join; } });
|
|
6
8
|
var qs_js_1 = require("./qs.js");
|
|
@@ -18,7 +18,7 @@ function join(base, ...segments) {
|
|
|
18
18
|
return joinPath(base, ...segments);
|
|
19
19
|
}
|
|
20
20
|
const lastSegment = segments[segments.length - 1];
|
|
21
|
-
const shouldPreserveTrailingSlash = lastSegment
|
|
21
|
+
const shouldPreserveTrailingSlash = lastSegment === null || lastSegment === void 0 ? void 0 : lastSegment.endsWith("/");
|
|
22
22
|
for (const segment of segments) {
|
|
23
23
|
const cleanSegment = trimSlashes(segment);
|
|
24
24
|
if (cleanSegment) {
|
|
@@ -38,7 +38,7 @@ function joinPath(base, ...segments) {
|
|
|
38
38
|
}
|
|
39
39
|
let result = base;
|
|
40
40
|
const lastSegment = segments[segments.length - 1];
|
|
41
|
-
const shouldPreserveTrailingSlash = lastSegment
|
|
41
|
+
const shouldPreserveTrailingSlash = lastSegment === null || lastSegment === void 0 ? void 0 : lastSegment.endsWith("/");
|
|
42
42
|
for (const segment of segments) {
|
|
43
43
|
const cleanSegment = trimSlashes(segment);
|
|
44
44
|
if (cleanSegment) {
|
|
@@ -54,7 +54,7 @@ function joinPathSegments(left, right) {
|
|
|
54
54
|
if (left.endsWith("/")) {
|
|
55
55
|
return left + right;
|
|
56
56
|
}
|
|
57
|
-
return left
|
|
57
|
+
return `${left}/${right}`;
|
|
58
58
|
}
|
|
59
59
|
function trimSlashes(str) {
|
|
60
60
|
if (!str)
|
package/dist/cjs/environments.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
-
*/
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
5
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
4
|
exports.CredalEnvironment = void 0;
|
|
7
5
|
exports.CredalEnvironment = {
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
-
*/
|
|
4
|
-
import * as core from "../core/index.js";
|
|
1
|
+
import type * as core from "../core/index.js";
|
|
5
2
|
export declare class CredalError extends Error {
|
|
6
3
|
readonly statusCode?: number;
|
|
7
4
|
readonly body?: unknown;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
-
*/
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
5
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
4
|
exports.CredalError = void 0;
|
|
7
5
|
const json_js_1 = require("../core/json.js");
|
|
@@ -16,7 +14,7 @@ class CredalError extends Error {
|
|
|
16
14
|
}
|
|
17
15
|
exports.CredalError = CredalError;
|
|
18
16
|
function buildMessage({ message, statusCode, body, }) {
|
|
19
|
-
|
|
17
|
+
const lines = [];
|
|
20
18
|
if (message != null) {
|
|
21
19
|
lines.push(message);
|
|
22
20
|
}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
-
*/
|
|
2
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
5
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
4
|
exports.CredalTimeoutError = void 0;
|
|
7
5
|
class CredalTimeoutError extends Error {
|