@treasuredata/tdx 2026.3.20 → 2026.3.21
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(_0x3d1109,_0x19476e){const _0x298fdd=a177_0xa9e4,_0x53dcfd=_0x3d1109();while(!![]){try{const _0x326d9b=-parseInt(_0x298fdd(0x1bf))/0x1*(-parseInt(_0x298fdd(0x1c5))/0x2)+parseInt(_0x298fdd(0x1c7))/0x3*(-parseInt(_0x298fdd(0x1bc))/0x4)+-parseInt(_0x298fdd(0x1db))/0x5*(-parseInt(_0x298fdd(0x1b9))/0x6)+parseInt(_0x298fdd(0x1d2))/0x7+parseInt(_0x298fdd(0x1ac))/0x8+parseInt(_0x298fdd(0x1c9))/0x9*(parseInt(_0x298fdd(0x1b1))/0xa)+-parseInt(_0x298fdd(0x1bb))/0xb;if(_0x326d9b===_0x19476e)break;else _0x53dcfd['push'](_0x53dcfd['shift']());}catch(_0x164297){_0x53dcfd['push'](_0x53dcfd['shift']());}}}(a177_0x10a0,0xc3686));import{formatRows,hyperlink}from'./formatters.js';import a177_0x434afb from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};function a177_0x10a0(){const _0x1ce8dc=['segment','\x20folder','getSegmentUrl','sort','folder','launched','6dEOIuV','├──\x20','29149791JuBWJD','44LtHZTC','join','└──\x20','332mVeVsO','type','🗺️\x20','dim','(running)','\x20\x20\x20','6340BxXetU','segmentCount','359913SCdzbX','(empty)','197019rXrNHo','journey','completed','(draft)','📁\x20','population','showIcons','metadata','journeyCount','10694754RrWXoT','length','push','state','\x20journey','folderCount','localeCompare','getJourneyUrl','base','7874260KdCViw','draft','indent','sortKey','\x20segment','showTreeLines','map','journeyBundleName','displayName','showMetadata','children','paused','2993096rjiFxj','(paused)','name','(completed)','🎯\x20','110gFFzoK','icon'];a177_0x10a0=function(){return _0x1ce8dc;};return a177_0x10a0();}export function formatTree(_0xc2a9fd,_0xb3250={},_0xd3b4c0=0x0,_0x218e5c=''){const _0x5c8dec=a177_0xa9e4,_0x475b40={...DEFAULT_OPTIONS,..._0xb3250},_0x50f5db=[],_0x763f36=[..._0xc2a9fd][_0x5c8dec(0x1b6)]((_0x397b6b,_0x2616bd)=>_0x397b6b[_0x5c8dec(0x1ae)][_0x5c8dec(0x1d8)](_0x2616bd[_0x5c8dec(0x1ae)],undefined,{'sensitivity':_0x5c8dec(0x1da)}));for(let _0x707587=0x0;_0x707587<_0x763f36['length'];_0x707587++){const _0x55240c=_0x763f36[_0x707587],_0xdf22d1=_0x707587===_0x763f36[_0x5c8dec(0x1d3)]-0x1;let _0x539d0d='';_0xd3b4c0>0x0&&(_0x539d0d+=_0x218e5c);_0x475b40[_0x5c8dec(0x1a5)]&&_0xd3b4c0>0x0&&(_0x539d0d+=a177_0x434afb[_0x5c8dec(0x1c2)](_0xdf22d1?_0x5c8dec(0x1be):_0x5c8dec(0x1ba)));if(_0x475b40[_0x5c8dec(0x1cf)]){if(_0x55240c[_0x5c8dec(0x1c0)]===_0x5c8dec(0x1b7))_0x539d0d+=_0x5c8dec(0x1cd);else _0x55240c[_0x5c8dec(0x1c0)]===_0x5c8dec(0x1ca)?_0x539d0d+=_0x5c8dec(0x1c1):_0x539d0d+=_0x5c8dec(0x1b0);}if(_0x475b40['getSegmentUrl']&&_0x55240c[_0x5c8dec(0x1c0)]==='segment')_0x539d0d+=hyperlink(_0x55240c['name'],_0x475b40[_0x5c8dec(0x1b5)](_0x55240c['id']));else _0x475b40[_0x5c8dec(0x1d9)]&&_0x55240c['type']==='journey'?_0x539d0d+=hyperlink(_0x55240c[_0x5c8dec(0x1ae)],_0x475b40['getJourneyUrl'](_0x55240c['id'])):_0x539d0d+=_0x55240c[_0x5c8dec(0x1ae)];if(_0x475b40['showMetadata']){if(_0x55240c[_0x5c8dec(0x1c0)]===_0x5c8dec(0x1b7)){const _0x5a1dc5=[];_0x55240c['metadata']['segmentCount']&&_0x5a1dc5['push'](_0x55240c[_0x5c8dec(0x1d0)][_0x5c8dec(0x1c6)]+_0x5c8dec(0x1a4)+(_0x55240c[_0x5c8dec(0x1d0)][_0x5c8dec(0x1c6)]!==0x1?'s':'')),_0x55240c[_0x5c8dec(0x1d0)][_0x5c8dec(0x1d7)]&&_0x5a1dc5['push'](_0x55240c[_0x5c8dec(0x1d0)][_0x5c8dec(0x1d7)]+_0x5c8dec(0x1b4)+(_0x55240c[_0x5c8dec(0x1d0)][_0x5c8dec(0x1d7)]!==0x1?'s':'')),_0x55240c[_0x5c8dec(0x1d0)][_0x5c8dec(0x1d1)]&&_0x5a1dc5[_0x5c8dec(0x1d4)](_0x55240c[_0x5c8dec(0x1d0)][_0x5c8dec(0x1d1)]+_0x5c8dec(0x1d6)+(_0x55240c['metadata'][_0x5c8dec(0x1d1)]!==0x1?'s':'')),_0x5a1dc5['length']>0x0&&(_0x539d0d+=a177_0x434afb[_0x5c8dec(0x1c2)]('\x20('+_0x5a1dc5[_0x5c8dec(0x1bd)](',\x20')+')'));}else{if(_0x55240c['type']===_0x5c8dec(0x1b3)&&_0x55240c['population']!==undefined)_0x539d0d+=a177_0x434afb[_0x5c8dec(0x1c2)]('\x20('+formatRows(_0x55240c[_0x5c8dec(0x1ce)])+')');else _0x55240c[_0x5c8dec(0x1c0)]==='journey'&&_0x55240c[_0x5c8dec(0x1d5)]&&(_0x539d0d+=a177_0x434afb[_0x5c8dec(0x1c2)]('\x20'+getJourneyStateIndicator(_0x55240c['state'])));}}_0x50f5db[_0x5c8dec(0x1d4)](_0x539d0d);if(_0x55240c['children']&&_0x55240c[_0x5c8dec(0x1aa)][_0x5c8dec(0x1d3)]>0x0){let _0x28f5d4;if(_0xd3b4c0===0x0)_0x28f5d4='';else _0x475b40[_0x5c8dec(0x1a5)]?_0x28f5d4=_0x218e5c+(_0xdf22d1?'\x20\x20\x20\x20':a177_0x434afb[_0x5c8dec(0x1c2)]('│')+_0x5c8dec(0x1c4)):_0x28f5d4=_0x218e5c+_0x475b40[_0x5c8dec(0x1dd)];const _0x3bfa92=formatTree(_0x55240c[_0x5c8dec(0x1aa)],_0x475b40,_0xd3b4c0+0x1,_0x28f5d4);_0x50f5db['push'](_0x3bfa92);}}return _0x50f5db['join']('\x0a');}function a177_0xa9e4(_0x28e5bf,_0x2a7394){_0x28e5bf=_0x28e5bf-0x1a3;const _0x10a015=a177_0x10a0();let _0xa9e424=_0x10a015[_0x28e5bf];return _0xa9e424;}export function formatFlatList(_0x2c11c1,_0x2e4456,_0x3dd390={},_0x20e891=[]){const _0x46bffd=a177_0xa9e4,_0x221857={...DEFAULT_OPTIONS,..._0x3dd390},_0x5c5680=[];for(const _0x8b3952 of _0x2c11c1){_0x5c5680[_0x46bffd(0x1d4)]({'sortKey':_0x8b3952[_0x46bffd(0x1ae)],'displayName':_0x8b3952[_0x46bffd(0x1ae)],'icon':_0x221857[_0x46bffd(0x1cf)]?'📁':'','metadata':undefined});}for(const _0x3f3a3e of _0x2e4456){const _0x3c323f=_0x221857[_0x46bffd(0x1a9)]&&_0x3f3a3e[_0x46bffd(0x1ce)]!==undefined?a177_0x434afb[_0x46bffd(0x1c2)]('\x20('+formatRows(_0x3f3a3e['population'])+')'):'',_0x273aa6=_0x221857[_0x46bffd(0x1b5)]?hyperlink(_0x3f3a3e[_0x46bffd(0x1ae)],_0x221857[_0x46bffd(0x1b5)](_0x3f3a3e['id'])):_0x3f3a3e[_0x46bffd(0x1ae)];_0x5c5680[_0x46bffd(0x1d4)]({'sortKey':_0x3f3a3e['name'],'displayName':_0x273aa6,'icon':_0x221857[_0x46bffd(0x1cf)]?'🎯':'','metadata':_0x3c323f});}for(const _0x1bdb3b of _0x20e891){const _0x3f04fe=getJourneyStateIndicator(_0x1bdb3b[_0x46bffd(0x1d5)]),_0x11abfd=_0x221857[_0x46bffd(0x1a9)]?a177_0x434afb['dim']('\x20'+_0x3f04fe):'',_0x3b49ab=_0x221857[_0x46bffd(0x1d9)]?hyperlink(_0x1bdb3b[_0x46bffd(0x1a7)],_0x221857[_0x46bffd(0x1d9)](_0x1bdb3b['id'])):_0x1bdb3b[_0x46bffd(0x1a7)];_0x5c5680[_0x46bffd(0x1d4)]({'sortKey':_0x1bdb3b[_0x46bffd(0x1a7)],'displayName':_0x3b49ab,'icon':_0x221857['showIcons']?'🗺️':'','metadata':_0x11abfd});}_0x5c5680[_0x46bffd(0x1b6)]((_0x3d450c,_0x10d4e3)=>_0x3d450c[_0x46bffd(0x1a3)][_0x46bffd(0x1d8)](_0x10d4e3[_0x46bffd(0x1a3)],undefined,{'sensitivity':_0x46bffd(0x1da)}));if(_0x5c5680[_0x46bffd(0x1d3)]===0x0)return _0x46bffd(0x1c8);const _0x1b62da=_0x5c5680[_0x46bffd(0x1a6)](_0x391f56=>{const _0x2a96bc=_0x46bffd,_0xbd15b5=_0x391f56[_0x2a96bc(0x1b2)]?_0x391f56[_0x2a96bc(0x1b2)]+'\x20':'',_0x39ac1c=_0x391f56[_0x2a96bc(0x1d0)]||'';return''+_0xbd15b5+_0x391f56[_0x2a96bc(0x1a8)]+_0x39ac1c;});return _0x1b62da[_0x46bffd(0x1bd)]('\x0a');}function getJourneyStateIndicator(_0x397f22){const _0x1f662a=a177_0xa9e4;switch(_0x397f22){case _0x1f662a(0x1dc):return _0x1f662a(0x1cc);case _0x1f662a(0x1b8):return _0x1f662a(0x1c3);case _0x1f662a(0x1ab):return _0x1f662a(0x1ad);case _0x1f662a(0x1cb):return _0x1f662a(0x1af);default:return'('+_0x397f22+')';}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a178_0x3b75(){const _0xd68b8e=['utf-8','subarray','1908595WmThni','trim','6lbYKaD','length','error','Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.','280384mryyCA','from','charCodeAt','slice','equals','2028JJQwGC','The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.','(empty\x20response)','...','Archive\x20validation\x20failed\x20with\x20unknown\x20error','822860TxkEMc','1995282LcmGXC','1458590lFIKiq','toString','Downloaded\x20archive\x20is\x20too\x20small\x20(','300526ZcRDKF','\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.','6286JyqNKE','3irpnqd','split'];a178_0x3b75=function(){return _0xd68b8e;};return a178_0x3b75();}const a178_0x15e485=a178_0x4e1f;(function(_0x19d2c4,_0x126157){const _0x4781e6=a178_0x4e1f,_0x1e3805=_0x19d2c4();while(!![]){try{const _0x1c517f=-parseInt(_0x4781e6(0x1f5))/0x1*(-parseInt(_0x4781e6(0x1f2))/0x2)+parseInt(_0x4781e6(0x1fb))/0x3*(-parseInt(_0x4781e6(0x1ed))/0x4)+parseInt(_0x4781e6(0x1f9))/0x5+-parseInt(_0x4781e6(0x204))/0x6*(parseInt(_0x4781e6(0x1f4))/0x7)+parseInt(_0x4781e6(0x1ff))/0x8+parseInt(_0x4781e6(0x1ee))/0x9+-parseInt(_0x4781e6(0x1ef))/0xa;if(_0x1c517f===_0x126157)break;else _0x1e3805['push'](_0x1e3805['shift']());}catch(_0x45303e){_0x1e3805['push'](_0x1e3805['shift']());}}}(a178_0x3b75,0x37c59));import{SDKError,ErrorCode}from'../errors.js';const GZIP_MAGIC=Buffer[a178_0x15e485(0x200)]([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x432507){const _0x4d0a86=a178_0x15e485;if(_0x432507[_0x4d0a86(0x1fc)]<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x432507['length'],'error':{'message':_0x4d0a86(0x1f1)+_0x432507[_0x4d0a86(0x1fc)]+_0x4d0a86(0x1f3),'preview':getContentPreview(_0x432507),'helpText':'Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.'}};if(!_0x432507[_0x4d0a86(0x1f8)](0x0,0x2)[_0x4d0a86(0x203)](GZIP_MAGIC)){const _0xfe871=getContentPreview(_0x432507),_0x302f42=_0xfe871?'\x20Server\x20response\x20preview:\x20'+_0xfe871:'';return{'isValid':![],'size':_0x432507[_0x4d0a86(0x1fc)],'error':{'message':_0x4d0a86(0x1fe)+_0x302f42,'preview':_0xfe871,'helpText':_0x4d0a86(0x205)}};}return{'isValid':!![],'size':_0x432507[_0x4d0a86(0x1fc)]};}function getContentPreview(_0x302c33){const _0x2eba01=a178_0x15e485;if(_0x302c33['length']===0x0)return _0x2eba01(0x206);const _0x5759e6=_0x302c33[_0x2eba01(0x1f8)](0x0,0xc8)[_0x2eba01(0x1f0)](_0x2eba01(0x1f7)),_0x46155b=_0x5759e6[_0x2eba01(0x1f6)]('')['filter'](_0x41fc02=>{const _0x67510d=_0x2eba01,_0x2335e2=_0x41fc02[_0x67510d(0x201)](0x0);return _0x2335e2>=0x20&&_0x2335e2<0x7f||_0x2335e2===0xa||_0x2335e2===0xd||_0x2335e2===0x9;})['length'],_0x22139e=_0x46155b/_0x5759e6['length'];if(_0x22139e>0.8){const _0x58f186=_0x5759e6[_0x2eba01(0x202)](0x0,0x64)[_0x2eba01(0x1fa)]();return _0x58f186[_0x2eba01(0x1fc)]<_0x5759e6[_0x2eba01(0x1fa)]()[_0x2eba01(0x1fc)]?_0x58f186+_0x2eba01(0x207):_0x58f186;}return undefined;}function a178_0x4e1f(_0x57e8fd,_0x46558a){_0x57e8fd=_0x57e8fd-0x1ec;const _0x3b7560=a178_0x3b75();let _0x4e1fac=_0x3b7560[_0x57e8fd];return _0x4e1fac;}export function throwArchiveValidationError(_0x50de1d){const _0x5df9b6=a178_0x15e485;if(!_0x50de1d['error'])throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x5df9b6(0x1ec));throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x50de1d['error']['message'],undefined,{'helpText':_0x50de1d[_0x5df9b6(0x1fd)]['helpText']});}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x51beaa,_0x344302){const _0x486c9e=a179_0x30bf,_0x3e896e=_0x51beaa();while(!![]){try{const _0x164ea6=-parseInt(_0x486c9e(0xf3))/0x1+-parseInt(_0x486c9e(0xf8))/0x2+-parseInt(_0x486c9e(0xef))/0x3*(parseInt(_0x486c9e(0x108))/0x4)+-parseInt(_0x486c9e(0x10b))/0x5*(-parseInt(_0x486c9e(0x100))/0x6)+-parseInt(_0x486c9e(0x10d))/0x7*(parseInt(_0x486c9e(0xf2))/0x8)+-parseInt(_0x486c9e(0x102))/0x9+parseInt(_0x486c9e(0xf6))/0xa;if(_0x164ea6===_0x344302)break;else _0x3e896e['push'](_0x3e896e['shift']());}catch(_0x23d337){_0x3e896e['push'](_0x3e896e['shift']());}}}(a179_0x3edf,0x77be9));import{promises as a179_0x5bf120}from'fs';import a179_0x275ba9 from'path';import a179_0x1dda6b from'os';function a179_0x3edf(){const _0x5388d1=['name','toISOString','3267SJaQRT','Source\x20directory\x20not\x20found:\x20','replace','1832CjHptE','255182zwASjS','mkdtemp','length','26933000vIIVRs','workflow_project','662630SaOJWW','tmpdir','create','join','find','sourceDir','skipValidation','push','11112JqZVjt','readdir','432009AArLhf','listProjects','revision','access','data','\x20workflow\x20files\x20found\x20in\x20','3512LBialj','tar','tdx-wf-clone-','555cYbMnd','filter','24997lUDHjy','newProjectName'];a179_0x3edf=function(){return _0x5388d1;};return a179_0x3edf();}import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';export async function prepareCloneWorkflow(_0x20c28a,_0x5e9a8c,_0x35a72d,_0x11cee4={}){const _0x20e0da=a179_0x30bf,{client:_0x5e209d}=_0x20c28a,_0x3bb2e1=a179_0x275ba9['resolve'](_0x5e9a8c);try{await a179_0x5bf120[_0x20e0da(0x105)](_0x3bb2e1);}catch{throw new Error(_0x20e0da(0xf0)+_0x5e9a8c);}const _0x121e80=tryFindWorkflowTdxConfig(_0x3bb2e1),_0x382ad3=_0x121e80?.['config'][_0x20e0da(0xf7)],_0x1d6ddb=_0x11cee4['revision']||new Date()[_0x20e0da(0xee)]()[_0x20e0da(0xf1)](/[:.]/g,'-');if(!_0x11cee4[_0x20e0da(0xfe)]){const _0x44c6b8=await a179_0x5bf120[_0x20e0da(0x101)](_0x3bb2e1),_0x2ac230=_0x44c6b8[_0x20e0da(0x10c)](_0x57eb42=>_0x57eb42['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x2ac230[_0x20e0da(0xf5)]===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+_0x20e0da(0x107)+_0x3bb2e1);}const _0x2fff8e=await getProjectFiles(_0x3bb2e1);let _0x57857d=![],_0x2881cf;try{const _0x59aa1e=await _0x5e209d[_0x20e0da(0x103)]({'name_pattern':_0x35a72d}),_0x5c2049=_0x59aa1e[_0x20e0da(0x106)][_0x20e0da(0xfc)](_0x1cdb13=>_0x1cdb13[_0x20e0da(0xed)]===_0x35a72d);_0x5c2049&&(_0x57857d=!![],_0x2881cf=_0x5c2049['id']);}catch{}return{'sourceDir':_0x3bb2e1,'sourceProjectName':_0x382ad3,'newProjectName':_0x35a72d,'revision':_0x1d6ddb,'fileCount':_0x2fff8e[_0x20e0da(0xf5)],'files':_0x2fff8e,'targetExists':_0x57857d,'existingProjectId':_0x2881cf};}function a179_0x30bf(_0x482451,_0xaeeb42){_0x482451=_0x482451-0xec;const _0x3edf8f=a179_0x3edf();let _0x30bf40=_0x3edf8f[_0x482451];return _0x30bf40;}export async function executeCloneWorkflow(_0x4f4252,_0x13e9d1){const _0x4e747e=a179_0x30bf,_0x2a4573=await import(_0x4e747e(0x109)),{client:_0x57bfe5}=_0x4f4252,_0x249fa1=await getProjectFiles(_0x13e9d1[_0x4e747e(0xfd)]),_0xb6b6a9=await a179_0x5bf120[_0x4e747e(0xf4)](a179_0x275ba9[_0x4e747e(0xfb)](a179_0x1dda6b[_0x4e747e(0xf9)](),_0x4e747e(0x10a))),_0x34fff9=a179_0x275ba9[_0x4e747e(0xfb)](_0xb6b6a9,'archive.tar.gz');try{await _0x2a4573[_0x4e747e(0xfa)]({'file':_0x34fff9,'gzip':!![],'cwd':_0x13e9d1[_0x4e747e(0xfd)],'portable':!![]},_0x249fa1);const _0x1476b7=await _0x57bfe5['uploadProjectArchive'](_0x13e9d1[_0x4e747e(0xec)],_0x13e9d1[_0x4e747e(0x104)],_0x34fff9);return{'sourceDir':_0x13e9d1[_0x4e747e(0xfd)],'sourceProjectName':_0x13e9d1['sourceProjectName'],'newProjectName':_0x1476b7[_0x4e747e(0xed)],'newProjectId':_0x1476b7['id'],'revision':_0x1476b7[_0x4e747e(0x104)],'fileCount':_0x249fa1[_0x4e747e(0xf5)],'files':_0x249fa1};}finally{await a179_0x5bf120['rm'](_0xb6b6a9,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x5f0366,_0x2b7afb=''){const _0x45ccc4=a179_0x30bf,_0x3ae45d=[],_0x204be4=await a179_0x5bf120[_0x45ccc4(0x101)](_0x5f0366,{'withFileTypes':!![]});for(const _0x3d90d9 of _0x204be4){const _0x5c776d=_0x2b7afb?a179_0x275ba9[_0x45ccc4(0xfb)](_0x2b7afb,_0x3d90d9[_0x45ccc4(0xed)]):_0x3d90d9['name'];if(_0x3d90d9[_0x45ccc4(0xed)]==='tdx.json')continue;if(!shouldIncludeInArchive(_0x3d90d9[_0x45ccc4(0xed)]))continue;if(_0x3d90d9['isDirectory']()){const _0x4fc8af=await getProjectFiles(a179_0x275ba9[_0x45ccc4(0xfb)](_0x5f0366,_0x3d90d9[_0x45ccc4(0xed)]),_0x5c776d);_0x3ae45d[_0x45ccc4(0xff)](..._0x4fc8af);}else _0x3ae45d[_0x45ccc4(0xff)](_0x5c776d);}return _0x3ae45d;}
|
|
@@ -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
|
+
const a180_0x453b94=a180_0x2107;function a180_0x2107(_0x312a87,_0x5c9963){_0x312a87=_0x312a87-0x1e0;const _0x5a9f85=a180_0x5a9f();let _0x2107c3=_0x5a9f85[_0x312a87];return _0x2107c3;}(function(_0x4afe81,_0x455fd6){const _0x1b9e31=a180_0x2107,_0x2d38f7=_0x4afe81();while(!![]){try{const _0x185ac4=parseInt(_0x1b9e31(0x259))/0x1+parseInt(_0x1b9e31(0x228))/0x2*(parseInt(_0x1b9e31(0x230))/0x3)+parseInt(_0x1b9e31(0x248))/0x4+-parseInt(_0x1b9e31(0x203))/0x5+parseInt(_0x1b9e31(0x20e))/0x6*(-parseInt(_0x1b9e31(0x1e7))/0x7)+parseInt(_0x1b9e31(0x24b))/0x8*(parseInt(_0x1b9e31(0x21d))/0x9)+parseInt(_0x1b9e31(0x235))/0xa*(-parseInt(_0x1b9e31(0x222))/0xb);if(_0x185ac4===_0x455fd6)break;else _0x2d38f7['push'](_0x2d38f7['shift']());}catch(_0x1aeebb){_0x2d38f7['push'](_0x2d38f7['shift']());}}}(a180_0x5a9f,0xec3ce));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0xbf1456,_0xde4449,_0x462866=0x64){const _0x2ceabb=a180_0x2107,_0x5b541f=Math[_0x2ceabb(0x1eb)](_0xde4449,MAX_PAGINATION_LIMIT),_0x4ba3de=[];let _0x438f61;while(_0x4ba3de[_0x2ceabb(0x21a)]<_0x5b541f){const _0x419d2e=await _0xbf1456(_0x462866,_0x438f61),_0x1368d1=_0x419d2e[_0x2ceabb(0x24c)]??_0x419d2e['data'][_0x2ceabb(0x21a)];if(_0x1368d1===0x0)break;_0x4ba3de['push'](..._0x419d2e[_0x2ceabb(0x246)]);if(!_0x419d2e[_0x2ceabb(0x1f8)]||_0x1368d1<_0x462866)break;_0x438f61=_0x419d2e[_0x2ceabb(0x1f8)];}return _0x4ba3de['slice'](0x0,_0x5b541f);}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_0x453b94(0x257)]=/^\d+$/;[a180_0x453b94(0x24a)];constructor(_0x2e7d57){const _0x2760bb=a180_0x453b94;this[_0x2760bb(0x24a)]=new WorkflowApiClient(_0x2e7d57);}async[a180_0x453b94(0x224)](_0x2d3747){const _0x2f165d=a180_0x453b94;if(WorkflowSDK[_0x2f165d(0x257)][_0x2f165d(0x247)](_0x2d3747)){const _0x56a3a0=await this['client']['getProject'](_0x2d3747);return{'id':_0x56a3a0['id'],'name':_0x56a3a0[_0x2f165d(0x205)]};}const _0xbb4444=await this[_0x2f165d(0x24a)][_0x2f165d(0x1fc)]({'name_pattern':_0x2d3747}),_0xf359d8=_0xbb4444['data']['find'](_0x2bc914=>_0x2bc914[_0x2f165d(0x205)]===_0x2d3747);if(!_0xf359d8)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],_0x2f165d(0x250)+_0x2d3747);return{'id':_0xf359d8['id'],'name':_0xf359d8[_0x2f165d(0x205)]};}async[a180_0x453b94(0x237)](_0x3feb2a,_0x5da1a2){const _0x40d0ba=a180_0x453b94,_0xb13f43=_0x5da1a2?.['limit']||0x64,_0x2dcf11=await paginateResults((_0x5c045b,_0x4a0361)=>this['client'][_0x40d0ba(0x1fc)]({'name_pattern':_0x3feb2a,'limit':_0x5c045b,'last_id':_0x4a0361??_0x5da1a2?.[_0x40d0ba(0x1fd)]}),_0xb13f43);return _0x2dcf11[_0x40d0ba(0x258)](_0x4a2be0=>({..._0x4a2be0,'project_id':_0x4a2be0['id'],'project_name':_0x4a2be0[_0x40d0ba(0x205)]}));}async[a180_0x453b94(0x254)](_0x16c3db,_0x2563a7){const _0x4b62da=a180_0x453b94,_0x395852=_0x2563a7?.['limit']||0x64,_0x49a872=await paginateResults((_0x5f5ad2,_0x57e73b)=>this['client'][_0x4b62da(0x1f9)]({'project_name':_0x16c3db,'limit':_0x5f5ad2,'last_id':_0x57e73b??_0x2563a7?.[_0x4b62da(0x1fd)]}),_0x395852);return _0x49a872[_0x4b62da(0x258)](_0x477cec=>({'project_id':_0x477cec['project']?.['id'],'project_name':_0x477cec[_0x4b62da(0x256)]?.[_0x4b62da(0x205)],'workflow_id':_0x477cec['id'],'workflow_name':_0x477cec[_0x4b62da(0x205)],'revision':_0x477cec['revision'],'timezone':_0x477cec[_0x4b62da(0x217)],'config':_0x477cec[_0x4b62da(0x23c)],'id':_0x477cec['id'],'name':_0x477cec['name'],'project':_0x477cec[_0x4b62da(0x256)]}));}async[a180_0x453b94(0x1f1)](_0x354538){const _0x3c97cd=a180_0x453b94;let _0xa9bded;if(_0x354538?.[_0x3c97cd(0x200)]){let _0xec4ddd,_0xbfe054=![];while(!_0xbfe054){const _0x29254b=await this[_0x3c97cd(0x24a)][_0x3c97cd(0x1fc)]({'limit':0x64,'last_id':_0xec4ddd}),_0x27ae94=_0x29254b[_0x3c97cd(0x246)][_0x3c97cd(0x216)](_0x2fc162=>_0x2fc162['name']===_0x354538['projectName']);if(_0x27ae94){_0xa9bded=_0x27ae94['id'],_0xbfe054=!![];break;}if(!_0x29254b[_0x3c97cd(0x1f8)]||_0x29254b['data'][_0x3c97cd(0x21a)]===0x0)break;_0xec4ddd=_0x29254b['lastId'];}if(!_0xa9bded)throw new SDKError(ErrorCode[_0x3c97cd(0x251)],_0x3c97cd(0x250)+_0x354538[_0x3c97cd(0x200)]);}const _0x1107eb=_0x354538?.['limit']||0x64,_0x7789a0=await paginateResults((_0x11f5f5,_0x1a2c63)=>this['client'][_0x3c97cd(0x21e)]({'project_id':_0xa9bded,'project_name':_0x354538?.[_0x3c97cd(0x200)],'workflow_name':_0x354538?.[_0x3c97cd(0x255)],'status':_0x354538?.[_0x3c97cd(0x215)],'from_time':_0x354538?.['fromTime'],'to_time':_0x354538?.[_0x3c97cd(0x252)],'limit':_0x11f5f5,'last_id':_0x1a2c63??_0x354538?.[_0x3c97cd(0x1fd)]}),_0x1107eb);return _0x7789a0[_0x3c97cd(0x258)](_0x3fb27f=>({'project_id':_0x3fb27f[_0x3c97cd(0x256)]?.['id'],'project_name':_0x3fb27f['project']?.[_0x3c97cd(0x205)],'workflow_id':_0x3fb27f['workflow']?.['id'],'workflow_name':_0x3fb27f['workflow']?.[_0x3c97cd(0x205)],'session_id':_0x3fb27f['id'],'sessionUuid':_0x3fb27f['sessionUuid'],'sessionTime':_0x3fb27f['sessionTime'],'lastAttempt':_0x3fb27f[_0x3c97cd(0x201)],'id':_0x3fb27f['id'],'project':_0x3fb27f[_0x3c97cd(0x256)],'workflow':_0x3fb27f['workflow']}));}async[a180_0x453b94(0x1e3)](_0x11f47b){const _0xdc2190=a180_0x453b94,_0x15103f=_0x11f47b?.[_0xdc2190(0x253)]||0x64,_0x11d513=await paginateResults((_0x532d40,_0x1d0494)=>this[_0xdc2190(0x24a)][_0xdc2190(0x1ea)]({'project_name':_0x11f47b?.[_0xdc2190(0x200)],'workflow_name':_0x11f47b?.[_0xdc2190(0x255)],'include_retried':_0x11f47b?.[_0xdc2190(0x21b)],'limit':_0x532d40,'last_id':_0x1d0494??_0x11f47b?.[_0xdc2190(0x1fd)]}),_0x15103f);return _0x11d513[_0xdc2190(0x258)](_0x14af89=>({'project_id':_0x14af89[_0xdc2190(0x256)]?.['id'],'project_name':_0x14af89['project']?.['name'],'workflow_id':_0x14af89[_0xdc2190(0x22a)]?.['id'],'workflow_name':_0x14af89[_0xdc2190(0x22a)]?.['name'],'session_id':_0x14af89['sessionId'],'sessionUuid':_0x14af89[_0xdc2190(0x23f)],'sessionTime':_0x14af89[_0xdc2190(0x23e)],'attempt_id':_0x14af89['id'],'attempt_index':_0x14af89[_0xdc2190(0x1e2)],'retryAttemptName':_0x14af89[_0xdc2190(0x1f0)],'done':_0x14af89[_0xdc2190(0x223)],'success':_0x14af89[_0xdc2190(0x220)],'cancelRequested':_0x14af89[_0xdc2190(0x23b)],'params':_0x14af89['params'],'createdAt':_0x14af89[_0xdc2190(0x23d)],'finishedAt':_0x14af89[_0xdc2190(0x210)],'id':_0x14af89['id'],'index':_0x14af89[_0xdc2190(0x1e2)],'project':_0x14af89[_0xdc2190(0x256)],'workflow':_0x14af89['workflow']}));}async['attempt'](_0x84d26a){const _0xbdedf3=a180_0x453b94,_0xcd7519=await this[_0xbdedf3(0x24a)][_0xbdedf3(0x1ed)](_0x84d26a);return _0xcd7519;}async['tasks'](_0x3ed648,_0x1b8222=![]){const _0xa54131=a180_0x453b94,_0x3ac08e=await this[_0xa54131(0x24a)][_0xa54131(0x22f)](_0x3ed648,_0x1b8222);return _0x3ac08e[_0xa54131(0x258)](_0x2e3f04=>({'task_id':_0x2e3f04['id'],'task_name':_0x2e3f04[_0xa54131(0x20d)],'parentId':_0x2e3f04['parentId'],'config':_0x2e3f04[_0xa54131(0x23c)],'upstreams':_0x2e3f04['upstreams'],'state':_0x2e3f04[_0xa54131(0x229)],'exportParams':_0x2e3f04['exportParams'],'storeParams':_0x2e3f04[_0xa54131(0x218)],'stateParams':_0x2e3f04[_0xa54131(0x1f3)],'updatedAt':_0x2e3f04[_0xa54131(0x1f7)],'retryAt':_0x2e3f04['retryAt'],'startedAt':_0x2e3f04['startedAt'],'error':_0x2e3f04[_0xa54131(0x22c)],'isGroup':_0x2e3f04[_0xa54131(0x233)],'id':_0x2e3f04['id'],'fullName':_0x2e3f04[_0xa54131(0x20d)]}));}async['logFiles'](_0x5d5851,_0x402b07){const _0xf632ee=a180_0x453b94;return await this[_0xf632ee(0x24a)][_0xf632ee(0x25a)](_0x5d5851,_0x402b07);}async['logs'](_0x359cfe,_0x2bcc73){const _0x50ece7=a180_0x453b94,_0x163095=await import(_0x50ece7(0x234)),{promisify:_0xe66b66}=await import(_0x50ece7(0x22e)),_0x1514df=_0xe66b66(_0x163095['gunzip']),_0x54a73c=await this[_0x50ece7(0x24a)][_0x50ece7(0x25a)](_0x359cfe,_0x2bcc73);if(_0x54a73c[_0x50ece7(0x21a)]===0x0)return'';const _0x51ad7b=[];for(const _0x2c5771 of _0x54a73c){if(!_0x2c5771['direct'])continue;const _0x69f075=await fetch(_0x2c5771[_0x50ece7(0x1e6)]);if(!_0x69f075['ok'])throw new Error('Failed\x20to\x20download\x20log\x20file:\x20'+_0x69f075[_0x50ece7(0x215)]);const _0x1ffb03=Buffer[_0x50ece7(0x1e8)](await _0x69f075['arrayBuffer']()),_0x1776a5=await _0x1514df(_0x1ffb03);_0x51ad7b[_0x50ece7(0x21c)](_0x1776a5[_0x50ece7(0x24e)]('utf-8'));}return _0x51ad7b[_0x50ece7(0x245)]('\x0a');}async[a180_0x453b94(0x1fe)](_0x45e1f9,_0x5be59f){const _0x1731b2=a180_0x453b94,_0x4667a4=await this[_0x1731b2(0x24a)][_0x1731b2(0x1e0)](_0x45e1f9,_0x5be59f);return _0x4667a4?.[_0x1731b2(0x232)]??_0x1731b2(0x206);}async[a180_0x453b94(0x1f6)](_0x513537,_0x1ecb7b){const _0x217357=a180_0x453b94,_0x92102a=await this[_0x217357(0x24a)][_0x217357(0x1f6)](_0x513537,{'from_task':_0x1ecb7b?.['fromTask'],'retry_params':_0x1ecb7b?.[_0x217357(0x240)]});return{'attemptId':_0x92102a['id'],'sessionId':_0x92102a['sessionId']};}async[a180_0x453b94(0x212)](_0x456cdc,_0xe8052f){const _0xd81707=a180_0x453b94,_0x54ce28=await this[_0xd81707(0x24a)][_0xd81707(0x212)](_0x456cdc,{'resume_from':_0xe8052f?.['resumeFrom'],'retry_params':_0xe8052f?.[_0xd81707(0x240)],'force':_0xe8052f?.['force']});return{'attemptId':_0x54ce28['id'],'sessionId':_0x54ce28[_0xd81707(0x204)]};}async['run'](_0x5e7485,_0x134a4f={},_0x44295d){const _0x38c4f0=a180_0x453b94,_0x4c8fe5=_0x5e7485['indexOf']('.');let _0x31e934,_0x323d81;if(_0x4c8fe5===-0x1)throw new Error(_0x38c4f0(0x236));_0x31e934=_0x5e7485[_0x38c4f0(0x208)](0x0,_0x4c8fe5),_0x323d81=_0x5e7485[_0x38c4f0(0x208)](_0x4c8fe5+0x1);if(!_0x31e934||!_0x323d81)throw new Error(_0x38c4f0(0x22b)+_0x5e7485+_0x38c4f0(0x20c));const _0x570e58=_0x44295d?.[_0x38c4f0(0x23e)]||new Date()[_0x38c4f0(0x221)]();return await this[_0x38c4f0(0x24a)][_0x38c4f0(0x249)]({'projectName':_0x31e934,'workflowName':_0x323d81,'sessionTime':_0x570e58,'params':_0x134a4f});}async[a180_0x453b94(0x214)](_0x49d4ac,_0x20932a,_0x52613e){const _0x5f179b=a180_0x453b94,{promises:_0x1c1d8d}=await import('fs'),_0x583265=await import(_0x5f179b(0x243)),_0x48653b=await import('os'),_0xba036=await import(_0x5f179b(0x209)),{id:_0x525661,name:_0x27a361}=await this[_0x5f179b(0x224)](_0x49d4ac),_0x39cff1=_0x48653b['tmpdir'](),_0x234147=_0x583265[_0x5f179b(0x245)](_0x39cff1,_0x5f179b(0x1fa)+_0x525661+'-'+Date[_0x5f179b(0x225)]()+_0x5f179b(0x213));try{await this[_0x5f179b(0x24a)][_0x5f179b(0x231)](_0x525661,_0x234147,_0x52613e?.[_0x5f179b(0x24f)]);const _0x35d9f4=_0x583265['join'](_0x20932a,_0x27a361);await _0x1c1d8d[_0x5f179b(0x207)](_0x35d9f4,{'recursive':!![]}),await _0xba036[_0x5f179b(0x20f)]({'file':_0x234147,'cwd':_0x35d9f4,'gzip':!![]});const _0x2e8506=async _0x3bbd64=>{const _0x4df33f=_0x5f179b;let _0x355554=0x0;const _0x490ed5=await _0x1c1d8d[_0x4df33f(0x1e4)](_0x3bbd64,{'withFileTypes':!![]});for(const _0x859566 of _0x490ed5){const _0x226b38=_0x583265[_0x4df33f(0x245)](_0x3bbd64,_0x859566[_0x4df33f(0x205)]);if(_0x859566[_0x4df33f(0x1f2)]())_0x355554++;else _0x859566[_0x4df33f(0x227)]()&&(_0x355554+=await _0x2e8506(_0x226b38));}return _0x355554;},_0x4faab3=await _0x2e8506(_0x35d9f4);return{'projectName':_0x27a361,'revision':_0x52613e?.[_0x5f179b(0x24f)]||_0x5f179b(0x211),'filesExtracted':_0x4faab3};}finally{try{await _0x1c1d8d['unlink'](_0x234147);}catch{}}}async[a180_0x453b94(0x21c)](_0x486ec5,_0x5e5339){const _0x3ee6f5=a180_0x453b94,{promises:_0x4bb3ee}=await import('fs'),_0xcf1918=await import('path'),_0x45ed38=await import(_0x3ee6f5(0x209)),_0x630ccf=_0x5e5339?.[_0x3ee6f5(0x200)]||_0xcf1918[_0x3ee6f5(0x241)](_0x486ec5),_0x2bdacc=_0x5e5339?.[_0x3ee6f5(0x24f)]||new Date()['toISOString']()['replace'](/[:.]/g,'-');try{await _0x4bb3ee['access'](_0x486ec5);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0x486ec5);}if(!_0x5e5339?.['skipValidation']){const _0x2da0e4=await _0x4bb3ee[_0x3ee6f5(0x1e4)](_0x486ec5),_0x59ddf1=_0x2da0e4[_0x3ee6f5(0x25c)](_0x821eaa=>_0x821eaa[_0x3ee6f5(0x25b)](WORKFLOW_FILE_EXTENSION));if(_0x59ddf1[_0x3ee6f5(0x21a)]===0x0)throw new Error(_0x3ee6f5(0x226)+WORKFLOW_FILE_EXTENSION+_0x3ee6f5(0x1f5));for(const _0x3cf362 of _0x59ddf1){const _0x11662a=_0xcf1918[_0x3ee6f5(0x245)](_0x486ec5,_0x3cf362);try{await _0x4bb3ee[_0x3ee6f5(0x20b)](_0x11662a);}catch{throw new Error(_0x3ee6f5(0x1e9)+_0x3cf362);}}}const _0xfc1d57=async(_0x203559,_0x4f7695='')=>{const _0x130223=_0x3ee6f5,_0x318e50=await _0x4bb3ee['readdir'](_0x203559,{'withFileTypes':!![]}),_0x54d357=[];for(const _0x278782 of _0x318e50){const _0x4bb49c=_0xcf1918[_0x130223(0x245)](_0x4f7695,_0x278782[_0x130223(0x205)]),_0x3e8881=_0xcf1918[_0x130223(0x245)](_0x203559,_0x278782['name']);if(!shouldIncludeInArchive(_0x278782[_0x130223(0x205)]))continue;_0x278782['isDirectory']()?_0x54d357['push'](...await _0xfc1d57(_0x3e8881,_0x4bb49c)):_0x54d357[_0x130223(0x21c)](_0x4bb49c);}return _0x54d357;},_0x302458=await _0xfc1d57(_0x486ec5),_0x2a62e3=await import('os'),_0x57043c=_0x2a62e3[_0x3ee6f5(0x244)](),_0x12ee39=_0xcf1918[_0x3ee6f5(0x245)](_0x57043c,'tdx-workflow-push-'+Date['now']()+_0x3ee6f5(0x213));try{await _0x45ed38[_0x3ee6f5(0x21f)]({'file':_0x12ee39,'gzip':!![],'cwd':_0x486ec5,'portable':!![]},_0x302458);const _0x3c82bd=await this[_0x3ee6f5(0x24a)]['uploadProjectArchive'](_0x630ccf,_0x2bdacc,_0x12ee39,{'scheduleFrom':_0x5e5339?.[_0x3ee6f5(0x24d)],'clearSchedule':_0x5e5339?.[_0x3ee6f5(0x1ee)],'clearScheduleAll':_0x5e5339?.['clearScheduleAll']});return{'projectId':_0x3c82bd['id'],'projectName':_0x3c82bd[_0x3ee6f5(0x205)],'revision':_0x3c82bd[_0x3ee6f5(0x24f)]};}finally{try{await _0x4bb3ee[_0x3ee6f5(0x239)](_0x12ee39);}catch{}}}async['delete'](_0xc1ab2){const _0xe0be7c=a180_0x453b94,{id:_0x1c6a2b}=await this[_0xe0be7c(0x224)](_0xc1ab2),_0xdd63a8=await this[_0xe0be7c(0x24a)][_0xe0be7c(0x1e1)](_0x1c6a2b);return{'projectId':_0xdd63a8['id'],'projectName':_0xdd63a8[_0xe0be7c(0x205)]};}async['listSecrets'](_0x3923d6){const _0x3668b8=a180_0x453b94,{id:_0x312171,name:_0x5cdfcd}=await this[_0x3668b8(0x224)](_0x3923d6),_0x435aa0=await this['client'][_0x3668b8(0x22d)](_0x312171);return{'projectName':_0x5cdfcd,'secrets':_0x435aa0};}async[a180_0x453b94(0x1e5)](_0xa804ef,_0x42f59d,_0x5c5acb){const _0x547300=a180_0x453b94,{id:_0x481aeb,name:_0x13d412}=await this[_0x547300(0x224)](_0xa804ef);return await this['client'][_0x547300(0x1e5)](_0x481aeb,_0x42f59d,_0x5c5acb),{'projectName':_0x13d412,'key':_0x42f59d};}async['setSecrets'](_0x307706,_0x5eb991){const _0x4019bb=a180_0x453b94,{id:_0x31123b,name:_0x400346}=await this[_0x4019bb(0x224)](_0x307706),_0x35bde2=Object[_0x4019bb(0x242)](_0x5eb991),_0x39b94b=await Promise[_0x4019bb(0x1ff)](_0x35bde2[_0x4019bb(0x258)](_0x581e1c=>this['client']['setSecret'](_0x31123b,_0x581e1c,_0x5eb991[_0x581e1c]))),_0x4d344c=_0x39b94b[_0x4019bb(0x258)]((_0x18daf9,_0x5d066b)=>_0x18daf9[_0x4019bb(0x215)]===_0x4019bb(0x238)?_0x35bde2[_0x5d066b]:null)['filter'](_0x4a9e53=>_0x4a9e53!==null);if(_0x4d344c['length']>0x0)throw new SDKError(ErrorCode[_0x4019bb(0x1ec)],_0x4019bb(0x20a)+(_0x4d344c[_0x4019bb(0x21a)]>0x1?'s':'')+':\x20'+_0x4d344c['join'](',\x20'));return{'projectName':_0x400346,'keys':_0x35bde2};}async[a180_0x453b94(0x1f4)](_0x439266,_0x1b2823){const _0x5ce0ec=a180_0x453b94,{id:_0x233c34,name:_0x51d704}=await this[_0x5ce0ec(0x224)](_0x439266);return await this[_0x5ce0ec(0x24a)]['deleteSecret'](_0x233c34,_0x1b2823),{'projectName':_0x51d704,'key':_0x1b2823};}async[a180_0x453b94(0x202)](_0x50538e,_0x202450){const _0x560067=a180_0x453b94;return pullWorkflow({'client':this[_0x560067(0x24a)],'resolveProjectId':this[_0x560067(0x224)][_0x560067(0x1ef)](this)},_0x50538e,_0x202450);}async[a180_0x453b94(0x23a)](_0x55f220,_0x42d67f){const _0xb13576=a180_0x453b94;return applyPullResult({'client':this[_0xb13576(0x24a)],'resolveProjectId':this[_0xb13576(0x224)][_0xb13576(0x1ef)](this)},_0x55f220,_0x42d67f);}async[a180_0x453b94(0x1fb)](_0x297522){const _0x1a22c4=a180_0x453b94;return preparePushWorkflow({'client':this['client'],'resolveProjectId':this[_0x1a22c4(0x224)][_0x1a22c4(0x1ef)](this)},_0x297522);}async[a180_0x453b94(0x219)](_0x3df4fd){const _0x38c305=a180_0x453b94;return executePushWorkflow({'client':this[_0x38c305(0x24a)],'resolveProjectId':this[_0x38c305(0x224)][_0x38c305(0x1ef)](this)},_0x3df4fd);}async['prepareCloneProject'](_0x455a33,_0x906a06,_0x3f2f56){return prepareCloneWorkflow({'client':this['client']},_0x455a33,_0x906a06,_0x3f2f56);}async['executeCloneProject'](_0x381df4){return executeCloneWorkflow({'client':this['client']},_0x381df4);}}function a180_0x5a9f(){const _0x4410c9=['extract','finishedAt','latest','retryAttempt','.tar.gz','download','status','find','timezone','storeParams','executePushProject','length','includeRetried','push','9CuTNTZ','listSessions','create','success','toISOString','44yAHgsO','done','resolveProjectId','now','No\x20','isDirectory','58GQRaDq','state','workflow','Invalid\x20workflow\x20format:\x20','error','listSecrets','util','getAttemptTasks','100461sFAPbL','downloadProjectArchive','message','isGroup','zlib','1067600ggYZbB','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','projects','rejected','unlink','applyPullProject','cancelRequested','config','createdAt','sessionTime','sessionUuid','retryParams','basename','keys','path','tmpdir','join','data','test','266556DOFYqL','startAttempt','client','8006072ZXmceI','rawCount','scheduleFrom','toString','revision','Project\x20not\x20found:\x20','WORKFLOW_PROJECT_NOT_FOUND','toTime','limit','workflows','workflowName','project','NUMERIC_ID_PATTERN','map','1148008QJaNkO','listLogFiles','endsWith','filter','killAttempt','deleteProject','index','attempts','readdir','setSecret','direct','75747KUWFnX','from','Cannot\x20read\x20workflow\x20file:\x20','listAttempts','min','WORKFLOW_SECRET_SET_FAILED','getAttempt','clearSchedule','bind','retryAttemptName','sessions','isFile','stateParams','deleteSecret','\x20workflow\x20files\x20found\x20in\x20project\x20directory','retrySession','updatedAt','lastId','listWorkflows','tdx-workflow-','preparePushProject','listProjects','last_id','kill','allSettled','projectName','lastAttempt','pullProject','3170060zShWec','sessionId','name','Kill\x20request\x20accepted','mkdir','substring','tar','Failed\x20to\x20set\x20secret','access','.\x20Expected\x20\x22project.workflow\x22','fullName','642geOFiL'];a180_0x5a9f=function(){return _0x4410c9;};return a180_0x5a9f();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
(function(_0x2911b7,_0x3049e3){const _0x4154d5=a181_0x3a51,_0x3611b9=_0x2911b7();while(!![]){try{const _0x1a0576=-parseInt(_0x4154d5(0x1ca))/0x1+-parseInt(_0x4154d5(0x1be))/0x2*(-parseInt(_0x4154d5(0x1d9))/0x3)+parseInt(_0x4154d5(0x1e2))/0x4*(-parseInt(_0x4154d5(0x1c5))/0x5)+parseInt(_0x4154d5(0x1cb))/0x6*(-parseInt(_0x4154d5(0x1d8))/0x7)+parseInt(_0x4154d5(0x1e0))/0x8+parseInt(_0x4154d5(0x1bb))/0x9+parseInt(_0x4154d5(0x1bf))/0xa;if(_0x1a0576===_0x3049e3)break;else _0x3611b9['push'](_0x3611b9['shift']());}catch(_0x155ee0){_0x3611b9['push'](_0x3611b9['shift']());}}}(a181_0x23b2,0x59a7d));function a181_0x3a51(_0x9a2eba,_0x183c71){_0x9a2eba=_0x9a2eba-0x1b0;const _0x23b2ab=a181_0x23b2();let _0x3a51b0=_0x23b2ab[_0x9a2eba];return _0x3a51b0;}function a181_0x23b2(){const _0x336392=['20HklzEi','path','cwd','localeCompare','tar','archive.tar.gz','name','type','getProject','readFile','readdir','tmpdir','new','catch','tdx.json','WORKFLOW_ARCHIVE_CORRUPTED','size','downloadProjectArchive','writeFile','\x20bytes)','6596973fxQABL','\x20(archive\x20size:\x20','revision','940634wifisc','3822660VbCKgJ','targetDir','includes','mkdir','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','unchanged','603685HQEypT','baseDir','The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.','join','stat','475544BZQtWh','6678URVUSg','has','message','projectName','toISOString','deleted','add','utf-8','zlib','TAR_BAD_ARCHIVE','projectId','Failed\x20to\x20extract\x20project\x20archive','extract','3241OUAaFW','3gfRfPS','isDirectory','latest','isNewProject','length','modified','filter','3009576hjVBzF','push'];a181_0x23b2=function(){return _0x336392;};return a181_0x23b2();}import{existsSync,promises as a181_0x2f56f6}from'fs';import a181_0x34a369 from'path';import a181_0x3cd3d7 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{getWorkflowProjectDir,createWorkflowTdxConfigContent,updateWorkflowTdxConfig}from'./tdx-config.js';import{SDKError,ErrorCode}from'../errors.js';export async function pullWorkflow(_0x392f0e,_0x3ee8ba,_0x2adcd6={}){const _0x1adc0d=a181_0x3a51,_0x3b5464=await import(_0x1adc0d(0x1e6)),{client:_0x2bc349,resolveProjectId:_0x187a5f}=_0x392f0e,{id:_0x2ff07c,name:_0x4c5b4c}=await _0x187a5f(_0x3ee8ba),_0x25b39b=_0x2adcd6[_0x1adc0d(0x1c6)]||process[_0x1adc0d(0x1e4)](),_0x4ad63a=_0x2adcd6[_0x1adc0d(0x1c0)]||getWorkflowProjectDir(_0x4c5b4c,_0x25b39b),_0x3c5994=a181_0x34a369['join'](_0x4ad63a,_0x1adc0d(0x1b5)),_0x17f7bb=!existsSync(_0x3c5994),_0x312ef2=await a181_0x2f56f6['mkdtemp'](a181_0x34a369[_0x1adc0d(0x1c8)](a181_0x3cd3d7[_0x1adc0d(0x1b2)](),'tdx-wf-pull-')),_0x22e6b0=a181_0x34a369['join'](_0x312ef2,'archive.tar.gz'),_0xc5e435=a181_0x34a369[_0x1adc0d(0x1c8)](_0x312ef2,'extracted');try{await _0x2bc349['downloadProjectArchive'](_0x2ff07c,_0x22e6b0,_0x2adcd6['revision']),await a181_0x2f56f6[_0x1adc0d(0x1c2)](_0xc5e435,{'recursive':!![]});try{await _0x3b5464[_0x1adc0d(0x1d7)]({'file':_0x22e6b0,'cwd':_0xc5e435,'gzip':!![]});}catch(_0x1447e0){const _0x24ced0=_0x1447e0 instanceof Error?_0x1447e0['message']:String(_0x1447e0);if(_0x24ced0[_0x1adc0d(0x1c1)](_0x1adc0d(0x1d4))||_0x24ced0[_0x1adc0d(0x1c1)]('zlib')){const _0x14cb6f=await a181_0x2f56f6[_0x1adc0d(0x1c9)](_0x22e6b0)['catch'](()=>null),_0x52f568=_0x14cb6f?_0x1adc0d(0x1bc)+_0x14cb6f[_0x1adc0d(0x1b7)]+_0x1adc0d(0x1ba):'';throw new SDKError(ErrorCode[_0x1adc0d(0x1b6)],_0x1adc0d(0x1d6)+_0x52f568+':\x20'+_0x24ced0,_0x1447e0,{'helpText':_0x1adc0d(0x1c3)+'The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.'});}throw _0x1447e0;}const _0x291440=await _0x2bc349[_0x1adc0d(0x1ea)](_0x2ff07c),_0x7fa72a=_0x2adcd6[_0x1adc0d(0x1bd)]||_0x291440[_0x1adc0d(0x1bd)]||_0x1adc0d(0x1db),_0x186b34=await calculateChanges(_0x4ad63a,_0xc5e435,_0x17f7bb),_0x41f820={'new':_0x186b34[_0x1adc0d(0x1df)](_0xe5adc2=>_0xe5adc2[_0x1adc0d(0x1e9)]==='new')[_0x1adc0d(0x1dd)],'modified':_0x186b34[_0x1adc0d(0x1df)](_0x388b05=>_0x388b05[_0x1adc0d(0x1e9)]==='modified')[_0x1adc0d(0x1dd)],'deleted':_0x186b34[_0x1adc0d(0x1df)](_0x1487f8=>_0x1487f8[_0x1adc0d(0x1e9)]===_0x1adc0d(0x1d0))[_0x1adc0d(0x1dd)],'unchanged':_0x186b34[_0x1adc0d(0x1df)](_0xeec2f1=>_0xeec2f1['type']===_0x1adc0d(0x1c4))['length']};return{'projectName':_0x4c5b4c,'projectId':_0x2ff07c,'revision':_0x7fa72a,'targetDir':_0x4ad63a,'changes':_0x186b34,'summary':_0x41f820,'hasChanges':_0x41f820[_0x1adc0d(0x1b3)]>0x0||_0x41f820[_0x1adc0d(0x1de)]>0x0||_0x41f820[_0x1adc0d(0x1d0)]>0x0,'isNewProject':_0x17f7bb};}finally{await a181_0x2f56f6['rm'](_0x312ef2,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0xa0574d,_0x18d973,_0x2dd8bd={}){const _0x3aa567=a181_0x3a51,_0x404b93=await import('tar'),{client:_0x467a38}=_0xa0574d,_0x39f683=await a181_0x2f56f6['mkdtemp'](a181_0x34a369[_0x3aa567(0x1c8)](a181_0x3cd3d7[_0x3aa567(0x1b2)](),'tdx-wf-apply-')),_0x5da0bc=a181_0x34a369[_0x3aa567(0x1c8)](_0x39f683,_0x3aa567(0x1e7));try{await _0x467a38[_0x3aa567(0x1b8)](_0x18d973[_0x3aa567(0x1d5)],_0x5da0bc,_0x2dd8bd[_0x3aa567(0x1bd)]),await a181_0x2f56f6['mkdir'](_0x18d973[_0x3aa567(0x1c0)],{'recursive':!![]});for(const _0x4155be of _0x18d973['changes']){if(_0x4155be['type']==='deleted'){const _0x4db440=a181_0x34a369[_0x3aa567(0x1c8)](_0x18d973[_0x3aa567(0x1c0)],_0x4155be[_0x3aa567(0x1e3)]);await a181_0x2f56f6['unlink'](_0x4db440)[_0x3aa567(0x1b4)](()=>{});}}try{await _0x404b93[_0x3aa567(0x1d7)]({'file':_0x5da0bc,'cwd':_0x18d973[_0x3aa567(0x1c0)],'gzip':!![]});}catch(_0x1a9a34){const _0x5bf97b=_0x1a9a34 instanceof Error?_0x1a9a34[_0x3aa567(0x1cd)]:String(_0x1a9a34);if(_0x5bf97b[_0x3aa567(0x1c1)](_0x3aa567(0x1d4))||_0x5bf97b['includes'](_0x3aa567(0x1d3))){const _0x2cb65f=await a181_0x2f56f6['stat'](_0x5da0bc)['catch'](()=>null),_0x35e92c=_0x2cb65f?_0x3aa567(0x1bc)+_0x2cb65f[_0x3aa567(0x1b7)]+_0x3aa567(0x1ba):'';throw new SDKError(ErrorCode[_0x3aa567(0x1b6)],_0x3aa567(0x1d6)+_0x35e92c+':\x20'+_0x5bf97b,_0x1a9a34,{'helpText':_0x3aa567(0x1c3)+_0x3aa567(0x1c7)});}throw _0x1a9a34;}const _0x3c7b85=a181_0x34a369[_0x3aa567(0x1c8)](_0x18d973['targetDir'],_0x3aa567(0x1b5));if(_0x18d973[_0x3aa567(0x1dc)]){const _0x36c0cd=createWorkflowTdxConfigContent(_0x18d973[_0x3aa567(0x1ce)],_0x18d973[_0x3aa567(0x1d5)],_0x18d973['revision']);await a181_0x2f56f6[_0x3aa567(0x1b9)](_0x3c7b85,_0x36c0cd,_0x3aa567(0x1d2));}else updateWorkflowTdxConfig(_0x3c7b85,{'last_pulled_revision':_0x18d973[_0x3aa567(0x1bd)],'last_pulled_at':new Date()[_0x3aa567(0x1cf)]()});}finally{await a181_0x2f56f6['rm'](_0x39f683,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x5571ab,_0x144c50,_0x3704c0){const _0x1bd765=a181_0x3a51,_0x505f65=[],_0xdc117a=await getAllFiles(_0x144c50),_0x4710ab=existsSync(_0x5571ab)?await getAllFiles(_0x5571ab):new Set();for(const _0x49c6fa of _0xdc117a){const _0xfeed6c=a181_0x34a369[_0x1bd765(0x1c8)](_0x5571ab,_0x49c6fa),_0x29a8cc=a181_0x34a369[_0x1bd765(0x1c8)](_0x144c50,_0x49c6fa);if(_0x49c6fa===_0x1bd765(0x1b5))continue;const _0x4d370d=await a181_0x2f56f6['readFile'](_0x29a8cc,_0x1bd765(0x1d2))[_0x1bd765(0x1b4)](()=>null);if(_0x4d370d===null)continue;if(!existsSync(_0xfeed6c)||_0x3704c0)_0x505f65[_0x1bd765(0x1e1)]({'path':_0x49c6fa,'type':_0x1bd765(0x1b3),'newContent':_0x4d370d});else{const _0x24a4b5=await a181_0x2f56f6[_0x1bd765(0x1b0)](_0xfeed6c,_0x1bd765(0x1d2))[_0x1bd765(0x1b4)](()=>null);if(_0x24a4b5===null)_0x505f65[_0x1bd765(0x1e1)]({'path':_0x49c6fa,'type':_0x1bd765(0x1de),'newContent':_0x4d370d});else{if(_0x24a4b5!==_0x4d370d){const _0x5852f9=generateDiff(_0x24a4b5,_0x4d370d),_0xc4eaaa=hasChanges(_0x5852f9)?formatDiffWithColors(_0x5852f9):undefined;_0x505f65[_0x1bd765(0x1e1)]({'path':_0x49c6fa,'type':_0x1bd765(0x1de),'oldContent':_0x24a4b5,'newContent':_0x4d370d,'diff':_0xc4eaaa});}else _0x505f65['push']({'path':_0x49c6fa,'type':_0x1bd765(0x1c4)});}}}if(!_0x3704c0)for(const _0x23ee09 of _0x4710ab){if(_0x23ee09===_0x1bd765(0x1b5))continue;if(!_0xdc117a[_0x1bd765(0x1cc)](_0x23ee09)){const _0x545a56=a181_0x34a369[_0x1bd765(0x1c8)](_0x5571ab,_0x23ee09),_0x2e786b=await a181_0x2f56f6[_0x1bd765(0x1b0)](_0x545a56,'utf-8')[_0x1bd765(0x1b4)](()=>undefined);_0x505f65['push']({'path':_0x23ee09,'type':'deleted','oldContent':_0x2e786b});}}return _0x505f65['sort']((_0x361291,_0x3d2e63)=>_0x361291[_0x1bd765(0x1e3)][_0x1bd765(0x1e5)](_0x3d2e63[_0x1bd765(0x1e3)])),_0x505f65;}async function getAllFiles(_0x34dcdf,_0x5a7631=''){const _0x5584dc=a181_0x3a51,_0x329401=new Set();if(!existsSync(_0x34dcdf))return _0x329401;const _0x572da7=await a181_0x2f56f6[_0x5584dc(0x1b1)](_0x34dcdf,{'withFileTypes':!![]});for(const _0x217a70 of _0x572da7){const _0x524ece=_0x5a7631?a181_0x34a369['join'](_0x5a7631,_0x217a70[_0x5584dc(0x1e8)]):_0x217a70[_0x5584dc(0x1e8)];if(_0x217a70[_0x5584dc(0x1da)]()){const _0x25c84e=await getAllFiles(a181_0x34a369['join'](_0x34dcdf,_0x217a70[_0x5584dc(0x1e8)]),_0x524ece);for(const _0x55d3f6 of _0x25c84e){_0x329401[_0x5584dc(0x1d1)](_0x55d3f6);}}else _0x329401[_0x5584dc(0x1d1)](_0x524ece);}return _0x329401;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x34012b,_0x4f6315){const _0x2ac152=a182_0x264d,_0x2fe8be=_0x34012b();while(!![]){try{const _0x2854b7=-parseInt(_0x2ac152(0x115))/0x1+parseInt(_0x2ac152(0x12d))/0x2+-parseInt(_0x2ac152(0x12b))/0x3+-parseInt(_0x2ac152(0x106))/0x4*(-parseInt(_0x2ac152(0x107))/0x5)+-parseInt(_0x2ac152(0x13e))/0x6+-parseInt(_0x2ac152(0x110))/0x7*(-parseInt(_0x2ac152(0x13a))/0x8)+parseInt(_0x2ac152(0x126))/0x9*(parseInt(_0x2ac152(0x116))/0xa);if(_0x2854b7===_0x4f6315)break;else _0x2fe8be['push'](_0x2fe8be['shift']());}catch(_0x15f402){_0x2fe8be['push'](_0x2fe8be['shift']());}}}(a182_0x1fbe,0xa5285));import{promises as a182_0x547073}from'fs';import a182_0x59a39d from'path';import a182_0x15a2de from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a182_0x264d(_0x487fc1,_0x2eb52d){_0x487fc1=_0x487fc1-0x104;const _0x1fbebf=a182_0x1fbe();let _0x264d98=_0x1fbebf[_0x487fc1];return _0x264d98;}import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';import{SDKError,ErrorCode}from'../errors.js';export async function preparePushWorkflow(_0x5f1285,_0x84b23c={}){const _0x563664=a182_0x264d,_0x1a10b8=await import(_0x563664(0x111)),{client:_0x5ae111,resolveProjectId:_0x286aab}=_0x5f1285,_0x41fb1a=_0x84b23c[_0x563664(0x135)]||process[_0x563664(0x118)](),_0x3483b5=findWorkflowTdxConfig(_0x41fb1a),{config:_0x4ba165,configDir:_0x2a74ca}=_0x3483b5;let _0x54da3d,_0x46633a=_0x4ba165[_0x563664(0x129)];try{const _0x134d4d=await _0x286aab(_0x4ba165[_0x563664(0x129)]);_0x54da3d=_0x134d4d['id'],_0x46633a=_0x134d4d['name'];}catch{_0x54da3d='';}const _0x363c31=_0x84b23c[_0x563664(0x13b)]||new Date()['toISOString']()[_0x563664(0x132)](/[:.]/g,'-');if(!_0x84b23c[_0x563664(0x122)]){const _0x482f32=await a182_0x547073[_0x563664(0x114)](_0x2a74ca),_0x8771a0=_0x482f32[_0x563664(0x13f)](_0x5559fd=>_0x5559fd[_0x563664(0x10f)](WORKFLOW_FILE_EXTENSION));if(_0x8771a0[_0x563664(0x119)]===0x0)throw new Error(_0x563664(0x124)+WORKFLOW_FILE_EXTENSION+_0x563664(0x12f)+_0x2a74ca);}const _0x42864a=await getProjectFiles(_0x2a74ca);let _0x2d8ddf;if(_0x54da3d){const _0x5e3401=await a182_0x547073[_0x563664(0x13c)](a182_0x59a39d['join'](a182_0x15a2de[_0x563664(0x139)](),_0x563664(0x11c))),_0x5377cc=a182_0x59a39d[_0x563664(0x121)](_0x5e3401,_0x563664(0x120)),_0x9bb568=a182_0x59a39d[_0x563664(0x121)](_0x5e3401,_0x563664(0x137));try{await _0x5ae111[_0x563664(0x108)](_0x54da3d,_0x5377cc),await a182_0x547073[_0x563664(0x10b)](_0x9bb568,{'recursive':!![]});try{await _0x1a10b8[_0x563664(0x133)]({'file':_0x5377cc,'cwd':_0x9bb568,'gzip':!![]});}catch(_0x431460){const _0x23b7f7=_0x431460 instanceof Error?_0x431460[_0x563664(0x127)]:String(_0x431460);if(_0x23b7f7[_0x563664(0x123)]('TAR_BAD_ARCHIVE')||_0x23b7f7[_0x563664(0x123)]('zlib')){const _0x3ba952=await a182_0x547073[_0x563664(0x11e)](_0x5377cc)[_0x563664(0x11a)](()=>null),_0xa55995=_0x3ba952?_0x563664(0x12a)+_0x3ba952[_0x563664(0x130)]+'\x20bytes)':'';throw new SDKError(ErrorCode[_0x563664(0x12c)],_0x563664(0x10c)+_0xa55995+':\x20'+_0x23b7f7,_0x431460,{'helpText':_0x563664(0x12e)});}throw _0x431460;}_0x2d8ddf=await calculatePushChanges(_0x2a74ca,_0x9bb568,_0x42864a);}finally{await a182_0x547073['rm'](_0x5e3401,{'recursive':!![],'force':!![]});}}else{_0x2d8ddf=[];for(const _0x4229f3 of _0x42864a){const _0x29899f=a182_0x59a39d['join'](_0x2a74ca,_0x4229f3),_0x1b7592=await a182_0x547073[_0x563664(0x128)](_0x29899f,_0x563664(0x104))['catch'](()=>null);_0x2d8ddf['push']({'path':_0x4229f3,'type':_0x563664(0x10d),'newContent':_0x1b7592||undefined});}}const _0x2d43ba={'new':_0x2d8ddf[_0x563664(0x13f)](_0x5f14eb=>_0x5f14eb['type']===_0x563664(0x10d))[_0x563664(0x119)],'modified':_0x2d8ddf['filter'](_0x59253f=>_0x59253f[_0x563664(0x10e)]===_0x563664(0x13d))[_0x563664(0x119)],'deleted':_0x2d8ddf[_0x563664(0x13f)](_0x15096d=>_0x15096d[_0x563664(0x10e)]==='deleted')[_0x563664(0x119)],'unchanged':_0x2d8ddf[_0x563664(0x13f)](_0x101eb6=>_0x101eb6[_0x563664(0x10e)]===_0x563664(0x125))[_0x563664(0x119)]};return{'projectName':_0x46633a,'projectId':_0x54da3d,'revision':_0x363c31,'sourceDir':_0x2a74ca,'changes':_0x2d8ddf,'summary':_0x2d43ba,'hasChanges':_0x2d43ba['new']>0x0||_0x2d43ba[_0x563664(0x13d)]>0x0||_0x2d43ba['deleted']>0x0,'configResult':_0x3483b5};}export async function executePushWorkflow(_0x37a6b8,_0x222af2){const _0x17c94e=a182_0x264d,_0x24cd1a=await import(_0x17c94e(0x111)),{client:_0x25f2e4}=_0x37a6b8,_0x5ecd83=await getProjectFiles(_0x222af2['sourceDir']),_0xa8aed1=await a182_0x547073[_0x17c94e(0x13c)](a182_0x59a39d['join'](a182_0x15a2de[_0x17c94e(0x139)](),'tdx-wf-push-archive-')),_0x52da34=a182_0x59a39d[_0x17c94e(0x121)](_0xa8aed1,'archive.tar.gz');try{await _0x24cd1a[_0x17c94e(0x113)]({'file':_0x52da34,'gzip':!![],'cwd':_0x222af2['sourceDir'],'portable':!![]},_0x5ecd83);const _0xd9f546=await _0x25f2e4[_0x17c94e(0x117)](_0x222af2[_0x17c94e(0x11d)],_0x222af2[_0x17c94e(0x13b)],_0x52da34);return updateWorkflowTdxConfig(_0x222af2['configResult']['configPath'],{'workflow_project_id':_0xd9f546['id'],'last_pushed_revision':_0xd9f546[_0x17c94e(0x13b)],'last_pushed_at':new Date()[_0x17c94e(0x11f)]()}),{'projectId':_0xd9f546['id'],'projectName':_0xd9f546['name'],'revision':_0xd9f546[_0x17c94e(0x13b)]};}finally{await a182_0x547073['rm'](_0xa8aed1,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x3715df,_0x48d6f2=_0x3715df,_0x1a2f16='',_0x6082c5=null){const _0x14af51=a182_0x264d,_0x19c1a9=[];if(_0x6082c5===null){_0x6082c5=createIgnoreInstance();const _0x2b3074=await loadDigdagignore(_0x3715df);_0x2b3074&&_0x6082c5['add'](_0x2b3074);}if(_0x1a2f16!==''){const _0x363eb3=await loadDigdagignore(_0x48d6f2);_0x363eb3&&addScopedPatterns(_0x6082c5,_0x363eb3,_0x1a2f16);}const _0xc19464=await a182_0x547073[_0x14af51(0x114)](_0x48d6f2,{'withFileTypes':!![]});for(const _0x3d9373 of _0xc19464){const _0x51dcd4=_0x1a2f16?a182_0x59a39d[_0x14af51(0x134)]['join'](_0x1a2f16,_0x3d9373[_0x14af51(0x131)]):_0x3d9373[_0x14af51(0x131)];if(_0x3d9373[_0x14af51(0x131)]===_0x14af51(0x138))continue;if(_0x3d9373['name']==='.digdagignore')continue;if(!shouldIncludeInArchive(_0x3d9373[_0x14af51(0x131)]))continue;if(shouldIgnoreWithInstance(_0x6082c5,_0x51dcd4,_0x3d9373[_0x14af51(0x109)]()))continue;if(_0x3d9373[_0x14af51(0x109)]()){const _0x4412cd=await getProjectFiles(_0x3715df,a182_0x59a39d['join'](_0x48d6f2,_0x3d9373[_0x14af51(0x131)]),_0x51dcd4,_0x6082c5);_0x19c1a9[_0x14af51(0x10a)](..._0x4412cd);}else _0x19c1a9[_0x14af51(0x10a)](_0x51dcd4);}return _0x19c1a9;}function a182_0x1fbe(){const _0x328f18=['downloadProjectArchive','isDirectory','push','mkdir','Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison','new','type','endsWith','7jQeUxN','tar','path','create','readdir','830046UrrbnE','10OoDepy','uploadProjectArchive','cwd','length','catch','has','tdx-wf-push-','projectName','stat','toISOString','archive.tar.gz','join','skipValidation','includes','No\x20','unchanged','19119897yGDUul','message','readFile','workflow_project','\x20(archive\x20size:\x20','158823qRXhnI','WORKFLOW_ARCHIVE_CORRUPTED','560070Iacsls','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','\x20workflow\x20files\x20found\x20in\x20','size','name','replace','extract','posix','sourceDir','localeCompare','extracted','tdx.json','tmpdir','3112424rXqhlb','revision','mkdtemp','modified','7577622CzRGqk','filter','utf-8','deleted','736jAXbIK','785vGpCiZ'];a182_0x1fbe=function(){return _0x328f18;};return a182_0x1fbe();}async function calculatePushChanges(_0x4bf36b,_0x248b5c,_0x1fef2a){const _0x145102=a182_0x264d,_0x152cbe=[],_0x358537=new Set(await getProjectFiles(_0x248b5c));for(const _0x2c4dd1 of _0x1fef2a){const _0xd483b=a182_0x59a39d[_0x145102(0x121)](_0x4bf36b,_0x2c4dd1),_0x165898=a182_0x59a39d[_0x145102(0x121)](_0x248b5c,_0x2c4dd1),_0x31320f=await a182_0x547073[_0x145102(0x128)](_0xd483b,_0x145102(0x104))['catch'](()=>null);if(_0x31320f===null)continue;if(!_0x358537[_0x145102(0x11b)](_0x2c4dd1))_0x152cbe[_0x145102(0x10a)]({'path':_0x2c4dd1,'type':_0x145102(0x10d),'newContent':_0x31320f});else{const _0x4c5c98=await a182_0x547073['readFile'](_0x165898,_0x145102(0x104))[_0x145102(0x11a)](()=>null);if(_0x4c5c98===null)_0x152cbe[_0x145102(0x10a)]({'path':_0x2c4dd1,'type':_0x145102(0x13d),'newContent':_0x31320f});else{if(_0x4c5c98!==_0x31320f){const _0x1df801=generateDiff(_0x4c5c98,_0x31320f),_0x2744a9=hasChanges(_0x1df801)?formatDiffWithColors(_0x1df801):undefined;_0x152cbe[_0x145102(0x10a)]({'path':_0x2c4dd1,'type':_0x145102(0x13d),'oldContent':_0x4c5c98,'newContent':_0x31320f,'diff':_0x2744a9});}else _0x152cbe[_0x145102(0x10a)]({'path':_0x2c4dd1,'type':_0x145102(0x125)});}}}for(const _0x25d614 of _0x358537){if(!_0x1fef2a[_0x145102(0x123)](_0x25d614)){const _0x505dae=a182_0x59a39d['join'](_0x248b5c,_0x25d614),_0x2c5cba=await a182_0x547073['readFile'](_0x505dae,'utf-8')['catch'](()=>undefined);_0x152cbe[_0x145102(0x10a)]({'path':_0x25d614,'type':_0x145102(0x105),'oldContent':_0x2c5cba});}}return _0x152cbe['sort']((_0x5c527c,_0x4dcd15)=>_0x5c527c[_0x145102(0x112)][_0x145102(0x136)](_0x4dcd15[_0x145102(0x112)])),_0x152cbe;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a183_0x106a20=a183_0x1b90;function a183_0x1b90(_0xb84e62,_0x375fb9){_0xb84e62=_0xb84e62-0xf5;const _0x37b020=a183_0x37b0();let _0x1b90cd=_0x37b020[_0xb84e62];return _0x1b90cd;}(function(_0xd30188,_0x225b6a){const _0x232a4f=a183_0x1b90,_0x26107f=_0xd30188();while(!![]){try{const _0x3914bc=-parseInt(_0x232a4f(0x101))/0x1+-parseInt(_0x232a4f(0xfd))/0x2+-parseInt(_0x232a4f(0xf5))/0x3+parseInt(_0x232a4f(0xff))/0x4+-parseInt(_0x232a4f(0x108))/0x5+parseInt(_0x232a4f(0x10f))/0x6+parseInt(_0x232a4f(0xf7))/0x7;if(_0x3914bc===_0x225b6a)break;else _0x26107f['push'](_0x26107f['shift']());}catch(_0x580f41){_0x26107f['push'](_0x26107f['shift']());}}}(a183_0x37b0,0xb365e));import{existsSync,readFileSync,writeFileSync}from'fs';import a183_0xd75af6 from'path';const TDX_CONFIG_FILE=a183_0x106a20(0xfa),WORKFLOWS_DIR=a183_0x106a20(0x105);export function findWorkflowTdxConfigPath(_0x159954=process[a183_0x106a20(0x10e)]()){const _0x592327=a183_0x106a20;let _0x34a99c=a183_0xd75af6[_0x592327(0xfe)](_0x159954);const _0x749997=a183_0xd75af6[_0x592327(0x103)](_0x34a99c)[_0x592327(0xf8)];while(_0x34a99c!==_0x749997){const _0x29c438=a183_0xd75af6['join'](_0x34a99c,TDX_CONFIG_FILE);if(existsSync(_0x29c438))try{const _0xce46da=readFileSync(_0x29c438,_0x592327(0x10a)),_0x17f8f3=JSON[_0x592327(0x103)](_0xce46da);if(_0x17f8f3&&typeof _0x17f8f3===_0x592327(0x10b)&&'workflow_project'in _0x17f8f3)return _0x29c438;}catch{}_0x34a99c=a183_0xd75af6[_0x592327(0x102)](_0x34a99c);}return null;}export function loadWorkflowTdxConfig(_0x326ca2){const _0x158fff=a183_0x106a20,_0x177db6=readFileSync(_0x326ca2,_0x158fff(0x10a));let _0x44160b;try{_0x44160b=JSON[_0x158fff(0x103)](_0x177db6);}catch{throw new Error(_0x158fff(0x10c)+_0x326ca2);}if(!_0x44160b||typeof _0x44160b!==_0x158fff(0x10b))throw new Error(_0x158fff(0x100));const _0x5484ea=_0x44160b;if(!_0x5484ea[_0x158fff(0xf6)]||typeof _0x5484ea[_0x158fff(0xf6)]!=='string')throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field');return{'workflow_project':_0x5484ea['workflow_project'],'workflow_project_id':typeof _0x5484ea[_0x158fff(0x104)]===_0x158fff(0xf9)?_0x5484ea[_0x158fff(0x104)]:undefined,'last_pulled_revision':typeof _0x5484ea[_0x158fff(0xfb)]===_0x158fff(0xf9)?_0x5484ea[_0x158fff(0xfb)]:undefined,'last_pulled_at':typeof _0x5484ea[_0x158fff(0x107)]===_0x158fff(0xf9)?_0x5484ea[_0x158fff(0x107)]:undefined,'last_pushed_revision':typeof _0x5484ea[_0x158fff(0x109)]===_0x158fff(0xf9)?_0x5484ea[_0x158fff(0x109)]:undefined,'last_pushed_at':typeof _0x5484ea[_0x158fff(0x10d)]==='string'?_0x5484ea['last_pushed_at']:undefined};}export function findWorkflowTdxConfig(_0x179e00=process['cwd']()){const _0x4e0d90=a183_0x106a20,_0x34a27a=findWorkflowTdxConfigPath(_0x179e00);if(!_0x34a27a)throw new Error('No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x1bfe0d=loadWorkflowTdxConfig(_0x34a27a),_0x8dd04c=a183_0xd75af6[_0x4e0d90(0x102)](_0x34a27a);return{'config':_0x1bfe0d,'configPath':_0x34a27a,'configDir':_0x8dd04c};}export function tryFindWorkflowTdxConfig(_0x153be1){try{return findWorkflowTdxConfig(_0x153be1);}catch{return null;}}function a183_0x37b0(){const _0x3c0b3c=['workflows','join','last_pulled_at','6198255dZPaYV','last_pushed_revision','utf-8','object','Invalid\x20JSON\x20in\x20','last_pushed_at','cwd','7158186srAJpO','2211615VDyoRJ','workflow_project','21450919cEaJNi','root','string','tdx.json','last_pulled_revision','toISOString','2156346AQsIAL','resolve','3972256XBeYNL','Invalid\x20tdx.json:\x20expected\x20object','1460669ySdbyU','dirname','parse','workflow_project_id'];a183_0x37b0=function(){return _0x3c0b3c;};return a183_0x37b0();}export function getWorkflowProjectDir(_0xc71f67,_0x2b1a0d=process[a183_0x106a20(0x10e)]()){const _0x45ac1c=a183_0x106a20;return a183_0xd75af6[_0x45ac1c(0x106)](_0x2b1a0d,WORKFLOWS_DIR,_0xc71f67);}export function getWorkflowTdxConfigPath(_0xff5ff3,_0x295d82=process[a183_0x106a20(0x10e)]()){const _0x5513ce=a183_0x106a20;return a183_0xd75af6[_0x5513ce(0x106)](getWorkflowProjectDir(_0xff5ff3,_0x295d82),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x29dd2a,_0x22ce8d,_0x36e3b6){const _0x5b899c=a183_0x106a20,_0x2c5a0d={'workflow_project':_0x29dd2a,..._0x22ce8d&&{'workflow_project_id':_0x22ce8d},..._0x36e3b6&&{'last_pulled_revision':_0x36e3b6},'last_pulled_at':new Date()[_0x5b899c(0xfc)]()};return JSON['stringify'](_0x2c5a0d,null,0x2)+'\x0a';}export function saveWorkflowTdxConfig(_0x2f2cb4,_0x56eb79){const _0x475085=JSON['stringify'](_0x56eb79,null,0x2)+'\x0a';writeFileSync(_0x2f2cb4,_0x475085,'utf-8');}export function updateWorkflowTdxConfig(_0x205240,_0x52e2a9){const _0x374d9f=loadWorkflowTdxConfig(_0x205240),_0x56450e={..._0x374d9f,..._0x52e2a9};saveWorkflowTdxConfig(_0x205240,_0x56450e);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x1671f7,_0x2fca83){const _0x2384e1=a184_0x4406,_0x2ce4d2=_0x1671f7();while(!![]){try{const _0x587bad=-parseInt(_0x2384e1(0x168))/0x1+parseInt(_0x2384e1(0x15d))/0x2+parseInt(_0x2384e1(0x153))/0x3+-parseInt(_0x2384e1(0x163))/0x4+-parseInt(_0x2384e1(0x165))/0x5+parseInt(_0x2384e1(0x166))/0x6*(-parseInt(_0x2384e1(0x160))/0x7)+parseInt(_0x2384e1(0x155))/0x8;if(_0x587bad===_0x2fca83)break;else _0x2ce4d2['push'](_0x2ce4d2['shift']());}catch(_0x5a3911){_0x2ce4d2['push'](_0x2ce4d2['shift']());}}}(a184_0x461c,0x1b021));function a184_0x4406(_0x2461c9,_0xf225b){_0x2461c9=_0x2461c9-0x152;const _0x461cf9=a184_0x461c();let _0x44067e=_0x461cf9[_0x2461c9];return _0x44067e;}function a184_0x461c(){const _0x40f60b=['add','replace','1505vGLuSo','endsWith','.digdag','100988fdAiDc','map','1082915dOXyxv','4038LGHGbX','slice','142409HjhOVT','trim','filter','102057dyQgRG','length','3658128YBcUBT','Thumbs.db','.DS_Store','startsWith','.digdagignore','utf-8','join','split','296548AOTzqT'];a184_0x461c=function(){return _0x40f60b;};return a184_0x461c();}import{promises as a184_0x365c06}from'fs';import a184_0x14706d from'path';import a184_0x402034 from'ignore';export const WORKFLOW_FILE_EXTENSION='.dig';export function shouldIncludeInArchive(_0x159c10){const _0x292bc5=a184_0x4406;if(_0x159c10===_0x292bc5(0x162))return!![];if(_0x159c10[_0x292bc5(0x158)]('.'))return![];if(_0x159c10[_0x292bc5(0x161)]('~'))return![];if(_0x159c10===_0x292bc5(0x156)||_0x159c10===_0x292bc5(0x157))return![];return!![];}export function parseDigdagignore(_0x20eeb3){const _0x6b8340=a184_0x4406;return _0x20eeb3[_0x6b8340(0x15c)]('\x0a')[_0x6b8340(0x164)](_0x5d4c2a=>_0x5d4c2a[_0x6b8340(0x169)]())[_0x6b8340(0x152)](_0x1523c1=>_0x1523c1['length']>0x0&&!_0x1523c1['startsWith']('#'));}export async function loadDigdagignore(_0x3a97f4){const _0x32334=a184_0x4406,_0x264366=a184_0x14706d[_0x32334(0x15b)](_0x3a97f4,_0x32334(0x159));try{const _0x5ab99e=await a184_0x365c06['readFile'](_0x264366,_0x32334(0x15a));return parseDigdagignore(_0x5ab99e);}catch(_0x4a9883){if(_0x4a9883['code']==='ENOENT')return null;throw _0x4a9883;}}export function createIgnoreInstance(_0x16b7ba){const _0x3471f6=a184_0x4406,_0x5c2883=a184_0x402034();return _0x16b7ba&&_0x16b7ba[_0x3471f6(0x154)]>0x0&&_0x5c2883[_0x3471f6(0x15e)](_0x16b7ba),_0x5c2883;}export function addScopedPatterns(_0x7efa3f,_0x1102b6,_0x6fa07a){const _0x3bef28=a184_0x4406,_0x342bf4=_0x1102b6[_0x3bef28(0x164)](_0x566951=>{const _0x4f72d4=_0x3bef28;if(_0x566951[_0x4f72d4(0x158)]('!')){const _0x20385f=_0x566951[_0x4f72d4(0x167)](0x1);if(_0x20385f[_0x4f72d4(0x158)]('/'))return'!'+_0x6fa07a+_0x20385f;return'!'+_0x6fa07a+'/'+_0x20385f;}if(_0x566951[_0x4f72d4(0x158)]('/'))return''+_0x6fa07a+_0x566951;return _0x6fa07a+'/'+_0x566951;});return _0x7efa3f[_0x3bef28(0x15e)](_0x342bf4),_0x7efa3f;}export function shouldIgnoreWithInstance(_0x418a04,_0x2d2a59,_0xf00bdd){const _0x1d9075=a184_0x4406,_0x4cb5ca=_0x2d2a59[_0x1d9075(0x15f)](/\\/g,'/'),_0xd0916c=_0xf00bdd?_0x4cb5ca+'/':_0x4cb5ca;return _0x418a04['ignores'](_0xd0916c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a185_0x127e94=a185_0x1c4c;(function(_0x46e9c8,_0x14738b){const _0x1b8687=a185_0x1c4c,_0x13eccc=_0x46e9c8();while(!![]){try{const _0x2cf1b7=parseInt(_0x1b8687(0xb5))/0x1+parseInt(_0x1b8687(0xac))/0x2+-parseInt(_0x1b8687(0xb4))/0x3*(parseInt(_0x1b8687(0xb7))/0x4)+parseInt(_0x1b8687(0xaf))/0x5+-parseInt(_0x1b8687(0xbc))/0x6+parseInt(_0x1b8687(0xa9))/0x7+-parseInt(_0x1b8687(0xa7))/0x8;if(_0x2cf1b7===_0x14738b)break;else _0x13eccc['push'](_0x13eccc['shift']());}catch(_0x7ac00b){_0x13eccc['push'](_0x13eccc['shift']());}}}(a185_0xcd57,0x66879));function a185_0x1c4c(_0x4b8269,_0x4e550e){_0x4b8269=_0x4b8269-0xa5;const _0xcd5701=a185_0xcd57();let _0x1c4c8a=_0xcd5701[_0x4b8269];return _0x1c4c8a;}import{TDX,LogLevel}from'../sdk/index.js';import{createHTTPMock}from'./http-mock.js';import{createTestGlobalOptions}from'./factories.js';export class CommandRunner{[a185_0x127e94(0xb9)];[a185_0x127e94(0xad)];constructor(){const _0xfcc079=a185_0x127e94;this['http']=createHTTPMock(),this[_0xfcc079(0xad)]=global[_0xfcc079(0xb1)];}[a185_0x127e94(0xc1)](){const _0x3b932f=a185_0x127e94;this['originalFetch']=global['fetch'],global[_0x3b932f(0xb1)]=this['http'][_0x3b932f(0xba)]();}[a185_0x127e94(0xbd)](_0x1229ff){const _0x284cae=a185_0x127e94;try{_0x1229ff?.['fail']&&this['http'][_0x284cae(0xab)](_0x1229ff);}finally{global[_0x284cae(0xb1)]=this[_0x284cae(0xad)],this[_0x284cae(0xb9)][_0x284cae(0xa5)]();}}async['run'](_0x1f42fc,_0x517fb3={}){const _0x8ca54c=a185_0x127e94,_0x54a977=[],_0x4e0c35=[],_0x6bda55=console[_0x8ca54c(0xaa)],_0x3bf6b9=console[_0x8ca54c(0xbe)],_0x39ffb2=console['warn'];console['log']=(..._0xd84aa0)=>{const _0x1782c7=_0x8ca54c;_0x54a977['push'](_0xd84aa0[_0x1782c7(0xb8)](String)[_0x1782c7(0xc2)]('\x20'));},console[_0x8ca54c(0xbe)]=(..._0x46fe7a)=>{const _0x1461ee=_0x8ca54c;_0x4e0c35[_0x1461ee(0xb0)](_0x46fe7a['map'](String)[_0x1461ee(0xc2)]('\x20'));},console[_0x8ca54c(0xbb)]=(..._0x26f92b)=>{const _0x4a9f10=_0x8ca54c;_0x4e0c35[_0x4a9f10(0xb0)](_0x26f92b[_0x4a9f10(0xb8)](String)[_0x4a9f10(0xc2)]('\x20'));};try{const _0x13bd90=new TDX({'site':_0x517fb3[_0x8ca54c(0xa6)]?.[_0x8ca54c(0xb6)]??_0x8ca54c(0xbf),'apiKey':_0x8ca54c(0xae),'logLevel':LogLevel[_0x8ca54c(0xa8)]}),_0x341d17={'options':createTestGlobalOptions(_0x517fb3[_0x8ca54c(0xa6)]),'args':_0x517fb3[_0x8ca54c(0xc0)]??[],'tdx':_0x13bd90},_0x2921b7=new _0x1f42fc(),_0x1d31f8=await _0x2921b7[_0x8ca54c(0xb3)](_0x341d17);return{'exitCode':_0x1d31f8,'stdout':_0x54a977,'stderr':_0x4e0c35};}finally{console[_0x8ca54c(0xaa)]=_0x6bda55,console[_0x8ca54c(0xbe)]=_0x3bf6b9,console['warn']=_0x39ffb2;}}async['runSequence'](_0x48a5de){const _0x4d625e=a185_0x127e94,_0xe2de8d=[];for(const {command:_0xe66d61,options:_0xdb78f8}of _0x48a5de){const _0x1cd3f5=await this[_0x4d625e(0xb3)](_0xe66d61,_0xdb78f8);_0xe2de8d[_0x4d625e(0xb0)](_0x1cd3f5);if(_0x1cd3f5[_0x4d625e(0xb2)]!==0x0)break;}return _0xe2de8d;}}export function createCommandRunner(){return new CommandRunner();}function a185_0xcd57(){const _0x1a9f47=['verify','69128kmWYbL','originalFetch','test-api-key-id/test-api-key-secret','1547965Giblmd','push','fetch','exitCode','run','30513PlWrUk','41292UAwmQl','site','68ttRoeF','map','http','createFetch','warn','237306NReITc','teardown','error','us01','args','setup','join','reset','options','3862272jmcCvq','ERROR','5108278BxoFsM','log'];a185_0xcd57=function(){return _0x1a9f47;};return a185_0xcd57();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a186_0x1650(_0xd67d33,_0x179dbe){_0xd67d33=_0xd67d33-0x6a;const _0x5a3ef9=a186_0x5a3e();let _0x1650a1=_0x5a3ef9[_0xd67d33];return _0x1650a1;}(function(_0x2a2762,_0x49d36a){const _0x572e26=a186_0x1650,_0x560fd2=_0x2a2762();while(!![]){try{const _0x35dea9=-parseInt(_0x572e26(0x7a))/0x1+parseInt(_0x572e26(0x77))/0x2*(parseInt(_0x572e26(0x82))/0x3)+-parseInt(_0x572e26(0x8a))/0x4+parseInt(_0x572e26(0x83))/0x5*(parseInt(_0x572e26(0x7b))/0x6)+parseInt(_0x572e26(0x79))/0x7+parseInt(_0x572e26(0x73))/0x8*(parseInt(_0x572e26(0x6b))/0x9)+-parseInt(_0x572e26(0x6d))/0xa;if(_0x35dea9===_0x49d36a)break;else _0x560fd2['push'](_0x560fd2['shift']());}catch(_0xd9674b){_0x560fd2['push'](_0x560fd2['shift']());}}}(a186_0x5a3e,0x82bd1));import{vi}from'vitest';import{join}from'path';function a186_0x5a3e(){const _0x2387ce=['912RitbWy','us01','journey','warn','test-api-key','reset','segment','705417lxcBex','25400qdpxVM','user','log','push','init','workflow','DEBUG','4133728ddXhoI','30000','256293mfkvjK','error','13144550ixxTYc','table','args','tdx','ERROR','map','216nLPpcd','join','query','tdx-test.log','6KymnwW','options','6771464AadRyU','330416uTMKEe'];a186_0x5a3e=function(){return _0x2387ce;};return a186_0x5a3e();}import{Logger,LogLevel,FileHandler}from'../utils/logger/index.js';import{getGlobalCacheDir}from'../utils/global-cache.js';export function createTestSDKContext(_0x45bdd8){const _0xc81c3b=a186_0x1650;return{'site':_0xc81c3b(0x7c),'apiKey':'test-api-key-id/test-api-key-secret','logLevel':LogLevel[_0xc81c3b(0x71)],..._0x45bdd8};}export function createTestGlobalOptions(_0xb5050){const _0x321cb9=a186_0x1650;return{'site':_0x321cb9(0x7c),'format':_0x321cb9(0x6e),'noColor':!![],'limit':0x64,'verbose':![],'timeout':_0x321cb9(0x6a),'dryRun':![],'yes':![],'logLevel':LogLevel[_0x321cb9(0x71)],..._0xb5050};}export async function initTestLogger(){const _0x51fa6f=a186_0x1650;Logger[_0x51fa6f(0x80)]();const _0x48e49a=join(getGlobalCacheDir(),'logs',_0x51fa6f(0x76));await Logger[_0x51fa6f(0x87)]({'defaultLevel':LogLevel[_0x51fa6f(0x89)],'handlers':[new FileHandler({'filePath':_0x48e49a,'rotate':![]})]});}export function resetTestLogger(){const _0x3a4d3b=a186_0x1650;Logger[_0x3a4d3b(0x80)]();}export function createMockTDX(_0x8f26ea){const _0x37fae4=a186_0x1650;return{'context':{'site':'us01','apiKey':_0x37fae4(0x7f),'logLevel':LogLevel[_0x37fae4(0x71)]},'query':{'execute':vi['fn'](),'listDatabases':vi['fn'](),'listTables':vi['fn'](),'describeTable':vi['fn'](),'showTable':vi['fn'](),..._0x8f26ea?.[_0x37fae4(0x75)]},'segment':{'listParents':vi['fn'](),'getParent':vi['fn'](),'list':vi['fn'](),'get':vi['fn'](),'create':vi['fn'](),'update':vi['fn'](),'delete':vi['fn'](),..._0x8f26ea?.[_0x37fae4(0x81)]},'journey':{'list':vi['fn'](),'get':vi['fn'](),'create':vi['fn'](),'update':vi['fn'](),'delete':vi['fn'](),..._0x8f26ea?.[_0x37fae4(0x7d)]},'workflow':{'list':vi['fn'](),'get':vi['fn'](),'run':vi['fn'](),..._0x8f26ea?.[_0x37fae4(0x88)]},'user':{'show':vi['fn'](),..._0x8f26ea?.[_0x37fae4(0x84)]},'api':{'request':vi['fn'](),..._0x8f26ea?.['api']},..._0x8f26ea};}export function createTestCommandContext(_0x1749d0){const _0x51b82d=a186_0x1650,_0x36c61d=createTestGlobalOptions(_0x1749d0?.[_0x51b82d(0x78)]),_0x5a8eca=_0x1749d0?.[_0x51b82d(0x70)]??createMockTDX();return{'options':_0x36c61d,'args':_0x1749d0?.[_0x51b82d(0x6f)]??[],'tdx':_0x5a8eca};}export function captureConsole(){const _0x480ec1=a186_0x1650,_0xbe8b49=[],_0x5c794e=[],_0x47363f=console['log'],_0x326d92=console['error'],_0x281daa=console[_0x480ec1(0x7e)];return console[_0x480ec1(0x85)]=(..._0x985a6a)=>{const _0x4c2a3d=_0x480ec1;_0xbe8b49[_0x4c2a3d(0x86)](_0x985a6a[_0x4c2a3d(0x72)](String)[_0x4c2a3d(0x74)]('\x20'));},console[_0x480ec1(0x6c)]=(..._0x20787e)=>{const _0x80f3b3=_0x480ec1;_0x5c794e[_0x80f3b3(0x86)](_0x20787e[_0x80f3b3(0x72)](String)[_0x80f3b3(0x74)]('\x20'));},console[_0x480ec1(0x7e)]=(..._0x215084)=>{const _0x4d6418=_0x480ec1;_0x5c794e[_0x4d6418(0x86)](_0x215084[_0x4d6418(0x72)](String)[_0x4d6418(0x74)]('\x20'));},{'stdout':_0xbe8b49,'stderr':_0x5c794e,'restore':()=>{const _0x363ed2=_0x480ec1;console[_0x363ed2(0x85)]=_0x47363f,console[_0x363ed2(0x6c)]=_0x326d92,console[_0x363ed2(0x7e)]=_0x281daa;}};}
|