@backstage/plugin-techdocs-backend 0.0.0-nightly-20220306022754 → 0.0.0-nightly-20220309022441

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,18 +1,20 @@
1
1
  # @backstage/plugin-techdocs-backend
2
2
 
3
- ## 0.0.0-nightly-20220306022754
3
+ ## 0.0.0-nightly-20220309022441
4
4
 
5
5
  ### Patch Changes
6
6
 
7
+ - e0a69ba49f: build(deps): bump `fs-extra` from 9.1.0 to 10.0.1
8
+ - 3c2bc73901: Use `setupRequestMockHandlers` from `@backstage/backend-test-utils`
7
9
  - 3e54f6c436: Use `@backstage/plugin-search-common` package instead of `@backstage/search-common`.
8
10
  - 91bf1e6c1a: Use `@backstage/plugin-techdocs-node` package instead of `@backstage/techdocs-common`.
9
11
  - Updated dependencies
10
- - @backstage/catalog-model@0.0.0-nightly-20220306022754
11
- - @backstage/backend-common@0.0.0-nightly-20220306022754
12
- - @backstage/plugin-catalog-common@0.0.0-nightly-20220306022754
13
- - @backstage/plugin-search-common@0.0.0-nightly-20220306022754
14
- - @backstage/plugin-techdocs-node@0.0.0-nightly-20220306022754
15
- - @backstage/catalog-client@0.0.0-nightly-20220306022754
12
+ - @backstage/backend-common@0.0.0-nightly-20220309022441
13
+ - @backstage/plugin-techdocs-node@0.0.0-nightly-20220309022441
14
+ - @backstage/catalog-model@0.0.0-nightly-20220309022441
15
+ - @backstage/plugin-catalog-common@0.0.0-nightly-20220309022441
16
+ - @backstage/plugin-search-common@0.0.0-nightly-20220309022441
17
+ - @backstage/catalog-client@0.0.0-nightly-20220309022441
16
18
 
17
19
  ## 0.14.1
18
20
 
@@ -0,0 +1,150 @@
1
+ /// <reference types="node" />
2
+ import { PluginEndpointDiscovery, PluginCacheManager, TokenManager } from '@backstage/backend-common';
3
+ import { Config } from '@backstage/config';
4
+ import { PreparerBuilder, GeneratorBuilder, PublisherBase, TechDocsDocument } from '@backstage/plugin-techdocs-node';
5
+ export * from '@backstage/plugin-techdocs-node';
6
+ export { TechDocsDocument } from '@backstage/plugin-techdocs-node';
7
+ import express from 'express';
8
+ import { Knex } from 'knex';
9
+ import { Logger } from 'winston';
10
+ import { Entity } from '@backstage/catalog-model';
11
+ import * as _backstage_plugin_permission_common from '@backstage/plugin-permission-common';
12
+ import { CatalogApi } from '@backstage/catalog-client';
13
+ import { DocumentCollatorFactory } from '@backstage/plugin-search-common';
14
+ import { Readable } from 'stream';
15
+
16
+ /**
17
+ * Parameters passed to the shouldBuild method on the DocsBuildStrategy interface
18
+ *
19
+ * @public
20
+ */
21
+ declare type ShouldBuildParameters = {
22
+ entity: Entity;
23
+ };
24
+ /**
25
+ * A strategy for when to build TechDocs locally, and when to skip building TechDocs (allowing for an external build)
26
+ *
27
+ * @public
28
+ */
29
+ interface DocsBuildStrategy {
30
+ shouldBuild(params: ShouldBuildParameters): Promise<boolean>;
31
+ }
32
+
33
+ /**
34
+ * Required dependencies for running TechDocs in the "out-of-the-box"
35
+ * deployment configuration (prepare/generate/publish all in the Backend).
36
+ *
37
+ * @public
38
+ */
39
+ declare type OutOfTheBoxDeploymentOptions = {
40
+ preparers: PreparerBuilder;
41
+ generators: GeneratorBuilder;
42
+ publisher: PublisherBase;
43
+ logger: Logger;
44
+ discovery: PluginEndpointDiscovery;
45
+ database?: Knex;
46
+ config: Config;
47
+ cache: PluginCacheManager;
48
+ docsBuildStrategy?: DocsBuildStrategy;
49
+ };
50
+ /**
51
+ * Required dependencies for running TechDocs in the "recommended" deployment
52
+ * configuration (prepare/generate handled externally in CI/CD).
53
+ *
54
+ * @public
55
+ */
56
+ declare type RecommendedDeploymentOptions = {
57
+ publisher: PublisherBase;
58
+ logger: Logger;
59
+ discovery: PluginEndpointDiscovery;
60
+ config: Config;
61
+ cache: PluginCacheManager;
62
+ docsBuildStrategy?: DocsBuildStrategy;
63
+ };
64
+ /**
65
+ * One of the two deployment configurations must be provided.
66
+ *
67
+ * @public
68
+ */
69
+ declare type RouterOptions = RecommendedDeploymentOptions | OutOfTheBoxDeploymentOptions;
70
+ /**
71
+ * Creates a techdocs router.
72
+ *
73
+ * @public
74
+ */
75
+ declare function createRouter(options: RouterOptions): Promise<express.Router>;
76
+
77
+ /**
78
+ * Options to configure the TechDocs collator factory
79
+ *
80
+ * @public
81
+ */
82
+ declare type TechDocsCollatorFactoryOptions = {
83
+ discovery: PluginEndpointDiscovery;
84
+ logger: Logger;
85
+ tokenManager: TokenManager;
86
+ locationTemplate?: string;
87
+ catalogClient?: CatalogApi;
88
+ parallelismLimit?: number;
89
+ legacyPathCasing?: boolean;
90
+ };
91
+ /**
92
+ * A search collator factory responsible for gathering and transforming
93
+ * TechDocs documents.
94
+ *
95
+ * @public
96
+ */
97
+ declare class DefaultTechDocsCollatorFactory implements DocumentCollatorFactory {
98
+ readonly type: string;
99
+ readonly visibilityPermission: _backstage_plugin_permission_common.Permission;
100
+ private discovery;
101
+ private locationTemplate;
102
+ private readonly logger;
103
+ private readonly catalogClient;
104
+ private readonly tokenManager;
105
+ private readonly parallelismLimit;
106
+ private readonly legacyPathCasing;
107
+ private constructor();
108
+ static fromConfig(config: Config, options: TechDocsCollatorFactoryOptions): DefaultTechDocsCollatorFactory;
109
+ getCollator(): Promise<Readable>;
110
+ private execute;
111
+ private applyArgsToFormat;
112
+ private static constructDocsIndexUrl;
113
+ private static handleEntityInfoCasing;
114
+ }
115
+
116
+ /**
117
+ * Options to configure the TechDocs collator
118
+ *
119
+ * @public
120
+ */
121
+ declare type TechDocsCollatorOptions = {
122
+ discovery: PluginEndpointDiscovery;
123
+ logger: Logger;
124
+ tokenManager: TokenManager;
125
+ locationTemplate?: string;
126
+ catalogClient?: CatalogApi;
127
+ parallelismLimit?: number;
128
+ legacyPathCasing?: boolean;
129
+ };
130
+ /**
131
+ * A search collator responsible for gathering and transforming TechDocs documents.
132
+ *
133
+ * @public
134
+ * @deprecated Upgrade to a more recent `@backstage/search-backend-node` and
135
+ * use `DefaultTechDocsCollatorFactory` instead.
136
+ */
137
+ declare class DefaultTechDocsCollator {
138
+ private readonly legacyPathCasing;
139
+ private readonly options;
140
+ readonly type: string;
141
+ readonly visibilityPermission: _backstage_plugin_permission_common.Permission;
142
+ private constructor();
143
+ static fromConfig(config: Config, options: TechDocsCollatorOptions): DefaultTechDocsCollator;
144
+ execute(): Promise<TechDocsDocument[]>;
145
+ protected applyArgsToFormat(format: string, args: Record<string, string>): string;
146
+ private static constructDocsIndexUrl;
147
+ private static handleEntityInfoCasing;
148
+ }
149
+
150
+ export { DefaultTechDocsCollator, DefaultTechDocsCollatorFactory, DocsBuildStrategy, OutOfTheBoxDeploymentOptions, RecommendedDeploymentOptions, RouterOptions, ShouldBuildParameters, TechDocsCollatorFactoryOptions, TechDocsCollatorOptions, createRouter };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@backstage/plugin-techdocs-backend",
3
3
  "description": "The Backstage backend plugin that renders technical documentation for your components",
4
- "version": "0.0.0-nightly-20220306022754",
4
+ "version": "0.0.0-nightly-20220309022441",
5
5
  "main": "dist/index.cjs.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -34,20 +34,20 @@
34
34
  "clean": "backstage-cli package clean"
35
35
  },
36
36
  "dependencies": {
37
- "@backstage/backend-common": "^0.0.0-nightly-20220306022754",
38
- "@backstage/catalog-client": "^0.0.0-nightly-20220306022754",
39
- "@backstage/catalog-model": "^0.0.0-nightly-20220306022754",
37
+ "@backstage/backend-common": "^0.0.0-nightly-20220309022441",
38
+ "@backstage/catalog-client": "^0.0.0-nightly-20220309022441",
39
+ "@backstage/catalog-model": "^0.0.0-nightly-20220309022441",
40
40
  "@backstage/config": "^0.1.15",
41
41
  "@backstage/errors": "^0.2.2",
42
42
  "@backstage/integration": "^0.8.0",
43
- "@backstage/plugin-catalog-common": "^0.0.0-nightly-20220306022754",
44
- "@backstage/plugin-search-common": "^0.0.0-nightly-20220306022754",
45
- "@backstage/plugin-techdocs-node": "^0.0.0-nightly-20220306022754",
43
+ "@backstage/plugin-catalog-common": "^0.0.0-nightly-20220309022441",
44
+ "@backstage/plugin-search-common": "^0.0.0-nightly-20220309022441",
45
+ "@backstage/plugin-techdocs-node": "^0.0.0-nightly-20220309022441",
46
46
  "@types/express": "^4.17.6",
47
47
  "dockerode": "^3.3.1",
48
48
  "express": "^4.17.1",
49
49
  "express-promise-router": "^4.1.0",
50
- "fs-extra": "9.1.0",
50
+ "fs-extra": "10.0.1",
51
51
  "knex": "^1.0.2",
52
52
  "lodash": "^4.17.21",
53
53
  "node-fetch": "^2.6.7",
@@ -55,9 +55,9 @@
55
55
  "winston": "^3.2.1"
56
56
  },
57
57
  "devDependencies": {
58
- "@backstage/cli": "^0.0.0-nightly-20220306022754",
59
- "@backstage/plugin-search-backend-node": "0.0.0-nightly-20220306022754",
60
- "@backstage/test-utils": "^0.3.0",
58
+ "@backstage/backend-test-utils": "^0.0.0-nightly-20220309022441",
59
+ "@backstage/cli": "^0.0.0-nightly-20220309022441",
60
+ "@backstage/plugin-search-backend-node": "0.0.0-nightly-20220309022441",
61
61
  "@types/dockerode": "^3.3.0",
62
62
  "msw": "^0.35.0",
63
63
  "supertest": "^6.1.3"