@lvce-editor/auth-worker 3.11.0 → 3.12.0
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/dist/authWorkerMain.js +26 -30
- package/package.json +1 -1
package/dist/authWorkerMain.js
CHANGED
|
@@ -1070,31 +1070,27 @@ const {
|
|
|
1070
1070
|
const Web = 1;
|
|
1071
1071
|
const Electron = 2;
|
|
1072
1072
|
|
|
1073
|
+
const MainProcess = -5;
|
|
1073
1074
|
const OpenerWorker = 4561;
|
|
1074
1075
|
const RendererWorker = 1;
|
|
1075
|
-
const SharedProcess = 1492;
|
|
1076
1076
|
|
|
1077
1077
|
const {
|
|
1078
1078
|
invoke: invoke$2,
|
|
1079
1079
|
set: set$1
|
|
1080
|
-
} = create(
|
|
1080
|
+
} = create(MainProcess);
|
|
1081
1081
|
|
|
1082
1082
|
const {
|
|
1083
1083
|
invoke: invoke$1,
|
|
1084
|
+
set
|
|
1085
|
+
} = create(OpenerWorker);
|
|
1086
|
+
|
|
1087
|
+
const {
|
|
1088
|
+
invoke,
|
|
1084
1089
|
invokeAndTransfer} = create(RendererWorker);
|
|
1085
1090
|
const sendMessagePortToOpenerWorker$1 = async (port, rpcId) => {
|
|
1086
1091
|
const command = 'HandleMessagePort.handleMessagePort';
|
|
1087
1092
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToOpenerWorker', port, command, rpcId);
|
|
1088
1093
|
};
|
|
1089
|
-
const sendMessagePortToSharedProcess$1 = async port => {
|
|
1090
|
-
const command = 'HandleElectronMessagePort.handleElectronMessagePort';
|
|
1091
|
-
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, command, 0);
|
|
1092
|
-
};
|
|
1093
|
-
|
|
1094
|
-
const {
|
|
1095
|
-
invoke,
|
|
1096
|
-
set
|
|
1097
|
-
} = create(SharedProcess);
|
|
1098
1094
|
|
|
1099
1095
|
const sendMessagePortToAuthProcess = async port => {
|
|
1100
1096
|
await invokeAndTransfer('SendMessagePortToExtensionHostWorker.sendMessagePortToSharedProcess', port, 'HandleMessagePortForAuthProcess.handleMessagePortForAuthProcess');
|
|
@@ -1107,6 +1103,17 @@ const initializeAuthProcess = async () => {
|
|
|
1107
1103
|
set$2(rpc);
|
|
1108
1104
|
};
|
|
1109
1105
|
|
|
1106
|
+
const sendMessagePortToMainProcess = async port => {
|
|
1107
|
+
await invokeAndTransfer('SendMessagePortToMainProcess.sendMessagePortToMainProcess', port, 'HandleElectronMessagePort.handleElectronMessagePort', 0);
|
|
1108
|
+
};
|
|
1109
|
+
const initializeMainProcess = async () => {
|
|
1110
|
+
const rpc = await create$2({
|
|
1111
|
+
commandMap: {},
|
|
1112
|
+
send: sendMessagePortToMainProcess
|
|
1113
|
+
});
|
|
1114
|
+
set$1(rpc);
|
|
1115
|
+
};
|
|
1116
|
+
|
|
1110
1117
|
const sendMessagePortToOpenerWorker = async port => {
|
|
1111
1118
|
await sendMessagePortToOpenerWorker$1(port, 0);
|
|
1112
1119
|
};
|
|
@@ -1115,7 +1122,7 @@ const initializeOpenerWorker = async () => {
|
|
|
1115
1122
|
commandMap: {},
|
|
1116
1123
|
send: sendMessagePortToOpenerWorker
|
|
1117
1124
|
});
|
|
1118
|
-
set
|
|
1125
|
+
set(rpc);
|
|
1119
1126
|
};
|
|
1120
1127
|
|
|
1121
1128
|
const millisecondsPerSecond = 1000;
|
|
@@ -1155,14 +1162,14 @@ const setAuthPlatform = value => {
|
|
|
1155
1162
|
|
|
1156
1163
|
const authStorageId = 'lvce-editor.auth';
|
|
1157
1164
|
const deleteSecret = async key => {
|
|
1158
|
-
await invoke('SecretStorage.delete', authStorageId, key);
|
|
1165
|
+
await invoke$2('SecretStorage.delete', authStorageId, key);
|
|
1159
1166
|
};
|
|
1160
1167
|
const getSecret = async key => {
|
|
1161
|
-
const value = await invoke('SecretStorage.get', authStorageId, key);
|
|
1168
|
+
const value = await invoke$2('SecretStorage.get', authStorageId, key);
|
|
1162
1169
|
return typeof value === 'string' ? value : '';
|
|
1163
1170
|
};
|
|
1164
1171
|
const storeSecret = async (key, value) => {
|
|
1165
|
-
await invoke('SecretStorage.store', authStorageId, key, value);
|
|
1172
|
+
await invoke$2('SecretStorage.store', authStorageId, key, value);
|
|
1166
1173
|
};
|
|
1167
1174
|
|
|
1168
1175
|
const databaseName = 'auth-worker';
|
|
@@ -1337,7 +1344,7 @@ const savePendingOidcAuthState = async value => {
|
|
|
1337
1344
|
let USER_AGENT;
|
|
1338
1345
|
if (typeof navigator === 'undefined' || !navigator.userAgent?.startsWith?.('Mozilla/5.0 ')) {
|
|
1339
1346
|
const NAME = 'oauth4webapi';
|
|
1340
|
-
const VERSION = 'v3.8.
|
|
1347
|
+
const VERSION = 'v3.8.7';
|
|
1341
1348
|
USER_AGENT = `${NAME}/${VERSION}`;
|
|
1342
1349
|
}
|
|
1343
1350
|
function looseInstanceOf(input, expected) {
|
|
@@ -2226,7 +2233,7 @@ const exchangeAuthorizationCode = async (backendUrl, clientId, code, redirectUri
|
|
|
2226
2233
|
|
|
2227
2234
|
const getCurrentHref = async () => {
|
|
2228
2235
|
try {
|
|
2229
|
-
return await invoke
|
|
2236
|
+
return await invoke('Layout.getHref');
|
|
2230
2237
|
} catch {
|
|
2231
2238
|
// ignore
|
|
2232
2239
|
}
|
|
@@ -3102,7 +3109,7 @@ const getInteractiveLoginResult = async (backendUrl, platform, signingInState) =
|
|
|
3102
3109
|
state
|
|
3103
3110
|
});
|
|
3104
3111
|
}
|
|
3105
|
-
await invoke$
|
|
3112
|
+
await invoke$1('Open.openUrl', loginUrl, platform, authUseRedirect);
|
|
3106
3113
|
if (platform !== Electron && authUseRedirect) {
|
|
3107
3114
|
return signingInState;
|
|
3108
3115
|
}
|
|
@@ -3183,19 +3190,8 @@ const initializeRendererWorker = async () => {
|
|
|
3183
3190
|
});
|
|
3184
3191
|
};
|
|
3185
3192
|
|
|
3186
|
-
const sendMessagePortToSharedProcess = async port => {
|
|
3187
|
-
await sendMessagePortToSharedProcess$1(port);
|
|
3188
|
-
};
|
|
3189
|
-
const initializeSharedProcess = async () => {
|
|
3190
|
-
const rpc = await create$2({
|
|
3191
|
-
commandMap: {},
|
|
3192
|
-
send: sendMessagePortToSharedProcess
|
|
3193
|
-
});
|
|
3194
|
-
set(rpc);
|
|
3195
|
-
};
|
|
3196
|
-
|
|
3197
3193
|
const listen = async () => {
|
|
3198
|
-
await Promise.all([initializeRendererWorker(), initializeOpenerWorker(), initializeAuthProcess(),
|
|
3194
|
+
await Promise.all([initializeRendererWorker(), initializeOpenerWorker(), initializeAuthProcess(), initializeMainProcess()]);
|
|
3199
3195
|
};
|
|
3200
3196
|
|
|
3201
3197
|
const main = async () => {
|