@backstage/plugin-scaffolder-node 0.8.2-next.2 → 0.8.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # @backstage/plugin-scaffolder-node
2
2
 
3
+ ## 0.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 16e2e9c: trim leading and trailing slashes from parseRepoUrl query parameters
8
+ - 72d019d: Removed various typos
9
+ - ec42f8e: Generating new tokens on each Scaffolder Task Retry
10
+ - Updated dependencies
11
+ - @backstage/integration@1.17.0
12
+ - @backstage/catalog-model@1.7.4
13
+ - @backstage/backend-plugin-api@1.3.1
14
+ - @backstage/errors@1.2.7
15
+ - @backstage/types@1.2.1
16
+ - @backstage/plugin-scaffolder-common@1.5.11
17
+
18
+ ## 0.8.2-next.3
19
+
20
+ ### Patch Changes
21
+
22
+ - 16e2e9c: trim leading and trailing slashes from parseRepoUrl query parameters
23
+ - ec42f8e: Generating new tokens on each Scaffolder Task Retry
24
+ - Updated dependencies
25
+ - @backstage/integration@1.17.0-next.3
26
+ - @backstage/backend-plugin-api@1.3.1-next.2
27
+ - @backstage/catalog-model@1.7.3
28
+ - @backstage/errors@1.2.7
29
+ - @backstage/types@1.2.1
30
+ - @backstage/plugin-scaffolder-common@1.5.11-next.0
31
+
3
32
  ## 0.8.2-next.2
4
33
 
5
34
  ### Patch Changes
@@ -5,6 +5,7 @@ var backendPluginApi = require('@backstage/backend-plugin-api');
5
5
  var path = require('path');
6
6
  var zodToJsonSchema = require('zod-to-json-schema');
7
7
  var zod = require('zod');
8
+ var lodash = require('lodash');
8
9
 
9
10
  function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
10
11
 
@@ -34,17 +35,18 @@ const parseRepoUrl = (repoUrl, integrations) => {
34
35
  );
35
36
  }
36
37
  const host = parsed.host;
37
- const owner = parsed.searchParams.get("owner") ?? void 0;
38
- const organization = parsed.searchParams.get("organization") ?? void 0;
39
- const workspace = parsed.searchParams.get("workspace") ?? void 0;
40
- const project = parsed.searchParams.get("project") ?? void 0;
41
38
  const type = integrations.byHost(host)?.type;
42
39
  if (!type) {
43
40
  throw new errors.InputError(
44
41
  `No matching integration configuration for host ${host}, please check your integrations config`
45
42
  );
46
43
  }
47
- const repo = parsed.searchParams.get("repo");
44
+ const { owner, organization, workspace, project, repo } = Object.fromEntries(
45
+ ["owner", "organization", "workspace", "project", "repo"].map((param) => [
46
+ param,
47
+ parsed.searchParams.has(param) ? lodash.trim(parsed.searchParams.get(param), "/") : void 0
48
+ ])
49
+ );
48
50
  switch (type) {
49
51
  case "bitbucket": {
50
52
  if (host === "www.bitbucket.org") {
@@ -1 +1 @@
1
- {"version":3,"file":"util.cjs.js","sources":["../../src/actions/util.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport { isChildPath } from '@backstage/backend-plugin-api';\nimport { join as joinPath, normalize as normalizePath } from 'path';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { TemplateActionOptions } from './createTemplateAction';\nimport zodToJsonSchema from 'zod-to-json-schema';\nimport { z } from 'zod';\nimport { Schema } from 'jsonschema';\n\n/**\n * @public\n */\nexport const getRepoSourceDirectory = (\n workspacePath: string,\n sourcePath: string | undefined,\n) => {\n if (sourcePath) {\n const safeSuffix = normalizePath(sourcePath).replace(\n /^(\\.\\.(\\/|\\\\|$))+/,\n '',\n );\n const path = joinPath(workspacePath, safeSuffix);\n if (!isChildPath(workspacePath, path)) {\n throw new Error('Invalid source path');\n }\n return path;\n }\n return workspacePath;\n};\n\n/**\n * @public\n */\nexport const parseRepoUrl = (\n repoUrl: string,\n integrations: ScmIntegrationRegistry,\n): {\n repo: string;\n host: string;\n owner?: string;\n organization?: string;\n workspace?: string;\n project?: string;\n} => {\n let parsed;\n try {\n parsed = new URL(`https://${repoUrl}`);\n } catch (error) {\n throw new InputError(\n `Invalid repo URL passed to publisher, got ${repoUrl}, ${error}`,\n );\n }\n const host = parsed.host;\n const owner = parsed.searchParams.get('owner') ?? undefined;\n const organization = parsed.searchParams.get('organization') ?? undefined;\n const workspace = parsed.searchParams.get('workspace') ?? undefined;\n const project = parsed.searchParams.get('project') ?? undefined;\n\n const type = integrations.byHost(host)?.type;\n\n if (!type) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n\n const repo: string = parsed.searchParams.get('repo')!;\n switch (type) {\n case 'bitbucket': {\n if (host === 'www.bitbucket.org') {\n checkRequiredParams(parsed, 'workspace');\n }\n checkRequiredParams(parsed, 'project', 'repo');\n break;\n }\n case 'azure': {\n checkRequiredParams(parsed, 'project', 'repo');\n break;\n }\n case 'gitlab': {\n // project is the projectID, and if defined, owner and repo won't be needed.\n if (!project) {\n checkRequiredParams(parsed, 'owner', 'repo');\n }\n break;\n }\n case 'gitea': {\n checkRequiredParams(parsed, 'repo');\n break;\n }\n case 'gerrit': {\n checkRequiredParams(parsed, 'repo');\n break;\n }\n default: {\n checkRequiredParams(parsed, 'repo', 'owner');\n break;\n }\n }\n\n return { host, owner, repo, organization, workspace, project };\n};\n\nfunction checkRequiredParams(repoUrl: URL, ...params: string[]) {\n for (let i = 0; i < params.length; i++) {\n if (!repoUrl.searchParams.get(params[i])) {\n throw new InputError(\n `Invalid repo URL passed to publisher: ${repoUrl.toString()}, missing ${\n params[i]\n }`,\n );\n }\n }\n}\n\nconst isZodSchema = (schema: unknown): schema is z.ZodType => {\n return typeof schema === 'object' && !!schema && 'safeParseAsync' in schema;\n};\n\nconst isNativeZodSchema = (\n schema: unknown,\n): schema is { [key in string]: (zImpl: typeof z) => z.ZodType } => {\n return (\n typeof schema === 'object' &&\n !!schema &&\n Object.values(schema).every(v => typeof v === 'function')\n );\n};\n\nexport const parseSchemas = (\n action: TemplateActionOptions,\n): { inputSchema?: Schema; outputSchema?: Schema } => {\n if (!action.schema) {\n return { inputSchema: undefined, outputSchema: undefined };\n }\n\n if (isZodSchema(action.schema.input)) {\n return {\n inputSchema: zodToJsonSchema(action.schema.input) as Schema,\n outputSchema: isZodSchema(action.schema.output)\n ? (zodToJsonSchema(action.schema.output) as Schema)\n : undefined,\n };\n }\n\n if (isNativeZodSchema(action.schema.input)) {\n const input = z.object(\n Object.fromEntries(\n Object.entries(action.schema.input).map(([k, v]) => [k, v(z)]),\n ),\n );\n\n return {\n inputSchema: zodToJsonSchema(input) as Schema,\n outputSchema: isNativeZodSchema(action.schema.output)\n ? (zodToJsonSchema(\n z.object(\n Object.fromEntries(\n Object.entries(action.schema.output).map(([k, v]) => [k, v(z)]),\n ),\n ),\n ) as Schema)\n : undefined,\n };\n }\n\n return {\n inputSchema: action.schema.input,\n outputSchema: action.schema.output,\n };\n};\n"],"names":["normalizePath","path","joinPath","isChildPath","InputError","zodToJsonSchema","z"],"mappings":";;;;;;;;;;;;AA4Ba,MAAA,sBAAA,GAAyB,CACpC,aAAA,EACA,UACG,KAAA;AACH,EAAA,IAAI,UAAY,EAAA;AACd,IAAM,MAAA,UAAA,GAAaA,cAAc,CAAA,UAAU,CAAE,CAAA,OAAA;AAAA,MAC3C,mBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAM,MAAAC,MAAA,GAAOC,SAAS,CAAA,aAAA,EAAe,UAAU,CAAA;AAC/C,IAAA,IAAI,CAACC,4BAAA,CAAY,aAAe,EAAAF,MAAI,CAAG,EAAA;AACrC,MAAM,MAAA,IAAI,MAAM,qBAAqB,CAAA;AAAA;AAEvC,IAAO,OAAAA,MAAA;AAAA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AAA,WAAA;AAAA,YACL,OAAO,OAAQ,CAAA,MAAA,CAAO,MAAO,CAAA,MAAM,EAAE,GAAI,CAAA,CAAC,CAAC,CAAA,EAAG,CAAC,CAAM,KAAA,CAAC,GAAG,CAAE,CAAAA,KAAC,CAAC,CAAC;AAAA;AAChE;AACF,OAEF,GAAA,KAAA;AAAA,KACN;AAAA;AAGF,EAAO,OAAA;AAAA,IACL,WAAA,EAAa,OAAO,MAAO,CAAA,KAAA;AAAA,IAC3B,YAAA,EAAc,OAAO,MAAO,CAAA;AAAA,GAC9B;AACF;;;;;;"}
1
+ {"version":3,"file":"util.cjs.js","sources":["../../src/actions/util.ts"],"sourcesContent":["/*\n * Copyright 2021 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { InputError } from '@backstage/errors';\nimport { isChildPath } from '@backstage/backend-plugin-api';\nimport { join as joinPath, normalize as normalizePath } from 'path';\nimport { ScmIntegrationRegistry } from '@backstage/integration';\nimport { TemplateActionOptions } from './createTemplateAction';\nimport zodToJsonSchema from 'zod-to-json-schema';\nimport { z } from 'zod';\nimport { Schema } from 'jsonschema';\nimport { trim } from 'lodash';\n\n/**\n * @public\n */\nexport const getRepoSourceDirectory = (\n workspacePath: string,\n sourcePath: string | undefined,\n) => {\n if (sourcePath) {\n const safeSuffix = normalizePath(sourcePath).replace(\n /^(\\.\\.(\\/|\\\\|$))+/,\n '',\n );\n const path = joinPath(workspacePath, safeSuffix);\n if (!isChildPath(workspacePath, path)) {\n throw new Error('Invalid source path');\n }\n return path;\n }\n return workspacePath;\n};\n\n/**\n * @public\n */\nexport const parseRepoUrl = (\n repoUrl: string,\n integrations: ScmIntegrationRegistry,\n): {\n repo: string;\n host: string;\n owner?: string;\n organization?: string;\n workspace?: string;\n project?: string;\n} => {\n let parsed;\n try {\n parsed = new URL(`https://${repoUrl}`);\n } catch (error) {\n throw new InputError(\n `Invalid repo URL passed to publisher, got ${repoUrl}, ${error}`,\n );\n }\n const host = parsed.host;\n const type = integrations.byHost(host)?.type;\n\n if (!type) {\n throw new InputError(\n `No matching integration configuration for host ${host}, please check your integrations config`,\n );\n }\n const { owner, organization, workspace, project, repo } = Object.fromEntries(\n ['owner', 'organization', 'workspace', 'project', 'repo'].map(param => [\n param,\n parsed.searchParams.has(param)\n ? trim(parsed.searchParams.get(param)!, '/')\n : undefined,\n ]),\n );\n switch (type) {\n case 'bitbucket': {\n if (host === 'www.bitbucket.org') {\n checkRequiredParams(parsed, 'workspace');\n }\n checkRequiredParams(parsed, 'project', 'repo');\n break;\n }\n case 'azure': {\n checkRequiredParams(parsed, 'project', 'repo');\n break;\n }\n case 'gitlab': {\n // project is the projectID, and if defined, owner and repo won't be needed.\n if (!project) {\n checkRequiredParams(parsed, 'owner', 'repo');\n }\n break;\n }\n case 'gitea': {\n checkRequiredParams(parsed, 'repo');\n break;\n }\n case 'gerrit': {\n checkRequiredParams(parsed, 'repo');\n break;\n }\n default: {\n checkRequiredParams(parsed, 'repo', 'owner');\n break;\n }\n }\n return { host, owner, repo: repo!, organization, workspace, project };\n};\n\nfunction checkRequiredParams(repoUrl: URL, ...params: string[]) {\n for (let i = 0; i < params.length; i++) {\n if (!repoUrl.searchParams.get(params[i])) {\n throw new InputError(\n `Invalid repo URL passed to publisher: ${repoUrl.toString()}, missing ${\n params[i]\n }`,\n );\n }\n }\n}\n\nconst isZodSchema = (schema: unknown): schema is z.ZodType => {\n return typeof schema === 'object' && !!schema && 'safeParseAsync' in schema;\n};\n\nconst isNativeZodSchema = (\n schema: unknown,\n): schema is { [key in string]: (zImpl: typeof z) => z.ZodType } => {\n return (\n typeof schema === 'object' &&\n !!schema &&\n Object.values(schema).every(v => typeof v === 'function')\n );\n};\n\nexport const parseSchemas = (\n action: TemplateActionOptions,\n): { inputSchema?: Schema; outputSchema?: Schema } => {\n if (!action.schema) {\n return { inputSchema: undefined, outputSchema: undefined };\n }\n\n if (isZodSchema(action.schema.input)) {\n return {\n inputSchema: zodToJsonSchema(action.schema.input) as Schema,\n outputSchema: isZodSchema(action.schema.output)\n ? (zodToJsonSchema(action.schema.output) as Schema)\n : undefined,\n };\n }\n\n if (isNativeZodSchema(action.schema.input)) {\n const input = z.object(\n Object.fromEntries(\n Object.entries(action.schema.input).map(([k, v]) => [k, v(z)]),\n ),\n );\n\n return {\n inputSchema: zodToJsonSchema(input) as Schema,\n outputSchema: isNativeZodSchema(action.schema.output)\n ? (zodToJsonSchema(\n z.object(\n Object.fromEntries(\n Object.entries(action.schema.output).map(([k, v]) => [k, v(z)]),\n ),\n ),\n ) as Schema)\n : undefined,\n };\n }\n\n return {\n inputSchema: action.schema.input,\n outputSchema: action.schema.output,\n };\n};\n"],"names":["normalizePath","path","joinPath","isChildPath","InputError","trim","zodToJsonSchema","z"],"mappings":";;;;;;;;;;;;;AA6Ba,MAAA,sBAAA,GAAyB,CACpC,aAAA,EACA,UACG,KAAA;AACH,EAAA,IAAI,UAAY,EAAA;AACd,IAAM,MAAA,UAAA,GAAaA,cAAc,CAAA,UAAU,CAAE,CAAA,OAAA;AAAA,MAC3C,mBAAA;AAAA,MACA;AAAA,KACF;AACA,IAAM,MAAAC,MAAA,GAAOC,SAAS,CAAA,aAAA,EAAe,UAAU,CAAA;AAC/C,IAAA,IAAI,CAACC,4BAAA,CAAY,aAAe,EAAAF,MAAI,CAAG,EAAA;AACrC,MAAM,MAAA,IAAI,MAAM,qBAAqB,CAAA;AAAA;AAEvC,IAAO,OAAAA,MAAA;AAAA;AAET,EAAO,OAAA,aAAA;AACT;AAKa,MAAA,YAAA,GAAe,CAC1B,OAAA,EACA,YAQG,KAAA;AACH,EAAI,IAAA,MA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AChE;AACF,OAEF,GAAA,KAAA;AAAA,KACN;AAAA;AAGF,EAAO,OAAA;AAAA,IACL,WAAA,EAAa,OAAO,MAAO,CAAA,KAAA;AAAA,IAC3B,YAAA,EAAc,OAAO,MAAO,CAAA;AAAA,GAC9B;AACF;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -128,7 +128,10 @@ interface TaskContext {
128
128
  */
129
129
  interface TaskBroker {
130
130
  cancel?(taskId: string): Promise<void>;
131
- retry?(taskId: string): Promise<void>;
131
+ retry?(options: {
132
+ secrets?: TaskSecrets;
133
+ taskId: string;
134
+ }): Promise<void>;
132
135
  claim(): Promise<TaskContext>;
133
136
  recoverTasks?(): Promise<void>;
134
137
  dispatch(options: TaskBrokerDispatchOptions): Promise<TaskBrokerDispatchResult>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-node",
3
- "version": "0.8.2-next.2",
3
+ "version": "0.8.2",
4
4
  "description": "The plugin-scaffolder-node module for @backstage/plugin-scaffolder-backend",
5
5
  "backstage": {
6
6
  "role": "node-library",
@@ -62,18 +62,19 @@
62
62
  "test": "backstage-cli package test"
63
63
  },
64
64
  "dependencies": {
65
- "@backstage/backend-plugin-api": "1.3.1-next.1",
66
- "@backstage/catalog-model": "1.7.3",
67
- "@backstage/errors": "1.2.7",
68
- "@backstage/integration": "1.17.0-next.2",
69
- "@backstage/plugin-scaffolder-common": "1.5.11-next.0",
70
- "@backstage/types": "1.2.1",
65
+ "@backstage/backend-plugin-api": "^1.3.1",
66
+ "@backstage/catalog-model": "^1.7.4",
67
+ "@backstage/errors": "^1.2.7",
68
+ "@backstage/integration": "^1.17.0",
69
+ "@backstage/plugin-scaffolder-common": "^1.5.11",
70
+ "@backstage/types": "^1.2.1",
71
71
  "@isomorphic-git/pgp-plugin": "^0.0.7",
72
72
  "concat-stream": "^2.0.0",
73
73
  "fs-extra": "^11.2.0",
74
74
  "globby": "^11.0.0",
75
75
  "isomorphic-git": "^1.23.0",
76
76
  "jsonschema": "^1.5.0",
77
+ "lodash": "^4.17.21",
77
78
  "p-limit": "^3.1.0",
78
79
  "tar": "^6.1.12",
79
80
  "winston": "^3.2.1",
@@ -82,8 +83,9 @@
82
83
  "zod-to-json-schema": "^3.20.4"
83
84
  },
84
85
  "devDependencies": {
85
- "@backstage/backend-test-utils": "1.5.0-next.2",
86
- "@backstage/cli": "0.32.1-next.2",
87
- "@backstage/config": "1.3.2"
86
+ "@backstage/backend-test-utils": "^1.5.0",
87
+ "@backstage/cli": "^0.32.1",
88
+ "@backstage/config": "^1.3.2",
89
+ "@types/lodash": "^4.14.151"
88
90
  }
89
91
  }