@hot-updater/supabase 1.0.0-rc.18 → 1.0.0-rc.21
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/edge.cjs +1 -1
- package/dist/edge.d.cts +3 -3
- package/dist/edge.d.mts +3 -3
- package/dist/edge.mjs +1 -1
- package/dist/index.cjs +11 -12
- package/dist/index.d.cts +3 -4
- package/dist/index.d.mts +3 -4
- package/dist/index.mjs +2 -3
- package/dist/init/index.cjs +7593 -6
- package/dist/init/index.d.cts +97 -4
- package/dist/init/index.d.mts +97 -4
- package/dist/init/index.mjs +7578 -3
- package/dist/{plugins--10vxSpf.mjs → plugins-B8grmU79.mjs} +2 -3
- package/dist/{plugins-CcNpRRGq.cjs → plugins-DJUmZYvT.cjs} +5 -6
- package/dist/supabaseDatabase-DVb3-y2x.d.cts +726 -0
- package/dist/supabaseDatabase-DVb3-y2x.d.mts +726 -0
- package/package.json +9 -13
- package/dist/iac/index.cjs +0 -7680
- package/dist/iac/index.d.cts +0 -101
- package/dist/iac/index.d.mts +0 -101
- package/dist/iac/index.mjs +0 -7664
- package/dist/supabaseDatabase-C0-IshLi.d.cts +0 -436
- package/dist/supabaseDatabase-C0-IshLi.d.mts +0 -436
- package/supabase/edge-functions/runtime.docker.integration.spec.ts +0 -1301
- package/supabase/migrations.spec.ts +0 -287
package/dist/edge.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_plugins = require("./plugins-
|
|
2
|
+
const require_plugins = require("./plugins-DJUmZYvT.cjs");
|
|
3
3
|
//#region src/supabaseEdgeFunctionStorage.ts
|
|
4
4
|
const supabaseEdgeFunctionStorage = (config) => require_plugins.supabaseStorage(config);
|
|
5
5
|
//#endregion
|
package/dist/edge.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as plugins, n as supabaseDatabase, t as SupabaseDatabaseConfig } from "./supabaseDatabase-
|
|
2
|
-
import {
|
|
1
|
+
import { i as plugins, n as supabaseDatabase, t as SupabaseDatabaseConfig } from "./supabaseDatabase-DVb3-y2x.cjs";
|
|
2
|
+
import { StorageAdapterWith } from "@hot-updater/plugin-core";
|
|
3
3
|
//#region src/supabaseEdgeFunctionStorage.d.ts
|
|
4
4
|
interface SupabaseEdgeFunctionStorageConfig {
|
|
5
5
|
supabaseUrl: string;
|
|
@@ -8,6 +8,6 @@ interface SupabaseEdgeFunctionStorageConfig {
|
|
|
8
8
|
basePath?: string;
|
|
9
9
|
signedUrlExpiresIn?: number;
|
|
10
10
|
}
|
|
11
|
-
declare const supabaseEdgeFunctionStorage: (config: SupabaseEdgeFunctionStorageConfig) =>
|
|
11
|
+
declare const supabaseEdgeFunctionStorage: (config: SupabaseEdgeFunctionStorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { type SupabaseDatabaseConfig, type SupabaseEdgeFunctionStorageConfig as SupabaseStorageConfig, plugins, supabaseDatabase, supabaseEdgeFunctionStorage as supabaseStorage };
|
package/dist/edge.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { i as plugins, n as supabaseDatabase, t as SupabaseDatabaseConfig } from "./supabaseDatabase-
|
|
2
|
-
import {
|
|
1
|
+
import { i as plugins, n as supabaseDatabase, t as SupabaseDatabaseConfig } from "./supabaseDatabase-DVb3-y2x.mjs";
|
|
2
|
+
import { StorageAdapterWith } from "@hot-updater/plugin-core";
|
|
3
3
|
//#region src/supabaseEdgeFunctionStorage.d.ts
|
|
4
4
|
interface SupabaseEdgeFunctionStorageConfig {
|
|
5
5
|
supabaseUrl: string;
|
|
@@ -8,6 +8,6 @@ interface SupabaseEdgeFunctionStorageConfig {
|
|
|
8
8
|
basePath?: string;
|
|
9
9
|
signedUrlExpiresIn?: number;
|
|
10
10
|
}
|
|
11
|
-
declare const supabaseEdgeFunctionStorage: (config: SupabaseEdgeFunctionStorageConfig) =>
|
|
11
|
+
declare const supabaseEdgeFunctionStorage: (config: SupabaseEdgeFunctionStorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
|
|
12
12
|
//#endregion
|
|
13
13
|
export { type SupabaseDatabaseConfig, type SupabaseEdgeFunctionStorageConfig as SupabaseStorageConfig, plugins, supabaseDatabase, supabaseEdgeFunctionStorage as supabaseStorage };
|
package/dist/edge.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as supabaseStorage, r as supabaseDatabase, t as plugins } from "./plugins
|
|
1
|
+
import { n as supabaseStorage, r as supabaseDatabase, t as plugins } from "./plugins-B8grmU79.mjs";
|
|
2
2
|
//#region src/supabaseEdgeFunctionStorage.ts
|
|
3
3
|
const supabaseEdgeFunctionStorage = (config) => supabaseStorage(config);
|
|
4
4
|
//#endregion
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_plugins = require("./plugins-
|
|
3
|
-
let
|
|
4
|
-
let _hot_updater_server_db = require("@hot-updater/server/db");
|
|
2
|
+
const require_plugins = require("./plugins-DJUmZYvT.cjs");
|
|
3
|
+
let _hot_updater_plugin_core = require("@hot-updater/plugin-core");
|
|
5
4
|
//#region src/supabaseSchema.ts
|
|
6
5
|
/** Every table the apply RPC may name: models, index tables, settings, and the write guard. */
|
|
7
|
-
const supabaseTableNames = (schema =
|
|
8
|
-
...schema.tables.flatMap((table) => [table.name, ...table.indexes.filter((index) => (0,
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
const supabaseTableNames = (schema = _hot_updater_plugin_core.coreTarget.schema) => [
|
|
7
|
+
...schema.tables.flatMap((table) => [table.name, ...table.indexes.filter((index) => (0, _hot_updater_plugin_core.isMultiIndex)(table, index)).map((index) => `${table.name}__${index.name}`)]),
|
|
8
|
+
_hot_updater_plugin_core.SETTINGS_TABLE.name,
|
|
9
|
+
_hot_updater_plugin_core.WRITE_GUARD_TABLE.name
|
|
11
10
|
].map((name) => require_plugins.SUPABASE_TABLE_PREFIX + name);
|
|
12
11
|
/** The words the SQL core's statements use besides quoted names, numbers, and operators. */
|
|
13
12
|
const KEYWORDS = [
|
|
@@ -104,13 +103,13 @@ $apply$`;
|
|
|
104
103
|
* and the settings rows last. Every statement can run again, so a migration
|
|
105
104
|
* for a server's plugin tables repeats core's.
|
|
106
105
|
*/
|
|
107
|
-
const supabaseSchemaStatements = ({ schema, settings: expected } =
|
|
108
|
-
const engine = (0,
|
|
106
|
+
const supabaseSchemaStatements = ({ schema, settings: expected } = _hot_updater_plugin_core.coreTarget) => {
|
|
107
|
+
const engine = (0, _hot_updater_plugin_core.generateEngineSql)("postgresql", schema, expected, { tablePrefix: require_plugins.SUPABASE_TABLE_PREFIX });
|
|
109
108
|
const settings = engine.slice(-Object.keys(expected).length);
|
|
110
109
|
const tables = supabaseTableNames(schema);
|
|
111
110
|
const apply = `public.${require_plugins.SUPABASE_APPLY_FUNCTION}(jsonb)`;
|
|
112
111
|
return [
|
|
113
|
-
...(0,
|
|
112
|
+
...(0, _hot_updater_plugin_core.createTableStatements)("postgresql", [_hot_updater_plugin_core.WRITE_GUARD_TABLE], require_plugins.SUPABASE_TABLE_PREFIX),
|
|
114
113
|
...engine.slice(0, -settings.length),
|
|
115
114
|
...tables.map((table) => `ALTER TABLE "${table}" ENABLE ROW LEVEL SECURITY`),
|
|
116
115
|
applyFunction(tables),
|
|
@@ -130,8 +129,8 @@ const supabaseSchemaSql = (target) => `-- HotUpdater.schema\n\n${supabaseSchemaS
|
|
|
130
129
|
*/
|
|
131
130
|
const supabaseDatabase = (config) => ({
|
|
132
131
|
...require_plugins.supabaseDatabase(config),
|
|
133
|
-
generateSchema: ((version, _name, target =
|
|
134
|
-
if (version !== "latest" && version !==
|
|
132
|
+
generateSchema: ((version, _name, target = _hot_updater_plugin_core.coreTarget) => {
|
|
133
|
+
if (version !== "latest" && version !== _hot_updater_plugin_core.coreSettings["schema.core"]) throw new Error(`Invalid version ${version}`);
|
|
135
134
|
const timestamp = (/* @__PURE__ */ new Date()).toISOString().replace(/\D/g, "").slice(0, 14);
|
|
136
135
|
return {
|
|
137
136
|
code: supabaseSchemaSql(target),
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { i as plugins, r as SupabaseServiceRoleConfig, t as SupabaseDatabaseConfig } from "./supabaseDatabase-
|
|
2
|
-
import {
|
|
3
|
-
import { ToolingDatabase } from "@hot-updater/server/db";
|
|
1
|
+
import { i as plugins, r as SupabaseServiceRoleConfig, t as SupabaseDatabaseConfig } from "./supabaseDatabase-DVb3-y2x.cjs";
|
|
2
|
+
import { StorageAdapterWith, ToolingDatabase } from "@hot-updater/plugin-core";
|
|
4
3
|
//#region src/supabaseMigration.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Hot Updater's database on Supabase, with the migration `hot-updater db
|
|
@@ -18,6 +17,6 @@ type SupabaseStorageConfig = SupabaseServiceRoleConfig & {
|
|
|
18
17
|
/** Signed download URL lifetime in seconds. @default 3600 */
|
|
19
18
|
signedUrlExpiresIn?: number;
|
|
20
19
|
};
|
|
21
|
-
declare const supabaseStorage: (config: SupabaseStorageConfig) =>
|
|
20
|
+
declare const supabaseStorage: (config: SupabaseStorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
|
|
22
21
|
//#endregion
|
|
23
22
|
export { type SupabaseDatabaseConfig, SupabaseStorageConfig, plugins, supabaseDatabase, supabaseStorage };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { i as plugins, r as SupabaseServiceRoleConfig, t as SupabaseDatabaseConfig } from "./supabaseDatabase-
|
|
2
|
-
import { ToolingDatabase } from "@hot-updater/
|
|
3
|
-
import { StoragePluginWith } from "@hot-updater/plugin-core";
|
|
1
|
+
import { i as plugins, r as SupabaseServiceRoleConfig, t as SupabaseDatabaseConfig } from "./supabaseDatabase-DVb3-y2x.mjs";
|
|
2
|
+
import { StorageAdapterWith, ToolingDatabase } from "@hot-updater/plugin-core";
|
|
4
3
|
//#region src/supabaseMigration.d.ts
|
|
5
4
|
/**
|
|
6
5
|
* Hot Updater's database on Supabase, with the migration `hot-updater db
|
|
@@ -18,6 +17,6 @@ type SupabaseStorageConfig = SupabaseServiceRoleConfig & {
|
|
|
18
17
|
/** Signed download URL lifetime in seconds. @default 3600 */
|
|
19
18
|
signedUrlExpiresIn?: number;
|
|
20
19
|
};
|
|
21
|
-
declare const supabaseStorage: (config: SupabaseStorageConfig) =>
|
|
20
|
+
declare const supabaseStorage: (config: SupabaseStorageConfig) => StorageAdapterWith<"put" | "get" | "getDownloadUrl" | "exists" | "delete">;
|
|
22
21
|
//#endregion
|
|
23
22
|
export { type SupabaseDatabaseConfig, SupabaseStorageConfig, plugins, supabaseDatabase, supabaseStorage };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { a as SUPABASE_TABLE_PREFIX, i as SUPABASE_APPLY_FUNCTION, n as supabaseStorage, r as supabaseDatabase$1, t as plugins } from "./plugins
|
|
2
|
-
import { SETTINGS_TABLE, WRITE_GUARD_TABLE, coreSettings, coreTarget, createTableStatements, isMultiIndex } from "@hot-updater/
|
|
3
|
-
import { generateEngineSql } from "@hot-updater/server/db";
|
|
1
|
+
import { a as SUPABASE_TABLE_PREFIX, i as SUPABASE_APPLY_FUNCTION, n as supabaseStorage, r as supabaseDatabase$1, t as plugins } from "./plugins-B8grmU79.mjs";
|
|
2
|
+
import { SETTINGS_TABLE, WRITE_GUARD_TABLE, coreSettings, coreTarget, createTableStatements, generateEngineSql, isMultiIndex } from "@hot-updater/plugin-core";
|
|
4
3
|
//#region src/supabaseSchema.ts
|
|
5
4
|
/** Every table the apply RPC may name: models, index tables, settings, and the write guard. */
|
|
6
5
|
const supabaseTableNames = (schema = coreTarget.schema) => [
|