@treasuredata/tdx 0.16.4 → 0.16.5
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.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +1 -1
- package/dist/commands/agent-test-command.d.ts +4 -0
- package/dist/commands/agent-test-command.d.ts.map +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/agent-test-command.js.map +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +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/describe.js +1 -1
- package/dist/commands/engage-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/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-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/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +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.d.ts +7 -5
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/connection-cache.d.ts.map +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/connection-cache.js.map +1 -1
- package/dist/core/constants.d.ts +22 -0
- package/dist/core/constants.d.ts.map +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/constants.js.map +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.d.ts.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/keychain.js.map +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.d.ts.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/user-cache.js.map +1 -1
- package/dist/core/version.d.ts +2 -2
- 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/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.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.d.ts +2 -0
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +1 -1
- package/dist/sdk/agent/test/evaluator.d.ts +3 -6
- package/dist/sdk/agent/test/evaluator.d.ts.map +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/evaluator.js.map +1 -1
- package/dist/sdk/agent/test/executor.d.ts +57 -1
- package/dist/sdk/agent/test/executor.d.ts.map +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/executor.js.map +1 -1
- package/dist/sdk/agent/test/index.d.ts +2 -2
- package/dist/sdk/agent/test/index.d.ts.map +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/index.js.map +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.d.ts.map +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/test/parser.js.map +1 -1
- package/dist/sdk/agent/test/types.d.ts +44 -0
- package/dist/sdk/agent/test/types.d.ts.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +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.d.ts +6 -0
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +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/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.d.ts.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/chat-cache.js.map +1 -1
- package/dist/sdk/llm/index.d.ts +11 -3
- package/dist/sdk/llm/index.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-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-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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.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.js +1 -1
- package/dist/sdk/types/llm.d.ts +39 -0
- package/dist/sdk/types/llm.d.ts.map +1 -1
- package/dist/sdk/types/progress.js +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/tree-formatter.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/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/global-cache.d.ts +88 -0
- package/dist/utils/global-cache.d.ts.map +1 -0
- package/dist/utils/global-cache.js +1 -0
- package/dist/utils/global-cache.js.map +1 -0
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.d.ts +48 -0
- package/dist/utils/local-cache.d.ts.map +1 -0
- package/dist/utils/local-cache.js +1 -0
- package/dist/utils/local-cache.js.map +1 -0
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.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/tdx-logger.js.map +1 -1
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2a4567,_0x7e35e8){const _0x18ec27=a145_0x45c7,_0x3206f1=_0x2a4567();while(!![]){try{const _0x18f460=-parseInt(_0x18ec27(0x1ff))/0x1+parseInt(_0x18ec27(0x1fb))/0x2*(-parseInt(_0x18ec27(0x202))/0x3)+-parseInt(_0x18ec27(0x200))/0x4+-parseInt(_0x18ec27(0x1f9))/0x5+-parseInt(_0x18ec27(0x1f8))/0x6+parseInt(_0x18ec27(0x1f4))/0x7+parseInt(_0x18ec27(0x1fd))/0x8;if(_0x18f460===_0x7e35e8)break;else _0x3206f1['push'](_0x3206f1['shift']());}catch(_0x43ff5c){_0x3206f1['push'](_0x3206f1['shift']());}}}(a145_0x14cf,0xdfb36));export function detectFormatFromExtension(_0x231954){const _0x1a4a06=a145_0x45c7,_0x59df14=_0x231954[_0x1a4a06(0x1fa)]()[_0x1a4a06(0x1f6)]('.')['pop']();switch(_0x59df14){case'json':return'json';case _0x1a4a06(0x201):return'jsonl';case _0x1a4a06(0x1fe):case _0x1a4a06(0x1f7):return _0x1a4a06(0x1fe);case _0x1a4a06(0x1fc):case _0x1a4a06(0x1f5):return'table';default:return undefined;}}function a145_0x45c7(_0x3e3626,_0xbd65c4){_0x3e3626=_0x3e3626-0x1f4;const _0x14cf15=a145_0x14cf();let _0x45c704=_0x14cf15[_0x3e3626];return _0x45c704;}function a145_0x14cf(){const _0x50e6f9=['886zhZZAB','txt','51538832kEOnMi','tsv','1388751FcnBPV','6054268dOakio','jsonl','621rDuczX','803250HaXeMw','text','split','tab','10103082stRTZB','4814800JebfHy','toLowerCase'];a145_0x14cf=function(){return _0x50e6f9;};return a145_0x14cf();}export function resolveOutputFormat(_0x98a5b,_0x700b54,_0x3b2ea4){if(_0x98a5b)return _0x98a5b;if(_0x700b54){const _0x1a73b7=detectFormatFromExtension(_0x700b54);if(_0x1a73b7)return _0x1a73b7;}return _0x3b2ea4;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4f6595,_0x44ed45){const _0x2cf02f=a146_0x389f,_0x48e66d=_0x4f6595();while(!![]){try{const _0x386bee=-parseInt(_0x2cf02f(0x1e5))/0x1+parseInt(_0x2cf02f(0x1da))/0x2*(-parseInt(_0x2cf02f(0x1e8))/0x3)+-parseInt(_0x2cf02f(0x1e7))/0x4+-parseInt(_0x2cf02f(0x1c5))/0x5+-parseInt(_0x2cf02f(0x1f8))/0x6+-parseInt(_0x2cf02f(0x1c4))/0x7*(-parseInt(_0x2cf02f(0x1c8))/0x8)+parseInt(_0x2cf02f(0x1e2))/0x9*(parseInt(_0x2cf02f(0x1e3))/0xa);if(_0x386bee===_0x44ed45)break;else _0x48e66d['push'](_0x48e66d['shift']());}catch(_0x3a7c1d){_0x48e66d['push'](_0x48e66d['shift']());}}}(a146_0x7545,0x91032));import{centerAlign,stringWidth,padEnd,padStart}from'../../utils/string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../../utils/colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x336fa3=a146_0x389f;return process[_0x336fa3(0x1ca)][_0x336fa3(0x1f0)]||Infinity;}export function formatAsTable(_0x2cf6f7,_0x2b1f6a=DEFAULT_MAX_DISPLAY_ROWS,_0x36306a=![],_0x2284e4={}){const _0x3108d8=a146_0x389f;if(_0x2cf6f7[_0x3108d8(0x1f6)]['length']===0x0)return'No\x20rows\x20returned';const _0x693307=_0x2cf6f7[_0x3108d8(0x1f0)][_0x3108d8(0x1e1)](_0x113a97=>_0x113a97[_0x3108d8(0x1c6)]),_0x20ce4f=_0x2cf6f7['columns']['map'](_0x5473dc=>simplifyType(_0x5473dc[_0x3108d8(0x1ed)])),_0x13ae14=_0x2cf6f7[_0x3108d8(0x1f6)]['slice'](0x0,_0x2b1f6a),_0x1d4191=_0x2cf6f7[_0x3108d8(0x1f6)][_0x3108d8(0x1cf)],_0x550a86=_0x1d4191>_0x2b1f6a,_0x3eab81=[],_0x32e089=getTerminalWidth(),_0x3152e5=_0x32e089!==Infinity,_0x3747b=0x32;let _0x122ac9=_0x693307[_0x3108d8(0x1e1)]((_0x4fbe96,_0xdeb8a7)=>{const _0xd06375=_0x3108d8,_0x3b103c=stringWidth(_0x20ce4f[_0xdeb8a7]),_0x2c5b0f=Math[_0xd06375(0x1d9)](..._0x13ae14[_0xd06375(0x1e1)](_0x47dc47=>{const _0x942e22=_0x47dc47[_0x4fbe96];return stringWidth(formatValue(_0x942e22));})),_0x56f094=Math[_0xd06375(0x1d9)](stringWidth(_0x4fbe96),_0x3b103c,_0x2c5b0f);return _0x36306a?_0x56f094:Math[_0xd06375(0x1cb)](_0x56f094,_0x3747b);});if(_0x3152e5&&!_0x36306a&&_0x693307[_0x3108d8(0x1cf)]>0x0){const _0x56133f=_0x55cf95=>{let _0x4554da=0x1;for(const _0x50785d of _0x55cf95){_0x4554da+=_0x50785d+0x3;}return _0x4554da+0x1;};let _0x449d26=_0x56133f(_0x122ac9);if(_0x449d26>_0x32e089){const _0x205d73=0x3;for(let _0x350f59=_0x122ac9['length']-0x1;_0x350f59>=0x0;_0x350f59--){_0x449d26=_0x56133f(_0x122ac9);if(_0x449d26<=_0x32e089)break;const _0x4edd74=_0x122ac9[_0x350f59],_0x5b8032=_0x449d26-_0x32e089,_0x51a63f=_0x4edd74-_0x205d73,_0x63368c=Math[_0x3108d8(0x1cb)](_0x5b8032,_0x51a63f);_0x63368c>0x0&&(_0x122ac9[_0x350f59]=_0x4edd74-_0x63368c);}}}const _0x5be81f=_0x693307,_0x5e4524=_0x20ce4f,_0x43933c=_0x122ac9,_0x403489=_0x122ac9;_0x3eab81[_0x3108d8(0x1ee)](colorBorder('┌'+_0x403489['map'](_0x14a176=>'─'[_0x3108d8(0x1f3)](_0x14a176+0x2))[_0x3108d8(0x1d4)]('┬')+'┐',_0x2284e4));const _0x250a06=_0x5be81f['map']((_0x12fb18,_0x24576a)=>centerAlign(_0x12fb18,_0x43933c[_0x24576a]));_0x3eab81['push'](colorBorder('│',_0x2284e4)+'\x20'+_0x250a06[_0x3108d8(0x1d4)]('\x20'+colorBorder('│',_0x2284e4)+'\x20')+'\x20'+colorBorder('│',_0x2284e4));const _0x2551a7=_0x5e4524[_0x3108d8(0x1e1)]((_0x2f1cd5,_0x11c908)=>colorType(centerAlign(_0x2f1cd5,_0x43933c[_0x11c908]),_0x2284e4));_0x3eab81[_0x3108d8(0x1ee)](colorBorder('│',_0x2284e4)+'\x20'+_0x2551a7[_0x3108d8(0x1d4)]('\x20'+colorBorder('│',_0x2284e4)+'\x20')+'\x20'+colorBorder('│',_0x2284e4)),_0x3eab81[_0x3108d8(0x1ee)](colorBorder('├'+_0x403489[_0x3108d8(0x1e1)](_0x876035=>'─'[_0x3108d8(0x1f3)](_0x876035+0x2))[_0x3108d8(0x1d4)]('┼')+'┤',_0x2284e4));const _0x33d033=(_0x550d69,_0x595183)=>{const _0x5c363e=stringWidth(_0x550d69);if(_0x5c363e<=_0x595183)return _0x550d69;let _0x2a35ec=_0x550d69;while(stringWidth(_0x2a35ec+'…')>_0x595183&&_0x2a35ec['length']>0x0){_0x2a35ec=_0x2a35ec['slice'](0x0,-0x1);}return _0x2a35ec+'…';};_0x13ae14['forEach'](_0x2dcece=>{const _0x1e75d1=_0x3108d8,_0x3ece1a=_0x693307[_0x1e75d1(0x1e1)]((_0x232710,_0x84e58c)=>{const _0x43d448=_0x1e75d1,_0x4ee5ff=_0x2dcece[_0x232710],_0x2ccbdb=formatValue(_0x4ee5ff),_0x113ccc=_0x43933c[_0x84e58c],_0x5ae919=_0x33d033(_0x2ccbdb,_0x113ccc),_0x23856b=typeof _0x4ee5ff===_0x43d448(0x1f2)||typeof _0x4ee5ff===_0x43d448(0x1e4)&&/^-?\d+$/[_0x43d448(0x1d8)](_0x4ee5ff);return _0x23856b?padStart(_0x5ae919,_0x113ccc):padEnd(_0x5ae919,_0x113ccc);});_0x3eab81[_0x1e75d1(0x1ee)](colorBorder('│',_0x2284e4)+'\x20'+_0x3ece1a[_0x1e75d1(0x1d4)]('\x20'+colorBorder('│',_0x2284e4)+'\x20')+'\x20'+colorBorder('│',_0x2284e4));});const _0x34cb9c=_0x403489[_0x3108d8(0x1ef)]((_0x161922,_0x2a2b04)=>_0x161922+_0x2a2b04+0x3,-0x1);_0x3eab81[_0x3108d8(0x1ee)](colorBorder('├'+_0x403489['map'](_0x55f0d1=>'─'[_0x3108d8(0x1f3)](_0x55f0d1+0x2))[_0x3108d8(0x1d4)]('┴')+'┤',_0x2284e4));let _0x19229d;_0x550a86?_0x19229d=_0x1d4191+_0x3108d8(0x1eb)+_0x2b1f6a+_0x3108d8(0x1e9):_0x19229d=_0x1d4191+_0x3108d8(0x1e6)+(_0x1d4191===0x1?'':'s');const _0x213016=_0x19229d[_0x3108d8(0x1d1)](_0x34cb9c-0x2);return _0x3eab81[_0x3108d8(0x1ee)](colorBorder('│',_0x2284e4)+'\x20'+_0x213016+'\x20'+colorBorder('│',_0x2284e4)),_0x3eab81[_0x3108d8(0x1ee)](colorBorder('└'+'─'[_0x3108d8(0x1f3)](_0x34cb9c)+'┘',_0x2284e4)),_0x3eab81[_0x3108d8(0x1d4)]('\x0a');}function simplifyType(_0x3f23fc){const _0x20c24a=a146_0x389f,_0x27cefa={'varchar':_0x20c24a(0x1e4),'bigint':_0x20c24a(0x1d7),'integer':_0x20c24a(0x1d3),'double':'double','boolean':'bool','date':_0x20c24a(0x1df),'timestamp':_0x20c24a(0x1de),'array':_0x20c24a(0x1cc),'map':'map','row':_0x20c24a(0x1f5)},_0x2cf452=_0x3f23fc[_0x20c24a(0x1dc)]();for(const [_0x47eb11,_0x4a5465]of Object[_0x20c24a(0x1c9)](_0x27cefa)){if(_0x2cf452['startsWith'](_0x47eb11))return _0x4a5465;}return _0x3f23fc[_0x20c24a(0x1cf)]>0xa?_0x3f23fc['substring'](0x0,0xa):_0x3f23fc;}export function formatAsJSON(_0x332e12,_0x28e87b={}){const _0xb24883=a146_0x389f;if(_0x332e12[_0xb24883(0x1f6)][_0xb24883(0x1cf)]===0x0)return'[]';if(shouldUseColor(_0x28e87b))return colorizeJSON(_0x332e12[_0xb24883(0x1f6)],_0x28e87b);const _0x3b100c=_0x332e12['data']['map'](_0x1502fb=>'\x20\x20'+JSON[_0xb24883(0x1ce)](_0x1502fb));return'[\x0a'+_0x3b100c['join'](',\x0a')+'\x0a]';}export function formatAsJSONL(_0xbf29f4,_0x5f3a6a={}){const _0x248e9a=a146_0x389f;if(_0xbf29f4[_0x248e9a(0x1f6)][_0x248e9a(0x1cf)]===0x0)return'';if(shouldUseColor(_0x5f3a6a))return _0xbf29f4[_0x248e9a(0x1f6)][_0x248e9a(0x1e1)](_0x181064=>colorizeJSONCompact(_0x181064,_0x5f3a6a))['join']('\x0a');return _0xbf29f4[_0x248e9a(0x1f6)]['map'](_0x17fd3b=>JSON[_0x248e9a(0x1ce)](_0x17fd3b))['join']('\x0a');}export function formatAsTSV(_0x14e446){const _0x695de8=a146_0x389f;if(_0x14e446[_0x695de8(0x1f6)][_0x695de8(0x1cf)]===0x0)return'';const _0x561c7d=[],_0x54c2dc=_0x14e446['columns'][_0x695de8(0x1e1)](_0x19adf7=>_0x19adf7[_0x695de8(0x1c6)]);return _0x561c7d[_0x695de8(0x1ee)](_0x54c2dc[_0x695de8(0x1d4)]('\x09')),_0x14e446[_0x695de8(0x1f6)][_0x695de8(0x1ec)](_0x1091b8=>{const _0x2740c8=_0x695de8,_0x55f583=_0x54c2dc[_0x2740c8(0x1e1)](_0x440d9d=>{const _0x3ccb6a=_0x1091b8[_0x440d9d];return formatValueForTSV(_0x3ccb6a);});_0x561c7d[_0x2740c8(0x1ee)](_0x55f583['join']('\x09'));}),_0x561c7d[_0x695de8(0x1d4)]('\x0a');}function formatValue(_0x52e53a){const _0x5f588c=a146_0x389f;if(_0x52e53a===null||_0x52e53a===undefined)return'';if(typeof _0x52e53a==='string'){const _0x712051=_0x52e53a[_0x5f588c(0x1f4)](/\n/g,'\x5cn')['replace'](/\r/g,'\x5cr')[_0x5f588c(0x1f4)](/\t/g,'\x5ct');return _0x712051;}if(typeof _0x52e53a===_0x5f588c(0x1f2))return String(_0x52e53a);if(typeof _0x52e53a===_0x5f588c(0x1c7))return _0x52e53a?'true':'false';if(_0x52e53a instanceof Date)return _0x52e53a[_0x5f588c(0x1d2)]();if(typeof _0x52e53a===_0x5f588c(0x1ea))return JSON[_0x5f588c(0x1ce)](_0x52e53a);return String(_0x52e53a);}function formatValueForTSV(_0x37f5c5){const _0x2f1c0e=a146_0x389f;if(_0x37f5c5===null||_0x37f5c5===undefined)return'';if(typeof _0x37f5c5===_0x2f1c0e(0x1e4))return _0x37f5c5['replace'](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x37f5c5===_0x2f1c0e(0x1f2)||typeof _0x37f5c5===_0x2f1c0e(0x1c7))return String(_0x37f5c5);if(_0x37f5c5 instanceof Date)return _0x37f5c5['toISOString']();if(typeof _0x37f5c5===_0x2f1c0e(0x1ea))return JSON['stringify'](_0x37f5c5);return String(_0x37f5c5);}export function formatQueryResult(_0x2fc7b3,_0x906578){const _0x373ada=a146_0x389f;switch(_0x906578){case _0x373ada(0x1d5):return formatAsTable(_0x2fc7b3);case'json':return formatAsJSON(_0x2fc7b3);case _0x373ada(0x1d0):return formatAsJSONL(_0x2fc7b3);case _0x373ada(0x1f7):return formatAsTSV(_0x2fc7b3);default:return formatAsJSON(_0x2fc7b3);}}export function formatBytes(_0x4a17a2){const _0x2a1301=a146_0x389f;if(_0x4a17a2===0x0)return _0x2a1301(0x1e0);const _0x44c3bc=['B','KB','MB','GB','TB'],_0x207407=0x400,_0x565156=Math['floor'](Math[_0x2a1301(0x1c3)](_0x4a17a2)/Math[_0x2a1301(0x1c3)](_0x207407)),_0x40a464=_0x4a17a2/Math[_0x2a1301(0x1f1)](_0x207407,_0x565156),_0x22d3c4=_0x40a464>=0xa?0x1:0x2;return _0x40a464[_0x2a1301(0x1d6)](_0x22d3c4)+'\x20'+_0x44c3bc[_0x565156];}function a146_0x389f(_0x500d4a,_0x5d921f){_0x500d4a=_0x500d4a-0x1c3;const _0x75454=a146_0x7545();let _0x389f42=_0x75454[_0x500d4a];return _0x389f42;}function a146_0x7545(){const _0x17eb27=['test','max','1145186VumIWm','toString','toLowerCase','\x1b]8;;','timestamp','date','0\x20B','map','942309PToSuP','260nzpuYm','string','554403UWEysg','\x20row','315024FsidHp','3KRyNuO','\x20shown)','object','\x20rows\x20(','forEach','type','push','reduce','columns','pow','number','repeat','replace','row','data','tsv','4115484GbDzHx','log','29540jKwboh','5191950jJsnBF','name','boolean','1520dPUkbn','entries','stdout','min','array','isTTY','stringify','length','jsonl','padEnd','toISOString','int','join','table','toFixed','long'];a146_0x7545=function(){return _0x17eb27;};return a146_0x7545();}export function formatRows(_0x33d647){const _0x4a2b06=a146_0x389f;if(_0x33d647==null)return'-';if(_0x33d647===0x0)return'0';if(_0x33d647<0x3e8)return _0x33d647[_0x4a2b06(0x1db)]();const _0x43aaa3=['','K','M','B','T'],_0x113d03=0x3e8,_0x2991f6=Math['floor'](Math['log'](_0x33d647)/Math['log'](_0x113d03)),_0x266acf=_0x33d647/Math[_0x4a2b06(0x1f1)](_0x113d03,_0x2991f6),_0x164609=_0x266acf>=0xa?0x1:0x2;return''+_0x266acf[_0x4a2b06(0x1d6)](_0x164609)+_0x43aaa3[_0x2991f6];}export function hyperlink(_0x3cdddf,_0x45aab9){const _0x5ce1fe=a146_0x389f;if(!process['stdout'][_0x5ce1fe(0x1cd)])return _0x3cdddf;return _0x5ce1fe(0x1dd)+_0x45aab9+'\x07'+_0x3cdddf+'\x1b]8;;\x07';}
|
|
1
|
+
(function(_0x387402,_0x594856){const _0x40c5d8=a146_0x51d7,_0x58c52a=_0x387402();while(!![]){try{const _0x59e328=parseInt(_0x40c5d8(0x1b9))/0x1*(-parseInt(_0x40c5d8(0x1bd))/0x2)+-parseInt(_0x40c5d8(0x1b4))/0x3*(parseInt(_0x40c5d8(0x1c3))/0x4)+-parseInt(_0x40c5d8(0x1c6))/0x5+parseInt(_0x40c5d8(0x1d9))/0x6*(parseInt(_0x40c5d8(0x1b2))/0x7)+-parseInt(_0x40c5d8(0x1cf))/0x8+parseInt(_0x40c5d8(0x1d7))/0x9+parseInt(_0x40c5d8(0x1c8))/0xa;if(_0x59e328===_0x594856)break;else _0x58c52a['push'](_0x58c52a['shift']());}catch(_0x267e20){_0x58c52a['push'](_0x58c52a['shift']());}}}(a146_0x5eb7,0x9f7a0));import{centerAlign,stringWidth,padEnd,padStart}from'../../utils/string-utils.js';function a146_0x5eb7(){const _0x1142f3=['true','table','map','forEach','32HTTntJ','No\x20rows\x20returned','toLowerCase','923695ZlBxeC','isTTY','9271860LzuWGF','pow','test','startsWith','push','\x1b]8;;\x07','log','952136rASrSY','double','timestamp','\x20rows\x20(','padEnd','length','stdout','long','5891643KzOwNM','max','6ojqmkk','row','toISOString','json','int','false','columns','string','\x20row','data','replace','date','repeat','name','slice','stringify','7368774qCkBly','object','310152LRMtfK','floor','number','0\x20B','entries','121493eGmnzk','boolean','substring','join','14JTELnQ','min'];a146_0x5eb7=function(){return _0x1142f3;};return a146_0x5eb7();}import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../../utils/colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x26f9b3=a146_0x51d7;return process[_0x26f9b3(0x1d5)]['columns']||Infinity;}export function formatAsTable(_0x2ab1dd,_0x1c6675=DEFAULT_MAX_DISPLAY_ROWS,_0x525798=![],_0x410a80={}){const _0x319ed5=a146_0x51d7;if(_0x2ab1dd[_0x319ed5(0x1ab)][_0x319ed5(0x1d4)]===0x0)return _0x319ed5(0x1c4);const _0x497533=_0x2ab1dd['columns'][_0x319ed5(0x1c1)](_0x4e8d2b=>_0x4e8d2b['name']),_0x436ce4=_0x2ab1dd[_0x319ed5(0x1a8)][_0x319ed5(0x1c1)](_0x17f3bf=>simplifyType(_0x17f3bf['type'])),_0x452658=_0x2ab1dd['data'][_0x319ed5(0x1b0)](0x0,_0x1c6675),_0x109788=_0x2ab1dd[_0x319ed5(0x1ab)][_0x319ed5(0x1d4)],_0x13cdec=_0x109788>_0x1c6675,_0x30daa8=[],_0x6513df=getTerminalWidth(),_0x2dd2e1=_0x6513df!==Infinity,_0x2d8df5=0x32;let _0x28ec50=_0x497533['map']((_0x1cd7e4,_0x3cd82d)=>{const _0x1d7520=_0x319ed5,_0x10b34c=stringWidth(_0x436ce4[_0x3cd82d]),_0x3ebdcf=Math[_0x1d7520(0x1d8)](..._0x452658[_0x1d7520(0x1c1)](_0x527f22=>{const _0x7a18e4=_0x527f22[_0x1cd7e4];return stringWidth(formatValue(_0x7a18e4));})),_0x2ac29f=Math[_0x1d7520(0x1d8)](stringWidth(_0x1cd7e4),_0x10b34c,_0x3ebdcf);return _0x525798?_0x2ac29f:Math[_0x1d7520(0x1be)](_0x2ac29f,_0x2d8df5);});if(_0x2dd2e1&&!_0x525798&&_0x497533[_0x319ed5(0x1d4)]>0x0){const _0x3af5a1=_0x51e068=>{let _0x13731c=0x1;for(const _0x2e2ef2 of _0x51e068){_0x13731c+=_0x2e2ef2+0x3;}return _0x13731c+0x1;};let _0x4bc6e4=_0x3af5a1(_0x28ec50);if(_0x4bc6e4>_0x6513df){const _0x1cce47=0x3;for(let _0x41912d=_0x28ec50[_0x319ed5(0x1d4)]-0x1;_0x41912d>=0x0;_0x41912d--){_0x4bc6e4=_0x3af5a1(_0x28ec50);if(_0x4bc6e4<=_0x6513df)break;const _0x1bc46d=_0x28ec50[_0x41912d],_0x20b362=_0x4bc6e4-_0x6513df,_0x44cd1b=_0x1bc46d-_0x1cce47,_0x8f8886=Math[_0x319ed5(0x1be)](_0x20b362,_0x44cd1b);_0x8f8886>0x0&&(_0x28ec50[_0x41912d]=_0x1bc46d-_0x8f8886);}}}const _0xf52ef2=_0x497533,_0x374dbc=_0x436ce4,_0x37f8a5=_0x28ec50,_0x3b0c1d=_0x28ec50;_0x30daa8[_0x319ed5(0x1cc)](colorBorder('┌'+_0x3b0c1d['map'](_0x328426=>'─'[_0x319ed5(0x1ae)](_0x328426+0x2))[_0x319ed5(0x1bc)]('┬')+'┐',_0x410a80));const _0x58ad6d=_0xf52ef2[_0x319ed5(0x1c1)]((_0x301c04,_0x286cb6)=>centerAlign(_0x301c04,_0x37f8a5[_0x286cb6]));_0x30daa8[_0x319ed5(0x1cc)](colorBorder('│',_0x410a80)+'\x20'+_0x58ad6d['join']('\x20'+colorBorder('│',_0x410a80)+'\x20')+'\x20'+colorBorder('│',_0x410a80));const _0x270b96=_0x374dbc[_0x319ed5(0x1c1)]((_0x5a245d,_0x1c51be)=>colorType(centerAlign(_0x5a245d,_0x37f8a5[_0x1c51be]),_0x410a80));_0x30daa8['push'](colorBorder('│',_0x410a80)+'\x20'+_0x270b96[_0x319ed5(0x1bc)]('\x20'+colorBorder('│',_0x410a80)+'\x20')+'\x20'+colorBorder('│',_0x410a80)),_0x30daa8['push'](colorBorder('├'+_0x3b0c1d[_0x319ed5(0x1c1)](_0x18b2ed=>'─'['repeat'](_0x18b2ed+0x2))[_0x319ed5(0x1bc)]('┼')+'┤',_0x410a80));const _0x495cd3=(_0x2fcdf1,_0x4b89c1)=>{const _0x37da9b=_0x319ed5,_0x4232ba=stringWidth(_0x2fcdf1);if(_0x4232ba<=_0x4b89c1)return _0x2fcdf1;let _0x4859ac=_0x2fcdf1;while(stringWidth(_0x4859ac+'…')>_0x4b89c1&&_0x4859ac['length']>0x0){_0x4859ac=_0x4859ac[_0x37da9b(0x1b0)](0x0,-0x1);}return _0x4859ac+'…';};_0x452658[_0x319ed5(0x1c2)](_0x4b9f27=>{const _0xa1b07c=_0x319ed5,_0x58b7eb=_0x497533['map']((_0x11e5e3,_0x2c67ea)=>{const _0xfb5cc0=a146_0x51d7,_0x2cefb4=_0x4b9f27[_0x11e5e3],_0x4e16dc=formatValue(_0x2cefb4),_0x3906bd=_0x37f8a5[_0x2c67ea],_0x49f0f0=_0x495cd3(_0x4e16dc,_0x3906bd),_0x24d433=typeof _0x2cefb4===_0xfb5cc0(0x1b6)||typeof _0x2cefb4===_0xfb5cc0(0x1a9)&&/^-?\d+$/[_0xfb5cc0(0x1ca)](_0x2cefb4);return _0x24d433?padStart(_0x49f0f0,_0x3906bd):padEnd(_0x49f0f0,_0x3906bd);});_0x30daa8[_0xa1b07c(0x1cc)](colorBorder('│',_0x410a80)+'\x20'+_0x58b7eb[_0xa1b07c(0x1bc)]('\x20'+colorBorder('│',_0x410a80)+'\x20')+'\x20'+colorBorder('│',_0x410a80));});const _0x4cfcee=_0x3b0c1d['reduce']((_0x2bc0c8,_0x16fefc)=>_0x2bc0c8+_0x16fefc+0x3,-0x1);_0x30daa8[_0x319ed5(0x1cc)](colorBorder('├'+_0x3b0c1d['map'](_0x26a76f=>'─'[_0x319ed5(0x1ae)](_0x26a76f+0x2))[_0x319ed5(0x1bc)]('┴')+'┤',_0x410a80));let _0x4e7235;_0x13cdec?_0x4e7235=_0x109788+_0x319ed5(0x1d2)+_0x1c6675+'\x20shown)':_0x4e7235=_0x109788+_0x319ed5(0x1aa)+(_0x109788===0x1?'':'s');const _0xb0f812=_0x4e7235[_0x319ed5(0x1d3)](_0x4cfcee-0x2);return _0x30daa8[_0x319ed5(0x1cc)](colorBorder('│',_0x410a80)+'\x20'+_0xb0f812+'\x20'+colorBorder('│',_0x410a80)),_0x30daa8[_0x319ed5(0x1cc)](colorBorder('└'+'─'['repeat'](_0x4cfcee)+'┘',_0x410a80)),_0x30daa8['join']('\x0a');}function simplifyType(_0x5716ef){const _0x23dc17=a146_0x51d7,_0x415e8b={'varchar':_0x23dc17(0x1a9),'bigint':_0x23dc17(0x1d6),'integer':_0x23dc17(0x1dd),'double':_0x23dc17(0x1d0),'boolean':'bool','date':_0x23dc17(0x1ad),'timestamp':_0x23dc17(0x1d1),'array':'array','map':_0x23dc17(0x1c1),'row':_0x23dc17(0x1da)},_0x3017e9=_0x5716ef[_0x23dc17(0x1c5)]();for(const [_0xf9aba8,_0x42fa4e]of Object[_0x23dc17(0x1b8)](_0x415e8b)){if(_0x3017e9[_0x23dc17(0x1cb)](_0xf9aba8))return _0x42fa4e;}return _0x5716ef[_0x23dc17(0x1d4)]>0xa?_0x5716ef[_0x23dc17(0x1bb)](0x0,0xa):_0x5716ef;}export function formatAsJSON(_0x458086,_0x1bb843={}){const _0x2d293e=a146_0x51d7;if(_0x458086[_0x2d293e(0x1ab)]['length']===0x0)return'[]';if(shouldUseColor(_0x1bb843))return colorizeJSON(_0x458086['data'],_0x1bb843);const _0x446706=_0x458086['data'][_0x2d293e(0x1c1)](_0x1e0b86=>'\x20\x20'+JSON['stringify'](_0x1e0b86));return'[\x0a'+_0x446706[_0x2d293e(0x1bc)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x1ce10c,_0x3edca5={}){const _0x1e7ea=a146_0x51d7;if(_0x1ce10c[_0x1e7ea(0x1ab)]['length']===0x0)return'';if(shouldUseColor(_0x3edca5))return _0x1ce10c[_0x1e7ea(0x1ab)][_0x1e7ea(0x1c1)](_0x2217d6=>colorizeJSONCompact(_0x2217d6,_0x3edca5))[_0x1e7ea(0x1bc)]('\x0a');return _0x1ce10c[_0x1e7ea(0x1ab)][_0x1e7ea(0x1c1)](_0x7879ce=>JSON['stringify'](_0x7879ce))['join']('\x0a');}export function formatAsTSV(_0x31d9fc){const _0x37ce90=a146_0x51d7;if(_0x31d9fc[_0x37ce90(0x1ab)][_0x37ce90(0x1d4)]===0x0)return'';const _0x5b308f=[],_0x32e20c=_0x31d9fc['columns'][_0x37ce90(0x1c1)](_0x2d17fd=>_0x2d17fd[_0x37ce90(0x1af)]);return _0x5b308f[_0x37ce90(0x1cc)](_0x32e20c[_0x37ce90(0x1bc)]('\x09')),_0x31d9fc[_0x37ce90(0x1ab)]['forEach'](_0x1a3163=>{const _0x1e09c0=_0x37ce90,_0x3520b1=_0x32e20c['map'](_0x5ab2f4=>{const _0x447ac2=_0x1a3163[_0x5ab2f4];return formatValueForTSV(_0x447ac2);});_0x5b308f[_0x1e09c0(0x1cc)](_0x3520b1[_0x1e09c0(0x1bc)]('\x09'));}),_0x5b308f[_0x37ce90(0x1bc)]('\x0a');}function formatValue(_0x390a9b){const _0x25504f=a146_0x51d7;if(_0x390a9b===null||_0x390a9b===undefined)return'';if(typeof _0x390a9b==='string'){const _0x507c28=_0x390a9b[_0x25504f(0x1ac)](/\n/g,'\x5cn')[_0x25504f(0x1ac)](/\r/g,'\x5cr')[_0x25504f(0x1ac)](/\t/g,'\x5ct');return _0x507c28;}if(typeof _0x390a9b===_0x25504f(0x1b6))return String(_0x390a9b);if(typeof _0x390a9b===_0x25504f(0x1ba))return _0x390a9b?_0x25504f(0x1bf):_0x25504f(0x1a7);if(_0x390a9b instanceof Date)return _0x390a9b[_0x25504f(0x1db)]();if(typeof _0x390a9b===_0x25504f(0x1b3))return JSON[_0x25504f(0x1b1)](_0x390a9b);return String(_0x390a9b);}function formatValueForTSV(_0x5e7105){const _0x55b4b4=a146_0x51d7;if(_0x5e7105===null||_0x5e7105===undefined)return'';if(typeof _0x5e7105===_0x55b4b4(0x1a9))return _0x5e7105[_0x55b4b4(0x1ac)](/\t/g,'\x5ct')[_0x55b4b4(0x1ac)](/\n/g,'\x5cn');if(typeof _0x5e7105==='number'||typeof _0x5e7105===_0x55b4b4(0x1ba))return String(_0x5e7105);if(_0x5e7105 instanceof Date)return _0x5e7105['toISOString']();if(typeof _0x5e7105===_0x55b4b4(0x1b3))return JSON[_0x55b4b4(0x1b1)](_0x5e7105);return String(_0x5e7105);}export function formatQueryResult(_0x5aaeee,_0x326604){const _0x25bef4=a146_0x51d7;switch(_0x326604){case _0x25bef4(0x1c0):return formatAsTable(_0x5aaeee);case _0x25bef4(0x1dc):return formatAsJSON(_0x5aaeee);case'jsonl':return formatAsJSONL(_0x5aaeee);case'tsv':return formatAsTSV(_0x5aaeee);default:return formatAsJSON(_0x5aaeee);}}export function formatBytes(_0x1b44ca){const _0x2e972f=a146_0x51d7;if(_0x1b44ca===0x0)return _0x2e972f(0x1b7);const _0x1a73d3=['B','KB','MB','GB','TB'],_0x46f085=0x400,_0x1aa29d=Math[_0x2e972f(0x1b5)](Math[_0x2e972f(0x1ce)](_0x1b44ca)/Math['log'](_0x46f085)),_0x381af5=_0x1b44ca/Math[_0x2e972f(0x1c9)](_0x46f085,_0x1aa29d),_0x23dd8a=_0x381af5>=0xa?0x1:0x2;return _0x381af5['toFixed'](_0x23dd8a)+'\x20'+_0x1a73d3[_0x1aa29d];}export function formatRows(_0x238a8d){const _0x41d769=a146_0x51d7;if(_0x238a8d==null)return'-';if(_0x238a8d===0x0)return'0';if(_0x238a8d<0x3e8)return _0x238a8d['toString']();const _0x213a8b=['','K','M','B','T'],_0x5e92c5=0x3e8,_0x18231f=Math[_0x41d769(0x1b5)](Math[_0x41d769(0x1ce)](_0x238a8d)/Math[_0x41d769(0x1ce)](_0x5e92c5)),_0x3e09cd=_0x238a8d/Math[_0x41d769(0x1c9)](_0x5e92c5,_0x18231f),_0x11611a=_0x3e09cd>=0xa?0x1:0x2;return''+_0x3e09cd['toFixed'](_0x11611a)+_0x213a8b[_0x18231f];}function a146_0x51d7(_0x31af18,_0x2ce2b9){_0x31af18=_0x31af18-0x1a7;const _0x5eb71f=a146_0x5eb7();let _0x51d7ac=_0x5eb71f[_0x31af18];return _0x51d7ac;}export function hyperlink(_0x4d1b31,_0x5b6a18){const _0x4133f8=a146_0x51d7;if(!process[_0x4133f8(0x1d5)][_0x4133f8(0x1c7)])return _0x4d1b31;return'\x1b]8;;'+_0x5b6a18+'\x07'+_0x4d1b31+_0x4133f8(0x1cd);}
|
package/dist/sdk/util/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a147_0x4521(){var _0x3894a8=['74oqbnZE','2359iJHDmW','757113iXhfFN','7151NGnpBq','24949520suDQqB','15720WCdWDr','6111162yfyRWN','2507880JTjTFS','3650870pbibDb','12UwaVOI'];a147_0x4521=function(){return _0x3894a8;};return a147_0x4521();}(function(_0x7c1bc3,_0x2a77b9){var _0x4addec=a147_0x3449,_0x211d78=_0x7c1bc3();while(!![]){try{var _0x46f0ac=-parseInt(_0x4addec(0x1c1))/0x1*(parseInt(_0x4addec(0x1be))/0x2)+-parseInt(_0x4addec(0x1c0))/0x3*(-parseInt(_0x4addec(0x1bd))/0x4)+parseInt(_0x4addec(0x1c6))/0x5+parseInt(_0x4addec(0x1c5))/0x6+-parseInt(_0x4addec(0x1bf))/0x7*(-parseInt(_0x4addec(0x1c3))/0x8)+parseInt(_0x4addec(0x1c4))/0x9+-parseInt(_0x4addec(0x1c2))/0xa;if(_0x46f0ac===_0x2a77b9)break;else _0x211d78['push'](_0x211d78['shift']());}catch(_0x334217){_0x211d78['push'](_0x211d78['shift']());}}}(a147_0x4521,0x76e27));function a147_0x3449(_0x243b07,_0x5209eb){_0x243b07=_0x243b07-0x1bd;var _0x4521f8=a147_0x4521();var _0x34495e=_0x4521f8[_0x243b07];return _0x34495e;}export*from'./formatters.js';export*from'./format-detector.js';export*from'./tree-formatter.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x594964,_0x5abef8){const _0x450e32=a148_0x3b74,_0x5b7f3c=_0x594964();while(!![]){try{const _0x11327c=parseInt(_0x450e32(0x1a4))/0x1*(-parseInt(_0x450e32(0x1cb))/0x2)+-parseInt(_0x450e32(0x1a6))/0x3+parseInt(_0x450e32(0x1cc))/0x4*(-parseInt(_0x450e32(0x1cf))/0x5)+parseInt(_0x450e32(0x1c1))/0x6+parseInt(_0x450e32(0x1b8))/0x7+parseInt(_0x450e32(0x1b7))/0x8*(-parseInt(_0x450e32(0x1d0))/0x9)+parseInt(_0x450e32(0x1ab))/0xa*(parseInt(_0x450e32(0x1b0))/0xb);if(_0x11327c===_0x5abef8)break;else _0x5b7f3c['push'](_0x5b7f3c['shift']());}catch(_0x540f10){_0x5b7f3c['push'](_0x5b7f3c['shift']());}}}(a148_0x4f3e,0x7fceb));import{formatRows,hyperlink}from'./formatters.js';import a148_0x552071 from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};export function formatTree(_0x5978cc,_0xb3b343={},_0x298eec=0x0,_0x204864=''){const _0x176627=a148_0x3b74,_0x2dfeb3={...DEFAULT_OPTIONS,..._0xb3b343},_0x38f5ce=[],_0x17c5d4=[..._0x5978cc][_0x176627(0x1ac)]((_0x1ae011,_0x55393f)=>_0x1ae011[_0x176627(0x1a1)]['localeCompare'](_0x55393f[_0x176627(0x1a1)],undefined,{'sensitivity':_0x176627(0x1b9)}));for(let _0x3055ff=0x0;_0x3055ff<_0x17c5d4['length'];_0x3055ff++){const _0x3b5cfe=_0x17c5d4[_0x3055ff],_0x457814=_0x3055ff===_0x17c5d4[_0x176627(0x1ae)]-0x1;let _0x1c2ea2='';_0x298eec>0x0&&(_0x1c2ea2+=_0x204864);_0x2dfeb3[_0x176627(0x1a3)]&&_0x298eec>0x0&&(_0x1c2ea2+=a148_0x552071[_0x176627(0x1a7)](_0x457814?_0x176627(0x1a9):'├──\x20'));if(_0x2dfeb3[_0x176627(0x1c9)]){if(_0x3b5cfe[_0x176627(0x1b6)]===_0x176627(0x1be))_0x1c2ea2+=_0x176627(0x1ad);else _0x3b5cfe[_0x176627(0x1b6)]===_0x176627(0x1c0)?_0x1c2ea2+=_0x176627(0x1c3):_0x1c2ea2+=_0x176627(0x1c6);}if(_0x2dfeb3[_0x176627(0x1ce)]&&_0x3b5cfe[_0x176627(0x1b6)]===_0x176627(0x1c4))_0x1c2ea2+=hyperlink(_0x3b5cfe[_0x176627(0x1a1)],_0x2dfeb3[_0x176627(0x1ce)](_0x3b5cfe['id']));else _0x2dfeb3[_0x176627(0x1d5)]&&_0x3b5cfe['type']===_0x176627(0x1c0)?_0x1c2ea2+=hyperlink(_0x3b5cfe[_0x176627(0x1a1)],_0x2dfeb3['getJourneyUrl'](_0x3b5cfe['id'])):_0x1c2ea2+=_0x3b5cfe[_0x176627(0x1a1)];if(_0x2dfeb3[_0x176627(0x1cd)]){if(_0x3b5cfe[_0x176627(0x1b6)]===_0x176627(0x1be)){const _0xc7e878=[];_0x3b5cfe[_0x176627(0x1b5)][_0x176627(0x1d2)]&&_0xc7e878[_0x176627(0x1a8)](_0x3b5cfe[_0x176627(0x1b5)][_0x176627(0x1d2)]+_0x176627(0x1b3)+(_0x3b5cfe[_0x176627(0x1b5)][_0x176627(0x1d2)]!==0x1?'s':'')),_0x3b5cfe[_0x176627(0x1b5)]['folderCount']&&_0xc7e878['push'](_0x3b5cfe['metadata'][_0x176627(0x1bd)]+_0x176627(0x1af)+(_0x3b5cfe[_0x176627(0x1b5)][_0x176627(0x1bd)]!==0x1?'s':'')),_0x3b5cfe[_0x176627(0x1b5)][_0x176627(0x1ba)]&&_0xc7e878[_0x176627(0x1a8)](_0x3b5cfe[_0x176627(0x1b5)][_0x176627(0x1ba)]+_0x176627(0x1b1)+(_0x3b5cfe['metadata'][_0x176627(0x1ba)]!==0x1?'s':'')),_0xc7e878[_0x176627(0x1ae)]>0x0&&(_0x1c2ea2+=a148_0x552071[_0x176627(0x1a7)]('\x20('+_0xc7e878['join'](',\x20')+')'));}else{if(_0x3b5cfe['type']===_0x176627(0x1c4)&&_0x3b5cfe[_0x176627(0x1d3)]!==undefined)_0x1c2ea2+=a148_0x552071['dim']('\x20('+formatRows(_0x3b5cfe[_0x176627(0x1d3)])+')');else _0x3b5cfe[_0x176627(0x1b6)]==='journey'&&_0x3b5cfe[_0x176627(0x1c5)]&&(_0x1c2ea2+=a148_0x552071[_0x176627(0x1a7)]('\x20'+getJourneyStateIndicator(_0x3b5cfe[_0x176627(0x1c5)])));}}_0x38f5ce[_0x176627(0x1a8)](_0x1c2ea2);if(_0x3b5cfe[_0x176627(0x1a5)]&&_0x3b5cfe[_0x176627(0x1a5)][_0x176627(0x1ae)]>0x0){let _0x39a232;if(_0x298eec===0x0)_0x39a232='';else _0x2dfeb3[_0x176627(0x1a3)]?_0x39a232=_0x204864+(_0x457814?'\x20\x20\x20\x20':a148_0x552071[_0x176627(0x1a7)]('│')+_0x176627(0x1d4)):_0x39a232=_0x204864+_0x2dfeb3[_0x176627(0x1b2)];const _0x40a1f3=formatTree(_0x3b5cfe[_0x176627(0x1a5)],_0x2dfeb3,_0x298eec+0x1,_0x39a232);_0x38f5ce[_0x176627(0x1a8)](_0x40a1f3);}}return _0x38f5ce[_0x176627(0x1a2)]('\x0a');}export function formatFlatList(_0x6df46b,_0x41f6c1,_0x3c7c75={},_0x1c112d=[]){const _0x3ed3a0=a148_0x3b74,_0x413242={...DEFAULT_OPTIONS,..._0x3c7c75},_0x224212=[];for(const _0x32b4dc of _0x6df46b){_0x224212[_0x3ed3a0(0x1a8)]({'sortKey':_0x32b4dc['name'],'displayName':_0x32b4dc['name'],'icon':_0x413242[_0x3ed3a0(0x1c9)]?'📁':'','metadata':undefined});}for(const _0x16bfe6 of _0x41f6c1){const _0x4daef8=_0x413242[_0x3ed3a0(0x1cd)]&&_0x16bfe6['population']!==undefined?a148_0x552071['dim']('\x20('+formatRows(_0x16bfe6[_0x3ed3a0(0x1d3)])+')'):'',_0xaf1c5c=_0x413242[_0x3ed3a0(0x1ce)]?hyperlink(_0x16bfe6[_0x3ed3a0(0x1a1)],_0x413242['getSegmentUrl'](_0x16bfe6['id'])):_0x16bfe6[_0x3ed3a0(0x1a1)];_0x224212['push']({'sortKey':_0x16bfe6[_0x3ed3a0(0x1a1)],'displayName':_0xaf1c5c,'icon':_0x413242[_0x3ed3a0(0x1c9)]?'🎯':'','metadata':_0x4daef8});}for(const _0x535f71 of _0x1c112d){const _0x3c10f3=getJourneyStateIndicator(_0x535f71[_0x3ed3a0(0x1c5)]),_0x24eb2f=_0x413242['showMetadata']?a148_0x552071[_0x3ed3a0(0x1a7)]('\x20'+_0x3c10f3):'',_0x29abb0=_0x413242['getJourneyUrl']?hyperlink(_0x535f71['journeyBundleName'],_0x413242[_0x3ed3a0(0x1d5)](_0x535f71['id'])):_0x535f71[_0x3ed3a0(0x1c7)];_0x224212[_0x3ed3a0(0x1a8)]({'sortKey':_0x535f71[_0x3ed3a0(0x1c7)],'displayName':_0x29abb0,'icon':_0x413242[_0x3ed3a0(0x1c9)]?_0x3ed3a0(0x1bc):'','metadata':_0x24eb2f});}_0x224212['sort']((_0x23a0c8,_0x10c12c)=>_0x23a0c8['sortKey']['localeCompare'](_0x10c12c[_0x3ed3a0(0x1bf)],undefined,{'sensitivity':_0x3ed3a0(0x1b9)}));if(_0x224212[_0x3ed3a0(0x1ae)]===0x0)return _0x3ed3a0(0x1d1);const _0x150653=_0x224212['map'](_0x4a0514=>{const _0x312d8c=_0x3ed3a0,_0x361003=_0x4a0514['icon']?_0x4a0514[_0x312d8c(0x1c2)]+'\x20':'',_0x43399d=_0x4a0514[_0x312d8c(0x1b5)]||'';return''+_0x361003+_0x4a0514[_0x312d8c(0x1ca)]+_0x43399d;});return _0x150653[_0x3ed3a0(0x1a2)]('\x0a');}function a148_0x3b74(_0x462476,_0x1838de){_0x462476=_0x462476-0x1a1;const _0x4f3e94=a148_0x4f3e();let _0x3b74c2=_0x4f3e94[_0x462476];return _0x3b74c2;}function getJourneyStateIndicator(_0x34925c){const _0xdf57d1=a148_0x3b74;switch(_0x34925c){case _0xdf57d1(0x1bb):return'(draft)';case'launched':return'(running)';case'paused':return _0xdf57d1(0x1aa);case _0xdf57d1(0x1c8):return _0xdf57d1(0x1b4);default:return'('+_0x34925c+')';}}function a148_0x4f3e(){const _0x9b341d=['(empty)','segmentCount','population','\x20\x20\x20','getJourneyUrl','name','join','showTreeLines','262469xEpyzE','children','3128022rgNylF','dim','push','└──\x20','(paused)','160ZTGyQe','sort','📁\x20','length','\x20folder','1404623MonVBX','\x20journey','indent','\x20segment','(completed)','metadata','type','8ZuZTqS','6322799pdWWRY','base','journeyCount','draft','🗺️','folderCount','folder','sortKey','journey','3544470LzfIel','icon','🗺️\x20','segment','state','🎯\x20','journeyBundleName','completed','showIcons','displayName','6XCamHX','3340556eSRFOp','showMetadata','getSegmentUrl','5CWPMvX','3135339riqQyx'];a148_0x4f3e=function(){return _0x9b341d;};return a148_0x4f3e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4a57ab,_0x3046f4){const _0x161898=a149_0x495c,_0x4a3042=_0x4a57ab();while(!![]){try{const _0xfb1cd6=-parseInt(_0x161898(0xfc))/0x1*(parseInt(_0x161898(0x108))/0x2)+-parseInt(_0x161898(0xe6))/0x3+-parseInt(_0x161898(0x107))/0x4*(parseInt(_0x161898(0xf4))/0x5)+parseInt(_0x161898(0xfb))/0x6*(parseInt(_0x161898(0xee))/0x7)+-parseInt(_0x161898(0x100))/0x8*(-parseInt(_0x161898(0x109))/0x9)+-parseInt(_0x161898(0x101))/0xa+parseInt(_0x161898(0xec))/0xb*(parseInt(_0x161898(0xeb))/0xc);if(_0xfb1cd6===_0x3046f4)break;else _0x4a3042['push'](_0x4a3042['shift']());}catch(_0x1250f5){_0x4a3042['push'](_0x4a3042['shift']());}}}(a149_0x46fe,0x585cc));import{promises as a149_0x1b78f4}from'fs';import a149_0x1c1a38 from'path';import a149_0x2e0dbf from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';export async function prepareCloneWorkflow(_0x30288b,_0x3e69b6,_0x4e43bd,_0xbe5b1e={}){const _0xb642fc=a149_0x495c,{client:_0x43e68c}=_0x30288b,_0x5b084f=a149_0x1c1a38[_0xb642fc(0x102)](_0x3e69b6);try{await a149_0x1b78f4[_0xb642fc(0x105)](_0x5b084f);}catch{throw new Error(_0xb642fc(0xff)+_0x3e69b6);}const _0x47c938=tryFindWorkflowTdxConfig(_0x5b084f),_0x14f529=_0x47c938?.['config'][_0xb642fc(0x106)],_0x19f095=_0xbe5b1e[_0xb642fc(0x104)]||new Date()[_0xb642fc(0xea)]()[_0xb642fc(0xf8)](/[:.]/g,'-');if(!_0xbe5b1e[_0xb642fc(0xf5)]){const _0x139696=await a149_0x1b78f4[_0xb642fc(0x10a)](_0x5b084f),_0xc75383=_0x139696[_0xb642fc(0xf6)](_0x47201=>_0x47201['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0xc75383['length']===0x0)throw new Error(_0xb642fc(0xfa)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20'+_0x5b084f);}const _0xc22339=await getProjectFiles(_0x5b084f);let _0x2281cd=![],_0x2a75da;try{const _0x38a2ce=await _0x43e68c[_0xb642fc(0xf1)]({'name_pattern':_0x4e43bd}),_0x2007bc=_0x38a2ce['data'][_0xb642fc(0xf2)](_0x4322cf=>_0x4322cf[_0xb642fc(0xfd)]===_0x4e43bd);_0x2007bc&&(_0x2281cd=!![],_0x2a75da=_0x2007bc['id']);}catch{}return{'sourceDir':_0x5b084f,'sourceProjectName':_0x14f529,'newProjectName':_0x4e43bd,'revision':_0x19f095,'fileCount':_0xc22339['length'],'files':_0xc22339,'targetExists':_0x2281cd,'existingProjectId':_0x2a75da};}function a149_0x495c(_0x1c8d21,_0x449c4b){_0x1c8d21=_0x1c8d21-0xe6;const _0x46fec7=a149_0x46fe();let _0x495ce4=_0x46fec7[_0x1c8d21];return _0x495ce4;}export async function executeCloneWorkflow(_0x482637,_0x429525){const _0x46dbda=a149_0x495c,_0x1a812e=await import(_0x46dbda(0xf9)),{client:_0x451be1}=_0x482637,_0x28c191=await getProjectFiles(_0x429525[_0x46dbda(0xf0)]),_0x27a6cc=await a149_0x1b78f4['mkdtemp'](a149_0x1c1a38[_0x46dbda(0xf7)](a149_0x2e0dbf[_0x46dbda(0xe7)](),_0x46dbda(0xef))),_0x424e37=a149_0x1c1a38[_0x46dbda(0xf7)](_0x27a6cc,_0x46dbda(0x10b));try{await _0x1a812e[_0x46dbda(0xf3)]({'file':_0x424e37,'gzip':!![],'cwd':_0x429525[_0x46dbda(0xf0)],'portable':!![]},_0x28c191);const _0x480b2d=await _0x451be1[_0x46dbda(0xe8)](_0x429525[_0x46dbda(0xfe)],_0x429525[_0x46dbda(0x104)],_0x424e37);return{'sourceDir':_0x429525[_0x46dbda(0xf0)],'sourceProjectName':_0x429525['sourceProjectName'],'newProjectName':_0x480b2d[_0x46dbda(0xfd)],'newProjectId':_0x480b2d['id'],'revision':_0x480b2d[_0x46dbda(0x104)],'fileCount':_0x28c191['length'],'files':_0x28c191};}finally{await a149_0x1b78f4['rm'](_0x27a6cc,{'recursive':!![],'force':!![]});}}function a149_0x46fe(){const _0x3334f4=['newProjectName','Source\x20directory\x20not\x20found:\x20','246752QPUUxK','1492610lpeagA','resolve','push','revision','access','workflow_project','60GFOJeH','22yFZIlA','9ZSXBLb','readdir','archive.tar.gz','1498293oKAlBl','tmpdir','uploadProjectArchive','isDirectory','toISOString','13467228dPcHfw','11GZWXfK','tdx.json','818167KxMjRi','tdx-wf-clone-','sourceDir','listProjects','find','create','210125lnwNQv','skipValidation','filter','join','replace','tar','No\x20','36RNOeTY','19400PLTCbJ','name'];a149_0x46fe=function(){return _0x3334f4;};return a149_0x46fe();}async function getProjectFiles(_0x13da93,_0x54e9c7=''){const _0x319fc3=a149_0x495c,_0x57e358=[],_0x3eb8a0=await a149_0x1b78f4[_0x319fc3(0x10a)](_0x13da93,{'withFileTypes':!![]});for(const _0xf93a7a of _0x3eb8a0){const _0x480bed=_0x54e9c7?a149_0x1c1a38[_0x319fc3(0xf7)](_0x54e9c7,_0xf93a7a[_0x319fc3(0xfd)]):_0xf93a7a['name'];if(_0xf93a7a[_0x319fc3(0xfd)]===_0x319fc3(0xed))continue;if(!shouldIncludeInArchive(_0xf93a7a['name']))continue;if(_0xf93a7a[_0x319fc3(0xe9)]()){const _0x122674=await getProjectFiles(a149_0x1c1a38[_0x319fc3(0xf7)](_0x13da93,_0xf93a7a['name']),_0x480bed);_0x57e358[_0x319fc3(0x103)](..._0x122674);}else _0x57e358[_0x319fc3(0x103)](_0x480bed);}return _0x57e358;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a150_0x75b7c4=a150_0x6093;function a150_0x5333(){const _0x24c7c1=['unlink','upstreams','listSecrets','Cannot\x20read\x20workflow\x20file:\x20','WORKFLOW_PROJECT_NOT_FOUND','toString','fullName','workflows','includeRetried','isGroup','retryAttemptName','startedAt','bind','scheduleFrom','path','listLogFiles','sessionId','prepareCloneProject','applyPullProject','.tar.gz','find','155612JWNdhd','resumeFrom','filter','getProject','executeCloneProject','setSecret','finishedAt','download','skipValidation','util','basename','access','logger','state','retryAt','createdAt','tmpdir','.\x20Expected\x20\x22project.workflow\x22','timezone','parentId','project','retrySession','No\x20','Project\x20not\x20found:\x20','now','getAttempt','lastId','join','from','mkdir','Kill\x20request\x20accepted','1155774YLEZuD','downloadProjectArchive','error','status','length','endsWith','gunzip','workflow','cancelRequested','fromTask','revision','Invalid\x20workflow\x20format:\x20','push','logFiles','lastAttempt','done','replace','client','listAttempts','readdir','pullProject','retryParams','isDirectory','deleteSecret','config','899244BUzWRr','fromTime','limit','uploadProjectArchive','message','run','params','zlib','startAttempt','getAttemptTasks','data','index','sessionUuid','sessionTime','toTime','name','storeParams','tar','2852136wlfzNK','arrayBuffer','delete','NUMERIC_ID_PATTERN','listProjects','workflowName','projectName','15oufjCR','success','last_id','create','tdx-workflow-','tasks','Project\x20directory\x20not\x20found:\x20','attempt','slice','resolveProjectId','extract','map','isFile','indexOf','932385cDFIqj','sessions','Failed\x20to\x20download\x20log\x20file:\x20','preparePushProject','12760336TsWFNk','executePushProject','killAttempt','60264MdWnIM'];a150_0x5333=function(){return _0x24c7c1;};return a150_0x5333();}(function(_0x311610,_0x2eadbc){const _0x4447f3=a150_0x6093,_0x106061=_0x311610();while(!![]){try{const _0x4ece16=-parseInt(_0x4447f3(0x13b))/0x1+-parseInt(_0x4447f3(0x169))/0x2+-parseInt(_0x4447f3(0x162))/0x3+-parseInt(_0x4447f3(0x17f))/0x4*(parseInt(_0x4447f3(0x154))/0x5)+-parseInt(_0x4447f3(0x122))/0x6+parseInt(_0x4447f3(0x14d))/0x7+parseInt(_0x4447f3(0x166))/0x8;if(_0x4ece16===_0x2eadbc)break;else _0x106061['push'](_0x106061['shift']());}catch(_0x849b93){_0x106061['push'](_0x106061['shift']());}}}(a150_0x5333,0x6e975));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';const MAX_PAGINATION_LIMIT=0x3e8;async function paginateResults(_0x2d70b8,_0x51c033,_0x5c292b=0x64){const _0x229a2e=a150_0x6093,_0x23eb04=Math['min'](_0x51c033,MAX_PAGINATION_LIMIT),_0x10cebb=[];let _0x2dfe2a;while(_0x10cebb[_0x229a2e(0x126)]<_0x23eb04){const _0x3e41a6=await _0x2d70b8(_0x5c292b,_0x2dfe2a),_0x2bbab0=_0x3e41a6['rawCount']??_0x3e41a6['data'][_0x229a2e(0x126)];if(_0x2bbab0===0x0)break;_0x10cebb[_0x229a2e(0x12e)](..._0x3e41a6['data']);if(!_0x3e41a6[_0x229a2e(0x11d)]||_0x2bbab0<_0x5c292b)break;_0x2dfe2a=_0x3e41a6[_0x229a2e(0x11d)];}return _0x10cebb[_0x229a2e(0x15c)](0x0,_0x23eb04);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';function a150_0x6093(_0x315e21,_0x2940d1){_0x315e21=_0x315e21-0x11d;const _0x533398=a150_0x5333();let _0x609347=_0x533398[_0x315e21];return _0x609347;}import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a150_0x75b7c4(0x150)]=/^\d+$/;[a150_0x75b7c4(0x133)];constructor(_0x525c06){const _0x3c1962=a150_0x75b7c4;this['client']=new WorkflowApiClient(_0x525c06,_0x525c06[_0x3c1962(0x18b)]);}async[a150_0x75b7c4(0x15d)](_0x532c65){const _0x58812a=a150_0x75b7c4;if(WorkflowSDK[_0x58812a(0x150)]['test'](_0x532c65)){const _0x4c2bde=await this[_0x58812a(0x133)][_0x58812a(0x182)](_0x532c65);return{'id':_0x4c2bde['id'],'name':_0x4c2bde[_0x58812a(0x14a)]};}const _0x5db4b6=await this['client'][_0x58812a(0x151)]({'name_pattern':_0x532c65}),_0x4806ea=_0x5db4b6[_0x58812a(0x145)][_0x58812a(0x17e)](_0x56286f=>_0x56286f[_0x58812a(0x14a)]===_0x532c65);if(!_0x4806ea)throw new SDKError(ErrorCode[_0x58812a(0x16e)],_0x58812a(0x196)+_0x532c65);return{'id':_0x4806ea['id'],'name':_0x4806ea[_0x58812a(0x14a)]};}async['projects'](_0x78941f,_0x371749){const _0x1ec2d3=a150_0x75b7c4,_0x6f6bfb=_0x371749?.[_0x1ec2d3(0x13d)]||0x64,_0x1ebee8=await paginateResults((_0x32adc1,_0x4a01e3)=>this[_0x1ec2d3(0x133)][_0x1ec2d3(0x151)]({'name_pattern':_0x78941f,'limit':_0x32adc1,'last_id':_0x4a01e3??_0x371749?.[_0x1ec2d3(0x156)]}),_0x6f6bfb);return _0x1ebee8[_0x1ec2d3(0x15f)](_0xe6960f=>({..._0xe6960f,'project_id':_0xe6960f['id'],'project_name':_0xe6960f[_0x1ec2d3(0x14a)]}));}async[a150_0x75b7c4(0x171)](_0x189ac8,_0x1002bc){const _0x2fc0ab=a150_0x75b7c4,_0x3124d4=_0x1002bc?.[_0x2fc0ab(0x13d)]||0x64,_0x50ad3e=await paginateResults((_0x278ef2,_0xf3de6c)=>this[_0x2fc0ab(0x133)]['listWorkflows']({'project_name':_0x189ac8,'limit':_0x278ef2,'last_id':_0xf3de6c??_0x1002bc?.[_0x2fc0ab(0x156)]}),_0x3124d4);return _0x50ad3e['map'](_0xdf110d=>({'project_id':_0xdf110d[_0x2fc0ab(0x193)]?.['id'],'project_name':_0xdf110d[_0x2fc0ab(0x193)]?.['name'],'workflow_id':_0xdf110d['id'],'workflow_name':_0xdf110d['name'],'revision':_0xdf110d['revision'],'timezone':_0xdf110d[_0x2fc0ab(0x191)],'config':_0xdf110d[_0x2fc0ab(0x13a)],'id':_0xdf110d['id'],'name':_0xdf110d['name'],'project':_0xdf110d['project']}));}async[a150_0x75b7c4(0x163)](_0x47e9b9){const _0x456196=a150_0x75b7c4;let _0x324392;if(_0x47e9b9?.[_0x456196(0x153)]){let _0x13171f,_0x506365=![];while(!_0x506365){const _0x1aa6e7=await this['client']['listProjects']({'limit':0x64,'last_id':_0x13171f}),_0x3f1288=_0x1aa6e7['data'][_0x456196(0x17e)](_0x2c5752=>_0x2c5752['name']===_0x47e9b9[_0x456196(0x153)]);if(_0x3f1288){_0x324392=_0x3f1288['id'],_0x506365=!![];break;}if(!_0x1aa6e7[_0x456196(0x11d)]||_0x1aa6e7['data']['length']===0x0)break;_0x13171f=_0x1aa6e7['lastId'];}if(!_0x324392)throw new SDKError(ErrorCode[_0x456196(0x16e)],_0x456196(0x196)+_0x47e9b9[_0x456196(0x153)]);}const _0x22665a=_0x47e9b9?.[_0x456196(0x13d)]||0x64,_0x36359b=await paginateResults((_0x24c513,_0x3784c2)=>this[_0x456196(0x133)]['listSessions']({'project_id':_0x324392,'project_name':_0x47e9b9?.[_0x456196(0x153)],'workflow_name':_0x47e9b9?.[_0x456196(0x152)],'status':_0x47e9b9?.[_0x456196(0x125)],'from_time':_0x47e9b9?.[_0x456196(0x13c)],'to_time':_0x47e9b9?.[_0x456196(0x149)],'limit':_0x24c513,'last_id':_0x3784c2??_0x47e9b9?.[_0x456196(0x156)]}),_0x22665a);return _0x36359b[_0x456196(0x15f)](_0x206692=>({'project_id':_0x206692[_0x456196(0x193)]?.['id'],'project_name':_0x206692[_0x456196(0x193)]?.[_0x456196(0x14a)],'workflow_id':_0x206692[_0x456196(0x129)]?.['id'],'workflow_name':_0x206692['workflow']?.[_0x456196(0x14a)],'session_id':_0x206692['id'],'sessionUuid':_0x206692[_0x456196(0x147)],'sessionTime':_0x206692[_0x456196(0x148)],'lastAttempt':_0x206692[_0x456196(0x130)],'id':_0x206692['id'],'project':_0x206692[_0x456196(0x193)],'workflow':_0x206692['workflow']}));}async['attempts'](_0x1c3746){const _0x3e935c=a150_0x75b7c4,_0x4b42d4=_0x1c3746?.[_0x3e935c(0x13d)]||0x64,_0x283c7d=await paginateResults((_0x537d76,_0x3deede)=>this['client'][_0x3e935c(0x134)]({'project_name':_0x1c3746?.['projectName'],'workflow_name':_0x1c3746?.[_0x3e935c(0x152)],'include_retried':_0x1c3746?.[_0x3e935c(0x172)],'limit':_0x537d76,'last_id':_0x3deede??_0x1c3746?.[_0x3e935c(0x156)]}),_0x4b42d4);return _0x283c7d[_0x3e935c(0x15f)](_0x18bb46=>({'project_id':_0x18bb46[_0x3e935c(0x193)]?.['id'],'project_name':_0x18bb46[_0x3e935c(0x193)]?.[_0x3e935c(0x14a)],'workflow_id':_0x18bb46['workflow']?.['id'],'workflow_name':_0x18bb46[_0x3e935c(0x129)]?.[_0x3e935c(0x14a)],'session_id':_0x18bb46[_0x3e935c(0x17a)],'sessionUuid':_0x18bb46['sessionUuid'],'sessionTime':_0x18bb46[_0x3e935c(0x148)],'attempt_id':_0x18bb46['id'],'attempt_index':_0x18bb46[_0x3e935c(0x146)],'retryAttemptName':_0x18bb46[_0x3e935c(0x174)],'done':_0x18bb46[_0x3e935c(0x131)],'success':_0x18bb46[_0x3e935c(0x155)],'cancelRequested':_0x18bb46[_0x3e935c(0x12a)],'params':_0x18bb46[_0x3e935c(0x141)],'createdAt':_0x18bb46[_0x3e935c(0x18e)],'finishedAt':_0x18bb46[_0x3e935c(0x185)],'id':_0x18bb46['id'],'index':_0x18bb46['index'],'project':_0x18bb46['project'],'workflow':_0x18bb46['workflow']}));}async[a150_0x75b7c4(0x15b)](_0x8d2721){const _0x1ea86c=a150_0x75b7c4,_0x2dee7b=await this[_0x1ea86c(0x133)][_0x1ea86c(0x198)](_0x8d2721);return _0x2dee7b;}async[a150_0x75b7c4(0x159)](_0xe01ace,_0x1188fc=![]){const _0x5b1c27=a150_0x75b7c4,_0x29b21c=await this[_0x5b1c27(0x133)][_0x5b1c27(0x144)](_0xe01ace,_0x1188fc);return _0x29b21c[_0x5b1c27(0x15f)](_0x7ae32=>({'task_id':_0x7ae32['id'],'task_name':_0x7ae32[_0x5b1c27(0x170)],'parentId':_0x7ae32[_0x5b1c27(0x192)],'config':_0x7ae32['config'],'upstreams':_0x7ae32[_0x5b1c27(0x16b)],'state':_0x7ae32[_0x5b1c27(0x18c)],'exportParams':_0x7ae32['exportParams'],'storeParams':_0x7ae32[_0x5b1c27(0x14b)],'stateParams':_0x7ae32['stateParams'],'updatedAt':_0x7ae32['updatedAt'],'retryAt':_0x7ae32[_0x5b1c27(0x18d)],'startedAt':_0x7ae32[_0x5b1c27(0x175)],'error':_0x7ae32[_0x5b1c27(0x124)],'isGroup':_0x7ae32[_0x5b1c27(0x173)],'id':_0x7ae32['id'],'fullName':_0x7ae32[_0x5b1c27(0x170)]}));}async[a150_0x75b7c4(0x12f)](_0x4528f0,_0x17d1a1){const _0x1990d8=a150_0x75b7c4;return await this['client'][_0x1990d8(0x179)](_0x4528f0,_0x17d1a1);}async['logs'](_0x4467a4,_0x1e45ed){const _0x22c3cf=a150_0x75b7c4,_0x3a6074=await import(_0x22c3cf(0x142)),{promisify:_0x5209c0}=await import(_0x22c3cf(0x188)),_0x14bab4=_0x5209c0(_0x3a6074[_0x22c3cf(0x128)]),_0x1ffc2b=await this[_0x22c3cf(0x133)][_0x22c3cf(0x179)](_0x4467a4,_0x1e45ed);if(_0x1ffc2b['length']===0x0)return'';const _0x780a07=[];for(const _0x4aa4ab of _0x1ffc2b){if(!_0x4aa4ab['direct'])continue;const _0x5a0d38=await fetch(_0x4aa4ab['direct']);if(!_0x5a0d38['ok'])throw new Error(_0x22c3cf(0x164)+_0x5a0d38['status']);const _0x2a9fe1=Buffer[_0x22c3cf(0x11f)](await _0x5a0d38[_0x22c3cf(0x14e)]()),_0x17232f=await _0x14bab4(_0x2a9fe1);_0x780a07[_0x22c3cf(0x12e)](_0x17232f[_0x22c3cf(0x16f)]('utf-8'));}return _0x780a07[_0x22c3cf(0x11e)]('\x0a');}async['kill'](_0x5bddf8,_0x5ee23b){const _0x32f1a7=a150_0x75b7c4,_0x1de5ae=await this[_0x32f1a7(0x133)][_0x32f1a7(0x168)](_0x5bddf8,_0x5ee23b);return _0x1de5ae?.[_0x32f1a7(0x13f)]??_0x32f1a7(0x121);}async[a150_0x75b7c4(0x194)](_0x4941bc,_0x2c0a9d){const _0x14d4a9=a150_0x75b7c4,_0x325e82=await this[_0x14d4a9(0x133)][_0x14d4a9(0x194)](_0x4941bc,{'from_task':_0x2c0a9d?.[_0x14d4a9(0x12b)],'retry_params':_0x2c0a9d?.[_0x14d4a9(0x137)]});return{'attemptId':_0x325e82['id'],'sessionId':_0x325e82[_0x14d4a9(0x17a)]};}async['retryAttempt'](_0x56ebfb,_0x3aaf6a){const _0x266a73=a150_0x75b7c4,_0xf4fc2b=await this['client']['retryAttempt'](_0x56ebfb,{'resume_from':_0x3aaf6a?.[_0x266a73(0x180)],'retry_params':_0x3aaf6a?.[_0x266a73(0x137)],'force':_0x3aaf6a?.['force']});return{'attemptId':_0xf4fc2b['id'],'sessionId':_0xf4fc2b[_0x266a73(0x17a)]};}async[a150_0x75b7c4(0x140)](_0x121ecc,_0x494797={},_0x813e46){const _0x5b7800=a150_0x75b7c4,_0x272a72=_0x121ecc[_0x5b7800(0x161)]('.');let _0xadfc2c,_0x2158b2;if(_0x272a72===-0x1)throw new Error('Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format');_0xadfc2c=_0x121ecc['substring'](0x0,_0x272a72),_0x2158b2=_0x121ecc['substring'](_0x272a72+0x1);if(!_0xadfc2c||!_0x2158b2)throw new Error(_0x5b7800(0x12d)+_0x121ecc+_0x5b7800(0x190));const _0x193d68=_0x813e46?.[_0x5b7800(0x148)]||new Date()['toISOString']();return await this[_0x5b7800(0x133)][_0x5b7800(0x143)]({'projectName':_0xadfc2c,'workflowName':_0x2158b2,'sessionTime':_0x193d68,'params':_0x494797});}async[a150_0x75b7c4(0x186)](_0x2628aa,_0x132d0a,_0x40759b){const _0x28f5e7=a150_0x75b7c4,{promises:_0x1eec91}=await import('fs'),_0xadffef=await import('path'),_0x3e4844=await import('os'),_0x3c6ba3=await import(_0x28f5e7(0x14c)),{id:_0x2f8d4b,name:_0x3249a9}=await this['resolveProjectId'](_0x2628aa),_0x490ac9=_0x3e4844['tmpdir'](),_0x19982a=_0xadffef[_0x28f5e7(0x11e)](_0x490ac9,_0x28f5e7(0x158)+_0x2f8d4b+'-'+Date[_0x28f5e7(0x197)]()+_0x28f5e7(0x17d));try{await this[_0x28f5e7(0x133)][_0x28f5e7(0x123)](_0x2f8d4b,_0x19982a,_0x40759b?.[_0x28f5e7(0x12c)]);const _0x241c43=_0xadffef[_0x28f5e7(0x11e)](_0x132d0a,_0x3249a9);await _0x1eec91[_0x28f5e7(0x120)](_0x241c43,{'recursive':!![]}),await _0x3c6ba3[_0x28f5e7(0x15e)]({'file':_0x19982a,'cwd':_0x241c43,'gzip':!![]});const _0x525e73=async _0x3cdffa=>{const _0x2e3717=_0x28f5e7;let _0x1a8a90=0x0;const _0x1c7cfe=await _0x1eec91[_0x2e3717(0x135)](_0x3cdffa,{'withFileTypes':!![]});for(const _0xdd96e8 of _0x1c7cfe){const _0x4cdabf=_0xadffef[_0x2e3717(0x11e)](_0x3cdffa,_0xdd96e8[_0x2e3717(0x14a)]);if(_0xdd96e8[_0x2e3717(0x160)]())_0x1a8a90++;else _0xdd96e8['isDirectory']()&&(_0x1a8a90+=await _0x525e73(_0x4cdabf));}return _0x1a8a90;},_0x580708=await _0x525e73(_0x241c43);return{'projectName':_0x3249a9,'revision':_0x40759b?.[_0x28f5e7(0x12c)]||'latest','filesExtracted':_0x580708};}finally{try{await _0x1eec91[_0x28f5e7(0x16a)](_0x19982a);}catch{}}}async['push'](_0x2faa4d,_0x9c3fab){const _0xf825ed=a150_0x75b7c4,{promises:_0x54bd26}=await import('fs'),_0x2938bd=await import(_0xf825ed(0x178)),_0x1eba33=await import('tar'),_0x349fb6=_0x9c3fab?.[_0xf825ed(0x153)]||_0x2938bd[_0xf825ed(0x189)](_0x2faa4d),_0x4478ea=_0x9c3fab?.['revision']||new Date()['toISOString']()[_0xf825ed(0x132)](/[:.]/g,'-');try{await _0x54bd26['access'](_0x2faa4d);}catch{throw new Error(_0xf825ed(0x15a)+_0x2faa4d);}if(!_0x9c3fab?.[_0xf825ed(0x187)]){const _0x271c40=await _0x54bd26[_0xf825ed(0x135)](_0x2faa4d),_0x683a24=_0x271c40[_0xf825ed(0x181)](_0x21c16b=>_0x21c16b[_0xf825ed(0x127)](WORKFLOW_FILE_EXTENSION));if(_0x683a24[_0xf825ed(0x126)]===0x0)throw new Error(_0xf825ed(0x195)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20project\x20directory');for(const _0x589a9e of _0x683a24){const _0x2ded06=_0x2938bd[_0xf825ed(0x11e)](_0x2faa4d,_0x589a9e);try{await _0x54bd26[_0xf825ed(0x18a)](_0x2ded06);}catch{throw new Error(_0xf825ed(0x16d)+_0x589a9e);}}}const _0x2fae7b=async(_0x2b54dd,_0x33809b='')=>{const _0x252b50=_0xf825ed,_0x36aa60=await _0x54bd26[_0x252b50(0x135)](_0x2b54dd,{'withFileTypes':!![]}),_0x2c8b8a=[];for(const _0x31201c of _0x36aa60){const _0x167ac4=_0x2938bd[_0x252b50(0x11e)](_0x33809b,_0x31201c['name']),_0x349aed=_0x2938bd['join'](_0x2b54dd,_0x31201c[_0x252b50(0x14a)]);if(!shouldIncludeInArchive(_0x31201c[_0x252b50(0x14a)]))continue;_0x31201c[_0x252b50(0x138)]()?_0x2c8b8a[_0x252b50(0x12e)](...await _0x2fae7b(_0x349aed,_0x167ac4)):_0x2c8b8a[_0x252b50(0x12e)](_0x167ac4);}return _0x2c8b8a;},_0x2fa0d5=await _0x2fae7b(_0x2faa4d),_0x3949f5=await import('os'),_0x51e0e6=_0x3949f5[_0xf825ed(0x18f)](),_0x3d57a4=_0x2938bd[_0xf825ed(0x11e)](_0x51e0e6,'tdx-workflow-push-'+Date[_0xf825ed(0x197)]()+_0xf825ed(0x17d));try{await _0x1eba33[_0xf825ed(0x157)]({'file':_0x3d57a4,'gzip':!![],'cwd':_0x2faa4d,'portable':!![]},_0x2fa0d5);const _0xefe8f7=await this['client'][_0xf825ed(0x13e)](_0x349fb6,_0x4478ea,_0x3d57a4,{'scheduleFrom':_0x9c3fab?.[_0xf825ed(0x177)],'clearSchedule':_0x9c3fab?.['clearSchedule'],'clearScheduleAll':_0x9c3fab?.['clearScheduleAll']});return{'projectId':_0xefe8f7['id'],'projectName':_0xefe8f7[_0xf825ed(0x14a)],'revision':_0xefe8f7['revision']};}finally{try{await _0x54bd26[_0xf825ed(0x16a)](_0x3d57a4);}catch{}}}async[a150_0x75b7c4(0x14f)](_0x2dff14){const _0x3334c6=a150_0x75b7c4,{id:_0x470499}=await this[_0x3334c6(0x15d)](_0x2dff14),_0xbb6b1b=await this['client']['deleteProject'](_0x470499);return{'projectId':_0xbb6b1b['id'],'projectName':_0xbb6b1b[_0x3334c6(0x14a)]};}async[a150_0x75b7c4(0x16c)](_0x27f338){const _0x1a2597=a150_0x75b7c4,{id:_0xf2a975,name:_0x14ef42}=await this['resolveProjectId'](_0x27f338),_0x158bf7=await this[_0x1a2597(0x133)][_0x1a2597(0x16c)](_0xf2a975);return{'projectName':_0x14ef42,'secrets':_0x158bf7};}async[a150_0x75b7c4(0x184)](_0x2a3390,_0x2832a5,_0x103498){const _0x342a46=a150_0x75b7c4,{id:_0x1f5947,name:_0x39689b}=await this['resolveProjectId'](_0x2a3390);return await this[_0x342a46(0x133)][_0x342a46(0x184)](_0x1f5947,_0x2832a5,_0x103498),{'projectName':_0x39689b,'key':_0x2832a5};}async[a150_0x75b7c4(0x139)](_0x248f93,_0xaa17c6){const _0x1f561d=a150_0x75b7c4,{id:_0x3dee4b,name:_0x406125}=await this['resolveProjectId'](_0x248f93);return await this[_0x1f561d(0x133)][_0x1f561d(0x139)](_0x3dee4b,_0xaa17c6),{'projectName':_0x406125,'key':_0xaa17c6};}async[a150_0x75b7c4(0x136)](_0x46b7f0,_0x18ae40){const _0x315703=a150_0x75b7c4;return pullWorkflow({'client':this['client'],'resolveProjectId':this[_0x315703(0x15d)]['bind'](this)},_0x46b7f0,_0x18ae40);}async[a150_0x75b7c4(0x17c)](_0xf25316,_0x2a4264){const _0x12e6b4=a150_0x75b7c4;return applyPullResult({'client':this['client'],'resolveProjectId':this[_0x12e6b4(0x15d)][_0x12e6b4(0x176)](this)},_0xf25316,_0x2a4264);}async[a150_0x75b7c4(0x165)](_0x20644a){const _0x2bbc59=a150_0x75b7c4;return preparePushWorkflow({'client':this['client'],'resolveProjectId':this[_0x2bbc59(0x15d)][_0x2bbc59(0x176)](this)},_0x20644a);}async[a150_0x75b7c4(0x167)](_0x51a242){const _0x547ffc=a150_0x75b7c4;return executePushWorkflow({'client':this[_0x547ffc(0x133)],'resolveProjectId':this[_0x547ffc(0x15d)][_0x547ffc(0x176)](this)},_0x51a242);}async[a150_0x75b7c4(0x17b)](_0x40790f,_0x42b774,_0x53df61){const _0x159cce=a150_0x75b7c4;return prepareCloneWorkflow({'client':this[_0x159cce(0x133)]},_0x40790f,_0x42b774,_0x53df61);}async[a150_0x75b7c4(0x183)](_0x906afd){return executeCloneWorkflow({'client':this['client']},_0x906afd);}}
|
|
1
|
+
const a150_0x13ef79=a150_0x5c08;(function(_0x1224f9,_0x24678f){const _0x4c210f=a150_0x5c08,_0x3e69b9=_0x1224f9();while(!![]){try{const _0x5e1b6b=parseInt(_0x4c210f(0x1cd))/0x1+parseInt(_0x4c210f(0x1db))/0x2*(-parseInt(_0x4c210f(0x168))/0x3)+-parseInt(_0x4c210f(0x1b6))/0x4+parseInt(_0x4c210f(0x1ce))/0x5+-parseInt(_0x4c210f(0x1a2))/0x6+-parseInt(_0x4c210f(0x15f))/0x7*(-parseInt(_0x4c210f(0x1ad))/0x8)+parseInt(_0x4c210f(0x17a))/0x9*(parseInt(_0x4c210f(0x1c6))/0xa);if(_0x5e1b6b===_0x24678f)break;else _0x3e69b9['push'](_0x3e69b9['shift']());}catch(_0x27f8a0){_0x3e69b9['push'](_0x3e69b9['shift']());}}}(a150_0x3a8b,0x7482f));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';const MAX_PAGINATION_LIMIT=0x3e8;async function paginateResults(_0x1a3bb0,_0x1ed02a,_0x685702=0x64){const _0x1f1bb9=a150_0x5c08,_0x31f924=Math['min'](_0x1ed02a,MAX_PAGINATION_LIMIT),_0xd7a93e=[];let _0x3800f;while(_0xd7a93e[_0x1f1bb9(0x177)]<_0x31f924){const _0x58118c=await _0x1a3bb0(_0x685702,_0x3800f),_0x4eb0a8=_0x58118c[_0x1f1bb9(0x192)]??_0x58118c[_0x1f1bb9(0x1a5)]['length'];if(_0x4eb0a8===0x0)break;_0xd7a93e[_0x1f1bb9(0x1d7)](..._0x58118c[_0x1f1bb9(0x1a5)]);if(!_0x58118c[_0x1f1bb9(0x19c)]||_0x4eb0a8<_0x685702)break;_0x3800f=_0x58118c[_0x1f1bb9(0x19c)];}return _0xd7a93e[_0x1f1bb9(0x163)](0x0,_0x31f924);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';function a150_0x5c08(_0x178d94,_0x2e6df9){_0x178d94=_0x178d94-0x15d;const _0x3a8b74=a150_0x3a8b();let _0x5c08af=_0x3a8b74[_0x178d94];return _0x5c08af;}import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a150_0x13ef79(0x1d0)]=/^\d+$/;[a150_0x13ef79(0x1bc)];constructor(_0x500949){const _0x1ed322=a150_0x13ef79;this[_0x1ed322(0x1bc)]=new WorkflowApiClient(_0x500949,_0x500949['logger']);}async[a150_0x13ef79(0x1a0)](_0x5cfdbb){const _0x58e842=a150_0x13ef79;if(WorkflowSDK[_0x58e842(0x1d0)]['test'](_0x5cfdbb)){const _0x4e893f=await this['client'][_0x58e842(0x16d)](_0x5cfdbb);return{'id':_0x4e893f['id'],'name':_0x4e893f[_0x58e842(0x1c9)]};}const _0x826839=await this['client'][_0x58e842(0x190)]({'name_pattern':_0x5cfdbb}),_0x3d11c0=_0x826839[_0x58e842(0x1a5)]['find'](_0x3a099d=>_0x3a099d['name']===_0x5cfdbb);if(!_0x3d11c0)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],_0x58e842(0x181)+_0x5cfdbb);return{'id':_0x3d11c0['id'],'name':_0x3d11c0[_0x58e842(0x1c9)]};}async[a150_0x13ef79(0x18c)](_0x2fc3d9,_0x10c791){const _0x2eae1b=a150_0x13ef79,_0xa055c1=_0x10c791?.[_0x2eae1b(0x1a9)]||0x64,_0x461735=await paginateResults((_0x488abb,_0x2733c6)=>this[_0x2eae1b(0x1bc)][_0x2eae1b(0x190)]({'name_pattern':_0x2fc3d9,'limit':_0x488abb,'last_id':_0x2733c6??_0x10c791?.[_0x2eae1b(0x1af)]}),_0xa055c1);return _0x461735['map'](_0x49c3a7=>({..._0x49c3a7,'project_id':_0x49c3a7['id'],'project_name':_0x49c3a7['name']}));}async[a150_0x13ef79(0x1a3)](_0x19661b,_0x28aebc){const _0x13b5df=a150_0x13ef79,_0x3f6612=_0x28aebc?.['limit']||0x64,_0x4ddef1=await paginateResults((_0x20e24a,_0x37b2e7)=>this[_0x13b5df(0x1bc)][_0x13b5df(0x1e1)]({'project_name':_0x19661b,'limit':_0x20e24a,'last_id':_0x37b2e7??_0x28aebc?.[_0x13b5df(0x1af)]}),_0x3f6612);return _0x4ddef1['map'](_0x3f22a2=>({'project_id':_0x3f22a2['project']?.['id'],'project_name':_0x3f22a2['project']?.['name'],'workflow_id':_0x3f22a2['id'],'workflow_name':_0x3f22a2[_0x13b5df(0x1c9)],'revision':_0x3f22a2[_0x13b5df(0x1b2)],'timezone':_0x3f22a2[_0x13b5df(0x1b4)],'config':_0x3f22a2[_0x13b5df(0x1c4)],'id':_0x3f22a2['id'],'name':_0x3f22a2[_0x13b5df(0x1c9)],'project':_0x3f22a2['project']}));}async['sessions'](_0x382dd2){const _0x3c5960=a150_0x13ef79;let _0x4e50b6;if(_0x382dd2?.[_0x3c5960(0x1b0)]){let _0x2a5249,_0x1ceac6=![];while(!_0x1ceac6){const _0x6a2352=await this[_0x3c5960(0x1bc)][_0x3c5960(0x190)]({'limit':0x64,'last_id':_0x2a5249}),_0x39b329=_0x6a2352[_0x3c5960(0x1a5)][_0x3c5960(0x1d3)](_0x2c31fb=>_0x2c31fb['name']===_0x382dd2[_0x3c5960(0x1b0)]);if(_0x39b329){_0x4e50b6=_0x39b329['id'],_0x1ceac6=!![];break;}if(!_0x6a2352[_0x3c5960(0x19c)]||_0x6a2352[_0x3c5960(0x1a5)][_0x3c5960(0x177)]===0x0)break;_0x2a5249=_0x6a2352[_0x3c5960(0x19c)];}if(!_0x4e50b6)throw new SDKError(ErrorCode[_0x3c5960(0x1c2)],_0x3c5960(0x181)+_0x382dd2[_0x3c5960(0x1b0)]);}const _0x3bb972=_0x382dd2?.[_0x3c5960(0x1a9)]||0x64,_0x454848=await paginateResults((_0x565981,_0x8a4508)=>this['client'][_0x3c5960(0x1cf)]({'project_id':_0x4e50b6,'project_name':_0x382dd2?.[_0x3c5960(0x1b0)],'workflow_name':_0x382dd2?.[_0x3c5960(0x1c5)],'status':_0x382dd2?.['status'],'from_time':_0x382dd2?.[_0x3c5960(0x1dc)],'to_time':_0x382dd2?.[_0x3c5960(0x1de)],'limit':_0x565981,'last_id':_0x8a4508??_0x382dd2?.['last_id']}),_0x3bb972);return _0x454848[_0x3c5960(0x176)](_0x480608=>({'project_id':_0x480608[_0x3c5960(0x17e)]?.['id'],'project_name':_0x480608['project']?.[_0x3c5960(0x1c9)],'workflow_id':_0x480608[_0x3c5960(0x180)]?.['id'],'workflow_name':_0x480608[_0x3c5960(0x180)]?.['name'],'session_id':_0x480608['id'],'sessionUuid':_0x480608[_0x3c5960(0x187)],'sessionTime':_0x480608[_0x3c5960(0x1a1)],'lastAttempt':_0x480608[_0x3c5960(0x1d8)],'id':_0x480608['id'],'project':_0x480608[_0x3c5960(0x17e)],'workflow':_0x480608[_0x3c5960(0x180)]}));}async[a150_0x13ef79(0x17f)](_0xb9622d){const _0x3fc6f1=a150_0x13ef79,_0x138e35=_0xb9622d?.[_0x3fc6f1(0x1a9)]||0x64,_0x4fdeab=await paginateResults((_0x2600f,_0x34a216)=>this['client'][_0x3fc6f1(0x186)]({'project_name':_0xb9622d?.[_0x3fc6f1(0x1b0)],'workflow_name':_0xb9622d?.[_0x3fc6f1(0x1c5)],'include_retried':_0xb9622d?.[_0x3fc6f1(0x173)],'limit':_0x2600f,'last_id':_0x34a216??_0xb9622d?.[_0x3fc6f1(0x1af)]}),_0x138e35);return _0x4fdeab[_0x3fc6f1(0x176)](_0xf47346=>({'project_id':_0xf47346['project']?.['id'],'project_name':_0xf47346[_0x3fc6f1(0x17e)]?.[_0x3fc6f1(0x1c9)],'workflow_id':_0xf47346[_0x3fc6f1(0x180)]?.['id'],'workflow_name':_0xf47346[_0x3fc6f1(0x180)]?.[_0x3fc6f1(0x1c9)],'session_id':_0xf47346[_0x3fc6f1(0x1d6)],'sessionUuid':_0xf47346[_0x3fc6f1(0x187)],'sessionTime':_0xf47346[_0x3fc6f1(0x1a1)],'attempt_id':_0xf47346['id'],'attempt_index':_0xf47346[_0x3fc6f1(0x1ba)],'retryAttemptName':_0xf47346[_0x3fc6f1(0x1bd)],'done':_0xf47346[_0x3fc6f1(0x1ca)],'success':_0xf47346[_0x3fc6f1(0x16c)],'cancelRequested':_0xf47346[_0x3fc6f1(0x172)],'params':_0xf47346[_0x3fc6f1(0x1d9)],'createdAt':_0xf47346[_0x3fc6f1(0x1c3)],'finishedAt':_0xf47346[_0x3fc6f1(0x1cc)],'id':_0xf47346['id'],'index':_0xf47346[_0x3fc6f1(0x1ba)],'project':_0xf47346[_0x3fc6f1(0x17e)],'workflow':_0xf47346[_0x3fc6f1(0x180)]}));}async['attempt'](_0x50bbd1){const _0x4849b9=a150_0x13ef79,_0xc9c0a0=await this['client'][_0x4849b9(0x183)](_0x50bbd1);return _0xc9c0a0;}async[a150_0x13ef79(0x175)](_0x2d7e37,_0x14b881=![]){const _0x494fe8=a150_0x13ef79,_0x2d293b=await this['client'][_0x494fe8(0x15d)](_0x2d7e37,_0x14b881);return _0x2d293b[_0x494fe8(0x176)](_0x19130f=>({'task_id':_0x19130f['id'],'task_name':_0x19130f[_0x494fe8(0x1da)],'parentId':_0x19130f[_0x494fe8(0x1d4)],'config':_0x19130f[_0x494fe8(0x1c4)],'upstreams':_0x19130f[_0x494fe8(0x178)],'state':_0x19130f['state'],'exportParams':_0x19130f[_0x494fe8(0x1c1)],'storeParams':_0x19130f[_0x494fe8(0x188)],'stateParams':_0x19130f[_0x494fe8(0x194)],'updatedAt':_0x19130f[_0x494fe8(0x169)],'retryAt':_0x19130f[_0x494fe8(0x19d)],'startedAt':_0x19130f[_0x494fe8(0x1c0)],'error':_0x19130f[_0x494fe8(0x179)],'isGroup':_0x19130f[_0x494fe8(0x1ac)],'id':_0x19130f['id'],'fullName':_0x19130f['fullName']}));}async[a150_0x13ef79(0x191)](_0xf4a794,_0x275c79){const _0x3da6ad=a150_0x13ef79;return await this[_0x3da6ad(0x1bc)][_0x3da6ad(0x1d1)](_0xf4a794,_0x275c79);}async[a150_0x13ef79(0x195)](_0x5b9ba0,_0x543567){const _0x504a18=a150_0x13ef79,_0x225de2=await import(_0x504a18(0x1df)),{promisify:_0x42baad}=await import(_0x504a18(0x18a)),_0x1d9826=_0x42baad(_0x225de2[_0x504a18(0x196)]),_0x599024=await this[_0x504a18(0x1bc)][_0x504a18(0x1d1)](_0x5b9ba0,_0x543567);if(_0x599024[_0x504a18(0x177)]===0x0)return'';const _0x4d5a47=[];for(const _0x354eaa of _0x599024){if(!_0x354eaa[_0x504a18(0x18f)])continue;const _0x33a26d=await fetch(_0x354eaa[_0x504a18(0x18f)]);if(!_0x33a26d['ok'])throw new Error(_0x504a18(0x1a4)+_0x33a26d['status']);const _0x46622e=Buffer[_0x504a18(0x1b5)](await _0x33a26d[_0x504a18(0x1a8)]()),_0x3f7d08=await _0x1d9826(_0x46622e);_0x4d5a47[_0x504a18(0x1d7)](_0x3f7d08[_0x504a18(0x17b)](_0x504a18(0x182)));}return _0x4d5a47[_0x504a18(0x15e)]('\x0a');}async[a150_0x13ef79(0x1bb)](_0x33dd2f,_0x46aef1){const _0x14d8f8=a150_0x13ef79,_0x157962=await this['client'][_0x14d8f8(0x17c)](_0x33dd2f,_0x46aef1);return _0x157962?.[_0x14d8f8(0x164)]??_0x14d8f8(0x1c7);}async[a150_0x13ef79(0x1b3)](_0x570f86,_0x4fa157){const _0x2e85de=a150_0x13ef79,_0x4a3084=await this['client'][_0x2e85de(0x1b3)](_0x570f86,{'from_task':_0x4fa157?.['fromTask'],'retry_params':_0x4fa157?.[_0x2e85de(0x16e)]});return{'attemptId':_0x4a3084['id'],'sessionId':_0x4a3084[_0x2e85de(0x1d6)]};}async[a150_0x13ef79(0x193)](_0x42a95d,_0x4af70d){const _0x4006a6=a150_0x13ef79,_0x26095b=await this[_0x4006a6(0x1bc)][_0x4006a6(0x193)](_0x42a95d,{'resume_from':_0x4af70d?.[_0x4006a6(0x1c8)],'retry_params':_0x4af70d?.['retryParams'],'force':_0x4af70d?.[_0x4006a6(0x1cb)]});return{'attemptId':_0x26095b['id'],'sessionId':_0x26095b['sessionId']};}async[a150_0x13ef79(0x198)](_0x5aa069,_0x383f83={},_0x53ce8c){const _0xfbd9e6=a150_0x13ef79,_0x58bfed=_0x5aa069[_0xfbd9e6(0x17d)]('.');let _0x5369bc,_0x42b202;if(_0x58bfed===-0x1)throw new Error('Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format');_0x5369bc=_0x5aa069[_0xfbd9e6(0x16a)](0x0,_0x58bfed),_0x42b202=_0x5aa069[_0xfbd9e6(0x16a)](_0x58bfed+0x1);if(!_0x5369bc||!_0x42b202)throw new Error(_0xfbd9e6(0x1d2)+_0x5aa069+_0xfbd9e6(0x185));const _0x227ec3=_0x53ce8c?.[_0xfbd9e6(0x1a1)]||new Date()[_0xfbd9e6(0x167)]();return await this[_0xfbd9e6(0x1bc)][_0xfbd9e6(0x1bf)]({'projectName':_0x5369bc,'workflowName':_0x42b202,'sessionTime':_0x227ec3,'params':_0x383f83});}async['download'](_0x112386,_0x4d12e9,_0x7e66c4){const _0x30d17e=a150_0x13ef79,{promises:_0x3b62e7}=await import('fs'),_0x1bc83c=await import(_0x30d17e(0x19f)),_0x5b2ce7=await import('os'),_0x4ec361=await import(_0x30d17e(0x184)),{id:_0x2d1e6b,name:_0x5ae499}=await this['resolveProjectId'](_0x112386),_0x5a15a4=_0x5b2ce7[_0x30d17e(0x1b1)](),_0x44885d=_0x1bc83c[_0x30d17e(0x15e)](_0x5a15a4,_0x30d17e(0x19e)+_0x2d1e6b+'-'+Date[_0x30d17e(0x170)]()+_0x30d17e(0x171));try{await this['client'][_0x30d17e(0x16f)](_0x2d1e6b,_0x44885d,_0x7e66c4?.[_0x30d17e(0x1b2)]);const _0x27d034=_0x1bc83c[_0x30d17e(0x15e)](_0x4d12e9,_0x5ae499);await _0x3b62e7[_0x30d17e(0x1a6)](_0x27d034,{'recursive':!![]}),await _0x4ec361[_0x30d17e(0x1d5)]({'file':_0x44885d,'cwd':_0x27d034,'gzip':!![]});const _0x3c0283=async _0x3e2e30=>{const _0x756836=_0x30d17e;let _0x106572=0x0;const _0x557ce1=await _0x3b62e7[_0x756836(0x16b)](_0x3e2e30,{'withFileTypes':!![]});for(const _0x4c0d47 of _0x557ce1){const _0x36a260=_0x1bc83c[_0x756836(0x15e)](_0x3e2e30,_0x4c0d47[_0x756836(0x1c9)]);if(_0x4c0d47[_0x756836(0x197)]())_0x106572++;else _0x4c0d47[_0x756836(0x174)]()&&(_0x106572+=await _0x3c0283(_0x36a260));}return _0x106572;},_0x5e58ca=await _0x3c0283(_0x27d034);return{'projectName':_0x5ae499,'revision':_0x7e66c4?.[_0x30d17e(0x1b2)]||_0x30d17e(0x1ae),'filesExtracted':_0x5e58ca};}finally{try{await _0x3b62e7[_0x30d17e(0x1ab)](_0x44885d);}catch{}}}async[a150_0x13ef79(0x1d7)](_0xc94d58,_0x5af5af){const _0x4d5df0=a150_0x13ef79,{promises:_0x1ed326}=await import('fs'),_0x26a468=await import(_0x4d5df0(0x19f)),_0x57cf5f=await import(_0x4d5df0(0x184)),_0x33013e=_0x5af5af?.['projectName']||_0x26a468['basename'](_0xc94d58),_0x212d25=_0x5af5af?.[_0x4d5df0(0x1b2)]||new Date()[_0x4d5df0(0x167)]()['replace'](/[:.]/g,'-');try{await _0x1ed326[_0x4d5df0(0x1e0)](_0xc94d58);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0xc94d58);}if(!_0x5af5af?.[_0x4d5df0(0x18d)]){const _0x1a54fd=await _0x1ed326[_0x4d5df0(0x16b)](_0xc94d58),_0x2cdc80=_0x1a54fd[_0x4d5df0(0x19b)](_0x51851f=>_0x51851f[_0x4d5df0(0x1a7)](WORKFLOW_FILE_EXTENSION));if(_0x2cdc80['length']===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+_0x4d5df0(0x18e));for(const _0x1d7369 of _0x2cdc80){const _0x1ac686=_0x26a468[_0x4d5df0(0x15e)](_0xc94d58,_0x1d7369);try{await _0x1ed326['access'](_0x1ac686);}catch{throw new Error(_0x4d5df0(0x1b9)+_0x1d7369);}}}const _0x266003=async(_0x54cef1,_0x3d5352='')=>{const _0x2a583b=_0x4d5df0,_0x31870f=await _0x1ed326[_0x2a583b(0x16b)](_0x54cef1,{'withFileTypes':!![]}),_0x46f932=[];for(const _0x276e6d of _0x31870f){const _0x1f69bf=_0x26a468[_0x2a583b(0x15e)](_0x3d5352,_0x276e6d[_0x2a583b(0x1c9)]),_0x181be2=_0x26a468[_0x2a583b(0x15e)](_0x54cef1,_0x276e6d[_0x2a583b(0x1c9)]);if(!shouldIncludeInArchive(_0x276e6d['name']))continue;_0x276e6d[_0x2a583b(0x174)]()?_0x46f932['push'](...await _0x266003(_0x181be2,_0x1f69bf)):_0x46f932['push'](_0x1f69bf);}return _0x46f932;},_0x142657=await _0x266003(_0xc94d58),_0xfc8d7=await import('os'),_0x173ca9=_0xfc8d7['tmpdir'](),_0x3a917d=_0x26a468[_0x4d5df0(0x15e)](_0x173ca9,_0x4d5df0(0x165)+Date[_0x4d5df0(0x170)]()+_0x4d5df0(0x171));try{await _0x57cf5f[_0x4d5df0(0x199)]({'file':_0x3a917d,'gzip':!![],'cwd':_0xc94d58,'portable':!![]},_0x142657);const _0x1e878e=await this[_0x4d5df0(0x1bc)][_0x4d5df0(0x161)](_0x33013e,_0x212d25,_0x3a917d,{'scheduleFrom':_0x5af5af?.['scheduleFrom'],'clearSchedule':_0x5af5af?.[_0x4d5df0(0x1aa)],'clearScheduleAll':_0x5af5af?.[_0x4d5df0(0x189)]});return{'projectId':_0x1e878e['id'],'projectName':_0x1e878e[_0x4d5df0(0x1c9)],'revision':_0x1e878e[_0x4d5df0(0x1b2)]};}finally{try{await _0x1ed326['unlink'](_0x3a917d);}catch{}}}async[a150_0x13ef79(0x162)](_0x43bfdf){const _0x41c7d7=a150_0x13ef79,{id:_0x1e63ed}=await this[_0x41c7d7(0x1a0)](_0x43bfdf),_0x4c3ad1=await this[_0x41c7d7(0x1bc)][_0x41c7d7(0x18b)](_0x1e63ed);return{'projectId':_0x4c3ad1['id'],'projectName':_0x4c3ad1[_0x41c7d7(0x1c9)]};}async[a150_0x13ef79(0x1dd)](_0x1d420d){const _0x38aa4a=a150_0x13ef79,{id:_0x1ac77d,name:_0x2fbd98}=await this[_0x38aa4a(0x1a0)](_0x1d420d),_0x4f2eeb=await this[_0x38aa4a(0x1bc)][_0x38aa4a(0x1dd)](_0x1ac77d);return{'projectName':_0x2fbd98,'secrets':_0x4f2eeb};}async['setSecret'](_0xbb037c,_0x4c1f15,_0x1c1ab4){const _0x33300f=a150_0x13ef79,{id:_0x167b21,name:_0x29a27f}=await this[_0x33300f(0x1a0)](_0xbb037c);return await this['client'][_0x33300f(0x1be)](_0x167b21,_0x4c1f15,_0x1c1ab4),{'projectName':_0x29a27f,'key':_0x4c1f15};}async['deleteSecret'](_0x98710e,_0x14c30f){const _0x4864f9=a150_0x13ef79,{id:_0x236f76,name:_0x1c41de}=await this[_0x4864f9(0x1a0)](_0x98710e);return await this[_0x4864f9(0x1bc)][_0x4864f9(0x166)](_0x236f76,_0x14c30f),{'projectName':_0x1c41de,'key':_0x14c30f};}async['pullProject'](_0xde1145,_0x281b3a){const _0x5b0b22=a150_0x13ef79;return pullWorkflow({'client':this[_0x5b0b22(0x1bc)],'resolveProjectId':this['resolveProjectId'][_0x5b0b22(0x1b7)](this)},_0xde1145,_0x281b3a);}async[a150_0x13ef79(0x19a)](_0x379fc6,_0xfe0eb5){const _0x2e61f2=a150_0x13ef79;return applyPullResult({'client':this[_0x2e61f2(0x1bc)],'resolveProjectId':this[_0x2e61f2(0x1a0)][_0x2e61f2(0x1b7)](this)},_0x379fc6,_0xfe0eb5);}async['preparePushProject'](_0x47c8be){const _0x283b31=a150_0x13ef79;return preparePushWorkflow({'client':this[_0x283b31(0x1bc)],'resolveProjectId':this[_0x283b31(0x1a0)][_0x283b31(0x1b7)](this)},_0x47c8be);}async['executePushProject'](_0x1ff68a){const _0x397fbf=a150_0x13ef79;return executePushWorkflow({'client':this[_0x397fbf(0x1bc)],'resolveProjectId':this['resolveProjectId'][_0x397fbf(0x1b7)](this)},_0x1ff68a);}async[a150_0x13ef79(0x160)](_0x1b22a8,_0x4e8b1e,_0x6f03d9){const _0x5662ad=a150_0x13ef79;return prepareCloneWorkflow({'client':this[_0x5662ad(0x1bc)]},_0x1b22a8,_0x4e8b1e,_0x6f03d9);}async[a150_0x13ef79(0x1b8)](_0xcfcfd4){const _0x3121df=a150_0x13ef79;return executeCloneWorkflow({'client':this[_0x3121df(0x1bc)]},_0xcfcfd4);}}function a150_0x3a8b(){const _0x1b27e0=['retryAttemptName','setSecret','startAttempt','startedAt','exportParams','WORKFLOW_PROJECT_NOT_FOUND','createdAt','config','workflowName','890mrBBJf','Kill\x20request\x20accepted','resumeFrom','name','done','force','finishedAt','22959tGjlHg','4060835ykObPV','listSessions','NUMERIC_ID_PATTERN','listLogFiles','Invalid\x20workflow\x20format:\x20','find','parentId','extract','sessionId','push','lastAttempt','params','fullName','8sdUjEw','fromTime','listSecrets','toTime','zlib','access','listWorkflows','getAttemptTasks','join','1555141WLxfuG','prepareCloneProject','uploadProjectArchive','delete','slice','message','tdx-workflow-push-','deleteSecret','toISOString','540561sdRNAn','updatedAt','substring','readdir','success','getProject','retryParams','downloadProjectArchive','now','.tar.gz','cancelRequested','includeRetried','isDirectory','tasks','map','length','upstreams','error','106902yrkUAA','toString','killAttempt','indexOf','project','attempts','workflow','Project\x20not\x20found:\x20','utf-8','getAttempt','tar','.\x20Expected\x20\x22project.workflow\x22','listAttempts','sessionUuid','storeParams','clearScheduleAll','util','deleteProject','projects','skipValidation','\x20workflow\x20files\x20found\x20in\x20project\x20directory','direct','listProjects','logFiles','rawCount','retryAttempt','stateParams','logs','gunzip','isFile','run','create','applyPullProject','filter','lastId','retryAt','tdx-workflow-','path','resolveProjectId','sessionTime','3665988eMKEFT','workflows','Failed\x20to\x20download\x20log\x20file:\x20','data','mkdir','endsWith','arrayBuffer','limit','clearSchedule','unlink','isGroup','8VlTTdW','latest','last_id','projectName','tmpdir','revision','retrySession','timezone','from','1221816fPTOku','bind','executeCloneProject','Cannot\x20read\x20workflow\x20file:\x20','index','kill','client'];a150_0x3a8b=function(){return _0x1b27e0;};return a150_0x3a8b();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x247b48,_0x118fbc){const _0x473c7a=a151_0x33c4,_0x155ae5=_0x247b48();while(!![]){try{const _0x3d1b86=parseInt(_0x473c7a(0xcb))/0x1+parseInt(_0x473c7a(0xe7))/0x2+-parseInt(_0x473c7a(0xe2))/0x3*(-parseInt(_0x473c7a(0xcd))/0x4)+-parseInt(_0x473c7a(0xc1))/0x5+-parseInt(_0x473c7a(0xcc))/0x6+-parseInt(_0x473c7a(0xf1))/0x7*(-parseInt(_0x473c7a(0xeb))/0x8)+parseInt(_0x473c7a(0xe0))/0x9;if(_0x3d1b86===_0x118fbc)break;else _0x155ae5['push'](_0x155ae5['shift']());}catch(_0x377485){_0x155ae5['push'](_0x155ae5['shift']());}}}(a151_0x81ed,0x55593));import{existsSync,promises as a151_0x4a8558}from'fs';import a151_0x11a663 from'path';import a151_0x3ad8bc 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(_0x2e22d6,_0x5a496c,_0x3ebbf3={}){const _0x19a468=a151_0x33c4,_0xeae7cb=await import(_0x19a468(0xc5)),{client:_0x281ac8,resolveProjectId:_0x5c6a8e}=_0x2e22d6,{id:_0x25346b,name:_0x4eb772}=await _0x5c6a8e(_0x5a496c),_0xddd037=_0x3ebbf3[_0x19a468(0xec)]||process[_0x19a468(0xdc)](),_0x15179a=_0x3ebbf3[_0x19a468(0xe5)]||getWorkflowProjectDir(_0x4eb772,_0xddd037),_0x39c6a3=a151_0x11a663['join'](_0x15179a,_0x19a468(0xcf)),_0x2c7c0e=!existsSync(_0x39c6a3),_0xd8f12a=await a151_0x4a8558[_0x19a468(0xe6)](a151_0x11a663['join'](a151_0x3ad8bc[_0x19a468(0xda)](),'tdx-wf-pull-')),_0x29e00f=a151_0x11a663['join'](_0xd8f12a,_0x19a468(0xc9)),_0x1ffb9b=a151_0x11a663[_0x19a468(0xdd)](_0xd8f12a,_0x19a468(0xc7));try{await _0x281ac8[_0x19a468(0xd6)](_0x25346b,_0x29e00f,_0x3ebbf3[_0x19a468(0xef)]),await a151_0x4a8558[_0x19a468(0xdf)](_0x1ffb9b,{'recursive':!![]});try{await _0xeae7cb['extract']({'file':_0x29e00f,'cwd':_0x1ffb9b,'gzip':!![]});}catch(_0x5bca29){const _0x8e1027=_0x5bca29 instanceof Error?_0x5bca29[_0x19a468(0xce)]:String(_0x5bca29);if(_0x8e1027['includes']('TAR_BAD_ARCHIVE')||_0x8e1027[_0x19a468(0xee)](_0x19a468(0xe4)))throw new SDKError(ErrorCode[_0x19a468(0xe9)],'Failed\x20to\x20extract\x20project\x20archive:\x20The\x20archive\x20may\x20be\x20corrupted\x20on\x20the\x20server.',_0x5bca29,{'helpText':_0x19a468(0xc8)});throw _0x5bca29;}const _0x1a0de2=await _0x281ac8[_0x19a468(0xe3)](_0x25346b),_0xd8fa31=_0x3ebbf3[_0x19a468(0xef)]||_0x1a0de2[_0x19a468(0xef)]||_0x19a468(0xca),_0x3a4eb0=await calculateChanges(_0x15179a,_0x1ffb9b,_0x2c7c0e),_0x10bfc7={'new':_0x3a4eb0[_0x19a468(0xd0)](_0x1fcf80=>_0x1fcf80[_0x19a468(0xd2)]===_0x19a468(0xde))[_0x19a468(0xed)],'modified':_0x3a4eb0['filter'](_0x371876=>_0x371876['type']===_0x19a468(0xe8))[_0x19a468(0xed)],'deleted':_0x3a4eb0['filter'](_0x1eb14a=>_0x1eb14a[_0x19a468(0xd2)]===_0x19a468(0xbf))[_0x19a468(0xed)],'unchanged':_0x3a4eb0['filter'](_0x595c13=>_0x595c13[_0x19a468(0xd2)]===_0x19a468(0xd1))[_0x19a468(0xed)]};return{'projectName':_0x4eb772,'projectId':_0x25346b,'revision':_0xd8fa31,'targetDir':_0x15179a,'changes':_0x3a4eb0,'summary':_0x10bfc7,'hasChanges':_0x10bfc7[_0x19a468(0xde)]>0x0||_0x10bfc7[_0x19a468(0xe8)]>0x0||_0x10bfc7[_0x19a468(0xbf)]>0x0,'isNewProject':_0x2c7c0e};}finally{await a151_0x4a8558['rm'](_0xd8f12a,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0x376cd0,_0x5d074c,_0x4a7ae1={}){const _0x230f7b=a151_0x33c4,_0x10039e=await import(_0x230f7b(0xc5)),{client:_0x79b81a}=_0x376cd0,_0x46d848=await a151_0x4a8558[_0x230f7b(0xe6)](a151_0x11a663[_0x230f7b(0xdd)](a151_0x3ad8bc[_0x230f7b(0xda)](),_0x230f7b(0xe1))),_0x205a09=a151_0x11a663[_0x230f7b(0xdd)](_0x46d848,_0x230f7b(0xc9));try{await _0x79b81a[_0x230f7b(0xd6)](_0x5d074c[_0x230f7b(0xf0)],_0x205a09,_0x4a7ae1[_0x230f7b(0xef)]),await a151_0x4a8558[_0x230f7b(0xdf)](_0x5d074c['targetDir'],{'recursive':!![]});for(const _0x4c32ac of _0x5d074c['changes']){if(_0x4c32ac['type']==='deleted'){const _0x20dd97=a151_0x11a663[_0x230f7b(0xdd)](_0x5d074c[_0x230f7b(0xe5)],_0x4c32ac[_0x230f7b(0xdb)]);await a151_0x4a8558['unlink'](_0x20dd97)['catch'](()=>{});}}try{await _0x10039e[_0x230f7b(0xc6)]({'file':_0x205a09,'cwd':_0x5d074c[_0x230f7b(0xe5)],'gzip':!![]});}catch(_0x128250){const _0x12d6f1=_0x128250 instanceof Error?_0x128250[_0x230f7b(0xce)]:String(_0x128250);if(_0x12d6f1[_0x230f7b(0xee)](_0x230f7b(0xd8))||_0x12d6f1[_0x230f7b(0xee)]('zlib'))throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x230f7b(0xd4),_0x128250,{'helpText':_0x230f7b(0xc8)});throw _0x128250;}const _0x4d2611=a151_0x11a663['join'](_0x5d074c[_0x230f7b(0xe5)],_0x230f7b(0xcf));if(_0x5d074c[_0x230f7b(0xd9)]){const _0x419c21=createWorkflowTdxConfigContent(_0x5d074c[_0x230f7b(0xd5)],_0x5d074c['projectId'],_0x5d074c[_0x230f7b(0xef)]);await a151_0x4a8558['writeFile'](_0x4d2611,_0x419c21,_0x230f7b(0xc0));}else updateWorkflowTdxConfig(_0x4d2611,{'last_pulled_revision':_0x5d074c['revision'],'last_pulled_at':new Date()['toISOString']()});}finally{await a151_0x4a8558['rm'](_0x46d848,{'recursive':!![],'force':!![]});}}function a151_0x81ed(){const _0x4b70b1=['includes','revision','projectId','56lWJisJ','catch','deleted','utf-8','2691380FsaMBs','readdir','has','name','tar','extract','extracted','Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support\x20if\x20the\x20issue\x20persists.','archive.tar.gz','latest','253976IqHvKY','3889752JJhylD','530000PIZPWa','message','tdx.json','filter','unchanged','type','push','Failed\x20to\x20extract\x20project\x20archive:\x20The\x20archive\x20may\x20be\x20corrupted\x20on\x20the\x20server.','projectName','downloadProjectArchive','sort','TAR_BAD_ARCHIVE','isNewProject','tmpdir','path','cwd','join','new','mkdir','5110317Cdtfvm','tdx-wf-apply-','3xYlrZr','getProject','zlib','targetDir','mkdtemp','834132SggEQh','modified','WORKFLOW_ARCHIVE_CORRUPTED','readFile','164800mnZFIH','baseDir','length'];a151_0x81ed=function(){return _0x4b70b1;};return a151_0x81ed();}function a151_0x33c4(_0x3637e4,_0x5a6806){_0x3637e4=_0x3637e4-0xbe;const _0x81eda6=a151_0x81ed();let _0x33c48d=_0x81eda6[_0x3637e4];return _0x33c48d;}async function calculateChanges(_0x5e7f70,_0x41a730,_0x33d00e){const _0x26fefc=a151_0x33c4,_0x10e593=[],_0x4b65c5=await getAllFiles(_0x41a730),_0x2d33b0=existsSync(_0x5e7f70)?await getAllFiles(_0x5e7f70):new Set();for(const _0x1bf452 of _0x4b65c5){const _0x224fc1=a151_0x11a663[_0x26fefc(0xdd)](_0x5e7f70,_0x1bf452),_0x41cd10=a151_0x11a663[_0x26fefc(0xdd)](_0x41a730,_0x1bf452);if(_0x1bf452===_0x26fefc(0xcf))continue;const _0x3e792d=await a151_0x4a8558[_0x26fefc(0xea)](_0x41cd10,_0x26fefc(0xc0))[_0x26fefc(0xbe)](()=>null);if(_0x3e792d===null)continue;if(!existsSync(_0x224fc1)||_0x33d00e)_0x10e593[_0x26fefc(0xd3)]({'path':_0x1bf452,'type':_0x26fefc(0xde),'newContent':_0x3e792d});else{const _0x4a97bd=await a151_0x4a8558['readFile'](_0x224fc1,'utf-8')[_0x26fefc(0xbe)](()=>null);if(_0x4a97bd===null)_0x10e593[_0x26fefc(0xd3)]({'path':_0x1bf452,'type':_0x26fefc(0xe8),'newContent':_0x3e792d});else{if(_0x4a97bd!==_0x3e792d){const _0x157a06=generateDiff(_0x4a97bd,_0x3e792d),_0x419650=hasChanges(_0x157a06)?formatDiffWithColors(_0x157a06):undefined;_0x10e593[_0x26fefc(0xd3)]({'path':_0x1bf452,'type':_0x26fefc(0xe8),'oldContent':_0x4a97bd,'newContent':_0x3e792d,'diff':_0x419650});}else _0x10e593[_0x26fefc(0xd3)]({'path':_0x1bf452,'type':'unchanged'});}}}if(!_0x33d00e)for(const _0xf422e3 of _0x2d33b0){if(_0xf422e3===_0x26fefc(0xcf))continue;if(!_0x4b65c5[_0x26fefc(0xc3)](_0xf422e3)){const _0x454dfc=a151_0x11a663[_0x26fefc(0xdd)](_0x5e7f70,_0xf422e3),_0x3230f0=await a151_0x4a8558[_0x26fefc(0xea)](_0x454dfc,_0x26fefc(0xc0))['catch'](()=>undefined);_0x10e593['push']({'path':_0xf422e3,'type':'deleted','oldContent':_0x3230f0});}}return _0x10e593[_0x26fefc(0xd7)]((_0x2a697a,_0x1fc205)=>_0x2a697a[_0x26fefc(0xdb)]['localeCompare'](_0x1fc205['path'])),_0x10e593;}async function getAllFiles(_0x38de04,_0xe50f94=''){const _0x79fb65=a151_0x33c4,_0x163db3=new Set();if(!existsSync(_0x38de04))return _0x163db3;const _0x3d871e=await a151_0x4a8558[_0x79fb65(0xc2)](_0x38de04,{'withFileTypes':!![]});for(const _0x4d915d of _0x3d871e){const _0x3f5562=_0xe50f94?a151_0x11a663['join'](_0xe50f94,_0x4d915d[_0x79fb65(0xc4)]):_0x4d915d[_0x79fb65(0xc4)];if(_0x4d915d['isDirectory']()){const _0x7c3495=await getAllFiles(a151_0x11a663[_0x79fb65(0xdd)](_0x38de04,_0x4d915d['name']),_0x3f5562);for(const _0x196057 of _0x7c3495){_0x163db3['add'](_0x196057);}}else _0x163db3['add'](_0x3f5562);}return _0x163db3;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5a44ed,_0x469573){const _0x1931c8=a152_0x3888,_0x4ccbcc=_0x5a44ed();while(!![]){try{const _0x432937=parseInt(_0x1931c8(0x194))/0x1*(-parseInt(_0x1931c8(0x197))/0x2)+parseInt(_0x1931c8(0x17f))/0x3*(parseInt(_0x1931c8(0x18c))/0x4)+-parseInt(_0x1931c8(0x182))/0x5+parseInt(_0x1931c8(0x189))/0x6+parseInt(_0x1931c8(0x19d))/0x7*(parseInt(_0x1931c8(0x18d))/0x8)+parseInt(_0x1931c8(0x174))/0x9*(parseInt(_0x1931c8(0x176))/0xa)+-parseInt(_0x1931c8(0x192))/0xb;if(_0x432937===_0x469573)break;else _0x4ccbcc['push'](_0x4ccbcc['shift']());}catch(_0x2b0c6e){_0x4ccbcc['push'](_0x4ccbcc['shift']());}}}(a152_0x5f29,0x74812));import{promises as a152_0x495f90}from'fs';function a152_0x5f29(){const _0x4e915c=['readFile','includes','replace','2340036WFFOMR','localeCompare','path','80EmqmbS','8vDusls','configResult','tar','configPath','downloadProjectArchive','1074491nnwbrm','tmpdir','5RIXLCg','uploadProjectArchive','sourceDir','278128NooxZv','new','catch','TAR_BAD_ARCHIVE','workflow_project','Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison.\x20The\x20archive\x20may\x20be\x20corrupted\x20on\x20the\x20server.','1253749MiCCIr','extract','message','sort','deleted','type','WORKFLOW_ARCHIVE_CORRUPTED','isDirectory','filter','tdx.json','mkdtemp','unchanged','cwd','add','name','skipValidation','archive.tar.gz','posix','13851DuCpCF','toISOString','5690lIQLVf','mkdir','tdx-wf-push-','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','revision','join','push','utf-8','has','44367IDHwXJ','modified','readdir','2351905lwfstU','length','zlib','projectName'];a152_0x5f29=function(){return _0x4e915c;};return a152_0x5f29();}import a152_0x4b9858 from'path';import a152_0x122c94 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(_0x57603c,_0x5e3145={}){const _0x5976ca=a152_0x3888,_0x185702=await import(_0x5976ca(0x18f)),{client:_0x3b6344,resolveProjectId:_0x2ba197}=_0x57603c,_0x52f182=_0x5e3145[_0x5976ca(0x196)]||process[_0x5976ca(0x16e)](),_0x2c2448=findWorkflowTdxConfig(_0x52f182),{config:_0xa876cc,configDir:_0x319cea}=_0x2c2448;let _0x529903,_0x465bb0=_0xa876cc[_0x5976ca(0x19b)];try{const _0xb77f1b=await _0x2ba197(_0xa876cc[_0x5976ca(0x19b)]);_0x529903=_0xb77f1b['id'],_0x465bb0=_0xb77f1b['name'];}catch{_0x529903='';}const _0x2ea238=_0x5e3145[_0x5976ca(0x17a)]||new Date()['toISOString']()[_0x5976ca(0x188)](/[:.]/g,'-');if(!_0x5e3145[_0x5976ca(0x171)]){const _0x468fcf=await a152_0x495f90[_0x5976ca(0x181)](_0x319cea),_0x74c704=_0x468fcf[_0x5976ca(0x16a)](_0x54f7a2=>_0x54f7a2['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x74c704[_0x5976ca(0x183)]===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20'+_0x319cea);}const _0x2a7312=await getProjectFiles(_0x319cea);let _0x1837a7;if(_0x529903){const _0x53af95=await a152_0x495f90[_0x5976ca(0x16c)](a152_0x4b9858[_0x5976ca(0x17b)](a152_0x122c94[_0x5976ca(0x193)](),_0x5976ca(0x178))),_0x4871ef=a152_0x4b9858[_0x5976ca(0x17b)](_0x53af95,_0x5976ca(0x172)),_0xcc3e1f=a152_0x4b9858['join'](_0x53af95,'extracted');try{await _0x3b6344[_0x5976ca(0x191)](_0x529903,_0x4871ef),await a152_0x495f90[_0x5976ca(0x177)](_0xcc3e1f,{'recursive':!![]});try{await _0x185702[_0x5976ca(0x19e)]({'file':_0x4871ef,'cwd':_0xcc3e1f,'gzip':!![]});}catch(_0x440997){const _0x59a309=_0x440997 instanceof Error?_0x440997[_0x5976ca(0x19f)]:String(_0x440997);if(_0x59a309[_0x5976ca(0x187)](_0x5976ca(0x19a))||_0x59a309[_0x5976ca(0x187)](_0x5976ca(0x184)))throw new SDKError(ErrorCode[_0x5976ca(0x168)],_0x5976ca(0x19c),_0x440997,{'helpText':_0x5976ca(0x179)});throw _0x440997;}_0x1837a7=await calculatePushChanges(_0x319cea,_0xcc3e1f,_0x2a7312);}finally{await a152_0x495f90['rm'](_0x53af95,{'recursive':!![],'force':!![]});}}else{_0x1837a7=[];for(const _0xd7c1c6 of _0x2a7312){const _0x4159b6=a152_0x4b9858[_0x5976ca(0x17b)](_0x319cea,_0xd7c1c6),_0x4371ec=await a152_0x495f90[_0x5976ca(0x186)](_0x4159b6,_0x5976ca(0x17d))[_0x5976ca(0x199)](()=>null);_0x1837a7[_0x5976ca(0x17c)]({'path':_0xd7c1c6,'type':_0x5976ca(0x198),'newContent':_0x4371ec||undefined});}}const _0x24a478={'new':_0x1837a7['filter'](_0x3f867c=>_0x3f867c['type']==='new')[_0x5976ca(0x183)],'modified':_0x1837a7[_0x5976ca(0x16a)](_0x1178c8=>_0x1178c8[_0x5976ca(0x167)]===_0x5976ca(0x180))['length'],'deleted':_0x1837a7['filter'](_0x77c379=>_0x77c379[_0x5976ca(0x167)]==='deleted')[_0x5976ca(0x183)],'unchanged':_0x1837a7['filter'](_0x4287cd=>_0x4287cd[_0x5976ca(0x167)]==='unchanged')[_0x5976ca(0x183)]};return{'projectName':_0x465bb0,'projectId':_0x529903,'revision':_0x2ea238,'sourceDir':_0x319cea,'changes':_0x1837a7,'summary':_0x24a478,'hasChanges':_0x24a478[_0x5976ca(0x198)]>0x0||_0x24a478[_0x5976ca(0x180)]>0x0||_0x24a478[_0x5976ca(0x1a1)]>0x0,'configResult':_0x2c2448};}export async function executePushWorkflow(_0x280d36,_0x50ed29){const _0x19c1dd=a152_0x3888,_0x135d18=await import(_0x19c1dd(0x18f)),{client:_0x288a79}=_0x280d36,_0x31c2d8=await getProjectFiles(_0x50ed29['sourceDir']),_0x289ffa=await a152_0x495f90['mkdtemp'](a152_0x4b9858[_0x19c1dd(0x17b)](a152_0x122c94['tmpdir'](),'tdx-wf-push-archive-')),_0x50525b=a152_0x4b9858[_0x19c1dd(0x17b)](_0x289ffa,_0x19c1dd(0x172));try{await _0x135d18['create']({'file':_0x50525b,'gzip':!![],'cwd':_0x50ed29[_0x19c1dd(0x196)],'portable':!![]},_0x31c2d8);const _0x26518f=await _0x288a79[_0x19c1dd(0x195)](_0x50ed29[_0x19c1dd(0x185)],_0x50ed29[_0x19c1dd(0x17a)],_0x50525b);return updateWorkflowTdxConfig(_0x50ed29[_0x19c1dd(0x18e)][_0x19c1dd(0x190)],{'workflow_project_id':_0x26518f['id'],'last_pushed_revision':_0x26518f[_0x19c1dd(0x17a)],'last_pushed_at':new Date()[_0x19c1dd(0x175)]()}),{'projectId':_0x26518f['id'],'projectName':_0x26518f[_0x19c1dd(0x170)],'revision':_0x26518f[_0x19c1dd(0x17a)]};}finally{await a152_0x495f90['rm'](_0x289ffa,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x1f106e,_0x29c5f1=_0x1f106e,_0x2284f6='',_0x4f42ac=null){const _0x18f04d=a152_0x3888,_0x431158=[];if(_0x4f42ac===null){_0x4f42ac=createIgnoreInstance();const _0x577fff=await loadDigdagignore(_0x1f106e);_0x577fff&&_0x4f42ac[_0x18f04d(0x16f)](_0x577fff);}if(_0x2284f6!==''){const _0x520fc6=await loadDigdagignore(_0x29c5f1);_0x520fc6&&addScopedPatterns(_0x4f42ac,_0x520fc6,_0x2284f6);}const _0x389de5=await a152_0x495f90['readdir'](_0x29c5f1,{'withFileTypes':!![]});for(const _0x30e09c of _0x389de5){const _0x133688=_0x2284f6?a152_0x4b9858[_0x18f04d(0x173)]['join'](_0x2284f6,_0x30e09c[_0x18f04d(0x170)]):_0x30e09c['name'];if(_0x30e09c['name']===_0x18f04d(0x16b))continue;if(_0x30e09c[_0x18f04d(0x170)]==='.digdagignore')continue;if(!shouldIncludeInArchive(_0x30e09c[_0x18f04d(0x170)]))continue;if(shouldIgnoreWithInstance(_0x4f42ac,_0x133688,_0x30e09c['isDirectory']()))continue;if(_0x30e09c[_0x18f04d(0x169)]()){const _0x3b986e=await getProjectFiles(_0x1f106e,a152_0x4b9858[_0x18f04d(0x17b)](_0x29c5f1,_0x30e09c[_0x18f04d(0x170)]),_0x133688,_0x4f42ac);_0x431158[_0x18f04d(0x17c)](..._0x3b986e);}else _0x431158[_0x18f04d(0x17c)](_0x133688);}return _0x431158;}function a152_0x3888(_0x2875af,_0xca9b54){_0x2875af=_0x2875af-0x167;const _0x5f29ab=a152_0x5f29();let _0x388892=_0x5f29ab[_0x2875af];return _0x388892;}async function calculatePushChanges(_0x1f94b4,_0x44fe52,_0x3184f2){const _0x50655f=a152_0x3888,_0x5508f6=[],_0x1bc736=new Set(await getProjectFiles(_0x44fe52));for(const _0x21ea94 of _0x3184f2){const _0x2c2e6e=a152_0x4b9858[_0x50655f(0x17b)](_0x1f94b4,_0x21ea94),_0x3ff8c8=a152_0x4b9858[_0x50655f(0x17b)](_0x44fe52,_0x21ea94),_0x2cf4b0=await a152_0x495f90[_0x50655f(0x186)](_0x2c2e6e,'utf-8')[_0x50655f(0x199)](()=>null);if(_0x2cf4b0===null)continue;if(!_0x1bc736[_0x50655f(0x17e)](_0x21ea94))_0x5508f6[_0x50655f(0x17c)]({'path':_0x21ea94,'type':_0x50655f(0x198),'newContent':_0x2cf4b0});else{const _0x57c0cc=await a152_0x495f90[_0x50655f(0x186)](_0x3ff8c8,'utf-8')[_0x50655f(0x199)](()=>null);if(_0x57c0cc===null)_0x5508f6['push']({'path':_0x21ea94,'type':'modified','newContent':_0x2cf4b0});else{if(_0x57c0cc!==_0x2cf4b0){const _0xcbdbc4=generateDiff(_0x57c0cc,_0x2cf4b0),_0x59dc82=hasChanges(_0xcbdbc4)?formatDiffWithColors(_0xcbdbc4):undefined;_0x5508f6['push']({'path':_0x21ea94,'type':_0x50655f(0x180),'oldContent':_0x57c0cc,'newContent':_0x2cf4b0,'diff':_0x59dc82});}else _0x5508f6[_0x50655f(0x17c)]({'path':_0x21ea94,'type':_0x50655f(0x16d)});}}}for(const _0x54cf77 of _0x1bc736){if(!_0x3184f2['includes'](_0x54cf77)){const _0x389ae8=a152_0x4b9858['join'](_0x44fe52,_0x54cf77),_0xe46774=await a152_0x495f90[_0x50655f(0x186)](_0x389ae8,_0x50655f(0x17d))[_0x50655f(0x199)](()=>undefined);_0x5508f6['push']({'path':_0x54cf77,'type':_0x50655f(0x1a1),'oldContent':_0xe46774});}}return _0x5508f6[_0x50655f(0x1a0)]((_0x29a9fe,_0x3a29b5)=>_0x29a9fe[_0x50655f(0x18b)][_0x50655f(0x18a)](_0x3a29b5[_0x50655f(0x18b)])),_0x5508f6;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a153_0x7f40e=a153_0x5536;(function(_0x485988,_0x10dc2c){const _0xacf008=a153_0x5536,_0x243f6f=_0x485988();while(!![]){try{const _0x3496eb=-parseInt(_0xacf008(0x85))/0x1*(-parseInt(_0xacf008(0x84))/0x2)+-parseInt(_0xacf008(0x8b))/0x3*(parseInt(_0xacf008(0x99))/0x4)+-parseInt(_0xacf008(0x9f))/0x5*(parseInt(_0xacf008(0x83))/0x6)+parseInt(_0xacf008(0x8c))/0x7*(parseInt(_0xacf008(0x80))/0x8)+-parseInt(_0xacf008(0x94))/0x9*(-parseInt(_0xacf008(0x97))/0xa)+parseInt(_0xacf008(0x8d))/0xb+-parseInt(_0xacf008(0x9b))/0xc*(parseInt(_0xacf008(0x96))/0xd);if(_0x3496eb===_0x10dc2c)break;else _0x243f6f['push'](_0x243f6f['shift']());}catch(_0x393286){_0x243f6f['push'](_0x243f6f['shift']());}}}(a153_0x302a,0xf2c61));import{existsSync,readFileSync,writeFileSync}from'fs';function a153_0x302a(){const _0x40bab8=['string','stringify','10983WZVBNY','1099ZKQEGr','9230386OHfjzG','last_pulled_revision','toISOString','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field','workflow_project_id','utf-8','workflows','747sugeJl','tdx.json','13VSYQcL','224450YekWla','cwd','652IqouDj','dirname','43074492JamFcn','object','last_pushed_at','parse','15055ecDFKJ','last_pulled_at','root','workflow_project','100888xaCAeg','Invalid\x20tdx.json:\x20expected\x20object','last_pushed_revision','294ThBWpX','1292472DCYEVw','1VDhFvU','join','No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Invalid\x20JSON\x20in\x20'];a153_0x302a=function(){return _0x40bab8;};return a153_0x302a();}import a153_0x3baa66 from'path';const TDX_CONFIG_FILE=a153_0x7f40e(0x95),WORKFLOWS_DIR=a153_0x7f40e(0x93);export function findWorkflowTdxConfigPath(_0x43bf6f=process[a153_0x7f40e(0x98)]()){const _0xeaf46b=a153_0x7f40e;let _0x34a494=a153_0x3baa66['resolve'](_0x43bf6f);const _0x57b56d=a153_0x3baa66['parse'](_0x34a494)[_0xeaf46b(0x7e)];while(_0x34a494!==_0x57b56d){const _0x1fb519=a153_0x3baa66[_0xeaf46b(0x86)](_0x34a494,TDX_CONFIG_FILE);if(existsSync(_0x1fb519))try{const _0x344e92=readFileSync(_0x1fb519,_0xeaf46b(0x92)),_0x1e6392=JSON[_0xeaf46b(0x9e)](_0x344e92);if(_0x1e6392&&typeof _0x1e6392==='object'&&_0xeaf46b(0x7f)in _0x1e6392)return _0x1fb519;}catch{}_0x34a494=a153_0x3baa66[_0xeaf46b(0x9a)](_0x34a494);}return null;}function a153_0x5536(_0x31c70c,_0x1781f5){_0x31c70c=_0x31c70c-0x7e;const _0x302a88=a153_0x302a();let _0x553635=_0x302a88[_0x31c70c];return _0x553635;}export function loadWorkflowTdxConfig(_0x59c0dd){const _0x294831=a153_0x7f40e,_0x5d37f7=readFileSync(_0x59c0dd,_0x294831(0x92));let _0x594c92;try{_0x594c92=JSON['parse'](_0x5d37f7);}catch{throw new Error(_0x294831(0x88)+_0x59c0dd);}if(!_0x594c92||typeof _0x594c92!==_0x294831(0x9c))throw new Error(_0x294831(0x81));const _0x56b73d=_0x594c92;if(!_0x56b73d[_0x294831(0x7f)]||typeof _0x56b73d[_0x294831(0x7f)]!==_0x294831(0x89))throw new Error(_0x294831(0x90));return{'workflow_project':_0x56b73d['workflow_project'],'workflow_project_id':typeof _0x56b73d[_0x294831(0x91)]===_0x294831(0x89)?_0x56b73d['workflow_project_id']:undefined,'last_pulled_revision':typeof _0x56b73d[_0x294831(0x8e)]===_0x294831(0x89)?_0x56b73d['last_pulled_revision']:undefined,'last_pulled_at':typeof _0x56b73d[_0x294831(0xa0)]===_0x294831(0x89)?_0x56b73d[_0x294831(0xa0)]:undefined,'last_pushed_revision':typeof _0x56b73d[_0x294831(0x82)]===_0x294831(0x89)?_0x56b73d[_0x294831(0x82)]:undefined,'last_pushed_at':typeof _0x56b73d[_0x294831(0x9d)]==='string'?_0x56b73d[_0x294831(0x9d)]:undefined};}export function findWorkflowTdxConfig(_0x1a7181=process['cwd']()){const _0x330177=a153_0x7f40e,_0x1d224b=findWorkflowTdxConfigPath(_0x1a7181);if(!_0x1d224b)throw new Error(_0x330177(0x87));const _0x180ce3=loadWorkflowTdxConfig(_0x1d224b),_0x119974=a153_0x3baa66[_0x330177(0x9a)](_0x1d224b);return{'config':_0x180ce3,'configPath':_0x1d224b,'configDir':_0x119974};}export function tryFindWorkflowTdxConfig(_0x28ff57){try{return findWorkflowTdxConfig(_0x28ff57);}catch{return null;}}export function getWorkflowProjectDir(_0x4590cd,_0xb070ce=process[a153_0x7f40e(0x98)]()){const _0x42a464=a153_0x7f40e;return a153_0x3baa66[_0x42a464(0x86)](_0xb070ce,WORKFLOWS_DIR,_0x4590cd);}export function getWorkflowTdxConfigPath(_0x19fa8e,_0x221dbd=process['cwd']()){const _0x3119dc=a153_0x7f40e;return a153_0x3baa66[_0x3119dc(0x86)](getWorkflowProjectDir(_0x19fa8e,_0x221dbd),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x53257d,_0x5152cd,_0x2d1858){const _0x19d77e=a153_0x7f40e,_0x13d264={'workflow_project':_0x53257d,..._0x5152cd&&{'workflow_project_id':_0x5152cd},..._0x2d1858&&{'last_pulled_revision':_0x2d1858},'last_pulled_at':new Date()[_0x19d77e(0x8f)]()};return JSON['stringify'](_0x13d264,null,0x2)+'\x0a';}export function saveWorkflowTdxConfig(_0x3d6293,_0x3c9371){const _0x2b587a=a153_0x7f40e,_0x386b11=JSON[_0x2b587a(0x8a)](_0x3c9371,null,0x2)+'\x0a';writeFileSync(_0x3d6293,_0x386b11,_0x2b587a(0x92));}export function updateWorkflowTdxConfig(_0x19df51,_0x19d7fe){const _0x28a63c=loadWorkflowTdxConfig(_0x19df51),_0x20f4ba={..._0x28a63c,..._0x19d7fe};saveWorkflowTdxConfig(_0x19df51,_0x20f4ba);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x615d17,_0x4cdb9c){const _0x57115a=a154_0x2ea2,_0x3ec6aa=_0x615d17();while(!![]){try{const _0x4c005f=parseInt(_0x57115a(0x1f3))/0x1+parseInt(_0x57115a(0x1f0))/0x2*(-parseInt(_0x57115a(0x201))/0x3)+parseInt(_0x57115a(0x1fb))/0x4+-parseInt(_0x57115a(0x1f8))/0x5*(parseInt(_0x57115a(0x207))/0x6)+parseInt(_0x57115a(0x1fc))/0x7*(-parseInt(_0x57115a(0x200))/0x8)+parseInt(_0x57115a(0x1f1))/0x9+-parseInt(_0x57115a(0x1f5))/0xa;if(_0x4c005f===_0x4cdb9c)break;else _0x3ec6aa['push'](_0x3ec6aa['shift']());}catch(_0x4c4d55){_0x3ec6aa['push'](_0x3ec6aa['shift']());}}}(a154_0x25b1,0x99d03));import{promises as a154_0xd883ae}from'fs';import a154_0x32aa6a from'path';import a154_0x3bcc61 from'ignore';function a154_0x25b1(){const _0x1fab4f=['endsWith','startsWith','.digdagignore','.digdag','142458FxwUWl','join','Thumbs.db','utf-8','25154WDqGrL','10297557DpOeij','slice','668571rqrtCQ','split','2035560BclMkq','readFile','code','115JNZfaZ','map','filter','53872sRIDQl','231140kQAiAe','trim','replace','ignores','96heyoMI','12mnNrYn','add'];a154_0x25b1=function(){return _0x1fab4f;};return a154_0x25b1();}export const WORKFLOW_FILE_EXTENSION='.dig';export function shouldIncludeInArchive(_0xabaa7b){const _0x460f5e=a154_0x2ea2;if(_0xabaa7b===_0x460f5e(0x206))return!![];if(_0xabaa7b[_0x460f5e(0x204)]('.'))return![];if(_0xabaa7b[_0x460f5e(0x203)]('~'))return![];if(_0xabaa7b===_0x460f5e(0x209)||_0xabaa7b==='.DS_Store')return![];return!![];}export function parseDigdagignore(_0x5c597d){const _0xc93139=a154_0x2ea2;return _0x5c597d[_0xc93139(0x1f4)]('\x0a')[_0xc93139(0x1f9)](_0xf82235=>_0xf82235[_0xc93139(0x1fd)]())[_0xc93139(0x1fa)](_0x6472a8=>_0x6472a8['length']>0x0&&!_0x6472a8[_0xc93139(0x204)]('#'));}export async function loadDigdagignore(_0x32cc3d){const _0x4e0e22=a154_0x2ea2,_0x38d008=a154_0x32aa6a[_0x4e0e22(0x208)](_0x32cc3d,_0x4e0e22(0x205));try{const _0x3cd2ee=await a154_0xd883ae[_0x4e0e22(0x1f6)](_0x38d008,_0x4e0e22(0x20a));return parseDigdagignore(_0x3cd2ee);}catch(_0x39f777){if(_0x39f777[_0x4e0e22(0x1f7)]==='ENOENT')return null;throw _0x39f777;}}function a154_0x2ea2(_0x254a3e,_0x58967a){_0x254a3e=_0x254a3e-0x1f0;const _0x25b1e2=a154_0x25b1();let _0x2ea292=_0x25b1e2[_0x254a3e];return _0x2ea292;}export function createIgnoreInstance(_0x426558){const _0x31d6b3=a154_0x2ea2,_0x1a8c10=a154_0x3bcc61();return _0x426558&&_0x426558['length']>0x0&&_0x1a8c10[_0x31d6b3(0x202)](_0x426558),_0x1a8c10;}export function addScopedPatterns(_0x74938a,_0x12760d,_0x2452a2){const _0x5dffd9=a154_0x2ea2,_0x46fe6e=_0x12760d[_0x5dffd9(0x1f9)](_0xbb23dd=>{const _0x271bb2=_0x5dffd9;if(_0xbb23dd[_0x271bb2(0x204)]('!')){const _0x5c25ed=_0xbb23dd[_0x271bb2(0x1f2)](0x1);if(_0x5c25ed[_0x271bb2(0x204)]('/'))return'!'+_0x2452a2+_0x5c25ed;return'!'+_0x2452a2+'/'+_0x5c25ed;}if(_0xbb23dd[_0x271bb2(0x204)]('/'))return''+_0x2452a2+_0xbb23dd;return _0x2452a2+'/'+_0xbb23dd;});return _0x74938a['add'](_0x46fe6e),_0x74938a;}export function shouldIgnoreWithInstance(_0x132468,_0x161d76,_0x5862d8){const _0x5db8f7=a154_0x2ea2,_0x4791bd=_0x161d76[_0x5db8f7(0x1fe)](/\\/g,'/'),_0x44bd62=_0x5862d8?_0x4791bd+'/':_0x4791bd;return _0x132468[_0x5db8f7(0x1ff)](_0x44bd62);}
|
package/dist/utils/async.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a155_0x2566(_0xf3cf50,_0x364887){_0xf3cf50=_0xf3cf50-0x1a5;const _0x2d1a94=a155_0x2d1a();let _0x25660a=_0x2d1a94[_0xf3cf50];return _0x25660a;}(function(_0x23efb7,_0x4e807f){const _0x2bf03a=a155_0x2566,_0x1e11ed=_0x23efb7();while(!![]){try{const _0x3a5677=parseInt(_0x2bf03a(0x1af))/0x1+parseInt(_0x2bf03a(0x1b3))/0x2+-parseInt(_0x2bf03a(0x1ab))/0x3+-parseInt(_0x2bf03a(0x1aa))/0x4*(parseInt(_0x2bf03a(0x1ad))/0x5)+parseInt(_0x2bf03a(0x1ae))/0x6+parseInt(_0x2bf03a(0x1b0))/0x7*(parseInt(_0x2bf03a(0x1a7))/0x8)+-parseInt(_0x2bf03a(0x1a8))/0x9*(parseInt(_0x2bf03a(0x1a9))/0xa);if(_0x3a5677===_0x4e807f)break;else _0x1e11ed['push'](_0x1e11ed['shift']());}catch(_0x12b224){_0x1e11ed['push'](_0x1e11ed['shift']());}}}(a155_0x2d1a,0xef357));function a155_0x2d1a(){const _0x574222=['689048oAKSGf','5786199tbpGrO','push','15QwbElm','11714556yMxzSS','374780DoPBoG','7238yexWDk','all','map','2345244trbwnR','length','slice','5328FQVVdP','981198nHeBGG','70WOgJnB'];a155_0x2d1a=function(){return _0x574222;};return a155_0x2d1a();}export async function batchAsync(_0x3b3fee,_0x1ac34f,_0x24afb5=0xa){const _0x4dead2=a155_0x2566,_0x37b020=[];for(let _0x12ec3d=0x0;_0x12ec3d<_0x3b3fee[_0x4dead2(0x1a5)];_0x12ec3d+=_0x24afb5){const _0x4781aa=_0x3b3fee[_0x4dead2(0x1a6)](_0x12ec3d,_0x12ec3d+_0x24afb5),_0x1ef674=await Promise[_0x4dead2(0x1b1)](_0x4781aa[_0x4dead2(0x1b2)](_0x1ac34f));_0x37b020[_0x4dead2(0x1ac)](..._0x1ef674);}return _0x37b020;}
|