storyblok 4.22.0 → 4.22.2
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 +43 -22
- package/dist/config/index.d.mts +168 -298
- package/dist/config/index.mjs +5 -3
- package/dist/config/index.mjs.map +1 -1
- package/dist/constants-FGOZXcwP.d.mts +149 -0
- package/dist/index.d.mts +608 -102
- package/dist/index.mjs +12394 -12896
- package/dist/index.mjs.map +1 -1
- package/dist/storyblok-types.d.mts +623 -0
- package/package.json +62 -41
- package/dist/config/index.d.ts +0 -347
- package/dist/index.d.ts +0 -121
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../src/lib/config/types.ts"],"sourcesContent":["import type { RegionCode } from
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../../src/lib/config/types.ts"],"sourcesContent":["import type { RegionCode } from \"../../constants\";\nimport type { Command, Option } from \"commander\";\nimport type { CommandOptions } from \"../../types\";\nimport type { PullComponentsOptions } from \"../../commands/components/pull/constants\";\nimport type { PushComponentsOptions } from \"../../commands/components/push/constants\";\nimport type { PullDatasourcesOptions } from \"../../commands/datasources/pull/constants\";\nimport type { PushDatasourcesOptions } from \"../../commands/datasources/push/constants\";\nimport type { DeleteDatasourceOptions } from \"../../commands/datasources/delete/constants\";\nimport type { MigrationsGenerateOptions } from \"../../commands/migrations/generate/constants\";\nimport type { MigrationsRunOptions } from \"../../commands/migrations/run/constants\";\nimport type { MigrationsRollbackOptions } from \"../../commands/migrations/rollback/types\";\nimport type { GenerateTypesOptions } from \"../../commands/types/generate/constants\";\nimport type { PullLanguagesOptions } from \"../../commands/languages/constants\";\nimport type { PullAssetsOptions } from \"../../commands/assets/pull/types\";\nimport type { PushAssetsOptions } from \"../../commands/assets/push/types\";\nimport type { PullStoriesOptions } from \"../../commands/stories/pull/types\";\nimport type { PushStoriesOptions } from \"../../commands/stories/push/types\";\nimport type { PruneLogsOptions } from \"../../commands/logs/prune/types\";\nimport type { PruneReportsOptions } from \"../../commands/reports/prune/types\";\nimport type { DeepPartial } from \"../../utils/types\";\n\nexport type PlainObject = Record<string, any>;\n\nexport interface ApiConfig {\n maxRetries: number;\n rateLimit: number;\n /** @deprecated Use `rateLimit` instead. @todo(next-major): Remove this field. */\n maxConcurrency?: number;\n}\n\nexport interface LogConsoleConfig {\n enabled: boolean;\n level: string;\n}\n\nexport interface LogFileConfig {\n enabled: boolean;\n level: string;\n maxFiles: number;\n}\n\nexport interface LogConfig {\n console: LogConsoleConfig;\n file: LogFileConfig;\n}\n\nexport interface ReportConfig {\n enabled: boolean;\n maxFiles: number;\n}\n\nexport interface UiConfig {\n enabled: boolean;\n}\n\nexport interface GlobalConfig {\n region?: RegionCode;\n space?: number | string;\n path?: string;\n api: ApiConfig;\n log: LogConfig;\n report: ReportConfig;\n ui: UiConfig;\n verbose: boolean;\n}\n\nexport interface ResolvedCliConfig extends GlobalConfig {\n [key: string]: any;\n}\n\ntype StripCommandOption<T> = T extends CommandOptions ? Omit<T, keyof CommandOptions> : T;\ntype CommandConfig<T> = Partial<StripCommandOption<T>>;\n\nexport interface SharedConfigOptions {\n space?: number | string;\n path?: string;\n}\n\nexport interface CommandOptionsMap {\n components: { pull: PullComponentsOptions; push: PushComponentsOptions };\n datasources: {\n pull: PullDatasourcesOptions;\n push: PushDatasourcesOptions;\n delete: DeleteDatasourceOptions;\n };\n migrations: {\n generate: MigrationsGenerateOptions;\n run: MigrationsRunOptions;\n rollback: MigrationsRollbackOptions;\n };\n types: { generate: GenerateTypesOptions };\n languages: { pull: PullLanguagesOptions };\n assets: { pull: PullAssetsOptions; push: PushAssetsOptions };\n stories: { pull: PullStoriesOptions; push: PushStoriesOptions };\n logs: { list: Record<string, never>; prune: PruneLogsOptions };\n reports: { list: Record<string, never>; prune: PruneReportsOptions };\n}\n\ntype SubcommandConfig<T> = SharedConfigOptions & CommandConfig<T>;\n\ntype ModuleConfig<Subs extends Record<string, any>> = SharedConfigOptions & {\n [K in keyof Subs]?: SubcommandConfig<Subs[K]>;\n};\n\nexport type ModulesConfig = {\n [K in keyof CommandOptionsMap]?: ModuleConfig<CommandOptionsMap[K]>;\n};\n\nexport type ComponentsModuleConfig = ModulesConfig[\"components\"];\nexport type DatasourcesModuleConfig = ModulesConfig[\"datasources\"];\nexport type MigrationsModuleConfig = ModulesConfig[\"migrations\"];\nexport type TypesModuleConfig = ModulesConfig[\"types\"];\nexport type LanguagesModuleConfig = ModulesConfig[\"languages\"];\nexport type AssetsModuleConfig = ModulesConfig[\"assets\"];\nexport type StoriesModuleConfig = ModulesConfig[\"stories\"];\nexport type LogsModuleConfig = ModulesConfig[\"logs\"];\nexport type ReportsModuleConfig = ModulesConfig[\"reports\"];\n\nexport interface StoryblokConfig extends DeepPartial<GlobalConfig> {\n modules?: ModulesConfig;\n}\n\nexport function defineConfig<T extends StoryblokConfig>(config: T): T {\n return config;\n}\n\nexport type OptionParser<T> = (value: string, previous?: T) => T;\n\nexport interface GlobalOptionDefinition<T = unknown> {\n flags: string;\n description: string;\n defaultValue?: T;\n parser?: OptionParser<T>;\n}\n\nexport interface ConfigLocation {\n cwd: string;\n configFile: string;\n}\n\nexport type CommanderOption = Option;\nexport type CommanderCommand = Command;\n"],"mappings":";AA0HA,SAAgB,aAAwC,QAAc;CACpE,OAAO;AACT"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import "@storyblok/management-api-client";
|
|
2
|
+
//#region src/types/index.d.ts
|
|
3
|
+
/**
|
|
4
|
+
* Interface representing the default options for a CLI command.
|
|
5
|
+
*/
|
|
6
|
+
interface CommandOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Indicates whether verbose output is enabled.
|
|
9
|
+
*/
|
|
10
|
+
verbose: boolean;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/commands/components/pull/constants.d.ts
|
|
14
|
+
/**
|
|
15
|
+
* Interface representing the options for the `components pull` command.
|
|
16
|
+
*/
|
|
17
|
+
interface PullComponentsOptions extends CommandOptions {
|
|
18
|
+
/**
|
|
19
|
+
* The filename to save the file as.
|
|
20
|
+
* Defaults to `components`. The file will be saved as `<filename>.<space>.json`.
|
|
21
|
+
* @default `components
|
|
22
|
+
*/
|
|
23
|
+
filename?: string;
|
|
24
|
+
/**
|
|
25
|
+
* The suffix to add to the filename.
|
|
26
|
+
* Defaults to the space ID.
|
|
27
|
+
* @default space
|
|
28
|
+
*/
|
|
29
|
+
suffix?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Indicates whether to save each component to a separate file.
|
|
32
|
+
* @default false
|
|
33
|
+
*/
|
|
34
|
+
separateFiles?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Glob pattern to select components by name. Matching components and their dependencies
|
|
37
|
+
* (assigned groups with ancestors, tags, presets, and schema-whitelisted groups/tags) are pulled.
|
|
38
|
+
*/
|
|
39
|
+
filter?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Component group name(s) or `Parent/Child` path(s) to select. Includes descendant groups.
|
|
42
|
+
* Repeatable; multiple values match any of the given groups.
|
|
43
|
+
*/
|
|
44
|
+
group?: string[];
|
|
45
|
+
/**
|
|
46
|
+
* Component tag name(s) to select. Repeatable and comma-separated; multiple values match any.
|
|
47
|
+
*/
|
|
48
|
+
tag?: string[];
|
|
49
|
+
}
|
|
50
|
+
//#endregion
|
|
51
|
+
//#region src/commands/components/push/constants.d.ts
|
|
52
|
+
interface PushComponentsOptions extends CommandOptions {
|
|
53
|
+
/**
|
|
54
|
+
* The glob pattern filter to apply to components before pushing.
|
|
55
|
+
* Matching components and all their dependencies (groups, tags, other components)
|
|
56
|
+
* will be collected and pushed together.
|
|
57
|
+
* @default `.*`
|
|
58
|
+
*/
|
|
59
|
+
filter?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Indicates whether to save each component to a separate file.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
separateFiles?: boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The source space id.
|
|
67
|
+
*/
|
|
68
|
+
from?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Suffix to add to the component name.
|
|
71
|
+
*/
|
|
72
|
+
suffix?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Component group name(s) or `Parent/Child` path(s) to select from local files. Includes descendants.
|
|
75
|
+
* Repeatable; multiple values match any of the given groups.
|
|
76
|
+
*/
|
|
77
|
+
group?: string[];
|
|
78
|
+
/**
|
|
79
|
+
* Component tag name(s) to select from local files. Repeatable and comma-separated; multiple values match any.
|
|
80
|
+
*/
|
|
81
|
+
tag?: string[];
|
|
82
|
+
}
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region src/commands/datasources/pull/constants.d.ts
|
|
85
|
+
/**
|
|
86
|
+
* Interface representing the options for the `datasources pull` command.
|
|
87
|
+
*/
|
|
88
|
+
interface PullDatasourcesOptions extends CommandOptions {
|
|
89
|
+
/**
|
|
90
|
+
* The filename to save the file as.
|
|
91
|
+
* Defaults to `DEFAULT_DATASOURCES_FILENAME`. The file will be saved as `<filename>.<space>.json`.
|
|
92
|
+
* @default DEFAULT_DATASOURCES_FILENAME
|
|
93
|
+
*/
|
|
94
|
+
filename?: string;
|
|
95
|
+
/**
|
|
96
|
+
* The suffix to add to the filename.
|
|
97
|
+
* Defaults to the space ID.
|
|
98
|
+
* @default space
|
|
99
|
+
*/
|
|
100
|
+
suffix?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Indicates whether to save each datasource to a separate file.
|
|
103
|
+
* @default false
|
|
104
|
+
*/
|
|
105
|
+
separateFiles?: boolean;
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
//#region src/commands/datasources/push/constants.d.ts
|
|
109
|
+
interface PushDatasourcesOptions extends CommandOptions {
|
|
110
|
+
/**
|
|
111
|
+
* The glob pattern filter to apply to datasources before pushing.
|
|
112
|
+
* @default `.*`
|
|
113
|
+
*/
|
|
114
|
+
filter?: string;
|
|
115
|
+
/**
|
|
116
|
+
* Indicates whether to save each component to a separate file.
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
119
|
+
separateFiles?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* The source space id.
|
|
122
|
+
*/
|
|
123
|
+
from?: string;
|
|
124
|
+
/**
|
|
125
|
+
* Suffix to add to the component name.
|
|
126
|
+
*/
|
|
127
|
+
suffix?: string;
|
|
128
|
+
}
|
|
129
|
+
//#endregion
|
|
130
|
+
//#region src/commands/migrations/generate/constants.d.ts
|
|
131
|
+
interface MigrationsGenerateOptions extends CommandOptions {
|
|
132
|
+
suffix?: string;
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/commands/migrations/run/constants.d.ts
|
|
136
|
+
interface MigrationsRunOptions extends CommandOptions {
|
|
137
|
+
dryRun?: boolean;
|
|
138
|
+
filter?: string;
|
|
139
|
+
/**
|
|
140
|
+
* The source space id to read migration files from.
|
|
141
|
+
*/
|
|
142
|
+
from?: string;
|
|
143
|
+
query?: string;
|
|
144
|
+
startsWith?: string;
|
|
145
|
+
publish?: "all" | "published" | "published-with-changes";
|
|
146
|
+
}
|
|
147
|
+
//#endregion
|
|
148
|
+
export { PushComponentsOptions as a, PullDatasourcesOptions as i, MigrationsGenerateOptions as n, PullComponentsOptions as o, PushDatasourcesOptions as r, CommandOptions as s, MigrationsRunOptions as t };
|
|
149
|
+
//# sourceMappingURL=constants-FGOZXcwP.d.mts.map
|