@backstage/plugin-catalog-backend-module-msgraph 0.7.1 → 0.7.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,29 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-backend-module-msgraph
|
|
2
2
|
|
|
3
|
+
## 0.7.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 3507fcd: Just some more circular dep cleanup
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/config@1.3.3
|
|
10
|
+
- @backstage/catalog-model@1.7.5
|
|
11
|
+
- @backstage/backend-plugin-api@1.4.1
|
|
12
|
+
- @backstage/plugin-catalog-common@1.1.5
|
|
13
|
+
- @backstage/plugin-catalog-node@1.17.2
|
|
14
|
+
|
|
15
|
+
## 0.7.2-next.0
|
|
16
|
+
|
|
17
|
+
### Patch Changes
|
|
18
|
+
|
|
19
|
+
- 3507fcd: Just some more circular dep cleanup
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
- @backstage/config@1.3.3-next.0
|
|
22
|
+
- @backstage/catalog-model@1.7.5-next.0
|
|
23
|
+
- @backstage/backend-plugin-api@1.4.1-next.0
|
|
24
|
+
- @backstage/plugin-catalog-common@1.1.5-next.0
|
|
25
|
+
- @backstage/plugin-catalog-node@1.17.2-next.0
|
|
26
|
+
|
|
3
27
|
## 0.7.1
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,55 +1,12 @@
|
|
|
1
1
|
import * as _backstage_backend_plugin_api from '@backstage/backend-plugin-api';
|
|
2
2
|
import { SchedulerServiceTaskScheduleDefinition, LoggerService, SchedulerServiceTaskRunner, SchedulerService } from '@backstage/backend-plugin-api';
|
|
3
|
-
import {
|
|
4
|
-
import { TokenCredential } from '@azure/identity';
|
|
3
|
+
import { UserEntity, GroupEntity } from '@backstage/catalog-model';
|
|
5
4
|
import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';
|
|
6
5
|
import { Config } from '@backstage/config';
|
|
7
|
-
import {
|
|
6
|
+
import { TokenCredential } from '@azure/identity';
|
|
8
7
|
import { EntityProvider, EntityProviderConnection, CatalogProcessor, CatalogProcessorEmit } from '@backstage/plugin-catalog-node';
|
|
9
8
|
import { LocationSpec } from '@backstage/plugin-catalog-common';
|
|
10
9
|
|
|
11
|
-
/**
|
|
12
|
-
* Interface for {@link microsoftGraphOrgEntityProviderTransformExtensionPoint}.
|
|
13
|
-
*
|
|
14
|
-
* @public
|
|
15
|
-
*/
|
|
16
|
-
interface MicrosoftGraphOrgEntityProviderTransformsExtensionPoint {
|
|
17
|
-
/**
|
|
18
|
-
* Set the function that transforms a user entry in msgraph to an entity.
|
|
19
|
-
* Optionally, you can pass separate transformers per provider ID.
|
|
20
|
-
*/
|
|
21
|
-
setUserTransformer(transformer: UserTransformer$1 | Record<string, UserTransformer$1>): void;
|
|
22
|
-
/**
|
|
23
|
-
* Set the function that transforms a group entry in msgraph to an entity.
|
|
24
|
-
* Optionally, you can pass separate transformers per provider ID.
|
|
25
|
-
*/
|
|
26
|
-
setGroupTransformer(transformer: GroupTransformer$1 | Record<string, GroupTransformer$1>): void;
|
|
27
|
-
/**
|
|
28
|
-
* Set the function that transforms an organization entry in msgraph to an entity.
|
|
29
|
-
* Optionally, you can pass separate transformers per provider ID.
|
|
30
|
-
*/
|
|
31
|
-
setOrganizationTransformer(transformer: OrganizationTransformer$1 | Record<string, OrganizationTransformer$1>): void;
|
|
32
|
-
/**
|
|
33
|
-
* Set the function that transforms provider config dynamically.
|
|
34
|
-
* Optionally, you can pass separate transformers per provider ID.
|
|
35
|
-
* Note: adjusting fields that are not used on each scheduled ingestion
|
|
36
|
-
* (e.g., id, schedule) will have no effect.
|
|
37
|
-
*/
|
|
38
|
-
setProviderConfigTransformer(transformer: ProviderConfigTransformer$1 | Record<string, ProviderConfigTransformer$1>): void;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Extension point used to customize the transforms used by the module.
|
|
42
|
-
*
|
|
43
|
-
* @public
|
|
44
|
-
*/
|
|
45
|
-
declare const microsoftGraphOrgEntityProviderTransformExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<MicrosoftGraphOrgEntityProviderTransformsExtensionPoint>;
|
|
46
|
-
/**
|
|
47
|
-
* Registers the MicrosoftGraphOrgEntityProvider with the catalog processing extension point.
|
|
48
|
-
*
|
|
49
|
-
* @public
|
|
50
|
-
*/
|
|
51
|
-
declare const catalogModuleMicrosoftGraphOrgEntityProvider: _backstage_backend_plugin_api.BackendFeature;
|
|
52
|
-
|
|
53
10
|
/**
|
|
54
11
|
* The configuration parameters for a single Microsoft Graph provider.
|
|
55
12
|
*
|
|
@@ -208,6 +165,76 @@ declare function readProviderConfigs(config: Config): MicrosoftGraphProviderConf
|
|
|
208
165
|
*/
|
|
209
166
|
declare function readProviderConfig(id: string, config: Config): MicrosoftGraphProviderConfig;
|
|
210
167
|
|
|
168
|
+
/**
|
|
169
|
+
* Customize the ingested User entity
|
|
170
|
+
*
|
|
171
|
+
* @public
|
|
172
|
+
*/
|
|
173
|
+
type UserTransformer = (user: MicrosoftGraph.User, userPhoto?: string) => Promise<UserEntity | undefined>;
|
|
174
|
+
/**
|
|
175
|
+
* Customize the ingested organization Group entity
|
|
176
|
+
*
|
|
177
|
+
* @public
|
|
178
|
+
*/
|
|
179
|
+
type OrganizationTransformer = (organization: MicrosoftGraph.Organization) => Promise<GroupEntity | undefined>;
|
|
180
|
+
/**
|
|
181
|
+
* Customize the ingested Group entity
|
|
182
|
+
*
|
|
183
|
+
* @public
|
|
184
|
+
*/
|
|
185
|
+
type GroupTransformer = (group: MicrosoftGraph.Group, groupPhoto?: string) => Promise<GroupEntity | undefined>;
|
|
186
|
+
/**
|
|
187
|
+
* Customize the MSGraph Provider Config Dynamically
|
|
188
|
+
*
|
|
189
|
+
* Transforming fields that are not used for each scheduled ingestion (e.g., id, schedule)
|
|
190
|
+
* will have no effect.
|
|
191
|
+
*
|
|
192
|
+
* @public
|
|
193
|
+
*/
|
|
194
|
+
type ProviderConfigTransformer = (provider: MicrosoftGraphProviderConfig) => Promise<MicrosoftGraphProviderConfig>;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Interface for {@link microsoftGraphOrgEntityProviderTransformExtensionPoint}.
|
|
198
|
+
*
|
|
199
|
+
* @public
|
|
200
|
+
*/
|
|
201
|
+
interface MicrosoftGraphOrgEntityProviderTransformsExtensionPoint {
|
|
202
|
+
/**
|
|
203
|
+
* Set the function that transforms a user entry in msgraph to an entity.
|
|
204
|
+
* Optionally, you can pass separate transformers per provider ID.
|
|
205
|
+
*/
|
|
206
|
+
setUserTransformer(transformer: UserTransformer | Record<string, UserTransformer>): void;
|
|
207
|
+
/**
|
|
208
|
+
* Set the function that transforms a group entry in msgraph to an entity.
|
|
209
|
+
* Optionally, you can pass separate transformers per provider ID.
|
|
210
|
+
*/
|
|
211
|
+
setGroupTransformer(transformer: GroupTransformer | Record<string, GroupTransformer>): void;
|
|
212
|
+
/**
|
|
213
|
+
* Set the function that transforms an organization entry in msgraph to an entity.
|
|
214
|
+
* Optionally, you can pass separate transformers per provider ID.
|
|
215
|
+
*/
|
|
216
|
+
setOrganizationTransformer(transformer: OrganizationTransformer | Record<string, OrganizationTransformer>): void;
|
|
217
|
+
/**
|
|
218
|
+
* Set the function that transforms provider config dynamically.
|
|
219
|
+
* Optionally, you can pass separate transformers per provider ID.
|
|
220
|
+
* Note: adjusting fields that are not used on each scheduled ingestion
|
|
221
|
+
* (e.g., id, schedule) will have no effect.
|
|
222
|
+
*/
|
|
223
|
+
setProviderConfigTransformer(transformer: ProviderConfigTransformer | Record<string, ProviderConfigTransformer>): void;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Extension point used to customize the transforms used by the module.
|
|
227
|
+
*
|
|
228
|
+
* @public
|
|
229
|
+
*/
|
|
230
|
+
declare const microsoftGraphOrgEntityProviderTransformExtensionPoint: _backstage_backend_plugin_api.ExtensionPoint<MicrosoftGraphOrgEntityProviderTransformsExtensionPoint>;
|
|
231
|
+
/**
|
|
232
|
+
* Registers the MicrosoftGraphOrgEntityProvider with the catalog processing extension point.
|
|
233
|
+
*
|
|
234
|
+
* @public
|
|
235
|
+
*/
|
|
236
|
+
declare const catalogModuleMicrosoftGraphOrgEntityProvider: _backstage_backend_plugin_api.BackendFeature;
|
|
237
|
+
|
|
211
238
|
/**
|
|
212
239
|
* OData (Open Data Protocol) Query
|
|
213
240
|
*
|
|
@@ -440,34 +467,6 @@ declare function defaultGroupTransformer(group: MicrosoftGraph.Group, groupPhoto
|
|
|
440
467
|
*/
|
|
441
468
|
declare function defaultUserTransformer(user: MicrosoftGraph.User, userPhoto?: string): Promise<UserEntity | undefined>;
|
|
442
469
|
|
|
443
|
-
/**
|
|
444
|
-
* Customize the ingested User entity
|
|
445
|
-
*
|
|
446
|
-
* @public
|
|
447
|
-
*/
|
|
448
|
-
type UserTransformer = (user: MicrosoftGraph.User, userPhoto?: string) => Promise<UserEntity | undefined>;
|
|
449
|
-
/**
|
|
450
|
-
* Customize the ingested organization Group entity
|
|
451
|
-
*
|
|
452
|
-
* @public
|
|
453
|
-
*/
|
|
454
|
-
type OrganizationTransformer = (organization: MicrosoftGraph.Organization) => Promise<GroupEntity | undefined>;
|
|
455
|
-
/**
|
|
456
|
-
* Customize the ingested Group entity
|
|
457
|
-
*
|
|
458
|
-
* @public
|
|
459
|
-
*/
|
|
460
|
-
type GroupTransformer = (group: MicrosoftGraph.Group, groupPhoto?: string) => Promise<GroupEntity | undefined>;
|
|
461
|
-
/**
|
|
462
|
-
* Customize the MSGraph Provider Config Dynamically
|
|
463
|
-
*
|
|
464
|
-
* Transforming fields that are not used for each scheduled ingestion (e.g., id, schedule)
|
|
465
|
-
* will have no effect.
|
|
466
|
-
*
|
|
467
|
-
* @public
|
|
468
|
-
*/
|
|
469
|
-
type ProviderConfigTransformer = (provider: MicrosoftGraphProviderConfig) => Promise<MicrosoftGraphProviderConfig>;
|
|
470
|
-
|
|
471
470
|
/**
|
|
472
471
|
* Reads an entire org as Group and User entities.
|
|
473
472
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"catalogModuleMicrosoftGraphOrgEntityProvider.cjs.js","sources":["../../src/module/catalogModuleMicrosoftGraphOrgEntityProvider.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {\n coreServices,\n createBackendModule,\n createExtensionPoint,\n} from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\nimport {\n GroupTransformer,\n OrganizationTransformer,\n ProviderConfigTransformer,\n UserTransformer,\n} from '
|
|
1
|
+
{"version":3,"file":"catalogModuleMicrosoftGraphOrgEntityProvider.cjs.js","sources":["../../src/module/catalogModuleMicrosoftGraphOrgEntityProvider.ts"],"sourcesContent":["/*\n * Copyright 2022 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 {\n coreServices,\n createBackendModule,\n createExtensionPoint,\n} from '@backstage/backend-plugin-api';\nimport { catalogProcessingExtensionPoint } from '@backstage/plugin-catalog-node/alpha';\nimport {\n GroupTransformer,\n OrganizationTransformer,\n ProviderConfigTransformer,\n UserTransformer,\n} from '../microsoftGraph/types';\nimport { MicrosoftGraphOrgEntityProvider } from '../processors';\n\n/**\n * Interface for {@link microsoftGraphOrgEntityProviderTransformExtensionPoint}.\n *\n * @public\n */\nexport interface MicrosoftGraphOrgEntityProviderTransformsExtensionPoint {\n /**\n * Set the function that transforms a user entry in msgraph to an entity.\n * Optionally, you can pass separate transformers per provider ID.\n */\n setUserTransformer(\n transformer: UserTransformer | Record<string, UserTransformer>,\n ): void;\n\n /**\n * Set the function that transforms a group entry in msgraph to an entity.\n * Optionally, you can pass separate transformers per provider ID.\n */\n setGroupTransformer(\n transformer: GroupTransformer | Record<string, GroupTransformer>,\n ): void;\n\n /**\n * Set the function that transforms an organization entry in msgraph to an entity.\n * Optionally, you can pass separate transformers per provider ID.\n */\n setOrganizationTransformer(\n transformer:\n | OrganizationTransformer\n | Record<string, OrganizationTransformer>,\n ): void;\n\n /**\n * Set the function that transforms provider config dynamically.\n * Optionally, you can pass separate transformers per provider ID.\n * Note: adjusting fields that are not used on each scheduled ingestion\n * (e.g., id, schedule) will have no effect.\n */\n setProviderConfigTransformer(\n transformer:\n | ProviderConfigTransformer\n | Record<string, ProviderConfigTransformer>,\n ): void;\n}\n\n/**\n * Extension point used to customize the transforms used by the module.\n *\n * @public\n */\nexport const microsoftGraphOrgEntityProviderTransformExtensionPoint =\n createExtensionPoint<MicrosoftGraphOrgEntityProviderTransformsExtensionPoint>(\n {\n id: 'catalog.microsoftGraphOrgEntityProvider.transforms',\n },\n );\n\n/**\n * Registers the MicrosoftGraphOrgEntityProvider with the catalog processing extension point.\n *\n * @public\n */\nexport const catalogModuleMicrosoftGraphOrgEntityProvider = createBackendModule(\n {\n pluginId: 'catalog',\n moduleId: 'microsoftGraphOrgEntityProvider',\n register(env) {\n let userTransformer:\n | UserTransformer\n | Record<string, UserTransformer>\n | undefined;\n let groupTransformer:\n | GroupTransformer\n | Record<string, GroupTransformer>\n | undefined;\n let organizationTransformer:\n | OrganizationTransformer\n | Record<string, OrganizationTransformer>\n | undefined;\n let providerConfigTransformer:\n | ProviderConfigTransformer\n | Record<string, ProviderConfigTransformer>\n | undefined;\n\n env.registerExtensionPoint(\n microsoftGraphOrgEntityProviderTransformExtensionPoint,\n {\n setUserTransformer(transformer) {\n if (userTransformer) {\n throw new Error('User transformer may only be set once');\n }\n userTransformer = transformer;\n },\n setGroupTransformer(transformer) {\n if (groupTransformer) {\n throw new Error('Group transformer may only be set once');\n }\n groupTransformer = transformer;\n },\n setOrganizationTransformer(transformer) {\n if (organizationTransformer) {\n throw new Error('Organization transformer may only be set once');\n }\n organizationTransformer = transformer;\n },\n setProviderConfigTransformer(transformer) {\n if (providerConfigTransformer) {\n throw new Error('Provider transformer may only be set once');\n }\n providerConfigTransformer = transformer;\n },\n },\n );\n\n env.registerInit({\n deps: {\n catalog: catalogProcessingExtensionPoint,\n config: coreServices.rootConfig,\n logger: coreServices.logger,\n scheduler: coreServices.scheduler,\n },\n async init({ catalog, config, logger, scheduler }) {\n catalog.addEntityProvider(\n MicrosoftGraphOrgEntityProvider.fromConfig(config, {\n logger,\n scheduler,\n userTransformer: userTransformer,\n groupTransformer: groupTransformer,\n organizationTransformer: organizationTransformer,\n providerConfigTransformer: providerConfigTransformer,\n }),\n );\n },\n });\n },\n },\n);\n"],"names":["createExtensionPoint","createBackendModule","catalogProcessingExtensionPoint","coreServices","MicrosoftGraphOrgEntityProvider"],"mappings":";;;;;;;;;;;;AAgFO,MAAM,sDACX,GAAAA,qCAAA;AAAA,EACE;AAAA,IACE,EAAI,EAAA;AAAA;AAER;AAOK,MAAM,4CAA+C,GAAAC,oCAAA;AAAA,EAC1D;AAAA,IACE,QAAU,EAAA,SAAA;AAAA,IACV,QAAU,EAAA,iCAAA;AAAA,IACV,SAAS,GAAK,EAAA;AACZ,MAAI,IAAA,eAAA;AAIJ,MAAI,IAAA,gBAAA;AAIJ,MA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A,aACD;AAAA,WACH;AAAA;AACF,OACD,CAAA;AAAA;AACH;AAEJ;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-backend-module-msgraph",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.2",
|
|
4
4
|
"description": "A Backstage catalog backend module that helps integrate towards Microsoft Graph",
|
|
5
5
|
"backstage": {
|
|
6
6
|
"role": "backend-plugin-module",
|
|
@@ -66,11 +66,11 @@
|
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@azure/identity": "^4.0.0",
|
|
69
|
-
"@backstage/backend-plugin-api": "^1.4.
|
|
70
|
-
"@backstage/catalog-model": "^1.7.
|
|
71
|
-
"@backstage/config": "^1.3.
|
|
72
|
-
"@backstage/plugin-catalog-common": "^1.1.
|
|
73
|
-
"@backstage/plugin-catalog-node": "^1.17.
|
|
69
|
+
"@backstage/backend-plugin-api": "^1.4.1",
|
|
70
|
+
"@backstage/catalog-model": "^1.7.5",
|
|
71
|
+
"@backstage/config": "^1.3.3",
|
|
72
|
+
"@backstage/plugin-catalog-common": "^1.1.5",
|
|
73
|
+
"@backstage/plugin-catalog-node": "^1.17.2",
|
|
74
74
|
"@microsoft/microsoft-graph-types": "^2.6.0",
|
|
75
75
|
"lodash": "^4.17.21",
|
|
76
76
|
"p-limit": "^3.0.2",
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"uuid": "^11.0.0"
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
|
-
"@backstage/backend-test-utils": "^1.
|
|
82
|
-
"@backstage/cli": "^0.33.
|
|
81
|
+
"@backstage/backend-test-utils": "^1.7.0",
|
|
82
|
+
"@backstage/cli": "^0.33.1",
|
|
83
83
|
"@types/lodash": "^4.14.151",
|
|
84
84
|
"luxon": "^3.0.0",
|
|
85
85
|
"msw": "^1.0.0"
|