@mog-sdk/node 0.1.8 → 0.1.9-beta-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/index.js CHANGED
@@ -87503,8 +87503,16 @@ var WorksheetImpl = class {
87503
87503
  // ===========================================================================
87504
87504
  // Identity (sync)
87505
87505
  // ===========================================================================
87506
- getName() {
87507
- return this._cachedName ?? this.sheetId;
87506
+ async getName() {
87507
+ if (this._cachedName != null) {
87508
+ return this._cachedName;
87509
+ }
87510
+ const name = await this.ctx.computeBridge.getSheetName(this.sheetId);
87511
+ if (name != null) {
87512
+ this._cachedName = name;
87513
+ return name;
87514
+ }
87515
+ return this.sheetId;
87508
87516
  }
87509
87517
  async setName(name) {
87510
87518
  await renameSheet(this.ctx, this.sheetId, name);
@@ -90348,14 +90356,20 @@ var WorkbookImpl = class {
90348
90356
  }
90349
90357
  /**
90350
90358
  * Initialize the workbook. Called by createWorkbook() factory.
90359
+ *
90360
+ * Pre-creates WorksheetImpl instances for all sheets and populates their
90361
+ * cached metadata (name, index, visibility) so that sync accessors like
90362
+ * getName() work immediately without a separate refreshSheetMetadata() call.
90351
90363
  */
90352
90364
  async _init() {
90353
- if (this._ownsActiveSheetTracking) {
90354
- const order = await getOrder(this.ctx);
90355
- if (order.length > 0) {
90356
- this.setActiveSheetIdFn(order[0]);
90357
- }
90365
+ const order = await getOrder(this.ctx);
90366
+ if (this._ownsActiveSheetTracking && order.length > 0) {
90367
+ this.setActiveSheetIdFn(order[0]);
90368
+ }
90369
+ for (const sheetId of order) {
90370
+ this._getOrCreateWorksheet(sheetId);
90358
90371
  }
90372
+ await this.refreshSheetMetadata();
90359
90373
  }
90360
90374
  /**
90361
90375
  * Resolve a name or index to a sheetId. ASYNC — reads from Rust.
@@ -90981,7 +90995,6 @@ async function createWorkbookWithBootstrap(options) {
90981
90995
  ctx: handle.context,
90982
90996
  eventBus
90983
90997
  });
90984
- await wb.refreshSheetMetadata();
90985
90998
  const originalDispose = wb.dispose.bind(wb);
90986
90999
  wb.dispose = () => {
90987
91000
  originalDispose();
@@ -91420,8 +91433,8 @@ var api_spec_default = {
91420
91433
  docstring: "",
91421
91434
  functions: {
91422
91435
  getName: {
91423
- signature: "getName(): string;",
91424
- docstring: "Get the sheet name.",
91436
+ signature: "getName(): Promise<string>;",
91437
+ docstring: "Get the sheet name. Async \u2014 reads from Rust via IPC (cached after first call).",
91425
91438
  usedTypes: [],
91426
91439
  tags: [
91427
91440
  "ask"
@@ -97483,7 +97496,7 @@ Used in condition filters where users specify rules like
97483
97496
  docstring: "A summary snapshot of the entire workbook state."
97484
97497
  }
97485
97498
  },
97486
- generated: "2026-03-31T22:12:29.100Z"
97499
+ generated: "2026-04-01T00:10:05.279Z"
97487
97500
  };
97488
97501
 
97489
97502
  // src/api-describe.ts