@treasuredata/tdx 0.16.1 → 0.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.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/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.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/claude-agent/claude-agent-client.d.ts +19 -1
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +1 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +1 -1
- package/dist/sdk/claude-agent/environment.js +1 -1
- package/dist/sdk/claude-agent/index.js +1 -1
- package/dist/sdk/claude-agent/system-prompts.js +1 -1
- package/dist/sdk/claude-agent/types.d.ts +26 -0
- package/dist/sdk/claude-agent/types.d.ts.map +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-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.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(_0x29fe8e,_0x299923){const _0x67cfd4=a148_0x3cb3,_0x3fbf78=_0x29fe8e();while(!![]){try{const _0x19eff7=-parseInt(_0x67cfd4(0xed))/0x1*(parseInt(_0x67cfd4(0x10c))/0x2)+-parseInt(_0x67cfd4(0xfc))/0x3*(parseInt(_0x67cfd4(0xe5))/0x4)+parseInt(_0x67cfd4(0x110))/0x5+parseInt(_0x67cfd4(0x10f))/0x6*(-parseInt(_0x67cfd4(0xf4))/0x7)+parseInt(_0x67cfd4(0x10d))/0x8+parseInt(_0x67cfd4(0xf9))/0x9+-parseInt(_0x67cfd4(0xf3))/0xa;if(_0x19eff7===_0x299923)break;else _0x3fbf78['push'](_0x3fbf78['shift']());}catch(_0x27cb9f){_0x3fbf78['push'](_0x3fbf78['shift']());}}}(a148_0x393f,0x9c33e));function a148_0x3cb3(_0x5d7e79,_0x3c59d8){_0x5d7e79=_0x5d7e79-0xdf;const _0x393f59=a148_0x393f();let _0x3cb39e=_0x393f59[_0x5d7e79];return _0x3cb39e;}import{formatRows,hyperlink}from'./formatters.js';import a148_0xedd70a from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};function a148_0x393f(){const _0x12f899=['926664iqsprl','localeCompare','journeyBundleName','sortKey','showMetadata','base','folderCount','draft','└──\x20','\x20segment','launched','🗺️\x20','metadata','(running)','completed','├──\x20','20NADlnj','9324664pdkoYy','length','517026UrXCxx','4765045yJGYCb','getJourneyUrl','population','state','push','showTreeLines','(draft)','children','12itFHrf','dim','journey','\x20folder','(empty)','join','journeyCount','paused','2671flfxwt','getSegmentUrl','map','type','name','segmentCount','7164830bOpkJg','14LkupNp','\x20journey','showIcons','segment','icon','3270717UrBIWx','folder','sort'];a148_0x393f=function(){return _0x12f899;};return a148_0x393f();}export function formatTree(_0x147751,_0x4958d1={},_0x45976d=0x0,_0x4a316c=''){const _0x23ae04=a148_0x3cb3,_0x39e1a9={...DEFAULT_OPTIONS,..._0x4958d1},_0x3e1b0a=[],_0x31733d=[..._0x147751][_0x23ae04(0xfb)]((_0x27deb4,_0x25dd6c)=>_0x27deb4['name']['localeCompare'](_0x25dd6c[_0x23ae04(0xf1)],undefined,{'sensitivity':_0x23ae04(0x101)}));for(let _0x555fba=0x0;_0x555fba<_0x31733d['length'];_0x555fba++){const _0x3ec09d=_0x31733d[_0x555fba],_0x24fe86=_0x555fba===_0x31733d[_0x23ae04(0x10e)]-0x1;let _0x543826='';_0x45976d>0x0&&(_0x543826+=_0x4a316c);_0x39e1a9[_0x23ae04(0xe2)]&&_0x45976d>0x0&&(_0x543826+=a148_0xedd70a[_0x23ae04(0xe6)](_0x24fe86?_0x23ae04(0x104):_0x23ae04(0x10b)));if(_0x39e1a9[_0x23ae04(0xf6)]){if(_0x3ec09d[_0x23ae04(0xf0)]===_0x23ae04(0xfa))_0x543826+='📁\x20';else _0x3ec09d[_0x23ae04(0xf0)]===_0x23ae04(0xe7)?_0x543826+=_0x23ae04(0x107):_0x543826+='🎯\x20';}if(_0x39e1a9['getSegmentUrl']&&_0x3ec09d[_0x23ae04(0xf0)]===_0x23ae04(0xf7))_0x543826+=hyperlink(_0x3ec09d[_0x23ae04(0xf1)],_0x39e1a9[_0x23ae04(0xee)](_0x3ec09d['id']));else _0x39e1a9['getJourneyUrl']&&_0x3ec09d['type']===_0x23ae04(0xe7)?_0x543826+=hyperlink(_0x3ec09d[_0x23ae04(0xf1)],_0x39e1a9[_0x23ae04(0x111)](_0x3ec09d['id'])):_0x543826+=_0x3ec09d[_0x23ae04(0xf1)];if(_0x39e1a9[_0x23ae04(0x100)]){if(_0x3ec09d[_0x23ae04(0xf0)]===_0x23ae04(0xfa)){const _0x545250=[];_0x3ec09d[_0x23ae04(0x108)][_0x23ae04(0xf2)]&&_0x545250[_0x23ae04(0xe1)](_0x3ec09d[_0x23ae04(0x108)][_0x23ae04(0xf2)]+_0x23ae04(0x105)+(_0x3ec09d[_0x23ae04(0x108)][_0x23ae04(0xf2)]!==0x1?'s':'')),_0x3ec09d[_0x23ae04(0x108)][_0x23ae04(0x102)]&&_0x545250[_0x23ae04(0xe1)](_0x3ec09d[_0x23ae04(0x108)][_0x23ae04(0x102)]+_0x23ae04(0xe8)+(_0x3ec09d[_0x23ae04(0x108)][_0x23ae04(0x102)]!==0x1?'s':'')),_0x3ec09d['metadata'][_0x23ae04(0xeb)]&&_0x545250[_0x23ae04(0xe1)](_0x3ec09d[_0x23ae04(0x108)]['journeyCount']+_0x23ae04(0xf5)+(_0x3ec09d[_0x23ae04(0x108)][_0x23ae04(0xeb)]!==0x1?'s':'')),_0x545250['length']>0x0&&(_0x543826+=a148_0xedd70a[_0x23ae04(0xe6)]('\x20('+_0x545250[_0x23ae04(0xea)](',\x20')+')'));}else{if(_0x3ec09d[_0x23ae04(0xf0)]===_0x23ae04(0xf7)&&_0x3ec09d[_0x23ae04(0xdf)]!==undefined)_0x543826+=a148_0xedd70a['dim']('\x20('+formatRows(_0x3ec09d[_0x23ae04(0xdf)])+')');else _0x3ec09d[_0x23ae04(0xf0)]==='journey'&&_0x3ec09d[_0x23ae04(0xe0)]&&(_0x543826+=a148_0xedd70a['dim']('\x20'+getJourneyStateIndicator(_0x3ec09d[_0x23ae04(0xe0)])));}}_0x3e1b0a[_0x23ae04(0xe1)](_0x543826);if(_0x3ec09d[_0x23ae04(0xe4)]&&_0x3ec09d['children'][_0x23ae04(0x10e)]>0x0){let _0x56b0cd;if(_0x45976d===0x0)_0x56b0cd='';else _0x39e1a9[_0x23ae04(0xe2)]?_0x56b0cd=_0x4a316c+(_0x24fe86?'\x20\x20\x20\x20':a148_0xedd70a[_0x23ae04(0xe6)]('│')+'\x20\x20\x20'):_0x56b0cd=_0x4a316c+_0x39e1a9['indent'];const _0x15d8df=formatTree(_0x3ec09d[_0x23ae04(0xe4)],_0x39e1a9,_0x45976d+0x1,_0x56b0cd);_0x3e1b0a[_0x23ae04(0xe1)](_0x15d8df);}}return _0x3e1b0a['join']('\x0a');}export function formatFlatList(_0x223404,_0xc19b39,_0x6978f0={},_0xdd9f65=[]){const _0x4ccd2f=a148_0x3cb3,_0x48100f={...DEFAULT_OPTIONS,..._0x6978f0},_0x25be84=[];for(const _0xf05026 of _0x223404){_0x25be84[_0x4ccd2f(0xe1)]({'sortKey':_0xf05026[_0x4ccd2f(0xf1)],'displayName':_0xf05026[_0x4ccd2f(0xf1)],'icon':_0x48100f['showIcons']?'📁':'','metadata':undefined});}for(const _0x254db9 of _0xc19b39){const _0x20b8c1=_0x48100f[_0x4ccd2f(0x100)]&&_0x254db9[_0x4ccd2f(0xdf)]!==undefined?a148_0xedd70a['dim']('\x20('+formatRows(_0x254db9[_0x4ccd2f(0xdf)])+')'):'',_0x14343d=_0x48100f['getSegmentUrl']?hyperlink(_0x254db9[_0x4ccd2f(0xf1)],_0x48100f[_0x4ccd2f(0xee)](_0x254db9['id'])):_0x254db9[_0x4ccd2f(0xf1)];_0x25be84[_0x4ccd2f(0xe1)]({'sortKey':_0x254db9[_0x4ccd2f(0xf1)],'displayName':_0x14343d,'icon':_0x48100f[_0x4ccd2f(0xf6)]?'🎯':'','metadata':_0x20b8c1});}for(const _0x4c56a1 of _0xdd9f65){const _0x31c73e=getJourneyStateIndicator(_0x4c56a1[_0x4ccd2f(0xe0)]),_0x6e7230=_0x48100f[_0x4ccd2f(0x100)]?a148_0xedd70a[_0x4ccd2f(0xe6)]('\x20'+_0x31c73e):'',_0x4617fa=_0x48100f['getJourneyUrl']?hyperlink(_0x4c56a1[_0x4ccd2f(0xfe)],_0x48100f[_0x4ccd2f(0x111)](_0x4c56a1['id'])):_0x4c56a1[_0x4ccd2f(0xfe)];_0x25be84[_0x4ccd2f(0xe1)]({'sortKey':_0x4c56a1[_0x4ccd2f(0xfe)],'displayName':_0x4617fa,'icon':_0x48100f[_0x4ccd2f(0xf6)]?'🗺️':'','metadata':_0x6e7230});}_0x25be84['sort']((_0x59f986,_0x37120a)=>_0x59f986[_0x4ccd2f(0xff)][_0x4ccd2f(0xfd)](_0x37120a['sortKey'],undefined,{'sensitivity':_0x4ccd2f(0x101)}));if(_0x25be84['length']===0x0)return _0x4ccd2f(0xe9);const _0x1f2361=_0x25be84[_0x4ccd2f(0xef)](_0x11bda6=>{const _0x1bd75e=_0x4ccd2f,_0x2ec21e=_0x11bda6['icon']?_0x11bda6[_0x1bd75e(0xf8)]+'\x20':'',_0x4e27c6=_0x11bda6[_0x1bd75e(0x108)]||'';return''+_0x2ec21e+_0x11bda6['displayName']+_0x4e27c6;});return _0x1f2361[_0x4ccd2f(0xea)]('\x0a');}function getJourneyStateIndicator(_0x466db6){const _0x5cec6b=a148_0x3cb3;switch(_0x466db6){case _0x5cec6b(0x103):return _0x5cec6b(0xe3);case _0x5cec6b(0x106):return _0x5cec6b(0x109);case _0x5cec6b(0xec):return'(paused)';case _0x5cec6b(0x10a):return'(completed)';default:return'('+_0x466db6+')';}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x42a201,_0x287979){const _0x32e2fa=a149_0x2b9c,_0x4f2aa1=_0x42a201();while(!![]){try{const _0x27a217=-parseInt(_0x32e2fa(0x1d3))/0x1*(-parseInt(_0x32e2fa(0x1ec))/0x2)+parseInt(_0x32e2fa(0x1d9))/0x3+-parseInt(_0x32e2fa(0x1d5))/0x4*(parseInt(_0x32e2fa(0x1ee))/0x5)+parseInt(_0x32e2fa(0x1d0))/0x6*(parseInt(_0x32e2fa(0x1ca))/0x7)+-parseInt(_0x32e2fa(0x1de))/0x8+parseInt(_0x32e2fa(0x1df))/0x9*(-parseInt(_0x32e2fa(0x1d1))/0xa)+parseInt(_0x32e2fa(0x1dd))/0xb;if(_0x27a217===_0x287979)break;else _0x4f2aa1['push'](_0x4f2aa1['shift']());}catch(_0x25bd53){_0x4f2aa1['push'](_0x4f2aa1['shift']());}}}(a149_0x3802,0x8e8b4));import{promises as a149_0x32bd4b}from'fs';function a149_0x3802(){const _0x3d5e40=['name','endsWith','archive.tar.gz','newProjectName','access','tmpdir','resolve','readdir','create','push','sourceProjectName','isDirectory','295954BBtSpe','sourceDir','315RWdpxj','tdx.json','length','\x20workflow\x20files\x20found\x20in\x20','208026CajYzJ','filter','revision','skipValidation','Source\x20directory\x20not\x20found:\x20','workflow_project','18MvlKff','280120lLRzFj','No\x20','1KYrJYX','listProjects','72100UJWALL','data','find','uploadProjectArchive','1319172BSpONS','mkdtemp','join','replace','13370005aFgRRP','934808gQufQI','18aNZCYj'];a149_0x3802=function(){return _0x3d5e40;};return a149_0x3802();}import a149_0x3c3b11 from'path';import a149_0x4dac6a from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';function a149_0x2b9c(_0x36ecc7,_0x254bf3){_0x36ecc7=_0x36ecc7-0x1ca;const _0x38023b=a149_0x3802();let _0x2b9c4e=_0x38023b[_0x36ecc7];return _0x2b9c4e;}export async function prepareCloneWorkflow(_0x5e8a58,_0x359858,_0x331350,_0x3cfba4={}){const _0x10dff2=a149_0x2b9c,{client:_0x1ccfa2}=_0x5e8a58,_0x29f27b=a149_0x3c3b11[_0x10dff2(0x1e6)](_0x359858);try{await a149_0x32bd4b[_0x10dff2(0x1e4)](_0x29f27b);}catch{throw new Error(_0x10dff2(0x1ce)+_0x359858);}const _0x4fdfc4=tryFindWorkflowTdxConfig(_0x29f27b),_0x2474a6=_0x4fdfc4?.['config'][_0x10dff2(0x1cf)],_0x4ef125=_0x3cfba4[_0x10dff2(0x1cc)]||new Date()['toISOString']()[_0x10dff2(0x1dc)](/[:.]/g,'-');if(!_0x3cfba4[_0x10dff2(0x1cd)]){const _0x418457=await a149_0x32bd4b[_0x10dff2(0x1e7)](_0x29f27b),_0x174a1a=_0x418457[_0x10dff2(0x1cb)](_0x4f2984=>_0x4f2984[_0x10dff2(0x1e1)](WORKFLOW_FILE_EXTENSION));if(_0x174a1a[_0x10dff2(0x1f0)]===0x0)throw new Error(_0x10dff2(0x1d2)+WORKFLOW_FILE_EXTENSION+_0x10dff2(0x1f1)+_0x29f27b);}const _0x522564=await getProjectFiles(_0x29f27b);let _0x4aa28b=![],_0x1a60ac;try{const _0x1f5630=await _0x1ccfa2[_0x10dff2(0x1d4)]({'name_pattern':_0x331350}),_0x12fc2e=_0x1f5630[_0x10dff2(0x1d6)][_0x10dff2(0x1d7)](_0xec1c79=>_0xec1c79[_0x10dff2(0x1e0)]===_0x331350);_0x12fc2e&&(_0x4aa28b=!![],_0x1a60ac=_0x12fc2e['id']);}catch{}return{'sourceDir':_0x29f27b,'sourceProjectName':_0x2474a6,'newProjectName':_0x331350,'revision':_0x4ef125,'fileCount':_0x522564[_0x10dff2(0x1f0)],'files':_0x522564,'targetExists':_0x4aa28b,'existingProjectId':_0x1a60ac};}export async function executeCloneWorkflow(_0x6ea19c,_0x1a315b){const _0x47686c=a149_0x2b9c,_0x2b1a34=await import('tar'),{client:_0x34c052}=_0x6ea19c,_0xe1bd79=await getProjectFiles(_0x1a315b[_0x47686c(0x1ed)]),_0x48a467=await a149_0x32bd4b[_0x47686c(0x1da)](a149_0x3c3b11[_0x47686c(0x1db)](a149_0x4dac6a[_0x47686c(0x1e5)](),'tdx-wf-clone-')),_0x28fbf1=a149_0x3c3b11[_0x47686c(0x1db)](_0x48a467,_0x47686c(0x1e2));try{await _0x2b1a34[_0x47686c(0x1e8)]({'file':_0x28fbf1,'gzip':!![],'cwd':_0x1a315b['sourceDir'],'portable':!![]},_0xe1bd79);const _0x50cced=await _0x34c052[_0x47686c(0x1d8)](_0x1a315b[_0x47686c(0x1e3)],_0x1a315b[_0x47686c(0x1cc)],_0x28fbf1);return{'sourceDir':_0x1a315b[_0x47686c(0x1ed)],'sourceProjectName':_0x1a315b[_0x47686c(0x1ea)],'newProjectName':_0x50cced['name'],'newProjectId':_0x50cced['id'],'revision':_0x50cced[_0x47686c(0x1cc)],'fileCount':_0xe1bd79[_0x47686c(0x1f0)],'files':_0xe1bd79};}finally{await a149_0x32bd4b['rm'](_0x48a467,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x53e3e5,_0x5f2a80=''){const _0x51f4ae=a149_0x2b9c,_0x80fe58=[],_0x11ddf3=await a149_0x32bd4b[_0x51f4ae(0x1e7)](_0x53e3e5,{'withFileTypes':!![]});for(const _0x574dd5 of _0x11ddf3){const _0x44ec71=_0x5f2a80?a149_0x3c3b11[_0x51f4ae(0x1db)](_0x5f2a80,_0x574dd5[_0x51f4ae(0x1e0)]):_0x574dd5[_0x51f4ae(0x1e0)];if(_0x574dd5['name']===_0x51f4ae(0x1ef))continue;if(!shouldIncludeInArchive(_0x574dd5[_0x51f4ae(0x1e0)]))continue;if(_0x574dd5[_0x51f4ae(0x1eb)]()){const _0x5b51c2=await getProjectFiles(a149_0x3c3b11['join'](_0x53e3e5,_0x574dd5['name']),_0x44ec71);_0x80fe58[_0x51f4ae(0x1e9)](..._0x5b51c2);}else _0x80fe58[_0x51f4ae(0x1e9)](_0x44ec71);}return _0x80fe58;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a150_0x167714=a150_0x58d0;(function(_0x43bf9b,_0x4785b0){const _0x3610c0=a150_0x58d0,_0x5eb531=_0x43bf9b();while(!![]){try{const _0x237975=-parseInt(_0x3610c0(0x1b8))/0x1*(-parseInt(_0x3610c0(0x206))/0x2)+parseInt(_0x3610c0(0x1ba))/0x3+-parseInt(_0x3610c0(0x228))/0x4+-parseInt(_0x3610c0(0x1f6))/0x5*(-parseInt(_0x3610c0(0x1c8))/0x6)+parseInt(_0x3610c0(0x1cb))/0x7+parseInt(_0x3610c0(0x1f8))/0x8+parseInt(_0x3610c0(0x1ec))/0x9*(-parseInt(_0x3610c0(0x217))/0xa);if(_0x237975===_0x4785b0)break;else _0x5eb531['push'](_0x5eb531['shift']());}catch(_0x204f4f){_0x5eb531['push'](_0x5eb531['shift']());}}}(a150_0x3be5,0x3aebe));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';function a150_0x58d0(_0x5e8629,_0x5855f3){_0x5e8629=_0x5e8629-0x1ae;const _0x3be551=a150_0x3be5();let _0x58d0ab=_0x3be551[_0x5e8629];return _0x58d0ab;}const MAX_PAGINATION_LIMIT=0x3e8;async function paginateResults(_0x56121f,_0x5322a3,_0x54eb72=0x64){const _0x1bc766=a150_0x58d0,_0x146920=Math['min'](_0x5322a3,MAX_PAGINATION_LIMIT),_0x41a532=[];let _0x2b3d21;while(_0x41a532[_0x1bc766(0x1b9)]<_0x146920){const _0x2b6b06=await _0x56121f(_0x54eb72,_0x2b3d21),_0x4f4868=_0x2b6b06[_0x1bc766(0x1cc)]??_0x2b6b06[_0x1bc766(0x203)][_0x1bc766(0x1b9)];if(_0x4f4868===0x0)break;_0x41a532[_0x1bc766(0x210)](..._0x2b6b06[_0x1bc766(0x203)]);if(!_0x2b6b06['lastId']||_0x4f4868<_0x54eb72)break;_0x2b3d21=_0x2b6b06[_0x1bc766(0x223)];}return _0x41a532[_0x1bc766(0x201)](0x0,_0x146920);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';function a150_0x3be5(){const _0x4096f8=['path','fullName','Cannot\x20read\x20workflow\x20file:\x20','error','Kill\x20request\x20accepted','projectName','66318BDJufd','tdx-workflow-','executePushProject','245910UsothS','rawCount','sessionUuid','startedAt','retryAttemptName','getAttempt','createdAt','filter','arrayBuffer','tasks','toTime','includeRetried','utf-8','sessionTime','state','attempt','revision','parentId','extract','updatedAt','substring','preparePushProject','lastAttempt','force','pullProject','uploadProjectArchive','downloadProjectArchive','workflowName','replace','listLogFiles','Invalid\x20workflow\x20format:\x20','test','limit','7056icnBXw','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','upstreams','isDirectory','create','setSecret','readdir','prepareCloneProject','Failed\x20to\x20download\x20log\x20file:\x20','scheduleFrom','45xHBULo','now','2984472YxaECj','Project\x20directory\x20not\x20found:\x20','sessionId','join','find','direct','Project\x20not\x20found:\x20','storeParams','clearSchedule','slice','logger','data','retrySession','kill','36AjfyKF','logFiles','done','.tar.gz','project','retryParams','name','workflows','NUMERIC_ID_PATTERN','applyPullProject','push','download','last_id','zlib','startAttempt','listProjects','deleteSecret','3280PoLaLs','unlink','No\x20','sessions','config','listSecrets','killAttempt','mkdir','logs','retryAt','gunzip','params','lastId','message','util','access','deleteProject','858948JCrVAD','getAttemptTasks','status','\x20workflow\x20files\x20found\x20in\x20project\x20directory','from','index','endsWith','latest','tar','cancelRequested','stateParams','getProject','client','attempts','workflow','toString','2946veYVCN','length','457611RDarnn','bind','projects','toISOString','tmpdir','retryAttempt','resolveProjectId','map'];a150_0x3be5=function(){return _0x4096f8;};return a150_0x3be5();}import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a150_0x167714(0x20e)]=/^\d+$/;[a150_0x167714(0x1b4)];constructor(_0x330872){const _0x2e18cb=a150_0x167714;this[_0x2e18cb(0x1b4)]=new WorkflowApiClient(_0x330872,_0x330872[_0x2e18cb(0x202)]);}async['resolveProjectId'](_0x529030){const _0x36a29e=a150_0x167714;if(WorkflowSDK['NUMERIC_ID_PATTERN'][_0x36a29e(0x1ea)](_0x529030)){const _0x29edf1=await this[_0x36a29e(0x1b4)][_0x36a29e(0x1b3)](_0x529030);return{'id':_0x29edf1['id'],'name':_0x29edf1[_0x36a29e(0x20c)]};}const _0x1a3b71=await this[_0x36a29e(0x1b4)][_0x36a29e(0x215)]({'name_pattern':_0x529030}),_0x10fe9b=_0x1a3b71['data'][_0x36a29e(0x1fc)](_0x25f4e2=>_0x25f4e2[_0x36a29e(0x20c)]===_0x529030);if(!_0x10fe9b)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],'Project\x20not\x20found:\x20'+_0x529030);return{'id':_0x10fe9b['id'],'name':_0x10fe9b[_0x36a29e(0x20c)]};}async[a150_0x167714(0x1bc)](_0x21b7f9,_0x4d7c30){const _0x5876d5=a150_0x167714,_0x58a581=_0x4d7c30?.[_0x5876d5(0x1eb)]||0x64,_0x28dad8=await paginateResults((_0x26ad36,_0x46b49d)=>this['client']['listProjects']({'name_pattern':_0x21b7f9,'limit':_0x26ad36,'last_id':_0x46b49d??_0x4d7c30?.['last_id']}),_0x58a581);return _0x28dad8[_0x5876d5(0x1c1)](_0x108936=>({..._0x108936,'project_id':_0x108936['id'],'project_name':_0x108936[_0x5876d5(0x20c)]}));}async[a150_0x167714(0x20d)](_0xf20937,_0xb4fb01){const _0xb6c505=a150_0x167714,_0x2a8e91=_0xb4fb01?.[_0xb6c505(0x1eb)]||0x64,_0x5db5c4=await paginateResults((_0x48b730,_0x1271cb)=>this[_0xb6c505(0x1b4)]['listWorkflows']({'project_name':_0xf20937,'limit':_0x48b730,'last_id':_0x1271cb??_0xb4fb01?.['last_id']}),_0x2a8e91);return _0x5db5c4['map'](_0xbb773c=>({'project_id':_0xbb773c['project']?.['id'],'project_name':_0xbb773c[_0xb6c505(0x20a)]?.[_0xb6c505(0x20c)],'workflow_id':_0xbb773c['id'],'workflow_name':_0xbb773c['name'],'revision':_0xbb773c[_0xb6c505(0x1db)],'timezone':_0xbb773c['timezone'],'config':_0xbb773c[_0xb6c505(0x21b)],'id':_0xbb773c['id'],'name':_0xbb773c[_0xb6c505(0x20c)],'project':_0xbb773c[_0xb6c505(0x20a)]}));}async[a150_0x167714(0x21a)](_0xdcdfc6){const _0x4ccc5d=a150_0x167714;let _0x257662;if(_0xdcdfc6?.[_0x4ccc5d(0x1c7)]){let _0x5f7631,_0x5547ab=![];while(!_0x5547ab){const _0x2c3708=await this[_0x4ccc5d(0x1b4)][_0x4ccc5d(0x215)]({'limit':0x64,'last_id':_0x5f7631}),_0x1fca98=_0x2c3708['data']['find'](_0x47d997=>_0x47d997[_0x4ccc5d(0x20c)]===_0xdcdfc6[_0x4ccc5d(0x1c7)]);if(_0x1fca98){_0x257662=_0x1fca98['id'],_0x5547ab=!![];break;}if(!_0x2c3708[_0x4ccc5d(0x223)]||_0x2c3708['data'][_0x4ccc5d(0x1b9)]===0x0)break;_0x5f7631=_0x2c3708[_0x4ccc5d(0x223)];}if(!_0x257662)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],_0x4ccc5d(0x1fe)+_0xdcdfc6[_0x4ccc5d(0x1c7)]);}const _0x25bc4b=_0xdcdfc6?.[_0x4ccc5d(0x1eb)]||0x64,_0x55684a=await paginateResults((_0x402d17,_0x5a5b48)=>this['client']['listSessions']({'project_id':_0x257662,'project_name':_0xdcdfc6?.[_0x4ccc5d(0x1c7)],'workflow_name':_0xdcdfc6?.[_0x4ccc5d(0x1e6)],'status':_0xdcdfc6?.[_0x4ccc5d(0x22a)],'from_time':_0xdcdfc6?.['fromTime'],'to_time':_0xdcdfc6?.[_0x4ccc5d(0x1d5)],'limit':_0x402d17,'last_id':_0x5a5b48??_0xdcdfc6?.[_0x4ccc5d(0x212)]}),_0x25bc4b);return _0x55684a[_0x4ccc5d(0x1c1)](_0x37d27a=>({'project_id':_0x37d27a[_0x4ccc5d(0x20a)]?.['id'],'project_name':_0x37d27a['project']?.[_0x4ccc5d(0x20c)],'workflow_id':_0x37d27a[_0x4ccc5d(0x1b6)]?.['id'],'workflow_name':_0x37d27a['workflow']?.[_0x4ccc5d(0x20c)],'session_id':_0x37d27a['id'],'sessionUuid':_0x37d27a['sessionUuid'],'sessionTime':_0x37d27a[_0x4ccc5d(0x1d8)],'lastAttempt':_0x37d27a[_0x4ccc5d(0x1e1)],'id':_0x37d27a['id'],'project':_0x37d27a[_0x4ccc5d(0x20a)],'workflow':_0x37d27a[_0x4ccc5d(0x1b6)]}));}async[a150_0x167714(0x1b5)](_0x3abc3c){const _0x244a41=a150_0x167714,_0x3a40e7=_0x3abc3c?.[_0x244a41(0x1eb)]||0x64,_0x874641=await paginateResults((_0x625722,_0x511aad)=>this['client']['listAttempts']({'project_name':_0x3abc3c?.[_0x244a41(0x1c7)],'workflow_name':_0x3abc3c?.[_0x244a41(0x1e6)],'include_retried':_0x3abc3c?.[_0x244a41(0x1d6)],'limit':_0x625722,'last_id':_0x511aad??_0x3abc3c?.[_0x244a41(0x212)]}),_0x3a40e7);return _0x874641[_0x244a41(0x1c1)](_0x1213da=>({'project_id':_0x1213da[_0x244a41(0x20a)]?.['id'],'project_name':_0x1213da[_0x244a41(0x20a)]?.[_0x244a41(0x20c)],'workflow_id':_0x1213da[_0x244a41(0x1b6)]?.['id'],'workflow_name':_0x1213da['workflow']?.[_0x244a41(0x20c)],'session_id':_0x1213da[_0x244a41(0x1fa)],'sessionUuid':_0x1213da[_0x244a41(0x1cd)],'sessionTime':_0x1213da[_0x244a41(0x1d8)],'attempt_id':_0x1213da['id'],'attempt_index':_0x1213da[_0x244a41(0x22d)],'retryAttemptName':_0x1213da[_0x244a41(0x1cf)],'done':_0x1213da[_0x244a41(0x208)],'success':_0x1213da['success'],'cancelRequested':_0x1213da[_0x244a41(0x1b1)],'params':_0x1213da[_0x244a41(0x222)],'createdAt':_0x1213da[_0x244a41(0x1d1)],'finishedAt':_0x1213da['finishedAt'],'id':_0x1213da['id'],'index':_0x1213da[_0x244a41(0x22d)],'project':_0x1213da[_0x244a41(0x20a)],'workflow':_0x1213da['workflow']}));}async[a150_0x167714(0x1da)](_0x579a82){const _0x261853=a150_0x167714,_0x2cfee4=await this[_0x261853(0x1b4)][_0x261853(0x1d0)](_0x579a82);return _0x2cfee4;}async[a150_0x167714(0x1d4)](_0x10b969,_0xa743be=![]){const _0x578598=a150_0x167714,_0x4a06f7=await this[_0x578598(0x1b4)][_0x578598(0x229)](_0x10b969,_0xa743be);return _0x4a06f7['map'](_0x48adce=>({'task_id':_0x48adce['id'],'task_name':_0x48adce['fullName'],'parentId':_0x48adce[_0x578598(0x1dc)],'config':_0x48adce[_0x578598(0x21b)],'upstreams':_0x48adce[_0x578598(0x1ee)],'state':_0x48adce[_0x578598(0x1d9)],'exportParams':_0x48adce['exportParams'],'storeParams':_0x48adce[_0x578598(0x1ff)],'stateParams':_0x48adce[_0x578598(0x1b2)],'updatedAt':_0x48adce[_0x578598(0x1de)],'retryAt':_0x48adce[_0x578598(0x220)],'startedAt':_0x48adce[_0x578598(0x1ce)],'error':_0x48adce[_0x578598(0x1c5)],'isGroup':_0x48adce['isGroup'],'id':_0x48adce['id'],'fullName':_0x48adce[_0x578598(0x1c3)]}));}async[a150_0x167714(0x207)](_0xf63de9,_0x346141){const _0x4623fb=a150_0x167714;return await this[_0x4623fb(0x1b4)][_0x4623fb(0x1e8)](_0xf63de9,_0x346141);}async[a150_0x167714(0x21f)](_0x56d1cd,_0x8fba21){const _0x2f8adc=a150_0x167714,_0x5cf8a0=await import(_0x2f8adc(0x213)),{promisify:_0x198d2b}=await import(_0x2f8adc(0x225)),_0x56373e=_0x198d2b(_0x5cf8a0[_0x2f8adc(0x221)]),_0x5bae8b=await this[_0x2f8adc(0x1b4)][_0x2f8adc(0x1e8)](_0x56d1cd,_0x8fba21);if(_0x5bae8b[_0x2f8adc(0x1b9)]===0x0)return'';const _0x5787dd=[];for(const _0x46584c of _0x5bae8b){if(!_0x46584c[_0x2f8adc(0x1fd)])continue;const _0x4d97ce=await fetch(_0x46584c[_0x2f8adc(0x1fd)]);if(!_0x4d97ce['ok'])throw new Error(_0x2f8adc(0x1f4)+_0x4d97ce[_0x2f8adc(0x22a)]);const _0x1f5599=Buffer[_0x2f8adc(0x22c)](await _0x4d97ce[_0x2f8adc(0x1d3)]()),_0x4323c1=await _0x56373e(_0x1f5599);_0x5787dd[_0x2f8adc(0x210)](_0x4323c1[_0x2f8adc(0x1b7)](_0x2f8adc(0x1d7)));}return _0x5787dd[_0x2f8adc(0x1fb)]('\x0a');}async[a150_0x167714(0x205)](_0x11a25e,_0x2fcd9b){const _0x13f990=a150_0x167714,_0x528219=await this[_0x13f990(0x1b4)][_0x13f990(0x21d)](_0x11a25e,_0x2fcd9b);return _0x528219?.[_0x13f990(0x224)]??_0x13f990(0x1c6);}async[a150_0x167714(0x204)](_0x57d297,_0x5b65ed){const _0x2c2803=a150_0x167714,_0x385611=await this[_0x2c2803(0x1b4)][_0x2c2803(0x204)](_0x57d297,{'from_task':_0x5b65ed?.['fromTask'],'retry_params':_0x5b65ed?.[_0x2c2803(0x20b)]});return{'attemptId':_0x385611['id'],'sessionId':_0x385611[_0x2c2803(0x1fa)]};}async['retryAttempt'](_0x203091,_0x19739f){const _0x42a56e=a150_0x167714,_0x9e69a4=await this[_0x42a56e(0x1b4)][_0x42a56e(0x1bf)](_0x203091,{'resume_from':_0x19739f?.['resumeFrom'],'retry_params':_0x19739f?.['retryParams'],'force':_0x19739f?.[_0x42a56e(0x1e2)]});return{'attemptId':_0x9e69a4['id'],'sessionId':_0x9e69a4['sessionId']};}async['run'](_0x931939,_0x512f7b={},_0x51cc70){const _0x5f4909=a150_0x167714,_0x15e089=_0x931939['indexOf']('.');let _0x282826,_0x583661;if(_0x15e089===-0x1)throw new Error(_0x5f4909(0x1ed));_0x282826=_0x931939[_0x5f4909(0x1df)](0x0,_0x15e089),_0x583661=_0x931939[_0x5f4909(0x1df)](_0x15e089+0x1);if(!_0x282826||!_0x583661)throw new Error(_0x5f4909(0x1e9)+_0x931939+'.\x20Expected\x20\x22project.workflow\x22');const _0x4ebcce=_0x51cc70?.[_0x5f4909(0x1d8)]||new Date()[_0x5f4909(0x1bd)]();return await this['client'][_0x5f4909(0x214)]({'projectName':_0x282826,'workflowName':_0x583661,'sessionTime':_0x4ebcce,'params':_0x512f7b});}async[a150_0x167714(0x211)](_0x227be4,_0xa6f642,_0x286922){const _0x851ce9=a150_0x167714,{promises:_0x1886a8}=await import('fs'),_0x1458db=await import(_0x851ce9(0x1c2)),_0x1ed2d4=await import('os'),_0x3201c8=await import(_0x851ce9(0x1b0)),{id:_0xdeee09,name:_0x4e8882}=await this[_0x851ce9(0x1c0)](_0x227be4),_0xe2f910=_0x1ed2d4[_0x851ce9(0x1be)](),_0x1dd191=_0x1458db[_0x851ce9(0x1fb)](_0xe2f910,_0x851ce9(0x1c9)+_0xdeee09+'-'+Date[_0x851ce9(0x1f7)]()+_0x851ce9(0x209));try{await this[_0x851ce9(0x1b4)][_0x851ce9(0x1e5)](_0xdeee09,_0x1dd191,_0x286922?.[_0x851ce9(0x1db)]);const _0x179ecc=_0x1458db['join'](_0xa6f642,_0x4e8882);await _0x1886a8[_0x851ce9(0x21e)](_0x179ecc,{'recursive':!![]}),await _0x3201c8[_0x851ce9(0x1dd)]({'file':_0x1dd191,'cwd':_0x179ecc,'gzip':!![]});const _0x57e32f=async _0x1ded96=>{const _0x2e1e24=_0x851ce9;let _0x431a92=0x0;const _0x21a705=await _0x1886a8[_0x2e1e24(0x1f2)](_0x1ded96,{'withFileTypes':!![]});for(const _0x19a7e5 of _0x21a705){const _0x7166ae=_0x1458db['join'](_0x1ded96,_0x19a7e5['name']);if(_0x19a7e5['isFile']())_0x431a92++;else _0x19a7e5[_0x2e1e24(0x1ef)]()&&(_0x431a92+=await _0x57e32f(_0x7166ae));}return _0x431a92;},_0x5b4388=await _0x57e32f(_0x179ecc);return{'projectName':_0x4e8882,'revision':_0x286922?.[_0x851ce9(0x1db)]||_0x851ce9(0x1af),'filesExtracted':_0x5b4388};}finally{try{await _0x1886a8[_0x851ce9(0x218)](_0x1dd191);}catch{}}}async['push'](_0x1b97b4,_0x2a20eb){const _0x26fa9f=a150_0x167714,{promises:_0x5d13b2}=await import('fs'),_0x1321d0=await import('path'),_0x5da3ca=await import(_0x26fa9f(0x1b0)),_0x5bdfb1=_0x2a20eb?.[_0x26fa9f(0x1c7)]||_0x1321d0['basename'](_0x1b97b4),_0x3f80e8=_0x2a20eb?.[_0x26fa9f(0x1db)]||new Date()[_0x26fa9f(0x1bd)]()[_0x26fa9f(0x1e7)](/[:.]/g,'-');try{await _0x5d13b2[_0x26fa9f(0x226)](_0x1b97b4);}catch{throw new Error(_0x26fa9f(0x1f9)+_0x1b97b4);}if(!_0x2a20eb?.['skipValidation']){const _0x22aee3=await _0x5d13b2[_0x26fa9f(0x1f2)](_0x1b97b4),_0x10e391=_0x22aee3[_0x26fa9f(0x1d2)](_0x21a1a6=>_0x21a1a6[_0x26fa9f(0x1ae)](WORKFLOW_FILE_EXTENSION));if(_0x10e391['length']===0x0)throw new Error(_0x26fa9f(0x219)+WORKFLOW_FILE_EXTENSION+_0x26fa9f(0x22b));for(const _0x20e075 of _0x10e391){const _0x4b022b=_0x1321d0[_0x26fa9f(0x1fb)](_0x1b97b4,_0x20e075);try{await _0x5d13b2[_0x26fa9f(0x226)](_0x4b022b);}catch{throw new Error(_0x26fa9f(0x1c4)+_0x20e075);}}}const _0x25e156=async(_0xd16c9c,_0x4984f1='')=>{const _0x1f4e51=_0x26fa9f,_0x393dd7=await _0x5d13b2[_0x1f4e51(0x1f2)](_0xd16c9c,{'withFileTypes':!![]}),_0x509ad5=[];for(const _0x3b6f4f of _0x393dd7){const _0x3b98be=_0x1321d0[_0x1f4e51(0x1fb)](_0x4984f1,_0x3b6f4f[_0x1f4e51(0x20c)]),_0x2f2f16=_0x1321d0[_0x1f4e51(0x1fb)](_0xd16c9c,_0x3b6f4f[_0x1f4e51(0x20c)]);if(!shouldIncludeInArchive(_0x3b6f4f[_0x1f4e51(0x20c)]))continue;_0x3b6f4f[_0x1f4e51(0x1ef)]()?_0x509ad5[_0x1f4e51(0x210)](...await _0x25e156(_0x2f2f16,_0x3b98be)):_0x509ad5[_0x1f4e51(0x210)](_0x3b98be);}return _0x509ad5;},_0x1af9c6=await _0x25e156(_0x1b97b4),_0x11fc79=await import('os'),_0x19b294=_0x11fc79[_0x26fa9f(0x1be)](),_0x6047de=_0x1321d0[_0x26fa9f(0x1fb)](_0x19b294,'tdx-workflow-push-'+Date[_0x26fa9f(0x1f7)]()+_0x26fa9f(0x209));try{await _0x5da3ca[_0x26fa9f(0x1f0)]({'file':_0x6047de,'gzip':!![],'cwd':_0x1b97b4,'portable':!![]},_0x1af9c6);const _0x4fa5b5=await this[_0x26fa9f(0x1b4)][_0x26fa9f(0x1e4)](_0x5bdfb1,_0x3f80e8,_0x6047de,{'scheduleFrom':_0x2a20eb?.[_0x26fa9f(0x1f5)],'clearSchedule':_0x2a20eb?.[_0x26fa9f(0x200)],'clearScheduleAll':_0x2a20eb?.['clearScheduleAll']});return{'projectId':_0x4fa5b5['id'],'projectName':_0x4fa5b5[_0x26fa9f(0x20c)],'revision':_0x4fa5b5[_0x26fa9f(0x1db)]};}finally{try{await _0x5d13b2[_0x26fa9f(0x218)](_0x6047de);}catch{}}}async['delete'](_0x145784){const _0x455fcc=a150_0x167714,{id:_0xa90a82}=await this[_0x455fcc(0x1c0)](_0x145784),_0x1dfa8f=await this[_0x455fcc(0x1b4)][_0x455fcc(0x227)](_0xa90a82);return{'projectId':_0x1dfa8f['id'],'projectName':_0x1dfa8f[_0x455fcc(0x20c)]};}async['listSecrets'](_0x4e581f){const _0x2bff91=a150_0x167714,{id:_0x18c26b,name:_0x1bb38a}=await this['resolveProjectId'](_0x4e581f),_0x53df43=await this[_0x2bff91(0x1b4)][_0x2bff91(0x21c)](_0x18c26b);return{'projectName':_0x1bb38a,'secrets':_0x53df43};}async[a150_0x167714(0x1f1)](_0x5d70e6,_0x1d1141,_0x1d73cf){const _0xe0219c=a150_0x167714,{id:_0x1195fb,name:_0x1e0700}=await this[_0xe0219c(0x1c0)](_0x5d70e6);return await this[_0xe0219c(0x1b4)][_0xe0219c(0x1f1)](_0x1195fb,_0x1d1141,_0x1d73cf),{'projectName':_0x1e0700,'key':_0x1d1141};}async[a150_0x167714(0x216)](_0x24b570,_0x4e60cf){const _0x59e149=a150_0x167714,{id:_0x3f6038,name:_0x2991c4}=await this['resolveProjectId'](_0x24b570);return await this[_0x59e149(0x1b4)]['deleteSecret'](_0x3f6038,_0x4e60cf),{'projectName':_0x2991c4,'key':_0x4e60cf};}async[a150_0x167714(0x1e3)](_0x3c8e83,_0x4a831c){const _0x4d0b8c=a150_0x167714;return pullWorkflow({'client':this[_0x4d0b8c(0x1b4)],'resolveProjectId':this[_0x4d0b8c(0x1c0)][_0x4d0b8c(0x1bb)](this)},_0x3c8e83,_0x4a831c);}async[a150_0x167714(0x20f)](_0x26e102,_0x15efe6){const _0x5bec68=a150_0x167714;return applyPullResult({'client':this[_0x5bec68(0x1b4)],'resolveProjectId':this[_0x5bec68(0x1c0)][_0x5bec68(0x1bb)](this)},_0x26e102,_0x15efe6);}async[a150_0x167714(0x1e0)](_0xce71f7){const _0xa55750=a150_0x167714;return preparePushWorkflow({'client':this[_0xa55750(0x1b4)],'resolveProjectId':this['resolveProjectId']['bind'](this)},_0xce71f7);}async[a150_0x167714(0x1ca)](_0xa7ea58){return executePushWorkflow({'client':this['client'],'resolveProjectId':this['resolveProjectId']['bind'](this)},_0xa7ea58);}async[a150_0x167714(0x1f3)](_0x2f101b,_0x56d238,_0x4ee2f7){const _0xbf7886=a150_0x167714;return prepareCloneWorkflow({'client':this[_0xbf7886(0x1b4)]},_0x2f101b,_0x56d238,_0x4ee2f7);}async['executeCloneProject'](_0x2df879){const _0x4ed2aa=a150_0x167714;return executeCloneWorkflow({'client':this[_0x4ed2aa(0x1b4)]},_0x2df879);}}
|
|
1
|
+
const a150_0x2d6428=a150_0x47c9;(function(_0xd2dfda,_0xa23b75){const _0x5ddad3=a150_0x47c9,_0x123604=_0xd2dfda();while(!![]){try{const _0x467ffc=parseInt(_0x5ddad3(0xa3))/0x1+parseInt(_0x5ddad3(0xca))/0x2+parseInt(_0x5ddad3(0xbd))/0x3*(parseInt(_0x5ddad3(0xef))/0x4)+parseInt(_0x5ddad3(0xeb))/0x5+parseInt(_0x5ddad3(0x107))/0x6*(parseInt(_0x5ddad3(0xcf))/0x7)+parseInt(_0x5ddad3(0xa8))/0x8+-parseInt(_0x5ddad3(0xf6))/0x9;if(_0x467ffc===_0xa23b75)break;else _0x123604['push'](_0x123604['shift']());}catch(_0x4ab1ea){_0x123604['push'](_0x123604['shift']());}}}(a150_0x161b,0xecb30));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';const MAX_PAGINATION_LIMIT=0x3e8;function a150_0x161b(){const _0x281244=['readdir','toTime','uploadProjectArchive','.tar.gz','tdx-workflow-push-','retryAttempt','listLogFiles','logger','listSessions','resolveProjectId','params','fullName','exportParams','name','sessionTime','state','last_id','filter','projectName','51kntJBk','retryParams','workflowName','downloadProjectArchive','message','util','deleteProject','create','tasks','done','logFiles','replace','extract','442164ZehrqQ','unlink','limit','fromTime','Kill\x20request\x20accepted','14ORPCdK','parentId','fromTask','access','retryAt','skipValidation','sessionId','timezone','revision','indexOf','endsWith','map','updatedAt','force','getAttemptTasks','Project\x20directory\x20not\x20found:\x20','isGroup','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','success','direct','tmpdir','WORKFLOW_PROJECT_NOT_FOUND','listAttempts','basename','sessionUuid','path','utf-8','setSecret','1575720TVqQwE','substring','executeCloneProject','No\x20','83644xyuydQ','upstreams','getProject','retrySession','listSecrets','slice','client','23739093CFOclp','attempts','deleteSecret','workflows','stateParams','sessions','length','killAttempt','workflow','lastId','toISOString','push','listProjects','Project\x20not\x20found:\x20','test','find','preparePushProject','4651782YTJEqL','cancelRequested','isDirectory','tdx-workflow-','join','status','.\x20Expected\x20\x22project.workflow\x22','logs','tar','pullProject','data','clearScheduleAll','bind','download','project','retryAttemptName','lastAttempt','prepareCloneProject','includeRetried','startAttempt','config','786280YzROdA','Cannot\x20read\x20workflow\x20file:\x20','rawCount','kill','now','3028880PcAPHX','clearSchedule'];a150_0x161b=function(){return _0x281244;};return a150_0x161b();}async function paginateResults(_0x1a49d3,_0x2ef424,_0x9ed20=0x64){const _0x5ce4bf=a150_0x47c9,_0x5d0695=Math['min'](_0x2ef424,MAX_PAGINATION_LIMIT),_0x310e0f=[];let _0x5938a5;while(_0x310e0f[_0x5ce4bf(0xfc)]<_0x5d0695){const _0x48ad57=await _0x1a49d3(_0x9ed20,_0x5938a5),_0x317299=_0x48ad57[_0x5ce4bf(0xa5)]??_0x48ad57[_0x5ce4bf(0x111)]['length'];if(_0x317299===0x0)break;_0x310e0f['push'](..._0x48ad57[_0x5ce4bf(0x111)]);if(!_0x48ad57[_0x5ce4bf(0xff)]||_0x317299<_0x9ed20)break;_0x5938a5=_0x48ad57[_0x5ce4bf(0xff)];}return _0x310e0f[_0x5ce4bf(0xf4)](0x0,_0x5d0695);}function a150_0x47c9(_0x4d34b7,_0x3f783f){_0x4d34b7=_0x4d34b7-0x9c;const _0x161b5f=a150_0x161b();let _0x47c9c7=_0x161b5f[_0x4d34b7];return _0x47c9c7;}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static ['NUMERIC_ID_PATTERN']=/^\d+$/;[a150_0x2d6428(0xf5)];constructor(_0x1fb269){const _0x1dbebb=a150_0x2d6428;this[_0x1dbebb(0xf5)]=new WorkflowApiClient(_0x1fb269,_0x1fb269[_0x1dbebb(0xb1)]);}async['resolveProjectId'](_0x18aa7d){const _0x523b57=a150_0x2d6428;if(WorkflowSDK['NUMERIC_ID_PATTERN'][_0x523b57(0x104)](_0x18aa7d)){const _0x5301a9=await this[_0x523b57(0xf5)][_0x523b57(0xf1)](_0x18aa7d);return{'id':_0x5301a9['id'],'name':_0x5301a9[_0x523b57(0xb7)]};}const _0x5b4c0d=await this[_0x523b57(0xf5)][_0x523b57(0x102)]({'name_pattern':_0x18aa7d}),_0x373c3b=_0x5b4c0d[_0x523b57(0x111)][_0x523b57(0x105)](_0x5d57fa=>_0x5d57fa[_0x523b57(0xb7)]===_0x18aa7d);if(!_0x373c3b)throw new SDKError(ErrorCode[_0x523b57(0xe4)],_0x523b57(0x103)+_0x18aa7d);return{'id':_0x373c3b['id'],'name':_0x373c3b[_0x523b57(0xb7)]};}async['projects'](_0x38de8e,_0x2c2cc1){const _0x5bf631=a150_0x2d6428,_0x3c38c9=_0x2c2cc1?.[_0x5bf631(0xcc)]||0x64,_0x1119e7=await paginateResults((_0x416518,_0x2faba6)=>this[_0x5bf631(0xf5)][_0x5bf631(0x102)]({'name_pattern':_0x38de8e,'limit':_0x416518,'last_id':_0x2faba6??_0x2c2cc1?.[_0x5bf631(0xba)]}),_0x3c38c9);return _0x1119e7[_0x5bf631(0xda)](_0x39a8c0=>({..._0x39a8c0,'project_id':_0x39a8c0['id'],'project_name':_0x39a8c0['name']}));}async[a150_0x2d6428(0xf9)](_0x14f973,_0x31f701){const _0x4275f3=a150_0x2d6428,_0x1c4860=_0x31f701?.[_0x4275f3(0xcc)]||0x64,_0x22cd28=await paginateResults((_0x484c55,_0x50014c)=>this[_0x4275f3(0xf5)]['listWorkflows']({'project_name':_0x14f973,'limit':_0x484c55,'last_id':_0x50014c??_0x31f701?.[_0x4275f3(0xba)]}),_0x1c4860);return _0x22cd28[_0x4275f3(0xda)](_0x19368c=>({'project_id':_0x19368c[_0x4275f3(0x9c)]?.['id'],'project_name':_0x19368c[_0x4275f3(0x9c)]?.[_0x4275f3(0xb7)],'workflow_id':_0x19368c['id'],'workflow_name':_0x19368c['name'],'revision':_0x19368c['revision'],'timezone':_0x19368c[_0x4275f3(0xd6)],'config':_0x19368c[_0x4275f3(0xa2)],'id':_0x19368c['id'],'name':_0x19368c[_0x4275f3(0xb7)],'project':_0x19368c[_0x4275f3(0x9c)]}));}async[a150_0x2d6428(0xfb)](_0x3062ad){const _0x43b998=a150_0x2d6428;let _0x342327;if(_0x3062ad?.[_0x43b998(0xbc)]){let _0x15c896,_0x26c1b1=![];while(!_0x26c1b1){const _0xa60d8=await this[_0x43b998(0xf5)][_0x43b998(0x102)]({'limit':0x64,'last_id':_0x15c896}),_0x265a5a=_0xa60d8['data']['find'](_0x21c82f=>_0x21c82f[_0x43b998(0xb7)]===_0x3062ad['projectName']);if(_0x265a5a){_0x342327=_0x265a5a['id'],_0x26c1b1=!![];break;}if(!_0xa60d8[_0x43b998(0xff)]||_0xa60d8[_0x43b998(0x111)][_0x43b998(0xfc)]===0x0)break;_0x15c896=_0xa60d8[_0x43b998(0xff)];}if(!_0x342327)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],_0x43b998(0x103)+_0x3062ad[_0x43b998(0xbc)]);}const _0x2af019=_0x3062ad?.['limit']||0x64,_0x146eb6=await paginateResults((_0x2b97bf,_0x28f2f4)=>this[_0x43b998(0xf5)][_0x43b998(0xb2)]({'project_id':_0x342327,'project_name':_0x3062ad?.[_0x43b998(0xbc)],'workflow_name':_0x3062ad?.[_0x43b998(0xbf)],'status':_0x3062ad?.[_0x43b998(0x10c)],'from_time':_0x3062ad?.[_0x43b998(0xcd)],'to_time':_0x3062ad?.[_0x43b998(0xab)],'limit':_0x2b97bf,'last_id':_0x28f2f4??_0x3062ad?.['last_id']}),_0x2af019);return _0x146eb6[_0x43b998(0xda)](_0x1d9f8a=>({'project_id':_0x1d9f8a[_0x43b998(0x9c)]?.['id'],'project_name':_0x1d9f8a['project']?.[_0x43b998(0xb7)],'workflow_id':_0x1d9f8a['workflow']?.['id'],'workflow_name':_0x1d9f8a[_0x43b998(0xfe)]?.[_0x43b998(0xb7)],'session_id':_0x1d9f8a['id'],'sessionUuid':_0x1d9f8a[_0x43b998(0xe7)],'sessionTime':_0x1d9f8a[_0x43b998(0xb8)],'lastAttempt':_0x1d9f8a[_0x43b998(0x9e)],'id':_0x1d9f8a['id'],'project':_0x1d9f8a['project'],'workflow':_0x1d9f8a[_0x43b998(0xfe)]}));}async[a150_0x2d6428(0xf7)](_0x4e50ba){const _0x4946ef=a150_0x2d6428,_0x23cba1=_0x4e50ba?.[_0x4946ef(0xcc)]||0x64,_0x8824b8=await paginateResults((_0x3168b9,_0x109b6e)=>this['client'][_0x4946ef(0xe5)]({'project_name':_0x4e50ba?.[_0x4946ef(0xbc)],'workflow_name':_0x4e50ba?.[_0x4946ef(0xbf)],'include_retried':_0x4e50ba?.[_0x4946ef(0xa0)],'limit':_0x3168b9,'last_id':_0x109b6e??_0x4e50ba?.[_0x4946ef(0xba)]}),_0x23cba1);return _0x8824b8[_0x4946ef(0xda)](_0x599e58=>({'project_id':_0x599e58['project']?.['id'],'project_name':_0x599e58[_0x4946ef(0x9c)]?.[_0x4946ef(0xb7)],'workflow_id':_0x599e58[_0x4946ef(0xfe)]?.['id'],'workflow_name':_0x599e58[_0x4946ef(0xfe)]?.[_0x4946ef(0xb7)],'session_id':_0x599e58[_0x4946ef(0xd5)],'sessionUuid':_0x599e58[_0x4946ef(0xe7)],'sessionTime':_0x599e58[_0x4946ef(0xb8)],'attempt_id':_0x599e58['id'],'attempt_index':_0x599e58['index'],'retryAttemptName':_0x599e58[_0x4946ef(0x9d)],'done':_0x599e58[_0x4946ef(0xc6)],'success':_0x599e58[_0x4946ef(0xe1)],'cancelRequested':_0x599e58[_0x4946ef(0x108)],'params':_0x599e58[_0x4946ef(0xb4)],'createdAt':_0x599e58['createdAt'],'finishedAt':_0x599e58['finishedAt'],'id':_0x599e58['id'],'index':_0x599e58['index'],'project':_0x599e58[_0x4946ef(0x9c)],'workflow':_0x599e58[_0x4946ef(0xfe)]}));}async['attempt'](_0x34af5b){const _0x531c55=a150_0x2d6428,_0x67a016=await this[_0x531c55(0xf5)]['getAttempt'](_0x34af5b);return _0x67a016;}async[a150_0x2d6428(0xc5)](_0x27fdbb,_0x22b571=![]){const _0x1566b9=a150_0x2d6428,_0xf3850d=await this[_0x1566b9(0xf5)][_0x1566b9(0xdd)](_0x27fdbb,_0x22b571);return _0xf3850d[_0x1566b9(0xda)](_0x23c09e=>({'task_id':_0x23c09e['id'],'task_name':_0x23c09e['fullName'],'parentId':_0x23c09e[_0x1566b9(0xd0)],'config':_0x23c09e['config'],'upstreams':_0x23c09e[_0x1566b9(0xf0)],'state':_0x23c09e[_0x1566b9(0xb9)],'exportParams':_0x23c09e[_0x1566b9(0xb6)],'storeParams':_0x23c09e['storeParams'],'stateParams':_0x23c09e[_0x1566b9(0xfa)],'updatedAt':_0x23c09e[_0x1566b9(0xdb)],'retryAt':_0x23c09e[_0x1566b9(0xd3)],'startedAt':_0x23c09e['startedAt'],'error':_0x23c09e['error'],'isGroup':_0x23c09e[_0x1566b9(0xdf)],'id':_0x23c09e['id'],'fullName':_0x23c09e[_0x1566b9(0xb5)]}));}async[a150_0x2d6428(0xc7)](_0x5f2a6a,_0x1558bf){const _0x4ef467=a150_0x2d6428;return await this[_0x4ef467(0xf5)][_0x4ef467(0xb0)](_0x5f2a6a,_0x1558bf);}async[a150_0x2d6428(0x10e)](_0x3eb855,_0x3484a4){const _0x2d63e4=a150_0x2d6428,_0x3f81d4=await import('zlib'),{promisify:_0x730f76}=await import(_0x2d63e4(0xc2)),_0x1e489f=_0x730f76(_0x3f81d4['gunzip']),_0x4e3f20=await this[_0x2d63e4(0xf5)]['listLogFiles'](_0x3eb855,_0x3484a4);if(_0x4e3f20[_0x2d63e4(0xfc)]===0x0)return'';const _0x397c00=[];for(const _0x20eeac of _0x4e3f20){if(!_0x20eeac[_0x2d63e4(0xe2)])continue;const _0x3a4c7b=await fetch(_0x20eeac['direct']);if(!_0x3a4c7b['ok'])throw new Error('Failed\x20to\x20download\x20log\x20file:\x20'+_0x3a4c7b[_0x2d63e4(0x10c)]);const _0x204a65=Buffer['from'](await _0x3a4c7b['arrayBuffer']()),_0x8257c6=await _0x1e489f(_0x204a65);_0x397c00[_0x2d63e4(0x101)](_0x8257c6['toString'](_0x2d63e4(0xe9)));}return _0x397c00[_0x2d63e4(0x10b)]('\x0a');}async[a150_0x2d6428(0xa6)](_0x234f3d,_0x23e888){const _0x1bee88=a150_0x2d6428,_0x5bd214=await this[_0x1bee88(0xf5)][_0x1bee88(0xfd)](_0x234f3d,_0x23e888);return _0x5bd214?.[_0x1bee88(0xc1)]??_0x1bee88(0xce);}async[a150_0x2d6428(0xf2)](_0x5e037f,_0x217297){const _0x4f5707=a150_0x2d6428,_0x35917c=await this[_0x4f5707(0xf5)][_0x4f5707(0xf2)](_0x5e037f,{'from_task':_0x217297?.[_0x4f5707(0xd1)],'retry_params':_0x217297?.['retryParams']});return{'attemptId':_0x35917c['id'],'sessionId':_0x35917c[_0x4f5707(0xd5)]};}async['retryAttempt'](_0x400d1f,_0x588647){const _0x473219=a150_0x2d6428,_0x10a65f=await this[_0x473219(0xf5)][_0x473219(0xaf)](_0x400d1f,{'resume_from':_0x588647?.['resumeFrom'],'retry_params':_0x588647?.[_0x473219(0xbe)],'force':_0x588647?.[_0x473219(0xdc)]});return{'attemptId':_0x10a65f['id'],'sessionId':_0x10a65f['sessionId']};}async['run'](_0x298eb7,_0x3f69b6={},_0x5adef0){const _0xa3c92b=a150_0x2d6428,_0x42dbf2=_0x298eb7[_0xa3c92b(0xd8)]('.');let _0x4c0b45,_0x5b97ba;if(_0x42dbf2===-0x1)throw new Error(_0xa3c92b(0xe0));_0x4c0b45=_0x298eb7['substring'](0x0,_0x42dbf2),_0x5b97ba=_0x298eb7[_0xa3c92b(0xec)](_0x42dbf2+0x1);if(!_0x4c0b45||!_0x5b97ba)throw new Error('Invalid\x20workflow\x20format:\x20'+_0x298eb7+_0xa3c92b(0x10d));const _0x2ee86a=_0x5adef0?.[_0xa3c92b(0xb8)]||new Date()[_0xa3c92b(0x100)]();return await this[_0xa3c92b(0xf5)][_0xa3c92b(0xa1)]({'projectName':_0x4c0b45,'workflowName':_0x5b97ba,'sessionTime':_0x2ee86a,'params':_0x3f69b6});}async[a150_0x2d6428(0x114)](_0x258b47,_0x21d62d,_0x290a76){const _0x24c4e0=a150_0x2d6428,{promises:_0x5cc307}=await import('fs'),_0x9107ea=await import(_0x24c4e0(0xe8)),_0x2267cf=await import('os'),_0x3d5549=await import(_0x24c4e0(0x10f)),{id:_0x3084a9,name:_0x29da80}=await this[_0x24c4e0(0xb3)](_0x258b47),_0x2df942=_0x2267cf[_0x24c4e0(0xe3)](),_0x323a18=_0x9107ea[_0x24c4e0(0x10b)](_0x2df942,_0x24c4e0(0x10a)+_0x3084a9+'-'+Date['now']()+_0x24c4e0(0xad));try{await this[_0x24c4e0(0xf5)][_0x24c4e0(0xc0)](_0x3084a9,_0x323a18,_0x290a76?.[_0x24c4e0(0xd7)]);const _0xf55ddd=_0x9107ea[_0x24c4e0(0x10b)](_0x21d62d,_0x29da80);await _0x5cc307['mkdir'](_0xf55ddd,{'recursive':!![]}),await _0x3d5549[_0x24c4e0(0xc9)]({'file':_0x323a18,'cwd':_0xf55ddd,'gzip':!![]});const _0x171a9d=async _0x441a58=>{const _0x184bd7=_0x24c4e0;let _0x16393b=0x0;const _0x2709ee=await _0x5cc307[_0x184bd7(0xaa)](_0x441a58,{'withFileTypes':!![]});for(const _0x1a1c98 of _0x2709ee){const _0x49d61f=_0x9107ea[_0x184bd7(0x10b)](_0x441a58,_0x1a1c98[_0x184bd7(0xb7)]);if(_0x1a1c98['isFile']())_0x16393b++;else _0x1a1c98['isDirectory']()&&(_0x16393b+=await _0x171a9d(_0x49d61f));}return _0x16393b;},_0x346472=await _0x171a9d(_0xf55ddd);return{'projectName':_0x29da80,'revision':_0x290a76?.['revision']||'latest','filesExtracted':_0x346472};}finally{try{await _0x5cc307[_0x24c4e0(0xcb)](_0x323a18);}catch{}}}async['push'](_0x25d09c,_0x3cd973){const _0x3b3a87=a150_0x2d6428,{promises:_0x2b6f80}=await import('fs'),_0x25c8d4=await import('path'),_0x59c7bc=await import('tar'),_0x15ae72=_0x3cd973?.[_0x3b3a87(0xbc)]||_0x25c8d4[_0x3b3a87(0xe6)](_0x25d09c),_0x49830f=_0x3cd973?.[_0x3b3a87(0xd7)]||new Date()[_0x3b3a87(0x100)]()[_0x3b3a87(0xc8)](/[:.]/g,'-');try{await _0x2b6f80[_0x3b3a87(0xd2)](_0x25d09c);}catch{throw new Error(_0x3b3a87(0xde)+_0x25d09c);}if(!_0x3cd973?.[_0x3b3a87(0xd4)]){const _0x422ce5=await _0x2b6f80['readdir'](_0x25d09c),_0xf23301=_0x422ce5[_0x3b3a87(0xbb)](_0x2bdb44=>_0x2bdb44[_0x3b3a87(0xd9)](WORKFLOW_FILE_EXTENSION));if(_0xf23301[_0x3b3a87(0xfc)]===0x0)throw new Error(_0x3b3a87(0xee)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20project\x20directory');for(const _0x5b9760 of _0xf23301){const _0x2b91bc=_0x25c8d4['join'](_0x25d09c,_0x5b9760);try{await _0x2b6f80[_0x3b3a87(0xd2)](_0x2b91bc);}catch{throw new Error(_0x3b3a87(0xa4)+_0x5b9760);}}}const _0x2c0e89=async(_0x33f424,_0x46cec8='')=>{const _0x24e12e=_0x3b3a87,_0x341a3e=await _0x2b6f80[_0x24e12e(0xaa)](_0x33f424,{'withFileTypes':!![]}),_0x1a1002=[];for(const _0x42d3a8 of _0x341a3e){const _0x3c5742=_0x25c8d4[_0x24e12e(0x10b)](_0x46cec8,_0x42d3a8['name']),_0x32da32=_0x25c8d4[_0x24e12e(0x10b)](_0x33f424,_0x42d3a8['name']);if(!shouldIncludeInArchive(_0x42d3a8[_0x24e12e(0xb7)]))continue;_0x42d3a8[_0x24e12e(0x109)]()?_0x1a1002[_0x24e12e(0x101)](...await _0x2c0e89(_0x32da32,_0x3c5742)):_0x1a1002['push'](_0x3c5742);}return _0x1a1002;},_0x2f6c2a=await _0x2c0e89(_0x25d09c),_0x3dcd01=await import('os'),_0x3c4781=_0x3dcd01[_0x3b3a87(0xe3)](),_0x1a8d83=_0x25c8d4[_0x3b3a87(0x10b)](_0x3c4781,_0x3b3a87(0xae)+Date[_0x3b3a87(0xa7)]()+_0x3b3a87(0xad));try{await _0x59c7bc[_0x3b3a87(0xc4)]({'file':_0x1a8d83,'gzip':!![],'cwd':_0x25d09c,'portable':!![]},_0x2f6c2a);const _0x487ae7=await this[_0x3b3a87(0xf5)][_0x3b3a87(0xac)](_0x15ae72,_0x49830f,_0x1a8d83,{'scheduleFrom':_0x3cd973?.['scheduleFrom'],'clearSchedule':_0x3cd973?.[_0x3b3a87(0xa9)],'clearScheduleAll':_0x3cd973?.[_0x3b3a87(0x112)]});return{'projectId':_0x487ae7['id'],'projectName':_0x487ae7[_0x3b3a87(0xb7)],'revision':_0x487ae7[_0x3b3a87(0xd7)]};}finally{try{await _0x2b6f80[_0x3b3a87(0xcb)](_0x1a8d83);}catch{}}}async['delete'](_0x2dbf23){const _0x3e5622=a150_0x2d6428,{id:_0x13a9fe}=await this[_0x3e5622(0xb3)](_0x2dbf23),_0x3a7e36=await this['client'][_0x3e5622(0xc3)](_0x13a9fe);return{'projectId':_0x3a7e36['id'],'projectName':_0x3a7e36[_0x3e5622(0xb7)]};}async[a150_0x2d6428(0xf3)](_0x2002f4){const _0x1965b4=a150_0x2d6428,{id:_0x2721cd,name:_0x3d02e2}=await this[_0x1965b4(0xb3)](_0x2002f4),_0x46ec2a=await this['client'][_0x1965b4(0xf3)](_0x2721cd);return{'projectName':_0x3d02e2,'secrets':_0x46ec2a};}async[a150_0x2d6428(0xea)](_0xc81461,_0x303373,_0x335ab9){const _0x444b51=a150_0x2d6428,{id:_0x52f803,name:_0x232d9e}=await this[_0x444b51(0xb3)](_0xc81461);return await this[_0x444b51(0xf5)][_0x444b51(0xea)](_0x52f803,_0x303373,_0x335ab9),{'projectName':_0x232d9e,'key':_0x303373};}async[a150_0x2d6428(0xf8)](_0x226d88,_0x44f7f7){const _0x4fdcc6=a150_0x2d6428,{id:_0x24d223,name:_0x21c794}=await this['resolveProjectId'](_0x226d88);return await this['client'][_0x4fdcc6(0xf8)](_0x24d223,_0x44f7f7),{'projectName':_0x21c794,'key':_0x44f7f7};}async[a150_0x2d6428(0x110)](_0x40f897,_0x1d45fc){const _0x1d9483=a150_0x2d6428;return pullWorkflow({'client':this[_0x1d9483(0xf5)],'resolveProjectId':this[_0x1d9483(0xb3)]['bind'](this)},_0x40f897,_0x1d45fc);}async['applyPullProject'](_0x484ffe,_0x5c2f16){const _0x19955b=a150_0x2d6428;return applyPullResult({'client':this[_0x19955b(0xf5)],'resolveProjectId':this[_0x19955b(0xb3)]['bind'](this)},_0x484ffe,_0x5c2f16);}async[a150_0x2d6428(0x106)](_0x3b8428){const _0x486b20=a150_0x2d6428;return preparePushWorkflow({'client':this[_0x486b20(0xf5)],'resolveProjectId':this[_0x486b20(0xb3)]['bind'](this)},_0x3b8428);}async['executePushProject'](_0x572bbd){const _0x195df5=a150_0x2d6428;return executePushWorkflow({'client':this[_0x195df5(0xf5)],'resolveProjectId':this[_0x195df5(0xb3)][_0x195df5(0x113)](this)},_0x572bbd);}async[a150_0x2d6428(0x9f)](_0x30c1d2,_0x16eca2,_0x59697e){const _0x59288b=a150_0x2d6428;return prepareCloneWorkflow({'client':this[_0x59288b(0xf5)]},_0x30c1d2,_0x16eca2,_0x59697e);}async[a150_0x2d6428(0xed)](_0x40230c){const _0x1b33c4=a150_0x2d6428;return executeCloneWorkflow({'client':this[_0x1b33c4(0xf5)]},_0x40230c);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x17490c,_0x1ac84c){const _0x1eda46=a151_0x3b74,_0x4d3682=_0x17490c();while(!![]){try{const _0x48f9ed=-parseInt(_0x1eda46(0xd3))/0x1+-parseInt(_0x1eda46(0xd6))/0x2+-parseInt(_0x1eda46(0xee))/0x3*(-parseInt(_0x1eda46(0xdb))/0x4)+-parseInt(_0x1eda46(0xe9))/0x5*(parseInt(_0x1eda46(0x105))/0x6)+parseInt(_0x1eda46(0xcf))/0x7*(-parseInt(_0x1eda46(0xe6))/0x8)+parseInt(_0x1eda46(0xff))/0x9*(parseInt(_0x1eda46(0xf3))/0xa)+parseInt(_0x1eda46(0xdc))/0xb*(parseInt(_0x1eda46(0xd2))/0xc);if(_0x48f9ed===_0x1ac84c)break;else _0x4d3682['push'](_0x4d3682['shift']());}catch(_0x3837c4){_0x4d3682['push'](_0x4d3682['shift']());}}}(a151_0x51cd,0x8edcc));import{existsSync,promises as a151_0x6d8c09}from'fs';import a151_0xeaa6fd from'path';import a151_0x1876d2 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{getWorkflowProjectDir,createWorkflowTdxConfigContent,updateWorkflowTdxConfig}from'./tdx-config.js';function a151_0x51cd(){const _0x385db0=['extract','latest','toISOString','add','downloadProjectArchive','catch','tdx.json','name','Failed\x20to\x20extract\x20project\x20archive:\x20The\x20archive\x20may\x20be\x20corrupted\x20on\x20the\x20server.','length','2016usEBus','includes','readdir','filter','deleted','baseDir','2246448hhsaru','mkdtemp','projectName','join','modified','193354FCeBpx','mkdir','new','28871160RJNcNE','501004aIuUUn','extracted','tar','1939458BLsLxS','tmpdir','isDirectory','push','unchanged','4debXKb','11XWiziL','revision','utf-8','cwd','archive.tar.gz','TAR_BAD_ARCHIVE','WORKFLOW_ARCHIVE_CORRUPTED','path','getProject','projectId','328GWgAfb','sort','zlib','5yoPhPR','message','localeCompare','readFile','changes','1132743jvvpmF','type','tdx-wf-pull-','targetDir','tdx-wf-apply-','34790IXUgbk','Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support\x20if\x20the\x20issue\x20persists.'];a151_0x51cd=function(){return _0x385db0;};return a151_0x51cd();}import{SDKError,ErrorCode}from'../errors.js';export async function pullWorkflow(_0x121949,_0xb54fbc,_0x21d048={}){const _0x202853=a151_0x3b74,_0xc0b2ef=await import(_0x202853(0xd5)),{client:_0x3f7218,resolveProjectId:_0x2e2e8b}=_0x121949,{id:_0x53681d,name:_0x216da9}=await _0x2e2e8b(_0xb54fbc),_0x4c6d1d=_0x21d048[_0x202853(0x104)]||process[_0x202853(0xdf)](),_0x5eab5e=_0x21d048[_0x202853(0xf1)]||getWorkflowProjectDir(_0x216da9,_0x4c6d1d),_0xb197fb=a151_0xeaa6fd['join'](_0x5eab5e,_0x202853(0xfb)),_0x55b0b0=!existsSync(_0xb197fb),_0x39dc6f=await a151_0x6d8c09[_0x202853(0x106)](a151_0xeaa6fd[_0x202853(0xcd)](a151_0x1876d2[_0x202853(0xd7)](),_0x202853(0xf0))),_0x3ce641=a151_0xeaa6fd[_0x202853(0xcd)](_0x39dc6f,_0x202853(0xe0)),_0x4fcfa5=a151_0xeaa6fd[_0x202853(0xcd)](_0x39dc6f,_0x202853(0xd4));try{await _0x3f7218[_0x202853(0xf9)](_0x53681d,_0x3ce641,_0x21d048[_0x202853(0xdd)]),await a151_0x6d8c09[_0x202853(0xd0)](_0x4fcfa5,{'recursive':!![]});try{await _0xc0b2ef[_0x202853(0xf5)]({'file':_0x3ce641,'cwd':_0x4fcfa5,'gzip':!![]});}catch(_0x3b924a){const _0x1661c1=_0x3b924a instanceof Error?_0x3b924a[_0x202853(0xea)]:String(_0x3b924a);if(_0x1661c1[_0x202853(0x100)](_0x202853(0xe1))||_0x1661c1[_0x202853(0x100)](_0x202853(0xe8)))throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x202853(0xfd),_0x3b924a,{'helpText':_0x202853(0xf4)});throw _0x3b924a;}const _0x47464a=await _0x3f7218[_0x202853(0xe4)](_0x53681d),_0x5c5fc0=_0x21d048[_0x202853(0xdd)]||_0x47464a['revision']||_0x202853(0xf6),_0x137f88=await calculateChanges(_0x5eab5e,_0x4fcfa5,_0x55b0b0),_0x433d51={'new':_0x137f88[_0x202853(0x102)](_0x49b04f=>_0x49b04f[_0x202853(0xef)]===_0x202853(0xd1))['length'],'modified':_0x137f88['filter'](_0x19cd1d=>_0x19cd1d[_0x202853(0xef)]===_0x202853(0xce))['length'],'deleted':_0x137f88[_0x202853(0x102)](_0x50ef0e=>_0x50ef0e[_0x202853(0xef)]===_0x202853(0x103))['length'],'unchanged':_0x137f88[_0x202853(0x102)](_0x2edb22=>_0x2edb22[_0x202853(0xef)]===_0x202853(0xda))[_0x202853(0xfe)]};return{'projectName':_0x216da9,'projectId':_0x53681d,'revision':_0x5c5fc0,'targetDir':_0x5eab5e,'changes':_0x137f88,'summary':_0x433d51,'hasChanges':_0x433d51[_0x202853(0xd1)]>0x0||_0x433d51[_0x202853(0xce)]>0x0||_0x433d51[_0x202853(0x103)]>0x0,'isNewProject':_0x55b0b0};}finally{await a151_0x6d8c09['rm'](_0x39dc6f,{'recursive':!![],'force':!![]});}}function a151_0x3b74(_0x2a357f,_0x581779){_0x2a357f=_0x2a357f-0xcc;const _0x51cdef=a151_0x51cd();let _0x3b741a=_0x51cdef[_0x2a357f];return _0x3b741a;}export async function applyPullResult(_0x4d7d4f,_0x45d2cb,_0x5b6002={}){const _0x46a769=a151_0x3b74,_0x2b1ffb=await import(_0x46a769(0xd5)),{client:_0x13fc5a}=_0x4d7d4f,_0x1b22fb=await a151_0x6d8c09[_0x46a769(0x106)](a151_0xeaa6fd['join'](a151_0x1876d2[_0x46a769(0xd7)](),_0x46a769(0xf2))),_0xb9bc5=a151_0xeaa6fd[_0x46a769(0xcd)](_0x1b22fb,_0x46a769(0xe0));try{await _0x13fc5a[_0x46a769(0xf9)](_0x45d2cb['projectId'],_0xb9bc5,_0x5b6002[_0x46a769(0xdd)]),await a151_0x6d8c09[_0x46a769(0xd0)](_0x45d2cb[_0x46a769(0xf1)],{'recursive':!![]});for(const _0x46048d of _0x45d2cb[_0x46a769(0xed)]){if(_0x46048d['type']==='deleted'){const _0x2f5ca0=a151_0xeaa6fd['join'](_0x45d2cb[_0x46a769(0xf1)],_0x46048d[_0x46a769(0xe3)]);await a151_0x6d8c09['unlink'](_0x2f5ca0)[_0x46a769(0xfa)](()=>{});}}try{await _0x2b1ffb[_0x46a769(0xf5)]({'file':_0xb9bc5,'cwd':_0x45d2cb['targetDir'],'gzip':!![]});}catch(_0x2cc37e){const _0x263f6d=_0x2cc37e instanceof Error?_0x2cc37e['message']:String(_0x2cc37e);if(_0x263f6d['includes'](_0x46a769(0xe1))||_0x263f6d[_0x46a769(0x100)](_0x46a769(0xe8)))throw new SDKError(ErrorCode[_0x46a769(0xe2)],_0x46a769(0xfd),_0x2cc37e,{'helpText':_0x46a769(0xf4)});throw _0x2cc37e;}const _0x430c4e=a151_0xeaa6fd['join'](_0x45d2cb[_0x46a769(0xf1)],'tdx.json');if(_0x45d2cb['isNewProject']){const _0x24855d=createWorkflowTdxConfigContent(_0x45d2cb[_0x46a769(0xcc)],_0x45d2cb[_0x46a769(0xe5)],_0x45d2cb[_0x46a769(0xdd)]);await a151_0x6d8c09['writeFile'](_0x430c4e,_0x24855d,_0x46a769(0xde));}else updateWorkflowTdxConfig(_0x430c4e,{'last_pulled_revision':_0x45d2cb[_0x46a769(0xdd)],'last_pulled_at':new Date()[_0x46a769(0xf7)]()});}finally{await a151_0x6d8c09['rm'](_0x1b22fb,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x4e3411,_0x381fa9,_0x5ce85e){const _0x225c41=a151_0x3b74,_0x1a38df=[],_0x554342=await getAllFiles(_0x381fa9),_0x496e99=existsSync(_0x4e3411)?await getAllFiles(_0x4e3411):new Set();for(const _0x11d996 of _0x554342){const _0x309e68=a151_0xeaa6fd[_0x225c41(0xcd)](_0x4e3411,_0x11d996),_0x27250e=a151_0xeaa6fd[_0x225c41(0xcd)](_0x381fa9,_0x11d996);if(_0x11d996===_0x225c41(0xfb))continue;const _0x37f8e5=await a151_0x6d8c09['readFile'](_0x27250e,_0x225c41(0xde))[_0x225c41(0xfa)](()=>null);if(_0x37f8e5===null)continue;if(!existsSync(_0x309e68)||_0x5ce85e)_0x1a38df[_0x225c41(0xd9)]({'path':_0x11d996,'type':_0x225c41(0xd1),'newContent':_0x37f8e5});else{const _0x418cf7=await a151_0x6d8c09[_0x225c41(0xec)](_0x309e68,_0x225c41(0xde))[_0x225c41(0xfa)](()=>null);if(_0x418cf7===null)_0x1a38df[_0x225c41(0xd9)]({'path':_0x11d996,'type':_0x225c41(0xce),'newContent':_0x37f8e5});else{if(_0x418cf7!==_0x37f8e5){const _0x44cebd=generateDiff(_0x418cf7,_0x37f8e5),_0xb7aace=hasChanges(_0x44cebd)?formatDiffWithColors(_0x44cebd):undefined;_0x1a38df[_0x225c41(0xd9)]({'path':_0x11d996,'type':_0x225c41(0xce),'oldContent':_0x418cf7,'newContent':_0x37f8e5,'diff':_0xb7aace});}else _0x1a38df[_0x225c41(0xd9)]({'path':_0x11d996,'type':'unchanged'});}}}if(!_0x5ce85e)for(const _0x58e88d of _0x496e99){if(_0x58e88d==='tdx.json')continue;if(!_0x554342['has'](_0x58e88d)){const _0x53e07c=a151_0xeaa6fd[_0x225c41(0xcd)](_0x4e3411,_0x58e88d),_0x3392e5=await a151_0x6d8c09['readFile'](_0x53e07c,'utf-8')['catch'](()=>undefined);_0x1a38df[_0x225c41(0xd9)]({'path':_0x58e88d,'type':_0x225c41(0x103),'oldContent':_0x3392e5});}}return _0x1a38df[_0x225c41(0xe7)]((_0x43017a,_0x5811f5)=>_0x43017a[_0x225c41(0xe3)][_0x225c41(0xeb)](_0x5811f5[_0x225c41(0xe3)])),_0x1a38df;}async function getAllFiles(_0x34fb6a,_0x3cdda5=''){const _0xd7c251=a151_0x3b74,_0x256cc3=new Set();if(!existsSync(_0x34fb6a))return _0x256cc3;const _0x2f6506=await a151_0x6d8c09[_0xd7c251(0x101)](_0x34fb6a,{'withFileTypes':!![]});for(const _0x71a7f7 of _0x2f6506){const _0x22de86=_0x3cdda5?a151_0xeaa6fd['join'](_0x3cdda5,_0x71a7f7[_0xd7c251(0xfc)]):_0x71a7f7[_0xd7c251(0xfc)];if(_0x71a7f7[_0xd7c251(0xd8)]()){const _0x24c41f=await getAllFiles(a151_0xeaa6fd['join'](_0x34fb6a,_0x71a7f7[_0xd7c251(0xfc)]),_0x22de86);for(const _0x5edffe of _0x24c41f){_0x256cc3[_0xd7c251(0xf8)](_0x5edffe);}}else _0x256cc3['add'](_0x22de86);}return _0x256cc3;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ed383,_0x4fdb31){const _0x22eadb=a152_0x4d5e,_0x4d8a25=_0x1ed383();while(!![]){try{const _0x5b4072=-parseInt(_0x22eadb(0x18c))/0x1+-parseInt(_0x22eadb(0x1b7))/0x2*(parseInt(_0x22eadb(0x191))/0x3)+-parseInt(_0x22eadb(0x1a8))/0x4*(-parseInt(_0x22eadb(0x1b3))/0x5)+parseInt(_0x22eadb(0x18d))/0x6+-parseInt(_0x22eadb(0x1ad))/0x7+parseInt(_0x22eadb(0x18e))/0x8+parseInt(_0x22eadb(0x19b))/0x9*(-parseInt(_0x22eadb(0x197))/0xa);if(_0x5b4072===_0x4fdb31)break;else _0x4d8a25['push'](_0x4d8a25['shift']());}catch(_0x3b2177){_0x4d8a25['push'](_0x4d8a25['shift']());}}}(a152_0x120d,0xea541));import{promises as a152_0x3311cc}from'fs';import a152_0x2be170 from'path';import a152_0x32c0e3 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a152_0x4d5e(_0x193897,_0xa09283){_0x193897=_0x193897-0x18a;const _0x120d27=a152_0x120d();let _0x4d5ebf=_0x120d27[_0x193897];return _0x4d5ebf;}import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';import{SDKError,ErrorCode}from'../errors.js';export async function preparePushWorkflow(_0x2211c1,_0x3a2887={}){const _0x574637=a152_0x4d5e,_0x6c17a2=await import('tar'),{client:_0x5eed69,resolveProjectId:_0x1a9beb}=_0x2211c1,_0x2a1cb9=_0x3a2887[_0x574637(0x1a6)]||process[_0x574637(0x1a7)](),_0x14e8e3=findWorkflowTdxConfig(_0x2a1cb9),{config:_0x2b900e,configDir:_0x2a6bbc}=_0x14e8e3;let _0x7689a,_0x2ef940=_0x2b900e[_0x574637(0x190)];try{const _0x165906=await _0x1a9beb(_0x2b900e[_0x574637(0x190)]);_0x7689a=_0x165906['id'],_0x2ef940=_0x165906[_0x574637(0x1a9)];}catch{_0x7689a='';}const _0x513950=_0x3a2887['revision']||new Date()['toISOString']()[_0x574637(0x1bc)](/[:.]/g,'-');if(!_0x3a2887[_0x574637(0x1b4)]){const _0x1143a0=await a152_0x3311cc[_0x574637(0x1af)](_0x2a6bbc),_0x3aa794=_0x1143a0[_0x574637(0x18a)](_0x486352=>_0x486352[_0x574637(0x1c3)](WORKFLOW_FILE_EXTENSION));if(_0x3aa794['length']===0x0)throw new Error(_0x574637(0x1a2)+WORKFLOW_FILE_EXTENSION+_0x574637(0x1ba)+_0x2a6bbc);}const _0x18aab3=await getProjectFiles(_0x2a6bbc);let _0x46aada;if(_0x7689a){const _0x11ccba=await a152_0x3311cc[_0x574637(0x1ae)](a152_0x2be170['join'](a152_0x32c0e3[_0x574637(0x195)](),_0x574637(0x1aa))),_0x4009aa=a152_0x2be170['join'](_0x11ccba,_0x574637(0x196)),_0x29b3e4=a152_0x2be170[_0x574637(0x1bd)](_0x11ccba,_0x574637(0x193));try{await _0x5eed69[_0x574637(0x18b)](_0x7689a,_0x4009aa),await a152_0x3311cc[_0x574637(0x1ab)](_0x29b3e4,{'recursive':!![]});try{await _0x6c17a2[_0x574637(0x1b5)]({'file':_0x4009aa,'cwd':_0x29b3e4,'gzip':!![]});}catch(_0x5a9531){const _0x156d5c=_0x5a9531 instanceof Error?_0x5a9531[_0x574637(0x1b0)]:String(_0x5a9531);if(_0x156d5c[_0x574637(0x192)](_0x574637(0x1c2))||_0x156d5c[_0x574637(0x192)](_0x574637(0x19a)))throw new SDKError(ErrorCode[_0x574637(0x18f)],_0x574637(0x19f),_0x5a9531,{'helpText':'Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.'});throw _0x5a9531;}_0x46aada=await calculatePushChanges(_0x2a6bbc,_0x29b3e4,_0x18aab3);}finally{await a152_0x3311cc['rm'](_0x11ccba,{'recursive':!![],'force':!![]});}}else{_0x46aada=[];for(const _0xcfb5a5 of _0x18aab3){const _0x5cd903=a152_0x2be170[_0x574637(0x1bd)](_0x2a6bbc,_0xcfb5a5),_0x8702b8=await a152_0x3311cc[_0x574637(0x1c0)](_0x5cd903,_0x574637(0x1bb))['catch'](()=>null);_0x46aada['push']({'path':_0xcfb5a5,'type':_0x574637(0x1c1),'newContent':_0x8702b8||undefined});}}const _0x5e0d9c={'new':_0x46aada[_0x574637(0x18a)](_0x503d09=>_0x503d09['type']===_0x574637(0x1c1))[_0x574637(0x1ac)],'modified':_0x46aada[_0x574637(0x18a)](_0x201241=>_0x201241[_0x574637(0x1bf)]===_0x574637(0x1c4))[_0x574637(0x1ac)],'deleted':_0x46aada[_0x574637(0x18a)](_0x2904f4=>_0x2904f4[_0x574637(0x1bf)]===_0x574637(0x199))[_0x574637(0x1ac)],'unchanged':_0x46aada[_0x574637(0x18a)](_0x131d91=>_0x131d91['type']===_0x574637(0x19e))[_0x574637(0x1ac)]};return{'projectName':_0x2ef940,'projectId':_0x7689a,'revision':_0x513950,'sourceDir':_0x2a6bbc,'changes':_0x46aada,'summary':_0x5e0d9c,'hasChanges':_0x5e0d9c[_0x574637(0x1c1)]>0x0||_0x5e0d9c['modified']>0x0||_0x5e0d9c[_0x574637(0x199)]>0x0,'configResult':_0x14e8e3};}export async function executePushWorkflow(_0x2bc166,_0x1c957f){const _0x4d5907=a152_0x4d5e,_0x5c03e4=await import(_0x4d5907(0x198)),{client:_0x5baddc}=_0x2bc166,_0x3256ad=await getProjectFiles(_0x1c957f[_0x4d5907(0x1a6)]),_0x599bc9=await a152_0x3311cc['mkdtemp'](a152_0x2be170['join'](a152_0x32c0e3[_0x4d5907(0x195)](),_0x4d5907(0x1a5))),_0x8ec109=a152_0x2be170[_0x4d5907(0x1bd)](_0x599bc9,_0x4d5907(0x196));try{await _0x5c03e4[_0x4d5907(0x1a1)]({'file':_0x8ec109,'gzip':!![],'cwd':_0x1c957f['sourceDir'],'portable':!![]},_0x3256ad);const _0x8b1eb1=await _0x5baddc['uploadProjectArchive'](_0x1c957f[_0x4d5907(0x19d)],_0x1c957f[_0x4d5907(0x1a0)],_0x8ec109);return updateWorkflowTdxConfig(_0x1c957f[_0x4d5907(0x1be)][_0x4d5907(0x1b8)],{'workflow_project_id':_0x8b1eb1['id'],'last_pushed_revision':_0x8b1eb1[_0x4d5907(0x1a0)],'last_pushed_at':new Date()['toISOString']()}),{'projectId':_0x8b1eb1['id'],'projectName':_0x8b1eb1['name'],'revision':_0x8b1eb1[_0x4d5907(0x1a0)]};}finally{await a152_0x3311cc['rm'](_0x599bc9,{'recursive':!![],'force':!![]});}}function a152_0x120d(){const _0x4451ac=['tdx-wf-push-archive-','sourceDir','cwd','2412008iqtGga','name','tdx-wf-push-','mkdir','length','4385661xAPVpF','mkdtemp','readdir','message','add','catch','15DqpMBJ','skipValidation','extract','push','65924lxuHaI','configPath','path','\x20workflow\x20files\x20found\x20in\x20','utf-8','replace','join','configResult','type','readFile','new','TAR_BAD_ARCHIVE','endsWith','modified','filter','downloadProjectArchive','26270KAMZjA','11407656mUyARl','6037544pfZtet','WORKFLOW_ARCHIVE_CORRUPTED','workflow_project','6kCESwL','includes','extracted','localeCompare','tmpdir','archive.tar.gz','27864490QgtjQf','tar','deleted','zlib','9xOgGPP','isDirectory','projectName','unchanged','Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison.\x20The\x20archive\x20may\x20be\x20corrupted\x20on\x20the\x20server.','revision','create','No\x20','.digdagignore','posix'];a152_0x120d=function(){return _0x4451ac;};return a152_0x120d();}async function getProjectFiles(_0xf4116a,_0x3d39fe=_0xf4116a,_0x2c1a28='',_0xe8a66a=null){const _0x426452=a152_0x4d5e,_0x4e5e2e=[];if(_0xe8a66a===null){_0xe8a66a=createIgnoreInstance();const _0x405d20=await loadDigdagignore(_0xf4116a);_0x405d20&&_0xe8a66a[_0x426452(0x1b1)](_0x405d20);}if(_0x2c1a28!==''){const _0xb4b2b5=await loadDigdagignore(_0x3d39fe);_0xb4b2b5&&addScopedPatterns(_0xe8a66a,_0xb4b2b5,_0x2c1a28);}const _0x1b8d51=await a152_0x3311cc['readdir'](_0x3d39fe,{'withFileTypes':!![]});for(const _0x3c9183 of _0x1b8d51){const _0x26819a=_0x2c1a28?a152_0x2be170[_0x426452(0x1a4)]['join'](_0x2c1a28,_0x3c9183[_0x426452(0x1a9)]):_0x3c9183[_0x426452(0x1a9)];if(_0x3c9183['name']==='tdx.json')continue;if(_0x3c9183[_0x426452(0x1a9)]===_0x426452(0x1a3))continue;if(!shouldIncludeInArchive(_0x3c9183[_0x426452(0x1a9)]))continue;if(shouldIgnoreWithInstance(_0xe8a66a,_0x26819a,_0x3c9183[_0x426452(0x19c)]()))continue;if(_0x3c9183[_0x426452(0x19c)]()){const _0x39c765=await getProjectFiles(_0xf4116a,a152_0x2be170[_0x426452(0x1bd)](_0x3d39fe,_0x3c9183['name']),_0x26819a,_0xe8a66a);_0x4e5e2e[_0x426452(0x1b6)](..._0x39c765);}else _0x4e5e2e[_0x426452(0x1b6)](_0x26819a);}return _0x4e5e2e;}async function calculatePushChanges(_0xd1655e,_0x58dac5,_0x2f11f5){const _0x120da8=a152_0x4d5e,_0x7c6130=[],_0x384a88=new Set(await getProjectFiles(_0x58dac5));for(const _0x16f1db of _0x2f11f5){const _0x4eac5f=a152_0x2be170[_0x120da8(0x1bd)](_0xd1655e,_0x16f1db),_0x696df4=a152_0x2be170['join'](_0x58dac5,_0x16f1db),_0x38d7cc=await a152_0x3311cc[_0x120da8(0x1c0)](_0x4eac5f,_0x120da8(0x1bb))[_0x120da8(0x1b2)](()=>null);if(_0x38d7cc===null)continue;if(!_0x384a88['has'](_0x16f1db))_0x7c6130[_0x120da8(0x1b6)]({'path':_0x16f1db,'type':_0x120da8(0x1c1),'newContent':_0x38d7cc});else{const _0x1b42e9=await a152_0x3311cc[_0x120da8(0x1c0)](_0x696df4,_0x120da8(0x1bb))['catch'](()=>null);if(_0x1b42e9===null)_0x7c6130[_0x120da8(0x1b6)]({'path':_0x16f1db,'type':_0x120da8(0x1c4),'newContent':_0x38d7cc});else{if(_0x1b42e9!==_0x38d7cc){const _0xcc6f42=generateDiff(_0x1b42e9,_0x38d7cc),_0x3e64f0=hasChanges(_0xcc6f42)?formatDiffWithColors(_0xcc6f42):undefined;_0x7c6130['push']({'path':_0x16f1db,'type':'modified','oldContent':_0x1b42e9,'newContent':_0x38d7cc,'diff':_0x3e64f0});}else _0x7c6130[_0x120da8(0x1b6)]({'path':_0x16f1db,'type':_0x120da8(0x19e)});}}}for(const _0x32f4e7 of _0x384a88){if(!_0x2f11f5[_0x120da8(0x192)](_0x32f4e7)){const _0x35dd8c=a152_0x2be170[_0x120da8(0x1bd)](_0x58dac5,_0x32f4e7),_0x48ed95=await a152_0x3311cc[_0x120da8(0x1c0)](_0x35dd8c,_0x120da8(0x1bb))['catch'](()=>undefined);_0x7c6130[_0x120da8(0x1b6)]({'path':_0x32f4e7,'type':_0x120da8(0x199),'oldContent':_0x48ed95});}}return _0x7c6130['sort']((_0x2689cc,_0x2acdf0)=>_0x2689cc['path'][_0x120da8(0x194)](_0x2acdf0[_0x120da8(0x1b9)])),_0x7c6130;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a153_0x25bfe1=a153_0x3799;(function(_0x277c6b,_0x2bb37c){const _0x476dc9=a153_0x3799,_0x363aa5=_0x277c6b();while(!![]){try{const _0x9fc963=parseInt(_0x476dc9(0x1c9))/0x1+parseInt(_0x476dc9(0x1c7))/0x2+-parseInt(_0x476dc9(0x1c3))/0x3*(-parseInt(_0x476dc9(0x1ca))/0x4)+parseInt(_0x476dc9(0x1b8))/0x5*(-parseInt(_0x476dc9(0x1b4))/0x6)+parseInt(_0x476dc9(0x1ba))/0x7+parseInt(_0x476dc9(0x1c1))/0x8+-parseInt(_0x476dc9(0x1b3))/0x9;if(_0x9fc963===_0x2bb37c)break;else _0x363aa5['push'](_0x363aa5['shift']());}catch(_0x577065){_0x363aa5['push'](_0x363aa5['shift']());}}}(a153_0x51b5,0xb4e85));import{existsSync,readFileSync,writeFileSync}from'fs';import a153_0x983695 from'path';function a153_0x51b5(){const _0x1b4bab=['last_pushed_at','last_pushed_revision','911914goqgrO','workflow_project_id','44538VaMOkK','125576bdYrfD','toISOString','stringify','dirname','cwd','tdx.json','7560036xHcMBX','3342IcOYoa','Invalid\x20JSON\x20in\x20','parse','string','12785UHYWZQ','last_pulled_at','5860834pBDydL','No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','Invalid\x20tdx.json:\x20expected\x20object','root','last_pulled_revision','workflow_project','utf-8','1535800HftiqH','join','141JHqaOe','object'];a153_0x51b5=function(){return _0x1b4bab;};return a153_0x51b5();}const TDX_CONFIG_FILE=a153_0x25bfe1(0x1b2),WORKFLOWS_DIR='workflows';export function findWorkflowTdxConfigPath(_0x1b9006=process[a153_0x25bfe1(0x1ce)]()){const _0x5beea5=a153_0x25bfe1;let _0x3d03df=a153_0x983695['resolve'](_0x1b9006);const _0x23fe1a=a153_0x983695[_0x5beea5(0x1b6)](_0x3d03df)[_0x5beea5(0x1bd)];while(_0x3d03df!==_0x23fe1a){const _0x519ef4=a153_0x983695[_0x5beea5(0x1c2)](_0x3d03df,TDX_CONFIG_FILE);if(existsSync(_0x519ef4))try{const _0xa8fc51=readFileSync(_0x519ef4,_0x5beea5(0x1c0)),_0x36d151=JSON[_0x5beea5(0x1b6)](_0xa8fc51);if(_0x36d151&&typeof _0x36d151===_0x5beea5(0x1c4)&&_0x5beea5(0x1bf)in _0x36d151)return _0x519ef4;}catch{}_0x3d03df=a153_0x983695[_0x5beea5(0x1cd)](_0x3d03df);}return null;}export function loadWorkflowTdxConfig(_0x9c3789){const _0x57b23c=a153_0x25bfe1,_0x357ec5=readFileSync(_0x9c3789,_0x57b23c(0x1c0));let _0x2f1359;try{_0x2f1359=JSON[_0x57b23c(0x1b6)](_0x357ec5);}catch{throw new Error(_0x57b23c(0x1b5)+_0x9c3789);}if(!_0x2f1359||typeof _0x2f1359!==_0x57b23c(0x1c4))throw new Error(_0x57b23c(0x1bc));const _0x5684e6=_0x2f1359;if(!_0x5684e6[_0x57b23c(0x1bf)]||typeof _0x5684e6[_0x57b23c(0x1bf)]!==_0x57b23c(0x1b7))throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field');return{'workflow_project':_0x5684e6[_0x57b23c(0x1bf)],'workflow_project_id':typeof _0x5684e6[_0x57b23c(0x1c8)]===_0x57b23c(0x1b7)?_0x5684e6[_0x57b23c(0x1c8)]:undefined,'last_pulled_revision':typeof _0x5684e6[_0x57b23c(0x1be)]===_0x57b23c(0x1b7)?_0x5684e6[_0x57b23c(0x1be)]:undefined,'last_pulled_at':typeof _0x5684e6[_0x57b23c(0x1b9)]==='string'?_0x5684e6[_0x57b23c(0x1b9)]:undefined,'last_pushed_revision':typeof _0x5684e6[_0x57b23c(0x1c6)]===_0x57b23c(0x1b7)?_0x5684e6[_0x57b23c(0x1c6)]:undefined,'last_pushed_at':typeof _0x5684e6['last_pushed_at']===_0x57b23c(0x1b7)?_0x5684e6[_0x57b23c(0x1c5)]:undefined};}export function findWorkflowTdxConfig(_0xd7efab=process['cwd']()){const _0x529ed9=a153_0x25bfe1,_0x103bb2=findWorkflowTdxConfigPath(_0xd7efab);if(!_0x103bb2)throw new Error(_0x529ed9(0x1bb));const _0x2410f5=loadWorkflowTdxConfig(_0x103bb2),_0x3eb1cd=a153_0x983695[_0x529ed9(0x1cd)](_0x103bb2);return{'config':_0x2410f5,'configPath':_0x103bb2,'configDir':_0x3eb1cd};}export function tryFindWorkflowTdxConfig(_0x519c4f){try{return findWorkflowTdxConfig(_0x519c4f);}catch{return null;}}export function getWorkflowProjectDir(_0x948514,_0x579302=process[a153_0x25bfe1(0x1ce)]()){const _0x555325=a153_0x25bfe1;return a153_0x983695[_0x555325(0x1c2)](_0x579302,WORKFLOWS_DIR,_0x948514);}function a153_0x3799(_0x4e3600,_0x3fa635){_0x4e3600=_0x4e3600-0x1b2;const _0x51b514=a153_0x51b5();let _0x3799ba=_0x51b514[_0x4e3600];return _0x3799ba;}export function getWorkflowTdxConfigPath(_0x327955,_0x2ccf6e=process[a153_0x25bfe1(0x1ce)]()){const _0x46276c=a153_0x25bfe1;return a153_0x983695[_0x46276c(0x1c2)](getWorkflowProjectDir(_0x327955,_0x2ccf6e),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x1f18d6,_0x281480,_0x18ca32){const _0x240f37=a153_0x25bfe1,_0x579ae7={'workflow_project':_0x1f18d6,..._0x281480&&{'workflow_project_id':_0x281480},..._0x18ca32&&{'last_pulled_revision':_0x18ca32},'last_pulled_at':new Date()[_0x240f37(0x1cb)]()};return JSON[_0x240f37(0x1cc)](_0x579ae7,null,0x2)+'\x0a';}export function saveWorkflowTdxConfig(_0x27432c,_0x35ccd2){const _0x419a5d=a153_0x25bfe1,_0x210210=JSON[_0x419a5d(0x1cc)](_0x35ccd2,null,0x2)+'\x0a';writeFileSync(_0x27432c,_0x210210,_0x419a5d(0x1c0));}export function updateWorkflowTdxConfig(_0x2354ac,_0x544793){const _0x4e463b=loadWorkflowTdxConfig(_0x2354ac),_0x4a4460={..._0x4e463b,..._0x544793};saveWorkflowTdxConfig(_0x2354ac,_0x4a4460);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a154_0x5e7903=a154_0x5211;(function(_0x4b1395,_0x1f60e9){const _0x4f389d=a154_0x5211,_0x9d97c0=_0x4b1395();while(!![]){try{const _0x69b065=-parseInt(_0x4f389d(0x11b))/0x1+parseInt(_0x4f389d(0x10e))/0x2+-parseInt(_0x4f389d(0x11d))/0x3+-parseInt(_0x4f389d(0x10c))/0x4+parseInt(_0x4f389d(0x120))/0x5*(-parseInt(_0x4f389d(0x122))/0x6)+parseInt(_0x4f389d(0x117))/0x7*(-parseInt(_0x4f389d(0x123))/0x8)+parseInt(_0x4f389d(0x124))/0x9;if(_0x69b065===_0x1f60e9)break;else _0x9d97c0['push'](_0x9d97c0['shift']());}catch(_0x2d4509){_0x9d97c0['push'](_0x9d97c0['shift']());}}}(a154_0x9dbb,0xd4766));import{promises as a154_0x4ca797}from'fs';import a154_0x2671cb from'path';function a154_0x9dbb(){const _0x15da91=['slice','add','5seXVcd','.DS_Store','8847822qTyTWU','40pRUQWd','44795133yQdhip','4861448cBklqW','Thumbs.db','1730986IvCZxq','length','split','trim','.digdagignore','.dig','ignores','readFile','map','990465SmSGjY','startsWith','endsWith','code','181106lEfklh','filter','4181712cmzcUF'];a154_0x9dbb=function(){return _0x15da91;};return a154_0x9dbb();}import a154_0x5ee633 from'ignore';export const WORKFLOW_FILE_EXTENSION=a154_0x5e7903(0x113);export function shouldIncludeInArchive(_0x5d7016){const _0x526494=a154_0x5e7903;if(_0x5d7016==='.digdag')return!![];if(_0x5d7016[_0x526494(0x118)]('.'))return![];if(_0x5d7016[_0x526494(0x119)]('~'))return![];if(_0x5d7016===_0x526494(0x10d)||_0x5d7016===_0x526494(0x121))return![];return!![];}export function parseDigdagignore(_0x5016cf){const _0x16e627=a154_0x5e7903;return _0x5016cf[_0x16e627(0x110)]('\x0a')[_0x16e627(0x116)](_0x3ccbb2=>_0x3ccbb2[_0x16e627(0x111)]())[_0x16e627(0x11c)](_0x12b006=>_0x12b006[_0x16e627(0x10f)]>0x0&&!_0x12b006['startsWith']('#'));}export async function loadDigdagignore(_0x3bbb26){const _0x49a2ca=a154_0x5e7903,_0x14deb3=a154_0x2671cb['join'](_0x3bbb26,_0x49a2ca(0x112));try{const _0xe1ffe=await a154_0x4ca797[_0x49a2ca(0x115)](_0x14deb3,'utf-8');return parseDigdagignore(_0xe1ffe);}catch(_0x263d5e){if(_0x263d5e[_0x49a2ca(0x11a)]==='ENOENT')return null;throw _0x263d5e;}}function a154_0x5211(_0x36752a,_0x350154){_0x36752a=_0x36752a-0x10c;const _0x9dbbee=a154_0x9dbb();let _0x52119e=_0x9dbbee[_0x36752a];return _0x52119e;}export function createIgnoreInstance(_0x3f2b1b){const _0x5d75aa=a154_0x5e7903,_0x1c3ff4=a154_0x5ee633();return _0x3f2b1b&&_0x3f2b1b[_0x5d75aa(0x10f)]>0x0&&_0x1c3ff4[_0x5d75aa(0x11f)](_0x3f2b1b),_0x1c3ff4;}export function addScopedPatterns(_0x5c42c5,_0x36f20e,_0x592a25){const _0x4a5896=a154_0x5e7903,_0x4d45f4=_0x36f20e[_0x4a5896(0x116)](_0x18bd42=>{const _0x27ad88=_0x4a5896;if(_0x18bd42[_0x27ad88(0x118)]('!')){const _0x1e5643=_0x18bd42[_0x27ad88(0x11e)](0x1);if(_0x1e5643[_0x27ad88(0x118)]('/'))return'!'+_0x592a25+_0x1e5643;return'!'+_0x592a25+'/'+_0x1e5643;}if(_0x18bd42['startsWith']('/'))return''+_0x592a25+_0x18bd42;return _0x592a25+'/'+_0x18bd42;});return _0x5c42c5['add'](_0x4d45f4),_0x5c42c5;}export function shouldIgnoreWithInstance(_0x4d20ab,_0x3aa110,_0x3cc720){const _0x602fa3=a154_0x5e7903,_0x298980=_0x3aa110['replace'](/\\/g,'/'),_0x5b0543=_0x3cc720?_0x298980+'/':_0x298980;return _0x4d20ab[_0x602fa3(0x114)](_0x5b0543);}
|
package/dist/utils/async.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a155_0x315c(){const _0x1e6da8=['12HYzLBu','1406690jDyqOd','284966kmWhlw','658761RzrYlx','length','333RMWBiO','46614DQKVFq','all','slice','push','1516886QulVbf','1849432MbXQIK','18XMFbEK','599470CceVdb'];a155_0x315c=function(){return _0x1e6da8;};return a155_0x315c();}(function(_0x3ab1c6,_0x4553dc){const _0x2cd25e=a155_0x128b,_0x31bdad=_0x3ab1c6();while(!![]){try{const _0x566d94=-parseInt(_0x2cd25e(0x97))/0x1+parseInt(_0x2cd25e(0x8d))/0x2+-parseInt(_0x2cd25e(0x98))/0x3*(parseInt(_0x2cd25e(0x95))/0x4)+parseInt(_0x2cd25e(0x96))/0x5*(-parseInt(_0x2cd25e(0x93))/0x6)+parseInt(_0x2cd25e(0x91))/0x7+-parseInt(_0x2cd25e(0x92))/0x8+-parseInt(_0x2cd25e(0x8c))/0x9*(-parseInt(_0x2cd25e(0x94))/0xa);if(_0x566d94===_0x4553dc)break;else _0x31bdad['push'](_0x31bdad['shift']());}catch(_0x36d8da){_0x31bdad['push'](_0x31bdad['shift']());}}}(a155_0x315c,0x6b354));function a155_0x128b(_0x2c11cb,_0x449b0){_0x2c11cb=_0x2c11cb-0x8b;const _0x315c4f=a155_0x315c();let _0x128ba9=_0x315c4f[_0x2c11cb];return _0x128ba9;}export async function batchAsync(_0x2d3e41,_0x3c084c,_0x57cf1e=0xa){const _0x199f32=a155_0x128b,_0x5cba7a=[];for(let _0x5630f7=0x0;_0x5630f7<_0x2d3e41[_0x199f32(0x8b)];_0x5630f7+=_0x57cf1e){const _0x6533cf=_0x2d3e41[_0x199f32(0x8f)](_0x5630f7,_0x5630f7+_0x57cf1e),_0x20716d=await Promise[_0x199f32(0x8e)](_0x6533cf['map'](_0x3c084c));_0x5cba7a[_0x199f32(0x90)](..._0x20716d);}return _0x5cba7a;}
|
package/dist/utils/colors.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1c3a02,_0x2f4e5d){const _0x330466=a156_0x3df3,_0x22dd97=_0x1c3a02();while(!![]){try{const _0x50573a=-parseInt(_0x330466(0xe0))/0x1*(-parseInt(_0x330466(0xf0))/0x2)+-parseInt(_0x330466(0xdc))/0x3*(-parseInt(_0x330466(0xe2))/0x4)+-parseInt(_0x330466(0xda))/0x5+-parseInt(_0x330466(0xe1))/0x6+-parseInt(_0x330466(0xd9))/0x7+-parseInt(_0x330466(0xe3))/0x8+parseInt(_0x330466(0xec))/0x9;if(_0x50573a===_0x2f4e5d)break;else _0x22dd97['push'](_0x22dd97['shift']());}catch(_0x5bf761){_0x22dd97['push'](_0x22dd97['shift']());}}}(a156_0x5667,0xabc4a));import*as a156_0xb64fbf from'chalk';const Chalk=a156_0xb64fbf['Chalk'];export function shouldUseColor(_0x5383a8={}){const _0x151b69=a156_0x3df3;if(_0x5383a8[_0x151b69(0xdd)]===!![])return![];if(_0x5383a8['color']===!![])return!![];if(process[_0x151b69(0xf1)]['NO_COLOR']!==undefined)return![];return process[_0x151b69(0xef)][_0x151b69(0xea)]??![];}export function getChalk(_0x4db437={}){if(shouldUseColor(_0x4db437))return new Chalk({'level':0x3});return new Chalk({'level':0x0});}export function colorBorder(_0x4f7467,_0x398ecb={}){return getChalk(_0x398ecb)['dim'](_0x4f7467);}function a156_0x5667(){const _0x599559=['387196KjZcDy','env','cyan','green','blue','8233232PYWBlv','1858630FyRnxA','object','251877mMZuwz','noColor','length','join','6sapjRl','973710rRVLMa','52cICuPp','369472TppJPy','dim','null','stringify','map','isArray','repeat','isTTY','string','1861902delhro','boolean','entries','stdout'];a156_0x5667=function(){return _0x599559;};return a156_0x5667();}export function colorHeader(_0x4e000a,_0x20b6d3={}){const _0x58c712=a156_0x3df3;return getChalk(_0x20b6d3)[_0x58c712(0xf2)](_0x4e000a);}export function colorType(_0x59ae2b,_0x326842={}){const _0x2087bd=a156_0x3df3;return getChalk(_0x326842)[_0x2087bd(0xe4)](_0x59ae2b);}export function colorJSONKey(_0x187c26,_0x9a3cca={}){const _0x5913ce=a156_0x3df3;return getChalk(_0x9a3cca)[_0x5913ce(0xf4)](_0x187c26);}export function colorJSONString(_0x46151f,_0x2488f0={}){const _0xd221c0=a156_0x3df3;return getChalk(_0x2488f0)[_0xd221c0(0xf3)](_0x46151f);}export function colorJSONNumber(_0x20d0fa,_0x29f8cc={}){const _0x3eacdb=a156_0x3df3;return getChalk(_0x29f8cc)[_0x3eacdb(0xf2)](_0x20d0fa);}export function colorJSONBoolean(_0x463951,_0x14406f={}){return getChalk(_0x14406f)['yellow'](_0x463951);}export function colorJSONNull(_0x1f555c,_0x38db5e={}){const _0x32d159=a156_0x3df3;return getChalk(_0x38db5e)[_0x32d159(0xe4)](_0x1f555c);}function a156_0x3df3(_0x36ece9,_0x43b4bb){_0x36ece9=_0x36ece9-0xd9;const _0x5667e0=a156_0x5667();let _0x3df3d9=_0x5667e0[_0x36ece9];return _0x3df3d9;}export function colorizeJSONCompact(_0x13ea39,_0x1c49d0={}){const _0x1a4598=a156_0x3df3;if(!shouldUseColor(_0x1c49d0))return JSON[_0x1a4598(0xe6)](_0x13ea39);if(_0x13ea39===null)return colorJSONNull(_0x1a4598(0xe5),_0x1c49d0);if(typeof _0x13ea39===_0x1a4598(0xed))return colorJSONBoolean(String(_0x13ea39),_0x1c49d0);if(typeof _0x13ea39==='number')return colorJSONNumber(String(_0x13ea39),_0x1c49d0);if(typeof _0x13ea39===_0x1a4598(0xeb))return colorJSONString(JSON['stringify'](_0x13ea39),_0x1c49d0);if(Array[_0x1a4598(0xe8)](_0x13ea39)){if(_0x13ea39[_0x1a4598(0xde)]===0x0)return'[]';const _0x65558=_0x13ea39[_0x1a4598(0xe7)](_0x8b970=>colorizeJSONCompact(_0x8b970,_0x1c49d0));return'['+_0x65558[_0x1a4598(0xdf)](',')+']';}if(typeof _0x13ea39===_0x1a4598(0xdb)){const _0x586d27=Object[_0x1a4598(0xee)](_0x13ea39);if(_0x586d27['length']===0x0)return'{}';const _0x4b6fbb=_0x586d27[_0x1a4598(0xe7)](([_0x507db4,_0x7b2298])=>{const _0x1d2508=_0x1a4598,_0x831ed5=colorJSONKey(JSON[_0x1d2508(0xe6)](_0x507db4),_0x1c49d0),_0x4342cf=colorizeJSONCompact(_0x7b2298,_0x1c49d0);return _0x831ed5+':'+_0x4342cf;});return'{'+_0x4b6fbb[_0x1a4598(0xdf)](',')+'}';}return String(_0x13ea39);}export function colorizeJSON(_0x320afb,_0x300e66={},_0x92f007=0x0){const _0x5e4acc=a156_0x3df3;if(!shouldUseColor(_0x300e66))return JSON[_0x5e4acc(0xe6)](_0x320afb,null,0x2);const _0x14929e='\x20'[_0x5e4acc(0xe9)](_0x92f007),_0x1a4f4f=_0x92f007+0x2;if(_0x320afb===null)return colorJSONNull(_0x5e4acc(0xe5),_0x300e66);if(typeof _0x320afb===_0x5e4acc(0xed))return colorJSONBoolean(String(_0x320afb),_0x300e66);if(typeof _0x320afb==='number')return colorJSONNumber(String(_0x320afb),_0x300e66);if(typeof _0x320afb===_0x5e4acc(0xeb))return colorJSONString(JSON[_0x5e4acc(0xe6)](_0x320afb),_0x300e66);if(Array[_0x5e4acc(0xe8)](_0x320afb)){if(_0x320afb[_0x5e4acc(0xde)]===0x0)return'[]';const _0x9a3fac=_0x320afb[_0x5e4acc(0xe7)](_0x3e3c21=>{const _0x4fbd90=_0x5e4acc,_0x3d1472=colorizeJSON(_0x3e3c21,_0x300e66,_0x1a4f4f);return''+'\x20'[_0x4fbd90(0xe9)](_0x1a4f4f)+_0x3d1472;});return'[\x0a'+_0x9a3fac[_0x5e4acc(0xdf)](',\x0a')+('\x0a'+_0x14929e+']');}if(typeof _0x320afb===_0x5e4acc(0xdb)){const _0xa8a0b3=Object[_0x5e4acc(0xee)](_0x320afb);if(_0xa8a0b3['length']===0x0)return'{}';const _0x14615c=_0xa8a0b3[_0x5e4acc(0xe7)](([_0x4f3763,_0x140311])=>{const _0x504d1a=_0x5e4acc,_0x144136=colorJSONKey(JSON[_0x504d1a(0xe6)](_0x4f3763),_0x300e66),_0x3424eb=colorizeJSON(_0x140311,_0x300e66,_0x1a4f4f);return''+'\x20'[_0x504d1a(0xe9)](_0x1a4f4f)+_0x144136+':\x20'+_0x3424eb;});return'{\x0a'+_0x14615c[_0x5e4acc(0xdf)](',\x0a')+('\x0a'+_0x14929e+'}');}return String(_0x320afb);}
|
package/dist/utils/diff.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x5dd34a,_0x145985){const _0xa8e2d1=a157_0x4e69,_0x1f8a59=_0x5dd34a();while(!![]){try{const _0x49f2cd=-parseInt(_0xa8e2d1(0x17e))/0x1+parseInt(_0xa8e2d1(0x193))/0x2+parseInt(_0xa8e2d1(0x184))/0x3*(-parseInt(_0xa8e2d1(0x19d))/0x4)+-parseInt(_0xa8e2d1(0x19a))/0x5*(parseInt(_0xa8e2d1(0x18b))/0x6)+-parseInt(_0xa8e2d1(0x195))/0x7*(parseInt(_0xa8e2d1(0x186))/0x8)+parseInt(_0xa8e2d1(0x187))/0x9+-parseInt(_0xa8e2d1(0x189))/0xa*(-parseInt(_0xa8e2d1(0x18f))/0xb);if(_0x49f2cd===_0x145985)break;else _0x1f8a59['push'](_0x1f8a59['shift']());}catch(_0x8c2dd7){_0x1f8a59['push'](_0x1f8a59['shift']());}}}(a157_0x328f,0x1f1e4));function a157_0x4e69(_0x388010,_0x1c5705){_0x388010=_0x388010-0x17c;const _0x328f49=a157_0x328f();let _0x4e69a1=_0x328f49[_0x388010];return _0x4e69a1;}import a157_0x407e8e from'chalk';function a157_0x328f(){const _0x3dcbac=['length','3JZhyDc','forEach','40amREde','573984opAhUv','type','120XmHxsp','fill','86466yvgmFs','unchanged','cyan','repeat','414942RlolXD','new','add','unshift','183112uBemsF','join','161693QBCEFQ','push','\x20\x20...','old','\x20\x20\x20','45VDPtFA','removed','size','188924wPksfm','padStart','split','has','content','red','188111SOQyWq','max','added','\x20-\x20','min'];a157_0x328f=function(){return _0x3dcbac;};return a157_0x328f();}export function generateDiff(_0x55aea9,_0x202c1a){const _0x325e9c=a157_0x4e69,_0x2486c8=_0x55aea9[_0x325e9c(0x19f)]('\x0a'),_0x37e646=_0x202c1a[_0x325e9c(0x19f)]('\x0a'),_0x483cdd=[],_0xb3b90b=computeLCS(_0x2486c8,_0x37e646);let _0x19d343=0x0,_0xc54113=0x0,_0x588a6a=0x0;while(_0x19d343<_0x2486c8['length']||_0xc54113<_0x37e646[_0x325e9c(0x183)]){if(_0x588a6a<_0xb3b90b[_0x325e9c(0x183)]&&_0x19d343<_0x2486c8[_0x325e9c(0x183)]&&_0x2486c8[_0x19d343]===_0xb3b90b[_0x588a6a])_0xc54113<_0x37e646['length']&&_0x37e646[_0xc54113]===_0xb3b90b[_0x588a6a]?(_0x483cdd['push']({'type':_0x325e9c(0x18c),'content':_0x2486c8[_0x19d343]}),_0x19d343++,_0xc54113++,_0x588a6a++):(_0x483cdd[_0x325e9c(0x196)]({'type':_0x325e9c(0x180),'content':_0x37e646[_0xc54113]}),_0xc54113++);else{if(_0x588a6a<_0xb3b90b[_0x325e9c(0x183)]&&_0xc54113<_0x37e646[_0x325e9c(0x183)]&&_0x37e646[_0xc54113]===_0xb3b90b[_0x588a6a])_0x483cdd[_0x325e9c(0x196)]({'type':_0x325e9c(0x19b),'content':_0x2486c8[_0x19d343]}),_0x19d343++;else{if(_0x19d343<_0x2486c8[_0x325e9c(0x183)]&&(_0x588a6a>=_0xb3b90b[_0x325e9c(0x183)]||_0x2486c8[_0x19d343]!==_0xb3b90b[_0x588a6a]))_0x483cdd['push']({'type':'removed','content':_0x2486c8[_0x19d343]}),_0x19d343++;else _0xc54113<_0x37e646[_0x325e9c(0x183)]&&(_0x483cdd[_0x325e9c(0x196)]({'type':_0x325e9c(0x180),'content':_0x37e646[_0xc54113]}),_0xc54113++);}}}return _0x483cdd;}function computeLCS(_0x532c01,_0x124fcf){const _0x39f3de=a157_0x4e69,_0xfdd0b2=_0x532c01[_0x39f3de(0x183)],_0x3586b8=_0x124fcf[_0x39f3de(0x183)],_0xaca0c6=Array(_0xfdd0b2+0x1)[_0x39f3de(0x18a)](null)['map'](()=>Array(_0x3586b8+0x1)[_0x39f3de(0x18a)](0x0));for(let _0x4d2461=0x1;_0x4d2461<=_0xfdd0b2;_0x4d2461++){for(let _0x7f9833=0x1;_0x7f9833<=_0x3586b8;_0x7f9833++){_0x532c01[_0x4d2461-0x1]===_0x124fcf[_0x7f9833-0x1]?_0xaca0c6[_0x4d2461][_0x7f9833]=_0xaca0c6[_0x4d2461-0x1][_0x7f9833-0x1]+0x1:_0xaca0c6[_0x4d2461][_0x7f9833]=Math[_0x39f3de(0x17f)](_0xaca0c6[_0x4d2461-0x1][_0x7f9833],_0xaca0c6[_0x4d2461][_0x7f9833-0x1]);}}const _0x5638c6=[];let _0x251b06=_0xfdd0b2,_0x1da106=_0x3586b8;while(_0x251b06>0x0&&_0x1da106>0x0){if(_0x532c01[_0x251b06-0x1]===_0x124fcf[_0x1da106-0x1])_0x5638c6[_0x39f3de(0x192)](_0x532c01[_0x251b06-0x1]),_0x251b06--,_0x1da106--;else _0xaca0c6[_0x251b06-0x1][_0x1da106]>_0xaca0c6[_0x251b06][_0x1da106-0x1]?_0x251b06--:_0x1da106--;}return _0x5638c6;}export function formatDiffWithColors(_0x26b353,_0x16e388=0x3){const _0x44b4fd=a157_0x4e69,_0x19a26b=new Set();_0x26b353[_0x44b4fd(0x185)]((_0x48caa8,_0x13c64c)=>{const _0x22c3d8=_0x44b4fd;_0x48caa8[_0x22c3d8(0x188)]!==_0x22c3d8(0x18c)&&_0x19a26b[_0x22c3d8(0x191)](_0x13c64c);});if(_0x19a26b[_0x44b4fd(0x19c)]===0x0)return'';const _0x3f430c=new Set();for(const _0x43c690 of _0x19a26b){for(let _0x19d89f=Math[_0x44b4fd(0x17f)](0x0,_0x43c690-_0x16e388);_0x19d89f<=Math[_0x44b4fd(0x182)](_0x26b353[_0x44b4fd(0x183)]-0x1,_0x43c690+_0x16e388);_0x19d89f++){_0x3f430c[_0x44b4fd(0x191)](_0x19d89f);}}const _0x34dabb=[];let _0x2376d1=-0x1;const _0xbdf915=_0x26b353[_0x44b4fd(0x183)],_0x43715b=Math[_0x44b4fd(0x17f)](0x3,String(_0xbdf915)[_0x44b4fd(0x183)]),_0x1f0a6a=[];let _0x5333e3=0x0,_0x5e99d9=0x0;for(const _0x20808e of _0x26b353){if(_0x20808e['type']===_0x44b4fd(0x19b))_0x5333e3++,_0x1f0a6a[_0x44b4fd(0x196)]({'old':_0x5333e3,'new':0x0});else _0x20808e[_0x44b4fd(0x188)]==='added'?(_0x5e99d9++,_0x1f0a6a['push']({'old':0x0,'new':_0x5e99d9})):(_0x5333e3++,_0x5e99d9++,_0x1f0a6a[_0x44b4fd(0x196)]({'old':_0x5333e3,'new':_0x5e99d9}));}for(let _0x40f12f=0x0;_0x40f12f<_0x26b353[_0x44b4fd(0x183)];_0x40f12f++){if(!_0x3f430c[_0x44b4fd(0x1a0)](_0x40f12f))continue;_0x2376d1!==-0x1&&_0x40f12f>_0x2376d1+0x1&&_0x34dabb[_0x44b4fd(0x196)](a157_0x407e8e[_0x44b4fd(0x18d)](_0x44b4fd(0x197)));_0x2376d1=_0x40f12f;const _0xbb5864=_0x26b353[_0x40f12f],_0x114290=_0x1f0a6a[_0x40f12f],_0x48d6aa=_0x114290['old']>0x0?String(_0x114290[_0x44b4fd(0x198)])[_0x44b4fd(0x19e)](_0x43715b):'\x20'[_0x44b4fd(0x18e)](_0x43715b),_0x3c8b97=_0x114290[_0x44b4fd(0x190)]>0x0?String(_0x114290[_0x44b4fd(0x190)])[_0x44b4fd(0x19e)](_0x43715b):'\x20'[_0x44b4fd(0x18e)](_0x43715b);switch(_0xbb5864[_0x44b4fd(0x188)]){case _0x44b4fd(0x19b):_0x34dabb['push'](a157_0x407e8e[_0x44b4fd(0x17d)](_0x48d6aa+'\x20'+_0x3c8b97+_0x44b4fd(0x181)+_0xbb5864[_0x44b4fd(0x17c)]));break;case'added':_0x34dabb[_0x44b4fd(0x196)](a157_0x407e8e['green'](_0x48d6aa+'\x20'+_0x3c8b97+'\x20+\x20'+_0xbb5864['content']));break;default:_0x34dabb[_0x44b4fd(0x196)](a157_0x407e8e['dim'](_0x48d6aa+'\x20'+_0x3c8b97+_0x44b4fd(0x199)+_0xbb5864[_0x44b4fd(0x17c)]));break;}}return _0x34dabb[_0x44b4fd(0x194)]('\x0a');}export function hasChanges(_0xc3f576){const _0x1a5ebb=a157_0x4e69;return _0xc3f576['some'](_0x490d38=>_0x490d38[_0x1a5ebb(0x188)]!=='unchanged');}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1efa9b,_0x455221){const _0x23d5a9=a158_0x21cd,_0x1e6cef=_0x1efa9b();while(!![]){try{const _0x5c1f30=-parseInt(_0x23d5a9(0x193))/0x1+-parseInt(_0x23d5a9(0x194))/0x2+parseInt(_0x23d5a9(0x19a))/0x3+-parseInt(_0x23d5a9(0x19b))/0x4*(-parseInt(_0x23d5a9(0x196))/0x5)+parseInt(_0x23d5a9(0x190))/0x6+-parseInt(_0x23d5a9(0x18b))/0x7+parseInt(_0x23d5a9(0x19c))/0x8*(parseInt(_0x23d5a9(0x195))/0x9);if(_0x5c1f30===_0x455221)break;else _0x1e6cef['push'](_0x1e6cef['shift']());}catch(_0xaec3f){_0x1e6cef['push'](_0x1e6cef['shift']());}}}(a158_0x3cf9,0xe1602));function a158_0x21cd(_0x494677,_0x4e5da0){_0x494677=_0x494677-0x18b;const _0x3cf902=a158_0x3cf9();let _0x21cd7a=_0x3cf902[_0x494677];return _0x21cd7a;}function a158_0x3cf9(){const _0xc076f6=['3532290nocKZx','113481TYKAhH','4415BSdNBj','writeFileSync','warn','mode','2061939vhbdPr','5932QqGNUo','736yhLdEy','Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20','mkdirSync',').\x20','458066qbmSAz','dirname','toString','chmodSync','\x20has\x20insecure\x20permissions\x20(','4213542ziDVXM','Should\x20be\x200600\x20or\x20more\x20restrictive.','existsSync','1104366wmRbJB'];a158_0x3cf9=function(){return _0xc076f6;};return a158_0x3cf9();}import*as a158_0x87885f from'node:fs';import*as a158_0x55a8cb from'node:path';export function setSecureFilePermissions(_0xe848c5){const _0x4dc4df=a158_0x21cd;try{a158_0x87885f[_0x4dc4df(0x18e)](_0xe848c5,0x180);}catch{console[_0x4dc4df(0x198)](_0x4dc4df(0x19d)+_0xe848c5);}}export function setSecureDirectoryPermissions(_0x554582){const _0x326628=a158_0x21cd;try{a158_0x87885f['chmodSync'](_0x554582,0x1c0);}catch{console[_0x326628(0x198)]('Warning:\x20Could\x20not\x20set\x20secure\x20permissions\x20on\x20'+_0x554582);}}export function createSecureDirectory(_0x52b83a){const _0x404294=a158_0x21cd;!a158_0x87885f[_0x404294(0x192)](_0x52b83a)&&(a158_0x87885f[_0x404294(0x19e)](_0x52b83a,{'recursive':!![],'mode':0x1c0}),setSecureDirectoryPermissions(_0x52b83a));}export function validateSecureFilePermissions(_0xb06067){const _0x5676c4=a158_0x21cd;try{const _0x445fda=a158_0x87885f['statSync'](_0xb06067),_0x495e45=_0x445fda[_0x5676c4(0x199)]&0x1ff,_0x2e83ca=(_0x495e45&0x3f)!==0x0;if(_0x2e83ca)return console['warn']('Warning:\x20'+_0xb06067+_0x5676c4(0x18f)+_0x495e45[_0x5676c4(0x18d)](0x8)+_0x5676c4(0x19f)+_0x5676c4(0x191)),![];return!![];}catch{return!![];}}export function writeSecureFile(_0x4526cf,_0x279ab4){const _0x2e62a2=a158_0x21cd,_0x372710=a158_0x55a8cb[_0x2e62a2(0x18c)](_0x4526cf);createSecureDirectory(_0x372710),a158_0x87885f[_0x2e62a2(0x197)](_0x4526cf,_0x279ab4,{'mode':0x180}),setSecureFilePermissions(_0x4526cf);}
|