@api-client/core 0.5.20 → 0.5.23

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 (62) hide show
  1. package/build/browser.d.ts +7 -0
  2. package/build/browser.js +10 -0
  3. package/build/browser.js.map +1 -1
  4. package/build/index.d.ts +4 -0
  5. package/build/index.js +7 -0
  6. package/build/index.js.map +1 -1
  7. package/build/src/authorization/AuthorizationError.d.ts +23 -0
  8. package/build/src/authorization/AuthorizationError.js +33 -0
  9. package/build/src/authorization/AuthorizationError.js.map +1 -0
  10. package/build/src/authorization/CustomParameters.d.ts +24 -0
  11. package/build/src/authorization/CustomParameters.js +59 -0
  12. package/build/src/authorization/CustomParameters.js.map +1 -0
  13. package/build/src/authorization/OAuth2Authorization.d.ts +332 -0
  14. package/build/src/authorization/OAuth2Authorization.js +965 -0
  15. package/build/src/authorization/OAuth2Authorization.js.map +1 -0
  16. package/build/src/authorization/OidcAuthorization.d.ts +34 -0
  17. package/build/src/authorization/OidcAuthorization.js +139 -0
  18. package/build/src/authorization/OidcAuthorization.js.map +1 -0
  19. package/build/src/authorization/Utils.d.ts +51 -0
  20. package/build/src/authorization/Utils.js +122 -0
  21. package/build/src/authorization/Utils.js.map +1 -0
  22. package/build/src/authorization/lib/IframeAuthorization.d.ts +53 -0
  23. package/build/src/authorization/lib/IframeAuthorization.js +116 -0
  24. package/build/src/authorization/lib/IframeAuthorization.js.map +1 -0
  25. package/build/src/authorization/lib/KnownGrants.d.ts +6 -0
  26. package/build/src/authorization/lib/KnownGrants.js +7 -0
  27. package/build/src/authorization/lib/KnownGrants.js.map +1 -0
  28. package/build/src/authorization/lib/PopupAuthorization.d.ts +41 -0
  29. package/build/src/authorization/lib/PopupAuthorization.js +73 -0
  30. package/build/src/authorization/lib/PopupAuthorization.js.map +1 -0
  31. package/build/src/authorization/lib/Tokens.d.ts +55 -0
  32. package/build/src/authorization/lib/Tokens.js +117 -0
  33. package/build/src/authorization/lib/Tokens.js.map +1 -0
  34. package/build/src/authorization/types.d.ts +174 -0
  35. package/build/src/authorization/types.js +2 -0
  36. package/build/src/authorization/types.js.map +1 -0
  37. package/build/src/models/Authorization.d.ts +3 -5
  38. package/build/src/models/RequestAuthorization.js +4 -0
  39. package/build/src/models/RequestAuthorization.js.map +1 -1
  40. package/build/src/runtime/actions/runnable/DeleteCookieRunnable.d.ts +1 -1
  41. package/build/src/runtime/actions/runnable/SetCookieRunnable.d.ts +1 -1
  42. package/build/src/runtime/actions/runnable/SetVariableRunnable.d.ts +1 -1
  43. package/build/src/runtime/modules/RequestAuthorization.js +3 -7
  44. package/build/src/runtime/modules/RequestAuthorization.js.map +1 -1
  45. package/oauth-popup.html +29 -0
  46. package/package.json +3 -1
  47. package/src/authorization/AuthorizationError.ts +25 -0
  48. package/src/authorization/CustomParameters.ts +61 -0
  49. package/src/authorization/OAuth2Authorization.ts +1027 -0
  50. package/src/authorization/OidcAuthorization.ts +143 -0
  51. package/src/authorization/Utils.ts +126 -0
  52. package/src/authorization/lib/IframeAuthorization.ts +128 -0
  53. package/src/authorization/lib/KnownGrants.ts +6 -0
  54. package/src/authorization/lib/PopupAuthorization.ts +80 -0
  55. package/src/authorization/lib/Tokens.ts +124 -0
  56. package/src/authorization/types.ts +176 -0
  57. package/src/models/Authorization.ts +4 -5
  58. package/src/models/RequestAuthorization.ts +5 -1
  59. package/src/runtime/actions/runnable/DeleteCookieRunnable.ts +1 -1
  60. package/src/runtime/actions/runnable/SetCookieRunnable.ts +2 -2
  61. package/src/runtime/actions/runnable/SetVariableRunnable.ts +1 -1
  62. package/src/runtime/modules/RequestAuthorization.ts +3 -7
@@ -63,6 +63,13 @@ export { UriTemplate, IUriTemplateOptions } from './src/lib/parsers/UriTemplate.
63
63
  export * from './src/lib/parsers/UrlProcessor.js';
64
64
  export * as HttpDefinitions from './src/lib/definitions/HttpDefinitions.js';
65
65
  export * as Buffer from './src/lib/Buffer.js';
66
+ export { OAuth2Authorization } from './src/authorization/OAuth2Authorization.js';
67
+ export { OidcAuthorization } from './src/authorization/OidcAuthorization.js';
68
+ export { AuthorizationError, CodeError } from './src/authorization/AuthorizationError.js';
69
+ export * as AuthUtils from './src/authorization/Utils.js';
70
+ export * from './src/authorization/types.js';
71
+ export { Tokens as OidcTokens } from './src/authorization/lib/Tokens.js';
72
+ export * as KnownGrants from './src/authorization/lib/KnownGrants.js';
66
73
  export { VariablesProcessor } from './src/runtime/variables/VariablesProcessor.js';
67
74
  export * from './src/runtime/node/InteropInterfaces.js';
68
75
  export { PayloadPointer } from './src/data/PayloadPointer.js';
package/build/browser.js CHANGED
@@ -62,6 +62,16 @@ export { UriTemplate } from './src/lib/parsers/UriTemplate.js';
62
62
  export * from './src/lib/parsers/UrlProcessor.js';
63
63
  export * as HttpDefinitions from './src/lib/definitions/HttpDefinitions.js';
64
64
  export * as Buffer from './src/lib/Buffer.js';
65
+ //
66
+ // Authorization
67
+ //
68
+ export { OAuth2Authorization } from './src/authorization/OAuth2Authorization.js';
69
+ export { OidcAuthorization } from './src/authorization/OidcAuthorization.js';
70
+ export { AuthorizationError, CodeError } from './src/authorization/AuthorizationError.js';
71
+ export * as AuthUtils from './src/authorization/Utils.js';
72
+ export * from './src/authorization/types.js';
73
+ export { Tokens as OidcTokens } from './src/authorization/lib/Tokens.js';
74
+ export * as KnownGrants from './src/authorization/lib/KnownGrants.js';
65
75
  //
66
76
  // Runtime
67
77
  //
@@ -1 +1 @@
1
- {"version":3,"file":"browser.js","sourceRoot":"","sources":["../browser.ts"],"names":[],"mappings":"AAAA,wDAAwD;AAMxD,OAAO,EAAE,QAAQ,EAAa,IAAI,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAErF,OAAO,EAAE,iBAAiB,EAAsB,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,WAAW,EAA8L,IAAI,IAAI,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACrR,OAAO,EAAE,WAAW,EAAgB,IAAI,IAAI,eAAe,EAAE,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AAO,EAAE,QAAQ,EAAa,MAAM,2CAA2C,CAAC;AAChF,OAAO,EAAE,kBAAkB,EAAuB,IAAI,IAAI,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC9I,OAAO,EAAE,eAAe,EAAoB,IAAI,IAAI,mBAAmB,EAAE,MAAM,kDAAkD,CAAC;AAClI,OAAO,EAAE,iBAAiB,EAAsB,IAAI,IAAI,qBAAqB,EAAE,MAAM,oDAAoD,CAAC;AAE1I,GAAG;AACH,0BAA0B;AAC1B,GAAG;AACH,OAAO,EAAE,4BAA4B,EAAE,MAAM,2DAA2D,CAAC;AACzG,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC"}
package/build/index.d.ts CHANGED
@@ -64,6 +64,10 @@ export { UriTemplate, IUriTemplateOptions } from './src/lib/parsers/UriTemplate.
64
64
  export * from './src/lib/parsers/UrlProcessor.js';
65
65
  export * as HttpDefinitions from './src/lib/definitions/HttpDefinitions.js';
66
66
  export * as Buffer from './src/lib/Buffer.js';
67
+ export { AuthorizationError, CodeError } from './src/authorization/AuthorizationError.js';
68
+ export * from './src/authorization/types.js';
69
+ export { Tokens as OidcTokens } from './src/authorization/lib/Tokens.js';
70
+ export * as KnownGrants from './src/authorization/lib/KnownGrants.js';
67
71
  export { VariablesProcessor } from './src/runtime/variables/VariablesProcessor.js';
68
72
  export { ProjectRequestRunner } from './src/runtime/node/ProjectRequestRunner.js';
69
73
  export { RequestFactory } from './src/runtime/node/RequestFactory.js';
package/build/index.js CHANGED
@@ -63,6 +63,13 @@ export { UriTemplate } from './src/lib/parsers/UriTemplate.js';
63
63
  export * from './src/lib/parsers/UrlProcessor.js';
64
64
  export * as HttpDefinitions from './src/lib/definitions/HttpDefinitions.js';
65
65
  export * as Buffer from './src/lib/Buffer.js';
66
+ //
67
+ // Authorization
68
+ //
69
+ export { AuthorizationError, CodeError } from './src/authorization/AuthorizationError.js';
70
+ export * from './src/authorization/types.js';
71
+ export { Tokens as OidcTokens } from './src/authorization/lib/Tokens.js';
72
+ export * as KnownGrants from './src/authorization/lib/KnownGrants.js';
66
73
  //
67
74
  // Runtime
68
75
  //
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAM3D,OAAO,EAAE,QAAQ,EAAa,IAAI,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAErF,OAAO,EAAE,iBAAiB,EAAsB,MAAM,mCAAmC,CAAC;AAC1F,OAAO,EAAE,WAAW,EAA8L,IAAI,IAAI,eAAe,EAAE,MAAM,mCAAmC,CAAC;AACrR,OAAO,EAAE,WAAW,EAAgB,IAAI,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,aAAa,EAAkB,MAAM,+BAA+B,CAAC;AAC9E,OAAO,EAAa,QAAQ,EAAE,IAAI,IAAI,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,EAAe,UAAU,EAA0C,MAAM,4BAA4B,CAAC;AAC7G,OAAO,EAAgB,WAAW,EAAE,IAAI,IAAI,eAAe,EAAuB,MAAM,6BAA6B,CAAC;AACtH,OAAO,EAAE,WAAW,EAAgB,IAAI,IAAI,eAAe,EAA0O,MAAM,6BAA6B,CAAC;AACzU,OAAO,EAAgB,WAAW,EAAE,IAAI,IAAI,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACjG,OAAO,EAAE,YAAY,EAAiB,IAAI,IAAI,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AACrG,OAAO,EAAE,OAAO,EAAY,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAE,OAAO,EAAY,IAAI,IAAI,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAkB,aAAa,EAAE,IAAI,IAAI,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,+B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OAAO,EAAE,4BAA4B,EAAE,MAAM,2DAA2D,CAAC;AACzG,OAAO,EAAE,sBAAsB,EAAE,MAAM,qDAAqD,CAAC;AAC7F,OAAO,EAAE,mBAAmB,EAAE,MAAM,kDAAkD,CAAC"}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * An object describing an error during the authorization process.
3
+ */
4
+ export declare class AuthorizationError extends Error {
5
+ code: string;
6
+ state: string;
7
+ interactive: boolean;
8
+ /**
9
+ * @param message The human readable message.
10
+ * @param code The error code
11
+ * @param state Used state parameter
12
+ * @param interactive Whether the request was interactive.
13
+ */
14
+ constructor(message: string, code: string, state: string, interactive: boolean);
15
+ }
16
+ export declare class CodeError extends Error {
17
+ code: string;
18
+ /**
19
+ * @param message The human readable message.
20
+ * @param code The error code
21
+ */
22
+ constructor(message: string, code: string);
23
+ }
@@ -0,0 +1,33 @@
1
+ /* eslint-disable max-classes-per-file */
2
+ /**
3
+ * An object describing an error during the authorization process.
4
+ */
5
+ export class AuthorizationError extends Error {
6
+ code;
7
+ state;
8
+ interactive;
9
+ /**
10
+ * @param message The human readable message.
11
+ * @param code The error code
12
+ * @param state Used state parameter
13
+ * @param interactive Whether the request was interactive.
14
+ */
15
+ constructor(message, code, state, interactive) {
16
+ super(message);
17
+ this.code = code;
18
+ this.state = state;
19
+ this.interactive = interactive;
20
+ }
21
+ }
22
+ export class CodeError extends Error {
23
+ code;
24
+ /**
25
+ * @param message The human readable message.
26
+ * @param code The error code
27
+ */
28
+ constructor(message, code) {
29
+ super(message);
30
+ this.code = code;
31
+ }
32
+ }
33
+ //# sourceMappingURL=AuthorizationError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AuthorizationError.js","sourceRoot":"","sources":["../../../src/authorization/AuthorizationError.ts"],"names":[],"mappings":"AAAA,yCAAyC;AACzC;;GAEG;AACH,MAAM,OAAO,kBAAmB,SAAQ,KAAK;IAOP;IAAqB;IAAsB;IAN/E;;;;;OAKG;IACH,YAAY,OAAe,EAAS,IAAY,EAAS,KAAa,EAAS,WAAoB;QACjG,KAAK,CAAC,OAAO,CAAC,CAAC;QADmB,SAAI,GAAJ,IAAI,CAAQ;QAAS,UAAK,GAAL,KAAK,CAAQ;QAAS,gBAAW,GAAX,WAAW,CAAS;IAEnG,CAAC;CACF;AAED,MAAM,OAAO,SAAU,SAAQ,KAAK;IAKE;IAJpC;;;OAGG;IACH,YAAY,OAAe,EAAS,IAAY;QAC9C,KAAK,CAAC,OAAO,CAAC,CAAC;QADmB,SAAI,GAAJ,IAAI,CAAQ;IAEhD,CAAC;CACF"}
@@ -0,0 +1,24 @@
1
+ import { IOAuth2AuthorizationRequestCustomData, IOAuth2CustomData } from "../models/Authorization.js";
2
+ /**
3
+ * Applies custom properties defined in the OAuth settings object to the URL.
4
+ *
5
+ * @param url The instance of the URL class to use
6
+ * @param data `customData.[type]` property from the settings object. The type is either `auth` or `token`.
7
+ */
8
+ export declare function applyCustomSettingsQuery(url: URL, data: IOAuth2AuthorizationRequestCustomData): void;
9
+ /**
10
+ * Applies custom body properties from the settings to the body value.
11
+ *
12
+ * @param body Already computed body for OAuth request. Custom properties are appended at the end of OAuth string.
13
+ * @param data Value of settings' `customData` property
14
+ * @returns Request body
15
+ */
16
+ export declare function applyCustomSettingsBody(body: string, data: IOAuth2CustomData): string;
17
+ /**
18
+ * Applies custom headers from the settings object
19
+ *
20
+ * @param headers A regular JS map with headers definition
21
+ * @param data Value of settings' `customData` property
22
+ * @returns The copy of the headers object, if it was altered. Otherwise the same object.
23
+ */
24
+ export declare function applyCustomSettingsHeaders(headers: Record<string, string>, data: IOAuth2CustomData): Record<string, string>;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Applies custom properties defined in the OAuth settings object to the URL.
3
+ *
4
+ * @param url The instance of the URL class to use
5
+ * @param data `customData.[type]` property from the settings object. The type is either `auth` or `token`.
6
+ */
7
+ export function applyCustomSettingsQuery(url, data) {
8
+ if (!data || !data.parameters) {
9
+ return;
10
+ }
11
+ data.parameters.forEach((item) => {
12
+ const { name, value = '' } = item;
13
+ if (!name) {
14
+ return;
15
+ }
16
+ url.searchParams.set(name, value);
17
+ });
18
+ }
19
+ /**
20
+ * Applies custom body properties from the settings to the body value.
21
+ *
22
+ * @param body Already computed body for OAuth request. Custom properties are appended at the end of OAuth string.
23
+ * @param data Value of settings' `customData` property
24
+ * @returns Request body
25
+ */
26
+ export function applyCustomSettingsBody(body, data) {
27
+ if (!data || !data.token || !data.token.body) {
28
+ return body;
29
+ }
30
+ const params = data.token.body.map((item) => {
31
+ let { value } = item;
32
+ if (value) {
33
+ value = encodeURIComponent(value);
34
+ }
35
+ else {
36
+ value = '';
37
+ }
38
+ return `${encodeURIComponent(item.name)}=${value}`;
39
+ }).join('&');
40
+ return `${body}&${params}`;
41
+ }
42
+ /**
43
+ * Applies custom headers from the settings object
44
+ *
45
+ * @param headers A regular JS map with headers definition
46
+ * @param data Value of settings' `customData` property
47
+ * @returns The copy of the headers object, if it was altered. Otherwise the same object.
48
+ */
49
+ export function applyCustomSettingsHeaders(headers, data) {
50
+ if (!data || !data.token || !data.token.headers) {
51
+ return headers;
52
+ }
53
+ const copy = { ...headers };
54
+ data.token.headers.forEach((item) => {
55
+ copy[item.name] = item.value;
56
+ });
57
+ return copy;
58
+ }
59
+ //# sourceMappingURL=CustomParameters.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomParameters.js","sourceRoot":"","sources":["../../../src/authorization/CustomParameters.ts"],"names":[],"mappings":"AAEA;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CAAC,GAAQ,EAAE,IAA2C;IAC5F,IAAI,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE;QAC7B,OAAO;KACR;IACD,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QAC/B,MAAM,EAAE,IAAI,EAAE,KAAK,GAAC,EAAE,EAAE,GAAG,IAAI,CAAC;QAChC,IAAI,CAAC,IAAI,EAAE;YACT,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ACd,CAAC"}
@@ -0,0 +1,332 @@
1
+ import { IframeAuthorization } from './lib/IframeAuthorization.js';
2
+ import { PopupAuthorization } from './lib/PopupAuthorization.js';
3
+ import { IOAuth2Authorization, ITokenInfo } from '../models/Authorization.js';
4
+ import { OauthProcessingOptions } from './types.js';
5
+ export declare const resolveFunction: unique symbol;
6
+ export declare const rejectFunction: unique symbol;
7
+ export declare const settingsValue: unique symbol;
8
+ export declare const optionsValue: unique symbol;
9
+ export declare const prepareSettings: unique symbol;
10
+ export declare const prepareOptions: unique symbol;
11
+ export declare const authorize: unique symbol;
12
+ export declare const stateValue: unique symbol;
13
+ export declare const authorizeImplicitCode: unique symbol;
14
+ export declare const authorizeClientCredentials: unique symbol;
15
+ export declare const authorizePassword: unique symbol;
16
+ export declare const authorizeCustomGrant: unique symbol;
17
+ export declare const authorizeDeviceCode: unique symbol;
18
+ export declare const authorizeJwt: unique symbol;
19
+ export declare const popupValue: unique symbol;
20
+ export declare const popupUnloadHandler: unique symbol;
21
+ export declare const tokenResponse: unique symbol;
22
+ export declare const messageHandler: unique symbol;
23
+ export declare const iframeValue: unique symbol;
24
+ export declare const processPopupRawData: unique symbol;
25
+ export declare const handleTokenInfo: unique symbol;
26
+ export declare const computeTokenInfoScopes: unique symbol;
27
+ export declare const computeExpires: unique symbol;
28
+ export declare const codeValue: unique symbol;
29
+ export declare const frameTimeoutHandler: unique symbol;
30
+ export declare const reportOAuthError: unique symbol;
31
+ export declare const authorizePopup: unique symbol;
32
+ export declare const authorizeTokenNonInteractive: unique symbol;
33
+ export declare const createErrorParams: unique symbol;
34
+ export declare const handleTokenCodeError: unique symbol;
35
+ export declare const codeVerifierValue: unique symbol;
36
+ export declare const tokenInfoFromParams: unique symbol;
37
+ export declare const grantResponseMapping: Record<string, string>;
38
+ /**
39
+ * A library that performs OAuth 2 authorization.
40
+ *
41
+ * It is build for API components ecosystem and the configuration is defined in `@advanced-rest-client/events`
42
+ * so all components use the same configuration.
43
+ */
44
+ export declare class OAuth2Authorization {
45
+ [settingsValue]: IOAuth2Authorization;
46
+ /**
47
+ * @returns The authorization settings used to initialize this class.
48
+ */
49
+ get settings(): IOAuth2Authorization;
50
+ [optionsValue]: OauthProcessingOptions;
51
+ /**
52
+ * @returns The processing options used to initialize this object.
53
+ */
54
+ get options(): OauthProcessingOptions;
55
+ [stateValue]?: string;
56
+ /**
57
+ * @returns The request state parameter. If the state is not passed with the configuration one is generated.
58
+ */
59
+ get state(): string;
60
+ /**
61
+ * @type The main resolve function
62
+ */
63
+ [resolveFunction]?: (value: ITokenInfo | PromiseLike<ITokenInfo>) => void;
64
+ /**
65
+ * @type The main reject function
66
+ */
67
+ [rejectFunction]?: (reason?: Error) => void;
68
+ [codeVerifierValue]?: string;
69
+ [popupValue]?: PopupAuthorization;
70
+ [iframeValue]?: IframeAuthorization;
71
+ [tokenResponse]?: ITokenInfo;
72
+ [codeValue]?: string;
73
+ /**
74
+ * @param {OAuth2Settings} settings The authorization configuration.
75
+ * @param {OauthProcessingOptions=} options Additional processing options to configure the behavior of this library.
76
+ */
77
+ constructor(settings: IOAuth2Authorization, options?: OauthProcessingOptions);
78
+ /**
79
+ * @param settings
80
+ * @returns Processed settings
81
+ */
82
+ [prepareSettings](settings: IOAuth2Authorization): IOAuth2Authorization;
83
+ /**
84
+ * @param options
85
+ * @returns Processed options
86
+ */
87
+ [prepareOptions](options: OauthProcessingOptions): OauthProcessingOptions;
88
+ /**
89
+ * A function that should be called before the authorization.
90
+ * It checks configuration integrity, and performs some sanity checks
91
+ * like proper values of the request URIs.
92
+ */
93
+ checkConfig(): void;
94
+ /**
95
+ * Performs the authorization.
96
+ * @returns Promise resolved to the token info.
97
+ */
98
+ authorize(): Promise<ITokenInfo>;
99
+ /**
100
+ * Reports authorization error back to the application.
101
+ *
102
+ * This operation clears the promise object.
103
+ *
104
+ * @param {string} message The message to report
105
+ * @param {string} code Error code
106
+ */
107
+ [reportOAuthError](message: string, code: string): void;
108
+ /**
109
+ * Starts the authorization process.
110
+ */
111
+ [authorize](): void;
112
+ /**
113
+ * Starts the authorization flow for the `implicit` and `authorization_code` flows.
114
+ * If the `interactive` flag is configured it then it chooses between showing the UI (popup)
115
+ * or non-interactive iframe.
116
+ */
117
+ [authorizeImplicitCode](): Promise<void>;
118
+ /**
119
+ * Constructs the popup/iframe URL for the `implicit` or `authorization_code` grant types.
120
+ * @return Full URL for the endpoint.
121
+ */
122
+ constructPopupUrl(): Promise<string | null>;
123
+ /**
124
+ * @returns The parameters to build popup URL.
125
+ */
126
+ buildPopupUrlParams(): Promise<URL | null>;
127
+ /**
128
+ * Opens a popup to request authorization from the user.
129
+ * @param url The URL to open.
130
+ */
131
+ [authorizePopup](url: string): void;
132
+ /**
133
+ * Tries to authorize the user in a non interactive way (iframe rather than a popup).
134
+ *
135
+ * This method always result in a success response. When there's an error or
136
+ * user is not logged in then the response won't contain auth token info.
137
+ *
138
+ * @param url Complete authorization url
139
+ */
140
+ [authorizeTokenNonInteractive](url: string): void;
141
+ /**
142
+ * Event handler for the the iframe timeout event.
143
+ * If there's the reject function then it is called with the error details.
144
+ */
145
+ [frameTimeoutHandler](): void;
146
+ /**
147
+ * Clears all registered observers:
148
+ * - popup/iframe message listeners
149
+ * - popup info pull interval
150
+ */
151
+ clearObservers(): void;
152
+ /**
153
+ * This is called when the popup info pull interval detects that the window was closed.
154
+ * It checks whether the token info has been set by the redirect page and if not then it reports an error.
155
+ */
156
+ [popupUnloadHandler](): void;
157
+ /**
158
+ * A handler for the `message` event registered when performing authorization that involves the popup
159
+ * of the iframe.
160
+ */
161
+ [messageHandler](e: MessageEvent): void;
162
+ /**
163
+ * @param {any} raw The data from the `MessageEvent`. Might not be the data returned by the auth popup/iframe.
164
+ */
165
+ [processPopupRawData](raw: any): void;
166
+ /**
167
+ * @param {URLSearchParams} params The instance of search params with the response from the auth dialog.
168
+ * @returns {boolean} true when the params qualify as an authorization popup redirect response.
169
+ */
170
+ validateTokenResponse(params: URLSearchParams): boolean;
171
+ /**
172
+ * Processes the response returned by the popup or the iframe.
173
+ */
174
+ processTokenResponse(oauthParams: URLSearchParams): Promise<void>;
175
+ /**
176
+ * Processes the response returned by the popup or the iframe.
177
+ * @returns Parameters for the [reportOAuthError]() function
178
+ */
179
+ createTokenResponseError(oauthParams: URLSearchParams): string[];
180
+ /**
181
+ * Creates arguments for the error function from error response
182
+ * @param code Returned from the authorization server error code
183
+ * @param description Returned from the authorization server error description
184
+ * @returns Parameters for the [reportOAuthError]() function
185
+ */
186
+ [createErrorParams](code: string, description?: string): string[];
187
+ /**
188
+ * Creates a token info object from query parameters
189
+ */
190
+ [tokenInfoFromParams](oauthParams: URLSearchParams): ITokenInfo;
191
+ /**
192
+ * Processes token info object when it's ready.
193
+ *
194
+ * @param info Token info returned from the server.
195
+ */
196
+ [handleTokenInfo](info: ITokenInfo): void;
197
+ /**
198
+ * Computes token expiration time.
199
+ * It sets `expires_at` property on the token info object which is the time
200
+ * in the future when when the token expires.
201
+ *
202
+ * @param tokenInfo Token info object
203
+ * @returns A copy with updated properties.
204
+ */
205
+ [computeExpires](tokenInfo: ITokenInfo): ITokenInfo;
206
+ /**
207
+ * Computes the final list of granted scopes.
208
+ * It is a list of scopes received in the response or the list of requested scopes.
209
+ * Because the user may change the list of scopes during the authorization process
210
+ * the received list of scopes can be different than the one requested by the user.
211
+ *
212
+ * @param scope The `scope` parameter received with the response. It's null safe.
213
+ * @returns The list of scopes for the token.
214
+ */
215
+ [computeTokenInfoScopes](scope: string): string[];
216
+ /**
217
+ * Exchanges the authorization code for authorization token.
218
+ *
219
+ * @param code Returned code from the authorization endpoint.
220
+ * @returns The response from the server.
221
+ */
222
+ getCodeInfo(code: string): Promise<Record<string, any>>;
223
+ /**
224
+ * Requests for token from the authorization server for `code`, `password`, `client_credentials` and custom grant types.
225
+ *
226
+ * @param url Base URI of the endpoint. Custom properties will be applied to the final URL.
227
+ * @param body Generated body for given type. Custom properties will be applied to the final body.
228
+ * @param optHeaders Optional headers to add to the request. Applied after custom data.
229
+ * @returns Promise resolved to the response string.
230
+ */
231
+ requestTokenInfo(url: string, body: string, optHeaders?: Record<string, string>): Promise<Record<string, any>>;
232
+ /**
233
+ * Processes body of the code exchange to a map of key value pairs.
234
+ */
235
+ processCodeResponse(body: string, mime?: string): Record<string, any>;
236
+ /**
237
+ * @returns The token info when the request was a success.
238
+ */
239
+ mapCodeResponse(info: Record<string, any>): ITokenInfo;
240
+ /**
241
+ * Exchanges the authorization code for authorization token.
242
+ *
243
+ * @param code Returned code from the authorization endpoint.
244
+ * @returns The token info when the request was a success.
245
+ */
246
+ exchangeCode(code: string): Promise<ITokenInfo>;
247
+ /**
248
+ * Returns a body value for the code exchange request.
249
+ * @param code Authorization code value returned by the authorization server.
250
+ * @return Request body.
251
+ */
252
+ getCodeRequestBody(code: string): string;
253
+ /**
254
+ * A handler for the error that happened during code exchange.
255
+ */
256
+ [handleTokenCodeError](e: Error): void;
257
+ /**
258
+ * Requests a token for `client_credentials` request type.
259
+ *
260
+ * This method resolves the main promise set by the `authorize()` function.
261
+ *
262
+ * @return Promise resolved to a token info object.
263
+ */
264
+ [authorizeClientCredentials](): Promise<void>;
265
+ /**
266
+ * Generates a payload message for client credentials.
267
+ *
268
+ * @return Message body as defined in OAuth2 spec.
269
+ */
270
+ getClientCredentialsBody(): string;
271
+ /**
272
+ * Builds the authorization header for Client Credentials grant type.
273
+ * According to the spec the authorization header for this grant type
274
+ * is the Base64 of `clientId` + `:` + `clientSecret`.
275
+ *
276
+ * @param settings The OAuth 2 settings to use
277
+ */
278
+ getClientCredentialsHeader(settings: IOAuth2Authorization): string;
279
+ /**
280
+ * Requests a token for `client_credentials` request type.
281
+ *
282
+ * This method resolves the main promise set by the `authorize()` function.
283
+ *
284
+ * @return Promise resolved to a token info object.
285
+ */
286
+ [authorizePassword](): Promise<void>;
287
+ /**
288
+ * Generates a payload message for password authorization.
289
+ *
290
+ * @return Message body as defined in OAuth2 spec.
291
+ */
292
+ getPasswordBody(): string;
293
+ /**
294
+ * Performs authorization on custom grant type.
295
+ * This extension is described in OAuth 2.0 spec.
296
+ *
297
+ * This method resolves the main promise set by the `authorize()` function.
298
+ *
299
+ * @return Promise resolved when the request finish.
300
+ */
301
+ [authorizeCustomGrant](): Promise<void>;
302
+ /**
303
+ * Generates a payload message for the custom grant.
304
+ *
305
+ * @returns Message body as defined in OAuth2 spec.
306
+ */
307
+ getCustomGrantBody(): string;
308
+ /**
309
+ * Requests a token for the `urn:ietf:params:oauth:grant-type:device_code` response type.
310
+ *
311
+ * @returns Promise resolved to a token info object.
312
+ */
313
+ [authorizeDeviceCode](): Promise<void>;
314
+ /**
315
+ * Generates a payload message for the `urn:ietf:params:oauth:grant-type:device_code` authorization.
316
+ *
317
+ * @returns Message body as defined in OAuth2 spec.
318
+ */
319
+ getDeviceCodeBody(): string;
320
+ /**
321
+ * Requests a token for the `urn:ietf:params:oauth:grant-type:jwt-bearer` response type.
322
+ *
323
+ * @return Promise resolved to a token info object.
324
+ */
325
+ [authorizeJwt](): Promise<void>;
326
+ /**
327
+ * Generates a payload message for the `urn:ietf:params:oauth:grant-type:jwt-bearer` authorization.
328
+ *
329
+ * @return {string} Message body as defined in OAuth2 spec.
330
+ */
331
+ getJwtBody(): string;
332
+ }