@edifice.io/edifice-ent-client-node 6.12.1767605646579 → 6.12.1767609523404

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
@@ -1,247 +1,247 @@
1
- class i {
2
- constructor(r) {
3
- this.natsConnection = r, console.log("Creating service EntNatsServiceClient");
1
+ class c {
2
+ constructor(t) {
3
+ this.natsConnection = t, console.log("Creating service EntNatsServiceClient");
4
4
  }
5
- async addCommunicationLinks(r, t = "") {
5
+ async addCommunicationLinks(t, r = "") {
6
6
  let e = "communication.link.users.add";
7
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
8
- const s = await this.natsConnection.request(e, JSON.stringify(r));
7
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
8
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
9
9
  if (!s)
10
10
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
11
11
  return this.extractResponse(s.json());
12
12
  }
13
- async addGroupMember(r, t = "") {
13
+ async addGroupMember(t, r = "") {
14
14
  let e = "directory.group.member.add";
15
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
16
- const s = await this.natsConnection.request(e, JSON.stringify(r));
15
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
16
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
17
17
  if (!s)
18
18
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
19
19
  return this.extractResponse(s.json());
20
20
  }
21
- async addLinkBetweenGroups(r, t = "") {
21
+ async addLinkBetweenGroups(t, r = "") {
22
22
  let e = "communication.link.groups.add";
23
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
24
- const s = await this.natsConnection.request(e, JSON.stringify(r));
23
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
24
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
25
25
  if (!s)
26
26
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
27
27
  return this.extractResponse(s.json());
28
28
  }
29
- async checkResourceAccess(r, t, e, s = "") {
30
- let n = "audience.check.right." + t + "." + e;
31
- s && (n = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: n });
32
- const o = await this.natsConnection.request(n, JSON.stringify(r));
29
+ async checkResourceAccess(t, r, e, s = "") {
30
+ let n = "audience.check.right." + r + "." + e;
31
+ s && (n = `${s}.${n}`), console.debug("Sending request to NATS subject", { messageAddress: n });
32
+ const o = await this.natsConnection.request(n, JSON.stringify(t));
33
33
  if (!o)
34
34
  throw console.warn("No reply received for subject", { messageAddress: n }), new Error("No reply received");
35
35
  return this.extractResponse(o.json());
36
36
  }
37
- async createAndStoreEvent(r, t = "") {
37
+ async createAndStoreEvent(t, r = "") {
38
38
  let e = "event.store.create";
39
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
40
- const s = await this.natsConnection.request(e, JSON.stringify(r));
39
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
40
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
41
41
  if (!s)
42
42
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
43
43
  return this.extractResponse(s.json());
44
44
  }
45
- async createManualGroup(r, t = "") {
45
+ async createManualGroup(t, r = "") {
46
46
  let e = "directory.group.manual.create";
47
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
48
- const s = await this.natsConnection.request(e, JSON.stringify(r));
47
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
48
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
49
49
  if (!s)
50
50
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
51
51
  return this.extractResponse(s.json());
52
52
  }
53
- async deleteManualGroup(r, t = "") {
53
+ async deleteManualGroup(t, r = "") {
54
54
  let e = "directory.group.manual.delete";
55
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
56
- const s = await this.natsConnection.request(e, JSON.stringify(r));
55
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
56
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
57
57
  if (!s)
58
58
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
59
59
  return this.extractResponse(s.json());
60
60
  }
61
- async fetchTranslations(r, t, e = "") {
62
- let s = "i18n." + t + ".fetch";
63
- e && (s = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: s });
64
- const n = await this.natsConnection.request(s, JSON.stringify(r));
61
+ async fetchTranslations(t, r, e = "") {
62
+ let s = "i18n." + r + ".fetch";
63
+ e && (s = `${e}.${s}`), console.debug("Sending request to NATS subject", { messageAddress: s });
64
+ const n = await this.natsConnection.request(s, JSON.stringify(t));
65
65
  if (!n)
66
66
  throw console.warn("No reply received for subject", { messageAddress: s }), new Error("No reply received");
67
67
  return this.extractResponse(n.json());
68
68
  }
69
- async findGroupByExternalId(r, t = "") {
69
+ async findGroupByExternalId(t, r = "") {
70
70
  let e = "directory.group.find.byexternalid";
71
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
72
- const s = await this.natsConnection.request(e, JSON.stringify(r));
71
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
72
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
73
73
  if (!s)
74
74
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
75
75
  return this.extractResponse(s.json());
76
76
  }
77
- async findSession(r, t = "") {
77
+ async findSession(t, r = "") {
78
78
  let e = "session.find";
79
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
80
- const s = await this.natsConnection.request(e, JSON.stringify(r));
79
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
80
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
81
81
  if (!s)
82
82
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
83
83
  return this.extractResponse(s.json());
84
84
  }
85
- async getResources(r, t, e = "") {
86
- let s = "resource.get." + t;
87
- e && (s = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: s });
88
- const n = await this.natsConnection.request(s, JSON.stringify(r));
85
+ async getResources(t, r, e = "") {
86
+ let s = "resource.get." + r;
87
+ e && (s = `${e}.${s}`), console.debug("Sending request to NATS subject", { messageAddress: s });
88
+ const n = await this.natsConnection.request(s, JSON.stringify(t));
89
89
  if (!n)
90
90
  throw console.warn("No reply received for subject", { messageAddress: s }), new Error("No reply received");
91
91
  return this.extractResponse(n.json());
92
92
  }
93
- async getUserDisplayNames(r, t = "") {
93
+ async getUserDisplayNames(t, r = "") {
94
94
  let e = "directory.users.get.displaynames";
95
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
96
- const s = await this.natsConnection.request(e, JSON.stringify(r));
95
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
96
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
97
97
  if (!s)
98
98
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
99
99
  return this.extractResponse(s.json());
100
100
  }
101
- async getUsersByIds(r, t = "") {
101
+ async getUsersByIds(t, r = "") {
102
102
  let e = "directory.users.get.byids";
103
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
104
- const s = await this.natsConnection.request(e, JSON.stringify(r));
103
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
104
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
105
105
  if (!s)
106
106
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
107
107
  return this.extractResponse(s.json());
108
108
  }
109
- async listenAndReplyExample(r, t = "") {
109
+ async listenAndReplyExample(t, r = "") {
110
110
  let e = "ent.test.listen.reply";
111
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
112
- const s = await this.natsConnection.request(e, JSON.stringify(r));
111
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
112
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
113
113
  if (!s)
114
114
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
115
115
  return this.extractResponse(s.json());
116
116
  }
117
- async listenOnlyExample(r, t = "") {
117
+ async listenOnlyExample(t, r = "") {
118
118
  let e = "ent.test.listen";
119
- t && (e = "{platformId}.{eventAddress}"), console.debug("Publishing to NATS subject", { messageAddress: e }), this.natsConnection.publish(e, JSON.stringify(r));
119
+ r && (e = `${r}.${e}`), console.debug("Publishing to NATS subject", { messageAddress: e }), this.natsConnection.publish(e, JSON.stringify(t));
120
120
  }
121
- async loadTest(r, t = "") {
121
+ async loadTest(t, r = "") {
122
122
  let e = "ent.loadtest";
123
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
124
- const s = await this.natsConnection.request(e, JSON.stringify(r));
123
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
124
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
125
125
  if (!s)
126
126
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
127
127
  return this.extractResponse(s.json());
128
128
  }
129
- async recreateCommunicationLinks(r, t = "") {
129
+ async recreateCommunicationLinks(t, r = "") {
130
130
  let e = "communication.link.users.recreate";
131
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
132
- const s = await this.natsConnection.request(e, JSON.stringify(r));
131
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
132
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
133
133
  if (!s)
134
134
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
135
135
  return this.extractResponse(s.json());
136
136
  }
137
- async refreshSession(r, t = "") {
137
+ async refreshSession(t, r = "") {
138
138
  let e = "session.refresh";
139
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
140
- const s = await this.natsConnection.request(e, JSON.stringify(r));
139
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
140
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
141
141
  if (!s)
142
142
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
143
143
  return this.extractResponse(s.json());
144
144
  }
145
- async registerApp(r, t = "") {
145
+ async registerApp(t, r = "") {
146
146
  let e = "ent.appregistry.app.register";
147
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
148
- const s = await this.natsConnection.request(e, JSON.stringify(r));
147
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
148
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
149
149
  if (!s)
150
150
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
151
151
  return this.extractResponse(s.json());
152
152
  }
153
- async registerI18nFiles(r, t, e = "") {
154
- let s = "i18n." + t + ".register";
155
- e && (s = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: s });
156
- const n = await this.natsConnection.request(s, JSON.stringify(r));
153
+ async registerI18nFiles(t, r, e = "") {
154
+ let s = "i18n." + r + ".register";
155
+ e && (s = `${e}.${s}`), console.debug("Sending request to NATS subject", { messageAddress: s });
156
+ const n = await this.natsConnection.request(s, JSON.stringify(t));
157
157
  if (!n)
158
158
  throw console.warn("No reply received for subject", { messageAddress: s }), new Error("No reply received");
159
159
  return this.extractResponse(n.json());
160
160
  }
161
- async registerNotification(r, t = "") {
161
+ async registerNotification(t, r = "") {
162
162
  let e = "timeline.notification.register";
163
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
164
- const s = await this.natsConnection.request(e, JSON.stringify(r));
163
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
164
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
165
165
  if (!s)
166
166
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
167
167
  return this.extractResponse(s.json());
168
168
  }
169
- async registerNotifications(r, t = "") {
169
+ async registerNotifications(t, r = "") {
170
170
  let e = "timeline.notification.register.batch";
171
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
172
- const s = await this.natsConnection.request(e, JSON.stringify(r));
171
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
172
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
173
173
  if (!s)
174
174
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
175
175
  return this.extractResponse(s.json());
176
176
  }
177
- async removeCommunicationLinks(r, t = "") {
177
+ async removeCommunicationLinks(t, r = "") {
178
178
  let e = "communication.link.users.remove";
179
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
180
- const s = await this.natsConnection.request(e, JSON.stringify(r));
179
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
180
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
181
181
  if (!s)
182
182
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
183
183
  return this.extractResponse(s.json());
184
184
  }
185
- async removeGroupMember(r, t = "") {
185
+ async removeGroupMember(t, r = "") {
186
186
  let e = "directory.group.member.delete";
187
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
188
- const s = await this.natsConnection.request(e, JSON.stringify(r));
187
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
188
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
189
189
  if (!s)
190
190
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
191
191
  return this.extractResponse(s.json());
192
192
  }
193
- async removeGroupShares(r, t, e = "") {
194
- let s = "share.group.remove." + t;
195
- e && (s = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: s });
196
- const n = await this.natsConnection.request(s, JSON.stringify(r));
193
+ async removeGroupShares(t, r, e = "") {
194
+ let s = "share.group.remove." + r;
195
+ e && (s = `${e}.${s}`), console.debug("Sending request to NATS subject", { messageAddress: s });
196
+ const n = await this.natsConnection.request(s, JSON.stringify(t));
197
197
  if (!n)
198
198
  throw console.warn("No reply received for subject", { messageAddress: s }), new Error("No reply received");
199
199
  return this.extractResponse(n.json());
200
200
  }
201
- async sendNotification(r, t = "") {
201
+ async sendNotification(t, r = "") {
202
202
  let e = "timeline.notification.send";
203
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
204
- const s = await this.natsConnection.request(e, JSON.stringify(r));
203
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
204
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
205
205
  if (!s)
206
206
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
207
207
  return this.extractResponse(s.json());
208
208
  }
209
- async updateManualGroup(r, t = "") {
209
+ async updateManualGroup(t, r = "") {
210
210
  let e = "directory.group.manual.update";
211
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
212
- const s = await this.natsConnection.request(e, JSON.stringify(r));
211
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
212
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
213
213
  if (!s)
214
214
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
215
215
  return this.extractResponse(s.json());
216
216
  }
217
- async updateWikiContent(r, t = "") {
217
+ async updateWikiContent(t, r = "") {
218
218
  let e = "ai.wiki.content.updated";
219
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
220
- const s = await this.natsConnection.request(e, JSON.stringify(r));
219
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
220
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
221
221
  if (!s)
222
222
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
223
223
  return this.extractResponse(s.json());
224
224
  }
225
- async updateWikiStructure(r, t = "") {
225
+ async updateWikiStructure(t, r = "") {
226
226
  let e = "ai.wiki.structure.updated";
227
- t && (e = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: e });
228
- const s = await this.natsConnection.request(e, JSON.stringify(r));
227
+ r && (e = `${r}.${e}`), console.debug("Sending request to NATS subject", { messageAddress: e });
228
+ const s = await this.natsConnection.request(e, JSON.stringify(t));
229
229
  if (!s)
230
230
  throw console.warn("No reply received for subject", { messageAddress: e }), new Error("No reply received");
231
231
  return this.extractResponse(s.json());
232
232
  }
233
- async upsertGroupShares(r, t, e = "") {
234
- let s = "share.group.upsert." + t;
235
- e && (s = "{platformId}.{eventAddress}"), console.debug("Sending request to NATS subject", { messageAddress: s });
236
- const n = await this.natsConnection.request(s, JSON.stringify(r));
233
+ async upsertGroupShares(t, r, e = "") {
234
+ let s = "share.group.upsert." + r;
235
+ e && (s = `${e}.${s}`), console.debug("Sending request to NATS subject", { messageAddress: s });
236
+ const n = await this.natsConnection.request(s, JSON.stringify(t));
237
237
  if (!n)
238
238
  throw console.warn("No reply received for subject", { messageAddress: s }), new Error("No reply received");
239
239
  return this.extractResponse(n.json());
240
240
  }
241
- extractResponse(r) {
242
- return r.response || r;
241
+ extractResponse(t) {
242
+ return t.response || t;
243
243
  }
244
244
  }
245
245
  export {
246
- i as EntNatsServiceClient
246
+ c as EntNatsServiceClient
247
247
  };
@@ -1 +1 @@
1
- (function(o,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(o=typeof globalThis<"u"?globalThis:o||self,i((o["@edifice"]=o["@edifice"]||{},o["@edifice"]["io/edifice-ent-client-node"]={})))})(this,function(o){"use strict";class i{constructor(r){this.natsConnection=r,console.log("Creating service EntNatsServiceClient")}async addCommunicationLinks(r,t=""){let e="communication.link.users.add";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async addGroupMember(r,t=""){let e="directory.group.member.add";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async addLinkBetweenGroups(r,t=""){let e="communication.link.groups.add";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async checkResourceAccess(r,t,e,s=""){let n="audience.check.right."+t+"."+e;s&&(n="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:n});const d=await this.natsConnection.request(n,JSON.stringify(r));if(!d)throw console.warn("No reply received for subject",{messageAddress:n}),new Error("No reply received");return this.extractResponse(d.json())}async createAndStoreEvent(r,t=""){let e="event.store.create";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async createManualGroup(r,t=""){let e="directory.group.manual.create";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async deleteManualGroup(r,t=""){let e="directory.group.manual.delete";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async fetchTranslations(r,t,e=""){let s="i18n."+t+".fetch";e&&(s="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(r));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async findGroupByExternalId(r,t=""){let e="directory.group.find.byexternalid";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async findSession(r,t=""){let e="session.find";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async getResources(r,t,e=""){let s="resource.get."+t;e&&(s="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(r));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async getUserDisplayNames(r,t=""){let e="directory.users.get.displaynames";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async getUsersByIds(r,t=""){let e="directory.users.get.byids";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async listenAndReplyExample(r,t=""){let e="ent.test.listen.reply";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async listenOnlyExample(r,t=""){let e="ent.test.listen";t&&(e="{platformId}.{eventAddress}"),console.debug("Publishing to NATS subject",{messageAddress:e}),this.natsConnection.publish(e,JSON.stringify(r))}async loadTest(r,t=""){let e="ent.loadtest";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async recreateCommunicationLinks(r,t=""){let e="communication.link.users.recreate";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async refreshSession(r,t=""){let e="session.refresh";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async registerApp(r,t=""){let e="ent.appregistry.app.register";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async registerI18nFiles(r,t,e=""){let s="i18n."+t+".register";e&&(s="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(r));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async registerNotification(r,t=""){let e="timeline.notification.register";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async registerNotifications(r,t=""){let e="timeline.notification.register.batch";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async removeCommunicationLinks(r,t=""){let e="communication.link.users.remove";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async removeGroupMember(r,t=""){let e="directory.group.member.delete";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async removeGroupShares(r,t,e=""){let s="share.group.remove."+t;e&&(s="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(r));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async sendNotification(r,t=""){let e="timeline.notification.send";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async updateManualGroup(r,t=""){let e="directory.group.manual.update";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async updateWikiContent(r,t=""){let e="ai.wiki.content.updated";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async updateWikiStructure(r,t=""){let e="ai.wiki.structure.updated";t&&(e="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(r));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async upsertGroupShares(r,t,e=""){let s="share.group.upsert."+t;e&&(s="{platformId}.{eventAddress}"),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(r));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}extractResponse(r){return r.response||r}}o.EntNatsServiceClient=i,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
1
+ (function(o,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):(o=typeof globalThis<"u"?globalThis:o||self,i((o["@edifice"]=o["@edifice"]||{},o["@edifice"]["io/edifice-ent-client-node"]={})))})(this,function(o){"use strict";class i{constructor(t){this.natsConnection=t,console.log("Creating service EntNatsServiceClient")}async addCommunicationLinks(t,r=""){let e="communication.link.users.add";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async addGroupMember(t,r=""){let e="directory.group.member.add";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async addLinkBetweenGroups(t,r=""){let e="communication.link.groups.add";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async checkResourceAccess(t,r,e,s=""){let n="audience.check.right."+r+"."+e;s&&(n=`${s}.${n}`),console.debug("Sending request to NATS subject",{messageAddress:n});const c=await this.natsConnection.request(n,JSON.stringify(t));if(!c)throw console.warn("No reply received for subject",{messageAddress:n}),new Error("No reply received");return this.extractResponse(c.json())}async createAndStoreEvent(t,r=""){let e="event.store.create";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async createManualGroup(t,r=""){let e="directory.group.manual.create";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async deleteManualGroup(t,r=""){let e="directory.group.manual.delete";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async fetchTranslations(t,r,e=""){let s="i18n."+r+".fetch";e&&(s=`${e}.${s}`),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(t));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async findGroupByExternalId(t,r=""){let e="directory.group.find.byexternalid";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async findSession(t,r=""){let e="session.find";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async getResources(t,r,e=""){let s="resource.get."+r;e&&(s=`${e}.${s}`),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(t));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async getUserDisplayNames(t,r=""){let e="directory.users.get.displaynames";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async getUsersByIds(t,r=""){let e="directory.users.get.byids";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async listenAndReplyExample(t,r=""){let e="ent.test.listen.reply";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async listenOnlyExample(t,r=""){let e="ent.test.listen";r&&(e=`${r}.${e}`),console.debug("Publishing to NATS subject",{messageAddress:e}),this.natsConnection.publish(e,JSON.stringify(t))}async loadTest(t,r=""){let e="ent.loadtest";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async recreateCommunicationLinks(t,r=""){let e="communication.link.users.recreate";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async refreshSession(t,r=""){let e="session.refresh";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async registerApp(t,r=""){let e="ent.appregistry.app.register";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async registerI18nFiles(t,r,e=""){let s="i18n."+r+".register";e&&(s=`${e}.${s}`),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(t));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async registerNotification(t,r=""){let e="timeline.notification.register";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async registerNotifications(t,r=""){let e="timeline.notification.register.batch";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async removeCommunicationLinks(t,r=""){let e="communication.link.users.remove";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async removeGroupMember(t,r=""){let e="directory.group.member.delete";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async removeGroupShares(t,r,e=""){let s="share.group.remove."+r;e&&(s=`${e}.${s}`),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(t));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}async sendNotification(t,r=""){let e="timeline.notification.send";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async updateManualGroup(t,r=""){let e="directory.group.manual.update";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async updateWikiContent(t,r=""){let e="ai.wiki.content.updated";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async updateWikiStructure(t,r=""){let e="ai.wiki.structure.updated";r&&(e=`${r}.${e}`),console.debug("Sending request to NATS subject",{messageAddress:e});const s=await this.natsConnection.request(e,JSON.stringify(t));if(!s)throw console.warn("No reply received for subject",{messageAddress:e}),new Error("No reply received");return this.extractResponse(s.json())}async upsertGroupShares(t,r,e=""){let s="share.group.upsert."+r;e&&(s=`${e}.${s}`),console.debug("Sending request to NATS subject",{messageAddress:s});const n=await this.natsConnection.request(s,JSON.stringify(t));if(!n)throw console.warn("No reply received for subject",{messageAddress:s}),new Error("No reply received");return this.extractResponse(n.json())}extractResponse(t){return t.response||t}}o.EntNatsServiceClient=i,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/edifice-ent-client-node",
3
- "version": "6.12.1767605646579",
3
+ "version": "6.12.1767609523404",
4
4
  "description": "Clients to interact with ent-nats-service",
5
5
  "private": false,
6
6
  "publishConfig": {