@luna-park/plugin 1.4.2 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as LogicUtil, i as LogicType, n as ELogicType, o as makeLogicNode, r as EVarType, t as ELogicScope, u as cloneWithFunctions } from "./dist-hc-SHkAg.mjs";
1
+ import { a as LogicUtil, i as LogicType, n as ELogicType, o as makeLogicNode, r as EVarType, t as ELogicScope, u as cloneWithFunctions } from "./dist-Cnje_ZD3.mjs";
2
2
  import { createElementBlock, openBlock, renderSlot } from "vue";
3
3
  import { Type } from "@sinclair/typebox";
4
4
  //#region \0/plugin-vue/export-helper
@@ -14,12 +14,14 @@ const _hoisted_1 = { class: "story-wrapper" };
14
14
  function _sfc_render(_ctx, _cache) {
15
15
  return openBlock(), createElementBlock("div", _hoisted_1, [renderSlot(_ctx.$slots, "default", {}, void 0, true)]);
16
16
  }
17
- var LSettingsStoryWrapper_default = /* @__PURE__ */ export_helper_default(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8d6cff07"]]);
17
+ var LSettingsStoryWrapper_default = /*#__PURE__*/ export_helper_default(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-8d6cff07"]]);
18
18
  //#endregion
19
19
  //#region src/types/hooks.ts
20
20
  let EPluginHooks = /* @__PURE__ */ function(EPluginHooks) {
21
21
  EPluginHooks["BackendMiddleware"] = "backend/middleware";
22
22
  EPluginHooks["BackendInputNode"] = "backend/input-node";
23
+ EPluginHooks["DatabaseScope"] = "database/scope";
24
+ EPluginHooks["DatabaseChange"] = "database/change";
23
25
  return EPluginHooks;
24
26
  }({});
25
27
  //#endregion
@@ -47,7 +49,7 @@ let ETokenType = /* @__PURE__ */ function(ETokenType) {
47
49
  return ETokenType;
48
50
  }({});
49
51
  //#endregion
50
- //#region ../shared/dist/chunk-CfYAbeIz.mjs
52
+ //#region ../shared/dist/rolldown-runtime-D7D4PA-g.mjs
51
53
  var __defProp = Object.defineProperty;
52
54
  var __exportAll = (all, no_symbols) => {
53
55
  let target = {};
@@ -126,18 +128,14 @@ var api_default = {
126
128
  });
127
129
  }
128
130
  };
129
- let ERouteType = /* @__PURE__ */ function(ERouteType) {
130
- ERouteType["Get"] = "get";
131
- ERouteType["Post"] = "post";
132
- ERouteType["Delete"] = "delete";
133
- ERouteType["Put"] = "put";
134
- return ERouteType;
135
- }({});
136
131
  const TypeDate = Type.String({ format: "date-time" });
137
132
  var app_exports$1 = /* @__PURE__ */ __exportAll({
138
133
  app: () => app,
139
134
  appEdits: () => appEdits
140
135
  });
136
+ /**
137
+ * Wire schema of an application, validated loosely (see `TApplication<true>` for the full shape)
138
+ */
141
139
  const app = Type.Object({
142
140
  name: Type.String(),
143
141
  config: Type.Record(Type.String(), Type.Unknown()),
@@ -172,7 +170,7 @@ const project = Type.Object({
172
170
  starsCount: Type.Number()
173
171
  })
174
172
  });
175
- const publicProject = Type.Object({ ...project.properties });
173
+ const publicProject = project;
176
174
  const privateProject = Type.Object({
177
175
  ...project.properties,
178
176
  app: Type.Unknown()
@@ -214,12 +212,12 @@ const flags = {
214
212
  watermark: false
215
213
  }
216
214
  };
217
- EPlanKey.Org, flags.pro, EPlanKey.Pro, flags.pro, EPlanKey.Edu, flags.pro, EPlanKey.Free, flags.free;
215
+ flags.pro, flags.pro, flags.pro, flags.free;
218
216
  const user = Type.Object({
219
217
  id: Type.Optional(Type.String()),
220
218
  auth: Type.Optional(Type.Object({})),
221
219
  mail: Type.String(),
222
- plan: Type.Object({ name: Type.String({ enum: Object.values(EPlanKey) }) }),
220
+ plan: Type.Object({ name: Type.Enum(EPlanKey) }),
223
221
  profile: Type.Object({
224
222
  other: Type.Object({
225
223
  avatar: Type.String(),
@@ -239,7 +237,10 @@ const user = Type.Object({
239
237
  twitter: Type.String()
240
238
  })
241
239
  }),
242
- settings: Type.Object({ newsletter: Type.Boolean() })
240
+ settings: Type.Object({
241
+ newsletter: Type.Boolean(),
242
+ onboarding: Type.Boolean()
243
+ })
243
244
  });
244
245
  let EElementType = /* @__PURE__ */ function(EElementType) {
245
246
  EElementType["Script"] = "script";
@@ -268,10 +269,10 @@ const types = {
268
269
  };
269
270
  var app_exports = /* @__PURE__ */ __exportAll({
270
271
  edit: () => edit$1,
271
- get: () => get$2
272
+ get: () => get$3
272
273
  });
273
- const get$2 = {
274
- type: ERouteType.Get,
274
+ const get$3 = {
275
+ type: "get",
275
276
  params: Type.Object({ id: Type.String() }),
276
277
  response: { 200: Type.Object({
277
278
  app: types.app,
@@ -280,7 +281,7 @@ const get$2 = {
280
281
  url: "/app/:id"
281
282
  };
282
283
  const edit$1 = {
283
- type: ERouteType.Post,
284
+ type: "post",
284
285
  body: Type.Object({
285
286
  app: Type.Optional(types.app),
286
287
  deletes: Type.Optional(Type.Array(Type.String())),
@@ -297,7 +298,7 @@ var auth_exports = /* @__PURE__ */ __exportAll({
297
298
  token: () => token
298
299
  });
299
300
  const authorize = {
300
- type: ERouteType.Post,
301
+ type: "post",
301
302
  body: Type.Object({
302
303
  client_id: Type.String(),
303
304
  redirect_uri: Type.String(),
@@ -308,7 +309,7 @@ const authorize = {
308
309
  url: "/auth/authorize"
309
310
  };
310
311
  const token = {
311
- type: ERouteType.Post,
312
+ type: "post",
312
313
  body: Type.Union([Type.Object({
313
314
  client_id: Type.String(),
314
315
  client_secret: Type.String(),
@@ -330,7 +331,7 @@ const token = {
330
331
  url: "/auth/token"
331
332
  };
332
333
  const me = {
333
- type: ERouteType.Get,
334
+ type: "get",
334
335
  headers: Type.Object({ authorization: Type.String() }),
335
336
  response: { 200: Type.Object({
336
337
  id: Type.String(),
@@ -339,7 +340,7 @@ const me = {
339
340
  url: "/auth/me"
340
341
  };
341
342
  const client = {
342
- type: ERouteType.Get,
343
+ type: "get",
343
344
  querystring: Type.Object({
344
345
  client_id: Type.String(),
345
346
  redirect_uri: Type.String()
@@ -347,13 +348,29 @@ const client = {
347
348
  response: { 200: Type.Object({ client_name: Type.String() }) },
348
349
  url: "/auth/client"
349
350
  };
351
+ var challenge_exports = /* @__PURE__ */ __exportAll({
352
+ get: () => get$2,
353
+ update: () => update$2
354
+ });
355
+ const progression = Type.Object({ done: Type.Array(Type.String()) });
356
+ const get$2 = {
357
+ type: "get",
358
+ response: { 200: progression },
359
+ url: "/challenge"
360
+ };
361
+ const update$2 = {
362
+ type: "post",
363
+ body: progression,
364
+ response: { 200: progression },
365
+ url: "/challenge"
366
+ };
350
367
  var compiler_exports = /* @__PURE__ */ __exportAll({
351
368
  build: () => build,
352
369
  compile: () => compile$1,
353
370
  download: () => download
354
371
  });
355
372
  const build = {
356
- type: ERouteType.Post,
373
+ type: "post",
357
374
  body: Type.Object({
358
375
  entry: Type.Optional(Type.String()),
359
376
  key: Type.String(),
@@ -367,7 +384,7 @@ const build = {
367
384
  url: "/compiler/build/:type"
368
385
  };
369
386
  const compile$1 = {
370
- type: ERouteType.Post,
387
+ type: "post",
371
388
  body: Type.Object({
372
389
  platform: Type.Optional(Type.Union([
373
390
  Type.Literal("win32"),
@@ -389,7 +406,7 @@ const compile$1 = {
389
406
  url: "/compiler/compile/:id"
390
407
  };
391
408
  const download = {
392
- type: ERouteType.Get,
409
+ type: "get",
393
410
  params: Type.Object({
394
411
  id: Type.String(),
395
412
  platform: Type.Optional(Type.Union([
@@ -411,7 +428,7 @@ const download = {
411
428
  };
412
429
  var desktop_exports = /* @__PURE__ */ __exportAll({ latest: () => latest });
413
430
  const latest = {
414
- type: ERouteType.Get,
431
+ type: "get",
415
432
  dev: true,
416
433
  querystring: Type.Object({
417
434
  arch: Type.Union([
@@ -436,6 +453,28 @@ const latest = {
436
453
  }) },
437
454
  url: "/desktop/release/latest"
438
455
  };
456
+ var deploy_exports = /* @__PURE__ */ __exportAll({
457
+ create: () => create$3,
458
+ listServers: () => listServers
459
+ });
460
+ const create$3 = {
461
+ type: "post",
462
+ body: Type.Object({ serverId: Type.String({ format: "uuid" }) }),
463
+ params: Type.Object({
464
+ appId: Type.String({ format: "uuid" }),
465
+ environment: Type.Union([Type.Literal("staging"), Type.Literal("production")])
466
+ }),
467
+ response: { 200: Type.Object({ id: Type.String({ format: "uuid" }) }) },
468
+ url: "/deploy/:appId/:environment"
469
+ };
470
+ const listServers = {
471
+ type: "get",
472
+ response: { 200: Type.Array(Type.Object({
473
+ id: Type.String({ format: "uuid" }),
474
+ name: Type.String()
475
+ })) },
476
+ url: "/deploy/servers"
477
+ };
439
478
  var file_exports = /* @__PURE__ */ __exportAll({
440
479
  list: () => list$3,
441
480
  remove: () => remove$2,
@@ -443,7 +482,7 @@ var file_exports = /* @__PURE__ */ __exportAll({
443
482
  upload: () => upload
444
483
  });
445
484
  const upload = {
446
- type: ERouteType.Post,
485
+ type: "post",
447
486
  body: Type.Object({
448
487
  file: Type.Object({
449
488
  filename: Type.String(),
@@ -460,13 +499,13 @@ const upload = {
460
499
  url: "/file/upload"
461
500
  };
462
501
  const remove$2 = {
463
- type: ERouteType.Post,
502
+ type: "post",
464
503
  body: Type.Object({ target: Type.String() }),
465
504
  response: { 200: Type.Object({ message: Type.String() }) },
466
505
  url: "/file/remove"
467
506
  };
468
507
  const list$3 = {
469
- type: ERouteType.Get,
508
+ type: "get",
470
509
  querystring: Type.Object({
471
510
  limit: Type.Optional(Type.String()),
472
511
  search: Type.Optional(Type.String()),
@@ -490,7 +529,7 @@ const list$3 = {
490
529
  url: "/file/list"
491
530
  };
492
531
  const status = {
493
- type: ERouteType.Get,
532
+ type: "get",
494
533
  response: { 200: Type.Object({
495
534
  limit: Type.Number(),
496
535
  total: Type.Number()
@@ -499,7 +538,7 @@ const status = {
499
538
  };
500
539
  var integrations_exports = /* @__PURE__ */ __exportAll({ googleAuth: () => googleAuth });
501
540
  const googleAuth = {
502
- type: ERouteType.Get,
541
+ type: "get",
503
542
  querystring: Type.Object({
504
543
  code: Type.Optional(Type.String()),
505
544
  scope: Type.Optional(Type.String()),
@@ -515,7 +554,7 @@ var keyConfig_exports = /* @__PURE__ */ __exportAll({
515
554
  remove: () => remove$1
516
555
  });
517
556
  const create$2 = {
518
- type: ERouteType.Post,
557
+ type: "post",
519
558
  body: Type.Object({ domain: Type.String() }),
520
559
  response: { 200: Type.Object({
521
560
  key: types.keyConfig,
@@ -524,18 +563,18 @@ const create$2 = {
524
563
  url: "/key-config"
525
564
  };
526
565
  const list$2 = {
527
- type: ERouteType.Get,
566
+ type: "get",
528
567
  response: { 200: Type.Array(types.keyConfig) },
529
568
  url: "/key-config"
530
569
  };
531
570
  const remove$1 = {
532
- type: ERouteType.Delete,
571
+ type: "delete",
533
572
  params: Type.Object({ id: Type.String() }),
534
573
  response: { 200: Type.Object({ message: Type.String() }) },
535
574
  url: "/key-config/:id"
536
575
  };
537
576
  const check$1 = {
538
- type: ERouteType.Post,
577
+ type: "post",
539
578
  body: Type.Object({
540
579
  domain: Type.String(),
541
580
  key: Type.String()
@@ -550,17 +589,18 @@ var license_exports = /* @__PURE__ */ __exportAll({
550
589
  list: () => list$1,
551
590
  reset: () => reset
552
591
  });
592
+ const TypeMachineFingerprint = Type.String({ pattern: "^v1:[0-9a-f]{64}$" });
553
593
  const reset = {
554
- type: ERouteType.Post,
594
+ type: "post",
555
595
  body: Type.Object({ id: Type.String() }),
556
596
  response: { 200: Type.Object({ message: Type.String() }) },
557
597
  url: "/license/reset"
558
598
  };
559
599
  const link = {
560
- type: ERouteType.Post,
600
+ type: "post",
561
601
  body: Type.Object({
562
602
  name: Type.String(),
563
- fingerprint: Type.String(),
603
+ fingerprint: TypeMachineFingerprint,
564
604
  key: Type.String()
565
605
  }),
566
606
  dev: true,
@@ -568,9 +608,9 @@ const link = {
568
608
  url: "/license/link"
569
609
  };
570
610
  const check = {
571
- type: ERouteType.Post,
611
+ type: "post",
572
612
  body: Type.Object({
573
- fingerprint: Type.String(),
613
+ fingerprint: TypeMachineFingerprint,
574
614
  key: Type.String()
575
615
  }),
576
616
  dev: true,
@@ -582,7 +622,7 @@ const check = {
582
622
  url: "/license/check"
583
623
  };
584
624
  const list$1 = {
585
- type: ERouteType.Get,
625
+ type: "get",
586
626
  response: { 200: Type.Array(Type.Object({
587
627
  id: Type.String(),
588
628
  name: Type.String(),
@@ -599,7 +639,7 @@ var magiclink_exports = /* @__PURE__ */ __exportAll({
599
639
  signup: () => signup
600
640
  });
601
641
  const activate = {
602
- type: ERouteType.Get,
642
+ type: "get",
603
643
  params: Type.Object({
604
644
  id: Type.String(),
605
645
  token: Type.String()
@@ -608,7 +648,7 @@ const activate = {
608
648
  url: "/magiclink/activate/:id/:token"
609
649
  };
610
650
  const create$1 = {
611
- type: ERouteType.Post,
651
+ type: "post",
612
652
  body: Type.Object({ mail: Type.String({ format: "email" }) }),
613
653
  response: { 200: Type.Object({
614
654
  expirationDate: Type.String(),
@@ -617,7 +657,7 @@ const create$1 = {
617
657
  url: "/magiclink/create"
618
658
  };
619
659
  const signup = {
620
- type: ERouteType.Post,
660
+ type: "post",
621
661
  body: Type.Object({ mail: Type.String({ format: "email" }) }),
622
662
  response: { 200: Type.Object({
623
663
  expirationDate: Type.String(),
@@ -630,8 +670,8 @@ var payment_exports = /* @__PURE__ */ __exportAll({
630
670
  portal: () => portal
631
671
  });
632
672
  const checkout = {
633
- type: ERouteType.Post,
634
- body: Type.Object({ plan: Type.Union([Type.Literal(EPlanKey.Pro), Type.Literal(EPlanKey.Org)]) }),
673
+ type: "post",
674
+ body: Type.Object({ plan: Type.Union([Type.Literal("pro"), Type.Literal("org")]) }),
635
675
  response: { 200: Type.Object({
636
676
  message: Type.String(),
637
677
  redirection: Type.String()
@@ -639,7 +679,7 @@ const checkout = {
639
679
  url: "/payment/checkout"
640
680
  };
641
681
  const portal = {
642
- type: ERouteType.Post,
682
+ type: "post",
643
683
  response: { 200: Type.Object({
644
684
  message: Type.String(),
645
685
  redirection: Type.String()
@@ -655,15 +695,14 @@ var project_exports = /* @__PURE__ */ __exportAll({
655
695
  star: () => star
656
696
  });
657
697
  const create = {
658
- type: ERouteType.Post,
698
+ type: "post",
659
699
  body: Type.Object({
660
700
  icon: Type.String(),
661
701
  template: Type.Union([
662
702
  Type.Literal("default"),
663
- Type.Literal("empty"),
703
+ Type.Literal("ferris-wheel"),
664
704
  Type.Literal("frontend"),
665
- Type.Literal("backend"),
666
- Type.Literal("database"),
705
+ Type.Literal("nuxt"),
667
706
  Type.Literal("testing")
668
707
  ]),
669
708
  title: Type.String()
@@ -675,7 +714,7 @@ const create = {
675
714
  url: "/project/create"
676
715
  };
677
716
  const list = {
678
- type: ERouteType.Get,
717
+ type: "get",
679
718
  params: Type.Object({ type: Type.Union([
680
719
  Type.Literal("mine"),
681
720
  Type.Literal("popular"),
@@ -692,19 +731,19 @@ const list = {
692
731
  url: "/project/list/:type"
693
732
  };
694
733
  const remove = {
695
- type: ERouteType.Delete,
734
+ type: "delete",
696
735
  params: Type.Object({ id: Type.String() }),
697
736
  response: { 200: Type.Object({ message: Type.String() }) },
698
737
  url: "/project/remove/:id"
699
738
  };
700
739
  const edit = {
701
- type: ERouteType.Post,
740
+ type: "post",
702
741
  body: types.privateProject,
703
742
  response: { 200: Type.Object({ message: Type.String() }) },
704
743
  url: "/project/edit"
705
744
  };
706
745
  const star = {
707
- type: ERouteType.Post,
746
+ type: "post",
708
747
  body: Type.Object({
709
748
  id: Type.String(),
710
749
  like: Type.Boolean()
@@ -713,7 +752,7 @@ const star = {
713
752
  url: "/project/star"
714
753
  };
715
754
  const proxy = {
716
- type: ERouteType.Post,
755
+ type: "post",
717
756
  body: Type.Object({
718
757
  body: Type.Optional(Type.Unknown()),
719
758
  headers: Type.Optional(Type.Record(Type.String(), Type.String())),
@@ -734,7 +773,7 @@ var script_exports = /* @__PURE__ */ __exportAll({
734
773
  update: () => update$1
735
774
  });
736
775
  const get$1 = {
737
- type: ERouteType.Get,
776
+ type: "get",
738
777
  params: Type.Object({
739
778
  id: Type.String(),
740
779
  script: Type.String()
@@ -743,7 +782,7 @@ const get$1 = {
743
782
  url: "/script/:id/:script"
744
783
  };
745
784
  const compile = {
746
- type: ERouteType.Post,
785
+ type: "post",
747
786
  params: Type.Object({
748
787
  id: Type.String(),
749
788
  script: Type.String()
@@ -752,7 +791,7 @@ const compile = {
752
791
  url: "/script/:id/:script/compile"
753
792
  };
754
793
  const update$1 = {
755
- type: ERouteType.Post,
794
+ type: "post",
756
795
  body: Type.Object({ autoReload: Type.Optional(Type.Boolean()) }),
757
796
  params: Type.Object({
758
797
  id: Type.String(),
@@ -763,7 +802,7 @@ const update$1 = {
763
802
  };
764
803
  var turnstile_exports = /* @__PURE__ */ __exportAll({ tick: () => tick });
765
804
  const tick = {
766
- type: ERouteType.Post,
805
+ type: "post",
767
806
  body: Type.Object({
768
807
  data: Type.Optional(Type.Unknown()),
769
808
  scope: Type.String()
@@ -772,15 +811,17 @@ const tick = {
772
811
  url: "/turnstile/tick"
773
812
  };
774
813
  var user_exports = /* @__PURE__ */ __exportAll({
814
+ confirmAccountDeletion: () => confirmAccountDeletion,
775
815
  disconnect: () => disconnect,
776
816
  get: () => get,
777
817
  ping: () => ping,
818
+ requestAccountDeletion: () => requestAccountDeletion,
778
819
  unsubscribe: () => unsubscribe,
779
820
  update: () => update,
780
821
  waitlist: () => waitlist
781
822
  });
782
823
  const ping = {
783
- type: ERouteType.Get,
824
+ type: "get",
784
825
  response: { 200: Type.Object({
785
826
  message: Type.String(),
786
827
  user: Type.Optional(types.user)
@@ -788,38 +829,52 @@ const ping = {
788
829
  url: "/user/ping"
789
830
  };
790
831
  const get = {
791
- type: ERouteType.Get,
832
+ type: "get",
792
833
  response: { 200: types.user },
793
834
  url: "/user"
794
835
  };
795
836
  const update = {
796
- type: ERouteType.Post,
837
+ type: "post",
797
838
  body: Type.Partial(types.user),
798
839
  response: { 200: Type.Object({ message: Type.String() }) },
799
840
  url: "/user"
800
841
  };
842
+ const requestAccountDeletion = {
843
+ type: "post",
844
+ response: { 200: Type.Object({ message: Type.String() }) },
845
+ url: "/user/account-deletion/request"
846
+ };
847
+ const confirmAccountDeletion = {
848
+ type: "delete",
849
+ params: Type.Object({ token: Type.String() }),
850
+ response: { 200: Type.Object({ message: Type.String() }) },
851
+ url: "/user/account-deletion/:token"
852
+ };
801
853
  const disconnect = {
802
- type: ERouteType.Get,
854
+ type: "get",
803
855
  response: { 200: Type.Object({ message: Type.String() }) },
804
856
  url: "/user/disconnect"
805
857
  };
806
858
  const waitlist = {
807
- type: ERouteType.Post,
859
+ type: "post",
808
860
  body: Type.Object({ mail: Type.String({ format: "email" }) }),
809
861
  response: { 200: Type.Object({ message: Type.String() }) },
810
862
  url: "/user/waitlist"
811
863
  };
812
864
  const unsubscribe = {
813
- type: ERouteType.Post,
814
- body: Type.Object({ id: Type.String() }),
865
+ type: "post",
866
+ body: Type.Object({ "List-Unsubscribe": Type.Union([Type.Literal("One-Click"), Type.Object({ value: Type.Literal("One-Click") })]) }),
867
+ params: Type.Object({ token: Type.String() }),
815
868
  response: { 200: Type.Object({ message: Type.String() }) },
816
- url: "/user/unsubscribe"
869
+ url: "/user/unsubscribe/:token"
817
870
  };
818
871
  const routes = {
819
872
  app: app_exports,
820
873
  auth: auth_exports,
874
+ challenge: challenge_exports,
821
875
  compiler: compiler_exports,
822
876
  desktop: desktop_exports,
877
+ deploy: deploy_exports,
823
878
  file: file_exports,
824
879
  integrations: integrations_exports,
825
880
  keyConfig: keyConfig_exports,
@@ -855,6 +910,46 @@ function getContent(response) {
855
910
  if (response.headers.get("Content-Type")?.startsWith("application/json")) return response.json();
856
911
  return response.text();
857
912
  }
913
+ function isSchemaType(schema, ...types) {
914
+ if (schema?.type === EVarType.union) return schema.elements.length > 0 && schema.elements.every((element) => isSchemaType(element, ...types));
915
+ return Boolean(schema && types.includes(schema.type));
916
+ }
917
+ function strip(schema) {
918
+ const result = { ...schema };
919
+ delete result.default;
920
+ delete result.name;
921
+ delete result.optional;
922
+ return result;
923
+ }
924
+ function named(schema, name) {
925
+ return {
926
+ ...strip(schema),
927
+ name
928
+ };
929
+ }
930
+ function binary(operator, precedence, types, evaluate, output) {
931
+ return {
932
+ accepts: (input) => isSchemaType(input, ...types),
933
+ argPrecedence: precedence + 1,
934
+ args: (input) => [named(input, "Value")],
935
+ evaluate,
936
+ inputPrecedence: precedence,
937
+ output: output ?? ((input) => strip(input)),
938
+ precedence,
939
+ print: (input, [arg]) => `${input} ${operator} ${arg}`
940
+ };
941
+ }
942
+ function comparison(operator, precedence, types, evaluate) {
943
+ return binary(operator, precedence, types, evaluate, () => LogicType.boolean());
944
+ }
945
+ const primitives = [
946
+ EVarType.boolean,
947
+ EVarType.number,
948
+ EVarType.string,
949
+ EVarType.unknown
950
+ ];
951
+ const ordered = [EVarType.number, EVarType.string];
952
+ comparison("===", 8, primitives, (input, [arg]) => input === arg), comparison("!==", 8, primitives, (input, [arg]) => input !== arg), comparison(">", 9, ordered, (input, [arg]) => input > arg), comparison(">=", 9, ordered, (input, [arg]) => input >= arg), comparison("<", 9, ordered, (input, [arg]) => input < arg), comparison("<=", 9, ordered, (input, [arg]) => input <= arg), binary("&&", 4, [EVarType.boolean], (input, [arg]) => Boolean(input && arg)), binary("||", 3, primitives, (input, [arg]) => input || arg), binary("+", 11, [EVarType.number, EVarType.string], (input, [arg]) => input + arg), binary("-", 11, [EVarType.number], (input, [arg]) => input - arg), binary("*", 12, [EVarType.number], (input, [arg]) => input * arg), binary("/", 12, [EVarType.number], (input, [arg]) => input / arg), binary("%", 12, [EVarType.number], (input, [arg]) => input % arg), EVarType.boolean, EVarType.number, EVarType.unknown, LogicType.string(), EVarType.boolean, EVarType.string, EVarType.unknown, LogicType.number(), EVarType.number, EVarType.string, EVarType.unknown, LogicType.boolean();
858
953
  //#endregion
859
954
  //#region src/index.ts
860
955
  function makePlugin(plugin) {
@@ -865,14 +960,15 @@ function makeComponent(component) {
865
960
  }
866
961
  async function loadPlugin(plugin, env) {
867
962
  const result = cloneWithFunctions(plugin);
868
- const config = env.app?.config?.plugins?.[plugin.id]?.config;
963
+ const { config, internals } = env.app?.config?.plugins?.[plugin.id] ?? {};
869
964
  for (const category of [
870
965
  "build",
871
966
  "editor",
872
967
  "inject"
873
968
  ]) if (result[category]) for (const key in result[category]) result[category][key] = await getPluginParam(result[category][key], {
874
969
  ...env,
875
- config
970
+ config,
971
+ internals
876
972
  });
877
973
  return result;
878
974
  }
@@ -1,8 +1,7 @@
1
1
  //#region src/preview/server.d.ts
2
- declare function startPreviewServer(config: {
2
+ export declare function startPreviewServer(config: {
3
3
  dist: string;
4
4
  externals: Array<string>;
5
5
  port: number;
6
6
  }): Promise<void>;
7
- //#endregion
8
- export { startPreviewServer };
7
+ //#endregion