@techdocs/cli 1.8.12 → 1.8.14

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,28 @@
1
1
  # @techdocs/cli
2
2
 
3
+ ## 1.8.14
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/backend-defaults@0.3.2
9
+ - @backstage/catalog-model@1.5.0
10
+ - @backstage/cli-common@0.1.14
11
+ - @backstage/config@1.2.0
12
+ - @backstage/plugin-techdocs-node@1.12.6
13
+
14
+ ## 1.8.13
15
+
16
+ ### Patch Changes
17
+
18
+ - aeae3be: Import discovery from backend-defaults instead of backend-common
19
+ - Updated dependencies
20
+ - @backstage/backend-defaults@0.3.1
21
+ - @backstage/plugin-techdocs-node@1.12.6
22
+ - @backstage/catalog-model@1.5.0
23
+ - @backstage/cli-common@0.1.14
24
+ - @backstage/config@1.2.0
25
+
3
26
  ## 1.8.12
4
27
 
5
28
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var backendCommon = require('@backstage/backend-common');
3
+ var discovery = require('@backstage/backend-defaults/discovery');
4
4
  var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
5
5
  var utility = require('./utility-CsspJYjU.cjs.js');
6
6
  var PublisherConfig = require('./PublisherConfig-Cn5i8vF5.cjs.js');
@@ -12,8 +12,8 @@ require('@backstage/config');
12
12
  async function migrate(opts) {
13
13
  const logger = utility.createLogger({ verbose: opts.verbose });
14
14
  const config = PublisherConfig.PublisherConfig.getValidConfig(opts);
15
- const discovery = backendCommon.HostDiscovery.fromConfig(config);
16
- const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery });
15
+ const discovery$1 = discovery.HostDiscovery.fromConfig(config);
16
+ const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery: discovery$1 });
17
17
  if (!publisher.migrateDocsCase) {
18
18
  throw new Error(`Migration not implemented for ${opts.publisherType}`);
19
19
  }
@@ -35,4 +35,4 @@ async function migrate(opts) {
35
35
  }
36
36
 
37
37
  exports.default = migrate;
38
- //# sourceMappingURL=migrate-BZzIXl_A.cjs.js.map
38
+ //# sourceMappingURL=migrate-Ddd_MQkE.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migrate-Ddd_MQkE.cjs.js","sources":["../../src/commands/migrate/migrate.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 { HostDiscovery } from '@backstage/backend-defaults/discovery';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function migrate(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = HostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n if (!publisher.migrateDocsCase) {\n throw new Error(`Migration not implemented for ${opts.publisherType}`);\n }\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n throw new Error('');\n }\n\n // Validate and parse migration arguments.\n const removeOriginal = opts.removeOriginal;\n const numericConcurrency = parseInt(opts.concurrency, 10);\n\n if (!Number.isInteger(numericConcurrency) || numericConcurrency <= 0) {\n throw new Error(\n `Concurrency must be a number greater than 1. ${opts.concurrency} provided.`,\n );\n }\n\n await publisher.migrateDocsCase({\n concurrency: numericConcurrency,\n removeOriginal,\n });\n}\n"],"names":["createLogger","PublisherConfig","discovery","HostDiscovery","Publisher"],"mappings":";;;;;;;;;;;AAsBA,eAA8B,QAAQ,IAAoB,EAAA;AACxD,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,MAAA,GAASC,+BAAgB,CAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAClD,EAAM,MAAAC,WAAA,GAAYC,uBAAc,CAAA,UAAA,CAAW,MAAM,CAAA,CAAA;AACjD,EAAM,MAAA,SAAA,GAAY,MAAMC,4BAAU,CAAA,UAAA,CAAW,QAAQ,EAAE,MAAA,aAAQF,aAAW,CAAA,CAAA;AAE1E,EAAI,IAAA,CAAC,UAAU,eAAiB,EAAA;AAC9B,IAAA,MAAM,IAAI,KAAA,CAAM,CAAiC,8BAAA,EAAA,IAAA,CAAK,aAAa,CAAE,CAAA,CAAA,CAAA;AAAA,GACvE;AAGA,EAAA,MAAM,EAAE,WAAA,EAAgB,GAAA,MAAM,UAAU,YAAa,EAAA,CAAA;AACrD,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAM,MAAA,IAAI,MAAM,EAAE,CAAA,CAAA;AAAA,GACpB;AAGA,EAAA,MAAM,iBAAiB,IAAK,CAAA,cAAA,CAAA;AAC5B,EAAA,MAAM,kBAAqB,GAAA,QAAA,CAAS,IAAK,CAAA,WAAA,EAAa,EAAE,CAAA,CAAA;AAExD,EAAA,IAAI,CAAC,MAAO,CAAA,SAAA,CAAU,kBAAkB,CAAA,IAAK,sBAAsB,CAAG,EAAA;AACpE,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,6CAAA,EAAgD,KAAK,WAAW,CAAA,UAAA,CAAA;AAAA,KAClE,CAAA;AAAA,GACF;AAEA,EAAA,MAAM,UAAU,eAAgB,CAAA;AAAA,IAC9B,WAAa,EAAA,kBAAA;AAAA,IACb,cAAA;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
@@ -2,7 +2,7 @@
2
2
 
3
3
  var path = require('path');
4
4
  var utility = require('./utility-CsspJYjU.cjs.js');
5
- var backendCommon = require('@backstage/backend-common');
5
+ var discovery = require('@backstage/backend-defaults/discovery');
6
6
  var pluginTechdocsNode = require('@backstage/plugin-techdocs-node');
7
7
  var PublisherConfig = require('./PublisherConfig-Cn5i8vF5.cjs.js');
8
8
  require('winston');
@@ -13,8 +13,8 @@ require('@backstage/config');
13
13
  async function publish(opts) {
14
14
  const logger = utility.createLogger({ verbose: opts.verbose });
15
15
  const config = PublisherConfig.PublisherConfig.getValidConfig(opts);
16
- const discovery = backendCommon.HostDiscovery.fromConfig(config);
17
- const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery });
16
+ const discovery$1 = discovery.HostDiscovery.fromConfig(config);
17
+ const publisher = await pluginTechdocsNode.Publisher.fromConfig(config, { logger, discovery: discovery$1 });
18
18
  const { isAvailable } = await publisher.getReadiness();
19
19
  if (!isAvailable) {
20
20
  return Promise.reject(new Error(""));
@@ -33,4 +33,4 @@ async function publish(opts) {
33
33
  }
34
34
 
35
35
  exports.default = publish;
36
- //# sourceMappingURL=publish-CnXRqKHz.cjs.js.map
36
+ //# sourceMappingURL=publish-DH7Mbt7b.cjs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publish-DH7Mbt7b.cjs.js","sources":["../../src/commands/publish/publish.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { resolve } from 'path';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { HostDiscovery } from '@backstage/backend-defaults/discovery';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function publish(opts: OptionValues): Promise<any> {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = HostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n return Promise.reject(new Error(''));\n }\n\n const [namespace, kind, name] = opts.entity.split('/');\n const entity = {\n kind,\n metadata: {\n namespace,\n name,\n },\n } as Entity;\n\n const directory = resolve(opts.directory);\n await publisher.publish({ entity, directory });\n\n return true;\n}\n"],"names":["createLogger","PublisherConfig","discovery","HostDiscovery","Publisher","resolve"],"mappings":";;;;;;;;;;;;AAwBA,eAA8B,QAAQ,IAAkC,EAAA;AACtE,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,MAAA,GAASC,+BAAgB,CAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAClD,EAAM,MAAAC,WAAA,GAAYC,uBAAc,CAAA,UAAA,CAAW,MAAM,CAAA,CAAA;AACjD,EAAM,MAAA,SAAA,GAAY,MAAMC,4BAAU,CAAA,UAAA,CAAW,QAAQ,EAAE,MAAA,aAAQF,aAAW,CAAA,CAAA;AAG1E,EAAA,MAAM,EAAE,WAAA,EAAgB,GAAA,MAAM,UAAU,YAAa,EAAA,CAAA;AACrD,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,EAAE,CAAC,CAAA,CAAA;AAAA,GACrC;AAEA,EAAM,MAAA,CAAC,WAAW,IAAM,EAAA,IAAI,IAAI,IAAK,CAAA,MAAA,CAAO,MAAM,GAAG,CAAA,CAAA;AACrD,EAAA,MAAM,MAAS,GAAA;AAAA,IACb,IAAA;AAAA,IACA,QAAU,EAAA;AAAA,MACR,SAAA;AAAA,MACA,IAAA;AAAA,KACF;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,SAAA,GAAYG,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAA,MAAM,SAAU,CAAA,OAAA,CAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA,CAAA;AAE7C,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}
@@ -125,6 +125,51 @@
125
125
  "$schema": "http://json-schema.org/draft-07/schema#"
126
126
  }
127
127
  },
128
+ {
129
+ "path": "../core-components/config.d.ts",
130
+ "value": {
131
+ "type": "object",
132
+ "properties": {
133
+ "auth": {
134
+ "type": "object",
135
+ "properties": {
136
+ "autologout": {
137
+ "description": "Autologout feature configuration",
138
+ "type": "object",
139
+ "properties": {
140
+ "enabled": {
141
+ "description": "Enable or disable the autologout feature",
142
+ "visibility": "frontend",
143
+ "type": "boolean"
144
+ },
145
+ "idleTimeoutMinutes": {
146
+ "description": "Number of minutes after which the inactive user is logged out automatically.\nDefault is 60 minutes (1 hour)",
147
+ "visibility": "frontend",
148
+ "type": "number"
149
+ },
150
+ "promptBeforeIdleSeconds": {
151
+ "description": "Number of seconds before the idle timeout where the user will be asked if it's still active.\nA dialog will be shown.\nDefault is 10 seconds.\nSet to 0 seconds to disable the prompt.",
152
+ "visibility": "frontend",
153
+ "type": "number"
154
+ },
155
+ "useWorkerTimers": {
156
+ "description": "Enable/disable the usage of worker thread timers instead of main thread timers.\nDefault is true.\nIf you experience some browser incompatibility, you may try to set this to false.",
157
+ "visibility": "frontend",
158
+ "type": "boolean"
159
+ },
160
+ "logoutIfDisconnected": {
161
+ "description": "Enable/disable the automatic logout also on users that are logged in but with no Backstage tabs open.\nDefault is true.",
162
+ "visibility": "frontend",
163
+ "type": "boolean"
164
+ }
165
+ }
166
+ }
167
+ }
168
+ }
169
+ },
170
+ "$schema": "http://json-schema.org/draft-07/schema#"
171
+ }
172
+ },
128
173
  {
129
174
  "path": "../core-app-api/config.d.ts",
130
175
  "value": {
@@ -333,51 +378,6 @@
333
378
  "$schema": "http://json-schema.org/draft-07/schema#"
334
379
  }
335
380
  },
336
- {
337
- "path": "../core-components/config.d.ts",
338
- "value": {
339
- "type": "object",
340
- "properties": {
341
- "auth": {
342
- "type": "object",
343
- "properties": {
344
- "autologout": {
345
- "description": "Autologout feature configuration",
346
- "type": "object",
347
- "properties": {
348
- "enabled": {
349
- "description": "Enable or disable the autologout feature",
350
- "visibility": "frontend",
351
- "type": "boolean"
352
- },
353
- "idleTimeoutMinutes": {
354
- "description": "Number of minutes after which the inactive user is logged out automatically.\nDefault is 60 minutes (1 hour)",
355
- "visibility": "frontend",
356
- "type": "number"
357
- },
358
- "promptBeforeIdleSeconds": {
359
- "description": "Number of seconds before the idle timeout where the user will be asked if it's still active.\nA dialog will be shown.\nDefault is 10 seconds.\nSet to 0 seconds to disable the prompt.",
360
- "visibility": "frontend",
361
- "type": "number"
362
- },
363
- "useWorkerTimers": {
364
- "description": "Enable/disable the usage of worker thread timers instead of main thread timers.\nDefault is true.\nIf you experience some browser incompatibility, you may try to set this to false.",
365
- "visibility": "frontend",
366
- "type": "boolean"
367
- },
368
- "logoutIfDisconnected": {
369
- "description": "Enable/disable the automatic logout also on users that are logged in but with no Backstage tabs open.\nDefault is true.",
370
- "visibility": "frontend",
371
- "type": "boolean"
372
- }
373
- }
374
- }
375
- }
376
- }
377
- },
378
- "$schema": "http://json-schema.org/draft-07/schema#"
379
- }
380
- },
381
381
  {
382
382
  "path": "../../plugins/techdocs/config.d.ts",
383
383
  "value": {
package/dist/index.cjs.js CHANGED
@@ -91,7 +91,7 @@ function registerCommands(program) {
91
91
  "--concurrency <MAX CONCURRENT REQS>",
92
92
  "Optional Controls the number of API requests allowed to be performed simultaneously.",
93
93
  "25"
94
- ).option("-v --verbose", "Enable verbose output.", false).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/migrate-BZzIXl_A.cjs.js'); }).then((m) => m.default)));
94
+ ).option("-v --verbose", "Enable verbose output.", false).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/migrate-Ddd_MQkE.cjs.js'); }).then((m) => m.default)));
95
95
  program.command("publish").description(
96
96
  "Publish generated TechDocs site to an external storage AWS S3, Google GCS, etc."
97
97
  ).requiredOption(
@@ -147,7 +147,7 @@ function registerCommands(program) {
147
147
  "--directory <PATH>",
148
148
  "Path of the directory containing generated files to publish",
149
149
  "./site/"
150
- ).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/publish-CnXRqKHz.cjs.js'); }).then((m) => m.default)));
150
+ ).action(lazy(() => Promise.resolve().then(function () { return require('./cjs/publish-DH7Mbt7b.cjs.js'); }).then((m) => m.default)));
151
151
  program.command("serve:mkdocs").description("Serve a documentation project locally using MkDocs serve.").option(
152
152
  "-i, --docker-image <DOCKER_IMAGE>",
153
153
  "The mkdocs docker container to use",
@@ -228,7 +228,7 @@ function lazy(getActionFunc) {
228
228
  };
229
229
  }
230
230
 
231
- var version = "1.8.12";
231
+ var version = "1.8.14";
232
232
 
233
233
  const main = (argv) => {
234
234
  commander.program.name("techdocs-cli").version(version);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@techdocs/cli",
3
3
  "description": "Utility CLI for managing TechDocs sites in Backstage.",
4
- "version": "1.8.12",
4
+ "version": "1.8.14",
5
5
  "publishConfig": {
6
6
  "access": "public"
7
7
  },
@@ -35,7 +35,7 @@
35
35
  "techdocs-cli": "bin/techdocs-cli"
36
36
  },
37
37
  "devDependencies": {
38
- "@backstage/cli": "^0.26.7",
38
+ "@backstage/cli": "^0.26.9",
39
39
  "@types/commander": "^2.12.2",
40
40
  "@types/fs-extra": "^11.0.0",
41
41
  "@types/http-proxy": "^1.17.4",
@@ -56,11 +56,11 @@
56
56
  "ext": "ts"
57
57
  },
58
58
  "dependencies": {
59
- "@backstage/backend-common": "^0.23.0",
59
+ "@backstage/backend-defaults": "^0.3.2",
60
60
  "@backstage/catalog-model": "^1.5.0",
61
61
  "@backstage/cli-common": "^0.1.14",
62
62
  "@backstage/config": "^1.2.0",
63
- "@backstage/plugin-techdocs-node": "^1.12.5",
63
+ "@backstage/plugin-techdocs-node": "^1.12.6",
64
64
  "commander": "^12.0.0",
65
65
  "fs-extra": "^11.0.0",
66
66
  "global-agent": "^3.0.0",
@@ -1 +0,0 @@
1
- {"version":3,"file":"migrate-BZzIXl_A.cjs.js","sources":["../../src/commands/migrate/migrate.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 { HostDiscovery } from '@backstage/backend-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function migrate(opts: OptionValues) {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = HostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n if (!publisher.migrateDocsCase) {\n throw new Error(`Migration not implemented for ${opts.publisherType}`);\n }\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n throw new Error('');\n }\n\n // Validate and parse migration arguments.\n const removeOriginal = opts.removeOriginal;\n const numericConcurrency = parseInt(opts.concurrency, 10);\n\n if (!Number.isInteger(numericConcurrency) || numericConcurrency <= 0) {\n throw new Error(\n `Concurrency must be a number greater than 1. ${opts.concurrency} provided.`,\n );\n }\n\n await publisher.migrateDocsCase({\n concurrency: numericConcurrency,\n removeOriginal,\n });\n}\n"],"names":["createLogger","PublisherConfig","HostDiscovery","Publisher"],"mappings":";;;;;;;;;;;AAsBA,eAA8B,QAAQ,IAAoB,EAAA;AACxD,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,MAAA,GAASC,+BAAgB,CAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAClD,EAAM,MAAA,SAAA,GAAYC,2BAAc,CAAA,UAAA,CAAW,MAAM,CAAA,CAAA;AACjD,EAAM,MAAA,SAAA,GAAY,MAAMC,4BAAU,CAAA,UAAA,CAAW,QAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA,CAAA;AAE1E,EAAI,IAAA,CAAC,UAAU,eAAiB,EAAA;AAC9B,IAAA,MAAM,IAAI,KAAA,CAAM,CAAiC,8BAAA,EAAA,IAAA,CAAK,aAAa,CAAE,CAAA,CAAA,CAAA;AAAA,GACvE;AAGA,EAAA,MAAM,EAAE,WAAA,EAAgB,GAAA,MAAM,UAAU,YAAa,EAAA,CAAA;AACrD,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAM,MAAA,IAAI,MAAM,EAAE,CAAA,CAAA;AAAA,GACpB;AAGA,EAAA,MAAM,iBAAiB,IAAK,CAAA,cAAA,CAAA;AAC5B,EAAA,MAAM,kBAAqB,GAAA,QAAA,CAAS,IAAK,CAAA,WAAA,EAAa,EAAE,CAAA,CAAA;AAExD,EAAA,IAAI,CAAC,MAAO,CAAA,SAAA,CAAU,kBAAkB,CAAA,IAAK,sBAAsB,CAAG,EAAA;AACpE,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,CAAA,6CAAA,EAAgD,KAAK,WAAW,CAAA,UAAA,CAAA;AAAA,KAClE,CAAA;AAAA,GACF;AAEA,EAAA,MAAM,UAAU,eAAgB,CAAA;AAAA,IAC9B,WAAa,EAAA,kBAAA;AAAA,IACb,cAAA;AAAA,GACD,CAAA,CAAA;AACH;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"publish-CnXRqKHz.cjs.js","sources":["../../src/commands/publish/publish.ts"],"sourcesContent":["/*\n * Copyright 2020 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 { resolve } from 'path';\nimport { OptionValues } from 'commander';\nimport { createLogger } from '../../lib/utility';\nimport { HostDiscovery } from '@backstage/backend-common';\nimport { Publisher } from '@backstage/plugin-techdocs-node';\nimport { Entity } from '@backstage/catalog-model';\nimport { PublisherConfig } from '../../lib/PublisherConfig';\n\nexport default async function publish(opts: OptionValues): Promise<any> {\n const logger = createLogger({ verbose: opts.verbose });\n\n const config = PublisherConfig.getValidConfig(opts);\n const discovery = HostDiscovery.fromConfig(config);\n const publisher = await Publisher.fromConfig(config, { logger, discovery });\n\n // Check that the publisher's underlying storage is ready and available.\n const { isAvailable } = await publisher.getReadiness();\n if (!isAvailable) {\n // Error messages printed in getReadiness() call. This ensures exit code 1.\n return Promise.reject(new Error(''));\n }\n\n const [namespace, kind, name] = opts.entity.split('/');\n const entity = {\n kind,\n metadata: {\n namespace,\n name,\n },\n } as Entity;\n\n const directory = resolve(opts.directory);\n await publisher.publish({ entity, directory });\n\n return true;\n}\n"],"names":["createLogger","PublisherConfig","HostDiscovery","Publisher","resolve"],"mappings":";;;;;;;;;;;;AAwBA,eAA8B,QAAQ,IAAkC,EAAA;AACtE,EAAA,MAAM,SAASA,oBAAa,CAAA,EAAE,OAAS,EAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AAErD,EAAM,MAAA,MAAA,GAASC,+BAAgB,CAAA,cAAA,CAAe,IAAI,CAAA,CAAA;AAClD,EAAM,MAAA,SAAA,GAAYC,2BAAc,CAAA,UAAA,CAAW,MAAM,CAAA,CAAA;AACjD,EAAM,MAAA,SAAA,GAAY,MAAMC,4BAAU,CAAA,UAAA,CAAW,QAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA,CAAA;AAG1E,EAAA,MAAM,EAAE,WAAA,EAAgB,GAAA,MAAM,UAAU,YAAa,EAAA,CAAA;AACrD,EAAA,IAAI,CAAC,WAAa,EAAA;AAEhB,IAAA,OAAO,OAAQ,CAAA,MAAA,CAAO,IAAI,KAAA,CAAM,EAAE,CAAC,CAAA,CAAA;AAAA,GACrC;AAEA,EAAM,MAAA,CAAC,WAAW,IAAM,EAAA,IAAI,IAAI,IAAK,CAAA,MAAA,CAAO,MAAM,GAAG,CAAA,CAAA;AACrD,EAAA,MAAM,MAAS,GAAA;AAAA,IACb,IAAA;AAAA,IACA,QAAU,EAAA;AAAA,MACR,SAAA;AAAA,MACA,IAAA;AAAA,KACF;AAAA,GACF,CAAA;AAEA,EAAM,MAAA,SAAA,GAAYC,YAAQ,CAAA,IAAA,CAAK,SAAS,CAAA,CAAA;AACxC,EAAA,MAAM,SAAU,CAAA,OAAA,CAAQ,EAAE,MAAA,EAAQ,WAAW,CAAA,CAAA;AAE7C,EAAO,OAAA,IAAA,CAAA;AACT;;;;"}