@relyio/sdk 0.16.0 → 0.17.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/CHANGELOG.md +8 -0
- package/dist/{chunk-RLLZUFDB.cjs → chunk-6E22GYPB.cjs} +55 -53
- package/dist/{chunk-7BZW6XYJ.cjs → chunk-6PTRZP5U.cjs} +2 -2
- package/dist/{chunk-CQHEG7QA.js → chunk-OVMIHAYK.js} +2 -2
- package/dist/{chunk-NIUOPIIB.js → chunk-VS2DEUTN.js} +16 -14
- package/dist/client/index.cjs +4 -4
- package/dist/client/index.d.cts +3 -3
- package/dist/client/index.d.ts +3 -3
- package/dist/client/index.js +2 -2
- package/dist/{define-content-type-LkI0rS2W.d.cts → define-content-type-AuL9-oz6.d.cts} +142 -8
- package/dist/{define-content-type-CAWSlgn0.d.ts → define-content-type-BGoQxqLf.d.ts} +142 -8
- package/dist/{define-schema-Dxu3RoHV.d.ts → define-schema-DgCX9YB7.d.ts} +1 -1
- package/dist/{define-schema-wlsJOrnY.d.cts → define-schema-DkXwpp0I.d.cts} +1 -1
- package/dist/{index-BH8JksfG.d.ts → index-BBp8_tn9.d.ts} +22 -16
- package/dist/{index-CcHmRALk.d.cts → index-Bp4AiNT3.d.cts} +1 -1
- package/dist/{index-CGtYxUuh.d.ts → index-DaMZ4FQ_.d.ts} +1 -1
- package/dist/{index-D80MXUkf.d.cts → index-DxRmKPrR.d.cts} +22 -16
- package/dist/index.cjs +68 -68
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +3 -3
- package/dist/preview/index.cjs +6 -6
- package/dist/preview/index.js +1 -1
- package/dist/rich-text/index.d.cts +2 -2
- package/dist/rich-text/index.d.ts +2 -2
- package/dist/schema/index.d.cts +3 -3
- package/dist/schema/index.d.ts +3 -3
- package/dist/types/index.d.cts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/package.json +4 -4
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as SchemaDefinition, b as SchemaContentTypeNames, j as SchemaEntryOf, f as SchemaLocaleCodes, c as SchemaSingletonNames, A as AggregateBlock, K as QueryParameterValue, F as FullTextSearch, e as SchemaQueryNames, J as InferQueryParams, L as AnyQueryParameters, h as SchemaAssetTypeNames, g as SchemaSettingsGroupNames } from './define-schema-
|
|
1
|
+
import { d2 as paths, cW as RetryConfig, d3 as MergedRelyIOConfig, cV as ApiResponse, aM as EntryMetadata, ap as Reading, cs as BaseContent, al as CheckedIncludes, d4 as ReadWhere, cx as WhereClause, d5 as components, aq as ReadWith, cI as UpdateInput, at as UntypedReading, cC as RevisedContent, cA as CreateInput, cB as CreatedContent, cH as ContentVersionRow, cG as ContentVersion, cF as RestoredContent, cl as SDKError, c$ as BaseValidationError, c_ as ValidationViolation, b2 as AssetServedBlocks, d6 as CheckedInclude, cw as WhereFieldCondition, cq as AssetFileBlock, ct as BaseSingleton, cD as WrittenSingleton, cu as BaseSettingsGroup, cE as WrittenSettingsGroup, aN as InferContentType, an as ContentReading, aT as InferSingleton, cm as RelyIOConfig, b0 as InferAssetType, ak as AssetReading, as as SingletonReading, aY as InferSettingsGroup, ar as SettingsReading, cn as RelyIOConfigUpdate } from './define-content-type-BGoQxqLf.js';
|
|
2
|
+
import { a as SchemaDefinition, b as SchemaContentTypeNames, j as SchemaEntryOf, f as SchemaLocaleCodes, c as SchemaSingletonNames, A as AggregateBlock, K as QueryParameterValue, F as FullTextSearch, e as SchemaQueryNames, J as InferQueryParams, L as AnyQueryParameters, h as SchemaAssetTypeNames, g as SchemaSettingsGroupNames } from './define-schema-DgCX9YB7.js';
|
|
3
3
|
import { DevUnreadableReason } from './dev-handshake/index.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1049,7 +1049,10 @@ interface CreateEntryOptions extends EntryPlacement, RetryableWriteOptions {
|
|
|
1049
1049
|
*/
|
|
1050
1050
|
declare class ContentClient<T extends BaseContent = BaseContent, R extends Reading = UntypedReading<T>> extends EntryHandle<T, R, RevisedContent<T>, EntryPlacement> {
|
|
1051
1051
|
/**
|
|
1052
|
-
* Create a new content entry.
|
|
1052
|
+
* Create a new content entry, published. The answer's `_metadata.warnings` lists each reference
|
|
1053
|
+
* the content type declares `weak` that the create made live while the entry it points at is
|
|
1054
|
+
* unpublished (`REFERENCE_NOT_PUBLISHED`) — `[]` when there are none; the create is never refused
|
|
1055
|
+
* for them.
|
|
1053
1056
|
*
|
|
1054
1057
|
* `locale` defaults to the client's own, and `dataset` to the client's (`client.with({ dataset })`
|
|
1055
1058
|
* sets it for every call).
|
|
@@ -1059,7 +1062,7 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
|
|
|
1059
1062
|
* const post = await relyio.content('post').create({ title: 'Hello' }, { slug: 'hello' })
|
|
1060
1063
|
* ```
|
|
1061
1064
|
*/
|
|
1062
|
-
create(data: CreateInput<T>, options?: CreateEntryOptions): Promise<T
|
|
1065
|
+
create(data: CreateInput<T>, options?: CreateEntryOptions): Promise<CreatedContent<T>>;
|
|
1063
1066
|
/**
|
|
1064
1067
|
* Get version history for one locale of an entry.
|
|
1065
1068
|
*
|
|
@@ -1678,7 +1681,7 @@ type DocumentVersionRow = components['schemas']['DocumentVersionRow'];
|
|
|
1678
1681
|
* Every call is in the locale it names, and otherwise in the client's own as it is when the call is
|
|
1679
1682
|
* made; a write of a document you read writes the locale it was read in.
|
|
1680
1683
|
*/
|
|
1681
|
-
declare abstract class DocumentHandle<T> {
|
|
1684
|
+
declare abstract class DocumentHandle<T, W = T> {
|
|
1682
1685
|
protected readonly httpClient: HttpClient;
|
|
1683
1686
|
protected readonly name: string;
|
|
1684
1687
|
/** The client's locale, asked on every call rather than copied when this handle was taken. */
|
|
@@ -1695,12 +1698,12 @@ declare abstract class DocumentHandle<T> {
|
|
|
1695
1698
|
* read, the write is refused with `ResourceConflictError` naming both versions: re-read it with
|
|
1696
1699
|
* `fresh: true` and retry.
|
|
1697
1700
|
*/
|
|
1698
|
-
update(read: ReadEntry, data: DocumentFields<T>, options?: RetryableWriteOptions): Promise<
|
|
1701
|
+
update(read: ReadEntry, data: DocumentFields<T>, options?: RetryableWriteOptions): Promise<W>;
|
|
1699
1702
|
/**
|
|
1700
1703
|
* Write the document with no version check, on purpose, in `options.locale` or the client's own —
|
|
1701
1704
|
* creating it, when nobody has yet.
|
|
1702
1705
|
*/
|
|
1703
|
-
update(data: DocumentFields<T>, options?: DocumentWriteOptions): Promise<
|
|
1706
|
+
update(data: DocumentFields<T>, options?: DocumentWriteOptions): Promise<W>;
|
|
1704
1707
|
/**
|
|
1705
1708
|
* Version history for one locale of the document.
|
|
1706
1709
|
*
|
|
@@ -1720,8 +1723,8 @@ declare abstract class DocumentHandle<T> {
|
|
|
1720
1723
|
* `context.resourceType` naming which (REL-2409 Q12).
|
|
1721
1724
|
*/
|
|
1722
1725
|
version(options: VersionOptions): Promise<DocumentVersion<T>>;
|
|
1723
|
-
/** `PATCH` the document's route with this write. */
|
|
1724
|
-
protected abstract patch(write: DocumentWrite<T>, options?: RetryableWriteOptions): Promise<
|
|
1726
|
+
/** `PATCH` the document's route with this write, answering what the route answers a write. */
|
|
1727
|
+
protected abstract patch(write: DocumentWrite<T>, options?: RetryableWriteOptions): Promise<W>;
|
|
1725
1728
|
/** `GET` the document's version history route. */
|
|
1726
1729
|
protected abstract readVersions(query: {
|
|
1727
1730
|
limit: number;
|
|
@@ -1763,7 +1766,7 @@ declare abstract class DocumentHandle<T> {
|
|
|
1763
1766
|
* if (homepage) await client.singleton('homepage').update(homepage, { title: 'Welcome' })
|
|
1764
1767
|
* ```
|
|
1765
1768
|
*/
|
|
1766
|
-
declare class SingletonClient<T = BaseSingleton, R extends Reading = UntypedReading<T>> extends DocumentHandle<T
|
|
1769
|
+
declare class SingletonClient<T = BaseSingleton, R extends Reading = UntypedReading<T>> extends DocumentHandle<T, WrittenSingleton<T>> {
|
|
1767
1770
|
/**
|
|
1768
1771
|
* The singleton, or `null` when nobody has written it yet (REL-2419, REL-2409 Q18).
|
|
1769
1772
|
*
|
|
@@ -1781,8 +1784,11 @@ declare class SingletonClient<T = BaseSingleton, R extends Reading = UntypedRead
|
|
|
1781
1784
|
* ```
|
|
1782
1785
|
*/
|
|
1783
1786
|
get<const P extends readonly string[] = []>(options?: DocumentReadOptions<R, P>): Promise<ReadWith<R, P[number]> | null>;
|
|
1784
|
-
/**
|
|
1785
|
-
|
|
1787
|
+
/**
|
|
1788
|
+
* The API publishes on PATCH: there is no separate publish route. The answer's `_metadata` also
|
|
1789
|
+
* lists the links the write left pointing nowhere and its `warnings` (REL-3097).
|
|
1790
|
+
*/
|
|
1791
|
+
protected patch(write: DocumentWrite<T>, options?: RetryableWriteOptions): Promise<WrittenSingleton<T>>;
|
|
1786
1792
|
protected readVersions(query: {
|
|
1787
1793
|
limit: number;
|
|
1788
1794
|
locale?: string;
|
|
@@ -1818,7 +1824,7 @@ declare class SingletonClient<T = BaseSingleton, R extends Reading = UntypedRead
|
|
|
1818
1824
|
* await client.settings('email-config').update(emailConfig, { fromName: 'RelyIO' })
|
|
1819
1825
|
* ```
|
|
1820
1826
|
*/
|
|
1821
|
-
declare class SettingsClient<T = BaseSettingsGroup, R extends Reading = UntypedReading<T>> extends DocumentHandle<T
|
|
1827
|
+
declare class SettingsClient<T = BaseSettingsGroup, R extends Reading = UntypedReading<T>> extends DocumentHandle<T, WrittenSettingsGroup<T>> {
|
|
1822
1828
|
/**
|
|
1823
1829
|
* The settings group (REL-2419, REL-2409 Q18).
|
|
1824
1830
|
*
|
|
@@ -1843,16 +1849,16 @@ declare class SettingsClient<T = BaseSettingsGroup, R extends Reading = UntypedR
|
|
|
1843
1849
|
* in the locale it was read in (REL-2419) — refused with `ResourceConflictError` if it changed
|
|
1844
1850
|
* since the read.
|
|
1845
1851
|
*/
|
|
1846
|
-
reset(read: ReadEntry, options?: RetryableWriteOptions): Promise<T
|
|
1852
|
+
reset(read: ReadEntry, options?: RetryableWriteOptions): Promise<WrittenSettingsGroup<T>>;
|
|
1847
1853
|
/**
|
|
1848
1854
|
* Reset the group to its default values with no version check, in `options.locale` or the
|
|
1849
1855
|
* client's own. The route reads its locale from `?locale=` and takes no body, so that is where it
|
|
1850
1856
|
* is sent.
|
|
1851
1857
|
*/
|
|
1852
|
-
reset(options?: DocumentWriteOptions): Promise<T
|
|
1858
|
+
reset(options?: DocumentWriteOptions): Promise<WrittenSettingsGroup<T>>;
|
|
1853
1859
|
/** The group's default values, as the schema declares them. */
|
|
1854
1860
|
getDefaults(): Promise<T>;
|
|
1855
|
-
protected patch(write: DocumentWrite<T>, options?: RetryableWriteOptions): Promise<T
|
|
1861
|
+
protected patch(write: DocumentWrite<T>, options?: RetryableWriteOptions): Promise<WrittenSettingsGroup<T>>;
|
|
1856
1862
|
protected readVersions(query: {
|
|
1857
1863
|
limit: number;
|
|
1858
1864
|
locale?: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { k as RichTextHeading, b as RichTextValue, y as RichTextTable, h as RichTextCodeGroup, e as RichTextBlock, l as RichTextInline, t as RichTextNode, w as RichTextSpan, r as RichTextMark, A as AnyRichTextEntryLink, c as RichTextShapeValue } from './rich-text.d-BWc-5gX1.cjs';
|
|
2
|
-
import { cs as BaseContent } from './define-content-type-
|
|
2
|
+
import { cs as BaseContent } from './define-content-type-AuL9-oz6.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The DOM↔field binding contract, as the one pure helper that emits it.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { k as RichTextHeading, b as RichTextValue, y as RichTextTable, h as RichTextCodeGroup, e as RichTextBlock, l as RichTextInline, t as RichTextNode, w as RichTextSpan, r as RichTextMark, A as AnyRichTextEntryLink, c as RichTextShapeValue } from './rich-text.d-BWc-5gX1.js';
|
|
2
|
-
import { cs as BaseContent } from './define-content-type-
|
|
2
|
+
import { cs as BaseContent } from './define-content-type-BGoQxqLf.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* The DOM↔field binding contract, as the one pure helper that emits it.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as SchemaDefinition, b as SchemaContentTypeNames, j as SchemaEntryOf, f as SchemaLocaleCodes, c as SchemaSingletonNames, A as AggregateBlock, K as QueryParameterValue, F as FullTextSearch, e as SchemaQueryNames, J as InferQueryParams, L as AnyQueryParameters, h as SchemaAssetTypeNames, g as SchemaSettingsGroupNames } from './define-schema-
|
|
1
|
+
import { d2 as paths, cW as RetryConfig, d3 as MergedRelyIOConfig, cV as ApiResponse, aM as EntryMetadata, ap as Reading, cs as BaseContent, al as CheckedIncludes, d4 as ReadWhere, cx as WhereClause, d5 as components, aq as ReadWith, cI as UpdateInput, at as UntypedReading, cC as RevisedContent, cA as CreateInput, cB as CreatedContent, cH as ContentVersionRow, cG as ContentVersion, cF as RestoredContent, cl as SDKError, c$ as BaseValidationError, c_ as ValidationViolation, b2 as AssetServedBlocks, d6 as CheckedInclude, cw as WhereFieldCondition, cq as AssetFileBlock, ct as BaseSingleton, cD as WrittenSingleton, cu as BaseSettingsGroup, cE as WrittenSettingsGroup, aN as InferContentType, an as ContentReading, aT as InferSingleton, cm as RelyIOConfig, b0 as InferAssetType, ak as AssetReading, as as SingletonReading, aY as InferSettingsGroup, ar as SettingsReading, cn as RelyIOConfigUpdate } from './define-content-type-AuL9-oz6.cjs';
|
|
2
|
+
import { a as SchemaDefinition, b as SchemaContentTypeNames, j as SchemaEntryOf, f as SchemaLocaleCodes, c as SchemaSingletonNames, A as AggregateBlock, K as QueryParameterValue, F as FullTextSearch, e as SchemaQueryNames, J as InferQueryParams, L as AnyQueryParameters, h as SchemaAssetTypeNames, g as SchemaSettingsGroupNames } from './define-schema-DkXwpp0I.cjs';
|
|
3
3
|
import { DevUnreadableReason } from './dev-handshake/index.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -1049,7 +1049,10 @@ interface CreateEntryOptions extends EntryPlacement, RetryableWriteOptions {
|
|
|
1049
1049
|
*/
|
|
1050
1050
|
declare class ContentClient<T extends BaseContent = BaseContent, R extends Reading = UntypedReading<T>> extends EntryHandle<T, R, RevisedContent<T>, EntryPlacement> {
|
|
1051
1051
|
/**
|
|
1052
|
-
* Create a new content entry.
|
|
1052
|
+
* Create a new content entry, published. The answer's `_metadata.warnings` lists each reference
|
|
1053
|
+
* the content type declares `weak` that the create made live while the entry it points at is
|
|
1054
|
+
* unpublished (`REFERENCE_NOT_PUBLISHED`) — `[]` when there are none; the create is never refused
|
|
1055
|
+
* for them.
|
|
1053
1056
|
*
|
|
1054
1057
|
* `locale` defaults to the client's own, and `dataset` to the client's (`client.with({ dataset })`
|
|
1055
1058
|
* sets it for every call).
|
|
@@ -1059,7 +1062,7 @@ declare class ContentClient<T extends BaseContent = BaseContent, R extends Readi
|
|
|
1059
1062
|
* const post = await relyio.content('post').create({ title: 'Hello' }, { slug: 'hello' })
|
|
1060
1063
|
* ```
|
|
1061
1064
|
*/
|
|
1062
|
-
create(data: CreateInput<T>, options?: CreateEntryOptions): Promise<T
|
|
1065
|
+
create(data: CreateInput<T>, options?: CreateEntryOptions): Promise<CreatedContent<T>>;
|
|
1063
1066
|
/**
|
|
1064
1067
|
* Get version history for one locale of an entry.
|
|
1065
1068
|
*
|
|
@@ -1678,7 +1681,7 @@ type DocumentVersionRow = components['schemas']['DocumentVersionRow'];
|
|
|
1678
1681
|
* Every call is in the locale it names, and otherwise in the client's own as it is when the call is
|
|
1679
1682
|
* made; a write of a document you read writes the locale it was read in.
|
|
1680
1683
|
*/
|
|
1681
|
-
declare abstract class DocumentHandle<T> {
|
|
1684
|
+
declare abstract class DocumentHandle<T, W = T> {
|
|
1682
1685
|
protected readonly httpClient: HttpClient;
|
|
1683
1686
|
protected readonly name: string;
|
|
1684
1687
|
/** The client's locale, asked on every call rather than copied when this handle was taken. */
|
|
@@ -1695,12 +1698,12 @@ declare abstract class DocumentHandle<T> {
|
|
|
1695
1698
|
* read, the write is refused with `ResourceConflictError` naming both versions: re-read it with
|
|
1696
1699
|
* `fresh: true` and retry.
|
|
1697
1700
|
*/
|
|
1698
|
-
update(read: ReadEntry, data: DocumentFields<T>, options?: RetryableWriteOptions): Promise<
|
|
1701
|
+
update(read: ReadEntry, data: DocumentFields<T>, options?: RetryableWriteOptions): Promise<W>;
|
|
1699
1702
|
/**
|
|
1700
1703
|
* Write the document with no version check, on purpose, in `options.locale` or the client's own —
|
|
1701
1704
|
* creating it, when nobody has yet.
|
|
1702
1705
|
*/
|
|
1703
|
-
update(data: DocumentFields<T>, options?: DocumentWriteOptions): Promise<
|
|
1706
|
+
update(data: DocumentFields<T>, options?: DocumentWriteOptions): Promise<W>;
|
|
1704
1707
|
/**
|
|
1705
1708
|
* Version history for one locale of the document.
|
|
1706
1709
|
*
|
|
@@ -1720,8 +1723,8 @@ declare abstract class DocumentHandle<T> {
|
|
|
1720
1723
|
* `context.resourceType` naming which (REL-2409 Q12).
|
|
1721
1724
|
*/
|
|
1722
1725
|
version(options: VersionOptions): Promise<DocumentVersion<T>>;
|
|
1723
|
-
/** `PATCH` the document's route with this write. */
|
|
1724
|
-
protected abstract patch(write: DocumentWrite<T>, options?: RetryableWriteOptions): Promise<
|
|
1726
|
+
/** `PATCH` the document's route with this write, answering what the route answers a write. */
|
|
1727
|
+
protected abstract patch(write: DocumentWrite<T>, options?: RetryableWriteOptions): Promise<W>;
|
|
1725
1728
|
/** `GET` the document's version history route. */
|
|
1726
1729
|
protected abstract readVersions(query: {
|
|
1727
1730
|
limit: number;
|
|
@@ -1763,7 +1766,7 @@ declare abstract class DocumentHandle<T> {
|
|
|
1763
1766
|
* if (homepage) await client.singleton('homepage').update(homepage, { title: 'Welcome' })
|
|
1764
1767
|
* ```
|
|
1765
1768
|
*/
|
|
1766
|
-
declare class SingletonClient<T = BaseSingleton, R extends Reading = UntypedReading<T>> extends DocumentHandle<T
|
|
1769
|
+
declare class SingletonClient<T = BaseSingleton, R extends Reading = UntypedReading<T>> extends DocumentHandle<T, WrittenSingleton<T>> {
|
|
1767
1770
|
/**
|
|
1768
1771
|
* The singleton, or `null` when nobody has written it yet (REL-2419, REL-2409 Q18).
|
|
1769
1772
|
*
|
|
@@ -1781,8 +1784,11 @@ declare class SingletonClient<T = BaseSingleton, R extends Reading = UntypedRead
|
|
|
1781
1784
|
* ```
|
|
1782
1785
|
*/
|
|
1783
1786
|
get<const P extends readonly string[] = []>(options?: DocumentReadOptions<R, P>): Promise<ReadWith<R, P[number]> | null>;
|
|
1784
|
-
/**
|
|
1785
|
-
|
|
1787
|
+
/**
|
|
1788
|
+
* The API publishes on PATCH: there is no separate publish route. The answer's `_metadata` also
|
|
1789
|
+
* lists the links the write left pointing nowhere and its `warnings` (REL-3097).
|
|
1790
|
+
*/
|
|
1791
|
+
protected patch(write: DocumentWrite<T>, options?: RetryableWriteOptions): Promise<WrittenSingleton<T>>;
|
|
1786
1792
|
protected readVersions(query: {
|
|
1787
1793
|
limit: number;
|
|
1788
1794
|
locale?: string;
|
|
@@ -1818,7 +1824,7 @@ declare class SingletonClient<T = BaseSingleton, R extends Reading = UntypedRead
|
|
|
1818
1824
|
* await client.settings('email-config').update(emailConfig, { fromName: 'RelyIO' })
|
|
1819
1825
|
* ```
|
|
1820
1826
|
*/
|
|
1821
|
-
declare class SettingsClient<T = BaseSettingsGroup, R extends Reading = UntypedReading<T>> extends DocumentHandle<T
|
|
1827
|
+
declare class SettingsClient<T = BaseSettingsGroup, R extends Reading = UntypedReading<T>> extends DocumentHandle<T, WrittenSettingsGroup<T>> {
|
|
1822
1828
|
/**
|
|
1823
1829
|
* The settings group (REL-2419, REL-2409 Q18).
|
|
1824
1830
|
*
|
|
@@ -1843,16 +1849,16 @@ declare class SettingsClient<T = BaseSettingsGroup, R extends Reading = UntypedR
|
|
|
1843
1849
|
* in the locale it was read in (REL-2419) — refused with `ResourceConflictError` if it changed
|
|
1844
1850
|
* since the read.
|
|
1845
1851
|
*/
|
|
1846
|
-
reset(read: ReadEntry, options?: RetryableWriteOptions): Promise<T
|
|
1852
|
+
reset(read: ReadEntry, options?: RetryableWriteOptions): Promise<WrittenSettingsGroup<T>>;
|
|
1847
1853
|
/**
|
|
1848
1854
|
* Reset the group to its default values with no version check, in `options.locale` or the
|
|
1849
1855
|
* client's own. The route reads its locale from `?locale=` and takes no body, so that is where it
|
|
1850
1856
|
* is sent.
|
|
1851
1857
|
*/
|
|
1852
|
-
reset(options?: DocumentWriteOptions): Promise<T
|
|
1858
|
+
reset(options?: DocumentWriteOptions): Promise<WrittenSettingsGroup<T>>;
|
|
1853
1859
|
/** The group's default values, as the schema declares them. */
|
|
1854
1860
|
getDefaults(): Promise<T>;
|
|
1855
|
-
protected patch(write: DocumentWrite<T>, options?: RetryableWriteOptions): Promise<T
|
|
1861
|
+
protected patch(write: DocumentWrite<T>, options?: RetryableWriteOptions): Promise<WrittenSettingsGroup<T>>;
|
|
1856
1862
|
protected readVersions(query: {
|
|
1857
1863
|
limit: number;
|
|
1858
1864
|
locale?: string;
|
package/dist/index.cjs
CHANGED
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var chunkGHYB6IZK_cjs = require('./chunk-GHYB6IZK.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunk6E22GYPB_cjs = require('./chunk-6E22GYPB.cjs');
|
|
7
7
|
require('./chunk-LSRPMNPT.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunk6PTRZP5U_cjs = require('./chunk-6PTRZP5U.cjs');
|
|
9
9
|
require('./chunk-PPA2WWOH.cjs');
|
|
10
10
|
var chunkTZL374LS_cjs = require('./chunk-TZL374LS.cjs');
|
|
11
11
|
var chunkRSHMA4KT_cjs = require('./chunk-RSHMA4KT.cjs');
|
|
@@ -22,9 +22,9 @@ function stopOnUnknownAnswer(_answer) {
|
|
|
22
22
|
}
|
|
23
23
|
chunkMWMSFIWN_cjs.__name(stopOnUnknownAnswer, "stopOnUnknownAnswer");
|
|
24
24
|
function classifyFollowFailure(error) {
|
|
25
|
-
if (error instanceof
|
|
26
|
-
if (!(error instanceof
|
|
27
|
-
const afterMs =
|
|
25
|
+
if (error instanceof chunk6E22GYPB_cjs.LiveEdgeError) return liveEdgeVerdict(error);
|
|
26
|
+
if (!(error instanceof chunk6E22GYPB_cjs.SDKError) || !error.retryable) return { retry: false };
|
|
27
|
+
const afterMs = chunk6E22GYPB_cjs.serviceInstructedDelayMs(error, Date.now());
|
|
28
28
|
return afterMs === void 0 ? { retry: true } : { retry: true, afterMs };
|
|
29
29
|
}
|
|
30
30
|
chunkMWMSFIWN_cjs.__name(classifyFollowFailure, "classifyFollowFailure");
|
|
@@ -38,7 +38,7 @@ function liveEdgeVerdict(error) {
|
|
|
38
38
|
return { retry: true, ...hint };
|
|
39
39
|
}
|
|
40
40
|
case "back-off": {
|
|
41
|
-
return { retry: true, ...hint, backOffMs:
|
|
41
|
+
return { retry: true, ...hint, backOffMs: chunk6PTRZP5U_cjs.VISITOR_ADMISSION_RETRY_AFTER_SECONDS * 1e3 };
|
|
42
42
|
}
|
|
43
43
|
default: {
|
|
44
44
|
return stopOnUnknownAnswer(error.retry);
|
|
@@ -51,10 +51,10 @@ async function followChanges(source, options) {
|
|
|
51
51
|
const classify = options.classify ?? classifyFollowFailure;
|
|
52
52
|
const random = options.random ?? Math.random;
|
|
53
53
|
const report = /* @__PURE__ */ chunkMWMSFIWN_cjs.__name((state) => {
|
|
54
|
-
if (!
|
|
54
|
+
if (!chunk6E22GYPB_cjs.isAborted(signal)) options.onState?.(state);
|
|
55
55
|
}, "report");
|
|
56
56
|
const resync = /* @__PURE__ */ chunkMWMSFIWN_cjs.__name(async (cause) => {
|
|
57
|
-
if (
|
|
57
|
+
if (chunk6E22GYPB_cjs.isAborted(signal)) return;
|
|
58
58
|
await onResync(cause);
|
|
59
59
|
report({ kind: "resynced", resync: cause });
|
|
60
60
|
}, "resync");
|
|
@@ -63,12 +63,12 @@ async function followChanges(source, options) {
|
|
|
63
63
|
let unanchored = false;
|
|
64
64
|
let current;
|
|
65
65
|
for (; ; ) {
|
|
66
|
-
if (
|
|
66
|
+
if (chunk6E22GYPB_cjs.isAborted(signal)) return { kind: "aborted", since };
|
|
67
67
|
try {
|
|
68
68
|
if (unanchored) {
|
|
69
69
|
unanchored = false;
|
|
70
70
|
await resync({ cause: "no-cursor" });
|
|
71
|
-
if (
|
|
71
|
+
if (chunk6E22GYPB_cjs.isAborted(signal)) return { kind: "aborted", since };
|
|
72
72
|
}
|
|
73
73
|
report({ kind: "following" });
|
|
74
74
|
const open = {};
|
|
@@ -85,13 +85,13 @@ async function followChanges(source, options) {
|
|
|
85
85
|
}, "reached")
|
|
86
86
|
});
|
|
87
87
|
for await (const change of changes) {
|
|
88
|
-
if (
|
|
88
|
+
if (chunk6E22GYPB_cjs.isAborted(signal)) return { kind: "aborted", since };
|
|
89
89
|
failures = 0;
|
|
90
90
|
await onChange(change);
|
|
91
91
|
since = change.cursor;
|
|
92
|
-
if (
|
|
92
|
+
if (chunk6E22GYPB_cjs.isAborted(signal)) return { kind: "aborted", since };
|
|
93
93
|
}
|
|
94
|
-
if (
|
|
94
|
+
if (chunk6E22GYPB_cjs.isAborted(signal)) return { kind: "aborted", since };
|
|
95
95
|
const error = new Error(
|
|
96
96
|
"The change source completed without its signal aborting; a source ends only on abort and throws every other end."
|
|
97
97
|
);
|
|
@@ -99,7 +99,7 @@ async function followChanges(source, options) {
|
|
|
99
99
|
return { kind: "stopped", since, error };
|
|
100
100
|
} catch (error) {
|
|
101
101
|
current = void 0;
|
|
102
|
-
if (
|
|
102
|
+
if (chunk6E22GYPB_cjs.isAborted(signal)) return { kind: "aborted", since };
|
|
103
103
|
const verdict = classify(error);
|
|
104
104
|
if (!verdict.retry) {
|
|
105
105
|
report({ kind: "stopped", error });
|
|
@@ -108,7 +108,7 @@ async function followChanges(source, options) {
|
|
|
108
108
|
failures += 1;
|
|
109
109
|
const retryInMs = retryDelayMs(failures, verdict, random);
|
|
110
110
|
report({ kind: "reconnecting", error, retryInMs });
|
|
111
|
-
await
|
|
111
|
+
await chunk6E22GYPB_cjs.sleep(retryInMs, signal);
|
|
112
112
|
if (since === void 0) unanchored = true;
|
|
113
113
|
}
|
|
114
114
|
}
|
|
@@ -316,215 +316,215 @@ Object.defineProperty(exports, "fieldset", {
|
|
|
316
316
|
});
|
|
317
317
|
Object.defineProperty(exports, "AssetClient", {
|
|
318
318
|
enumerable: true,
|
|
319
|
-
get: function () { return
|
|
319
|
+
get: function () { return chunk6E22GYPB_cjs.AssetClient; }
|
|
320
320
|
});
|
|
321
321
|
Object.defineProperty(exports, "AssetFileBuilder", {
|
|
322
322
|
enumerable: true,
|
|
323
|
-
get: function () { return
|
|
323
|
+
get: function () { return chunk6E22GYPB_cjs.AssetFileBuilder; }
|
|
324
324
|
});
|
|
325
325
|
Object.defineProperty(exports, "AssetUploadBuilder", {
|
|
326
326
|
enumerable: true,
|
|
327
|
-
get: function () { return
|
|
327
|
+
get: function () { return chunk6E22GYPB_cjs.AssetUploadBuilder; }
|
|
328
328
|
});
|
|
329
329
|
Object.defineProperty(exports, "AuthorizationError", {
|
|
330
330
|
enumerable: true,
|
|
331
|
-
get: function () { return
|
|
331
|
+
get: function () { return chunk6E22GYPB_cjs.AuthorizationError; }
|
|
332
332
|
});
|
|
333
333
|
Object.defineProperty(exports, "BaseValidationError", {
|
|
334
334
|
enumerable: true,
|
|
335
|
-
get: function () { return
|
|
335
|
+
get: function () { return chunk6E22GYPB_cjs.BaseValidationError; }
|
|
336
336
|
});
|
|
337
337
|
Object.defineProperty(exports, "ChangesExpiredError", {
|
|
338
338
|
enumerable: true,
|
|
339
|
-
get: function () { return
|
|
339
|
+
get: function () { return chunk6E22GYPB_cjs.ChangesExpiredError; }
|
|
340
340
|
});
|
|
341
341
|
Object.defineProperty(exports, "ConnectionError", {
|
|
342
342
|
enumerable: true,
|
|
343
|
-
get: function () { return
|
|
343
|
+
get: function () { return chunk6E22GYPB_cjs.ConnectionError; }
|
|
344
344
|
});
|
|
345
345
|
Object.defineProperty(exports, "ContentClient", {
|
|
346
346
|
enumerable: true,
|
|
347
|
-
get: function () { return
|
|
347
|
+
get: function () { return chunk6E22GYPB_cjs.ContentClient; }
|
|
348
348
|
});
|
|
349
349
|
Object.defineProperty(exports, "DefaultRetryPolicy", {
|
|
350
350
|
enumerable: true,
|
|
351
|
-
get: function () { return
|
|
351
|
+
get: function () { return chunk6E22GYPB_cjs.DefaultRetryPolicy; }
|
|
352
352
|
});
|
|
353
353
|
Object.defineProperty(exports, "ErrorMapper", {
|
|
354
354
|
enumerable: true,
|
|
355
|
-
get: function () { return
|
|
355
|
+
get: function () { return chunk6E22GYPB_cjs.ErrorMapper; }
|
|
356
356
|
});
|
|
357
357
|
Object.defineProperty(exports, "FileUploadError", {
|
|
358
358
|
enumerable: true,
|
|
359
|
-
get: function () { return
|
|
359
|
+
get: function () { return chunk6E22GYPB_cjs.FileUploadError; }
|
|
360
360
|
});
|
|
361
361
|
Object.defineProperty(exports, "FileValidationError", {
|
|
362
362
|
enumerable: true,
|
|
363
|
-
get: function () { return
|
|
363
|
+
get: function () { return chunk6E22GYPB_cjs.FileValidationError; }
|
|
364
364
|
});
|
|
365
365
|
Object.defineProperty(exports, "HttpClient", {
|
|
366
366
|
enumerable: true,
|
|
367
|
-
get: function () { return
|
|
367
|
+
get: function () { return chunk6E22GYPB_cjs.HttpClient; }
|
|
368
368
|
});
|
|
369
369
|
Object.defineProperty(exports, "InvalidApiKeyError", {
|
|
370
370
|
enumerable: true,
|
|
371
|
-
get: function () { return
|
|
371
|
+
get: function () { return chunk6E22GYPB_cjs.InvalidApiKeyError; }
|
|
372
372
|
});
|
|
373
373
|
Object.defineProperty(exports, "InvalidPayloadError", {
|
|
374
374
|
enumerable: true,
|
|
375
|
-
get: function () { return
|
|
375
|
+
get: function () { return chunk6E22GYPB_cjs.InvalidPayloadError; }
|
|
376
376
|
});
|
|
377
377
|
Object.defineProperty(exports, "LIVE_KEEPALIVE_INTERVAL_MS", {
|
|
378
378
|
enumerable: true,
|
|
379
|
-
get: function () { return
|
|
379
|
+
get: function () { return chunk6E22GYPB_cjs.LIVE_KEEPALIVE_INTERVAL_MS; }
|
|
380
380
|
});
|
|
381
381
|
Object.defineProperty(exports, "LIVE_SOCKET_OPEN_TIMEOUT_MS", {
|
|
382
382
|
enumerable: true,
|
|
383
|
-
get: function () { return
|
|
383
|
+
get: function () { return chunk6E22GYPB_cjs.LIVE_SOCKET_OPEN_TIMEOUT_MS; }
|
|
384
384
|
});
|
|
385
385
|
Object.defineProperty(exports, "LiveEdgeError", {
|
|
386
386
|
enumerable: true,
|
|
387
|
-
get: function () { return
|
|
387
|
+
get: function () { return chunk6E22GYPB_cjs.LiveEdgeError; }
|
|
388
388
|
});
|
|
389
389
|
Object.defineProperty(exports, "MethodNotAllowedError", {
|
|
390
390
|
enumerable: true,
|
|
391
|
-
get: function () { return
|
|
391
|
+
get: function () { return chunk6E22GYPB_cjs.MethodNotAllowedError; }
|
|
392
392
|
});
|
|
393
393
|
Object.defineProperty(exports, "MissingApiKeyError", {
|
|
394
394
|
enumerable: true,
|
|
395
|
-
get: function () { return
|
|
395
|
+
get: function () { return chunk6E22GYPB_cjs.MissingApiKeyError; }
|
|
396
396
|
});
|
|
397
397
|
Object.defineProperty(exports, "NetworkError", {
|
|
398
398
|
enumerable: true,
|
|
399
|
-
get: function () { return
|
|
399
|
+
get: function () { return chunk6E22GYPB_cjs.NetworkError; }
|
|
400
400
|
});
|
|
401
401
|
Object.defineProperty(exports, "PREVIEW_KEY_PREFIX", {
|
|
402
402
|
enumerable: true,
|
|
403
|
-
get: function () { return
|
|
403
|
+
get: function () { return chunk6E22GYPB_cjs.PREVIEW_KEY_PREFIX; }
|
|
404
404
|
});
|
|
405
405
|
Object.defineProperty(exports, "PUBLISHABLE_KEY_PREFIX", {
|
|
406
406
|
enumerable: true,
|
|
407
|
-
get: function () { return
|
|
407
|
+
get: function () { return chunk6E22GYPB_cjs.PUBLISHABLE_KEY_PREFIX; }
|
|
408
408
|
});
|
|
409
409
|
Object.defineProperty(exports, "PayloadTooLargeError", {
|
|
410
410
|
enumerable: true,
|
|
411
|
-
get: function () { return
|
|
411
|
+
get: function () { return chunk6E22GYPB_cjs.PayloadTooLargeError; }
|
|
412
412
|
});
|
|
413
413
|
Object.defineProperty(exports, "PlanFeatureUnavailableError", {
|
|
414
414
|
enumerable: true,
|
|
415
|
-
get: function () { return
|
|
415
|
+
get: function () { return chunk6E22GYPB_cjs.PlanFeatureUnavailableError; }
|
|
416
416
|
});
|
|
417
417
|
Object.defineProperty(exports, "RateLimitError", {
|
|
418
418
|
enumerable: true,
|
|
419
|
-
get: function () { return
|
|
419
|
+
get: function () { return chunk6E22GYPB_cjs.RateLimitError; }
|
|
420
420
|
});
|
|
421
421
|
Object.defineProperty(exports, "ReadOnlyKeyError", {
|
|
422
422
|
enumerable: true,
|
|
423
|
-
get: function () { return
|
|
423
|
+
get: function () { return chunk6E22GYPB_cjs.ReadOnlyKeyError; }
|
|
424
424
|
});
|
|
425
425
|
Object.defineProperty(exports, "ResourceConflictError", {
|
|
426
426
|
enumerable: true,
|
|
427
|
-
get: function () { return
|
|
427
|
+
get: function () { return chunk6E22GYPB_cjs.ResourceConflictError; }
|
|
428
428
|
});
|
|
429
429
|
Object.defineProperty(exports, "ResourceExpiredError", {
|
|
430
430
|
enumerable: true,
|
|
431
|
-
get: function () { return
|
|
431
|
+
get: function () { return chunk6E22GYPB_cjs.ResourceExpiredError; }
|
|
432
432
|
});
|
|
433
433
|
Object.defineProperty(exports, "ResourceNotFoundError", {
|
|
434
434
|
enumerable: true,
|
|
435
|
-
get: function () { return
|
|
435
|
+
get: function () { return chunk6E22GYPB_cjs.ResourceNotFoundError; }
|
|
436
436
|
});
|
|
437
437
|
Object.defineProperty(exports, "SDKError", {
|
|
438
438
|
enumerable: true,
|
|
439
|
-
get: function () { return
|
|
439
|
+
get: function () { return chunk6E22GYPB_cjs.SDKError; }
|
|
440
440
|
});
|
|
441
441
|
Object.defineProperty(exports, "ServerError", {
|
|
442
442
|
enumerable: true,
|
|
443
|
-
get: function () { return
|
|
443
|
+
get: function () { return chunk6E22GYPB_cjs.ServerError; }
|
|
444
444
|
});
|
|
445
445
|
Object.defineProperty(exports, "ServiceIndeterminateError", {
|
|
446
446
|
enumerable: true,
|
|
447
|
-
get: function () { return
|
|
447
|
+
get: function () { return chunk6E22GYPB_cjs.ServiceIndeterminateError; }
|
|
448
448
|
});
|
|
449
449
|
Object.defineProperty(exports, "SettingsClient", {
|
|
450
450
|
enumerable: true,
|
|
451
|
-
get: function () { return
|
|
451
|
+
get: function () { return chunk6E22GYPB_cjs.SettingsClient; }
|
|
452
452
|
});
|
|
453
453
|
Object.defineProperty(exports, "SingletonClient", {
|
|
454
454
|
enumerable: true,
|
|
455
|
-
get: function () { return
|
|
455
|
+
get: function () { return chunk6E22GYPB_cjs.SingletonClient; }
|
|
456
456
|
});
|
|
457
457
|
Object.defineProperty(exports, "TimeoutError", {
|
|
458
458
|
enumerable: true,
|
|
459
|
-
get: function () { return
|
|
459
|
+
get: function () { return chunk6E22GYPB_cjs.TimeoutError; }
|
|
460
460
|
});
|
|
461
461
|
Object.defineProperty(exports, "TransactionRolledBackError", {
|
|
462
462
|
enumerable: true,
|
|
463
|
-
get: function () { return
|
|
463
|
+
get: function () { return chunk6E22GYPB_cjs.TransactionRolledBackError; }
|
|
464
464
|
});
|
|
465
465
|
Object.defineProperty(exports, "TypedRelyIOClient", {
|
|
466
466
|
enumerable: true,
|
|
467
|
-
get: function () { return
|
|
467
|
+
get: function () { return chunk6E22GYPB_cjs.TypedRelyIOClient; }
|
|
468
468
|
});
|
|
469
469
|
Object.defineProperty(exports, "UnknownContractError", {
|
|
470
470
|
enumerable: true,
|
|
471
|
-
get: function () { return
|
|
471
|
+
get: function () { return chunk6E22GYPB_cjs.UnknownContractError; }
|
|
472
472
|
});
|
|
473
473
|
Object.defineProperty(exports, "UsageQuotaExceededError", {
|
|
474
474
|
enumerable: true,
|
|
475
|
-
get: function () { return
|
|
475
|
+
get: function () { return chunk6E22GYPB_cjs.UsageQuotaExceededError; }
|
|
476
476
|
});
|
|
477
477
|
Object.defineProperty(exports, "ValidationError", {
|
|
478
478
|
enumerable: true,
|
|
479
|
-
get: function () { return
|
|
479
|
+
get: function () { return chunk6E22GYPB_cjs.ValidationError; }
|
|
480
480
|
});
|
|
481
481
|
Object.defineProperty(exports, "createClient", {
|
|
482
482
|
enumerable: true,
|
|
483
|
-
get: function () { return
|
|
483
|
+
get: function () { return chunk6E22GYPB_cjs.createClient; }
|
|
484
484
|
});
|
|
485
485
|
Object.defineProperty(exports, "default", {
|
|
486
486
|
enumerable: true,
|
|
487
|
-
get: function () { return
|
|
487
|
+
get: function () { return chunk6E22GYPB_cjs.createClient; }
|
|
488
488
|
});
|
|
489
489
|
Object.defineProperty(exports, "isAssetEntry", {
|
|
490
490
|
enumerable: true,
|
|
491
|
-
get: function () { return
|
|
491
|
+
get: function () { return chunk6E22GYPB_cjs.isAssetEntry; }
|
|
492
492
|
});
|
|
493
493
|
Object.defineProperty(exports, "isMissingEntry", {
|
|
494
494
|
enumerable: true,
|
|
495
|
-
get: function () { return
|
|
495
|
+
get: function () { return chunk6E22GYPB_cjs.isMissingEntry; }
|
|
496
496
|
});
|
|
497
497
|
Object.defineProperty(exports, "isPreviewKey", {
|
|
498
498
|
enumerable: true,
|
|
499
|
-
get: function () { return
|
|
499
|
+
get: function () { return chunk6E22GYPB_cjs.isPreviewKey; }
|
|
500
500
|
});
|
|
501
501
|
Object.defineProperty(exports, "isPublishableKey", {
|
|
502
502
|
enumerable: true,
|
|
503
|
-
get: function () { return
|
|
503
|
+
get: function () { return chunk6E22GYPB_cjs.isPublishableKey; }
|
|
504
504
|
});
|
|
505
505
|
Object.defineProperty(exports, "isReplaySafe", {
|
|
506
506
|
enumerable: true,
|
|
507
|
-
get: function () { return
|
|
507
|
+
get: function () { return chunk6E22GYPB_cjs.isReplaySafe; }
|
|
508
508
|
});
|
|
509
509
|
Object.defineProperty(exports, "isResourceNotFound", {
|
|
510
510
|
enumerable: true,
|
|
511
|
-
get: function () { return
|
|
511
|
+
get: function () { return chunk6E22GYPB_cjs.isResourceNotFound; }
|
|
512
512
|
});
|
|
513
513
|
Object.defineProperty(exports, "matchRoute", {
|
|
514
514
|
enumerable: true,
|
|
515
|
-
get: function () { return
|
|
515
|
+
get: function () { return chunk6E22GYPB_cjs.matchRoute; }
|
|
516
516
|
});
|
|
517
517
|
Object.defineProperty(exports, "retryPolicyFor", {
|
|
518
518
|
enumerable: true,
|
|
519
|
-
get: function () { return
|
|
519
|
+
get: function () { return chunk6E22GYPB_cjs.retryPolicyFor; }
|
|
520
520
|
});
|
|
521
521
|
Object.defineProperty(exports, "validateFile", {
|
|
522
522
|
enumerable: true,
|
|
523
|
-
get: function () { return
|
|
523
|
+
get: function () { return chunk6E22GYPB_cjs.validateFile; }
|
|
524
524
|
});
|
|
525
525
|
Object.defineProperty(exports, "versionCheckOf", {
|
|
526
526
|
enumerable: true,
|
|
527
|
-
get: function () { return
|
|
527
|
+
get: function () { return chunk6E22GYPB_cjs.versionCheckOf; }
|
|
528
528
|
});
|
|
529
529
|
Object.defineProperty(exports, "camelToSnake", {
|
|
530
530
|
enumerable: true,
|