@sso-id/node 0.2.1 → 0.2.2

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 (2) hide show
  1. package/dist/management.js +13 -2
  2. package/package.json +1 -1
@@ -68,7 +68,12 @@ export class ManagementClient {
68
68
  return this.request('GET', `/api/users${qs ? `?${qs}` : ''}`);
69
69
  },
70
70
  get: (userId) => this.request('GET', `/api/users/${encodeURIComponent(userId)}`),
71
- create: (data) => this.request('POST', '/api/users', data),
71
+ create: (data) => this.request('POST', '/api/users', {
72
+ emailAddress: data.emailAddress ?? data.email ?? data.userName,
73
+ firstName: data.firstName ?? data.name ?? data.displayName ?? 'User',
74
+ lastName: data.lastName ?? 'User',
75
+ ...data,
76
+ }),
72
77
  invite: (data) => this.request('POST', '/api/users/invite', data),
73
78
  update: (userId, data) => this.request('PUT', `/api/users/${encodeURIComponent(userId)}`, data),
74
79
  delete: (userId) => this.request('DELETE', `/api/users/${encodeURIComponent(userId)}`),
@@ -111,7 +116,13 @@ export class ManagementClient {
111
116
  groups = {
112
117
  list: () => this.request('GET', '/api/groups'),
113
118
  get: (groupId) => this.request('GET', `/api/groups/${encodeURIComponent(groupId)}`),
114
- create: (data) => this.request('POST', '/api/groups', data),
119
+ create: (data) => this.request('POST', '/api/groups', {
120
+ groupId: '',
121
+ groupName: data.groupName ?? data.name,
122
+ createdBy: 'system',
123
+ lastModifiedBy: 'system',
124
+ ...data,
125
+ }),
115
126
  update: (groupId, data) => this.request('PUT', `/api/groups/${encodeURIComponent(groupId)}`, data),
116
127
  delete: (groupId) => this.request('DELETE', `/api/groups/${encodeURIComponent(groupId)}`),
117
128
  listUsers: (groupId) => this.request('GET', `/api/groups/${encodeURIComponent(groupId)}/users`),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sso-id/node",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "description": "Official SSO.ID Node.js SDK (RS256 JWKS JWT verification, Express/Fastify middleware, Management API client)",
6
6
  "main": "dist/index.js",