@treasuredata/tdx 2026.4.12 → 2026.4.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-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.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-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/tools/work-create-item.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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.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.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/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.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.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/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.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
|
-
const a192_0x3e84c0=a192_0x179b;function a192_0x2ef2(){const _0x43c043=['107584JhYYdw','bind','enableSchedule','cancelRequested','logs','Invalid\x20workflow\x20format:\x20','No\x20','latest','sessionTime','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','Cannot\x20read\x20workflow\x20file:\x20','Project\x20directory\x20not\x20found:\x20','test','startAttempt','pullProject','preparePushProject','7663624kKoeRu','storeParams','17292WniVTs','readdir','retryAttempt','exportParams','disableSchedule','finishedAt','sessions','filter','access','toString','min','.tar.gz','deleteProject','download','uploadProjectArchive','projectName','listLogFiles','skipValidation','retrySession','deleteSecret','319817BWbody','replace','error','data','rejected','includeRetried','basename','state','workflows','allSettled','name','sessionUuid','setSecrets','resolveProjectId','direct','find','revision','executePushProject','getProject','indexOf','retryParams','1855LVDbKo','unlink','tmpdir','Failed\x20to\x20set\x20secret','retryAt','downloadProjectArchive','last_id','setSecret','9WbENCc','9grvywK','executeCloneProject','workflowName','substring','map','WORKFLOW_PROJECT_NOT_FOUND','listAttempts','isDirectory','params','message','clearScheduleAll','retryAttemptName','tdx-workflow-','tdx-workflow-push-','now','listSecrets','from','path','config','client','listProjects','timezone','limit','logFiles','WORKFLOW_SECRET_SET_FAILED','attempts','5217270GQgIMn','1501908nAmmKM','endsWith','lastAttempt','Project\x20not\x20found:\x20','push','lastId','\x20workflow\x20files\x20found\x20in\x20project\x20directory','parentId','Failed\x20to\x20download\x20log\x20file:\x20','2173545IVcAhI','clearSchedule','applyPullProject','.\x20Expected\x20\x22project.workflow\x22','workflow','createdAt','listSchedules','toISOString','prepareCloneProject','create','join','keys','force','status','NUMERIC_ID_PATTERN','attempt','length','sessionId','fullName','project','index'];a192_0x2ef2=function(){return _0x43c043;};return a192_0x2ef2();}(function(_0xf39359,_0x52394c){const _0x420586=a192_0x179b,_0x33e17e=_0xf39359();while(!![]){try{const _0x49bac7=-parseInt(_0x420586(0xbd))/0x1+-parseInt(_0x420586(0xf6))/0x2+parseInt(_0x420586(0xdb))/0x3*(-parseInt(_0x420586(0x114))/0x4)+parseInt(_0x420586(0xff))/0x5+parseInt(_0x420586(0x126))/0x6*(parseInt(_0x420586(0xd2))/0x7)+parseInt(_0x420586(0x124))/0x8+-parseInt(_0x420586(0xda))/0x9*(parseInt(_0x420586(0xf5))/0xa);if(_0x49bac7===_0x52394c)break;else _0x33e17e['push'](_0x33e17e['shift']());}catch(_0x289919){_0x33e17e['push'](_0x33e17e['shift']());}}}(a192_0x2ef2,0x75f86));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x39de5,_0x12aa27,_0x1ce874=0x64){const _0x3a88d9=a192_0x179b,_0x451444=Math[_0x3a88d9(0x130)](_0x12aa27,MAX_PAGINATION_LIMIT),_0x5030d9=[];let _0x3b3fdb;while(_0x5030d9['length']<_0x451444){const _0x572e23=await _0x39de5(_0x1ce874,_0x3b3fdb),_0x452e1b=_0x572e23['rawCount']??_0x572e23['data'][_0x3a88d9(0x10f)];if(_0x452e1b===0x0)break;_0x5030d9['push'](..._0x572e23[_0x3a88d9(0xc0)]);if(!_0x572e23[_0x3a88d9(0xfb)]||_0x452e1b<_0x1ce874)break;_0x3b3fdb=_0x572e23[_0x3a88d9(0xfb)];}return _0x5030d9['slice'](0x0,_0x451444);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';function a192_0x179b(_0x50d22c,_0x13fba6){_0x50d22c=_0x50d22c-0xbc;const _0x2ef2d5=a192_0x2ef2();let _0x179b0f=_0x2ef2d5[_0x50d22c];return _0x179b0f;}import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a192_0x3e84c0(0x10d)]=/^\d+$/;[a192_0x3e84c0(0xee)];constructor(_0x334c8f){const _0x3f59d5=a192_0x3e84c0;this[_0x3f59d5(0xee)]=new WorkflowApiClient(_0x334c8f);}async[a192_0x3e84c0(0xca)](_0x11f04f){const _0x4344b7=a192_0x3e84c0;if(WorkflowSDK[_0x4344b7(0x10d)][_0x4344b7(0x120)](_0x11f04f)){const _0x62f1b0=await this[_0x4344b7(0xee)][_0x4344b7(0xcf)](_0x11f04f);return{'id':_0x62f1b0['id'],'name':_0x62f1b0[_0x4344b7(0xc7)]};}const _0x39b9a2=await this[_0x4344b7(0xee)]['listProjects']({'name_pattern':_0x11f04f}),_0x129d57=_0x39b9a2[_0x4344b7(0xc0)][_0x4344b7(0xcc)](_0x5ada65=>_0x5ada65[_0x4344b7(0xc7)]===_0x11f04f);if(!_0x129d57)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],'Project\x20not\x20found:\x20'+_0x11f04f);return{'id':_0x129d57['id'],'name':_0x129d57[_0x4344b7(0xc7)]};}async['projects'](_0x21c096,_0x4982e4){const _0x4f0435=a192_0x3e84c0,_0x1bef79=_0x4982e4?.[_0x4f0435(0xf1)]||0x64,_0x4e85b4=await paginateResults((_0x23e313,_0x2ffed8)=>this[_0x4f0435(0xee)]['listProjects']({'name_pattern':_0x21c096,'limit':_0x23e313,'last_id':_0x2ffed8??_0x4982e4?.['last_id']}),_0x1bef79);return _0x4e85b4['map'](_0x144ced=>({..._0x144ced,'project_id':_0x144ced['id'],'project_name':_0x144ced['name']}));}async[a192_0x3e84c0(0xc5)](_0x5ddfe4,_0x5f32e4){const _0x32febd=a192_0x3e84c0,_0x42bf8d=_0x5f32e4?.[_0x32febd(0xf1)]||0x64,_0xd97f3c=await paginateResults((_0x1b62cb,_0x28b72d)=>this[_0x32febd(0xee)]['listWorkflows']({'project_name':_0x5ddfe4,'limit':_0x1b62cb,'last_id':_0x28b72d??_0x5f32e4?.[_0x32febd(0xd8)]}),_0x42bf8d);return _0xd97f3c['map'](_0x3b2ec1=>({'project_id':_0x3b2ec1[_0x32febd(0x112)]?.['id'],'project_name':_0x3b2ec1[_0x32febd(0x112)]?.[_0x32febd(0xc7)],'workflow_id':_0x3b2ec1['id'],'workflow_name':_0x3b2ec1[_0x32febd(0xc7)],'revision':_0x3b2ec1['revision'],'timezone':_0x3b2ec1[_0x32febd(0xf0)],'config':_0x3b2ec1['config'],'id':_0x3b2ec1['id'],'name':_0x3b2ec1[_0x32febd(0xc7)],'project':_0x3b2ec1['project']}));}async[a192_0x3e84c0(0x12c)](_0x49d944){const _0x3a5237=a192_0x3e84c0;let _0x270cf0;if(_0x49d944?.['projectName']){let _0x11aa09,_0x282452=![];while(!_0x282452){const _0x2106d1=await this[_0x3a5237(0xee)][_0x3a5237(0xef)]({'limit':0x64,'last_id':_0x11aa09}),_0x5e34d5=_0x2106d1[_0x3a5237(0xc0)]['find'](_0x2d7f99=>_0x2d7f99[_0x3a5237(0xc7)]===_0x49d944['projectName']);if(_0x5e34d5){_0x270cf0=_0x5e34d5['id'],_0x282452=!![];break;}if(!_0x2106d1[_0x3a5237(0xfb)]||_0x2106d1[_0x3a5237(0xc0)][_0x3a5237(0x10f)]===0x0)break;_0x11aa09=_0x2106d1['lastId'];}if(!_0x270cf0)throw new SDKError(ErrorCode[_0x3a5237(0xe0)],_0x3a5237(0xf9)+_0x49d944['projectName']);}const _0x30b917=_0x49d944?.['limit']||0x64,_0x1a303c=await paginateResults((_0x4e276f,_0x23183f)=>this[_0x3a5237(0xee)]['listSessions']({'project_id':_0x270cf0,'project_name':_0x49d944?.['projectName'],'workflow_name':_0x49d944?.[_0x3a5237(0xdd)],'status':_0x49d944?.[_0x3a5237(0x10c)],'from_time':_0x49d944?.['fromTime'],'to_time':_0x49d944?.['toTime'],'limit':_0x4e276f,'last_id':_0x23183f??_0x49d944?.[_0x3a5237(0xd8)]}),_0x30b917);return _0x1a303c[_0x3a5237(0xdf)](_0x8e7aa8=>({'project_id':_0x8e7aa8[_0x3a5237(0x112)]?.['id'],'project_name':_0x8e7aa8['project']?.[_0x3a5237(0xc7)],'workflow_id':_0x8e7aa8[_0x3a5237(0x103)]?.['id'],'workflow_name':_0x8e7aa8[_0x3a5237(0x103)]?.[_0x3a5237(0xc7)],'session_id':_0x8e7aa8['id'],'sessionUuid':_0x8e7aa8[_0x3a5237(0xc8)],'sessionTime':_0x8e7aa8[_0x3a5237(0x11c)],'lastAttempt':_0x8e7aa8[_0x3a5237(0xf8)],'id':_0x8e7aa8['id'],'project':_0x8e7aa8['project'],'workflow':_0x8e7aa8[_0x3a5237(0x103)]}));}async[a192_0x3e84c0(0xf4)](_0x275b02){const _0x2de4c2=a192_0x3e84c0,_0x4339ff=_0x275b02?.['limit']||0x64,_0x18f89a=await paginateResults((_0xeae47b,_0x30812b)=>this[_0x2de4c2(0xee)][_0x2de4c2(0xe1)]({'project_name':_0x275b02?.[_0x2de4c2(0x135)],'workflow_name':_0x275b02?.[_0x2de4c2(0xdd)],'include_retried':_0x275b02?.[_0x2de4c2(0xc2)],'limit':_0xeae47b,'last_id':_0x30812b??_0x275b02?.['last_id']}),_0x4339ff);return _0x18f89a[_0x2de4c2(0xdf)](_0x1dd156=>({'project_id':_0x1dd156[_0x2de4c2(0x112)]?.['id'],'project_name':_0x1dd156[_0x2de4c2(0x112)]?.[_0x2de4c2(0xc7)],'workflow_id':_0x1dd156[_0x2de4c2(0x103)]?.['id'],'workflow_name':_0x1dd156[_0x2de4c2(0x103)]?.[_0x2de4c2(0xc7)],'session_id':_0x1dd156['sessionId'],'sessionUuid':_0x1dd156['sessionUuid'],'sessionTime':_0x1dd156[_0x2de4c2(0x11c)],'attempt_id':_0x1dd156['id'],'attempt_index':_0x1dd156[_0x2de4c2(0x113)],'retryAttemptName':_0x1dd156[_0x2de4c2(0xe6)],'done':_0x1dd156['done'],'success':_0x1dd156['success'],'cancelRequested':_0x1dd156[_0x2de4c2(0x117)],'params':_0x1dd156[_0x2de4c2(0xe3)],'createdAt':_0x1dd156[_0x2de4c2(0x104)],'finishedAt':_0x1dd156[_0x2de4c2(0x12b)],'id':_0x1dd156['id'],'index':_0x1dd156['index'],'project':_0x1dd156[_0x2de4c2(0x112)],'workflow':_0x1dd156[_0x2de4c2(0x103)]}));}async[a192_0x3e84c0(0x10e)](_0x427bfe){const _0xd31459=await this['client']['getAttempt'](_0x427bfe);return _0xd31459;}async['tasks'](_0x5006ff,_0x4a51db=![]){const _0x4548b0=a192_0x3e84c0,_0x3d9be8=await this['client']['getAttemptTasks'](_0x5006ff,_0x4a51db);return _0x3d9be8['map'](_0x3e0477=>({'task_id':_0x3e0477['id'],'task_name':_0x3e0477['fullName'],'parentId':_0x3e0477[_0x4548b0(0xfd)],'config':_0x3e0477[_0x4548b0(0xed)],'upstreams':_0x3e0477['upstreams'],'state':_0x3e0477[_0x4548b0(0xc4)],'exportParams':_0x3e0477[_0x4548b0(0x129)],'storeParams':_0x3e0477[_0x4548b0(0x125)],'stateParams':_0x3e0477['stateParams'],'updatedAt':_0x3e0477['updatedAt'],'retryAt':_0x3e0477[_0x4548b0(0xd6)],'startedAt':_0x3e0477['startedAt'],'error':_0x3e0477[_0x4548b0(0xbf)],'isGroup':_0x3e0477['isGroup'],'id':_0x3e0477['id'],'fullName':_0x3e0477[_0x4548b0(0x111)]}));}async[a192_0x3e84c0(0xf2)](_0x1a8536,_0x48a094){const _0x3a0b0=a192_0x3e84c0;return await this[_0x3a0b0(0xee)][_0x3a0b0(0x136)](_0x1a8536,_0x48a094);}async[a192_0x3e84c0(0x118)](_0x1abe35,_0x1a0732){const _0x59dc84=a192_0x3e84c0,_0x4ece6e=await import('zlib'),{promisify:_0xd3258a}=await import('util'),_0x4b7af3=_0xd3258a(_0x4ece6e['gunzip']),_0x525611=await this[_0x59dc84(0xee)][_0x59dc84(0x136)](_0x1abe35,_0x1a0732);if(_0x525611[_0x59dc84(0x10f)]===0x0)return'';const _0x346683=[];for(const _0x4ab75d of _0x525611){if(!_0x4ab75d['direct'])continue;const _0x3e6eff=await fetch(_0x4ab75d[_0x59dc84(0xcb)]);if(!_0x3e6eff['ok'])throw new Error(_0x59dc84(0xfe)+_0x3e6eff['status']);const _0x29ce73=Buffer[_0x59dc84(0xeb)](await _0x3e6eff['arrayBuffer']()),_0x3c53b4=await _0x4b7af3(_0x29ce73);_0x346683[_0x59dc84(0xfa)](_0x3c53b4[_0x59dc84(0x12f)]('utf-8'));}return _0x346683[_0x59dc84(0x109)]('\x0a');}async['kill'](_0x14bc33,_0x30b08a){const _0x42eb3c=a192_0x3e84c0,_0xb7d103=await this[_0x42eb3c(0xee)]['killAttempt'](_0x14bc33,_0x30b08a);return _0xb7d103?.[_0x42eb3c(0xe4)]??'Kill\x20request\x20accepted';}async[a192_0x3e84c0(0x138)](_0x5e940f,_0x41c99f){const _0x39e0f0=a192_0x3e84c0,_0x580bf4=await this['client']['retrySession'](_0x5e940f,{'from_task':_0x41c99f?.['fromTask'],'retry_params':_0x41c99f?.[_0x39e0f0(0xd1)]});return{'attemptId':_0x580bf4['id'],'sessionId':_0x580bf4[_0x39e0f0(0x110)]};}async[a192_0x3e84c0(0x128)](_0x211fd2,_0x4f5714){const _0x4cd2eb=a192_0x3e84c0,_0xfc231e=await this[_0x4cd2eb(0xee)][_0x4cd2eb(0x128)](_0x211fd2,{'resume_from':_0x4f5714?.['resumeFrom'],'retry_params':_0x4f5714?.[_0x4cd2eb(0xd1)],'force':_0x4f5714?.[_0x4cd2eb(0x10b)]});return{'attemptId':_0xfc231e['id'],'sessionId':_0xfc231e[_0x4cd2eb(0x110)]};}async['run'](_0x488d0c,_0x36693a={},_0x345efa){const _0x46e7e3=a192_0x3e84c0,_0x5314ce=_0x488d0c[_0x46e7e3(0xd0)]('.');let _0x3bf4a8,_0x261e0b;if(_0x5314ce===-0x1)throw new Error(_0x46e7e3(0x11d));_0x3bf4a8=_0x488d0c[_0x46e7e3(0xde)](0x0,_0x5314ce),_0x261e0b=_0x488d0c[_0x46e7e3(0xde)](_0x5314ce+0x1);if(!_0x3bf4a8||!_0x261e0b)throw new Error(_0x46e7e3(0x119)+_0x488d0c+_0x46e7e3(0x102));const _0x28893c=_0x345efa?.[_0x46e7e3(0x11c)]||new Date()[_0x46e7e3(0x106)]();return await this[_0x46e7e3(0xee)][_0x46e7e3(0x121)]({'projectName':_0x3bf4a8,'workflowName':_0x261e0b,'sessionTime':_0x28893c,'params':_0x36693a});}async[a192_0x3e84c0(0x133)](_0x218070,_0x1c6a86,_0x3891d8){const _0x3c4d33=a192_0x3e84c0,{promises:_0x310b3e}=await import('fs'),_0x200fcc=await import(_0x3c4d33(0xec)),_0x3fee90=await import('os'),_0x394f3b=await import('tar'),{id:_0x197e25,name:_0x85c1ce}=await this['resolveProjectId'](_0x218070),_0x47fa0b=_0x3fee90[_0x3c4d33(0xd4)](),_0x4824c5=_0x200fcc[_0x3c4d33(0x109)](_0x47fa0b,_0x3c4d33(0xe7)+_0x197e25+'-'+Date[_0x3c4d33(0xe9)]()+_0x3c4d33(0x131));try{await this[_0x3c4d33(0xee)][_0x3c4d33(0xd7)](_0x197e25,_0x4824c5,_0x3891d8?.[_0x3c4d33(0xcd)]);const _0x262fba=_0x200fcc[_0x3c4d33(0x109)](_0x1c6a86,_0x85c1ce);await _0x310b3e['mkdir'](_0x262fba,{'recursive':!![]}),await _0x394f3b['extract']({'file':_0x4824c5,'cwd':_0x262fba,'gzip':!![]});const _0x2705ca=async _0x3fe162=>{const _0x120065=_0x3c4d33;let _0x1f49da=0x0;const _0x5a09a3=await _0x310b3e[_0x120065(0x127)](_0x3fe162,{'withFileTypes':!![]});for(const _0x3f34e6 of _0x5a09a3){const _0x7bcd14=_0x200fcc['join'](_0x3fe162,_0x3f34e6[_0x120065(0xc7)]);if(_0x3f34e6['isFile']())_0x1f49da++;else _0x3f34e6[_0x120065(0xe2)]()&&(_0x1f49da+=await _0x2705ca(_0x7bcd14));}return _0x1f49da;},_0x439d96=await _0x2705ca(_0x262fba);return{'projectName':_0x85c1ce,'revision':_0x3891d8?.[_0x3c4d33(0xcd)]||_0x3c4d33(0x11b),'filesExtracted':_0x439d96};}finally{try{await _0x310b3e[_0x3c4d33(0xd3)](_0x4824c5);}catch{}}}async[a192_0x3e84c0(0xfa)](_0x5a2d85,_0x3a83b6){const _0x49e55e=a192_0x3e84c0,{promises:_0x3759f2}=await import('fs'),_0x352fa0=await import('path'),_0x47d29c=await import('tar'),_0x59e2be=_0x3a83b6?.[_0x49e55e(0x135)]||_0x352fa0[_0x49e55e(0xc3)](_0x5a2d85),_0x4387dc=_0x3a83b6?.[_0x49e55e(0xcd)]||new Date()[_0x49e55e(0x106)]()[_0x49e55e(0xbe)](/[:.]/g,'-');try{await _0x3759f2[_0x49e55e(0x12e)](_0x5a2d85);}catch{throw new Error(_0x49e55e(0x11f)+_0x5a2d85);}if(!_0x3a83b6?.[_0x49e55e(0x137)]){const _0x2a0f66=await _0x3759f2['readdir'](_0x5a2d85),_0x407226=_0x2a0f66[_0x49e55e(0x12d)](_0x252b4b=>_0x252b4b[_0x49e55e(0xf7)](WORKFLOW_FILE_EXTENSION));if(_0x407226[_0x49e55e(0x10f)]===0x0)throw new Error(_0x49e55e(0x11a)+WORKFLOW_FILE_EXTENSION+_0x49e55e(0xfc));for(const _0x3db820 of _0x407226){const _0x2e8633=_0x352fa0[_0x49e55e(0x109)](_0x5a2d85,_0x3db820);try{await _0x3759f2[_0x49e55e(0x12e)](_0x2e8633);}catch{throw new Error(_0x49e55e(0x11e)+_0x3db820);}}}const _0x36c755=async(_0x51fc6b,_0x18c428='')=>{const _0x2ee463=_0x49e55e,_0x4834eb=await _0x3759f2[_0x2ee463(0x127)](_0x51fc6b,{'withFileTypes':!![]}),_0x275235=[];for(const _0x66d2ca of _0x4834eb){const _0x40b122=_0x352fa0[_0x2ee463(0x109)](_0x18c428,_0x66d2ca['name']),_0x4a336b=_0x352fa0[_0x2ee463(0x109)](_0x51fc6b,_0x66d2ca[_0x2ee463(0xc7)]);if(!shouldIncludeInArchive(_0x66d2ca[_0x2ee463(0xc7)]))continue;_0x66d2ca[_0x2ee463(0xe2)]()?_0x275235[_0x2ee463(0xfa)](...await _0x36c755(_0x4a336b,_0x40b122)):_0x275235['push'](_0x40b122);}return _0x275235;},_0x9f1bd6=await _0x36c755(_0x5a2d85),_0x2b57ed=await import('os'),_0x39d3c5=_0x2b57ed['tmpdir'](),_0x44123d=_0x352fa0['join'](_0x39d3c5,_0x49e55e(0xe8)+Date[_0x49e55e(0xe9)]()+_0x49e55e(0x131));try{await _0x47d29c[_0x49e55e(0x108)]({'file':_0x44123d,'gzip':!![],'cwd':_0x5a2d85,'portable':!![]},_0x9f1bd6);const _0x5f8e67=await this[_0x49e55e(0xee)][_0x49e55e(0x134)](_0x59e2be,_0x4387dc,_0x44123d,{'scheduleFrom':_0x3a83b6?.['scheduleFrom'],'clearSchedule':_0x3a83b6?.[_0x49e55e(0x100)],'clearScheduleAll':_0x3a83b6?.[_0x49e55e(0xe5)]});return{'projectId':_0x5f8e67['id'],'projectName':_0x5f8e67[_0x49e55e(0xc7)],'revision':_0x5f8e67[_0x49e55e(0xcd)]};}finally{try{await _0x3759f2[_0x49e55e(0xd3)](_0x44123d);}catch{}}}async['delete'](_0x3fe16b){const _0x402ac7=a192_0x3e84c0,{id:_0x5d4a8c}=await this[_0x402ac7(0xca)](_0x3fe16b),_0x10be52=await this[_0x402ac7(0xee)][_0x402ac7(0x132)](_0x5d4a8c);return{'projectId':_0x10be52['id'],'projectName':_0x10be52[_0x402ac7(0xc7)]};}async[a192_0x3e84c0(0xea)](_0x1d3fb5){const _0x233d87=a192_0x3e84c0,{id:_0x28547a,name:_0xdf99fc}=await this[_0x233d87(0xca)](_0x1d3fb5),_0x24cf6a=await this['client'][_0x233d87(0xea)](_0x28547a);return{'projectName':_0xdf99fc,'secrets':_0x24cf6a};}async['setSecret'](_0x5c3baa,_0xc0d556,_0x43d3ae){const _0xcc6f11=a192_0x3e84c0,{id:_0x3d2538,name:_0x484d87}=await this['resolveProjectId'](_0x5c3baa);return await this[_0xcc6f11(0xee)]['setSecret'](_0x3d2538,_0xc0d556,_0x43d3ae),{'projectName':_0x484d87,'key':_0xc0d556};}async[a192_0x3e84c0(0xc9)](_0x581a12,_0x545dcd){const _0xc497a0=a192_0x3e84c0,{id:_0x539867,name:_0xe7d477}=await this['resolveProjectId'](_0x581a12),_0x301a8b=Object[_0xc497a0(0x10a)](_0x545dcd),_0x383680=await Promise[_0xc497a0(0xc6)](_0x301a8b[_0xc497a0(0xdf)](_0xac9682=>this['client'][_0xc497a0(0xd9)](_0x539867,_0xac9682,_0x545dcd[_0xac9682]))),_0x5174b3=_0x383680[_0xc497a0(0xdf)]((_0x17d7aa,_0x4ab48b)=>_0x17d7aa[_0xc497a0(0x10c)]===_0xc497a0(0xc1)?_0x301a8b[_0x4ab48b]:null)[_0xc497a0(0x12d)](_0x85dc6a=>_0x85dc6a!==null);if(_0x5174b3[_0xc497a0(0x10f)]>0x0)throw new SDKError(ErrorCode[_0xc497a0(0xf3)],_0xc497a0(0xd5)+(_0x5174b3[_0xc497a0(0x10f)]>0x1?'s':'')+':\x20'+_0x5174b3[_0xc497a0(0x109)](',\x20'));return{'projectName':_0xe7d477,'keys':_0x301a8b};}async[a192_0x3e84c0(0xbc)](_0x3a80f1,_0x2ae0a5){const _0x1e54b3=a192_0x3e84c0,{id:_0x42e11d,name:_0x568abb}=await this[_0x1e54b3(0xca)](_0x3a80f1);return await this[_0x1e54b3(0xee)][_0x1e54b3(0xbc)](_0x42e11d,_0x2ae0a5),{'projectName':_0x568abb,'key':_0x2ae0a5};}async[a192_0x3e84c0(0x122)](_0x5613a6,_0x1c2977){const _0x2fe5c6=a192_0x3e84c0;return pullWorkflow({'client':this[_0x2fe5c6(0xee)],'resolveProjectId':this[_0x2fe5c6(0xca)][_0x2fe5c6(0x115)](this)},_0x5613a6,_0x1c2977);}async[a192_0x3e84c0(0x101)](_0x46be4e,_0x5edc4d){const _0x307809=a192_0x3e84c0;return applyPullResult({'client':this['client'],'resolveProjectId':this[_0x307809(0xca)][_0x307809(0x115)](this)},_0x46be4e,_0x5edc4d);}async[a192_0x3e84c0(0x123)](_0x239745){const _0x2371d9=a192_0x3e84c0;return preparePushWorkflow({'client':this[_0x2371d9(0xee)],'resolveProjectId':this[_0x2371d9(0xca)][_0x2371d9(0x115)](this)},_0x239745);}async[a192_0x3e84c0(0xce)](_0x4f906e){const _0x19988c=a192_0x3e84c0;return executePushWorkflow({'client':this['client'],'resolveProjectId':this['resolveProjectId'][_0x19988c(0x115)](this)},_0x4f906e);}async[a192_0x3e84c0(0x107)](_0x3a2d9d,_0x1abb36,_0xa64cdc){const _0x210188=a192_0x3e84c0;return prepareCloneWorkflow({'client':this[_0x210188(0xee)]},_0x3a2d9d,_0x1abb36,_0xa64cdc);}async[a192_0x3e84c0(0xdc)](_0x11a84f){const _0x56aa20=a192_0x3e84c0;return executeCloneWorkflow({'client':this[_0x56aa20(0xee)]},_0x11a84f);}async['listSchedules'](){const _0x22d633=a192_0x3e84c0;return await this[_0x22d633(0xee)][_0x22d633(0x105)]();}async[a192_0x3e84c0(0x116)](_0x2582ad,_0x580a74){const _0x3e85bf=a192_0x3e84c0;return await this['client'][_0x3e85bf(0x116)](_0x2582ad,_0x580a74);}async[a192_0x3e84c0(0x12a)](_0x222928){const _0x11b664=a192_0x3e84c0;return await this['client'][_0x11b664(0x12a)](_0x222928);}}
|
|
1
|
+
const a192_0x6753f9=a192_0x2920;function a192_0x5a2e(){const _0x4324fa=['listAttempts','tdx-workflow-push-','944753gvRVlP','name','getProject','error','client','16pzyZXZ','updatedAt','killAttempt','listSessions','lastId','extract','95431DWLqcK','No\x20','setSecret','retryAt','from','fullName','WORKFLOW_PROJECT_NOT_FOUND','retryParams','executeCloneProject','WORKFLOW_SECRET_SET_FAILED','1990652FmQlwj','params','disableSchedule','project','length','clearScheduleAll','push','retryAttemptName','setSecrets','tar','unlink','preparePushProject','startAttempt','createdAt','startedAt','state','map','config','toISOString','slice','timezone','isGroup','test','resolveProjectId','Invalid\x20workflow\x20format:\x20','logs','skipValidation','tasks','listSchedules','latest','run','attempts','gunzip','finishedAt','attempt','enableSchedule','join','Kill\x20request\x20accepted','Cannot\x20read\x20workflow\x20file:\x20','basename','applyPullProject','zlib','access','Project\x20not\x20found:\x20','listProjects','fromTask','11292010kvdYBf','listLogFiles','logFiles','find','direct','cancelRequested','index','sessions','NUMERIC_ID_PATTERN','indexOf','bind','tmpdir','pullProject','data','force','resumeFrom','.\x20Expected\x20\x22project.workflow\x22','message','create','download','includeRetried','readdir','delete','projects','storeParams','keys','sessionTime','retryAttempt','endsWith','revision','now','isDirectory','substring','.tar.gz','retrySession','12720969YpfJki','workflow','5knBZoQ','516tgmGxi','uploadProjectArchive','rawCount','deleteSecret','8449024KvKTtV','downloadProjectArchive','getAttempt','last_id','sessionId','\x20workflow\x20files\x20found\x20in\x20project\x20directory','path','mkdir','listWorkflows','sessionUuid','stateParams','status','limit','min','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','util','toString','projectName','481974xyXqcG'];a192_0x5a2e=function(){return _0x4324fa;};return a192_0x5a2e();}(function(_0x2f9665,_0x32fa0d){const _0x56e53b=a192_0x2920,_0x18bfc8=_0x2f9665();while(!![]){try{const _0xb1e43a=-parseInt(_0x56e53b(0x1ad))/0x1+parseInt(_0x56e53b(0x130))/0x2*(-parseInt(_0x56e53b(0x1aa))/0x3)+-parseInt(_0x56e53b(0x140))/0x4*(-parseInt(_0x56e53b(0x193))/0x5)+parseInt(_0x56e53b(0x194))/0x6*(parseInt(_0x56e53b(0x136))/0x7)+parseInt(_0x56e53b(0x198))/0x8+parseInt(_0x56e53b(0x191))/0x9+-parseInt(_0x56e53b(0x16e))/0xa;if(_0xb1e43a===_0x32fa0d)break;else _0x18bfc8['push'](_0x18bfc8['shift']());}catch(_0xc24d5){_0x18bfc8['push'](_0x18bfc8['shift']());}}}(a192_0x5a2e,0xbe8a4));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x21ad25,_0x42b8a4,_0x41dc86=0x64){const _0x88f828=a192_0x2920,_0x45dcb5=Math[_0x88f828(0x1a5)](_0x42b8a4,MAX_PAGINATION_LIMIT),_0x5246a2=[];let _0x1531eb;while(_0x5246a2['length']<_0x45dcb5){const _0x32220e=await _0x21ad25(_0x41dc86,_0x1531eb),_0x43939c=_0x32220e[_0x88f828(0x196)]??_0x32220e[_0x88f828(0x17b)]['length'];if(_0x43939c===0x0)break;_0x5246a2[_0x88f828(0x146)](..._0x32220e['data']);if(!_0x32220e[_0x88f828(0x134)]||_0x43939c<_0x41dc86)break;_0x1531eb=_0x32220e[_0x88f828(0x134)];}return _0x5246a2[_0x88f828(0x153)](0x0,_0x45dcb5);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';function a192_0x2920(_0x496181,_0x4db2f2){_0x496181=_0x496181-0x12d;const _0x5a2e18=a192_0x5a2e();let _0x292063=_0x5a2e18[_0x496181];return _0x292063;}import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static ['NUMERIC_ID_PATTERN']=/^\d+$/;[a192_0x6753f9(0x12f)];constructor(_0x21ab69){const _0x2281e4=a192_0x6753f9;this[_0x2281e4(0x12f)]=new WorkflowApiClient(_0x21ab69);}async[a192_0x6753f9(0x157)](_0x11d6eb){const _0x3e4c18=a192_0x6753f9;if(WorkflowSDK[_0x3e4c18(0x176)][_0x3e4c18(0x156)](_0x11d6eb)){const _0x1506a1=await this[_0x3e4c18(0x12f)][_0x3e4c18(0x12d)](_0x11d6eb);return{'id':_0x1506a1['id'],'name':_0x1506a1[_0x3e4c18(0x1ae)]};}const _0x31919b=await this[_0x3e4c18(0x12f)][_0x3e4c18(0x16c)]({'name_pattern':_0x11d6eb}),_0x1120f3=_0x31919b[_0x3e4c18(0x17b)][_0x3e4c18(0x171)](_0x2f986d=>_0x2f986d[_0x3e4c18(0x1ae)]===_0x11d6eb);if(!_0x1120f3)throw new SDKError(ErrorCode[_0x3e4c18(0x13c)],_0x3e4c18(0x16b)+_0x11d6eb);return{'id':_0x1120f3['id'],'name':_0x1120f3[_0x3e4c18(0x1ae)]};}async[a192_0x6753f9(0x185)](_0x5ef9fa,_0x23541c){const _0x51b321=a192_0x6753f9,_0x1ee479=_0x23541c?.['limit']||0x64,_0x59c5e1=await paginateResults((_0x342070,_0x5bdfeb)=>this['client'][_0x51b321(0x16c)]({'name_pattern':_0x5ef9fa,'limit':_0x342070,'last_id':_0x5bdfeb??_0x23541c?.[_0x51b321(0x19b)]}),_0x1ee479);return _0x59c5e1[_0x51b321(0x150)](_0x32a0f5=>({..._0x32a0f5,'project_id':_0x32a0f5['id'],'project_name':_0x32a0f5[_0x51b321(0x1ae)]}));}async['workflows'](_0x390394,_0x532eb4){const _0x42e348=a192_0x6753f9,_0x6a7ff9=_0x532eb4?.['limit']||0x64,_0x25ef02=await paginateResults((_0x2c470f,_0x10574b)=>this[_0x42e348(0x12f)][_0x42e348(0x1a0)]({'project_name':_0x390394,'limit':_0x2c470f,'last_id':_0x10574b??_0x532eb4?.['last_id']}),_0x6a7ff9);return _0x25ef02['map'](_0x3e6045=>({'project_id':_0x3e6045[_0x42e348(0x143)]?.['id'],'project_name':_0x3e6045[_0x42e348(0x143)]?.[_0x42e348(0x1ae)],'workflow_id':_0x3e6045['id'],'workflow_name':_0x3e6045[_0x42e348(0x1ae)],'revision':_0x3e6045[_0x42e348(0x18b)],'timezone':_0x3e6045[_0x42e348(0x154)],'config':_0x3e6045[_0x42e348(0x151)],'id':_0x3e6045['id'],'name':_0x3e6045[_0x42e348(0x1ae)],'project':_0x3e6045['project']}));}async[a192_0x6753f9(0x175)](_0x13bde0){const _0xfb2e5f=a192_0x6753f9;let _0x15c1bb;if(_0x13bde0?.[_0xfb2e5f(0x1a9)]){let _0x4fa380,_0x30e76d=![];while(!_0x30e76d){const _0x4fdb30=await this[_0xfb2e5f(0x12f)]['listProjects']({'limit':0x64,'last_id':_0x4fa380}),_0x3cc469=_0x4fdb30[_0xfb2e5f(0x17b)][_0xfb2e5f(0x171)](_0x4b0f13=>_0x4b0f13[_0xfb2e5f(0x1ae)]===_0x13bde0[_0xfb2e5f(0x1a9)]);if(_0x3cc469){_0x15c1bb=_0x3cc469['id'],_0x30e76d=!![];break;}if(!_0x4fdb30[_0xfb2e5f(0x134)]||_0x4fdb30[_0xfb2e5f(0x17b)]['length']===0x0)break;_0x4fa380=_0x4fdb30[_0xfb2e5f(0x134)];}if(!_0x15c1bb)throw new SDKError(ErrorCode[_0xfb2e5f(0x13c)],_0xfb2e5f(0x16b)+_0x13bde0[_0xfb2e5f(0x1a9)]);}const _0x136d6d=_0x13bde0?.[_0xfb2e5f(0x1a4)]||0x64,_0x1c5ce2=await paginateResults((_0x43bf8f,_0x2b80ff)=>this[_0xfb2e5f(0x12f)][_0xfb2e5f(0x133)]({'project_id':_0x15c1bb,'project_name':_0x13bde0?.[_0xfb2e5f(0x1a9)],'workflow_name':_0x13bde0?.['workflowName'],'status':_0x13bde0?.['status'],'from_time':_0x13bde0?.['fromTime'],'to_time':_0x13bde0?.['toTime'],'limit':_0x43bf8f,'last_id':_0x2b80ff??_0x13bde0?.[_0xfb2e5f(0x19b)]}),_0x136d6d);return _0x1c5ce2['map'](_0x1e6057=>({'project_id':_0x1e6057[_0xfb2e5f(0x143)]?.['id'],'project_name':_0x1e6057[_0xfb2e5f(0x143)]?.[_0xfb2e5f(0x1ae)],'workflow_id':_0x1e6057[_0xfb2e5f(0x192)]?.['id'],'workflow_name':_0x1e6057['workflow']?.[_0xfb2e5f(0x1ae)],'session_id':_0x1e6057['id'],'sessionUuid':_0x1e6057[_0xfb2e5f(0x1a1)],'sessionTime':_0x1e6057[_0xfb2e5f(0x188)],'lastAttempt':_0x1e6057['lastAttempt'],'id':_0x1e6057['id'],'project':_0x1e6057['project'],'workflow':_0x1e6057[_0xfb2e5f(0x192)]}));}async[a192_0x6753f9(0x15f)](_0x2babab){const _0xb5ac74=a192_0x6753f9,_0x3124cb=_0x2babab?.[_0xb5ac74(0x1a4)]||0x64,_0x48c216=await paginateResults((_0x454a47,_0x12d928)=>this[_0xb5ac74(0x12f)][_0xb5ac74(0x1ab)]({'project_name':_0x2babab?.[_0xb5ac74(0x1a9)],'workflow_name':_0x2babab?.['workflowName'],'include_retried':_0x2babab?.[_0xb5ac74(0x182)],'limit':_0x454a47,'last_id':_0x12d928??_0x2babab?.[_0xb5ac74(0x19b)]}),_0x3124cb);return _0x48c216[_0xb5ac74(0x150)](_0x172c91=>({'project_id':_0x172c91['project']?.['id'],'project_name':_0x172c91['project']?.[_0xb5ac74(0x1ae)],'workflow_id':_0x172c91['workflow']?.['id'],'workflow_name':_0x172c91['workflow']?.[_0xb5ac74(0x1ae)],'session_id':_0x172c91['sessionId'],'sessionUuid':_0x172c91[_0xb5ac74(0x1a1)],'sessionTime':_0x172c91[_0xb5ac74(0x188)],'attempt_id':_0x172c91['id'],'attempt_index':_0x172c91[_0xb5ac74(0x174)],'retryAttemptName':_0x172c91[_0xb5ac74(0x147)],'done':_0x172c91['done'],'success':_0x172c91['success'],'cancelRequested':_0x172c91[_0xb5ac74(0x173)],'params':_0x172c91[_0xb5ac74(0x141)],'createdAt':_0x172c91[_0xb5ac74(0x14d)],'finishedAt':_0x172c91[_0xb5ac74(0x161)],'id':_0x172c91['id'],'index':_0x172c91[_0xb5ac74(0x174)],'project':_0x172c91[_0xb5ac74(0x143)],'workflow':_0x172c91[_0xb5ac74(0x192)]}));}async[a192_0x6753f9(0x162)](_0x4f5d3c){const _0x3a74fb=a192_0x6753f9,_0x37dd06=await this[_0x3a74fb(0x12f)][_0x3a74fb(0x19a)](_0x4f5d3c);return _0x37dd06;}async[a192_0x6753f9(0x15b)](_0x381a54,_0x4ee769=![]){const _0x59168d=a192_0x6753f9,_0x5cf726=await this[_0x59168d(0x12f)]['getAttemptTasks'](_0x381a54,_0x4ee769);return _0x5cf726[_0x59168d(0x150)](_0x1b400d=>({'task_id':_0x1b400d['id'],'task_name':_0x1b400d[_0x59168d(0x13b)],'parentId':_0x1b400d['parentId'],'config':_0x1b400d[_0x59168d(0x151)],'upstreams':_0x1b400d['upstreams'],'state':_0x1b400d[_0x59168d(0x14f)],'exportParams':_0x1b400d['exportParams'],'storeParams':_0x1b400d[_0x59168d(0x186)],'stateParams':_0x1b400d[_0x59168d(0x1a2)],'updatedAt':_0x1b400d[_0x59168d(0x131)],'retryAt':_0x1b400d[_0x59168d(0x139)],'startedAt':_0x1b400d[_0x59168d(0x14e)],'error':_0x1b400d[_0x59168d(0x12e)],'isGroup':_0x1b400d[_0x59168d(0x155)],'id':_0x1b400d['id'],'fullName':_0x1b400d[_0x59168d(0x13b)]}));}async[a192_0x6753f9(0x170)](_0x5a4f0,_0x588525){const _0x1bea6a=a192_0x6753f9;return await this[_0x1bea6a(0x12f)][_0x1bea6a(0x16f)](_0x5a4f0,_0x588525);}async[a192_0x6753f9(0x159)](_0x403559,_0xbf5a3c){const _0x20d6ca=a192_0x6753f9,_0x53efa8=await import(_0x20d6ca(0x169)),{promisify:_0x5e4403}=await import(_0x20d6ca(0x1a7)),_0x2b7ed8=_0x5e4403(_0x53efa8[_0x20d6ca(0x160)]),_0x4cb785=await this['client'][_0x20d6ca(0x16f)](_0x403559,_0xbf5a3c);if(_0x4cb785[_0x20d6ca(0x144)]===0x0)return'';const _0x3d9fa9=[];for(const _0x2d2a4d of _0x4cb785){if(!_0x2d2a4d[_0x20d6ca(0x172)])continue;const _0x312d4d=await fetch(_0x2d2a4d[_0x20d6ca(0x172)]);if(!_0x312d4d['ok'])throw new Error('Failed\x20to\x20download\x20log\x20file:\x20'+_0x312d4d[_0x20d6ca(0x1a3)]);const _0x29d9fe=Buffer[_0x20d6ca(0x13a)](await _0x312d4d['arrayBuffer']()),_0x181477=await _0x2b7ed8(_0x29d9fe);_0x3d9fa9['push'](_0x181477[_0x20d6ca(0x1a8)]('utf-8'));}return _0x3d9fa9[_0x20d6ca(0x164)]('\x0a');}async['kill'](_0x18c6b7,_0x3a80aa){const _0x4e681f=a192_0x6753f9,_0x25a8a8=await this[_0x4e681f(0x12f)][_0x4e681f(0x132)](_0x18c6b7,_0x3a80aa);return _0x25a8a8?.[_0x4e681f(0x17f)]??_0x4e681f(0x165);}async[a192_0x6753f9(0x190)](_0x23c527,_0x42433e){const _0x15362d=a192_0x6753f9,_0xbe8977=await this[_0x15362d(0x12f)][_0x15362d(0x190)](_0x23c527,{'from_task':_0x42433e?.[_0x15362d(0x16d)],'retry_params':_0x42433e?.['retryParams']});return{'attemptId':_0xbe8977['id'],'sessionId':_0xbe8977['sessionId']};}async[a192_0x6753f9(0x189)](_0x44c76f,_0x2a7243){const _0x2065b2=a192_0x6753f9,_0x411a17=await this['client'][_0x2065b2(0x189)](_0x44c76f,{'resume_from':_0x2a7243?.[_0x2065b2(0x17d)],'retry_params':_0x2a7243?.[_0x2065b2(0x13d)],'force':_0x2a7243?.[_0x2065b2(0x17c)]});return{'attemptId':_0x411a17['id'],'sessionId':_0x411a17[_0x2065b2(0x19c)]};}async[a192_0x6753f9(0x15e)](_0x2ed32a,_0x50bd26={},_0x1695b1){const _0x43b5da=a192_0x6753f9,_0x448639=_0x2ed32a[_0x43b5da(0x177)]('.');let _0x2d774a,_0x514a17;if(_0x448639===-0x1)throw new Error(_0x43b5da(0x1a6));_0x2d774a=_0x2ed32a[_0x43b5da(0x18e)](0x0,_0x448639),_0x514a17=_0x2ed32a[_0x43b5da(0x18e)](_0x448639+0x1);if(!_0x2d774a||!_0x514a17)throw new Error(_0x43b5da(0x158)+_0x2ed32a+_0x43b5da(0x17e));const _0x5eb247=_0x1695b1?.[_0x43b5da(0x188)]||new Date()['toISOString']();return await this[_0x43b5da(0x12f)][_0x43b5da(0x14c)]({'projectName':_0x2d774a,'workflowName':_0x514a17,'sessionTime':_0x5eb247,'params':_0x50bd26});}async[a192_0x6753f9(0x181)](_0x2d0637,_0xeedbc4,_0x556c7d){const _0x26ed4b=a192_0x6753f9,{promises:_0xb1ff36}=await import('fs'),_0x554079=await import('path'),_0x3e47df=await import('os'),_0x52c234=await import(_0x26ed4b(0x149)),{id:_0x5249f9,name:_0x113ccc}=await this['resolveProjectId'](_0x2d0637),_0x1641dd=_0x3e47df[_0x26ed4b(0x179)](),_0x345190=_0x554079['join'](_0x1641dd,'tdx-workflow-'+_0x5249f9+'-'+Date[_0x26ed4b(0x18c)]()+_0x26ed4b(0x18f));try{await this[_0x26ed4b(0x12f)][_0x26ed4b(0x199)](_0x5249f9,_0x345190,_0x556c7d?.[_0x26ed4b(0x18b)]);const _0x5b525a=_0x554079[_0x26ed4b(0x164)](_0xeedbc4,_0x113ccc);await _0xb1ff36[_0x26ed4b(0x19f)](_0x5b525a,{'recursive':!![]}),await _0x52c234[_0x26ed4b(0x135)]({'file':_0x345190,'cwd':_0x5b525a,'gzip':!![]});const _0x53fb90=async _0x574ac1=>{const _0x31f064=_0x26ed4b;let _0x4c0a57=0x0;const _0x1eab68=await _0xb1ff36[_0x31f064(0x183)](_0x574ac1,{'withFileTypes':!![]});for(const _0x30f9eb of _0x1eab68){const _0x1196bc=_0x554079[_0x31f064(0x164)](_0x574ac1,_0x30f9eb[_0x31f064(0x1ae)]);if(_0x30f9eb['isFile']())_0x4c0a57++;else _0x30f9eb[_0x31f064(0x18d)]()&&(_0x4c0a57+=await _0x53fb90(_0x1196bc));}return _0x4c0a57;},_0x33a09a=await _0x53fb90(_0x5b525a);return{'projectName':_0x113ccc,'revision':_0x556c7d?.['revision']||_0x26ed4b(0x15d),'filesExtracted':_0x33a09a};}finally{try{await _0xb1ff36[_0x26ed4b(0x14a)](_0x345190);}catch{}}}async['push'](_0x201649,_0x47b79a){const _0x3c1823=a192_0x6753f9,{promises:_0x3cb343}=await import('fs'),_0x51c1a1=await import(_0x3c1823(0x19e)),_0x52a193=await import(_0x3c1823(0x149)),_0x3f5ee5=_0x47b79a?.[_0x3c1823(0x1a9)]||_0x51c1a1[_0x3c1823(0x167)](_0x201649),_0x4bfc96=_0x47b79a?.[_0x3c1823(0x18b)]||new Date()[_0x3c1823(0x152)]()['replace'](/[:.]/g,'-');try{await _0x3cb343[_0x3c1823(0x16a)](_0x201649);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0x201649);}if(!_0x47b79a?.[_0x3c1823(0x15a)]){const _0x6cb9c9=await _0x3cb343[_0x3c1823(0x183)](_0x201649),_0x3a2bbe=_0x6cb9c9['filter'](_0x31e902=>_0x31e902[_0x3c1823(0x18a)](WORKFLOW_FILE_EXTENSION));if(_0x3a2bbe[_0x3c1823(0x144)]===0x0)throw new Error(_0x3c1823(0x137)+WORKFLOW_FILE_EXTENSION+_0x3c1823(0x19d));for(const _0x539ff7 of _0x3a2bbe){const _0x1ef1ba=_0x51c1a1[_0x3c1823(0x164)](_0x201649,_0x539ff7);try{await _0x3cb343[_0x3c1823(0x16a)](_0x1ef1ba);}catch{throw new Error(_0x3c1823(0x166)+_0x539ff7);}}}const _0x27ba6b=async(_0xe5d8fc,_0x542799='')=>{const _0x2b9658=_0x3c1823,_0x3e4943=await _0x3cb343[_0x2b9658(0x183)](_0xe5d8fc,{'withFileTypes':!![]}),_0x49d21b=[];for(const _0x290fad of _0x3e4943){const _0x853edc=_0x51c1a1['join'](_0x542799,_0x290fad[_0x2b9658(0x1ae)]),_0x1ec3a5=_0x51c1a1['join'](_0xe5d8fc,_0x290fad['name']);if(!shouldIncludeInArchive(_0x290fad[_0x2b9658(0x1ae)]))continue;_0x290fad[_0x2b9658(0x18d)]()?_0x49d21b[_0x2b9658(0x146)](...await _0x27ba6b(_0x1ec3a5,_0x853edc)):_0x49d21b[_0x2b9658(0x146)](_0x853edc);}return _0x49d21b;},_0x50c2ba=await _0x27ba6b(_0x201649),_0x19fe48=await import('os'),_0x1a600d=_0x19fe48[_0x3c1823(0x179)](),_0x48c1bb=_0x51c1a1['join'](_0x1a600d,_0x3c1823(0x1ac)+Date[_0x3c1823(0x18c)]()+_0x3c1823(0x18f));try{await _0x52a193[_0x3c1823(0x180)]({'file':_0x48c1bb,'gzip':!![],'cwd':_0x201649,'portable':!![]},_0x50c2ba);const _0x179208=await this[_0x3c1823(0x12f)][_0x3c1823(0x195)](_0x3f5ee5,_0x4bfc96,_0x48c1bb,{'scheduleFrom':_0x47b79a?.['scheduleFrom'],'clearSchedule':_0x47b79a?.['clearSchedule'],'clearScheduleAll':_0x47b79a?.[_0x3c1823(0x145)]});return{'projectId':_0x179208['id'],'projectName':_0x179208[_0x3c1823(0x1ae)],'revision':_0x179208[_0x3c1823(0x18b)]};}finally{try{await _0x3cb343[_0x3c1823(0x14a)](_0x48c1bb);}catch{}}}async[a192_0x6753f9(0x184)](_0x27751b){const _0x597371=a192_0x6753f9,{id:_0x43d159}=await this[_0x597371(0x157)](_0x27751b),_0x10d503=await this[_0x597371(0x12f)]['deleteProject'](_0x43d159);return{'projectId':_0x10d503['id'],'projectName':_0x10d503[_0x597371(0x1ae)]};}async['listSecrets'](_0x1fa89e){const _0x287985=a192_0x6753f9,{id:_0x39292e,name:_0x486265}=await this[_0x287985(0x157)](_0x1fa89e),_0x295ef4=await this[_0x287985(0x12f)]['listSecrets'](_0x39292e);return{'projectName':_0x486265,'secrets':_0x295ef4};}async['setSecret'](_0x40bc97,_0x20a093,_0x2caf2f){const _0x6f7327=a192_0x6753f9,{id:_0x377318,name:_0x59edca}=await this['resolveProjectId'](_0x40bc97);return await this[_0x6f7327(0x12f)][_0x6f7327(0x138)](_0x377318,_0x20a093,_0x2caf2f),{'projectName':_0x59edca,'key':_0x20a093};}async[a192_0x6753f9(0x148)](_0x573f41,_0x28db57){const _0x401a49=a192_0x6753f9,{id:_0x4ab1f3,name:_0x191268}=await this[_0x401a49(0x157)](_0x573f41),_0x4b73e1=Object[_0x401a49(0x187)](_0x28db57),_0x4ec070=await Promise['allSettled'](_0x4b73e1['map'](_0x258a43=>this[_0x401a49(0x12f)][_0x401a49(0x138)](_0x4ab1f3,_0x258a43,_0x28db57[_0x258a43]))),_0x345cff=_0x4ec070[_0x401a49(0x150)]((_0x155157,_0x50c58c)=>_0x155157[_0x401a49(0x1a3)]==='rejected'?_0x4b73e1[_0x50c58c]:null)['filter'](_0x34dc19=>_0x34dc19!==null);if(_0x345cff[_0x401a49(0x144)]>0x0)throw new SDKError(ErrorCode[_0x401a49(0x13f)],'Failed\x20to\x20set\x20secret'+(_0x345cff['length']>0x1?'s':'')+':\x20'+_0x345cff[_0x401a49(0x164)](',\x20'));return{'projectName':_0x191268,'keys':_0x4b73e1};}async[a192_0x6753f9(0x197)](_0x26890e,_0x2b4ce7){const _0x3aeb84=a192_0x6753f9,{id:_0x553aba,name:_0x2fde1c}=await this[_0x3aeb84(0x157)](_0x26890e);return await this[_0x3aeb84(0x12f)][_0x3aeb84(0x197)](_0x553aba,_0x2b4ce7),{'projectName':_0x2fde1c,'key':_0x2b4ce7};}async[a192_0x6753f9(0x17a)](_0x2193a0,_0x110dae){const _0x857b0a=a192_0x6753f9;return pullWorkflow({'client':this['client'],'resolveProjectId':this[_0x857b0a(0x157)][_0x857b0a(0x178)](this)},_0x2193a0,_0x110dae);}async[a192_0x6753f9(0x168)](_0x6e6127,_0x1e707a){const _0x1d1b2e=a192_0x6753f9;return applyPullResult({'client':this[_0x1d1b2e(0x12f)],'resolveProjectId':this[_0x1d1b2e(0x157)][_0x1d1b2e(0x178)](this)},_0x6e6127,_0x1e707a);}async[a192_0x6753f9(0x14b)](_0x55e276){const _0x4b5e51=a192_0x6753f9;return preparePushWorkflow({'client':this[_0x4b5e51(0x12f)],'resolveProjectId':this[_0x4b5e51(0x157)]['bind'](this)},_0x55e276);}async['executePushProject'](_0x31e29b){const _0x27e6b9=a192_0x6753f9;return executePushWorkflow({'client':this[_0x27e6b9(0x12f)],'resolveProjectId':this[_0x27e6b9(0x157)][_0x27e6b9(0x178)](this)},_0x31e29b);}async['prepareCloneProject'](_0x264047,_0x35d8bc,_0x758d0f){const _0xa40a23=a192_0x6753f9;return prepareCloneWorkflow({'client':this[_0xa40a23(0x12f)]},_0x264047,_0x35d8bc,_0x758d0f);}async[a192_0x6753f9(0x13e)](_0x313cd9){const _0x1f3a23=a192_0x6753f9;return executeCloneWorkflow({'client':this[_0x1f3a23(0x12f)]},_0x313cd9);}async[a192_0x6753f9(0x15c)](){const _0x2d1e9b=a192_0x6753f9;return await this[_0x2d1e9b(0x12f)][_0x2d1e9b(0x15c)]();}async[a192_0x6753f9(0x163)](_0x124d95,_0x48ac99){const _0x57300f=a192_0x6753f9;return await this[_0x57300f(0x12f)]['enableSchedule'](_0x124d95,_0x48ac99);}async[a192_0x6753f9(0x142)](_0x2e6ddb){const _0x8bdea5=a192_0x6753f9;return await this['client'][_0x8bdea5(0x142)](_0x2e6ddb);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a193_0x1867(){const _0x3a77b6=['sort','length','path','\x20(archive\x20size:\x20','481738zwUTLM','zlib','archive.tar.gz','includes','cwd','toISOString','3909180hoLcmg','readdir','push','downloadProjectArchive','join','changes','7reZZRz','targetDir','new','type','tdx.json','revision','name','size','mkdir','41035nFjWun','597879arAsYs','unlink','618ipgbGX','projectId','tar','latest','localeCompare','WORKFLOW_ARCHIVE_CORRUPTED','catch','utf-8','add','4710498ibxEQf','110TeCgJw','modified','filter','extract','Failed\x20to\x20extract\x20project\x20archive','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','deleted','tmpdir','extracted','The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.','mkdtemp','has','tdx-wf-pull-','\x20bytes)','projectName','TAR_BAD_ARCHIVE','11410968NVeCkq','unchanged','1758998CyvLyf','message'];a193_0x1867=function(){return _0x3a77b6;};return a193_0x1867();}(function(_0x1797e7,_0x3ddded){const _0x359bf3=a193_0x5ca1,_0x2c243a=_0x1797e7();while(!![]){try{const _0x5bb8fa=parseInt(_0x359bf3(0x164))/0x1+parseInt(_0x359bf3(0x198))/0x2+-parseInt(_0x359bf3(0x185))/0x3+parseInt(_0x359bf3(0x16a))/0x4+parseInt(_0x359bf3(0x179))/0x5*(parseInt(_0x359bf3(0x17c))/0x6)+parseInt(_0x359bf3(0x170))/0x7*(-parseInt(_0x359bf3(0x196))/0x8)+parseInt(_0x359bf3(0x17a))/0x9*(parseInt(_0x359bf3(0x186))/0xa);if(_0x5bb8fa===_0x3ddded)break;else _0x2c243a['push'](_0x2c243a['shift']());}catch(_0x12e438){_0x2c243a['push'](_0x2c243a['shift']());}}}(a193_0x1867,0xe0229));import{existsSync,promises as a193_0x1e62a0}from'fs';import a193_0xad194f from'path';import a193_0x2c0d2b 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(_0x1f029f,_0x166a95,_0x252d18={}){const _0xad5750=a193_0x5ca1,_0x463573=await import(_0xad5750(0x17e)),{client:_0x11240b,resolveProjectId:_0x27f473}=_0x1f029f,{id:_0xfbb595,name:_0x6c8359}=await _0x27f473(_0x166a95),_0x1f45b2=_0x252d18['baseDir']||process[_0xad5750(0x168)](),_0x36b5ac=_0x252d18['targetDir']||getWorkflowProjectDir(_0x6c8359,_0x1f45b2),_0x574124=a193_0xad194f[_0xad5750(0x16e)](_0x36b5ac,_0xad5750(0x174)),_0x35aad1=!existsSync(_0x574124),_0x533ff2=await a193_0x1e62a0[_0xad5750(0x190)](a193_0xad194f[_0xad5750(0x16e)](a193_0x2c0d2b[_0xad5750(0x18d)](),_0xad5750(0x192))),_0x3832f4=a193_0xad194f[_0xad5750(0x16e)](_0x533ff2,_0xad5750(0x166)),_0x49e1ad=a193_0xad194f[_0xad5750(0x16e)](_0x533ff2,_0xad5750(0x18e));try{await _0x11240b[_0xad5750(0x16d)](_0xfbb595,_0x3832f4,_0x252d18[_0xad5750(0x175)]),await a193_0x1e62a0[_0xad5750(0x178)](_0x49e1ad,{'recursive':!![]});try{await _0x463573[_0xad5750(0x189)]({'file':_0x3832f4,'cwd':_0x49e1ad,'gzip':!![]});}catch(_0x588668){const _0x4d6ff3=_0x588668 instanceof Error?_0x588668[_0xad5750(0x199)]:String(_0x588668);if(_0x4d6ff3[_0xad5750(0x167)](_0xad5750(0x195))||_0x4d6ff3[_0xad5750(0x167)]('zlib')){const _0x42bbb5=await a193_0x1e62a0['stat'](_0x3832f4)[_0xad5750(0x182)](()=>null),_0x22c11c=_0x42bbb5?'\x20(archive\x20size:\x20'+_0x42bbb5['size']+_0xad5750(0x193):'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0xad5750(0x18a)+_0x22c11c+':\x20'+_0x4d6ff3,_0x588668,{'helpText':_0xad5750(0x18b)+_0xad5750(0x18f)});}throw _0x588668;}const _0x542e9f=await _0x11240b['getProject'](_0xfbb595),_0x3cf06d=_0x252d18[_0xad5750(0x175)]||_0x542e9f['revision']||_0xad5750(0x17f),_0x4e6307=await calculateChanges(_0x36b5ac,_0x49e1ad,_0x35aad1),_0xde3e39={'new':_0x4e6307[_0xad5750(0x188)](_0x16206c=>_0x16206c[_0xad5750(0x173)]===_0xad5750(0x172))['length'],'modified':_0x4e6307['filter'](_0x23b7f2=>_0x23b7f2[_0xad5750(0x173)]===_0xad5750(0x187))[_0xad5750(0x161)],'deleted':_0x4e6307['filter'](_0x4f2817=>_0x4f2817[_0xad5750(0x173)]===_0xad5750(0x18c))['length'],'unchanged':_0x4e6307[_0xad5750(0x188)](_0x2efb67=>_0x2efb67[_0xad5750(0x173)]===_0xad5750(0x197))[_0xad5750(0x161)]};return{'projectName':_0x6c8359,'projectId':_0xfbb595,'revision':_0x3cf06d,'targetDir':_0x36b5ac,'changes':_0x4e6307,'summary':_0xde3e39,'hasChanges':_0xde3e39['new']>0x0||_0xde3e39['modified']>0x0||_0xde3e39[_0xad5750(0x18c)]>0x0,'isNewProject':_0x35aad1};}finally{await a193_0x1e62a0['rm'](_0x533ff2,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0x83ba02,_0x13e2e9,_0x3dc534={}){const _0x2ede8b=a193_0x5ca1,_0x2de67c=await import(_0x2ede8b(0x17e)),{client:_0x51b65d}=_0x83ba02,_0x2b4bc9=await a193_0x1e62a0[_0x2ede8b(0x190)](a193_0xad194f['join'](a193_0x2c0d2b[_0x2ede8b(0x18d)](),'tdx-wf-apply-')),_0x27c3b0=a193_0xad194f['join'](_0x2b4bc9,_0x2ede8b(0x166));try{await _0x51b65d[_0x2ede8b(0x16d)](_0x13e2e9['projectId'],_0x27c3b0,_0x3dc534[_0x2ede8b(0x175)]),await a193_0x1e62a0[_0x2ede8b(0x178)](_0x13e2e9['targetDir'],{'recursive':!![]});for(const _0x4a286b of _0x13e2e9[_0x2ede8b(0x16f)]){if(_0x4a286b[_0x2ede8b(0x173)]==='deleted'){const _0x104e4f=a193_0xad194f[_0x2ede8b(0x16e)](_0x13e2e9['targetDir'],_0x4a286b[_0x2ede8b(0x162)]);await a193_0x1e62a0[_0x2ede8b(0x17b)](_0x104e4f)[_0x2ede8b(0x182)](()=>{});}}try{await _0x2de67c[_0x2ede8b(0x189)]({'file':_0x27c3b0,'cwd':_0x13e2e9[_0x2ede8b(0x171)],'gzip':!![]});}catch(_0x10f0c8){const _0x592398=_0x10f0c8 instanceof Error?_0x10f0c8[_0x2ede8b(0x199)]:String(_0x10f0c8);if(_0x592398[_0x2ede8b(0x167)](_0x2ede8b(0x195))||_0x592398[_0x2ede8b(0x167)](_0x2ede8b(0x165))){const _0x27ded4=await a193_0x1e62a0['stat'](_0x27c3b0)['catch'](()=>null),_0x3d28fc=_0x27ded4?_0x2ede8b(0x163)+_0x27ded4[_0x2ede8b(0x177)]+_0x2ede8b(0x193):'';throw new SDKError(ErrorCode[_0x2ede8b(0x181)],_0x2ede8b(0x18a)+_0x3d28fc+':\x20'+_0x592398,_0x10f0c8,{'helpText':_0x2ede8b(0x18b)+_0x2ede8b(0x18f)});}throw _0x10f0c8;}const _0xed1f3=a193_0xad194f[_0x2ede8b(0x16e)](_0x13e2e9[_0x2ede8b(0x171)],_0x2ede8b(0x174));if(_0x13e2e9['isNewProject']){const _0x42bc71=createWorkflowTdxConfigContent(_0x13e2e9[_0x2ede8b(0x194)],_0x13e2e9[_0x2ede8b(0x17d)],_0x13e2e9['revision']);await a193_0x1e62a0['writeFile'](_0xed1f3,_0x42bc71,_0x2ede8b(0x183));}else updateWorkflowTdxConfig(_0xed1f3,{'last_pulled_revision':_0x13e2e9['revision'],'last_pulled_at':new Date()[_0x2ede8b(0x169)]()});}finally{await a193_0x1e62a0['rm'](_0x2b4bc9,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x1963e3,_0x48ac5a,_0x1a8cbe){const _0x52974f=a193_0x5ca1,_0x397b1c=[],_0x12e149=await getAllFiles(_0x48ac5a),_0xa476f5=existsSync(_0x1963e3)?await getAllFiles(_0x1963e3):new Set();for(const _0x59aa9b of _0x12e149){const _0x299077=a193_0xad194f[_0x52974f(0x16e)](_0x1963e3,_0x59aa9b),_0x1c5f1e=a193_0xad194f[_0x52974f(0x16e)](_0x48ac5a,_0x59aa9b);if(_0x59aa9b==='tdx.json')continue;const _0xe00540=await a193_0x1e62a0['readFile'](_0x1c5f1e,_0x52974f(0x183))[_0x52974f(0x182)](()=>null);if(_0xe00540===null)continue;if(!existsSync(_0x299077)||_0x1a8cbe)_0x397b1c[_0x52974f(0x16c)]({'path':_0x59aa9b,'type':_0x52974f(0x172),'newContent':_0xe00540});else{const _0x3a81f8=await a193_0x1e62a0['readFile'](_0x299077,_0x52974f(0x183))[_0x52974f(0x182)](()=>null);if(_0x3a81f8===null)_0x397b1c['push']({'path':_0x59aa9b,'type':'modified','newContent':_0xe00540});else{if(_0x3a81f8!==_0xe00540){const _0xe9a771=generateDiff(_0x3a81f8,_0xe00540),_0x55e63f=hasChanges(_0xe9a771)?formatDiffWithColors(_0xe9a771):undefined;_0x397b1c[_0x52974f(0x16c)]({'path':_0x59aa9b,'type':_0x52974f(0x187),'oldContent':_0x3a81f8,'newContent':_0xe00540,'diff':_0x55e63f});}else _0x397b1c[_0x52974f(0x16c)]({'path':_0x59aa9b,'type':_0x52974f(0x197)});}}}if(!_0x1a8cbe)for(const _0x3b1598 of _0xa476f5){if(_0x3b1598===_0x52974f(0x174))continue;if(!_0x12e149[_0x52974f(0x191)](_0x3b1598)){const _0x270071=a193_0xad194f[_0x52974f(0x16e)](_0x1963e3,_0x3b1598),_0x838241=await a193_0x1e62a0['readFile'](_0x270071,'utf-8')[_0x52974f(0x182)](()=>undefined);_0x397b1c[_0x52974f(0x16c)]({'path':_0x3b1598,'type':_0x52974f(0x18c),'oldContent':_0x838241});}}return _0x397b1c[_0x52974f(0x19a)]((_0x2467c1,_0x4aa50f)=>_0x2467c1[_0x52974f(0x162)][_0x52974f(0x180)](_0x4aa50f[_0x52974f(0x162)])),_0x397b1c;}function a193_0x5ca1(_0x4d81ce,_0x29ca9a){_0x4d81ce=_0x4d81ce-0x161;const _0x18678f=a193_0x1867();let _0x5ca1c2=_0x18678f[_0x4d81ce];return _0x5ca1c2;}async function getAllFiles(_0x23035c,_0x3cd9fb=''){const _0x23e47b=a193_0x5ca1,_0x105099=new Set();if(!existsSync(_0x23035c))return _0x105099;const _0x276de4=await a193_0x1e62a0[_0x23e47b(0x16b)](_0x23035c,{'withFileTypes':!![]});for(const _0x2bee32 of _0x276de4){const _0x278f1c=_0x3cd9fb?a193_0xad194f['join'](_0x3cd9fb,_0x2bee32[_0x23e47b(0x176)]):_0x2bee32['name'];if(_0x2bee32['isDirectory']()){const _0x21c81f=await getAllFiles(a193_0xad194f[_0x23e47b(0x16e)](_0x23035c,_0x2bee32[_0x23e47b(0x176)]),_0x278f1c);for(const _0x149956 of _0x21c81f){_0x105099[_0x23e47b(0x184)](_0x149956);}}else _0x105099[_0x23e47b(0x184)](_0x278f1c);}return _0x105099;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x42289f,_0x263a44){const _0x37d383=a194_0xdb9c,_0x580c09=_0x42289f();while(!![]){try{const _0x29e04a=parseInt(_0x37d383(0x1c2))/0x1+-parseInt(_0x37d383(0x1a4))/0x2*(parseInt(_0x37d383(0x1ab))/0x3)+parseInt(_0x37d383(0x19d))/0x4+-parseInt(_0x37d383(0x1c5))/0x5+-parseInt(_0x37d383(0x1a2))/0x6+parseInt(_0x37d383(0x1b3))/0x7*(parseInt(_0x37d383(0x1ba))/0x8)+-parseInt(_0x37d383(0x1c0))/0x9;if(_0x29e04a===_0x263a44)break;else _0x580c09['push'](_0x580c09['shift']());}catch(_0xe8f7c0){_0x580c09['push'](_0x580c09['shift']());}}}(a194_0x35e0,0xa6e84));import{promises as a194_0x23e413}from'fs';function a194_0xdb9c(_0x1dbb12,_0x1bec86){_0x1dbb12=_0x1dbb12-0x198;const _0x35e09f=a194_0x35e0();let _0xdb9cbe=_0x35e09f[_0x1dbb12];return _0xdb9cbe;}import a194_0x3ae9d0 from'path';import a194_0x2b9971 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';import{SDKError,ErrorCode}from'../errors.js';function a194_0x35e0(){const _0x553c65=['tdx.json','tdx-wf-push-archive-','isDirectory','new','configResult','length','localeCompare','stat','modified','tmpdir','mkdtemp','readFile','4194836bztLvo','posix','name','\x20(archive\x20size:\x20','join','4529760ijwyhJ','readdir','452908MnSgtI','catch','archive.tar.gz','TAR_BAD_ARCHIVE','extract','filter','\x20workflow\x20files\x20found\x20in\x20','3YFKNNy','zlib','uploadProjectArchive','replace','revision','tdx-wf-push-','push','sort','7Ivigsl','sourceDir','.digdagignore','configPath','tar','utf-8','includes','8806472vVxQXF','create','type','workflow_project','downloadProjectArchive','add','7134156DbzNqV','deleted','1093130fnkaCW','toISOString','has','3924490UmewGf','endsWith'];a194_0x35e0=function(){return _0x553c65;};return a194_0x35e0();}export async function preparePushWorkflow(_0x1dc41a,_0x3e913a={}){const _0x4211c6=a194_0xdb9c,_0x210fd1=await import(_0x4211c6(0x1b7)),{client:_0x5ef22a,resolveProjectId:_0x259c7b}=_0x1dc41a,_0x8eb6c8=_0x3e913a[_0x4211c6(0x1b4)]||process['cwd'](),_0x3c627d=findWorkflowTdxConfig(_0x8eb6c8),{config:_0x3eb957,configDir:_0x40fc06}=_0x3c627d;let _0x5d745d,_0x376ac2=_0x3eb957[_0x4211c6(0x1bd)];try{const _0x5abab6=await _0x259c7b(_0x3eb957['workflow_project']);_0x5d745d=_0x5abab6['id'],_0x376ac2=_0x5abab6[_0x4211c6(0x19f)];}catch{_0x5d745d='';}const _0xeaf054=_0x3e913a[_0x4211c6(0x1af)]||new Date()[_0x4211c6(0x1c3)]()[_0x4211c6(0x1ae)](/[:.]/g,'-');if(!_0x3e913a['skipValidation']){const _0x316d14=await a194_0x23e413[_0x4211c6(0x1a3)](_0x40fc06),_0x4e6e29=_0x316d14['filter'](_0x1b68c2=>_0x1b68c2[_0x4211c6(0x1c6)](WORKFLOW_FILE_EXTENSION));if(_0x4e6e29[_0x4211c6(0x1cc)]===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+_0x4211c6(0x1aa)+_0x40fc06);}const _0x1a1103=await getProjectFiles(_0x40fc06);let _0xc8e107;if(_0x5d745d){const _0x1c3db6=await a194_0x23e413['mkdtemp'](a194_0x3ae9d0[_0x4211c6(0x1a1)](a194_0x2b9971['tmpdir'](),_0x4211c6(0x1b0))),_0x4f81a6=a194_0x3ae9d0[_0x4211c6(0x1a1)](_0x1c3db6,_0x4211c6(0x1a6)),_0x282c6d=a194_0x3ae9d0[_0x4211c6(0x1a1)](_0x1c3db6,'extracted');try{await _0x5ef22a[_0x4211c6(0x1be)](_0x5d745d,_0x4f81a6),await a194_0x23e413['mkdir'](_0x282c6d,{'recursive':!![]});try{await _0x210fd1[_0x4211c6(0x1a8)]({'file':_0x4f81a6,'cwd':_0x282c6d,'gzip':!![]});}catch(_0x5b8a87){const _0x4a0d93=_0x5b8a87 instanceof Error?_0x5b8a87['message']:String(_0x5b8a87);if(_0x4a0d93[_0x4211c6(0x1b9)](_0x4211c6(0x1a7))||_0x4a0d93[_0x4211c6(0x1b9)](_0x4211c6(0x1ac))){const _0x510a3c=await a194_0x23e413[_0x4211c6(0x198)](_0x4f81a6)['catch'](()=>null),_0x270c20=_0x510a3c?_0x4211c6(0x1a0)+_0x510a3c['size']+'\x20bytes)':'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],'Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison'+_0x270c20+':\x20'+_0x4a0d93,_0x5b8a87,{'helpText':'Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.'});}throw _0x5b8a87;}_0xc8e107=await calculatePushChanges(_0x40fc06,_0x282c6d,_0x1a1103);}finally{await a194_0x23e413['rm'](_0x1c3db6,{'recursive':!![],'force':!![]});}}else{_0xc8e107=[];for(const _0x3a1266 of _0x1a1103){const _0x3a8ec5=a194_0x3ae9d0[_0x4211c6(0x1a1)](_0x40fc06,_0x3a1266),_0x3a58ce=await a194_0x23e413[_0x4211c6(0x19c)](_0x3a8ec5,_0x4211c6(0x1b8))[_0x4211c6(0x1a5)](()=>null);_0xc8e107[_0x4211c6(0x1b1)]({'path':_0x3a1266,'type':'new','newContent':_0x3a58ce||undefined});}}const _0x8907c1={'new':_0xc8e107[_0x4211c6(0x1a9)](_0x2b672b=>_0x2b672b[_0x4211c6(0x1bc)]===_0x4211c6(0x1ca))[_0x4211c6(0x1cc)],'modified':_0xc8e107['filter'](_0x448202=>_0x448202[_0x4211c6(0x1bc)]===_0x4211c6(0x199))['length'],'deleted':_0xc8e107[_0x4211c6(0x1a9)](_0x4a9013=>_0x4a9013[_0x4211c6(0x1bc)]===_0x4211c6(0x1c1))[_0x4211c6(0x1cc)],'unchanged':_0xc8e107[_0x4211c6(0x1a9)](_0xb0661c=>_0xb0661c[_0x4211c6(0x1bc)]==='unchanged')['length']};return{'projectName':_0x376ac2,'projectId':_0x5d745d,'revision':_0xeaf054,'sourceDir':_0x40fc06,'changes':_0xc8e107,'summary':_0x8907c1,'hasChanges':_0x8907c1[_0x4211c6(0x1ca)]>0x0||_0x8907c1[_0x4211c6(0x199)]>0x0||_0x8907c1[_0x4211c6(0x1c1)]>0x0,'configResult':_0x3c627d};}export async function executePushWorkflow(_0x5212c8,_0xec1b74){const _0x3243da=a194_0xdb9c,_0x36601b=await import(_0x3243da(0x1b7)),{client:_0x32758c}=_0x5212c8,_0x5d8acd=await getProjectFiles(_0xec1b74['sourceDir']),_0x21e113=await a194_0x23e413[_0x3243da(0x19b)](a194_0x3ae9d0[_0x3243da(0x1a1)](a194_0x2b9971[_0x3243da(0x19a)](),_0x3243da(0x1c8))),_0x3f0de4=a194_0x3ae9d0[_0x3243da(0x1a1)](_0x21e113,_0x3243da(0x1a6));try{await _0x36601b[_0x3243da(0x1bb)]({'file':_0x3f0de4,'gzip':!![],'cwd':_0xec1b74[_0x3243da(0x1b4)],'portable':!![]},_0x5d8acd);const _0x18f985=await _0x32758c[_0x3243da(0x1ad)](_0xec1b74['projectName'],_0xec1b74[_0x3243da(0x1af)],_0x3f0de4);return updateWorkflowTdxConfig(_0xec1b74[_0x3243da(0x1cb)][_0x3243da(0x1b6)],{'workflow_project_id':_0x18f985['id'],'last_pushed_revision':_0x18f985[_0x3243da(0x1af)],'last_pushed_at':new Date()[_0x3243da(0x1c3)]()}),{'projectId':_0x18f985['id'],'projectName':_0x18f985['name'],'revision':_0x18f985[_0x3243da(0x1af)]};}finally{await a194_0x23e413['rm'](_0x21e113,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x585d9c,_0x5be00a=_0x585d9c,_0x1c0236='',_0x4d1b04=null){const _0x298577=a194_0xdb9c,_0x429ca0=[];if(_0x4d1b04===null){_0x4d1b04=createIgnoreInstance();const _0x3ffec0=await loadDigdagignore(_0x585d9c);_0x3ffec0&&_0x4d1b04[_0x298577(0x1bf)](_0x3ffec0);}if(_0x1c0236!==''){const _0x18df98=await loadDigdagignore(_0x5be00a);_0x18df98&&addScopedPatterns(_0x4d1b04,_0x18df98,_0x1c0236);}const _0x3d56eb=await a194_0x23e413[_0x298577(0x1a3)](_0x5be00a,{'withFileTypes':!![]});for(const _0x230839 of _0x3d56eb){const _0x50b2d6=_0x1c0236?a194_0x3ae9d0[_0x298577(0x19e)]['join'](_0x1c0236,_0x230839['name']):_0x230839[_0x298577(0x19f)];if(_0x230839[_0x298577(0x19f)]===_0x298577(0x1c7))continue;if(_0x230839[_0x298577(0x19f)]===_0x298577(0x1b5))continue;if(!shouldIncludeInArchive(_0x230839[_0x298577(0x19f)]))continue;if(shouldIgnoreWithInstance(_0x4d1b04,_0x50b2d6,_0x230839['isDirectory']()))continue;if(_0x230839[_0x298577(0x1c9)]()){const _0x2da8c7=await getProjectFiles(_0x585d9c,a194_0x3ae9d0[_0x298577(0x1a1)](_0x5be00a,_0x230839[_0x298577(0x19f)]),_0x50b2d6,_0x4d1b04);_0x429ca0['push'](..._0x2da8c7);}else _0x429ca0['push'](_0x50b2d6);}return _0x429ca0;}async function calculatePushChanges(_0x418cbc,_0x26e6d3,_0x1db5d4){const _0x4a3ce6=a194_0xdb9c,_0x3a8016=[],_0x21b33f=new Set(await getProjectFiles(_0x26e6d3));for(const _0x47c6b2 of _0x1db5d4){const _0x4e3495=a194_0x3ae9d0[_0x4a3ce6(0x1a1)](_0x418cbc,_0x47c6b2),_0x55b13c=a194_0x3ae9d0[_0x4a3ce6(0x1a1)](_0x26e6d3,_0x47c6b2),_0x4e2123=await a194_0x23e413[_0x4a3ce6(0x19c)](_0x4e3495,_0x4a3ce6(0x1b8))[_0x4a3ce6(0x1a5)](()=>null);if(_0x4e2123===null)continue;if(!_0x21b33f[_0x4a3ce6(0x1c4)](_0x47c6b2))_0x3a8016[_0x4a3ce6(0x1b1)]({'path':_0x47c6b2,'type':_0x4a3ce6(0x1ca),'newContent':_0x4e2123});else{const _0x57e506=await a194_0x23e413[_0x4a3ce6(0x19c)](_0x55b13c,_0x4a3ce6(0x1b8))[_0x4a3ce6(0x1a5)](()=>null);if(_0x57e506===null)_0x3a8016[_0x4a3ce6(0x1b1)]({'path':_0x47c6b2,'type':_0x4a3ce6(0x199),'newContent':_0x4e2123});else{if(_0x57e506!==_0x4e2123){const _0x4bd777=generateDiff(_0x57e506,_0x4e2123),_0x3327b0=hasChanges(_0x4bd777)?formatDiffWithColors(_0x4bd777):undefined;_0x3a8016[_0x4a3ce6(0x1b1)]({'path':_0x47c6b2,'type':_0x4a3ce6(0x199),'oldContent':_0x57e506,'newContent':_0x4e2123,'diff':_0x3327b0});}else _0x3a8016[_0x4a3ce6(0x1b1)]({'path':_0x47c6b2,'type':'unchanged'});}}}for(const _0x4763a4 of _0x21b33f){if(!_0x1db5d4[_0x4a3ce6(0x1b9)](_0x4763a4)){const _0x313b15=a194_0x3ae9d0[_0x4a3ce6(0x1a1)](_0x26e6d3,_0x4763a4),_0x135233=await a194_0x23e413[_0x4a3ce6(0x19c)](_0x313b15,'utf-8')[_0x4a3ce6(0x1a5)](()=>undefined);_0x3a8016[_0x4a3ce6(0x1b1)]({'path':_0x4763a4,'type':_0x4a3ce6(0x1c1),'oldContent':_0x135233});}}return _0x3a8016[_0x4a3ce6(0x1b2)]((_0x585ea5,_0x54da4b)=>_0x585ea5['path'][_0x4a3ce6(0x1cd)](_0x54da4b['path'])),_0x3a8016;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a195_0x4759b9=a195_0x29ff;(function(_0x4e0dcd,_0x1c6be6){const _0x66f63d=a195_0x29ff,_0x557fb=_0x4e0dcd();while(!![]){try{const _0x39d64e=-parseInt(_0x66f63d(0x209))/0x1*(-parseInt(_0x66f63d(0x1ea))/0x2)+parseInt(_0x66f63d(0x1eb))/0x3*(-parseInt(_0x66f63d(0x1f3))/0x4)+parseInt(_0x66f63d(0x1ef))/0x5*(parseInt(_0x66f63d(0x1f6))/0x6)+parseInt(_0x66f63d(0x1f8))/0x7*(-parseInt(_0x66f63d(0x20a))/0x8)+-parseInt(_0x66f63d(0x207))/0x9+parseInt(_0x66f63d(0x1fd))/0xa*(parseInt(_0x66f63d(0x205))/0xb)+parseInt(_0x66f63d(0x1fa))/0xc*(parseInt(_0x66f63d(0x1ed))/0xd);if(_0x39d64e===_0x1c6be6)break;else _0x557fb['push'](_0x557fb['shift']());}catch(_0x46ba7b){_0x557fb['push'](_0x557fb['shift']());}}}(a195_0x5e8f,0xe834e));import{existsSync,readFileSync,writeFileSync}from'fs';import a195_0x2c1649 from'path';const TDX_CONFIG_FILE=a195_0x4759b9(0x206),WORKFLOWS_DIR=a195_0x4759b9(0x202);function a195_0x5e8f(){const _0x1f9b33=['22GjnNAF','9HsDzcm','last_pulled_revision','17425967UrSNFW','utf-8','1434965weyDtz','toISOString','object','parse','1771736tcEKBr','last_pushed_revision','Invalid\x20tdx.json:\x20expected\x20object','6jIprbL','workflow_project','6597143QlhnUa','string','24bhZghU','stringify','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field','658990SNWLJG','join','cwd','last_pushed_at','Invalid\x20JSON\x20in\x20','workflows','dirname','root','33WiJaNY','tdx.json','3053250VwGBeL','workflow_project_id','36001LbADnO','8XIcHQp','resolve'];a195_0x5e8f=function(){return _0x1f9b33;};return a195_0x5e8f();}export function findWorkflowTdxConfigPath(_0x1209d6=process[a195_0x4759b9(0x1ff)]()){const _0x5035f2=a195_0x4759b9;let _0x50f814=a195_0x2c1649[_0x5035f2(0x20b)](_0x1209d6);const _0x4686b4=a195_0x2c1649[_0x5035f2(0x1f2)](_0x50f814)[_0x5035f2(0x204)];while(_0x50f814!==_0x4686b4){const _0x48e8db=a195_0x2c1649[_0x5035f2(0x1fe)](_0x50f814,TDX_CONFIG_FILE);if(existsSync(_0x48e8db))try{const _0x50563f=readFileSync(_0x48e8db,_0x5035f2(0x1ee)),_0x56943d=JSON[_0x5035f2(0x1f2)](_0x50563f);if(_0x56943d&&typeof _0x56943d===_0x5035f2(0x1f1)&&_0x5035f2(0x1f7)in _0x56943d)return _0x48e8db;}catch{}_0x50f814=a195_0x2c1649[_0x5035f2(0x203)](_0x50f814);}return null;}export function loadWorkflowTdxConfig(_0x5dc3a8){const _0x348d8e=a195_0x4759b9,_0x206e30=readFileSync(_0x5dc3a8,_0x348d8e(0x1ee));let _0x5b0f5f;try{_0x5b0f5f=JSON[_0x348d8e(0x1f2)](_0x206e30);}catch{throw new Error(_0x348d8e(0x201)+_0x5dc3a8);}if(!_0x5b0f5f||typeof _0x5b0f5f!==_0x348d8e(0x1f1))throw new Error(_0x348d8e(0x1f5));const _0x2dbccc=_0x5b0f5f;if(!_0x2dbccc['workflow_project']||typeof _0x2dbccc[_0x348d8e(0x1f7)]!==_0x348d8e(0x1f9))throw new Error(_0x348d8e(0x1fc));return{'workflow_project':_0x2dbccc['workflow_project'],'workflow_project_id':typeof _0x2dbccc[_0x348d8e(0x208)]===_0x348d8e(0x1f9)?_0x2dbccc['workflow_project_id']:undefined,'last_pulled_revision':typeof _0x2dbccc[_0x348d8e(0x1ec)]===_0x348d8e(0x1f9)?_0x2dbccc[_0x348d8e(0x1ec)]:undefined,'last_pulled_at':typeof _0x2dbccc['last_pulled_at']==='string'?_0x2dbccc['last_pulled_at']:undefined,'last_pushed_revision':typeof _0x2dbccc[_0x348d8e(0x1f4)]===_0x348d8e(0x1f9)?_0x2dbccc[_0x348d8e(0x1f4)]:undefined,'last_pushed_at':typeof _0x2dbccc[_0x348d8e(0x200)]===_0x348d8e(0x1f9)?_0x2dbccc['last_pushed_at']:undefined};}export function findWorkflowTdxConfig(_0x5613fd=process[a195_0x4759b9(0x1ff)]()){const _0x4cca83=a195_0x4759b9,_0x1c86c6=findWorkflowTdxConfigPath(_0x5613fd);if(!_0x1c86c6)throw new Error('No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x599082=loadWorkflowTdxConfig(_0x1c86c6),_0x1dabb5=a195_0x2c1649[_0x4cca83(0x203)](_0x1c86c6);return{'config':_0x599082,'configPath':_0x1c86c6,'configDir':_0x1dabb5};}export function tryFindWorkflowTdxConfig(_0x43377e){try{return findWorkflowTdxConfig(_0x43377e);}catch{return null;}}export function getWorkflowProjectDir(_0x99202d,_0x15d3f0=process[a195_0x4759b9(0x1ff)]()){const _0x47f970=a195_0x4759b9;return a195_0x2c1649[_0x47f970(0x1fe)](_0x15d3f0,WORKFLOWS_DIR,_0x99202d);}export function getWorkflowTdxConfigPath(_0x42460d,_0x3fb735=process['cwd']()){return a195_0x2c1649['join'](getWorkflowProjectDir(_0x42460d,_0x3fb735),TDX_CONFIG_FILE);}function a195_0x29ff(_0x19a191,_0x35e9ea){_0x19a191=_0x19a191-0x1ea;const _0x5e8fbe=a195_0x5e8f();let _0x29ff04=_0x5e8fbe[_0x19a191];return _0x29ff04;}export function createWorkflowTdxConfigContent(_0x189007,_0x3ed761,_0x464ab7){const _0x23c62b=a195_0x4759b9,_0x465395={'workflow_project':_0x189007,..._0x3ed761&&{'workflow_project_id':_0x3ed761},..._0x464ab7&&{'last_pulled_revision':_0x464ab7},'last_pulled_at':new Date()[_0x23c62b(0x1f0)]()};return JSON[_0x23c62b(0x1fb)](_0x465395,null,0x2)+'\x0a';}export function saveWorkflowTdxConfig(_0x5f3bd6,_0x2fda1b){const _0x4ec100=a195_0x4759b9,_0x2f6710=JSON[_0x4ec100(0x1fb)](_0x2fda1b,null,0x2)+'\x0a';writeFileSync(_0x5f3bd6,_0x2f6710,_0x4ec100(0x1ee));}export function updateWorkflowTdxConfig(_0x4a1456,_0x264c1b){const _0x41d89c=loadWorkflowTdxConfig(_0x4a1456),_0x499f9b={..._0x41d89c,..._0x264c1b};saveWorkflowTdxConfig(_0x4a1456,_0x499f9b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a196_0x4ddd26=a196_0x8f41;(function(_0x3e2961,_0x4955c6){const _0x447020=a196_0x8f41,_0x3eacad=_0x3e2961();while(!![]){try{const _0x397f2c=parseInt(_0x447020(0x20e))/0x1+-parseInt(_0x447020(0x1f7))/0x2+parseInt(_0x447020(0x205))/0x3*(-parseInt(_0x447020(0x203))/0x4)+parseInt(_0x447020(0x20c))/0x5*(-parseInt(_0x447020(0x207))/0x6)+-parseInt(_0x447020(0x206))/0x7+parseInt(_0x447020(0x208))/0x8*(parseInt(_0x447020(0x20d))/0x9)+-parseInt(_0x447020(0x202))/0xa*(-parseInt(_0x447020(0x1f9))/0xb);if(_0x397f2c===_0x4955c6)break;else _0x3eacad['push'](_0x3eacad['shift']());}catch(_0x36e817){_0x3eacad['push'](_0x3eacad['shift']());}}}(a196_0x1595,0x33146));import{promises as a196_0x306061}from'fs';import a196_0x41e4f5 from'path';function a196_0x8f41(_0x57b91d,_0x219279){_0x57b91d=_0x57b91d-0x1f3;const _0x1595ed=a196_0x1595();let _0x8f4111=_0x1595ed[_0x57b91d];return _0x8f4111;}import a196_0x5574c2 from'ignore';export const WORKFLOW_FILE_EXTENSION=a196_0x4ddd26(0x200);export function shouldIncludeInArchive(_0x39ea24){const _0x23020c=a196_0x4ddd26;if(_0x39ea24===_0x23020c(0x1ff))return!![];if(_0x39ea24[_0x23020c(0x1fc)]('.'))return![];if(_0x39ea24['endsWith']('~'))return![];if(_0x39ea24===_0x23020c(0x20a)||_0x39ea24===_0x23020c(0x1f4))return![];return!![];}export function parseDigdagignore(_0x9916e){const _0xbfdad1=a196_0x4ddd26;return _0x9916e['split']('\x0a')['map'](_0x46a909=>_0x46a909[_0xbfdad1(0x1fd)]())[_0xbfdad1(0x1fb)](_0x145f1b=>_0x145f1b[_0xbfdad1(0x1f6)]>0x0&&!_0x145f1b[_0xbfdad1(0x1fc)]('#'));}export async function loadDigdagignore(_0x1a9eec){const _0x328d01=a196_0x4ddd26,_0x32bfd2=a196_0x41e4f5[_0x328d01(0x1fe)](_0x1a9eec,_0x328d01(0x204));try{const _0x549061=await a196_0x306061[_0x328d01(0x1f8)](_0x32bfd2,_0x328d01(0x20f));return parseDigdagignore(_0x549061);}catch(_0x5d2992){if(_0x5d2992[_0x328d01(0x1f3)]===_0x328d01(0x1fa))return null;throw _0x5d2992;}}function a196_0x1595(){const _0x49b6b8=['startsWith','trim','join','.digdag','.dig','replace','10gnhnSq','6596iZJxwg','.digdagignore','291qjxbfn','134351fzZBxQ','6XjJNkw','62080KoujBz','ignores','Thumbs.db','add','1143720oIQdBn','279UxgEDU','287530KhndPL','utf-8','code','.DS_Store','map','length','154382DTxyfZ','readFile','1828343ocvGmb','ENOENT','filter'];a196_0x1595=function(){return _0x49b6b8;};return a196_0x1595();}export function createIgnoreInstance(_0xdaaf51){const _0xb2a9a0=a196_0x4ddd26,_0x3114ed=a196_0x5574c2();return _0xdaaf51&&_0xdaaf51[_0xb2a9a0(0x1f6)]>0x0&&_0x3114ed[_0xb2a9a0(0x20b)](_0xdaaf51),_0x3114ed;}export function addScopedPatterns(_0x35500c,_0x460b1e,_0x54aed5){const _0x2a794d=a196_0x4ddd26,_0x24ba31=_0x460b1e[_0x2a794d(0x1f5)](_0xef70d8=>{const _0x38911d=_0x2a794d;if(_0xef70d8[_0x38911d(0x1fc)]('!')){const _0x1f858f=_0xef70d8['slice'](0x1);if(_0x1f858f['startsWith']('/'))return'!'+_0x54aed5+_0x1f858f;return'!'+_0x54aed5+'/'+_0x1f858f;}if(_0xef70d8[_0x38911d(0x1fc)]('/'))return''+_0x54aed5+_0xef70d8;return _0x54aed5+'/'+_0xef70d8;});return _0x35500c['add'](_0x24ba31),_0x35500c;}export function shouldIgnoreWithInstance(_0x45e430,_0xe1dec5,_0x4e333e){const _0x15bb89=a196_0x4ddd26,_0x5d17e6=_0xe1dec5[_0x15bb89(0x201)](/\\/g,'/'),_0x4970bc=_0x4e333e?_0x5d17e6+'/':_0x5d17e6;return _0x45e430[_0x15bb89(0x209)](_0x4970bc);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a197_0xe216(_0x51a90a,_0x3fca3b){_0x51a90a=_0x51a90a-0xb6;const _0x129592=a197_0x1295();let _0xe21616=_0x129592[_0x51a90a];return _0xe21616;}const a197_0x27bf59=a197_0xe216;(function(_0x5bab62,_0x319f16){const _0x6dbae0=a197_0xe216,_0x5b8ca0=_0x5bab62();while(!![]){try{const _0x4a434d=-parseInt(_0x6dbae0(0xcc))/0x1+-parseInt(_0x6dbae0(0xc2))/0x2*(-parseInt(_0x6dbae0(0xca))/0x3)+parseInt(_0x6dbae0(0xb8))/0x4+parseInt(_0x6dbae0(0xc8))/0x5+parseInt(_0x6dbae0(0xc1))/0x6*(parseInt(_0x6dbae0(0xc3))/0x7)+parseInt(_0x6dbae0(0xc0))/0x8+parseInt(_0x6dbae0(0xb6))/0x9*(-parseInt(_0x6dbae0(0xbc))/0xa);if(_0x4a434d===_0x319f16)break;else _0x5b8ca0['push'](_0x5b8ca0['shift']());}catch(_0x269300){_0x5b8ca0['push'](_0x5b8ca0['shift']());}}}(a197_0x1295,0x57500));import*as a197_0x56586c from'node:fs';import{join,resolve}from'node:path';import{getGlobalCacheDir}from'../../utils/global-cache.js';const LOG_FILE=join(a197_0x27bf59(0xb9),a197_0x27bf59(0xba),'access.jsonl');function getLogPath(){return join(getGlobalCacheDir(),LOG_FILE);}export function logAccess(_0x2c14bf,_0x5e2959){const _0x3102bd=a197_0x27bf59,_0x5ba4bb=getLogPath();a197_0x56586c[_0x3102bd(0xc9)](join(_0x5ba4bb,'..'),{'recursive':!![]});const _0x271390={'ts':Date[_0x3102bd(0xc7)](),'ws':resolve(_0x2c14bf),'path':_0x5e2959};a197_0x56586c[_0x3102bd(0xbe)](_0x5ba4bb,JSON[_0x3102bd(0xc4)](_0x271390)+'\x0a');}export function getRecentDocuments(_0x564fdc,_0x4e0d21=0x14){const _0x2d042c=a197_0x27bf59,_0x1bdf79=getLastAccessedMap(_0x564fdc);return[..._0x1bdf79[_0x2d042c(0xcb)]()][_0x2d042c(0xc6)]((_0x5c482d,_0x418708)=>_0x418708[0x1]-_0x5c482d[0x1])['slice'](0x0,_0x4e0d21)[_0x2d042c(0xbf)](([_0x41b8e4])=>_0x41b8e4);}export function getLastAccessedMap(_0x4022e1){const _0x95e64e=a197_0x27bf59,_0x411363=resolve(_0x4022e1),_0x240b4f=new Map();let _0x5adefa;try{_0x5adefa=a197_0x56586c[_0x95e64e(0xcd)](getLogPath(),_0x95e64e(0xc5));}catch{return _0x240b4f;}for(const _0x197016 of _0x5adefa[_0x95e64e(0xce)]('\x0a')){if(!_0x197016)continue;try{const _0x35ebf6=JSON[_0x95e64e(0xb7)](_0x197016);if(_0x35ebf6['ws']!==_0x411363)continue;const _0x2d7147=_0x240b4f[_0x95e64e(0xbd)](_0x35ebf6[_0x95e64e(0xbb)]);if(!_0x2d7147||_0x35ebf6['ts']>_0x2d7147)_0x240b4f['set'](_0x35ebf6['path'],_0x35ebf6['ts']);}catch{}}return _0x240b4f;}function a197_0x1295(){const _0x4a8a65=['18SkwtoJ','parse','273244yWQXHc','work','logs','path','6844340nzgXTd','get','appendFileSync','map','5502464ulHCaQ','30192cIBqlu','46218xyoOTM','490AAzAnh','stringify','utf-8','sort','now','1085915nLobsO','mkdirSync','90QzYXDO','entries','292312EiiexO','readFileSync','split'];a197_0x1295=function(){return _0x4a8a65;};return a197_0x1295();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x4dab36,_0x2f9fbe){const _0x416067=a198_0x4792,_0x19391f=_0x4dab36();while(!![]){try{const _0x12ede0=parseInt(_0x416067(0x1d5))/0x1*(parseInt(_0x416067(0x1d9))/0x2)+-parseInt(_0x416067(0x1e6))/0x3+-parseInt(_0x416067(0x1cf))/0x4+parseInt(_0x416067(0x1e7))/0x5*(-parseInt(_0x416067(0x1d6))/0x6)+-parseInt(_0x416067(0x1d0))/0x7*(-parseInt(_0x416067(0x1eb))/0x8)+-parseInt(_0x416067(0x1da))/0x9+parseInt(_0x416067(0x1dd))/0xa;if(_0x12ede0===_0x2f9fbe)break;else _0x19391f['push'](_0x19391f['shift']());}catch(_0x5b7235){_0x19391f['push'](_0x19391f['shift']());}}}(a198_0x28be,0x41027));function a198_0x4792(_0xdb4a69,_0x388120){_0xdb4a69=_0xdb4a69-0x1ce;const _0x28be92=a198_0x28be();let _0x4792ae=_0x28be92[_0xdb4a69];return _0x4792ae;}export function parseFrontmatter(_0x1b0873){const _0x3f6c8b=a198_0x4792,_0x345c4e=_0x1b0873['match'](/^---\s*\n([\s\S]*?)\n---\s*\n?([\s\S]*)$/);if(!_0x345c4e)return{'frontmatter':{},'body':_0x1b0873['trim']()};const _0x14efd2=_0x345c4e[0x1],_0x3d5b15=_0x345c4e[0x2][_0x3f6c8b(0x1d2)](),_0x59a026=parseSimpleYaml(_0x14efd2);return{'frontmatter':_0x59a026,'body':_0x3d5b15};}export function serializeFrontmatter(_0x13a0a0,_0x576580){const _0x487439=a198_0x4792,_0x2a88a5=[];for(const [_0x150085,_0x4e258a]of Object[_0x487439(0x1de)](_0x13a0a0)){if(_0x4e258a===undefined||_0x4e258a===null)continue;if(Array[_0x487439(0x1ec)](_0x4e258a))_0x4e258a[_0x487439(0x1d1)]===0x0?_0x2a88a5[_0x487439(0x1e3)](_0x150085+_0x487439(0x1db)):_0x2a88a5[_0x487439(0x1e3)](_0x150085+_0x487439(0x1e8)+_0x4e258a[_0x487439(0x1d7)](_0x442415=>formatYamlValue(String(_0x442415)))['join'](',\x20')+']');else{if(typeof _0x4e258a===_0x487439(0x1e2))_0x2a88a5[_0x487439(0x1e3)](_0x150085+':\x20'+_0x4e258a);else typeof _0x4e258a===_0x487439(0x1e9)?_0x2a88a5[_0x487439(0x1e3)](_0x150085+':\x20'+_0x4e258a):_0x2a88a5['push'](_0x150085+':\x20'+formatYamlValue(String(_0x4e258a)));}}const _0x3b710b=_0x2a88a5['join']('\x0a');return _0x487439(0x1ed)+_0x3b710b+'\x0a---\x0a\x0a'+_0x576580+'\x0a';}function formatYamlValue(_0x1f0651){const _0x42d3c6=a198_0x4792;if(_0x1f0651[_0x42d3c6(0x1ea)](':')||_0x1f0651[_0x42d3c6(0x1ea)]('#')||_0x1f0651[_0x42d3c6(0x1ea)]('\x27')||_0x1f0651[_0x42d3c6(0x1ea)]('\x22')||_0x1f0651[_0x42d3c6(0x1ea)]('\x0a')||_0x1f0651[_0x42d3c6(0x1dc)]('\x20')||_0x1f0651[_0x42d3c6(0x1d8)]('\x20'))return'\x22'+_0x1f0651[_0x42d3c6(0x1e1)](/\\/g,'\x5c\x5c')[_0x42d3c6(0x1e1)](/"/g,'\x5c\x22')+'\x22';return _0x1f0651;}function a198_0x28be(){const _0x9e59a6=['length','trim','false','slice','210846gCdvPC','1024932PsVXkK','map','endsWith','4sTjBmk','2669814BQGcZV',':\x20[]','startsWith','6460770HYSSfy','entries','null','test','replace','boolean','push','indexOf','true','1335429vAQBan','5zsWUsN',':\x20[','number','includes','1829648FlRliP','isArray','---\x0a','split','1385164kcmGGq','14rXbmII'];a198_0x28be=function(){return _0x9e59a6;};return a198_0x28be();}function parseSimpleYaml(_0x2f78d9){const _0x1a8589=a198_0x4792,_0x6274d8={},_0x2c90e3=_0x2f78d9[_0x1a8589(0x1ce)]('\x0a');for(const _0x516e25 of _0x2c90e3){const _0x2259ec=_0x516e25[_0x1a8589(0x1d2)]();if(!_0x2259ec||_0x2259ec[_0x1a8589(0x1dc)]('#'))continue;const _0x8c3c33=_0x2259ec[_0x1a8589(0x1e4)](':');if(_0x8c3c33===-0x1)continue;const _0x425021=_0x2259ec[_0x1a8589(0x1d4)](0x0,_0x8c3c33)[_0x1a8589(0x1d2)]();let _0x494472=_0x2259ec['slice'](_0x8c3c33+0x1)[_0x1a8589(0x1d2)]();const _0x5744c1=_0x494472[_0x1a8589(0x1e4)]('\x20#');_0x5744c1!==-0x1&&!_0x494472['startsWith']('\x22')&&!_0x494472['startsWith']('\x27')&&(_0x494472=_0x494472[_0x1a8589(0x1d4)](0x0,_0x5744c1)[_0x1a8589(0x1d2)]()),_0x6274d8[_0x425021]=parseYamlValue(_0x494472);}return _0x6274d8;}function parseYamlValue(_0x582538){const _0x497b16=a198_0x4792;if(!_0x582538||_0x582538==='~'||_0x582538===_0x497b16(0x1df))return null;if(_0x582538==='true')return!![];if(_0x582538==='false')return![];if(_0x582538[_0x497b16(0x1dc)]('[')&&_0x582538[_0x497b16(0x1d8)](']')){const _0x24b816=_0x582538[_0x497b16(0x1d4)](0x1,-0x1)[_0x497b16(0x1d2)]();if(!_0x24b816)return[];return _0x24b816[_0x497b16(0x1ce)](',')[_0x497b16(0x1d7)](_0x549083=>{const _0x5021e8=_0x549083['trim']();return parseYamlScalar(_0x5021e8);});}if(_0x582538[_0x497b16(0x1dc)]('\x22')&&_0x582538[_0x497b16(0x1d8)]('\x22'))return _0x582538[_0x497b16(0x1d4)](0x1,-0x1)[_0x497b16(0x1e1)](/\\"/g,'\x22')[_0x497b16(0x1e1)](/\\\\/g,'\x5c');if(_0x582538[_0x497b16(0x1dc)]('\x27')&&_0x582538[_0x497b16(0x1d8)]('\x27'))return _0x582538[_0x497b16(0x1d4)](0x1,-0x1);if(/^-?\d+(\.\d+)?$/[_0x497b16(0x1e0)](_0x582538))return Number(_0x582538);return _0x582538;}function parseYamlScalar(_0x379cfe){const _0x301ca3=a198_0x4792;if(_0x379cfe[_0x301ca3(0x1dc)]('\x22')&&_0x379cfe['endsWith']('\x22'))return _0x379cfe[_0x301ca3(0x1d4)](0x1,-0x1)[_0x301ca3(0x1e1)](/\\"/g,'\x22')[_0x301ca3(0x1e1)](/\\\\/g,'\x5c');if(_0x379cfe[_0x301ca3(0x1dc)]('\x27')&&_0x379cfe[_0x301ca3(0x1d8)]('\x27'))return _0x379cfe[_0x301ca3(0x1d4)](0x1,-0x1);if(_0x379cfe===_0x301ca3(0x1e5))return!![];if(_0x379cfe===_0x301ca3(0x1d3))return![];if(/^-?\d+(\.\d+)?$/[_0x301ca3(0x1e0)](_0x379cfe))return Number(_0x379cfe);return _0x379cfe;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a199_0x5947(_0x4e8d43,_0x11a837){_0x4e8d43=_0x4e8d43-0xb9;const _0x334ef0=a199_0x334e();let _0x5947a7=_0x334ef0[_0x4e8d43];return _0x5947a7;}const a199_0x15c86b=a199_0x5947;function a199_0x334e(){const _0x1d5a3d=['1105053pfQqNF','clear','pull','length','hasRemote','pipe','pendingMessage','commit','removeRemote','string','stdout','relative','pendingFiles','diff','commitStaged','push','.gitignore','join','cachedIsRepo','849591gTOuwL','get-url','from','.git','setRemote','status','https:','batchMs','gitWithTokenRedacted','3724636tiFphp','3941qVqXnb','workspacePath','470METTGY','batchTimer','flush','8071TTPrbr','main','existsSync','***','password','remove','x-access-token','message','--abbrev-ref','origin','isRepo','hasDirtyFiles','add','split','autoCommit','toString','ensureRepo','trim','map','authedRemoteUrl','getRemoteUrl','protocol','--git-dir','config','fileHistory','getCurrentBranch','stderr','log','rev-parse','HEAD','2304lHdnTn','1031768NmiHug','branch','utf-8','git','remote','--porcelain','writeFileSync','1982895HJbvpG'];a199_0x334e=function(){return _0x1d5a3d;};return a199_0x334e();}(function(_0x106b92,_0x4404fd){const _0x49cbb2=a199_0x5947,_0x3072f5=_0x106b92();while(!![]){try{const _0x13c9ba=parseInt(_0x49cbb2(0x100))/0x1*(parseInt(_0x49cbb2(0xb9))/0x2)+-parseInt(_0x49cbb2(0xe3))/0x3+-parseInt(_0x49cbb2(0xff))/0x4+parseInt(_0x49cbb2(0xe2))/0x5+parseInt(_0x49cbb2(0xda))/0x6*(parseInt(_0x49cbb2(0xbc))/0x7)+parseInt(_0x49cbb2(0xdb))/0x8+-parseInt(_0x49cbb2(0xf6))/0x9;if(_0x13c9ba===_0x4404fd)break;else _0x3072f5['push'](_0x3072f5['shift']());}catch(_0x4ad982){_0x3072f5['push'](_0x3072f5['shift']());}}}(a199_0x334e,0x7a330));import{execFileSync}from'node:child_process';import*as a199_0x47980f from'node:fs';import*as a199_0x11720 from'node:path';export const WORKSPACE_GITIGNORE='#\x20Session\x20artifacts\x0achat-*/\x0a\x0a#\x20Cache\x20(access\x20log,\x20etc.)\x0a.cache/\x0a\x0a#\x20OS\x20files\x0a.DS_Store\x0a';const DEFAULT_CONFIG={'autoCommit':!![],'batchMs':0x7d0};export class WorkspaceGit{[a199_0x15c86b(0x101)];['config'];[a199_0x15c86b(0xba)]=null;[a199_0x15c86b(0xef)]=new Set();[a199_0x15c86b(0xe9)]=null;[a199_0x15c86b(0xf5)]=null;constructor(_0x4a5455,_0x2c1d11){const _0x55ac46=a199_0x15c86b;this[_0x55ac46(0x101)]=_0x4a5455,this[_0x55ac46(0xd3)]={...DEFAULT_CONFIG,..._0x2c1d11};}[a199_0x15c86b(0xcc)](){const _0x54b9b2=a199_0x15c86b,_0x191d52=a199_0x11720['join'](this[_0x54b9b2(0x101)],_0x54b9b2(0xf9));!a199_0x47980f[_0x54b9b2(0xbe)](_0x191d52)&&(this[_0x54b9b2(0xde)]('init'),this['cachedIsRepo']=!![]);const _0x57e0c9=a199_0x11720[_0x54b9b2(0xf4)](this[_0x54b9b2(0x101)],_0x54b9b2(0xf3));!a199_0x47980f[_0x54b9b2(0xbe)](_0x57e0c9)&&a199_0x47980f[_0x54b9b2(0xe1)](_0x57e0c9,WORKSPACE_GITIGNORE,_0x54b9b2(0xdd));}[a199_0x15c86b(0xc6)](){const _0x281558=a199_0x15c86b;if(this[_0x281558(0xf5)]!==null)return this[_0x281558(0xf5)];try{this[_0x281558(0xde)](_0x281558(0xd8),_0x281558(0xd2)),this['cachedIsRepo']=!![];}catch{this[_0x281558(0xf5)]=![];}return this[_0x281558(0xf5)];}[a199_0x15c86b(0xea)](_0x1afc07,_0x21b817){const _0x2dd1f5=a199_0x15c86b;if(!this['config'][_0x2dd1f5(0xca)])return;if(!this[_0x2dd1f5(0xc6)]())return;const _0x4e8c83=a199_0x11720[_0x2dd1f5(0xee)](this[_0x2dd1f5(0x101)],_0x1afc07);this[_0x2dd1f5(0xef)][_0x2dd1f5(0xc8)](_0x4e8c83),this[_0x2dd1f5(0xe9)]=_0x21b817,this[_0x2dd1f5(0xba)]&&clearTimeout(this[_0x2dd1f5(0xba)]),this[_0x2dd1f5(0xd3)][_0x2dd1f5(0xfd)]===0x0?this[_0x2dd1f5(0xbb)]():this['batchTimer']=setTimeout(()=>this['flush'](),this['config'][_0x2dd1f5(0xfd)]);}[a199_0x15c86b(0xbb)](){const _0x143722=a199_0x15c86b;if(this[_0x143722(0xef)]['size']===0x0)return;const _0x5f04cd=Array[_0x143722(0xf8)](this[_0x143722(0xef)]),_0x2a5bfa=this[_0x143722(0xe9)]||'work:\x20update';this[_0x143722(0xef)][_0x143722(0xe4)](),this[_0x143722(0xe9)]=null;this['batchTimer']&&(clearTimeout(this[_0x143722(0xba)]),this[_0x143722(0xba)]=null);try{this['git'](_0x143722(0xc8),'--',..._0x5f04cd);}catch{return;}this[_0x143722(0xf1)](_0x2a5bfa);}['commitAll'](_0x41deb9){const _0xbe8668=a199_0x15c86b;if(!this[_0xbe8668(0xd3)][_0xbe8668(0xca)])return;if(!this[_0xbe8668(0xc7)]())return;try{this[_0xbe8668(0xde)](_0xbe8668(0xc8),'-A');}catch{return;}this[_0xbe8668(0xf1)](_0x41deb9);}[a199_0x15c86b(0xc7)](){const _0x59b410=a199_0x15c86b;if(!this[_0x59b410(0xc6)]())return![];try{const _0x55b326=this['git'](_0x59b410(0xfb),_0x59b410(0xe0));return _0x55b326['trim']()[_0x59b410(0xe6)]>0x0;}catch{return![];}}[a199_0x15c86b(0xd4)](_0x47f88c,_0x146796=0xa){const _0x4ea710=a199_0x15c86b;if(!this['isRepo']())return[];const _0x383aa1=a199_0x11720[_0x4ea710(0xee)](this[_0x4ea710(0x101)],_0x47f88c);try{const _0x4886af=this['git'](_0x4ea710(0xd7),'--pretty=format:%H|%aI|%s','-n',String(_0x146796),'--',_0x383aa1);if(!_0x4886af[_0x4ea710(0xcd)]())return[];return _0x4886af[_0x4ea710(0xcd)]()['split']('\x0a')[_0x4ea710(0xce)](_0x594e50=>{const _0x236c42=_0x4ea710,[_0x4abbf1,_0x54bdf0,..._0xcbb522]=_0x594e50[_0x236c42(0xc9)]('|');return{'hash':_0x4abbf1,'date':_0x54bdf0,'message':_0xcbb522['join']('|')};});}catch{return[];}}[a199_0x15c86b(0xf1)](_0x41299d){const _0x375534=a199_0x15c86b;try{try{this[_0x375534(0xde)](_0x375534(0xf0),'--cached','--quiet');return;}catch{}this['git'](_0x375534(0xea),'-m',_0x41299d);}catch{}}[a199_0x15c86b(0xd0)](_0x489443=a199_0x15c86b(0xc5)){const _0x58cb8d=a199_0x15c86b;if(!this[_0x58cb8d(0xc6)]())return null;try{return this[_0x58cb8d(0xde)]('remote',_0x58cb8d(0xf7),_0x489443)['trim']()||null;}catch{return null;}}[a199_0x15c86b(0xe7)](_0x2a53f8=a199_0x15c86b(0xc5)){const _0xbc4fc0=a199_0x15c86b;return this[_0xbc4fc0(0xd0)](_0x2a53f8)!==null;}[a199_0x15c86b(0xfa)](_0x544f16,_0x5adc9c=a199_0x15c86b(0xc5)){const _0x40e307=a199_0x15c86b;!this[_0x40e307(0xc6)]()&&this[_0x40e307(0xcc)](),this['getRemoteUrl'](_0x5adc9c)!==null?this[_0x40e307(0xde)]('remote','set-url',_0x5adc9c,_0x544f16):this['git']('remote',_0x40e307(0xc8),_0x5adc9c,_0x544f16);}[a199_0x15c86b(0xeb)](_0x71bc1a=a199_0x15c86b(0xc5)){const _0x45daf3=a199_0x15c86b;if(!this['isRepo']())return;if(this[_0x45daf3(0xd0)](_0x71bc1a)===null)return;this['git'](_0x45daf3(0xdf),_0x45daf3(0xc1),_0x71bc1a);}[a199_0x15c86b(0xd5)](){const _0x581b71=a199_0x15c86b;if(!this[_0x581b71(0xc6)]())return _0x581b71(0xbd);try{return this[_0x581b71(0xde)]('rev-parse',_0x581b71(0xc4),_0x581b71(0xd9))['trim']()||_0x581b71(0xbd);}catch{return _0x581b71(0xbd);}}[a199_0x15c86b(0xf2)](_0x45389e){const _0x1de82e=a199_0x15c86b,{remote:remote=_0x1de82e(0xc5),token:_0x5a3c06}=_0x45389e??{},_0x133081=_0x45389e?.[_0x1de82e(0xdc)]||this[_0x1de82e(0xd5)]();if(_0x5a3c06){const _0x141142=this[_0x1de82e(0xcf)](remote,_0x5a3c06);if(_0x141142)return this['gitWithTokenRedacted']('push',_0x5a3c06,'-u',_0x141142,_0x133081);}return this[_0x1de82e(0xde)](_0x1de82e(0xf2),'-u',remote,_0x133081);}['pull'](_0x4b9106){const _0x1841f2=a199_0x15c86b,{remote:remote=_0x1841f2(0xc5),token:_0x41707b}=_0x4b9106??{},_0xe8ed6f=_0x4b9106?.[_0x1841f2(0xdc)]||this[_0x1841f2(0xd5)]();if(_0x41707b){const _0x37b828=this[_0x1841f2(0xcf)](remote,_0x41707b);if(_0x37b828)return this[_0x1841f2(0xfe)](_0x1841f2(0xe5),_0x41707b,_0x37b828,_0xe8ed6f);}return this[_0x1841f2(0xde)](_0x1841f2(0xe5),remote,_0xe8ed6f);}[a199_0x15c86b(0xcf)](_0x554e99,_0x1dda67){const _0x52a57b=a199_0x15c86b,_0x13650b=this[_0x52a57b(0xd0)](_0x554e99);if(!_0x13650b)return null;try{const _0x22989e=new URL(_0x13650b);if(_0x22989e[_0x52a57b(0xd1)]!==_0x52a57b(0xfc))return null;return _0x22989e['username']=_0x52a57b(0xc2),_0x22989e[_0x52a57b(0xc0)]=_0x1dda67,_0x22989e[_0x52a57b(0xcb)]();}catch{return null;}}['git'](..._0x172a59){const _0x57fc32=a199_0x15c86b;return execFileSync(_0x57fc32(0xde),_0x172a59,{'cwd':this['workspacePath'],'encoding':_0x57fc32(0xdd),'stdio':[_0x57fc32(0xe8),_0x57fc32(0xe8),'pipe']});}['gitWithTokenRedacted'](_0x559f1b,_0x40a4e5,..._0x317f7a){const _0x2960ec=a199_0x15c86b;try{return this[_0x2960ec(0xde)](_0x559f1b,..._0x317f7a);}catch(_0x5c5c7a){if(_0x5c5c7a instanceof Error){const _0x280a20=_0x217578=>_0x217578['replaceAll'](_0x40a4e5,_0x2960ec(0xbf));_0x5c5c7a[_0x2960ec(0xc3)]=_0x280a20(_0x5c5c7a[_0x2960ec(0xc3)]);const _0xa944ed=_0x5c5c7a;if(typeof _0xa944ed[_0x2960ec(0xd6)]===_0x2960ec(0xec))_0xa944ed[_0x2960ec(0xd6)]=_0x280a20(_0xa944ed[_0x2960ec(0xd6)]);if(typeof _0xa944ed[_0x2960ec(0xed)]===_0x2960ec(0xec))_0xa944ed[_0x2960ec(0xed)]=_0x280a20(_0xa944ed[_0x2960ec(0xed)]);}throw _0x5c5c7a;}}}
|