@xyo-network/node-memory 3.6.9 → 3.6.10

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,3 @@
1
- var __defProp = Object.defineProperty;
2
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
-
4
1
  // src/MemoryNode.ts
5
2
  import { assertEx } from "@xylabs/assert";
6
3
  import { exists } from "@xylabs/exists";
@@ -9,16 +6,16 @@ import { AbstractNode } from "@xyo-network/node-abstract";
9
6
  import { isNodeModule } from "@xyo-network/node-model";
10
7
  import { Mutex } from "async-mutex";
11
8
  var MemoryNode = class extends AbstractNode {
12
- static {
13
- __name(this, "MemoryNode");
14
- }
15
9
  registeredModuleMap = {};
16
10
  _attachMutex = new Mutex();
17
11
  _attachedPrivateModules = /* @__PURE__ */ new Set();
18
12
  _attachedPublicModules = /* @__PURE__ */ new Set();
19
13
  async attachHandler(id, external) {
20
14
  await this.started("throw");
21
- return assertEx(isAddress(id) ? await this.attachUsingAddress(id, external) : await this.attachUsingName(id, external), () => `Unable to locate module [${id}]`);
15
+ return assertEx(
16
+ isAddress(id) ? await this.attachUsingAddress(id, external) : await this.attachUsingName(id, external),
17
+ () => `Unable to locate module [${id}]`
18
+ );
22
19
  }
23
20
  async certifyHandler(id) {
24
21
  const child = (await this.publicChildren()).find((child2) => child2.modName === id || child2.address === id);
@@ -51,16 +48,15 @@ var MemoryNode = class extends AbstractNode {
51
48
  }
52
49
  }
53
50
  this.registeredModuleMap[mod.address] = mod;
54
- const args = {
55
- mod,
56
- name: mod.modName
57
- };
51
+ const args = { mod, name: mod.modName };
58
52
  await this.emit("moduleRegistered", args);
59
53
  }
60
54
  registeredHandler() {
61
- return Promise.resolve(Object.keys(this.registeredModuleMap).map((key) => {
62
- return key;
63
- }));
55
+ return Promise.resolve(
56
+ Object.keys(this.registeredModuleMap).map((key) => {
57
+ return key;
58
+ })
59
+ );
64
60
  }
65
61
  registeredModules() {
66
62
  return Object.values(this.registeredModuleMap).map((value) => {
@@ -74,10 +70,7 @@ var MemoryNode = class extends AbstractNode {
74
70
  } catch {
75
71
  }
76
72
  delete this.registeredModuleMap[mod.address];
77
- const args = {
78
- mod,
79
- name: mod.modName
80
- };
73
+ const args = { mod, name: mod.modName };
81
74
  await this.emit("moduleUnregistered", args);
82
75
  return this;
83
76
  }
@@ -106,14 +99,11 @@ var MemoryNode = class extends AbstractNode {
106
99
  this.privateResolver.addResolver(mod.downResolver);
107
100
  }
108
101
  mod.addParent(this);
109
- const args = {
110
- mod,
111
- name: mod.modName
112
- };
102
+ const args = { mod, name: mod.modName };
113
103
  await this.emit("moduleAttached", args);
114
104
  if (isNodeModule(mod) && external) {
115
- const attachedListener = /* @__PURE__ */ __name(async (args2) => await this.emit("moduleAttached", args2), "attachedListener");
116
- const detachedListener = /* @__PURE__ */ __name(async (args2) => await this.emit("moduleDetached", args2), "detachedListener");
105
+ const attachedListener = async (args2) => await this.emit("moduleAttached", args2);
106
+ const detachedListener = async (args2) => await this.emit("moduleDetached", args2);
117
107
  mod.on("moduleAttached", attachedListener);
118
108
  mod.on("moduleDetached", detachedListener);
119
109
  }
@@ -136,10 +126,7 @@ var MemoryNode = class extends AbstractNode {
136
126
  if (isAttachedPrivate) {
137
127
  this._attachedPrivateModules.delete(mod.address);
138
128
  }
139
- const args = {
140
- mod,
141
- name: mod.modName
142
- };
129
+ const args = { mod, name: mod.modName };
143
130
  await this.emit("moduleDetached", args);
144
131
  if (isNodeModule(mod)) {
145
132
  const notificationList = await this.getModulesToNotifyAbout(mod);
@@ -164,9 +151,7 @@ var MemoryNode = class extends AbstractNode {
164
151
  }
165
152
  async getModulesToNotifyAbout(node) {
166
153
  const notifiedAddresses = [];
167
- const childModules = await node.resolve("*", {
168
- direction: "down"
169
- });
154
+ const childModules = await node.resolve("*", { direction: "down" });
170
155
  return childModules.map((child) => {
171
156
  if (node.address === child.address) {
172
157
  return;
@@ -179,22 +164,20 @@ var MemoryNode = class extends AbstractNode {
179
164
  }).filter(exists);
180
165
  }
181
166
  async notifyOfExistingModulesAttached(childModules) {
182
- await Promise.all(childModules.map(async (child) => {
183
- const args = {
184
- mod: child,
185
- name: child.modName
186
- };
187
- await this.emit("moduleAttached", args);
188
- }));
167
+ await Promise.all(
168
+ childModules.map(async (child) => {
169
+ const args = { mod: child, name: child.modName };
170
+ await this.emit("moduleAttached", args);
171
+ })
172
+ );
189
173
  }
190
174
  async notifyOfExistingModulesDetached(childModules) {
191
- await Promise.all(childModules.map(async (child) => {
192
- const args = {
193
- mod: child,
194
- name: child.modName
195
- };
196
- await this.emit("moduleDetached", args);
197
- }));
175
+ await Promise.all(
176
+ childModules.map(async (child) => {
177
+ const args = { mod: child, name: child.modName };
178
+ await this.emit("moduleDetached", args);
179
+ })
180
+ );
198
181
  }
199
182
  registeredModuleAddressFromName(name) {
200
183
  return Object.values(this.registeredModuleMap).find((value) => {
@@ -214,28 +197,30 @@ import { asNodeInstance } from "@xyo-network/node-model";
214
197
  import { assertEx as assertEx2 } from "@xylabs/assert";
215
198
  import { exists as exists2 } from "@xylabs/exists";
216
199
  import { asAttachableModuleInstance } from "@xyo-network/module-model";
217
- var flatAttachAllToExistingNode = /* @__PURE__ */ __name(async (source, destination) => {
200
+ var flatAttachAllToExistingNode = async (source, destination) => {
218
201
  const children = (await source.publicChildren()).map((child) => asAttachableModuleInstance(child)).filter(exists2);
219
- await Promise.all(children.map(async (child) => {
220
- await destination.register?.(child);
221
- await destination.attach(child.address, true);
222
- }));
202
+ await Promise.all(
203
+ children.map(async (child) => {
204
+ await destination.register?.(child);
205
+ await destination.attach(child.address, true);
206
+ })
207
+ );
223
208
  return destination;
224
- }, "flatAttachAllToExistingNode");
225
- var flatAttachChildToExistingNode = /* @__PURE__ */ __name(async (source, id, destination) => {
209
+ };
210
+ var flatAttachChildToExistingNode = async (source, id, destination) => {
226
211
  assertEx2(id !== "*", () => "* is not a single child");
227
212
  const child = assertEx2(await source.resolve(id), () => `Module ${id} not found`);
228
213
  const attachableChild = asAttachableModuleInstance(child, () => `Module ${id} is not attachable`);
229
214
  await destination.register?.(attachableChild);
230
215
  await destination.attach(child.address, true);
231
216
  return destination;
232
- }, "flatAttachChildToExistingNode");
233
- var flatAttachToExistingNode = /* @__PURE__ */ __name(async (source, id, destination) => {
217
+ };
218
+ var flatAttachToExistingNode = async (source, id, destination) => {
234
219
  return id === "*" ? await flatAttachAllToExistingNode(source, destination) : flatAttachChildToExistingNode(source, id, destination);
235
- }, "flatAttachToExistingNode");
220
+ };
236
221
 
237
222
  // src/NodeHelper/attachToExistingNode.ts
238
- var attachToExistingNode = /* @__PURE__ */ __name(async (source, id, destination) => {
223
+ var attachToExistingNode = async (source, id, destination) => {
239
224
  const parts = id.split(":");
240
225
  const first = assertEx3(parts.shift(), () => "missing first part");
241
226
  if (parts.length === 0) {
@@ -243,33 +228,27 @@ var attachToExistingNode = /* @__PURE__ */ __name(async (source, id, destination
243
228
  } else {
244
229
  const firstModule = await source.resolve(first);
245
230
  const firstNode = asNodeInstance(firstModule, () => "first part is not a node");
246
- const newNode = await MemoryNode.create({
247
- config: firstNode.config
248
- });
231
+ const newNode = await MemoryNode.create({ config: firstNode.config });
249
232
  await destination.register?.(newNode);
250
233
  await destination.attach(newNode.address, true);
251
234
  await attachToExistingNode(firstNode, parts.join(":"), newNode);
252
235
  return destination;
253
236
  }
254
- }, "attachToExistingNode");
237
+ };
255
238
 
256
239
  // src/NodeHelper/attachToNewNode.ts
257
240
  import { NodeConfigSchema } from "@xyo-network/node-model";
258
- var DEFAULT_NODE_PARAMS = {
259
- config: {
260
- schema: NodeConfigSchema
261
- }
262
- };
263
- var attachToNewNode = /* @__PURE__ */ __name(async (source, id, destinationParams = DEFAULT_NODE_PARAMS) => {
241
+ var DEFAULT_NODE_PARAMS = { config: { schema: NodeConfigSchema } };
242
+ var attachToNewNode = async (source, id, destinationParams = DEFAULT_NODE_PARAMS) => {
264
243
  const destination = await MemoryNode.create(destinationParams);
265
244
  return await attachToExistingNode(source, id, destination);
266
- }, "attachToNewNode");
245
+ };
267
246
 
268
247
  // src/NodeHelper/flatAttachToNewNode.ts
269
- var flatAttachToNewNode = /* @__PURE__ */ __name(async (source, id, destinationParams) => {
248
+ var flatAttachToNewNode = async (source, id, destinationParams) => {
270
249
  const destination = await MemoryNode.create(destinationParams);
271
250
  return await flatAttachToExistingNode(source, id, destination);
272
- }, "flatAttachToNewNode");
251
+ };
273
252
 
274
253
  // src/NodeHelper/index.ts
275
254
  var MemoryNodeHelper = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/MemoryNode.ts","../../src/NodeHelper/index.ts","../../src/NodeHelper/attachToExistingNode.ts","../../src/NodeHelper/flatAttachToExistingNode.ts","../../src/NodeHelper/attachToNewNode.ts","../../src/NodeHelper/flatAttachToNewNode.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport type { Address } from '@xylabs/hex'\nimport { isAddress } from '@xylabs/hex'\nimport type { Promisable } from '@xylabs/promise'\nimport type { EventListener } from '@xyo-network/module-events'\nimport type {\n AnyConfigSchema,\n AttachableModuleInstance,\n Module,\n ModuleIdentifier,\n ModuleInstance,\n ModuleResolverInstance,\n} from '@xyo-network/module-model'\nimport type { CompositeModuleResolver } from '@xyo-network/module-resolver'\nimport { AbstractNode } from '@xyo-network/node-abstract'\nimport type {\n AttachableNodeInstance, ChildCertificationFields, NodeConfig, NodeModuleEventData, NodeParams,\n} from '@xyo-network/node-model'\nimport { isNodeModule } from '@xyo-network/node-model'\nimport { Mutex } from 'async-mutex'\n\nexport type MemoryNodeParams = NodeParams<AnyConfigSchema<NodeConfig>>\n\nexport class MemoryNode<TParams extends MemoryNodeParams = MemoryNodeParams, TEventData extends NodeModuleEventData = NodeModuleEventData>\n extends AbstractNode<TParams, TEventData>\n implements AttachableNodeInstance<TParams, TEventData> {\n protected registeredModuleMap: Record<Address, AttachableModuleInstance> = {}\n\n private _attachMutex = new Mutex()\n\n private _attachedPrivateModules = new Set<Address>()\n private _attachedPublicModules = new Set<Address>()\n\n async attachHandler(id: ModuleIdentifier, external?: boolean) {\n await this.started('throw')\n return assertEx(\n isAddress(id) ? await this.attachUsingAddress(id as Address, external) : await this.attachUsingName(id, external),\n () => `Unable to locate module [${id}]`,\n )\n }\n\n async certifyHandler(id: ModuleIdentifier): Promise<ChildCertificationFields> {\n const child = (await this.publicChildren()).find(child => child.modName === id || child.address === id)\n if (child) {\n return { address: child.address, expiration: Date.now() + 1000 * 60 * 10 /* 10 minutes */ }\n }\n throw new Error(`Unable to certify child module [${id}]`)\n }\n\n async detachHandler(id: ModuleIdentifier) {\n await this.started('throw')\n return isAddress(id) ? await this.detachUsingAddress(id as Address) : await this.detachUsingName(id)\n }\n\n override privateChildren(): Promise<ModuleInstance[]> {\n return this.attachedPrivateModules()\n }\n\n override publicChildren(): Promise<ModuleInstance[]> {\n return this.attachedPublicModules()\n }\n\n async register(mod: AttachableModuleInstance) {\n await this.started('throw')\n if (this.registeredModuleMap[mod.address]) {\n if (this.registeredModuleMap[mod.address] === mod) {\n this.logger.warn(`Module already registered at that address[${mod.address}]|${mod.id}|[${mod.config.schema}]`)\n } else {\n throw new Error(`Other module already registered at that address[${mod.address}]|${mod.id}|[${mod.config.schema}]`)\n }\n }\n this.registeredModuleMap[mod.address] = mod\n const args = { mod, name: mod.modName }\n await this.emit('moduleRegistered', args)\n }\n\n registeredHandler(): Promisable<Address[]> {\n return Promise.resolve(\n (Object.keys(this.registeredModuleMap) as Address[]).map((key) => {\n return key\n }),\n )\n }\n\n registeredModules(): AttachableModuleInstance[] {\n return Object.values(this.registeredModuleMap).map((value) => {\n return value\n })\n }\n\n async unregister(mod: ModuleInstance): Promise<ModuleInstance> {\n await this.started('throw')\n // try to detach if it is attached\n try {\n await this.detach(mod.address)\n } catch {}\n delete this.registeredModuleMap[mod.address]\n const args = { mod, name: mod.modName }\n await this.emit('moduleUnregistered', args)\n return this\n }\n\n protected async attachUsingAddress(address: Address, external?: boolean) {\n return await this._attachMutex.runExclusive(async () => {\n const existingModule = await this.resolve(address)\n if (existingModule) {\n this.logger.warn(`MemoryNode: Module [${existingModule?.modName ?? existingModule?.address}] already attached at address [${address}]`)\n }\n const mod = assertEx(this.registeredModuleMap[address], () => `No Module Registered at address [${address}]`)\n\n if (this._attachedPublicModules.has(mod.address)) {\n this.logger.warn(`Module [${mod.modName}] already attached at [${address}] (public)`)\n }\n if (this._attachedPrivateModules.has(mod.address)) {\n this.logger.warn(`Module [${mod.modName}] already attached at [${address}] (private)`)\n }\n\n const notificationList = await this.getModulesToNotifyAbout(mod)\n\n // give it private access\n mod.upResolver.addResolver?.(this.privateResolver)\n\n // give it public access\n mod.upResolver.addResolver?.(this.downResolver as CompositeModuleResolver)\n\n // give it outside access\n mod.upResolver.addResolver?.(this.upResolver)\n\n if (external) {\n // expose it externally\n this._attachedPublicModules.add(mod.address)\n this.downResolver.addResolver(mod.downResolver as ModuleResolverInstance)\n } else {\n this._attachedPrivateModules.add(mod.address)\n this.privateResolver.addResolver(mod.downResolver as ModuleResolverInstance)\n }\n\n mod.addParent(this)\n\n const args = { mod, name: mod.modName }\n await this.emit('moduleAttached', args)\n\n if (isNodeModule(mod) && external) {\n const attachedListener: EventListener<TEventData['moduleAttached']> = async (args: TEventData['moduleAttached']) =>\n await this.emit('moduleAttached', args)\n\n const detachedListener: EventListener<TEventData['moduleDetached']> = async (args: TEventData['moduleDetached']) =>\n await this.emit('moduleDetached', args)\n\n mod.on('moduleAttached', attachedListener as EventListener)\n mod.on('moduleDetached', detachedListener as EventListener)\n }\n\n await this.notifyOfExistingModulesAttached(notificationList)\n\n return address\n })\n }\n\n protected async detachUsingAddress(address: Address) {\n const mod = assertEx(this.registeredModuleMap[address], () => `No Module Registered at address [${address}]`)\n\n const isAttachedPublic = this._attachedPublicModules.has(mod.address)\n const isAttachedPrivate = this._attachedPrivateModules.has(mod.address)\n\n assertEx(isAttachedPublic || isAttachedPrivate, () => `Module [${mod.modName}] not attached at [${address}]`)\n\n // remove inside access\n mod.upResolver?.removeResolver?.(this.privateResolver)\n\n // remove outside access\n mod.upResolver?.removeResolver?.(this.upResolver)\n\n // remove external exposure\n this.downResolver.removeResolver(mod.downResolver as ModuleResolverInstance)\n\n mod.removeParent(this.address)\n\n if (isAttachedPublic) {\n this._attachedPublicModules.delete(mod.address)\n }\n\n if (isAttachedPrivate) {\n this._attachedPrivateModules.delete(mod.address)\n }\n\n const args = { mod, name: mod.modName }\n await this.emit('moduleDetached', args)\n\n // notify of all sub node children detach\n if (isNodeModule(mod)) {\n const notificationList = await this.getModulesToNotifyAbout(mod)\n await this.notifyOfExistingModulesDetached(notificationList)\n }\n return address\n }\n\n protected override startHandler() {\n return super.startHandler()\n }\n\n private async attachUsingName(name: string, external?: boolean) {\n const address = this.registeredModuleAddressFromName(name)\n if (address) {\n return await this.attachUsingAddress(address, external)\n }\n }\n\n private async detachUsingName(name: string) {\n const address = this.registeredModuleAddressFromName(name)\n if (address) {\n return await this.detachUsingAddress(address)\n }\n }\n\n private async getModulesToNotifyAbout(node: ModuleInstance) {\n const notifiedAddresses: string[] = []\n // send attach events for all existing attached modules\n const childModules = await node.resolve('*', { direction: 'down' })\n return (\n childModules.map((child) => {\n // don't report self\n if (node.address === child.address) {\n return\n }\n\n // prevent loop\n if (notifiedAddresses.includes(child.address)) {\n return\n }\n\n notifiedAddresses.push(child.address)\n\n return child\n })\n ).filter(exists)\n }\n\n private async notifyOfExistingModulesAttached(childModules: Module[]) {\n await Promise.all(\n childModules.map(async (child) => {\n const args = { mod: child, name: child.modName }\n await this.emit('moduleAttached', args)\n }),\n )\n }\n\n private async notifyOfExistingModulesDetached(childModules: Module[]) {\n await Promise.all(\n childModules.map(async (child) => {\n const args = { mod: child, name: child.modName }\n await this.emit('moduleDetached', args)\n }),\n )\n }\n\n private registeredModuleAddressFromName(name: string) {\n return Object.values(this.registeredModuleMap).find((value) => {\n return value.modName === name\n })?.address\n }\n}\n","import { NodeHelper } from '@xyo-network/node-abstract'\n\nimport { attachToExistingNode } from './attachToExistingNode.ts'\nimport { attachToNewNode } from './attachToNewNode.ts'\nimport {\n flatAttachAllToExistingNode, flatAttachChildToExistingNode, flatAttachToExistingNode,\n} from './flatAttachToExistingNode.ts'\nimport { flatAttachToNewNode } from './flatAttachToNewNode.ts'\n\nexport const MemoryNodeHelper = {\n ...NodeHelper,\n attachToExistingNode,\n attachToNewNode,\n flatAttachAllToExistingNode,\n flatAttachChildToExistingNode,\n flatAttachToExistingNode,\n flatAttachToNewNode,\n}\n","import { assertEx } from '@xylabs/assert'\nimport type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { NodeInstance } from '@xyo-network/node-model'\nimport { asNodeInstance } from '@xyo-network/node-model'\n\nimport { MemoryNode } from '../MemoryNode.ts'\nimport { flatAttachToExistingNode } from './flatAttachToExistingNode.ts'\n\nexport const attachToExistingNode = async (source: NodeInstance, id: ModuleIdentifier, destination: NodeInstance): Promise<NodeInstance> => {\n const parts = id.split(':')\n const first = assertEx(parts.shift(), () => 'missing first part')\n if (parts.length === 0) {\n // this is an immediate child/children\n return await flatAttachToExistingNode(source, first, destination)\n } else {\n // all parts that are not the last should be nodes, build them and nest\n const firstModule = await source.resolve(first)\n const firstNode = asNodeInstance(firstModule, () => 'first part is not a node')\n const newNode = await MemoryNode.create({ config: firstNode.config })\n await destination.register?.(newNode)\n await destination.attach(newNode.address, true)\n await attachToExistingNode(firstNode, parts.join(':'), newNode)\n return destination\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport type { ModuleIdentifier } from '@xyo-network/module-model'\nimport { asAttachableModuleInstance } from '@xyo-network/module-model'\nimport type { NodeInstance } from '@xyo-network/node-model'\n\nexport const flatAttachAllToExistingNode = async (source: NodeInstance, destination: NodeInstance): Promise<NodeInstance> => {\n const children = (await source.publicChildren()).map(child => asAttachableModuleInstance(child)).filter(exists)\n await Promise.all(\n children.map(async (child) => {\n await destination.register?.(child)\n await destination.attach(child.address, true)\n }),\n )\n return destination\n}\n\nexport const flatAttachChildToExistingNode = async (source: NodeInstance, id: ModuleIdentifier, destination: NodeInstance): Promise<NodeInstance> => {\n assertEx(id !== '*', () => '* is not a single child')\n const child = assertEx(await source.resolve(id), () => `Module ${id} not found`)\n const attachableChild = asAttachableModuleInstance(child, () => `Module ${id} is not attachable`)\n await destination.register?.(attachableChild)\n await destination.attach(child.address, true)\n return destination\n}\n\nexport const flatAttachToExistingNode = async (source: NodeInstance, id: ModuleIdentifier, destination: NodeInstance): Promise<NodeInstance> => {\n return id === '*' ? await flatAttachAllToExistingNode(source, destination) : flatAttachChildToExistingNode(source, id, destination)\n}\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport { NodeConfigSchema, type NodeInstance } from '@xyo-network/node-model'\n\nimport type { MemoryNodeParams } from '../MemoryNode.ts'\nimport { MemoryNode } from '../MemoryNode.ts'\nimport { attachToExistingNode } from './attachToExistingNode.ts'\n\nconst DEFAULT_NODE_PARAMS = { config: { schema: NodeConfigSchema } }\n\nexport const attachToNewNode = async (\n source: NodeInstance,\n id: ModuleIdentifier,\n destinationParams: MemoryNodeParams = DEFAULT_NODE_PARAMS,\n): Promise<NodeInstance> => {\n const destination = await MemoryNode.create(destinationParams)\n return await attachToExistingNode(source, id, destination)\n}\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { NodeInstance } from '@xyo-network/node-model'\n\nimport type { MemoryNodeParams } from '../MemoryNode.ts'\nimport { MemoryNode } from '../MemoryNode.ts'\nimport { flatAttachToExistingNode } from './flatAttachToExistingNode.ts'\n\nexport const flatAttachToNewNode = async (\n source: NodeInstance,\n id: ModuleIdentifier,\n destinationParams: MemoryNodeParams,\n): Promise<NodeInstance> => {\n const destination = await MemoryNode.create(destinationParams)\n return await flatAttachToExistingNode(source, id, destination)\n}\n"],"mappings":";;;;AAAA,SAASA,gBAAgB;AACzB,SAASC,cAAc;AAEvB,SAASC,iBAAiB;AAY1B,SAASC,oBAAoB;AAI7B,SA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,QAAQL,UAAUK;IAAO,CAAA;AACnE,UAAMf,YAAYgB,WAAWJ,OAAAA;AAC7B,UAAMZ,YAAYiB,OAAOL,QAAQM,SAAS,IAAA;AAC1C,UAAMrB,qBAAqBa,WAAWT,MAAMkB,KAAK,GAAA,GAAMP,OAAAA;AACvD,WAAOZ;EACT;AACF,GAhBoC;;;AEPpC,SAASoB,wBAA2C;AAMpD,IAAMC,sBAAsB;EAAEC,QAAQ;IAAEC,QAAQC;EAAiB;AAAE;AAE5D,IAAMC,kBAAkB,8BAC7BC,QACAC,IACAC,oBAAsCP,wBAAmB;AAEzD,QAAMQ,cAAc,MAAMC,WAAWC,OAAOH,iBAAAA;AAC5C,SAAO,MAAMI,qBAAqBN,QAAQC,IAAIE,WAAAA;AAChD,GAP+B;;;ACFxB,IAAMI,sBAAsB,8BACjCC,QACAC,IACAC,sBAAAA;AAEA,QAAMC,cAAc,MAAMC,WAAWC,OAAOH,iBAAAA;AAC5C,SAAO,MAAMI,yBAAyBN,QAAQC,IAAIE,WAAAA;AACpD,GAPmC;;;AJE5B,IAAMI,mBAAmB;EAC9B,GAAGC;EACHC;EACAC;EACAC;EACAC;EACAC;EACAC;AACF;","names":["assertEx","exists","isAddress","AbstractNode","isNodeModule","Mutex","MemoryNode","AbstractNode","registeredModuleMap","_attachMutex","Mutex","_attachedPrivateModules","Set","_attachedPublicModules","attachHandler","id","external","started","assertEx","isAddress","attachUsingAddress","attachUsingName","certifyHandler","child","publicChildren","find","modName","address","expiration","Date","now","Error","detachHandler","detachUsingAddress","detachUsingName","privateChildren","attachedPrivateModules","attachedPublicModules","register","mod","logger","warn","config","schema","args","name","emit","registeredHandler","Promise","resolve","Object","keys","map","key","registeredModules","values","value","unregister","detach","runExclusive","existingModule","has","notificationList","getModulesToNotifyAbout","upResolver","addResolver","privateResolver","downResolver","add","addParent","isNodeModule","attachedListener","detachedListener","on","notifyOfExistingModulesAttached","isAttachedPublic","isAttachedPrivate","removeResolver","removeParent","delete","notifyOfExistingModulesDetached","startHandler","registeredModuleAddressFromName","node","notifiedAddresses","childModules","direction","includes","push","filter","exists","all","NodeHelper","assertEx","asNodeInstance","assertEx","exists","asAttachableModuleInstance","flatAttachAllToExistingNode","source","destination","children","publicChildren","map","child","asAttachableModuleInstance","filter","exists","Promise","all","register","attach","address","flatAttachChildToExistingNode","id","assertEx","resolve","attachableChild","flatAttachToExistingNode","attachToExistingNode","source","id","destination","parts","split","first","assertEx","shift","length","flatAttachToExistingNode","firstModule","resolve","firstNode","asNodeInstance","newNode","MemoryNode","create","config","register","attach","address","join","NodeConfigSchema","DEFAULT_NODE_PARAMS","config","schema","NodeConfigSchema","attachToNewNode","source","id","destinationParams","destination","MemoryNode","create","attachToExistingNode","flatAttachToNewNode","source","id","destinationParams","destination","MemoryNode","create","flatAttachToExistingNode","MemoryNodeHelper","NodeHelper","attachToExistingNode","attachToNewNode","flatAttachAllToExistingNode","flatAttachChildToExistingNode","flatAttachToExistingNode","flatAttachToNewNode"]}
1
+ {"version":3,"sources":["../../src/MemoryNode.ts","../../src/NodeHelper/index.ts","../../src/NodeHelper/attachToExistingNode.ts","../../src/NodeHelper/flatAttachToExistingNode.ts","../../src/NodeHelper/attachToNewNode.ts","../../src/NodeHelper/flatAttachToNewNode.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport type { Address } from '@xylabs/hex'\nimport { isAddress } from '@xylabs/hex'\nimport type { Promisable } from '@xylabs/promise'\nimport type { EventListener } from '@xyo-network/module-events'\nimport type {\n AnyConfigSchema,\n AttachableModuleInstance,\n Module,\n ModuleIdentifier,\n ModuleInstance,\n ModuleResolverInstance,\n} from '@xyo-network/module-model'\nimport type { CompositeModuleResolver } from '@xyo-network/module-resolver'\nimport { AbstractNode } from '@xyo-network/node-abstract'\nimport type {\n AttachableNodeInstance, ChildCertificationFields, NodeConfig, NodeModuleEventData, NodeParams,\n} from '@xyo-network/node-model'\nimport { isNodeModule } from '@xyo-network/node-model'\nimport { Mutex } from 'async-mutex'\n\nexport type MemoryNodeParams = NodeParams<AnyConfigSchema<NodeConfig>>\n\nexport class MemoryNode<TParams extends MemoryNodeParams = MemoryNodeParams, TEventData extends NodeModuleEventData = NodeModuleEventData>\n extends AbstractNode<TParams, TEventData>\n implements AttachableNodeInstance<TParams, TEventData> {\n protected registeredModuleMap: Record<Address, AttachableModuleInstance> = {}\n\n private _attachMutex = new Mutex()\n\n private _attachedPrivateModules = new Set<Address>()\n private _attachedPublicModules = new Set<Address>()\n\n async attachHandler(id: ModuleIdentifier, external?: boolean) {\n await this.started('throw')\n return assertEx(\n isAddress(id) ? await this.attachUsingAddress(id as Address, external) : await this.attachUsingName(id, external),\n () => `Unable to locate module [${id}]`,\n )\n }\n\n async certifyHandler(id: ModuleIdentifier): Promise<ChildCertificationFields> {\n const child = (await this.publicChildren()).find(child => child.modName === id || child.address === id)\n if (child) {\n return { address: child.address, expiration: Date.now() + 1000 * 60 * 10 /* 10 minutes */ }\n }\n throw new Error(`Unable to certify child module [${id}]`)\n }\n\n async detachHandler(id: ModuleIdentifier) {\n await this.started('throw')\n return isAddress(id) ? await this.detachUsingAddress(id as Address) : await this.detachUsingName(id)\n }\n\n override privateChildren(): Promise<ModuleInstance[]> {\n return this.attachedPrivateModules()\n }\n\n override publicChildren(): Promise<ModuleInstance[]> {\n return this.attachedPublicModules()\n }\n\n async register(mod: AttachableModuleInstance) {\n await this.started('throw')\n if (this.registeredModuleMap[mod.address]) {\n if (this.registeredModuleMap[mod.address] === mod) {\n this.logger.warn(`Module already registered at that address[${mod.address}]|${mod.id}|[${mod.config.schema}]`)\n } else {\n throw new Error(`Other module already registered at that address[${mod.address}]|${mod.id}|[${mod.config.schema}]`)\n }\n }\n this.registeredModuleMap[mod.address] = mod\n const args = { mod, name: mod.modName }\n await this.emit('moduleRegistered', args)\n }\n\n registeredHandler(): Promisable<Address[]> {\n return Promise.resolve(\n (Object.keys(this.registeredModuleMap) as Address[]).map((key) => {\n return key\n }),\n )\n }\n\n registeredModules(): AttachableModuleInstance[] {\n return Object.values(this.registeredModuleMap).map((value) => {\n return value\n })\n }\n\n async unregister(mod: ModuleInstance): Promise<ModuleInstance> {\n await this.started('throw')\n // try to detach if it is attached\n try {\n await this.detach(mod.address)\n } catch {}\n delete this.registeredModuleMap[mod.address]\n const args = { mod, name: mod.modName }\n await this.emit('moduleUnregistered', args)\n return this\n }\n\n protected async attachUsingAddress(address: Address, external?: boolean) {\n return await this._attachMutex.runExclusive(async () => {\n const existingModule = await this.resolve(address)\n if (existingModule) {\n this.logger.warn(`MemoryNode: Module [${existingModule?.modName ?? existingModule?.address}] already attached at address [${address}]`)\n }\n const mod = assertEx(this.registeredModuleMap[address], () => `No Module Registered at address [${address}]`)\n\n if (this._attachedPublicModules.has(mod.address)) {\n this.logger.warn(`Module [${mod.modName}] already attached at [${address}] (public)`)\n }\n if (this._attachedPrivateModules.has(mod.address)) {\n this.logger.warn(`Module [${mod.modName}] already attached at [${address}] (private)`)\n }\n\n const notificationList = await this.getModulesToNotifyAbout(mod)\n\n // give it private access\n mod.upResolver.addResolver?.(this.privateResolver)\n\n // give it public access\n mod.upResolver.addResolver?.(this.downResolver as CompositeModuleResolver)\n\n // give it outside access\n mod.upResolver.addResolver?.(this.upResolver)\n\n if (external) {\n // expose it externally\n this._attachedPublicModules.add(mod.address)\n this.downResolver.addResolver(mod.downResolver as ModuleResolverInstance)\n } else {\n this._attachedPrivateModules.add(mod.address)\n this.privateResolver.addResolver(mod.downResolver as ModuleResolverInstance)\n }\n\n mod.addParent(this)\n\n const args = { mod, name: mod.modName }\n await this.emit('moduleAttached', args)\n\n if (isNodeModule(mod) && external) {\n const attachedListener: EventListener<TEventData['moduleAttached']> = async (args: TEventData['moduleAttached']) =>\n await this.emit('moduleAttached', args)\n\n const detachedListener: EventListener<TEventData['moduleDetached']> = async (args: TEventData['moduleDetached']) =>\n await this.emit('moduleDetached', args)\n\n mod.on('moduleAttached', attachedListener as EventListener)\n mod.on('moduleDetached', detachedListener as EventListener)\n }\n\n await this.notifyOfExistingModulesAttached(notificationList)\n\n return address\n })\n }\n\n protected async detachUsingAddress(address: Address) {\n const mod = assertEx(this.registeredModuleMap[address], () => `No Module Registered at address [${address}]`)\n\n const isAttachedPublic = this._attachedPublicModules.has(mod.address)\n const isAttachedPrivate = this._attachedPrivateModules.has(mod.address)\n\n assertEx(isAttachedPublic || isAttachedPrivate, () => `Module [${mod.modName}] not attached at [${address}]`)\n\n // remove inside access\n mod.upResolver?.removeResolver?.(this.privateResolver)\n\n // remove outside access\n mod.upResolver?.removeResolver?.(this.upResolver)\n\n // remove external exposure\n this.downResolver.removeResolver(mod.downResolver as ModuleResolverInstance)\n\n mod.removeParent(this.address)\n\n if (isAttachedPublic) {\n this._attachedPublicModules.delete(mod.address)\n }\n\n if (isAttachedPrivate) {\n this._attachedPrivateModules.delete(mod.address)\n }\n\n const args = { mod, name: mod.modName }\n await this.emit('moduleDetached', args)\n\n // notify of all sub node children detach\n if (isNodeModule(mod)) {\n const notificationList = await this.getModulesToNotifyAbout(mod)\n await this.notifyOfExistingModulesDetached(notificationList)\n }\n return address\n }\n\n protected override startHandler() {\n return super.startHandler()\n }\n\n private async attachUsingName(name: string, external?: boolean) {\n const address = this.registeredModuleAddressFromName(name)\n if (address) {\n return await this.attachUsingAddress(address, external)\n }\n }\n\n private async detachUsingName(name: string) {\n const address = this.registeredModuleAddressFromName(name)\n if (address) {\n return await this.detachUsingAddress(address)\n }\n }\n\n private async getModulesToNotifyAbout(node: ModuleInstance) {\n const notifiedAddresses: string[] = []\n // send attach events for all existing attached modules\n const childModules = await node.resolve('*', { direction: 'down' })\n return (\n childModules.map((child) => {\n // don't report self\n if (node.address === child.address) {\n return\n }\n\n // prevent loop\n if (notifiedAddresses.includes(child.address)) {\n return\n }\n\n notifiedAddresses.push(child.address)\n\n return child\n })\n ).filter(exists)\n }\n\n private async notifyOfExistingModulesAttached(childModules: Module[]) {\n await Promise.all(\n childModules.map(async (child) => {\n const args = { mod: child, name: child.modName }\n await this.emit('moduleAttached', args)\n }),\n )\n }\n\n private async notifyOfExistingModulesDetached(childModules: Module[]) {\n await Promise.all(\n childModules.map(async (child) => {\n const args = { mod: child, name: child.modName }\n await this.emit('moduleDetached', args)\n }),\n )\n }\n\n private registeredModuleAddressFromName(name: string) {\n return Object.values(this.registeredModuleMap).find((value) => {\n return value.modName === name\n })?.address\n }\n}\n","import { NodeHelper } from '@xyo-network/node-abstract'\n\nimport { attachToExistingNode } from './attachToExistingNode.ts'\nimport { attachToNewNode } from './attachToNewNode.ts'\nimport {\n flatAttachAllToExistingNode, flatAttachChildToExistingNode, flatAttachToExistingNode,\n} from './flatAttachToExistingNode.ts'\nimport { flatAttachToNewNode } from './flatAttachToNewNode.ts'\n\nexport const MemoryNodeHelper = {\n ...NodeHelper,\n attachToExistingNode,\n attachToNewNode,\n flatAttachAllToExistingNode,\n flatAttachChildToExistingNode,\n flatAttachToExistingNode,\n flatAttachToNewNode,\n}\n","import { assertEx } from '@xylabs/assert'\nimport type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { NodeInstance } from '@xyo-network/node-model'\nimport { asNodeInstance } from '@xyo-network/node-model'\n\nimport { MemoryNode } from '../MemoryNode.ts'\nimport { flatAttachToExistingNode } from './flatAttachToExistingNode.ts'\n\nexport const attachToExistingNode = async (source: NodeInstance, id: ModuleIdentifier, destination: NodeInstance): Promise<NodeInstance> => {\n const parts = id.split(':')\n const first = assertEx(parts.shift(), () => 'missing first part')\n if (parts.length === 0) {\n // this is an immediate child/children\n return await flatAttachToExistingNode(source, first, destination)\n } else {\n // all parts that are not the last should be nodes, build them and nest\n const firstModule = await source.resolve(first)\n const firstNode = asNodeInstance(firstModule, () => 'first part is not a node')\n const newNode = await MemoryNode.create({ config: firstNode.config })\n await destination.register?.(newNode)\n await destination.attach(newNode.address, true)\n await attachToExistingNode(firstNode, parts.join(':'), newNode)\n return destination\n }\n}\n","import { assertEx } from '@xylabs/assert'\nimport { exists } from '@xylabs/exists'\nimport type { ModuleIdentifier } from '@xyo-network/module-model'\nimport { asAttachableModuleInstance } from '@xyo-network/module-model'\nimport type { NodeInstance } from '@xyo-network/node-model'\n\nexport const flatAttachAllToExistingNode = async (source: NodeInstance, destination: NodeInstance): Promise<NodeInstance> => {\n const children = (await source.publicChildren()).map(child => asAttachableModuleInstance(child)).filter(exists)\n await Promise.all(\n children.map(async (child) => {\n await destination.register?.(child)\n await destination.attach(child.address, true)\n }),\n )\n return destination\n}\n\nexport const flatAttachChildToExistingNode = async (source: NodeInstance, id: ModuleIdentifier, destination: NodeInstance): Promise<NodeInstance> => {\n assertEx(id !== '*', () => '* is not a single child')\n const child = assertEx(await source.resolve(id), () => `Module ${id} not found`)\n const attachableChild = asAttachableModuleInstance(child, () => `Module ${id} is not attachable`)\n await destination.register?.(attachableChild)\n await destination.attach(child.address, true)\n return destination\n}\n\nexport const flatAttachToExistingNode = async (source: NodeInstance, id: ModuleIdentifier, destination: NodeInstance): Promise<NodeInstance> => {\n return id === '*' ? await flatAttachAllToExistingNode(source, destination) : flatAttachChildToExistingNode(source, id, destination)\n}\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport { NodeConfigSchema, type NodeInstance } from '@xyo-network/node-model'\n\nimport type { MemoryNodeParams } from '../MemoryNode.ts'\nimport { MemoryNode } from '../MemoryNode.ts'\nimport { attachToExistingNode } from './attachToExistingNode.ts'\n\nconst DEFAULT_NODE_PARAMS = { config: { schema: NodeConfigSchema } }\n\nexport const attachToNewNode = async (\n source: NodeInstance,\n id: ModuleIdentifier,\n destinationParams: MemoryNodeParams = DEFAULT_NODE_PARAMS,\n): Promise<NodeInstance> => {\n const destination = await MemoryNode.create(destinationParams)\n return await attachToExistingNode(source, id, destination)\n}\n","import type { ModuleIdentifier } from '@xyo-network/module-model'\nimport type { NodeInstance } from '@xyo-network/node-model'\n\nimport type { MemoryNodeParams } from '../MemoryNode.ts'\nimport { MemoryNode } from '../MemoryNode.ts'\nimport { flatAttachToExistingNode } from './flatAttachToExistingNode.ts'\n\nexport const flatAttachToNewNode = async (\n source: NodeInstance,\n id: ModuleIdentifier,\n destinationParams: MemoryNodeParams,\n): Promise<NodeInstance> => {\n const destination = await MemoryNode.create(destinationParams)\n return await flatAttachToExistingNode(source, id, destination)\n}\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,cAAc;AAEvB,SAAS,iBAAiB;AAY1B,SAAS,oBAAoB;AAI7B,SAAS,oBAAoB;AAC7B,SAAS,aAAa;AAIf,IAAM,aAAN,cACG,aAC+C;AAAA,EAC7C,sBAAiE,CAAC;AAAA,EAEpE,eAAe,IAAI,MAAM;AAAA,EAEzB,0BAA0B,oBAAI,IAAa;AAAA,EAC3C,yBAAyB,oBAAI,IAAa;AAAA,EAElD,MAAM,cAAc,IAAsB,UAAoB;AAC5D,UAAM,KAAK,QAAQ,OAAO;AAC1B,WAAO;AAAA,MACL,UAAU,EAAE,IAAI,MAAM,KAAK,mBAAmB,IAAe,QAAQ,IAAI,MAAM,KAAK,gBAAgB,IAAI,QAAQ;AAAA,MAChH,MAAM,4BAA4B,EAAE;AAAA,IACtC;AAAA,EACF;AAAA,EAEA,MAAM,eAAe,IAAyD;AAC5E,UAAM,SAAS,MAAM,KAAK,eAAe,GAAG,KAAK,CAAAA,WAASA,OAAM,YAAY,MAAMA,OAAM,YAAY,EAAE;AACtG,QAAI,OAAO;AACT,aAAO;AAAA,QAAE,SAAS,MAAM;AAAA,QAAS,YAAY,KAAK,IAAI,IAAI,MAAO,KAAK;AAAA;AAAA,MAAoB;AAAA,IAC5F;AACA,UAAM,IAAI,MAAM,mCAAmC,EAAE,GAAG;AAAA,EAC1D;AAAA,EAEA,MAAM,cAAc,IAAsB;AACxC,UAAM,KAAK,QAAQ,OAAO;AAC1B,WAAO,UAAU,EAAE,IAAI,MAAM,KAAK,mBAAmB,EAAa,IAAI,MAAM,KAAK,gBAAgB,EAAE;AAAA,EACrG;AAAA,EAES,kBAA6C;AACpD,WAAO,KAAK,uBAA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,qBAAqB,WAAW,MAAM,KAAK,GAAG,GAAG,OAAO;AAC9D,WAAO;AAAA,EACT;AACF;;;AEvBA,SAAS,wBAA2C;AAMpD,IAAM,sBAAsB,EAAE,QAAQ,EAAE,QAAQ,iBAAiB,EAAE;AAE5D,IAAM,kBAAkB,OAC7B,QACA,IACA,oBAAsC,wBACZ;AAC1B,QAAM,cAAc,MAAM,WAAW,OAAO,iBAAiB;AAC7D,SAAO,MAAM,qBAAqB,QAAQ,IAAI,WAAW;AAC3D;;;ACTO,IAAM,sBAAsB,OACjC,QACA,IACA,sBAC0B;AAC1B,QAAM,cAAc,MAAM,WAAW,OAAO,iBAAiB;AAC7D,SAAO,MAAM,yBAAyB,QAAQ,IAAI,WAAW;AAC/D;;;AJLO,IAAM,mBAAmB;AAAA,EAC9B,GAAG;AAAA,EACH;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":["child","args","assertEx","assertEx","exists","assertEx"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/node-memory",
3
- "version": "3.6.9",
3
+ "version": "3.6.10",
4
4
  "description": "Primary SDK for using XYO Protocol 2.0",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -29,21 +29,21 @@
29
29
  "module": "dist/neutral/index.mjs",
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "dependencies": {
32
- "@xylabs/assert": "^4.4.34",
33
- "@xylabs/exists": "^4.4.34",
34
- "@xylabs/hex": "^4.4.34",
35
- "@xylabs/promise": "^4.4.34",
36
- "@xyo-network/module-events": "^3.6.9",
37
- "@xyo-network/module-model": "^3.6.9",
38
- "@xyo-network/module-resolver": "^3.6.9",
39
- "@xyo-network/node-abstract": "^3.6.9",
40
- "@xyo-network/node-model": "^3.6.9",
32
+ "@xylabs/assert": "^4.5.1",
33
+ "@xylabs/exists": "^4.5.1",
34
+ "@xylabs/hex": "^4.5.1",
35
+ "@xylabs/promise": "^4.5.1",
36
+ "@xyo-network/module-events": "^3.6.10",
37
+ "@xyo-network/module-model": "^3.6.10",
38
+ "@xyo-network/module-resolver": "^3.6.10",
39
+ "@xyo-network/node-abstract": "^3.6.10",
40
+ "@xyo-network/node-model": "^3.6.10",
41
41
  "async-mutex": "^0.5.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@xylabs/ts-scripts-yarn3": "^4.2.6",
45
45
  "@xylabs/tsconfig": "^4.2.6",
46
- "typescript": "^5.7.2"
46
+ "typescript": "^5.7.3"
47
47
  },
48
48
  "publishConfig": {
49
49
  "access": "public"