@zaflun/lumio-extension-types 0.3.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 +163 -66
  2. package/dist/index.js +182 -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,35 +162,30 @@ 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
190
  declare const VALID_PLATFORMS: readonly ["twitch", "youtube", "kick", "trovo", "discord"];
194
191
  declare const VALID_ROLES: readonly ["everyone", "follower", "subscriber", "vip", "moderator", "broadcaster"];
@@ -239,10 +236,48 @@ 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>;
242
276
  declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
243
277
  extension_id: z.ZodString;
244
278
  name: z.ZodString;
245
279
  description: z.ZodOptional<z.ZodString>;
280
+ icon: z.ZodOptional<z.ZodString>;
246
281
  category: z.ZodEnum<{
247
282
  widget: "widget";
248
283
  extension: "extension";
@@ -250,8 +285,26 @@ declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
250
285
  bot_module: "bot_module";
251
286
  integration: "integration";
252
287
  theme: "theme";
288
+ automation_node: "automation_node";
253
289
  }>;
254
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>>;
255
308
  targets: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<{
256
309
  editor: "editor";
257
310
  layer: "layer";
@@ -264,12 +317,18 @@ declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
264
317
  allow_ports: z.ZodArray<z.ZodNumber>;
265
318
  }, z.core.$strip>>;
266
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>>>>;
267
325
  visibility: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
268
326
  private: "private";
269
327
  unlisted: "unlisted";
270
328
  public: "public";
271
329
  paid: "paid";
272
330
  }>>>;
331
+ default_install: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
273
332
  pricing: z.ZodDefault<z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
274
333
  type: z.ZodLiteral<"free">;
275
334
  }, z.core.$strip>, z.ZodObject<{
@@ -282,20 +341,8 @@ declare const lumioExtensionConfigBaseSchema: z.ZodObject<{
282
341
  currency: z.ZodString;
283
342
  interval: z.ZodString;
284
343
  }, 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>>>;
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>>>>;
299
346
  platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
300
347
  twitch: "twitch";
301
348
  youtube: "youtube";
@@ -333,6 +380,7 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
333
380
  extension_id: z.ZodString;
334
381
  name: z.ZodString;
335
382
  description: z.ZodOptional<z.ZodString>;
383
+ icon: z.ZodOptional<z.ZodString>;
336
384
  category: z.ZodEnum<{
337
385
  widget: "widget";
338
386
  extension: "extension";
@@ -340,8 +388,26 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
340
388
  bot_module: "bot_module";
341
389
  integration: "integration";
342
390
  theme: "theme";
391
+ automation_node: "automation_node";
343
392
  }>;
344
393
  version: z.ZodString;
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>>;
345
411
  targets: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodEnum<{
346
412
  editor: "editor";
347
413
  layer: "layer";
@@ -354,12 +420,18 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
354
420
  allow_ports: z.ZodArray<z.ZodNumber>;
355
421
  }, z.core.$strip>>;
356
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>>>>;
357
428
  visibility: z.ZodDefault<z.ZodOptional<z.ZodEnum<{
358
429
  private: "private";
359
430
  unlisted: "unlisted";
360
431
  public: "public";
361
432
  paid: "paid";
362
433
  }>>>;
434
+ default_install: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
363
435
  pricing: z.ZodDefault<z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
364
436
  type: z.ZodLiteral<"free">;
365
437
  }, z.core.$strip>, z.ZodObject<{
@@ -372,20 +444,8 @@ declare const lumioExtensionConfigSchema: z.ZodObject<{
372
444
  currency: z.ZodString;
373
445
  interval: z.ZodString;
374
446
  }, 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>>>;
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>>>>;
389
449
  platforms: z.ZodOptional<z.ZodArray<z.ZodEnum<{
390
450
  twitch: "twitch";
391
451
  youtube: "youtube";
@@ -437,6 +497,11 @@ type DeveloperVerificationStatus = z.infer<typeof developerVerificationStatusSch
437
497
  declare const developerProfileSchema: z.ZodObject<{
438
498
  id: z.ZodString;
439
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>;
440
505
  stripe_connect_id: z.ZodNullable<z.ZodString>;
441
506
  paypal_email: z.ZodNullable<z.ZodString>;
442
507
  bank_iban: z.ZodNullable<z.ZodString>;
@@ -457,17 +522,49 @@ declare const developerTeamSchema: z.ZodObject<{
457
522
  id: z.ZodString;
458
523
  name: z.ZodString;
459
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>;
460
529
  owner_id: z.ZodString;
461
530
  created_at: z.ZodString;
462
531
  updated_at: z.ZodString;
463
532
  }, z.core.$strip>;
464
533
  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
- }>;
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>;
471
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>;
472
569
 
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 };
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,9 +144,20 @@ 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 = [
@@ -170,12 +195,32 @@ var triggerConfigSchema = z2.object({
170
195
  events: z2.array(z2.string()).optional().default([]),
171
196
  timers: z2.array(triggerTimerSchema).optional().default([])
172
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
+ });
173
215
  var lumioExtensionConfigBaseSchema = z2.object({
174
216
  extension_id: z2.string(),
175
217
  name: z2.string(),
176
218
  description: z2.string().optional(),
219
+ icon: z2.string().max(100).optional(),
177
220
  category: extensionCategorySchema,
178
221
  version: z2.string(),
222
+ node_type: nodeTypeSchema.optional(),
223
+ node: automationNodeSchema.optional(),
179
224
  targets: z2.array(z2.enum(["editor", "layer", "interactive"])).optional().default([]),
180
225
  server: z2.boolean().optional().default(false),
181
226
  permissions: z2.array(z2.string()).optional().default([]),
@@ -184,28 +229,109 @@ var lumioExtensionConfigBaseSchema = z2.object({
184
229
  allow_ports: z2.array(z2.number())
185
230
  }).optional(),
186
231
  fonts: z2.array(z2.string()).optional().default([]),
232
+ sounds: z2.array(lumioExtensionSoundSchema).optional().default([]),
187
233
  visibility: extensionVisibilitySchema.optional().default("private"),
234
+ default_install: z2.boolean().optional().default(false),
188
235
  pricing: extensionPricingSchema.optional().default({ type: "free" }),
189
236
  config_schema: configSchemaSchema.optional(),
237
+ designer_schema: configSchemaSchema.optional(),
190
238
  platforms: z2.array(z2.enum(VALID_PLATFORMS)).optional(),
191
239
  triggers: triggerConfigSchema.optional()
192
240
  });
193
241
  var lumioExtensionConfigSchema = lumioExtensionConfigBaseSchema.superRefine((data, ctx) => {
194
- if (data.category !== "bot_module" && data.targets.length === 0) {
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) {
195
314
  ctx.addIssue({
196
315
  code: "custom",
197
316
  message: "Non-bot_module extensions must have at least one target",
198
317
  path: ["targets"]
199
318
  });
200
319
  }
201
- if (data.triggers && data.category !== "bot_module") {
320
+ if (data.triggers && !isBotModule) {
202
321
  ctx.addIssue({
203
322
  code: "custom",
204
323
  message: "Only bot_module extensions can have triggers",
205
324
  path: ["triggers"]
206
325
  });
207
326
  }
208
- if (data.category === "bot_module" && (!data.platforms || data.platforms.length === 0)) {
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)) {
209
335
  ctx.addIssue({
210
336
  code: "custom",
211
337
  message: "bot_module extensions must specify platforms",
@@ -229,6 +355,11 @@ var developerVerificationStatusSchema = z3.enum(
229
355
  var developerProfileSchema = z3.object({
230
356
  id: z3.string(),
231
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(),
232
363
  stripe_connect_id: z3.string().nullable(),
233
364
  paypal_email: z3.string().nullable(),
234
365
  bank_iban: z3.string().nullable(),
@@ -244,27 +375,65 @@ var developerTeamSchema = z3.object({
244
375
  id: z3.string(),
245
376
  name: z3.string(),
246
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(),
247
382
  owner_id: z3.string(),
248
383
  created_at: z3.string(),
249
384
  updated_at: z3.string()
250
385
  });
251
- var DEVELOPER_TEAM_ROLES = ["owner", "admin", "member"];
252
- 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
+ });
253
418
  export {
254
419
  CONFIG_FIELD_TYPES,
255
- DEVELOPER_TEAM_ROLES,
256
420
  DEVELOPER_TYPES,
257
421
  DEVELOPER_VERIFICATION_STATUSES,
258
422
  EXTENSION_CATEGORIES,
259
423
  EXTENSION_STATUSES,
260
424
  EXTENSION_VISIBILITIES,
425
+ NODE_TYPES,
261
426
  PRICING_TYPES,
427
+ TRIGGER_MODES,
262
428
  VALID_PLATFORMS,
263
429
  VALID_ROLES,
264
430
  VERSION_STATUSES,
431
+ automationNodeSchema,
265
432
  configFieldSchema,
266
433
  configSchemaSchema,
267
434
  developerProfileSchema,
435
+ developerTeamMemberSchema,
436
+ developerTeamPermissionSchema,
268
437
  developerTeamRoleSchema,
269
438
  developerTeamSchema,
270
439
  developerTypeSchema,
@@ -279,9 +448,12 @@ export {
279
448
  extensionVisibilitySchema,
280
449
  lumioExtensionConfigBaseSchema,
281
450
  lumioExtensionConfigSchema,
451
+ lumioExtensionSoundSchema,
452
+ nodeTypeSchema,
282
453
  pricingTypeSchema,
283
454
  triggerCommandSchema,
284
455
  triggerConfigSchema,
456
+ triggerModeSchema,
285
457
  triggerTimerSchema,
286
458
  versionStatusSchema
287
459
  };
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.2",
4
4
  "description": "Shared TypeScript types for Lumio extensions, store, and config",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",