@haex-space/vault-sdk 2.5.111 → 2.5.112
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-8dlKVNDZ.d.ts → client-BVMJXZiK.d.ts} +75 -1
- package/dist/{client-DFGx115H.d.mts → client-GPE112vL.d.mts} +75 -1
- package/dist/index.d.mts +27 -3
- package/dist/index.d.ts +27 -3
- package/dist/index.js +91 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +91 -2
- 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 +88 -0
- package/dist/react.js.map +1 -1
- package/dist/react.mjs +88 -0
- 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 +88 -0
- package/dist/runtime/nuxt.plugin.client.js.map +1 -1
- package/dist/runtime/nuxt.plugin.client.mjs +88 -0
- 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 +88 -0
- package/dist/svelte.js.map +1 -1
- package/dist/svelte.mjs +88 -0
- 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 +88 -0
- package/dist/vue.js.map +1 -1
- package/dist/vue.mjs +88 -0
- package/dist/vue.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as nuxt_app from 'nuxt/app';
|
|
2
2
|
import { ShallowRef } from 'vue';
|
|
3
|
-
import { H as HaexVaultSdk } from '../client-
|
|
3
|
+
import { H as HaexVaultSdk } from '../client-GPE112vL.mjs';
|
|
4
4
|
import { A as ApplicationContext } from '../types-gfc9eCL4.mjs';
|
|
5
5
|
import 'drizzle-orm/sqlite-proxy';
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as nuxt_app from 'nuxt/app';
|
|
2
2
|
import { ShallowRef } from 'vue';
|
|
3
|
-
import { H as HaexVaultSdk } from '../client-
|
|
3
|
+
import { H as HaexVaultSdk } from '../client-BVMJXZiK.js';
|
|
4
4
|
import { A as ApplicationContext } from '../types-gfc9eCL4.js';
|
|
5
5
|
import 'drizzle-orm/sqlite-proxy';
|
|
6
6
|
|
|
@@ -232,6 +232,16 @@ var LOCALSEND_COMMANDS = {
|
|
|
232
232
|
cancelSend: "localsend_cancel_send"
|
|
233
233
|
};
|
|
234
234
|
|
|
235
|
+
// src/commands/spaces.ts
|
|
236
|
+
var SPACE_COMMANDS = {
|
|
237
|
+
/** Bulk assign rows to spaces */
|
|
238
|
+
assign: "extension_space_assign",
|
|
239
|
+
/** Bulk unassign rows from spaces */
|
|
240
|
+
unassign: "extension_space_unassign",
|
|
241
|
+
/** Get space assignments for a table */
|
|
242
|
+
getAssignments: "extension_space_get_assignments"
|
|
243
|
+
};
|
|
244
|
+
|
|
235
245
|
// src/api/storage.ts
|
|
236
246
|
var StorageAPI = class {
|
|
237
247
|
constructor(client) {
|
|
@@ -1040,6 +1050,83 @@ var LocalSendAPI = class {
|
|
|
1040
1050
|
}
|
|
1041
1051
|
};
|
|
1042
1052
|
|
|
1053
|
+
// src/api/spaces.ts
|
|
1054
|
+
var SpacesAPI = class {
|
|
1055
|
+
constructor(client) {
|
|
1056
|
+
this.client = client;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* Bulk assign rows to spaces.
|
|
1060
|
+
* @param assignments - Array of row-to-space mappings
|
|
1061
|
+
* @returns Number of assignments created
|
|
1062
|
+
*/
|
|
1063
|
+
async assignAsync(assignments) {
|
|
1064
|
+
return this.client.request(SPACE_COMMANDS.assign, {
|
|
1065
|
+
assignments: assignments.map(toSnakeCase)
|
|
1066
|
+
});
|
|
1067
|
+
}
|
|
1068
|
+
/**
|
|
1069
|
+
* Bulk unassign rows from spaces.
|
|
1070
|
+
* @param assignments - Array of row-to-space mappings to remove
|
|
1071
|
+
* @returns Number of assignments removed
|
|
1072
|
+
*/
|
|
1073
|
+
async unassignAsync(assignments) {
|
|
1074
|
+
return this.client.request(SPACE_COMMANDS.unassign, {
|
|
1075
|
+
assignments: assignments.map(toSnakeCase)
|
|
1076
|
+
});
|
|
1077
|
+
}
|
|
1078
|
+
/**
|
|
1079
|
+
* Get space assignments for a table, optionally filtered by row.
|
|
1080
|
+
* @param tableName - The table to query assignments for
|
|
1081
|
+
* @param rowPks - Optional row primary key(s) to filter by
|
|
1082
|
+
* @returns Array of space assignments
|
|
1083
|
+
*/
|
|
1084
|
+
async getAssignmentsAsync(tableName, rowPks) {
|
|
1085
|
+
const result = await this.client.request(
|
|
1086
|
+
SPACE_COMMANDS.getAssignments,
|
|
1087
|
+
{
|
|
1088
|
+
table_name: tableName,
|
|
1089
|
+
row_pks: rowPks
|
|
1090
|
+
}
|
|
1091
|
+
);
|
|
1092
|
+
return result.map(fromSnakeCase);
|
|
1093
|
+
}
|
|
1094
|
+
/**
|
|
1095
|
+
* Convenience method to assign a single row to a space.
|
|
1096
|
+
* @param tableName - The table name
|
|
1097
|
+
* @param rowPks - The row primary key(s)
|
|
1098
|
+
* @param spaceId - The space ID to assign to
|
|
1099
|
+
* @returns Number of assignments created (0 or 1)
|
|
1100
|
+
*/
|
|
1101
|
+
async assignRowAsync(tableName, rowPks, spaceId) {
|
|
1102
|
+
return this.assignAsync([{ tableName, rowPks, spaceId }]);
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Convenience method to unassign a single row from a space.
|
|
1106
|
+
* @param tableName - The table name
|
|
1107
|
+
* @param rowPks - The row primary key(s)
|
|
1108
|
+
* @param spaceId - The space ID to unassign from
|
|
1109
|
+
* @returns Number of assignments removed (0 or 1)
|
|
1110
|
+
*/
|
|
1111
|
+
async unassignRowAsync(tableName, rowPks, spaceId) {
|
|
1112
|
+
return this.unassignAsync([{ tableName, rowPks, spaceId }]);
|
|
1113
|
+
}
|
|
1114
|
+
};
|
|
1115
|
+
function toSnakeCase(a) {
|
|
1116
|
+
return {
|
|
1117
|
+
table_name: a.tableName,
|
|
1118
|
+
row_pks: a.rowPks,
|
|
1119
|
+
space_id: a.spaceId
|
|
1120
|
+
};
|
|
1121
|
+
}
|
|
1122
|
+
function fromSnakeCase(a) {
|
|
1123
|
+
return {
|
|
1124
|
+
tableName: a.table_name,
|
|
1125
|
+
rowPks: a.row_pks,
|
|
1126
|
+
spaceId: a.space_id
|
|
1127
|
+
};
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1043
1130
|
// src/messages.ts
|
|
1044
1131
|
var HAEXSPACE_MESSAGE_TYPES = {
|
|
1045
1132
|
/** Debug message for development/troubleshooting */
|
|
@@ -1738,6 +1825,7 @@ var HaexVaultSdk = class {
|
|
|
1738
1825
|
this.permissions = new PermissionsAPI(this);
|
|
1739
1826
|
this.remoteStorage = new RemoteStorageAPI(this);
|
|
1740
1827
|
this.localsend = new LocalSendAPI(this);
|
|
1828
|
+
this.spaces = new SpacesAPI(this);
|
|
1741
1829
|
installConsoleForwarding(this.config.debug);
|
|
1742
1830
|
this.readyPromise = new Promise((resolve) => {
|
|
1743
1831
|
this.resolveReady = resolve;
|