@authsome/client 0.0.7 → 0.0.9
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/dist/client.d.ts +42 -42
- package/dist/client.js +20 -20
- package/dist/index.d.ts +20 -20
- package/dist/index.js +62 -62
- package/dist/plugins/admin.js +11 -11
- package/dist/plugins/apikey.js +7 -7
- package/dist/plugins/backupauth.js +6 -6
- package/dist/plugins/cms.d.ts +69 -18
- package/dist/plugins/cms.js +47 -47
- package/dist/plugins/idverification.js +11 -11
- package/dist/plugins/impersonation.js +6 -6
- package/dist/plugins/jwt.js +5 -5
- package/dist/plugins/multiapp.d.ts +19 -4
- package/dist/plugins/multiapp.js +23 -23
- package/dist/plugins/multisession.js +9 -9
- package/dist/plugins/notification.js +14 -14
- package/dist/plugins/oidcprovider.d.ts +3 -3
- package/dist/plugins/oidcprovider.js +17 -17
- package/dist/plugins/organization.d.ts +16 -4
- package/dist/plugins/organization.js +20 -20
- package/dist/plugins/permissions.js +3 -3
- package/dist/plugins/secrets.d.ts +1 -1
- package/dist/plugins/secrets.js +11 -11
- package/dist/plugins/sso.js +6 -6
- package/dist/plugins/stepup.js +14 -14
- package/dist/plugins/webhook.d.ts +1 -1
- package/dist/types.d.ts +3837 -3787
- package/package.json +1 -2
- package/src/client.ts +42 -42
- package/src/index.ts +20 -20
- package/src/plugins/admin.ts +11 -11
- package/src/plugins/apikey.ts +7 -7
- package/src/plugins/backupauth.ts +6 -6
- package/src/plugins/cms.ts +52 -52
- package/src/plugins/idverification.ts +11 -11
- package/src/plugins/impersonation.ts +6 -6
- package/src/plugins/jwt.ts +5 -5
- package/src/plugins/multiapp.ts +30 -30
- package/src/plugins/multisession.ts +9 -9
- package/src/plugins/notification.ts +14 -14
- package/src/plugins/oidcprovider.ts +23 -23
- package/src/plugins/organization.ts +24 -24
- package/src/plugins/permissions.ts +3 -3
- package/src/plugins/secrets.ts +12 -12
- package/src/plugins/sso.ts +6 -6
- package/src/plugins/stepup.ts +14 -14
- package/src/plugins/webhook.ts +1 -1
- package/src/types.ts +3928 -3877
package/package.json
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@authsome/client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.9",
|
|
4
4
|
"description": "TypeScript client for AuthSome authentication",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "tsc",
|
|
9
|
-
"pub": "npm publish --access public",
|
|
10
9
|
"prepublishOnly": "npm run build"
|
|
11
10
|
},
|
|
12
11
|
"keywords": ["authsome", "authentication", "client"],
|
package/src/client.ts
CHANGED
|
@@ -3,35 +3,35 @@
|
|
|
3
3
|
import { ClientPlugin } from './plugin';
|
|
4
4
|
import { createErrorFromResponse } from './errors';
|
|
5
5
|
import * as types from './types';
|
|
6
|
-
import { AnonymousPlugin } from './plugins/anonymous';
|
|
7
|
-
import { EmailverificationPlugin } from './plugins/emailverification';
|
|
8
|
-
import { IdverificationPlugin } from './plugins/idverification';
|
|
9
|
-
import { PasskeyPlugin } from './plugins/passkey';
|
|
10
|
-
import { PermissionsPlugin } from './plugins/permissions';
|
|
11
|
-
import { MfaPlugin } from './plugins/mfa';
|
|
12
6
|
import { MultiappPlugin } from './plugins/multiapp';
|
|
13
|
-
import {
|
|
14
|
-
import { CompliancePlugin } from './plugins/compliance';
|
|
15
|
-
import { MagiclinkPlugin } from './plugins/magiclink';
|
|
7
|
+
import { PasskeyPlugin } from './plugins/passkey';
|
|
16
8
|
import { PhonePlugin } from './plugins/phone';
|
|
17
9
|
import { WebhookPlugin } from './plugins/webhook';
|
|
10
|
+
import { ImpersonationPlugin } from './plugins/impersonation';
|
|
11
|
+
import { CmsPlugin } from './plugins/cms';
|
|
12
|
+
import { OidcproviderPlugin } from './plugins/oidcprovider';
|
|
13
|
+
import { EmailotpPlugin } from './plugins/emailotp';
|
|
14
|
+
import { BackupauthPlugin } from './plugins/backupauth';
|
|
15
|
+
import { TwofaPlugin } from './plugins/twofa';
|
|
16
|
+
import { SocialPlugin } from './plugins/social';
|
|
18
17
|
import { AdminPlugin } from './plugins/admin';
|
|
18
|
+
import { EmailverificationPlugin } from './plugins/emailverification';
|
|
19
|
+
import { ConsentPlugin } from './plugins/consent';
|
|
19
20
|
import { StepupPlugin } from './plugins/stepup';
|
|
20
|
-
import { ImpersonationPlugin } from './plugins/impersonation';
|
|
21
21
|
import { JwtPlugin } from './plugins/jwt';
|
|
22
|
-
import {
|
|
22
|
+
import { MfaPlugin } from './plugins/mfa';
|
|
23
|
+
import { SecretsPlugin } from './plugins/secrets';
|
|
23
24
|
import { UsernamePlugin } from './plugins/username';
|
|
24
|
-
import {
|
|
25
|
+
import { MagiclinkPlugin } from './plugins/magiclink';
|
|
26
|
+
import { OrganizationPlugin } from './plugins/organization';
|
|
27
|
+
import { SsoPlugin } from './plugins/sso';
|
|
28
|
+
import { IdverificationPlugin } from './plugins/idverification';
|
|
29
|
+
import { NotificationPlugin } from './plugins/notification';
|
|
25
30
|
import { MultisessionPlugin } from './plugins/multisession';
|
|
26
|
-
import {
|
|
31
|
+
import { PermissionsPlugin } from './plugins/permissions';
|
|
32
|
+
import { AnonymousPlugin } from './plugins/anonymous';
|
|
27
33
|
import { ApikeyPlugin } from './plugins/apikey';
|
|
28
|
-
import {
|
|
29
|
-
import { BackupauthPlugin } from './plugins/backupauth';
|
|
30
|
-
import { OrganizationPlugin } from './plugins/organization';
|
|
31
|
-
import { TwofaPlugin } from './plugins/twofa';
|
|
32
|
-
import { EmailotpPlugin } from './plugins/emailotp';
|
|
33
|
-
import { SecretsPlugin } from './plugins/secrets';
|
|
34
|
-
import { SocialPlugin } from './plugins/social';
|
|
34
|
+
import { CompliancePlugin } from './plugins/compliance';
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* AuthSome client configuration
|
|
@@ -163,35 +163,35 @@ export class AuthsomeClient {
|
|
|
163
163
|
}
|
|
164
164
|
|
|
165
165
|
public readonly $plugins = {
|
|
166
|
-
anonymous: (): AnonymousPlugin | undefined => this.getPlugin<AnonymousPlugin>('anonymous'),
|
|
167
|
-
emailverification: (): EmailverificationPlugin | undefined => this.getPlugin<EmailverificationPlugin>('emailverification'),
|
|
168
|
-
idverification: (): IdverificationPlugin | undefined => this.getPlugin<IdverificationPlugin>('idverification'),
|
|
169
|
-
passkey: (): PasskeyPlugin | undefined => this.getPlugin<PasskeyPlugin>('passkey'),
|
|
170
|
-
permissions: (): PermissionsPlugin | undefined => this.getPlugin<PermissionsPlugin>('permissions'),
|
|
171
|
-
mfa: (): MfaPlugin | undefined => this.getPlugin<MfaPlugin>('mfa'),
|
|
172
166
|
multiapp: (): MultiappPlugin | undefined => this.getPlugin<MultiappPlugin>('multiapp'),
|
|
173
|
-
|
|
174
|
-
compliance: (): CompliancePlugin | undefined => this.getPlugin<CompliancePlugin>('compliance'),
|
|
175
|
-
magiclink: (): MagiclinkPlugin | undefined => this.getPlugin<MagiclinkPlugin>('magiclink'),
|
|
167
|
+
passkey: (): PasskeyPlugin | undefined => this.getPlugin<PasskeyPlugin>('passkey'),
|
|
176
168
|
phone: (): PhonePlugin | undefined => this.getPlugin<PhonePlugin>('phone'),
|
|
177
169
|
webhook: (): WebhookPlugin | undefined => this.getPlugin<WebhookPlugin>('webhook'),
|
|
170
|
+
impersonation: (): ImpersonationPlugin | undefined => this.getPlugin<ImpersonationPlugin>('impersonation'),
|
|
171
|
+
cms: (): CmsPlugin | undefined => this.getPlugin<CmsPlugin>('cms'),
|
|
172
|
+
oidcprovider: (): OidcproviderPlugin | undefined => this.getPlugin<OidcproviderPlugin>('oidcprovider'),
|
|
173
|
+
emailotp: (): EmailotpPlugin | undefined => this.getPlugin<EmailotpPlugin>('emailotp'),
|
|
174
|
+
backupauth: (): BackupauthPlugin | undefined => this.getPlugin<BackupauthPlugin>('backupauth'),
|
|
175
|
+
twofa: (): TwofaPlugin | undefined => this.getPlugin<TwofaPlugin>('twofa'),
|
|
176
|
+
social: (): SocialPlugin | undefined => this.getPlugin<SocialPlugin>('social'),
|
|
178
177
|
admin: (): AdminPlugin | undefined => this.getPlugin<AdminPlugin>('admin'),
|
|
178
|
+
emailverification: (): EmailverificationPlugin | undefined => this.getPlugin<EmailverificationPlugin>('emailverification'),
|
|
179
|
+
consent: (): ConsentPlugin | undefined => this.getPlugin<ConsentPlugin>('consent'),
|
|
179
180
|
stepup: (): StepupPlugin | undefined => this.getPlugin<StepupPlugin>('stepup'),
|
|
180
|
-
impersonation: (): ImpersonationPlugin | undefined => this.getPlugin<ImpersonationPlugin>('impersonation'),
|
|
181
181
|
jwt: (): JwtPlugin | undefined => this.getPlugin<JwtPlugin>('jwt'),
|
|
182
|
-
|
|
182
|
+
mfa: (): MfaPlugin | undefined => this.getPlugin<MfaPlugin>('mfa'),
|
|
183
|
+
secrets: (): SecretsPlugin | undefined => this.getPlugin<SecretsPlugin>('secrets'),
|
|
183
184
|
username: (): UsernamePlugin | undefined => this.getPlugin<UsernamePlugin>('username'),
|
|
184
|
-
|
|
185
|
+
magiclink: (): MagiclinkPlugin | undefined => this.getPlugin<MagiclinkPlugin>('magiclink'),
|
|
186
|
+
organization: (): OrganizationPlugin | undefined => this.getPlugin<OrganizationPlugin>('organization'),
|
|
187
|
+
sso: (): SsoPlugin | undefined => this.getPlugin<SsoPlugin>('sso'),
|
|
188
|
+
idverification: (): IdverificationPlugin | undefined => this.getPlugin<IdverificationPlugin>('idverification'),
|
|
189
|
+
notification: (): NotificationPlugin | undefined => this.getPlugin<NotificationPlugin>('notification'),
|
|
185
190
|
multisession: (): MultisessionPlugin | undefined => this.getPlugin<MultisessionPlugin>('multisession'),
|
|
186
|
-
|
|
191
|
+
permissions: (): PermissionsPlugin | undefined => this.getPlugin<PermissionsPlugin>('permissions'),
|
|
192
|
+
anonymous: (): AnonymousPlugin | undefined => this.getPlugin<AnonymousPlugin>('anonymous'),
|
|
187
193
|
apikey: (): ApikeyPlugin | undefined => this.getPlugin<ApikeyPlugin>('apikey'),
|
|
188
|
-
|
|
189
|
-
backupauth: (): BackupauthPlugin | undefined => this.getPlugin<BackupauthPlugin>('backupauth'),
|
|
190
|
-
organization: (): OrganizationPlugin | undefined => this.getPlugin<OrganizationPlugin>('organization'),
|
|
191
|
-
twofa: (): TwofaPlugin | undefined => this.getPlugin<TwofaPlugin>('twofa'),
|
|
192
|
-
emailotp: (): EmailotpPlugin | undefined => this.getPlugin<EmailotpPlugin>('emailotp'),
|
|
193
|
-
secrets: (): SecretsPlugin | undefined => this.getPlugin<SecretsPlugin>('secrets'),
|
|
194
|
-
social: (): SocialPlugin | undefined => this.getPlugin<SocialPlugin>('social'),
|
|
194
|
+
compliance: (): CompliancePlugin | undefined => this.getPlugin<CompliancePlugin>('compliance'),
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
public async request<T>(
|
|
@@ -239,7 +239,7 @@ export class AuthsomeClient {
|
|
|
239
239
|
return response.json();
|
|
240
240
|
}
|
|
241
241
|
|
|
242
|
-
async signUp(request: {
|
|
242
|
+
async signUp(request: { email: string; password: string; name?: string }): Promise<{ user: types.User; session: types.Session }> {
|
|
243
243
|
const path = '/signup';
|
|
244
244
|
return this.request<{ user: types.User; session: types.Session }>('POST', path, {
|
|
245
245
|
body: request,
|
|
@@ -290,7 +290,7 @@ export class AuthsomeClient {
|
|
|
290
290
|
});
|
|
291
291
|
}
|
|
292
292
|
|
|
293
|
-
async refreshSession(request: { refreshToken: string }): Promise<{ refreshToken: string; expiresAt: string; refreshExpiresAt: string; session: any
|
|
293
|
+
async refreshSession(request: { refreshToken: string }): Promise<{ accessToken: string; refreshToken: string; expiresAt: string; refreshExpiresAt: string; session: any }> {
|
|
294
294
|
const path = '/refresh';
|
|
295
295
|
return this.request<{ expiresAt: string; refreshExpiresAt: string; session: any; accessToken: string; refreshToken: string }>('POST', path, {
|
|
296
296
|
body: request,
|
package/src/index.ts
CHANGED
|
@@ -6,32 +6,32 @@ export * from './types';
|
|
|
6
6
|
export * from './errors';
|
|
7
7
|
|
|
8
8
|
// Plugin exports
|
|
9
|
-
export { AnonymousPlugin, anonymousClient } from './plugins/anonymous';
|
|
10
|
-
export { EmailverificationPlugin, emailverificationClient } from './plugins/emailverification';
|
|
11
|
-
export { IdverificationPlugin, idverificationClient } from './plugins/idverification';
|
|
12
|
-
export { PasskeyPlugin, passkeyClient } from './plugins/passkey';
|
|
13
|
-
export { PermissionsPlugin, permissionsClient } from './plugins/permissions';
|
|
14
|
-
export { MfaPlugin, mfaClient } from './plugins/mfa';
|
|
15
9
|
export { MultiappPlugin, multiappClient } from './plugins/multiapp';
|
|
16
|
-
export {
|
|
17
|
-
export { CompliancePlugin, complianceClient } from './plugins/compliance';
|
|
18
|
-
export { MagiclinkPlugin, magiclinkClient } from './plugins/magiclink';
|
|
10
|
+
export { PasskeyPlugin, passkeyClient } from './plugins/passkey';
|
|
19
11
|
export { PhonePlugin, phoneClient } from './plugins/phone';
|
|
20
12
|
export { WebhookPlugin, webhookClient } from './plugins/webhook';
|
|
13
|
+
export { ImpersonationPlugin, impersonationClient } from './plugins/impersonation';
|
|
14
|
+
export { CmsPlugin, cmsClient } from './plugins/cms';
|
|
15
|
+
export { OidcproviderPlugin, oidcproviderClient } from './plugins/oidcprovider';
|
|
16
|
+
export { EmailotpPlugin, emailotpClient } from './plugins/emailotp';
|
|
17
|
+
export { BackupauthPlugin, backupauthClient } from './plugins/backupauth';
|
|
18
|
+
export { TwofaPlugin, twofaClient } from './plugins/twofa';
|
|
19
|
+
export { SocialPlugin, socialClient } from './plugins/social';
|
|
21
20
|
export { AdminPlugin, adminClient } from './plugins/admin';
|
|
21
|
+
export { EmailverificationPlugin, emailverificationClient } from './plugins/emailverification';
|
|
22
|
+
export { ConsentPlugin, consentClient } from './plugins/consent';
|
|
22
23
|
export { StepupPlugin, stepupClient } from './plugins/stepup';
|
|
23
|
-
export { ImpersonationPlugin, impersonationClient } from './plugins/impersonation';
|
|
24
24
|
export { JwtPlugin, jwtClient } from './plugins/jwt';
|
|
25
|
-
export {
|
|
25
|
+
export { MfaPlugin, mfaClient } from './plugins/mfa';
|
|
26
|
+
export { SecretsPlugin, secretsClient } from './plugins/secrets';
|
|
26
27
|
export { UsernamePlugin, usernameClient } from './plugins/username';
|
|
27
|
-
export {
|
|
28
|
+
export { MagiclinkPlugin, magiclinkClient } from './plugins/magiclink';
|
|
29
|
+
export { OrganizationPlugin, organizationClient } from './plugins/organization';
|
|
30
|
+
export { SsoPlugin, ssoClient } from './plugins/sso';
|
|
31
|
+
export { IdverificationPlugin, idverificationClient } from './plugins/idverification';
|
|
32
|
+
export { NotificationPlugin, notificationClient } from './plugins/notification';
|
|
28
33
|
export { MultisessionPlugin, multisessionClient } from './plugins/multisession';
|
|
29
|
-
export {
|
|
34
|
+
export { PermissionsPlugin, permissionsClient } from './plugins/permissions';
|
|
35
|
+
export { AnonymousPlugin, anonymousClient } from './plugins/anonymous';
|
|
30
36
|
export { ApikeyPlugin, apikeyClient } from './plugins/apikey';
|
|
31
|
-
export {
|
|
32
|
-
export { BackupauthPlugin, backupauthClient } from './plugins/backupauth';
|
|
33
|
-
export { OrganizationPlugin, organizationClient } from './plugins/organization';
|
|
34
|
-
export { TwofaPlugin, twofaClient } from './plugins/twofa';
|
|
35
|
-
export { EmailotpPlugin, emailotpClient } from './plugins/emailotp';
|
|
36
|
-
export { SecretsPlugin, secretsClient } from './plugins/secrets';
|
|
37
|
-
export { SocialPlugin, socialClient } from './plugins/social';
|
|
37
|
+
export { CompliancePlugin, complianceClient } from './plugins/compliance';
|
package/src/plugins/admin.ts
CHANGED
|
@@ -13,57 +13,57 @@ export class AdminPlugin implements ClientPlugin {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
async createUser(): Promise<void> {
|
|
16
|
-
const path = '/users';
|
|
16
|
+
const path = '/admin/users';
|
|
17
17
|
return this.client.request<void>('POST', path);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
async listUsers(): Promise<void> {
|
|
21
|
-
const path = '/users';
|
|
21
|
+
const path = '/admin/users';
|
|
22
22
|
return this.client.request<void>('GET', path);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
async deleteUser(params: { id: string }): Promise<types.MessageResponse> {
|
|
26
|
-
const path = `/users/${params.id}`;
|
|
26
|
+
const path = `/admin/users/${params.id}`;
|
|
27
27
|
return this.client.request<types.MessageResponse>('DELETE', path);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
async banUser(params: { id: string }): Promise<types.MessageResponse> {
|
|
31
|
-
const path = `/users/${params.id}/ban`;
|
|
31
|
+
const path = `/admin/users/${params.id}/ban`;
|
|
32
32
|
return this.client.request<types.MessageResponse>('POST', path);
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
async unbanUser(params: { id: string }): Promise<types.MessageResponse> {
|
|
36
|
-
const path = `/users/${params.id}/unban`;
|
|
36
|
+
const path = `/admin/users/${params.id}/unban`;
|
|
37
37
|
return this.client.request<types.MessageResponse>('POST', path);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
async impersonateUser(params: { id: string }): Promise<void> {
|
|
41
|
-
const path = `/users/${params.id}/impersonate`;
|
|
41
|
+
const path = `/admin/users/${params.id}/impersonate`;
|
|
42
42
|
return this.client.request<void>('POST', path);
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
async setUserRole(params: { id: string }): Promise<types.MessageResponse> {
|
|
46
|
-
const path = `/users/${params.id}/role`;
|
|
46
|
+
const path = `/admin/users/${params.id}/role`;
|
|
47
47
|
return this.client.request<types.MessageResponse>('POST', path);
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
async listSessions(): Promise<void> {
|
|
51
|
-
const path = '/sessions';
|
|
51
|
+
const path = '/admin/sessions';
|
|
52
52
|
return this.client.request<void>('GET', path);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
async revokeSession(params: { id: string }): Promise<types.MessageResponse> {
|
|
56
|
-
const path = `/sessions/${params.id}`;
|
|
56
|
+
const path = `/admin/sessions/${params.id}`;
|
|
57
57
|
return this.client.request<types.MessageResponse>('DELETE', path);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
async getStats(): Promise<void> {
|
|
61
|
-
const path = '/stats';
|
|
61
|
+
const path = '/admin/stats';
|
|
62
62
|
return this.client.request<void>('GET', path);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
async getAuditLogs(): Promise<void> {
|
|
66
|
-
const path = '/audit-logs';
|
|
66
|
+
const path = '/admin/audit-logs';
|
|
67
67
|
return this.client.request<void>('GET', path);
|
|
68
68
|
}
|
|
69
69
|
|
package/src/plugins/apikey.ts
CHANGED
|
@@ -13,49 +13,49 @@ export class ApikeyPlugin implements ClientPlugin {
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
async createAPIKey(request: types.CreateAPIKeyRequest): Promise<types.CreateAPIKeyResponse> {
|
|
16
|
-
const path = '/
|
|
16
|
+
const path = '/api-keys';
|
|
17
17
|
return this.client.request<types.CreateAPIKeyResponse>('POST', path, {
|
|
18
18
|
body: request,
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
async listAPIKeys(request?: types.ListAPIKeysRequest): Promise<types.ListAPIKeysResponse> {
|
|
23
|
-
const path = '/
|
|
23
|
+
const path = '/api-keys';
|
|
24
24
|
return this.client.request<types.ListAPIKeysResponse>('GET', path, {
|
|
25
25
|
query: this.client.toQueryParams(request),
|
|
26
26
|
});
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
async getAPIKey(params: { id: string }, request?: types.GetAPIKeyRequest): Promise<types.APIKey> {
|
|
30
|
-
const path =
|
|
30
|
+
const path = `/api-keys/${params.id}`;
|
|
31
31
|
return this.client.request<types.APIKey>('GET', path, {
|
|
32
32
|
query: this.client.toQueryParams(request),
|
|
33
33
|
});
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
async updateAPIKey(params: { id: string }, request: types.UpdateAPIKeyRequest): Promise<types.APIKey> {
|
|
37
|
-
const path =
|
|
37
|
+
const path = `/api-keys/${params.id}`;
|
|
38
38
|
return this.client.request<types.APIKey>('PUT', path, {
|
|
39
39
|
body: request,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
async deleteAPIKey(params: { id: string }, request?: types.DeleteAPIKeyRequest): Promise<types.MessageResponse> {
|
|
44
|
-
const path =
|
|
44
|
+
const path = `/api-keys/${params.id}`;
|
|
45
45
|
return this.client.request<types.MessageResponse>('DELETE', path, {
|
|
46
46
|
query: this.client.toQueryParams(request),
|
|
47
47
|
});
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
async rotateAPIKey(params: { id: string }, request: types.RotateAPIKeyRequest): Promise<types.RotateAPIKeyResponse> {
|
|
51
|
-
const path =
|
|
51
|
+
const path = `/api-keys/${params.id}/rotate`;
|
|
52
52
|
return this.client.request<types.RotateAPIKeyResponse>('POST', path, {
|
|
53
53
|
body: request,
|
|
54
54
|
});
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
async verifyAPIKey(request: types.VerifyAPIKeyRequest): Promise<types.VerifyAPIKeyResponse> {
|
|
58
|
-
const path = '/verify';
|
|
58
|
+
const path = '/api-keys/verify';
|
|
59
59
|
return this.client.request<types.VerifyAPIKeyResponse>('POST', path, {
|
|
60
60
|
body: request,
|
|
61
61
|
});
|
|
@@ -161,36 +161,36 @@ export class BackupauthPlugin implements ClientPlugin {
|
|
|
161
161
|
}
|
|
162
162
|
|
|
163
163
|
async listRecoverySessions(): Promise<types.BackupAuthSessionsResponse> {
|
|
164
|
-
const path = '/sessions';
|
|
164
|
+
const path = '/admin/sessions';
|
|
165
165
|
return this.client.request<types.BackupAuthSessionsResponse>('GET', path);
|
|
166
166
|
}
|
|
167
167
|
|
|
168
168
|
async approveRecovery(params: { id: string }, request: types.ApproveRecoveryRequest): Promise<types.BackupAuthStatusResponse> {
|
|
169
|
-
const path = `/sessions/${params.id}/approve`;
|
|
169
|
+
const path = `/admin/sessions/${params.id}/approve`;
|
|
170
170
|
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
171
171
|
body: request,
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
|
|
175
175
|
async rejectRecovery(params: { id: string }, request: types.RejectRecoveryRequest): Promise<types.BackupAuthStatusResponse> {
|
|
176
|
-
const path = `/sessions/${params.id}/reject`;
|
|
176
|
+
const path = `/admin/sessions/${params.id}/reject`;
|
|
177
177
|
return this.client.request<types.BackupAuthStatusResponse>('POST', path, {
|
|
178
178
|
body: request,
|
|
179
179
|
});
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
async getRecoveryStats(): Promise<types.BackupAuthStatsResponse> {
|
|
183
|
-
const path = '/stats';
|
|
183
|
+
const path = '/admin/stats';
|
|
184
184
|
return this.client.request<types.BackupAuthStatsResponse>('GET', path);
|
|
185
185
|
}
|
|
186
186
|
|
|
187
187
|
async getRecoveryConfig(): Promise<types.BackupAuthConfigResponse> {
|
|
188
|
-
const path = '/config';
|
|
188
|
+
const path = '/admin/config';
|
|
189
189
|
return this.client.request<types.BackupAuthConfigResponse>('GET', path);
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
async updateRecoveryConfig(request: types.UpdateRecoveryConfigRequest): Promise<types.BackupAuthConfigResponse> {
|
|
193
|
-
const path = '/config';
|
|
193
|
+
const path = '/admin/config';
|
|
194
194
|
return this.client.request<types.BackupAuthConfigResponse>('PUT', path, {
|
|
195
195
|
body: request,
|
|
196
196
|
});
|
package/src/plugins/cms.ts
CHANGED
|
@@ -12,164 +12,164 @@ export class CmsPlugin implements ClientPlugin {
|
|
|
12
12
|
this.client = client;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
async listEntries(): Promise<void> {
|
|
16
|
-
const path =
|
|
15
|
+
async listEntries(params: { typeSlug: string }): Promise<void> {
|
|
16
|
+
const path = `/cms/${params.typeSlug}`;
|
|
17
17
|
return this.client.request<void>('GET', path);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
-
async createEntry(request: types.CreateEntryRequest): Promise<void> {
|
|
21
|
-
const path =
|
|
20
|
+
async createEntry(params: { typeSlug: string }, request: types.CreateEntryRequest): Promise<void> {
|
|
21
|
+
const path = `/cms/${params.typeSlug}`;
|
|
22
22
|
return this.client.request<void>('POST', path, {
|
|
23
23
|
body: request,
|
|
24
24
|
});
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
async getEntry(): Promise<void> {
|
|
28
|
-
const path =
|
|
27
|
+
async getEntry(params: { typeSlug: string; entryId: string }): Promise<void> {
|
|
28
|
+
const path = `/cms/${params.typeSlug}/${params.entryId}`;
|
|
29
29
|
return this.client.request<void>('GET', path);
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
async updateEntry(request: types.UpdateEntryRequest): Promise<void> {
|
|
33
|
-
const path =
|
|
32
|
+
async updateEntry(params: { typeSlug: string; entryId: string }, request: types.UpdateEntryRequest): Promise<void> {
|
|
33
|
+
const path = `/cms/${params.typeSlug}/${params.entryId}`;
|
|
34
34
|
return this.client.request<void>('PUT', path, {
|
|
35
35
|
body: request,
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
async deleteEntry(): Promise<void> {
|
|
40
|
-
const path =
|
|
39
|
+
async deleteEntry(params: { typeSlug: string; entryId: string }): Promise<void> {
|
|
40
|
+
const path = `/cms/${params.typeSlug}/${params.entryId}`;
|
|
41
41
|
return this.client.request<void>('DELETE', path);
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
async publishEntry(request: types.PublishEntryRequest): Promise<void> {
|
|
45
|
-
const path =
|
|
44
|
+
async publishEntry(params: { typeSlug: string; entryId: string }, request: types.PublishEntryRequest): Promise<void> {
|
|
45
|
+
const path = `/cms/${params.typeSlug}/${params.entryId}/publish`;
|
|
46
46
|
return this.client.request<void>('POST', path, {
|
|
47
47
|
body: request,
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
async unpublishEntry(): Promise<void> {
|
|
52
|
-
const path =
|
|
51
|
+
async unpublishEntry(params: { typeSlug: string; entryId: string }): Promise<void> {
|
|
52
|
+
const path = `/cms/${params.typeSlug}/${params.entryId}/unpublish`;
|
|
53
53
|
return this.client.request<void>('POST', path);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
async archiveEntry(): Promise<void> {
|
|
57
|
-
const path =
|
|
56
|
+
async archiveEntry(params: { typeSlug: string; entryId: string }): Promise<void> {
|
|
57
|
+
const path = `/cms/${params.typeSlug}/${params.entryId}/archive`;
|
|
58
58
|
return this.client.request<void>('POST', path);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
async queryEntries(): Promise<void> {
|
|
62
|
-
const path =
|
|
61
|
+
async queryEntries(params: { typeSlug: string }): Promise<void> {
|
|
62
|
+
const path = `/cms/${params.typeSlug}/query`;
|
|
63
63
|
return this.client.request<void>('POST', path);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
async bulkPublish(): Promise<void> {
|
|
67
|
-
const path =
|
|
66
|
+
async bulkPublish(params: { typeSlug: string }): Promise<void> {
|
|
67
|
+
const path = `/cms/${params.typeSlug}/bulk/publish`;
|
|
68
68
|
return this.client.request<void>('POST', path);
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
async bulkUnpublish(): Promise<void> {
|
|
72
|
-
const path =
|
|
71
|
+
async bulkUnpublish(params: { typeSlug: string }): Promise<void> {
|
|
72
|
+
const path = `/cms/${params.typeSlug}/bulk/unpublish`;
|
|
73
73
|
return this.client.request<void>('POST', path);
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
async bulkDelete(): Promise<void> {
|
|
77
|
-
const path =
|
|
76
|
+
async bulkDelete(params: { typeSlug: string }): Promise<void> {
|
|
77
|
+
const path = `/cms/${params.typeSlug}/bulk/delete`;
|
|
78
78
|
return this.client.request<void>('POST', path);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
async getEntryStats(): Promise<void> {
|
|
82
|
-
const path =
|
|
81
|
+
async getEntryStats(params: { typeSlug: string }): Promise<void> {
|
|
82
|
+
const path = `/cms/${params.typeSlug}/stats`;
|
|
83
83
|
return this.client.request<void>('GET', path);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
async listContentTypes(): Promise<void> {
|
|
87
|
-
const path = '/
|
|
87
|
+
const path = '/cms/types';
|
|
88
88
|
return this.client.request<void>('GET', path);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
async createContentType(request: types.CreateContentTypeRequest): Promise<void> {
|
|
92
|
-
const path = '/
|
|
92
|
+
const path = '/cms/types';
|
|
93
93
|
return this.client.request<void>('POST', path, {
|
|
94
94
|
body: request,
|
|
95
95
|
});
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
async getContentType(params: { slug: string }): Promise<void> {
|
|
99
|
-
const path =
|
|
99
|
+
const path = `/cms/types/${params.slug}`;
|
|
100
100
|
return this.client.request<void>('GET', path);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
103
|
async updateContentType(params: { slug: string }, request: types.UpdateContentTypeRequest): Promise<void> {
|
|
104
|
-
const path =
|
|
104
|
+
const path = `/cms/types/${params.slug}`;
|
|
105
105
|
return this.client.request<void>('PUT', path, {
|
|
106
106
|
body: request,
|
|
107
107
|
});
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
async deleteContentType(params: { slug: string }): Promise<void> {
|
|
111
|
-
const path =
|
|
111
|
+
const path = `/cms/types/${params.slug}`;
|
|
112
112
|
return this.client.request<void>('DELETE', path);
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
-
async listFields(): Promise<void> {
|
|
116
|
-
const path =
|
|
115
|
+
async listFields(params: { slug: string }): Promise<void> {
|
|
116
|
+
const path = `/cms/types/${params.slug}/fields`;
|
|
117
117
|
return this.client.request<void>('GET', path);
|
|
118
118
|
}
|
|
119
119
|
|
|
120
|
-
async addField(request: types.CreateFieldRequest): Promise<void> {
|
|
121
|
-
const path =
|
|
120
|
+
async addField(params: { slug: string }, request: types.CreateFieldRequest): Promise<void> {
|
|
121
|
+
const path = `/cms/types/${params.slug}/fields`;
|
|
122
122
|
return this.client.request<void>('POST', path, {
|
|
123
123
|
body: request,
|
|
124
124
|
});
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
async getField(params: { fieldSlug: string }): Promise<void> {
|
|
128
|
-
const path =
|
|
127
|
+
async getField(params: { slug: string; fieldSlug: string }): Promise<void> {
|
|
128
|
+
const path = `/cms/types/${params.slug}/fields/${params.fieldSlug}`;
|
|
129
129
|
return this.client.request<void>('GET', path);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
async updateField(params: { fieldSlug: string }, request: types.UpdateFieldRequest): Promise<void> {
|
|
133
|
-
const path =
|
|
132
|
+
async updateField(params: { slug: string; fieldSlug: string }, request: types.UpdateFieldRequest): Promise<void> {
|
|
133
|
+
const path = `/cms/types/${params.slug}/fields/${params.fieldSlug}`;
|
|
134
134
|
return this.client.request<void>('PUT', path, {
|
|
135
135
|
body: request,
|
|
136
136
|
});
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
async deleteField(params: { fieldSlug: string }): Promise<void> {
|
|
140
|
-
const path =
|
|
139
|
+
async deleteField(params: { slug: string; fieldSlug: string }): Promise<void> {
|
|
140
|
+
const path = `/cms/types/${params.slug}/fields/${params.fieldSlug}`;
|
|
141
141
|
return this.client.request<void>('DELETE', path);
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
async reorderFields(request: types.ReorderFieldsRequest): Promise<void> {
|
|
145
|
-
const path =
|
|
144
|
+
async reorderFields(params: { slug: string }, request: types.ReorderFieldsRequest): Promise<void> {
|
|
145
|
+
const path = `/cms/types/${params.slug}/fields/reorder`;
|
|
146
146
|
return this.client.request<void>('POST', path, {
|
|
147
147
|
body: request,
|
|
148
148
|
});
|
|
149
149
|
}
|
|
150
150
|
|
|
151
151
|
async getFieldTypes(): Promise<void> {
|
|
152
|
-
const path = '/field-types';
|
|
152
|
+
const path = '/cms/field-types';
|
|
153
153
|
return this.client.request<void>('GET', path);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
async listRevisions(): Promise<void> {
|
|
157
|
-
const path =
|
|
156
|
+
async listRevisions(params: { typeSlug: string; entryId: string }): Promise<void> {
|
|
157
|
+
const path = `/cms/${params.typeSlug}/${params.entryId}/revisions`;
|
|
158
158
|
return this.client.request<void>('GET', path);
|
|
159
159
|
}
|
|
160
160
|
|
|
161
|
-
async getRevision(params: { version: number }): Promise<void> {
|
|
162
|
-
const path =
|
|
161
|
+
async getRevision(params: { typeSlug: string; entryId: string; version: number }): Promise<void> {
|
|
162
|
+
const path = `/cms/${params.typeSlug}/${params.entryId}/revisions/${params.version}`;
|
|
163
163
|
return this.client.request<void>('GET', path);
|
|
164
164
|
}
|
|
165
165
|
|
|
166
|
-
async restoreRevision(params: { version: number }): Promise<void> {
|
|
167
|
-
const path =
|
|
166
|
+
async restoreRevision(params: { entryId: string; version: number; typeSlug: string }): Promise<void> {
|
|
167
|
+
const path = `/cms/${params.typeSlug}/${params.entryId}/revisions/${params.version}/restore`;
|
|
168
168
|
return this.client.request<void>('POST', path);
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
async compareRevisions(): Promise<void> {
|
|
172
|
-
const path =
|
|
171
|
+
async compareRevisions(params: { typeSlug: string; entryId: string }): Promise<void> {
|
|
172
|
+
const path = `/cms/${params.typeSlug}/${params.entryId}/revisions/compare`;
|
|
173
173
|
return this.client.request<void>('GET', path);
|
|
174
174
|
}
|
|
175
175
|
|