@storyblok/api-client 1.0.0-alpha.1 → 1.0.0-alpha.3
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 +3 -1
- package/dist/client.cjs +7 -4
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.cts +302 -68
- package/dist/client.d.mts +302 -68
- package/dist/client.mjs +7 -4
- package/dist/client.mjs.map +1 -1
- package/dist/generated/capi/_internal.gen.d.cts +120 -0
- package/dist/generated/capi/_internal.gen.d.mts +120 -0
- package/dist/generated/{shared → capi}/client/client.gen.cjs +1 -1
- package/dist/generated/capi/client/client.gen.cjs.map +1 -0
- package/dist/generated/{shared → capi}/client/client.gen.mjs +1 -1
- package/dist/generated/capi/client/client.gen.mjs.map +1 -0
- package/dist/generated/{shared → capi}/client/types.gen.d.cts +1 -1
- package/dist/generated/{shared → capi}/client/types.gen.d.mts +1 -1
- package/dist/generated/{shared → capi}/client/utils.gen.cjs +1 -1
- package/dist/generated/capi/client/utils.gen.cjs.map +1 -0
- package/dist/generated/{shared → capi}/client/utils.gen.d.cts +1 -1
- package/dist/generated/{shared → capi}/client/utils.gen.d.mts +1 -1
- package/dist/generated/{shared → capi}/client/utils.gen.mjs +1 -1
- package/dist/generated/capi/client/utils.gen.mjs.map +1 -0
- package/dist/generated/capi/client.gen.cjs +10 -0
- package/dist/generated/capi/client.gen.cjs.map +1 -0
- package/dist/generated/capi/client.gen.mjs +10 -0
- package/dist/generated/capi/client.gen.mjs.map +1 -0
- package/dist/generated/{shared → capi}/core/auth.gen.cjs +1 -1
- package/dist/generated/capi/core/auth.gen.cjs.map +1 -0
- package/dist/generated/{shared → capi}/core/auth.gen.d.cts +1 -1
- package/dist/generated/{shared → capi}/core/auth.gen.d.mts +1 -1
- package/dist/generated/{shared → capi}/core/auth.gen.mjs +1 -1
- package/dist/generated/capi/core/auth.gen.mjs.map +1 -0
- package/dist/generated/{shared → capi}/core/bodySerializer.gen.cjs +1 -1
- package/dist/generated/capi/core/bodySerializer.gen.cjs.map +1 -0
- package/dist/generated/{shared → capi}/core/bodySerializer.gen.d.cts +1 -1
- package/dist/generated/{shared → capi}/core/bodySerializer.gen.d.mts +1 -1
- package/dist/generated/{shared → capi}/core/bodySerializer.gen.mjs +1 -1
- package/dist/generated/capi/core/bodySerializer.gen.mjs.map +1 -0
- package/dist/generated/{shared → capi}/core/params.gen.cjs +1 -1
- package/dist/generated/capi/core/params.gen.cjs.map +1 -0
- package/dist/generated/{shared → capi}/core/params.gen.mjs +1 -1
- package/dist/generated/capi/core/params.gen.mjs.map +1 -0
- package/dist/generated/{shared → capi}/core/pathSerializer.gen.cjs +1 -1
- package/dist/generated/capi/core/pathSerializer.gen.cjs.map +1 -0
- package/dist/generated/{shared → capi}/core/pathSerializer.gen.d.cts +1 -1
- package/dist/generated/{shared → capi}/core/pathSerializer.gen.d.mts +1 -1
- package/dist/generated/{shared → capi}/core/pathSerializer.gen.mjs +1 -1
- package/dist/generated/capi/core/pathSerializer.gen.mjs.map +1 -0
- package/dist/generated/{shared → capi}/core/serverSentEvents.gen.cjs +1 -1
- package/dist/generated/capi/core/serverSentEvents.gen.cjs.map +1 -0
- package/dist/generated/{shared → capi}/core/serverSentEvents.gen.d.cts +1 -1
- package/dist/generated/{shared → capi}/core/serverSentEvents.gen.d.mts +1 -1
- package/dist/generated/{shared → capi}/core/serverSentEvents.gen.mjs +1 -1
- package/dist/generated/capi/core/serverSentEvents.gen.mjs.map +1 -0
- package/dist/generated/{shared → capi}/core/types.gen.d.cts +1 -1
- package/dist/generated/{shared → capi}/core/types.gen.d.mts +1 -1
- package/dist/generated/{shared → capi}/core/utils.gen.cjs +1 -1
- package/dist/generated/capi/core/utils.gen.cjs.map +1 -0
- package/dist/generated/{shared → capi}/core/utils.gen.mjs +1 -1
- package/dist/generated/capi/core/utils.gen.mjs.map +1 -0
- package/dist/generated/capi/sdk.gen.cjs +141 -0
- package/dist/generated/capi/sdk.gen.cjs.map +1 -0
- package/dist/generated/capi/sdk.gen.mjs +133 -0
- package/dist/generated/capi/sdk.gen.mjs.map +1 -0
- package/dist/generated/capi/types-aliased.gen.d.cts +181 -0
- package/dist/generated/capi/types-aliased.gen.d.mts +181 -0
- package/dist/generated/capi/types.gen.d.cts +919 -0
- package/dist/generated/capi/types.gen.d.mts +919 -0
- package/dist/generated/mapi/_internal.gen.d.cts +146 -0
- package/dist/generated/mapi/_internal.gen.d.mts +146 -0
- package/dist/generated/mapi/types.gen.d.cts +293 -0
- package/dist/generated/mapi/types.gen.d.mts +293 -0
- package/dist/generated/overlay/_internal.gen.d.cts +831 -0
- package/dist/generated/overlay/_internal.gen.d.mts +831 -0
- package/dist/generated/types/_utils.d.cts +7 -0
- package/dist/generated/types/_utils.d.mts +7 -0
- package/dist/generated/types/block.d.cts +49 -0
- package/dist/generated/types/block.d.mts +49 -0
- package/dist/generated/types/field.d.cts +71 -0
- package/dist/generated/types/field.d.mts +71 -0
- package/dist/generated/types/story.d.cts +19 -0
- package/dist/generated/types/story.d.mts +19 -0
- package/dist/index.d.cts +6 -3
- package/dist/index.d.mts +6 -3
- package/dist/resources/datasource-entries.cjs +2 -2
- package/dist/resources/datasource-entries.cjs.map +1 -1
- package/dist/resources/datasource-entries.mjs +2 -2
- package/dist/resources/datasource-entries.mjs.map +1 -1
- package/dist/resources/datasources.cjs +4 -4
- package/dist/resources/datasources.cjs.map +1 -1
- package/dist/resources/datasources.mjs +4 -4
- package/dist/resources/datasources.mjs.map +1 -1
- package/dist/resources/experiments.cjs +26 -0
- package/dist/resources/experiments.cjs.map +1 -0
- package/dist/resources/experiments.mjs +26 -0
- package/dist/resources/experiments.mjs.map +1 -0
- package/dist/resources/links.cjs +2 -2
- package/dist/resources/links.cjs.map +1 -1
- package/dist/resources/links.mjs +2 -2
- package/dist/resources/links.mjs.map +1 -1
- package/dist/resources/spaces.cjs +4 -4
- package/dist/resources/spaces.cjs.map +1 -1
- package/dist/resources/spaces.mjs +4 -4
- package/dist/resources/spaces.mjs.map +1 -1
- package/dist/resources/stories.cjs +10 -8
- package/dist/resources/stories.cjs.map +1 -1
- package/dist/resources/stories.d.cts +16 -13
- package/dist/resources/stories.d.mts +16 -13
- package/dist/resources/stories.mjs +10 -8
- package/dist/resources/stories.mjs.map +1 -1
- package/dist/resources/tags.cjs +2 -2
- package/dist/resources/tags.cjs.map +1 -1
- package/dist/resources/tags.mjs +2 -2
- package/dist/resources/tags.mjs.map +1 -1
- package/dist/utils/fetch-rel-uuids.cjs +2 -2
- package/dist/utils/fetch-rel-uuids.cjs.map +1 -1
- package/dist/utils/fetch-rel-uuids.mjs +2 -2
- package/dist/utils/fetch-rel-uuids.mjs.map +1 -1
- package/dist/utils/inline-relations.cjs.map +1 -1
- package/dist/utils/inline-relations.mjs.map +1 -1
- package/package.json +13 -19
- package/dist/generated/datasource_entries/client.gen.cjs +0 -10
- package/dist/generated/datasource_entries/client.gen.cjs.map +0 -1
- package/dist/generated/datasource_entries/client.gen.mjs +0 -10
- package/dist/generated/datasource_entries/client.gen.mjs.map +0 -1
- package/dist/generated/datasource_entries/sdk.gen.cjs +0 -21
- package/dist/generated/datasource_entries/sdk.gen.cjs.map +0 -1
- package/dist/generated/datasource_entries/sdk.gen.mjs +0 -21
- package/dist/generated/datasource_entries/sdk.gen.mjs.map +0 -1
- package/dist/generated/datasource_entries/types.gen.d.cts +0 -52
- package/dist/generated/datasource_entries/types.gen.d.mts +0 -52
- package/dist/generated/datasources/client.gen.cjs +0 -10
- package/dist/generated/datasources/client.gen.cjs.map +0 -1
- package/dist/generated/datasources/client.gen.mjs +0 -10
- package/dist/generated/datasources/client.gen.mjs.map +0 -1
- package/dist/generated/datasources/sdk.gen.cjs +0 -36
- package/dist/generated/datasources/sdk.gen.cjs.map +0 -1
- package/dist/generated/datasources/sdk.gen.mjs +0 -35
- package/dist/generated/datasources/sdk.gen.mjs.map +0 -1
- package/dist/generated/datasources/types.gen.d.cts +0 -82
- package/dist/generated/datasources/types.gen.d.mts +0 -82
- package/dist/generated/links/client.gen.cjs +0 -10
- package/dist/generated/links/client.gen.cjs.map +0 -1
- package/dist/generated/links/client.gen.mjs +0 -10
- package/dist/generated/links/client.gen.mjs.map +0 -1
- package/dist/generated/links/sdk.gen.cjs +0 -21
- package/dist/generated/links/sdk.gen.cjs.map +0 -1
- package/dist/generated/links/sdk.gen.mjs +0 -21
- package/dist/generated/links/sdk.gen.mjs.map +0 -1
- package/dist/generated/links/types.gen.d.cts +0 -125
- package/dist/generated/links/types.gen.d.mts +0 -125
- package/dist/generated/shared/client/client.gen.cjs.map +0 -1
- package/dist/generated/shared/client/client.gen.mjs.map +0 -1
- package/dist/generated/shared/client/utils.gen.cjs.map +0 -1
- package/dist/generated/shared/client/utils.gen.mjs.map +0 -1
- package/dist/generated/shared/core/auth.gen.cjs.map +0 -1
- package/dist/generated/shared/core/auth.gen.mjs.map +0 -1
- package/dist/generated/shared/core/bodySerializer.gen.cjs.map +0 -1
- package/dist/generated/shared/core/bodySerializer.gen.mjs.map +0 -1
- package/dist/generated/shared/core/params.gen.cjs.map +0 -1
- package/dist/generated/shared/core/params.gen.mjs.map +0 -1
- package/dist/generated/shared/core/pathSerializer.gen.cjs.map +0 -1
- package/dist/generated/shared/core/pathSerializer.gen.mjs.map +0 -1
- package/dist/generated/shared/core/serverSentEvents.gen.cjs.map +0 -1
- package/dist/generated/shared/core/serverSentEvents.gen.mjs.map +0 -1
- package/dist/generated/shared/core/utils.gen.cjs.map +0 -1
- package/dist/generated/shared/core/utils.gen.mjs.map +0 -1
- package/dist/generated/spaces/client.gen.cjs +0 -10
- package/dist/generated/spaces/client.gen.cjs.map +0 -1
- package/dist/generated/spaces/client.gen.mjs +0 -10
- package/dist/generated/spaces/client.gen.mjs.map +0 -1
- package/dist/generated/spaces/sdk.gen.cjs +0 -21
- package/dist/generated/spaces/sdk.gen.cjs.map +0 -1
- package/dist/generated/spaces/sdk.gen.mjs +0 -21
- package/dist/generated/spaces/sdk.gen.mjs.map +0 -1
- package/dist/generated/spaces/types.gen.d.cts +0 -26
- package/dist/generated/spaces/types.gen.d.mts +0 -26
- package/dist/generated/stories/client.gen.cjs +0 -10
- package/dist/generated/stories/client.gen.cjs.map +0 -1
- package/dist/generated/stories/client.gen.mjs +0 -10
- package/dist/generated/stories/client.gen.mjs.map +0 -1
- package/dist/generated/stories/index.d.mts +0 -1
- package/dist/generated/stories/sdk.gen.cjs +0 -36
- package/dist/generated/stories/sdk.gen.cjs.map +0 -1
- package/dist/generated/stories/sdk.gen.d.mts +0 -1
- package/dist/generated/stories/sdk.gen.mjs +0 -35
- package/dist/generated/stories/sdk.gen.mjs.map +0 -1
- package/dist/generated/stories/types.gen.d.cts +0 -607
- package/dist/generated/stories/types.gen.d.mts +0 -607
- package/dist/generated/tags/client.gen.cjs +0 -10
- package/dist/generated/tags/client.gen.cjs.map +0 -1
- package/dist/generated/tags/client.gen.mjs +0 -10
- package/dist/generated/tags/client.gen.mjs.map +0 -1
- package/dist/generated/tags/sdk.gen.cjs +0 -21
- package/dist/generated/tags/sdk.gen.cjs.map +0 -1
- package/dist/generated/tags/sdk.gen.mjs +0 -21
- package/dist/generated/tags/sdk.gen.mjs.map +0 -1
- package/dist/generated/tags/types.gen.d.cts +0 -29
- package/dist/generated/tags/types.gen.d.mts +0 -29
- /package/dist/generated/{shared → capi}/client/client.gen.d.mts +0 -0
- /package/dist/generated/{shared → capi}/client/index.cjs +0 -0
- /package/dist/generated/{shared → capi}/client/index.d.mts +0 -0
- /package/dist/generated/{shared → capi}/client/index.mjs +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/generated/types/_utils.d.ts
|
|
2
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
3
|
+
/** Replaces the keys of `T` that also appear in `U` with the definitions from `U`. */
|
|
4
|
+
type Override<T, U> = Prettify<Omit<T, keyof U> & U>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { Override, Prettify };
|
|
7
|
+
//# sourceMappingURL=_utils.d.cts.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
//#region src/generated/types/_utils.d.ts
|
|
2
|
+
type Prettify<T> = { [K in keyof T]: T[K] } & {};
|
|
3
|
+
/** Replaces the keys of `T` that also appear in `U` with the definitions from `U`. */
|
|
4
|
+
type Override<T, U> = Prettify<Omit<T, keyof U> & U>;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { Override, Prettify };
|
|
7
|
+
//# sourceMappingURL=_utils.d.mts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Field } from "../overlay/_internal.gen.cjs";
|
|
2
|
+
import { Component } from "../mapi/_internal.gen.cjs";
|
|
3
|
+
import { Override } from "./_utils.cjs";
|
|
4
|
+
|
|
5
|
+
//#region src/generated/types/block.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Ordered array of named fields — the content-shape DSL form `defineBlock`
|
|
8
|
+
* accepts and returns. A field's position in the array sets the order it appears
|
|
9
|
+
* in the editor (mapped to the wire `pos` on push).
|
|
10
|
+
*/
|
|
11
|
+
type BlockFields = ReadonlyArray<Field & {
|
|
12
|
+
name: string;
|
|
13
|
+
pos?: number;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* A Storyblok block: a named, ordered set of content fields. Uses the
|
|
18
|
+
* content-shape DSL `fields` array rather than the MAPI wire `schema` record.
|
|
19
|
+
*/
|
|
20
|
+
type Block<TName extends string = string, TFields extends BlockFields = BlockFields, TIsRoot extends boolean = boolean, TIsNestable extends boolean = boolean> = Override<Omit<Component, 'schema' | 'component_group_uuid'>, {
|
|
21
|
+
name: TName;
|
|
22
|
+
fields: TFields;
|
|
23
|
+
is_root?: TIsRoot;
|
|
24
|
+
is_nestable?: TIsNestable;
|
|
25
|
+
/**
|
|
26
|
+
* Escape hatch for pinning this block to a Storyblok UI-managed component
|
|
27
|
+
* group by UUID. Component groups are normally maintained in code via the
|
|
28
|
+
* schema directory layout; set this only if you intentionally manage groups
|
|
29
|
+
* in the Storyblok UI, and fill in the group UUID yourself. When set,
|
|
30
|
+
* `schema push` diffs it and sends it to the Management API; when omitted,
|
|
31
|
+
* the block's remote group is left untouched.
|
|
32
|
+
*
|
|
33
|
+
* @deprecated Prefer maintaining component groups in code through the
|
|
34
|
+
* directory layout.
|
|
35
|
+
*/
|
|
36
|
+
component_group_uuid?: string | null;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* A root {@link Block} (`is_root: true`). Given a union of blocks, narrows to
|
|
40
|
+
* its root members; with no argument it is the generic root-block type.
|
|
41
|
+
*/
|
|
42
|
+
type RootBlock<T extends Block = Block & {
|
|
43
|
+
is_root: true;
|
|
44
|
+
}> = Extract<T, {
|
|
45
|
+
is_root: true;
|
|
46
|
+
}>;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { Block, BlockFields, RootBlock };
|
|
49
|
+
//# sourceMappingURL=block.d.cts.map
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Field } from "../overlay/_internal.gen.mjs";
|
|
2
|
+
import { Component } from "../mapi/_internal.gen.mjs";
|
|
3
|
+
import { Override } from "./_utils.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/generated/types/block.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Ordered array of named fields — the content-shape DSL form `defineBlock`
|
|
8
|
+
* accepts and returns. A field's position in the array sets the order it appears
|
|
9
|
+
* in the editor (mapped to the wire `pos` on push).
|
|
10
|
+
*/
|
|
11
|
+
type BlockFields = ReadonlyArray<Field & {
|
|
12
|
+
name: string;
|
|
13
|
+
pos?: number;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
}>;
|
|
16
|
+
/**
|
|
17
|
+
* A Storyblok block: a named, ordered set of content fields. Uses the
|
|
18
|
+
* content-shape DSL `fields` array rather than the MAPI wire `schema` record.
|
|
19
|
+
*/
|
|
20
|
+
type Block<TName extends string = string, TFields extends BlockFields = BlockFields, TIsRoot extends boolean = boolean, TIsNestable extends boolean = boolean> = Override<Omit<Component, 'schema' | 'component_group_uuid'>, {
|
|
21
|
+
name: TName;
|
|
22
|
+
fields: TFields;
|
|
23
|
+
is_root?: TIsRoot;
|
|
24
|
+
is_nestable?: TIsNestable;
|
|
25
|
+
/**
|
|
26
|
+
* Escape hatch for pinning this block to a Storyblok UI-managed component
|
|
27
|
+
* group by UUID. Component groups are normally maintained in code via the
|
|
28
|
+
* schema directory layout; set this only if you intentionally manage groups
|
|
29
|
+
* in the Storyblok UI, and fill in the group UUID yourself. When set,
|
|
30
|
+
* `schema push` diffs it and sends it to the Management API; when omitted,
|
|
31
|
+
* the block's remote group is left untouched.
|
|
32
|
+
*
|
|
33
|
+
* @deprecated Prefer maintaining component groups in code through the
|
|
34
|
+
* directory layout.
|
|
35
|
+
*/
|
|
36
|
+
component_group_uuid?: string | null;
|
|
37
|
+
}>;
|
|
38
|
+
/**
|
|
39
|
+
* A root {@link Block} (`is_root: true`). Given a union of blocks, narrows to
|
|
40
|
+
* its root members; with no argument it is the generic root-block type.
|
|
41
|
+
*/
|
|
42
|
+
type RootBlock<T extends Block = Block & {
|
|
43
|
+
is_root: true;
|
|
44
|
+
}> = Extract<T, {
|
|
45
|
+
is_root: true;
|
|
46
|
+
}>;
|
|
47
|
+
//#endregion
|
|
48
|
+
export { Block, BlockFields, RootBlock };
|
|
49
|
+
//# sourceMappingURL=block.d.mts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { AssetFieldValue, BlockContentBase, Field, MultilinkFieldValue, PluginFieldValue, RichtextFieldValue, TableFieldValue } from "../overlay/_internal.gen.cjs";
|
|
2
|
+
import { Prettify } from "./_utils.cjs";
|
|
3
|
+
import { Block, BlockFields } from "./block.cjs";
|
|
4
|
+
|
|
5
|
+
//#region src/generated/types/field.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Registry of all blocks in the space, used to resolve nested `bloks` fields.
|
|
8
|
+
* A `Block` union resolves nested content against the registry; `NoBlocks`
|
|
9
|
+
* (the default) leaves it loose (`BlockContentBase`).
|
|
10
|
+
*/
|
|
11
|
+
type NoBlocks = false;
|
|
12
|
+
/** True when `T` is the un-narrowed base `Block` (i.e. no specific block was supplied). */
|
|
13
|
+
type IsBaseBlock<T> = [Block] extends [T] ? true : false;
|
|
14
|
+
/**
|
|
15
|
+
* Maps a block's ordered `fields` array to its read content object, splitting
|
|
16
|
+
* required (`required: true`) from optional fields. Each `F` is a member of the
|
|
17
|
+
* field union, so it provably satisfies `FieldValue`'s `Field` constraint.
|
|
18
|
+
*/
|
|
19
|
+
type ContentFields<TFields extends BlockFields, TBlocks> = Prettify<{ [F in TFields[number] as F extends {
|
|
20
|
+
required: true;
|
|
21
|
+
} ? F['name'] : never]: FieldValue<F, TBlocks> } & { [F in TFields[number] as F extends {
|
|
22
|
+
required: true;
|
|
23
|
+
} ? never : F['name']]?: FieldValue<F, TBlocks> | null }>;
|
|
24
|
+
/** Input (write) variant of {@link ContentFields}, resolving each field via {@link FieldValueInput}. */
|
|
25
|
+
/**
|
|
26
|
+
* Content object for a single block instance as returned by the Storyblok
|
|
27
|
+
* Content Delivery API. Without a `TBlock` argument, this is the loose
|
|
28
|
+
* runtime shape (any block, `_editable` optional). With a schema-typed
|
|
29
|
+
* `TBlock`, fields are narrowed per the block's `fields`.
|
|
30
|
+
*/
|
|
31
|
+
type BlockContent<TBlock extends Block = Block, TBlocks = NoBlocks> = IsBaseBlock<TBlock> extends true ? BlockContentBase : TBlock extends any ? Prettify<{
|
|
32
|
+
_uid: string;
|
|
33
|
+
component: TBlock['name'];
|
|
34
|
+
_editable?: string;
|
|
35
|
+
} & ContentFields<TBlock['fields'], TBlocks>> : never;
|
|
36
|
+
interface FieldTypeValueMap {
|
|
37
|
+
text: string;
|
|
38
|
+
textarea: string;
|
|
39
|
+
richtext: RichtextFieldValue;
|
|
40
|
+
markdown: string;
|
|
41
|
+
number: number;
|
|
42
|
+
datetime: string;
|
|
43
|
+
boolean: boolean;
|
|
44
|
+
option: string;
|
|
45
|
+
options: string[];
|
|
46
|
+
asset: AssetFieldValue;
|
|
47
|
+
multiasset: AssetFieldValue[];
|
|
48
|
+
multilink: MultilinkFieldValue;
|
|
49
|
+
bloks: BlockContentBase[];
|
|
50
|
+
table: TableFieldValue;
|
|
51
|
+
section: never;
|
|
52
|
+
tab: never;
|
|
53
|
+
custom: PluginFieldValue;
|
|
54
|
+
}
|
|
55
|
+
type IsNestable<T> = T extends {
|
|
56
|
+
is_nestable: false;
|
|
57
|
+
} ? false : T extends {
|
|
58
|
+
is_nestable: true;
|
|
59
|
+
} ? true : true;
|
|
60
|
+
type ApplyAllow<TField, TBlocks> = TField extends {
|
|
61
|
+
allow: ReadonlyArray<infer TAllowed extends string>;
|
|
62
|
+
} ? Extract<TBlocks, {
|
|
63
|
+
name: TAllowed;
|
|
64
|
+
}> : TBlocks extends any ? IsNestable<TBlocks> extends true ? TBlocks : never : never;
|
|
65
|
+
/** Resolves a field definition to its runtime content value type (read). */
|
|
66
|
+
type FieldValue<TField extends Field = Field, TBlocks = NoBlocks> = Prettify<TField extends {
|
|
67
|
+
type: 'bloks';
|
|
68
|
+
} ? [TBlocks] extends [never] ? BlockContentBase[] : [TBlocks] extends [Block] ? BlockContent<ApplyAllow<TField, TBlocks>, TBlocks>[] : BlockContentBase[] : FieldTypeValueMap[TField['type']]>;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { BlockContent };
|
|
71
|
+
//# sourceMappingURL=field.d.cts.map
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { AssetFieldValue, BlockContentBase, Field, MultilinkFieldValue, PluginFieldValue, RichtextFieldValue, TableFieldValue } from "../overlay/_internal.gen.mjs";
|
|
2
|
+
import { Prettify } from "./_utils.mjs";
|
|
3
|
+
import { Block, BlockFields } from "./block.mjs";
|
|
4
|
+
|
|
5
|
+
//#region src/generated/types/field.d.ts
|
|
6
|
+
/**
|
|
7
|
+
* Registry of all blocks in the space, used to resolve nested `bloks` fields.
|
|
8
|
+
* A `Block` union resolves nested content against the registry; `NoBlocks`
|
|
9
|
+
* (the default) leaves it loose (`BlockContentBase`).
|
|
10
|
+
*/
|
|
11
|
+
type NoBlocks = false;
|
|
12
|
+
/** True when `T` is the un-narrowed base `Block` (i.e. no specific block was supplied). */
|
|
13
|
+
type IsBaseBlock<T> = [Block] extends [T] ? true : false;
|
|
14
|
+
/**
|
|
15
|
+
* Maps a block's ordered `fields` array to its read content object, splitting
|
|
16
|
+
* required (`required: true`) from optional fields. Each `F` is a member of the
|
|
17
|
+
* field union, so it provably satisfies `FieldValue`'s `Field` constraint.
|
|
18
|
+
*/
|
|
19
|
+
type ContentFields<TFields extends BlockFields, TBlocks> = Prettify<{ [F in TFields[number] as F extends {
|
|
20
|
+
required: true;
|
|
21
|
+
} ? F['name'] : never]: FieldValue<F, TBlocks> } & { [F in TFields[number] as F extends {
|
|
22
|
+
required: true;
|
|
23
|
+
} ? never : F['name']]?: FieldValue<F, TBlocks> | null }>;
|
|
24
|
+
/** Input (write) variant of {@link ContentFields}, resolving each field via {@link FieldValueInput}. */
|
|
25
|
+
/**
|
|
26
|
+
* Content object for a single block instance as returned by the Storyblok
|
|
27
|
+
* Content Delivery API. Without a `TBlock` argument, this is the loose
|
|
28
|
+
* runtime shape (any block, `_editable` optional). With a schema-typed
|
|
29
|
+
* `TBlock`, fields are narrowed per the block's `fields`.
|
|
30
|
+
*/
|
|
31
|
+
type BlockContent<TBlock extends Block = Block, TBlocks = NoBlocks> = IsBaseBlock<TBlock> extends true ? BlockContentBase : TBlock extends any ? Prettify<{
|
|
32
|
+
_uid: string;
|
|
33
|
+
component: TBlock['name'];
|
|
34
|
+
_editable?: string;
|
|
35
|
+
} & ContentFields<TBlock['fields'], TBlocks>> : never;
|
|
36
|
+
interface FieldTypeValueMap {
|
|
37
|
+
text: string;
|
|
38
|
+
textarea: string;
|
|
39
|
+
richtext: RichtextFieldValue;
|
|
40
|
+
markdown: string;
|
|
41
|
+
number: number;
|
|
42
|
+
datetime: string;
|
|
43
|
+
boolean: boolean;
|
|
44
|
+
option: string;
|
|
45
|
+
options: string[];
|
|
46
|
+
asset: AssetFieldValue;
|
|
47
|
+
multiasset: AssetFieldValue[];
|
|
48
|
+
multilink: MultilinkFieldValue;
|
|
49
|
+
bloks: BlockContentBase[];
|
|
50
|
+
table: TableFieldValue;
|
|
51
|
+
section: never;
|
|
52
|
+
tab: never;
|
|
53
|
+
custom: PluginFieldValue;
|
|
54
|
+
}
|
|
55
|
+
type IsNestable<T> = T extends {
|
|
56
|
+
is_nestable: false;
|
|
57
|
+
} ? false : T extends {
|
|
58
|
+
is_nestable: true;
|
|
59
|
+
} ? true : true;
|
|
60
|
+
type ApplyAllow<TField, TBlocks> = TField extends {
|
|
61
|
+
allow: ReadonlyArray<infer TAllowed extends string>;
|
|
62
|
+
} ? Extract<TBlocks, {
|
|
63
|
+
name: TAllowed;
|
|
64
|
+
}> : TBlocks extends any ? IsNestable<TBlocks> extends true ? TBlocks : never : never;
|
|
65
|
+
/** Resolves a field definition to its runtime content value type (read). */
|
|
66
|
+
type FieldValue<TField extends Field = Field, TBlocks = NoBlocks> = Prettify<TField extends {
|
|
67
|
+
type: 'bloks';
|
|
68
|
+
} ? [TBlocks] extends [never] ? BlockContentBase[] : [TBlocks] extends [Block] ? BlockContent<ApplyAllow<TField, TBlocks>, TBlocks>[] : BlockContentBase[] : FieldTypeValueMap[TField['type']]>;
|
|
69
|
+
//#endregion
|
|
70
|
+
export { BlockContent };
|
|
71
|
+
//# sourceMappingURL=field.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CapiStory } from "../capi/_internal.gen.cjs";
|
|
2
|
+
import { Override, Prettify } from "./_utils.cjs";
|
|
3
|
+
import { Block, RootBlock } from "./block.cjs";
|
|
4
|
+
import { BlockContent } from "./field.cjs";
|
|
5
|
+
|
|
6
|
+
//#region src/generated/types/story.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Registry of all blocks, threaded through to resolve nested `bloks` fields.
|
|
9
|
+
* `NoBlocks` (the default) leaves nested content loose (`BlockContentBase`).
|
|
10
|
+
*/
|
|
11
|
+
type NoBlocks = false;
|
|
12
|
+
type CapiStoryWithSchemaContent<TBlock extends RootBlock = RootBlock, TBlocks = NoBlocks> = Override<CapiStory, {
|
|
13
|
+
content: BlockContent<TBlock, TBlocks>;
|
|
14
|
+
}>;
|
|
15
|
+
/** A Storyblok CDN (CAPI) story. */
|
|
16
|
+
type Story<TBlockOrBlocks extends RootBlock | Block = RootBlock, TBlocks = NoBlocks> = Prettify<[TBlockOrBlocks] extends [RootBlock] ? CapiStoryWithSchemaContent<TBlockOrBlocks, TBlocks> : TBlocks extends NoBlocks ? CapiStoryWithSchemaContent<Extract<TBlockOrBlocks, RootBlock>, TBlockOrBlocks> : never>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Story };
|
|
19
|
+
//# sourceMappingURL=story.d.cts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { CapiStory } from "../capi/_internal.gen.mjs";
|
|
2
|
+
import { Override, Prettify } from "./_utils.mjs";
|
|
3
|
+
import { Block, RootBlock } from "./block.mjs";
|
|
4
|
+
import { BlockContent } from "./field.mjs";
|
|
5
|
+
|
|
6
|
+
//#region src/generated/types/story.d.ts
|
|
7
|
+
/**
|
|
8
|
+
* Registry of all blocks, threaded through to resolve nested `bloks` fields.
|
|
9
|
+
* `NoBlocks` (the default) leaves nested content loose (`BlockContentBase`).
|
|
10
|
+
*/
|
|
11
|
+
type NoBlocks = false;
|
|
12
|
+
type CapiStoryWithSchemaContent<TBlock extends RootBlock = RootBlock, TBlocks = NoBlocks> = Override<CapiStory, {
|
|
13
|
+
content: BlockContent<TBlock, TBlocks>;
|
|
14
|
+
}>;
|
|
15
|
+
/** A Storyblok CDN (CAPI) story. */
|
|
16
|
+
type Story<TBlockOrBlocks extends RootBlock | Block = RootBlock, TBlocks = NoBlocks> = Prettify<[TBlockOrBlocks] extends [RootBlock] ? CapiStoryWithSchemaContent<TBlockOrBlocks, TBlocks> : TBlocks extends NoBlocks ? CapiStoryWithSchemaContent<Extract<TBlockOrBlocks, RootBlock>, TBlockOrBlocks> : never>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { Story };
|
|
19
|
+
//# sourceMappingURL=story.d.mts.map
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { Middleware } from "./generated/
|
|
1
|
+
import { Middleware } from "./generated/capi/client/utils.gen.cjs";
|
|
2
2
|
import { CacheProvider, CacheStrategy, CacheStrategyHandler } from "./utils/cache.cjs";
|
|
3
3
|
import { ApiErrorBody, ClientError } from "./error.cjs";
|
|
4
|
+
import { Block } from "./generated/types/block.cjs";
|
|
5
|
+
import { Story } from "./generated/types/story.cjs";
|
|
4
6
|
import { StoryWithInlinedRelations } from "./resources/stories.cjs";
|
|
5
7
|
import { ApiResponse, CacheConfig, ContentApiClient, ContentApiClientConfig, FetchOptions, HttpRequestMethod, HttpRequestOptions, RequestWithCacheOptions, ResourceDeps, createApiClient } from "./client.cjs";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
+
import { Datasource, DatasourceEntry, Link, StoryAlternate, Tag } from "./generated/capi/types-aliased.gen.cjs";
|
|
9
|
+
import { Space, StoryLocalizedPath, StoryTranslatedSlug } from "./generated/mapi/types.gen.cjs";
|
|
10
|
+
export { type ApiErrorBody, type ApiResponse, type CacheConfig, type CacheProvider, type CacheStrategy, type CacheStrategyHandler, ClientError, type Block as Component, type ContentApiClient, type ContentApiClientConfig, type Datasource, type DatasourceEntry, type FetchOptions, type HttpRequestMethod, type HttpRequestOptions, type Link, type Middleware, type RequestWithCacheOptions, type ResourceDeps, type Space, type Story, type StoryAlternate, type StoryLocalizedPath, type StoryTranslatedSlug, type StoryWithInlinedRelations, type Tag, createApiClient };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { Middleware } from "./generated/
|
|
1
|
+
import { Middleware } from "./generated/capi/client/utils.gen.mjs";
|
|
2
2
|
import { CacheProvider, CacheStrategy, CacheStrategyHandler } from "./utils/cache.mjs";
|
|
3
3
|
import { ApiErrorBody, ClientError } from "./error.mjs";
|
|
4
|
+
import { Block } from "./generated/types/block.mjs";
|
|
5
|
+
import { Story } from "./generated/types/story.mjs";
|
|
4
6
|
import { StoryWithInlinedRelations } from "./resources/stories.mjs";
|
|
5
7
|
import { ApiResponse, CacheConfig, ContentApiClient, ContentApiClientConfig, FetchOptions, HttpRequestMethod, HttpRequestOptions, RequestWithCacheOptions, ResourceDeps, createApiClient } from "./client.mjs";
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
+
import { Datasource, DatasourceEntry, Link, StoryAlternate, Tag } from "./generated/capi/types-aliased.gen.mjs";
|
|
9
|
+
import { Space, StoryLocalizedPath, StoryTranslatedSlug } from "./generated/mapi/types.gen.mjs";
|
|
10
|
+
export { type ApiErrorBody, type ApiResponse, type CacheConfig, type CacheProvider, type CacheStrategy, type CacheStrategyHandler, ClientError, type Block as Component, type ContentApiClient, type ContentApiClientConfig, type Datasource, type DatasourceEntry, type FetchOptions, type HttpRequestMethod, type HttpRequestOptions, type Link, type Middleware, type RequestWithCacheOptions, type ResourceDeps, type Space, type Story, type StoryAlternate, type StoryLocalizedPath, type StoryTranslatedSlug, type StoryWithInlinedRelations, type Tag, createApiClient };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_sdk_gen = require('../generated/
|
|
1
|
+
const require_sdk_gen = require('../generated/capi/sdk.gen.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/resources/datasource-entries.ts
|
|
4
4
|
function createDatasourceEntriesResource(deps) {
|
|
@@ -7,7 +7,7 @@ function createDatasourceEntriesResource(deps) {
|
|
|
7
7
|
const { query = {}, signal, throwOnError, fetchOptions } = options;
|
|
8
8
|
const requestPath = "/v2/cdn/datasource_entries";
|
|
9
9
|
return requestWithCache("GET", requestPath, query, (requestQuery) => {
|
|
10
|
-
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(require_sdk_gen.
|
|
10
|
+
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(require_sdk_gen.listDatasourceEntries({
|
|
11
11
|
client,
|
|
12
12
|
query: requestQuery,
|
|
13
13
|
signal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource-entries.cjs","names":["
|
|
1
|
+
{"version":3,"file":"datasource-entries.cjs","names":["listDatasourceEntries"],"sources":["../../src/resources/datasource-entries.ts"],"sourcesContent":["import { listDatasourceEntries } from '../generated/capi/sdk.gen';\nimport type {\n ListDatasourceEntriesData,\n ListDatasourceEntriesResponses,\n} from '../generated/capi/types.gen';\nimport type { ApiResponse, FetchOptions, ResourceDeps } from '../client';\n\nexport function createDatasourceEntriesResource<DefaultThrowOnError extends boolean = false>(deps: ResourceDeps<DefaultThrowOnError>) {\n const { client, requestWithCache, asApiResponse, throttleManager } = deps;\n\n return {\n list: async <ThrowOnError extends boolean = DefaultThrowOnError>(\n options: { query?: ListDatasourceEntriesData['query']; signal?: AbortSignal; throwOnError?: ThrowOnError; fetchOptions?: FetchOptions } = {},\n ): Promise<ApiResponse<ListDatasourceEntriesResponses[200], ThrowOnError>> => {\n const { query = {}, signal, throwOnError, fetchOptions } = options;\n const requestPath = '/v2/cdn/datasource_entries';\n return requestWithCache<ListDatasourceEntriesResponses[200], ThrowOnError>('GET', requestPath, query, (requestQuery: Record<string, unknown>) => {\n return throttleManager.execute(requestPath, requestQuery, () =>\n asApiResponse<ListDatasourceEntriesResponses[200], ThrowOnError>(listDatasourceEntries({\n client,\n query: requestQuery,\n signal,\n ...(throwOnError === undefined ? {} : { throwOnError }),\n ...(fetchOptions ? { kyOptions: { ...client.getConfig().kyOptions, ...fetchOptions } } : {}),\n })));\n });\n },\n };\n}\n"],"mappings":";;;AAOA,SAAgB,gCAA6E,MAAyC;CACpI,MAAM,EAAE,QAAQ,kBAAkB,eAAe,oBAAoB;AAErE,QAAO,EACL,MAAM,OACJ,UAA0I,EAAE,KAChE;EAC5E,MAAM,EAAE,QAAQ,EAAE,EAAE,QAAQ,cAAc,iBAAiB;EAC3D,MAAM,cAAc;AACpB,SAAO,iBAAoE,OAAO,aAAa,QAAQ,iBAA0C;AAC/I,UAAO,gBAAgB,QAAQ,aAAa,oBAC1C,cAAiEA,sCAAsB;IACrF;IACA,OAAO;IACP;IACA,GAAI,iBAAiB,SAAY,EAAE,GAAG,EAAE,cAAc;IACtD,GAAI,eAAe,EAAE,WAAW;KAAE,GAAG,OAAO,WAAW,CAAC;KAAW,GAAG;KAAc,EAAE,GAAG,EAAE;IAC5F,CAAC,CAAC,CAAC;IACN;IAEL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { listDatasourceEntries } from "../generated/capi/sdk.gen.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/resources/datasource-entries.ts
|
|
4
4
|
function createDatasourceEntriesResource(deps) {
|
|
@@ -7,7 +7,7 @@ function createDatasourceEntriesResource(deps) {
|
|
|
7
7
|
const { query = {}, signal, throwOnError, fetchOptions } = options;
|
|
8
8
|
const requestPath = "/v2/cdn/datasource_entries";
|
|
9
9
|
return requestWithCache("GET", requestPath, query, (requestQuery) => {
|
|
10
|
-
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(
|
|
10
|
+
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(listDatasourceEntries({
|
|
11
11
|
client,
|
|
12
12
|
query: requestQuery,
|
|
13
13
|
signal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasource-entries.mjs","names":[
|
|
1
|
+
{"version":3,"file":"datasource-entries.mjs","names":[],"sources":["../../src/resources/datasource-entries.ts"],"sourcesContent":["import { listDatasourceEntries } from '../generated/capi/sdk.gen';\nimport type {\n ListDatasourceEntriesData,\n ListDatasourceEntriesResponses,\n} from '../generated/capi/types.gen';\nimport type { ApiResponse, FetchOptions, ResourceDeps } from '../client';\n\nexport function createDatasourceEntriesResource<DefaultThrowOnError extends boolean = false>(deps: ResourceDeps<DefaultThrowOnError>) {\n const { client, requestWithCache, asApiResponse, throttleManager } = deps;\n\n return {\n list: async <ThrowOnError extends boolean = DefaultThrowOnError>(\n options: { query?: ListDatasourceEntriesData['query']; signal?: AbortSignal; throwOnError?: ThrowOnError; fetchOptions?: FetchOptions } = {},\n ): Promise<ApiResponse<ListDatasourceEntriesResponses[200], ThrowOnError>> => {\n const { query = {}, signal, throwOnError, fetchOptions } = options;\n const requestPath = '/v2/cdn/datasource_entries';\n return requestWithCache<ListDatasourceEntriesResponses[200], ThrowOnError>('GET', requestPath, query, (requestQuery: Record<string, unknown>) => {\n return throttleManager.execute(requestPath, requestQuery, () =>\n asApiResponse<ListDatasourceEntriesResponses[200], ThrowOnError>(listDatasourceEntries({\n client,\n query: requestQuery,\n signal,\n ...(throwOnError === undefined ? {} : { throwOnError }),\n ...(fetchOptions ? { kyOptions: { ...client.getConfig().kyOptions, ...fetchOptions } } : {}),\n })));\n });\n },\n };\n}\n"],"mappings":";;;AAOA,SAAgB,gCAA6E,MAAyC;CACpI,MAAM,EAAE,QAAQ,kBAAkB,eAAe,oBAAoB;AAErE,QAAO,EACL,MAAM,OACJ,UAA0I,EAAE,KAChE;EAC5E,MAAM,EAAE,QAAQ,EAAE,EAAE,QAAQ,cAAc,iBAAiB;EAC3D,MAAM,cAAc;AACpB,SAAO,iBAAoE,OAAO,aAAa,QAAQ,iBAA0C;AAC/I,UAAO,gBAAgB,QAAQ,aAAa,oBAC1C,cAAiE,sBAAsB;IACrF;IACA,OAAO;IACP;IACA,GAAI,iBAAiB,SAAY,EAAE,GAAG,EAAE,cAAc;IACtD,GAAI,eAAe,EAAE,WAAW;KAAE,GAAG,OAAO,WAAW,CAAC;KAAW,GAAG;KAAc,EAAE,GAAG,EAAE;IAC5F,CAAC,CAAC,CAAC;IACN;IAEL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_sdk_gen = require('../generated/
|
|
1
|
+
const require_sdk_gen = require('../generated/capi/sdk.gen.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/resources/datasources.ts
|
|
4
4
|
function createDatasourcesResource(deps) {
|
|
@@ -7,8 +7,8 @@ function createDatasourcesResource(deps) {
|
|
|
7
7
|
get: async (id, options = {}) => {
|
|
8
8
|
const { query = {}, signal, throwOnError, fetchOptions } = options;
|
|
9
9
|
const requestPath = `/v2/cdn/datasources/${id}`;
|
|
10
|
-
return requestWithCache("GET", requestPath, query, (requestQuery) => {
|
|
11
|
-
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(require_sdk_gen.
|
|
10
|
+
return requestWithCache("GET", requestPath, query ?? {}, (requestQuery) => {
|
|
11
|
+
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(require_sdk_gen.getDatasourceById({
|
|
12
12
|
client,
|
|
13
13
|
path: { id },
|
|
14
14
|
query: requestQuery,
|
|
@@ -25,7 +25,7 @@ function createDatasourcesResource(deps) {
|
|
|
25
25
|
const { query = {}, signal, throwOnError, fetchOptions } = options;
|
|
26
26
|
const requestPath = "/v2/cdn/datasources";
|
|
27
27
|
return requestWithCache("GET", requestPath, query, (requestQuery) => {
|
|
28
|
-
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(require_sdk_gen.
|
|
28
|
+
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(require_sdk_gen.listDatasources({
|
|
29
29
|
client,
|
|
30
30
|
query: requestQuery,
|
|
31
31
|
signal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasources.cjs","names":["
|
|
1
|
+
{"version":3,"file":"datasources.cjs","names":["getDatasourceById","listDatasources"],"sources":["../../src/resources/datasources.ts"],"sourcesContent":["import { getDatasourceById, listDatasources } from '../generated/capi/sdk.gen';\nimport type {\n GetDatasourceByIdData,\n GetDatasourceByIdResponses,\n ListDatasourcesData,\n ListDatasourcesResponses,\n} from '../generated/capi/types.gen';\nimport type { ApiResponse, FetchOptions, ResourceDeps } from '../client';\n\nexport function createDatasourcesResource<DefaultThrowOnError extends boolean = false>(deps: ResourceDeps<DefaultThrowOnError>) {\n const { client, requestWithCache, asApiResponse, throttleManager } = deps;\n\n return {\n get: async <ThrowOnError extends boolean = DefaultThrowOnError>(\n id: GetDatasourceByIdData['path']['id'],\n options: { query?: GetDatasourceByIdData['query']; signal?: AbortSignal; throwOnError?: ThrowOnError; fetchOptions?: FetchOptions } = {},\n ): Promise<ApiResponse<GetDatasourceByIdResponses[200], ThrowOnError>> => {\n const { query = {}, signal, throwOnError, fetchOptions } = options;\n const requestPath = `/v2/cdn/datasources/${id}`;\n return requestWithCache<GetDatasourceByIdResponses[200], ThrowOnError>('GET', requestPath, query ?? {}, (requestQuery: Record<string, unknown>) => {\n return throttleManager.execute(requestPath, requestQuery, () =>\n asApiResponse<GetDatasourceByIdResponses[200], ThrowOnError>(getDatasourceById({\n client,\n path: { id },\n query: requestQuery,\n signal,\n ...(throwOnError === undefined ? {} : { throwOnError }),\n ...(fetchOptions ? { kyOptions: { ...client.getConfig().kyOptions, ...fetchOptions } } : {}),\n })));\n });\n },\n\n list: async <ThrowOnError extends boolean = DefaultThrowOnError>(\n options: { query?: ListDatasourcesData['query']; signal?: AbortSignal; throwOnError?: ThrowOnError; fetchOptions?: FetchOptions } = {},\n ): Promise<ApiResponse<ListDatasourcesResponses[200], ThrowOnError>> => {\n const { query = {}, signal, throwOnError, fetchOptions } = options;\n const requestPath = '/v2/cdn/datasources';\n return requestWithCache<ListDatasourcesResponses[200], ThrowOnError>('GET', requestPath, query, (requestQuery: Record<string, unknown>) => {\n return throttleManager.execute(requestPath, requestQuery, () =>\n asApiResponse<ListDatasourcesResponses[200], ThrowOnError>(listDatasources({\n client,\n query: requestQuery,\n signal,\n ...(throwOnError === undefined ? {} : { throwOnError }),\n ...(fetchOptions ? { kyOptions: { ...client.getConfig().kyOptions, ...fetchOptions } } : {}),\n })));\n });\n },\n };\n}\n"],"mappings":";;;AASA,SAAgB,0BAAuE,MAAyC;CAC9H,MAAM,EAAE,QAAQ,kBAAkB,eAAe,oBAAoB;AAErE,QAAO;EACL,KAAK,OACH,IACA,UAAsI,EAAE,KAChE;GACxE,MAAM,EAAE,QAAQ,EAAE,EAAE,QAAQ,cAAc,iBAAiB;GAC3D,MAAM,cAAc,uBAAuB;AAC3C,UAAO,iBAAgE,OAAO,aAAa,SAAS,EAAE,GAAG,iBAA0C;AACjJ,WAAO,gBAAgB,QAAQ,aAAa,oBAC1C,cAA6DA,kCAAkB;KAC7E;KACA,MAAM,EAAE,IAAI;KACZ,OAAO;KACP;KACA,GAAI,iBAAiB,SAAY,EAAE,GAAG,EAAE,cAAc;KACtD,GAAI,eAAe,EAAE,WAAW;MAAE,GAAG,OAAO,WAAW,CAAC;MAAW,GAAG;MAAc,EAAE,GAAG,EAAE;KAC5F,CAAC,CAAC,CAAC;KACN;;EAGJ,MAAM,OACJ,UAAoI,EAAE,KAChE;GACtE,MAAM,EAAE,QAAQ,EAAE,EAAE,QAAQ,cAAc,iBAAiB;GAC3D,MAAM,cAAc;AACpB,UAAO,iBAA8D,OAAO,aAAa,QAAQ,iBAA0C;AACzI,WAAO,gBAAgB,QAAQ,aAAa,oBAC1C,cAA2DC,gCAAgB;KACzE;KACA,OAAO;KACP;KACA,GAAI,iBAAiB,SAAY,EAAE,GAAG,EAAE,cAAc;KACtD,GAAI,eAAe,EAAE,WAAW;MAAE,GAAG,OAAO,WAAW,CAAC;MAAW,GAAG;MAAc,EAAE,GAAG,EAAE;KAC5F,CAAC,CAAC,CAAC;KACN;;EAEL"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getDatasourceById, listDatasources } from "../generated/capi/sdk.gen.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/resources/datasources.ts
|
|
4
4
|
function createDatasourcesResource(deps) {
|
|
@@ -7,8 +7,8 @@ function createDatasourcesResource(deps) {
|
|
|
7
7
|
get: async (id, options = {}) => {
|
|
8
8
|
const { query = {}, signal, throwOnError, fetchOptions } = options;
|
|
9
9
|
const requestPath = `/v2/cdn/datasources/${id}`;
|
|
10
|
-
return requestWithCache("GET", requestPath, query, (requestQuery) => {
|
|
11
|
-
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(
|
|
10
|
+
return requestWithCache("GET", requestPath, query ?? {}, (requestQuery) => {
|
|
11
|
+
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(getDatasourceById({
|
|
12
12
|
client,
|
|
13
13
|
path: { id },
|
|
14
14
|
query: requestQuery,
|
|
@@ -25,7 +25,7 @@ function createDatasourcesResource(deps) {
|
|
|
25
25
|
const { query = {}, signal, throwOnError, fetchOptions } = options;
|
|
26
26
|
const requestPath = "/v2/cdn/datasources";
|
|
27
27
|
return requestWithCache("GET", requestPath, query, (requestQuery) => {
|
|
28
|
-
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(
|
|
28
|
+
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(listDatasources({
|
|
29
29
|
client,
|
|
30
30
|
query: requestQuery,
|
|
31
31
|
signal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"datasources.mjs","names":[
|
|
1
|
+
{"version":3,"file":"datasources.mjs","names":[],"sources":["../../src/resources/datasources.ts"],"sourcesContent":["import { getDatasourceById, listDatasources } from '../generated/capi/sdk.gen';\nimport type {\n GetDatasourceByIdData,\n GetDatasourceByIdResponses,\n ListDatasourcesData,\n ListDatasourcesResponses,\n} from '../generated/capi/types.gen';\nimport type { ApiResponse, FetchOptions, ResourceDeps } from '../client';\n\nexport function createDatasourcesResource<DefaultThrowOnError extends boolean = false>(deps: ResourceDeps<DefaultThrowOnError>) {\n const { client, requestWithCache, asApiResponse, throttleManager } = deps;\n\n return {\n get: async <ThrowOnError extends boolean = DefaultThrowOnError>(\n id: GetDatasourceByIdData['path']['id'],\n options: { query?: GetDatasourceByIdData['query']; signal?: AbortSignal; throwOnError?: ThrowOnError; fetchOptions?: FetchOptions } = {},\n ): Promise<ApiResponse<GetDatasourceByIdResponses[200], ThrowOnError>> => {\n const { query = {}, signal, throwOnError, fetchOptions } = options;\n const requestPath = `/v2/cdn/datasources/${id}`;\n return requestWithCache<GetDatasourceByIdResponses[200], ThrowOnError>('GET', requestPath, query ?? {}, (requestQuery: Record<string, unknown>) => {\n return throttleManager.execute(requestPath, requestQuery, () =>\n asApiResponse<GetDatasourceByIdResponses[200], ThrowOnError>(getDatasourceById({\n client,\n path: { id },\n query: requestQuery,\n signal,\n ...(throwOnError === undefined ? {} : { throwOnError }),\n ...(fetchOptions ? { kyOptions: { ...client.getConfig().kyOptions, ...fetchOptions } } : {}),\n })));\n });\n },\n\n list: async <ThrowOnError extends boolean = DefaultThrowOnError>(\n options: { query?: ListDatasourcesData['query']; signal?: AbortSignal; throwOnError?: ThrowOnError; fetchOptions?: FetchOptions } = {},\n ): Promise<ApiResponse<ListDatasourcesResponses[200], ThrowOnError>> => {\n const { query = {}, signal, throwOnError, fetchOptions } = options;\n const requestPath = '/v2/cdn/datasources';\n return requestWithCache<ListDatasourcesResponses[200], ThrowOnError>('GET', requestPath, query, (requestQuery: Record<string, unknown>) => {\n return throttleManager.execute(requestPath, requestQuery, () =>\n asApiResponse<ListDatasourcesResponses[200], ThrowOnError>(listDatasources({\n client,\n query: requestQuery,\n signal,\n ...(throwOnError === undefined ? {} : { throwOnError }),\n ...(fetchOptions ? { kyOptions: { ...client.getConfig().kyOptions, ...fetchOptions } } : {}),\n })));\n });\n },\n };\n}\n"],"mappings":";;;AASA,SAAgB,0BAAuE,MAAyC;CAC9H,MAAM,EAAE,QAAQ,kBAAkB,eAAe,oBAAoB;AAErE,QAAO;EACL,KAAK,OACH,IACA,UAAsI,EAAE,KAChE;GACxE,MAAM,EAAE,QAAQ,EAAE,EAAE,QAAQ,cAAc,iBAAiB;GAC3D,MAAM,cAAc,uBAAuB;AAC3C,UAAO,iBAAgE,OAAO,aAAa,SAAS,EAAE,GAAG,iBAA0C;AACjJ,WAAO,gBAAgB,QAAQ,aAAa,oBAC1C,cAA6D,kBAAkB;KAC7E;KACA,MAAM,EAAE,IAAI;KACZ,OAAO;KACP;KACA,GAAI,iBAAiB,SAAY,EAAE,GAAG,EAAE,cAAc;KACtD,GAAI,eAAe,EAAE,WAAW;MAAE,GAAG,OAAO,WAAW,CAAC;MAAW,GAAG;MAAc,EAAE,GAAG,EAAE;KAC5F,CAAC,CAAC,CAAC;KACN;;EAGJ,MAAM,OACJ,UAAoI,EAAE,KAChE;GACtE,MAAM,EAAE,QAAQ,EAAE,EAAE,QAAQ,cAAc,iBAAiB;GAC3D,MAAM,cAAc;AACpB,UAAO,iBAA8D,OAAO,aAAa,QAAQ,iBAA0C;AACzI,WAAO,gBAAgB,QAAQ,aAAa,oBAC1C,cAA2D,gBAAgB;KACzE;KACA,OAAO;KACP;KACA,GAAI,iBAAiB,SAAY,EAAE,GAAG,EAAE,cAAc;KACtD,GAAI,eAAe,EAAE,WAAW;MAAE,GAAG,OAAO,WAAW,CAAC;MAAW,GAAG;MAAc,EAAE,GAAG,EAAE;KAC5F,CAAC,CAAC,CAAC;KACN;;EAEL"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const require_sdk_gen = require('../generated/capi/sdk.gen.cjs');
|
|
2
|
+
|
|
3
|
+
//#region src/resources/experiments.ts
|
|
4
|
+
function createExperimentsResource(deps) {
|
|
5
|
+
const { client, requestWithCache, asApiResponse, throttleManager } = deps;
|
|
6
|
+
return { list: async (options = {}) => {
|
|
7
|
+
const { query = {}, signal, throwOnError, fetchOptions } = options;
|
|
8
|
+
const requestPath = "/v2/cdn/experiments";
|
|
9
|
+
return requestWithCache("GET", requestPath, query, (requestQuery) => {
|
|
10
|
+
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(require_sdk_gen.listCdnExperimentsV2({
|
|
11
|
+
client,
|
|
12
|
+
query: requestQuery,
|
|
13
|
+
signal,
|
|
14
|
+
...throwOnError === void 0 ? {} : { throwOnError },
|
|
15
|
+
...fetchOptions ? { kyOptions: {
|
|
16
|
+
...client.getConfig().kyOptions,
|
|
17
|
+
...fetchOptions
|
|
18
|
+
} } : {}
|
|
19
|
+
})));
|
|
20
|
+
});
|
|
21
|
+
} };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
exports.createExperimentsResource = createExperimentsResource;
|
|
26
|
+
//# sourceMappingURL=experiments.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiments.cjs","names":["listCdnExperimentsV2"],"sources":["../../src/resources/experiments.ts"],"sourcesContent":["import { listCdnExperimentsV2 } from '../generated/capi/sdk.gen';\nimport type { ListCdnExperimentsV2Data, ListCdnExperimentsV2Responses } from '../generated/capi/types.gen';\nimport type { ApiResponse, FetchOptions, ResourceDeps } from '../client';\n\nexport function createExperimentsResource<DefaultThrowOnError extends boolean = false>(deps: ResourceDeps<DefaultThrowOnError>) {\n const { client, requestWithCache, asApiResponse, throttleManager } = deps;\n\n return {\n /**\n * Retrieve all running experiments for the space.\n *\n * Each experiment lists its variants and their `story_mappings`, which map an\n * `original_story_id`/`original_slug` to a `variant_story_id`/`variant_slug`.\n * The CDN has no per-story variant filter, so the typical flow is:\n *\n * 1. `experiments.list()` to fetch the running experiments.\n * 2. Pick a variant deterministically (e.g. hash the visitor id against the\n * variant `public_id`/`weight`) for the experiment that maps the story you\n * are rendering.\n * 3. Fetch that variant's own `variant_slug` via the `stories` resource (the\n * control variant resolves back to the `original_slug`).\n *\n * See `@storyblok/experiments` for variant assignment and tracking helpers.\n */\n list: async <ThrowOnError extends boolean = DefaultThrowOnError>(\n options: { query?: ListCdnExperimentsV2Data['query']; signal?: AbortSignal; throwOnError?: ThrowOnError; fetchOptions?: FetchOptions } = {},\n ): Promise<ApiResponse<ListCdnExperimentsV2Responses[200], ThrowOnError>> => {\n const { query = {}, signal, throwOnError, fetchOptions } = options;\n const requestPath = '/v2/cdn/experiments';\n return requestWithCache<ListCdnExperimentsV2Responses[200], ThrowOnError>('GET', requestPath, query, (requestQuery: Record<string, unknown>) => {\n return throttleManager.execute(requestPath, requestQuery, () =>\n asApiResponse<ListCdnExperimentsV2Responses[200], ThrowOnError>(listCdnExperimentsV2({\n client,\n query: requestQuery,\n signal,\n ...(throwOnError === undefined ? {} : { throwOnError }),\n ...(fetchOptions ? { kyOptions: { ...client.getConfig().kyOptions, ...fetchOptions } } : {}),\n })));\n });\n },\n };\n}\n"],"mappings":";;;AAIA,SAAgB,0BAAuE,MAAyC;CAC9H,MAAM,EAAE,QAAQ,kBAAkB,eAAe,oBAAoB;AAErE,QAAO,EAiBL,MAAM,OACJ,UAAyI,EAAE,KAChE;EAC3E,MAAM,EAAE,QAAQ,EAAE,EAAE,QAAQ,cAAc,iBAAiB;EAC3D,MAAM,cAAc;AACpB,SAAO,iBAAmE,OAAO,aAAa,QAAQ,iBAA0C;AAC9I,UAAO,gBAAgB,QAAQ,aAAa,oBAC1C,cAAgEA,qCAAqB;IACnF;IACA,OAAO;IACP;IACA,GAAI,iBAAiB,SAAY,EAAE,GAAG,EAAE,cAAc;IACtD,GAAI,eAAe,EAAE,WAAW;KAAE,GAAG,OAAO,WAAW,CAAC;KAAW,GAAG;KAAc,EAAE,GAAG,EAAE;IAC5F,CAAC,CAAC,CAAC;IACN;IAEL"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { listCdnExperimentsV2 } from "../generated/capi/sdk.gen.mjs";
|
|
2
|
+
|
|
3
|
+
//#region src/resources/experiments.ts
|
|
4
|
+
function createExperimentsResource(deps) {
|
|
5
|
+
const { client, requestWithCache, asApiResponse, throttleManager } = deps;
|
|
6
|
+
return { list: async (options = {}) => {
|
|
7
|
+
const { query = {}, signal, throwOnError, fetchOptions } = options;
|
|
8
|
+
const requestPath = "/v2/cdn/experiments";
|
|
9
|
+
return requestWithCache("GET", requestPath, query, (requestQuery) => {
|
|
10
|
+
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(listCdnExperimentsV2({
|
|
11
|
+
client,
|
|
12
|
+
query: requestQuery,
|
|
13
|
+
signal,
|
|
14
|
+
...throwOnError === void 0 ? {} : { throwOnError },
|
|
15
|
+
...fetchOptions ? { kyOptions: {
|
|
16
|
+
...client.getConfig().kyOptions,
|
|
17
|
+
...fetchOptions
|
|
18
|
+
} } : {}
|
|
19
|
+
})));
|
|
20
|
+
});
|
|
21
|
+
} };
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
//#endregion
|
|
25
|
+
export { createExperimentsResource };
|
|
26
|
+
//# sourceMappingURL=experiments.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiments.mjs","names":[],"sources":["../../src/resources/experiments.ts"],"sourcesContent":["import { listCdnExperimentsV2 } from '../generated/capi/sdk.gen';\nimport type { ListCdnExperimentsV2Data, ListCdnExperimentsV2Responses } from '../generated/capi/types.gen';\nimport type { ApiResponse, FetchOptions, ResourceDeps } from '../client';\n\nexport function createExperimentsResource<DefaultThrowOnError extends boolean = false>(deps: ResourceDeps<DefaultThrowOnError>) {\n const { client, requestWithCache, asApiResponse, throttleManager } = deps;\n\n return {\n /**\n * Retrieve all running experiments for the space.\n *\n * Each experiment lists its variants and their `story_mappings`, which map an\n * `original_story_id`/`original_slug` to a `variant_story_id`/`variant_slug`.\n * The CDN has no per-story variant filter, so the typical flow is:\n *\n * 1. `experiments.list()` to fetch the running experiments.\n * 2. Pick a variant deterministically (e.g. hash the visitor id against the\n * variant `public_id`/`weight`) for the experiment that maps the story you\n * are rendering.\n * 3. Fetch that variant's own `variant_slug` via the `stories` resource (the\n * control variant resolves back to the `original_slug`).\n *\n * See `@storyblok/experiments` for variant assignment and tracking helpers.\n */\n list: async <ThrowOnError extends boolean = DefaultThrowOnError>(\n options: { query?: ListCdnExperimentsV2Data['query']; signal?: AbortSignal; throwOnError?: ThrowOnError; fetchOptions?: FetchOptions } = {},\n ): Promise<ApiResponse<ListCdnExperimentsV2Responses[200], ThrowOnError>> => {\n const { query = {}, signal, throwOnError, fetchOptions } = options;\n const requestPath = '/v2/cdn/experiments';\n return requestWithCache<ListCdnExperimentsV2Responses[200], ThrowOnError>('GET', requestPath, query, (requestQuery: Record<string, unknown>) => {\n return throttleManager.execute(requestPath, requestQuery, () =>\n asApiResponse<ListCdnExperimentsV2Responses[200], ThrowOnError>(listCdnExperimentsV2({\n client,\n query: requestQuery,\n signal,\n ...(throwOnError === undefined ? {} : { throwOnError }),\n ...(fetchOptions ? { kyOptions: { ...client.getConfig().kyOptions, ...fetchOptions } } : {}),\n })));\n });\n },\n };\n}\n"],"mappings":";;;AAIA,SAAgB,0BAAuE,MAAyC;CAC9H,MAAM,EAAE,QAAQ,kBAAkB,eAAe,oBAAoB;AAErE,QAAO,EAiBL,MAAM,OACJ,UAAyI,EAAE,KAChE;EAC3E,MAAM,EAAE,QAAQ,EAAE,EAAE,QAAQ,cAAc,iBAAiB;EAC3D,MAAM,cAAc;AACpB,SAAO,iBAAmE,OAAO,aAAa,QAAQ,iBAA0C;AAC9I,UAAO,gBAAgB,QAAQ,aAAa,oBAC1C,cAAgE,qBAAqB;IACnF;IACA,OAAO;IACP;IACA,GAAI,iBAAiB,SAAY,EAAE,GAAG,EAAE,cAAc;IACtD,GAAI,eAAe,EAAE,WAAW;KAAE,GAAG,OAAO,WAAW,CAAC;KAAW,GAAG;KAAc,EAAE,GAAG,EAAE;IAC5F,CAAC,CAAC,CAAC;IACN;IAEL"}
|
package/dist/resources/links.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_sdk_gen = require('../generated/
|
|
1
|
+
const require_sdk_gen = require('../generated/capi/sdk.gen.cjs');
|
|
2
2
|
|
|
3
3
|
//#region src/resources/links.ts
|
|
4
4
|
function createLinksResource(deps) {
|
|
@@ -7,7 +7,7 @@ function createLinksResource(deps) {
|
|
|
7
7
|
const { query = {}, signal, throwOnError, fetchOptions } = options;
|
|
8
8
|
const requestPath = "/v2/cdn/links";
|
|
9
9
|
return requestWithCache("GET", requestPath, query, (requestQuery) => {
|
|
10
|
-
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(require_sdk_gen.
|
|
10
|
+
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(require_sdk_gen.listLinks({
|
|
11
11
|
client,
|
|
12
12
|
query: requestQuery,
|
|
13
13
|
signal,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.cjs","names":["listLinks"],"sources":["../../src/resources/links.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"links.cjs","names":["listLinks"],"sources":["../../src/resources/links.ts"],"sourcesContent":["import { listLinks } from '../generated/capi/sdk.gen';\nimport type { ListLinksData, ListLinksResponses } from '../generated/capi/types.gen';\nimport type { ApiResponse, FetchOptions, ResourceDeps } from '../client';\n\nexport function createLinksResource<DefaultThrowOnError extends boolean = false>(deps: ResourceDeps<DefaultThrowOnError>) {\n const { client, requestWithCache, asApiResponse, throttleManager } = deps;\n\n return {\n list: async <ThrowOnError extends boolean = DefaultThrowOnError>(\n options: { query?: ListLinksData['query']; signal?: AbortSignal; throwOnError?: ThrowOnError; fetchOptions?: FetchOptions } = {},\n ): Promise<ApiResponse<ListLinksResponses[200], ThrowOnError>> => {\n const { query = {}, signal, throwOnError, fetchOptions } = options;\n const requestPath = '/v2/cdn/links';\n return requestWithCache<ListLinksResponses[200], ThrowOnError>('GET', requestPath, query, (requestQuery: Record<string, unknown>) => {\n return throttleManager.execute(requestPath, requestQuery, () =>\n asApiResponse<ListLinksResponses[200], ThrowOnError>(listLinks({\n client,\n query: requestQuery,\n signal,\n ...(throwOnError === undefined ? {} : { throwOnError }),\n ...(fetchOptions ? { kyOptions: { ...client.getConfig().kyOptions, ...fetchOptions } } : {}),\n })));\n });\n },\n };\n}\n"],"mappings":";;;AAIA,SAAgB,oBAAiE,MAAyC;CACxH,MAAM,EAAE,QAAQ,kBAAkB,eAAe,oBAAoB;AAErE,QAAO,EACL,MAAM,OACJ,UAA8H,EAAE,KAChE;EAChE,MAAM,EAAE,QAAQ,EAAE,EAAE,QAAQ,cAAc,iBAAiB;EAC3D,MAAM,cAAc;AACpB,SAAO,iBAAwD,OAAO,aAAa,QAAQ,iBAA0C;AACnI,UAAO,gBAAgB,QAAQ,aAAa,oBAC1C,cAAqDA,0BAAU;IAC7D;IACA,OAAO;IACP;IACA,GAAI,iBAAiB,SAAY,EAAE,GAAG,EAAE,cAAc;IACtD,GAAI,eAAe,EAAE,WAAW;KAAE,GAAG,OAAO,WAAW,CAAC;KAAW,GAAG;KAAc,EAAE,GAAG,EAAE;IAC5F,CAAC,CAAC,CAAC;IACN;IAEL"}
|
package/dist/resources/links.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { listLinks } from "../generated/capi/sdk.gen.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/resources/links.ts
|
|
4
4
|
function createLinksResource(deps) {
|
|
@@ -7,7 +7,7 @@ function createLinksResource(deps) {
|
|
|
7
7
|
const { query = {}, signal, throwOnError, fetchOptions } = options;
|
|
8
8
|
const requestPath = "/v2/cdn/links";
|
|
9
9
|
return requestWithCache("GET", requestPath, query, (requestQuery) => {
|
|
10
|
-
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(
|
|
10
|
+
return throttleManager.execute(requestPath, requestQuery, () => asApiResponse(listLinks({
|
|
11
11
|
client,
|
|
12
12
|
query: requestQuery,
|
|
13
13
|
signal,
|