@authme/core 2.4.8 → 2.4.11
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/index.cjs +12 -6
- package/index.js +10 -8
- package/package.json +2 -2
- package/src/index.d.ts +1 -0
- package/src/lib/authme-log.d.ts +1 -0
package/index.cjs
CHANGED
|
@@ -48,13 +48,15 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
48
48
|
});
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
var name = "authme/
|
|
52
|
-
var version$1 = "2.4.
|
|
53
|
-
var
|
|
51
|
+
var name = "@authme/core";
|
|
52
|
+
var version$1 = "2.4.11";
|
|
53
|
+
var peerDependencies = {
|
|
54
|
+
"core-js": "^3.6.0"
|
|
55
|
+
};
|
|
54
56
|
var packageInfo = {
|
|
55
57
|
name: name,
|
|
56
58
|
version: version$1,
|
|
57
|
-
|
|
59
|
+
peerDependencies: peerDependencies
|
|
58
60
|
};
|
|
59
61
|
|
|
60
62
|
var _a;
|
|
@@ -110,7 +112,7 @@ function sendRequest(url, method = 'GET', {
|
|
|
110
112
|
// 可以透過代入 null 的方式來取消預設值。
|
|
111
113
|
accessToken = util.Storage.getItem('token'),
|
|
112
114
|
baseUrl = util.Storage.getItem('apiBaseUrl'),
|
|
113
|
-
sdkInfo = [`sdk-version: ${version}`,
|
|
115
|
+
sdkInfo = [`sdk-version: ${version}`, util.getUserAgent()].join(';')
|
|
114
116
|
} = {}) {
|
|
115
117
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
118
|
const requestLoggingFunction = getRequestLoggingFunc();
|
|
@@ -131,7 +133,7 @@ function sendRequest(url, method = 'GET', {
|
|
|
131
133
|
try {
|
|
132
134
|
const normalizedUrl = baseUrl ? new URL(url, baseUrl).toString() : url;
|
|
133
135
|
resp = requestLoggingFunction ? yield requestLoggingFunction(() => fetch(normalizedUrl.toString(), options), {
|
|
134
|
-
runFunction:
|
|
136
|
+
runFunction: 'api.sendRequest',
|
|
135
137
|
message: {
|
|
136
138
|
url: normalizedUrl.toString(),
|
|
137
139
|
options
|
|
@@ -584,6 +586,10 @@ Object.defineProperty(exports, 'ErrorCode', {
|
|
|
584
586
|
enumerable: true,
|
|
585
587
|
get: function () { return util.ErrorCode; }
|
|
586
588
|
});
|
|
589
|
+
Object.defineProperty(exports, 'debugLog', {
|
|
590
|
+
enumerable: true,
|
|
591
|
+
get: function () { return util.debugLog; }
|
|
592
|
+
});
|
|
587
593
|
exports.EventListenerService = EventListenerService;
|
|
588
594
|
exports.TrackingEvent = TrackingEvent;
|
|
589
595
|
exports.core = core;
|
package/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Storage,
|
|
2
|
-
export { AuthmeError, ErrorCode } from '@authme/util';
|
|
1
|
+
import { Storage, getUserAgent, AuthmeError, ErrorCode, STORAGE_KEY, decodeToken, useState, getDeviceInfo, getSystemInfo } from '@authme/util';
|
|
2
|
+
export { AuthmeError, ErrorCode, debugLog } from '@authme/util';
|
|
3
3
|
import 'core-js/modules/es.object.assign.js';
|
|
4
4
|
import 'core-js/modules/es.regexp.to-string.js';
|
|
5
5
|
import 'core-js/modules/es.array.iterator.js';
|
|
@@ -45,13 +45,15 @@ function __awaiter(thisArg, _arguments, P, generator) {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
var name = "authme/
|
|
49
|
-
var version$1 = "2.4.
|
|
50
|
-
var
|
|
48
|
+
var name = "@authme/core";
|
|
49
|
+
var version$1 = "2.4.11";
|
|
50
|
+
var peerDependencies = {
|
|
51
|
+
"core-js": "^3.6.0"
|
|
52
|
+
};
|
|
51
53
|
var packageInfo = {
|
|
52
54
|
name: name,
|
|
53
55
|
version: version$1,
|
|
54
|
-
|
|
56
|
+
peerDependencies: peerDependencies
|
|
55
57
|
};
|
|
56
58
|
|
|
57
59
|
var _a;
|
|
@@ -107,7 +109,7 @@ function sendRequest(url, method = 'GET', {
|
|
|
107
109
|
// 可以透過代入 null 的方式來取消預設值。
|
|
108
110
|
accessToken = Storage.getItem('token'),
|
|
109
111
|
baseUrl = Storage.getItem('apiBaseUrl'),
|
|
110
|
-
sdkInfo = [`sdk-version: ${version}`,
|
|
112
|
+
sdkInfo = [`sdk-version: ${version}`, getUserAgent()].join(';')
|
|
111
113
|
} = {}) {
|
|
112
114
|
return __awaiter(this, void 0, void 0, function* () {
|
|
113
115
|
const requestLoggingFunction = getRequestLoggingFunc();
|
|
@@ -128,7 +130,7 @@ function sendRequest(url, method = 'GET', {
|
|
|
128
130
|
try {
|
|
129
131
|
const normalizedUrl = baseUrl ? new URL(url, baseUrl).toString() : url;
|
|
130
132
|
resp = requestLoggingFunction ? yield requestLoggingFunction(() => fetch(normalizedUrl.toString(), options), {
|
|
131
|
-
runFunction:
|
|
133
|
+
runFunction: 'api.sendRequest',
|
|
132
134
|
message: {
|
|
133
135
|
url: normalizedUrl.toString(),
|
|
134
136
|
options
|
package/package.json
CHANGED
package/src/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './lib/core';
|
|
|
2
2
|
export * from './lib/model';
|
|
3
3
|
export * from './lib/data-access';
|
|
4
4
|
export * from './lib/translate';
|
|
5
|
+
export * from './lib/authme-log';
|
|
5
6
|
export * from './lib/enum/language.enum';
|
|
6
7
|
export * from './lib/features';
|
|
7
8
|
export { version } from './lib/version';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { debugLog } from '@authme/util';
|