@septkit/shell-lib 0.0.31 → 0.0.32
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 +68 -31
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ function a(e) {
|
|
|
9
9
|
return i.some((t) => e.startsWith(t));
|
|
10
10
|
}
|
|
11
11
|
//#endregion
|
|
12
|
-
//#region node_modules/.pnpm/@dialecte+core@0.
|
|
12
|
+
//#region node_modules/.pnpm/@dialecte+core@0.6.1/node_modules/@dialecte/core/dist/utils-CTBHUFs9.js
|
|
13
13
|
var o = {
|
|
14
14
|
UNKNOWN: {
|
|
15
15
|
code: "D0001",
|
|
@@ -99,6 +99,18 @@ var o = {
|
|
|
99
99
|
code: "D3008",
|
|
100
100
|
message: "Attribute value differs from the schema-fixed value"
|
|
101
101
|
},
|
|
102
|
+
XSI_TYPE_REQUIRED: {
|
|
103
|
+
code: "D3009",
|
|
104
|
+
message: "The element is declared with an abstract type: name a type with xsi:type"
|
|
105
|
+
},
|
|
106
|
+
XSI_TYPE_NOT_ADMITTED: {
|
|
107
|
+
code: "D3010",
|
|
108
|
+
message: "The element may not take the type named with xsi:type"
|
|
109
|
+
},
|
|
110
|
+
XSI_TYPE_CHANGE_LEAVES_CONTENT: {
|
|
111
|
+
code: "D3011",
|
|
112
|
+
message: "The new xsi:type does not admit content the element still holds"
|
|
113
|
+
},
|
|
102
114
|
ALREADY_COMMITTED: {
|
|
103
115
|
code: "D4001",
|
|
104
116
|
message: "Transaction already committed"
|
|
@@ -149,57 +161,82 @@ var o = {
|
|
|
149
161
|
}
|
|
150
162
|
};
|
|
151
163
|
function s(e, t) {
|
|
152
|
-
|
|
153
|
-
|
|
164
|
+
throw c(e, t);
|
|
165
|
+
}
|
|
166
|
+
function c(e, t) {
|
|
167
|
+
let n = typeof e == "string" ? {
|
|
154
168
|
key: e,
|
|
169
|
+
...o[e]
|
|
170
|
+
} : e, r = {
|
|
171
|
+
code: n.code,
|
|
172
|
+
key: n.key,
|
|
155
173
|
message: t.message ?? n.message,
|
|
156
174
|
detail: t.detail,
|
|
157
|
-
method:
|
|
175
|
+
method: u((/* @__PURE__ */ Error()).stack),
|
|
158
176
|
ref: t.ref,
|
|
177
|
+
meta: t.meta,
|
|
159
178
|
cause: t.cause
|
|
160
179
|
}, i = Error(t.detail);
|
|
161
|
-
|
|
180
|
+
return i.cause = r, i;
|
|
162
181
|
}
|
|
163
|
-
|
|
182
|
+
new Set(Object.values(o).map((e) => e.code));
|
|
183
|
+
var l = new Set([
|
|
184
|
+
"throwDialecteError",
|
|
185
|
+
"createDialecteError",
|
|
186
|
+
"invariant",
|
|
187
|
+
"reportFailure"
|
|
188
|
+
]);
|
|
189
|
+
function u(e) {
|
|
164
190
|
if (!e) return "unknown";
|
|
165
|
-
let t = e.split("\n").slice(1).
|
|
166
|
-
if (!
|
|
167
|
-
let
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
191
|
+
let t = e.split("\n").slice(1).map((e) => e.match(/\bat\s+(?:async\s+)?(\S+)(?:\s+\[as\s+[^\]]+\])?\s+\(([^)]+)\)/)).find((e) => !d(e?.[1])), n = t?.[1]?.replace(/^Object\./, ""), r = t?.[2];
|
|
192
|
+
if (!r || !n) return n ?? "unknown";
|
|
193
|
+
let i = r.match(/(\w[\w-]*\/src\/[^?:]+)/);
|
|
194
|
+
return i ? `${i[1].replace(/\.[^/.]+$/, "")}::${n}` : n;
|
|
195
|
+
}
|
|
196
|
+
function d(e) {
|
|
197
|
+
return e ? l.has(e.slice(e.lastIndexOf(".") + 1)) : !1;
|
|
171
198
|
}
|
|
172
|
-
|
|
199
|
+
`${{
|
|
200
|
+
uri: "http://dialecte.dev/XML/DEV",
|
|
201
|
+
prefix: "dev"
|
|
202
|
+
}.prefix}`;
|
|
203
|
+
var f = {
|
|
204
|
+
uri: "http://www.w3.org/2001/XMLSchema-instance",
|
|
205
|
+
prefix: "xsi"
|
|
206
|
+
};
|
|
207
|
+
`${f.prefix}${f.uri}`;
|
|
208
|
+
function p(e, t) {
|
|
173
209
|
if (e) return;
|
|
174
|
-
let { detail: n, key: r = "ASSERTION_FAILED", ref: i } = t;
|
|
210
|
+
let { detail: n, key: r = "ASSERTION_FAILED", ref: i, meta: a } = t;
|
|
175
211
|
s(r, {
|
|
176
212
|
detail: n,
|
|
177
|
-
ref: i
|
|
213
|
+
ref: i,
|
|
214
|
+
meta: a
|
|
178
215
|
});
|
|
179
216
|
}
|
|
180
217
|
//#endregion
|
|
181
218
|
//#region src/shell-context.ts
|
|
182
|
-
var
|
|
183
|
-
function
|
|
184
|
-
|
|
219
|
+
var m = null;
|
|
220
|
+
function h(e) {
|
|
221
|
+
m = e;
|
|
185
222
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
223
|
+
function g() {
|
|
224
|
+
m = null;
|
|
188
225
|
}
|
|
189
|
-
function
|
|
190
|
-
return
|
|
226
|
+
function _() {
|
|
227
|
+
return p(m, { detail: "getProject: shell context not set. Call setShellContext(api) before app.mount()." }), m.project;
|
|
191
228
|
}
|
|
192
|
-
function
|
|
193
|
-
return
|
|
229
|
+
function v() {
|
|
230
|
+
return p(m, { detail: "getActiveDocumentId: shell context not set. Call setShellContext(api) before app.mount()." }), m.activeDocumentId;
|
|
194
231
|
}
|
|
195
|
-
function
|
|
196
|
-
return
|
|
232
|
+
function y() {
|
|
233
|
+
return p(m, { detail: "getCommands: shell context not set. Call setShellContext(api) before app.mount()." }), m.commands;
|
|
197
234
|
}
|
|
198
|
-
function
|
|
199
|
-
return
|
|
235
|
+
function b() {
|
|
236
|
+
return p(m, { detail: "getStorageSources: shell context not set. Call setShellContext(api) before app.mount()." }), p(m.storageSources, { detail: "getStorageSources: no storage sources provided by the shell." }), m.storageSources;
|
|
200
237
|
}
|
|
201
|
-
function
|
|
202
|
-
return
|
|
238
|
+
function x() {
|
|
239
|
+
return p(m, { detail: "getPwa: shell context not set. Call setShellContext(api) before app.mount()." }), p(m.pwa, { detail: "getPwa: no PWA surface provided by the shell." }), m.pwa;
|
|
203
240
|
}
|
|
204
241
|
//#endregion
|
|
205
|
-
export { t as LIBRARY_DB_PREFIX, i as RESERVED_DB_PREFIXES, e as SHELL_DB_PREFIX, n as TEMP_DOCUMENT_PREFIX, r as TEMP_PROJECT_PREFIX,
|
|
242
|
+
export { t as LIBRARY_DB_PREFIX, i as RESERVED_DB_PREFIXES, e as SHELL_DB_PREFIX, n as TEMP_DOCUMENT_PREFIX, r as TEMP_PROJECT_PREFIX, g as clearShellContext, v as getActiveDocumentId, y as getCommands, _ as getProject, x as getPwa, b as getStorageSources, a as isReservedDatabaseName, h as setShellContext };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@septkit/shell-lib",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.32",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@dialecte/core": "0.
|
|
17
|
-
"@dialecte/scl": "0.
|
|
16
|
+
"@dialecte/core": "0.6.1",
|
|
17
|
+
"@dialecte/scl": "0.8.0"
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"oxlint": "~1.6.0",
|