@hydradb/sdk 0.0.2 → 2.0.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/README.md +526 -354
- package/dist/BaseClient.d.ts +6 -2
- package/dist/BaseClient.js +31 -15
- package/dist/Client.d.ts +28 -32
- package/dist/Client.js +99 -73
- package/dist/api/client/requests/QueryRequest.d.ts +40 -0
- package/dist/api/client/requests/index.d.ts +1 -0
- package/dist/api/errors/BadRequestError.js +17 -7
- package/dist/api/errors/ForbiddenError.js +17 -7
- package/dist/api/errors/InternalServerError.js +17 -7
- package/dist/api/errors/NotFoundError.js +17 -7
- package/dist/api/errors/ServiceUnavailableError.js +17 -7
- package/dist/api/errors/TooManyRequestsError.d.ts +1 -2
- package/dist/api/errors/TooManyRequestsError.js +17 -7
- package/dist/api/errors/UnauthorizedError.js +17 -7
- package/dist/api/errors/UnprocessableEntityError.js +17 -7
- package/dist/api/index.d.ts +1 -0
- package/dist/api/index.js +1 -0
- package/dist/api/resources/context/client/Client.d.ts +131 -0
- package/dist/api/resources/context/client/Client.js +587 -0
- package/dist/api/resources/context/client/requests/BodyIngestContextIngestPost.d.ts +26 -0
- package/dist/api/resources/context/client/requests/InspectContextRequest.d.ts +20 -0
- package/dist/api/resources/{fetch/client/requests/GraphRelationsBySourceIdFetchRequest.d.ts → context/client/requests/RelationsContextRequest.d.ts} +10 -9
- package/dist/api/resources/context/client/requests/StatusContextRequest.d.ts +16 -0
- package/dist/api/resources/context/client/requests/V2ListContentRequest.d.ts +25 -0
- package/dist/api/resources/context/client/requests/V2SourceDeleteRequest.d.ts +16 -0
- package/dist/api/resources/context/client/requests/index.d.ts +6 -0
- package/dist/api/resources/context/exports.d.ts +2 -0
- package/dist/api/resources/{recall → context}/exports.js +2 -2
- package/dist/api/resources/index.d.ts +6 -19
- package/dist/api/resources/index.js +24 -27
- package/dist/api/resources/{tenant → tenants}/client/Client.d.ts +39 -39
- package/dist/api/resources/{tenant → tenants}/client/Client.js +204 -130
- package/dist/api/resources/tenants/client/requests/DeleteTenantsRequest.d.ts +10 -0
- package/dist/api/resources/tenants/client/requests/StatsTenantsRequest.d.ts +10 -0
- package/dist/api/resources/tenants/client/requests/StatusTenantsRequest.d.ts +10 -0
- package/dist/api/resources/tenants/client/requests/SubTenantsTenantsRequest.d.ts +10 -0
- package/dist/api/resources/tenants/client/requests/index.d.ts +4 -0
- package/dist/api/resources/tenants/exports.d.ts +2 -0
- package/dist/api/resources/{data → tenants}/exports.js +2 -2
- package/dist/api/resources/webhooks/client/Client.d.ts +87 -0
- package/dist/api/resources/webhooks/client/Client.js +429 -0
- package/dist/api/resources/webhooks/client/requests/GetDeliveryWebhooksRequest.d.ts +9 -0
- package/dist/api/resources/webhooks/client/requests/ListDeliveriesWebhooksRequest.d.ts +12 -0
- package/dist/api/resources/webhooks/client/requests/RetryDeliveryWebhooksRequest.d.ts +9 -0
- package/dist/api/resources/webhooks/client/requests/index.d.ts +3 -0
- package/dist/api/resources/webhooks/exports.d.ts +2 -0
- package/dist/api/resources/{fetch → webhooks}/exports.js +2 -2
- package/dist/api/types/CollectionStats.d.ts +1 -1
- package/dist/api/types/ContentFilter.d.ts +9 -5
- package/dist/api/types/CustomPropertyDefinition.d.ts +7 -7
- package/dist/api/types/DeleteUserMemoryResponse.d.ts +2 -2
- package/dist/api/types/DeliveryItem.d.ts +12 -0
- package/dist/api/types/DeliveryListResponse.d.ts +7 -0
- package/dist/api/types/Entity.d.ts +3 -3
- package/dist/api/types/ErrorDetail.d.ts +4 -0
- package/dist/api/types/GraphContext.d.ts +4 -4
- package/dist/api/types/InfraStatusResponseV2.d.ts +17 -0
- package/dist/api/types/InfraV2.d.ts +11 -0
- package/dist/api/types/IngestType.d.ts +5 -0
- package/dist/api/types/{ListContentKind.js → IngestType.js} +3 -3
- package/dist/api/types/ListUserMemoriesResponse.d.ts +3 -3
- package/dist/api/types/PaginationMeta.d.ts +4 -4
- package/dist/api/types/QueryApiResponse.d.ts +7 -0
- package/dist/api/types/QueryBy.d.ts +6 -0
- package/dist/api/types/QueryBy.js +9 -0
- package/dist/api/types/QueryRequestAlpha.d.ts +4 -0
- package/dist/api/types/RelationEvidence.d.ts +9 -9
- package/dist/api/types/ResponseMeta.d.ts +4 -0
- package/dist/api/types/RetryResponse.d.ts +5 -0
- package/dist/api/types/ScoredPathResponse.d.ts +4 -4
- package/dist/api/types/SourceDeleteApiResponse.d.ts +7 -0
- package/dist/api/types/SourceDeleteApiResponseData.d.ts +2 -0
- package/dist/api/types/SourceDeleteResponse.d.ts +4 -4
- package/dist/api/types/SourceDeleteResultItem.d.ts +2 -2
- package/dist/api/types/SourceFetchApiResponse.d.ts +7 -0
- package/dist/api/types/SourceGraphRelationsResponse.d.ts +4 -4
- package/dist/api/types/SourceInfo.d.ts +13 -7
- package/dist/api/types/SourceIngestApiResponse.d.ts +7 -0
- package/dist/api/types/SourceIngestApiResponseData.d.ts +2 -0
- package/dist/api/types/SourceListApiResponse.d.ts +7 -0
- package/dist/api/types/SourceListApiResponseData.d.ts +2 -0
- package/dist/api/types/SourceRelationsApiResponse.d.ts +7 -0
- package/dist/api/types/SourceStatusApiResponse.d.ts +7 -0
- package/dist/api/types/SourceType.d.ts +7 -0
- package/dist/api/types/SourceType.js +10 -0
- package/dist/api/types/SubTenantIdsResponse.d.ts +2 -2
- package/dist/api/types/TenantCreateAcceptedResponse.d.ts +3 -3
- package/dist/api/types/TenantCreateApiResponse.d.ts +7 -0
- package/dist/api/{resources/tenant/client/requests → types}/TenantCreateRequest.d.ts +9 -9
- package/dist/api/types/TenantDeleteApiResponse.d.ts +7 -0
- package/dist/api/types/TenantDeleteResponse.d.ts +3 -3
- package/dist/api/types/TenantIdsResponse.d.ts +3 -3
- package/dist/api/types/TenantInfraStatusApiResponse.d.ts +7 -0
- package/dist/api/types/TenantListApiResponse.d.ts +7 -0
- package/dist/api/types/TenantStatsApiResponse.d.ts +7 -0
- package/dist/api/types/TenantStatsResponse.d.ts +5 -5
- package/dist/api/types/TenantSubTenantsApiResponse.d.ts +7 -0
- package/dist/api/types/TripletWithEvidence.d.ts +1 -1
- package/dist/api/types/UserMemory.d.ts +4 -2
- package/dist/api/types/V2AddMemoryResponse.d.ts +11 -0
- package/dist/api/types/V2BatchProcessingStatus.d.ts +5 -0
- package/dist/api/types/V2Chunk.d.ts +29 -0
- package/dist/api/types/{MemoryResultItem.d.ts → V2MemoryResultItem.d.ts} +8 -9
- package/dist/api/types/V2ProcessingStatus.d.ts +18 -0
- package/dist/api/types/V2ProcessingStatusIndexingStatus.d.ts +10 -0
- package/dist/api/types/V2ProcessingStatusIndexingStatus.js +13 -0
- package/dist/api/types/V2RetrievalResult.d.ts +12 -0
- package/dist/api/types/V2SourceFetchResponse.d.ts +23 -0
- package/dist/api/types/V2SourceListResponse.d.ts +1 -0
- package/dist/api/types/V2SourceUploadResponse.d.ts +11 -0
- package/dist/api/types/V2SourceUploadResultItem.d.ts +13 -0
- package/dist/api/types/VectorstoreStatus.d.ts +6 -0
- package/dist/api/types/WebhookDeleteApiResponse.d.ts +7 -0
- package/dist/api/types/WebhookDeleteResponse.d.ts +4 -0
- package/dist/api/types/WebhookDeliveryItemApiResponse.d.ts +7 -0
- package/dist/api/types/WebhookDeliveryListApiResponse.d.ts +7 -0
- package/dist/api/types/WebhookGetApiResponse.d.ts +7 -0
- package/dist/api/types/WebhookGetResponse.d.ts +6 -0
- package/dist/api/types/WebhookRegisterApiResponse.d.ts +7 -0
- package/dist/api/types/WebhookRegisterRequest.d.ts +8 -0
- package/dist/api/types/WebhookRegisterRequest.js +3 -0
- package/dist/api/types/WebhookRegisterResponse.d.ts +7 -0
- package/dist/api/types/WebhookRegisterResponse.js +3 -0
- package/dist/api/types/WebhookRetryApiResponse.d.ts +7 -0
- package/dist/api/types/WebhookRetryApiResponse.js +3 -0
- package/dist/api/types/WebhookTestApiResponse.d.ts +7 -0
- package/dist/api/types/WebhookTestApiResponse.js +3 -0
- package/dist/api/types/WebhookTestResponse.d.ts +5 -0
- package/dist/api/types/WebhookTestResponse.js +3 -0
- package/dist/api/types/index.d.ts +52 -39
- package/dist/api/types/index.js +52 -39
- package/dist/auth/BearerAuthProvider.d.ts +1 -1
- package/dist/auth/BearerAuthProvider.js +18 -8
- package/dist/core/auth/AuthProvider.js +1 -2
- package/dist/core/auth/BasicAuth.js +2 -3
- package/dist/core/base64.js +2 -3
- package/dist/core/fetcher/BinaryResponse.js +1 -2
- package/dist/core/fetcher/Fetcher.js +7 -9
- package/dist/core/fetcher/Headers.d.ts +1 -2
- package/dist/core/fetcher/Headers.js +3 -11
- package/dist/core/fetcher/RawResponse.js +2 -2
- package/dist/core/fetcher/createRequestUrl.js +1 -2
- package/dist/core/fetcher/getErrorResponseBody.js +3 -5
- package/dist/core/fetcher/getFetchFn.js +1 -2
- package/dist/core/fetcher/getHeader.js +1 -2
- package/dist/core/fetcher/getRequestBody.js +1 -2
- package/dist/core/fetcher/getResponseBody.js +1 -2
- package/dist/core/fetcher/makePassthroughRequest.js +12 -13
- package/dist/core/fetcher/makeRequest.js +13 -6
- package/dist/core/fetcher/requestWithRetries.js +1 -2
- package/dist/core/fetcher/signals.js +4 -5
- package/dist/core/file/file.js +29 -21
- package/dist/core/file/types.d.ts +0 -4
- package/dist/core/form-data-utils/FormDataWrapper.js +22 -32
- package/dist/core/form-data-utils/encodeAsFormParameter.js +1 -2
- package/dist/core/headers.d.ts +2 -3
- package/dist/core/headers.js +10 -9
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +19 -8
- package/dist/core/json.d.ts +1 -1
- package/dist/core/json.js +2 -2
- package/dist/core/logging/exports.js +17 -7
- package/dist/core/logging/logger.js +6 -7
- package/dist/core/runtime/runtime.js +7 -8
- package/dist/core/schemas/Schema.d.ts +88 -0
- package/dist/core/schemas/Schema.js +25 -0
- package/dist/core/schemas/builders/bigint/bigint.d.ts +2 -0
- package/dist/core/schemas/builders/bigint/bigint.js +56 -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.d.ts +2 -0
- package/dist/core/schemas/builders/date/date.js +65 -0
- package/dist/core/schemas/builders/date/index.d.ts +1 -0
- package/dist/core/schemas/builders/date/index.js +5 -0
- package/dist/core/schemas/builders/enum/enum.d.ts +3 -0
- package/dist/core/schemas/builders/enum/enum.js +45 -0
- package/dist/core/schemas/builders/enum/index.d.ts +1 -0
- package/dist/core/schemas/builders/enum/index.js +6 -0
- package/dist/core/schemas/builders/index.d.ts +14 -0
- package/dist/core/schemas/builders/index.js +30 -0
- package/dist/core/schemas/builders/lazy/index.d.ts +3 -0
- package/dist/core/schemas/builders/lazy/index.js +7 -0
- package/dist/core/schemas/builders/lazy/lazy.d.ts +5 -0
- package/dist/core/schemas/builders/lazy/lazy.js +27 -0
- package/dist/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
- package/dist/core/schemas/builders/lazy/lazyObject.js +20 -0
- package/dist/core/schemas/builders/list/index.d.ts +1 -0
- package/dist/core/schemas/builders/list/index.js +5 -0
- package/dist/core/schemas/builders/list/list.d.ts +2 -0
- package/dist/core/schemas/builders/list/list.js +52 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.js +28 -0
- package/dist/core/schemas/builders/literals/index.d.ts +2 -0
- package/dist/core/schemas/builders/literals/index.js +7 -0
- package/dist/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
- package/dist/core/schemas/builders/literals/stringLiteral.js +28 -0
- package/dist/core/schemas/builders/object/index.d.ts +6 -0
- package/dist/core/schemas/builders/object/index.js +11 -0
- package/dist/core/schemas/builders/object/object.d.ts +3 -0
- package/dist/core/schemas/builders/object/object.js +385 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +7 -0
- package/dist/core/schemas/builders/object/property.d.ts +8 -0
- package/dist/core/schemas/builders/object/property.js +15 -0
- package/dist/core/schemas/builders/object/types.d.ts +31 -0
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +66 -0
- package/dist/core/schemas/builders/object-like/index.d.ts +2 -0
- package/dist/core/schemas/builders/object-like/index.js +6 -0
- package/dist/core/schemas/builders/object-like/types.d.ts +7 -0
- package/dist/core/schemas/builders/primitives/any.d.ts +2 -0
- package/dist/core/schemas/builders/primitives/any.js +9 -0
- package/dist/core/schemas/builders/primitives/boolean.d.ts +2 -0
- package/dist/core/schemas/builders/primitives/boolean.js +25 -0
- package/dist/core/schemas/builders/primitives/index.d.ts +6 -0
- package/dist/core/schemas/builders/primitives/index.js +15 -0
- package/dist/core/schemas/builders/primitives/never.d.ts +2 -0
- package/dist/core/schemas/builders/primitives/never.js +14 -0
- package/dist/core/schemas/builders/primitives/number.d.ts +2 -0
- package/dist/core/schemas/builders/primitives/number.js +25 -0
- package/dist/core/schemas/builders/primitives/string.d.ts +2 -0
- package/dist/core/schemas/builders/primitives/string.js +25 -0
- package/dist/core/schemas/builders/primitives/unknown.d.ts +2 -0
- package/dist/core/schemas/builders/primitives/unknown.js +6 -0
- package/dist/core/schemas/builders/record/index.d.ts +2 -0
- package/dist/core/schemas/builders/record/index.js +6 -0
- package/dist/core/schemas/builders/record/record.d.ts +4 -0
- package/dist/core/schemas/builders/record/record.js +137 -0
- package/dist/core/schemas/builders/record/types.d.ts +6 -0
- package/dist/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
- package/dist/core/schemas/builders/schema-utils/JsonError.js +13 -0
- package/dist/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
- package/dist/core/schemas/builders/schema-utils/ParseError.js +13 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +21 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +157 -0
- package/dist/core/schemas/builders/schema-utils/index.d.ts +4 -0
- package/dist/core/schemas/builders/schema-utils/index.js +11 -0
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
- package/dist/core/schemas/builders/schema-utils/stringifyValidationErrors.js +9 -0
- package/dist/core/schemas/builders/set/index.d.ts +1 -0
- package/dist/core/schemas/builders/set/index.js +5 -0
- package/dist/core/schemas/builders/set/set.d.ts +2 -0
- package/dist/core/schemas/builders/set/set.js +45 -0
- package/dist/core/schemas/builders/undiscriminated-union/index.d.ts +2 -0
- package/dist/core/schemas/builders/undiscriminated-union/index.js +5 -0
- package/dist/core/schemas/builders/undiscriminated-union/types.d.ts +4 -0
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts +3 -0
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +42 -0
- package/dist/core/schemas/builders/union/discriminant.d.ts +5 -0
- package/dist/core/schemas/builders/union/discriminant.js +9 -0
- package/dist/core/schemas/builders/union/index.d.ts +4 -0
- package/dist/core/schemas/builders/union/index.js +7 -0
- package/dist/core/schemas/builders/union/types.d.ts +13 -0
- package/dist/core/schemas/builders/union/union.d.ts +4 -0
- package/dist/core/schemas/builders/union/union.js +130 -0
- package/dist/core/schemas/index.d.ts +2 -0
- package/dist/core/schemas/index.js +17 -0
- package/dist/core/schemas/utils/MaybePromise.d.ts +1 -0
- package/dist/core/schemas/utils/MaybePromise.js +2 -0
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
- package/dist/core/schemas/utils/addQuestionMarksToNullableProperties.js +2 -0
- package/dist/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
- package/dist/core/schemas/utils/createIdentitySchemaCreator.js +18 -0
- package/dist/core/schemas/utils/entries.d.ts +1 -0
- package/dist/core/schemas/utils/entries.js +6 -0
- package/dist/core/schemas/utils/filterObject.d.ts +1 -0
- package/dist/core/schemas/utils/filterObject.js +13 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +27 -0
- package/dist/core/schemas/utils/isPlainObject.d.ts +1 -0
- package/dist/core/schemas/utils/isPlainObject.js +15 -0
- package/dist/core/schemas/utils/keys.d.ts +1 -0
- package/dist/core/schemas/utils/keys.js +6 -0
- package/dist/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
- package/dist/core/schemas/utils/maybeSkipValidation.js +31 -0
- package/dist/core/schemas/utils/partition.d.ts +1 -0
- package/dist/core/schemas/utils/partition.js +15 -0
- package/dist/core/url/QueryStringBuilder.js +2 -3
- package/dist/core/url/encodePathParam.js +1 -2
- package/dist/core/url/join.js +4 -5
- package/dist/core/url/qs.js +5 -3
- package/dist/errors/HydraDBTimeoutError.js +1 -1
- package/dist/errors/handleNonStatusCodeError.js +18 -9
- package/dist/helpers/buildString.d.ts +16 -0
- package/dist/helpers/buildString.js +204 -0
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.js +8 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +21 -8
- package/dist/serialization/client/requests/QueryRequest.d.ts +28 -0
- package/dist/serialization/client/requests/QueryRequest.js +60 -0
- package/dist/serialization/client/requests/index.d.ts +1 -0
- package/dist/serialization/client/requests/index.js +5 -0
- package/dist/{api/resources/fetch → serialization}/index.d.ts +1 -0
- package/dist/{api/resources/fetch → serialization}/index.js +1 -0
- package/dist/serialization/resources/context/client/requests/V2ListContentRequest.d.ts +18 -0
- package/dist/serialization/resources/context/client/requests/V2ListContentRequest.js +50 -0
- package/dist/serialization/resources/context/client/requests/V2SourceDeleteRequest.d.ts +13 -0
- package/dist/serialization/resources/context/client/requests/V2SourceDeleteRequest.js +45 -0
- package/dist/serialization/resources/context/client/requests/index.d.ts +2 -0
- package/dist/serialization/resources/context/client/requests/index.js +7 -0
- package/dist/serialization/resources/index.d.ts +2 -0
- package/dist/serialization/resources/index.js +41 -0
- package/dist/serialization/types/Bm25OperatorType.d.ts +7 -0
- package/dist/serialization/types/Bm25OperatorType.js +39 -0
- package/dist/serialization/types/CollectionStats.d.ts +10 -0
- package/dist/serialization/types/CollectionStats.js +42 -0
- package/dist/serialization/types/ContentFilter.d.ts +11 -0
- package/dist/serialization/types/ContentFilter.js +43 -0
- package/dist/serialization/types/CustomPropertyDefinition.d.ts +17 -0
- package/dist/serialization/types/CustomPropertyDefinition.js +49 -0
- package/dist/serialization/types/DeleteUserMemoryResponse.d.ts +10 -0
- package/dist/serialization/types/DeleteUserMemoryResponse.js +42 -0
- package/dist/serialization/types/DeliveryItem.d.ts +18 -0
- package/dist/serialization/types/DeliveryItem.js +50 -0
- package/dist/serialization/types/DeliveryListResponse.d.ts +12 -0
- package/dist/serialization/types/DeliveryListResponse.js +44 -0
- package/dist/serialization/types/Entity.d.ts +13 -0
- package/dist/serialization/types/Entity.js +45 -0
- package/dist/serialization/types/ErrorDetail.d.ts +10 -0
- package/dist/serialization/types/ErrorDetail.js +42 -0
- package/dist/serialization/types/GraphContext.d.ts +13 -0
- package/dist/serialization/types/GraphContext.js +47 -0
- package/dist/serialization/types/InfraStatusResponseV2.d.ts +13 -0
- package/dist/serialization/types/InfraStatusResponseV2.js +45 -0
- package/dist/serialization/types/InfraV2.d.ts +13 -0
- package/dist/serialization/types/InfraV2.js +45 -0
- package/dist/serialization/types/IngestType.d.ts +7 -0
- package/dist/serialization/types/IngestType.js +39 -0
- package/dist/serialization/types/ListUserMemoriesResponse.d.ts +14 -0
- package/dist/serialization/types/ListUserMemoriesResponse.js +46 -0
- package/dist/serialization/types/MilvusDataType.d.ts +7 -0
- package/dist/serialization/types/MilvusDataType.js +52 -0
- package/dist/serialization/types/PaginationMeta.d.ts +14 -0
- package/dist/serialization/types/PaginationMeta.js +46 -0
- package/dist/serialization/types/PathTriplet.d.ts +13 -0
- package/dist/serialization/types/PathTriplet.js +45 -0
- package/dist/serialization/types/QueryApiResponse.d.ts +15 -0
- package/dist/serialization/types/QueryApiResponse.js +47 -0
- package/dist/serialization/types/QueryBy.d.ts +7 -0
- package/dist/serialization/types/QueryBy.js +42 -0
- package/dist/serialization/types/QueryRequestAlpha.d.ts +7 -0
- package/dist/serialization/types/QueryRequestAlpha.js +39 -0
- package/dist/serialization/types/RelationEvidence.d.ts +18 -0
- package/dist/serialization/types/RelationEvidence.js +50 -0
- package/dist/serialization/types/ResponseMeta.d.ts +10 -0
- package/dist/serialization/types/ResponseMeta.js +42 -0
- package/dist/serialization/types/RetrieveMode.d.ts +7 -0
- package/dist/serialization/types/RetrieveMode.js +39 -0
- package/dist/serialization/types/RetryResponse.d.ts +11 -0
- package/dist/serialization/types/RetryResponse.js +43 -0
- package/dist/serialization/types/ScoredPathResponse.d.ts +14 -0
- package/dist/serialization/types/ScoredPathResponse.js +46 -0
- package/dist/serialization/types/SourceDeleteApiResponse.d.ts +15 -0
- package/dist/serialization/types/SourceDeleteApiResponse.js +47 -0
- package/dist/serialization/types/SourceDeleteApiResponseData.d.ts +9 -0
- package/dist/serialization/types/SourceDeleteApiResponseData.js +41 -0
- package/dist/serialization/types/SourceDeleteResponse.d.ts +13 -0
- package/dist/serialization/types/SourceDeleteResponse.js +45 -0
- package/dist/serialization/types/SourceDeleteResultItem.d.ts +11 -0
- package/dist/serialization/types/SourceDeleteResultItem.js +43 -0
- package/dist/serialization/types/SourceFetchApiResponse.d.ts +15 -0
- package/dist/serialization/types/SourceFetchApiResponse.js +47 -0
- package/dist/serialization/types/SourceGraphRelationsResponse.d.ts +14 -0
- package/dist/serialization/types/SourceGraphRelationsResponse.js +46 -0
- package/dist/serialization/types/SourceInfo.d.ts +19 -0
- package/dist/serialization/types/SourceInfo.js +51 -0
- package/dist/serialization/types/SourceIngestApiResponse.d.ts +15 -0
- package/dist/serialization/types/SourceIngestApiResponse.js +47 -0
- package/dist/serialization/types/SourceIngestApiResponseData.d.ts +9 -0
- package/dist/serialization/types/SourceIngestApiResponseData.js +41 -0
- package/dist/serialization/types/SourceListApiResponse.d.ts +15 -0
- package/dist/serialization/types/SourceListApiResponse.js +47 -0
- package/dist/serialization/types/SourceListApiResponseData.d.ts +9 -0
- package/dist/serialization/types/SourceListApiResponseData.js +41 -0
- package/dist/serialization/types/SourceRelationsApiResponse.d.ts +15 -0
- package/dist/serialization/types/SourceRelationsApiResponse.js +47 -0
- package/dist/serialization/types/SourceStatus.d.ts +7 -0
- package/dist/serialization/types/SourceStatus.js +39 -0
- package/dist/serialization/types/SourceStatusApiResponse.d.ts +15 -0
- package/dist/serialization/types/SourceStatusApiResponse.js +47 -0
- package/dist/serialization/types/SourceType.d.ts +7 -0
- package/dist/serialization/types/SourceType.js +39 -0
- package/dist/serialization/types/SubTenantIdsResponse.d.ts +10 -0
- package/dist/serialization/types/SubTenantIdsResponse.js +42 -0
- package/dist/serialization/types/TenantCreateAcceptedResponse.d.ts +11 -0
- package/dist/serialization/types/TenantCreateAcceptedResponse.js +43 -0
- package/dist/serialization/types/TenantCreateApiResponse.d.ts +15 -0
- package/dist/serialization/types/TenantCreateApiResponse.js +47 -0
- package/dist/serialization/types/TenantCreateRequest.d.ts +13 -0
- package/dist/serialization/types/TenantCreateRequest.js +45 -0
- package/dist/serialization/types/TenantDeleteApiResponse.d.ts +15 -0
- package/dist/serialization/types/TenantDeleteApiResponse.js +47 -0
- package/dist/serialization/types/TenantDeleteResponse.d.ts +11 -0
- package/dist/serialization/types/TenantDeleteResponse.js +43 -0
- package/dist/serialization/types/TenantIdsResponse.d.ts +11 -0
- package/dist/serialization/types/TenantIdsResponse.js +45 -0
- package/dist/serialization/types/TenantInfraStatusApiResponse.d.ts +15 -0
- package/dist/serialization/types/TenantInfraStatusApiResponse.js +47 -0
- package/dist/serialization/types/TenantListApiResponse.d.ts +15 -0
- package/dist/serialization/types/TenantListApiResponse.js +47 -0
- package/dist/serialization/types/TenantStatsApiResponse.d.ts +15 -0
- package/dist/serialization/types/TenantStatsApiResponse.js +47 -0
- package/dist/serialization/types/TenantStatsResponse.d.ts +13 -0
- package/dist/serialization/types/TenantStatsResponse.js +45 -0
- package/dist/serialization/types/TenantSubTenantsApiResponse.d.ts +15 -0
- package/dist/serialization/types/TenantSubTenantsApiResponse.js +47 -0
- package/dist/serialization/types/TripletWithEvidence.d.ts +14 -0
- package/dist/serialization/types/TripletWithEvidence.js +46 -0
- package/dist/serialization/types/UserMemory.d.ts +11 -0
- package/dist/serialization/types/UserMemory.js +43 -0
- package/dist/serialization/types/V2AddMemoryResponse.d.ts +14 -0
- package/dist/serialization/types/V2AddMemoryResponse.js +46 -0
- package/dist/serialization/types/V2BatchProcessingStatus.d.ts +10 -0
- package/dist/serialization/types/V2BatchProcessingStatus.js +42 -0
- package/dist/serialization/types/V2Chunk.d.ts +20 -0
- package/dist/serialization/types/V2Chunk.js +54 -0
- package/dist/serialization/types/V2MemoryResultItem.d.ts +15 -0
- package/dist/serialization/types/V2MemoryResultItem.js +47 -0
- package/dist/serialization/types/V2ProcessingStatus.d.ts +15 -0
- package/dist/serialization/types/V2ProcessingStatus.js +47 -0
- package/dist/serialization/types/V2ProcessingStatusIndexingStatus.d.ts +7 -0
- package/dist/serialization/types/V2ProcessingStatusIndexingStatus.js +39 -0
- package/dist/serialization/types/V2RetrievalResult.d.ts +15 -0
- package/dist/serialization/types/V2RetrievalResult.js +47 -0
- package/dist/serialization/types/V2SourceFetchResponse.d.ts +17 -0
- package/dist/serialization/types/V2SourceFetchResponse.js +49 -0
- package/dist/serialization/types/V2SourceListResponse.d.ts +7 -0
- package/dist/serialization/types/V2SourceListResponse.js +39 -0
- package/dist/serialization/types/V2SourceUploadResponse.d.ts +14 -0
- package/dist/serialization/types/V2SourceUploadResponse.js +46 -0
- package/dist/serialization/types/V2SourceUploadResultItem.d.ts +14 -0
- package/dist/serialization/types/V2SourceUploadResultItem.js +46 -0
- package/dist/serialization/types/VectorstoreStatus.d.ts +10 -0
- package/dist/serialization/types/VectorstoreStatus.js +42 -0
- package/dist/serialization/types/WebhookDeleteApiResponse.d.ts +15 -0
- package/dist/serialization/types/WebhookDeleteApiResponse.js +47 -0
- package/dist/serialization/types/WebhookDeleteResponse.d.ts +10 -0
- package/dist/serialization/types/WebhookDeleteResponse.js +42 -0
- package/dist/serialization/types/WebhookDeliveryItemApiResponse.d.ts +15 -0
- package/dist/serialization/types/WebhookDeliveryItemApiResponse.js +47 -0
- package/dist/serialization/types/WebhookDeliveryListApiResponse.d.ts +15 -0
- package/dist/serialization/types/WebhookDeliveryListApiResponse.js +47 -0
- package/dist/serialization/types/WebhookGetApiResponse.d.ts +15 -0
- package/dist/serialization/types/WebhookGetApiResponse.js +47 -0
- package/dist/serialization/types/WebhookGetResponse.d.ts +12 -0
- package/dist/serialization/types/WebhookGetResponse.js +44 -0
- package/dist/serialization/types/WebhookRegisterApiResponse.d.ts +15 -0
- package/dist/serialization/types/WebhookRegisterApiResponse.js +47 -0
- package/dist/serialization/types/WebhookRegisterRequest.d.ts +11 -0
- package/dist/serialization/types/WebhookRegisterRequest.js +43 -0
- package/dist/serialization/types/WebhookRegisterResponse.d.ts +13 -0
- package/dist/serialization/types/WebhookRegisterResponse.js +45 -0
- package/dist/serialization/types/WebhookRetryApiResponse.d.ts +15 -0
- package/dist/serialization/types/WebhookRetryApiResponse.js +47 -0
- package/dist/serialization/types/WebhookTestApiResponse.d.ts +15 -0
- package/dist/serialization/types/WebhookTestApiResponse.js +47 -0
- package/dist/serialization/types/WebhookTestResponse.d.ts +11 -0
- package/dist/serialization/types/WebhookTestResponse.js +43 -0
- package/dist/serialization/types/index.d.ts +78 -0
- package/dist/serialization/types/index.js +94 -0
- package/package.json +12 -2
- package/dist/api/resources/data/client/Client.d.ts +0 -33
- package/dist/api/resources/data/client/Client.js +0 -108
- package/dist/api/resources/data/client/requests/SourceDeleteRequest.d.ts +0 -13
- package/dist/api/resources/data/client/requests/index.d.ts +0 -1
- package/dist/api/resources/data/exports.d.ts +0 -2
- package/dist/api/resources/embeddings/client/Client.d.ts +0 -111
- package/dist/api/resources/embeddings/client/Client.js +0 -339
- package/dist/api/resources/embeddings/client/requests/BodyFilterRawEmbeddingsEndpointEmbeddingsFilterRawEmbeddingsPost.d.ts +0 -21
- package/dist/api/resources/embeddings/client/requests/BodyInsertRawEmbeddingsEndpointEmbeddingsInsertRawEmbeddingsPost.d.ts +0 -36
- package/dist/api/resources/embeddings/client/requests/BodySearchRawEmbeddingsEndpointEmbeddingsSearchRawEmbeddingsPost.d.ts +0 -22
- package/dist/api/resources/embeddings/client/requests/DeleteEmbeddingsRequest.d.ts +0 -16
- package/dist/api/resources/embeddings/client/requests/index.d.ts +0 -4
- package/dist/api/resources/embeddings/exports.d.ts +0 -2
- package/dist/api/resources/embeddings/exports.js +0 -21
- package/dist/api/resources/fetch/client/Client.d.ts +0 -72
- package/dist/api/resources/fetch/client/Client.js +0 -252
- package/dist/api/resources/fetch/client/requests/ListContentRequest.d.ts +0 -25
- package/dist/api/resources/fetch/client/requests/SourceFetchRequest.d.ts +0 -20
- package/dist/api/resources/fetch/client/requests/index.d.ts +0 -3
- package/dist/api/resources/fetch/exports.d.ts +0 -2
- package/dist/api/resources/fetch/types/ListDataFetchResponse.d.ts +0 -2
- package/dist/api/resources/fetch/types/index.d.ts +0 -1
- package/dist/api/resources/fetch/types/index.js +0 -17
- package/dist/api/resources/graphHealth/client/Client.d.ts +0 -32
- package/dist/api/resources/graphHealth/client/Client.js +0 -115
- package/dist/api/resources/graphHealth/client/requests/GetSuperNodesGraphHealthSuperNodesGetRequest.d.ts +0 -16
- package/dist/api/resources/graphHealth/client/requests/index.d.ts +0 -1
- package/dist/api/resources/graphHealth/exports.d.ts +0 -2
- package/dist/api/resources/graphHealth/exports.js +0 -21
- package/dist/api/resources/ingestionPipeline/client/Client.d.ts +0 -27
- package/dist/api/resources/ingestionPipeline/client/Client.js +0 -90
- package/dist/api/resources/ingestionPipeline/client/requests/MemoryIngestRequest.d.ts +0 -19
- package/dist/api/resources/ingestionPipeline/client/requests/index.d.ts +0 -1
- package/dist/api/resources/ingestionPipeline/exports.d.ts +0 -2
- package/dist/api/resources/ingestionPipeline/exports.js +0 -21
- package/dist/api/resources/key/client/Client.d.ts +0 -30
- package/dist/api/resources/key/client/Client.js +0 -104
- package/dist/api/resources/key/client/requests/ApiKeyCreateRequest.d.ts +0 -14
- package/dist/api/resources/key/client/requests/index.d.ts +0 -1
- package/dist/api/resources/key/exports.d.ts +0 -2
- package/dist/api/resources/key/exports.js +0 -21
- package/dist/api/resources/key/index.d.ts +0 -1
- package/dist/api/resources/key/index.js +0 -17
- package/dist/api/resources/recall/client/Client.d.ts +0 -97
- package/dist/api/resources/recall/client/Client.js +0 -324
- package/dist/api/resources/recall/client/index.d.ts +0 -1
- package/dist/api/resources/recall/client/index.js +0 -17
- package/dist/api/resources/recall/client/requests/FullTextSearchRequest.d.ts +0 -22
- package/dist/api/resources/recall/client/requests/QnASearchRequest.d.ts +0 -38
- package/dist/api/resources/recall/client/requests/index.d.ts +0 -2
- package/dist/api/resources/recall/exports.d.ts +0 -2
- package/dist/api/resources/recall/index.d.ts +0 -1
- package/dist/api/resources/recall/index.js +0 -17
- package/dist/api/resources/tenant/client/index.d.ts +0 -1
- package/dist/api/resources/tenant/client/index.js +0 -17
- package/dist/api/resources/tenant/client/requests/DeleteTenantTenantRequest.d.ts +0 -10
- package/dist/api/resources/tenant/client/requests/GetInfraStatusTenantRequest.d.ts +0 -10
- package/dist/api/resources/tenant/client/requests/GetSubTenantIdsTenantRequest.d.ts +0 -10
- package/dist/api/resources/tenant/client/requests/MonitorTenantRequest.d.ts +0 -10
- package/dist/api/resources/tenant/client/requests/index.d.ts +0 -5
- package/dist/api/resources/tenant/exports.d.ts +0 -2
- package/dist/api/resources/tenant/exports.js +0 -21
- package/dist/api/resources/tenant/index.d.ts +0 -1
- package/dist/api/resources/tenant/index.js +0 -17
- package/dist/api/resources/upload/client/Client.d.ts +0 -92
- package/dist/api/resources/upload/client/Client.js +0 -349
- package/dist/api/resources/upload/client/index.d.ts +0 -1
- package/dist/api/resources/upload/client/index.js +0 -17
- package/dist/api/resources/upload/client/requests/BodyAddMemoryMemoriesAddMemoryPost.d.ts +0 -18
- package/dist/api/resources/upload/client/requests/BodyUploadKnowledgeIngestionUploadKnowledgePost.d.ts +0 -23
- package/dist/api/resources/upload/client/requests/DeleteMemoryUploadRequest.d.ts +0 -15
- package/dist/api/resources/upload/client/requests/VerifyProcessingUploadRequest.d.ts +0 -16
- package/dist/api/resources/upload/client/requests/index.d.ts +0 -4
- package/dist/api/resources/upload/exports.d.ts +0 -2
- package/dist/api/resources/upload/exports.js +0 -21
- package/dist/api/resources/upload/index.d.ts +0 -1
- package/dist/api/resources/upload/index.js +0 -17
- package/dist/api/types/ActualErrorResponse.d.ts +0 -4
- package/dist/api/types/AddMemoryResponse.d.ts +0 -14
- package/dist/api/types/ApiKeyCreateResponse.d.ts +0 -14
- package/dist/api/types/AttachmentModel.d.ts +0 -17
- package/dist/api/types/BatchProcessingStatus.d.ts +0 -5
- package/dist/api/types/ContentModel.d.ts +0 -14
- package/dist/api/types/CortexModelsResponseCommonsActualErrorResponse.d.ts +0 -4
- package/dist/api/types/CortexModelsResponseCommonsErrorResponse.d.ts +0 -5
- package/dist/api/types/DeleteResult.d.ts +0 -11
- package/dist/api/types/ErrorResponse.d.ts +0 -5
- package/dist/api/types/FetchMode.d.ts +0 -7
- package/dist/api/types/FetchMode.js +0 -10
- package/dist/api/types/ForcefulRelationsPayload.d.ts +0 -6
- package/dist/api/types/HttpValidationError.d.ts +0 -4
- package/dist/api/types/Infra.d.ts +0 -5
- package/dist/api/types/InfraStatusResponse.d.ts +0 -14
- package/dist/api/types/IngestResponse.d.ts +0 -4
- package/dist/api/types/InsertResult.d.ts +0 -13
- package/dist/api/types/ListContentKind.d.ts +0 -5
- package/dist/api/types/MemoryItem.d.ts +0 -44
- package/dist/api/types/ProcessingStatus.d.ts +0 -26
- package/dist/api/types/ProcessingStatus.js +0 -16
- package/dist/api/types/QnASearchResponse.d.ts +0 -17
- package/dist/api/types/RawEmbeddingDocument.d.ts +0 -16
- package/dist/api/types/RawEmbeddingSearchResult.d.ts +0 -16
- package/dist/api/types/RawEmbeddingVector.d.ts +0 -9
- package/dist/api/types/RecallSearchRequest.d.ts +0 -34
- package/dist/api/types/RetrievalResult.d.ts +0 -12
- package/dist/api/types/SearchMode.d.ts +0 -6
- package/dist/api/types/SearchMode.js +0 -9
- package/dist/api/types/SourceFetchResponse.d.ts +0 -23
- package/dist/api/types/SourceListResponse.d.ts +0 -1
- package/dist/api/types/SourceModel.d.ts +0 -42
- package/dist/api/types/SourceUploadResponse.d.ts +0 -11
- package/dist/api/types/SourceUploadResultItem.d.ts +0 -11
- package/dist/api/types/SuperNodeItem.d.ts +0 -9
- package/dist/api/types/SuperNodeResponse.d.ts +0 -11
- package/dist/api/types/SupportedLlmProviders.d.ts +0 -8
- package/dist/api/types/SupportedLlmProviders.js +0 -11
- package/dist/api/types/UserAssistantPair.d.ts +0 -9
- package/dist/api/types/ValidationError.d.ts +0 -11
- package/dist/api/types/VectorStoreChunk.d.ts +0 -26
- /package/dist/api/{resources/data/client → client}/index.d.ts +0 -0
- /package/dist/api/{resources/data/client → client}/index.js +0 -0
- /package/dist/api/{resources/data/client/requests/SourceDeleteRequest.js → client/requests/QueryRequest.js} +0 -0
- /package/dist/api/{resources/data/client → client}/requests/index.js +0 -0
- /package/dist/api/resources/{embeddings → context}/client/index.d.ts +0 -0
- /package/dist/api/resources/{embeddings → context}/client/index.js +0 -0
- /package/dist/api/resources/{embeddings/client/requests/BodyFilterRawEmbeddingsEndpointEmbeddingsFilterRawEmbeddingsPost.js → context/client/requests/BodyIngestContextIngestPost.js} +0 -0
- /package/dist/api/resources/{embeddings/client/requests/BodyInsertRawEmbeddingsEndpointEmbeddingsInsertRawEmbeddingsPost.js → context/client/requests/InspectContextRequest.js} +0 -0
- /package/dist/api/resources/{embeddings/client/requests/BodySearchRawEmbeddingsEndpointEmbeddingsSearchRawEmbeddingsPost.js → context/client/requests/RelationsContextRequest.js} +0 -0
- /package/dist/api/resources/{embeddings/client/requests/DeleteEmbeddingsRequest.js → context/client/requests/StatusContextRequest.js} +0 -0
- /package/dist/api/resources/{fetch/client/requests/GraphRelationsBySourceIdFetchRequest.js → context/client/requests/V2ListContentRequest.js} +0 -0
- /package/dist/api/resources/{fetch/client/requests/ListContentRequest.js → context/client/requests/V2SourceDeleteRequest.js} +0 -0
- /package/dist/api/resources/{embeddings → context}/client/requests/index.js +0 -0
- /package/dist/api/resources/{data → context}/index.d.ts +0 -0
- /package/dist/api/resources/{data → context}/index.js +0 -0
- /package/dist/api/resources/{fetch → tenants}/client/index.d.ts +0 -0
- /package/dist/api/resources/{fetch → tenants}/client/index.js +0 -0
- /package/dist/api/resources/{fetch/client/requests/SourceFetchRequest.js → tenants/client/requests/DeleteTenantsRequest.js} +0 -0
- /package/dist/api/resources/{fetch/types/ListDataFetchResponse.js → tenants/client/requests/StatsTenantsRequest.js} +0 -0
- /package/dist/api/resources/{graphHealth/client/requests/GetSuperNodesGraphHealthSuperNodesGetRequest.js → tenants/client/requests/StatusTenantsRequest.js} +0 -0
- /package/dist/api/resources/{ingestionPipeline/client/requests/MemoryIngestRequest.js → tenants/client/requests/SubTenantsTenantsRequest.js} +0 -0
- /package/dist/api/resources/{fetch → tenants}/client/requests/index.js +0 -0
- /package/dist/api/resources/{embeddings → tenants}/index.d.ts +0 -0
- /package/dist/api/resources/{embeddings → tenants}/index.js +0 -0
- /package/dist/api/resources/{graphHealth → webhooks}/client/index.d.ts +0 -0
- /package/dist/api/resources/{graphHealth → webhooks}/client/index.js +0 -0
- /package/dist/api/resources/{key/client/requests/ApiKeyCreateRequest.js → webhooks/client/requests/GetDeliveryWebhooksRequest.js} +0 -0
- /package/dist/api/resources/{recall/client/requests/FullTextSearchRequest.js → webhooks/client/requests/ListDeliveriesWebhooksRequest.js} +0 -0
- /package/dist/api/resources/{recall/client/requests/QnASearchRequest.js → webhooks/client/requests/RetryDeliveryWebhooksRequest.js} +0 -0
- /package/dist/api/resources/{graphHealth → webhooks}/client/requests/index.js +0 -0
- /package/dist/api/resources/{graphHealth → webhooks}/index.d.ts +0 -0
- /package/dist/api/resources/{graphHealth → webhooks}/index.js +0 -0
- /package/dist/api/{resources/tenant/client/requests/DeleteTenantTenantRequest.js → types/DeliveryItem.js} +0 -0
- /package/dist/api/{resources/tenant/client/requests/GetInfraStatusTenantRequest.js → types/DeliveryListResponse.js} +0 -0
- /package/dist/api/{resources/tenant/client/requests/GetSubTenantIdsTenantRequest.js → types/ErrorDetail.js} +0 -0
- /package/dist/api/{resources/tenant/client/requests/MonitorTenantRequest.js → types/InfraStatusResponseV2.js} +0 -0
- /package/dist/api/{resources/tenant/client/requests/TenantCreateRequest.js → types/InfraV2.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/BodyAddMemoryMemoriesAddMemoryPost.js → types/QueryApiResponse.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/BodyUploadKnowledgeIngestionUploadKnowledgePost.js → types/QueryRequestAlpha.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/DeleteMemoryUploadRequest.js → types/ResponseMeta.js} +0 -0
- /package/dist/api/{resources/upload/client/requests/VerifyProcessingUploadRequest.js → types/RetryResponse.js} +0 -0
- /package/dist/api/types/{ActualErrorResponse.js → SourceDeleteApiResponse.js} +0 -0
- /package/dist/api/types/{AddMemoryResponse.js → SourceDeleteApiResponseData.js} +0 -0
- /package/dist/api/types/{ApiKeyCreateResponse.js → SourceFetchApiResponse.js} +0 -0
- /package/dist/api/types/{AttachmentModel.js → SourceIngestApiResponse.js} +0 -0
- /package/dist/api/types/{BatchProcessingStatus.js → SourceIngestApiResponseData.js} +0 -0
- /package/dist/api/types/{ContentModel.js → SourceListApiResponse.js} +0 -0
- /package/dist/api/types/{CortexModelsResponseCommonsActualErrorResponse.js → SourceListApiResponseData.js} +0 -0
- /package/dist/api/types/{CortexModelsResponseCommonsErrorResponse.js → SourceRelationsApiResponse.js} +0 -0
- /package/dist/api/types/{DeleteResult.js → SourceStatusApiResponse.js} +0 -0
- /package/dist/api/types/{ErrorResponse.js → TenantCreateApiResponse.js} +0 -0
- /package/dist/api/types/{ForcefulRelationsPayload.js → TenantCreateRequest.js} +0 -0
- /package/dist/api/types/{HttpValidationError.js → TenantDeleteApiResponse.js} +0 -0
- /package/dist/api/types/{Infra.js → TenantInfraStatusApiResponse.js} +0 -0
- /package/dist/api/types/{InfraStatusResponse.js → TenantListApiResponse.js} +0 -0
- /package/dist/api/types/{IngestResponse.js → TenantStatsApiResponse.js} +0 -0
- /package/dist/api/types/{InsertResult.js → TenantSubTenantsApiResponse.js} +0 -0
- /package/dist/api/types/{MemoryItem.js → V2AddMemoryResponse.js} +0 -0
- /package/dist/api/types/{MemoryResultItem.js → V2BatchProcessingStatus.js} +0 -0
- /package/dist/api/types/{QnASearchResponse.js → V2Chunk.js} +0 -0
- /package/dist/api/types/{RawEmbeddingDocument.js → V2MemoryResultItem.js} +0 -0
- /package/dist/api/types/{RawEmbeddingSearchResult.js → V2ProcessingStatus.js} +0 -0
- /package/dist/api/types/{RawEmbeddingVector.js → V2RetrievalResult.js} +0 -0
- /package/dist/api/types/{RecallSearchRequest.js → V2SourceFetchResponse.js} +0 -0
- /package/dist/api/types/{RetrievalResult.js → V2SourceListResponse.js} +0 -0
- /package/dist/api/types/{SourceFetchResponse.js → V2SourceUploadResponse.js} +0 -0
- /package/dist/api/types/{SourceListResponse.js → V2SourceUploadResultItem.js} +0 -0
- /package/dist/api/types/{SourceModel.js → VectorstoreStatus.js} +0 -0
- /package/dist/api/types/{SourceUploadResponse.js → WebhookDeleteApiResponse.js} +0 -0
- /package/dist/api/types/{SourceUploadResultItem.js → WebhookDeleteResponse.js} +0 -0
- /package/dist/api/types/{SuperNodeItem.js → WebhookDeliveryItemApiResponse.js} +0 -0
- /package/dist/api/types/{SuperNodeResponse.js → WebhookDeliveryListApiResponse.js} +0 -0
- /package/dist/api/types/{UserAssistantPair.js → WebhookGetApiResponse.js} +0 -0
- /package/dist/api/types/{ValidationError.js → WebhookGetResponse.js} +0 -0
- /package/dist/api/types/{VectorStoreChunk.js → WebhookRegisterApiResponse.js} +0 -0
- /package/dist/{api/resources/key/client/requests/index.js → core/schemas/builders/object/types.js} +0 -0
- /package/dist/{api/resources/ingestionPipeline/client/requests/index.js → core/schemas/builders/object-like/types.js} +0 -0
- /package/dist/{api/resources/recall/client/requests/index.js → core/schemas/builders/record/types.js} +0 -0
- /package/dist/{api/resources/tenant/client/requests/index.js → core/schemas/builders/undiscriminated-union/types.js} +0 -0
- /package/dist/{api/resources/upload/client/requests/index.js → core/schemas/builders/union/types.js} +0 -0
- /package/dist/{api/resources/ingestionPipeline → serialization}/client/index.d.ts +0 -0
- /package/dist/{api/resources/ingestionPipeline → serialization}/client/index.js +0 -0
- /package/dist/{api/resources/key → serialization/resources/context}/client/index.d.ts +0 -0
- /package/dist/{api/resources/key → serialization/resources/context}/client/index.js +0 -0
- /package/dist/{api/resources/ingestionPipeline → serialization/resources/context}/index.d.ts +0 -0
- /package/dist/{api/resources/ingestionPipeline → serialization/resources/context}/index.js +0 -0
package/README.md
CHANGED
|
@@ -1,143 +1,248 @@
|
|
|
1
1
|
# Hydra DB TypeScript SDK
|
|
2
2
|
|
|
3
|
-
The official TypeScript SDK for the Hydra DB platform.
|
|
3
|
+
The official TypeScript SDK for the Hydra DB platform.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Hydra DB provides memory, knowledge ingestion, retrieval, and graph context for AI applications.
|
|
6
6
|
|
|
7
|
-
[
|
|
7
|
+
[Hydra DB docs](https://docs.hydradb.com/)
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Features
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
- Ingest knowledge files, app-generated knowledge, and memories
|
|
12
|
+
- Track ingestion/indexing status of sources
|
|
13
|
+
- Retrieve knowledge and/or memory with a single `query` call (hybrid or keyword search, optional graph context)
|
|
14
|
+
- Inspect, list, and delete sources, and fetch graph relations
|
|
15
|
+
- Manage tenants and sub-tenants
|
|
16
|
+
- Register and manage webhooks and inspect deliveries
|
|
17
|
+
- Format retrieval results for LLM prompts with `buildString`
|
|
18
|
+
- Make authenticated passthrough requests for endpoints not yet wrapped by the SDK
|
|
16
19
|
|
|
17
|
-
##
|
|
20
|
+
## Installation
|
|
18
21
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
npm i @hydra_db/node
|
|
22
|
+
```bash
|
|
23
|
+
npm install @hydradb/sdk
|
|
23
24
|
# or
|
|
24
|
-
yarn add @
|
|
25
|
+
yarn add @hydradb/sdk
|
|
25
26
|
# or
|
|
26
|
-
pnpm add @
|
|
27
|
+
pnpm add @hydradb/sdk
|
|
27
28
|
```
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
## Client setup
|
|
30
31
|
|
|
31
32
|
```ts
|
|
32
|
-
import { HydraDBClient } from "@
|
|
33
|
-
|
|
34
|
-
process.loadEnvFile(".env");
|
|
33
|
+
import { HydraDBClient } from "@hydradb/sdk";
|
|
35
34
|
|
|
36
35
|
const client = new HydraDBClient({
|
|
37
36
|
token: process.env.HYDRA_DB_API_KEY,
|
|
38
37
|
});
|
|
39
38
|
|
|
40
39
|
const TENANT_ID = process.env.HYDRA_TENANT_ID ?? "my-company";
|
|
41
|
-
const SUB_TENANT_ID = process.env.HYDRA_SUB_TENANT_ID ?? "";
|
|
40
|
+
const SUB_TENANT_ID = process.env.HYDRA_SUB_TENANT_ID ?? "my-sub-tenant";
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
The default API base URL is:
|
|
44
|
+
|
|
45
|
+
```text
|
|
46
|
+
https://api.hydradb.com
|
|
42
47
|
```
|
|
43
48
|
|
|
44
|
-
|
|
49
|
+
For an on-prem deployment, pass `baseUrl`:
|
|
50
|
+
|
|
51
|
+
```ts
|
|
52
|
+
const localClient = new HydraDBClient({
|
|
53
|
+
token: process.env.HYDRA_DB_API_KEY,
|
|
54
|
+
baseUrl: "https://<id>.hydradb.<domain>",
|
|
55
|
+
});
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
The client targets API version `2` by default; override it with `apiVersion`. Other client options include `headers`, `timeoutInSeconds` (default `60`), `maxRetries`, `environment`, and a custom `fetch` implementation.
|
|
59
|
+
|
|
60
|
+
> Note: request fields use **camelCase** (`tenantId`, `subTenantId`, `maxResults`, …). The SDK serializes them to the API's snake_case on the wire.
|
|
61
|
+
|
|
62
|
+
## Client structure
|
|
63
|
+
|
|
64
|
+
All functionality is reached through one top-level method and three sub-clients:
|
|
65
|
+
|
|
66
|
+
| Accessor | Purpose |
|
|
67
|
+
|---|---|
|
|
68
|
+
| `client.query(...)` | Retrieve knowledge and/or memory in a single call. |
|
|
69
|
+
| `client.context` | Ingest, inspect, list, delete sources, and fetch graph relations. |
|
|
70
|
+
| `client.tenants` | Create, list, delete, and inspect tenants. |
|
|
71
|
+
| `client.webhooks` | Register and manage webhooks and inspect deliveries. |
|
|
72
|
+
|
|
73
|
+
## Important tenant and sub-tenant rule
|
|
74
|
+
|
|
75
|
+
Use the same `tenantId` and `subTenantId` across ingest, status, query, inspect, list, and delete calls.
|
|
45
76
|
|
|
46
|
-
|
|
77
|
+
If you ingest with a `subTenantId` and then check status or search without it, you may be looking at a different namespace. Omitting `subTenantId` uses the default sub-tenant created during tenant setup.
|
|
47
78
|
|
|
48
|
-
|
|
79
|
+
## Tenant management
|
|
49
80
|
|
|
50
|
-
|
|
81
|
+
A tenant is the top-level isolated database. A sub-tenant is an optional isolated collection inside a tenant.
|
|
82
|
+
|
|
83
|
+
### Create a standard tenant
|
|
51
84
|
|
|
52
85
|
```ts
|
|
53
|
-
|
|
54
|
-
|
|
86
|
+
await client.tenants.create({
|
|
87
|
+
tenantId: TENANT_ID,
|
|
55
88
|
});
|
|
56
89
|
```
|
|
57
90
|
|
|
58
|
-
|
|
91
|
+
### Create an embeddings tenant
|
|
92
|
+
|
|
93
|
+
Provide `embeddingsDimension` and set `isEmbeddingsTenant: true`.
|
|
59
94
|
|
|
60
95
|
```ts
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
96
|
+
await client.tenants.create({
|
|
97
|
+
tenantId: "my-embeddings-tenant",
|
|
98
|
+
isEmbeddingsTenant: true,
|
|
99
|
+
embeddingsDimension: 1536,
|
|
65
100
|
});
|
|
66
101
|
```
|
|
67
102
|
|
|
68
|
-
###
|
|
103
|
+
### Create a tenant with a metadata schema
|
|
104
|
+
|
|
105
|
+
Each field can enable filtering (`enableMatch`), semantic search (`enableDenseEmbedding`), and/or keyword search (`enableSparseEmbedding`). Fields with embeddings enabled must be string-typed.
|
|
69
106
|
|
|
70
107
|
```ts
|
|
71
|
-
|
|
72
|
-
|
|
108
|
+
await client.tenants.create({
|
|
109
|
+
tenantId: TENANT_ID,
|
|
110
|
+
tenantMetadataSchema: [
|
|
111
|
+
{
|
|
112
|
+
name: "department",
|
|
113
|
+
dataType: "string",
|
|
114
|
+
enableMatch: true,
|
|
115
|
+
enableDenseEmbedding: false,
|
|
116
|
+
enableSparseEmbedding: false,
|
|
117
|
+
},
|
|
118
|
+
],
|
|
73
119
|
});
|
|
74
|
-
// subTenants.sub_tenant_ids -> string[]
|
|
75
120
|
```
|
|
76
121
|
|
|
77
|
-
###
|
|
122
|
+
### List tenants
|
|
123
|
+
|
|
124
|
+
```ts
|
|
125
|
+
const tenants = await client.tenants.list();
|
|
126
|
+
console.log(tenants);
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### List sub-tenants
|
|
78
130
|
|
|
79
|
-
|
|
131
|
+
```ts
|
|
132
|
+
const subTenants = await client.tenants.subTenants({
|
|
133
|
+
tenantId: TENANT_ID,
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
console.log(subTenants);
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Check tenant infrastructure status
|
|
80
140
|
|
|
81
141
|
```ts
|
|
82
|
-
const infraStatus = await client.
|
|
83
|
-
|
|
142
|
+
const infraStatus = await client.tenants.status({
|
|
143
|
+
tenantId: TENANT_ID,
|
|
84
144
|
});
|
|
145
|
+
|
|
146
|
+
console.log(infraStatus);
|
|
85
147
|
```
|
|
86
148
|
|
|
87
|
-
###
|
|
149
|
+
### Tenant stats
|
|
88
150
|
|
|
89
151
|
```ts
|
|
90
|
-
const stats = await client.
|
|
91
|
-
|
|
152
|
+
const stats = await client.tenants.stats({
|
|
153
|
+
tenantId: TENANT_ID,
|
|
92
154
|
});
|
|
155
|
+
|
|
156
|
+
console.log(stats);
|
|
93
157
|
```
|
|
94
158
|
|
|
95
|
-
### Delete a
|
|
159
|
+
### Delete a tenant
|
|
96
160
|
|
|
97
|
-
>
|
|
161
|
+
> Warning: this permanently deletes the tenant and its data.
|
|
98
162
|
|
|
99
163
|
```ts
|
|
100
|
-
await client.
|
|
101
|
-
|
|
164
|
+
await client.tenants.delete({
|
|
165
|
+
tenantId: TENANT_ID,
|
|
102
166
|
});
|
|
103
167
|
```
|
|
104
168
|
|
|
105
|
-
|
|
169
|
+
## Ingest knowledge and memory
|
|
106
170
|
|
|
107
|
-
|
|
171
|
+
`client.context.ingest()` handles both knowledge files and memory, selected via the `type` field (`"knowledge"` or `"memory"`).
|
|
108
172
|
|
|
109
|
-
###
|
|
173
|
+
### Ingest one file
|
|
110
174
|
|
|
111
|
-
|
|
175
|
+
`documents` accepts a list of uploadable files. Each entry can be a file path (`{ path, filename?, contentType? }`), a file-like object with metadata (`{ data, filename?, contentType? }`), or a raw buffer/blob/stream.
|
|
112
176
|
|
|
113
177
|
```ts
|
|
114
|
-
|
|
178
|
+
const uploadResult = await client.context.ingest({
|
|
179
|
+
tenantId: TENANT_ID,
|
|
180
|
+
subTenantId: SUB_TENANT_ID,
|
|
181
|
+
type: "knowledge",
|
|
182
|
+
documents: [
|
|
183
|
+
{
|
|
184
|
+
path: "./report.pdf",
|
|
185
|
+
filename: "report.pdf",
|
|
186
|
+
contentType: "application/pdf",
|
|
187
|
+
},
|
|
188
|
+
],
|
|
189
|
+
upsert: true,
|
|
190
|
+
});
|
|
115
191
|
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
192
|
+
console.log(uploadResult);
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
The initial response typically reports a `queued` status — the file was accepted into the ingestion queue, not finished. Use `client.context.status()` to track progress.
|
|
196
|
+
|
|
197
|
+
### Ingest multiple files
|
|
198
|
+
|
|
199
|
+
```ts
|
|
200
|
+
await client.context.ingest({
|
|
201
|
+
tenantId: TENANT_ID,
|
|
202
|
+
subTenantId: SUB_TENANT_ID,
|
|
203
|
+
type: "knowledge",
|
|
204
|
+
documents: [
|
|
205
|
+
{ path: "./a.pdf", filename: "a.pdf", contentType: "application/pdf" },
|
|
206
|
+
{ path: "./notes.txt", filename: "notes.txt", contentType: "text/plain" },
|
|
122
207
|
],
|
|
123
208
|
upsert: true,
|
|
124
209
|
});
|
|
125
|
-
// uploadResult.results[0].source_id -> ID you can use later
|
|
126
210
|
```
|
|
127
211
|
|
|
128
|
-
|
|
212
|
+
Buffers, blobs, and streams also work:
|
|
213
|
+
|
|
214
|
+
```ts
|
|
215
|
+
import { readFileSync } from "node:fs";
|
|
216
|
+
|
|
217
|
+
await client.context.ingest({
|
|
218
|
+
tenantId: TENANT_ID,
|
|
219
|
+
subTenantId: SUB_TENANT_ID,
|
|
220
|
+
type: "knowledge",
|
|
221
|
+
documents: [
|
|
222
|
+
{
|
|
223
|
+
data: readFileSync("./report.pdf"),
|
|
224
|
+
filename: "report.pdf",
|
|
225
|
+
contentType: "application/pdf",
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
});
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
### Ingest files with per-file metadata
|
|
232
|
+
|
|
233
|
+
`documentMetadata` is a JSON **string** — a JSON array of per-file metadata objects (knowledge only). Each object may include `id`, `metadata`, `additional_metadata`, `infer`, and `relations`. Array length should match `documents`.
|
|
129
234
|
|
|
130
235
|
```ts
|
|
131
|
-
const
|
|
236
|
+
const documentMetadata = [
|
|
132
237
|
{
|
|
133
238
|
id: "doc_a",
|
|
134
|
-
|
|
135
|
-
|
|
239
|
+
metadata: { department: "sales" },
|
|
240
|
+
additional_metadata: { author: "Alice" },
|
|
136
241
|
},
|
|
137
242
|
{
|
|
138
243
|
id: "doc_b",
|
|
139
|
-
|
|
140
|
-
|
|
244
|
+
metadata: { department: "marketing" },
|
|
245
|
+
additional_metadata: { author: "Bob" },
|
|
141
246
|
relations: {
|
|
142
247
|
cortex_source_ids: ["doc_a"],
|
|
143
248
|
properties: { relation: "same_upload_batch" },
|
|
@@ -145,426 +250,494 @@ const fileMetadata = [
|
|
|
145
250
|
},
|
|
146
251
|
];
|
|
147
252
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
253
|
+
await client.context.ingest({
|
|
254
|
+
tenantId: TENANT_ID,
|
|
255
|
+
subTenantId: SUB_TENANT_ID,
|
|
256
|
+
type: "knowledge",
|
|
257
|
+
documents: [
|
|
258
|
+
{ path: "./a.pdf", filename: "a.pdf", contentType: "application/pdf" },
|
|
259
|
+
{ path: "./b.pdf", filename: "b.pdf", contentType: "application/pdf" },
|
|
154
260
|
],
|
|
155
|
-
|
|
261
|
+
documentMetadata: JSON.stringify(documentMetadata),
|
|
156
262
|
upsert: true,
|
|
157
263
|
});
|
|
158
264
|
```
|
|
159
265
|
|
|
160
|
-
###
|
|
266
|
+
### Ingest app-generated knowledge
|
|
161
267
|
|
|
162
|
-
|
|
268
|
+
`appKnowledge` is a JSON **string** — a single source object or an array of source objects (knowledge only).
|
|
163
269
|
|
|
164
270
|
```ts
|
|
165
|
-
const
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
271
|
+
const appKnowledge = [
|
|
272
|
+
{
|
|
273
|
+
id: "app_source_1",
|
|
274
|
+
title: "CRM Account Note",
|
|
275
|
+
content: { text: "Acme is interested in the enterprise plan." },
|
|
276
|
+
type: "document",
|
|
277
|
+
tenant_metadata: { department: "sales" },
|
|
278
|
+
document_metadata: { source: "crm" },
|
|
279
|
+
},
|
|
280
|
+
];
|
|
281
|
+
|
|
282
|
+
await client.context.ingest({
|
|
283
|
+
tenantId: TENANT_ID,
|
|
284
|
+
subTenantId: SUB_TENANT_ID,
|
|
285
|
+
type: "knowledge",
|
|
286
|
+
appKnowledge: JSON.stringify(appKnowledge),
|
|
287
|
+
upsert: true,
|
|
169
288
|
});
|
|
170
|
-
// status.statuses[0].indexing_status -> "queued" | "processing" | "completed" | "errored"
|
|
171
289
|
```
|
|
172
290
|
|
|
173
|
-
### Add
|
|
291
|
+
### Add memories
|
|
174
292
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
**Plain text:**
|
|
293
|
+
`memories` is a JSON **string** — a JSON array of memory items (memory only). Each item can include `text`, `title`, `infer`, and `metadata`.
|
|
178
294
|
|
|
179
295
|
```ts
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
296
|
+
const memories = [
|
|
297
|
+
{
|
|
298
|
+
source_id: "memory_001",
|
|
299
|
+
text: "User prefers detailed technical explanations.",
|
|
300
|
+
title: "User preference",
|
|
301
|
+
infer: true,
|
|
302
|
+
metadata: { category: "preference" },
|
|
303
|
+
},
|
|
304
|
+
];
|
|
305
|
+
|
|
306
|
+
await client.context.ingest({
|
|
307
|
+
tenantId: TENANT_ID,
|
|
308
|
+
subTenantId: SUB_TENANT_ID,
|
|
309
|
+
type: "memory",
|
|
310
|
+
memories: JSON.stringify(memories),
|
|
183
311
|
upsert: true,
|
|
184
|
-
memories: [
|
|
185
|
-
{
|
|
186
|
-
text: "User prefers detailed explanations and dark mode",
|
|
187
|
-
infer: true,
|
|
188
|
-
user_name: "John",
|
|
189
|
-
},
|
|
190
|
-
],
|
|
191
312
|
});
|
|
192
313
|
```
|
|
193
314
|
|
|
194
|
-
|
|
315
|
+
## Check ingestion status
|
|
316
|
+
|
|
317
|
+
`client.context.status()` reports indexing status for one or more source IDs. Pass a single `id` or a list via `ids`.
|
|
195
318
|
|
|
196
319
|
```ts
|
|
197
|
-
await client.
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
memories: [
|
|
202
|
-
{
|
|
203
|
-
text: "# Meeting Notes\n\n## Key Points\n- Budget approved\n- Launch date: Q2",
|
|
204
|
-
is_markdown: true,
|
|
205
|
-
infer: false,
|
|
206
|
-
title: "Meeting Notes",
|
|
207
|
-
},
|
|
208
|
-
],
|
|
320
|
+
const status = await client.context.status({
|
|
321
|
+
tenantId: TENANT_ID,
|
|
322
|
+
subTenantId: SUB_TENANT_ID,
|
|
323
|
+
ids: ["source-id-1", "source-id-2"],
|
|
209
324
|
});
|
|
325
|
+
|
|
326
|
+
console.log(status);
|
|
210
327
|
```
|
|
211
328
|
|
|
212
|
-
|
|
329
|
+
### Poll until ingestion finishes
|
|
213
330
|
|
|
214
331
|
```ts
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
332
|
+
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
333
|
+
|
|
334
|
+
async function waitForIngestion(ids: string[]) {
|
|
335
|
+
while (true) {
|
|
336
|
+
const status = await client.context.status({
|
|
337
|
+
tenantId: TENANT_ID,
|
|
338
|
+
subTenantId: SUB_TENANT_ID,
|
|
339
|
+
ids,
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
// Inspect the returned status fields (per the SourceStatusApiResponse
|
|
343
|
+
// schema) and break once everything has completed or errored.
|
|
344
|
+
console.log(status);
|
|
345
|
+
|
|
346
|
+
await sleep(5000);
|
|
347
|
+
}
|
|
348
|
+
}
|
|
231
349
|
```
|
|
232
350
|
|
|
233
|
-
|
|
351
|
+
## Query (retrieval)
|
|
352
|
+
|
|
353
|
+
`client.query()` is the single retrieval entry point. It searches knowledge, memory, or both, with optional graph context. It returns a promise resolving to a `QueryApiResponse`; the retrieval payload is on `.data`.
|
|
234
354
|
|
|
235
355
|
```ts
|
|
236
|
-
await client.
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
356
|
+
const response = await client.query({
|
|
357
|
+
tenantId: TENANT_ID,
|
|
358
|
+
subTenantId: SUB_TENANT_ID,
|
|
359
|
+
query: "What did the account notes say about Acme?",
|
|
360
|
+
maxResults: 10,
|
|
361
|
+
mode: "fast",
|
|
362
|
+
alpha: 0.8,
|
|
363
|
+
recencyBias: 0,
|
|
364
|
+
graphContext: true,
|
|
240
365
|
});
|
|
366
|
+
|
|
367
|
+
console.log(response.data?.chunks);
|
|
368
|
+
console.log(response.data?.sources);
|
|
241
369
|
```
|
|
242
370
|
|
|
243
|
-
|
|
371
|
+
### Search knowledge, memory, or both
|
|
244
372
|
|
|
245
|
-
|
|
373
|
+
Use the `type` field:
|
|
246
374
|
|
|
247
|
-
|
|
375
|
+
```ts
|
|
376
|
+
// Knowledge only
|
|
377
|
+
await client.query({ tenantId: TENANT_ID, query: "quarterly revenue", type: "knowledge" });
|
|
248
378
|
|
|
249
|
-
|
|
379
|
+
// Memory only
|
|
380
|
+
await client.query({ tenantId: TENANT_ID, query: "user preferences", type: "memory" });
|
|
250
381
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
tenant_id: TENANT_ID,
|
|
254
|
-
sub_tenant_id: SUB_TENANT_ID,
|
|
255
|
-
query: "Which mode does the user prefer?",
|
|
256
|
-
alpha: 0.8, // 1.0 = pure semantic, 0.0 = pure keyword
|
|
257
|
-
recency_bias: 0, // 0.0 = no bias, 1.0 = strongly prefer recent
|
|
258
|
-
max_results: 10,
|
|
259
|
-
});
|
|
260
|
-
// results.chunks -> VectorStoreChunk[]
|
|
261
|
-
// results.sources -> SourceInfo[]
|
|
382
|
+
// Both, merged
|
|
383
|
+
await client.query({ tenantId: TENANT_ID, query: "what does the user prefer", type: "all" });
|
|
262
384
|
```
|
|
263
385
|
|
|
264
|
-
###
|
|
386
|
+
### Hybrid vs. keyword search
|
|
387
|
+
|
|
388
|
+
`alpha` controls the hybrid balance and can be a number in `0.0`–`1.0` or the string `"auto"`:
|
|
265
389
|
|
|
266
|
-
|
|
390
|
+
- `1.0`: more semantic/vector weighted
|
|
391
|
+
- `0.0`: more keyword/BM25 weighted
|
|
392
|
+
- `"auto"`: backend chooses the balance
|
|
393
|
+
|
|
394
|
+
For pure keyword/BM25 search, set `queryBy: "text"` and choose an `operator`:
|
|
267
395
|
|
|
268
396
|
```ts
|
|
269
|
-
const
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
query: "
|
|
273
|
-
|
|
397
|
+
const response = await client.query({
|
|
398
|
+
tenantId: TENANT_ID,
|
|
399
|
+
subTenantId: SUB_TENANT_ID,
|
|
400
|
+
query: "enterprise plan",
|
|
401
|
+
queryBy: "text",
|
|
402
|
+
operator: "phrase", // "or" | "and" | "phrase"
|
|
403
|
+
type: "knowledge",
|
|
274
404
|
});
|
|
275
405
|
```
|
|
276
406
|
|
|
277
|
-
|
|
407
|
+
`queryBy` accepts `"hybrid"` (vector + BM25, default) or `"text"` (BM25 only). `operator` applies only when `queryBy: "text"`.
|
|
408
|
+
|
|
409
|
+
### Metadata filters
|
|
278
410
|
|
|
279
|
-
|
|
411
|
+
Top-level keys match tenant metadata (and must correspond to fields defined in `tenantMetadataSchema`). To filter on document-level fields you sent as `additional_metadata` at ingestion, nest them under `additional_metadata` (the key `document_metadata` is also accepted as a legacy alias).
|
|
280
412
|
|
|
281
413
|
```ts
|
|
282
|
-
const
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
query: "
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
414
|
+
const response = await client.query({
|
|
415
|
+
tenantId: TENANT_ID,
|
|
416
|
+
subTenantId: SUB_TENANT_ID,
|
|
417
|
+
query: "revenue forecast",
|
|
418
|
+
maxResults: 10,
|
|
419
|
+
metadataFilters: {
|
|
420
|
+
department: "sales",
|
|
421
|
+
additional_metadata: { author: "Alice" },
|
|
422
|
+
},
|
|
289
423
|
});
|
|
290
424
|
```
|
|
291
425
|
|
|
292
|
-
###
|
|
426
|
+
### All `query` options
|
|
293
427
|
|
|
294
|
-
|
|
428
|
+
| Option | Type | Description |
|
|
429
|
+
|---|---|---|
|
|
430
|
+
| `tenantId` | `string` | Tenant identifier (required). |
|
|
431
|
+
| `query` | `string` | Search terms (required). |
|
|
432
|
+
| `subTenantId` | `string` | Optional sub-tenant identifier. |
|
|
433
|
+
| `maxResults` | `number` | Maximum number of results. |
|
|
434
|
+
| `mode` | `string` | `"fast"` or `"thinking"`. |
|
|
435
|
+
| `alpha` | `string \| number` | Hybrid balance (`0.0`–`1.0` or `"auto"`). |
|
|
436
|
+
| `recencyBias` | `number` | Preference for newer content (`0.0`–`1.0`). |
|
|
437
|
+
| `graphContext` | `boolean` | Enable graph context (on by default in v2; set `false` to omit). |
|
|
438
|
+
| `queryForcefulRelations` | `boolean` | Search forceful relations in thinking mode. |
|
|
439
|
+
| `additionalContext` | `string` | Extra context to guide retrieval. |
|
|
440
|
+
| `queryApps` | `boolean` | Run a parallel app-aware retrieval lane and fuse results. |
|
|
441
|
+
| `metadataFilters` | `object` | Key-value metadata filters. |
|
|
442
|
+
| `type` | `string` | `"knowledge"`, `"memory"`, or `"all"`. |
|
|
443
|
+
| `queryBy` | `string` | `"hybrid"` or `"text"`. |
|
|
444
|
+
| `operator` | `string` | `"or"`, `"and"`, or `"phrase"` (only with `queryBy: "text"`). |
|
|
295
445
|
|
|
296
|
-
|
|
297
|
-
const answer = await client.recall.qna({
|
|
298
|
-
tenant_id: TENANT_ID,
|
|
299
|
-
sub_tenant_id: SUB_TENANT_ID,
|
|
300
|
-
question: "What is the user's preferred reporting format?",
|
|
301
|
-
mode: "fast", // "fast" | "thinking"
|
|
302
|
-
search_mode: "memories",
|
|
303
|
-
max_chunks: 6,
|
|
304
|
-
});
|
|
305
|
-
```
|
|
446
|
+
## Formatting results for an LLM
|
|
306
447
|
|
|
307
|
-
|
|
448
|
+
`buildString` formats a query result (or its `.data`) into a plain string ready for prompt injection. It is exported from the package root and from `@hydradb/sdk/helpers`.
|
|
308
449
|
|
|
309
450
|
```ts
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
llm_provider: "anthropic",
|
|
318
|
-
model: "claude-sonnet-4-6",
|
|
319
|
-
temperature: 0.2,
|
|
320
|
-
max_tokens: 1024,
|
|
451
|
+
import { HydraDBClient, buildString } from "@hydradb/sdk";
|
|
452
|
+
|
|
453
|
+
const client = new HydraDBClient({ token: process.env.HYDRA_DB_API_KEY });
|
|
454
|
+
|
|
455
|
+
const response = await client.query({
|
|
456
|
+
tenantId: TENANT_ID,
|
|
457
|
+
query: "What does the user prefer?",
|
|
321
458
|
});
|
|
322
|
-
```
|
|
323
459
|
|
|
324
|
-
|
|
460
|
+
// Pass the full envelope or just the data — buildString handles both.
|
|
461
|
+
console.log(buildString(response));
|
|
462
|
+
console.log(buildString(response.data!));
|
|
463
|
+
```
|
|
325
464
|
|
|
326
|
-
|
|
465
|
+
The output renders chunks under a `=== CONTEXT ===` header, with graph relations and synthesis context appended when present. If there is nothing to render, it returns `"No relevant context found."`.
|
|
327
466
|
|
|
328
|
-
|
|
467
|
+
## Inspect, list, and delete sources
|
|
329
468
|
|
|
330
|
-
List sources
|
|
469
|
+
### List sources
|
|
331
470
|
|
|
332
471
|
```ts
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
kind: "knowledge",
|
|
472
|
+
const sources = await client.context.list({
|
|
473
|
+
tenantId: TENANT_ID,
|
|
474
|
+
subTenantId: SUB_TENANT_ID,
|
|
475
|
+
type: "knowledge",
|
|
338
476
|
page: 1,
|
|
339
|
-
|
|
477
|
+
pageSize: 50,
|
|
340
478
|
});
|
|
341
479
|
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
480
|
+
console.log(sources);
|
|
481
|
+
```
|
|
482
|
+
|
|
483
|
+
List memories with `type: "memory"`.
|
|
484
|
+
|
|
485
|
+
### Fetch specific source IDs
|
|
486
|
+
|
|
487
|
+
```ts
|
|
488
|
+
const sources = await client.context.list({
|
|
489
|
+
tenantId: TENANT_ID,
|
|
490
|
+
subTenantId: SUB_TENANT_ID,
|
|
491
|
+
type: "knowledge",
|
|
492
|
+
ids: ["doc_a", "doc_b"],
|
|
347
493
|
});
|
|
348
494
|
```
|
|
349
495
|
|
|
350
|
-
Filter
|
|
496
|
+
### Filter listed data
|
|
351
497
|
|
|
352
498
|
```ts
|
|
353
|
-
const filtered = await client.
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
499
|
+
const filtered = await client.context.list({
|
|
500
|
+
tenantId: TENANT_ID,
|
|
501
|
+
subTenantId: SUB_TENANT_ID,
|
|
502
|
+
type: "knowledge",
|
|
357
503
|
filters: {
|
|
358
|
-
tenant_metadata: {
|
|
504
|
+
tenant_metadata: { department: "sales" },
|
|
505
|
+
document_metadata: { author: "Alice" },
|
|
359
506
|
},
|
|
360
507
|
});
|
|
361
508
|
```
|
|
362
509
|
|
|
363
|
-
###
|
|
510
|
+
### Include only selected fields
|
|
511
|
+
|
|
512
|
+
```ts
|
|
513
|
+
const sources = await client.context.list({
|
|
514
|
+
tenantId: TENANT_ID,
|
|
515
|
+
subTenantId: SUB_TENANT_ID,
|
|
516
|
+
type: "knowledge",
|
|
517
|
+
includeFields: ["title", "document_metadata", "tenant_metadata"],
|
|
518
|
+
});
|
|
519
|
+
```
|
|
520
|
+
|
|
521
|
+
Allowed field names:
|
|
522
|
+
|
|
523
|
+
```text
|
|
524
|
+
attachments, content, description, document_metadata, note, relations,
|
|
525
|
+
tenant_metadata, timestamp, title, type, url
|
|
526
|
+
```
|
|
364
527
|
|
|
365
|
-
|
|
528
|
+
### Inspect a single source
|
|
366
529
|
|
|
367
530
|
```ts
|
|
368
|
-
const source = await client.
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
mode: "content",
|
|
531
|
+
const source = await client.context.inspect({
|
|
532
|
+
tenantId: TENANT_ID,
|
|
533
|
+
subTenantId: SUB_TENANT_ID,
|
|
534
|
+
id: "source-id-1",
|
|
535
|
+
mode: "content",
|
|
373
536
|
});
|
|
537
|
+
|
|
538
|
+
console.log(source);
|
|
374
539
|
```
|
|
375
540
|
|
|
376
|
-
|
|
541
|
+
Supported `mode` values: `content` | `url` | `both`. For presigned URLs, set `expirySeconds`:
|
|
542
|
+
|
|
543
|
+
```ts
|
|
544
|
+
const source = await client.context.inspect({
|
|
545
|
+
tenantId: TENANT_ID,
|
|
546
|
+
subTenantId: SUB_TENANT_ID,
|
|
547
|
+
id: "source-id-1",
|
|
548
|
+
mode: "url",
|
|
549
|
+
expirySeconds: 3600,
|
|
550
|
+
});
|
|
551
|
+
```
|
|
377
552
|
|
|
378
|
-
|
|
553
|
+
### Fetch graph relations
|
|
379
554
|
|
|
380
555
|
```ts
|
|
381
|
-
const relations = await client.
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
556
|
+
const relations = await client.context.relations({
|
|
557
|
+
tenantId: TENANT_ID,
|
|
558
|
+
subTenantId: SUB_TENANT_ID,
|
|
559
|
+
id: "source-id-1",
|
|
560
|
+
type: "knowledge",
|
|
386
561
|
limit: 10,
|
|
387
562
|
});
|
|
563
|
+
|
|
564
|
+
console.log(relations);
|
|
388
565
|
```
|
|
389
566
|
|
|
390
|
-
|
|
567
|
+
Omit `id` to fetch relations across the whole sub-tenant. Use `cursor` for pagination.
|
|
391
568
|
|
|
392
|
-
|
|
569
|
+
### Delete sources
|
|
393
570
|
|
|
394
|
-
|
|
571
|
+
Use `type` to target knowledge or memory.
|
|
395
572
|
|
|
396
573
|
```ts
|
|
397
|
-
await client.
|
|
398
|
-
|
|
399
|
-
|
|
574
|
+
await client.context.delete({
|
|
575
|
+
tenantId: TENANT_ID,
|
|
576
|
+
subTenantId: SUB_TENANT_ID,
|
|
400
577
|
ids: ["source-id-1", "source-id-2"],
|
|
578
|
+
type: "knowledge",
|
|
401
579
|
});
|
|
402
580
|
```
|
|
403
581
|
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
## API Key Management
|
|
582
|
+
## Webhooks
|
|
407
583
|
|
|
408
|
-
|
|
584
|
+
Hydra DB can notify your application about events such as indexing status changes.
|
|
409
585
|
|
|
410
|
-
|
|
586
|
+
### Register a webhook
|
|
411
587
|
|
|
412
588
|
```ts
|
|
413
|
-
const
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
prefix: "sk",
|
|
589
|
+
const hook = await client.webhooks.register({
|
|
590
|
+
url: "https://example.com/hydra-webhook",
|
|
591
|
+
eventTypes: ["indexing.status_changed"],
|
|
592
|
+
signingSecret: "a-secret-at-least-16-chars",
|
|
418
593
|
});
|
|
419
|
-
// newKey.full_api_key -> the actual key (only shown once)
|
|
420
|
-
```
|
|
421
594
|
|
|
422
|
-
|
|
595
|
+
console.log(hook);
|
|
596
|
+
```
|
|
423
597
|
|
|
424
|
-
|
|
598
|
+
When `signingSecret` is set, every delivery includes an `X-HydraDB-Signature: sha256=<hmac>` header computed as `HMAC-SHA256(key=signingSecret, msg=raw_body)`. The secret must be at least 16 characters; omit it to disable signing.
|
|
425
599
|
|
|
426
|
-
|
|
600
|
+
### Get the current webhook
|
|
427
601
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
> await client.tenant.create({
|
|
432
|
-
> tenant_id: "my-embeddings-tenant",
|
|
433
|
-
> is_embeddings_tenant: true,
|
|
434
|
-
> embeddings_dimension: 1536,
|
|
435
|
-
> });
|
|
436
|
-
> ```
|
|
602
|
+
```ts
|
|
603
|
+
console.log(await client.webhooks.get());
|
|
604
|
+
```
|
|
437
605
|
|
|
438
|
-
###
|
|
606
|
+
### Delete the webhook
|
|
439
607
|
|
|
440
608
|
```ts
|
|
441
|
-
await client.
|
|
442
|
-
tenant_id: TENANT_ID,
|
|
443
|
-
sub_tenant_id: SUB_TENANT_ID,
|
|
444
|
-
upsert: true,
|
|
445
|
-
embeddings: [
|
|
446
|
-
{
|
|
447
|
-
source_id: "my-doc-001",
|
|
448
|
-
metadata: { category: "finance", year: 2024 },
|
|
449
|
-
embeddings: [
|
|
450
|
-
{ chunk_id: "my-doc-001-chunk-0", embedding: [0.1, 0.2, 0.3 /* ... 1536 dims */] },
|
|
451
|
-
{ chunk_id: "my-doc-001-chunk-1", embedding: [0.4, 0.5, 0.6 /* ... 1536 dims */] },
|
|
452
|
-
],
|
|
453
|
-
},
|
|
454
|
-
],
|
|
455
|
-
});
|
|
609
|
+
await client.webhooks.delete();
|
|
456
610
|
```
|
|
457
611
|
|
|
458
|
-
###
|
|
612
|
+
### Send a test event
|
|
459
613
|
|
|
460
|
-
|
|
614
|
+
```ts
|
|
615
|
+
await client.webhooks.test();
|
|
616
|
+
```
|
|
617
|
+
|
|
618
|
+
### List and inspect deliveries
|
|
461
619
|
|
|
462
620
|
```ts
|
|
463
|
-
const
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
query_embedding: [0.1, 0.2, 0.3 /* ... 1536 dims */],
|
|
467
|
-
limit: 10,
|
|
621
|
+
const deliveries = await client.webhooks.listDeliveries({
|
|
622
|
+
limit: 20,
|
|
623
|
+
status: "failed", // pending | failed | delivered | permanently_failed
|
|
468
624
|
});
|
|
469
|
-
|
|
625
|
+
console.log(deliveries);
|
|
626
|
+
|
|
627
|
+
const one = await client.webhooks.getDelivery({ deliveryId: "delivery_id" });
|
|
628
|
+
console.log(one);
|
|
470
629
|
```
|
|
471
630
|
|
|
472
|
-
|
|
631
|
+
Use `cursor` to paginate deliveries.
|
|
473
632
|
|
|
474
|
-
|
|
633
|
+
### Retry a delivery
|
|
475
634
|
|
|
476
635
|
```ts
|
|
477
|
-
|
|
478
|
-
const bySource = await client.embeddings.filter({
|
|
479
|
-
tenant_id: TENANT_ID,
|
|
480
|
-
sub_tenant_id: SUB_TENANT_ID,
|
|
481
|
-
source_id: "my-doc-001",
|
|
482
|
-
limit: 50,
|
|
483
|
-
});
|
|
484
|
-
|
|
485
|
-
// By chunk IDs
|
|
486
|
-
const byChunks = await client.embeddings.filter({
|
|
487
|
-
tenant_id: TENANT_ID,
|
|
488
|
-
sub_tenant_id: SUB_TENANT_ID,
|
|
489
|
-
chunk_ids: ["my-doc-001-chunk-0", "my-doc-001-chunk-1"],
|
|
490
|
-
});
|
|
636
|
+
await client.webhooks.retryDelivery({ deliveryId: "delivery_id" });
|
|
491
637
|
```
|
|
492
638
|
|
|
493
|
-
|
|
639
|
+
## Accessing raw responses
|
|
640
|
+
|
|
641
|
+
Most methods return an `HttpResponsePromise`, which you can `await` for the parsed body or call `.withRawResponse()` on to also get headers and status.
|
|
494
642
|
|
|
495
643
|
```ts
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
sub_tenant_id: SUB_TENANT_ID,
|
|
500
|
-
source_id: "my-doc-001",
|
|
501
|
-
});
|
|
644
|
+
const { data, rawResponse } = await client
|
|
645
|
+
.query({ tenantId: TENANT_ID, query: "revenue" })
|
|
646
|
+
.withRawResponse();
|
|
502
647
|
|
|
503
|
-
|
|
504
|
-
await client.embeddings.delete({
|
|
505
|
-
tenant_id: TENANT_ID,
|
|
506
|
-
sub_tenant_id: SUB_TENANT_ID,
|
|
507
|
-
chunk_ids: ["my-doc-001-chunk-0"],
|
|
508
|
-
});
|
|
648
|
+
console.log(rawResponse.status, data.data?.chunks);
|
|
509
649
|
```
|
|
510
650
|
|
|
511
|
-
|
|
651
|
+
## Passthrough fetch
|
|
512
652
|
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
Retrieve platform-level health and usage metrics:
|
|
653
|
+
Use `client.fetch()` for endpoints not yet wrapped by the SDK. It uses the SDK's configured auth, base URL, timeout, and retry settings. Relative paths resolve against the configured base URL.
|
|
516
654
|
|
|
517
655
|
```ts
|
|
518
|
-
const
|
|
656
|
+
const response = await client.fetch("/metrics", { method: "GET" });
|
|
657
|
+
const data = await response.json();
|
|
519
658
|
```
|
|
520
659
|
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
## SDK Method Reference
|
|
660
|
+
## Error handling
|
|
524
661
|
|
|
525
|
-
|
|
662
|
+
```ts
|
|
663
|
+
import {
|
|
664
|
+
HydraDBError,
|
|
665
|
+
HydraDBTimeoutError,
|
|
666
|
+
HydraDB,
|
|
667
|
+
} from "@hydradb/sdk";
|
|
668
|
+
|
|
669
|
+
try {
|
|
670
|
+
await client.context.ingest({
|
|
671
|
+
tenantId: TENANT_ID,
|
|
672
|
+
subTenantId: SUB_TENANT_ID,
|
|
673
|
+
type: "knowledge",
|
|
674
|
+
documents: [{ path: "./missing.pdf" }],
|
|
675
|
+
});
|
|
676
|
+
} catch (error) {
|
|
677
|
+
if (error instanceof HydraDBTimeoutError) {
|
|
678
|
+
console.error("Request timed out", error);
|
|
679
|
+
} else if (error instanceof HydraDB.UnauthorizedError) {
|
|
680
|
+
console.error("Invalid or missing API key");
|
|
681
|
+
} else if (error instanceof HydraDBError) {
|
|
682
|
+
console.error("Hydra DB API error", error.statusCode, error.body);
|
|
683
|
+
} else {
|
|
684
|
+
console.error("Unexpected error", error);
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
```
|
|
688
|
+
|
|
689
|
+
Typed status errors are available under the `HydraDB` namespace:
|
|
690
|
+
|
|
691
|
+
```text
|
|
692
|
+
HydraDB.BadRequestError
|
|
693
|
+
HydraDB.UnauthorizedError
|
|
694
|
+
HydraDB.ForbiddenError
|
|
695
|
+
HydraDB.NotFoundError
|
|
696
|
+
HydraDB.UnprocessableEntityError
|
|
697
|
+
HydraDB.TooManyRequestsError
|
|
698
|
+
HydraDB.InternalServerError
|
|
699
|
+
HydraDB.ServiceUnavailableError
|
|
700
|
+
```
|
|
701
|
+
|
|
702
|
+
`HydraDBError` (base) and `HydraDBTimeoutError` are exported from the package root.
|
|
703
|
+
|
|
704
|
+
## SDK method reference
|
|
705
|
+
|
|
706
|
+
| SDK method | Description |
|
|
526
707
|
|---|---|
|
|
527
|
-
| `client.
|
|
528
|
-
| `client.
|
|
529
|
-
| `client.
|
|
530
|
-
| `client.
|
|
531
|
-
| `client.
|
|
532
|
-
| `client.
|
|
533
|
-
| `client.
|
|
534
|
-
| `client.
|
|
535
|
-
| `client.
|
|
536
|
-
| `client.
|
|
537
|
-
| `client.
|
|
538
|
-
| `client.
|
|
539
|
-
| `client.
|
|
540
|
-
| `client.
|
|
541
|
-
| `client.
|
|
542
|
-
| `client.
|
|
543
|
-
| `client.
|
|
544
|
-
| `client.
|
|
545
|
-
| `client.
|
|
546
|
-
| `client.
|
|
547
|
-
| `client.
|
|
548
|
-
| `
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
The
|
|
560
|
-
|
|
561
|
-
- **Request parameters** — every field (required, optional, type, validation) is reflected in the method signature
|
|
562
|
-
- **Response objects** — return types match the exact JSON schema from each endpoint
|
|
563
|
-
- **Nested objects** — complex parameters and responses preserve their full structure
|
|
564
|
-
|
|
565
|
-
Your IDE will automatically provide autocompletion, type-checking, inline documentation, and compile-time validation for every method. Just hit **Cmd+Space / Ctrl+Space**.
|
|
566
|
-
|
|
567
|
-
---
|
|
708
|
+
| `client.query()` | Retrieve knowledge and/or memory in a single call. |
|
|
709
|
+
| `client.context.ingest()` | Ingest knowledge files, app-generated knowledge, or memories. |
|
|
710
|
+
| `client.context.status()` | Check ingestion/indexing status for source IDs. |
|
|
711
|
+
| `client.context.inspect()` | Fetch a single source's content or URL. |
|
|
712
|
+
| `client.context.list()` | List knowledge sources or memories. |
|
|
713
|
+
| `client.context.delete()` | Delete one or more source IDs. |
|
|
714
|
+
| `client.context.relations()` | Fetch graph relations for a source or sub-tenant. |
|
|
715
|
+
| `client.tenants.create()` | Create a standard or embeddings tenant. |
|
|
716
|
+
| `client.tenants.list()` | List tenants. |
|
|
717
|
+
| `client.tenants.delete()` | Delete a tenant. |
|
|
718
|
+
| `client.tenants.status()` | Check tenant infrastructure status. |
|
|
719
|
+
| `client.tenants.subTenants()` | List sub-tenants for a tenant. |
|
|
720
|
+
| `client.tenants.stats()` | Get tenant stats. |
|
|
721
|
+
| `client.webhooks.register()` | Register a webhook. |
|
|
722
|
+
| `client.webhooks.get()` | Get the current webhook. |
|
|
723
|
+
| `client.webhooks.delete()` | Delete the webhook. |
|
|
724
|
+
| `client.webhooks.test()` | Send a test event. |
|
|
725
|
+
| `client.webhooks.listDeliveries()` | List webhook deliveries. |
|
|
726
|
+
| `client.webhooks.getDelivery()` | Get a single delivery. |
|
|
727
|
+
| `client.webhooks.retryDelivery()` | Retry a delivery. |
|
|
728
|
+
| `client.fetch()` | Authenticated passthrough request. |
|
|
729
|
+
| `buildString()` | Format a query result into an LLM-ready string. |
|
|
730
|
+
|
|
731
|
+
## Notes for contributors
|
|
732
|
+
|
|
733
|
+
This SDK is generated from the Hydra DB API definition with Fern. The generated clients live in `Client.ts` and under `api/resources/{context,tenants,webhooks}/client/Client.ts`. If method signatures change in the generated code, update this README to match.
|
|
734
|
+
|
|
735
|
+
Before publishing, verify these stay consistent:
|
|
736
|
+
|
|
737
|
+
- Package name and version in `package.json` (`@hydradb/sdk`)
|
|
738
|
+
- Installation command in this README
|
|
739
|
+
- Request fields use camelCase
|
|
740
|
+
- The ingest payload shapes (`documentMetadata`, `appKnowledge`, and `memories` are JSON strings)
|
|
568
741
|
|
|
569
742
|
## Links
|
|
570
743
|
|
|
@@ -574,5 +747,4 @@ Your IDE will automatically provide autocompletion, type-checking, inline docume
|
|
|
574
747
|
|
|
575
748
|
## Support
|
|
576
749
|
|
|
577
|
-
If you have any questions or need help, reach out at [founders@hydradb.com](mailto:founders@
|
|
578
|
-
|
|
750
|
+
If you have any questions or need help, reach out at [founders@hydradb.com](mailto:founders@hydradb.com).
|