@zaflun/lumio-extension-types 0.3.2 → 0.4.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/index.d.ts +18 -5
- package/dist/index.js +7 -5
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -187,7 +187,7 @@ interface ConfigField {
|
|
|
187
187
|
declare const configFieldSchema: z.ZodType<ConfigField>;
|
|
188
188
|
declare const configSchemaSchema: z.ZodArray<z.ZodType<ConfigField, unknown, z.core.$ZodTypeInternals<ConfigField, unknown>>>;
|
|
189
189
|
type ConfigSchema = z.infer<typeof configSchemaSchema>;
|
|
190
|
-
declare const VALID_PLATFORMS: readonly ["twitch", "youtube", "kick", "
|
|
190
|
+
declare const VALID_PLATFORMS: readonly ["twitch", "youtube", "kick", "discord"];
|
|
191
191
|
declare const VALID_ROLES: readonly ["everyone", "follower", "subscriber", "vip", "moderator", "broadcaster"];
|
|
192
192
|
declare const triggerCommandSchema: z.ZodObject<{
|
|
193
193
|
name: z.ZodString;
|
|
@@ -273,6 +273,23 @@ declare const lumioExtensionSoundSchema: z.ZodObject<{
|
|
|
273
273
|
name: z.ZodString;
|
|
274
274
|
default_volume: z.ZodOptional<z.ZodNumber>;
|
|
275
275
|
}, z.core.$strip>;
|
|
276
|
+
/**
|
|
277
|
+
* Runtime / stored extension-config schema — **snake_case**, matching the
|
|
278
|
+
* `@lumio/types` convention used across DB rows, WS payloads and the worker
|
|
279
|
+
* runtime (extension-runtime, bot-module-worker, automation-worker, V8).
|
|
280
|
+
*
|
|
281
|
+
* ⚠️ This is NOT the deploy-manifest schema. The `lumio.config.json` written by
|
|
282
|
+
* `lumio init` and uploaded by `lumio deploy` is **camelCase** (`extensionId`,
|
|
283
|
+
* `nodeType`, `pollIntervalSeconds`, `triggerMode`, `allowHosts`, …) and is
|
|
284
|
+
* validated on the server by `crates/lo-extensions/src/manifest_validator.rs`,
|
|
285
|
+
* which reads camelCase and transforms it into the snake_case stored form this
|
|
286
|
+
* schema describes. The CLI (`packages/cli/src/config/parser.ts`) has its own
|
|
287
|
+
* camelCase `LumioConfig` for the same reason. Do not try to validate the CLI /
|
|
288
|
+
* manifest format against this schema — they live on different layers, bridged
|
|
289
|
+
* by the manifest validator. Only the shared *enum value* lists
|
|
290
|
+
* (`VALID_PLATFORMS`, `VALID_ROLES`, `NODE_TYPES`, `TRIGGER_MODES`, …) are
|
|
291
|
+
* casing-agnostic and safe to share between the two layers.
|
|
292
|
+
*/
|
|
276
293
|
declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
|
|
277
294
|
extension_id: z.ZodString;
|
|
278
295
|
name: z.ZodString;
|
|
@@ -308,7 +325,6 @@ declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
|
|
|
308
325
|
targets: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
309
326
|
editor: "editor";
|
|
310
327
|
layer: "layer";
|
|
311
|
-
interactive: "interactive";
|
|
312
328
|
}>>>>;
|
|
313
329
|
server: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
314
330
|
permissions: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
@@ -347,7 +363,6 @@ declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
|
|
|
347
363
|
twitch: "twitch";
|
|
348
364
|
youtube: "youtube";
|
|
349
365
|
kick: "kick";
|
|
350
|
-
trovo: "trovo";
|
|
351
366
|
discord: "discord";
|
|
352
367
|
}>>>;
|
|
353
368
|
triggers: z.ZodOptional<z.ZodObject<{
|
|
@@ -411,7 +426,6 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
|
|
|
411
426
|
targets: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
412
427
|
editor: "editor";
|
|
413
428
|
layer: "layer";
|
|
414
|
-
interactive: "interactive";
|
|
415
429
|
}>>>>;
|
|
416
430
|
server: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
417
431
|
permissions: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
@@ -450,7 +464,6 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
|
|
|
450
464
|
twitch: "twitch";
|
|
451
465
|
youtube: "youtube";
|
|
452
466
|
kick: "kick";
|
|
453
|
-
trovo: "trovo";
|
|
454
467
|
discord: "discord";
|
|
455
468
|
}>>>;
|
|
456
469
|
triggers: z.ZodOptional<z.ZodObject<{
|
package/dist/index.js
CHANGED
|
@@ -164,7 +164,6 @@ var VALID_PLATFORMS = [
|
|
|
164
164
|
"twitch",
|
|
165
165
|
"youtube",
|
|
166
166
|
"kick",
|
|
167
|
-
"trovo",
|
|
168
167
|
"discord"
|
|
169
168
|
];
|
|
170
169
|
var VALID_ROLES = [
|
|
@@ -208,8 +207,11 @@ var automationNodeSchema = z2.object({
|
|
|
208
207
|
color: z2.string().regex(/^#[0-9a-fA-F]{6}$/).optional()
|
|
209
208
|
});
|
|
210
209
|
var lumioExtensionSoundSchema = z2.object({
|
|
211
|
-
file: z2.string()
|
|
212
|
-
|
|
210
|
+
file: z2.string().min(1).max(255).refine(
|
|
211
|
+
(f) => !f.includes("..") && !f.startsWith("/") && !f.includes("\\"),
|
|
212
|
+
{ message: "Invalid sound file path" }
|
|
213
|
+
),
|
|
214
|
+
name: z2.string().min(1).max(255),
|
|
213
215
|
default_volume: z2.number().min(0).max(1).optional()
|
|
214
216
|
});
|
|
215
217
|
var lumioExtensionConfigBaseSchema = z2.object({
|
|
@@ -221,7 +223,7 @@ var lumioExtensionConfigBaseSchema = z2.object({
|
|
|
221
223
|
version: z2.string(),
|
|
222
224
|
node_type: nodeTypeSchema.optional(),
|
|
223
225
|
node: automationNodeSchema.optional(),
|
|
224
|
-
targets: z2.array(z2.enum(["editor", "layer"
|
|
226
|
+
targets: z2.array(z2.enum(["editor", "layer"])).optional().default([]),
|
|
225
227
|
server: z2.boolean().optional().default(false),
|
|
226
228
|
permissions: z2.array(z2.string()).optional().default([]),
|
|
227
229
|
egress: z2.object({
|
|
@@ -229,7 +231,7 @@ var lumioExtensionConfigBaseSchema = z2.object({
|
|
|
229
231
|
allow_ports: z2.array(z2.number())
|
|
230
232
|
}).optional(),
|
|
231
233
|
fonts: z2.array(z2.string()).optional().default([]),
|
|
232
|
-
sounds: z2.array(lumioExtensionSoundSchema).optional().default([]),
|
|
234
|
+
sounds: z2.array(lumioExtensionSoundSchema).max(200).optional().default([]),
|
|
233
235
|
visibility: extensionVisibilitySchema.optional().default("private"),
|
|
234
236
|
default_install: z2.boolean().optional().default(false),
|
|
235
237
|
pricing: extensionPricingSchema.optional().default({ type: "free" }),
|