@ztimson/momentum 0.28.4 → 0.29.0
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/actions.d.ts +3 -2
- package/dist/actions.d.ts.map +1 -1
- package/dist/ai.d.ts +11 -0
- package/dist/ai.d.ts.map +1 -0
- package/dist/analytics.d.ts +37 -0
- package/dist/analytics.d.ts.map +1 -0
- package/dist/core.d.ts +2 -2
- package/dist/core.d.ts.map +1 -1
- package/dist/index.cjs +97 -55
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +97 -55
- package/dist/momentum.d.ts +4 -0
- package/dist/momentum.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/actions.d.ts
CHANGED
package/dist/actions.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,kBAAkB,EAAE,YAAY,EAAE,KAAK,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAC,eAAe,EAAC,MAAM,MAAM,CAAC;AACrC,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAC,IAAI,EAAE,UAAU,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"actions.d.ts","sourceRoot":"","sources":["../src/actions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,kBAAkB,EAAE,YAAY,EAAE,KAAK,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAClF,OAAO,EAAC,eAAe,EAAC,MAAM,MAAM,CAAC;AACrC,OAAO,EAAC,IAAI,EAAC,MAAM,QAAQ,CAAC;AAE5B,MAAM,MAAM,MAAM,GAAG,IAAI,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE;QAAC,IAAI,EAAE,UAAU,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAC,CAAC;IAC3C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,IAAI,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,IAAI,CAAC;CACf,CAAA;AAED,MAAM,MAAM,cAAc,GAAG;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,MAAM,EAAE,GAAG,EAAE,CAAC;IACd,MAAM,CAAC,EAAE,GAAG,CAAC;CACb,CAAA;AAED,oBAAY,UAAU;IACrB,MAAM,IAAA;IACN,OAAO,IAAA;IACP,QAAQ,IAAA;IACR,KAAK,IAAA;IACL,OAAO,IAAA;IACP,MAAM,IAAA;IACN,KAAK,IAAA;CACL;AAED,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG;IACxC,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAG,CAAC;IACjC,MAAM,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,GAAG,CAAC;IAC5B,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,KAAK,GAAG,CAAC;IACrC,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,GAAG,CAAC;IAChC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,KAAK,GAAG,CAAC;CAC5C,CAAA;AAED,qBAAa,OAAQ,SAAQ,YAAY,CAAC,YAAY,CAAC;IACtD,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAO;IAE3B,MAAM,4BAAqC;IAC3C,IAAI,KAAK,aAAgC;IACzC,IAAI,KAAK,CAAC,GAAG,UAAA,EAA4B;gBAE7B,GAAG,EAAE,GAAG,GAAG,MAAM;IAK7B,MAAM,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAOjC,IAAI,IAAI,OAAO,CAAC,MAAM,EAAE,CAAC;IAQzB,IAAI,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,UAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAUtD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,kBAAuB;IAIlD,OAAO,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,IAAI,GAAE,kBAAuB;IAK9D,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;CAWvC"}
|
package/dist/ai.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TypedEmitter, TypedEvents } from '@ztimson/utils';
|
|
2
|
+
import { Api } from './api';
|
|
3
|
+
export type AiEvents = TypedEvents & {
|
|
4
|
+
'QUESTION': (q: string, ctx: any, answer: string) => any;
|
|
5
|
+
};
|
|
6
|
+
export declare class Ai extends TypedEmitter<AiEvents> {
|
|
7
|
+
private readonly api;
|
|
8
|
+
constructor(api: Api | string);
|
|
9
|
+
ask(question: string, context: any): import('@ztimson/utils').PromiseProgress<any>;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=ai.d.ts.map
|
package/dist/ai.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ai.d.ts","sourceRoot":"","sources":["../src/ai.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,KAAK,WAAW,EAAC,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG;IACpC,UAAU,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,KAAK,GAAG,CAAC;CACzD,CAAC;AAEF,qBAAa,EAAG,SAAQ,YAAY,CAAC,QAAQ,CAAC;IAC7C,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAO;gBAEf,GAAG,EAAE,GAAG,GAAG,MAAM;IAK7B,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,GAAG;CASlC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { TypedEmitter, TypedEvents } from '@ztimson/utils';
|
|
2
|
+
import { Api } from './api';
|
|
3
|
+
export type AnalyticEvents = TypedEvents & {
|
|
4
|
+
'IP_TRACE': (ip: string, trace: IpTrace) => any;
|
|
5
|
+
};
|
|
6
|
+
export type IpTrace = {
|
|
7
|
+
"query": string;
|
|
8
|
+
"status": string;
|
|
9
|
+
"continent": string;
|
|
10
|
+
"continentCode": string;
|
|
11
|
+
"country": string;
|
|
12
|
+
"countryCode": string;
|
|
13
|
+
"region": string;
|
|
14
|
+
"regionName": string;
|
|
15
|
+
"city": string;
|
|
16
|
+
"district": string;
|
|
17
|
+
"zip": string;
|
|
18
|
+
"lat": number;
|
|
19
|
+
"lon": number;
|
|
20
|
+
"timezone": string;
|
|
21
|
+
"offset": number;
|
|
22
|
+
"currency": string;
|
|
23
|
+
"isp": string;
|
|
24
|
+
"org": string;
|
|
25
|
+
"as": string;
|
|
26
|
+
"asname": string;
|
|
27
|
+
"mobile": boolean;
|
|
28
|
+
"proxy": boolean;
|
|
29
|
+
"hosting": boolean;
|
|
30
|
+
message?: string;
|
|
31
|
+
};
|
|
32
|
+
export declare class Analytics extends TypedEmitter<AnalyticEvents> {
|
|
33
|
+
private readonly api;
|
|
34
|
+
constructor(api: Api | string);
|
|
35
|
+
traceIp(ip: string): import('@ztimson/utils').PromiseProgress<any>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=analytics.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics.d.ts","sourceRoot":"","sources":["../src/analytics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAE,WAAW,EAAC,MAAM,gBAAgB,CAAC;AACzD,OAAO,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE1B,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG;IAC1C,UAAU,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,KAAK,GAAG,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,OAAO,GAAG;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;IACpB,eAAe,EAAE,MAAM,CAAC;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,qBAAa,SAAU,SAAQ,YAAY,CAAC,cAAc,CAAC;IAC1D,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAO;gBAEf,GAAG,EAAE,GAAG,GAAG,MAAM;IAK7B,OAAO,CAAC,EAAE,EAAE,MAAM;CAOlB"}
|
package/dist/core.d.ts
CHANGED
package/dist/core.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG;IAClB,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,
|
|
1
|
+
{"version":3,"file":"core.d.ts","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG;IAClB,GAAG,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,IAAI,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,IAAI,CAAC;CACnB,CAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
var F = (n, e, t) => e in n ?
|
|
8
|
+
var v = Object.defineProperty;
|
|
9
|
+
var F = (n, e, t) => e in n ? v(n, e, { enumerable: true, configurable: true, writable: true, value: t }) : n[e] = t;
|
|
10
10
|
var a = (n, e, t) => (F(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
11
|
-
function
|
|
11
|
+
function W(n, e = false) {
|
|
12
12
|
if (n == null)
|
|
13
13
|
throw new Error("Cannot clean a NULL value");
|
|
14
14
|
return Array.isArray(n) ? n = n.filter((t) => t != null) : Object.entries(n).forEach(([t, r]) => {
|
|
@@ -19,6 +19,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
19
19
|
const t = typeof n, r = typeof e;
|
|
20
20
|
return t != "object" || n == null || r != "object" || e == null ? t == "function" && r == "function" ? n.toString() == e.toString() : n === e : Object.keys(n).length != Object.keys(e).length ? false : Object.keys(n).every((s) => b(n[s], e[s]));
|
|
21
21
|
}
|
|
22
|
+
function q(n) {
|
|
23
|
+
try {
|
|
24
|
+
return JSON.parse(n);
|
|
25
|
+
} catch {
|
|
26
|
+
return n;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
22
29
|
class E extends Promise {
|
|
23
30
|
constructor(t) {
|
|
24
31
|
super((r, o) => t(
|
|
@@ -56,15 +63,15 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
56
63
|
return this.from(super.finally(t));
|
|
57
64
|
}
|
|
58
65
|
}
|
|
59
|
-
function
|
|
66
|
+
function Z(n, e) {
|
|
60
67
|
const t = document.createElement("a");
|
|
61
68
|
t.href = n, t.download = e, document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
62
69
|
}
|
|
63
|
-
function
|
|
70
|
+
function Bt(n, e) {
|
|
64
71
|
const t = URL.createObjectURL(n);
|
|
65
|
-
|
|
72
|
+
Z(t, e), URL.revokeObjectURL(t);
|
|
66
73
|
}
|
|
67
|
-
function
|
|
74
|
+
function bt(n = {}) {
|
|
68
75
|
return new Promise((e) => {
|
|
69
76
|
const t = document.createElement("input");
|
|
70
77
|
t.type = "file", t.accept = n.accept || "*", t.style.display = "none", t.multiple = !!n.multiple, t.onblur = t.onchange = async () => {
|
|
@@ -72,13 +79,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
72
79
|
}, document.body.appendChild(t), t.click();
|
|
73
80
|
});
|
|
74
81
|
}
|
|
75
|
-
function
|
|
82
|
+
function Rt(n) {
|
|
76
83
|
return new E((e, t, r) => {
|
|
77
84
|
const o = new XMLHttpRequest(), s = new FormData();
|
|
78
|
-
n.files.forEach((i) => s.append("file", i)), o.withCredentials = !!n.withCredentials, o.upload.addEventListener("progress", (i) => i.lengthComputable ? r(i.loaded / i.total) : null), o.
|
|
85
|
+
n.files.forEach((i) => s.append("file", i)), o.withCredentials = !!n.withCredentials, o.upload.addEventListener("progress", (i) => i.lengthComputable ? r(i.loaded / i.total) : null), o.addEventListener("loadend", () => e(q(o.responseText))), o.addEventListener("error", () => t(q(o.responseText))), o.addEventListener("timeout", () => t({ error: "Request timed out" })), o.open("POST", n.url), Object.entries(n.headers || {}).forEach(([i, p]) => o.setRequestHeader(i, p)), o.send(s);
|
|
79
86
|
});
|
|
80
87
|
}
|
|
81
|
-
class
|
|
88
|
+
class H {
|
|
82
89
|
constructor() {
|
|
83
90
|
a(this, "listeners", {});
|
|
84
91
|
}
|
|
@@ -119,7 +126,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
119
126
|
});
|
|
120
127
|
}
|
|
121
128
|
}
|
|
122
|
-
a(
|
|
129
|
+
a(H, "listeners", {});
|
|
123
130
|
class w extends Error {
|
|
124
131
|
constructor(t, r) {
|
|
125
132
|
super(t);
|
|
@@ -148,7 +155,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
148
155
|
}
|
|
149
156
|
}
|
|
150
157
|
a(w, "code", 500);
|
|
151
|
-
class
|
|
158
|
+
class X extends w {
|
|
152
159
|
constructor(e = "Bad Request") {
|
|
153
160
|
super(e);
|
|
154
161
|
}
|
|
@@ -156,8 +163,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
156
163
|
return e.constructor.code == this.code;
|
|
157
164
|
}
|
|
158
165
|
}
|
|
159
|
-
a(
|
|
160
|
-
class
|
|
166
|
+
a(X, "code", 400);
|
|
167
|
+
class Q extends w {
|
|
161
168
|
constructor(e = "Unauthorized") {
|
|
162
169
|
super(e);
|
|
163
170
|
}
|
|
@@ -165,8 +172,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
165
172
|
return e.constructor.code == this.code;
|
|
166
173
|
}
|
|
167
174
|
}
|
|
168
|
-
a(
|
|
169
|
-
class
|
|
175
|
+
a(Q, "code", 401);
|
|
176
|
+
class _ extends w {
|
|
170
177
|
constructor(e = "Forbidden") {
|
|
171
178
|
super(e);
|
|
172
179
|
}
|
|
@@ -174,8 +181,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
174
181
|
return e.constructor.code == this.code;
|
|
175
182
|
}
|
|
176
183
|
}
|
|
177
|
-
a(
|
|
178
|
-
class
|
|
184
|
+
a(_, "code", 403);
|
|
185
|
+
class tt extends w {
|
|
179
186
|
constructor(e = "Not Found") {
|
|
180
187
|
super(e);
|
|
181
188
|
}
|
|
@@ -183,8 +190,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
183
190
|
return e.constructor.code == this.code;
|
|
184
191
|
}
|
|
185
192
|
}
|
|
186
|
-
a(
|
|
187
|
-
class
|
|
193
|
+
a(tt, "code", 404);
|
|
194
|
+
class et extends w {
|
|
188
195
|
constructor(e = "Internal Server Error") {
|
|
189
196
|
super(e);
|
|
190
197
|
}
|
|
@@ -192,7 +199,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
192
199
|
return e.constructor.code == this.code;
|
|
193
200
|
}
|
|
194
201
|
}
|
|
195
|
-
a(
|
|
202
|
+
a(et, "code", 500);
|
|
196
203
|
const g = class g2 {
|
|
197
204
|
constructor(e = {}) {
|
|
198
205
|
a(this, "interceptors", {});
|
|
@@ -221,7 +228,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
221
228
|
const s = Array.isArray(e.query) ? e.query : Object.keys(e.query).map((i) => ({ key: i, value: e.query[i] }));
|
|
222
229
|
t += (t.includes("?") ? "&" : "?") + s.map((i) => `${i.key}=${i.value}`).join("&");
|
|
223
230
|
}
|
|
224
|
-
const r =
|
|
231
|
+
const r = W({
|
|
225
232
|
"Content-Type": e.body ? e.body instanceof FormData ? "multipart/form-data" : "application/json" : void 0,
|
|
226
233
|
...g2.headers,
|
|
227
234
|
...this.headers,
|
|
@@ -233,24 +240,24 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
233
240
|
method: e.method || (e.body ? "POST" : "GET"),
|
|
234
241
|
body: e.body
|
|
235
242
|
}).then(async (c) => {
|
|
236
|
-
var
|
|
243
|
+
var j, G;
|
|
237
244
|
for (let u of [...Object.values(g2.interceptors), ...Object.values(this.interceptors)])
|
|
238
245
|
await new Promise((O) => u(c, () => O()));
|
|
239
246
|
const R = c.headers.get("Content-Length"), N = R ? parseInt(R, 10) : 0;
|
|
240
|
-
let
|
|
241
|
-
const
|
|
247
|
+
let k = 0;
|
|
248
|
+
const T = (j = c.body) == null ? void 0 : j.getReader(), Y = new ReadableStream({
|
|
242
249
|
start(u) {
|
|
243
250
|
function O() {
|
|
244
|
-
|
|
251
|
+
T == null || T.read().then((x) => {
|
|
245
252
|
if (x.done)
|
|
246
253
|
return u.close();
|
|
247
|
-
|
|
254
|
+
k += x.value.byteLength, p(k / N), u.enqueue(x.value), O();
|
|
248
255
|
}).catch((x) => u.error(x));
|
|
249
256
|
}
|
|
250
257
|
O();
|
|
251
258
|
}
|
|
252
259
|
});
|
|
253
|
-
if (c.data = new Response(
|
|
260
|
+
if (c.data = new Response(Y), e.decode == null || e.decode) {
|
|
254
261
|
const u = (G = c.headers.get("Content-Type")) == null ? void 0 : G.toLowerCase();
|
|
255
262
|
u != null && u.includes("form") ? c.data = await c.data.formData() : u != null && u.includes("json") ? c.data = await c.data.json() : u != null && u.includes("text") ? c.data = await c.data.text() : u != null && u.includes("application") && (c.data = await c.data.blob());
|
|
256
263
|
}
|
|
@@ -287,8 +294,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
287
294
|
LIGHT_CYAN: "\x1B[96m",
|
|
288
295
|
WHITE: "\x1B[97m"
|
|
289
296
|
};
|
|
290
|
-
var
|
|
291
|
-
const y = class y2 extends
|
|
297
|
+
var nt = /* @__PURE__ */ ((n) => (n[n.ERROR = 0] = "ERROR", n[n.WARN = 1] = "WARN", n[n.INFO = 2] = "INFO", n[n.LOG = 3] = "LOG", n[n.DEBUG = 4] = "DEBUG", n))(nt || {});
|
|
298
|
+
const y = class y2 extends H {
|
|
292
299
|
constructor(e) {
|
|
293
300
|
super(), this.namespace = e;
|
|
294
301
|
}
|
|
@@ -339,7 +346,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
339
346
|
constructor(url = location.origin, opts = {}) {
|
|
340
347
|
opts.url = url;
|
|
341
348
|
super(opts);
|
|
342
|
-
__publicField(this, "emitter", new
|
|
349
|
+
__publicField(this, "emitter", new H());
|
|
343
350
|
__publicField(this, "_token", null);
|
|
344
351
|
__publicField(this, "emit", this.emitter.emit.bind(this.emitter));
|
|
345
352
|
__publicField(this, "off", this.emitter.off.bind(this.emitter));
|
|
@@ -1089,7 +1096,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1089
1096
|
ActionType2[ActionType2["PUT"] = 6] = "PUT";
|
|
1090
1097
|
return ActionType2;
|
|
1091
1098
|
})(ActionType || {});
|
|
1092
|
-
class Actions extends
|
|
1099
|
+
class Actions extends H {
|
|
1093
1100
|
constructor(api) {
|
|
1094
1101
|
super();
|
|
1095
1102
|
__publicField(this, "api");
|
|
@@ -1143,6 +1150,35 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1143
1150
|
});
|
|
1144
1151
|
}
|
|
1145
1152
|
}
|
|
1153
|
+
class Ai extends H {
|
|
1154
|
+
constructor(api) {
|
|
1155
|
+
super();
|
|
1156
|
+
__publicField(this, "api");
|
|
1157
|
+
this.api = typeof api == "string" ? new Api(api) : api;
|
|
1158
|
+
}
|
|
1159
|
+
ask(question, context) {
|
|
1160
|
+
return this.api.request({ url: `/api/ai`, method: "POST", body: {
|
|
1161
|
+
question,
|
|
1162
|
+
context
|
|
1163
|
+
} }).then((resp) => {
|
|
1164
|
+
this.emit("QUESTION", question, context, resp);
|
|
1165
|
+
return resp;
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
class Analytics extends H {
|
|
1170
|
+
constructor(api) {
|
|
1171
|
+
super();
|
|
1172
|
+
__publicField(this, "api");
|
|
1173
|
+
this.api = typeof api == "string" ? new Api(api) : api;
|
|
1174
|
+
}
|
|
1175
|
+
traceIp(ip) {
|
|
1176
|
+
return this.api.request({ url: `/api/analytics/trace?ip=${ip}` }).then((resp) => {
|
|
1177
|
+
this.emit("IP_TRACE", ip, resp);
|
|
1178
|
+
return resp;
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
}
|
|
1146
1182
|
class Totp {
|
|
1147
1183
|
constructor(api) {
|
|
1148
1184
|
__publicField(this, "enable", this.reset);
|
|
@@ -1155,13 +1191,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1155
1191
|
return this.api.request({ url: `/api/auth/totp/${username}`, method: "POST" });
|
|
1156
1192
|
}
|
|
1157
1193
|
setup(username, method = "app", totp) {
|
|
1158
|
-
return this.api.request({ url: `/api/auth/totp/${username}`, body:
|
|
1194
|
+
return this.api.request({ url: `/api/auth/totp/${username}`, body: W({
|
|
1159
1195
|
method,
|
|
1160
1196
|
totp
|
|
1161
1197
|
}) });
|
|
1162
1198
|
}
|
|
1163
1199
|
}
|
|
1164
|
-
class Auth extends
|
|
1200
|
+
class Auth extends H {
|
|
1165
1201
|
constructor(api, opts) {
|
|
1166
1202
|
var _a;
|
|
1167
1203
|
super();
|
|
@@ -1292,7 +1328,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1292
1328
|
});
|
|
1293
1329
|
}
|
|
1294
1330
|
}
|
|
1295
|
-
class Data extends
|
|
1331
|
+
class Data extends H {
|
|
1296
1332
|
constructor(api) {
|
|
1297
1333
|
super();
|
|
1298
1334
|
__publicField(this, "api");
|
|
@@ -1334,7 +1370,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1334
1370
|
});
|
|
1335
1371
|
}
|
|
1336
1372
|
}
|
|
1337
|
-
class Email extends
|
|
1373
|
+
class Email extends H {
|
|
1338
1374
|
constructor(api) {
|
|
1339
1375
|
super();
|
|
1340
1376
|
__publicField(this, "api");
|
|
@@ -1349,7 +1385,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1349
1385
|
});
|
|
1350
1386
|
}
|
|
1351
1387
|
}
|
|
1352
|
-
class Groups extends
|
|
1388
|
+
class Groups extends H {
|
|
1353
1389
|
constructor(api) {
|
|
1354
1390
|
super();
|
|
1355
1391
|
__publicField(this, "api");
|
|
@@ -1431,32 +1467,32 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1431
1467
|
return this.api.request({ url: `/api/logs/server${query ? `?${query}` : ""}` }).then((resp) => resp);
|
|
1432
1468
|
}
|
|
1433
1469
|
debug(...logs) {
|
|
1434
|
-
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(
|
|
1470
|
+
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(nt.DEBUG, logs) }).then(() => {
|
|
1435
1471
|
}).catch(() => {
|
|
1436
1472
|
});
|
|
1437
1473
|
}
|
|
1438
1474
|
log(...logs) {
|
|
1439
|
-
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(
|
|
1475
|
+
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(nt.LOG, logs) }).then(() => {
|
|
1440
1476
|
}).catch(() => {
|
|
1441
1477
|
});
|
|
1442
1478
|
}
|
|
1443
1479
|
info(...logs) {
|
|
1444
|
-
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(
|
|
1480
|
+
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(nt.INFO, logs) }).then(() => {
|
|
1445
1481
|
}).catch(() => {
|
|
1446
1482
|
});
|
|
1447
1483
|
}
|
|
1448
1484
|
warn(...logs) {
|
|
1449
|
-
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(
|
|
1485
|
+
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(nt.WARN, logs) }).then(() => {
|
|
1450
1486
|
}).catch(() => {
|
|
1451
1487
|
});
|
|
1452
1488
|
}
|
|
1453
1489
|
error(...logs) {
|
|
1454
|
-
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(
|
|
1490
|
+
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(nt.ERROR, logs) }).then(() => {
|
|
1455
1491
|
}).catch(() => {
|
|
1456
1492
|
});
|
|
1457
1493
|
}
|
|
1458
1494
|
}
|
|
1459
|
-
class Payments extends
|
|
1495
|
+
class Payments extends H {
|
|
1460
1496
|
constructor(api, secret) {
|
|
1461
1497
|
super();
|
|
1462
1498
|
__publicField(this, "api");
|
|
@@ -1497,7 +1533,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1497
1533
|
return history;
|
|
1498
1534
|
}
|
|
1499
1535
|
}
|
|
1500
|
-
class Pdf extends
|
|
1536
|
+
class Pdf extends H {
|
|
1501
1537
|
constructor(api) {
|
|
1502
1538
|
super();
|
|
1503
1539
|
__publicField(this, "api");
|
|
@@ -1507,7 +1543,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1507
1543
|
const blob = await resp.blob();
|
|
1508
1544
|
if (fileName) {
|
|
1509
1545
|
const url = URL.createObjectURL(blob);
|
|
1510
|
-
|
|
1546
|
+
Z(url, fileName.endsWith(".pdf") ? fileName : fileName + ".pdf");
|
|
1511
1547
|
URL.revokeObjectURL(url);
|
|
1512
1548
|
}
|
|
1513
1549
|
this.emit("CREATE", blob);
|
|
@@ -1570,7 +1606,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1570
1606
|
};
|
|
1571
1607
|
__publicField(_Socket, "timeout", 1e4);
|
|
1572
1608
|
let Socket = _Socket;
|
|
1573
|
-
class Storage extends
|
|
1609
|
+
class Storage extends H {
|
|
1574
1610
|
constructor(api) {
|
|
1575
1611
|
super();
|
|
1576
1612
|
__publicField(this, "api");
|
|
@@ -1606,16 +1642,16 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1606
1642
|
const blob = await response.blob();
|
|
1607
1643
|
const name = opts.downloadAs || new URL(path).pathname.split("/").pop();
|
|
1608
1644
|
this.emit("DOWNLOAD", path, blob);
|
|
1609
|
-
|
|
1645
|
+
Bt(blob, name);
|
|
1610
1646
|
return response;
|
|
1611
1647
|
});
|
|
1612
1648
|
}
|
|
1613
1649
|
upload(files, opts = "") {
|
|
1614
1650
|
return new E(async (res, rej, prog) => {
|
|
1615
|
-
if (!files) files = await
|
|
1651
|
+
if (!files) files = await bt();
|
|
1616
1652
|
if (!files || Array.isArray(files) && !files.length) return [];
|
|
1617
1653
|
const url = this.api.url + ("/api/storage/" + (typeof opts == "string" ? opts : opts == null ? void 0 : opts.path)).replaceAll("//", "/");
|
|
1618
|
-
return
|
|
1654
|
+
return Rt({
|
|
1619
1655
|
url,
|
|
1620
1656
|
files: Array.isArray(files) ? files : [files],
|
|
1621
1657
|
headers: this.api.headers
|
|
@@ -1832,7 +1868,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1832
1868
|
}, 1e3);
|
|
1833
1869
|
}
|
|
1834
1870
|
}
|
|
1835
|
-
class Users extends
|
|
1871
|
+
class Users extends H {
|
|
1836
1872
|
constructor(api) {
|
|
1837
1873
|
super();
|
|
1838
1874
|
__publicField(this, "api");
|
|
@@ -1897,7 +1933,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1897
1933
|
});
|
|
1898
1934
|
}
|
|
1899
1935
|
uploadImage(username, file) {
|
|
1900
|
-
return
|
|
1936
|
+
return Rt({
|
|
1901
1937
|
url: this.api.url + `/api/users/${username}/image`,
|
|
1902
1938
|
files: [file],
|
|
1903
1939
|
headers: this.api.headers
|
|
@@ -1907,7 +1943,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1907
1943
|
});
|
|
1908
1944
|
}
|
|
1909
1945
|
}
|
|
1910
|
-
class Settings extends
|
|
1946
|
+
class Settings extends H {
|
|
1911
1947
|
constructor(api) {
|
|
1912
1948
|
super();
|
|
1913
1949
|
__publicField(this, "api");
|
|
@@ -1949,7 +1985,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1949
1985
|
});
|
|
1950
1986
|
}
|
|
1951
1987
|
}
|
|
1952
|
-
class Static extends
|
|
1988
|
+
class Static extends H {
|
|
1953
1989
|
constructor(api) {
|
|
1954
1990
|
super();
|
|
1955
1991
|
__publicField(this, "api");
|
|
@@ -1969,7 +2005,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1969
2005
|
}
|
|
1970
2006
|
upload(files, path = "/") {
|
|
1971
2007
|
return new E(async (res, rej, prog) => {
|
|
1972
|
-
return
|
|
2008
|
+
return Rt({
|
|
1973
2009
|
url: this.api.url + ("/api/static/" + path).replaceAll("//", "/"),
|
|
1974
2010
|
files: Array.isArray(files) ? files : [files],
|
|
1975
2011
|
headers: this.api.headers
|
|
@@ -1982,11 +2018,13 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1982
2018
|
});
|
|
1983
2019
|
}
|
|
1984
2020
|
}
|
|
1985
|
-
class Momentum extends
|
|
2021
|
+
class Momentum extends H {
|
|
1986
2022
|
constructor(url, opts) {
|
|
1987
2023
|
super();
|
|
1988
2024
|
__publicField(this, "api");
|
|
1989
2025
|
__publicField(this, "actions");
|
|
2026
|
+
__publicField(this, "ai");
|
|
2027
|
+
__publicField(this, "analytics");
|
|
1990
2028
|
__publicField(this, "auth");
|
|
1991
2029
|
__publicField(this, "data");
|
|
1992
2030
|
__publicField(this, "email");
|
|
@@ -2002,6 +2040,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2002
2040
|
__publicField(this, "users");
|
|
2003
2041
|
this.api = new Api(url, opts == null ? void 0 : opts.api);
|
|
2004
2042
|
this.actions = new Actions(this.api);
|
|
2043
|
+
this.ai = new Ai(this.api);
|
|
2044
|
+
this.analytics = new Analytics(this.api);
|
|
2005
2045
|
this.auth = new Auth(this.api, {
|
|
2006
2046
|
persist: (opts == null ? void 0 : opts.persist) ?? true,
|
|
2007
2047
|
loginUi: opts == null ? void 0 : opts.loginUi
|
|
@@ -2046,6 +2086,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2046
2086
|
}
|
|
2047
2087
|
exports2.ActionType = ActionType;
|
|
2048
2088
|
exports2.Actions = Actions;
|
|
2089
|
+
exports2.Ai = Ai;
|
|
2090
|
+
exports2.Analytics = Analytics;
|
|
2049
2091
|
exports2.Api = Api;
|
|
2050
2092
|
exports2.Auth = Auth;
|
|
2051
2093
|
exports2.Data = Data;
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,aAAa,CAAC;AAC5B,cAAc,OAAO,CAAC;AACtB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,OAAO,CAAC;AACtB,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,MAAM,CAAC;AACrB,cAAc,SAAS,CAAC"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
|
-
var
|
|
5
|
-
var F = (n, e, t) => e in n ?
|
|
4
|
+
var v = Object.defineProperty;
|
|
5
|
+
var F = (n, e, t) => e in n ? v(n, e, { enumerable: true, configurable: true, writable: true, value: t }) : n[e] = t;
|
|
6
6
|
var a = (n, e, t) => (F(n, typeof e != "symbol" ? e + "" : e, t), t);
|
|
7
|
-
function
|
|
7
|
+
function W(n, e = false) {
|
|
8
8
|
if (n == null)
|
|
9
9
|
throw new Error("Cannot clean a NULL value");
|
|
10
10
|
return Array.isArray(n) ? n = n.filter((t) => t != null) : Object.entries(n).forEach(([t, r]) => {
|
|
@@ -15,6 +15,13 @@ function b(n, e) {
|
|
|
15
15
|
const t = typeof n, r = typeof e;
|
|
16
16
|
return t != "object" || n == null || r != "object" || e == null ? t == "function" && r == "function" ? n.toString() == e.toString() : n === e : Object.keys(n).length != Object.keys(e).length ? false : Object.keys(n).every((s) => b(n[s], e[s]));
|
|
17
17
|
}
|
|
18
|
+
function q(n) {
|
|
19
|
+
try {
|
|
20
|
+
return JSON.parse(n);
|
|
21
|
+
} catch {
|
|
22
|
+
return n;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
18
25
|
class E extends Promise {
|
|
19
26
|
constructor(t) {
|
|
20
27
|
super((r, o) => t(
|
|
@@ -52,15 +59,15 @@ class E extends Promise {
|
|
|
52
59
|
return this.from(super.finally(t));
|
|
53
60
|
}
|
|
54
61
|
}
|
|
55
|
-
function
|
|
62
|
+
function Z(n, e) {
|
|
56
63
|
const t = document.createElement("a");
|
|
57
64
|
t.href = n, t.download = e, document.body.appendChild(t), t.click(), document.body.removeChild(t);
|
|
58
65
|
}
|
|
59
|
-
function
|
|
66
|
+
function Bt(n, e) {
|
|
60
67
|
const t = URL.createObjectURL(n);
|
|
61
|
-
|
|
68
|
+
Z(t, e), URL.revokeObjectURL(t);
|
|
62
69
|
}
|
|
63
|
-
function
|
|
70
|
+
function bt(n = {}) {
|
|
64
71
|
return new Promise((e) => {
|
|
65
72
|
const t = document.createElement("input");
|
|
66
73
|
t.type = "file", t.accept = n.accept || "*", t.style.display = "none", t.multiple = !!n.multiple, t.onblur = t.onchange = async () => {
|
|
@@ -68,13 +75,13 @@ function Bt(n = {}) {
|
|
|
68
75
|
}, document.body.appendChild(t), t.click();
|
|
69
76
|
});
|
|
70
77
|
}
|
|
71
|
-
function
|
|
78
|
+
function Rt(n) {
|
|
72
79
|
return new E((e, t, r) => {
|
|
73
80
|
const o = new XMLHttpRequest(), s = new FormData();
|
|
74
|
-
n.files.forEach((i) => s.append("file", i)), o.withCredentials = !!n.withCredentials, o.upload.addEventListener("progress", (i) => i.lengthComputable ? r(i.loaded / i.total) : null), o.
|
|
81
|
+
n.files.forEach((i) => s.append("file", i)), o.withCredentials = !!n.withCredentials, o.upload.addEventListener("progress", (i) => i.lengthComputable ? r(i.loaded / i.total) : null), o.addEventListener("loadend", () => e(q(o.responseText))), o.addEventListener("error", () => t(q(o.responseText))), o.addEventListener("timeout", () => t({ error: "Request timed out" })), o.open("POST", n.url), Object.entries(n.headers || {}).forEach(([i, p]) => o.setRequestHeader(i, p)), o.send(s);
|
|
75
82
|
});
|
|
76
83
|
}
|
|
77
|
-
class
|
|
84
|
+
class H {
|
|
78
85
|
constructor() {
|
|
79
86
|
a(this, "listeners", {});
|
|
80
87
|
}
|
|
@@ -115,7 +122,7 @@ class P {
|
|
|
115
122
|
});
|
|
116
123
|
}
|
|
117
124
|
}
|
|
118
|
-
a(
|
|
125
|
+
a(H, "listeners", {});
|
|
119
126
|
class w extends Error {
|
|
120
127
|
constructor(t, r) {
|
|
121
128
|
super(t);
|
|
@@ -144,7 +151,7 @@ class w extends Error {
|
|
|
144
151
|
}
|
|
145
152
|
}
|
|
146
153
|
a(w, "code", 500);
|
|
147
|
-
class
|
|
154
|
+
class X extends w {
|
|
148
155
|
constructor(e = "Bad Request") {
|
|
149
156
|
super(e);
|
|
150
157
|
}
|
|
@@ -152,8 +159,8 @@ class Z extends w {
|
|
|
152
159
|
return e.constructor.code == this.code;
|
|
153
160
|
}
|
|
154
161
|
}
|
|
155
|
-
a(
|
|
156
|
-
class
|
|
162
|
+
a(X, "code", 400);
|
|
163
|
+
class Q extends w {
|
|
157
164
|
constructor(e = "Unauthorized") {
|
|
158
165
|
super(e);
|
|
159
166
|
}
|
|
@@ -161,8 +168,8 @@ class X extends w {
|
|
|
161
168
|
return e.constructor.code == this.code;
|
|
162
169
|
}
|
|
163
170
|
}
|
|
164
|
-
a(
|
|
165
|
-
class
|
|
171
|
+
a(Q, "code", 401);
|
|
172
|
+
class _ extends w {
|
|
166
173
|
constructor(e = "Forbidden") {
|
|
167
174
|
super(e);
|
|
168
175
|
}
|
|
@@ -170,8 +177,8 @@ class Q extends w {
|
|
|
170
177
|
return e.constructor.code == this.code;
|
|
171
178
|
}
|
|
172
179
|
}
|
|
173
|
-
a(
|
|
174
|
-
class
|
|
180
|
+
a(_, "code", 403);
|
|
181
|
+
class tt extends w {
|
|
175
182
|
constructor(e = "Not Found") {
|
|
176
183
|
super(e);
|
|
177
184
|
}
|
|
@@ -179,8 +186,8 @@ class _ extends w {
|
|
|
179
186
|
return e.constructor.code == this.code;
|
|
180
187
|
}
|
|
181
188
|
}
|
|
182
|
-
a(
|
|
183
|
-
class
|
|
189
|
+
a(tt, "code", 404);
|
|
190
|
+
class et extends w {
|
|
184
191
|
constructor(e = "Internal Server Error") {
|
|
185
192
|
super(e);
|
|
186
193
|
}
|
|
@@ -188,7 +195,7 @@ class tt extends w {
|
|
|
188
195
|
return e.constructor.code == this.code;
|
|
189
196
|
}
|
|
190
197
|
}
|
|
191
|
-
a(
|
|
198
|
+
a(et, "code", 500);
|
|
192
199
|
const g = class g2 {
|
|
193
200
|
constructor(e = {}) {
|
|
194
201
|
a(this, "interceptors", {});
|
|
@@ -217,7 +224,7 @@ const g = class g2 {
|
|
|
217
224
|
const s = Array.isArray(e.query) ? e.query : Object.keys(e.query).map((i) => ({ key: i, value: e.query[i] }));
|
|
218
225
|
t += (t.includes("?") ? "&" : "?") + s.map((i) => `${i.key}=${i.value}`).join("&");
|
|
219
226
|
}
|
|
220
|
-
const r =
|
|
227
|
+
const r = W({
|
|
221
228
|
"Content-Type": e.body ? e.body instanceof FormData ? "multipart/form-data" : "application/json" : void 0,
|
|
222
229
|
...g2.headers,
|
|
223
230
|
...this.headers,
|
|
@@ -229,24 +236,24 @@ const g = class g2 {
|
|
|
229
236
|
method: e.method || (e.body ? "POST" : "GET"),
|
|
230
237
|
body: e.body
|
|
231
238
|
}).then(async (c) => {
|
|
232
|
-
var
|
|
239
|
+
var j, G;
|
|
233
240
|
for (let u of [...Object.values(g2.interceptors), ...Object.values(this.interceptors)])
|
|
234
241
|
await new Promise((O) => u(c, () => O()));
|
|
235
242
|
const R = c.headers.get("Content-Length"), N = R ? parseInt(R, 10) : 0;
|
|
236
|
-
let
|
|
237
|
-
const
|
|
243
|
+
let k = 0;
|
|
244
|
+
const T = (j = c.body) == null ? void 0 : j.getReader(), Y = new ReadableStream({
|
|
238
245
|
start(u) {
|
|
239
246
|
function O() {
|
|
240
|
-
|
|
247
|
+
T == null || T.read().then((x) => {
|
|
241
248
|
if (x.done)
|
|
242
249
|
return u.close();
|
|
243
|
-
|
|
250
|
+
k += x.value.byteLength, p(k / N), u.enqueue(x.value), O();
|
|
244
251
|
}).catch((x) => u.error(x));
|
|
245
252
|
}
|
|
246
253
|
O();
|
|
247
254
|
}
|
|
248
255
|
});
|
|
249
|
-
if (c.data = new Response(
|
|
256
|
+
if (c.data = new Response(Y), e.decode == null || e.decode) {
|
|
250
257
|
const u = (G = c.headers.get("Content-Type")) == null ? void 0 : G.toLowerCase();
|
|
251
258
|
u != null && u.includes("form") ? c.data = await c.data.formData() : u != null && u.includes("json") ? c.data = await c.data.json() : u != null && u.includes("text") ? c.data = await c.data.text() : u != null && u.includes("application") && (c.data = await c.data.blob());
|
|
252
259
|
}
|
|
@@ -283,8 +290,8 @@ const A = {
|
|
|
283
290
|
LIGHT_CYAN: "\x1B[96m",
|
|
284
291
|
WHITE: "\x1B[97m"
|
|
285
292
|
};
|
|
286
|
-
var
|
|
287
|
-
const y = class y2 extends
|
|
293
|
+
var nt = /* @__PURE__ */ ((n) => (n[n.ERROR = 0] = "ERROR", n[n.WARN = 1] = "WARN", n[n.INFO = 2] = "INFO", n[n.LOG = 3] = "LOG", n[n.DEBUG = 4] = "DEBUG", n))(nt || {});
|
|
294
|
+
const y = class y2 extends H {
|
|
288
295
|
constructor(e) {
|
|
289
296
|
super(), this.namespace = e;
|
|
290
297
|
}
|
|
@@ -335,7 +342,7 @@ class Api extends M {
|
|
|
335
342
|
constructor(url = location.origin, opts = {}) {
|
|
336
343
|
opts.url = url;
|
|
337
344
|
super(opts);
|
|
338
|
-
__publicField(this, "emitter", new
|
|
345
|
+
__publicField(this, "emitter", new H());
|
|
339
346
|
__publicField(this, "_token", null);
|
|
340
347
|
__publicField(this, "emit", this.emitter.emit.bind(this.emitter));
|
|
341
348
|
__publicField(this, "off", this.emitter.off.bind(this.emitter));
|
|
@@ -1085,7 +1092,7 @@ var ActionType = /* @__PURE__ */ ((ActionType2) => {
|
|
|
1085
1092
|
ActionType2[ActionType2["PUT"] = 6] = "PUT";
|
|
1086
1093
|
return ActionType2;
|
|
1087
1094
|
})(ActionType || {});
|
|
1088
|
-
class Actions extends
|
|
1095
|
+
class Actions extends H {
|
|
1089
1096
|
constructor(api) {
|
|
1090
1097
|
super();
|
|
1091
1098
|
__publicField(this, "api");
|
|
@@ -1139,6 +1146,35 @@ class Actions extends P {
|
|
|
1139
1146
|
});
|
|
1140
1147
|
}
|
|
1141
1148
|
}
|
|
1149
|
+
class Ai extends H {
|
|
1150
|
+
constructor(api) {
|
|
1151
|
+
super();
|
|
1152
|
+
__publicField(this, "api");
|
|
1153
|
+
this.api = typeof api == "string" ? new Api(api) : api;
|
|
1154
|
+
}
|
|
1155
|
+
ask(question, context) {
|
|
1156
|
+
return this.api.request({ url: `/api/ai`, method: "POST", body: {
|
|
1157
|
+
question,
|
|
1158
|
+
context
|
|
1159
|
+
} }).then((resp) => {
|
|
1160
|
+
this.emit("QUESTION", question, context, resp);
|
|
1161
|
+
return resp;
|
|
1162
|
+
});
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1165
|
+
class Analytics extends H {
|
|
1166
|
+
constructor(api) {
|
|
1167
|
+
super();
|
|
1168
|
+
__publicField(this, "api");
|
|
1169
|
+
this.api = typeof api == "string" ? new Api(api) : api;
|
|
1170
|
+
}
|
|
1171
|
+
traceIp(ip) {
|
|
1172
|
+
return this.api.request({ url: `/api/analytics/trace?ip=${ip}` }).then((resp) => {
|
|
1173
|
+
this.emit("IP_TRACE", ip, resp);
|
|
1174
|
+
return resp;
|
|
1175
|
+
});
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1142
1178
|
class Totp {
|
|
1143
1179
|
constructor(api) {
|
|
1144
1180
|
__publicField(this, "enable", this.reset);
|
|
@@ -1151,13 +1187,13 @@ class Totp {
|
|
|
1151
1187
|
return this.api.request({ url: `/api/auth/totp/${username}`, method: "POST" });
|
|
1152
1188
|
}
|
|
1153
1189
|
setup(username, method = "app", totp) {
|
|
1154
|
-
return this.api.request({ url: `/api/auth/totp/${username}`, body:
|
|
1190
|
+
return this.api.request({ url: `/api/auth/totp/${username}`, body: W({
|
|
1155
1191
|
method,
|
|
1156
1192
|
totp
|
|
1157
1193
|
}) });
|
|
1158
1194
|
}
|
|
1159
1195
|
}
|
|
1160
|
-
class Auth extends
|
|
1196
|
+
class Auth extends H {
|
|
1161
1197
|
constructor(api, opts) {
|
|
1162
1198
|
var _a;
|
|
1163
1199
|
super();
|
|
@@ -1288,7 +1324,7 @@ class Auth extends P {
|
|
|
1288
1324
|
});
|
|
1289
1325
|
}
|
|
1290
1326
|
}
|
|
1291
|
-
class Data extends
|
|
1327
|
+
class Data extends H {
|
|
1292
1328
|
constructor(api) {
|
|
1293
1329
|
super();
|
|
1294
1330
|
__publicField(this, "api");
|
|
@@ -1330,7 +1366,7 @@ class Data extends P {
|
|
|
1330
1366
|
});
|
|
1331
1367
|
}
|
|
1332
1368
|
}
|
|
1333
|
-
class Email extends
|
|
1369
|
+
class Email extends H {
|
|
1334
1370
|
constructor(api) {
|
|
1335
1371
|
super();
|
|
1336
1372
|
__publicField(this, "api");
|
|
@@ -1345,7 +1381,7 @@ class Email extends P {
|
|
|
1345
1381
|
});
|
|
1346
1382
|
}
|
|
1347
1383
|
}
|
|
1348
|
-
class Groups extends
|
|
1384
|
+
class Groups extends H {
|
|
1349
1385
|
constructor(api) {
|
|
1350
1386
|
super();
|
|
1351
1387
|
__publicField(this, "api");
|
|
@@ -1427,32 +1463,32 @@ class Logger {
|
|
|
1427
1463
|
return this.api.request({ url: `/api/logs/server${query ? `?${query}` : ""}` }).then((resp) => resp);
|
|
1428
1464
|
}
|
|
1429
1465
|
debug(...logs) {
|
|
1430
|
-
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(
|
|
1466
|
+
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(nt.DEBUG, logs) }).then(() => {
|
|
1431
1467
|
}).catch(() => {
|
|
1432
1468
|
});
|
|
1433
1469
|
}
|
|
1434
1470
|
log(...logs) {
|
|
1435
|
-
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(
|
|
1471
|
+
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(nt.LOG, logs) }).then(() => {
|
|
1436
1472
|
}).catch(() => {
|
|
1437
1473
|
});
|
|
1438
1474
|
}
|
|
1439
1475
|
info(...logs) {
|
|
1440
|
-
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(
|
|
1476
|
+
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(nt.INFO, logs) }).then(() => {
|
|
1441
1477
|
}).catch(() => {
|
|
1442
1478
|
});
|
|
1443
1479
|
}
|
|
1444
1480
|
warn(...logs) {
|
|
1445
|
-
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(
|
|
1481
|
+
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(nt.WARN, logs) }).then(() => {
|
|
1446
1482
|
}).catch(() => {
|
|
1447
1483
|
});
|
|
1448
1484
|
}
|
|
1449
1485
|
error(...logs) {
|
|
1450
|
-
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(
|
|
1486
|
+
return this.api.request({ url: `/api/logs/client`, body: this.buildLog(nt.ERROR, logs) }).then(() => {
|
|
1451
1487
|
}).catch(() => {
|
|
1452
1488
|
});
|
|
1453
1489
|
}
|
|
1454
1490
|
}
|
|
1455
|
-
class Payments extends
|
|
1491
|
+
class Payments extends H {
|
|
1456
1492
|
constructor(api, secret) {
|
|
1457
1493
|
super();
|
|
1458
1494
|
__publicField(this, "api");
|
|
@@ -1493,7 +1529,7 @@ class Payments extends P {
|
|
|
1493
1529
|
return history;
|
|
1494
1530
|
}
|
|
1495
1531
|
}
|
|
1496
|
-
class Pdf extends
|
|
1532
|
+
class Pdf extends H {
|
|
1497
1533
|
constructor(api) {
|
|
1498
1534
|
super();
|
|
1499
1535
|
__publicField(this, "api");
|
|
@@ -1503,7 +1539,7 @@ class Pdf extends P {
|
|
|
1503
1539
|
const blob = await resp.blob();
|
|
1504
1540
|
if (fileName) {
|
|
1505
1541
|
const url = URL.createObjectURL(blob);
|
|
1506
|
-
|
|
1542
|
+
Z(url, fileName.endsWith(".pdf") ? fileName : fileName + ".pdf");
|
|
1507
1543
|
URL.revokeObjectURL(url);
|
|
1508
1544
|
}
|
|
1509
1545
|
this.emit("CREATE", blob);
|
|
@@ -1566,7 +1602,7 @@ const _Socket = class _Socket {
|
|
|
1566
1602
|
};
|
|
1567
1603
|
__publicField(_Socket, "timeout", 1e4);
|
|
1568
1604
|
let Socket = _Socket;
|
|
1569
|
-
class Storage extends
|
|
1605
|
+
class Storage extends H {
|
|
1570
1606
|
constructor(api) {
|
|
1571
1607
|
super();
|
|
1572
1608
|
__publicField(this, "api");
|
|
@@ -1602,16 +1638,16 @@ class Storage extends P {
|
|
|
1602
1638
|
const blob = await response.blob();
|
|
1603
1639
|
const name = opts.downloadAs || new URL(path).pathname.split("/").pop();
|
|
1604
1640
|
this.emit("DOWNLOAD", path, blob);
|
|
1605
|
-
|
|
1641
|
+
Bt(blob, name);
|
|
1606
1642
|
return response;
|
|
1607
1643
|
});
|
|
1608
1644
|
}
|
|
1609
1645
|
upload(files, opts = "") {
|
|
1610
1646
|
return new E(async (res, rej, prog) => {
|
|
1611
|
-
if (!files) files = await
|
|
1647
|
+
if (!files) files = await bt();
|
|
1612
1648
|
if (!files || Array.isArray(files) && !files.length) return [];
|
|
1613
1649
|
const url = this.api.url + ("/api/storage/" + (typeof opts == "string" ? opts : opts == null ? void 0 : opts.path)).replaceAll("//", "/");
|
|
1614
|
-
return
|
|
1650
|
+
return Rt({
|
|
1615
1651
|
url,
|
|
1616
1652
|
files: Array.isArray(files) ? files : [files],
|
|
1617
1653
|
headers: this.api.headers
|
|
@@ -1828,7 +1864,7 @@ class UI {
|
|
|
1828
1864
|
}, 1e3);
|
|
1829
1865
|
}
|
|
1830
1866
|
}
|
|
1831
|
-
class Users extends
|
|
1867
|
+
class Users extends H {
|
|
1832
1868
|
constructor(api) {
|
|
1833
1869
|
super();
|
|
1834
1870
|
__publicField(this, "api");
|
|
@@ -1893,7 +1929,7 @@ class Users extends P {
|
|
|
1893
1929
|
});
|
|
1894
1930
|
}
|
|
1895
1931
|
uploadImage(username, file) {
|
|
1896
|
-
return
|
|
1932
|
+
return Rt({
|
|
1897
1933
|
url: this.api.url + `/api/users/${username}/image`,
|
|
1898
1934
|
files: [file],
|
|
1899
1935
|
headers: this.api.headers
|
|
@@ -1903,7 +1939,7 @@ class Users extends P {
|
|
|
1903
1939
|
});
|
|
1904
1940
|
}
|
|
1905
1941
|
}
|
|
1906
|
-
class Settings extends
|
|
1942
|
+
class Settings extends H {
|
|
1907
1943
|
constructor(api) {
|
|
1908
1944
|
super();
|
|
1909
1945
|
__publicField(this, "api");
|
|
@@ -1945,7 +1981,7 @@ class Settings extends P {
|
|
|
1945
1981
|
});
|
|
1946
1982
|
}
|
|
1947
1983
|
}
|
|
1948
|
-
class Static extends
|
|
1984
|
+
class Static extends H {
|
|
1949
1985
|
constructor(api) {
|
|
1950
1986
|
super();
|
|
1951
1987
|
__publicField(this, "api");
|
|
@@ -1965,7 +2001,7 @@ class Static extends P {
|
|
|
1965
2001
|
}
|
|
1966
2002
|
upload(files, path = "/") {
|
|
1967
2003
|
return new E(async (res, rej, prog) => {
|
|
1968
|
-
return
|
|
2004
|
+
return Rt({
|
|
1969
2005
|
url: this.api.url + ("/api/static/" + path).replaceAll("//", "/"),
|
|
1970
2006
|
files: Array.isArray(files) ? files : [files],
|
|
1971
2007
|
headers: this.api.headers
|
|
@@ -1978,11 +2014,13 @@ class Static extends P {
|
|
|
1978
2014
|
});
|
|
1979
2015
|
}
|
|
1980
2016
|
}
|
|
1981
|
-
class Momentum extends
|
|
2017
|
+
class Momentum extends H {
|
|
1982
2018
|
constructor(url, opts) {
|
|
1983
2019
|
super();
|
|
1984
2020
|
__publicField(this, "api");
|
|
1985
2021
|
__publicField(this, "actions");
|
|
2022
|
+
__publicField(this, "ai");
|
|
2023
|
+
__publicField(this, "analytics");
|
|
1986
2024
|
__publicField(this, "auth");
|
|
1987
2025
|
__publicField(this, "data");
|
|
1988
2026
|
__publicField(this, "email");
|
|
@@ -1998,6 +2036,8 @@ class Momentum extends P {
|
|
|
1998
2036
|
__publicField(this, "users");
|
|
1999
2037
|
this.api = new Api(url, opts == null ? void 0 : opts.api);
|
|
2000
2038
|
this.actions = new Actions(this.api);
|
|
2039
|
+
this.ai = new Ai(this.api);
|
|
2040
|
+
this.analytics = new Analytics(this.api);
|
|
2001
2041
|
this.auth = new Auth(this.api, {
|
|
2002
2042
|
persist: (opts == null ? void 0 : opts.persist) ?? true,
|
|
2003
2043
|
loginUi: opts == null ? void 0 : opts.loginUi
|
|
@@ -2043,6 +2083,8 @@ class Momentum extends P {
|
|
|
2043
2083
|
export {
|
|
2044
2084
|
ActionType,
|
|
2045
2085
|
Actions,
|
|
2086
|
+
Ai,
|
|
2087
|
+
Analytics,
|
|
2046
2088
|
Api,
|
|
2047
2089
|
Auth,
|
|
2048
2090
|
Data,
|
package/dist/momentum.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Actions } from './actions';
|
|
2
|
+
import { Ai } from './ai';
|
|
3
|
+
import { Analytics } from './analytics';
|
|
2
4
|
import { Api, ApiEvents } from './api';
|
|
3
5
|
import { Auth, AuthEvents, AuthOptions } from './auth';
|
|
4
6
|
import { Data, DataEvents } from './data';
|
|
@@ -24,6 +26,8 @@ export type MomentumOptions = AuthOptions & {
|
|
|
24
26
|
export declare class Momentum extends TypedEmitter<MomentumEvents> {
|
|
25
27
|
api: Api;
|
|
26
28
|
actions: Actions;
|
|
29
|
+
ai: Ai;
|
|
30
|
+
analytics: Analytics;
|
|
27
31
|
auth: Auth;
|
|
28
32
|
data: Data;
|
|
29
33
|
email: Email;
|
package/dist/momentum.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"momentum.d.ts","sourceRoot":"","sources":["../src/momentum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,GAAG,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAC,IAAI,EAAE,KAAK,UAAU,EAAE,WAAW,EAAC,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAE,KAAK,UAAU,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAC,KAAK,EAAE,KAAK,WAAW,EAAC,MAAM,SAAS,CAAC;AAChD,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,GAAG,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,KAAK,aAAa,EAAC,MAAM,WAAW,CAAC;AACtD,OAAO,EAAC,EAAE,EAAC,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,QAAQ,EAAE,KAAK,aAAa,EAAC,MAAM,YAAY,CAAC;AACxD,OAAO,EAAC,MAAM,EAAE,KAAK,YAAY,EAAC,MAAM,UAAU,CAAC;AAEnD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,YAAY,GAAG,aAAa,GAAG,aAAa,CAAC;AAExJ,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC3C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,kBAAkB,CAAC;CACzB,CAAA;AAED,qBAAa,QAAS,SAAQ,YAAY,CAAC,cAAc,CAAC;IACzD,GAAG,EAAG,GAAG,CAAC;IACV,OAAO,EAAG,OAAO,CAAC;IAClB,IAAI,EAAG,IAAI,CAAC;IACZ,IAAI,EAAG,IAAI,CAAC;IACZ,KAAK,EAAG,KAAK,CAAC;IACd,MAAM,EAAG,MAAM,CAAC;IAChB,MAAM,EAAG,MAAM,CAAC;IAChB,QAAQ,EAAG,QAAQ,CAAC;IACpB,GAAG,EAAG,GAAG,CAAC;IACV,QAAQ,EAAG,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAG,MAAM,CAAC;IAChB,OAAO,EAAG,OAAO,CAAC;IAClB,EAAE,EAAG,EAAE,CAAC;IACR,KAAK,EAAG,KAAK,CAAC;gBAEF,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,eAAe;
|
|
1
|
+
{"version":3,"file":"momentum.d.ts","sourceRoot":"","sources":["../src/momentum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,WAAW,CAAC;AAClC,OAAO,EAAC,EAAE,EAAC,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAC,GAAG,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAC,IAAI,EAAE,KAAK,UAAU,EAAE,WAAW,EAAC,MAAM,QAAQ,CAAC;AAC1D,OAAO,EAAC,IAAI,EAAE,KAAK,UAAU,EAAC,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAC,KAAK,EAAE,KAAK,WAAW,EAAC,MAAM,SAAS,CAAC;AAChD,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAChC,OAAO,EAAC,YAAY,EAAE,KAAK,WAAW,EAAE,KAAK,kBAAkB,EAAC,MAAM,gBAAgB,CAAC;AACvF,OAAO,EAAC,MAAM,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAC,QAAQ,EAAC,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,GAAG,EAAE,KAAK,SAAS,EAAC,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAC,MAAM,EAAC,MAAM,WAAW,CAAC;AACjC,OAAO,EAAC,OAAO,EAAE,KAAK,aAAa,EAAC,MAAM,WAAW,CAAC;AACtD,OAAO,EAAC,EAAE,EAAC,MAAM,MAAM,CAAC;AACxB,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,QAAQ,EAAE,KAAK,aAAa,EAAC,MAAM,YAAY,CAAC;AACxD,OAAO,EAAC,MAAM,EAAE,KAAK,YAAY,EAAC,MAAM,UAAU,CAAC;AAEnD,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,WAAW,GAAG,SAAS,GAAG,YAAY,GAAG,aAAa,GAAG,aAAa,CAAC;AAExJ,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC3C,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,GAAG,CAAC,EAAE,kBAAkB,CAAC;CACzB,CAAA;AAED,qBAAa,QAAS,SAAQ,YAAY,CAAC,cAAc,CAAC;IACzD,GAAG,EAAG,GAAG,CAAC;IACV,OAAO,EAAG,OAAO,CAAC;IAClB,EAAE,EAAG,EAAE,CAAC;IACR,SAAS,EAAG,SAAS,CAAC;IACtB,IAAI,EAAG,IAAI,CAAC;IACZ,IAAI,EAAG,IAAI,CAAC;IACZ,KAAK,EAAG,KAAK,CAAC;IACd,MAAM,EAAG,MAAM,CAAC;IAChB,MAAM,EAAG,MAAM,CAAC;IAChB,QAAQ,EAAG,QAAQ,CAAC;IACpB,GAAG,EAAG,GAAG,CAAC;IACV,QAAQ,EAAG,QAAQ,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,EAAG,MAAM,CAAC;IAChB,OAAO,EAAG,OAAO,CAAC;IAClB,EAAE,EAAG,EAAE,CAAC;IACR,KAAK,EAAG,KAAK,CAAC;gBAEF,GAAG,CAAC,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,eAAe;CA6ChD"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ztimson/momentum",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"description": "Client library for momentum",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Momentum"
|
|
@@ -20,13 +20,13 @@
|
|
|
20
20
|
"types": "./dist/index.d.ts"
|
|
21
21
|
},
|
|
22
22
|
"scripts": {
|
|
23
|
+
"start": "vite build --watch",
|
|
23
24
|
"prebuild": "node -e \"const fs=require('fs');fs.cpSync('../README.md','./README.md')\"",
|
|
24
25
|
"build": "tsc && vite build",
|
|
25
|
-
"postbuild": "node -e \"const fs=require('fs');fs.cpSync('dist/index.mjs','../server/public/momentum.mjs');fs.cpSync('dist/index.cjs','../server/public/momentum.js')\""
|
|
26
|
-
"watch": "vite build --watch"
|
|
26
|
+
"postbuild": "node -e \"const fs=require('fs');fs.cpSync('dist/index.mjs','../server/public/momentum.mjs');fs.cpSync('dist/index.cjs','../server/public/momentum.js')\""
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@ztimson/utils": "
|
|
29
|
+
"@ztimson/utils": "0.15.1",
|
|
30
30
|
"rxjs": "^7.8.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|