@zaflun/lumio-extension-types 0.3.2 → 0.3.3

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 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", "trovo", "discord"];
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;
@@ -347,7 +364,6 @@ declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
347
364
  twitch: "twitch";
348
365
  youtube: "youtube";
349
366
  kick: "kick";
350
- trovo: "trovo";
351
367
  discord: "discord";
352
368
  }>>>;
353
369
  triggers: z.ZodOptional<z.ZodObject<{
@@ -450,7 +466,6 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
450
466
  twitch: "twitch";
451
467
  youtube: "youtube";
452
468
  kick: "kick";
453
- trovo: "trovo";
454
469
  discord: "discord";
455
470
  }>>>;
456
471
  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
- name: z2.string(),
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({
@@ -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" }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaflun/lumio-extension-types",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Shared TypeScript types for Lumio extensions, store, and config",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",