@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
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.list = list;
|
|
4
|
+
const Schema_js_1 = require("../../Schema.js");
|
|
5
|
+
const getErrorMessageForIncorrectType_js_1 = require("../../utils/getErrorMessageForIncorrectType.js");
|
|
6
|
+
const maybeSkipValidation_js_1 = require("../../utils/maybeSkipValidation.js");
|
|
7
|
+
const index_js_1 = require("../schema-utils/index.js");
|
|
8
|
+
function list(schema) {
|
|
9
|
+
const baseSchema = {
|
|
10
|
+
parse: (raw, opts) => validateAndTransformArray(raw, (item, index) => schema.parse(item, {
|
|
11
|
+
...opts,
|
|
12
|
+
breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`],
|
|
13
|
+
})),
|
|
14
|
+
json: (parsed, opts) => validateAndTransformArray(parsed, (item, index) => schema.json(item, {
|
|
15
|
+
...opts,
|
|
16
|
+
breadcrumbsPrefix: [...(opts?.breadcrumbsPrefix ?? []), `[${index}]`],
|
|
17
|
+
})),
|
|
18
|
+
getType: () => Schema_js_1.SchemaType.LIST,
|
|
19
|
+
};
|
|
20
|
+
return {
|
|
21
|
+
...(0, maybeSkipValidation_js_1.maybeSkipValidation)(baseSchema),
|
|
22
|
+
...(0, index_js_1.getSchemaUtils)(baseSchema),
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
function validateAndTransformArray(value, transformItem) {
|
|
26
|
+
if (!Array.isArray(value)) {
|
|
27
|
+
return {
|
|
28
|
+
ok: false,
|
|
29
|
+
errors: [
|
|
30
|
+
{
|
|
31
|
+
message: (0, getErrorMessageForIncorrectType_js_1.getErrorMessageForIncorrectType)(value, "list"),
|
|
32
|
+
path: [],
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
const result = [];
|
|
38
|
+
const errors = [];
|
|
39
|
+
for (let i = 0; i < value.length; i++) {
|
|
40
|
+
const item = transformItem(value[i], i);
|
|
41
|
+
if (item.ok) {
|
|
42
|
+
result.push(item.value);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
errors.push(...item.errors);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
if (errors.length === 0) {
|
|
49
|
+
return { ok: true, value: result };
|
|
50
|
+
}
|
|
51
|
+
return { ok: false, errors };
|
|
52
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.booleanLiteral = booleanLiteral;
|
|
4
|
+
const Schema_js_1 = require("../../Schema.js");
|
|
5
|
+
const createIdentitySchemaCreator_js_1 = require("../../utils/createIdentitySchemaCreator.js");
|
|
6
|
+
const getErrorMessageForIncorrectType_js_1 = require("../../utils/getErrorMessageForIncorrectType.js");
|
|
7
|
+
function booleanLiteral(literal) {
|
|
8
|
+
const schemaCreator = (0, createIdentitySchemaCreator_js_1.createIdentitySchemaCreator)(Schema_js_1.SchemaType.BOOLEAN_LITERAL, (value, { breadcrumbsPrefix = [] } = {}) => {
|
|
9
|
+
if (value === literal) {
|
|
10
|
+
return {
|
|
11
|
+
ok: true,
|
|
12
|
+
value: literal,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return {
|
|
17
|
+
ok: false,
|
|
18
|
+
errors: [
|
|
19
|
+
{
|
|
20
|
+
path: breadcrumbsPrefix,
|
|
21
|
+
message: (0, getErrorMessageForIncorrectType_js_1.getErrorMessageForIncorrectType)(value, `${literal.toString()}`),
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return schemaCreator();
|
|
28
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stringLiteral = exports.booleanLiteral = void 0;
|
|
4
|
+
var booleanLiteral_js_1 = require("./booleanLiteral.js");
|
|
5
|
+
Object.defineProperty(exports, "booleanLiteral", { enumerable: true, get: function () { return booleanLiteral_js_1.booleanLiteral; } });
|
|
6
|
+
var stringLiteral_js_1 = require("./stringLiteral.js");
|
|
7
|
+
Object.defineProperty(exports, "stringLiteral", { enumerable: true, get: function () { return stringLiteral_js_1.stringLiteral; } });
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stringLiteral = stringLiteral;
|
|
4
|
+
const Schema_js_1 = require("../../Schema.js");
|
|
5
|
+
const createIdentitySchemaCreator_js_1 = require("../../utils/createIdentitySchemaCreator.js");
|
|
6
|
+
const getErrorMessageForIncorrectType_js_1 = require("../../utils/getErrorMessageForIncorrectType.js");
|
|
7
|
+
function stringLiteral(literal) {
|
|
8
|
+
const schemaCreator = (0, createIdentitySchemaCreator_js_1.createIdentitySchemaCreator)(Schema_js_1.SchemaType.STRING_LITERAL, (value, { breadcrumbsPrefix = [] } = {}) => {
|
|
9
|
+
if (value === literal) {
|
|
10
|
+
return {
|
|
11
|
+
ok: true,
|
|
12
|
+
value: literal,
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return {
|
|
17
|
+
ok: false,
|
|
18
|
+
errors: [
|
|
19
|
+
{
|
|
20
|
+
path: breadcrumbsPrefix,
|
|
21
|
+
message: (0, getErrorMessageForIncorrectType_js_1.getErrorMessageForIncorrectType)(value, `"${literal}"`),
|
|
22
|
+
},
|
|
23
|
+
],
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return schemaCreator();
|
|
28
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { getObjectUtils, object } from "./object.js";
|
|
2
|
+
export type { inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas, inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas, } from "./objectWithoutOptionalProperties.js";
|
|
3
|
+
export { objectWithoutOptionalProperties } from "./objectWithoutOptionalProperties.js";
|
|
4
|
+
export type { Property } from "./property.js";
|
|
5
|
+
export { isProperty, property } from "./property.js";
|
|
6
|
+
export type { BaseObjectSchema, inferObjectSchemaFromPropertySchemas, inferParsedObject, inferParsedObjectFromPropertySchemas, inferParsedPropertySchema, inferRawKey, inferRawObject, inferRawObjectFromPropertySchemas, inferRawPropertySchema, ObjectSchema, ObjectUtils, PropertySchemas, } from "./types.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.property = exports.isProperty = exports.objectWithoutOptionalProperties = exports.object = exports.getObjectUtils = void 0;
|
|
4
|
+
var object_js_1 = require("./object.js");
|
|
5
|
+
Object.defineProperty(exports, "getObjectUtils", { enumerable: true, get: function () { return object_js_1.getObjectUtils; } });
|
|
6
|
+
Object.defineProperty(exports, "object", { enumerable: true, get: function () { return object_js_1.object; } });
|
|
7
|
+
var objectWithoutOptionalProperties_js_1 = require("./objectWithoutOptionalProperties.js");
|
|
8
|
+
Object.defineProperty(exports, "objectWithoutOptionalProperties", { enumerable: true, get: function () { return objectWithoutOptionalProperties_js_1.objectWithoutOptionalProperties; } });
|
|
9
|
+
var property_js_1 = require("./property.js");
|
|
10
|
+
Object.defineProperty(exports, "isProperty", { enumerable: true, get: function () { return property_js_1.isProperty; } });
|
|
11
|
+
Object.defineProperty(exports, "property", { enumerable: true, get: function () { return property_js_1.property; } });
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BaseObjectSchema, inferObjectSchemaFromPropertySchemas, ObjectUtils, PropertySchemas } from "./types.js";
|
|
2
|
+
export declare function object<ParsedKeys extends string, T extends PropertySchemas<ParsedKeys>>(schemas: T): inferObjectSchemaFromPropertySchemas<T>;
|
|
3
|
+
export declare function getObjectUtils<Raw, Parsed>(schema: BaseObjectSchema<Raw, Parsed>): ObjectUtils<Raw, Parsed>;
|
|
@@ -0,0 +1,385 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.object = object;
|
|
4
|
+
exports.getObjectUtils = getObjectUtils;
|
|
5
|
+
const Schema_js_1 = require("../../Schema.js");
|
|
6
|
+
const entries_js_1 = require("../../utils/entries.js");
|
|
7
|
+
const filterObject_js_1 = require("../../utils/filterObject.js");
|
|
8
|
+
const getErrorMessageForIncorrectType_js_1 = require("../../utils/getErrorMessageForIncorrectType.js");
|
|
9
|
+
const isPlainObject_js_1 = require("../../utils/isPlainObject.js");
|
|
10
|
+
const keys_js_1 = require("../../utils/keys.js");
|
|
11
|
+
const maybeSkipValidation_js_1 = require("../../utils/maybeSkipValidation.js");
|
|
12
|
+
const partition_js_1 = require("../../utils/partition.js");
|
|
13
|
+
const index_js_1 = require("../object-like/index.js");
|
|
14
|
+
const index_js_2 = require("../schema-utils/index.js");
|
|
15
|
+
const property_js_1 = require("./property.js");
|
|
16
|
+
// eslint-disable-next-line @typescript-eslint/unbound-method
|
|
17
|
+
const _hasOwn = Object.prototype.hasOwnProperty;
|
|
18
|
+
function object(schemas) {
|
|
19
|
+
// All property metadata is lazily computed on first use.
|
|
20
|
+
// This keeps schema construction free of iteration, which matters when
|
|
21
|
+
// many schemas are defined but only some are exercised at runtime.
|
|
22
|
+
// Required-key computation is also deferred because lazy() schemas may
|
|
23
|
+
// not be resolved at construction time.
|
|
24
|
+
let _rawKeyToProperty;
|
|
25
|
+
function getRawKeyToProperty() {
|
|
26
|
+
if (_rawKeyToProperty == null) {
|
|
27
|
+
_rawKeyToProperty = {};
|
|
28
|
+
for (const [parsedKey, schemaOrObjectProperty] of (0, entries_js_1.entries)(schemas)) {
|
|
29
|
+
const rawKey = (0, property_js_1.isProperty)(schemaOrObjectProperty)
|
|
30
|
+
? schemaOrObjectProperty.rawKey
|
|
31
|
+
: parsedKey;
|
|
32
|
+
const valueSchema = (0, property_js_1.isProperty)(schemaOrObjectProperty)
|
|
33
|
+
? schemaOrObjectProperty.valueSchema
|
|
34
|
+
: schemaOrObjectProperty;
|
|
35
|
+
_rawKeyToProperty[rawKey] = {
|
|
36
|
+
rawKey,
|
|
37
|
+
parsedKey: parsedKey,
|
|
38
|
+
valueSchema,
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return _rawKeyToProperty;
|
|
43
|
+
}
|
|
44
|
+
let _parseRequiredKeys;
|
|
45
|
+
let _jsonRequiredKeys;
|
|
46
|
+
let _parseRequiredKeysSet;
|
|
47
|
+
let _jsonRequiredKeysSet;
|
|
48
|
+
function getParseRequiredKeys() {
|
|
49
|
+
if (_parseRequiredKeys == null) {
|
|
50
|
+
_parseRequiredKeys = [];
|
|
51
|
+
_jsonRequiredKeys = [];
|
|
52
|
+
for (const [parsedKey, schemaOrObjectProperty] of (0, entries_js_1.entries)(schemas)) {
|
|
53
|
+
const rawKey = (0, property_js_1.isProperty)(schemaOrObjectProperty)
|
|
54
|
+
? schemaOrObjectProperty.rawKey
|
|
55
|
+
: parsedKey;
|
|
56
|
+
const valueSchema = (0, property_js_1.isProperty)(schemaOrObjectProperty)
|
|
57
|
+
? schemaOrObjectProperty.valueSchema
|
|
58
|
+
: schemaOrObjectProperty;
|
|
59
|
+
if (isSchemaRequired(valueSchema)) {
|
|
60
|
+
_parseRequiredKeys.push(rawKey);
|
|
61
|
+
_jsonRequiredKeys.push(parsedKey);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
_parseRequiredKeysSet = new Set(_parseRequiredKeys);
|
|
65
|
+
_jsonRequiredKeysSet = new Set(_jsonRequiredKeys);
|
|
66
|
+
}
|
|
67
|
+
return _parseRequiredKeys;
|
|
68
|
+
}
|
|
69
|
+
function getJsonRequiredKeys() {
|
|
70
|
+
if (_jsonRequiredKeys == null) {
|
|
71
|
+
getParseRequiredKeys();
|
|
72
|
+
}
|
|
73
|
+
return _jsonRequiredKeys;
|
|
74
|
+
}
|
|
75
|
+
function getParseRequiredKeysSet() {
|
|
76
|
+
if (_parseRequiredKeysSet == null) {
|
|
77
|
+
getParseRequiredKeys();
|
|
78
|
+
}
|
|
79
|
+
return _parseRequiredKeysSet;
|
|
80
|
+
}
|
|
81
|
+
function getJsonRequiredKeysSet() {
|
|
82
|
+
if (_jsonRequiredKeysSet == null) {
|
|
83
|
+
getParseRequiredKeys();
|
|
84
|
+
}
|
|
85
|
+
return _jsonRequiredKeysSet;
|
|
86
|
+
}
|
|
87
|
+
const baseSchema = {
|
|
88
|
+
_getRawProperties: () => Object.entries(schemas).map(([parsedKey, propertySchema]) => (0, property_js_1.isProperty)(propertySchema) ? propertySchema.rawKey : parsedKey),
|
|
89
|
+
_getParsedProperties: () => (0, keys_js_1.keys)(schemas),
|
|
90
|
+
parse: (raw, opts) => {
|
|
91
|
+
const breadcrumbsPrefix = opts?.breadcrumbsPrefix ?? [];
|
|
92
|
+
return validateAndTransformObject({
|
|
93
|
+
value: raw,
|
|
94
|
+
requiredKeys: getParseRequiredKeys(),
|
|
95
|
+
requiredKeysSet: getParseRequiredKeysSet(),
|
|
96
|
+
getProperty: (rawKey) => {
|
|
97
|
+
const property = getRawKeyToProperty()[rawKey];
|
|
98
|
+
if (property == null) {
|
|
99
|
+
return undefined;
|
|
100
|
+
}
|
|
101
|
+
return {
|
|
102
|
+
transformedKey: property.parsedKey,
|
|
103
|
+
transform: (propertyValue) => {
|
|
104
|
+
const childBreadcrumbs = [...breadcrumbsPrefix, rawKey];
|
|
105
|
+
return property.valueSchema.parse(propertyValue, {
|
|
106
|
+
...opts,
|
|
107
|
+
breadcrumbsPrefix: childBreadcrumbs,
|
|
108
|
+
});
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
},
|
|
112
|
+
unrecognizedObjectKeys: opts?.unrecognizedObjectKeys,
|
|
113
|
+
skipValidation: opts?.skipValidation,
|
|
114
|
+
breadcrumbsPrefix,
|
|
115
|
+
omitUndefined: opts?.omitUndefined,
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
json: (parsed, opts) => {
|
|
119
|
+
const breadcrumbsPrefix = opts?.breadcrumbsPrefix ?? [];
|
|
120
|
+
return validateAndTransformObject({
|
|
121
|
+
value: parsed,
|
|
122
|
+
requiredKeys: getJsonRequiredKeys(),
|
|
123
|
+
requiredKeysSet: getJsonRequiredKeysSet(),
|
|
124
|
+
getProperty: (parsedKey) => {
|
|
125
|
+
const property = schemas[parsedKey];
|
|
126
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
127
|
+
if (property == null) {
|
|
128
|
+
return undefined;
|
|
129
|
+
}
|
|
130
|
+
if ((0, property_js_1.isProperty)(property)) {
|
|
131
|
+
return {
|
|
132
|
+
transformedKey: property.rawKey,
|
|
133
|
+
transform: (propertyValue) => {
|
|
134
|
+
const childBreadcrumbs = [...breadcrumbsPrefix, parsedKey];
|
|
135
|
+
return property.valueSchema.json(propertyValue, {
|
|
136
|
+
...opts,
|
|
137
|
+
breadcrumbsPrefix: childBreadcrumbs,
|
|
138
|
+
});
|
|
139
|
+
},
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
return {
|
|
144
|
+
transformedKey: parsedKey,
|
|
145
|
+
transform: (propertyValue) => {
|
|
146
|
+
const childBreadcrumbs = [...breadcrumbsPrefix, parsedKey];
|
|
147
|
+
return property.json(propertyValue, {
|
|
148
|
+
...opts,
|
|
149
|
+
breadcrumbsPrefix: childBreadcrumbs,
|
|
150
|
+
});
|
|
151
|
+
},
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
},
|
|
155
|
+
unrecognizedObjectKeys: opts?.unrecognizedObjectKeys,
|
|
156
|
+
skipValidation: opts?.skipValidation,
|
|
157
|
+
breadcrumbsPrefix,
|
|
158
|
+
omitUndefined: opts?.omitUndefined,
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
getType: () => Schema_js_1.SchemaType.OBJECT,
|
|
162
|
+
};
|
|
163
|
+
return {
|
|
164
|
+
...(0, maybeSkipValidation_js_1.maybeSkipValidation)(baseSchema),
|
|
165
|
+
...(0, index_js_2.getSchemaUtils)(baseSchema),
|
|
166
|
+
...(0, index_js_1.getObjectLikeUtils)(baseSchema),
|
|
167
|
+
...getObjectUtils(baseSchema),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function validateAndTransformObject({ value, requiredKeys, requiredKeysSet, getProperty, unrecognizedObjectKeys = "fail", skipValidation = false, breadcrumbsPrefix = [], }) {
|
|
171
|
+
if (!(0, isPlainObject_js_1.isPlainObject)(value)) {
|
|
172
|
+
return {
|
|
173
|
+
ok: false,
|
|
174
|
+
errors: [
|
|
175
|
+
{
|
|
176
|
+
path: breadcrumbsPrefix,
|
|
177
|
+
message: (0, getErrorMessageForIncorrectType_js_1.getErrorMessageForIncorrectType)(value, "object"),
|
|
178
|
+
},
|
|
179
|
+
],
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
// Track which required keys have been seen.
|
|
183
|
+
// Use a counter instead of copying the Set to avoid per-call allocation.
|
|
184
|
+
let missingRequiredCount = requiredKeys.length;
|
|
185
|
+
const errors = [];
|
|
186
|
+
const transformed = {};
|
|
187
|
+
for (const preTransformedKey in value) {
|
|
188
|
+
if (!_hasOwn.call(value, preTransformedKey)) {
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
const preTransformedItemValue = value[preTransformedKey];
|
|
192
|
+
const property = getProperty(preTransformedKey);
|
|
193
|
+
if (property != null) {
|
|
194
|
+
if (missingRequiredCount > 0 && requiredKeysSet.has(preTransformedKey)) {
|
|
195
|
+
missingRequiredCount--;
|
|
196
|
+
}
|
|
197
|
+
const value = property.transform(preTransformedItemValue);
|
|
198
|
+
if (value.ok) {
|
|
199
|
+
transformed[property.transformedKey] = value.value;
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
transformed[preTransformedKey] = preTransformedItemValue;
|
|
203
|
+
errors.push(...value.errors);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
else {
|
|
207
|
+
switch (unrecognizedObjectKeys) {
|
|
208
|
+
case "fail":
|
|
209
|
+
errors.push({
|
|
210
|
+
path: [...breadcrumbsPrefix, preTransformedKey],
|
|
211
|
+
message: `Unexpected key "${preTransformedKey}"`,
|
|
212
|
+
});
|
|
213
|
+
break;
|
|
214
|
+
case "strip":
|
|
215
|
+
break;
|
|
216
|
+
case "passthrough":
|
|
217
|
+
transformed[preTransformedKey] = preTransformedItemValue;
|
|
218
|
+
break;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
if (missingRequiredCount > 0) {
|
|
223
|
+
for (const key of requiredKeys) {
|
|
224
|
+
if (!(key in value)) {
|
|
225
|
+
errors.push({
|
|
226
|
+
path: breadcrumbsPrefix,
|
|
227
|
+
message: `Missing required key "${key}"`,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
if (errors.length === 0 || skipValidation) {
|
|
233
|
+
return {
|
|
234
|
+
ok: true,
|
|
235
|
+
value: transformed,
|
|
236
|
+
};
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
return {
|
|
240
|
+
ok: false,
|
|
241
|
+
errors,
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
function getObjectUtils(schema) {
|
|
246
|
+
return {
|
|
247
|
+
extend: (extension) => {
|
|
248
|
+
const baseSchema = {
|
|
249
|
+
_getParsedProperties: () => [...schema._getParsedProperties(), ...extension._getParsedProperties()],
|
|
250
|
+
_getRawProperties: () => [...schema._getRawProperties(), ...extension._getRawProperties()],
|
|
251
|
+
parse: (raw, opts) => {
|
|
252
|
+
return validateAndTransformExtendedObject({
|
|
253
|
+
extensionKeys: extension._getRawProperties(),
|
|
254
|
+
value: raw,
|
|
255
|
+
transformBase: (rawBase) => schema.parse(rawBase, opts),
|
|
256
|
+
transformExtension: (rawExtension) => extension.parse(rawExtension, opts),
|
|
257
|
+
breadcrumbsPrefix: opts?.breadcrumbsPrefix,
|
|
258
|
+
});
|
|
259
|
+
},
|
|
260
|
+
json: (parsed, opts) => {
|
|
261
|
+
return validateAndTransformExtendedObject({
|
|
262
|
+
extensionKeys: extension._getParsedProperties(),
|
|
263
|
+
value: parsed,
|
|
264
|
+
transformBase: (parsedBase) => schema.json(parsedBase, opts),
|
|
265
|
+
transformExtension: (parsedExtension) => extension.json(parsedExtension, opts),
|
|
266
|
+
breadcrumbsPrefix: opts?.breadcrumbsPrefix,
|
|
267
|
+
});
|
|
268
|
+
},
|
|
269
|
+
getType: () => Schema_js_1.SchemaType.OBJECT,
|
|
270
|
+
};
|
|
271
|
+
return {
|
|
272
|
+
...baseSchema,
|
|
273
|
+
...(0, index_js_2.getSchemaUtils)(baseSchema),
|
|
274
|
+
...(0, index_js_1.getObjectLikeUtils)(baseSchema),
|
|
275
|
+
...getObjectUtils(baseSchema),
|
|
276
|
+
};
|
|
277
|
+
},
|
|
278
|
+
passthrough: () => {
|
|
279
|
+
const knownRawKeys = new Set(schema._getRawProperties());
|
|
280
|
+
const knownParsedKeys = new Set(schema._getParsedProperties());
|
|
281
|
+
const baseSchema = {
|
|
282
|
+
_getParsedProperties: () => schema._getParsedProperties(),
|
|
283
|
+
_getRawProperties: () => schema._getRawProperties(),
|
|
284
|
+
parse: (raw, opts) => {
|
|
285
|
+
const transformed = schema.parse(raw, { ...opts, unrecognizedObjectKeys: "passthrough" });
|
|
286
|
+
if (!transformed.ok) {
|
|
287
|
+
return transformed;
|
|
288
|
+
}
|
|
289
|
+
const extraProperties = {};
|
|
290
|
+
if (typeof raw === "object" && raw != null) {
|
|
291
|
+
for (const [key, value] of Object.entries(raw)) {
|
|
292
|
+
if (!knownRawKeys.has(key)) {
|
|
293
|
+
extraProperties[key] = value;
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
return {
|
|
298
|
+
ok: true,
|
|
299
|
+
value: {
|
|
300
|
+
...extraProperties,
|
|
301
|
+
...transformed.value,
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
},
|
|
305
|
+
json: (parsed, opts) => {
|
|
306
|
+
const transformed = schema.json(parsed, { ...opts, unrecognizedObjectKeys: "passthrough" });
|
|
307
|
+
if (!transformed.ok) {
|
|
308
|
+
return transformed;
|
|
309
|
+
}
|
|
310
|
+
const extraProperties = {};
|
|
311
|
+
if (typeof parsed === "object" && parsed != null) {
|
|
312
|
+
for (const [key, value] of Object.entries(parsed)) {
|
|
313
|
+
if (!knownParsedKeys.has(key)) {
|
|
314
|
+
extraProperties[key] = value;
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
}
|
|
318
|
+
return {
|
|
319
|
+
ok: true,
|
|
320
|
+
value: {
|
|
321
|
+
...extraProperties,
|
|
322
|
+
...transformed.value,
|
|
323
|
+
},
|
|
324
|
+
};
|
|
325
|
+
},
|
|
326
|
+
getType: () => Schema_js_1.SchemaType.OBJECT,
|
|
327
|
+
};
|
|
328
|
+
return {
|
|
329
|
+
...baseSchema,
|
|
330
|
+
...(0, index_js_2.getSchemaUtils)(baseSchema),
|
|
331
|
+
...(0, index_js_1.getObjectLikeUtils)(baseSchema),
|
|
332
|
+
...getObjectUtils(baseSchema),
|
|
333
|
+
};
|
|
334
|
+
},
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
function validateAndTransformExtendedObject({ extensionKeys, value, transformBase, transformExtension, breadcrumbsPrefix = [], }) {
|
|
338
|
+
if (!(0, isPlainObject_js_1.isPlainObject)(value)) {
|
|
339
|
+
return {
|
|
340
|
+
ok: false,
|
|
341
|
+
errors: [
|
|
342
|
+
{
|
|
343
|
+
path: breadcrumbsPrefix,
|
|
344
|
+
message: (0, getErrorMessageForIncorrectType_js_1.getErrorMessageForIncorrectType)(value, "object"),
|
|
345
|
+
},
|
|
346
|
+
],
|
|
347
|
+
};
|
|
348
|
+
}
|
|
349
|
+
const extensionPropertiesSet = new Set(extensionKeys);
|
|
350
|
+
const [extensionProperties, baseProperties] = (0, partition_js_1.partition)((0, keys_js_1.keys)(value), (key) => extensionPropertiesSet.has(key));
|
|
351
|
+
const transformedBase = transformBase((0, filterObject_js_1.filterObject)(value, baseProperties));
|
|
352
|
+
const transformedExtension = transformExtension((0, filterObject_js_1.filterObject)(value, extensionProperties));
|
|
353
|
+
if (transformedBase.ok && transformedExtension.ok) {
|
|
354
|
+
return {
|
|
355
|
+
ok: true,
|
|
356
|
+
value: {
|
|
357
|
+
...transformedBase.value,
|
|
358
|
+
...transformedExtension.value,
|
|
359
|
+
},
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
else {
|
|
363
|
+
return {
|
|
364
|
+
ok: false,
|
|
365
|
+
errors: [
|
|
366
|
+
...(transformedBase.ok ? [] : transformedBase.errors),
|
|
367
|
+
...(transformedExtension.ok ? [] : transformedExtension.errors),
|
|
368
|
+
],
|
|
369
|
+
};
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
function isSchemaRequired(schema) {
|
|
373
|
+
return !isSchemaOptional(schema);
|
|
374
|
+
}
|
|
375
|
+
function isSchemaOptional(schema) {
|
|
376
|
+
switch (schema.getType()) {
|
|
377
|
+
case Schema_js_1.SchemaType.ANY:
|
|
378
|
+
case Schema_js_1.SchemaType.UNKNOWN:
|
|
379
|
+
case Schema_js_1.SchemaType.OPTIONAL:
|
|
380
|
+
case Schema_js_1.SchemaType.OPTIONAL_NULLABLE:
|
|
381
|
+
return true;
|
|
382
|
+
default:
|
|
383
|
+
return false;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { inferParsedPropertySchema, inferRawObjectFromPropertySchemas, ObjectSchema, PropertySchemas } from "./types.js";
|
|
2
|
+
export declare function objectWithoutOptionalProperties<ParsedKeys extends string, T extends PropertySchemas<ParsedKeys>>(schemas: T): inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas<T>;
|
|
3
|
+
export type inferObjectWithoutOptionalPropertiesSchemaFromPropertySchemas<T extends PropertySchemas<keyof T>> = ObjectSchema<inferRawObjectFromPropertySchemas<T>, inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas<T>>;
|
|
4
|
+
export type inferParsedObjectWithoutOptionalPropertiesFromPropertySchemas<T extends PropertySchemas<keyof T>> = {
|
|
5
|
+
[K in keyof T]: inferParsedPropertySchema<T[K]>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.objectWithoutOptionalProperties = objectWithoutOptionalProperties;
|
|
4
|
+
const object_js_1 = require("./object.js");
|
|
5
|
+
function objectWithoutOptionalProperties(schemas) {
|
|
6
|
+
return (0, object_js_1.object)(schemas);
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Schema } from "../../Schema.js";
|
|
2
|
+
export declare function property<RawKey extends string, RawValue, ParsedValue>(rawKey: RawKey, valueSchema: Schema<RawValue, ParsedValue>): Property<RawKey, RawValue, ParsedValue>;
|
|
3
|
+
export interface Property<RawKey extends string, RawValue, ParsedValue> {
|
|
4
|
+
rawKey: RawKey;
|
|
5
|
+
valueSchema: Schema<RawValue, ParsedValue>;
|
|
6
|
+
isProperty: true;
|
|
7
|
+
}
|
|
8
|
+
export declare function isProperty<O extends Property<any, any, any>>(maybeProperty: unknown): maybeProperty is O;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.property = property;
|
|
4
|
+
exports.isProperty = isProperty;
|
|
5
|
+
function property(rawKey, valueSchema) {
|
|
6
|
+
return {
|
|
7
|
+
rawKey,
|
|
8
|
+
valueSchema,
|
|
9
|
+
isProperty: true,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function isProperty(maybeProperty) {
|
|
13
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
14
|
+
return maybeProperty.isProperty;
|
|
15
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { BaseSchema, inferParsed, inferRaw, Schema } from "../../Schema.js";
|
|
2
|
+
import type { addQuestionMarksToNullableProperties } from "../../utils/addQuestionMarksToNullableProperties.js";
|
|
3
|
+
import type { ObjectLikeUtils } from "../object-like/index.js";
|
|
4
|
+
import type { SchemaUtils } from "../schema-utils/index.js";
|
|
5
|
+
import type { Property } from "./property.js";
|
|
6
|
+
export type ObjectSchema<Raw, Parsed> = BaseObjectSchema<Raw, Parsed> & ObjectLikeUtils<Raw, Parsed> & ObjectUtils<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
|
|
7
|
+
export interface BaseObjectSchema<Raw, Parsed> extends BaseSchema<Raw, Parsed> {
|
|
8
|
+
_getRawProperties: () => (keyof Raw)[];
|
|
9
|
+
_getParsedProperties: () => (keyof Parsed)[];
|
|
10
|
+
}
|
|
11
|
+
export interface ObjectUtils<Raw, Parsed> {
|
|
12
|
+
extend: <RawExtension, ParsedExtension>(schemas: ObjectSchema<RawExtension, ParsedExtension>) => ObjectSchema<Raw & RawExtension, Parsed & ParsedExtension>;
|
|
13
|
+
passthrough: () => ObjectSchema<Raw & {
|
|
14
|
+
[key: string]: unknown;
|
|
15
|
+
}, Parsed & {
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}>;
|
|
18
|
+
}
|
|
19
|
+
export type inferRawObject<O extends ObjectSchema<any, any>> = O extends ObjectSchema<infer Raw, any> ? Raw : never;
|
|
20
|
+
export type inferParsedObject<O extends ObjectSchema<any, any>> = O extends ObjectSchema<any, infer Parsed> ? Parsed : never;
|
|
21
|
+
export type inferObjectSchemaFromPropertySchemas<T extends PropertySchemas<keyof T>> = ObjectSchema<inferRawObjectFromPropertySchemas<T>, inferParsedObjectFromPropertySchemas<T>>;
|
|
22
|
+
export type inferRawObjectFromPropertySchemas<T extends PropertySchemas<keyof T>> = addQuestionMarksToNullableProperties<{
|
|
23
|
+
[ParsedKey in keyof T as inferRawKey<ParsedKey, T[ParsedKey]>]: inferRawPropertySchema<T[ParsedKey]>;
|
|
24
|
+
}>;
|
|
25
|
+
export type inferParsedObjectFromPropertySchemas<T extends PropertySchemas<keyof T>> = addQuestionMarksToNullableProperties<{
|
|
26
|
+
[K in keyof T]: inferParsedPropertySchema<T[K]>;
|
|
27
|
+
}>;
|
|
28
|
+
export type PropertySchemas<ParsedKeys extends string | number | symbol> = Record<ParsedKeys, Property<any, any, any> | Schema<any, any>>;
|
|
29
|
+
export type inferRawPropertySchema<P extends Property<any, any, any> | Schema<any, any>> = P extends Property<any, infer Raw, any> ? Raw : P extends Schema<any, any> ? inferRaw<P> : never;
|
|
30
|
+
export type inferParsedPropertySchema<P extends Property<any, any, any> | Schema<any, any>> = P extends Property<any, any, infer Parsed> ? Parsed : P extends Schema<any, any> ? inferParsed<P> : never;
|
|
31
|
+
export type inferRawKey<ParsedKey extends string | number | symbol, P extends Property<any, any, any> | Schema<any, any>> = P extends Property<infer Raw, any, any> ? Raw : ParsedKey;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BaseSchema } from "../../Schema.js";
|
|
2
|
+
import type { ObjectLikeSchema, ObjectLikeUtils } from "./types.js";
|
|
3
|
+
export declare function getObjectLikeUtils<Raw, Parsed>(schema: BaseSchema<Raw, Parsed>): ObjectLikeUtils<Raw, Parsed>;
|
|
4
|
+
/**
|
|
5
|
+
* object-like utils are defined in one file to resolve issues with circular imports
|
|
6
|
+
*/
|
|
7
|
+
export declare function withParsedProperties<RawObjectShape, ParsedObjectShape, Properties>(objectLike: BaseSchema<RawObjectShape, ParsedObjectShape>, properties: {
|
|
8
|
+
[K in keyof Properties]: Properties[K] | ((parsed: ParsedObjectShape) => Properties[K]);
|
|
9
|
+
}): ObjectLikeSchema<RawObjectShape, ParsedObjectShape & Properties>;
|