@zaflun/lumio-extension-types 0.3.0 → 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.
Files changed (3) hide show
  1. package/dist/index.d.ts +181 -69
  2. package/dist/index.js +185 -11
  3. package/package.json +1 -1
package/dist/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod/v4';
2
2
 
3
- declare const EXTENSION_CATEGORIES: readonly ["widget", "extension", "overlay", "bot_module", "integration", "theme"];
3
+ declare const EXTENSION_CATEGORIES: readonly ["widget", "extension", "overlay", "bot_module", "integration", "theme", "automation_node"];
4
4
  declare const EXTENSION_VISIBILITIES: readonly ["private", "unlisted", "public", "paid"];
5
5
  declare const EXTENSION_STATUSES: readonly ["draft", "published", "deprecated", "pending_deletion", "deleted", "suspended"];
6
6
  declare const VERSION_STATUSES: readonly ["draft", "pending_review", "testing", "pending_publish", "published", "rejected", "deprecated", "suspended"];
@@ -11,6 +11,7 @@ declare const extensionCategorySchema: z.ZodEnum<{
11
11
  bot_module: "bot_module";
12
12
  integration: "integration";
13
13
  theme: "theme";
14
+ automation_node: "automation_node";
14
15
  }>;
15
16
  declare const extensionVisibilitySchema: z.ZodEnum<{
16
17
  private: "private";
@@ -55,6 +56,7 @@ declare const extensionSchema: z.ZodObject<{
55
56
  bot_module: "bot_module";
56
57
  integration: "integration";
57
58
  theme: "theme";
59
+ automation_node: "automation_node";
58
60
  }>;
59
61
  visibility: z.ZodEnum<{
60
62
  private: "private";
@@ -140,7 +142,7 @@ declare const extensionReviewSchema: z.ZodObject<{
140
142
  type ExtensionReview = z.infer<typeof extensionReviewSchema>;
141
143
 
142
144
  declare const PRICING_TYPES: readonly ["free", "one_time", "subscription"];
143
- declare const CONFIG_FIELD_TYPES: readonly ["string", "number", "boolean", "color", "select"];
145
+ declare const CONFIG_FIELD_TYPES: readonly ["string", "number", "boolean", "color", "select", "textarea", "slider", "font", "icon", "image", "sound", "multiselect", "group", "divider", "info", "channel", "designer", "presets"];
144
146
  declare const pricingTypeSchema: z.ZodEnum<{
145
147
  free: "free";
146
148
  one_time: "one_time";
@@ -160,37 +162,32 @@ declare const extensionPricingSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
160
162
  interval: z.ZodString;
161
163
  }, z.core.$strip>], "type">;
162
164
  type ExtensionPricing = z.infer<typeof extensionPricingSchema>;
163
- declare const configFieldSchema: z.ZodObject<{
164
- key: z.ZodString;
165
- type: z.ZodEnum<{
166
- string: "string";
167
- number: "number";
168
- boolean: "boolean";
169
- color: "color";
170
- select: "select";
171
- }>;
172
- label: z.ZodString;
173
- default_value: z.ZodUnknown;
174
- required: z.ZodBoolean;
175
- options: z.ZodOptional<z.ZodArray<z.ZodString>>;
176
- }, z.core.$strip>;
177
- type ConfigField = z.infer<typeof configFieldSchema>;
178
- declare const configSchemaSchema: z.ZodArray<z.ZodObject<{
179
- key: z.ZodString;
180
- type: z.ZodEnum<{
181
- string: "string";
182
- number: "number";
183
- boolean: "boolean";
184
- color: "color";
185
- select: "select";
186
- }>;
187
- label: z.ZodString;
188
- default_value: z.ZodUnknown;
189
- required: z.ZodBoolean;
190
- options: z.ZodOptional<z.ZodArray<z.ZodString>>;
191
- }, z.core.$strip>>;
165
+ interface ConfigField {
166
+ key: string;
167
+ type: (typeof CONFIG_FIELD_TYPES)[number];
168
+ label: string;
169
+ default_value?: unknown;
170
+ required: boolean;
171
+ options?: string[];
172
+ min?: number;
173
+ max?: number;
174
+ step?: number;
175
+ placeholder?: string;
176
+ rows?: number;
177
+ unit?: string;
178
+ collapsed?: boolean;
179
+ visible_when?: {
180
+ key: string;
181
+ equals: unknown;
182
+ };
183
+ fields?: ConfigField[];
184
+ content?: string;
185
+ multiple?: boolean;
186
+ }
187
+ declare const configFieldSchema: z.ZodType<ConfigField>;
188
+ declare const configSchemaSchema: z.ZodArray<z.ZodType<ConfigField, unknown, z.core.$ZodTypeInternals<ConfigField, unknown>>>;
192
189
  type ConfigSchema = z.infer<typeof configSchemaSchema>;
193
- declare const VALID_PLATFORMS: readonly ["twitch", "youtube", "kick", "trovo", "discord"];
190
+ declare const VALID_PLATFORMS: readonly ["twitch", "youtube", "kick", "discord"];
194
191
  declare const VALID_ROLES: readonly ["everyone", "follower", "subscriber", "vip", "moderator", "broadcaster"];
195
192
  declare const triggerCommandSchema: z.ZodObject<{
196
193
  name: z.ZodString;
@@ -239,10 +236,65 @@ declare const triggerConfigSchema: z.ZodObject<{
239
236
  }, z.core.$strip>;
240
237
  type TriggerConfig = z.infer<typeof triggerConfigSchema>;
241
238
  type TriggerCommand = z.infer<typeof triggerCommandSchema>;
239
+ declare const NODE_TYPES: readonly ["trigger", "action", "logic"];
240
+ declare const TRIGGER_MODES: readonly ["webhook", "polling", "both"];
241
+ declare const nodeTypeSchema: z.ZodEnum<{
242
+ trigger: "trigger";
243
+ action: "action";
244
+ logic: "logic";
245
+ }>;
246
+ declare const triggerModeSchema: z.ZodEnum<{
247
+ webhook: "webhook";
248
+ polling: "polling";
249
+ both: "both";
250
+ }>;
251
+ type AutomationNodeType = z.infer<typeof nodeTypeSchema>;
252
+ type TriggerMode = z.infer<typeof triggerModeSchema>;
253
+ declare const automationNodeSchema: z.ZodObject<{
254
+ input_schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
255
+ output_schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
256
+ trigger_mode: z.ZodOptional<z.ZodEnum<{
257
+ webhook: "webhook";
258
+ polling: "polling";
259
+ both: "both";
260
+ }>>;
261
+ poll_interval_seconds: z.ZodOptional<z.ZodNumber>;
262
+ icon: z.ZodOptional<z.ZodString>;
263
+ color: z.ZodOptional<z.ZodString>;
264
+ }, z.core.$strip>;
265
+ type AutomationNode = z.infer<typeof automationNodeSchema>;
266
+ interface LumioExtensionSound {
267
+ file: string;
268
+ name: string;
269
+ default_volume?: number;
270
+ }
271
+ declare const lumioExtensionSoundSchema: z.ZodObject<{
272
+ file: z.ZodString;
273
+ name: z.ZodString;
274
+ default_volume: z.ZodOptional<z.ZodNumber>;
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
+ */
242
293
  declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
243
294
  extension_id: z.ZodString;
244
295
  name: z.ZodString;
245
296
  description: z.ZodOptional<z.ZodString>;
297
+ icon: z.ZodOptional<z.ZodString>;
246
298
  category: z.ZodEnum<{
247
299
  widget: "widget";
248
300
  extension: "extension";
@@ -250,8 +302,26 @@ declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
250
302
  bot_module: "bot_module";
251
303
  integration: "integration";
252
304
  theme: "theme";
305
+ automation_node: "automation_node";
253
306
  }>;
254
307
  version: z.ZodString;
308
+ node_type: z.ZodOptional<z.ZodEnum<{
309
+ trigger: "trigger";
310
+ action: "action";
311
+ logic: "logic";
312
+ }>>;
313
+ node: z.ZodOptional<z.ZodObject<{
314
+ input_schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
315
+ output_schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
316
+ trigger_mode: z.ZodOptional<z.ZodEnum<{
317
+ webhook: "webhook";
318
+ polling: "polling";
319
+ both: "both";
320
+ }>>;
321
+ poll_interval_seconds: z.ZodOptional<z.ZodNumber>;
322
+ icon: z.ZodOptional<z.ZodString>;
323
+ color: z.ZodOptional<z.ZodString>;
324
+ }, z.core.$strip>>;
255
325
  targets: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<{
256
326
  editor: "editor";
257
327
  layer: "layer";
@@ -264,12 +334,18 @@ declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
264
334
  allow_ports: z.ZodArray<z.ZodNumber>;
265
335
  }, z.core.$strip>>;
266
336
  fonts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
337
+ sounds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
338
+ file: z.ZodString;
339
+ name: z.ZodString;
340
+ default_volume: z.ZodOptional<z.ZodNumber>;
341
+ }, z.core.$strip>>>>;
267
342
  visibility: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
268
343
  private: "private";
269
344
  unlisted: "unlisted";
270
345
  public: "public";
271
346
  paid: "paid";
272
347
  }>>>;
348
+ default_install: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
273
349
  pricing: z.ZodDefault<z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
274
350
  type: z.ZodLiteral<"free">;
275
351
  }, z.core.$strip>, z.ZodObject<{
@@ -282,25 +358,12 @@ declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
282
358
  currency: z.ZodString;
283
359
  interval: z.ZodString;
284
360
  }, z.core.$strip>], "type">>>;
285
- config_schema: z.ZodOptional<z.ZodArray<z.ZodObject<{
286
- key: z.ZodString;
287
- type: z.ZodEnum<{
288
- string: "string";
289
- number: "number";
290
- boolean: "boolean";
291
- color: "color";
292
- select: "select";
293
- }>;
294
- label: z.ZodString;
295
- default_value: z.ZodUnknown;
296
- required: z.ZodBoolean;
297
- options: z.ZodOptional<z.ZodArray<z.ZodString>>;
298
- }, z.core.$strip>>>;
361
+ config_schema: z.ZodOptional<z.ZodArray<z.ZodType<ConfigField, unknown, z.core.$ZodTypeInternals<ConfigField, unknown>>>>;
362
+ designer_schema: z.ZodOptional<z.ZodArray<z.ZodType<ConfigField, unknown, z.core.$ZodTypeInternals<ConfigField, unknown>>>>;
299
363
  platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
300
364
  twitch: "twitch";
301
365
  youtube: "youtube";
302
366
  kick: "kick";
303
- trovo: "trovo";
304
367
  discord: "discord";
305
368
  }>>>;
306
369
  triggers: z.ZodOptional<z.ZodObject<{
@@ -333,6 +396,7 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
333
396
  extension_id: z.ZodString;
334
397
  name: z.ZodString;
335
398
  description: z.ZodOptional<z.ZodString>;
399
+ icon: z.ZodOptional<z.ZodString>;
336
400
  category: z.ZodEnum<{
337
401
  widget: "widget";
338
402
  extension: "extension";
@@ -340,8 +404,26 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
340
404
  bot_module: "bot_module";
341
405
  integration: "integration";
342
406
  theme: "theme";
407
+ automation_node: "automation_node";
343
408
  }>;
344
409
  version: z.ZodString;
410
+ node_type: z.ZodOptional<z.ZodEnum<{
411
+ trigger: "trigger";
412
+ action: "action";
413
+ logic: "logic";
414
+ }>>;
415
+ node: z.ZodOptional<z.ZodObject<{
416
+ input_schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
417
+ output_schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
418
+ trigger_mode: z.ZodOptional<z.ZodEnum<{
419
+ webhook: "webhook";
420
+ polling: "polling";
421
+ both: "both";
422
+ }>>;
423
+ poll_interval_seconds: z.ZodOptional<z.ZodNumber>;
424
+ icon: z.ZodOptional<z.ZodString>;
425
+ color: z.ZodOptional<z.ZodString>;
426
+ }, z.core.$strip>>;
345
427
  targets: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<{
346
428
  editor: "editor";
347
429
  layer: "layer";
@@ -354,12 +436,18 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
354
436
  allow_ports: z.ZodArray<z.ZodNumber>;
355
437
  }, z.core.$strip>>;
356
438
  fonts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
439
+ sounds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
440
+ file: z.ZodString;
441
+ name: z.ZodString;
442
+ default_volume: z.ZodOptional<z.ZodNumber>;
443
+ }, z.core.$strip>>>>;
357
444
  visibility: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
358
445
  private: "private";
359
446
  unlisted: "unlisted";
360
447
  public: "public";
361
448
  paid: "paid";
362
449
  }>>>;
450
+ default_install: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
363
451
  pricing: z.ZodDefault<z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
364
452
  type: z.ZodLiteral<"free">;
365
453
  }, z.core.$strip>, z.ZodObject<{
@@ -372,25 +460,12 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
372
460
  currency: z.ZodString;
373
461
  interval: z.ZodString;
374
462
  }, z.core.$strip>], "type">>>;
375
- config_schema: z.ZodOptional<z.ZodArray<z.ZodObject<{
376
- key: z.ZodString;
377
- type: z.ZodEnum<{
378
- string: "string";
379
- number: "number";
380
- boolean: "boolean";
381
- color: "color";
382
- select: "select";
383
- }>;
384
- label: z.ZodString;
385
- default_value: z.ZodUnknown;
386
- required: z.ZodBoolean;
387
- options: z.ZodOptional<z.ZodArray<z.ZodString>>;
388
- }, z.core.$strip>>>;
463
+ config_schema: z.ZodOptional<z.ZodArray<z.ZodType<ConfigField, unknown, z.core.$ZodTypeInternals<ConfigField, unknown>>>>;
464
+ designer_schema: z.ZodOptional<z.ZodArray<z.ZodType<ConfigField, unknown, z.core.$ZodTypeInternals<ConfigField, unknown>>>>;
389
465
  platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
390
466
  twitch: "twitch";
391
467
  youtube: "youtube";
392
468
  kick: "kick";
393
- trovo: "trovo";
394
469
  discord: "discord";
395
470
  }>>>;
396
471
  triggers: z.ZodOptional<z.ZodObject<{
@@ -437,6 +512,11 @@ type DeveloperVerificationStatus = z.infer<typeof developerVerificationStatusSch
437
512
  declare const developerProfileSchema: z.ZodObject<{
438
513
  id: z.ZodString;
439
514
  user_id: z.ZodString;
515
+ description: z.ZodNullable<z.ZodString>;
516
+ slug: z.ZodNullable<z.ZodString>;
517
+ github_url: z.ZodNullable<z.ZodString>;
518
+ website_url: z.ZodNullable<z.ZodString>;
519
+ avatar_key: z.ZodNullable<z.ZodString>;
440
520
  stripe_connect_id: z.ZodNullable<z.ZodString>;
441
521
  paypal_email: z.ZodNullable<z.ZodString>;
442
522
  bank_iban: z.ZodNullable<z.ZodString>;
@@ -457,17 +537,49 @@ declare const developerTeamSchema: z.ZodObject<{
457
537
  id: z.ZodString;
458
538
  name: z.ZodString;
459
539
  slug: z.ZodString;
540
+ description: z.ZodNullable<z.ZodString>;
541
+ github_url: z.ZodNullable<z.ZodString>;
542
+ website_url: z.ZodNullable<z.ZodString>;
543
+ avatar_key: z.ZodNullable<z.ZodString>;
460
544
  owner_id: z.ZodString;
461
545
  created_at: z.ZodString;
462
546
  updated_at: z.ZodString;
463
547
  }, z.core.$strip>;
464
548
  type DeveloperTeam = z.infer<typeof developerTeamSchema>;
465
- declare const DEVELOPER_TEAM_ROLES: readonly ["owner", "admin", "member"];
466
- declare const developerTeamRoleSchema: z.ZodEnum<{
467
- owner: "owner";
468
- admin: "admin";
469
- member: "member";
470
- }>;
549
+ declare const developerTeamRoleSchema: z.ZodObject<{
550
+ id: z.ZodString;
551
+ team_id: z.ZodString;
552
+ name: z.ZodString;
553
+ slug: z.ZodString;
554
+ description: z.ZodNullable<z.ZodString>;
555
+ is_default: z.ZodBoolean;
556
+ is_system: z.ZodBoolean;
557
+ color: z.ZodNullable<z.ZodString>;
558
+ sort_order: z.ZodNumber;
559
+ permission_count: z.ZodNumber;
560
+ member_count: z.ZodNumber;
561
+ created_at: z.ZodString;
562
+ updated_at: z.ZodString;
563
+ }, z.core.$strip>;
471
564
  type DeveloperTeamRole = z.infer<typeof developerTeamRoleSchema>;
565
+ declare const developerTeamMemberSchema: z.ZodObject<{
566
+ id: z.ZodString;
567
+ team_id: z.ZodString;
568
+ user_id: z.ZodString;
569
+ role_id: z.ZodString;
570
+ role_name: z.ZodString;
571
+ role_slug: z.ZodString;
572
+ role_color: z.ZodNullable<z.ZodString>;
573
+ display_name: z.ZodString;
574
+ email: z.ZodString;
575
+ avatar_url: z.ZodNullable<z.ZodString>;
576
+ created_at: z.ZodString;
577
+ }, z.core.$strip>;
578
+ type DeveloperTeamMember = z.infer<typeof developerTeamMemberSchema>;
579
+ declare const developerTeamPermissionSchema: z.ZodObject<{
580
+ key: z.ZodString;
581
+ category: z.ZodString;
582
+ }, z.core.$strip>;
583
+ type DeveloperTeamPermission = z.infer<typeof developerTeamPermissionSchema>;
472
584
 
473
- export { CONFIG_FIELD_TYPES, type ConfigField, type ConfigSchema, DEVELOPER_TEAM_ROLES, DEVELOPER_TYPES, DEVELOPER_VERIFICATION_STATUSES, type DeveloperProfile, type DeveloperTeam, type DeveloperTeamRole, type DeveloperType, type DeveloperVerificationStatus, EXTENSION_CATEGORIES, EXTENSION_STATUSES, EXTENSION_VISIBILITIES, type Extension, type ExtensionCategory, type ExtensionInstall, type ExtensionPricing, type ExtensionReview, type ExtensionStatus, type ExtensionVersion, type ExtensionVisibility, type LumioExtensionConfig, PRICING_TYPES, type PricingType, type TriggerCommand, type TriggerConfig, VALID_PLATFORMS, VALID_ROLES, VERSION_STATUSES, type VersionStatus, configFieldSchema, configSchemaSchema, developerProfileSchema, developerTeamRoleSchema, developerTeamSchema, developerTypeSchema, developerVerificationStatusSchema, extensionCategorySchema, extensionInstallSchema, extensionPricingSchema, extensionReviewSchema, extensionSchema, extensionStatusSchema, extensionVersionSchema, extensionVisibilitySchema, lumioExtensionConfigBaseSchema, lumioExtensionConfigSchema, pricingTypeSchema, triggerCommandSchema, triggerConfigSchema, triggerTimerSchema, versionStatusSchema };
585
+ export { type AutomationNode, type AutomationNodeType, CONFIG_FIELD_TYPES, type ConfigField, type ConfigSchema, DEVELOPER_TYPES, DEVELOPER_VERIFICATION_STATUSES, type DeveloperProfile, type DeveloperTeam, type DeveloperTeamMember, type DeveloperTeamPermission, type DeveloperTeamRole, type DeveloperType, type DeveloperVerificationStatus, EXTENSION_CATEGORIES, EXTENSION_STATUSES, EXTENSION_VISIBILITIES, type Extension, type ExtensionCategory, type ExtensionInstall, type ExtensionPricing, type ExtensionReview, type ExtensionStatus, type ExtensionVersion, type ExtensionVisibility, type LumioExtensionConfig, type LumioExtensionSound, NODE_TYPES, PRICING_TYPES, type PricingType, TRIGGER_MODES, type TriggerCommand, type TriggerConfig, type TriggerMode, VALID_PLATFORMS, VALID_ROLES, VERSION_STATUSES, type VersionStatus, automationNodeSchema, configFieldSchema, configSchemaSchema, developerProfileSchema, developerTeamMemberSchema, developerTeamPermissionSchema, developerTeamRoleSchema, developerTeamSchema, developerTypeSchema, developerVerificationStatusSchema, extensionCategorySchema, extensionInstallSchema, extensionPricingSchema, extensionReviewSchema, extensionSchema, extensionStatusSchema, extensionVersionSchema, extensionVisibilitySchema, lumioExtensionConfigBaseSchema, lumioExtensionConfigSchema, lumioExtensionSoundSchema, nodeTypeSchema, pricingTypeSchema, triggerCommandSchema, triggerConfigSchema, triggerModeSchema, triggerTimerSchema, versionStatusSchema };
package/dist/index.js CHANGED
@@ -6,7 +6,8 @@ var EXTENSION_CATEGORIES = [
6
6
  "overlay",
7
7
  "bot_module",
8
8
  "integration",
9
- "theme"
9
+ "theme",
10
+ "automation_node"
10
11
  ];
11
12
  var EXTENSION_VISIBILITIES = [
12
13
  "private",
@@ -107,7 +108,20 @@ var CONFIG_FIELD_TYPES = [
107
108
  "number",
108
109
  "boolean",
109
110
  "color",
110
- "select"
111
+ "select",
112
+ "textarea",
113
+ "slider",
114
+ "font",
115
+ "icon",
116
+ "image",
117
+ "sound",
118
+ "multiselect",
119
+ "group",
120
+ "divider",
121
+ "info",
122
+ "channel",
123
+ "designer",
124
+ "presets"
111
125
  ];
112
126
  var pricingTypeSchema = z2.enum(PRICING_TYPES);
113
127
  var extensionPricingSchema = z2.discriminatedUnion("type", [
@@ -130,16 +144,26 @@ var configFieldSchema = z2.object({
130
144
  key: z2.string(),
131
145
  type: z2.enum(CONFIG_FIELD_TYPES),
132
146
  label: z2.string(),
133
- default_value: z2.unknown(),
147
+ default_value: z2.unknown().optional(),
134
148
  required: z2.boolean(),
135
- options: z2.array(z2.string()).optional()
149
+ options: z2.array(z2.string()).optional(),
150
+ min: z2.number().optional(),
151
+ max: z2.number().optional(),
152
+ step: z2.number().optional(),
153
+ placeholder: z2.string().optional(),
154
+ rows: z2.number().int().min(1).max(50).optional(),
155
+ unit: z2.string().max(10).optional(),
156
+ collapsed: z2.boolean().optional(),
157
+ visible_when: z2.object({ key: z2.string(), equals: z2.unknown() }).optional(),
158
+ fields: z2.array(z2.lazy(() => configFieldSchema)).optional(),
159
+ content: z2.string().optional(),
160
+ multiple: z2.boolean().optional()
136
161
  });
137
162
  var configSchemaSchema = z2.array(configFieldSchema);
138
163
  var VALID_PLATFORMS = [
139
164
  "twitch",
140
165
  "youtube",
141
166
  "kick",
142
- "trovo",
143
167
  "discord"
144
168
  ];
145
169
  var VALID_ROLES = [
@@ -170,12 +194,35 @@ var triggerConfigSchema = z2.object({
170
194
  events: z2.array(z2.string()).optional().default([]),
171
195
  timers: z2.array(triggerTimerSchema).optional().default([])
172
196
  });
197
+ var NODE_TYPES = ["trigger", "action", "logic"];
198
+ var TRIGGER_MODES = ["webhook", "polling", "both"];
199
+ var nodeTypeSchema = z2.enum(NODE_TYPES);
200
+ var triggerModeSchema = z2.enum(TRIGGER_MODES);
201
+ var automationNodeSchema = z2.object({
202
+ input_schema: z2.record(z2.string(), z2.unknown()).optional().default({}),
203
+ output_schema: z2.record(z2.string(), z2.unknown()).optional().default({}),
204
+ trigger_mode: triggerModeSchema.optional(),
205
+ poll_interval_seconds: z2.number().int().min(10).max(300).optional(),
206
+ icon: z2.string().max(100).optional(),
207
+ color: z2.string().regex(/^#[0-9a-fA-F]{6}$/).optional()
208
+ });
209
+ var lumioExtensionSoundSchema = z2.object({
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),
215
+ default_volume: z2.number().min(0).max(1).optional()
216
+ });
173
217
  var lumioExtensionConfigBaseSchema = z2.object({
174
218
  extension_id: z2.string(),
175
219
  name: z2.string(),
176
220
  description: z2.string().optional(),
221
+ icon: z2.string().max(100).optional(),
177
222
  category: extensionCategorySchema,
178
223
  version: z2.string(),
224
+ node_type: nodeTypeSchema.optional(),
225
+ node: automationNodeSchema.optional(),
179
226
  targets: z2.array(z2.enum(["editor", "layer", "interactive"])).optional().default([]),
180
227
  server: z2.boolean().optional().default(false),
181
228
  permissions: z2.array(z2.string()).optional().default([]),
@@ -184,28 +231,109 @@ var lumioExtensionConfigBaseSchema = z2.object({
184
231
  allow_ports: z2.array(z2.number())
185
232
  }).optional(),
186
233
  fonts: z2.array(z2.string()).optional().default([]),
234
+ sounds: z2.array(lumioExtensionSoundSchema).max(200).optional().default([]),
187
235
  visibility: extensionVisibilitySchema.optional().default("private"),
236
+ default_install: z2.boolean().optional().default(false),
188
237
  pricing: extensionPricingSchema.optional().default({ type: "free" }),
189
238
  config_schema: configSchemaSchema.optional(),
239
+ designer_schema: configSchemaSchema.optional(),
190
240
  platforms: z2.array(z2.enum(VALID_PLATFORMS)).optional(),
191
241
  triggers: triggerConfigSchema.optional()
192
242
  });
193
243
  var lumioExtensionConfigSchema = lumioExtensionConfigBaseSchema.superRefine((data, ctx) => {
194
- if (data.category !== "bot_module" && data.targets.length === 0) {
244
+ const isAutomationNode = data.category === "automation_node";
245
+ const isBotModule = data.category === "bot_module";
246
+ if (isAutomationNode) {
247
+ if (!data.node_type) {
248
+ ctx.addIssue({
249
+ code: "custom",
250
+ message: "automation_node extensions must specify node_type",
251
+ path: ["node_type"]
252
+ });
253
+ }
254
+ if (!data.node) {
255
+ ctx.addIssue({
256
+ code: "custom",
257
+ message: "automation_node extensions must specify node object",
258
+ path: ["node"]
259
+ });
260
+ }
261
+ if (!data.server) {
262
+ ctx.addIssue({
263
+ code: "custom",
264
+ message: "automation_node extensions must have server: true",
265
+ path: ["server"]
266
+ });
267
+ }
268
+ if (!data.targets.includes("editor")) {
269
+ ctx.addIssue({
270
+ code: "custom",
271
+ message: "automation_node extensions must include 'editor' in targets",
272
+ path: ["targets"]
273
+ });
274
+ }
275
+ }
276
+ if (isAutomationNode && data.node_type === "trigger" && data.node) {
277
+ if (!data.node.trigger_mode) {
278
+ ctx.addIssue({
279
+ code: "custom",
280
+ message: "trigger nodes must specify node.trigger_mode",
281
+ path: ["node", "trigger_mode"]
282
+ });
283
+ }
284
+ }
285
+ if (isAutomationNode && data.node_type !== "trigger" && data.node) {
286
+ if (data.node.trigger_mode) {
287
+ ctx.addIssue({
288
+ code: "custom",
289
+ message: "Only trigger nodes may specify trigger_mode",
290
+ path: ["node", "trigger_mode"]
291
+ });
292
+ }
293
+ if (data.node.poll_interval_seconds) {
294
+ ctx.addIssue({
295
+ code: "custom",
296
+ message: "Only trigger nodes may specify poll_interval_seconds",
297
+ path: ["node", "poll_interval_seconds"]
298
+ });
299
+ }
300
+ }
301
+ if (!isAutomationNode && data.node_type) {
302
+ ctx.addIssue({
303
+ code: "custom",
304
+ message: "node_type is only valid for automation_node extensions",
305
+ path: ["node_type"]
306
+ });
307
+ }
308
+ if (!isAutomationNode && data.node) {
309
+ ctx.addIssue({
310
+ code: "custom",
311
+ message: "node is only valid for automation_node extensions",
312
+ path: ["node"]
313
+ });
314
+ }
315
+ if (!isBotModule && !isAutomationNode && data.targets.length === 0) {
195
316
  ctx.addIssue({
196
317
  code: "custom",
197
318
  message: "Non-bot_module extensions must have at least one target",
198
319
  path: ["targets"]
199
320
  });
200
321
  }
201
- if (data.triggers && data.category !== "bot_module") {
322
+ if (data.triggers && !isBotModule) {
202
323
  ctx.addIssue({
203
324
  code: "custom",
204
325
  message: "Only bot_module extensions can have triggers",
205
326
  path: ["triggers"]
206
327
  });
207
328
  }
208
- if (data.category === "bot_module" && (!data.platforms || data.platforms.length === 0)) {
329
+ if (data.default_install) {
330
+ ctx.addIssue({
331
+ code: "custom",
332
+ message: "default_install is reserved for system extensions and cannot be set by third-party developers",
333
+ path: ["default_install"]
334
+ });
335
+ }
336
+ if (isBotModule && (!data.platforms || data.platforms.length === 0)) {
209
337
  ctx.addIssue({
210
338
  code: "custom",
211
339
  message: "bot_module extensions must specify platforms",
@@ -229,6 +357,11 @@ var developerVerificationStatusSchema = z3.enum(
229
357
  var developerProfileSchema = z3.object({
230
358
  id: z3.string(),
231
359
  user_id: z3.string(),
360
+ description: z3.string().nullable(),
361
+ slug: z3.string().nullable(),
362
+ github_url: z3.string().nullable(),
363
+ website_url: z3.string().nullable(),
364
+ avatar_key: z3.string().nullable(),
232
365
  stripe_connect_id: z3.string().nullable(),
233
366
  paypal_email: z3.string().nullable(),
234
367
  bank_iban: z3.string().nullable(),
@@ -244,27 +377,65 @@ var developerTeamSchema = z3.object({
244
377
  id: z3.string(),
245
378
  name: z3.string(),
246
379
  slug: z3.string(),
380
+ description: z3.string().nullable(),
381
+ github_url: z3.string().nullable(),
382
+ website_url: z3.string().nullable(),
383
+ avatar_key: z3.string().nullable(),
247
384
  owner_id: z3.string(),
248
385
  created_at: z3.string(),
249
386
  updated_at: z3.string()
250
387
  });
251
- var DEVELOPER_TEAM_ROLES = ["owner", "admin", "member"];
252
- var developerTeamRoleSchema = z3.enum(DEVELOPER_TEAM_ROLES);
388
+ var developerTeamRoleSchema = z3.object({
389
+ id: z3.string(),
390
+ team_id: z3.string(),
391
+ name: z3.string(),
392
+ slug: z3.string(),
393
+ description: z3.string().nullable(),
394
+ is_default: z3.boolean(),
395
+ is_system: z3.boolean(),
396
+ color: z3.string().nullable(),
397
+ sort_order: z3.number(),
398
+ permission_count: z3.number(),
399
+ member_count: z3.number(),
400
+ created_at: z3.string(),
401
+ updated_at: z3.string()
402
+ });
403
+ var developerTeamMemberSchema = z3.object({
404
+ id: z3.string(),
405
+ team_id: z3.string(),
406
+ user_id: z3.string(),
407
+ role_id: z3.string(),
408
+ role_name: z3.string(),
409
+ role_slug: z3.string(),
410
+ role_color: z3.string().nullable(),
411
+ display_name: z3.string(),
412
+ email: z3.string(),
413
+ avatar_url: z3.string().nullable(),
414
+ created_at: z3.string()
415
+ });
416
+ var developerTeamPermissionSchema = z3.object({
417
+ key: z3.string(),
418
+ category: z3.string()
419
+ });
253
420
  export {
254
421
  CONFIG_FIELD_TYPES,
255
- DEVELOPER_TEAM_ROLES,
256
422
  DEVELOPER_TYPES,
257
423
  DEVELOPER_VERIFICATION_STATUSES,
258
424
  EXTENSION_CATEGORIES,
259
425
  EXTENSION_STATUSES,
260
426
  EXTENSION_VISIBILITIES,
427
+ NODE_TYPES,
261
428
  PRICING_TYPES,
429
+ TRIGGER_MODES,
262
430
  VALID_PLATFORMS,
263
431
  VALID_ROLES,
264
432
  VERSION_STATUSES,
433
+ automationNodeSchema,
265
434
  configFieldSchema,
266
435
  configSchemaSchema,
267
436
  developerProfileSchema,
437
+ developerTeamMemberSchema,
438
+ developerTeamPermissionSchema,
268
439
  developerTeamRoleSchema,
269
440
  developerTeamSchema,
270
441
  developerTypeSchema,
@@ -279,9 +450,12 @@ export {
279
450
  extensionVisibilitySchema,
280
451
  lumioExtensionConfigBaseSchema,
281
452
  lumioExtensionConfigSchema,
453
+ lumioExtensionSoundSchema,
454
+ nodeTypeSchema,
282
455
  pricingTypeSchema,
283
456
  triggerCommandSchema,
284
457
  triggerConfigSchema,
458
+ triggerModeSchema,
285
459
  triggerTimerSchema,
286
460
  versionStatusSchema
287
461
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaflun/lumio-extension-types",
3
- "version": "0.3.0",
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",