@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/vue.mjs
CHANGED
|
@@ -459,18 +459,27 @@ var DatabaseAPI = class {
|
|
|
459
459
|
await this.execute(query);
|
|
460
460
|
}
|
|
461
461
|
/**
|
|
462
|
-
* Registers extension migrations with HaexVault
|
|
463
|
-
*
|
|
464
|
-
*
|
|
462
|
+
* Registers and applies extension migrations with HaexVault
|
|
463
|
+
*
|
|
464
|
+
* HaexVault will:
|
|
465
|
+
* 1. Validate all SQL statements (ensure only extension's own tables are accessed)
|
|
466
|
+
* 2. Store migrations with applied_at = NULL
|
|
467
|
+
* 3. Query pending migrations sorted by name
|
|
468
|
+
* 4. Apply pending migrations and set up CRDT triggers
|
|
469
|
+
* 5. Mark successful migrations with applied_at timestamp
|
|
470
|
+
*
|
|
465
471
|
* @param extensionVersion - The version of the extension
|
|
466
472
|
* @param migrations - Array of migration objects with name and SQL content
|
|
467
|
-
* @returns Promise
|
|
473
|
+
* @returns Promise with migration result (applied count, already applied count, applied migration names)
|
|
468
474
|
*/
|
|
469
475
|
async registerMigrationsAsync(extensionVersion, migrations) {
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
476
|
+
return this.client.request(
|
|
477
|
+
HAEXTENSION_METHODS.database.registerMigrations,
|
|
478
|
+
{
|
|
479
|
+
extensionVersion,
|
|
480
|
+
migrations
|
|
481
|
+
}
|
|
482
|
+
);
|
|
474
483
|
}
|
|
475
484
|
async insert(tableName, data) {
|
|
476
485
|
const keys = Object.keys(data);
|
|
@@ -959,11 +968,18 @@ var HaexVaultClient = class {
|
|
|
959
968
|
};
|
|
960
969
|
}
|
|
961
970
|
/**
|
|
962
|
-
* Registers extension migrations with HaexVault
|
|
963
|
-
*
|
|
971
|
+
* Registers and applies extension migrations with HaexVault
|
|
972
|
+
*
|
|
973
|
+
* HaexVault will:
|
|
974
|
+
* 1. Validate all SQL statements (ensure only extension's own tables are accessed)
|
|
975
|
+
* 2. Store migrations with applied_at = NULL
|
|
976
|
+
* 3. Query pending migrations sorted by name
|
|
977
|
+
* 4. Apply pending migrations and set up CRDT triggers
|
|
978
|
+
* 5. Mark successful migrations with applied_at timestamp
|
|
979
|
+
*
|
|
964
980
|
* @param extensionVersion - The version of the extension
|
|
965
981
|
* @param migrations - Array of migration objects with name and SQL content
|
|
966
|
-
* @returns Promise
|
|
982
|
+
* @returns Promise with migration result (applied count, already applied count, applied migration names)
|
|
967
983
|
*/
|
|
968
984
|
async registerMigrationsAsync(extensionVersion, migrations) {
|
|
969
985
|
return this.database.registerMigrationsAsync(extensionVersion, migrations);
|
|
@@ -1083,6 +1099,11 @@ var HaexVaultClient = class {
|
|
|
1083
1099
|
data: params.data,
|
|
1084
1100
|
fileName: params.fileName
|
|
1085
1101
|
});
|
|
1102
|
+
case HAEXTENSION_METHODS.database.registerMigrations:
|
|
1103
|
+
return invoke("webview_extension_db_register_migrations", {
|
|
1104
|
+
extensionVersion: params.extensionVersion,
|
|
1105
|
+
migrations: params.migrations
|
|
1106
|
+
});
|
|
1086
1107
|
default:
|
|
1087
1108
|
throw new HaexHubError(
|
|
1088
1109
|
"METHOD_NOT_FOUND" /* METHOD_NOT_FOUND */,
|