@autional/api-communication 0.2.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 +53 -0
- package/package.json +36 -0
- package/src/index.ts +136 -0
package/README.md
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# @authms/api-identity
|
|
2
|
+
|
|
3
|
+
AuthMS Identity Service API — auto-generated TypeScript client for identity-service (21 functions).
|
|
4
|
+
|
|
5
|
+
## Functions
|
|
6
|
+
|
|
7
|
+
| Function | Description |
|
|
8
|
+
|----------|-------------|
|
|
9
|
+
| `login(client, data)` | Authenticate with email/phone/username and password |
|
|
10
|
+
| `register(client, data)` | Register a new user account |
|
|
11
|
+
| `refreshToken(client, data)` | Refresh access token using refresh token |
|
|
12
|
+
| `getProfile(client)` | Get current user profile |
|
|
13
|
+
| `updateProfile(client, data)` | Update current user profile |
|
|
14
|
+
| `logout(client)` | Logout and revoke tokens |
|
|
15
|
+
| `verifyEmail(client, data)` | Verify email with verification code |
|
|
16
|
+
| `sendVerificationEmail(client, data)` | Send email verification code |
|
|
17
|
+
| `changePassword(client, data)` | Change password (requires current password) |
|
|
18
|
+
| `forgotPassword(client, data)` | Request password reset email |
|
|
19
|
+
| `resetPassword(client, data)` | Reset password with token from email |
|
|
20
|
+
| `checkPermission(client, data)` | Check if user has a specific permission |
|
|
21
|
+
| `getPermissions(client)` | Get user's permission list |
|
|
22
|
+
| `getTenants(client)` | Get user's tenants |
|
|
23
|
+
| `switchTenant(client, data)` | Switch active tenant |
|
|
24
|
+
| `requestRoleActivation(client, data)` | Request PIM/JIT role activation |
|
|
25
|
+
| `getRoleActivations(client)` | Get active role activations |
|
|
26
|
+
| `deleteAccount(client)` | Delete current user account |
|
|
27
|
+
| `getSessions(client)` | Get user's sessions |
|
|
28
|
+
| `deleteSession(client, sessionId)` | Delete a specific session |
|
|
29
|
+
| `getMFAMethods(client)` | Get user's MFA methods |
|
|
30
|
+
|
|
31
|
+
## Install
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npm install @authms/core @authms/api-identity
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Quick Start
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { AuthMS, browserPlatform } from '@authms/core';
|
|
41
|
+
import { login, getProfile } from '@authms/api-identity';
|
|
42
|
+
|
|
43
|
+
const authms = new AuthMS({ appId: 'my-app', issuer: 'https://auth.iam.tianv.com', platform: browserPlatform });
|
|
44
|
+
await authms.initialize();
|
|
45
|
+
|
|
46
|
+
const result = await login(authms.api, { email: 'user@example.com', password: 's3cret' });
|
|
47
|
+
console.log(result.user);
|
|
48
|
+
|
|
49
|
+
const profile = await getProfile(authms.api);
|
|
50
|
+
console.log(profile);
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
See the [root SDK README](../../README.md) for full documentation.
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@autional/api-communication",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "AuthMS Identity Service API \u2014 auto-generated TypeScript client",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.mjs",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.mjs",
|
|
12
|
+
"require": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"sideEffects": false,
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --clean --external @autional/core",
|
|
18
|
+
"typecheck": "tsc --noEmit",
|
|
19
|
+
"clean": "rimraf dist"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"src"
|
|
24
|
+
],
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@autional/core": ">=0.1.0"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@autional/core": ">=0.1.0",
|
|
30
|
+
"rimraf": "^5.0.0",
|
|
31
|
+
"tsup": "^8.4.0",
|
|
32
|
+
"typescript": "^5.8.0",
|
|
33
|
+
"vitest": "^3.0.0"
|
|
34
|
+
},
|
|
35
|
+
"license": "MIT"
|
|
36
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
// @ts-nocheck — auto-generated from swagger.json
|
|
2
|
+
/** @authms/api-communication — auto-generated */
|
|
3
|
+
import type { ApiClient } from '@authms/core';
|
|
4
|
+
|
|
5
|
+
export function adminCommunicationLogs(client: ApiClient, data?: Record<string, unknown>) {
|
|
6
|
+
return client.get(`/communication/api/v1/admin/communication/logs`, { params });
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function adminCommunicationPlatformStats(client: ApiClient, data?: Record<string, unknown>) {
|
|
10
|
+
return client.get(`/communication/api/v1/admin/communication/platform-stats`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function adminCommunicationProvidersPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
14
|
+
return client.post(`/communication/api/v1/admin/communication/providers`, data);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function adminCommunicationProvidersByProvidersDelete(client: ApiClient, data?: Record<string, unknown>) {
|
|
18
|
+
return client.delete(`/communication/api/v1/admin/communication/providers/${templateId}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function adminCommunicationProvidersByProvidersPut(client: ApiClient, data?: Record<string, unknown>) {
|
|
22
|
+
return client.put(`/communication/api/v1/admin/communication/providers/${templateId}`, data);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function adminCommunicationRateLimits(client: ApiClient, data?: Record<string, unknown>) {
|
|
26
|
+
return client.get(`/communication/api/v1/admin/communication/rate-limits`, { params });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function adminCommunicationResendByResendPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
30
|
+
return client.post(`/communication/api/v1/admin/communication/resend/${templateId}`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function adminCommunicationTemplatesPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
34
|
+
return client.post(`/communication/api/v1/admin/communication/templates`, data);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function adminCommunicationTemplatesByTemplatesDelete(client: ApiClient, data?: Record<string, unknown>) {
|
|
38
|
+
return client.delete(`/communication/api/v1/admin/communication/templates/${templateId}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function adminCommunicationTemplatesByTemplatesPut(client: ApiClient, data?: Record<string, unknown>) {
|
|
42
|
+
return client.put(`/communication/api/v1/admin/communication/templates/${templateId}`, data);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function adminCommunicationTemplatesCloneToLocaleByTemplatesPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
46
|
+
return client.post(`/communication/api/v1/admin/communication/templates/${templateId}/clone-to-locale`, data);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function adminCommunicationTemplatesPreviewByTemplatesPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
50
|
+
return client.post(`/communication/api/v1/admin/communication/templates/${templateId}/preview`, data);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function adminCommunicationTemplatesVersionsByTemplates(client: ApiClient, data?: Record<string, unknown>) {
|
|
54
|
+
return client.get(`/communication/api/v1/admin/communication/templates/${templateId}/versions`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function communicationBulkPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
58
|
+
return client.post(`/communication/api/v1/communication/bulk`, data);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function communicationCallbackByCallbackPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
62
|
+
return client.post(`/communication/api/v1/communication/callback/${provider}`, data);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function communicationDashboard(client: ApiClient, data?: Record<string, unknown>) {
|
|
66
|
+
return client.get(`/communication/api/v1/communication/dashboard`, { params });
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function communicationEmailPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
70
|
+
return client.post(`/communication/api/v1/communication/email`, data);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function communicationHealthByHealth(client: ApiClient, data?: Record<string, unknown>) {
|
|
74
|
+
return client.get(`/communication/api/v1/communication/health/${channel}`);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function communicationLogs(client: ApiClient, data?: Record<string, unknown>) {
|
|
78
|
+
return client.get(`/communication/api/v1/communication/logs`, { params });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function communicationProviders(client: ApiClient, data?: Record<string, unknown>) {
|
|
82
|
+
return client.get(`/communication/api/v1/communication/providers`, { params });
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function communicationProvidersByProviders(client: ApiClient, data?: Record<string, unknown>) {
|
|
86
|
+
return client.get(`/communication/api/v1/communication/providers/${templateId}`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function communicationPushPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
90
|
+
return client.post(`/communication/api/v1/communication/push`, data);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function communicationPushTokens(client: ApiClient, data?: Record<string, unknown>) {
|
|
94
|
+
return client.get(`/communication/api/v1/communication/push-tokens`, { params });
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function communicationPushTokensPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
98
|
+
return client.post(`/communication/api/v1/communication/push-tokens`, data);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function communicationPushTokensByPushTokensDelete(client: ApiClient, data?: Record<string, unknown>) {
|
|
102
|
+
return client.delete(`/communication/api/v1/communication/push-tokens/${templateId}`);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function communicationPushTokensByPushTokensPut(client: ApiClient, data?: Record<string, unknown>) {
|
|
106
|
+
return client.put(`/communication/api/v1/communication/push-tokens/${templateId}`, data);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function communicationRateLimits(client: ApiClient, data?: Record<string, unknown>) {
|
|
110
|
+
return client.get(`/communication/api/v1/communication/rate-limits`, { params });
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function communicationScheduledByScheduledDelete(client: ApiClient, data?: Record<string, unknown>) {
|
|
114
|
+
return client.delete(`/communication/api/v1/communication/scheduled/${templateId}`, { data });
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function communicationSmsPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
118
|
+
return client.post(`/communication/api/v1/communication/sms`, data);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function communicationTemplateStats(client: ApiClient, data?: Record<string, unknown>) {
|
|
122
|
+
return client.get(`/communication/api/v1/communication/template-stats`, { params });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function communicationTemplates(client: ApiClient, data?: Record<string, unknown>) {
|
|
126
|
+
return client.get(`/communication/api/v1/communication/templates`, { params });
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function communicationTemplatesAvailable(client: ApiClient, data?: Record<string, unknown>) {
|
|
130
|
+
return client.get(`/communication/api/v1/communication/templates/available`, { params });
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function communicationTemplatesByTemplates(client: ApiClient, data?: Record<string, unknown>) {
|
|
134
|
+
return client.get(`/communication/api/v1/communication/templates/${templateId}`);
|
|
135
|
+
}
|
|
136
|
+
|