@symbo.ls/sdk 3.1.1 → 3.1.2
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/README.md +172 -11
- package/dist/cjs/config/environment.js +39 -33
- package/dist/cjs/index.js +35 -8
- package/dist/cjs/services/AuthService.js +44 -3
- package/dist/cjs/services/BasedService.js +530 -24
- package/dist/cjs/services/CoreService.js +1751 -0
- package/dist/cjs/services/SocketIOService.js +34 -36
- package/dist/cjs/services/SymstoryService.js +135 -49
- package/dist/cjs/services/index.js +4 -4
- package/dist/cjs/utils/TokenManager.js +374 -0
- package/dist/cjs/utils/basedQuerys.js +120 -0
- package/dist/cjs/utils/permission.js +4 -4
- package/dist/cjs/utils/services.js +32 -9
- package/dist/cjs/utils/symstoryClient.js +32 -1
- package/dist/esm/config/environment.js +39 -33
- package/dist/esm/index.js +8964 -11076
- package/dist/esm/services/AuthService.js +48 -7
- package/dist/esm/services/BasedService.js +683 -56
- package/dist/esm/services/CoreService.js +2264 -0
- package/dist/esm/services/SocketIOService.js +71 -68
- package/dist/esm/services/SymstoryService.js +293 -101
- package/dist/esm/services/index.js +8905 -11066
- package/dist/esm/utils/TokenManager.js +360 -0
- package/dist/esm/utils/basedQuerys.js +120 -0
- package/dist/esm/utils/permission.js +4 -4
- package/dist/esm/utils/services.js +32 -9
- package/dist/esm/utils/symstoryClient.js +69 -33
- package/dist/esm/utils/validation.js +89 -19
- package/dist/node/config/environment.js +39 -33
- package/dist/node/index.js +43 -10
- package/dist/node/services/AuthService.js +44 -3
- package/dist/node/services/BasedService.js +531 -25
- package/dist/node/services/CoreService.js +1722 -0
- package/dist/node/services/SocketIOService.js +34 -36
- package/dist/node/services/SymstoryService.js +135 -49
- package/dist/node/services/index.js +4 -4
- package/dist/node/utils/TokenManager.js +355 -0
- package/dist/node/utils/basedQuerys.js +120 -0
- package/dist/node/utils/permission.js +4 -4
- package/dist/node/utils/services.js +32 -9
- package/dist/node/utils/symstoryClient.js +32 -1
- package/package.json +16 -13
- package/src/config/environment.js +40 -35
- package/src/index.js +49 -10
- package/src/services/AuthService.js +52 -3
- package/src/services/BasedService.js +602 -23
- package/src/services/CoreService.js +1943 -0
- package/src/services/SocketIOService.js +49 -71
- package/src/services/SymstoryService.js +150 -64
- package/src/services/index.js +4 -4
- package/src/utils/TokenManager.js +424 -0
- package/src/utils/basedQuerys.js +123 -0
- package/src/utils/permission.js +4 -4
- package/src/utils/services.js +32 -9
- package/src/utils/symstoryClient.js +35 -1
|
@@ -66,7 +66,7 @@ class SocketService extends import_BaseService.BaseService {
|
|
|
66
66
|
init() {
|
|
67
67
|
try {
|
|
68
68
|
const { _context, _options } = this;
|
|
69
|
-
const socketUrl = import_environment.default.socketUrl || _options.socketUrl
|
|
69
|
+
const socketUrl = import_environment.default.socketUrl || _options.socketUrl;
|
|
70
70
|
if (!socketUrl) {
|
|
71
71
|
throw new Error("Socket URL is required");
|
|
72
72
|
}
|
|
@@ -103,6 +103,9 @@ class SocketService extends import_BaseService.BaseService {
|
|
|
103
103
|
userId: (_e = _context.user) == null ? void 0 : _e.id,
|
|
104
104
|
socketUrl: this._info.config.url,
|
|
105
105
|
location: window.location.host,
|
|
106
|
+
// onConnect: () => {
|
|
107
|
+
// console.log('waz')
|
|
108
|
+
// },
|
|
106
109
|
onChange: this._handleMessage.bind(this),
|
|
107
110
|
sessionId: this._sessionId,
|
|
108
111
|
usersName: (_f = _context.user) == null ? void 0 : _f.name,
|
|
@@ -144,7 +147,7 @@ class SocketService extends import_BaseService.BaseService {
|
|
|
144
147
|
import_client.send.call(
|
|
145
148
|
this._socket,
|
|
146
149
|
type,
|
|
147
|
-
opts.
|
|
150
|
+
opts.useDeepStringify ? deepStringify(payload) : payload
|
|
148
151
|
);
|
|
149
152
|
}
|
|
150
153
|
_handleMessage(event, data) {
|
|
@@ -175,38 +178,27 @@ class SocketService extends import_BaseService.BaseService {
|
|
|
175
178
|
}
|
|
176
179
|
}
|
|
177
180
|
_handleChangeEvent(data) {
|
|
178
|
-
|
|
179
|
-
if (
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
const componentUpdates = ((_a = data.schema) == null ? void 0 : _a.components) || ((_b = data.schema) == null ? void 0 : _b.pages);
|
|
192
|
-
if (window.location.pathname.includes("/canvas") && componentUpdates) {
|
|
193
|
-
for (const updatedComponent in componentUpdates) {
|
|
194
|
-
if (Object.hasOwn(componentUpdates, updatedComponent)) {
|
|
195
|
-
(_c = this._context.element) == null ? void 0 : _c.updateComponentOnCanvas(updatedComponent);
|
|
196
|
-
}
|
|
197
|
-
}
|
|
181
|
+
const { type, changes, version } = data;
|
|
182
|
+
if (version) this._context.state.version = version;
|
|
183
|
+
if (changes) {
|
|
184
|
+
window.requestAnimationFrame(async () => {
|
|
185
|
+
await this._context.state.setPathCollection(changes, {
|
|
186
|
+
preventReplace: type === "canvas",
|
|
187
|
+
preventUpdate: true,
|
|
188
|
+
fromSocket: true,
|
|
189
|
+
userId: data.userId,
|
|
190
|
+
changes
|
|
191
|
+
});
|
|
192
|
+
});
|
|
198
193
|
}
|
|
199
194
|
}
|
|
200
195
|
_handleClientsEvent(data) {
|
|
201
|
-
const { root } =
|
|
196
|
+
const { root } = this._context.state;
|
|
202
197
|
root.replace(
|
|
203
198
|
{ clients: data },
|
|
204
199
|
{
|
|
205
|
-
|
|
206
|
-
preventUpdate:
|
|
207
|
-
preventModalUpdate: true,
|
|
208
|
-
preventStateUpdateListener: true,
|
|
209
|
-
execStateFunction: true
|
|
200
|
+
fromSocket: true,
|
|
201
|
+
preventUpdate: true
|
|
210
202
|
}
|
|
211
203
|
);
|
|
212
204
|
}
|
|
@@ -223,9 +215,9 @@ class SocketService extends import_BaseService.BaseService {
|
|
|
223
215
|
element.__ref.root,
|
|
224
216
|
{},
|
|
225
217
|
{
|
|
226
|
-
|
|
218
|
+
fromSocket: true,
|
|
227
219
|
updateStateOptions: {
|
|
228
|
-
|
|
220
|
+
fromSocket: true,
|
|
229
221
|
preventStateUpdateListener: 1
|
|
230
222
|
// !isModalRoute(data.route, element)
|
|
231
223
|
}
|
|
@@ -240,9 +232,9 @@ class SocketService extends import_BaseService.BaseService {
|
|
|
240
232
|
element.__ref.root,
|
|
241
233
|
{},
|
|
242
234
|
{
|
|
243
|
-
|
|
235
|
+
fromSocket: true,
|
|
244
236
|
updateStateOptions: {
|
|
245
|
-
|
|
237
|
+
fromSocket: true
|
|
246
238
|
}
|
|
247
239
|
}
|
|
248
240
|
);
|
|
@@ -262,11 +254,17 @@ class SocketService extends import_BaseService.BaseService {
|
|
|
262
254
|
this._reconnectAttempts++;
|
|
263
255
|
this._updateStatus("reconnecting");
|
|
264
256
|
setTimeout(() => {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
257
|
+
try {
|
|
258
|
+
const connected = this.connect();
|
|
259
|
+
if (connected) {
|
|
260
|
+
this._reconnectAttempts = 0;
|
|
261
|
+
} else {
|
|
262
|
+
this._handleReconnect();
|
|
263
|
+
}
|
|
264
|
+
} catch (error) {
|
|
265
|
+
console.error("Reconnection failed:", error);
|
|
268
266
|
this._handleReconnect();
|
|
269
|
-
}
|
|
267
|
+
}
|
|
270
268
|
}, this._reconnectDelay * this._reconnectAttempts);
|
|
271
269
|
} else {
|
|
272
270
|
this._updateStatus("failed");
|
|
@@ -40,7 +40,7 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
40
40
|
super(config);
|
|
41
41
|
this._client = null;
|
|
42
42
|
this._cache = /* @__PURE__ */ new Map();
|
|
43
|
-
this._state =
|
|
43
|
+
this._state = {};
|
|
44
44
|
this._socketService = this._context.services.socket;
|
|
45
45
|
this._undoStack = [];
|
|
46
46
|
this._redoStack = [];
|
|
@@ -59,7 +59,7 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
59
59
|
}
|
|
60
60
|
});
|
|
61
61
|
this._client = import_symstoryClient.default.client;
|
|
62
|
-
this._state = state;
|
|
62
|
+
this._state = this._isObject(state) ? state : {};
|
|
63
63
|
if (socketUrl) {
|
|
64
64
|
await this._socketService.init();
|
|
65
65
|
}
|
|
@@ -79,6 +79,30 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
79
79
|
throw error;
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
+
// publish a new version
|
|
83
|
+
async publish({ version, type = "minor" } = {}) {
|
|
84
|
+
if (version) {
|
|
85
|
+
await this._client.publishVersion(version, { type });
|
|
86
|
+
} else {
|
|
87
|
+
await this.updateData([], { type });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
// get changes between versions
|
|
91
|
+
async getChanges({ versionId, versionValue, branch } = {}) {
|
|
92
|
+
return this._client.getChanges({ versionId, versionValue, branch });
|
|
93
|
+
}
|
|
94
|
+
safeStringify(obj) {
|
|
95
|
+
const seen = /* @__PURE__ */ new WeakSet();
|
|
96
|
+
return JSON.stringify(obj, (key, value) => {
|
|
97
|
+
if (typeof value === "object" && value !== null) {
|
|
98
|
+
if (seen.has(value)) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
seen.add(value);
|
|
102
|
+
}
|
|
103
|
+
return value;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
82
106
|
// Update project data
|
|
83
107
|
async updateData(changes, options = {}, callback) {
|
|
84
108
|
var _a;
|
|
@@ -93,35 +117,33 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
93
117
|
isRedo
|
|
94
118
|
} = options;
|
|
95
119
|
try {
|
|
96
|
-
|
|
120
|
+
const { state } = this._context;
|
|
121
|
+
if ("isOld" in state && state.isOld) {
|
|
97
122
|
return;
|
|
98
123
|
}
|
|
99
|
-
const updates = changes.map((change) => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
});
|
|
106
|
-
if (this._context.state && "setPathCollection" in this._context.state && !quietUpdate) {
|
|
107
|
-
this._context.state.setPathCollection(changes, {
|
|
124
|
+
const updates = changes.map((change) => ({
|
|
125
|
+
change,
|
|
126
|
+
prev: state == null ? void 0 : state.getByPath(change[1])
|
|
127
|
+
}));
|
|
128
|
+
if (state && "setPathCollection" in state && !quietUpdate) {
|
|
129
|
+
await state.setPathCollection(changes, {
|
|
108
130
|
preventUpdate: true,
|
|
109
131
|
...options
|
|
110
132
|
});
|
|
111
|
-
if ("__element" in this._state && isFunction(callback)) {
|
|
112
|
-
callback.call(this._state.__element);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
const filteredUpdates = updates.filter(
|
|
116
|
-
({ change, prev }) => change[3] !== void 0 || JSON.stringify(change[2]) !== JSON.stringify(prev)
|
|
117
|
-
);
|
|
118
|
-
if (!filteredUpdates.length) {
|
|
119
|
-
return;
|
|
120
133
|
}
|
|
121
|
-
|
|
122
|
-
if (
|
|
123
|
-
|
|
134
|
+
const filteredUpdates = updates.filter(({ change, prev }) => {
|
|
135
|
+
if (change && change.err) {
|
|
136
|
+
delete change.err;
|
|
137
|
+
}
|
|
138
|
+
if (prev && prev.err) {
|
|
139
|
+
delete prev.err;
|
|
124
140
|
}
|
|
141
|
+
return (
|
|
142
|
+
// eslint-disable-next-line no-undefined
|
|
143
|
+
change[3] !== void 0 || this.safeStringify(change[2]) !== this.safeStringify(prev)
|
|
144
|
+
);
|
|
145
|
+
});
|
|
146
|
+
if (!fromSocket && !isUndo) {
|
|
125
147
|
if (!isRedo) {
|
|
126
148
|
this._redoStack.length = 0;
|
|
127
149
|
}
|
|
@@ -138,27 +160,49 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
138
160
|
if (isFunction(change)) {
|
|
139
161
|
return [action, path, (change == null ? void 0 : change.toString()) ?? change];
|
|
140
162
|
}
|
|
163
|
+
if (change && change.err) {
|
|
164
|
+
delete change.err;
|
|
165
|
+
}
|
|
141
166
|
return [
|
|
142
167
|
action,
|
|
143
168
|
path,
|
|
144
169
|
isObjectLike(change) ? deepStringify(change, Array.isArray(change) ? [] : {}) : change
|
|
145
170
|
];
|
|
146
171
|
});
|
|
147
|
-
const res = await this.
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
172
|
+
const res = await this._context.services.core.applyProjectChanges(
|
|
173
|
+
state.projectId,
|
|
174
|
+
stringifiedData,
|
|
175
|
+
{
|
|
176
|
+
type,
|
|
177
|
+
message,
|
|
178
|
+
branch
|
|
179
|
+
}
|
|
180
|
+
);
|
|
181
|
+
if (this._socketService._socket) {
|
|
182
|
+
this._socketService.send("change", {
|
|
183
|
+
type: "update",
|
|
184
|
+
changes: stringifiedData,
|
|
185
|
+
version: res == null ? void 0 : res.value
|
|
186
|
+
});
|
|
187
|
+
}
|
|
152
188
|
if (res == null ? void 0 : res.value) {
|
|
153
189
|
this._context.symstory = {
|
|
154
190
|
...this._context.symstory,
|
|
155
191
|
version: res.value
|
|
156
192
|
};
|
|
157
|
-
if (
|
|
158
|
-
|
|
193
|
+
if (state && "quietUpdate" in state) {
|
|
194
|
+
const { isVersionsOpen } = state;
|
|
195
|
+
if (isVersionsOpen) {
|
|
196
|
+
state.quietUpdate({ version: res.value });
|
|
197
|
+
} else {
|
|
198
|
+
state.version = res.value;
|
|
199
|
+
}
|
|
159
200
|
}
|
|
160
201
|
this._cache.clear();
|
|
161
202
|
}
|
|
203
|
+
if ("__element" in this._state && isFunction(callback)) {
|
|
204
|
+
await callback.call(this._state.__element, changes, res);
|
|
205
|
+
}
|
|
162
206
|
return res;
|
|
163
207
|
} catch (error) {
|
|
164
208
|
if (isFunction(callback)) {
|
|
@@ -184,13 +228,12 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
184
228
|
})),
|
|
185
229
|
options
|
|
186
230
|
});
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
() => resolve(changes)
|
|
192
|
-
)
|
|
231
|
+
await this.updateData(
|
|
232
|
+
changes,
|
|
233
|
+
{ ...options, isUndo: true, message: `Undo: ${options.message || ""}` },
|
|
234
|
+
() => changes
|
|
193
235
|
);
|
|
236
|
+
return changes;
|
|
194
237
|
}
|
|
195
238
|
async redo() {
|
|
196
239
|
if (!this._redoStack.length) {
|
|
@@ -202,27 +245,26 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
202
245
|
change[1],
|
|
203
246
|
prev
|
|
204
247
|
]);
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
() => resolve(changes)
|
|
210
|
-
)
|
|
248
|
+
await this.updateData(
|
|
249
|
+
changes,
|
|
250
|
+
{ ...options, isRedo: true, message: `Redo: ${options.message || ""}` },
|
|
251
|
+
() => changes
|
|
211
252
|
);
|
|
253
|
+
return changes;
|
|
212
254
|
}
|
|
213
255
|
// Delete project data
|
|
214
|
-
async deleteData(path, options = {}) {
|
|
256
|
+
async deleteData(path, options = {}, callback) {
|
|
215
257
|
this._requireReady();
|
|
216
258
|
try {
|
|
217
259
|
const changes = [["delete", path]];
|
|
218
|
-
return await this.
|
|
260
|
+
return await this.updateData(changes, options, callback);
|
|
219
261
|
} catch (error) {
|
|
220
262
|
throw new Error(`Failed to delete data: ${error.message}`);
|
|
221
263
|
}
|
|
222
264
|
}
|
|
223
265
|
// Get project data
|
|
224
266
|
async getData(query, options = {}) {
|
|
225
|
-
var _a, _b;
|
|
267
|
+
var _a, _b, _c;
|
|
226
268
|
this._requireReady();
|
|
227
269
|
try {
|
|
228
270
|
const {
|
|
@@ -247,7 +289,7 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
247
289
|
try {
|
|
248
290
|
const result = await this._client.get(query, branch, version);
|
|
249
291
|
if (!bypassCache && cacheKey) {
|
|
250
|
-
this._cache.set(cacheKey, result);
|
|
292
|
+
(_c = this._cache) == null ? void 0 : _c.set(cacheKey, result);
|
|
251
293
|
}
|
|
252
294
|
return result;
|
|
253
295
|
} finally {
|
|
@@ -260,6 +302,10 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
260
302
|
throw new Error(`Failed to get data: ${error.message}`);
|
|
261
303
|
}
|
|
262
304
|
}
|
|
305
|
+
// Helper method to check if a variable is a valid object
|
|
306
|
+
_isObject(variable) {
|
|
307
|
+
return variable !== null && typeof variable === "object" && !Array.isArray(variable);
|
|
308
|
+
}
|
|
263
309
|
// Helper method to generate cache key
|
|
264
310
|
_generateCacheKey(query, branch, version) {
|
|
265
311
|
if (!query) {
|
|
@@ -293,6 +339,9 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
293
339
|
}
|
|
294
340
|
async createBranch(branch, options = {}) {
|
|
295
341
|
this._requireReady();
|
|
342
|
+
if (!branch) {
|
|
343
|
+
throw new Error("Branch name is required.");
|
|
344
|
+
}
|
|
296
345
|
try {
|
|
297
346
|
return await this._client.createBranch(branch, options);
|
|
298
347
|
} catch (error) {
|
|
@@ -301,6 +350,9 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
301
350
|
}
|
|
302
351
|
async editBranch(branch, options = {}) {
|
|
303
352
|
this._requireReady();
|
|
353
|
+
if (!branch) {
|
|
354
|
+
throw new Error("Branch name is required.");
|
|
355
|
+
}
|
|
304
356
|
try {
|
|
305
357
|
return await this._client.editBranch(branch, options);
|
|
306
358
|
} catch (error) {
|
|
@@ -309,6 +361,9 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
309
361
|
}
|
|
310
362
|
async deleteBranch(branch) {
|
|
311
363
|
this._requireReady();
|
|
364
|
+
if (!branch) {
|
|
365
|
+
throw new Error("Branch name is required.");
|
|
366
|
+
}
|
|
312
367
|
try {
|
|
313
368
|
return await this._client.deleteBranch(branch);
|
|
314
369
|
} catch (error) {
|
|
@@ -317,6 +372,9 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
317
372
|
}
|
|
318
373
|
async mergeBranch(branch, options = {}) {
|
|
319
374
|
this._requireReady();
|
|
375
|
+
if (!branch) {
|
|
376
|
+
throw new Error("Branch name is required.");
|
|
377
|
+
}
|
|
320
378
|
try {
|
|
321
379
|
return await this._client.mergeBranch(branch, options);
|
|
322
380
|
} catch (error) {
|
|
@@ -357,7 +415,8 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
357
415
|
return await this.updateData(
|
|
358
416
|
[
|
|
359
417
|
["update", [type, data.key], value],
|
|
360
|
-
["update", ["schema", type, data.key], schema]
|
|
418
|
+
["update", ["schema", type, data.key], schema],
|
|
419
|
+
...options.additionalChanges || []
|
|
361
420
|
],
|
|
362
421
|
{
|
|
363
422
|
message: `Created ${data.key} in ${type}`,
|
|
@@ -369,6 +428,32 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
369
428
|
throw new Error(`Failed to add item: ${error.message}`);
|
|
370
429
|
}
|
|
371
430
|
}
|
|
431
|
+
async addMultipleItems(items, options = {}, callback) {
|
|
432
|
+
this._requireReady();
|
|
433
|
+
const updateData = [];
|
|
434
|
+
items.forEach((item) => {
|
|
435
|
+
const [type, data] = item;
|
|
436
|
+
const { value, ...schema } = data;
|
|
437
|
+
import_validation.validateParams.type(type);
|
|
438
|
+
import_validation.validateParams.data(data, type);
|
|
439
|
+
updateData.push(
|
|
440
|
+
["update", [type, data.key], value],
|
|
441
|
+
["update", ["schema", type, data.key], schema]
|
|
442
|
+
);
|
|
443
|
+
});
|
|
444
|
+
try {
|
|
445
|
+
return await this.updateData(
|
|
446
|
+
[...updateData, ...options.additionalChanges || []],
|
|
447
|
+
{
|
|
448
|
+
message: `Created ${updateData.length} items`,
|
|
449
|
+
...options
|
|
450
|
+
},
|
|
451
|
+
isFunction(options) ? options : callback
|
|
452
|
+
);
|
|
453
|
+
} catch (error) {
|
|
454
|
+
throw new Error(`Failed to add item: ${error.message}`);
|
|
455
|
+
}
|
|
456
|
+
}
|
|
372
457
|
async updateItem(type, data, options = {}, callback) {
|
|
373
458
|
this._requireReady();
|
|
374
459
|
try {
|
|
@@ -416,7 +501,8 @@ class SymstoryService extends import_BaseService.BaseService {
|
|
|
416
501
|
return await this.updateData(
|
|
417
502
|
[
|
|
418
503
|
["delete", [type, key]],
|
|
419
|
-
["delete", ["schema", type, key]]
|
|
504
|
+
["delete", ["schema", type, key]],
|
|
505
|
+
...options.additionalChanges || []
|
|
420
506
|
],
|
|
421
507
|
{
|
|
422
508
|
message: `Deleted ${key} from ${type}`,
|
|
@@ -19,24 +19,24 @@ var services_exports = {};
|
|
|
19
19
|
__export(services_exports, {
|
|
20
20
|
AIService: () => import_AIService.AIService,
|
|
21
21
|
AuthService: () => import_AuthService.AuthService,
|
|
22
|
-
|
|
22
|
+
CoreService: () => import_CoreService.CoreService,
|
|
23
23
|
SocketService: () => import_SocketIOService.SocketService,
|
|
24
24
|
SymstoryService: () => import_SymstoryService.SymstoryService,
|
|
25
25
|
createAIService: () => createAIService,
|
|
26
26
|
createAuthService: () => createAuthService,
|
|
27
|
-
|
|
27
|
+
createCoreService: () => createCoreService,
|
|
28
28
|
createSocketService: () => createSocketService,
|
|
29
29
|
createSymstoryService: () => createSymstoryService
|
|
30
30
|
});
|
|
31
31
|
module.exports = __toCommonJS(services_exports);
|
|
32
|
-
var import_BasedService = require("./BasedService.js");
|
|
33
32
|
var import_SymstoryService = require("./SymstoryService.js");
|
|
34
33
|
var import_AuthService = require("./AuthService.js");
|
|
35
34
|
var import_AIService = require("./AIService.js");
|
|
36
35
|
var import_SocketIOService = require("./SocketIOService.js");
|
|
36
|
+
var import_CoreService = require("./CoreService.js");
|
|
37
37
|
const createService = (ServiceClass, config) => new ServiceClass(config);
|
|
38
|
-
const createBasedService = (config) => createService(import_BasedService.BasedService, config);
|
|
39
38
|
const createSymstoryService = (config) => createService(import_SymstoryService.SymstoryService, config);
|
|
40
39
|
const createAuthService = (config) => createService(import_AuthService.AuthService, config);
|
|
41
40
|
const createAIService = (config) => createService(import_AIService.AIService, config);
|
|
42
41
|
const createSocketService = (config) => createService(import_SocketIOService.SocketService, config);
|
|
42
|
+
const createCoreService = (config) => createService(import_CoreService.CoreService, config);
|