@frontegg/rest-api 3.0.48 → 3.0.50
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/constants.d.ts +1 -0
- package/constants.js +2 -1
- package/directory/index.d.ts +2 -1
- package/directory/index.js +3 -0
- package/directory/interfaces.d.ts +3 -0
- package/fetch.d.ts +1 -1
- package/fetch.js +4 -3
- package/index.js +1 -1
- package/node/constants.js +2 -1
- package/node/directory/index.js +5 -0
- package/node/fetch.js +4 -3
- package/node/index.js +1 -1
- package/package.json +1 -1
package/constants.d.ts
CHANGED
package/constants.js
CHANGED
package/directory/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Scim2ConnectionConfigResponse, Scim2CreateConnectionConfigRequest, Scim2PatchConnectionConfigRequest } from './interfaces';
|
|
1
|
+
import { Scim2ConnectionConfigResponse, Scim2CountResponse, Scim2CreateConnectionConfigRequest, Scim2PatchConnectionConfigRequest } from './interfaces';
|
|
2
2
|
/**
|
|
3
3
|
* returns all scim2 configurations
|
|
4
4
|
*
|
|
@@ -20,3 +20,4 @@ export declare function createConfiguration(body: Scim2CreateConnectionConfigReq
|
|
|
20
20
|
* ``authorized user``
|
|
21
21
|
*/
|
|
22
22
|
export declare function deleteConfiguration(id: string): Promise<void>;
|
|
23
|
+
export declare function countConfigurationUsers(id: string): Promise<Scim2CountResponse>;
|
package/directory/index.js
CHANGED
|
@@ -11,4 +11,7 @@ export async function createConfiguration(body) {
|
|
|
11
11
|
}
|
|
12
12
|
export async function deleteConfiguration(id) {
|
|
13
13
|
return Delete(`${urls.directory.v1}/${id}`);
|
|
14
|
+
}
|
|
15
|
+
export async function countConfigurationUsers(id) {
|
|
16
|
+
return Get(`${urls.directory.temp}/${id}/Users/count`);
|
|
14
17
|
}
|
package/fetch.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ interface RequestOptions {
|
|
|
9
9
|
headers?: Record<string, string>;
|
|
10
10
|
credentials?: RequestCredentials;
|
|
11
11
|
}
|
|
12
|
-
export declare function getBaseUrl(context: ContextOptions, url: string,
|
|
12
|
+
export declare function getBaseUrl(context: ContextOptions, url: string, withFronteggPrefix?: boolean): string;
|
|
13
13
|
export declare const Get: (url: string, params?: any, opts?: Pick<RequestOptions, "body" | "params" | "contentType" | "responseType" | "headers" | "credentials"> | undefined) => Promise<any>;
|
|
14
14
|
export declare const Post: (url: string, body?: any, opts?: Pick<RequestOptions, "body" | "params" | "contentType" | "responseType" | "headers" | "credentials"> | undefined) => Promise<any>;
|
|
15
15
|
export declare const Patch: (url: string, body?: any, opts?: Pick<RequestOptions, "body" | "params" | "contentType" | "responseType" | "headers" | "credentials"> | undefined) => Promise<any>;
|
package/fetch.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
2
|
import { ContextHolder } from './ContextHolder';
|
|
3
3
|
import { FronteggApiError } from './error';
|
|
4
|
-
export function getBaseUrl(context, url,
|
|
4
|
+
export function getBaseUrl(context, url, withFronteggPrefix = true) {
|
|
5
5
|
let baseUrl;
|
|
6
6
|
|
|
7
7
|
if (typeof context.baseUrl === 'function') {
|
|
@@ -10,13 +10,14 @@ export function getBaseUrl(context, url, withFronteggSuffix = true) {
|
|
|
10
10
|
baseUrl = context.baseUrl;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
const prefix = context.urlPrefix ||
|
|
13
|
+
const prefix = context.urlPrefix || 'frontegg';
|
|
14
|
+
const removePrefix = prefix === 'frontegg' && !withFronteggPrefix;
|
|
14
15
|
|
|
15
16
|
if (!baseUrl.endsWith('/')) {
|
|
16
17
|
baseUrl += '/';
|
|
17
18
|
}
|
|
18
19
|
|
|
19
|
-
if (!baseUrl.endsWith(prefix)) {
|
|
20
|
+
if (!baseUrl.endsWith(prefix) && !removePrefix) {
|
|
20
21
|
baseUrl += prefix;
|
|
21
22
|
}
|
|
22
23
|
|
package/index.js
CHANGED
package/node/constants.js
CHANGED
package/node/directory/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.countConfigurationUsers = countConfigurationUsers;
|
|
6
7
|
exports.createConfiguration = createConfiguration;
|
|
7
8
|
exports.deleteConfiguration = deleteConfiguration;
|
|
8
9
|
exports.getConfigs = getConfigs;
|
|
@@ -26,4 +27,8 @@ async function createConfiguration(body) {
|
|
|
26
27
|
|
|
27
28
|
async function deleteConfiguration(id) {
|
|
28
29
|
return (0, _fetch.Delete)(`${_constants.urls.directory.v1}/${id}`);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
async function countConfigurationUsers(id) {
|
|
33
|
+
return (0, _fetch.Get)(`${_constants.urls.directory.temp}/${id}/Users/count`);
|
|
29
34
|
}
|
package/node/fetch.js
CHANGED
|
@@ -14,7 +14,7 @@ var _ContextHolder = require("./ContextHolder");
|
|
|
14
14
|
|
|
15
15
|
var _error = require("./error");
|
|
16
16
|
|
|
17
|
-
function getBaseUrl(context, url,
|
|
17
|
+
function getBaseUrl(context, url, withFronteggPrefix = true) {
|
|
18
18
|
let baseUrl;
|
|
19
19
|
|
|
20
20
|
if (typeof context.baseUrl === 'function') {
|
|
@@ -23,13 +23,14 @@ function getBaseUrl(context, url, withFronteggSuffix = true) {
|
|
|
23
23
|
baseUrl = context.baseUrl;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
const prefix = context.urlPrefix ||
|
|
26
|
+
const prefix = context.urlPrefix || 'frontegg';
|
|
27
|
+
const removePrefix = prefix === 'frontegg' && !withFronteggPrefix;
|
|
27
28
|
|
|
28
29
|
if (!baseUrl.endsWith('/')) {
|
|
29
30
|
baseUrl += '/';
|
|
30
31
|
}
|
|
31
32
|
|
|
32
|
-
if (!baseUrl.endsWith(prefix)) {
|
|
33
|
+
if (!baseUrl.endsWith(prefix) && !removePrefix) {
|
|
33
34
|
baseUrl += prefix;
|
|
34
35
|
}
|
|
35
36
|
|
package/node/index.js
CHANGED