@nice2dev/ui-api 1.4.24 → 1.4.25
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 +39 -0
- package/README.md +13 -40
- package/dist/apiClient/ApiClientParts.d.ts +3 -1
- package/dist/apiClient/ApiModelsEditor.d.ts +22 -0
- package/dist/core/model.d.ts +6 -0
- package/dist/core/openapi.d.ts +18 -0
- package/dist/core.cjs +29 -29
- package/dist/core.mjs +603 -561
- package/dist/index.cjs +5 -7
- package/dist/index.d.ts +1 -6
- package/dist/index.mjs +1777 -3413
- package/dist/types.d.ts +0 -18
- package/dist/ui-api.css +1 -1
- package/package.json +3 -3
- package/dist/NiceAPIDesigner.d.ts +0 -5
- package/dist/NiceAPITester.d.ts +0 -7
- package/dist/NiceWebhookTester.d.ts +0 -60
- package/dist/apiModelBridge.d.ts +0 -16
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# @nice2dev/ui-api
|
|
2
2
|
|
|
3
|
+
## 1.4.25
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 2913135: Control merges (round 44, 1.4.25).
|
|
8
|
+
|
|
9
|
+
**Breaking:** removals and renames in a patch release. The user chose this for round 44; see
|
|
10
|
+
`documentation/omniverk/OMNIVERK_UPGRADE_1.4.25.md`.
|
|
11
|
+
|
|
12
|
+
| Removed | Use instead |
|
|
13
|
+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------- |
|
|
14
|
+
| `NiceChat` (`ui`, `ui-tools`), `NiceChatProps`, `NiceChatMessage` | `NiceChatWindow` (`ui-communication`) |
|
|
15
|
+
| `NiceDiagram` (alias in `ui-diagrams`, `ui-planning`) | `NiceDiagramViewer` |
|
|
16
|
+
| `NiceDockMenu`, `NiceDockMenuProps` (`ui/navigation`) | `NiceDock` with `autoHide` |
|
|
17
|
+
| `NiceBrushEngine`, `useBrushEngine`, `BRUSH_PRESETS` and its types (`ui-graphics`) | the brush of `NicePixelEditor` (1.4.27) |
|
|
18
|
+
| `NiceCommunication`, `NiceCommunicationDefault`, `NiceCommunicationProps`, `NiceTeamsWorkspace`, `NiceTeamsWorkspaceProps` | `NiceCommunicationCenter`, `NiceCommunicationCenterProps` |
|
|
19
|
+
| `NiceAPITester`, `NiceAPITesterProps` | `NiceApiClient` |
|
|
20
|
+
| `NiceWebhookTester` and its types | `NiceApiClient` with `hmac` auth |
|
|
21
|
+
| `NiceAPIDesigner`, `NiceAPIDesignerProps` | `NiceApiClient` docs: Models and Security tabs |
|
|
22
|
+
| `fromApiTesterRequest`, `toApiTesterRequest`, `fromApiTesterCollection`, `toApiTesterCollection`, `toApiTesterRequests`, `openApiSchemaToCollection`, `collectionToOpenApiSchema` | `importOpenApi`, `exportOpenApi` |
|
|
23
|
+
| `ApiDesigner`, `ApiTesting` type namespaces (`ui-tools`) | — |
|
|
24
|
+
- **NiceCommunicationCenter** (NiceCommunication with NiceTeamsWorkspace as its default layout):
|
|
25
|
+
- `mode` is optional and defaults to `workspace`;
|
|
26
|
+
- the section header and search placeholder are translated labels, not the raw section key;
|
|
27
|
+
- Join calls the new `onJoinMeeting(meetingId)`, else opens the meeting's `joinUrl`, else starts a
|
|
28
|
+
video call with its participants;
|
|
29
|
+
- Files lists the attachments shared in conversations and channels;
|
|
30
|
+
- Activity lists unread team channels too, and a channel row opens that channel;
|
|
31
|
+
- a group conversation shows its own name in the chat list;
|
|
32
|
+
- `enableWhiteboard` reaches the workspace.
|
|
33
|
+
- **NiceDock**: `autoHide` slides the bar out past its edge until the pointer or focus comes back.
|
|
34
|
+
- **NiceApiClient**: the collection's documentation has tabs:
|
|
35
|
+
- Overview;
|
|
36
|
+
- Models: add, rename (references follow), retype, delete, edit properties or the JSON schema;
|
|
37
|
+
- Security: the schemes the OpenAPI export declares, who uses them, and the collection auth.
|
|
38
|
+
- **ui-api core**: new `renameApiSchema(collection, from, to)` and
|
|
39
|
+
`apiSecuritySchemes(collection)`.
|
|
40
|
+
- `viewSchema` lists `NiceChatWindow` and `NiceDiagramViewer`.
|
|
41
|
+
|
|
3
42
|
## 1.4.24
|
|
4
43
|
|
|
5
44
|
No changes in this release.
|
package/README.md
CHANGED
|
@@ -1,22 +1,15 @@
|
|
|
1
1
|
# @nice2dev/ui-api
|
|
2
2
|
|
|
3
|
-
Nice2Dev API & Integration Platform —
|
|
3
|
+
Nice2Dev API & Integration Platform — API client and documentation, integrations, integration builder for React applications.
|
|
4
4
|
|
|
5
5
|
## Features
|
|
6
6
|
|
|
7
|
-
- **
|
|
8
|
-
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
- Documentation
|
|
13
|
-
|
|
14
|
-
- **NiceAPITester** - API testing studio (Postman-like)
|
|
15
|
-
- Request builder
|
|
16
|
-
- Environment management
|
|
17
|
-
- Collection runner
|
|
18
|
-
- Test scripts
|
|
19
|
-
- Response validation
|
|
7
|
+
- **NiceApiClient** - send requests and document the API
|
|
8
|
+
- Request builder: parameters, nine body kinds, every auth kind (API key, bearer, basic, digest,
|
|
9
|
+
OAuth 2, AWS SigV4, HMAC signatures, mTLS, custom headers)
|
|
10
|
+
- Environments and variables, `{{secret:KEY}}` from the host
|
|
11
|
+
- Import curl, OpenAPI / Swagger, Postman, HAR, GraphQL, WSDL; export OpenAPI, Postman, HAR, Markdown
|
|
12
|
+
- Documentation mode: operations, models (editable, with references), security schemes
|
|
20
13
|
|
|
21
14
|
- **NiceIntegrationBuilder** - Visual flow builder
|
|
22
15
|
- Drag-and-drop flow design
|
|
@@ -35,35 +28,18 @@ pnpm add @nice2dev/ui-api
|
|
|
35
28
|
|
|
36
29
|
## Usage
|
|
37
30
|
|
|
38
|
-
### API
|
|
39
|
-
|
|
40
|
-
```tsx
|
|
41
|
-
import { NiceAPIDesigner } from '@nice2dev/ui-api';
|
|
42
|
-
import '@nice2dev/ui-api/style.css';
|
|
43
|
-
|
|
44
|
-
function App() {
|
|
45
|
-
return (
|
|
46
|
-
<NiceAPIDesigner
|
|
47
|
-
onChange={(schema) => console.log('Schema updated:', schema)}
|
|
48
|
-
onSave={(schema) => saveToBackend(schema)}
|
|
49
|
-
/>
|
|
50
|
-
);
|
|
51
|
-
}
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
### API Tester
|
|
31
|
+
### API client
|
|
55
32
|
|
|
56
33
|
```tsx
|
|
57
|
-
import {
|
|
34
|
+
import { NiceApiClient } from '@nice2dev/ui-api';
|
|
58
35
|
import '@nice2dev/ui-api/style.css';
|
|
59
36
|
|
|
60
37
|
function App() {
|
|
61
38
|
return (
|
|
62
|
-
<
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
]}
|
|
39
|
+
<NiceApiClient
|
|
40
|
+
defaultValue={collection}
|
|
41
|
+
environments={[{ id: 'dev', name: 'Development', values: [{ key: 'baseUrl', value: 'http://localhost:3000' }] }]}
|
|
42
|
+
onChange={saveCollection}
|
|
67
43
|
/>
|
|
68
44
|
);
|
|
69
45
|
}
|
|
@@ -147,9 +123,6 @@ if (request.kind === 'request') {
|
|
|
147
123
|
const yaml = exportOpenApiYaml(collection!);
|
|
148
124
|
```
|
|
149
125
|
|
|
150
|
-
`fromApiTesterCollection` / `toApiTesterCollection` (from the main entry) move collections between
|
|
151
|
-
the core model and `NiceAPITester`.
|
|
152
|
-
|
|
153
126
|
## License
|
|
154
127
|
|
|
155
128
|
See LICENSE file.
|
|
@@ -68,6 +68,8 @@ export declare function ApiRequestDocs({ request, collection, auth, transform, }
|
|
|
68
68
|
transform: (text: string) => string;
|
|
69
69
|
}): React.ReactElement;
|
|
70
70
|
/** Documentation of the collection: name, version, description, servers, auth, models. */
|
|
71
|
-
export declare function ApiCollectionDocs({ collection, }: {
|
|
71
|
+
export declare function ApiCollectionDocs({ collection, showModels, }: {
|
|
72
72
|
collection: NiceApiCollection;
|
|
73
|
+
/** The Models section (off when the models have a tab of their own). */
|
|
74
|
+
showModels?: boolean;
|
|
73
75
|
}): React.ReactElement;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { NiceApiCollection } from '../core';
|
|
3
|
+
type CollectionUpdate = (updater: (prev: NiceApiCollection) => NiceApiCollection) => void;
|
|
4
|
+
/** The collection's models: editable, or as read-only trees. */
|
|
5
|
+
export declare function ApiModelsEditor({ collection, onChange, readOnly, }: {
|
|
6
|
+
collection: NiceApiCollection;
|
|
7
|
+
onChange?: CollectionUpdate;
|
|
8
|
+
readOnly?: boolean;
|
|
9
|
+
}): React.ReactElement;
|
|
10
|
+
/** The security schemes the OpenAPI export declares, who uses them, and the collection's auth. */
|
|
11
|
+
export declare function ApiSecurityDocs({ collection, onChange, readOnly, }: {
|
|
12
|
+
collection: NiceApiCollection;
|
|
13
|
+
onChange?: CollectionUpdate;
|
|
14
|
+
readOnly?: boolean;
|
|
15
|
+
}): React.ReactElement;
|
|
16
|
+
/** The collection's documentation as tabs: Overview, Models (editable), Security. */
|
|
17
|
+
export declare function ApiCollectionDocsTabs({ collection, onChange, readOnly, }: {
|
|
18
|
+
collection: NiceApiCollection;
|
|
19
|
+
onChange?: CollectionUpdate;
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
}): React.ReactElement;
|
|
22
|
+
export {};
|
package/dist/core/model.d.ts
CHANGED
|
@@ -303,6 +303,12 @@ export declare function flattenApiRequests(items: readonly NiceApiItem[], parent
|
|
|
303
303
|
request: NiceApiRequest;
|
|
304
304
|
folders: NiceApiFolder[];
|
|
305
305
|
}[];
|
|
306
|
+
/**
|
|
307
|
+
* Renames model `from` to `to` and rewrites every `#/components/schemas/<from>` reference in the
|
|
308
|
+
* collection (request bodies, parameters, responses, other models). Returns the collection unchanged
|
|
309
|
+
* when `from` does not exist or `to` is taken.
|
|
310
|
+
*/
|
|
311
|
+
export declare function renameApiSchema(collection: NiceApiCollection, from: string, to: string): NiceApiCollection;
|
|
306
312
|
/** The item with `id` anywhere in `items`. */
|
|
307
313
|
export declare function findApiItem(items: readonly NiceApiItem[], id: string): NiceApiItem | undefined;
|
|
308
314
|
/** `items` with the item `id` replaced by `update(item)` (or removed when it returns null). */
|
package/dist/core/openapi.d.ts
CHANGED
|
@@ -20,6 +20,24 @@ export interface NiceOpenApiExportOptions {
|
|
|
20
20
|
/** The variable that holds the server URL. Default `baseUrl`. */
|
|
21
21
|
baseUrlVariable?: string;
|
|
22
22
|
}
|
|
23
|
+
/** A security scheme the OpenAPI export declares, and who authenticates with it. */
|
|
24
|
+
export interface NiceApiSecuritySchemeUse {
|
|
25
|
+
/** The key in `components.securitySchemes` (`bearerAuth`, `X-API-KeyAuth`, `oauth2`…). */
|
|
26
|
+
name: string;
|
|
27
|
+
/** The OpenAPI security scheme object. */
|
|
28
|
+
scheme: Record<string, unknown>;
|
|
29
|
+
/** OAuth 2 scopes. */
|
|
30
|
+
scopes: string[];
|
|
31
|
+
/** The collection's own auth is this scheme. */
|
|
32
|
+
collectionDefault: boolean;
|
|
33
|
+
/** Ids of the requests that authenticate with it, inherited auth included. */
|
|
34
|
+
requestIds: string[];
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* The security schemes of a collection — what `exportOpenApi` declares, from the collection's
|
|
38
|
+
* auth and each request's own or inherited (folder, collection) auth.
|
|
39
|
+
*/
|
|
40
|
+
export declare function apiSecuritySchemes(collection: NiceApiCollection): NiceApiSecuritySchemeUse[];
|
|
23
41
|
/** A collection as an OpenAPI 3.1 document (an object — `stringifyYaml` or `JSON.stringify` it). */
|
|
24
42
|
export declare function exportOpenApi(collection: NiceApiCollection, options?: NiceOpenApiExportOptions): Record<string, unknown>;
|
|
25
43
|
/** The collection as an OpenAPI 3.1 YAML text. */
|