@credal/sdk 0.0.23 → 0.0.25
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/Client.d.ts +10 -9
- package/Client.js +12 -17
- package/api/resources/common/types/Operator.d.ts +1 -1
- package/api/resources/common/types/ResourceIdentifier.d.ts +1 -1
- package/api/resources/common/types/ResourceType.d.ts +1 -1
- package/api/resources/common/types/Role.d.ts +1 -1
- package/api/resources/copilots/client/Client.d.ts +4 -0
- package/api/resources/copilots/client/Client.js +55 -117
- package/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +2 -8
- package/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +2 -8
- package/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +3 -12
- package/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +4 -16
- package/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +2 -8
- package/api/resources/copilots/client/requests/SendMessageRequest.d.ts +5 -20
- package/api/resources/copilots/client/requests/StreamMessageRequest.d.ts +19 -20
- package/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +1 -4
- package/api/resources/copilots/types/ErrorChunk.d.ts +7 -0
- package/{dist/api/resources/actions/types/DirectMessage.d.ts → api/resources/copilots/types/ErrorChunkData.d.ts} +2 -2
- package/api/resources/copilots/types/FeedbackEnum.d.ts +1 -1
- package/api/resources/copilots/types/Filter.d.ts +1 -1
- package/api/resources/copilots/types/SendMessageResponse.d.ts +3 -5
- package/api/resources/copilots/types/StreamingChunk.d.ts +4 -1
- package/api/resources/copilots/types/index.d.ts +2 -0
- package/api/resources/copilots/types/index.js +2 -0
- package/api/resources/documentCatalog/client/Client.d.ts +4 -0
- package/api/resources/documentCatalog/client/Client.js +31 -45
- package/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +10 -40
- package/api/resources/documentCollections/client/Client.d.ts +4 -0
- package/api/resources/documentCollections/client/Client.js +43 -81
- package/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -4
- package/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +3 -12
- package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +1 -4
- package/api/resources/index.d.ts +0 -3
- package/api/resources/index.js +18 -11
- package/api/resources/permissionsService/client/Client.d.ts +4 -0
- package/api/resources/permissionsService/client/Client.js +31 -45
- package/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +3 -12
- package/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +3 -12
- package/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.ts +4 -16
- package/api/resources/permissionsService/types/Action.d.ts +1 -1
- package/api/resources/permissionsService/types/AuthorizedResourceListPage.d.ts +1 -1
- package/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.ts +1 -1
- package/api/resources/permissionsService/types/Principal.d.ts +1 -1
- package/api/resources/search/client/Client.d.ts +4 -0
- package/api/resources/search/client/Client.js +23 -21
- package/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +3 -12
- package/api/resources/users/client/Client.d.ts +4 -0
- package/api/resources/users/client/Client.js +23 -21
- package/core/auth/BearerToken.d.ts +1 -1
- package/core/fetcher/APIResponse.d.ts +1 -1
- package/core/fetcher/Fetcher.d.ts +2 -2
- package/core/fetcher/Fetcher.js +6 -5
- package/core/fetcher/Supplier.d.ts +1 -1
- package/core/fetcher/createRequestUrl.d.ts +1 -1
- package/core/fetcher/createRequestUrl.js +1 -2
- package/core/fetcher/getFetchFn.js +18 -9
- package/core/fetcher/getHeader.js +1 -2
- package/core/fetcher/getRequestBody.js +5 -5
- package/core/fetcher/getResponseBody.js +1 -2
- package/core/fetcher/makeRequest.d.ts +1 -1
- package/core/fetcher/requestWithRetries.js +4 -5
- package/core/fetcher/signals.d.ts +0 -1
- package/core/fetcher/signals.js +2 -3
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
- package/core/index.js +17 -7
- package/core/json.d.ts +15 -0
- package/core/json.js +24 -0
- package/core/runtime/runtime.d.ts +1 -1
- package/core/runtime/runtime.js +51 -41
- package/core/schemas/Schema.d.ts +7 -5
- package/core/schemas/Schema.js +2 -0
- package/core/schemas/builders/bigint/bigint.d.ts +1 -1
- package/core/schemas/builders/bigint/bigint.js +22 -19
- package/core/schemas/builders/date/date.js +1 -2
- package/core/schemas/builders/enum/enum.js +1 -2
- package/core/schemas/builders/lazy/lazy.d.ts +1 -1
- package/core/schemas/builders/lazy/lazy.js +3 -4
- package/core/schemas/builders/lazy/lazyObject.js +1 -2
- package/core/schemas/builders/list/list.js +1 -2
- package/core/schemas/builders/literals/booleanLiteral.js +1 -2
- package/core/schemas/builders/literals/stringLiteral.js +1 -2
- package/core/schemas/builders/object/object.d.ts +1 -1
- package/core/schemas/builders/object/object.js +31 -3
- package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
- package/core/schemas/builders/object/property.js +2 -3
- package/core/schemas/builders/object/types.d.ts +16 -11
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
- package/core/schemas/builders/object-like/types.d.ts +1 -1
- package/core/schemas/builders/record/record.js +2 -4
- package/core/schemas/builders/record/types.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +67 -4
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/core/schemas/builders/set/set.js +1 -2
- package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
- package/core/schemas/builders/union/discriminant.js +1 -2
- package/core/schemas/builders/union/types.d.ts +6 -6
- package/core/schemas/builders/union/union.d.ts +1 -1
- package/core/schemas/builders/union/union.js +1 -2
- package/core/schemas/utils/MaybePromise.d.ts +1 -1
- package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +4 -4
- package/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
- package/core/schemas/utils/entries.d.ts +1 -1
- package/core/schemas/utils/entries.js +1 -2
- package/core/schemas/utils/filterObject.d.ts +1 -1
- package/core/schemas/utils/filterObject.js +1 -2
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
- package/core/schemas/utils/isPlainObject.js +1 -2
- package/core/schemas/utils/keys.d.ts +1 -1
- package/core/schemas/utils/keys.js +1 -2
- package/core/schemas/utils/maybeSkipValidation.js +1 -2
- package/core/schemas/utils/partition.js +1 -2
- package/core/streaming-fetcher/Stream.d.ts +0 -1
- package/core/streaming-fetcher/Stream.js +20 -21
- package/dist/Client.d.ts +10 -9
- package/dist/Client.js +12 -17
- package/dist/api/resources/common/types/Operator.d.ts +1 -1
- package/dist/api/resources/common/types/ResourceIdentifier.d.ts +1 -1
- package/dist/api/resources/common/types/ResourceType.d.ts +1 -1
- package/dist/api/resources/common/types/Role.d.ts +1 -1
- package/dist/api/resources/copilots/client/Client.d.ts +4 -0
- package/dist/api/resources/copilots/client/Client.js +55 -117
- package/dist/api/resources/copilots/client/requests/AddCollectionToCopilotRequest.d.ts +2 -8
- package/dist/api/resources/copilots/client/requests/CreateConversationRequest.d.ts +2 -8
- package/dist/api/resources/copilots/client/requests/CreateCopilotRequest.d.ts +3 -12
- package/dist/api/resources/copilots/client/requests/ProvideMessageFeedbackRequest.d.ts +4 -16
- package/dist/api/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.d.ts +2 -8
- package/dist/api/resources/copilots/client/requests/SendMessageRequest.d.ts +5 -20
- package/dist/api/resources/copilots/client/requests/StreamMessageRequest.d.ts +19 -20
- package/dist/api/resources/copilots/client/requests/UpdateConfigurationRequest.d.ts +1 -4
- package/dist/api/resources/copilots/types/ErrorChunk.d.ts +7 -0
- package/{api/resources/actions/types/DirectMessage.d.ts → dist/api/resources/copilots/types/ErrorChunkData.d.ts} +2 -2
- package/dist/api/resources/copilots/types/FeedbackEnum.d.ts +1 -1
- package/dist/api/resources/copilots/types/Filter.d.ts +1 -1
- package/dist/api/resources/copilots/types/SendMessageResponse.d.ts +3 -5
- package/dist/api/resources/copilots/types/StreamingChunk.d.ts +4 -1
- package/dist/api/resources/copilots/types/index.d.ts +2 -0
- package/dist/api/resources/copilots/types/index.js +2 -0
- package/dist/api/resources/documentCatalog/client/Client.d.ts +4 -0
- package/dist/api/resources/documentCatalog/client/Client.js +31 -45
- package/dist/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts +10 -40
- package/dist/api/resources/documentCollections/client/Client.d.ts +4 -0
- package/dist/api/resources/documentCollections/client/Client.js +43 -81
- package/dist/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts +1 -4
- package/dist/api/resources/documentCollections/client/requests/CreateCollectionRequest.d.ts +3 -12
- package/dist/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts +1 -4
- package/dist/api/resources/index.d.ts +0 -3
- package/dist/api/resources/index.js +18 -11
- package/dist/api/resources/permissionsService/client/Client.d.ts +4 -0
- package/dist/api/resources/permissionsService/client/Client.js +31 -45
- package/dist/api/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.d.ts +3 -12
- package/dist/api/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.d.ts +3 -12
- package/dist/api/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.d.ts +4 -16
- package/dist/api/resources/permissionsService/types/Action.d.ts +1 -1
- package/dist/api/resources/permissionsService/types/AuthorizedResourceListPage.d.ts +1 -1
- package/dist/api/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.d.ts +1 -1
- package/dist/api/resources/permissionsService/types/Principal.d.ts +1 -1
- package/dist/api/resources/search/client/Client.d.ts +4 -0
- package/dist/api/resources/search/client/Client.js +23 -21
- package/dist/api/resources/search/client/requests/SearchDocumentCollectionRequest.d.ts +3 -12
- package/dist/api/resources/users/client/Client.d.ts +4 -0
- package/dist/api/resources/users/client/Client.js +23 -21
- package/dist/core/auth/BearerToken.d.ts +1 -1
- package/dist/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.d.ts +2 -2
- package/dist/core/fetcher/Fetcher.js +6 -5
- package/dist/core/fetcher/Supplier.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.js +1 -2
- package/dist/core/fetcher/getFetchFn.js +18 -9
- package/dist/core/fetcher/getHeader.js +1 -2
- package/dist/core/fetcher/getRequestBody.js +5 -5
- package/dist/core/fetcher/getResponseBody.js +1 -2
- package/dist/core/fetcher/makeRequest.d.ts +1 -1
- package/dist/core/fetcher/requestWithRetries.js +4 -5
- package/dist/core/fetcher/signals.d.ts +0 -1
- package/dist/core/fetcher/signals.js +2 -3
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +0 -1
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +6 -4
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +1 -1
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +1 -1
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +18 -9
- package/dist/core/index.js +17 -7
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +24 -0
- package/dist/core/runtime/runtime.d.ts +1 -1
- package/dist/core/runtime/runtime.js +51 -41
- package/dist/core/schemas/Schema.d.ts +7 -5
- package/dist/core/schemas/Schema.js +2 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +1 -1
- package/dist/core/schemas/builders/bigint/bigint.js +22 -19
- package/dist/core/schemas/builders/date/date.js +1 -2
- package/dist/core/schemas/builders/enum/enum.js +1 -2
- package/dist/core/schemas/builders/lazy/lazy.d.ts +1 -1
- package/dist/core/schemas/builders/lazy/lazy.js +3 -4
- package/dist/core/schemas/builders/lazy/lazyObject.js +1 -2
- package/dist/core/schemas/builders/list/list.js +1 -2
- package/dist/core/schemas/builders/literals/booleanLiteral.js +1 -2
- package/dist/core/schemas/builders/literals/stringLiteral.js +1 -2
- package/dist/core/schemas/builders/object/object.d.ts +1 -1
- package/dist/core/schemas/builders/object/object.js +31 -3
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +3 -3
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +1 -2
- package/dist/core/schemas/builders/object/property.js +2 -3
- package/dist/core/schemas/builders/object/types.d.ts +16 -11
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +2 -3
- package/dist/core/schemas/builders/object-like/types.d.ts +1 -1
- package/dist/core/schemas/builders/record/record.js +2 -4
- package/dist/core/schemas/builders/record/types.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +4 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +67 -4
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/dist/core/schemas/builders/set/set.js +1 -2
- package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +1 -2
- package/dist/core/schemas/builders/union/discriminant.js +1 -2
- package/dist/core/schemas/builders/union/types.d.ts +6 -6
- package/dist/core/schemas/builders/union/union.d.ts +1 -1
- package/dist/core/schemas/builders/union/union.js +1 -2
- package/dist/core/schemas/utils/MaybePromise.d.ts +1 -1
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +4 -4
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +1 -2
- package/dist/core/schemas/utils/entries.d.ts +1 -1
- package/dist/core/schemas/utils/entries.js +1 -2
- package/dist/core/schemas/utils/filterObject.d.ts +1 -1
- package/dist/core/schemas/utils/filterObject.js +1 -2
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +1 -2
- package/dist/core/schemas/utils/isPlainObject.js +1 -2
- package/dist/core/schemas/utils/keys.d.ts +1 -1
- package/dist/core/schemas/utils/keys.js +1 -2
- package/dist/core/schemas/utils/maybeSkipValidation.js +1 -2
- package/dist/core/schemas/utils/partition.js +1 -2
- package/dist/core/streaming-fetcher/Stream.d.ts +0 -1
- package/dist/core/streaming-fetcher/Stream.js +20 -21
- package/dist/environments.d.ts +1 -1
- package/dist/errors/CredalError.js +2 -1
- package/dist/errors/CredalTimeoutError.d.ts +1 -1
- package/dist/errors/CredalTimeoutError.js +2 -2
- package/dist/index.d.ts +1 -0
- package/dist/index.js +19 -8
- package/dist/serialization/resources/common/types/Collaborator.js +17 -7
- package/dist/serialization/resources/common/types/ExternalResourceId.js +17 -7
- package/dist/serialization/resources/common/types/Operator.js +17 -7
- package/dist/serialization/resources/common/types/ResourceIdentifier.js +17 -7
- package/dist/serialization/resources/common/types/ResourceType.js +17 -7
- package/dist/serialization/resources/common/types/Role.js +17 -7
- package/dist/serialization/resources/common/types/Url.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/CreateConversationRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/ProvideMessageFeedbackRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/SendMessageRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/StreamMessageRequest.js +17 -7
- package/dist/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +17 -7
- package/dist/serialization/resources/copilots/types/AiEndpointConfiguration.js +17 -7
- package/dist/serialization/resources/copilots/types/BlockedChunk.js +17 -7
- package/dist/serialization/resources/copilots/types/BooleanFieldSchema.js +17 -7
- package/dist/serialization/resources/copilots/types/CollectionFilteredData.js +17 -7
- package/dist/serialization/resources/copilots/types/Configuration.js +17 -7
- package/dist/serialization/resources/copilots/types/CreateConversationResponse.js +17 -7
- package/dist/serialization/resources/copilots/types/CreateCopilotResponse.js +17 -7
- package/dist/serialization/resources/copilots/types/DataChunk.js +17 -7
- package/dist/serialization/resources/copilots/types/DataFilter.js +17 -7
- package/dist/serialization/resources/copilots/types/DatetimeFieldSchema.js +17 -7
- package/dist/serialization/resources/copilots/types/DeleteCopilotResponse.js +17 -7
- package/dist/serialization/resources/copilots/types/EndOfMessageChunk.js +17 -7
- package/dist/serialization/resources/{actions/types/SlackThread.d.ts → copilots/types/ErrorChunk.d.ts} +4 -4
- package/dist/serialization/resources/{actions/types/HumanConfirmationChannel.js → copilots/types/ErrorChunk.js} +21 -20
- package/dist/serialization/resources/{actions/types/DirectMessage.d.ts → copilots/types/ErrorChunkData.d.ts} +3 -3
- package/dist/serialization/resources/{actions/types/InvokeActionResponse.js → copilots/types/ErrorChunkData.js} +20 -12
- package/dist/serialization/resources/copilots/types/FeedbackEnum.js +17 -7
- package/dist/serialization/resources/copilots/types/Filter.js +17 -7
- package/dist/serialization/resources/copilots/types/FinalChunk.js +17 -7
- package/dist/serialization/resources/copilots/types/InitialChunk.js +17 -7
- package/dist/serialization/resources/copilots/types/InputVariable.js +17 -7
- package/dist/serialization/resources/copilots/types/InsertedAuditLog.js +17 -7
- package/dist/serialization/resources/copilots/types/MessageBlocked.js +17 -7
- package/dist/serialization/resources/copilots/types/MessageFeedback.js +17 -7
- package/dist/serialization/resources/copilots/types/MessageReply.js +17 -7
- package/dist/serialization/resources/copilots/types/NumberFieldSchema.js +17 -7
- package/dist/serialization/resources/copilots/types/PolicyTrigger.js +17 -7
- package/dist/serialization/resources/copilots/types/ReferencedSource.js +17 -7
- package/dist/serialization/resources/copilots/types/ResponseChunk.js +17 -7
- package/dist/serialization/resources/copilots/types/SendAgentMessageResponse.js +17 -7
- package/dist/serialization/resources/copilots/types/SendMessageResponse.js +17 -7
- package/dist/serialization/resources/copilots/types/StreamingChunk.d.ts +5 -1
- package/dist/serialization/resources/copilots/types/StreamingChunk.js +19 -7
- package/dist/serialization/resources/copilots/types/StringFieldSchema.js +17 -7
- package/dist/serialization/resources/copilots/types/WebSearchResult.js +17 -7
- package/dist/serialization/resources/copilots/types/index.d.ts +2 -0
- package/dist/serialization/resources/copilots/types/index.js +2 -0
- package/dist/serialization/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.js +17 -7
- package/dist/serialization/resources/documentCatalog/types/DocumentMetadataPatch.js +17 -7
- package/dist/serialization/resources/documentCatalog/types/DocumentMetadataPatchRequest.js +17 -7
- package/dist/serialization/resources/documentCatalog/types/SyncSourceByUrlRequest.js +17 -7
- package/dist/serialization/resources/documentCatalog/types/SyncSourceByUrlResponse.js +17 -7
- package/dist/serialization/resources/documentCatalog/types/UploadDocumentResponse.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +17 -7
- package/dist/serialization/resources/documentCollections/types/CreateCollectionResponse.js +17 -7
- package/dist/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +17 -7
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +17 -7
- package/dist/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +17 -7
- package/dist/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +17 -7
- package/dist/serialization/resources/index.d.ts +0 -3
- package/dist/serialization/resources/index.js +18 -11
- package/dist/serialization/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.js +17 -7
- package/dist/serialization/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.js +17 -7
- package/dist/serialization/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.js +17 -7
- package/dist/serialization/resources/permissionsService/types/Action.js +17 -7
- package/dist/serialization/resources/permissionsService/types/AuthorizedResource.js +17 -7
- package/dist/serialization/resources/permissionsService/types/AuthorizedResourceListPage.js +17 -7
- package/dist/serialization/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.js +17 -7
- package/dist/serialization/resources/permissionsService/types/CheckResourceAuthorizationResponse.js +17 -7
- package/dist/serialization/resources/permissionsService/types/Group.js +17 -7
- package/dist/serialization/resources/permissionsService/types/Principal.js +17 -7
- package/dist/serialization/resources/permissionsService/types/PrincipalListPage.js +17 -7
- package/dist/serialization/resources/permissionsService/types/ResourceAuthorizationResult.js +17 -7
- package/dist/serialization/resources/permissionsService/types/User.js +17 -7
- package/dist/serialization/resources/search/client/requests/SearchDocumentCollectionRequest.js +17 -7
- package/dist/serialization/resources/search/types/DocumentCollectionSearchOptions.js +17 -7
- package/dist/serialization/resources/search/types/DocumentCollectionSearchResult.js +17 -7
- package/dist/serialization/resources/search/types/SearchDocumentCollectionResponse.js +17 -7
- package/dist/serialization/resources/search/types/SearchResultChunk.js +17 -7
- package/dist/serialization/resources/search/types/SingleFieldFilter.js +17 -7
- package/dist/serialization/resources/users/client/index.js +17 -7
- package/dist/serialization/resources/users/client/metadata.js +17 -7
- package/dist/serialization/resources/users/types/UserMetadataPatch.js +17 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/environments.d.ts +1 -1
- package/errors/CredalError.js +2 -1
- package/errors/CredalTimeoutError.d.ts +1 -1
- package/errors/CredalTimeoutError.js +2 -2
- package/index.d.ts +1 -0
- package/index.js +19 -8
- package/{jest.config.js → jest.config.mjs} +4 -1
- package/package.json +16 -17
- package/reference.md +0 -79
- package/scripts/rename-to-esm-files.js +115 -0
- package/serialization/resources/common/types/Collaborator.js +17 -7
- package/serialization/resources/common/types/ExternalResourceId.js +17 -7
- package/serialization/resources/common/types/Operator.js +17 -7
- package/serialization/resources/common/types/ResourceIdentifier.js +17 -7
- package/serialization/resources/common/types/ResourceType.js +17 -7
- package/serialization/resources/common/types/Role.js +17 -7
- package/serialization/resources/common/types/Url.js +17 -7
- package/serialization/resources/copilots/client/requests/AddCollectionToCopilotRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/CreateConversationRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/CreateCopilotRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/DeleteCopilotRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/ProvideMessageFeedbackRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/RemoveCollectionFromCopilotRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/SendMessageRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/StreamMessageRequest.js +17 -7
- package/serialization/resources/copilots/client/requests/UpdateConfigurationRequest.js +17 -7
- package/serialization/resources/copilots/types/AiEndpointConfiguration.js +17 -7
- package/serialization/resources/copilots/types/BlockedChunk.js +17 -7
- package/serialization/resources/copilots/types/BooleanFieldSchema.js +17 -7
- package/serialization/resources/copilots/types/CollectionFilteredData.js +17 -7
- package/serialization/resources/copilots/types/Configuration.js +17 -7
- package/serialization/resources/copilots/types/CreateConversationResponse.js +17 -7
- package/serialization/resources/copilots/types/CreateCopilotResponse.js +17 -7
- package/serialization/resources/copilots/types/DataChunk.js +17 -7
- package/serialization/resources/copilots/types/DataFilter.js +17 -7
- package/serialization/resources/copilots/types/DatetimeFieldSchema.js +17 -7
- package/serialization/resources/copilots/types/DeleteCopilotResponse.js +17 -7
- package/serialization/resources/copilots/types/EndOfMessageChunk.js +17 -7
- package/serialization/resources/{actions/types/Conversation.d.ts → copilots/types/ErrorChunk.d.ts} +4 -3
- package/{dist/serialization/resources/actions/types/Conversation.js → serialization/resources/copilots/types/ErrorChunk.js} +21 -10
- package/{dist/serialization/resources/actions/types/Conversation.d.ts → serialization/resources/copilots/types/ErrorChunkData.d.ts} +3 -3
- package/{dist/serialization/resources/actions/types/SlackThread.js → serialization/resources/copilots/types/ErrorChunkData.js} +20 -11
- package/serialization/resources/copilots/types/FeedbackEnum.js +17 -7
- package/serialization/resources/copilots/types/Filter.js +17 -7
- package/serialization/resources/copilots/types/FinalChunk.js +17 -7
- package/serialization/resources/copilots/types/InitialChunk.js +17 -7
- package/serialization/resources/copilots/types/InputVariable.js +17 -7
- package/serialization/resources/copilots/types/InsertedAuditLog.js +17 -7
- package/serialization/resources/copilots/types/MessageBlocked.js +17 -7
- package/serialization/resources/copilots/types/MessageFeedback.js +17 -7
- package/serialization/resources/copilots/types/MessageReply.js +17 -7
- package/serialization/resources/copilots/types/NumberFieldSchema.js +17 -7
- package/serialization/resources/copilots/types/PolicyTrigger.js +17 -7
- package/serialization/resources/copilots/types/ReferencedSource.js +17 -7
- package/serialization/resources/copilots/types/ResponseChunk.js +17 -7
- package/serialization/resources/copilots/types/SendAgentMessageResponse.js +17 -7
- package/serialization/resources/copilots/types/SendMessageResponse.js +17 -7
- package/serialization/resources/copilots/types/StreamingChunk.d.ts +5 -1
- package/serialization/resources/copilots/types/StreamingChunk.js +19 -7
- package/serialization/resources/copilots/types/StringFieldSchema.js +17 -7
- package/serialization/resources/copilots/types/WebSearchResult.js +17 -7
- package/serialization/resources/copilots/types/index.d.ts +2 -0
- package/serialization/resources/copilots/types/index.js +2 -0
- package/serialization/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.js +17 -7
- package/serialization/resources/documentCatalog/types/DocumentMetadataPatch.js +17 -7
- package/serialization/resources/documentCatalog/types/DocumentMetadataPatchRequest.js +17 -7
- package/serialization/resources/documentCatalog/types/SyncSourceByUrlRequest.js +17 -7
- package/serialization/resources/documentCatalog/types/SyncSourceByUrlResponse.js +17 -7
- package/serialization/resources/documentCatalog/types/UploadDocumentResponse.js +17 -7
- package/serialization/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.js +17 -7
- package/serialization/resources/documentCollections/client/requests/CreateCollectionRequest.js +17 -7
- package/serialization/resources/documentCollections/client/requests/CreateMongoCollectionSyncRequest.js +17 -7
- package/serialization/resources/documentCollections/client/requests/DeleteCollectionRequest.js +17 -7
- package/serialization/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.js +17 -7
- package/serialization/resources/documentCollections/client/requests/UpdateMongoCollectionSyncRequest.js +17 -7
- package/serialization/resources/documentCollections/types/CreateCollectionResponse.js +17 -7
- package/serialization/resources/documentCollections/types/DeleteCollectionResponse.js +17 -7
- package/serialization/resources/documentCollections/types/MongoCollectionSyncConfig.js +17 -7
- package/serialization/resources/documentCollections/types/MongoCollectionSyncResponse.js +17 -7
- package/serialization/resources/documentCollections/types/MongoSourceFieldsConfig.js +17 -7
- package/serialization/resources/index.d.ts +0 -3
- package/serialization/resources/index.js +18 -11
- package/serialization/resources/permissionsService/client/requests/CheckBulkResourcesAuthorizationForUserRequest.js +17 -7
- package/serialization/resources/permissionsService/client/requests/CheckResourceAuthorizationForUserRequest.js +17 -7
- package/serialization/resources/permissionsService/client/requests/ListCachedAuthorizedResourcesForUserRequest.js +17 -7
- package/serialization/resources/permissionsService/types/Action.js +17 -7
- package/serialization/resources/permissionsService/types/AuthorizedResource.js +17 -7
- package/serialization/resources/permissionsService/types/AuthorizedResourceListPage.js +17 -7
- package/serialization/resources/permissionsService/types/CheckBulkResourcesAuthorizationResponse.js +17 -7
- package/serialization/resources/permissionsService/types/CheckResourceAuthorizationResponse.js +17 -7
- package/serialization/resources/permissionsService/types/Group.js +17 -7
- package/serialization/resources/permissionsService/types/Principal.js +17 -7
- package/serialization/resources/permissionsService/types/PrincipalListPage.js +17 -7
- package/serialization/resources/permissionsService/types/ResourceAuthorizationResult.js +17 -7
- package/serialization/resources/permissionsService/types/User.js +17 -7
- package/serialization/resources/search/client/requests/SearchDocumentCollectionRequest.js +17 -7
- package/serialization/resources/search/types/DocumentCollectionSearchOptions.js +17 -7
- package/serialization/resources/search/types/DocumentCollectionSearchResult.js +17 -7
- package/serialization/resources/search/types/SearchDocumentCollectionResponse.js +17 -7
- package/serialization/resources/search/types/SearchResultChunk.js +17 -7
- package/serialization/resources/search/types/SingleFieldFilter.js +17 -7
- package/serialization/resources/users/client/index.js +17 -7
- package/serialization/resources/users/client/metadata.js +17 -7
- package/serialization/resources/users/types/UserMetadataPatch.js +17 -7
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/api/resources/actions/client/Client.d.ts +0 -50
- package/api/resources/actions/client/Client.js +0 -138
- package/api/resources/actions/client/index.d.ts +0 -1
- package/api/resources/actions/client/index.js +0 -17
- package/api/resources/actions/client/requests/InvokeActionRequest.d.ts +0 -55
- package/api/resources/actions/client/requests/index.d.ts +0 -1
- package/api/resources/actions/client/requests/index.js +0 -2
- package/api/resources/actions/index.d.ts +0 -2
- package/api/resources/actions/index.js +0 -18
- package/api/resources/actions/types/ActionStatus.d.ts +0 -13
- package/api/resources/actions/types/ActionStatus.js +0 -15
- package/api/resources/actions/types/Conversation.d.ts +0 -6
- package/api/resources/actions/types/HumanConfirmationChannel.d.ts +0 -16
- package/api/resources/actions/types/InvokeActionResponse.d.ts +0 -8
- package/api/resources/actions/types/InvokeActionResponse.js +0 -5
- package/api/resources/actions/types/SlackThread.d.ts +0 -7
- package/api/resources/actions/types/SlackThread.js +0 -5
- package/api/resources/actions/types/index.d.ts +0 -6
- package/api/resources/actions/types/index.js +0 -22
- package/dist/api/resources/actions/client/Client.d.ts +0 -50
- package/dist/api/resources/actions/client/Client.js +0 -138
- package/dist/api/resources/actions/client/index.d.ts +0 -1
- package/dist/api/resources/actions/client/index.js +0 -17
- package/dist/api/resources/actions/client/requests/InvokeActionRequest.d.ts +0 -55
- package/dist/api/resources/actions/client/requests/InvokeActionRequest.js +0 -5
- package/dist/api/resources/actions/client/requests/index.d.ts +0 -1
- package/dist/api/resources/actions/client/requests/index.js +0 -2
- package/dist/api/resources/actions/index.d.ts +0 -2
- package/dist/api/resources/actions/index.js +0 -18
- package/dist/api/resources/actions/types/ActionStatus.d.ts +0 -13
- package/dist/api/resources/actions/types/ActionStatus.js +0 -15
- package/dist/api/resources/actions/types/Conversation.d.ts +0 -6
- package/dist/api/resources/actions/types/Conversation.js +0 -5
- package/dist/api/resources/actions/types/DirectMessage.js +0 -5
- package/dist/api/resources/actions/types/HumanConfirmationChannel.d.ts +0 -16
- package/dist/api/resources/actions/types/HumanConfirmationChannel.js +0 -5
- package/dist/api/resources/actions/types/InvokeActionResponse.d.ts +0 -8
- package/dist/api/resources/actions/types/InvokeActionResponse.js +0 -5
- package/dist/api/resources/actions/types/SlackThread.d.ts +0 -7
- package/dist/api/resources/actions/types/SlackThread.js +0 -5
- package/dist/api/resources/actions/types/index.d.ts +0 -6
- package/dist/api/resources/actions/types/index.js +0 -22
- package/dist/serialization/resources/actions/client/index.d.ts +0 -1
- package/dist/serialization/resources/actions/client/index.js +0 -17
- package/dist/serialization/resources/actions/client/requests/InvokeActionRequest.d.ts +0 -19
- package/dist/serialization/resources/actions/client/requests/InvokeActionRequest.js +0 -40
- package/dist/serialization/resources/actions/client/requests/index.d.ts +0 -1
- package/dist/serialization/resources/actions/client/requests/index.js +0 -5
- package/dist/serialization/resources/actions/index.d.ts +0 -2
- package/dist/serialization/resources/actions/index.js +0 -18
- package/dist/serialization/resources/actions/types/ActionStatus.d.ts +0 -10
- package/dist/serialization/resources/actions/types/ActionStatus.js +0 -39
- package/dist/serialization/resources/actions/types/DirectMessage.js +0 -33
- package/dist/serialization/resources/actions/types/HumanConfirmationChannel.d.ts +0 -22
- package/dist/serialization/resources/actions/types/InvokeActionResponse.d.ts +0 -14
- package/dist/serialization/resources/actions/types/index.d.ts +0 -6
- package/dist/serialization/resources/actions/types/index.js +0 -22
- package/serialization/resources/actions/client/index.d.ts +0 -1
- package/serialization/resources/actions/client/index.js +0 -17
- package/serialization/resources/actions/client/requests/InvokeActionRequest.d.ts +0 -19
- package/serialization/resources/actions/client/requests/InvokeActionRequest.js +0 -40
- package/serialization/resources/actions/client/requests/index.d.ts +0 -1
- package/serialization/resources/actions/client/requests/index.js +0 -5
- package/serialization/resources/actions/index.d.ts +0 -2
- package/serialization/resources/actions/index.js +0 -18
- package/serialization/resources/actions/types/ActionStatus.d.ts +0 -10
- package/serialization/resources/actions/types/ActionStatus.js +0 -39
- package/serialization/resources/actions/types/Conversation.js +0 -33
- package/serialization/resources/actions/types/DirectMessage.d.ts +0 -12
- package/serialization/resources/actions/types/DirectMessage.js +0 -33
- package/serialization/resources/actions/types/HumanConfirmationChannel.d.ts +0 -22
- package/serialization/resources/actions/types/HumanConfirmationChannel.js +0 -43
- package/serialization/resources/actions/types/InvokeActionResponse.d.ts +0 -14
- package/serialization/resources/actions/types/InvokeActionResponse.js +0 -35
- package/serialization/resources/actions/types/SlackThread.d.ts +0 -13
- package/serialization/resources/actions/types/SlackThread.js +0 -34
- package/serialization/resources/actions/types/index.d.ts +0 -6
- package/serialization/resources/actions/types/index.js +0 -22
- /package/api/resources/{actions/client/requests/InvokeActionRequest.js → copilots/types/ErrorChunk.js} +0 -0
- /package/api/resources/{actions/types/Conversation.js → copilots/types/ErrorChunkData.js} +0 -0
- /package/{api/resources/actions/types/DirectMessage.js → dist/api/resources/copilots/types/ErrorChunk.js} +0 -0
- /package/{api/resources/actions/types/HumanConfirmationChannel.js → dist/api/resources/copilots/types/ErrorChunkData.js} +0 -0
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Credal from "../../../index";
|
|
5
|
-
export
|
|
5
|
+
export type StreamingChunk = Credal.StreamingChunk.Initial | Credal.StreamingChunk.DataChunk | Credal.StreamingChunk.EndOfMessage | Credal.StreamingChunk.FinalChunk | Credal.StreamingChunk.Blocked | Credal.StreamingChunk.ErrorChunk;
|
|
6
6
|
export declare namespace StreamingChunk {
|
|
7
7
|
interface Initial extends Credal.InitialChunk {
|
|
8
8
|
event: "initial";
|
|
@@ -19,4 +19,7 @@ export declare namespace StreamingChunk {
|
|
|
19
19
|
interface Blocked extends Credal.BlockedChunk {
|
|
20
20
|
event: "blocked";
|
|
21
21
|
}
|
|
22
|
+
interface ErrorChunk extends Credal.ErrorChunk {
|
|
23
|
+
event: "error_chunk";
|
|
24
|
+
}
|
|
22
25
|
}
|
|
@@ -43,4 +43,6 @@ __exportStar(require("./DataChunk"), exports);
|
|
|
43
43
|
__exportStar(require("./FinalChunk"), exports);
|
|
44
44
|
__exportStar(require("./EndOfMessageChunk"), exports);
|
|
45
45
|
__exportStar(require("./BlockedChunk"), exports);
|
|
46
|
+
__exportStar(require("./ErrorChunkData"), exports);
|
|
47
|
+
__exportStar(require("./ErrorChunk"), exports);
|
|
46
48
|
__exportStar(require("./StreamingChunk"), exports);
|
|
@@ -7,6 +7,8 @@ import * as Credal from "../../../index";
|
|
|
7
7
|
export declare namespace DocumentCatalog {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CredalEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
apiKey?: core.Supplier<core.BearerToken | undefined>;
|
|
11
13
|
fetcher?: core.FetchFunction;
|
|
12
14
|
}
|
|
@@ -17,6 +19,8 @@ export declare namespace DocumentCatalog {
|
|
|
17
19
|
maxRetries?: number;
|
|
18
20
|
/** A hook to abort the request. */
|
|
19
21
|
abortSignal?: AbortSignal;
|
|
22
|
+
/** Additional headers to include in the request. */
|
|
23
|
+
headers?: Record<string, string>;
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
export declare class DocumentCatalog {
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -62,20 +72,12 @@ class DocumentCatalog {
|
|
|
62
72
|
* })
|
|
63
73
|
*/
|
|
64
74
|
uploadDocumentContents(request, requestOptions) {
|
|
65
|
-
var _a, _b;
|
|
66
75
|
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
var _a, _b, _c;
|
|
67
77
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
68
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
78
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/catalog/uploadDocumentContents"),
|
|
69
79
|
method: "POST",
|
|
70
|
-
headers: {
|
|
71
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
72
|
-
"X-Fern-Language": "JavaScript",
|
|
73
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
74
|
-
"X-Fern-SDK-Version": "0.0.23",
|
|
75
|
-
"User-Agent": "@credal/sdk/0.0.23",
|
|
76
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
77
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
78
|
-
},
|
|
80
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
79
81
|
contentType: "application/json",
|
|
80
82
|
requestType: "json",
|
|
81
83
|
body: serializers.UploadDocumentContentsRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -104,7 +106,7 @@ class DocumentCatalog {
|
|
|
104
106
|
body: _response.error.rawBody,
|
|
105
107
|
});
|
|
106
108
|
case "timeout":
|
|
107
|
-
throw new errors.CredalTimeoutError();
|
|
109
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/catalog/uploadDocumentContents.");
|
|
108
110
|
case "unknown":
|
|
109
111
|
throw new errors.CredalError({
|
|
110
112
|
message: _response.error.errorMessage,
|
|
@@ -125,20 +127,12 @@ class DocumentCatalog {
|
|
|
125
127
|
* })
|
|
126
128
|
*/
|
|
127
129
|
syncSourceByUrl(request, requestOptions) {
|
|
128
|
-
var _a, _b;
|
|
129
130
|
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
var _a, _b, _c;
|
|
130
132
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
131
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
133
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/catalog/syncSourceByUrl"),
|
|
132
134
|
method: "POST",
|
|
133
|
-
headers: {
|
|
134
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
135
|
-
"X-Fern-Language": "JavaScript",
|
|
136
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
137
|
-
"X-Fern-SDK-Version": "0.0.23",
|
|
138
|
-
"User-Agent": "@credal/sdk/0.0.23",
|
|
139
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
140
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
141
|
-
},
|
|
135
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
142
136
|
contentType: "application/json",
|
|
143
137
|
requestType: "json",
|
|
144
138
|
body: serializers.SyncSourceByUrlRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -167,7 +161,7 @@ class DocumentCatalog {
|
|
|
167
161
|
body: _response.error.rawBody,
|
|
168
162
|
});
|
|
169
163
|
case "timeout":
|
|
170
|
-
throw new errors.CredalTimeoutError();
|
|
164
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/catalog/syncSourceByUrl.");
|
|
171
165
|
case "unknown":
|
|
172
166
|
throw new errors.CredalError({
|
|
173
167
|
message: _response.error.errorMessage,
|
|
@@ -208,20 +202,12 @@ class DocumentCatalog {
|
|
|
208
202
|
* })
|
|
209
203
|
*/
|
|
210
204
|
metadata(request, requestOptions) {
|
|
211
|
-
var _a, _b;
|
|
212
205
|
return __awaiter(this, void 0, void 0, function* () {
|
|
206
|
+
var _a, _b, _c;
|
|
213
207
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
214
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
208
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/catalog/metadata"),
|
|
215
209
|
method: "PATCH",
|
|
216
|
-
headers: {
|
|
217
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
218
|
-
"X-Fern-Language": "JavaScript",
|
|
219
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
220
|
-
"X-Fern-SDK-Version": "0.0.23",
|
|
221
|
-
"User-Agent": "@credal/sdk/0.0.23",
|
|
222
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
223
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
224
|
-
},
|
|
210
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
225
211
|
contentType: "application/json",
|
|
226
212
|
requestType: "json",
|
|
227
213
|
body: serializers.DocumentMetadataPatchRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -245,7 +231,7 @@ class DocumentCatalog {
|
|
|
245
231
|
body: _response.error.rawBody,
|
|
246
232
|
});
|
|
247
233
|
case "timeout":
|
|
248
|
-
throw new errors.CredalTimeoutError();
|
|
234
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling PATCH /v0/catalog/metadata.");
|
|
249
235
|
case "unknown":
|
|
250
236
|
throw new errors.CredalError({
|
|
251
237
|
message: _response.error.errorMessage,
|
|
@@ -254,12 +240,12 @@ class DocumentCatalog {
|
|
|
254
240
|
});
|
|
255
241
|
}
|
|
256
242
|
_getAuthorizationHeader() {
|
|
257
|
-
var _a;
|
|
258
243
|
return __awaiter(this, void 0, void 0, function* () {
|
|
244
|
+
var _a;
|
|
259
245
|
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"];
|
|
260
246
|
if (bearer == null) {
|
|
261
247
|
throw new errors.CredalError({
|
|
262
|
-
message: "Please specify
|
|
248
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a CREDAL_API_KEY environment variable",
|
|
263
249
|
});
|
|
264
250
|
}
|
|
265
251
|
return `Bearer ${bearer}`;
|
package/dist/api/resources/documentCatalog/client/requests/UploadDocumentContentsRequest.d.ts
CHANGED
|
@@ -12,54 +12,24 @@
|
|
|
12
12
|
* }
|
|
13
13
|
*/
|
|
14
14
|
export interface UploadDocumentContentsRequest {
|
|
15
|
-
/**
|
|
16
|
-
* The name of the document you want to upload.
|
|
17
|
-
*
|
|
18
|
-
*/
|
|
15
|
+
/** The name of the document you want to upload. */
|
|
19
16
|
documentName: string;
|
|
20
|
-
/**
|
|
21
|
-
* The full LLM-formatted text contents of the document you want to upload.
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
17
|
+
/** The full LLM-formatted text contents of the document you want to upload. */
|
|
24
18
|
documentContents: string;
|
|
25
|
-
/**
|
|
26
|
-
* Users allowed to access the document. Unlike Credal's out of the box connectors which reconcile various permissions models from 3rd party software, for custom uploads the caller is responsible for specifying who can access the document and currently flattening groups if applicable. Documents can also be marked as internal public.
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
19
|
+
/** Users allowed to access the document. Unlike Credal's out of the box connectors which reconcile various permissions models from 3rd party software, for custom uploads the caller is responsible for specifying who can access the document and currently flattening groups if applicable. Documents can also be marked as internal public. */
|
|
29
20
|
allowedUsersEmailAddresses: string[];
|
|
30
|
-
/**
|
|
31
|
-
* [Legacy] The user on behalf of whom the document should be uploaded. In most cases, this can simply be the email of the developer making the API call. This field will be removed in the future in favor of purely specifying permissions via allowedUsersEmailAddresses.
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
21
|
+
/** [Legacy] The user on behalf of whom the document should be uploaded. In most cases, this can simply be the email of the developer making the API call. This field will be removed in the future in favor of purely specifying permissions via allowedUsersEmailAddresses. */
|
|
34
22
|
uploadAsUserEmail: string;
|
|
35
|
-
/**
|
|
36
|
-
* The external ID of the document. This is typically the ID as it exists in its original external system. Uploads to the same external ID will update the document in Credal.
|
|
37
|
-
*
|
|
38
|
-
*/
|
|
23
|
+
/** The external ID of the document. This is typically the ID as it exists in its original external system. Uploads to the same external ID will update the document in Credal. */
|
|
39
24
|
documentExternalId: string;
|
|
40
|
-
/**
|
|
41
|
-
* The external URL of the document you want to upload. If provided Credal will link to this URL.
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
25
|
+
/** The external URL of the document you want to upload. If provided Credal will link to this URL. */
|
|
44
26
|
documentExternalUrl?: string;
|
|
45
|
-
/**
|
|
46
|
-
* Optional JSON representing any custom metdata for this document
|
|
47
|
-
*
|
|
48
|
-
*/
|
|
27
|
+
/** Optional JSON representing any custom metdata for this document */
|
|
49
28
|
customMetadata?: unknown;
|
|
50
|
-
/**
|
|
51
|
-
* If specified, document will also be added to a particular document collection
|
|
52
|
-
*
|
|
53
|
-
*/
|
|
29
|
+
/** If specified, document will also be added to a particular document collection */
|
|
54
30
|
collectionId?: string;
|
|
55
|
-
/**
|
|
56
|
-
* If specified, document contents will be re-uploaded and re-embedded even if the document already exists in Credal
|
|
57
|
-
*
|
|
58
|
-
*/
|
|
31
|
+
/** If specified, document contents will be re-uploaded and re-embedded even if the document already exists in Credal */
|
|
59
32
|
forceUpdate?: boolean;
|
|
60
|
-
/**
|
|
61
|
-
* If specified, document will be accessible to everyone within the organization of the uploader
|
|
62
|
-
*
|
|
63
|
-
*/
|
|
33
|
+
/** If specified, document will be accessible to everyone within the organization of the uploader */
|
|
64
34
|
internalPublic?: boolean;
|
|
65
35
|
}
|
|
@@ -7,6 +7,8 @@ import * as Credal from "../../../index";
|
|
|
7
7
|
export declare namespace DocumentCollections {
|
|
8
8
|
interface Options {
|
|
9
9
|
environment?: core.Supplier<environments.CredalEnvironment | string>;
|
|
10
|
+
/** Specify a custom URL to connect the client to. */
|
|
11
|
+
baseUrl?: core.Supplier<string>;
|
|
10
12
|
apiKey?: core.Supplier<core.BearerToken | undefined>;
|
|
11
13
|
fetcher?: core.FetchFunction;
|
|
12
14
|
}
|
|
@@ -17,6 +19,8 @@ export declare namespace DocumentCollections {
|
|
|
17
19
|
maxRetries?: number;
|
|
18
20
|
/** A hook to abort the request. */
|
|
19
21
|
abortSignal?: AbortSignal;
|
|
22
|
+
/** Additional headers to include in the request. */
|
|
23
|
+
headers?: Record<string, string>;
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
export declare class DocumentCollections {
|
|
@@ -18,13 +18,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
18
18
|
}) : function(o, v) {
|
|
19
19
|
o["default"] = v;
|
|
20
20
|
});
|
|
21
|
-
var __importStar = (this && this.__importStar) || function (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
28
38
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
39
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
40
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -69,20 +79,12 @@ class DocumentCollections {
|
|
|
69
79
|
* })
|
|
70
80
|
*/
|
|
71
81
|
addDocumentsToCollection(request, requestOptions) {
|
|
72
|
-
var _a, _b;
|
|
73
82
|
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
var _a, _b, _c;
|
|
74
84
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
75
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
85
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/documentCollections/addDocumentsToCollection"),
|
|
76
86
|
method: "POST",
|
|
77
|
-
headers: {
|
|
78
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
79
|
-
"X-Fern-Language": "JavaScript",
|
|
80
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
81
|
-
"X-Fern-SDK-Version": "0.0.23",
|
|
82
|
-
"User-Agent": "@credal/sdk/0.0.23",
|
|
83
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
84
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
85
|
-
},
|
|
87
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
86
88
|
contentType: "application/json",
|
|
87
89
|
requestType: "json",
|
|
88
90
|
body: serializers.AddDocumentsToCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -106,7 +108,7 @@ class DocumentCollections {
|
|
|
106
108
|
body: _response.error.rawBody,
|
|
107
109
|
});
|
|
108
110
|
case "timeout":
|
|
109
|
-
throw new errors.CredalTimeoutError();
|
|
111
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/documentCollections/addDocumentsToCollection.");
|
|
110
112
|
case "unknown":
|
|
111
113
|
throw new errors.CredalError({
|
|
112
114
|
message: _response.error.errorMessage,
|
|
@@ -135,20 +137,12 @@ class DocumentCollections {
|
|
|
135
137
|
* })
|
|
136
138
|
*/
|
|
137
139
|
removeDocumentsFromCollection(request, requestOptions) {
|
|
138
|
-
var _a, _b;
|
|
139
140
|
return __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
var _a, _b, _c;
|
|
140
142
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
141
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
143
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/documentCollections/removeDocumentsFromCollection"),
|
|
142
144
|
method: "DELETE",
|
|
143
|
-
headers: {
|
|
144
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
145
|
-
"X-Fern-Language": "JavaScript",
|
|
146
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
147
|
-
"X-Fern-SDK-Version": "0.0.23",
|
|
148
|
-
"User-Agent": "@credal/sdk/0.0.23",
|
|
149
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
150
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
151
|
-
},
|
|
145
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
152
146
|
contentType: "application/json",
|
|
153
147
|
requestType: "json",
|
|
154
148
|
body: serializers.RemoveDocumentsFromCollectionRequest.jsonOrThrow(request, {
|
|
@@ -174,7 +168,7 @@ class DocumentCollections {
|
|
|
174
168
|
body: _response.error.rawBody,
|
|
175
169
|
});
|
|
176
170
|
case "timeout":
|
|
177
|
-
throw new errors.CredalTimeoutError();
|
|
171
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling DELETE /v0/documentCollections/removeDocumentsFromCollection.");
|
|
178
172
|
case "unknown":
|
|
179
173
|
throw new errors.CredalError({
|
|
180
174
|
message: _response.error.errorMessage,
|
|
@@ -199,20 +193,12 @@ class DocumentCollections {
|
|
|
199
193
|
* })
|
|
200
194
|
*/
|
|
201
195
|
createCollection(request, requestOptions) {
|
|
202
|
-
var _a, _b;
|
|
203
196
|
return __awaiter(this, void 0, void 0, function* () {
|
|
197
|
+
var _a, _b, _c;
|
|
204
198
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
205
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
199
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/documentCollections/createCollection"),
|
|
206
200
|
method: "POST",
|
|
207
|
-
headers: {
|
|
208
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
209
|
-
"X-Fern-Language": "JavaScript",
|
|
210
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
211
|
-
"X-Fern-SDK-Version": "0.0.23",
|
|
212
|
-
"User-Agent": "@credal/sdk/0.0.23",
|
|
213
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
214
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
215
|
-
},
|
|
201
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
216
202
|
contentType: "application/json",
|
|
217
203
|
requestType: "json",
|
|
218
204
|
body: serializers.CreateCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -241,7 +227,7 @@ class DocumentCollections {
|
|
|
241
227
|
body: _response.error.rawBody,
|
|
242
228
|
});
|
|
243
229
|
case "timeout":
|
|
244
|
-
throw new errors.CredalTimeoutError();
|
|
230
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/documentCollections/createCollection.");
|
|
245
231
|
case "unknown":
|
|
246
232
|
throw new errors.CredalError({
|
|
247
233
|
message: _response.error.errorMessage,
|
|
@@ -261,20 +247,12 @@ class DocumentCollections {
|
|
|
261
247
|
* })
|
|
262
248
|
*/
|
|
263
249
|
deleteCollection(request, requestOptions) {
|
|
264
|
-
var _a, _b;
|
|
265
250
|
return __awaiter(this, void 0, void 0, function* () {
|
|
251
|
+
var _a, _b, _c;
|
|
266
252
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
267
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
253
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/documentCollections/deleteCollection"),
|
|
268
254
|
method: "DELETE",
|
|
269
|
-
headers: {
|
|
270
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
271
|
-
"X-Fern-Language": "JavaScript",
|
|
272
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
273
|
-
"X-Fern-SDK-Version": "0.0.23",
|
|
274
|
-
"User-Agent": "@credal/sdk/0.0.23",
|
|
275
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
276
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
277
|
-
},
|
|
255
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
278
256
|
contentType: "application/json",
|
|
279
257
|
requestType: "json",
|
|
280
258
|
body: serializers.DeleteCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -303,7 +281,7 @@ class DocumentCollections {
|
|
|
303
281
|
body: _response.error.rawBody,
|
|
304
282
|
});
|
|
305
283
|
case "timeout":
|
|
306
|
-
throw new errors.CredalTimeoutError();
|
|
284
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling DELETE /v0/documentCollections/deleteCollection.");
|
|
307
285
|
case "unknown":
|
|
308
286
|
throw new errors.CredalError({
|
|
309
287
|
message: _response.error.errorMessage,
|
|
@@ -339,20 +317,12 @@ class DocumentCollections {
|
|
|
339
317
|
* })
|
|
340
318
|
*/
|
|
341
319
|
createMongoCollectionSync(request, requestOptions) {
|
|
342
|
-
var _a, _b;
|
|
343
320
|
return __awaiter(this, void 0, void 0, function* () {
|
|
321
|
+
var _a, _b, _c;
|
|
344
322
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
345
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
323
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/documentCollections/mongodb/createMongoSync"),
|
|
346
324
|
method: "POST",
|
|
347
|
-
headers: {
|
|
348
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
349
|
-
"X-Fern-Language": "JavaScript",
|
|
350
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
351
|
-
"X-Fern-SDK-Version": "0.0.23",
|
|
352
|
-
"User-Agent": "@credal/sdk/0.0.23",
|
|
353
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
354
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
355
|
-
},
|
|
325
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
356
326
|
contentType: "application/json",
|
|
357
327
|
requestType: "json",
|
|
358
328
|
body: serializers.CreateMongoCollectionSyncRequest.jsonOrThrow(request, {
|
|
@@ -383,7 +353,7 @@ class DocumentCollections {
|
|
|
383
353
|
body: _response.error.rawBody,
|
|
384
354
|
});
|
|
385
355
|
case "timeout":
|
|
386
|
-
throw new errors.CredalTimeoutError();
|
|
356
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/documentCollections/mongodb/createMongoSync.");
|
|
387
357
|
case "unknown":
|
|
388
358
|
throw new errors.CredalError({
|
|
389
359
|
message: _response.error.errorMessage,
|
|
@@ -419,20 +389,12 @@ class DocumentCollections {
|
|
|
419
389
|
* })
|
|
420
390
|
*/
|
|
421
391
|
updateMongoCollectionSync(request, requestOptions) {
|
|
422
|
-
var _a, _b;
|
|
423
392
|
return __awaiter(this, void 0, void 0, function* () {
|
|
393
|
+
var _a, _b, _c;
|
|
424
394
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
425
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
395
|
+
url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.CredalEnvironment.Production, "/v0/documentCollections/mongodb/updateMongoSync"),
|
|
426
396
|
method: "POST",
|
|
427
|
-
headers: {
|
|
428
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
429
|
-
"X-Fern-Language": "JavaScript",
|
|
430
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
431
|
-
"X-Fern-SDK-Version": "0.0.23",
|
|
432
|
-
"User-Agent": "@credal/sdk/0.0.23",
|
|
433
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
434
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
435
|
-
},
|
|
397
|
+
headers: Object.assign({ Authorization: yield this._getAuthorizationHeader(), "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "@credal/sdk", "X-Fern-SDK-Version": "0.0.25", "User-Agent": "@credal/sdk/0.0.25", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
436
398
|
contentType: "application/json",
|
|
437
399
|
requestType: "json",
|
|
438
400
|
body: serializers.UpdateMongoCollectionSyncRequest.jsonOrThrow(request, {
|
|
@@ -463,7 +425,7 @@ class DocumentCollections {
|
|
|
463
425
|
body: _response.error.rawBody,
|
|
464
426
|
});
|
|
465
427
|
case "timeout":
|
|
466
|
-
throw new errors.CredalTimeoutError();
|
|
428
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/documentCollections/mongodb/updateMongoSync.");
|
|
467
429
|
case "unknown":
|
|
468
430
|
throw new errors.CredalError({
|
|
469
431
|
message: _response.error.errorMessage,
|
|
@@ -472,12 +434,12 @@ class DocumentCollections {
|
|
|
472
434
|
});
|
|
473
435
|
}
|
|
474
436
|
_getAuthorizationHeader() {
|
|
475
|
-
var _a;
|
|
476
437
|
return __awaiter(this, void 0, void 0, function* () {
|
|
438
|
+
var _a;
|
|
477
439
|
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"];
|
|
478
440
|
if (bearer == null) {
|
|
479
441
|
throw new errors.CredalError({
|
|
480
|
-
message: "Please specify
|
|
442
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a CREDAL_API_KEY environment variable",
|
|
481
443
|
});
|
|
482
444
|
}
|
|
483
445
|
return `Bearer ${bearer}`;
|
package/dist/api/resources/documentCollections/client/requests/AddDocumentsToCollectionRequest.d.ts
CHANGED
|
@@ -20,9 +20,6 @@ import * as Credal from "../../../../index";
|
|
|
20
20
|
export interface AddDocumentsToCollectionRequest {
|
|
21
21
|
/** The ID of the document collection you want to add to. */
|
|
22
22
|
collectionId: string;
|
|
23
|
-
/**
|
|
24
|
-
* The set of resource identifier for which you want to add to the collection.
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
23
|
+
/** The set of resource identifier for which you want to add to the collection. */
|
|
27
24
|
resourceIdentifiers: Credal.ResourceIdentifier[];
|
|
28
25
|
}
|
|
@@ -14,19 +14,10 @@ import * as Credal from "../../../../index";
|
|
|
14
14
|
* }
|
|
15
15
|
*/
|
|
16
16
|
export interface CreateCollectionRequest {
|
|
17
|
-
/**
|
|
18
|
-
* A descriptive name for the collection.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
17
|
+
/** A descriptive name for the collection. */
|
|
21
18
|
name: string;
|
|
22
|
-
/**
|
|
23
|
-
* An in depth name for the copilot's function. Useful for routing requests to the right copilot.
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
19
|
+
/** An in depth name for the copilot's function. Useful for routing requests to the right copilot. */
|
|
26
20
|
description: string;
|
|
27
|
-
/**
|
|
28
|
-
* A list of collaborator emails and roles that will have access to the copilot.
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
21
|
+
/** A list of collaborator emails and roles that will have access to the copilot. */
|
|
31
22
|
collaborators: Credal.Collaborator[];
|
|
32
23
|
}
|
|
@@ -20,9 +20,6 @@ import * as Credal from "../../../../index";
|
|
|
20
20
|
export interface RemoveDocumentsFromCollectionRequest {
|
|
21
21
|
/** The ID of the document collection you want to add to. */
|
|
22
22
|
collectionId: string;
|
|
23
|
-
/**
|
|
24
|
-
* The set of resource identifier for which you want to remove from the collection
|
|
25
|
-
*
|
|
26
|
-
*/
|
|
23
|
+
/** The set of resource identifier for which you want to remove from the collection */
|
|
27
24
|
resourceIdentifiers: Credal.ResourceIdentifier[];
|
|
28
25
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
export * as actions from "./actions";
|
|
2
|
-
export * from "./actions/types";
|
|
3
1
|
export * as common from "./common";
|
|
4
2
|
export * from "./common/types";
|
|
5
3
|
export * as copilots from "./copilots";
|
|
@@ -14,7 +12,6 @@ export * as search from "./search";
|
|
|
14
12
|
export * from "./search/types";
|
|
15
13
|
export * as users from "./users";
|
|
16
14
|
export * from "./users/types";
|
|
17
|
-
export * from "./actions/client/requests";
|
|
18
15
|
export * from "./copilots/client/requests";
|
|
19
16
|
export * from "./documentCatalog/client/requests";
|
|
20
17
|
export * from "./documentCollections/client/requests";
|
|
@@ -15,20 +15,28 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
36
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
37
|
};
|
|
28
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.users = exports.search = exports.permissionsService = exports.documentCollections = exports.documentCatalog = exports.copilots = exports.common =
|
|
30
|
-
exports.actions = __importStar(require("./actions"));
|
|
31
|
-
__exportStar(require("./actions/types"), exports);
|
|
39
|
+
exports.users = exports.search = exports.permissionsService = exports.documentCollections = exports.documentCatalog = exports.copilots = exports.common = void 0;
|
|
32
40
|
exports.common = __importStar(require("./common"));
|
|
33
41
|
__exportStar(require("./common/types"), exports);
|
|
34
42
|
exports.copilots = __importStar(require("./copilots"));
|
|
@@ -43,7 +51,6 @@ exports.search = __importStar(require("./search"));
|
|
|
43
51
|
__exportStar(require("./search/types"), exports);
|
|
44
52
|
exports.users = __importStar(require("./users"));
|
|
45
53
|
__exportStar(require("./users/types"), exports);
|
|
46
|
-
__exportStar(require("./actions/client/requests"), exports);
|
|
47
54
|
__exportStar(require("./copilots/client/requests"), exports);
|
|
48
55
|
__exportStar(require("./documentCatalog/client/requests"), exports);
|
|
49
56
|
__exportStar(require("./documentCollections/client/requests"), exports);
|