@terraforge/core 0.0.24 → 0.0.26
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/index.d.mts +2 -2
- package/dist/index.mjs +17 -9
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -360,9 +360,9 @@ declare class WorkSpace {
|
|
|
360
360
|
urn: URN;
|
|
361
361
|
operation: "delete" | "update";
|
|
362
362
|
commit(): void;
|
|
363
|
-
}[]
|
|
363
|
+
}[];
|
|
364
364
|
commit: () => Promise<void>;
|
|
365
|
-
}>;
|
|
365
|
+
} | undefined>;
|
|
366
366
|
/**
|
|
367
367
|
* Get the status of all resources in the app by comparing current config with state file.
|
|
368
368
|
*/
|
package/dist/index.mjs
CHANGED
|
@@ -1118,8 +1118,8 @@ const refresh = async (app, opt) => {
|
|
|
1118
1118
|
if (opt.filters && opt.filters.length > 0) filteredStacks = Object.entries(appState?.stacks ?? {}).filter(([stackName]) => {
|
|
1119
1119
|
return opt.filters.includes(stackName);
|
|
1120
1120
|
}).map(([_, state]) => state);
|
|
1121
|
-
if (appState && filteredStacks.length > 0)
|
|
1122
|
-
|
|
1121
|
+
if (appState && filteredStacks.length > 0) {
|
|
1122
|
+
const filteredOperations = (await Promise.all(filteredStacks.map((stackState) => {
|
|
1123
1123
|
return Promise.all(Object.entries(stackState.nodes).map(([_urn, nodeState]) => {
|
|
1124
1124
|
const urn = _urn;
|
|
1125
1125
|
return queue(async () => {
|
|
@@ -1133,6 +1133,9 @@ const refresh = async (app, opt) => {
|
|
|
1133
1133
|
type: nodeState.type,
|
|
1134
1134
|
state: nodeState.output
|
|
1135
1135
|
});
|
|
1136
|
+
console.log(urn);
|
|
1137
|
+
console.log(nodeState.output);
|
|
1138
|
+
console.log(result?.state);
|
|
1136
1139
|
if (!result) return {
|
|
1137
1140
|
urn,
|
|
1138
1141
|
operation: "delete",
|
|
@@ -1150,11 +1153,15 @@ const refresh = async (app, opt) => {
|
|
|
1150
1153
|
};
|
|
1151
1154
|
});
|
|
1152
1155
|
}));
|
|
1153
|
-
}))).flat().filter((op) => !!op)
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1156
|
+
}))).flat().filter((op) => !!op);
|
|
1157
|
+
if (filteredOperations.length === 0) return;
|
|
1158
|
+
return {
|
|
1159
|
+
operations: filteredOperations,
|
|
1160
|
+
async commit() {
|
|
1161
|
+
await opt.backend.state.update(app.urn, appState);
|
|
1162
|
+
}
|
|
1163
|
+
};
|
|
1164
|
+
}
|
|
1158
1165
|
};
|
|
1159
1166
|
|
|
1160
1167
|
//#endregion
|
|
@@ -1328,11 +1335,12 @@ var WorkSpace = class {
|
|
|
1328
1335
|
await this.destroyProviders();
|
|
1329
1336
|
await releaseLock();
|
|
1330
1337
|
releaseExit();
|
|
1338
|
+
return;
|
|
1331
1339
|
}
|
|
1332
1340
|
return {
|
|
1333
|
-
operations: result
|
|
1341
|
+
operations: result.operations,
|
|
1334
1342
|
commit: async () => {
|
|
1335
|
-
await result
|
|
1343
|
+
await result.commit();
|
|
1336
1344
|
await this.destroyProviders();
|
|
1337
1345
|
await releaseLock();
|
|
1338
1346
|
releaseExit();
|