@hot-updater/cli-tools 1.0.0-rc.2 → 1.0.0-rc.22
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/dist/index.d.mts +281 -65
- package/dist/index.mjs +659 -543
- package/package.json +6 -5
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Readable } from "stream";
|
|
2
2
|
import { Key as Key$1 } from "node:readline";
|
|
3
|
+
import { AnyHotUpdaterPlugin, Bundle, BundleSigningAdapter, ConfigInput, ConfiguredDatabase, EngineDatabase, HotUpdaterCoreApi, LocalSigningConfig, Migrator, Platform, PluginClientPlugin, RequiredDeep, SchemaGenerator, SigningConfig, StorageAdapter, StorageAdapterWith, StoragePutResult, ToolingDatabase } from "@hot-updater/plugin-core";
|
|
3
4
|
import { Readable as Readable$1, Writable } from "node:stream";
|
|
4
|
-
import {
|
|
5
|
+
import { ManifestArchive } from "@hot-updater/protocol";
|
|
5
6
|
//#region src/BuildLogger.d.ts
|
|
6
7
|
type LinePattern = string | RegExp;
|
|
7
8
|
interface BuildLoggerConfig {
|
|
@@ -31,8 +32,101 @@ declare class BuildLogger {
|
|
|
31
32
|
private showLogFileLocation;
|
|
32
33
|
}
|
|
33
34
|
//#endregion
|
|
34
|
-
//#region src/
|
|
35
|
-
|
|
35
|
+
//#region src/appSetup.d.ts
|
|
36
|
+
/** The credential init gives an app, through the server's clientAuth plugin. */
|
|
37
|
+
interface AppClientCredential {
|
|
38
|
+
/** Its name in output, such as "API key". */
|
|
39
|
+
readonly label: string;
|
|
40
|
+
/** The request header that carries it. */
|
|
41
|
+
readonly header: string;
|
|
42
|
+
readonly value: string;
|
|
43
|
+
}
|
|
44
|
+
/** A client plugin the server's plugins ask an app to add. */
|
|
45
|
+
interface AppClientPlugin {
|
|
46
|
+
/** The module that exports it. */
|
|
47
|
+
readonly module: string;
|
|
48
|
+
/** The export, which the app calls with no arguments. */
|
|
49
|
+
readonly name: string;
|
|
50
|
+
}
|
|
51
|
+
interface AppSetup {
|
|
52
|
+
readonly credential?: AppClientCredential;
|
|
53
|
+
readonly clientPlugins?: readonly AppClientPlugin[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* The app's import lines for `HotUpdater` and `clientPlugins`: one line per
|
|
57
|
+
* module, the SDK's first, so a built-in plugin joins `HotUpdater`'s import.
|
|
58
|
+
* The agent scaffold renders the same lines in hot-updater's
|
|
59
|
+
* `commands/infra/clientAuth.ts`, which imports no package.
|
|
60
|
+
*/
|
|
61
|
+
declare const renderAppImports: (clientPlugins: readonly AppClientPlugin[]) => string[];
|
|
62
|
+
/**
|
|
63
|
+
* The App.tsx code init prints: `HotUpdater.init` with the server's URL,
|
|
64
|
+
* the header that carries the client credential when the server takes one,
|
|
65
|
+
* and the client plugins the server's plugins ask for.
|
|
66
|
+
*/
|
|
67
|
+
declare const renderAppSetup: ({ baseURL, credential, clientPlugins }: AppSetup & {
|
|
68
|
+
readonly baseURL: string;
|
|
69
|
+
}) => string;
|
|
70
|
+
/** Prints the App.tsx code, when the URL is known, and the app's credential. */
|
|
71
|
+
declare const printAppSetup: ({ baseURL, ...setup }: AppSetup & {
|
|
72
|
+
readonly baseURL?: string;
|
|
73
|
+
/** Required, so each init passes its server plugins' client plugins. */
|
|
74
|
+
readonly clientPlugins: readonly AppClientPlugin[];
|
|
75
|
+
}) => void;
|
|
76
|
+
//#endregion
|
|
77
|
+
//#region src/assembleServer.d.ts
|
|
78
|
+
/**
|
|
79
|
+
* The server hot-updater.config.ts describes, as the CLI runs it: core and
|
|
80
|
+
* the plugins over the config's database and storage.
|
|
81
|
+
*/
|
|
82
|
+
interface AssembledServer {
|
|
83
|
+
/** The config's database: the server's own, or `standaloneRepository(...)`. */
|
|
84
|
+
readonly database: ConfiguredDatabase;
|
|
85
|
+
/**
|
|
86
|
+
* Core's reads and typed writes. Over the server's database they take the
|
|
87
|
+
* server's path: the plugins' schema fence, pruning during writes, the
|
|
88
|
+
* storage's file URLs, and the database's CDN purge. Over
|
|
89
|
+
* `standaloneRepository`, they go through the server's admin API.
|
|
90
|
+
*/
|
|
91
|
+
readonly core: HotUpdaterCoreApi;
|
|
92
|
+
/** Where the CLI uploads bundles; undefined when the config names none. */
|
|
93
|
+
readonly storage: StorageAdapter | undefined;
|
|
94
|
+
/** The plugins as configured, as a frozen copy. */
|
|
95
|
+
readonly plugins: readonly AnyHotUpdaterPlugin[];
|
|
96
|
+
/** Each plugin's API by id; undefined over standaloneRepository, whose plugins run on the server. */
|
|
97
|
+
readonly api: Readonly<Record<string, unknown>> | undefined;
|
|
98
|
+
/** The client plugins an app adds for the plugins: what init prints and doctor checks. */
|
|
99
|
+
readonly clientPlugins: readonly PluginClientPlugin[];
|
|
100
|
+
/** The plugin that guards client routes; absent when they are public. */
|
|
101
|
+
readonly clientAuth?: {
|
|
102
|
+
readonly plugin: string;
|
|
103
|
+
/** The request headers its decision reads, lowercase. */
|
|
104
|
+
readonly varyHeaders: readonly string[];
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
/** What `assembleServer` runs: hot-updater.config.ts's `database`, `storage`, and `plugins`. */
|
|
108
|
+
interface AssembleServerOptions {
|
|
109
|
+
readonly database: ConfiguredDatabase;
|
|
110
|
+
readonly storage?: StorageAdapter;
|
|
111
|
+
readonly plugins?: readonly AnyHotUpdaterPlugin[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Core and the plugins over hot-updater.config.ts's database, assembled by
|
|
115
|
+
* `createHotUpdater` as the server assembles them, so the CLI's writes take
|
|
116
|
+
* the server's path. Plugins the server would refuse are refused here.
|
|
117
|
+
* Assembling reads and writes nothing, and storage that only uploads is
|
|
118
|
+
* enough: only a server mounts the handlers that serve downloads.
|
|
119
|
+
*
|
|
120
|
+
* Over `standaloneRepository(...)`, core is the server's admin API and the
|
|
121
|
+
* plugins run on the server; here they are only checked, on a database
|
|
122
|
+
* nothing reads, for what the CLI reads from them.
|
|
123
|
+
*/
|
|
124
|
+
declare function assembleServer(options: AssembleServerOptions & {
|
|
125
|
+
readonly database: EngineDatabase;
|
|
126
|
+
}): AssembledServer & {
|
|
127
|
+
readonly api: Readonly<Record<string, unknown>>;
|
|
128
|
+
};
|
|
129
|
+
declare function assembleServer(options: AssembleServerOptions): AssembledServer;
|
|
36
130
|
//#endregion
|
|
37
131
|
//#region src/banner.d.ts
|
|
38
132
|
declare const link: (url: string) => string;
|
|
@@ -68,43 +162,42 @@ type ProviderConfig = {
|
|
|
68
162
|
imports: ImportInfo[];
|
|
69
163
|
configString: string;
|
|
70
164
|
};
|
|
165
|
+
declare const renderImportStatements: (imports: ImportInfo[]) => string;
|
|
71
166
|
type ConfigBuilderScaffold = {
|
|
72
167
|
imports: ImportInfo[];
|
|
73
168
|
buildConfigString: string;
|
|
74
169
|
storageConfigString: string;
|
|
75
170
|
databaseConfigString: string;
|
|
171
|
+
pluginsConfigString: string;
|
|
76
172
|
intermediateCode: string;
|
|
77
173
|
text: string;
|
|
78
174
|
};
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
setStorage(storageConfig: ProviderConfig): this;
|
|
85
|
-
/** Sets the database configuration and adds its required imports. */
|
|
86
|
-
setDatabase(databaseConfig: ProviderConfig): this;
|
|
87
|
-
/** Sets the intermediate code block to be placed between imports and defineConfig. */
|
|
88
|
-
setIntermediateCode(code: string): this;
|
|
89
|
-
/** Assembles and returns the final configuration string. */
|
|
90
|
-
getResult(): string;
|
|
91
|
-
}
|
|
92
|
-
declare class ConfigBuilder implements IConfigBuilder {
|
|
175
|
+
/**
|
|
176
|
+
* Renders the hot-updater.config.ts init writes: the build, the server's
|
|
177
|
+
* storage, database, and plugins, and the deploy settings.
|
|
178
|
+
*/
|
|
179
|
+
declare class ConfigBuilder {
|
|
93
180
|
private buildType;
|
|
94
181
|
private storageInfo;
|
|
95
182
|
private databaseInfo;
|
|
183
|
+
private pluginsInfo;
|
|
96
184
|
private intermediateCode;
|
|
97
|
-
private
|
|
98
|
-
|
|
185
|
+
private readonly imports;
|
|
186
|
+
/** Adds an import, such as a credentials helper's. */
|
|
99
187
|
addImport(info: ImportInfo): this;
|
|
100
|
-
private addImports;
|
|
101
|
-
private getImportInfos;
|
|
102
188
|
private generateBuildConfigString;
|
|
189
|
+
/** Sets the build type ('bare', 'rock', or 'expo') and its import. */
|
|
103
190
|
setBuildType(buildType: BuildType): this;
|
|
191
|
+
/** Sets the storage the CLI uploads to, which the server lists, and its imports. */
|
|
104
192
|
setStorage(storageConfig: ProviderConfig): this;
|
|
193
|
+
/** Sets the server's database and its imports. */
|
|
105
194
|
setDatabase(databaseConfig: ProviderConfig): this;
|
|
195
|
+
/** Sets the plugins the server runs, such as a provider package's `plugins`. */
|
|
196
|
+
setPlugins(pluginsConfig: ProviderConfig): this;
|
|
197
|
+
/** Sets the code between the environment loading and the config, such as a credentials helper. */
|
|
106
198
|
setIntermediateCode(code: string): this;
|
|
107
199
|
getScaffold(): ConfigBuilderScaffold;
|
|
200
|
+
/** hot-updater.config.ts's text. */
|
|
108
201
|
getResult(): string;
|
|
109
202
|
}
|
|
110
203
|
//#endregion
|
|
@@ -163,41 +256,16 @@ declare const copyDirToTmp: (dir: string, childDirname?: string) => Promise<{
|
|
|
163
256
|
}>;
|
|
164
257
|
//#endregion
|
|
165
258
|
//#region src/createTarBr.d.ts
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
path: string;
|
|
169
|
-
name: string;
|
|
170
|
-
}[];
|
|
171
|
-
outfile: string;
|
|
172
|
-
}) => Promise<string>;
|
|
173
|
-
declare const createTarBr: ({ outfile, targetDir, excludeExts }: {
|
|
174
|
-
targetDir: string;
|
|
259
|
+
/** Build the one supported bulk transport from the exact manifest file set. */
|
|
260
|
+
declare function createTarBrTargetFiles({ outfile, targetFiles }: {
|
|
175
261
|
outfile: string;
|
|
176
|
-
excludeExts?: string[];
|
|
177
|
-
}) => Promise<string>;
|
|
178
|
-
//#endregion
|
|
179
|
-
//#region src/createTarGz.d.ts
|
|
180
|
-
declare const createTarGzTargetFiles: ({ outfile, targetFiles }: {
|
|
181
262
|
targetFiles: {
|
|
182
263
|
path: string;
|
|
183
264
|
name: string;
|
|
184
265
|
}[];
|
|
185
|
-
|
|
186
|
-
}) => Promise<string>;
|
|
187
|
-
declare const createTarGz: ({ outfile, targetDir, excludeExts }: {
|
|
188
|
-
targetDir: string;
|
|
189
|
-
outfile: string;
|
|
190
|
-
excludeExts?: string[];
|
|
191
|
-
}) => Promise<string>;
|
|
266
|
+
}): Promise<ManifestArchive>;
|
|
192
267
|
//#endregion
|
|
193
268
|
//#region src/createZip.d.ts
|
|
194
|
-
declare const createZipTargetFiles: ({ outfile, targetFiles }: {
|
|
195
|
-
targetFiles: {
|
|
196
|
-
path: string;
|
|
197
|
-
name: string;
|
|
198
|
-
}[];
|
|
199
|
-
outfile: string;
|
|
200
|
-
}) => Promise<string>;
|
|
201
269
|
declare const createZip: ({ outfile, targetDir, excludeExts }: {
|
|
202
270
|
targetDir: string;
|
|
203
271
|
outfile: string;
|
|
@@ -249,6 +317,7 @@ type CreateHotUpdaterConfigScaffoldOptions = {
|
|
|
249
317
|
build: BuildType;
|
|
250
318
|
storage: ProviderConfig;
|
|
251
319
|
database: ProviderConfig;
|
|
320
|
+
plugins: ProviderConfig;
|
|
252
321
|
extraImports?: ImportInfo[];
|
|
253
322
|
helperStatements?: ManagedHelperStatement[];
|
|
254
323
|
updateStrategy?: "appVersion" | "fingerprint";
|
|
@@ -272,6 +341,10 @@ type HotUpdaterConfigScaffold = {
|
|
|
272
341
|
initializer: string;
|
|
273
342
|
callee: string;
|
|
274
343
|
};
|
|
344
|
+
/** The plugins the server runs, such as a provider package's `plugins`. */
|
|
345
|
+
plugins: {
|
|
346
|
+
initializer: string;
|
|
347
|
+
};
|
|
275
348
|
helperStatements: ManagedHelperStatement[];
|
|
276
349
|
updateStrategy: string;
|
|
277
350
|
};
|
|
@@ -280,9 +353,28 @@ type WriteHotUpdaterConfigResult = {
|
|
|
280
353
|
path: string;
|
|
281
354
|
reason?: string;
|
|
282
355
|
};
|
|
283
|
-
declare const createHotUpdaterConfigScaffold: ({ build, storage, database, extraImports, helperStatements, updateStrategy }: CreateHotUpdaterConfigScaffoldOptions) => HotUpdaterConfigScaffold;
|
|
356
|
+
declare const createHotUpdaterConfigScaffold: ({ build, storage, database, plugins, extraImports, helperStatements, updateStrategy }: CreateHotUpdaterConfigScaffoldOptions) => HotUpdaterConfigScaffold;
|
|
284
357
|
declare const createHotUpdaterConfigScaffoldFromBuilder: (builder: ConfigBuilder, { helperStatements, updateStrategy }?: CreateHotUpdaterConfigScaffoldFromBuilderOptions) => HotUpdaterConfigScaffold;
|
|
358
|
+
/**
|
|
359
|
+
* Writes hot-updater.config.ts: the scaffold's when there is none, or the
|
|
360
|
+
* existing config with the scaffold's build, storage, database, plugins, and
|
|
361
|
+
* helpers merged in, keeping the project's own settings.
|
|
362
|
+
*/
|
|
285
363
|
declare const writeHotUpdaterConfig: (scaffold: HotUpdaterConfigScaffold, filePath?: string) => Promise<WriteHotUpdaterConfigResult>;
|
|
364
|
+
/**
|
|
365
|
+
* Writes hot-updater.config.ts and says what it did. `settings` names the
|
|
366
|
+
* provider in messages, such as "Supabase". A config it cannot merge is
|
|
367
|
+
* kept, with what to add to it. The plugins file an older init wrote is
|
|
368
|
+
* removed; one the project wrote is named, since nothing reads it.
|
|
369
|
+
*/
|
|
370
|
+
declare const writeHotUpdaterFiles: (scaffold: HotUpdaterConfigScaffold, { cwd, settings }: {
|
|
371
|
+
cwd?: string;
|
|
372
|
+
settings: string;
|
|
373
|
+
}) => Promise<{
|
|
374
|
+
readonly config: WriteHotUpdaterConfigResult;
|
|
375
|
+
/** What became of hotUpdater.plugins.ts, when there was one. */
|
|
376
|
+
readonly pluginsFile?: "removed" | "kept";
|
|
377
|
+
}>;
|
|
286
378
|
//#endregion
|
|
287
379
|
//#region src/hotUpdaterEnv.d.ts
|
|
288
380
|
type HotUpdaterInitEnv = {
|
|
@@ -430,7 +522,7 @@ declare const createLogWriter: ({ prefix, logFilePath }: {
|
|
|
430
522
|
}) => Promise<HotUpdaterLogWriter>;
|
|
431
523
|
//#endregion
|
|
432
524
|
//#region src/localBundleSigning.d.ts
|
|
433
|
-
declare const normalizeSigningConfig: (signing: SigningConfig | undefined) =>
|
|
525
|
+
declare const normalizeSigningConfig: (signing: SigningConfig | undefined) => BundleSigningAdapter | Extract<LocalSigningConfig, {
|
|
434
526
|
enabled: true;
|
|
435
527
|
}> | undefined;
|
|
436
528
|
//#endregion
|
|
@@ -439,10 +531,125 @@ type HotUpdaterConfigOptions = {
|
|
|
439
531
|
platform: Platform;
|
|
440
532
|
channel: string;
|
|
441
533
|
} | null;
|
|
442
|
-
type ConfigResponse = RequiredDeep<Omit<ConfigInput, "database" | "
|
|
534
|
+
type ConfigResponse = RequiredDeep<Omit<ConfigInput, "database" | "storage" | "plugins" | "signing">> & {
|
|
535
|
+
/** The server's database, or `standaloneRepository(...)`; absent when the config names none. */
|
|
536
|
+
database?: ConfiguredDatabase;
|
|
537
|
+
/** Where the CLI uploads bundles; absent when the config names none. */
|
|
538
|
+
storage?: StorageAdapter;
|
|
539
|
+
/** The plugins the server runs; none when the config lists none. */
|
|
540
|
+
plugins: readonly AnyHotUpdaterPlugin[];
|
|
443
541
|
signing?: ReturnType<typeof normalizeSigningConfig>;
|
|
444
542
|
};
|
|
445
543
|
declare const loadConfig: (options: HotUpdaterConfigOptions) => Promise<ConfigResponse>;
|
|
544
|
+
/**
|
|
545
|
+
* hot-updater.config for each of `platforms`, with the file loaded once. A
|
|
546
|
+
* config object gives every platform the same database, storage, and
|
|
547
|
+
* plugins; a config function runs once per platform, so the adapters it
|
|
548
|
+
* creates are that platform's own.
|
|
549
|
+
*/
|
|
550
|
+
declare const loadPlatformConfigs: <TPlatform extends Platform>(platforms: readonly TPlatform[], { channel }: {
|
|
551
|
+
readonly channel: string;
|
|
552
|
+
}) => Promise<{
|
|
553
|
+
readonly platform: TPlatform;
|
|
554
|
+
readonly config: ConfigResponse;
|
|
555
|
+
}[]>;
|
|
556
|
+
//#endregion
|
|
557
|
+
//#region src/serverDefinition.d.ts
|
|
558
|
+
/** A plugin's endpoint on a server's `handlers.client`. */
|
|
559
|
+
interface ServerClientEndpoint {
|
|
560
|
+
/** The id of the plugin that adds it. */
|
|
561
|
+
readonly plugin: string;
|
|
562
|
+
readonly method: string;
|
|
563
|
+
/** Relative to the handler's mount; `:name` segments are parameters. */
|
|
564
|
+
readonly path: string;
|
|
565
|
+
}
|
|
566
|
+
/**
|
|
567
|
+
* A server definition as tooling reads it: the `hotUpdater` that
|
|
568
|
+
* `createHotUpdater` from `@hot-updater/server` returns, through its
|
|
569
|
+
* public properties.
|
|
570
|
+
*/
|
|
571
|
+
interface ServerDefinition {
|
|
572
|
+
/** The database as configured, with the tooling `hot-updater db` runs. */
|
|
573
|
+
readonly database: ToolingDatabase;
|
|
574
|
+
/** The storage as configured, in order. */
|
|
575
|
+
readonly storage: readonly StorageAdapter[];
|
|
576
|
+
readonly plugins: readonly AnyHotUpdaterPlugin[];
|
|
577
|
+
/** The client plugins an app adds for the plugins: what init prints. */
|
|
578
|
+
readonly clientPlugins: readonly PluginClientPlugin[];
|
|
579
|
+
/** The plugins' client endpoints, which a host that routes by path sends to the server. */
|
|
580
|
+
readonly clientEndpoints: readonly ServerClientEndpoint[];
|
|
581
|
+
/** The plugin that guards client routes; absent when they are public. */
|
|
582
|
+
readonly clientAuth?: {
|
|
583
|
+
readonly plugin: string;
|
|
584
|
+
/** The request headers its decision reads, lowercase. */
|
|
585
|
+
readonly varyHeaders: readonly string[];
|
|
586
|
+
};
|
|
587
|
+
/** Core's API, on the server's own path. */
|
|
588
|
+
readonly core: HotUpdaterCoreApi;
|
|
589
|
+
/** Each plugin's API by plugin id. */
|
|
590
|
+
readonly api: Readonly<Record<string, unknown>>;
|
|
591
|
+
}
|
|
592
|
+
/** A server definition tooling cannot use, with what to do about it. */
|
|
593
|
+
declare class ServerDefinitionError extends Error {
|
|
594
|
+
readonly name = "ServerDefinitionError";
|
|
595
|
+
}
|
|
596
|
+
/** Whether `value` has the public properties tooling reads from a server definition. */
|
|
597
|
+
declare const isServerDefinition: (value: unknown) => value is ServerDefinition;
|
|
598
|
+
/**
|
|
599
|
+
* `value` as a server definition, or a `ServerDefinitionError` that says
|
|
600
|
+
* what `source`, the module it came from, must export instead.
|
|
601
|
+
*/
|
|
602
|
+
declare const serverDefinitionOf: (value: unknown, source?: string) => ServerDefinition;
|
|
603
|
+
/** The credential an app sends to client routes. */
|
|
604
|
+
interface ClientCredentialSpec {
|
|
605
|
+
/** Its name in output, such as "API key". */
|
|
606
|
+
readonly label: string;
|
|
607
|
+
/** The request header that carries it, lowercase. */
|
|
608
|
+
readonly header: string;
|
|
609
|
+
/** The environment variable init stores it in. */
|
|
610
|
+
readonly env: string;
|
|
611
|
+
}
|
|
612
|
+
/** The client-route policy a definition's plugins set, as tooling needs it. */
|
|
613
|
+
interface ClientAuthSpec {
|
|
614
|
+
/** The plugin that provides clientAuth. */
|
|
615
|
+
readonly plugin: string;
|
|
616
|
+
/** The request headers its decision reads, lowercase: what caches key on. */
|
|
617
|
+
readonly varyHeaders: readonly string[];
|
|
618
|
+
readonly credential: ClientCredentialSpec;
|
|
619
|
+
}
|
|
620
|
+
interface ProvisionedClientCredential extends ClientCredentialSpec {
|
|
621
|
+
readonly value: string;
|
|
622
|
+
}
|
|
623
|
+
type CredentialSource = Pick<ServerDefinition, "plugins" | "clientAuth">;
|
|
624
|
+
/**
|
|
625
|
+
* The client-route policy a definition's plugins set: the plugin that
|
|
626
|
+
* provides clientAuth, the headers its decision reads, and the credential an
|
|
627
|
+
* app sends. Undefined when client routes are public.
|
|
628
|
+
*/
|
|
629
|
+
declare const clientAuthOf: (definition: CredentialSource) => ClientAuthSpec | undefined;
|
|
630
|
+
/**
|
|
631
|
+
* A new client credential, made without a database, so tooling can save it
|
|
632
|
+
* before it registers it. Undefined when client routes are public.
|
|
633
|
+
*/
|
|
634
|
+
declare const generateClientCredential: (definition: CredentialSource) => string | undefined;
|
|
635
|
+
/**
|
|
636
|
+
* Provisions the credential an app sends to client routes, through the
|
|
637
|
+
* plugin that provides clientAuth, on the definition's database: a
|
|
638
|
+
* credential saved in `env` is registered again rather than replaced.
|
|
639
|
+
* Undefined when client routes are public.
|
|
640
|
+
*/
|
|
641
|
+
declare const provisionClientCredential: (definition: CredentialSource & Pick<ServerDefinition, "api">, input: {
|
|
642
|
+
readonly env: Readonly<Record<string, string | undefined>>;
|
|
643
|
+
/** Names the credential where the plugin stores one. */
|
|
644
|
+
readonly name: string;
|
|
645
|
+
}) => Promise<ProvisionedClientCredential | undefined>;
|
|
646
|
+
type ToolingSource = Pick<ServerDefinition, "database" | "plugins">;
|
|
647
|
+
/** Whether `hot-updater db generate` writes schema files for a definition's database. */
|
|
648
|
+
declare const generatesSchema: ({ database }: Pick<ServerDefinition, "database">) => boolean;
|
|
649
|
+
/** The migrator for a definition's database: core's tables and its plugins' tables. */
|
|
650
|
+
declare const createMigrator: ({ database, plugins }: ToolingSource) => Migrator;
|
|
651
|
+
/** The schema file `hot-updater db generate` writes for a definition's database. */
|
|
652
|
+
declare const generateSchema: ({ database, plugins }: ToolingSource, version: Parameters<SchemaGenerator>[0], name?: Parameters<SchemaGenerator>[1]) => ReturnType<SchemaGenerator>;
|
|
446
653
|
//#endregion
|
|
447
654
|
//#region src/log.d.ts
|
|
448
655
|
declare const log: {
|
|
@@ -464,26 +671,35 @@ declare const makeEnv: (newEnvVars: Record<string, EnvVarValue>, filePath?: stri
|
|
|
464
671
|
readonly removeKeys?: readonly string[];
|
|
465
672
|
}) => Promise<string>;
|
|
466
673
|
//#endregion
|
|
674
|
+
//#region src/moduleSpecifiers.d.ts
|
|
675
|
+
/**
|
|
676
|
+
* The modules `source` imports or re-exports, statically or with an
|
|
677
|
+
* `import()` of a string literal or a template without substitutions: what a
|
|
678
|
+
* runtime that loads it unbundled, such as Deno through an import map,
|
|
679
|
+
* resolves. An `import()` of a computed specifier, such as
|
|
680
|
+
* `import("dayjs/locale/" + name + ".js")`, names no module to resolve.
|
|
681
|
+
* Minified code reads the same as formatted code. `fileName` gives the
|
|
682
|
+
* language, such as `.ts`.
|
|
683
|
+
*/
|
|
684
|
+
declare const moduleSpecifiersOf: (fileName: string, source: string) => string[];
|
|
685
|
+
//#endregion
|
|
467
686
|
//#region src/promoteBundle.d.ts
|
|
468
|
-
type
|
|
687
|
+
type PromoteStorageAdapter = StorageAdapterWith<"get" | "put" | "exists" | "delete">;
|
|
469
688
|
declare const LEGACY_BUNDLE_ERROR = "This OTA bundle was created by a version that does not support manifest.json. Copy bundle is not available.";
|
|
470
|
-
declare function
|
|
689
|
+
declare function createCopiedBundleArtifacts({ bundle, config, nextBundleId, storageAdapter }: {
|
|
471
690
|
bundle: Bundle;
|
|
472
691
|
config: ConfigResponse;
|
|
473
692
|
nextBundleId: string;
|
|
474
|
-
|
|
693
|
+
storageAdapter: PromoteStorageAdapter;
|
|
475
694
|
}): Promise<{
|
|
476
695
|
bundle: {
|
|
477
696
|
id: string;
|
|
478
|
-
|
|
479
|
-
storageUri: string;
|
|
480
|
-
fileHash: string;
|
|
481
|
-
metadata: import("@hot-updater/core").BundleMetadata | undefined;
|
|
697
|
+
metadata: import("@hot-updater/protocol").BundleMetadata | undefined;
|
|
482
698
|
assetBaseStorageUri: string;
|
|
483
699
|
patches: never[];
|
|
484
700
|
manifestFileHash: string;
|
|
485
701
|
manifestStorageUri: string;
|
|
486
|
-
platform: import("@hot-updater/
|
|
702
|
+
platform: import("@hot-updater/protocol").Platform;
|
|
487
703
|
gitCommitHash: string | null;
|
|
488
704
|
};
|
|
489
705
|
uploadedStorageUris: string[];
|
|
@@ -512,7 +728,7 @@ interface InternalClackSettings {
|
|
|
512
728
|
};
|
|
513
729
|
};
|
|
514
730
|
}
|
|
515
|
-
declare const settings: InternalClackSettings;
|
|
731
|
+
declare const settings$1: InternalClackSettings;
|
|
516
732
|
interface ClackSettings {
|
|
517
733
|
/**
|
|
518
734
|
* Set custom global aliases for the default actions.
|
|
@@ -776,7 +992,7 @@ declare class AutocompletePrompt<T extends OptionLike$1> extends Prompt<T['value
|
|
|
776
992
|
type DateFormat = 'YMD' | 'MDY' | 'DMY';
|
|
777
993
|
declare function isCancel(value: unknown): value is symbol;
|
|
778
994
|
declare namespace index_d_exports {
|
|
779
|
-
export { AutocompleteMultiSelectOptions, AutocompleteOptions, BoxAlignment, BoxOptions, ClackSettings, CommonOptions, ConfirmOptions, DateFormat, DateOptions, GroupMultiSelectOptions, LimitOptionsParams, LogMessageOptions, MULTISELECT_INSTRUCTIONS, MultiLineOptions, MultiSelectOptions, NoteOptions, Option, PasswordOptions, PathOptions, ProgressOptions, ProgressResult, PromptGroup, PromptGroupAwaitedReturn, PromptGroupOptions, SELECT_INSTRUCTIONS, S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, SelectKeyOptions, SelectOptions, SpinnerOptions, SpinnerResult, Task, TaskLogCompletionOptions, TaskLogMessageOptions, TaskLogOptions, TextOptions, autocomplete, autocompleteMultiselect, box, cancel, confirm, date, formatInstructionFooter, group, groupMultiselect, intro, isCI, isCancel, isTTY, limitOptions, log$1 as log, multiline, multiselect, note, outro, password, path, progress, select, selectKey, settings, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr, updateSettings };
|
|
995
|
+
export { AutocompleteMultiSelectOptions, AutocompleteOptions, BoxAlignment, BoxOptions, ClackSettings, CommonOptions, ConfirmOptions, DateFormat, DateOptions, GroupMultiSelectOptions, LimitOptionsParams, LogMessageOptions, MULTISELECT_INSTRUCTIONS, MultiLineOptions, MultiSelectOptions, NoteOptions, Option, PasswordOptions, PathOptions, ProgressOptions, ProgressResult, PromptGroup, PromptGroupAwaitedReturn, PromptGroupOptions, SELECT_INSTRUCTIONS, S_BAR, S_BAR_END, S_BAR_END_RIGHT, S_BAR_H, S_BAR_START, S_BAR_START_RIGHT, S_CHECKBOX_ACTIVE, S_CHECKBOX_INACTIVE, S_CHECKBOX_SELECTED, S_CONNECT_LEFT, S_CORNER_BOTTOM_LEFT, S_CORNER_BOTTOM_RIGHT, S_CORNER_TOP_LEFT, S_CORNER_TOP_RIGHT, S_ERROR, S_INFO, S_PASSWORD_MASK, S_RADIO_ACTIVE, S_RADIO_INACTIVE, S_STEP_ACTIVE, S_STEP_CANCEL, S_STEP_ERROR, S_STEP_SUBMIT, S_SUCCESS, S_WARN, SelectKeyOptions, SelectOptions, SpinnerOptions, SpinnerResult, Task, TaskLogCompletionOptions, TaskLogMessageOptions, TaskLogOptions, TextOptions, autocomplete, autocompleteMultiselect, box, cancel, confirm, date, formatInstructionFooter, group, groupMultiselect, intro, isCI, isCancel, isTTY, limitOptions, log$1 as log, multiline, multiselect, note, outro, password, path, progress, select, selectKey, settings$1 as settings, spinner, stream, symbol, symbolBar, taskLog, tasks, text, unicode, unicodeOr, updateSettings };
|
|
780
996
|
}
|
|
781
997
|
declare const unicode: boolean;
|
|
782
998
|
declare const isCI: () => boolean;
|
|
@@ -1710,10 +1926,10 @@ declare const resolveHotUpdaterServerVersion: (currentPackageName: string, optio
|
|
|
1710
1926
|
//#endregion
|
|
1711
1927
|
//#region src/storageFiles.d.ts
|
|
1712
1928
|
declare const getStorageFileByteSize: (filePath: string) => Promise<number>;
|
|
1713
|
-
declare const putStorageFile: (storage:
|
|
1929
|
+
declare const putStorageFile: (storage: StorageAdapterWith<"put">, key: string, filePath: string) => Promise<StoragePutResult & {
|
|
1714
1930
|
byteSize: number;
|
|
1715
1931
|
}>;
|
|
1716
|
-
declare const writeStorageFile: (storage:
|
|
1932
|
+
declare const writeStorageFile: (storage: StorageAdapterWith<"get">, storageUri: string, filePath: string) => Promise<void>;
|
|
1717
1933
|
declare const writeStorageResponseFile: (response: Response, filePath: string) => Promise<void>;
|
|
1718
1934
|
//#endregion
|
|
1719
1935
|
//#region src/transformEnv.d.ts
|
|
@@ -1733,4 +1949,4 @@ type TransformTemplateArgs<T extends string> = { [Key in ExtractPlaceholders<T>]
|
|
|
1733
1949
|
*/
|
|
1734
1950
|
declare function transformTemplate<T extends string>(templateString: T, values: TransformTemplateArgs<T>): string;
|
|
1735
1951
|
//#endregion
|
|
1736
|
-
export { BuildLogger, BuildLoggerConfig, BuildType, BundleSigningSession, ConfigBuilder, ConfigBuilderScaffold, ConfigResponse, CreateHotUpdaterConfigScaffoldFromBuilderOptions, CreateHotUpdaterConfigScaffoldOptions, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdateDirUtil, HotUpdaterConfigOptions, HotUpdaterConfigScaffold, HotUpdaterInitEnv, HotUpdaterLogWriter,
|
|
1952
|
+
export { AppClientCredential, AppClientPlugin, AssembleServerOptions, AssembledServer, BuildLogger, BuildLoggerConfig, BuildType, BundleSigningSession, ClientAuthSpec, ClientCredentialSpec, ConfigBuilder, ConfigBuilderScaffold, ConfigResponse, CreateHotUpdaterConfigScaffoldFromBuilderOptions, CreateHotUpdaterConfigScaffoldOptions, HOT_UPDATER_SERVER_PACKAGE_VERSION_ENV, HotUpdateDirUtil, HotUpdaterConfigOptions, HotUpdaterConfigScaffold, HotUpdaterInitEnv, HotUpdaterLogWriter, ImportInfo, InitEnvFileError, InitError, InitProviderDefinition, InitProviderInputDefinition, InitProviderInputPersistence, LEGACY_BUNDLE_ERROR, LegacyInfrastructureError, ManagedHelperStatement, ManagedHelperStrategy, MissingInitInputsError, PromptProgress, PromptSpinner, ProviderConfig, ProvisionedClientCredential, ReactNativeMetadata, ReadPackageUpResult, RunInitOptions, ServerClientEndpoint, ServerDefinition, ServerDefinitionError, WriteHotUpdaterConfigResult, assembleServer, assertInfrastructureGenerationAtUrl, assertInfrastructureGenerationPayload, assertInitInputs, assertInitProviderInputs, banner, clientAuthOf, typedColors as colors, confirmInitInputPersistence, copyDirToTmp, createCopiedBundleArtifacts, createHotUpdaterConfigScaffold, createHotUpdaterConfigScaffoldFromBuilder, createLogWriter, createMigrator, createTarBrTargetFiles, createZip, decryptJson, defineInitProvider, encryptJson, ensureInstallPackages, generateClientCredential, generateSchema, generatesSchema, getAndroidSdkPath, getBundleSigningPublicKey, getCwd, getHotUpdaterEnvValue, getHotUpdaterInitInputEnv, getInitProviderEnvVars, getInitProviderTextPromptValues, getMissingInitInputs, getMissingInitProviderInputs, getPackageManager, getReactNativeMetadatas, getStorageFileByteSize, isServerDefinition, link, loadConfig, loadPlatformConfigs, log, makeEnv, moduleSpecifiersOf, p, prepareBundleSigning, printAppSetup, printBanner, provisionClientCredential, putStorageFile, readBundleSigningPublicKeyFile, readHotUpdaterEnv, readHotUpdaterInitEnv, readPackageUp, renderAppImports, renderAppSetup, renderImportStatements, resolveHotUpdaterServerVersion, resolveInitProviderInput, resolveInitProviderInputs, resolvePackageVersion, serverDefinitionOf, shouldAutoSelectOnlyInitResource, stripAnsi, transformEnv, transformTemplate, writeHotUpdaterConfig, writeHotUpdaterFiles, writeStorageFile, writeStorageResponseFile };
|