@hot-updater/plugin-core 1.2.0-rc.5 → 1.2.0-rc.51
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/coreApi.d.cts +277 -10
- package/dist/coreApi.d.mts +277 -10
- package/dist/database/adapter.d.cts +24 -0
- package/dist/database/adapter.d.mts +24 -0
- package/dist/databaseRows.cjs +4 -2
- package/dist/databaseRows.mjs +4 -2
- package/dist/engine/core/schema.cjs +253 -6
- package/dist/engine/core/schema.d.cts +154 -1
- package/dist/engine/core/schema.d.mts +154 -1
- package/dist/engine/core/schema.mjs +252 -7
- package/dist/engine/createEngine.cjs +1 -2
- package/dist/engine/createEngine.d.cts +1 -6
- package/dist/engine/createEngine.d.mts +1 -6
- package/dist/engine/createEngine.mjs +1 -2
- package/dist/engine/database/aggregateBatching.cjs +87 -129
- package/dist/engine/database/aggregateBatching.mjs +87 -129
- package/dist/engine/database/database.cjs +1 -4
- package/dist/engine/database/database.mjs +1 -4
- package/dist/engine/database/engineTransaction.cjs +21 -1
- package/dist/engine/database/engineTransaction.d.cts +5 -1
- package/dist/engine/database/engineTransaction.d.mts +5 -1
- package/dist/engine/database/engineTransaction.mjs +21 -1
- package/dist/engine/database/kv/kvAdapter.cjs +80 -4
- package/dist/engine/database/kv/kvAdapter.mjs +80 -4
- package/dist/engine/database/resolveSchema.cjs +6 -3
- package/dist/engine/database/resolveSchema.mjs +6 -3
- package/dist/engine/database/sql/sqlAdapter.cjs +36 -12
- package/dist/engine/database/sql/sqlAdapter.mjs +37 -13
- package/dist/engine/database/sql/sqlSchema.cjs +24 -6
- package/dist/engine/database/sql/sqlSchema.d.cts +1 -1
- package/dist/engine/database/sql/sqlSchema.d.mts +1 -1
- package/dist/engine/database/sql/sqlSchema.mjs +24 -6
- package/dist/engine/db/coreDatabase.cjs +10 -5
- package/dist/engine/db/coreDatabase.d.cts +2 -1
- package/dist/engine/db/coreDatabase.d.mts +2 -1
- package/dist/engine/db/coreDatabase.mjs +10 -5
- package/dist/engine/db/engineMigrator.cjs +45 -17
- package/dist/engine/db/engineMigrator.mjs +46 -18
- package/dist/engine/db/engineSql.cjs +25 -0
- package/dist/engine/db/engineSql.d.cts +13 -1
- package/dist/engine/db/engineSql.d.mts +13 -1
- package/dist/engine/db/engineSql.mjs +26 -2
- package/dist/engine/db/engineSqlMigrator.cjs +60 -21
- package/dist/engine/db/engineSqlMigrator.d.cts +2 -0
- package/dist/engine/db/engineSqlMigrator.d.mts +2 -0
- package/dist/engine/db/engineSqlMigrator.mjs +62 -23
- package/dist/engine/db/schemaSettings.cjs +56 -5
- package/dist/engine/db/schemaSettings.d.cts +5 -2
- package/dist/engine/db/schemaSettings.d.mts +5 -2
- package/dist/engine/db/schemaSettings.mjs +55 -6
- package/dist/engine/db/settingsMigrator.cjs +124 -15
- package/dist/engine/db/settingsMigrator.d.cts +18 -8
- package/dist/engine/db/settingsMigrator.d.mts +18 -8
- package/dist/engine/db/settingsMigrator.mjs +121 -16
- package/dist/engine/db/sqlSchemaState.cjs +136 -0
- package/dist/engine/db/sqlSchemaState.mjs +131 -0
- package/dist/engine/db/types.d.cts +6 -0
- package/dist/engine/db/types.d.mts +6 -0
- package/dist/index.cjs +3 -8
- package/dist/index.d.cts +6 -7
- package/dist/index.d.mts +6 -7
- package/dist/index.mjs +4 -5
- package/dist/releaseCatalogCompiler.cjs +18 -7
- package/dist/releaseCatalogCompiler.mjs +18 -7
- package/dist/releaseCatalogMutation.d.cts +6 -0
- package/dist/releaseCatalogMutation.d.mts +6 -0
- package/dist/serverPlugin/coreReads.d.cts +10 -1
- package/dist/serverPlugin/coreReads.d.mts +10 -1
- package/dist/serverPlugin/definitions.d.cts +4 -0
- package/dist/serverPlugin/definitions.d.mts +4 -0
- package/dist/serverPlugin/schema.d.cts +4 -0
- package/dist/serverPlugin/schema.d.mts +4 -0
- package/dist/types/databaseConfig.d.cts +10 -20
- package/dist/types/databaseConfig.d.mts +10 -20
- package/dist/types/databaseRows.d.cts +77 -2
- package/dist/types/databaseRows.d.mts +77 -2
- package/dist/types/index.cjs +3 -0
- package/dist/types/index.d.cts +114 -56
- package/dist/types/index.d.mts +114 -56
- package/dist/types/index.mjs +3 -1
- package/dist/types/models.d.cts +9 -1
- package/dist/types/models.d.mts +9 -1
- package/dist/types/public.d.cts +3 -3
- package/dist/types/public.d.mts +3 -3
- package/package.json +3 -9
- package/dist/remoteBundleSigning.cjs +0 -357
- package/dist/remoteBundleSigning.d.cts +0 -38
- package/dist/remoteBundleSigning.d.mts +0 -38
- package/dist/remoteBundleSigning.mjs +0 -352
|
@@ -21,6 +21,10 @@ interface DerivedDefinition<TRow = never, TType extends FieldType = FieldType> {
|
|
|
21
21
|
readonly type: TType;
|
|
22
22
|
/** Up to 16 values; the row is indexed once per value. */
|
|
23
23
|
readonly multi?: true;
|
|
24
|
+
/** Strings: the maximum length; unbounded text when absent. */
|
|
25
|
+
readonly maxLength?: number;
|
|
26
|
+
/** Strings: ASCII only, so a long key fits MySQL's 3,072-byte index limit. */
|
|
27
|
+
readonly ascii?: true;
|
|
24
28
|
/** Null, or an empty list, leaves the row out of indexes on this field. */
|
|
25
29
|
compute(row: TRow): FieldValue<TType> | null | readonly FieldValue<TType>[];
|
|
26
30
|
}
|
|
@@ -3,28 +3,17 @@ import { RetryOptions } from "../engine/database/engineTransaction.cjs";
|
|
|
3
3
|
import { HotUpdaterCoreApi } from "../coreApi.cjs";
|
|
4
4
|
//#region src/types/databaseConfig.d.ts
|
|
5
5
|
/**
|
|
6
|
-
* How changes to aggregates declared `batched` reach their rows:
|
|
7
|
-
* transaction
|
|
8
|
-
*
|
|
9
|
-
* (DynamoDB, Firestore) batch them.
|
|
6
|
+
* How changes to aggregates declared `batched` reach their rows: each
|
|
7
|
+
* transaction writes its changes as one log row, and a compaction merges
|
|
8
|
+
* pending log rows into one write per aggregate row. Databases that bill each
|
|
9
|
+
* write (DynamoDB, Firestore, Cosmos DB) batch them.
|
|
10
10
|
*/
|
|
11
11
|
interface AggregateBatching {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* aggregates
|
|
16
|
-
* changes
|
|
17
|
-
* rows, but a crash loses up to one window, and a runtime that freezes
|
|
18
|
-
* or drops the process between requests (Lambda, Cloud Functions,
|
|
19
|
-
* Workers) loses more, so use it only on a long-lived server.
|
|
20
|
-
*/
|
|
21
|
-
readonly mode?: "log" | "memory";
|
|
22
|
-
/**
|
|
23
|
-
* How long changes wait before a compaction or a flush: `"log"` compacts
|
|
24
|
-
* after a commit once this has passed since the last compaction, 60
|
|
25
|
-
* seconds by default, and `"memory"` flushes this often, 15 seconds by
|
|
26
|
-
* default. A read that cannot compact (read-only credentials) shows
|
|
27
|
-
* aggregates that can leave out up to one window of the latest changes.
|
|
13
|
+
* A commit compacts once this has passed since the last compaction, 60
|
|
14
|
+
* seconds by default. A read compacts first; one that cannot (read-only
|
|
15
|
+
* credentials) shows aggregates that can leave out up to one window of the
|
|
16
|
+
* latest changes.
|
|
28
17
|
*/
|
|
29
18
|
readonly windowMs?: number;
|
|
30
19
|
}
|
|
@@ -46,7 +35,8 @@ interface EngineDatabase {
|
|
|
46
35
|
/**
|
|
47
36
|
* How a transaction that conflicts with another write runs again. A store
|
|
48
37
|
* many writers contend on, such as DynamoDB under a burst of events, can
|
|
49
|
-
* take more attempts; `onRetry` observes each rerun.
|
|
38
|
+
* take more attempts; `onRetry` observes each rerun. An aggregate write
|
|
39
|
+
* that lost to another writer's commit is resent without spending one.
|
|
50
40
|
*/
|
|
51
41
|
readonly retry?: RetryOptions;
|
|
52
42
|
dispose?(): Promise<void>;
|
|
@@ -3,28 +3,17 @@ import { RetryOptions } from "../engine/database/engineTransaction.mjs";
|
|
|
3
3
|
import { HotUpdaterCoreApi } from "../coreApi.mjs";
|
|
4
4
|
//#region src/types/databaseConfig.d.ts
|
|
5
5
|
/**
|
|
6
|
-
* How changes to aggregates declared `batched` reach their rows:
|
|
7
|
-
* transaction
|
|
8
|
-
*
|
|
9
|
-
* (DynamoDB, Firestore) batch them.
|
|
6
|
+
* How changes to aggregates declared `batched` reach their rows: each
|
|
7
|
+
* transaction writes its changes as one log row, and a compaction merges
|
|
8
|
+
* pending log rows into one write per aggregate row. Databases that bill each
|
|
9
|
+
* write (DynamoDB, Firestore, Cosmos DB) batch them.
|
|
10
10
|
*/
|
|
11
11
|
interface AggregateBatching {
|
|
12
12
|
/**
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* aggregates
|
|
16
|
-
* changes
|
|
17
|
-
* rows, but a crash loses up to one window, and a runtime that freezes
|
|
18
|
-
* or drops the process between requests (Lambda, Cloud Functions,
|
|
19
|
-
* Workers) loses more, so use it only on a long-lived server.
|
|
20
|
-
*/
|
|
21
|
-
readonly mode?: "log" | "memory";
|
|
22
|
-
/**
|
|
23
|
-
* How long changes wait before a compaction or a flush: `"log"` compacts
|
|
24
|
-
* after a commit once this has passed since the last compaction, 60
|
|
25
|
-
* seconds by default, and `"memory"` flushes this often, 15 seconds by
|
|
26
|
-
* default. A read that cannot compact (read-only credentials) shows
|
|
27
|
-
* aggregates that can leave out up to one window of the latest changes.
|
|
13
|
+
* A commit compacts once this has passed since the last compaction, 60
|
|
14
|
+
* seconds by default. A read compacts first; one that cannot (read-only
|
|
15
|
+
* credentials) shows aggregates that can leave out up to one window of the
|
|
16
|
+
* latest changes.
|
|
28
17
|
*/
|
|
29
18
|
readonly windowMs?: number;
|
|
30
19
|
}
|
|
@@ -46,7 +35,8 @@ interface EngineDatabase {
|
|
|
46
35
|
/**
|
|
47
36
|
* How a transaction that conflicts with another write runs again. A store
|
|
48
37
|
* many writers contend on, such as DynamoDB under a burst of events, can
|
|
49
|
-
* take more attempts; `onRetry` observes each rerun.
|
|
38
|
+
* take more attempts; `onRetry` observes each rerun. An aggregate write
|
|
39
|
+
* that lost to another writer's commit is resent without spending one.
|
|
50
40
|
*/
|
|
51
41
|
readonly retry?: RetryOptions;
|
|
52
42
|
dispose?(): Promise<void>;
|
|
@@ -46,6 +46,13 @@ interface ReleaseRow {
|
|
|
46
46
|
readonly source_release_id: string | null;
|
|
47
47
|
readonly created_at_ms: number;
|
|
48
48
|
readonly updated_at_ms: number;
|
|
49
|
+
/**
|
|
50
|
+
* The release's label, shown `v<label>`: sequential per channel and
|
|
51
|
+
* platform, assigned once and never changed or reused while the channel
|
|
52
|
+
* exists. Null on a row the label fill hasn't reached yet, and left out
|
|
53
|
+
* of a row read through an adapter of an earlier release.
|
|
54
|
+
*/
|
|
55
|
+
readonly label?: number | null;
|
|
49
56
|
}
|
|
50
57
|
interface ReleaseCatalogRow {
|
|
51
58
|
readonly scope_key: string;
|
|
@@ -69,7 +76,13 @@ interface ChannelRow {
|
|
|
69
76
|
/** The kinds of artifact a native build registers. */
|
|
70
77
|
type NativeBuildArtifactKind = "apk" | "aab" | "ipa" | "app";
|
|
71
78
|
/** The store track a native build was submitted to. */
|
|
72
|
-
type NativeBuildSubmissionDestination = "testflight" | "play-internal";
|
|
79
|
+
type NativeBuildSubmissionDestination = "testflight" | "play-internal" | "play-closed" | "play-open" | "play-production";
|
|
80
|
+
/**
|
|
81
|
+
* How an iOS `.ipa` was exported, as its embedded provisioning profile says:
|
|
82
|
+
* for the App Store (no device list), ad hoc or development (a device list,
|
|
83
|
+
* development's with `get-task-allow`), or enterprise (every device).
|
|
84
|
+
*/
|
|
85
|
+
type NativeBuildExportMethod = "app-store" | "ad-hoc" | "development" | "enterprise";
|
|
73
86
|
/**
|
|
74
87
|
* A registered native build: its artifact in storage, the scope it serves,
|
|
75
88
|
* and `min_bundle_id`, the `bundles` row of the bundle built into it.
|
|
@@ -105,6 +118,68 @@ interface NativeBuildRow {
|
|
|
105
118
|
* by the build number, and a fingerprint build records no app version.
|
|
106
119
|
*/
|
|
107
120
|
readonly submitted_version: string | null;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the build is marked as what the store sells, which deploys patch
|
|
123
|
+
* from over the scope's newest build. A scope has one at most.
|
|
124
|
+
*/
|
|
125
|
+
readonly is_store_build: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Whether the build is a sandbox build, one built from a scheme with
|
|
128
|
+
* `sandbox: true` or imported with the sandbox layer: set from its artifact
|
|
129
|
+
* when the build registers, on any channel, and never changed. A sandbox
|
|
130
|
+
* build is never the store build.
|
|
131
|
+
*/
|
|
132
|
+
readonly is_sandbox: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* The URL scheme a sandbox build's artifact registers, which its preview
|
|
135
|
+
* links open. Null on any other build, and on a sandbox build registered
|
|
136
|
+
* before it was recorded, which registered `hu-sandbox-<app ID>`.
|
|
137
|
+
*/
|
|
138
|
+
readonly sandbox_url_scheme: string | null;
|
|
139
|
+
/**
|
|
140
|
+
* How an `.ipa` was exported, read from its profile when it registered and
|
|
141
|
+
* never changed. Null on any other artifact, and on an `.ipa` registered
|
|
142
|
+
* before it was recorded.
|
|
143
|
+
*/
|
|
144
|
+
readonly export_method: NativeBuildExportMethod | null;
|
|
145
|
+
/**
|
|
146
|
+
* The app version the artifact itself reports, its
|
|
147
|
+
* `CFBundleShortVersionString` or `versionName`, whatever the update
|
|
148
|
+
* strategy: a fingerprint build has one too, where `app_version`, the
|
|
149
|
+
* version OTAs target, is null. Read from the artifact when it registered
|
|
150
|
+
* and never changed. Null when it couldn't be read, and on a build
|
|
151
|
+
* registered before it was recorded; a server older than it leaves it out.
|
|
152
|
+
*/
|
|
153
|
+
readonly native_app_version?: string | null;
|
|
154
|
+
}
|
|
155
|
+
/** Where an iOS device is in the registry: requested, approved, or registered with Apple. */
|
|
156
|
+
type IosDeviceStatus = "pending" | "approved" | "registered";
|
|
157
|
+
/**
|
|
158
|
+
* An iPhone or iPad a team asked to install ad hoc builds on: the device
|
|
159
|
+
* registry the CLI registers with Apple from. Holds personal data: a UDID, a
|
|
160
|
+
* name, and emails.
|
|
161
|
+
*/
|
|
162
|
+
interface IosDeviceRow {
|
|
163
|
+
readonly id: string;
|
|
164
|
+
/** The UDID in lower case, in whichever of Apple's two formats it came. */
|
|
165
|
+
readonly udid: string;
|
|
166
|
+
/** The name App Store Connect shows once it is registered. */
|
|
167
|
+
readonly name: string;
|
|
168
|
+
readonly status: IosDeviceStatus;
|
|
169
|
+
/** Who asked for it, or null for the CLI. */
|
|
170
|
+
readonly requested_by: string | null;
|
|
171
|
+
readonly created_at_ms: number;
|
|
172
|
+
/** Who approved it: a Console email, or null for the CLI. */
|
|
173
|
+
readonly approved_by: string | null;
|
|
174
|
+
readonly approved_at_ms: number | null;
|
|
175
|
+
/** When it first counted as registered with Apple. */
|
|
176
|
+
readonly registered_at_ms: number | null;
|
|
177
|
+
/** The App Store Connect issuer of the account that registered it, set once. */
|
|
178
|
+
readonly apple_issuer_id: string | null;
|
|
179
|
+
/** Why Apple didn't take it or stopped counting it, in Apple's words or ours. */
|
|
180
|
+
readonly apple_error: string | null;
|
|
181
|
+
/** The newest native build whose .ipa the CLI checked lists it. */
|
|
182
|
+
readonly build_id: string | null;
|
|
108
183
|
}
|
|
109
184
|
//#endregion
|
|
110
|
-
export { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, NativeBuildArtifactKind, NativeBuildRow, NativeBuildSubmissionDestination, ReleaseCatalogRow, ReleaseRow };
|
|
185
|
+
export { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, IosDeviceRow, IosDeviceStatus, NativeBuildArtifactKind, NativeBuildExportMethod, NativeBuildRow, NativeBuildSubmissionDestination, ReleaseCatalogRow, ReleaseRow };
|
|
@@ -46,6 +46,13 @@ interface ReleaseRow {
|
|
|
46
46
|
readonly source_release_id: string | null;
|
|
47
47
|
readonly created_at_ms: number;
|
|
48
48
|
readonly updated_at_ms: number;
|
|
49
|
+
/**
|
|
50
|
+
* The release's label, shown `v<label>`: sequential per channel and
|
|
51
|
+
* platform, assigned once and never changed or reused while the channel
|
|
52
|
+
* exists. Null on a row the label fill hasn't reached yet, and left out
|
|
53
|
+
* of a row read through an adapter of an earlier release.
|
|
54
|
+
*/
|
|
55
|
+
readonly label?: number | null;
|
|
49
56
|
}
|
|
50
57
|
interface ReleaseCatalogRow {
|
|
51
58
|
readonly scope_key: string;
|
|
@@ -69,7 +76,13 @@ interface ChannelRow {
|
|
|
69
76
|
/** The kinds of artifact a native build registers. */
|
|
70
77
|
type NativeBuildArtifactKind = "apk" | "aab" | "ipa" | "app";
|
|
71
78
|
/** The store track a native build was submitted to. */
|
|
72
|
-
type NativeBuildSubmissionDestination = "testflight" | "play-internal";
|
|
79
|
+
type NativeBuildSubmissionDestination = "testflight" | "play-internal" | "play-closed" | "play-open" | "play-production";
|
|
80
|
+
/**
|
|
81
|
+
* How an iOS `.ipa` was exported, as its embedded provisioning profile says:
|
|
82
|
+
* for the App Store (no device list), ad hoc or development (a device list,
|
|
83
|
+
* development's with `get-task-allow`), or enterprise (every device).
|
|
84
|
+
*/
|
|
85
|
+
type NativeBuildExportMethod = "app-store" | "ad-hoc" | "development" | "enterprise";
|
|
73
86
|
/**
|
|
74
87
|
* A registered native build: its artifact in storage, the scope it serves,
|
|
75
88
|
* and `min_bundle_id`, the `bundles` row of the bundle built into it.
|
|
@@ -105,6 +118,68 @@ interface NativeBuildRow {
|
|
|
105
118
|
* by the build number, and a fingerprint build records no app version.
|
|
106
119
|
*/
|
|
107
120
|
readonly submitted_version: string | null;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the build is marked as what the store sells, which deploys patch
|
|
123
|
+
* from over the scope's newest build. A scope has one at most.
|
|
124
|
+
*/
|
|
125
|
+
readonly is_store_build: boolean;
|
|
126
|
+
/**
|
|
127
|
+
* Whether the build is a sandbox build, one built from a scheme with
|
|
128
|
+
* `sandbox: true` or imported with the sandbox layer: set from its artifact
|
|
129
|
+
* when the build registers, on any channel, and never changed. A sandbox
|
|
130
|
+
* build is never the store build.
|
|
131
|
+
*/
|
|
132
|
+
readonly is_sandbox: boolean;
|
|
133
|
+
/**
|
|
134
|
+
* The URL scheme a sandbox build's artifact registers, which its preview
|
|
135
|
+
* links open. Null on any other build, and on a sandbox build registered
|
|
136
|
+
* before it was recorded, which registered `hu-sandbox-<app ID>`.
|
|
137
|
+
*/
|
|
138
|
+
readonly sandbox_url_scheme: string | null;
|
|
139
|
+
/**
|
|
140
|
+
* How an `.ipa` was exported, read from its profile when it registered and
|
|
141
|
+
* never changed. Null on any other artifact, and on an `.ipa` registered
|
|
142
|
+
* before it was recorded.
|
|
143
|
+
*/
|
|
144
|
+
readonly export_method: NativeBuildExportMethod | null;
|
|
145
|
+
/**
|
|
146
|
+
* The app version the artifact itself reports, its
|
|
147
|
+
* `CFBundleShortVersionString` or `versionName`, whatever the update
|
|
148
|
+
* strategy: a fingerprint build has one too, where `app_version`, the
|
|
149
|
+
* version OTAs target, is null. Read from the artifact when it registered
|
|
150
|
+
* and never changed. Null when it couldn't be read, and on a build
|
|
151
|
+
* registered before it was recorded; a server older than it leaves it out.
|
|
152
|
+
*/
|
|
153
|
+
readonly native_app_version?: string | null;
|
|
154
|
+
}
|
|
155
|
+
/** Where an iOS device is in the registry: requested, approved, or registered with Apple. */
|
|
156
|
+
type IosDeviceStatus = "pending" | "approved" | "registered";
|
|
157
|
+
/**
|
|
158
|
+
* An iPhone or iPad a team asked to install ad hoc builds on: the device
|
|
159
|
+
* registry the CLI registers with Apple from. Holds personal data: a UDID, a
|
|
160
|
+
* name, and emails.
|
|
161
|
+
*/
|
|
162
|
+
interface IosDeviceRow {
|
|
163
|
+
readonly id: string;
|
|
164
|
+
/** The UDID in lower case, in whichever of Apple's two formats it came. */
|
|
165
|
+
readonly udid: string;
|
|
166
|
+
/** The name App Store Connect shows once it is registered. */
|
|
167
|
+
readonly name: string;
|
|
168
|
+
readonly status: IosDeviceStatus;
|
|
169
|
+
/** Who asked for it, or null for the CLI. */
|
|
170
|
+
readonly requested_by: string | null;
|
|
171
|
+
readonly created_at_ms: number;
|
|
172
|
+
/** Who approved it: a Console email, or null for the CLI. */
|
|
173
|
+
readonly approved_by: string | null;
|
|
174
|
+
readonly approved_at_ms: number | null;
|
|
175
|
+
/** When it first counted as registered with Apple. */
|
|
176
|
+
readonly registered_at_ms: number | null;
|
|
177
|
+
/** The App Store Connect issuer of the account that registered it, set once. */
|
|
178
|
+
readonly apple_issuer_id: string | null;
|
|
179
|
+
/** Why Apple didn't take it or stopped counting it, in Apple's words or ours. */
|
|
180
|
+
readonly apple_error: string | null;
|
|
181
|
+
/** The newest native build whose .ipa the CLI checked lists it. */
|
|
182
|
+
readonly build_id: string | null;
|
|
108
183
|
}
|
|
109
184
|
//#endregion
|
|
110
|
-
export { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, NativeBuildArtifactKind, NativeBuildRow, NativeBuildSubmissionDestination, ReleaseCatalogRow, ReleaseRow };
|
|
185
|
+
export { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, IosDeviceRow, IosDeviceStatus, NativeBuildArtifactKind, NativeBuildExportMethod, NativeBuildRow, NativeBuildSubmissionDestination, ReleaseCatalogRow, ReleaseRow };
|
package/dist/types/index.cjs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
const require_databaseConfig = require("./databaseConfig.cjs");
|
|
2
2
|
//#region src/types/index.ts
|
|
3
|
+
/** The value of a `Lazy`, calling its function. */
|
|
4
|
+
const resolveLazy = async (value) => typeof value === "function" ? await value() : value;
|
|
3
5
|
/**
|
|
4
6
|
* Supported Apple platforms for building and deployment
|
|
5
7
|
*/
|
|
6
8
|
const supportedIosPlatforms = { ios: "ios" };
|
|
7
9
|
//#endregion
|
|
8
10
|
exports.isRemoteDatabase = require_databaseConfig.isRemoteDatabase;
|
|
11
|
+
exports.resolveLazy = resolveLazy;
|
|
9
12
|
exports.supportedIosPlatforms = supportedIosPlatforms;
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,12 +1,39 @@
|
|
|
1
|
-
import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, NativeBuildArtifactKind, NativeBuildRow, NativeBuildSubmissionDestination, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
|
|
1
|
+
import { BundlePatchRow, BundleRow, ChannelRow, DatabaseBundleMetadata, DatabaseJsonObject, DatabaseJsonValue, IosDeviceRow, IosDeviceStatus, NativeBuildArtifactKind, NativeBuildExportMethod, NativeBuildRow, NativeBuildSubmissionDestination, ReleaseCatalogRow, ReleaseRow } from "./databaseRows.cjs";
|
|
2
2
|
import { AnyHotUpdaterPlugin } from "../serverPlugin/definePlugin.cjs";
|
|
3
3
|
import { AggregateBatching, ConfiguredDatabase, EngineDatabase, RemoteDatabase, isRemoteDatabase } from "./databaseConfig.cjs";
|
|
4
4
|
import { BuiltIns, HasMultipleCallSignatures, Primitive, RequiredDeep } from "./utils.cjs";
|
|
5
5
|
import { BundleRowUpdate, ReleaseCatalogRowUpdate, ReleaseRowUpdate } from "./databaseOperations.cjs";
|
|
6
|
-
import { ChannelDeleteResult, ChannelInsertResult, NativeBuildDeleteResult } from "./models.cjs";
|
|
6
|
+
import { ChannelDeleteResult, ChannelInsertResult, NativeBuildDeleteResult, NativeBuildMarkResult } from "./models.cjs";
|
|
7
7
|
import "./public.cjs";
|
|
8
8
|
import { Bundle as Bundle$1, Platform, Platform as Platform$1 } from "@hot-updater/protocol";
|
|
9
9
|
//#region src/types/index.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* A value, or a function that returns it, called on first use: an
|
|
12
|
+
* adapter shared by servers and the CLI takes its credentials so, as a
|
|
13
|
+
* string from a server's own environment or as `secret("<name>")` from
|
|
14
|
+
* `hot-updater.config.ts`, which loads without reading a secret.
|
|
15
|
+
*/
|
|
16
|
+
type Lazy<T> = T | (() => T | Promise<T>);
|
|
17
|
+
/** The value of a `Lazy`, calling its function. */
|
|
18
|
+
declare const resolveLazy: <T>(value: Lazy<T>) => Promise<T>;
|
|
19
|
+
/**
|
|
20
|
+
* The brand of a `SecretRef`, `Symbol.for("@hot-updater/secret-ref")` at
|
|
21
|
+
* runtime: `hot-updater`'s `secret()` sets it, and the CLI recognizes a
|
|
22
|
+
* reference by it, so a plain string or function is none.
|
|
23
|
+
*/
|
|
24
|
+
declare const secretRefBrand: unique symbol;
|
|
25
|
+
/**
|
|
26
|
+
* `secret("<name>")` in `hot-updater.config.ts`: the secret the config's
|
|
27
|
+
* `secrets` adapter holds as `name`. Called, it reads the value, the
|
|
28
|
+
* environment first, so it is a `Lazy<string>` any adapter credential
|
|
29
|
+
* takes; the build credentials, such as `signing.keystore`, take only a
|
|
30
|
+
* reference, which the CLI resolves by `name` for its kind.
|
|
31
|
+
*/
|
|
32
|
+
type SecretRef = (() => Promise<string>) & {
|
|
33
|
+
readonly [secretRefBrand]: true;
|
|
34
|
+
/** The secret's name in the config's `secrets` adapter. */
|
|
35
|
+
readonly name: string;
|
|
36
|
+
};
|
|
10
37
|
interface BuildAdapterArgs {
|
|
11
38
|
cwd: string;
|
|
12
39
|
}
|
|
@@ -89,6 +116,11 @@ interface BuildAdapter {
|
|
|
89
116
|
readonly appVersion?: string;
|
|
90
117
|
/** The channel the native build would embed. */
|
|
91
118
|
readonly channel?: string;
|
|
119
|
+
/**
|
|
120
|
+
* The trust-anchor file the prebuild embeds as the bundle signing
|
|
121
|
+
* public key, such as the Expo config plugin's `publicKeyPath`.
|
|
122
|
+
*/
|
|
123
|
+
readonly publicKeyPath?: string;
|
|
92
124
|
}>;
|
|
93
125
|
prebuild?: (args: {
|
|
94
126
|
platform: Platform;
|
|
@@ -109,6 +141,19 @@ interface BuildAdapter {
|
|
|
109
141
|
/**
|
|
110
142
|
* Android native build gradle configuration.
|
|
111
143
|
*/
|
|
144
|
+
/** The options of a native build scheme's `sandbox`, which turn it on. */
|
|
145
|
+
interface NativeBuildSandboxOptions {
|
|
146
|
+
/**
|
|
147
|
+
* The URL scheme the sandbox build registers, which its preview links and
|
|
148
|
+
* QR codes open: lower case, a letter then up to 63 letters, digits, `+`,
|
|
149
|
+
* `.` or `-`, none the app registers itself, and not `http`, `https`,
|
|
150
|
+
* `file`, `data`, `javascript`, `true` or `false`. A build keeps the scheme it
|
|
151
|
+
* was built with, so a changed one takes effect at the next sandbox build.
|
|
152
|
+
*
|
|
153
|
+
* @default "hu-sandbox-<bundleIdentifier | packageName>"
|
|
154
|
+
*/
|
|
155
|
+
urlScheme?: string;
|
|
156
|
+
}
|
|
112
157
|
interface NativeBuildAndroidScheme {
|
|
113
158
|
/**
|
|
114
159
|
* Android application module build variant.
|
|
@@ -144,16 +189,28 @@ interface NativeBuildAndroidScheme {
|
|
|
144
189
|
applicationId?: string;
|
|
145
190
|
/**
|
|
146
191
|
* Signs a release variant with a keystore the CLI resolves: `keystore` is
|
|
147
|
-
* `secret
|
|
192
|
+
* `secret("<name>")`, the `android-keystore` the config's `secrets` adapter
|
|
148
193
|
* holds as `<name>`, which the `HOT_UPDATER_ANDROID_KEYSTORE_*`
|
|
149
194
|
* environment variables override. Debug variants keep the debug keystore
|
|
150
195
|
* and resolve nothing. Without it, the variant's own `signingConfig` signs.
|
|
151
196
|
*
|
|
152
|
-
* @example { keystore: "
|
|
197
|
+
* @example { keystore: secret("release-keystore") }
|
|
153
198
|
*/
|
|
154
199
|
signing?: {
|
|
155
|
-
keystore:
|
|
200
|
+
keystore: SecretRef;
|
|
156
201
|
};
|
|
202
|
+
/**
|
|
203
|
+
* Builds the app with the sandbox native layer, for testing OTA bundles on
|
|
204
|
+
* a device, as a separate app: the application ID gets a `.sandbox` suffix.
|
|
205
|
+
* It embeds the project's channel, as any scheme's build does, and reaches
|
|
206
|
+
* Google Play's internal testing only. No other build compiles the layer.
|
|
207
|
+
* An object turns it on with options: `urlScheme` is the URL scheme its
|
|
208
|
+
* preview links and QR codes open, `hu-sandbox-<packageName>` by default.
|
|
209
|
+
*
|
|
210
|
+
* @default false
|
|
211
|
+
* @example { urlScheme: "acme-preview" }
|
|
212
|
+
*/
|
|
213
|
+
sandbox?: boolean | NativeBuildSandboxOptions;
|
|
157
214
|
}
|
|
158
215
|
type IosBuildDestination = {
|
|
159
216
|
id: string;
|
|
@@ -241,17 +298,32 @@ interface NativeBuildIosScheme {
|
|
|
241
298
|
simulator?: boolean;
|
|
242
299
|
/**
|
|
243
300
|
* Signs a device build with automatic signing, authenticated by an App
|
|
244
|
-
* Store Connect API key the CLI resolves: `ascApiKey` is `secret
|
|
301
|
+
* Store Connect API key the CLI resolves: `ascApiKey` is `secret("<name>")`,
|
|
245
302
|
* the `asc-api-key` the config's `secrets` adapter holds as `<name>`,
|
|
246
303
|
* which the `HOT_UPDATER_ASC_KEY*` environment variables override.
|
|
247
304
|
* Simulator builds resolve nothing. Without it, the project's signing
|
|
248
305
|
* settings and Xcode's accounts sign.
|
|
249
306
|
*
|
|
250
|
-
* @example { ascApiKey: "
|
|
307
|
+
* @example { ascApiKey: secret("asc-api-key") }
|
|
251
308
|
*/
|
|
252
309
|
signing?: {
|
|
253
|
-
ascApiKey:
|
|
310
|
+
ascApiKey: SecretRef;
|
|
254
311
|
};
|
|
312
|
+
/**
|
|
313
|
+
* Builds the app with the sandbox native layer, for testing OTA bundles on
|
|
314
|
+
* a device. It has the bundle identifier its Xcode configuration builds,
|
|
315
|
+
* which `bundleIdentifier` must name: the store app's by default, which it
|
|
316
|
+
* replaces on a device, or its own from a separate configuration. It
|
|
317
|
+
* embeds the project's channel, as any scheme's build does, and its `.ipa`
|
|
318
|
+
* is for TestFlight internal testing only, never App Store review. No other build
|
|
319
|
+
* compiles the layer. An object turns it on with options: `urlScheme` is
|
|
320
|
+
* the URL scheme its preview links and QR codes open,
|
|
321
|
+
* `hu-sandbox-<bundleIdentifier>` by default.
|
|
322
|
+
*
|
|
323
|
+
* @default false
|
|
324
|
+
* @example { urlScheme: "acme-preview" }
|
|
325
|
+
*/
|
|
326
|
+
sandbox?: boolean | NativeBuildSandboxOptions;
|
|
255
327
|
}
|
|
256
328
|
interface PlatformConfig {
|
|
257
329
|
/**
|
|
@@ -362,28 +434,6 @@ interface StorageAdapter {
|
|
|
362
434
|
/** Deletes only the exact base-path-relative keys supplied by the caller. */
|
|
363
435
|
readonly deleteObjects?: (keys: readonly string[]) => Promise<void>;
|
|
364
436
|
}
|
|
365
|
-
interface BundleSigningAdapter {
|
|
366
|
-
readonly name: string;
|
|
367
|
-
/** Returns the RSA public key used by this provider in SPKI PEM format. */
|
|
368
|
-
readonly getPublicKey: (input?: {
|
|
369
|
-
readonly cwd?: string;
|
|
370
|
-
}) => Promise<{
|
|
371
|
-
readonly publicKey: string;
|
|
372
|
-
}>;
|
|
373
|
-
/**
|
|
374
|
-
* Signs `message` with RSA PKCS#1 v1.5 SHA-256.
|
|
375
|
-
*
|
|
376
|
-
* Hot Updater passes the 32 raw bytes decoded from a SHA-256 file hash.
|
|
377
|
-
* Remote signing services must treat this value as the raw message, not as
|
|
378
|
-
* an already-computed digest.
|
|
379
|
-
*/
|
|
380
|
-
readonly sign: (input: {
|
|
381
|
-
readonly message: Uint8Array;
|
|
382
|
-
readonly cwd?: string;
|
|
383
|
-
}) => Promise<{
|
|
384
|
-
readonly signature: Uint8Array;
|
|
385
|
-
}>;
|
|
386
|
-
}
|
|
387
437
|
/**
|
|
388
438
|
* What a secrets adapter is given with each call. It carries no secret: an
|
|
389
439
|
* adapter reads its own credentials, such as a token or a CLI sign-in.
|
|
@@ -393,11 +443,12 @@ interface SecretsContext {
|
|
|
393
443
|
readonly cwd: string;
|
|
394
444
|
}
|
|
395
445
|
/**
|
|
396
|
-
* Where the CLI reads secrets
|
|
397
|
-
*
|
|
446
|
+
* Where the CLI reads the secrets `secret("<name>")` names in a config: build
|
|
447
|
+
* credentials, such as a keystore, and adapter credentials. Values
|
|
398
448
|
* are strings: binary is base64, and a credential with several fields is one
|
|
399
449
|
* JSON value per name. `localSecrets()`, an export of `hot-updater`, keeps them
|
|
400
|
-
* in files on this machine
|
|
450
|
+
* in files on this machine, and `infisical()`, another, in an Infisical
|
|
451
|
+
* project; a store of your own implements this.
|
|
401
452
|
*/
|
|
402
453
|
interface SecretsAdapter {
|
|
403
454
|
readonly name: string;
|
|
@@ -428,22 +479,27 @@ type LocalSigningConfig = {
|
|
|
428
479
|
} | {
|
|
429
480
|
readonly enabled: true;
|
|
430
481
|
/**
|
|
431
|
-
* `secret
|
|
432
|
-
* `secrets` adapter holds as `<name>`. The CLI reads it once
|
|
433
|
-
* when it first signs or derives the public key, and keeps it
|
|
434
|
-
* memory only.
|
|
482
|
+
* `secret("<name>")`, the RSA private key in PEM format that the
|
|
483
|
+
* config's `secrets` adapter holds as `<name>`. The CLI reads it once
|
|
484
|
+
* per run, when it first signs or derives the public key, and keeps it
|
|
485
|
+
* in memory only.
|
|
435
486
|
*
|
|
436
|
-
* @example { enabled: true, privateKey: "
|
|
487
|
+
* @example { enabled: true, privateKey: secret("bundle-signing-key") }
|
|
437
488
|
*/
|
|
438
|
-
readonly privateKey:
|
|
489
|
+
readonly privateKey: SecretRef;
|
|
439
490
|
readonly privateKeyPath?: never;
|
|
440
491
|
} | {
|
|
441
492
|
readonly enabled: false;
|
|
442
493
|
readonly privateKeyPath?: string;
|
|
443
|
-
readonly privateKey?:
|
|
494
|
+
readonly privateKey?: SecretRef;
|
|
444
495
|
};
|
|
445
|
-
/**
|
|
446
|
-
|
|
496
|
+
/**
|
|
497
|
+
* Bundle signing with an RSA private key in PEM. `secret("<name>")` is the
|
|
498
|
+
* shorthand of `{ enabled: true, privateKey: secret("<name>") }`. Without
|
|
499
|
+
* `signing`, bundles are unsigned and deploy warns; `enabled: false` turns
|
|
500
|
+
* signing off without the warning.
|
|
501
|
+
*/
|
|
502
|
+
type SigningConfig = SecretRef | LocalSigningConfig;
|
|
447
503
|
/**
|
|
448
504
|
* Extra fingerprint sources.
|
|
449
505
|
*
|
|
@@ -471,6 +527,9 @@ type ConfigInput = {
|
|
|
471
527
|
* If `appVersion`, the bundle will be updated if the target app version is valid.
|
|
472
528
|
* @docs https://hot-updater.dev/docs/guides/update-strategies/app-version
|
|
473
529
|
*
|
|
530
|
+
* `hot-updater init` writes `fingerprint` for a new project; a config that
|
|
531
|
+
* sets none keeps `appVersion`, so upgrading never retargets shipped apps.
|
|
532
|
+
*
|
|
474
533
|
* @default "appVersion"
|
|
475
534
|
*/
|
|
476
535
|
updateStrategy: "fingerprint" | "appVersion";
|
|
@@ -504,7 +563,8 @@ type ConfigInput = {
|
|
|
504
563
|
*/
|
|
505
564
|
nativeVersion?: string | number;
|
|
506
565
|
/**
|
|
507
|
-
*
|
|
566
|
+
* Passed to the build adapter's fingerprint, which may use it for its own
|
|
567
|
+
* diagnostics. fingerprint.json never records them.
|
|
508
568
|
*/
|
|
509
569
|
debug?: boolean;
|
|
510
570
|
};
|
|
@@ -547,25 +607,23 @@ type ConfigInput = {
|
|
|
547
607
|
platform?: PlatformConfig;
|
|
548
608
|
nativeBuild?: NativeBuildArgs;
|
|
549
609
|
/**
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
*
|
|
610
|
+
* Signs each bundle with RSA-SHA256, which the app verifies with the
|
|
611
|
+
* public key it embeds. `secret("bundle-signing-key")` reads the RSA
|
|
612
|
+
* private key in PEM from the config's `secrets` adapter; the object
|
|
613
|
+
* forms take it from a secret (`privateKey`) or a file
|
|
614
|
+
* (`privateKeyPath`). Without `signing`, bundles are unsigned and deploy
|
|
615
|
+
* warns; `{ enabled: false }` turns signing off without the warning.
|
|
554
616
|
*
|
|
555
617
|
* @example
|
|
556
618
|
* ```ts
|
|
557
|
-
* signing:
|
|
558
|
-
* enabled: true,
|
|
559
|
-
* privateKey: "secret:bundle-signing-key",
|
|
560
|
-
* }
|
|
619
|
+
* signing: secret("bundle-signing-key"),
|
|
561
620
|
* ```
|
|
562
621
|
*/
|
|
563
622
|
signing?: SigningConfig;
|
|
564
623
|
/**
|
|
565
|
-
* Where the CLI reads the secrets the config names
|
|
566
|
-
*
|
|
567
|
-
*
|
|
568
|
-
* under it.
|
|
624
|
+
* Where the CLI reads the secrets the config names with `secret("<name>")`,
|
|
625
|
+
* after the environment, and stores the keys it issues. It is the only
|
|
626
|
+
* store: nothing is kept on this machine under it.
|
|
569
627
|
*
|
|
570
628
|
* @default localSecrets()
|
|
571
629
|
*/
|
|
@@ -592,4 +650,4 @@ interface NativeBuildOptions {
|
|
|
592
650
|
scheme?: string;
|
|
593
651
|
}
|
|
594
652
|
//#endregion
|
|
595
|
-
export { type AggregateBatching, ApplePlatform, BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, BuiltIns, type Bundle$1 as Bundle, type BundlePatchRow, type BundleRow, type BundleRowUpdate,
|
|
653
|
+
export { type AggregateBatching, ApplePlatform, BuildAdapter, BuildAdapterArgs, BuildAdapterConfig, BuiltIns, type Bundle$1 as Bundle, type BundlePatchRow, type BundleRow, type BundleRowUpdate, type ChannelDeleteResult, type ChannelInsertResult, type ChannelRow, ConfigInput, type ConfiguredDatabase, type DatabaseBundleMetadata, type DatabaseJsonObject, type DatabaseJsonValue, type EngineDatabase, FingerprintExtraSources, HasMultipleCallSignatures, IosBuildDestination, type IosDeviceRow, type IosDeviceStatus, Lazy, LocalSigningConfig, NativeBuildAndroidScheme, NativeBuildArgs, type NativeBuildArtifactKind, type NativeBuildDeleteResult, type NativeBuildExportMethod, NativeBuildIosScheme, type NativeBuildMarkResult, NativeBuildOptions, type NativeBuildRow, NativeBuildSandboxOptions, type NativeBuildSubmissionDestination, NativeFingerprint, NativeFingerprintOptions, NativeFingerprintProvider, NativeFingerprintSource, type Platform$1 as Platform, PlatformConfig, Primitive, type ReleaseCatalogRow, type ReleaseCatalogRowUpdate, type ReleaseRow, type ReleaseRowUpdate, type RemoteDatabase, RequiredDeep, SecretRef, SecretsAdapter, SecretsContext, SigningConfig, StorageAdapter, StorageDeleteInput, StorageDeleteResult, StorageExistsInput, StorageExistsResult, StorageGetDownloadUrlInput, StorageGetDownloadUrlResult, StorageGetInput, StorageGetResult, StorageObject, StoragePutInput, StoragePutResult, isRemoteDatabase, resolveLazy, supportedIosPlatforms };
|