@treasuredata/tdx 0.26.4 → 0.26.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/mcp-command.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profile-command.js +1 -1
  28. package/dist/commands/profiles-command.js +1 -1
  29. package/dist/commands/query-command.js +1 -1
  30. package/dist/commands/schedule-command.js +1 -1
  31. package/dist/commands/segment-command.js +1 -1
  32. package/dist/commands/segment-create-command.js +1 -1
  33. package/dist/commands/segment-fields-command.js +1 -1
  34. package/dist/commands/segment-pull-command.js +1 -1
  35. package/dist/commands/segment-push-command.js +1 -1
  36. package/dist/commands/segment-update-command.js +1 -1
  37. package/dist/commands/segment-use-command.js +1 -1
  38. package/dist/commands/segment-validate-command.js +1 -1
  39. package/dist/commands/segments.js +1 -1
  40. package/dist/commands/show.js +1 -1
  41. package/dist/commands/status-command.js +1 -1
  42. package/dist/commands/tables.js +1 -1
  43. package/dist/commands/unset-command.js +1 -1
  44. package/dist/commands/use-command.js +1 -1
  45. package/dist/commands/user-command.js +1 -1
  46. package/dist/commands/workflow-command.js +1 -1
  47. package/dist/core/auth.js +1 -1
  48. package/dist/core/command-output.js +1 -1
  49. package/dist/core/config.js +1 -1
  50. package/dist/core/connection-cache.js +1 -1
  51. package/dist/core/constants.js +1 -1
  52. package/dist/core/credential-cache.js +1 -1
  53. package/dist/core/global-context.js +1 -1
  54. package/dist/core/keychain.js +1 -1
  55. package/dist/core/profile.js +1 -1
  56. package/dist/core/project-config.js +1 -1
  57. package/dist/core/session.js +1 -1
  58. package/dist/core/user-cache.js +1 -1
  59. package/dist/core/version.js +1 -1
  60. package/dist/index.js +1 -1
  61. package/dist/mcp/server.js +1 -1
  62. package/dist/mcp/tools/index.js +1 -1
  63. package/dist/mcp/tools/tdx-run.js +1 -1
  64. package/dist/mcp/tools/tdx-search.js +1 -1
  65. package/dist/mcp/utils.js +1 -1
  66. package/dist/proxy/claude-usage-tracker.js +1 -1
  67. package/dist/proxy/passthrough-server.js +1 -1
  68. package/dist/proxy/sse-usage-parser.js +1 -1
  69. package/dist/sdk/agent/agent-config.js +1 -1
  70. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  71. package/dist/sdk/agent/agent-yaml.js +1 -1
  72. package/dist/sdk/agent/test/evaluator.js +1 -1
  73. package/dist/sdk/agent/test/executor.js +1 -1
  74. package/dist/sdk/agent/test/index.js +1 -1
  75. package/dist/sdk/agent/test/output.js +1 -1
  76. package/dist/sdk/agent/test/parser.js +1 -1
  77. package/dist/sdk/api.js +1 -1
  78. package/dist/sdk/client/cdp-api-client.js +1 -1
  79. package/dist/sdk/client/endpoints.js +1 -1
  80. package/dist/sdk/client/engage-api-client.js +1 -1
  81. package/dist/sdk/client/http-client.js +1 -1
  82. package/dist/sdk/client/llm-api-client.js +1 -1
  83. package/dist/sdk/client/rate-limiter.js +1 -1
  84. package/dist/sdk/client/td-api-client.js +1 -1
  85. package/dist/sdk/client/trino-api-client.js +1 -1
  86. package/dist/sdk/client/workflow-client.js +1 -1
  87. package/dist/sdk/connection-validator.js +1 -1
  88. package/dist/sdk/connection.js +1 -1
  89. package/dist/sdk/engage.js +1 -1
  90. package/dist/sdk/errors.js +1 -1
  91. package/dist/sdk/index.js +1 -1
  92. package/dist/sdk/io/index.js +1 -1
  93. package/dist/sdk/io/node-filesystem.js +1 -1
  94. package/dist/sdk/job.js +1 -1
  95. package/dist/sdk/journey.js +1 -1
  96. package/dist/sdk/llm/chat-cache.js +1 -1
  97. package/dist/sdk/llm/index.js +1 -1
  98. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  99. package/dist/sdk/llm/model-factors.js +1 -1
  100. package/dist/sdk/personalization.js +1 -1
  101. package/dist/sdk/query/index.js +1 -1
  102. package/dist/sdk/query/sql-parser.js +1 -1
  103. package/dist/sdk/realtime.js +1 -1
  104. package/dist/sdk/schedule.js +1 -1
  105. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  106. package/dist/sdk/segment/fields-display.js +1 -1
  107. package/dist/sdk/segment/file-discovery.js +1 -1
  108. package/dist/sdk/segment/journey-utils.js +1 -1
  109. package/dist/sdk/segment/journey-validator.js +1 -1
  110. package/dist/sdk/segment/journey-yaml.js +1 -1
  111. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  112. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  113. package/dist/sdk/segment/pull-workflow.js +1 -1
  114. package/dist/sdk/segment/push-recovery.js +1 -1
  115. package/dist/sdk/segment/push-workflow.js +1 -1
  116. package/dist/sdk/segment/resolution-context.js +1 -1
  117. package/dist/sdk/segment/segment-path-parser.js +1 -1
  118. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  119. package/dist/sdk/segment/target-resolution.js +1 -1
  120. package/dist/sdk/segment/tdx-config.js +1 -1
  121. package/dist/sdk/segment/validate-files.js +1 -1
  122. package/dist/sdk/segment/yaml-validator.js +1 -1
  123. package/dist/sdk/segment.js +1 -1
  124. package/dist/sdk/types/index.js +1 -1
  125. package/dist/sdk/types/progress.js +1 -1
  126. package/dist/sdk/user.js +1 -1
  127. package/dist/sdk/util/format-detector.js +1 -1
  128. package/dist/sdk/util/formatters.js +1 -1
  129. package/dist/sdk/util/index.js +1 -1
  130. package/dist/sdk/util/tree-formatter.js +1 -1
  131. package/dist/sdk/workflow/archive-validation.js +1 -1
  132. package/dist/sdk/workflow/clone-workflow.js +1 -1
  133. package/dist/sdk/workflow/index.js +1 -1
  134. package/dist/sdk/workflow/pull-workflow.js +1 -1
  135. package/dist/sdk/workflow/push-workflow.js +1 -1
  136. package/dist/sdk/workflow/tdx-config.js +1 -1
  137. package/dist/sdk/workflow/workflow-utils.js +1 -1
  138. package/dist/test-utils/command-runner.js +1 -1
  139. package/dist/test-utils/factories.js +1 -1
  140. package/dist/test-utils/fixtures.js +1 -1
  141. package/dist/test-utils/http-mock.js +1 -1
  142. package/dist/test-utils/index.js +1 -1
  143. package/dist/utils/async.js +1 -1
  144. package/dist/utils/colors.js +1 -1
  145. package/dist/utils/diff.js +1 -1
  146. package/dist/utils/file-permissions.js +1 -1
  147. package/dist/utils/global-cache.js +1 -1
  148. package/dist/utils/json-loader.js +1 -1
  149. package/dist/utils/local-cache.js +1 -1
  150. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  151. package/dist/utils/logger/formatters/index.js +1 -1
  152. package/dist/utils/logger/handlers/console-handler.js +1 -1
  153. package/dist/utils/logger/handlers/file-handler.js +1 -1
  154. package/dist/utils/logger/handlers/index.js +1 -1
  155. package/dist/utils/logger/handlers/null-handler.js +1 -1
  156. package/dist/utils/logger/index.js +1 -1
  157. package/dist/utils/logger/logger.js +1 -1
  158. package/dist/utils/logger/types.js +1 -1
  159. package/dist/utils/option-validation.js +1 -1
  160. package/dist/utils/port.js +1 -1
  161. package/dist/utils/process.js +1 -1
  162. package/dist/utils/prompt.js +1 -1
  163. package/dist/utils/spinner.js +1 -1
  164. package/dist/utils/sse-parser.js +1 -1
  165. package/dist/utils/string-utils.js +1 -1
  166. package/dist/utils/table-ref-parser.js +1 -1
  167. package/dist/utils/tdx-logger.js +1 -1
  168. package/dist/utils/version-check.js +1 -1
  169. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x44f11a,_0x11c183){const _0x2bf6a2=a143_0x52b6,_0x1ceb52=_0x44f11a();while(!![]){try{const _0x44a796=parseInt(_0x2bf6a2(0x1cd))/0x1+parseInt(_0x2bf6a2(0x1d5))/0x2+-parseInt(_0x2bf6a2(0x1c9))/0x3+parseInt(_0x2bf6a2(0x1e0))/0x4+parseInt(_0x2bf6a2(0x1d4))/0x5+-parseInt(_0x2bf6a2(0x1d3))/0x6+-parseInt(_0x2bf6a2(0x1d9))/0x7;if(_0x44a796===_0x11c183)break;else _0x1ceb52['push'](_0x1ceb52['shift']());}catch(_0x30ea32){_0x1ceb52['push'](_0x1ceb52['shift']());}}}(a143_0xbaf3,0x4d63d));import{formatRows,hyperlink}from'./formatters.js';function a143_0xbaf3(){const _0xd3fe49=['(completed)','sortKey','1977900FcNXGC','sort','📁\x20','displayName','map','join','showIcons','journeyBundleName','folderCount','launched','type','name','(paused)','showTreeLines','indent','dim','🗺️\x20','children','getJourneyUrl','└──\x20','draft','metadata','\x20\x20\x20\x20','journeyCount','showMetadata','(draft)','310494IPeOXd','\x20\x20\x20','getSegmentUrl','population','209333EGPWAz','folder','🗺️','state','segment','segmentCount','1355004XeLOwf','2295665pDVZPH','845588uHxTeh','paused','push','localeCompare','6575898MdmfCh','journey','\x20folder','├──\x20','length'];a143_0xbaf3=function(){return _0xd3fe49;};return a143_0xbaf3();}import a143_0x5815ce from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};export function formatTree(_0x64eba1,_0x1248d4={},_0x19b093=0x0,_0x303f9f=''){const _0x508408=a143_0x52b6,_0x491b0e={...DEFAULT_OPTIONS,..._0x1248d4},_0x2bd07b=[],_0x3dee37=[..._0x64eba1][_0x508408(0x1e1)]((_0x47384b,_0x32dd64)=>_0x47384b[_0x508408(0x1eb)][_0x508408(0x1d8)](_0x32dd64[_0x508408(0x1eb)],undefined,{'sensitivity':'base'}));for(let _0xfbc935=0x0;_0xfbc935<_0x3dee37[_0x508408(0x1dd)];_0xfbc935++){const _0x22f388=_0x3dee37[_0xfbc935],_0x22f0c3=_0xfbc935===_0x3dee37['length']-0x1;let _0x4b5e96='';_0x19b093>0x0&&(_0x4b5e96+=_0x303f9f);_0x491b0e[_0x508408(0x1ed)]&&_0x19b093>0x0&&(_0x4b5e96+=a143_0x5815ce[_0x508408(0x1ef)](_0x22f0c3?_0x508408(0x1f3):_0x508408(0x1dc)));if(_0x491b0e[_0x508408(0x1e6)]){if(_0x22f388[_0x508408(0x1ea)]===_0x508408(0x1ce))_0x4b5e96+=_0x508408(0x1e2);else _0x22f388[_0x508408(0x1ea)]===_0x508408(0x1da)?_0x4b5e96+=_0x508408(0x1f0):_0x4b5e96+='🎯\x20';}if(_0x491b0e['getSegmentUrl']&&_0x22f388[_0x508408(0x1ea)]===_0x508408(0x1d1))_0x4b5e96+=hyperlink(_0x22f388['name'],_0x491b0e[_0x508408(0x1cb)](_0x22f388['id']));else _0x491b0e[_0x508408(0x1f2)]&&_0x22f388[_0x508408(0x1ea)]===_0x508408(0x1da)?_0x4b5e96+=hyperlink(_0x22f388[_0x508408(0x1eb)],_0x491b0e['getJourneyUrl'](_0x22f388['id'])):_0x4b5e96+=_0x22f388[_0x508408(0x1eb)];if(_0x491b0e[_0x508408(0x1c7)]){if(_0x22f388[_0x508408(0x1ea)]===_0x508408(0x1ce)){const _0x36c089=[];_0x22f388['metadata'][_0x508408(0x1d2)]&&_0x36c089[_0x508408(0x1d7)](_0x22f388[_0x508408(0x1c4)][_0x508408(0x1d2)]+'\x20segment'+(_0x22f388[_0x508408(0x1c4)][_0x508408(0x1d2)]!==0x1?'s':'')),_0x22f388[_0x508408(0x1c4)]['folderCount']&&_0x36c089[_0x508408(0x1d7)](_0x22f388[_0x508408(0x1c4)][_0x508408(0x1e8)]+_0x508408(0x1db)+(_0x22f388[_0x508408(0x1c4)][_0x508408(0x1e8)]!==0x1?'s':'')),_0x22f388[_0x508408(0x1c4)][_0x508408(0x1c6)]&&_0x36c089['push'](_0x22f388[_0x508408(0x1c4)][_0x508408(0x1c6)]+'\x20journey'+(_0x22f388[_0x508408(0x1c4)]['journeyCount']!==0x1?'s':'')),_0x36c089[_0x508408(0x1dd)]>0x0&&(_0x4b5e96+=a143_0x5815ce[_0x508408(0x1ef)]('\x20('+_0x36c089[_0x508408(0x1e5)](',\x20')+')'));}else{if(_0x22f388[_0x508408(0x1ea)]===_0x508408(0x1d1)&&_0x22f388[_0x508408(0x1cc)]!==undefined)_0x4b5e96+=a143_0x5815ce[_0x508408(0x1ef)]('\x20('+formatRows(_0x22f388[_0x508408(0x1cc)])+')');else _0x22f388[_0x508408(0x1ea)]===_0x508408(0x1da)&&_0x22f388[_0x508408(0x1d0)]&&(_0x4b5e96+=a143_0x5815ce['dim']('\x20'+getJourneyStateIndicator(_0x22f388[_0x508408(0x1d0)])));}}_0x2bd07b[_0x508408(0x1d7)](_0x4b5e96);if(_0x22f388[_0x508408(0x1f1)]&&_0x22f388[_0x508408(0x1f1)][_0x508408(0x1dd)]>0x0){let _0x3c55ed;if(_0x19b093===0x0)_0x3c55ed='';else _0x491b0e['showTreeLines']?_0x3c55ed=_0x303f9f+(_0x22f0c3?_0x508408(0x1c5):a143_0x5815ce[_0x508408(0x1ef)]('│')+_0x508408(0x1ca)):_0x3c55ed=_0x303f9f+_0x491b0e[_0x508408(0x1ee)];const _0x103ff9=formatTree(_0x22f388[_0x508408(0x1f1)],_0x491b0e,_0x19b093+0x1,_0x3c55ed);_0x2bd07b[_0x508408(0x1d7)](_0x103ff9);}}return _0x2bd07b['join']('\x0a');}function a143_0x52b6(_0xdbbea0,_0x49dd08){_0xdbbea0=_0xdbbea0-0x1c4;const _0xbaf344=a143_0xbaf3();let _0x52b601=_0xbaf344[_0xdbbea0];return _0x52b601;}export function formatFlatList(_0x49c30b,_0x3e8a9b,_0x397a34={},_0x45e7b6=[]){const _0x161f52=a143_0x52b6,_0x5d1b95={...DEFAULT_OPTIONS,..._0x397a34},_0x3b8589=[];for(const _0x349127 of _0x49c30b){_0x3b8589['push']({'sortKey':_0x349127['name'],'displayName':_0x349127[_0x161f52(0x1eb)],'icon':_0x5d1b95[_0x161f52(0x1e6)]?'📁':'','metadata':undefined});}for(const _0x714000 of _0x3e8a9b){const _0x3bba6d=_0x5d1b95[_0x161f52(0x1c7)]&&_0x714000[_0x161f52(0x1cc)]!==undefined?a143_0x5815ce[_0x161f52(0x1ef)]('\x20('+formatRows(_0x714000['population'])+')'):'',_0x50897c=_0x5d1b95[_0x161f52(0x1cb)]?hyperlink(_0x714000['name'],_0x5d1b95[_0x161f52(0x1cb)](_0x714000['id'])):_0x714000[_0x161f52(0x1eb)];_0x3b8589[_0x161f52(0x1d7)]({'sortKey':_0x714000[_0x161f52(0x1eb)],'displayName':_0x50897c,'icon':_0x5d1b95[_0x161f52(0x1e6)]?'🎯':'','metadata':_0x3bba6d});}for(const _0x3b9c57 of _0x45e7b6){const _0x508285=getJourneyStateIndicator(_0x3b9c57['state']),_0x36c7e7=_0x5d1b95['showMetadata']?a143_0x5815ce[_0x161f52(0x1ef)]('\x20'+_0x508285):'',_0x439218=_0x5d1b95[_0x161f52(0x1f2)]?hyperlink(_0x3b9c57[_0x161f52(0x1e7)],_0x5d1b95['getJourneyUrl'](_0x3b9c57['id'])):_0x3b9c57[_0x161f52(0x1e7)];_0x3b8589['push']({'sortKey':_0x3b9c57[_0x161f52(0x1e7)],'displayName':_0x439218,'icon':_0x5d1b95[_0x161f52(0x1e6)]?_0x161f52(0x1cf):'','metadata':_0x36c7e7});}_0x3b8589[_0x161f52(0x1e1)]((_0x4e450c,_0x3e8136)=>_0x4e450c[_0x161f52(0x1df)]['localeCompare'](_0x3e8136['sortKey'],undefined,{'sensitivity':'base'}));if(_0x3b8589[_0x161f52(0x1dd)]===0x0)return'(empty)';const _0x4d9a81=_0x3b8589[_0x161f52(0x1e4)](_0x243b9c=>{const _0x103d02=_0x161f52,_0x4bf50e=_0x243b9c['icon']?_0x243b9c['icon']+'\x20':'',_0x4e07a6=_0x243b9c[_0x103d02(0x1c4)]||'';return''+_0x4bf50e+_0x243b9c[_0x103d02(0x1e3)]+_0x4e07a6;});return _0x4d9a81[_0x161f52(0x1e5)]('\x0a');}function getJourneyStateIndicator(_0x305fbb){const _0x190b19=a143_0x52b6;switch(_0x305fbb){case _0x190b19(0x1f4):return _0x190b19(0x1c8);case _0x190b19(0x1e9):return'(running)';case _0x190b19(0x1d6):return _0x190b19(0x1ec);case'completed':return _0x190b19(0x1de);default:return'('+_0x305fbb+')';}}
1
+ (function(_0x46c2a8,_0x258773){const _0x41b6d4=a143_0x5073,_0x48353d=_0x46c2a8();while(!![]){try{const _0x12a318=-parseInt(_0x41b6d4(0x98))/0x1+-parseInt(_0x41b6d4(0xa7))/0x2*(-parseInt(_0x41b6d4(0xb6))/0x3)+-parseInt(_0x41b6d4(0x96))/0x4+-parseInt(_0x41b6d4(0xa4))/0x5*(parseInt(_0x41b6d4(0xc0))/0x6)+parseInt(_0x41b6d4(0xaa))/0x7*(-parseInt(_0x41b6d4(0xa9))/0x8)+parseInt(_0x41b6d4(0xb1))/0x9+parseInt(_0x41b6d4(0x9e))/0xa;if(_0x12a318===_0x258773)break;else _0x48353d['push'](_0x48353d['shift']());}catch(_0x1bbfc8){_0x48353d['push'](_0x48353d['shift']());}}}(a143_0x3089,0xd175f));import{formatRows,hyperlink}from'./formatters.js';import a143_0x5380c1 from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};export function formatTree(_0x2c0406,_0x181745={},_0x4e92fb=0x0,_0x167bdb=''){const _0x46c9eb=a143_0x5073,_0x307c3f={...DEFAULT_OPTIONS,..._0x181745},_0x444561=[],_0x3cea91=[..._0x2c0406]['sort']((_0x3d69e8,_0x287c38)=>_0x3d69e8['name'][_0x46c9eb(0xb4)](_0x287c38[_0x46c9eb(0xac)],undefined,{'sensitivity':_0x46c9eb(0xbc)}));for(let _0x615064=0x0;_0x615064<_0x3cea91[_0x46c9eb(0xb3)];_0x615064++){const _0x119f4c=_0x3cea91[_0x615064],_0x106c65=_0x615064===_0x3cea91[_0x46c9eb(0xb3)]-0x1;let _0x95285b='';_0x4e92fb>0x0&&(_0x95285b+=_0x167bdb);_0x307c3f['showTreeLines']&&_0x4e92fb>0x0&&(_0x95285b+=a143_0x5380c1[_0x46c9eb(0x9b)](_0x106c65?'└──\x20':_0x46c9eb(0xba)));if(_0x307c3f['showIcons']){if(_0x119f4c[_0x46c9eb(0xad)]==='folder')_0x95285b+='📁\x20';else _0x119f4c[_0x46c9eb(0xad)]===_0x46c9eb(0x8e)?_0x95285b+=_0x46c9eb(0xb9):_0x95285b+=_0x46c9eb(0x94);}if(_0x307c3f[_0x46c9eb(0xb8)]&&_0x119f4c[_0x46c9eb(0xad)]===_0x46c9eb(0x91))_0x95285b+=hyperlink(_0x119f4c[_0x46c9eb(0xac)],_0x307c3f[_0x46c9eb(0xb8)](_0x119f4c['id']));else _0x307c3f[_0x46c9eb(0xa2)]&&_0x119f4c[_0x46c9eb(0xad)]===_0x46c9eb(0x8e)?_0x95285b+=hyperlink(_0x119f4c[_0x46c9eb(0xac)],_0x307c3f['getJourneyUrl'](_0x119f4c['id'])):_0x95285b+=_0x119f4c[_0x46c9eb(0xac)];if(_0x307c3f[_0x46c9eb(0x9f)]){if(_0x119f4c[_0x46c9eb(0xad)]===_0x46c9eb(0xbb)){const _0x44fff6=[];_0x119f4c['metadata'][_0x46c9eb(0xa3)]&&_0x44fff6[_0x46c9eb(0xbd)](_0x119f4c[_0x46c9eb(0xc2)]['segmentCount']+_0x46c9eb(0xc3)+(_0x119f4c[_0x46c9eb(0xc2)][_0x46c9eb(0xa3)]!==0x1?'s':'')),_0x119f4c[_0x46c9eb(0xc2)][_0x46c9eb(0x90)]&&_0x44fff6[_0x46c9eb(0xbd)](_0x119f4c[_0x46c9eb(0xc2)][_0x46c9eb(0x90)]+_0x46c9eb(0xa8)+(_0x119f4c[_0x46c9eb(0xc2)]['folderCount']!==0x1?'s':'')),_0x119f4c[_0x46c9eb(0xc2)][_0x46c9eb(0x92)]&&_0x44fff6[_0x46c9eb(0xbd)](_0x119f4c[_0x46c9eb(0xc2)]['journeyCount']+_0x46c9eb(0x93)+(_0x119f4c[_0x46c9eb(0xc2)][_0x46c9eb(0x92)]!==0x1?'s':'')),_0x44fff6[_0x46c9eb(0xb3)]>0x0&&(_0x95285b+=a143_0x5380c1[_0x46c9eb(0x9b)]('\x20('+_0x44fff6[_0x46c9eb(0xc1)](',\x20')+')'));}else{if(_0x119f4c['type']===_0x46c9eb(0x91)&&_0x119f4c['population']!==undefined)_0x95285b+=a143_0x5380c1[_0x46c9eb(0x9b)]('\x20('+formatRows(_0x119f4c[_0x46c9eb(0xab)])+')');else _0x119f4c[_0x46c9eb(0xad)]==='journey'&&_0x119f4c[_0x46c9eb(0x95)]&&(_0x95285b+=a143_0x5380c1[_0x46c9eb(0x9b)]('\x20'+getJourneyStateIndicator(_0x119f4c[_0x46c9eb(0x95)])));}}_0x444561[_0x46c9eb(0xbd)](_0x95285b);if(_0x119f4c['children']&&_0x119f4c[_0x46c9eb(0x99)][_0x46c9eb(0xb3)]>0x0){let _0x22c58d;if(_0x4e92fb===0x0)_0x22c58d='';else _0x307c3f[_0x46c9eb(0xa5)]?_0x22c58d=_0x167bdb+(_0x106c65?_0x46c9eb(0xb5):a143_0x5380c1['dim']('│')+_0x46c9eb(0xbe)):_0x22c58d=_0x167bdb+_0x307c3f[_0x46c9eb(0xbf)];const _0x141c69=formatTree(_0x119f4c[_0x46c9eb(0x99)],_0x307c3f,_0x4e92fb+0x1,_0x22c58d);_0x444561[_0x46c9eb(0xbd)](_0x141c69);}}return _0x444561['join']('\x0a');}function a143_0x5073(_0x17656d,_0x18ff4d){_0x17656d=_0x17656d-0x8d;const _0x3089b4=a143_0x3089();let _0x507391=_0x3089b4[_0x17656d];return _0x507391;}export function formatFlatList(_0x4415d2,_0x289ad8,_0x4f2e9c={},_0x52c8a0=[]){const _0xe08b88=a143_0x5073,_0x2df900={...DEFAULT_OPTIONS,..._0x4f2e9c},_0x353045=[];for(const _0x320b44 of _0x4415d2){_0x353045['push']({'sortKey':_0x320b44[_0xe08b88(0xac)],'displayName':_0x320b44[_0xe08b88(0xac)],'icon':_0x2df900['showIcons']?'📁':'','metadata':undefined});}for(const _0x591c90 of _0x289ad8){const _0x569320=_0x2df900['showMetadata']&&_0x591c90[_0xe08b88(0xab)]!==undefined?a143_0x5380c1[_0xe08b88(0x9b)]('\x20('+formatRows(_0x591c90[_0xe08b88(0xab)])+')'):'',_0x35b182=_0x2df900[_0xe08b88(0xb8)]?hyperlink(_0x591c90[_0xe08b88(0xac)],_0x2df900['getSegmentUrl'](_0x591c90['id'])):_0x591c90['name'];_0x353045[_0xe08b88(0xbd)]({'sortKey':_0x591c90['name'],'displayName':_0x35b182,'icon':_0x2df900[_0xe08b88(0xae)]?'🎯':'','metadata':_0x569320});}for(const _0x2c3926 of _0x52c8a0){const _0x344dba=getJourneyStateIndicator(_0x2c3926[_0xe08b88(0x95)]),_0x222c39=_0x2df900[_0xe08b88(0x9f)]?a143_0x5380c1['dim']('\x20'+_0x344dba):'',_0x36ec85=_0x2df900[_0xe08b88(0xa2)]?hyperlink(_0x2c3926['journeyBundleName'],_0x2df900[_0xe08b88(0xa2)](_0x2c3926['id'])):_0x2c3926[_0xe08b88(0xaf)];_0x353045['push']({'sortKey':_0x2c3926[_0xe08b88(0xaf)],'displayName':_0x36ec85,'icon':_0x2df900[_0xe08b88(0xae)]?_0xe08b88(0xb7):'','metadata':_0x222c39});}_0x353045[_0xe08b88(0xa6)]((_0x96f14b,_0x4d1508)=>_0x96f14b[_0xe08b88(0x8d)]['localeCompare'](_0x4d1508[_0xe08b88(0x8d)],undefined,{'sensitivity':'base'}));if(_0x353045[_0xe08b88(0xb3)]===0x0)return'(empty)';const _0x5d665c=_0x353045[_0xe08b88(0xa0)](_0x205a2e=>{const _0x2ef763=_0xe08b88,_0x1973ed=_0x205a2e[_0x2ef763(0x9d)]?_0x205a2e[_0x2ef763(0x9d)]+'\x20':'',_0x5c8054=_0x205a2e[_0x2ef763(0xc2)]||'';return''+_0x1973ed+_0x205a2e['displayName']+_0x5c8054;});return _0x5d665c[_0xe08b88(0xc1)]('\x0a');}function a143_0x3089(){const _0x4942e3=['\x20\x20\x20\x20','9mxjOkE','🗺️','getSegmentUrl','🗺️\x20','├──\x20','folder','base','push','\x20\x20\x20','indent','18WrVara','join','metadata','\x20segment','sortKey','journey','launched','folderCount','segment','journeyCount','\x20journey','🎯\x20','state','4585508oikltv','(running)','71113mztkcE','children','(completed)','dim','paused','icon','21041010WyioOj','showMetadata','map','draft','getJourneyUrl','segmentCount','2406305xqEZhb','showTreeLines','sort','479352BqGKyf','\x20folder','7166144SyGbCU','7JWZAjz','population','name','type','showIcons','journeyBundleName','(paused)','14326767lpPhui','(draft)','length','localeCompare'];a143_0x3089=function(){return _0x4942e3;};return a143_0x3089();}function getJourneyStateIndicator(_0x3f899b){const _0x41c163=a143_0x5073;switch(_0x3f899b){case _0x41c163(0xa1):return _0x41c163(0xb2);case _0x41c163(0x8f):return _0x41c163(0x97);case _0x41c163(0x9c):return _0x41c163(0xb0);case'completed':return _0x41c163(0x9a);default:return'('+_0x3f899b+')';}}
@@ -1 +1 @@
1
- (function(_0x22f8e4,_0x308daf){const _0x48a537=a144_0x23a9,_0x2715f7=_0x22f8e4();while(!![]){try{const _0x434432=-parseInt(_0x48a537(0x148))/0x1*(parseInt(_0x48a537(0x14d))/0x2)+-parseInt(_0x48a537(0x14c))/0x3+-parseInt(_0x48a537(0x14b))/0x4*(-parseInt(_0x48a537(0x13a))/0x5)+parseInt(_0x48a537(0x13d))/0x6+parseInt(_0x48a537(0x139))/0x7+-parseInt(_0x48a537(0x137))/0x8+parseInt(_0x48a537(0x138))/0x9;if(_0x434432===_0x308daf)break;else _0x2715f7['push'](_0x2715f7['shift']());}catch(_0x280fcb){_0x2715f7['push'](_0x2715f7['shift']());}}}(a144_0x1517,0xd0dd1));function a144_0x23a9(_0xe19e39,_0xe65ec){_0xe19e39=_0xe19e39-0x132;const _0x1517ed=a144_0x1517();let _0x23a9e7=_0x1517ed[_0xe19e39];return _0x23a9e7;}import{SDKError,ErrorCode}from'../errors.js';const GZIP_MAGIC=Buffer['from']([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x260b9c){const _0x3fd113=a144_0x23a9;if(_0x260b9c[_0x3fd113(0x141)]<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x260b9c[_0x3fd113(0x141)],'error':{'message':'Downloaded\x20archive\x20is\x20too\x20small\x20('+_0x260b9c[_0x3fd113(0x141)]+'\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.','preview':getContentPreview(_0x260b9c),'helpText':_0x3fd113(0x134)}};if(!_0x260b9c[_0x3fd113(0x13c)](0x0,0x2)[_0x3fd113(0x144)](GZIP_MAGIC)){const _0x5e3254=getContentPreview(_0x260b9c),_0x1fdfcc=_0x5e3254?_0x3fd113(0x133)+_0x5e3254:'';return{'isValid':![],'size':_0x260b9c[_0x3fd113(0x141)],'error':{'message':_0x3fd113(0x142)+_0x1fdfcc,'preview':_0x5e3254,'helpText':'The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.'}};}return{'isValid':!![],'size':_0x260b9c[_0x3fd113(0x141)]};}function getContentPreview(_0x458130){const _0x4c22ef=a144_0x23a9;if(_0x458130[_0x4c22ef(0x141)]===0x0)return _0x4c22ef(0x147);const _0x2492c6=_0x458130['subarray'](0x0,0xc8)['toString'](_0x4c22ef(0x145)),_0x41fc6c=_0x2492c6[_0x4c22ef(0x13e)]('')[_0x4c22ef(0x143)](_0x7fe066=>{const _0x342127=_0x4c22ef,_0x52d87e=_0x7fe066[_0x342127(0x14a)](0x0);return _0x52d87e>=0x20&&_0x52d87e<0x7f||_0x52d87e===0xa||_0x52d87e===0xd||_0x52d87e===0x9;})[_0x4c22ef(0x141)],_0x58bcad=_0x41fc6c/_0x2492c6['length'];if(_0x58bcad>0.8){const _0x56f01d=_0x2492c6[_0x4c22ef(0x140)](0x0,0x64)[_0x4c22ef(0x135)]();return _0x56f01d[_0x4c22ef(0x141)]<_0x2492c6['trim']()['length']?_0x56f01d+_0x4c22ef(0x132):_0x56f01d;}return undefined;}function a144_0x1517(){const _0x1cf83e=['helpText','charCodeAt','9748KGJslm','1988094RnycCN','2pSCeZs','...','\x20Server\x20response\x20preview:\x20','Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.','trim','message','9921312vNYuQs','2471580svjOVc','10689252fxbqDE','2065uQJFbU','error','subarray','1385166zUcrfQ','split','Archive\x20validation\x20failed\x20with\x20unknown\x20error','slice','length','Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.','filter','equals','utf-8','WORKFLOW_ARCHIVE_CORRUPTED','(empty\x20response)','280631TmTjFq'];a144_0x1517=function(){return _0x1cf83e;};return a144_0x1517();}export function throwArchiveValidationError(_0x227925){const _0x45b221=a144_0x23a9;if(!_0x227925[_0x45b221(0x13b)])throw new SDKError(ErrorCode[_0x45b221(0x146)],_0x45b221(0x13f));throw new SDKError(ErrorCode[_0x45b221(0x146)],_0x227925[_0x45b221(0x13b)][_0x45b221(0x136)],undefined,{'helpText':_0x227925[_0x45b221(0x13b)][_0x45b221(0x149)]});}
1
+ const a144_0x1163da=a144_0x119b;function a144_0x119b(_0x12378b,_0x501455){_0x12378b=_0x12378b-0x1c1;const _0x3e118a=a144_0x3e11();let _0x119b53=_0x3e118a[_0x12378b];return _0x119b53;}(function(_0x17ade2,_0x436f4d){const _0x4f9dbe=a144_0x119b,_0x142111=_0x17ade2();while(!![]){try{const _0x50384f=parseInt(_0x4f9dbe(0x1ca))/0x1+-parseInt(_0x4f9dbe(0x1cc))/0x2*(parseInt(_0x4f9dbe(0x1ce))/0x3)+-parseInt(_0x4f9dbe(0x1c1))/0x4*(parseInt(_0x4f9dbe(0x1d1))/0x5)+parseInt(_0x4f9dbe(0x1cf))/0x6+parseInt(_0x4f9dbe(0x1c3))/0x7+parseInt(_0x4f9dbe(0x1d7))/0x8+-parseInt(_0x4f9dbe(0x1cb))/0x9;if(_0x50384f===_0x436f4d)break;else _0x142111['push'](_0x142111['shift']());}catch(_0xb96ee8){_0x142111['push'](_0x142111['shift']());}}}(a144_0x3e11,0x7e734));import{SDKError,ErrorCode}from'../errors.js';const GZIP_MAGIC=Buffer[a144_0x1163da(0x1d8)]([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x4eb9b3){const _0xd1d764=a144_0x1163da;if(_0x4eb9b3[_0xd1d764(0x1da)]<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x4eb9b3[_0xd1d764(0x1da)],'error':{'message':_0xd1d764(0x1d0)+_0x4eb9b3[_0xd1d764(0x1da)]+_0xd1d764(0x1d3),'preview':getContentPreview(_0x4eb9b3),'helpText':_0xd1d764(0x1c7)}};if(!_0x4eb9b3['subarray'](0x0,0x2)[_0xd1d764(0x1d2)](GZIP_MAGIC)){const _0x7ccb83=getContentPreview(_0x4eb9b3),_0xe7e4e3=_0x7ccb83?_0xd1d764(0x1d5)+_0x7ccb83:'';return{'isValid':![],'size':_0x4eb9b3[_0xd1d764(0x1da)],'error':{'message':_0xd1d764(0x1dc)+_0xe7e4e3,'preview':_0x7ccb83,'helpText':_0xd1d764(0x1c5)}};}return{'isValid':!![],'size':_0x4eb9b3[_0xd1d764(0x1da)]};}function getContentPreview(_0x94ed2c){const _0x260cd2=a144_0x1163da;if(_0x94ed2c[_0x260cd2(0x1da)]===0x0)return _0x260cd2(0x1c9);const _0x57119b=_0x94ed2c[_0x260cd2(0x1c6)](0x0,0xc8)[_0x260cd2(0x1dd)]('utf-8'),_0x1b6459=_0x57119b[_0x260cd2(0x1d4)]('')[_0x260cd2(0x1d6)](_0x98be63=>{const _0x2fd35b=_0x98be63['charCodeAt'](0x0);return _0x2fd35b>=0x20&&_0x2fd35b<0x7f||_0x2fd35b===0xa||_0x2fd35b===0xd||_0x2fd35b===0x9;})[_0x260cd2(0x1da)],_0x579ce8=_0x1b6459/_0x57119b[_0x260cd2(0x1da)];if(_0x579ce8>0.8){const _0x4c0185=_0x57119b['slice'](0x0,0x64)[_0x260cd2(0x1c2)]();return _0x4c0185[_0x260cd2(0x1da)]<_0x57119b[_0x260cd2(0x1c2)]()['length']?_0x4c0185+_0x260cd2(0x1c4):_0x4c0185;}return undefined;}export function throwArchiveValidationError(_0x2fc64e){const _0x24fffb=a144_0x1163da;if(!_0x2fc64e[_0x24fffb(0x1db)])throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x24fffb(0x1d9));throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x2fc64e['error'][_0x24fffb(0x1c8)],undefined,{'helpText':_0x2fc64e[_0x24fffb(0x1db)][_0x24fffb(0x1cd)]});}function a144_0x3e11(){const _0x42a0eb=['split','\x20Server\x20response\x20preview:\x20','filter','1531384WuKoYR','from','Archive\x20validation\x20failed\x20with\x20unknown\x20error','length','error','Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.','toString','9068HRsFhJ','trim','5253682zDGqlJ','...','The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.','subarray','Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.','message','(empty\x20response)','700565yTWRoz','9037674xrUTDC','170132qafpGA','helpText','18zyFnGk','2394456dtJIFp','Downloaded\x20archive\x20is\x20too\x20small\x20(','20HXXIUS','equals','\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.'];a144_0x3e11=function(){return _0x42a0eb;};return a144_0x3e11();}
@@ -1 +1 @@
1
- (function(_0x1344a1,_0x13a2b2){const _0x3c8125=a145_0x5096,_0x26ee4c=_0x1344a1();while(!![]){try{const _0x20dd58=parseInt(_0x3c8125(0x110))/0x1*(-parseInt(_0x3c8125(0x11f))/0x2)+parseInt(_0x3c8125(0x131))/0x3*(parseInt(_0x3c8125(0x135))/0x4)+-parseInt(_0x3c8125(0x111))/0x5*(-parseInt(_0x3c8125(0x12f))/0x6)+parseInt(_0x3c8125(0x116))/0x7+-parseInt(_0x3c8125(0x136))/0x8+parseInt(_0x3c8125(0x12a))/0x9*(-parseInt(_0x3c8125(0x10f))/0xa)+-parseInt(_0x3c8125(0x125))/0xb;if(_0x20dd58===_0x13a2b2)break;else _0x26ee4c['push'](_0x26ee4c['shift']());}catch(_0x398e58){_0x26ee4c['push'](_0x26ee4c['shift']());}}}(a145_0x4298,0x8d9c5));function a145_0x4298(){const _0x2f24d1=['newProjectName','sourceDir','1472644xemnTC','3807664wyhnEj','endsWith','20elVNuD','1ZfSIbL','22490mRSPtF','sourceProjectName','filter','isDirectory','archive.tar.gz','4760595nEAMKp','tdx-wf-clone-','mkdtemp','length','tdx.json','toISOString','Source\x20directory\x20not\x20found:\x20','access','workflow_project','245020ZCDDaS','resolve','tmpdir','push','readdir','join','10127337yyfUzt','tar','uploadProjectArchive','revision','data','2612241aFUnch','No\x20','config','\x20workflow\x20files\x20found\x20in\x20','name','1194NnTdov','listProjects','9qPjqbx','skipValidation'];a145_0x4298=function(){return _0x2f24d1;};return a145_0x4298();}import{promises as a145_0x52ce33}from'fs';import a145_0x39df22 from'path';function a145_0x5096(_0x27dd6c,_0x12b540){_0x27dd6c=_0x27dd6c-0x10f;const _0x429862=a145_0x4298();let _0x509604=_0x429862[_0x27dd6c];return _0x509604;}import a145_0x131f13 from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';export async function prepareCloneWorkflow(_0x12a292,_0x528ef0,_0x2020ca,_0x25ced3={}){const _0x2ae481=a145_0x5096,{client:_0x24bf70}=_0x12a292,_0x18ff4b=a145_0x39df22[_0x2ae481(0x120)](_0x528ef0);try{await a145_0x52ce33[_0x2ae481(0x11d)](_0x18ff4b);}catch{throw new Error(_0x2ae481(0x11c)+_0x528ef0);}const _0x30ae21=tryFindWorkflowTdxConfig(_0x18ff4b),_0x2bb6b9=_0x30ae21?.[_0x2ae481(0x12c)][_0x2ae481(0x11e)],_0x4b416e=_0x25ced3['revision']||new Date()[_0x2ae481(0x11b)]()['replace'](/[:.]/g,'-');if(!_0x25ced3[_0x2ae481(0x132)]){const _0xe41cc5=await a145_0x52ce33[_0x2ae481(0x123)](_0x18ff4b),_0x545914=_0xe41cc5[_0x2ae481(0x113)](_0xaa3118=>_0xaa3118[_0x2ae481(0x137)](WORKFLOW_FILE_EXTENSION));if(_0x545914[_0x2ae481(0x119)]===0x0)throw new Error(_0x2ae481(0x12b)+WORKFLOW_FILE_EXTENSION+_0x2ae481(0x12d)+_0x18ff4b);}const _0x138106=await getProjectFiles(_0x18ff4b);let _0x2cce85=![],_0xd86bda;try{const _0x100ade=await _0x24bf70[_0x2ae481(0x130)]({'name_pattern':_0x2020ca}),_0x8ccef2=_0x100ade[_0x2ae481(0x129)]['find'](_0x23ced7=>_0x23ced7[_0x2ae481(0x12e)]===_0x2020ca);_0x8ccef2&&(_0x2cce85=!![],_0xd86bda=_0x8ccef2['id']);}catch{}return{'sourceDir':_0x18ff4b,'sourceProjectName':_0x2bb6b9,'newProjectName':_0x2020ca,'revision':_0x4b416e,'fileCount':_0x138106[_0x2ae481(0x119)],'files':_0x138106,'targetExists':_0x2cce85,'existingProjectId':_0xd86bda};}export async function executeCloneWorkflow(_0x291849,_0x59c174){const _0x197d80=a145_0x5096,_0xd0b86b=await import(_0x197d80(0x126)),{client:_0xd7b1aa}=_0x291849,_0x501b11=await getProjectFiles(_0x59c174[_0x197d80(0x134)]),_0x3f0b35=await a145_0x52ce33[_0x197d80(0x118)](a145_0x39df22[_0x197d80(0x124)](a145_0x131f13[_0x197d80(0x121)](),_0x197d80(0x117))),_0x51225e=a145_0x39df22[_0x197d80(0x124)](_0x3f0b35,_0x197d80(0x115));try{await _0xd0b86b['create']({'file':_0x51225e,'gzip':!![],'cwd':_0x59c174['sourceDir'],'portable':!![]},_0x501b11);const _0x3243e8=await _0xd7b1aa[_0x197d80(0x127)](_0x59c174[_0x197d80(0x133)],_0x59c174[_0x197d80(0x128)],_0x51225e);return{'sourceDir':_0x59c174[_0x197d80(0x134)],'sourceProjectName':_0x59c174[_0x197d80(0x112)],'newProjectName':_0x3243e8[_0x197d80(0x12e)],'newProjectId':_0x3243e8['id'],'revision':_0x3243e8[_0x197d80(0x128)],'fileCount':_0x501b11[_0x197d80(0x119)],'files':_0x501b11};}finally{await a145_0x52ce33['rm'](_0x3f0b35,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x42467d,_0x2c6c80=''){const _0x513026=a145_0x5096,_0x382115=[],_0x5f1668=await a145_0x52ce33[_0x513026(0x123)](_0x42467d,{'withFileTypes':!![]});for(const _0x18c028 of _0x5f1668){const _0x25cf9c=_0x2c6c80?a145_0x39df22['join'](_0x2c6c80,_0x18c028[_0x513026(0x12e)]):_0x18c028[_0x513026(0x12e)];if(_0x18c028[_0x513026(0x12e)]===_0x513026(0x11a))continue;if(!shouldIncludeInArchive(_0x18c028['name']))continue;if(_0x18c028[_0x513026(0x114)]()){const _0xbecd60=await getProjectFiles(a145_0x39df22['join'](_0x42467d,_0x18c028['name']),_0x25cf9c);_0x382115[_0x513026(0x122)](..._0xbecd60);}else _0x382115[_0x513026(0x122)](_0x25cf9c);}return _0x382115;}
1
+ function a145_0x4999(){const _0x41e0e2=['revision','data','newProjectName','98903ZCXbFf','No\x20','998GvRSHD','sourceDir','resolve','sourceProjectName','2770650RvNwak','readdir','length','config','find','uploadProjectArchive','listProjects','24eXMwKm','toISOString','tdx-wf-clone-','replace','access','archive.tar.gz','filter','name','join','2229724xHeswZ','push','skipValidation','endsWith','641775WoJvsf','373OagyDn','977466SJZZvt','370431MUUyyF','mkdtemp','create'];a145_0x4999=function(){return _0x41e0e2;};return a145_0x4999();}(function(_0x292805,_0x458d4e){const _0x1557f3=a145_0x40dc,_0x4402e9=_0x292805();while(!![]){try{const _0x256cc2=-parseInt(_0x1557f3(0x76))/0x1*(parseInt(_0x1557f3(0x80))/0x2)+-parseInt(_0x1557f3(0x77))/0x3+parseInt(_0x1557f3(0x71))/0x4+-parseInt(_0x1557f3(0x75))/0x5+parseInt(_0x1557f3(0x84))/0x6+-parseInt(_0x1557f3(0x7e))/0x7*(parseInt(_0x1557f3(0x68))/0x8)+-parseInt(_0x1557f3(0x78))/0x9;if(_0x256cc2===_0x458d4e)break;else _0x4402e9['push'](_0x4402e9['shift']());}catch(_0x55abbf){_0x4402e9['push'](_0x4402e9['shift']());}}}(a145_0x4999,0x481bc));import{promises as a145_0x4c599f}from'fs';function a145_0x40dc(_0x542396,_0x40fedb){_0x542396=_0x542396-0x68;const _0x4999ef=a145_0x4999();let _0x40dcb3=_0x4999ef[_0x542396];return _0x40dcb3;}import a145_0x222421 from'path';import a145_0x449c84 from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';export async function prepareCloneWorkflow(_0x299659,_0xf8f5a6,_0x3472a6,_0x3d3058={}){const _0xac7ae6=a145_0x40dc,{client:_0xb5c32c}=_0x299659,_0x52aa0d=a145_0x222421[_0xac7ae6(0x82)](_0xf8f5a6);try{await a145_0x4c599f[_0xac7ae6(0x6c)](_0x52aa0d);}catch{throw new Error('Source\x20directory\x20not\x20found:\x20'+_0xf8f5a6);}const _0x25aecf=tryFindWorkflowTdxConfig(_0x52aa0d),_0x300edd=_0x25aecf?.[_0xac7ae6(0x87)]['workflow_project'],_0x2e27f1=_0x3d3058[_0xac7ae6(0x7b)]||new Date()[_0xac7ae6(0x69)]()[_0xac7ae6(0x6b)](/[:.]/g,'-');if(!_0x3d3058[_0xac7ae6(0x73)]){const _0x483d07=await a145_0x4c599f[_0xac7ae6(0x85)](_0x52aa0d),_0x42e07f=_0x483d07[_0xac7ae6(0x6e)](_0x53f06e=>_0x53f06e[_0xac7ae6(0x74)](WORKFLOW_FILE_EXTENSION));if(_0x42e07f[_0xac7ae6(0x86)]===0x0)throw new Error(_0xac7ae6(0x7f)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20'+_0x52aa0d);}const _0x53ec23=await getProjectFiles(_0x52aa0d);let _0x3d1130=![],_0x4db67d;try{const _0x4f73c5=await _0xb5c32c[_0xac7ae6(0x8a)]({'name_pattern':_0x3472a6}),_0xc92a31=_0x4f73c5[_0xac7ae6(0x7c)][_0xac7ae6(0x88)](_0x5aa47c=>_0x5aa47c[_0xac7ae6(0x6f)]===_0x3472a6);_0xc92a31&&(_0x3d1130=!![],_0x4db67d=_0xc92a31['id']);}catch{}return{'sourceDir':_0x52aa0d,'sourceProjectName':_0x300edd,'newProjectName':_0x3472a6,'revision':_0x2e27f1,'fileCount':_0x53ec23['length'],'files':_0x53ec23,'targetExists':_0x3d1130,'existingProjectId':_0x4db67d};}export async function executeCloneWorkflow(_0x4053bb,_0x1a8c4f){const _0x38e9e9=a145_0x40dc,_0x22b01d=await import('tar'),{client:_0x5c1bdf}=_0x4053bb,_0x3ae1eb=await getProjectFiles(_0x1a8c4f[_0x38e9e9(0x81)]),_0x3d2644=await a145_0x4c599f[_0x38e9e9(0x79)](a145_0x222421[_0x38e9e9(0x70)](a145_0x449c84['tmpdir'](),_0x38e9e9(0x6a))),_0x553aa8=a145_0x222421[_0x38e9e9(0x70)](_0x3d2644,_0x38e9e9(0x6d));try{await _0x22b01d[_0x38e9e9(0x7a)]({'file':_0x553aa8,'gzip':!![],'cwd':_0x1a8c4f['sourceDir'],'portable':!![]},_0x3ae1eb);const _0x2270d8=await _0x5c1bdf[_0x38e9e9(0x89)](_0x1a8c4f[_0x38e9e9(0x7d)],_0x1a8c4f['revision'],_0x553aa8);return{'sourceDir':_0x1a8c4f[_0x38e9e9(0x81)],'sourceProjectName':_0x1a8c4f[_0x38e9e9(0x83)],'newProjectName':_0x2270d8['name'],'newProjectId':_0x2270d8['id'],'revision':_0x2270d8[_0x38e9e9(0x7b)],'fileCount':_0x3ae1eb['length'],'files':_0x3ae1eb};}finally{await a145_0x4c599f['rm'](_0x3d2644,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x15dac0,_0x17e265=''){const _0x47d318=a145_0x40dc,_0x52af2f=[],_0x4aedb2=await a145_0x4c599f['readdir'](_0x15dac0,{'withFileTypes':!![]});for(const _0x458288 of _0x4aedb2){const _0x26b75c=_0x17e265?a145_0x222421['join'](_0x17e265,_0x458288['name']):_0x458288[_0x47d318(0x6f)];if(_0x458288['name']==='tdx.json')continue;if(!shouldIncludeInArchive(_0x458288[_0x47d318(0x6f)]))continue;if(_0x458288['isDirectory']()){const _0xd943d5=await getProjectFiles(a145_0x222421[_0x47d318(0x70)](_0x15dac0,_0x458288['name']),_0x26b75c);_0x52af2f['push'](..._0xd943d5);}else _0x52af2f[_0x47d318(0x72)](_0x26b75c);}return _0x52af2f;}
@@ -1 +1 @@
1
- const a146_0x259bce=a146_0x41d5;function a146_0x46aa(){const _0x3094b4=['min','limit','5621375NtwnXq','workflowName','length','workflow','pullProject','prepareCloneProject','393ALMQMb','includeRetried','delete','state','sessions','isFile','join','6dgZbmM','client','Cannot\x20read\x20workflow\x20file:\x20','retryAttemptName','toString','zlib','replace','sessionUuid','projectName','getAttempt','retryAttempt','attempt','listWorkflows','data','util','mkdir','retryAt','kill','find','Invalid\x20workflow\x20format:\x20','map','25028064gCVUQf','978063CsAAyR','project','getAttemptTasks','logFiles','lastAttempt','Failed\x20to\x20download\x20log\x20file:\x20','retryParams','setSecret','utf-8','1243304lICThh','config','resolveProjectId','params','executeCloneProject','listAttempts','latest','upstreams','resumeFrom','clearScheduleAll','tar','basename','isGroup','exportParams','status','parentId','substring','getProject','gunzip','listSecrets','Project\x20not\x20found:\x20','fullName','fromTime','deleteSecret','deleteProject','toISOString','updatedAt','path','uploadProjectArchive','force','tdx-workflow-','from','fromTask','WORKFLOW_PROJECT_NOT_FOUND','name','now','revision','test','arrayBuffer','tmpdir','error','startedAt','logs','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','push','unlink','listProjects','timezone','.tar.gz','sessionId','cancelRequested','readdir','Kill\x20request\x20accepted','6856031dOdsvu','projects','slice','last_id','bind','attempts','direct','success','lastId','downloadProjectArchive','Project\x20directory\x20not\x20found:\x20','index','21796KNbHES','stateParams','run','skipValidation','sessionTime','listLogFiles','createdAt','clearSchedule','No\x20','8852520MeCfBn','rawCount','done','retrySession','tasks','isDirectory','extract','applyPullProject','access'];a146_0x46aa=function(){return _0x3094b4;};return a146_0x46aa();}(function(_0x430cfc,_0x244964){const _0x5b5424=a146_0x41d5,_0x475cc7=_0x430cfc();while(!![]){try{const _0x4098a8=-parseInt(_0x5b5424(0x10f))/0x1+-parseInt(_0x5b5424(0x97))/0x2+-parseInt(_0x5b5424(0xf2))/0x3*(-parseInt(_0x5b5424(0xd8))/0x4)+parseInt(_0x5b5424(0xec))/0x5*(-parseInt(_0x5b5424(0xf9))/0x6)+parseInt(_0x5b5424(0xcc))/0x7+-parseInt(_0x5b5424(0xe1))/0x8+parseInt(_0x5b5424(0x10e))/0x9;if(_0x4098a8===_0x244964)break;else _0x475cc7['push'](_0x475cc7['shift']());}catch(_0x24b4df){_0x475cc7['push'](_0x475cc7['shift']());}}}(a146_0x46aa,0x9d209));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';const MAX_PAGINATION_LIMIT=0x3e8;async function paginateResults(_0x53253d,_0x238631,_0x2378cf=0x64){const _0x46e438=a146_0x41d5,_0xedf3cb=Math[_0x46e438(0xea)](_0x238631,MAX_PAGINATION_LIMIT),_0x347f16=[];let _0x553d38;while(_0x347f16[_0x46e438(0xee)]<_0xedf3cb){const _0x2db1f6=await _0x53253d(_0x2378cf,_0x553d38),_0x4b23cf=_0x2db1f6[_0x46e438(0xe2)]??_0x2db1f6[_0x46e438(0x106)][_0x46e438(0xee)];if(_0x4b23cf===0x0)break;_0x347f16['push'](..._0x2db1f6[_0x46e438(0x106)]);if(!_0x2db1f6['lastId']||_0x4b23cf<_0x2378cf)break;_0x553d38=_0x2db1f6[_0x46e438(0xd4)];}return _0x347f16[_0x46e438(0xce)](0x0,_0xedf3cb);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';function a146_0x41d5(_0x207472,_0x5555e1){_0x207472=_0x207472-0x94;const _0x46aa07=a146_0x46aa();let _0x41d548=_0x46aa07[_0x207472];return _0x41d548;}import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static ['NUMERIC_ID_PATTERN']=/^\d+$/;[a146_0x259bce(0xfa)];constructor(_0x27838f){const _0x1c359f=a146_0x259bce;this[_0x1c359f(0xfa)]=new WorkflowApiClient(_0x27838f);}async[a146_0x259bce(0x99)](_0x3538bd){const _0x2d57ea=a146_0x259bce;if(WorkflowSDK['NUMERIC_ID_PATTERN'][_0x2d57ea(0xbc)](_0x3538bd)){const _0x2f05ce=await this[_0x2d57ea(0xfa)][_0x2d57ea(0xa8)](_0x3538bd);return{'id':_0x2f05ce['id'],'name':_0x2f05ce[_0x2d57ea(0xb9)]};}const _0x5a8cdc=await this['client'][_0x2d57ea(0xc5)]({'name_pattern':_0x3538bd}),_0x1fad21=_0x5a8cdc[_0x2d57ea(0x106)][_0x2d57ea(0x10b)](_0x4adc4a=>_0x4adc4a['name']===_0x3538bd);if(!_0x1fad21)throw new SDKError(ErrorCode[_0x2d57ea(0xb8)],_0x2d57ea(0xab)+_0x3538bd);return{'id':_0x1fad21['id'],'name':_0x1fad21[_0x2d57ea(0xb9)]};}async[a146_0x259bce(0xcd)](_0x39a7ec,_0x213f21){const _0xcedc30=a146_0x259bce,_0x4ac5d5=_0x213f21?.[_0xcedc30(0xeb)]||0x64,_0x194094=await paginateResults((_0x9e3360,_0x565705)=>this[_0xcedc30(0xfa)][_0xcedc30(0xc5)]({'name_pattern':_0x39a7ec,'limit':_0x9e3360,'last_id':_0x565705??_0x213f21?.[_0xcedc30(0xcf)]}),_0x4ac5d5);return _0x194094['map'](_0x52736a=>({..._0x52736a,'project_id':_0x52736a['id'],'project_name':_0x52736a['name']}));}async['workflows'](_0x1c9280,_0x3e3ea9){const _0x2a9f5c=a146_0x259bce,_0x47b792=_0x3e3ea9?.[_0x2a9f5c(0xeb)]||0x64,_0x59f7f9=await paginateResults((_0x38d20f,_0x2fc475)=>this[_0x2a9f5c(0xfa)][_0x2a9f5c(0x105)]({'project_name':_0x1c9280,'limit':_0x38d20f,'last_id':_0x2fc475??_0x3e3ea9?.[_0x2a9f5c(0xcf)]}),_0x47b792);return _0x59f7f9[_0x2a9f5c(0x10d)](_0x4efe4a=>({'project_id':_0x4efe4a[_0x2a9f5c(0x110)]?.['id'],'project_name':_0x4efe4a[_0x2a9f5c(0x110)]?.[_0x2a9f5c(0xb9)],'workflow_id':_0x4efe4a['id'],'workflow_name':_0x4efe4a[_0x2a9f5c(0xb9)],'revision':_0x4efe4a[_0x2a9f5c(0xbb)],'timezone':_0x4efe4a[_0x2a9f5c(0xc6)],'config':_0x4efe4a[_0x2a9f5c(0x98)],'id':_0x4efe4a['id'],'name':_0x4efe4a[_0x2a9f5c(0xb9)],'project':_0x4efe4a[_0x2a9f5c(0x110)]}));}async[a146_0x259bce(0xf6)](_0x1ee482){const _0x1f40ee=a146_0x259bce;let _0x362520;if(_0x1ee482?.[_0x1f40ee(0x101)]){let _0x1e30c8,_0x229895=![];while(!_0x229895){const _0x2344be=await this[_0x1f40ee(0xfa)][_0x1f40ee(0xc5)]({'limit':0x64,'last_id':_0x1e30c8}),_0x53ce39=_0x2344be['data'][_0x1f40ee(0x10b)](_0x5af730=>_0x5af730[_0x1f40ee(0xb9)]===_0x1ee482[_0x1f40ee(0x101)]);if(_0x53ce39){_0x362520=_0x53ce39['id'],_0x229895=!![];break;}if(!_0x2344be['lastId']||_0x2344be[_0x1f40ee(0x106)][_0x1f40ee(0xee)]===0x0)break;_0x1e30c8=_0x2344be[_0x1f40ee(0xd4)];}if(!_0x362520)throw new SDKError(ErrorCode[_0x1f40ee(0xb8)],_0x1f40ee(0xab)+_0x1ee482[_0x1f40ee(0x101)]);}const _0x5a94c5=_0x1ee482?.[_0x1f40ee(0xeb)]||0x64,_0x12b5c4=await paginateResults((_0x9d6015,_0x41fc1a)=>this[_0x1f40ee(0xfa)]['listSessions']({'project_id':_0x362520,'project_name':_0x1ee482?.[_0x1f40ee(0x101)],'workflow_name':_0x1ee482?.[_0x1f40ee(0xed)],'status':_0x1ee482?.[_0x1f40ee(0xa5)],'from_time':_0x1ee482?.[_0x1f40ee(0xad)],'to_time':_0x1ee482?.['toTime'],'limit':_0x9d6015,'last_id':_0x41fc1a??_0x1ee482?.[_0x1f40ee(0xcf)]}),_0x5a94c5);return _0x12b5c4['map'](_0x5b5a10=>({'project_id':_0x5b5a10['project']?.['id'],'project_name':_0x5b5a10['project']?.[_0x1f40ee(0xb9)],'workflow_id':_0x5b5a10[_0x1f40ee(0xef)]?.['id'],'workflow_name':_0x5b5a10['workflow']?.['name'],'session_id':_0x5b5a10['id'],'sessionUuid':_0x5b5a10[_0x1f40ee(0x100)],'sessionTime':_0x5b5a10[_0x1f40ee(0xdc)],'lastAttempt':_0x5b5a10[_0x1f40ee(0x113)],'id':_0x5b5a10['id'],'project':_0x5b5a10[_0x1f40ee(0x110)],'workflow':_0x5b5a10[_0x1f40ee(0xef)]}));}async[a146_0x259bce(0xd1)](_0x3ea444){const _0x16aec8=a146_0x259bce,_0x5af625=_0x3ea444?.[_0x16aec8(0xeb)]||0x64,_0x1448af=await paginateResults((_0x51488b,_0x18189d)=>this[_0x16aec8(0xfa)][_0x16aec8(0x9c)]({'project_name':_0x3ea444?.[_0x16aec8(0x101)],'workflow_name':_0x3ea444?.[_0x16aec8(0xed)],'include_retried':_0x3ea444?.[_0x16aec8(0xf3)],'limit':_0x51488b,'last_id':_0x18189d??_0x3ea444?.[_0x16aec8(0xcf)]}),_0x5af625);return _0x1448af[_0x16aec8(0x10d)](_0x57fcf1=>({'project_id':_0x57fcf1[_0x16aec8(0x110)]?.['id'],'project_name':_0x57fcf1[_0x16aec8(0x110)]?.[_0x16aec8(0xb9)],'workflow_id':_0x57fcf1[_0x16aec8(0xef)]?.['id'],'workflow_name':_0x57fcf1['workflow']?.[_0x16aec8(0xb9)],'session_id':_0x57fcf1[_0x16aec8(0xc8)],'sessionUuid':_0x57fcf1['sessionUuid'],'sessionTime':_0x57fcf1[_0x16aec8(0xdc)],'attempt_id':_0x57fcf1['id'],'attempt_index':_0x57fcf1[_0x16aec8(0xd7)],'retryAttemptName':_0x57fcf1[_0x16aec8(0xfc)],'done':_0x57fcf1[_0x16aec8(0xe3)],'success':_0x57fcf1[_0x16aec8(0xd3)],'cancelRequested':_0x57fcf1[_0x16aec8(0xc9)],'params':_0x57fcf1[_0x16aec8(0x9a)],'createdAt':_0x57fcf1[_0x16aec8(0xde)],'finishedAt':_0x57fcf1['finishedAt'],'id':_0x57fcf1['id'],'index':_0x57fcf1['index'],'project':_0x57fcf1[_0x16aec8(0x110)],'workflow':_0x57fcf1[_0x16aec8(0xef)]}));}async[a146_0x259bce(0x104)](_0x2bab47){const _0x4c1275=a146_0x259bce,_0x366d05=await this[_0x4c1275(0xfa)][_0x4c1275(0x102)](_0x2bab47);return _0x366d05;}async[a146_0x259bce(0xe5)](_0x59b1c8,_0xbd5341=![]){const _0x28303a=a146_0x259bce,_0x436169=await this['client'][_0x28303a(0x111)](_0x59b1c8,_0xbd5341);return _0x436169[_0x28303a(0x10d)](_0x14753c=>({'task_id':_0x14753c['id'],'task_name':_0x14753c[_0x28303a(0xac)],'parentId':_0x14753c[_0x28303a(0xa6)],'config':_0x14753c[_0x28303a(0x98)],'upstreams':_0x14753c[_0x28303a(0x9e)],'state':_0x14753c[_0x28303a(0xf5)],'exportParams':_0x14753c[_0x28303a(0xa4)],'storeParams':_0x14753c['storeParams'],'stateParams':_0x14753c[_0x28303a(0xd9)],'updatedAt':_0x14753c[_0x28303a(0xb1)],'retryAt':_0x14753c[_0x28303a(0x109)],'startedAt':_0x14753c[_0x28303a(0xc0)],'error':_0x14753c[_0x28303a(0xbf)],'isGroup':_0x14753c[_0x28303a(0xa3)],'id':_0x14753c['id'],'fullName':_0x14753c[_0x28303a(0xac)]}));}async[a146_0x259bce(0x112)](_0x17861b,_0x1d37f4){const _0x407343=a146_0x259bce;return await this['client'][_0x407343(0xdd)](_0x17861b,_0x1d37f4);}async[a146_0x259bce(0xc1)](_0x2fded3,_0x153c13){const _0xbfd0fd=a146_0x259bce,_0x33a0ec=await import(_0xbfd0fd(0xfe)),{promisify:_0x14e841}=await import(_0xbfd0fd(0x107)),_0x15294b=_0x14e841(_0x33a0ec[_0xbfd0fd(0xa9)]),_0x4c06eb=await this['client']['listLogFiles'](_0x2fded3,_0x153c13);if(_0x4c06eb[_0xbfd0fd(0xee)]===0x0)return'';const _0x2387c1=[];for(const _0x558178 of _0x4c06eb){if(!_0x558178[_0xbfd0fd(0xd2)])continue;const _0x2c137c=await fetch(_0x558178[_0xbfd0fd(0xd2)]);if(!_0x2c137c['ok'])throw new Error(_0xbfd0fd(0x114)+_0x2c137c[_0xbfd0fd(0xa5)]);const _0x3eb8fb=Buffer[_0xbfd0fd(0xb6)](await _0x2c137c[_0xbfd0fd(0xbd)]()),_0x53394d=await _0x15294b(_0x3eb8fb);_0x2387c1[_0xbfd0fd(0xc3)](_0x53394d[_0xbfd0fd(0xfd)](_0xbfd0fd(0x96)));}return _0x2387c1['join']('\x0a');}async[a146_0x259bce(0x10a)](_0x8c22,_0x24b1de){const _0x3992ad=a146_0x259bce,_0x238860=await this[_0x3992ad(0xfa)]['killAttempt'](_0x8c22,_0x24b1de);return _0x238860?.['message']??_0x3992ad(0xcb);}async[a146_0x259bce(0xe4)](_0x286093,_0x33c130){const _0x5e362c=a146_0x259bce,_0x1c4306=await this[_0x5e362c(0xfa)][_0x5e362c(0xe4)](_0x286093,{'from_task':_0x33c130?.[_0x5e362c(0xb7)],'retry_params':_0x33c130?.[_0x5e362c(0x94)]});return{'attemptId':_0x1c4306['id'],'sessionId':_0x1c4306[_0x5e362c(0xc8)]};}async[a146_0x259bce(0x103)](_0x5575be,_0x59d3c5){const _0x18e01a=a146_0x259bce,_0x427bcd=await this[_0x18e01a(0xfa)][_0x18e01a(0x103)](_0x5575be,{'resume_from':_0x59d3c5?.[_0x18e01a(0x9f)],'retry_params':_0x59d3c5?.[_0x18e01a(0x94)],'force':_0x59d3c5?.[_0x18e01a(0xb4)]});return{'attemptId':_0x427bcd['id'],'sessionId':_0x427bcd[_0x18e01a(0xc8)]};}async[a146_0x259bce(0xda)](_0x461ab7,_0x4d588a={},_0x182a38){const _0x40ca6a=a146_0x259bce,_0x5b11d6=_0x461ab7['indexOf']('.');let _0x3c57d7,_0x1fd675;if(_0x5b11d6===-0x1)throw new Error(_0x40ca6a(0xc2));_0x3c57d7=_0x461ab7[_0x40ca6a(0xa7)](0x0,_0x5b11d6),_0x1fd675=_0x461ab7[_0x40ca6a(0xa7)](_0x5b11d6+0x1);if(!_0x3c57d7||!_0x1fd675)throw new Error(_0x40ca6a(0x10c)+_0x461ab7+'.\x20Expected\x20\x22project.workflow\x22');const _0x1443cb=_0x182a38?.[_0x40ca6a(0xdc)]||new Date()['toISOString']();return await this[_0x40ca6a(0xfa)]['startAttempt']({'projectName':_0x3c57d7,'workflowName':_0x1fd675,'sessionTime':_0x1443cb,'params':_0x4d588a});}async['download'](_0x36df43,_0xe67231,_0x265e13){const _0x404b22=a146_0x259bce,{promises:_0x2487b9}=await import('fs'),_0x47a97a=await import(_0x404b22(0xb2)),_0xf1ae9e=await import('os'),_0x5de06e=await import('tar'),{id:_0x5a95a2,name:_0x27c2df}=await this[_0x404b22(0x99)](_0x36df43),_0x47ee77=_0xf1ae9e[_0x404b22(0xbe)](),_0x28526d=_0x47a97a[_0x404b22(0xf8)](_0x47ee77,_0x404b22(0xb5)+_0x5a95a2+'-'+Date[_0x404b22(0xba)]()+_0x404b22(0xc7));try{await this['client'][_0x404b22(0xd5)](_0x5a95a2,_0x28526d,_0x265e13?.['revision']);const _0x1da2e4=_0x47a97a[_0x404b22(0xf8)](_0xe67231,_0x27c2df);await _0x2487b9[_0x404b22(0x108)](_0x1da2e4,{'recursive':!![]}),await _0x5de06e[_0x404b22(0xe7)]({'file':_0x28526d,'cwd':_0x1da2e4,'gzip':!![]});const _0x236380=async _0x20b06a=>{const _0x20c2f3=_0x404b22;let _0x502b00=0x0;const _0x145860=await _0x2487b9[_0x20c2f3(0xca)](_0x20b06a,{'withFileTypes':!![]});for(const _0x23910a of _0x145860){const _0x2f3d58=_0x47a97a[_0x20c2f3(0xf8)](_0x20b06a,_0x23910a['name']);if(_0x23910a[_0x20c2f3(0xf7)]())_0x502b00++;else _0x23910a[_0x20c2f3(0xe6)]()&&(_0x502b00+=await _0x236380(_0x2f3d58));}return _0x502b00;},_0x22a827=await _0x236380(_0x1da2e4);return{'projectName':_0x27c2df,'revision':_0x265e13?.[_0x404b22(0xbb)]||_0x404b22(0x9d),'filesExtracted':_0x22a827};}finally{try{await _0x2487b9[_0x404b22(0xc4)](_0x28526d);}catch{}}}async['push'](_0x51a2b9,_0x3c5d3b){const _0x4ee87a=a146_0x259bce,{promises:_0x4163eb}=await import('fs'),_0x397c6c=await import('path'),_0x578ce5=await import(_0x4ee87a(0xa1)),_0x3bd787=_0x3c5d3b?.['projectName']||_0x397c6c[_0x4ee87a(0xa2)](_0x51a2b9),_0x2c6ee8=_0x3c5d3b?.[_0x4ee87a(0xbb)]||new Date()[_0x4ee87a(0xb0)]()[_0x4ee87a(0xff)](/[:.]/g,'-');try{await _0x4163eb['access'](_0x51a2b9);}catch{throw new Error(_0x4ee87a(0xd6)+_0x51a2b9);}if(!_0x3c5d3b?.[_0x4ee87a(0xdb)]){const _0x26de66=await _0x4163eb[_0x4ee87a(0xca)](_0x51a2b9),_0x311a79=_0x26de66['filter'](_0x2b43e2=>_0x2b43e2['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x311a79[_0x4ee87a(0xee)]===0x0)throw new Error(_0x4ee87a(0xe0)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20project\x20directory');for(const _0x3572bf of _0x311a79){const _0x503b9f=_0x397c6c['join'](_0x51a2b9,_0x3572bf);try{await _0x4163eb[_0x4ee87a(0xe9)](_0x503b9f);}catch{throw new Error(_0x4ee87a(0xfb)+_0x3572bf);}}}const _0x26ba15=async(_0x27cd5d,_0x2ed96c='')=>{const _0x212aa9=_0x4ee87a,_0x1d8afc=await _0x4163eb[_0x212aa9(0xca)](_0x27cd5d,{'withFileTypes':!![]}),_0x5e020a=[];for(const _0x19b654 of _0x1d8afc){const _0xf24c8d=_0x397c6c[_0x212aa9(0xf8)](_0x2ed96c,_0x19b654[_0x212aa9(0xb9)]),_0x3efa66=_0x397c6c['join'](_0x27cd5d,_0x19b654[_0x212aa9(0xb9)]);if(!shouldIncludeInArchive(_0x19b654['name']))continue;_0x19b654[_0x212aa9(0xe6)]()?_0x5e020a['push'](...await _0x26ba15(_0x3efa66,_0xf24c8d)):_0x5e020a[_0x212aa9(0xc3)](_0xf24c8d);}return _0x5e020a;},_0x4c0a90=await _0x26ba15(_0x51a2b9),_0x4aec36=await import('os'),_0x2e07c6=_0x4aec36[_0x4ee87a(0xbe)](),_0x7d5583=_0x397c6c['join'](_0x2e07c6,'tdx-workflow-push-'+Date[_0x4ee87a(0xba)]()+_0x4ee87a(0xc7));try{await _0x578ce5['create']({'file':_0x7d5583,'gzip':!![],'cwd':_0x51a2b9,'portable':!![]},_0x4c0a90);const _0x4a4a94=await this[_0x4ee87a(0xfa)][_0x4ee87a(0xb3)](_0x3bd787,_0x2c6ee8,_0x7d5583,{'scheduleFrom':_0x3c5d3b?.['scheduleFrom'],'clearSchedule':_0x3c5d3b?.[_0x4ee87a(0xdf)],'clearScheduleAll':_0x3c5d3b?.[_0x4ee87a(0xa0)]});return{'projectId':_0x4a4a94['id'],'projectName':_0x4a4a94[_0x4ee87a(0xb9)],'revision':_0x4a4a94[_0x4ee87a(0xbb)]};}finally{try{await _0x4163eb['unlink'](_0x7d5583);}catch{}}}async[a146_0x259bce(0xf4)](_0x4c4293){const _0x365b56=a146_0x259bce,{id:_0x5bf98e}=await this[_0x365b56(0x99)](_0x4c4293),_0x536c31=await this[_0x365b56(0xfa)][_0x365b56(0xaf)](_0x5bf98e);return{'projectId':_0x536c31['id'],'projectName':_0x536c31[_0x365b56(0xb9)]};}async[a146_0x259bce(0xaa)](_0x4e6b60){const _0x377a5e=a146_0x259bce,{id:_0x534bdb,name:_0x10f6cd}=await this[_0x377a5e(0x99)](_0x4e6b60),_0x2b76ab=await this[_0x377a5e(0xfa)]['listSecrets'](_0x534bdb);return{'projectName':_0x10f6cd,'secrets':_0x2b76ab};}async[a146_0x259bce(0x95)](_0x1a5c34,_0x329554,_0x5ab076){const _0x489ab2=a146_0x259bce,{id:_0x3b9bb4,name:_0x5536f1}=await this[_0x489ab2(0x99)](_0x1a5c34);return await this['client'][_0x489ab2(0x95)](_0x3b9bb4,_0x329554,_0x5ab076),{'projectName':_0x5536f1,'key':_0x329554};}async[a146_0x259bce(0xae)](_0x4ecbff,_0x301e55){const _0x3cec50=a146_0x259bce,{id:_0x333a6,name:_0x24a7b8}=await this[_0x3cec50(0x99)](_0x4ecbff);return await this[_0x3cec50(0xfa)][_0x3cec50(0xae)](_0x333a6,_0x301e55),{'projectName':_0x24a7b8,'key':_0x301e55};}async[a146_0x259bce(0xf0)](_0x1b947d,_0x1ae00e){const _0x3d7f23=a146_0x259bce;return pullWorkflow({'client':this['client'],'resolveProjectId':this[_0x3d7f23(0x99)][_0x3d7f23(0xd0)](this)},_0x1b947d,_0x1ae00e);}async[a146_0x259bce(0xe8)](_0x371945,_0x233a5d){const _0x56c8dc=a146_0x259bce;return applyPullResult({'client':this[_0x56c8dc(0xfa)],'resolveProjectId':this[_0x56c8dc(0x99)]['bind'](this)},_0x371945,_0x233a5d);}async['preparePushProject'](_0x1454bc){const _0x42e29e=a146_0x259bce;return preparePushWorkflow({'client':this[_0x42e29e(0xfa)],'resolveProjectId':this[_0x42e29e(0x99)][_0x42e29e(0xd0)](this)},_0x1454bc);}async['executePushProject'](_0x4ec090){const _0x307379=a146_0x259bce;return executePushWorkflow({'client':this['client'],'resolveProjectId':this[_0x307379(0x99)][_0x307379(0xd0)](this)},_0x4ec090);}async[a146_0x259bce(0xf1)](_0x3610e7,_0x1404c7,_0x9c9d3a){const _0x31dac3=a146_0x259bce;return prepareCloneWorkflow({'client':this[_0x31dac3(0xfa)]},_0x3610e7,_0x1404c7,_0x9c9d3a);}async[a146_0x259bce(0x9b)](_0x4addf6){const _0x540f85=a146_0x259bce;return executeCloneWorkflow({'client':this[_0x540f85(0xfa)]},_0x4addf6);}}
1
+ function a146_0x405b(_0x37f0c3,_0x3a8c51){_0x37f0c3=_0x37f0c3-0xfa;const _0x4fc90f=a146_0x4fc9();let _0x405be6=_0x4fc90f[_0x37f0c3];return _0x405be6;}const a146_0x5fec8=a146_0x405b;(function(_0xdab396,_0x33c3a0){const _0x17bf39=a146_0x405b,_0x33ef31=_0xdab396();while(!![]){try{const _0x456f45=parseInt(_0x17bf39(0x14b))/0x1+parseInt(_0x17bf39(0x15c))/0x2+-parseInt(_0x17bf39(0x137))/0x3+-parseInt(_0x17bf39(0x16f))/0x4*(-parseInt(_0x17bf39(0x12f))/0x5)+parseInt(_0x17bf39(0x13e))/0x6*(-parseInt(_0x17bf39(0x107))/0x7)+parseInt(_0x17bf39(0x136))/0x8+-parseInt(_0x17bf39(0x171))/0x9;if(_0x456f45===_0x33c3a0)break;else _0x33ef31['push'](_0x33ef31['shift']());}catch(_0x3f0a0c){_0x33ef31['push'](_0x33ef31['shift']());}}}(a146_0x4fc9,0xc804a));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';const MAX_PAGINATION_LIMIT=0x3e8;function a146_0x4fc9(){const _0x4315ee=['toISOString','startedAt','success','sessionTime','Project\x20not\x20found:\x20','push','finishedAt','fullName','parentId','cancelRequested','preparePushProject','index','lastId','isDirectory','setSecret','includeRetried','mkdir','revision','downloadProjectArchive','attempts','listSessions','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','sessionUuid','force','limit','retryAttemptName','uploadProjectArchive','client','exportParams','skipValidation','direct','deleteSecret','Cannot\x20read\x20workflow\x20file:\x20','Kill\x20request\x20accepted','tmpdir','106915FoJjeS','clearScheduleAll','logs','substring','workflow','now','retrySession','11220280beieRN','2628729itBeOM','params','data','listSecrets','retryAttempt','Failed\x20to\x20download\x20log\x20file:\x20','upstreams','94782zbPRdK','status','arrayBuffer','message','slice','getAttemptTasks','attempt','tar','tasks','download','deleteProject','delete','listAttempts','586484lRJKwy','WORKFLOW_PROJECT_NOT_FOUND','error','stateParams','startAttempt','resumeFrom','done','lastAttempt','from','listWorkflows','join','zlib','name','executePushProject','isFile','listProjects','replace','1771426NLyKSy','find','\x20workflow\x20files\x20found\x20in\x20project\x20directory','Project\x20directory\x20not\x20found:\x20','last_id','extract','killAttempt','resolveProjectId','listLogFiles','NUMERIC_ID_PATTERN','getAttempt','project','map','rawCount','kill','projectName','tdx-workflow-','applyPullProject','fromTask','20eTZoqn','access','11148651JNfNJO','latest','isGroup','filter','retryParams','sessions','workflowName','run','projects','tdx-workflow-push-','storeParams','sessionId','prepareCloneProject','bind','config','21QcJKbo','.\x20Expected\x20\x22project.workflow\x22','Invalid\x20workflow\x20format:\x20','length','No\x20'];a146_0x4fc9=function(){return _0x4315ee;};return a146_0x4fc9();}async function paginateResults(_0x4967e2,_0xaf6974,_0x5c5e91=0x64){const _0x5b3b28=a146_0x405b,_0x2542be=Math['min'](_0xaf6974,MAX_PAGINATION_LIMIT),_0x48a29a=[];let _0x2a3bf0;while(_0x48a29a['length']<_0x2542be){const _0x12ab3e=await _0x4967e2(_0x5c5e91,_0x2a3bf0),_0x4c210c=_0x12ab3e[_0x5b3b28(0x169)]??_0x12ab3e[_0x5b3b28(0x139)][_0x5b3b28(0x10a)];if(_0x4c210c===0x0)break;_0x48a29a['push'](..._0x12ab3e[_0x5b3b28(0x139)]);if(!_0x12ab3e[_0x5b3b28(0x118)]||_0x4c210c<_0x5c5e91)break;_0x2a3bf0=_0x12ab3e[_0x5b3b28(0x118)];}return _0x48a29a[_0x5b3b28(0x142)](0x0,_0x2542be);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a146_0x5fec8(0x165)]=/^\d+$/;['client'];constructor(_0x28e7eb){const _0x962df4=a146_0x5fec8;this[_0x962df4(0x127)]=new WorkflowApiClient(_0x28e7eb);}async['resolveProjectId'](_0x3913f6){const _0x2e16b6=a146_0x5fec8;if(WorkflowSDK['NUMERIC_ID_PATTERN']['test'](_0x3913f6)){const _0x53498c=await this[_0x2e16b6(0x127)]['getProject'](_0x3913f6);return{'id':_0x53498c['id'],'name':_0x53498c[_0x2e16b6(0x157)]};}const _0x2488e5=await this['client'][_0x2e16b6(0x15a)]({'name_pattern':_0x3913f6}),_0x29216c=_0x2488e5[_0x2e16b6(0x139)][_0x2e16b6(0x15d)](_0x3c46c2=>_0x3c46c2[_0x2e16b6(0x157)]===_0x3913f6);if(!_0x29216c)throw new SDKError(ErrorCode[_0x2e16b6(0x14c)],_0x2e16b6(0x110)+_0x3913f6);return{'id':_0x29216c['id'],'name':_0x29216c[_0x2e16b6(0x157)]};}async[a146_0x5fec8(0x100)](_0x457e88,_0x4e9ff2){const _0x24665f=a146_0x5fec8,_0x46cd53=_0x4e9ff2?.[_0x24665f(0x124)]||0x64,_0x506d7e=await paginateResults((_0x540a4c,_0x2fa460)=>this['client']['listProjects']({'name_pattern':_0x457e88,'limit':_0x540a4c,'last_id':_0x2fa460??_0x4e9ff2?.[_0x24665f(0x160)]}),_0x46cd53);return _0x506d7e[_0x24665f(0x168)](_0x2fc779=>({..._0x2fc779,'project_id':_0x2fc779['id'],'project_name':_0x2fc779[_0x24665f(0x157)]}));}async['workflows'](_0x41309d,_0x19f01d){const _0x47b803=a146_0x5fec8,_0x3a7fea=_0x19f01d?.[_0x47b803(0x124)]||0x64,_0x5cf79f=await paginateResults((_0x347c98,_0x44b775)=>this[_0x47b803(0x127)][_0x47b803(0x154)]({'project_name':_0x41309d,'limit':_0x347c98,'last_id':_0x44b775??_0x19f01d?.['last_id']}),_0x3a7fea);return _0x5cf79f[_0x47b803(0x168)](_0x2ac8f2=>({'project_id':_0x2ac8f2[_0x47b803(0x167)]?.['id'],'project_name':_0x2ac8f2['project']?.[_0x47b803(0x157)],'workflow_id':_0x2ac8f2['id'],'workflow_name':_0x2ac8f2[_0x47b803(0x157)],'revision':_0x2ac8f2['revision'],'timezone':_0x2ac8f2['timezone'],'config':_0x2ac8f2['config'],'id':_0x2ac8f2['id'],'name':_0x2ac8f2[_0x47b803(0x157)],'project':_0x2ac8f2[_0x47b803(0x167)]}));}async[a146_0x5fec8(0xfd)](_0x5f1702){const _0x41ca00=a146_0x5fec8;let _0xef318f;if(_0x5f1702?.[_0x41ca00(0x16b)]){let _0x592662,_0x42538e=![];while(!_0x42538e){const _0x466a7f=await this['client'][_0x41ca00(0x15a)]({'limit':0x64,'last_id':_0x592662}),_0x40bc7a=_0x466a7f[_0x41ca00(0x139)][_0x41ca00(0x15d)](_0x599209=>_0x599209[_0x41ca00(0x157)]===_0x5f1702[_0x41ca00(0x16b)]);if(_0x40bc7a){_0xef318f=_0x40bc7a['id'],_0x42538e=!![];break;}if(!_0x466a7f[_0x41ca00(0x118)]||_0x466a7f['data']['length']===0x0)break;_0x592662=_0x466a7f['lastId'];}if(!_0xef318f)throw new SDKError(ErrorCode[_0x41ca00(0x14c)],_0x41ca00(0x110)+_0x5f1702[_0x41ca00(0x16b)]);}const _0x6b2481=_0x5f1702?.[_0x41ca00(0x124)]||0x64,_0x1575ce=await paginateResults((_0x3528e2,_0x5e7824)=>this[_0x41ca00(0x127)][_0x41ca00(0x120)]({'project_id':_0xef318f,'project_name':_0x5f1702?.['projectName'],'workflow_name':_0x5f1702?.[_0x41ca00(0xfe)],'status':_0x5f1702?.['status'],'from_time':_0x5f1702?.['fromTime'],'to_time':_0x5f1702?.['toTime'],'limit':_0x3528e2,'last_id':_0x5e7824??_0x5f1702?.[_0x41ca00(0x160)]}),_0x6b2481);return _0x1575ce[_0x41ca00(0x168)](_0xf3acd0=>({'project_id':_0xf3acd0[_0x41ca00(0x167)]?.['id'],'project_name':_0xf3acd0[_0x41ca00(0x167)]?.[_0x41ca00(0x157)],'workflow_id':_0xf3acd0['workflow']?.['id'],'workflow_name':_0xf3acd0[_0x41ca00(0x133)]?.[_0x41ca00(0x157)],'session_id':_0xf3acd0['id'],'sessionUuid':_0xf3acd0[_0x41ca00(0x122)],'sessionTime':_0xf3acd0[_0x41ca00(0x10f)],'lastAttempt':_0xf3acd0[_0x41ca00(0x152)],'id':_0xf3acd0['id'],'project':_0xf3acd0[_0x41ca00(0x167)],'workflow':_0xf3acd0[_0x41ca00(0x133)]}));}async[a146_0x5fec8(0x11f)](_0x449b5b){const _0x1ab523=a146_0x5fec8,_0x50902e=_0x449b5b?.[_0x1ab523(0x124)]||0x64,_0x541ae8=await paginateResults((_0x2934f8,_0x3240d9)=>this['client'][_0x1ab523(0x14a)]({'project_name':_0x449b5b?.['projectName'],'workflow_name':_0x449b5b?.[_0x1ab523(0xfe)],'include_retried':_0x449b5b?.[_0x1ab523(0x11b)],'limit':_0x2934f8,'last_id':_0x3240d9??_0x449b5b?.[_0x1ab523(0x160)]}),_0x50902e);return _0x541ae8[_0x1ab523(0x168)](_0x4c4677=>({'project_id':_0x4c4677['project']?.['id'],'project_name':_0x4c4677[_0x1ab523(0x167)]?.['name'],'workflow_id':_0x4c4677[_0x1ab523(0x133)]?.['id'],'workflow_name':_0x4c4677[_0x1ab523(0x133)]?.[_0x1ab523(0x157)],'session_id':_0x4c4677[_0x1ab523(0x103)],'sessionUuid':_0x4c4677['sessionUuid'],'sessionTime':_0x4c4677[_0x1ab523(0x10f)],'attempt_id':_0x4c4677['id'],'attempt_index':_0x4c4677[_0x1ab523(0x117)],'retryAttemptName':_0x4c4677[_0x1ab523(0x125)],'done':_0x4c4677[_0x1ab523(0x151)],'success':_0x4c4677[_0x1ab523(0x10e)],'cancelRequested':_0x4c4677[_0x1ab523(0x115)],'params':_0x4c4677[_0x1ab523(0x138)],'createdAt':_0x4c4677['createdAt'],'finishedAt':_0x4c4677[_0x1ab523(0x112)],'id':_0x4c4677['id'],'index':_0x4c4677[_0x1ab523(0x117)],'project':_0x4c4677[_0x1ab523(0x167)],'workflow':_0x4c4677[_0x1ab523(0x133)]}));}async[a146_0x5fec8(0x144)](_0x5d8ef3){const _0x48a0a6=a146_0x5fec8,_0xea45c0=await this['client'][_0x48a0a6(0x166)](_0x5d8ef3);return _0xea45c0;}async[a146_0x5fec8(0x146)](_0x340d26,_0x3bf053=![]){const _0x421a28=a146_0x5fec8,_0x44d9ee=await this[_0x421a28(0x127)][_0x421a28(0x143)](_0x340d26,_0x3bf053);return _0x44d9ee[_0x421a28(0x168)](_0x4fc051=>({'task_id':_0x4fc051['id'],'task_name':_0x4fc051['fullName'],'parentId':_0x4fc051[_0x421a28(0x114)],'config':_0x4fc051[_0x421a28(0x106)],'upstreams':_0x4fc051[_0x421a28(0x13d)],'state':_0x4fc051['state'],'exportParams':_0x4fc051[_0x421a28(0x128)],'storeParams':_0x4fc051[_0x421a28(0x102)],'stateParams':_0x4fc051[_0x421a28(0x14e)],'updatedAt':_0x4fc051['updatedAt'],'retryAt':_0x4fc051['retryAt'],'startedAt':_0x4fc051[_0x421a28(0x10d)],'error':_0x4fc051[_0x421a28(0x14d)],'isGroup':_0x4fc051[_0x421a28(0xfa)],'id':_0x4fc051['id'],'fullName':_0x4fc051[_0x421a28(0x113)]}));}async['logFiles'](_0xd34855,_0x2632d8){const _0x57b2ce=a146_0x5fec8;return await this[_0x57b2ce(0x127)]['listLogFiles'](_0xd34855,_0x2632d8);}async[a146_0x5fec8(0x131)](_0x192970,_0x2b446a){const _0x878f16=a146_0x5fec8,_0x406507=await import(_0x878f16(0x156)),{promisify:_0x3e0a9c}=await import('util'),_0x592b2a=_0x3e0a9c(_0x406507['gunzip']),_0x312af5=await this[_0x878f16(0x127)][_0x878f16(0x164)](_0x192970,_0x2b446a);if(_0x312af5[_0x878f16(0x10a)]===0x0)return'';const _0x3f966d=[];for(const _0x261fc3 of _0x312af5){if(!_0x261fc3['direct'])continue;const _0x19b41b=await fetch(_0x261fc3[_0x878f16(0x12a)]);if(!_0x19b41b['ok'])throw new Error(_0x878f16(0x13c)+_0x19b41b[_0x878f16(0x13f)]);const _0x3e3cb0=Buffer[_0x878f16(0x153)](await _0x19b41b[_0x878f16(0x140)]()),_0x5197cf=await _0x592b2a(_0x3e3cb0);_0x3f966d[_0x878f16(0x111)](_0x5197cf['toString']('utf-8'));}return _0x3f966d[_0x878f16(0x155)]('\x0a');}async[a146_0x5fec8(0x16a)](_0x11381c,_0x29a49b){const _0x9f6b16=a146_0x5fec8,_0x33097d=await this[_0x9f6b16(0x127)][_0x9f6b16(0x162)](_0x11381c,_0x29a49b);return _0x33097d?.[_0x9f6b16(0x141)]??_0x9f6b16(0x12d);}async[a146_0x5fec8(0x135)](_0x1158d6,_0x14408c){const _0x5c4bf7=a146_0x5fec8,_0x22aac1=await this[_0x5c4bf7(0x127)][_0x5c4bf7(0x135)](_0x1158d6,{'from_task':_0x14408c?.[_0x5c4bf7(0x16e)],'retry_params':_0x14408c?.[_0x5c4bf7(0xfc)]});return{'attemptId':_0x22aac1['id'],'sessionId':_0x22aac1[_0x5c4bf7(0x103)]};}async[a146_0x5fec8(0x13b)](_0x1c8a24,_0x49e786){const _0x1960e1=a146_0x5fec8,_0x42d980=await this[_0x1960e1(0x127)]['retryAttempt'](_0x1c8a24,{'resume_from':_0x49e786?.[_0x1960e1(0x150)],'retry_params':_0x49e786?.[_0x1960e1(0xfc)],'force':_0x49e786?.[_0x1960e1(0x123)]});return{'attemptId':_0x42d980['id'],'sessionId':_0x42d980['sessionId']};}async[a146_0x5fec8(0xff)](_0x5a9388,_0x4ddb17={},_0x42d0a2){const _0x370f79=a146_0x5fec8,_0x3f3279=_0x5a9388['indexOf']('.');let _0x245bfb,_0x3000ff;if(_0x3f3279===-0x1)throw new Error(_0x370f79(0x121));_0x245bfb=_0x5a9388[_0x370f79(0x132)](0x0,_0x3f3279),_0x3000ff=_0x5a9388[_0x370f79(0x132)](_0x3f3279+0x1);if(!_0x245bfb||!_0x3000ff)throw new Error(_0x370f79(0x109)+_0x5a9388+_0x370f79(0x108));const _0x32bf3b=_0x42d0a2?.[_0x370f79(0x10f)]||new Date()[_0x370f79(0x10c)]();return await this[_0x370f79(0x127)][_0x370f79(0x14f)]({'projectName':_0x245bfb,'workflowName':_0x3000ff,'sessionTime':_0x32bf3b,'params':_0x4ddb17});}async[a146_0x5fec8(0x147)](_0x3a93a6,_0x1f7bdb,_0x1dbfe5){const _0x36a062=a146_0x5fec8,{promises:_0x358439}=await import('fs'),_0x1e7139=await import('path'),_0x366f90=await import('os'),_0x3dd684=await import(_0x36a062(0x145)),{id:_0x117fbe,name:_0x55021f}=await this[_0x36a062(0x163)](_0x3a93a6),_0x10d1f9=_0x366f90[_0x36a062(0x12e)](),_0x2f8be4=_0x1e7139[_0x36a062(0x155)](_0x10d1f9,_0x36a062(0x16c)+_0x117fbe+'-'+Date[_0x36a062(0x134)]()+'.tar.gz');try{await this[_0x36a062(0x127)][_0x36a062(0x11e)](_0x117fbe,_0x2f8be4,_0x1dbfe5?.[_0x36a062(0x11d)]);const _0x30674e=_0x1e7139['join'](_0x1f7bdb,_0x55021f);await _0x358439[_0x36a062(0x11c)](_0x30674e,{'recursive':!![]}),await _0x3dd684[_0x36a062(0x161)]({'file':_0x2f8be4,'cwd':_0x30674e,'gzip':!![]});const _0x54b57a=async _0x3057de=>{const _0x1bc2a9=_0x36a062;let _0x4dbd37=0x0;const _0x262d10=await _0x358439['readdir'](_0x3057de,{'withFileTypes':!![]});for(const _0x3f3f3f of _0x262d10){const _0x11a1f8=_0x1e7139[_0x1bc2a9(0x155)](_0x3057de,_0x3f3f3f[_0x1bc2a9(0x157)]);if(_0x3f3f3f[_0x1bc2a9(0x159)]())_0x4dbd37++;else _0x3f3f3f['isDirectory']()&&(_0x4dbd37+=await _0x54b57a(_0x11a1f8));}return _0x4dbd37;},_0x3f98b1=await _0x54b57a(_0x30674e);return{'projectName':_0x55021f,'revision':_0x1dbfe5?.[_0x36a062(0x11d)]||_0x36a062(0x172),'filesExtracted':_0x3f98b1};}finally{try{await _0x358439['unlink'](_0x2f8be4);}catch{}}}async['push'](_0x160edd,_0x5365e5){const _0x204369=a146_0x5fec8,{promises:_0x4273c5}=await import('fs'),_0x5d9b89=await import('path'),_0x2ab34f=await import('tar'),_0x4f9a80=_0x5365e5?.['projectName']||_0x5d9b89['basename'](_0x160edd),_0xb2700d=_0x5365e5?.[_0x204369(0x11d)]||new Date()[_0x204369(0x10c)]()[_0x204369(0x15b)](/[:.]/g,'-');try{await _0x4273c5[_0x204369(0x170)](_0x160edd);}catch{throw new Error(_0x204369(0x15f)+_0x160edd);}if(!_0x5365e5?.[_0x204369(0x129)]){const _0xa3aae9=await _0x4273c5['readdir'](_0x160edd),_0x2b193c=_0xa3aae9[_0x204369(0xfb)](_0x15d56b=>_0x15d56b['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x2b193c[_0x204369(0x10a)]===0x0)throw new Error(_0x204369(0x10b)+WORKFLOW_FILE_EXTENSION+_0x204369(0x15e));for(const _0x55a2b8 of _0x2b193c){const _0x1fc370=_0x5d9b89[_0x204369(0x155)](_0x160edd,_0x55a2b8);try{await _0x4273c5[_0x204369(0x170)](_0x1fc370);}catch{throw new Error(_0x204369(0x12c)+_0x55a2b8);}}}const _0x1dab8a=async(_0x183897,_0x5baec2='')=>{const _0x455124=_0x204369,_0x1ff83a=await _0x4273c5['readdir'](_0x183897,{'withFileTypes':!![]}),_0x566b34=[];for(const _0x156d73 of _0x1ff83a){const _0x721110=_0x5d9b89[_0x455124(0x155)](_0x5baec2,_0x156d73[_0x455124(0x157)]),_0x4297f0=_0x5d9b89[_0x455124(0x155)](_0x183897,_0x156d73[_0x455124(0x157)]);if(!shouldIncludeInArchive(_0x156d73['name']))continue;_0x156d73[_0x455124(0x119)]()?_0x566b34[_0x455124(0x111)](...await _0x1dab8a(_0x4297f0,_0x721110)):_0x566b34[_0x455124(0x111)](_0x721110);}return _0x566b34;},_0x17d860=await _0x1dab8a(_0x160edd),_0x2926cd=await import('os'),_0x4cbd4e=_0x2926cd[_0x204369(0x12e)](),_0x4956dc=_0x5d9b89[_0x204369(0x155)](_0x4cbd4e,_0x204369(0x101)+Date[_0x204369(0x134)]()+'.tar.gz');try{await _0x2ab34f['create']({'file':_0x4956dc,'gzip':!![],'cwd':_0x160edd,'portable':!![]},_0x17d860);const _0x5566cf=await this['client'][_0x204369(0x126)](_0x4f9a80,_0xb2700d,_0x4956dc,{'scheduleFrom':_0x5365e5?.['scheduleFrom'],'clearSchedule':_0x5365e5?.['clearSchedule'],'clearScheduleAll':_0x5365e5?.[_0x204369(0x130)]});return{'projectId':_0x5566cf['id'],'projectName':_0x5566cf['name'],'revision':_0x5566cf['revision']};}finally{try{await _0x4273c5['unlink'](_0x4956dc);}catch{}}}async[a146_0x5fec8(0x149)](_0x145c22){const _0x2daffa=a146_0x5fec8,{id:_0x57c416}=await this[_0x2daffa(0x163)](_0x145c22),_0x46d6a0=await this[_0x2daffa(0x127)][_0x2daffa(0x148)](_0x57c416);return{'projectId':_0x46d6a0['id'],'projectName':_0x46d6a0[_0x2daffa(0x157)]};}async['listSecrets'](_0x3823f6){const _0x40e628=a146_0x5fec8,{id:_0x1c663c,name:_0x33c772}=await this['resolveProjectId'](_0x3823f6),_0x1a9575=await this[_0x40e628(0x127)][_0x40e628(0x13a)](_0x1c663c);return{'projectName':_0x33c772,'secrets':_0x1a9575};}async[a146_0x5fec8(0x11a)](_0x6e74ae,_0x9e9827,_0x26f108){const _0x216fad=a146_0x5fec8,{id:_0x448767,name:_0xeddf9d}=await this[_0x216fad(0x163)](_0x6e74ae);return await this[_0x216fad(0x127)][_0x216fad(0x11a)](_0x448767,_0x9e9827,_0x26f108),{'projectName':_0xeddf9d,'key':_0x9e9827};}async[a146_0x5fec8(0x12b)](_0x374ee8,_0x60e7b){const _0x4af6aa=a146_0x5fec8,{id:_0x2b0101,name:_0x23846d}=await this[_0x4af6aa(0x163)](_0x374ee8);return await this[_0x4af6aa(0x127)][_0x4af6aa(0x12b)](_0x2b0101,_0x60e7b),{'projectName':_0x23846d,'key':_0x60e7b};}async['pullProject'](_0x31aceb,_0x49330a){const _0x324ed6=a146_0x5fec8;return pullWorkflow({'client':this['client'],'resolveProjectId':this[_0x324ed6(0x163)][_0x324ed6(0x105)](this)},_0x31aceb,_0x49330a);}async[a146_0x5fec8(0x16d)](_0x54fda7,_0x3e8070){const _0xae99ae=a146_0x5fec8;return applyPullResult({'client':this[_0xae99ae(0x127)],'resolveProjectId':this[_0xae99ae(0x163)][_0xae99ae(0x105)](this)},_0x54fda7,_0x3e8070);}async[a146_0x5fec8(0x116)](_0x4064e9){const _0x436507=a146_0x5fec8;return preparePushWorkflow({'client':this[_0x436507(0x127)],'resolveProjectId':this[_0x436507(0x163)][_0x436507(0x105)](this)},_0x4064e9);}async[a146_0x5fec8(0x158)](_0x124136){const _0x367a0f=a146_0x5fec8;return executePushWorkflow({'client':this[_0x367a0f(0x127)],'resolveProjectId':this['resolveProjectId'][_0x367a0f(0x105)](this)},_0x124136);}async[a146_0x5fec8(0x104)](_0x433573,_0x21af13,_0xfb6287){const _0x1df202=a146_0x5fec8;return prepareCloneWorkflow({'client':this[_0x1df202(0x127)]},_0x433573,_0x21af13,_0xfb6287);}async['executeCloneProject'](_0x493031){return executeCloneWorkflow({'client':this['client']},_0x493031);}}
@@ -1 +1 @@
1
- (function(_0x485c97,_0x4fab21){const _0xdcc824=a147_0x4297,_0x2775aa=_0x485c97();while(!![]){try{const _0x5ab66d=parseInt(_0xdcc824(0x1b6))/0x1*(parseInt(_0xdcc824(0x1be))/0x2)+parseInt(_0xdcc824(0x1cc))/0x3*(parseInt(_0xdcc824(0x1c9))/0x4)+-parseInt(_0xdcc824(0x1c0))/0x5+-parseInt(_0xdcc824(0x1d9))/0x6+-parseInt(_0xdcc824(0x1a9))/0x7*(-parseInt(_0xdcc824(0x1bd))/0x8)+-parseInt(_0xdcc824(0x1b5))/0x9+-parseInt(_0xdcc824(0x1ae))/0xa;if(_0x5ab66d===_0x4fab21)break;else _0x2775aa['push'](_0x2775aa['shift']());}catch(_0x3e596f){_0x2775aa['push'](_0x2775aa['shift']());}}}(a147_0x23cc,0x53ea4));import{existsSync,promises as a147_0x25822a}from'fs';import a147_0x44887c from'path';import a147_0x10aec0 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(_0x21bb5e,_0xca5470,_0x402368={}){const _0x6fb504=a147_0x4297,_0x3b3d3c=await import(_0x6fb504(0x1aa)),{client:_0x356fe0,resolveProjectId:_0x174551}=_0x21bb5e,{id:_0x219c81,name:_0x4f9922}=await _0x174551(_0xca5470),_0x2412db=_0x402368['baseDir']||process[_0x6fb504(0x1ac)](),_0x34a335=_0x402368['targetDir']||getWorkflowProjectDir(_0x4f9922,_0x2412db),_0x5e87ab=a147_0x44887c['join'](_0x34a335,_0x6fb504(0x1b2)),_0x226183=!existsSync(_0x5e87ab),_0x48c8df=await a147_0x25822a[_0x6fb504(0x1c5)](a147_0x44887c[_0x6fb504(0x1c6)](a147_0x10aec0[_0x6fb504(0x1ce)](),_0x6fb504(0x1a6))),_0x1c6c81=a147_0x44887c[_0x6fb504(0x1c6)](_0x48c8df,_0x6fb504(0x1b3)),_0x2d9fce=a147_0x44887c[_0x6fb504(0x1c6)](_0x48c8df,'extracted');try{await _0x356fe0[_0x6fb504(0x1d2)](_0x219c81,_0x1c6c81,_0x402368[_0x6fb504(0x1bc)]),await a147_0x25822a[_0x6fb504(0x1b1)](_0x2d9fce,{'recursive':!![]});try{await _0x3b3d3c['extract']({'file':_0x1c6c81,'cwd':_0x2d9fce,'gzip':!![]});}catch(_0x1ef92f){const _0x4c5268=_0x1ef92f instanceof Error?_0x1ef92f[_0x6fb504(0x1ad)]:String(_0x1ef92f);if(_0x4c5268[_0x6fb504(0x1b7)](_0x6fb504(0x1ca))||_0x4c5268[_0x6fb504(0x1b7)](_0x6fb504(0x1ba))){const _0x1d949a=await a147_0x25822a['stat'](_0x1c6c81)['catch'](()=>null),_0x8ea626=_0x1d949a?'\x20(archive\x20size:\x20'+_0x1d949a[_0x6fb504(0x1e0)]+_0x6fb504(0x1c3):'';throw new SDKError(ErrorCode[_0x6fb504(0x1b4)],_0x6fb504(0x1af)+_0x8ea626+':\x20'+_0x4c5268,_0x1ef92f,{'helpText':'The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20'+'The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.'});}throw _0x1ef92f;}const _0x527b45=await _0x356fe0[_0x6fb504(0x1d0)](_0x219c81),_0x38efcc=_0x402368[_0x6fb504(0x1bc)]||_0x527b45[_0x6fb504(0x1bc)]||_0x6fb504(0x1da),_0x3ee9fd=await calculateChanges(_0x34a335,_0x2d9fce,_0x226183),_0x4690e0={'new':_0x3ee9fd['filter'](_0xf893f2=>_0xf893f2[_0x6fb504(0x1d4)]===_0x6fb504(0x1a8))[_0x6fb504(0x1cf)],'modified':_0x3ee9fd[_0x6fb504(0x1dc)](_0x2df10f=>_0x2df10f[_0x6fb504(0x1d4)]==='modified')[_0x6fb504(0x1cf)],'deleted':_0x3ee9fd[_0x6fb504(0x1dc)](_0x39eee0=>_0x39eee0[_0x6fb504(0x1d4)]===_0x6fb504(0x1ab))[_0x6fb504(0x1cf)],'unchanged':_0x3ee9fd[_0x6fb504(0x1dc)](_0x492c04=>_0x492c04[_0x6fb504(0x1d4)]==='unchanged')[_0x6fb504(0x1cf)]};return{'projectName':_0x4f9922,'projectId':_0x219c81,'revision':_0x38efcc,'targetDir':_0x34a335,'changes':_0x3ee9fd,'summary':_0x4690e0,'hasChanges':_0x4690e0[_0x6fb504(0x1a8)]>0x0||_0x4690e0[_0x6fb504(0x1b9)]>0x0||_0x4690e0[_0x6fb504(0x1ab)]>0x0,'isNewProject':_0x226183};}finally{await a147_0x25822a['rm'](_0x48c8df,{'recursive':!![],'force':!![]});}}function a147_0x4297(_0x53fedb,_0x10b2d8){_0x53fedb=_0x53fedb-0x1a6;const _0x23cc32=a147_0x23cc();let _0x429715=_0x23cc32[_0x53fedb];return _0x429715;}function a147_0x23cc(){const _0x29563e=['isDirectory','revision','104iBlHph','6emHQnW','stat','3274085vXaNna','unchanged','changes','\x20bytes)','sort','mkdtemp','join','path','localeCompare','338992rLKcjJ','TAR_BAD_ARCHIVE','toISOString','21GBJPyq','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','tmpdir','length','getProject','isNewProject','downloadProjectArchive','push','type','add','The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.','projectName','extract','167100JojeuI','latest','utf-8','filter','name','readFile','catch','size','targetDir','tdx-wf-pull-','writeFile','new','280903AVfuKE','tar','deleted','cwd','message','1100680fOcpWj','Failed\x20to\x20extract\x20project\x20archive','tdx-wf-apply-','mkdir','tdx.json','archive.tar.gz','WORKFLOW_ARCHIVE_CORRUPTED','594396OMeOJa','29194mLnKnX','includes','\x20(archive\x20size:\x20','modified','zlib'];a147_0x23cc=function(){return _0x29563e;};return a147_0x23cc();}export async function applyPullResult(_0x2552a9,_0x2e6d94,_0x181933={}){const _0x21f871=a147_0x4297,_0x14d2b9=await import(_0x21f871(0x1aa)),{client:_0x1c42e2}=_0x2552a9,_0x3dfdb1=await a147_0x25822a[_0x21f871(0x1c5)](a147_0x44887c['join'](a147_0x10aec0[_0x21f871(0x1ce)](),_0x21f871(0x1b0))),_0xb4e0de=a147_0x44887c[_0x21f871(0x1c6)](_0x3dfdb1,_0x21f871(0x1b3));try{await _0x1c42e2[_0x21f871(0x1d2)](_0x2e6d94['projectId'],_0xb4e0de,_0x181933[_0x21f871(0x1bc)]),await a147_0x25822a[_0x21f871(0x1b1)](_0x2e6d94[_0x21f871(0x1e1)],{'recursive':!![]});for(const _0x2c565b of _0x2e6d94[_0x21f871(0x1c2)]){if(_0x2c565b[_0x21f871(0x1d4)]==='deleted'){const _0x55064f=a147_0x44887c[_0x21f871(0x1c6)](_0x2e6d94[_0x21f871(0x1e1)],_0x2c565b[_0x21f871(0x1c7)]);await a147_0x25822a['unlink'](_0x55064f)['catch'](()=>{});}}try{await _0x14d2b9[_0x21f871(0x1d8)]({'file':_0xb4e0de,'cwd':_0x2e6d94['targetDir'],'gzip':!![]});}catch(_0x39e29c){const _0x4fae1e=_0x39e29c instanceof Error?_0x39e29c['message']:String(_0x39e29c);if(_0x4fae1e['includes'](_0x21f871(0x1ca))||_0x4fae1e[_0x21f871(0x1b7)]('zlib')){const _0x4a6c09=await a147_0x25822a[_0x21f871(0x1bf)](_0xb4e0de)[_0x21f871(0x1df)](()=>null),_0x46d7f2=_0x4a6c09?_0x21f871(0x1b8)+_0x4a6c09[_0x21f871(0x1e0)]+'\x20bytes)':'';throw new SDKError(ErrorCode[_0x21f871(0x1b4)],_0x21f871(0x1af)+_0x46d7f2+':\x20'+_0x4fae1e,_0x39e29c,{'helpText':_0x21f871(0x1cd)+_0x21f871(0x1d6)});}throw _0x39e29c;}const _0x5b4626=a147_0x44887c[_0x21f871(0x1c6)](_0x2e6d94[_0x21f871(0x1e1)],_0x21f871(0x1b2));if(_0x2e6d94[_0x21f871(0x1d1)]){const _0x54398e=createWorkflowTdxConfigContent(_0x2e6d94[_0x21f871(0x1d7)],_0x2e6d94['projectId'],_0x2e6d94['revision']);await a147_0x25822a[_0x21f871(0x1a7)](_0x5b4626,_0x54398e,'utf-8');}else updateWorkflowTdxConfig(_0x5b4626,{'last_pulled_revision':_0x2e6d94[_0x21f871(0x1bc)],'last_pulled_at':new Date()[_0x21f871(0x1cb)]()});}finally{await a147_0x25822a['rm'](_0x3dfdb1,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x3c6007,_0x3648a7,_0x1f36b4){const _0x1cd630=a147_0x4297,_0x5c9307=[],_0x11d0d8=await getAllFiles(_0x3648a7),_0x2cb2b0=existsSync(_0x3c6007)?await getAllFiles(_0x3c6007):new Set();for(const _0x3cde49 of _0x11d0d8){const _0x154ff1=a147_0x44887c['join'](_0x3c6007,_0x3cde49),_0x56355a=a147_0x44887c[_0x1cd630(0x1c6)](_0x3648a7,_0x3cde49);if(_0x3cde49===_0x1cd630(0x1b2))continue;const _0x3ceb9d=await a147_0x25822a[_0x1cd630(0x1de)](_0x56355a,_0x1cd630(0x1db))['catch'](()=>null);if(_0x3ceb9d===null)continue;if(!existsSync(_0x154ff1)||_0x1f36b4)_0x5c9307[_0x1cd630(0x1d3)]({'path':_0x3cde49,'type':_0x1cd630(0x1a8),'newContent':_0x3ceb9d});else{const _0x35e192=await a147_0x25822a[_0x1cd630(0x1de)](_0x154ff1,_0x1cd630(0x1db))[_0x1cd630(0x1df)](()=>null);if(_0x35e192===null)_0x5c9307[_0x1cd630(0x1d3)]({'path':_0x3cde49,'type':_0x1cd630(0x1b9),'newContent':_0x3ceb9d});else{if(_0x35e192!==_0x3ceb9d){const _0x191aef=generateDiff(_0x35e192,_0x3ceb9d),_0x3ae772=hasChanges(_0x191aef)?formatDiffWithColors(_0x191aef):undefined;_0x5c9307[_0x1cd630(0x1d3)]({'path':_0x3cde49,'type':_0x1cd630(0x1b9),'oldContent':_0x35e192,'newContent':_0x3ceb9d,'diff':_0x3ae772});}else _0x5c9307['push']({'path':_0x3cde49,'type':_0x1cd630(0x1c1)});}}}if(!_0x1f36b4)for(const _0x2da6f0 of _0x2cb2b0){if(_0x2da6f0==='tdx.json')continue;if(!_0x11d0d8['has'](_0x2da6f0)){const _0x40ffa5=a147_0x44887c[_0x1cd630(0x1c6)](_0x3c6007,_0x2da6f0),_0x1ba8f6=await a147_0x25822a['readFile'](_0x40ffa5,'utf-8')[_0x1cd630(0x1df)](()=>undefined);_0x5c9307['push']({'path':_0x2da6f0,'type':_0x1cd630(0x1ab),'oldContent':_0x1ba8f6});}}return _0x5c9307[_0x1cd630(0x1c4)]((_0x5237ae,_0x4ff03a)=>_0x5237ae[_0x1cd630(0x1c7)][_0x1cd630(0x1c8)](_0x4ff03a[_0x1cd630(0x1c7)])),_0x5c9307;}async function getAllFiles(_0x1ce832,_0x50320c=''){const _0x2c006c=a147_0x4297,_0x5bb933=new Set();if(!existsSync(_0x1ce832))return _0x5bb933;const _0x27f9f8=await a147_0x25822a['readdir'](_0x1ce832,{'withFileTypes':!![]});for(const _0x250452 of _0x27f9f8){const _0x1b8332=_0x50320c?a147_0x44887c[_0x2c006c(0x1c6)](_0x50320c,_0x250452[_0x2c006c(0x1dd)]):_0x250452[_0x2c006c(0x1dd)];if(_0x250452[_0x2c006c(0x1bb)]()){const _0x37f54c=await getAllFiles(a147_0x44887c[_0x2c006c(0x1c6)](_0x1ce832,_0x250452['name']),_0x1b8332);for(const _0x30b5ec of _0x37f54c){_0x5bb933[_0x2c006c(0x1d5)](_0x30b5ec);}}else _0x5bb933[_0x2c006c(0x1d5)](_0x1b8332);}return _0x5bb933;}
1
+ (function(_0x2df573,_0x257e25){const _0xe14210=a147_0x2a38,_0x215bec=_0x2df573();while(!![]){try{const _0x382635=-parseInt(_0xe14210(0x82))/0x1*(-parseInt(_0xe14210(0xac))/0x2)+parseInt(_0xe14210(0x88))/0x3+parseInt(_0xe14210(0xaa))/0x4*(-parseInt(_0xe14210(0x90))/0x5)+parseInt(_0xe14210(0x96))/0x6+-parseInt(_0xe14210(0xa1))/0x7*(parseInt(_0xe14210(0xb6))/0x8)+parseInt(_0xe14210(0xb0))/0x9+parseInt(_0xe14210(0xb1))/0xa;if(_0x382635===_0x257e25)break;else _0x215bec['push'](_0x215bec['shift']());}catch(_0x5f2213){_0x215bec['push'](_0x215bec['shift']());}}}(a147_0x2387,0x629d8));import{existsSync,promises as a147_0x2590c6}from'fs';import a147_0x3c4f18 from'path';import a147_0x2365d3 from'os';function a147_0x2a38(_0x362a4f,_0x231589){_0x362a4f=_0x362a4f-0x7d;const _0x2387fd=a147_0x2387();let _0x2a380a=_0x2387fd[_0x362a4f];return _0x2a380a;}import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{getWorkflowProjectDir,createWorkflowTdxConfigContent,updateWorkflowTdxConfig}from'./tdx-config.js';import{SDKError,ErrorCode}from'../errors.js';export async function pullWorkflow(_0x77d7d3,_0x37107d,_0x4d0fe4={}){const _0x32a0e0=a147_0x2a38,_0x3d0521=await import(_0x32a0e0(0x7f)),{client:_0xff5c01,resolveProjectId:_0x2f94a4}=_0x77d7d3,{id:_0x4c3e98,name:_0x570c40}=await _0x2f94a4(_0x37107d),_0x46d854=_0x4d0fe4[_0x32a0e0(0x8d)]||process[_0x32a0e0(0x97)](),_0x1a27a2=_0x4d0fe4[_0x32a0e0(0xb4)]||getWorkflowProjectDir(_0x570c40,_0x46d854),_0x2af90d=a147_0x3c4f18[_0x32a0e0(0xae)](_0x1a27a2,_0x32a0e0(0xaf)),_0x1db2ff=!existsSync(_0x2af90d),_0x4ba638=await a147_0x2590c6[_0x32a0e0(0xad)](a147_0x3c4f18[_0x32a0e0(0xae)](a147_0x2365d3['tmpdir'](),'tdx-wf-pull-')),_0x13da47=a147_0x3c4f18[_0x32a0e0(0xae)](_0x4ba638,_0x32a0e0(0x86)),_0x361cd5=a147_0x3c4f18['join'](_0x4ba638,_0x32a0e0(0x94));try{await _0xff5c01['downloadProjectArchive'](_0x4c3e98,_0x13da47,_0x4d0fe4[_0x32a0e0(0xa3)]),await a147_0x2590c6[_0x32a0e0(0xa0)](_0x361cd5,{'recursive':!![]});try{await _0x3d0521[_0x32a0e0(0xa5)]({'file':_0x13da47,'cwd':_0x361cd5,'gzip':!![]});}catch(_0x26f5a5){const _0x3ea634=_0x26f5a5 instanceof Error?_0x26f5a5[_0x32a0e0(0x85)]:String(_0x26f5a5);if(_0x3ea634[_0x32a0e0(0xab)](_0x32a0e0(0x84))||_0x3ea634[_0x32a0e0(0xab)](_0x32a0e0(0x8e))){const _0x1c25ab=await a147_0x2590c6[_0x32a0e0(0x8a)](_0x13da47)[_0x32a0e0(0x9d)](()=>null),_0x2698fd=_0x1c25ab?_0x32a0e0(0xa8)+_0x1c25ab[_0x32a0e0(0x98)]+_0x32a0e0(0x80):'';throw new SDKError(ErrorCode[_0x32a0e0(0x9b)],'Failed\x20to\x20extract\x20project\x20archive'+_0x2698fd+':\x20'+_0x3ea634,_0x26f5a5,{'helpText':_0x32a0e0(0xb7)+'The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.'});}throw _0x26f5a5;}const _0x462669=await _0xff5c01[_0x32a0e0(0x9e)](_0x4c3e98),_0x114afd=_0x4d0fe4['revision']||_0x462669[_0x32a0e0(0xa3)]||_0x32a0e0(0x95),_0x1cb98a=await calculateChanges(_0x1a27a2,_0x361cd5,_0x1db2ff),_0xf1a3c4={'new':_0x1cb98a[_0x32a0e0(0x9f)](_0x19af4a=>_0x19af4a['type']===_0x32a0e0(0xa7))[_0x32a0e0(0xb5)],'modified':_0x1cb98a[_0x32a0e0(0x9f)](_0x303873=>_0x303873[_0x32a0e0(0x7d)]===_0x32a0e0(0xb8))[_0x32a0e0(0xb5)],'deleted':_0x1cb98a[_0x32a0e0(0x9f)](_0x22f121=>_0x22f121[_0x32a0e0(0x7d)]===_0x32a0e0(0xa6))[_0x32a0e0(0xb5)],'unchanged':_0x1cb98a['filter'](_0x1c9c9c=>_0x1c9c9c[_0x32a0e0(0x7d)]==='unchanged')[_0x32a0e0(0xb5)]};return{'projectName':_0x570c40,'projectId':_0x4c3e98,'revision':_0x114afd,'targetDir':_0x1a27a2,'changes':_0x1cb98a,'summary':_0xf1a3c4,'hasChanges':_0xf1a3c4[_0x32a0e0(0xa7)]>0x0||_0xf1a3c4[_0x32a0e0(0xb8)]>0x0||_0xf1a3c4[_0x32a0e0(0xa6)]>0x0,'isNewProject':_0x1db2ff};}finally{await a147_0x2590c6['rm'](_0x4ba638,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0x3b16b3,_0x51735d,_0x1eb9fa={}){const _0x356333=a147_0x2a38,_0x490aa5=await import('tar'),{client:_0x2fa948}=_0x3b16b3,_0xb18a83=await a147_0x2590c6[_0x356333(0xad)](a147_0x3c4f18[_0x356333(0xae)](a147_0x2365d3[_0x356333(0x91)](),_0x356333(0x83))),_0x147199=a147_0x3c4f18[_0x356333(0xae)](_0xb18a83,_0x356333(0x86));try{await _0x2fa948[_0x356333(0x92)](_0x51735d['projectId'],_0x147199,_0x1eb9fa[_0x356333(0xa3)]),await a147_0x2590c6['mkdir'](_0x51735d['targetDir'],{'recursive':!![]});for(const _0x1e8e3c of _0x51735d[_0x356333(0xa9)]){if(_0x1e8e3c[_0x356333(0x7d)]===_0x356333(0xa6)){const _0x2e9c09=a147_0x3c4f18[_0x356333(0xae)](_0x51735d['targetDir'],_0x1e8e3c['path']);await a147_0x2590c6['unlink'](_0x2e9c09)[_0x356333(0x9d)](()=>{});}}try{await _0x490aa5[_0x356333(0xa5)]({'file':_0x147199,'cwd':_0x51735d[_0x356333(0xb4)],'gzip':!![]});}catch(_0x3cf597){const _0x3b51af=_0x3cf597 instanceof Error?_0x3cf597[_0x356333(0x85)]:String(_0x3cf597);if(_0x3b51af[_0x356333(0xab)](_0x356333(0x84))||_0x3b51af[_0x356333(0xab)]('zlib')){const _0x469590=await a147_0x2590c6[_0x356333(0x8a)](_0x147199)['catch'](()=>null),_0x4a7307=_0x469590?_0x356333(0xa8)+_0x469590['size']+_0x356333(0x80):'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x356333(0xb2)+_0x4a7307+':\x20'+_0x3b51af,_0x3cf597,{'helpText':_0x356333(0xb7)+'The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.'});}throw _0x3cf597;}const _0x5dd92a=a147_0x3c4f18[_0x356333(0xae)](_0x51735d[_0x356333(0xb4)],_0x356333(0xaf));if(_0x51735d[_0x356333(0xa4)]){const _0x4335a9=createWorkflowTdxConfigContent(_0x51735d[_0x356333(0x89)],_0x51735d['projectId'],_0x51735d[_0x356333(0xa3)]);await a147_0x2590c6[_0x356333(0x9c)](_0x5dd92a,_0x4335a9,'utf-8');}else updateWorkflowTdxConfig(_0x5dd92a,{'last_pulled_revision':_0x51735d[_0x356333(0xa3)],'last_pulled_at':new Date()[_0x356333(0xa2)]()});}finally{await a147_0x2590c6['rm'](_0xb18a83,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x43265e,_0x1b70fe,_0x5b915b){const _0x4df5b3=a147_0x2a38,_0x1edafc=[],_0x52a80e=await getAllFiles(_0x1b70fe),_0x2331af=existsSync(_0x43265e)?await getAllFiles(_0x43265e):new Set();for(const _0x33e6ec of _0x52a80e){const _0x223aba=a147_0x3c4f18[_0x4df5b3(0xae)](_0x43265e,_0x33e6ec),_0x2c9d41=a147_0x3c4f18[_0x4df5b3(0xae)](_0x1b70fe,_0x33e6ec);if(_0x33e6ec===_0x4df5b3(0xaf))continue;const _0x21b977=await a147_0x2590c6[_0x4df5b3(0x99)](_0x2c9d41,_0x4df5b3(0x8c))[_0x4df5b3(0x9d)](()=>null);if(_0x21b977===null)continue;if(!existsSync(_0x223aba)||_0x5b915b)_0x1edafc[_0x4df5b3(0x8f)]({'path':_0x33e6ec,'type':_0x4df5b3(0xa7),'newContent':_0x21b977});else{const _0x3685c1=await a147_0x2590c6[_0x4df5b3(0x99)](_0x223aba,_0x4df5b3(0x8c))[_0x4df5b3(0x9d)](()=>null);if(_0x3685c1===null)_0x1edafc[_0x4df5b3(0x8f)]({'path':_0x33e6ec,'type':'modified','newContent':_0x21b977});else{if(_0x3685c1!==_0x21b977){const _0x38b34e=generateDiff(_0x3685c1,_0x21b977),_0x1e7338=hasChanges(_0x38b34e)?formatDiffWithColors(_0x38b34e):undefined;_0x1edafc[_0x4df5b3(0x8f)]({'path':_0x33e6ec,'type':'modified','oldContent':_0x3685c1,'newContent':_0x21b977,'diff':_0x1e7338});}else _0x1edafc[_0x4df5b3(0x8f)]({'path':_0x33e6ec,'type':'unchanged'});}}}if(!_0x5b915b)for(const _0x29bde4 of _0x2331af){if(_0x29bde4===_0x4df5b3(0xaf))continue;if(!_0x52a80e['has'](_0x29bde4)){const _0x24cc15=a147_0x3c4f18[_0x4df5b3(0xae)](_0x43265e,_0x29bde4),_0x5e8be6=await a147_0x2590c6['readFile'](_0x24cc15,'utf-8')[_0x4df5b3(0x9d)](()=>undefined);_0x1edafc['push']({'path':_0x29bde4,'type':'deleted','oldContent':_0x5e8be6});}}return _0x1edafc[_0x4df5b3(0x9a)]((_0x5371a4,_0x516c43)=>_0x5371a4[_0x4df5b3(0x93)][_0x4df5b3(0x8b)](_0x516c43['path'])),_0x1edafc;}async function getAllFiles(_0x335f2e,_0x5f00ad=''){const _0x353136=a147_0x2a38,_0x1cfe28=new Set();if(!existsSync(_0x335f2e))return _0x1cfe28;const _0x1b44d0=await a147_0x2590c6[_0x353136(0xb3)](_0x335f2e,{'withFileTypes':!![]});for(const _0x3dfd52 of _0x1b44d0){const _0x25fe9f=_0x5f00ad?a147_0x3c4f18[_0x353136(0xae)](_0x5f00ad,_0x3dfd52['name']):_0x3dfd52['name'];if(_0x3dfd52[_0x353136(0x81)]()){const _0x411169=await getAllFiles(a147_0x3c4f18['join'](_0x335f2e,_0x3dfd52[_0x353136(0x87)]),_0x25fe9f);for(const _0x80a120 of _0x411169){_0x1cfe28[_0x353136(0x7e)](_0x80a120);}}else _0x1cfe28[_0x353136(0x7e)](_0x25fe9f);}return _0x1cfe28;}function a147_0x2387(){const _0x58abb5=['isDirectory','3nnEklc','tdx-wf-apply-','TAR_BAD_ARCHIVE','message','archive.tar.gz','name','1215840fzrRns','projectName','stat','localeCompare','utf-8','baseDir','zlib','push','165OeaBZa','tmpdir','downloadProjectArchive','path','extracted','latest','2148378ZMBePL','cwd','size','readFile','sort','WORKFLOW_ARCHIVE_CORRUPTED','writeFile','catch','getProject','filter','mkdir','7oYbOvo','toISOString','revision','isNewProject','extract','deleted','new','\x20(archive\x20size:\x20','changes','44844sVhXHk','includes','105524WfYDKe','mkdtemp','join','tdx.json','1052316ZORXZR','2319720UIbHmL','Failed\x20to\x20extract\x20project\x20archive','readdir','targetDir','length','3973072EXmCeZ','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','modified','type','add','tar','\x20bytes)'];a147_0x2387=function(){return _0x58abb5;};return a147_0x2387();}
@@ -1 +1 @@
1
- (function(_0x146f71,_0x5d46e2){const _0x3d57d0=a148_0x630b,_0x4f1fb2=_0x146f71();while(!![]){try{const _0x52352e=-parseInt(_0x3d57d0(0x171))/0x1+parseInt(_0x3d57d0(0x180))/0x2*(-parseInt(_0x3d57d0(0x17e))/0x3)+parseInt(_0x3d57d0(0x173))/0x4+-parseInt(_0x3d57d0(0x170))/0x5+-parseInt(_0x3d57d0(0x16e))/0x6+parseInt(_0x3d57d0(0x158))/0x7+-parseInt(_0x3d57d0(0x16b))/0x8*(-parseInt(_0x3d57d0(0x177))/0x9);if(_0x52352e===_0x5d46e2)break;else _0x4f1fb2['push'](_0x4f1fb2['shift']());}catch(_0x19797a){_0x4f1fb2['push'](_0x4f1fb2['shift']());}}}(a148_0x300b,0x9d534));import{promises as a148_0x37e1f8}from'fs';import a148_0x1df766 from'path';import a148_0x13ebe4 from'os';function a148_0x630b(_0x2a71de,_0x32cd88){_0x2a71de=_0x2a71de-0x14f;const _0x300bff=a148_0x300b();let _0x630b05=_0x300bff[_0x2a71de];return _0x630b05;}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';export async function preparePushWorkflow(_0x2135bb,_0x5907a5={}){const _0x47e225=a148_0x630b,_0x4c5d29=await import(_0x47e225(0x14f)),{client:_0x49bbfd,resolveProjectId:_0x4550ae}=_0x2135bb,_0x55087d=_0x5907a5[_0x47e225(0x185)]||process[_0x47e225(0x188)](),_0x380293=findWorkflowTdxConfig(_0x55087d),{config:_0x2e2151,configDir:_0xbf5afe}=_0x380293;let _0x32339a,_0x4d82f6=_0x2e2151[_0x47e225(0x166)];try{const _0x14ecfd=await _0x4550ae(_0x2e2151[_0x47e225(0x166)]);_0x32339a=_0x14ecfd['id'],_0x4d82f6=_0x14ecfd[_0x47e225(0x182)];}catch{_0x32339a='';}const _0x278c92=_0x5907a5['revision']||new Date()[_0x47e225(0x153)]()[_0x47e225(0x165)](/[:.]/g,'-');if(!_0x5907a5[_0x47e225(0x16d)]){const _0x2daef6=await a148_0x37e1f8[_0x47e225(0x15d)](_0xbf5afe),_0x390d7a=_0x2daef6['filter'](_0x34dbe2=>_0x34dbe2[_0x47e225(0x175)](WORKFLOW_FILE_EXTENSION));if(_0x390d7a[_0x47e225(0x159)]===0x0)throw new Error(_0x47e225(0x164)+WORKFLOW_FILE_EXTENSION+_0x47e225(0x15f)+_0xbf5afe);}const _0x4b332e=await getProjectFiles(_0xbf5afe);let _0x183449;if(_0x32339a){const _0x78e6f0=await a148_0x37e1f8[_0x47e225(0x15a)](a148_0x1df766[_0x47e225(0x178)](a148_0x13ebe4['tmpdir'](),_0x47e225(0x183))),_0x4c3832=a148_0x1df766['join'](_0x78e6f0,_0x47e225(0x155)),_0x10bb07=a148_0x1df766[_0x47e225(0x178)](_0x78e6f0,_0x47e225(0x15c));try{await _0x49bbfd[_0x47e225(0x17a)](_0x32339a,_0x4c3832),await a148_0x37e1f8['mkdir'](_0x10bb07,{'recursive':!![]});try{await _0x4c5d29[_0x47e225(0x16a)]({'file':_0x4c3832,'cwd':_0x10bb07,'gzip':!![]});}catch(_0x39cd13){const _0x2219e5=_0x39cd13 instanceof Error?_0x39cd13[_0x47e225(0x150)]:String(_0x39cd13);if(_0x2219e5[_0x47e225(0x18a)]('TAR_BAD_ARCHIVE')||_0x2219e5[_0x47e225(0x18a)](_0x47e225(0x160))){const _0x1ae4f7=await a148_0x37e1f8[_0x47e225(0x189)](_0x4c3832)[_0x47e225(0x152)](()=>null),_0x3ce184=_0x1ae4f7?_0x47e225(0x179)+_0x1ae4f7[_0x47e225(0x17d)]+'\x20bytes)':'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],'Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison'+_0x3ce184+':\x20'+_0x2219e5,_0x39cd13,{'helpText':_0x47e225(0x156)});}throw _0x39cd13;}_0x183449=await calculatePushChanges(_0xbf5afe,_0x10bb07,_0x4b332e);}finally{await a148_0x37e1f8['rm'](_0x78e6f0,{'recursive':!![],'force':!![]});}}else{_0x183449=[];for(const _0x4bb1b8 of _0x4b332e){const _0x2f0935=a148_0x1df766[_0x47e225(0x178)](_0xbf5afe,_0x4bb1b8),_0x4843e0=await a148_0x37e1f8[_0x47e225(0x169)](_0x2f0935,_0x47e225(0x172))[_0x47e225(0x152)](()=>null);_0x183449[_0x47e225(0x151)]({'path':_0x4bb1b8,'type':_0x47e225(0x17f),'newContent':_0x4843e0||undefined});}}const _0x195651={'new':_0x183449['filter'](_0x4bde1e=>_0x4bde1e['type']===_0x47e225(0x17f))['length'],'modified':_0x183449[_0x47e225(0x186)](_0x483908=>_0x483908[_0x47e225(0x161)]===_0x47e225(0x17b))[_0x47e225(0x159)],'deleted':_0x183449[_0x47e225(0x186)](_0x46bffa=>_0x46bffa[_0x47e225(0x161)]===_0x47e225(0x17c))[_0x47e225(0x159)],'unchanged':_0x183449[_0x47e225(0x186)](_0x28d97c=>_0x28d97c[_0x47e225(0x161)]==='unchanged')[_0x47e225(0x159)]};return{'projectName':_0x4d82f6,'projectId':_0x32339a,'revision':_0x278c92,'sourceDir':_0xbf5afe,'changes':_0x183449,'summary':_0x195651,'hasChanges':_0x195651['new']>0x0||_0x195651[_0x47e225(0x17b)]>0x0||_0x195651[_0x47e225(0x17c)]>0x0,'configResult':_0x380293};}export async function executePushWorkflow(_0x1d9432,_0x1fc752){const _0x3efa98=a148_0x630b,_0x34befa=await import(_0x3efa98(0x14f)),{client:_0x5f0651}=_0x1d9432,_0x3d37f3=await getProjectFiles(_0x1fc752[_0x3efa98(0x185)]),_0x21180c=await a148_0x37e1f8[_0x3efa98(0x15a)](a148_0x1df766[_0x3efa98(0x178)](a148_0x13ebe4[_0x3efa98(0x181)](),_0x3efa98(0x176))),_0x590b6a=a148_0x1df766[_0x3efa98(0x178)](_0x21180c,_0x3efa98(0x155));try{await _0x34befa['create']({'file':_0x590b6a,'gzip':!![],'cwd':_0x1fc752[_0x3efa98(0x185)],'portable':!![]},_0x3d37f3);const _0x295063=await _0x5f0651[_0x3efa98(0x15b)](_0x1fc752['projectName'],_0x1fc752[_0x3efa98(0x168)],_0x590b6a);return updateWorkflowTdxConfig(_0x1fc752['configResult'][_0x3efa98(0x187)],{'workflow_project_id':_0x295063['id'],'last_pushed_revision':_0x295063[_0x3efa98(0x168)],'last_pushed_at':new Date()[_0x3efa98(0x153)]()}),{'projectId':_0x295063['id'],'projectName':_0x295063[_0x3efa98(0x182)],'revision':_0x295063[_0x3efa98(0x168)]};}finally{await a148_0x37e1f8['rm'](_0x21180c,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x467b9e,_0xb024c4=_0x467b9e,_0x147c3b='',_0x25b104=null){const _0x283429=a148_0x630b,_0x4071cb=[];if(_0x25b104===null){_0x25b104=createIgnoreInstance();const _0x4b45e8=await loadDigdagignore(_0x467b9e);_0x4b45e8&&_0x25b104[_0x283429(0x184)](_0x4b45e8);}if(_0x147c3b!==''){const _0x59286c=await loadDigdagignore(_0xb024c4);_0x59286c&&addScopedPatterns(_0x25b104,_0x59286c,_0x147c3b);}const _0x24384c=await a148_0x37e1f8[_0x283429(0x15d)](_0xb024c4,{'withFileTypes':!![]});for(const _0x5af8da of _0x24384c){const _0x813e77=_0x147c3b?a148_0x1df766[_0x283429(0x16f)][_0x283429(0x178)](_0x147c3b,_0x5af8da['name']):_0x5af8da[_0x283429(0x182)];if(_0x5af8da[_0x283429(0x182)]===_0x283429(0x16c))continue;if(_0x5af8da[_0x283429(0x182)]===_0x283429(0x163))continue;if(!shouldIncludeInArchive(_0x5af8da[_0x283429(0x182)]))continue;if(shouldIgnoreWithInstance(_0x25b104,_0x813e77,_0x5af8da[_0x283429(0x162)]()))continue;if(_0x5af8da[_0x283429(0x162)]()){const _0x4c2cf8=await getProjectFiles(_0x467b9e,a148_0x1df766['join'](_0xb024c4,_0x5af8da[_0x283429(0x182)]),_0x813e77,_0x25b104);_0x4071cb[_0x283429(0x151)](..._0x4c2cf8);}else _0x4071cb[_0x283429(0x151)](_0x813e77);}return _0x4071cb;}async function calculatePushChanges(_0x5e992d,_0x4af464,_0x98eeea){const _0x358829=a148_0x630b,_0x12c921=[],_0x1f3b3f=new Set(await getProjectFiles(_0x4af464));for(const _0x478778 of _0x98eeea){const _0x58b03c=a148_0x1df766['join'](_0x5e992d,_0x478778),_0x231056=a148_0x1df766[_0x358829(0x178)](_0x4af464,_0x478778),_0x1e6141=await a148_0x37e1f8[_0x358829(0x169)](_0x58b03c,_0x358829(0x172))[_0x358829(0x152)](()=>null);if(_0x1e6141===null)continue;if(!_0x1f3b3f[_0x358829(0x174)](_0x478778))_0x12c921[_0x358829(0x151)]({'path':_0x478778,'type':_0x358829(0x17f),'newContent':_0x1e6141});else{const _0x5b0079=await a148_0x37e1f8[_0x358829(0x169)](_0x231056,_0x358829(0x172))['catch'](()=>null);if(_0x5b0079===null)_0x12c921[_0x358829(0x151)]({'path':_0x478778,'type':_0x358829(0x17b),'newContent':_0x1e6141});else{if(_0x5b0079!==_0x1e6141){const _0xc8bd14=generateDiff(_0x5b0079,_0x1e6141),_0x3e8301=hasChanges(_0xc8bd14)?formatDiffWithColors(_0xc8bd14):undefined;_0x12c921['push']({'path':_0x478778,'type':'modified','oldContent':_0x5b0079,'newContent':_0x1e6141,'diff':_0x3e8301});}else _0x12c921[_0x358829(0x151)]({'path':_0x478778,'type':_0x358829(0x15e)});}}}for(const _0x39d2f2 of _0x1f3b3f){if(!_0x98eeea[_0x358829(0x18a)](_0x39d2f2)){const _0x3b8977=a148_0x1df766[_0x358829(0x178)](_0x4af464,_0x39d2f2),_0x481697=await a148_0x37e1f8['readFile'](_0x3b8977,'utf-8')['catch'](()=>undefined);_0x12c921[_0x358829(0x151)]({'path':_0x39d2f2,'type':_0x358829(0x17c),'oldContent':_0x481697});}}return _0x12c921[_0x358829(0x157)]((_0x1b311c,_0x4f38b5)=>_0x1b311c[_0x358829(0x167)][_0x358829(0x154)](_0x4f38b5[_0x358829(0x167)])),_0x12c921;}function a148_0x300b(){const _0x5c4629=['configPath','cwd','stat','includes','tar','message','push','catch','toISOString','localeCompare','archive.tar.gz','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','sort','8258180oHgyEH','length','mkdtemp','uploadProjectArchive','extracted','readdir','unchanged','\x20workflow\x20files\x20found\x20in\x20','zlib','type','isDirectory','.digdagignore','No\x20','replace','workflow_project','path','revision','readFile','extract','8iVkCgo','tdx.json','skipValidation','7453758DyGYYz','posix','1712215JLJQGp','454688nnTmmm','utf-8','3350536zDnlXJ','has','endsWith','tdx-wf-push-archive-','9376461ZNAmco','join','\x20(archive\x20size:\x20','downloadProjectArchive','modified','deleted','size','195ABLCuX','new','11550QvcdBd','tmpdir','name','tdx-wf-push-','add','sourceDir','filter'];a148_0x300b=function(){return _0x5c4629;};return a148_0x300b();}
1
+ function a148_0x93b9(_0x23987f,_0x3180b2){_0x23987f=_0x23987f-0x1a9;const _0x543e45=a148_0x543e();let _0x93b9e9=_0x543e45[_0x23987f];return _0x93b9e9;}(function(_0x30a014,_0x39e05e){const _0x37c67e=a148_0x93b9,_0x4c6ec0=_0x30a014();while(!![]){try{const _0x2d1d64=-parseInt(_0x37c67e(0x1b5))/0x1*(parseInt(_0x37c67e(0x1ad))/0x2)+parseInt(_0x37c67e(0x1ac))/0x3*(parseInt(_0x37c67e(0x1c3))/0x4)+parseInt(_0x37c67e(0x1c6))/0x5+-parseInt(_0x37c67e(0x1de))/0x6*(-parseInt(_0x37c67e(0x1cf))/0x7)+-parseInt(_0x37c67e(0x1b6))/0x8*(parseInt(_0x37c67e(0x1ba))/0x9)+parseInt(_0x37c67e(0x1a9))/0xa*(-parseInt(_0x37c67e(0x1e6))/0xb)+parseInt(_0x37c67e(0x1bb))/0xc;if(_0x2d1d64===_0x39e05e)break;else _0x4c6ec0['push'](_0x4c6ec0['shift']());}catch(_0x322ccb){_0x4c6ec0['push'](_0x4c6ec0['shift']());}}}(a148_0x543e,0xc2fe6));import{promises as a148_0x5bb96c}from'fs';import a148_0x268258 from'path';import a148_0xd0b9b1 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';function a148_0x543e(){const _0x55a66c=['tmpdir','name','isDirectory','has','28444LDGnFX','mkdtemp','configPath','4009515HVwhCp','sourceDir','length','zlib','\x20bytes)','skipValidation','toISOString','\x20(archive\x20size:\x20','stat','875DIgxPK','TAR_BAD_ARCHIVE','configResult','push','includes','replace','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','archive.tar.gz','size','extracted','tdx.json','modified','localeCompare','path','Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison','72378ttWgkB','catch','tar','workflow_project','join','projectName','new','type','75515rWmbUH','2290BxiMQd','mkdir','posix','102oTmQsC','3470daGVbQ','\x20workflow\x20files\x20found\x20in\x20','cwd','readdir','filter','revision','create','downloadProjectArchive','555CNYJnv','136EtmZnB','readFile','unchanged','utf-8','755478sfEeWO','26509992CCgnEj','.digdagignore','WORKFLOW_ARCHIVE_CORRUPTED','deleted'];a148_0x543e=function(){return _0x55a66c;};return a148_0x543e();}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';import{SDKError,ErrorCode}from'../errors.js';export async function preparePushWorkflow(_0x3e1921,_0x1c83a2={}){const _0x50bfef=a148_0x93b9,_0x39fdca=await import('tar'),{client:_0x23f9dc,resolveProjectId:_0x1c791d}=_0x3e1921,_0x30f5fb=_0x1c83a2[_0x50bfef(0x1c7)]||process[_0x50bfef(0x1af)](),_0x3119f0=findWorkflowTdxConfig(_0x30f5fb),{config:_0x5a3ec5,configDir:_0x82402c}=_0x3119f0;let _0x3dae36,_0xf0c2ee=_0x5a3ec5[_0x50bfef(0x1e1)];try{const _0x2ef606=await _0x1c791d(_0x5a3ec5[_0x50bfef(0x1e1)]);_0x3dae36=_0x2ef606['id'],_0xf0c2ee=_0x2ef606[_0x50bfef(0x1c0)];}catch{_0x3dae36='';}const _0x1ad2f4=_0x1c83a2[_0x50bfef(0x1b2)]||new Date()[_0x50bfef(0x1cc)]()[_0x50bfef(0x1d4)](/[:.]/g,'-');if(!_0x1c83a2[_0x50bfef(0x1cb)]){const _0x346cac=await a148_0x5bb96c['readdir'](_0x82402c),_0x56a9af=_0x346cac[_0x50bfef(0x1b1)](_0xc929d9=>_0xc929d9['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x56a9af['length']===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+_0x50bfef(0x1ae)+_0x82402c);}const _0x1cc0ed=await getProjectFiles(_0x82402c);let _0x1c368f;if(_0x3dae36){const _0xb0ccf1=await a148_0x5bb96c[_0x50bfef(0x1c4)](a148_0x268258['join'](a148_0xd0b9b1[_0x50bfef(0x1bf)](),'tdx-wf-push-')),_0x872ce2=a148_0x268258[_0x50bfef(0x1e2)](_0xb0ccf1,_0x50bfef(0x1d6)),_0x20654a=a148_0x268258[_0x50bfef(0x1e2)](_0xb0ccf1,_0x50bfef(0x1d8));try{await _0x23f9dc[_0x50bfef(0x1b4)](_0x3dae36,_0x872ce2),await a148_0x5bb96c[_0x50bfef(0x1aa)](_0x20654a,{'recursive':!![]});try{await _0x39fdca['extract']({'file':_0x872ce2,'cwd':_0x20654a,'gzip':!![]});}catch(_0x174c67){const _0x2bea09=_0x174c67 instanceof Error?_0x174c67['message']:String(_0x174c67);if(_0x2bea09['includes'](_0x50bfef(0x1d0))||_0x2bea09[_0x50bfef(0x1d3)](_0x50bfef(0x1c9))){const _0x2d4d77=await a148_0x5bb96c[_0x50bfef(0x1ce)](_0x872ce2)[_0x50bfef(0x1df)](()=>null),_0x3cdd7b=_0x2d4d77?_0x50bfef(0x1cd)+_0x2d4d77[_0x50bfef(0x1d7)]+_0x50bfef(0x1ca):'';throw new SDKError(ErrorCode[_0x50bfef(0x1bd)],_0x50bfef(0x1dd)+_0x3cdd7b+':\x20'+_0x2bea09,_0x174c67,{'helpText':_0x50bfef(0x1d5)});}throw _0x174c67;}_0x1c368f=await calculatePushChanges(_0x82402c,_0x20654a,_0x1cc0ed);}finally{await a148_0x5bb96c['rm'](_0xb0ccf1,{'recursive':!![],'force':!![]});}}else{_0x1c368f=[];for(const _0x2c170b of _0x1cc0ed){const _0x386fdb=a148_0x268258[_0x50bfef(0x1e2)](_0x82402c,_0x2c170b),_0x13ab26=await a148_0x5bb96c[_0x50bfef(0x1b7)](_0x386fdb,_0x50bfef(0x1b9))[_0x50bfef(0x1df)](()=>null);_0x1c368f[_0x50bfef(0x1d2)]({'path':_0x2c170b,'type':'new','newContent':_0x13ab26||undefined});}}const _0x4629fb={'new':_0x1c368f[_0x50bfef(0x1b1)](_0x7667c3=>_0x7667c3['type']==='new')[_0x50bfef(0x1c8)],'modified':_0x1c368f[_0x50bfef(0x1b1)](_0x2e54b3=>_0x2e54b3[_0x50bfef(0x1e5)]==='modified')[_0x50bfef(0x1c8)],'deleted':_0x1c368f['filter'](_0x2f6e88=>_0x2f6e88['type']==='deleted')[_0x50bfef(0x1c8)],'unchanged':_0x1c368f[_0x50bfef(0x1b1)](_0x1ef0e7=>_0x1ef0e7[_0x50bfef(0x1e5)]===_0x50bfef(0x1b8))[_0x50bfef(0x1c8)]};return{'projectName':_0xf0c2ee,'projectId':_0x3dae36,'revision':_0x1ad2f4,'sourceDir':_0x82402c,'changes':_0x1c368f,'summary':_0x4629fb,'hasChanges':_0x4629fb[_0x50bfef(0x1e4)]>0x0||_0x4629fb[_0x50bfef(0x1da)]>0x0||_0x4629fb['deleted']>0x0,'configResult':_0x3119f0};}export async function executePushWorkflow(_0x54240d,_0x46ff42){const _0x3bcf56=a148_0x93b9,_0x106ce2=await import(_0x3bcf56(0x1e0)),{client:_0x21e136}=_0x54240d,_0x5ea7cd=await getProjectFiles(_0x46ff42[_0x3bcf56(0x1c7)]),_0xeb2989=await a148_0x5bb96c[_0x3bcf56(0x1c4)](a148_0x268258[_0x3bcf56(0x1e2)](a148_0xd0b9b1[_0x3bcf56(0x1bf)](),'tdx-wf-push-archive-')),_0x28fa55=a148_0x268258['join'](_0xeb2989,_0x3bcf56(0x1d6));try{await _0x106ce2[_0x3bcf56(0x1b3)]({'file':_0x28fa55,'gzip':!![],'cwd':_0x46ff42[_0x3bcf56(0x1c7)],'portable':!![]},_0x5ea7cd);const _0x43f70f=await _0x21e136['uploadProjectArchive'](_0x46ff42[_0x3bcf56(0x1e3)],_0x46ff42['revision'],_0x28fa55);return updateWorkflowTdxConfig(_0x46ff42[_0x3bcf56(0x1d1)][_0x3bcf56(0x1c5)],{'workflow_project_id':_0x43f70f['id'],'last_pushed_revision':_0x43f70f[_0x3bcf56(0x1b2)],'last_pushed_at':new Date()['toISOString']()}),{'projectId':_0x43f70f['id'],'projectName':_0x43f70f[_0x3bcf56(0x1c0)],'revision':_0x43f70f['revision']};}finally{await a148_0x5bb96c['rm'](_0xeb2989,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x32d924,_0x45a336=_0x32d924,_0x105d94='',_0x2aadef=null){const _0x1d564e=a148_0x93b9,_0x471d71=[];if(_0x2aadef===null){_0x2aadef=createIgnoreInstance();const _0x11a904=await loadDigdagignore(_0x32d924);_0x11a904&&_0x2aadef['add'](_0x11a904);}if(_0x105d94!==''){const _0x106940=await loadDigdagignore(_0x45a336);_0x106940&&addScopedPatterns(_0x2aadef,_0x106940,_0x105d94);}const _0x3498dd=await a148_0x5bb96c[_0x1d564e(0x1b0)](_0x45a336,{'withFileTypes':!![]});for(const _0x27cbae of _0x3498dd){const _0x34f1e8=_0x105d94?a148_0x268258[_0x1d564e(0x1ab)][_0x1d564e(0x1e2)](_0x105d94,_0x27cbae[_0x1d564e(0x1c0)]):_0x27cbae[_0x1d564e(0x1c0)];if(_0x27cbae['name']===_0x1d564e(0x1d9))continue;if(_0x27cbae['name']===_0x1d564e(0x1bc))continue;if(!shouldIncludeInArchive(_0x27cbae[_0x1d564e(0x1c0)]))continue;if(shouldIgnoreWithInstance(_0x2aadef,_0x34f1e8,_0x27cbae[_0x1d564e(0x1c1)]()))continue;if(_0x27cbae[_0x1d564e(0x1c1)]()){const _0x16b427=await getProjectFiles(_0x32d924,a148_0x268258[_0x1d564e(0x1e2)](_0x45a336,_0x27cbae[_0x1d564e(0x1c0)]),_0x34f1e8,_0x2aadef);_0x471d71[_0x1d564e(0x1d2)](..._0x16b427);}else _0x471d71[_0x1d564e(0x1d2)](_0x34f1e8);}return _0x471d71;}async function calculatePushChanges(_0x16fa83,_0x1b57e9,_0x5049f2){const _0x1586b6=a148_0x93b9,_0x4f5ca6=[],_0x13be92=new Set(await getProjectFiles(_0x1b57e9));for(const _0x2d67d5 of _0x5049f2){const _0x4aaa75=a148_0x268258['join'](_0x16fa83,_0x2d67d5),_0x53444e=a148_0x268258[_0x1586b6(0x1e2)](_0x1b57e9,_0x2d67d5),_0x53baca=await a148_0x5bb96c[_0x1586b6(0x1b7)](_0x4aaa75,'utf-8')['catch'](()=>null);if(_0x53baca===null)continue;if(!_0x13be92[_0x1586b6(0x1c2)](_0x2d67d5))_0x4f5ca6[_0x1586b6(0x1d2)]({'path':_0x2d67d5,'type':_0x1586b6(0x1e4),'newContent':_0x53baca});else{const _0x69665a=await a148_0x5bb96c['readFile'](_0x53444e,_0x1586b6(0x1b9))['catch'](()=>null);if(_0x69665a===null)_0x4f5ca6['push']({'path':_0x2d67d5,'type':_0x1586b6(0x1da),'newContent':_0x53baca});else{if(_0x69665a!==_0x53baca){const _0x347297=generateDiff(_0x69665a,_0x53baca),_0x5ecb5c=hasChanges(_0x347297)?formatDiffWithColors(_0x347297):undefined;_0x4f5ca6[_0x1586b6(0x1d2)]({'path':_0x2d67d5,'type':'modified','oldContent':_0x69665a,'newContent':_0x53baca,'diff':_0x5ecb5c});}else _0x4f5ca6[_0x1586b6(0x1d2)]({'path':_0x2d67d5,'type':'unchanged'});}}}for(const _0x2973bb of _0x13be92){if(!_0x5049f2[_0x1586b6(0x1d3)](_0x2973bb)){const _0x5c6a4e=a148_0x268258[_0x1586b6(0x1e2)](_0x1b57e9,_0x2973bb),_0xd4a708=await a148_0x5bb96c['readFile'](_0x5c6a4e,'utf-8')[_0x1586b6(0x1df)](()=>undefined);_0x4f5ca6[_0x1586b6(0x1d2)]({'path':_0x2973bb,'type':_0x1586b6(0x1be),'oldContent':_0xd4a708});}}return _0x4f5ca6['sort']((_0x304912,_0x9c3916)=>_0x304912[_0x1586b6(0x1dc)][_0x1586b6(0x1db)](_0x9c3916[_0x1586b6(0x1dc)])),_0x4f5ca6;}
@@ -1 +1 @@
1
- const a149_0x35fc6f=a149_0x30ca;(function(_0x57e6ce,_0x2f195e){const _0x181216=a149_0x30ca,_0x316e11=_0x57e6ce();while(!![]){try{const _0x2f4097=-parseInt(_0x181216(0x186))/0x1+-parseInt(_0x181216(0x176))/0x2*(parseInt(_0x181216(0x167))/0x3)+-parseInt(_0x181216(0x185))/0x4*(-parseInt(_0x181216(0x175))/0x5)+-parseInt(_0x181216(0x168))/0x6*(-parseInt(_0x181216(0x17c))/0x7)+-parseInt(_0x181216(0x172))/0x8*(parseInt(_0x181216(0x165))/0x9)+parseInt(_0x181216(0x17f))/0xa*(parseInt(_0x181216(0x179))/0xb)+parseInt(_0x181216(0x17a))/0xc*(parseInt(_0x181216(0x166))/0xd);if(_0x2f4097===_0x2f195e)break;else _0x316e11['push'](_0x316e11['shift']());}catch(_0x8539c3){_0x316e11['push'](_0x316e11['shift']());}}}(a149_0x5c6b,0x41659));import{existsSync,readFileSync,writeFileSync}from'fs';import a149_0x2f2a8e from'path';const TDX_CONFIG_FILE=a149_0x35fc6f(0x16b),WORKFLOWS_DIR=a149_0x35fc6f(0x181);export function findWorkflowTdxConfigPath(_0x232465=process[a149_0x35fc6f(0x17d)]()){const _0x2bde87=a149_0x35fc6f;let _0x13d52c=a149_0x2f2a8e[_0x2bde87(0x16e)](_0x232465);const _0x6c15a2=a149_0x2f2a8e[_0x2bde87(0x16d)](_0x13d52c)[_0x2bde87(0x180)];while(_0x13d52c!==_0x6c15a2){const _0x583c8c=a149_0x2f2a8e[_0x2bde87(0x171)](_0x13d52c,TDX_CONFIG_FILE);if(existsSync(_0x583c8c))try{const _0x4f7d47=readFileSync(_0x583c8c,_0x2bde87(0x16c)),_0x2953b0=JSON['parse'](_0x4f7d47);if(_0x2953b0&&typeof _0x2953b0===_0x2bde87(0x170)&&_0x2bde87(0x178)in _0x2953b0)return _0x583c8c;}catch{}_0x13d52c=a149_0x2f2a8e['dirname'](_0x13d52c);}return null;}export function loadWorkflowTdxConfig(_0x535f35){const _0x2d6e7b=a149_0x35fc6f,_0x46b5b7=readFileSync(_0x535f35,'utf-8');let _0x5f4998;try{_0x5f4998=JSON[_0x2d6e7b(0x16d)](_0x46b5b7);}catch{throw new Error(_0x2d6e7b(0x174)+_0x535f35);}if(!_0x5f4998||typeof _0x5f4998!==_0x2d6e7b(0x170))throw new Error(_0x2d6e7b(0x16a));const _0x41b4c2=_0x5f4998;if(!_0x41b4c2[_0x2d6e7b(0x178)]||typeof _0x41b4c2[_0x2d6e7b(0x178)]!==_0x2d6e7b(0x182))throw new Error(_0x2d6e7b(0x169));return{'workflow_project':_0x41b4c2[_0x2d6e7b(0x178)],'workflow_project_id':typeof _0x41b4c2[_0x2d6e7b(0x17e)]===_0x2d6e7b(0x182)?_0x41b4c2[_0x2d6e7b(0x17e)]:undefined,'last_pulled_revision':typeof _0x41b4c2['last_pulled_revision']===_0x2d6e7b(0x182)?_0x41b4c2[_0x2d6e7b(0x16f)]:undefined,'last_pulled_at':typeof _0x41b4c2[_0x2d6e7b(0x173)]==='string'?_0x41b4c2[_0x2d6e7b(0x173)]:undefined,'last_pushed_revision':typeof _0x41b4c2['last_pushed_revision']===_0x2d6e7b(0x182)?_0x41b4c2['last_pushed_revision']:undefined,'last_pushed_at':typeof _0x41b4c2[_0x2d6e7b(0x183)]===_0x2d6e7b(0x182)?_0x41b4c2[_0x2d6e7b(0x183)]:undefined};}export function findWorkflowTdxConfig(_0x15c7d5=process[a149_0x35fc6f(0x17d)]()){const _0x23fa8e=a149_0x35fc6f,_0x807463=findWorkflowTdxConfigPath(_0x15c7d5);if(!_0x807463)throw new Error(_0x23fa8e(0x184));const _0x5512c2=loadWorkflowTdxConfig(_0x807463),_0x5cf17a=a149_0x2f2a8e['dirname'](_0x807463);return{'config':_0x5512c2,'configPath':_0x807463,'configDir':_0x5cf17a};}export function tryFindWorkflowTdxConfig(_0x1a8c27){try{return findWorkflowTdxConfig(_0x1a8c27);}catch{return null;}}export function getWorkflowProjectDir(_0x388f4c,_0x49e2b3=process[a149_0x35fc6f(0x17d)]()){const _0x4cfb9d=a149_0x35fc6f;return a149_0x2f2a8e[_0x4cfb9d(0x171)](_0x49e2b3,WORKFLOWS_DIR,_0x388f4c);}export function getWorkflowTdxConfigPath(_0x48f1df,_0x256fbb=process[a149_0x35fc6f(0x17d)]()){const _0x1d8c0e=a149_0x35fc6f;return a149_0x2f2a8e[_0x1d8c0e(0x171)](getWorkflowProjectDir(_0x48f1df,_0x256fbb),TDX_CONFIG_FILE);}function a149_0x30ca(_0x341d30,_0x3d34df){_0x341d30=_0x341d30-0x165;const _0x5c6b2d=a149_0x5c6b();let _0x30ca34=_0x5c6b2d[_0x341d30];return _0x30ca34;}function a149_0x5c6b(){const _0x548d4c=['Invalid\x20JSON\x20in\x20','318830mRFNwz','11992RqxOsQ','stringify','workflow_project','1111KBzxok','390864MZGcDb','toISOString','7vnqWQQ','cwd','workflow_project_id','5210ewKyMv','root','workflows','string','last_pushed_at','No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','4wpdhjh','97858ABbBUV','3843tcGFij','390hiBFSE','228WmVbJe','1367334Bslmxv','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field','Invalid\x20tdx.json:\x20expected\x20object','tdx.json','utf-8','parse','resolve','last_pulled_revision','object','join','9368YFLvoL','last_pulled_at'];a149_0x5c6b=function(){return _0x548d4c;};return a149_0x5c6b();}export function createWorkflowTdxConfigContent(_0x3cadba,_0x54ba49,_0x5c5844){const _0xf9435d=a149_0x35fc6f,_0x27306f={'workflow_project':_0x3cadba,..._0x54ba49&&{'workflow_project_id':_0x54ba49},..._0x5c5844&&{'last_pulled_revision':_0x5c5844},'last_pulled_at':new Date()[_0xf9435d(0x17b)]()};return JSON[_0xf9435d(0x177)](_0x27306f,null,0x2)+'\x0a';}export function saveWorkflowTdxConfig(_0x1927e,_0x13f754){const _0x94b50f=a149_0x35fc6f,_0xcec4b1=JSON['stringify'](_0x13f754,null,0x2)+'\x0a';writeFileSync(_0x1927e,_0xcec4b1,_0x94b50f(0x16c));}export function updateWorkflowTdxConfig(_0x60967e,_0x2afde2){const _0x17f92e=loadWorkflowTdxConfig(_0x60967e),_0x7f86c9={..._0x17f92e,..._0x2afde2};saveWorkflowTdxConfig(_0x60967e,_0x7f86c9);}
1
+ const a149_0x12720f=a149_0x2e24;(function(_0x57781e,_0x38f85c){const _0x5cf76f=a149_0x2e24,_0x19a541=_0x57781e();while(!![]){try{const _0x4857a8=-parseInt(_0x5cf76f(0xc7))/0x1+parseInt(_0x5cf76f(0xbc))/0x2*(parseInt(_0x5cf76f(0xcc))/0x3)+parseInt(_0x5cf76f(0xc5))/0x4*(-parseInt(_0x5cf76f(0xc6))/0x5)+-parseInt(_0x5cf76f(0xbf))/0x6+parseInt(_0x5cf76f(0xc1))/0x7+-parseInt(_0x5cf76f(0xcb))/0x8*(-parseInt(_0x5cf76f(0xb5))/0x9)+parseInt(_0x5cf76f(0xc2))/0xa*(parseInt(_0x5cf76f(0xb6))/0xb);if(_0x4857a8===_0x38f85c)break;else _0x19a541['push'](_0x19a541['shift']());}catch(_0x48e2f3){_0x19a541['push'](_0x19a541['shift']());}}}(a149_0x4290,0x91587));function a149_0x2e24(_0x40be53,_0x84c1fc){_0x40be53=_0x40be53-0xae;const _0x429013=a149_0x4290();let _0x2e2417=_0x429013[_0x40be53];return _0x2e2417;}import{existsSync,readFileSync,writeFileSync}from'fs';import a149_0x15015c from'path';const TDX_CONFIG_FILE=a149_0x12720f(0xb7),WORKFLOWS_DIR=a149_0x12720f(0xba);export function findWorkflowTdxConfigPath(_0x55cb92=process[a149_0x12720f(0xc8)]()){const _0x3f8664=a149_0x12720f;let _0x35a3cc=a149_0x15015c[_0x3f8664(0xaf)](_0x55cb92);const _0x2e6507=a149_0x15015c[_0x3f8664(0xbb)](_0x35a3cc)[_0x3f8664(0xca)];while(_0x35a3cc!==_0x2e6507){const _0x3c72d6=a149_0x15015c[_0x3f8664(0xc9)](_0x35a3cc,TDX_CONFIG_FILE);if(existsSync(_0x3c72d6))try{const _0x3e8d25=readFileSync(_0x3c72d6,'utf-8'),_0x3a3772=JSON[_0x3f8664(0xbb)](_0x3e8d25);if(_0x3a3772&&typeof _0x3a3772===_0x3f8664(0xb1)&&_0x3f8664(0xc4)in _0x3a3772)return _0x3c72d6;}catch{}_0x35a3cc=a149_0x15015c[_0x3f8664(0xb0)](_0x35a3cc);}return null;}export function loadWorkflowTdxConfig(_0x5dc592){const _0x3dfd81=a149_0x12720f,_0xea9601=readFileSync(_0x5dc592,'utf-8');let _0x4ea0fd;try{_0x4ea0fd=JSON[_0x3dfd81(0xbb)](_0xea9601);}catch{throw new Error(_0x3dfd81(0xc0)+_0x5dc592);}if(!_0x4ea0fd||typeof _0x4ea0fd!==_0x3dfd81(0xb1))throw new Error(_0x3dfd81(0xc3));const _0x33ddfa=_0x4ea0fd;if(!_0x33ddfa[_0x3dfd81(0xc4)]||typeof _0x33ddfa[_0x3dfd81(0xc4)]!=='string')throw new Error('Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field');return{'workflow_project':_0x33ddfa[_0x3dfd81(0xc4)],'workflow_project_id':typeof _0x33ddfa[_0x3dfd81(0xbd)]==='string'?_0x33ddfa[_0x3dfd81(0xbd)]:undefined,'last_pulled_revision':typeof _0x33ddfa['last_pulled_revision']===_0x3dfd81(0xb9)?_0x33ddfa['last_pulled_revision']:undefined,'last_pulled_at':typeof _0x33ddfa[_0x3dfd81(0xb2)]===_0x3dfd81(0xb9)?_0x33ddfa[_0x3dfd81(0xb2)]:undefined,'last_pushed_revision':typeof _0x33ddfa[_0x3dfd81(0xb8)]===_0x3dfd81(0xb9)?_0x33ddfa[_0x3dfd81(0xb8)]:undefined,'last_pushed_at':typeof _0x33ddfa[_0x3dfd81(0xbe)]===_0x3dfd81(0xb9)?_0x33ddfa[_0x3dfd81(0xbe)]:undefined};}export function findWorkflowTdxConfig(_0x4fcf75=process[a149_0x12720f(0xc8)]()){const _0x2b573e=a149_0x12720f,_0x179fbf=findWorkflowTdxConfigPath(_0x4fcf75);if(!_0x179fbf)throw new Error('No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0x1c10cf=loadWorkflowTdxConfig(_0x179fbf),_0x3f526b=a149_0x15015c[_0x2b573e(0xb0)](_0x179fbf);return{'config':_0x1c10cf,'configPath':_0x179fbf,'configDir':_0x3f526b};}export function tryFindWorkflowTdxConfig(_0xb3812b){try{return findWorkflowTdxConfig(_0xb3812b);}catch{return null;}}export function getWorkflowProjectDir(_0x310fff,_0x2a4ffd=process[a149_0x12720f(0xc8)]()){const _0x257247=a149_0x12720f;return a149_0x15015c[_0x257247(0xc9)](_0x2a4ffd,WORKFLOWS_DIR,_0x310fff);}export function getWorkflowTdxConfigPath(_0x5cb7b5,_0x3f924b=process[a149_0x12720f(0xc8)]()){const _0x27b322=a149_0x12720f;return a149_0x15015c[_0x27b322(0xc9)](getWorkflowProjectDir(_0x5cb7b5,_0x3f924b),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x5b2fe6,_0x5ca52f,_0x426f91){const _0x53fb8b=a149_0x12720f,_0x135266={'workflow_project':_0x5b2fe6,..._0x5ca52f&&{'workflow_project_id':_0x5ca52f},..._0x426f91&&{'last_pulled_revision':_0x426f91},'last_pulled_at':new Date()[_0x53fb8b(0xb3)]()};return JSON[_0x53fb8b(0xae)](_0x135266,null,0x2)+'\x0a';}function a149_0x4290(){const _0x51fa9c=['string','workflows','parse','298XWvRcm','workflow_project_id','last_pushed_at','5218098EYJwin','Invalid\x20JSON\x20in\x20','323449EMzBcr','31111570qRqTcv','Invalid\x20tdx.json:\x20expected\x20object','workflow_project','1240336KDbFfj','15sNmWxq','968721wVYbfl','cwd','join','root','451624slsKhu','1887yPXHwP','stringify','resolve','dirname','object','last_pulled_at','toISOString','utf-8','18JbxgrN','11coBnzO','tdx.json','last_pushed_revision'];a149_0x4290=function(){return _0x51fa9c;};return a149_0x4290();}export function saveWorkflowTdxConfig(_0x4e3d09,_0x3b8692){const _0x4e5d82=a149_0x12720f,_0x5b6e9f=JSON['stringify'](_0x3b8692,null,0x2)+'\x0a';writeFileSync(_0x4e3d09,_0x5b6e9f,_0x4e5d82(0xb4));}export function updateWorkflowTdxConfig(_0x592d6d,_0x1ef89f){const _0x434277=loadWorkflowTdxConfig(_0x592d6d),_0x1698c8={..._0x434277,..._0x1ef89f};saveWorkflowTdxConfig(_0x592d6d,_0x1698c8);}
@@ -1 +1 @@
1
- function a150_0x256f(_0x300f4c,_0x442a6a){_0x300f4c=_0x300f4c-0x16f;const _0x1709f8=a150_0x1709();let _0x256f8a=_0x1709f8[_0x300f4c];return _0x256f8a;}const a150_0x3d1d79=a150_0x256f;function a150_0x1709(){const _0x4ee85e=['35844790DzKekt','startsWith','.dig','3013384lXiVef','join','split','9AlZXqK','7uOqZBr','324754rwFnfi','11546704SvUTBv','ignores','Thumbs.db','10wiTKRb','ENOENT','filter','map','length','code','endsWith','replace','add','8114310YNKhFe','.digdagignore','utf-8','780463seZMzz','10459629YzZUFM','readFile','slice','trim'];a150_0x1709=function(){return _0x4ee85e;};return a150_0x1709();}(function(_0x4bb35e,_0x1a1d05){const _0x7076e3=a150_0x256f,_0x2f04b4=_0x4bb35e();while(!![]){try{const _0x5ba5b7=parseInt(_0x7076e3(0x176))/0x1+parseInt(_0x7076e3(0x183))/0x2*(parseInt(_0x7076e3(0x181))/0x3)+parseInt(_0x7076e3(0x17e))/0x4*(parseInt(_0x7076e3(0x187))/0x5)+parseInt(_0x7076e3(0x173))/0x6+parseInt(_0x7076e3(0x182))/0x7*(parseInt(_0x7076e3(0x184))/0x8)+-parseInt(_0x7076e3(0x177))/0x9+-parseInt(_0x7076e3(0x17b))/0xa;if(_0x5ba5b7===_0x1a1d05)break;else _0x2f04b4['push'](_0x2f04b4['shift']());}catch(_0x20a16c){_0x2f04b4['push'](_0x2f04b4['shift']());}}}(a150_0x1709,0xc9035));import{promises as a150_0x211e5}from'fs';import a150_0x1de3e5 from'path';import a150_0x4563ca from'ignore';export const WORKFLOW_FILE_EXTENSION=a150_0x3d1d79(0x17d);export function shouldIncludeInArchive(_0x216c28){const _0x5372d1=a150_0x3d1d79;if(_0x216c28==='.digdag')return!![];if(_0x216c28['startsWith']('.'))return![];if(_0x216c28[_0x5372d1(0x170)]('~'))return![];if(_0x216c28===_0x5372d1(0x186)||_0x216c28==='.DS_Store')return![];return!![];}export function parseDigdagignore(_0x41f4ed){const _0x168a9d=a150_0x3d1d79;return _0x41f4ed[_0x168a9d(0x180)]('\x0a')[_0x168a9d(0x18a)](_0x11c7a4=>_0x11c7a4[_0x168a9d(0x17a)]())[_0x168a9d(0x189)](_0x2b8812=>_0x2b8812[_0x168a9d(0x18b)]>0x0&&!_0x2b8812[_0x168a9d(0x17c)]('#'));}export async function loadDigdagignore(_0x210d20){const _0x13957d=a150_0x3d1d79,_0x3eb730=a150_0x1de3e5[_0x13957d(0x17f)](_0x210d20,_0x13957d(0x174));try{const _0x5732e6=await a150_0x211e5[_0x13957d(0x178)](_0x3eb730,_0x13957d(0x175));return parseDigdagignore(_0x5732e6);}catch(_0x211e5e){if(_0x211e5e[_0x13957d(0x16f)]===_0x13957d(0x188))return null;throw _0x211e5e;}}export function createIgnoreInstance(_0x228cc7){const _0x53c9f8=a150_0x3d1d79,_0x7a09d8=a150_0x4563ca();return _0x228cc7&&_0x228cc7[_0x53c9f8(0x18b)]>0x0&&_0x7a09d8[_0x53c9f8(0x172)](_0x228cc7),_0x7a09d8;}export function addScopedPatterns(_0x3ba9f0,_0x7a270d,_0xcdfedd){const _0x1f1dce=a150_0x3d1d79,_0x582c50=_0x7a270d[_0x1f1dce(0x18a)](_0xb4a198=>{const _0x1b3202=_0x1f1dce;if(_0xb4a198[_0x1b3202(0x17c)]('!')){const _0x327f8b=_0xb4a198[_0x1b3202(0x179)](0x1);if(_0x327f8b[_0x1b3202(0x17c)]('/'))return'!'+_0xcdfedd+_0x327f8b;return'!'+_0xcdfedd+'/'+_0x327f8b;}if(_0xb4a198[_0x1b3202(0x17c)]('/'))return''+_0xcdfedd+_0xb4a198;return _0xcdfedd+'/'+_0xb4a198;});return _0x3ba9f0[_0x1f1dce(0x172)](_0x582c50),_0x3ba9f0;}export function shouldIgnoreWithInstance(_0x79ba49,_0x26f611,_0x59b57b){const _0x37ccde=a150_0x3d1d79,_0x4a6742=_0x26f611[_0x37ccde(0x171)](/\\/g,'/'),_0x22fc61=_0x59b57b?_0x4a6742+'/':_0x4a6742;return _0x79ba49[_0x37ccde(0x185)](_0x22fc61);}
1
+ const a150_0x2fef97=a150_0x905f;(function(_0x580670,_0x310368){const _0x4573f3=a150_0x905f,_0x538b4f=_0x580670();while(!![]){try{const _0x31af76=-parseInt(_0x4573f3(0xfe))/0x1+parseInt(_0x4573f3(0xf1))/0x2*(parseInt(_0x4573f3(0xed))/0x3)+-parseInt(_0x4573f3(0xe9))/0x4+-parseInt(_0x4573f3(0xf3))/0x5*(parseInt(_0x4573f3(0xea))/0x6)+parseInt(_0x4573f3(0xec))/0x7+-parseInt(_0x4573f3(0xf7))/0x8+parseInt(_0x4573f3(0xff))/0x9;if(_0x31af76===_0x310368)break;else _0x538b4f['push'](_0x538b4f['shift']());}catch(_0x3aa46d){_0x538b4f['push'](_0x538b4f['shift']());}}}(a150_0x46aa,0xe3537));import{promises as a150_0x52060d}from'fs';function a150_0x46aa(){const _0x44d805=['join','.dig','277642ZNViUe','slice','90GtNezc','ENOENT','add','.digdagignore','9719336OLhyUK','Thumbs.db','split','length','.DS_Store','ignores','code','513203CQpLsL','30441924VtNYaO','endsWith','replace','startsWith','filter','map','3282576YMBQEA','611370WzoPYi','readFile','12549208pxvzCC','3KIOsWA','.digdag'];a150_0x46aa=function(){return _0x44d805;};return a150_0x46aa();}import a150_0xd5ad0a from'path';function a150_0x905f(_0x5ed896,_0x558c04){_0x5ed896=_0x5ed896-0xe4;const _0x46aa2a=a150_0x46aa();let _0x905f6c=_0x46aa2a[_0x5ed896];return _0x905f6c;}import a150_0x225c60 from'ignore';export const WORKFLOW_FILE_EXTENSION=a150_0x2fef97(0xf0);export function shouldIncludeInArchive(_0x1128d6){const _0x5f321e=a150_0x2fef97;if(_0x1128d6===_0x5f321e(0xee))return!![];if(_0x1128d6['startsWith']('.'))return![];if(_0x1128d6[_0x5f321e(0xe4)]('~'))return![];if(_0x1128d6===_0x5f321e(0xf8)||_0x1128d6===_0x5f321e(0xfb))return![];return!![];}export function parseDigdagignore(_0x3cf231){const _0x40456e=a150_0x2fef97;return _0x3cf231[_0x40456e(0xf9)]('\x0a')[_0x40456e(0xe8)](_0x11df7c=>_0x11df7c['trim']())[_0x40456e(0xe7)](_0x31091c=>_0x31091c['length']>0x0&&!_0x31091c[_0x40456e(0xe6)]('#'));}export async function loadDigdagignore(_0x182029){const _0x3378bf=a150_0x2fef97,_0x4d15c0=a150_0xd5ad0a[_0x3378bf(0xef)](_0x182029,_0x3378bf(0xf6));try{const _0x96dbc0=await a150_0x52060d[_0x3378bf(0xeb)](_0x4d15c0,'utf-8');return parseDigdagignore(_0x96dbc0);}catch(_0x55932a){if(_0x55932a[_0x3378bf(0xfd)]===_0x3378bf(0xf4))return null;throw _0x55932a;}}export function createIgnoreInstance(_0x77a28b){const _0x565770=a150_0x2fef97,_0x21f345=a150_0x225c60();return _0x77a28b&&_0x77a28b[_0x565770(0xfa)]>0x0&&_0x21f345[_0x565770(0xf5)](_0x77a28b),_0x21f345;}export function addScopedPatterns(_0x2ab85b,_0x41ec3f,_0x511915){const _0x4ddb57=a150_0x2fef97,_0x35b51e=_0x41ec3f[_0x4ddb57(0xe8)](_0x1d01ed=>{const _0x26c78f=_0x4ddb57;if(_0x1d01ed['startsWith']('!')){const _0xdc7d2a=_0x1d01ed[_0x26c78f(0xf2)](0x1);if(_0xdc7d2a['startsWith']('/'))return'!'+_0x511915+_0xdc7d2a;return'!'+_0x511915+'/'+_0xdc7d2a;}if(_0x1d01ed[_0x26c78f(0xe6)]('/'))return''+_0x511915+_0x1d01ed;return _0x511915+'/'+_0x1d01ed;});return _0x2ab85b[_0x4ddb57(0xf5)](_0x35b51e),_0x2ab85b;}export function shouldIgnoreWithInstance(_0x2bc836,_0x844f21,_0xb5a1b6){const _0x527432=a150_0x2fef97,_0x2e8196=_0x844f21[_0x527432(0xe5)](/\\/g,'/'),_0x3f5278=_0xb5a1b6?_0x2e8196+'/':_0x2e8196;return _0x2bc836[_0x527432(0xfc)](_0x3f5278);}
@@ -1 +1 @@
1
- const a151_0x3cdb0b=a151_0x5a51;function a151_0x20fa(){const _0x5dd6a1=['map','setup','982266uqNMgc','verify','warn','test-api-key-id/test-api-key-secret','10756idfJXb','1115IOHiKw','runSequence','teardown','log','ERROR','fetch','6594420pTQShE','1082CDYFYF','28716809OPlmMe','join','args','push','14DYZjrx','423855MlWwKH','options','http','72UfoQsc','run','originalFetch','us01','error','4122vSdGYF','666086yTufKq','createFetch'];a151_0x20fa=function(){return _0x5dd6a1;};return a151_0x20fa();}(function(_0xe9d387,_0x39249f){const _0x46d3da=a151_0x5a51,_0x4bff67=_0xe9d387();while(!![]){try{const _0x3dbe29=-parseInt(_0x46d3da(0x12a))/0x1+-parseInt(_0x46d3da(0x13a))/0x2*(parseInt(_0x46d3da(0x129))/0x3)+-parseInt(_0x46d3da(0x132))/0x4*(-parseInt(_0x46d3da(0x133))/0x5)+parseInt(_0x46d3da(0x12e))/0x6*(-parseInt(_0x46d3da(0x13f))/0x7)+-parseInt(_0x46d3da(0x143))/0x8*(parseInt(_0x46d3da(0x140))/0x9)+-parseInt(_0x46d3da(0x139))/0xa+parseInt(_0x46d3da(0x13b))/0xb;if(_0x3dbe29===_0x39249f)break;else _0x4bff67['push'](_0x4bff67['shift']());}catch(_0x4063ce){_0x4bff67['push'](_0x4bff67['shift']());}}}(a151_0x20fa,0x5f3ef));import{TDX,LogLevel}from'../sdk/index.js';import{createHTTPMock}from'./http-mock.js';function a151_0x5a51(_0x31735f,_0x3e1e87){_0x31735f=_0x31735f-0x125;const _0x20fa6d=a151_0x20fa();let _0x5a51f7=_0x20fa6d[_0x31735f];return _0x5a51f7;}import{createTestGlobalOptions}from'./factories.js';export class CommandRunner{[a151_0x3cdb0b(0x142)];[a151_0x3cdb0b(0x126)];constructor(){const _0xf14f85=a151_0x3cdb0b;this[_0xf14f85(0x142)]=createHTTPMock(),this['originalFetch']=global['fetch'];}[a151_0x3cdb0b(0x12d)](){const _0x55fa6e=a151_0x3cdb0b;this[_0x55fa6e(0x126)]=global['fetch'],global[_0x55fa6e(0x138)]=this[_0x55fa6e(0x142)][_0x55fa6e(0x12b)]();}[a151_0x3cdb0b(0x135)](_0x3f9c83){const _0x47c78c=a151_0x3cdb0b;try{_0x3f9c83?.['fail']&&this[_0x47c78c(0x142)][_0x47c78c(0x12f)](_0x3f9c83);}finally{global['fetch']=this[_0x47c78c(0x126)],this[_0x47c78c(0x142)]['reset']();}}async[a151_0x3cdb0b(0x125)](_0x5a1be6,_0x4699b1={}){const _0x1b9596=a151_0x3cdb0b,_0x2eca8e=[],_0x1bc58e=[],_0x488e1c=console[_0x1b9596(0x136)],_0x31926f=console[_0x1b9596(0x128)],_0x21717d=console[_0x1b9596(0x130)];console[_0x1b9596(0x136)]=(..._0x262ddc)=>{const _0x187864=_0x1b9596;_0x2eca8e['push'](_0x262ddc[_0x187864(0x12c)](String)[_0x187864(0x13c)]('\x20'));},console[_0x1b9596(0x128)]=(..._0x131ae1)=>{const _0x2d37af=_0x1b9596;_0x1bc58e[_0x2d37af(0x13e)](_0x131ae1[_0x2d37af(0x12c)](String)[_0x2d37af(0x13c)]('\x20'));},console[_0x1b9596(0x130)]=(..._0x32e75f)=>{const _0x1c438c=_0x1b9596;_0x1bc58e[_0x1c438c(0x13e)](_0x32e75f[_0x1c438c(0x12c)](String)['join']('\x20'));};try{const _0x41d1ac=new TDX({'site':_0x4699b1[_0x1b9596(0x141)]?.['site']??_0x1b9596(0x127),'apiKey':_0x1b9596(0x131),'logLevel':LogLevel[_0x1b9596(0x137)]}),_0xfc657c={'options':createTestGlobalOptions(_0x4699b1['options']),'args':_0x4699b1[_0x1b9596(0x13d)]??[],'tdx':_0x41d1ac},_0x4f1120=new _0x5a1be6(),_0x1a873d=await _0x4f1120[_0x1b9596(0x125)](_0xfc657c);return{'exitCode':_0x1a873d,'stdout':_0x2eca8e,'stderr':_0x1bc58e};}finally{console[_0x1b9596(0x136)]=_0x488e1c,console[_0x1b9596(0x128)]=_0x31926f,console['warn']=_0x21717d;}}async[a151_0x3cdb0b(0x134)](_0x575673){const _0x2200cb=a151_0x3cdb0b,_0x412202=[];for(const {command:_0x48ae42,options:_0x2edd37}of _0x575673){const _0x440899=await this[_0x2200cb(0x125)](_0x48ae42,_0x2edd37);_0x412202['push'](_0x440899);if(_0x440899['exitCode']!==0x0)break;}return _0x412202;}}export function createCommandRunner(){return new CommandRunner();}
1
+ const a151_0x5baedb=a151_0xf970;(function(_0x15cb37,_0x451d68){const _0x471f0a=a151_0xf970,_0xff7fda=_0x15cb37();while(!![]){try{const _0x13495e=parseInt(_0x471f0a(0xfb))/0x1+parseInt(_0x471f0a(0x105))/0x2*(parseInt(_0x471f0a(0x100))/0x3)+parseInt(_0x471f0a(0xeb))/0x4*(parseInt(_0x471f0a(0xf5))/0x5)+parseInt(_0x471f0a(0xf3))/0x6+parseInt(_0x471f0a(0xec))/0x7+-parseInt(_0x471f0a(0xfe))/0x8*(-parseInt(_0x471f0a(0xee))/0x9)+-parseInt(_0x471f0a(0xea))/0xa;if(_0x13495e===_0x451d68)break;else _0xff7fda['push'](_0xff7fda['shift']());}catch(_0x5d0d8c){_0xff7fda['push'](_0xff7fda['shift']());}}}(a151_0x285e,0xbd9df));import{TDX,LogLevel}from'../sdk/index.js';import{createHTTPMock}from'./http-mock.js';function a151_0xf970(_0x28c91d,_0x5af1b4){_0x28c91d=_0x28c91d-0xe8;const _0x285e4f=a151_0x285e();let _0xf970fb=_0x285e4f[_0x28c91d];return _0xf970fb;}import{createTestGlobalOptions}from'./factories.js';export class CommandRunner{['http'];[a151_0x5baedb(0xed)];constructor(){const _0x33c208=a151_0x5baedb;this[_0x33c208(0xe9)]=createHTTPMock(),this[_0x33c208(0xed)]=global[_0x33c208(0xff)];}['setup'](){const _0x576e38=a151_0x5baedb;this[_0x576e38(0xed)]=global[_0x576e38(0xff)],global['fetch']=this[_0x576e38(0xe9)][_0x576e38(0xfd)]();}['teardown'](_0x319729){const _0x2d6b80=a151_0x5baedb;try{_0x319729?.['fail']&&this[_0x2d6b80(0xe9)][_0x2d6b80(0xf4)](_0x319729);}finally{global['fetch']=this[_0x2d6b80(0xed)],this['http'][_0x2d6b80(0xf2)]();}}async['run'](_0x128c0a,_0x3d8fe4={}){const _0xa390c0=a151_0x5baedb,_0x33b614=[],_0x59be76=[],_0x177d91=console['log'],_0x58d29a=console[_0xa390c0(0xfa)],_0x1b13a9=console['warn'];console[_0xa390c0(0xf7)]=(..._0x54bc5e)=>{const _0x11680d=_0xa390c0;_0x33b614[_0x11680d(0xf8)](_0x54bc5e['map'](String)[_0x11680d(0xf6)]('\x20'));},console[_0xa390c0(0xfa)]=(..._0x5445be)=>{const _0x2b4261=_0xa390c0;_0x59be76['push'](_0x5445be[_0x2b4261(0xf1)](String)[_0x2b4261(0xf6)]('\x20'));},console[_0xa390c0(0x104)]=(..._0x5b8ebb)=>{const _0x1cb4d4=_0xa390c0;_0x59be76[_0x1cb4d4(0xf8)](_0x5b8ebb[_0x1cb4d4(0xf1)](String)[_0x1cb4d4(0xf6)]('\x20'));};try{const _0x2c7275=new TDX({'site':_0x3d8fe4[_0xa390c0(0xfc)]?.[_0xa390c0(0xef)]??'us01','apiKey':_0xa390c0(0x101),'logLevel':LogLevel[_0xa390c0(0x103)]}),_0x9456b6={'options':createTestGlobalOptions(_0x3d8fe4[_0xa390c0(0xfc)]),'args':_0x3d8fe4[_0xa390c0(0x102)]??[],'tdx':_0x2c7275},_0x289a01=new _0x128c0a(),_0x16a2cc=await _0x289a01[_0xa390c0(0xe8)](_0x9456b6);return{'exitCode':_0x16a2cc,'stdout':_0x33b614,'stderr':_0x59be76};}finally{console[_0xa390c0(0xf7)]=_0x177d91,console['error']=_0x58d29a,console[_0xa390c0(0x104)]=_0x1b13a9;}}async[a151_0x5baedb(0xf0)](_0x2a7e77){const _0x4feff4=a151_0x5baedb,_0x23e90e=[];for(const {command:_0x7b1538,options:_0x4ea9ca}of _0x2a7e77){const _0x7d1353=await this[_0x4feff4(0xe8)](_0x7b1538,_0x4ea9ca);_0x23e90e[_0x4feff4(0xf8)](_0x7d1353);if(_0x7d1353[_0x4feff4(0xf9)]!==0x0)break;}return _0x23e90e;}}export function createCommandRunner(){return new CommandRunner();}function a151_0x285e(){const _0x3ebe43=['log','push','exitCode','error','1420713QpkqNi','options','createFetch','36136trhZRr','fetch','4102674xfUKjh','test-api-key-id/test-api-key-secret','args','ERROR','warn','2ZOtBRM','run','http','44000940phpxZQ','279988ZkSCbL','1013789TRGkFQ','originalFetch','171BDfOxF','site','runSequence','map','reset','4967406eBIfRq','verify','95NeBJPR','join'];a151_0x285e=function(){return _0x3ebe43;};return a151_0x285e();}
@@ -1 +1 @@
1
- (function(_0x4c89f2,_0x5b563d){const _0x4dacff=a152_0x487b,_0x18f2d7=_0x4c89f2();while(!![]){try{const _0x37435b=-parseInt(_0x4dacff(0xbb))/0x1+-parseInt(_0x4dacff(0xd3))/0x2*(parseInt(_0x4dacff(0xd5))/0x3)+-parseInt(_0x4dacff(0xcd))/0x4+parseInt(_0x4dacff(0xc1))/0x5*(parseInt(_0x4dacff(0xc4))/0x6)+parseInt(_0x4dacff(0xc7))/0x7*(parseInt(_0x4dacff(0xcb))/0x8)+parseInt(_0x4dacff(0xd2))/0x9+parseInt(_0x4dacff(0xc5))/0xa*(parseInt(_0x4dacff(0xbd))/0xb);if(_0x37435b===_0x5b563d)break;else _0x18f2d7['push'](_0x18f2d7['shift']());}catch(_0x16c24a){_0x18f2d7['push'](_0x18f2d7['shift']());}}}(a152_0x1700,0x8fca9));import{vi}from'vitest';import{join}from'path';import{Logger,LogLevel,FileHandler}from'../utils/logger/index.js';function a152_0x1700(){const _0x311406=['segment','error','70488bmvtgA','4LDpSRl','query','659064fOasGW','log','tdx','test-api-key','user','logs','args','804174Vgrltb','test-api-key-id/test-api-key-secret','572mrlPuS','tdx-test.log','warn','api','5lKAflm','options','us01','5776614ZemeGB','245620HlReBI','ERROR','119QNkurN','push','30000','workflow','261880dOBbxk','DEBUG','3887204gTnONd','join','map'];a152_0x1700=function(){return _0x311406;};return a152_0x1700();}import{getGlobalCacheDir}from'../utils/global-cache.js';export function createTestSDKContext(_0x224712){const _0x92cf33=a152_0x487b;return{'site':_0x92cf33(0xc3),'apiKey':_0x92cf33(0xbc),'logLevel':LogLevel[_0x92cf33(0xc6)],..._0x224712};}export function createTestGlobalOptions(_0x35d724){const _0x16ba4c=a152_0x487b;return{'site':'us01','format':'table','noColor':!![],'limit':0x64,'verbose':![],'timeout':_0x16ba4c(0xc9),'dryRun':![],'yes':![],'logLevel':LogLevel[_0x16ba4c(0xc6)],..._0x35d724};}export async function initTestLogger(){const _0x4a4877=a152_0x487b;Logger['reset']();const _0x5209ad=join(getGlobalCacheDir(),_0x4a4877(0xb9),_0x4a4877(0xbe));await Logger['init']({'defaultLevel':LogLevel[_0x4a4877(0xcc)],'handlers':[new FileHandler({'filePath':_0x5209ad,'rotate':![]})]});}export function resetTestLogger(){Logger['reset']();}export function createMockTDX(_0x211bdc){const _0xff4cbc=a152_0x487b;return{'context':{'site':_0xff4cbc(0xc3),'apiKey':_0xff4cbc(0xb7),'logLevel':LogLevel[_0xff4cbc(0xc6)]},'query':{'execute':vi['fn'](),'listDatabases':vi['fn'](),'listTables':vi['fn'](),'describeTable':vi['fn'](),'showTable':vi['fn'](),..._0x211bdc?.[_0xff4cbc(0xd4)]},'segment':{'listParents':vi['fn'](),'getParent':vi['fn'](),'list':vi['fn'](),'get':vi['fn'](),'create':vi['fn'](),'update':vi['fn'](),'delete':vi['fn'](),..._0x211bdc?.[_0xff4cbc(0xd0)]},'journey':{'list':vi['fn'](),'get':vi['fn'](),'create':vi['fn'](),'update':vi['fn'](),'delete':vi['fn'](),..._0x211bdc?.['journey']},'workflow':{'list':vi['fn'](),'get':vi['fn'](),'run':vi['fn'](),..._0x211bdc?.[_0xff4cbc(0xca)]},'user':{'show':vi['fn'](),..._0x211bdc?.[_0xff4cbc(0xb8)]},'api':{'request':vi['fn'](),..._0x211bdc?.[_0xff4cbc(0xc0)]},..._0x211bdc};}function a152_0x487b(_0x395d3f,_0x353b49){_0x395d3f=_0x395d3f-0xb7;const _0x170086=a152_0x1700();let _0x487bef=_0x170086[_0x395d3f];return _0x487bef;}export function createTestCommandContext(_0x14a50e){const _0xddfb76=a152_0x487b,_0x187c14=createTestGlobalOptions(_0x14a50e?.[_0xddfb76(0xc2)]),_0x14e3fd=_0x14a50e?.[_0xddfb76(0xd7)]??createMockTDX();return{'options':_0x187c14,'args':_0x14a50e?.[_0xddfb76(0xba)]??[],'tdx':_0x14e3fd};}export function captureConsole(){const _0x40547c=a152_0x487b,_0x49e41a=[],_0x1d8cac=[],_0x159b99=console[_0x40547c(0xd6)],_0x58060a=console[_0x40547c(0xd1)],_0x3468be=console['warn'];return console['log']=(..._0x337b44)=>{const _0x160634=_0x40547c;_0x49e41a[_0x160634(0xc8)](_0x337b44[_0x160634(0xcf)](String)[_0x160634(0xce)]('\x20'));},console['error']=(..._0x476fc1)=>{const _0x44315e=_0x40547c;_0x1d8cac[_0x44315e(0xc8)](_0x476fc1[_0x44315e(0xcf)](String)[_0x44315e(0xce)]('\x20'));},console[_0x40547c(0xbf)]=(..._0x143c6a)=>{const _0x27f57a=_0x40547c;_0x1d8cac[_0x27f57a(0xc8)](_0x143c6a[_0x27f57a(0xcf)](String)[_0x27f57a(0xce)]('\x20'));},{'stdout':_0x49e41a,'stderr':_0x1d8cac,'restore':()=>{const _0x370f07=_0x40547c;console[_0x370f07(0xd6)]=_0x159b99,console[_0x370f07(0xd1)]=_0x58060a,console[_0x370f07(0xbf)]=_0x3468be;}};}
1
+ (function(_0xdfcf5e,_0xb5ed42){const _0x3c8697=a152_0x3896,_0x398454=_0xdfcf5e();while(!![]){try{const _0x3e8606=-parseInt(_0x3c8697(0xf1))/0x1*(-parseInt(_0x3c8697(0xff))/0x2)+-parseInt(_0x3c8697(0xf0))/0x3+-parseInt(_0x3c8697(0xed))/0x4+parseInt(_0x3c8697(0xfe))/0x5+parseInt(_0x3c8697(0xf7))/0x6*(parseInt(_0x3c8697(0xf8))/0x7)+-parseInt(_0x3c8697(0xfb))/0x8*(parseInt(_0x3c8697(0xfa))/0x9)+parseInt(_0x3c8697(0xf3))/0xa*(parseInt(_0x3c8697(0xfc))/0xb);if(_0x3e8606===_0xb5ed42)break;else _0x398454['push'](_0x398454['shift']());}catch(_0x4928ad){_0x398454['push'](_0x398454['shift']());}}}(a152_0x4aaa,0x546a9));import{vi}from'vitest';import{join}from'path';import{Logger,LogLevel,FileHandler}from'../utils/logger/index.js';function a152_0x4aaa(){const _0x228334=['reset','tdx','us01','log','226348mCxhZv','init','workflow','1288389poguKh','29DkFMfk','args','30znuVVo','api','logs','map','204MOYvJT','38297MHWUsd','DEBUG','1031463IEtGLQ','32ZgsGvy','2588234xefZzR','tdx-test.log','1093190RIehBs','12394NdNPYK','error','ERROR','test-api-key','warn','30000','join','segment','table','query','push'];a152_0x4aaa=function(){return _0x228334;};return a152_0x4aaa();}import{getGlobalCacheDir}from'../utils/global-cache.js';export function createTestSDKContext(_0x1d2d90){const _0x40d4d5=a152_0x3896;return{'site':'us01','apiKey':'test-api-key-id/test-api-key-secret','logLevel':LogLevel[_0x40d4d5(0x101)],..._0x1d2d90};}export function createTestGlobalOptions(_0x21f32c){const _0xd19616=a152_0x3896;return{'site':_0xd19616(0x10c),'format':_0xd19616(0x107),'noColor':!![],'limit':0x64,'verbose':![],'timeout':_0xd19616(0x104),'dryRun':![],'yes':![],'logLevel':LogLevel[_0xd19616(0x101)],..._0x21f32c};}export async function initTestLogger(){const _0x45175e=a152_0x3896;Logger[_0x45175e(0x10a)]();const _0x37205b=join(getGlobalCacheDir(),_0x45175e(0xf5),_0x45175e(0xfd));await Logger[_0x45175e(0xee)]({'defaultLevel':LogLevel[_0x45175e(0xf9)],'handlers':[new FileHandler({'filePath':_0x37205b,'rotate':![]})]});}export function resetTestLogger(){const _0x5ca16e=a152_0x3896;Logger[_0x5ca16e(0x10a)]();}export function createMockTDX(_0x8c565d){const _0x3feba3=a152_0x3896;return{'context':{'site':'us01','apiKey':_0x3feba3(0x102),'logLevel':LogLevel[_0x3feba3(0x101)]},'query':{'execute':vi['fn'](),'listDatabases':vi['fn'](),'listTables':vi['fn'](),'describeTable':vi['fn'](),'showTable':vi['fn'](),..._0x8c565d?.[_0x3feba3(0x108)]},'segment':{'listParents':vi['fn'](),'getParent':vi['fn'](),'list':vi['fn'](),'get':vi['fn'](),'create':vi['fn'](),'update':vi['fn'](),'delete':vi['fn'](),..._0x8c565d?.[_0x3feba3(0x106)]},'journey':{'list':vi['fn'](),'get':vi['fn'](),'create':vi['fn'](),'update':vi['fn'](),'delete':vi['fn'](),..._0x8c565d?.['journey']},'workflow':{'list':vi['fn'](),'get':vi['fn'](),'run':vi['fn'](),..._0x8c565d?.[_0x3feba3(0xef)]},'user':{'show':vi['fn'](),..._0x8c565d?.['user']},'api':{'request':vi['fn'](),..._0x8c565d?.[_0x3feba3(0xf4)]},..._0x8c565d};}function a152_0x3896(_0x539b75,_0x1acb08){_0x539b75=_0x539b75-0xed;const _0x4aaad2=a152_0x4aaa();let _0x3896c0=_0x4aaad2[_0x539b75];return _0x3896c0;}export function createTestCommandContext(_0x2eb920){const _0x4105ae=a152_0x3896,_0x1355ec=createTestGlobalOptions(_0x2eb920?.['options']),_0x58de3b=_0x2eb920?.[_0x4105ae(0x10b)]??createMockTDX();return{'options':_0x1355ec,'args':_0x2eb920?.[_0x4105ae(0xf2)]??[],'tdx':_0x58de3b};}export function captureConsole(){const _0x50b4ab=a152_0x3896,_0x37923d=[],_0x42c17f=[],_0x244bdf=console[_0x50b4ab(0x10d)],_0x39d085=console[_0x50b4ab(0x100)],_0x1cf133=console[_0x50b4ab(0x103)];return console['log']=(..._0x745e88)=>{const _0x2c688a=_0x50b4ab;_0x37923d[_0x2c688a(0x109)](_0x745e88[_0x2c688a(0xf6)](String)[_0x2c688a(0x105)]('\x20'));},console[_0x50b4ab(0x100)]=(..._0x2ece3a)=>{const _0x4c3f4f=_0x50b4ab;_0x42c17f['push'](_0x2ece3a['map'](String)[_0x4c3f4f(0x105)]('\x20'));},console['warn']=(..._0x3dccc8)=>{const _0x25d668=_0x50b4ab;_0x42c17f[_0x25d668(0x109)](_0x3dccc8['map'](String)['join']('\x20'));},{'stdout':_0x37923d,'stderr':_0x42c17f,'restore':()=>{const _0x37e8c2=_0x50b4ab;console['log']=_0x244bdf,console[_0x37e8c2(0x100)]=_0x39d085,console['warn']=_0x1cf133;}};}