@nice2dev/ui-api 1.4.31 → 1.4.33
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 +49 -0
- package/dist/NiceIntegrationBuilder.d.ts +36 -4
- package/dist/NiceIntegrationsEditor.d.ts +18 -1
- package/dist/core/integration.d.ts +29 -0
- package/dist/core.cjs +33 -33
- package/dist/core.mjs +471 -416
- package/dist/index.cjs +6 -5
- package/dist/index.d.ts +5 -4
- package/dist/index.mjs +2421 -2483
- package/dist/types.d.ts +8 -11
- package/dist/ui-api.css +1 -1
- package/package.json +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,54 @@
|
|
|
1
1
|
# @nice2dev/ui-api
|
|
2
2
|
|
|
3
|
+
## 1.4.33
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- acc59d7: NiceIntegrationBuilder on the shared workflow designer (round 44, 1.4.33).
|
|
8
|
+
|
|
9
|
+
- **NiceIntegrationBuilder** is now a flow of `NiceWorkflowDesigner` (`@nice2dev/ui-diagrams`) — one
|
|
10
|
+
interface for workflows and integrations — with the steps an integration needs:
|
|
11
|
+
- Start: the trigger is optional (manual unless a schedule, a webhook or an event is picked);
|
|
12
|
+
- Call a function: picked by path from the catalog (`functions`) — the module's scripts and the
|
|
13
|
+
integrations' endpoints as functions (new core `integrationFunctions(file)`:
|
|
14
|
+
`integrations/<key>/<operationId>`), with arguments and a variable for the result;
|
|
15
|
+
- For each: a loop over a list (a dictionary synced item by item) — its "each" transition runs the
|
|
16
|
+
body, which comes back; "done" goes on;
|
|
17
|
+
- Map fields, Condition (yes / no), End, Error.
|
|
18
|
+
New props `workflow` / `defaultWorkflow` / `onChange` (a `NiceWorkflowDefinition`), `functions`,
|
|
19
|
+
`stepTypes`, `onSave` (Publish), `onRun` (Test), `readOnly`, `height`; new exports
|
|
20
|
+
`integrationStepTypes`, `newIntegrationFlow`, `integrationFunctions`, `NiceFlowFunction`. The old
|
|
21
|
+
canvas and its `flow` / `connectors` props are gone; its flow types stay exported, deprecated.
|
|
22
|
+
`@nice2dev/ui-diagrams` is a new peer of `@nice2dev/ui-api`.
|
|
23
|
+
- **NiceWorkflowDesigner**: a step kind declares its fields (`fields`: text, long text, a list, a
|
|
24
|
+
number, a switch — new type `NiceWorkflowStepField`), edited in the step's properties and kept in
|
|
25
|
+
the step's new `config`; an empty required field is a validation warning; `summary(config)` shows
|
|
26
|
+
the configured value under the step's name.
|
|
27
|
+
- Translations for the new texts in all twelve dictionaries.
|
|
28
|
+
|
|
29
|
+
## 1.4.32
|
|
30
|
+
|
|
31
|
+
### Patch Changes
|
|
32
|
+
|
|
33
|
+
- b909e45: NiceIntegrationsEditor and NiceEnvironmentSetsEditor (round 44, 1.4.32).
|
|
34
|
+
|
|
35
|
+
- **NiceIntegrationsEditor**:
|
|
36
|
+
- the integrations as a tree with folders on any level — an integration's `package` is its folder
|
|
37
|
+
path (`Banking/PSD2` is two folders); folders are dragged and renamed (everything inside follows),
|
|
38
|
+
integrations dragged into folders, Add ▸ Integration / Folder adds into the picked folder; a
|
|
39
|
+
folder's page renames it and adds inside; removing a folder moves its content up a level. Empty
|
|
40
|
+
folders are kept in the file's new `folders`;
|
|
41
|
+
- new `dataSources` (`{ key, name?, fields? }`): an operation's source and target suggest them;
|
|
42
|
+
- the field mapping is a table with suggestions — the target's fields, the source's fields or what
|
|
43
|
+
the endpoint answers with (new core `responseFieldPaths`: `$[*].title`, `$.accounts[*].iban`) —
|
|
44
|
+
and "Map matching fields" pairs the fields of the same name.
|
|
45
|
+
- **NiceEnvironmentSetsEditor**: one set at a time — ‹ › or the list — and at most one more beside it to
|
|
46
|
+
compare (every set at once squeezed the values to nothing); the shown sets' settings sit above the
|
|
47
|
+
table; variables can be removed; on a narrow screen every variable is a card.
|
|
48
|
+
- NiceApiClient's 1.4.31 buttons use the existing icon / link button styles (a duplicate pair removed);
|
|
49
|
+
the `NiceApiClientLayout` and `NiceIntegrationDataSource` types are exported.
|
|
50
|
+
- Translations for the new texts in all twelve dictionaries.
|
|
51
|
+
|
|
3
52
|
## 1.4.31
|
|
4
53
|
|
|
5
54
|
### Patch Changes
|
|
@@ -1,7 +1,39 @@
|
|
|
1
|
+
import { NiceWorkflowDefinition } from '@nice2dev/ui';
|
|
2
|
+
import { NiceComponentTutorial, NiceTranslateFn } from '@nice2dev/ui-core';
|
|
3
|
+
import { NiceWorkflowStepType } from '@nice2dev/ui-diagrams';
|
|
1
4
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
5
|
+
import { NiceFlowFunction } from './core';
|
|
6
|
+
export interface NiceIntegrationBuilderProps {
|
|
7
|
+
/** The flow (controlled) — a workflow of the shared designer. */
|
|
8
|
+
workflow?: NiceWorkflowDefinition;
|
|
9
|
+
/** The flow to start from (uncontrolled). Default: Start → End. */
|
|
10
|
+
defaultWorkflow?: NiceWorkflowDefinition;
|
|
11
|
+
onChange?: (workflow: NiceWorkflowDefinition) => void;
|
|
12
|
+
/**
|
|
13
|
+
* The function catalog a Call step picks from: the module's scripts, the integrations' endpoints
|
|
14
|
+
* (`integrationFunctions(file)`), the host's functions.
|
|
15
|
+
*/
|
|
16
|
+
functions?: NiceFlowFunction[];
|
|
17
|
+
/** More kinds of step, merged by id over the integration ones. */
|
|
18
|
+
stepTypes?: NiceWorkflowStepType[];
|
|
19
|
+
/** The designer's Publish. */
|
|
20
|
+
onSave?: (workflow: NiceWorkflowDefinition) => void;
|
|
21
|
+
/** The designer's Test. */
|
|
22
|
+
onRun?: (workflow: NiceWorkflowDefinition) => void;
|
|
23
|
+
readOnly?: boolean;
|
|
24
|
+
/** Height. Default 560. */
|
|
25
|
+
height?: number | string;
|
|
26
|
+
className?: string;
|
|
27
|
+
style?: React.CSSProperties;
|
|
28
|
+
/** Optional guided tour. `true` = built-in; array/object = custom steps. Shows a "?" button. */
|
|
29
|
+
tutorial?: NiceComponentTutorial;
|
|
30
|
+
}
|
|
3
31
|
/**
|
|
4
|
-
*
|
|
32
|
+
* The integration steps of the designer — Start (optional trigger), Call a function (from
|
|
33
|
+
* `functions`), For each, Map fields, Condition, End, Error.
|
|
5
34
|
*/
|
|
6
|
-
export declare function
|
|
7
|
-
|
|
35
|
+
export declare function integrationStepTypes(functions: readonly NiceFlowFunction[], t: NiceTranslateFn): NiceWorkflowStepType[];
|
|
36
|
+
/** A new flow: Start → End. */
|
|
37
|
+
export declare function newIntegrationFlow(name?: string): NiceWorkflowDefinition;
|
|
38
|
+
/** An integration's flow on the shared workflow designer, with the integration steps. */
|
|
39
|
+
export declare function NiceIntegrationBuilder({ workflow, defaultWorkflow, onChange, functions, stepTypes, onSave, onRun, readOnly, height, className, style, tutorial, }: NiceIntegrationBuilderProps): React.ReactElement;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { NiceApiTransport, NiceEnvironmentSets, NiceIntegrationsFile } from './core';
|
|
3
|
+
/** 1.4.32: a data source an operation reads from or writes to, with its fields for the mapping. */
|
|
4
|
+
export interface NiceIntegrationDataSource {
|
|
5
|
+
key: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
fields?: string[];
|
|
8
|
+
}
|
|
3
9
|
export interface NiceIntegrationsEditorProps {
|
|
4
10
|
/** The module's integrations (controlled). */
|
|
5
11
|
value?: NiceIntegrationsFile;
|
|
@@ -12,6 +18,11 @@ export interface NiceIntegrationsEditorProps {
|
|
|
12
18
|
modules?: string[];
|
|
13
19
|
dataSources?: string[];
|
|
14
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* 1.4.32: the data sources an operation can read from and write to, with their fields — offered as
|
|
23
|
+
* an operation's source / target and as the fields of its mapping.
|
|
24
|
+
*/
|
|
25
|
+
dataSources?: NiceIntegrationDataSource[];
|
|
15
26
|
/** Sends the API tab's requests (the host's proxy). */
|
|
16
27
|
sendRequest?: NiceApiTransport;
|
|
17
28
|
resolveSecret?: (key: string) => string | undefined;
|
|
@@ -32,7 +43,13 @@ export interface NiceEnvironmentSetsEditorProps {
|
|
|
32
43
|
className?: string;
|
|
33
44
|
style?: React.CSSProperties;
|
|
34
45
|
}
|
|
35
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Variables × sets: each set's own values, the inherited ones shown faded, secrets as `{{secret:KEY}}`.
|
|
48
|
+
*
|
|
49
|
+
* 1.4.32: one set at a time — switched with ‹ › or picked from the list — and at most a second one
|
|
50
|
+
* beside it to compare (every set at once squeezed the values to nothing); the table turns into
|
|
51
|
+
* cards on a narrow screen.
|
|
52
|
+
*/
|
|
36
53
|
export declare function NiceEnvironmentSetsEditor(props: NiceEnvironmentSetsEditorProps): React.ReactElement;
|
|
37
54
|
/** What NiceDevelopmentStudio hands an editor plug-in (structural — no dependency on ui-forms). */
|
|
38
55
|
export interface NiceApiStudioEditorContext {
|
|
@@ -93,6 +93,11 @@ export interface NiceIntegrationDef {
|
|
|
93
93
|
/** A module's `{prefix}.integrations.json`. */
|
|
94
94
|
export interface NiceIntegrationsFile {
|
|
95
95
|
integrations: NiceIntegrationDef[];
|
|
96
|
+
/**
|
|
97
|
+
* 1.4.32: folders of the tree (`Banking/PSD2` — an integration's `package` is its folder), kept
|
|
98
|
+
* here so an empty one stays; the folders of the packages in use need not be listed.
|
|
99
|
+
*/
|
|
100
|
+
folders?: string[];
|
|
96
101
|
}
|
|
97
102
|
/** A declared variable (its values live in the sets). */
|
|
98
103
|
export interface NiceEnvironmentVariableDecl {
|
|
@@ -157,6 +162,30 @@ export declare function validateIntegrations(file: NiceIntegrationsFile, sets?:
|
|
|
157
162
|
dataSources?: string[];
|
|
158
163
|
}): NiceIntegrationIssue[];
|
|
159
164
|
/** The integrations grouped for a tree: package → direction → integrations. */
|
|
165
|
+
/**
|
|
166
|
+
* 1.4.32: the fields a request answers with, as source paths for a mapping — `$.name` for an object,
|
|
167
|
+
* `$[*].name` for a list, `$.items[*].id` for a list inside — from its documented 200 / 201 response
|
|
168
|
+
* (named schemas resolved, `allOf` merged).
|
|
169
|
+
*/
|
|
170
|
+
export declare function responseFieldPaths(endpoints: NiceApiCollection | undefined, requestId: string | undefined): string[];
|
|
171
|
+
/**
|
|
172
|
+
* 1.4.33: a function a flow step can call (NiceIntegrationBuilder): a module script, an integration's
|
|
173
|
+
* endpoint, any function of the host — picked by its path from the catalog.
|
|
174
|
+
*/
|
|
175
|
+
export interface NiceFlowFunction {
|
|
176
|
+
/** Unique: `scripts/syncCurrencies`, `integrations/psd2-accounts/listAccounts`. */
|
|
177
|
+
path: string;
|
|
178
|
+
name?: string;
|
|
179
|
+
kind?: 'script' | 'endpoint' | 'function';
|
|
180
|
+
/** The heading it is listed under (an integration's name, `Scripts`…). */
|
|
181
|
+
group?: string;
|
|
182
|
+
description?: string;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* 1.4.33: every consumed endpoint of the integrations as a function with a path —
|
|
186
|
+
* `integrations/<integration key>/<operationId or request name>` — listed under its integration.
|
|
187
|
+
*/
|
|
188
|
+
export declare function integrationFunctions(file: NiceIntegrationsFile): NiceFlowFunction[];
|
|
160
189
|
export declare function groupIntegrations(integrations: readonly NiceIntegrationDef[]): {
|
|
161
190
|
package: string;
|
|
162
191
|
directions: {
|