shelving 1.254.0 → 1.255.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 +1 -1
- package/api/cache/APICache.d.ts +9 -9
- package/api/cache/APICache.js +8 -8
- package/api/cache/EndpointCache.d.ts +10 -10
- package/api/cache/EndpointCache.js +10 -10
- package/api/endpoint/Endpoint.d.ts +20 -20
- package/api/endpoint/Endpoint.js +10 -10
- package/api/endpoint/util.d.ts +5 -5
- package/api/provider/APIProvider.d.ts +7 -7
- package/api/provider/APIProvider.js +2 -2
- package/api/provider/CachedAPIProvider.d.ts +7 -7
- package/api/provider/CachedAPIProvider.js +7 -7
- package/api/provider/ClientAPIProvider.d.ts +10 -10
- package/api/provider/ClientAPIProvider.js +9 -9
- package/api/provider/DebugAPIProvider.d.ts +4 -4
- package/api/provider/DebugAPIProvider.js +4 -4
- package/api/provider/JSONAPIProvider.d.ts +2 -2
- package/api/provider/JSONAPIProvider.js +2 -2
- package/api/provider/LoggingAPIProvider.d.ts +2 -2
- package/api/provider/LoggingAPIProvider.js +2 -2
- package/api/provider/MockAPIProvider.d.ts +11 -11
- package/api/provider/MockAPIProvider.js +8 -8
- package/api/provider/MockEndpointAPIProvider.d.ts +1 -1
- package/api/provider/MockEndpointAPIProvider.js +1 -1
- package/api/provider/ThroughAPIProvider.d.ts +8 -8
- package/api/provider/ThroughAPIProvider.js +8 -8
- package/api/provider/ValidationAPIProvider.d.ts +3 -3
- package/api/provider/ValidationAPIProvider.js +3 -3
- package/api/provider/XMLAPIProvider.d.ts +2 -2
- package/api/provider/XMLAPIProvider.js +2 -2
- package/api/store/EndpointStore.d.ts +3 -3
- package/api/store/EndpointStore.js +3 -3
- package/bun/BunPostgreSQLProvider.d.ts +4 -4
- package/bun/BunPostgreSQLProvider.js +4 -4
- package/cloudflare/CloudflareD1Provider.d.ts +3 -3
- package/cloudflare/CloudflareD1Provider.js +3 -3
- package/cloudflare/CloudflareKVProvider.d.ts +13 -13
- package/cloudflare/CloudflareKVProvider.js +13 -13
- package/cloudflare/types.d.ts +7 -7
- package/db/cache/CollectionCache.d.ts +11 -11
- package/db/cache/CollectionCache.js +11 -11
- package/db/cache/DBCache.d.ts +11 -11
- package/db/cache/DBCache.js +10 -10
- package/db/collection/Collection.d.ts +16 -16
- package/db/collection/Collection.js +7 -7
- package/db/migrate/DBMigrator.d.ts +3 -3
- package/db/migrate/DBMigrator.js +2 -2
- package/db/migrate/PostgreSQLMigrator.d.ts +1 -1
- package/db/migrate/PostgreSQLMigrator.js +1 -1
- package/db/migrate/SQLMigrator.d.ts +9 -9
- package/db/migrate/SQLMigrator.js +6 -6
- package/db/migrate/SQLiteMigrator.d.ts +1 -1
- package/db/migrate/SQLiteMigrator.js +1 -1
- package/db/provider/CacheDBProvider.d.ts +15 -15
- package/db/provider/CacheDBProvider.js +15 -15
- package/db/provider/ChangesDBProvider.d.ts +10 -10
- package/db/provider/ChangesDBProvider.js +9 -9
- package/db/provider/DBProvider.d.ts +16 -16
- package/db/provider/DBProvider.js +5 -5
- package/db/provider/DebugDBProvider.d.ts +13 -13
- package/db/provider/DebugDBProvider.js +13 -13
- package/db/provider/MemoryDBProvider.d.ts +31 -31
- package/db/provider/MemoryDBProvider.js +31 -31
- package/db/provider/MockDBProvider.d.ts +13 -13
- package/db/provider/MockDBProvider.js +12 -12
- package/db/provider/PostgreSQLProvider.d.ts +4 -4
- package/db/provider/PostgreSQLProvider.js +4 -4
- package/db/provider/SQLProvider.d.ts +29 -29
- package/db/provider/SQLProvider.js +27 -27
- package/db/provider/SQLiteProvider.d.ts +5 -5
- package/db/provider/SQLiteProvider.js +5 -5
- package/db/provider/ThroughDBProvider.d.ts +17 -17
- package/db/provider/ThroughDBProvider.js +17 -17
- package/db/provider/ValidationDBProvider.d.ts +12 -12
- package/db/provider/ValidationDBProvider.js +12 -12
- package/db/store/ItemStore.d.ts +5 -5
- package/db/store/ItemStore.js +5 -5
- package/db/store/QueryStore.d.ts +10 -10
- package/db/store/QueryStore.js +10 -10
- package/error/BaseError.d.ts +3 -3
- package/error/BaseError.js +1 -1
- package/error/Errors.d.ts +1 -1
- package/error/Errors.js +1 -1
- package/error/NetworkError.d.ts +1 -1
- package/error/NetworkError.js +1 -1
- package/error/RequestError.d.ts +7 -7
- package/error/RequestError.js +7 -7
- package/error/RequiredError.d.ts +1 -1
- package/error/RequiredError.js +1 -1
- package/error/ResponseError.d.ts +2 -2
- package/error/ResponseError.js +2 -2
- package/error/UnexpectedError.d.ts +1 -1
- package/error/UnexpectedError.js +1 -1
- package/error/UnimplementedError.d.ts +1 -1
- package/error/UnimplementedError.js +1 -1
- package/error/ValueError.d.ts +1 -1
- package/error/ValueError.js +1 -1
- package/extract/DirectoryExtractor.d.ts +3 -3
- package/extract/DirectoryExtractor.js +2 -2
- package/extract/Extractor.d.ts +3 -3
- package/extract/Extractor.js +1 -1
- package/extract/FileExtractor.d.ts +3 -3
- package/extract/FileExtractor.js +3 -3
- package/extract/IndexExtractor.d.ts +3 -3
- package/extract/IndexExtractor.js +2 -2
- package/extract/MarkupExtractor.d.ts +3 -3
- package/extract/MarkupExtractor.js +3 -3
- package/extract/MergingExtractor.d.ts +3 -3
- package/extract/MergingExtractor.js +2 -2
- package/extract/ModuleExtractor.d.ts +3 -3
- package/extract/ModuleExtractor.js +2 -2
- package/extract/PackageExtractor.d.ts +3 -3
- package/extract/PackageExtractor.js +2 -2
- package/extract/ThroughExtractor.d.ts +4 -4
- package/extract/ThroughExtractor.js +4 -4
- package/extract/TypescriptExtractor.d.ts +2 -2
- package/extract/TypescriptExtractor.js +2 -2
- package/firestore/client/FirestoreClientProvider.d.ts +14 -14
- package/firestore/client/FirestoreClientProvider.js +14 -14
- package/firestore/lite/FirestoreLiteProvider.d.ts +14 -14
- package/firestore/lite/FirestoreLiteProvider.js +14 -14
- package/firestore/server/FirestoreServerProvider.d.ts +14 -14
- package/firestore/server/FirestoreServerProvider.js +14 -14
- package/markup/MarkupParser.d.ts +14 -14
- package/markup/MarkupParser.js +13 -13
- package/markup/MarkupRule.d.ts +4 -4
- package/markup/Parser.d.ts +2 -2
- package/markup/Parser.js +1 -1
- package/markup/rule/blockquote.d.ts +1 -1
- package/markup/rule/blockquote.js +1 -1
- package/markup/rule/code.d.ts +1 -1
- package/markup/rule/code.js +1 -1
- package/markup/rule/fenced.d.ts +1 -1
- package/markup/rule/fenced.js +1 -1
- package/markup/rule/heading.d.ts +1 -1
- package/markup/rule/heading.js +1 -1
- package/markup/rule/index.d.ts +3 -3
- package/markup/rule/index.js +3 -3
- package/markup/rule/inline.d.ts +1 -1
- package/markup/rule/inline.js +1 -1
- package/markup/rule/linebreak.d.ts +1 -1
- package/markup/rule/linebreak.js +1 -1
- package/markup/rule/link.d.ts +2 -2
- package/markup/rule/link.js +2 -2
- package/markup/rule/ordered.d.ts +1 -1
- package/markup/rule/ordered.js +1 -1
- package/markup/rule/paragraph.d.ts +1 -1
- package/markup/rule/paragraph.js +1 -1
- package/markup/rule/separator.d.ts +1 -1
- package/markup/rule/separator.js +1 -1
- package/markup/rule/table.d.ts +1 -1
- package/markup/rule/table.js +1 -1
- package/markup/rule/unordered.d.ts +1 -1
- package/markup/rule/unordered.js +1 -1
- package/markup/util/regexp.d.ts +14 -14
- package/markup/util/regexp.js +11 -11
- package/package.json +1 -1
- package/react/createAPIContext.d.ts +2 -2
- package/react/createAPIContext.js +1 -1
- package/react/createDBContext.d.ts +2 -2
- package/react/createDBContext.js +1 -1
- package/react/useInstance.d.ts +1 -1
- package/react/useInstance.js +1 -1
- package/react/useLazy.d.ts +1 -1
- package/react/useMap.d.ts +1 -1
- package/react/useMap.js +1 -1
- package/react/useReduce.d.ts +1 -1
- package/react/useSequence.d.ts +1 -1
- package/react/useSequence.js +1 -1
- package/react/useStore.d.ts +1 -1
- package/schema/AddressSchema.d.ts +5 -5
- package/schema/AddressSchema.js +4 -4
- package/schema/ArraySchema.d.ts +5 -5
- package/schema/ArraySchema.js +4 -4
- package/schema/BooleanSchema.d.ts +5 -5
- package/schema/BooleanSchema.js +4 -4
- package/schema/ChoiceSchema.d.ts +7 -7
- package/schema/ChoiceSchema.js +4 -4
- package/schema/ColorSchema.d.ts +5 -5
- package/schema/ColorSchema.js +4 -4
- package/schema/CountrySchema.d.ts +6 -6
- package/schema/CountrySchema.js +5 -5
- package/schema/CurrencyAmountSchema.d.ts +14 -14
- package/schema/CurrencyAmountSchema.js +12 -12
- package/schema/CurrencyCodeSchema.d.ts +8 -8
- package/schema/CurrencyCodeSchema.js +7 -7
- package/schema/DataSchema.d.ts +10 -10
- package/schema/DataSchema.js +8 -8
- package/schema/DateSchema.d.ts +8 -8
- package/schema/DateSchema.js +6 -6
- package/schema/DateTimeSchema.d.ts +5 -5
- package/schema/DateTimeSchema.js +5 -5
- package/schema/DictionarySchema.d.ts +5 -5
- package/schema/DictionarySchema.js +4 -4
- package/schema/EmailSchema.d.ts +5 -5
- package/schema/EmailSchema.js +4 -4
- package/schema/EntitySchema.d.ts +5 -5
- package/schema/EntitySchema.js +4 -4
- package/schema/FileSchema.d.ts +5 -5
- package/schema/FileSchema.js +4 -4
- package/schema/KeySchema.d.ts +4 -4
- package/schema/KeySchema.js +4 -4
- package/schema/NullableSchema.d.ts +5 -5
- package/schema/NullableSchema.js +4 -4
- package/schema/NumberSchema.d.ts +14 -14
- package/schema/NumberSchema.js +13 -13
- package/schema/OptionalSchema.d.ts +5 -5
- package/schema/OptionalSchema.js +4 -4
- package/schema/PasswordSchema.d.ts +3 -3
- package/schema/PasswordSchema.js +3 -3
- package/schema/PhoneSchema.d.ts +5 -5
- package/schema/PhoneSchema.js +4 -4
- package/schema/RequiredSchema.d.ts +3 -3
- package/schema/RequiredSchema.js +3 -3
- package/schema/Schema.d.ts +9 -9
- package/schema/Schema.js +5 -5
- package/schema/SlugSchema.d.ts +5 -5
- package/schema/SlugSchema.js +4 -4
- package/schema/StringSchema.d.ts +12 -12
- package/schema/StringSchema.js +10 -10
- package/schema/ThroughSchema.d.ts +4 -4
- package/schema/ThroughSchema.js +3 -3
- package/schema/TimeSchema.d.ts +5 -5
- package/schema/TimeSchema.js +5 -5
- package/schema/URISchema.d.ts +7 -7
- package/schema/URISchema.js +6 -6
- package/schema/URLSchema.d.ts +7 -7
- package/schema/URLSchema.js +6 -6
- package/schema/UUIDSchema.d.ts +5 -5
- package/schema/UUIDSchema.js +4 -4
- package/sequence/DeferredSequence.d.ts +9 -9
- package/sequence/DeferredSequence.js +7 -7
- package/sequence/InspectSequence.d.ts +9 -9
- package/sequence/InspectSequence.js +9 -9
- package/sequence/LazySequence.d.ts +4 -4
- package/sequence/LazySequence.js +4 -4
- package/sequence/Sequence.d.ts +4 -4
- package/sequence/Sequence.js +3 -3
- package/sequence/ThroughSequence.d.ts +2 -2
- package/sequence/ThroughSequence.js +2 -2
- package/store/ArrayStore.d.ts +11 -11
- package/store/ArrayStore.js +11 -11
- package/store/BooleanStore.d.ts +2 -2
- package/store/BooleanStore.js +2 -2
- package/store/BusyStore.d.ts +2 -2
- package/store/BusyStore.js +2 -2
- package/store/DataStore.d.ts +15 -15
- package/store/DataStore.js +15 -15
- package/store/DictionaryStore.d.ts +8 -8
- package/store/DictionaryStore.js +8 -8
- package/store/FetchStore.d.ts +8 -8
- package/store/FetchStore.js +7 -7
- package/store/PathStore.d.ts +6 -6
- package/store/PathStore.js +6 -6
- package/store/PayloadFetchStore.d.ts +3 -3
- package/store/PayloadFetchStore.js +2 -2
- package/store/Store.d.ts +16 -16
- package/store/Store.js +10 -10
- package/store/URLStore.d.ts +25 -25
- package/store/URLStore.js +25 -25
- package/test/basics.d.ts +14 -14
- package/test/basics.js +12 -12
- package/test/people.d.ts +9 -9
- package/test/people.js +7 -7
- package/test/util.d.ts +3 -3
- package/test/util.js +3 -3
- package/ui/README.md +1 -1
- package/ui/app/App.d.ts +2 -2
- package/ui/app/App.js +1 -1
- package/ui/app/App.tsx +2 -2
- package/ui/block/Address.d.ts +6 -6
- package/ui/block/Address.js +3 -3
- package/ui/block/Address.tsx +6 -6
- package/ui/block/Block.d.ts +6 -5
- package/ui/block/Block.js +4 -3
- package/ui/block/Block.module.css +1 -0
- package/ui/block/Block.tsx +7 -5
- package/ui/block/Blockquote.d.ts +2 -2
- package/ui/block/Blockquote.js +1 -1
- package/ui/block/Blockquote.tsx +2 -2
- package/ui/block/Caption.d.ts +2 -2
- package/ui/block/Caption.js +1 -1
- package/ui/block/Caption.tsx +2 -2
- package/ui/block/Card.d.ts +2 -2
- package/ui/block/Card.js +1 -1
- package/ui/block/Card.module.css +1 -0
- package/ui/block/Card.tsx +2 -2
- package/ui/block/Definitions.d.ts +2 -2
- package/ui/block/Definitions.js +1 -1
- package/ui/block/Definitions.tsx +2 -2
- package/ui/block/Divider.d.ts +2 -2
- package/ui/block/Divider.js +1 -1
- package/ui/block/Divider.tsx +2 -2
- package/ui/block/Heading.d.ts +2 -2
- package/ui/block/Heading.js +1 -1
- package/ui/block/Heading.tsx +2 -2
- package/ui/block/Image.d.ts +2 -2
- package/ui/block/Image.js +1 -1
- package/ui/block/Image.tsx +2 -2
- package/ui/block/Label.d.ts +2 -2
- package/ui/block/Label.js +1 -1
- package/ui/block/Label.tsx +2 -2
- package/ui/block/List.d.ts +2 -2
- package/ui/block/List.js +1 -1
- package/ui/block/List.tsx +2 -2
- package/ui/block/Panel.d.ts +4 -3
- package/ui/block/Panel.js +3 -2
- package/ui/block/Panel.md +4 -2
- package/ui/block/Panel.module.css +7 -1
- package/ui/block/Panel.tsx +5 -3
- package/ui/block/Paragraph.d.ts +3 -3
- package/ui/block/Paragraph.js +2 -2
- package/ui/block/Paragraph.tsx +3 -3
- package/ui/block/Preformatted.d.ts +2 -2
- package/ui/block/Preformatted.js +1 -1
- package/ui/block/Preformatted.tsx +2 -2
- package/ui/block/Prose.d.ts +2 -2
- package/ui/block/Prose.js +1 -1
- package/ui/block/Prose.tsx +2 -2
- package/ui/block/Section.d.ts +9 -8
- package/ui/block/Section.js +8 -7
- package/ui/block/Section.md +3 -4
- package/ui/block/Section.module.css +3 -7
- package/ui/block/Section.tsx +10 -8
- package/ui/block/Subheading.d.ts +2 -2
- package/ui/block/Subheading.js +1 -1
- package/ui/block/Subheading.tsx +2 -2
- package/ui/block/Title.d.ts +2 -2
- package/ui/block/Title.js +1 -1
- package/ui/block/Title.tsx +2 -2
- package/ui/block/Video.d.ts +8 -8
- package/ui/block/Video.js +4 -4
- package/ui/block/Video.tsx +8 -8
- package/ui/dialog/Dialog.d.ts +4 -4
- package/ui/dialog/Dialog.js +2 -2
- package/ui/dialog/Dialog.tsx +4 -4
- package/ui/dialog/Dialogs.d.ts +8 -8
- package/ui/dialog/Dialogs.js +6 -6
- package/ui/dialog/Dialogs.tsx +8 -8
- package/ui/dialog/Modal.d.ts +2 -2
- package/ui/dialog/Modal.js +1 -1
- package/ui/dialog/Modal.tsx +2 -2
- package/ui/docs/DocumentationButtons.d.ts +1 -1
- package/ui/docs/DocumentationButtons.tsx +1 -1
- package/ui/docs/DocumentationCard.d.ts +1 -1
- package/ui/docs/DocumentationCard.js +1 -1
- package/ui/docs/DocumentationCard.tsx +1 -1
- package/ui/docs/DocumentationDescription.d.ts +2 -2
- package/ui/docs/DocumentationDescription.js +1 -1
- package/ui/docs/DocumentationDescription.tsx +2 -2
- package/ui/docs/DocumentationHomePage.d.ts +1 -1
- package/ui/docs/DocumentationHomePage.js +2 -2
- package/ui/docs/DocumentationHomePage.tsx +11 -9
- package/ui/docs/DocumentationKind.d.ts +3 -3
- package/ui/docs/DocumentationKind.js +2 -2
- package/ui/docs/DocumentationKind.tsx +3 -3
- package/ui/docs/DocumentationPage.d.ts +1 -1
- package/ui/docs/DocumentationPage.js +2 -2
- package/ui/docs/DocumentationPage.tsx +29 -27
- package/ui/docs/DocumentationParams.d.ts +2 -2
- package/ui/docs/DocumentationParams.js +1 -1
- package/ui/docs/DocumentationParams.tsx +2 -2
- package/ui/docs/DocumentationProperties.d.ts +2 -2
- package/ui/docs/DocumentationProperties.js +1 -1
- package/ui/docs/DocumentationProperties.tsx +2 -2
- package/ui/docs/DocumentationReferences.d.ts +2 -2
- package/ui/docs/DocumentationReferences.js +1 -1
- package/ui/docs/DocumentationReferences.tsx +2 -2
- package/ui/docs/DocumentationReturns.d.ts +2 -2
- package/ui/docs/DocumentationReturns.js +1 -1
- package/ui/docs/DocumentationReturns.tsx +2 -2
- package/ui/docs/DocumentationSignatures.d.ts +2 -2
- package/ui/docs/DocumentationSignatures.js +1 -1
- package/ui/docs/DocumentationSignatures.tsx +2 -2
- package/ui/docs/DocumentationThrows.d.ts +2 -2
- package/ui/docs/DocumentationThrows.js +1 -1
- package/ui/docs/DocumentationThrows.tsx +2 -2
- package/ui/docs/DocumentationType.d.ts +3 -3
- package/ui/docs/DocumentationType.js +2 -2
- package/ui/docs/DocumentationType.tsx +3 -3
- package/ui/form/ArrayInput.d.ts +2 -2
- package/ui/form/ArrayInput.tsx +2 -2
- package/ui/form/ArrayRadioInputs.d.ts +2 -2
- package/ui/form/ArrayRadioInputs.js +1 -1
- package/ui/form/ArrayRadioInputs.tsx +2 -2
- package/ui/form/Button.d.ts +3 -3
- package/ui/form/Button.js +2 -2
- package/ui/form/Button.module.css +1 -0
- package/ui/form/Button.tsx +3 -3
- package/ui/form/ButtonInput.d.ts +2 -2
- package/ui/form/ButtonInput.js +1 -1
- package/ui/form/ButtonInput.tsx +2 -2
- package/ui/form/ButtonInputPopover.d.ts +2 -2
- package/ui/form/ButtonInputPopover.js +1 -1
- package/ui/form/ButtonInputPopover.tsx +2 -2
- package/ui/form/ButtonPopover.d.ts +2 -2
- package/ui/form/ButtonPopover.js +1 -1
- package/ui/form/ButtonPopover.tsx +2 -2
- package/ui/form/CheckboxInput.d.ts +2 -2
- package/ui/form/CheckboxInput.js +1 -1
- package/ui/form/CheckboxInput.tsx +2 -2
- package/ui/form/ChoiceRadioInputs.d.ts +2 -2
- package/ui/form/ChoiceRadioInputs.tsx +2 -2
- package/ui/form/Clickable.d.ts +7 -7
- package/ui/form/Clickable.js +4 -4
- package/ui/form/Clickable.tsx +7 -7
- package/ui/form/DataInput.d.ts +2 -2
- package/ui/form/DataInput.tsx +2 -2
- package/ui/form/DateInput.d.ts +2 -2
- package/ui/form/DateInput.js +1 -1
- package/ui/form/DateInput.tsx +2 -2
- package/ui/form/DictionaryInput.d.ts +2 -2
- package/ui/form/DictionaryInput.tsx +2 -2
- package/ui/form/Field.d.ts +2 -2
- package/ui/form/Field.js +1 -1
- package/ui/form/Field.tsx +2 -2
- package/ui/form/FileInput.d.ts +2 -2
- package/ui/form/FileInput.js +1 -1
- package/ui/form/FileInput.tsx +2 -2
- package/ui/form/Form.d.ts +8 -7
- package/ui/form/Form.js +10 -7
- package/ui/form/Form.md +1 -1
- package/ui/form/Form.module.css +4 -0
- package/ui/form/Form.tsx +16 -11
- package/ui/form/FormContext.d.ts +3 -3
- package/ui/form/FormContext.js +1 -1
- package/ui/form/FormContext.tsx +3 -3
- package/ui/form/FormFields.d.ts +2 -2
- package/ui/form/FormFields.js +2 -2
- package/ui/form/FormFields.tsx +2 -2
- package/ui/form/FormFooter.d.ts +2 -2
- package/ui/form/FormFooter.js +1 -1
- package/ui/form/FormFooter.tsx +2 -2
- package/ui/form/FormInput.d.ts +3 -3
- package/ui/form/FormInput.js +2 -2
- package/ui/form/FormInput.tsx +3 -3
- package/ui/form/FormMessage.d.ts +1 -1
- package/ui/form/FormMessage.js +1 -1
- package/ui/form/FormMessage.tsx +1 -1
- package/ui/form/FormNotice.d.ts +1 -1
- package/ui/form/FormNotice.js +1 -1
- package/ui/form/FormNotice.tsx +1 -1
- package/ui/form/FormNotify.d.ts +1 -1
- package/ui/form/FormNotify.js +1 -1
- package/ui/form/FormNotify.tsx +1 -1
- package/ui/form/FormStore.d.ts +6 -6
- package/ui/form/FormStore.js +6 -6
- package/ui/form/FormStore.tsx +6 -6
- package/ui/form/Input.d.ts +3 -3
- package/ui/form/Input.js +1 -1
- package/ui/form/Input.tsx +3 -3
- package/ui/form/NumberInput.d.ts +2 -2
- package/ui/form/NumberInput.js +1 -1
- package/ui/form/NumberInput.tsx +2 -2
- package/ui/form/OutputInput.d.ts +2 -2
- package/ui/form/OutputInput.js +1 -1
- package/ui/form/OutputInput.tsx +2 -2
- package/ui/form/Popover.d.ts +3 -3
- package/ui/form/Popover.js +1 -1
- package/ui/form/Popover.tsx +3 -3
- package/ui/form/Progress.d.ts +4 -4
- package/ui/form/Progress.js +2 -2
- package/ui/form/Progress.tsx +4 -4
- package/ui/form/QueryInput.d.ts +2 -2
- package/ui/form/QueryInput.js +1 -1
- package/ui/form/QueryInput.tsx +2 -2
- package/ui/form/RadioInput.d.ts +2 -2
- package/ui/form/RadioInput.js +1 -1
- package/ui/form/RadioInput.tsx +2 -2
- package/ui/form/SchemaInput.d.ts +21 -21
- package/ui/form/SchemaInput.js +10 -10
- package/ui/form/SchemaInput.tsx +21 -21
- package/ui/form/SelectInput.d.ts +2 -2
- package/ui/form/SelectInput.tsx +2 -2
- package/ui/form/SubmitButton.d.ts +2 -2
- package/ui/form/SubmitButton.js +1 -1
- package/ui/form/SubmitButton.tsx +2 -2
- package/ui/form/TextInput.d.ts +2 -2
- package/ui/form/TextInput.js +1 -1
- package/ui/form/TextInput.tsx +2 -2
- package/ui/inline/Code.d.ts +2 -2
- package/ui/inline/Code.js +1 -1
- package/ui/inline/Code.tsx +2 -2
- package/ui/inline/Deleted.d.ts +2 -2
- package/ui/inline/Deleted.js +1 -1
- package/ui/inline/Deleted.tsx +2 -2
- package/ui/inline/Emphasis.d.ts +2 -2
- package/ui/inline/Emphasis.js +1 -1
- package/ui/inline/Emphasis.tsx +2 -2
- package/ui/inline/Inserted.d.ts +2 -2
- package/ui/inline/Inserted.js +1 -1
- package/ui/inline/Inserted.tsx +2 -2
- package/ui/inline/Link.d.ts +2 -2
- package/ui/inline/Link.js +1 -1
- package/ui/inline/Link.tsx +2 -2
- package/ui/inline/Mark.d.ts +2 -2
- package/ui/inline/Mark.js +1 -1
- package/ui/inline/Mark.tsx +2 -2
- package/ui/inline/Small.d.ts +2 -2
- package/ui/inline/Small.js +1 -1
- package/ui/inline/Small.tsx +2 -2
- package/ui/inline/Strong.d.ts +2 -2
- package/ui/inline/Strong.js +1 -1
- package/ui/inline/Strong.tsx +2 -2
- package/ui/inline/Subscript.d.ts +2 -2
- package/ui/inline/Subscript.js +1 -1
- package/ui/inline/Subscript.tsx +2 -2
- package/ui/inline/Superscript.d.ts +2 -2
- package/ui/inline/Superscript.js +1 -1
- package/ui/inline/Superscript.tsx +2 -2
- package/ui/inline/When.d.ts +6 -6
- package/ui/inline/When.js +3 -3
- package/ui/inline/When.tsx +6 -6
- package/ui/layout/CenteredLayout.d.ts +2 -2
- package/ui/layout/CenteredLayout.js +1 -1
- package/ui/layout/CenteredLayout.tsx +2 -2
- package/ui/layout/Layout.d.ts +1 -1
- package/ui/layout/Layout.js +1 -1
- package/ui/layout/Layout.ts +1 -1
- package/ui/layout/SidebarLayout.d.ts +2 -2
- package/ui/layout/SidebarLayout.js +1 -1
- package/ui/layout/SidebarLayout.tsx +2 -2
- package/ui/menu/Menu.d.ts +4 -4
- package/ui/menu/Menu.js +2 -2
- package/ui/menu/Menu.tsx +4 -4
- package/ui/misc/Catcher.d.ts +11 -11
- package/ui/misc/Catcher.js +5 -5
- package/ui/misc/Catcher.tsx +11 -11
- package/ui/misc/Icon.d.ts +4 -4
- package/ui/misc/Icon.js +2 -2
- package/ui/misc/Icon.tsx +4 -4
- package/ui/misc/Loading.d.ts +3 -3
- package/ui/misc/Loading.js +2 -2
- package/ui/misc/Loading.tsx +3 -3
- package/ui/misc/Mapper.d.ts +4 -4
- package/ui/misc/Mapper.js +1 -1
- package/ui/misc/Mapper.tsx +4 -4
- package/ui/misc/Markup.d.ts +2 -2
- package/ui/misc/Markup.js +1 -1
- package/ui/misc/Markup.tsx +2 -2
- package/ui/misc/MetaContext.d.ts +4 -4
- package/ui/misc/MetaContext.js +3 -3
- package/ui/misc/MetaContext.tsx +4 -4
- package/ui/misc/Tag.d.ts +4 -4
- package/ui/misc/Tag.js +2 -2
- package/ui/misc/Tag.tsx +4 -4
- package/ui/notice/Message.d.ts +3 -3
- package/ui/notice/Message.js +2 -2
- package/ui/notice/Message.tsx +3 -3
- package/ui/notice/Notice.d.ts +3 -3
- package/ui/notice/Notice.js +2 -2
- package/ui/notice/Notice.tsx +3 -3
- package/ui/notice/NoticeStore.d.ts +3 -3
- package/ui/notice/NoticeStore.js +3 -3
- package/ui/notice/NoticeStore.ts +3 -3
- package/ui/notice/Notices.d.ts +2 -2
- package/ui/notice/Notices.js +1 -1
- package/ui/notice/Notices.tsx +2 -2
- package/ui/notice/NoticesStore.d.ts +3 -3
- package/ui/notice/NoticesStore.js +3 -3
- package/ui/notice/NoticesStore.ts +3 -3
- package/ui/page/HTML.d.ts +2 -2
- package/ui/page/HTML.js +1 -1
- package/ui/page/HTML.tsx +2 -2
- package/ui/page/Head.d.ts +1 -1
- package/ui/page/Head.js +1 -1
- package/ui/page/Head.tsx +1 -1
- package/ui/page/Page.d.ts +2 -2
- package/ui/page/Page.js +1 -1
- package/ui/page/Page.tsx +2 -2
- package/ui/router/Navigation.d.ts +2 -2
- package/ui/router/Navigation.js +1 -1
- package/ui/router/Navigation.tsx +2 -2
- package/ui/router/NavigationContext.d.ts +2 -2
- package/ui/router/NavigationContext.js +2 -2
- package/ui/router/NavigationContext.tsx +2 -2
- package/ui/router/NavigationStore.d.ts +3 -3
- package/ui/router/NavigationStore.js +3 -3
- package/ui/router/NavigationStore.tsx +3 -3
- package/ui/router/RouteCache.d.ts +2 -2
- package/ui/router/RouteCache.js +1 -1
- package/ui/router/RouteCache.tsx +2 -2
- package/ui/router/Router.d.ts +2 -2
- package/ui/router/Router.js +1 -1
- package/ui/router/Router.tsx +2 -2
- package/ui/router/Routes.d.ts +4 -4
- package/ui/router/Routes.tsx +4 -4
- package/ui/style/Color.d.ts +3 -3
- package/ui/style/Color.js +1 -1
- package/ui/style/Color.tsx +3 -3
- package/ui/style/Duration.d.ts +3 -3
- package/ui/style/Duration.js +1 -1
- package/ui/style/Duration.tsx +3 -3
- package/ui/style/Flex.d.ts +6 -6
- package/ui/style/Flex.js +3 -3
- package/ui/style/Flex.tsx +6 -6
- package/ui/style/Gap.d.ts +3 -3
- package/ui/style/Gap.js +1 -1
- package/ui/style/Gap.tsx +3 -3
- package/ui/style/Indent.d.ts +24 -0
- package/ui/style/Indent.js +13 -0
- package/ui/style/Indent.module.css +62 -0
- package/ui/style/Indent.tsx +49 -0
- package/ui/style/Padding.d.ts +3 -3
- package/ui/style/Padding.js +1 -1
- package/ui/style/Padding.tsx +3 -3
- package/ui/style/Radius.d.ts +3 -3
- package/ui/style/Radius.js +1 -1
- package/ui/style/Radius.tsx +3 -3
- package/ui/style/Scroll.d.ts +4 -4
- package/ui/style/Scroll.js +2 -2
- package/ui/style/Scroll.tsx +4 -4
- package/ui/style/Shadow.d.ts +3 -3
- package/ui/style/Shadow.js +1 -1
- package/ui/style/Shadow.tsx +3 -3
- package/ui/style/Space.d.ts +3 -3
- package/ui/style/Space.js +1 -1
- package/ui/style/Space.tsx +3 -3
- package/ui/style/Status.d.ts +4 -4
- package/ui/style/Status.js +2 -2
- package/ui/style/Status.tsx +4 -4
- package/ui/style/Stroke.d.ts +3 -3
- package/ui/style/Stroke.js +1 -1
- package/ui/style/Stroke.tsx +3 -3
- package/ui/style/Tint.d.ts +2 -2
- package/ui/style/Tint.js +1 -1
- package/ui/style/Tint.tsx +2 -2
- package/ui/style/Typography.d.ts +6 -6
- package/ui/style/Typography.js +1 -1
- package/ui/style/Typography.tsx +6 -6
- package/ui/style/Width.d.ts +3 -3
- package/ui/style/Width.js +1 -1
- package/ui/style/Width.tsx +3 -3
- package/ui/style/getSpaceClass.md +2 -2
- package/ui/style/index.d.ts +1 -0
- package/ui/style/index.js +1 -0
- package/ui/style/index.tsx +1 -0
- package/ui/table/Cell.d.ts +2 -2
- package/ui/table/Cell.js +1 -1
- package/ui/table/Cell.tsx +2 -2
- package/ui/table/Table.d.ts +2 -2
- package/ui/table/Table.js +1 -1
- package/ui/table/Table.tsx +2 -2
- package/ui/transition/CollapseTransition.d.ts +2 -2
- package/ui/transition/CollapseTransition.js +1 -1
- package/ui/transition/CollapseTransition.tsx +2 -2
- package/ui/transition/FadeTransition.d.ts +2 -2
- package/ui/transition/FadeTransition.js +1 -1
- package/ui/transition/FadeTransition.tsx +2 -2
- package/ui/transition/HorizontalTransition.d.ts +2 -2
- package/ui/transition/HorizontalTransition.js +1 -1
- package/ui/transition/HorizontalTransition.tsx +2 -2
- package/ui/transition/Transition.d.ts +2 -2
- package/ui/transition/Transition.js +1 -1
- package/ui/transition/Transition.tsx +2 -2
- package/ui/transition/VerticalTransition.d.ts +2 -2
- package/ui/transition/VerticalTransition.js +1 -1
- package/ui/transition/VerticalTransition.tsx +2 -2
- package/ui/transition/util.d.ts +3 -3
- package/ui/transition/util.js +1 -1
- package/ui/transition/util.tsx +3 -3
- package/ui/tree/TreeApp.d.ts +2 -2
- package/ui/tree/TreeApp.js +1 -1
- package/ui/tree/TreeApp.tsx +2 -2
- package/ui/tree/TreeBreadcrumbs.d.ts +2 -2
- package/ui/tree/TreeBreadcrumbs.js +1 -1
- package/ui/tree/TreeBreadcrumbs.tsx +2 -2
- package/ui/tree/TreeButton.d.ts +2 -2
- package/ui/tree/TreeButton.js +1 -1
- package/ui/tree/TreeButton.tsx +2 -2
- package/ui/tree/TreeCard.d.ts +1 -1
- package/ui/tree/TreeCard.js +1 -1
- package/ui/tree/TreeCard.tsx +1 -1
- package/ui/tree/TreeCards.d.ts +3 -3
- package/ui/tree/TreeCards.js +2 -2
- package/ui/tree/TreeCards.tsx +3 -3
- package/ui/tree/TreeContext.d.ts +4 -4
- package/ui/tree/TreeContext.js +4 -4
- package/ui/tree/TreeContext.tsx +4 -4
- package/ui/tree/TreeIndexPage.d.ts +1 -1
- package/ui/tree/TreeIndexPage.js +3 -2
- package/ui/tree/TreeIndexPage.tsx +28 -25
- package/ui/tree/TreeLink.d.ts +2 -2
- package/ui/tree/TreeLink.js +1 -1
- package/ui/tree/TreeLink.tsx +2 -2
- package/ui/tree/TreeMarkup.d.ts +3 -3
- package/ui/tree/TreeMarkup.js +3 -3
- package/ui/tree/TreeMarkup.tsx +3 -3
- package/ui/tree/TreeMenu.d.ts +5 -5
- package/ui/tree/TreeMenu.js +4 -4
- package/ui/tree/TreeMenu.tsx +5 -5
- package/ui/tree/TreePage.d.ts +1 -1
- package/ui/tree/TreePage.js +3 -2
- package/ui/tree/TreePage.tsx +17 -14
- package/ui/tree/TreeRouter.d.ts +3 -3
- package/ui/tree/TreeRouter.js +2 -2
- package/ui/tree/TreeRouter.tsx +3 -3
- package/ui/tree/TreeSidebar.d.ts +2 -2
- package/ui/tree/TreeSidebar.js +1 -1
- package/ui/tree/TreeSidebar.tsx +2 -2
- package/ui/util/context.d.ts +1 -1
- package/ui/util/context.ts +1 -1
- package/ui/util/css.d.ts +5 -5
- package/ui/util/css.js +2 -2
- package/ui/util/css.ts +5 -5
- package/ui/util/event.d.ts +1 -1
- package/ui/util/event.js +1 -1
- package/ui/util/event.ts +1 -1
- package/ui/util/focus.d.ts +3 -3
- package/ui/util/focus.js +3 -3
- package/ui/util/focus.ts +3 -3
- package/ui/util/meta.d.ts +16 -16
- package/ui/util/meta.js +8 -8
- package/ui/util/meta.ts +16 -16
- package/ui/util/notice.d.ts +10 -10
- package/ui/util/notice.js +9 -9
- package/ui/util/notice.ts +10 -10
- package/ui/util/props.d.ts +2 -2
- package/ui/util/props.ts +2 -2
- package/ui/util/refresh.d.ts +1 -1
- package/ui/util/refresh.js +1 -1
- package/ui/util/refresh.ts +1 -1
- package/ui/util/scroll.d.ts +2 -2
- package/ui/util/scroll.js +2 -2
- package/ui/util/scroll.ts +2 -2
- package/ui/util/state.d.ts +2 -2
- package/ui/util/state.js +2 -2
- package/ui/util/state.ts +2 -2
- package/util/ansi.d.ts +24 -24
- package/util/ansi.js +23 -23
- package/util/array.d.ts +37 -37
- package/util/array.js +29 -29
- package/util/async.d.ts +15 -15
- package/util/async.js +13 -13
- package/util/base64.d.ts +6 -6
- package/util/base64.js +6 -6
- package/util/boolean.d.ts +10 -10
- package/util/boolean.js +10 -10
- package/util/buffer.d.ts +4 -4
- package/util/buffer.js +3 -3
- package/util/bytes.d.ts +6 -6
- package/util/bytes.js +4 -4
- package/util/class.d.ts +8 -8
- package/util/class.js +5 -5
- package/util/color.d.ts +21 -21
- package/util/color.js +20 -20
- package/util/constants.d.ts +26 -26
- package/util/constants.js +26 -26
- package/util/crypto.d.ts +3 -3
- package/util/crypto.js +3 -3
- package/util/currency.d.ts +6 -6
- package/util/currency.js +5 -5
- package/util/data.d.ts +26 -26
- package/util/data.js +4 -4
- package/util/date.d.ts +19 -19
- package/util/date.js +18 -18
- package/util/debug.d.ts +12 -12
- package/util/debug.js +12 -12
- package/util/dictionary.d.ts +24 -24
- package/util/dictionary.js +17 -17
- package/util/diff.d.ts +4 -4
- package/util/diff.js +2 -2
- package/util/dispose.d.ts +13 -13
- package/util/dispose.js +13 -13
- package/util/duration.d.ts +31 -31
- package/util/duration.js +29 -29
- package/util/element.d.ts +10 -10
- package/util/element.js +5 -5
- package/util/entity.d.ts +6 -6
- package/util/entity.js +1 -1
- package/util/entry.d.ts +9 -9
- package/util/entry.js +4 -4
- package/util/env.d.ts +4 -4
- package/util/env.js +4 -4
- package/util/equal.d.ts +22 -22
- package/util/equal.js +22 -22
- package/util/error.d.ts +8 -8
- package/util/error.js +7 -7
- package/util/file.d.ts +4 -4
- package/util/file.js +3 -3
- package/util/filter.d.ts +4 -4
- package/util/filter.js +3 -3
- package/util/focus.d.ts +1 -1
- package/util/focus.js +1 -1
- package/util/format.d.ts +27 -27
- package/util/format.js +15 -15
- package/util/function.d.ts +11 -11
- package/util/function.js +4 -4
- package/util/geo.d.ts +8 -8
- package/util/geo.js +5 -5
- package/util/hash.d.ts +2 -2
- package/util/hash.js +2 -2
- package/util/http.d.ts +26 -26
- package/util/http.js +18 -18
- package/util/hydrate.d.ts +4 -4
- package/util/hydrate.js +2 -2
- package/util/item.d.ts +11 -11
- package/util/item.js +4 -4
- package/util/iterate.d.ts +13 -13
- package/util/iterate.js +10 -10
- package/util/jwt.d.ts +9 -9
- package/util/jwt.js +7 -7
- package/util/lazy.d.ts +2 -2
- package/util/link.d.ts +3 -3
- package/util/link.js +2 -2
- package/util/log.d.ts +3 -3
- package/util/log.js +3 -3
- package/util/map.d.ts +19 -19
- package/util/map.js +11 -11
- package/util/merge.d.ts +5 -5
- package/util/merge.js +1 -1
- package/util/null.d.ts +13 -13
- package/util/null.js +11 -11
- package/util/number.d.ts +18 -18
- package/util/number.js +17 -17
- package/util/object.d.ts +35 -35
- package/util/object.js +17 -17
- package/util/path.d.ts +14 -14
- package/util/path.js +8 -8
- package/util/query.d.ts +10 -10
- package/util/query.js +7 -7
- package/util/random.d.ts +5 -5
- package/util/random.js +5 -5
- package/util/regexp.d.ts +26 -26
- package/util/regexp.js +13 -13
- package/util/sequence.d.ts +8 -8
- package/util/sequence.js +6 -6
- package/util/serialise.d.ts +1 -1
- package/util/serialise.js +1 -1
- package/util/set.d.ts +13 -13
- package/util/set.js +9 -9
- package/util/sort.d.ts +4 -4
- package/util/sort.js +3 -3
- package/util/source.d.ts +3 -3
- package/util/source.js +2 -2
- package/util/start.d.ts +8 -8
- package/util/start.js +5 -5
- package/util/string.d.ts +28 -28
- package/util/string.js +24 -24
- package/util/template.d.ts +10 -10
- package/util/template.js +7 -7
- package/util/timeout.d.ts +5 -5
- package/util/timeout.js +5 -5
- package/util/transform.d.ts +9 -9
- package/util/transform.js +7 -7
- package/util/tree.d.ts +12 -12
- package/util/tree.js +2 -2
- package/util/types.d.ts +2 -2
- package/util/undefined.d.ts +6 -6
- package/util/undefined.js +6 -6
- package/util/units.d.ts +16 -16
- package/util/units.js +14 -14
- package/util/update.d.ts +4 -4
- package/util/update.js +2 -2
- package/util/uri.d.ts +26 -26
- package/util/uri.js +6 -6
- package/util/url.d.ts +16 -16
- package/util/url.js +11 -11
- package/util/uuid.d.ts +3 -3
- package/util/uuid.js +3 -3
- package/util/validate.d.ts +11 -11
- package/util/validate.js +6 -6
- package/util/xml.d.ts +2 -2
- package/util/xml.js +2 -2
|
@@ -10,13 +10,13 @@ import type { Endpoint } from "../endpoint/Endpoint.js";
|
|
|
10
10
|
* const provider = new ClientAPIProvider({ url: "https://api.example.com" });
|
|
11
11
|
* const user = await provider.call(getUser, { id: "abc" });
|
|
12
12
|
*
|
|
13
|
-
* @see https://
|
|
13
|
+
* @see https://shelving.cc/api/APIProvider
|
|
14
14
|
*/
|
|
15
15
|
export declare abstract class APIProvider<P = unknown, R = unknown> implements AsyncDisposable {
|
|
16
16
|
/**
|
|
17
17
|
* The common base URL that every endpoint request is resolved against.
|
|
18
18
|
*
|
|
19
|
-
* @see https://
|
|
19
|
+
* @see https://shelving.cc/api/APIProvider/url
|
|
20
20
|
*/
|
|
21
21
|
abstract readonly url: URL;
|
|
22
22
|
/**
|
|
@@ -30,7 +30,7 @@ export declare abstract class APIProvider<P = unknown, R = unknown> implements A
|
|
|
30
30
|
* @throws {RequiredError} if this endpoint's path has `{placeholders}` but `payload` is not a data object.
|
|
31
31
|
* @throws {RequiredError} if this is a `HEAD` or `GET` request but `payload` is not a data object.
|
|
32
32
|
* @example provider.renderURL(getUser, { id: "abc" }) // URL("https://api.example.com/users/abc")
|
|
33
|
-
* @see https://
|
|
33
|
+
* @see https://shelving.cc/api/APIProvider/renderURL
|
|
34
34
|
*/
|
|
35
35
|
abstract renderURL<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP, caller?: AnyCaller): URL;
|
|
36
36
|
/**
|
|
@@ -47,7 +47,7 @@ export declare abstract class APIProvider<P = unknown, R = unknown> implements A
|
|
|
47
47
|
* @throws {RequiredError} if this endpoint's path has `{placeholders}` but `payload` is not a data object.
|
|
48
48
|
* @throws {RequiredError} if this is a `HEAD` or `GET` request but `payload` is not a data object.
|
|
49
49
|
* @example provider.createRequest(getUser, { id: "abc" })
|
|
50
|
-
* @see https://
|
|
50
|
+
* @see https://shelving.cc/api/APIProvider/createRequest
|
|
51
51
|
*/
|
|
52
52
|
abstract createRequest<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP, options?: RequestOptions, caller?: AnyCaller): Request;
|
|
53
53
|
/**
|
|
@@ -56,7 +56,7 @@ export declare abstract class APIProvider<P = unknown, R = unknown> implements A
|
|
|
56
56
|
* @param request The `Request` to send.
|
|
57
57
|
* @returns A promise resolving to the `Response`.
|
|
58
58
|
* @example const response = await provider.fetch(request);
|
|
59
|
-
* @see https://
|
|
59
|
+
* @see https://shelving.cc/api/APIProvider/fetch
|
|
60
60
|
*/
|
|
61
61
|
abstract fetch(request: Request): Promise<Response>;
|
|
62
62
|
/**
|
|
@@ -70,7 +70,7 @@ export declare abstract class APIProvider<P = unknown, R = unknown> implements A
|
|
|
70
70
|
* @returns A promise resolving to the parsed result.
|
|
71
71
|
* @throws {ResponseError} if the response status is non-2xx.
|
|
72
72
|
* @example const result = await provider.parseResponse(getUser, response);
|
|
73
|
-
* @see https://
|
|
73
|
+
* @see https://shelving.cc/api/APIProvider/parseResponse
|
|
74
74
|
*/
|
|
75
75
|
abstract parseResponse<PP extends P, RR extends R>(_endpoint: Endpoint<PP, RR>, response: Response, caller?: AnyCaller): Promise<RR>;
|
|
76
76
|
/**
|
|
@@ -84,7 +84,7 @@ export declare abstract class APIProvider<P = unknown, R = unknown> implements A
|
|
|
84
84
|
* @returns A promise resolving to the parsed result.
|
|
85
85
|
* @throws {ResponseError} if the response status is non-2xx.
|
|
86
86
|
* @example const user = await provider.call(getUser, { id: "abc" });
|
|
87
|
-
* @see https://
|
|
87
|
+
* @see https://shelving.cc/api/APIProvider/call
|
|
88
88
|
*/
|
|
89
89
|
call<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP, options?: RequestOptions, caller?: AnyCaller): Promise<RR>;
|
|
90
90
|
[Symbol.asyncDispose](): Promise<void>;
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* const provider = new ClientAPIProvider({ url: "https://api.example.com" });
|
|
8
8
|
* const user = await provider.call(getUser, { id: "abc" });
|
|
9
9
|
*
|
|
10
|
-
* @see https://
|
|
10
|
+
* @see https://shelving.cc/api/APIProvider
|
|
11
11
|
*/
|
|
12
12
|
export class APIProvider {
|
|
13
13
|
/**
|
|
@@ -21,7 +21,7 @@ export class APIProvider {
|
|
|
21
21
|
* @returns A promise resolving to the parsed result.
|
|
22
22
|
* @throws {ResponseError} if the response status is non-2xx.
|
|
23
23
|
* @example const user = await provider.call(getUser, { id: "abc" });
|
|
24
|
-
* @see https://
|
|
24
|
+
* @see https://shelving.cc/api/APIProvider/call
|
|
25
25
|
*/
|
|
26
26
|
async call(endpoint, payload, options, caller) {
|
|
27
27
|
const request = this.createRequest(endpoint, payload, options, caller);
|
|
@@ -11,13 +11,13 @@ import { ThroughAPIProvider } from "./ThroughAPIProvider.js";
|
|
|
11
11
|
* @example
|
|
12
12
|
* const api = new CachedAPIProvider(source);
|
|
13
13
|
* const result = await api.call(endpoint, payload);
|
|
14
|
-
* @see https://
|
|
14
|
+
* @see https://shelving.cc/api/CachedAPIProvider
|
|
15
15
|
*/
|
|
16
16
|
export declare class CachedAPIProvider<P, R> extends ThroughAPIProvider<P, R> implements AsyncDisposable {
|
|
17
17
|
/**
|
|
18
18
|
* The maximum age used when calling `call()`, defaulting to `AVOID_REFRESH` (only refresh if invalidated or still loading).
|
|
19
19
|
* - Not used for `refresh()` calls, which always refetch immediately.
|
|
20
|
-
* @see https://
|
|
20
|
+
* @see https://shelving.cc/api/CachedAPIProvider/maxAge
|
|
21
21
|
*/
|
|
22
22
|
readonly maxAge: number | undefined;
|
|
23
23
|
private readonly _cache;
|
|
@@ -38,7 +38,7 @@ export declare class CachedAPIProvider<P, R> extends ThroughAPIProvider<P, R> im
|
|
|
38
38
|
* @param caller The calling function used for error stack traces.
|
|
39
39
|
* @returns Promise resolving to the (possibly cached) result.
|
|
40
40
|
* @example await api.call(endpoint, payload)
|
|
41
|
-
* @see https://
|
|
41
|
+
* @see https://shelving.cc/api/CachedAPIProvider/call
|
|
42
42
|
*/
|
|
43
43
|
call<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP, _options?: RequestOptions, caller?: AnyCaller): Promise<RR>;
|
|
44
44
|
/**
|
|
@@ -47,7 +47,7 @@ export declare class CachedAPIProvider<P, R> extends ThroughAPIProvider<P, R> im
|
|
|
47
47
|
* @param endpoint The endpoint whose cached result should be invalidated.
|
|
48
48
|
* @param payload The payload identifying the cached result.
|
|
49
49
|
* @example api.invalidate(endpoint, payload)
|
|
50
|
-
* @see https://
|
|
50
|
+
* @see https://shelving.cc/api/CachedAPIProvider/invalidate
|
|
51
51
|
*/
|
|
52
52
|
invalidate<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP): void;
|
|
53
53
|
/**
|
|
@@ -55,7 +55,7 @@ export declare class CachedAPIProvider<P, R> extends ThroughAPIProvider<P, R> im
|
|
|
55
55
|
*
|
|
56
56
|
* @param endpoint The endpoint whose cached results should be invalidated.
|
|
57
57
|
* @example api.invalidateAll(endpoint)
|
|
58
|
-
* @see https://
|
|
58
|
+
* @see https://shelving.cc/api/CachedAPIProvider/invalidateAll
|
|
59
59
|
*/
|
|
60
60
|
invalidateAll<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>): void;
|
|
61
61
|
/**
|
|
@@ -64,7 +64,7 @@ export declare class CachedAPIProvider<P, R> extends ThroughAPIProvider<P, R> im
|
|
|
64
64
|
* @param endpoint The endpoint whose cached result should be refreshed.
|
|
65
65
|
* @param payload The payload identifying the cached result.
|
|
66
66
|
* @example api.refresh(endpoint, payload)
|
|
67
|
-
* @see https://
|
|
67
|
+
* @see https://shelving.cc/api/CachedAPIProvider/refresh
|
|
68
68
|
*/
|
|
69
69
|
refresh<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP): void;
|
|
70
70
|
/**
|
|
@@ -72,7 +72,7 @@ export declare class CachedAPIProvider<P, R> extends ThroughAPIProvider<P, R> im
|
|
|
72
72
|
*
|
|
73
73
|
* @param endpoint The endpoint whose cached results should be refreshed.
|
|
74
74
|
* @example api.refreshAll(endpoint)
|
|
75
|
-
* @see https://
|
|
75
|
+
* @see https://shelving.cc/api/CachedAPIProvider/refreshAll
|
|
76
76
|
*/
|
|
77
77
|
refreshAll<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>): void;
|
|
78
78
|
[Symbol.asyncDispose](): Promise<void>;
|
|
@@ -10,13 +10,13 @@ import { ThroughAPIProvider } from "./ThroughAPIProvider.js";
|
|
|
10
10
|
* @example
|
|
11
11
|
* const api = new CachedAPIProvider(source);
|
|
12
12
|
* const result = await api.call(endpoint, payload);
|
|
13
|
-
* @see https://
|
|
13
|
+
* @see https://shelving.cc/api/CachedAPIProvider
|
|
14
14
|
*/
|
|
15
15
|
export class CachedAPIProvider extends ThroughAPIProvider {
|
|
16
16
|
/**
|
|
17
17
|
* The maximum age used when calling `call()`, defaulting to `AVOID_REFRESH` (only refresh if invalidated or still loading).
|
|
18
18
|
* - Not used for `refresh()` calls, which always refetch immediately.
|
|
19
|
-
* @see https://
|
|
19
|
+
* @see https://shelving.cc/api/CachedAPIProvider/maxAge
|
|
20
20
|
*/
|
|
21
21
|
maxAge;
|
|
22
22
|
_cache;
|
|
@@ -41,7 +41,7 @@ export class CachedAPIProvider extends ThroughAPIProvider {
|
|
|
41
41
|
* @param caller The calling function used for error stack traces.
|
|
42
42
|
* @returns Promise resolving to the (possibly cached) result.
|
|
43
43
|
* @example await api.call(endpoint, payload)
|
|
44
|
-
* @see https://
|
|
44
|
+
* @see https://shelving.cc/api/CachedAPIProvider/call
|
|
45
45
|
*/
|
|
46
46
|
call(endpoint, payload, _options, caller = this.call) {
|
|
47
47
|
return this._cache.call(endpoint, payload, this.maxAge, caller);
|
|
@@ -52,7 +52,7 @@ export class CachedAPIProvider extends ThroughAPIProvider {
|
|
|
52
52
|
* @param endpoint The endpoint whose cached result should be invalidated.
|
|
53
53
|
* @param payload The payload identifying the cached result.
|
|
54
54
|
* @example api.invalidate(endpoint, payload)
|
|
55
|
-
* @see https://
|
|
55
|
+
* @see https://shelving.cc/api/CachedAPIProvider/invalidate
|
|
56
56
|
*/
|
|
57
57
|
invalidate(endpoint, payload) {
|
|
58
58
|
this._cache.invalidate(endpoint, payload);
|
|
@@ -62,7 +62,7 @@ export class CachedAPIProvider extends ThroughAPIProvider {
|
|
|
62
62
|
*
|
|
63
63
|
* @param endpoint The endpoint whose cached results should be invalidated.
|
|
64
64
|
* @example api.invalidateAll(endpoint)
|
|
65
|
-
* @see https://
|
|
65
|
+
* @see https://shelving.cc/api/CachedAPIProvider/invalidateAll
|
|
66
66
|
*/
|
|
67
67
|
invalidateAll(endpoint) {
|
|
68
68
|
this._cache.invalidateAll(endpoint);
|
|
@@ -73,7 +73,7 @@ export class CachedAPIProvider extends ThroughAPIProvider {
|
|
|
73
73
|
* @param endpoint The endpoint whose cached result should be refreshed.
|
|
74
74
|
* @param payload The payload identifying the cached result.
|
|
75
75
|
* @example api.refresh(endpoint, payload)
|
|
76
|
-
* @see https://
|
|
76
|
+
* @see https://shelving.cc/api/CachedAPIProvider/refresh
|
|
77
77
|
*/
|
|
78
78
|
refresh(endpoint, payload) {
|
|
79
79
|
this._cache.refresh(endpoint, payload, this.maxAge);
|
|
@@ -83,7 +83,7 @@ export class CachedAPIProvider extends ThroughAPIProvider {
|
|
|
83
83
|
*
|
|
84
84
|
* @param endpoint The endpoint whose cached results should be refreshed.
|
|
85
85
|
* @example api.refreshAll(endpoint)
|
|
86
|
-
* @see https://
|
|
86
|
+
* @see https://shelving.cc/api/CachedAPIProvider/refreshAll
|
|
87
87
|
*/
|
|
88
88
|
refreshAll(endpoint) {
|
|
89
89
|
this._cache.refreshAll(endpoint, this.maxAge);
|
|
@@ -8,7 +8,7 @@ import { APIProvider } from "./APIProvider.js";
|
|
|
8
8
|
/**
|
|
9
9
|
* Options for constructing a `ClientAPIProvider`.
|
|
10
10
|
*
|
|
11
|
-
* @see https://
|
|
11
|
+
* @see https://shelving.cc/api/ClientAPIProviderOptions
|
|
12
12
|
*/
|
|
13
13
|
export interface ClientAPIProviderOptions {
|
|
14
14
|
/**
|
|
@@ -44,25 +44,25 @@ export interface ClientAPIProviderOptions {
|
|
|
44
44
|
* const provider = new ClientAPIProvider({ url: "https://api.example.com" });
|
|
45
45
|
* const user = await provider.call(getUser, { id: "abc" });
|
|
46
46
|
*
|
|
47
|
-
* @see https://
|
|
47
|
+
* @see https://shelving.cc/api/ClientAPIProvider
|
|
48
48
|
*/
|
|
49
49
|
export declare class ClientAPIProvider<P = unknown, R = unknown> extends APIProvider<P, R> {
|
|
50
50
|
/**
|
|
51
51
|
* The common base URL for all rendered endpoint requests.
|
|
52
52
|
*
|
|
53
|
-
* @see https://
|
|
53
|
+
* @see https://shelving.cc/api/ClientAPIProvider/url
|
|
54
54
|
*/
|
|
55
55
|
readonly url: URL;
|
|
56
56
|
/**
|
|
57
57
|
* Default options used for HTTP requests created with `this.createRequest()` and `this.fetch()`
|
|
58
58
|
*
|
|
59
|
-
* @see https://
|
|
59
|
+
* @see https://shelving.cc/api/ClientAPIProvider/options
|
|
60
60
|
*/
|
|
61
61
|
readonly options: RequestOptions;
|
|
62
62
|
/**
|
|
63
63
|
* Timeout in milliseconds before the request is aborted, or `0` for no timeout.
|
|
64
64
|
*
|
|
65
|
-
* @see https://
|
|
65
|
+
* @see https://shelving.cc/api/ClientAPIProvider/timeout
|
|
66
66
|
*/
|
|
67
67
|
readonly timeout: number;
|
|
68
68
|
/**
|
|
@@ -70,7 +70,7 @@ export declare class ClientAPIProvider<P = unknown, R = unknown> extends APIProv
|
|
|
70
70
|
*
|
|
71
71
|
* @throws {RequiredError} if `url` cannot be resolved to a valid base URL.
|
|
72
72
|
* @example new ClientAPIProvider({ url: "https://api.example.com" })
|
|
73
|
-
* @see https://
|
|
73
|
+
* @see https://shelving.cc/api/ClientAPIProvider
|
|
74
74
|
*/
|
|
75
75
|
constructor({ url, options, timeout }: ClientAPIProviderOptions);
|
|
76
76
|
/**
|
|
@@ -83,7 +83,7 @@ export declare class ClientAPIProvider<P = unknown, R = unknown> extends APIProv
|
|
|
83
83
|
* @throws {RequiredError} if this endpoint's path has `{placeholders}` but `payload` is not a data object.
|
|
84
84
|
* @throws {RequiredError} if this is a `HEAD` or `GET` request but `payload` is not a data object.
|
|
85
85
|
* @example provider.renderURL(getUser, { id: "abc" })
|
|
86
|
-
* @see https://
|
|
86
|
+
* @see https://shelving.cc/api/ClientAPIProvider/renderURL
|
|
87
87
|
*/
|
|
88
88
|
renderURL<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP, caller?: AnyCaller): URL;
|
|
89
89
|
/**
|
|
@@ -99,7 +99,7 @@ export declare class ClientAPIProvider<P = unknown, R = unknown> extends APIProv
|
|
|
99
99
|
* @throws {RequiredError} if this endpoint's path has `{placeholders}` but `payload` is not a data object.
|
|
100
100
|
* @throws {RequiredError} if this is a `HEAD` or `GET` request but `payload` is not a data object.
|
|
101
101
|
* @example provider.createRequest(getUser, { id: "abc" })
|
|
102
|
-
* @see https://
|
|
102
|
+
* @see https://shelving.cc/api/ClientAPIProvider/createRequest
|
|
103
103
|
*/
|
|
104
104
|
createRequest<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP, options?: RequestOptions, caller?: AnyCaller): Request;
|
|
105
105
|
/** Internal implementation function for `createRequest()` used for requests that have no body. */
|
|
@@ -114,7 +114,7 @@ export declare class ClientAPIProvider<P = unknown, R = unknown> extends APIProv
|
|
|
114
114
|
* @param request The `Request` to send.
|
|
115
115
|
* @returns A promise resolving to the `Response`.
|
|
116
116
|
* @example await provider.fetch(request)
|
|
117
|
-
* @see https://
|
|
117
|
+
* @see https://shelving.cc/api/ClientAPIProvider/fetch
|
|
118
118
|
*/
|
|
119
119
|
fetch(request: Request): Promise<Response>;
|
|
120
120
|
/**
|
|
@@ -126,7 +126,7 @@ export declare class ClientAPIProvider<P = unknown, R = unknown> extends APIProv
|
|
|
126
126
|
* @returns A promise resolving to the parsed result.
|
|
127
127
|
* @throws {ResponseError} if the response status is non-2xx.
|
|
128
128
|
* @example await provider.parseResponse(getUser, response)
|
|
129
|
-
* @see https://
|
|
129
|
+
* @see https://shelving.cc/api/ClientAPIProvider/parseResponse
|
|
130
130
|
*/
|
|
131
131
|
parseResponse<PP extends P, RR extends R>(_endpoint: Endpoint<PP, RR>, response: Response, caller?: AnyCaller): Promise<RR>;
|
|
132
132
|
}
|
|
@@ -18,25 +18,25 @@ import { APIProvider } from "./APIProvider.js";
|
|
|
18
18
|
* const provider = new ClientAPIProvider({ url: "https://api.example.com" });
|
|
19
19
|
* const user = await provider.call(getUser, { id: "abc" });
|
|
20
20
|
*
|
|
21
|
-
* @see https://
|
|
21
|
+
* @see https://shelving.cc/api/ClientAPIProvider
|
|
22
22
|
*/
|
|
23
23
|
export class ClientAPIProvider extends APIProvider {
|
|
24
24
|
/**
|
|
25
25
|
* The common base URL for all rendered endpoint requests.
|
|
26
26
|
*
|
|
27
|
-
* @see https://
|
|
27
|
+
* @see https://shelving.cc/api/ClientAPIProvider/url
|
|
28
28
|
*/
|
|
29
29
|
url;
|
|
30
30
|
/**
|
|
31
31
|
* Default options used for HTTP requests created with `this.createRequest()` and `this.fetch()`
|
|
32
32
|
*
|
|
33
|
-
* @see https://
|
|
33
|
+
* @see https://shelving.cc/api/ClientAPIProvider/options
|
|
34
34
|
*/
|
|
35
35
|
options;
|
|
36
36
|
/**
|
|
37
37
|
* Timeout in milliseconds before the request is aborted, or `0` for no timeout.
|
|
38
38
|
*
|
|
39
|
-
* @see https://
|
|
39
|
+
* @see https://shelving.cc/api/ClientAPIProvider/timeout
|
|
40
40
|
*/
|
|
41
41
|
timeout;
|
|
42
42
|
/**
|
|
@@ -44,7 +44,7 @@ export class ClientAPIProvider extends APIProvider {
|
|
|
44
44
|
*
|
|
45
45
|
* @throws {RequiredError} if `url` cannot be resolved to a valid base URL.
|
|
46
46
|
* @example new ClientAPIProvider({ url: "https://api.example.com" })
|
|
47
|
-
* @see https://
|
|
47
|
+
* @see https://shelving.cc/api/ClientAPIProvider
|
|
48
48
|
*/
|
|
49
49
|
constructor({ url, options = {}, timeout = 20_000 }) {
|
|
50
50
|
super();
|
|
@@ -62,7 +62,7 @@ export class ClientAPIProvider extends APIProvider {
|
|
|
62
62
|
* @throws {RequiredError} if this endpoint's path has `{placeholders}` but `payload` is not a data object.
|
|
63
63
|
* @throws {RequiredError} if this is a `HEAD` or `GET` request but `payload` is not a data object.
|
|
64
64
|
* @example provider.renderURL(getUser, { id: "abc" })
|
|
65
|
-
* @see https://
|
|
65
|
+
* @see https://shelving.cc/api/ClientAPIProvider/renderURL
|
|
66
66
|
*/
|
|
67
67
|
renderURL(endpoint, payload, caller = this.renderURL) {
|
|
68
68
|
// Construct the full URL from `this.url` and the rendered path.
|
|
@@ -93,7 +93,7 @@ export class ClientAPIProvider extends APIProvider {
|
|
|
93
93
|
* @throws {RequiredError} if this endpoint's path has `{placeholders}` but `payload` is not a data object.
|
|
94
94
|
* @throws {RequiredError} if this is a `HEAD` or `GET` request but `payload` is not a data object.
|
|
95
95
|
* @example provider.createRequest(getUser, { id: "abc" })
|
|
96
|
-
* @see https://
|
|
96
|
+
* @see https://shelving.cc/api/ClientAPIProvider/createRequest
|
|
97
97
|
*/
|
|
98
98
|
createRequest(endpoint, payload, options, caller = this.createRequest) {
|
|
99
99
|
// Render the path into the base URL.
|
|
@@ -125,7 +125,7 @@ export class ClientAPIProvider extends APIProvider {
|
|
|
125
125
|
* @param request The `Request` to send.
|
|
126
126
|
* @returns A promise resolving to the `Response`.
|
|
127
127
|
* @example await provider.fetch(request)
|
|
128
|
-
* @see https://
|
|
128
|
+
* @see https://shelving.cc/api/ClientAPIProvider/fetch
|
|
129
129
|
*/
|
|
130
130
|
async fetch(request) {
|
|
131
131
|
return fetch(request);
|
|
@@ -139,7 +139,7 @@ export class ClientAPIProvider extends APIProvider {
|
|
|
139
139
|
* @returns A promise resolving to the parsed result.
|
|
140
140
|
* @throws {ResponseError} if the response status is non-2xx.
|
|
141
141
|
* @example await provider.parseResponse(getUser, response)
|
|
142
|
-
* @see https://
|
|
142
|
+
* @see https://shelving.cc/api/ClientAPIProvider/parseResponse
|
|
143
143
|
*/
|
|
144
144
|
async parseResponse(_endpoint, response, caller = this.parseResponse) {
|
|
145
145
|
const { ok, status } = response;
|
|
@@ -8,7 +8,7 @@ import { ThroughAPIProvider } from "./ThroughAPIProvider.js";
|
|
|
8
8
|
* @example
|
|
9
9
|
* const api = new DebugAPIProvider(source);
|
|
10
10
|
* await api.call(endpoint, payload); // logs request, response, and result
|
|
11
|
-
* @see https://
|
|
11
|
+
* @see https://shelving.cc/api/DebugAPIProvider
|
|
12
12
|
*/
|
|
13
13
|
export declare class DebugAPIProvider<P, R> extends ThroughAPIProvider<P, R> {
|
|
14
14
|
/**
|
|
@@ -21,7 +21,7 @@ export declare class DebugAPIProvider<P, R> extends ThroughAPIProvider<P, R> {
|
|
|
21
21
|
* @returns The built request.
|
|
22
22
|
* @throws Rethrows any error thrown while building the request (after logging it).
|
|
23
23
|
* @example api.createRequest(endpoint, payload)
|
|
24
|
-
* @see https://
|
|
24
|
+
* @see https://shelving.cc/api/DebugAPIProvider/createRequest
|
|
25
25
|
*/
|
|
26
26
|
createRequest<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP, options?: RequestOptions, caller?: AnyCaller): Request;
|
|
27
27
|
/**
|
|
@@ -31,7 +31,7 @@ export declare class DebugAPIProvider<P, R> extends ThroughAPIProvider<P, R> {
|
|
|
31
31
|
* @returns Promise resolving to the response.
|
|
32
32
|
* @throws Rethrows any error thrown by the source provider (after logging it).
|
|
33
33
|
* @example await api.fetch(request)
|
|
34
|
-
* @see https://
|
|
34
|
+
* @see https://shelving.cc/api/DebugAPIProvider/fetch
|
|
35
35
|
*/
|
|
36
36
|
fetch(request: Request): Promise<Response>;
|
|
37
37
|
/**
|
|
@@ -43,7 +43,7 @@ export declare class DebugAPIProvider<P, R> extends ThroughAPIProvider<P, R> {
|
|
|
43
43
|
* @returns Promise resolving to the parsed result.
|
|
44
44
|
* @throws Rethrows any error thrown while parsing (after logging it).
|
|
45
45
|
* @example await api.parseResponse(endpoint, response)
|
|
46
|
-
* @see https://
|
|
46
|
+
* @see https://shelving.cc/api/DebugAPIProvider/parseResponse
|
|
47
47
|
*/
|
|
48
48
|
parseResponse<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, response: Response, caller?: AnyCaller): Promise<RR>;
|
|
49
49
|
}
|
|
@@ -7,7 +7,7 @@ import { ThroughAPIProvider } from "./ThroughAPIProvider.js";
|
|
|
7
7
|
* @example
|
|
8
8
|
* const api = new DebugAPIProvider(source);
|
|
9
9
|
* await api.call(endpoint, payload); // logs request, response, and result
|
|
10
|
-
* @see https://
|
|
10
|
+
* @see https://shelving.cc/api/DebugAPIProvider
|
|
11
11
|
*/
|
|
12
12
|
export class DebugAPIProvider extends ThroughAPIProvider {
|
|
13
13
|
/**
|
|
@@ -20,7 +20,7 @@ export class DebugAPIProvider extends ThroughAPIProvider {
|
|
|
20
20
|
* @returns The built request.
|
|
21
21
|
* @throws Rethrows any error thrown while building the request (after logging it).
|
|
22
22
|
* @example api.createRequest(endpoint, payload)
|
|
23
|
-
* @see https://
|
|
23
|
+
* @see https://shelving.cc/api/DebugAPIProvider/createRequest
|
|
24
24
|
*/
|
|
25
25
|
createRequest(endpoint, payload, options, caller = this.createRequest) {
|
|
26
26
|
try {
|
|
@@ -40,7 +40,7 @@ export class DebugAPIProvider extends ThroughAPIProvider {
|
|
|
40
40
|
* @returns Promise resolving to the response.
|
|
41
41
|
* @throws Rethrows any error thrown by the source provider (after logging it).
|
|
42
42
|
* @example await api.fetch(request)
|
|
43
|
-
* @see https://
|
|
43
|
+
* @see https://shelving.cc/api/DebugAPIProvider/fetch
|
|
44
44
|
*/
|
|
45
45
|
async fetch(request) {
|
|
46
46
|
try {
|
|
@@ -63,7 +63,7 @@ export class DebugAPIProvider extends ThroughAPIProvider {
|
|
|
63
63
|
* @returns Promise resolving to the parsed result.
|
|
64
64
|
* @throws Rethrows any error thrown while parsing (after logging it).
|
|
65
65
|
* @example await api.parseResponse(endpoint, response)
|
|
66
|
-
* @see https://
|
|
66
|
+
* @see https://shelving.cc/api/DebugAPIProvider/parseResponse
|
|
67
67
|
*/
|
|
68
68
|
async parseResponse(endpoint, response, caller = this.parseResponse) {
|
|
69
69
|
try {
|
|
@@ -11,7 +11,7 @@ import { ClientAPIProvider } from "./ClientAPIProvider.js";
|
|
|
11
11
|
* const provider = new JSONAPIProvider({ url: "https://api.example.com" });
|
|
12
12
|
* const user = await provider.call(getUser, { id: "abc" });
|
|
13
13
|
*
|
|
14
|
-
* @see https://
|
|
14
|
+
* @see https://shelving.cc/api/JSONAPIProvider
|
|
15
15
|
*/
|
|
16
16
|
export declare class JSONAPIProvider<P = unknown, R = unknown> extends ClientAPIProvider<P, R> {
|
|
17
17
|
protected _createBodyRequest(method: RequestBodyMethod, url: PossibleURL, payload: P, options: RequestOptions, caller: AnyCaller): Request;
|
|
@@ -26,7 +26,7 @@ export declare class JSONAPIProvider<P = unknown, R = unknown> extends ClientAPI
|
|
|
26
26
|
* @returns A promise resolving to the parsed JSON result.
|
|
27
27
|
* @throws {ResponseError} if the response status is non-2xx.
|
|
28
28
|
* @example await provider.parseResponse(getUser, response)
|
|
29
|
-
* @see https://
|
|
29
|
+
* @see https://shelving.cc/api/JSONAPIProvider/parseResponse
|
|
30
30
|
*/
|
|
31
31
|
parseResponse<PP extends P, RR extends R>(_endpoint: Endpoint<PP, RR>, response: Response, caller?: AnyCaller): Promise<RR>;
|
|
32
32
|
}
|
|
@@ -10,7 +10,7 @@ import { ClientAPIProvider } from "./ClientAPIProvider.js";
|
|
|
10
10
|
* const provider = new JSONAPIProvider({ url: "https://api.example.com" });
|
|
11
11
|
* const user = await provider.call(getUser, { id: "abc" });
|
|
12
12
|
*
|
|
13
|
-
* @see https://
|
|
13
|
+
* @see https://shelving.cc/api/JSONAPIProvider
|
|
14
14
|
*/
|
|
15
15
|
export class JSONAPIProvider extends ClientAPIProvider {
|
|
16
16
|
_createBodyRequest(method, url, payload, options, caller) {
|
|
@@ -27,7 +27,7 @@ export class JSONAPIProvider extends ClientAPIProvider {
|
|
|
27
27
|
* @returns A promise resolving to the parsed JSON result.
|
|
28
28
|
* @throws {ResponseError} if the response status is non-2xx.
|
|
29
29
|
* @example await provider.parseResponse(getUser, response)
|
|
30
|
-
* @see https://
|
|
30
|
+
* @see https://shelving.cc/api/JSONAPIProvider/parseResponse
|
|
31
31
|
*/
|
|
32
32
|
async parseResponse(_endpoint, response, caller = this.parseResponse) {
|
|
33
33
|
const { ok, status } = response;
|
|
@@ -8,7 +8,7 @@ import { ThroughAPIProvider } from "./ThroughAPIProvider.js";
|
|
|
8
8
|
* @example
|
|
9
9
|
* const api = new LoggingAPIProvider(source);
|
|
10
10
|
* await api.fetch(request); // logs request and response
|
|
11
|
-
* @see https://
|
|
11
|
+
* @see https://shelving.cc/api/LoggingAPIProvider
|
|
12
12
|
*/
|
|
13
13
|
export declare class LoggingAPIProvider<P, R> extends ThroughAPIProvider<P, R> {
|
|
14
14
|
protected _logRequest: Callback<[Request]>;
|
|
@@ -37,7 +37,7 @@ export declare class LoggingAPIProvider<P, R> extends ThroughAPIProvider<P, R> {
|
|
|
37
37
|
* @returns Promise resolving to the response.
|
|
38
38
|
* @throws Rethrows any error thrown by the source provider (after logging it).
|
|
39
39
|
* @example await api.fetch(request)
|
|
40
|
-
* @see https://
|
|
40
|
+
* @see https://shelving.cc/api/LoggingAPIProvider/fetch
|
|
41
41
|
*/
|
|
42
42
|
fetch(request: Request): Promise<Response>;
|
|
43
43
|
}
|
|
@@ -7,7 +7,7 @@ import { ThroughAPIProvider } from "./ThroughAPIProvider.js";
|
|
|
7
7
|
* @example
|
|
8
8
|
* const api = new LoggingAPIProvider(source);
|
|
9
9
|
* await api.fetch(request); // logs request and response
|
|
10
|
-
* @see https://
|
|
10
|
+
* @see https://shelving.cc/api/LoggingAPIProvider
|
|
11
11
|
*/
|
|
12
12
|
export class LoggingAPIProvider extends ThroughAPIProvider {
|
|
13
13
|
_logRequest;
|
|
@@ -41,7 +41,7 @@ export class LoggingAPIProvider extends ThroughAPIProvider {
|
|
|
41
41
|
* @returns Promise resolving to the response.
|
|
42
42
|
* @throws Rethrows any error thrown by the source provider (after logging it).
|
|
43
43
|
* @example await api.fetch(request)
|
|
44
|
-
* @see https://
|
|
44
|
+
* @see https://shelving.cc/api/LoggingAPIProvider/fetch
|
|
45
45
|
*/
|
|
46
46
|
async fetch(request) {
|
|
47
47
|
try {
|
|
@@ -5,7 +5,7 @@ import type { APIProvider } from "./APIProvider.js";
|
|
|
5
5
|
import { ThroughAPIProvider } from "./ThroughAPIProvider.js";
|
|
6
6
|
/**
|
|
7
7
|
* Record of a single mocked fetch, pairing the request with the response the handler returned.
|
|
8
|
-
* @see https://
|
|
8
|
+
* @see https://shelving.cc/api/MockAPIFetchCall
|
|
9
9
|
*/
|
|
10
10
|
export type MockAPIFetchCall = {
|
|
11
11
|
readonly request: Request;
|
|
@@ -13,7 +13,7 @@ export type MockAPIFetchCall = {
|
|
|
13
13
|
};
|
|
14
14
|
/**
|
|
15
15
|
* Record of a single request build, capturing the endpoint, payload, options, and built request.
|
|
16
|
-
* @see https://
|
|
16
|
+
* @see https://shelving.cc/api/MockAPIRequestCall
|
|
17
17
|
*/
|
|
18
18
|
export type MockAPIRequestCall = {
|
|
19
19
|
readonly endpoint: AnyEndpoint;
|
|
@@ -23,7 +23,7 @@ export type MockAPIRequestCall = {
|
|
|
23
23
|
};
|
|
24
24
|
/**
|
|
25
25
|
* Record of a single response parse, capturing the endpoint, response, and parsed result.
|
|
26
|
-
* @see https://
|
|
26
|
+
* @see https://shelving.cc/api/MockAPIResponseCall
|
|
27
27
|
*/
|
|
28
28
|
export type MockAPIResponseCall = {
|
|
29
29
|
readonly endpoint: AnyEndpoint;
|
|
@@ -40,27 +40,27 @@ export type MockAPIResponseCall = {
|
|
|
40
40
|
* const api = new MockAPIProvider();
|
|
41
41
|
* const result = await api.call(endpoint, payload);
|
|
42
42
|
* expect(api.fetchCalls).toHaveLength(1);
|
|
43
|
-
* @see https://
|
|
43
|
+
* @see https://shelving.cc/api/MockAPIProvider
|
|
44
44
|
*/
|
|
45
45
|
export declare class MockAPIProvider<P = unknown, R = unknown> extends ThroughAPIProvider<P, R> {
|
|
46
46
|
/**
|
|
47
47
|
* Records of every request built by this provider.
|
|
48
|
-
* @see https://
|
|
48
|
+
* @see https://shelving.cc/api/MockAPIProvider/requestCalls
|
|
49
49
|
*/
|
|
50
50
|
readonly requestCalls: MockAPIRequestCall[];
|
|
51
51
|
/**
|
|
52
52
|
* Records of every fetch handled by this provider.
|
|
53
|
-
* @see https://
|
|
53
|
+
* @see https://shelving.cc/api/MockAPIProvider/fetchCalls
|
|
54
54
|
*/
|
|
55
55
|
readonly fetchCalls: MockAPIFetchCall[];
|
|
56
56
|
/**
|
|
57
57
|
* Records of every response parsed by this provider.
|
|
58
|
-
* @see https://
|
|
58
|
+
* @see https://shelving.cc/api/MockAPIProvider/responseCalls
|
|
59
59
|
*/
|
|
60
60
|
readonly responseCalls: MockAPIResponseCall[];
|
|
61
61
|
/**
|
|
62
62
|
* The request handler that serves fetches in place of the network.
|
|
63
|
-
* @see https://
|
|
63
|
+
* @see https://shelving.cc/api/MockAPIProvider/handler
|
|
64
64
|
*/
|
|
65
65
|
readonly handler: RequestHandler;
|
|
66
66
|
/**
|
|
@@ -80,7 +80,7 @@ export declare class MockAPIProvider<P = unknown, R = unknown> extends ThroughAP
|
|
|
80
80
|
* @param caller The calling function used for error stack traces.
|
|
81
81
|
* @returns The built request.
|
|
82
82
|
* @example api.createRequest(endpoint, payload)
|
|
83
|
-
* @see https://
|
|
83
|
+
* @see https://shelving.cc/api/MockAPIProvider/createRequest
|
|
84
84
|
*/
|
|
85
85
|
createRequest<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, payload: PP, options?: RequestOptions, caller?: AnyCaller): Request;
|
|
86
86
|
/**
|
|
@@ -91,7 +91,7 @@ export declare class MockAPIProvider<P = unknown, R = unknown> extends ThroughAP
|
|
|
91
91
|
* @param caller The calling function used for error stack traces.
|
|
92
92
|
* @returns Promise resolving to the parsed result.
|
|
93
93
|
* @example await api.parseResponse(endpoint, response)
|
|
94
|
-
* @see https://
|
|
94
|
+
* @see https://shelving.cc/api/MockAPIProvider/parseResponse
|
|
95
95
|
*/
|
|
96
96
|
parseResponse<PP extends P, RR extends R>(endpoint: Endpoint<PP, RR>, response: Response, caller?: AnyCaller): Promise<RR>;
|
|
97
97
|
/**
|
|
@@ -100,7 +100,7 @@ export declare class MockAPIProvider<P = unknown, R = unknown> extends ThroughAP
|
|
|
100
100
|
* @param request The request to handle.
|
|
101
101
|
* @returns Promise resolving to the handler's response.
|
|
102
102
|
* @example await api.fetch(request)
|
|
103
|
-
* @see https://
|
|
103
|
+
* @see https://shelving.cc/api/MockAPIProvider/fetch
|
|
104
104
|
*/
|
|
105
105
|
fetch(request: Request): Promise<Response>;
|
|
106
106
|
}
|