@authsome/client 0.0.6 → 0.0.8

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.
Files changed (39) hide show
  1. package/dist/client.d.ts +36 -36
  2. package/dist/client.js +16 -16
  3. package/dist/index.d.ts +16 -16
  4. package/dist/index.js +50 -50
  5. package/dist/plugins/apikey.d.ts +3 -3
  6. package/dist/plugins/apikey.js +8 -8
  7. package/dist/plugins/backupauth.js +23 -23
  8. package/dist/plugins/cms.d.ts +69 -18
  9. package/dist/plugins/cms.js +46 -46
  10. package/dist/plugins/idverification.js +4 -4
  11. package/dist/plugins/jwt.js +2 -2
  12. package/dist/plugins/multiapp.d.ts +19 -4
  13. package/dist/plugins/multiapp.js +20 -20
  14. package/dist/plugins/notification.d.ts +3 -3
  15. package/dist/plugins/notification.js +19 -19
  16. package/dist/plugins/oidcprovider.d.ts +4 -0
  17. package/dist/plugins/oidcprovider.js +26 -4
  18. package/dist/plugins/organization.d.ts +29 -17
  19. package/dist/plugins/organization.js +36 -36
  20. package/dist/plugins/permissions.js +3 -3
  21. package/dist/plugins/secrets.js +2 -2
  22. package/dist/plugins/webhook.d.ts +1 -1
  23. package/dist/types.d.ts +3941 -3113
  24. package/package.json +2 -3
  25. package/src/client.ts +36 -36
  26. package/src/index.ts +16 -16
  27. package/src/plugins/apikey.ts +9 -9
  28. package/src/plugins/backupauth.ts +23 -23
  29. package/src/plugins/cms.ts +51 -51
  30. package/src/plugins/idverification.ts +4 -4
  31. package/src/plugins/jwt.ts +2 -2
  32. package/src/plugins/multiapp.ts +27 -27
  33. package/src/plugins/notification.ts +20 -20
  34. package/src/plugins/oidcprovider.ts +30 -4
  35. package/src/plugins/organization.ts +39 -39
  36. package/src/plugins/permissions.ts +3 -3
  37. package/src/plugins/secrets.ts +2 -2
  38. package/src/plugins/webhook.ts +1 -1
  39. package/src/types.ts +4164 -3201
@@ -17,21 +17,21 @@ class OidcproviderPlugin {
17
17
  });
18
18
  }
19
19
  async listClients() {
20
- const path = '/oauth2/listclients';
20
+ const path = '/oauth2/clients';
21
21
  return this.client.request('GET', path);
22
22
  }
23
23
  async getClient(params) {
24
- const path = `/oauth2/${params.clientId}`;
24
+ const path = `/oauth2/clients/${params.clientId}`;
25
25
  return this.client.request('GET', path);
26
26
  }
27
27
  async updateClient(params, request) {
28
- const path = `/oauth2/${params.clientId}`;
28
+ const path = `/oauth2/clients/${params.clientId}`;
29
29
  return this.client.request('PUT', path, {
30
30
  body: request,
31
31
  });
32
32
  }
33
33
  async deleteClient(params) {
34
- const path = `/oauth2/${params.clientId}`;
34
+ const path = `/oauth2/clients/${params.clientId}`;
35
35
  return this.client.request('DELETE', path);
36
36
  }
37
37
  async discovery() {
@@ -74,6 +74,28 @@ class OidcproviderPlugin {
74
74
  body: request,
75
75
  });
76
76
  }
77
+ async deviceAuthorize(request) {
78
+ const path = '/oauth2/device_authorization';
79
+ return this.client.request('POST', path, {
80
+ body: request,
81
+ });
82
+ }
83
+ async deviceCodeEntry() {
84
+ const path = '/oauth2/device';
85
+ return this.client.request('GET', path);
86
+ }
87
+ async deviceVerify(request) {
88
+ const path = '/oauth2/device/verify';
89
+ return this.client.request('POST', path, {
90
+ body: request,
91
+ });
92
+ }
93
+ async deviceAuthorizeDecision(request) {
94
+ const path = '/oauth2/device/authorize';
95
+ return this.client.request('POST', path, {
96
+ body: request,
97
+ });
98
+ }
77
99
  }
78
100
  exports.OidcproviderPlugin = OidcproviderPlugin;
79
101
  function oidcproviderClient() {
@@ -6,32 +6,31 @@ export declare class OrganizationPlugin implements ClientPlugin {
6
6
  private client;
7
7
  init(client: AuthsomeClient): void;
8
8
  createOrganization(): Promise<types.Organization>;
9
+ getOrganization(params: {
10
+ id: string;
11
+ }): Promise<types.Organization>;
12
+ listOrganizations(): Promise<types.Organization>;
9
13
  updateOrganization(params: {
10
14
  id: string;
11
15
  }): Promise<types.Organization>;
12
16
  deleteOrganization(params: {
13
17
  id: string;
14
18
  }): Promise<void>;
15
- inviteMember(): Promise<void>;
16
- removeMember(params: {
17
- memberId: string;
18
- }): Promise<void>;
19
- createTeam(): Promise<void>;
20
- updateTeam(params: {
21
- teamId: string;
22
- }): Promise<void>;
23
- deleteTeam(params: {
24
- teamId: string;
25
- }): Promise<void>;
26
- getOrganization(params: {
27
- id: string;
28
- }): Promise<types.Organization>;
29
- listOrganizations(): Promise<types.Organization>;
30
19
  getOrganizationBySlug(params: {
31
20
  slug: string;
32
21
  }): Promise<types.Organization>;
33
- listMembers(): Promise<void>;
22
+ listMembers(params: {
23
+ id: string;
24
+ }): Promise<void>;
25
+ inviteMember(params: {
26
+ id: string;
27
+ }): Promise<void>;
34
28
  updateMember(params: {
29
+ id: string;
30
+ memberId: string;
31
+ }): Promise<void>;
32
+ removeMember(params: {
33
+ id: string;
35
34
  memberId: string;
36
35
  }): Promise<void>;
37
36
  acceptInvitation(params: {
@@ -40,6 +39,19 @@ export declare class OrganizationPlugin implements ClientPlugin {
40
39
  declineInvitation(params: {
41
40
  token: string;
42
41
  }): Promise<types.StatusResponse>;
43
- listTeams(): Promise<void>;
42
+ listTeams(params: {
43
+ id: string;
44
+ }): Promise<void>;
45
+ createTeam(params: {
46
+ id: string;
47
+ }): Promise<void>;
48
+ updateTeam(params: {
49
+ id: string;
50
+ teamId: string;
51
+ }): Promise<void>;
52
+ deleteTeam(params: {
53
+ id: string;
54
+ teamId: string;
55
+ }): Promise<void>;
44
56
  }
45
57
  export declare function organizationClient(): OrganizationPlugin;
@@ -11,9 +11,17 @@ class OrganizationPlugin {
11
11
  this.client = client;
12
12
  }
13
13
  async createOrganization() {
14
- const path = '/organizations/createorganization';
14
+ const path = '/organizations';
15
15
  return this.client.request('POST', path);
16
16
  }
17
+ async getOrganization(params) {
18
+ const path = `/organizations/${params.id}`;
19
+ return this.client.request('GET', path);
20
+ }
21
+ async listOrganizations() {
22
+ const path = '/organizations';
23
+ return this.client.request('GET', path);
24
+ }
17
25
  async updateOrganization(params) {
18
26
  const path = `/organizations/${params.id}`;
19
27
  return this.client.request('PATCH', path);
@@ -22,58 +30,50 @@ class OrganizationPlugin {
22
30
  const path = `/organizations/${params.id}`;
23
31
  return this.client.request('DELETE', path);
24
32
  }
25
- async inviteMember() {
26
- const path = '/organizations/invite';
27
- return this.client.request('POST', path);
28
- }
29
- async removeMember(params) {
30
- const path = `/organizations/${params.memberId}`;
31
- return this.client.request('DELETE', path);
32
- }
33
- async createTeam() {
34
- const path = '/organizations/createteam';
35
- return this.client.request('POST', path);
36
- }
37
- async updateTeam(params) {
38
- const path = `/organizations/${params.teamId}`;
39
- return this.client.request('PATCH', path);
40
- }
41
- async deleteTeam(params) {
42
- const path = `/organizations/${params.teamId}`;
43
- return this.client.request('DELETE', path);
44
- }
45
- async getOrganization(params) {
46
- const path = `/organizations/${params.id}`;
47
- return this.client.request('GET', path);
48
- }
49
- async listOrganizations() {
50
- const path = '/organizations/listorganizations';
51
- return this.client.request('GET', path);
52
- }
53
33
  async getOrganizationBySlug(params) {
54
34
  const path = `/organizations/slug/${params.slug}`;
55
35
  return this.client.request('GET', path);
56
36
  }
57
- async listMembers() {
58
- const path = '/organizations/listmembers';
37
+ async listMembers(params) {
38
+ const path = `/organizations/${params.id}/members`;
59
39
  return this.client.request('GET', path);
60
40
  }
41
+ async inviteMember(params) {
42
+ const path = `/organizations/${params.id}/members/invite`;
43
+ return this.client.request('POST', path);
44
+ }
61
45
  async updateMember(params) {
62
- const path = `/organizations/${params.memberId}`;
46
+ const path = `/organizations/${params.id}/members/${params.memberId}`;
63
47
  return this.client.request('PATCH', path);
64
48
  }
49
+ async removeMember(params) {
50
+ const path = `/organizations/${params.id}/members/${params.memberId}`;
51
+ return this.client.request('DELETE', path);
52
+ }
65
53
  async acceptInvitation(params) {
66
- const path = `/organizations/${params.token}/accept`;
54
+ const path = `/organization-invitations/${params.token}/accept`;
67
55
  return this.client.request('POST', path);
68
56
  }
69
57
  async declineInvitation(params) {
70
- const path = `/organizations/${params.token}/decline`;
58
+ const path = `/organization-invitations/${params.token}/decline`;
71
59
  return this.client.request('POST', path);
72
60
  }
73
- async listTeams() {
74
- const path = '/organizations/listteams';
61
+ async listTeams(params) {
62
+ const path = `/organizations/${params.id}/teams`;
75
63
  return this.client.request('GET', path);
76
64
  }
65
+ async createTeam(params) {
66
+ const path = `/organizations/${params.id}/teams`;
67
+ return this.client.request('POST', path);
68
+ }
69
+ async updateTeam(params) {
70
+ const path = `/organizations/${params.id}/teams/${params.teamId}`;
71
+ return this.client.request('PATCH', path);
72
+ }
73
+ async deleteTeam(params) {
74
+ const path = `/organizations/${params.id}/teams/${params.teamId}`;
75
+ return this.client.request('DELETE', path);
76
+ }
77
77
  }
78
78
  exports.OrganizationPlugin = OrganizationPlugin;
79
79
  function organizationClient() {
@@ -11,17 +11,17 @@ class PermissionsPlugin {
11
11
  this.client = client;
12
12
  }
13
13
  async migrateAll(request) {
14
- const path = '/api/permissions/migrate/all';
14
+ const path = '/permissions/migrate/all';
15
15
  return this.client.request('POST', path, {
16
16
  body: request,
17
17
  });
18
18
  }
19
19
  async migrateRoles() {
20
- const path = '/api/permissions/migrate/roles';
20
+ const path = '/permissions/migrate/roles';
21
21
  return this.client.request('POST', path);
22
22
  }
23
23
  async previewConversion(request) {
24
- const path = '/api/permissions/migrate/preview';
24
+ const path = '/permissions/migrate/preview';
25
25
  return this.client.request('POST', path, {
26
26
  body: request,
27
27
  });
@@ -11,13 +11,13 @@ class SecretsPlugin {
11
11
  this.client = client;
12
12
  }
13
13
  async list(request) {
14
- const path = '/secrets/list';
14
+ const path = '/secrets';
15
15
  return this.client.request('GET', path, {
16
16
  query: this.client.toQueryParams(request),
17
17
  });
18
18
  }
19
19
  async create(request) {
20
- const path = '/secrets/create';
20
+ const path = '/secrets';
21
21
  return this.client.request('POST', path, {
22
22
  body: request,
23
23
  });
@@ -6,9 +6,9 @@ export declare class WebhookPlugin implements ClientPlugin {
6
6
  private client;
7
7
  init(client: AuthsomeClient): void;
8
8
  create(request: {
9
+ secret?: string;
9
10
  url: string;
10
11
  events: string[];
11
- secret?: string;
12
12
  }): Promise<{
13
13
  webhook: types.Webhook;
14
14
  }>;