openmates 0.21.0-alpha.6 → 0.21.0-alpha.7
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/{chunk-WDFC7XBM.js → chunk-3PJYPJJQ.js} +17 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -87504,6 +87504,7 @@ async function resolveRemoteAccessBindings(client, masterKey, projects, candidat
|
|
|
87504
87504
|
}
|
|
87505
87505
|
const bindings = [];
|
|
87506
87506
|
for (const item of resolved) {
|
|
87507
|
+
await ensureProjectDefaultFocus(client, item.project, context, item.rootPath);
|
|
87507
87508
|
const sourceType = remoteAccessSourceType(item.rootPath);
|
|
87508
87509
|
const source = startRemoteAccessSource({
|
|
87509
87510
|
sourceId: item.sourceId,
|
|
@@ -87591,9 +87592,24 @@ async function createEncryptedRemoteAccessProject(client, name, rootPath, writeM
|
|
|
87591
87592
|
};
|
|
87592
87593
|
}
|
|
87593
87594
|
async function decryptProjectDefaultFocus(client, project, context) {
|
|
87595
|
+
return ensureProjectDefaultFocus(client, project, context);
|
|
87596
|
+
}
|
|
87597
|
+
async function ensureProjectDefaultFocus(client, project, context, rootPath) {
|
|
87594
87598
|
const settings = await client.getProjectSettings(project.projectId, context);
|
|
87595
87599
|
if (!settings.encrypted_settings) {
|
|
87596
|
-
|
|
87600
|
+
const importedInstructions = rootPath ? readRootProjectInstructions(rootPath) : null;
|
|
87601
|
+
const focus = buildProjectDefaultFocus(
|
|
87602
|
+
project.name,
|
|
87603
|
+
importedInstructions?.instructions,
|
|
87604
|
+
importedInstructions?.source
|
|
87605
|
+
);
|
|
87606
|
+
await client.updateProjectSettings(project.projectId, {
|
|
87607
|
+
write_mode: settings.write_mode === "always_ask" ? "always_ask" : "apply_and_show",
|
|
87608
|
+
default_focus_id: focus.focus_id,
|
|
87609
|
+
encrypted_settings: await encryptWithAesGcmCombined(JSON.stringify({ default_focus: focus }), project.projectKey),
|
|
87610
|
+
updated_at: nowSeconds3()
|
|
87611
|
+
}, context);
|
|
87612
|
+
return focus;
|
|
87597
87613
|
}
|
|
87598
87614
|
const plaintext = await decryptWithAesGcmCombined(settings.encrypted_settings, project.projectKey);
|
|
87599
87615
|
if (!plaintext) throw new CliContractError("project_focus_invalid", "The Project default focus could not be decrypted.");
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED