@credal/sdk 0.0.24 → 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 -6
- 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/api/resources/copilots/types/ErrorChunk.js +5 -0
- package/api/resources/copilots/types/ErrorChunkData.d.ts +6 -0
- package/api/resources/copilots/types/ErrorChunkData.js +5 -0
- 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.js +17 -7
- 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 -6
- 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/dist/api/resources/copilots/types/ErrorChunk.js +5 -0
- package/dist/api/resources/copilots/types/ErrorChunkData.d.ts +6 -0
- package/dist/api/resources/copilots/types/ErrorChunkData.js +5 -0
- 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.js +17 -7
- 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/copilots/types/ErrorChunk.d.ts +13 -0
- package/dist/serialization/resources/copilots/types/ErrorChunk.js +44 -0
- package/dist/serialization/resources/copilots/types/ErrorChunkData.d.ts +12 -0
- package/dist/serialization/resources/copilots/types/ErrorChunkData.js +43 -0
- 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.js +17 -7
- 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/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/copilots/types/ErrorChunk.d.ts +13 -0
- package/serialization/resources/copilots/types/ErrorChunk.js +44 -0
- package/serialization/resources/copilots/types/ErrorChunkData.d.ts +12 -0
- package/serialization/resources/copilots/types/ErrorChunkData.js +43 -0
- 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.js +17 -7
- 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
|
@@ -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
|
}
|
package/api/resources/documentCollections/client/requests/RemoveDocumentsFromCollectionRequest.d.ts
CHANGED
|
@@ -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
|
}
|
package/api/resources/index.js
CHANGED
|
@@ -15,13 +15,23 @@ 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
|
};
|
|
@@ -7,6 +7,8 @@ import * as Credal from "../../../index";
|
|
|
7
7
|
export declare namespace PermissionsService {
|
|
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 PermissionsService {
|
|
|
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 PermissionsService {
|
|
@@ -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) {
|
|
@@ -65,20 +75,12 @@ class PermissionsService {
|
|
|
65
75
|
* })
|
|
66
76
|
*/
|
|
67
77
|
checkResourceAuthorizationForUser(request, requestOptions) {
|
|
68
|
-
var _a, _b;
|
|
69
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
var _a, _b, _c;
|
|
70
80
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
71
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
81
|
+
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/permissions/checkResourceAuthorizationForUser"),
|
|
72
82
|
method: "POST",
|
|
73
|
-
headers: {
|
|
74
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
75
|
-
"X-Fern-Language": "JavaScript",
|
|
76
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
77
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
78
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
79
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
80
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
81
|
-
},
|
|
83
|
+
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),
|
|
82
84
|
contentType: "application/json",
|
|
83
85
|
requestType: "json",
|
|
84
86
|
body: serializers.CheckResourceAuthorizationForUserRequest.jsonOrThrow(request, {
|
|
@@ -109,7 +111,7 @@ class PermissionsService {
|
|
|
109
111
|
body: _response.error.rawBody,
|
|
110
112
|
});
|
|
111
113
|
case "timeout":
|
|
112
|
-
throw new errors.CredalTimeoutError();
|
|
114
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/permissions/checkResourceAuthorizationForUser.");
|
|
113
115
|
case "unknown":
|
|
114
116
|
throw new errors.CredalError({
|
|
115
117
|
message: _response.error.errorMessage,
|
|
@@ -137,20 +139,12 @@ class PermissionsService {
|
|
|
137
139
|
* })
|
|
138
140
|
*/
|
|
139
141
|
checkBulkResourcesAuthorizationForUser(request, requestOptions) {
|
|
140
|
-
var _a, _b;
|
|
141
142
|
return __awaiter(this, void 0, void 0, function* () {
|
|
143
|
+
var _a, _b, _c;
|
|
142
144
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
143
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
145
|
+
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/permissions/checkBulkResourcesAuthorizationForUser"),
|
|
144
146
|
method: "POST",
|
|
145
|
-
headers: {
|
|
146
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
147
|
-
"X-Fern-Language": "JavaScript",
|
|
148
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
149
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
150
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
151
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
152
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
153
|
-
},
|
|
147
|
+
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),
|
|
154
148
|
contentType: "application/json",
|
|
155
149
|
requestType: "json",
|
|
156
150
|
body: serializers.CheckBulkResourcesAuthorizationForUserRequest.jsonOrThrow(request, {
|
|
@@ -181,7 +175,7 @@ class PermissionsService {
|
|
|
181
175
|
body: _response.error.rawBody,
|
|
182
176
|
});
|
|
183
177
|
case "timeout":
|
|
184
|
-
throw new errors.CredalTimeoutError();
|
|
178
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/permissions/checkBulkResourcesAuthorizationForUser.");
|
|
185
179
|
case "unknown":
|
|
186
180
|
throw new errors.CredalError({
|
|
187
181
|
message: _response.error.errorMessage,
|
|
@@ -201,20 +195,12 @@ class PermissionsService {
|
|
|
201
195
|
* })
|
|
202
196
|
*/
|
|
203
197
|
listCachedAuthorizedResourcesForUser(request, requestOptions) {
|
|
204
|
-
var _a, _b;
|
|
205
198
|
return __awaiter(this, void 0, void 0, function* () {
|
|
199
|
+
var _a, _b, _c;
|
|
206
200
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
207
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
201
|
+
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/permissions/listCachedAuthorizedResourcesForUser"),
|
|
208
202
|
method: "POST",
|
|
209
|
-
headers: {
|
|
210
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
211
|
-
"X-Fern-Language": "JavaScript",
|
|
212
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
213
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
214
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
215
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
216
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
217
|
-
},
|
|
203
|
+
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),
|
|
218
204
|
contentType: "application/json",
|
|
219
205
|
requestType: "json",
|
|
220
206
|
body: serializers.ListCachedAuthorizedResourcesForUserRequest.jsonOrThrow(request, {
|
|
@@ -245,7 +231,7 @@ class PermissionsService {
|
|
|
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 POST /v0/permissions/listCachedAuthorizedResourcesForUser.");
|
|
249
235
|
case "unknown":
|
|
250
236
|
throw new errors.CredalError({
|
|
251
237
|
message: _response.error.errorMessage,
|
|
@@ -254,12 +240,12 @@ class PermissionsService {
|
|
|
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}`;
|
|
@@ -17,19 +17,10 @@ import * as Credal from "../../../../index";
|
|
|
17
17
|
* }
|
|
18
18
|
*/
|
|
19
19
|
export interface CheckBulkResourcesAuthorizationForUserRequest {
|
|
20
|
-
/**
|
|
21
|
-
* The set of resource identifier for which you want to check authorization. Currently limited to 20 resources.
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
20
|
+
/** The set of resource identifier for which you want to check authorization. Currently limited to 20 resources. */
|
|
24
21
|
resourceIdentifiers: Credal.ResourceIdentifier[];
|
|
25
|
-
/**
|
|
26
|
-
* The user email to check authorization for.
|
|
27
|
-
*
|
|
28
|
-
*/
|
|
22
|
+
/** The user email to check authorization for. */
|
|
29
23
|
userEmail: string;
|
|
30
|
-
/**
|
|
31
|
-
* If specified, Credal will bypass the permissions cache and check current permissions for all resources specified.
|
|
32
|
-
*
|
|
33
|
-
*/
|
|
24
|
+
/** If specified, Credal will bypass the permissions cache and check current permissions for all resources specified. */
|
|
34
25
|
disableCache?: boolean;
|
|
35
26
|
}
|
|
@@ -14,19 +14,10 @@ import * as Credal from "../../../../index";
|
|
|
14
14
|
* }
|
|
15
15
|
*/
|
|
16
16
|
export interface CheckResourceAuthorizationForUserRequest {
|
|
17
|
-
/**
|
|
18
|
-
* The resource identifier for which you want to check authorization.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
17
|
+
/** The resource identifier for which you want to check authorization. */
|
|
21
18
|
resourceIdentifier: Credal.ResourceIdentifier;
|
|
22
|
-
/**
|
|
23
|
-
* The user email to check authorization for.
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
19
|
+
/** The user email to check authorization for. */
|
|
26
20
|
userEmail: string;
|
|
27
|
-
/**
|
|
28
|
-
* If specified, Credal will bypass the permissions cache and check current permissions for this resource
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
21
|
+
/** If specified, Credal will bypass the permissions cache and check current permissions for this resource */
|
|
31
22
|
disableCache?: boolean;
|
|
32
23
|
}
|
|
@@ -9,24 +9,12 @@ import * as Credal from "../../../../index";
|
|
|
9
9
|
* }
|
|
10
10
|
*/
|
|
11
11
|
export interface ListCachedAuthorizedResourcesForUserRequest {
|
|
12
|
-
/**
|
|
13
|
-
* The user email to list authorized resources for.
|
|
14
|
-
*
|
|
15
|
-
*/
|
|
12
|
+
/** The user email to list authorized resources for. */
|
|
16
13
|
userEmail: string;
|
|
17
|
-
/**
|
|
18
|
-
* The type of resource you want to list. If not specified, all resource types will be listed.
|
|
19
|
-
*
|
|
20
|
-
*/
|
|
14
|
+
/** The type of resource you want to list. If not specified, all resource types will be listed. */
|
|
21
15
|
resourceType?: Credal.ResourceType;
|
|
22
|
-
/**
|
|
23
|
-
* The maximum number of resources to return. Defaults to 100.
|
|
24
|
-
*
|
|
25
|
-
*/
|
|
16
|
+
/** The maximum number of resources to return. Defaults to 100. */
|
|
26
17
|
limit?: number;
|
|
27
|
-
/**
|
|
28
|
-
* The offset to use for pagination. If not specified, the first page of results will be returned.
|
|
29
|
-
*
|
|
30
|
-
*/
|
|
18
|
+
/** The offset to use for pagination. If not specified, the first page of results will be returned. */
|
|
31
19
|
offset?: number;
|
|
32
20
|
}
|
|
@@ -2,4 +2,4 @@
|
|
|
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 CheckBulkResourcesAuthorizationResponse = Credal.ResourceAuthorizationResult[];
|
|
@@ -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 Principal = Credal.Principal.Group | Credal.Principal.User;
|
|
6
6
|
export declare namespace Principal {
|
|
7
7
|
interface Group extends Credal.Group {
|
|
8
8
|
type: "group";
|
|
@@ -7,6 +7,8 @@ import * as Credal from "../../../index";
|
|
|
7
7
|
export declare namespace Search {
|
|
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 Search {
|
|
|
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 Search {
|
|
@@ -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) {
|
|
@@ -75,20 +85,12 @@ class Search {
|
|
|
75
85
|
* })
|
|
76
86
|
*/
|
|
77
87
|
searchDocumentCollection(request, requestOptions) {
|
|
78
|
-
var _a, _b;
|
|
79
88
|
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
var _a, _b, _c;
|
|
80
90
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
81
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
91
|
+
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/search/searchDocumentCollection"),
|
|
82
92
|
method: "POST",
|
|
83
|
-
headers: {
|
|
84
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
85
|
-
"X-Fern-Language": "JavaScript",
|
|
86
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
87
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
88
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
89
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
90
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
91
|
-
},
|
|
93
|
+
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),
|
|
92
94
|
contentType: "application/json",
|
|
93
95
|
requestType: "json",
|
|
94
96
|
body: serializers.SearchDocumentCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -117,7 +119,7 @@ class Search {
|
|
|
117
119
|
body: _response.error.rawBody,
|
|
118
120
|
});
|
|
119
121
|
case "timeout":
|
|
120
|
-
throw new errors.CredalTimeoutError();
|
|
122
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling POST /v0/search/searchDocumentCollection.");
|
|
121
123
|
case "unknown":
|
|
122
124
|
throw new errors.CredalError({
|
|
123
125
|
message: _response.error.errorMessage,
|
|
@@ -126,12 +128,12 @@ class Search {
|
|
|
126
128
|
});
|
|
127
129
|
}
|
|
128
130
|
_getAuthorizationHeader() {
|
|
129
|
-
var _a;
|
|
130
131
|
return __awaiter(this, void 0, void 0, function* () {
|
|
132
|
+
var _a;
|
|
131
133
|
const bearer = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["CREDAL_API_KEY"];
|
|
132
134
|
if (bearer == null) {
|
|
133
135
|
throw new errors.CredalError({
|
|
134
|
-
message: "Please specify
|
|
136
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a CREDAL_API_KEY environment variable",
|
|
135
137
|
});
|
|
136
138
|
}
|
|
137
139
|
return `Bearer ${bearer}`;
|
|
@@ -26,20 +26,11 @@ import * as Credal from "../../../../index";
|
|
|
26
26
|
export interface SearchDocumentCollectionRequest {
|
|
27
27
|
collectionId: string;
|
|
28
28
|
searchQuery: string;
|
|
29
|
-
/**
|
|
30
|
-
* The email of the user making the search request for permissions reduction.
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
29
|
+
/** The email of the user making the search request for permissions reduction. */
|
|
33
30
|
userEmail: string;
|
|
34
|
-
/**
|
|
35
|
-
* The structured query filters to apply to the search query.
|
|
36
|
-
*
|
|
37
|
-
*/
|
|
31
|
+
/** The structured query filters to apply to the search query. */
|
|
38
32
|
structuredQueryFilters?: Credal.SingleFieldFilter[];
|
|
39
33
|
searchOptions?: Credal.DocumentCollectionSearchOptions;
|
|
40
|
-
/**
|
|
41
|
-
* Legacy metadata filter expression to apply to the search query. Use structuredQueryFilters instead.
|
|
42
|
-
*
|
|
43
|
-
*/
|
|
34
|
+
/** Legacy metadata filter expression to apply to the search query. Use structuredQueryFilters instead. */
|
|
44
35
|
metadataFilterExpression?: string;
|
|
45
36
|
}
|
|
@@ -7,6 +7,8 @@ import * as Credal from "../../../index";
|
|
|
7
7
|
export declare namespace Users {
|
|
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 Users {
|
|
|
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 Users {
|
|
@@ -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) {
|
|
@@ -70,20 +80,12 @@ class Users {
|
|
|
70
80
|
* }])
|
|
71
81
|
*/
|
|
72
82
|
metadata(request, requestOptions) {
|
|
73
|
-
var _a, _b;
|
|
74
83
|
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
var _a, _b, _c;
|
|
75
85
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
76
|
-
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.
|
|
86
|
+
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/users/metadata"),
|
|
77
87
|
method: "PATCH",
|
|
78
|
-
headers: {
|
|
79
|
-
Authorization: yield this._getAuthorizationHeader(),
|
|
80
|
-
"X-Fern-Language": "JavaScript",
|
|
81
|
-
"X-Fern-SDK-Name": "@credal/sdk",
|
|
82
|
-
"X-Fern-SDK-Version": "0.0.24",
|
|
83
|
-
"User-Agent": "@credal/sdk/0.0.24",
|
|
84
|
-
"X-Fern-Runtime": core.RUNTIME.type,
|
|
85
|
-
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
86
|
-
},
|
|
88
|
+
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),
|
|
87
89
|
contentType: "application/json",
|
|
88
90
|
requestType: "json",
|
|
89
91
|
body: serializers.users.metadata.Request.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
@@ -107,7 +109,7 @@ class Users {
|
|
|
107
109
|
body: _response.error.rawBody,
|
|
108
110
|
});
|
|
109
111
|
case "timeout":
|
|
110
|
-
throw new errors.CredalTimeoutError();
|
|
112
|
+
throw new errors.CredalTimeoutError("Timeout exceeded when calling PATCH /v0/users/metadata.");
|
|
111
113
|
case "unknown":
|
|
112
114
|
throw new errors.CredalError({
|
|
113
115
|
message: _response.error.errorMessage,
|
|
@@ -116,12 +118,12 @@ class Users {
|
|
|
116
118
|
});
|
|
117
119
|
}
|
|
118
120
|
_getAuthorizationHeader() {
|
|
119
|
-
var _a;
|
|
120
121
|
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
var _a;
|
|
121
123
|
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"];
|
|
122
124
|
if (bearer == null) {
|
|
123
125
|
throw new errors.CredalError({
|
|
124
|
-
message: "Please specify
|
|
126
|
+
message: "Please specify a bearer by either passing it in to the constructor or initializing a CREDAL_API_KEY environment variable",
|
|
125
127
|
});
|
|
126
128
|
}
|
|
127
129
|
return `Bearer ${bearer}`;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export
|
|
1
|
+
export type APIResponse<Success, Failure> = SuccessfulResponse<Success> | FailedResponse<Failure>;
|
|
2
2
|
export interface SuccessfulResponse<T> {
|
|
3
3
|
ok: true;
|
|
4
4
|
body: T;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { APIResponse } from "./APIResponse";
|
|
2
|
-
export
|
|
2
|
+
export type FetchFunction = <R = unknown>(args: Fetcher.Args) => Promise<APIResponse<R, Fetcher.Error>>;
|
|
3
3
|
export declare namespace Fetcher {
|
|
4
4
|
interface Args {
|
|
5
5
|
url: string;
|
|
6
6
|
method: string;
|
|
7
7
|
contentType?: string;
|
|
8
8
|
headers?: Record<string, string | undefined>;
|
|
9
|
-
queryParameters?: Record<string, string | string[] | object | object[]>;
|
|
9
|
+
queryParameters?: Record<string, string | string[] | object | object[] | null>;
|
|
10
10
|
body?: unknown;
|
|
11
11
|
timeoutMs?: number;
|
|
12
12
|
maxRetries?: number;
|
package/core/fetcher/Fetcher.js
CHANGED
|
@@ -9,7 +9,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
});
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.fetcher =
|
|
12
|
+
exports.fetcher = void 0;
|
|
13
|
+
exports.fetcherImpl = fetcherImpl;
|
|
14
|
+
const json_1 = require("../json");
|
|
13
15
|
const createRequestUrl_1 = require("./createRequestUrl");
|
|
14
16
|
const getFetchFn_1 = require("./getFetchFn");
|
|
15
17
|
const getRequestBody_1 = require("./getRequestBody");
|
|
@@ -30,7 +32,7 @@ function fetcherImpl(args) {
|
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
const url = (0, createRequestUrl_1.createRequestUrl)(args.url, args.queryParameters);
|
|
33
|
-
|
|
35
|
+
const requestBody = yield (0, getRequestBody_1.getRequestBody)({
|
|
34
36
|
body: args.body,
|
|
35
37
|
type: args.requestType === "json" ? "json" : "other",
|
|
36
38
|
});
|
|
@@ -39,7 +41,7 @@ function fetcherImpl(args) {
|
|
|
39
41
|
const response = yield (0, requestWithRetries_1.requestWithRetries)(() => __awaiter(this, void 0, void 0, function* () {
|
|
40
42
|
return (0, makeRequest_1.makeRequest)(fetchFn, url, args.method, headers, requestBody, args.timeoutMs, args.abortSignal, args.withCredentials, args.duplex);
|
|
41
43
|
}), args.maxRetries);
|
|
42
|
-
|
|
44
|
+
const responseBody = yield (0, getResponseBody_1.getResponseBody)(response, args.responseType);
|
|
43
45
|
if (response.status >= 200 && response.status < 400) {
|
|
44
46
|
return {
|
|
45
47
|
ok: true,
|
|
@@ -89,11 +91,10 @@ function fetcherImpl(args) {
|
|
|
89
91
|
ok: false,
|
|
90
92
|
error: {
|
|
91
93
|
reason: "unknown",
|
|
92
|
-
errorMessage:
|
|
94
|
+
errorMessage: (0, json_1.toJson)(error),
|
|
93
95
|
},
|
|
94
96
|
};
|
|
95
97
|
}
|
|
96
98
|
});
|
|
97
99
|
}
|
|
98
|
-
exports.fetcherImpl = fetcherImpl;
|
|
99
100
|
exports.fetcher = fetcherImpl;
|