@pipelab/plugin-nvpatch 1.0.0-beta.13 → 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
@@ -17,9 +17,9 @@ import { Duplex, PassThrough, Readable, Transform, Writable, getDefaultHighWater
17
17
  import { Buffer as Buffer$1 } from "node:buffer";
18
18
  import { hostname } from "os";
19
19
  import { formatWithOptions, types } from "util";
20
+ import { access, mkdir } from "node:fs/promises";
20
21
  import http from "node:http";
21
22
  import { webcrypto } from "node:crypto";
22
- import { access, mkdir } from "node:fs/promises";
23
23
  //#region ../../node_modules/is-plain-obj/index.js
24
24
  function isPlainObject(value) {
25
25
  if (typeof value !== "object" || value === null) return false;
@@ -9119,6 +9119,56 @@ function literal(literal_, message) {
9119
9119
  }
9120
9120
  };
9121
9121
  }
9122
+ function looseObject(entries, message) {
9123
+ return {
9124
+ kind: "schema",
9125
+ type: "loose_object",
9126
+ reference: looseObject,
9127
+ expects: "Object",
9128
+ async: false,
9129
+ entries,
9130
+ message,
9131
+ _run(dataset, config2) {
9132
+ const input = dataset.value;
9133
+ if (input && typeof input === "object") {
9134
+ dataset.typed = true;
9135
+ dataset.value = {};
9136
+ for (const key in this.entries) {
9137
+ const value2 = input[key];
9138
+ const valueDataset = this.entries[key]._run({
9139
+ typed: false,
9140
+ value: value2
9141
+ }, config2);
9142
+ if (valueDataset.issues) {
9143
+ const pathItem = {
9144
+ type: "object",
9145
+ origin: "value",
9146
+ input,
9147
+ key,
9148
+ value: value2
9149
+ };
9150
+ for (const issue of valueDataset.issues) {
9151
+ if (issue.path) issue.path.unshift(pathItem);
9152
+ else issue.path = [pathItem];
9153
+ dataset.issues?.push(issue);
9154
+ }
9155
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
9156
+ if (config2.abortEarly) {
9157
+ dataset.typed = false;
9158
+ break;
9159
+ }
9160
+ }
9161
+ if (!valueDataset.typed) dataset.typed = false;
9162
+ if (valueDataset.value !== void 0 || key in input) dataset.value[key] = valueDataset.value;
9163
+ }
9164
+ if (!dataset.issues || !config2.abortEarly) {
9165
+ for (const key in input) if (_isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
9166
+ }
9167
+ } else _addIssue(this, "type", dataset, config2);
9168
+ return dataset;
9169
+ }
9170
+ };
9171
+ }
9122
9172
  function number(message) {
9123
9173
  return {
9124
9174
  kind: "schema",
@@ -9656,6 +9706,18 @@ settingsMigratorInternal.createMigrations({
9656
9706
  })
9657
9707
  ]
9658
9708
  });
9709
+ const connectionsMigratorInternal = createMigrator();
9710
+ const defaultConnections = connectionsMigratorInternal.createDefault({
9711
+ version: "1.0.0",
9712
+ connections: []
9713
+ });
9714
+ connectionsMigratorInternal.createMigrations({
9715
+ defaultValue: defaultConnections,
9716
+ migrations: [createMigration({
9717
+ version: "1.0.0",
9718
+ up: finalVersion
9719
+ })]
9720
+ });
9659
9721
  const fileRepoMigratorInternal = createMigrator();
9660
9722
  const defaultFileRepo = fileRepoMigratorInternal.createDefault({
9661
9723
  version: "2.0.0",
@@ -9817,11 +9879,51 @@ const LEGACY_ID_MAP = {
9817
9879
  };
9818
9880
  const getStrictPluginId = (pluginId) => {
9819
9881
  if (!pluginId) return pluginId;
9820
- if (LEGACY_ID_MAP[pluginId]) return LEGACY_ID_MAP[pluginId];
9821
- if (pluginId.startsWith("@") || pluginId.includes("/") || pluginId.startsWith("pipelab-plugin-")) return pluginId;
9822
- const prefixed = `@pipelab/plugin-${pluginId}`;
9823
- return LEGACY_ID_MAP[prefixed] || prefixed;
9882
+ return LEGACY_ID_MAP[pluginId] || pluginId;
9824
9883
  };
9884
+ //#endregion
9885
+ //#region ../../packages/shared/src/save-location.ts
9886
+ const SaveLocationInternalValidator = object({
9887
+ id: string(),
9888
+ project: string(),
9889
+ lastModified: string(),
9890
+ type: literal("internal"),
9891
+ configName: string()
9892
+ });
9893
+ const SaveLocationValidator = union([
9894
+ object({
9895
+ id: string(),
9896
+ project: string(),
9897
+ path: string(),
9898
+ lastModified: string(),
9899
+ type: literal("external"),
9900
+ summary: object({
9901
+ plugins: array(string()),
9902
+ name: string(),
9903
+ description: string()
9904
+ })
9905
+ }),
9906
+ SaveLocationInternalValidator,
9907
+ object({
9908
+ id: string(),
9909
+ project: string(),
9910
+ type: literal("pipelab-cloud")
9911
+ })
9912
+ ]);
9913
+ object({
9914
+ version: literal("1.0.0"),
9915
+ data: optional(record(string(), SaveLocationValidator), {})
9916
+ });
9917
+ const FileRepoProjectValidatorV2$1 = object({
9918
+ id: string(),
9919
+ name: string(),
9920
+ description: string()
9921
+ });
9922
+ object({
9923
+ version: literal("2.0.0"),
9924
+ projects: array(FileRepoProjectValidatorV2$1),
9925
+ pipelines: optional(array(SaveLocationValidator), [])
9926
+ });
9825
9927
  object({
9826
9928
  cacheFolder: string(),
9827
9929
  theme: union([literal("light"), literal("dark")]),
@@ -9973,6 +10075,17 @@ object({
9973
10075
  })),
9974
10076
  isInternalMigrationBannerClosed: optional(boolean(), false)
9975
10077
  });
10078
+ const ConnectionValidator = looseObject({
10079
+ id: string(),
10080
+ pluginName: string(),
10081
+ name: string(),
10082
+ createdAt: string(),
10083
+ isDefault: boolean()
10084
+ });
10085
+ object({
10086
+ version: literal("1.0.0"),
10087
+ connections: array(ConnectionValidator)
10088
+ });
9976
10089
  //#endregion
9977
10090
  //#region ../../node_modules/tslog/dist/esm/prettyLogStyles.js
9978
10091
  const prettyLogStyles = {
@@ -10493,7 +10606,7 @@ const useLogger = () => {
10493
10606
  const OriginValidator = object({
10494
10607
  pluginId: string(),
10495
10608
  nodeId: string(),
10496
- version: pipe(optional(string()), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent."))
10609
+ version: optional(pipe(string(), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent.")))
10497
10610
  });
10498
10611
  const BlockActionValidatorV1 = object({
10499
10612
  type: literal("action"),
@@ -10506,7 +10619,7 @@ const EditorParamValidatorV3 = union([literal("simple"), literal("editor")]);
10506
10619
  const BlockActionValidatorV3 = object({
10507
10620
  type: literal("action"),
10508
10621
  uid: string(),
10509
- name: pipe(optional(string()), description("A custom name provided by the user")),
10622
+ name: optional(pipe(string(), description("A custom name provided by the user"))),
10510
10623
  disabled: optional(boolean()),
10511
10624
  params: record(string(), object({
10512
10625
  editor: EditorParamValidatorV3,
@@ -52796,35 +52909,6 @@ const createPathParam = (value, definition) => {
52796
52909
  };
52797
52910
  };
52798
52911
  //#endregion
52799
- //#region ../../packages/shared/src/save-location.ts
52800
- const SaveLocationInternalValidator = object({
52801
- id: string(),
52802
- project: string(),
52803
- lastModified: string(),
52804
- type: literal("internal"),
52805
- configName: string()
52806
- });
52807
- const SaveLocationValidator = union([
52808
- object({
52809
- id: string(),
52810
- project: string(),
52811
- path: string(),
52812
- lastModified: string(),
52813
- type: literal("external"),
52814
- summary: object({
52815
- plugins: array(string()),
52816
- name: string(),
52817
- description: string()
52818
- })
52819
- }),
52820
- SaveLocationInternalValidator,
52821
- object({
52822
- id: string(),
52823
- project: string(),
52824
- type: literal("pipelab-cloud")
52825
- })
52826
- ]);
52827
- //#endregion
52828
52912
  //#region ../../packages/shared/src/websocket.types.ts
52829
52913
  var WebSocketError = class extends Error {
52830
52914
  constructor(message, code, requestId) {
@@ -52841,20 +52925,6 @@ object({
52841
52925
  version: literal("1.0.0"),
52842
52926
  data: optional(record(string(), SaveLocationValidator), {})
52843
52927
  });
52844
- const FileRepoProjectValidatorV2$1 = object({
52845
- id: string(),
52846
- name: string(),
52847
- description: string()
52848
- });
52849
- object({
52850
- version: literal("2.0.0"),
52851
- projects: array(FileRepoProjectValidatorV2$1),
52852
- pipelines: optional(array(SaveLocationValidator), [])
52853
- });
52854
- object({
52855
- version: literal("1.0.0"),
52856
- data: optional(record(string(), SaveLocationValidator), {})
52857
- });
52858
52928
  const FileRepoProjectValidatorV2 = object({
52859
52929
  id: string(),
52860
52930
  name: string(),
@@ -52874,9 +52944,13 @@ var init_esm_shims = __esmMin((() => {
52874
52944
  __dirname = /* @__PURE__ */ getDirname();
52875
52945
  }));
52876
52946
  //#endregion
52877
- //#region ../../packages/core-node/src/context.ts
52947
+ //#region ../../packages/constants/src/index.ts
52878
52948
  init_esm_shims();
52879
- const _dirname = typeof __dirname !== "undefined" ? __dirname : typeof import.meta !== "undefined" && import.meta.url ? dirname(fileURLToPath(import.meta.url)) : process.cwd();
52949
+ const websocketPort = 33753;
52950
+ //#endregion
52951
+ //#region ../../packages/core-node/src/context.ts
52952
+ const metaUrl = typeof import.meta !== "undefined" ? import.meta.url : void 0;
52953
+ const _dirname = typeof __dirname !== "undefined" ? __dirname : metaUrl ? dirname(fileURLToPath(metaUrl)) : process.cwd();
52880
52954
  const isDev = process.env.NODE_ENV === "development";
52881
52955
  /**
52882
52956
  * Finds the monorepo root by looking for pnpm-workspace.yaml.
@@ -56448,9 +56522,6 @@ const useAPI = () => {
56448
56522
  };
56449
56523
  };
56450
56524
  //#endregion
56451
- //#region ../../packages/constants/src/index.ts
56452
- const websocketPort = 33753;
56453
- //#endregion
56454
56525
  //#region ../../packages/core-node/src/websocket-server.ts
56455
56526
  var WebSocketServer = class {
56456
56527
  wss = null;