@treasuredata/tdx 2026.3.32 → 2026.3.33
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/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.d.ts +1 -3
- package/dist/commands/work-command.d.ts.map +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/work-command.js.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +42 -19
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/types/workspace.js.map +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.d.ts +15 -0
- package/dist/sdk/workspace/git.d.ts.map +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/git.js.map +1 -1
- package/dist/sdk/workspace/index.d.ts +38 -21
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.d.ts +49 -0
- package/dist/sdk/workspace/weekly.d.ts.map +1 -0
- package/dist/sdk/workspace/weekly.js +1 -0
- package/dist/sdk/workspace/weekly.js.map +1 -0
- package/dist/sdk/workspace/wikilinks.d.ts +7 -2
- package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/sdk/workspace/wikilinks.js.map +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
- package/dist/sdk/workspace/skills.d.ts +0 -34
- package/dist/sdk/workspace/skills.d.ts.map +0 -1
- package/dist/sdk/workspace/skills.js +0 -1
- package/dist/sdk/workspace/skills.js.map +0 -1
package/dist/sdk/util/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2bcc8e,_0x209d91){var _0x5f0373=a187_0x3fd9,_0x2d090b=_0x2bcc8e();while(!![]){try{var _0x2809e0=parseInt(_0x5f0373(0x137))/0x1*(parseInt(_0x5f0373(0x134))/0x2)+-parseInt(_0x5f0373(0x132))/0x3+parseInt(_0x5f0373(0x13d))/0x4*(parseInt(_0x5f0373(0x138))/0x5)+-parseInt(_0x5f0373(0x13b))/0x6*(-parseInt(_0x5f0373(0x131))/0x7)+parseInt(_0x5f0373(0x133))/0x8*(-parseInt(_0x5f0373(0x135))/0x9)+parseInt(_0x5f0373(0x13c))/0xa*(parseInt(_0x5f0373(0x139))/0xb)+-parseInt(_0x5f0373(0x13a))/0xc*(parseInt(_0x5f0373(0x136))/0xd);if(_0x2809e0===_0x209d91)break;else _0x2d090b['push'](_0x2d090b['shift']());}catch(_0x340370){_0x2d090b['push'](_0x2d090b['shift']());}}}(a187_0x543f,0x31986));export*from'./formatters.js';function a187_0x3fd9(_0x4e9482,_0x30ddba){_0x4e9482=_0x4e9482-0x131;var _0x543f00=a187_0x543f();var _0x3fd9d2=_0x543f00[_0x4e9482];return _0x3fd9d2;}export*from'./format-detector.js';export*from'./tree-formatter.js';function a187_0x543f(){var _0x56f2a7=['19235QtFUHb','1910iyqqVG','11frKkEK','492kYrSAP','12Akydms','3245410nJtdsD','4184WHmjaj','1406258vjZgcK','455151gUYpVd','6488loKGub','2nZsCCX','2007wNXGtJ','193232OtCxSi'];a187_0x543f=function(){return _0x56f2a7;};return a187_0x543f();}export*from'./paginate.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a188_0x1caf(_0x5e4d36,_0x17dd64){_0x5e4d36=_0x5e4d36-0x1c8;const _0x34bc53=a188_0x34bc();let _0x1caf03=_0x34bc53[_0x5e4d36];return _0x1caf03;}function a188_0x34bc(){const _0x3e8afb=['slice','13567059fWewnb','2ZqmMIc','1644024veFHqK','28qIFVZj','91545PgpNUx','length','2610015WjwKDc','4096896oabiRk','isArray','328720MaJVZZ','data','6100480mrkeZu','min'];a188_0x34bc=function(){return _0x3e8afb;};return a188_0x34bc();}(function(_0x4474f3,_0x1a0e4b){const _0xf712d3=a188_0x1caf,_0x37ba75=_0x4474f3();while(!![]){try{const _0x1d131f=parseInt(_0xf712d3(0x1d2))/0x1+-parseInt(_0xf712d3(0x1ca))/0x2*(parseInt(_0xf712d3(0x1cd))/0x3)+parseInt(_0xf712d3(0x1d0))/0x4+parseInt(_0xf712d3(0x1cf))/0x5+parseInt(_0xf712d3(0x1cb))/0x6*(parseInt(_0xf712d3(0x1cc))/0x7)+-parseInt(_0xf712d3(0x1d4))/0x8+-parseInt(_0xf712d3(0x1c9))/0x9;if(_0x1d131f===_0x1a0e4b)break;else _0x37ba75['push'](_0x37ba75['shift']());}catch(_0x55297b){_0x37ba75['push'](_0x37ba75['shift']());}}}(a188_0x34bc,0xa3ae5));export const PAGE_SIZE=0x64;export const MAX_PAGINATION_LIMIT=0x2710;export async function paginate(_0x41b84e,_0x29d0c5=MAX_PAGINATION_LIMIT,_0x44f239=0x0){const _0x4d6348=a188_0x1caf,_0x8d6e67=Math[_0x4d6348(0x1d5)](_0x29d0c5,MAX_PAGINATION_LIMIT),_0x2eefb0=[];let _0x685cb7=_0x44f239;while(_0x2eefb0[_0x4d6348(0x1ce)]<_0x8d6e67){const _0x24d44e=Math[_0x4d6348(0x1d5)](PAGE_SIZE,_0x8d6e67-_0x2eefb0[_0x4d6348(0x1ce)]),_0x342949=await _0x41b84e(_0x24d44e,_0x685cb7),_0x1bcdc2=Array[_0x4d6348(0x1d1)](_0x342949[_0x4d6348(0x1d3)])?_0x342949[_0x4d6348(0x1d3)]:[_0x342949[_0x4d6348(0x1d3)]];_0x2eefb0['push'](..._0x1bcdc2);if(_0x1bcdc2['length']<_0x24d44e)break;_0x685cb7+=_0x24d44e;}return _0x2eefb0[_0x4d6348(0x1ce)]>_0x8d6e67?_0x2eefb0[_0x4d6348(0x1c8)](0x0,_0x8d6e67):_0x2eefb0;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2611ba,_0x4c6f38){const _0x1aa051=a189_0x1623,_0x417a36=_0x2611ba();while(!![]){try{const _0x526a11=-parseInt(_0x1aa051(0x1f7))/0x1*(-parseInt(_0x1aa051(0x1db))/0x2)+parseInt(_0x1aa051(0x1c8))/0x3*(-parseInt(_0x1aa051(0x1de))/0x4)+-parseInt(_0x1aa051(0x1ef))/0x5+parseInt(_0x1aa051(0x1dd))/0x6*(parseInt(_0x1aa051(0x1ce))/0x7)+-parseInt(_0x1aa051(0x1c6))/0x8+-parseInt(_0x1aa051(0x1e4))/0x9*(-parseInt(_0x1aa051(0x1ed))/0xa)+parseInt(_0x1aa051(0x1da))/0xb;if(_0x526a11===_0x4c6f38)break;else _0x417a36['push'](_0x417a36['shift']());}catch(_0x786f7c){_0x417a36['push'](_0x417a36['shift']());}}}(a189_0x61d5,0x7a74b));import{formatRows,hyperlink}from'./formatters.js';import a189_0x1d4b71 from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};export function formatTree(_0x1e68a5,_0x16440e={},_0x3dd575=0x0,_0x2b2515=''){const _0x88402b=a189_0x1623,_0x49fa47={...DEFAULT_OPTIONS,..._0x16440e},_0x124212=[],_0x112452=[..._0x1e68a5]['sort']((_0x5e0199,_0x58aab2)=>_0x5e0199['name']['localeCompare'](_0x58aab2[_0x88402b(0x1d3)],undefined,{'sensitivity':_0x88402b(0x1e0)}));for(let _0x5d59c3=0x0;_0x5d59c3<_0x112452[_0x88402b(0x1cd)];_0x5d59c3++){const _0x44665e=_0x112452[_0x5d59c3],_0x2e5c07=_0x5d59c3===_0x112452['length']-0x1;let _0x3d0ad3='';_0x3dd575>0x0&&(_0x3d0ad3+=_0x2b2515);_0x49fa47['showTreeLines']&&_0x3dd575>0x0&&(_0x3d0ad3+=a189_0x1d4b71[_0x88402b(0x1df)](_0x2e5c07?_0x88402b(0x1f8):'├──\x20'));if(_0x49fa47[_0x88402b(0x1d5)]){if(_0x44665e[_0x88402b(0x1cf)]===_0x88402b(0x1fa))_0x3d0ad3+=_0x88402b(0x1d6);else _0x44665e[_0x88402b(0x1cf)]===_0x88402b(0x1ec)?_0x3d0ad3+=_0x88402b(0x1c9):_0x3d0ad3+=_0x88402b(0x1e8);}if(_0x49fa47[_0x88402b(0x1d8)]&&_0x44665e['type']===_0x88402b(0x1eb))_0x3d0ad3+=hyperlink(_0x44665e['name'],_0x49fa47[_0x88402b(0x1d8)](_0x44665e['id']));else _0x49fa47[_0x88402b(0x1dc)]&&_0x44665e[_0x88402b(0x1cf)]===_0x88402b(0x1ec)?_0x3d0ad3+=hyperlink(_0x44665e[_0x88402b(0x1d3)],_0x49fa47['getJourneyUrl'](_0x44665e['id'])):_0x3d0ad3+=_0x44665e[_0x88402b(0x1d3)];if(_0x49fa47[_0x88402b(0x1f0)]){if(_0x44665e[_0x88402b(0x1cf)]==='folder'){const _0x455aae=[];_0x44665e[_0x88402b(0x1c7)]['segmentCount']&&_0x455aae[_0x88402b(0x1d9)](_0x44665e[_0x88402b(0x1c7)]['segmentCount']+_0x88402b(0x1d1)+(_0x44665e[_0x88402b(0x1c7)][_0x88402b(0x1e6)]!==0x1?'s':'')),_0x44665e['metadata']['folderCount']&&_0x455aae[_0x88402b(0x1d9)](_0x44665e[_0x88402b(0x1c7)]['folderCount']+_0x88402b(0x1e2)+(_0x44665e[_0x88402b(0x1c7)][_0x88402b(0x1e3)]!==0x1?'s':'')),_0x44665e[_0x88402b(0x1c7)][_0x88402b(0x1d4)]&&_0x455aae[_0x88402b(0x1d9)](_0x44665e[_0x88402b(0x1c7)][_0x88402b(0x1d4)]+_0x88402b(0x1c5)+(_0x44665e[_0x88402b(0x1c7)][_0x88402b(0x1d4)]!==0x1?'s':'')),_0x455aae[_0x88402b(0x1cd)]>0x0&&(_0x3d0ad3+=a189_0x1d4b71[_0x88402b(0x1df)]('\x20('+_0x455aae['join'](',\x20')+')'));}else{if(_0x44665e['type']==='segment'&&_0x44665e['population']!==undefined)_0x3d0ad3+=a189_0x1d4b71[_0x88402b(0x1df)]('\x20('+formatRows(_0x44665e[_0x88402b(0x1f5)])+')');else _0x44665e['type']===_0x88402b(0x1ec)&&_0x44665e[_0x88402b(0x1cb)]&&(_0x3d0ad3+=a189_0x1d4b71['dim']('\x20'+getJourneyStateIndicator(_0x44665e[_0x88402b(0x1cb)])));}}_0x124212[_0x88402b(0x1d9)](_0x3d0ad3);if(_0x44665e[_0x88402b(0x1e1)]&&_0x44665e[_0x88402b(0x1e1)][_0x88402b(0x1cd)]>0x0){let _0x47d998;if(_0x3dd575===0x0)_0x47d998='';else _0x49fa47[_0x88402b(0x1ee)]?_0x47d998=_0x2b2515+(_0x2e5c07?_0x88402b(0x1c4):a189_0x1d4b71[_0x88402b(0x1df)]('│')+_0x88402b(0x1f1)):_0x47d998=_0x2b2515+_0x49fa47[_0x88402b(0x1f9)];const _0x593ab3=formatTree(_0x44665e['children'],_0x49fa47,_0x3dd575+0x1,_0x47d998);_0x124212[_0x88402b(0x1d9)](_0x593ab3);}}return _0x124212[_0x88402b(0x1f4)]('\x0a');}function a189_0x61d5(){const _0x2b6b01=['population','launched','7tpyypQ','└──\x20','indent','folder','\x20\x20\x20\x20','\x20journey','3056760PTwFFs','metadata','3jhSdgw','🗺️\x20','(running)','state','(paused)','length','168iSmFPu','type','paused','\x20segment','sortKey','name','journeyCount','showIcons','📁\x20','journeyBundleName','getSegmentUrl','push','7813938RYczfm','153574oWtwuj','getJourneyUrl','141558dRhbDq','2937416TWNHWb','dim','base','children','\x20folder','folderCount','9BLhuVz','localeCompare','segmentCount','(draft)','🎯\x20','icon','(empty)','segment','journey','360190qqDlTX','showTreeLines','1160450GWIfNB','showMetadata','\x20\x20\x20','(completed)','map','join'];a189_0x61d5=function(){return _0x2b6b01;};return a189_0x61d5();}function a189_0x1623(_0x15bdbe,_0x25c436){_0x15bdbe=_0x15bdbe-0x1c4;const _0x61d5f6=a189_0x61d5();let _0x16237b=_0x61d5f6[_0x15bdbe];return _0x16237b;}export function formatFlatList(_0x3c659d,_0x319db5,_0x1f5632={},_0x2f5e22=[]){const _0x2941be=a189_0x1623,_0x123b98={...DEFAULT_OPTIONS,..._0x1f5632},_0x409bb5=[];for(const _0x26367b of _0x3c659d){_0x409bb5[_0x2941be(0x1d9)]({'sortKey':_0x26367b[_0x2941be(0x1d3)],'displayName':_0x26367b['name'],'icon':_0x123b98['showIcons']?'📁':'','metadata':undefined});}for(const _0x484c39 of _0x319db5){const _0x1d5139=_0x123b98[_0x2941be(0x1f0)]&&_0x484c39[_0x2941be(0x1f5)]!==undefined?a189_0x1d4b71[_0x2941be(0x1df)]('\x20('+formatRows(_0x484c39[_0x2941be(0x1f5)])+')'):'',_0x35f3c8=_0x123b98[_0x2941be(0x1d8)]?hyperlink(_0x484c39[_0x2941be(0x1d3)],_0x123b98[_0x2941be(0x1d8)](_0x484c39['id'])):_0x484c39[_0x2941be(0x1d3)];_0x409bb5[_0x2941be(0x1d9)]({'sortKey':_0x484c39[_0x2941be(0x1d3)],'displayName':_0x35f3c8,'icon':_0x123b98[_0x2941be(0x1d5)]?'🎯':'','metadata':_0x1d5139});}for(const _0x1fb15d of _0x2f5e22){const _0x1a17f1=getJourneyStateIndicator(_0x1fb15d[_0x2941be(0x1cb)]),_0x30d806=_0x123b98[_0x2941be(0x1f0)]?a189_0x1d4b71['dim']('\x20'+_0x1a17f1):'',_0x309da6=_0x123b98[_0x2941be(0x1dc)]?hyperlink(_0x1fb15d[_0x2941be(0x1d7)],_0x123b98['getJourneyUrl'](_0x1fb15d['id'])):_0x1fb15d[_0x2941be(0x1d7)];_0x409bb5[_0x2941be(0x1d9)]({'sortKey':_0x1fb15d[_0x2941be(0x1d7)],'displayName':_0x309da6,'icon':_0x123b98[_0x2941be(0x1d5)]?'🗺️':'','metadata':_0x30d806});}_0x409bb5['sort']((_0x43d9b7,_0x4de333)=>_0x43d9b7[_0x2941be(0x1d2)][_0x2941be(0x1e5)](_0x4de333[_0x2941be(0x1d2)],undefined,{'sensitivity':_0x2941be(0x1e0)}));if(_0x409bb5['length']===0x0)return _0x2941be(0x1ea);const _0x21798f=_0x409bb5[_0x2941be(0x1f3)](_0x42c9ab=>{const _0x37be74=_0x2941be,_0x5dcadb=_0x42c9ab[_0x37be74(0x1e9)]?_0x42c9ab['icon']+'\x20':'',_0x48c980=_0x42c9ab[_0x37be74(0x1c7)]||'';return''+_0x5dcadb+_0x42c9ab['displayName']+_0x48c980;});return _0x21798f[_0x2941be(0x1f4)]('\x0a');}function getJourneyStateIndicator(_0x37807e){const _0x53e924=a189_0x1623;switch(_0x37807e){case'draft':return _0x53e924(0x1e7);case _0x53e924(0x1f6):return _0x53e924(0x1ca);case _0x53e924(0x1d0):return _0x53e924(0x1cc);case'completed':return _0x53e924(0x1f2);default:return'('+_0x37807e+')';}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a190_0x4ab9(){const _0x43a3f2=['7720016srXppM','1855840mgyJGP','error','128836jdfbZy','Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.','Downloaded\x20archive\x20is\x20too\x20small\x20(','equals','WORKFLOW_ARCHIVE_CORRUPTED','26816976uvHiZl','Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.','10ndyqpI','toString','from','6BzJxwv','(empty\x20response)','5032280tZrHmo','trim','\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.','The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.','length','charCodeAt','utf-8','message','Archive\x20validation\x20failed\x20with\x20unknown\x20error','1582622DDCoGA','subarray','helpText','3uOQZal','8855455xeaHxn','\x20Server\x20response\x20preview:\x20'];a190_0x4ab9=function(){return _0x43a3f2;};return a190_0x4ab9();}const a190_0x1e6f21=a190_0x5f16;(function(_0x4a0567,_0xb7ce04){const _0x57eeb=a190_0x5f16,_0x5ec9d7=_0x4a0567();while(!![]){try{const _0x335fae=parseInt(_0x57eeb(0xee))/0x1+-parseInt(_0x57eeb(0xd9))/0x2*(-parseInt(_0x57eeb(0xf1))/0x3)+-parseInt(_0x57eeb(0xd7))/0x4+-parseInt(_0x57eeb(0xe5))/0x5+parseInt(_0x57eeb(0xe3))/0x6*(-parseInt(_0x57eeb(0xd4))/0x7)+-parseInt(_0x57eeb(0xd6))/0x8+parseInt(_0x57eeb(0xde))/0x9*(parseInt(_0x57eeb(0xe0))/0xa);if(_0x335fae===_0xb7ce04)break;else _0x5ec9d7['push'](_0x5ec9d7['shift']());}catch(_0x1d43f5){_0x5ec9d7['push'](_0x5ec9d7['shift']());}}}(a190_0x4ab9,0xe220d));import{SDKError,ErrorCode}from'../errors.js';function a190_0x5f16(_0x16d02c,_0x1ce73e){_0x16d02c=_0x16d02c-0xd4;const _0x4ab981=a190_0x4ab9();let _0x5f16bd=_0x4ab981[_0x16d02c];return _0x5f16bd;}const GZIP_MAGIC=Buffer[a190_0x1e6f21(0xe2)]([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x2c8d18){const _0x59f73d=a190_0x1e6f21;if(_0x2c8d18['length']<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x2c8d18[_0x59f73d(0xe9)],'error':{'message':_0x59f73d(0xdb)+_0x2c8d18['length']+_0x59f73d(0xe7),'preview':getContentPreview(_0x2c8d18),'helpText':_0x59f73d(0xda)}};if(!_0x2c8d18[_0x59f73d(0xef)](0x0,0x2)[_0x59f73d(0xdc)](GZIP_MAGIC)){const _0x4e6cfd=getContentPreview(_0x2c8d18),_0x204597=_0x4e6cfd?_0x59f73d(0xd5)+_0x4e6cfd:'';return{'isValid':![],'size':_0x2c8d18[_0x59f73d(0xe9)],'error':{'message':_0x59f73d(0xdf)+_0x204597,'preview':_0x4e6cfd,'helpText':_0x59f73d(0xe8)}};}return{'isValid':!![],'size':_0x2c8d18[_0x59f73d(0xe9)]};}function getContentPreview(_0x4b5869){const _0x283e67=a190_0x1e6f21;if(_0x4b5869[_0x283e67(0xe9)]===0x0)return _0x283e67(0xe4);const _0x5c406c=_0x4b5869[_0x283e67(0xef)](0x0,0xc8)[_0x283e67(0xe1)](_0x283e67(0xeb)),_0x2b9484=_0x5c406c['split']('')['filter'](_0x3cfdcd=>{const _0x195f04=_0x283e67,_0xc3e5a2=_0x3cfdcd[_0x195f04(0xea)](0x0);return _0xc3e5a2>=0x20&&_0xc3e5a2<0x7f||_0xc3e5a2===0xa||_0xc3e5a2===0xd||_0xc3e5a2===0x9;})['length'],_0x250e39=_0x2b9484/_0x5c406c['length'];if(_0x250e39>0.8){const _0x370da5=_0x5c406c['slice'](0x0,0x64)[_0x283e67(0xe6)]();return _0x370da5[_0x283e67(0xe9)]<_0x5c406c[_0x283e67(0xe6)]()[_0x283e67(0xe9)]?_0x370da5+'...':_0x370da5;}return undefined;}export function throwArchiveValidationError(_0xca6395){const _0x5501cf=a190_0x1e6f21;if(!_0xca6395[_0x5501cf(0xd8)])throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x5501cf(0xed));throw new SDKError(ErrorCode[_0x5501cf(0xdd)],_0xca6395['error'][_0x5501cf(0xec)],undefined,{'helpText':_0xca6395[_0x5501cf(0xd8)][_0x5501cf(0xf0)]});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x51e5ce,_0x2f7a43){const _0x37072=a191_0x5055,_0x55217c=_0x51e5ce();while(!![]){try{const _0x473fbc=parseInt(_0x37072(0xbc))/0x1*(parseInt(_0x37072(0xad))/0x2)+-parseInt(_0x37072(0xba))/0x3*(parseInt(_0x37072(0xb0))/0x4)+-parseInt(_0x37072(0xb5))/0x5+-parseInt(_0x37072(0xb8))/0x6*(parseInt(_0x37072(0xb4))/0x7)+parseInt(_0x37072(0xa3))/0x8*(-parseInt(_0x37072(0xbf))/0x9)+parseInt(_0x37072(0xa9))/0xa*(-parseInt(_0x37072(0xa0))/0xb)+parseInt(_0x37072(0x9d))/0xc;if(_0x473fbc===_0x2f7a43)break;else _0x55217c['push'](_0x55217c['shift']());}catch(_0x11750d){_0x55217c['push'](_0x55217c['shift']());}}}(a191_0x1967,0x6141f));function a191_0x5055(_0x57aa32,_0x5841f2){_0x57aa32=_0x57aa32-0x9b;const _0x196794=a191_0x1967();let _0x50553e=_0x196794[_0x57aa32];return _0x50553e;}import{promises as a191_0x1676c5}from'fs';import a191_0x561768 from'path';import a191_0x517d3f from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';export async function prepareCloneWorkflow(_0x3ef333,_0x4ac300,_0x56bcbb,_0x32be99={}){const _0x26c0af=a191_0x5055,{client:_0x341e74}=_0x3ef333,_0x26f2ef=a191_0x561768[_0x26c0af(0x9f)](_0x4ac300);try{await a191_0x1676c5['access'](_0x26f2ef);}catch{throw new Error('Source\x20directory\x20not\x20found:\x20'+_0x4ac300);}const _0x184a93=tryFindWorkflowTdxConfig(_0x26f2ef),_0x12c709=_0x184a93?.[_0x26c0af(0x9b)]['workflow_project'],_0x2a2f90=_0x32be99[_0x26c0af(0xab)]||new Date()['toISOString']()[_0x26c0af(0xb7)](/[:.]/g,'-');if(!_0x32be99[_0x26c0af(0xb2)]){const _0x4b52fa=await a191_0x1676c5[_0x26c0af(0xb1)](_0x26f2ef),_0x10a7f3=_0x4b52fa[_0x26c0af(0xa4)](_0x499e76=>_0x499e76[_0x26c0af(0xbd)](WORKFLOW_FILE_EXTENSION));if(_0x10a7f3['length']===0x0)throw new Error(_0x26c0af(0xa8)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20'+_0x26f2ef);}const _0xf60810=await getProjectFiles(_0x26f2ef);let _0x2273d1=![],_0x28751b;try{const _0x29fd7e=await _0x341e74[_0x26c0af(0xaf)]({'name_pattern':_0x56bcbb}),_0x401b3a=_0x29fd7e[_0x26c0af(0xbb)][_0x26c0af(0xb9)](_0xefd483=>_0xefd483['name']===_0x56bcbb);_0x401b3a&&(_0x2273d1=!![],_0x28751b=_0x401b3a['id']);}catch{}return{'sourceDir':_0x26f2ef,'sourceProjectName':_0x12c709,'newProjectName':_0x56bcbb,'revision':_0x2a2f90,'fileCount':_0xf60810['length'],'files':_0xf60810,'targetExists':_0x2273d1,'existingProjectId':_0x28751b};}export async function executeCloneWorkflow(_0x1bd1b3,_0x2d5f70){const _0x3b5951=a191_0x5055,_0x5c199e=await import(_0x3b5951(0xaa)),{client:_0x1ccdfc}=_0x1bd1b3,_0x5d518b=await getProjectFiles(_0x2d5f70[_0x3b5951(0xa7)]),_0x3bd0fe=await a191_0x1676c5[_0x3b5951(0x9e)](a191_0x561768[_0x3b5951(0xb6)](a191_0x517d3f[_0x3b5951(0xbe)](),_0x3b5951(0xae))),_0x1033ac=a191_0x561768[_0x3b5951(0xb6)](_0x3bd0fe,_0x3b5951(0xa2));try{await _0x5c199e[_0x3b5951(0xac)]({'file':_0x1033ac,'gzip':!![],'cwd':_0x2d5f70[_0x3b5951(0xa7)],'portable':!![]},_0x5d518b);const _0x17246d=await _0x1ccdfc['uploadProjectArchive'](_0x2d5f70[_0x3b5951(0xa5)],_0x2d5f70[_0x3b5951(0xab)],_0x1033ac);return{'sourceDir':_0x2d5f70[_0x3b5951(0xa7)],'sourceProjectName':_0x2d5f70['sourceProjectName'],'newProjectName':_0x17246d['name'],'newProjectId':_0x17246d['id'],'revision':_0x17246d['revision'],'fileCount':_0x5d518b['length'],'files':_0x5d518b};}finally{await a191_0x1676c5['rm'](_0x3bd0fe,{'recursive':!![],'force':!![]});}}function a191_0x1967(){const _0x13aa88=['replace','2154uGVUSN','find','2223657QCLsoe','data','3MpSYhA','endsWith','tmpdir','7104861jUfbwM','config','isDirectory','32357112SIfJmm','mkdtemp','resolve','22OGppwf','push','archive.tar.gz','8UuoreE','filter','newProjectName','tdx.json','sourceDir','No\x20','1121570OVSUvf','tar','revision','create','444946ZbgQpH','tdx-wf-clone-','listProjects','4AArheQ','readdir','skipValidation','name','12187NlDnUJ','2927485XxUPyC','join'];a191_0x1967=function(){return _0x13aa88;};return a191_0x1967();}async function getProjectFiles(_0x1bcbe1,_0x238056=''){const _0x2bdc4e=a191_0x5055,_0x5bbe48=[],_0x5d132e=await a191_0x1676c5[_0x2bdc4e(0xb1)](_0x1bcbe1,{'withFileTypes':!![]});for(const _0x5e3e60 of _0x5d132e){const _0x33a8c9=_0x238056?a191_0x561768['join'](_0x238056,_0x5e3e60[_0x2bdc4e(0xb3)]):_0x5e3e60[_0x2bdc4e(0xb3)];if(_0x5e3e60[_0x2bdc4e(0xb3)]===_0x2bdc4e(0xa6))continue;if(!shouldIncludeInArchive(_0x5e3e60[_0x2bdc4e(0xb3)]))continue;if(_0x5e3e60[_0x2bdc4e(0x9c)]()){const _0x292719=await getProjectFiles(a191_0x561768[_0x2bdc4e(0xb6)](_0x1bcbe1,_0x5e3e60[_0x2bdc4e(0xb3)]),_0x33a8c9);_0x5bbe48[_0x2bdc4e(0xa1)](..._0x292719);}else _0x5bbe48['push'](_0x33a8c9);}return _0x5bbe48;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a192_0x25f3(_0x3a0087,_0x2d839c){_0x3a0087=_0x3a0087-0x1b7;const _0x4b0fb2=a192_0x4b0f();let _0x25f331=_0x4b0fb2[_0x3a0087];return _0x25f331;}const a192_0x37c6d2=a192_0x25f3;function a192_0x4b0f(){const _0x2b282e=['upstreams','deleteSecret','kill','resolveProjectId','storeParams','listSecrets','join','sessionTime','limit','\x20workflow\x20files\x20found\x20in\x20project\x20directory','name','1100885vfoYpm','path','from','utf-8','data','status','startedAt','cancelRequested','find','readdir','latest','303704bGToFu','listWorkflows','bind','unlink','download','direct','extract','error','message','now','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','project','timezone','3106030bzmwdP','createdAt','workflow','projects','success','access','tar','test','retrySession','keys','No\x20','downloadProjectArchive','stateParams','toTime','10zspvfL','executeCloneProject','sessionUuid','259MCMRsO','fullName','index','projectName','isDirectory','includeRetried','13989jpJmNF','retryParams','64589624FdWksY','killAttempt','Cannot\x20read\x20workflow\x20file:\x20','sessions','applyPullProject','arrayBuffer','Kill\x20request\x20accepted','workflowName','Project\x20not\x20found:\x20','Project\x20directory\x20not\x20found:\x20','lastAttempt','map','push','last_id','startAttempt','sessionId','replace','revision','getAttemptTasks','client','tasks','listProjects','retryAttempt','workflows','1373457KJsgUg','toISOString','scheduleFrom','isGroup','finishedAt','clearScheduleAll','getAttempt','updatedAt','lastId','substring','setSecret','toString','indexOf','WORKFLOW_PROJECT_NOT_FOUND','11621898vMalqq','done','preparePushProject','tmpdir','allSettled','fromTask','executePushProject','listLogFiles','resumeFrom','412KamhTL','42dcBqHA','tdx-workflow-','logFiles','length','pullProject','retryAttemptName','listSessions','util','setSecrets','parentId','logs','NUMERIC_ID_PATTERN','rawCount','deleteProject','skipValidation','fromTime'];a192_0x4b0f=function(){return _0x2b282e;};return a192_0x4b0f();}(function(_0x38b697,_0x4343c9){const _0x94c65a=a192_0x25f3,_0x3fdde8=_0x38b697();while(!![]){try{const _0x62f7dd=-parseInt(_0x94c65a(0x1bb))/0x1+-parseInt(_0x94c65a(0x206))/0x2+-parseInt(_0x94c65a(0x21d))/0x3*(parseInt(_0x94c65a(0x1d2))/0x4)+parseInt(_0x94c65a(0x1ee))/0x5*(-parseInt(_0x94c65a(0x1d3))/0x6)+-parseInt(_0x94c65a(0x217))/0x7*(parseInt(_0x94c65a(0x1f9))/0x8)+-parseInt(_0x94c65a(0x1c9))/0x9*(-parseInt(_0x94c65a(0x214))/0xa)+parseInt(_0x94c65a(0x21f))/0xb;if(_0x62f7dd===_0x4343c9)break;else _0x3fdde8['push'](_0x3fdde8['shift']());}catch(_0xf74e44){_0x3fdde8['push'](_0x3fdde8['shift']());}}}(a192_0x4b0f,0xc5deb));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x364a17,_0x4a4e67,_0x17aa81=0x64){const _0x2c369d=a192_0x25f3,_0x2925a8=Math['min'](_0x4a4e67,MAX_PAGINATION_LIMIT),_0x2a245d=[];let _0x4dd3d1;while(_0x2a245d['length']<_0x2925a8){const _0x302f57=await _0x364a17(_0x17aa81,_0x4dd3d1),_0xb02362=_0x302f57[_0x2c369d(0x1df)]??_0x302f57[_0x2c369d(0x1f2)][_0x2c369d(0x1d6)];if(_0xb02362===0x0)break;_0x2a245d[_0x2c369d(0x22b)](..._0x302f57[_0x2c369d(0x1f2)]);if(!_0x302f57['lastId']||_0xb02362<_0x17aa81)break;_0x4dd3d1=_0x302f57[_0x2c369d(0x1c3)];}return _0x2a245d['slice'](0x0,_0x2925a8);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a192_0x37c6d2(0x1de)]=/^\d+$/;[a192_0x37c6d2(0x232)];constructor(_0x25736e){const _0x53f7d3=a192_0x37c6d2;this[_0x53f7d3(0x232)]=new WorkflowApiClient(_0x25736e);}async[a192_0x37c6d2(0x1e6)](_0x2290a3){const _0x4f2e98=a192_0x37c6d2;if(WorkflowSDK[_0x4f2e98(0x1de)][_0x4f2e98(0x20d)](_0x2290a3)){const _0x180065=await this[_0x4f2e98(0x232)]['getProject'](_0x2290a3);return{'id':_0x180065['id'],'name':_0x180065['name']};}const _0x37d9d3=await this['client'][_0x4f2e98(0x1b8)]({'name_pattern':_0x2290a3}),_0x4fef02=_0x37d9d3['data'][_0x4f2e98(0x1f6)](_0x45b83d=>_0x45b83d[_0x4f2e98(0x1ed)]===_0x2290a3);if(!_0x4fef02)throw new SDKError(ErrorCode[_0x4f2e98(0x1c8)],_0x4f2e98(0x227)+_0x2290a3);return{'id':_0x4fef02['id'],'name':_0x4fef02[_0x4f2e98(0x1ed)]};}async[a192_0x37c6d2(0x209)](_0x37e119,_0x51e90f){const _0xd49b33=a192_0x37c6d2,_0x3faf0c=_0x51e90f?.['limit']||0x64,_0x5c7045=await paginateResults((_0x14090e,_0x5e723f)=>this[_0xd49b33(0x232)][_0xd49b33(0x1b8)]({'name_pattern':_0x37e119,'limit':_0x14090e,'last_id':_0x5e723f??_0x51e90f?.[_0xd49b33(0x22c)]}),_0x3faf0c);return _0x5c7045['map'](_0x42ffed=>({..._0x42ffed,'project_id':_0x42ffed['id'],'project_name':_0x42ffed[_0xd49b33(0x1ed)]}));}async[a192_0x37c6d2(0x1ba)](_0x4904bb,_0x460857){const _0x89acf=a192_0x37c6d2,_0x2264bc=_0x460857?.[_0x89acf(0x1eb)]||0x64,_0x250688=await paginateResults((_0x4ea764,_0x37a8e0)=>this['client'][_0x89acf(0x1fa)]({'project_name':_0x4904bb,'limit':_0x4ea764,'last_id':_0x37a8e0??_0x460857?.['last_id']}),_0x2264bc);return _0x250688['map'](_0x34f1f0=>({'project_id':_0x34f1f0[_0x89acf(0x204)]?.['id'],'project_name':_0x34f1f0[_0x89acf(0x204)]?.['name'],'workflow_id':_0x34f1f0['id'],'workflow_name':_0x34f1f0[_0x89acf(0x1ed)],'revision':_0x34f1f0[_0x89acf(0x230)],'timezone':_0x34f1f0[_0x89acf(0x205)],'config':_0x34f1f0['config'],'id':_0x34f1f0['id'],'name':_0x34f1f0[_0x89acf(0x1ed)],'project':_0x34f1f0[_0x89acf(0x204)]}));}async[a192_0x37c6d2(0x222)](_0x275340){const _0x41c3c8=a192_0x37c6d2;let _0x406406;if(_0x275340?.[_0x41c3c8(0x21a)]){let _0x1c3b3a,_0x56d58d=![];while(!_0x56d58d){const _0x5daec1=await this[_0x41c3c8(0x232)][_0x41c3c8(0x1b8)]({'limit':0x64,'last_id':_0x1c3b3a}),_0x16252c=_0x5daec1[_0x41c3c8(0x1f2)][_0x41c3c8(0x1f6)](_0x5a78e6=>_0x5a78e6[_0x41c3c8(0x1ed)]===_0x275340[_0x41c3c8(0x21a)]);if(_0x16252c){_0x406406=_0x16252c['id'],_0x56d58d=!![];break;}if(!_0x5daec1['lastId']||_0x5daec1['data'][_0x41c3c8(0x1d6)]===0x0)break;_0x1c3b3a=_0x5daec1[_0x41c3c8(0x1c3)];}if(!_0x406406)throw new SDKError(ErrorCode[_0x41c3c8(0x1c8)],_0x41c3c8(0x227)+_0x275340[_0x41c3c8(0x21a)]);}const _0x1464e0=_0x275340?.[_0x41c3c8(0x1eb)]||0x64,_0x4e2134=await paginateResults((_0x517cc0,_0x75cdf0)=>this[_0x41c3c8(0x232)][_0x41c3c8(0x1d9)]({'project_id':_0x406406,'project_name':_0x275340?.[_0x41c3c8(0x21a)],'workflow_name':_0x275340?.[_0x41c3c8(0x226)],'status':_0x275340?.[_0x41c3c8(0x1f3)],'from_time':_0x275340?.[_0x41c3c8(0x1e2)],'to_time':_0x275340?.[_0x41c3c8(0x213)],'limit':_0x517cc0,'last_id':_0x75cdf0??_0x275340?.['last_id']}),_0x1464e0);return _0x4e2134[_0x41c3c8(0x22a)](_0x3adf8e=>({'project_id':_0x3adf8e[_0x41c3c8(0x204)]?.['id'],'project_name':_0x3adf8e['project']?.[_0x41c3c8(0x1ed)],'workflow_id':_0x3adf8e[_0x41c3c8(0x208)]?.['id'],'workflow_name':_0x3adf8e['workflow']?.[_0x41c3c8(0x1ed)],'session_id':_0x3adf8e['id'],'sessionUuid':_0x3adf8e[_0x41c3c8(0x216)],'sessionTime':_0x3adf8e[_0x41c3c8(0x1ea)],'lastAttempt':_0x3adf8e[_0x41c3c8(0x229)],'id':_0x3adf8e['id'],'project':_0x3adf8e[_0x41c3c8(0x204)],'workflow':_0x3adf8e[_0x41c3c8(0x208)]}));}async['attempts'](_0x117b38){const _0xdbc341=a192_0x37c6d2,_0x8e9041=_0x117b38?.['limit']||0x64,_0x296f33=await paginateResults((_0x49d016,_0x4a6b3b)=>this['client']['listAttempts']({'project_name':_0x117b38?.['projectName'],'workflow_name':_0x117b38?.[_0xdbc341(0x226)],'include_retried':_0x117b38?.[_0xdbc341(0x21c)],'limit':_0x49d016,'last_id':_0x4a6b3b??_0x117b38?.['last_id']}),_0x8e9041);return _0x296f33[_0xdbc341(0x22a)](_0x371e49=>({'project_id':_0x371e49[_0xdbc341(0x204)]?.['id'],'project_name':_0x371e49[_0xdbc341(0x204)]?.[_0xdbc341(0x1ed)],'workflow_id':_0x371e49['workflow']?.['id'],'workflow_name':_0x371e49[_0xdbc341(0x208)]?.[_0xdbc341(0x1ed)],'session_id':_0x371e49[_0xdbc341(0x22e)],'sessionUuid':_0x371e49[_0xdbc341(0x216)],'sessionTime':_0x371e49['sessionTime'],'attempt_id':_0x371e49['id'],'attempt_index':_0x371e49[_0xdbc341(0x219)],'retryAttemptName':_0x371e49[_0xdbc341(0x1d8)],'done':_0x371e49[_0xdbc341(0x1ca)],'success':_0x371e49[_0xdbc341(0x20a)],'cancelRequested':_0x371e49[_0xdbc341(0x1f5)],'params':_0x371e49['params'],'createdAt':_0x371e49[_0xdbc341(0x207)],'finishedAt':_0x371e49[_0xdbc341(0x1bf)],'id':_0x371e49['id'],'index':_0x371e49[_0xdbc341(0x219)],'project':_0x371e49[_0xdbc341(0x204)],'workflow':_0x371e49[_0xdbc341(0x208)]}));}async['attempt'](_0x2b2aa3){const _0x47471e=a192_0x37c6d2,_0x15755b=await this[_0x47471e(0x232)][_0x47471e(0x1c1)](_0x2b2aa3);return _0x15755b;}async[a192_0x37c6d2(0x1b7)](_0x3b9632,_0x20bb59=![]){const _0x46de84=a192_0x37c6d2,_0x272c74=await this[_0x46de84(0x232)][_0x46de84(0x231)](_0x3b9632,_0x20bb59);return _0x272c74['map'](_0x5c1bdf=>({'task_id':_0x5c1bdf['id'],'task_name':_0x5c1bdf[_0x46de84(0x218)],'parentId':_0x5c1bdf[_0x46de84(0x1dc)],'config':_0x5c1bdf['config'],'upstreams':_0x5c1bdf[_0x46de84(0x1e3)],'state':_0x5c1bdf['state'],'exportParams':_0x5c1bdf['exportParams'],'storeParams':_0x5c1bdf[_0x46de84(0x1e7)],'stateParams':_0x5c1bdf[_0x46de84(0x212)],'updatedAt':_0x5c1bdf[_0x46de84(0x1c2)],'retryAt':_0x5c1bdf['retryAt'],'startedAt':_0x5c1bdf[_0x46de84(0x1f4)],'error':_0x5c1bdf[_0x46de84(0x200)],'isGroup':_0x5c1bdf[_0x46de84(0x1be)],'id':_0x5c1bdf['id'],'fullName':_0x5c1bdf[_0x46de84(0x218)]}));}async[a192_0x37c6d2(0x1d5)](_0x3403d5,_0x4f8c1f){const _0xfe284c=a192_0x37c6d2;return await this['client'][_0xfe284c(0x1d0)](_0x3403d5,_0x4f8c1f);}async[a192_0x37c6d2(0x1dd)](_0xc74afe,_0x4430e2){const _0x1ee025=a192_0x37c6d2,_0x3f8df6=await import('zlib'),{promisify:_0x2977ae}=await import(_0x1ee025(0x1da)),_0x24c121=_0x2977ae(_0x3f8df6['gunzip']),_0x3ac620=await this[_0x1ee025(0x232)][_0x1ee025(0x1d0)](_0xc74afe,_0x4430e2);if(_0x3ac620[_0x1ee025(0x1d6)]===0x0)return'';const _0xad62fb=[];for(const _0x4f6db0 of _0x3ac620){if(!_0x4f6db0['direct'])continue;const _0x2c9221=await fetch(_0x4f6db0[_0x1ee025(0x1fe)]);if(!_0x2c9221['ok'])throw new Error('Failed\x20to\x20download\x20log\x20file:\x20'+_0x2c9221[_0x1ee025(0x1f3)]);const _0x52b26e=Buffer[_0x1ee025(0x1f0)](await _0x2c9221[_0x1ee025(0x224)]()),_0x3b37cf=await _0x24c121(_0x52b26e);_0xad62fb[_0x1ee025(0x22b)](_0x3b37cf[_0x1ee025(0x1c6)](_0x1ee025(0x1f1)));}return _0xad62fb[_0x1ee025(0x1e9)]('\x0a');}async[a192_0x37c6d2(0x1e5)](_0x9c8d03,_0x2b4107){const _0x39a10a=a192_0x37c6d2,_0x3e65c0=await this[_0x39a10a(0x232)][_0x39a10a(0x220)](_0x9c8d03,_0x2b4107);return _0x3e65c0?.[_0x39a10a(0x201)]??_0x39a10a(0x225);}async['retrySession'](_0x590753,_0x3a4b2c){const _0xb007c7=a192_0x37c6d2,_0x59dbbb=await this[_0xb007c7(0x232)][_0xb007c7(0x20e)](_0x590753,{'from_task':_0x3a4b2c?.[_0xb007c7(0x1ce)],'retry_params':_0x3a4b2c?.[_0xb007c7(0x21e)]});return{'attemptId':_0x59dbbb['id'],'sessionId':_0x59dbbb['sessionId']};}async[a192_0x37c6d2(0x1b9)](_0x11cf40,_0x25c2d8){const _0x508c98=a192_0x37c6d2,_0x582707=await this[_0x508c98(0x232)][_0x508c98(0x1b9)](_0x11cf40,{'resume_from':_0x25c2d8?.[_0x508c98(0x1d1)],'retry_params':_0x25c2d8?.['retryParams'],'force':_0x25c2d8?.['force']});return{'attemptId':_0x582707['id'],'sessionId':_0x582707[_0x508c98(0x22e)]};}async['run'](_0x2b2f98,_0x8c6aa4={},_0x18495d){const _0x1c24f6=a192_0x37c6d2,_0x159256=_0x2b2f98[_0x1c24f6(0x1c7)]('.');let _0x102c10,_0x514fc6;if(_0x159256===-0x1)throw new Error(_0x1c24f6(0x203));_0x102c10=_0x2b2f98[_0x1c24f6(0x1c4)](0x0,_0x159256),_0x514fc6=_0x2b2f98[_0x1c24f6(0x1c4)](_0x159256+0x1);if(!_0x102c10||!_0x514fc6)throw new Error('Invalid\x20workflow\x20format:\x20'+_0x2b2f98+'.\x20Expected\x20\x22project.workflow\x22');const _0x222d69=_0x18495d?.[_0x1c24f6(0x1ea)]||new Date()[_0x1c24f6(0x1bc)]();return await this['client'][_0x1c24f6(0x22d)]({'projectName':_0x102c10,'workflowName':_0x514fc6,'sessionTime':_0x222d69,'params':_0x8c6aa4});}async[a192_0x37c6d2(0x1fd)](_0x82e8d9,_0x3b4cfe,_0x4638e3){const _0xce6a0c=a192_0x37c6d2,{promises:_0x51336b}=await import('fs'),_0x581f01=await import(_0xce6a0c(0x1ef)),_0x1008e8=await import('os'),_0x4ecec4=await import(_0xce6a0c(0x20c)),{id:_0x4df414,name:_0x320b17}=await this[_0xce6a0c(0x1e6)](_0x82e8d9),_0x540542=_0x1008e8[_0xce6a0c(0x1cc)](),_0x52d53d=_0x581f01[_0xce6a0c(0x1e9)](_0x540542,_0xce6a0c(0x1d4)+_0x4df414+'-'+Date[_0xce6a0c(0x202)]()+'.tar.gz');try{await this['client'][_0xce6a0c(0x211)](_0x4df414,_0x52d53d,_0x4638e3?.['revision']);const _0x64c261=_0x581f01[_0xce6a0c(0x1e9)](_0x3b4cfe,_0x320b17);await _0x51336b['mkdir'](_0x64c261,{'recursive':!![]}),await _0x4ecec4[_0xce6a0c(0x1ff)]({'file':_0x52d53d,'cwd':_0x64c261,'gzip':!![]});const _0x2b265a=async _0x317b39=>{const _0xb70122=_0xce6a0c;let _0x2c93f7=0x0;const _0x25e066=await _0x51336b[_0xb70122(0x1f7)](_0x317b39,{'withFileTypes':!![]});for(const _0x19866c of _0x25e066){const _0x11388a=_0x581f01[_0xb70122(0x1e9)](_0x317b39,_0x19866c[_0xb70122(0x1ed)]);if(_0x19866c['isFile']())_0x2c93f7++;else _0x19866c[_0xb70122(0x21b)]()&&(_0x2c93f7+=await _0x2b265a(_0x11388a));}return _0x2c93f7;},_0x49040b=await _0x2b265a(_0x64c261);return{'projectName':_0x320b17,'revision':_0x4638e3?.['revision']||_0xce6a0c(0x1f8),'filesExtracted':_0x49040b};}finally{try{await _0x51336b[_0xce6a0c(0x1fc)](_0x52d53d);}catch{}}}async[a192_0x37c6d2(0x22b)](_0x3d3263,_0x4eab82){const _0x4d580=a192_0x37c6d2,{promises:_0x759064}=await import('fs'),_0xdca359=await import(_0x4d580(0x1ef)),_0x4e7968=await import(_0x4d580(0x20c)),_0x56b8b2=_0x4eab82?.[_0x4d580(0x21a)]||_0xdca359['basename'](_0x3d3263),_0x54e7c7=_0x4eab82?.['revision']||new Date()[_0x4d580(0x1bc)]()[_0x4d580(0x22f)](/[:.]/g,'-');try{await _0x759064[_0x4d580(0x20b)](_0x3d3263);}catch{throw new Error(_0x4d580(0x228)+_0x3d3263);}if(!_0x4eab82?.[_0x4d580(0x1e1)]){const _0x12eb62=await _0x759064['readdir'](_0x3d3263),_0x37a7bb=_0x12eb62['filter'](_0x24208d=>_0x24208d['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x37a7bb[_0x4d580(0x1d6)]===0x0)throw new Error(_0x4d580(0x210)+WORKFLOW_FILE_EXTENSION+_0x4d580(0x1ec));for(const _0x5753a5 of _0x37a7bb){const _0x493ce6=_0xdca359[_0x4d580(0x1e9)](_0x3d3263,_0x5753a5);try{await _0x759064[_0x4d580(0x20b)](_0x493ce6);}catch{throw new Error(_0x4d580(0x221)+_0x5753a5);}}}const _0x480acd=async(_0x53c41a,_0x2ad78a='')=>{const _0x24398f=_0x4d580,_0x4ccc40=await _0x759064['readdir'](_0x53c41a,{'withFileTypes':!![]}),_0x32b541=[];for(const _0x370e8f of _0x4ccc40){const _0x2fb1c7=_0xdca359['join'](_0x2ad78a,_0x370e8f[_0x24398f(0x1ed)]),_0x3d7c5f=_0xdca359[_0x24398f(0x1e9)](_0x53c41a,_0x370e8f[_0x24398f(0x1ed)]);if(!shouldIncludeInArchive(_0x370e8f[_0x24398f(0x1ed)]))continue;_0x370e8f[_0x24398f(0x21b)]()?_0x32b541[_0x24398f(0x22b)](...await _0x480acd(_0x3d7c5f,_0x2fb1c7)):_0x32b541[_0x24398f(0x22b)](_0x2fb1c7);}return _0x32b541;},_0x3357d9=await _0x480acd(_0x3d3263),_0x5f504c=await import('os'),_0x53d4ed=_0x5f504c[_0x4d580(0x1cc)](),_0x322283=_0xdca359[_0x4d580(0x1e9)](_0x53d4ed,'tdx-workflow-push-'+Date['now']()+'.tar.gz');try{await _0x4e7968['create']({'file':_0x322283,'gzip':!![],'cwd':_0x3d3263,'portable':!![]},_0x3357d9);const _0x3c357f=await this[_0x4d580(0x232)]['uploadProjectArchive'](_0x56b8b2,_0x54e7c7,_0x322283,{'scheduleFrom':_0x4eab82?.[_0x4d580(0x1bd)],'clearSchedule':_0x4eab82?.['clearSchedule'],'clearScheduleAll':_0x4eab82?.[_0x4d580(0x1c0)]});return{'projectId':_0x3c357f['id'],'projectName':_0x3c357f[_0x4d580(0x1ed)],'revision':_0x3c357f[_0x4d580(0x230)]};}finally{try{await _0x759064[_0x4d580(0x1fc)](_0x322283);}catch{}}}async['delete'](_0x5e6d53){const _0x31d67f=a192_0x37c6d2,{id:_0xa12a17}=await this[_0x31d67f(0x1e6)](_0x5e6d53),_0x3b290c=await this[_0x31d67f(0x232)][_0x31d67f(0x1e0)](_0xa12a17);return{'projectId':_0x3b290c['id'],'projectName':_0x3b290c[_0x31d67f(0x1ed)]};}async[a192_0x37c6d2(0x1e8)](_0x52623e){const _0x61e930=a192_0x37c6d2,{id:_0x543d63,name:_0x32b2e7}=await this['resolveProjectId'](_0x52623e),_0x537865=await this[_0x61e930(0x232)][_0x61e930(0x1e8)](_0x543d63);return{'projectName':_0x32b2e7,'secrets':_0x537865};}async[a192_0x37c6d2(0x1c5)](_0x39965c,_0x3753ce,_0x3f8f85){const _0x24f88e=a192_0x37c6d2,{id:_0x18e5a5,name:_0x1f5f0b}=await this[_0x24f88e(0x1e6)](_0x39965c);return await this[_0x24f88e(0x232)][_0x24f88e(0x1c5)](_0x18e5a5,_0x3753ce,_0x3f8f85),{'projectName':_0x1f5f0b,'key':_0x3753ce};}async[a192_0x37c6d2(0x1db)](_0x2959ea,_0x4fe317){const _0x341692=a192_0x37c6d2,{id:_0x5e42ca,name:_0x202cdb}=await this['resolveProjectId'](_0x2959ea),_0xd71e44=Object[_0x341692(0x20f)](_0x4fe317),_0x5b9760=await Promise[_0x341692(0x1cd)](_0xd71e44[_0x341692(0x22a)](_0x525757=>this['client'][_0x341692(0x1c5)](_0x5e42ca,_0x525757,_0x4fe317[_0x525757]))),_0x236839=_0x5b9760[_0x341692(0x22a)]((_0x5b32a6,_0x54911a)=>_0x5b32a6['status']==='rejected'?_0xd71e44[_0x54911a]:null)['filter'](_0x7b73fe=>_0x7b73fe!==null);if(_0x236839['length']>0x0)throw new SDKError(ErrorCode['WORKFLOW_SECRET_SET_FAILED'],'Failed\x20to\x20set\x20secret'+(_0x236839[_0x341692(0x1d6)]>0x1?'s':'')+':\x20'+_0x236839[_0x341692(0x1e9)](',\x20'));return{'projectName':_0x202cdb,'keys':_0xd71e44};}async[a192_0x37c6d2(0x1e4)](_0x176633,_0x1a0376){const _0x43eec1=a192_0x37c6d2,{id:_0x12f64a,name:_0x4056e1}=await this[_0x43eec1(0x1e6)](_0x176633);return await this['client'][_0x43eec1(0x1e4)](_0x12f64a,_0x1a0376),{'projectName':_0x4056e1,'key':_0x1a0376};}async[a192_0x37c6d2(0x1d7)](_0x142d07,_0x3bfb8c){const _0x311ca5=a192_0x37c6d2;return pullWorkflow({'client':this[_0x311ca5(0x232)],'resolveProjectId':this[_0x311ca5(0x1e6)][_0x311ca5(0x1fb)](this)},_0x142d07,_0x3bfb8c);}async[a192_0x37c6d2(0x223)](_0x502638,_0x3dd684){const _0x40c029=a192_0x37c6d2;return applyPullResult({'client':this['client'],'resolveProjectId':this[_0x40c029(0x1e6)][_0x40c029(0x1fb)](this)},_0x502638,_0x3dd684);}async[a192_0x37c6d2(0x1cb)](_0x342676){const _0xb8921b=a192_0x37c6d2;return preparePushWorkflow({'client':this['client'],'resolveProjectId':this[_0xb8921b(0x1e6)][_0xb8921b(0x1fb)](this)},_0x342676);}async[a192_0x37c6d2(0x1cf)](_0x5f25e3){const _0x3889d6=a192_0x37c6d2;return executePushWorkflow({'client':this[_0x3889d6(0x232)],'resolveProjectId':this[_0x3889d6(0x1e6)][_0x3889d6(0x1fb)](this)},_0x5f25e3);}async['prepareCloneProject'](_0x316261,_0x865db9,_0x2c79a9){const _0x42e23c=a192_0x37c6d2;return prepareCloneWorkflow({'client':this[_0x42e23c(0x232)]},_0x316261,_0x865db9,_0x2c79a9);}async[a192_0x37c6d2(0x215)](_0x2cff07){return executeCloneWorkflow({'client':this['client']},_0x2cff07);}}
|
|
1
|
+
const a192_0x472e1b=a192_0x1210;(function(_0x2f4cf5,_0x41d508){const _0x358634=a192_0x1210,_0x2bd8c4=_0x2f4cf5();while(!![]){try{const _0x56c6de=parseInt(_0x358634(0xda))/0x1*(-parseInt(_0x358634(0xe6))/0x2)+parseInt(_0x358634(0xae))/0x3*(parseInt(_0x358634(0xea))/0x4)+parseInt(_0x358634(0xd4))/0x5*(parseInt(_0x358634(0xb7))/0x6)+-parseInt(_0x358634(0xed))/0x7+parseInt(_0x358634(0xfa))/0x8*(parseInt(_0x358634(0xba))/0x9)+parseInt(_0x358634(0xbe))/0xa+-parseInt(_0x358634(0xaf))/0xb;if(_0x56c6de===_0x41d508)break;else _0x2bd8c4['push'](_0x2bd8c4['shift']());}catch(_0x132bdb){_0x2bd8c4['push'](_0x2bd8c4['shift']());}}}(a192_0x2a42,0x4a614));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x54bce7,_0x1138e1,_0x2664eb=0x64){const _0x472607=a192_0x1210,_0x332425=Math[_0x472607(0x10f)](_0x1138e1,MAX_PAGINATION_LIMIT),_0x266e52=[];let _0x40915a;while(_0x266e52[_0x472607(0xdb)]<_0x332425){const _0x4b2061=await _0x54bce7(_0x2664eb,_0x40915a),_0x46bc89=_0x4b2061[_0x472607(0x10d)]??_0x4b2061[_0x472607(0xfc)][_0x472607(0xdb)];if(_0x46bc89===0x0)break;_0x266e52[_0x472607(0xbd)](..._0x4b2061[_0x472607(0xfc)]);if(!_0x4b2061[_0x472607(0xb0)]||_0x46bc89<_0x2664eb)break;_0x40915a=_0x4b2061[_0x472607(0xb0)];}return _0x266e52[_0x472607(0xc2)](0x0,_0x332425);}function a192_0x1210(_0x4b4a62,_0x328df5){_0x4b4a62=_0x4b4a62-0x95;const _0x2a42eb=a192_0x2a42();let _0x12109f=_0x2a42eb[_0x4b4a62];return _0x12109f;}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static ['NUMERIC_ID_PATTERN']=/^\d+$/;[a192_0x472e1b(0x109)];constructor(_0x3a2280){const _0x351edf=a192_0x472e1b;this[_0x351edf(0x109)]=new WorkflowApiClient(_0x3a2280);}async[a192_0x472e1b(0xcb)](_0x4b5c16){const _0x42deba=a192_0x472e1b;if(WorkflowSDK[_0x42deba(0x105)][_0x42deba(0xf2)](_0x4b5c16)){const _0x38fe0c=await this[_0x42deba(0x109)][_0x42deba(0x101)](_0x4b5c16);return{'id':_0x38fe0c['id'],'name':_0x38fe0c['name']};}const _0x2356ea=await this[_0x42deba(0x109)][_0x42deba(0xe5)]({'name_pattern':_0x4b5c16}),_0x37c5e4=_0x2356ea[_0x42deba(0xfc)]['find'](_0x42fb42=>_0x42fb42['name']===_0x4b5c16);if(!_0x37c5e4)throw new SDKError(ErrorCode[_0x42deba(0xa1)],_0x42deba(0x100)+_0x4b5c16);return{'id':_0x37c5e4['id'],'name':_0x37c5e4[_0x42deba(0xd5)]};}async['projects'](_0x32371d,_0x3d0da4){const _0x306ab2=a192_0x472e1b,_0x365b98=_0x3d0da4?.[_0x306ab2(0x9d)]||0x64,_0x145f5d=await paginateResults((_0x2b8208,_0x2cfda8)=>this[_0x306ab2(0x109)][_0x306ab2(0xe5)]({'name_pattern':_0x32371d,'limit':_0x2b8208,'last_id':_0x2cfda8??_0x3d0da4?.['last_id']}),_0x365b98);return _0x145f5d['map'](_0x43f5be=>({..._0x43f5be,'project_id':_0x43f5be['id'],'project_name':_0x43f5be['name']}));}async[a192_0x472e1b(0x98)](_0x540b55,_0x3d4524){const _0x55e9d6=a192_0x472e1b,_0x5b9391=_0x3d4524?.['limit']||0x64,_0x571bb1=await paginateResults((_0x1391cc,_0x2b7030)=>this['client'][_0x55e9d6(0xd7)]({'project_name':_0x540b55,'limit':_0x1391cc,'last_id':_0x2b7030??_0x3d4524?.['last_id']}),_0x5b9391);return _0x571bb1['map'](_0x9033f9=>({'project_id':_0x9033f9[_0x55e9d6(0xf6)]?.['id'],'project_name':_0x9033f9[_0x55e9d6(0xf6)]?.['name'],'workflow_id':_0x9033f9['id'],'workflow_name':_0x9033f9['name'],'revision':_0x9033f9['revision'],'timezone':_0x9033f9[_0x55e9d6(0x10a)],'config':_0x9033f9[_0x55e9d6(0xc5)],'id':_0x9033f9['id'],'name':_0x9033f9[_0x55e9d6(0xd5)],'project':_0x9033f9['project']}));}async[a192_0x472e1b(0xcc)](_0x3f1285){const _0x33b92b=a192_0x472e1b;let _0x1f22be;if(_0x3f1285?.[_0x33b92b(0xc1)]){let _0x5de6ca,_0x2e59cd=![];while(!_0x2e59cd){const _0x571f32=await this[_0x33b92b(0x109)][_0x33b92b(0xe5)]({'limit':0x64,'last_id':_0x5de6ca}),_0x370457=_0x571f32[_0x33b92b(0xfc)][_0x33b92b(0xc4)](_0x48769b=>_0x48769b[_0x33b92b(0xd5)]===_0x3f1285[_0x33b92b(0xc1)]);if(_0x370457){_0x1f22be=_0x370457['id'],_0x2e59cd=!![];break;}if(!_0x571f32['lastId']||_0x571f32[_0x33b92b(0xfc)][_0x33b92b(0xdb)]===0x0)break;_0x5de6ca=_0x571f32['lastId'];}if(!_0x1f22be)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],_0x33b92b(0x100)+_0x3f1285[_0x33b92b(0xc1)]);}const _0x5ad5c0=_0x3f1285?.[_0x33b92b(0x9d)]||0x64,_0x2eb0c9=await paginateResults((_0x19b961,_0x50f6bc)=>this[_0x33b92b(0x109)]['listSessions']({'project_id':_0x1f22be,'project_name':_0x3f1285?.[_0x33b92b(0xc1)],'workflow_name':_0x3f1285?.[_0x33b92b(0x9c)],'status':_0x3f1285?.[_0x33b92b(0xaa)],'from_time':_0x3f1285?.[_0x33b92b(0xce)],'to_time':_0x3f1285?.[_0x33b92b(0xcd)],'limit':_0x19b961,'last_id':_0x50f6bc??_0x3f1285?.[_0x33b92b(0xfe)]}),_0x5ad5c0);return _0x2eb0c9[_0x33b92b(0xe3)](_0x43023c=>({'project_id':_0x43023c[_0x33b92b(0xf6)]?.['id'],'project_name':_0x43023c[_0x33b92b(0xf6)]?.['name'],'workflow_id':_0x43023c[_0x33b92b(0xb1)]?.['id'],'workflow_name':_0x43023c[_0x33b92b(0xb1)]?.[_0x33b92b(0xd5)],'session_id':_0x43023c['id'],'sessionUuid':_0x43023c['sessionUuid'],'sessionTime':_0x43023c[_0x33b92b(0xc6)],'lastAttempt':_0x43023c[_0x33b92b(0x97)],'id':_0x43023c['id'],'project':_0x43023c[_0x33b92b(0xf6)],'workflow':_0x43023c['workflow']}));}async[a192_0x472e1b(0xe4)](_0x9eb31e){const _0x5264ca=a192_0x472e1b,_0x4c87b3=_0x9eb31e?.['limit']||0x64,_0x5d198b=await paginateResults((_0xc0161c,_0x3e7b24)=>this['client'][_0x5264ca(0x9e)]({'project_name':_0x9eb31e?.[_0x5264ca(0xc1)],'workflow_name':_0x9eb31e?.[_0x5264ca(0x9c)],'include_retried':_0x9eb31e?.[_0x5264ca(0xa3)],'limit':_0xc0161c,'last_id':_0x3e7b24??_0x9eb31e?.[_0x5264ca(0xfe)]}),_0x4c87b3);return _0x5d198b[_0x5264ca(0xe3)](_0xcda348=>({'project_id':_0xcda348['project']?.['id'],'project_name':_0xcda348[_0x5264ca(0xf6)]?.[_0x5264ca(0xd5)],'workflow_id':_0xcda348[_0x5264ca(0xb1)]?.['id'],'workflow_name':_0xcda348['workflow']?.[_0x5264ca(0xd5)],'session_id':_0xcda348[_0x5264ca(0x9a)],'sessionUuid':_0xcda348['sessionUuid'],'sessionTime':_0xcda348[_0x5264ca(0xc6)],'attempt_id':_0xcda348['id'],'attempt_index':_0xcda348[_0x5264ca(0xec)],'retryAttemptName':_0xcda348[_0x5264ca(0xc7)],'done':_0xcda348['done'],'success':_0xcda348['success'],'cancelRequested':_0xcda348[_0x5264ca(0x95)],'params':_0xcda348[_0x5264ca(0xac)],'createdAt':_0xcda348['createdAt'],'finishedAt':_0xcda348[_0x5264ca(0xd6)],'id':_0xcda348['id'],'index':_0xcda348[_0x5264ca(0xec)],'project':_0xcda348[_0x5264ca(0xf6)],'workflow':_0xcda348[_0x5264ca(0xb1)]}));}async[a192_0x472e1b(0xb4)](_0x5794e0){const _0x4d538f=a192_0x472e1b,_0x1fc228=await this[_0x4d538f(0x109)]['getAttempt'](_0x5794e0);return _0x1fc228;}async[a192_0x472e1b(0xd9)](_0x4b2e29,_0x19323e=![]){const _0x4745d1=a192_0x472e1b,_0x49400f=await this[_0x4745d1(0x109)][_0x4745d1(0x9b)](_0x4b2e29,_0x19323e);return _0x49400f[_0x4745d1(0xe3)](_0x4ba6cc=>({'task_id':_0x4ba6cc['id'],'task_name':_0x4ba6cc[_0x4745d1(0xd1)],'parentId':_0x4ba6cc['parentId'],'config':_0x4ba6cc['config'],'upstreams':_0x4ba6cc[_0x4745d1(0xff)],'state':_0x4ba6cc['state'],'exportParams':_0x4ba6cc[_0x4745d1(0xd8)],'storeParams':_0x4ba6cc[_0x4745d1(0xf5)],'stateParams':_0x4ba6cc[_0x4745d1(0xb6)],'updatedAt':_0x4ba6cc[_0x4745d1(0xfb)],'retryAt':_0x4ba6cc[_0x4745d1(0xb5)],'startedAt':_0x4ba6cc[_0x4745d1(0xee)],'error':_0x4ba6cc['error'],'isGroup':_0x4ba6cc[_0x4745d1(0xbb)],'id':_0x4ba6cc['id'],'fullName':_0x4ba6cc[_0x4745d1(0xd1)]}));}async[a192_0x472e1b(0xc3)](_0x19bbdb,_0x4e9a5e){return await this['client']['listLogFiles'](_0x19bbdb,_0x4e9a5e);}async[a192_0x472e1b(0xd0)](_0x28d3c2,_0x50791f){const _0xca56e3=a192_0x472e1b,_0x2e8576=await import(_0xca56e3(0x9f)),{promisify:_0x14591f}=await import(_0xca56e3(0xca)),_0xb594e2=_0x14591f(_0x2e8576[_0xca56e3(0xb3)]),_0x45893e=await this[_0xca56e3(0x109)][_0xca56e3(0xe8)](_0x28d3c2,_0x50791f);if(_0x45893e[_0xca56e3(0xdb)]===0x0)return'';const _0x1267f3=[];for(const _0xfd755c of _0x45893e){if(!_0xfd755c[_0xca56e3(0xef)])continue;const _0x27dac7=await fetch(_0xfd755c[_0xca56e3(0xef)]);if(!_0x27dac7['ok'])throw new Error(_0xca56e3(0xf3)+_0x27dac7[_0xca56e3(0xaa)]);const _0x5c6719=Buffer['from'](await _0x27dac7[_0xca56e3(0xc0)]()),_0x48398e=await _0xb594e2(_0x5c6719);_0x1267f3[_0xca56e3(0xbd)](_0x48398e[_0xca56e3(0xa4)]('utf-8'));}return _0x1267f3[_0xca56e3(0x10e)]('\x0a');}async[a192_0x472e1b(0x113)](_0x952ac5,_0x4a299d){const _0x4a9a6e=a192_0x472e1b,_0x3a4391=await this['client'][_0x4a9a6e(0xe2)](_0x952ac5,_0x4a299d);return _0x3a4391?.[_0x4a9a6e(0xe7)]??_0x4a9a6e(0x104);}async[a192_0x472e1b(0xbc)](_0x512432,_0x1f18ac){const _0x5578e5=a192_0x472e1b,_0x32743d=await this[_0x5578e5(0x109)][_0x5578e5(0xbc)](_0x512432,{'from_task':_0x1f18ac?.['fromTask'],'retry_params':_0x1f18ac?.[_0x5578e5(0xc8)]});return{'attemptId':_0x32743d['id'],'sessionId':_0x32743d[_0x5578e5(0x9a)]};}async[a192_0x472e1b(0x111)](_0x4188aa,_0x5ad8c7){const _0x2c5396=a192_0x472e1b,_0x5f2821=await this[_0x2c5396(0x109)]['retryAttempt'](_0x4188aa,{'resume_from':_0x5ad8c7?.[_0x2c5396(0xf9)],'retry_params':_0x5ad8c7?.[_0x2c5396(0xc8)],'force':_0x5ad8c7?.['force']});return{'attemptId':_0x5f2821['id'],'sessionId':_0x5f2821['sessionId']};}async[a192_0x472e1b(0x99)](_0x31cb41,_0x1aad4e={},_0x4484e0){const _0x4da243=a192_0x472e1b,_0x145f9b=_0x31cb41[_0x4da243(0x103)]('.');let _0x88a7fc,_0x20bc4e;if(_0x145f9b===-0x1)throw new Error(_0x4da243(0x96));_0x88a7fc=_0x31cb41[_0x4da243(0xde)](0x0,_0x145f9b),_0x20bc4e=_0x31cb41[_0x4da243(0xde)](_0x145f9b+0x1);if(!_0x88a7fc||!_0x20bc4e)throw new Error(_0x4da243(0xab)+_0x31cb41+_0x4da243(0xdc));const _0x5cb735=_0x4484e0?.[_0x4da243(0xc6)]||new Date()[_0x4da243(0xf4)]();return await this[_0x4da243(0x109)][_0x4da243(0xa8)]({'projectName':_0x88a7fc,'workflowName':_0x20bc4e,'sessionTime':_0x5cb735,'params':_0x1aad4e});}async[a192_0x472e1b(0xeb)](_0x58bcf3,_0x4b290e,_0x49605b){const _0x3ce3b5=a192_0x472e1b,{promises:_0x4eb9f3}=await import('fs'),_0x4f094f=await import('path'),_0x154b5c=await import('os'),_0xf1665a=await import(_0x3ce3b5(0xc9)),{id:_0x47b041,name:_0x50549d}=await this[_0x3ce3b5(0xcb)](_0x58bcf3),_0xa84601=_0x154b5c[_0x3ce3b5(0xbf)](),_0x52f2ae=_0x4f094f[_0x3ce3b5(0x10e)](_0xa84601,'tdx-workflow-'+_0x47b041+'-'+Date[_0x3ce3b5(0xdd)]()+_0x3ce3b5(0x115));try{await this[_0x3ce3b5(0x109)]['downloadProjectArchive'](_0x47b041,_0x52f2ae,_0x49605b?.[_0x3ce3b5(0xe1)]);const _0x2b32ae=_0x4f094f[_0x3ce3b5(0x10e)](_0x4b290e,_0x50549d);await _0x4eb9f3['mkdir'](_0x2b32ae,{'recursive':!![]}),await _0xf1665a[_0x3ce3b5(0xf8)]({'file':_0x52f2ae,'cwd':_0x2b32ae,'gzip':!![]});const _0x278152=async _0x18ea47=>{const _0x581d93=_0x3ce3b5;let _0x47aff5=0x0;const _0x715e07=await _0x4eb9f3[_0x581d93(0x107)](_0x18ea47,{'withFileTypes':!![]});for(const _0x2268a9 of _0x715e07){const _0x465433=_0x4f094f[_0x581d93(0x10e)](_0x18ea47,_0x2268a9[_0x581d93(0xd5)]);if(_0x2268a9[_0x581d93(0xcf)]())_0x47aff5++;else _0x2268a9[_0x581d93(0xfd)]()&&(_0x47aff5+=await _0x278152(_0x465433));}return _0x47aff5;},_0x165fa1=await _0x278152(_0x2b32ae);return{'projectName':_0x50549d,'revision':_0x49605b?.['revision']||_0x3ce3b5(0x112),'filesExtracted':_0x165fa1};}finally{try{await _0x4eb9f3[_0x3ce3b5(0x108)](_0x52f2ae);}catch{}}}async[a192_0x472e1b(0xbd)](_0x4fbab8,_0x15a125){const _0x2b5c13=a192_0x472e1b,{promises:_0x5220db}=await import('fs'),_0x4aa8d3=await import(_0x2b5c13(0x102)),_0x3655ed=await import(_0x2b5c13(0xc9)),_0x59b7c2=_0x15a125?.['projectName']||_0x4aa8d3['basename'](_0x4fbab8),_0x4aa4b2=_0x15a125?.[_0x2b5c13(0xe1)]||new Date()[_0x2b5c13(0xf4)]()[_0x2b5c13(0x10c)](/[:.]/g,'-');try{await _0x5220db[_0x2b5c13(0x106)](_0x4fbab8);}catch{throw new Error(_0x2b5c13(0x116)+_0x4fbab8);}if(!_0x15a125?.[_0x2b5c13(0xa0)]){const _0x589609=await _0x5220db[_0x2b5c13(0x107)](_0x4fbab8),_0x3c1e6d=_0x589609['filter'](_0x57d688=>_0x57d688[_0x2b5c13(0xb2)](WORKFLOW_FILE_EXTENSION));if(_0x3c1e6d[_0x2b5c13(0xdb)]===0x0)throw new Error(_0x2b5c13(0xa6)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20project\x20directory');for(const _0xb714d8 of _0x3c1e6d){const _0x5e614b=_0x4aa8d3[_0x2b5c13(0x10e)](_0x4fbab8,_0xb714d8);try{await _0x5220db[_0x2b5c13(0x106)](_0x5e614b);}catch{throw new Error('Cannot\x20read\x20workflow\x20file:\x20'+_0xb714d8);}}}const _0x19851b=async(_0x456b3a,_0x14109f='')=>{const _0x344f93=_0x2b5c13,_0x28c381=await _0x5220db[_0x344f93(0x107)](_0x456b3a,{'withFileTypes':!![]}),_0x12d9d7=[];for(const _0x4a5dbd of _0x28c381){const _0x153c1c=_0x4aa8d3['join'](_0x14109f,_0x4a5dbd[_0x344f93(0xd5)]),_0x8d5e0c=_0x4aa8d3[_0x344f93(0x10e)](_0x456b3a,_0x4a5dbd[_0x344f93(0xd5)]);if(!shouldIncludeInArchive(_0x4a5dbd[_0x344f93(0xd5)]))continue;_0x4a5dbd[_0x344f93(0xfd)]()?_0x12d9d7[_0x344f93(0xbd)](...await _0x19851b(_0x8d5e0c,_0x153c1c)):_0x12d9d7['push'](_0x153c1c);}return _0x12d9d7;},_0x5e2f3b=await _0x19851b(_0x4fbab8),_0x477865=await import('os'),_0x1615d3=_0x477865[_0x2b5c13(0xbf)](),_0x31079c=_0x4aa8d3[_0x2b5c13(0x10e)](_0x1615d3,'tdx-workflow-push-'+Date[_0x2b5c13(0xdd)]()+_0x2b5c13(0x115));try{await _0x3655ed[_0x2b5c13(0x110)]({'file':_0x31079c,'gzip':!![],'cwd':_0x4fbab8,'portable':!![]},_0x5e2f3b);const _0x1a6c07=await this[_0x2b5c13(0x109)][_0x2b5c13(0xe0)](_0x59b7c2,_0x4aa4b2,_0x31079c,{'scheduleFrom':_0x15a125?.[_0x2b5c13(0xb8)],'clearSchedule':_0x15a125?.['clearSchedule'],'clearScheduleAll':_0x15a125?.['clearScheduleAll']});return{'projectId':_0x1a6c07['id'],'projectName':_0x1a6c07[_0x2b5c13(0xd5)],'revision':_0x1a6c07[_0x2b5c13(0xe1)]};}finally{try{await _0x5220db[_0x2b5c13(0x108)](_0x31079c);}catch{}}}async[a192_0x472e1b(0x10b)](_0x5d82e7){const _0x486a16=a192_0x472e1b,{id:_0x4ffe6a}=await this[_0x486a16(0xcb)](_0x5d82e7),_0x1c6d20=await this[_0x486a16(0x109)]['deleteProject'](_0x4ffe6a);return{'projectId':_0x1c6d20['id'],'projectName':_0x1c6d20[_0x486a16(0xd5)]};}async['listSecrets'](_0x15e601){const _0xd0e835=a192_0x472e1b,{id:_0x26a8ab,name:_0x15ef22}=await this[_0xd0e835(0xcb)](_0x15e601),_0xc08c9a=await this[_0xd0e835(0x109)]['listSecrets'](_0x26a8ab);return{'projectName':_0x15ef22,'secrets':_0xc08c9a};}async[a192_0x472e1b(0xf1)](_0x3a4e03,_0x253aff,_0xeff27){const _0x56f435=a192_0x472e1b,{id:_0x15eb4c,name:_0x23706f}=await this[_0x56f435(0xcb)](_0x3a4e03);return await this[_0x56f435(0x109)]['setSecret'](_0x15eb4c,_0x253aff,_0xeff27),{'projectName':_0x23706f,'key':_0x253aff};}async[a192_0x472e1b(0xb9)](_0x8d14c4,_0x1213a4){const _0x246110=a192_0x472e1b,{id:_0x26f10f,name:_0xe8f0b7}=await this[_0x246110(0xcb)](_0x8d14c4),_0x416f4a=Object[_0x246110(0xe9)](_0x1213a4),_0x1e1978=await Promise['allSettled'](_0x416f4a[_0x246110(0xe3)](_0x2b75aa=>this[_0x246110(0x109)][_0x246110(0xf1)](_0x26f10f,_0x2b75aa,_0x1213a4[_0x2b75aa]))),_0x427820=_0x1e1978[_0x246110(0xe3)]((_0x59ea38,_0x1f58ee)=>_0x59ea38[_0x246110(0xaa)]===_0x246110(0xd3)?_0x416f4a[_0x1f58ee]:null)[_0x246110(0x114)](_0x29a53a=>_0x29a53a!==null);if(_0x427820[_0x246110(0xdb)]>0x0)throw new SDKError(ErrorCode[_0x246110(0xdf)],_0x246110(0xa9)+(_0x427820[_0x246110(0xdb)]>0x1?'s':'')+':\x20'+_0x427820[_0x246110(0x10e)](',\x20'));return{'projectName':_0xe8f0b7,'keys':_0x416f4a};}async[a192_0x472e1b(0xa5)](_0x42d8fd,_0x1c0f77){const _0x2e80d4=a192_0x472e1b,{id:_0x4024a8,name:_0x455f34}=await this[_0x2e80d4(0xcb)](_0x42d8fd);return await this[_0x2e80d4(0x109)][_0x2e80d4(0xa5)](_0x4024a8,_0x1c0f77),{'projectName':_0x455f34,'key':_0x1c0f77};}async[a192_0x472e1b(0xd2)](_0x294c41,_0x555e74){const _0x10b49c=a192_0x472e1b;return pullWorkflow({'client':this[_0x10b49c(0x109)],'resolveProjectId':this[_0x10b49c(0xcb)][_0x10b49c(0xa2)](this)},_0x294c41,_0x555e74);}async[a192_0x472e1b(0xa7)](_0x135f73,_0x47fa90){const _0x54b08b=a192_0x472e1b;return applyPullResult({'client':this['client'],'resolveProjectId':this['resolveProjectId'][_0x54b08b(0xa2)](this)},_0x135f73,_0x47fa90);}async[a192_0x472e1b(0xf0)](_0x946e){const _0x19c33a=a192_0x472e1b;return preparePushWorkflow({'client':this[_0x19c33a(0x109)],'resolveProjectId':this['resolveProjectId'][_0x19c33a(0xa2)](this)},_0x946e);}async['executePushProject'](_0x5e7641){const _0x25a858=a192_0x472e1b;return executePushWorkflow({'client':this['client'],'resolveProjectId':this[_0x25a858(0xcb)][_0x25a858(0xa2)](this)},_0x5e7641);}async[a192_0x472e1b(0xad)](_0x3f6563,_0x29b69e,_0x4f2282){const _0x3ccced=a192_0x472e1b;return prepareCloneWorkflow({'client':this[_0x3ccced(0x109)]},_0x3f6563,_0x29b69e,_0x4f2282);}async[a192_0x472e1b(0xf7)](_0x59e5bf){const _0x4ab7f6=a192_0x472e1b;return executeCloneWorkflow({'client':this[_0x4ab7f6(0x109)]},_0x59e5bf);}}function a192_0x2a42(){const _0x2220db=['direct','preparePushProject','setSecret','test','Failed\x20to\x20download\x20log\x20file:\x20','toISOString','storeParams','project','executeCloneProject','extract','resumeFrom','32XaHvQP','updatedAt','data','isDirectory','last_id','upstreams','Project\x20not\x20found:\x20','getProject','path','indexOf','Kill\x20request\x20accepted','NUMERIC_ID_PATTERN','access','readdir','unlink','client','timezone','delete','replace','rawCount','join','min','create','retryAttempt','latest','kill','filter','.tar.gz','Project\x20directory\x20not\x20found:\x20','cancelRequested','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','lastAttempt','workflows','run','sessionId','getAttemptTasks','workflowName','limit','listAttempts','zlib','skipValidation','WORKFLOW_PROJECT_NOT_FOUND','bind','includeRetried','toString','deleteSecret','No\x20','applyPullProject','startAttempt','Failed\x20to\x20set\x20secret','status','Invalid\x20workflow\x20format:\x20','params','prepareCloneProject','1089hzxhJP','3205169uFVeBG','lastId','workflow','endsWith','gunzip','attempt','retryAt','stateParams','84eJOdVK','scheduleFrom','setSecrets','978489bgNYeq','isGroup','retrySession','push','5884200tDyouB','tmpdir','arrayBuffer','projectName','slice','logFiles','find','config','sessionTime','retryAttemptName','retryParams','tar','util','resolveProjectId','sessions','toTime','fromTime','isFile','logs','fullName','pullProject','rejected','36705UPXAaE','name','finishedAt','listWorkflows','exportParams','tasks','29qJUrYk','length','.\x20Expected\x20\x22project.workflow\x22','now','substring','WORKFLOW_SECRET_SET_FAILED','uploadProjectArchive','revision','killAttempt','map','attempts','listProjects','26298qqPAlN','message','listLogFiles','keys','2420dPSHMc','download','index','2578331nTSEMe','startedAt'];a192_0x2a42=function(){return _0x2220db;};return a192_0x2a42();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x54d407,_0x5f5854){const _0x18e80a=a193_0xe8c8,_0x1868a9=_0x54d407();while(!![]){try{const _0x45f7ed=parseInt(_0x18e80a(0x19f))/0x1+-parseInt(_0x18e80a(0x19b))/0x2+-parseInt(_0x18e80a(0x1a1))/0x3+-parseInt(_0x18e80a(0x192))/0x4*(-parseInt(_0x18e80a(0x1ac))/0x5)+parseInt(_0x18e80a(0x1b6))/0x6+-parseInt(_0x18e80a(0x19d))/0x7+parseInt(_0x18e80a(0x1bc))/0x8;if(_0x45f7ed===_0x5f5854)break;else _0x1868a9['push'](_0x1868a9['shift']());}catch(_0x1782d4){_0x1868a9['push'](_0x1868a9['shift']());}}}(a193_0x5c7d,0xb4ddd));import{existsSync,promises as a193_0x1e46fb}from'fs';import a193_0x11f50c from'path';function a193_0x5c7d(){const _0x7cfc83=['latest','toISOString','The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.','tdx.json','unlink','stat','push','utf-8','8dXWaqN','join','add','downloadProjectArchive','changes','zlib','deleted','writeFile','cwd','1173996wgOceS','getProject','4928378JFMShj','Failed\x20to\x20extract\x20project\x20archive','427855LqEpyz','unchanged','1683255uAcmln','catch','message','size','name','readFile','localeCompare','filter','includes','revision','targetDir','2445665MNGiRk','tdx-wf-apply-','tmpdir','tar','\x20(archive\x20size:\x20','projectId','type','mkdtemp','mkdir','modified','6994158FpYRAG','path','TAR_BAD_ARCHIVE','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','readdir','length','169216mCUiGC','tdx-wf-pull-','WORKFLOW_ARCHIVE_CORRUPTED','isNewProject','archive.tar.gz','new','extract','has','projectName','isDirectory'];a193_0x5c7d=function(){return _0x7cfc83;};return a193_0x5c7d();}import a193_0x26e762 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{getWorkflowProjectDir,createWorkflowTdxConfigContent,updateWorkflowTdxConfig}from'./tdx-config.js';import{SDKError,ErrorCode}from'../errors.js';export async function pullWorkflow(_0x3a4142,_0x19d878,_0x422286={}){const _0x57e1a9=a193_0xe8c8,_0x57f488=await import(_0x57e1a9(0x1af)),{client:_0x11f804,resolveProjectId:_0x422e5d}=_0x3a4142,{id:_0x4a8fb7,name:_0x448012}=await _0x422e5d(_0x19d878),_0xfb43c=_0x422286['baseDir']||process[_0x57e1a9(0x19a)](),_0x4e951a=_0x422286[_0x57e1a9(0x1ab)]||getWorkflowProjectDir(_0x448012,_0xfb43c),_0x3bf173=a193_0x11f50c[_0x57e1a9(0x193)](_0x4e951a,_0x57e1a9(0x18d)),_0xb4c4d9=!existsSync(_0x3bf173),_0x58175a=await a193_0x1e46fb[_0x57e1a9(0x1b3)](a193_0x11f50c['join'](a193_0x26e762[_0x57e1a9(0x1ae)](),_0x57e1a9(0x1bd))),_0xc08360=a193_0x11f50c['join'](_0x58175a,_0x57e1a9(0x1c0)),_0x2d3bed=a193_0x11f50c['join'](_0x58175a,'extracted');try{await _0x11f804[_0x57e1a9(0x195)](_0x4a8fb7,_0xc08360,_0x422286[_0x57e1a9(0x1aa)]),await a193_0x1e46fb['mkdir'](_0x2d3bed,{'recursive':!![]});try{await _0x57f488[_0x57e1a9(0x1c2)]({'file':_0xc08360,'cwd':_0x2d3bed,'gzip':!![]});}catch(_0x52c5d0){const _0x4110d2=_0x52c5d0 instanceof Error?_0x52c5d0[_0x57e1a9(0x1a3)]:String(_0x52c5d0);if(_0x4110d2[_0x57e1a9(0x1a9)](_0x57e1a9(0x1b8))||_0x4110d2[_0x57e1a9(0x1a9)](_0x57e1a9(0x197))){const _0x508ce2=await a193_0x1e46fb[_0x57e1a9(0x18f)](_0xc08360)[_0x57e1a9(0x1a2)](()=>null),_0x559aeb=_0x508ce2?_0x57e1a9(0x1b0)+_0x508ce2[_0x57e1a9(0x1a4)]+'\x20bytes)':'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x57e1a9(0x19e)+_0x559aeb+':\x20'+_0x4110d2,_0x52c5d0,{'helpText':'The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20'+_0x57e1a9(0x18c)});}throw _0x52c5d0;}const _0x1fe2d8=await _0x11f804[_0x57e1a9(0x19c)](_0x4a8fb7),_0x5aab82=_0x422286[_0x57e1a9(0x1aa)]||_0x1fe2d8[_0x57e1a9(0x1aa)]||_0x57e1a9(0x18a),_0x155860=await calculateChanges(_0x4e951a,_0x2d3bed,_0xb4c4d9),_0x1b653b={'new':_0x155860[_0x57e1a9(0x1a8)](_0x26136b=>_0x26136b[_0x57e1a9(0x1b2)]==='new')[_0x57e1a9(0x1bb)],'modified':_0x155860['filter'](_0x7c0818=>_0x7c0818[_0x57e1a9(0x1b2)]===_0x57e1a9(0x1b5))[_0x57e1a9(0x1bb)],'deleted':_0x155860[_0x57e1a9(0x1a8)](_0x3f1800=>_0x3f1800[_0x57e1a9(0x1b2)]===_0x57e1a9(0x198))[_0x57e1a9(0x1bb)],'unchanged':_0x155860[_0x57e1a9(0x1a8)](_0x19793c=>_0x19793c[_0x57e1a9(0x1b2)]===_0x57e1a9(0x1a0))[_0x57e1a9(0x1bb)]};return{'projectName':_0x448012,'projectId':_0x4a8fb7,'revision':_0x5aab82,'targetDir':_0x4e951a,'changes':_0x155860,'summary':_0x1b653b,'hasChanges':_0x1b653b[_0x57e1a9(0x1c1)]>0x0||_0x1b653b[_0x57e1a9(0x1b5)]>0x0||_0x1b653b['deleted']>0x0,'isNewProject':_0xb4c4d9};}finally{await a193_0x1e46fb['rm'](_0x58175a,{'recursive':!![],'force':!![]});}}function a193_0xe8c8(_0xf4e8b8,_0x2f61a1){_0xf4e8b8=_0xf4e8b8-0x187;const _0x5c7d2c=a193_0x5c7d();let _0xe8c849=_0x5c7d2c[_0xf4e8b8];return _0xe8c849;}export async function applyPullResult(_0x2abfc8,_0x5e9d1b,_0xd82de9={}){const _0xa3040e=a193_0xe8c8,_0x90c161=await import(_0xa3040e(0x1af)),{client:_0x5230ef}=_0x2abfc8,_0x66f7e1=await a193_0x1e46fb['mkdtemp'](a193_0x11f50c[_0xa3040e(0x193)](a193_0x26e762[_0xa3040e(0x1ae)](),_0xa3040e(0x1ad))),_0x11e5ec=a193_0x11f50c[_0xa3040e(0x193)](_0x66f7e1,'archive.tar.gz');try{await _0x5230ef[_0xa3040e(0x195)](_0x5e9d1b[_0xa3040e(0x1b1)],_0x11e5ec,_0xd82de9[_0xa3040e(0x1aa)]),await a193_0x1e46fb[_0xa3040e(0x1b4)](_0x5e9d1b[_0xa3040e(0x1ab)],{'recursive':!![]});for(const _0x353a50 of _0x5e9d1b[_0xa3040e(0x196)]){if(_0x353a50['type']===_0xa3040e(0x198)){const _0x28a34a=a193_0x11f50c['join'](_0x5e9d1b['targetDir'],_0x353a50[_0xa3040e(0x1b7)]);await a193_0x1e46fb[_0xa3040e(0x18e)](_0x28a34a)[_0xa3040e(0x1a2)](()=>{});}}try{await _0x90c161['extract']({'file':_0x11e5ec,'cwd':_0x5e9d1b[_0xa3040e(0x1ab)],'gzip':!![]});}catch(_0x237fca){const _0x2c9fa3=_0x237fca instanceof Error?_0x237fca[_0xa3040e(0x1a3)]:String(_0x237fca);if(_0x2c9fa3[_0xa3040e(0x1a9)](_0xa3040e(0x1b8))||_0x2c9fa3[_0xa3040e(0x1a9)](_0xa3040e(0x197))){const _0x55147e=await a193_0x1e46fb[_0xa3040e(0x18f)](_0x11e5ec)[_0xa3040e(0x1a2)](()=>null),_0x2aca35=_0x55147e?'\x20(archive\x20size:\x20'+_0x55147e[_0xa3040e(0x1a4)]+'\x20bytes)':'';throw new SDKError(ErrorCode[_0xa3040e(0x1be)],_0xa3040e(0x19e)+_0x2aca35+':\x20'+_0x2c9fa3,_0x237fca,{'helpText':_0xa3040e(0x1b9)+'The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.'});}throw _0x237fca;}const _0x9a06bf=a193_0x11f50c[_0xa3040e(0x193)](_0x5e9d1b[_0xa3040e(0x1ab)],_0xa3040e(0x18d));if(_0x5e9d1b[_0xa3040e(0x1bf)]){const _0x433698=createWorkflowTdxConfigContent(_0x5e9d1b[_0xa3040e(0x188)],_0x5e9d1b['projectId'],_0x5e9d1b[_0xa3040e(0x1aa)]);await a193_0x1e46fb[_0xa3040e(0x199)](_0x9a06bf,_0x433698,'utf-8');}else updateWorkflowTdxConfig(_0x9a06bf,{'last_pulled_revision':_0x5e9d1b['revision'],'last_pulled_at':new Date()[_0xa3040e(0x18b)]()});}finally{await a193_0x1e46fb['rm'](_0x66f7e1,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x4bca18,_0x3a1325,_0x55f243){const _0x26de65=a193_0xe8c8,_0xcbcba6=[],_0x33db7f=await getAllFiles(_0x3a1325),_0x2b4025=existsSync(_0x4bca18)?await getAllFiles(_0x4bca18):new Set();for(const _0x113c12 of _0x33db7f){const _0x30bd46=a193_0x11f50c[_0x26de65(0x193)](_0x4bca18,_0x113c12),_0x5dbc02=a193_0x11f50c[_0x26de65(0x193)](_0x3a1325,_0x113c12);if(_0x113c12==='tdx.json')continue;const _0x582090=await a193_0x1e46fb['readFile'](_0x5dbc02,'utf-8')[_0x26de65(0x1a2)](()=>null);if(_0x582090===null)continue;if(!existsSync(_0x30bd46)||_0x55f243)_0xcbcba6[_0x26de65(0x190)]({'path':_0x113c12,'type':_0x26de65(0x1c1),'newContent':_0x582090});else{const _0x10b23e=await a193_0x1e46fb[_0x26de65(0x1a6)](_0x30bd46,_0x26de65(0x191))[_0x26de65(0x1a2)](()=>null);if(_0x10b23e===null)_0xcbcba6[_0x26de65(0x190)]({'path':_0x113c12,'type':_0x26de65(0x1b5),'newContent':_0x582090});else{if(_0x10b23e!==_0x582090){const _0x5e5ec8=generateDiff(_0x10b23e,_0x582090),_0xd2e672=hasChanges(_0x5e5ec8)?formatDiffWithColors(_0x5e5ec8):undefined;_0xcbcba6[_0x26de65(0x190)]({'path':_0x113c12,'type':_0x26de65(0x1b5),'oldContent':_0x10b23e,'newContent':_0x582090,'diff':_0xd2e672});}else _0xcbcba6['push']({'path':_0x113c12,'type':'unchanged'});}}}if(!_0x55f243)for(const _0x36b102 of _0x2b4025){if(_0x36b102===_0x26de65(0x18d))continue;if(!_0x33db7f[_0x26de65(0x187)](_0x36b102)){const _0x792341=a193_0x11f50c['join'](_0x4bca18,_0x36b102),_0x33f0b7=await a193_0x1e46fb[_0x26de65(0x1a6)](_0x792341,'utf-8')[_0x26de65(0x1a2)](()=>undefined);_0xcbcba6[_0x26de65(0x190)]({'path':_0x36b102,'type':_0x26de65(0x198),'oldContent':_0x33f0b7});}}return _0xcbcba6['sort']((_0x3b0abe,_0xb750fb)=>_0x3b0abe[_0x26de65(0x1b7)][_0x26de65(0x1a7)](_0xb750fb[_0x26de65(0x1b7)])),_0xcbcba6;}async function getAllFiles(_0x8df532,_0x31d594=''){const _0xfb1c4b=a193_0xe8c8,_0xba6579=new Set();if(!existsSync(_0x8df532))return _0xba6579;const _0x1c0a1f=await a193_0x1e46fb[_0xfb1c4b(0x1ba)](_0x8df532,{'withFileTypes':!![]});for(const _0x14dad9 of _0x1c0a1f){const _0x27a49a=_0x31d594?a193_0x11f50c[_0xfb1c4b(0x193)](_0x31d594,_0x14dad9[_0xfb1c4b(0x1a5)]):_0x14dad9[_0xfb1c4b(0x1a5)];if(_0x14dad9[_0xfb1c4b(0x189)]()){const _0x29ab34=await getAllFiles(a193_0x11f50c[_0xfb1c4b(0x193)](_0x8df532,_0x14dad9[_0xfb1c4b(0x1a5)]),_0x27a49a);for(const _0x52ba4d of _0x29ab34){_0xba6579[_0xfb1c4b(0x194)](_0x52ba4d);}}else _0xba6579[_0xfb1c4b(0x194)](_0x27a49a);}return _0xba6579;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x14a287,_0x4408d0){const _0x5071bb=a194_0x3c91,_0x545008=_0x14a287();while(!![]){try{const _0x1d1cff=parseInt(_0x5071bb(0x14f))/0x1*(parseInt(_0x5071bb(0x145))/0x2)+parseInt(_0x5071bb(0x158))/0x3*(parseInt(_0x5071bb(0x162))/0x4)+parseInt(_0x5071bb(0x16e))/0x5+-parseInt(_0x5071bb(0x171))/0x6+parseInt(_0x5071bb(0x13c))/0x7+-parseInt(_0x5071bb(0x150))/0x8+-parseInt(_0x5071bb(0x160))/0x9;if(_0x1d1cff===_0x4408d0)break;else _0x545008['push'](_0x545008['shift']());}catch(_0x4efd17){_0x545008['push'](_0x545008['shift']());}}}(a194_0x59ef,0xb1a43));function a194_0x59ef(){const _0x1c4f8a=['\x20(archive\x20size:\x20','has','6410604VxsUbc','workflow_project','toISOString','readdir','configResult','tdx-wf-push-','9149399uVeTcD','No\x20','unchanged','downloadProjectArchive','name','posix','modified','deleted','add','248012QCiNkK','type','tmpdir','extracted','length','Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison','includes','path','mkdtemp','join','11pEuWLS','4857744bifmYo','extract','tdx.json','message','zlib','revision','archive.tar.gz','utf-8','651639QyzSUU','localeCompare','readFile','\x20bytes)','isDirectory','mkdir','replace','.digdagignore','15496902MIXzJp','filter','12pcUSqE','create','sourceDir','TAR_BAD_ARCHIVE','push','cwd','skipValidation','catch','endsWith','uploadProjectArchive','size','new','4011935TtXCYC'];a194_0x59ef=function(){return _0x1c4f8a;};return a194_0x59ef();}import{promises as a194_0x2d18ab}from'fs';import a194_0x22b865 from'path';import a194_0x5ca6e5 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';import{SDKError,ErrorCode}from'../errors.js';export async function preparePushWorkflow(_0x942335,_0x111d37={}){const _0xe2164d=a194_0x3c91,_0x37e16b=await import('tar'),{client:_0x579426,resolveProjectId:_0x1cb918}=_0x942335,_0x3cf35a=_0x111d37[_0xe2164d(0x164)]||process[_0xe2164d(0x167)](),_0x293afb=findWorkflowTdxConfig(_0x3cf35a),{config:_0x23610f,configDir:_0x17e0d0}=_0x293afb;let _0x3eb376,_0x192fc4=_0x23610f[_0xe2164d(0x172)];try{const _0x2d0adc=await _0x1cb918(_0x23610f[_0xe2164d(0x172)]);_0x3eb376=_0x2d0adc['id'],_0x192fc4=_0x2d0adc['name'];}catch{_0x3eb376='';}const _0x8b3fa8=_0x111d37['revision']||new Date()[_0xe2164d(0x138)]()[_0xe2164d(0x15e)](/[:.]/g,'-');if(!_0x111d37[_0xe2164d(0x168)]){const _0x1d5890=await a194_0x2d18ab[_0xe2164d(0x139)](_0x17e0d0),_0x5de409=_0x1d5890['filter'](_0x448cc3=>_0x448cc3[_0xe2164d(0x16a)](WORKFLOW_FILE_EXTENSION));if(_0x5de409[_0xe2164d(0x149)]===0x0)throw new Error(_0xe2164d(0x13d)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20'+_0x17e0d0);}const _0x4c5923=await getProjectFiles(_0x17e0d0);let _0x46dec1;if(_0x3eb376){const _0x2dd05a=await a194_0x2d18ab[_0xe2164d(0x14d)](a194_0x22b865['join'](a194_0x5ca6e5[_0xe2164d(0x147)](),_0xe2164d(0x13b))),_0xe863da=a194_0x22b865['join'](_0x2dd05a,_0xe2164d(0x156)),_0x58abca=a194_0x22b865[_0xe2164d(0x14e)](_0x2dd05a,_0xe2164d(0x148));try{await _0x579426[_0xe2164d(0x13f)](_0x3eb376,_0xe863da),await a194_0x2d18ab[_0xe2164d(0x15d)](_0x58abca,{'recursive':!![]});try{await _0x37e16b[_0xe2164d(0x151)]({'file':_0xe863da,'cwd':_0x58abca,'gzip':!![]});}catch(_0x52d905){const _0x4ebeaa=_0x52d905 instanceof Error?_0x52d905[_0xe2164d(0x153)]:String(_0x52d905);if(_0x4ebeaa[_0xe2164d(0x14b)](_0xe2164d(0x165))||_0x4ebeaa['includes'](_0xe2164d(0x154))){const _0x3abf78=await a194_0x2d18ab['stat'](_0xe863da)[_0xe2164d(0x169)](()=>null),_0x1fdd1c=_0x3abf78?_0xe2164d(0x16f)+_0x3abf78[_0xe2164d(0x16c)]+_0xe2164d(0x15b):'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0xe2164d(0x14a)+_0x1fdd1c+':\x20'+_0x4ebeaa,_0x52d905,{'helpText':'Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.'});}throw _0x52d905;}_0x46dec1=await calculatePushChanges(_0x17e0d0,_0x58abca,_0x4c5923);}finally{await a194_0x2d18ab['rm'](_0x2dd05a,{'recursive':!![],'force':!![]});}}else{_0x46dec1=[];for(const _0x1e9b5b of _0x4c5923){const _0x4734de=a194_0x22b865[_0xe2164d(0x14e)](_0x17e0d0,_0x1e9b5b),_0x337735=await a194_0x2d18ab[_0xe2164d(0x15a)](_0x4734de,_0xe2164d(0x157))[_0xe2164d(0x169)](()=>null);_0x46dec1['push']({'path':_0x1e9b5b,'type':_0xe2164d(0x16d),'newContent':_0x337735||undefined});}}const _0x3c70ad={'new':_0x46dec1[_0xe2164d(0x161)](_0x2a9384=>_0x2a9384[_0xe2164d(0x146)]===_0xe2164d(0x16d))['length'],'modified':_0x46dec1[_0xe2164d(0x161)](_0x8ca0a9=>_0x8ca0a9[_0xe2164d(0x146)]===_0xe2164d(0x142))['length'],'deleted':_0x46dec1['filter'](_0x3afd9a=>_0x3afd9a['type']===_0xe2164d(0x143))[_0xe2164d(0x149)],'unchanged':_0x46dec1[_0xe2164d(0x161)](_0x50802c=>_0x50802c[_0xe2164d(0x146)]===_0xe2164d(0x13e))['length']};return{'projectName':_0x192fc4,'projectId':_0x3eb376,'revision':_0x8b3fa8,'sourceDir':_0x17e0d0,'changes':_0x46dec1,'summary':_0x3c70ad,'hasChanges':_0x3c70ad[_0xe2164d(0x16d)]>0x0||_0x3c70ad[_0xe2164d(0x142)]>0x0||_0x3c70ad[_0xe2164d(0x143)]>0x0,'configResult':_0x293afb};}export async function executePushWorkflow(_0x4fa2e7,_0x3803ed){const _0x3a01d3=a194_0x3c91,_0x41f399=await import('tar'),{client:_0x8fdf3a}=_0x4fa2e7,_0xb90c0e=await getProjectFiles(_0x3803ed[_0x3a01d3(0x164)]),_0x41acb1=await a194_0x2d18ab['mkdtemp'](a194_0x22b865[_0x3a01d3(0x14e)](a194_0x5ca6e5[_0x3a01d3(0x147)](),'tdx-wf-push-archive-')),_0x56a3f4=a194_0x22b865[_0x3a01d3(0x14e)](_0x41acb1,_0x3a01d3(0x156));try{await _0x41f399[_0x3a01d3(0x163)]({'file':_0x56a3f4,'gzip':!![],'cwd':_0x3803ed[_0x3a01d3(0x164)],'portable':!![]},_0xb90c0e);const _0x8eb8b7=await _0x8fdf3a[_0x3a01d3(0x16b)](_0x3803ed['projectName'],_0x3803ed[_0x3a01d3(0x155)],_0x56a3f4);return updateWorkflowTdxConfig(_0x3803ed[_0x3a01d3(0x13a)]['configPath'],{'workflow_project_id':_0x8eb8b7['id'],'last_pushed_revision':_0x8eb8b7[_0x3a01d3(0x155)],'last_pushed_at':new Date()[_0x3a01d3(0x138)]()}),{'projectId':_0x8eb8b7['id'],'projectName':_0x8eb8b7[_0x3a01d3(0x140)],'revision':_0x8eb8b7['revision']};}finally{await a194_0x2d18ab['rm'](_0x41acb1,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x76caa8,_0x3fcad9=_0x76caa8,_0x2b5e3b='',_0x5540e2=null){const _0x4e94d7=a194_0x3c91,_0x1beeb9=[];if(_0x5540e2===null){_0x5540e2=createIgnoreInstance();const _0x1c415f=await loadDigdagignore(_0x76caa8);_0x1c415f&&_0x5540e2[_0x4e94d7(0x144)](_0x1c415f);}if(_0x2b5e3b!==''){const _0x295dbd=await loadDigdagignore(_0x3fcad9);_0x295dbd&&addScopedPatterns(_0x5540e2,_0x295dbd,_0x2b5e3b);}const _0x24fe73=await a194_0x2d18ab[_0x4e94d7(0x139)](_0x3fcad9,{'withFileTypes':!![]});for(const _0x1eebb3 of _0x24fe73){const _0x314f1d=_0x2b5e3b?a194_0x22b865[_0x4e94d7(0x141)][_0x4e94d7(0x14e)](_0x2b5e3b,_0x1eebb3[_0x4e94d7(0x140)]):_0x1eebb3[_0x4e94d7(0x140)];if(_0x1eebb3[_0x4e94d7(0x140)]===_0x4e94d7(0x152))continue;if(_0x1eebb3[_0x4e94d7(0x140)]===_0x4e94d7(0x15f))continue;if(!shouldIncludeInArchive(_0x1eebb3[_0x4e94d7(0x140)]))continue;if(shouldIgnoreWithInstance(_0x5540e2,_0x314f1d,_0x1eebb3[_0x4e94d7(0x15c)]()))continue;if(_0x1eebb3[_0x4e94d7(0x15c)]()){const _0xa04f9c=await getProjectFiles(_0x76caa8,a194_0x22b865[_0x4e94d7(0x14e)](_0x3fcad9,_0x1eebb3[_0x4e94d7(0x140)]),_0x314f1d,_0x5540e2);_0x1beeb9[_0x4e94d7(0x166)](..._0xa04f9c);}else _0x1beeb9[_0x4e94d7(0x166)](_0x314f1d);}return _0x1beeb9;}function a194_0x3c91(_0xd84d67,_0x35f717){_0xd84d67=_0xd84d67-0x138;const _0x59effb=a194_0x59ef();let _0x3c917c=_0x59effb[_0xd84d67];return _0x3c917c;}async function calculatePushChanges(_0x1c79ae,_0x604dd,_0x8484be){const _0x452176=a194_0x3c91,_0x29d774=[],_0x1449cc=new Set(await getProjectFiles(_0x604dd));for(const _0x2c7cd3 of _0x8484be){const _0x3a9ee2=a194_0x22b865[_0x452176(0x14e)](_0x1c79ae,_0x2c7cd3),_0x4ced4a=a194_0x22b865[_0x452176(0x14e)](_0x604dd,_0x2c7cd3),_0x4ad557=await a194_0x2d18ab[_0x452176(0x15a)](_0x3a9ee2,_0x452176(0x157))[_0x452176(0x169)](()=>null);if(_0x4ad557===null)continue;if(!_0x1449cc[_0x452176(0x170)](_0x2c7cd3))_0x29d774[_0x452176(0x166)]({'path':_0x2c7cd3,'type':_0x452176(0x16d),'newContent':_0x4ad557});else{const _0x3008fb=await a194_0x2d18ab[_0x452176(0x15a)](_0x4ced4a,'utf-8')[_0x452176(0x169)](()=>null);if(_0x3008fb===null)_0x29d774[_0x452176(0x166)]({'path':_0x2c7cd3,'type':_0x452176(0x142),'newContent':_0x4ad557});else{if(_0x3008fb!==_0x4ad557){const _0x221a58=generateDiff(_0x3008fb,_0x4ad557),_0x37d839=hasChanges(_0x221a58)?formatDiffWithColors(_0x221a58):undefined;_0x29d774[_0x452176(0x166)]({'path':_0x2c7cd3,'type':'modified','oldContent':_0x3008fb,'newContent':_0x4ad557,'diff':_0x37d839});}else _0x29d774['push']({'path':_0x2c7cd3,'type':_0x452176(0x13e)});}}}for(const _0x320d92 of _0x1449cc){if(!_0x8484be[_0x452176(0x14b)](_0x320d92)){const _0x55e12d=a194_0x22b865[_0x452176(0x14e)](_0x604dd,_0x320d92),_0x4756c9=await a194_0x2d18ab[_0x452176(0x15a)](_0x55e12d,_0x452176(0x157))[_0x452176(0x169)](()=>undefined);_0x29d774[_0x452176(0x166)]({'path':_0x320d92,'type':_0x452176(0x143),'oldContent':_0x4756c9});}}return _0x29d774['sort']((_0x4f4827,_0x468106)=>_0x4f4827[_0x452176(0x14c)][_0x452176(0x159)](_0x468106[_0x452176(0x14c)])),_0x29d774;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a195_0x169eb6=a195_0x234b;(function(_0x4a36a9,_0x9fc1b6){const _0x4ad8d7=a195_0x234b,_0x44c654=_0x4a36a9();while(!![]){try{const _0x1d8e1f=-parseInt(_0x4ad8d7(0x1f4))/0x1+-parseInt(_0x4ad8d7(0x1f6))/0x2+-parseInt(_0x4ad8d7(0x1f1))/0x3+parseInt(_0x4ad8d7(0x1fb))/0x4*(parseInt(_0x4ad8d7(0x1f9))/0x5)+parseInt(_0x4ad8d7(0x204))/0x6+-parseInt(_0x4ad8d7(0x1ed))/0x7+parseInt(_0x4ad8d7(0x1f2))/0x8;if(_0x1d8e1f===_0x9fc1b6)break;else _0x44c654['push'](_0x44c654['shift']());}catch(_0x36cff3){_0x44c654['push'](_0x44c654['shift']());}}}(a195_0x5c16,0x4010c));function a195_0x234b(_0x1d683f,_0x33ef73){_0x1d683f=_0x1d683f-0x1e7;const _0x5c1627=a195_0x5c16();let _0x234b4e=_0x5c1627[_0x1d683f];return _0x234b4e;}import{existsSync,readFileSync,writeFileSync}from'fs';import a195_0x51e594 from'path';const TDX_CONFIG_FILE=a195_0x169eb6(0x1fd),WORKFLOWS_DIR='workflows';export function findWorkflowTdxConfigPath(_0x4b369c=process['cwd']()){const _0x27c044=a195_0x169eb6;let _0x59a1ba=a195_0x51e594[_0x27c044(0x1eb)](_0x4b369c);const _0x349457=a195_0x51e594[_0x27c044(0x200)](_0x59a1ba)[_0x27c044(0x201)];while(_0x59a1ba!==_0x349457){const _0x4170b2=a195_0x51e594[_0x27c044(0x1f5)](_0x59a1ba,TDX_CONFIG_FILE);if(existsSync(_0x4170b2))try{const _0x299cad=readFileSync(_0x4170b2,_0x27c044(0x202)),_0x416216=JSON[_0x27c044(0x200)](_0x299cad);if(_0x416216&&typeof _0x416216===_0x27c044(0x1fc)&&_0x27c044(0x1f0)in _0x416216)return _0x4170b2;}catch{}_0x59a1ba=a195_0x51e594['dirname'](_0x59a1ba);}return null;}export function loadWorkflowTdxConfig(_0x16ad97){const _0x1e5933=a195_0x169eb6,_0x53db80=readFileSync(_0x16ad97,_0x1e5933(0x202));let _0x12ab2a;try{_0x12ab2a=JSON['parse'](_0x53db80);}catch{throw new Error(_0x1e5933(0x1e7)+_0x16ad97);}if(!_0x12ab2a||typeof _0x12ab2a!=='object')throw new Error(_0x1e5933(0x1f8));const _0x5c3f0c=_0x12ab2a;if(!_0x5c3f0c[_0x1e5933(0x1f0)]||typeof _0x5c3f0c[_0x1e5933(0x1f0)]!==_0x1e5933(0x203))throw new Error(_0x1e5933(0x1ee));return{'workflow_project':_0x5c3f0c[_0x1e5933(0x1f0)],'workflow_project_id':typeof _0x5c3f0c[_0x1e5933(0x1fa)]===_0x1e5933(0x203)?_0x5c3f0c[_0x1e5933(0x1fa)]:undefined,'last_pulled_revision':typeof _0x5c3f0c[_0x1e5933(0x1ef)]===_0x1e5933(0x203)?_0x5c3f0c[_0x1e5933(0x1ef)]:undefined,'last_pulled_at':typeof _0x5c3f0c[_0x1e5933(0x1ea)]==='string'?_0x5c3f0c[_0x1e5933(0x1ea)]:undefined,'last_pushed_revision':typeof _0x5c3f0c['last_pushed_revision']===_0x1e5933(0x203)?_0x5c3f0c[_0x1e5933(0x1f3)]:undefined,'last_pushed_at':typeof _0x5c3f0c[_0x1e5933(0x1e8)]===_0x1e5933(0x203)?_0x5c3f0c[_0x1e5933(0x1e8)]:undefined};}export function findWorkflowTdxConfig(_0x30af6e=process[a195_0x169eb6(0x1e9)]()){const _0x2d9435=a195_0x169eb6,_0x13a2ca=findWorkflowTdxConfigPath(_0x30af6e);if(!_0x13a2ca)throw new Error(_0x2d9435(0x1ec));const _0x43e136=loadWorkflowTdxConfig(_0x13a2ca),_0x4b834d=a195_0x51e594[_0x2d9435(0x1f7)](_0x13a2ca);return{'config':_0x43e136,'configPath':_0x13a2ca,'configDir':_0x4b834d};}export function tryFindWorkflowTdxConfig(_0x5efe4c){try{return findWorkflowTdxConfig(_0x5efe4c);}catch{return null;}}export function getWorkflowProjectDir(_0x2a291d,_0x3d9b11=process[a195_0x169eb6(0x1e9)]()){const _0x5c03d1=a195_0x169eb6;return a195_0x51e594[_0x5c03d1(0x1f5)](_0x3d9b11,WORKFLOWS_DIR,_0x2a291d);}export function getWorkflowTdxConfigPath(_0x5d3428,_0x362aec=process[a195_0x169eb6(0x1e9)]()){const _0x1cfde5=a195_0x169eb6;return a195_0x51e594[_0x1cfde5(0x1f5)](getWorkflowProjectDir(_0x5d3428,_0x362aec),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x1a39f6,_0x2bb822,_0x18699c){const _0xf669c9=a195_0x169eb6,_0x571e59={'workflow_project':_0x1a39f6,..._0x2bb822&&{'workflow_project_id':_0x2bb822},..._0x18699c&&{'last_pulled_revision':_0x18699c},'last_pulled_at':new Date()[_0xf669c9(0x1fe)]()};return JSON[_0xf669c9(0x1ff)](_0x571e59,null,0x2)+'\x0a';}function a195_0x5c16(){const _0x39a4dd=['workflow_project','1346247KSQpzA','5742712JhuUQL','last_pushed_revision','343575ErOPld','join','441230RJEQRr','dirname','Invalid\x20tdx.json:\x20expected\x20object','30565nADlPG','workflow_project_id','44QDMLKR','object','tdx.json','toISOString','stringify','parse','root','utf-8','string','3054624LwyKDb','Invalid\x20JSON\x20in\x20','last_pushed_at','cwd','last_pulled_at','resolve','No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','131845KzbmIa','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field','last_pulled_revision'];a195_0x5c16=function(){return _0x39a4dd;};return a195_0x5c16();}export function saveWorkflowTdxConfig(_0x3de82e,_0x275181){const _0x168755=a195_0x169eb6,_0x117f20=JSON[_0x168755(0x1ff)](_0x275181,null,0x2)+'\x0a';writeFileSync(_0x3de82e,_0x117f20,_0x168755(0x202));}export function updateWorkflowTdxConfig(_0x113215,_0x19c0e4){const _0x2988e8=loadWorkflowTdxConfig(_0x113215),_0x589338={..._0x2988e8,..._0x19c0e4};saveWorkflowTdxConfig(_0x113215,_0x589338);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a196_0x2389(_0xb09f70,_0x4553a6){_0xb09f70=_0xb09f70-0xc2;const _0x6fa63c=a196_0x6fa6();let _0x238998=_0x6fa63c[_0xb09f70];return _0x238998;}(function(_0x19eb16,_0x3a604b){const _0x4047fe=a196_0x2389,_0x2841b9=_0x19eb16();while(!![]){try{const _0x49dd8a=-parseInt(_0x4047fe(0xd8))/0x1*(parseInt(_0x4047fe(0xc6))/0x2)+-parseInt(_0x4047fe(0xcc))/0x3+-parseInt(_0x4047fe(0xd5))/0x4+parseInt(_0x4047fe(0xdc))/0x5*(parseInt(_0x4047fe(0xd4))/0x6)+parseInt(_0x4047fe(0xd9))/0x7+parseInt(_0x4047fe(0xc8))/0x8+-parseInt(_0x4047fe(0xcb))/0x9*(-parseInt(_0x4047fe(0xd1))/0xa);if(_0x49dd8a===_0x3a604b)break;else _0x2841b9['push'](_0x2841b9['shift']());}catch(_0x5da639){_0x2841b9['push'](_0x2841b9['shift']());}}}(a196_0x6fa6,0x56df9));import{promises as a196_0x5a3cb8}from'fs';import a196_0x5447d8 from'path';import a196_0x215d90 from'ignore';export const WORKFLOW_FILE_EXTENSION='.dig';function a196_0x6fa6(){const _0x3be5fc=['ignores','86fBMlxP','join','1113304IcvLOG','length','.digdag','1569222LTFvaU','782259ceQHsH','utf-8','endsWith','.DS_Store','.digdagignore','30ssmYWi','add','map','590178QqPrwW','878808qodUed','Thumbs.db','readFile','7159GnSxLM','1996134Ehiwpi','startsWith','split','10jxLSSG','filter','ENOENT','slice'];a196_0x6fa6=function(){return _0x3be5fc;};return a196_0x6fa6();}export function shouldIncludeInArchive(_0x31b54e){const _0x1e3085=a196_0x2389;if(_0x31b54e===_0x1e3085(0xca))return!![];if(_0x31b54e['startsWith']('.'))return![];if(_0x31b54e[_0x1e3085(0xce)]('~'))return![];if(_0x31b54e===_0x1e3085(0xd6)||_0x31b54e===_0x1e3085(0xcf))return![];return!![];}export function parseDigdagignore(_0x3fcd5c){const _0x33f5f4=a196_0x2389;return _0x3fcd5c[_0x33f5f4(0xdb)]('\x0a')[_0x33f5f4(0xd3)](_0x4abbb6=>_0x4abbb6['trim']())[_0x33f5f4(0xc2)](_0x31bc1d=>_0x31bc1d[_0x33f5f4(0xc9)]>0x0&&!_0x31bc1d[_0x33f5f4(0xda)]('#'));}export async function loadDigdagignore(_0x2f0154){const _0x559d62=a196_0x2389,_0x32d5cc=a196_0x5447d8[_0x559d62(0xc7)](_0x2f0154,_0x559d62(0xd0));try{const _0xab58e1=await a196_0x5a3cb8[_0x559d62(0xd7)](_0x32d5cc,_0x559d62(0xcd));return parseDigdagignore(_0xab58e1);}catch(_0x6ffdf3){if(_0x6ffdf3['code']===_0x559d62(0xc3))return null;throw _0x6ffdf3;}}export function createIgnoreInstance(_0x158e63){const _0x5b7057=a196_0x2389,_0x3bffad=a196_0x215d90();return _0x158e63&&_0x158e63[_0x5b7057(0xc9)]>0x0&&_0x3bffad['add'](_0x158e63),_0x3bffad;}export function addScopedPatterns(_0x2f065c,_0x386fe6,_0x33e0c6){const _0x5e9a9d=a196_0x2389,_0xfbc0de=_0x386fe6[_0x5e9a9d(0xd3)](_0x4accff=>{const _0x35ce0c=_0x5e9a9d;if(_0x4accff[_0x35ce0c(0xda)]('!')){const _0x960d9=_0x4accff[_0x35ce0c(0xc4)](0x1);if(_0x960d9[_0x35ce0c(0xda)]('/'))return'!'+_0x33e0c6+_0x960d9;return'!'+_0x33e0c6+'/'+_0x960d9;}if(_0x4accff[_0x35ce0c(0xda)]('/'))return''+_0x33e0c6+_0x4accff;return _0x33e0c6+'/'+_0x4accff;});return _0x2f065c[_0x5e9a9d(0xd2)](_0xfbc0de),_0x2f065c;}export function shouldIgnoreWithInstance(_0x578208,_0xc4902e,_0x36208b){const _0x319d8e=a196_0x2389,_0x50f971=_0xc4902e['replace'](/\\/g,'/'),_0x31718d=_0x36208b?_0x50f971+'/':_0x50f971;return _0x578208[_0x319d8e(0xc5)](_0x31718d);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a197_0x2c08(){const _0x5cf1c3=['197150emrWqr','isArray','138FzYkne','3355xZrWqG','23487mZuppr','146788wctWWD','split','3YbdIeX','---\x0a','indexOf','includes','null','45070VnpwuO','82257KxYaqu','trim','2692017HWVwBO',':\x20[]','join','52xOXnqn','test','false','startsWith','true','slice','map','push','replace','boolean','3675200ndhJVz','endsWith','\x0a---\x0a\x0a',':\x20['];a197_0x2c08=function(){return _0x5cf1c3;};return a197_0x2c08();}function a197_0x4220(_0x1471c1,_0x33ec02){_0x1471c1=_0x1471c1-0xef;const _0x2c0804=a197_0x2c08();let _0x422075=_0x2c0804[_0x1471c1];return _0x422075;}(function(_0x2607a7,_0x1c4f6f){const _0x4bc048=a197_0x4220,_0x4c55ba=_0x2607a7();while(!![]){try{const _0x2bce39=parseInt(_0x4bc048(0x103))/0x1*(-parseInt(_0x4bc048(0x101))/0x2)+-parseInt(_0x4bc048(0x100))/0x3*(-parseInt(_0x4bc048(0x10e))/0x4)+parseInt(_0x4bc048(0xfc))/0x5+parseInt(_0x4bc048(0xfe))/0x6*(-parseInt(_0x4bc048(0x109))/0x7)+-parseInt(_0x4bc048(0xf8))/0x8+-parseInt(_0x4bc048(0x10b))/0x9+parseInt(_0x4bc048(0x108))/0xa*(parseInt(_0x4bc048(0xff))/0xb);if(_0x2bce39===_0x1c4f6f)break;else _0x4c55ba['push'](_0x4c55ba['shift']());}catch(_0x12a848){_0x4c55ba['push'](_0x4c55ba['shift']());}}}(a197_0x2c08,0x4127a));export function parseFrontmatter(_0x5a4cd0){const _0x5c5474=a197_0x4220,_0x2b48cb=_0x5a4cd0['match'](/^---\s*\n([\s\S]*?)\n---\s*\n?([\s\S]*)$/);if(!_0x2b48cb)return{'frontmatter':{},'body':_0x5a4cd0[_0x5c5474(0x10a)]()};const _0x330b0d=_0x2b48cb[0x1],_0x207dd6=_0x2b48cb[0x2]['trim'](),_0x54ba4a=parseSimpleYaml(_0x330b0d);return{'frontmatter':_0x54ba4a,'body':_0x207dd6};}export function serializeFrontmatter(_0x566464,_0x54d525){const _0xe456e1=a197_0x4220,_0x36b3a2=[];for(const [_0x20eaa6,_0x441589]of Object['entries'](_0x566464)){if(_0x441589===undefined||_0x441589===null)continue;if(Array[_0xe456e1(0xfd)](_0x441589))_0x441589['length']===0x0?_0x36b3a2[_0xe456e1(0xf5)](_0x20eaa6+_0xe456e1(0x10c)):_0x36b3a2[_0xe456e1(0xf5)](_0x20eaa6+_0xe456e1(0xfb)+_0x441589[_0xe456e1(0xf4)](_0x40b7d4=>formatYamlValue(String(_0x40b7d4)))['join'](',\x20')+']');else{if(typeof _0x441589===_0xe456e1(0xf7))_0x36b3a2[_0xe456e1(0xf5)](_0x20eaa6+':\x20'+_0x441589);else typeof _0x441589==='number'?_0x36b3a2[_0xe456e1(0xf5)](_0x20eaa6+':\x20'+_0x441589):_0x36b3a2[_0xe456e1(0xf5)](_0x20eaa6+':\x20'+formatYamlValue(String(_0x441589)));}}const _0x2c7e3b=_0x36b3a2[_0xe456e1(0x10d)]('\x0a');return _0xe456e1(0x104)+_0x2c7e3b+_0xe456e1(0xfa)+_0x54d525+'\x0a';}function formatYamlValue(_0x2ab397){const _0x3ca6f7=a197_0x4220;if(_0x2ab397['includes'](':')||_0x2ab397[_0x3ca6f7(0x106)]('#')||_0x2ab397[_0x3ca6f7(0x106)]('\x27')||_0x2ab397[_0x3ca6f7(0x106)]('\x22')||_0x2ab397[_0x3ca6f7(0x106)]('\x0a')||_0x2ab397['startsWith']('\x20')||_0x2ab397[_0x3ca6f7(0xf9)]('\x20'))return'\x22'+_0x2ab397[_0x3ca6f7(0xf6)](/\\/g,'\x5c\x5c')[_0x3ca6f7(0xf6)](/"/g,'\x5c\x22')+'\x22';return _0x2ab397;}function parseSimpleYaml(_0x44ad8f){const _0x43b54f=a197_0x4220,_0x2f0ee3={},_0x2601a9=_0x44ad8f[_0x43b54f(0x102)]('\x0a');for(const _0x3c3ab0 of _0x2601a9){const _0x5c75c2=_0x3c3ab0[_0x43b54f(0x10a)]();if(!_0x5c75c2||_0x5c75c2[_0x43b54f(0xf1)]('#'))continue;const _0xc4cc50=_0x5c75c2[_0x43b54f(0x105)](':');if(_0xc4cc50===-0x1)continue;const _0x34fc76=_0x5c75c2[_0x43b54f(0xf3)](0x0,_0xc4cc50)['trim']();let _0xfe42c0=_0x5c75c2[_0x43b54f(0xf3)](_0xc4cc50+0x1)[_0x43b54f(0x10a)]();const _0x10652e=_0xfe42c0[_0x43b54f(0x105)]('\x20#');_0x10652e!==-0x1&&!_0xfe42c0[_0x43b54f(0xf1)]('\x22')&&!_0xfe42c0[_0x43b54f(0xf1)]('\x27')&&(_0xfe42c0=_0xfe42c0[_0x43b54f(0xf3)](0x0,_0x10652e)[_0x43b54f(0x10a)]()),_0x2f0ee3[_0x34fc76]=parseYamlValue(_0xfe42c0);}return _0x2f0ee3;}function parseYamlValue(_0x4e11cb){const _0x3e6573=a197_0x4220;if(!_0x4e11cb||_0x4e11cb==='~'||_0x4e11cb===_0x3e6573(0x107))return null;if(_0x4e11cb===_0x3e6573(0xf2))return!![];if(_0x4e11cb===_0x3e6573(0xf0))return![];if(_0x4e11cb[_0x3e6573(0xf1)]('[')&&_0x4e11cb[_0x3e6573(0xf9)](']')){const _0x2fbe07=_0x4e11cb[_0x3e6573(0xf3)](0x1,-0x1)[_0x3e6573(0x10a)]();if(!_0x2fbe07)return[];return _0x2fbe07[_0x3e6573(0x102)](',')[_0x3e6573(0xf4)](_0x5d5a5e=>{const _0x2b9de8=_0x3e6573,_0xc42178=_0x5d5a5e[_0x2b9de8(0x10a)]();return parseYamlScalar(_0xc42178);});}if(_0x4e11cb[_0x3e6573(0xf1)]('\x22')&&_0x4e11cb[_0x3e6573(0xf9)]('\x22'))return _0x4e11cb[_0x3e6573(0xf3)](0x1,-0x1)[_0x3e6573(0xf6)](/\\"/g,'\x22')[_0x3e6573(0xf6)](/\\\\/g,'\x5c');if(_0x4e11cb[_0x3e6573(0xf1)]('\x27')&&_0x4e11cb[_0x3e6573(0xf9)]('\x27'))return _0x4e11cb[_0x3e6573(0xf3)](0x1,-0x1);if(/^-?\d+(\.\d+)?$/[_0x3e6573(0xef)](_0x4e11cb))return Number(_0x4e11cb);return _0x4e11cb;}function parseYamlScalar(_0x237a3d){const _0x315972=a197_0x4220;if(_0x237a3d[_0x315972(0xf1)]('\x22')&&_0x237a3d[_0x315972(0xf9)]('\x22'))return _0x237a3d['slice'](0x1,-0x1)['replace'](/\\"/g,'\x22')['replace'](/\\\\/g,'\x5c');if(_0x237a3d[_0x315972(0xf1)]('\x27')&&_0x237a3d['endsWith']('\x27'))return _0x237a3d[_0x315972(0xf3)](0x1,-0x1);if(_0x237a3d===_0x315972(0xf2))return!![];if(_0x237a3d===_0x315972(0xf0))return![];if(/^-?\d+(\.\d+)?$/[_0x315972(0xef)](_0x237a3d))return Number(_0x237a3d);return _0x237a3d;}
|
|
@@ -20,6 +20,7 @@ export declare class WorkspaceGit {
|
|
|
20
20
|
private batchTimer;
|
|
21
21
|
private pendingFiles;
|
|
22
22
|
private pendingMessage;
|
|
23
|
+
private cachedIsRepo;
|
|
23
24
|
constructor(workspacePath: string, config?: Partial<GitConfig>);
|
|
24
25
|
/**
|
|
25
26
|
* Ensure a git repo exists at the workspace root
|
|
@@ -38,6 +39,15 @@ export declare class WorkspaceGit {
|
|
|
38
39
|
* Flush pending commits immediately
|
|
39
40
|
*/
|
|
40
41
|
flush(): void;
|
|
42
|
+
/**
|
|
43
|
+
* Commit all changed/untracked/deleted files in the workspace.
|
|
44
|
+
* Used to capture changes made by external tools before SDK mutations.
|
|
45
|
+
*/
|
|
46
|
+
commitAll(message: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Check if there are uncommitted changes in the workspace
|
|
49
|
+
*/
|
|
50
|
+
hasDirtyFiles(): boolean;
|
|
41
51
|
/**
|
|
42
52
|
* Get file history (git log for a specific file)
|
|
43
53
|
*/
|
|
@@ -46,6 +56,11 @@ export declare class WorkspaceGit {
|
|
|
46
56
|
date: string;
|
|
47
57
|
message: string;
|
|
48
58
|
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Commit whatever is currently staged, if anything.
|
|
61
|
+
* Shared by flush() and commitAll() to avoid duplicating the diff-check logic.
|
|
62
|
+
*/
|
|
63
|
+
private commitStaged;
|
|
49
64
|
/**
|
|
50
65
|
* Execute a git command safely using execFileSync (no shell interpolation)
|
|
51
66
|
*/
|