@haex-space/vault-sdk 2.0.0 → 2.2.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/{client-O_JEOzfx.d.mts → client-Dr3nKgRa.d.mts} +31 -15
- package/dist/{client-O_JEOzfx.d.ts → client-Dr3nKgRa.d.ts} +31 -15
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +32 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +32 -11
- package/dist/index.mjs.map +1 -1
- package/dist/react.d.mts +1 -1
- package/dist/react.d.ts +1 -1
- package/dist/react.js +32 -11
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +32 -11
- package/dist/react.mjs.map +1 -1
- package/dist/runtime/nuxt.plugin.client.d.mts +1 -1
- package/dist/runtime/nuxt.plugin.client.d.ts +1 -1
- package/dist/runtime/nuxt.plugin.client.js +32 -11
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +32 -11
- package/dist/runtime/nuxt.plugin.client.mjs.map +1 -1
- package/dist/svelte.d.mts +1 -1
- package/dist/svelte.d.ts +1 -1
- package/dist/svelte.js +32 -11
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +32 -11
- package/dist/svelte.mjs.map +1 -1
- package/dist/vue.d.mts +1 -1
- package/dist/vue.d.ts +1 -1
- package/dist/vue.js +32 -11
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +32 -11
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -520,18 +520,27 @@ var DatabaseAPI = class {
|
|
|
520
520
|
await this.execute(query);
|
|
521
521
|
}
|
|
522
522
|
/**
|
|
523
|
-
* Registers extension migrations with HaexVault
|
|
524
|
-
*
|
|
525
|
-
*
|
|
523
|
+
* Registers and applies extension migrations with HaexVault
|
|
524
|
+
*
|
|
525
|
+
* HaexVault will:
|
|
526
|
+
* 1. Validate all SQL statements (ensure only extension's own tables are accessed)
|
|
527
|
+
* 2. Store migrations with applied_at = NULL
|
|
528
|
+
* 3. Query pending migrations sorted by name
|
|
529
|
+
* 4. Apply pending migrations and set up CRDT triggers
|
|
530
|
+
* 5. Mark successful migrations with applied_at timestamp
|
|
531
|
+
*
|
|
526
532
|
* @param extensionVersion - The version of the extension
|
|
527
533
|
* @param migrations - Array of migration objects with name and SQL content
|
|
528
|
-
* @returns Promise
|
|
534
|
+
* @returns Promise with migration result (applied count, already applied count, applied migration names)
|
|
529
535
|
*/
|
|
530
536
|
async registerMigrationsAsync(extensionVersion, migrations) {
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
537
|
+
return this.client.request(
|
|
538
|
+
HAEXTENSION_METHODS.database.registerMigrations,
|
|
539
|
+
{
|
|
540
|
+
extensionVersion,
|
|
541
|
+
migrations
|
|
542
|
+
}
|
|
543
|
+
);
|
|
535
544
|
}
|
|
536
545
|
async insert(tableName, data) {
|
|
537
546
|
const keys = Object.keys(data);
|
|
@@ -1020,11 +1029,18 @@ var HaexVaultClient = class {
|
|
|
1020
1029
|
};
|
|
1021
1030
|
}
|
|
1022
1031
|
/**
|
|
1023
|
-
* Registers extension migrations with HaexVault
|
|
1024
|
-
*
|
|
1032
|
+
* Registers and applies extension migrations with HaexVault
|
|
1033
|
+
*
|
|
1034
|
+
* HaexVault will:
|
|
1035
|
+
* 1. Validate all SQL statements (ensure only extension's own tables are accessed)
|
|
1036
|
+
* 2. Store migrations with applied_at = NULL
|
|
1037
|
+
* 3. Query pending migrations sorted by name
|
|
1038
|
+
* 4. Apply pending migrations and set up CRDT triggers
|
|
1039
|
+
* 5. Mark successful migrations with applied_at timestamp
|
|
1040
|
+
*
|
|
1025
1041
|
* @param extensionVersion - The version of the extension
|
|
1026
1042
|
* @param migrations - Array of migration objects with name and SQL content
|
|
1027
|
-
* @returns Promise
|
|
1043
|
+
* @returns Promise with migration result (applied count, already applied count, applied migration names)
|
|
1028
1044
|
*/
|
|
1029
1045
|
async registerMigrationsAsync(extensionVersion, migrations) {
|
|
1030
1046
|
return this.database.registerMigrationsAsync(extensionVersion, migrations);
|
|
@@ -1144,6 +1160,11 @@ var HaexVaultClient = class {
|
|
|
1144
1160
|
data: params.data,
|
|
1145
1161
|
fileName: params.fileName
|
|
1146
1162
|
});
|
|
1163
|
+
case HAEXTENSION_METHODS.database.registerMigrations:
|
|
1164
|
+
return invoke("webview_extension_db_register_migrations", {
|
|
1165
|
+
extensionVersion: params.extensionVersion,
|
|
1166
|
+
migrations: params.migrations
|
|
1167
|
+
});
|
|
1147
1168
|
default:
|
|
1148
1169
|
throw new HaexHubError(
|
|
1149
1170
|
"METHOD_NOT_FOUND" /* METHOD_NOT_FOUND */,
|