@terraforge/core 0.0.22 → 0.0.23

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 CHANGED
@@ -355,7 +355,7 @@ declare class WorkSpace {
355
355
  /**
356
356
  * Refresh the state of the resources & data-sources inside your app.
357
357
  */
358
- refresh(app: App): Promise<void>;
358
+ refresh(app: App, options?: ProcedureOptions): Promise<void>;
359
359
  /**
360
360
  * Get the status of all resources in the app by comparing current config with state file.
361
361
  */
package/dist/index.mjs CHANGED
@@ -1114,8 +1114,12 @@ const hydrate = async (app, opt) => {
1114
1114
  const refresh = async (app, opt) => {
1115
1115
  const appState = await opt.backend.state.get(app.urn);
1116
1116
  const queue = createConcurrencyQueue(opt.concurrency ?? 10);
1117
- if (appState) {
1118
- await Promise.all(Object.values(appState.stacks).map((stackState) => {
1117
+ let filteredStacks = [];
1118
+ if (opt.filters && opt.filters.length > 0) filteredStacks = Object.entries(appState?.stacks ?? {}).filter(([stackName]) => {
1119
+ return opt.filters.includes(stackName);
1120
+ }).map(([_, state]) => state);
1121
+ if (appState && filteredStacks.length > 0) {
1122
+ await Promise.all(filteredStacks.map((stackState) => {
1119
1123
  return Promise.all(Object.values(stackState.nodes).map((nodeState) => {
1120
1124
  return queue(async () => {
1121
1125
  const provider = findProvider(opt.providers, nodeState.provider);
@@ -1296,10 +1300,13 @@ var WorkSpace = class {
1296
1300
  /**
1297
1301
  * Refresh the state of the resources & data-sources inside your app.
1298
1302
  */
1299
- refresh(app) {
1303
+ refresh(app, options = {}) {
1300
1304
  return lockApp(this.props.backend.lock, app, async () => {
1301
1305
  try {
1302
- await refresh(app, this.props);
1306
+ await refresh(app, {
1307
+ ...this.props,
1308
+ ...options
1309
+ });
1303
1310
  } finally {
1304
1311
  await this.destroyProviders();
1305
1312
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@terraforge/core",
3
- "version": "0.0.22",
3
+ "version": "0.0.23",
4
4
  "type": "module",
5
5
  "repository": {
6
6
  "type": "git",