windmill-cli 1.518.2 → 1.519.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/esm/gen/core/OpenAPI.js +1 -1
- package/esm/gen/services.gen.js +74 -2
- package/esm/{apps.js → src/commands/app/apps.js} +6 -6
- package/esm/{dev.js → src/commands/dev/dev.js} +11 -11
- package/esm/{flow.js → src/commands/flow/flow.js} +13 -13
- package/esm/{folder.js → src/commands/folder/folder.js} +6 -6
- package/esm/src/commands/gitsync-settings/converter.js +134 -0
- package/esm/src/commands/gitsync-settings/gitsync-settings.js +2 -0
- package/esm/src/commands/gitsync-settings/index.js +28 -0
- package/esm/src/commands/gitsync-settings/legacySettings.js +119 -0
- package/esm/src/commands/gitsync-settings/pull.js +372 -0
- package/esm/src/commands/gitsync-settings/push.js +263 -0
- package/esm/src/commands/gitsync-settings/types.js +37 -0
- package/esm/src/commands/gitsync-settings/utils.js +129 -0
- package/esm/{hub.js → src/commands/hub/hub.js} +6 -6
- package/esm/src/commands/init/init.js +214 -0
- package/esm/{instance.js → src/commands/instance/instance.js} +18 -18
- package/esm/{queues.js → src/commands/queues/queues.js} +4 -4
- package/esm/{resource.js → src/commands/resource/resource.js} +7 -7
- package/esm/{resource-type.js → src/commands/resource-type/resource-type.js} +6 -6
- package/esm/{schedule.js → src/commands/schedule/schedule.js} +6 -6
- package/esm/{script.js → src/commands/script/script.js} +14 -14
- package/esm/{pull.js → src/commands/sync/pull.js} +2 -2
- package/esm/{sync.js → src/commands/sync/sync.js} +47 -146
- package/esm/{trigger.js → src/commands/trigger/trigger.js} +6 -6
- package/esm/{user.js → src/commands/user/user.js} +6 -6
- package/esm/{variable.js → src/commands/variable/variable.js} +6 -6
- package/esm/{worker_groups.js → src/commands/worker-groups/worker_groups.js} +5 -5
- package/esm/{workers.js → src/commands/workers/workers.js} +4 -4
- package/esm/{workspace.js → src/commands/workspace/workspace.js} +78 -44
- package/esm/{auth.js → src/core/auth.js} +3 -3
- package/esm/src/core/branch-profiles.js +46 -0
- package/esm/src/core/conf.js +162 -0
- package/esm/src/core/context.js +263 -0
- package/esm/{login.js → src/core/login.js} +2 -2
- package/esm/{settings.js → src/core/settings.js} +8 -8
- package/esm/src/core/store.js +19 -0
- package/esm/src/main.js +174 -0
- package/esm/{types.js → src/types.js} +16 -16
- package/esm/{codebase.js → src/utils/codebase.js} +1 -1
- package/esm/src/utils/git.js +29 -0
- package/esm/{metadata.js → src/utils/metadata.js} +31 -31
- package/esm/{upgrade.js → src/utils/upgrade.js} +1 -1
- package/esm/{utils.js → src/utils/utils.js} +11 -3
- package/esm/windmill-utils-internal/src/config/config.js +190 -0
- package/esm/windmill-utils-internal/src/inline-scripts/extractor.js +13 -9
- package/esm/windmill-utils-internal/src/path-utils/path-assigner.js +25 -9
- package/package.json +6 -6
- package/types/gen/services.gen.d.ts +37 -1
- package/types/gen/services.gen.d.ts.map +1 -1
- package/types/gen/types.gen.d.ts +48 -3
- package/types/gen/types.gen.d.ts.map +1 -1
- package/types/src/commands/app/apps.d.ts +17 -0
- package/types/src/commands/app/apps.d.ts.map +1 -0
- package/types/src/commands/dev/dev.d.ts +12 -0
- package/types/src/commands/dev/dev.d.ts.map +1 -0
- package/types/{flow.d.ts → src/commands/flow/flow.d.ts} +5 -5
- package/types/src/commands/flow/flow.d.ts.map +1 -0
- package/types/{folder.d.ts → src/commands/folder/folder.d.ts} +3 -3
- package/types/src/commands/folder/folder.d.ts.map +1 -0
- package/types/src/commands/gitsync-settings/converter.d.ts +10 -0
- package/types/src/commands/gitsync-settings/converter.d.ts.map +1 -0
- package/types/src/commands/gitsync-settings/gitsync-settings.d.ts +3 -0
- package/types/src/commands/gitsync-settings/gitsync-settings.d.ts.map +1 -0
- package/types/src/commands/gitsync-settings/index.d.ts +25 -0
- package/types/src/commands/gitsync-settings/index.d.ts.map +1 -0
- package/types/src/commands/gitsync-settings/legacySettings.d.ts +4 -0
- package/types/src/commands/gitsync-settings/legacySettings.d.ts.map +1 -0
- package/types/src/commands/gitsync-settings/pull.d.ts +14 -0
- package/types/src/commands/gitsync-settings/pull.d.ts.map +1 -0
- package/types/src/commands/gitsync-settings/push.d.ts +10 -0
- package/types/src/commands/gitsync-settings/push.d.ts.map +1 -0
- package/types/src/commands/gitsync-settings/types.d.ts +35 -0
- package/types/src/commands/gitsync-settings/types.d.ts.map +1 -0
- package/types/src/commands/gitsync-settings/utils.d.ts +36 -0
- package/types/src/commands/gitsync-settings/utils.d.ts.map +1 -0
- package/types/{hub.d.ts → src/commands/hub/hub.d.ts} +2 -2
- package/types/src/commands/hub/hub.d.ts.map +1 -0
- package/types/src/commands/init/init.d.ts +34 -0
- package/types/src/commands/init/init.d.ts.map +1 -0
- package/types/{instance.d.ts → src/commands/instance/instance.d.ts} +1 -1
- package/types/src/commands/instance/instance.d.ts.map +1 -0
- package/types/src/commands/queues/queues.d.ts +14 -0
- package/types/src/commands/queues/queues.d.ts.map +1 -0
- package/types/{resource.d.ts → src/commands/resource/resource.d.ts} +3 -3
- package/types/src/commands/resource/resource.d.ts.map +1 -0
- package/types/src/commands/resource-type/resource-type.d.ts +16 -0
- package/types/src/commands/resource-type/resource-type.d.ts.map +1 -0
- package/types/{schedule.d.ts → src/commands/schedule/schedule.d.ts} +3 -3
- package/types/src/commands/schedule/schedule.d.ts.map +1 -0
- package/types/{script.d.ts → src/commands/script/script.d.ts} +9 -9
- package/types/src/commands/script/script.d.ts.map +1 -0
- package/types/{pull.d.ts → src/commands/sync/pull.d.ts} +3 -3
- package/types/src/commands/sync/pull.d.ts.map +1 -0
- package/types/{sync.d.ts → src/commands/sync/sync.d.ts} +11 -13
- package/types/src/commands/sync/sync.d.ts.map +1 -0
- package/types/{trigger.d.ts → src/commands/trigger/trigger.d.ts} +3 -3
- package/types/src/commands/trigger/trigger.d.ts.map +1 -0
- package/types/{user.d.ts → src/commands/user/user.d.ts} +5 -5
- package/types/src/commands/user/user.d.ts.map +1 -0
- package/types/{variable.d.ts → src/commands/variable/variable.d.ts} +3 -3
- package/types/src/commands/variable/variable.d.ts.map +1 -0
- package/types/{worker_groups.d.ts → src/commands/worker-groups/worker_groups.d.ts} +2 -3
- package/types/src/commands/worker-groups/worker_groups.d.ts.map +1 -0
- package/types/{workers.d.ts → src/commands/workers/workers.d.ts} +1 -1
- package/types/src/commands/workers/workers.d.ts.map +1 -0
- package/types/{workspace.d.ts → src/commands/workspace/workspace.d.ts} +6 -4
- package/types/src/commands/workspace/workspace.d.ts.map +1 -0
- package/types/{auth.d.ts → src/core/auth.d.ts} +2 -2
- package/types/src/core/auth.d.ts.map +1 -0
- package/types/src/core/branch-profiles.d.ts +12 -0
- package/types/src/core/branch-profiles.d.ts.map +1 -0
- package/types/{conf.d.ts → src/core/conf.d.ts} +12 -3
- package/types/src/core/conf.d.ts.map +1 -0
- package/types/{context.d.ts → src/core/context.d.ts} +2 -2
- package/types/src/core/context.d.ts.map +1 -0
- package/types/{login.d.ts → src/core/login.d.ts} +1 -1
- package/types/src/core/login.d.ts.map +1 -0
- package/types/{settings.d.ts → src/core/settings.d.ts} +2 -2
- package/types/src/core/settings.d.ts.map +1 -0
- package/types/src/core/store.d.ts +2 -0
- package/types/src/core/store.d.ts.map +1 -0
- package/types/src/guidance/flow_guidance.d.ts.map +1 -0
- package/types/src/guidance/script_guidance.d.ts.map +1 -0
- package/types/src/main.d.ts +74 -0
- package/types/src/main.d.ts.map +1 -0
- package/types/src/types.d.ts.map +1 -0
- package/types/{codebase.d.ts → src/utils/codebase.d.ts} +1 -1
- package/types/src/utils/codebase.d.ts.map +1 -0
- package/types/src/utils/git.d.ts +3 -0
- package/types/src/utils/git.d.ts.map +1 -0
- package/types/src/utils/local_encryption.d.ts.map +1 -0
- package/types/{metadata.d.ts → src/utils/metadata.d.ts} +4 -4
- package/types/src/utils/metadata.d.ts.map +1 -0
- package/types/src/utils/script_common.d.ts.map +1 -0
- package/types/{upgrade.d.ts → src/utils/upgrade.d.ts} +1 -1
- package/types/src/utils/upgrade.d.ts.map +1 -0
- package/types/{utils.d.ts → src/utils/utils.d.ts} +2 -1
- package/types/src/utils/utils.d.ts.map +1 -0
- package/types/windmill-utils-internal/src/config/config.d.ts +12 -0
- package/types/windmill-utils-internal/src/config/config.d.ts.map +1 -0
- package/types/windmill-utils-internal/src/gen/types.gen.d.ts +48 -3
- package/types/windmill-utils-internal/src/gen/types.gen.d.ts.map +1 -1
- package/types/windmill-utils-internal/src/inline-scripts/extractor.d.ts +1 -4
- package/types/windmill-utils-internal/src/inline-scripts/extractor.d.ts.map +1 -1
- package/types/windmill-utils-internal/src/path-utils/path-assigner.d.ts +6 -6
- package/types/windmill-utils-internal/src/path-utils/path-assigner.d.ts.map +1 -1
- package/esm/conf.js +0 -78
- package/esm/context.js +0 -121
- package/esm/gitsync-settings.js +0 -984
- package/esm/main.js +0 -337
- package/esm/store.js +0 -76
- package/types/apps.d.ts +0 -17
- package/types/apps.d.ts.map +0 -1
- package/types/auth.d.ts.map +0 -1
- package/types/codebase.d.ts.map +0 -1
- package/types/conf.d.ts.map +0 -1
- package/types/context.d.ts.map +0 -1
- package/types/dev.d.ts +0 -12
- package/types/dev.d.ts.map +0 -1
- package/types/flow.d.ts.map +0 -1
- package/types/flow_guidance.d.ts.map +0 -1
- package/types/folder.d.ts.map +0 -1
- package/types/gitsync-settings.d.ts +0 -40
- package/types/gitsync-settings.d.ts.map +0 -1
- package/types/hub.d.ts.map +0 -1
- package/types/instance.d.ts.map +0 -1
- package/types/local_encryption.d.ts.map +0 -1
- package/types/login.d.ts.map +0 -1
- package/types/main.d.ts +0 -70
- package/types/main.d.ts.map +0 -1
- package/types/metadata.d.ts.map +0 -1
- package/types/pull.d.ts.map +0 -1
- package/types/queues.d.ts +0 -14
- package/types/queues.d.ts.map +0 -1
- package/types/resource-type.d.ts +0 -16
- package/types/resource-type.d.ts.map +0 -1
- package/types/resource.d.ts.map +0 -1
- package/types/schedule.d.ts.map +0 -1
- package/types/script.d.ts.map +0 -1
- package/types/script_common.d.ts.map +0 -1
- package/types/script_guidance.d.ts.map +0 -1
- package/types/settings.d.ts.map +0 -1
- package/types/store.d.ts +0 -3
- package/types/store.d.ts.map +0 -1
- package/types/sync.d.ts.map +0 -1
- package/types/trigger.d.ts.map +0 -1
- package/types/types.d.ts.map +0 -1
- package/types/upgrade.d.ts.map +0 -1
- package/types/user.d.ts.map +0 -1
- package/types/utils.d.ts.map +0 -1
- package/types/variable.d.ts.map +0 -1
- package/types/worker_groups.d.ts.map +0 -1
- package/types/workers.d.ts.map +0 -1
- package/types/workspace.d.ts.map +0 -1
- /package/esm/{flow_guidance.js → src/guidance/flow_guidance.js} +0 -0
- /package/esm/{script_guidance.js → src/guidance/script_guidance.js} +0 -0
- /package/esm/{local_encryption.js → src/utils/local_encryption.js} +0 -0
- /package/esm/{script_common.js → src/utils/script_common.js} +0 -0
- /package/types/{flow_guidance.d.ts → src/guidance/flow_guidance.d.ts} +0 -0
- /package/types/{script_guidance.d.ts → src/guidance/script_guidance.d.ts} +0 -0
- /package/types/{types.d.ts → src/types.d.ts} +0 -0
- /package/types/{local_encryption.d.ts → src/utils/local_encryption.d.ts} +0 -0
- /package/types/{script_common.d.ts → src/utils/script_common.d.ts} +0 -0
package/esm/gen/core/OpenAPI.js
CHANGED
package/esm/gen/services.gen.js
CHANGED
|
@@ -476,6 +476,37 @@ export const existsUsername = (data) => {
|
|
|
476
476
|
mediaType: 'application/json'
|
|
477
477
|
});
|
|
478
478
|
};
|
|
479
|
+
/**
|
|
480
|
+
* checks that all given databases exist or else return the ones that don't
|
|
481
|
+
* @param data The data for the request.
|
|
482
|
+
* @param data.requestBody
|
|
483
|
+
* @returns string databases that do not exist
|
|
484
|
+
* @throws ApiError
|
|
485
|
+
*/
|
|
486
|
+
export const databasesExist = (data) => {
|
|
487
|
+
return __request(OpenAPI, {
|
|
488
|
+
method: 'POST',
|
|
489
|
+
url: '/settings/databases_exist',
|
|
490
|
+
body: data.requestBody,
|
|
491
|
+
mediaType: 'application/json'
|
|
492
|
+
});
|
|
493
|
+
};
|
|
494
|
+
/**
|
|
495
|
+
* Runs CREATE DATABASE on the Windmill Postgres and grants access to the ducklake_user
|
|
496
|
+
* @param data The data for the request.
|
|
497
|
+
* @param data.name The name of the database to create
|
|
498
|
+
* @returns unknown status
|
|
499
|
+
* @throws ApiError
|
|
500
|
+
*/
|
|
501
|
+
export const createDucklakeDatabase = (data) => {
|
|
502
|
+
return __request(OpenAPI, {
|
|
503
|
+
method: 'POST',
|
|
504
|
+
url: '/settings/create_ducklake_database/{name}',
|
|
505
|
+
path: {
|
|
506
|
+
name: data.name
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
};
|
|
479
510
|
/**
|
|
480
511
|
* get global settings
|
|
481
512
|
* @param data The data for the request.
|
|
@@ -1599,6 +1630,41 @@ export const editLargeFileStorageConfig = (data) => {
|
|
|
1599
1630
|
mediaType: 'application/json'
|
|
1600
1631
|
});
|
|
1601
1632
|
};
|
|
1633
|
+
/**
|
|
1634
|
+
* list ducklakes
|
|
1635
|
+
* @param data The data for the request.
|
|
1636
|
+
* @param data.workspace
|
|
1637
|
+
* @returns string status
|
|
1638
|
+
* @throws ApiError
|
|
1639
|
+
*/
|
|
1640
|
+
export const listDucklakes = (data) => {
|
|
1641
|
+
return __request(OpenAPI, {
|
|
1642
|
+
method: 'GET',
|
|
1643
|
+
url: '/w/{workspace}/workspaces/list_ducklakes',
|
|
1644
|
+
path: {
|
|
1645
|
+
workspace: data.workspace
|
|
1646
|
+
}
|
|
1647
|
+
});
|
|
1648
|
+
};
|
|
1649
|
+
/**
|
|
1650
|
+
* edit ducklake settings
|
|
1651
|
+
* @param data The data for the request.
|
|
1652
|
+
* @param data.workspace
|
|
1653
|
+
* @param data.requestBody Ducklake settings
|
|
1654
|
+
* @returns unknown status
|
|
1655
|
+
* @throws ApiError
|
|
1656
|
+
*/
|
|
1657
|
+
export const editDucklakeConfig = (data) => {
|
|
1658
|
+
return __request(OpenAPI, {
|
|
1659
|
+
method: 'POST',
|
|
1660
|
+
url: '/w/{workspace}/workspaces/edit_ducklake_config',
|
|
1661
|
+
path: {
|
|
1662
|
+
workspace: data.workspace
|
|
1663
|
+
},
|
|
1664
|
+
body: data.requestBody,
|
|
1665
|
+
mediaType: 'application/json'
|
|
1666
|
+
});
|
|
1667
|
+
};
|
|
1602
1668
|
/**
|
|
1603
1669
|
* edit workspace git sync settings
|
|
1604
1670
|
* @param data The data for the request.
|
|
@@ -5725,7 +5791,9 @@ export const getJobArgs = (data) => {
|
|
|
5725
5791
|
* @param data.id
|
|
5726
5792
|
* @param data.running
|
|
5727
5793
|
* @param data.logOffset
|
|
5794
|
+
* @param data.streamOffset
|
|
5728
5795
|
* @param data.getProgress
|
|
5796
|
+
* @param data.noLogs
|
|
5729
5797
|
* @returns unknown job details
|
|
5730
5798
|
* @throws ApiError
|
|
5731
5799
|
*/
|
|
@@ -5740,7 +5808,9 @@ export const getJobUpdates = (data) => {
|
|
|
5740
5808
|
query: {
|
|
5741
5809
|
running: data.running,
|
|
5742
5810
|
log_offset: data.logOffset,
|
|
5743
|
-
|
|
5811
|
+
stream_offset: data.streamOffset,
|
|
5812
|
+
get_progress: data.getProgress,
|
|
5813
|
+
no_logs: data.noLogs
|
|
5744
5814
|
}
|
|
5745
5815
|
});
|
|
5746
5816
|
};
|
|
@@ -5753,6 +5823,7 @@ export const getJobUpdates = (data) => {
|
|
|
5753
5823
|
* @param data.logOffset
|
|
5754
5824
|
* @param data.getProgress
|
|
5755
5825
|
* @param data.onlyResult
|
|
5826
|
+
* @param data.noLogs
|
|
5756
5827
|
* @returns string server-sent events stream of job updates
|
|
5757
5828
|
* @throws ApiError
|
|
5758
5829
|
*/
|
|
@@ -5768,7 +5839,8 @@ export const getJobUpdatesSse = (data) => {
|
|
|
5768
5839
|
running: data.running,
|
|
5769
5840
|
log_offset: data.logOffset,
|
|
5770
5841
|
get_progress: data.getProgress,
|
|
5771
|
-
only_result: data.onlyResult
|
|
5842
|
+
only_result: data.onlyResult,
|
|
5843
|
+
no_logs: data.noLogs
|
|
5772
5844
|
}
|
|
5773
5845
|
});
|
|
5774
5846
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// deno-lint-ignore-file no-explicit-any
|
|
2
|
-
import { requireLogin } from "
|
|
3
|
-
import { resolveWorkspace, validatePath } from "
|
|
4
|
-
import { colors, Command, log, SEP, Table, yamlParseFile } from "
|
|
5
|
-
import * as wmill from "
|
|
6
|
-
import { isSuperset } from "
|
|
7
|
-
import { readInlinePathSync } from "
|
|
2
|
+
import { requireLogin } from "../../core/auth.js";
|
|
3
|
+
import { resolveWorkspace, validatePath } from "../../core/context.js";
|
|
4
|
+
import { colors, Command, log, SEP, Table, yamlParseFile } from "../../../deps.js";
|
|
5
|
+
import * as wmill from "../../../gen/services.gen.js";
|
|
6
|
+
import { isSuperset } from "../../types.js";
|
|
7
|
+
import { readInlinePathSync } from "../../utils/utils.js";
|
|
8
8
|
const alreadySynced = [];
|
|
9
9
|
export async function pushApp(workspace, remotePath, localPath, message) {
|
|
10
10
|
if (alreadySynced.includes(localPath)) {
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as dntShim from "
|
|
2
|
-
import { Command, SEP, WebSocketServer, express, getPort, http, log, open, yamlParseFile, } from "
|
|
3
|
-
import { getTypeStrFromPath } from "
|
|
4
|
-
import { ignoreF } from "
|
|
5
|
-
import { requireLogin } from "
|
|
6
|
-
import { resolveWorkspace } from "
|
|
7
|
-
import { mergeConfigWithConfigFile, readConfigFile, } from "
|
|
8
|
-
import { exts, findGlobalDeps, removeExtensionToPath } from "
|
|
9
|
-
import { inferContentTypeFromFilePath } from "
|
|
10
|
-
import { replaceInlineScripts } from "
|
|
11
|
-
import { parseMetadataFile } from "
|
|
1
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
|
+
import { Command, SEP, WebSocketServer, express, getPort, http, log, open, yamlParseFile, } from "../../../deps.js";
|
|
3
|
+
import { getTypeStrFromPath } from "../../types.js";
|
|
4
|
+
import { ignoreF } from "../sync/sync.js";
|
|
5
|
+
import { requireLogin } from "../../core/auth.js";
|
|
6
|
+
import { resolveWorkspace } from "../../core/context.js";
|
|
7
|
+
import { mergeConfigWithConfigFile, readConfigFile, } from "../../core/conf.js";
|
|
8
|
+
import { exts, findGlobalDeps, removeExtensionToPath } from "../script/script.js";
|
|
9
|
+
import { inferContentTypeFromFilePath } from "../../utils/script_common.js";
|
|
10
|
+
import { replaceInlineScripts } from "../../../windmill-utils-internal/src/inline-scripts/replacer.js";
|
|
11
|
+
import { parseMetadataFile } from "../../utils/metadata.js";
|
|
12
12
|
const PORT = 3001;
|
|
13
13
|
async function dev(opts) {
|
|
14
14
|
const workspace = await resolveWorkspace(opts);
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
// deno-lint-ignore-file no-explicit-any
|
|
2
|
-
import * as dntShim from "
|
|
3
|
-
import { isSuperset } from "
|
|
4
|
-
import { Confirm, SEP, log, yamlStringify } from "
|
|
5
|
-
import { colors, Command, Table, yamlParseFile } from "
|
|
6
|
-
import * as wmill from "
|
|
7
|
-
import { requireLogin } from "
|
|
8
|
-
import { resolveWorkspace, validatePath } from "
|
|
9
|
-
import { resolve, track_job } from "
|
|
10
|
-
import { defaultFlowDefinition } from "
|
|
11
|
-
import { generateFlowLockInternal } from "
|
|
12
|
-
import { mergeConfigWithConfigFile } from "
|
|
13
|
-
import { FSFSElement, elementsToMap, ignoreF } from "
|
|
14
|
-
import { replaceInlineScripts } from "
|
|
2
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
3
|
+
import { isSuperset } from "../../types.js";
|
|
4
|
+
import { Confirm, SEP, log, yamlStringify } from "../../../deps.js";
|
|
5
|
+
import { colors, Command, Table, yamlParseFile } from "../../../deps.js";
|
|
6
|
+
import * as wmill from "../../../gen/services.gen.js";
|
|
7
|
+
import { requireLogin } from "../../core/auth.js";
|
|
8
|
+
import { resolveWorkspace, validatePath } from "../../core/context.js";
|
|
9
|
+
import { resolve, track_job } from "../script/script.js";
|
|
10
|
+
import { defaultFlowDefinition } from "../../../bootstrap/flow_bootstrap.js";
|
|
11
|
+
import { generateFlowLockInternal } from "../../utils/metadata.js";
|
|
12
|
+
import { mergeConfigWithConfigFile } from "../../core/conf.js";
|
|
13
|
+
import { FSFSElement, elementsToMap, ignoreF } from "../sync/sync.js";
|
|
14
|
+
import { replaceInlineScripts } from "../../../windmill-utils-internal/src/inline-scripts/replacer.js";
|
|
15
15
|
const alreadySynced = [];
|
|
16
16
|
export async function pushFlow(workspace, remotePath, localPath, message) {
|
|
17
17
|
if (alreadySynced.includes(localPath)) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// deno-lint-ignore-file no-explicit-any
|
|
2
|
-
import * as dntShim from "
|
|
3
|
-
import { colors, Command, log, SEP, Table } from "
|
|
4
|
-
import * as wmill from "
|
|
5
|
-
import { requireLogin } from "
|
|
6
|
-
import { resolveWorkspace, validatePath } from "
|
|
7
|
-
import { isSuperset, parseFromFile } from "
|
|
2
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
3
|
+
import { colors, Command, log, SEP, Table } from "../../../deps.js";
|
|
4
|
+
import * as wmill from "../../../gen/services.gen.js";
|
|
5
|
+
import { requireLogin } from "../../core/auth.js";
|
|
6
|
+
import { resolveWorkspace, validatePath } from "../../core/context.js";
|
|
7
|
+
import { isSuperset, parseFromFile } from "../../types.js";
|
|
8
8
|
async function list(opts) {
|
|
9
9
|
const workspace = await resolveWorkspace(opts);
|
|
10
10
|
await requireLogin(opts);
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Helper to compare string arrays (used for includes/excludes/extraIncludes)
|
|
2
|
+
function arraysEqual(arr1, arr2) {
|
|
3
|
+
if (arr1.length !== arr2.length) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
const sorted1 = [...arr1].sort();
|
|
7
|
+
const sorted2 = [...arr2].sort();
|
|
8
|
+
return sorted1.every((item, index) => item === sorted2[index]);
|
|
9
|
+
}
|
|
10
|
+
export class GitSyncSettingsConverter {
|
|
11
|
+
// Convert backend include_type array to SyncOptions boolean flags
|
|
12
|
+
static fromBackendFormat(settings) {
|
|
13
|
+
const includeTypes = settings.include_type || [];
|
|
14
|
+
const result = {
|
|
15
|
+
includes: settings.include_path || [],
|
|
16
|
+
excludes: settings.exclude_path || [],
|
|
17
|
+
skipScripts: !includeTypes.includes("script"),
|
|
18
|
+
skipFlows: !includeTypes.includes("flow"),
|
|
19
|
+
skipApps: !includeTypes.includes("app"),
|
|
20
|
+
skipFolders: !includeTypes.includes("folder"),
|
|
21
|
+
skipVariables: !includeTypes.includes("variable"),
|
|
22
|
+
skipResources: !includeTypes.includes("resource"),
|
|
23
|
+
skipResourceTypes: !includeTypes.includes("resourcetype"),
|
|
24
|
+
skipSecrets: !includeTypes.includes("secret"),
|
|
25
|
+
includeSchedules: includeTypes.includes("schedule"),
|
|
26
|
+
includeTriggers: includeTypes.includes("trigger"),
|
|
27
|
+
includeUsers: includeTypes.includes("user"),
|
|
28
|
+
includeGroups: includeTypes.includes("group"),
|
|
29
|
+
includeSettings: includeTypes.includes("settings"),
|
|
30
|
+
includeKey: includeTypes.includes("key"),
|
|
31
|
+
};
|
|
32
|
+
// Only include extraIncludes if it has content
|
|
33
|
+
if (settings.extra_include_path && settings.extra_include_path.length > 0) {
|
|
34
|
+
result.extraIncludes = settings.extra_include_path;
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
// Convert SyncOptions boolean flags to backend include_type array
|
|
39
|
+
static toBackendFormat(opts) {
|
|
40
|
+
const includeTypes = [];
|
|
41
|
+
if (!opts.skipScripts)
|
|
42
|
+
includeTypes.push("script");
|
|
43
|
+
if (!opts.skipFlows)
|
|
44
|
+
includeTypes.push("flow");
|
|
45
|
+
if (!opts.skipApps)
|
|
46
|
+
includeTypes.push("app");
|
|
47
|
+
if (!opts.skipFolders)
|
|
48
|
+
includeTypes.push("folder");
|
|
49
|
+
if (!opts.skipVariables)
|
|
50
|
+
includeTypes.push("variable");
|
|
51
|
+
if (!opts.skipResources)
|
|
52
|
+
includeTypes.push("resource");
|
|
53
|
+
if (!opts.skipResourceTypes)
|
|
54
|
+
includeTypes.push("resourcetype");
|
|
55
|
+
if (!opts.skipSecrets)
|
|
56
|
+
includeTypes.push("secret");
|
|
57
|
+
if (opts.includeSchedules)
|
|
58
|
+
includeTypes.push("schedule");
|
|
59
|
+
if (opts.includeTriggers)
|
|
60
|
+
includeTypes.push("trigger");
|
|
61
|
+
if (opts.includeUsers)
|
|
62
|
+
includeTypes.push("user");
|
|
63
|
+
if (opts.includeGroups)
|
|
64
|
+
includeTypes.push("group");
|
|
65
|
+
if (opts.includeSettings)
|
|
66
|
+
includeTypes.push("settings");
|
|
67
|
+
if (opts.includeKey)
|
|
68
|
+
includeTypes.push("key");
|
|
69
|
+
const result = {
|
|
70
|
+
include_path: opts.includes || [],
|
|
71
|
+
include_type: includeTypes,
|
|
72
|
+
};
|
|
73
|
+
// Only include optional arrays if they have content
|
|
74
|
+
if (opts.excludes && opts.excludes.length > 0) {
|
|
75
|
+
result.exclude_path = opts.excludes;
|
|
76
|
+
}
|
|
77
|
+
if (opts.extraIncludes && opts.extraIncludes.length > 0) {
|
|
78
|
+
result.extra_include_path = opts.extraIncludes;
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
// Normalize SyncOptions for semantic comparison - treat undefined values as their defaults
|
|
83
|
+
static normalize(opts) {
|
|
84
|
+
return {
|
|
85
|
+
...opts,
|
|
86
|
+
includes: opts.includes || [],
|
|
87
|
+
excludes: opts.excludes || [],
|
|
88
|
+
extraIncludes: opts.extraIncludes || [],
|
|
89
|
+
skipVariables: opts.skipVariables ?? false,
|
|
90
|
+
skipResources: opts.skipResources ?? false,
|
|
91
|
+
skipResourceTypes: opts.skipResourceTypes ?? false,
|
|
92
|
+
skipSecrets: opts.skipSecrets ?? true,
|
|
93
|
+
skipScripts: opts.skipScripts ?? false,
|
|
94
|
+
skipFlows: opts.skipFlows ?? false,
|
|
95
|
+
skipApps: opts.skipApps ?? false,
|
|
96
|
+
skipFolders: opts.skipFolders ?? false,
|
|
97
|
+
includeSchedules: opts.includeSchedules ?? false,
|
|
98
|
+
includeTriggers: opts.includeTriggers ?? false,
|
|
99
|
+
includeUsers: opts.includeUsers ?? false,
|
|
100
|
+
includeGroups: opts.includeGroups ?? false,
|
|
101
|
+
includeSettings: opts.includeSettings ?? false,
|
|
102
|
+
includeKey: opts.includeKey ?? false,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
// Extract only git-sync relevant fields for comparison
|
|
106
|
+
static extractGitSyncFields(opts) {
|
|
107
|
+
return {
|
|
108
|
+
includes: opts.includes || [],
|
|
109
|
+
excludes: opts.excludes || [],
|
|
110
|
+
extraIncludes: opts.extraIncludes || [],
|
|
111
|
+
skipScripts: opts.skipScripts,
|
|
112
|
+
skipFlows: opts.skipFlows,
|
|
113
|
+
skipApps: opts.skipApps,
|
|
114
|
+
skipFolders: opts.skipFolders,
|
|
115
|
+
skipVariables: opts.skipVariables,
|
|
116
|
+
skipResources: opts.skipResources,
|
|
117
|
+
skipResourceTypes: opts.skipResourceTypes,
|
|
118
|
+
skipSecrets: opts.skipSecrets,
|
|
119
|
+
includeSchedules: opts.includeSchedules,
|
|
120
|
+
includeTriggers: opts.includeTriggers,
|
|
121
|
+
includeUsers: opts.includeUsers,
|
|
122
|
+
includeGroups: opts.includeGroups,
|
|
123
|
+
includeSettings: opts.includeSettings,
|
|
124
|
+
includeKey: opts.includeKey,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
// Check if two values are different, with special handling for arrays
|
|
128
|
+
static isDifferent(value1, value2) {
|
|
129
|
+
if (Array.isArray(value1) && Array.isArray(value2)) {
|
|
130
|
+
return !arraysEqual(value1, value2);
|
|
131
|
+
}
|
|
132
|
+
return value1 !== value2;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Command } from "../../../deps.js";
|
|
2
|
+
import { pullGitSyncSettings } from "./pull.js";
|
|
3
|
+
import { pushGitSyncSettings } from "./push.js";
|
|
4
|
+
const command = new Command()
|
|
5
|
+
.description("Manage git-sync settings between local wmill.yaml and Windmill backend")
|
|
6
|
+
.command("pull")
|
|
7
|
+
.description("Pull git-sync settings from Windmill backend to local wmill.yaml")
|
|
8
|
+
.option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo)")
|
|
9
|
+
.option("--default", "Write settings to top-level defaults instead of overrides")
|
|
10
|
+
.option("--replace", "Replace existing settings (non-interactive mode)")
|
|
11
|
+
.option("--override", "Add branch-specific override (non-interactive mode)")
|
|
12
|
+
.option("--diff", "Show differences without applying changes")
|
|
13
|
+
.option("--json-output", "Output in JSON format")
|
|
14
|
+
.option("--with-backend-settings <json:string>", "Use provided JSON settings instead of querying backend (for testing)")
|
|
15
|
+
.option("--yes", "Skip interactive prompts and use default behavior")
|
|
16
|
+
.option("--promotion <branch:string>", "Use promotionOverrides from the specified branch instead of regular overrides")
|
|
17
|
+
.action(pullGitSyncSettings)
|
|
18
|
+
.command("push")
|
|
19
|
+
.description("Push git-sync settings from local wmill.yaml to Windmill backend")
|
|
20
|
+
.option("--repository <repo:string>", "Specify repository path (e.g., u/user/repo)")
|
|
21
|
+
.option("--diff", "Show what would be pushed without applying changes")
|
|
22
|
+
.option("--json-output", "Output in JSON format")
|
|
23
|
+
.option("--with-backend-settings <json:string>", "Use provided JSON settings instead of querying backend (for testing)")
|
|
24
|
+
.option("--yes", "Skip interactive prompts and use default behavior")
|
|
25
|
+
.option("--promotion <branch:string>", "Use promotionOverrides from the specified branch instead of regular overrides")
|
|
26
|
+
.action(pushGitSyncSettings);
|
|
27
|
+
export { pullGitSyncSettings, pushGitSyncSettings };
|
|
28
|
+
export default command;
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import * as dntShim from "../../../_dnt.shims.js";
|
|
2
|
+
import { colors, Confirm } from "../../../deps.js";
|
|
3
|
+
import * as wmill from "../../../gen/services.gen.js";
|
|
4
|
+
// Shared migration function for legacy repositories
|
|
5
|
+
export async function handleLegacyRepositoryMigration(selectedRepo, gitSyncSettings, workspace, opts, operationName = "operation") {
|
|
6
|
+
if (selectedRepo.settings) {
|
|
7
|
+
return selectedRepo; // Already migrated
|
|
8
|
+
}
|
|
9
|
+
// This repository is in legacy format - handle migration
|
|
10
|
+
if (!gitSyncSettings.include_path || !gitSyncSettings.include_type) {
|
|
11
|
+
throw new Error(`Repository "${selectedRepo.git_repo_resource_path}" has legacy format but workspace-level include_path or include_type is missing. This indicates corrupted git-sync settings.`);
|
|
12
|
+
}
|
|
13
|
+
const workspaceIncludePath = gitSyncSettings.include_path;
|
|
14
|
+
const workspaceIncludeType = gitSyncSettings.include_type;
|
|
15
|
+
if (dntShim.Deno.stdout.isTerminal() && !opts.yes) {
|
|
16
|
+
// Interactive mode - show migration prompt
|
|
17
|
+
console.log(colors.yellow('\n⚠️ Legacy git-sync settings detected!'));
|
|
18
|
+
console.log(`\nRepository "${selectedRepo.git_repo_resource_path}" has legacy settings format.`);
|
|
19
|
+
console.log('The new format allows per-repository filter configuration.');
|
|
20
|
+
if (operationName === "push") {
|
|
21
|
+
console.log('This repository must be migrated before pushing settings.\n');
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
console.log('\n');
|
|
25
|
+
}
|
|
26
|
+
console.log(colors.bold('Current workspace-level settings:'));
|
|
27
|
+
console.log(` Include paths: ${workspaceIncludePath.join(', ')}`);
|
|
28
|
+
console.log(` Include types: ${workspaceIncludeType.join(', ')}\n`);
|
|
29
|
+
// Show what the migration will do
|
|
30
|
+
let finalIncludeType = [...workspaceIncludeType];
|
|
31
|
+
if (selectedRepo.exclude_types_override && selectedRepo.exclude_types_override.length > 0) {
|
|
32
|
+
const originalCount = finalIncludeType.length;
|
|
33
|
+
finalIncludeType = finalIncludeType.filter(type => !selectedRepo.exclude_types_override.includes(type));
|
|
34
|
+
const excludedCount = originalCount - finalIncludeType.length;
|
|
35
|
+
console.log(colors.yellow(`Repository excludes ${excludedCount} types: ${selectedRepo.exclude_types_override.join(', ')}`));
|
|
36
|
+
}
|
|
37
|
+
console.log(colors.bold('\nAfter migration, repository will have:'));
|
|
38
|
+
console.log(` Include paths: ${workspaceIncludePath.join(', ')}`);
|
|
39
|
+
console.log(` Include types: ${finalIncludeType.join(', ')}\n`);
|
|
40
|
+
const confirm = await Confirm.prompt({
|
|
41
|
+
message: operationName === "push"
|
|
42
|
+
? 'Do you want to migrate this repository before pushing?'
|
|
43
|
+
: 'Do you want to migrate this repository?',
|
|
44
|
+
default: true
|
|
45
|
+
});
|
|
46
|
+
if (!confirm) {
|
|
47
|
+
const message = operationName === "push"
|
|
48
|
+
? '\n⚠️ Migration skipped. Cannot push to legacy repository.'
|
|
49
|
+
: '\n⚠️ Migration skipped. You can migrate later via the UI.';
|
|
50
|
+
console.log(colors.yellow(message));
|
|
51
|
+
if (operationName === "push") {
|
|
52
|
+
return null; // Signal to exit push operation
|
|
53
|
+
}
|
|
54
|
+
throw new Error('Migration cancelled by user');
|
|
55
|
+
}
|
|
56
|
+
// Perform the migration
|
|
57
|
+
let migratedIncludeType = [...workspaceIncludeType];
|
|
58
|
+
if (selectedRepo.exclude_types_override && selectedRepo.exclude_types_override.length > 0) {
|
|
59
|
+
migratedIncludeType = migratedIncludeType.filter(type => !selectedRepo.exclude_types_override.includes(type));
|
|
60
|
+
}
|
|
61
|
+
const migratedRepo = {
|
|
62
|
+
...selectedRepo,
|
|
63
|
+
settings: {
|
|
64
|
+
include_path: [...workspaceIncludePath],
|
|
65
|
+
include_type: migratedIncludeType,
|
|
66
|
+
exclude_path: [],
|
|
67
|
+
extra_include_path: []
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
// Remove the old field
|
|
71
|
+
delete migratedRepo.exclude_types_override;
|
|
72
|
+
// Update the backend with migrated repository
|
|
73
|
+
const updatedRepositories = gitSyncSettings.repositories.map((repo) => {
|
|
74
|
+
if (repo.git_repo_resource_path === selectedRepo.git_repo_resource_path) {
|
|
75
|
+
return migratedRepo;
|
|
76
|
+
}
|
|
77
|
+
return repo;
|
|
78
|
+
});
|
|
79
|
+
await wmill.editWorkspaceGitSyncConfig({
|
|
80
|
+
workspace: workspace.workspaceId,
|
|
81
|
+
requestBody: {
|
|
82
|
+
git_sync_settings: {
|
|
83
|
+
repositories: updatedRepositories,
|
|
84
|
+
// Keep workspace-level settings if other repos are still legacy
|
|
85
|
+
...(gitSyncSettings.repositories.some((r) => r.git_repo_resource_path !== selectedRepo.git_repo_resource_path && !r.settings) && {
|
|
86
|
+
include_path: workspaceIncludePath,
|
|
87
|
+
include_type: workspaceIncludeType
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
console.log(colors.green('\n✓ Repository migration completed successfully!'));
|
|
93
|
+
if (operationName === "push") {
|
|
94
|
+
console.log('Now proceeding with push operation...\n');
|
|
95
|
+
}
|
|
96
|
+
return migratedRepo;
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
// Non-interactive mode - show error
|
|
100
|
+
console.error(colors.red('\n❌ Legacy git-sync settings detected!'));
|
|
101
|
+
console.error(`\nRepository "${selectedRepo.git_repo_resource_path}" has legacy settings format.`);
|
|
102
|
+
if (operationName === "push") {
|
|
103
|
+
console.error('This repository must be migrated before pushing settings.');
|
|
104
|
+
}
|
|
105
|
+
console.error('Please choose one of the following options:\n');
|
|
106
|
+
console.error('1. Go to the Windmill UI > Workspace Settings > Git Sync');
|
|
107
|
+
console.error(' Review and save this repository to migrate to the new format.\n');
|
|
108
|
+
console.error('2. Run this command in interactive mode (with TTY) to migrate.');
|
|
109
|
+
console.error(` Example: wmill gitsync-settings ${operationName}\n`);
|
|
110
|
+
if (operationName === "push") {
|
|
111
|
+
console.error('3. Pull settings first to migrate: wmill gitsync-settings pull\n');
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
console.error('3. Push local settings to override backend settings:');
|
|
115
|
+
console.error(' wmill gitsync-settings push\n');
|
|
116
|
+
}
|
|
117
|
+
dntShim.Deno.exit(1);
|
|
118
|
+
}
|
|
119
|
+
}
|