@meshagent/meshagent-ts-auth 0.36.2 → 0.36.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,9 @@
1
+ ## [0.36.3]
2
+ - Storage client now supports move operations and emits file moved events.
3
+ - Secrets client now supports existence checks.
4
+ - Project user add calls now omit permission fields unless explicitly set.
5
+ - Updated JS toolchain dependencies: esbuild 0.28.0, jest 30.3.0, mocha 12.0.0-beta-9.2, @tailwindcss/vite 4.2.2, @vitejs/plugin-react 6.0.1, vite 8.0.7.
6
+
1
7
  ## [0.36.2]
2
8
  - Breaking: Removed share-connect API from the TypeScript client (`connectShare` / RoomShareConnectionInfo).
3
9
  - OAuth helpers now default requested scope to `profile` (TS auth + React auth).
@@ -6148,7 +6148,7 @@ meshagent.auth = (() => {
6148
6148
  } catch (e) {
6149
6149
  }
6150
6150
  var varStorage = _localStorage;
6151
- var EqualityTraitSymbol = Symbol("Equality");
6151
+ var EqualityTraitSymbol = /* @__PURE__ */ Symbol("Equality");
6152
6152
  var equals = (a, b) => a === b || !!a?.[EqualityTraitSymbol]?.(b) || false;
6153
6153
  var isObject2 = (o) => typeof o === "object";
6154
6154
  var assign = Object.assign;
@@ -6354,7 +6354,7 @@ meshagent.auth = (() => {
6354
6354
  return str;
6355
6355
  };
6356
6356
  var oneOf = (gen, array) => array[int31(gen, 0, array.length - 1)];
6357
- var schemaSymbol = Symbol("0schema");
6357
+ var schemaSymbol = /* @__PURE__ */ Symbol("0schema");
6358
6358
  var ValidationError = class {
6359
6359
  constructor() {
6360
6360
  this._rerrs = [];
@@ -6632,7 +6632,7 @@ meshagent.auth = (() => {
6632
6632
  }
6633
6633
  };
6634
6634
  var $$stringTemplate = $constructedBy($StringTemplate);
6635
- var isOptionalSymbol = Symbol("optional");
6635
+ var isOptionalSymbol = /* @__PURE__ */ Symbol("optional");
6636
6636
  var $Optional = class extends Schema {
6637
6637
  /**
6638
6638
  * @param {S} shape
@@ -16503,7 +16503,7 @@ ${err.toString()}`);
16503
16503
  "../meshagent-ts/dist/browser/room-event.js"(exports) {
16504
16504
  "use strict";
16505
16505
  Object.defineProperty(exports, "__esModule", { value: true });
16506
- exports.RoomLogEvent = exports.FileUpdatedEvent = exports.FileDeletedEvent = exports.FileCreatedEvent = exports.RoomMessageEvent = exports.RoomMessage = exports.RoomEvent = void 0;
16506
+ exports.RoomLogEvent = exports.FileMovedEvent = exports.FileUpdatedEvent = exports.FileDeletedEvent = exports.FileCreatedEvent = exports.RoomMessageEvent = exports.RoomMessage = exports.RoomEvent = void 0;
16507
16507
  var RoomEvent = class {
16508
16508
  };
16509
16509
  exports.RoomEvent = RoomEvent;
@@ -16571,6 +16571,21 @@ ${err.toString()}`);
16571
16571
  }
16572
16572
  };
16573
16573
  exports.FileUpdatedEvent = FileUpdatedEvent;
16574
+ var FileMovedEvent = class extends RoomEvent {
16575
+ constructor({ sourcePath, destinationPath, participantId }) {
16576
+ super();
16577
+ this.sourcePath = sourcePath;
16578
+ this.destinationPath = destinationPath;
16579
+ this.participantId = participantId;
16580
+ }
16581
+ get name() {
16582
+ return "file moved";
16583
+ }
16584
+ get description() {
16585
+ return `a file was moved from ${this.sourcePath} to ${this.destinationPath}`;
16586
+ }
16587
+ };
16588
+ exports.FileMovedEvent = FileMovedEvent;
16574
16589
  var RoomLogEvent = class extends RoomEvent {
16575
16590
  constructor({ type, data }) {
16576
16591
  super();
@@ -17703,7 +17718,7 @@ ${err.toString()}`);
17703
17718
  var init_helpers = __esm({
17704
17719
  "../node_modules/jose/dist/webapi/lib/helpers.js"() {
17705
17720
  init_base64url();
17706
- unprotected = Symbol();
17721
+ unprotected = /* @__PURE__ */ Symbol();
17707
17722
  }
17708
17723
  });
17709
17724
 
@@ -20828,8 +20843,8 @@ ${newlined}
20828
20843
  const VERSION = "v6.2.2";
20829
20844
  USER_AGENT = `${NAME}/${VERSION}`;
20830
20845
  }
20831
- customFetch = Symbol();
20832
- jwksCache = Symbol();
20846
+ customFetch = /* @__PURE__ */ Symbol();
20847
+ jwksCache = /* @__PURE__ */ Symbol();
20833
20848
  RemoteJWKSet = class {
20834
20849
  constructor(url, options) {
20835
20850
  __privateAdd(this, _url);
@@ -23066,15 +23081,15 @@ ${newlined}
23066
23081
  });
23067
23082
  }
23068
23083
  async addUserToProject(projectId, userId, options = {}) {
23069
- const { isAdmin = false, isDeveloper = false, canCreateRooms = false } = options;
23084
+ const { isAdmin, isDeveloper, canCreateRooms } = options;
23070
23085
  return await this.request(`/accounts/projects/${projectId}/users`, {
23071
23086
  method: "POST",
23072
23087
  json: {
23073
23088
  project_id: projectId,
23074
23089
  user_id: userId,
23075
- is_admin: isAdmin,
23076
- is_developer: isDeveloper,
23077
- can_create_rooms: canCreateRooms
23090
+ ...isAdmin !== void 0 ? { is_admin: isAdmin } : {},
23091
+ ...isDeveloper !== void 0 ? { is_developer: isDeveloper } : {},
23092
+ ...canCreateRooms !== void 0 ? { can_create_rooms: canCreateRooms } : {}
23078
23093
  },
23079
23094
  action: "add user to project"
23080
23095
  });
@@ -25027,7 +25042,7 @@ ${newlined}
25027
25042
  await this._task;
25028
25043
  }
25029
25044
  };
25030
- SyncOpenStreamState.INPUT_STREAM_CLOSE = Symbol("sync-open-input-close");
25045
+ SyncOpenStreamState.INPUT_STREAM_CLOSE = /* @__PURE__ */ Symbol("sync-open-input-close");
25031
25046
  var SyncClient = class extends event_emitter_1.EventEmitter {
25032
25047
  constructor({ room }) {
25033
25048
  super();
@@ -25326,6 +25341,7 @@ ${newlined}
25326
25341
  super();
25327
25342
  this.client = room;
25328
25343
  this.client.protocol.addHandler("storage.file.deleted", this._handleFileDeleted.bind(this));
25344
+ this.client.protocol.addHandler("storage.file.moved", this._handleFileMoved.bind(this));
25329
25345
  this.client.protocol.addHandler("storage.file.updated", this._handleFileUpdated.bind(this));
25330
25346
  }
25331
25347
  async _handleFileUpdated(protocol, messageId, type, bytes) {
@@ -25340,6 +25356,16 @@ ${newlined}
25340
25356
  this.client.emit(event);
25341
25357
  this.emit("file.deleted", event);
25342
25358
  }
25359
+ async _handleFileMoved(protocol, messageId, type, bytes) {
25360
+ const [data, _] = (0, utils_1.unpackMessage)(bytes || new Uint8Array());
25361
+ const event = new room_event_1.FileMovedEvent({
25362
+ sourcePath: data["source_path"],
25363
+ destinationPath: data["destination_path"],
25364
+ participantId: data["participant_id"]
25365
+ });
25366
+ this.client.emit(event);
25367
+ this.emit("file.moved", event);
25368
+ }
25343
25369
  _unexpectedResponseError(operation) {
25344
25370
  return _unexpectedStorageResponseError(operation);
25345
25371
  }
@@ -25386,6 +25412,13 @@ ${newlined}
25386
25412
  async delete(path, { recursive = null } = {}) {
25387
25413
  await this._invoke("delete", { path, recursive });
25388
25414
  }
25415
+ async move(sourcePath, destinationPath, { overwrite = false } = {}) {
25416
+ await this._invoke("move", {
25417
+ source_path: sourcePath,
25418
+ destination_path: destinationPath,
25419
+ overwrite
25420
+ });
25421
+ }
25389
25422
  async exists(path) {
25390
25423
  const result = await this._invoke("exists", { path });
25391
25424
  if (!(result instanceof response_1.JsonContent)) {
@@ -25981,6 +26014,17 @@ ${newlined}
25981
26014
  }
25982
26015
  return secrets.map((item) => this.parseSecretInfo(item));
25983
26016
  }
26017
+ async exists({ secretId, delegatedTo, forIdentity }) {
26018
+ const response = await this.invoke("exists", {
26019
+ secret_id: secretId,
26020
+ delegated_to: delegatedTo ?? null,
26021
+ for_identity: forIdentity ?? null
26022
+ });
26023
+ if (!(response instanceof response_1.JsonContent) || typeof response.json["exists"] !== "boolean") {
26024
+ throw this.unexpectedResponse("exists");
26025
+ }
26026
+ return response.json["exists"];
26027
+ }
25984
26028
  async deleteSecret({ secretId, delegatedTo }) {
25985
26029
  const response = await this.invoke("delete_secret", {
25986
26030
  id: secretId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meshagent/meshagent-ts-auth",
3
- "version": "0.36.2",
3
+ "version": "0.36.3",
4
4
  "description": "Meshagent Typescript Auth",
5
5
  "homepage": "https://github.com/meshagent/meshagent-ts-auth",
6
6
  "scripts": {
@@ -37,14 +37,14 @@
37
37
  "CHANGELOG.md"
38
38
  ],
39
39
  "dependencies": {
40
- "@meshagent/meshagent": "^0.36.2",
40
+ "@meshagent/meshagent": "^0.36.3",
41
41
  "typescript": "^5.8.3"
42
42
  },
43
43
  "devDependencies": {
44
- "esbuild": "^0.25.0",
44
+ "esbuild": "^0.28.0",
45
45
  "jest": "^30.3.0"
46
46
  },
47
47
  "overrides": {
48
48
  "rollup": "4.52.5"
49
49
  }
50
- }
50
+ }