@data-fair/lib-common-types 1.9.2 → 1.10.1
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/catalog/.type/index.d.ts +0 -4
- package/catalog/schema.d.ts +0 -4
- package/catalog/schema.js +1 -5
- package/package.json +1 -1
- package/processings.d.ts +16 -2
package/catalog/.type/index.d.ts
CHANGED
package/catalog/schema.d.ts
CHANGED
package/catalog/schema.js
CHANGED
|
@@ -22,7 +22,7 @@ export default {
|
|
|
22
22
|
metadata: {
|
|
23
23
|
type: 'object',
|
|
24
24
|
description: 'The metadata of the catalog plugin',
|
|
25
|
-
required: ['title', 'description', '
|
|
25
|
+
required: ['title', 'description', 'capabilities'],
|
|
26
26
|
additionalProperties: false,
|
|
27
27
|
properties: {
|
|
28
28
|
title: {
|
|
@@ -33,10 +33,6 @@ export default {
|
|
|
33
33
|
description: 'The description of the plugin to be displayed in the UI',
|
|
34
34
|
type: 'string'
|
|
35
35
|
},
|
|
36
|
-
icon: {
|
|
37
|
-
description: 'The SVG Path icon of the plugin',
|
|
38
|
-
type: 'string'
|
|
39
|
-
},
|
|
40
36
|
capabilities: {
|
|
41
37
|
description: 'The list of capabilities that a catalog can have.',
|
|
42
38
|
type: 'array',
|
package/package.json
CHANGED
package/processings.d.ts
CHANGED
|
@@ -3,9 +3,10 @@ import type { DataFairWsClient } from '@data-fair/lib-node/ws-client.js';
|
|
|
3
3
|
/**
|
|
4
4
|
* Processing context.
|
|
5
5
|
*/
|
|
6
|
-
export interface ProcessingContext {
|
|
7
|
-
processingConfig:
|
|
6
|
+
export interface ProcessingContext<TProcesssingConfig = any> {
|
|
7
|
+
processingConfig: TProcesssingConfig;
|
|
8
8
|
pluginConfig: any;
|
|
9
|
+
secrets?: Record<string, string>;
|
|
9
10
|
processingId: string;
|
|
10
11
|
dir: string;
|
|
11
12
|
tmpDir: string;
|
|
@@ -18,6 +19,19 @@ export interface ProcessingContext {
|
|
|
18
19
|
dataset: any;
|
|
19
20
|
}) => Promise<void>;
|
|
20
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Function to prepare a processing (trigger when the config is updated).
|
|
24
|
+
* It can be used to:
|
|
25
|
+
* - throw additional errors to validate the config
|
|
26
|
+
* - remove secrets from the config and store them in the secrets object
|
|
27
|
+
*/
|
|
28
|
+
export type PrepareFunction<TProcesssingConfig = any> = (context: {
|
|
29
|
+
processingConfig: TProcesssingConfig;
|
|
30
|
+
secrets: Record<string, string>;
|
|
31
|
+
}) => Promise<{
|
|
32
|
+
processingConfig?: TProcesssingConfig;
|
|
33
|
+
secrets?: Record<string, string>;
|
|
34
|
+
}>;
|
|
21
35
|
/**
|
|
22
36
|
* Log functions.
|
|
23
37
|
*/
|