@haex-space/vault-sdk 2.5.112 → 2.5.113

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.
@@ -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-GPE112vL.mjs';
3
+ import { H as HaexVaultSdk } from '../client-Dfy9UQeu.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-BVMJXZiK.js';
3
+ import { H as HaexVaultSdk } from '../client-Dhn288AJ.js';
4
4
  import { A as ApplicationContext } from '../types-gfc9eCL4.js';
5
5
  import 'drizzle-orm/sqlite-proxy';
6
6
 
@@ -239,7 +239,13 @@ var SPACE_COMMANDS = {
239
239
  /** Bulk unassign rows from spaces */
240
240
  unassign: "extension_space_unassign",
241
241
  /** Get space assignments for a table */
242
- getAssignments: "extension_space_get_assignments"
242
+ getAssignments: "extension_space_get_assignments",
243
+ /** List all spaces the user is a member of (with decrypted names) */
244
+ list: "extension_space_list",
245
+ /** Create a new shared space */
246
+ create: "extension_space_create",
247
+ /** List available sync backends */
248
+ listBackends: "extension_space_list_backends"
243
249
  };
244
250
 
245
251
  // src/api/storage.ts
@@ -1111,19 +1117,48 @@ var SpacesAPI = class {
1111
1117
  async unassignRowAsync(tableName, rowPks, spaceId) {
1112
1118
  return this.unassignAsync([{ tableName, rowPks, spaceId }]);
1113
1119
  }
1120
+ // ==========================================================================
1121
+ // Space Management
1122
+ // ==========================================================================
1123
+ /**
1124
+ * List all shared spaces the user is a member of.
1125
+ * Returns spaces with decrypted names (decryption happens vault-side).
1126
+ */
1127
+ async listSpacesAsync() {
1128
+ return this.client.request(SPACE_COMMANDS.list);
1129
+ }
1130
+ /**
1131
+ * Create a new shared space.
1132
+ * @param name - Human-readable space name
1133
+ * @param serverUrl - The sync server URL to create the space on
1134
+ * @returns The created space with decrypted name
1135
+ */
1136
+ async createSpaceAsync(name, serverUrl) {
1137
+ return this.client.request(SPACE_COMMANDS.create, {
1138
+ name,
1139
+ server_url: serverUrl
1140
+ });
1141
+ }
1142
+ /**
1143
+ * List available sync backends that can host shared spaces.
1144
+ * @returns Array of backend info with server URLs
1145
+ */
1146
+ async listSyncBackendsAsync() {
1147
+ return this.client.request(SPACE_COMMANDS.listBackends);
1148
+ }
1114
1149
  };
1115
- function toSnakeCase(a) {
1150
+ function toSnakeCase(assignment) {
1116
1151
  return {
1117
- table_name: a.tableName,
1118
- row_pks: a.rowPks,
1119
- space_id: a.spaceId
1152
+ table_name: assignment.tableName,
1153
+ row_pks: assignment.rowPks,
1154
+ space_id: assignment.spaceId
1120
1155
  };
1121
1156
  }
1122
- function fromSnakeCase(a) {
1157
+ function fromSnakeCase(assignment) {
1123
1158
  return {
1124
- tableName: a.table_name,
1125
- rowPks: a.row_pks,
1126
- spaceId: a.space_id
1159
+ tableName: assignment.table_name,
1160
+ rowPks: assignment.row_pks,
1161
+ spaceId: assignment.space_id
1127
1162
  };
1128
1163
  }
1129
1164