wcz-test 7.0.2 → 7.1.1
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/DialogsContext-8xfQ3X-k.js +285 -0
- package/dist/DialogsContext-8xfQ3X-k.js.map +1 -0
- package/dist/{DialogsHooks-BZUdpDVJ.js → DialogsHooks-BXfwbYWP.js} +14 -14
- package/dist/{DialogsHooks-BZUdpDVJ.js.map → DialogsHooks-BXfwbYWP.js.map} +1 -1
- package/dist/FileMeta-CDQ1BQUH.js +21 -0
- package/dist/FileMeta-CDQ1BQUH.js.map +1 -0
- package/dist/RouterListItemButton-DrW6M53Y.js +17 -0
- package/dist/{RouterListItemButton-C_jUvB6C.js.map → RouterListItemButton-DrW6M53Y.js.map} +1 -1
- package/dist/components.js +1158 -1132
- package/dist/components.js.map +1 -1
- package/dist/exports/components.d.ts +14 -0
- package/dist/exports/hooks.d.ts +6 -0
- package/dist/exports/index.d.ts +4 -0
- package/dist/exports/models.d.ts +24 -0
- package/dist/exports/query.d.ts +2 -0
- package/dist/exports/utils.d.ts +5 -0
- package/dist/exports/vite.d.ts +1 -0
- package/dist/hooks.js +466 -421
- package/dist/hooks.js.map +1 -1
- package/dist/index-DchOf6FV.js +2756 -0
- package/dist/index-DchOf6FV.js.map +1 -0
- package/dist/{index-Y_pgyGkL.js → index-De6Lo0ff.js} +531 -603
- package/dist/index-De6Lo0ff.js.map +1 -0
- package/dist/index.js +822 -666
- package/dist/index.js.map +1 -1
- package/dist/models.js +2 -2
- package/dist/query.js +6 -0
- package/dist/query.js.map +1 -0
- package/dist/utils-Dttzp8un.js +10879 -0
- package/dist/utils-Dttzp8un.js.map +1 -0
- package/dist/utils.js +271 -8
- package/dist/utils.js.map +1 -1
- package/dist/vite.js +53 -26
- package/dist/vite.js.map +1 -1
- package/package.json +6 -10
- package/dist/ApprovalStatus-lESbUD_x.js +0 -7
- package/dist/ApprovalStatus-lESbUD_x.js.map +0 -1
- package/dist/DialogsContext-CGAKEKKW.js +0 -546
- package/dist/DialogsContext-CGAKEKKW.js.map +0 -1
- package/dist/FileHooks-CstZ4QII.js +0 -2699
- package/dist/FileHooks-CstZ4QII.js.map +0 -1
- package/dist/FileMeta-Bzeo3ie9.js +0 -18
- package/dist/FileMeta-Bzeo3ie9.js.map +0 -1
- package/dist/GraphQueries-Bx0CzlWR.js +0 -28020
- package/dist/GraphQueries-Bx0CzlWR.js.map +0 -1
- package/dist/RouterListItemButton-C_jUvB6C.js +0 -18
- package/dist/auth.d.ts +0 -8
- package/dist/auth.js +0 -6
- package/dist/auth.js.map +0 -1
- package/dist/bun-sqlite-dialect-CZjbVcY_.js +0 -143
- package/dist/bun-sqlite-dialect-CZjbVcY_.js.map +0 -1
- package/dist/compiler-runtime-BNHg76kC.js +0 -37
- package/dist/compiler-runtime-BNHg76kC.js.map +0 -1
- package/dist/components.d.ts +0 -44
- package/dist/hooks.d.ts +0 -26
- package/dist/index-BT7qlAad.js +0 -159
- package/dist/index-BT7qlAad.js.map +0 -1
- package/dist/index-Biz5inV2.js +0 -268
- package/dist/index-Biz5inV2.js.map +0 -1
- package/dist/index-Phhmhd_m.js +0 -227
- package/dist/index-Phhmhd_m.js.map +0 -1
- package/dist/index-Y_pgyGkL.js.map +0 -1
- package/dist/index.d.ts +0 -20
- package/dist/models.d.ts +0 -107
- package/dist/node-sqlite-dialect-CSXFdUmA.js +0 -143
- package/dist/node-sqlite-dialect-CSXFdUmA.js.map +0 -1
- package/dist/queries.d.ts +0 -95
- package/dist/queries.js +0 -567
- package/dist/queries.js.map +0 -1
- package/dist/utils-araYIHAE.js +0 -81
- package/dist/utils-araYIHAE.js.map +0 -1
- package/dist/utils.d.ts +0 -14
- package/dist/vite.d.ts +0 -5
package/dist/utils.js
CHANGED
|
@@ -1,11 +1,274 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { P as R, c as _, g as v } from "./utils-Dttzp8un.js";
|
|
2
|
+
import { t as x } from "./i18next-Bx3TmZAT.js";
|
|
3
|
+
const c = "0123456789abcdef";
|
|
4
|
+
class o {
|
|
5
|
+
/** @param bytes - The 16-byte byte array representation. */
|
|
6
|
+
constructor(e) {
|
|
7
|
+
this.bytes = e;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Creates an object from the internal representation, a 16-byte byte array
|
|
11
|
+
* containing the binary UUID representation in the big-endian byte order.
|
|
12
|
+
*
|
|
13
|
+
* This method does NOT shallow-copy the argument, and thus the created object
|
|
14
|
+
* holds the reference to the underlying buffer.
|
|
15
|
+
*
|
|
16
|
+
* @throws TypeError if the length of the argument is not 16.
|
|
17
|
+
*/
|
|
18
|
+
static ofInner(e) {
|
|
19
|
+
if (e.length !== 16)
|
|
20
|
+
throw new TypeError("not 128-bit length");
|
|
21
|
+
return new o(e);
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Builds a byte array from UUIDv7 field values.
|
|
25
|
+
*
|
|
26
|
+
* @param unixTsMs - A 48-bit `unix_ts_ms` field value.
|
|
27
|
+
* @param randA - A 12-bit `rand_a` field value.
|
|
28
|
+
* @param randBHi - The higher 30 bits of 62-bit `rand_b` field value.
|
|
29
|
+
* @param randBLo - The lower 32 bits of 62-bit `rand_b` field value.
|
|
30
|
+
* @throws RangeError if any field value is out of the specified range.
|
|
31
|
+
*/
|
|
32
|
+
static fromFieldsV7(e, t, n, i) {
|
|
33
|
+
if (!Number.isInteger(e) || !Number.isInteger(t) || !Number.isInteger(n) || !Number.isInteger(i) || e < 0 || t < 0 || n < 0 || i < 0 || e > 281474976710655 || t > 4095 || n > 1073741823 || i > 4294967295)
|
|
34
|
+
throw new RangeError("invalid field value");
|
|
35
|
+
const r = new Uint8Array(16);
|
|
36
|
+
return r[0] = e / 2 ** 40, r[1] = e / 2 ** 32, r[2] = e / 2 ** 24, r[3] = e / 2 ** 16, r[4] = e / 2 ** 8, r[5] = e, r[6] = 112 | t >>> 8, r[7] = t, r[8] = 128 | n >>> 24, r[9] = n >>> 16, r[10] = n >>> 8, r[11] = n, r[12] = i >>> 24, r[13] = i >>> 16, r[14] = i >>> 8, r[15] = i, new o(r);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Builds a byte array from a string representation.
|
|
40
|
+
*
|
|
41
|
+
* This method accepts the following formats:
|
|
42
|
+
*
|
|
43
|
+
* - 32-digit hexadecimal format without hyphens: `0189dcd553117d408db09496a2eef37b`
|
|
44
|
+
* - 8-4-4-4-12 hyphenated format: `0189dcd5-5311-7d40-8db0-9496a2eef37b`
|
|
45
|
+
* - Hyphenated format with surrounding braces: `{0189dcd5-5311-7d40-8db0-9496a2eef37b}`
|
|
46
|
+
* - RFC 9562 URN format: `urn:uuid:0189dcd5-5311-7d40-8db0-9496a2eef37b`
|
|
47
|
+
*
|
|
48
|
+
* Leading and trailing whitespaces represents an error.
|
|
49
|
+
*
|
|
50
|
+
* @throws SyntaxError if the argument could not parse as a valid UUID string.
|
|
51
|
+
*/
|
|
52
|
+
static parse(e) {
|
|
53
|
+
var t, n, i, r;
|
|
54
|
+
let a;
|
|
55
|
+
switch (e.length) {
|
|
56
|
+
case 32:
|
|
57
|
+
a = (t = /^[0-9a-f]{32}$/i.exec(e)) === null || t === void 0 ? void 0 : t[0];
|
|
58
|
+
break;
|
|
59
|
+
case 36:
|
|
60
|
+
a = (n = /^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e)) === null || n === void 0 ? void 0 : n.slice(1, 6).join("");
|
|
61
|
+
break;
|
|
62
|
+
case 38:
|
|
63
|
+
a = (i = /^\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\}$/i.exec(e)) === null || i === void 0 ? void 0 : i.slice(1, 6).join("");
|
|
64
|
+
break;
|
|
65
|
+
case 45:
|
|
66
|
+
a = (r = /^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i.exec(e)) === null || r === void 0 ? void 0 : r.slice(1, 6).join("");
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
if (a) {
|
|
70
|
+
const f = new Uint8Array(16);
|
|
71
|
+
for (let s = 0; s < 16; s += 4) {
|
|
72
|
+
const h = parseInt(a.substring(2 * s, 2 * s + 8), 16);
|
|
73
|
+
f[s + 0] = h >>> 24, f[s + 1] = h >>> 16, f[s + 2] = h >>> 8, f[s + 3] = h;
|
|
74
|
+
}
|
|
75
|
+
return new o(f);
|
|
76
|
+
} else
|
|
77
|
+
throw new SyntaxError("could not parse UUID string");
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* @returns The 8-4-4-4-12 canonical hexadecimal string representation
|
|
81
|
+
* (`0189dcd5-5311-7d40-8db0-9496a2eef37b`).
|
|
82
|
+
*/
|
|
83
|
+
toString() {
|
|
84
|
+
let e = "";
|
|
85
|
+
for (let t = 0; t < this.bytes.length; t++)
|
|
86
|
+
e += c.charAt(this.bytes[t] >>> 4), e += c.charAt(this.bytes[t] & 15), (t === 3 || t === 5 || t === 7 || t === 9) && (e += "-");
|
|
87
|
+
return e;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @returns The 32-digit hexadecimal representation without hyphens
|
|
91
|
+
* (`0189dcd553117d408db09496a2eef37b`).
|
|
92
|
+
*/
|
|
93
|
+
toHex() {
|
|
94
|
+
let e = "";
|
|
95
|
+
for (let t = 0; t < this.bytes.length; t++)
|
|
96
|
+
e += c.charAt(this.bytes[t] >>> 4), e += c.charAt(this.bytes[t] & 15);
|
|
97
|
+
return e;
|
|
98
|
+
}
|
|
99
|
+
/** @returns The 8-4-4-4-12 canonical hexadecimal string representation. */
|
|
100
|
+
toJSON() {
|
|
101
|
+
return this.toString();
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Reports the variant field value of the UUID or, if appropriate, "NIL" or
|
|
105
|
+
* "MAX".
|
|
106
|
+
*
|
|
107
|
+
* For convenience, this method reports "NIL" or "MAX" if `this` represents
|
|
108
|
+
* the Nil or Max UUID, although the Nil and Max UUIDs are technically
|
|
109
|
+
* subsumed under the variants `0b0` and `0b111`, respectively.
|
|
110
|
+
*/
|
|
111
|
+
getVariant() {
|
|
112
|
+
const e = this.bytes[8] >>> 4;
|
|
113
|
+
if (e < 0)
|
|
114
|
+
throw new Error("unreachable");
|
|
115
|
+
if (e <= 7)
|
|
116
|
+
return this.bytes.every((t) => t === 0) ? "NIL" : "VAR_0";
|
|
117
|
+
if (e <= 11)
|
|
118
|
+
return "VAR_10";
|
|
119
|
+
if (e <= 13)
|
|
120
|
+
return "VAR_110";
|
|
121
|
+
if (e <= 15)
|
|
122
|
+
return this.bytes.every((t) => t === 255) ? "MAX" : "VAR_RESERVED";
|
|
123
|
+
throw new Error("unreachable");
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Returns the version field value of the UUID or `undefined` if the UUID does
|
|
127
|
+
* not have the variant field value of `0b10`.
|
|
128
|
+
*/
|
|
129
|
+
getVersion() {
|
|
130
|
+
return this.getVariant() === "VAR_10" ? this.bytes[6] >>> 4 : void 0;
|
|
131
|
+
}
|
|
132
|
+
/** Creates an object from `this`. */
|
|
133
|
+
clone() {
|
|
134
|
+
return new o(this.bytes.slice(0));
|
|
135
|
+
}
|
|
136
|
+
/** Returns true if `this` is equivalent to `other`. */
|
|
137
|
+
equals(e) {
|
|
138
|
+
return this.compareTo(e) === 0;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Returns a negative integer, zero, or positive integer if `this` is less
|
|
142
|
+
* than, equal to, or greater than `other`, respectively.
|
|
143
|
+
*/
|
|
144
|
+
compareTo(e) {
|
|
145
|
+
for (let t = 0; t < 16; t++) {
|
|
146
|
+
const n = this.bytes[t] - e.bytes[t];
|
|
147
|
+
if (n !== 0)
|
|
148
|
+
return Math.sign(n);
|
|
149
|
+
}
|
|
150
|
+
return 0;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
class b {
|
|
154
|
+
/**
|
|
155
|
+
* Creates a generator object with the default random number generator, or
|
|
156
|
+
* with the specified one if passed as an argument. The specified random
|
|
157
|
+
* number generator should be cryptographically strong and securely seeded.
|
|
158
|
+
*/
|
|
159
|
+
constructor(e) {
|
|
160
|
+
this.timestamp_biased = 0, this.counter = 0, this.random = e ?? g();
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Generates a new UUIDv7 object from the current timestamp, or resets the
|
|
164
|
+
* generator upon significant timestamp rollback.
|
|
165
|
+
*
|
|
166
|
+
* This method returns a monotonically increasing UUID by reusing the previous
|
|
167
|
+
* timestamp even if the up-to-date timestamp is smaller than the immediately
|
|
168
|
+
* preceding UUID's. However, when such a clock rollback is considered
|
|
169
|
+
* significant (i.e., by more than ten seconds), this method resets the
|
|
170
|
+
* generator and returns a new UUID based on the given timestamp, breaking the
|
|
171
|
+
* increasing order of UUIDs.
|
|
172
|
+
*
|
|
173
|
+
* See {@link generateOrAbort} for the other mode of generation and
|
|
174
|
+
* {@link generateOrResetCore} for the low-level primitive.
|
|
175
|
+
*/
|
|
176
|
+
generate() {
|
|
177
|
+
return this.generateOrResetCore(Date.now(), 1e4);
|
|
178
|
+
}
|
|
179
|
+
/**
|
|
180
|
+
* Generates a new UUIDv7 object from the current timestamp, or returns
|
|
181
|
+
* `undefined` upon significant timestamp rollback.
|
|
182
|
+
*
|
|
183
|
+
* This method returns a monotonically increasing UUID by reusing the previous
|
|
184
|
+
* timestamp even if the up-to-date timestamp is smaller than the immediately
|
|
185
|
+
* preceding UUID's. However, when such a clock rollback is considered
|
|
186
|
+
* significant (i.e., by more than ten seconds), this method aborts and
|
|
187
|
+
* returns `undefined` immediately.
|
|
188
|
+
*
|
|
189
|
+
* See {@link generate} for the other mode of generation and
|
|
190
|
+
* {@link generateOrAbortCore} for the low-level primitive.
|
|
191
|
+
*/
|
|
192
|
+
generateOrAbort() {
|
|
193
|
+
return this.generateOrAbortCore(Date.now(), 1e4);
|
|
194
|
+
}
|
|
195
|
+
/**
|
|
196
|
+
* Generates a new UUIDv7 object from the `unixTsMs` passed, or resets the
|
|
197
|
+
* generator upon significant timestamp rollback.
|
|
198
|
+
*
|
|
199
|
+
* This method is equivalent to {@link generate} except that it takes a custom
|
|
200
|
+
* timestamp and clock rollback allowance.
|
|
201
|
+
*
|
|
202
|
+
* @param rollbackAllowance - The amount of `unixTsMs` rollback that is
|
|
203
|
+
* considered significant. A suggested value is `10_000` (milliseconds).
|
|
204
|
+
* @throws RangeError if `unixTsMs` is not a 48-bit unsigned integer.
|
|
205
|
+
*/
|
|
206
|
+
generateOrResetCore(e, t) {
|
|
207
|
+
let n = this.generateOrAbortCore(e, t);
|
|
208
|
+
return n === void 0 && (this.timestamp_biased = 0, n = this.generateOrAbortCore(e, t)), n;
|
|
209
|
+
}
|
|
210
|
+
/**
|
|
211
|
+
* Generates a new UUIDv7 object from the `unixTsMs` passed, or returns
|
|
212
|
+
* `undefined` upon significant timestamp rollback.
|
|
213
|
+
*
|
|
214
|
+
* This method is equivalent to {@link generateOrAbort} except that it takes a
|
|
215
|
+
* custom timestamp and clock rollback allowance.
|
|
216
|
+
*
|
|
217
|
+
* @param rollbackAllowance - The amount of `unixTsMs` rollback that is
|
|
218
|
+
* considered significant. A suggested value is `10_000` (milliseconds).
|
|
219
|
+
* @throws RangeError if `unixTsMs` is not a 48-bit unsigned integer.
|
|
220
|
+
*/
|
|
221
|
+
generateOrAbortCore(e, t) {
|
|
222
|
+
if (!Number.isInteger(e) || e < 0 || e > 281474976710655)
|
|
223
|
+
throw new RangeError("`unixTsMs` must be a 48-bit unsigned integer");
|
|
224
|
+
if (t < 0 || t > 281474976710655)
|
|
225
|
+
throw new RangeError("`rollbackAllowance` out of reasonable range");
|
|
226
|
+
if (e++, e > this.timestamp_biased)
|
|
227
|
+
this.timestamp_biased = e, this.resetCounter();
|
|
228
|
+
else if (e + t >= this.timestamp_biased)
|
|
229
|
+
this.counter++, this.counter > 4398046511103 && (this.timestamp_biased++, this.resetCounter());
|
|
230
|
+
else
|
|
231
|
+
return;
|
|
232
|
+
return o.fromFieldsV7(this.timestamp_biased - 1, Math.trunc(this.counter / 2 ** 30), this.counter & 2 ** 30 - 1, this.random.nextUint32());
|
|
233
|
+
}
|
|
234
|
+
/** Initializes the counter at a 42-bit random integer. */
|
|
235
|
+
resetCounter() {
|
|
236
|
+
this.counter = this.random.nextUint32() * 1024 + (this.random.nextUint32() & 1023);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Generates a new UUIDv4 object utilizing the random number generator inside.
|
|
240
|
+
*
|
|
241
|
+
* @internal
|
|
242
|
+
*/
|
|
243
|
+
generateV4() {
|
|
244
|
+
const e = new Uint8Array(Uint32Array.of(this.random.nextUint32(), this.random.nextUint32(), this.random.nextUint32(), this.random.nextUint32()).buffer);
|
|
245
|
+
return e[6] = 64 | e[6] >>> 4, e[8] = 128 | e[8] >>> 2, o.ofInner(e);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
const g = () => {
|
|
249
|
+
if (typeof crypto < "u" && typeof crypto.getRandomValues < "u")
|
|
250
|
+
return new m();
|
|
251
|
+
if (typeof UUIDV7_DENY_WEAK_RNG < "u" && UUIDV7_DENY_WEAK_RNG)
|
|
252
|
+
throw new Error("no cryptographically strong RNG available");
|
|
253
|
+
return {
|
|
254
|
+
nextUint32: () => Math.trunc(Math.random() * 65536) * 65536 + Math.trunc(Math.random() * 65536)
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
class m {
|
|
258
|
+
constructor() {
|
|
259
|
+
this.buffer = new Uint32Array(8), this.cursor = 65535;
|
|
260
|
+
}
|
|
261
|
+
nextUint32() {
|
|
262
|
+
return this.cursor >= this.buffer.length && (crypto.getRandomValues(this.buffer), this.cursor = 0), this.buffer[this.cursor++];
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
let u;
|
|
266
|
+
const y = () => d().toString(), d = () => (u || (u = new b())).generate();
|
|
5
267
|
export {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
268
|
+
R as Platform,
|
|
269
|
+
_ as createEnv,
|
|
270
|
+
v as getAccessToken,
|
|
271
|
+
x as t,
|
|
272
|
+
y as uuidv7
|
|
10
273
|
};
|
|
11
274
|
//# sourceMappingURL=utils.js.map
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;"}
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../node_modules/uuidv7/dist/index.js"],"sourcesContent":["/**\n * uuidv7: A JavaScript implementation of UUID version 7\n *\n * Copyright 2021-2025 LiosK\n *\n * @license Apache-2.0\n * @packageDocumentation\n */\nconst DIGITS = \"0123456789abcdef\";\n/** Represents a UUID as a 16-byte byte array. */\nexport class UUID {\n /** @param bytes - The 16-byte byte array representation. */\n constructor(bytes) {\n this.bytes = bytes;\n }\n /**\n * Creates an object from the internal representation, a 16-byte byte array\n * containing the binary UUID representation in the big-endian byte order.\n *\n * This method does NOT shallow-copy the argument, and thus the created object\n * holds the reference to the underlying buffer.\n *\n * @throws TypeError if the length of the argument is not 16.\n */\n static ofInner(bytes) {\n if (bytes.length !== 16) {\n throw new TypeError(\"not 128-bit length\");\n }\n else {\n return new UUID(bytes);\n }\n }\n /**\n * Builds a byte array from UUIDv7 field values.\n *\n * @param unixTsMs - A 48-bit `unix_ts_ms` field value.\n * @param randA - A 12-bit `rand_a` field value.\n * @param randBHi - The higher 30 bits of 62-bit `rand_b` field value.\n * @param randBLo - The lower 32 bits of 62-bit `rand_b` field value.\n * @throws RangeError if any field value is out of the specified range.\n */\n static fromFieldsV7(unixTsMs, randA, randBHi, randBLo) {\n if (!Number.isInteger(unixTsMs) ||\n !Number.isInteger(randA) ||\n !Number.isInteger(randBHi) ||\n !Number.isInteger(randBLo) ||\n unixTsMs < 0 ||\n randA < 0 ||\n randBHi < 0 ||\n randBLo < 0 ||\n unixTsMs > 281474976710655 ||\n randA > 0xfff ||\n randBHi > 1073741823 ||\n randBLo > 4294967295) {\n throw new RangeError(\"invalid field value\");\n }\n const bytes = new Uint8Array(16);\n bytes[0] = unixTsMs / 2 ** 40;\n bytes[1] = unixTsMs / 2 ** 32;\n bytes[2] = unixTsMs / 2 ** 24;\n bytes[3] = unixTsMs / 2 ** 16;\n bytes[4] = unixTsMs / 2 ** 8;\n bytes[5] = unixTsMs;\n bytes[6] = 0x70 | (randA >>> 8);\n bytes[7] = randA;\n bytes[8] = 0x80 | (randBHi >>> 24);\n bytes[9] = randBHi >>> 16;\n bytes[10] = randBHi >>> 8;\n bytes[11] = randBHi;\n bytes[12] = randBLo >>> 24;\n bytes[13] = randBLo >>> 16;\n bytes[14] = randBLo >>> 8;\n bytes[15] = randBLo;\n return new UUID(bytes);\n }\n /**\n * Builds a byte array from a string representation.\n *\n * This method accepts the following formats:\n *\n * - 32-digit hexadecimal format without hyphens: `0189dcd553117d408db09496a2eef37b`\n * - 8-4-4-4-12 hyphenated format: `0189dcd5-5311-7d40-8db0-9496a2eef37b`\n * - Hyphenated format with surrounding braces: `{0189dcd5-5311-7d40-8db0-9496a2eef37b}`\n * - RFC 9562 URN format: `urn:uuid:0189dcd5-5311-7d40-8db0-9496a2eef37b`\n *\n * Leading and trailing whitespaces represents an error.\n *\n * @throws SyntaxError if the argument could not parse as a valid UUID string.\n */\n static parse(uuid) {\n var _a, _b, _c, _d;\n let hex = undefined;\n switch (uuid.length) {\n case 32:\n hex = (_a = /^[0-9a-f]{32}$/i.exec(uuid)) === null || _a === void 0 ? void 0 : _a[0];\n break;\n case 36:\n hex =\n (_b = /^([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i\n .exec(uuid)) === null || _b === void 0 ? void 0 : _b.slice(1, 6).join(\"\");\n break;\n case 38:\n hex =\n (_c = /^\\{([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})\\}$/i\n .exec(uuid)) === null || _c === void 0 ? void 0 : _c.slice(1, 6).join(\"\");\n break;\n case 45:\n hex =\n (_d = /^urn:uuid:([0-9a-f]{8})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{4})-([0-9a-f]{12})$/i\n .exec(uuid)) === null || _d === void 0 ? void 0 : _d.slice(1, 6).join(\"\");\n break;\n default:\n break;\n }\n if (hex) {\n const inner = new Uint8Array(16);\n for (let i = 0; i < 16; i += 4) {\n const n = parseInt(hex.substring(2 * i, 2 * i + 8), 16);\n inner[i + 0] = n >>> 24;\n inner[i + 1] = n >>> 16;\n inner[i + 2] = n >>> 8;\n inner[i + 3] = n;\n }\n return new UUID(inner);\n }\n else {\n throw new SyntaxError(\"could not parse UUID string\");\n }\n }\n /**\n * @returns The 8-4-4-4-12 canonical hexadecimal string representation\n * (`0189dcd5-5311-7d40-8db0-9496a2eef37b`).\n */\n toString() {\n let text = \"\";\n for (let i = 0; i < this.bytes.length; i++) {\n text += DIGITS.charAt(this.bytes[i] >>> 4);\n text += DIGITS.charAt(this.bytes[i] & 0xf);\n if (i === 3 || i === 5 || i === 7 || i === 9) {\n text += \"-\";\n }\n }\n return text;\n }\n /**\n * @returns The 32-digit hexadecimal representation without hyphens\n * (`0189dcd553117d408db09496a2eef37b`).\n */\n toHex() {\n let text = \"\";\n for (let i = 0; i < this.bytes.length; i++) {\n text += DIGITS.charAt(this.bytes[i] >>> 4);\n text += DIGITS.charAt(this.bytes[i] & 0xf);\n }\n return text;\n }\n /** @returns The 8-4-4-4-12 canonical hexadecimal string representation. */\n toJSON() {\n return this.toString();\n }\n /**\n * Reports the variant field value of the UUID or, if appropriate, \"NIL\" or\n * \"MAX\".\n *\n * For convenience, this method reports \"NIL\" or \"MAX\" if `this` represents\n * the Nil or Max UUID, although the Nil and Max UUIDs are technically\n * subsumed under the variants `0b0` and `0b111`, respectively.\n */\n getVariant() {\n const n = this.bytes[8] >>> 4;\n if (n < 0) {\n throw new Error(\"unreachable\");\n }\n else if (n <= 0b0111) {\n return this.bytes.every((e) => e === 0) ? \"NIL\" : \"VAR_0\";\n }\n else if (n <= 0b1011) {\n return \"VAR_10\";\n }\n else if (n <= 0b1101) {\n return \"VAR_110\";\n }\n else if (n <= 0b1111) {\n return this.bytes.every((e) => e === 0xff) ? \"MAX\" : \"VAR_RESERVED\";\n }\n else {\n throw new Error(\"unreachable\");\n }\n }\n /**\n * Returns the version field value of the UUID or `undefined` if the UUID does\n * not have the variant field value of `0b10`.\n */\n getVersion() {\n return this.getVariant() === \"VAR_10\" ? this.bytes[6] >>> 4 : undefined;\n }\n /** Creates an object from `this`. */\n clone() {\n return new UUID(this.bytes.slice(0));\n }\n /** Returns true if `this` is equivalent to `other`. */\n equals(other) {\n return this.compareTo(other) === 0;\n }\n /**\n * Returns a negative integer, zero, or positive integer if `this` is less\n * than, equal to, or greater than `other`, respectively.\n */\n compareTo(other) {\n for (let i = 0; i < 16; i++) {\n const diff = this.bytes[i] - other.bytes[i];\n if (diff !== 0) {\n return Math.sign(diff);\n }\n }\n return 0;\n }\n}\n/**\n * Encapsulates the monotonic counter state.\n *\n * This class provides APIs to utilize a separate counter state from that of the\n * global generator used by {@link uuidv7} and {@link uuidv7obj}. In addition to\n * the default {@link generate} method, this class has {@link generateOrAbort}\n * that is useful to absolutely guarantee the monotonically increasing order of\n * generated UUIDs. See their respective documentation for details.\n */\nexport class V7Generator {\n /**\n * Creates a generator object with the default random number generator, or\n * with the specified one if passed as an argument. The specified random\n * number generator should be cryptographically strong and securely seeded.\n */\n constructor(randomNumberGenerator) {\n /**\n * Biased by one to distinguish zero (uninitialized) and zero (UNIX epoch).\n */\n this.timestamp_biased = 0;\n this.counter = 0;\n this.random = randomNumberGenerator !== null && randomNumberGenerator !== void 0 ? randomNumberGenerator : getDefaultRandom();\n }\n /**\n * Generates a new UUIDv7 object from the current timestamp, or resets the\n * generator upon significant timestamp rollback.\n *\n * This method returns a monotonically increasing UUID by reusing the previous\n * timestamp even if the up-to-date timestamp is smaller than the immediately\n * preceding UUID's. However, when such a clock rollback is considered\n * significant (i.e., by more than ten seconds), this method resets the\n * generator and returns a new UUID based on the given timestamp, breaking the\n * increasing order of UUIDs.\n *\n * See {@link generateOrAbort} for the other mode of generation and\n * {@link generateOrResetCore} for the low-level primitive.\n */\n generate() {\n return this.generateOrResetCore(Date.now(), 10000);\n }\n /**\n * Generates a new UUIDv7 object from the current timestamp, or returns\n * `undefined` upon significant timestamp rollback.\n *\n * This method returns a monotonically increasing UUID by reusing the previous\n * timestamp even if the up-to-date timestamp is smaller than the immediately\n * preceding UUID's. However, when such a clock rollback is considered\n * significant (i.e., by more than ten seconds), this method aborts and\n * returns `undefined` immediately.\n *\n * See {@link generate} for the other mode of generation and\n * {@link generateOrAbortCore} for the low-level primitive.\n */\n generateOrAbort() {\n return this.generateOrAbortCore(Date.now(), 10000);\n }\n /**\n * Generates a new UUIDv7 object from the `unixTsMs` passed, or resets the\n * generator upon significant timestamp rollback.\n *\n * This method is equivalent to {@link generate} except that it takes a custom\n * timestamp and clock rollback allowance.\n *\n * @param rollbackAllowance - The amount of `unixTsMs` rollback that is\n * considered significant. A suggested value is `10_000` (milliseconds).\n * @throws RangeError if `unixTsMs` is not a 48-bit unsigned integer.\n */\n generateOrResetCore(unixTsMs, rollbackAllowance) {\n let value = this.generateOrAbortCore(unixTsMs, rollbackAllowance);\n if (value === undefined) {\n // reset state and resume\n this.timestamp_biased = 0;\n value = this.generateOrAbortCore(unixTsMs, rollbackAllowance);\n }\n return value;\n }\n /**\n * Generates a new UUIDv7 object from the `unixTsMs` passed, or returns\n * `undefined` upon significant timestamp rollback.\n *\n * This method is equivalent to {@link generateOrAbort} except that it takes a\n * custom timestamp and clock rollback allowance.\n *\n * @param rollbackAllowance - The amount of `unixTsMs` rollback that is\n * considered significant. A suggested value is `10_000` (milliseconds).\n * @throws RangeError if `unixTsMs` is not a 48-bit unsigned integer.\n */\n generateOrAbortCore(unixTsMs, rollbackAllowance) {\n const MAX_COUNTER = 4398046511103;\n if (!Number.isInteger(unixTsMs) ||\n unixTsMs < 0 ||\n unixTsMs > 281474976710655) {\n throw new RangeError(\"`unixTsMs` must be a 48-bit unsigned integer\");\n }\n else if (rollbackAllowance < 0 || rollbackAllowance > 281474976710655) {\n throw new RangeError(\"`rollbackAllowance` out of reasonable range\");\n }\n unixTsMs++;\n if (unixTsMs > this.timestamp_biased) {\n this.timestamp_biased = unixTsMs;\n this.resetCounter();\n }\n else if (unixTsMs + rollbackAllowance >= this.timestamp_biased) {\n // go on with previous timestamp if new one is not much smaller\n this.counter++;\n if (this.counter > MAX_COUNTER) {\n // increment timestamp at counter overflow\n this.timestamp_biased++;\n this.resetCounter();\n }\n }\n else {\n // abort if clock went backwards to unbearable extent\n return undefined;\n }\n return UUID.fromFieldsV7(this.timestamp_biased - 1, Math.trunc(this.counter / 2 ** 30), this.counter & (2 ** 30 - 1), this.random.nextUint32());\n }\n /** Initializes the counter at a 42-bit random integer. */\n resetCounter() {\n this.counter =\n this.random.nextUint32() * 0x400 + (this.random.nextUint32() & 0x3ff);\n }\n /**\n * Generates a new UUIDv4 object utilizing the random number generator inside.\n *\n * @internal\n */\n generateV4() {\n const bytes = new Uint8Array(Uint32Array.of(this.random.nextUint32(), this.random.nextUint32(), this.random.nextUint32(), this.random.nextUint32()).buffer);\n bytes[6] = 0x40 | (bytes[6] >>> 4);\n bytes[8] = 0x80 | (bytes[8] >>> 2);\n return UUID.ofInner(bytes);\n }\n}\n/** Returns the default random number generator available in the environment. */\nconst getDefaultRandom = () => {\n // detect Web Crypto API\n if (typeof crypto !== \"undefined\" &&\n typeof crypto.getRandomValues !== \"undefined\") {\n return new BufferedCryptoRandom();\n }\n else {\n // fall back on Math.random() unless the flag is set to true\n if (typeof UUIDV7_DENY_WEAK_RNG !== \"undefined\" && UUIDV7_DENY_WEAK_RNG) {\n throw new Error(\"no cryptographically strong RNG available\");\n }\n return {\n nextUint32: () => Math.trunc(Math.random() * 65536) * 65536 +\n Math.trunc(Math.random() * 65536),\n };\n }\n};\n/**\n * Wraps `crypto.getRandomValues()` to enable buffering; this uses a small\n * buffer by default to avoid both unbearable throughput decline in some\n * environments and the waste of time and space for unused values.\n */\nclass BufferedCryptoRandom {\n constructor() {\n this.buffer = new Uint32Array(8);\n this.cursor = 0xffff;\n }\n nextUint32() {\n if (this.cursor >= this.buffer.length) {\n crypto.getRandomValues(this.buffer);\n this.cursor = 0;\n }\n return this.buffer[this.cursor++];\n }\n}\nlet defaultGenerator;\n/**\n * Generates a UUIDv7 string.\n *\n * @returns The 8-4-4-4-12 canonical hexadecimal string representation\n * (\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\").\n */\nexport const uuidv7 = () => uuidv7obj().toString();\n/** Generates a UUIDv7 object. */\nexport const uuidv7obj = () => (defaultGenerator || (defaultGenerator = new V7Generator())).generate();\n/**\n * Generates a UUIDv4 string.\n *\n * @returns The 8-4-4-4-12 canonical hexadecimal string representation\n * (\"xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx\").\n */\nexport const uuidv4 = () => uuidv4obj().toString();\n/** Generates a UUIDv4 object. */\nexport const uuidv4obj = () => (defaultGenerator || (defaultGenerator = new V7Generator())).generateV4();\n"],"names":["DIGITS","UUID","bytes","unixTsMs","randA","randBHi","randBLo","uuid","_a","_b","_c","_d","hex","inner","i","n","text","e","other","diff","V7Generator","randomNumberGenerator","getDefaultRandom","rollbackAllowance","value","BufferedCryptoRandom","defaultGenerator","uuidv7","uuidv7obj"],"mappings":";;AAQA,MAAMA,IAAS;AAER,MAAMC,EAAK;AAAA;AAAA,EAEd,YAAYC,GAAO;AACf,SAAK,QAAQA;AAAA,EACjB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAUA,OAAO,QAAQA,GAAO;AA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,UAAU,KAAK,OAAO,WAC3B,OAAO,gBAAgB,KAAK,MAAM,GAClC,KAAK,SAAS,IAEX,KAAK,OAAO,KAAK,QAAQ;AAAA,EACpC;AACJ;AACA,IAAIC;AAOQ,MAACC,IAAS,MAAMC,EAAS,EAAG,SAAQ,GAEnCA,IAAY,OAAOF,MAAqBA,IAAmB,IAAIN,EAAW,IAAK,SAAQ;","x_google_ignoreList":[0]}
|
package/dist/vite.js
CHANGED
|
@@ -1,54 +1,81 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
function
|
|
4
|
-
const
|
|
5
|
-
let
|
|
1
|
+
import s from "node:fs";
|
|
2
|
+
import t from "node:path";
|
|
3
|
+
function v() {
|
|
4
|
+
const d = "virtual:wcz-layout", u = "\0" + d;
|
|
5
|
+
let o, i, n;
|
|
6
6
|
return {
|
|
7
7
|
name: "vite:wcz-layout",
|
|
8
8
|
enforce: "pre",
|
|
9
|
-
configResolved(
|
|
10
|
-
e = n.resolve(
|
|
9
|
+
configResolved(e) {
|
|
10
|
+
o = t.resolve(e.root, "src/locales"), i = t.resolve(e.root, "src/lib/auth/permissions.ts"), n = t.resolve(e.root, "src/lib/auth/scopes.ts");
|
|
11
|
+
},
|
|
12
|
+
configureServer(e) {
|
|
13
|
+
const r = (l) => {
|
|
14
|
+
if (l.includes(o) || l === i || l === n) {
|
|
15
|
+
const c = e.moduleGraph.getModuleById(u);
|
|
16
|
+
c && e.moduleGraph.invalidateModule(c), e.ws.send({
|
|
17
|
+
type: "full-reload",
|
|
18
|
+
path: "*"
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
e.watcher.add([o, i, n]), e.watcher.on("add", r), e.watcher.on("change", r), e.watcher.on("unlink", r);
|
|
11
23
|
},
|
|
12
24
|
config() {
|
|
13
25
|
return {
|
|
14
26
|
optimizeDeps: {
|
|
15
|
-
exclude: [
|
|
27
|
+
exclude: [d]
|
|
16
28
|
},
|
|
17
29
|
ssr: {
|
|
18
30
|
noExternal: ["@mui/*"]
|
|
19
31
|
}
|
|
20
32
|
};
|
|
21
33
|
},
|
|
22
|
-
resolveId(
|
|
23
|
-
return
|
|
34
|
+
resolveId(e) {
|
|
35
|
+
return e === d ? u : null;
|
|
24
36
|
},
|
|
25
|
-
load(
|
|
26
|
-
if (
|
|
27
|
-
|
|
37
|
+
load(e) {
|
|
38
|
+
if (e !== u) return null;
|
|
39
|
+
s.existsSync(o) || s.mkdirSync(o, {
|
|
28
40
|
recursive: !0
|
|
29
41
|
});
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
for (const
|
|
34
|
-
const
|
|
42
|
+
const r = t.join(o, "en.json");
|
|
43
|
+
s.existsSync(r) || s.writeFileSync(r, JSON.stringify({}));
|
|
44
|
+
const l = s.readdirSync(o), c = {};
|
|
45
|
+
for (const m of l.filter((a) => a.endsWith(".json"))) {
|
|
46
|
+
const a = t.basename(m, ".json"), h = t.join(o, m);
|
|
35
47
|
try {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
translation: y
|
|
48
|
+
c[a] = {
|
|
49
|
+
translation: JSON.parse(s.readFileSync(h, "utf-8"))
|
|
39
50
|
};
|
|
40
|
-
} catch
|
|
41
|
-
|
|
51
|
+
} catch {
|
|
52
|
+
c[a] = {
|
|
42
53
|
translation: {}
|
|
43
54
|
};
|
|
44
55
|
}
|
|
45
|
-
this.addWatchFile(
|
|
56
|
+
this.addWatchFile(h);
|
|
46
57
|
}
|
|
47
|
-
|
|
58
|
+
const p = t.dirname(i);
|
|
59
|
+
s.existsSync(p) || s.mkdirSync(p, {
|
|
60
|
+
recursive: !0
|
|
61
|
+
}), s.existsSync(i) || s.writeFileSync(i, `export const permissions = {
|
|
62
|
+
admin: ["wcz-developers"]
|
|
63
|
+
};`), this.addWatchFile(i);
|
|
64
|
+
const f = t.dirname(n);
|
|
65
|
+
s.existsSync(f) || s.mkdirSync(f, {
|
|
66
|
+
recursive: !0
|
|
67
|
+
}), s.existsSync(n) || s.writeFileSync(n, `export const scopes = {
|
|
68
|
+
};`), this.addWatchFile(n);
|
|
69
|
+
const y = i.split(t.sep).join(t.posix.sep), S = n.split(t.sep).join(t.posix.sep);
|
|
70
|
+
return `
|
|
71
|
+
export const resources = ${JSON.stringify(c)};
|
|
72
|
+
export { permissions } from "${y}";
|
|
73
|
+
export { scopes } from "${S}";
|
|
74
|
+
`;
|
|
48
75
|
}
|
|
49
76
|
};
|
|
50
77
|
}
|
|
51
78
|
export {
|
|
52
|
-
|
|
79
|
+
v as viteWczLayout
|
|
53
80
|
};
|
|
54
81
|
//# sourceMappingURL=vite.js.map
|
package/dist/vite.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vite.js","sources":["../src/lib/vite-plugin.ts"],"sourcesContent":["import fs from \"node:fs\";\r\nimport path from \"node:path\";\r\nimport type { Resource } from \"i18next\";\r\nimport type { Plugin } from \"vite\";\r\n\r\nexport function viteWczLayout(): Plugin {\r\n const virtualModuleId = \"virtual:wcz-layout\";\r\n const resolvedVirtualModuleId = \"\\0\" + virtualModuleId;\r\n\r\n let localesPath: string;\r\n\r\n return {\r\n name: \"vite:wcz-layout\",\r\n enforce: \"pre\",\r\n configResolved(resolvedConfig) {\r\n localesPath = path.resolve(resolvedConfig.root, \"src/locales\");\r\n },\r\n
|
|
1
|
+
{"version":3,"file":"vite.js","sources":["../src/lib/vite-plugin.ts"],"sourcesContent":["import fs from \"node:fs\";\r\nimport path from \"node:path\";\r\nimport type { Resource } from \"i18next\";\r\nimport type { Plugin } from \"vite\";\r\n\r\nexport function viteWczLayout(): Plugin {\r\n const virtualModuleId = \"virtual:wcz-layout\";\r\n const resolvedVirtualModuleId = \"\\0\" + virtualModuleId;\r\n\r\n let localesPath: string;\r\n let permissionsPath: string;\r\n let scopesPath: string;\r\n\r\n return {\r\n name: \"vite:wcz-layout\",\r\n enforce: \"pre\",\r\n configResolved(resolvedConfig) {\r\n localesPath = path.resolve(resolvedConfig.root, \"src/locales\");\r\n permissionsPath = path.resolve(resolvedConfig.root, \"src/lib/auth/permissions.ts\");\r\n scopesPath = path.resolve(resolvedConfig.root, \"src/lib/auth/scopes.ts\");\r\n },\r\n configureServer(server) {\r\n const refresh = (filePath: string) => {\r\n if (filePath.includes(localesPath) || filePath === permissionsPath || filePath === scopesPath) {\r\n const module = server.moduleGraph.getModuleById(resolvedVirtualModuleId);\r\n if (module) server.moduleGraph.invalidateModule(module);\r\n server.ws.send({ type: \"full-reload\", path: \"*\" });\r\n }\r\n };\r\n\r\n server.watcher.add([localesPath, permissionsPath, scopesPath]);\r\n server.watcher.on(\"add\", refresh);\r\n server.watcher.on(\"change\", refresh);\r\n server.watcher.on(\"unlink\", refresh);\r\n },\r\n config() {\r\n return {\r\n optimizeDeps: { exclude: [virtualModuleId] },\r\n ssr: { noExternal: [\"@mui/*\"] },\r\n };\r\n },\r\n resolveId(id) {\r\n if (id === virtualModuleId) return resolvedVirtualModuleId;\r\n return null;\r\n },\r\n load(id) {\r\n if (id !== resolvedVirtualModuleId) return null;\r\n\r\n // 1. Locales logic\r\n if (!fs.existsSync(localesPath)) fs.mkdirSync(localesPath, { recursive: true });\r\n const enPath = path.join(localesPath, \"en.json\");\r\n if (!fs.existsSync(enPath)) fs.writeFileSync(enPath, JSON.stringify({}));\r\n\r\n const files = fs.readdirSync(localesPath);\r\n const resources: Resource = {};\r\n for (const file of files.filter((f) => f.endsWith(\".json\"))) {\r\n const lang = path.basename(file, \".json\");\r\n const filePath = path.join(localesPath, file);\r\n try {\r\n resources[lang] = { translation: JSON.parse(fs.readFileSync(filePath, \"utf-8\")) };\r\n } catch {\r\n resources[lang] = { translation: {} };\r\n }\r\n this.addWatchFile(filePath);\r\n }\r\n\r\n // 2. Permissions logic\r\n const permissionsDir = path.dirname(permissionsPath);\r\n if (!fs.existsSync(permissionsDir)) fs.mkdirSync(permissionsDir, { recursive: true });\r\n if (!fs.existsSync(permissionsPath)) {\r\n fs.writeFileSync(permissionsPath, \"export const permissions = {\\n admin: [\\\"wcz-developers\\\"]\\n};\");\r\n }\r\n this.addWatchFile(permissionsPath);\r\n\r\n // 3. Scopes logic\r\n const scopesDir = path.dirname(scopesPath);\r\n if (!fs.existsSync(scopesDir)) fs.mkdirSync(scopesDir, { recursive: true });\r\n if (!fs.existsSync(scopesPath)) {\r\n fs.writeFileSync(scopesPath, \"export const scopes = {\\n};\");\r\n }\r\n this.addWatchFile(scopesPath);\r\n\r\n const normalizedPermissionsPath = permissionsPath.split(path.sep).join(path.posix.sep);\r\n const normalizedScopesPath = scopesPath.split(path.sep).join(path.posix.sep);\r\n return `\r\n export const resources = ${JSON.stringify(resources)};\r\n export { permissions } from \"${normalizedPermissionsPath}\";\r\n export { scopes } from \"${normalizedScopesPath}\";\r\n `;\r\n },\r\n };\r\n}\r\n"],"names":["viteWczLayout","virtualModuleId","resolvedVirtualModuleId","localesPath","permissionsPath","scopesPath","name","enforce","configResolved","resolvedConfig","path","resolve","root","configureServer","server","refresh","filePath","includes","module","moduleGraph","getModuleById","invalidateModule","ws","send","type","watcher","add","on","config","optimizeDeps","exclude","ssr","noExternal","resolveId","id","load","fs","existsSync","mkdirSync","recursive","enPath","join","writeFileSync","JSON","stringify","files","readdirSync","resources","file","filter","f","endsWith","lang","basename","translation","parse","readFileSync","addWatchFile","permissionsDir","dirname","scopesDir","normalizedPermissionsPath","split","sep","posix","normalizedScopesPath"],"mappings":";;AAKO,SAASA,IAAwB;AACpC,QAAMC,IAAkB,sBAClBC,IAA0B,OAAOD;AAEvC,MAAIE,GACAC,GACAC;AAEJ,SAAO;AAAA,IACHC,MAAM;AAAA,IACNC,SAAS;AAAA,IACTC,eAAeC,GAAgB;AAC3BN,MAAAA,IAAcO,EAAKC,QAAQF,EAAeG,MAAM,aAAa,GAC7DR,IAAkBM,EAAKC,QAAQF,EAAeG,MAAM,6BAA6B,GACjFP,IAAaK,EAAKC,QAAQF,EAAeG,MAAM,wBAAwB;AAAA,IAC3E;AAAA,I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}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "wcz-test",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"type": "module",
|
|
@@ -21,18 +21,14 @@
|
|
|
21
21
|
"types": "./dist/models.d.ts",
|
|
22
22
|
"import": "./dist/models.js"
|
|
23
23
|
},
|
|
24
|
-
"./
|
|
25
|
-
"types": "./dist/
|
|
26
|
-
"import": "./dist/
|
|
24
|
+
"./query": {
|
|
25
|
+
"types": "./dist/query.d.ts",
|
|
26
|
+
"import": "./dist/query.js"
|
|
27
27
|
},
|
|
28
28
|
"./utils": {
|
|
29
29
|
"types": "./dist/utils.d.ts",
|
|
30
30
|
"import": "./dist/utils.js"
|
|
31
31
|
},
|
|
32
|
-
"./auth": {
|
|
33
|
-
"types": "./dist/auth.d.ts",
|
|
34
|
-
"import": "./dist/auth.js"
|
|
35
|
-
},
|
|
36
32
|
"./vite": {
|
|
37
33
|
"types": "./dist/vite.d.ts",
|
|
38
34
|
"import": "./dist/vite.js"
|
|
@@ -58,6 +54,8 @@
|
|
|
58
54
|
"react-i18next": "^16.5.0"
|
|
59
55
|
},
|
|
60
56
|
"devDependencies": {
|
|
57
|
+
"@azure/msal-browser": "^4.27.0",
|
|
58
|
+
"@azure/msal-react": "^3.0.23",
|
|
61
59
|
"@tanstack/eslint-config": "^0.3.4",
|
|
62
60
|
"@tanstack/eslint-plugin-query": "^5.91.2",
|
|
63
61
|
"@tanstack/eslint-plugin-router": "^1.141.0",
|
|
@@ -67,8 +65,6 @@
|
|
|
67
65
|
"@types/react-dom": "^19.2.3",
|
|
68
66
|
"@vitejs/plugin-react": "^5.1.2",
|
|
69
67
|
"babel-plugin-react-compiler": "^1.0.0",
|
|
70
|
-
"better-auth": "^1.4.7",
|
|
71
|
-
"drizzle-kit": "^0.31.8",
|
|
72
68
|
"file-saver": "^2.0.5",
|
|
73
69
|
"nitro": "^3.0.1-alpha.1",
|
|
74
70
|
"react-dropzone": "^14.3.8",
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import e from "zod";
|
|
2
|
-
const a = e.enum(["NotAvailable", "FutureApproval", "WaitingForApproval", "Approved", "Rejected", "Skipped", "Withdrawn", "Cancelled"]), t = e.enum(["WaitingForApproval", "Approved", "PartiallyApproved", "Rejected", "Withdrawn", "Cancelled"]);
|
|
3
|
-
export {
|
|
4
|
-
a as A,
|
|
5
|
-
t as a
|
|
6
|
-
};
|
|
7
|
-
//# sourceMappingURL=ApprovalStatus-lESbUD_x.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ApprovalStatus-lESbUD_x.js","sources":["../src/models/approval/ApprovalStepResult.ts","../src/models/approval/ApprovalStatus.ts"],"sourcesContent":["import z from \"zod\";\n\nexport const ApprovalStepResult = z.enum([\n \"NotAvailable\",\n \"FutureApproval\",\n \"WaitingForApproval\",\n \"Approved\",\n \"Rejected\",\n \"Skipped\",\n \"Withdrawn\",\n \"Cancelled\"\n]);","import z from \"zod\";\n\nexport const ApprovalStatus = z.enum([\n \"WaitingForApproval\",\n \"Approved\",\n \"PartiallyApproved\",\n \"Rejected\",\n \"Withdrawn\",\n \"Cancelled\"\n]);"],"names":["ApprovalStepResult","z","enum","ApprovalStatus"],"mappings":";AAEO,MAAMA,IAAqBC,EAAEC,KAAK,CACrC,gBACA,kBACA,sBACA,YACA,YACA,WACA,aACA,WAAW,CACd,GCTYC,IAAiBF,EAAEC,KAAK,CACjC,sBACA,YACA,qBACA,YACA,aACA,WAAW,CACd;"}
|