@sso-id/node 0.2.5 → 0.2.7
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/management.d.ts +20 -0
- package/dist/management.js +44 -0
- package/package.json +36 -36
package/dist/management.d.ts
CHANGED
|
@@ -90,6 +90,26 @@ export declare class ManagementClient {
|
|
|
90
90
|
addUser: (groupId: string, userId: string) => Promise<unknown>;
|
|
91
91
|
removeUser: (groupId: string, userId: string) => Promise<void>;
|
|
92
92
|
};
|
|
93
|
+
readonly appPages: {
|
|
94
|
+
listMenus: () => Promise<unknown[]>;
|
|
95
|
+
createMenu: (data: {
|
|
96
|
+
menuTitle: string;
|
|
97
|
+
menuUrl: string;
|
|
98
|
+
menuDescription?: string;
|
|
99
|
+
parentId?: string;
|
|
100
|
+
sortOrder?: number;
|
|
101
|
+
isCategory?: boolean;
|
|
102
|
+
}) => Promise<unknown>;
|
|
103
|
+
listApis: () => Promise<unknown[]>;
|
|
104
|
+
createApi: (data: {
|
|
105
|
+
apiName: string;
|
|
106
|
+
apiUrl: string;
|
|
107
|
+
httpMethod?: string;
|
|
108
|
+
apiDescription?: string;
|
|
109
|
+
menuId?: string;
|
|
110
|
+
sortOrder?: number;
|
|
111
|
+
}) => Promise<unknown>;
|
|
112
|
+
};
|
|
93
113
|
readonly scim: {
|
|
94
114
|
forConnection: (connectionId?: string, scimBearerToken?: string) => {
|
|
95
115
|
serviceProviderConfig: () => Promise<unknown>;
|
package/dist/management.js
CHANGED
|
@@ -306,6 +306,50 @@ export class ManagementClient {
|
|
|
306
306
|
addUser: (groupId, userId) => this.request('POST', `/api/groups/${encodeURIComponent(groupId)}/users/${encodeURIComponent(userId)}`),
|
|
307
307
|
removeUser: (groupId, userId) => this.request('DELETE', `/api/groups/${encodeURIComponent(groupId)}/users/${encodeURIComponent(userId)}`),
|
|
308
308
|
};
|
|
309
|
+
appPages = {
|
|
310
|
+
listMenus: async () => {
|
|
311
|
+
const appId = await this.getApplicationId();
|
|
312
|
+
if (!appId)
|
|
313
|
+
return [];
|
|
314
|
+
const res = await this.request('GET', `/api/applications/${encodeURIComponent(appId)}/menus`).catch(() => []);
|
|
315
|
+
return unwrapList(res);
|
|
316
|
+
},
|
|
317
|
+
createMenu: async (data) => {
|
|
318
|
+
const appId = await this.getApplicationId();
|
|
319
|
+
if (!appId)
|
|
320
|
+
throw new Error('Application not found for clientId');
|
|
321
|
+
return this.request('POST', `/api/applications/${encodeURIComponent(appId)}/menus`, {
|
|
322
|
+
applicationId: appId,
|
|
323
|
+
menuTitle: data.menuTitle,
|
|
324
|
+
menuUrl: data.menuUrl,
|
|
325
|
+
menuDescription: data.menuDescription || '',
|
|
326
|
+
parentId: data.parentId || '',
|
|
327
|
+
sortOrder: data.sortOrder ?? 1,
|
|
328
|
+
isCategory: data.isCategory ?? false,
|
|
329
|
+
});
|
|
330
|
+
},
|
|
331
|
+
listApis: async () => {
|
|
332
|
+
const appId = await this.getApplicationId();
|
|
333
|
+
if (!appId)
|
|
334
|
+
return [];
|
|
335
|
+
const res = await this.request('GET', `/api/applications/${encodeURIComponent(appId)}/apis`).catch(() => []);
|
|
336
|
+
return unwrapList(res);
|
|
337
|
+
},
|
|
338
|
+
createApi: async (data) => {
|
|
339
|
+
const appId = await this.getApplicationId();
|
|
340
|
+
if (!appId)
|
|
341
|
+
throw new Error('Application not found for clientId');
|
|
342
|
+
return this.request('POST', `/api/applications/${encodeURIComponent(appId)}/apis`, {
|
|
343
|
+
applicationId: appId,
|
|
344
|
+
apiName: data.apiName,
|
|
345
|
+
apiUrl: data.apiUrl,
|
|
346
|
+
httpMethod: data.httpMethod || 'GET,POST',
|
|
347
|
+
apiDescription: data.apiDescription || '',
|
|
348
|
+
menuId: data.menuId || '',
|
|
349
|
+
sortOrder: data.sortOrder ?? 1,
|
|
350
|
+
});
|
|
351
|
+
},
|
|
352
|
+
};
|
|
309
353
|
scim = {
|
|
310
354
|
forConnection: (connectionId, scimBearerToken) => {
|
|
311
355
|
const prefix = connectionId
|
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@sso-id/node",
|
|
3
|
+
"version": "0.2.7",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Official SSO.ID Node.js SDK (RS256 JWKS JWT verification, Express/Fastify middleware, Management API client)",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"module": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"test": "node --test tests/*.test.mjs"
|
|
12
|
+
},
|
|
13
|
+
"keywords": [
|
|
14
|
+
"sso.id",
|
|
15
|
+
"node",
|
|
16
|
+
"jwt",
|
|
17
|
+
"jwks",
|
|
18
|
+
"oauth2",
|
|
19
|
+
"oidc",
|
|
20
|
+
"management-api"
|
|
21
|
+
],
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"engines": {
|
|
24
|
+
"node": "\u003e=18.0.0"
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@types/node": "^20.11.0",
|
|
28
|
+
"typescript": "^5.4.0"
|
|
29
|
+
},
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public"
|
|
32
|
+
},
|
|
33
|
+
"files": [
|
|
34
|
+
"dist"
|
|
35
|
+
]
|
|
36
|
+
}
|