@sso-id/node 0.2.5 → 0.2.6
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 +50 -0
- package/package.json +1 -1
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,56 @@ 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(`/api/applications/${encodeURIComponent(appId)}/menus`).catch(() => []);
|
|
315
|
+
return this.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(`/api/applications/${encodeURIComponent(appId)}/menus`, {
|
|
322
|
+
method: 'POST',
|
|
323
|
+
body: JSON.stringify({
|
|
324
|
+
applicationId: appId,
|
|
325
|
+
menuTitle: data.menuTitle,
|
|
326
|
+
menuUrl: data.menuUrl,
|
|
327
|
+
menuDescription: data.menuDescription || '',
|
|
328
|
+
parentId: data.parentId || '',
|
|
329
|
+
sortOrder: data.sortOrder ?? 1,
|
|
330
|
+
isCategory: data.isCategory ?? false,
|
|
331
|
+
}),
|
|
332
|
+
});
|
|
333
|
+
},
|
|
334
|
+
listApis: async () => {
|
|
335
|
+
const appId = await this.getApplicationId();
|
|
336
|
+
if (!appId)
|
|
337
|
+
return [];
|
|
338
|
+
const res = await this.request(`/api/applications/${encodeURIComponent(appId)}/apis`).catch(() => []);
|
|
339
|
+
return this.unwrapList(res);
|
|
340
|
+
},
|
|
341
|
+
createApi: async (data) => {
|
|
342
|
+
const appId = await this.getApplicationId();
|
|
343
|
+
if (!appId)
|
|
344
|
+
throw new Error('Application not found for clientId');
|
|
345
|
+
return this.request(`/api/applications/${encodeURIComponent(appId)}/apis`, {
|
|
346
|
+
method: 'POST',
|
|
347
|
+
body: JSON.stringify({
|
|
348
|
+
applicationId: appId,
|
|
349
|
+
apiName: data.apiName,
|
|
350
|
+
apiUrl: data.apiUrl,
|
|
351
|
+
httpMethod: data.httpMethod || 'GET,POST',
|
|
352
|
+
apiDescription: data.apiDescription || '',
|
|
353
|
+
menuId: data.menuId || '',
|
|
354
|
+
sortOrder: data.sortOrder ?? 1,
|
|
355
|
+
}),
|
|
356
|
+
});
|
|
357
|
+
},
|
|
358
|
+
};
|
|
309
359
|
scim = {
|
|
310
360
|
forConnection: (connectionId, scimBearerToken) => {
|
|
311
361
|
const prefix = connectionId
|
package/package.json
CHANGED