@backstage/plugin-catalog-backend-module-incremental-ingestion 0.3.3-next.2 → 0.3.3
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 +17 -0
- package/README.md +8 -8
- package/alpha/package.json +1 -1
- package/package.json +15 -15
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @backstage/plugin-catalog-backend-module-incremental-ingestion
|
|
2
2
|
|
|
3
|
+
## 0.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 53309661cb5c: Update installation guide to fix inconsistency in type names
|
|
8
|
+
- Updated dependencies
|
|
9
|
+
- @backstage/backend-common@0.19.0
|
|
10
|
+
- @backstage/plugin-catalog-backend@1.10.0
|
|
11
|
+
- @backstage/catalog-model@1.4.0
|
|
12
|
+
- @backstage/errors@1.2.0
|
|
13
|
+
- @backstage/backend-plugin-api@0.5.3
|
|
14
|
+
- @backstage/backend-tasks@0.5.3
|
|
15
|
+
- @backstage/plugin-catalog-node@1.3.7
|
|
16
|
+
- @backstage/config@1.0.8
|
|
17
|
+
- @backstage/plugin-events-node@0.2.7
|
|
18
|
+
- @backstage/plugin-permission-common@0.7.6
|
|
19
|
+
|
|
3
20
|
## 0.3.3-next.2
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -175,17 +175,17 @@ import { IncrementalEntityProvider } from '@backstage/plugin-catalog-backend-mod
|
|
|
175
175
|
|
|
176
176
|
// This will include your pagination information, let's say our API accepts a `page` parameter.
|
|
177
177
|
// In this case, the cursor will include `page`
|
|
178
|
-
interface
|
|
178
|
+
interface Cursor {
|
|
179
179
|
page: number;
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
// This interface describes the type of data that will be passed to your burst function.
|
|
183
|
-
interface
|
|
183
|
+
interface Context {
|
|
184
184
|
apiClient: MyApiClient;
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
export class MyIncrementalEntityProvider
|
|
188
|
-
implements IncrementalEntityProvider<
|
|
188
|
+
implements IncrementalEntityProvider<Cursor, Context>
|
|
189
189
|
{
|
|
190
190
|
getProviderName() {
|
|
191
191
|
return `MyIncrementalEntityProvider`;
|
|
@@ -203,7 +203,7 @@ export class MyIncrementalEntityProvider
|
|
|
203
203
|
return `MyIncrementalEntityProvider`;
|
|
204
204
|
}
|
|
205
205
|
|
|
206
|
-
async around(burst: (context:
|
|
206
|
+
async around(burst: (context: Context) => Promise<void>): Promise<void> {
|
|
207
207
|
const apiClient = new MyApiClient();
|
|
208
208
|
|
|
209
209
|
await burst({ apiClient });
|
|
@@ -229,7 +229,7 @@ export class MyIncrementalEntityProvider
|
|
|
229
229
|
return `MyIncrementalEntityProvider`;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
-
async around(burst: (context:
|
|
232
|
+
async around(burst: (context: Context) => Promise<void>): Promise<void> {
|
|
233
233
|
const apiClient = new MyApiClient(this.token);
|
|
234
234
|
|
|
235
235
|
await burst({ apiClient });
|
|
@@ -240,7 +240,7 @@ export class MyIncrementalEntityProvider
|
|
|
240
240
|
The last step is to implement the actual `next` method that will accept the cursor, call the API, process the result and return the result.
|
|
241
241
|
|
|
242
242
|
```ts
|
|
243
|
-
export class MyIncrementalEntityProvider implements IncrementalEntityProvider<
|
|
243
|
+
export class MyIncrementalEntityProvider implements IncrementalEntityProvider<Cursor, Context> {
|
|
244
244
|
|
|
245
245
|
token: string;
|
|
246
246
|
|
|
@@ -253,14 +253,14 @@ export class MyIncrementalEntityProvider implements IncrementalEntityProvider<My
|
|
|
253
253
|
}
|
|
254
254
|
|
|
255
255
|
|
|
256
|
-
async around(burst: (context:
|
|
256
|
+
async around(burst: (context: Context) => Promise<void>): Promise<void> {
|
|
257
257
|
|
|
258
258
|
const apiClient = new MyApiClient(this.token)
|
|
259
259
|
|
|
260
260
|
await burst({ apiClient })
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
async next(context:
|
|
263
|
+
async next(context: Context, cursor?: Cursor = { page: 1 }): Promise<EntityIteratorResult<Cursor>> {
|
|
264
264
|
const { apiClient } = context;
|
|
265
265
|
|
|
266
266
|
// call your API with the current cursor
|
package/alpha/package.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@backstage/plugin-catalog-backend-module-incremental-ingestion",
|
|
3
3
|
"description": "An entity provider for streaming large asset sources into the catalog",
|
|
4
|
-
"version": "0.3.3
|
|
4
|
+
"version": "0.3.3",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -43,16 +43,16 @@
|
|
|
43
43
|
"postpack": "backstage-cli package postpack"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@backstage/backend-common": "^0.19.0
|
|
47
|
-
"@backstage/backend-plugin-api": "^0.5.3
|
|
48
|
-
"@backstage/backend-tasks": "^0.5.3
|
|
49
|
-
"@backstage/catalog-model": "^1.4.0
|
|
50
|
-
"@backstage/config": "^1.0.
|
|
51
|
-
"@backstage/errors": "^1.2.0
|
|
52
|
-
"@backstage/plugin-catalog-backend": "^1.10.0
|
|
53
|
-
"@backstage/plugin-catalog-node": "^1.3.7
|
|
54
|
-
"@backstage/plugin-events-node": "^0.2.7
|
|
55
|
-
"@backstage/plugin-permission-common": "^0.7.6
|
|
46
|
+
"@backstage/backend-common": "^0.19.0",
|
|
47
|
+
"@backstage/backend-plugin-api": "^0.5.3",
|
|
48
|
+
"@backstage/backend-tasks": "^0.5.3",
|
|
49
|
+
"@backstage/catalog-model": "^1.4.0",
|
|
50
|
+
"@backstage/config": "^1.0.8",
|
|
51
|
+
"@backstage/errors": "^1.2.0",
|
|
52
|
+
"@backstage/plugin-catalog-backend": "^1.10.0",
|
|
53
|
+
"@backstage/plugin-catalog-node": "^1.3.7",
|
|
54
|
+
"@backstage/plugin-events-node": "^0.2.7",
|
|
55
|
+
"@backstage/plugin-permission-common": "^0.7.6",
|
|
56
56
|
"@types/express": "^4.17.6",
|
|
57
57
|
"@types/luxon": "^3.0.0",
|
|
58
58
|
"express": "^4.17.1",
|
|
@@ -64,10 +64,10 @@
|
|
|
64
64
|
"winston": "^3.2.1"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
|
-
"@backstage/backend-app-api": "^0.4.4
|
|
68
|
-
"@backstage/backend-defaults": "^0.1.11
|
|
69
|
-
"@backstage/backend-test-utils": "^0.1.38
|
|
70
|
-
"@backstage/cli": "^0.22.8
|
|
67
|
+
"@backstage/backend-app-api": "^0.4.4",
|
|
68
|
+
"@backstage/backend-defaults": "^0.1.11",
|
|
69
|
+
"@backstage/backend-test-utils": "^0.1.38",
|
|
70
|
+
"@backstage/cli": "^0.22.8"
|
|
71
71
|
},
|
|
72
72
|
"files": [
|
|
73
73
|
"dist",
|