@hot-updater/plugin-core 0.36.7 → 1.0.0-rc.1
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/assetStorageLayout.cjs +36 -18
- package/dist/assetStorageLayout.d.cts +21 -6
- package/dist/assetStorageLayout.d.mts +21 -6
- package/dist/assetStorageLayout.mjs +36 -18
- package/dist/bundleStorageLayout.cjs +2 -3
- package/dist/bundleStorageLayout.mjs +2 -3
- package/dist/contentAddressedAssets.cjs +5 -0
- package/dist/contentAddressedAssets.d.cts +2 -1
- package/dist/contentAddressedAssets.d.mts +2 -1
- package/dist/contentAddressedAssets.mjs +5 -1
- package/dist/createDatabasePlugin.cjs +775 -284
- package/dist/createDatabasePlugin.d.cts +20 -64
- package/dist/createDatabasePlugin.d.mts +20 -64
- package/dist/createDatabasePlugin.mjs +773 -284
- package/dist/createStorageKeyBuilder.cjs +9 -2
- package/dist/createStorageKeyBuilder.mjs +9 -2
- package/dist/createStoragePlugin.cjs +6 -145
- package/dist/createStoragePlugin.d.cts +7 -52
- package/dist/createStoragePlugin.d.mts +7 -52
- package/dist/createStoragePlugin.mjs +5 -143
- package/dist/databaseClient.cjs +112 -0
- package/dist/databaseClient.d.cts +33 -0
- package/dist/databaseClient.d.mts +33 -0
- package/dist/databaseClient.mjs +110 -0
- package/dist/databaseClientReads.cjs +113 -0
- package/dist/databaseClientReads.mjs +112 -0
- package/dist/databaseClientUpdates.cjs +39 -0
- package/dist/databaseClientUpdates.d.cts +11 -0
- package/dist/databaseClientUpdates.d.mts +11 -0
- package/dist/databaseClientUpdates.mjs +36 -0
- package/dist/databaseJsonValue.cjs +37 -0
- package/dist/databaseJsonValue.d.cts +5 -0
- package/dist/databaseJsonValue.d.mts +5 -0
- package/dist/databaseJsonValue.mjs +37 -0
- package/dist/databaseMetadata.cjs +13 -0
- package/dist/databaseMetadata.mjs +12 -0
- package/dist/databasePluginCrud.cjs +86 -0
- package/dist/databasePluginCrud.d.cts +1 -0
- package/dist/databasePluginCrud.d.mts +1 -0
- package/dist/databasePluginCrud.mjs +86 -0
- package/dist/databasePluginCrudValidation.d.cts +1 -0
- package/dist/databasePluginCrudValidation.d.mts +1 -0
- package/dist/databasePluginCrudValidationErrors.cjs +10 -0
- package/dist/databasePluginCrudValidationErrors.d.cts +9 -0
- package/dist/databasePluginCrudValidationErrors.d.mts +9 -0
- package/dist/databasePluginCrudValidationErrors.mjs +10 -0
- package/dist/databasePluginCrudValidationFields.cjs +291 -0
- package/dist/databasePluginCrudValidationFields.d.cts +1 -0
- package/dist/databasePluginCrudValidationFields.d.mts +1 -0
- package/dist/databasePluginCrudValidationFields.mjs +281 -0
- package/dist/databasePluginCrudValidationMutations.cjs +88 -0
- package/dist/databasePluginCrudValidationMutations.d.cts +1 -0
- package/dist/databasePluginCrudValidationMutations.d.mts +1 -0
- package/dist/databasePluginCrudValidationMutations.mjs +82 -0
- package/dist/databasePluginCrudValidationQueries.cjs +103 -0
- package/dist/databasePluginCrudValidationQueries.d.cts +1 -0
- package/dist/databasePluginCrudValidationQueries.d.mts +1 -0
- package/dist/databasePluginCrudValidationQueries.mjs +97 -0
- package/dist/databasePluginCrudValidationRows.cjs +55 -0
- package/dist/databasePluginCrudValidationRows.d.cts +1 -0
- package/dist/databasePluginCrudValidationRows.d.mts +1 -0
- package/dist/databasePluginCrudValidationRows.mjs +53 -0
- package/dist/databasePluginTransaction.cjs +7 -0
- package/dist/databasePluginTransaction.mjs +7 -0
- package/dist/databaseRows.cjs +149 -0
- package/dist/databaseRows.d.cts +34 -0
- package/dist/databaseRows.d.mts +34 -0
- package/dist/databaseRows.mjs +141 -0
- package/dist/index.cjs +76 -24
- package/dist/index.d.cts +22 -12
- package/dist/index.d.mts +22 -12
- package/dist/index.mjs +21 -14
- package/dist/internal.cjs +6 -0
- package/dist/internal.d.cts +9 -0
- package/dist/internal.d.mts +9 -0
- package/dist/internal.mjs +3 -0
- package/dist/node_modules/.pnpm/verkit@0.3.2/node_modules/verkit/dist/index.cjs +345 -0
- package/dist/node_modules/.pnpm/verkit@0.3.2/node_modules/verkit/dist/index.mjs +341 -0
- package/dist/paginateBundles.d.cts +6 -4
- package/dist/paginateBundles.d.mts +6 -4
- package/dist/parseStorageUri.cjs +46 -30
- package/dist/parseStorageUri.d.cts +20 -17
- package/dist/parseStorageUri.d.mts +20 -17
- package/dist/parseStorageUri.mjs +46 -30
- package/dist/queryBundles.cjs +1 -7
- package/dist/queryBundles.d.cts +3 -1
- package/dist/queryBundles.d.mts +3 -1
- package/dist/queryBundles.mjs +1 -7
- package/dist/releaseCatalogCompiler.cjs +391 -0
- package/dist/releaseCatalogCompiler.d.cts +55 -0
- package/dist/releaseCatalogCompiler.d.mts +55 -0
- package/dist/releaseCatalogCompiler.mjs +386 -0
- package/dist/releaseCatalogMutation.cjs +303 -0
- package/dist/releaseCatalogMutation.d.cts +86 -0
- package/dist/releaseCatalogMutation.d.mts +86 -0
- package/dist/releaseCatalogMutation.mjs +297 -0
- package/dist/releaseManagement.cjs +231 -0
- package/dist/releaseManagement.d.cts +48 -0
- package/dist/releaseManagement.d.mts +48 -0
- package/dist/releaseManagement.mjs +224 -0
- package/dist/remoteBundleSigning.cjs +294 -0
- package/dist/remoteBundleSigning.d.cts +41 -0
- package/dist/remoteBundleSigning.d.mts +41 -0
- package/dist/remoteBundleSigning.mjs +289 -0
- package/dist/requestBundleCache.cjs +22 -0
- package/dist/requestBundleCache.d.cts +9 -0
- package/dist/requestBundleCache.d.mts +9 -0
- package/dist/requestBundleCache.mjs +22 -0
- package/dist/semverSatisfies.cjs +3 -4
- package/dist/semverSatisfies.mjs +1 -1
- package/dist/storageDownloadPath.cjs +48 -0
- package/dist/storageDownloadPath.d.cts +15 -0
- package/dist/storageDownloadPath.d.mts +15 -0
- package/dist/storageDownloadPath.mjs +46 -0
- package/dist/types/database.d.cts +4 -0
- package/dist/types/database.d.mts +4 -0
- package/dist/types/databaseFields.cjs +92 -0
- package/dist/types/databaseFields.d.cts +12 -0
- package/dist/types/databaseFields.d.mts +12 -0
- package/dist/types/databaseFields.mjs +92 -0
- package/dist/types/databaseOperations.d.cts +173 -0
- package/dist/types/databaseOperations.d.mts +173 -0
- package/dist/types/databasePlugin.d.cts +240 -0
- package/dist/types/databasePlugin.d.mts +240 -0
- package/dist/types/databaseQuery.d.cts +47 -0
- package/dist/types/databaseQuery.d.mts +47 -0
- package/dist/types/databaseRows.d.cts +120 -0
- package/dist/types/databaseRows.d.mts +120 -0
- package/dist/types/index.d.cts +119 -161
- package/dist/types/index.d.mts +119 -161
- package/dist/types/internal.d.cts +7 -0
- package/dist/types/internal.d.mts +7 -0
- package/dist/types/public.d.cts +3 -0
- package/dist/types/public.d.mts +3 -0
- package/dist/uuidv7.cjs +9 -0
- package/dist/uuidv7.d.cts +4 -1
- package/dist/uuidv7.d.mts +4 -1
- package/dist/uuidv7.mjs +8 -1
- package/package.json +10 -5
- package/dist/bundleUnitOfWork.cjs +0 -158
- package/dist/bundleUnitOfWork.mjs +0 -158
- package/dist/bundleUnitOfWorkStore.cjs +0 -15
- package/dist/bundleUnitOfWorkStore.mjs +0 -15
- package/dist/createBlobDatabasePlugin.cjs +0 -382
- package/dist/createBlobDatabasePlugin.d.cts +0 -29
- package/dist/createBlobDatabasePlugin.d.mts +0 -29
- package/dist/createBlobDatabasePlugin.mjs +0 -381
- package/dist/legacyAssetStorageLayout.cjs +0 -12
- package/dist/legacyAssetStorageLayout.mjs +0 -12
- package/dist/requestUpdateBundleState.cjs +0 -26
- package/dist/requestUpdateBundleState.d.cts +0 -12
- package/dist/requestUpdateBundleState.d.mts +0 -12
- package/dist/requestUpdateBundleState.mjs +0 -24
- package/dist/resolveUpdateInfoFromBundles.cjs +0 -14
- package/dist/resolveUpdateInfoFromBundles.d.cts +0 -16
- package/dist/resolveUpdateInfoFromBundles.d.mts +0 -16
- package/dist/resolveUpdateInfoFromBundles.mjs +0 -13
- package/dist/storageProfile.cjs +0 -15
- package/dist/storageProfile.d.cts +0 -9
- package/dist/storageProfile.d.mts +0 -9
- package/dist/storageProfile.mjs +0 -12
|
@@ -1,70 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { DatabasePlugin } from "./types/databasePlugin.cjs";
|
|
2
|
+
import { DatabasePluginImplementation } from "./types/databaseOperations.cjs";
|
|
3
|
+
import { DatabasePluginInputError, DatabasePluginInputErrorCode } from "./databasePluginCrudValidationErrors.cjs";
|
|
4
4
|
//#region src/createDatabasePlugin.d.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
getBundles: (options: DatabaseBundleQueryOptions & {
|
|
10
|
-
offset?: number;
|
|
11
|
-
}, context?: HotUpdaterContext<TContext>) => Promise<Paginated<Bundle[]>>;
|
|
12
|
-
getChannels: (context?: HotUpdaterContext<TContext>) => Promise<string[]>;
|
|
13
|
-
onUnmount?: () => Promise<void>;
|
|
14
|
-
commitBundle: (params: {
|
|
15
|
-
changedSets: {
|
|
16
|
-
operation: "insert" | "update" | "delete";
|
|
17
|
-
data: Bundle;
|
|
18
|
-
}[];
|
|
19
|
-
}, context?: HotUpdaterContext<TContext>) => Promise<void>;
|
|
5
|
+
declare class DatabaseAtomicCommitUnsupportedError extends Error {
|
|
6
|
+
readonly pluginName: string;
|
|
7
|
+
readonly name = "DatabaseAtomicCommitUnsupportedError";
|
|
8
|
+
constructor(pluginName: string);
|
|
20
9
|
}
|
|
21
10
|
/**
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
type DatabasePluginMethods<TContext = unknown> = Omit<AbstractDatabasePlugin<TContext>, never>;
|
|
25
|
-
/**
|
|
26
|
-
* Factory function that creates database plugin methods
|
|
27
|
-
*/
|
|
28
|
-
type DatabasePluginFactory<TConfig, TContext = unknown> = (config: TConfig) => DatabasePluginMethods<TContext>;
|
|
29
|
-
/**
|
|
30
|
-
* Configuration options for creating a database plugin
|
|
31
|
-
*/
|
|
32
|
-
interface CreateDatabasePluginOptions<TConfig, TContext = unknown> {
|
|
33
|
-
/**
|
|
34
|
-
* The name of the database plugin (e.g., "postgres", "d1Database")
|
|
35
|
-
*/
|
|
36
|
-
name: string;
|
|
37
|
-
/**
|
|
38
|
-
* Function that creates the database plugin methods
|
|
39
|
-
*/
|
|
40
|
-
factory: DatabasePluginFactory<TConfig, TContext>;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Creates a database plugin with lazy initialization and automatic hook execution.
|
|
44
|
-
*
|
|
45
|
-
* This factory function abstracts the double currying pattern used by all database plugins,
|
|
46
|
-
* ensuring consistent lazy initialization behavior across different database providers.
|
|
47
|
-
* Hooks are automatically executed at appropriate times without requiring manual invocation.
|
|
11
|
+
* Internal provider signal for a delete rejected by a live reference.
|
|
48
12
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```typescript
|
|
54
|
-
* export const postgres = createDatabasePlugin<PostgresConfig>({
|
|
55
|
-
* name: "postgres",
|
|
56
|
-
* factory: (config) => {
|
|
57
|
-
* const db = new Kysely(config);
|
|
58
|
-
* return {
|
|
59
|
-
* async getBundleById(bundleId) { ... },
|
|
60
|
-
* async getBundles(options) { ... },
|
|
61
|
-
* async getChannels() { ... },
|
|
62
|
-
* async commitBundle({ changedSets }) { ... }
|
|
63
|
-
* };
|
|
64
|
-
* }
|
|
65
|
-
* });
|
|
66
|
-
* ```
|
|
13
|
+
* Provider implementations throw this after translating their native
|
|
14
|
+
* foreign-key or reference-condition error. The public database contract
|
|
15
|
+
* observes only the indexed `referenced` commit conflict.
|
|
67
16
|
*/
|
|
68
|
-
declare
|
|
17
|
+
declare class DatabaseRowReferencedError extends Error {
|
|
18
|
+
readonly name = "DatabaseRowReferencedError";
|
|
19
|
+
constructor();
|
|
20
|
+
}
|
|
21
|
+
type CreateDatabasePluginOptions = DatabasePlugin;
|
|
22
|
+
type DatabasePluginAdapter = Omit<DatabasePlugin, "name">;
|
|
23
|
+
declare const createDatabasePluginAdapter: (name: string, implementation: DatabasePluginImplementation) => DatabasePluginAdapter;
|
|
24
|
+
declare const createDatabasePlugin: (options: CreateDatabasePluginOptions) => DatabasePlugin;
|
|
69
25
|
//#endregion
|
|
70
|
-
export {
|
|
26
|
+
export { CreateDatabasePluginOptions, DatabaseAtomicCommitUnsupportedError, DatabasePluginAdapter, DatabaseRowReferencedError, createDatabasePlugin, createDatabasePluginAdapter };
|
|
@@ -1,70 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { DatabasePlugin } from "./types/databasePlugin.mjs";
|
|
2
|
+
import { DatabasePluginImplementation } from "./types/databaseOperations.mjs";
|
|
3
|
+
import { DatabasePluginInputError, DatabasePluginInputErrorCode } from "./databasePluginCrudValidationErrors.mjs";
|
|
4
4
|
//#region src/createDatabasePlugin.d.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
getBundles: (options: DatabaseBundleQueryOptions & {
|
|
10
|
-
offset?: number;
|
|
11
|
-
}, context?: HotUpdaterContext<TContext>) => Promise<Paginated<Bundle[]>>;
|
|
12
|
-
getChannels: (context?: HotUpdaterContext<TContext>) => Promise<string[]>;
|
|
13
|
-
onUnmount?: () => Promise<void>;
|
|
14
|
-
commitBundle: (params: {
|
|
15
|
-
changedSets: {
|
|
16
|
-
operation: "insert" | "update" | "delete";
|
|
17
|
-
data: Bundle;
|
|
18
|
-
}[];
|
|
19
|
-
}, context?: HotUpdaterContext<TContext>) => Promise<void>;
|
|
5
|
+
declare class DatabaseAtomicCommitUnsupportedError extends Error {
|
|
6
|
+
readonly pluginName: string;
|
|
7
|
+
readonly name = "DatabaseAtomicCommitUnsupportedError";
|
|
8
|
+
constructor(pluginName: string);
|
|
20
9
|
}
|
|
21
10
|
/**
|
|
22
|
-
*
|
|
23
|
-
*/
|
|
24
|
-
type DatabasePluginMethods<TContext = unknown> = Omit<AbstractDatabasePlugin<TContext>, never>;
|
|
25
|
-
/**
|
|
26
|
-
* Factory function that creates database plugin methods
|
|
27
|
-
*/
|
|
28
|
-
type DatabasePluginFactory<TConfig, TContext = unknown> = (config: TConfig) => DatabasePluginMethods<TContext>;
|
|
29
|
-
/**
|
|
30
|
-
* Configuration options for creating a database plugin
|
|
31
|
-
*/
|
|
32
|
-
interface CreateDatabasePluginOptions<TConfig, TContext = unknown> {
|
|
33
|
-
/**
|
|
34
|
-
* The name of the database plugin (e.g., "postgres", "d1Database")
|
|
35
|
-
*/
|
|
36
|
-
name: string;
|
|
37
|
-
/**
|
|
38
|
-
* Function that creates the database plugin methods
|
|
39
|
-
*/
|
|
40
|
-
factory: DatabasePluginFactory<TConfig, TContext>;
|
|
41
|
-
}
|
|
42
|
-
/**
|
|
43
|
-
* Creates a database plugin with lazy initialization and automatic hook execution.
|
|
44
|
-
*
|
|
45
|
-
* This factory function abstracts the double currying pattern used by all database plugins,
|
|
46
|
-
* ensuring consistent lazy initialization behavior across different database providers.
|
|
47
|
-
* Hooks are automatically executed at appropriate times without requiring manual invocation.
|
|
11
|
+
* Internal provider signal for a delete rejected by a live reference.
|
|
48
12
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* @example
|
|
53
|
-
* ```typescript
|
|
54
|
-
* export const postgres = createDatabasePlugin<PostgresConfig>({
|
|
55
|
-
* name: "postgres",
|
|
56
|
-
* factory: (config) => {
|
|
57
|
-
* const db = new Kysely(config);
|
|
58
|
-
* return {
|
|
59
|
-
* async getBundleById(bundleId) { ... },
|
|
60
|
-
* async getBundles(options) { ... },
|
|
61
|
-
* async getChannels() { ... },
|
|
62
|
-
* async commitBundle({ changedSets }) { ... }
|
|
63
|
-
* };
|
|
64
|
-
* }
|
|
65
|
-
* });
|
|
66
|
-
* ```
|
|
13
|
+
* Provider implementations throw this after translating their native
|
|
14
|
+
* foreign-key or reference-condition error. The public database contract
|
|
15
|
+
* observes only the indexed `referenced` commit conflict.
|
|
67
16
|
*/
|
|
68
|
-
declare
|
|
17
|
+
declare class DatabaseRowReferencedError extends Error {
|
|
18
|
+
readonly name = "DatabaseRowReferencedError";
|
|
19
|
+
constructor();
|
|
20
|
+
}
|
|
21
|
+
type CreateDatabasePluginOptions = DatabasePlugin;
|
|
22
|
+
type DatabasePluginAdapter = Omit<DatabasePlugin, "name">;
|
|
23
|
+
declare const createDatabasePluginAdapter: (name: string, implementation: DatabasePluginImplementation) => DatabasePluginAdapter;
|
|
24
|
+
declare const createDatabasePlugin: (options: CreateDatabasePluginOptions) => DatabasePlugin;
|
|
69
25
|
//#endregion
|
|
70
|
-
export {
|
|
26
|
+
export { CreateDatabasePluginOptions, DatabaseAtomicCommitUnsupportedError, DatabasePluginAdapter, DatabaseRowReferencedError, createDatabasePlugin, createDatabasePluginAdapter };
|