@airtop/sdk 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Client.d.ts +33 -0
- package/Client.js +22 -0
- package/README.md +135 -0
- package/api/errors/InternalServerError.d.ts +8 -0
- package/api/errors/InternalServerError.js +41 -0
- package/api/errors/NotFoundError.d.ts +8 -0
- package/api/errors/NotFoundError.js +41 -0
- package/api/errors/UnprocessableEntityError.d.ts +8 -0
- package/api/errors/UnprocessableEntityError.js +41 -0
- package/api/errors/index.d.ts +3 -0
- package/api/errors/index.js +19 -0
- package/api/index.d.ts +3 -0
- package/api/index.js +19 -0
- package/api/resources/index.d.ts +5 -0
- package/api/resources/index.js +34 -0
- package/api/resources/profiles/client/Client.d.ts +66 -0
- package/api/resources/profiles/client/Client.js +296 -0
- package/api/resources/profiles/client/index.d.ts +1 -0
- package/api/resources/profiles/client/index.js +17 -0
- package/api/resources/profiles/client/requests/ProfilesDeleteRequest.d.ts +19 -0
- package/api/resources/profiles/client/requests/ProfilesDeleteRequest.js +5 -0
- package/api/resources/profiles/client/requests/ProfilesGetRequest.d.ts +19 -0
- package/api/resources/profiles/client/requests/ProfilesGetRequest.js +5 -0
- package/api/resources/profiles/client/requests/index.d.ts +2 -0
- package/api/resources/profiles/client/requests/index.js +2 -0
- package/api/resources/profiles/index.d.ts +1 -0
- package/api/resources/profiles/index.js +17 -0
- package/api/resources/sessions/client/Client.d.ts +132 -0
- package/api/resources/sessions/client/Client.js +788 -0
- package/api/resources/sessions/client/index.d.ts +1 -0
- package/api/resources/sessions/client/index.js +17 -0
- package/api/resources/sessions/client/requests/CreateLiveViewUrlRequest.d.ts +20 -0
- package/api/resources/sessions/client/requests/CreateLiveViewUrlRequest.js +5 -0
- package/api/resources/sessions/client/requests/SessionPromptContentRequest.d.ts +15 -0
- package/api/resources/sessions/client/requests/SessionPromptContentRequest.js +5 -0
- package/api/resources/sessions/client/requests/SessionPromptPaginatedExtractionRequest.d.ts +15 -0
- package/api/resources/sessions/client/requests/SessionPromptPaginatedExtractionRequest.js +5 -0
- package/api/resources/sessions/client/requests/SessionRestInputV1.d.ts +14 -0
- package/api/resources/sessions/client/requests/SessionRestInputV1.js +5 -0
- package/api/resources/sessions/client/requests/SessionsListRequest.d.ts +13 -0
- package/api/resources/sessions/client/requests/SessionsListRequest.js +5 -0
- package/api/resources/sessions/client/requests/index.d.ts +5 -0
- package/api/resources/sessions/client/requests/index.js +2 -0
- package/api/resources/sessions/index.d.ts +2 -0
- package/api/resources/sessions/index.js +18 -0
- package/api/resources/sessions/types/SessionsEventsResponse.d.ts +16 -0
- package/api/resources/sessions/types/SessionsEventsResponse.js +5 -0
- package/api/resources/sessions/types/SessionsEventsResponseError.d.ts +11 -0
- package/api/resources/sessions/types/SessionsEventsResponseError.js +5 -0
- package/api/resources/sessions/types/SessionsEventsResponseStatus.d.ts +11 -0
- package/api/resources/sessions/types/SessionsEventsResponseStatus.js +5 -0
- package/api/resources/sessions/types/index.d.ts +3 -0
- package/api/resources/sessions/types/index.js +19 -0
- package/api/types/CleanScrapeResponse.d.ts +12 -0
- package/api/types/CleanScrapeResponse.js +5 -0
- package/api/types/CleanScrapeResponseData.d.ts +10 -0
- package/api/types/CleanScrapeResponseData.js +5 -0
- package/api/types/CleanScrapeResponseDataStatus.d.ts +12 -0
- package/api/types/CleanScrapeResponseDataStatus.js +11 -0
- package/api/types/CleanScrapeResponseOutput.d.ts +12 -0
- package/api/types/CleanScrapeResponseOutput.js +5 -0
- package/api/types/ConnectionInfo.d.ts +14 -0
- package/api/types/ConnectionInfo.js +5 -0
- package/api/types/ErrorDetail.d.ts +10 -0
- package/api/types/ErrorDetail.js +5 -0
- package/api/types/ErrorMessage.d.ts +11 -0
- package/api/types/ErrorMessage.js +5 -0
- package/api/types/ErrorModel.d.ts +20 -0
- package/api/types/ErrorModel.js +5 -0
- package/api/types/LiveViewConnectionInfo.d.ts +9 -0
- package/api/types/LiveViewConnectionInfo.js +5 -0
- package/api/types/LiveViewUrlOutputV1Body.d.ts +9 -0
- package/api/types/LiveViewUrlOutputV1Body.js +5 -0
- package/api/types/ProfileOutputV1Body.d.ts +10 -0
- package/api/types/ProfileOutputV1Body.js +5 -0
- package/api/types/ProfileV1.d.ts +13 -0
- package/api/types/ProfileV1.js +5 -0
- package/api/types/ProfilesOutputV1Body.d.ts +9 -0
- package/api/types/ProfilesOutputV1Body.js +5 -0
- package/api/types/ScrapeResponseContent.d.ts +9 -0
- package/api/types/ScrapeResponseContent.js +5 -0
- package/api/types/Session.d.ts +20 -0
- package/api/types/Session.js +5 -0
- package/api/types/SessionAiResponse.d.ts +16 -0
- package/api/types/SessionAiResponse.js +5 -0
- package/api/types/SessionAiResponseData.d.ts +10 -0
- package/api/types/SessionAiResponseData.js +5 -0
- package/api/types/SessionAiResponseDataStatus.d.ts +12 -0
- package/api/types/SessionAiResponseDataStatus.js +11 -0
- package/api/types/SessionAiResponseIssue.d.ts +11 -0
- package/api/types/SessionAiResponseIssue.js +5 -0
- package/api/types/SessionAiResponseMetadata.d.ts +8 -0
- package/api/types/SessionAiResponseMetadata.js +5 -0
- package/api/types/SessionAiResponseMetadataUsage.d.ts +9 -0
- package/api/types/SessionAiResponseMetadataUsage.js +5 -0
- package/api/types/SessionConfig.d.ts +17 -0
- package/api/types/SessionConfig.js +5 -0
- package/api/types/SessionConfigV1.d.ts +17 -0
- package/api/types/SessionConfigV1.js +5 -0
- package/api/types/SessionOutputV1Body.d.ts +12 -0
- package/api/types/SessionOutputV1Body.js +5 -0
- package/api/types/SessionWithConnectionInfo.d.ts +10 -0
- package/api/types/SessionWithConnectionInfo.js +5 -0
- package/api/types/SessionsOutputV1Body.d.ts +10 -0
- package/api/types/SessionsOutputV1Body.js +5 -0
- package/api/types/StatusMessage.d.ts +14 -0
- package/api/types/StatusMessage.js +5 -0
- package/api/types/StatusMessageStatus.d.ts +13 -0
- package/api/types/StatusMessageStatus.js +12 -0
- package/api/types/index.d.ts +28 -0
- package/api/types/index.js +44 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/APIResponse.js +2 -0
- package/core/fetcher/Fetcher.d.ts +39 -0
- package/core/fetcher/Fetcher.js +99 -0
- package/core/fetcher/Supplier.d.ts +4 -0
- package/core/fetcher/Supplier.js +22 -0
- package/core/fetcher/createRequestUrl.d.ts +1 -0
- package/core/fetcher/createRequestUrl.js +13 -0
- package/core/fetcher/getFetchFn.d.ts +4 -0
- package/core/fetcher/getFetchFn.js +59 -0
- package/core/fetcher/getHeader.d.ts +1 -0
- package/core/fetcher/getHeader.js +12 -0
- package/core/fetcher/getRequestBody.d.ts +7 -0
- package/core/fetcher/getRequestBody.js +23 -0
- package/core/fetcher/getResponseBody.d.ts +1 -0
- package/core/fetcher/getResponseBody.js +52 -0
- package/core/fetcher/index.d.ts +5 -0
- package/core/fetcher/index.js +9 -0
- package/core/fetcher/makeRequest.d.ts +1 -0
- package/core/fetcher/makeRequest.js +42 -0
- package/core/fetcher/requestWithRetries.d.ts +1 -0
- package/core/fetcher/requestWithRetries.js +32 -0
- package/core/fetcher/signals.d.ts +12 -0
- package/core/fetcher/signals.js +37 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
- package/core/index.d.ts +4 -0
- package/core/index.js +33 -0
- package/core/runtime/index.d.ts +1 -0
- package/core/runtime/index.js +5 -0
- package/core/runtime/runtime.d.ts +9 -0
- package/core/runtime/runtime.js +93 -0
- package/core/schemas/Schema.d.ts +84 -0
- package/core/schemas/Schema.js +21 -0
- package/core/schemas/builders/date/date.d.ts +2 -0
- package/core/schemas/builders/date/date.js +63 -0
- package/core/schemas/builders/date/index.d.ts +1 -0
- package/core/schemas/builders/date/index.js +5 -0
- package/core/schemas/builders/enum/enum.d.ts +2 -0
- package/core/schemas/builders/enum/enum.js +39 -0
- package/core/schemas/builders/enum/index.d.ts +1 -0
- package/core/schemas/builders/enum/index.js +5 -0
- package/core/schemas/builders/index.d.ts +13 -0
- package/core/schemas/builders/index.js +29 -0
- package/core/schemas/builders/lazy/index.d.ts +3 -0
- package/core/schemas/builders/lazy/index.js +7 -0
- package/core/schemas/builders/lazy/lazy.d.ts +5 -0
- package/core/schemas/builders/lazy/lazy.js +25 -0
- package/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
- package/core/schemas/builders/lazy/lazyObject.js +12 -0
- package/core/schemas/builders/list/index.d.ts +1 -0
- package/core/schemas/builders/list/index.js +5 -0
- package/core/schemas/builders/list/list.d.ts +2 -0
- package/core/schemas/builders/list/list.js +55 -0
- package/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/core/schemas/builders/literals/booleanLiteral.js +29 -0
- package/core/schemas/builders/literals/index.d.ts +2 -0
- package/core/schemas/builders/literals/index.js +7 -0
- package/core/schemas/builders/literals/stringLiteral.d.ts +2 -0
- package/core/schemas/builders/literals/stringLiteral.js +29 -0
- package/core/schemas/builders/object/index.d.ts +6 -0
- package/core/schemas/builders/object/index.js +11 -0
- package/core/schemas/builders/object/object.d.ts +3 -0
- package/core/schemas/builders/object/object.js +233 -0
- package/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
- package/core/schemas/builders/object/property.d.ts +8 -0
- package/core/schemas/builders/object/property.js +16 -0
- package/core/schemas/builders/object/types.d.ts +26 -0
- package/core/schemas/builders/object/types.js +2 -0
- package/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
- package/core/schemas/builders/object-like/getObjectLikeUtils.js +54 -0
- package/core/schemas/builders/object-like/index.d.ts +2 -0
- package/core/schemas/builders/object-like/index.js +6 -0
- package/core/schemas/builders/object-like/types.d.ts +7 -0
- package/core/schemas/builders/object-like/types.js +2 -0
- package/core/schemas/builders/primitives/any.d.ts +1 -0
- package/core/schemas/builders/primitives/any.js +6 -0
- package/core/schemas/builders/primitives/boolean.d.ts +1 -0
- package/core/schemas/builders/primitives/boolean.js +25 -0
- package/core/schemas/builders/primitives/index.d.ts +5 -0
- package/core/schemas/builders/primitives/index.js +13 -0
- package/core/schemas/builders/primitives/number.d.ts +1 -0
- package/core/schemas/builders/primitives/number.js +25 -0
- package/core/schemas/builders/primitives/string.d.ts +1 -0
- package/core/schemas/builders/primitives/string.js +25 -0
- package/core/schemas/builders/primitives/unknown.d.ts +1 -0
- package/core/schemas/builders/primitives/unknown.js +6 -0
- package/core/schemas/builders/record/index.d.ts +2 -0
- package/core/schemas/builders/record/index.js +5 -0
- package/core/schemas/builders/record/record.d.ts +3 -0
- package/core/schemas/builders/record/record.js +95 -0
- package/core/schemas/builders/record/types.d.ts +4 -0
- package/core/schemas/builders/record/types.js +2 -0
- package/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
- package/core/schemas/builders/schema-utils/JsonError.js +12 -0
- package/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
- package/core/schemas/builders/schema-utils/ParseError.js +12 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +17 -0
- package/core/schemas/builders/schema-utils/getSchemaUtils.js +82 -0
- package/core/schemas/builders/schema-utils/index.d.ts +4 -0
- package/core/schemas/builders/schema-utils/index.js +11 -0
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.d.ts +2 -0
- package/core/schemas/builders/schema-utils/stringifyValidationErrors.js +10 -0
- package/core/schemas/builders/set/index.d.ts +1 -0
- package/core/schemas/builders/set/index.js +5 -0
- package/core/schemas/builders/set/set.d.ts +2 -0
- package/core/schemas/builders/set/set.js +44 -0
- package/core/schemas/builders/undiscriminated-union/index.d.ts +2 -0
- package/core/schemas/builders/undiscriminated-union/index.js +5 -0
- package/core/schemas/builders/undiscriminated-union/types.d.ts +4 -0
- package/core/schemas/builders/undiscriminated-union/types.js +2 -0
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts +3 -0
- package/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +40 -0
- package/core/schemas/builders/union/discriminant.d.ts +5 -0
- package/core/schemas/builders/union/discriminant.js +10 -0
- package/core/schemas/builders/union/index.d.ts +4 -0
- package/core/schemas/builders/union/index.js +7 -0
- package/core/schemas/builders/union/types.d.ts +13 -0
- package/core/schemas/builders/union/types.js +2 -0
- package/core/schemas/builders/union/union.d.ts +4 -0
- package/core/schemas/builders/union/union.js +130 -0
- package/core/schemas/index.d.ts +2 -0
- package/core/schemas/index.js +17 -0
- package/core/schemas/utils/MaybePromise.d.ts +1 -0
- package/core/schemas/utils/MaybePromise.js +2 -0
- package/core/schemas/utils/addQuestionMarksToNullableProperties.d.ts +7 -0
- package/core/schemas/utils/addQuestionMarksToNullableProperties.js +2 -0
- package/core/schemas/utils/createIdentitySchemaCreator.d.ts +2 -0
- package/core/schemas/utils/createIdentitySchemaCreator.js +16 -0
- package/core/schemas/utils/entries.d.ts +1 -0
- package/core/schemas/utils/entries.js +7 -0
- package/core/schemas/utils/filterObject.d.ts +1 -0
- package/core/schemas/utils/filterObject.js +14 -0
- package/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
- package/core/schemas/utils/getErrorMessageForIncorrectType.js +24 -0
- package/core/schemas/utils/isPlainObject.d.ts +1 -0
- package/core/schemas/utils/isPlainObject.js +18 -0
- package/core/schemas/utils/keys.d.ts +1 -0
- package/core/schemas/utils/keys.js +7 -0
- package/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
- package/core/schemas/utils/maybeSkipValidation.js +28 -0
- package/core/schemas/utils/partition.d.ts +1 -0
- package/core/schemas/utils/partition.js +16 -0
- package/core/streaming-fetcher/Stream.d.ts +48 -0
- package/core/streaming-fetcher/Stream.js +170 -0
- package/core/streaming-fetcher/index.d.ts +1 -0
- package/core/streaming-fetcher/index.js +5 -0
- package/dist/Client.d.ts +33 -0
- package/dist/Client.js +22 -0
- package/dist/api/errors/InternalServerError.d.ts +8 -0
- package/dist/api/errors/InternalServerError.js +41 -0
- package/dist/api/errors/NotFoundError.d.ts +8 -0
- package/dist/api/errors/NotFoundError.js +41 -0
- package/dist/api/errors/UnprocessableEntityError.d.ts +8 -0
- package/dist/api/errors/UnprocessableEntityError.js +41 -0
- package/dist/api/errors/index.d.ts +3 -0
- package/dist/api/errors/index.js +19 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +19 -0
- package/dist/api/resources/index.d.ts +5 -0
- package/dist/api/resources/index.js +34 -0
- package/dist/api/resources/profiles/client/Client.d.ts +66 -0
- package/dist/api/resources/profiles/client/Client.js +296 -0
- package/dist/api/resources/profiles/client/index.d.ts +1 -0
- package/dist/api/resources/profiles/client/index.js +17 -0
- package/dist/api/resources/profiles/client/requests/ProfilesDeleteRequest.d.ts +19 -0
- package/dist/api/resources/profiles/client/requests/ProfilesDeleteRequest.js +5 -0
- package/dist/api/resources/profiles/client/requests/ProfilesGetRequest.d.ts +19 -0
- package/dist/api/resources/profiles/client/requests/ProfilesGetRequest.js +5 -0
- package/dist/api/resources/profiles/client/requests/index.d.ts +2 -0
- package/dist/api/resources/profiles/client/requests/index.js +2 -0
- package/dist/api/resources/profiles/index.d.ts +1 -0
- package/dist/api/resources/profiles/index.js +17 -0
- package/dist/api/resources/sessions/client/Client.d.ts +132 -0
- package/dist/api/resources/sessions/client/Client.js +788 -0
- package/dist/api/resources/sessions/client/index.d.ts +1 -0
- package/dist/api/resources/sessions/client/index.js +17 -0
- package/dist/api/resources/sessions/client/requests/CreateLiveViewUrlRequest.d.ts +20 -0
- package/dist/api/resources/sessions/client/requests/CreateLiveViewUrlRequest.js +5 -0
- package/dist/api/resources/sessions/client/requests/SessionPromptContentRequest.d.ts +15 -0
- package/dist/api/resources/sessions/client/requests/SessionPromptContentRequest.js +5 -0
- package/dist/api/resources/sessions/client/requests/SessionPromptPaginatedExtractionRequest.d.ts +15 -0
- package/dist/api/resources/sessions/client/requests/SessionPromptPaginatedExtractionRequest.js +5 -0
- package/dist/api/resources/sessions/client/requests/SessionRestInputV1.d.ts +14 -0
- package/dist/api/resources/sessions/client/requests/SessionRestInputV1.js +5 -0
- package/dist/api/resources/sessions/client/requests/SessionsListRequest.d.ts +13 -0
- package/dist/api/resources/sessions/client/requests/SessionsListRequest.js +5 -0
- package/dist/api/resources/sessions/client/requests/index.d.ts +5 -0
- package/dist/api/resources/sessions/client/requests/index.js +2 -0
- package/dist/api/resources/sessions/index.d.ts +2 -0
- package/dist/api/resources/sessions/index.js +18 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponse.d.ts +16 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponse.js +5 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponseError.d.ts +11 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponseError.js +5 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponseStatus.d.ts +11 -0
- package/dist/api/resources/sessions/types/SessionsEventsResponseStatus.js +5 -0
- package/dist/api/resources/sessions/types/index.d.ts +3 -0
- package/dist/api/resources/sessions/types/index.js +19 -0
- package/dist/api/types/CleanScrapeResponse.d.ts +12 -0
- package/dist/api/types/CleanScrapeResponse.js +5 -0
- package/dist/api/types/CleanScrapeResponseData.d.ts +10 -0
- package/dist/api/types/CleanScrapeResponseData.js +5 -0
- package/dist/api/types/CleanScrapeResponseDataStatus.d.ts +12 -0
- package/dist/api/types/CleanScrapeResponseDataStatus.js +11 -0
- package/dist/api/types/CleanScrapeResponseOutput.d.ts +12 -0
- package/dist/api/types/CleanScrapeResponseOutput.js +5 -0
- package/dist/api/types/ConnectionInfo.d.ts +14 -0
- package/dist/api/types/ConnectionInfo.js +5 -0
- package/dist/api/types/ErrorDetail.d.ts +10 -0
- package/dist/api/types/ErrorDetail.js +5 -0
- package/dist/api/types/ErrorMessage.d.ts +11 -0
- package/dist/api/types/ErrorMessage.js +5 -0
- package/dist/api/types/ErrorModel.d.ts +20 -0
- package/dist/api/types/ErrorModel.js +5 -0
- package/dist/api/types/LiveViewConnectionInfo.d.ts +9 -0
- package/dist/api/types/LiveViewConnectionInfo.js +5 -0
- package/dist/api/types/LiveViewUrlOutputV1Body.d.ts +9 -0
- package/dist/api/types/LiveViewUrlOutputV1Body.js +5 -0
- package/dist/api/types/ProfileOutputV1Body.d.ts +10 -0
- package/dist/api/types/ProfileOutputV1Body.js +5 -0
- package/dist/api/types/ProfileV1.d.ts +13 -0
- package/dist/api/types/ProfileV1.js +5 -0
- package/dist/api/types/ProfilesOutputV1Body.d.ts +9 -0
- package/dist/api/types/ProfilesOutputV1Body.js +5 -0
- package/dist/api/types/ScrapeResponseContent.d.ts +9 -0
- package/dist/api/types/ScrapeResponseContent.js +5 -0
- package/dist/api/types/Session.d.ts +20 -0
- package/dist/api/types/Session.js +5 -0
- package/dist/api/types/SessionAiResponse.d.ts +16 -0
- package/dist/api/types/SessionAiResponse.js +5 -0
- package/dist/api/types/SessionAiResponseData.d.ts +10 -0
- package/dist/api/types/SessionAiResponseData.js +5 -0
- package/dist/api/types/SessionAiResponseDataStatus.d.ts +12 -0
- package/dist/api/types/SessionAiResponseDataStatus.js +11 -0
- package/dist/api/types/SessionAiResponseIssue.d.ts +11 -0
- package/dist/api/types/SessionAiResponseIssue.js +5 -0
- package/dist/api/types/SessionAiResponseMetadata.d.ts +8 -0
- package/dist/api/types/SessionAiResponseMetadata.js +5 -0
- package/dist/api/types/SessionAiResponseMetadataUsage.d.ts +9 -0
- package/dist/api/types/SessionAiResponseMetadataUsage.js +5 -0
- package/dist/api/types/SessionConfig.d.ts +17 -0
- package/dist/api/types/SessionConfig.js +5 -0
- package/dist/api/types/SessionConfigV1.d.ts +17 -0
- package/dist/api/types/SessionConfigV1.js +5 -0
- package/dist/api/types/SessionOutputV1Body.d.ts +12 -0
- package/dist/api/types/SessionOutputV1Body.js +5 -0
- package/dist/api/types/SessionWithConnectionInfo.d.ts +10 -0
- package/dist/api/types/SessionWithConnectionInfo.js +5 -0
- package/dist/api/types/SessionsOutputV1Body.d.ts +10 -0
- package/dist/api/types/SessionsOutputV1Body.js +5 -0
- package/dist/api/types/StatusMessage.d.ts +14 -0
- package/dist/api/types/StatusMessage.js +5 -0
- package/dist/api/types/StatusMessageStatus.d.ts +13 -0
- package/dist/api/types/StatusMessageStatus.js +12 -0
- package/dist/api/types/index.d.ts +28 -0
- package/dist/api/types/index.js +44 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/APIResponse.js +2 -0
- package/dist/core/fetcher/Fetcher.d.ts +39 -0
- package/dist/core/fetcher/Fetcher.js +99 -0
- package/dist/core/fetcher/Supplier.d.ts +4 -0
- package/dist/core/fetcher/Supplier.js +22 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +13 -0
- package/dist/core/fetcher/getFetchFn.d.ts +4 -0
- package/dist/core/fetcher/getFetchFn.js +59 -0
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +12 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +23 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +52 -0
- package/dist/core/fetcher/index.d.ts +5 -0
- package/dist/core/fetcher/index.js +9 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +42 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +32 -0
- package/dist/core/fetcher/signals.d.ts +12 -0
- package/dist/core/fetcher/signals.js +37 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/Node18UniversalStreamWrapper.js +245 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.d.ts +22 -0
- package/dist/core/fetcher/stream-wrappers/NodePre18StreamWrapper.js +124 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.d.ts +31 -0
- package/dist/core/fetcher/stream-wrappers/UndiciStreamWrapper.js +227 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.d.ts +18 -0
- package/dist/core/fetcher/stream-wrappers/chooseStreamWrapper.js +50 -0
- package/dist/core/index.d.ts +4 -0
- package/dist/core/index.js +33 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +5 -0
- package/dist/core/runtime/runtime.d.ts +9 -0
- package/dist/core/runtime/runtime.js +93 -0
- package/dist/core/schemas/Schema.d.ts +84 -0
- package/dist/core/schemas/Schema.js +21 -0
- package/dist/core/schemas/builders/date/date.d.ts +2 -0
- package/dist/core/schemas/builders/date/date.js +63 -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 +2 -0
- package/dist/core/schemas/builders/enum/enum.js +39 -0
- package/dist/core/schemas/builders/enum/index.d.ts +1 -0
- package/dist/core/schemas/builders/enum/index.js +5 -0
- package/dist/core/schemas/builders/index.d.ts +13 -0
- package/dist/core/schemas/builders/index.js +29 -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 +25 -0
- package/dist/core/schemas/builders/lazy/lazyObject.d.ts +3 -0
- package/dist/core/schemas/builders/lazy/lazyObject.js +12 -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 +55 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.d.ts +2 -0
- package/dist/core/schemas/builders/literals/booleanLiteral.js +29 -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 +29 -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 +233 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.d.ts +6 -0
- package/dist/core/schemas/builders/object/objectWithoutOptionalProperties.js +8 -0
- package/dist/core/schemas/builders/object/property.d.ts +8 -0
- package/dist/core/schemas/builders/object/property.js +16 -0
- package/dist/core/schemas/builders/object/types.d.ts +26 -0
- package/dist/core/schemas/builders/object/types.js +2 -0
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.d.ts +9 -0
- package/dist/core/schemas/builders/object-like/getObjectLikeUtils.js +54 -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/object-like/types.js +2 -0
- package/dist/core/schemas/builders/primitives/any.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/any.js +6 -0
- package/dist/core/schemas/builders/primitives/boolean.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/boolean.js +25 -0
- package/dist/core/schemas/builders/primitives/index.d.ts +5 -0
- package/dist/core/schemas/builders/primitives/index.js +13 -0
- package/dist/core/schemas/builders/primitives/number.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/number.js +25 -0
- package/dist/core/schemas/builders/primitives/string.d.ts +1 -0
- package/dist/core/schemas/builders/primitives/string.js +25 -0
- package/dist/core/schemas/builders/primitives/unknown.d.ts +1 -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 +5 -0
- package/dist/core/schemas/builders/record/record.d.ts +3 -0
- package/dist/core/schemas/builders/record/record.js +95 -0
- package/dist/core/schemas/builders/record/types.d.ts +4 -0
- package/dist/core/schemas/builders/record/types.js +2 -0
- package/dist/core/schemas/builders/schema-utils/JsonError.d.ts +5 -0
- package/dist/core/schemas/builders/schema-utils/JsonError.js +12 -0
- package/dist/core/schemas/builders/schema-utils/ParseError.d.ts +5 -0
- package/dist/core/schemas/builders/schema-utils/ParseError.js +12 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.d.ts +17 -0
- package/dist/core/schemas/builders/schema-utils/getSchemaUtils.js +82 -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 +10 -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 +44 -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/types.js +2 -0
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.d.ts +3 -0
- package/dist/core/schemas/builders/undiscriminated-union/undiscriminatedUnion.js +40 -0
- package/dist/core/schemas/builders/union/discriminant.d.ts +5 -0
- package/dist/core/schemas/builders/union/discriminant.js +10 -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/types.js +2 -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 +16 -0
- package/dist/core/schemas/utils/entries.d.ts +1 -0
- package/dist/core/schemas/utils/entries.js +7 -0
- package/dist/core/schemas/utils/filterObject.d.ts +1 -0
- package/dist/core/schemas/utils/filterObject.js +14 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.d.ts +1 -0
- package/dist/core/schemas/utils/getErrorMessageForIncorrectType.js +24 -0
- package/dist/core/schemas/utils/isPlainObject.d.ts +1 -0
- package/dist/core/schemas/utils/isPlainObject.js +18 -0
- package/dist/core/schemas/utils/keys.d.ts +1 -0
- package/dist/core/schemas/utils/keys.js +7 -0
- package/dist/core/schemas/utils/maybeSkipValidation.d.ts +2 -0
- package/dist/core/schemas/utils/maybeSkipValidation.js +28 -0
- package/dist/core/schemas/utils/partition.d.ts +1 -0
- package/dist/core/schemas/utils/partition.js +16 -0
- package/dist/core/streaming-fetcher/Stream.d.ts +48 -0
- package/dist/core/streaming-fetcher/Stream.js +170 -0
- package/dist/core/streaming-fetcher/index.d.ts +1 -0
- package/dist/core/streaming-fetcher/index.js +5 -0
- package/dist/environments.d.ts +7 -0
- package/dist/environments.js +9 -0
- package/dist/errors/AirtopError.d.ts +12 -0
- package/dist/errors/AirtopError.js +32 -0
- package/dist/errors/AirtopTimeoutError.d.ts +6 -0
- package/dist/errors/AirtopTimeoutError.js +13 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +7 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +34 -0
- package/dist/serialization/index.d.ts +2 -0
- package/dist/serialization/index.js +18 -0
- package/dist/serialization/resources/index.d.ts +3 -0
- package/dist/serialization/resources/index.js +32 -0
- package/dist/serialization/resources/sessions/client/index.d.ts +1 -0
- package/dist/serialization/resources/sessions/client/index.js +17 -0
- package/dist/serialization/resources/sessions/client/requests/SessionPromptContentRequest.d.ts +13 -0
- package/dist/serialization/resources/sessions/client/requests/SessionPromptContentRequest.js +34 -0
- package/dist/serialization/resources/sessions/client/requests/SessionPromptPaginatedExtractionRequest.d.ts +13 -0
- package/dist/serialization/resources/sessions/client/requests/SessionPromptPaginatedExtractionRequest.js +34 -0
- package/dist/serialization/resources/sessions/client/requests/SessionRestInputV1.d.ts +14 -0
- package/dist/serialization/resources/sessions/client/requests/SessionRestInputV1.js +35 -0
- package/dist/serialization/resources/sessions/client/requests/index.d.ts +3 -0
- package/dist/serialization/resources/sessions/client/requests/index.js +9 -0
- package/dist/serialization/resources/sessions/index.d.ts +2 -0
- package/dist/serialization/resources/sessions/index.js +18 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +18 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponse.js +41 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponseError.d.ts +15 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponseError.js +36 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponseStatus.d.ts +15 -0
- package/dist/serialization/resources/sessions/types/SessionsEventsResponseStatus.js +36 -0
- package/dist/serialization/resources/sessions/types/index.d.ts +3 -0
- package/dist/serialization/resources/sessions/types/index.js +19 -0
- package/dist/serialization/types/CleanScrapeResponse.d.ts +16 -0
- package/dist/serialization/types/CleanScrapeResponse.js +37 -0
- package/dist/serialization/types/CleanScrapeResponseData.d.ts +15 -0
- package/dist/serialization/types/CleanScrapeResponseData.js +36 -0
- package/dist/serialization/types/CleanScrapeResponseDataStatus.d.ts +10 -0
- package/dist/serialization/types/CleanScrapeResponseDataStatus.js +31 -0
- package/dist/serialization/types/CleanScrapeResponseOutput.d.ts +15 -0
- package/dist/serialization/types/CleanScrapeResponseOutput.js +36 -0
- package/dist/serialization/types/ConnectionInfo.d.ts +16 -0
- package/dist/serialization/types/ConnectionInfo.js +37 -0
- package/dist/serialization/types/ErrorDetail.d.ts +14 -0
- package/dist/serialization/types/ErrorDetail.js +35 -0
- package/dist/serialization/types/ErrorMessage.d.ts +14 -0
- package/dist/serialization/types/ErrorMessage.js +35 -0
- package/dist/serialization/types/ErrorModel.d.ts +19 -0
- package/dist/serialization/types/ErrorModel.js +40 -0
- package/dist/serialization/types/LiveViewConnectionInfo.d.ts +13 -0
- package/dist/serialization/types/LiveViewConnectionInfo.js +34 -0
- package/dist/serialization/types/LiveViewUrlOutputV1Body.d.ts +13 -0
- package/dist/serialization/types/LiveViewUrlOutputV1Body.js +34 -0
- package/dist/serialization/types/ProfileOutputV1Body.d.ts +14 -0
- package/dist/serialization/types/ProfileOutputV1Body.js +35 -0
- package/dist/serialization/types/ProfileV1.d.ts +15 -0
- package/dist/serialization/types/ProfileV1.js +36 -0
- package/dist/serialization/types/ProfilesOutputV1Body.d.ts +14 -0
- package/dist/serialization/types/ProfilesOutputV1Body.js +35 -0
- package/dist/serialization/types/ScrapeResponseContent.d.ts +13 -0
- package/dist/serialization/types/ScrapeResponseContent.js +34 -0
- package/dist/serialization/types/Session.d.ts +19 -0
- package/dist/serialization/types/Session.js +40 -0
- package/dist/serialization/types/SessionAiResponse.d.ts +19 -0
- package/dist/serialization/types/SessionAiResponse.js +40 -0
- package/dist/serialization/types/SessionAiResponseData.d.ts +14 -0
- package/dist/serialization/types/SessionAiResponseData.js +35 -0
- package/dist/serialization/types/SessionAiResponseDataStatus.d.ts +10 -0
- package/dist/serialization/types/SessionAiResponseDataStatus.js +31 -0
- package/dist/serialization/types/SessionAiResponseIssue.d.ts +14 -0
- package/dist/serialization/types/SessionAiResponseIssue.js +35 -0
- package/dist/serialization/types/SessionAiResponseMetadata.d.ts +13 -0
- package/dist/serialization/types/SessionAiResponseMetadata.js +34 -0
- package/dist/serialization/types/SessionAiResponseMetadataUsage.d.ts +13 -0
- package/dist/serialization/types/SessionAiResponseMetadataUsage.js +34 -0
- package/dist/serialization/types/SessionConfig.d.ts +17 -0
- package/dist/serialization/types/SessionConfig.js +38 -0
- package/dist/serialization/types/SessionConfigV1.d.ts +17 -0
- package/dist/serialization/types/SessionConfigV1.js +38 -0
- package/dist/serialization/types/SessionOutputV1Body.d.ts +16 -0
- package/dist/serialization/types/SessionOutputV1Body.js +37 -0
- package/dist/serialization/types/SessionWithConnectionInfo.d.ts +15 -0
- package/dist/serialization/types/SessionWithConnectionInfo.js +36 -0
- package/dist/serialization/types/SessionsOutputV1Body.d.ts +14 -0
- package/dist/serialization/types/SessionsOutputV1Body.js +35 -0
- package/dist/serialization/types/StatusMessage.d.ts +16 -0
- package/dist/serialization/types/StatusMessage.js +37 -0
- package/dist/serialization/types/StatusMessageStatus.d.ts +10 -0
- package/dist/serialization/types/StatusMessageStatus.js +31 -0
- package/dist/serialization/types/index.d.ts +28 -0
- package/dist/serialization/types/index.js +44 -0
- package/environments.d.ts +7 -0
- package/environments.js +9 -0
- package/errors/AirtopError.d.ts +12 -0
- package/errors/AirtopError.js +32 -0
- package/errors/AirtopTimeoutError.d.ts +6 -0
- package/errors/AirtopTimeoutError.js +13 -0
- package/errors/index.d.ts +2 -0
- package/errors/index.js +7 -0
- package/index.d.ts +4 -0
- package/index.js +34 -0
- package/jest.config.js +5 -0
- package/package.json +39 -0
- package/reference.md +812 -0
- package/serialization/index.d.ts +2 -0
- package/serialization/index.js +18 -0
- package/serialization/resources/index.d.ts +3 -0
- package/serialization/resources/index.js +32 -0
- package/serialization/resources/sessions/client/index.d.ts +1 -0
- package/serialization/resources/sessions/client/index.js +17 -0
- package/serialization/resources/sessions/client/requests/SessionPromptContentRequest.d.ts +13 -0
- package/serialization/resources/sessions/client/requests/SessionPromptContentRequest.js +34 -0
- package/serialization/resources/sessions/client/requests/SessionPromptPaginatedExtractionRequest.d.ts +13 -0
- package/serialization/resources/sessions/client/requests/SessionPromptPaginatedExtractionRequest.js +34 -0
- package/serialization/resources/sessions/client/requests/SessionRestInputV1.d.ts +14 -0
- package/serialization/resources/sessions/client/requests/SessionRestInputV1.js +35 -0
- package/serialization/resources/sessions/client/requests/index.d.ts +3 -0
- package/serialization/resources/sessions/client/requests/index.js +9 -0
- package/serialization/resources/sessions/index.d.ts +2 -0
- package/serialization/resources/sessions/index.js +18 -0
- package/serialization/resources/sessions/types/SessionsEventsResponse.d.ts +18 -0
- package/serialization/resources/sessions/types/SessionsEventsResponse.js +41 -0
- package/serialization/resources/sessions/types/SessionsEventsResponseError.d.ts +15 -0
- package/serialization/resources/sessions/types/SessionsEventsResponseError.js +36 -0
- package/serialization/resources/sessions/types/SessionsEventsResponseStatus.d.ts +15 -0
- package/serialization/resources/sessions/types/SessionsEventsResponseStatus.js +36 -0
- package/serialization/resources/sessions/types/index.d.ts +3 -0
- package/serialization/resources/sessions/types/index.js +19 -0
- package/serialization/types/CleanScrapeResponse.d.ts +16 -0
- package/serialization/types/CleanScrapeResponse.js +37 -0
- package/serialization/types/CleanScrapeResponseData.d.ts +15 -0
- package/serialization/types/CleanScrapeResponseData.js +36 -0
- package/serialization/types/CleanScrapeResponseDataStatus.d.ts +10 -0
- package/serialization/types/CleanScrapeResponseDataStatus.js +31 -0
- package/serialization/types/CleanScrapeResponseOutput.d.ts +15 -0
- package/serialization/types/CleanScrapeResponseOutput.js +36 -0
- package/serialization/types/ConnectionInfo.d.ts +16 -0
- package/serialization/types/ConnectionInfo.js +37 -0
- package/serialization/types/ErrorDetail.d.ts +14 -0
- package/serialization/types/ErrorDetail.js +35 -0
- package/serialization/types/ErrorMessage.d.ts +14 -0
- package/serialization/types/ErrorMessage.js +35 -0
- package/serialization/types/ErrorModel.d.ts +19 -0
- package/serialization/types/ErrorModel.js +40 -0
- package/serialization/types/LiveViewConnectionInfo.d.ts +13 -0
- package/serialization/types/LiveViewConnectionInfo.js +34 -0
- package/serialization/types/LiveViewUrlOutputV1Body.d.ts +13 -0
- package/serialization/types/LiveViewUrlOutputV1Body.js +34 -0
- package/serialization/types/ProfileOutputV1Body.d.ts +14 -0
- package/serialization/types/ProfileOutputV1Body.js +35 -0
- package/serialization/types/ProfileV1.d.ts +15 -0
- package/serialization/types/ProfileV1.js +36 -0
- package/serialization/types/ProfilesOutputV1Body.d.ts +14 -0
- package/serialization/types/ProfilesOutputV1Body.js +35 -0
- package/serialization/types/ScrapeResponseContent.d.ts +13 -0
- package/serialization/types/ScrapeResponseContent.js +34 -0
- package/serialization/types/Session.d.ts +19 -0
- package/serialization/types/Session.js +40 -0
- package/serialization/types/SessionAiResponse.d.ts +19 -0
- package/serialization/types/SessionAiResponse.js +40 -0
- package/serialization/types/SessionAiResponseData.d.ts +14 -0
- package/serialization/types/SessionAiResponseData.js +35 -0
- package/serialization/types/SessionAiResponseDataStatus.d.ts +10 -0
- package/serialization/types/SessionAiResponseDataStatus.js +31 -0
- package/serialization/types/SessionAiResponseIssue.d.ts +14 -0
- package/serialization/types/SessionAiResponseIssue.js +35 -0
- package/serialization/types/SessionAiResponseMetadata.d.ts +13 -0
- package/serialization/types/SessionAiResponseMetadata.js +34 -0
- package/serialization/types/SessionAiResponseMetadataUsage.d.ts +13 -0
- package/serialization/types/SessionAiResponseMetadataUsage.js +34 -0
- package/serialization/types/SessionConfig.d.ts +17 -0
- package/serialization/types/SessionConfig.js +38 -0
- package/serialization/types/SessionConfigV1.d.ts +17 -0
- package/serialization/types/SessionConfigV1.js +38 -0
- package/serialization/types/SessionOutputV1Body.d.ts +16 -0
- package/serialization/types/SessionOutputV1Body.js +37 -0
- package/serialization/types/SessionWithConnectionInfo.d.ts +15 -0
- package/serialization/types/SessionWithConnectionInfo.js +36 -0
- package/serialization/types/SessionsOutputV1Body.d.ts +14 -0
- package/serialization/types/SessionsOutputV1Body.js +35 -0
- package/serialization/types/StatusMessage.d.ts +16 -0
- package/serialization/types/StatusMessage.js +37 -0
- package/serialization/types/StatusMessageStatus.d.ts +10 -0
- package/serialization/types/StatusMessageStatus.js +31 -0
- package/serialization/types/index.d.ts +28 -0
- package/serialization/types/index.js +44 -0
@@ -0,0 +1,227 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
|
+
});
|
10
|
+
};
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
12
|
+
exports.UndiciStreamWrapper = void 0;
|
13
|
+
class UndiciStreamWrapper {
|
14
|
+
constructor(readableStream) {
|
15
|
+
this.readableStream = readableStream;
|
16
|
+
this.reader = this.readableStream.getReader();
|
17
|
+
this.events = {
|
18
|
+
data: [],
|
19
|
+
end: [],
|
20
|
+
error: [],
|
21
|
+
readable: [],
|
22
|
+
close: [],
|
23
|
+
pause: [],
|
24
|
+
resume: [],
|
25
|
+
};
|
26
|
+
this.paused = false;
|
27
|
+
this.resumeCallback = null;
|
28
|
+
this.encoding = null;
|
29
|
+
}
|
30
|
+
on(event, callback) {
|
31
|
+
var _a;
|
32
|
+
(_a = this.events[event]) === null || _a === void 0 ? void 0 : _a.push(callback);
|
33
|
+
}
|
34
|
+
off(event, callback) {
|
35
|
+
var _a;
|
36
|
+
this.events[event] = (_a = this.events[event]) === null || _a === void 0 ? void 0 : _a.filter((cb) => cb !== callback);
|
37
|
+
}
|
38
|
+
pipe(dest) {
|
39
|
+
this.on("data", (chunk) => {
|
40
|
+
if (dest instanceof UndiciStreamWrapper) {
|
41
|
+
dest._write(chunk);
|
42
|
+
}
|
43
|
+
else {
|
44
|
+
const writer = dest.getWriter();
|
45
|
+
writer.write(chunk).then(() => writer.releaseLock());
|
46
|
+
}
|
47
|
+
});
|
48
|
+
this.on("end", () => {
|
49
|
+
if (dest instanceof UndiciStreamWrapper) {
|
50
|
+
dest._end();
|
51
|
+
}
|
52
|
+
else {
|
53
|
+
const writer = dest.getWriter();
|
54
|
+
writer.close();
|
55
|
+
}
|
56
|
+
});
|
57
|
+
this.on("error", (error) => {
|
58
|
+
if (dest instanceof UndiciStreamWrapper) {
|
59
|
+
dest._error(error);
|
60
|
+
}
|
61
|
+
else {
|
62
|
+
const writer = dest.getWriter();
|
63
|
+
writer.abort(error);
|
64
|
+
}
|
65
|
+
});
|
66
|
+
this._startReading();
|
67
|
+
return dest;
|
68
|
+
}
|
69
|
+
pipeTo(dest) {
|
70
|
+
return this.pipe(dest);
|
71
|
+
}
|
72
|
+
unpipe(dest) {
|
73
|
+
this.off("data", (chunk) => {
|
74
|
+
if (dest instanceof UndiciStreamWrapper) {
|
75
|
+
dest._write(chunk);
|
76
|
+
}
|
77
|
+
else {
|
78
|
+
const writer = dest.getWriter();
|
79
|
+
writer.write(chunk).then(() => writer.releaseLock());
|
80
|
+
}
|
81
|
+
});
|
82
|
+
this.off("end", () => {
|
83
|
+
if (dest instanceof UndiciStreamWrapper) {
|
84
|
+
dest._end();
|
85
|
+
}
|
86
|
+
else {
|
87
|
+
const writer = dest.getWriter();
|
88
|
+
writer.close();
|
89
|
+
}
|
90
|
+
});
|
91
|
+
this.off("error", (error) => {
|
92
|
+
if (dest instanceof UndiciStreamWrapper) {
|
93
|
+
dest._error(error);
|
94
|
+
}
|
95
|
+
else {
|
96
|
+
const writer = dest.getWriter();
|
97
|
+
writer.abort(error);
|
98
|
+
}
|
99
|
+
});
|
100
|
+
}
|
101
|
+
destroy(error) {
|
102
|
+
this.reader
|
103
|
+
.cancel(error)
|
104
|
+
.then(() => {
|
105
|
+
this._emit("close");
|
106
|
+
})
|
107
|
+
.catch((err) => {
|
108
|
+
this._emit("error", err);
|
109
|
+
});
|
110
|
+
}
|
111
|
+
pause() {
|
112
|
+
this.paused = true;
|
113
|
+
this._emit("pause");
|
114
|
+
}
|
115
|
+
resume() {
|
116
|
+
if (this.paused) {
|
117
|
+
this.paused = false;
|
118
|
+
this._emit("resume");
|
119
|
+
if (this.resumeCallback) {
|
120
|
+
this.resumeCallback();
|
121
|
+
this.resumeCallback = null;
|
122
|
+
}
|
123
|
+
}
|
124
|
+
}
|
125
|
+
get isPaused() {
|
126
|
+
return this.paused;
|
127
|
+
}
|
128
|
+
read() {
|
129
|
+
return __awaiter(this, void 0, void 0, function* () {
|
130
|
+
if (this.paused) {
|
131
|
+
yield new Promise((resolve) => {
|
132
|
+
this.resumeCallback = resolve;
|
133
|
+
});
|
134
|
+
}
|
135
|
+
const { done, value } = yield this.reader.read();
|
136
|
+
if (done) {
|
137
|
+
return undefined;
|
138
|
+
}
|
139
|
+
return value;
|
140
|
+
});
|
141
|
+
}
|
142
|
+
setEncoding(encoding) {
|
143
|
+
this.encoding = encoding;
|
144
|
+
}
|
145
|
+
text() {
|
146
|
+
return __awaiter(this, void 0, void 0, function* () {
|
147
|
+
const chunks = [];
|
148
|
+
while (true) {
|
149
|
+
const { done, value } = yield this.reader.read();
|
150
|
+
if (done)
|
151
|
+
break;
|
152
|
+
if (value)
|
153
|
+
chunks.push(value);
|
154
|
+
}
|
155
|
+
const decoder = new TextDecoder(this.encoding || "utf-8");
|
156
|
+
return decoder.decode(yield new Blob(chunks).arrayBuffer());
|
157
|
+
});
|
158
|
+
}
|
159
|
+
json() {
|
160
|
+
return __awaiter(this, void 0, void 0, function* () {
|
161
|
+
const text = yield this.text();
|
162
|
+
return JSON.parse(text);
|
163
|
+
});
|
164
|
+
}
|
165
|
+
_write(chunk) {
|
166
|
+
this._emit("data", chunk);
|
167
|
+
}
|
168
|
+
_end() {
|
169
|
+
this._emit("end");
|
170
|
+
}
|
171
|
+
_error(error) {
|
172
|
+
this._emit("error", error);
|
173
|
+
}
|
174
|
+
_emit(event, data) {
|
175
|
+
if (this.events[event]) {
|
176
|
+
for (const callback of this.events[event] || []) {
|
177
|
+
callback(data);
|
178
|
+
}
|
179
|
+
}
|
180
|
+
}
|
181
|
+
_startReading() {
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
183
|
+
try {
|
184
|
+
this._emit("readable");
|
185
|
+
while (true) {
|
186
|
+
if (this.paused) {
|
187
|
+
yield new Promise((resolve) => {
|
188
|
+
this.resumeCallback = resolve;
|
189
|
+
});
|
190
|
+
}
|
191
|
+
const { done, value } = yield this.reader.read();
|
192
|
+
if (done) {
|
193
|
+
this._emit("end");
|
194
|
+
this._emit("close");
|
195
|
+
break;
|
196
|
+
}
|
197
|
+
if (value) {
|
198
|
+
this._emit("data", value);
|
199
|
+
}
|
200
|
+
}
|
201
|
+
}
|
202
|
+
catch (error) {
|
203
|
+
this._emit("error", error);
|
204
|
+
}
|
205
|
+
});
|
206
|
+
}
|
207
|
+
[Symbol.asyncIterator]() {
|
208
|
+
return {
|
209
|
+
next: () => __awaiter(this, void 0, void 0, function* () {
|
210
|
+
if (this.paused) {
|
211
|
+
yield new Promise((resolve) => {
|
212
|
+
this.resumeCallback = resolve;
|
213
|
+
});
|
214
|
+
}
|
215
|
+
const { done, value } = yield this.reader.read();
|
216
|
+
if (done) {
|
217
|
+
return { done: true, value: undefined };
|
218
|
+
}
|
219
|
+
return { done: false, value };
|
220
|
+
}),
|
221
|
+
[Symbol.asyncIterator]() {
|
222
|
+
return this;
|
223
|
+
},
|
224
|
+
};
|
225
|
+
}
|
226
|
+
}
|
227
|
+
exports.UndiciStreamWrapper = UndiciStreamWrapper;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
export declare type EventCallback = (data?: any) => void;
|
2
|
+
export interface StreamWrapper<WritableStream, ReadFormat> {
|
3
|
+
setEncoding(encoding?: string): void;
|
4
|
+
on(event: string, callback: EventCallback): void;
|
5
|
+
off(event: string, callback: EventCallback): void;
|
6
|
+
pipe(dest: WritableStream): WritableStream;
|
7
|
+
pipeTo(dest: WritableStream): WritableStream;
|
8
|
+
unpipe(dest?: WritableStream): void;
|
9
|
+
destroy(error?: Error): void;
|
10
|
+
pause(): void;
|
11
|
+
resume(): void;
|
12
|
+
get isPaused(): boolean;
|
13
|
+
read(): Promise<ReadFormat | undefined>;
|
14
|
+
text(): Promise<string>;
|
15
|
+
json<T>(): Promise<T>;
|
16
|
+
[Symbol.asyncIterator](): AsyncIterableIterator<ReadFormat>;
|
17
|
+
}
|
18
|
+
export declare function chooseStreamWrapper(responseBody: any): Promise<Promise<StreamWrapper<any, any>>>;
|
@@ -0,0 +1,50 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
26
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
27
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
28
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
29
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
30
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
31
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
32
|
+
});
|
33
|
+
};
|
34
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
35
|
+
exports.chooseStreamWrapper = void 0;
|
36
|
+
const runtime_1 = require("../../runtime");
|
37
|
+
function chooseStreamWrapper(responseBody) {
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
39
|
+
if (runtime_1.RUNTIME.type === "node" && runtime_1.RUNTIME.parsedVersion != null && runtime_1.RUNTIME.parsedVersion >= 18) {
|
40
|
+
return new (yield Promise.resolve().then(() => __importStar(require("./Node18UniversalStreamWrapper")))).Node18UniversalStreamWrapper(responseBody);
|
41
|
+
}
|
42
|
+
else if (runtime_1.RUNTIME.type !== "node" && typeof fetch == "function") {
|
43
|
+
return new (yield Promise.resolve().then(() => __importStar(require("./UndiciStreamWrapper")))).UndiciStreamWrapper(responseBody);
|
44
|
+
}
|
45
|
+
else {
|
46
|
+
return new (yield Promise.resolve().then(() => __importStar(require("./NodePre18StreamWrapper")))).NodePre18StreamWrapper(responseBody);
|
47
|
+
}
|
48
|
+
});
|
49
|
+
}
|
50
|
+
exports.chooseStreamWrapper = chooseStreamWrapper;
|
package/core/index.d.ts
ADDED
package/core/index.js
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
|
+
if (k2 === undefined) k2 = k;
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
9
|
+
}) : (function(o, m, k, k2) {
|
10
|
+
if (k2 === undefined) k2 = k;
|
11
|
+
o[k2] = m[k];
|
12
|
+
}));
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
19
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
20
|
+
};
|
21
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
22
|
+
if (mod && mod.__esModule) return mod;
|
23
|
+
var result = {};
|
24
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
25
|
+
__setModuleDefault(result, mod);
|
26
|
+
return result;
|
27
|
+
};
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
29
|
+
exports.serialization = void 0;
|
30
|
+
__exportStar(require("./fetcher"), exports);
|
31
|
+
__exportStar(require("./runtime"), exports);
|
32
|
+
__exportStar(require("./streaming-fetcher"), exports);
|
33
|
+
exports.serialization = __importStar(require("./schemas"));
|
@@ -0,0 +1 @@
|
|
1
|
+
export { RUNTIME } from "./runtime";
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* A constant that indicates which environment and version the SDK is running in.
|
3
|
+
*/
|
4
|
+
export declare const RUNTIME: Runtime;
|
5
|
+
export interface Runtime {
|
6
|
+
type: "browser" | "web-worker" | "deno" | "bun" | "node" | "react-native" | "unknown" | "workerd";
|
7
|
+
version?: string;
|
8
|
+
parsedVersion?: number;
|
9
|
+
}
|
@@ -0,0 +1,93 @@
|
|
1
|
+
"use strict";
|
2
|
+
var _a, _b, _c, _d, _e;
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
4
|
+
exports.RUNTIME = void 0;
|
5
|
+
/**
|
6
|
+
* A constant that indicates whether the environment the code is running is a Web Browser.
|
7
|
+
*/
|
8
|
+
const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined";
|
9
|
+
/**
|
10
|
+
* A constant that indicates whether the environment the code is running is a Web Worker.
|
11
|
+
*/
|
12
|
+
const isWebWorker = typeof self === "object" &&
|
13
|
+
// @ts-ignore
|
14
|
+
typeof (self === null || self === void 0 ? void 0 : self.importScripts) === "function" &&
|
15
|
+
(((_a = self.constructor) === null || _a === void 0 ? void 0 : _a.name) === "DedicatedWorkerGlobalScope" ||
|
16
|
+
((_b = self.constructor) === null || _b === void 0 ? void 0 : _b.name) === "ServiceWorkerGlobalScope" ||
|
17
|
+
((_c = self.constructor) === null || _c === void 0 ? void 0 : _c.name) === "SharedWorkerGlobalScope");
|
18
|
+
/**
|
19
|
+
* A constant that indicates whether the environment the code is running is Deno.
|
20
|
+
*/
|
21
|
+
const isDeno = typeof Deno !== "undefined" && typeof Deno.version !== "undefined" && typeof Deno.version.deno !== "undefined";
|
22
|
+
/**
|
23
|
+
* A constant that indicates whether the environment the code is running is Bun.sh.
|
24
|
+
*/
|
25
|
+
const isBun = typeof Bun !== "undefined" && typeof Bun.version !== "undefined";
|
26
|
+
/**
|
27
|
+
* A constant that indicates whether the environment the code is running is Node.JS.
|
28
|
+
*/
|
29
|
+
const isNode = typeof process !== "undefined" &&
|
30
|
+
Boolean(process.version) &&
|
31
|
+
Boolean((_d = process.versions) === null || _d === void 0 ? void 0 : _d.node) &&
|
32
|
+
// Deno spoofs process.versions.node, see https://deno.land/std@0.177.0/node/process.ts?s=versions
|
33
|
+
!isDeno &&
|
34
|
+
!isBun;
|
35
|
+
/**
|
36
|
+
* A constant that indicates whether the environment the code is running is in React-Native.
|
37
|
+
* https://github.com/facebook/react-native/blob/main/packages/react-native/Libraries/Core/setUpNavigator.js
|
38
|
+
*/
|
39
|
+
const isReactNative = typeof navigator !== "undefined" && (navigator === null || navigator === void 0 ? void 0 : navigator.product) === "ReactNative";
|
40
|
+
/**
|
41
|
+
* A constant that indicates whether the environment the code is running is Cloudflare.
|
42
|
+
* https://developers.cloudflare.com/workers/runtime-apis/web-standards/#navigatoruseragent
|
43
|
+
*/
|
44
|
+
const isCloudflare = typeof globalThis !== "undefined" && ((_e = globalThis === null || globalThis === void 0 ? void 0 : globalThis.navigator) === null || _e === void 0 ? void 0 : _e.userAgent) === "Cloudflare-Workers";
|
45
|
+
/**
|
46
|
+
* A constant that indicates which environment and version the SDK is running in.
|
47
|
+
*/
|
48
|
+
exports.RUNTIME = evaluateRuntime();
|
49
|
+
function evaluateRuntime() {
|
50
|
+
if (isBrowser) {
|
51
|
+
return {
|
52
|
+
type: "browser",
|
53
|
+
version: window.navigator.userAgent,
|
54
|
+
};
|
55
|
+
}
|
56
|
+
if (isCloudflare) {
|
57
|
+
return {
|
58
|
+
type: "workerd",
|
59
|
+
};
|
60
|
+
}
|
61
|
+
if (isWebWorker) {
|
62
|
+
return {
|
63
|
+
type: "web-worker",
|
64
|
+
};
|
65
|
+
}
|
66
|
+
if (isDeno) {
|
67
|
+
return {
|
68
|
+
type: "deno",
|
69
|
+
version: Deno.version.deno,
|
70
|
+
};
|
71
|
+
}
|
72
|
+
if (isBun) {
|
73
|
+
return {
|
74
|
+
type: "bun",
|
75
|
+
version: Bun.version,
|
76
|
+
};
|
77
|
+
}
|
78
|
+
if (isNode) {
|
79
|
+
return {
|
80
|
+
type: "node",
|
81
|
+
version: process.versions.node,
|
82
|
+
parsedVersion: Number(process.versions.node.split(".")[0]),
|
83
|
+
};
|
84
|
+
}
|
85
|
+
if (isReactNative) {
|
86
|
+
return {
|
87
|
+
type: "react-native",
|
88
|
+
};
|
89
|
+
}
|
90
|
+
return {
|
91
|
+
type: "unknown",
|
92
|
+
};
|
93
|
+
}
|
@@ -0,0 +1,84 @@
|
|
1
|
+
import { SchemaUtils } from "./builders";
|
2
|
+
export declare type Schema<Raw = unknown, Parsed = unknown> = BaseSchema<Raw, Parsed> & SchemaUtils<Raw, Parsed>;
|
3
|
+
export declare type inferRaw<S extends Schema> = S extends Schema<infer Raw, any> ? Raw : never;
|
4
|
+
export declare type inferParsed<S extends Schema> = S extends Schema<any, infer Parsed> ? Parsed : never;
|
5
|
+
export interface BaseSchema<Raw, Parsed> {
|
6
|
+
parse: (raw: unknown, opts?: SchemaOptions) => MaybeValid<Parsed>;
|
7
|
+
json: (parsed: unknown, opts?: SchemaOptions) => MaybeValid<Raw>;
|
8
|
+
getType: () => SchemaType | SchemaType;
|
9
|
+
}
|
10
|
+
export declare const SchemaType: {
|
11
|
+
readonly DATE: "date";
|
12
|
+
readonly ENUM: "enum";
|
13
|
+
readonly LIST: "list";
|
14
|
+
readonly STRING_LITERAL: "stringLiteral";
|
15
|
+
readonly BOOLEAN_LITERAL: "booleanLiteral";
|
16
|
+
readonly OBJECT: "object";
|
17
|
+
readonly ANY: "any";
|
18
|
+
readonly BOOLEAN: "boolean";
|
19
|
+
readonly NUMBER: "number";
|
20
|
+
readonly STRING: "string";
|
21
|
+
readonly UNKNOWN: "unknown";
|
22
|
+
readonly RECORD: "record";
|
23
|
+
readonly SET: "set";
|
24
|
+
readonly UNION: "union";
|
25
|
+
readonly UNDISCRIMINATED_UNION: "undiscriminatedUnion";
|
26
|
+
readonly OPTIONAL: "optional";
|
27
|
+
};
|
28
|
+
export declare type SchemaType = typeof SchemaType[keyof typeof SchemaType];
|
29
|
+
export declare type MaybeValid<T> = Valid<T> | Invalid;
|
30
|
+
export interface Valid<T> {
|
31
|
+
ok: true;
|
32
|
+
value: T;
|
33
|
+
}
|
34
|
+
export interface Invalid {
|
35
|
+
ok: false;
|
36
|
+
errors: ValidationError[];
|
37
|
+
}
|
38
|
+
export interface ValidationError {
|
39
|
+
path: string[];
|
40
|
+
message: string;
|
41
|
+
}
|
42
|
+
export interface SchemaOptions {
|
43
|
+
/**
|
44
|
+
* how to handle unrecognized keys in objects
|
45
|
+
*
|
46
|
+
* @default "fail"
|
47
|
+
*/
|
48
|
+
unrecognizedObjectKeys?: "fail" | "passthrough" | "strip";
|
49
|
+
/**
|
50
|
+
* whether to fail when an unrecognized discriminant value is
|
51
|
+
* encountered in a union
|
52
|
+
*
|
53
|
+
* @default false
|
54
|
+
*/
|
55
|
+
allowUnrecognizedUnionMembers?: boolean;
|
56
|
+
/**
|
57
|
+
* whether to fail when an unrecognized enum value is encountered
|
58
|
+
*
|
59
|
+
* @default false
|
60
|
+
*/
|
61
|
+
allowUnrecognizedEnumValues?: boolean;
|
62
|
+
/**
|
63
|
+
* whether to allow data that doesn't conform to the schema.
|
64
|
+
* invalid data is passed through without transformation.
|
65
|
+
*
|
66
|
+
* when this is enabled, .parse() and .json() will always
|
67
|
+
* return `ok: true`. `.parseOrThrow()` and `.jsonOrThrow()`
|
68
|
+
* will never fail.
|
69
|
+
*
|
70
|
+
* @default false
|
71
|
+
*/
|
72
|
+
skipValidation?: boolean;
|
73
|
+
/**
|
74
|
+
* each validation failure contains a "path" property, which is
|
75
|
+
* the breadcrumbs to the offending node in the JSON. you can supply
|
76
|
+
* a prefix that is prepended to all the errors' paths. this can be
|
77
|
+
* helpful for zurg's internal debug logging.
|
78
|
+
*/
|
79
|
+
breadcrumbsPrefix?: string[];
|
80
|
+
/**
|
81
|
+
* whether to send 'null' for optional properties explicitly set to 'undefined'.
|
82
|
+
*/
|
83
|
+
omitUndefined?: boolean;
|
84
|
+
}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.SchemaType = void 0;
|
4
|
+
exports.SchemaType = {
|
5
|
+
DATE: "date",
|
6
|
+
ENUM: "enum",
|
7
|
+
LIST: "list",
|
8
|
+
STRING_LITERAL: "stringLiteral",
|
9
|
+
BOOLEAN_LITERAL: "booleanLiteral",
|
10
|
+
OBJECT: "object",
|
11
|
+
ANY: "any",
|
12
|
+
BOOLEAN: "boolean",
|
13
|
+
NUMBER: "number",
|
14
|
+
STRING: "string",
|
15
|
+
UNKNOWN: "unknown",
|
16
|
+
RECORD: "record",
|
17
|
+
SET: "set",
|
18
|
+
UNION: "union",
|
19
|
+
UNDISCRIMINATED_UNION: "undiscriminatedUnion",
|
20
|
+
OPTIONAL: "optional",
|
21
|
+
};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.date = void 0;
|
4
|
+
const Schema_1 = require("../../Schema");
|
5
|
+
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
6
|
+
const maybeSkipValidation_1 = require("../../utils/maybeSkipValidation");
|
7
|
+
const schema_utils_1 = require("../schema-utils");
|
8
|
+
// https://stackoverflow.com/questions/12756159/regex-and-iso8601-formatted-datetime
|
9
|
+
const ISO_8601_REGEX = /^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;
|
10
|
+
function date() {
|
11
|
+
const baseSchema = {
|
12
|
+
parse: (raw, { breadcrumbsPrefix = [] } = {}) => {
|
13
|
+
if (typeof raw !== "string") {
|
14
|
+
return {
|
15
|
+
ok: false,
|
16
|
+
errors: [
|
17
|
+
{
|
18
|
+
path: breadcrumbsPrefix,
|
19
|
+
message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(raw, "string"),
|
20
|
+
},
|
21
|
+
],
|
22
|
+
};
|
23
|
+
}
|
24
|
+
if (!ISO_8601_REGEX.test(raw)) {
|
25
|
+
return {
|
26
|
+
ok: false,
|
27
|
+
errors: [
|
28
|
+
{
|
29
|
+
path: breadcrumbsPrefix,
|
30
|
+
message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(raw, "ISO 8601 date string"),
|
31
|
+
},
|
32
|
+
],
|
33
|
+
};
|
34
|
+
}
|
35
|
+
return {
|
36
|
+
ok: true,
|
37
|
+
value: new Date(raw),
|
38
|
+
};
|
39
|
+
},
|
40
|
+
json: (date, { breadcrumbsPrefix = [] } = {}) => {
|
41
|
+
if (date instanceof Date) {
|
42
|
+
return {
|
43
|
+
ok: true,
|
44
|
+
value: date.toISOString(),
|
45
|
+
};
|
46
|
+
}
|
47
|
+
else {
|
48
|
+
return {
|
49
|
+
ok: false,
|
50
|
+
errors: [
|
51
|
+
{
|
52
|
+
path: breadcrumbsPrefix,
|
53
|
+
message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(date, "Date object"),
|
54
|
+
},
|
55
|
+
],
|
56
|
+
};
|
57
|
+
}
|
58
|
+
},
|
59
|
+
getType: () => Schema_1.SchemaType.DATE,
|
60
|
+
};
|
61
|
+
return Object.assign(Object.assign({}, (0, maybeSkipValidation_1.maybeSkipValidation)(baseSchema)), (0, schema_utils_1.getSchemaUtils)(baseSchema));
|
62
|
+
}
|
63
|
+
exports.date = date;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { date } from "./date";
|
@@ -0,0 +1,39 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.enum_ = void 0;
|
4
|
+
const Schema_1 = require("../../Schema");
|
5
|
+
const createIdentitySchemaCreator_1 = require("../../utils/createIdentitySchemaCreator");
|
6
|
+
const getErrorMessageForIncorrectType_1 = require("../../utils/getErrorMessageForIncorrectType");
|
7
|
+
function enum_(values) {
|
8
|
+
const validValues = new Set(values);
|
9
|
+
const schemaCreator = (0, createIdentitySchemaCreator_1.createIdentitySchemaCreator)(Schema_1.SchemaType.ENUM, (value, { allowUnrecognizedEnumValues, breadcrumbsPrefix = [] } = {}) => {
|
10
|
+
if (typeof value !== "string") {
|
11
|
+
return {
|
12
|
+
ok: false,
|
13
|
+
errors: [
|
14
|
+
{
|
15
|
+
path: breadcrumbsPrefix,
|
16
|
+
message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "string"),
|
17
|
+
},
|
18
|
+
],
|
19
|
+
};
|
20
|
+
}
|
21
|
+
if (!validValues.has(value) && !allowUnrecognizedEnumValues) {
|
22
|
+
return {
|
23
|
+
ok: false,
|
24
|
+
errors: [
|
25
|
+
{
|
26
|
+
path: breadcrumbsPrefix,
|
27
|
+
message: (0, getErrorMessageForIncorrectType_1.getErrorMessageForIncorrectType)(value, "enum"),
|
28
|
+
},
|
29
|
+
],
|
30
|
+
};
|
31
|
+
}
|
32
|
+
return {
|
33
|
+
ok: true,
|
34
|
+
value: value,
|
35
|
+
};
|
36
|
+
});
|
37
|
+
return schemaCreator();
|
38
|
+
}
|
39
|
+
exports.enum_ = enum_;
|