@autional/api-storage 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 +232 -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-storage",
|
|
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,232 @@
|
|
|
1
|
+
// @ts-nocheck — auto-generated from swagger.json
|
|
2
|
+
/** @authms/api-storage — auto-generated */
|
|
3
|
+
import type { ApiClient } from '@authms/core';
|
|
4
|
+
|
|
5
|
+
export function adminStorageBuckets(client: ApiClient, data?: Record<string, unknown>) {
|
|
6
|
+
return client.get(`/storage/api/v1/admin/storage/buckets`, { params });
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function adminStorageBucketsPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
10
|
+
return client.post(`/storage/api/v1/admin/storage/buckets`, data);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function adminStorageBucketsByBucketsDelete(client: ApiClient, data?: Record<string, unknown>) {
|
|
14
|
+
return client.delete(`/storage/api/v1/admin/storage/buckets/${name}`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export function adminStorageBucketsByBuckets(client: ApiClient, data?: Record<string, unknown>) {
|
|
18
|
+
return client.get(`/storage/api/v1/admin/storage/buckets/${name}`);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export function adminStorageBucketsByBucketsPut(client: ApiClient, data?: Record<string, unknown>) {
|
|
22
|
+
return client.put(`/storage/api/v1/admin/storage/buckets/${name}`, data);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export function adminStorageCleanStaleUploadsPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
26
|
+
return client.post(`/storage/api/v1/admin/storage/clean-stale-uploads`, undefined, { params });
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function adminStorageDataRetentionPolicy(client: ApiClient, data?: Record<string, unknown>) {
|
|
30
|
+
return client.get(`/storage/api/v1/admin/storage/data-retention-policy`);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export function adminStorageDataRetentionPolicyPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
34
|
+
return client.post(`/storage/api/v1/admin/storage/data-retention-policy`, data);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function adminStorageEncryptionStatus(client: ApiClient, data?: Record<string, unknown>) {
|
|
38
|
+
return client.get(`/storage/api/v1/admin/storage/encryption-status`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function adminStorageQuota(client: ApiClient, data?: Record<string, unknown>) {
|
|
42
|
+
return client.get(`/storage/api/v1/admin/storage/quota`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function adminStorageQuotaPut(client: ApiClient, data?: Record<string, unknown>) {
|
|
46
|
+
return client.put(`/storage/api/v1/admin/storage/quota`, data);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function adminStorageStats(client: ApiClient, data?: Record<string, unknown>) {
|
|
50
|
+
return client.get(`/storage/api/v1/admin/storage/stats`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function files(client: ApiClient, data?: Record<string, unknown>) {
|
|
54
|
+
return client.get(`/storage/api/v1/files`, { params });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function filesPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
58
|
+
return client.post(`/storage/api/v1/files`);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function filesBatchDownloadPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
62
|
+
return client.post(`/storage/api/v1/files/batch-download`, data);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function filesBulkDeletionsPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
66
|
+
return client.post(`/storage/api/v1/files/bulk-deletions`, data);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export function filesBulkUploadsPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
70
|
+
return client.post(`/storage/api/v1/files/bulk-uploads`, data);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export function filesMultipartInitPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
74
|
+
return client.post(`/storage/api/v1/files/multipart/init`, data);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function filesMultipartByMultipartDelete(client: ApiClient, data?: Record<string, unknown>) {
|
|
78
|
+
return client.delete(`/storage/api/v1/files/multipart/${fileId}`);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function filesMultipartCompleteByMultipartPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
82
|
+
return client.post(`/storage/api/v1/files/multipart/${fileId}/complete`);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function filesSharedByShared(client: ApiClient, data?: Record<string, unknown>) {
|
|
86
|
+
return client.get(`/storage/api/v1/files/shared/${token}`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function filesUploadUrlPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
90
|
+
return client.post(`/storage/api/v1/files/upload-url`, data);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export function filesByFilesDelete(client: ApiClient, data?: Record<string, unknown>) {
|
|
94
|
+
return client.delete(`/storage/api/v1/files/${fileId}`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
export function filesByFilesPatch(client: ApiClient, data?: Record<string, unknown>) {
|
|
98
|
+
return client.patch(`/storage/api/v1/files/${fileId}`, data);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function filesCopyByFilesPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
102
|
+
return client.post(`/storage/api/v1/files/${fileId}/copy`, data);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function filesDownloadByFiles(client: ApiClient, data?: Record<string, unknown>) {
|
|
106
|
+
return client.get(`/storage/api/v1/files/${fileId}/download`);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function filesMetadataByFiles(client: ApiClient, data?: Record<string, unknown>) {
|
|
110
|
+
return client.get(`/storage/api/v1/files/${fileId}/metadata`);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export function filesMoveByFilesPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
114
|
+
return client.post(`/storage/api/v1/files/${fileId}/move`, data);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function filesPresignedUrlByFiles(client: ApiClient, data?: Record<string, unknown>) {
|
|
118
|
+
return client.get(`/storage/api/v1/files/${fileId}/presigned-url`, { params });
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
export function filesPreviewByFiles(client: ApiClient, data?: Record<string, unknown>) {
|
|
122
|
+
return client.get(`/storage/api/v1/files/${fileId}/preview`, { params });
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
export function filesShareByFilesDelete(client: ApiClient, data?: Record<string, unknown>) {
|
|
126
|
+
return client.delete(`/storage/api/v1/files/${fileId}/share`, { params });
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function filesShareByFiles(client: ApiClient, data?: Record<string, unknown>) {
|
|
130
|
+
return client.get(`/storage/api/v1/files/${fileId}/share`);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function filesShareByFilesPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
134
|
+
return client.post(`/storage/api/v1/files/${fileId}/share`, data);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export function filesThumbnailByFiles(client: ApiClient, data?: Record<string, unknown>) {
|
|
138
|
+
return client.get(`/storage/api/v1/files/${fileId}/thumbnail`, { params });
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function filesUploadCompleteByFilesPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
142
|
+
return client.post(`/storage/api/v1/files/${fileId}/upload-complete`);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function filesVersionsByFiles(client: ApiClient, data?: Record<string, unknown>) {
|
|
146
|
+
return client.get(`/storage/api/v1/files/${fileId}/versions`);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
export function filesVersionsRestoreByFilesByVersionsPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
150
|
+
return client.post(`/storage/api/v1/files/${fileId}/versions/${versionId}/restore`);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function filesVisibilityByFilesPatch(client: ApiClient, data?: Record<string, unknown>) {
|
|
154
|
+
return client.patch(`/storage/api/v1/files/${fileId}/visibility`, data);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function filesWatermarkByFilesPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
158
|
+
return client.post(`/storage/api/v1/files/${fileId}/watermark`, data);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
export function foldersPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
162
|
+
return client.post(`/storage/api/v1/folders`, data);
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function foldersContentsByFolders(client: ApiClient, data?: Record<string, unknown>) {
|
|
166
|
+
return client.get(`/storage/api/v1/folders/${folderId}/contents`);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function shares(client: ApiClient, data?: Record<string, unknown>) {
|
|
170
|
+
return client.get(`/storage/api/v1/shares`, { params });
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
export function storageBatchDeletePost(client: ApiClient, data?: Record<string, unknown>) {
|
|
174
|
+
return client.post(`/storage/api/v1/storage/batch-delete`, data);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function storageBatchMovePost(client: ApiClient, data?: Record<string, unknown>) {
|
|
178
|
+
return client.post(`/storage/api/v1/storage/batch-move`, data);
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function storageFoldersPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
182
|
+
return client.post(`/storage/api/v1/storage/folders`, data);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export function storageFoldersByFoldersDelete(client: ApiClient, data?: Record<string, unknown>) {
|
|
186
|
+
return client.delete(`/storage/api/v1/storage/folders/${folderId}`);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export function storageFoldersByFolders(client: ApiClient, data?: Record<string, unknown>) {
|
|
190
|
+
return client.get(`/storage/api/v1/storage/folders/${folderId}`);
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
export function storageFoldersByFoldersPatch(client: ApiClient, data?: Record<string, unknown>) {
|
|
194
|
+
return client.patch(`/storage/api/v1/storage/folders/${folderId}`, data);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export function storagePublicEncryptionStatus(client: ApiClient, data?: Record<string, unknown>) {
|
|
198
|
+
return client.get(`/storage/api/v1/storage/public/encryption-status`);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export function storagePublicReports(client: ApiClient, data?: Record<string, unknown>) {
|
|
202
|
+
return client.get(`/storage/api/v1/storage/public/reports`, { params });
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
export function storagePublicReportsDownloadByReports(client: ApiClient, data?: Record<string, unknown>) {
|
|
206
|
+
return client.get(`/storage/api/v1/storage/public/reports/${fileId}/download`);
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export function storageQuota(client: ApiClient, data?: Record<string, unknown>) {
|
|
210
|
+
return client.get(`/storage/api/v1/storage/quota`);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export function storageTrashDelete(client: ApiClient, data?: Record<string, unknown>) {
|
|
214
|
+
return client.delete(`/storage/api/v1/storage/trash`);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export function storageTrash(client: ApiClient, data?: Record<string, unknown>) {
|
|
218
|
+
return client.get(`/storage/api/v1/storage/trash`, { params });
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
export function storageTrashByTrashDelete(client: ApiClient, data?: Record<string, unknown>) {
|
|
222
|
+
return client.delete(`/storage/api/v1/storage/trash/${trashId}`);
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
export function storageTrashRestoreByTrashPost(client: ApiClient, data?: Record<string, unknown>) {
|
|
226
|
+
return client.post(`/storage/api/v1/storage/trash/${trashId}/restore`);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export function storageTrends(client: ApiClient, data?: Record<string, unknown>) {
|
|
230
|
+
return client.get(`/storage/api/v1/storage/trends`, { params });
|
|
231
|
+
}
|
|
232
|
+
|