@asgardeo/auth-spa 0.2.21 → 0.3.1
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 +111 -89
- package/dist/asgardeo-spa.production.esm.js +19 -16
- package/dist/asgardeo-spa.production.esm.js.map +1 -1
- package/dist/asgardeo-spa.production.js +19 -16
- package/dist/asgardeo-spa.production.js.map +1 -1
- package/dist/asgardeo-spa.production.min.js +1 -1
- package/dist/asgardeo-spa.production.min.js.map +1 -1
- package/dist/polyfilled/asgardeo-spa.production.esm.js +42 -39
- package/dist/polyfilled/asgardeo-spa.production.esm.js.map +1 -1
- package/dist/polyfilled/asgardeo-spa.production.js +42 -39
- package/dist/polyfilled/asgardeo-spa.production.js.map +1 -1
- package/dist/polyfilled/asgardeo-spa.production.min.js +1 -1
- package/dist/polyfilled/asgardeo-spa.production.min.js.map +1 -1
- package/dist/src/client.d.ts +6 -3
- package/dist/src/client.d.ts.map +1 -1
- package/dist/src/client.js +14 -11
- package/dist/src/client.js.map +1 -1
- package/dist/src/clients/main-thread-client.d.ts.map +1 -1
- package/dist/src/clients/main-thread-client.js +40 -34
- package/dist/src/clients/main-thread-client.js.map +1 -1
- package/dist/src/clients/web-worker-client.d.ts.map +1 -1
- package/dist/src/clients/web-worker-client.js +7 -9
- package/dist/src/clients/web-worker-client.js.map +1 -1
- package/dist/src/models/client.d.ts +2 -2
- package/dist/src/models/client.d.ts.map +1 -1
- package/dist/src/utils/crypto-utils.d.ts +2 -4
- package/dist/src/utils/crypto-utils.d.ts.map +1 -1
- package/dist/src/utils/crypto-utils.js +3 -6
- package/dist/src/utils/crypto-utils.js.map +1 -1
- package/dist/src/worker/client.worker.d.ts.map +1 -1
- package/dist/src/worker/client.worker.js +3 -3
- package/dist/src/worker/client.worker.js.map +1 -1
- package/dist/src/worker/worker-core.d.ts.map +1 -1
- package/dist/src/worker/worker-core.js +48 -42
- package/dist/src/worker/worker-core.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/client.ts +24 -35
- package/src/clients/main-thread-client.ts +63 -75
- package/src/clients/web-worker-client.ts +20 -30
- package/src/models/client.ts +2 -3
- package/src/utils/crypto-utils.ts +15 -19
- package/src/worker/client.worker.ts +5 -10
- package/src/worker/worker-core.ts +81 -89
- package/dist/src/exception/exception.d.ts +0 -27
- package/dist/src/exception/exception.d.ts.map +0 -1
- package/dist/src/exception/exception.js +0 -30
- package/dist/src/exception/exception.js.map +0 -1
- package/dist/src/exception/index.d.ts +0 -19
- package/dist/src/exception/index.d.ts.map +0 -1
- package/dist/src/exception/index.js +0 -19
- package/dist/src/exception/index.js.map +0 -1
- package/src/exception/exception.ts +0 -44
- package/src/exception/index.ts +0 -19
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import {
|
|
20
20
|
AsgardeoAuthClient,
|
|
21
|
+
AsgardeoAuthException,
|
|
21
22
|
AuthClientConfig,
|
|
22
23
|
AuthorizationURLParams,
|
|
23
24
|
BasicUserInfo,
|
|
@@ -31,7 +32,6 @@ import {
|
|
|
31
32
|
TokenResponse
|
|
32
33
|
} from "@asgardeo/auth-js";
|
|
33
34
|
import { CUSTOM_GRANT_CONFIG } from "../constants";
|
|
34
|
-
import { AsgardeoSPAException } from "../exception";
|
|
35
35
|
import { SPAHelper } from "../helpers";
|
|
36
36
|
import { HttpClient, HttpClientInstance } from "../http-client";
|
|
37
37
|
import {
|
|
@@ -63,7 +63,7 @@ export const WebWorkerCore = async (
|
|
|
63
63
|
if (requestConfig.attachToken) {
|
|
64
64
|
request.headers = {
|
|
65
65
|
...request.headers,
|
|
66
|
-
Authorization: `Bearer ${await _authenticationClient.getAccessToken()}`
|
|
66
|
+
Authorization: `Bearer ${ await _authenticationClient.getAccessToken() }`
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
69
|
};
|
|
@@ -84,13 +84,13 @@ export const WebWorkerCore = async (
|
|
|
84
84
|
|
|
85
85
|
const httpRequest = async (requestConfig: HttpRequestConfig): Promise<HttpResponse> => {
|
|
86
86
|
let matches = false;
|
|
87
|
-
const
|
|
87
|
+
const serverOrigin = (config as any).baseUrl || (config as any).serverOrigin;
|
|
88
88
|
|
|
89
89
|
for (const baseUrl of [
|
|
90
90
|
...((await _dataLayer.getConfigData())?.resourceServerURLs ?? []),
|
|
91
|
-
|
|
91
|
+
serverOrigin
|
|
92
92
|
]) {
|
|
93
|
-
if (requestConfig?.url?.startsWith(baseUrl)) {
|
|
93
|
+
if (baseUrl && requestConfig?.url?.startsWith(baseUrl)) {
|
|
94
94
|
matches = true;
|
|
95
95
|
|
|
96
96
|
break;
|
|
@@ -103,45 +103,43 @@ export const WebWorkerCore = async (
|
|
|
103
103
|
.then((response: HttpResponse) => {
|
|
104
104
|
return Promise.resolve(response);
|
|
105
105
|
})
|
|
106
|
-
.catch((error: HttpError) => {
|
|
106
|
+
.catch(async (error: HttpError) => {
|
|
107
107
|
if (error?.response?.status === 401 || !error?.response) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
)
|
|
129
|
-
);
|
|
130
|
-
|
|
108
|
+
let refreshAccessTokenResponse: BasicUserInfo;
|
|
109
|
+
try {
|
|
110
|
+
refreshAccessTokenResponse = await refreshAccessToken();
|
|
111
|
+
} catch (refreshError: any) {
|
|
112
|
+
throw new AsgardeoAuthException(
|
|
113
|
+
"SPA-WORKER_CORE-HR-SE01",
|
|
114
|
+
refreshError?.name ?? "Refresh token request failed.",
|
|
115
|
+
refreshError?.message ??
|
|
116
|
+
"An error occurred while trying to refresh the " +
|
|
117
|
+
"access token following a 401 response from the server."
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
if (refreshAccessTokenResponse) {
|
|
122
|
+
return _httpClient
|
|
123
|
+
.request(requestConfig)
|
|
124
|
+
.then((response) => {
|
|
125
|
+
return Promise.resolve(response);
|
|
126
|
+
})
|
|
127
|
+
.catch((error) => {
|
|
128
|
+
return Promise.reject(error);
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
return Promise.reject(error);
|
|
134
134
|
});
|
|
135
135
|
} else {
|
|
136
136
|
return Promise.reject(
|
|
137
|
-
new
|
|
138
|
-
"WORKER_CORE-HR-IV02",
|
|
139
|
-
"worker-core",
|
|
140
|
-
"httpRequest",
|
|
137
|
+
new AsgardeoAuthException(
|
|
138
|
+
"SPA-WORKER_CORE-HR-IV02",
|
|
141
139
|
"Request to the provided endpoint is prohibited.",
|
|
142
140
|
"Requests can only be sent to resource servers specified by the `resourceServerURLs`" +
|
|
143
|
-
|
|
144
|
-
|
|
141
|
+
" attribute while initializing the SDK. The specified endpoint in this request " +
|
|
142
|
+
"cannot be found among the `resourceServerURLs`"
|
|
145
143
|
)
|
|
146
144
|
);
|
|
147
145
|
}
|
|
@@ -149,16 +147,17 @@ export const WebWorkerCore = async (
|
|
|
149
147
|
|
|
150
148
|
const httpRequestAll = async (requestConfigs: HttpRequestConfig[]): Promise<HttpResponse[] | undefined> => {
|
|
151
149
|
let matches = true;
|
|
152
|
-
|
|
150
|
+
|
|
151
|
+
const serverOrigin = (config as any).baseUrl || (config as any).serverOrigin;
|
|
153
152
|
|
|
154
153
|
for (const requestConfig of requestConfigs) {
|
|
155
154
|
let urlMatches = false;
|
|
156
155
|
|
|
157
156
|
for (const baseUrl of [
|
|
158
157
|
...((await _dataLayer.getConfigData())?.resourceServerURLs ?? []),
|
|
159
|
-
|
|
158
|
+
serverOrigin
|
|
160
159
|
]) {
|
|
161
|
-
if (requestConfig.url?.startsWith(baseUrl)) {
|
|
160
|
+
if (baseUrl && requestConfig.url?.startsWith(baseUrl)) {
|
|
162
161
|
urlMatches = true;
|
|
163
162
|
|
|
164
163
|
break;
|
|
@@ -186,35 +185,34 @@ export const WebWorkerCore = async (
|
|
|
186
185
|
.then((responses: HttpResponse[]) => {
|
|
187
186
|
return Promise.resolve(responses);
|
|
188
187
|
})
|
|
189
|
-
.catch((error: HttpError) => {
|
|
188
|
+
.catch(async (error: HttpError) => {
|
|
190
189
|
if (error?.response?.status === 401) {
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
});
|
|
190
|
+
let refreshAccessTokenResponse: BasicUserInfo;
|
|
191
|
+
try {
|
|
192
|
+
refreshAccessTokenResponse = await refreshAccessToken();
|
|
193
|
+
} catch (refreshError: any) {
|
|
194
|
+
throw new AsgardeoAuthException(
|
|
195
|
+
"SPA-WORKER_CORE-HRA-SE01",
|
|
196
|
+
refreshError?.name ?? "Refresh token request failed.",
|
|
197
|
+
refreshError?.message ??
|
|
198
|
+
"An error occurred while trying to refresh the " +
|
|
199
|
+
"access token following a 401 response from the server."
|
|
200
|
+
);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
if (refreshAccessTokenResponse) {
|
|
204
|
+
return (
|
|
205
|
+
_httpClient.all &&
|
|
206
|
+
_httpClient
|
|
207
|
+
.all(requests)
|
|
208
|
+
.then((response) => {
|
|
209
|
+
return Promise.resolve(response);
|
|
210
|
+
})
|
|
211
|
+
.catch((error) => {
|
|
212
|
+
return Promise.reject(error);
|
|
213
|
+
})
|
|
214
|
+
);
|
|
215
|
+
}
|
|
218
216
|
}
|
|
219
217
|
|
|
220
218
|
return Promise.reject(error);
|
|
@@ -222,14 +220,12 @@ export const WebWorkerCore = async (
|
|
|
222
220
|
);
|
|
223
221
|
} else {
|
|
224
222
|
return Promise.reject(
|
|
225
|
-
new
|
|
226
|
-
"WORKER_CORE-HRA-IV02",
|
|
227
|
-
"worker-core",
|
|
228
|
-
"httpRequest",
|
|
223
|
+
new AsgardeoAuthException(
|
|
224
|
+
"SPA-WORKER_CORE-HRA-IV02",
|
|
229
225
|
"Request to the provided endpoint is prohibited.",
|
|
230
226
|
"Requests can only be sent to resource servers specified by the `resourceServerURLs`" +
|
|
231
|
-
|
|
232
|
-
|
|
227
|
+
" attribute while initializing the SDK. The specified endpoint in this request " +
|
|
228
|
+
"cannot be found among the `resourceServerURLs`"
|
|
233
229
|
)
|
|
234
230
|
);
|
|
235
231
|
}
|
|
@@ -289,10 +285,8 @@ export const WebWorkerCore = async (
|
|
|
289
285
|
}
|
|
290
286
|
|
|
291
287
|
return Promise.reject(
|
|
292
|
-
new
|
|
293
|
-
"WORKER_CORE-RAT1-NF01",
|
|
294
|
-
"worker-core",
|
|
295
|
-
"requestAccessToken",
|
|
288
|
+
new AsgardeoAuthException(
|
|
289
|
+
"SPA-WORKER_CORE-RAT1-NF01",
|
|
296
290
|
"No authorization code.",
|
|
297
291
|
"No authorization code was found."
|
|
298
292
|
)
|
|
@@ -312,23 +306,23 @@ export const WebWorkerCore = async (
|
|
|
312
306
|
const requestCustomGrant = async (config: CustomGrantConfig): Promise<BasicUserInfo | FetchResponse> => {
|
|
313
307
|
let useDefaultEndpoint = true;
|
|
314
308
|
let matches = false;
|
|
315
|
-
const
|
|
309
|
+
const serverOrigin = (config as any).baseUrl || (config as any).serverOrigin;
|
|
316
310
|
|
|
317
311
|
// If the config does not contains a token endpoint, default token endpoint will be used.
|
|
318
312
|
if (config?.tokenEndpoint) {
|
|
319
313
|
useDefaultEndpoint = false;
|
|
320
314
|
for (const baseUrl of [
|
|
321
315
|
...((await _dataLayer.getConfigData())?.resourceServerURLs ?? []),
|
|
322
|
-
|
|
316
|
+
serverOrigin
|
|
323
317
|
]) {
|
|
324
|
-
if (config.tokenEndpoint?.startsWith(baseUrl)) {
|
|
318
|
+
if (baseUrl && config.tokenEndpoint?.startsWith(baseUrl)) {
|
|
325
319
|
matches = true;
|
|
326
320
|
break;
|
|
327
321
|
}
|
|
328
322
|
}
|
|
329
323
|
}
|
|
330
324
|
|
|
331
|
-
if(config.shouldReplayAfterRefresh) {
|
|
325
|
+
if (config.shouldReplayAfterRefresh) {
|
|
332
326
|
_dataLayer.setTemporaryDataParameter(CUSTOM_GRANT_CONFIG, JSON.stringify(config));
|
|
333
327
|
}
|
|
334
328
|
if (useDefaultEndpoint || matches) {
|
|
@@ -348,14 +342,12 @@ export const WebWorkerCore = async (
|
|
|
348
342
|
});
|
|
349
343
|
} else {
|
|
350
344
|
return Promise.reject(
|
|
351
|
-
new
|
|
352
|
-
"WORKER_CORE-RCG-IV01",
|
|
353
|
-
"worker-core",
|
|
354
|
-
"requestCustomGrant",
|
|
345
|
+
new AsgardeoAuthException(
|
|
346
|
+
"SPA-WORKER_CORE-RCG-IV01",
|
|
355
347
|
"Request to the provided endpoint is prohibited.",
|
|
356
348
|
"Requests can only be sent to resource servers specified by the `resourceServerURLs`" +
|
|
357
|
-
|
|
358
|
-
|
|
349
|
+
" attribute while initializing the SDK. The specified token endpoint in this request " +
|
|
350
|
+
"cannot be found among the `resourceServerURLs`"
|
|
359
351
|
)
|
|
360
352
|
);
|
|
361
353
|
}
|
|
@@ -427,11 +419,11 @@ export const WebWorkerCore = async (
|
|
|
427
419
|
};
|
|
428
420
|
|
|
429
421
|
const getCustomGrantConfigData = async (): Promise<AuthClientConfig<CustomGrantConfig> | null> => {
|
|
430
|
-
const configString =
|
|
431
|
-
if(configString) {
|
|
422
|
+
const configString = await _dataLayer.getTemporaryDataParameter(CUSTOM_GRANT_CONFIG);
|
|
423
|
+
if (configString) {
|
|
432
424
|
return JSON.parse(configString as string);
|
|
433
425
|
} else {
|
|
434
|
-
return null
|
|
426
|
+
return null;
|
|
435
427
|
}
|
|
436
428
|
};
|
|
437
429
|
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
5
|
-
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
-
* in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing,
|
|
12
|
-
* software distributed under the License is distributed on an
|
|
13
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
* KIND, either express or implied. See the License for the
|
|
15
|
-
* specific language governing permissions and limitations
|
|
16
|
-
* under the License.
|
|
17
|
-
*/
|
|
18
|
-
export declare class AsgardeoSPAException extends Error {
|
|
19
|
-
name: string;
|
|
20
|
-
code: string;
|
|
21
|
-
file: string;
|
|
22
|
-
method: string;
|
|
23
|
-
description: string;
|
|
24
|
-
error: AsgardeoSPAException | undefined;
|
|
25
|
-
constructor(code: string, file: string, method: string, message: string, description: string, error?: AsgardeoSPAException | undefined);
|
|
26
|
-
}
|
|
27
|
-
//# sourceMappingURL=exception.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exception.d.ts","sourceRoot":"","sources":["../../../src/exception/exception.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,qBAAa,oBAAqB,SAAQ,KAAK;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,oBAAoB,GAAG,SAAS,CAAC;gBAG3C,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,WAAW,EAAE,MAAM,EACnB,KAAK,CAAC,EAAE,oBAAoB,GAAG,SAAS;CAW/C"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
5
|
-
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
-
* in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing,
|
|
12
|
-
* software distributed under the License is distributed on an
|
|
13
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
* KIND, either express or implied. See the License for the
|
|
15
|
-
* specific language governing permissions and limitations
|
|
16
|
-
* under the License.
|
|
17
|
-
*/
|
|
18
|
-
export class AsgardeoSPAException extends Error {
|
|
19
|
-
constructor(code, file, method, message, description, error) {
|
|
20
|
-
super(message !== null && message !== void 0 ? message : error === null || error === void 0 ? void 0 : error.message);
|
|
21
|
-
this.name = this.constructor.name;
|
|
22
|
-
this.code = code;
|
|
23
|
-
this.file = file;
|
|
24
|
-
this.method = method;
|
|
25
|
-
this.error = error;
|
|
26
|
-
this.description = description;
|
|
27
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=exception.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"exception.js","sourceRoot":"","sources":["../../../src/exception/exception.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,MAAM,OAAO,oBAAqB,SAAQ,KAAK;IAQ3C,YACI,IAAY,EACZ,IAAY,EACZ,MAAc,EACd,OAAe,EACf,WAAmB,EACnB,KAAwC;QAExC,KAAK,CAAC,OAAO,aAAP,OAAO,cAAP,OAAO,GAAI,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,CAAC,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC;QAClC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACtD,CAAC;CACJ"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
5
|
-
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
-
* in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing,
|
|
12
|
-
* software distributed under the License is distributed on an
|
|
13
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
* KIND, either express or implied. See the License for the
|
|
15
|
-
* specific language governing permissions and limitations
|
|
16
|
-
* under the License.
|
|
17
|
-
*/
|
|
18
|
-
export * from "./exception";
|
|
19
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exception/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;EAgBE;AAEF,cAAc,aAAa,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
5
|
-
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
-
* in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing,
|
|
12
|
-
* software distributed under the License is distributed on an
|
|
13
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
* KIND, either express or implied. See the License for the
|
|
15
|
-
* specific language governing permissions and limitations
|
|
16
|
-
* under the License.
|
|
17
|
-
*/
|
|
18
|
-
export * from "./exception";
|
|
19
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/exception/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;EAgBE;AAEF,cAAc,aAAa,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
5
|
-
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
-
* in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing,
|
|
12
|
-
* software distributed under the License is distributed on an
|
|
13
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
* KIND, either express or implied. See the License for the
|
|
15
|
-
* specific language governing permissions and limitations
|
|
16
|
-
* under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
export class AsgardeoSPAException extends Error {
|
|
20
|
-
public name: string;
|
|
21
|
-
public code: string;
|
|
22
|
-
public file: string;
|
|
23
|
-
public method: string;
|
|
24
|
-
public description: string;
|
|
25
|
-
public error: AsgardeoSPAException | undefined;
|
|
26
|
-
|
|
27
|
-
public constructor(
|
|
28
|
-
code: string,
|
|
29
|
-
file: string,
|
|
30
|
-
method: string,
|
|
31
|
-
message: string,
|
|
32
|
-
description: string,
|
|
33
|
-
error?: AsgardeoSPAException | undefined
|
|
34
|
-
) {
|
|
35
|
-
super(message ?? error?.message);
|
|
36
|
-
this.name = this.constructor.name;
|
|
37
|
-
this.code = code;
|
|
38
|
-
this.file = file;
|
|
39
|
-
this.method = method;
|
|
40
|
-
this.error = error;
|
|
41
|
-
this.description = description;
|
|
42
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
43
|
-
}
|
|
44
|
-
}
|
package/src/exception/index.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
|
|
3
|
-
*
|
|
4
|
-
* WSO2 Inc. licenses this file to you under the Apache License,
|
|
5
|
-
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
-
* in compliance with the License.
|
|
7
|
-
* You may obtain a copy of the License at
|
|
8
|
-
*
|
|
9
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
-
*
|
|
11
|
-
* Unless required by applicable law or agreed to in writing,
|
|
12
|
-
* software distributed under the License is distributed on an
|
|
13
|
-
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
-
* KIND, either express or implied. See the License for the
|
|
15
|
-
* specific language governing permissions and limitations
|
|
16
|
-
* under the License.
|
|
17
|
-
*/
|
|
18
|
-
|
|
19
|
-
export * from "./exception";
|