@winwinmbs/portal-api 1.0.0
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/README.md +29 -0
- package/dist/_tsup-dts-rollup.d.mts +4113 -0
- package/dist/_tsup-dts-rollup.d.ts +4113 -0
- package/dist/index.d.mts +120 -0
- package/dist/index.d.ts +120 -0
- package/dist/index.js +2144 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +2085 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +40 -0
package/README.md
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
## @winwinmbs/portal-api
|
|
2
|
+
|
|
3
|
+
Business API client for WINWIN Portal. Decoupled from authentication — accepts a `getToken` callback from any auth source.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add @winwinmbs/portal-api
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage with @winwinmbs/portal-auth
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import { AuthClient } from '@winwinmbs/portal-auth';
|
|
15
|
+
import { PortalApiClient } from '@winwinmbs/portal-api';
|
|
16
|
+
|
|
17
|
+
const auth = new AuthClient({ apiUrl, mode: 'sso', portalUrl, appId });
|
|
18
|
+
const api = new PortalApiClient({
|
|
19
|
+
apiUrl,
|
|
20
|
+
getToken: () => auth.getAccessToken(),
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
await api.files.upload(/* ... */);
|
|
24
|
+
await api.workflow.list();
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Available API modules
|
|
28
|
+
|
|
29
|
+
email, eventLog, files, health, line, organization, otp, permission, permissionCategory, role, systemConfig, todo, user, webhook, workflow
|