@treasuredata/tdx 2026.3.20 → 2026.3.22
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.d.ts +33 -0
- package/dist/commands/policy-command.d.ts.map +1 -0
- package/dist/commands/policy-command.js +1 -0
- package/dist/commands/policy-command.js.map +1 -0
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +7 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.d.ts +41 -0
- package/dist/sdk/policy.d.ts.map +1 -0
- package/dist/sdk/policy.js +1 -0
- package/dist/sdk/policy.js.map +1 -0
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/policy.d.ts +58 -0
- package/dist/sdk/types/policy.d.ts.map +1 -0
- package/dist/sdk/types/policy.js +1 -0
- package/dist/sdk/types/policy.js.map +1 -0
- 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/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xbce2da,_0x3dcc0c){const _0x2d82b1=a177_0x1298,_0x3260a4=_0xbce2da();while(!![]){try{const _0x1135da=-parseInt(_0x2d82b1(0x66))/0x1*(-parseInt(_0x2d82b1(0x89))/0x2)+-parseInt(_0x2d82b1(0x8a))/0x3+parseInt(_0x2d82b1(0x7e))/0x4*(-parseInt(_0x2d82b1(0x77))/0x5)+parseInt(_0x2d82b1(0x90))/0x6*(parseInt(_0x2d82b1(0x86))/0x7)+parseInt(_0x2d82b1(0x79))/0x8*(-parseInt(_0x2d82b1(0x97))/0x9)+parseInt(_0x2d82b1(0x75))/0xa*(-parseInt(_0x2d82b1(0x7a))/0xb)+parseInt(_0x2d82b1(0x7d))/0xc;if(_0x1135da===_0x3dcc0c)break;else _0x3260a4['push'](_0x3260a4['shift']());}catch(_0x20fa91){_0x3260a4['push'](_0x3260a4['shift']());}}}(a177_0x123f,0x5b67a));import{formatRows,hyperlink}from'./formatters.js';function a177_0x1298(_0x4baa54,_0x307c17){_0x4baa54=_0x4baa54-0x64;const _0x123f6d=a177_0x123f();let _0x129832=_0x123f6d[_0x4baa54];return _0x129832;}function a177_0x123f(){const _0x8ec016=['📁\x20','folderCount','length','(completed)','type','join','🎯\x20','children','94550SJVhLo','sortKey','9595NIfJlv','getJourneyUrl','18224nQFCQd','682bNutPr','segment','showTreeLines','14668440OgmaQG','568BLhbUO','paused','base','push','displayName','\x20\x20\x20\x20','\x20folder','(empty)','21eWrkTT','\x20\x20\x20','folder','1086388oMPRFx','1865643jwcgqT','journeyCount','showMetadata','name','draft','metadata','638994EbjbJP','\x20journey','sort','(paused)','journey','dim','(draft)','909MAnHtR','journeyBundleName','🗺️\x20','segmentCount','icon','1YwBAOt','state','launched','showIcons','population','localeCompare','getSegmentUrl'];a177_0x123f=function(){return _0x8ec016;};return a177_0x123f();}import a177_0x211d3a from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};export function formatTree(_0x25c7e5,_0xce9108={},_0x22da69=0x0,_0x46b8ba=''){const _0x4ec683=a177_0x1298,_0x316575={...DEFAULT_OPTIONS,..._0xce9108},_0x47a112=[],_0x26760e=[..._0x25c7e5][_0x4ec683(0x92)]((_0x2f6bab,_0x56f012)=>_0x2f6bab[_0x4ec683(0x8d)][_0x4ec683(0x6b)](_0x56f012['name'],undefined,{'sensitivity':_0x4ec683(0x80)}));for(let _0x17822b=0x0;_0x17822b<_0x26760e[_0x4ec683(0x6f)];_0x17822b++){const _0x3c1dea=_0x26760e[_0x17822b],_0x55fb8a=_0x17822b===_0x26760e[_0x4ec683(0x6f)]-0x1;let _0x5c9366='';_0x22da69>0x0&&(_0x5c9366+=_0x46b8ba);_0x316575['showTreeLines']&&_0x22da69>0x0&&(_0x5c9366+=a177_0x211d3a['dim'](_0x55fb8a?'└──\x20':'├──\x20'));if(_0x316575[_0x4ec683(0x69)]){if(_0x3c1dea[_0x4ec683(0x71)]===_0x4ec683(0x88))_0x5c9366+=_0x4ec683(0x6d);else _0x3c1dea[_0x4ec683(0x71)]===_0x4ec683(0x94)?_0x5c9366+=_0x4ec683(0x99):_0x5c9366+=_0x4ec683(0x73);}if(_0x316575[_0x4ec683(0x6c)]&&_0x3c1dea[_0x4ec683(0x71)]===_0x4ec683(0x7b))_0x5c9366+=hyperlink(_0x3c1dea[_0x4ec683(0x8d)],_0x316575[_0x4ec683(0x6c)](_0x3c1dea['id']));else _0x316575[_0x4ec683(0x78)]&&_0x3c1dea[_0x4ec683(0x71)]===_0x4ec683(0x94)?_0x5c9366+=hyperlink(_0x3c1dea['name'],_0x316575[_0x4ec683(0x78)](_0x3c1dea['id'])):_0x5c9366+=_0x3c1dea[_0x4ec683(0x8d)];if(_0x316575[_0x4ec683(0x8c)]){if(_0x3c1dea[_0x4ec683(0x71)]==='folder'){const _0x26ffec=[];_0x3c1dea['metadata'][_0x4ec683(0x64)]&&_0x26ffec['push'](_0x3c1dea[_0x4ec683(0x8f)]['segmentCount']+'\x20segment'+(_0x3c1dea[_0x4ec683(0x8f)][_0x4ec683(0x64)]!==0x1?'s':'')),_0x3c1dea['metadata']['folderCount']&&_0x26ffec[_0x4ec683(0x81)](_0x3c1dea[_0x4ec683(0x8f)]['folderCount']+_0x4ec683(0x84)+(_0x3c1dea[_0x4ec683(0x8f)][_0x4ec683(0x6e)]!==0x1?'s':'')),_0x3c1dea[_0x4ec683(0x8f)][_0x4ec683(0x8b)]&&_0x26ffec[_0x4ec683(0x81)](_0x3c1dea[_0x4ec683(0x8f)][_0x4ec683(0x8b)]+_0x4ec683(0x91)+(_0x3c1dea[_0x4ec683(0x8f)]['journeyCount']!==0x1?'s':'')),_0x26ffec[_0x4ec683(0x6f)]>0x0&&(_0x5c9366+=a177_0x211d3a[_0x4ec683(0x95)]('\x20('+_0x26ffec[_0x4ec683(0x72)](',\x20')+')'));}else{if(_0x3c1dea['type']===_0x4ec683(0x7b)&&_0x3c1dea[_0x4ec683(0x6a)]!==undefined)_0x5c9366+=a177_0x211d3a[_0x4ec683(0x95)]('\x20('+formatRows(_0x3c1dea[_0x4ec683(0x6a)])+')');else _0x3c1dea[_0x4ec683(0x71)]===_0x4ec683(0x94)&&_0x3c1dea[_0x4ec683(0x67)]&&(_0x5c9366+=a177_0x211d3a[_0x4ec683(0x95)]('\x20'+getJourneyStateIndicator(_0x3c1dea[_0x4ec683(0x67)])));}}_0x47a112[_0x4ec683(0x81)](_0x5c9366);if(_0x3c1dea['children']&&_0x3c1dea[_0x4ec683(0x74)][_0x4ec683(0x6f)]>0x0){let _0x2c4e35;if(_0x22da69===0x0)_0x2c4e35='';else _0x316575[_0x4ec683(0x7c)]?_0x2c4e35=_0x46b8ba+(_0x55fb8a?_0x4ec683(0x83):a177_0x211d3a[_0x4ec683(0x95)]('│')+_0x4ec683(0x87)):_0x2c4e35=_0x46b8ba+_0x316575['indent'];const _0x2c1d5c=formatTree(_0x3c1dea['children'],_0x316575,_0x22da69+0x1,_0x2c4e35);_0x47a112['push'](_0x2c1d5c);}}return _0x47a112['join']('\x0a');}export function formatFlatList(_0x305c87,_0x2e2eb6,_0x13e8a0={},_0x452675=[]){const _0x1b069b=a177_0x1298,_0xd3fd88={...DEFAULT_OPTIONS,..._0x13e8a0},_0x5a4d14=[];for(const _0x13a4aa of _0x305c87){_0x5a4d14[_0x1b069b(0x81)]({'sortKey':_0x13a4aa['name'],'displayName':_0x13a4aa['name'],'icon':_0xd3fd88['showIcons']?'📁':'','metadata':undefined});}for(const _0x371af2 of _0x2e2eb6){const _0x48c529=_0xd3fd88[_0x1b069b(0x8c)]&&_0x371af2[_0x1b069b(0x6a)]!==undefined?a177_0x211d3a['dim']('\x20('+formatRows(_0x371af2[_0x1b069b(0x6a)])+')'):'',_0x1f09f2=_0xd3fd88[_0x1b069b(0x6c)]?hyperlink(_0x371af2[_0x1b069b(0x8d)],_0xd3fd88['getSegmentUrl'](_0x371af2['id'])):_0x371af2[_0x1b069b(0x8d)];_0x5a4d14[_0x1b069b(0x81)]({'sortKey':_0x371af2[_0x1b069b(0x8d)],'displayName':_0x1f09f2,'icon':_0xd3fd88[_0x1b069b(0x69)]?'🎯':'','metadata':_0x48c529});}for(const _0x4c3151 of _0x452675){const _0x31bc32=getJourneyStateIndicator(_0x4c3151[_0x1b069b(0x67)]),_0x3c770d=_0xd3fd88[_0x1b069b(0x8c)]?a177_0x211d3a[_0x1b069b(0x95)]('\x20'+_0x31bc32):'',_0x4c6c58=_0xd3fd88[_0x1b069b(0x78)]?hyperlink(_0x4c3151[_0x1b069b(0x98)],_0xd3fd88['getJourneyUrl'](_0x4c3151['id'])):_0x4c3151[_0x1b069b(0x98)];_0x5a4d14[_0x1b069b(0x81)]({'sortKey':_0x4c3151[_0x1b069b(0x98)],'displayName':_0x4c6c58,'icon':_0xd3fd88[_0x1b069b(0x69)]?'🗺️':'','metadata':_0x3c770d});}_0x5a4d14[_0x1b069b(0x92)]((_0x54d601,_0x52e026)=>_0x54d601[_0x1b069b(0x76)][_0x1b069b(0x6b)](_0x52e026[_0x1b069b(0x76)],undefined,{'sensitivity':_0x1b069b(0x80)}));if(_0x5a4d14[_0x1b069b(0x6f)]===0x0)return _0x1b069b(0x85);const _0x3c76d8=_0x5a4d14['map'](_0x54e7ae=>{const _0x2400fb=_0x1b069b,_0x20908a=_0x54e7ae[_0x2400fb(0x65)]?_0x54e7ae['icon']+'\x20':'',_0x1cd752=_0x54e7ae[_0x2400fb(0x8f)]||'';return''+_0x20908a+_0x54e7ae[_0x2400fb(0x82)]+_0x1cd752;});return _0x3c76d8[_0x1b069b(0x72)]('\x0a');}function getJourneyStateIndicator(_0xeed027){const _0x21b049=a177_0x1298;switch(_0xeed027){case _0x21b049(0x8e):return _0x21b049(0x96);case _0x21b049(0x68):return'(running)';case _0x21b049(0x7f):return _0x21b049(0x93);case'completed':return _0x21b049(0x70);default:return'('+_0xeed027+')';}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x18e660,_0x37a843){const _0x318df6=a178_0x5a68,_0x2d4f5d=_0x18e660();while(!![]){try{const _0x39bdd6=parseInt(_0x318df6(0xb8))/0x1+-parseInt(_0x318df6(0xb1))/0x2+-parseInt(_0x318df6(0xc0))/0x3*(parseInt(_0x318df6(0xc1))/0x4)+-parseInt(_0x318df6(0xaf))/0x5+-parseInt(_0x318df6(0xb0))/0x6*(parseInt(_0x318df6(0xac))/0x7)+-parseInt(_0x318df6(0xc6))/0x8*(parseInt(_0x318df6(0xae))/0x9)+parseInt(_0x318df6(0xc2))/0xa;if(_0x39bdd6===_0x37a843)break;else _0x2d4f5d['push'](_0x2d4f5d['shift']());}catch(_0x1e445b){_0x2d4f5d['push'](_0x2d4f5d['shift']());}}}(a178_0xe11a,0x2eac5));import{SDKError,ErrorCode}from'../errors.js';function a178_0xe11a(){const _0x5e0f37=['11180430ICzDRB','\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.','slice','(empty\x20response)','2792GJuHWh','equals','591010tkCQeT','length','4311nwJGMk','1187315MxYSGj','24eegoBo','427606zpRJxk','Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.','subarray','Downloaded\x20archive\x20is\x20too\x20small\x20(','WORKFLOW_ARCHIVE_CORRUPTED','filter','message','64329LOxYQA','Archive\x20validation\x20failed\x20with\x20unknown\x20error','error','Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.','The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.','...','toString','trim','42bWpjjG','10012nZOfAt'];a178_0xe11a=function(){return _0x5e0f37;};return a178_0xe11a();}function a178_0x5a68(_0x41994a,_0x2153c8){_0x41994a=_0x41994a-0xac;const _0xe11a7e=a178_0xe11a();let _0x5a688f=_0xe11a7e[_0x41994a];return _0x5a688f;}const GZIP_MAGIC=Buffer['from']([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x522f03){const _0x88881=a178_0x5a68;if(_0x522f03[_0x88881(0xad)]<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x522f03[_0x88881(0xad)],'error':{'message':_0x88881(0xb4)+_0x522f03[_0x88881(0xad)]+_0x88881(0xc3),'preview':getContentPreview(_0x522f03),'helpText':_0x88881(0xbb)}};if(!_0x522f03[_0x88881(0xb3)](0x0,0x2)[_0x88881(0xc7)](GZIP_MAGIC)){const _0x4ffa58=getContentPreview(_0x522f03),_0x5a9563=_0x4ffa58?'\x20Server\x20response\x20preview:\x20'+_0x4ffa58:'';return{'isValid':![],'size':_0x522f03['length'],'error':{'message':_0x88881(0xb2)+_0x5a9563,'preview':_0x4ffa58,'helpText':_0x88881(0xbc)}};}return{'isValid':!![],'size':_0x522f03[_0x88881(0xad)]};}function getContentPreview(_0x55ab51){const _0x4354ac=a178_0x5a68;if(_0x55ab51[_0x4354ac(0xad)]===0x0)return _0x4354ac(0xc5);const _0x515754=_0x55ab51['subarray'](0x0,0xc8)[_0x4354ac(0xbe)]('utf-8'),_0x4ff3ab=_0x515754['split']('')[_0x4354ac(0xb6)](_0x51b731=>{const _0x2c696b=_0x51b731['charCodeAt'](0x0);return _0x2c696b>=0x20&&_0x2c696b<0x7f||_0x2c696b===0xa||_0x2c696b===0xd||_0x2c696b===0x9;})[_0x4354ac(0xad)],_0x4f2b61=_0x4ff3ab/_0x515754[_0x4354ac(0xad)];if(_0x4f2b61>0.8){const _0x573818=_0x515754[_0x4354ac(0xc4)](0x0,0x64)['trim']();return _0x573818[_0x4354ac(0xad)]<_0x515754[_0x4354ac(0xbf)]()['length']?_0x573818+_0x4354ac(0xbd):_0x573818;}return undefined;}export function throwArchiveValidationError(_0xaf53fd){const _0x4d9502=a178_0x5a68;if(!_0xaf53fd[_0x4d9502(0xba)])throw new SDKError(ErrorCode[_0x4d9502(0xb5)],_0x4d9502(0xb9));throw new SDKError(ErrorCode[_0x4d9502(0xb5)],_0xaf53fd[_0x4d9502(0xba)][_0x4d9502(0xb7)],undefined,{'helpText':_0xaf53fd['error']['helpText']});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a179_0x4b36(){const _0x939390=['1368590IyqtSh','access','tar','revision','282pHFWMF','6172ctxETY','resolve','toISOString','1845vpaCJt','1916536WlCDRI','No\x20','create','134675CPhQvY','8604873xgyJJB','32952GWpYhA','filter','uploadProjectArchive','join','tdx.json','84920zGKsDG','21gSKOXY','sourceDir','endsWith','replace','readdir','Source\x20directory\x20not\x20found:\x20','sourceProjectName','14TSthpa','mkdtemp','archive.tar.gz','config','\x20workflow\x20files\x20found\x20in\x20','name','isDirectory','length','push','listProjects','workflow_project','find','data','5811eIHpYd','55cofskj'];a179_0x4b36=function(){return _0x939390;};return a179_0x4b36();}(function(_0x44555d,_0x204b16){const _0x1f405d=a179_0x4588,_0x541fb0=_0x44555d();while(!![]){try{const _0x15681b=-parseInt(_0x1f405d(0x117))/0x1*(parseInt(_0x1f405d(0x11f))/0x2)+-parseInt(_0x1f405d(0x10c))/0x3*(parseInt(_0x1f405d(0x109))/0x4)+parseInt(_0x1f405d(0x110))/0x5*(-parseInt(_0x1f405d(0x108))/0x6)+-parseInt(_0x1f405d(0x118))/0x7*(-parseInt(_0x1f405d(0x10d))/0x8)+parseInt(_0x1f405d(0x111))/0x9+-parseInt(_0x1f405d(0x104))/0xa*(-parseInt(_0x1f405d(0x12d))/0xb)+-parseInt(_0x1f405d(0x112))/0xc*(-parseInt(_0x1f405d(0x12c))/0xd);if(_0x15681b===_0x204b16)break;else _0x541fb0['push'](_0x541fb0['shift']());}catch(_0x4dc5f8){_0x541fb0['push'](_0x541fb0['shift']());}}}(a179_0x4b36,0xbdc09));import{promises as a179_0x6de023}from'fs';import a179_0x171584 from'path';import a179_0x65a69c from'os';function a179_0x4588(_0x5eab76,_0x280e80){_0x5eab76=_0x5eab76-0x104;const _0x4b361e=a179_0x4b36();let _0x4588e1=_0x4b361e[_0x5eab76];return _0x4588e1;}import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';export async function prepareCloneWorkflow(_0x321bc0,_0x49e5f0,_0x430f27,_0x171d3a={}){const _0x1dea0f=a179_0x4588,{client:_0x5bf48d}=_0x321bc0,_0x2227d0=a179_0x171584[_0x1dea0f(0x10a)](_0x49e5f0);try{await a179_0x6de023[_0x1dea0f(0x105)](_0x2227d0);}catch{throw new Error(_0x1dea0f(0x11d)+_0x49e5f0);}const _0x47344f=tryFindWorkflowTdxConfig(_0x2227d0),_0x5988d6=_0x47344f?.[_0x1dea0f(0x122)][_0x1dea0f(0x129)],_0x6c63b=_0x171d3a[_0x1dea0f(0x107)]||new Date()[_0x1dea0f(0x10b)]()[_0x1dea0f(0x11b)](/[:.]/g,'-');if(!_0x171d3a['skipValidation']){const _0x1be848=await a179_0x6de023['readdir'](_0x2227d0),_0x2cf217=_0x1be848[_0x1dea0f(0x113)](_0x3d1458=>_0x3d1458[_0x1dea0f(0x11a)](WORKFLOW_FILE_EXTENSION));if(_0x2cf217['length']===0x0)throw new Error(_0x1dea0f(0x10e)+WORKFLOW_FILE_EXTENSION+_0x1dea0f(0x123)+_0x2227d0);}const _0x333113=await getProjectFiles(_0x2227d0);let _0x143380=![],_0x2f4673;try{const _0x4a06ae=await _0x5bf48d[_0x1dea0f(0x128)]({'name_pattern':_0x430f27}),_0x4891fc=_0x4a06ae[_0x1dea0f(0x12b)][_0x1dea0f(0x12a)](_0x735b52=>_0x735b52[_0x1dea0f(0x124)]===_0x430f27);_0x4891fc&&(_0x143380=!![],_0x2f4673=_0x4891fc['id']);}catch{}return{'sourceDir':_0x2227d0,'sourceProjectName':_0x5988d6,'newProjectName':_0x430f27,'revision':_0x6c63b,'fileCount':_0x333113[_0x1dea0f(0x126)],'files':_0x333113,'targetExists':_0x143380,'existingProjectId':_0x2f4673};}export async function executeCloneWorkflow(_0x5c9989,_0x12c6f8){const _0x3eb9dc=a179_0x4588,_0x48ddb3=await import(_0x3eb9dc(0x106)),{client:_0x23b41a}=_0x5c9989,_0x30eb4d=await getProjectFiles(_0x12c6f8['sourceDir']),_0x260998=await a179_0x6de023[_0x3eb9dc(0x120)](a179_0x171584[_0x3eb9dc(0x115)](a179_0x65a69c['tmpdir'](),'tdx-wf-clone-')),_0x56fbc1=a179_0x171584[_0x3eb9dc(0x115)](_0x260998,_0x3eb9dc(0x121));try{await _0x48ddb3[_0x3eb9dc(0x10f)]({'file':_0x56fbc1,'gzip':!![],'cwd':_0x12c6f8[_0x3eb9dc(0x119)],'portable':!![]},_0x30eb4d);const _0x263f6e=await _0x23b41a[_0x3eb9dc(0x114)](_0x12c6f8['newProjectName'],_0x12c6f8[_0x3eb9dc(0x107)],_0x56fbc1);return{'sourceDir':_0x12c6f8[_0x3eb9dc(0x119)],'sourceProjectName':_0x12c6f8[_0x3eb9dc(0x11e)],'newProjectName':_0x263f6e[_0x3eb9dc(0x124)],'newProjectId':_0x263f6e['id'],'revision':_0x263f6e[_0x3eb9dc(0x107)],'fileCount':_0x30eb4d[_0x3eb9dc(0x126)],'files':_0x30eb4d};}finally{await a179_0x6de023['rm'](_0x260998,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x1e1a54,_0x34613c=''){const _0x4933cd=a179_0x4588,_0x3eb747=[],_0x14e752=await a179_0x6de023[_0x4933cd(0x11c)](_0x1e1a54,{'withFileTypes':!![]});for(const _0x508d9b of _0x14e752){const _0x2f9118=_0x34613c?a179_0x171584['join'](_0x34613c,_0x508d9b[_0x4933cd(0x124)]):_0x508d9b[_0x4933cd(0x124)];if(_0x508d9b[_0x4933cd(0x124)]===_0x4933cd(0x116))continue;if(!shouldIncludeInArchive(_0x508d9b[_0x4933cd(0x124)]))continue;if(_0x508d9b[_0x4933cd(0x125)]()){const _0x337c4c=await getProjectFiles(a179_0x171584['join'](_0x1e1a54,_0x508d9b['name']),_0x2f9118);_0x3eb747[_0x4933cd(0x127)](..._0x337c4c);}else _0x3eb747[_0x4933cd(0x127)](_0x2f9118);}return _0x3eb747;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a177_0x27fd31=a177_0x1312;(function(_0xdcbeb2,_0x188794){const _0x256006=a177_0x1312,_0x31e47f=_0xdcbeb2();while(!![]){try{const _0x4796a4=-parseInt(_0x256006(0xc0))/0x1*(-parseInt(_0x256006(0xe7))/0x2)+-parseInt(_0x256006(0xd3))/0x3*(parseInt(_0x256006(0xf2))/0x4)+parseInt(_0x256006(0xd4))/0x5*(-parseInt(_0x256006(0x87))/0x6)+parseInt(_0x256006(0x9d))/0x7+parseInt(_0x256006(0xd0))/0x8*(-parseInt(_0x256006(0xea))/0x9)+parseInt(_0x256006(0xd9))/0xa*(-parseInt(_0x256006(0xf1))/0xb)+parseInt(_0x256006(0x82))/0xc;if(_0x4796a4===_0x188794)break;else _0x31e47f['push'](_0x31e47f['shift']());}catch(_0x21b529){_0x31e47f['push'](_0x31e47f['shift']());}}}(a177_0x59c2,0xd9d15));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';function a177_0x1312(_0x271fc1,_0x26f27d){_0x271fc1=_0x271fc1-0x81;const _0x59c2c3=a177_0x59c2();let _0x131273=_0x59c2c3[_0x271fc1];return _0x131273;}import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x55ad34,_0xf02228,_0x3e9743=0x64){const _0x368aba=a177_0x1312,_0x4cf4d4=Math[_0x368aba(0xd2)](_0xf02228,MAX_PAGINATION_LIMIT),_0x4ab51f=[];let _0x1440d4;while(_0x4ab51f[_0x368aba(0x81)]<_0x4cf4d4){const _0x26f9fa=await _0x55ad34(_0x3e9743,_0x1440d4),_0x2e1c42=_0x26f9fa[_0x368aba(0xe2)]??_0x26f9fa[_0x368aba(0xd8)][_0x368aba(0x81)];if(_0x2e1c42===0x0)break;_0x4ab51f['push'](..._0x26f9fa[_0x368aba(0xd8)]);if(!_0x26f9fa[_0x368aba(0xa9)]||_0x2e1c42<_0x3e9743)break;_0x1440d4=_0x26f9fa['lastId'];}return _0x4ab51f[_0x368aba(0xed)](0x0,_0x4cf4d4);}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+$/;[a177_0x27fd31(0xe6)];constructor(_0x19d962){const _0x3d5720=a177_0x27fd31;this[_0x3d5720(0xe6)]=new WorkflowApiClient(_0x19d962);}async[a177_0x27fd31(0xb7)](_0x10d716){const _0x320569=a177_0x27fd31;if(WorkflowSDK[_0x320569(0xa1)]['test'](_0x10d716)){const _0x328318=await this[_0x320569(0xe6)]['getProject'](_0x10d716);return{'id':_0x328318['id'],'name':_0x328318[_0x320569(0xa7)]};}const _0x226cec=await this[_0x320569(0xe6)][_0x320569(0xaa)]({'name_pattern':_0x10d716}),_0x185306=_0x226cec[_0x320569(0xd8)][_0x320569(0xba)](_0x156792=>_0x156792[_0x320569(0xa7)]===_0x10d716);if(!_0x185306)throw new SDKError(ErrorCode[_0x320569(0xe8)],'Project\x20not\x20found:\x20'+_0x10d716);return{'id':_0x185306['id'],'name':_0x185306['name']};}async[a177_0x27fd31(0xe1)](_0x8aa9cf,_0x3493aa){const _0x2e44eb=a177_0x27fd31,_0x1d95f5=_0x3493aa?.[_0x2e44eb(0x9e)]||0x64,_0x350f17=await paginateResults((_0x41f87e,_0x14c15d)=>this['client']['listProjects']({'name_pattern':_0x8aa9cf,'limit':_0x41f87e,'last_id':_0x14c15d??_0x3493aa?.['last_id']}),_0x1d95f5);return _0x350f17['map'](_0x4aa7ff=>({..._0x4aa7ff,'project_id':_0x4aa7ff['id'],'project_name':_0x4aa7ff[_0x2e44eb(0xa7)]}));}async['workflows'](_0x5a99a0,_0x4a3c65){const _0x5e1e66=a177_0x27fd31,_0x19802b=_0x4a3c65?.['limit']||0x64,_0x59d5bc=await paginateResults((_0x2906c0,_0xbcb0b1)=>this[_0x5e1e66(0xe6)][_0x5e1e66(0xaf)]({'project_name':_0x5a99a0,'limit':_0x2906c0,'last_id':_0xbcb0b1??_0x4a3c65?.[_0x5e1e66(0xa6)]}),_0x19802b);return _0x59d5bc[_0x5e1e66(0xcc)](_0x2822b5=>({'project_id':_0x2822b5['project']?.['id'],'project_name':_0x2822b5[_0x5e1e66(0xe0)]?.[_0x5e1e66(0xa7)],'workflow_id':_0x2822b5['id'],'workflow_name':_0x2822b5['name'],'revision':_0x2822b5[_0x5e1e66(0x8e)],'timezone':_0x2822b5['timezone'],'config':_0x2822b5['config'],'id':_0x2822b5['id'],'name':_0x2822b5[_0x5e1e66(0xa7)],'project':_0x2822b5[_0x5e1e66(0xe0)]}));}async[a177_0x27fd31(0xc6)](_0x5b8333){const _0x51be5b=a177_0x27fd31;let _0x5b5276;if(_0x5b8333?.[_0x51be5b(0xb8)]){let _0x545b39,_0x4c2f68=![];while(!_0x4c2f68){const _0x4ef6fc=await this[_0x51be5b(0xe6)][_0x51be5b(0xaa)]({'limit':0x64,'last_id':_0x545b39}),_0x45a225=_0x4ef6fc[_0x51be5b(0xd8)][_0x51be5b(0xba)](_0x2b896a=>_0x2b896a[_0x51be5b(0xa7)]===_0x5b8333[_0x51be5b(0xb8)]);if(_0x45a225){_0x5b5276=_0x45a225['id'],_0x4c2f68=!![];break;}if(!_0x4ef6fc[_0x51be5b(0xa9)]||_0x4ef6fc[_0x51be5b(0xd8)]['length']===0x0)break;_0x545b39=_0x4ef6fc['lastId'];}if(!_0x5b5276)throw new SDKError(ErrorCode[_0x51be5b(0xe8)],'Project\x20not\x20found:\x20'+_0x5b8333[_0x51be5b(0xb8)]);}const _0x17981e=_0x5b8333?.[_0x51be5b(0x9e)]||0x64,_0x15d3cb=await paginateResults((_0x224b25,_0x46f62a)=>this[_0x51be5b(0xe6)][_0x51be5b(0xc5)]({'project_id':_0x5b5276,'project_name':_0x5b8333?.['projectName'],'workflow_name':_0x5b8333?.['workflowName'],'status':_0x5b8333?.[_0x51be5b(0xca)],'from_time':_0x5b8333?.[_0x51be5b(0xb0)],'to_time':_0x5b8333?.[_0x51be5b(0xfc)],'limit':_0x224b25,'last_id':_0x46f62a??_0x5b8333?.['last_id']}),_0x17981e);return _0x15d3cb[_0x51be5b(0xcc)](_0x49529d=>({'project_id':_0x49529d[_0x51be5b(0xe0)]?.['id'],'project_name':_0x49529d[_0x51be5b(0xe0)]?.['name'],'workflow_id':_0x49529d[_0x51be5b(0xf6)]?.['id'],'workflow_name':_0x49529d[_0x51be5b(0xf6)]?.[_0x51be5b(0xa7)],'session_id':_0x49529d['id'],'sessionUuid':_0x49529d[_0x51be5b(0xee)],'sessionTime':_0x49529d[_0x51be5b(0xae)],'lastAttempt':_0x49529d[_0x51be5b(0x88)],'id':_0x49529d['id'],'project':_0x49529d[_0x51be5b(0xe0)],'workflow':_0x49529d['workflow']}));}async[a177_0x27fd31(0xf0)](_0x43087a){const _0x6fba55=a177_0x27fd31,_0x683929=_0x43087a?.[_0x6fba55(0x9e)]||0x64,_0x190988=await paginateResults((_0x1b2a96,_0x52d66a)=>this['client'][_0x6fba55(0x91)]({'project_name':_0x43087a?.['projectName'],'workflow_name':_0x43087a?.[_0x6fba55(0xab)],'include_retried':_0x43087a?.[_0x6fba55(0xb4)],'limit':_0x1b2a96,'last_id':_0x52d66a??_0x43087a?.[_0x6fba55(0xa6)]}),_0x683929);return _0x190988[_0x6fba55(0xcc)](_0x7b2e03=>({'project_id':_0x7b2e03[_0x6fba55(0xe0)]?.['id'],'project_name':_0x7b2e03[_0x6fba55(0xe0)]?.['name'],'workflow_id':_0x7b2e03['workflow']?.['id'],'workflow_name':_0x7b2e03[_0x6fba55(0xf6)]?.[_0x6fba55(0xa7)],'session_id':_0x7b2e03['sessionId'],'sessionUuid':_0x7b2e03[_0x6fba55(0xee)],'sessionTime':_0x7b2e03[_0x6fba55(0xae)],'attempt_id':_0x7b2e03['id'],'attempt_index':_0x7b2e03[_0x6fba55(0x92)],'retryAttemptName':_0x7b2e03['retryAttemptName'],'done':_0x7b2e03['done'],'success':_0x7b2e03[_0x6fba55(0xd5)],'cancelRequested':_0x7b2e03[_0x6fba55(0xce)],'params':_0x7b2e03[_0x6fba55(0x90)],'createdAt':_0x7b2e03[_0x6fba55(0xf9)],'finishedAt':_0x7b2e03[_0x6fba55(0xbb)],'id':_0x7b2e03['id'],'index':_0x7b2e03[_0x6fba55(0x92)],'project':_0x7b2e03[_0x6fba55(0xe0)],'workflow':_0x7b2e03[_0x6fba55(0xf6)]}));}async['attempt'](_0x150eeb){const _0x1be346=a177_0x27fd31,_0x27a7e2=await this[_0x1be346(0xe6)][_0x1be346(0xac)](_0x150eeb);return _0x27a7e2;}async['tasks'](_0x1bce66,_0x5a818b=![]){const _0x5b8597=a177_0x27fd31,_0x404910=await this[_0x5b8597(0xe6)][_0x5b8597(0xa2)](_0x1bce66,_0x5a818b);return _0x404910[_0x5b8597(0xcc)](_0x5083f7=>({'task_id':_0x5083f7['id'],'task_name':_0x5083f7['fullName'],'parentId':_0x5083f7[_0x5b8597(0x86)],'config':_0x5083f7[_0x5b8597(0xfb)],'upstreams':_0x5083f7[_0x5b8597(0xc1)],'state':_0x5083f7[_0x5b8597(0xbd)],'exportParams':_0x5083f7['exportParams'],'storeParams':_0x5083f7[_0x5b8597(0xcd)],'stateParams':_0x5083f7['stateParams'],'updatedAt':_0x5083f7['updatedAt'],'retryAt':_0x5083f7[_0x5b8597(0xf4)],'startedAt':_0x5083f7[_0x5b8597(0xb3)],'error':_0x5083f7[_0x5b8597(0xd6)],'isGroup':_0x5083f7[_0x5b8597(0x9a)],'id':_0x5083f7['id'],'fullName':_0x5083f7['fullName']}));}async[a177_0x27fd31(0x9b)](_0x24feb0,_0x214e16){const _0x58ba86=a177_0x27fd31;return await this[_0x58ba86(0xe6)][_0x58ba86(0xc8)](_0x24feb0,_0x214e16);}async['logs'](_0x3addf1,_0x3ac218){const _0x32d0ff=a177_0x27fd31,_0x1a8ecb=await import(_0x32d0ff(0xdd)),{promisify:_0x23a5e8}=await import('util'),_0x434983=_0x23a5e8(_0x1a8ecb['gunzip']),_0x22b21e=await this['client'][_0x32d0ff(0xc8)](_0x3addf1,_0x3ac218);if(_0x22b21e[_0x32d0ff(0x81)]===0x0)return'';const _0x13684b=[];for(const _0xbd43b9 of _0x22b21e){if(!_0xbd43b9[_0x32d0ff(0x98)])continue;const _0x14a45d=await fetch(_0xbd43b9[_0x32d0ff(0x98)]);if(!_0x14a45d['ok'])throw new Error(_0x32d0ff(0xb6)+_0x14a45d['status']);const _0x2d9170=Buffer[_0x32d0ff(0x89)](await _0x14a45d[_0x32d0ff(0x83)]()),_0x4267db=await _0x434983(_0x2d9170);_0x13684b['push'](_0x4267db[_0x32d0ff(0x97)]('utf-8'));}return _0x13684b[_0x32d0ff(0x96)]('\x0a');}async['kill'](_0x42c032,_0x29636c){const _0x56a6b9=a177_0x27fd31,_0x43a6bd=await this[_0x56a6b9(0xe6)][_0x56a6b9(0xec)](_0x42c032,_0x29636c);return _0x43a6bd?.[_0x56a6b9(0xde)]??_0x56a6b9(0xf3);}async[a177_0x27fd31(0xbe)](_0x2778ba,_0x5e3d51){const _0x45a71c=a177_0x27fd31,_0x46e007=await this[_0x45a71c(0xe6)][_0x45a71c(0xbe)](_0x2778ba,{'from_task':_0x5e3d51?.[_0x45a71c(0xc9)],'retry_params':_0x5e3d51?.[_0x45a71c(0xdb)]});return{'attemptId':_0x46e007['id'],'sessionId':_0x46e007['sessionId']};}async['retryAttempt'](_0x2121b8,_0x4a01e0){const _0x967c26=a177_0x27fd31,_0x5ad4dc=await this[_0x967c26(0xe6)][_0x967c26(0xcf)](_0x2121b8,{'resume_from':_0x4a01e0?.[_0x967c26(0xc3)],'retry_params':_0x4a01e0?.['retryParams'],'force':_0x4a01e0?.['force']});return{'attemptId':_0x5ad4dc['id'],'sessionId':_0x5ad4dc[_0x967c26(0x8b)]};}async['run'](_0x233cfa,_0x56f226={},_0xc9a235){const _0x72f0=a177_0x27fd31,_0x49cf5b=_0x233cfa['indexOf']('.');let _0x19740d,_0x16f075;if(_0x49cf5b===-0x1)throw new Error(_0x72f0(0xb2));_0x19740d=_0x233cfa[_0x72f0(0x95)](0x0,_0x49cf5b),_0x16f075=_0x233cfa['substring'](_0x49cf5b+0x1);if(!_0x19740d||!_0x16f075)throw new Error(_0x72f0(0xc2)+_0x233cfa+_0x72f0(0xa4));const _0x286256=_0xc9a235?.[_0x72f0(0xae)]||new Date()[_0x72f0(0xa3)]();return await this['client']['startAttempt']({'projectName':_0x19740d,'workflowName':_0x16f075,'sessionTime':_0x286256,'params':_0x56f226});}async[a177_0x27fd31(0x8a)](_0x2e1eb6,_0x5a7a76,_0x530689){const _0x226f07=a177_0x27fd31,{promises:_0x17303f}=await import('fs'),_0x4606cb=await import(_0x226f07(0xf8)),_0x4c221a=await import('os'),_0x2a67f9=await import(_0x226f07(0xbc)),{id:_0x598117,name:_0x47e581}=await this['resolveProjectId'](_0x2e1eb6),_0x237f3b=_0x4c221a[_0x226f07(0xb9)](),_0x1655a2=_0x4606cb[_0x226f07(0x96)](_0x237f3b,_0x226f07(0xe5)+_0x598117+'-'+Date[_0x226f07(0xdc)]()+_0x226f07(0x8c));try{await this[_0x226f07(0xe6)][_0x226f07(0xe3)](_0x598117,_0x1655a2,_0x530689?.[_0x226f07(0x8e)]);const _0x4d41d0=_0x4606cb['join'](_0x5a7a76,_0x47e581);await _0x17303f[_0x226f07(0xef)](_0x4d41d0,{'recursive':!![]}),await _0x2a67f9[_0x226f07(0xb5)]({'file':_0x1655a2,'cwd':_0x4d41d0,'gzip':!![]});const _0x33f16f=async _0x5dcb9f=>{const _0x2149d4=_0x226f07;let _0x1dcd26=0x0;const _0x4a6915=await _0x17303f[_0x2149d4(0xfa)](_0x5dcb9f,{'withFileTypes':!![]});for(const _0x24b70e of _0x4a6915){const _0x335f7e=_0x4606cb[_0x2149d4(0x96)](_0x5dcb9f,_0x24b70e[_0x2149d4(0xa7)]);if(_0x24b70e[_0x2149d4(0xbf)]())_0x1dcd26++;else _0x24b70e['isDirectory']()&&(_0x1dcd26+=await _0x33f16f(_0x335f7e));}return _0x1dcd26;},_0x288b32=await _0x33f16f(_0x4d41d0);return{'projectName':_0x47e581,'revision':_0x530689?.['revision']||'latest','filesExtracted':_0x288b32};}finally{try{await _0x17303f['unlink'](_0x1655a2);}catch{}}}async['push'](_0x52f9f7,_0xc52b76){const _0x59eb3e=a177_0x27fd31,{promises:_0x5d9811}=await import('fs'),_0x4cfd24=await import(_0x59eb3e(0xf8)),_0x3f1142=await import(_0x59eb3e(0xbc)),_0x2379e8=_0xc52b76?.[_0x59eb3e(0xb8)]||_0x4cfd24['basename'](_0x52f9f7),_0x56b9b5=_0xc52b76?.[_0x59eb3e(0x8e)]||new Date()[_0x59eb3e(0xa3)]()[_0x59eb3e(0xa0)](/[:.]/g,'-');try{await _0x5d9811[_0x59eb3e(0x9f)](_0x52f9f7);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0x52f9f7);}if(!_0xc52b76?.[_0x59eb3e(0xdf)]){const _0x58a225=await _0x5d9811['readdir'](_0x52f9f7),_0x12e3a0=_0x58a225[_0x59eb3e(0x8d)](_0xc3c0a1=>_0xc3c0a1[_0x59eb3e(0x9c)](WORKFLOW_FILE_EXTENSION));if(_0x12e3a0[_0x59eb3e(0x81)]===0x0)throw new Error(_0x59eb3e(0xf5)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20project\x20directory');for(const _0xfcb720 of _0x12e3a0){const _0x285668=_0x4cfd24['join'](_0x52f9f7,_0xfcb720);try{await _0x5d9811[_0x59eb3e(0x9f)](_0x285668);}catch{throw new Error(_0x59eb3e(0x93)+_0xfcb720);}}}const _0x4209d0=async(_0x534e10,_0x4c8f26='')=>{const _0x3a17c1=_0x59eb3e,_0x4313fe=await _0x5d9811[_0x3a17c1(0xfa)](_0x534e10,{'withFileTypes':!![]}),_0x27fb13=[];for(const _0x2786e5 of _0x4313fe){const _0x31b30e=_0x4cfd24['join'](_0x4c8f26,_0x2786e5['name']),_0x351bdb=_0x4cfd24['join'](_0x534e10,_0x2786e5['name']);if(!shouldIncludeInArchive(_0x2786e5[_0x3a17c1(0xa7)]))continue;_0x2786e5[_0x3a17c1(0xb1)]()?_0x27fb13[_0x3a17c1(0xa5)](...await _0x4209d0(_0x351bdb,_0x31b30e)):_0x27fb13[_0x3a17c1(0xa5)](_0x31b30e);}return _0x27fb13;},_0x26e15b=await _0x4209d0(_0x52f9f7),_0x45ecd0=await import('os'),_0x1177fd=_0x45ecd0[_0x59eb3e(0xb9)](),_0x12c58d=_0x4cfd24[_0x59eb3e(0x96)](_0x1177fd,_0x59eb3e(0xda)+Date[_0x59eb3e(0xdc)]()+_0x59eb3e(0x8c));try{await _0x3f1142[_0x59eb3e(0xc4)]({'file':_0x12c58d,'gzip':!![],'cwd':_0x52f9f7,'portable':!![]},_0x26e15b);const _0x196263=await this[_0x59eb3e(0xe6)]['uploadProjectArchive'](_0x2379e8,_0x56b9b5,_0x12c58d,{'scheduleFrom':_0xc52b76?.[_0x59eb3e(0xeb)],'clearSchedule':_0xc52b76?.[_0x59eb3e(0xc7)],'clearScheduleAll':_0xc52b76?.[_0x59eb3e(0xd1)]});return{'projectId':_0x196263['id'],'projectName':_0x196263[_0x59eb3e(0xa7)],'revision':_0x196263[_0x59eb3e(0x8e)]};}finally{try{await _0x5d9811[_0x59eb3e(0xe9)](_0x12c58d);}catch{}}}async['delete'](_0x3bf3b3){const _0x2e30cb=a177_0x27fd31,{id:_0x4cab85}=await this[_0x2e30cb(0xb7)](_0x3bf3b3),_0x347b0a=await this['client'][_0x2e30cb(0xe4)](_0x4cab85);return{'projectId':_0x347b0a['id'],'projectName':_0x347b0a['name']};}async[a177_0x27fd31(0xad)](_0x4e4e7d){const _0x4af8cb=a177_0x27fd31,{id:_0x491328,name:_0x21568b}=await this[_0x4af8cb(0xb7)](_0x4e4e7d),_0x4f19b0=await this['client'][_0x4af8cb(0xad)](_0x491328);return{'projectName':_0x21568b,'secrets':_0x4f19b0};}async[a177_0x27fd31(0x94)](_0x2805c9,_0x1e53b3,_0x5d088b){const _0x5ada4d=a177_0x27fd31,{id:_0x464224,name:_0x571f65}=await this[_0x5ada4d(0xb7)](_0x2805c9);return await this[_0x5ada4d(0xe6)][_0x5ada4d(0x94)](_0x464224,_0x1e53b3,_0x5d088b),{'projectName':_0x571f65,'key':_0x1e53b3};}async[a177_0x27fd31(0xcb)](_0x17ea34,_0x4055dc){const _0x1ab63e=a177_0x27fd31,{id:_0x27e152,name:_0x3bf588}=await this['resolveProjectId'](_0x17ea34),_0x164b91=Object['keys'](_0x4055dc),_0x4c2f29=await Promise['allSettled'](_0x164b91['map'](_0x2d818d=>this[_0x1ab63e(0xe6)][_0x1ab63e(0x94)](_0x27e152,_0x2d818d,_0x4055dc[_0x2d818d]))),_0x5640d2=_0x4c2f29['map']((_0x128f43,_0x50389f)=>_0x128f43['status']===_0x1ab63e(0xa8)?_0x164b91[_0x50389f]:null)[_0x1ab63e(0x8d)](_0x431fe1=>_0x431fe1!==null);if(_0x5640d2[_0x1ab63e(0x81)]>0x0)throw new SDKError(ErrorCode['WORKFLOW_SECRET_SET_FAILED'],_0x1ab63e(0x84)+(_0x5640d2['length']>0x1?'s':'')+':\x20'+_0x5640d2[_0x1ab63e(0x96)](',\x20'));return{'projectName':_0x3bf588,'keys':_0x164b91};}async['deleteSecret'](_0x4ada1e,_0xe8677b){const _0x2b1730=a177_0x27fd31,{id:_0x38e0e1,name:_0x604bad}=await this[_0x2b1730(0xb7)](_0x4ada1e);return await this['client'][_0x2b1730(0x99)](_0x38e0e1,_0xe8677b),{'projectName':_0x604bad,'key':_0xe8677b};}async['pullProject'](_0x52c0b2,_0x223a4e){const _0x3c7024=a177_0x27fd31;return pullWorkflow({'client':this[_0x3c7024(0xe6)],'resolveProjectId':this[_0x3c7024(0xb7)][_0x3c7024(0xd7)](this)},_0x52c0b2,_0x223a4e);}async['applyPullProject'](_0x45a5a6,_0x2c5f38){const _0xe56810=a177_0x27fd31;return applyPullResult({'client':this[_0xe56810(0xe6)],'resolveProjectId':this[_0xe56810(0xb7)][_0xe56810(0xd7)](this)},_0x45a5a6,_0x2c5f38);}async[a177_0x27fd31(0x85)](_0xfb8e5d){const _0x59274b=a177_0x27fd31;return preparePushWorkflow({'client':this[_0x59274b(0xe6)],'resolveProjectId':this[_0x59274b(0xb7)][_0x59274b(0xd7)](this)},_0xfb8e5d);}async[a177_0x27fd31(0xf7)](_0x1413f5){const _0x4d9ace=a177_0x27fd31;return executePushWorkflow({'client':this[_0x4d9ace(0xe6)],'resolveProjectId':this[_0x4d9ace(0xb7)]['bind'](this)},_0x1413f5);}async[a177_0x27fd31(0x8f)](_0x13bc14,_0x5ee422,_0x2bf130){return prepareCloneWorkflow({'client':this['client']},_0x13bc14,_0x5ee422,_0x2bf130);}async['executeCloneProject'](_0xe7a9d0){const _0x32c588=a177_0x27fd31;return executeCloneWorkflow({'client':this[_0x32c588(0xe6)]},_0xe7a9d0);}}function a177_0x59c2(){const _0x5073d4=['toString','direct','deleteSecret','isGroup','logFiles','endsWith','2583728uWvTkc','limit','access','replace','NUMERIC_ID_PATTERN','getAttemptTasks','toISOString','.\x20Expected\x20\x22project.workflow\x22','push','last_id','name','rejected','lastId','listProjects','workflowName','getAttempt','listSecrets','sessionTime','listWorkflows','fromTime','isDirectory','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','startedAt','includeRetried','extract','Failed\x20to\x20download\x20log\x20file:\x20','resolveProjectId','projectName','tmpdir','find','finishedAt','tar','state','retrySession','isFile','3QmjnRQ','upstreams','Invalid\x20workflow\x20format:\x20','resumeFrom','create','listSessions','sessions','clearSchedule','listLogFiles','fromTask','status','setSecrets','map','storeParams','cancelRequested','retryAttempt','24fupnnx','clearScheduleAll','min','240ioEDeC','9655fRhxaL','success','error','bind','data','730uLuVZa','tdx-workflow-push-','retryParams','now','zlib','message','skipValidation','project','projects','rawCount','downloadProjectArchive','deleteProject','tdx-workflow-','client','154778cZzMmI','WORKFLOW_PROJECT_NOT_FOUND','unlink','1414143gNjtAD','scheduleFrom','killAttempt','slice','sessionUuid','mkdir','attempts','20977OgSiZP','79792HSWszL','Kill\x20request\x20accepted','retryAt','No\x20','workflow','executePushProject','path','createdAt','readdir','config','toTime','length','41808996hjyDja','arrayBuffer','Failed\x20to\x20set\x20secret','preparePushProject','parentId','3066yHymKO','lastAttempt','from','download','sessionId','.tar.gz','filter','revision','prepareCloneProject','params','listAttempts','index','Cannot\x20read\x20workflow\x20file:\x20','setSecret','substring','join'];a177_0x59c2=function(){return _0x5073d4;};return a177_0x59c2();}
|
|
1
|
+
function a180_0x1720(){const _0xd58dca=['basename','cancelRequested','map','toISOString','workflowName','force','getProject','clearSchedule','tasks','parentId','Kill\x20request\x20accepted','killAttempt','WORKFLOW_SECRET_SET_FAILED','message','pullProject','sessions','min','mkdir','tar','451263oCEWRw','error','fromTime','rawCount','Cannot\x20read\x20workflow\x20file:\x20','deleteProject','prepareCloneProject','revision','direct','data','workflow','851871foRtpH','filter','1064kmgeTv','bind','Invalid\x20workflow\x20format:\x20','sessionId','delete','fullName','4771584yxQEej','26577iKtNhl','clearScheduleAll','Project\x20not\x20found:\x20','listProjects','path','index','arrayBuffer','create','NUMERIC_ID_PATTERN','slice','Failed\x20to\x20set\x20secret','endsWith','keys','2922078GxalKd','retryAttempt','test','fromTask','last_id','access','.\x20Expected\x20\x22project.workflow\x22','264CJPZGz','length','retrySession','attempt','kill','setSecrets','14rNDKqW','83721dDJgli','retryAttemptName','push','getAttemptTasks','getAttempt','unlink','81980XaGgGR','listSecrets','retryParams','executeCloneProject','listWorkflows','download','name','retryAt','8SsOTkp','limit','listAttempts','substring','stateParams','readdir','now','logFiles','projects','done','Failed\x20to\x20download\x20log\x20file:\x20','join','projectName','toTime','isDirectory','downloadProjectArchive','sessionUuid','setSecret','scheduleFrom','lastId','.tar.gz','params','client','tdx-workflow-','deleteSecret','tmpdir','timezone','startAttempt','run','tdx-workflow-push-','project','executePushProject','WORKFLOW_PROJECT_NOT_FOUND','\x20workflow\x20files\x20found\x20in\x20project\x20directory','resolveProjectId','extract','uploadProjectArchive','rejected','sessionTime','resumeFrom','workflows','status','updatedAt','listLogFiles','1130lpTAYI','logs'];a180_0x1720=function(){return _0xd58dca;};return a180_0x1720();}const a180_0x1649a9=a180_0x58fd;(function(_0x183b93,_0x2080b7){const _0x2bbb3f=a180_0x58fd,_0x2d3e68=_0x183b93();while(!![]){try{const _0x95d0b3=parseInt(_0x2bbb3f(0x1e5))/0x1+parseInt(_0x2bbb3f(0x222))/0x2*(parseInt(_0x2bbb3f(0x1f0))/0x3)+parseInt(_0x2bbb3f(0x20d))/0x4*(-parseInt(_0x2bbb3f(0x21a))/0x5)+-parseInt(_0x2bbb3f(0x206))/0x6*(-parseInt(_0x2bbb3f(0x213))/0x7)+parseInt(_0x2bbb3f(0x1f2))/0x8*(parseInt(_0x2bbb3f(0x1f9))/0x9)+-parseInt(_0x2bbb3f(0x1d0))/0xa*(parseInt(_0x2bbb3f(0x214))/0xb)+-parseInt(_0x2bbb3f(0x1f8))/0xc;if(_0x95d0b3===_0x2080b7)break;else _0x2d3e68['push'](_0x2d3e68['shift']());}catch(_0x237395){_0x2d3e68['push'](_0x2d3e68['shift']());}}}(a180_0x1720,0x95ea7));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';function a180_0x58fd(_0x590556,_0x3d4176){_0x590556=_0x590556-0x1c1;const _0x17201a=a180_0x1720();let _0x58fdf0=_0x17201a[_0x590556];return _0x58fdf0;}import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x1cb7fc,_0x5672ed,_0x158147=0x64){const _0x235c10=a180_0x58fd,_0x1f6629=Math[_0x235c10(0x1e2)](_0x5672ed,MAX_PAGINATION_LIMIT),_0x34eeab=[];let _0x1bd2a1;while(_0x34eeab[_0x235c10(0x20e)]<_0x1f6629){const _0x5619a9=await _0x1cb7fc(_0x158147,_0x1bd2a1),_0xbf0599=_0x5619a9[_0x235c10(0x1e8)]??_0x5619a9['data'][_0x235c10(0x20e)];if(_0xbf0599===0x0)break;_0x34eeab[_0x235c10(0x216)](..._0x5619a9['data']);if(!_0x5619a9[_0x235c10(0x235)]||_0xbf0599<_0x158147)break;_0x1bd2a1=_0x5619a9[_0x235c10(0x235)];}return _0x34eeab[_0x235c10(0x202)](0x0,_0x1f6629);}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 [a180_0x1649a9(0x201)]=/^\d+$/;[a180_0x1649a9(0x238)];constructor(_0x480d61){const _0x4ba7a1=a180_0x1649a9;this[_0x4ba7a1(0x238)]=new WorkflowApiClient(_0x480d61);}async[a180_0x1649a9(0x1c6)](_0x2943d3){const _0x1d2dcc=a180_0x1649a9;if(WorkflowSDK['NUMERIC_ID_PATTERN'][_0x1d2dcc(0x208)](_0x2943d3)){const _0x1c5e92=await this[_0x1d2dcc(0x238)][_0x1d2dcc(0x1d8)](_0x2943d3);return{'id':_0x1c5e92['id'],'name':_0x1c5e92['name']};}const _0x509eae=await this[_0x1d2dcc(0x238)][_0x1d2dcc(0x1fc)]({'name_pattern':_0x2943d3}),_0x5f1e8e=_0x509eae[_0x1d2dcc(0x1ee)]['find'](_0x328bf5=>_0x328bf5[_0x1d2dcc(0x220)]===_0x2943d3);if(!_0x5f1e8e)throw new SDKError(ErrorCode[_0x1d2dcc(0x1c4)],'Project\x20not\x20found:\x20'+_0x2943d3);return{'id':_0x5f1e8e['id'],'name':_0x5f1e8e[_0x1d2dcc(0x220)]};}async[a180_0x1649a9(0x22a)](_0x57d934,_0x244b2e){const _0x56a55d=a180_0x1649a9,_0x3aae90=_0x244b2e?.[_0x56a55d(0x223)]||0x64,_0x52cf02=await paginateResults((_0x2591a3,_0x263c1e)=>this['client'][_0x56a55d(0x1fc)]({'name_pattern':_0x57d934,'limit':_0x2591a3,'last_id':_0x263c1e??_0x244b2e?.[_0x56a55d(0x20a)]}),_0x3aae90);return _0x52cf02[_0x56a55d(0x1d4)](_0xc3ed16=>({..._0xc3ed16,'project_id':_0xc3ed16['id'],'project_name':_0xc3ed16[_0x56a55d(0x220)]}));}async[a180_0x1649a9(0x1cc)](_0x211365,_0x50f931){const _0x203423=a180_0x1649a9,_0x20ed24=_0x50f931?.[_0x203423(0x223)]||0x64,_0xd723db=await paginateResults((_0x24dd75,_0x4d0982)=>this[_0x203423(0x238)][_0x203423(0x21e)]({'project_name':_0x211365,'limit':_0x24dd75,'last_id':_0x4d0982??_0x50f931?.['last_id']}),_0x20ed24);return _0xd723db[_0x203423(0x1d4)](_0x1d2efa=>({'project_id':_0x1d2efa[_0x203423(0x1c2)]?.['id'],'project_name':_0x1d2efa[_0x203423(0x1c2)]?.[_0x203423(0x220)],'workflow_id':_0x1d2efa['id'],'workflow_name':_0x1d2efa['name'],'revision':_0x1d2efa[_0x203423(0x1ec)],'timezone':_0x1d2efa[_0x203423(0x23c)],'config':_0x1d2efa['config'],'id':_0x1d2efa['id'],'name':_0x1d2efa[_0x203423(0x220)],'project':_0x1d2efa[_0x203423(0x1c2)]}));}async[a180_0x1649a9(0x1e1)](_0x40d7a2){const _0x4a753b=a180_0x1649a9;let _0x3f270e;if(_0x40d7a2?.['projectName']){let _0x3197f0,_0x4bbbff=![];while(!_0x4bbbff){const _0x17f8a6=await this[_0x4a753b(0x238)][_0x4a753b(0x1fc)]({'limit':0x64,'last_id':_0x3197f0}),_0x5df668=_0x17f8a6[_0x4a753b(0x1ee)]['find'](_0x556fa9=>_0x556fa9['name']===_0x40d7a2[_0x4a753b(0x22e)]);if(_0x5df668){_0x3f270e=_0x5df668['id'],_0x4bbbff=!![];break;}if(!_0x17f8a6[_0x4a753b(0x235)]||_0x17f8a6[_0x4a753b(0x1ee)][_0x4a753b(0x20e)]===0x0)break;_0x3197f0=_0x17f8a6[_0x4a753b(0x235)];}if(!_0x3f270e)throw new SDKError(ErrorCode[_0x4a753b(0x1c4)],_0x4a753b(0x1fb)+_0x40d7a2[_0x4a753b(0x22e)]);}const _0x420e57=_0x40d7a2?.['limit']||0x64,_0x4b2823=await paginateResults((_0x192450,_0x3d7f0f)=>this[_0x4a753b(0x238)]['listSessions']({'project_id':_0x3f270e,'project_name':_0x40d7a2?.[_0x4a753b(0x22e)],'workflow_name':_0x40d7a2?.[_0x4a753b(0x1d6)],'status':_0x40d7a2?.[_0x4a753b(0x1cd)],'from_time':_0x40d7a2?.[_0x4a753b(0x1e7)],'to_time':_0x40d7a2?.[_0x4a753b(0x22f)],'limit':_0x192450,'last_id':_0x3d7f0f??_0x40d7a2?.['last_id']}),_0x420e57);return _0x4b2823[_0x4a753b(0x1d4)](_0x47b473=>({'project_id':_0x47b473['project']?.['id'],'project_name':_0x47b473['project']?.[_0x4a753b(0x220)],'workflow_id':_0x47b473[_0x4a753b(0x1ef)]?.['id'],'workflow_name':_0x47b473[_0x4a753b(0x1ef)]?.[_0x4a753b(0x220)],'session_id':_0x47b473['id'],'sessionUuid':_0x47b473[_0x4a753b(0x232)],'sessionTime':_0x47b473[_0x4a753b(0x1ca)],'lastAttempt':_0x47b473['lastAttempt'],'id':_0x47b473['id'],'project':_0x47b473['project'],'workflow':_0x47b473[_0x4a753b(0x1ef)]}));}async['attempts'](_0x6f5630){const _0x2368be=a180_0x1649a9,_0x375c06=_0x6f5630?.[_0x2368be(0x223)]||0x64,_0x3fcfcf=await paginateResults((_0x3b6423,_0x29a822)=>this['client'][_0x2368be(0x224)]({'project_name':_0x6f5630?.[_0x2368be(0x22e)],'workflow_name':_0x6f5630?.[_0x2368be(0x1d6)],'include_retried':_0x6f5630?.['includeRetried'],'limit':_0x3b6423,'last_id':_0x29a822??_0x6f5630?.[_0x2368be(0x20a)]}),_0x375c06);return _0x3fcfcf[_0x2368be(0x1d4)](_0x34905c=>({'project_id':_0x34905c[_0x2368be(0x1c2)]?.['id'],'project_name':_0x34905c['project']?.[_0x2368be(0x220)],'workflow_id':_0x34905c[_0x2368be(0x1ef)]?.['id'],'workflow_name':_0x34905c[_0x2368be(0x1ef)]?.['name'],'session_id':_0x34905c[_0x2368be(0x1f5)],'sessionUuid':_0x34905c[_0x2368be(0x232)],'sessionTime':_0x34905c[_0x2368be(0x1ca)],'attempt_id':_0x34905c['id'],'attempt_index':_0x34905c['index'],'retryAttemptName':_0x34905c[_0x2368be(0x215)],'done':_0x34905c[_0x2368be(0x22b)],'success':_0x34905c['success'],'cancelRequested':_0x34905c[_0x2368be(0x1d3)],'params':_0x34905c[_0x2368be(0x237)],'createdAt':_0x34905c['createdAt'],'finishedAt':_0x34905c['finishedAt'],'id':_0x34905c['id'],'index':_0x34905c[_0x2368be(0x1fe)],'project':_0x34905c[_0x2368be(0x1c2)],'workflow':_0x34905c['workflow']}));}async[a180_0x1649a9(0x210)](_0x771a1a){const _0x1557fe=a180_0x1649a9,_0x45cad4=await this[_0x1557fe(0x238)][_0x1557fe(0x218)](_0x771a1a);return _0x45cad4;}async[a180_0x1649a9(0x1da)](_0x12699d,_0x4cbe92=![]){const _0xe66989=a180_0x1649a9,_0x48c9f8=await this[_0xe66989(0x238)][_0xe66989(0x217)](_0x12699d,_0x4cbe92);return _0x48c9f8[_0xe66989(0x1d4)](_0xf98409=>({'task_id':_0xf98409['id'],'task_name':_0xf98409[_0xe66989(0x1f7)],'parentId':_0xf98409[_0xe66989(0x1db)],'config':_0xf98409['config'],'upstreams':_0xf98409['upstreams'],'state':_0xf98409['state'],'exportParams':_0xf98409['exportParams'],'storeParams':_0xf98409['storeParams'],'stateParams':_0xf98409[_0xe66989(0x226)],'updatedAt':_0xf98409[_0xe66989(0x1ce)],'retryAt':_0xf98409[_0xe66989(0x221)],'startedAt':_0xf98409['startedAt'],'error':_0xf98409[_0xe66989(0x1e6)],'isGroup':_0xf98409['isGroup'],'id':_0xf98409['id'],'fullName':_0xf98409['fullName']}));}async[a180_0x1649a9(0x229)](_0x59ad84,_0x48e310){const _0x150639=a180_0x1649a9;return await this[_0x150639(0x238)][_0x150639(0x1cf)](_0x59ad84,_0x48e310);}async[a180_0x1649a9(0x1d1)](_0x59e21d,_0x269c90){const _0x137e88=a180_0x1649a9,_0x2378d4=await import('zlib'),{promisify:_0x2f23f1}=await import('util'),_0x113ec5=_0x2f23f1(_0x2378d4['gunzip']),_0x223d10=await this['client'][_0x137e88(0x1cf)](_0x59e21d,_0x269c90);if(_0x223d10[_0x137e88(0x20e)]===0x0)return'';const _0x86fe08=[];for(const _0x4bf289 of _0x223d10){if(!_0x4bf289[_0x137e88(0x1ed)])continue;const _0x595c21=await fetch(_0x4bf289[_0x137e88(0x1ed)]);if(!_0x595c21['ok'])throw new Error(_0x137e88(0x22c)+_0x595c21[_0x137e88(0x1cd)]);const _0x1b1a8e=Buffer['from'](await _0x595c21[_0x137e88(0x1ff)]()),_0x5c31e9=await _0x113ec5(_0x1b1a8e);_0x86fe08[_0x137e88(0x216)](_0x5c31e9['toString']('utf-8'));}return _0x86fe08[_0x137e88(0x22d)]('\x0a');}async[a180_0x1649a9(0x211)](_0x48fff2,_0x12bb08){const _0x26193e=a180_0x1649a9,_0x3f007f=await this[_0x26193e(0x238)][_0x26193e(0x1dd)](_0x48fff2,_0x12bb08);return _0x3f007f?.[_0x26193e(0x1df)]??_0x26193e(0x1dc);}async[a180_0x1649a9(0x20f)](_0xd520e0,_0x2e916a){const _0x6ee253=a180_0x1649a9,_0x3adc99=await this[_0x6ee253(0x238)]['retrySession'](_0xd520e0,{'from_task':_0x2e916a?.[_0x6ee253(0x209)],'retry_params':_0x2e916a?.[_0x6ee253(0x21c)]});return{'attemptId':_0x3adc99['id'],'sessionId':_0x3adc99[_0x6ee253(0x1f5)]};}async[a180_0x1649a9(0x207)](_0x22e53e,_0x3ddf5f){const _0x2b1a2c=a180_0x1649a9,_0x5cd075=await this[_0x2b1a2c(0x238)]['retryAttempt'](_0x22e53e,{'resume_from':_0x3ddf5f?.[_0x2b1a2c(0x1cb)],'retry_params':_0x3ddf5f?.[_0x2b1a2c(0x21c)],'force':_0x3ddf5f?.[_0x2b1a2c(0x1d7)]});return{'attemptId':_0x5cd075['id'],'sessionId':_0x5cd075[_0x2b1a2c(0x1f5)]};}async[a180_0x1649a9(0x23e)](_0x17f249,_0x5684ae={},_0xe15d1d){const _0x9b966=a180_0x1649a9,_0x4d9ba5=_0x17f249['indexOf']('.');let _0x226340,_0x47a93e;if(_0x4d9ba5===-0x1)throw new Error('Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format');_0x226340=_0x17f249[_0x9b966(0x225)](0x0,_0x4d9ba5),_0x47a93e=_0x17f249[_0x9b966(0x225)](_0x4d9ba5+0x1);if(!_0x226340||!_0x47a93e)throw new Error(_0x9b966(0x1f4)+_0x17f249+_0x9b966(0x20c));const _0x32b05e=_0xe15d1d?.[_0x9b966(0x1ca)]||new Date()[_0x9b966(0x1d5)]();return await this[_0x9b966(0x238)][_0x9b966(0x23d)]({'projectName':_0x226340,'workflowName':_0x47a93e,'sessionTime':_0x32b05e,'params':_0x5684ae});}async[a180_0x1649a9(0x21f)](_0x5c25e7,_0x5a6be8,_0x3796d7){const _0x3ab6b4=a180_0x1649a9,{promises:_0x45606c}=await import('fs'),_0x56737f=await import(_0x3ab6b4(0x1fd)),_0x278b5f=await import('os'),_0x578cad=await import(_0x3ab6b4(0x1e4)),{id:_0x245326,name:_0x55c1ee}=await this[_0x3ab6b4(0x1c6)](_0x5c25e7),_0x4f40a8=_0x278b5f[_0x3ab6b4(0x23b)](),_0x3c87c6=_0x56737f[_0x3ab6b4(0x22d)](_0x4f40a8,_0x3ab6b4(0x239)+_0x245326+'-'+Date[_0x3ab6b4(0x228)]()+_0x3ab6b4(0x236));try{await this['client'][_0x3ab6b4(0x231)](_0x245326,_0x3c87c6,_0x3796d7?.[_0x3ab6b4(0x1ec)]);const _0x5038a6=_0x56737f[_0x3ab6b4(0x22d)](_0x5a6be8,_0x55c1ee);await _0x45606c[_0x3ab6b4(0x1e3)](_0x5038a6,{'recursive':!![]}),await _0x578cad[_0x3ab6b4(0x1c7)]({'file':_0x3c87c6,'cwd':_0x5038a6,'gzip':!![]});const _0x1c157d=async _0x332ecb=>{const _0x461bdb=_0x3ab6b4;let _0x3aa1a0=0x0;const _0x4d1b50=await _0x45606c[_0x461bdb(0x227)](_0x332ecb,{'withFileTypes':!![]});for(const _0x176937 of _0x4d1b50){const _0x2ad02e=_0x56737f['join'](_0x332ecb,_0x176937['name']);if(_0x176937['isFile']())_0x3aa1a0++;else _0x176937['isDirectory']()&&(_0x3aa1a0+=await _0x1c157d(_0x2ad02e));}return _0x3aa1a0;},_0x2c963c=await _0x1c157d(_0x5038a6);return{'projectName':_0x55c1ee,'revision':_0x3796d7?.[_0x3ab6b4(0x1ec)]||'latest','filesExtracted':_0x2c963c};}finally{try{await _0x45606c[_0x3ab6b4(0x219)](_0x3c87c6);}catch{}}}async['push'](_0x42b21e,_0x3a5907){const _0x5255ba=a180_0x1649a9,{promises:_0x3d82a2}=await import('fs'),_0x1f4e93=await import(_0x5255ba(0x1fd)),_0x464b7f=await import(_0x5255ba(0x1e4)),_0x4d85d3=_0x3a5907?.[_0x5255ba(0x22e)]||_0x1f4e93[_0x5255ba(0x1d2)](_0x42b21e),_0x588dc9=_0x3a5907?.[_0x5255ba(0x1ec)]||new Date()[_0x5255ba(0x1d5)]()['replace'](/[:.]/g,'-');try{await _0x3d82a2[_0x5255ba(0x20b)](_0x42b21e);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0x42b21e);}if(!_0x3a5907?.['skipValidation']){const _0x51807c=await _0x3d82a2[_0x5255ba(0x227)](_0x42b21e),_0x5cfc33=_0x51807c[_0x5255ba(0x1f1)](_0x9d787c=>_0x9d787c[_0x5255ba(0x204)](WORKFLOW_FILE_EXTENSION));if(_0x5cfc33[_0x5255ba(0x20e)]===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+_0x5255ba(0x1c5));for(const _0xd079dd of _0x5cfc33){const _0x10fb19=_0x1f4e93[_0x5255ba(0x22d)](_0x42b21e,_0xd079dd);try{await _0x3d82a2[_0x5255ba(0x20b)](_0x10fb19);}catch{throw new Error(_0x5255ba(0x1e9)+_0xd079dd);}}}const _0x2ba4ca=async(_0x1d04c7,_0x3a6127='')=>{const _0x4d9735=_0x5255ba,_0x4583a4=await _0x3d82a2['readdir'](_0x1d04c7,{'withFileTypes':!![]}),_0x3ecc4c=[];for(const _0x2b3895 of _0x4583a4){const _0x3cd165=_0x1f4e93['join'](_0x3a6127,_0x2b3895[_0x4d9735(0x220)]),_0x2d09b8=_0x1f4e93[_0x4d9735(0x22d)](_0x1d04c7,_0x2b3895[_0x4d9735(0x220)]);if(!shouldIncludeInArchive(_0x2b3895[_0x4d9735(0x220)]))continue;_0x2b3895[_0x4d9735(0x230)]()?_0x3ecc4c[_0x4d9735(0x216)](...await _0x2ba4ca(_0x2d09b8,_0x3cd165)):_0x3ecc4c[_0x4d9735(0x216)](_0x3cd165);}return _0x3ecc4c;},_0x29ec95=await _0x2ba4ca(_0x42b21e),_0x188453=await import('os'),_0x3443a5=_0x188453['tmpdir'](),_0x12dc75=_0x1f4e93['join'](_0x3443a5,_0x5255ba(0x1c1)+Date['now']()+'.tar.gz');try{await _0x464b7f[_0x5255ba(0x200)]({'file':_0x12dc75,'gzip':!![],'cwd':_0x42b21e,'portable':!![]},_0x29ec95);const _0x41aa83=await this[_0x5255ba(0x238)][_0x5255ba(0x1c8)](_0x4d85d3,_0x588dc9,_0x12dc75,{'scheduleFrom':_0x3a5907?.[_0x5255ba(0x234)],'clearSchedule':_0x3a5907?.[_0x5255ba(0x1d9)],'clearScheduleAll':_0x3a5907?.[_0x5255ba(0x1fa)]});return{'projectId':_0x41aa83['id'],'projectName':_0x41aa83[_0x5255ba(0x220)],'revision':_0x41aa83[_0x5255ba(0x1ec)]};}finally{try{await _0x3d82a2[_0x5255ba(0x219)](_0x12dc75);}catch{}}}async[a180_0x1649a9(0x1f6)](_0x10b4e6){const _0x4fcbb2=a180_0x1649a9,{id:_0x121593}=await this['resolveProjectId'](_0x10b4e6),_0x3cbe51=await this[_0x4fcbb2(0x238)][_0x4fcbb2(0x1ea)](_0x121593);return{'projectId':_0x3cbe51['id'],'projectName':_0x3cbe51[_0x4fcbb2(0x220)]};}async[a180_0x1649a9(0x21b)](_0x55f3a8){const _0xde0f88=a180_0x1649a9,{id:_0x2115bb,name:_0x559c51}=await this[_0xde0f88(0x1c6)](_0x55f3a8),_0x3dd0fc=await this[_0xde0f88(0x238)]['listSecrets'](_0x2115bb);return{'projectName':_0x559c51,'secrets':_0x3dd0fc};}async['setSecret'](_0x446373,_0x4662d1,_0x49f91d){const _0x2782f7=a180_0x1649a9,{id:_0x589fff,name:_0x373423}=await this['resolveProjectId'](_0x446373);return await this[_0x2782f7(0x238)][_0x2782f7(0x233)](_0x589fff,_0x4662d1,_0x49f91d),{'projectName':_0x373423,'key':_0x4662d1};}async[a180_0x1649a9(0x212)](_0x3ae0ed,_0x2b83f6){const _0x35db61=a180_0x1649a9,{id:_0x11d4e1,name:_0x4e59f0}=await this[_0x35db61(0x1c6)](_0x3ae0ed),_0x23bf04=Object[_0x35db61(0x205)](_0x2b83f6),_0x5321be=await Promise['allSettled'](_0x23bf04[_0x35db61(0x1d4)](_0x300226=>this['client'][_0x35db61(0x233)](_0x11d4e1,_0x300226,_0x2b83f6[_0x300226]))),_0x1aaf92=_0x5321be['map']((_0x44398a,_0x39cba4)=>_0x44398a[_0x35db61(0x1cd)]===_0x35db61(0x1c9)?_0x23bf04[_0x39cba4]:null)['filter'](_0x5d95e8=>_0x5d95e8!==null);if(_0x1aaf92[_0x35db61(0x20e)]>0x0)throw new SDKError(ErrorCode[_0x35db61(0x1de)],_0x35db61(0x203)+(_0x1aaf92[_0x35db61(0x20e)]>0x1?'s':'')+':\x20'+_0x1aaf92[_0x35db61(0x22d)](',\x20'));return{'projectName':_0x4e59f0,'keys':_0x23bf04};}async['deleteSecret'](_0x5cb6ba,_0x3d4eae){const _0x217cad=a180_0x1649a9,{id:_0x402311,name:_0x1b25c8}=await this[_0x217cad(0x1c6)](_0x5cb6ba);return await this[_0x217cad(0x238)][_0x217cad(0x23a)](_0x402311,_0x3d4eae),{'projectName':_0x1b25c8,'key':_0x3d4eae};}async[a180_0x1649a9(0x1e0)](_0x41c19c,_0x250b76){const _0x1a8530=a180_0x1649a9;return pullWorkflow({'client':this[_0x1a8530(0x238)],'resolveProjectId':this[_0x1a8530(0x1c6)][_0x1a8530(0x1f3)](this)},_0x41c19c,_0x250b76);}async['applyPullProject'](_0x122cc8,_0x40daef){const _0x445df5=a180_0x1649a9;return applyPullResult({'client':this['client'],'resolveProjectId':this[_0x445df5(0x1c6)]['bind'](this)},_0x122cc8,_0x40daef);}async['preparePushProject'](_0x182400){const _0x591e3a=a180_0x1649a9;return preparePushWorkflow({'client':this[_0x591e3a(0x238)],'resolveProjectId':this[_0x591e3a(0x1c6)][_0x591e3a(0x1f3)](this)},_0x182400);}async[a180_0x1649a9(0x1c3)](_0xcafc1){const _0x48bc3c=a180_0x1649a9;return executePushWorkflow({'client':this[_0x48bc3c(0x238)],'resolveProjectId':this[_0x48bc3c(0x1c6)][_0x48bc3c(0x1f3)](this)},_0xcafc1);}async[a180_0x1649a9(0x1eb)](_0x52644d,_0x50342a,_0x4eaf62){const _0x23b1b4=a180_0x1649a9;return prepareCloneWorkflow({'client':this[_0x23b1b4(0x238)]},_0x52644d,_0x50342a,_0x4eaf62);}async[a180_0x1649a9(0x21d)](_0x525124){return executeCloneWorkflow({'client':this['client']},_0x525124);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x410775,_0x583802){const _0x4f1741=a181_0x2395,_0x1585e8=_0x410775();while(!![]){try{const _0x1d25f8=parseInt(_0x4f1741(0x140))/0x1*(parseInt(_0x4f1741(0x125))/0x2)+-parseInt(_0x4f1741(0x127))/0x3*(-parseInt(_0x4f1741(0x139))/0x4)+parseInt(_0x4f1741(0x13d))/0x5*(parseInt(_0x4f1741(0x15e))/0x6)+-parseInt(_0x4f1741(0x156))/0x7*(parseInt(_0x4f1741(0x130))/0x8)+parseInt(_0x4f1741(0x146))/0x9+-parseInt(_0x4f1741(0x15c))/0xa+parseInt(_0x4f1741(0x154))/0xb;if(_0x1d25f8===_0x583802)break;else _0x1585e8['push'](_0x1585e8['shift']());}catch(_0x244484){_0x1585e8['push'](_0x1585e8['shift']());}}}(a181_0x2ae1,0x37b7d));function a181_0x2395(_0x4eb8e2,_0xe41666){_0x4eb8e2=_0x4eb8e2-0x121;const _0x2ae156=a181_0x2ae1();let _0x23951e=_0x2ae156[_0x4eb8e2];return _0x23951e;}import{existsSync,promises as a181_0x1ec011}from'fs';import a181_0x9507c4 from'path';import a181_0x441f62 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{getWorkflowProjectDir,createWorkflowTdxConfigContent,updateWorkflowTdxConfig}from'./tdx-config.js';function a181_0x2ae1(){const _0x534a7c=['includes','isDirectory','utf-8','type','mkdir','tdx-wf-pull-','5428RPuSDn','baseDir','tar','toISOString','5FfjRTw','readFile','projectName','10pIUQOU','tdx.json','localeCompare','unlink','\x20(archive\x20size:\x20','archive.tar.gz','865827JNtRFf','getProject','join','filter','TAR_BAD_ARCHIVE','extract','extracted','mkdtemp','changes','add','size','tmpdir','cwd','targetDir','2956657Yzkzlh','name','7ybLcpj','sort','length','push','projectId','message','3208550GAvsDn','path','1183254TIXHZo','has','writeFile','deleted','new','stat','unchanged','45638ggFymG','Failed\x20to\x20extract\x20project\x20archive','315anYaRe','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','catch','WORKFLOW_ARCHIVE_CORRUPTED','latest','tdx-wf-apply-','zlib','downloadProjectArchive','\x20bytes)','3070384fLLNkq','modified','revision'];a181_0x2ae1=function(){return _0x534a7c;};return a181_0x2ae1();}import{SDKError,ErrorCode}from'../errors.js';export async function pullWorkflow(_0x3d4b85,_0x2082b9,_0x4ffd05={}){const _0x595c75=a181_0x2395,_0xe4399c=await import('tar'),{client:_0x5c997b,resolveProjectId:_0x1c9a00}=_0x3d4b85,{id:_0x5f0c2b,name:_0x5d5f60}=await _0x1c9a00(_0x2082b9),_0x17b8b4=_0x4ffd05[_0x595c75(0x13a)]||process[_0x595c75(0x152)](),_0x495a0b=_0x4ffd05[_0x595c75(0x153)]||getWorkflowProjectDir(_0x5d5f60,_0x17b8b4),_0x4efa96=a181_0x9507c4[_0x595c75(0x148)](_0x495a0b,_0x595c75(0x141)),_0x414aa9=!existsSync(_0x4efa96),_0x59403d=await a181_0x1ec011[_0x595c75(0x14d)](a181_0x9507c4[_0x595c75(0x148)](a181_0x441f62[_0x595c75(0x151)](),_0x595c75(0x138))),_0x4b5e99=a181_0x9507c4['join'](_0x59403d,_0x595c75(0x145)),_0x2606f9=a181_0x9507c4[_0x595c75(0x148)](_0x59403d,_0x595c75(0x14c));try{await _0x5c997b[_0x595c75(0x12e)](_0x5f0c2b,_0x4b5e99,_0x4ffd05[_0x595c75(0x132)]),await a181_0x1ec011[_0x595c75(0x137)](_0x2606f9,{'recursive':!![]});try{await _0xe4399c[_0x595c75(0x14b)]({'file':_0x4b5e99,'cwd':_0x2606f9,'gzip':!![]});}catch(_0x1adcc2){const _0x169bdf=_0x1adcc2 instanceof Error?_0x1adcc2[_0x595c75(0x15b)]:String(_0x1adcc2);if(_0x169bdf[_0x595c75(0x133)](_0x595c75(0x14a))||_0x169bdf[_0x595c75(0x133)](_0x595c75(0x12d))){const _0xdc46b1=await a181_0x1ec011[_0x595c75(0x123)](_0x4b5e99)['catch'](()=>null),_0x4b7a3f=_0xdc46b1?_0x595c75(0x144)+_0xdc46b1['size']+_0x595c75(0x12f):'';throw new SDKError(ErrorCode[_0x595c75(0x12a)],_0x595c75(0x126)+_0x4b7a3f+':\x20'+_0x169bdf,_0x1adcc2,{'helpText':_0x595c75(0x128)+'The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.'});}throw _0x1adcc2;}const _0x21e20f=await _0x5c997b[_0x595c75(0x147)](_0x5f0c2b),_0x53102a=_0x4ffd05[_0x595c75(0x132)]||_0x21e20f['revision']||_0x595c75(0x12b),_0x56560e=await calculateChanges(_0x495a0b,_0x2606f9,_0x414aa9),_0x2e7fb6={'new':_0x56560e[_0x595c75(0x149)](_0x2e327f=>_0x2e327f[_0x595c75(0x136)]===_0x595c75(0x122))[_0x595c75(0x158)],'modified':_0x56560e[_0x595c75(0x149)](_0x94b096=>_0x94b096[_0x595c75(0x136)]==='modified')[_0x595c75(0x158)],'deleted':_0x56560e['filter'](_0x4dd904=>_0x4dd904[_0x595c75(0x136)]===_0x595c75(0x121))['length'],'unchanged':_0x56560e[_0x595c75(0x149)](_0x2f1a02=>_0x2f1a02[_0x595c75(0x136)]===_0x595c75(0x124))['length']};return{'projectName':_0x5d5f60,'projectId':_0x5f0c2b,'revision':_0x53102a,'targetDir':_0x495a0b,'changes':_0x56560e,'summary':_0x2e7fb6,'hasChanges':_0x2e7fb6[_0x595c75(0x122)]>0x0||_0x2e7fb6[_0x595c75(0x131)]>0x0||_0x2e7fb6[_0x595c75(0x121)]>0x0,'isNewProject':_0x414aa9};}finally{await a181_0x1ec011['rm'](_0x59403d,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0x29cb12,_0x5a9255,_0x2e15c1={}){const _0xed3380=a181_0x2395,_0x27fe73=await import(_0xed3380(0x13b)),{client:_0x32aa11}=_0x29cb12,_0x1c757a=await a181_0x1ec011[_0xed3380(0x14d)](a181_0x9507c4[_0xed3380(0x148)](a181_0x441f62['tmpdir'](),_0xed3380(0x12c))),_0x4ea804=a181_0x9507c4[_0xed3380(0x148)](_0x1c757a,_0xed3380(0x145));try{await _0x32aa11['downloadProjectArchive'](_0x5a9255[_0xed3380(0x15a)],_0x4ea804,_0x2e15c1[_0xed3380(0x132)]),await a181_0x1ec011['mkdir'](_0x5a9255['targetDir'],{'recursive':!![]});for(const _0x59ea5f of _0x5a9255[_0xed3380(0x14e)]){if(_0x59ea5f[_0xed3380(0x136)]===_0xed3380(0x121)){const _0x138a93=a181_0x9507c4['join'](_0x5a9255[_0xed3380(0x153)],_0x59ea5f[_0xed3380(0x15d)]);await a181_0x1ec011[_0xed3380(0x143)](_0x138a93)[_0xed3380(0x129)](()=>{});}}try{await _0x27fe73[_0xed3380(0x14b)]({'file':_0x4ea804,'cwd':_0x5a9255[_0xed3380(0x153)],'gzip':!![]});}catch(_0x5c58bb){const _0x55be8a=_0x5c58bb instanceof Error?_0x5c58bb['message']:String(_0x5c58bb);if(_0x55be8a[_0xed3380(0x133)](_0xed3380(0x14a))||_0x55be8a[_0xed3380(0x133)](_0xed3380(0x12d))){const _0x5c4ba4=await a181_0x1ec011[_0xed3380(0x123)](_0x4ea804)[_0xed3380(0x129)](()=>null),_0x1a4a4c=_0x5c4ba4?_0xed3380(0x144)+_0x5c4ba4[_0xed3380(0x150)]+_0xed3380(0x12f):'';throw new SDKError(ErrorCode[_0xed3380(0x12a)],_0xed3380(0x126)+_0x1a4a4c+':\x20'+_0x55be8a,_0x5c58bb,{'helpText':'The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20'+'The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.'});}throw _0x5c58bb;}const _0x560e43=a181_0x9507c4[_0xed3380(0x148)](_0x5a9255[_0xed3380(0x153)],_0xed3380(0x141));if(_0x5a9255['isNewProject']){const _0x400526=createWorkflowTdxConfigContent(_0x5a9255[_0xed3380(0x13f)],_0x5a9255['projectId'],_0x5a9255[_0xed3380(0x132)]);await a181_0x1ec011[_0xed3380(0x160)](_0x560e43,_0x400526,_0xed3380(0x135));}else updateWorkflowTdxConfig(_0x560e43,{'last_pulled_revision':_0x5a9255[_0xed3380(0x132)],'last_pulled_at':new Date()[_0xed3380(0x13c)]()});}finally{await a181_0x1ec011['rm'](_0x1c757a,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x4a6903,_0x47b391,_0x14a011){const _0x2e5ddd=a181_0x2395,_0x530a71=[],_0x42aa90=await getAllFiles(_0x47b391),_0x297df8=existsSync(_0x4a6903)?await getAllFiles(_0x4a6903):new Set();for(const _0x3ff34f of _0x42aa90){const _0x4d0c9e=a181_0x9507c4[_0x2e5ddd(0x148)](_0x4a6903,_0x3ff34f),_0x31504d=a181_0x9507c4[_0x2e5ddd(0x148)](_0x47b391,_0x3ff34f);if(_0x3ff34f===_0x2e5ddd(0x141))continue;const _0x3038d1=await a181_0x1ec011[_0x2e5ddd(0x13e)](_0x31504d,_0x2e5ddd(0x135))[_0x2e5ddd(0x129)](()=>null);if(_0x3038d1===null)continue;if(!existsSync(_0x4d0c9e)||_0x14a011)_0x530a71['push']({'path':_0x3ff34f,'type':_0x2e5ddd(0x122),'newContent':_0x3038d1});else{const _0x5d6f36=await a181_0x1ec011['readFile'](_0x4d0c9e,'utf-8')[_0x2e5ddd(0x129)](()=>null);if(_0x5d6f36===null)_0x530a71['push']({'path':_0x3ff34f,'type':'modified','newContent':_0x3038d1});else{if(_0x5d6f36!==_0x3038d1){const _0x55b1e7=generateDiff(_0x5d6f36,_0x3038d1),_0x3823cc=hasChanges(_0x55b1e7)?formatDiffWithColors(_0x55b1e7):undefined;_0x530a71[_0x2e5ddd(0x159)]({'path':_0x3ff34f,'type':_0x2e5ddd(0x131),'oldContent':_0x5d6f36,'newContent':_0x3038d1,'diff':_0x3823cc});}else _0x530a71[_0x2e5ddd(0x159)]({'path':_0x3ff34f,'type':'unchanged'});}}}if(!_0x14a011)for(const _0x41a2d1 of _0x297df8){if(_0x41a2d1==='tdx.json')continue;if(!_0x42aa90[_0x2e5ddd(0x15f)](_0x41a2d1)){const _0x5e7a1b=a181_0x9507c4[_0x2e5ddd(0x148)](_0x4a6903,_0x41a2d1),_0x16ebb0=await a181_0x1ec011[_0x2e5ddd(0x13e)](_0x5e7a1b,'utf-8')['catch'](()=>undefined);_0x530a71[_0x2e5ddd(0x159)]({'path':_0x41a2d1,'type':_0x2e5ddd(0x121),'oldContent':_0x16ebb0});}}return _0x530a71[_0x2e5ddd(0x157)]((_0x2ec39e,_0x5e8aac)=>_0x2ec39e['path'][_0x2e5ddd(0x142)](_0x5e8aac[_0x2e5ddd(0x15d)])),_0x530a71;}async function getAllFiles(_0x5ad2aa,_0x38fe05=''){const _0x5623e6=a181_0x2395,_0x1ed26a=new Set();if(!existsSync(_0x5ad2aa))return _0x1ed26a;const _0x510429=await a181_0x1ec011['readdir'](_0x5ad2aa,{'withFileTypes':!![]});for(const _0x54d75d of _0x510429){const _0x3d7af6=_0x38fe05?a181_0x9507c4[_0x5623e6(0x148)](_0x38fe05,_0x54d75d['name']):_0x54d75d['name'];if(_0x54d75d[_0x5623e6(0x134)]()){const _0x20cb04=await getAllFiles(a181_0x9507c4[_0x5623e6(0x148)](_0x5ad2aa,_0x54d75d[_0x5623e6(0x155)]),_0x3d7af6);for(const _0x1b5af3 of _0x20cb04){_0x1ed26a['add'](_0x1b5af3);}}else _0x1ed26a[_0x5623e6(0x14f)](_0x3d7af6);}return _0x1ed26a;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x328a02,_0x338108){const _0x42fe2c=a182_0x12e6,_0x5565c6=_0x328a02();while(!![]){try{const _0x32c47f=parseInt(_0x42fe2c(0x137))/0x1+parseInt(_0x42fe2c(0x157))/0x2*(-parseInt(_0x42fe2c(0x13a))/0x3)+parseInt(_0x42fe2c(0x144))/0x4+parseInt(_0x42fe2c(0x158))/0x5+parseInt(_0x42fe2c(0x153))/0x6*(-parseInt(_0x42fe2c(0x130))/0x7)+-parseInt(_0x42fe2c(0x151))/0x8+parseInt(_0x42fe2c(0x12b))/0x9;if(_0x32c47f===_0x338108)break;else _0x5565c6['push'](_0x5565c6['shift']());}catch(_0x31e73c){_0x5565c6['push'](_0x5565c6['shift']());}}}(a182_0x4a4e,0x3a4f3));import{promises as a182_0x302a35}from'fs';function a182_0x12e6(_0xacc769,_0x482957){_0xacc769=_0xacc769-0x12b;const _0x4a4e49=a182_0x4a4e();let _0x12e6f6=_0x4a4e49[_0xacc769];return _0x12e6f6;}import a182_0x1a3ae1 from'path';import a182_0x58c3e5 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';import{SDKError,ErrorCode}from'../errors.js';function a182_0x4a4e(){const _0x2a091a=['type','sort','5554971AdndZb','modified','readFile','extracted','new','210QTSRww','downloadProjectArchive','sourceDir','mkdtemp','path','tar','WORKFLOW_ARCHIVE_CORRUPTED','158590STUoKo','configResult','extract','27GweBzK','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','length','isDirectory','No\x20','filter','stat','skipValidation','posix','join','991940mfcDit','cwd','tdx-wf-push-','size','tmpdir','\x20workflow\x20files\x20found\x20in\x20','message','\x20bytes)','replace','zlib','catch','endsWith','utf-8','1471800dBOHTy','create','86982GGIPkN','readdir','\x20(archive\x20size:\x20','projectName','76842FXtAgO','898575wOJZFj','unchanged','revision','name','archive.tar.gz','workflow_project','push','includes','uploadProjectArchive','deleted','.digdagignore'];a182_0x4a4e=function(){return _0x2a091a;};return a182_0x4a4e();}export async function preparePushWorkflow(_0x566624,_0xf730d2={}){const _0x338685=a182_0x12e6,_0x4f05f0=await import(_0x338685(0x135)),{client:_0x8657b8,resolveProjectId:_0x101b34}=_0x566624,_0x333c65=_0xf730d2['sourceDir']||process[_0x338685(0x145)](),_0x2ddf0c=findWorkflowTdxConfig(_0x333c65),{config:_0x3b4ba4,configDir:_0x43c57e}=_0x2ddf0c;let _0x3d1b18,_0x314bd4=_0x3b4ba4[_0x338685(0x15d)];try{const _0x55e471=await _0x101b34(_0x3b4ba4[_0x338685(0x15d)]);_0x3d1b18=_0x55e471['id'],_0x314bd4=_0x55e471[_0x338685(0x15b)];}catch{_0x3d1b18='';}const _0x1b0351=_0xf730d2[_0x338685(0x15a)]||new Date()['toISOString']()[_0x338685(0x14c)](/[:.]/g,'-');if(!_0xf730d2[_0x338685(0x141)]){const _0x1c5647=await a182_0x302a35[_0x338685(0x154)](_0x43c57e),_0xf28e98=_0x1c5647[_0x338685(0x13f)](_0x51817f=>_0x51817f[_0x338685(0x14f)](WORKFLOW_FILE_EXTENSION));if(_0xf28e98['length']===0x0)throw new Error(_0x338685(0x13e)+WORKFLOW_FILE_EXTENSION+_0x338685(0x149)+_0x43c57e);}const _0x5491f6=await getProjectFiles(_0x43c57e);let _0x579ea7;if(_0x3d1b18){const _0x6e0ddf=await a182_0x302a35[_0x338685(0x133)](a182_0x1a3ae1[_0x338685(0x143)](a182_0x58c3e5[_0x338685(0x148)](),_0x338685(0x146))),_0x3ef215=a182_0x1a3ae1[_0x338685(0x143)](_0x6e0ddf,'archive.tar.gz'),_0x254260=a182_0x1a3ae1['join'](_0x6e0ddf,_0x338685(0x12e));try{await _0x8657b8[_0x338685(0x131)](_0x3d1b18,_0x3ef215),await a182_0x302a35['mkdir'](_0x254260,{'recursive':!![]});try{await _0x4f05f0[_0x338685(0x139)]({'file':_0x3ef215,'cwd':_0x254260,'gzip':!![]});}catch(_0x1437dd){const _0x263f20=_0x1437dd instanceof Error?_0x1437dd[_0x338685(0x14a)]:String(_0x1437dd);if(_0x263f20[_0x338685(0x15f)]('TAR_BAD_ARCHIVE')||_0x263f20[_0x338685(0x15f)](_0x338685(0x14d))){const _0x3e066b=await a182_0x302a35[_0x338685(0x140)](_0x3ef215)['catch'](()=>null),_0x3649b5=_0x3e066b?_0x338685(0x155)+_0x3e066b[_0x338685(0x147)]+_0x338685(0x14b):'';throw new SDKError(ErrorCode[_0x338685(0x136)],'Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison'+_0x3649b5+':\x20'+_0x263f20,_0x1437dd,{'helpText':_0x338685(0x13b)});}throw _0x1437dd;}_0x579ea7=await calculatePushChanges(_0x43c57e,_0x254260,_0x5491f6);}finally{await a182_0x302a35['rm'](_0x6e0ddf,{'recursive':!![],'force':!![]});}}else{_0x579ea7=[];for(const _0x5a6ab6 of _0x5491f6){const _0x33a7fe=a182_0x1a3ae1[_0x338685(0x143)](_0x43c57e,_0x5a6ab6),_0x5cab3d=await a182_0x302a35['readFile'](_0x33a7fe,_0x338685(0x150))[_0x338685(0x14e)](()=>null);_0x579ea7[_0x338685(0x15e)]({'path':_0x5a6ab6,'type':'new','newContent':_0x5cab3d||undefined});}}const _0x20ee0e={'new':_0x579ea7[_0x338685(0x13f)](_0x3bcebb=>_0x3bcebb['type']===_0x338685(0x12f))[_0x338685(0x13c)],'modified':_0x579ea7[_0x338685(0x13f)](_0xed22f2=>_0xed22f2[_0x338685(0x163)]===_0x338685(0x12c))[_0x338685(0x13c)],'deleted':_0x579ea7[_0x338685(0x13f)](_0x1ddec3=>_0x1ddec3[_0x338685(0x163)]===_0x338685(0x161))['length'],'unchanged':_0x579ea7[_0x338685(0x13f)](_0x227378=>_0x227378[_0x338685(0x163)]==='unchanged')[_0x338685(0x13c)]};return{'projectName':_0x314bd4,'projectId':_0x3d1b18,'revision':_0x1b0351,'sourceDir':_0x43c57e,'changes':_0x579ea7,'summary':_0x20ee0e,'hasChanges':_0x20ee0e[_0x338685(0x12f)]>0x0||_0x20ee0e[_0x338685(0x12c)]>0x0||_0x20ee0e[_0x338685(0x161)]>0x0,'configResult':_0x2ddf0c};}export async function executePushWorkflow(_0x3d40f8,_0x2e2428){const _0x19e04c=a182_0x12e6,_0x1e4a26=await import('tar'),{client:_0x3298fc}=_0x3d40f8,_0xd82cc9=await getProjectFiles(_0x2e2428['sourceDir']),_0x42db00=await a182_0x302a35[_0x19e04c(0x133)](a182_0x1a3ae1[_0x19e04c(0x143)](a182_0x58c3e5[_0x19e04c(0x148)](),'tdx-wf-push-archive-')),_0xb6ca46=a182_0x1a3ae1[_0x19e04c(0x143)](_0x42db00,_0x19e04c(0x15c));try{await _0x1e4a26[_0x19e04c(0x152)]({'file':_0xb6ca46,'gzip':!![],'cwd':_0x2e2428[_0x19e04c(0x132)],'portable':!![]},_0xd82cc9);const _0x285209=await _0x3298fc[_0x19e04c(0x160)](_0x2e2428[_0x19e04c(0x156)],_0x2e2428[_0x19e04c(0x15a)],_0xb6ca46);return updateWorkflowTdxConfig(_0x2e2428[_0x19e04c(0x138)]['configPath'],{'workflow_project_id':_0x285209['id'],'last_pushed_revision':_0x285209[_0x19e04c(0x15a)],'last_pushed_at':new Date()['toISOString']()}),{'projectId':_0x285209['id'],'projectName':_0x285209[_0x19e04c(0x15b)],'revision':_0x285209['revision']};}finally{await a182_0x302a35['rm'](_0x42db00,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x2dbc07,_0x4aa7a6=_0x2dbc07,_0x522fb0='',_0x5a5787=null){const _0x3744b5=a182_0x12e6,_0xb6b7b0=[];if(_0x5a5787===null){_0x5a5787=createIgnoreInstance();const _0x4512f9=await loadDigdagignore(_0x2dbc07);_0x4512f9&&_0x5a5787['add'](_0x4512f9);}if(_0x522fb0!==''){const _0x45944e=await loadDigdagignore(_0x4aa7a6);_0x45944e&&addScopedPatterns(_0x5a5787,_0x45944e,_0x522fb0);}const _0x253b65=await a182_0x302a35[_0x3744b5(0x154)](_0x4aa7a6,{'withFileTypes':!![]});for(const _0x21810f of _0x253b65){const _0x500bc2=_0x522fb0?a182_0x1a3ae1[_0x3744b5(0x142)]['join'](_0x522fb0,_0x21810f[_0x3744b5(0x15b)]):_0x21810f[_0x3744b5(0x15b)];if(_0x21810f[_0x3744b5(0x15b)]==='tdx.json')continue;if(_0x21810f[_0x3744b5(0x15b)]===_0x3744b5(0x162))continue;if(!shouldIncludeInArchive(_0x21810f[_0x3744b5(0x15b)]))continue;if(shouldIgnoreWithInstance(_0x5a5787,_0x500bc2,_0x21810f[_0x3744b5(0x13d)]()))continue;if(_0x21810f[_0x3744b5(0x13d)]()){const _0x2e93af=await getProjectFiles(_0x2dbc07,a182_0x1a3ae1[_0x3744b5(0x143)](_0x4aa7a6,_0x21810f[_0x3744b5(0x15b)]),_0x500bc2,_0x5a5787);_0xb6b7b0[_0x3744b5(0x15e)](..._0x2e93af);}else _0xb6b7b0['push'](_0x500bc2);}return _0xb6b7b0;}async function calculatePushChanges(_0x4469b8,_0x337368,_0x11ba9a){const _0x51bcee=a182_0x12e6,_0x4c52b6=[],_0x562fd0=new Set(await getProjectFiles(_0x337368));for(const _0x126c3a of _0x11ba9a){const _0x28c0e7=a182_0x1a3ae1[_0x51bcee(0x143)](_0x4469b8,_0x126c3a),_0x549545=a182_0x1a3ae1[_0x51bcee(0x143)](_0x337368,_0x126c3a),_0x304d77=await a182_0x302a35[_0x51bcee(0x12d)](_0x28c0e7,_0x51bcee(0x150))[_0x51bcee(0x14e)](()=>null);if(_0x304d77===null)continue;if(!_0x562fd0['has'](_0x126c3a))_0x4c52b6[_0x51bcee(0x15e)]({'path':_0x126c3a,'type':'new','newContent':_0x304d77});else{const _0x5b1b98=await a182_0x302a35[_0x51bcee(0x12d)](_0x549545,_0x51bcee(0x150))[_0x51bcee(0x14e)](()=>null);if(_0x5b1b98===null)_0x4c52b6[_0x51bcee(0x15e)]({'path':_0x126c3a,'type':_0x51bcee(0x12c),'newContent':_0x304d77});else{if(_0x5b1b98!==_0x304d77){const _0x15463f=generateDiff(_0x5b1b98,_0x304d77),_0x1e9a2d=hasChanges(_0x15463f)?formatDiffWithColors(_0x15463f):undefined;_0x4c52b6[_0x51bcee(0x15e)]({'path':_0x126c3a,'type':_0x51bcee(0x12c),'oldContent':_0x5b1b98,'newContent':_0x304d77,'diff':_0x1e9a2d});}else _0x4c52b6[_0x51bcee(0x15e)]({'path':_0x126c3a,'type':_0x51bcee(0x159)});}}}for(const _0x583e97 of _0x562fd0){if(!_0x11ba9a[_0x51bcee(0x15f)](_0x583e97)){const _0x214c7c=a182_0x1a3ae1[_0x51bcee(0x143)](_0x337368,_0x583e97),_0x5d203b=await a182_0x302a35[_0x51bcee(0x12d)](_0x214c7c,_0x51bcee(0x150))[_0x51bcee(0x14e)](()=>undefined);_0x4c52b6['push']({'path':_0x583e97,'type':_0x51bcee(0x161),'oldContent':_0x5d203b});}}return _0x4c52b6[_0x51bcee(0x164)]((_0x16a9a9,_0x462d53)=>_0x16a9a9[_0x51bcee(0x134)]['localeCompare'](_0x462d53['path'])),_0x4c52b6;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a183_0x43b5bd=a183_0x3278;function a183_0x3da3(){const _0x3988cb=['489923EuueIB','18IVWmyR','27145nqrTBT','object','174594pqkMRB','root','cwd','569124qificU','Invalid\x20JSON\x20in\x20','parse','2523HjHILV','1340570ZDQbvp','workflow_project_id','join','last_pulled_revision','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field','Invalid\x20tdx.json:\x20expected\x20object','80mndeYt','tdx.json','last_pushed_revision','stringify','dirname','workflow_project','last_pulled_at','115947XuKMfq','workflows','16Egezcc','utf-8','No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','string','resolve','last_pushed_at'];a183_0x3da3=function(){return _0x3988cb;};return a183_0x3da3();}(function(_0x190988,_0x365e47){const _0x2dd9ae=a183_0x3278,_0x2e8304=_0x190988();while(!![]){try{const _0x23e673=parseInt(_0x2dd9ae(0xdf))/0x1+parseInt(_0x2dd9ae(0xcc))/0x2*(-parseInt(_0x2dd9ae(0xc5))/0x3)+-parseInt(_0x2dd9ae(0xc2))/0x4+parseInt(_0x2dd9ae(0xdd))/0x5+-parseInt(_0x2dd9ae(0xdc))/0x6*(-parseInt(_0x2dd9ae(0xdb))/0x7)+parseInt(_0x2dd9ae(0xd5))/0x8*(parseInt(_0x2dd9ae(0xd3))/0x9)+-parseInt(_0x2dd9ae(0xc6))/0xa;if(_0x23e673===_0x365e47)break;else _0x2e8304['push'](_0x2e8304['shift']());}catch(_0xcb3d3a){_0x2e8304['push'](_0x2e8304['shift']());}}}(a183_0x3da3,0x19d32));import{existsSync,readFileSync,writeFileSync}from'fs';import a183_0x23714d from'path';const TDX_CONFIG_FILE=a183_0x43b5bd(0xcd),WORKFLOWS_DIR=a183_0x43b5bd(0xd4);export function findWorkflowTdxConfigPath(_0x134c35=process['cwd']()){const _0x4670e9=a183_0x43b5bd;let _0xf0c072=a183_0x23714d[_0x4670e9(0xd9)](_0x134c35);const _0x5bd63b=a183_0x23714d[_0x4670e9(0xc4)](_0xf0c072)[_0x4670e9(0xc0)];while(_0xf0c072!==_0x5bd63b){const _0x2347ca=a183_0x23714d['join'](_0xf0c072,TDX_CONFIG_FILE);if(existsSync(_0x2347ca))try{const _0x1c8cbc=readFileSync(_0x2347ca,_0x4670e9(0xd6)),_0x3442f2=JSON['parse'](_0x1c8cbc);if(_0x3442f2&&typeof _0x3442f2==='object'&&_0x4670e9(0xd1)in _0x3442f2)return _0x2347ca;}catch{}_0xf0c072=a183_0x23714d[_0x4670e9(0xd0)](_0xf0c072);}return null;}export function loadWorkflowTdxConfig(_0x4a9a3d){const _0x3a4066=a183_0x43b5bd,_0x1472ce=readFileSync(_0x4a9a3d,_0x3a4066(0xd6));let _0x34eb07;try{_0x34eb07=JSON[_0x3a4066(0xc4)](_0x1472ce);}catch{throw new Error(_0x3a4066(0xc3)+_0x4a9a3d);}if(!_0x34eb07||typeof _0x34eb07!==_0x3a4066(0xde))throw new Error(_0x3a4066(0xcb));const _0x39564f=_0x34eb07;if(!_0x39564f['workflow_project']||typeof _0x39564f[_0x3a4066(0xd1)]!==_0x3a4066(0xd8))throw new Error(_0x3a4066(0xca));return{'workflow_project':_0x39564f[_0x3a4066(0xd1)],'workflow_project_id':typeof _0x39564f[_0x3a4066(0xc7)]==='string'?_0x39564f[_0x3a4066(0xc7)]:undefined,'last_pulled_revision':typeof _0x39564f[_0x3a4066(0xc9)]==='string'?_0x39564f[_0x3a4066(0xc9)]:undefined,'last_pulled_at':typeof _0x39564f[_0x3a4066(0xd2)]===_0x3a4066(0xd8)?_0x39564f[_0x3a4066(0xd2)]:undefined,'last_pushed_revision':typeof _0x39564f['last_pushed_revision']===_0x3a4066(0xd8)?_0x39564f[_0x3a4066(0xce)]:undefined,'last_pushed_at':typeof _0x39564f[_0x3a4066(0xda)]===_0x3a4066(0xd8)?_0x39564f[_0x3a4066(0xda)]:undefined};}export function findWorkflowTdxConfig(_0x230b9d=process[a183_0x43b5bd(0xc1)]()){const _0x4f67d5=a183_0x43b5bd,_0x48c0fb=findWorkflowTdxConfigPath(_0x230b9d);if(!_0x48c0fb)throw new Error(_0x4f67d5(0xd7));const _0x5a1613=loadWorkflowTdxConfig(_0x48c0fb),_0x202c0e=a183_0x23714d[_0x4f67d5(0xd0)](_0x48c0fb);return{'config':_0x5a1613,'configPath':_0x48c0fb,'configDir':_0x202c0e};}export function tryFindWorkflowTdxConfig(_0x23f059){try{return findWorkflowTdxConfig(_0x23f059);}catch{return null;}}export function getWorkflowProjectDir(_0xbabc3a,_0x52566e=process['cwd']()){const _0x46c0eb=a183_0x43b5bd;return a183_0x23714d[_0x46c0eb(0xc8)](_0x52566e,WORKFLOWS_DIR,_0xbabc3a);}export function getWorkflowTdxConfigPath(_0xaa6752,_0x55ab1e=process[a183_0x43b5bd(0xc1)]()){const _0x186616=a183_0x43b5bd;return a183_0x23714d[_0x186616(0xc8)](getWorkflowProjectDir(_0xaa6752,_0x55ab1e),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x2ce59f,_0x4581cd,_0x3a26aa){const _0x14264b=a183_0x43b5bd,_0x3abfa6={'workflow_project':_0x2ce59f,..._0x4581cd&&{'workflow_project_id':_0x4581cd},..._0x3a26aa&&{'last_pulled_revision':_0x3a26aa},'last_pulled_at':new Date()['toISOString']()};return JSON[_0x14264b(0xcf)](_0x3abfa6,null,0x2)+'\x0a';}function a183_0x3278(_0x147ecc,_0x186356){_0x147ecc=_0x147ecc-0xc0;const _0x3da383=a183_0x3da3();let _0x3278b5=_0x3da383[_0x147ecc];return _0x3278b5;}export function saveWorkflowTdxConfig(_0x596d0c,_0x1802a0){const _0x4e8b04=a183_0x43b5bd,_0x4b8854=JSON[_0x4e8b04(0xcf)](_0x1802a0,null,0x2)+'\x0a';writeFileSync(_0x596d0c,_0x4b8854,_0x4e8b04(0xd6));}export function updateWorkflowTdxConfig(_0xefede2,_0x21611b){const _0x2ccdad=loadWorkflowTdxConfig(_0xefede2),_0x3c9fea={..._0x2ccdad,..._0x21611b};saveWorkflowTdxConfig(_0xefede2,_0x3c9fea);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a184_0x171c(_0x148941,_0xef45d5){_0x148941=_0x148941-0x86;const _0x1d1679=a184_0x1d16();let _0x171cf3=_0x1d1679[_0x148941];return _0x171cf3;}const a184_0x2a6b1a=a184_0x171c;(function(_0x247bcf,_0x74a99d){const _0x31989b=a184_0x171c,_0x49dd11=_0x247bcf();while(!![]){try{const _0xc3c839=-parseInt(_0x31989b(0x87))/0x1+parseInt(_0x31989b(0x91))/0x2*(parseInt(_0x31989b(0x90))/0x3)+parseInt(_0x31989b(0x9b))/0x4*(parseInt(_0x31989b(0x9e))/0x5)+parseInt(_0x31989b(0x9c))/0x6+-parseInt(_0x31989b(0x88))/0x7+parseInt(_0x31989b(0x9a))/0x8*(parseInt(_0x31989b(0x8f))/0x9)+-parseInt(_0x31989b(0x93))/0xa;if(_0xc3c839===_0x74a99d)break;else _0x49dd11['push'](_0x49dd11['shift']());}catch(_0x7c4ace){_0x49dd11['push'](_0x49dd11['shift']());}}}(a184_0x1d16,0xcf575));import{promises as a184_0x1f16c3}from'fs';import a184_0x1301ab from'path';import a184_0x337f6b from'ignore';export const WORKFLOW_FILE_EXTENSION=a184_0x2a6b1a(0x92);export function shouldIncludeInArchive(_0x48e98d){const _0x5ca0fb=a184_0x2a6b1a;if(_0x48e98d==='.digdag')return!![];if(_0x48e98d[_0x5ca0fb(0x8d)]('.'))return![];if(_0x48e98d[_0x5ca0fb(0x8a)]('~'))return![];if(_0x48e98d===_0x5ca0fb(0x86)||_0x48e98d===_0x5ca0fb(0x96))return![];return!![];}function a184_0x1d16(){const _0x1f0e6a=['3760nzsUyD','ENOENT','replace','map','Thumbs.db','1253961dDGpfZ','1469321nshiUt','slice','endsWith','add','split','startsWith','.digdagignore','216405qNOVNx','2136993QpKhdY','2jmeqQA','.dig','6912570cKklBQ','join','code','.DS_Store','filter','trim','ignores','48vvDMel','6680cDRmuT','5351694BWihLn','length'];a184_0x1d16=function(){return _0x1f0e6a;};return a184_0x1d16();}export function parseDigdagignore(_0x4be4f6){const _0x41fd5b=a184_0x2a6b1a;return _0x4be4f6[_0x41fd5b(0x8c)]('\x0a')[_0x41fd5b(0xa1)](_0x59e24d=>_0x59e24d[_0x41fd5b(0x98)]())[_0x41fd5b(0x97)](_0x440937=>_0x440937[_0x41fd5b(0x9d)]>0x0&&!_0x440937[_0x41fd5b(0x8d)]('#'));}export async function loadDigdagignore(_0x45e8e9){const _0x2cdf1d=a184_0x2a6b1a,_0x18719b=a184_0x1301ab[_0x2cdf1d(0x94)](_0x45e8e9,_0x2cdf1d(0x8e));try{const _0x18d7e0=await a184_0x1f16c3['readFile'](_0x18719b,'utf-8');return parseDigdagignore(_0x18d7e0);}catch(_0x10fcad){if(_0x10fcad[_0x2cdf1d(0x95)]===_0x2cdf1d(0x9f))return null;throw _0x10fcad;}}export function createIgnoreInstance(_0x1d4df0){const _0x473982=a184_0x2a6b1a,_0x4d12ef=a184_0x337f6b();return _0x1d4df0&&_0x1d4df0[_0x473982(0x9d)]>0x0&&_0x4d12ef[_0x473982(0x8b)](_0x1d4df0),_0x4d12ef;}export function addScopedPatterns(_0xd78671,_0x40e45e,_0x51ed1c){const _0x53907c=a184_0x2a6b1a,_0x387d42=_0x40e45e[_0x53907c(0xa1)](_0x5e8a69=>{const _0x38e65f=_0x53907c;if(_0x5e8a69['startsWith']('!')){const _0x16c76a=_0x5e8a69[_0x38e65f(0x89)](0x1);if(_0x16c76a[_0x38e65f(0x8d)]('/'))return'!'+_0x51ed1c+_0x16c76a;return'!'+_0x51ed1c+'/'+_0x16c76a;}if(_0x5e8a69[_0x38e65f(0x8d)]('/'))return''+_0x51ed1c+_0x5e8a69;return _0x51ed1c+'/'+_0x5e8a69;});return _0xd78671[_0x53907c(0x8b)](_0x387d42),_0xd78671;}export function shouldIgnoreWithInstance(_0x327488,_0x19d8b0,_0xfe51af){const _0x2070df=a184_0x2a6b1a,_0x292920=_0x19d8b0[_0x2070df(0xa0)](/\\/g,'/'),_0x45d1db=_0xfe51af?_0x292920+'/':_0x292920;return _0x327488[_0x2070df(0x99)](_0x45d1db);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a185_0x50076f=a185_0x44e0;function a185_0x2960(){const _0x17145f=['49707nsjWpb','106120OQKwhz','fetch','site','log','207wUdzya','fail','options','147RcrLeF','push','504509xiQeIB','ERROR','3072572eEQqns','5506OOMiQa','660QAzbgO','run','originalFetch','3236050GABbxC','14423060SEQuLO','test-api-key-id/test-api-key-secret','warn','error','reset','http','map','us01','createFetch','verify','exitCode','args','join'];a185_0x2960=function(){return _0x17145f;};return a185_0x2960();}(function(_0x604a7,_0x1b3c69){const _0x5f5281=a185_0x44e0,_0x1253ab=_0x604a7();while(!![]){try{const _0x2529df=-parseInt(_0x5f5281(0x94))/0x1+-parseInt(_0x5f5281(0x97))/0x2*(parseInt(_0x5f5281(0x92))/0x3)+-parseInt(_0x5f5281(0x96))/0x4+-parseInt(_0x5f5281(0x9b))/0x5+parseInt(_0x5f5281(0x98))/0x6*(parseInt(_0x5f5281(0x8a))/0x7)+-parseInt(_0x5f5281(0x8b))/0x8*(-parseInt(_0x5f5281(0x8f))/0x9)+parseInt(_0x5f5281(0x9c))/0xa;if(_0x2529df===_0x1b3c69)break;else _0x1253ab['push'](_0x1253ab['shift']());}catch(_0x194d04){_0x1253ab['push'](_0x1253ab['shift']());}}}(a185_0x2960,0x73a98));import{TDX,LogLevel}from'../sdk/index.js';import{createHTTPMock}from'./http-mock.js';function a185_0x44e0(_0x5eb379,_0x1b0846){_0x5eb379=_0x5eb379-0x7f;const _0x29601b=a185_0x2960();let _0x44e0a6=_0x29601b[_0x5eb379];return _0x44e0a6;}import{createTestGlobalOptions}from'./factories.js';export class CommandRunner{[a185_0x50076f(0x82)];[a185_0x50076f(0x9a)];constructor(){const _0x103c51=a185_0x50076f;this['http']=createHTTPMock(),this[_0x103c51(0x9a)]=global[_0x103c51(0x8c)];}['setup'](){const _0x5f2768=a185_0x50076f;this[_0x5f2768(0x9a)]=global[_0x5f2768(0x8c)],global[_0x5f2768(0x8c)]=this[_0x5f2768(0x82)][_0x5f2768(0x85)]();}['teardown'](_0x37abe1){const _0x3b4b28=a185_0x50076f;try{_0x37abe1?.[_0x3b4b28(0x90)]&&this['http'][_0x3b4b28(0x86)](_0x37abe1);}finally{global[_0x3b4b28(0x8c)]=this['originalFetch'],this['http'][_0x3b4b28(0x81)]();}}async[a185_0x50076f(0x99)](_0x167ad4,_0x1e4ef4={}){const _0x374caf=a185_0x50076f,_0x16031f=[],_0x2c0344=[],_0x5704a1=console['log'],_0x36e2da=console[_0x374caf(0x80)],_0x546d53=console[_0x374caf(0x7f)];console[_0x374caf(0x8e)]=(..._0x415cbb)=>{const _0x29463a=_0x374caf;_0x16031f[_0x29463a(0x93)](_0x415cbb[_0x29463a(0x83)](String)[_0x29463a(0x89)]('\x20'));},console[_0x374caf(0x80)]=(..._0x409c47)=>{const _0x53c677=_0x374caf;_0x2c0344[_0x53c677(0x93)](_0x409c47['map'](String)['join']('\x20'));},console[_0x374caf(0x7f)]=(..._0x498931)=>{const _0x3f5f13=_0x374caf;_0x2c0344[_0x3f5f13(0x93)](_0x498931[_0x3f5f13(0x83)](String)[_0x3f5f13(0x89)]('\x20'));};try{const _0x20af63=new TDX({'site':_0x1e4ef4['options']?.[_0x374caf(0x8d)]??_0x374caf(0x84),'apiKey':_0x374caf(0x9d),'logLevel':LogLevel[_0x374caf(0x95)]}),_0xe332a1={'options':createTestGlobalOptions(_0x1e4ef4[_0x374caf(0x91)]),'args':_0x1e4ef4[_0x374caf(0x88)]??[],'tdx':_0x20af63},_0x5dd1fb=new _0x167ad4(),_0x56a18a=await _0x5dd1fb[_0x374caf(0x99)](_0xe332a1);return{'exitCode':_0x56a18a,'stdout':_0x16031f,'stderr':_0x2c0344};}finally{console[_0x374caf(0x8e)]=_0x5704a1,console[_0x374caf(0x80)]=_0x36e2da,console[_0x374caf(0x7f)]=_0x546d53;}}async['runSequence'](_0x481ed9){const _0xcf2ea8=a185_0x50076f,_0x500df9=[];for(const {command:_0x28f841,options:_0x546f95}of _0x481ed9){const _0x51ffdc=await this[_0xcf2ea8(0x99)](_0x28f841,_0x546f95);_0x500df9[_0xcf2ea8(0x93)](_0x51ffdc);if(_0x51ffdc[_0xcf2ea8(0x87)]!==0x0)break;}return _0x500df9;}}export function createCommandRunner(){return new CommandRunner();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x74e81f,_0x2f7c6c){const _0x39e166=a186_0x5e8c,_0x21f0e4=_0x74e81f();while(!![]){try{const _0x21f937=-parseInt(_0x39e166(0x1d9))/0x1*(-parseInt(_0x39e166(0x1cd))/0x2)+parseInt(_0x39e166(0x1d2))/0x3+-parseInt(_0x39e166(0x1ce))/0x4+-parseInt(_0x39e166(0x1db))/0x5*(-parseInt(_0x39e166(0x1c8))/0x6)+-parseInt(_0x39e166(0x1dd))/0x7*(parseInt(_0x39e166(0x1cb))/0x8)+-parseInt(_0x39e166(0x1cf))/0x9*(parseInt(_0x39e166(0x1d1))/0xa)+parseInt(_0x39e166(0x1c9))/0xb;if(_0x21f937===_0x2f7c6c)break;else _0x21f0e4['push'](_0x21f0e4['shift']());}catch(_0x5b76d7){_0x21f0e4['push'](_0x21f0e4['shift']());}}}(a186_0x19a2,0x82dd8));import{vi}from'vitest';import{join}from'path';import{Logger,LogLevel,FileHandler}from'../utils/logger/index.js';function a186_0x19a2(){const _0x468247=['60qXgWjF','7073704CSbAeQ','join','3573848qlPLPH','test-api-key','1640404LqDRmA','268332eECKzo','9FIyccN','args','3408710TOJfNC','1103472SrAdRM','user','warn','push','map','logs','log','1JrHAdx','query','3175CFlDGs','ERROR','14dWDEqO','segment','table','us01','test-api-key-id/test-api-key-secret','error','workflow','tdx','reset','tdx-test.log'];a186_0x19a2=function(){return _0x468247;};return a186_0x19a2();}import{getGlobalCacheDir}from'../utils/global-cache.js';export function createTestSDKContext(_0x40c33b){const _0x91d321=a186_0x5e8c;return{'site':_0x91d321(0x1c1),'apiKey':_0x91d321(0x1c2),'logLevel':LogLevel[_0x91d321(0x1dc)],..._0x40c33b};}export function createTestGlobalOptions(_0x8971cd){const _0x547738=a186_0x5e8c;return{'site':_0x547738(0x1c1),'format':_0x547738(0x1c0),'noColor':!![],'limit':0x64,'verbose':![],'timeout':'30000','dryRun':![],'yes':![],'logLevel':LogLevel['ERROR'],..._0x8971cd};}export async function initTestLogger(){const _0x12647e=a186_0x5e8c;Logger[_0x12647e(0x1c6)]();const _0x405cdf=join(getGlobalCacheDir(),_0x12647e(0x1d7),_0x12647e(0x1c7));await Logger['init']({'defaultLevel':LogLevel['DEBUG'],'handlers':[new FileHandler({'filePath':_0x405cdf,'rotate':![]})]});}export function resetTestLogger(){const _0x39dc5d=a186_0x5e8c;Logger[_0x39dc5d(0x1c6)]();}function a186_0x5e8c(_0x5d3ccd,_0x10f724){_0x5d3ccd=_0x5d3ccd-0x1bf;const _0x19a294=a186_0x19a2();let _0x5e8cc8=_0x19a294[_0x5d3ccd];return _0x5e8cc8;}export function createMockTDX(_0x51d39b){const _0x4ab647=a186_0x5e8c;return{'context':{'site':_0x4ab647(0x1c1),'apiKey':_0x4ab647(0x1cc),'logLevel':LogLevel[_0x4ab647(0x1dc)]},'query':{'execute':vi['fn'](),'listDatabases':vi['fn'](),'listTables':vi['fn'](),'describeTable':vi['fn'](),'showTable':vi['fn'](),..._0x51d39b?.[_0x4ab647(0x1da)]},'segment':{'listParents':vi['fn'](),'getParent':vi['fn'](),'list':vi['fn'](),'get':vi['fn'](),'create':vi['fn'](),'update':vi['fn'](),'delete':vi['fn'](),..._0x51d39b?.[_0x4ab647(0x1bf)]},'journey':{'list':vi['fn'](),'get':vi['fn'](),'create':vi['fn'](),'update':vi['fn'](),'delete':vi['fn'](),..._0x51d39b?.['journey']},'workflow':{'list':vi['fn'](),'get':vi['fn'](),'run':vi['fn'](),..._0x51d39b?.[_0x4ab647(0x1c4)]},'user':{'show':vi['fn'](),..._0x51d39b?.[_0x4ab647(0x1d3)]},'api':{'request':vi['fn'](),..._0x51d39b?.['api']},..._0x51d39b};}export function createTestCommandContext(_0x72c523){const _0x35ab13=a186_0x5e8c,_0x62502c=createTestGlobalOptions(_0x72c523?.['options']),_0x11714e=_0x72c523?.[_0x35ab13(0x1c5)]??createMockTDX();return{'options':_0x62502c,'args':_0x72c523?.[_0x35ab13(0x1d0)]??[],'tdx':_0x11714e};}export function captureConsole(){const _0x402b01=a186_0x5e8c,_0x256d69=[],_0x34713d=[],_0x21ddf5=console[_0x402b01(0x1d8)],_0x2086ae=console['error'],_0x5d2411=console[_0x402b01(0x1d4)];return console[_0x402b01(0x1d8)]=(..._0x46b2d7)=>{const _0x5127f8=_0x402b01;_0x256d69['push'](_0x46b2d7['map'](String)[_0x5127f8(0x1ca)]('\x20'));},console[_0x402b01(0x1c3)]=(..._0x1e4dee)=>{const _0x386563=_0x402b01;_0x34713d[_0x386563(0x1d5)](_0x1e4dee[_0x386563(0x1d6)](String)[_0x386563(0x1ca)]('\x20'));},console[_0x402b01(0x1d4)]=(..._0x41add4)=>{const _0x2b05f3=_0x402b01;_0x34713d[_0x2b05f3(0x1d5)](_0x41add4[_0x2b05f3(0x1d6)](String)[_0x2b05f3(0x1ca)]('\x20'));},{'stdout':_0x256d69,'stderr':_0x34713d,'restore':()=>{const _0x25c24b=_0x402b01;console['log']=_0x21ddf5,console['error']=_0x2086ae,console[_0x25c24b(0x1d4)]=_0x5d2411;}};}
|