@go-labs-sg/event-tech 0.12.0 → 1.1.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/README.md +71 -0
- package/dist/index.js +296 -167
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -93,10 +93,22 @@ et event appearance update --event-id <id> --appearance-version <n> --appearance
|
|
|
93
93
|
et event appearance reset --event-id <id> --appearance-version <n>
|
|
94
94
|
et event appearance upload --event-id <id> --file ./background.mp4 --media-type video --content-type video/mp4
|
|
95
95
|
et event photo-wall display-items --event-id <id> --limit 30
|
|
96
|
+
et lucky-draw participants replace --event-id <id> --participants '[{"luckyDrawId":"illustrative-001","name":"Example Person","email":"example@example.test"}]' --allow-state-change --target <id>
|
|
97
|
+
et lucky-draw participants list --event-id <id> --page 1 --per-page 100
|
|
96
98
|
```
|
|
97
99
|
|
|
98
100
|
Commands emit deterministic JSON envelopes. Authentication credentials are never included in successful output, and bearer credentials are redacted from errors.
|
|
99
101
|
|
|
102
|
+
### Deprecated event types
|
|
103
|
+
|
|
104
|
+
Scavenger Hunt (Amazing Race) and Gardens by the Bay are deprecated and frozen.
|
|
105
|
+
Existing `event list`, `event get` and appearance commands retain their contracts
|
|
106
|
+
and can still return historical `SCAVENGER_HUNT` / `GARDENS_BY_THE_BAY` values.
|
|
107
|
+
The CLI has no event-create, duplicate, type-change or scavenger-specific commands;
|
|
108
|
+
no replacement commands or scavenger read-shape parity will be added. The server
|
|
109
|
+
blocks new creation, duplication and changes into these types, including requests
|
|
110
|
+
from older/custom clients. See the [retirement policy](../../../docs/agents/event-tech-deprecated-scavenger.md).
|
|
111
|
+
|
|
100
112
|
### Event appearance and Photo Wall display
|
|
101
113
|
|
|
102
114
|
`event appearance get` returns the canonical appearance, its optimistic-lock
|
|
@@ -167,6 +179,65 @@ bun run packages/event-tech/cli/src/index.ts help
|
|
|
167
179
|
|
|
168
180
|
Building is not publication or permission to mutate live data. Use focused temporary business-behavior tests and the final pre-push gate from the shared workflow. Use this package's actual scripts; do not assume it has a command-artifact generator.
|
|
169
181
|
|
|
182
|
+
## Lucky draw participant source import
|
|
183
|
+
|
|
184
|
+
The participant import is an API-first rollout: use a deployment that includes
|
|
185
|
+
the replacement/readback API. It replaces the source-imported roster; it does
|
|
186
|
+
not append rows and does not evaluate eligibility, produce results, or discover
|
|
187
|
+
a draw. `pre-draw` commits winners, so do not use it for discovery.
|
|
188
|
+
|
|
189
|
+
Supply one JSON array either inline or from a file (the file form avoids roster
|
|
190
|
+
values in shell history). The identities in this example are illustrative only:
|
|
191
|
+
|
|
192
|
+
```sh
|
|
193
|
+
et lucky-draw participants replace \
|
|
194
|
+
--event-id event-123 \
|
|
195
|
+
--participants-file ./illustrative-participants.json \
|
|
196
|
+
--allow-state-change \
|
|
197
|
+
--target event-123
|
|
198
|
+
```
|
|
199
|
+
|
|
200
|
+
```json
|
|
201
|
+
[
|
|
202
|
+
{
|
|
203
|
+
"luckyDrawId": "illustrative-001",
|
|
204
|
+
"name": "Example Person",
|
|
205
|
+
"email": "example@example.test"
|
|
206
|
+
}
|
|
207
|
+
]
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
`--allow-state-change` must be a bare, explicit acknowledgement, and `--target`
|
|
211
|
+
must exactly match `--event-id`; the CLI rejects either guard before accessing
|
|
212
|
+
native credentials or calling the API. The CLI does not trim or normalize IDs;
|
|
213
|
+
the API validates the roster: it must contain 1–20,000 participants, and
|
|
214
|
+
source IDs must be nonblank and unique as exact strings. The API also enforces name/email limits
|
|
215
|
+
and applies the replacement in one transaction.
|
|
216
|
+
|
|
217
|
+
The authenticated caller needs `event.setup`. The successful replacement
|
|
218
|
+
envelope preserves the API's additive readback:
|
|
219
|
+
`participants { id, luckyDrawId, name, email, luckyDrawPrizeId }`, plus a
|
|
220
|
+
`summary { added, updated, removed, unchanged, total, replay }` and a matching
|
|
221
|
+
human-readable `message`. Repeating an
|
|
222
|
+
unchanged import changes no participant rows and preserves participant row IDs
|
|
223
|
+
(it records one `lucky_draw_participants_replayed` activity-log entry). If any prize is
|
|
224
|
+
already assigned, including one held by a passport-linked or archived
|
|
225
|
+
participant, only the identical current imported roster is accepted.
|
|
226
|
+
Archived and passport-linked identity collisions conflict. This does not claim
|
|
227
|
+
that historical draws are frozen: existing unassign corrections remain
|
|
228
|
+
unchanged.
|
|
229
|
+
|
|
230
|
+
List the roster with the API's paginated readback:
|
|
231
|
+
|
|
232
|
+
```sh
|
|
233
|
+
et lucky-draw participants list --event-id event-123 --page 1 --per-page 100
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
`page` defaults to 1 and `per-page` defaults to 100 (range 1–100). Inspect all
|
|
237
|
+
pages: the response preserves `participants`, `pageCount`, and `totalCount`.
|
|
238
|
+
Listing can include passport-linked people outside the imported roster. It does
|
|
239
|
+
not create a draw, mutate it, or perform a pre-draw probe.
|
|
240
|
+
|
|
170
241
|
## Lucky draw pre-draw
|
|
171
242
|
|
|
172
243
|
```sh
|
package/dist/index.js
CHANGED
|
@@ -35,31 +35,31 @@ var __toESM = (mod, isNodeMode, target) => {
|
|
|
35
35
|
var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
|
|
36
36
|
var __require = import.meta.require;
|
|
37
37
|
|
|
38
|
-
// ../../../node_modules/.bun/dotenv@18.0.
|
|
38
|
+
// ../../../node_modules/.bun/dotenv@18.0.8/node_modules/dotenv/dist/index.cjs
|
|
39
39
|
var require_dist = __commonJS(function(exports, module) {
|
|
40
|
-
var
|
|
40
|
+
var j = (e, n) => () => {
|
|
41
41
|
try {
|
|
42
|
-
return
|
|
42
|
+
return n || e((n = { exports: {} }).exports, n), n.exports;
|
|
43
43
|
} catch (t) {
|
|
44
|
-
throw
|
|
44
|
+
throw n = 0, t;
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
|
-
var
|
|
47
|
+
var k = j((xe, U) => {
|
|
48
48
|
function G(e) {
|
|
49
49
|
return typeof e == "string" ? !["false", "0", "no", "off", ""].includes(e.toLowerCase()) : !!e;
|
|
50
50
|
}
|
|
51
|
-
function
|
|
52
|
-
let
|
|
51
|
+
function Y(e = process.env) {
|
|
52
|
+
let n = {};
|
|
53
53
|
for (let t of ["ENCODING", "PATH", "QUIET", "DEBUG", "OVERRIDE", "FAST"]) {
|
|
54
|
-
let
|
|
55
|
-
|
|
54
|
+
let o = e[`DOTENV_${t}`] != null ? e[`DOTENV_${t}`] : e[`DOTENV_CONFIG_${t}`];
|
|
55
|
+
o != null && (n[t.toLowerCase()] = t === "ENCODING" || t === "PATH" ? o : G(o));
|
|
56
56
|
}
|
|
57
|
-
return
|
|
57
|
+
return n;
|
|
58
58
|
}
|
|
59
|
-
U.exports = { parseBoolean: G, optionsFromEnv:
|
|
59
|
+
U.exports = { parseBoolean: G, optionsFromEnv: Y };
|
|
60
60
|
});
|
|
61
|
-
var N =
|
|
62
|
-
var
|
|
61
|
+
var N = j((ye, x) => {
|
|
62
|
+
var z = __require("fs"), I = __require("path"), Z = __require("os"), { URL: ee, fileURLToPath: te } = __require("url"), { parseBoolean: $, optionsFromEnv: B } = k(), re = /(?:^|^)\s*(?:export\s+)?([\w.-]+)(?:\s*=\s*?|:\s+?)(\s*'(?:\\'|[^'])*'|\s*"(?:\\"|[^"])*"|\s*`(?:\\`|[^`])*`|[^#\r\n]+)?\s*(?:#.*)?(?:$|$)/mg, b = new Uint8Array(256);
|
|
63
63
|
for (let e = 48;e <= 57; e++)
|
|
64
64
|
b[e] = 1;
|
|
65
65
|
for (let e = 65;e <= 90; e++)
|
|
@@ -69,92 +69,92 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
69
69
|
b[45] = 1;
|
|
70
70
|
b[46] = 1;
|
|
71
71
|
b[95] = 1;
|
|
72
|
-
function
|
|
73
|
-
let
|
|
72
|
+
function ne(e) {
|
|
73
|
+
let n = {}, t = e.toString();
|
|
74
74
|
t = t.replace(/\r\n?/mg, `
|
|
75
75
|
`);
|
|
76
|
-
let
|
|
77
|
-
for (;(
|
|
78
|
-
let r =
|
|
76
|
+
let o;
|
|
77
|
+
for (;(o = re.exec(t)) != null; ) {
|
|
78
|
+
let r = o[1], s = o[2] || "";
|
|
79
79
|
s = s.trim();
|
|
80
80
|
let i = s[0];
|
|
81
81
|
s = s.replace(/^(['"`])([\s\S]*)\1$/mg, "$2"), i === '"' && (s = s.replace(/\\n/g, `
|
|
82
|
-
`), s = s.replace(/\\r/g, "\r")),
|
|
82
|
+
`), s = s.replace(/\\r/g, "\r")), n[r] = s;
|
|
83
83
|
}
|
|
84
|
-
return
|
|
84
|
+
return n;
|
|
85
85
|
}
|
|
86
86
|
function w(e) {
|
|
87
87
|
return e <= 32 ? e === 32 || e >= 9 && e <= 13 : e >= 160 && (e === 160 || e === 5760 || e >= 8192 && e <= 8202 || e === 8232 || e === 8233 || e === 8239 || e === 8287 || e === 12288 || e === 65279);
|
|
88
88
|
}
|
|
89
|
-
function
|
|
89
|
+
function q(e) {
|
|
90
90
|
return e === 10 || e === 8232 || e === 8233;
|
|
91
91
|
}
|
|
92
92
|
function oe(e) {
|
|
93
|
-
let
|
|
93
|
+
let n = {}, t = typeof e == "string" ? e : e.toString();
|
|
94
94
|
t.indexOf("\r") !== -1 && (t = t.replace(/\r\n?/g, `
|
|
95
95
|
`));
|
|
96
|
-
let
|
|
97
|
-
for (;r <
|
|
96
|
+
let o = t.length, r = 0;
|
|
97
|
+
for (;r < o; ) {
|
|
98
98
|
let s = t.charCodeAt(r);
|
|
99
|
-
for (;r <
|
|
99
|
+
for (;r < o && w(s); )
|
|
100
100
|
r++, s = t.charCodeAt(r);
|
|
101
|
-
if (r >=
|
|
101
|
+
if (r >= o)
|
|
102
102
|
break;
|
|
103
103
|
if (s === 35) {
|
|
104
|
-
for (;r <
|
|
104
|
+
for (;r < o && !q(t.charCodeAt(r)); )
|
|
105
105
|
r++;
|
|
106
106
|
continue;
|
|
107
107
|
}
|
|
108
108
|
let i = -1;
|
|
109
|
-
if (s === 101 && r + 6 <
|
|
109
|
+
if (s === 101 && r + 6 < o && t.charCodeAt(r + 1) === 120 && t.charCodeAt(r + 2) === 112 && t.charCodeAt(r + 3) === 111 && t.charCodeAt(r + 4) === 114 && t.charCodeAt(r + 5) === 116) {
|
|
110
110
|
let v = t.charCodeAt(r + 6);
|
|
111
111
|
if (w(v)) {
|
|
112
112
|
let u = r + 7;
|
|
113
|
-
for (;u <
|
|
113
|
+
for (;u < o && w(t.charCodeAt(u)); )
|
|
114
114
|
u++;
|
|
115
115
|
b[t.charCodeAt(u)] && (i = r + 6, r = u);
|
|
116
116
|
} else
|
|
117
117
|
s = t.charCodeAt(r);
|
|
118
118
|
}
|
|
119
119
|
let l = r, d = 0;
|
|
120
|
-
for (;r <
|
|
120
|
+
for (;r < o && (d = t.charCodeAt(r), b[d]); )
|
|
121
121
|
r++;
|
|
122
122
|
if (r === l) {
|
|
123
|
-
for (;r <
|
|
123
|
+
for (;r < o && !q(t.charCodeAt(r)); )
|
|
124
124
|
r++;
|
|
125
125
|
continue;
|
|
126
126
|
}
|
|
127
|
-
let
|
|
128
|
-
if (r >=
|
|
127
|
+
let h = t.slice(l, r), f = r;
|
|
128
|
+
if (r >= o && (d = 0), w(d))
|
|
129
129
|
do
|
|
130
|
-
r++, d = r <
|
|
130
|
+
r++, d = r < o ? t.charCodeAt(r) : 0;
|
|
131
131
|
while (w(d));
|
|
132
132
|
if (d === 61)
|
|
133
133
|
r++;
|
|
134
|
-
else if (d === 58 && r === f && r + 1 <
|
|
134
|
+
else if (d === 58 && r === f && r + 1 < o && w(t.charCodeAt(r + 1)))
|
|
135
135
|
r += 2;
|
|
136
136
|
else {
|
|
137
|
-
for (r = i === -1 ? f : i;r <
|
|
137
|
+
for (r = i === -1 ? f : i;r < o && !q(t.charCodeAt(r)); )
|
|
138
138
|
r++;
|
|
139
139
|
continue;
|
|
140
140
|
}
|
|
141
141
|
let c = r, a = r;
|
|
142
|
-
for (;a <
|
|
142
|
+
for (;a < o && w(t.charCodeAt(a)); )
|
|
143
143
|
a++;
|
|
144
|
-
let g = t.charCodeAt(a),
|
|
144
|
+
let g = t.charCodeAt(a), p, y = false;
|
|
145
145
|
if (g === 39 || g === 34 || g === 96) {
|
|
146
146
|
let v = t[a], u = t.indexOf(v, a + 1), m = -1, C = -1;
|
|
147
147
|
for (;u !== -1; ) {
|
|
148
|
-
let
|
|
149
|
-
for (;E <
|
|
148
|
+
let O = t.charCodeAt(u - 1) === 92, E = u + 1;
|
|
149
|
+
for (;E < o && !q(t.charCodeAt(E)) && w(t.charCodeAt(E)); )
|
|
150
150
|
E++;
|
|
151
|
-
if ((E ===
|
|
151
|
+
if ((E === o || q(t.charCodeAt(E)) || t.charCodeAt(E) === 35) && (m = u, C = E), !O)
|
|
152
152
|
break;
|
|
153
153
|
u = t.indexOf(v, u + 1);
|
|
154
154
|
}
|
|
155
155
|
if (m !== -1) {
|
|
156
|
-
if (
|
|
157
|
-
for (;r <
|
|
156
|
+
if (p = t.slice(a + 1, m), r = C, t.charCodeAt(r) === 35)
|
|
157
|
+
for (;r < o && !q(t.charCodeAt(r)); )
|
|
158
158
|
r++;
|
|
159
159
|
y = true;
|
|
160
160
|
}
|
|
@@ -162,9 +162,9 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
162
162
|
if (!y) {
|
|
163
163
|
let v = t.indexOf(`
|
|
164
164
|
`, c);
|
|
165
|
-
v === -1 && (v =
|
|
165
|
+
v === -1 && (v = o);
|
|
166
166
|
let u;
|
|
167
|
-
if (
|
|
167
|
+
if (o < 4096)
|
|
168
168
|
u = t.indexOf("#", c), (u === -1 || u > v) && (u = v);
|
|
169
169
|
else
|
|
170
170
|
for (u = c;u < v && t.charCodeAt(u) !== 35; )
|
|
@@ -174,38 +174,41 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
174
174
|
m++;
|
|
175
175
|
for (;C > m && w(t.charCodeAt(C - 1)); )
|
|
176
176
|
C--;
|
|
177
|
-
let
|
|
178
|
-
if (C - m >= 2 && (
|
|
179
|
-
for (;r <
|
|
177
|
+
let O = t.charCodeAt(m);
|
|
178
|
+
if (p = t.slice(m, C), p.includes("\u2028") || p.includes("\u2029") ? p = p.replace(/^(['"`])([\s\S]*)\1$/mg, "$2") : C - m >= 2 && (O === 39 || O === 34 || O === 96) && t.charCodeAt(C - 1) === O && (p = t.slice(m + 1, C - 1)), r = u, u < v)
|
|
179
|
+
for (;r < o && !q(t.charCodeAt(r)); )
|
|
180
180
|
r++;
|
|
181
181
|
}
|
|
182
|
-
g === 34 && (y || a < r) &&
|
|
183
|
-
`).replace(/\\r/g, "\r")),
|
|
182
|
+
g === 34 && (y || a < r) && p.indexOf("\\") !== -1 && (p = p.replace(/\\n/g, `
|
|
183
|
+
`).replace(/\\r/g, "\r")), n[h] = p;
|
|
184
184
|
}
|
|
185
|
-
return
|
|
185
|
+
return n;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
return
|
|
187
|
+
function se(e, n) {
|
|
188
|
+
return n && $(n.fast) ? oe(e) : ne(e);
|
|
189
189
|
}
|
|
190
190
|
function T(e) {
|
|
191
191
|
console.log(`\u2506 ${e}`);
|
|
192
192
|
}
|
|
193
|
-
function
|
|
193
|
+
function ie(e) {
|
|
194
194
|
console.error(`\u25C7 ${e}`);
|
|
195
195
|
}
|
|
196
196
|
function V(e) {
|
|
197
|
-
return e[0] === "~" ?
|
|
197
|
+
return e[0] === "~" ? I.join(Z.homedir(), e.slice(1)) : e;
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
|
|
199
|
+
function ce(e = {}) {
|
|
200
|
+
let n = { ...e };
|
|
201
|
+
for (let t of Object.keys(n))
|
|
202
|
+
n[t] === undefined && delete n[t];
|
|
203
|
+
return { ...B(), ...n };
|
|
201
204
|
}
|
|
202
|
-
function
|
|
203
|
-
e =
|
|
204
|
-
let
|
|
205
|
-
e && e.processEnv != null && (
|
|
205
|
+
function ae(e) {
|
|
206
|
+
e = ce(e);
|
|
207
|
+
let n = I.resolve(process.cwd(), ".env"), t = "utf8", o = process.env;
|
|
208
|
+
e && e.processEnv != null && (o = e.processEnv);
|
|
206
209
|
let r = $(e && e.debug);
|
|
207
210
|
e && e.encoding ? t = e.encoding : r && T("no encoding is specified (UTF-8 is used by default)");
|
|
208
|
-
let s = [
|
|
211
|
+
let s = [n];
|
|
209
212
|
if (e && e.path)
|
|
210
213
|
if (!Array.isArray(e.path))
|
|
211
214
|
s = [V(e.path)];
|
|
@@ -217,116 +220,116 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
217
220
|
let i, l = {}, d = { fast: e.fast };
|
|
218
221
|
for (let c of s)
|
|
219
222
|
try {
|
|
220
|
-
let a = A.parse(
|
|
223
|
+
let a = A.parse(z.readFileSync(c, { encoding: t }), d);
|
|
221
224
|
A.populate(l, a, e);
|
|
222
225
|
} catch (a) {
|
|
223
226
|
r && T(`failed to load ${c} ${a.message}`), i = a;
|
|
224
227
|
}
|
|
225
|
-
let
|
|
228
|
+
let h = A.populate(o, l, e), f = $(Object.prototype.hasOwnProperty.call(e, "quiet") ? e.quiet : B(o).quiet);
|
|
226
229
|
if (r || !f) {
|
|
227
|
-
let c = Object.keys(
|
|
230
|
+
let c = Object.keys(h).length, a = [];
|
|
228
231
|
for (let g of s)
|
|
229
232
|
try {
|
|
230
|
-
let
|
|
231
|
-
a.push(
|
|
232
|
-
} catch (
|
|
233
|
-
r && T(`failed to load ${g} ${
|
|
233
|
+
let p = I.relative(process.cwd(), g instanceof ee ? te(g) : g);
|
|
234
|
+
a.push(p);
|
|
235
|
+
} catch (p) {
|
|
236
|
+
r && T(`failed to load ${g} ${p.message}`), i = p;
|
|
234
237
|
}
|
|
235
|
-
|
|
238
|
+
ie(`injected env (${c}) from ${a.join(",")}`);
|
|
236
239
|
}
|
|
237
240
|
return i ? { parsed: l, error: i } : { parsed: l };
|
|
238
241
|
}
|
|
239
|
-
function
|
|
242
|
+
function le(e) {
|
|
240
243
|
return A.configDotenv(e);
|
|
241
244
|
}
|
|
242
|
-
function
|
|
243
|
-
let
|
|
244
|
-
if (e === null || typeof e != "object" ||
|
|
245
|
+
function fe(e, n, t = {}) {
|
|
246
|
+
let o = $(t && t.debug), r = $(t && t.override), s = {};
|
|
247
|
+
if (e === null || typeof e != "object" || n === null || typeof n != "object") {
|
|
245
248
|
let i = new Error("OBJECT_REQUIRED: Please check the processEnv argument being passed to populate");
|
|
246
249
|
throw i.code = "OBJECT_REQUIRED", i;
|
|
247
250
|
}
|
|
248
|
-
for (let i of Object.keys(
|
|
249
|
-
Object.prototype.hasOwnProperty.call(e, i) ? (r === true && (e[i] =
|
|
251
|
+
for (let i of Object.keys(n))
|
|
252
|
+
Object.prototype.hasOwnProperty.call(e, i) ? (r === true && (e[i] = n[i], s[i] = n[i]), o && T(r === true ? `"${i}" is already defined and WAS overwritten` : `"${i}" is already defined and was NOT overwritten`)) : (e[i] = n[i], s[i] = n[i]);
|
|
250
253
|
return s;
|
|
251
254
|
}
|
|
252
|
-
var A = { configDotenv:
|
|
255
|
+
var A = { configDotenv: ae, config: le, parse: se, populate: fe };
|
|
253
256
|
x.exports.configDotenv = A.configDotenv;
|
|
254
257
|
x.exports.config = A.config;
|
|
255
258
|
x.exports.parse = A.parse;
|
|
256
259
|
x.exports.populate = A.populate;
|
|
257
260
|
x.exports = A;
|
|
258
261
|
});
|
|
259
|
-
var M =
|
|
260
|
-
var _ = __require("child_process"),
|
|
261
|
-
function
|
|
262
|
-
let
|
|
263
|
-
for (let
|
|
264
|
-
if (
|
|
262
|
+
var M = j((Te, W) => {
|
|
263
|
+
var _ = __require("child_process"), ue = __require("fs"), L = __require("path");
|
|
264
|
+
function de(e) {
|
|
265
|
+
let n = ['"'], t = 0;
|
|
266
|
+
for (let o of e) {
|
|
267
|
+
if (o === "\\") {
|
|
265
268
|
t++;
|
|
266
269
|
continue;
|
|
267
270
|
}
|
|
268
|
-
|
|
271
|
+
o === '"' ? n.push("\\".repeat(t * 2 + 1), '"') : n.push("\\".repeat(t), o), t = 0;
|
|
269
272
|
}
|
|
270
|
-
return
|
|
273
|
+
return n.push("\\".repeat(t * 2), '"'), n.join("");
|
|
271
274
|
}
|
|
272
|
-
function H(e,
|
|
273
|
-
for (let t = 0;t <
|
|
274
|
-
let
|
|
275
|
+
function H(e, n = 1) {
|
|
276
|
+
for (let t = 0;t < n; t++) {
|
|
277
|
+
let o = [];
|
|
275
278
|
for (let r of e) {
|
|
276
279
|
let s = r.charCodeAt(0), i = s >= 48 && s <= 57 || s >= 65 && s <= 90 || s >= 97 && s <= 122, l = "\\/:._-".includes(r);
|
|
277
|
-
!i && !l && s < 128 &&
|
|
280
|
+
!i && !l && s < 128 && o.push("^"), o.push(r);
|
|
278
281
|
}
|
|
279
|
-
e =
|
|
282
|
+
e = o.join("");
|
|
280
283
|
}
|
|
281
284
|
return e;
|
|
282
285
|
}
|
|
283
|
-
function P(e,
|
|
284
|
-
let t = Object.keys(e).reverse().find((
|
|
286
|
+
function P(e, n) {
|
|
287
|
+
let t = Object.keys(e).reverse().find((o) => o.toUpperCase() === n);
|
|
285
288
|
return t === undefined ? undefined : e[t];
|
|
286
289
|
}
|
|
287
|
-
function
|
|
288
|
-
let
|
|
290
|
+
function pe(e, n, t) {
|
|
291
|
+
let o = (P(n, "PATHEXT") || ".COM;.EXE;.BAT;.CMD").split(";").filter(Boolean), s = o.some((l) => e.toLowerCase().endsWith(l.toLowerCase())) ? ["", ...o] : [...o, ""], i = /[\\/]/.test(e) ? [t] : [t, ...(P(n, "PATH") || "").split(";")];
|
|
289
292
|
for (let l of i)
|
|
290
293
|
for (let d of s) {
|
|
291
|
-
let
|
|
294
|
+
let h = L.resolve(t, l.replace(/^"|"$/g, ""), e + d);
|
|
292
295
|
try {
|
|
293
|
-
if (
|
|
294
|
-
return
|
|
296
|
+
if (ue.statSync(h).isFile())
|
|
297
|
+
return h;
|
|
295
298
|
} catch {}
|
|
296
299
|
}
|
|
297
300
|
}
|
|
298
|
-
function
|
|
301
|
+
function he(e, n, t) {
|
|
299
302
|
if (process.platform !== "win32")
|
|
300
|
-
return _.spawn(e,
|
|
301
|
-
let
|
|
303
|
+
return _.spawn(e, n, t);
|
|
304
|
+
let o = t.env || process.env, r = pe(e, o, t.cwd || process.cwd());
|
|
302
305
|
if (r && /\.(?:exe|com)$/i.test(r))
|
|
303
|
-
return _.spawn(r,
|
|
306
|
+
return _.spawn(r, n, t);
|
|
304
307
|
let s = /\.(?:bat|cmd)$/i.test(r || e), i = [H(L.normalize(r || e))];
|
|
305
|
-
for (let d of
|
|
306
|
-
i.push(H(
|
|
308
|
+
for (let d of n)
|
|
309
|
+
i.push(H(de(d), s ? 2 : 1));
|
|
307
310
|
let l = i.join(" ");
|
|
308
|
-
return _.spawn(P(
|
|
311
|
+
return _.spawn(P(o, "COMSPEC") || "cmd.exe", ["/d", "/v:off", "/s", "/c", `"${l}"`], { ...t, windowsVerbatimArguments: true });
|
|
309
312
|
}
|
|
310
|
-
W.exports =
|
|
313
|
+
W.exports = he;
|
|
311
314
|
});
|
|
312
|
-
var
|
|
313
|
-
var
|
|
315
|
+
var X = j(($e, F) => {
|
|
316
|
+
var ge = __require("fs"), me = __require("os"), Q = __require("path"), ve = __require("child_process"), Ce = M(), R = N(), { optionsFromEnv: J } = k();
|
|
314
317
|
function D() {
|
|
315
318
|
console.log(["Usage: dotenv run [--help] [-q|--quiet] [--debug] [--override] [--fast] [-f|--file <paths>] [--] <command> [args...]", "", "Run a command with environment variables from a .env file.", "Place dotenv options before the command; all following arguments go to the command.", "", "Options:", " -f, --file <paths> .env paths, comma-separated or repeated (default: .env)", " -q, --quiet suppress the injected env message", " --debug enable debug logging", " --override override existing environment variables", " --fast use the faster character-scanner parser", "", "Environment variables (DOTENV_CONFIG_* names remain as fallbacks):", " DOTENV_PATH, DOTENV_ENCODING, DOTENV_QUIET,", " DOTENV_DEBUG, DOTENV_OVERRIDE,", " DOTENV_FAST"].join(`
|
|
316
319
|
`));
|
|
317
320
|
}
|
|
318
321
|
function we(e) {
|
|
319
|
-
let
|
|
320
|
-
for (let
|
|
321
|
-
let f = e[
|
|
322
|
+
let n = [], t = false, o, r, s, i, l = -1;
|
|
323
|
+
for (let h = 0;h < e.length; h++) {
|
|
324
|
+
let f = e[h];
|
|
322
325
|
if (f === "--") {
|
|
323
|
-
l =
|
|
326
|
+
l = h + 1;
|
|
324
327
|
break;
|
|
325
328
|
}
|
|
326
329
|
if (f === "--help" || f === "-h")
|
|
327
330
|
return { help: true };
|
|
328
331
|
if (f === "--quiet" || f === "-q") {
|
|
329
|
-
|
|
332
|
+
o = true;
|
|
330
333
|
continue;
|
|
331
334
|
}
|
|
332
335
|
if (f === "--debug") {
|
|
@@ -342,51 +345,51 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
342
345
|
continue;
|
|
343
346
|
}
|
|
344
347
|
if (f === "-f" || f === "--file" || f.startsWith("-f=") || f.startsWith("--file=")) {
|
|
345
|
-
let c = f.indexOf("="), a = c === -1 ? f : f.slice(0, c), g = c === -1 ? e[++
|
|
348
|
+
let c = f.indexOf("="), a = c === -1 ? f : f.slice(0, c), g = c === -1 ? e[++h] : f.slice(c + 1);
|
|
346
349
|
if (!g || g === "--")
|
|
347
350
|
return { error: `${a} requires a path` };
|
|
348
|
-
let
|
|
349
|
-
if (
|
|
351
|
+
let p = g.split(",").map((y) => y.trim()).filter(Boolean);
|
|
352
|
+
if (p.length === 0)
|
|
350
353
|
return { error: `${a} requires a path` };
|
|
351
|
-
|
|
354
|
+
n.push(...p), t = true;
|
|
352
355
|
continue;
|
|
353
356
|
}
|
|
354
357
|
if (f.startsWith("-"))
|
|
355
358
|
return { error: `unknown option: ${f}` };
|
|
356
|
-
l =
|
|
359
|
+
l = h;
|
|
357
360
|
break;
|
|
358
361
|
}
|
|
359
362
|
let d = l === -1 ? [] : e.slice(l);
|
|
360
|
-
return { paths:
|
|
363
|
+
return { paths: n, pathSet: t, quiet: o, debug: r, override: s, fast: i, command: d };
|
|
361
364
|
}
|
|
362
365
|
function Ae(e) {
|
|
363
|
-
return e[0] === "~" ? Q.join(
|
|
366
|
+
return e[0] === "~" ? Q.join(me.homedir(), e.slice(1)) : e;
|
|
364
367
|
}
|
|
365
368
|
function Ee(e) {
|
|
366
|
-
let
|
|
367
|
-
return
|
|
369
|
+
let n = J(), t = { encoding: n.encoding || "utf8", quiet: n.quiet, debug: n.debug === true, override: n.override === true, fast: n.fast === true, paths: [".env"], defaultPath: true };
|
|
370
|
+
return n.path != null && (t.paths = [n.path], t.defaultPath = false), e.pathSet && (t.paths = e.paths, t.defaultPath = false), e.quiet != null && (t.quiet = e.quiet), e.debug != null && (t.debug = e.debug), e.override != null && (t.override = e.override), e.fast != null && (t.fast = e.fast), t;
|
|
368
371
|
}
|
|
369
372
|
function be(e) {
|
|
370
|
-
let
|
|
373
|
+
let n = {}, t = [], o = { override: e.override, debug: e.debug };
|
|
371
374
|
for (let s of e.paths) {
|
|
372
375
|
let i = Q.resolve(process.cwd(), Ae(s));
|
|
373
376
|
try {
|
|
374
|
-
let l = R.parse(
|
|
375
|
-
R.populate(
|
|
377
|
+
let l = R.parse(ge.readFileSync(i, { encoding: e.encoding }), { fast: e.fast });
|
|
378
|
+
R.populate(n, l, o), t.push(s);
|
|
376
379
|
} catch (l) {
|
|
377
380
|
if (e.debug && console.log(`\u2506 failed to load ${s} ${l.message}`), !(e.defaultPath && l.code === "ENOENT"))
|
|
378
381
|
throw l;
|
|
379
382
|
}
|
|
380
383
|
}
|
|
381
|
-
return { injected: R.populate(process.env,
|
|
384
|
+
return { injected: R.populate(process.env, n, o), loadedPaths: t };
|
|
382
385
|
}
|
|
383
|
-
function
|
|
384
|
-
let
|
|
385
|
-
if (
|
|
386
|
+
function K(e) {
|
|
387
|
+
let n = e[0];
|
|
388
|
+
if (n === "--help" || n === "-h") {
|
|
386
389
|
D();
|
|
387
390
|
return;
|
|
388
391
|
}
|
|
389
|
-
if (
|
|
392
|
+
if (n !== "run") {
|
|
390
393
|
D(), process.exitCode = 1;
|
|
391
394
|
return;
|
|
392
395
|
}
|
|
@@ -403,22 +406,22 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
403
406
|
D(), process.exitCode = 1;
|
|
404
407
|
return;
|
|
405
408
|
}
|
|
406
|
-
let
|
|
409
|
+
let o = Ee(t);
|
|
407
410
|
try {
|
|
408
|
-
let c = be(
|
|
409
|
-
if (!
|
|
410
|
-
let
|
|
411
|
-
c.loadedPaths.length > 0 && (
|
|
411
|
+
let c = be(o);
|
|
412
|
+
if (!(o.quiet == null ? J().quiet : o.quiet)) {
|
|
413
|
+
let g = `\u25C7 injected env (${Object.keys(c.injected).length})`;
|
|
414
|
+
c.loadedPaths.length > 0 && (g += ` from ${c.loadedPaths.join(", ")}`), console.error(g);
|
|
412
415
|
}
|
|
413
416
|
} catch (c) {
|
|
414
417
|
console.error(`dotenv: ${c.message}`), process.exitCode = 1;
|
|
415
418
|
return;
|
|
416
419
|
}
|
|
417
|
-
let r = !!process.stdin.isTTY, s = process.platform !== "win32" && !r, i =
|
|
418
|
-
function
|
|
420
|
+
let r = !!process.stdin.isTTY, s = process.platform !== "win32" && !r, i = Ce(t.command[0], t.command.slice(1), { stdio: "inherit", detached: s }), l = new Map, d = 0;
|
|
421
|
+
function h(c) {
|
|
419
422
|
if (!(!i.pid || i.exitCode !== null || i.signalCode !== null)) {
|
|
420
423
|
if (process.platform === "win32") {
|
|
421
|
-
|
|
424
|
+
ve.spawnSync("taskkill", ["/pid", String(i.pid), "/T", "/F"], { stdio: "ignore" });
|
|
422
425
|
return;
|
|
423
426
|
}
|
|
424
427
|
try {
|
|
@@ -439,11 +442,11 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
439
442
|
if (d++, r && process.platform !== "win32" && d === 1)
|
|
440
443
|
return;
|
|
441
444
|
if (d > 1) {
|
|
442
|
-
|
|
445
|
+
h(d === 2 ? "SIGTERM" : "SIGKILL");
|
|
443
446
|
return;
|
|
444
447
|
}
|
|
445
448
|
}
|
|
446
|
-
|
|
449
|
+
h(c);
|
|
447
450
|
};
|
|
448
451
|
l.set(c, a), process.on(c, a);
|
|
449
452
|
}
|
|
@@ -453,16 +456,16 @@ var require_dist = __commonJS(function(exports, module) {
|
|
|
453
456
|
f(), typeof c == "number" ? process.exit(c) : (setInterval(() => {}, 1000), process.kill(process.pid, a));
|
|
454
457
|
});
|
|
455
458
|
}
|
|
456
|
-
F.exports =
|
|
457
|
-
F === __require.main &&
|
|
459
|
+
F.exports = K;
|
|
460
|
+
F === __require.main && K(process.argv.slice(2));
|
|
458
461
|
});
|
|
459
|
-
var
|
|
460
|
-
var
|
|
461
|
-
module.exports =
|
|
462
|
-
module.exports.config =
|
|
463
|
-
module.exports.configDotenv =
|
|
464
|
-
module.exports.parse =
|
|
465
|
-
module.exports.populate =
|
|
462
|
+
var S = N();
|
|
463
|
+
var qe = X();
|
|
464
|
+
module.exports = S;
|
|
465
|
+
module.exports.config = S.config;
|
|
466
|
+
module.exports.configDotenv = S.configDotenv;
|
|
467
|
+
module.exports.parse = S.parse;
|
|
468
|
+
module.exports.populate = S.populate;
|
|
466
469
|
});
|
|
467
470
|
|
|
468
471
|
// src/load-env.ts
|
|
@@ -509,7 +512,7 @@ var createPkcePair = () => {
|
|
|
509
512
|
verifier
|
|
510
513
|
};
|
|
511
514
|
};
|
|
512
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
515
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/util.js
|
|
513
516
|
function getEnumValues(entries) {
|
|
514
517
|
const numericValues = Object.values(entries).filter((v) => typeof v === "number");
|
|
515
518
|
const values = Object.entries(entries).filter(([k, _]) => numericValues.indexOf(+k) === -1).map(([_, v]) => v);
|
|
@@ -855,6 +858,18 @@ function prefixIssues(path, issues) {
|
|
|
855
858
|
function unwrapMessage(message) {
|
|
856
859
|
return typeof message === "string" ? message : message?.message;
|
|
857
860
|
}
|
|
861
|
+
function sizeCaps(defChecks) {
|
|
862
|
+
const caps = [];
|
|
863
|
+
for (const ch of defChecks ?? []) {
|
|
864
|
+
const d = ch._zod.def;
|
|
865
|
+
if (!/_(length|size)$|_equals$/.test(d.check))
|
|
866
|
+
break;
|
|
867
|
+
const max = d.maximum ?? d.length ?? d.size;
|
|
868
|
+
if (max >= 0)
|
|
869
|
+
caps.push([max, ch]);
|
|
870
|
+
}
|
|
871
|
+
return caps;
|
|
872
|
+
}
|
|
858
873
|
function attachSchema(issues, start, inst) {
|
|
859
874
|
var _a;
|
|
860
875
|
for (let i = start;i < issues.length; i++) {
|
|
@@ -1052,7 +1067,7 @@ function constantCatch(value) {
|
|
|
1052
1067
|
return fn;
|
|
1053
1068
|
}
|
|
1054
1069
|
|
|
1055
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
1070
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/core.js
|
|
1056
1071
|
var _a;
|
|
1057
1072
|
var _zodDesc = { value: undefined, enumerable: false };
|
|
1058
1073
|
var _E = "captureStackTrace" in Error ? Error : null;
|
|
@@ -1170,7 +1185,7 @@ function config2(newConfig) {
|
|
|
1170
1185
|
Object.assign(globalConfig, newConfig);
|
|
1171
1186
|
return globalConfig;
|
|
1172
1187
|
}
|
|
1173
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
1188
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/errors.js
|
|
1174
1189
|
function _getMessage() {
|
|
1175
1190
|
const internals = this._zod;
|
|
1176
1191
|
internals.message ?? (internals.message = JSON.stringify(internals.def, jsonStringifyReplacer, 2));
|
|
@@ -1285,7 +1300,7 @@ function formatError(error, mapper = (issue) => issue.message) {
|
|
|
1285
1300
|
return fieldErrors;
|
|
1286
1301
|
}
|
|
1287
1302
|
|
|
1288
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
1303
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/parse.js
|
|
1289
1304
|
function finalizeParams(callee, params) {
|
|
1290
1305
|
return { callee: params?.callee ?? callee, Err: params?.Err };
|
|
1291
1306
|
}
|
|
@@ -1432,7 +1447,7 @@ var _safeEncodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
|
1432
1447
|
var _safeDecodeAsync = (_Err) => async (schema, value, _ctx) => {
|
|
1433
1448
|
return _safeParseAsync(_Err)(schema, value, _ctx);
|
|
1434
1449
|
};
|
|
1435
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
1450
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/regexes.js
|
|
1436
1451
|
var cuid = /^[cC][0-9a-z]{6,}$/;
|
|
1437
1452
|
var cuid2 = /^[0-9a-z]+$/;
|
|
1438
1453
|
var ulid = /^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/;
|
|
@@ -1490,7 +1505,7 @@ var _null = /^null$/i;
|
|
|
1490
1505
|
var lowercase = /^[^A-Z]*$/;
|
|
1491
1506
|
var uppercase = /^[^a-z]*$/;
|
|
1492
1507
|
|
|
1493
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
1508
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/checks.js
|
|
1494
1509
|
var $ZodCheck = /* @__PURE__ */ $constructor("$ZodCheck", (inst, def) => {
|
|
1495
1510
|
var _a;
|
|
1496
1511
|
inst._zod ?? (inst._zod = {});
|
|
@@ -1806,7 +1821,7 @@ var $ZodCheckOverwrite = /* @__PURE__ */ $constructor("$ZodCheckOverwrite", (ins
|
|
|
1806
1821
|
};
|
|
1807
1822
|
});
|
|
1808
1823
|
|
|
1809
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
1824
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/doc.js
|
|
1810
1825
|
class Doc {
|
|
1811
1826
|
constructor(args = [], closed = {}) {
|
|
1812
1827
|
this.content = [];
|
|
@@ -1848,14 +1863,14 @@ ${content.join(`
|
|
|
1848
1863
|
}
|
|
1849
1864
|
}
|
|
1850
1865
|
|
|
1851
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
1866
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/versions.js
|
|
1852
1867
|
var version = {
|
|
1853
1868
|
major: 4,
|
|
1854
1869
|
minor: 6,
|
|
1855
|
-
patch:
|
|
1870
|
+
patch: 7
|
|
1856
1871
|
};
|
|
1857
1872
|
|
|
1858
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
1873
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/schemas.js
|
|
1859
1874
|
var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
1860
1875
|
var _a;
|
|
1861
1876
|
inst ?? (inst = {});
|
|
@@ -2421,6 +2436,29 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
|
|
|
2421
2436
|
return payload;
|
|
2422
2437
|
};
|
|
2423
2438
|
});
|
|
2439
|
+
function capSize(inst, size) {
|
|
2440
|
+
const caps = sizeCaps(inst._zod.def.checks);
|
|
2441
|
+
if (!caps.length)
|
|
2442
|
+
return;
|
|
2443
|
+
const cap = Math.min(...caps.map((c) => c[0]));
|
|
2444
|
+
const parse = inst._zod.parse;
|
|
2445
|
+
inst._zod.parse = (payload, ctx) => {
|
|
2446
|
+
const n = size(payload.value);
|
|
2447
|
+
if (n > cap && !ctx?.skipChecks && ctx?.direction !== "backward") {
|
|
2448
|
+
for (const [max, ch] of sizeCaps(inst._zod.def.checks)) {
|
|
2449
|
+
if (n > max && ch._zod.def.when(payload)) {
|
|
2450
|
+
const start = payload.issues.length;
|
|
2451
|
+
ch._zod.check(payload);
|
|
2452
|
+
payload.issues[start].continue = false;
|
|
2453
|
+
attachSchema(payload.issues, start, inst);
|
|
2454
|
+
return payload;
|
|
2455
|
+
}
|
|
2456
|
+
}
|
|
2457
|
+
}
|
|
2458
|
+
return parse(payload, ctx);
|
|
2459
|
+
};
|
|
2460
|
+
}
|
|
2461
|
+
var arraySize = (input) => Array.isArray(input) ? input.length : -1;
|
|
2424
2462
|
function handleArrayResult(result, final, index) {
|
|
2425
2463
|
if (result.issues.length) {
|
|
2426
2464
|
final.issues.push(...prefixIssues(index, result.issues));
|
|
@@ -2464,6 +2502,7 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
|
|
|
2464
2502
|
}
|
|
2465
2503
|
return payload;
|
|
2466
2504
|
};
|
|
2505
|
+
capSize(inst, arraySize);
|
|
2467
2506
|
});
|
|
2468
2507
|
function handlePropertyResult(result, final, key, input, optin, optout) {
|
|
2469
2508
|
const isPresent = key in input;
|
|
@@ -3246,7 +3285,7 @@ function handleRefineResult(result, payload, input, inst) {
|
|
|
3246
3285
|
payload.issues.push(issue(_iss));
|
|
3247
3286
|
}
|
|
3248
3287
|
}
|
|
3249
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
3288
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/memoizer.js
|
|
3250
3289
|
class $ZodCyclicError extends Error {
|
|
3251
3290
|
constructor() {
|
|
3252
3291
|
super(`Cannot parse a reference cycle that closes through a transform`);
|
|
@@ -3515,7 +3554,7 @@ function isBackEdge(ctx, value) {
|
|
|
3515
3554
|
const backEdges = ctx[STATE]?.backEdges;
|
|
3516
3555
|
return backEdges !== undefined && isRef(value) && backEdges.has(value);
|
|
3517
3556
|
}
|
|
3518
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
3557
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/locales/en.js
|
|
3519
3558
|
var error = () => {
|
|
3520
3559
|
const Sizable = {
|
|
3521
3560
|
string: { unit: "characters", verb: "to have" },
|
|
@@ -3637,7 +3676,7 @@ function en_default() {
|
|
|
3637
3676
|
localeError: error()
|
|
3638
3677
|
};
|
|
3639
3678
|
}
|
|
3640
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
3679
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/registries.js
|
|
3641
3680
|
var _a2;
|
|
3642
3681
|
class $ZodRegistry {
|
|
3643
3682
|
constructor() {
|
|
@@ -3684,7 +3723,7 @@ function registry() {
|
|
|
3684
3723
|
}
|
|
3685
3724
|
(_a2 = globalThis).__zod_globalRegistry ?? (_a2.__zod_globalRegistry = registry());
|
|
3686
3725
|
var globalRegistry = globalThis.__zod_globalRegistry;
|
|
3687
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
3726
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/api.js
|
|
3688
3727
|
function snapshotChecks(def) {
|
|
3689
3728
|
if (def.checks)
|
|
3690
3729
|
def.checks = [...def.checks];
|
|
@@ -4138,7 +4177,7 @@ function _check(fn, params) {
|
|
|
4138
4177
|
ch._zod.check = fn;
|
|
4139
4178
|
return ch;
|
|
4140
4179
|
}
|
|
4141
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
4180
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/to-json-schema.js
|
|
4142
4181
|
function assignProps(target, ...sources) {
|
|
4143
4182
|
for (const source of sources) {
|
|
4144
4183
|
for (const key of Reflect.ownKeys(source)) {
|
|
@@ -4661,7 +4700,7 @@ var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) =
|
|
|
4661
4700
|
extractDefs(ctx, schema);
|
|
4662
4701
|
return finalize(ctx, schema);
|
|
4663
4702
|
};
|
|
4664
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
4703
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/core/json-schema-processors.js
|
|
4665
4704
|
var narrowMin = (agg, key, value) => {
|
|
4666
4705
|
if (agg[key] === undefined || value > agg[key])
|
|
4667
4706
|
agg[key] = value;
|
|
@@ -5090,7 +5129,7 @@ var optionalProcessor = (schema, ctx, _json, params) => {
|
|
|
5090
5129
|
const seen = ctx.seen.get(schema);
|
|
5091
5130
|
seen.ref = def.innerType;
|
|
5092
5131
|
};
|
|
5093
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
5132
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/errors.js
|
|
5094
5133
|
var _installedErrorProtos = /* @__PURE__ */ new WeakSet([Object.prototype, Error.prototype]);
|
|
5095
5134
|
function _lazyMethod(proto, key, make) {
|
|
5096
5135
|
Object.defineProperty(proto, key, {
|
|
@@ -5135,7 +5174,7 @@ var ZodRealError = /* @__PURE__ */ $constructor("ZodError", initializer2, undefi
|
|
|
5135
5174
|
Parent: Error
|
|
5136
5175
|
});
|
|
5137
5176
|
|
|
5138
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
5177
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/parse.js
|
|
5139
5178
|
var parse2 = /* @__PURE__ */ _parse(ZodRealError);
|
|
5140
5179
|
var parseAsync = /* @__PURE__ */ _parseAsync(ZodRealError);
|
|
5141
5180
|
var safeParse = /* @__PURE__ */ _safeParse(ZodRealError);
|
|
@@ -5149,7 +5188,7 @@ var safeDecode = /* @__PURE__ */ _safeDecode(ZodRealError);
|
|
|
5149
5188
|
var safeEncodeAsync = /* @__PURE__ */ _safeEncodeAsync(ZodRealError);
|
|
5150
5189
|
var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
5151
5190
|
|
|
5152
|
-
// ../../../node_modules/.bun/zod@4.6.
|
|
5191
|
+
// ../../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
|
|
5153
5192
|
function _ensureDefaultLocale() {
|
|
5154
5193
|
if (!globalConfig.localeError)
|
|
5155
5194
|
config2(en_default());
|
|
@@ -6822,10 +6861,15 @@ Usage:
|
|
|
6822
6861
|
et event appearance upload --event-id <id> --file <path> --media-type <image|video> --content-type <mime>
|
|
6823
6862
|
et event photo-wall display-items --event-id <id> [--limit <n>] [--cursor <json>] [--retained-ids <json>]
|
|
6824
6863
|
et lucky-draw pre-draw --event-id <id> --prize-count <n>
|
|
6864
|
+
et lucky-draw participants replace --event-id <id> (--participants <json-array> | --participants-file <path>) --allow-state-change --target <same-event-id>
|
|
6865
|
+
et lucky-draw participants list --event-id <id> [--page <n>] [--per-page <n>]
|
|
6825
6866
|
|
|
6826
6867
|
Lucky draw:
|
|
6827
6868
|
pre-draw immediately saves winners for the next unassigned prizes in order.
|
|
6828
6869
|
Uses the live draw random selection and participant filters in the backend.
|
|
6870
|
+
participants replace replaces the imported source roster; it is not an append.
|
|
6871
|
+
It requires --allow-state-change and --target exactly equal to --event-id.
|
|
6872
|
+
participants list defaults to page 1 with 100 results per page; inspect every page.
|
|
6829
6873
|
|
|
6830
6874
|
Global options:
|
|
6831
6875
|
--api-url <url> Override EVENT_TECH_API_URL.
|
|
@@ -7027,6 +7071,50 @@ var parseRetainedIds = (value) => {
|
|
|
7027
7071
|
}
|
|
7028
7072
|
return parsed;
|
|
7029
7073
|
};
|
|
7074
|
+
var luckyDrawParticipantFields = new Set(["email", "luckyDrawId", "name"]);
|
|
7075
|
+
var parseLuckyDrawParticipants = (value) => {
|
|
7076
|
+
let parsed;
|
|
7077
|
+
try {
|
|
7078
|
+
parsed = JSON.parse(value);
|
|
7079
|
+
} catch {
|
|
7080
|
+
throw new CliUsageError("--participants must be valid JSON.");
|
|
7081
|
+
}
|
|
7082
|
+
if (!Array.isArray(parsed)) {
|
|
7083
|
+
throw new CliUsageError("--participants must be a JSON array.");
|
|
7084
|
+
}
|
|
7085
|
+
return parsed.map((participant, index) => {
|
|
7086
|
+
if (typeof participant !== "object" || participant === null || Array.isArray(participant)) {
|
|
7087
|
+
throw new CliUsageError(`--participants[${index}] must be an object.`);
|
|
7088
|
+
}
|
|
7089
|
+
if (Object.keys(participant).some((key) => !luckyDrawParticipantFields.has(key))) {
|
|
7090
|
+
throw new CliUsageError(`--participants[${index}] contains an unsupported field.`);
|
|
7091
|
+
}
|
|
7092
|
+
const luckyDrawId = "luckyDrawId" in participant ? participant.luckyDrawId : undefined;
|
|
7093
|
+
const name = "name" in participant ? participant.name : undefined;
|
|
7094
|
+
const email = "email" in participant ? participant.email : undefined;
|
|
7095
|
+
if (typeof luckyDrawId !== "string") {
|
|
7096
|
+
throw new CliUsageError(`--participants[${index}].luckyDrawId must be a string.`);
|
|
7097
|
+
}
|
|
7098
|
+
if (name !== undefined && typeof name !== "string") {
|
|
7099
|
+
throw new CliUsageError(`--participants[${index}].name must be a string.`);
|
|
7100
|
+
}
|
|
7101
|
+
if (email !== undefined && email !== null && typeof email !== "string") {
|
|
7102
|
+
throw new CliUsageError(`--participants[${index}].email must be a string or null.`);
|
|
7103
|
+
}
|
|
7104
|
+
return {
|
|
7105
|
+
luckyDrawId,
|
|
7106
|
+
...name === undefined ? {} : { name },
|
|
7107
|
+
...email === undefined ? {} : { email }
|
|
7108
|
+
};
|
|
7109
|
+
});
|
|
7110
|
+
};
|
|
7111
|
+
var readParticipantsFile = async (path) => {
|
|
7112
|
+
try {
|
|
7113
|
+
return await readFile2(path, "utf8");
|
|
7114
|
+
} catch {
|
|
7115
|
+
throw new CliUsageError("--participants-file could not be read.");
|
|
7116
|
+
}
|
|
7117
|
+
};
|
|
7030
7118
|
var parseAppearanceMediaType = (value) => {
|
|
7031
7119
|
if (value === "image" || value === "video")
|
|
7032
7120
|
return value;
|
|
@@ -7261,6 +7349,47 @@ Waiting for approval\u2026
|
|
|
7261
7349
|
writeSuccess(runtime, await api2.event.luckyDraw.preDrawPrizes.mutate(input));
|
|
7262
7350
|
return;
|
|
7263
7351
|
}
|
|
7352
|
+
if (group === "lucky-draw" && action === "participants" && subAction === "replace") {
|
|
7353
|
+
assertPositionalCount(parsed, 3);
|
|
7354
|
+
assertOnlyFlags(parsed, [
|
|
7355
|
+
"event-id",
|
|
7356
|
+
"participants",
|
|
7357
|
+
"participants-file",
|
|
7358
|
+
"allow-state-change",
|
|
7359
|
+
"target"
|
|
7360
|
+
]);
|
|
7361
|
+
if (parsed.flags.get("allow-state-change") !== true) {
|
|
7362
|
+
throw new CliUsageError("--allow-state-change is required as an explicit acknowledgement.");
|
|
7363
|
+
}
|
|
7364
|
+
const eventId = getRequiredFlag(parsed, "event-id");
|
|
7365
|
+
if (getRequiredFlag(parsed, "target") !== eventId) {
|
|
7366
|
+
throw new CliUsageError("--target must exactly match --event-id.");
|
|
7367
|
+
}
|
|
7368
|
+
const participantsValue = getOptionalFlag(parsed, "participants");
|
|
7369
|
+
const participantsFile = getOptionalFlag(parsed, "participants-file");
|
|
7370
|
+
if (participantsValue === undefined === (participantsFile === undefined)) {
|
|
7371
|
+
throw new CliUsageError("Provide exactly one of --participants or --participants-file.");
|
|
7372
|
+
}
|
|
7373
|
+
const input = {
|
|
7374
|
+
eventId,
|
|
7375
|
+
participants: parseLuckyDrawParticipants(participantsValue ?? await readParticipantsFile(getRequiredFlag(parsed, "participants-file")))
|
|
7376
|
+
};
|
|
7377
|
+
await ensureAuthentication();
|
|
7378
|
+
writeSuccess(runtime, await api2.event.luckyDraw.createLuckyDrawParticipant.mutate(input));
|
|
7379
|
+
return;
|
|
7380
|
+
}
|
|
7381
|
+
if (group === "lucky-draw" && action === "participants" && subAction === "list") {
|
|
7382
|
+
assertPositionalCount(parsed, 3);
|
|
7383
|
+
assertOnlyFlags(parsed, ["event-id", "page", "per-page"]);
|
|
7384
|
+
const input = {
|
|
7385
|
+
eventId: getRequiredFlag(parsed, "event-id"),
|
|
7386
|
+
page: parsePositiveInteger(getOptionalFlag(parsed, "page") ?? "1", "page"),
|
|
7387
|
+
perPage: parseBoundedInteger(getOptionalFlag(parsed, "per-page") ?? "100", "per-page", 1, 100)
|
|
7388
|
+
};
|
|
7389
|
+
await ensureAuthentication();
|
|
7390
|
+
writeSuccess(runtime, await api2.event.luckyDraw.getLuckyDrawParticipantsByEventId.query(input));
|
|
7391
|
+
return;
|
|
7392
|
+
}
|
|
7264
7393
|
throw new CliUsageError("Unknown command. Run `et --help` for available commands.");
|
|
7265
7394
|
};
|
|
7266
7395
|
var runCli = async (args, runtime = processRuntime, credentialStore = createBunCredentialStore({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@go-labs-sg/event-tech",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Event Tech CLI for managing Event Tech resources through the Go Labs API.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
],
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@trpc/client": "^11.19.0",
|
|
20
|
-
"dotenv": "^18.0.
|
|
20
|
+
"dotenv": "^18.0.8",
|
|
21
21
|
"superjson": "^2.2.6"
|
|
22
22
|
},
|
|
23
23
|
"engines": {
|