@luna-park/plugin 2.0.1 → 2.2.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.
@@ -1,4 +1,4 @@
1
- import { d as TSchema } from "./index-w5zIwwtu.mjs";
1
+ import { d as TSchema } from "./index-Dz0vJvpL.mjs";
2
2
  import * as ts$1 from "typescript";
3
3
  import ts from "typescript";
4
4
  type TExportResult = {
@@ -57,6 +57,7 @@ interface TSchemaOptions {
57
57
  index?: boolean;
58
58
  input?: string;
59
59
  insert?: number | "last";
60
+ literal?: boolean;
60
61
  max?: number;
61
62
  min?: number;
62
63
  multiplier?: number;
@@ -372,6 +373,7 @@ type TDocumentation = {
372
373
  value: unknown;
373
374
  }>;
374
375
  }>;
376
+ llm?: string;
375
377
  parameters?: Array<{
376
378
  description: string;
377
379
  name: string;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as TVector, a as LogicUtil, c as TInterfaceConstantValue, d as TSchema, f as TVoid, g as MaybePromise, h as DeepPartial, i as LogicType, l as TLogicNode, m as CVector, n as ELogicType, o as Static, p as makeLogicNode, r as EVarType, s as TInterfaceConfig, t as ELogicScope, u as TObject } from "./index-w5zIwwtu.mjs";
1
+ import { _ as TVector, a as LogicUtil, c as TInterfaceConstantValue, d as TSchema, f as TVoid, g as MaybePromise, h as DeepPartial, i as LogicType, l as TLogicNode, m as CVector, n as ELogicType, o as Static, p as makeLogicNode, r as EVarType, s as TInterfaceConfig, t as ELogicScope, u as TObject } from "./index-Dz0vJvpL.mjs";
2
2
  import { Component, ComputedRef, Directive } from "vue";
3
3
  import "@sinclair/typebox";
4
4
  import { IconDefinition } from "@fortawesome/fontawesome-svg-core";
@@ -178,48 +178,6 @@ type TFileBase = TFileBaseExport & {
178
178
  id: string;
179
179
  parent?: TFolder;
180
180
  };
181
- declare enum ELayoutElement {
182
- input = "input",
183
- div = "div",
184
- media = "media",
185
- customText = "customText",
186
- component = "component",
187
- package = "package",
188
- customHtml = "customHtml",
189
- slot = "slot",
190
- template = "template",
191
- variable = "variable",
192
- link = "link"
193
- }
194
- declare enum ETokenType {
195
- Class = "class",
196
- Color = "color",
197
- FontSize = "font-size",
198
- FontWeight = "font-weight",
199
- FontFamily = "font-family",
200
- Length = "length",
201
- Time = "time"
202
- }
203
- declare module "@luna-park/logicnodes" {
204
- interface TSchemaOptions {
205
- custom?: boolean;
206
- displayGrid?: number;
207
- dual?: boolean;
208
- filter?: boolean;
209
- flex?: boolean;
210
- grid?: boolean;
211
- image?: boolean;
212
- mode?: "corner";
213
- number?: boolean;
214
- quad?: boolean;
215
- ref?: boolean;
216
- shadow?: boolean;
217
- units?: Array<string>;
218
- }
219
- interface TString<T extends string = string> {
220
- target?: string;
221
- }
222
- }
223
181
  declare enum ELayoutValueType {
224
182
  Variable = "variable",
225
183
  Property = "property",
@@ -338,6 +296,48 @@ type TValue = {
338
296
  parent?: TLogic;
339
297
  schema: TSchema;
340
298
  };
299
+ declare enum ELayoutElement {
300
+ input = "input",
301
+ div = "div",
302
+ media = "media",
303
+ customText = "customText",
304
+ component = "component",
305
+ package = "package",
306
+ customHtml = "customHtml",
307
+ slot = "slot",
308
+ template = "template",
309
+ variable = "variable",
310
+ link = "link"
311
+ }
312
+ declare enum ETokenType {
313
+ Class = "class",
314
+ Color = "color",
315
+ FontSize = "font-size",
316
+ FontWeight = "font-weight",
317
+ FontFamily = "font-family",
318
+ Length = "length",
319
+ Time = "time"
320
+ }
321
+ declare module "@luna-park/logicnodes" {
322
+ interface TSchemaOptions {
323
+ custom?: boolean;
324
+ displayGrid?: number;
325
+ dual?: boolean;
326
+ filter?: boolean;
327
+ flex?: boolean;
328
+ grid?: boolean;
329
+ image?: boolean;
330
+ mode?: "corner";
331
+ number?: boolean;
332
+ quad?: boolean;
333
+ ref?: boolean;
334
+ shadow?: boolean;
335
+ units?: Array<string>;
336
+ }
337
+ interface TString<T extends string = string> {
338
+ target?: string;
339
+ }
340
+ }
341
341
  type TTextBlock = {
342
342
  content: string;
343
343
  key: string;
@@ -391,6 +391,13 @@ type TLayoutClassOf<TStyle> = {
391
391
  };
392
392
  type TLayoutClassExport = TLayoutClassOf<TLayoutStyleExport>;
393
393
  type TLayoutClass = TLayoutClassOf<TLayoutStyle>;
394
+ /**
395
+ * Class applied to an element: `name` is a constant, a class token or a variable, applied while `toggle` is truthy (always when absent)
396
+ */
397
+ type TLayoutClassBindingOf<TVariable> = {
398
+ name: TVariable;
399
+ toggle?: TVariable;
400
+ };
394
401
  type TLayoutEventParameterOf<TVariable> = {
395
402
  schema: TSchema;
396
403
  value: TVariable;
@@ -401,7 +408,7 @@ interface TLayoutNodeOf<TElement extends TLayoutElementType, TVariable, TChild,
401
408
  id: string;
402
409
  name: string;
403
410
  children: Array<TChild>;
404
- classes: Array<TVariable>;
411
+ classes: Array<TLayoutClassBindingOf<TVariable>>;
405
412
  collapsed?: boolean;
406
413
  content: TLayoutContentOf<TElement, TVariable, TChild>;
407
414
  element: TElement;
@@ -719,6 +726,8 @@ type TApplicationConfig = {
719
726
  }>;
720
727
  state: {
721
728
  currentTab: string;
729
+ deployAppId?: string;
730
+ deployServerId?: string;
722
731
  explorerSort?: EFileSortStrategy;
723
732
  tabs: Array<string>;
724
733
  };
@@ -802,7 +811,10 @@ interface TLogicOf<TGraph, TValue, TAnchor> extends TLogicBaseOf<TGraph, TValue>
802
811
  type: EElementType.Logic | EElementType.Standalone;
803
812
  async: boolean;
804
813
  code?: string;
814
+ description?: string;
805
815
  export: boolean;
816
+ hue?: number;
817
+ icon?: string;
806
818
  inputs: Record<string, TAnchor>;
807
819
  mode: ELogicMode;
808
820
  outputs: Record<string, TAnchor>;
@@ -1157,12 +1169,18 @@ type TBasePlugin<TConfig extends TSchema = TSchema, TInternals = unknown> = {
1157
1169
  };
1158
1170
  llm?: string;
1159
1171
  name: string;
1160
- settings?: Array<{
1161
- component: Component;
1162
- icon?: IconDefinition | string;
1163
- label: string;
1164
- }>;
1165
1172
  windows?: Record<string, Component>;
1173
+ workspace?: {
1174
+ preview?: Component;
1175
+ sections: Array<TPluginWorkspaceSection>;
1176
+ };
1177
+ };
1178
+ type TPluginWorkspaceSection = {
1179
+ component: Component;
1180
+ description?: string;
1181
+ icon: IconDefinition | string;
1182
+ id: string;
1183
+ title: string;
1166
1184
  };
1167
1185
  type TPlugin<TConfig extends TSchema = TSchema, TInternal = unknown, TBase extends TBasePlugin<TConfig, TInternal> = TBasePlugin<TConfig, TInternal>> = Omit<TBase, "build" | "editor" | "inject"> & { [TCategory in "build" | "editor" | "inject"]?: { [TKey in keyof NonNullable<TBase[TCategory]>]: TOption<TEnv<TConfig, TInternal>, NonNullable<TBase[TCategory]>[TKey]>; }; };
1168
1186
  type TProxyPlugin<TConfig extends TSchema = TSchema, TInternal = unknown, TBase extends TBasePlugin<TConfig, TInternal> = TBasePlugin<TConfig, TInternal>> = Omit<TBase, "build" | "editor" | "inject"> & { [TCategory in "build" | "editor" | "inject"]?: { [TKey in keyof NonNullable<TBase[TCategory]>]: Promise<NonNullable<TBase[TCategory]>[TKey]>; }; };
@@ -1189,6 +1207,10 @@ type TEnv<TConfig extends TSchema = TSchema, TInternals = unknown> = {
1189
1207
  };
1190
1208
  type THost = {
1191
1209
  readonly available: boolean;
1210
+ authorize: (buildUrl: (callback: string) => string, options?: {
1211
+ signal?: AbortSignal;
1212
+ timeout?: number;
1213
+ }) => Promise<URLSearchParams>;
1192
1214
  fetch: typeof fetch;
1193
1215
  readFile: (path: string) => Promise<Uint8Array | undefined>;
1194
1216
  removeFile: (path: string) => Promise<void>;
@@ -1201,4 +1223,4 @@ export declare function loadPlugin<TConfig extends TSchema, TInternal>(plugin: T
1201
1223
  export declare function sortPlugins<T extends Pick<TBasePlugin, "dependencies" | "id">>(plugins: Array<T>): Array<T>;
1202
1224
  export declare function getPluginApi<TApi = unknown>(plugin: Pick<TBasePlugin, "api" | "config" | "id"> | undefined, env: Partial<TEnv>): Promise<TApi | undefined>;
1203
1225
  export declare function getPluginParam<T>(target: TOption<TEnv, T>, env: Partial<TEnv>): Promise<T>;
1204
- 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 TProxyPlugin, type TRouteGuard, type TSchema, type TSlot, type TTemplate, type TToken, makeLogicNode };
1226
+ 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 };
package/dist/index.mjs CHANGED
@@ -26,73 +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/index.mjs
30
- const config = {
31
- backendUrl: "https://luna-park.app",
32
- hostUrl: "https://host.luna-park.app",
33
- webSocketUrl: "wss://luna-park.app"
34
- };
35
- const baseConfig = {
36
- credentials: "include",
37
- headers: {
38
- "Accept": "application/json, text/plain",
39
- "Content-Type": "application/json"
40
- },
41
- mode: "cors"
42
- };
43
- const baseMultiConfig = {
44
- credentials: "include",
45
- headers: { Accept: "application/json, text/plain" },
46
- mode: "cors"
47
- };
48
- var api_default = {
49
- async delete(url, config) {
50
- const init = {
51
- ...baseConfig,
52
- method: "DELETE",
53
- ...config
54
- };
55
- if (!init.body) {
56
- init.headers = { ...init.headers };
57
- delete init.headers["Content-Type"];
58
- }
59
- return fetch(url, init);
60
- },
61
- async get(url, config) {
62
- return await fetch(url, {
63
- ...baseConfig,
64
- method: "GET",
65
- ...config
66
- });
67
- },
68
- getBaseUrl({ dev } = { dev: false }) {
69
- return `${config.backendUrl}/${dev ? "dev" : "api"}`;
70
- },
71
- async multipart(url, data, config) {
72
- return await fetch(url, {
73
- ...baseMultiConfig,
74
- body: data,
75
- method: "POST",
76
- ...config
77
- });
78
- },
79
- async post(url, data, config) {
80
- return await fetch(url, {
81
- ...baseConfig,
82
- body: JSON.stringify(data) || "{}",
83
- method: "POST",
84
- ...config
85
- });
86
- },
87
- async put(url, data, config) {
88
- return await fetch(url, {
89
- ...baseConfig,
90
- body: JSON.stringify(data) || "{}",
91
- method: "PUT",
92
- ...config
93
- });
94
- }
95
- };
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
96
66
  const TypeDate = Type.String({ format: "date-time" });
97
67
  var app_exports$1 = /* @__PURE__ */ __exportAll({
98
68
  app: () => app,
@@ -111,7 +81,7 @@ const appEdits = Type.Array(Type.Object({
111
81
  file: Type.Unknown(),
112
82
  path: Type.String()
113
83
  }));
114
- const project = Type.Object({
84
+ const project$1 = Type.Object({
115
85
  id: Type.String(),
116
86
  app: Type.Object({
117
87
  name: Type.String(),
@@ -128,9 +98,9 @@ const project = Type.Object({
128
98
  starsCount: Type.Number()
129
99
  })
130
100
  });
131
- const publicProject = project;
101
+ const publicProject = project$1;
132
102
  const privateProject = Type.Object({
133
- ...project.properties,
103
+ ...project$1.properties,
134
104
  app: Type.Unknown()
135
105
  });
136
106
  const session = Type.Object({
@@ -189,7 +159,6 @@ const flags = {
189
159
  flags.pro, flags.pro, flags.free;
190
160
  const user = Type.Object({
191
161
  id: Type.Optional(Type.String()),
192
- auth: Type.Optional(Type.Object({})),
193
162
  mail: Type.String(),
194
163
  plan: Type.Object({
195
164
  name: Type.Enum(EPlanKey),
@@ -240,6 +209,81 @@ let EElementType = /* @__PURE__ */ function(EElementType) {
240
209
  EElementType["Media"] = "media";
241
210
  return EElementType;
242
211
  }({});
212
+ const types = {
213
+ ...app_exports$1,
214
+ privateProject,
215
+ project: project$1,
216
+ publicProject,
217
+ session,
218
+ user
219
+ };
220
+ // ../shared/dist/index.mjs
221
+ const config = {
222
+ backendUrl: "https://luna-park.app",
223
+ hostUrl: "https://host.luna-park.app",
224
+ webSocketUrl: "wss://luna-park.app"
225
+ };
226
+ const baseConfig = {
227
+ credentials: "include",
228
+ headers: {
229
+ "Accept": "application/json, text/plain",
230
+ "Content-Type": "application/json"
231
+ },
232
+ mode: "cors"
233
+ };
234
+ const baseMultiConfig = {
235
+ credentials: "include",
236
+ headers: { Accept: "application/json, text/plain" },
237
+ mode: "cors"
238
+ };
239
+ var api_default = {
240
+ async delete(url, config) {
241
+ const init = {
242
+ ...baseConfig,
243
+ method: "DELETE",
244
+ ...config
245
+ };
246
+ if (!init.body) {
247
+ init.headers = { ...init.headers };
248
+ delete init.headers["Content-Type"];
249
+ }
250
+ return fetch(url, init);
251
+ },
252
+ async get(url, config) {
253
+ return await fetch(url, {
254
+ ...baseConfig,
255
+ method: "GET",
256
+ ...config
257
+ });
258
+ },
259
+ getBaseUrl({ dev } = { dev: false }) {
260
+ return `${config.backendUrl}/${dev ? "dev" : "api"}`;
261
+ },
262
+ async multipart(url, data, config) {
263
+ return await fetch(url, {
264
+ ...baseMultiConfig,
265
+ body: data,
266
+ method: "POST",
267
+ ...config
268
+ });
269
+ },
270
+ async post(url, data, config) {
271
+ return await fetch(url, {
272
+ ...baseConfig,
273
+ body: JSON.stringify(data) || "{}",
274
+ method: "POST",
275
+ ...config
276
+ });
277
+ },
278
+ async put(url, data, config) {
279
+ return await fetch(url, {
280
+ ...baseConfig,
281
+ body: JSON.stringify(data) || "{}",
282
+ method: "PUT",
283
+ ...config
284
+ });
285
+ }
286
+ };
243
287
  let EDBOperation = /* @__PURE__ */ function(EDBOperation) {
244
288
  EDBOperation["And"] = "and";
245
289
  EDBOperation["Or"] = "or";
@@ -260,14 +304,6 @@ let EDBCondition = /* @__PURE__ */ function(EDBCondition) {
260
304
  EDBCondition["Contains"] = "contains";
261
305
  return EDBCondition;
262
306
  }({});
263
- const types = {
264
- ...app_exports$1,
265
- privateProject,
266
- project,
267
- publicProject,
268
- session,
269
- user
270
- };
271
307
  var app_exports = /* @__PURE__ */ __exportAll({
272
308
  edit: () => edit$1,
273
309
  get: () => get$3
@@ -396,23 +432,42 @@ const download = {
396
432
  url: "/compiler/download/:id/:target"
397
433
  };
398
434
  var deploy_exports = /* @__PURE__ */ __exportAll({
435
+ addDomain: () => addDomain,
399
436
  addServerMember: () => addServerMember,
437
+ archiveDownload: () => archiveDownload,
438
+ archiveReady: () => archiveReady,
439
+ checkManagedDomain: () => checkManagedDomain,
440
+ claimManagedDomain: () => claimManagedDomain,
400
441
  create: () => create$2,
442
+ createDesktop: () => createDesktop,
443
+ destroyApplication: () => destroyApplication,
444
+ destroyEnvironment: () => destroyEnvironment,
445
+ environmentLink: () => environmentLink,
401
446
  environments: () => environments,
402
447
  events: () => events,
403
448
  getVariables: () => getVariables,
449
+ listArchives: () => listArchives,
450
+ listDomains: () => listDomains,
404
451
  listServerMembers: () => listServerMembers,
452
+ listServerTiers: () => listServerTiers,
405
453
  listServers: () => listServers,
454
+ managedDomainZone: () => managedDomainZone,
406
455
  monitoringLink: () => monitoringLink,
407
456
  promote: () => promote,
408
457
  rebuild: () => rebuild,
458
+ registerDesktop: () => registerDesktop,
459
+ removeDomain: () => removeDomain,
409
460
  removeServerMember: () => removeServerMember,
461
+ renameServer: () => renameServer,
462
+ revokeEnvironmentLinks: () => revokeEnvironmentLinks,
410
463
  rollback: () => rollback,
411
464
  runtime: () => runtime,
412
465
  serverBackups: () => serverBackups,
413
466
  setAutoUpdate: () => setAutoUpdate,
467
+ setEnvironmentAccess: () => setEnvironmentAccess,
414
468
  setVariables: () => setVariables,
415
- updateServer: () => updateServer
469
+ updateServer: () => updateServer,
470
+ verifyDomain: () => verifyDomain
416
471
  });
417
472
  const create$2 = {
418
473
  type: "post",
@@ -430,6 +485,32 @@ const environmentParams = Type.Object({
430
485
  environment: environmentKind
431
486
  });
432
487
  const messageResponse = Type.Object({ message: Type.String() });
488
+ const registerDesktop = {
489
+ type: "post",
490
+ body: Type.Object({
491
+ name: Type.String({
492
+ maxLength: 200,
493
+ minLength: 1
494
+ }),
495
+ icon: Type.String({ maxLength: 64 })
496
+ }),
497
+ response: { 200: Type.Object({ id: Type.String({ format: "uuid" }) }) },
498
+ url: "/deploy/desktop"
499
+ };
500
+ const createDesktop = {
501
+ type: "post",
502
+ body: Type.Object({
503
+ archive: Type.Object({
504
+ filename: Type.String(),
505
+ mimetype: Type.String()
506
+ }),
507
+ serverId: Type.Object({ value: Type.String({ format: "uuid" }) })
508
+ }),
509
+ multipart: true,
510
+ params: environmentParams,
511
+ response: { 200: Type.Object({ id: Type.String({ format: "uuid" }) }) },
512
+ url: "/deploy/desktop/:appId/:environment"
513
+ };
433
514
  const deploymentSummary = Type.Object({
434
515
  id: Type.String({ format: "uuid" }),
435
516
  baseHash: Type.Union([Type.String(), Type.Null()]),
@@ -453,6 +534,7 @@ const listServers = {
453
534
  response: { 200: Type.Array(Type.Object({
454
535
  id: Type.String({ format: "uuid" }),
455
536
  name: Type.String(),
537
+ displayName: Type.Union([Type.String(), Type.Null()]),
456
538
  ipv6: Type.Union([Type.String(), Type.Null()]),
457
539
  maintenanceHour: Type.Integer(),
458
540
  ownerMail: Type.Union([Type.String(), Type.Null()]),
@@ -504,6 +586,7 @@ const environments = {
504
586
  environments: Type.Array(Type.Object({
505
587
  active: Type.Union([deploymentSummary, Type.Null()]),
506
588
  history: Type.Array(deploymentSummary),
589
+ isPrivate: Type.Boolean(),
507
590
  kind: environmentKind,
508
591
  pending: Type.Union([deploymentSummary, Type.Null()]),
509
592
  status: Type.String(),
@@ -513,6 +596,99 @@ const environments = {
513
596
  }) },
514
597
  url: "/deploy/:appId/environments"
515
598
  };
599
+ const environmentLink = {
600
+ type: "post",
601
+ body: Type.Object({ mode: Type.Union([Type.Literal("open"), Type.Literal("share")]) }),
602
+ params: environmentParams,
603
+ response: { 200: Type.Object({
604
+ expiresAt: Type.Union([Type.String(), Type.Null()]),
605
+ url: Type.String()
606
+ }) },
607
+ url: "/deploy/:appId/:environment/link"
608
+ };
609
+ const environmentDomain = Type.Object({
610
+ id: Type.String({ format: "uuid" }),
611
+ hostname: Type.String(),
612
+ lastError: Type.Union([Type.String(), Type.Null()]),
613
+ managed: Type.Boolean(),
614
+ records: Type.Object({
615
+ a: Type.Union([Type.String(), Type.Null()]),
616
+ aaaa: Type.Union([Type.String(), Type.Null()])
617
+ }),
618
+ routed: Type.Boolean(),
619
+ verifiedAt: Type.Union([Type.String(), Type.Null()])
620
+ });
621
+ const domainParams = Type.Object({
622
+ ...environmentParams.properties,
623
+ domainId: Type.String({ format: "uuid" })
624
+ });
625
+ const listDomains = {
626
+ type: "get",
627
+ params: environmentParams,
628
+ response: { 200: Type.Array(environmentDomain) },
629
+ url: "/deploy/:appId/:environment/domains"
630
+ };
631
+ const addDomain = {
632
+ type: "post",
633
+ body: Type.Object({ hostname: Type.String({
634
+ maxLength: 260,
635
+ minLength: 1
636
+ }) }),
637
+ params: environmentParams,
638
+ response: { 200: environmentDomain },
639
+ url: "/deploy/:appId/:environment/domains"
640
+ };
641
+ const removeDomain = {
642
+ type: "delete",
643
+ params: domainParams,
644
+ response: { 200: messageResponse },
645
+ url: "/deploy/:appId/:environment/domains/:domainId"
646
+ };
647
+ const verifyDomain = {
648
+ type: "post",
649
+ params: domainParams,
650
+ response: { 200: environmentDomain },
651
+ url: "/deploy/:appId/:environment/domains/:domainId/verify"
652
+ };
653
+ const managedDomainZone = {
654
+ type: "get",
655
+ response: { 200: Type.Object({ zone: Type.Union([Type.String(), Type.Null()]) }) },
656
+ url: "/deploy/managed-domain-zone"
657
+ };
658
+ const checkManagedDomain = {
659
+ type: "get",
660
+ params: environmentParams,
661
+ querystring: Type.Object({ label: Type.String({ maxLength: 80 }) }),
662
+ response: { 200: Type.Object({
663
+ available: Type.Boolean(),
664
+ hostname: Type.Union([Type.String(), Type.Null()]),
665
+ reason: Type.Union([Type.String(), Type.Null()])
666
+ }) },
667
+ url: "/deploy/:appId/:environment/managed-domain"
668
+ };
669
+ const claimManagedDomain = {
670
+ type: "post",
671
+ body: Type.Object({ label: Type.String({
672
+ maxLength: 80,
673
+ minLength: 1
674
+ }) }),
675
+ params: environmentParams,
676
+ response: { 200: environmentDomain },
677
+ url: "/deploy/:appId/:environment/managed-domain"
678
+ };
679
+ const setEnvironmentAccess = {
680
+ type: "put",
681
+ body: Type.Object({ isPrivate: Type.Boolean() }),
682
+ params: environmentParams,
683
+ response: { 200: messageResponse },
684
+ url: "/deploy/:appId/:environment/access"
685
+ };
686
+ const revokeEnvironmentLinks = {
687
+ type: "post",
688
+ params: environmentParams,
689
+ response: { 200: messageResponse },
690
+ url: "/deploy/:appId/:environment/revoke-links"
691
+ };
516
692
  const events = {
517
693
  type: "get",
518
694
  params: Type.Object({ deploymentId: Type.String({ format: "uuid" }) }),
@@ -560,6 +736,18 @@ const promote = {
560
736
  response: { 200: Type.Object({ id: Type.String({ format: "uuid" }) }) },
561
737
  url: "/deploy/:appId/promote/:stagingDeploymentId"
562
738
  };
739
+ const destroyEnvironment = {
740
+ type: "delete",
741
+ params: environmentParams,
742
+ response: { 200: messageResponse },
743
+ url: "/deploy/:appId/:environment"
744
+ };
745
+ const destroyApplication = {
746
+ type: "delete",
747
+ params: Type.Object({ appId: Type.String({ format: "uuid" }) }),
748
+ response: { 200: messageResponse },
749
+ url: "/deploy/:appId"
750
+ };
563
751
  const setAutoUpdate = {
564
752
  type: "put",
565
753
  body: Type.Object({ enabled: Type.Boolean() }),
@@ -587,6 +775,49 @@ const serverBackups = {
587
775
  })) }) },
588
776
  url: "/deploy/servers/:serverId/backups"
589
777
  };
778
+ const renameServer = {
779
+ type: "put",
780
+ body: Type.Object({ name: Type.String({
781
+ maxLength: 60,
782
+ minLength: 1
783
+ }) }),
784
+ params: serverParams,
785
+ response: { 200: Type.Object({ message: Type.String() }) },
786
+ url: "/deploy/servers/:serverId/name"
787
+ };
788
+ const listArchives = {
789
+ type: "get",
790
+ response: { 200: Type.Array(Type.Object({
791
+ createdAt: Type.String(),
792
+ expiresAt: Type.Union([Type.String(), Type.Null()]),
793
+ id: Type.String({ format: "uuid" }),
794
+ serverName: Type.String(),
795
+ size: Type.Union([Type.Number(), Type.Null()]),
796
+ status: Type.String()
797
+ })) },
798
+ url: "/deploy/archives"
799
+ };
800
+ const archiveDownload = {
801
+ type: "post",
802
+ params: Type.Object({ archiveId: Type.String({ format: "uuid" }) }),
803
+ response: { 200: Type.Object({ url: Type.String() }) },
804
+ url: "/deploy/archives/:archiveId/download"
805
+ };
806
+ const archiveReady = {
807
+ type: "post",
808
+ params: Type.Object({ archiveId: Type.String({ format: "uuid" }) }),
809
+ response: { 200: Type.Object({ message: Type.String() }) },
810
+ url: "/deploy/archives/:archiveId/ready"
811
+ };
812
+ const listServerTiers = {
813
+ type: "get",
814
+ response: { 200: Type.Array(Type.Object({
815
+ id: Type.String(),
816
+ locations: Type.Array(Type.String()),
817
+ serverType: Type.Union([Type.String(), Type.Null()])
818
+ })) },
819
+ url: "/deploy/server-tiers"
820
+ };
590
821
  const runtime = {
591
822
  type: "get",
592
823
  response: { 200: Type.Object({ hash: Type.String() }) },
@@ -822,7 +1053,9 @@ const signup = {
822
1053
  };
823
1054
  var payment_exports = /* @__PURE__ */ __exportAll({
824
1055
  checkout: () => checkout,
825
- portal: () => portal
1056
+ listServerSubscriptions: () => listServerSubscriptions,
1057
+ portal: () => portal,
1058
+ serverCheckout: () => serverCheckout
826
1059
  });
827
1060
  const checkout = {
828
1061
  type: "post",
@@ -841,6 +1074,33 @@ const portal = {
841
1074
  }) },
842
1075
  url: "/payment/portal"
843
1076
  };
1077
+ const serverCheckout = {
1078
+ type: "post",
1079
+ body: Type.Object({
1080
+ ipv4: Type.Boolean(),
1081
+ tier: Type.String()
1082
+ }),
1083
+ response: { 200: Type.Object({
1084
+ message: Type.String(),
1085
+ redirection: Type.String()
1086
+ }) },
1087
+ url: "/payment/server/checkout"
1088
+ };
1089
+ const serverSubscription = Type.Object({
1090
+ cancelAt: Type.Union([Type.String(), Type.Null()]),
1091
+ currentPeriodEnd: Type.Union([Type.String(), Type.Null()]),
1092
+ id: Type.String({ format: "uuid" }),
1093
+ ipv4: Type.Boolean(),
1094
+ provisioningError: Type.Union([Type.String(), Type.Null()]),
1095
+ serverId: Type.Union([Type.String({ format: "uuid" }), Type.Null()]),
1096
+ status: Type.String(),
1097
+ tier: Type.String()
1098
+ });
1099
+ const listServerSubscriptions = {
1100
+ type: "get",
1101
+ response: { 200: Type.Array(serverSubscription) },
1102
+ url: "/payment/server/subscriptions"
1103
+ };
844
1104
  var project_exports = /* @__PURE__ */ __exportAll({
845
1105
  create: () => create,
846
1106
  edit: () => edit,
@@ -938,16 +1198,103 @@ const update$1 = {
938
1198
  url: "/script/:id/:script/update"
939
1199
  };
940
1200
  var turnstile_exports = /* @__PURE__ */ __exportAll({ tick: () => tick });
1201
+ const shortText = Type.String({ maxLength: 256 });
1202
+ const longText = Type.String({ maxLength: 5e4 });
1203
+ const desktop = Type.Object({
1204
+ id: Type.String({ format: "uuid" }),
1205
+ os: Type.Optional(Type.Unknown()),
1206
+ version: Type.Optional(Type.String({ maxLength: 32 }))
1207
+ });
1208
+ const project = Type.Object({
1209
+ id: shortText,
1210
+ name: shortText
1211
+ });
1212
+ const reportKind = Type.Union([
1213
+ Type.Literal("bug"),
1214
+ Type.Literal("documentation"),
1215
+ Type.Literal("suggestion")
1216
+ ]);
1217
+ function tickEvent(scope, data) {
1218
+ return Type.Object({
1219
+ data: Type.Object({
1220
+ ...data,
1221
+ desktop: Type.Optional(desktop)
1222
+ }, { additionalProperties: false }),
1223
+ scope: Type.Literal(scope)
1224
+ });
1225
+ }
1226
+ /**
1227
+ * Validated by `scope` only: with the server's `removeAdditional`, a plain union strips the fields of later events while trying earlier ones
1228
+ */
1229
+ const tickEvents = Type.Union([
1230
+ tickEvent("page", {
1231
+ event: Type.Literal("view"),
1232
+ path: Type.String({ maxLength: 2048 }),
1233
+ subject: shortText
1234
+ }),
1235
+ tickEvent("referrer", {
1236
+ event: Type.Literal("arrive"),
1237
+ subject: Type.String({ maxLength: 2048 })
1238
+ }),
1239
+ tickEvent("referral", {
1240
+ event: Type.Literal("arrive"),
1241
+ subject: shortText
1242
+ }),
1243
+ tickEvent("challenge", {
1244
+ attempt: Type.Optional(Type.Integer({
1245
+ maximum: 1e4,
1246
+ minimum: 1
1247
+ })),
1248
+ event: Type.Union([
1249
+ Type.Literal("intro"),
1250
+ Type.Literal("start"),
1251
+ Type.Literal("see"),
1252
+ Type.Literal("step"),
1253
+ Type.Literal("fail"),
1254
+ Type.Literal("done")
1255
+ ]),
1256
+ step: Type.Optional(Type.Integer({
1257
+ maximum: 1e3,
1258
+ minimum: 0
1259
+ })),
1260
+ subject: Type.Optional(shortText)
1261
+ }),
1262
+ tickEvent("editor", {
1263
+ event: Type.Literal("open"),
1264
+ subject: shortText
1265
+ }),
1266
+ tickEvent("desktop", {
1267
+ event: Type.Union([
1268
+ Type.Literal("start"),
1269
+ Type.Literal("create-project"),
1270
+ Type.Literal("open-project")
1271
+ ]),
1272
+ template: Type.Optional(shortText)
1273
+ }),
1274
+ tickEvent("error", {
1275
+ event: Type.Optional(Type.Literal("error")),
1276
+ message: longText,
1277
+ project: Type.Optional(project)
1278
+ }),
1279
+ tickEvent("ai-report", {
1280
+ date: shortText,
1281
+ details: longText,
1282
+ event: Type.Optional(reportKind),
1283
+ example: longText,
1284
+ kind: Type.Optional(reportKind),
1285
+ model: shortText,
1286
+ project: Type.Optional(project),
1287
+ title: longText
1288
+ })
1289
+ ]);
941
1290
  const tick = {
942
1291
  type: "post",
943
- body: Type.Object({
944
- data: Type.Optional(Type.Intersect([Type.Object({ desktop: Type.Optional(Type.Object({
945
- id: Type.String({ minLength: 1 }),
946
- os: Type.Optional(Type.Unknown()),
947
- version: Type.Optional(Type.String())
948
- }, { additionalProperties: true })) }, { additionalProperties: true }), Type.Record(Type.String(), Type.Unknown())])),
949
- scope: Type.String()
1292
+ body: Type.Unsafe({
1293
+ type: "object",
1294
+ discriminator: { propertyName: "scope" },
1295
+ oneOf: tickEvents.anyOf
950
1296
  }),
1297
+ keepalive: true,
951
1298
  response: { 200: Type.Object({}) },
952
1299
  url: "/turnstile/tick"
953
1300
  };
@@ -1061,7 +1408,7 @@ for (const [serviceName, serviceRoutes] of Object.entries(routes)) {
1061
1408
  if (args.querystring) {
1062
1409
  for (const key of Object.keys(args.querystring)) if (args.querystring[key]) url.searchParams.append(key, args.querystring[key].toString());
1063
1410
  }
1064
- const result = await (route.multipart ? api_default.multipart : api_default[route.type])(url.href, args.body);
1411
+ const result = await (route.multipart ? api_default.multipart : api_default[route.type])(url.href, args.body, route.keepalive ? { keepalive: true } : void 0);
1065
1412
  const content = await getContent(result);
1066
1413
  if (result.status >= 400) throw new Error(`Error ${result.status} (${result.statusText}): ${content.message || content}`);
1067
1414
  return content;
@@ -1178,10 +1525,12 @@ LogicType.string(), LogicType.string({
1178
1525
  name: "Source",
1179
1526
  description: "The source"
1180
1527
  });
1528
+ // ../shared/dist/layout.mjs
1181
1529
  const baseEvent = LogicType.object({
1182
1530
  preventDefault: LogicType.function(LogicType.object({}), LogicType.void(), { description: "Prevent the default action of the event" }),
1183
1531
  target: LogicType.interface("HTMLElement")
1184
1532
  });
1533
+ LogicType.object({ ...baseEvent.properties }, { name: "Event" });
1185
1534
  LogicType.object({
1186
1535
  ...baseEvent.properties,
1187
1536
  data: LogicType.string({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@luna-park/plugin",
3
- "version": "2.0.1",
3
+ "version": "2.2.0",
4
4
  "private": false,
5
5
  "description": "Plugin helper for Luna Park.",
6
6
  "homepage": "https://luna-park.app",