@dvelop-sdk/identityprovider 2.1.7 → 3.0.3

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 (51) hide show
  1. package/README.md +1 -1
  2. package/lib/authentication/get-auth-session/get-auth-session.d.ts +35 -14
  3. package/lib/authentication/get-auth-session/get-auth-session.d.ts.map +1 -1
  4. package/lib/authentication/get-auth-session/get-auth-session.js +52 -48
  5. package/lib/authentication/get-auth-session/get-auth-session.js.map +1 -1
  6. package/lib/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.d.ts +35 -10
  7. package/lib/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.d.ts.map +1 -1
  8. package/lib/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.js +53 -50
  9. package/lib/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.js.map +1 -1
  10. package/lib/authentication/get-login-redirection-uri/get-login-redirection-uri.d.ts +4 -6
  11. package/lib/authentication/get-login-redirection-uri/get-login-redirection-uri.d.ts.map +1 -1
  12. package/lib/authentication/get-login-redirection-uri/get-login-redirection-uri.js +4 -6
  13. package/lib/authentication/get-login-redirection-uri/get-login-redirection-uri.js.map +1 -1
  14. package/lib/authentication/request-app-session/request-app-session.d.ts +40 -10
  15. package/lib/authentication/request-app-session/request-app-session.d.ts.map +1 -1
  16. package/lib/authentication/request-app-session/request-app-session.js +46 -40
  17. package/lib/authentication/request-app-session/request-app-session.js.map +1 -1
  18. package/lib/authentication/validate-app-session-signature/validate-app-session-signature.d.ts +15 -15
  19. package/lib/authentication/validate-app-session-signature/validate-app-session-signature.d.ts.map +1 -1
  20. package/lib/authentication/validate-app-session-signature/validate-app-session-signature.js +41 -20
  21. package/lib/authentication/validate-app-session-signature/validate-app-session-signature.js.map +1 -1
  22. package/lib/authentication/validate-auth-session-id/validate-auth-session-id.d.ts +54 -11
  23. package/lib/authentication/validate-auth-session-id/validate-auth-session-id.d.ts.map +1 -1
  24. package/lib/authentication/validate-auth-session-id/validate-auth-session-id.js +47 -48
  25. package/lib/authentication/validate-auth-session-id/validate-auth-session-id.js.map +1 -1
  26. package/lib/index.d.ts +32 -7
  27. package/lib/index.d.ts.map +1 -1
  28. package/lib/index.js +38 -19
  29. package/lib/index.js.map +1 -1
  30. package/lib/internal.d.ts +6 -0
  31. package/lib/internal.d.ts.map +1 -0
  32. package/lib/internal.js +19 -0
  33. package/lib/internal.js.map +1 -0
  34. package/lib/utils/http.d.ts +24 -0
  35. package/lib/utils/http.d.ts.map +1 -0
  36. package/lib/utils/http.js +130 -0
  37. package/lib/utils/http.js.map +1 -0
  38. package/package.json +3 -5
  39. package/LICENSE +0 -201
  40. package/lib/authentication/get-auth-session/auth-session.d.ts +0 -15
  41. package/lib/authentication/get-auth-session/auth-session.d.ts.map +0 -1
  42. package/lib/authentication/get-auth-session/auth-session.js +0 -3
  43. package/lib/authentication/get-auth-session/auth-session.js.map +0 -1
  44. package/lib/authentication/validate-auth-session-id/scim-user.d.ts +0 -32
  45. package/lib/authentication/validate-auth-session-id/scim-user.d.ts.map +0 -1
  46. package/lib/authentication/validate-auth-session-id/scim-user.js +0 -3
  47. package/lib/authentication/validate-auth-session-id/scim-user.js.map +0 -1
  48. package/lib/errors.d.ts +0 -33
  49. package/lib/errors.d.ts.map +0 -1
  50. package/lib/errors.js +0 -82
  51. package/lib/errors.js.map +0 -1
package/README.md CHANGED
@@ -15,7 +15,7 @@
15
15
 
16
16
  </br>
17
17
 
18
- <p>This package contains functionality for the <a href="https://developer.d-velop.de/documentation/idpapi/en/identityprovider-app-201523580.html">Identityprovider-App</a> in the d.velop cloud.</p>
18
+ <p>This package contains functionality for the <a href="https://developer.d-velop.de/documentation/idpapi/en">Identityprovider-App</a> in the d.velop cloud.</p>
19
19
 
20
20
  <a href="https://d-velop.github.io/dvelop-sdk-node/modules/identityprovider.html"><strong>Explore the docs »</strong></a>
21
21
 
@@ -1,24 +1,45 @@
1
- import { AuthSession } from "../../index";
2
- export interface AuthSessionDto {
3
- AuthSessionId: string;
4
- Expire: string;
1
+ import { DvelopContext } from "../../../../core/lib";
2
+ import { HttpConfig, HttpResponse } from "../../utils/http";
3
+ /**
4
+ * Used for authentication in the d.velop cloud. Refer to the [documentation](https://developer.d-velop.de/documentation/idpapi/en/identityprovider-app-201523580.html#validating-the-login) for further information.
5
+ * @category Authentication
6
+ */
7
+ export interface AuthSession {
8
+ /** This key will validate your requests (usually sent as Bearer-Token). **The AuthSessionId should be kept secret and never be publicly available** */
9
+ id: string;
10
+ /** Date at which the AuthSessionId will no longer be valid. */
11
+ expire: Date;
5
12
  }
6
13
  /**
7
- * Returns an [AuthSession]{@link AuthSession} based on an API-Key. API-Keys can be generated by d.velop cloud tenant administrators.
14
+ * Default transform-function provided to the {@link getAuthSession}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
15
+ * @internal
16
+ * @category Authentication
17
+ */
18
+ export declare function _getAuthSessionDefaultTransformFunction(response: HttpResponse, _: DvelopContext): AuthSession;
19
+ /**
20
+ * Factory for the {@link getAuthSession}-function. See internals for more information. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
21
+ * @typeparam T Return type of the {@link getAuthSession}-function. A corresponding transformFuntion has to be supplied.
22
+ * @internal
23
+ * @category Authentication
24
+ */
25
+ export declare function _getAuthSessionFactory<T>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext) => T): (context: DvelopContext) => Promise<T>;
26
+ /**
27
+ * Returns an {@link AuthSession} based on an API-Key. API-Keys can be generated by d.velop cloud tenant administrators.
8
28
  * **The AuthSessionId should be kept secret and never be publicly available.**
9
29
  *
10
- * @param {string} systemBaseUri SystemBaseUri for the tenant
11
- * @param {string} apiKey API-Key provided by the d.velop cloud
12
- * @throws {@link UnauthorizedError} indicates an invalid authSessionId or no authSessionId was sent.
13
30
  *
14
- * @category Authentication
31
+ * ```typescript
32
+ * import { getAuthSession } from "@dvelop-sdk/identityprovider";
33
+ *
34
+ * const authSession = await getAuthSession({
35
+ * systemBaseUri: "https://monster-ag.d-velop.cloud",
36
+ * authSessionId: "dQw4w9WgXcQ"
37
+ * });
15
38
  *
16
- * @example ```typescript
17
- * const authSession: AuthSession = await getAuthSession("https://monster-ag.d-velop.cloud", "<API_KEY>");
18
- * console.log(authSession.id); //a valid authSessionId
19
- * console.log('still valid:', authSession.expire.getTime() > new Date().getTime()); //still valid: true
39
+ console.log(authSession);
20
40
  * ```
21
41
  *
42
+ * @category Authentication
22
43
  */
23
- export declare function getAuthSession(systemBaseUri: string, apiKey: string): Promise<AuthSession>;
44
+ export declare function getAuthSession(context: DvelopContext): Promise<AuthSession>;
24
45
  //# sourceMappingURL=get-auth-session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-auth-session.d.ts","sourceRoot":"","sources":["../../../src/authentication/get-auth-session/get-auth-session.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAqB,MAAM,aAAa,CAAC;AAE7D,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAsB,cAAc,CAAC,aAAa,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CA2BhG"}
1
+ {"version":3,"file":"get-auth-session.d.ts","sourceRoot":"","sources":["../../../src/authentication/get-auth-session/get-auth-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,uJAAuJ;IACvJ,EAAE,EAAE,MAAM,CAAC;IACX,+DAA+D;IAC/D,MAAM,EAAE,IAAI,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,uCAAuC,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,GAAG,WAAW,CAK7G;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,CAAC,EACtC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,KAAK,CAAC,GACvE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,CASxC;AAED;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAsB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,WAAW,CAAC,CAEjF"}
@@ -35,65 +35,69 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
38
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.getAuthSession = void 0;
43
- var axios_1 = __importDefault(require("axios"));
44
- var index_1 = require("../../index");
39
+ exports.getAuthSession = exports._getAuthSessionFactory = exports._getAuthSessionDefaultTransformFunction = void 0;
40
+ var http_1 = require("../../utils/http");
41
+ /**
42
+ * Default transform-function provided to the {@link getAuthSession}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
43
+ * @internal
44
+ * @category Authentication
45
+ */
46
+ function _getAuthSessionDefaultTransformFunction(response, _) {
47
+ return {
48
+ id: response.data.AuthSessionId,
49
+ expire: new Date(response.data.Expire)
50
+ };
51
+ }
52
+ exports._getAuthSessionDefaultTransformFunction = _getAuthSessionDefaultTransformFunction;
53
+ /**
54
+ * Factory for the {@link getAuthSession}-function. See internals for more information. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
55
+ * @typeparam T Return type of the {@link getAuthSession}-function. A corresponding transformFuntion has to be supplied.
56
+ * @internal
57
+ * @category Authentication
58
+ */
59
+ function _getAuthSessionFactory(httpRequestFunction, transformFunction) {
60
+ var _this = this;
61
+ return function (context) { return __awaiter(_this, void 0, void 0, function () {
62
+ var response;
63
+ return __generator(this, function (_a) {
64
+ switch (_a.label) {
65
+ case 0: return [4 /*yield*/, httpRequestFunction(context, {
66
+ method: "GET",
67
+ url: "/identityprovider",
68
+ follows: ["login"],
69
+ })];
70
+ case 1:
71
+ response = _a.sent();
72
+ return [2 /*return*/, transformFunction(response, context)];
73
+ }
74
+ });
75
+ }); };
76
+ }
77
+ exports._getAuthSessionFactory = _getAuthSessionFactory;
45
78
  /**
46
- * Returns an [AuthSession]{@link AuthSession} based on an API-Key. API-Keys can be generated by d.velop cloud tenant administrators.
79
+ * Returns an {@link AuthSession} based on an API-Key. API-Keys can be generated by d.velop cloud tenant administrators.
47
80
  * **The AuthSessionId should be kept secret and never be publicly available.**
48
81
  *
49
- * @param {string} systemBaseUri SystemBaseUri for the tenant
50
- * @param {string} apiKey API-Key provided by the d.velop cloud
51
- * @throws {@link UnauthorizedError} indicates an invalid authSessionId or no authSessionId was sent.
52
82
  *
53
- * @category Authentication
83
+ * ```typescript
84
+ * import { getAuthSession } from "@dvelop-sdk/identityprovider";
85
+ *
86
+ * const authSession = await getAuthSession({
87
+ * systemBaseUri: "https://monster-ag.d-velop.cloud",
88
+ * authSessionId: "dQw4w9WgXcQ"
89
+ * });
54
90
  *
55
- * @example ```typescript
56
- * const authSession: AuthSession = await getAuthSession("https://monster-ag.d-velop.cloud", "<API_KEY>");
57
- * console.log(authSession.id); //a valid authSessionId
58
- * console.log('still valid:', authSession.expire.getTime() > new Date().getTime()); //still valid: true
91
+ console.log(authSession);
59
92
  * ```
60
93
  *
94
+ * @category Authentication
61
95
  */
62
- function getAuthSession(systemBaseUri, apiKey) {
96
+ /* istanbul ignore next */
97
+ function getAuthSession(context) {
63
98
  return __awaiter(this, void 0, void 0, function () {
64
- var errorContext, response, e_1;
65
99
  return __generator(this, function (_a) {
66
- switch (_a.label) {
67
- case 0:
68
- errorContext = "Failed to get authSession";
69
- _a.label = 1;
70
- case 1:
71
- _a.trys.push([1, 3, , 4]);
72
- return [4 /*yield*/, axios_1.default.get("/identityprovider", {
73
- baseURL: systemBaseUri,
74
- headers: {
75
- "Authorization": "Bearer " + apiKey
76
- },
77
- follows: ["login"]
78
- })];
79
- case 2:
80
- response = _a.sent();
81
- return [2 /*return*/, {
82
- id: response.data.AuthSessionId,
83
- expire: new Date(response.data.Expire)
84
- }];
85
- case 3:
86
- e_1 = _a.sent();
87
- if (e_1.response) {
88
- switch (e_1.response.status) {
89
- case 401:
90
- throw new index_1.UnauthorizedError(errorContext, e_1.response);
91
- }
92
- }
93
- e_1.message = errorContext + ": " + e_1.message;
94
- throw e_1;
95
- case 4: return [2 /*return*/];
96
- }
100
+ return [2 /*return*/, _getAuthSessionFactory(http_1._defaultHttpRequestFunction, _getAuthSessionDefaultTransformFunction)(context)];
97
101
  });
98
102
  });
99
103
  }
@@ -1 +1 @@
1
- {"version":3,"file":"get-auth-session.js","sourceRoot":"","sources":["../../../src/authentication/get-auth-session/get-auth-session.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA6C;AAC7C,qCAA6D;AAO7D;;;;;;;;;;;;;;;;GAgBG;AACH,SAAsB,cAAc,CAAC,aAAqB,EAAE,MAAc;;;;;;oBAElE,YAAY,GAAW,2BAA2B,CAAC;;;;oBAGP,qBAAM,eAAK,CAAC,GAAG,CAAiB,mBAAmB,EAAE;4BACnG,OAAO,EAAE,aAAa;4BACtB,OAAO,EAAE;gCACP,eAAe,EAAE,YAAU,MAAQ;6BACpC;4BACD,OAAO,EAAE,CAAC,OAAO,CAAC;yBACnB,CAAC,EAAA;;oBANI,QAAQ,GAAkC,SAM9C;oBAEF,sBAAO;4BACL,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,aAAa;4BAC/B,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;yBACvC,EAAC;;;oBAEF,IAAI,GAAC,CAAC,QAAQ,EAAE;wBACd,QAAQ,GAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;4BAC3B,KAAK,GAAG;gCACN,MAAM,IAAI,yBAAiB,CAAC,YAAY,EAAE,GAAC,CAAC,QAAQ,CAAC,CAAC;yBACvD;qBACF;oBACD,GAAC,CAAC,OAAO,GAAM,YAAY,UAAK,GAAC,CAAC,OAAS,CAAC;oBAC5C,MAAM,GAAC,CAAC;;;;;CAEX;AA3BD,wCA2BC"}
1
+ {"version":3,"file":"get-auth-session.js","sourceRoot":"","sources":["../../../src/authentication/get-auth-session/get-auth-session.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAazF;;;;GAIG;AACH,SAAgB,uCAAuC,CAAC,QAAsB,EAAE,CAAgB;IAC9F,OAAO;QACL,EAAE,EAAE,QAAQ,CAAC,IAAI,CAAC,aAAa;QAC/B,MAAM,EAAE,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC;KACvC,CAAC;AACJ,CAAC;AALD,0FAKC;AAED;;;;;GAKG;AACH,SAAgB,sBAAsB,CACpC,mBAA0F,EAC1F,iBAAwE;IAF1E,iBAYC;IARC,OAAO,UAAO,OAAsB;;;;wBACH,qBAAM,mBAAmB,CAAC,OAAO,EAAE;wBAChE,MAAM,EAAE,KAAK;wBACb,GAAG,EAAE,mBAAmB;wBACxB,OAAO,EAAE,CAAC,OAAO,CAAC;qBACnB,CAAC,EAAA;;oBAJI,QAAQ,GAAiB,SAI7B;oBACF,sBAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,CAAC,EAAC;;;SAC7C,CAAC;AACJ,CAAC;AAZD,wDAYC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,0BAA0B;AAC1B,SAAsB,cAAc,CAAC,OAAsB;;;YACzD,sBAAO,sBAAsB,CAAC,kCAA2B,EAAE,uCAAuC,CAAC,CAAC,OAAO,CAAC,EAAC;;;CAC9G;AAFD,wCAEC"}
@@ -1,17 +1,42 @@
1
+ import { DvelopContext } from "@dvelop-sdk/core";
2
+ import { HttpConfig, HttpResponse } from "../../utils/http";
1
3
  /**
2
- * Provides a valid authSessionId for a user without login.
4
+ * Parameters for the {@link getImpersonatedAuthSessionId}-function.
5
+ * @category Authentication
6
+ */
7
+ export interface GetImpersonatedAuthSessionIdParams {
8
+ userId: string;
9
+ }
10
+ /**
11
+ * Default transform-function provided to the {@link getImpersontedAuthSessionId}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
12
+ * @internal
13
+ * @category Authentication
14
+ */
15
+ export declare function _getImpersonatedAuthSessionIdDefaultTransformFunction(response: HttpResponse, _: DvelopContext, __: GetImpersonatedAuthSessionIdParams): string;
16
+ /**
17
+ * Factory for the {@link getImpersonatedAuthSessionId}}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
18
+ * @typeparam T Return type of the {@link getImpersonatedAuthSessionId}-function. A corresponding transformFuntion has to be supplied.
19
+ * @internal
20
+ * @category Authentication
21
+ */
22
+ export declare function _getImpersonatedAuthSessionIdFactory<T>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: GetImpersonatedAuthSessionIdParams) => T): (context: DvelopContext, params: GetImpersonatedAuthSessionIdParams) => Promise<T>;
23
+ /**
24
+ * Returns an authSessionId for the given user. All requests with this authSessionId will be in that users name.
25
+ * **The AuthSessionId should be kept secret and never be publicly available.**
3
26
  *
4
- * @param {string} systemBaseUri SystemBaseUri for the tenant
5
- * @param {string} appSession A valid appSession
6
- * @param {string} userId User that should be impersonated
27
+ * ```typescript
28
+ * import { getImpersonatedAuthSessionId } from "@dvelop-sdk/identityprovider";
7
29
  *
8
- * @category Authentication
30
+ * const authSessionId = await getImpersonatedAuthSessionId({
31
+ * systemBaseUri: "https://monster-ag.d-velop.cloud",
32
+ * authSessionId: "dQw4w9WgXcQ" // has to be an AppSession
33
+ * }, {
34
+ * userId: "XiFkyR35v2Y"
35
+ * });
9
36
  *
10
- * @example ```typescript
11
- * const authSessionIdForSulley = await getImpersonedAuthSessionId("https://monster-ag.d-velop.cloud", "<APP_SESSION>", "<SULLEYS_USER_ID>");
12
- * const sulley: ScimUser = await validateAuthSessionId("https://monster-ag.d-velop.cloud", authSessionIdForSulley);
13
- * console.log(sulley.displayName) // James P. Sullivan
37
+ * console.log(authSessionId);
14
38
  * ```
39
+ * @category Authentication
15
40
  */
16
- export declare function getImpersonatedAuthSessionId(systemBaseUri: string, appSession: string, userId: string): Promise<string>;
41
+ export declare function getImpersonatedAuthSessionId(context: DvelopContext, params: GetImpersonatedAuthSessionIdParams): Promise<string>;
17
42
  //# sourceMappingURL=get-impersonated-auth-session-id.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-impersonated-auth-session-id.d.ts","sourceRoot":"","sources":["../../../src/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.ts"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,4BAA4B,CAAC,aAAa,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CA8B7H"}
1
+ {"version":3,"file":"get-impersonated-auth-session-id.d.ts","sourceRoot":"","sources":["../../../src/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,kCAAkC;IACjD,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,wBAAgB,qDAAqD,CAAC,QAAQ,EAAE,YAAY,EAAE,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,kCAAkC,GAAG,MAAM,CAE9J;AAED;;;;;GAKG;AACH,wBAAgB,oCAAoC,CAAC,CAAC,EACpD,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kCAAkC,KAAK,CAAC,GACnH,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kCAAkC,KAAK,OAAO,CAAC,CAAC,CAAC,CAWpF;AAED;;;;;;;;;;;;;;;;;GAiBG;AAEH,wBAAsB,4BAA4B,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,kCAAkC,GAAG,OAAO,CAAC,MAAM,CAAC,CAEtI"}
@@ -35,66 +35,69 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
38
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.getImpersonatedAuthSessionId = void 0;
43
- var axios_1 = __importDefault(require("axios"));
44
- var index_1 = require("../../index");
39
+ exports.getImpersonatedAuthSessionId = exports._getImpersonatedAuthSessionIdFactory = exports._getImpersonatedAuthSessionIdDefaultTransformFunction = void 0;
40
+ var http_1 = require("../../utils/http");
45
41
  /**
46
- * Provides a valid authSessionId for a user without login.
47
- *
48
- * @param {string} systemBaseUri SystemBaseUri for the tenant
49
- * @param {string} appSession A valid appSession
50
- * @param {string} userId User that should be impersonated
51
- *
42
+ * Default transform-function provided to the {@link getImpersontedAuthSessionId}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
43
+ * @internal
52
44
  * @category Authentication
53
- *
54
- * @example ```typescript
55
- * const authSessionIdForSulley = await getImpersonedAuthSessionId("https://monster-ag.d-velop.cloud", "<APP_SESSION>", "<SULLEYS_USER_ID>");
56
- * const sulley: ScimUser = await validateAuthSessionId("https://monster-ag.d-velop.cloud", authSessionIdForSulley);
57
- * console.log(sulley.displayName) // James P. Sullivan
58
- * ```
59
45
  */
60
- function getImpersonatedAuthSessionId(systemBaseUri, appSession, userId) {
61
- return __awaiter(this, void 0, void 0, function () {
62
- var errorContext, response, e_1;
46
+ function _getImpersonatedAuthSessionIdDefaultTransformFunction(response, _, __) {
47
+ return response.data.authSessionId;
48
+ }
49
+ exports._getImpersonatedAuthSessionIdDefaultTransformFunction = _getImpersonatedAuthSessionIdDefaultTransformFunction;
50
+ /**
51
+ * Factory for the {@link getImpersonatedAuthSessionId}}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
52
+ * @typeparam T Return type of the {@link getImpersonatedAuthSessionId}-function. A corresponding transformFuntion has to be supplied.
53
+ * @internal
54
+ * @category Authentication
55
+ */
56
+ function _getImpersonatedAuthSessionIdFactory(httpRequestFunction, transformFunction) {
57
+ var _this = this;
58
+ return function (context, params) { return __awaiter(_this, void 0, void 0, function () {
59
+ var response;
63
60
  return __generator(this, function (_a) {
64
61
  switch (_a.label) {
65
- case 0:
66
- errorContext = "Failed to impersonate user";
67
- _a.label = 1;
62
+ case 0: return [4 /*yield*/, httpRequestFunction(context, {
63
+ method: "GET",
64
+ url: "/identityprovider/impersonatesession",
65
+ params: {
66
+ userId: params.userId
67
+ }
68
+ })];
68
69
  case 1:
69
- _a.trys.push([1, 3, , 4]);
70
- return [4 /*yield*/, axios_1.default.get("/identityprovider/impersonatesession", {
71
- baseURL: systemBaseUri,
72
- headers: {
73
- "Content-Type": "application/json",
74
- "Accept": "application/hal+json",
75
- "Authorization": "Bearer " + appSession
76
- },
77
- params: {
78
- userId: userId
79
- }
80
- })];
81
- case 2:
82
70
  response = _a.sent();
83
- return [2 /*return*/, response.data.authSessionId];
84
- case 3:
85
- e_1 = _a.sent();
86
- if (e_1.response) {
87
- switch (e_1.response.status) {
88
- case 401:
89
- throw new index_1.UnauthorizedError(errorContext, e_1.response);
90
- //TODO: 404 if user does not exist?
91
- }
92
- }
93
- e_1.message = errorContext + ": " + e_1.message;
94
- throw e_1;
95
- case 4: return [2 /*return*/];
71
+ return [2 /*return*/, transformFunction(response, context, params)];
96
72
  }
97
73
  });
74
+ }); };
75
+ }
76
+ exports._getImpersonatedAuthSessionIdFactory = _getImpersonatedAuthSessionIdFactory;
77
+ /**
78
+ * Returns an authSessionId for the given user. All requests with this authSessionId will be in that users name.
79
+ * **The AuthSessionId should be kept secret and never be publicly available.**
80
+ *
81
+ * ```typescript
82
+ * import { getImpersonatedAuthSessionId } from "@dvelop-sdk/identityprovider";
83
+ *
84
+ * const authSessionId = await getImpersonatedAuthSessionId({
85
+ * systemBaseUri: "https://monster-ag.d-velop.cloud",
86
+ * authSessionId: "dQw4w9WgXcQ" // has to be an AppSession
87
+ * }, {
88
+ * userId: "XiFkyR35v2Y"
89
+ * });
90
+ *
91
+ * console.log(authSessionId);
92
+ * ```
93
+ * @category Authentication
94
+ */
95
+ /* istanbul ignore next */
96
+ function getImpersonatedAuthSessionId(context, params) {
97
+ return __awaiter(this, void 0, void 0, function () {
98
+ return __generator(this, function (_a) {
99
+ return [2 /*return*/, _getImpersonatedAuthSessionIdFactory(http_1._defaultHttpRequestFunction, _getImpersonatedAuthSessionIdDefaultTransformFunction)(context, params)];
100
+ });
98
101
  });
99
102
  }
100
103
  exports.getImpersonatedAuthSessionId = getImpersonatedAuthSessionId;
@@ -1 +1 @@
1
- {"version":3,"file":"get-impersonated-auth-session-id.js","sourceRoot":"","sources":["../../../src/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,qCAAgD;AAMhD;;;;;;;;;;;;;;GAcG;AACH,SAAsB,4BAA4B,CAAC,aAAqB,EAAE,UAAkB,EAAE,MAAc;;;;;;oBAEpG,YAAY,GAAW,4BAA4B,CAAC;;;;oBAGvC,qBAAM,eAAK,CAAC,GAAG,CAA6B,sCAAsC,EAAE;4BACnG,OAAO,EAAE,aAAa;4BACtB,OAAO,EAAE;gCACP,cAAc,EAAE,kBAAkB;gCAClC,QAAQ,EAAE,sBAAsB;gCAChC,eAAe,EAAE,YAAU,UAAY;6BACxC;4BACD,MAAM,EAAE;gCACN,MAAM,EAAE,MAAM;6BACf;yBACF,CAAC,EAAA;;oBAVI,QAAQ,GAAG,SAUf;oBAEF,sBAAO,QAAQ,CAAC,IAAI,CAAC,aAAa,EAAC;;;oBAEnC,IAAI,GAAC,CAAC,QAAQ,EAAE;wBACd,QAAQ,GAAC,CAAC,QAAQ,CAAC,MAAM,EAAE;4BAC3B,KAAK,GAAG;gCACN,MAAM,IAAI,yBAAiB,CAAC,YAAY,EAAE,GAAC,CAAC,QAAQ,CAAC,CAAC;4BAEtD,mCAAmC;yBACpC;qBACF;oBACD,GAAC,CAAC,OAAO,GAAM,YAAY,UAAK,GAAC,CAAC,OAAS,CAAC;oBAC5C,MAAM,GAAC,CAAC;;;;;CAEX;AA9BD,oEA8BC"}
1
+ {"version":3,"file":"get-impersonated-auth-session-id.js","sourceRoot":"","sources":["../../../src/authentication/get-impersonated-auth-session-id/get-impersonated-auth-session-id.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAUzF;;;;GAIG;AACH,SAAgB,qDAAqD,CAAC,QAAsB,EAAE,CAAgB,EAAE,EAAsC;IACpJ,OAAO,QAAQ,CAAC,IAAI,CAAC,aAAa,CAAC;AACrC,CAAC;AAFD,sHAEC;AAED;;;;;GAKG;AACH,SAAgB,oCAAoC,CAClD,mBAA0F,EAC1F,iBAAoH;IAFtH,iBAcC;IAVC,OAAO,UAAO,OAAsB,EAAE,MAA0C;;;;wBAC/C,qBAAM,mBAAmB,CAAC,OAAO,EAAE;wBAChE,MAAM,EAAE,KAAK;wBACb,GAAG,EAAE,sCAAsC;wBAC3C,MAAM,EAAE;4BACN,MAAM,EAAE,MAAM,CAAC,MAAM;yBACtB;qBACF,CAAC,EAAA;;oBANI,QAAQ,GAAiB,SAM7B;oBACF,sBAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAC;;;SACrD,CAAC;AACJ,CAAC;AAdD,oFAcC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,0BAA0B;AAC1B,SAAsB,4BAA4B,CAAC,OAAsB,EAAE,MAA0C;;;YACnH,sBAAO,oCAAoC,CAAC,kCAA2B,EAAE,qDAAqD,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,EAAC;;;CAClJ;AAFD,oEAEC"}
@@ -1,14 +1,12 @@
1
1
  /**
2
2
  * Returns the URI a request should be redirected to in case it does not contain a valid authSessionId. Redirected requests will display a HTML Login for users to authenticate.
3
3
  *
4
- * @param {string} successUri The URI the request should be redirected to after a successful login
4
+ * ```typescript
5
+ * const redirectionUri = getLoginRedirectionUri("https://monster-ag.d-velop.cloud/cda-compliance/feature");
6
+ * redirect(redirectionUri); // respond with 302
7
+ * ```
5
8
  *
6
9
  * @category Authentication
7
- *
8
- * @example ```typescript
9
- * const redirectionUri = getLoginRedirectionUri("<ORIGINAL_URL>");
10
- * request.redirect(redirectionUri);
11
- * ```
12
10
  */
13
11
  export declare function getLoginRedirectionUri(successUri: string): string;
14
12
  //# sourceMappingURL=get-login-redirection-uri.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-login-redirection-uri.d.ts","sourceRoot":"","sources":["../../../src/authentication/get-login-redirection-uri/get-login-redirection-uri.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEjE"}
1
+ {"version":3,"file":"get-login-redirection-uri.d.ts","sourceRoot":"","sources":["../../../src/authentication/get-login-redirection-uri/get-login-redirection-uri.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEjE"}
@@ -4,14 +4,12 @@ exports.getLoginRedirectionUri = void 0;
4
4
  /**
5
5
  * Returns the URI a request should be redirected to in case it does not contain a valid authSessionId. Redirected requests will display a HTML Login for users to authenticate.
6
6
  *
7
- * @param {string} successUri The URI the request should be redirected to after a successful login
7
+ * ```typescript
8
+ * const redirectionUri = getLoginRedirectionUri("https://monster-ag.d-velop.cloud/cda-compliance/feature");
9
+ * redirect(redirectionUri); // respond with 302
10
+ * ```
8
11
  *
9
12
  * @category Authentication
10
- *
11
- * @example ```typescript
12
- * const redirectionUri = getLoginRedirectionUri("<ORIGINAL_URL>");
13
- * request.redirect(redirectionUri);
14
- * ```
15
13
  */
16
14
  function getLoginRedirectionUri(successUri) {
17
15
  return "/identityprovider/login?redirect=" + encodeURIComponent(successUri);
@@ -1 +1 @@
1
- {"version":3,"file":"get-login-redirection-uri.js","sourceRoot":"","sources":["../../../src/authentication/get-login-redirection-uri/get-login-redirection-uri.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;GAWG;AACH,SAAgB,sBAAsB,CAAC,UAAkB;IACvD,OAAO,sCAAoC,kBAAkB,CAAC,UAAU,CAAG,CAAC;AAC9E,CAAC;AAFD,wDAEC"}
1
+ {"version":3,"file":"get-login-redirection-uri.js","sourceRoot":"","sources":["../../../src/authentication/get-login-redirection-uri/get-login-redirection-uri.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;GASG;AACH,SAAgB,sBAAsB,CAAC,UAAkB;IACvD,OAAO,sCAAoC,kBAAkB,CAAC,UAAU,CAAG,CAAC;AAC9E,CAAC;AAFD,wDAEC"}
@@ -1,16 +1,46 @@
1
+ import { DvelopContext } from "../../../../core/lib";
2
+ import { HttpConfig, HttpResponse } from "../../utils/http";
1
3
  /**
2
- * Request an appSession to be posted to the specified callback. For further information on this process refer to the [documentation](https://developer.d-velop.de/documentation/idpapi/en/identityprovider-app-201523580.html#IdentityproviderApp-Inter-appcommunicationwithappsessions).
3
- *
4
- * @param {string} systemBaseUri SystemBaseUri for the tenant
5
- * @param {string} appName AppName of the requesting app
6
- * @param {string} callback CallbackUri with leading slash and appName
7
- * @param {string} requestId Unique requestId
8
- *
4
+ * Parameters for the {@link requestAppSession}-function.
5
+ * @category Authentication
6
+ */
7
+ export interface RequestAppSessionParams {
8
+ /** Name of the app requesting the appSession */
9
+ appName: string;
10
+ /** Relative URI to which the appSession will be sent via POST */
11
+ callback: string;
12
+ }
13
+ /**
14
+ * AppSession which will be postet to your app after using the {@link requestAppSession}-function.
15
+ * @category Authentication
16
+ */
17
+ export interface AppSession {
18
+ appSessionId: string;
19
+ expire: string;
20
+ sign: string;
21
+ }
22
+ /**
23
+ * Factory for the {@link requestAppSession}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
24
+ * @typeparam T Return type of the {@link requestAppSession}-function. A corresponding transformFuntion has to be supplied.
9
25
  * @category Authentication
26
+ */
27
+ export declare function _requestAppSessionFactory<T>(httpRequestFunction: (context: DvelopContext, config: HttpConfig) => Promise<HttpResponse>, transformFunction: (response: HttpResponse, context: DvelopContext, params: RequestAppSessionParams) => T): (context: DvelopContext, params: RequestAppSessionParams) => Promise<T>;
28
+ /**
29
+ * Request an appSession for your app. The appSession will be sent via POST to your defined callback.
30
+ * **Do not forget to validate the appSessionId via the {@link validateAppSessionSignature}-function**
31
+ *
32
+ * ```typescript
33
+ * import { requestAppSession } from "@dvelop-sdk/identityprovider";
10
34
  *
11
- * @example ```typescript
12
- * await requestAppSession("https://monster-ag.d-velop.cloud", "monster-hello", "/monster-hello/give/me/my/appsession", "UUID")
35
+ * await requestAppSession({
36
+ * systemBaseUri: "https://monster-ag.d-velop.cloud",
37
+ * authSessionId: "dQw4w9WgXcQ"
38
+ * }, {
39
+ * appName: "cda-compliance",
40
+ * callback: "/cda-compliance/appsession"
41
+ * });
13
42
  * ```
43
+ * @category Authentication
14
44
  */
15
- export declare function requestAppSession(systemBaseUri: string, appName: string, callback: string, requestId: string): Promise<void>;
45
+ export declare function requestAppSession(context: DvelopContext, params: RequestAppSessionParams): Promise<void>;
16
46
  //# sourceMappingURL=request-app-session.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"request-app-session.d.ts","sourceRoot":"","sources":["../../../src/authentication/request-app-session/request-app-session.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,wBAAsB,iBAAiB,CAAC,aAAa,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBlI"}
1
+ {"version":3,"file":"request-app-session.d.ts","sourceRoot":"","sources":["../../../src/authentication/request-app-session/request-app-session.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,UAAU,EAAE,YAAY,EAA+B,MAAM,kBAAkB,CAAC;AAEzF;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACtC,gDAAgD;IAChD,OAAO,EAAE,MAAM,CAAC;IAChB,iEAAiE;IACjE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,MAAM,WAAW,UAAU;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CAAC,CAAC,EACzC,mBAAmB,EAAE,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,UAAU,KAAK,OAAO,CAAC,YAAY,CAAC,EAC1F,iBAAiB,EAAE,CAAC,QAAQ,EAAE,YAAY,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,KAAK,CAAC,GACxG,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,KAAK,OAAO,CAAC,CAAC,CAAC,CAgBzE;AAED;;;;;;;;;;;;;;;;GAgBG;AAEH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAAC,IAAI,CAAC,CAE9G"}
@@ -35,55 +35,61 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
35
35
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
36
36
  }
37
37
  };
38
- var __importDefault = (this && this.__importDefault) || function (mod) {
39
- return (mod && mod.__esModule) ? mod : { "default": mod };
40
- };
41
38
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.requestAppSession = void 0;
43
- var axios_1 = __importDefault(require("axios"));
39
+ exports.requestAppSession = exports._requestAppSessionFactory = void 0;
40
+ var http_1 = require("../../utils/http");
44
41
  /**
45
- * Request an appSession to be posted to the specified callback. For further information on this process refer to the [documentation](https://developer.d-velop.de/documentation/idpapi/en/identityprovider-app-201523580.html#IdentityproviderApp-Inter-appcommunicationwithappsessions).
46
- *
47
- * @param {string} systemBaseUri SystemBaseUri for the tenant
48
- * @param {string} appName AppName of the requesting app
49
- * @param {string} callback CallbackUri with leading slash and appName
50
- * @param {string} requestId Unique requestId
51
- *
42
+ * Factory for the {@link requestAppSession}-function. See [Advanced Topics](https://github.com/d-velop/dvelop-sdk-node#advanced-topics) for more information.
43
+ * @typeparam T Return type of the {@link requestAppSession}-function. A corresponding transformFuntion has to be supplied.
52
44
  * @category Authentication
45
+ */
46
+ function _requestAppSessionFactory(httpRequestFunction, transformFunction) {
47
+ var _this = this;
48
+ return function (context, params) { return __awaiter(_this, void 0, void 0, function () {
49
+ var response;
50
+ return __generator(this, function (_a) {
51
+ switch (_a.label) {
52
+ case 0: return [4 /*yield*/, httpRequestFunction(context, {
53
+ method: "POST",
54
+ url: "/identityprovider/appsession",
55
+ data: {
56
+ appname: params.appName,
57
+ callback: params.callback,
58
+ requestid: context.requestId
59
+ }
60
+ })];
61
+ case 1:
62
+ response = _a.sent();
63
+ return [2 /*return*/, transformFunction(response, context, params)];
64
+ }
65
+ });
66
+ }); };
67
+ }
68
+ exports._requestAppSessionFactory = _requestAppSessionFactory;
69
+ /**
70
+ * Request an appSession for your app. The appSession will be sent via POST to your defined callback.
71
+ * **Do not forget to validate the appSessionId via the {@link validateAppSessionSignature}-function**
53
72
  *
54
- * @example ```typescript
55
- * await requestAppSession("https://monster-ag.d-velop.cloud", "monster-hello", "/monster-hello/give/me/my/appsession", "UUID")
73
+ * ```typescript
74
+ * import { requestAppSession } from "@dvelop-sdk/identityprovider";
75
+ *
76
+ * await requestAppSession({
77
+ * systemBaseUri: "https://monster-ag.d-velop.cloud",
78
+ * authSessionId: "dQw4w9WgXcQ"
79
+ * }, {
80
+ * appName: "cda-compliance",
81
+ * callback: "/cda-compliance/appsession"
82
+ * });
56
83
  * ```
84
+ * @category Authentication
57
85
  */
58
- function requestAppSession(systemBaseUri, appName, callback, requestId) {
86
+ /* istanbul ignore next */
87
+ function requestAppSession(context, params) {
59
88
  return __awaiter(this, void 0, void 0, function () {
60
- var errorContext, e_1;
61
89
  return __generator(this, function (_a) {
62
90
  switch (_a.label) {
63
- case 0:
64
- errorContext = "Failed to request appSession";
65
- _a.label = 1;
66
- case 1:
67
- _a.trys.push([1, 3, , 4]);
68
- return [4 /*yield*/, axios_1.default.post("/identityprovider/appsession", {
69
- appname: appName,
70
- callback: callback,
71
- requestid: requestId
72
- }, {
73
- baseURL: systemBaseUri,
74
- headers: {
75
- "Content-Type": "application/json",
76
- "Origin": systemBaseUri
77
- }
78
- })];
79
- case 2:
80
- _a.sent();
81
- return [3 /*break*/, 4];
82
- case 3:
83
- e_1 = _a.sent();
84
- e_1.message = errorContext + ": " + e_1.message;
85
- throw e_1;
86
- case 4: return [2 /*return*/];
91
+ case 0: return [4 /*yield*/, _requestAppSessionFactory(http_1._defaultHttpRequestFunction, function () { })(context, params)];
92
+ case 1: return [2 /*return*/, _a.sent()];
87
93
  }
88
94
  });
89
95
  });
@@ -1 +1 @@
1
- {"version":3,"file":"request-app-session.js","sourceRoot":"","sources":["../../../src/authentication/request-app-session/request-app-session.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAE1B;;;;;;;;;;;;;GAaG;AACH,SAAsB,iBAAiB,CAAC,aAAqB,EAAE,OAAe,EAAE,QAAgB,EAAE,SAAiB;;;;;;oBAE3G,YAAY,GAAW,8BAA8B,CAAC;;;;oBAG1D,qBAAM,eAAK,CAAC,IAAI,CAAC,8BAA8B,EAAE;4BAC/C,OAAO,EAAE,OAAO;4BAChB,QAAQ,EAAE,QAAQ;4BAClB,SAAS,EAAE,SAAS;yBACrB,EAAE;4BACD,OAAO,EAAE,aAAa;4BACtB,OAAO,EAAE;gCACP,cAAc,EAAE,kBAAkB;gCAClC,QAAQ,EAAE,aAAa;6BACxB;yBACF,CAAC,EAAA;;oBAVF,SAUE,CAAC;;;;oBAEH,GAAC,CAAC,OAAO,GAAM,YAAY,UAAK,GAAC,CAAC,OAAS,CAAC;oBAC5C,MAAM,GAAC,CAAC;;;;;CAEX;AApBD,8CAoBC"}
1
+ {"version":3,"file":"request-app-session.js","sourceRoot":"","sources":["../../../src/authentication/request-app-session/request-app-session.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,yCAAyF;AAuBzF;;;;GAIG;AACH,SAAgB,yBAAyB,CACvC,mBAA0F,EAC1F,iBAAyG;IAF3G,iBAmBC;IAdC,OAAO,UAAO,OAAsB,EAAE,MAA+B;;;;wBAElD,qBAAM,mBAAmB,CAAC,OAAO,EAAE;wBAClD,MAAM,EAAE,MAAM;wBACd,GAAG,EAAE,8BAA8B;wBACnC,IAAI,EAAE;4BACJ,OAAO,EAAE,MAAM,CAAC,OAAO;4BACvB,QAAQ,EAAE,MAAM,CAAC,QAAQ;4BACzB,SAAS,EAAE,OAAO,CAAC,SAAS;yBAC7B;qBACF,CAAC,EAAA;;oBARI,QAAQ,GAAG,SAQf;oBAEF,sBAAO,iBAAiB,CAAC,QAAQ,EAAE,OAAO,EAAE,MAAM,CAAC,EAAC;;;SACrD,CAAC;AACJ,CAAC;AAnBD,8DAmBC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,0BAA0B;AAC1B,SAAsB,iBAAiB,CAAC,OAAsB,EAAE,MAA+B;;;;wBACtF,qBAAM,yBAAyB,CAAC,kCAA2B,EAAE,cAAQ,CAAC,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,EAAA;wBAA/F,sBAAO,SAAwF,EAAC;;;;CACjG;AAFD,8CAEC"}