@treasuredata/tdx 0.26.5 → 0.26.6
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.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/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.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.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/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/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.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/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/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/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/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/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x46c2a8,_0x258773){const _0x41b6d4=a143_0x5073,_0x48353d=_0x46c2a8();while(!![]){try{const _0x12a318=-parseInt(_0x41b6d4(0x98))/0x1+-parseInt(_0x41b6d4(0xa7))/0x2*(-parseInt(_0x41b6d4(0xb6))/0x3)+-parseInt(_0x41b6d4(0x96))/0x4+-parseInt(_0x41b6d4(0xa4))/0x5*(parseInt(_0x41b6d4(0xc0))/0x6)+parseInt(_0x41b6d4(0xaa))/0x7*(-parseInt(_0x41b6d4(0xa9))/0x8)+parseInt(_0x41b6d4(0xb1))/0x9+parseInt(_0x41b6d4(0x9e))/0xa;if(_0x12a318===_0x258773)break;else _0x48353d['push'](_0x48353d['shift']());}catch(_0x1bbfc8){_0x48353d['push'](_0x48353d['shift']());}}}(a143_0x3089,0xd175f));import{formatRows,hyperlink}from'./formatters.js';import a143_0x5380c1 from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};export function formatTree(_0x2c0406,_0x181745={},_0x4e92fb=0x0,_0x167bdb=''){const _0x46c9eb=a143_0x5073,_0x307c3f={...DEFAULT_OPTIONS,..._0x181745},_0x444561=[],_0x3cea91=[..._0x2c0406]['sort']((_0x3d69e8,_0x287c38)=>_0x3d69e8['name'][_0x46c9eb(0xb4)](_0x287c38[_0x46c9eb(0xac)],undefined,{'sensitivity':_0x46c9eb(0xbc)}));for(let _0x615064=0x0;_0x615064<_0x3cea91[_0x46c9eb(0xb3)];_0x615064++){const _0x119f4c=_0x3cea91[_0x615064],_0x106c65=_0x615064===_0x3cea91[_0x46c9eb(0xb3)]-0x1;let _0x95285b='';_0x4e92fb>0x0&&(_0x95285b+=_0x167bdb);_0x307c3f['showTreeLines']&&_0x4e92fb>0x0&&(_0x95285b+=a143_0x5380c1[_0x46c9eb(0x9b)](_0x106c65?'└──\x20':_0x46c9eb(0xba)));if(_0x307c3f['showIcons']){if(_0x119f4c[_0x46c9eb(0xad)]==='folder')_0x95285b+='📁\x20';else _0x119f4c[_0x46c9eb(0xad)]===_0x46c9eb(0x8e)?_0x95285b+=_0x46c9eb(0xb9):_0x95285b+=_0x46c9eb(0x94);}if(_0x307c3f[_0x46c9eb(0xb8)]&&_0x119f4c[_0x46c9eb(0xad)]===_0x46c9eb(0x91))_0x95285b+=hyperlink(_0x119f4c[_0x46c9eb(0xac)],_0x307c3f[_0x46c9eb(0xb8)](_0x119f4c['id']));else _0x307c3f[_0x46c9eb(0xa2)]&&_0x119f4c[_0x46c9eb(0xad)]===_0x46c9eb(0x8e)?_0x95285b+=hyperlink(_0x119f4c[_0x46c9eb(0xac)],_0x307c3f['getJourneyUrl'](_0x119f4c['id'])):_0x95285b+=_0x119f4c[_0x46c9eb(0xac)];if(_0x307c3f[_0x46c9eb(0x9f)]){if(_0x119f4c[_0x46c9eb(0xad)]===_0x46c9eb(0xbb)){const _0x44fff6=[];_0x119f4c['metadata'][_0x46c9eb(0xa3)]&&_0x44fff6[_0x46c9eb(0xbd)](_0x119f4c[_0x46c9eb(0xc2)]['segmentCount']+_0x46c9eb(0xc3)+(_0x119f4c[_0x46c9eb(0xc2)][_0x46c9eb(0xa3)]!==0x1?'s':'')),_0x119f4c[_0x46c9eb(0xc2)][_0x46c9eb(0x90)]&&_0x44fff6[_0x46c9eb(0xbd)](_0x119f4c[_0x46c9eb(0xc2)][_0x46c9eb(0x90)]+_0x46c9eb(0xa8)+(_0x119f4c[_0x46c9eb(0xc2)]['folderCount']!==0x1?'s':'')),_0x119f4c[_0x46c9eb(0xc2)][_0x46c9eb(0x92)]&&_0x44fff6[_0x46c9eb(0xbd)](_0x119f4c[_0x46c9eb(0xc2)]['journeyCount']+_0x46c9eb(0x93)+(_0x119f4c[_0x46c9eb(0xc2)][_0x46c9eb(0x92)]!==0x1?'s':'')),_0x44fff6[_0x46c9eb(0xb3)]>0x0&&(_0x95285b+=a143_0x5380c1[_0x46c9eb(0x9b)]('\x20('+_0x44fff6[_0x46c9eb(0xc1)](',\x20')+')'));}else{if(_0x119f4c['type']===_0x46c9eb(0x91)&&_0x119f4c['population']!==undefined)_0x95285b+=a143_0x5380c1[_0x46c9eb(0x9b)]('\x20('+formatRows(_0x119f4c[_0x46c9eb(0xab)])+')');else _0x119f4c[_0x46c9eb(0xad)]==='journey'&&_0x119f4c[_0x46c9eb(0x95)]&&(_0x95285b+=a143_0x5380c1[_0x46c9eb(0x9b)]('\x20'+getJourneyStateIndicator(_0x119f4c[_0x46c9eb(0x95)])));}}_0x444561[_0x46c9eb(0xbd)](_0x95285b);if(_0x119f4c['children']&&_0x119f4c[_0x46c9eb(0x99)][_0x46c9eb(0xb3)]>0x0){let _0x22c58d;if(_0x4e92fb===0x0)_0x22c58d='';else _0x307c3f[_0x46c9eb(0xa5)]?_0x22c58d=_0x167bdb+(_0x106c65?_0x46c9eb(0xb5):a143_0x5380c1['dim']('│')+_0x46c9eb(0xbe)):_0x22c58d=_0x167bdb+_0x307c3f[_0x46c9eb(0xbf)];const _0x141c69=formatTree(_0x119f4c[_0x46c9eb(0x99)],_0x307c3f,_0x4e92fb+0x1,_0x22c58d);_0x444561[_0x46c9eb(0xbd)](_0x141c69);}}return _0x444561['join']('\x0a');}function a143_0x5073(_0x17656d,_0x18ff4d){_0x17656d=_0x17656d-0x8d;const _0x3089b4=a143_0x3089();let _0x507391=_0x3089b4[_0x17656d];return _0x507391;}export function formatFlatList(_0x4415d2,_0x289ad8,_0x4f2e9c={},_0x52c8a0=[]){const _0xe08b88=a143_0x5073,_0x2df900={...DEFAULT_OPTIONS,..._0x4f2e9c},_0x353045=[];for(const _0x320b44 of _0x4415d2){_0x353045['push']({'sortKey':_0x320b44[_0xe08b88(0xac)],'displayName':_0x320b44[_0xe08b88(0xac)],'icon':_0x2df900['showIcons']?'📁':'','metadata':undefined});}for(const _0x591c90 of _0x289ad8){const _0x569320=_0x2df900['showMetadata']&&_0x591c90[_0xe08b88(0xab)]!==undefined?a143_0x5380c1[_0xe08b88(0x9b)]('\x20('+formatRows(_0x591c90[_0xe08b88(0xab)])+')'):'',_0x35b182=_0x2df900[_0xe08b88(0xb8)]?hyperlink(_0x591c90[_0xe08b88(0xac)],_0x2df900['getSegmentUrl'](_0x591c90['id'])):_0x591c90['name'];_0x353045[_0xe08b88(0xbd)]({'sortKey':_0x591c90['name'],'displayName':_0x35b182,'icon':_0x2df900[_0xe08b88(0xae)]?'🎯':'','metadata':_0x569320});}for(const _0x2c3926 of _0x52c8a0){const _0x344dba=getJourneyStateIndicator(_0x2c3926[_0xe08b88(0x95)]),_0x222c39=_0x2df900[_0xe08b88(0x9f)]?a143_0x5380c1['dim']('\x20'+_0x344dba):'',_0x36ec85=_0x2df900[_0xe08b88(0xa2)]?hyperlink(_0x2c3926['journeyBundleName'],_0x2df900[_0xe08b88(0xa2)](_0x2c3926['id'])):_0x2c3926[_0xe08b88(0xaf)];_0x353045['push']({'sortKey':_0x2c3926[_0xe08b88(0xaf)],'displayName':_0x36ec85,'icon':_0x2df900[_0xe08b88(0xae)]?_0xe08b88(0xb7):'','metadata':_0x222c39});}_0x353045[_0xe08b88(0xa6)]((_0x96f14b,_0x4d1508)=>_0x96f14b[_0xe08b88(0x8d)]['localeCompare'](_0x4d1508[_0xe08b88(0x8d)],undefined,{'sensitivity':'base'}));if(_0x353045[_0xe08b88(0xb3)]===0x0)return'(empty)';const _0x5d665c=_0x353045[_0xe08b88(0xa0)](_0x205a2e=>{const _0x2ef763=_0xe08b88,_0x1973ed=_0x205a2e[_0x2ef763(0x9d)]?_0x205a2e[_0x2ef763(0x9d)]+'\x20':'',_0x5c8054=_0x205a2e[_0x2ef763(0xc2)]||'';return''+_0x1973ed+_0x205a2e['displayName']+_0x5c8054;});return _0x5d665c[_0xe08b88(0xc1)]('\x0a');}function a143_0x3089(){const _0x4942e3=['\x20\x20\x20\x20','9mxjOkE','🗺️','getSegmentUrl','🗺️\x20','├──\x20','folder','base','push','\x20\x20\x20','indent','18WrVara','join','metadata','\x20segment','sortKey','journey','launched','folderCount','segment','journeyCount','\x20journey','🎯\x20','state','4585508oikltv','(running)','71113mztkcE','children','(completed)','dim','paused','icon','21041010WyioOj','showMetadata','map','draft','getJourneyUrl','segmentCount','2406305xqEZhb','showTreeLines','sort','479352BqGKyf','\x20folder','7166144SyGbCU','7JWZAjz','population','name','type','showIcons','journeyBundleName','(paused)','14326767lpPhui','(draft)','length','localeCompare'];a143_0x3089=function(){return _0x4942e3;};return a143_0x3089();}function getJourneyStateIndicator(_0x3f899b){const _0x41c163=a143_0x5073;switch(_0x3f899b){case _0x41c163(0xa1):return _0x41c163(0xb2);case _0x41c163(0x8f):return _0x41c163(0x97);case _0x41c163(0x9c):return _0x41c163(0xb0);case'completed':return _0x41c163(0x9a);default:return'('+_0x3f899b+')';}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a144_0x1163da=a144_0x119b;function a144_0x119b(_0x12378b,_0x501455){_0x12378b=_0x12378b-0x1c1;const _0x3e118a=a144_0x3e11();let _0x119b53=_0x3e118a[_0x12378b];return _0x119b53;}(function(_0x17ade2,_0x436f4d){const _0x4f9dbe=a144_0x119b,_0x142111=_0x17ade2();while(!![]){try{const _0x50384f=parseInt(_0x4f9dbe(0x1ca))/0x1+-parseInt(_0x4f9dbe(0x1cc))/0x2*(parseInt(_0x4f9dbe(0x1ce))/0x3)+-parseInt(_0x4f9dbe(0x1c1))/0x4*(parseInt(_0x4f9dbe(0x1d1))/0x5)+parseInt(_0x4f9dbe(0x1cf))/0x6+parseInt(_0x4f9dbe(0x1c3))/0x7+parseInt(_0x4f9dbe(0x1d7))/0x8+-parseInt(_0x4f9dbe(0x1cb))/0x9;if(_0x50384f===_0x436f4d)break;else _0x142111['push'](_0x142111['shift']());}catch(_0xb96ee8){_0x142111['push'](_0x142111['shift']());}}}(a144_0x3e11,0x7e734));import{SDKError,ErrorCode}from'../errors.js';const GZIP_MAGIC=Buffer[a144_0x1163da(0x1d8)]([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x4eb9b3){const _0xd1d764=a144_0x1163da;if(_0x4eb9b3[_0xd1d764(0x1da)]<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x4eb9b3[_0xd1d764(0x1da)],'error':{'message':_0xd1d764(0x1d0)+_0x4eb9b3[_0xd1d764(0x1da)]+_0xd1d764(0x1d3),'preview':getContentPreview(_0x4eb9b3),'helpText':_0xd1d764(0x1c7)}};if(!_0x4eb9b3['subarray'](0x0,0x2)[_0xd1d764(0x1d2)](GZIP_MAGIC)){const _0x7ccb83=getContentPreview(_0x4eb9b3),_0xe7e4e3=_0x7ccb83?_0xd1d764(0x1d5)+_0x7ccb83:'';return{'isValid':![],'size':_0x4eb9b3[_0xd1d764(0x1da)],'error':{'message':_0xd1d764(0x1dc)+_0xe7e4e3,'preview':_0x7ccb83,'helpText':_0xd1d764(0x1c5)}};}return{'isValid':!![],'size':_0x4eb9b3[_0xd1d764(0x1da)]};}function getContentPreview(_0x94ed2c){const _0x260cd2=a144_0x1163da;if(_0x94ed2c[_0x260cd2(0x1da)]===0x0)return _0x260cd2(0x1c9);const _0x57119b=_0x94ed2c[_0x260cd2(0x1c6)](0x0,0xc8)[_0x260cd2(0x1dd)]('utf-8'),_0x1b6459=_0x57119b[_0x260cd2(0x1d4)]('')[_0x260cd2(0x1d6)](_0x98be63=>{const _0x2fd35b=_0x98be63['charCodeAt'](0x0);return _0x2fd35b>=0x20&&_0x2fd35b<0x7f||_0x2fd35b===0xa||_0x2fd35b===0xd||_0x2fd35b===0x9;})[_0x260cd2(0x1da)],_0x579ce8=_0x1b6459/_0x57119b[_0x260cd2(0x1da)];if(_0x579ce8>0.8){const _0x4c0185=_0x57119b['slice'](0x0,0x64)[_0x260cd2(0x1c2)]();return _0x4c0185[_0x260cd2(0x1da)]<_0x57119b[_0x260cd2(0x1c2)]()['length']?_0x4c0185+_0x260cd2(0x1c4):_0x4c0185;}return undefined;}export function throwArchiveValidationError(_0x2fc64e){const _0x24fffb=a144_0x1163da;if(!_0x2fc64e[_0x24fffb(0x1db)])throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x24fffb(0x1d9));throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x2fc64e['error'][_0x24fffb(0x1c8)],undefined,{'helpText':_0x2fc64e[_0x24fffb(0x1db)][_0x24fffb(0x1cd)]});}function a144_0x3e11(){const _0x42a0eb=['split','\x20Server\x20response\x20preview:\x20','filter','1531384WuKoYR','from','Archive\x20validation\x20failed\x20with\x20unknown\x20error','length','error','Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.','toString','9068HRsFhJ','trim','5253682zDGqlJ','...','The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.','subarray','Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.','message','(empty\x20response)','700565yTWRoz','9037674xrUTDC','170132qafpGA','helpText','18zyFnGk','2394456dtJIFp','Downloaded\x20archive\x20is\x20too\x20small\x20(','20HXXIUS','equals','\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.'];a144_0x3e11=function(){return _0x42a0eb;};return a144_0x3e11();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a145_0x4999(){const _0x41e0e2=['revision','data','newProjectName','98903ZCXbFf','No\x20','998GvRSHD','sourceDir','resolve','sourceProjectName','2770650RvNwak','readdir','length','config','find','uploadProjectArchive','listProjects','24eXMwKm','toISOString','tdx-wf-clone-','replace','access','archive.tar.gz','filter','name','join','2229724xHeswZ','push','skipValidation','endsWith','641775WoJvsf','373OagyDn','977466SJZZvt','370431MUUyyF','mkdtemp','create'];a145_0x4999=function(){return _0x41e0e2;};return a145_0x4999();}(function(_0x292805,_0x458d4e){const _0x1557f3=a145_0x40dc,_0x4402e9=_0x292805();while(!![]){try{const _0x256cc2=-parseInt(_0x1557f3(0x76))/0x1*(parseInt(_0x1557f3(0x80))/0x2)+-parseInt(_0x1557f3(0x77))/0x3+parseInt(_0x1557f3(0x71))/0x4+-parseInt(_0x1557f3(0x75))/0x5+parseInt(_0x1557f3(0x84))/0x6+-parseInt(_0x1557f3(0x7e))/0x7*(parseInt(_0x1557f3(0x68))/0x8)+-parseInt(_0x1557f3(0x78))/0x9;if(_0x256cc2===_0x458d4e)break;else _0x4402e9['push'](_0x4402e9['shift']());}catch(_0x55abbf){_0x4402e9['push'](_0x4402e9['shift']());}}}(a145_0x4999,0x481bc));import{promises as a145_0x4c599f}from'fs';function a145_0x40dc(_0x542396,_0x40fedb){_0x542396=_0x542396-0x68;const _0x4999ef=a145_0x4999();let _0x40dcb3=_0x4999ef[_0x542396];return _0x40dcb3;}import a145_0x222421 from'path';import a145_0x449c84 from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';export async function prepareCloneWorkflow(_0x299659,_0xf8f5a6,_0x3472a6,_0x3d3058={}){const _0xac7ae6=a145_0x40dc,{client:_0xb5c32c}=_0x299659,_0x52aa0d=a145_0x222421[_0xac7ae6(0x82)](_0xf8f5a6);try{await a145_0x4c599f[_0xac7ae6(0x6c)](_0x52aa0d);}catch{throw new Error('Source\x20directory\x20not\x20found:\x20'+_0xf8f5a6);}const _0x25aecf=tryFindWorkflowTdxConfig(_0x52aa0d),_0x300edd=_0x25aecf?.[_0xac7ae6(0x87)]['workflow_project'],_0x2e27f1=_0x3d3058[_0xac7ae6(0x7b)]||new Date()[_0xac7ae6(0x69)]()[_0xac7ae6(0x6b)](/[:.]/g,'-');if(!_0x3d3058[_0xac7ae6(0x73)]){const _0x483d07=await a145_0x4c599f[_0xac7ae6(0x85)](_0x52aa0d),_0x42e07f=_0x483d07[_0xac7ae6(0x6e)](_0x53f06e=>_0x53f06e[_0xac7ae6(0x74)](WORKFLOW_FILE_EXTENSION));if(_0x42e07f[_0xac7ae6(0x86)]===0x0)throw new Error(_0xac7ae6(0x7f)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20'+_0x52aa0d);}const _0x53ec23=await getProjectFiles(_0x52aa0d);let _0x3d1130=![],_0x4db67d;try{const _0x4f73c5=await _0xb5c32c[_0xac7ae6(0x8a)]({'name_pattern':_0x3472a6}),_0xc92a31=_0x4f73c5[_0xac7ae6(0x7c)][_0xac7ae6(0x88)](_0x5aa47c=>_0x5aa47c[_0xac7ae6(0x6f)]===_0x3472a6);_0xc92a31&&(_0x3d1130=!![],_0x4db67d=_0xc92a31['id']);}catch{}return{'sourceDir':_0x52aa0d,'sourceProjectName':_0x300edd,'newProjectName':_0x3472a6,'revision':_0x2e27f1,'fileCount':_0x53ec23['length'],'files':_0x53ec23,'targetExists':_0x3d1130,'existingProjectId':_0x4db67d};}export async function executeCloneWorkflow(_0x4053bb,_0x1a8c4f){const _0x38e9e9=a145_0x40dc,_0x22b01d=await import('tar'),{client:_0x5c1bdf}=_0x4053bb,_0x3ae1eb=await getProjectFiles(_0x1a8c4f[_0x38e9e9(0x81)]),_0x3d2644=await a145_0x4c599f[_0x38e9e9(0x79)](a145_0x222421[_0x38e9e9(0x70)](a145_0x449c84['tmpdir'](),_0x38e9e9(0x6a))),_0x553aa8=a145_0x222421[_0x38e9e9(0x70)](_0x3d2644,_0x38e9e9(0x6d));try{await _0x22b01d[_0x38e9e9(0x7a)]({'file':_0x553aa8,'gzip':!![],'cwd':_0x1a8c4f['sourceDir'],'portable':!![]},_0x3ae1eb);const _0x2270d8=await _0x5c1bdf[_0x38e9e9(0x89)](_0x1a8c4f[_0x38e9e9(0x7d)],_0x1a8c4f['revision'],_0x553aa8);return{'sourceDir':_0x1a8c4f[_0x38e9e9(0x81)],'sourceProjectName':_0x1a8c4f[_0x38e9e9(0x83)],'newProjectName':_0x2270d8['name'],'newProjectId':_0x2270d8['id'],'revision':_0x2270d8[_0x38e9e9(0x7b)],'fileCount':_0x3ae1eb['length'],'files':_0x3ae1eb};}finally{await a145_0x4c599f['rm'](_0x3d2644,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x15dac0,_0x17e265=''){const _0x47d318=a145_0x40dc,_0x52af2f=[],_0x4aedb2=await a145_0x4c599f['readdir'](_0x15dac0,{'withFileTypes':!![]});for(const _0x458288 of _0x4aedb2){const _0x26b75c=_0x17e265?a145_0x222421['join'](_0x17e265,_0x458288['name']):_0x458288[_0x47d318(0x6f)];if(_0x458288['name']==='tdx.json')continue;if(!shouldIncludeInArchive(_0x458288[_0x47d318(0x6f)]))continue;if(_0x458288['isDirectory']()){const _0xd943d5=await getProjectFiles(a145_0x222421[_0x47d318(0x70)](_0x15dac0,_0x458288['name']),_0x26b75c);_0x52af2f['push'](..._0xd943d5);}else _0x52af2f[_0x47d318(0x72)](_0x26b75c);}return _0x52af2f;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a146_0x114c3e=a146_0x4f1f;(function(_0x5f1b72,_0x5df75c){const _0x956d75=a146_0x4f1f,_0x4ee9ee=_0x5f1b72();while(!![]){try{const _0x67fc8f=-parseInt(_0x956d75(0x193))/0x1+-parseInt(_0x956d75(0x1a1))/0x2+-parseInt(_0x956d75(0x1ab))/0x3*(-parseInt(_0x956d75(0x199))/0x4)+-parseInt(_0x956d75(0x187))/0x5*(-parseInt(_0x956d75(0x1e0))/0x6)+parseInt(_0x956d75(0x18b))/0x7+-parseInt(_0x956d75(0x1ce))/0x8*(parseInt(_0x956d75(0x1e8))/0x9)+parseInt(_0x956d75(0x1e4))/0xa;if(_0x67fc8f===_0x5df75c)break;else _0x4ee9ee['push'](_0x4ee9ee['shift']());}catch(_0x11d16b){_0x4ee9ee['push'](_0x4ee9ee['shift']());}}}(a146_0x11cd,0xb1885));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';const MAX_PAGINATION_LIMIT=0x3e8;async function paginateResults(_0x456772,_0x37a140,_0x4af80a=0x64){const _0x228a78=a146_0x4f1f,_0x187428=Math[_0x228a78(0x1ee)](_0x37a140,MAX_PAGINATION_LIMIT),_0x3a9d6e=[];let _0x2bb47a;while(_0x3a9d6e[_0x228a78(0x1c3)]<_0x187428){const _0x580040=await _0x456772(_0x4af80a,_0x2bb47a),_0x484709=_0x580040['rawCount']??_0x580040[_0x228a78(0x1b7)]['length'];if(_0x484709===0x0)break;_0x3a9d6e[_0x228a78(0x1a3)](..._0x580040[_0x228a78(0x1b7)]);if(!_0x580040[_0x228a78(0x194)]||_0x484709<_0x4af80a)break;_0x2bb47a=_0x580040[_0x228a78(0x194)];}return _0x3a9d6e['slice'](0x0,_0x187428);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';function a146_0x4f1f(_0x4a8210,_0x30713c){_0x4a8210=_0x4a8210-0x187;const _0x11cd41=a146_0x11cd();let _0x4f1fb1=_0x11cd41[_0x4a8210];return _0x4f1fb1;}import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';function a146_0x11cd(){const _0x3588f5=['toTime','message','5187366LdmnRe','test','Invalid\x20workflow\x20format:\x20','latest','9238710GdmPjh','stateParams','includeRetried','last_id','98001xxccfV','project','bind','workflow','toString','tasks','min','config','deleteProject','sessions','retrySession','delete','replace','workflows','logFiles','endsWith','.tar.gz','fromTask','map','listWorkflows','timezone','listSessions','params','gunzip','fullName','\x20workflow\x20files\x20found\x20in\x20project\x20directory','isFile','Failed\x20to\x20download\x20log\x20file:\x20','filter','listSecrets','5fTLoqF','error','clearScheduleAll','isGroup','8533651fuSehX','retryParams','startAttempt','finishedAt','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','tdx-workflow-push-','Project\x20not\x20found:\x20','tmpdir','1076114nOYsjo','lastId','resolveProjectId','path','clearSchedule','.\x20Expected\x20\x22project.workflow\x22','16IZCGPN','executeCloneProject','killAttempt','updatedAt','readdir','revision','isDirectory','listAttempts','2550308YlRFuY','kill','push','WORKFLOW_PROJECT_NOT_FOUND','sessionUuid','deleteSecret','force','preparePushProject','storeParams','workflowName','379857VCOZMo','Kill\x20request\x20accepted','retryAt','startedAt','find','success','getAttemptTasks','applyPullProject','status','parentId','listProjects','now','data','substring','unlink','No\x20','done','state','cancelRequested','projectName','NUMERIC_ID_PATTERN','logs','executePushProject','toISOString','length','limit','sessionTime','client','tar','zlib','from','pullProject','downloadProjectArchive','index','sessionId','320aDfkez','resumeFrom','basename','skipValidation','direct','projects','Project\x20directory\x20not\x20found:\x20','join','Cannot\x20read\x20workflow\x20file:\x20','name','utf-8','exportParams','mkdir','scheduleFrom','attempt','createdAt'];a146_0x11cd=function(){return _0x3588f5;};return a146_0x11cd();}import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a146_0x114c3e(0x1bf)]=/^\d+$/;['client'];constructor(_0x57ebf3){const _0xd9165d=a146_0x114c3e;this[_0xd9165d(0x1c6)]=new WorkflowApiClient(_0x57ebf3);}async[a146_0x114c3e(0x195)](_0x985dfe){const _0x40bdbb=a146_0x114c3e;if(WorkflowSDK[_0x40bdbb(0x1bf)][_0x40bdbb(0x1e1)](_0x985dfe)){const _0x15bcf2=await this['client']['getProject'](_0x985dfe);return{'id':_0x15bcf2['id'],'name':_0x15bcf2[_0x40bdbb(0x1d7)]};}const _0x566432=await this[_0x40bdbb(0x1c6)][_0x40bdbb(0x1b5)]({'name_pattern':_0x985dfe}),_0x11bfe0=_0x566432[_0x40bdbb(0x1b7)]['find'](_0x22f65c=>_0x22f65c[_0x40bdbb(0x1d7)]===_0x985dfe);if(!_0x11bfe0)throw new SDKError(ErrorCode[_0x40bdbb(0x1a4)],_0x40bdbb(0x191)+_0x985dfe);return{'id':_0x11bfe0['id'],'name':_0x11bfe0[_0x40bdbb(0x1d7)]};}async[a146_0x114c3e(0x1d3)](_0x10f066,_0x1da6d6){const _0x4d14e2=a146_0x114c3e,_0x32ddd6=_0x1da6d6?.[_0x4d14e2(0x1c4)]||0x64,_0x162de3=await paginateResults((_0x568a7e,_0x56150d)=>this['client']['listProjects']({'name_pattern':_0x10f066,'limit':_0x568a7e,'last_id':_0x56150d??_0x1da6d6?.[_0x4d14e2(0x1e7)]}),_0x32ddd6);return _0x162de3[_0x4d14e2(0x1fa)](_0x17726d=>({..._0x17726d,'project_id':_0x17726d['id'],'project_name':_0x17726d[_0x4d14e2(0x1d7)]}));}async[a146_0x114c3e(0x1f5)](_0x1ded32,_0x52e2b0){const _0x7aca67=a146_0x114c3e,_0x2f0e73=_0x52e2b0?.[_0x7aca67(0x1c4)]||0x64,_0x25ae8d=await paginateResults((_0xea0207,_0x49b78e)=>this[_0x7aca67(0x1c6)][_0x7aca67(0x1fb)]({'project_name':_0x1ded32,'limit':_0xea0207,'last_id':_0x49b78e??_0x52e2b0?.[_0x7aca67(0x1e7)]}),_0x2f0e73);return _0x25ae8d[_0x7aca67(0x1fa)](_0x2ae78d=>({'project_id':_0x2ae78d[_0x7aca67(0x1e9)]?.['id'],'project_name':_0x2ae78d[_0x7aca67(0x1e9)]?.[_0x7aca67(0x1d7)],'workflow_id':_0x2ae78d['id'],'workflow_name':_0x2ae78d[_0x7aca67(0x1d7)],'revision':_0x2ae78d[_0x7aca67(0x19e)],'timezone':_0x2ae78d[_0x7aca67(0x1fc)],'config':_0x2ae78d['config'],'id':_0x2ae78d['id'],'name':_0x2ae78d[_0x7aca67(0x1d7)],'project':_0x2ae78d[_0x7aca67(0x1e9)]}));}async[a146_0x114c3e(0x1f1)](_0x16855f){const _0x2a9368=a146_0x114c3e;let _0x53e271;if(_0x16855f?.[_0x2a9368(0x1be)]){let _0x409b31,_0x2fecfa=![];while(!_0x2fecfa){const _0x19547e=await this[_0x2a9368(0x1c6)][_0x2a9368(0x1b5)]({'limit':0x64,'last_id':_0x409b31}),_0x5d1714=_0x19547e['data'][_0x2a9368(0x1af)](_0x2535ca=>_0x2535ca[_0x2a9368(0x1d7)]===_0x16855f['projectName']);if(_0x5d1714){_0x53e271=_0x5d1714['id'],_0x2fecfa=!![];break;}if(!_0x19547e['lastId']||_0x19547e[_0x2a9368(0x1b7)][_0x2a9368(0x1c3)]===0x0)break;_0x409b31=_0x19547e[_0x2a9368(0x194)];}if(!_0x53e271)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],_0x2a9368(0x191)+_0x16855f[_0x2a9368(0x1be)]);}const _0x5a0dfb=_0x16855f?.[_0x2a9368(0x1c4)]||0x64,_0x345483=await paginateResults((_0x3cf9d5,_0x8cb993)=>this[_0x2a9368(0x1c6)][_0x2a9368(0x1fd)]({'project_id':_0x53e271,'project_name':_0x16855f?.['projectName'],'workflow_name':_0x16855f?.[_0x2a9368(0x1aa)],'status':_0x16855f?.[_0x2a9368(0x1b3)],'from_time':_0x16855f?.['fromTime'],'to_time':_0x16855f?.[_0x2a9368(0x1de)],'limit':_0x3cf9d5,'last_id':_0x8cb993??_0x16855f?.[_0x2a9368(0x1e7)]}),_0x5a0dfb);return _0x345483[_0x2a9368(0x1fa)](_0x3fc985=>({'project_id':_0x3fc985['project']?.['id'],'project_name':_0x3fc985[_0x2a9368(0x1e9)]?.['name'],'workflow_id':_0x3fc985[_0x2a9368(0x1eb)]?.['id'],'workflow_name':_0x3fc985[_0x2a9368(0x1eb)]?.[_0x2a9368(0x1d7)],'session_id':_0x3fc985['id'],'sessionUuid':_0x3fc985[_0x2a9368(0x1a5)],'sessionTime':_0x3fc985[_0x2a9368(0x1c5)],'lastAttempt':_0x3fc985['lastAttempt'],'id':_0x3fc985['id'],'project':_0x3fc985[_0x2a9368(0x1e9)],'workflow':_0x3fc985[_0x2a9368(0x1eb)]}));}async['attempts'](_0x26d932){const _0x431fcd=a146_0x114c3e,_0x5ee338=_0x26d932?.['limit']||0x64,_0x4d2293=await paginateResults((_0x5d0d15,_0x16dd89)=>this[_0x431fcd(0x1c6)][_0x431fcd(0x1a0)]({'project_name':_0x26d932?.[_0x431fcd(0x1be)],'workflow_name':_0x26d932?.[_0x431fcd(0x1aa)],'include_retried':_0x26d932?.[_0x431fcd(0x1e6)],'limit':_0x5d0d15,'last_id':_0x16dd89??_0x26d932?.[_0x431fcd(0x1e7)]}),_0x5ee338);return _0x4d2293['map'](_0x766ccf=>({'project_id':_0x766ccf[_0x431fcd(0x1e9)]?.['id'],'project_name':_0x766ccf['project']?.[_0x431fcd(0x1d7)],'workflow_id':_0x766ccf['workflow']?.['id'],'workflow_name':_0x766ccf[_0x431fcd(0x1eb)]?.['name'],'session_id':_0x766ccf[_0x431fcd(0x1cd)],'sessionUuid':_0x766ccf[_0x431fcd(0x1a5)],'sessionTime':_0x766ccf['sessionTime'],'attempt_id':_0x766ccf['id'],'attempt_index':_0x766ccf[_0x431fcd(0x1cc)],'retryAttemptName':_0x766ccf['retryAttemptName'],'done':_0x766ccf[_0x431fcd(0x1bb)],'success':_0x766ccf[_0x431fcd(0x1b0)],'cancelRequested':_0x766ccf[_0x431fcd(0x1bd)],'params':_0x766ccf[_0x431fcd(0x1fe)],'createdAt':_0x766ccf[_0x431fcd(0x1dd)],'finishedAt':_0x766ccf[_0x431fcd(0x18e)],'id':_0x766ccf['id'],'index':_0x766ccf[_0x431fcd(0x1cc)],'project':_0x766ccf['project'],'workflow':_0x766ccf['workflow']}));}async[a146_0x114c3e(0x1dc)](_0x2c355d){const _0x4a72e8=await this['client']['getAttempt'](_0x2c355d);return _0x4a72e8;}async[a146_0x114c3e(0x1ed)](_0x3aa51e,_0x483e6b=![]){const _0x1a622a=a146_0x114c3e,_0x261c57=await this[_0x1a622a(0x1c6)][_0x1a622a(0x1b1)](_0x3aa51e,_0x483e6b);return _0x261c57['map'](_0x1e8f25=>({'task_id':_0x1e8f25['id'],'task_name':_0x1e8f25['fullName'],'parentId':_0x1e8f25[_0x1a622a(0x1b4)],'config':_0x1e8f25[_0x1a622a(0x1ef)],'upstreams':_0x1e8f25['upstreams'],'state':_0x1e8f25[_0x1a622a(0x1bc)],'exportParams':_0x1e8f25[_0x1a622a(0x1d9)],'storeParams':_0x1e8f25[_0x1a622a(0x1a9)],'stateParams':_0x1e8f25[_0x1a622a(0x1e5)],'updatedAt':_0x1e8f25[_0x1a622a(0x19c)],'retryAt':_0x1e8f25[_0x1a622a(0x1ad)],'startedAt':_0x1e8f25[_0x1a622a(0x1ae)],'error':_0x1e8f25[_0x1a622a(0x188)],'isGroup':_0x1e8f25[_0x1a622a(0x18a)],'id':_0x1e8f25['id'],'fullName':_0x1e8f25[_0x1a622a(0x200)]}));}async[a146_0x114c3e(0x1f6)](_0xf8e1e1,_0x2ae14d){const _0x5efcb6=a146_0x114c3e;return await this[_0x5efcb6(0x1c6)]['listLogFiles'](_0xf8e1e1,_0x2ae14d);}async[a146_0x114c3e(0x1c0)](_0x54a038,_0x2e5147){const _0x3ffd74=a146_0x114c3e,_0x2ff576=await import(_0x3ffd74(0x1c8)),{promisify:_0x300b0c}=await import('util'),_0x579532=_0x300b0c(_0x2ff576[_0x3ffd74(0x1ff)]),_0x9a10f=await this['client']['listLogFiles'](_0x54a038,_0x2e5147);if(_0x9a10f[_0x3ffd74(0x1c3)]===0x0)return'';const _0x24681b=[];for(const _0x45c440 of _0x9a10f){if(!_0x45c440[_0x3ffd74(0x1d2)])continue;const _0x5cbd22=await fetch(_0x45c440[_0x3ffd74(0x1d2)]);if(!_0x5cbd22['ok'])throw new Error(_0x3ffd74(0x203)+_0x5cbd22[_0x3ffd74(0x1b3)]);const _0x185823=Buffer[_0x3ffd74(0x1c9)](await _0x5cbd22['arrayBuffer']()),_0xec54f8=await _0x579532(_0x185823);_0x24681b['push'](_0xec54f8[_0x3ffd74(0x1ec)](_0x3ffd74(0x1d8)));}return _0x24681b['join']('\x0a');}async[a146_0x114c3e(0x1a2)](_0x6439fa,_0x360837){const _0x461494=a146_0x114c3e,_0x196ae2=await this[_0x461494(0x1c6)][_0x461494(0x19b)](_0x6439fa,_0x360837);return _0x196ae2?.[_0x461494(0x1df)]??_0x461494(0x1ac);}async[a146_0x114c3e(0x1f2)](_0x2f81aa,_0x5a4499){const _0x2908b4=a146_0x114c3e,_0x33a736=await this[_0x2908b4(0x1c6)][_0x2908b4(0x1f2)](_0x2f81aa,{'from_task':_0x5a4499?.[_0x2908b4(0x1f9)],'retry_params':_0x5a4499?.['retryParams']});return{'attemptId':_0x33a736['id'],'sessionId':_0x33a736[_0x2908b4(0x1cd)]};}async['retryAttempt'](_0x48fa16,_0x3a0c85){const _0x22cea2=a146_0x114c3e,_0xb206e5=await this[_0x22cea2(0x1c6)]['retryAttempt'](_0x48fa16,{'resume_from':_0x3a0c85?.[_0x22cea2(0x1cf)],'retry_params':_0x3a0c85?.[_0x22cea2(0x18c)],'force':_0x3a0c85?.[_0x22cea2(0x1a7)]});return{'attemptId':_0xb206e5['id'],'sessionId':_0xb206e5['sessionId']};}async['run'](_0x3933ee,_0x278714={},_0x2c3d07){const _0x413040=a146_0x114c3e,_0x194767=_0x3933ee['indexOf']('.');let _0x15ff75,_0x1334f9;if(_0x194767===-0x1)throw new Error(_0x413040(0x18f));_0x15ff75=_0x3933ee['substring'](0x0,_0x194767),_0x1334f9=_0x3933ee[_0x413040(0x1b8)](_0x194767+0x1);if(!_0x15ff75||!_0x1334f9)throw new Error(_0x413040(0x1e2)+_0x3933ee+_0x413040(0x198));const _0x2e9a56=_0x2c3d07?.[_0x413040(0x1c5)]||new Date()[_0x413040(0x1c2)]();return await this[_0x413040(0x1c6)][_0x413040(0x18d)]({'projectName':_0x15ff75,'workflowName':_0x1334f9,'sessionTime':_0x2e9a56,'params':_0x278714});}async['download'](_0x3dbc14,_0x575550,_0x2fb54f){const _0x566cb9=a146_0x114c3e,{promises:_0x37ae4f}=await import('fs'),_0x5a0327=await import(_0x566cb9(0x196)),_0x5129d5=await import('os'),_0x36ad06=await import(_0x566cb9(0x1c7)),{id:_0x2e8f39,name:_0x100e8d}=await this[_0x566cb9(0x195)](_0x3dbc14),_0x2a8339=_0x5129d5[_0x566cb9(0x192)](),_0x2c2c20=_0x5a0327['join'](_0x2a8339,'tdx-workflow-'+_0x2e8f39+'-'+Date[_0x566cb9(0x1b6)]()+'.tar.gz');try{await this[_0x566cb9(0x1c6)][_0x566cb9(0x1cb)](_0x2e8f39,_0x2c2c20,_0x2fb54f?.[_0x566cb9(0x19e)]);const _0x10fa8e=_0x5a0327[_0x566cb9(0x1d5)](_0x575550,_0x100e8d);await _0x37ae4f[_0x566cb9(0x1da)](_0x10fa8e,{'recursive':!![]}),await _0x36ad06['extract']({'file':_0x2c2c20,'cwd':_0x10fa8e,'gzip':!![]});const _0x48a45d=async _0x3b1ca6=>{const _0x3bbd39=_0x566cb9;let _0x19d4b7=0x0;const _0x27245e=await _0x37ae4f[_0x3bbd39(0x19d)](_0x3b1ca6,{'withFileTypes':!![]});for(const _0x212b3d of _0x27245e){const _0x3a2de3=_0x5a0327['join'](_0x3b1ca6,_0x212b3d[_0x3bbd39(0x1d7)]);if(_0x212b3d[_0x3bbd39(0x202)]())_0x19d4b7++;else _0x212b3d[_0x3bbd39(0x19f)]()&&(_0x19d4b7+=await _0x48a45d(_0x3a2de3));}return _0x19d4b7;},_0x22c78c=await _0x48a45d(_0x10fa8e);return{'projectName':_0x100e8d,'revision':_0x2fb54f?.[_0x566cb9(0x19e)]||_0x566cb9(0x1e3),'filesExtracted':_0x22c78c};}finally{try{await _0x37ae4f[_0x566cb9(0x1b9)](_0x2c2c20);}catch{}}}async['push'](_0x23b8ea,_0x49b0ea){const _0xe07088=a146_0x114c3e,{promises:_0x5f8ab7}=await import('fs'),_0x987d4e=await import(_0xe07088(0x196)),_0x55092a=await import('tar'),_0x1b406e=_0x49b0ea?.['projectName']||_0x987d4e[_0xe07088(0x1d0)](_0x23b8ea),_0x4bed26=_0x49b0ea?.[_0xe07088(0x19e)]||new Date()['toISOString']()[_0xe07088(0x1f4)](/[:.]/g,'-');try{await _0x5f8ab7['access'](_0x23b8ea);}catch{throw new Error(_0xe07088(0x1d4)+_0x23b8ea);}if(!_0x49b0ea?.[_0xe07088(0x1d1)]){const _0x372e2d=await _0x5f8ab7['readdir'](_0x23b8ea),_0x1b8c21=_0x372e2d[_0xe07088(0x204)](_0x55a682=>_0x55a682[_0xe07088(0x1f7)](WORKFLOW_FILE_EXTENSION));if(_0x1b8c21[_0xe07088(0x1c3)]===0x0)throw new Error(_0xe07088(0x1ba)+WORKFLOW_FILE_EXTENSION+_0xe07088(0x201));for(const _0x44a4b3 of _0x1b8c21){const _0x6616e8=_0x987d4e[_0xe07088(0x1d5)](_0x23b8ea,_0x44a4b3);try{await _0x5f8ab7['access'](_0x6616e8);}catch{throw new Error(_0xe07088(0x1d6)+_0x44a4b3);}}}const _0x4dfd48=async(_0x10fd1a,_0x3b2004='')=>{const _0x2b94f8=_0xe07088,_0x3f2aa8=await _0x5f8ab7[_0x2b94f8(0x19d)](_0x10fd1a,{'withFileTypes':!![]}),_0x3b4744=[];for(const _0x55bf27 of _0x3f2aa8){const _0x3b39b3=_0x987d4e[_0x2b94f8(0x1d5)](_0x3b2004,_0x55bf27['name']),_0x57ec9c=_0x987d4e[_0x2b94f8(0x1d5)](_0x10fd1a,_0x55bf27[_0x2b94f8(0x1d7)]);if(!shouldIncludeInArchive(_0x55bf27[_0x2b94f8(0x1d7)]))continue;_0x55bf27['isDirectory']()?_0x3b4744[_0x2b94f8(0x1a3)](...await _0x4dfd48(_0x57ec9c,_0x3b39b3)):_0x3b4744['push'](_0x3b39b3);}return _0x3b4744;},_0x40babd=await _0x4dfd48(_0x23b8ea),_0x41a01d=await import('os'),_0x2ebf31=_0x41a01d['tmpdir'](),_0x31d329=_0x987d4e[_0xe07088(0x1d5)](_0x2ebf31,_0xe07088(0x190)+Date['now']()+_0xe07088(0x1f8));try{await _0x55092a['create']({'file':_0x31d329,'gzip':!![],'cwd':_0x23b8ea,'portable':!![]},_0x40babd);const _0x9e0077=await this['client']['uploadProjectArchive'](_0x1b406e,_0x4bed26,_0x31d329,{'scheduleFrom':_0x49b0ea?.[_0xe07088(0x1db)],'clearSchedule':_0x49b0ea?.[_0xe07088(0x197)],'clearScheduleAll':_0x49b0ea?.[_0xe07088(0x189)]});return{'projectId':_0x9e0077['id'],'projectName':_0x9e0077[_0xe07088(0x1d7)],'revision':_0x9e0077[_0xe07088(0x19e)]};}finally{try{await _0x5f8ab7[_0xe07088(0x1b9)](_0x31d329);}catch{}}}async[a146_0x114c3e(0x1f3)](_0x164d64){const _0x11b56e=a146_0x114c3e,{id:_0x3b1cea}=await this['resolveProjectId'](_0x164d64),_0x54f146=await this[_0x11b56e(0x1c6)][_0x11b56e(0x1f0)](_0x3b1cea);return{'projectId':_0x54f146['id'],'projectName':_0x54f146[_0x11b56e(0x1d7)]};}async[a146_0x114c3e(0x205)](_0x1e7544){const _0x2d0a99=a146_0x114c3e,{id:_0x104f07,name:_0x479653}=await this[_0x2d0a99(0x195)](_0x1e7544),_0x3cdaf8=await this[_0x2d0a99(0x1c6)][_0x2d0a99(0x205)](_0x104f07);return{'projectName':_0x479653,'secrets':_0x3cdaf8};}async['setSecret'](_0xfb9b45,_0xd4c148,_0x2697f0){const _0x24c73d=a146_0x114c3e,{id:_0x1caa07,name:_0x251662}=await this['resolveProjectId'](_0xfb9b45);return await this[_0x24c73d(0x1c6)]['setSecret'](_0x1caa07,_0xd4c148,_0x2697f0),{'projectName':_0x251662,'key':_0xd4c148};}async[a146_0x114c3e(0x1a6)](_0x328c10,_0x24ce26){const _0x587233=a146_0x114c3e,{id:_0x336d31,name:_0x26687f}=await this[_0x587233(0x195)](_0x328c10);return await this['client']['deleteSecret'](_0x336d31,_0x24ce26),{'projectName':_0x26687f,'key':_0x24ce26};}async[a146_0x114c3e(0x1ca)](_0x27cef3,_0x4215a0){const _0x2c7084=a146_0x114c3e;return pullWorkflow({'client':this[_0x2c7084(0x1c6)],'resolveProjectId':this[_0x2c7084(0x195)]['bind'](this)},_0x27cef3,_0x4215a0);}async[a146_0x114c3e(0x1b2)](_0x57d429,_0x3741e4){const _0x53e825=a146_0x114c3e;return applyPullResult({'client':this[_0x53e825(0x1c6)],'resolveProjectId':this[_0x53e825(0x195)][_0x53e825(0x1ea)](this)},_0x57d429,_0x3741e4);}async[a146_0x114c3e(0x1a8)](_0x5b6bb5){const _0x18a7eb=a146_0x114c3e;return preparePushWorkflow({'client':this[_0x18a7eb(0x1c6)],'resolveProjectId':this[_0x18a7eb(0x195)][_0x18a7eb(0x1ea)](this)},_0x5b6bb5);}async[a146_0x114c3e(0x1c1)](_0x1a7971){const _0x578234=a146_0x114c3e;return executePushWorkflow({'client':this[_0x578234(0x1c6)],'resolveProjectId':this[_0x578234(0x195)][_0x578234(0x1ea)](this)},_0x1a7971);}async['prepareCloneProject'](_0x449e40,_0x520f1d,_0x5673d0){const _0x315044=a146_0x114c3e;return prepareCloneWorkflow({'client':this[_0x315044(0x1c6)]},_0x449e40,_0x520f1d,_0x5673d0);}async[a146_0x114c3e(0x19a)](_0x55f8ae){const _0x4c54f4=a146_0x114c3e;return executeCloneWorkflow({'client':this[_0x4c54f4(0x1c6)]},_0x55f8ae);}}
|
|
1
|
+
function a146_0x405b(_0x37f0c3,_0x3a8c51){_0x37f0c3=_0x37f0c3-0xfa;const _0x4fc90f=a146_0x4fc9();let _0x405be6=_0x4fc90f[_0x37f0c3];return _0x405be6;}const a146_0x5fec8=a146_0x405b;(function(_0xdab396,_0x33c3a0){const _0x17bf39=a146_0x405b,_0x33ef31=_0xdab396();while(!![]){try{const _0x456f45=parseInt(_0x17bf39(0x14b))/0x1+parseInt(_0x17bf39(0x15c))/0x2+-parseInt(_0x17bf39(0x137))/0x3+-parseInt(_0x17bf39(0x16f))/0x4*(-parseInt(_0x17bf39(0x12f))/0x5)+parseInt(_0x17bf39(0x13e))/0x6*(-parseInt(_0x17bf39(0x107))/0x7)+parseInt(_0x17bf39(0x136))/0x8+-parseInt(_0x17bf39(0x171))/0x9;if(_0x456f45===_0x33c3a0)break;else _0x33ef31['push'](_0x33ef31['shift']());}catch(_0x3f0a0c){_0x33ef31['push'](_0x33ef31['shift']());}}}(a146_0x4fc9,0xc804a));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';const MAX_PAGINATION_LIMIT=0x3e8;function a146_0x4fc9(){const _0x4315ee=['toISOString','startedAt','success','sessionTime','Project\x20not\x20found:\x20','push','finishedAt','fullName','parentId','cancelRequested','preparePushProject','index','lastId','isDirectory','setSecret','includeRetried','mkdir','revision','downloadProjectArchive','attempts','listSessions','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','sessionUuid','force','limit','retryAttemptName','uploadProjectArchive','client','exportParams','skipValidation','direct','deleteSecret','Cannot\x20read\x20workflow\x20file:\x20','Kill\x20request\x20accepted','tmpdir','106915FoJjeS','clearScheduleAll','logs','substring','workflow','now','retrySession','11220280beieRN','2628729itBeOM','params','data','listSecrets','retryAttempt','Failed\x20to\x20download\x20log\x20file:\x20','upstreams','94782zbPRdK','status','arrayBuffer','message','slice','getAttemptTasks','attempt','tar','tasks','download','deleteProject','delete','listAttempts','586484lRJKwy','WORKFLOW_PROJECT_NOT_FOUND','error','stateParams','startAttempt','resumeFrom','done','lastAttempt','from','listWorkflows','join','zlib','name','executePushProject','isFile','listProjects','replace','1771426NLyKSy','find','\x20workflow\x20files\x20found\x20in\x20project\x20directory','Project\x20directory\x20not\x20found:\x20','last_id','extract','killAttempt','resolveProjectId','listLogFiles','NUMERIC_ID_PATTERN','getAttempt','project','map','rawCount','kill','projectName','tdx-workflow-','applyPullProject','fromTask','20eTZoqn','access','11148651JNfNJO','latest','isGroup','filter','retryParams','sessions','workflowName','run','projects','tdx-workflow-push-','storeParams','sessionId','prepareCloneProject','bind','config','21QcJKbo','.\x20Expected\x20\x22project.workflow\x22','Invalid\x20workflow\x20format:\x20','length','No\x20'];a146_0x4fc9=function(){return _0x4315ee;};return a146_0x4fc9();}async function paginateResults(_0x4967e2,_0xaf6974,_0x5c5e91=0x64){const _0x5b3b28=a146_0x405b,_0x2542be=Math['min'](_0xaf6974,MAX_PAGINATION_LIMIT),_0x48a29a=[];let _0x2a3bf0;while(_0x48a29a['length']<_0x2542be){const _0x12ab3e=await _0x4967e2(_0x5c5e91,_0x2a3bf0),_0x4c210c=_0x12ab3e[_0x5b3b28(0x169)]??_0x12ab3e[_0x5b3b28(0x139)][_0x5b3b28(0x10a)];if(_0x4c210c===0x0)break;_0x48a29a['push'](..._0x12ab3e[_0x5b3b28(0x139)]);if(!_0x12ab3e[_0x5b3b28(0x118)]||_0x4c210c<_0x5c5e91)break;_0x2a3bf0=_0x12ab3e[_0x5b3b28(0x118)];}return _0x48a29a[_0x5b3b28(0x142)](0x0,_0x2542be);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a146_0x5fec8(0x165)]=/^\d+$/;['client'];constructor(_0x28e7eb){const _0x962df4=a146_0x5fec8;this[_0x962df4(0x127)]=new WorkflowApiClient(_0x28e7eb);}async['resolveProjectId'](_0x3913f6){const _0x2e16b6=a146_0x5fec8;if(WorkflowSDK['NUMERIC_ID_PATTERN']['test'](_0x3913f6)){const _0x53498c=await this[_0x2e16b6(0x127)]['getProject'](_0x3913f6);return{'id':_0x53498c['id'],'name':_0x53498c[_0x2e16b6(0x157)]};}const _0x2488e5=await this['client'][_0x2e16b6(0x15a)]({'name_pattern':_0x3913f6}),_0x29216c=_0x2488e5[_0x2e16b6(0x139)][_0x2e16b6(0x15d)](_0x3c46c2=>_0x3c46c2[_0x2e16b6(0x157)]===_0x3913f6);if(!_0x29216c)throw new SDKError(ErrorCode[_0x2e16b6(0x14c)],_0x2e16b6(0x110)+_0x3913f6);return{'id':_0x29216c['id'],'name':_0x29216c[_0x2e16b6(0x157)]};}async[a146_0x5fec8(0x100)](_0x457e88,_0x4e9ff2){const _0x24665f=a146_0x5fec8,_0x46cd53=_0x4e9ff2?.[_0x24665f(0x124)]||0x64,_0x506d7e=await paginateResults((_0x540a4c,_0x2fa460)=>this['client']['listProjects']({'name_pattern':_0x457e88,'limit':_0x540a4c,'last_id':_0x2fa460??_0x4e9ff2?.[_0x24665f(0x160)]}),_0x46cd53);return _0x506d7e[_0x24665f(0x168)](_0x2fc779=>({..._0x2fc779,'project_id':_0x2fc779['id'],'project_name':_0x2fc779[_0x24665f(0x157)]}));}async['workflows'](_0x41309d,_0x19f01d){const _0x47b803=a146_0x5fec8,_0x3a7fea=_0x19f01d?.[_0x47b803(0x124)]||0x64,_0x5cf79f=await paginateResults((_0x347c98,_0x44b775)=>this[_0x47b803(0x127)][_0x47b803(0x154)]({'project_name':_0x41309d,'limit':_0x347c98,'last_id':_0x44b775??_0x19f01d?.['last_id']}),_0x3a7fea);return _0x5cf79f[_0x47b803(0x168)](_0x2ac8f2=>({'project_id':_0x2ac8f2[_0x47b803(0x167)]?.['id'],'project_name':_0x2ac8f2['project']?.[_0x47b803(0x157)],'workflow_id':_0x2ac8f2['id'],'workflow_name':_0x2ac8f2[_0x47b803(0x157)],'revision':_0x2ac8f2['revision'],'timezone':_0x2ac8f2['timezone'],'config':_0x2ac8f2['config'],'id':_0x2ac8f2['id'],'name':_0x2ac8f2[_0x47b803(0x157)],'project':_0x2ac8f2[_0x47b803(0x167)]}));}async[a146_0x5fec8(0xfd)](_0x5f1702){const _0x41ca00=a146_0x5fec8;let _0xef318f;if(_0x5f1702?.[_0x41ca00(0x16b)]){let _0x592662,_0x42538e=![];while(!_0x42538e){const _0x466a7f=await this['client'][_0x41ca00(0x15a)]({'limit':0x64,'last_id':_0x592662}),_0x40bc7a=_0x466a7f[_0x41ca00(0x139)][_0x41ca00(0x15d)](_0x599209=>_0x599209[_0x41ca00(0x157)]===_0x5f1702[_0x41ca00(0x16b)]);if(_0x40bc7a){_0xef318f=_0x40bc7a['id'],_0x42538e=!![];break;}if(!_0x466a7f[_0x41ca00(0x118)]||_0x466a7f['data']['length']===0x0)break;_0x592662=_0x466a7f['lastId'];}if(!_0xef318f)throw new SDKError(ErrorCode[_0x41ca00(0x14c)],_0x41ca00(0x110)+_0x5f1702[_0x41ca00(0x16b)]);}const _0x6b2481=_0x5f1702?.[_0x41ca00(0x124)]||0x64,_0x1575ce=await paginateResults((_0x3528e2,_0x5e7824)=>this[_0x41ca00(0x127)][_0x41ca00(0x120)]({'project_id':_0xef318f,'project_name':_0x5f1702?.['projectName'],'workflow_name':_0x5f1702?.[_0x41ca00(0xfe)],'status':_0x5f1702?.['status'],'from_time':_0x5f1702?.['fromTime'],'to_time':_0x5f1702?.['toTime'],'limit':_0x3528e2,'last_id':_0x5e7824??_0x5f1702?.[_0x41ca00(0x160)]}),_0x6b2481);return _0x1575ce[_0x41ca00(0x168)](_0xf3acd0=>({'project_id':_0xf3acd0[_0x41ca00(0x167)]?.['id'],'project_name':_0xf3acd0[_0x41ca00(0x167)]?.[_0x41ca00(0x157)],'workflow_id':_0xf3acd0['workflow']?.['id'],'workflow_name':_0xf3acd0[_0x41ca00(0x133)]?.[_0x41ca00(0x157)],'session_id':_0xf3acd0['id'],'sessionUuid':_0xf3acd0[_0x41ca00(0x122)],'sessionTime':_0xf3acd0[_0x41ca00(0x10f)],'lastAttempt':_0xf3acd0[_0x41ca00(0x152)],'id':_0xf3acd0['id'],'project':_0xf3acd0[_0x41ca00(0x167)],'workflow':_0xf3acd0[_0x41ca00(0x133)]}));}async[a146_0x5fec8(0x11f)](_0x449b5b){const _0x1ab523=a146_0x5fec8,_0x50902e=_0x449b5b?.[_0x1ab523(0x124)]||0x64,_0x541ae8=await paginateResults((_0x2934f8,_0x3240d9)=>this['client'][_0x1ab523(0x14a)]({'project_name':_0x449b5b?.['projectName'],'workflow_name':_0x449b5b?.[_0x1ab523(0xfe)],'include_retried':_0x449b5b?.[_0x1ab523(0x11b)],'limit':_0x2934f8,'last_id':_0x3240d9??_0x449b5b?.[_0x1ab523(0x160)]}),_0x50902e);return _0x541ae8[_0x1ab523(0x168)](_0x4c4677=>({'project_id':_0x4c4677['project']?.['id'],'project_name':_0x4c4677[_0x1ab523(0x167)]?.['name'],'workflow_id':_0x4c4677[_0x1ab523(0x133)]?.['id'],'workflow_name':_0x4c4677[_0x1ab523(0x133)]?.[_0x1ab523(0x157)],'session_id':_0x4c4677[_0x1ab523(0x103)],'sessionUuid':_0x4c4677['sessionUuid'],'sessionTime':_0x4c4677[_0x1ab523(0x10f)],'attempt_id':_0x4c4677['id'],'attempt_index':_0x4c4677[_0x1ab523(0x117)],'retryAttemptName':_0x4c4677[_0x1ab523(0x125)],'done':_0x4c4677[_0x1ab523(0x151)],'success':_0x4c4677[_0x1ab523(0x10e)],'cancelRequested':_0x4c4677[_0x1ab523(0x115)],'params':_0x4c4677[_0x1ab523(0x138)],'createdAt':_0x4c4677['createdAt'],'finishedAt':_0x4c4677[_0x1ab523(0x112)],'id':_0x4c4677['id'],'index':_0x4c4677[_0x1ab523(0x117)],'project':_0x4c4677[_0x1ab523(0x167)],'workflow':_0x4c4677[_0x1ab523(0x133)]}));}async[a146_0x5fec8(0x144)](_0x5d8ef3){const _0x48a0a6=a146_0x5fec8,_0xea45c0=await this['client'][_0x48a0a6(0x166)](_0x5d8ef3);return _0xea45c0;}async[a146_0x5fec8(0x146)](_0x340d26,_0x3bf053=![]){const _0x421a28=a146_0x5fec8,_0x44d9ee=await this[_0x421a28(0x127)][_0x421a28(0x143)](_0x340d26,_0x3bf053);return _0x44d9ee[_0x421a28(0x168)](_0x4fc051=>({'task_id':_0x4fc051['id'],'task_name':_0x4fc051['fullName'],'parentId':_0x4fc051[_0x421a28(0x114)],'config':_0x4fc051[_0x421a28(0x106)],'upstreams':_0x4fc051[_0x421a28(0x13d)],'state':_0x4fc051['state'],'exportParams':_0x4fc051[_0x421a28(0x128)],'storeParams':_0x4fc051[_0x421a28(0x102)],'stateParams':_0x4fc051[_0x421a28(0x14e)],'updatedAt':_0x4fc051['updatedAt'],'retryAt':_0x4fc051['retryAt'],'startedAt':_0x4fc051[_0x421a28(0x10d)],'error':_0x4fc051[_0x421a28(0x14d)],'isGroup':_0x4fc051[_0x421a28(0xfa)],'id':_0x4fc051['id'],'fullName':_0x4fc051[_0x421a28(0x113)]}));}async['logFiles'](_0xd34855,_0x2632d8){const _0x57b2ce=a146_0x5fec8;return await this[_0x57b2ce(0x127)]['listLogFiles'](_0xd34855,_0x2632d8);}async[a146_0x5fec8(0x131)](_0x192970,_0x2b446a){const _0x878f16=a146_0x5fec8,_0x406507=await import(_0x878f16(0x156)),{promisify:_0x3e0a9c}=await import('util'),_0x592b2a=_0x3e0a9c(_0x406507['gunzip']),_0x312af5=await this[_0x878f16(0x127)][_0x878f16(0x164)](_0x192970,_0x2b446a);if(_0x312af5[_0x878f16(0x10a)]===0x0)return'';const _0x3f966d=[];for(const _0x261fc3 of _0x312af5){if(!_0x261fc3['direct'])continue;const _0x19b41b=await fetch(_0x261fc3[_0x878f16(0x12a)]);if(!_0x19b41b['ok'])throw new Error(_0x878f16(0x13c)+_0x19b41b[_0x878f16(0x13f)]);const _0x3e3cb0=Buffer[_0x878f16(0x153)](await _0x19b41b[_0x878f16(0x140)]()),_0x5197cf=await _0x592b2a(_0x3e3cb0);_0x3f966d[_0x878f16(0x111)](_0x5197cf['toString']('utf-8'));}return _0x3f966d[_0x878f16(0x155)]('\x0a');}async[a146_0x5fec8(0x16a)](_0x11381c,_0x29a49b){const _0x9f6b16=a146_0x5fec8,_0x33097d=await this[_0x9f6b16(0x127)][_0x9f6b16(0x162)](_0x11381c,_0x29a49b);return _0x33097d?.[_0x9f6b16(0x141)]??_0x9f6b16(0x12d);}async[a146_0x5fec8(0x135)](_0x1158d6,_0x14408c){const _0x5c4bf7=a146_0x5fec8,_0x22aac1=await this[_0x5c4bf7(0x127)][_0x5c4bf7(0x135)](_0x1158d6,{'from_task':_0x14408c?.[_0x5c4bf7(0x16e)],'retry_params':_0x14408c?.[_0x5c4bf7(0xfc)]});return{'attemptId':_0x22aac1['id'],'sessionId':_0x22aac1[_0x5c4bf7(0x103)]};}async[a146_0x5fec8(0x13b)](_0x1c8a24,_0x49e786){const _0x1960e1=a146_0x5fec8,_0x42d980=await this[_0x1960e1(0x127)]['retryAttempt'](_0x1c8a24,{'resume_from':_0x49e786?.[_0x1960e1(0x150)],'retry_params':_0x49e786?.[_0x1960e1(0xfc)],'force':_0x49e786?.[_0x1960e1(0x123)]});return{'attemptId':_0x42d980['id'],'sessionId':_0x42d980['sessionId']};}async[a146_0x5fec8(0xff)](_0x5a9388,_0x4ddb17={},_0x42d0a2){const _0x370f79=a146_0x5fec8,_0x3f3279=_0x5a9388['indexOf']('.');let _0x245bfb,_0x3000ff;if(_0x3f3279===-0x1)throw new Error(_0x370f79(0x121));_0x245bfb=_0x5a9388[_0x370f79(0x132)](0x0,_0x3f3279),_0x3000ff=_0x5a9388[_0x370f79(0x132)](_0x3f3279+0x1);if(!_0x245bfb||!_0x3000ff)throw new Error(_0x370f79(0x109)+_0x5a9388+_0x370f79(0x108));const _0x32bf3b=_0x42d0a2?.[_0x370f79(0x10f)]||new Date()[_0x370f79(0x10c)]();return await this[_0x370f79(0x127)][_0x370f79(0x14f)]({'projectName':_0x245bfb,'workflowName':_0x3000ff,'sessionTime':_0x32bf3b,'params':_0x4ddb17});}async[a146_0x5fec8(0x147)](_0x3a93a6,_0x1f7bdb,_0x1dbfe5){const _0x36a062=a146_0x5fec8,{promises:_0x358439}=await import('fs'),_0x1e7139=await import('path'),_0x366f90=await import('os'),_0x3dd684=await import(_0x36a062(0x145)),{id:_0x117fbe,name:_0x55021f}=await this[_0x36a062(0x163)](_0x3a93a6),_0x10d1f9=_0x366f90[_0x36a062(0x12e)](),_0x2f8be4=_0x1e7139[_0x36a062(0x155)](_0x10d1f9,_0x36a062(0x16c)+_0x117fbe+'-'+Date[_0x36a062(0x134)]()+'.tar.gz');try{await this[_0x36a062(0x127)][_0x36a062(0x11e)](_0x117fbe,_0x2f8be4,_0x1dbfe5?.[_0x36a062(0x11d)]);const _0x30674e=_0x1e7139['join'](_0x1f7bdb,_0x55021f);await _0x358439[_0x36a062(0x11c)](_0x30674e,{'recursive':!![]}),await _0x3dd684[_0x36a062(0x161)]({'file':_0x2f8be4,'cwd':_0x30674e,'gzip':!![]});const _0x54b57a=async _0x3057de=>{const _0x1bc2a9=_0x36a062;let _0x4dbd37=0x0;const _0x262d10=await _0x358439['readdir'](_0x3057de,{'withFileTypes':!![]});for(const _0x3f3f3f of _0x262d10){const _0x11a1f8=_0x1e7139[_0x1bc2a9(0x155)](_0x3057de,_0x3f3f3f[_0x1bc2a9(0x157)]);if(_0x3f3f3f[_0x1bc2a9(0x159)]())_0x4dbd37++;else _0x3f3f3f['isDirectory']()&&(_0x4dbd37+=await _0x54b57a(_0x11a1f8));}return _0x4dbd37;},_0x3f98b1=await _0x54b57a(_0x30674e);return{'projectName':_0x55021f,'revision':_0x1dbfe5?.[_0x36a062(0x11d)]||_0x36a062(0x172),'filesExtracted':_0x3f98b1};}finally{try{await _0x358439['unlink'](_0x2f8be4);}catch{}}}async['push'](_0x160edd,_0x5365e5){const _0x204369=a146_0x5fec8,{promises:_0x4273c5}=await import('fs'),_0x5d9b89=await import('path'),_0x2ab34f=await import('tar'),_0x4f9a80=_0x5365e5?.['projectName']||_0x5d9b89['basename'](_0x160edd),_0xb2700d=_0x5365e5?.[_0x204369(0x11d)]||new Date()[_0x204369(0x10c)]()[_0x204369(0x15b)](/[:.]/g,'-');try{await _0x4273c5[_0x204369(0x170)](_0x160edd);}catch{throw new Error(_0x204369(0x15f)+_0x160edd);}if(!_0x5365e5?.[_0x204369(0x129)]){const _0xa3aae9=await _0x4273c5['readdir'](_0x160edd),_0x2b193c=_0xa3aae9[_0x204369(0xfb)](_0x15d56b=>_0x15d56b['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x2b193c[_0x204369(0x10a)]===0x0)throw new Error(_0x204369(0x10b)+WORKFLOW_FILE_EXTENSION+_0x204369(0x15e));for(const _0x55a2b8 of _0x2b193c){const _0x1fc370=_0x5d9b89[_0x204369(0x155)](_0x160edd,_0x55a2b8);try{await _0x4273c5[_0x204369(0x170)](_0x1fc370);}catch{throw new Error(_0x204369(0x12c)+_0x55a2b8);}}}const _0x1dab8a=async(_0x183897,_0x5baec2='')=>{const _0x455124=_0x204369,_0x1ff83a=await _0x4273c5['readdir'](_0x183897,{'withFileTypes':!![]}),_0x566b34=[];for(const _0x156d73 of _0x1ff83a){const _0x721110=_0x5d9b89[_0x455124(0x155)](_0x5baec2,_0x156d73[_0x455124(0x157)]),_0x4297f0=_0x5d9b89[_0x455124(0x155)](_0x183897,_0x156d73[_0x455124(0x157)]);if(!shouldIncludeInArchive(_0x156d73['name']))continue;_0x156d73[_0x455124(0x119)]()?_0x566b34[_0x455124(0x111)](...await _0x1dab8a(_0x4297f0,_0x721110)):_0x566b34[_0x455124(0x111)](_0x721110);}return _0x566b34;},_0x17d860=await _0x1dab8a(_0x160edd),_0x2926cd=await import('os'),_0x4cbd4e=_0x2926cd[_0x204369(0x12e)](),_0x4956dc=_0x5d9b89[_0x204369(0x155)](_0x4cbd4e,_0x204369(0x101)+Date[_0x204369(0x134)]()+'.tar.gz');try{await _0x2ab34f['create']({'file':_0x4956dc,'gzip':!![],'cwd':_0x160edd,'portable':!![]},_0x17d860);const _0x5566cf=await this['client'][_0x204369(0x126)](_0x4f9a80,_0xb2700d,_0x4956dc,{'scheduleFrom':_0x5365e5?.['scheduleFrom'],'clearSchedule':_0x5365e5?.['clearSchedule'],'clearScheduleAll':_0x5365e5?.[_0x204369(0x130)]});return{'projectId':_0x5566cf['id'],'projectName':_0x5566cf['name'],'revision':_0x5566cf['revision']};}finally{try{await _0x4273c5['unlink'](_0x4956dc);}catch{}}}async[a146_0x5fec8(0x149)](_0x145c22){const _0x2daffa=a146_0x5fec8,{id:_0x57c416}=await this[_0x2daffa(0x163)](_0x145c22),_0x46d6a0=await this[_0x2daffa(0x127)][_0x2daffa(0x148)](_0x57c416);return{'projectId':_0x46d6a0['id'],'projectName':_0x46d6a0[_0x2daffa(0x157)]};}async['listSecrets'](_0x3823f6){const _0x40e628=a146_0x5fec8,{id:_0x1c663c,name:_0x33c772}=await this['resolveProjectId'](_0x3823f6),_0x1a9575=await this[_0x40e628(0x127)][_0x40e628(0x13a)](_0x1c663c);return{'projectName':_0x33c772,'secrets':_0x1a9575};}async[a146_0x5fec8(0x11a)](_0x6e74ae,_0x9e9827,_0x26f108){const _0x216fad=a146_0x5fec8,{id:_0x448767,name:_0xeddf9d}=await this[_0x216fad(0x163)](_0x6e74ae);return await this[_0x216fad(0x127)][_0x216fad(0x11a)](_0x448767,_0x9e9827,_0x26f108),{'projectName':_0xeddf9d,'key':_0x9e9827};}async[a146_0x5fec8(0x12b)](_0x374ee8,_0x60e7b){const _0x4af6aa=a146_0x5fec8,{id:_0x2b0101,name:_0x23846d}=await this[_0x4af6aa(0x163)](_0x374ee8);return await this[_0x4af6aa(0x127)][_0x4af6aa(0x12b)](_0x2b0101,_0x60e7b),{'projectName':_0x23846d,'key':_0x60e7b};}async['pullProject'](_0x31aceb,_0x49330a){const _0x324ed6=a146_0x5fec8;return pullWorkflow({'client':this['client'],'resolveProjectId':this[_0x324ed6(0x163)][_0x324ed6(0x105)](this)},_0x31aceb,_0x49330a);}async[a146_0x5fec8(0x16d)](_0x54fda7,_0x3e8070){const _0xae99ae=a146_0x5fec8;return applyPullResult({'client':this[_0xae99ae(0x127)],'resolveProjectId':this[_0xae99ae(0x163)][_0xae99ae(0x105)](this)},_0x54fda7,_0x3e8070);}async[a146_0x5fec8(0x116)](_0x4064e9){const _0x436507=a146_0x5fec8;return preparePushWorkflow({'client':this[_0x436507(0x127)],'resolveProjectId':this[_0x436507(0x163)][_0x436507(0x105)](this)},_0x4064e9);}async[a146_0x5fec8(0x158)](_0x124136){const _0x367a0f=a146_0x5fec8;return executePushWorkflow({'client':this[_0x367a0f(0x127)],'resolveProjectId':this['resolveProjectId'][_0x367a0f(0x105)](this)},_0x124136);}async[a146_0x5fec8(0x104)](_0x433573,_0x21af13,_0xfb6287){const _0x1df202=a146_0x5fec8;return prepareCloneWorkflow({'client':this[_0x1df202(0x127)]},_0x433573,_0x21af13,_0xfb6287);}async['executeCloneProject'](_0x493031){return executeCloneWorkflow({'client':this['client']},_0x493031);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x2df573,_0x257e25){const _0xe14210=a147_0x2a38,_0x215bec=_0x2df573();while(!![]){try{const _0x382635=-parseInt(_0xe14210(0x82))/0x1*(-parseInt(_0xe14210(0xac))/0x2)+parseInt(_0xe14210(0x88))/0x3+parseInt(_0xe14210(0xaa))/0x4*(-parseInt(_0xe14210(0x90))/0x5)+parseInt(_0xe14210(0x96))/0x6+-parseInt(_0xe14210(0xa1))/0x7*(parseInt(_0xe14210(0xb6))/0x8)+parseInt(_0xe14210(0xb0))/0x9+parseInt(_0xe14210(0xb1))/0xa;if(_0x382635===_0x257e25)break;else _0x215bec['push'](_0x215bec['shift']());}catch(_0x5f2213){_0x215bec['push'](_0x215bec['shift']());}}}(a147_0x2387,0x629d8));import{existsSync,promises as a147_0x2590c6}from'fs';import a147_0x3c4f18 from'path';import a147_0x2365d3 from'os';function a147_0x2a38(_0x362a4f,_0x231589){_0x362a4f=_0x362a4f-0x7d;const _0x2387fd=a147_0x2387();let _0x2a380a=_0x2387fd[_0x362a4f];return _0x2a380a;}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(_0x77d7d3,_0x37107d,_0x4d0fe4={}){const _0x32a0e0=a147_0x2a38,_0x3d0521=await import(_0x32a0e0(0x7f)),{client:_0xff5c01,resolveProjectId:_0x2f94a4}=_0x77d7d3,{id:_0x4c3e98,name:_0x570c40}=await _0x2f94a4(_0x37107d),_0x46d854=_0x4d0fe4[_0x32a0e0(0x8d)]||process[_0x32a0e0(0x97)](),_0x1a27a2=_0x4d0fe4[_0x32a0e0(0xb4)]||getWorkflowProjectDir(_0x570c40,_0x46d854),_0x2af90d=a147_0x3c4f18[_0x32a0e0(0xae)](_0x1a27a2,_0x32a0e0(0xaf)),_0x1db2ff=!existsSync(_0x2af90d),_0x4ba638=await a147_0x2590c6[_0x32a0e0(0xad)](a147_0x3c4f18[_0x32a0e0(0xae)](a147_0x2365d3['tmpdir'](),'tdx-wf-pull-')),_0x13da47=a147_0x3c4f18[_0x32a0e0(0xae)](_0x4ba638,_0x32a0e0(0x86)),_0x361cd5=a147_0x3c4f18['join'](_0x4ba638,_0x32a0e0(0x94));try{await _0xff5c01['downloadProjectArchive'](_0x4c3e98,_0x13da47,_0x4d0fe4[_0x32a0e0(0xa3)]),await a147_0x2590c6[_0x32a0e0(0xa0)](_0x361cd5,{'recursive':!![]});try{await _0x3d0521[_0x32a0e0(0xa5)]({'file':_0x13da47,'cwd':_0x361cd5,'gzip':!![]});}catch(_0x26f5a5){const _0x3ea634=_0x26f5a5 instanceof Error?_0x26f5a5[_0x32a0e0(0x85)]:String(_0x26f5a5);if(_0x3ea634[_0x32a0e0(0xab)](_0x32a0e0(0x84))||_0x3ea634[_0x32a0e0(0xab)](_0x32a0e0(0x8e))){const _0x1c25ab=await a147_0x2590c6[_0x32a0e0(0x8a)](_0x13da47)[_0x32a0e0(0x9d)](()=>null),_0x2698fd=_0x1c25ab?_0x32a0e0(0xa8)+_0x1c25ab[_0x32a0e0(0x98)]+_0x32a0e0(0x80):'';throw new SDKError(ErrorCode[_0x32a0e0(0x9b)],'Failed\x20to\x20extract\x20project\x20archive'+_0x2698fd+':\x20'+_0x3ea634,_0x26f5a5,{'helpText':_0x32a0e0(0xb7)+'The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.'});}throw _0x26f5a5;}const _0x462669=await _0xff5c01[_0x32a0e0(0x9e)](_0x4c3e98),_0x114afd=_0x4d0fe4['revision']||_0x462669[_0x32a0e0(0xa3)]||_0x32a0e0(0x95),_0x1cb98a=await calculateChanges(_0x1a27a2,_0x361cd5,_0x1db2ff),_0xf1a3c4={'new':_0x1cb98a[_0x32a0e0(0x9f)](_0x19af4a=>_0x19af4a['type']===_0x32a0e0(0xa7))[_0x32a0e0(0xb5)],'modified':_0x1cb98a[_0x32a0e0(0x9f)](_0x303873=>_0x303873[_0x32a0e0(0x7d)]===_0x32a0e0(0xb8))[_0x32a0e0(0xb5)],'deleted':_0x1cb98a[_0x32a0e0(0x9f)](_0x22f121=>_0x22f121[_0x32a0e0(0x7d)]===_0x32a0e0(0xa6))[_0x32a0e0(0xb5)],'unchanged':_0x1cb98a['filter'](_0x1c9c9c=>_0x1c9c9c[_0x32a0e0(0x7d)]==='unchanged')[_0x32a0e0(0xb5)]};return{'projectName':_0x570c40,'projectId':_0x4c3e98,'revision':_0x114afd,'targetDir':_0x1a27a2,'changes':_0x1cb98a,'summary':_0xf1a3c4,'hasChanges':_0xf1a3c4[_0x32a0e0(0xa7)]>0x0||_0xf1a3c4[_0x32a0e0(0xb8)]>0x0||_0xf1a3c4[_0x32a0e0(0xa6)]>0x0,'isNewProject':_0x1db2ff};}finally{await a147_0x2590c6['rm'](_0x4ba638,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0x3b16b3,_0x51735d,_0x1eb9fa={}){const _0x356333=a147_0x2a38,_0x490aa5=await import('tar'),{client:_0x2fa948}=_0x3b16b3,_0xb18a83=await a147_0x2590c6[_0x356333(0xad)](a147_0x3c4f18[_0x356333(0xae)](a147_0x2365d3[_0x356333(0x91)](),_0x356333(0x83))),_0x147199=a147_0x3c4f18[_0x356333(0xae)](_0xb18a83,_0x356333(0x86));try{await _0x2fa948[_0x356333(0x92)](_0x51735d['projectId'],_0x147199,_0x1eb9fa[_0x356333(0xa3)]),await a147_0x2590c6['mkdir'](_0x51735d['targetDir'],{'recursive':!![]});for(const _0x1e8e3c of _0x51735d[_0x356333(0xa9)]){if(_0x1e8e3c[_0x356333(0x7d)]===_0x356333(0xa6)){const _0x2e9c09=a147_0x3c4f18[_0x356333(0xae)](_0x51735d['targetDir'],_0x1e8e3c['path']);await a147_0x2590c6['unlink'](_0x2e9c09)[_0x356333(0x9d)](()=>{});}}try{await _0x490aa5[_0x356333(0xa5)]({'file':_0x147199,'cwd':_0x51735d[_0x356333(0xb4)],'gzip':!![]});}catch(_0x3cf597){const _0x3b51af=_0x3cf597 instanceof Error?_0x3cf597[_0x356333(0x85)]:String(_0x3cf597);if(_0x3b51af[_0x356333(0xab)](_0x356333(0x84))||_0x3b51af[_0x356333(0xab)]('zlib')){const _0x469590=await a147_0x2590c6[_0x356333(0x8a)](_0x147199)['catch'](()=>null),_0x4a7307=_0x469590?_0x356333(0xa8)+_0x469590['size']+_0x356333(0x80):'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x356333(0xb2)+_0x4a7307+':\x20'+_0x3b51af,_0x3cf597,{'helpText':_0x356333(0xb7)+'The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.'});}throw _0x3cf597;}const _0x5dd92a=a147_0x3c4f18[_0x356333(0xae)](_0x51735d[_0x356333(0xb4)],_0x356333(0xaf));if(_0x51735d[_0x356333(0xa4)]){const _0x4335a9=createWorkflowTdxConfigContent(_0x51735d[_0x356333(0x89)],_0x51735d['projectId'],_0x51735d[_0x356333(0xa3)]);await a147_0x2590c6[_0x356333(0x9c)](_0x5dd92a,_0x4335a9,'utf-8');}else updateWorkflowTdxConfig(_0x5dd92a,{'last_pulled_revision':_0x51735d[_0x356333(0xa3)],'last_pulled_at':new Date()[_0x356333(0xa2)]()});}finally{await a147_0x2590c6['rm'](_0xb18a83,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x43265e,_0x1b70fe,_0x5b915b){const _0x4df5b3=a147_0x2a38,_0x1edafc=[],_0x52a80e=await getAllFiles(_0x1b70fe),_0x2331af=existsSync(_0x43265e)?await getAllFiles(_0x43265e):new Set();for(const _0x33e6ec of _0x52a80e){const _0x223aba=a147_0x3c4f18[_0x4df5b3(0xae)](_0x43265e,_0x33e6ec),_0x2c9d41=a147_0x3c4f18[_0x4df5b3(0xae)](_0x1b70fe,_0x33e6ec);if(_0x33e6ec===_0x4df5b3(0xaf))continue;const _0x21b977=await a147_0x2590c6[_0x4df5b3(0x99)](_0x2c9d41,_0x4df5b3(0x8c))[_0x4df5b3(0x9d)](()=>null);if(_0x21b977===null)continue;if(!existsSync(_0x223aba)||_0x5b915b)_0x1edafc[_0x4df5b3(0x8f)]({'path':_0x33e6ec,'type':_0x4df5b3(0xa7),'newContent':_0x21b977});else{const _0x3685c1=await a147_0x2590c6[_0x4df5b3(0x99)](_0x223aba,_0x4df5b3(0x8c))[_0x4df5b3(0x9d)](()=>null);if(_0x3685c1===null)_0x1edafc[_0x4df5b3(0x8f)]({'path':_0x33e6ec,'type':'modified','newContent':_0x21b977});else{if(_0x3685c1!==_0x21b977){const _0x38b34e=generateDiff(_0x3685c1,_0x21b977),_0x1e7338=hasChanges(_0x38b34e)?formatDiffWithColors(_0x38b34e):undefined;_0x1edafc[_0x4df5b3(0x8f)]({'path':_0x33e6ec,'type':'modified','oldContent':_0x3685c1,'newContent':_0x21b977,'diff':_0x1e7338});}else _0x1edafc[_0x4df5b3(0x8f)]({'path':_0x33e6ec,'type':'unchanged'});}}}if(!_0x5b915b)for(const _0x29bde4 of _0x2331af){if(_0x29bde4===_0x4df5b3(0xaf))continue;if(!_0x52a80e['has'](_0x29bde4)){const _0x24cc15=a147_0x3c4f18[_0x4df5b3(0xae)](_0x43265e,_0x29bde4),_0x5e8be6=await a147_0x2590c6['readFile'](_0x24cc15,'utf-8')[_0x4df5b3(0x9d)](()=>undefined);_0x1edafc['push']({'path':_0x29bde4,'type':'deleted','oldContent':_0x5e8be6});}}return _0x1edafc[_0x4df5b3(0x9a)]((_0x5371a4,_0x516c43)=>_0x5371a4[_0x4df5b3(0x93)][_0x4df5b3(0x8b)](_0x516c43['path'])),_0x1edafc;}async function getAllFiles(_0x335f2e,_0x5f00ad=''){const _0x353136=a147_0x2a38,_0x1cfe28=new Set();if(!existsSync(_0x335f2e))return _0x1cfe28;const _0x1b44d0=await a147_0x2590c6[_0x353136(0xb3)](_0x335f2e,{'withFileTypes':!![]});for(const _0x3dfd52 of _0x1b44d0){const _0x25fe9f=_0x5f00ad?a147_0x3c4f18[_0x353136(0xae)](_0x5f00ad,_0x3dfd52['name']):_0x3dfd52['name'];if(_0x3dfd52[_0x353136(0x81)]()){const _0x411169=await getAllFiles(a147_0x3c4f18['join'](_0x335f2e,_0x3dfd52[_0x353136(0x87)]),_0x25fe9f);for(const _0x80a120 of _0x411169){_0x1cfe28[_0x353136(0x7e)](_0x80a120);}}else _0x1cfe28[_0x353136(0x7e)](_0x25fe9f);}return _0x1cfe28;}function a147_0x2387(){const _0x58abb5=['isDirectory','3nnEklc','tdx-wf-apply-','TAR_BAD_ARCHIVE','message','archive.tar.gz','name','1215840fzrRns','projectName','stat','localeCompare','utf-8','baseDir','zlib','push','165OeaBZa','tmpdir','downloadProjectArchive','path','extracted','latest','2148378ZMBePL','cwd','size','readFile','sort','WORKFLOW_ARCHIVE_CORRUPTED','writeFile','catch','getProject','filter','mkdir','7oYbOvo','toISOString','revision','isNewProject','extract','deleted','new','\x20(archive\x20size:\x20','changes','44844sVhXHk','includes','105524WfYDKe','mkdtemp','join','tdx.json','1052316ZORXZR','2319720UIbHmL','Failed\x20to\x20extract\x20project\x20archive','readdir','targetDir','length','3973072EXmCeZ','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','modified','type','add','tar','\x20bytes)'];a147_0x2387=function(){return _0x58abb5;};return a147_0x2387();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a148_0x93b9(_0x23987f,_0x3180b2){_0x23987f=_0x23987f-0x1a9;const _0x543e45=a148_0x543e();let _0x93b9e9=_0x543e45[_0x23987f];return _0x93b9e9;}(function(_0x30a014,_0x39e05e){const _0x37c67e=a148_0x93b9,_0x4c6ec0=_0x30a014();while(!![]){try{const _0x2d1d64=-parseInt(_0x37c67e(0x1b5))/0x1*(parseInt(_0x37c67e(0x1ad))/0x2)+parseInt(_0x37c67e(0x1ac))/0x3*(parseInt(_0x37c67e(0x1c3))/0x4)+parseInt(_0x37c67e(0x1c6))/0x5+-parseInt(_0x37c67e(0x1de))/0x6*(-parseInt(_0x37c67e(0x1cf))/0x7)+-parseInt(_0x37c67e(0x1b6))/0x8*(parseInt(_0x37c67e(0x1ba))/0x9)+parseInt(_0x37c67e(0x1a9))/0xa*(-parseInt(_0x37c67e(0x1e6))/0xb)+parseInt(_0x37c67e(0x1bb))/0xc;if(_0x2d1d64===_0x39e05e)break;else _0x4c6ec0['push'](_0x4c6ec0['shift']());}catch(_0x322ccb){_0x4c6ec0['push'](_0x4c6ec0['shift']());}}}(a148_0x543e,0xc2fe6));import{promises as a148_0x5bb96c}from'fs';import a148_0x268258 from'path';import a148_0xd0b9b1 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';function a148_0x543e(){const _0x55a66c=['tmpdir','name','isDirectory','has','28444LDGnFX','mkdtemp','configPath','4009515HVwhCp','sourceDir','length','zlib','\x20bytes)','skipValidation','toISOString','\x20(archive\x20size:\x20','stat','875DIgxPK','TAR_BAD_ARCHIVE','configResult','push','includes','replace','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','archive.tar.gz','size','extracted','tdx.json','modified','localeCompare','path','Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison','72378ttWgkB','catch','tar','workflow_project','join','projectName','new','type','75515rWmbUH','2290BxiMQd','mkdir','posix','102oTmQsC','3470daGVbQ','\x20workflow\x20files\x20found\x20in\x20','cwd','readdir','filter','revision','create','downloadProjectArchive','555CNYJnv','136EtmZnB','readFile','unchanged','utf-8','755478sfEeWO','26509992CCgnEj','.digdagignore','WORKFLOW_ARCHIVE_CORRUPTED','deleted'];a148_0x543e=function(){return _0x55a66c;};return a148_0x543e();}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';import{SDKError,ErrorCode}from'../errors.js';export async function preparePushWorkflow(_0x3e1921,_0x1c83a2={}){const _0x50bfef=a148_0x93b9,_0x39fdca=await import('tar'),{client:_0x23f9dc,resolveProjectId:_0x1c791d}=_0x3e1921,_0x30f5fb=_0x1c83a2[_0x50bfef(0x1c7)]||process[_0x50bfef(0x1af)](),_0x3119f0=findWorkflowTdxConfig(_0x30f5fb),{config:_0x5a3ec5,configDir:_0x82402c}=_0x3119f0;let _0x3dae36,_0xf0c2ee=_0x5a3ec5[_0x50bfef(0x1e1)];try{const _0x2ef606=await _0x1c791d(_0x5a3ec5[_0x50bfef(0x1e1)]);_0x3dae36=_0x2ef606['id'],_0xf0c2ee=_0x2ef606[_0x50bfef(0x1c0)];}catch{_0x3dae36='';}const _0x1ad2f4=_0x1c83a2[_0x50bfef(0x1b2)]||new Date()[_0x50bfef(0x1cc)]()[_0x50bfef(0x1d4)](/[:.]/g,'-');if(!_0x1c83a2[_0x50bfef(0x1cb)]){const _0x346cac=await a148_0x5bb96c['readdir'](_0x82402c),_0x56a9af=_0x346cac[_0x50bfef(0x1b1)](_0xc929d9=>_0xc929d9['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x56a9af['length']===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+_0x50bfef(0x1ae)+_0x82402c);}const _0x1cc0ed=await getProjectFiles(_0x82402c);let _0x1c368f;if(_0x3dae36){const _0xb0ccf1=await a148_0x5bb96c[_0x50bfef(0x1c4)](a148_0x268258['join'](a148_0xd0b9b1[_0x50bfef(0x1bf)](),'tdx-wf-push-')),_0x872ce2=a148_0x268258[_0x50bfef(0x1e2)](_0xb0ccf1,_0x50bfef(0x1d6)),_0x20654a=a148_0x268258[_0x50bfef(0x1e2)](_0xb0ccf1,_0x50bfef(0x1d8));try{await _0x23f9dc[_0x50bfef(0x1b4)](_0x3dae36,_0x872ce2),await a148_0x5bb96c[_0x50bfef(0x1aa)](_0x20654a,{'recursive':!![]});try{await _0x39fdca['extract']({'file':_0x872ce2,'cwd':_0x20654a,'gzip':!![]});}catch(_0x174c67){const _0x2bea09=_0x174c67 instanceof Error?_0x174c67['message']:String(_0x174c67);if(_0x2bea09['includes'](_0x50bfef(0x1d0))||_0x2bea09[_0x50bfef(0x1d3)](_0x50bfef(0x1c9))){const _0x2d4d77=await a148_0x5bb96c[_0x50bfef(0x1ce)](_0x872ce2)[_0x50bfef(0x1df)](()=>null),_0x3cdd7b=_0x2d4d77?_0x50bfef(0x1cd)+_0x2d4d77[_0x50bfef(0x1d7)]+_0x50bfef(0x1ca):'';throw new SDKError(ErrorCode[_0x50bfef(0x1bd)],_0x50bfef(0x1dd)+_0x3cdd7b+':\x20'+_0x2bea09,_0x174c67,{'helpText':_0x50bfef(0x1d5)});}throw _0x174c67;}_0x1c368f=await calculatePushChanges(_0x82402c,_0x20654a,_0x1cc0ed);}finally{await a148_0x5bb96c['rm'](_0xb0ccf1,{'recursive':!![],'force':!![]});}}else{_0x1c368f=[];for(const _0x2c170b of _0x1cc0ed){const _0x386fdb=a148_0x268258[_0x50bfef(0x1e2)](_0x82402c,_0x2c170b),_0x13ab26=await a148_0x5bb96c[_0x50bfef(0x1b7)](_0x386fdb,_0x50bfef(0x1b9))[_0x50bfef(0x1df)](()=>null);_0x1c368f[_0x50bfef(0x1d2)]({'path':_0x2c170b,'type':'new','newContent':_0x13ab26||undefined});}}const _0x4629fb={'new':_0x1c368f[_0x50bfef(0x1b1)](_0x7667c3=>_0x7667c3['type']==='new')[_0x50bfef(0x1c8)],'modified':_0x1c368f[_0x50bfef(0x1b1)](_0x2e54b3=>_0x2e54b3[_0x50bfef(0x1e5)]==='modified')[_0x50bfef(0x1c8)],'deleted':_0x1c368f['filter'](_0x2f6e88=>_0x2f6e88['type']==='deleted')[_0x50bfef(0x1c8)],'unchanged':_0x1c368f[_0x50bfef(0x1b1)](_0x1ef0e7=>_0x1ef0e7[_0x50bfef(0x1e5)]===_0x50bfef(0x1b8))[_0x50bfef(0x1c8)]};return{'projectName':_0xf0c2ee,'projectId':_0x3dae36,'revision':_0x1ad2f4,'sourceDir':_0x82402c,'changes':_0x1c368f,'summary':_0x4629fb,'hasChanges':_0x4629fb[_0x50bfef(0x1e4)]>0x0||_0x4629fb[_0x50bfef(0x1da)]>0x0||_0x4629fb['deleted']>0x0,'configResult':_0x3119f0};}export async function executePushWorkflow(_0x54240d,_0x46ff42){const _0x3bcf56=a148_0x93b9,_0x106ce2=await import(_0x3bcf56(0x1e0)),{client:_0x21e136}=_0x54240d,_0x5ea7cd=await getProjectFiles(_0x46ff42[_0x3bcf56(0x1c7)]),_0xeb2989=await a148_0x5bb96c[_0x3bcf56(0x1c4)](a148_0x268258[_0x3bcf56(0x1e2)](a148_0xd0b9b1[_0x3bcf56(0x1bf)](),'tdx-wf-push-archive-')),_0x28fa55=a148_0x268258['join'](_0xeb2989,_0x3bcf56(0x1d6));try{await _0x106ce2[_0x3bcf56(0x1b3)]({'file':_0x28fa55,'gzip':!![],'cwd':_0x46ff42[_0x3bcf56(0x1c7)],'portable':!![]},_0x5ea7cd);const _0x43f70f=await _0x21e136['uploadProjectArchive'](_0x46ff42[_0x3bcf56(0x1e3)],_0x46ff42['revision'],_0x28fa55);return updateWorkflowTdxConfig(_0x46ff42[_0x3bcf56(0x1d1)][_0x3bcf56(0x1c5)],{'workflow_project_id':_0x43f70f['id'],'last_pushed_revision':_0x43f70f[_0x3bcf56(0x1b2)],'last_pushed_at':new Date()['toISOString']()}),{'projectId':_0x43f70f['id'],'projectName':_0x43f70f[_0x3bcf56(0x1c0)],'revision':_0x43f70f['revision']};}finally{await a148_0x5bb96c['rm'](_0xeb2989,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x32d924,_0x45a336=_0x32d924,_0x105d94='',_0x2aadef=null){const _0x1d564e=a148_0x93b9,_0x471d71=[];if(_0x2aadef===null){_0x2aadef=createIgnoreInstance();const _0x11a904=await loadDigdagignore(_0x32d924);_0x11a904&&_0x2aadef['add'](_0x11a904);}if(_0x105d94!==''){const _0x106940=await loadDigdagignore(_0x45a336);_0x106940&&addScopedPatterns(_0x2aadef,_0x106940,_0x105d94);}const _0x3498dd=await a148_0x5bb96c[_0x1d564e(0x1b0)](_0x45a336,{'withFileTypes':!![]});for(const _0x27cbae of _0x3498dd){const _0x34f1e8=_0x105d94?a148_0x268258[_0x1d564e(0x1ab)][_0x1d564e(0x1e2)](_0x105d94,_0x27cbae[_0x1d564e(0x1c0)]):_0x27cbae[_0x1d564e(0x1c0)];if(_0x27cbae['name']===_0x1d564e(0x1d9))continue;if(_0x27cbae['name']===_0x1d564e(0x1bc))continue;if(!shouldIncludeInArchive(_0x27cbae[_0x1d564e(0x1c0)]))continue;if(shouldIgnoreWithInstance(_0x2aadef,_0x34f1e8,_0x27cbae[_0x1d564e(0x1c1)]()))continue;if(_0x27cbae[_0x1d564e(0x1c1)]()){const _0x16b427=await getProjectFiles(_0x32d924,a148_0x268258[_0x1d564e(0x1e2)](_0x45a336,_0x27cbae[_0x1d564e(0x1c0)]),_0x34f1e8,_0x2aadef);_0x471d71[_0x1d564e(0x1d2)](..._0x16b427);}else _0x471d71[_0x1d564e(0x1d2)](_0x34f1e8);}return _0x471d71;}async function calculatePushChanges(_0x16fa83,_0x1b57e9,_0x5049f2){const _0x1586b6=a148_0x93b9,_0x4f5ca6=[],_0x13be92=new Set(await getProjectFiles(_0x1b57e9));for(const _0x2d67d5 of _0x5049f2){const _0x4aaa75=a148_0x268258['join'](_0x16fa83,_0x2d67d5),_0x53444e=a148_0x268258[_0x1586b6(0x1e2)](_0x1b57e9,_0x2d67d5),_0x53baca=await a148_0x5bb96c[_0x1586b6(0x1b7)](_0x4aaa75,'utf-8')['catch'](()=>null);if(_0x53baca===null)continue;if(!_0x13be92[_0x1586b6(0x1c2)](_0x2d67d5))_0x4f5ca6[_0x1586b6(0x1d2)]({'path':_0x2d67d5,'type':_0x1586b6(0x1e4),'newContent':_0x53baca});else{const _0x69665a=await a148_0x5bb96c['readFile'](_0x53444e,_0x1586b6(0x1b9))['catch'](()=>null);if(_0x69665a===null)_0x4f5ca6['push']({'path':_0x2d67d5,'type':_0x1586b6(0x1da),'newContent':_0x53baca});else{if(_0x69665a!==_0x53baca){const _0x347297=generateDiff(_0x69665a,_0x53baca),_0x5ecb5c=hasChanges(_0x347297)?formatDiffWithColors(_0x347297):undefined;_0x4f5ca6[_0x1586b6(0x1d2)]({'path':_0x2d67d5,'type':'modified','oldContent':_0x69665a,'newContent':_0x53baca,'diff':_0x5ecb5c});}else _0x4f5ca6[_0x1586b6(0x1d2)]({'path':_0x2d67d5,'type':'unchanged'});}}}for(const _0x2973bb of _0x13be92){if(!_0x5049f2[_0x1586b6(0x1d3)](_0x2973bb)){const _0x5c6a4e=a148_0x268258[_0x1586b6(0x1e2)](_0x1b57e9,_0x2973bb),_0xd4a708=await a148_0x5bb96c['readFile'](_0x5c6a4e,'utf-8')[_0x1586b6(0x1df)](()=>undefined);_0x4f5ca6[_0x1586b6(0x1d2)]({'path':_0x2973bb,'type':_0x1586b6(0x1be),'oldContent':_0xd4a708});}}return _0x4f5ca6['sort']((_0x304912,_0x9c3916)=>_0x304912[_0x1586b6(0x1dc)][_0x1586b6(0x1db)](_0x9c3916[_0x1586b6(0x1dc)])),_0x4f5ca6;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a149_0x12720f=a149_0x2e24;(function(_0x57781e,_0x38f85c){const _0x5cf76f=a149_0x2e24,_0x19a541=_0x57781e();while(!![]){try{const _0x4857a8=-parseInt(_0x5cf76f(0xc7))/0x1+parseInt(_0x5cf76f(0xbc))/0x2*(parseInt(_0x5cf76f(0xcc))/0x3)+parseInt(_0x5cf76f(0xc5))/0x4*(-parseInt(_0x5cf76f(0xc6))/0x5)+-parseInt(_0x5cf76f(0xbf))/0x6+parseInt(_0x5cf76f(0xc1))/0x7+-parseInt(_0x5cf76f(0xcb))/0x8*(-parseInt(_0x5cf76f(0xb5))/0x9)+parseInt(_0x5cf76f(0xc2))/0xa*(parseInt(_0x5cf76f(0xb6))/0xb);if(_0x4857a8===_0x38f85c)break;else _0x19a541['push'](_0x19a541['shift']());}catch(_0x48e2f3){_0x19a541['push'](_0x19a541['shift']());}}}(a149_0x4290,0x91587));function a149_0x2e24(_0x40be53,_0x84c1fc){_0x40be53=_0x40be53-0xae;const _0x429013=a149_0x4290();let _0x2e2417=_0x429013[_0x40be53];return _0x2e2417;}import{existsSync,readFileSync,writeFileSync}from'fs';import a149_0x15015c from'path';const TDX_CONFIG_FILE=a149_0x12720f(0xb7),WORKFLOWS_DIR=a149_0x12720f(0xba);export function findWorkflowTdxConfigPath(_0x55cb92=process[a149_0x12720f(0xc8)]()){const _0x3f8664=a149_0x12720f;let _0x35a3cc=a149_0x15015c[_0x3f8664(0xaf)](_0x55cb92);const _0x2e6507=a149_0x15015c[_0x3f8664(0xbb)](_0x35a3cc)[_0x3f8664(0xca)];while(_0x35a3cc!==_0x2e6507){const _0x3c72d6=a149_0x15015c[_0x3f8664(0xc9)](_0x35a3cc,TDX_CONFIG_FILE);if(existsSync(_0x3c72d6))try{const _0x3e8d25=readFileSync(_0x3c72d6,'utf-8'),_0x3a3772=JSON[_0x3f8664(0xbb)](_0x3e8d25);if(_0x3a3772&&typeof _0x3a3772===_0x3f8664(0xb1)&&_0x3f8664(0xc4)in _0x3a3772)return _0x3c72d6;}catch{}_0x35a3cc=a149_0x15015c[_0x3f8664(0xb0)](_0x35a3cc);}return null;}export function loadWorkflowTdxConfig(_0x5dc592){const _0x3dfd81=a149_0x12720f,_0xea9601=readFileSync(_0x5dc592,'utf-8');let _0x4ea0fd;try{_0x4ea0fd=JSON[_0x3dfd81(0xbb)](_0xea9601);}catch{throw new Error(_0x3dfd81(0xc0)+_0x5dc592);}if(!_0x4ea0fd||typeof _0x4ea0fd!==_0x3dfd81(0xb1))throw new Error(_0x3dfd81(0xc3));const _0x33ddfa=_0x4ea0fd;if(!_0x33ddfa[_0x3dfd81(0xc4)]||typeof _0x33ddfa[_0x3dfd81(0xc4)]!=='string')throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field');return{'workflow_project':_0x33ddfa[_0x3dfd81(0xc4)],'workflow_project_id':typeof _0x33ddfa[_0x3dfd81(0xbd)]==='string'?_0x33ddfa[_0x3dfd81(0xbd)]:undefined,'last_pulled_revision':typeof _0x33ddfa['last_pulled_revision']===_0x3dfd81(0xb9)?_0x33ddfa['last_pulled_revision']:undefined,'last_pulled_at':typeof _0x33ddfa[_0x3dfd81(0xb2)]===_0x3dfd81(0xb9)?_0x33ddfa[_0x3dfd81(0xb2)]:undefined,'last_pushed_revision':typeof _0x33ddfa[_0x3dfd81(0xb8)]===_0x3dfd81(0xb9)?_0x33ddfa[_0x3dfd81(0xb8)]:undefined,'last_pushed_at':typeof _0x33ddfa[_0x3dfd81(0xbe)]===_0x3dfd81(0xb9)?_0x33ddfa[_0x3dfd81(0xbe)]:undefined};}export function findWorkflowTdxConfig(_0x4fcf75=process[a149_0x12720f(0xc8)]()){const _0x2b573e=a149_0x12720f,_0x179fbf=findWorkflowTdxConfigPath(_0x4fcf75);if(!_0x179fbf)throw new Error('No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x1c10cf=loadWorkflowTdxConfig(_0x179fbf),_0x3f526b=a149_0x15015c[_0x2b573e(0xb0)](_0x179fbf);return{'config':_0x1c10cf,'configPath':_0x179fbf,'configDir':_0x3f526b};}export function tryFindWorkflowTdxConfig(_0xb3812b){try{return findWorkflowTdxConfig(_0xb3812b);}catch{return null;}}export function getWorkflowProjectDir(_0x310fff,_0x2a4ffd=process[a149_0x12720f(0xc8)]()){const _0x257247=a149_0x12720f;return a149_0x15015c[_0x257247(0xc9)](_0x2a4ffd,WORKFLOWS_DIR,_0x310fff);}export function getWorkflowTdxConfigPath(_0x5cb7b5,_0x3f924b=process[a149_0x12720f(0xc8)]()){const _0x27b322=a149_0x12720f;return a149_0x15015c[_0x27b322(0xc9)](getWorkflowProjectDir(_0x5cb7b5,_0x3f924b),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x5b2fe6,_0x5ca52f,_0x426f91){const _0x53fb8b=a149_0x12720f,_0x135266={'workflow_project':_0x5b2fe6,..._0x5ca52f&&{'workflow_project_id':_0x5ca52f},..._0x426f91&&{'last_pulled_revision':_0x426f91},'last_pulled_at':new Date()[_0x53fb8b(0xb3)]()};return JSON[_0x53fb8b(0xae)](_0x135266,null,0x2)+'\x0a';}function a149_0x4290(){const _0x51fa9c=['string','workflows','parse','298XWvRcm','workflow_project_id','last_pushed_at','5218098EYJwin','Invalid\x20JSON\x20in\x20','323449EMzBcr','31111570qRqTcv','Invalid\x20tdx.json:\x20expected\x20object','workflow_project','1240336KDbFfj','15sNmWxq','968721wVYbfl','cwd','join','root','451624slsKhu','1887yPXHwP','stringify','resolve','dirname','object','last_pulled_at','toISOString','utf-8','18JbxgrN','11coBnzO','tdx.json','last_pushed_revision'];a149_0x4290=function(){return _0x51fa9c;};return a149_0x4290();}export function saveWorkflowTdxConfig(_0x4e3d09,_0x3b8692){const _0x4e5d82=a149_0x12720f,_0x5b6e9f=JSON['stringify'](_0x3b8692,null,0x2)+'\x0a';writeFileSync(_0x4e3d09,_0x5b6e9f,_0x4e5d82(0xb4));}export function updateWorkflowTdxConfig(_0x592d6d,_0x1ef89f){const _0x434277=loadWorkflowTdxConfig(_0x592d6d),_0x1698c8={..._0x434277,..._0x1ef89f};saveWorkflowTdxConfig(_0x592d6d,_0x1698c8);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a150_0x2fef97=a150_0x905f;(function(_0x580670,_0x310368){const _0x4573f3=a150_0x905f,_0x538b4f=_0x580670();while(!![]){try{const _0x31af76=-parseInt(_0x4573f3(0xfe))/0x1+parseInt(_0x4573f3(0xf1))/0x2*(parseInt(_0x4573f3(0xed))/0x3)+-parseInt(_0x4573f3(0xe9))/0x4+-parseInt(_0x4573f3(0xf3))/0x5*(parseInt(_0x4573f3(0xea))/0x6)+parseInt(_0x4573f3(0xec))/0x7+-parseInt(_0x4573f3(0xf7))/0x8+parseInt(_0x4573f3(0xff))/0x9;if(_0x31af76===_0x310368)break;else _0x538b4f['push'](_0x538b4f['shift']());}catch(_0x3aa46d){_0x538b4f['push'](_0x538b4f['shift']());}}}(a150_0x46aa,0xe3537));import{promises as a150_0x52060d}from'fs';function a150_0x46aa(){const _0x44d805=['join','.dig','277642ZNViUe','slice','90GtNezc','ENOENT','add','.digdagignore','9719336OLhyUK','Thumbs.db','split','length','.DS_Store','ignores','code','513203CQpLsL','30441924VtNYaO','endsWith','replace','startsWith','filter','map','3282576YMBQEA','611370WzoPYi','readFile','12549208pxvzCC','3KIOsWA','.digdag'];a150_0x46aa=function(){return _0x44d805;};return a150_0x46aa();}import a150_0xd5ad0a from'path';function a150_0x905f(_0x5ed896,_0x558c04){_0x5ed896=_0x5ed896-0xe4;const _0x46aa2a=a150_0x46aa();let _0x905f6c=_0x46aa2a[_0x5ed896];return _0x905f6c;}import a150_0x225c60 from'ignore';export const WORKFLOW_FILE_EXTENSION=a150_0x2fef97(0xf0);export function shouldIncludeInArchive(_0x1128d6){const _0x5f321e=a150_0x2fef97;if(_0x1128d6===_0x5f321e(0xee))return!![];if(_0x1128d6['startsWith']('.'))return![];if(_0x1128d6[_0x5f321e(0xe4)]('~'))return![];if(_0x1128d6===_0x5f321e(0xf8)||_0x1128d6===_0x5f321e(0xfb))return![];return!![];}export function parseDigdagignore(_0x3cf231){const _0x40456e=a150_0x2fef97;return _0x3cf231[_0x40456e(0xf9)]('\x0a')[_0x40456e(0xe8)](_0x11df7c=>_0x11df7c['trim']())[_0x40456e(0xe7)](_0x31091c=>_0x31091c['length']>0x0&&!_0x31091c[_0x40456e(0xe6)]('#'));}export async function loadDigdagignore(_0x182029){const _0x3378bf=a150_0x2fef97,_0x4d15c0=a150_0xd5ad0a[_0x3378bf(0xef)](_0x182029,_0x3378bf(0xf6));try{const _0x96dbc0=await a150_0x52060d[_0x3378bf(0xeb)](_0x4d15c0,'utf-8');return parseDigdagignore(_0x96dbc0);}catch(_0x55932a){if(_0x55932a[_0x3378bf(0xfd)]===_0x3378bf(0xf4))return null;throw _0x55932a;}}export function createIgnoreInstance(_0x77a28b){const _0x565770=a150_0x2fef97,_0x21f345=a150_0x225c60();return _0x77a28b&&_0x77a28b[_0x565770(0xfa)]>0x0&&_0x21f345[_0x565770(0xf5)](_0x77a28b),_0x21f345;}export function addScopedPatterns(_0x2ab85b,_0x41ec3f,_0x511915){const _0x4ddb57=a150_0x2fef97,_0x35b51e=_0x41ec3f[_0x4ddb57(0xe8)](_0x1d01ed=>{const _0x26c78f=_0x4ddb57;if(_0x1d01ed['startsWith']('!')){const _0xdc7d2a=_0x1d01ed[_0x26c78f(0xf2)](0x1);if(_0xdc7d2a['startsWith']('/'))return'!'+_0x511915+_0xdc7d2a;return'!'+_0x511915+'/'+_0xdc7d2a;}if(_0x1d01ed[_0x26c78f(0xe6)]('/'))return''+_0x511915+_0x1d01ed;return _0x511915+'/'+_0x1d01ed;});return _0x2ab85b[_0x4ddb57(0xf5)](_0x35b51e),_0x2ab85b;}export function shouldIgnoreWithInstance(_0x2bc836,_0x844f21,_0xb5a1b6){const _0x527432=a150_0x2fef97,_0x2e8196=_0x844f21[_0x527432(0xe5)](/\\/g,'/'),_0x3f5278=_0xb5a1b6?_0x2e8196+'/':_0x2e8196;return _0x2bc836[_0x527432(0xfc)](_0x3f5278);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a151_0x5baedb=a151_0xf970;(function(_0x15cb37,_0x451d68){const _0x471f0a=a151_0xf970,_0xff7fda=_0x15cb37();while(!![]){try{const _0x13495e=parseInt(_0x471f0a(0xfb))/0x1+parseInt(_0x471f0a(0x105))/0x2*(parseInt(_0x471f0a(0x100))/0x3)+parseInt(_0x471f0a(0xeb))/0x4*(parseInt(_0x471f0a(0xf5))/0x5)+parseInt(_0x471f0a(0xf3))/0x6+parseInt(_0x471f0a(0xec))/0x7+-parseInt(_0x471f0a(0xfe))/0x8*(-parseInt(_0x471f0a(0xee))/0x9)+-parseInt(_0x471f0a(0xea))/0xa;if(_0x13495e===_0x451d68)break;else _0xff7fda['push'](_0xff7fda['shift']());}catch(_0x5d0d8c){_0xff7fda['push'](_0xff7fda['shift']());}}}(a151_0x285e,0xbd9df));import{TDX,LogLevel}from'../sdk/index.js';import{createHTTPMock}from'./http-mock.js';function a151_0xf970(_0x28c91d,_0x5af1b4){_0x28c91d=_0x28c91d-0xe8;const _0x285e4f=a151_0x285e();let _0xf970fb=_0x285e4f[_0x28c91d];return _0xf970fb;}import{createTestGlobalOptions}from'./factories.js';export class CommandRunner{['http'];[a151_0x5baedb(0xed)];constructor(){const _0x33c208=a151_0x5baedb;this[_0x33c208(0xe9)]=createHTTPMock(),this[_0x33c208(0xed)]=global[_0x33c208(0xff)];}['setup'](){const _0x576e38=a151_0x5baedb;this[_0x576e38(0xed)]=global[_0x576e38(0xff)],global['fetch']=this[_0x576e38(0xe9)][_0x576e38(0xfd)]();}['teardown'](_0x319729){const _0x2d6b80=a151_0x5baedb;try{_0x319729?.['fail']&&this[_0x2d6b80(0xe9)][_0x2d6b80(0xf4)](_0x319729);}finally{global['fetch']=this[_0x2d6b80(0xed)],this['http'][_0x2d6b80(0xf2)]();}}async['run'](_0x128c0a,_0x3d8fe4={}){const _0xa390c0=a151_0x5baedb,_0x33b614=[],_0x59be76=[],_0x177d91=console['log'],_0x58d29a=console[_0xa390c0(0xfa)],_0x1b13a9=console['warn'];console[_0xa390c0(0xf7)]=(..._0x54bc5e)=>{const _0x11680d=_0xa390c0;_0x33b614[_0x11680d(0xf8)](_0x54bc5e['map'](String)[_0x11680d(0xf6)]('\x20'));},console[_0xa390c0(0xfa)]=(..._0x5445be)=>{const _0x2b4261=_0xa390c0;_0x59be76['push'](_0x5445be[_0x2b4261(0xf1)](String)[_0x2b4261(0xf6)]('\x20'));},console[_0xa390c0(0x104)]=(..._0x5b8ebb)=>{const _0x1cb4d4=_0xa390c0;_0x59be76[_0x1cb4d4(0xf8)](_0x5b8ebb[_0x1cb4d4(0xf1)](String)[_0x1cb4d4(0xf6)]('\x20'));};try{const _0x2c7275=new TDX({'site':_0x3d8fe4[_0xa390c0(0xfc)]?.[_0xa390c0(0xef)]??'us01','apiKey':_0xa390c0(0x101),'logLevel':LogLevel[_0xa390c0(0x103)]}),_0x9456b6={'options':createTestGlobalOptions(_0x3d8fe4[_0xa390c0(0xfc)]),'args':_0x3d8fe4[_0xa390c0(0x102)]??[],'tdx':_0x2c7275},_0x289a01=new _0x128c0a(),_0x16a2cc=await _0x289a01[_0xa390c0(0xe8)](_0x9456b6);return{'exitCode':_0x16a2cc,'stdout':_0x33b614,'stderr':_0x59be76};}finally{console[_0xa390c0(0xf7)]=_0x177d91,console['error']=_0x58d29a,console[_0xa390c0(0x104)]=_0x1b13a9;}}async[a151_0x5baedb(0xf0)](_0x2a7e77){const _0x4feff4=a151_0x5baedb,_0x23e90e=[];for(const {command:_0x7b1538,options:_0x4ea9ca}of _0x2a7e77){const _0x7d1353=await this[_0x4feff4(0xe8)](_0x7b1538,_0x4ea9ca);_0x23e90e[_0x4feff4(0xf8)](_0x7d1353);if(_0x7d1353[_0x4feff4(0xf9)]!==0x0)break;}return _0x23e90e;}}export function createCommandRunner(){return new CommandRunner();}function a151_0x285e(){const _0x3ebe43=['log','push','exitCode','error','1420713QpkqNi','options','createFetch','36136trhZRr','fetch','4102674xfUKjh','test-api-key-id/test-api-key-secret','args','ERROR','warn','2ZOtBRM','run','http','44000940phpxZQ','279988ZkSCbL','1013789TRGkFQ','originalFetch','171BDfOxF','site','runSequence','map','reset','4967406eBIfRq','verify','95NeBJPR','join'];a151_0x285e=function(){return _0x3ebe43;};return a151_0x285e();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xdfcf5e,_0xb5ed42){const _0x3c8697=a152_0x3896,_0x398454=_0xdfcf5e();while(!![]){try{const _0x3e8606=-parseInt(_0x3c8697(0xf1))/0x1*(-parseInt(_0x3c8697(0xff))/0x2)+-parseInt(_0x3c8697(0xf0))/0x3+-parseInt(_0x3c8697(0xed))/0x4+parseInt(_0x3c8697(0xfe))/0x5+parseInt(_0x3c8697(0xf7))/0x6*(parseInt(_0x3c8697(0xf8))/0x7)+-parseInt(_0x3c8697(0xfb))/0x8*(parseInt(_0x3c8697(0xfa))/0x9)+parseInt(_0x3c8697(0xf3))/0xa*(parseInt(_0x3c8697(0xfc))/0xb);if(_0x3e8606===_0xb5ed42)break;else _0x398454['push'](_0x398454['shift']());}catch(_0x4928ad){_0x398454['push'](_0x398454['shift']());}}}(a152_0x4aaa,0x546a9));import{vi}from'vitest';import{join}from'path';import{Logger,LogLevel,FileHandler}from'../utils/logger/index.js';function a152_0x4aaa(){const _0x228334=['reset','tdx','us01','log','226348mCxhZv','init','workflow','1288389poguKh','29DkFMfk','args','30znuVVo','api','logs','map','204MOYvJT','38297MHWUsd','DEBUG','1031463IEtGLQ','32ZgsGvy','2588234xefZzR','tdx-test.log','1093190RIehBs','12394NdNPYK','error','ERROR','test-api-key','warn','30000','join','segment','table','query','push'];a152_0x4aaa=function(){return _0x228334;};return a152_0x4aaa();}import{getGlobalCacheDir}from'../utils/global-cache.js';export function createTestSDKContext(_0x1d2d90){const _0x40d4d5=a152_0x3896;return{'site':'us01','apiKey':'test-api-key-id/test-api-key-secret','logLevel':LogLevel[_0x40d4d5(0x101)],..._0x1d2d90};}export function createTestGlobalOptions(_0x21f32c){const _0xd19616=a152_0x3896;return{'site':_0xd19616(0x10c),'format':_0xd19616(0x107),'noColor':!![],'limit':0x64,'verbose':![],'timeout':_0xd19616(0x104),'dryRun':![],'yes':![],'logLevel':LogLevel[_0xd19616(0x101)],..._0x21f32c};}export async function initTestLogger(){const _0x45175e=a152_0x3896;Logger[_0x45175e(0x10a)]();const _0x37205b=join(getGlobalCacheDir(),_0x45175e(0xf5),_0x45175e(0xfd));await Logger[_0x45175e(0xee)]({'defaultLevel':LogLevel[_0x45175e(0xf9)],'handlers':[new FileHandler({'filePath':_0x37205b,'rotate':![]})]});}export function resetTestLogger(){const _0x5ca16e=a152_0x3896;Logger[_0x5ca16e(0x10a)]();}export function createMockTDX(_0x8c565d){const _0x3feba3=a152_0x3896;return{'context':{'site':'us01','apiKey':_0x3feba3(0x102),'logLevel':LogLevel[_0x3feba3(0x101)]},'query':{'execute':vi['fn'](),'listDatabases':vi['fn'](),'listTables':vi['fn'](),'describeTable':vi['fn'](),'showTable':vi['fn'](),..._0x8c565d?.[_0x3feba3(0x108)]},'segment':{'listParents':vi['fn'](),'getParent':vi['fn'](),'list':vi['fn'](),'get':vi['fn'](),'create':vi['fn'](),'update':vi['fn'](),'delete':vi['fn'](),..._0x8c565d?.[_0x3feba3(0x106)]},'journey':{'list':vi['fn'](),'get':vi['fn'](),'create':vi['fn'](),'update':vi['fn'](),'delete':vi['fn'](),..._0x8c565d?.['journey']},'workflow':{'list':vi['fn'](),'get':vi['fn'](),'run':vi['fn'](),..._0x8c565d?.[_0x3feba3(0xef)]},'user':{'show':vi['fn'](),..._0x8c565d?.['user']},'api':{'request':vi['fn'](),..._0x8c565d?.[_0x3feba3(0xf4)]},..._0x8c565d};}function a152_0x3896(_0x539b75,_0x1acb08){_0x539b75=_0x539b75-0xed;const _0x4aaad2=a152_0x4aaa();let _0x3896c0=_0x4aaad2[_0x539b75];return _0x3896c0;}export function createTestCommandContext(_0x2eb920){const _0x4105ae=a152_0x3896,_0x1355ec=createTestGlobalOptions(_0x2eb920?.['options']),_0x58de3b=_0x2eb920?.[_0x4105ae(0x10b)]??createMockTDX();return{'options':_0x1355ec,'args':_0x2eb920?.[_0x4105ae(0xf2)]??[],'tdx':_0x58de3b};}export function captureConsole(){const _0x50b4ab=a152_0x3896,_0x37923d=[],_0x42c17f=[],_0x244bdf=console[_0x50b4ab(0x10d)],_0x39d085=console[_0x50b4ab(0x100)],_0x1cf133=console[_0x50b4ab(0x103)];return console['log']=(..._0x745e88)=>{const _0x2c688a=_0x50b4ab;_0x37923d[_0x2c688a(0x109)](_0x745e88[_0x2c688a(0xf6)](String)[_0x2c688a(0x105)]('\x20'));},console[_0x50b4ab(0x100)]=(..._0x2ece3a)=>{const _0x4c3f4f=_0x50b4ab;_0x42c17f['push'](_0x2ece3a['map'](String)[_0x4c3f4f(0x105)]('\x20'));},console['warn']=(..._0x3dccc8)=>{const _0x25d668=_0x50b4ab;_0x42c17f[_0x25d668(0x109)](_0x3dccc8['map'](String)['join']('\x20'));},{'stdout':_0x37923d,'stderr':_0x42c17f,'restore':()=>{const _0x37e8c2=_0x50b4ab;console['log']=_0x244bdf,console[_0x37e8c2(0x100)]=_0x39d085,console['warn']=_0x1cf133;}};}
|