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