@treasuredata/tdx 0.26.4 → 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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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
|
-
(function(
|
|
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_0x259bce=a146_0x41d5;function a146_0x46aa(){const _0x3094b4=['min','limit','5621375NtwnXq','workflowName','length','workflow','pullProject','prepareCloneProject','393ALMQMb','includeRetried','delete','state','sessions','isFile','join','6dgZbmM','client','Cannot\x20read\x20workflow\x20file:\x20','retryAttemptName','toString','zlib','replace','sessionUuid','projectName','getAttempt','retryAttempt','attempt','listWorkflows','data','util','mkdir','retryAt','kill','find','Invalid\x20workflow\x20format:\x20','map','25028064gCVUQf','978063CsAAyR','project','getAttemptTasks','logFiles','lastAttempt','Failed\x20to\x20download\x20log\x20file:\x20','retryParams','setSecret','utf-8','1243304lICThh','config','resolveProjectId','params','executeCloneProject','listAttempts','latest','upstreams','resumeFrom','clearScheduleAll','tar','basename','isGroup','exportParams','status','parentId','substring','getProject','gunzip','listSecrets','Project\x20not\x20found:\x20','fullName','fromTime','deleteSecret','deleteProject','toISOString','updatedAt','path','uploadProjectArchive','force','tdx-workflow-','from','fromTask','WORKFLOW_PROJECT_NOT_FOUND','name','now','revision','test','arrayBuffer','tmpdir','error','startedAt','logs','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','push','unlink','listProjects','timezone','.tar.gz','sessionId','cancelRequested','readdir','Kill\x20request\x20accepted','6856031dOdsvu','projects','slice','last_id','bind','attempts','direct','success','lastId','downloadProjectArchive','Project\x20directory\x20not\x20found:\x20','index','21796KNbHES','stateParams','run','skipValidation','sessionTime','listLogFiles','createdAt','clearSchedule','No\x20','8852520MeCfBn','rawCount','done','retrySession','tasks','isDirectory','extract','applyPullProject','access'];a146_0x46aa=function(){return _0x3094b4;};return a146_0x46aa();}(function(_0x430cfc,_0x244964){const _0x5b5424=a146_0x41d5,_0x475cc7=_0x430cfc();while(!![]){try{const _0x4098a8=-parseInt(_0x5b5424(0x10f))/0x1+-parseInt(_0x5b5424(0x97))/0x2+-parseInt(_0x5b5424(0xf2))/0x3*(-parseInt(_0x5b5424(0xd8))/0x4)+parseInt(_0x5b5424(0xec))/0x5*(-parseInt(_0x5b5424(0xf9))/0x6)+parseInt(_0x5b5424(0xcc))/0x7+-parseInt(_0x5b5424(0xe1))/0x8+parseInt(_0x5b5424(0x10e))/0x9;if(_0x4098a8===_0x244964)break;else _0x475cc7['push'](_0x475cc7['shift']());}catch(_0x24b4df){_0x475cc7['push'](_0x475cc7['shift']());}}}(a146_0x46aa,0x9d209));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';const MAX_PAGINATION_LIMIT=0x3e8;async function paginateResults(_0x53253d,_0x238631,_0x2378cf=0x64){const _0x46e438=a146_0x41d5,_0xedf3cb=Math[_0x46e438(0xea)](_0x238631,MAX_PAGINATION_LIMIT),_0x347f16=[];let _0x553d38;while(_0x347f16[_0x46e438(0xee)]<_0xedf3cb){const _0x2db1f6=await _0x53253d(_0x2378cf,_0x553d38),_0x4b23cf=_0x2db1f6[_0x46e438(0xe2)]??_0x2db1f6[_0x46e438(0x106)][_0x46e438(0xee)];if(_0x4b23cf===0x0)break;_0x347f16['push'](..._0x2db1f6[_0x46e438(0x106)]);if(!_0x2db1f6['lastId']||_0x4b23cf<_0x2378cf)break;_0x553d38=_0x2db1f6[_0x46e438(0xd4)];}return _0x347f16[_0x46e438(0xce)](0x0,_0xedf3cb);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';function a146_0x41d5(_0x207472,_0x5555e1){_0x207472=_0x207472-0x94;const _0x46aa07=a146_0x46aa();let _0x41d548=_0x46aa07[_0x207472];return _0x41d548;}import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static ['NUMERIC_ID_PATTERN']=/^\d+$/;[a146_0x259bce(0xfa)];constructor(_0x27838f){const _0x1c359f=a146_0x259bce;this[_0x1c359f(0xfa)]=new WorkflowApiClient(_0x27838f);}async[a146_0x259bce(0x99)](_0x3538bd){const _0x2d57ea=a146_0x259bce;if(WorkflowSDK['NUMERIC_ID_PATTERN'][_0x2d57ea(0xbc)](_0x3538bd)){const _0x2f05ce=await this[_0x2d57ea(0xfa)][_0x2d57ea(0xa8)](_0x3538bd);return{'id':_0x2f05ce['id'],'name':_0x2f05ce[_0x2d57ea(0xb9)]};}const _0x5a8cdc=await this['client'][_0x2d57ea(0xc5)]({'name_pattern':_0x3538bd}),_0x1fad21=_0x5a8cdc[_0x2d57ea(0x106)][_0x2d57ea(0x10b)](_0x4adc4a=>_0x4adc4a['name']===_0x3538bd);if(!_0x1fad21)throw new SDKError(ErrorCode[_0x2d57ea(0xb8)],_0x2d57ea(0xab)+_0x3538bd);return{'id':_0x1fad21['id'],'name':_0x1fad21[_0x2d57ea(0xb9)]};}async[a146_0x259bce(0xcd)](_0x39a7ec,_0x213f21){const _0xcedc30=a146_0x259bce,_0x4ac5d5=_0x213f21?.[_0xcedc30(0xeb)]||0x64,_0x194094=await paginateResults((_0x9e3360,_0x565705)=>this[_0xcedc30(0xfa)][_0xcedc30(0xc5)]({'name_pattern':_0x39a7ec,'limit':_0x9e3360,'last_id':_0x565705??_0x213f21?.[_0xcedc30(0xcf)]}),_0x4ac5d5);return _0x194094['map'](_0x52736a=>({..._0x52736a,'project_id':_0x52736a['id'],'project_name':_0x52736a['name']}));}async['workflows'](_0x1c9280,_0x3e3ea9){const _0x2a9f5c=a146_0x259bce,_0x47b792=_0x3e3ea9?.[_0x2a9f5c(0xeb)]||0x64,_0x59f7f9=await paginateResults((_0x38d20f,_0x2fc475)=>this[_0x2a9f5c(0xfa)][_0x2a9f5c(0x105)]({'project_name':_0x1c9280,'limit':_0x38d20f,'last_id':_0x2fc475??_0x3e3ea9?.[_0x2a9f5c(0xcf)]}),_0x47b792);return _0x59f7f9[_0x2a9f5c(0x10d)](_0x4efe4a=>({'project_id':_0x4efe4a[_0x2a9f5c(0x110)]?.['id'],'project_name':_0x4efe4a[_0x2a9f5c(0x110)]?.[_0x2a9f5c(0xb9)],'workflow_id':_0x4efe4a['id'],'workflow_name':_0x4efe4a[_0x2a9f5c(0xb9)],'revision':_0x4efe4a[_0x2a9f5c(0xbb)],'timezone':_0x4efe4a[_0x2a9f5c(0xc6)],'config':_0x4efe4a[_0x2a9f5c(0x98)],'id':_0x4efe4a['id'],'name':_0x4efe4a[_0x2a9f5c(0xb9)],'project':_0x4efe4a[_0x2a9f5c(0x110)]}));}async[a146_0x259bce(0xf6)](_0x1ee482){const _0x1f40ee=a146_0x259bce;let _0x362520;if(_0x1ee482?.[_0x1f40ee(0x101)]){let _0x1e30c8,_0x229895=![];while(!_0x229895){const _0x2344be=await this[_0x1f40ee(0xfa)][_0x1f40ee(0xc5)]({'limit':0x64,'last_id':_0x1e30c8}),_0x53ce39=_0x2344be['data'][_0x1f40ee(0x10b)](_0x5af730=>_0x5af730[_0x1f40ee(0xb9)]===_0x1ee482[_0x1f40ee(0x101)]);if(_0x53ce39){_0x362520=_0x53ce39['id'],_0x229895=!![];break;}if(!_0x2344be['lastId']||_0x2344be[_0x1f40ee(0x106)][_0x1f40ee(0xee)]===0x0)break;_0x1e30c8=_0x2344be[_0x1f40ee(0xd4)];}if(!_0x362520)throw new SDKError(ErrorCode[_0x1f40ee(0xb8)],_0x1f40ee(0xab)+_0x1ee482[_0x1f40ee(0x101)]);}const _0x5a94c5=_0x1ee482?.[_0x1f40ee(0xeb)]||0x64,_0x12b5c4=await paginateResults((_0x9d6015,_0x41fc1a)=>this[_0x1f40ee(0xfa)]['listSessions']({'project_id':_0x362520,'project_name':_0x1ee482?.[_0x1f40ee(0x101)],'workflow_name':_0x1ee482?.[_0x1f40ee(0xed)],'status':_0x1ee482?.[_0x1f40ee(0xa5)],'from_time':_0x1ee482?.[_0x1f40ee(0xad)],'to_time':_0x1ee482?.['toTime'],'limit':_0x9d6015,'last_id':_0x41fc1a??_0x1ee482?.[_0x1f40ee(0xcf)]}),_0x5a94c5);return _0x12b5c4['map'](_0x5b5a10=>({'project_id':_0x5b5a10['project']?.['id'],'project_name':_0x5b5a10['project']?.[_0x1f40ee(0xb9)],'workflow_id':_0x5b5a10[_0x1f40ee(0xef)]?.['id'],'workflow_name':_0x5b5a10['workflow']?.['name'],'session_id':_0x5b5a10['id'],'sessionUuid':_0x5b5a10[_0x1f40ee(0x100)],'sessionTime':_0x5b5a10[_0x1f40ee(0xdc)],'lastAttempt':_0x5b5a10[_0x1f40ee(0x113)],'id':_0x5b5a10['id'],'project':_0x5b5a10[_0x1f40ee(0x110)],'workflow':_0x5b5a10[_0x1f40ee(0xef)]}));}async[a146_0x259bce(0xd1)](_0x3ea444){const _0x16aec8=a146_0x259bce,_0x5af625=_0x3ea444?.[_0x16aec8(0xeb)]||0x64,_0x1448af=await paginateResults((_0x51488b,_0x18189d)=>this[_0x16aec8(0xfa)][_0x16aec8(0x9c)]({'project_name':_0x3ea444?.[_0x16aec8(0x101)],'workflow_name':_0x3ea444?.[_0x16aec8(0xed)],'include_retried':_0x3ea444?.[_0x16aec8(0xf3)],'limit':_0x51488b,'last_id':_0x18189d??_0x3ea444?.[_0x16aec8(0xcf)]}),_0x5af625);return _0x1448af[_0x16aec8(0x10d)](_0x57fcf1=>({'project_id':_0x57fcf1[_0x16aec8(0x110)]?.['id'],'project_name':_0x57fcf1[_0x16aec8(0x110)]?.[_0x16aec8(0xb9)],'workflow_id':_0x57fcf1[_0x16aec8(0xef)]?.['id'],'workflow_name':_0x57fcf1['workflow']?.[_0x16aec8(0xb9)],'session_id':_0x57fcf1[_0x16aec8(0xc8)],'sessionUuid':_0x57fcf1['sessionUuid'],'sessionTime':_0x57fcf1[_0x16aec8(0xdc)],'attempt_id':_0x57fcf1['id'],'attempt_index':_0x57fcf1[_0x16aec8(0xd7)],'retryAttemptName':_0x57fcf1[_0x16aec8(0xfc)],'done':_0x57fcf1[_0x16aec8(0xe3)],'success':_0x57fcf1[_0x16aec8(0xd3)],'cancelRequested':_0x57fcf1[_0x16aec8(0xc9)],'params':_0x57fcf1[_0x16aec8(0x9a)],'createdAt':_0x57fcf1[_0x16aec8(0xde)],'finishedAt':_0x57fcf1['finishedAt'],'id':_0x57fcf1['id'],'index':_0x57fcf1['index'],'project':_0x57fcf1[_0x16aec8(0x110)],'workflow':_0x57fcf1[_0x16aec8(0xef)]}));}async[a146_0x259bce(0x104)](_0x2bab47){const _0x4c1275=a146_0x259bce,_0x366d05=await this[_0x4c1275(0xfa)][_0x4c1275(0x102)](_0x2bab47);return _0x366d05;}async[a146_0x259bce(0xe5)](_0x59b1c8,_0xbd5341=![]){const _0x28303a=a146_0x259bce,_0x436169=await this['client'][_0x28303a(0x111)](_0x59b1c8,_0xbd5341);return _0x436169[_0x28303a(0x10d)](_0x14753c=>({'task_id':_0x14753c['id'],'task_name':_0x14753c[_0x28303a(0xac)],'parentId':_0x14753c[_0x28303a(0xa6)],'config':_0x14753c[_0x28303a(0x98)],'upstreams':_0x14753c[_0x28303a(0x9e)],'state':_0x14753c[_0x28303a(0xf5)],'exportParams':_0x14753c[_0x28303a(0xa4)],'storeParams':_0x14753c['storeParams'],'stateParams':_0x14753c[_0x28303a(0xd9)],'updatedAt':_0x14753c[_0x28303a(0xb1)],'retryAt':_0x14753c[_0x28303a(0x109)],'startedAt':_0x14753c[_0x28303a(0xc0)],'error':_0x14753c[_0x28303a(0xbf)],'isGroup':_0x14753c[_0x28303a(0xa3)],'id':_0x14753c['id'],'fullName':_0x14753c[_0x28303a(0xac)]}));}async[a146_0x259bce(0x112)](_0x17861b,_0x1d37f4){const _0x407343=a146_0x259bce;return await this['client'][_0x407343(0xdd)](_0x17861b,_0x1d37f4);}async[a146_0x259bce(0xc1)](_0x2fded3,_0x153c13){const _0xbfd0fd=a146_0x259bce,_0x33a0ec=await import(_0xbfd0fd(0xfe)),{promisify:_0x14e841}=await import(_0xbfd0fd(0x107)),_0x15294b=_0x14e841(_0x33a0ec[_0xbfd0fd(0xa9)]),_0x4c06eb=await this['client']['listLogFiles'](_0x2fded3,_0x153c13);if(_0x4c06eb[_0xbfd0fd(0xee)]===0x0)return'';const _0x2387c1=[];for(const _0x558178 of _0x4c06eb){if(!_0x558178[_0xbfd0fd(0xd2)])continue;const _0x2c137c=await fetch(_0x558178[_0xbfd0fd(0xd2)]);if(!_0x2c137c['ok'])throw new Error(_0xbfd0fd(0x114)+_0x2c137c[_0xbfd0fd(0xa5)]);const _0x3eb8fb=Buffer[_0xbfd0fd(0xb6)](await _0x2c137c[_0xbfd0fd(0xbd)]()),_0x53394d=await _0x15294b(_0x3eb8fb);_0x2387c1[_0xbfd0fd(0xc3)](_0x53394d[_0xbfd0fd(0xfd)](_0xbfd0fd(0x96)));}return _0x2387c1['join']('\x0a');}async[a146_0x259bce(0x10a)](_0x8c22,_0x24b1de){const _0x3992ad=a146_0x259bce,_0x238860=await this[_0x3992ad(0xfa)]['killAttempt'](_0x8c22,_0x24b1de);return _0x238860?.['message']??_0x3992ad(0xcb);}async[a146_0x259bce(0xe4)](_0x286093,_0x33c130){const _0x5e362c=a146_0x259bce,_0x1c4306=await this[_0x5e362c(0xfa)][_0x5e362c(0xe4)](_0x286093,{'from_task':_0x33c130?.[_0x5e362c(0xb7)],'retry_params':_0x33c130?.[_0x5e362c(0x94)]});return{'attemptId':_0x1c4306['id'],'sessionId':_0x1c4306[_0x5e362c(0xc8)]};}async[a146_0x259bce(0x103)](_0x5575be,_0x59d3c5){const _0x18e01a=a146_0x259bce,_0x427bcd=await this[_0x18e01a(0xfa)][_0x18e01a(0x103)](_0x5575be,{'resume_from':_0x59d3c5?.[_0x18e01a(0x9f)],'retry_params':_0x59d3c5?.[_0x18e01a(0x94)],'force':_0x59d3c5?.[_0x18e01a(0xb4)]});return{'attemptId':_0x427bcd['id'],'sessionId':_0x427bcd[_0x18e01a(0xc8)]};}async[a146_0x259bce(0xda)](_0x461ab7,_0x4d588a={},_0x182a38){const _0x40ca6a=a146_0x259bce,_0x5b11d6=_0x461ab7['indexOf']('.');let _0x3c57d7,_0x1fd675;if(_0x5b11d6===-0x1)throw new Error(_0x40ca6a(0xc2));_0x3c57d7=_0x461ab7[_0x40ca6a(0xa7)](0x0,_0x5b11d6),_0x1fd675=_0x461ab7[_0x40ca6a(0xa7)](_0x5b11d6+0x1);if(!_0x3c57d7||!_0x1fd675)throw new Error(_0x40ca6a(0x10c)+_0x461ab7+'.\x20Expected\x20\x22project.workflow\x22');const _0x1443cb=_0x182a38?.[_0x40ca6a(0xdc)]||new Date()['toISOString']();return await this[_0x40ca6a(0xfa)]['startAttempt']({'projectName':_0x3c57d7,'workflowName':_0x1fd675,'sessionTime':_0x1443cb,'params':_0x4d588a});}async['download'](_0x36df43,_0xe67231,_0x265e13){const _0x404b22=a146_0x259bce,{promises:_0x2487b9}=await import('fs'),_0x47a97a=await import(_0x404b22(0xb2)),_0xf1ae9e=await import('os'),_0x5de06e=await import('tar'),{id:_0x5a95a2,name:_0x27c2df}=await this[_0x404b22(0x99)](_0x36df43),_0x47ee77=_0xf1ae9e[_0x404b22(0xbe)](),_0x28526d=_0x47a97a[_0x404b22(0xf8)](_0x47ee77,_0x404b22(0xb5)+_0x5a95a2+'-'+Date[_0x404b22(0xba)]()+_0x404b22(0xc7));try{await this['client'][_0x404b22(0xd5)](_0x5a95a2,_0x28526d,_0x265e13?.['revision']);const _0x1da2e4=_0x47a97a[_0x404b22(0xf8)](_0xe67231,_0x27c2df);await _0x2487b9[_0x404b22(0x108)](_0x1da2e4,{'recursive':!![]}),await _0x5de06e[_0x404b22(0xe7)]({'file':_0x28526d,'cwd':_0x1da2e4,'gzip':!![]});const _0x236380=async _0x20b06a=>{const _0x20c2f3=_0x404b22;let _0x502b00=0x0;const _0x145860=await _0x2487b9[_0x20c2f3(0xca)](_0x20b06a,{'withFileTypes':!![]});for(const _0x23910a of _0x145860){const _0x2f3d58=_0x47a97a[_0x20c2f3(0xf8)](_0x20b06a,_0x23910a['name']);if(_0x23910a[_0x20c2f3(0xf7)]())_0x502b00++;else _0x23910a[_0x20c2f3(0xe6)]()&&(_0x502b00+=await _0x236380(_0x2f3d58));}return _0x502b00;},_0x22a827=await _0x236380(_0x1da2e4);return{'projectName':_0x27c2df,'revision':_0x265e13?.[_0x404b22(0xbb)]||_0x404b22(0x9d),'filesExtracted':_0x22a827};}finally{try{await _0x2487b9[_0x404b22(0xc4)](_0x28526d);}catch{}}}async['push'](_0x51a2b9,_0x3c5d3b){const _0x4ee87a=a146_0x259bce,{promises:_0x4163eb}=await import('fs'),_0x397c6c=await import('path'),_0x578ce5=await import(_0x4ee87a(0xa1)),_0x3bd787=_0x3c5d3b?.['projectName']||_0x397c6c[_0x4ee87a(0xa2)](_0x51a2b9),_0x2c6ee8=_0x3c5d3b?.[_0x4ee87a(0xbb)]||new Date()[_0x4ee87a(0xb0)]()[_0x4ee87a(0xff)](/[:.]/g,'-');try{await _0x4163eb['access'](_0x51a2b9);}catch{throw new Error(_0x4ee87a(0xd6)+_0x51a2b9);}if(!_0x3c5d3b?.[_0x4ee87a(0xdb)]){const _0x26de66=await _0x4163eb[_0x4ee87a(0xca)](_0x51a2b9),_0x311a79=_0x26de66['filter'](_0x2b43e2=>_0x2b43e2['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x311a79[_0x4ee87a(0xee)]===0x0)throw new Error(_0x4ee87a(0xe0)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20project\x20directory');for(const _0x3572bf of _0x311a79){const _0x503b9f=_0x397c6c['join'](_0x51a2b9,_0x3572bf);try{await _0x4163eb[_0x4ee87a(0xe9)](_0x503b9f);}catch{throw new Error(_0x4ee87a(0xfb)+_0x3572bf);}}}const _0x26ba15=async(_0x27cd5d,_0x2ed96c='')=>{const _0x212aa9=_0x4ee87a,_0x1d8afc=await _0x4163eb[_0x212aa9(0xca)](_0x27cd5d,{'withFileTypes':!![]}),_0x5e020a=[];for(const _0x19b654 of _0x1d8afc){const _0xf24c8d=_0x397c6c[_0x212aa9(0xf8)](_0x2ed96c,_0x19b654[_0x212aa9(0xb9)]),_0x3efa66=_0x397c6c['join'](_0x27cd5d,_0x19b654[_0x212aa9(0xb9)]);if(!shouldIncludeInArchive(_0x19b654['name']))continue;_0x19b654[_0x212aa9(0xe6)]()?_0x5e020a['push'](...await _0x26ba15(_0x3efa66,_0xf24c8d)):_0x5e020a[_0x212aa9(0xc3)](_0xf24c8d);}return _0x5e020a;},_0x4c0a90=await _0x26ba15(_0x51a2b9),_0x4aec36=await import('os'),_0x2e07c6=_0x4aec36[_0x4ee87a(0xbe)](),_0x7d5583=_0x397c6c['join'](_0x2e07c6,'tdx-workflow-push-'+Date[_0x4ee87a(0xba)]()+_0x4ee87a(0xc7));try{await _0x578ce5['create']({'file':_0x7d5583,'gzip':!![],'cwd':_0x51a2b9,'portable':!![]},_0x4c0a90);const _0x4a4a94=await this[_0x4ee87a(0xfa)][_0x4ee87a(0xb3)](_0x3bd787,_0x2c6ee8,_0x7d5583,{'scheduleFrom':_0x3c5d3b?.['scheduleFrom'],'clearSchedule':_0x3c5d3b?.[_0x4ee87a(0xdf)],'clearScheduleAll':_0x3c5d3b?.[_0x4ee87a(0xa0)]});return{'projectId':_0x4a4a94['id'],'projectName':_0x4a4a94[_0x4ee87a(0xb9)],'revision':_0x4a4a94[_0x4ee87a(0xbb)]};}finally{try{await _0x4163eb['unlink'](_0x7d5583);}catch{}}}async[a146_0x259bce(0xf4)](_0x4c4293){const _0x365b56=a146_0x259bce,{id:_0x5bf98e}=await this[_0x365b56(0x99)](_0x4c4293),_0x536c31=await this[_0x365b56(0xfa)][_0x365b56(0xaf)](_0x5bf98e);return{'projectId':_0x536c31['id'],'projectName':_0x536c31[_0x365b56(0xb9)]};}async[a146_0x259bce(0xaa)](_0x4e6b60){const _0x377a5e=a146_0x259bce,{id:_0x534bdb,name:_0x10f6cd}=await this[_0x377a5e(0x99)](_0x4e6b60),_0x2b76ab=await this[_0x377a5e(0xfa)]['listSecrets'](_0x534bdb);return{'projectName':_0x10f6cd,'secrets':_0x2b76ab};}async[a146_0x259bce(0x95)](_0x1a5c34,_0x329554,_0x5ab076){const _0x489ab2=a146_0x259bce,{id:_0x3b9bb4,name:_0x5536f1}=await this[_0x489ab2(0x99)](_0x1a5c34);return await this['client'][_0x489ab2(0x95)](_0x3b9bb4,_0x329554,_0x5ab076),{'projectName':_0x5536f1,'key':_0x329554};}async[a146_0x259bce(0xae)](_0x4ecbff,_0x301e55){const _0x3cec50=a146_0x259bce,{id:_0x333a6,name:_0x24a7b8}=await this[_0x3cec50(0x99)](_0x4ecbff);return await this[_0x3cec50(0xfa)][_0x3cec50(0xae)](_0x333a6,_0x301e55),{'projectName':_0x24a7b8,'key':_0x301e55};}async[a146_0x259bce(0xf0)](_0x1b947d,_0x1ae00e){const _0x3d7f23=a146_0x259bce;return pullWorkflow({'client':this['client'],'resolveProjectId':this[_0x3d7f23(0x99)][_0x3d7f23(0xd0)](this)},_0x1b947d,_0x1ae00e);}async[a146_0x259bce(0xe8)](_0x371945,_0x233a5d){const _0x56c8dc=a146_0x259bce;return applyPullResult({'client':this[_0x56c8dc(0xfa)],'resolveProjectId':this[_0x56c8dc(0x99)]['bind'](this)},_0x371945,_0x233a5d);}async['preparePushProject'](_0x1454bc){const _0x42e29e=a146_0x259bce;return preparePushWorkflow({'client':this[_0x42e29e(0xfa)],'resolveProjectId':this[_0x42e29e(0x99)][_0x42e29e(0xd0)](this)},_0x1454bc);}async['executePushProject'](_0x4ec090){const _0x307379=a146_0x259bce;return executePushWorkflow({'client':this['client'],'resolveProjectId':this[_0x307379(0x99)][_0x307379(0xd0)](this)},_0x4ec090);}async[a146_0x259bce(0xf1)](_0x3610e7,_0x1404c7,_0x9c9d3a){const _0x31dac3=a146_0x259bce;return prepareCloneWorkflow({'client':this[_0x31dac3(0xfa)]},_0x3610e7,_0x1404c7,_0x9c9d3a);}async[a146_0x259bce(0x9b)](_0x4addf6){const _0x540f85=a146_0x259bce;return executeCloneWorkflow({'client':this[_0x540f85(0xfa)]},_0x4addf6);}}
|
|
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
|
-
|
|
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
|
-
(function(
|
|
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;}};}
|