windmill-cli 1.723.0 → 1.725.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.
Files changed (2) hide show
  1. package/esm/main.js +423 -102
  2. package/package.json +1 -1
package/esm/main.js CHANGED
@@ -16772,7 +16772,7 @@ var init_OpenAPI = __esm(() => {
16772
16772
  PASSWORD: undefined,
16773
16773
  TOKEN: getEnv3("WM_TOKEN"),
16774
16774
  USERNAME: undefined,
16775
- VERSION: "1.723.0",
16775
+ VERSION: "1.725.0",
16776
16776
  WITH_CREDENTIALS: true,
16777
16777
  interceptors: {
16778
16778
  request: new Interceptors,
@@ -17081,6 +17081,7 @@ __export(exports_services_gen, {
17081
17081
  updateFlowHistory: () => updateFlowHistory,
17082
17082
  updateFlow: () => updateFlow,
17083
17083
  updateEmailTrigger: () => updateEmailTrigger,
17084
+ updateDraft: () => updateDraft,
17084
17085
  updateConfig: () => updateConfig,
17085
17086
  updateAzureTrigger: () => updateAzureTrigger,
17086
17087
  updateAppRaw: () => updateAppRaw,
@@ -17323,6 +17324,7 @@ __export(exports_services_gen, {
17323
17324
  listExtJwtTokens: () => listExtJwtTokens,
17324
17325
  listEmailTriggers: () => listEmailTriggers,
17325
17326
  listDucklakes: () => listDucklakes,
17327
+ listDrafts: () => listDrafts,
17326
17328
  listDeploymentRequestEligibleDeployers: () => listDeploymentRequestEligibleDeployers,
17327
17329
  listDedicatedWithDeps: () => listDedicatedWithDeps,
17328
17330
  listDataTables: () => listDataTables,
@@ -17412,7 +17414,6 @@ __export(exports_services_gen, {
17412
17414
  getScriptLatestVersion: () => getScriptLatestVersion,
17413
17415
  getScriptHistoryByPath: () => getScriptHistoryByPath,
17414
17416
  getScriptDeploymentStatus: () => getScriptDeploymentStatus,
17415
- getScriptByPathWithDraft: () => getScriptByPathWithDraft,
17416
17417
  getScriptByPath: () => getScriptByPath,
17417
17418
  getScriptByHash: () => getScriptByHash,
17418
17419
  getScheduledFor: () => getScheduledFor,
@@ -17508,10 +17509,10 @@ __export(exports_services_gen, {
17508
17509
  getFlowHistory: () => getFlowHistory,
17509
17510
  getFlowDeploymentStatus: () => getFlowDeploymentStatus,
17510
17511
  getFlowDebugInfo: () => getFlowDebugInfo,
17511
- getFlowByPathWithDraft: () => getFlowByPathWithDraft,
17512
17512
  getFlowByPath: () => getFlowByPath,
17513
17513
  getFlowAllLogs: () => getFlowAllLogs,
17514
17514
  getEmailTrigger: () => getEmailTrigger,
17515
+ getDraftForUser: () => getDraftForUser,
17515
17516
  getDeployTo: () => getDeployTo,
17516
17517
  getDependentsAmounts: () => getDependentsAmounts,
17517
17518
  getDependents: () => getDependents,
@@ -17550,7 +17551,6 @@ __export(exports_services_gen, {
17550
17551
  getAppLatestVersion: () => getAppLatestVersion,
17551
17552
  getAppHistoryByPath: () => getAppHistoryByPath,
17552
17553
  getAppByVersion: () => getAppByVersion,
17553
- getAppByPathWithDraft: () => getAppByPathWithDraft,
17554
17554
  getAppByPath: () => getAppByPath,
17555
17555
  generateOpenapiSpec: () => generateOpenapiSpec,
17556
17556
  generateNativeTriggerServiceConnectUrl: () => generateNativeTriggerServiceConnectUrl,
@@ -17664,7 +17664,6 @@ __export(exports_services_gen, {
17664
17664
  deleteFlowConversation: () => deleteFlowConversation,
17665
17665
  deleteFlowByPath: () => deleteFlowByPath,
17666
17666
  deleteEmailTrigger: () => deleteEmailTrigger,
17667
- deleteDraft: () => deleteDraft,
17668
17667
  deleteConfig: () => deleteConfig,
17669
17668
  deleteConcurrencyGroup: () => deleteConcurrencyGroup,
17670
17669
  deleteCompletedJob: () => deleteCompletedJob,
@@ -17712,7 +17711,6 @@ __export(exports_services_gen, {
17712
17711
  createFolder: () => createFolder,
17713
17712
  createFlow: () => createFlow,
17714
17713
  createEmailTrigger: () => createEmailTrigger,
17715
- createDraft: () => createDraft,
17716
17714
  createDeploymentRequestComment: () => createDeploymentRequestComment,
17717
17715
  createDeploymentRequest: () => createDeploymentRequest,
17718
17716
  createCustomerPortalSession: () => createCustomerPortalSession,
@@ -19506,7 +19504,8 @@ var backendVersion = () => {
19506
19504
  },
19507
19505
  query: {
19508
19506
  decrypt_secret: data3.decryptSecret,
19509
- include_encrypted: data3.includeEncrypted
19507
+ include_encrypted: data3.includeEncrypted,
19508
+ get_draft: data3.getDraft
19510
19509
  }
19511
19510
  });
19512
19511
  }, getVariableValue = (data3) => {
@@ -19545,7 +19544,8 @@ var backendVersion = () => {
19545
19544
  broad_filter: data3.broadFilter,
19546
19545
  page: data3.page,
19547
19546
  per_page: data3.perPage,
19548
- label: data3.label
19547
+ label: data3.label,
19548
+ include_draft_only: data3.includeDraftOnly
19549
19549
  }
19550
19550
  });
19551
19551
  }, listContextualVariables = (data3) => {
@@ -19960,6 +19960,9 @@ var backendVersion = () => {
19960
19960
  path: {
19961
19961
  workspace: data3.workspace,
19962
19962
  path: data3.path
19963
+ },
19964
+ query: {
19965
+ get_draft: data3.getDraft
19963
19966
  }
19964
19967
  });
19965
19968
  }, getResourceValueInterpolated = (data3) => {
@@ -20022,7 +20025,8 @@ var backendVersion = () => {
20022
20025
  description: data3.description,
20023
20026
  value: data3.value,
20024
20027
  broad_filter: data3.broadFilter,
20025
- label: data3.label
20028
+ label: data3.label,
20029
+ include_draft_only: data3.includeDraftOnly
20026
20030
  }
20027
20031
  });
20028
20032
  }, listSearchResource = (data3) => {
@@ -20318,26 +20322,42 @@ var backendVersion = () => {
20318
20322
  workspace: data3.workspace
20319
20323
  }
20320
20324
  });
20321
- }, createDraft = (data3) => {
20325
+ }, listDrafts = (data3) => {
20322
20326
  return request(OpenAPI, {
20323
- method: "POST",
20324
- url: "/w/{workspace}/drafts/create",
20327
+ method: "GET",
20328
+ url: "/w/{workspace}/drafts/list",
20325
20329
  path: {
20326
20330
  workspace: data3.workspace
20327
- },
20328
- body: data3.requestBody,
20329
- mediaType: "application/json"
20331
+ }
20330
20332
  });
20331
- }, deleteDraft = (data3) => {
20333
+ }, getDraftForUser = (data3) => {
20332
20334
  return request(OpenAPI, {
20333
- method: "DELETE",
20334
- url: "/w/{workspace}/drafts/delete/{kind}/{path}",
20335
+ method: "GET",
20336
+ url: "/w/{workspace}/drafts/get/{kind}/{path}",
20335
20337
  path: {
20336
20338
  workspace: data3.workspace,
20337
20339
  kind: data3.kind,
20338
20340
  path: data3.path
20341
+ },
20342
+ query: {
20343
+ username: data3.username
20344
+ },
20345
+ errors: {
20346
+ 404: "no draft for that owner at that path"
20339
20347
  }
20340
20348
  });
20349
+ }, updateDraft = (data3) => {
20350
+ return request(OpenAPI, {
20351
+ method: "POST",
20352
+ url: "/w/{workspace}/drafts/update/{kind}/{path}",
20353
+ path: {
20354
+ workspace: data3.workspace,
20355
+ kind: data3.kind,
20356
+ path: data3.path
20357
+ },
20358
+ body: data3.requestBody,
20359
+ mediaType: "application/json"
20360
+ });
20341
20361
  }, createScript = (data3) => {
20342
20362
  return request(OpenAPI, {
20343
20363
  method: "POST",
@@ -20497,7 +20517,8 @@ var backendVersion = () => {
20497
20517
  path: data3.path
20498
20518
  },
20499
20519
  query: {
20500
- with_starred_info: data3.withStarredInfo
20520
+ with_starred_info: data3.withStarredInfo,
20521
+ get_draft: data3.getDraft
20501
20522
  }
20502
20523
  });
20503
20524
  }, getTriggersCountOfScript = (data3) => {
@@ -20518,15 +20539,6 @@ var backendVersion = () => {
20518
20539
  path: data3.path
20519
20540
  }
20520
20541
  });
20521
- }, getScriptByPathWithDraft = (data3) => {
20522
- return request(OpenAPI, {
20523
- method: "GET",
20524
- url: "/w/{workspace}/scripts/get/draft/{path}",
20525
- path: {
20526
- workspace: data3.workspace,
20527
- path: data3.path
20528
- }
20529
- });
20530
20542
  }, getScriptHistoryByPath = (data3) => {
20531
20543
  return request(OpenAPI, {
20532
20544
  method: "GET",
@@ -21070,7 +21082,8 @@ var backendVersion = () => {
21070
21082
  path: data3.path
21071
21083
  },
21072
21084
  query: {
21073
- with_starred_info: data3.withStarredInfo
21085
+ with_starred_info: data3.withStarredInfo,
21086
+ get_draft: data3.getDraft
21074
21087
  }
21075
21088
  });
21076
21089
  }, getFlowDeploymentStatus = (data3) => {
@@ -21111,15 +21124,6 @@ var backendVersion = () => {
21111
21124
  body: data3.requestBody,
21112
21125
  mediaType: "application/json"
21113
21126
  });
21114
- }, getFlowByPathWithDraft = (data3) => {
21115
- return request(OpenAPI, {
21116
- method: "GET",
21117
- url: "/w/{workspace}/flows/get/draft/{path}",
21118
- path: {
21119
- workspace: data3.workspace,
21120
- path: data3.path
21121
- }
21122
- });
21123
21127
  }, existsFlowByPath = (data3) => {
21124
21128
  return request(OpenAPI, {
21125
21129
  method: "GET",
@@ -21235,7 +21239,8 @@ var backendVersion = () => {
21235
21239
  path_start: data3.pathStart,
21236
21240
  path_exact: data3.pathExact,
21237
21241
  starred_only: data3.starredOnly,
21238
- label: data3.label
21242
+ label: data3.label,
21243
+ include_draft_only: data3.includeDraftOnly
21239
21244
  }
21240
21245
  });
21241
21246
  }, getSharedUi = (data3) => {
@@ -21347,7 +21352,9 @@ var backendVersion = () => {
21347
21352
  path: data3.path
21348
21353
  },
21349
21354
  query: {
21350
- with_starred_info: data3.withStarredInfo
21355
+ with_starred_info: data3.withStarredInfo,
21356
+ get_draft: data3.getDraft,
21357
+ raw_app: data3.rawApp
21351
21358
  }
21352
21359
  });
21353
21360
  }, getAppLiteByPath = (data3) => {
@@ -21359,15 +21366,6 @@ var backendVersion = () => {
21359
21366
  path: data3.path
21360
21367
  }
21361
21368
  });
21362
- }, getAppByPathWithDraft = (data3) => {
21363
- return request(OpenAPI, {
21364
- method: "GET",
21365
- url: "/w/{workspace}/apps/get/draft/{path}",
21366
- path: {
21367
- workspace: data3.workspace,
21368
- path: data3.path
21369
- }
21370
- });
21371
21369
  }, getAppHistoryByPath = (data3) => {
21372
21370
  return request(OpenAPI, {
21373
21371
  method: "GET",
@@ -22598,6 +22596,9 @@ var backendVersion = () => {
22598
22596
  path: {
22599
22597
  workspace: data3.workspace,
22600
22598
  path: data3.path
22599
+ },
22600
+ query: {
22601
+ get_draft: data3.getDraft
22601
22602
  }
22602
22603
  });
22603
22604
  }, existsSchedule = (data3) => {
@@ -22627,7 +22628,8 @@ var backendVersion = () => {
22627
22628
  description: data3.description,
22628
22629
  summary: data3.summary,
22629
22630
  broad_filter: data3.broadFilter,
22630
- label: data3.label
22631
+ label: data3.label,
22632
+ include_draft_only: data3.includeDraftOnly
22631
22633
  }
22632
22634
  });
22633
22635
  }, listSchedulesWithJobs = (data3) => {
@@ -22719,6 +22721,9 @@ var backendVersion = () => {
22719
22721
  path: {
22720
22722
  workspace: data3.workspace,
22721
22723
  path: data3.path
22724
+ },
22725
+ query: {
22726
+ get_draft: data3.getDraft
22722
22727
  }
22723
22728
  });
22724
22729
  }, listHttpTriggers = (data3) => {
@@ -22734,7 +22739,8 @@ var backendVersion = () => {
22734
22739
  path: data3.path,
22735
22740
  is_flow: data3.isFlow,
22736
22741
  path_start: data3.pathStart,
22737
- label: data3.label
22742
+ label: data3.label,
22743
+ include_draft_only: data3.includeDraftOnly
22738
22744
  }
22739
22745
  });
22740
22746
  }, existsHttpTrigger = (data3) => {
@@ -22804,6 +22810,9 @@ var backendVersion = () => {
22804
22810
  path: {
22805
22811
  workspace: data3.workspace,
22806
22812
  path: data3.path
22813
+ },
22814
+ query: {
22815
+ get_draft: data3.getDraft
22807
22816
  }
22808
22817
  });
22809
22818
  }, listWebsocketTriggers = (data3) => {
@@ -22819,7 +22828,8 @@ var backendVersion = () => {
22819
22828
  path: data3.path,
22820
22829
  is_flow: data3.isFlow,
22821
22830
  path_start: data3.pathStart,
22822
- label: data3.label
22831
+ label: data3.label,
22832
+ include_draft_only: data3.includeDraftOnly
22823
22833
  }
22824
22834
  });
22825
22835
  }, existsWebsocketTrigger = (data3) => {
@@ -22889,6 +22899,9 @@ var backendVersion = () => {
22889
22899
  path: {
22890
22900
  workspace: data3.workspace,
22891
22901
  path: data3.path
22902
+ },
22903
+ query: {
22904
+ get_draft: data3.getDraft
22892
22905
  }
22893
22906
  });
22894
22907
  }, listKafkaTriggers = (data3) => {
@@ -22904,7 +22917,8 @@ var backendVersion = () => {
22904
22917
  path: data3.path,
22905
22918
  is_flow: data3.isFlow,
22906
22919
  path_start: data3.pathStart,
22907
- label: data3.label
22920
+ label: data3.label,
22921
+ include_draft_only: data3.includeDraftOnly
22908
22922
  }
22909
22923
  });
22910
22924
  }, existsKafkaTrigger = (data3) => {
@@ -22994,6 +23008,9 @@ var backendVersion = () => {
22994
23008
  path: {
22995
23009
  workspace: data3.workspace,
22996
23010
  path: data3.path
23011
+ },
23012
+ query: {
23013
+ get_draft: data3.getDraft
22997
23014
  }
22998
23015
  });
22999
23016
  }, listNatsTriggers = (data3) => {
@@ -23009,7 +23026,8 @@ var backendVersion = () => {
23009
23026
  path: data3.path,
23010
23027
  is_flow: data3.isFlow,
23011
23028
  path_start: data3.pathStart,
23012
- label: data3.label
23029
+ label: data3.label,
23030
+ include_draft_only: data3.includeDraftOnly
23013
23031
  }
23014
23032
  });
23015
23033
  }, existsNatsTrigger = (data3) => {
@@ -23079,6 +23097,9 @@ var backendVersion = () => {
23079
23097
  path: {
23080
23098
  workspace: data3.workspace,
23081
23099
  path: data3.path
23100
+ },
23101
+ query: {
23102
+ get_draft: data3.getDraft
23082
23103
  }
23083
23104
  });
23084
23105
  }, listSqsTriggers = (data3) => {
@@ -23094,7 +23115,8 @@ var backendVersion = () => {
23094
23115
  path: data3.path,
23095
23116
  is_flow: data3.isFlow,
23096
23117
  path_start: data3.pathStart,
23097
- label: data3.label
23118
+ label: data3.label,
23119
+ include_draft_only: data3.includeDraftOnly
23098
23120
  }
23099
23121
  });
23100
23122
  }, existsSqsTrigger = (data3) => {
@@ -23262,7 +23284,8 @@ var backendVersion = () => {
23262
23284
  per_page: data3.perPage,
23263
23285
  path: data3.path,
23264
23286
  is_flow: data3.isFlow,
23265
- label: data3.label
23287
+ label: data3.label,
23288
+ include_draft_only: data3.includeDraftOnly
23266
23289
  }
23267
23290
  });
23268
23291
  }, existsNativeTrigger = (data3) => {
@@ -23379,6 +23402,9 @@ var backendVersion = () => {
23379
23402
  path: {
23380
23403
  workspace: data3.workspace,
23381
23404
  path: data3.path
23405
+ },
23406
+ query: {
23407
+ get_draft: data3.getDraft
23382
23408
  }
23383
23409
  });
23384
23410
  }, listMqttTriggers = (data3) => {
@@ -23394,7 +23420,8 @@ var backendVersion = () => {
23394
23420
  path: data3.path,
23395
23421
  is_flow: data3.isFlow,
23396
23422
  path_start: data3.pathStart,
23397
- label: data3.label
23423
+ label: data3.label,
23424
+ include_draft_only: data3.includeDraftOnly
23398
23425
  }
23399
23426
  });
23400
23427
  }, existsMqttTrigger = (data3) => {
@@ -23464,6 +23491,9 @@ var backendVersion = () => {
23464
23491
  path: {
23465
23492
  workspace: data3.workspace,
23466
23493
  path: data3.path
23494
+ },
23495
+ query: {
23496
+ get_draft: data3.getDraft
23467
23497
  }
23468
23498
  });
23469
23499
  }, listGcpTriggers = (data3) => {
@@ -23479,7 +23509,8 @@ var backendVersion = () => {
23479
23509
  path: data3.path,
23480
23510
  is_flow: data3.isFlow,
23481
23511
  path_start: data3.pathStart,
23482
- label: data3.label
23512
+ label: data3.label,
23513
+ include_draft_only: data3.includeDraftOnly
23483
23514
  }
23484
23515
  });
23485
23516
  }, existsGcpTrigger = (data3) => {
@@ -23580,6 +23611,9 @@ var backendVersion = () => {
23580
23611
  path: {
23581
23612
  workspace: data3.workspace,
23582
23613
  path: data3.path
23614
+ },
23615
+ query: {
23616
+ get_draft: data3.getDraft
23583
23617
  }
23584
23618
  });
23585
23619
  }, listAzureTriggers = (data3) => {
@@ -23594,7 +23628,8 @@ var backendVersion = () => {
23594
23628
  per_page: data3.perPage,
23595
23629
  path: data3.path,
23596
23630
  is_flow: data3.isFlow,
23597
- path_start: data3.pathStart
23631
+ path_start: data3.pathStart,
23632
+ include_draft_only: data3.includeDraftOnly
23598
23633
  }
23599
23634
  });
23600
23635
  }, existsAzureTrigger = (data3) => {
@@ -23836,6 +23871,9 @@ var backendVersion = () => {
23836
23871
  path: {
23837
23872
  workspace: data3.workspace,
23838
23873
  path: data3.path
23874
+ },
23875
+ query: {
23876
+ get_draft: data3.getDraft
23839
23877
  }
23840
23878
  });
23841
23879
  }, listPostgresTriggers = (data3) => {
@@ -23851,7 +23889,8 @@ var backendVersion = () => {
23851
23889
  path: data3.path,
23852
23890
  is_flow: data3.isFlow,
23853
23891
  path_start: data3.pathStart,
23854
- label: data3.label
23892
+ label: data3.label,
23893
+ include_draft_only: data3.includeDraftOnly
23855
23894
  }
23856
23895
  });
23857
23896
  }, existsPostgresTrigger = (data3) => {
@@ -23921,6 +23960,9 @@ var backendVersion = () => {
23921
23960
  path: {
23922
23961
  workspace: data3.workspace,
23923
23962
  path: data3.path
23963
+ },
23964
+ query: {
23965
+ get_draft: data3.getDraft
23924
23966
  }
23925
23967
  });
23926
23968
  }, listEmailTriggers = (data3) => {
@@ -23936,7 +23978,8 @@ var backendVersion = () => {
23936
23978
  path: data3.path,
23937
23979
  is_flow: data3.isFlow,
23938
23980
  path_start: data3.pathStart,
23939
- label: data3.label
23981
+ label: data3.label,
23982
+ include_draft_only: data3.includeDraftOnly
23940
23983
  }
23941
23984
  });
23942
23985
  }, existsEmailTrigger = (data3) => {
@@ -25304,7 +25347,7 @@ var init_auth = __esm(async () => {
25304
25347
  });
25305
25348
 
25306
25349
  // src/core/constants.ts
25307
- var WM_FORK_PREFIX = "wm-fork", VERSION = "1.723.0";
25350
+ var WM_FORK_PREFIX = "wm-fork", VERSION = "1.725.0";
25308
25351
 
25309
25352
  // src/utils/git.ts
25310
25353
  var exports_git = {};
@@ -62847,14 +62890,27 @@ function extractRawscriptInline(id, summary, rawscript, mapping, separator, assi
62847
62890
  rawscript.content = "!inline " + path6.replaceAll(separator, "/");
62848
62891
  const lock = rawscript.lock;
62849
62892
  if (lock && lock != "") {
62850
- const dotIdx = mappedPath ? mappedPath.lastIndexOf(".") : -1;
62851
- const lockBasePath = mappedPath ? dotIdx > 0 ? mappedPath.substring(0, dotIdx + 1) : mappedPath + "." : basePath;
62893
+ const lockBasePath = mappedPath ? lockBasePathForContent(mappedPath, language) : basePath;
62852
62894
  const lockPath = lockBasePath + "lock";
62853
62895
  rawscript.lock = "!inline " + lockPath.replaceAll(separator, "/");
62854
62896
  r.push({ path: lockPath, content: lock, language, is_lock: true });
62855
62897
  }
62856
62898
  return r;
62857
62899
  }
62900
+ function lockBasePathForContent(contentPath, language) {
62901
+ const langExt = LANGUAGE_EXTENSIONS[language];
62902
+ if (langExt && contentPath.endsWith("." + langExt)) {
62903
+ return contentPath.substring(0, contentPath.length - langExt.length);
62904
+ }
62905
+ const dotIdx = contentPath.lastIndexOf(".");
62906
+ return dotIdx > 0 ? contentPath.substring(0, dotIdx + 1) : contentPath + ".";
62907
+ }
62908
+ function legacyLockPathForContent(contentPath, language) {
62909
+ const dotIdx = contentPath.lastIndexOf(".");
62910
+ const legacy = (dotIdx > 0 ? contentPath.substring(0, dotIdx + 1) : contentPath + ".") + "lock";
62911
+ const canonical = lockBasePathForContent(contentPath, language) + "lock";
62912
+ return legacy === canonical ? undefined : legacy;
62913
+ }
62858
62914
  function extractInlineScripts(modules, mapping = {}, separator = "/", defaultTs, pathAssigner, options) {
62859
62915
  const assigner = pathAssigner ?? newPathAssigner(defaultTs ?? "bun", { skipInlineScriptSuffix: options?.skipInlineScriptSuffix });
62860
62916
  const failOnInlineDirective = options?.failOnInlineDirective ?? false;
@@ -63103,6 +63159,8 @@ function collectPathScriptPaths(flowValue) {
63103
63159
  }
63104
63160
 
63105
63161
  // src/commands/flow/flow_metadata.ts
63162
+ import { existsSync as existsSync4 } from "node:fs";
63163
+ import { rm } from "node:fs/promises";
63106
63164
  import * as path6 from "node:path";
63107
63165
  import { sep as SEP4 } from "node:path";
63108
63166
  async function isFlowDirectlyStale(folder, hashes, conf) {
@@ -63260,6 +63318,22 @@ async function generateFlowLockInternal(folder, dryRun, workspace, opts, justUpd
63260
63318
  inlineScripts.forEach((s) => {
63261
63319
  writeIfChanged(process.cwd() + SEP4 + folder + SEP4 + s.path, s.content);
63262
63320
  });
63321
+ for (const s of inlineScripts) {
63322
+ if (s.is_lock)
63323
+ continue;
63324
+ const legacyRelPath = legacyLockPathForContent(s.path, s.language);
63325
+ if (!legacyRelPath)
63326
+ continue;
63327
+ const legacyAbsPath = process.cwd() + SEP4 + folder + SEP4 + legacyRelPath;
63328
+ if (existsSync4(legacyAbsPath)) {
63329
+ try {
63330
+ await rm(legacyAbsPath);
63331
+ info(colors.gray(`Removed legacy lock file ${legacyRelPath} (renamed to canonical name)`));
63332
+ } catch (e) {
63333
+ info(colors.yellow(`Failed to remove legacy lock file ${legacyRelPath}: ${e}`));
63334
+ }
63335
+ }
63336
+ }
63263
63337
  writeIfChanged(process.cwd() + SEP4 + folder + SEP4 + "flow.yaml", import_yaml6.stringify(flowValue, yamlOptions));
63264
63338
  }
63265
63339
  const depsForHash = tree ? {} : filteredDeps;
@@ -65916,7 +65990,7 @@ __export(exports_sync, {
65916
65990
  canonicalizeCaseInsensitiveKeys: () => canonicalizeCaseInsensitiveKeys,
65917
65991
  FSFSElement: () => FSFSElement
65918
65992
  });
65919
- import { writeFile as writeFile7, readdir as readdir4, stat as stat7, rm, copyFile, mkdir as mkdir5 } from "node:fs/promises";
65993
+ import { writeFile as writeFile7, readdir as readdir4, stat as stat7, rm as rm2, copyFile, mkdir as mkdir5 } from "node:fs/promises";
65920
65994
  import * as path10 from "node:path";
65921
65995
  import { sep as SEP9 } from "node:path";
65922
65996
  function configKeyForItemKind(kind) {
@@ -67219,8 +67293,8 @@ async function isCaseInsensitiveFilesystem(dir) {
67219
67293
  } catch {
67220
67294
  result = false;
67221
67295
  }
67222
- await rm(upper).catch(() => {});
67223
- await rm(lower).catch(() => {});
67296
+ await rm2(upper).catch(() => {});
67297
+ await rm2(lower).catch(() => {});
67224
67298
  } catch {
67225
67299
  result = false;
67226
67300
  }
@@ -67794,13 +67868,13 @@ Both local and remote have been modified.`));
67794
67868
  } else if (change.name === "deleted") {
67795
67869
  try {
67796
67870
  info(`Deleting ${getTypeStrFromPath(change.path)} ${change.path}`);
67797
- await rm(target);
67871
+ await rm2(target);
67798
67872
  if (opts.stateful) {
67799
- await rm(stateTarget);
67873
+ await rm2(stateTarget);
67800
67874
  }
67801
67875
  } catch {
67802
67876
  if (opts.stateful) {
67803
- await rm(stateTarget);
67877
+ await rm2(stateTarget);
67804
67878
  }
67805
67879
  }
67806
67880
  }
@@ -68770,7 +68844,7 @@ Run 'wmill folder add-missing' to create them locally, then push again.`;
68770
68844
  }
68771
68845
  if (stateTarget) {
68772
68846
  try {
68773
- await rm(stateTarget);
68847
+ await rm2(stateTarget);
68774
68848
  } catch {}
68775
68849
  }
68776
68850
  } else if (change.name === "ws_specific_flag") {
@@ -69116,8 +69190,8 @@ var init_parse_schema = __esm(() => {
69116
69190
 
69117
69191
  // src/utils/metadata.ts
69118
69192
  import { sep as SEP10 } from "node:path";
69119
- import { writeFile as writeFile8, stat as stat8, rm as rm2, readdir as readdir5 } from "node:fs/promises";
69120
- import { readFileSync as readFileSync2, existsSync as existsSync5, readdirSync, statSync, writeFileSync as writeFileSync4 } from "node:fs";
69193
+ import { writeFile as writeFile8, stat as stat8, rm as rm3, readdir as readdir5 } from "node:fs/promises";
69194
+ import { readFileSync as readFileSync2, existsSync as existsSync6, readdirSync, statSync, writeFileSync as writeFileSync4 } from "node:fs";
69121
69195
  import * as path11 from "node:path";
69122
69196
  import { createRequire as createRequire2 } from "node:module";
69123
69197
  function loadParser(pkgName) {
@@ -69216,7 +69290,7 @@ async function generateScriptMetadataInternal(scriptPath, workspace, opts, dryRu
69216
69290
  const metadataContent = await readTextFile(metadataWithType.path);
69217
69291
  const filteredRawWorkspaceDependencies = filterWorkspaceDependencies(rawWorkspaceDependencies, scriptContent, language);
69218
69292
  const moduleFolderPath = isFolderLayout ? path11.dirname(scriptPath) : scriptPath.substring(0, scriptPath.indexOf(".")) + getModuleFolderSuffix();
69219
- const hasModules = existsSync5(moduleFolderPath) && statSync(moduleFolderPath).isDirectory();
69293
+ const hasModules = existsSync6(moduleFolderPath) && statSync(moduleFolderPath).isDirectory();
69220
69294
  const depsForHash = tree ? {} : filteredRawWorkspaceDependencies;
69221
69295
  let hash2 = await generateScriptHash(depsForHash, scriptContent, metadataContent);
69222
69296
  let moduleHashes = {};
@@ -69521,7 +69595,7 @@ async function updateScriptLock(workspace, scriptContent, language, remotePath,
69521
69595
  } else {
69522
69596
  try {
69523
69597
  if (await stat8(lockPath)) {
69524
- await rm2(lockPath);
69598
+ await rm3(lockPath);
69525
69599
  }
69526
69600
  } catch (e) {
69527
69601
  info(colors.yellow(`Error removing lock file ${lockPath}: ${e}`));
@@ -69561,7 +69635,7 @@ async function updateModuleLocks(workspace, dirPath, relPrefix, scriptRemotePath
69561
69635
  writeFileSync4(lockPath, lock, "utf-8");
69562
69636
  } else {
69563
69637
  try {
69564
- if (existsSync5(lockPath)) {
69638
+ if (existsSync6(lockPath)) {
69565
69639
  const { rm: rmAsync } = await import("node:fs/promises");
69566
69640
  await rmAsync(lockPath);
69567
69641
  }
@@ -72442,7 +72516,7 @@ var init_lint2 = __esm(async () => {
72442
72516
  });
72443
72517
 
72444
72518
  // src/commands/app/new.ts
72445
- import { stat as stat9, writeFile as writeFile10, mkdir as mkdir7, rm as rm3 } from "node:fs/promises";
72519
+ import { stat as stat9, writeFile as writeFile10, mkdir as mkdir7, rm as rm4 } from "node:fs/promises";
72446
72520
  import path17 from "node:path";
72447
72521
  import { execSync as execSync5, exec, execFile as execFile6 } from "node:child_process";
72448
72522
  function validateAppPath(appPath) {
@@ -72721,7 +72795,7 @@ CREATE SCHEMA IF NOT EXISTS ${schemaName};
72721
72795
  return;
72722
72796
  }
72723
72797
  }
72724
- await rm3(appDir, { recursive: true, force: true });
72798
+ await rm4(appDir, { recursive: true, force: true });
72725
72799
  }
72726
72800
  await mkdir7(appDir, { recursive: true });
72727
72801
  await mkdir7(path17.join(appDir, "backend"), { recursive: true });
@@ -73740,24 +73814,51 @@ async function add2(opts, value, remotePath) {
73740
73814
  if (!validatePath(remotePath)) {
73741
73815
  return;
73742
73816
  }
73817
+ const isSecret = opts.secret ?? (opts.public ? false : undefined);
73743
73818
  if (await existsVariable({
73744
73819
  workspace: workspace.workspaceId,
73745
73820
  path: remotePath
73746
73821
  })) {
73747
- if (!await Confirm.prompt({
73822
+ if (!opts.yes && !await Confirm.prompt({
73748
73823
  message: `Variable already exist, do you want to update its value?`,
73749
73824
  default: true
73750
73825
  })) {
73751
73826
  return;
73752
73827
  }
73828
+ if (isSecret === false) {
73829
+ const existing = await getVariable({
73830
+ workspace: workspace.workspaceId,
73831
+ path: remotePath,
73832
+ decryptSecret: false
73833
+ });
73834
+ if (existing.is_secret) {
73835
+ warn(colors.yellow(`Variable ${remotePath} is currently secret and will be downgraded to non-secret: its value will be stored in plaintext`));
73836
+ }
73837
+ }
73753
73838
  info(colors.bold.yellow("Updating variable..."));
73839
+ await updateVariable({
73840
+ workspace: workspace.workspaceId,
73841
+ path: remotePath,
73842
+ alreadyEncrypted: false,
73843
+ requestBody: {
73844
+ value,
73845
+ ...isSecret !== undefined ? { is_secret: isSecret } : {},
73846
+ ...opts.description !== undefined ? { description: opts.description } : {}
73847
+ }
73848
+ });
73849
+ } else {
73850
+ info(colors.bold.yellow("Creating variable..."));
73851
+ await createVariable({
73852
+ workspace: workspace.workspaceId,
73853
+ alreadyEncrypted: false,
73854
+ requestBody: {
73855
+ path: remotePath,
73856
+ value,
73857
+ is_secret: isSecret ?? true,
73858
+ description: opts.description ?? ""
73859
+ }
73860
+ });
73754
73861
  }
73755
- info(colors.bold.yellow("Pushing variable..."));
73756
- await pushVariable(workspace.workspaceId, remotePath + ".variable.yaml", undefined, {
73757
- value,
73758
- is_secret: !opts.public,
73759
- description: ""
73760
- }, true);
73761
73862
  info(colors.bold.underline.green(`Variable ${remotePath} pushed`));
73762
73863
  }
73763
73864
  var import_yaml25, command15, variable_default;
@@ -73774,7 +73875,7 @@ var init_variable = __esm(async () => {
73774
73875
  init_confirm()
73775
73876
  ]);
73776
73877
  import_yaml25 = __toESM(require_dist(), 1);
73777
- command15 = new Command().description("variable related commands").option("--json", "Output as JSON (for piping to jq)").action(list8).command("list", "list all variables").option("--json", "Output as JSON (for piping to jq)").action(list8).command("get", "get a variable's details").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(get6).command("new", "create a new variable locally").arguments("<path:string>").action(newVariable).command("push", "Push a local variable spec. This overrides any remote versions.").arguments("<file_path:string> <remote_path:string>").option("--plain-secrets", "Push secrets as plain text").action(push7).command("add", "Create a new variable on the remote. This will update the variable if it already exists.").arguments("<value:string> <remote_path:string>").option("--plain-secrets", "Push secrets as plain text").option("--public", "Legacy option, use --plain-secrets instead").action(add2);
73878
+ command15 = new Command().description("variable related commands").option("--json", "Output as JSON (for piping to jq)").action(list8).command("list", "list all variables").option("--json", "Output as JSON (for piping to jq)").action(list8).command("get", "get a variable's details").arguments("<path:string>").option("--json", "Output as JSON (for piping to jq)").action(get6).command("new", "create a new variable locally").arguments("<path:string>").action(newVariable).command("push", "Push a local variable spec. This overrides any remote versions.").arguments("<file_path:string> <remote_path:string>").option("--plain-secrets", "Push secrets as plain text").action(push7).command("add", "Create a new variable on the remote. This will update the variable if it already exists.").arguments("<value:string> <remote_path:string>").option("--yes", "Skip confirmation prompt when updating an existing variable").option("--secret", "Mark the variable as secret (default when creating a new variable)").option("--no-secret", "Mark the variable as non-secret (when updating, the existing setting is preserved if neither --secret nor --no-secret is passed)").option("--description <description:string>", "Set the variable description (when updating, the existing description is preserved if not passed)").option("--plain-secrets", "Push secrets as plain text").option("--public", "Legacy option, use --no-secret instead").action(add2);
73778
73879
  variable_default = command15;
73779
73880
  });
73780
73881
 
@@ -74607,7 +74708,7 @@ var init_settings = __esm(async () => {
74607
74708
  });
74608
74709
 
74609
74710
  // src/commands/instance/instance.ts
74610
- import { writeFile as writeFile15, readdir as readdir9, mkdir as mkdir11, rm as rm4, stat as stat14 } from "node:fs/promises";
74711
+ import { writeFile as writeFile15, readdir as readdir9, mkdir as mkdir11, rm as rm5, stat as stat14 } from "node:fs/promises";
74611
74712
  import { appendFile } from "node:fs/promises";
74612
74713
  import * as path18 from "node:path";
74613
74714
  async function allInstances() {
@@ -74873,7 +74974,7 @@ Pulling workspace ` + remoteWorkspace.id);
74873
74974
  if (confirmDelete) {
74874
74975
  for (const workspace of localWorkspacesToDelete) {
74875
74976
  await removeWorkspace(workspace.id, false, {});
74876
- await rm4(path18.join(rootDir, workspace.dir), {
74977
+ await rm5(path18.join(rootDir, workspace.dir), {
74877
74978
  recursive: true
74878
74979
  });
74879
74980
  }
@@ -85054,8 +85155,12 @@ variable related commands
85054
85155
  - \`variable push <file_path:string> <remote_path:string>\` - Push a local variable spec. This overrides any remote versions.
85055
85156
  - \`--plain-secrets\` - Push secrets as plain text
85056
85157
  - \`variable add <value:string> <remote_path:string>\` - Create a new variable on the remote. This will update the variable if it already exists.
85158
+ - \`--yes\` - Skip confirmation prompt when updating an existing variable
85159
+ - \`--secret\` - Mark the variable as secret (default when creating a new variable)
85160
+ - \`--no-secret\` - Mark the variable as non-secret (when updating, the existing setting is preserved if neither --secret nor --no-secret is passed)
85161
+ - \`--description <description:string>\` - Set the variable description (when updating, the existing description is preserved if not passed)
85057
85162
  - \`--plain-secrets\` - Push secrets as plain text
85058
- - \`--public\` - Legacy option, use --plain-secrets instead
85163
+ - \`--public\` - Legacy option, use --no-secret instead
85059
85164
 
85060
85165
  ### version
85061
85166
 
@@ -85295,6 +85400,26 @@ properties:
85295
85400
  type: array
85296
85401
  items:
85297
85402
  type: string
85403
+ draft_only:
85404
+ type: boolean
85405
+ description: 'True when this row is a per-user draft with no deployed
85406
+
85407
+ trigger at the same path. Set by list endpoints when
85408
+
85409
+ \`include_draft_only=true\` synthesizes the row from the
85410
+
85411
+ draft. Frontend renders a "Draft" badge.
85412
+
85413
+ '
85414
+ is_draft:
85415
+ type: boolean
85416
+ description: 'True when the authed user has a per-user draft at this path
85417
+
85418
+ (over a deployed row or a synthesized draft-only row).
85419
+
85420
+ Frontend appends a \`*\` to the displayed name.
85421
+
85422
+ '
85298
85423
  azure_resource_path:
85299
85424
  type: string
85300
85425
  azure_mode:
@@ -85380,6 +85505,26 @@ properties:
85380
85505
  type: array
85381
85506
  items:
85382
85507
  type: string
85508
+ draft_only:
85509
+ type: boolean
85510
+ description: 'True when this row is a per-user draft with no deployed
85511
+
85512
+ trigger at the same path. Set by list endpoints when
85513
+
85514
+ \`include_draft_only=true\` synthesizes the row from the
85515
+
85516
+ draft. Frontend renders a "Draft" badge.
85517
+
85518
+ '
85519
+ is_draft:
85520
+ type: boolean
85521
+ description: 'True when the authed user has a per-user draft at this path
85522
+
85523
+ (over a deployed row or a synthesized draft-only row).
85524
+
85525
+ Frontend appends a \`*\` to the displayed name.
85526
+
85527
+ '
85383
85528
  local_part:
85384
85529
  type: string
85385
85530
  workspaced_local_part:
@@ -85445,6 +85590,26 @@ properties:
85445
85590
  type: array
85446
85591
  items:
85447
85592
  type: string
85593
+ draft_only:
85594
+ type: boolean
85595
+ description: 'True when this row is a per-user draft with no deployed
85596
+
85597
+ trigger at the same path. Set by list endpoints when
85598
+
85599
+ \`include_draft_only=true\` synthesizes the row from the
85600
+
85601
+ draft. Frontend renders a "Draft" badge.
85602
+
85603
+ '
85604
+ is_draft:
85605
+ type: boolean
85606
+ description: 'True when the authed user has a per-user draft at this path
85607
+
85608
+ (over a deployed row or a synthesized draft-only row).
85609
+
85610
+ Frontend appends a \`*\` to the displayed name.
85611
+
85612
+ '
85448
85613
  gcp_resource_path:
85449
85614
  type: string
85450
85615
  description: Path to the GCP resource containing service account credentials for
@@ -85546,6 +85711,26 @@ properties:
85546
85711
  type: array
85547
85712
  items:
85548
85713
  type: string
85714
+ draft_only:
85715
+ type: boolean
85716
+ description: 'True when this row is a per-user draft with no deployed
85717
+
85718
+ trigger at the same path. Set by list endpoints when
85719
+
85720
+ \`include_draft_only=true\` synthesizes the row from the
85721
+
85722
+ draft. Frontend renders a "Draft" badge.
85723
+
85724
+ '
85725
+ is_draft:
85726
+ type: boolean
85727
+ description: 'True when the authed user has a per-user draft at this path
85728
+
85729
+ (over a deployed row or a synthesized draft-only row).
85730
+
85731
+ Frontend appends a \`*\` to the displayed name.
85732
+
85733
+ '
85549
85734
  route_path:
85550
85735
  type: string
85551
85736
  description: The URL route path that will trigger this endpoint (e.g., 'api/myendpoint').
@@ -85680,6 +85865,26 @@ properties:
85680
85865
  type: array
85681
85866
  items:
85682
85867
  type: string
85868
+ draft_only:
85869
+ type: boolean
85870
+ description: 'True when this row is a per-user draft with no deployed
85871
+
85872
+ trigger at the same path. Set by list endpoints when
85873
+
85874
+ \`include_draft_only=true\` synthesizes the row from the
85875
+
85876
+ draft. Frontend renders a "Draft" badge.
85877
+
85878
+ '
85879
+ is_draft:
85880
+ type: boolean
85881
+ description: 'True when the authed user has a per-user draft at this path
85882
+
85883
+ (over a deployed row or a synthesized draft-only row).
85884
+
85885
+ Frontend appends a \`*\` to the displayed name.
85886
+
85887
+ '
85683
85888
  kafka_resource_path:
85684
85889
  type: string
85685
85890
  description: Path to the Kafka resource containing connection configuration
@@ -85783,6 +85988,26 @@ properties:
85783
85988
  type: array
85784
85989
  items:
85785
85990
  type: string
85991
+ draft_only:
85992
+ type: boolean
85993
+ description: 'True when this row is a per-user draft with no deployed
85994
+
85995
+ trigger at the same path. Set by list endpoints when
85996
+
85997
+ \`include_draft_only=true\` synthesizes the row from the
85998
+
85999
+ draft. Frontend renders a "Draft" badge.
86000
+
86001
+ '
86002
+ is_draft:
86003
+ type: boolean
86004
+ description: 'True when the authed user has a per-user draft at this path
86005
+
86006
+ (over a deployed row or a synthesized draft-only row).
86007
+
86008
+ Frontend appends a \`*\` to the displayed name.
86009
+
86010
+ '
85786
86011
  mqtt_resource_path:
85787
86012
  type: string
85788
86013
  description: Path to the MQTT resource containing broker connection configuration
@@ -85877,6 +86102,26 @@ properties:
85877
86102
  type: array
85878
86103
  items:
85879
86104
  type: string
86105
+ draft_only:
86106
+ type: boolean
86107
+ description: 'True when this row is a per-user draft with no deployed
86108
+
86109
+ trigger at the same path. Set by list endpoints when
86110
+
86111
+ \`include_draft_only=true\` synthesizes the row from the
86112
+
86113
+ draft. Frontend renders a "Draft" badge.
86114
+
86115
+ '
86116
+ is_draft:
86117
+ type: boolean
86118
+ description: 'True when the authed user has a per-user draft at this path
86119
+
86120
+ (over a deployed row or a synthesized draft-only row).
86121
+
86122
+ Frontend appends a \`*\` to the displayed name.
86123
+
86124
+ '
85880
86125
  nats_resource_path:
85881
86126
  type: string
85882
86127
  description: Path to the NATS resource containing connection configuration
@@ -85958,6 +86203,26 @@ properties:
85958
86203
  type: array
85959
86204
  items:
85960
86205
  type: string
86206
+ draft_only:
86207
+ type: boolean
86208
+ description: 'True when this row is a per-user draft with no deployed
86209
+
86210
+ trigger at the same path. Set by list endpoints when
86211
+
86212
+ \`include_draft_only=true\` synthesizes the row from the
86213
+
86214
+ draft. Frontend renders a "Draft" badge.
86215
+
86216
+ '
86217
+ is_draft:
86218
+ type: boolean
86219
+ description: 'True when the authed user has a per-user draft at this path
86220
+
86221
+ (over a deployed row or a synthesized draft-only row).
86222
+
86223
+ Frontend appends a \`*\` to the displayed name.
86224
+
86225
+ '
85961
86226
  postgres_resource_path:
85962
86227
  type: string
85963
86228
  description: Path to the PostgreSQL resource containing connection configuration
@@ -86140,6 +86405,22 @@ properties:
86140
86405
  type: array
86141
86406
  items:
86142
86407
  type: string
86408
+ draft_only:
86409
+ type: boolean
86410
+ description: 'True when this row is a per-user draft with no deployed
86411
+
86412
+ schedule at the same path. Frontend renders a "Draft" badge.
86413
+
86414
+ '
86415
+ is_draft:
86416
+ type: boolean
86417
+ description: 'True when the authed user has a per-user draft at this path
86418
+
86419
+ (over a deployed row or a synthesized draft-only row).
86420
+
86421
+ Frontend appends a \`*\` to the displayed name.
86422
+
86423
+ '
86143
86424
  inherited_labels:
86144
86425
  type: array
86145
86426
  items:
@@ -86171,6 +86452,26 @@ properties:
86171
86452
  type: array
86172
86453
  items:
86173
86454
  type: string
86455
+ draft_only:
86456
+ type: boolean
86457
+ description: 'True when this row is a per-user draft with no deployed
86458
+
86459
+ trigger at the same path. Set by list endpoints when
86460
+
86461
+ \`include_draft_only=true\` synthesizes the row from the
86462
+
86463
+ draft. Frontend renders a "Draft" badge.
86464
+
86465
+ '
86466
+ is_draft:
86467
+ type: boolean
86468
+ description: 'True when the authed user has a per-user draft at this path
86469
+
86470
+ (over a deployed row or a synthesized draft-only row).
86471
+
86472
+ Frontend appends a \`*\` to the displayed name.
86473
+
86474
+ '
86174
86475
  queue_url:
86175
86476
  type: string
86176
86477
  description: The full URL of the AWS SQS queue to poll for messages
@@ -86251,6 +86552,26 @@ properties:
86251
86552
  type: array
86252
86553
  items:
86253
86554
  type: string
86555
+ draft_only:
86556
+ type: boolean
86557
+ description: 'True when this row is a per-user draft with no deployed
86558
+
86559
+ trigger at the same path. Set by list endpoints when
86560
+
86561
+ \`include_draft_only=true\` synthesizes the row from the
86562
+
86563
+ draft. Frontend renders a "Draft" badge.
86564
+
86565
+ '
86566
+ is_draft:
86567
+ type: boolean
86568
+ description: 'True when the authed user has a per-user draft at this path
86569
+
86570
+ (over a deployed row or a synthesized draft-only row).
86571
+
86572
+ Frontend appends a \`*\` to the displayed name.
86573
+
86574
+ '
86254
86575
  url:
86255
86576
  type: string
86256
86577
  description: The WebSocket URL to connect to (can be a static URL or computed
@@ -86531,7 +86852,7 @@ __export(exports_tsconfig, {
86531
86852
  });
86532
86853
  import { execSync as execSync6 } from "node:child_process";
86533
86854
  import { createHash as createHash2 } from "node:crypto";
86534
- import { existsSync as existsSync12, readFileSync as readFileSync4, writeFileSync as writeFileSync7 } from "node:fs";
86855
+ import { existsSync as existsSync13, readFileSync as readFileSync4, writeFileSync as writeFileSync7 } from "node:fs";
86535
86856
  import path21 from "node:path";
86536
86857
  import process23 from "node:process";
86537
86858
  function buildManagedTsconfig() {
@@ -86658,7 +86979,7 @@ async function refreshManagedDenoImportMap(mode) {
86658
86979
  });
86659
86980
  }
86660
86981
  async function ensureUserReferencesManaged(opts) {
86661
- const existing = [opts.file, ...opts.altFiles ?? []].map((f) => path21.join(process23.cwd(), f)).find((p) => existsSync12(p));
86982
+ const existing = [opts.file, ...opts.altFiles ?? []].map((f) => path21.join(process23.cwd(), f)).find((p) => existsSync13(p));
86662
86983
  if (!existing) {
86663
86984
  const userPath = path21.join(process23.cwd(), opts.file);
86664
86985
  writeFileSync7(userPath, JSON.stringify(opts.create, null, 2) + `
@@ -86710,7 +87031,7 @@ async function ensureUserReferencesManaged(opts) {
86710
87031
  }
86711
87032
  function ensureBunTypesAvailable() {
86712
87033
  const cwd = process23.cwd();
86713
- if (existsSync12(path21.join(cwd, "node_modules", "bun-types"))) {
87034
+ if (existsSync13(path21.join(cwd, "node_modules", "bun-types"))) {
86714
87035
  return true;
86715
87036
  }
86716
87037
  try {
@@ -86733,7 +87054,7 @@ function ensureBunTypesAvailable() {
86733
87054
  async function warnIfTsconfigStale(opts) {
86734
87055
  const cwd = opts?.cwd ?? process23.cwd();
86735
87056
  const managedPath = path21.join(cwd, MANAGED_TSCONFIG);
86736
- if (!existsSync12(managedPath))
87057
+ if (!existsSync13(managedPath))
86737
87058
  return;
86738
87059
  let managedText;
86739
87060
  try {
@@ -88172,7 +88493,7 @@ await __promiseAll([
88172
88493
  init_context()
88173
88494
  ]);
88174
88495
  var import_yaml39 = __toESM(require_dist(), 1);
88175
- import { existsSync as existsSync9 } from "node:fs";
88496
+ import { existsSync as existsSync10 } from "node:fs";
88176
88497
  import { writeFile as writeFile19 } from "node:fs/promises";
88177
88498
  import { dirname as dirname18, join as join18 } from "node:path";
88178
88499
  var PROTECTION_RULES_FILENAME = "protection-rules.yaml";
@@ -88183,7 +88504,7 @@ function getProtectionRulesPath() {
88183
88504
  return join18(dirname18(wmillPath), PROTECTION_RULES_FILENAME);
88184
88505
  }
88185
88506
  async function readProtectionRulesFile(path20) {
88186
- if (!existsSync9(path20))
88507
+ if (!existsSync10(path20))
88187
88508
  return {};
88188
88509
  const parsed = await yamlParseFile(path20);
88189
88510
  return parsed ?? {};
@@ -88394,7 +88715,7 @@ await __promiseAll([
88394
88715
  init_conf()
88395
88716
  ]);
88396
88717
  import process22 from "node:process";
88397
- import { existsSync as existsSync10 } from "node:fs";
88718
+ import { existsSync as existsSync11 } from "node:fs";
88398
88719
  async function pushProtectionRules(opts, workspaceArg) {
88399
88720
  if (opts.jsonOutput)
88400
88721
  setSilent(true);
@@ -88404,7 +88725,7 @@ async function pushProtectionRules(opts, workspaceArg) {
88404
88725
  error: "No wmill.yaml found. Run 'wmill init' first — protection-rules.yaml lives next to it."
88405
88726
  });
88406
88727
  }
88407
- if (!existsSync10(prPath)) {
88728
+ if (!existsSync11(prPath)) {
88408
88729
  fail(opts, {
88409
88730
  error: "No protection-rules.yaml found. Run 'wmill protection-rules pull' first."
88410
88731
  });
@@ -89609,7 +89930,7 @@ await __promiseAll([
89609
89930
  init_workspace(),
89610
89931
  init_resource_type()
89611
89932
  ]);
89612
- import { stat as stat20, writeFile as writeFile22, rm as rm6 } from "node:fs/promises";
89933
+ import { stat as stat20, writeFile as writeFile22, rm as rm7 } from "node:fs/promises";
89613
89934
 
89614
89935
  // src/commands/init/template.ts
89615
89936
  var NON_SCHEMA_KEYS = new Set([
@@ -90090,7 +90411,7 @@ await __promiseAll([
90090
90411
  init_utils(),
90091
90412
  init_freshness()
90092
90413
  ]);
90093
- import { cp, mkdir as mkdir13, readdir as readdir11, rm as rm5, stat as stat19, writeFile as writeFile21 } from "node:fs/promises";
90414
+ import { cp, mkdir as mkdir13, readdir as readdir11, rm as rm6, stat as stat19, writeFile as writeFile21 } from "node:fs/promises";
90094
90415
  import { join as join20 } from "node:path";
90095
90416
  var WMILL_INIT_AI_SKILLS_SOURCE_ENV = "WMILL_INIT_AI_SKILLS_SOURCE";
90096
90417
  var WMILL_INIT_AI_AGENTS_SOURCE_ENV = "WMILL_INIT_AI_AGENTS_SOURCE";
@@ -90151,7 +90472,7 @@ async function migrateLegacyManagedFile(targetDir) {
90151
90472
  const legacyPath = join20(targetDir, LEGACY_AGENTS_CLI_FILENAME);
90152
90473
  const legacyExists = await stat19(legacyPath).catch(() => null) != null;
90153
90474
  if (legacyExists) {
90154
- await rm5(legacyPath, { force: true });
90475
+ await rm6(legacyPath, { force: true });
90155
90476
  }
90156
90477
  return legacyExists;
90157
90478
  }
@@ -90555,8 +90876,8 @@ async function initAction(opts) {
90555
90876
  });
90556
90877
  if (choice === "cancel") {
90557
90878
  try {
90558
- await rm6("wmill.yaml");
90559
- await rm6("wmill-lock.yaml");
90879
+ await rm7("wmill.yaml");
90880
+ await rm7("wmill-lock.yaml");
90560
90881
  } catch {}
90561
90882
  info("Init cancelled");
90562
90883
  process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "windmill-cli",
3
- "version": "1.723.0",
3
+ "version": "1.725.0",
4
4
  "description": "CLI for Windmill",
5
5
  "license": "Apache 2.0",
6
6
  "type": "module",