@luna-park/plugin 2.1.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -39,6 +39,7 @@ type TComponent<TProps extends Record<string, TSchema> = Record<string, TSchema>
39
39
  link?: string;
40
40
  };
41
41
  emits?: Record<string, TSchema> | ((attributes: TAttributes<TProps, TInternals>) => Record<string, TSchema>);
42
+ guides?: Array<string>;
42
43
  icon?: IconDefinition | string;
43
44
  internals?: TInternals;
44
45
  llm?: string;
@@ -1153,6 +1154,7 @@ type TBasePlugin<TConfig extends TSchema = TSchema, TInternals = unknown> = {
1153
1154
  attributes?: Record<string, unknown>;
1154
1155
  };
1155
1156
  };
1157
+ guides?: Record<string, TPluginGuide>;
1156
1158
  hooks?: { [THook in EPluginHooks]?: (params: THookParams[THook]) => MaybePromise<void>; };
1157
1159
  icon: string;
1158
1160
  id: string;
@@ -1175,6 +1177,10 @@ type TBasePlugin<TConfig extends TSchema = TSchema, TInternals = unknown> = {
1175
1177
  sections: Array<TPluginWorkspaceSection>;
1176
1178
  };
1177
1179
  };
1180
+ type TPluginGuide = {
1181
+ content: string;
1182
+ description: string;
1183
+ };
1178
1184
  type TPluginWorkspaceSection = {
1179
1185
  component: Component;
1180
1186
  description?: string;
@@ -1207,6 +1213,10 @@ type TEnv<TConfig extends TSchema = TSchema, TInternals = unknown> = {
1207
1213
  };
1208
1214
  type THost = {
1209
1215
  readonly available: boolean;
1216
+ authorize: (buildUrl: (callback: string) => string, options?: {
1217
+ signal?: AbortSignal;
1218
+ timeout?: number;
1219
+ }) => Promise<URLSearchParams>;
1210
1220
  fetch: typeof fetch;
1211
1221
  readFile: (path: string) => Promise<Uint8Array | undefined>;
1212
1222
  removeFile: (path: string) => Promise<void>;
@@ -1219,4 +1229,4 @@ export declare function loadPlugin<TConfig extends TSchema, TInternal>(plugin: T
1219
1229
  export declare function sortPlugins<T extends Pick<TBasePlugin, "dependencies" | "id">>(plugins: Array<T>): Array<T>;
1220
1230
  export declare function getPluginApi<TApi = unknown>(plugin: Pick<TBasePlugin, "api" | "config" | "id"> | undefined, env: Partial<TEnv>): Promise<TApi | undefined>;
1221
1231
  export declare function getPluginParam<T>(target: TOption<TEnv, T>, env: Partial<TEnv>): Promise<T>;
1222
- export { EDBCondition, EDBOperation, EElementType, ELogicScope, ELogicType, ETokenType, EVarType, _default as LSettingsStoryWrapper, LogicType, LogicUtil, type Static, type TAnyLogic, type TAnyLogicExport, type TApplication, type TApplicationExport, type TBasePlugin, type TComponent, type TDBCondition, type TDBOperation, type TElementPanel, type TElementPanelAction, type TElementPanelProps, type TEnv, type TFile, type TFileComponent, type TFileComponentExport, type TFileConfig, type TFileConfigExport, type TFileCron, type TFileCronExport, type TFileDatabase, type TFileDatabaseExport, type TFileExport, type TFileMedia, type TFileMediaExport, type TFileRoute, type TFileRouteExport, type TFileScript, type TFileScriptExport, type TFileStore, type TFileStoreExport, type TFileText, type TFileTextExport, type TFileType, type TFileTypeExport, type TFolder, type TFolderExport, type THookParams, type THost, type TInterface, type TInterfaceEditorProps, type TLayoutSchema, type TLayoutSchemaExport, type TLogic, type TLogicExport, type TLogicMain, type TLogicMainExport, type TLogicNode, type TOption, type TPanels, type TPlugin, type TPluginElement, type TPluginWorkspaceSection, type TProxyPlugin, type TRouteGuard, type TSchema, type TSlot, type TTemplate, type TToken, makeLogicNode };
1232
+ export { EDBCondition, EDBOperation, EElementType, ELogicScope, ELogicType, ETokenType, EVarType, _default as LSettingsStoryWrapper, LogicType, LogicUtil, type Static, type TAnyLogic, type TAnyLogicExport, type TApplication, type TApplicationExport, type TBasePlugin, type TComponent, type TDBCondition, type TDBOperation, type TElementPanel, type TElementPanelAction, type TElementPanelProps, type TEnv, type TFile, type TFileComponent, type TFileComponentExport, type TFileConfig, type TFileConfigExport, type TFileCron, type TFileCronExport, type TFileDatabase, type TFileDatabaseExport, type TFileExport, type TFileMedia, type TFileMediaExport, type TFileRoute, type TFileRouteExport, type TFileScript, type TFileScriptExport, type TFileStore, type TFileStoreExport, type TFileText, type TFileTextExport, type TFileType, type TFileTypeExport, type TFolder, type TFolderExport, type THookParams, type THost, type TInterface, type TInterfaceEditorProps, type TLayoutSchema, type TLayoutSchemaExport, type TLogic, type TLogicExport, type TLogicMain, type TLogicMainExport, type TLogicNode, type TOption, type TPanels, type TPlugin, type TPluginElement, type TPluginGuide, type TPluginWorkspaceSection, type TProxyPlugin, type TRouteGuard, type TSchema, type TSlot, type TTemplate, type TToken, makeLogicNode };
package/dist/index.mjs CHANGED
@@ -26,7 +26,43 @@ var __exportAll = (all, no_symbols) => {
26
26
  if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
27
27
  return target;
28
28
  };
29
- // ../shared/dist/types-CvOhRij4.mjs
29
+ // ../shared/dist/servers.mjs
30
+ function defineServerTier(line, size, priceMonthly, serverTypes, specs) {
31
+ return {
32
+ ...specs,
33
+ id: `${line}-${size}`,
34
+ line,
35
+ priceMonthly,
36
+ serverTypes,
37
+ size
38
+ };
39
+ }
40
+ defineServerTier("economy", "small", 20, ["cx23"], {
41
+ cores: 2,
42
+ diskGb: 40,
43
+ memoryGb: 4
44
+ }), defineServerTier("economy", "medium", 30, ["cx33"], {
45
+ cores: 4,
46
+ diskGb: 80,
47
+ memoryGb: 8
48
+ }), defineServerTier("economy", "large", 50, ["cx43"], {
49
+ cores: 8,
50
+ diskGb: 160,
51
+ memoryGb: 16
52
+ }), defineServerTier("performance", "small", 40, ["cpx22"], {
53
+ cores: 2,
54
+ diskGb: 80,
55
+ memoryGb: 4
56
+ }), defineServerTier("performance", "medium", 70, ["cpx32"], {
57
+ cores: 4,
58
+ diskGb: 160,
59
+ memoryGb: 8
60
+ }), defineServerTier("performance", "large", 120, ["cpx42"], {
61
+ cores: 8,
62
+ diskGb: 320,
63
+ memoryGb: 16
64
+ });
65
+ // ../shared/dist/types-DX6OvWhQ.mjs
30
66
  const TypeDate = Type.String({ format: "date-time" });
31
67
  var app_exports$1 = /* @__PURE__ */ __exportAll({
32
68
  app: () => app,
@@ -398,6 +434,8 @@ const download = {
398
434
  var deploy_exports = /* @__PURE__ */ __exportAll({
399
435
  addDomain: () => addDomain,
400
436
  addServerMember: () => addServerMember,
437
+ archiveDownload: () => archiveDownload,
438
+ archiveReady: () => archiveReady,
401
439
  checkManagedDomain: () => checkManagedDomain,
402
440
  claimManagedDomain: () => claimManagedDomain,
403
441
  create: () => create$2,
@@ -408,8 +446,11 @@ var deploy_exports = /* @__PURE__ */ __exportAll({
408
446
  environments: () => environments,
409
447
  events: () => events,
410
448
  getVariables: () => getVariables,
449
+ listArchives: () => listArchives,
411
450
  listDomains: () => listDomains,
451
+ listServerAlerts: () => listServerAlerts,
412
452
  listServerMembers: () => listServerMembers,
453
+ listServerTiers: () => listServerTiers,
413
454
  listServers: () => listServers,
414
455
  managedDomainZone: () => managedDomainZone,
415
456
  monitoringLink: () => monitoringLink,
@@ -418,12 +459,14 @@ var deploy_exports = /* @__PURE__ */ __exportAll({
418
459
  registerDesktop: () => registerDesktop,
419
460
  removeDomain: () => removeDomain,
420
461
  removeServerMember: () => removeServerMember,
462
+ renameServer: () => renameServer,
421
463
  revokeEnvironmentLinks: () => revokeEnvironmentLinks,
422
464
  rollback: () => rollback,
423
465
  runtime: () => runtime,
424
466
  serverBackups: () => serverBackups,
425
467
  setAutoUpdate: () => setAutoUpdate,
426
468
  setEnvironmentAccess: () => setEnvironmentAccess,
469
+ setServerIpv4: () => setServerIpv4,
427
470
  setVariables: () => setVariables,
428
471
  updateServer: () => updateServer,
429
472
  verifyDomain: () => verifyDomain
@@ -493,13 +536,30 @@ const listServers = {
493
536
  response: { 200: Type.Array(Type.Object({
494
537
  id: Type.String({ format: "uuid" }),
495
538
  name: Type.String(),
539
+ displayName: Type.Union([Type.String(), Type.Null()]),
496
540
  ipv6: Type.Union([Type.String(), Type.Null()]),
497
541
  maintenanceHour: Type.Integer(),
498
542
  ownerMail: Type.Union([Type.String(), Type.Null()]),
499
543
  readyAt: Type.Union([Type.String(), Type.Null()]),
500
544
  role: Type.Union([Type.Literal("member"), Type.Literal("owner")]),
501
545
  status: Type.String(),
502
- url: Type.Union([Type.String(), Type.Null()])
546
+ url: Type.Union([Type.String(), Type.Null()]),
547
+ capacity: Type.Object({
548
+ disk: Type.Union([Type.Object({
549
+ free: Type.Number(),
550
+ total: Type.Number()
551
+ }), Type.Null()]),
552
+ environments: Type.Integer(),
553
+ maxEnvironments: Type.Union([Type.Integer(), Type.Null()])
554
+ }),
555
+ ipv4: Type.Union([Type.String(), Type.Null()]),
556
+ ipv4Requested: Type.Boolean(),
557
+ ipv4Status: Type.Union([
558
+ Type.Literal("attaching"),
559
+ Type.Literal("detaching"),
560
+ Type.Null()
561
+ ]),
562
+ tier: Type.Union([Type.String(), Type.Null()])
503
563
  })) },
504
564
  url: "/deploy/servers"
505
565
  };
@@ -723,6 +783,26 @@ const updateServer = {
723
783
  response: { 200: messageResponse },
724
784
  url: "/deploy/servers/:serverId"
725
785
  };
786
+ const setServerIpv4 = {
787
+ type: "put",
788
+ body: Type.Object({ enabled: Type.Boolean() }),
789
+ params: serverParams,
790
+ response: { 200: messageResponse },
791
+ url: "/deploy/servers/:serverId/ipv4"
792
+ };
793
+ const listServerAlerts = {
794
+ type: "get",
795
+ params: serverParams,
796
+ response: { 200: Type.Array(Type.Object({
797
+ id: Type.String({ format: "uuid" }),
798
+ key: Type.String(),
799
+ level: Type.Union([Type.Literal("critical"), Type.Literal("warning")]),
800
+ message: Type.String(),
801
+ openedAt: Type.String(),
802
+ resolvedAt: Type.Union([Type.String(), Type.Null()])
803
+ })) },
804
+ url: "/deploy/servers/:serverId/alerts"
805
+ };
726
806
  const serverBackups = {
727
807
  type: "get",
728
808
  params: Type.Object({ serverId: Type.String({ format: "uuid" }) }),
@@ -733,6 +813,49 @@ const serverBackups = {
733
813
  })) }) },
734
814
  url: "/deploy/servers/:serverId/backups"
735
815
  };
816
+ const renameServer = {
817
+ type: "put",
818
+ body: Type.Object({ name: Type.String({
819
+ maxLength: 60,
820
+ minLength: 1
821
+ }) }),
822
+ params: serverParams,
823
+ response: { 200: Type.Object({ message: Type.String() }) },
824
+ url: "/deploy/servers/:serverId/name"
825
+ };
826
+ const listArchives = {
827
+ type: "get",
828
+ response: { 200: Type.Array(Type.Object({
829
+ id: Type.String({ format: "uuid" }),
830
+ createdAt: Type.String(),
831
+ expiresAt: Type.Union([Type.String(), Type.Null()]),
832
+ serverName: Type.String(),
833
+ size: Type.Union([Type.Number(), Type.Null()]),
834
+ status: Type.String()
835
+ })) },
836
+ url: "/deploy/archives"
837
+ };
838
+ const archiveDownload = {
839
+ type: "post",
840
+ params: Type.Object({ archiveId: Type.String({ format: "uuid" }) }),
841
+ response: { 200: Type.Object({ url: Type.String() }) },
842
+ url: "/deploy/archives/:archiveId/download"
843
+ };
844
+ const archiveReady = {
845
+ type: "post",
846
+ params: Type.Object({ archiveId: Type.String({ format: "uuid" }) }),
847
+ response: { 200: Type.Object({ message: Type.String() }) },
848
+ url: "/deploy/archives/:archiveId/ready"
849
+ };
850
+ const listServerTiers = {
851
+ type: "get",
852
+ response: { 200: Type.Array(Type.Object({
853
+ id: Type.String(),
854
+ locations: Type.Array(Type.String()),
855
+ serverType: Type.Union([Type.String(), Type.Null()])
856
+ })) },
857
+ url: "/deploy/server-tiers"
858
+ };
736
859
  const runtime = {
737
860
  type: "get",
738
861
  response: { 200: Type.Object({ hash: Type.String() }) },
@@ -968,7 +1091,9 @@ const signup = {
968
1091
  };
969
1092
  var payment_exports = /* @__PURE__ */ __exportAll({
970
1093
  checkout: () => checkout,
971
- portal: () => portal
1094
+ listServerSubscriptions: () => listServerSubscriptions,
1095
+ portal: () => portal,
1096
+ serverCheckout: () => serverCheckout
972
1097
  });
973
1098
  const checkout = {
974
1099
  type: "post",
@@ -987,6 +1112,33 @@ const portal = {
987
1112
  }) },
988
1113
  url: "/payment/portal"
989
1114
  };
1115
+ const serverCheckout = {
1116
+ type: "post",
1117
+ body: Type.Object({
1118
+ ipv4: Type.Boolean(),
1119
+ tier: Type.String()
1120
+ }),
1121
+ response: { 200: Type.Object({
1122
+ message: Type.String(),
1123
+ redirection: Type.String()
1124
+ }) },
1125
+ url: "/payment/server/checkout"
1126
+ };
1127
+ const serverSubscription = Type.Object({
1128
+ id: Type.String({ format: "uuid" }),
1129
+ cancelAt: Type.Union([Type.String(), Type.Null()]),
1130
+ currentPeriodEnd: Type.Union([Type.String(), Type.Null()]),
1131
+ ipv4: Type.Boolean(),
1132
+ provisioningError: Type.Union([Type.String(), Type.Null()]),
1133
+ serverId: Type.Union([Type.String({ format: "uuid" }), Type.Null()]),
1134
+ status: Type.String(),
1135
+ tier: Type.String()
1136
+ });
1137
+ const listServerSubscriptions = {
1138
+ type: "get",
1139
+ response: { 200: Type.Array(serverSubscription) },
1140
+ url: "/payment/server/subscriptions"
1141
+ };
990
1142
  var project_exports = /* @__PURE__ */ __exportAll({
991
1143
  create: () => create,
992
1144
  edit: () => edit,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luna-park/plugin",
3
- "version": "2.1.0",
3
+ "version": "2.3.0",
4
4
  "private": false,
5
5
  "description": "Plugin helper for Luna Park.",
6
6
  "homepage": "https://luna-park.app",