@zaflun/lumio-extension-types 0.1.0 → 0.3.2

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 +321 -53
  2. package/dist/index.js +248 -10
  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,40 +162,225 @@ 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>>;
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>>>;
189
+ type ConfigSchema = z.infer<typeof configSchemaSchema>;
190
+ declare const VALID_PLATFORMS: readonly ["twitch", "youtube", "kick", "trovo", "discord"];
191
+ declare const VALID_ROLES: readonly ["everyone", "follower", "subscriber", "vip", "moderator", "broadcaster"];
192
+ declare const triggerCommandSchema: z.ZodObject<{
193
+ name: z.ZodString;
194
+ description: z.ZodString;
195
+ cooldown_global: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
196
+ cooldown_user: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
197
+ min_role: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
198
+ everyone: "everyone";
199
+ follower: "follower";
200
+ subscriber: "subscriber";
201
+ vip: "vip";
202
+ moderator: "moderator";
203
+ broadcaster: "broadcaster";
204
+ }>>>;
205
+ discord_options: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnknown>>>;
176
206
  }, 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";
207
+ declare const triggerTimerSchema: z.ZodObject<{
208
+ name: z.ZodString;
209
+ interval: z.ZodNumber;
210
+ handler: z.ZodString;
211
+ }, z.core.$strip>;
212
+ declare const triggerConfigSchema: z.ZodObject<{
213
+ commands: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
214
+ name: z.ZodString;
215
+ description: z.ZodString;
216
+ cooldown_global: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
217
+ cooldown_user: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
218
+ min_role: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
219
+ everyone: "everyone";
220
+ follower: "follower";
221
+ subscriber: "subscriber";
222
+ vip: "vip";
223
+ moderator: "moderator";
224
+ broadcaster: "broadcaster";
225
+ }>>>;
226
+ discord_options: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnknown>>>;
227
+ }, z.core.$strip>>>>;
228
+ keywords: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
229
+ patterns: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
230
+ events: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
231
+ timers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
232
+ name: z.ZodString;
233
+ interval: z.ZodNumber;
234
+ handler: z.ZodString;
235
+ }, z.core.$strip>>>>;
236
+ }, z.core.$strip>;
237
+ type TriggerConfig = z.infer<typeof triggerConfigSchema>;
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
+ declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
277
+ extension_id: z.ZodString;
278
+ name: z.ZodString;
279
+ description: z.ZodOptional<z.ZodString>;
280
+ icon: z.ZodOptional<z.ZodString>;
281
+ category: z.ZodEnum<{
282
+ widget: "widget";
283
+ extension: "extension";
284
+ overlay: "overlay";
285
+ bot_module: "bot_module";
286
+ integration: "integration";
287
+ theme: "theme";
288
+ automation_node: "automation_node";
186
289
  }>;
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>>;
192
- type ConfigSchema = z.infer<typeof configSchemaSchema>;
290
+ version: z.ZodString;
291
+ node_type: z.ZodOptional<z.ZodEnum<{
292
+ trigger: "trigger";
293
+ action: "action";
294
+ logic: "logic";
295
+ }>>;
296
+ node: z.ZodOptional<z.ZodObject<{
297
+ input_schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
298
+ output_schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
299
+ trigger_mode: z.ZodOptional<z.ZodEnum<{
300
+ webhook: "webhook";
301
+ polling: "polling";
302
+ both: "both";
303
+ }>>;
304
+ poll_interval_seconds: z.ZodOptional<z.ZodNumber>;
305
+ icon: z.ZodOptional<z.ZodString>;
306
+ color: z.ZodOptional<z.ZodString>;
307
+ }, z.core.$strip>>;
308
+ targets: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<{
309
+ editor: "editor";
310
+ layer: "layer";
311
+ interactive: "interactive";
312
+ }>>>>;
313
+ server: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
314
+ permissions: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
315
+ egress: z.ZodOptional<z.ZodObject<{
316
+ allow_hosts: z.ZodArray<z.ZodString>;
317
+ allow_ports: z.ZodArray<z.ZodNumber>;
318
+ }, z.core.$strip>>;
319
+ fonts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
320
+ sounds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
321
+ file: z.ZodString;
322
+ name: z.ZodString;
323
+ default_volume: z.ZodOptional<z.ZodNumber>;
324
+ }, z.core.$strip>>>>;
325
+ visibility: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
326
+ private: "private";
327
+ unlisted: "unlisted";
328
+ public: "public";
329
+ paid: "paid";
330
+ }>>>;
331
+ default_install: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
332
+ pricing: z.ZodDefault<z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
333
+ type: z.ZodLiteral<"free">;
334
+ }, z.core.$strip>, z.ZodObject<{
335
+ type: z.ZodLiteral<"one_time">;
336
+ amount: z.ZodNumber;
337
+ currency: z.ZodString;
338
+ }, z.core.$strip>, z.ZodObject<{
339
+ type: z.ZodLiteral<"subscription">;
340
+ amount: z.ZodNumber;
341
+ currency: z.ZodString;
342
+ interval: z.ZodString;
343
+ }, z.core.$strip>], "type">>>;
344
+ config_schema: z.ZodOptional<z.ZodArray<z.ZodType<ConfigField, unknown, z.core.$ZodTypeInternals<ConfigField, unknown>>>>;
345
+ designer_schema: z.ZodOptional<z.ZodArray<z.ZodType<ConfigField, unknown, z.core.$ZodTypeInternals<ConfigField, unknown>>>>;
346
+ platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
347
+ twitch: "twitch";
348
+ youtube: "youtube";
349
+ kick: "kick";
350
+ trovo: "trovo";
351
+ discord: "discord";
352
+ }>>>;
353
+ triggers: z.ZodOptional<z.ZodObject<{
354
+ commands: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
355
+ name: z.ZodString;
356
+ description: z.ZodString;
357
+ cooldown_global: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
358
+ cooldown_user: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
359
+ min_role: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
360
+ everyone: "everyone";
361
+ follower: "follower";
362
+ subscriber: "subscriber";
363
+ vip: "vip";
364
+ moderator: "moderator";
365
+ broadcaster: "broadcaster";
366
+ }>>>;
367
+ discord_options: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnknown>>>;
368
+ }, z.core.$strip>>>>;
369
+ keywords: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
370
+ patterns: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
371
+ events: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
372
+ timers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
373
+ name: z.ZodString;
374
+ interval: z.ZodNumber;
375
+ handler: z.ZodString;
376
+ }, z.core.$strip>>>>;
377
+ }, z.core.$strip>>;
378
+ }, z.core.$strip>;
193
379
  declare const lumioExtensionConfigSchema: z.ZodObject<{
194
380
  extension_id: z.ZodString;
195
381
  name: z.ZodString;
196
382
  description: z.ZodOptional<z.ZodString>;
383
+ icon: z.ZodOptional<z.ZodString>;
197
384
  category: z.ZodEnum<{
198
385
  widget: "widget";
199
386
  extension: "extension";
@@ -201,13 +388,31 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
201
388
  bot_module: "bot_module";
202
389
  integration: "integration";
203
390
  theme: "theme";
391
+ automation_node: "automation_node";
204
392
  }>;
205
393
  version: z.ZodString;
206
- targets: z.ZodArray<z.ZodEnum<{
394
+ node_type: z.ZodOptional<z.ZodEnum<{
395
+ trigger: "trigger";
396
+ action: "action";
397
+ logic: "logic";
398
+ }>>;
399
+ node: z.ZodOptional<z.ZodObject<{
400
+ input_schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
401
+ output_schema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
402
+ trigger_mode: z.ZodOptional<z.ZodEnum<{
403
+ webhook: "webhook";
404
+ polling: "polling";
405
+ both: "both";
406
+ }>>;
407
+ poll_interval_seconds: z.ZodOptional<z.ZodNumber>;
408
+ icon: z.ZodOptional<z.ZodString>;
409
+ color: z.ZodOptional<z.ZodString>;
410
+ }, z.core.$strip>>;
411
+ targets: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<{
207
412
  editor: "editor";
208
413
  layer: "layer";
209
414
  interactive: "interactive";
210
- }>>;
415
+ }>>>>;
211
416
  server: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
212
417
  permissions: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
213
418
  egress: z.ZodOptional<z.ZodObject<{
@@ -215,12 +420,18 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
215
420
  allow_ports: z.ZodArray<z.ZodNumber>;
216
421
  }, z.core.$strip>>;
217
422
  fonts: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
423
+ sounds: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
424
+ file: z.ZodString;
425
+ name: z.ZodString;
426
+ default_volume: z.ZodOptional<z.ZodNumber>;
427
+ }, z.core.$strip>>>>;
218
428
  visibility: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
219
429
  private: "private";
220
430
  unlisted: "unlisted";
221
431
  public: "public";
222
432
  paid: "paid";
223
433
  }>>>;
434
+ default_install: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
224
435
  pricing: z.ZodDefault<z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
225
436
  type: z.ZodLiteral<"free">;
226
437
  }, z.core.$strip>, z.ZodObject<{
@@ -233,20 +444,40 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
233
444
  currency: z.ZodString;
234
445
  interval: z.ZodString;
235
446
  }, z.core.$strip>], "type">>>;
236
- config_schema: z.ZodOptional<z.ZodArray<z.ZodObject<{
237
- key: z.ZodString;
238
- type: z.ZodEnum<{
239
- string: "string";
240
- number: "number";
241
- boolean: "boolean";
242
- color: "color";
243
- select: "select";
244
- }>;
245
- label: z.ZodString;
246
- default_value: z.ZodUnknown;
247
- required: z.ZodBoolean;
248
- options: z.ZodOptional<z.ZodArray<z.ZodString>>;
249
- }, z.core.$strip>>>;
447
+ config_schema: z.ZodOptional<z.ZodArray<z.ZodType<ConfigField, unknown, z.core.$ZodTypeInternals<ConfigField, unknown>>>>;
448
+ designer_schema: z.ZodOptional<z.ZodArray<z.ZodType<ConfigField, unknown, z.core.$ZodTypeInternals<ConfigField, unknown>>>>;
449
+ platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
450
+ twitch: "twitch";
451
+ youtube: "youtube";
452
+ kick: "kick";
453
+ trovo: "trovo";
454
+ discord: "discord";
455
+ }>>>;
456
+ triggers: z.ZodOptional<z.ZodObject<{
457
+ commands: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
458
+ name: z.ZodString;
459
+ description: z.ZodString;
460
+ cooldown_global: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
461
+ cooldown_user: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
462
+ min_role: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
463
+ everyone: "everyone";
464
+ follower: "follower";
465
+ subscriber: "subscriber";
466
+ vip: "vip";
467
+ moderator: "moderator";
468
+ broadcaster: "broadcaster";
469
+ }>>>;
470
+ discord_options: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodUnknown>>>;
471
+ }, z.core.$strip>>>>;
472
+ keywords: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
473
+ patterns: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
474
+ events: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
475
+ timers: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
476
+ name: z.ZodString;
477
+ interval: z.ZodNumber;
478
+ handler: z.ZodString;
479
+ }, z.core.$strip>>>>;
480
+ }, z.core.$strip>>;
250
481
  }, z.core.$strip>;
251
482
  type LumioExtensionConfig = z.infer<typeof lumioExtensionConfigSchema>;
252
483
 
@@ -266,6 +497,11 @@ type DeveloperVerificationStatus = z.infer<typeof developerVerificationStatusSch
266
497
  declare const developerProfileSchema: z.ZodObject<{
267
498
  id: z.ZodString;
268
499
  user_id: z.ZodString;
500
+ description: z.ZodNullable<z.ZodString>;
501
+ slug: z.ZodNullable<z.ZodString>;
502
+ github_url: z.ZodNullable<z.ZodString>;
503
+ website_url: z.ZodNullable<z.ZodString>;
504
+ avatar_key: z.ZodNullable<z.ZodString>;
269
505
  stripe_connect_id: z.ZodNullable<z.ZodString>;
270
506
  paypal_email: z.ZodNullable<z.ZodString>;
271
507
  bank_iban: z.ZodNullable<z.ZodString>;
@@ -286,17 +522,49 @@ declare const developerTeamSchema: z.ZodObject<{
286
522
  id: z.ZodString;
287
523
  name: z.ZodString;
288
524
  slug: z.ZodString;
525
+ description: z.ZodNullable<z.ZodString>;
526
+ github_url: z.ZodNullable<z.ZodString>;
527
+ website_url: z.ZodNullable<z.ZodString>;
528
+ avatar_key: z.ZodNullable<z.ZodString>;
289
529
  owner_id: z.ZodString;
290
530
  created_at: z.ZodString;
291
531
  updated_at: z.ZodString;
292
532
  }, z.core.$strip>;
293
533
  type DeveloperTeam = z.infer<typeof developerTeamSchema>;
294
- declare const DEVELOPER_TEAM_ROLES: readonly ["owner", "admin", "member"];
295
- declare const developerTeamRoleSchema: z.ZodEnum<{
296
- owner: "owner";
297
- admin: "admin";
298
- member: "member";
299
- }>;
534
+ declare const developerTeamRoleSchema: z.ZodObject<{
535
+ id: z.ZodString;
536
+ team_id: z.ZodString;
537
+ name: z.ZodString;
538
+ slug: z.ZodString;
539
+ description: z.ZodNullable<z.ZodString>;
540
+ is_default: z.ZodBoolean;
541
+ is_system: z.ZodBoolean;
542
+ color: z.ZodNullable<z.ZodString>;
543
+ sort_order: z.ZodNumber;
544
+ permission_count: z.ZodNumber;
545
+ member_count: z.ZodNumber;
546
+ created_at: z.ZodString;
547
+ updated_at: z.ZodString;
548
+ }, z.core.$strip>;
300
549
  type DeveloperTeamRole = z.infer<typeof developerTeamRoleSchema>;
550
+ declare const developerTeamMemberSchema: z.ZodObject<{
551
+ id: z.ZodString;
552
+ team_id: z.ZodString;
553
+ user_id: z.ZodString;
554
+ role_id: z.ZodString;
555
+ role_name: z.ZodString;
556
+ role_slug: z.ZodString;
557
+ role_color: z.ZodNullable<z.ZodString>;
558
+ display_name: z.ZodString;
559
+ email: z.ZodString;
560
+ avatar_url: z.ZodNullable<z.ZodString>;
561
+ created_at: z.ZodString;
562
+ }, z.core.$strip>;
563
+ type DeveloperTeamMember = z.infer<typeof developerTeamMemberSchema>;
564
+ declare const developerTeamPermissionSchema: z.ZodObject<{
565
+ key: z.ZodString;
566
+ category: z.ZodString;
567
+ }, z.core.$strip>;
568
+ type DeveloperTeamPermission = z.infer<typeof developerTeamPermissionSchema>;
301
569
 
302
- 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, VERSION_STATUSES, type VersionStatus, configFieldSchema, configSchemaSchema, developerProfileSchema, developerTeamRoleSchema, developerTeamSchema, developerTypeSchema, developerVerificationStatusSchema, extensionCategorySchema, extensionInstallSchema, extensionPricingSchema, extensionReviewSchema, extensionSchema, extensionStatusSchema, extensionVersionSchema, extensionVisibilitySchema, lumioExtensionConfigSchema, pricingTypeSchema, versionStatusSchema };
570
+ 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,18 +144,84 @@ 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
- var lumioExtensionConfigSchema = z2.object({
163
+ var VALID_PLATFORMS = [
164
+ "twitch",
165
+ "youtube",
166
+ "kick",
167
+ "trovo",
168
+ "discord"
169
+ ];
170
+ var VALID_ROLES = [
171
+ "everyone",
172
+ "follower",
173
+ "subscriber",
174
+ "vip",
175
+ "moderator",
176
+ "broadcaster"
177
+ ];
178
+ var triggerCommandSchema = z2.object({
179
+ name: z2.string().min(1).max(32).regex(/^[a-zA-Z0-9_]+$/),
180
+ description: z2.string(),
181
+ cooldown_global: z2.number().int().min(0).optional().default(0),
182
+ cooldown_user: z2.number().int().min(0).optional().default(0),
183
+ min_role: z2.enum(VALID_ROLES).optional().default("everyone"),
184
+ discord_options: z2.array(z2.unknown()).optional().default([])
185
+ });
186
+ var triggerTimerSchema = z2.object({
187
+ name: z2.string(),
188
+ interval: z2.number().int().min(60),
189
+ handler: z2.string()
190
+ });
191
+ var triggerConfigSchema = z2.object({
192
+ commands: z2.array(triggerCommandSchema).max(20).optional().default([]),
193
+ keywords: z2.array(z2.string().min(3)).max(50).optional().default([]),
194
+ patterns: z2.array(z2.string().max(200)).max(10).optional().default([]),
195
+ events: z2.array(z2.string()).optional().default([]),
196
+ timers: z2.array(triggerTimerSchema).optional().default([])
197
+ });
198
+ var NODE_TYPES = ["trigger", "action", "logic"];
199
+ var TRIGGER_MODES = ["webhook", "polling", "both"];
200
+ var nodeTypeSchema = z2.enum(NODE_TYPES);
201
+ var triggerModeSchema = z2.enum(TRIGGER_MODES);
202
+ var automationNodeSchema = z2.object({
203
+ input_schema: z2.record(z2.string(), z2.unknown()).optional().default({}),
204
+ output_schema: z2.record(z2.string(), z2.unknown()).optional().default({}),
205
+ trigger_mode: triggerModeSchema.optional(),
206
+ poll_interval_seconds: z2.number().int().min(10).max(300).optional(),
207
+ icon: z2.string().max(100).optional(),
208
+ color: z2.string().regex(/^#[0-9a-fA-F]{6}$/).optional()
209
+ });
210
+ var lumioExtensionSoundSchema = z2.object({
211
+ file: z2.string(),
212
+ name: z2.string(),
213
+ default_volume: z2.number().min(0).max(1).optional()
214
+ });
215
+ var lumioExtensionConfigBaseSchema = z2.object({
139
216
  extension_id: z2.string(),
140
217
  name: z2.string(),
141
218
  description: z2.string().optional(),
219
+ icon: z2.string().max(100).optional(),
142
220
  category: extensionCategorySchema,
143
221
  version: z2.string(),
144
- targets: z2.array(z2.enum(["editor", "layer", "interactive"])).min(1),
222
+ node_type: nodeTypeSchema.optional(),
223
+ node: automationNodeSchema.optional(),
224
+ targets: z2.array(z2.enum(["editor", "layer", "interactive"])).optional().default([]),
145
225
  server: z2.boolean().optional().default(false),
146
226
  permissions: z2.array(z2.string()).optional().default([]),
147
227
  egress: z2.object({
@@ -149,9 +229,115 @@ var lumioExtensionConfigSchema = z2.object({
149
229
  allow_ports: z2.array(z2.number())
150
230
  }).optional(),
151
231
  fonts: z2.array(z2.string()).optional().default([]),
232
+ sounds: z2.array(lumioExtensionSoundSchema).optional().default([]),
152
233
  visibility: extensionVisibilitySchema.optional().default("private"),
234
+ default_install: z2.boolean().optional().default(false),
153
235
  pricing: extensionPricingSchema.optional().default({ type: "free" }),
154
- config_schema: configSchemaSchema.optional()
236
+ config_schema: configSchemaSchema.optional(),
237
+ designer_schema: configSchemaSchema.optional(),
238
+ platforms: z2.array(z2.enum(VALID_PLATFORMS)).optional(),
239
+ triggers: triggerConfigSchema.optional()
240
+ });
241
+ var lumioExtensionConfigSchema = lumioExtensionConfigBaseSchema.superRefine((data, ctx) => {
242
+ const isAutomationNode = data.category === "automation_node";
243
+ const isBotModule = data.category === "bot_module";
244
+ if (isAutomationNode) {
245
+ if (!data.node_type) {
246
+ ctx.addIssue({
247
+ code: "custom",
248
+ message: "automation_node extensions must specify node_type",
249
+ path: ["node_type"]
250
+ });
251
+ }
252
+ if (!data.node) {
253
+ ctx.addIssue({
254
+ code: "custom",
255
+ message: "automation_node extensions must specify node object",
256
+ path: ["node"]
257
+ });
258
+ }
259
+ if (!data.server) {
260
+ ctx.addIssue({
261
+ code: "custom",
262
+ message: "automation_node extensions must have server: true",
263
+ path: ["server"]
264
+ });
265
+ }
266
+ if (!data.targets.includes("editor")) {
267
+ ctx.addIssue({
268
+ code: "custom",
269
+ message: "automation_node extensions must include 'editor' in targets",
270
+ path: ["targets"]
271
+ });
272
+ }
273
+ }
274
+ if (isAutomationNode && data.node_type === "trigger" && data.node) {
275
+ if (!data.node.trigger_mode) {
276
+ ctx.addIssue({
277
+ code: "custom",
278
+ message: "trigger nodes must specify node.trigger_mode",
279
+ path: ["node", "trigger_mode"]
280
+ });
281
+ }
282
+ }
283
+ if (isAutomationNode && data.node_type !== "trigger" && data.node) {
284
+ if (data.node.trigger_mode) {
285
+ ctx.addIssue({
286
+ code: "custom",
287
+ message: "Only trigger nodes may specify trigger_mode",
288
+ path: ["node", "trigger_mode"]
289
+ });
290
+ }
291
+ if (data.node.poll_interval_seconds) {
292
+ ctx.addIssue({
293
+ code: "custom",
294
+ message: "Only trigger nodes may specify poll_interval_seconds",
295
+ path: ["node", "poll_interval_seconds"]
296
+ });
297
+ }
298
+ }
299
+ if (!isAutomationNode && data.node_type) {
300
+ ctx.addIssue({
301
+ code: "custom",
302
+ message: "node_type is only valid for automation_node extensions",
303
+ path: ["node_type"]
304
+ });
305
+ }
306
+ if (!isAutomationNode && data.node) {
307
+ ctx.addIssue({
308
+ code: "custom",
309
+ message: "node is only valid for automation_node extensions",
310
+ path: ["node"]
311
+ });
312
+ }
313
+ if (!isBotModule && !isAutomationNode && data.targets.length === 0) {
314
+ ctx.addIssue({
315
+ code: "custom",
316
+ message: "Non-bot_module extensions must have at least one target",
317
+ path: ["targets"]
318
+ });
319
+ }
320
+ if (data.triggers && !isBotModule) {
321
+ ctx.addIssue({
322
+ code: "custom",
323
+ message: "Only bot_module extensions can have triggers",
324
+ path: ["triggers"]
325
+ });
326
+ }
327
+ if (data.default_install) {
328
+ ctx.addIssue({
329
+ code: "custom",
330
+ message: "default_install is reserved for system extensions and cannot be set by third-party developers",
331
+ path: ["default_install"]
332
+ });
333
+ }
334
+ if (isBotModule && (!data.platforms || data.platforms.length === 0)) {
335
+ ctx.addIssue({
336
+ code: "custom",
337
+ message: "bot_module extensions must specify platforms",
338
+ path: ["platforms"]
339
+ });
340
+ }
155
341
  });
156
342
 
157
343
  // src/developer.ts
@@ -169,6 +355,11 @@ var developerVerificationStatusSchema = z3.enum(
169
355
  var developerProfileSchema = z3.object({
170
356
  id: z3.string(),
171
357
  user_id: z3.string(),
358
+ description: z3.string().nullable(),
359
+ slug: z3.string().nullable(),
360
+ github_url: z3.string().nullable(),
361
+ website_url: z3.string().nullable(),
362
+ avatar_key: z3.string().nullable(),
172
363
  stripe_connect_id: z3.string().nullable(),
173
364
  paypal_email: z3.string().nullable(),
174
365
  bank_iban: z3.string().nullable(),
@@ -184,25 +375,65 @@ var developerTeamSchema = z3.object({
184
375
  id: z3.string(),
185
376
  name: z3.string(),
186
377
  slug: z3.string(),
378
+ description: z3.string().nullable(),
379
+ github_url: z3.string().nullable(),
380
+ website_url: z3.string().nullable(),
381
+ avatar_key: z3.string().nullable(),
187
382
  owner_id: z3.string(),
188
383
  created_at: z3.string(),
189
384
  updated_at: z3.string()
190
385
  });
191
- var DEVELOPER_TEAM_ROLES = ["owner", "admin", "member"];
192
- var developerTeamRoleSchema = z3.enum(DEVELOPER_TEAM_ROLES);
386
+ var developerTeamRoleSchema = z3.object({
387
+ id: z3.string(),
388
+ team_id: z3.string(),
389
+ name: z3.string(),
390
+ slug: z3.string(),
391
+ description: z3.string().nullable(),
392
+ is_default: z3.boolean(),
393
+ is_system: z3.boolean(),
394
+ color: z3.string().nullable(),
395
+ sort_order: z3.number(),
396
+ permission_count: z3.number(),
397
+ member_count: z3.number(),
398
+ created_at: z3.string(),
399
+ updated_at: z3.string()
400
+ });
401
+ var developerTeamMemberSchema = z3.object({
402
+ id: z3.string(),
403
+ team_id: z3.string(),
404
+ user_id: z3.string(),
405
+ role_id: z3.string(),
406
+ role_name: z3.string(),
407
+ role_slug: z3.string(),
408
+ role_color: z3.string().nullable(),
409
+ display_name: z3.string(),
410
+ email: z3.string(),
411
+ avatar_url: z3.string().nullable(),
412
+ created_at: z3.string()
413
+ });
414
+ var developerTeamPermissionSchema = z3.object({
415
+ key: z3.string(),
416
+ category: z3.string()
417
+ });
193
418
  export {
194
419
  CONFIG_FIELD_TYPES,
195
- DEVELOPER_TEAM_ROLES,
196
420
  DEVELOPER_TYPES,
197
421
  DEVELOPER_VERIFICATION_STATUSES,
198
422
  EXTENSION_CATEGORIES,
199
423
  EXTENSION_STATUSES,
200
424
  EXTENSION_VISIBILITIES,
425
+ NODE_TYPES,
201
426
  PRICING_TYPES,
427
+ TRIGGER_MODES,
428
+ VALID_PLATFORMS,
429
+ VALID_ROLES,
202
430
  VERSION_STATUSES,
431
+ automationNodeSchema,
203
432
  configFieldSchema,
204
433
  configSchemaSchema,
205
434
  developerProfileSchema,
435
+ developerTeamMemberSchema,
436
+ developerTeamPermissionSchema,
206
437
  developerTeamRoleSchema,
207
438
  developerTeamSchema,
208
439
  developerTypeSchema,
@@ -215,7 +446,14 @@ export {
215
446
  extensionStatusSchema,
216
447
  extensionVersionSchema,
217
448
  extensionVisibilitySchema,
449
+ lumioExtensionConfigBaseSchema,
218
450
  lumioExtensionConfigSchema,
451
+ lumioExtensionSoundSchema,
452
+ nodeTypeSchema,
219
453
  pricingTypeSchema,
454
+ triggerCommandSchema,
455
+ triggerConfigSchema,
456
+ triggerModeSchema,
457
+ triggerTimerSchema,
220
458
  versionStatusSchema
221
459
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zaflun/lumio-extension-types",
3
- "version": "0.1.0",
3
+ "version": "0.3.2",
4
4
  "description": "Shared TypeScript types for Lumio extensions, store, and config",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",