@pipelab/plugin-system 1.0.0-beta.14 → 1.0.0-beta.15

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
@@ -1582,6 +1582,56 @@ function literal(literal_, message) {
1582
1582
  }
1583
1583
  };
1584
1584
  }
1585
+ function looseObject(entries, message) {
1586
+ return {
1587
+ kind: "schema",
1588
+ type: "loose_object",
1589
+ reference: looseObject,
1590
+ expects: "Object",
1591
+ async: false,
1592
+ entries,
1593
+ message,
1594
+ _run(dataset, config2) {
1595
+ const input = dataset.value;
1596
+ if (input && typeof input === "object") {
1597
+ dataset.typed = true;
1598
+ dataset.value = {};
1599
+ for (const key in this.entries) {
1600
+ const value2 = input[key];
1601
+ const valueDataset = this.entries[key]._run({
1602
+ typed: false,
1603
+ value: value2
1604
+ }, config2);
1605
+ if (valueDataset.issues) {
1606
+ const pathItem = {
1607
+ type: "object",
1608
+ origin: "value",
1609
+ input,
1610
+ key,
1611
+ value: value2
1612
+ };
1613
+ for (const issue of valueDataset.issues) {
1614
+ if (issue.path) issue.path.unshift(pathItem);
1615
+ else issue.path = [pathItem];
1616
+ dataset.issues?.push(issue);
1617
+ }
1618
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
1619
+ if (config2.abortEarly) {
1620
+ dataset.typed = false;
1621
+ break;
1622
+ }
1623
+ }
1624
+ if (!valueDataset.typed) dataset.typed = false;
1625
+ if (valueDataset.value !== void 0 || key in input) dataset.value[key] = valueDataset.value;
1626
+ }
1627
+ if (!dataset.issues || !config2.abortEarly) {
1628
+ for (const key in input) if (_isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
1629
+ }
1630
+ } else _addIssue(this, "type", dataset, config2);
1631
+ return dataset;
1632
+ }
1633
+ };
1634
+ }
1585
1635
  function number(message) {
1586
1636
  return {
1587
1637
  kind: "schema",
@@ -2119,6 +2169,18 @@ settingsMigratorInternal.createMigrations({
2119
2169
  })
2120
2170
  ]
2121
2171
  });
2172
+ const connectionsMigratorInternal = createMigrator();
2173
+ const defaultConnections = connectionsMigratorInternal.createDefault({
2174
+ version: "1.0.0",
2175
+ connections: []
2176
+ });
2177
+ connectionsMigratorInternal.createMigrations({
2178
+ defaultValue: defaultConnections,
2179
+ migrations: [createMigration({
2180
+ version: "1.0.0",
2181
+ up: finalVersion
2182
+ })]
2183
+ });
2122
2184
  const fileRepoMigratorInternal = createMigrator();
2123
2185
  const defaultFileRepo = fileRepoMigratorInternal.createDefault({
2124
2186
  version: "2.0.0",
@@ -2280,11 +2342,51 @@ const LEGACY_ID_MAP = {
2280
2342
  };
2281
2343
  const getStrictPluginId = (pluginId) => {
2282
2344
  if (!pluginId) return pluginId;
2283
- if (LEGACY_ID_MAP[pluginId]) return LEGACY_ID_MAP[pluginId];
2284
- if (pluginId.startsWith("@") || pluginId.includes("/") || pluginId.startsWith("pipelab-plugin-")) return pluginId;
2285
- const prefixed = `@pipelab/plugin-${pluginId}`;
2286
- return LEGACY_ID_MAP[prefixed] || prefixed;
2345
+ return LEGACY_ID_MAP[pluginId] || pluginId;
2287
2346
  };
2347
+ //#endregion
2348
+ //#region ../../packages/shared/src/save-location.ts
2349
+ const SaveLocationInternalValidator = object({
2350
+ id: string(),
2351
+ project: string(),
2352
+ lastModified: string(),
2353
+ type: literal("internal"),
2354
+ configName: string()
2355
+ });
2356
+ const SaveLocationValidator = union([
2357
+ object({
2358
+ id: string(),
2359
+ project: string(),
2360
+ path: string(),
2361
+ lastModified: string(),
2362
+ type: literal("external"),
2363
+ summary: object({
2364
+ plugins: array(string()),
2365
+ name: string(),
2366
+ description: string()
2367
+ })
2368
+ }),
2369
+ SaveLocationInternalValidator,
2370
+ object({
2371
+ id: string(),
2372
+ project: string(),
2373
+ type: literal("pipelab-cloud")
2374
+ })
2375
+ ]);
2376
+ object({
2377
+ version: literal("1.0.0"),
2378
+ data: optional(record(string(), SaveLocationValidator), {})
2379
+ });
2380
+ const FileRepoProjectValidatorV2$1 = object({
2381
+ id: string(),
2382
+ name: string(),
2383
+ description: string()
2384
+ });
2385
+ object({
2386
+ version: literal("2.0.0"),
2387
+ projects: array(FileRepoProjectValidatorV2$1),
2388
+ pipelines: optional(array(SaveLocationValidator), [])
2389
+ });
2288
2390
  object({
2289
2391
  cacheFolder: string(),
2290
2392
  theme: union([literal("light"), literal("dark")]),
@@ -2436,6 +2538,17 @@ object({
2436
2538
  })),
2437
2539
  isInternalMigrationBannerClosed: optional(boolean(), false)
2438
2540
  });
2541
+ const ConnectionValidator = looseObject({
2542
+ id: string(),
2543
+ pluginName: string(),
2544
+ name: string(),
2545
+ createdAt: string(),
2546
+ isDefault: boolean()
2547
+ });
2548
+ object({
2549
+ version: literal("1.0.0"),
2550
+ connections: array(ConnectionValidator)
2551
+ });
2439
2552
  //#endregion
2440
2553
  //#region ../../node_modules/tslog/dist/esm/prettyLogStyles.js
2441
2554
  const prettyLogStyles = {
@@ -2956,7 +3069,7 @@ const useLogger = () => {
2956
3069
  const OriginValidator = object({
2957
3070
  pluginId: string(),
2958
3071
  nodeId: string(),
2959
- version: pipe(optional(string()), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent."))
3072
+ version: optional(pipe(string(), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent.")))
2960
3073
  });
2961
3074
  const BlockActionValidatorV1 = object({
2962
3075
  type: literal("action"),
@@ -2969,7 +3082,7 @@ const EditorParamValidatorV3 = union([literal("simple"), literal("editor")]);
2969
3082
  const BlockActionValidatorV3 = object({
2970
3083
  type: literal("action"),
2971
3084
  uid: string(),
2972
- name: pipe(optional(string()), description("A custom name provided by the user")),
3085
+ name: optional(pipe(string(), description("A custom name provided by the user"))),
2973
3086
  disabled: optional(boolean()),
2974
3087
  params: record(string(), object({
2975
3088
  editor: EditorParamValidatorV3,
@@ -45279,35 +45392,6 @@ const createEvent = (event) => {
45279
45392
  };
45280
45393
  };
45281
45394
  //#endregion
45282
- //#region ../../packages/shared/src/save-location.ts
45283
- const SaveLocationInternalValidator = object({
45284
- id: string(),
45285
- project: string(),
45286
- lastModified: string(),
45287
- type: literal("internal"),
45288
- configName: string()
45289
- });
45290
- const SaveLocationValidator = union([
45291
- object({
45292
- id: string(),
45293
- project: string(),
45294
- path: string(),
45295
- lastModified: string(),
45296
- type: literal("external"),
45297
- summary: object({
45298
- plugins: array(string()),
45299
- name: string(),
45300
- description: string()
45301
- })
45302
- }),
45303
- SaveLocationInternalValidator,
45304
- object({
45305
- id: string(),
45306
- project: string(),
45307
- type: literal("pipelab-cloud")
45308
- })
45309
- ]);
45310
- //#endregion
45311
45395
  //#region ../../packages/shared/src/websocket.types.ts
45312
45396
  var WebSocketError = class extends Error {
45313
45397
  constructor(message, code, requestId) {
@@ -45324,20 +45408,6 @@ object({
45324
45408
  version: literal("1.0.0"),
45325
45409
  data: optional(record(string(), SaveLocationValidator), {})
45326
45410
  });
45327
- const FileRepoProjectValidatorV2$1 = object({
45328
- id: string(),
45329
- name: string(),
45330
- description: string()
45331
- });
45332
- object({
45333
- version: literal("2.0.0"),
45334
- projects: array(FileRepoProjectValidatorV2$1),
45335
- pipelines: optional(array(SaveLocationValidator), [])
45336
- });
45337
- object({
45338
- version: literal("1.0.0"),
45339
- data: optional(record(string(), SaveLocationValidator), {})
45340
- });
45341
45411
  const FileRepoProjectValidatorV2 = object({
45342
45412
  id: string(),
45343
45413
  name: string(),
@@ -45357,9 +45427,13 @@ var init_esm_shims = __esmMin((() => {
45357
45427
  __dirname = /* @__PURE__ */ getDirname();
45358
45428
  }));
45359
45429
  //#endregion
45360
- //#region ../../packages/core-node/src/context.ts
45430
+ //#region ../../packages/constants/src/index.ts
45361
45431
  init_esm_shims();
45362
- const _dirname = typeof __dirname !== "undefined" ? __dirname : typeof import.meta !== "undefined" && import.meta.url ? dirname(fileURLToPath(import.meta.url)) : process.cwd();
45432
+ const websocketPort = 33753;
45433
+ //#endregion
45434
+ //#region ../../packages/core-node/src/context.ts
45435
+ const metaUrl = typeof import.meta !== "undefined" ? import.meta.url : void 0;
45436
+ const _dirname = typeof __dirname !== "undefined" ? __dirname : metaUrl ? dirname(fileURLToPath(metaUrl)) : process.cwd();
45363
45437
  const isDev = process.env.NODE_ENV === "development";
45364
45438
  /**
45365
45439
  * Finds the monorepo root by looking for pnpm-workspace.yaml.
@@ -48931,9 +49005,6 @@ const useAPI = () => {
48931
49005
  };
48932
49006
  };
48933
49007
  //#endregion
48934
- //#region ../../packages/constants/src/index.ts
48935
- const websocketPort = 33753;
48936
- //#endregion
48937
49008
  //#region ../../packages/core-node/src/websocket-server.ts
48938
49009
  var WebSocketServer = class {
48939
49010
  wss = null;