@getzep/zep-cloud 2.2.0 → 2.3.0
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 -5
- package/api/errors/BadRequestError.js +17 -7
- package/api/errors/ConflictError.js +17 -7
- package/api/errors/InternalServerError.js +17 -7
- package/api/errors/NotFoundError.js +17 -7
- package/api/errors/UnauthorizedError.js +17 -7
- package/api/resources/document/client/Client.d.ts +18 -13
- package/api/resources/document/client/Client.js +158 -141
- package/api/resources/graph/client/Client.d.ts +13 -8
- package/api/resources/graph/client/Client.js +50 -38
- package/api/resources/graph/resources/edge/client/Client.d.ts +9 -4
- package/api/resources/graph/resources/edge/client/Client.js +51 -37
- package/api/resources/graph/resources/episode/client/Client.d.ts +8 -3
- package/api/resources/graph/resources/episode/client/Client.js +46 -33
- package/api/resources/graph/resources/index.js +17 -7
- package/api/resources/graph/resources/node/client/Client.d.ts +8 -3
- package/api/resources/graph/resources/node/client/Client.js +43 -30
- package/api/resources/group/client/Client.d.ts +7 -2
- package/api/resources/group/client/Client.js +36 -24
- package/api/resources/index.js +17 -7
- package/api/resources/memory/client/Client.d.ts +28 -23
- package/api/resources/memory/client/Client.js +225 -195
- package/api/resources/memory/client/requests/AddMemoryRequest.d.ts +1 -1
- package/api/resources/user/client/Client.d.ts +12 -7
- package/api/resources/user/client/Client.js +82 -65
- package/api/types/GraphDataType.d.ts +1 -1
- package/api/types/GraphSearchScope.d.ts +1 -1
- package/api/types/Reranker.d.ts +1 -1
- package/api/types/RoleType.d.ts +1 -1
- package/api/types/SearchScope.d.ts +1 -1
- package/api/types/SearchType.d.ts +1 -1
- package/core/fetcher/APIResponse.d.ts +1 -1
- package/core/fetcher/Fetcher.d.ts +5 -2
- package/core/fetcher/Fetcher.js +18 -175
- package/core/fetcher/Supplier.d.ts +1 -1
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +12 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +68 -0
- package/core/fetcher/getHeader.js +1 -2
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +22 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +54 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +40 -0
- package/core/fetcher/signals.d.ts +11 -0
- package/core/fetcher/signals.js +36 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/core/index.js +17 -7
- package/core/runtime/runtime.d.ts +2 -1
- package/core/runtime/runtime.js +12 -1
- package/core/schemas/Schema.d.ts +13 -9
- package/core/schemas/Schema.js +1 -0
- package/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/core/schemas/builders/bigint/bigint.js +49 -0
- package/core/schemas/builders/bigint/index.d.ts +1 -0
- package/core/schemas/builders/bigint/index.js +5 -0
- package/core/schemas/builders/date/date.js +1 -2
- package/core/schemas/builders/enum/enum.js +1 -2
- package/core/schemas/builders/index.d.ts +1 -0
- package/core/schemas/builders/index.js +1 -0
- package/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/core/schemas/builders/lazy/lazy.js +11 -23
- package/core/schemas/builders/lazy/lazyObject.js +2 -12
- package/core/schemas/builders/list/list.js +32 -46
- 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 +120 -114
- 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 +18 -13
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +5 -15
- package/core/schemas/builders/object-like/types.d.ts +1 -1
- package/core/schemas/builders/record/record.js +50 -62
- package/core/schemas/builders/record/types.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +21 -25
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/core/schemas/builders/set/set.js +7 -17
- package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +22 -34
- 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 +52 -64
- package/core/schemas/utils/MaybePromise.d.ts +1 -1
- package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +3 -3
- 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 +5 -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 +4 -14
- package/core/schemas/utils/partition.js +1 -2
- package/dist/Client.d.ts +10 -5
- package/dist/api/errors/BadRequestError.js +17 -7
- package/dist/api/errors/ConflictError.js +17 -7
- package/dist/api/errors/InternalServerError.js +17 -7
- package/dist/api/errors/NotFoundError.js +17 -7
- package/dist/api/errors/UnauthorizedError.js +17 -7
- package/dist/api/resources/document/client/Client.d.ts +18 -13
- package/dist/api/resources/document/client/Client.js +158 -141
- package/dist/api/resources/graph/client/Client.d.ts +13 -8
- package/dist/api/resources/graph/client/Client.js +50 -38
- package/dist/api/resources/graph/resources/edge/client/Client.d.ts +9 -4
- package/dist/api/resources/graph/resources/edge/client/Client.js +51 -37
- package/dist/api/resources/graph/resources/episode/client/Client.d.ts +8 -3
- package/dist/api/resources/graph/resources/episode/client/Client.js +46 -33
- package/dist/api/resources/graph/resources/index.js +17 -7
- package/dist/api/resources/graph/resources/node/client/Client.d.ts +8 -3
- package/dist/api/resources/graph/resources/node/client/Client.js +43 -30
- package/dist/api/resources/group/client/Client.d.ts +7 -2
- package/dist/api/resources/group/client/Client.js +36 -24
- package/dist/api/resources/index.js +17 -7
- package/dist/api/resources/memory/client/Client.d.ts +28 -23
- package/dist/api/resources/memory/client/Client.js +225 -195
- package/dist/api/resources/memory/client/requests/AddMemoryRequest.d.ts +1 -1
- package/dist/api/resources/user/client/Client.d.ts +12 -7
- package/dist/api/resources/user/client/Client.js +82 -65
- package/dist/api/types/GraphDataType.d.ts +1 -1
- package/dist/api/types/GraphSearchScope.d.ts +1 -1
- package/dist/api/types/Reranker.d.ts +1 -1
- package/dist/api/types/RoleType.d.ts +1 -1
- package/dist/api/types/SearchScope.d.ts +1 -1
- package/dist/api/types/SearchType.d.ts +1 -1
- package/dist/core/fetcher/APIResponse.d.ts +1 -1
- package/dist/core/fetcher/Fetcher.d.ts +5 -2
- package/dist/core/fetcher/Fetcher.js +18 -175
- package/dist/core/fetcher/Supplier.d.ts +1 -1
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +12 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +68 -0
- package/dist/core/fetcher/getHeader.js +1 -2
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +22 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +54 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +40 -0
- package/dist/core/fetcher/signals.d.ts +11 -0
- package/dist/core/fetcher/signals.js +36 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +30 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +247 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +21 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +126 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +229 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +59 -0
- package/dist/core/index.js +17 -7
- package/dist/core/runtime/runtime.d.ts +2 -1
- package/dist/core/runtime/runtime.js +12 -1
- package/dist/core/schemas/Schema.d.ts +13 -9
- package/dist/core/schemas/Schema.js +1 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/dist/core/schemas/builders/bigint/bigint.js +49 -0
- package/dist/core/schemas/builders/bigint/index.d.ts +1 -0
- package/dist/core/schemas/builders/bigint/index.js +5 -0
- 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/index.d.ts +1 -0
- package/dist/core/schemas/builders/index.js +1 -0
- package/dist/core/schemas/builders/lazy/lazy.d.ts +2 -2
- package/dist/core/schemas/builders/lazy/lazy.js +11 -23
- package/dist/core/schemas/builders/lazy/lazyObject.js +2 -12
- package/dist/core/schemas/builders/list/list.js +32 -46
- 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 +120 -114
- 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 +18 -13
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +5 -15
- package/dist/core/schemas/builders/object-like/types.d.ts +1 -1
- package/dist/core/schemas/builders/record/record.js +50 -62
- package/dist/core/schemas/builders/record/types.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +2 -2
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +21 -25
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +1 -2
- package/dist/core/schemas/builders/set/set.js +7 -17
- package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -4
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +22 -34
- 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 +52 -64
- package/dist/core/schemas/utils/MaybePromise.d.ts +1 -1
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +3 -3
- 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 +5 -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 +4 -14
- package/dist/core/schemas/utils/partition.js +1 -2
- package/dist/environments.d.ts +1 -1
- package/dist/errors/ZepTimeoutError.d.ts +1 -1
- package/dist/errors/ZepTimeoutError.js +2 -2
- package/dist/extractor/base.js +1 -1
- package/dist/extractor/index.d.ts +2 -2
- package/dist/index.js +17 -7
- package/dist/serialization/resources/document/client/addDocuments.js +17 -7
- package/dist/serialization/resources/document/client/batchDeleteDocuments.js +17 -7
- package/dist/serialization/resources/document/client/batchGetDocuments.js +17 -7
- package/dist/serialization/resources/document/client/batchUpdateDocuments.js +17 -7
- package/dist/serialization/resources/document/client/index.js +17 -7
- package/dist/serialization/resources/document/client/listCollections.js +17 -7
- package/dist/serialization/resources/document/client/requests/CreateDocumentCollectionRequest.js +17 -7
- package/dist/serialization/resources/document/client/requests/DocumentSearchPayload.js +17 -7
- package/dist/serialization/resources/document/client/requests/GetDocumentListRequest.js +17 -7
- package/dist/serialization/resources/document/client/requests/UpdateDocumentCollectionRequest.js +17 -7
- package/dist/serialization/resources/document/client/requests/UpdateDocumentRequest.js +17 -7
- package/dist/serialization/resources/graph/client/requests/AddDataRequest.js +17 -7
- package/dist/serialization/resources/graph/client/requests/GraphSearchQuery.js +17 -7
- package/dist/serialization/resources/graph/resources/edge/client/getByGroupId.js +17 -7
- package/dist/serialization/resources/graph/resources/edge/client/getByUserId.js +17 -7
- package/dist/serialization/resources/graph/resources/edge/client/index.js +17 -7
- package/dist/serialization/resources/graph/resources/index.js +17 -7
- package/dist/serialization/resources/graph/resources/node/client/getByGroupId.js +17 -7
- package/dist/serialization/resources/graph/resources/node/client/getByUserId.js +17 -7
- package/dist/serialization/resources/graph/resources/node/client/index.js +17 -7
- package/dist/serialization/resources/group/client/requests/CreateGroupRequest.js +17 -7
- package/dist/serialization/resources/index.js +17 -7
- package/dist/serialization/resources/memory/client/extractData.js +17 -7
- package/dist/serialization/resources/memory/client/index.js +17 -7
- package/dist/serialization/resources/memory/client/requests/AddFactsRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/AddMemoryRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/CreateSessionRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/EndSessionRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/EndSessionsRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/ExtractDataRequest.js +17 -7
- package/dist/serialization/resources/memory/client/requests/MemorySearchPayload.js +17 -7
- package/dist/serialization/resources/memory/client/requests/ModelsMessageMetadataUpdate.js +17 -7
- package/dist/serialization/resources/memory/client/requests/SessionSearchQuery.js +17 -7
- package/dist/serialization/resources/memory/client/requests/UpdateSessionRequest.js +17 -7
- package/dist/serialization/resources/memory/client/search.js +17 -7
- package/dist/serialization/resources/user/client/getSessions.js +17 -7
- package/dist/serialization/resources/user/client/index.js +17 -7
- package/dist/serialization/resources/user/client/requests/CreateUserRequest.js +17 -7
- package/dist/serialization/resources/user/client/requests/UpdateUserRequest.js +17 -7
- package/dist/serialization/types/AddMemoryResponse.js +17 -7
- package/dist/serialization/types/ApiError.js +17 -7
- package/dist/serialization/types/ApidataDocument.js +17 -7
- package/dist/serialization/types/ApidataDocumentCollection.js +17 -7
- package/dist/serialization/types/ApidataDocumentSearchResponse.js +17 -7
- package/dist/serialization/types/ApidataDocumentWithScore.js +17 -7
- package/dist/serialization/types/ApidataFactRatingExamples.js +17 -7
- package/dist/serialization/types/ApidataFactRatingInstruction.js +17 -7
- package/dist/serialization/types/ClassifySessionRequest.js +17 -7
- package/dist/serialization/types/CreateDocumentRequest.js +17 -7
- package/dist/serialization/types/EndSessionResponse.js +17 -7
- package/dist/serialization/types/EndSessionsResponse.js +17 -7
- package/dist/serialization/types/EntityEdge.js +17 -7
- package/dist/serialization/types/EntityNode.js +17 -7
- package/dist/serialization/types/Episode.js +17 -7
- package/dist/serialization/types/EpisodeResponse.js +17 -7
- package/dist/serialization/types/Fact.js +17 -7
- package/dist/serialization/types/FactRatingExamples.js +17 -7
- package/dist/serialization/types/FactRatingInstruction.js +17 -7
- package/dist/serialization/types/FactResponse.js +17 -7
- package/dist/serialization/types/FactsResponse.js +17 -7
- package/dist/serialization/types/GraphDataType.js +17 -7
- package/dist/serialization/types/GraphSearchResults.js +17 -7
- package/dist/serialization/types/GraphSearchScope.js +17 -7
- package/dist/serialization/types/Group.js +17 -7
- package/dist/serialization/types/Memory.js +17 -7
- package/dist/serialization/types/MemorySearchResult.js +17 -7
- package/dist/serialization/types/Message.js +17 -7
- package/dist/serialization/types/MessageListResponse.js +17 -7
- package/dist/serialization/types/NewFact.js +17 -7
- package/dist/serialization/types/Question.js +17 -7
- package/dist/serialization/types/Reranker.js +17 -7
- package/dist/serialization/types/RoleType.js +17 -7
- package/dist/serialization/types/SearchScope.js +17 -7
- package/dist/serialization/types/SearchType.js +17 -7
- package/dist/serialization/types/Session.js +17 -7
- package/dist/serialization/types/SessionClassification.js +17 -7
- package/dist/serialization/types/SessionListResponse.js +17 -7
- package/dist/serialization/types/SessionSearchResponse.js +17 -7
- package/dist/serialization/types/SessionSearchResult.js +17 -7
- package/dist/serialization/types/SuccessResponse.js +17 -7
- package/dist/serialization/types/Summary.js +17 -7
- package/dist/serialization/types/SummaryListResponse.js +17 -7
- package/dist/serialization/types/UpdateDocumentListRequest.js +17 -7
- package/dist/serialization/types/User.js +17 -7
- package/dist/serialization/types/UserListResponse.js +17 -7
- package/dist/version.d.ts +1 -0
- package/dist/version.js +4 -0
- package/environments.d.ts +1 -1
- package/errors/ZepTimeoutError.d.ts +1 -1
- package/errors/ZepTimeoutError.js +2 -2
- package/extractor/base.js +1 -1
- package/extractor/index.d.ts +2 -2
- package/index.js +17 -7
- package/{jest.config.js → jest.config.mjs} +4 -1
- package/package.json +25 -16
- package/reference.md +3801 -0
- package/scripts/rename-to-esm-files.js +115 -0
- package/serialization/resources/document/client/addDocuments.js +17 -7
- package/serialization/resources/document/client/batchDeleteDocuments.js +17 -7
- package/serialization/resources/document/client/batchGetDocuments.js +17 -7
- package/serialization/resources/document/client/batchUpdateDocuments.js +17 -7
- package/serialization/resources/document/client/index.js +17 -7
- package/serialization/resources/document/client/listCollections.js +17 -7
- package/serialization/resources/document/client/requests/CreateDocumentCollectionRequest.js +17 -7
- package/serialization/resources/document/client/requests/DocumentSearchPayload.js +17 -7
- package/serialization/resources/document/client/requests/GetDocumentListRequest.js +17 -7
- package/serialization/resources/document/client/requests/UpdateDocumentCollectionRequest.js +17 -7
- package/serialization/resources/document/client/requests/UpdateDocumentRequest.js +17 -7
- package/serialization/resources/graph/client/requests/AddDataRequest.js +17 -7
- package/serialization/resources/graph/client/requests/GraphSearchQuery.js +17 -7
- package/serialization/resources/graph/resources/edge/client/getByGroupId.js +17 -7
- package/serialization/resources/graph/resources/edge/client/getByUserId.js +17 -7
- package/serialization/resources/graph/resources/edge/client/index.js +17 -7
- package/serialization/resources/graph/resources/index.js +17 -7
- package/serialization/resources/graph/resources/node/client/getByGroupId.js +17 -7
- package/serialization/resources/graph/resources/node/client/getByUserId.js +17 -7
- package/serialization/resources/graph/resources/node/client/index.js +17 -7
- package/serialization/resources/group/client/requests/CreateGroupRequest.js +17 -7
- package/serialization/resources/index.js +17 -7
- package/serialization/resources/memory/client/extractData.js +17 -7
- package/serialization/resources/memory/client/index.js +17 -7
- package/serialization/resources/memory/client/requests/AddFactsRequest.js +17 -7
- package/serialization/resources/memory/client/requests/AddMemoryRequest.js +17 -7
- package/serialization/resources/memory/client/requests/CreateSessionRequest.js +17 -7
- package/serialization/resources/memory/client/requests/EndSessionRequest.js +17 -7
- package/serialization/resources/memory/client/requests/EndSessionsRequest.js +17 -7
- package/serialization/resources/memory/client/requests/ExtractDataRequest.js +17 -7
- package/serialization/resources/memory/client/requests/MemorySearchPayload.js +17 -7
- package/serialization/resources/memory/client/requests/ModelsMessageMetadataUpdate.js +17 -7
- package/serialization/resources/memory/client/requests/SessionSearchQuery.js +17 -7
- package/serialization/resources/memory/client/requests/UpdateSessionRequest.js +17 -7
- package/serialization/resources/memory/client/search.js +17 -7
- package/serialization/resources/user/client/getSessions.js +17 -7
- package/serialization/resources/user/client/index.js +17 -7
- package/serialization/resources/user/client/requests/CreateUserRequest.js +17 -7
- package/serialization/resources/user/client/requests/UpdateUserRequest.js +17 -7
- package/serialization/types/AddMemoryResponse.js +17 -7
- package/serialization/types/ApiError.js +17 -7
- package/serialization/types/ApidataDocument.js +17 -7
- package/serialization/types/ApidataDocumentCollection.js +17 -7
- package/serialization/types/ApidataDocumentSearchResponse.js +17 -7
- package/serialization/types/ApidataDocumentWithScore.js +17 -7
- package/serialization/types/ApidataFactRatingExamples.js +17 -7
- package/serialization/types/ApidataFactRatingInstruction.js +17 -7
- package/serialization/types/ClassifySessionRequest.js +17 -7
- package/serialization/types/CreateDocumentRequest.js +17 -7
- package/serialization/types/EndSessionResponse.js +17 -7
- package/serialization/types/EndSessionsResponse.js +17 -7
- package/serialization/types/EntityEdge.js +17 -7
- package/serialization/types/EntityNode.js +17 -7
- package/serialization/types/Episode.js +17 -7
- package/serialization/types/EpisodeResponse.js +17 -7
- package/serialization/types/Fact.js +17 -7
- package/serialization/types/FactRatingExamples.js +17 -7
- package/serialization/types/FactRatingInstruction.js +17 -7
- package/serialization/types/FactResponse.js +17 -7
- package/serialization/types/FactsResponse.js +17 -7
- package/serialization/types/GraphDataType.js +17 -7
- package/serialization/types/GraphSearchResults.js +17 -7
- package/serialization/types/GraphSearchScope.js +17 -7
- package/serialization/types/Group.js +17 -7
- package/serialization/types/Memory.js +17 -7
- package/serialization/types/MemorySearchResult.js +17 -7
- package/serialization/types/Message.js +17 -7
- package/serialization/types/MessageListResponse.js +17 -7
- package/serialization/types/NewFact.js +17 -7
- package/serialization/types/Question.js +17 -7
- package/serialization/types/Reranker.js +17 -7
- package/serialization/types/RoleType.js +17 -7
- package/serialization/types/SearchScope.js +17 -7
- package/serialization/types/SearchType.js +17 -7
- package/serialization/types/Session.js +17 -7
- package/serialization/types/SessionClassification.js +17 -7
- package/serialization/types/SessionListResponse.js +17 -7
- package/serialization/types/SessionSearchResponse.js +17 -7
- package/serialization/types/SessionSearchResult.js +17 -7
- package/serialization/types/SuccessResponse.js +17 -7
- package/serialization/types/Summary.js +17 -7
- package/serialization/types/SummaryListResponse.js +17 -7
- package/serialization/types/UpdateDocumentListRequest.js +17 -7
- package/serialization/types/User.js +17 -7
- package/serialization/types/UserListResponse.js +17 -7
- package/version.d.ts +1 -0
- package/version.js +4 -0
|
@@ -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,22 +79,23 @@ class Document {
|
|
|
69
79
|
* @throws {@link Zep.InternalServerError}
|
|
70
80
|
*
|
|
71
81
|
* @example
|
|
72
|
-
* await
|
|
82
|
+
* await client.document.listCollections()
|
|
73
83
|
*/
|
|
74
84
|
listCollections(requestOptions) {
|
|
75
|
-
var _a, _b;
|
|
76
85
|
return __awaiter(this, void 0, void 0, function* () {
|
|
86
|
+
var _a, _b;
|
|
77
87
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
78
88
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, "collections"),
|
|
79
89
|
method: "GET",
|
|
80
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
90
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
81
91
|
contentType: "application/json",
|
|
92
|
+
requestType: "json",
|
|
82
93
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
83
94
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
84
95
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
85
96
|
});
|
|
86
97
|
if (_response.ok) {
|
|
87
|
-
return
|
|
98
|
+
return serializers.document.listCollections.Response.parseOrThrow(_response.body, {
|
|
88
99
|
unrecognizedObjectKeys: "passthrough",
|
|
89
100
|
allowUnrecognizedUnionMembers: true,
|
|
90
101
|
allowUnrecognizedEnumValues: true,
|
|
@@ -95,7 +106,7 @@ class Document {
|
|
|
95
106
|
if (_response.error.reason === "status-code") {
|
|
96
107
|
switch (_response.error.statusCode) {
|
|
97
108
|
case 401:
|
|
98
|
-
throw new Zep.UnauthorizedError(
|
|
109
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
99
110
|
unrecognizedObjectKeys: "passthrough",
|
|
100
111
|
allowUnrecognizedUnionMembers: true,
|
|
101
112
|
allowUnrecognizedEnumValues: true,
|
|
@@ -103,7 +114,7 @@ class Document {
|
|
|
103
114
|
breadcrumbsPrefix: ["response"],
|
|
104
115
|
}));
|
|
105
116
|
case 500:
|
|
106
|
-
throw new Zep.InternalServerError(
|
|
117
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
107
118
|
unrecognizedObjectKeys: "passthrough",
|
|
108
119
|
allowUnrecognizedUnionMembers: true,
|
|
109
120
|
allowUnrecognizedEnumValues: true,
|
|
@@ -124,7 +135,7 @@ class Document {
|
|
|
124
135
|
body: _response.error.rawBody,
|
|
125
136
|
});
|
|
126
137
|
case "timeout":
|
|
127
|
-
throw new errors.ZepTimeoutError();
|
|
138
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /collections.");
|
|
128
139
|
case "unknown":
|
|
129
140
|
throw new errors.ZepError({
|
|
130
141
|
message: _response.error.errorMessage,
|
|
@@ -144,22 +155,23 @@ class Document {
|
|
|
144
155
|
* @throws {@link Zep.InternalServerError}
|
|
145
156
|
*
|
|
146
157
|
* @example
|
|
147
|
-
* await
|
|
158
|
+
* await client.document.getCollection("collectionName")
|
|
148
159
|
*/
|
|
149
160
|
getCollection(collectionName, requestOptions) {
|
|
150
|
-
var _a, _b;
|
|
151
161
|
return __awaiter(this, void 0, void 0, function* () {
|
|
162
|
+
var _a, _b;
|
|
152
163
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
153
164
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}`),
|
|
154
165
|
method: "GET",
|
|
155
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
166
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
156
167
|
contentType: "application/json",
|
|
168
|
+
requestType: "json",
|
|
157
169
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
158
170
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
159
171
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
160
172
|
});
|
|
161
173
|
if (_response.ok) {
|
|
162
|
-
return
|
|
174
|
+
return serializers.ApidataDocumentCollection.parseOrThrow(_response.body, {
|
|
163
175
|
unrecognizedObjectKeys: "passthrough",
|
|
164
176
|
allowUnrecognizedUnionMembers: true,
|
|
165
177
|
allowUnrecognizedEnumValues: true,
|
|
@@ -170,7 +182,7 @@ class Document {
|
|
|
170
182
|
if (_response.error.reason === "status-code") {
|
|
171
183
|
switch (_response.error.statusCode) {
|
|
172
184
|
case 400:
|
|
173
|
-
throw new Zep.BadRequestError(
|
|
185
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
174
186
|
unrecognizedObjectKeys: "passthrough",
|
|
175
187
|
allowUnrecognizedUnionMembers: true,
|
|
176
188
|
allowUnrecognizedEnumValues: true,
|
|
@@ -178,7 +190,7 @@ class Document {
|
|
|
178
190
|
breadcrumbsPrefix: ["response"],
|
|
179
191
|
}));
|
|
180
192
|
case 401:
|
|
181
|
-
throw new Zep.UnauthorizedError(
|
|
193
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
182
194
|
unrecognizedObjectKeys: "passthrough",
|
|
183
195
|
allowUnrecognizedUnionMembers: true,
|
|
184
196
|
allowUnrecognizedEnumValues: true,
|
|
@@ -186,7 +198,7 @@ class Document {
|
|
|
186
198
|
breadcrumbsPrefix: ["response"],
|
|
187
199
|
}));
|
|
188
200
|
case 404:
|
|
189
|
-
throw new Zep.NotFoundError(
|
|
201
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
190
202
|
unrecognizedObjectKeys: "passthrough",
|
|
191
203
|
allowUnrecognizedUnionMembers: true,
|
|
192
204
|
allowUnrecognizedEnumValues: true,
|
|
@@ -194,7 +206,7 @@ class Document {
|
|
|
194
206
|
breadcrumbsPrefix: ["response"],
|
|
195
207
|
}));
|
|
196
208
|
case 500:
|
|
197
|
-
throw new Zep.InternalServerError(
|
|
209
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
198
210
|
unrecognizedObjectKeys: "passthrough",
|
|
199
211
|
allowUnrecognizedUnionMembers: true,
|
|
200
212
|
allowUnrecognizedEnumValues: true,
|
|
@@ -215,7 +227,7 @@ class Document {
|
|
|
215
227
|
body: _response.error.rawBody,
|
|
216
228
|
});
|
|
217
229
|
case "timeout":
|
|
218
|
-
throw new errors.ZepTimeoutError();
|
|
230
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /collections/{collectionName}.");
|
|
219
231
|
case "unknown":
|
|
220
232
|
throw new errors.ZepError({
|
|
221
233
|
message: _response.error.errorMessage,
|
|
@@ -236,25 +248,24 @@ class Document {
|
|
|
236
248
|
* @throws {@link Zep.InternalServerError}
|
|
237
249
|
*
|
|
238
250
|
* @example
|
|
239
|
-
* await
|
|
251
|
+
* await client.document.addCollection("collectionName")
|
|
240
252
|
*/
|
|
241
|
-
addCollection(
|
|
242
|
-
|
|
243
|
-
|
|
253
|
+
addCollection(collectionName_1) {
|
|
254
|
+
return __awaiter(this, arguments, void 0, function* (collectionName, request = {}, requestOptions) {
|
|
255
|
+
var _a, _b;
|
|
244
256
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
245
257
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}`),
|
|
246
258
|
method: "POST",
|
|
247
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
259
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
248
260
|
contentType: "application/json",
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
}),
|
|
261
|
+
requestType: "json",
|
|
262
|
+
body: serializers.CreateDocumentCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
252
263
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
253
264
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
254
265
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
255
266
|
});
|
|
256
267
|
if (_response.ok) {
|
|
257
|
-
return
|
|
268
|
+
return serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
258
269
|
unrecognizedObjectKeys: "passthrough",
|
|
259
270
|
allowUnrecognizedUnionMembers: true,
|
|
260
271
|
allowUnrecognizedEnumValues: true,
|
|
@@ -265,7 +276,7 @@ class Document {
|
|
|
265
276
|
if (_response.error.reason === "status-code") {
|
|
266
277
|
switch (_response.error.statusCode) {
|
|
267
278
|
case 400:
|
|
268
|
-
throw new Zep.BadRequestError(
|
|
279
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
269
280
|
unrecognizedObjectKeys: "passthrough",
|
|
270
281
|
allowUnrecognizedUnionMembers: true,
|
|
271
282
|
allowUnrecognizedEnumValues: true,
|
|
@@ -273,7 +284,7 @@ class Document {
|
|
|
273
284
|
breadcrumbsPrefix: ["response"],
|
|
274
285
|
}));
|
|
275
286
|
case 401:
|
|
276
|
-
throw new Zep.UnauthorizedError(
|
|
287
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
277
288
|
unrecognizedObjectKeys: "passthrough",
|
|
278
289
|
allowUnrecognizedUnionMembers: true,
|
|
279
290
|
allowUnrecognizedEnumValues: true,
|
|
@@ -281,7 +292,7 @@ class Document {
|
|
|
281
292
|
breadcrumbsPrefix: ["response"],
|
|
282
293
|
}));
|
|
283
294
|
case 404:
|
|
284
|
-
throw new Zep.NotFoundError(
|
|
295
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
285
296
|
unrecognizedObjectKeys: "passthrough",
|
|
286
297
|
allowUnrecognizedUnionMembers: true,
|
|
287
298
|
allowUnrecognizedEnumValues: true,
|
|
@@ -289,7 +300,7 @@ class Document {
|
|
|
289
300
|
breadcrumbsPrefix: ["response"],
|
|
290
301
|
}));
|
|
291
302
|
case 500:
|
|
292
|
-
throw new Zep.InternalServerError(
|
|
303
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
293
304
|
unrecognizedObjectKeys: "passthrough",
|
|
294
305
|
allowUnrecognizedUnionMembers: true,
|
|
295
306
|
allowUnrecognizedEnumValues: true,
|
|
@@ -310,7 +321,7 @@ class Document {
|
|
|
310
321
|
body: _response.error.rawBody,
|
|
311
322
|
});
|
|
312
323
|
case "timeout":
|
|
313
|
-
throw new errors.ZepTimeoutError();
|
|
324
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /collections/{collectionName}.");
|
|
314
325
|
case "unknown":
|
|
315
326
|
throw new errors.ZepError({
|
|
316
327
|
message: _response.error.errorMessage,
|
|
@@ -330,22 +341,23 @@ class Document {
|
|
|
330
341
|
* @throws {@link Zep.InternalServerError}
|
|
331
342
|
*
|
|
332
343
|
* @example
|
|
333
|
-
* await
|
|
344
|
+
* await client.document.deleteCollection("collectionName")
|
|
334
345
|
*/
|
|
335
346
|
deleteCollection(collectionName, requestOptions) {
|
|
336
|
-
var _a, _b;
|
|
337
347
|
return __awaiter(this, void 0, void 0, function* () {
|
|
348
|
+
var _a, _b;
|
|
338
349
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
339
350
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}`),
|
|
340
351
|
method: "DELETE",
|
|
341
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
352
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
342
353
|
contentType: "application/json",
|
|
354
|
+
requestType: "json",
|
|
343
355
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
344
356
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
345
357
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
346
358
|
});
|
|
347
359
|
if (_response.ok) {
|
|
348
|
-
return
|
|
360
|
+
return serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
349
361
|
unrecognizedObjectKeys: "passthrough",
|
|
350
362
|
allowUnrecognizedUnionMembers: true,
|
|
351
363
|
allowUnrecognizedEnumValues: true,
|
|
@@ -356,7 +368,7 @@ class Document {
|
|
|
356
368
|
if (_response.error.reason === "status-code") {
|
|
357
369
|
switch (_response.error.statusCode) {
|
|
358
370
|
case 400:
|
|
359
|
-
throw new Zep.BadRequestError(
|
|
371
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
360
372
|
unrecognizedObjectKeys: "passthrough",
|
|
361
373
|
allowUnrecognizedUnionMembers: true,
|
|
362
374
|
allowUnrecognizedEnumValues: true,
|
|
@@ -364,7 +376,7 @@ class Document {
|
|
|
364
376
|
breadcrumbsPrefix: ["response"],
|
|
365
377
|
}));
|
|
366
378
|
case 401:
|
|
367
|
-
throw new Zep.UnauthorizedError(
|
|
379
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
368
380
|
unrecognizedObjectKeys: "passthrough",
|
|
369
381
|
allowUnrecognizedUnionMembers: true,
|
|
370
382
|
allowUnrecognizedEnumValues: true,
|
|
@@ -372,7 +384,7 @@ class Document {
|
|
|
372
384
|
breadcrumbsPrefix: ["response"],
|
|
373
385
|
}));
|
|
374
386
|
case 404:
|
|
375
|
-
throw new Zep.NotFoundError(
|
|
387
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
376
388
|
unrecognizedObjectKeys: "passthrough",
|
|
377
389
|
allowUnrecognizedUnionMembers: true,
|
|
378
390
|
allowUnrecognizedEnumValues: true,
|
|
@@ -380,7 +392,7 @@ class Document {
|
|
|
380
392
|
breadcrumbsPrefix: ["response"],
|
|
381
393
|
}));
|
|
382
394
|
case 500:
|
|
383
|
-
throw new Zep.InternalServerError(
|
|
395
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
384
396
|
unrecognizedObjectKeys: "passthrough",
|
|
385
397
|
allowUnrecognizedUnionMembers: true,
|
|
386
398
|
allowUnrecognizedEnumValues: true,
|
|
@@ -401,7 +413,7 @@ class Document {
|
|
|
401
413
|
body: _response.error.rawBody,
|
|
402
414
|
});
|
|
403
415
|
case "timeout":
|
|
404
|
-
throw new errors.ZepTimeoutError();
|
|
416
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /collections/{collectionName}.");
|
|
405
417
|
case "unknown":
|
|
406
418
|
throw new errors.ZepError({
|
|
407
419
|
message: _response.error.errorMessage,
|
|
@@ -422,25 +434,24 @@ class Document {
|
|
|
422
434
|
* @throws {@link Zep.InternalServerError}
|
|
423
435
|
*
|
|
424
436
|
* @example
|
|
425
|
-
* await
|
|
437
|
+
* await client.document.updateCollection("collectionName")
|
|
426
438
|
*/
|
|
427
|
-
updateCollection(
|
|
428
|
-
|
|
429
|
-
|
|
439
|
+
updateCollection(collectionName_1) {
|
|
440
|
+
return __awaiter(this, arguments, void 0, function* (collectionName, request = {}, requestOptions) {
|
|
441
|
+
var _a, _b;
|
|
430
442
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
431
443
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}`),
|
|
432
444
|
method: "PATCH",
|
|
433
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
445
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
434
446
|
contentType: "application/json",
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
}),
|
|
447
|
+
requestType: "json",
|
|
448
|
+
body: serializers.UpdateDocumentCollectionRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
438
449
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
439
450
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
440
451
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
441
452
|
});
|
|
442
453
|
if (_response.ok) {
|
|
443
|
-
return
|
|
454
|
+
return serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
444
455
|
unrecognizedObjectKeys: "passthrough",
|
|
445
456
|
allowUnrecognizedUnionMembers: true,
|
|
446
457
|
allowUnrecognizedEnumValues: true,
|
|
@@ -451,7 +462,7 @@ class Document {
|
|
|
451
462
|
if (_response.error.reason === "status-code") {
|
|
452
463
|
switch (_response.error.statusCode) {
|
|
453
464
|
case 400:
|
|
454
|
-
throw new Zep.BadRequestError(
|
|
465
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
455
466
|
unrecognizedObjectKeys: "passthrough",
|
|
456
467
|
allowUnrecognizedUnionMembers: true,
|
|
457
468
|
allowUnrecognizedEnumValues: true,
|
|
@@ -459,7 +470,7 @@ class Document {
|
|
|
459
470
|
breadcrumbsPrefix: ["response"],
|
|
460
471
|
}));
|
|
461
472
|
case 401:
|
|
462
|
-
throw new Zep.UnauthorizedError(
|
|
473
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
463
474
|
unrecognizedObjectKeys: "passthrough",
|
|
464
475
|
allowUnrecognizedUnionMembers: true,
|
|
465
476
|
allowUnrecognizedEnumValues: true,
|
|
@@ -467,7 +478,7 @@ class Document {
|
|
|
467
478
|
breadcrumbsPrefix: ["response"],
|
|
468
479
|
}));
|
|
469
480
|
case 404:
|
|
470
|
-
throw new Zep.NotFoundError(
|
|
481
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
471
482
|
unrecognizedObjectKeys: "passthrough",
|
|
472
483
|
allowUnrecognizedUnionMembers: true,
|
|
473
484
|
allowUnrecognizedEnumValues: true,
|
|
@@ -475,7 +486,7 @@ class Document {
|
|
|
475
486
|
breadcrumbsPrefix: ["response"],
|
|
476
487
|
}));
|
|
477
488
|
case 500:
|
|
478
|
-
throw new Zep.InternalServerError(
|
|
489
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
479
490
|
unrecognizedObjectKeys: "passthrough",
|
|
480
491
|
allowUnrecognizedUnionMembers: true,
|
|
481
492
|
allowUnrecognizedEnumValues: true,
|
|
@@ -496,7 +507,7 @@ class Document {
|
|
|
496
507
|
body: _response.error.rawBody,
|
|
497
508
|
});
|
|
498
509
|
case "timeout":
|
|
499
|
-
throw new errors.ZepTimeoutError();
|
|
510
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling PATCH /collections/{collectionName}.");
|
|
500
511
|
case "unknown":
|
|
501
512
|
throw new errors.ZepError({
|
|
502
513
|
message: _response.error.errorMessage,
|
|
@@ -516,27 +527,26 @@ class Document {
|
|
|
516
527
|
* @throws {@link Zep.InternalServerError}
|
|
517
528
|
*
|
|
518
529
|
* @example
|
|
519
|
-
* await
|
|
530
|
+
* await client.document.addDocuments("collectionName", [{
|
|
520
531
|
* content: "content"
|
|
521
532
|
* }])
|
|
522
533
|
*/
|
|
523
534
|
addDocuments(collectionName, request, requestOptions) {
|
|
524
|
-
var _a, _b;
|
|
525
535
|
return __awaiter(this, void 0, void 0, function* () {
|
|
536
|
+
var _a, _b;
|
|
526
537
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
527
538
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}/documents`),
|
|
528
539
|
method: "POST",
|
|
529
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
540
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
530
541
|
contentType: "application/json",
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
}),
|
|
542
|
+
requestType: "json",
|
|
543
|
+
body: serializers.document.addDocuments.Request.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
534
544
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
535
545
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
536
546
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
537
547
|
});
|
|
538
548
|
if (_response.ok) {
|
|
539
|
-
return
|
|
549
|
+
return serializers.document.addDocuments.Response.parseOrThrow(_response.body, {
|
|
540
550
|
unrecognizedObjectKeys: "passthrough",
|
|
541
551
|
allowUnrecognizedUnionMembers: true,
|
|
542
552
|
allowUnrecognizedEnumValues: true,
|
|
@@ -547,7 +557,7 @@ class Document {
|
|
|
547
557
|
if (_response.error.reason === "status-code") {
|
|
548
558
|
switch (_response.error.statusCode) {
|
|
549
559
|
case 400:
|
|
550
|
-
throw new Zep.BadRequestError(
|
|
560
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
551
561
|
unrecognizedObjectKeys: "passthrough",
|
|
552
562
|
allowUnrecognizedUnionMembers: true,
|
|
553
563
|
allowUnrecognizedEnumValues: true,
|
|
@@ -555,7 +565,7 @@ class Document {
|
|
|
555
565
|
breadcrumbsPrefix: ["response"],
|
|
556
566
|
}));
|
|
557
567
|
case 401:
|
|
558
|
-
throw new Zep.UnauthorizedError(
|
|
568
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
559
569
|
unrecognizedObjectKeys: "passthrough",
|
|
560
570
|
allowUnrecognizedUnionMembers: true,
|
|
561
571
|
allowUnrecognizedEnumValues: true,
|
|
@@ -563,7 +573,7 @@ class Document {
|
|
|
563
573
|
breadcrumbsPrefix: ["response"],
|
|
564
574
|
}));
|
|
565
575
|
case 500:
|
|
566
|
-
throw new Zep.InternalServerError(
|
|
576
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
567
577
|
unrecognizedObjectKeys: "passthrough",
|
|
568
578
|
allowUnrecognizedUnionMembers: true,
|
|
569
579
|
allowUnrecognizedEnumValues: true,
|
|
@@ -584,7 +594,7 @@ class Document {
|
|
|
584
594
|
body: _response.error.rawBody,
|
|
585
595
|
});
|
|
586
596
|
case "timeout":
|
|
587
|
-
throw new errors.ZepTimeoutError();
|
|
597
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /collections/{collectionName}/documents.");
|
|
588
598
|
case "unknown":
|
|
589
599
|
throw new errors.ZepError({
|
|
590
600
|
message: _response.error.errorMessage,
|
|
@@ -604,17 +614,18 @@ class Document {
|
|
|
604
614
|
* @throws {@link Zep.InternalServerError}
|
|
605
615
|
*
|
|
606
616
|
* @example
|
|
607
|
-
* await
|
|
617
|
+
* await client.document.batchDeleteDocuments("collectionName", ["string"])
|
|
608
618
|
*/
|
|
609
619
|
batchDeleteDocuments(collectionName, request, requestOptions) {
|
|
610
|
-
var _a, _b;
|
|
611
620
|
return __awaiter(this, void 0, void 0, function* () {
|
|
621
|
+
var _a, _b;
|
|
612
622
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
613
623
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}/documents/batchDelete`),
|
|
614
624
|
method: "POST",
|
|
615
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
625
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
616
626
|
contentType: "application/json",
|
|
617
|
-
|
|
627
|
+
requestType: "json",
|
|
628
|
+
body: serializers.document.batchDeleteDocuments.Request.jsonOrThrow(request, {
|
|
618
629
|
unrecognizedObjectKeys: "strip",
|
|
619
630
|
}),
|
|
620
631
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -622,7 +633,7 @@ class Document {
|
|
|
622
633
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
623
634
|
});
|
|
624
635
|
if (_response.ok) {
|
|
625
|
-
return
|
|
636
|
+
return serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
626
637
|
unrecognizedObjectKeys: "passthrough",
|
|
627
638
|
allowUnrecognizedUnionMembers: true,
|
|
628
639
|
allowUnrecognizedEnumValues: true,
|
|
@@ -633,7 +644,7 @@ class Document {
|
|
|
633
644
|
if (_response.error.reason === "status-code") {
|
|
634
645
|
switch (_response.error.statusCode) {
|
|
635
646
|
case 400:
|
|
636
|
-
throw new Zep.BadRequestError(
|
|
647
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
637
648
|
unrecognizedObjectKeys: "passthrough",
|
|
638
649
|
allowUnrecognizedUnionMembers: true,
|
|
639
650
|
allowUnrecognizedEnumValues: true,
|
|
@@ -641,7 +652,7 @@ class Document {
|
|
|
641
652
|
breadcrumbsPrefix: ["response"],
|
|
642
653
|
}));
|
|
643
654
|
case 401:
|
|
644
|
-
throw new Zep.UnauthorizedError(
|
|
655
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
645
656
|
unrecognizedObjectKeys: "passthrough",
|
|
646
657
|
allowUnrecognizedUnionMembers: true,
|
|
647
658
|
allowUnrecognizedEnumValues: true,
|
|
@@ -649,7 +660,7 @@ class Document {
|
|
|
649
660
|
breadcrumbsPrefix: ["response"],
|
|
650
661
|
}));
|
|
651
662
|
case 500:
|
|
652
|
-
throw new Zep.InternalServerError(
|
|
663
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
653
664
|
unrecognizedObjectKeys: "passthrough",
|
|
654
665
|
allowUnrecognizedUnionMembers: true,
|
|
655
666
|
allowUnrecognizedEnumValues: true,
|
|
@@ -670,7 +681,7 @@ class Document {
|
|
|
670
681
|
body: _response.error.rawBody,
|
|
671
682
|
});
|
|
672
683
|
case "timeout":
|
|
673
|
-
throw new errors.ZepTimeoutError();
|
|
684
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /collections/{collectionName}/documents/batchDelete.");
|
|
674
685
|
case "unknown":
|
|
675
686
|
throw new errors.ZepError({
|
|
676
687
|
message: _response.error.errorMessage,
|
|
@@ -690,23 +701,24 @@ class Document {
|
|
|
690
701
|
* @throws {@link Zep.InternalServerError}
|
|
691
702
|
*
|
|
692
703
|
* @example
|
|
693
|
-
* await
|
|
704
|
+
* await client.document.batchGetDocuments("collectionName")
|
|
694
705
|
*/
|
|
695
|
-
batchGetDocuments(
|
|
696
|
-
|
|
697
|
-
|
|
706
|
+
batchGetDocuments(collectionName_1) {
|
|
707
|
+
return __awaiter(this, arguments, void 0, function* (collectionName, request = {}, requestOptions) {
|
|
708
|
+
var _a, _b;
|
|
698
709
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
699
710
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}/documents/batchGet`),
|
|
700
711
|
method: "POST",
|
|
701
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
712
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
702
713
|
contentType: "application/json",
|
|
703
|
-
|
|
714
|
+
requestType: "json",
|
|
715
|
+
body: serializers.GetDocumentListRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
704
716
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
705
717
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
706
718
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
707
719
|
});
|
|
708
720
|
if (_response.ok) {
|
|
709
|
-
return
|
|
721
|
+
return serializers.document.batchGetDocuments.Response.parseOrThrow(_response.body, {
|
|
710
722
|
unrecognizedObjectKeys: "passthrough",
|
|
711
723
|
allowUnrecognizedUnionMembers: true,
|
|
712
724
|
allowUnrecognizedEnumValues: true,
|
|
@@ -717,7 +729,7 @@ class Document {
|
|
|
717
729
|
if (_response.error.reason === "status-code") {
|
|
718
730
|
switch (_response.error.statusCode) {
|
|
719
731
|
case 400:
|
|
720
|
-
throw new Zep.BadRequestError(
|
|
732
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
721
733
|
unrecognizedObjectKeys: "passthrough",
|
|
722
734
|
allowUnrecognizedUnionMembers: true,
|
|
723
735
|
allowUnrecognizedEnumValues: true,
|
|
@@ -725,7 +737,7 @@ class Document {
|
|
|
725
737
|
breadcrumbsPrefix: ["response"],
|
|
726
738
|
}));
|
|
727
739
|
case 401:
|
|
728
|
-
throw new Zep.UnauthorizedError(
|
|
740
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
729
741
|
unrecognizedObjectKeys: "passthrough",
|
|
730
742
|
allowUnrecognizedUnionMembers: true,
|
|
731
743
|
allowUnrecognizedEnumValues: true,
|
|
@@ -733,7 +745,7 @@ class Document {
|
|
|
733
745
|
breadcrumbsPrefix: ["response"],
|
|
734
746
|
}));
|
|
735
747
|
case 500:
|
|
736
|
-
throw new Zep.InternalServerError(
|
|
748
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
737
749
|
unrecognizedObjectKeys: "passthrough",
|
|
738
750
|
allowUnrecognizedUnionMembers: true,
|
|
739
751
|
allowUnrecognizedEnumValues: true,
|
|
@@ -754,7 +766,7 @@ class Document {
|
|
|
754
766
|
body: _response.error.rawBody,
|
|
755
767
|
});
|
|
756
768
|
case "timeout":
|
|
757
|
-
throw new errors.ZepTimeoutError();
|
|
769
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /collections/{collectionName}/documents/batchGet.");
|
|
758
770
|
case "unknown":
|
|
759
771
|
throw new errors.ZepError({
|
|
760
772
|
message: _response.error.errorMessage,
|
|
@@ -774,19 +786,20 @@ class Document {
|
|
|
774
786
|
* @throws {@link Zep.InternalServerError}
|
|
775
787
|
*
|
|
776
788
|
* @example
|
|
777
|
-
* await
|
|
789
|
+
* await client.document.batchUpdateDocuments("collectionName", [{
|
|
778
790
|
* uuid: "uuid"
|
|
779
791
|
* }])
|
|
780
792
|
*/
|
|
781
793
|
batchUpdateDocuments(collectionName, request, requestOptions) {
|
|
782
|
-
var _a, _b;
|
|
783
794
|
return __awaiter(this, void 0, void 0, function* () {
|
|
795
|
+
var _a, _b;
|
|
784
796
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
785
797
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}/documents/batchUpdate`),
|
|
786
798
|
method: "PATCH",
|
|
787
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
799
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
788
800
|
contentType: "application/json",
|
|
789
|
-
|
|
801
|
+
requestType: "json",
|
|
802
|
+
body: serializers.document.batchUpdateDocuments.Request.jsonOrThrow(request, {
|
|
790
803
|
unrecognizedObjectKeys: "strip",
|
|
791
804
|
}),
|
|
792
805
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -794,7 +807,7 @@ class Document {
|
|
|
794
807
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
795
808
|
});
|
|
796
809
|
if (_response.ok) {
|
|
797
|
-
return
|
|
810
|
+
return serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
798
811
|
unrecognizedObjectKeys: "passthrough",
|
|
799
812
|
allowUnrecognizedUnionMembers: true,
|
|
800
813
|
allowUnrecognizedEnumValues: true,
|
|
@@ -805,7 +818,7 @@ class Document {
|
|
|
805
818
|
if (_response.error.reason === "status-code") {
|
|
806
819
|
switch (_response.error.statusCode) {
|
|
807
820
|
case 400:
|
|
808
|
-
throw new Zep.BadRequestError(
|
|
821
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
809
822
|
unrecognizedObjectKeys: "passthrough",
|
|
810
823
|
allowUnrecognizedUnionMembers: true,
|
|
811
824
|
allowUnrecognizedEnumValues: true,
|
|
@@ -813,7 +826,7 @@ class Document {
|
|
|
813
826
|
breadcrumbsPrefix: ["response"],
|
|
814
827
|
}));
|
|
815
828
|
case 401:
|
|
816
|
-
throw new Zep.UnauthorizedError(
|
|
829
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
817
830
|
unrecognizedObjectKeys: "passthrough",
|
|
818
831
|
allowUnrecognizedUnionMembers: true,
|
|
819
832
|
allowUnrecognizedEnumValues: true,
|
|
@@ -821,7 +834,7 @@ class Document {
|
|
|
821
834
|
breadcrumbsPrefix: ["response"],
|
|
822
835
|
}));
|
|
823
836
|
case 500:
|
|
824
|
-
throw new Zep.InternalServerError(
|
|
837
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
825
838
|
unrecognizedObjectKeys: "passthrough",
|
|
826
839
|
allowUnrecognizedUnionMembers: true,
|
|
827
840
|
allowUnrecognizedEnumValues: true,
|
|
@@ -842,7 +855,7 @@ class Document {
|
|
|
842
855
|
body: _response.error.rawBody,
|
|
843
856
|
});
|
|
844
857
|
case "timeout":
|
|
845
|
-
throw new errors.ZepTimeoutError();
|
|
858
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling PATCH /collections/{collectionName}/documents/batchUpdate.");
|
|
846
859
|
case "unknown":
|
|
847
860
|
throw new errors.ZepError({
|
|
848
861
|
message: _response.error.errorMessage,
|
|
@@ -862,22 +875,23 @@ class Document {
|
|
|
862
875
|
* @throws {@link Zep.InternalServerError}
|
|
863
876
|
*
|
|
864
877
|
* @example
|
|
865
|
-
* await
|
|
878
|
+
* await client.document.getsADocumentFromADocumentCollectionByUuidCloudOnly("collectionName", "documentUUID")
|
|
866
879
|
*/
|
|
867
880
|
getsADocumentFromADocumentCollectionByUuidCloudOnly(collectionName, documentUuid, requestOptions) {
|
|
868
|
-
var _a, _b;
|
|
869
881
|
return __awaiter(this, void 0, void 0, function* () {
|
|
882
|
+
var _a, _b;
|
|
870
883
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
871
884
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}/documents/uuid/${encodeURIComponent(documentUuid)}`),
|
|
872
885
|
method: "GET",
|
|
873
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
886
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
874
887
|
contentType: "application/json",
|
|
888
|
+
requestType: "json",
|
|
875
889
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
876
890
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
877
891
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
878
892
|
});
|
|
879
893
|
if (_response.ok) {
|
|
880
|
-
return
|
|
894
|
+
return serializers.ApidataDocument.parseOrThrow(_response.body, {
|
|
881
895
|
unrecognizedObjectKeys: "passthrough",
|
|
882
896
|
allowUnrecognizedUnionMembers: true,
|
|
883
897
|
allowUnrecognizedEnumValues: true,
|
|
@@ -888,7 +902,7 @@ class Document {
|
|
|
888
902
|
if (_response.error.reason === "status-code") {
|
|
889
903
|
switch (_response.error.statusCode) {
|
|
890
904
|
case 400:
|
|
891
|
-
throw new Zep.BadRequestError(
|
|
905
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
892
906
|
unrecognizedObjectKeys: "passthrough",
|
|
893
907
|
allowUnrecognizedUnionMembers: true,
|
|
894
908
|
allowUnrecognizedEnumValues: true,
|
|
@@ -896,7 +910,7 @@ class Document {
|
|
|
896
910
|
breadcrumbsPrefix: ["response"],
|
|
897
911
|
}));
|
|
898
912
|
case 401:
|
|
899
|
-
throw new Zep.UnauthorizedError(
|
|
913
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
900
914
|
unrecognizedObjectKeys: "passthrough",
|
|
901
915
|
allowUnrecognizedUnionMembers: true,
|
|
902
916
|
allowUnrecognizedEnumValues: true,
|
|
@@ -904,7 +918,7 @@ class Document {
|
|
|
904
918
|
breadcrumbsPrefix: ["response"],
|
|
905
919
|
}));
|
|
906
920
|
case 500:
|
|
907
|
-
throw new Zep.InternalServerError(
|
|
921
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
908
922
|
unrecognizedObjectKeys: "passthrough",
|
|
909
923
|
allowUnrecognizedUnionMembers: true,
|
|
910
924
|
allowUnrecognizedEnumValues: true,
|
|
@@ -925,7 +939,7 @@ class Document {
|
|
|
925
939
|
body: _response.error.rawBody,
|
|
926
940
|
});
|
|
927
941
|
case "timeout":
|
|
928
|
-
throw new errors.ZepTimeoutError();
|
|
942
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling GET /collections/{collectionName}/documents/uuid/{documentUUID}.");
|
|
929
943
|
case "unknown":
|
|
930
944
|
throw new errors.ZepError({
|
|
931
945
|
message: _response.error.errorMessage,
|
|
@@ -946,22 +960,23 @@ class Document {
|
|
|
946
960
|
* @throws {@link Zep.InternalServerError}
|
|
947
961
|
*
|
|
948
962
|
* @example
|
|
949
|
-
* await
|
|
963
|
+
* await client.document.deleteDocument("collectionName", "documentUUID")
|
|
950
964
|
*/
|
|
951
965
|
deleteDocument(collectionName, documentUuid, requestOptions) {
|
|
952
|
-
var _a, _b;
|
|
953
966
|
return __awaiter(this, void 0, void 0, function* () {
|
|
967
|
+
var _a, _b;
|
|
954
968
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
955
969
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}/documents/uuid/${encodeURIComponent(documentUuid)}`),
|
|
956
970
|
method: "DELETE",
|
|
957
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
971
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
958
972
|
contentType: "application/json",
|
|
973
|
+
requestType: "json",
|
|
959
974
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
960
975
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
961
976
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
962
977
|
});
|
|
963
978
|
if (_response.ok) {
|
|
964
|
-
return
|
|
979
|
+
return serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
965
980
|
unrecognizedObjectKeys: "passthrough",
|
|
966
981
|
allowUnrecognizedUnionMembers: true,
|
|
967
982
|
allowUnrecognizedEnumValues: true,
|
|
@@ -972,7 +987,7 @@ class Document {
|
|
|
972
987
|
if (_response.error.reason === "status-code") {
|
|
973
988
|
switch (_response.error.statusCode) {
|
|
974
989
|
case 400:
|
|
975
|
-
throw new Zep.BadRequestError(
|
|
990
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
976
991
|
unrecognizedObjectKeys: "passthrough",
|
|
977
992
|
allowUnrecognizedUnionMembers: true,
|
|
978
993
|
allowUnrecognizedEnumValues: true,
|
|
@@ -980,7 +995,7 @@ class Document {
|
|
|
980
995
|
breadcrumbsPrefix: ["response"],
|
|
981
996
|
}));
|
|
982
997
|
case 401:
|
|
983
|
-
throw new Zep.UnauthorizedError(
|
|
998
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
984
999
|
unrecognizedObjectKeys: "passthrough",
|
|
985
1000
|
allowUnrecognizedUnionMembers: true,
|
|
986
1001
|
allowUnrecognizedEnumValues: true,
|
|
@@ -988,7 +1003,7 @@ class Document {
|
|
|
988
1003
|
breadcrumbsPrefix: ["response"],
|
|
989
1004
|
}));
|
|
990
1005
|
case 404:
|
|
991
|
-
throw new Zep.NotFoundError(
|
|
1006
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
992
1007
|
unrecognizedObjectKeys: "passthrough",
|
|
993
1008
|
allowUnrecognizedUnionMembers: true,
|
|
994
1009
|
allowUnrecognizedEnumValues: true,
|
|
@@ -996,7 +1011,7 @@ class Document {
|
|
|
996
1011
|
breadcrumbsPrefix: ["response"],
|
|
997
1012
|
}));
|
|
998
1013
|
case 500:
|
|
999
|
-
throw new Zep.InternalServerError(
|
|
1014
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1000
1015
|
unrecognizedObjectKeys: "passthrough",
|
|
1001
1016
|
allowUnrecognizedUnionMembers: true,
|
|
1002
1017
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1017,7 +1032,7 @@ class Document {
|
|
|
1017
1032
|
body: _response.error.rawBody,
|
|
1018
1033
|
});
|
|
1019
1034
|
case "timeout":
|
|
1020
|
-
throw new errors.ZepTimeoutError();
|
|
1035
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling DELETE /collections/{collectionName}/documents/uuid/{documentUUID}.");
|
|
1021
1036
|
case "unknown":
|
|
1022
1037
|
throw new errors.ZepError({
|
|
1023
1038
|
message: _response.error.errorMessage,
|
|
@@ -1039,23 +1054,24 @@ class Document {
|
|
|
1039
1054
|
* @throws {@link Zep.InternalServerError}
|
|
1040
1055
|
*
|
|
1041
1056
|
* @example
|
|
1042
|
-
* await
|
|
1057
|
+
* await client.document.updatesADocumentCloudOnly("collectionName", "documentUUID")
|
|
1043
1058
|
*/
|
|
1044
|
-
updatesADocumentCloudOnly(
|
|
1045
|
-
|
|
1046
|
-
|
|
1059
|
+
updatesADocumentCloudOnly(collectionName_1, documentUuid_1) {
|
|
1060
|
+
return __awaiter(this, arguments, void 0, function* (collectionName, documentUuid, request = {}, requestOptions) {
|
|
1061
|
+
var _a, _b;
|
|
1047
1062
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1048
1063
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}/documents/uuid/${encodeURIComponent(documentUuid)}`),
|
|
1049
1064
|
method: "PATCH",
|
|
1050
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1065
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1051
1066
|
contentType: "application/json",
|
|
1052
|
-
|
|
1067
|
+
requestType: "json",
|
|
1068
|
+
body: serializers.UpdateDocumentRequest.jsonOrThrow(request, { unrecognizedObjectKeys: "strip" }),
|
|
1053
1069
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1054
1070
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1055
1071
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1056
1072
|
});
|
|
1057
1073
|
if (_response.ok) {
|
|
1058
|
-
return
|
|
1074
|
+
return serializers.SuccessResponse.parseOrThrow(_response.body, {
|
|
1059
1075
|
unrecognizedObjectKeys: "passthrough",
|
|
1060
1076
|
allowUnrecognizedUnionMembers: true,
|
|
1061
1077
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1066,7 +1082,7 @@ class Document {
|
|
|
1066
1082
|
if (_response.error.reason === "status-code") {
|
|
1067
1083
|
switch (_response.error.statusCode) {
|
|
1068
1084
|
case 400:
|
|
1069
|
-
throw new Zep.BadRequestError(
|
|
1085
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1070
1086
|
unrecognizedObjectKeys: "passthrough",
|
|
1071
1087
|
allowUnrecognizedUnionMembers: true,
|
|
1072
1088
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1074,7 +1090,7 @@ class Document {
|
|
|
1074
1090
|
breadcrumbsPrefix: ["response"],
|
|
1075
1091
|
}));
|
|
1076
1092
|
case 401:
|
|
1077
|
-
throw new Zep.UnauthorizedError(
|
|
1093
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1078
1094
|
unrecognizedObjectKeys: "passthrough",
|
|
1079
1095
|
allowUnrecognizedUnionMembers: true,
|
|
1080
1096
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1082,7 +1098,7 @@ class Document {
|
|
|
1082
1098
|
breadcrumbsPrefix: ["response"],
|
|
1083
1099
|
}));
|
|
1084
1100
|
case 404:
|
|
1085
|
-
throw new Zep.NotFoundError(
|
|
1101
|
+
throw new Zep.NotFoundError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1086
1102
|
unrecognizedObjectKeys: "passthrough",
|
|
1087
1103
|
allowUnrecognizedUnionMembers: true,
|
|
1088
1104
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1090,7 +1106,7 @@ class Document {
|
|
|
1090
1106
|
breadcrumbsPrefix: ["response"],
|
|
1091
1107
|
}));
|
|
1092
1108
|
case 500:
|
|
1093
|
-
throw new Zep.InternalServerError(
|
|
1109
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1094
1110
|
unrecognizedObjectKeys: "passthrough",
|
|
1095
1111
|
allowUnrecognizedUnionMembers: true,
|
|
1096
1112
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1111,7 +1127,7 @@ class Document {
|
|
|
1111
1127
|
body: _response.error.rawBody,
|
|
1112
1128
|
});
|
|
1113
1129
|
case "timeout":
|
|
1114
|
-
throw new errors.ZepTimeoutError();
|
|
1130
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling PATCH /collections/{collectionName}/documents/uuid/{documentUUID}.");
|
|
1115
1131
|
case "unknown":
|
|
1116
1132
|
throw new errors.ZepError({
|
|
1117
1133
|
message: _response.error.errorMessage,
|
|
@@ -1131,11 +1147,11 @@ class Document {
|
|
|
1131
1147
|
* @throws {@link Zep.InternalServerError}
|
|
1132
1148
|
*
|
|
1133
1149
|
* @example
|
|
1134
|
-
* await
|
|
1150
|
+
* await client.document.search("collectionName")
|
|
1135
1151
|
*/
|
|
1136
|
-
search(
|
|
1137
|
-
|
|
1138
|
-
|
|
1152
|
+
search(collectionName_1) {
|
|
1153
|
+
return __awaiter(this, arguments, void 0, function* (collectionName, request = {}, requestOptions) {
|
|
1154
|
+
var _a, _b;
|
|
1139
1155
|
const { limit } = request, _body = __rest(request, ["limit"]);
|
|
1140
1156
|
const _queryParams = {};
|
|
1141
1157
|
if (limit != null) {
|
|
@@ -1144,16 +1160,17 @@ class Document {
|
|
|
1144
1160
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
1145
1161
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ZepEnvironment.Default, `collections/${encodeURIComponent(collectionName)}/search`),
|
|
1146
1162
|
method: "POST",
|
|
1147
|
-
headers: Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.2.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
1163
|
+
headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "zep-cloud", "X-Fern-SDK-Version": "2.3.0", "User-Agent": "zep-cloud/2.3.0", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
1148
1164
|
contentType: "application/json",
|
|
1149
1165
|
queryParameters: _queryParams,
|
|
1150
|
-
|
|
1166
|
+
requestType: "json",
|
|
1167
|
+
body: serializers.DocumentSearchPayload.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
1151
1168
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
1152
1169
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
1153
1170
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
1154
1171
|
});
|
|
1155
1172
|
if (_response.ok) {
|
|
1156
|
-
return
|
|
1173
|
+
return serializers.ApidataDocumentSearchResponse.parseOrThrow(_response.body, {
|
|
1157
1174
|
unrecognizedObjectKeys: "passthrough",
|
|
1158
1175
|
allowUnrecognizedUnionMembers: true,
|
|
1159
1176
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1164,7 +1181,7 @@ class Document {
|
|
|
1164
1181
|
if (_response.error.reason === "status-code") {
|
|
1165
1182
|
switch (_response.error.statusCode) {
|
|
1166
1183
|
case 400:
|
|
1167
|
-
throw new Zep.BadRequestError(
|
|
1184
|
+
throw new Zep.BadRequestError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1168
1185
|
unrecognizedObjectKeys: "passthrough",
|
|
1169
1186
|
allowUnrecognizedUnionMembers: true,
|
|
1170
1187
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1172,7 +1189,7 @@ class Document {
|
|
|
1172
1189
|
breadcrumbsPrefix: ["response"],
|
|
1173
1190
|
}));
|
|
1174
1191
|
case 401:
|
|
1175
|
-
throw new Zep.UnauthorizedError(
|
|
1192
|
+
throw new Zep.UnauthorizedError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1176
1193
|
unrecognizedObjectKeys: "passthrough",
|
|
1177
1194
|
allowUnrecognizedUnionMembers: true,
|
|
1178
1195
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1180,7 +1197,7 @@ class Document {
|
|
|
1180
1197
|
breadcrumbsPrefix: ["response"],
|
|
1181
1198
|
}));
|
|
1182
1199
|
case 500:
|
|
1183
|
-
throw new Zep.InternalServerError(
|
|
1200
|
+
throw new Zep.InternalServerError(serializers.ApiError.parseOrThrow(_response.error.body, {
|
|
1184
1201
|
unrecognizedObjectKeys: "passthrough",
|
|
1185
1202
|
allowUnrecognizedUnionMembers: true,
|
|
1186
1203
|
allowUnrecognizedEnumValues: true,
|
|
@@ -1201,7 +1218,7 @@ class Document {
|
|
|
1201
1218
|
body: _response.error.rawBody,
|
|
1202
1219
|
});
|
|
1203
1220
|
case "timeout":
|
|
1204
|
-
throw new errors.ZepTimeoutError();
|
|
1221
|
+
throw new errors.ZepTimeoutError("Timeout exceeded when calling POST /collections/{collectionName}/search.");
|
|
1205
1222
|
case "unknown":
|
|
1206
1223
|
throw new errors.ZepError({
|
|
1207
1224
|
message: _response.error.errorMessage,
|
|
@@ -1210,8 +1227,8 @@ class Document {
|
|
|
1210
1227
|
});
|
|
1211
1228
|
}
|
|
1212
1229
|
_getCustomAuthorizationHeaders() {
|
|
1213
|
-
var _a;
|
|
1214
1230
|
return __awaiter(this, void 0, void 0, function* () {
|
|
1231
|
+
var _a;
|
|
1215
1232
|
const apiKeyValue = (_a = (yield core.Supplier.get(this._options.apiKey))) !== null && _a !== void 0 ? _a : process === null || process === void 0 ? void 0 : process.env["ZEP_API_KEY"];
|
|
1216
1233
|
return { Authorization: `Api-Key ${apiKeyValue}` };
|
|
1217
1234
|
});
|