cidaas-javascript-sdk 2.1.4 → 2.2.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.
- package/package.json +12 -1
- package/src/main/web-auth/webauth.js +56 -10
- package/types/authentication/index.d.ts +15 -0
- package/types/index.d.ts +5 -0
- package/types/main/web-auth/webauth.d.ts +2 -0
- package/types/web-auth/exception.d.ts +7 -0
- package/types/web-auth/webauth.d.ts +138 -0
- package/.gitlab-ci.yml +0 -17
- package/.prettierrc +0 -6
- package/src/test/sum.js +0 -4
- package/src/test/test.js +0 -5
- package/tsconfig.json +0 -21
- package/webpack.common.js +0 -32
- package/webpack.dev.js +0 -15
- package/webpack.prod.js +0 -11
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cidaas-javascript-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.3",
|
|
4
4
|
"author": "cidaas by Widas ID GmbH",
|
|
5
5
|
"description": "Cidaas native javascript sdk",
|
|
6
6
|
"license": "MIT",
|
|
@@ -16,7 +16,18 @@
|
|
|
16
16
|
"test:coverage": "jest --coverage",
|
|
17
17
|
"build-types": "npx -p typescript tsc src/**/*.js --declaration --allowJs --emitDeclarationOnly --outDir types"
|
|
18
18
|
},
|
|
19
|
+
"files": [
|
|
20
|
+
"src",
|
|
21
|
+
"types",
|
|
22
|
+
"README.md",
|
|
23
|
+
"license.MD",
|
|
24
|
+
"Changelogs.md"
|
|
25
|
+
],
|
|
26
|
+
"publishConfig": {
|
|
27
|
+
"registry": "https://registry.npmjs.org/"
|
|
28
|
+
},
|
|
19
29
|
"dependencies": {
|
|
30
|
+
"@types/node": "^18.11.18",
|
|
20
31
|
"crypto-js": "^4.1.1",
|
|
21
32
|
"oidc-client": "^1.11.5"
|
|
22
33
|
},
|
|
@@ -134,7 +134,7 @@ WebAuth.prototype.getUserProfile = function (options) {
|
|
|
134
134
|
};
|
|
135
135
|
http.open("GET", _serviceURL, true);
|
|
136
136
|
http.setRequestHeader("Content-type", "application/json");
|
|
137
|
-
http.setRequestHeader("
|
|
137
|
+
http.setRequestHeader("Authorization", `Bearer ${options.access_token}`);
|
|
138
138
|
if (window.localeSettings) {
|
|
139
139
|
http.setRequestHeader("accept-language", window.localeSettings);
|
|
140
140
|
}
|
|
@@ -161,7 +161,7 @@ WebAuth.prototype.getProfileInfo = function (access_token) {
|
|
|
161
161
|
};
|
|
162
162
|
http.open("GET", _serviceURL, true);
|
|
163
163
|
http.setRequestHeader("Content-type", "application/json");
|
|
164
|
-
http.setRequestHeader("
|
|
164
|
+
http.setRequestHeader("Authorization", `Bearer ${access_token}`);
|
|
165
165
|
if (window.localeSettings) {
|
|
166
166
|
http.setRequestHeader("accept-language", window.localeSettings);
|
|
167
167
|
}
|
|
@@ -242,7 +242,7 @@ function createPostPromise(options, serviceurl, errorResolver, access_token) {
|
|
|
242
242
|
http.open("POST", serviceurl, true);
|
|
243
243
|
http.setRequestHeader("Content-type", "application/json");
|
|
244
244
|
if (access_token) {
|
|
245
|
-
http.setRequestHeader("
|
|
245
|
+
http.setRequestHeader("Authorization", `Bearer ${access_token}`);
|
|
246
246
|
}
|
|
247
247
|
if (window.localeSettings) {
|
|
248
248
|
http.setRequestHeader("accept-language", window.localeSettings);
|
|
@@ -1199,7 +1199,7 @@ WebAuth.prototype.getScopeConsentVersionDetailsV2 = function (options) {
|
|
|
1199
1199
|
};
|
|
1200
1200
|
http.open("GET", _serviceURL, true);
|
|
1201
1201
|
http.setRequestHeader("Content-type", "application/json");
|
|
1202
|
-
http.setRequestHeader("Authorization",
|
|
1202
|
+
http.setRequestHeader("Authorization", `Bearer ${options.access_token}`);
|
|
1203
1203
|
if (window.localeSettings) {
|
|
1204
1204
|
http.setRequestHeader("accept-language", window.localeSettings);
|
|
1205
1205
|
}
|
|
@@ -1412,7 +1412,7 @@ WebAuth.prototype.updateProfile = function (options, access_token, sub) {
|
|
|
1412
1412
|
};
|
|
1413
1413
|
http.open("PUT", _serviceURL, true);
|
|
1414
1414
|
http.setRequestHeader("Content-type", "application/json");
|
|
1415
|
-
http.setRequestHeader("
|
|
1415
|
+
http.setRequestHeader("Authorization", `Bearer ${access_token}`);
|
|
1416
1416
|
if (window.localeSettings) {
|
|
1417
1417
|
http.setRequestHeader("accept-language", window.localeSettings);
|
|
1418
1418
|
}
|
|
@@ -1446,7 +1446,7 @@ WebAuth.prototype.getUnreviewedDevices = function (access_token, sub) {
|
|
|
1446
1446
|
};
|
|
1447
1447
|
http.open("GET", _serviceURL, true);
|
|
1448
1448
|
http.setRequestHeader("Content-type", "application/json");
|
|
1449
|
-
http.setRequestHeader("
|
|
1449
|
+
http.setRequestHeader("Authorization", `Bearer ${access_token}`);
|
|
1450
1450
|
if (window.localeSettings) {
|
|
1451
1451
|
http.setRequestHeader("accept-language", window.localeSettings);
|
|
1452
1452
|
}
|
|
@@ -1474,7 +1474,7 @@ WebAuth.prototype.getReviewedDevices = function (access_token, sub) {
|
|
|
1474
1474
|
};
|
|
1475
1475
|
http.open("GET", _serviceURL, true);
|
|
1476
1476
|
http.setRequestHeader("Content-type", "application/json");
|
|
1477
|
-
http.setRequestHeader("
|
|
1477
|
+
http.setRequestHeader("Authorization", `Bearer ${access_token}`);
|
|
1478
1478
|
if (window.localeSettings) {
|
|
1479
1479
|
http.setRequestHeader("accept-language", window.localeSettings);
|
|
1480
1480
|
}
|
|
@@ -1502,7 +1502,7 @@ WebAuth.prototype.reviewDevice = function (options, access_token, sub) {
|
|
|
1502
1502
|
};
|
|
1503
1503
|
http.open("PUT", _serviceURL, true);
|
|
1504
1504
|
http.setRequestHeader("Content-type", "application/json");
|
|
1505
|
-
http.setRequestHeader("
|
|
1505
|
+
http.setRequestHeader("Authorization", `Bearer ${access_token}`);
|
|
1506
1506
|
if (window.localeSettings) {
|
|
1507
1507
|
http.setRequestHeader("accept-language", window.localeSettings);
|
|
1508
1508
|
}
|
|
@@ -1536,7 +1536,7 @@ WebAuth.prototype.viewAcceptedConsent = function (options, access_token) {
|
|
|
1536
1536
|
};
|
|
1537
1537
|
http.open("GET", _serviceURL, true);
|
|
1538
1538
|
http.setRequestHeader("Content-type", "application/json");
|
|
1539
|
-
http.setRequestHeader("
|
|
1539
|
+
http.setRequestHeader("Authorization", `Bearer ${access_token}`);
|
|
1540
1540
|
if (window.localeSettings) {
|
|
1541
1541
|
http.setRequestHeader("accept-language", window.localeSettings);
|
|
1542
1542
|
}
|
|
@@ -1845,6 +1845,28 @@ WebAuth.prototype.loginAfterRegister = function (options) {
|
|
|
1845
1845
|
}
|
|
1846
1846
|
};
|
|
1847
1847
|
|
|
1848
|
+
// device code flow - verify
|
|
1849
|
+
WebAuth.prototype.deviceCodeVerify = function (code) {
|
|
1850
|
+
const params = `user_code=${encodeURI(code)}`;
|
|
1851
|
+
const url = `${window.webAuthSettings.authority}/token-srv/device/verify?${params}`;
|
|
1852
|
+
try {
|
|
1853
|
+
const form = document.createElement('form');
|
|
1854
|
+
form.action = url
|
|
1855
|
+
form.method = 'GET';
|
|
1856
|
+
const hiddenField = document.createElement("input");
|
|
1857
|
+
hiddenField.setAttribute("type", "hidden");
|
|
1858
|
+
hiddenField.setAttribute("name", 'user_code');
|
|
1859
|
+
hiddenField.setAttribute("value", encodeURI(code));
|
|
1860
|
+
|
|
1861
|
+
form.appendChild(hiddenField);
|
|
1862
|
+
document.body.appendChild(form);
|
|
1863
|
+
form.submit();
|
|
1864
|
+
} catch (ex) {
|
|
1865
|
+
throw new Error(ex);
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
|
|
1869
|
+
|
|
1848
1870
|
WebAuth.prototype.userCheckExists = function (options) {
|
|
1849
1871
|
var _serviceURL = window.webAuthSettings.authority + "/users-srv/user/checkexists/" + options.requestId;
|
|
1850
1872
|
return createPostPromise(options, _serviceURL, undefined);
|
|
@@ -1854,4 +1876,28 @@ WebAuth.prototype.setAcceptLanguageHeader = function (acceptLanguage) {
|
|
|
1854
1876
|
window.localeSettings = acceptLanguage;
|
|
1855
1877
|
}
|
|
1856
1878
|
|
|
1857
|
-
|
|
1879
|
+
// get device info
|
|
1880
|
+
WebAuth.prototype.getDeviceInfo = function (options) {
|
|
1881
|
+
return new Promise(function (resolve, reject) {
|
|
1882
|
+
try {
|
|
1883
|
+
options.deviceFingerprint = self.crypto.randomUUID();
|
|
1884
|
+
var http = new XMLHttpRequest();
|
|
1885
|
+
var _serviceURL = window.webAuthSettings.authority + "/device-srv/deviceinfo";
|
|
1886
|
+
http.onreadystatechange = function () {
|
|
1887
|
+
if (http.readyState == 4) {
|
|
1888
|
+
resolve(JSON.parse(http.responseText));
|
|
1889
|
+
}
|
|
1890
|
+
};
|
|
1891
|
+
http.open("POST", _serviceURL, true);
|
|
1892
|
+
http.setRequestHeader("Content-type", "application/json");
|
|
1893
|
+
if (window.localeSettings) {
|
|
1894
|
+
http.setRequestHeader("accept-language", window.localeSettings);
|
|
1895
|
+
}
|
|
1896
|
+
http.send(JSON.stringify(options));
|
|
1897
|
+
} catch (ex) {
|
|
1898
|
+
reject(ex);
|
|
1899
|
+
}
|
|
1900
|
+
});
|
|
1901
|
+
};
|
|
1902
|
+
|
|
1903
|
+
module.exports = WebAuth;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export = Authentication;
|
|
2
|
+
declare function Authentication(): void;
|
|
3
|
+
declare class Authentication {
|
|
4
|
+
redirectSignIn(view_type: any): void;
|
|
5
|
+
redirectSignInCallback(): Promise<any>;
|
|
6
|
+
redirectSignOut(): Promise<any>;
|
|
7
|
+
redirectSignOutCallback(): Promise<any>;
|
|
8
|
+
popupSignIn(): void;
|
|
9
|
+
popupSignInCallback(): void;
|
|
10
|
+
popupSignOut(): void;
|
|
11
|
+
popupSignOutCallback(): void;
|
|
12
|
+
silentSignIn(): void;
|
|
13
|
+
silentSignInCallback(): void;
|
|
14
|
+
silentSignInCallbackV2(): Promise<any>;
|
|
15
|
+
}
|
package/types/index.d.ts
ADDED
|
@@ -131,6 +131,8 @@ declare class WebAuth {
|
|
|
131
131
|
getMissingFieldsLogin(trackId: any): Promise<any>;
|
|
132
132
|
progressiveRegistration(options: any, headers: any): Promise<any>;
|
|
133
133
|
loginAfterRegister(options: any): void;
|
|
134
|
+
deviceCodeVerify(code: any): void;
|
|
134
135
|
userCheckExists(options: any): Promise<any>;
|
|
135
136
|
setAcceptLanguageHeader(acceptLanguage: any): void;
|
|
137
|
+
getDeviceInfo(options: any): Promise<any>;
|
|
136
138
|
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
export = WebAuth;
|
|
2
|
+
declare function WebAuth(settings: any): void;
|
|
3
|
+
declare class WebAuth {
|
|
4
|
+
constructor(settings: any);
|
|
5
|
+
loginWithBrowser(): void;
|
|
6
|
+
registerWithBrowser(): void;
|
|
7
|
+
loginCallback(): Promise<any>;
|
|
8
|
+
getUserInfo(): Promise<any>;
|
|
9
|
+
getUserProfile(options: any): Promise<any>;
|
|
10
|
+
getProfileInfo(access_token: any): Promise<any>;
|
|
11
|
+
logout(): Promise<any>;
|
|
12
|
+
logoutCallback(): Promise<any>;
|
|
13
|
+
renewToken(options: any): Promise<any>;
|
|
14
|
+
generateCodeVerifier(): void;
|
|
15
|
+
generateRandomString(length: any): string;
|
|
16
|
+
generateCodeChallenge(code_verifier: any): any;
|
|
17
|
+
base64URL(string: any): any;
|
|
18
|
+
getLoginURL(): string;
|
|
19
|
+
getAccessToken(options: any): Promise<any>;
|
|
20
|
+
validateAccessToken(options: any): Promise<any>;
|
|
21
|
+
getRequestId(): Promise<any>;
|
|
22
|
+
loginWithCredentials(options: any): void;
|
|
23
|
+
loginWithCredentialsAsynFn(options: any): Promise<Response>;
|
|
24
|
+
loginWithSocial(options: any, queryParams: any): void;
|
|
25
|
+
registerWithSocial(options: any, queryParams: any): void;
|
|
26
|
+
getMissingFields(options: any): Promise<any>;
|
|
27
|
+
getTenantInfo(): Promise<any>;
|
|
28
|
+
logoutUser(options: any): void;
|
|
29
|
+
getClientInfo(options: any): Promise<any>;
|
|
30
|
+
getRegistrationSetup(options: any): Promise<any>;
|
|
31
|
+
register(options: any, headers: any): Promise<any>;
|
|
32
|
+
getInviteUserDetails(options: any): Promise<any>;
|
|
33
|
+
getCommunicationStatus(options: any): Promise<any>;
|
|
34
|
+
initiateAccountVerification(options: any): void;
|
|
35
|
+
initiateAccountVerificationAsynFn(options: any): Promise<Response>;
|
|
36
|
+
verifyAccount(options: any): Promise<any>;
|
|
37
|
+
initiateResetPassword(options: any): Promise<any>;
|
|
38
|
+
handleResetPassword(options: any): void;
|
|
39
|
+
resetPassword(options: any): void;
|
|
40
|
+
getMFAList(options: any): Promise<any>;
|
|
41
|
+
getMFAListV2(options: any): Promise<any>;
|
|
42
|
+
initiateMFAV2(options: any): Promise<any>;
|
|
43
|
+
initiateEmail(options: any): Promise<any>;
|
|
44
|
+
initiateEmailV2(options: any): Promise<any>;
|
|
45
|
+
initiateSMS(options: any): Promise<any>;
|
|
46
|
+
initiateSMSV2(options: any): Promise<any>;
|
|
47
|
+
initiateIVR(options: any): Promise<any>;
|
|
48
|
+
initiateIVRV2(options: any): Promise<any>;
|
|
49
|
+
initiateBackupcode(options: any): Promise<any>;
|
|
50
|
+
initiateBackupcodeV2(options: any): Promise<any>;
|
|
51
|
+
initiateTOTP(options: any): Promise<any>;
|
|
52
|
+
initiateTOTPV2(options: any): Promise<any>;
|
|
53
|
+
initiatePattern(options: any): Promise<any>;
|
|
54
|
+
initiatePatternV2(options: any): Promise<any>;
|
|
55
|
+
initiateTouchId(options: any): Promise<any>;
|
|
56
|
+
initiateTouchIdV2(options: any): Promise<any>;
|
|
57
|
+
initiateSmartPush(options: any): Promise<any>;
|
|
58
|
+
initiateSmartPushV2(options: any): Promise<any>;
|
|
59
|
+
initiateFace(options: any): Promise<any>;
|
|
60
|
+
initiateFaceV2(options: any): Promise<any>;
|
|
61
|
+
initiateVoice(options: any): Promise<any>;
|
|
62
|
+
initiateVoiceV2(options: any): Promise<any>;
|
|
63
|
+
authenticateMFAV2(options: any): Promise<any>;
|
|
64
|
+
cancelMFAV2(options: any): Promise<any>;
|
|
65
|
+
authenticateEmail(options: any): Promise<any>;
|
|
66
|
+
authenticateEmailV2(options: any): Promise<any>;
|
|
67
|
+
authenticateSMS(options: any): Promise<any>;
|
|
68
|
+
authenticateSMSV2(options: any): Promise<any>;
|
|
69
|
+
authenticateIVR(options: any): Promise<any>;
|
|
70
|
+
authenticateIVRV2(options: any): Promise<any>;
|
|
71
|
+
authenticateBackupcode(options: any): Promise<any>;
|
|
72
|
+
authenticateBackupcodeV2(options: any): Promise<any>;
|
|
73
|
+
authenticateTOTP(options: any): Promise<any>;
|
|
74
|
+
authenticateTOTPV2(options: any): Promise<any>;
|
|
75
|
+
passwordlessLogin(options: any): void;
|
|
76
|
+
getConsentDetails(options: any): Promise<any>;
|
|
77
|
+
getConsentDetailsV2(options: any): Promise<any>;
|
|
78
|
+
acceptConsent(options: any): Promise<any>;
|
|
79
|
+
acceptConsentV2(options: any): Promise<any>;
|
|
80
|
+
getScopeConsentDetails(options: any): Promise<any>;
|
|
81
|
+
getScopeConsentVersionDetailsV2(options: any): Promise<any>;
|
|
82
|
+
acceptScopeConsent(options: any): Promise<any>;
|
|
83
|
+
scopeConsentContinue(options: any): void;
|
|
84
|
+
acceptClaimConsent(options: any): Promise<any>;
|
|
85
|
+
claimConsentContinue(options: any): void;
|
|
86
|
+
revokeClaimConsent(options: any): Promise<any>;
|
|
87
|
+
getDeduplicationDetails(options: any): Promise<any>;
|
|
88
|
+
deduplicationLogin(options: any): void;
|
|
89
|
+
registerDeduplication(options: any): Promise<any>;
|
|
90
|
+
consentContinue(options: any): void;
|
|
91
|
+
mfaContinue(options: any): void;
|
|
92
|
+
firstTimeChangePassword(options: any): void;
|
|
93
|
+
changePassword(options: any, access_token: any): Promise<any>;
|
|
94
|
+
updateProfile(options: any, access_token: any, sub: any): Promise<any>;
|
|
95
|
+
getUserActivities(options: any, access_token: any): Promise<any>;
|
|
96
|
+
getUnreviewedDevices(access_token: any, sub: any): Promise<any>;
|
|
97
|
+
getReviewedDevices(access_token: any, sub: any): Promise<any>;
|
|
98
|
+
reviewDevice(options: any, access_token: any, sub: any): Promise<any>;
|
|
99
|
+
getAcceptedConsentList(options: any, access_token: any): Promise<any>;
|
|
100
|
+
viewAcceptedConsent(options: any, access_token: any): Promise<any>;
|
|
101
|
+
getConfiguredVerificationList(options: any, access_token: any): Promise<any>;
|
|
102
|
+
initiateLinkAccount(options: any, access_token: any): Promise<any>;
|
|
103
|
+
completeLinkAccount(options: any, access_token: any): Promise<any>;
|
|
104
|
+
getLinkedUsers(access_token: any, sub: any): Promise<any>;
|
|
105
|
+
unlinkAccount(access_token: any, identityId: any): Promise<any>;
|
|
106
|
+
getAllVerificationList(access_token: any): Promise<any>;
|
|
107
|
+
updateProfileImage(options: any, access_token: any): Promise<any>;
|
|
108
|
+
setupEmail(options: any): Promise<any>;
|
|
109
|
+
setupSMS(options: any): Promise<any>;
|
|
110
|
+
setupIVR(options: any): Promise<any>;
|
|
111
|
+
setupBackupcode(options: any, access_token: any): Promise<any>;
|
|
112
|
+
setupTOTP(options: any, access_token: any): Promise<any>;
|
|
113
|
+
setupPattern(options: any, access_token: any): Promise<any>;
|
|
114
|
+
setupTouchId(options: any, access_token: any): Promise<any>;
|
|
115
|
+
setupSmartPush(options: any, access_token: any): Promise<any>;
|
|
116
|
+
setupFace(options: any, access_token: any): Promise<any>;
|
|
117
|
+
setupVoice(options: any, access_token: any): Promise<any>;
|
|
118
|
+
enrollEmail(options: any, access_token: any): Promise<any>;
|
|
119
|
+
enrollSMS(options: any, access_token: any): Promise<any>;
|
|
120
|
+
enrollIVR(options: any, access_token: any): Promise<any>;
|
|
121
|
+
enrollTOTP(options: any, access_token: any): Promise<any>;
|
|
122
|
+
updateSuggestMFA(track_id: any, options: any): Promise<any>;
|
|
123
|
+
enrollVerification(options: any): Promise<any>;
|
|
124
|
+
updateSocket(status_id: any): Promise<any>;
|
|
125
|
+
setupFidoVerification(options: any): Promise<any>;
|
|
126
|
+
checkVerificationTypeConfigured(options: any): Promise<any>;
|
|
127
|
+
authenticateVerification(options: any): Promise<any>;
|
|
128
|
+
authenticateFaceVerification(options: any): Promise<any>;
|
|
129
|
+
initiateVerification(options: any): Promise<any>;
|
|
130
|
+
deleteUserAccount(options: any): Promise<any>;
|
|
131
|
+
getMissingFieldsLogin(trackId: any): Promise<any>;
|
|
132
|
+
progressiveRegistration(options: any, headers: any): Promise<any>;
|
|
133
|
+
loginAfterRegister(options: any): void;
|
|
134
|
+
deviceCodeVerify(code: any): void;
|
|
135
|
+
userCheckExists(options: any): Promise<any>;
|
|
136
|
+
setAcceptLanguageHeader(acceptLanguage: any): void;
|
|
137
|
+
getDeviceInfo(options: any): Promise<any>;
|
|
138
|
+
}
|
package/.gitlab-ci.yml
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
include:
|
|
2
|
-
- project: "widas/codequality"
|
|
3
|
-
ref: fix/yml-file-failure
|
|
4
|
-
file: "ci_templates/js.gitlab-ci.yml"
|
|
5
|
-
|
|
6
|
-
stages:
|
|
7
|
-
- test
|
|
8
|
-
- build
|
|
9
|
-
- badges
|
|
10
|
-
- deploy
|
|
11
|
-
|
|
12
|
-
npm-build:
|
|
13
|
-
image: nexus.widas.de:18443/cidaas-node-typescript:10.10.0-latest
|
|
14
|
-
stage: build
|
|
15
|
-
script:
|
|
16
|
-
- npm install
|
|
17
|
-
- npm run build
|
package/.prettierrc
DELETED
package/src/test/sum.js
DELETED
package/src/test/test.js
DELETED
package/tsconfig.json
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Change this to match your project
|
|
3
|
-
"include": ["src/**/*"],
|
|
4
|
-
"compilerOptions": {
|
|
5
|
-
// Tells TypeScript to read JS files, as
|
|
6
|
-
// normally they are ignored as source files
|
|
7
|
-
"allowJs": true,
|
|
8
|
-
// Generate d.ts files
|
|
9
|
-
"declaration": true,
|
|
10
|
-
// This compiler run should
|
|
11
|
-
// only output d.ts files
|
|
12
|
-
"emitDeclarationOnly": true,
|
|
13
|
-
// Types should go into this directory.
|
|
14
|
-
// Removing this would place the .d.ts files
|
|
15
|
-
// next to the .js files
|
|
16
|
-
"outDir": "dist",
|
|
17
|
-
// go to js file when using IDE functions like
|
|
18
|
-
// "Go to Definition" in VSCode
|
|
19
|
-
"declarationMap": true
|
|
20
|
-
}
|
|
21
|
-
}
|
package/webpack.common.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
const path = require('path');
|
|
2
|
-
const pjson = require('./package.json');
|
|
3
|
-
var webpack = require('webpack');
|
|
4
|
-
|
|
5
|
-
var entryPoints = {
|
|
6
|
-
'cidaas-javascript-sdk': './src/main/index.js'
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
module.exports = {
|
|
10
|
-
entry: entryPoints,
|
|
11
|
-
plugins: [
|
|
12
|
-
new webpack.BannerPlugin({
|
|
13
|
-
banner: `${pjson.name} v${pjson.version}\n\nAuthor: ${pjson.author}\nDate: ${new Date().toLocaleString()}\nLicense: MIT\n`, // eslint-disable-line
|
|
14
|
-
raw: false,
|
|
15
|
-
entryOnly: true
|
|
16
|
-
}
|
|
17
|
-
)
|
|
18
|
-
],
|
|
19
|
-
output: {
|
|
20
|
-
path: path.resolve(__dirname, './build'),
|
|
21
|
-
filename: '[name].min.js',
|
|
22
|
-
library: '[name]',
|
|
23
|
-
libraryTarget: 'umd',
|
|
24
|
-
umdNamedDefine: true,
|
|
25
|
-
clean: true,
|
|
26
|
-
},
|
|
27
|
-
stats: {
|
|
28
|
-
colors: true,
|
|
29
|
-
modules: true,
|
|
30
|
-
reasons: true
|
|
31
|
-
},
|
|
32
|
-
};
|
package/webpack.dev.js
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const { merge } = require('webpack-merge');
|
|
2
|
-
const common = require('./webpack.common.js');
|
|
3
|
-
|
|
4
|
-
module.exports = merge(common, {
|
|
5
|
-
mode: 'development',
|
|
6
|
-
devtool: 'inline-source-map',
|
|
7
|
-
devServer: {
|
|
8
|
-
contentBase: './build',
|
|
9
|
-
},
|
|
10
|
-
watch: true,
|
|
11
|
-
watchOptions: {
|
|
12
|
-
aggregateTimeout: 500,
|
|
13
|
-
poll: true
|
|
14
|
-
},
|
|
15
|
-
});
|
package/webpack.prod.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const { merge } = require('webpack-merge');
|
|
2
|
-
var webpack = require('webpack');
|
|
3
|
-
const common = require('./webpack.common.js');
|
|
4
|
-
const CompressionPlugin = require("compression-webpack-plugin");
|
|
5
|
-
module.exports = merge(common, {
|
|
6
|
-
mode: 'production',
|
|
7
|
-
plugins: [
|
|
8
|
-
new webpack.optimize.AggressiveMergingPlugin(),
|
|
9
|
-
new CompressionPlugin()
|
|
10
|
-
]
|
|
11
|
-
});
|