@dvelop-sdk/identityprovider 3.1.0 → 4.0.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.
- package/README.md +29 -29
- package/lib/authentication/get-auth-session/get-auth-session.d.ts +44 -44
- package/lib/authentication/get-auth-session/get-auth-session.js +104 -104
- package/lib/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.d.ts +41 -41
- package/lib/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.js +103 -103
- package/lib/authentication/get-login-redirection-uri/get-login-redirection-uri.d.ts +11 -11
- package/lib/authentication/get-login-redirection-uri/get-login-redirection-uri.js +17 -17
- package/lib/authentication/request-app-session/request-app-session.d.ts +36 -45
- package/lib/authentication/request-app-session/request-app-session.d.ts.map +1 -1
- package/lib/authentication/request-app-session/request-app-session.js +97 -97
- package/lib/authentication/request-app-session/request-app-session.js.map +1 -1
- package/lib/authentication/validate-app-session-signature/validate-app-session-signature.d.ts +31 -23
- package/lib/authentication/validate-app-session-signature/validate-app-session-signature.d.ts.map +1 -1
- package/lib/authentication/validate-app-session-signature/validate-app-session-signature.js +62 -55
- package/lib/authentication/validate-app-session-signature/validate-app-session-signature.js.map +1 -1
- package/lib/authentication/validate-auth-session-id/validate-auth-session-id.d.ts +61 -61
- package/lib/authentication/validate-auth-session-id/validate-auth-session-id.js +100 -100
- package/lib/index.d.ts +40 -40
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +45 -45
- package/lib/index.js.map +1 -1
- package/lib/internal.d.ts +5 -5
- package/lib/internal.js +18 -18
- package/lib/utils/http.d.ts +23 -23
- package/lib/utils/http.js +129 -129
- package/package.json +27 -27
package/lib/index.js
CHANGED
|
@@ -1,46 +1,46 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
-
}) : (function(o, m, k, k2) {
|
|
6
|
-
if (k2 === undefined) k2 = k;
|
|
7
|
-
o[k2] = m[k];
|
|
8
|
-
}));
|
|
9
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
-
}) : function(o, v) {
|
|
12
|
-
o["default"] = v;
|
|
13
|
-
});
|
|
14
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
-
if (mod && mod.__esModule) return mod;
|
|
16
|
-
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
-
__setModuleDefault(result, mod);
|
|
19
|
-
return result;
|
|
20
|
-
};
|
|
21
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
-
exports.validateAuthSessionId = exports.InvalidAppSessionSignatureError = exports.validateAppSessionSignature = exports.getLoginRedirectionUri = exports.requestAppSession = exports.getImpersonatedAuthSessionId = exports.getAuthSession = exports.internals = exports.IdentityproviderError = exports.NotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.BadInputError = void 0;
|
|
23
|
-
// Utils
|
|
24
|
-
var core_1 = require("@dvelop-sdk/core");
|
|
25
|
-
Object.defineProperty(exports, "BadInputError", { enumerable: true, get: function () { return core_1.BadInputError; } });
|
|
26
|
-
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return core_1.UnauthorizedError; } });
|
|
27
|
-
Object.defineProperty(exports, "ForbiddenError", { enumerable: true, get: function () { return core_1.ForbiddenError; } });
|
|
28
|
-
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return core_1.NotFoundError; } });
|
|
29
|
-
var http_1 = require("./utils/http");
|
|
30
|
-
Object.defineProperty(exports, "IdentityproviderError", { enumerable: true, get: function () { return http_1.IdentityproviderError; } });
|
|
31
|
-
exports.internals = __importStar(require("./internal"));
|
|
32
|
-
// Authentication
|
|
33
|
-
var get_auth_session_1 = require("./authentication/get-auth-session/get-auth-session");
|
|
34
|
-
Object.defineProperty(exports, "getAuthSession", { enumerable: true, get: function () { return get_auth_session_1.getAuthSession; } });
|
|
35
|
-
var get_impersonated_auth_session_id_1 = require("./authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id");
|
|
36
|
-
Object.defineProperty(exports, "getImpersonatedAuthSessionId", { enumerable: true, get: function () { return get_impersonated_auth_session_id_1.getImpersonatedAuthSessionId; } });
|
|
37
|
-
var request_app_session_1 = require("./authentication/request-app-session/request-app-session");
|
|
38
|
-
Object.defineProperty(exports, "requestAppSession", { enumerable: true, get: function () { return request_app_session_1.requestAppSession; } });
|
|
39
|
-
var get_login_redirection_uri_1 = require("./authentication/get-login-redirection-uri/get-login-redirection-uri");
|
|
40
|
-
Object.defineProperty(exports, "getLoginRedirectionUri", { enumerable: true, get: function () { return get_login_redirection_uri_1.getLoginRedirectionUri; } });
|
|
41
|
-
var validate_app_session_signature_1 = require("./authentication/validate-app-session-signature/validate-app-session-signature");
|
|
42
|
-
Object.defineProperty(exports, "validateAppSessionSignature", { enumerable: true, get: function () { return validate_app_session_signature_1.validateAppSessionSignature; } });
|
|
43
|
-
Object.defineProperty(exports, "InvalidAppSessionSignatureError", { enumerable: true, get: function () { return validate_app_session_signature_1.InvalidAppSessionSignatureError; } });
|
|
44
|
-
var validate_auth_session_id_1 = require("./authentication/validate-auth-session-id/validate-auth-session-id");
|
|
45
|
-
Object.defineProperty(exports, "validateAuthSessionId", { enumerable: true, get: function () { return validate_auth_session_id_1.validateAuthSessionId; } });
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
5
|
+
}) : (function(o, m, k, k2) {
|
|
6
|
+
if (k2 === undefined) k2 = k;
|
|
7
|
+
o[k2] = m[k];
|
|
8
|
+
}));
|
|
9
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
10
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
11
|
+
}) : function(o, v) {
|
|
12
|
+
o["default"] = v;
|
|
13
|
+
});
|
|
14
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
|
+
if (mod && mod.__esModule) return mod;
|
|
16
|
+
var result = {};
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
|
+
__setModuleDefault(result, mod);
|
|
19
|
+
return result;
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.validateAuthSessionId = exports.InvalidAppSessionSignatureError = exports.validateAppSessionSignature = exports.getLoginRedirectionUri = exports.requestAppSession = exports.getImpersonatedAuthSessionId = exports.getAuthSession = exports.internals = exports.IdentityproviderError = exports.NotFoundError = exports.ForbiddenError = exports.UnauthorizedError = exports.BadInputError = void 0;
|
|
23
|
+
// Utils
|
|
24
|
+
var core_1 = require("@dvelop-sdk/core");
|
|
25
|
+
Object.defineProperty(exports, "BadInputError", { enumerable: true, get: function () { return core_1.BadInputError; } });
|
|
26
|
+
Object.defineProperty(exports, "UnauthorizedError", { enumerable: true, get: function () { return core_1.UnauthorizedError; } });
|
|
27
|
+
Object.defineProperty(exports, "ForbiddenError", { enumerable: true, get: function () { return core_1.ForbiddenError; } });
|
|
28
|
+
Object.defineProperty(exports, "NotFoundError", { enumerable: true, get: function () { return core_1.NotFoundError; } });
|
|
29
|
+
var http_1 = require("./utils/http");
|
|
30
|
+
Object.defineProperty(exports, "IdentityproviderError", { enumerable: true, get: function () { return http_1.IdentityproviderError; } });
|
|
31
|
+
exports.internals = __importStar(require("./internal"));
|
|
32
|
+
// Authentication
|
|
33
|
+
var get_auth_session_1 = require("./authentication/get-auth-session/get-auth-session");
|
|
34
|
+
Object.defineProperty(exports, "getAuthSession", { enumerable: true, get: function () { return get_auth_session_1.getAuthSession; } });
|
|
35
|
+
var get_impersonated_auth_session_id_1 = require("./authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id");
|
|
36
|
+
Object.defineProperty(exports, "getImpersonatedAuthSessionId", { enumerable: true, get: function () { return get_impersonated_auth_session_id_1.getImpersonatedAuthSessionId; } });
|
|
37
|
+
var request_app_session_1 = require("./authentication/request-app-session/request-app-session");
|
|
38
|
+
Object.defineProperty(exports, "requestAppSession", { enumerable: true, get: function () { return request_app_session_1.requestAppSession; } });
|
|
39
|
+
var get_login_redirection_uri_1 = require("./authentication/get-login-redirection-uri/get-login-redirection-uri");
|
|
40
|
+
Object.defineProperty(exports, "getLoginRedirectionUri", { enumerable: true, get: function () { return get_login_redirection_uri_1.getLoginRedirectionUri; } });
|
|
41
|
+
var validate_app_session_signature_1 = require("./authentication/validate-app-session-signature/validate-app-session-signature");
|
|
42
|
+
Object.defineProperty(exports, "validateAppSessionSignature", { enumerable: true, get: function () { return validate_app_session_signature_1.validateAppSessionSignature; } });
|
|
43
|
+
Object.defineProperty(exports, "InvalidAppSessionSignatureError", { enumerable: true, get: function () { return validate_app_session_signature_1.InvalidAppSessionSignatureError; } });
|
|
44
|
+
var validate_auth_session_id_1 = require("./authentication/validate-auth-session-id/validate-auth-session-id");
|
|
45
|
+
Object.defineProperty(exports, "validateAuthSessionId", { enumerable: true, get: function () { return validate_auth_session_id_1.validateAuthSessionId; } });
|
|
46
46
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,QAAQ;AACR,yCAAkH;AAA1F,qGAAA,aAAa,OAAA;AAAE,yGAAA,iBAAiB,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,qGAAA,aAAa,OAAA;AACvF,qCAAqD;AAA5C,6GAAA,qBAAqB,OAAA;AAC9B,wDAAwC;AAExC,iBAAiB;AACjB,uFAAoF;AAA3E,kHAAA,cAAc,OAAA;AACvB,uIAAsK;AAAzH,gJAAA,4BAA4B,OAAA;AACzE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAiCA,QAAQ;AACR,yCAAkH;AAA1F,qGAAA,aAAa,OAAA;AAAE,yGAAA,iBAAiB,OAAA;AAAE,sGAAA,cAAc,OAAA;AAAE,qGAAA,aAAa,OAAA;AACvF,qCAAqD;AAA5C,6GAAA,qBAAqB,OAAA;AAC9B,wDAAwC;AAExC,iBAAiB;AACjB,uFAAoF;AAA3E,kHAAA,cAAc,OAAA;AACvB,uIAAsK;AAAzH,gJAAA,4BAA4B,OAAA;AACzE,gGAAsH;AAApF,wHAAA,iBAAiB,OAAA;AACnD,kHAA8G;AAArG,mIAAA,sBAAsB,OAAA;AAC/B,iIAA0K;AAArJ,6IAAA,2BAA2B,OAAA;AAAE,iJAAA,+BAA+B,OAAA;AACjF,+GAAuH;AAA9G,iIAAA,qBAAqB,OAAA"}
|
package/lib/internal.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { _defaultHttpRequestFunctionFactory, _defaultHttpRequestFunction } from "./utils/http";
|
|
2
|
-
export { _getAuthSessionFactory, _getAuthSessionDefaultTransformFunction } from "./authentication/get-auth-session/get-auth-session";
|
|
3
|
-
export { _getImpersonatedAuthSessionIdFactory, _getImpersonatedAuthSessionIdDefaultTransformFunction } from "./authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id";
|
|
4
|
-
export { _requestAppSessionFactory } from "./authentication/request-app-session/request-app-session";
|
|
5
|
-
export { _validateAuthSessionIdFactory, _validateAuthSessionIdDefaultTransformFunction } from "./authentication/validate-auth-session-id/validate-auth-session-id";
|
|
1
|
+
export { _defaultHttpRequestFunctionFactory, _defaultHttpRequestFunction } from "./utils/http";
|
|
2
|
+
export { _getAuthSessionFactory, _getAuthSessionDefaultTransformFunction } from "./authentication/get-auth-session/get-auth-session";
|
|
3
|
+
export { _getImpersonatedAuthSessionIdFactory, _getImpersonatedAuthSessionIdDefaultTransformFunction } from "./authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id";
|
|
4
|
+
export { _requestAppSessionFactory } from "./authentication/request-app-session/request-app-session";
|
|
5
|
+
export { _validateAuthSessionIdFactory, _validateAuthSessionIdDefaultTransformFunction } from "./authentication/validate-auth-session-id/validate-auth-session-id";
|
|
6
6
|
//# sourceMappingURL=internal.d.ts.map
|
package/lib/internal.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports._validateAuthSessionIdDefaultTransformFunction = exports._validateAuthSessionIdFactory = exports._requestAppSessionFactory = exports._getImpersonatedAuthSessionIdDefaultTransformFunction = exports._getImpersonatedAuthSessionIdFactory = exports._getAuthSessionDefaultTransformFunction = exports._getAuthSessionFactory = exports._defaultHttpRequestFunction = exports._defaultHttpRequestFunctionFactory = void 0;
|
|
4
|
-
var http_1 = require("./utils/http");
|
|
5
|
-
Object.defineProperty(exports, "_defaultHttpRequestFunctionFactory", { enumerable: true, get: function () { return http_1._defaultHttpRequestFunctionFactory; } });
|
|
6
|
-
Object.defineProperty(exports, "_defaultHttpRequestFunction", { enumerable: true, get: function () { return http_1._defaultHttpRequestFunction; } });
|
|
7
|
-
// Authentication
|
|
8
|
-
var get_auth_session_1 = require("./authentication/get-auth-session/get-auth-session");
|
|
9
|
-
Object.defineProperty(exports, "_getAuthSessionFactory", { enumerable: true, get: function () { return get_auth_session_1._getAuthSessionFactory; } });
|
|
10
|
-
Object.defineProperty(exports, "_getAuthSessionDefaultTransformFunction", { enumerable: true, get: function () { return get_auth_session_1._getAuthSessionDefaultTransformFunction; } });
|
|
11
|
-
var get_impersonated_auth_session_id_1 = require("./authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id");
|
|
12
|
-
Object.defineProperty(exports, "_getImpersonatedAuthSessionIdFactory", { enumerable: true, get: function () { return get_impersonated_auth_session_id_1._getImpersonatedAuthSessionIdFactory; } });
|
|
13
|
-
Object.defineProperty(exports, "_getImpersonatedAuthSessionIdDefaultTransformFunction", { enumerable: true, get: function () { return get_impersonated_auth_session_id_1._getImpersonatedAuthSessionIdDefaultTransformFunction; } });
|
|
14
|
-
var request_app_session_1 = require("./authentication/request-app-session/request-app-session");
|
|
15
|
-
Object.defineProperty(exports, "_requestAppSessionFactory", { enumerable: true, get: function () { return request_app_session_1._requestAppSessionFactory; } });
|
|
16
|
-
var validate_auth_session_id_1 = require("./authentication/validate-auth-session-id/validate-auth-session-id");
|
|
17
|
-
Object.defineProperty(exports, "_validateAuthSessionIdFactory", { enumerable: true, get: function () { return validate_auth_session_id_1._validateAuthSessionIdFactory; } });
|
|
18
|
-
Object.defineProperty(exports, "_validateAuthSessionIdDefaultTransformFunction", { enumerable: true, get: function () { return validate_auth_session_id_1._validateAuthSessionIdDefaultTransformFunction; } });
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports._validateAuthSessionIdDefaultTransformFunction = exports._validateAuthSessionIdFactory = exports._requestAppSessionFactory = exports._getImpersonatedAuthSessionIdDefaultTransformFunction = exports._getImpersonatedAuthSessionIdFactory = exports._getAuthSessionDefaultTransformFunction = exports._getAuthSessionFactory = exports._defaultHttpRequestFunction = exports._defaultHttpRequestFunctionFactory = void 0;
|
|
4
|
+
var http_1 = require("./utils/http");
|
|
5
|
+
Object.defineProperty(exports, "_defaultHttpRequestFunctionFactory", { enumerable: true, get: function () { return http_1._defaultHttpRequestFunctionFactory; } });
|
|
6
|
+
Object.defineProperty(exports, "_defaultHttpRequestFunction", { enumerable: true, get: function () { return http_1._defaultHttpRequestFunction; } });
|
|
7
|
+
// Authentication
|
|
8
|
+
var get_auth_session_1 = require("./authentication/get-auth-session/get-auth-session");
|
|
9
|
+
Object.defineProperty(exports, "_getAuthSessionFactory", { enumerable: true, get: function () { return get_auth_session_1._getAuthSessionFactory; } });
|
|
10
|
+
Object.defineProperty(exports, "_getAuthSessionDefaultTransformFunction", { enumerable: true, get: function () { return get_auth_session_1._getAuthSessionDefaultTransformFunction; } });
|
|
11
|
+
var get_impersonated_auth_session_id_1 = require("./authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id");
|
|
12
|
+
Object.defineProperty(exports, "_getImpersonatedAuthSessionIdFactory", { enumerable: true, get: function () { return get_impersonated_auth_session_id_1._getImpersonatedAuthSessionIdFactory; } });
|
|
13
|
+
Object.defineProperty(exports, "_getImpersonatedAuthSessionIdDefaultTransformFunction", { enumerable: true, get: function () { return get_impersonated_auth_session_id_1._getImpersonatedAuthSessionIdDefaultTransformFunction; } });
|
|
14
|
+
var request_app_session_1 = require("./authentication/request-app-session/request-app-session");
|
|
15
|
+
Object.defineProperty(exports, "_requestAppSessionFactory", { enumerable: true, get: function () { return request_app_session_1._requestAppSessionFactory; } });
|
|
16
|
+
var validate_auth_session_id_1 = require("./authentication/validate-auth-session-id/validate-auth-session-id");
|
|
17
|
+
Object.defineProperty(exports, "_validateAuthSessionIdFactory", { enumerable: true, get: function () { return validate_auth_session_id_1._validateAuthSessionIdFactory; } });
|
|
18
|
+
Object.defineProperty(exports, "_validateAuthSessionIdDefaultTransformFunction", { enumerable: true, get: function () { return validate_auth_session_id_1._validateAuthSessionIdDefaultTransformFunction; } });
|
|
19
19
|
//# sourceMappingURL=internal.js.map
|
package/lib/utils/http.d.ts
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { DvelopContext, DvelopHttpRequestConfig, DvelopHttpResponse, DvelopHttpClient, DvelopSdkError } from "@dvelop-sdk/core";
|
|
2
|
-
export { DvelopHttpRequestConfig as HttpConfig, DvelopHttpResponse as HttpResponse } from "@dvelop-sdk/core";
|
|
3
|
-
/**
|
|
4
|
-
* Generic Error for identityprovider-package.
|
|
5
|
-
* @category Error
|
|
6
|
-
*/
|
|
7
|
-
export declare class IdentityproviderError extends DvelopSdkError {
|
|
8
|
-
message: string;
|
|
9
|
-
originalError?: Error | undefined;
|
|
10
|
-
constructor(message: string, originalError?: Error | undefined);
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Factory used to create the default httpRequestFunction. Mostly used for HTTP-Error handling.
|
|
14
|
-
* @internal
|
|
15
|
-
* @category Http
|
|
16
|
-
*/
|
|
17
|
-
export declare function _defaultHttpRequestFunctionFactory(httpClient: DvelopHttpClient): (context: DvelopContext, config: DvelopHttpRequestConfig) => Promise<DvelopHttpResponse>;
|
|
18
|
-
/**
|
|
19
|
-
* Default httpRequestFunction used in dms-package.
|
|
20
|
-
* @internal
|
|
21
|
-
* @category Http
|
|
22
|
-
*/
|
|
23
|
-
export declare function _defaultHttpRequestFunction(context: DvelopContext, config: DvelopHttpRequestConfig): Promise<DvelopHttpResponse>;
|
|
1
|
+
import { DvelopContext, DvelopHttpRequestConfig, DvelopHttpResponse, DvelopHttpClient, DvelopSdkError } from "@dvelop-sdk/core";
|
|
2
|
+
export { DvelopHttpRequestConfig as HttpConfig, DvelopHttpResponse as HttpResponse } from "@dvelop-sdk/core";
|
|
3
|
+
/**
|
|
4
|
+
* Generic Error for identityprovider-package.
|
|
5
|
+
* @category Error
|
|
6
|
+
*/
|
|
7
|
+
export declare class IdentityproviderError extends DvelopSdkError {
|
|
8
|
+
message: string;
|
|
9
|
+
originalError?: Error | undefined;
|
|
10
|
+
constructor(message: string, originalError?: Error | undefined);
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Factory used to create the default httpRequestFunction. Mostly used for HTTP-Error handling.
|
|
14
|
+
* @internal
|
|
15
|
+
* @category Http
|
|
16
|
+
*/
|
|
17
|
+
export declare function _defaultHttpRequestFunctionFactory(httpClient: DvelopHttpClient): (context: DvelopContext, config: DvelopHttpRequestConfig) => Promise<DvelopHttpResponse>;
|
|
18
|
+
/**
|
|
19
|
+
* Default httpRequestFunction used in dms-package.
|
|
20
|
+
* @internal
|
|
21
|
+
* @category Http
|
|
22
|
+
*/
|
|
23
|
+
export declare function _defaultHttpRequestFunction(context: DvelopContext, config: DvelopHttpRequestConfig): Promise<DvelopHttpResponse>;
|
|
24
24
|
//# sourceMappingURL=http.d.ts.map
|
package/lib/utils/http.js
CHANGED
|
@@ -1,130 +1,130 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (_) try {
|
|
33
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
-
exports._defaultHttpRequestFunction = exports._defaultHttpRequestFunctionFactory = exports.IdentityproviderError = void 0;
|
|
55
|
-
var core_1 = require("@dvelop-sdk/core");
|
|
56
|
-
/**
|
|
57
|
-
* Generic Error for identityprovider-package.
|
|
58
|
-
* @category Error
|
|
59
|
-
*/
|
|
60
|
-
/* istanbul ignore next */
|
|
61
|
-
var IdentityproviderError = /** @class */ (function (_super) {
|
|
62
|
-
__extends(IdentityproviderError, _super);
|
|
63
|
-
// eslint-disable-next-line no-unused-vars
|
|
64
|
-
function IdentityproviderError(message, originalError) {
|
|
65
|
-
var _this = _super.call(this, message) || this;
|
|
66
|
-
_this.message = message;
|
|
67
|
-
_this.originalError = originalError;
|
|
68
|
-
Object.setPrototypeOf(_this, IdentityproviderError.prototype);
|
|
69
|
-
return _this;
|
|
70
|
-
}
|
|
71
|
-
return IdentityproviderError;
|
|
72
|
-
}(core_1.DvelopSdkError));
|
|
73
|
-
exports.IdentityproviderError = IdentityproviderError;
|
|
74
|
-
/**
|
|
75
|
-
* Factory used to create the default httpRequestFunction. Mostly used for HTTP-Error handling.
|
|
76
|
-
* @internal
|
|
77
|
-
* @category Http
|
|
78
|
-
*/
|
|
79
|
-
function _defaultHttpRequestFunctionFactory(httpClient) {
|
|
80
|
-
var _this = this;
|
|
81
|
-
return function (context, config) { return __awaiter(_this, void 0, void 0, function () {
|
|
82
|
-
var error_1;
|
|
83
|
-
var _a, _b, _c, _d, _e, _f;
|
|
84
|
-
return __generator(this, function (_g) {
|
|
85
|
-
switch (_g.label) {
|
|
86
|
-
case 0:
|
|
87
|
-
_g.trys.push([0, 2, , 3]);
|
|
88
|
-
return [4 /*yield*/, httpClient.request(context, config)];
|
|
89
|
-
case 1: return [2 /*return*/, _g.sent()];
|
|
90
|
-
case 2:
|
|
91
|
-
error_1 = _g.sent();
|
|
92
|
-
if (error_1.response) {
|
|
93
|
-
switch (error_1.response.status) {
|
|
94
|
-
case 400:
|
|
95
|
-
throw new core_1.BadInputError(((_a = error_1.response.data) === null || _a === void 0 ? void 0 : _a.reason) || "Identityprovider-App responded with Status 400 indicating bad Request-Parameters. See 'originalError'-property for details.", error_1);
|
|
96
|
-
case 401:
|
|
97
|
-
throw new core_1.UnauthorizedError(((_b = error_1.response.data) === null || _b === void 0 ? void 0 : _b.reason) || error_1.response.data || "Identityprovider-App responded with Status 401 indicating bad authSessionId.", error_1);
|
|
98
|
-
case 403:
|
|
99
|
-
throw new core_1.ForbiddenError(((_c = error_1.response.data) === null || _c === void 0 ? void 0 : _c.reason) || "Identityprovider-App responded with Status 403 indicating a forbidden action. See 'originalError'-property for details.", error_1);
|
|
100
|
-
case 404:
|
|
101
|
-
throw new core_1.NotFoundError(((_d = error_1.response.data) === null || _d === void 0 ? void 0 : _d.reason) || ((_e = error_1.response.data) === null || _e === void 0 ? void 0 : _e.LocalizedMessage) || "Identityprovider-App responded with Status 404 indicating a requested resource does not exist. See 'originalError'-property for details.", error_1);
|
|
102
|
-
default:
|
|
103
|
-
throw new IdentityproviderError(((_f = error_1.response.data) === null || _f === void 0 ? void 0 : _f.reason) || "Identityprovider-App responded with status " + error_1.response.status + ". See 'originalError'-property for details.", error_1);
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
throw new IdentityproviderError("Request to Identityprovider-App failed: " + error_1.message + ". See 'originalError'-property for details.", error_1);
|
|
108
|
-
}
|
|
109
|
-
return [3 /*break*/, 3];
|
|
110
|
-
case 3: return [2 /*return*/];
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
}); };
|
|
114
|
-
}
|
|
115
|
-
exports._defaultHttpRequestFunctionFactory = _defaultHttpRequestFunctionFactory;
|
|
116
|
-
/**
|
|
117
|
-
* Default httpRequestFunction used in dms-package.
|
|
118
|
-
* @internal
|
|
119
|
-
* @category Http
|
|
120
|
-
*/
|
|
121
|
-
/* istanbul ignore next */
|
|
122
|
-
function _defaultHttpRequestFunction(context, config) {
|
|
123
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
124
|
-
return __generator(this, function (_a) {
|
|
125
|
-
return [2 /*return*/, _defaultHttpRequestFunctionFactory(core_1.defaultDvelopHttpClientFactory())(context, config)];
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
exports._defaultHttpRequestFunction = _defaultHttpRequestFunction;
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (_) try {
|
|
33
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
|
+
exports._defaultHttpRequestFunction = exports._defaultHttpRequestFunctionFactory = exports.IdentityproviderError = void 0;
|
|
55
|
+
var core_1 = require("@dvelop-sdk/core");
|
|
56
|
+
/**
|
|
57
|
+
* Generic Error for identityprovider-package.
|
|
58
|
+
* @category Error
|
|
59
|
+
*/
|
|
60
|
+
/* istanbul ignore next */
|
|
61
|
+
var IdentityproviderError = /** @class */ (function (_super) {
|
|
62
|
+
__extends(IdentityproviderError, _super);
|
|
63
|
+
// eslint-disable-next-line no-unused-vars
|
|
64
|
+
function IdentityproviderError(message, originalError) {
|
|
65
|
+
var _this = _super.call(this, message) || this;
|
|
66
|
+
_this.message = message;
|
|
67
|
+
_this.originalError = originalError;
|
|
68
|
+
Object.setPrototypeOf(_this, IdentityproviderError.prototype);
|
|
69
|
+
return _this;
|
|
70
|
+
}
|
|
71
|
+
return IdentityproviderError;
|
|
72
|
+
}(core_1.DvelopSdkError));
|
|
73
|
+
exports.IdentityproviderError = IdentityproviderError;
|
|
74
|
+
/**
|
|
75
|
+
* Factory used to create the default httpRequestFunction. Mostly used for HTTP-Error handling.
|
|
76
|
+
* @internal
|
|
77
|
+
* @category Http
|
|
78
|
+
*/
|
|
79
|
+
function _defaultHttpRequestFunctionFactory(httpClient) {
|
|
80
|
+
var _this = this;
|
|
81
|
+
return function (context, config) { return __awaiter(_this, void 0, void 0, function () {
|
|
82
|
+
var error_1;
|
|
83
|
+
var _a, _b, _c, _d, _e, _f;
|
|
84
|
+
return __generator(this, function (_g) {
|
|
85
|
+
switch (_g.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
_g.trys.push([0, 2, , 3]);
|
|
88
|
+
return [4 /*yield*/, httpClient.request(context, config)];
|
|
89
|
+
case 1: return [2 /*return*/, _g.sent()];
|
|
90
|
+
case 2:
|
|
91
|
+
error_1 = _g.sent();
|
|
92
|
+
if (error_1.response) {
|
|
93
|
+
switch (error_1.response.status) {
|
|
94
|
+
case 400:
|
|
95
|
+
throw new core_1.BadInputError(((_a = error_1.response.data) === null || _a === void 0 ? void 0 : _a.reason) || "Identityprovider-App responded with Status 400 indicating bad Request-Parameters. See 'originalError'-property for details.", error_1);
|
|
96
|
+
case 401:
|
|
97
|
+
throw new core_1.UnauthorizedError(((_b = error_1.response.data) === null || _b === void 0 ? void 0 : _b.reason) || error_1.response.data || "Identityprovider-App responded with Status 401 indicating bad authSessionId.", error_1);
|
|
98
|
+
case 403:
|
|
99
|
+
throw new core_1.ForbiddenError(((_c = error_1.response.data) === null || _c === void 0 ? void 0 : _c.reason) || "Identityprovider-App responded with Status 403 indicating a forbidden action. See 'originalError'-property for details.", error_1);
|
|
100
|
+
case 404:
|
|
101
|
+
throw new core_1.NotFoundError(((_d = error_1.response.data) === null || _d === void 0 ? void 0 : _d.reason) || ((_e = error_1.response.data) === null || _e === void 0 ? void 0 : _e.LocalizedMessage) || "Identityprovider-App responded with Status 404 indicating a requested resource does not exist. See 'originalError'-property for details.", error_1);
|
|
102
|
+
default:
|
|
103
|
+
throw new IdentityproviderError(((_f = error_1.response.data) === null || _f === void 0 ? void 0 : _f.reason) || "Identityprovider-App responded with status " + error_1.response.status + ". See 'originalError'-property for details.", error_1);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
else {
|
|
107
|
+
throw new IdentityproviderError("Request to Identityprovider-App failed: " + error_1.message + ". See 'originalError'-property for details.", error_1);
|
|
108
|
+
}
|
|
109
|
+
return [3 /*break*/, 3];
|
|
110
|
+
case 3: return [2 /*return*/];
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
}); };
|
|
114
|
+
}
|
|
115
|
+
exports._defaultHttpRequestFunctionFactory = _defaultHttpRequestFunctionFactory;
|
|
116
|
+
/**
|
|
117
|
+
* Default httpRequestFunction used in dms-package.
|
|
118
|
+
* @internal
|
|
119
|
+
* @category Http
|
|
120
|
+
*/
|
|
121
|
+
/* istanbul ignore next */
|
|
122
|
+
function _defaultHttpRequestFunction(context, config) {
|
|
123
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
124
|
+
return __generator(this, function (_a) {
|
|
125
|
+
return [2 /*return*/, _defaultHttpRequestFunctionFactory(core_1.defaultDvelopHttpClientFactory())(context, config)];
|
|
126
|
+
});
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
exports._defaultHttpRequestFunction = _defaultHttpRequestFunction;
|
|
130
130
|
//# sourceMappingURL=http.js.map
|
package/package.json
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@dvelop-sdk/identityprovider",
|
|
3
|
-
"description": "This package contains functionality for the Identityprovider-App in the d.velop cloud.",
|
|
4
|
-
"version": "
|
|
5
|
-
"license": "Apache-2.0",
|
|
6
|
-
"main": "lib/index.js",
|
|
7
|
-
"types": "lib/index.d.ts",
|
|
8
|
-
"author": "Lennart <lennart.klose@d-velop.de>",
|
|
9
|
-
"files": [
|
|
10
|
-
"lib"
|
|
11
|
-
],
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "git+https://github.com/d-velop/dvelop-sdk-node.git"
|
|
15
|
-
},
|
|
16
|
-
"bugs": {
|
|
17
|
-
"url": "https://github.com/d-velop/dvelop-sdk-node/issues"
|
|
18
|
-
},
|
|
19
|
-
"publishConfig": {
|
|
20
|
-
"access": "public"
|
|
21
|
-
},
|
|
22
|
-
"scripts": {
|
|
23
|
-
"license": "license-checker --production --onlyAllow Apache-2.0;MIT;ISC;BSD-2-Clause;BSD-3-Clause"
|
|
24
|
-
},
|
|
25
|
-
"dependencies": {
|
|
26
|
-
"@dvelop-sdk/core": "^2.0.0"
|
|
27
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@dvelop-sdk/identityprovider",
|
|
3
|
+
"description": "This package contains functionality for the Identityprovider-App in the d.velop cloud.",
|
|
4
|
+
"version": "4.0.2",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"main": "lib/index.js",
|
|
7
|
+
"types": "lib/index.d.ts",
|
|
8
|
+
"author": "Lennart <lennart.klose@d-velop.de>",
|
|
9
|
+
"files": [
|
|
10
|
+
"lib"
|
|
11
|
+
],
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "git+https://github.com/d-velop/dvelop-sdk-node.git"
|
|
15
|
+
},
|
|
16
|
+
"bugs": {
|
|
17
|
+
"url": "https://github.com/d-velop/dvelop-sdk-node/issues"
|
|
18
|
+
},
|
|
19
|
+
"publishConfig": {
|
|
20
|
+
"access": "public"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"license": "license-checker --production --onlyAllow Apache-2.0;MIT;ISC;BSD-2-Clause;BSD-3-Clause"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"@dvelop-sdk/core": "^2.1.0-beta.0"
|
|
27
|
+
}
|
|
28
28
|
}
|