@nice2dev/ui-api 1.4.31 → 1.4.32

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,28 @@
1
1
  # @nice2dev/ui-api
2
2
 
3
+ ## 1.4.32
4
+
5
+ ### Patch Changes
6
+
7
+ - b909e45: NiceIntegrationsEditor and NiceEnvironmentSetsEditor (round 44, 1.4.32).
8
+
9
+ - **NiceIntegrationsEditor**:
10
+ - the integrations as a tree with folders on any level — an integration's `package` is its folder
11
+ path (`Banking/PSD2` is two folders); folders are dragged and renamed (everything inside follows),
12
+ integrations dragged into folders, Add ▸ Integration / Folder adds into the picked folder; a
13
+ folder's page renames it and adds inside; removing a folder moves its content up a level. Empty
14
+ folders are kept in the file's new `folders`;
15
+ - new `dataSources` (`{ key, name?, fields? }`): an operation's source and target suggest them;
16
+ - the field mapping is a table with suggestions — the target's fields, the source's fields or what
17
+ the endpoint answers with (new core `responseFieldPaths`: `$[*].title`, `$.accounts[*].iban`) —
18
+ and "Map matching fields" pairs the fields of the same name.
19
+ - **NiceEnvironmentSetsEditor**: one set at a time — ‹ › or the list — and at most one more beside it to
20
+ compare (every set at once squeezed the values to nothing); the shown sets' settings sit above the
21
+ table; variables can be removed; on a narrow screen every variable is a card.
22
+ - NiceApiClient's 1.4.31 buttons use the existing icon / link button styles (a duplicate pair removed);
23
+ the `NiceApiClientLayout` and `NiceIntegrationDataSource` types are exported.
24
+ - Translations for the new texts in all twelve dictionaries.
25
+
3
26
  ## 1.4.31
4
27
 
5
28
  ### Patch Changes
@@ -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
- /** Variables × sets: each set's own values, the inherited ones shown faded, secrets as `{{secret:KEY}}`. */
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,12 @@ 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[];
160
171
  export declare function groupIntegrations(integrations: readonly NiceIntegrationDef[]): {
161
172
  package: string;
162
173
  directions: {