@treasuredata/tdx 2026.3.27 → 2026.3.28

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 (222) 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/auth-login-command.js +1 -1
  13. package/dist/commands/chat-command.js +1 -1
  14. package/dist/commands/claude-command.js +1 -1
  15. package/dist/commands/claude-statusline-command.js +1 -1
  16. package/dist/commands/claude-usage-command.js +1 -1
  17. package/dist/commands/command.js +1 -1
  18. package/dist/commands/connection-command.js +1 -1
  19. package/dist/commands/databases.js +1 -1
  20. package/dist/commands/delivery-command.js +1 -1
  21. package/dist/commands/describe.js +1 -1
  22. package/dist/commands/engage-campaign-pull-command.js +1 -1
  23. package/dist/commands/engage-campaign-push-command.js +1 -1
  24. package/dist/commands/engage-campaign-validate-command.js +1 -1
  25. package/dist/commands/engage-command.js +1 -1
  26. package/dist/commands/engage-template-pull-command.js +1 -1
  27. package/dist/commands/engage-template-push-command.js +1 -1
  28. package/dist/commands/engage-template-validate-command.js +1 -1
  29. package/dist/commands/job-command.js +1 -1
  30. package/dist/commands/journey-command.js +1 -1
  31. package/dist/commands/journey-validate-command.js +1 -1
  32. package/dist/commands/llm-command.js +1 -1
  33. package/dist/commands/mcp-command.js +1 -1
  34. package/dist/commands/parent-segment-command.d.ts +141 -2
  35. package/dist/commands/parent-segment-command.d.ts.map +1 -1
  36. package/dist/commands/parent-segment-command.js +1 -1
  37. package/dist/commands/parent-segment-command.js.map +1 -1
  38. package/dist/commands/policy-command.js +1 -1
  39. package/dist/commands/profile-command.js +1 -1
  40. package/dist/commands/profiles-command.js +1 -1
  41. package/dist/commands/query-command.js +1 -1
  42. package/dist/commands/schedule-command.js +1 -1
  43. package/dist/commands/segment-command.js +1 -1
  44. package/dist/commands/segment-create-command.js +1 -1
  45. package/dist/commands/segment-fields-command.js +1 -1
  46. package/dist/commands/segment-pull-command.js +1 -1
  47. package/dist/commands/segment-push-command.js +1 -1
  48. package/dist/commands/segment-update-command.js +1 -1
  49. package/dist/commands/segment-use-command.js +1 -1
  50. package/dist/commands/segment-validate-command.js +1 -1
  51. package/dist/commands/segments.js +1 -1
  52. package/dist/commands/show.js +1 -1
  53. package/dist/commands/status-command.js +1 -1
  54. package/dist/commands/tables.js +1 -1
  55. package/dist/commands/unset-command.js +1 -1
  56. package/dist/commands/upgrade-command.js +1 -1
  57. package/dist/commands/use-command.js +1 -1
  58. package/dist/commands/user-command.js +1 -1
  59. package/dist/commands/workflow-command.js +1 -1
  60. package/dist/core/auth.js +1 -1
  61. package/dist/core/command-output.js +1 -1
  62. package/dist/core/config.js +1 -1
  63. package/dist/core/connection-cache.js +1 -1
  64. package/dist/core/constants.js +1 -1
  65. package/dist/core/credential-cache.js +1 -1
  66. package/dist/core/global-context.js +1 -1
  67. package/dist/core/keychain.js +1 -1
  68. package/dist/core/oauth-keychain.js +1 -1
  69. package/dist/core/oauth.js +1 -1
  70. package/dist/core/profile.js +1 -1
  71. package/dist/core/project-config.js +1 -1
  72. package/dist/core/session.js +1 -1
  73. package/dist/core/user-cache.js +1 -1
  74. package/dist/core/version.js +1 -1
  75. package/dist/index.js +1 -1
  76. package/dist/mcp/server.js +1 -1
  77. package/dist/mcp/tools/index.js +1 -1
  78. package/dist/mcp/tools/tdx-run.js +1 -1
  79. package/dist/mcp/tools/tdx-search.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/client/cdp-api-client.d.ts +29 -1
  95. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  96. package/dist/sdk/client/cdp-api-client.js +1 -1
  97. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  98. package/dist/sdk/client/delivery-api-client.js +1 -1
  99. package/dist/sdk/client/endpoints.js +1 -1
  100. package/dist/sdk/client/engage-api-client.js +1 -1
  101. package/dist/sdk/client/http-client.js +1 -1
  102. package/dist/sdk/client/llm-api-client.js +1 -1
  103. package/dist/sdk/client/oauth-refresh.js +1 -1
  104. package/dist/sdk/client/rate-limiter.js +1 -1
  105. package/dist/sdk/client/td-api-client.js +1 -1
  106. package/dist/sdk/client/trino-api-client.js +1 -1
  107. package/dist/sdk/client/workflow-client.js +1 -1
  108. package/dist/sdk/connection-validator.js +1 -1
  109. package/dist/sdk/connection.js +1 -1
  110. package/dist/sdk/delivery.js +1 -1
  111. package/dist/sdk/engage/campaign-pull.js +1 -1
  112. package/dist/sdk/engage/campaign-push.js +1 -1
  113. package/dist/sdk/engage/campaign-validator.js +1 -1
  114. package/dist/sdk/engage/campaign-yaml.js +1 -1
  115. package/dist/sdk/engage/template-pull.js +1 -1
  116. package/dist/sdk/engage/template-push.js +1 -1
  117. package/dist/sdk/engage/template-validator.js +1 -1
  118. package/dist/sdk/engage/template-yaml.js +1 -1
  119. package/dist/sdk/engage/types/campaign-def.js +1 -1
  120. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  121. package/dist/sdk/engage/types/template-schema.js +1 -1
  122. package/dist/sdk/engage.js +1 -1
  123. package/dist/sdk/errors.js +1 -1
  124. package/dist/sdk/index.js +1 -1
  125. package/dist/sdk/io/index.js +1 -1
  126. package/dist/sdk/io/node-filesystem.js +1 -1
  127. package/dist/sdk/job.js +1 -1
  128. package/dist/sdk/journey.js +1 -1
  129. package/dist/sdk/llm/chat-cache.js +1 -1
  130. package/dist/sdk/llm/index.js +1 -1
  131. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  132. package/dist/sdk/llm/model-factors.js +1 -1
  133. package/dist/sdk/personalization.d.ts +228 -0
  134. package/dist/sdk/personalization.d.ts.map +1 -1
  135. package/dist/sdk/personalization.js +1 -1
  136. package/dist/sdk/personalization.js.map +1 -1
  137. package/dist/sdk/policy.js +1 -1
  138. package/dist/sdk/query/index.js +1 -1
  139. package/dist/sdk/query/sql-parser.js +1 -1
  140. package/dist/sdk/realtime.d.ts +57 -0
  141. package/dist/sdk/realtime.d.ts.map +1 -1
  142. package/dist/sdk/realtime.js +1 -1
  143. package/dist/sdk/realtime.js.map +1 -1
  144. package/dist/sdk/schedule.js +1 -1
  145. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  146. package/dist/sdk/segment/fields-display.js +1 -1
  147. package/dist/sdk/segment/file-discovery.js +1 -1
  148. package/dist/sdk/segment/journey-utils.js +1 -1
  149. package/dist/sdk/segment/journey-validator.js +1 -1
  150. package/dist/sdk/segment/journey-yaml.js +1 -1
  151. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  152. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  153. package/dist/sdk/segment/pull-workflow.js +1 -1
  154. package/dist/sdk/segment/push-recovery.js +1 -1
  155. package/dist/sdk/segment/push-workflow.js +1 -1
  156. package/dist/sdk/segment/resolution-context.js +1 -1
  157. package/dist/sdk/segment/segment-path-parser.js +1 -1
  158. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  159. package/dist/sdk/segment/segment-validator.js +1 -1
  160. package/dist/sdk/segment/target-resolution.js +1 -1
  161. package/dist/sdk/segment/tdx-config.js +1 -1
  162. package/dist/sdk/segment/types/activation-schema.js +1 -1
  163. package/dist/sdk/segment/types/journey-def.js +1 -1
  164. package/dist/sdk/segment/types/journey-schema.js +1 -1
  165. package/dist/sdk/segment/types/segment-def.js +1 -1
  166. package/dist/sdk/segment/types/segment-schema.js +1 -1
  167. package/dist/sdk/segment/validate-files.js +1 -1
  168. package/dist/sdk/segment/yaml-validator.js +1 -1
  169. package/dist/sdk/segment.js +1 -1
  170. package/dist/sdk/types/cdp.d.ts +76 -0
  171. package/dist/sdk/types/cdp.d.ts.map +1 -1
  172. package/dist/sdk/types/index.d.ts +1 -1
  173. package/dist/sdk/types/index.d.ts.map +1 -1
  174. package/dist/sdk/types/index.js +1 -1
  175. package/dist/sdk/types/index.js.map +1 -1
  176. package/dist/sdk/types/progress.js +1 -1
  177. package/dist/sdk/user.js +1 -1
  178. package/dist/sdk/util/format-detector.js +1 -1
  179. package/dist/sdk/util/formatters.js +1 -1
  180. package/dist/sdk/util/index.js +1 -1
  181. package/dist/sdk/util/paginate.js +1 -1
  182. package/dist/sdk/util/tree-formatter.js +1 -1
  183. package/dist/sdk/workflow/archive-validation.js +1 -1
  184. package/dist/sdk/workflow/clone-workflow.js +1 -1
  185. package/dist/sdk/workflow/index.js +1 -1
  186. package/dist/sdk/workflow/pull-workflow.js +1 -1
  187. package/dist/sdk/workflow/push-workflow.js +1 -1
  188. package/dist/sdk/workflow/tdx-config.js +1 -1
  189. package/dist/sdk/workflow/workflow-utils.js +1 -1
  190. package/dist/test-utils/command-runner.js +1 -1
  191. package/dist/test-utils/factories.js +1 -1
  192. package/dist/test-utils/fixtures.js +1 -1
  193. package/dist/test-utils/http-mock.js +1 -1
  194. package/dist/test-utils/index.js +1 -1
  195. package/dist/utils/async.js +1 -1
  196. package/dist/utils/colors.js +1 -1
  197. package/dist/utils/diff.js +1 -1
  198. package/dist/utils/file-permissions.js +1 -1
  199. package/dist/utils/file-reader.js +1 -1
  200. package/dist/utils/github-releases.js +1 -1
  201. package/dist/utils/global-cache.js +1 -1
  202. package/dist/utils/json-loader.js +1 -1
  203. package/dist/utils/local-cache.js +1 -1
  204. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  205. package/dist/utils/logger/formatters/index.js +1 -1
  206. package/dist/utils/logger/handlers/console-handler.js +1 -1
  207. package/dist/utils/logger/handlers/file-handler.js +1 -1
  208. package/dist/utils/logger/handlers/index.js +1 -1
  209. package/dist/utils/logger/handlers/null-handler.js +1 -1
  210. package/dist/utils/logger/index.js +1 -1
  211. package/dist/utils/logger/logger.js +1 -1
  212. package/dist/utils/logger/types.js +1 -1
  213. package/dist/utils/option-validation.js +1 -1
  214. package/dist/utils/process.js +1 -1
  215. package/dist/utils/prompt.js +1 -1
  216. package/dist/utils/spinner.js +1 -1
  217. package/dist/utils/sse-parser.js +1 -1
  218. package/dist/utils/string-utils.js +1 -1
  219. package/dist/utils/table-ref-parser.js +1 -1
  220. package/dist/utils/tdx-logger.js +1 -1
  221. package/dist/utils/version-check.js +1 -1
  222. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x122c66,_0x137a52){const _0x159069=a173_0x4d42,_0x4b7f98=_0x122c66();while(!![]){try{const _0x2fd816=parseInt(_0x159069(0x11f))/0x1+parseInt(_0x159069(0x12e))/0x2*(-parseInt(_0x159069(0x124))/0x3)+parseInt(_0x159069(0x12b))/0x4*(-parseInt(_0x159069(0x121))/0x5)+parseInt(_0x159069(0x12c))/0x6+-parseInt(_0x159069(0x11e))/0x7*(-parseInt(_0x159069(0x129))/0x8)+-parseInt(_0x159069(0x127))/0x9*(-parseInt(_0x159069(0x120))/0xa)+-parseInt(_0x159069(0x11a))/0xb*(parseInt(_0x159069(0x126))/0xc);if(_0x2fd816===_0x137a52)break;else _0x4b7f98['push'](_0x4b7f98['shift']());}catch(_0x5f01eb){_0x4b7f98['push'](_0x4b7f98['shift']());}}}(a173_0x4f75,0x75753));export function detectFormatFromExtension(_0x1e341d){const _0x4d4521=a173_0x4d42,_0x955e15=_0x1e341d[_0x4d4521(0x12a)]()[_0x4d4521(0x125)]('.')[_0x4d4521(0x128)]();switch(_0x955e15){case _0x4d4521(0x11d):return _0x4d4521(0x11d);case _0x4d4521(0x11c):return _0x4d4521(0x11c);case _0x4d4521(0x11b):case _0x4d4521(0x123):return _0x4d4521(0x11b);case _0x4d4521(0x122):case _0x4d4521(0x12d):return _0x4d4521(0x12f);default:return undefined;}}function a173_0x4f75(){const _0x2383fe=['pop','56yzJXJm','toLowerCase','4mJXSCL','1174386inQCIv','text','32360IUgEQP','table','44gxqyAE','tsv','jsonl','json','53004oDIyfH','20426YUkcot','420ISgpxL','834740DSXluK','txt','tab','24wUqOem','split','1152120RrrRrj','191223GKGBNM'];a173_0x4f75=function(){return _0x2383fe;};return a173_0x4f75();}function a173_0x4d42(_0x10b2c2,_0x370dac){_0x10b2c2=_0x10b2c2-0x11a;const _0x4f75c4=a173_0x4f75();let _0x4d4283=_0x4f75c4[_0x10b2c2];return _0x4d4283;}export function resolveOutputFormat(_0x415eba,_0xbdad75,_0x325d52){if(_0x415eba)return _0x415eba;if(_0xbdad75){const _0x3b2ea8=detectFormatFromExtension(_0xbdad75);if(_0x3b2ea8)return _0x3b2ea8;}return _0x325d52;}
1
+ (function(_0x2d1f6d,_0x23e6b4){const _0x2fd04e=a173_0x82ba,_0xa4814=_0x2d1f6d();while(!![]){try{const _0x4565e5=parseInt(_0x2fd04e(0x192))/0x1*(-parseInt(_0x2fd04e(0x1a2))/0x2)+-parseInt(_0x2fd04e(0x198))/0x3+-parseInt(_0x2fd04e(0x19f))/0x4*(-parseInt(_0x2fd04e(0x199))/0x5)+parseInt(_0x2fd04e(0x197))/0x6*(parseInt(_0x2fd04e(0x19b))/0x7)+parseInt(_0x2fd04e(0x1a0))/0x8*(parseInt(_0x2fd04e(0x194))/0x9)+parseInt(_0x2fd04e(0x191))/0xa+-parseInt(_0x2fd04e(0x1a5))/0xb;if(_0x4565e5===_0x23e6b4)break;else _0xa4814['push'](_0xa4814['shift']());}catch(_0x98f196){_0xa4814['push'](_0xa4814['shift']());}}}(a173_0x48e4,0x8dcec));export function detectFormatFromExtension(_0x694026){const _0x43bf4d=a173_0x82ba,_0xdb4d17=_0x694026[_0x43bf4d(0x19d)]()[_0x43bf4d(0x1a3)]('.')[_0x43bf4d(0x193)]();switch(_0xdb4d17){case _0x43bf4d(0x1a1):return _0x43bf4d(0x1a1);case _0x43bf4d(0x1a4):return _0x43bf4d(0x1a4);case _0x43bf4d(0x19c):case _0x43bf4d(0x19e):return _0x43bf4d(0x19c);case _0x43bf4d(0x19a):case _0x43bf4d(0x195):return _0x43bf4d(0x196);default:return undefined;}}export function resolveOutputFormat(_0xd817cd,_0x2eb3a3,_0x3f3b76){if(_0xd817cd)return _0xd817cd;if(_0x2eb3a3){const _0x596716=detectFormatFromExtension(_0x2eb3a3);if(_0x596716)return _0x596716;}return _0x3f3b76;}function a173_0x82ba(_0xc8c04c,_0x65faa2){_0xc8c04c=_0xc8c04c-0x191;const _0x48e409=a173_0x48e4();let _0x82ba99=_0x48e409[_0xc8c04c];return _0x82ba99;}function a173_0x48e4(){const _0x7d5a7c=['4128OhMtRZ','json','46vQngaA','split','jsonl','8749026tQTekU','5305570nXahaC','381kERfOd','pop','9117scaOMv','text','table','2076792lgiTsu','75177ipYIIe','53175qmPXJu','txt','7WDzGBn','tsv','toLowerCase','tab','4QINegs'];a173_0x48e4=function(){return _0x7d5a7c;};return a173_0x48e4();}
@@ -1 +1 @@
1
- function a174_0x39d9(_0x1c4433,_0xb5f99e){_0x1c4433=_0x1c4433-0xa0;const _0x1df98d=a174_0x1df9();let _0x39d980=_0x1df98d[_0x1c4433];return _0x39d980;}(function(_0xe8386c,_0x56da82){const _0x4658f3=a174_0x39d9,_0x14fc37=_0xe8386c();while(!![]){try{const _0x46225b=parseInt(_0x4658f3(0xa3))/0x1+parseInt(_0x4658f3(0xa8))/0x2*(parseInt(_0x4658f3(0xd1))/0x3)+parseInt(_0x4658f3(0xc4))/0x4*(-parseInt(_0x4658f3(0xb1))/0x5)+parseInt(_0x4658f3(0xab))/0x6+-parseInt(_0x4658f3(0xc5))/0x7+parseInt(_0x4658f3(0xd0))/0x8*(parseInt(_0x4658f3(0xb2))/0x9)+-parseInt(_0x4658f3(0xb7))/0xa;if(_0x46225b===_0x56da82)break;else _0x14fc37['push'](_0x14fc37['shift']());}catch(_0x199e63){_0x14fc37['push'](_0x14fc37['shift']());}}}(a174_0x1df9,0xdb8bb));import{centerAlign,stringWidth,padEnd,padStart}from'../../utils/string-utils.js';function a174_0x1df9(){const _0x28c767=['bool','toFixed','push','toString','557456fxUecv','1721314BMlENv','toISOString','entries','toLowerCase','table','name','\x1b]8;;\x07','data','No\x20rows\x20returned','min','\x20shown)','7152136wGQCDa','6rsonrW','date','string','array','pow','repeat','int','stdout','map','\x20rows\x20(','forEach','join','stringify','1268440Wfqsjb','timestamp','length','substring','isTTY','1218378zuvYZB','replace','floor','316662wSPvQj','max','object','test','log','0\x20B','5VMtDSY','9RVLzVM','type','padEnd','startsWith','\x20row','21490870bisxFQ','jsonl','slice','\x1b]8;;','columns','double','number','long','boolean'];a174_0x1df9=function(){return _0x28c767;};return a174_0x1df9();}import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../../utils/colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0xd999f0=a174_0x39d9;return process[_0xd999f0(0xd8)][_0xd999f0(0xbb)]||Infinity;}export function formatAsTable(_0x456313,_0x153ae2=DEFAULT_MAX_DISPLAY_ROWS,_0xc25176=![],_0x5470bf={}){const _0xaed526=a174_0x39d9;if(_0x456313[_0xaed526(0xcc)]['length']===0x0)return _0xaed526(0xcd);const _0x4bc2a9=_0x456313[_0xaed526(0xbb)][_0xaed526(0xd9)](_0x1165dc=>_0x1165dc['name']),_0x2a56ff=_0x456313[_0xaed526(0xbb)][_0xaed526(0xd9)](_0x22fe57=>simplifyType(_0x22fe57[_0xaed526(0xb3)])),_0x4ee3f3=_0x456313[_0xaed526(0xcc)]['slice'](0x0,_0x153ae2),_0xb3286b=_0x456313[_0xaed526(0xcc)][_0xaed526(0xa5)],_0x1b4421=_0xb3286b>_0x153ae2,_0x5da16b=[],_0x135eaf=getTerminalWidth(),_0x436f0e=_0x135eaf!==Infinity,_0x3f4e26=0x32;let _0x191fab=_0x4bc2a9['map']((_0x543005,_0x31e852)=>{const _0x10d4d2=_0xaed526,_0x1d2ab6=stringWidth(_0x2a56ff[_0x31e852]),_0x42c823=Math[_0x10d4d2(0xac)](..._0x4ee3f3['map'](_0x17f339=>{const _0x3ff665=_0x17f339[_0x543005];return stringWidth(formatValue(_0x3ff665));})),_0x42bae5=Math[_0x10d4d2(0xac)](stringWidth(_0x543005),_0x1d2ab6,_0x42c823);return _0xc25176?_0x42bae5:Math['min'](_0x42bae5,_0x3f4e26);});if(_0x436f0e&&!_0xc25176&&_0x4bc2a9['length']>0x0){const _0x1c417b=_0x1667ca=>{let _0x51b889=0x1;for(const _0x41808f of _0x1667ca){_0x51b889+=_0x41808f+0x3;}return _0x51b889+0x1;};let _0x2bf812=_0x1c417b(_0x191fab);if(_0x2bf812>_0x135eaf){const _0x2164c0=0x3;for(let _0x56851d=_0x191fab[_0xaed526(0xa5)]-0x1;_0x56851d>=0x0;_0x56851d--){_0x2bf812=_0x1c417b(_0x191fab);if(_0x2bf812<=_0x135eaf)break;const _0x22f038=_0x191fab[_0x56851d],_0x409df2=_0x2bf812-_0x135eaf,_0x15c5e1=_0x22f038-_0x2164c0,_0x338489=Math[_0xaed526(0xce)](_0x409df2,_0x15c5e1);_0x338489>0x0&&(_0x191fab[_0x56851d]=_0x22f038-_0x338489);}}}const _0x23b814=_0x4bc2a9,_0xc9d9e3=_0x2a56ff,_0x58c71b=_0x191fab,_0xfcbff=_0x191fab;_0x5da16b['push'](colorBorder('┌'+_0xfcbff['map'](_0x3a6d8d=>'─'['repeat'](_0x3a6d8d+0x2))[_0xaed526(0xa1)]('┬')+'┐',_0x5470bf));const _0xe701cd=_0x23b814[_0xaed526(0xd9)]((_0x14dac5,_0x58b54f)=>centerAlign(_0x14dac5,_0x58c71b[_0x58b54f]));_0x5da16b[_0xaed526(0xc2)](colorBorder('│',_0x5470bf)+'\x20'+_0xe701cd[_0xaed526(0xa1)]('\x20'+colorBorder('│',_0x5470bf)+'\x20')+'\x20'+colorBorder('│',_0x5470bf));const _0x2408c2=_0xc9d9e3[_0xaed526(0xd9)]((_0x382d98,_0x5df4e9)=>colorType(centerAlign(_0x382d98,_0x58c71b[_0x5df4e9]),_0x5470bf));_0x5da16b[_0xaed526(0xc2)](colorBorder('│',_0x5470bf)+'\x20'+_0x2408c2[_0xaed526(0xa1)]('\x20'+colorBorder('│',_0x5470bf)+'\x20')+'\x20'+colorBorder('│',_0x5470bf)),_0x5da16b[_0xaed526(0xc2)](colorBorder('├'+_0xfcbff['map'](_0x3be345=>'─'[_0xaed526(0xd6)](_0x3be345+0x2))[_0xaed526(0xa1)]('┼')+'┤',_0x5470bf));const _0x159230=(_0x4609dc,_0x238298)=>{const _0x447190=_0xaed526,_0x29a3b3=stringWidth(_0x4609dc);if(_0x29a3b3<=_0x238298)return _0x4609dc;let _0x5b1819=_0x4609dc;while(stringWidth(_0x5b1819+'…')>_0x238298&&_0x5b1819[_0x447190(0xa5)]>0x0){_0x5b1819=_0x5b1819[_0x447190(0xb9)](0x0,-0x1);}return _0x5b1819+'…';};_0x4ee3f3[_0xaed526(0xa0)](_0x3a957c=>{const _0x21b0a7=_0xaed526,_0x5ef38c=_0x4bc2a9['map']((_0x29ae3b,_0x51d36a)=>{const _0x4bd2e6=a174_0x39d9,_0x3514a4=_0x3a957c[_0x29ae3b],_0x213e7e=formatValue(_0x3514a4),_0x9ef882=_0x58c71b[_0x51d36a],_0x22d09c=_0x159230(_0x213e7e,_0x9ef882),_0x2c200f=typeof _0x3514a4==='number'||typeof _0x3514a4==='string'&&/^-?\d+$/[_0x4bd2e6(0xae)](_0x3514a4);return _0x2c200f?padStart(_0x22d09c,_0x9ef882):padEnd(_0x22d09c,_0x9ef882);});_0x5da16b[_0x21b0a7(0xc2)](colorBorder('│',_0x5470bf)+'\x20'+_0x5ef38c[_0x21b0a7(0xa1)]('\x20'+colorBorder('│',_0x5470bf)+'\x20')+'\x20'+colorBorder('│',_0x5470bf));});const _0xf314c2=_0xfcbff['reduce']((_0x26fb60,_0x417bd2)=>_0x26fb60+_0x417bd2+0x3,-0x1);_0x5da16b[_0xaed526(0xc2)](colorBorder('├'+_0xfcbff[_0xaed526(0xd9)](_0xd006ca=>'─'['repeat'](_0xd006ca+0x2))['join']('┴')+'┤',_0x5470bf));let _0x5c4577;_0x1b4421?_0x5c4577=_0xb3286b+_0xaed526(0xda)+_0x153ae2+_0xaed526(0xcf):_0x5c4577=_0xb3286b+_0xaed526(0xb6)+(_0xb3286b===0x1?'':'s');const _0x61d7a4=_0x5c4577[_0xaed526(0xb4)](_0xf314c2-0x2);return _0x5da16b[_0xaed526(0xc2)](colorBorder('│',_0x5470bf)+'\x20'+_0x61d7a4+'\x20'+colorBorder('│',_0x5470bf)),_0x5da16b[_0xaed526(0xc2)](colorBorder('└'+'─'[_0xaed526(0xd6)](_0xf314c2)+'┘',_0x5470bf)),_0x5da16b['join']('\x0a');}function simplifyType(_0x1a89ce){const _0x5594ce=a174_0x39d9,_0x4ec582={'varchar':'string','bigint':_0x5594ce(0xbe),'integer':_0x5594ce(0xd7),'double':_0x5594ce(0xbc),'boolean':_0x5594ce(0xc0),'date':_0x5594ce(0xd2),'timestamp':_0x5594ce(0xa4),'array':_0x5594ce(0xd4),'map':'map','row':'row'},_0x3eaeee=_0x1a89ce[_0x5594ce(0xc8)]();for(const [_0x1beebb,_0x2042b9]of Object[_0x5594ce(0xc7)](_0x4ec582)){if(_0x3eaeee[_0x5594ce(0xb5)](_0x1beebb))return _0x2042b9;}return _0x1a89ce[_0x5594ce(0xa5)]>0xa?_0x1a89ce[_0x5594ce(0xa6)](0x0,0xa):_0x1a89ce;}export function formatAsJSON(_0x6022cb,_0x86cb77={}){const _0x257b12=a174_0x39d9;if(_0x6022cb['data'][_0x257b12(0xa5)]===0x0)return'[]';if(shouldUseColor(_0x86cb77))return colorizeJSON(_0x6022cb[_0x257b12(0xcc)],_0x86cb77);const _0x1f7960=_0x6022cb['data']['map'](_0x2f9bb4=>'\x20\x20'+JSON[_0x257b12(0xa2)](_0x2f9bb4));return'[\x0a'+_0x1f7960['join'](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x268429,_0x4b881a={}){const _0x3ae3e6=a174_0x39d9;if(_0x268429[_0x3ae3e6(0xcc)][_0x3ae3e6(0xa5)]===0x0)return'';if(shouldUseColor(_0x4b881a))return _0x268429[_0x3ae3e6(0xcc)][_0x3ae3e6(0xd9)](_0x183bf0=>colorizeJSONCompact(_0x183bf0,_0x4b881a))[_0x3ae3e6(0xa1)]('\x0a');return _0x268429[_0x3ae3e6(0xcc)][_0x3ae3e6(0xd9)](_0x22d7d9=>JSON[_0x3ae3e6(0xa2)](_0x22d7d9))[_0x3ae3e6(0xa1)]('\x0a');}export function formatAsTSV(_0x16d062){const _0x52bf71=a174_0x39d9;if(_0x16d062[_0x52bf71(0xcc)][_0x52bf71(0xa5)]===0x0)return'';const _0x51415e=[],_0x165477=_0x16d062[_0x52bf71(0xbb)]['map'](_0x36eadb=>_0x36eadb[_0x52bf71(0xca)]);return _0x51415e[_0x52bf71(0xc2)](_0x165477['join']('\x09')),_0x16d062[_0x52bf71(0xcc)][_0x52bf71(0xa0)](_0xb2e352=>{const _0x47fd74=_0x52bf71,_0x1d935d=_0x165477['map'](_0xade1ea=>{const _0x40ec93=_0xb2e352[_0xade1ea];return formatValueForTSV(_0x40ec93);});_0x51415e['push'](_0x1d935d[_0x47fd74(0xa1)]('\x09'));}),_0x51415e[_0x52bf71(0xa1)]('\x0a');}function formatValue(_0x41dec5){const _0x1945f4=a174_0x39d9;if(_0x41dec5===null||_0x41dec5===undefined)return'';if(typeof _0x41dec5===_0x1945f4(0xd3)){const _0x448301=_0x41dec5[_0x1945f4(0xa9)](/\n/g,'\x5cn')['replace'](/\r/g,'\x5cr')['replace'](/\t/g,'\x5ct');return _0x448301;}if(typeof _0x41dec5===_0x1945f4(0xbd))return String(_0x41dec5);if(typeof _0x41dec5===_0x1945f4(0xbf))return _0x41dec5?'true':'false';if(_0x41dec5 instanceof Date)return _0x41dec5['toISOString']();if(typeof _0x41dec5==='object')return JSON[_0x1945f4(0xa2)](_0x41dec5);return String(_0x41dec5);}function formatValueForTSV(_0x48ae73){const _0x3600d7=a174_0x39d9;if(_0x48ae73===null||_0x48ae73===undefined)return'';if(typeof _0x48ae73===_0x3600d7(0xd3))return _0x48ae73['replace'](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x48ae73===_0x3600d7(0xbd)||typeof _0x48ae73==='boolean')return String(_0x48ae73);if(_0x48ae73 instanceof Date)return _0x48ae73[_0x3600d7(0xc6)]();if(typeof _0x48ae73===_0x3600d7(0xad))return JSON[_0x3600d7(0xa2)](_0x48ae73);return String(_0x48ae73);}export function formatQueryResult(_0x164d50,_0x4f4d88){const _0x39b825=a174_0x39d9;switch(_0x4f4d88){case _0x39b825(0xc9):return formatAsTable(_0x164d50);case'json':return formatAsJSON(_0x164d50);case _0x39b825(0xb8):return formatAsJSONL(_0x164d50);case'tsv':return formatAsTSV(_0x164d50);default:return formatAsJSON(_0x164d50);}}export function formatBytes(_0x53ae85){const _0x4156ca=a174_0x39d9;if(_0x53ae85===0x0)return _0x4156ca(0xb0);const _0x46a19d=['B','KB','MB','GB','TB'],_0x186677=0x400,_0x385a23=Math[_0x4156ca(0xaa)](Math['log'](_0x53ae85)/Math[_0x4156ca(0xaf)](_0x186677)),_0x4dd070=_0x53ae85/Math[_0x4156ca(0xd5)](_0x186677,_0x385a23),_0x28aa9c=_0x4dd070>=0xa?0x1:0x2;return _0x4dd070[_0x4156ca(0xc1)](_0x28aa9c)+'\x20'+_0x46a19d[_0x385a23];}export function formatRows(_0x394619){const _0x453ed3=a174_0x39d9;if(_0x394619==null)return'-';if(_0x394619===0x0)return'0';if(_0x394619<0x3e8)return _0x394619[_0x453ed3(0xc3)]();const _0x3c1771=['','K','M','B','T'],_0xa58250=0x3e8,_0x53fcf2=Math[_0x453ed3(0xaa)](Math[_0x453ed3(0xaf)](_0x394619)/Math[_0x453ed3(0xaf)](_0xa58250)),_0x1bd3da=_0x394619/Math[_0x453ed3(0xd5)](_0xa58250,_0x53fcf2),_0x2cddd1=_0x1bd3da>=0xa?0x1:0x2;return''+_0x1bd3da[_0x453ed3(0xc1)](_0x2cddd1)+_0x3c1771[_0x53fcf2];}export function hyperlink(_0x2a5e84,_0x5e284c){const _0x7be05f=a174_0x39d9;if(!process[_0x7be05f(0xd8)][_0x7be05f(0xa7)])return _0x2a5e84;return _0x7be05f(0xba)+_0x5e284c+'\x07'+_0x2a5e84+_0x7be05f(0xcb);}
1
+ (function(_0x102b7f,_0x826342){const _0x46c31b=a174_0x28c3,_0x37ee09=_0x102b7f();while(!![]){try{const _0x5b0323=-parseInt(_0x46c31b(0xf7))/0x1*(-parseInt(_0x46c31b(0xf8))/0x2)+-parseInt(_0x46c31b(0xd5))/0x3*(-parseInt(_0x46c31b(0xe8))/0x4)+parseInt(_0x46c31b(0xf3))/0x5+parseInt(_0x46c31b(0xe7))/0x6*(parseInt(_0x46c31b(0xe0))/0x7)+-parseInt(_0x46c31b(0xcb))/0x8+-parseInt(_0x46c31b(0xfc))/0x9+-parseInt(_0x46c31b(0xec))/0xa;if(_0x5b0323===_0x826342)break;else _0x37ee09['push'](_0x37ee09['shift']());}catch(_0x451f5c){_0x37ee09['push'](_0x37ee09['shift']());}}}(a174_0x4224,0xe2b10));function a174_0x28c3(_0x542c03,_0x29a881){_0x542c03=_0x542c03-0xc6;const _0x42248f=a174_0x4224();let _0x28c3dc=_0x42248f[_0x542c03];return _0x28c3dc;}import{centerAlign,stringWidth,padEnd,padStart}from'../../utils/string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../../utils/colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x3c84ef=a174_0x28c3;return process[_0x3c84ef(0xef)][_0x3c84ef(0xdf)]||Infinity;}export function formatAsTable(_0x57dee4,_0x292b5f=DEFAULT_MAX_DISPLAY_ROWS,_0x3f4f46=![],_0x1105e9={}){const _0x47f1d3=a174_0x28c3;if(_0x57dee4[_0x47f1d3(0xce)][_0x47f1d3(0xd2)]===0x0)return _0x47f1d3(0xd4);const _0x1f8caf=_0x57dee4['columns'][_0x47f1d3(0xf4)](_0x17bf36=>_0x17bf36[_0x47f1d3(0xfd)]),_0x230e96=_0x57dee4[_0x47f1d3(0xdf)]['map'](_0x18d60a=>simplifyType(_0x18d60a[_0x47f1d3(0xea)])),_0x4d8382=_0x57dee4[_0x47f1d3(0xce)]['slice'](0x0,_0x292b5f),_0x171690=_0x57dee4['data'][_0x47f1d3(0xd2)],_0x4a8a50=_0x171690>_0x292b5f,_0x2c8953=[],_0x5d5e70=getTerminalWidth(),_0x1713dd=_0x5d5e70!==Infinity,_0x187aae=0x32;let _0x23240b=_0x1f8caf[_0x47f1d3(0xf4)]((_0xecc20d,_0x483d43)=>{const _0x1372f8=_0x47f1d3,_0x4f9c48=stringWidth(_0x230e96[_0x483d43]),_0x10731b=Math['max'](..._0x4d8382[_0x1372f8(0xf4)](_0x122c05=>{const _0x197839=_0x122c05[_0xecc20d];return stringWidth(formatValue(_0x197839));})),_0x27d4a5=Math[_0x1372f8(0xd6)](stringWidth(_0xecc20d),_0x4f9c48,_0x10731b);return _0x3f4f46?_0x27d4a5:Math[_0x1372f8(0x101)](_0x27d4a5,_0x187aae);});if(_0x1713dd&&!_0x3f4f46&&_0x1f8caf['length']>0x0){const _0x230ec2=_0xe1f966=>{let _0xc71be4=0x1;for(const _0x5495a7 of _0xe1f966){_0xc71be4+=_0x5495a7+0x3;}return _0xc71be4+0x1;};let _0x414f04=_0x230ec2(_0x23240b);if(_0x414f04>_0x5d5e70){const _0x14170e=0x3;for(let _0x114f80=_0x23240b[_0x47f1d3(0xd2)]-0x1;_0x114f80>=0x0;_0x114f80--){_0x414f04=_0x230ec2(_0x23240b);if(_0x414f04<=_0x5d5e70)break;const _0x2f49e7=_0x23240b[_0x114f80],_0x221c58=_0x414f04-_0x5d5e70,_0x57631f=_0x2f49e7-_0x14170e,_0x490fc2=Math[_0x47f1d3(0x101)](_0x221c58,_0x57631f);_0x490fc2>0x0&&(_0x23240b[_0x114f80]=_0x2f49e7-_0x490fc2);}}}const _0x4b81ff=_0x1f8caf,_0x4421b1=_0x230e96,_0x678af1=_0x23240b,_0x3b74ba=_0x23240b;_0x2c8953[_0x47f1d3(0xe9)](colorBorder('┌'+_0x3b74ba['map'](_0x235f6e=>'─'[_0x47f1d3(0xfa)](_0x235f6e+0x2))['join']('┬')+'┐',_0x1105e9));const _0x3787ad=_0x4b81ff['map']((_0x31b00f,_0x1b8a74)=>centerAlign(_0x31b00f,_0x678af1[_0x1b8a74]));_0x2c8953[_0x47f1d3(0xe9)](colorBorder('│',_0x1105e9)+'\x20'+_0x3787ad['join']('\x20'+colorBorder('│',_0x1105e9)+'\x20')+'\x20'+colorBorder('│',_0x1105e9));const _0x5e77ff=_0x4421b1[_0x47f1d3(0xf4)]((_0x2b2f34,_0x249a47)=>colorType(centerAlign(_0x2b2f34,_0x678af1[_0x249a47]),_0x1105e9));_0x2c8953['push'](colorBorder('│',_0x1105e9)+'\x20'+_0x5e77ff[_0x47f1d3(0x102)]('\x20'+colorBorder('│',_0x1105e9)+'\x20')+'\x20'+colorBorder('│',_0x1105e9)),_0x2c8953['push'](colorBorder('├'+_0x3b74ba[_0x47f1d3(0xf4)](_0x49d80c=>'─'[_0x47f1d3(0xfa)](_0x49d80c+0x2))[_0x47f1d3(0x102)]('┼')+'┤',_0x1105e9));const _0x5512cb=(_0x4c1f6d,_0x10611e)=>{const _0x2821a1=_0x47f1d3,_0x4be0ab=stringWidth(_0x4c1f6d);if(_0x4be0ab<=_0x10611e)return _0x4c1f6d;let _0x4e5297=_0x4c1f6d;while(stringWidth(_0x4e5297+'…')>_0x10611e&&_0x4e5297[_0x2821a1(0xd2)]>0x0){_0x4e5297=_0x4e5297['slice'](0x0,-0x1);}return _0x4e5297+'…';};_0x4d8382[_0x47f1d3(0xc7)](_0x455f33=>{const _0xc5f146=_0x47f1d3,_0x5f34ba=_0x1f8caf[_0xc5f146(0xf4)]((_0x374248,_0x3577cc)=>{const _0x33e8be=_0xc5f146,_0x2c66d3=_0x455f33[_0x374248],_0x2c1896=formatValue(_0x2c66d3),_0x3f663a=_0x678af1[_0x3577cc],_0x4ddd0b=_0x5512cb(_0x2c1896,_0x3f663a),_0x8cfe47=typeof _0x2c66d3===_0x33e8be(0xd0)||typeof _0x2c66d3==='string'&&/^-?\d+$/[_0x33e8be(0xd7)](_0x2c66d3);return _0x8cfe47?padStart(_0x4ddd0b,_0x3f663a):padEnd(_0x4ddd0b,_0x3f663a);});_0x2c8953[_0xc5f146(0xe9)](colorBorder('│',_0x1105e9)+'\x20'+_0x5f34ba[_0xc5f146(0x102)]('\x20'+colorBorder('│',_0x1105e9)+'\x20')+'\x20'+colorBorder('│',_0x1105e9));});const _0xfe2513=_0x3b74ba[_0x47f1d3(0xfb)]((_0x3f6492,_0x161c21)=>_0x3f6492+_0x161c21+0x3,-0x1);_0x2c8953['push'](colorBorder('├'+_0x3b74ba[_0x47f1d3(0xf4)](_0x35e6bf=>'─'[_0x47f1d3(0xfa)](_0x35e6bf+0x2))[_0x47f1d3(0x102)]('┴')+'┤',_0x1105e9));let _0x155452;_0x4a8a50?_0x155452=_0x171690+_0x47f1d3(0xc6)+_0x292b5f+_0x47f1d3(0xcd):_0x155452=_0x171690+_0x47f1d3(0xf9)+(_0x171690===0x1?'':'s');const _0x44fd91=_0x155452[_0x47f1d3(0xd8)](_0xfe2513-0x2);return _0x2c8953['push'](colorBorder('│',_0x1105e9)+'\x20'+_0x44fd91+'\x20'+colorBorder('│',_0x1105e9)),_0x2c8953[_0x47f1d3(0xe9)](colorBorder('└'+'─'[_0x47f1d3(0xfa)](_0xfe2513)+'┘',_0x1105e9)),_0x2c8953[_0x47f1d3(0x102)]('\x0a');}function simplifyType(_0x5a06c1){const _0x48344b=a174_0x28c3,_0x38ef05={'varchar':_0x48344b(0xdd),'bigint':_0x48344b(0xde),'integer':_0x48344b(0xf2),'double':_0x48344b(0xc8),'boolean':_0x48344b(0xdc),'date':_0x48344b(0xe3),'timestamp':_0x48344b(0xf5),'array':_0x48344b(0xe6),'map':'map','row':_0x48344b(0xd3)},_0x575105=_0x5a06c1[_0x48344b(0xfe)]();for(const [_0x24207c,_0x3fd228]of Object['entries'](_0x38ef05)){if(_0x575105[_0x48344b(0xca)](_0x24207c))return _0x3fd228;}return _0x5a06c1[_0x48344b(0xd2)]>0xa?_0x5a06c1[_0x48344b(0xf1)](0x0,0xa):_0x5a06c1;}export function formatAsJSON(_0x152a7f,_0x295a10={}){const _0x2feb7e=a174_0x28c3;if(_0x152a7f[_0x2feb7e(0xce)][_0x2feb7e(0xd2)]===0x0)return'[]';if(shouldUseColor(_0x295a10))return colorizeJSON(_0x152a7f[_0x2feb7e(0xce)],_0x295a10);const _0x1f17a7=_0x152a7f[_0x2feb7e(0xce)]['map'](_0x5d1724=>'\x20\x20'+JSON[_0x2feb7e(0xcf)](_0x5d1724));return'[\x0a'+_0x1f17a7[_0x2feb7e(0x102)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x252e57,_0x4140b2={}){const _0x1603c9=a174_0x28c3;if(_0x252e57[_0x1603c9(0xce)]['length']===0x0)return'';if(shouldUseColor(_0x4140b2))return _0x252e57[_0x1603c9(0xce)][_0x1603c9(0xf4)](_0x2081e=>colorizeJSONCompact(_0x2081e,_0x4140b2))['join']('\x0a');return _0x252e57[_0x1603c9(0xce)][_0x1603c9(0xf4)](_0x5e64b2=>JSON['stringify'](_0x5e64b2))[_0x1603c9(0x102)]('\x0a');}export function formatAsTSV(_0x6a2783){const _0x4c0162=a174_0x28c3;if(_0x6a2783[_0x4c0162(0xce)][_0x4c0162(0xd2)]===0x0)return'';const _0x3fc1fe=[],_0x9c44c1=_0x6a2783['columns']['map'](_0x2534a5=>_0x2534a5['name']);return _0x3fc1fe[_0x4c0162(0xe9)](_0x9c44c1['join']('\x09')),_0x6a2783[_0x4c0162(0xce)]['forEach'](_0x26eb4c=>{const _0x5562d2=_0x4c0162,_0xcb6ba=_0x9c44c1['map'](_0x15e49a=>{const _0x3a2d7b=_0x26eb4c[_0x15e49a];return formatValueForTSV(_0x3a2d7b);});_0x3fc1fe['push'](_0xcb6ba[_0x5562d2(0x102)]('\x09'));}),_0x3fc1fe[_0x4c0162(0x102)]('\x0a');}function formatValue(_0x3b9955){const _0x57a320=a174_0x28c3;if(_0x3b9955===null||_0x3b9955===undefined)return'';if(typeof _0x3b9955===_0x57a320(0xdd)){const _0x553cc8=_0x3b9955[_0x57a320(0xf6)](/\n/g,'\x5cn')['replace'](/\r/g,'\x5cr')['replace'](/\t/g,'\x5ct');return _0x553cc8;}if(typeof _0x3b9955===_0x57a320(0xd0))return String(_0x3b9955);if(typeof _0x3b9955===_0x57a320(0xe5))return _0x3b9955?_0x57a320(0xcc):_0x57a320(0xe1);if(_0x3b9955 instanceof Date)return _0x3b9955['toISOString']();if(typeof _0x3b9955===_0x57a320(0xc9))return JSON['stringify'](_0x3b9955);return String(_0x3b9955);}function formatValueForTSV(_0x18ae1c){const _0x3d7031=a174_0x28c3;if(_0x18ae1c===null||_0x18ae1c===undefined)return'';if(typeof _0x18ae1c===_0x3d7031(0xdd))return _0x18ae1c[_0x3d7031(0xf6)](/\t/g,'\x5ct')[_0x3d7031(0xf6)](/\n/g,'\x5cn');if(typeof _0x18ae1c==='number'||typeof _0x18ae1c===_0x3d7031(0xe5))return String(_0x18ae1c);if(_0x18ae1c instanceof Date)return _0x18ae1c[_0x3d7031(0xdb)]();if(typeof _0x18ae1c===_0x3d7031(0xc9))return JSON[_0x3d7031(0xcf)](_0x18ae1c);return String(_0x18ae1c);}export function formatQueryResult(_0x4b2dcc,_0x5106b4){const _0x335ce0=a174_0x28c3;switch(_0x5106b4){case _0x335ce0(0xe4):return formatAsTable(_0x4b2dcc);case _0x335ce0(0xff):return formatAsJSON(_0x4b2dcc);case _0x335ce0(0xd1):return formatAsJSONL(_0x4b2dcc);case'tsv':return formatAsTSV(_0x4b2dcc);default:return formatAsJSON(_0x4b2dcc);}}export function formatBytes(_0x5d6643){const _0x3f7dda=a174_0x28c3;if(_0x5d6643===0x0)return'0\x20B';const _0x202c6b=['B','KB','MB','GB','TB'],_0x492574=0x400,_0x374a6e=Math[_0x3f7dda(0xeb)](Math[_0x3f7dda(0x100)](_0x5d6643)/Math[_0x3f7dda(0x100)](_0x492574)),_0x1ca341=_0x5d6643/Math[_0x3f7dda(0xda)](_0x492574,_0x374a6e),_0x5bbdd6=_0x1ca341>=0xa?0x1:0x2;return _0x1ca341[_0x3f7dda(0xf0)](_0x5bbdd6)+'\x20'+_0x202c6b[_0x374a6e];}function a174_0x4224(){const _0xb44a00=['isTTY','pow','toISOString','bool','string','long','columns','665semuup','false','toString','date','table','boolean','array','3366hElIBC','437876IqWfWs','push','type','floor','6158210OhmCRg','\x1b]8;;','\x1b]8;;\x07','stdout','toFixed','substring','int','6582185ydwuQf','map','timestamp','replace','32KPBgFl','86426lPQrGa','\x20row','repeat','reduce','1738881CgSGOu','name','toLowerCase','json','log','min','join','\x20rows\x20(','forEach','double','object','startsWith','10747176DVtyWk','true','\x20shown)','data','stringify','number','jsonl','length','row','No\x20rows\x20returned','9pQwuze','max','test','padEnd'];a174_0x4224=function(){return _0xb44a00;};return a174_0x4224();}export function formatRows(_0xfb8dcb){const _0x394ec7=a174_0x28c3;if(_0xfb8dcb==null)return'-';if(_0xfb8dcb===0x0)return'0';if(_0xfb8dcb<0x3e8)return _0xfb8dcb[_0x394ec7(0xe2)]();const _0x27e6cd=['','K','M','B','T'],_0xef7e72=0x3e8,_0x535d35=Math['floor'](Math['log'](_0xfb8dcb)/Math[_0x394ec7(0x100)](_0xef7e72)),_0x4e9359=_0xfb8dcb/Math[_0x394ec7(0xda)](_0xef7e72,_0x535d35),_0x4dca45=_0x4e9359>=0xa?0x1:0x2;return''+_0x4e9359[_0x394ec7(0xf0)](_0x4dca45)+_0x27e6cd[_0x535d35];}export function hyperlink(_0x4ac71a,_0x5ed16e){const _0x260301=a174_0x28c3;if(!process[_0x260301(0xef)][_0x260301(0xd9)])return _0x4ac71a;return _0x260301(0xed)+_0x5ed16e+'\x07'+_0x4ac71a+_0x260301(0xee);}
@@ -1 +1 @@
1
- (function(_0x224cdf,_0x157cf2){var _0x1ad375=a175_0x4b04,_0xef924c=_0x224cdf();while(!![]){try{var _0x1fcb0e=-parseInt(_0x1ad375(0x191))/0x1+parseInt(_0x1ad375(0x192))/0x2+parseInt(_0x1ad375(0x195))/0x3+parseInt(_0x1ad375(0x190))/0x4*(parseInt(_0x1ad375(0x18e))/0x5)+parseInt(_0x1ad375(0x196))/0x6*(parseInt(_0x1ad375(0x193))/0x7)+-parseInt(_0x1ad375(0x18f))/0x8+-parseInt(_0x1ad375(0x194))/0x9;if(_0x1fcb0e===_0x157cf2)break;else _0xef924c['push'](_0xef924c['shift']());}catch(_0x4dc164){_0xef924c['push'](_0xef924c['shift']());}}}(a175_0x38f2,0xa10a2));function a175_0x4b04(_0x296b9c,_0x487d07){_0x296b9c=_0x296b9c-0x18e;var _0x38f237=a175_0x38f2();var _0x4b0453=_0x38f237[_0x296b9c];return _0x4b0453;}export*from'./formatters.js';function a175_0x38f2(){var _0x4cf937=['876376dChRgf','4DEatwY','330664gPCxjJ','1536212KySGGj','7SVjrVx','23090301zKxLhi','3691878sFwWal','6523806vLyMpp','2896925QcWuAS'];a175_0x38f2=function(){return _0x4cf937;};return a175_0x38f2();}export*from'./format-detector.js';export*from'./tree-formatter.js';export*from'./paginate.js';
1
+ (function(_0x34de31,_0x1bdd65){var _0x5e7146=a175_0x2d76,_0x95707e=_0x34de31();while(!![]){try{var _0x55c3af=-parseInt(_0x5e7146(0x122))/0x1+parseInt(_0x5e7146(0x11e))/0x2+parseInt(_0x5e7146(0x11b))/0x3*(parseInt(_0x5e7146(0x123))/0x4)+-parseInt(_0x5e7146(0x11d))/0x5*(parseInt(_0x5e7146(0x124))/0x6)+-parseInt(_0x5e7146(0x120))/0x7+-parseInt(_0x5e7146(0x121))/0x8+parseInt(_0x5e7146(0x11f))/0x9*(parseInt(_0x5e7146(0x11c))/0xa);if(_0x55c3af===_0x1bdd65)break;else _0x95707e['push'](_0x95707e['shift']());}catch(_0x33a0fc){_0x95707e['push'](_0x95707e['shift']());}}}(a175_0x27f8,0x8d426));export*from'./formatters.js';export*from'./format-detector.js';function a175_0x2d76(_0x12688c,_0x3ecc97){_0x12688c=_0x12688c-0x11b;var _0x27f805=a175_0x27f8();var _0x2d7619=_0x27f805[_0x12688c];return _0x2d7619;}function a175_0x27f8(){var _0x5251bf=['4444244AVViYj','2331064ULLviK','995751dcrdMu','1046164sOlgZP','210vmPwnu','3PqpbmC','23159750ivJhrW','155730SeVVao','2026436MBimWt','9SridKR'];a175_0x27f8=function(){return _0x5251bf;};return a175_0x27f8();}export*from'./tree-formatter.js';export*from'./paginate.js';
@@ -1 +1 @@
1
- (function(_0xe0d55e,_0x33635d){const _0x8a85b5=a176_0x16d0,_0x452df=_0xe0d55e();while(!![]){try{const _0x3310cb=-parseInt(_0x8a85b5(0x1ce))/0x1*(parseInt(_0x8a85b5(0x1cf))/0x2)+-parseInt(_0x8a85b5(0x1d0))/0x3+parseInt(_0x8a85b5(0x1d1))/0x4*(parseInt(_0x8a85b5(0x1cd))/0x5)+-parseInt(_0x8a85b5(0x1ca))/0x6+parseInt(_0x8a85b5(0x1cc))/0x7*(parseInt(_0x8a85b5(0x1d2))/0x8)+parseInt(_0x8a85b5(0x1cb))/0x9+-parseInt(_0x8a85b5(0x1d3))/0xa*(-parseInt(_0x8a85b5(0x1c6))/0xb);if(_0x3310cb===_0x33635d)break;else _0x452df['push'](_0x452df['shift']());}catch(_0x39b268){_0x452df['push'](_0x452df['shift']());}}}(a176_0x7415,0x72d65));export const PAGE_SIZE=0x64;function a176_0x7415(){const _0x410448=['5XmglTu','7ZeSfSM','154802hBduSC','1833417UcjtMQ','1465196ErGEiV','8SZwYOV','250OwpXLJ','push','length','164362AeWFBH','min','isArray','data','4146348DWkTPf','7260273uaeXKx','5374817eytBDs'];a176_0x7415=function(){return _0x410448;};return a176_0x7415();}export const MAX_PAGINATION_LIMIT=0x2710;function a176_0x16d0(_0x4d07b9,_0x414a3a){_0x4d07b9=_0x4d07b9-0x1c6;const _0x741504=a176_0x7415();let _0x16d03f=_0x741504[_0x4d07b9];return _0x16d03f;}export async function paginate(_0x33bca7,_0x4f498c=MAX_PAGINATION_LIMIT,_0x10c920=0x0){const _0x586956=a176_0x16d0,_0x523199=Math[_0x586956(0x1c7)](_0x4f498c,MAX_PAGINATION_LIMIT),_0x5281de=[];let _0xe23cc8=_0x10c920;while(_0x5281de['length']<_0x523199){const _0x24abf0=Math[_0x586956(0x1c7)](PAGE_SIZE,_0x523199-_0x5281de['length']),_0x5641ac=await _0x33bca7(_0x24abf0,_0xe23cc8),_0x5b011c=Array[_0x586956(0x1c8)](_0x5641ac[_0x586956(0x1c9)])?_0x5641ac['data']:[_0x5641ac[_0x586956(0x1c9)]];_0x5281de[_0x586956(0x1d4)](..._0x5b011c);if(_0x5b011c[_0x586956(0x1d5)]<_0x24abf0)break;_0xe23cc8+=_0x24abf0;}return _0x5281de['length']>_0x523199?_0x5281de['slice'](0x0,_0x523199):_0x5281de;}
1
+ (function(_0x3cfa1e,_0x23cbb8){const _0x399201=a176_0x2cd3,_0x20628e=_0x3cfa1e();while(!![]){try{const _0x5177d3=-parseInt(_0x399201(0x1cb))/0x1+parseInt(_0x399201(0x1d0))/0x2*(parseInt(_0x399201(0x1d6))/0x3)+parseInt(_0x399201(0x1c8))/0x4*(-parseInt(_0x399201(0x1d3))/0x5)+parseInt(_0x399201(0x1d2))/0x6*(-parseInt(_0x399201(0x1d4))/0x7)+parseInt(_0x399201(0x1ca))/0x8*(-parseInt(_0x399201(0x1cc))/0x9)+-parseInt(_0x399201(0x1ce))/0xa*(-parseInt(_0x399201(0x1c9))/0xb)+parseInt(_0x399201(0x1d7))/0xc;if(_0x5177d3===_0x23cbb8)break;else _0x20628e['push'](_0x20628e['shift']());}catch(_0x33fe28){_0x20628e['push'](_0x20628e['shift']());}}}(a176_0x1c1a,0x6c9e3));export const PAGE_SIZE=0x64;export const MAX_PAGINATION_LIMIT=0x2710;export async function paginate(_0x338045,_0x15d592=MAX_PAGINATION_LIMIT,_0xcf0dc1=0x0){const _0x5c24a3=a176_0x2cd3,_0x1b63e2=Math[_0x5c24a3(0x1c7)](_0x15d592,MAX_PAGINATION_LIMIT),_0x56b63b=[];let _0x3b95b5=_0xcf0dc1;while(_0x56b63b[_0x5c24a3(0x1d5)]<_0x1b63e2){const _0x3f3d3c=Math['min'](PAGE_SIZE,_0x1b63e2-_0x56b63b[_0x5c24a3(0x1d5)]),_0x1304b3=await _0x338045(_0x3f3d3c,_0x3b95b5),_0x3d0787=Array[_0x5c24a3(0x1cd)](_0x1304b3[_0x5c24a3(0x1d1)])?_0x1304b3['data']:[_0x1304b3['data']];_0x56b63b[_0x5c24a3(0x1cf)](..._0x3d0787);if(_0x3d0787['length']<_0x3f3d3c)break;_0x3b95b5+=_0x3f3d3c;}return _0x56b63b[_0x5c24a3(0x1d5)]>_0x1b63e2?_0x56b63b['slice'](0x0,_0x1b63e2):_0x56b63b;}function a176_0x2cd3(_0x1499bb,_0x2eaca5){_0x1499bb=_0x1499bb-0x1c7;const _0x1c1ad8=a176_0x1c1a();let _0x2cd368=_0x1c1ad8[_0x1499bb];return _0x2cd368;}function a176_0x1c1a(){const _0x2a8df0=['2910clqIZe','14047740OneFVc','min','41732kNujAn','253198qHmtgJ','6172792MPVSmr','65323BHHPAO','9eIwSOZ','isArray','230EDqpZl','push','1008iGCoaP','data','18LPvWBw','185bDjAhs','1215893LcMDbR','length'];a176_0x1c1a=function(){return _0x2a8df0;};return a176_0x1c1a();}
@@ -1 +1 @@
1
- (function(_0xca2c04,_0x7abcbd){const _0x4e25bd=a177_0x5510,_0x859434=_0xca2c04();while(!![]){try{const _0x57c833=parseInt(_0x4e25bd(0x168))/0x1+parseInt(_0x4e25bd(0x18a))/0x2*(-parseInt(_0x4e25bd(0x18b))/0x3)+-parseInt(_0x4e25bd(0x166))/0x4*(-parseInt(_0x4e25bd(0x189))/0x5)+parseInt(_0x4e25bd(0x186))/0x6+-parseInt(_0x4e25bd(0x179))/0x7+-parseInt(_0x4e25bd(0x180))/0x8*(-parseInt(_0x4e25bd(0x16f))/0x9)+-parseInt(_0x4e25bd(0x17a))/0xa;if(_0x57c833===_0x7abcbd)break;else _0x859434['push'](_0x859434['shift']());}catch(_0x5e8da3){_0x859434['push'](_0x859434['shift']());}}}(a177_0x55a7,0xe8485));function a177_0x55a7(){const _0x2c7bee=['600fprHXd','paused','1324653QkraqK','launched','localeCompare','push','🗺️','icon','sortKey','9xcEXrU','journeyCount','population','state','indent','\x20segment','showMetadata','🎯\x20','└──\x20','metadata','6158712fCShiL','12999630zUHlBW','map','dim','\x20\x20\x20\x20','name','segment','550232YYHvSs','journey','children','type','(running)','getJourneyUrl','5145012qoLPpe','showIcons','folderCount','55435YxNENa','2ZwzXkG','2348328qHDtzR','showTreeLines','journeyBundleName','sort','\x20\x20\x20','(paused)','folder','segmentCount','displayName','length','draft','completed','join','getSegmentUrl'];a177_0x55a7=function(){return _0x2c7bee;};return a177_0x55a7();}function a177_0x5510(_0x1fb9b6,_0xc5e0e6){_0x1fb9b6=_0x1fb9b6-0x15f;const _0x55a7ee=a177_0x55a7();let _0x5510da=_0x55a7ee[_0x1fb9b6];return _0x5510da;}import{formatRows,hyperlink}from'./formatters.js';import a177_0x2d2eb2 from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};export function formatTree(_0x2afc4f,_0x2f11b5={},_0xcdefb8=0x0,_0x19f6dd=''){const _0x217768=a177_0x5510,_0x4bc193={...DEFAULT_OPTIONS,..._0x2f11b5},_0x21d196=[],_0x11961e=[..._0x2afc4f][_0x217768(0x18e)]((_0x531ff9,_0x311e97)=>_0x531ff9['name'][_0x217768(0x16a)](_0x311e97[_0x217768(0x17e)],undefined,{'sensitivity':'base'}));for(let _0x1a8159=0x0;_0x1a8159<_0x11961e['length'];_0x1a8159++){const _0x48f5e0=_0x11961e[_0x1a8159],_0x5efbcd=_0x1a8159===_0x11961e[_0x217768(0x161)]-0x1;let _0x8779d6='';_0xcdefb8>0x0&&(_0x8779d6+=_0x19f6dd);_0x4bc193['showTreeLines']&&_0xcdefb8>0x0&&(_0x8779d6+=a177_0x2d2eb2[_0x217768(0x17c)](_0x5efbcd?_0x217768(0x177):'├──\x20'));if(_0x4bc193[_0x217768(0x187)]){if(_0x48f5e0[_0x217768(0x183)]==='folder')_0x8779d6+='📁\x20';else _0x48f5e0[_0x217768(0x183)]===_0x217768(0x181)?_0x8779d6+='🗺️\x20':_0x8779d6+=_0x217768(0x176);}if(_0x4bc193[_0x217768(0x165)]&&_0x48f5e0[_0x217768(0x183)]==='segment')_0x8779d6+=hyperlink(_0x48f5e0['name'],_0x4bc193[_0x217768(0x165)](_0x48f5e0['id']));else _0x4bc193[_0x217768(0x185)]&&_0x48f5e0['type']==='journey'?_0x8779d6+=hyperlink(_0x48f5e0['name'],_0x4bc193[_0x217768(0x185)](_0x48f5e0['id'])):_0x8779d6+=_0x48f5e0[_0x217768(0x17e)];if(_0x4bc193[_0x217768(0x175)]){if(_0x48f5e0[_0x217768(0x183)]===_0x217768(0x191)){const _0x5ac144=[];_0x48f5e0[_0x217768(0x178)][_0x217768(0x15f)]&&_0x5ac144[_0x217768(0x16b)](_0x48f5e0[_0x217768(0x178)]['segmentCount']+_0x217768(0x174)+(_0x48f5e0[_0x217768(0x178)][_0x217768(0x15f)]!==0x1?'s':'')),_0x48f5e0[_0x217768(0x178)][_0x217768(0x188)]&&_0x5ac144['push'](_0x48f5e0[_0x217768(0x178)]['folderCount']+'\x20folder'+(_0x48f5e0[_0x217768(0x178)][_0x217768(0x188)]!==0x1?'s':'')),_0x48f5e0[_0x217768(0x178)][_0x217768(0x170)]&&_0x5ac144[_0x217768(0x16b)](_0x48f5e0[_0x217768(0x178)][_0x217768(0x170)]+'\x20journey'+(_0x48f5e0[_0x217768(0x178)][_0x217768(0x170)]!==0x1?'s':'')),_0x5ac144[_0x217768(0x161)]>0x0&&(_0x8779d6+=a177_0x2d2eb2[_0x217768(0x17c)]('\x20('+_0x5ac144[_0x217768(0x164)](',\x20')+')'));}else{if(_0x48f5e0[_0x217768(0x183)]===_0x217768(0x17f)&&_0x48f5e0[_0x217768(0x171)]!==undefined)_0x8779d6+=a177_0x2d2eb2[_0x217768(0x17c)]('\x20('+formatRows(_0x48f5e0[_0x217768(0x171)])+')');else _0x48f5e0[_0x217768(0x183)]===_0x217768(0x181)&&_0x48f5e0[_0x217768(0x172)]&&(_0x8779d6+=a177_0x2d2eb2[_0x217768(0x17c)]('\x20'+getJourneyStateIndicator(_0x48f5e0[_0x217768(0x172)])));}}_0x21d196[_0x217768(0x16b)](_0x8779d6);if(_0x48f5e0[_0x217768(0x182)]&&_0x48f5e0[_0x217768(0x182)][_0x217768(0x161)]>0x0){let _0x490f37;if(_0xcdefb8===0x0)_0x490f37='';else _0x4bc193[_0x217768(0x18c)]?_0x490f37=_0x19f6dd+(_0x5efbcd?_0x217768(0x17d):a177_0x2d2eb2[_0x217768(0x17c)]('│')+_0x217768(0x18f)):_0x490f37=_0x19f6dd+_0x4bc193[_0x217768(0x173)];const _0x28b154=formatTree(_0x48f5e0[_0x217768(0x182)],_0x4bc193,_0xcdefb8+0x1,_0x490f37);_0x21d196[_0x217768(0x16b)](_0x28b154);}}return _0x21d196[_0x217768(0x164)]('\x0a');}export function formatFlatList(_0x19d8c0,_0x4fb0bc,_0x16a517={},_0x32ea86=[]){const _0x5493cc=a177_0x5510,_0x4bca1b={...DEFAULT_OPTIONS,..._0x16a517},_0x2aeb13=[];for(const _0x45a477 of _0x19d8c0){_0x2aeb13['push']({'sortKey':_0x45a477[_0x5493cc(0x17e)],'displayName':_0x45a477[_0x5493cc(0x17e)],'icon':_0x4bca1b['showIcons']?'📁':'','metadata':undefined});}for(const _0x306a7b of _0x4fb0bc){const _0x1e9937=_0x4bca1b[_0x5493cc(0x175)]&&_0x306a7b[_0x5493cc(0x171)]!==undefined?a177_0x2d2eb2[_0x5493cc(0x17c)]('\x20('+formatRows(_0x306a7b[_0x5493cc(0x171)])+')'):'',_0x341d76=_0x4bca1b['getSegmentUrl']?hyperlink(_0x306a7b[_0x5493cc(0x17e)],_0x4bca1b[_0x5493cc(0x165)](_0x306a7b['id'])):_0x306a7b[_0x5493cc(0x17e)];_0x2aeb13[_0x5493cc(0x16b)]({'sortKey':_0x306a7b[_0x5493cc(0x17e)],'displayName':_0x341d76,'icon':_0x4bca1b[_0x5493cc(0x187)]?'🎯':'','metadata':_0x1e9937});}for(const _0x1cd9bd of _0x32ea86){const _0x446676=getJourneyStateIndicator(_0x1cd9bd[_0x5493cc(0x172)]),_0x378d74=_0x4bca1b[_0x5493cc(0x175)]?a177_0x2d2eb2['dim']('\x20'+_0x446676):'',_0x5db5a6=_0x4bca1b[_0x5493cc(0x185)]?hyperlink(_0x1cd9bd[_0x5493cc(0x18d)],_0x4bca1b[_0x5493cc(0x185)](_0x1cd9bd['id'])):_0x1cd9bd[_0x5493cc(0x18d)];_0x2aeb13[_0x5493cc(0x16b)]({'sortKey':_0x1cd9bd[_0x5493cc(0x18d)],'displayName':_0x5db5a6,'icon':_0x4bca1b[_0x5493cc(0x187)]?_0x5493cc(0x16c):'','metadata':_0x378d74});}_0x2aeb13['sort']((_0x312d91,_0x2e485c)=>_0x312d91['sortKey'][_0x5493cc(0x16a)](_0x2e485c[_0x5493cc(0x16e)],undefined,{'sensitivity':'base'}));if(_0x2aeb13[_0x5493cc(0x161)]===0x0)return'(empty)';const _0x49a1f6=_0x2aeb13[_0x5493cc(0x17b)](_0x16289f=>{const _0x23ec36=_0x5493cc,_0x1dfb9c=_0x16289f[_0x23ec36(0x16d)]?_0x16289f[_0x23ec36(0x16d)]+'\x20':'',_0x1ec45a=_0x16289f[_0x23ec36(0x178)]||'';return''+_0x1dfb9c+_0x16289f[_0x23ec36(0x160)]+_0x1ec45a;});return _0x49a1f6[_0x5493cc(0x164)]('\x0a');}function getJourneyStateIndicator(_0x44c2fa){const _0xf4e2f6=a177_0x5510;switch(_0x44c2fa){case _0xf4e2f6(0x162):return'(draft)';case _0xf4e2f6(0x169):return _0xf4e2f6(0x184);case _0xf4e2f6(0x167):return _0xf4e2f6(0x190);case _0xf4e2f6(0x163):return'(completed)';default:return'('+_0x44c2fa+')';}}
1
+ function a177_0xa212(_0x1deddf,_0x40214d){_0x1deddf=_0x1deddf-0x16e;const _0x18c42f=a177_0x18c4();let _0xa2120c=_0x18c42f[_0x1deddf];return _0xa2120c;}(function(_0x310c77,_0x2e8c95){const _0x4be32a=a177_0xa212,_0x2cfd3a=_0x310c77();while(!![]){try{const _0x516255=-parseInt(_0x4be32a(0x186))/0x1+parseInt(_0x4be32a(0x18b))/0x2+parseInt(_0x4be32a(0x195))/0x3+parseInt(_0x4be32a(0x179))/0x4+parseInt(_0x4be32a(0x174))/0x5+-parseInt(_0x4be32a(0x176))/0x6+-parseInt(_0x4be32a(0x191))/0x7;if(_0x516255===_0x2e8c95)break;else _0x2cfd3a['push'](_0x2cfd3a['shift']());}catch(_0x5203ab){_0x2cfd3a['push'](_0x2cfd3a['shift']());}}}(a177_0x18c4,0x28eec));import{formatRows,hyperlink}from'./formatters.js';function a177_0x18c4(){const _0x3c04a1=['10576bNKdRF','population','children','folder','journey','(completed)','513107JcYaZl','\x20journey','🎯\x20','\x20folder','234396xRnZct','sortKey','(draft)','push','type','icon','displayName','🗺️','segmentCount','getJourneyUrl','\x20\x20\x20\x20','🗺️\x20','base','journeyCount','showTreeLines','showMetadata','draft','784410fohFLR','├──\x20','65886bsShYC','completed','📁\x20','1205160pcAOfc','(running)','segment','└──\x20','state','metadata','folderCount','map','join','showIcons','(empty)','dim','name','289650ppKzDv','getSegmentUrl','length','journeyBundleName','localeCompare'];a177_0x18c4=function(){return _0x3c04a1;};return a177_0x18c4();}import a177_0x1140a1 from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};export function formatTree(_0x2381ea,_0x24183e={},_0x51e8a3=0x0,_0x540028=''){const _0x21a6e0=a177_0xa212,_0x371535={...DEFAULT_OPTIONS,..._0x24183e},_0x57d4bc=[],_0xfd97d3=[..._0x2381ea]['sort']((_0x431f37,_0x3ae2d6)=>_0x431f37[_0x21a6e0(0x185)][_0x21a6e0(0x18a)](_0x3ae2d6['name'],undefined,{'sensitivity':'base'}));for(let _0x56e0bc=0x0;_0x56e0bc<_0xfd97d3[_0x21a6e0(0x188)];_0x56e0bc++){const _0x58604f=_0xfd97d3[_0x56e0bc],_0x258dd8=_0x56e0bc===_0xfd97d3['length']-0x1;let _0x9e1af4='';_0x51e8a3>0x0&&(_0x9e1af4+=_0x540028);_0x371535['showTreeLines']&&_0x51e8a3>0x0&&(_0x9e1af4+=a177_0x1140a1['dim'](_0x258dd8?_0x21a6e0(0x17c):_0x21a6e0(0x175)));if(_0x371535['showIcons']){if(_0x58604f[_0x21a6e0(0x199)]===_0x21a6e0(0x18e))_0x9e1af4+=_0x21a6e0(0x178);else _0x58604f['type']===_0x21a6e0(0x18f)?_0x9e1af4+=_0x21a6e0(0x16e):_0x9e1af4+=_0x21a6e0(0x193);}if(_0x371535[_0x21a6e0(0x187)]&&_0x58604f[_0x21a6e0(0x199)]===_0x21a6e0(0x17b))_0x9e1af4+=hyperlink(_0x58604f[_0x21a6e0(0x185)],_0x371535[_0x21a6e0(0x187)](_0x58604f['id']));else _0x371535[_0x21a6e0(0x19e)]&&_0x58604f[_0x21a6e0(0x199)]==='journey'?_0x9e1af4+=hyperlink(_0x58604f[_0x21a6e0(0x185)],_0x371535['getJourneyUrl'](_0x58604f['id'])):_0x9e1af4+=_0x58604f['name'];if(_0x371535['showMetadata']){if(_0x58604f[_0x21a6e0(0x199)]===_0x21a6e0(0x18e)){const _0x3938aa=[];_0x58604f['metadata'][_0x21a6e0(0x19d)]&&_0x3938aa[_0x21a6e0(0x198)](_0x58604f[_0x21a6e0(0x17e)]['segmentCount']+'\x20segment'+(_0x58604f[_0x21a6e0(0x17e)][_0x21a6e0(0x19d)]!==0x1?'s':'')),_0x58604f[_0x21a6e0(0x17e)][_0x21a6e0(0x17f)]&&_0x3938aa[_0x21a6e0(0x198)](_0x58604f[_0x21a6e0(0x17e)][_0x21a6e0(0x17f)]+_0x21a6e0(0x194)+(_0x58604f['metadata'][_0x21a6e0(0x17f)]!==0x1?'s':'')),_0x58604f[_0x21a6e0(0x17e)][_0x21a6e0(0x170)]&&_0x3938aa['push'](_0x58604f['metadata'][_0x21a6e0(0x170)]+_0x21a6e0(0x192)+(_0x58604f['metadata'][_0x21a6e0(0x170)]!==0x1?'s':'')),_0x3938aa[_0x21a6e0(0x188)]>0x0&&(_0x9e1af4+=a177_0x1140a1[_0x21a6e0(0x184)]('\x20('+_0x3938aa[_0x21a6e0(0x181)](',\x20')+')'));}else{if(_0x58604f[_0x21a6e0(0x199)]===_0x21a6e0(0x17b)&&_0x58604f[_0x21a6e0(0x18c)]!==undefined)_0x9e1af4+=a177_0x1140a1['dim']('\x20('+formatRows(_0x58604f['population'])+')');else _0x58604f[_0x21a6e0(0x199)]===_0x21a6e0(0x18f)&&_0x58604f['state']&&(_0x9e1af4+=a177_0x1140a1[_0x21a6e0(0x184)]('\x20'+getJourneyStateIndicator(_0x58604f['state'])));}}_0x57d4bc['push'](_0x9e1af4);if(_0x58604f[_0x21a6e0(0x18d)]&&_0x58604f['children'][_0x21a6e0(0x188)]>0x0){let _0x11683e;if(_0x51e8a3===0x0)_0x11683e='';else _0x371535[_0x21a6e0(0x171)]?_0x11683e=_0x540028+(_0x258dd8?_0x21a6e0(0x19f):a177_0x1140a1[_0x21a6e0(0x184)]('│')+'\x20\x20\x20'):_0x11683e=_0x540028+_0x371535['indent'];const _0x1b2da7=formatTree(_0x58604f[_0x21a6e0(0x18d)],_0x371535,_0x51e8a3+0x1,_0x11683e);_0x57d4bc[_0x21a6e0(0x198)](_0x1b2da7);}}return _0x57d4bc[_0x21a6e0(0x181)]('\x0a');}export function formatFlatList(_0x163cad,_0x4c943a,_0x8ba79b={},_0x295faf=[]){const _0x4d1b8e=a177_0xa212,_0x3dbca5={...DEFAULT_OPTIONS,..._0x8ba79b},_0x4ee4f1=[];for(const _0x59f022 of _0x163cad){_0x4ee4f1['push']({'sortKey':_0x59f022[_0x4d1b8e(0x185)],'displayName':_0x59f022['name'],'icon':_0x3dbca5['showIcons']?'📁':'','metadata':undefined});}for(const _0x45b173 of _0x4c943a){const _0x2ad2b1=_0x3dbca5[_0x4d1b8e(0x172)]&&_0x45b173[_0x4d1b8e(0x18c)]!==undefined?a177_0x1140a1[_0x4d1b8e(0x184)]('\x20('+formatRows(_0x45b173[_0x4d1b8e(0x18c)])+')'):'',_0x372325=_0x3dbca5[_0x4d1b8e(0x187)]?hyperlink(_0x45b173[_0x4d1b8e(0x185)],_0x3dbca5[_0x4d1b8e(0x187)](_0x45b173['id'])):_0x45b173[_0x4d1b8e(0x185)];_0x4ee4f1[_0x4d1b8e(0x198)]({'sortKey':_0x45b173['name'],'displayName':_0x372325,'icon':_0x3dbca5['showIcons']?'🎯':'','metadata':_0x2ad2b1});}for(const _0x2497bf of _0x295faf){const _0x38f2d4=getJourneyStateIndicator(_0x2497bf[_0x4d1b8e(0x17d)]),_0xeaf6bf=_0x3dbca5['showMetadata']?a177_0x1140a1[_0x4d1b8e(0x184)]('\x20'+_0x38f2d4):'',_0x1e27bb=_0x3dbca5['getJourneyUrl']?hyperlink(_0x2497bf[_0x4d1b8e(0x189)],_0x3dbca5[_0x4d1b8e(0x19e)](_0x2497bf['id'])):_0x2497bf[_0x4d1b8e(0x189)];_0x4ee4f1[_0x4d1b8e(0x198)]({'sortKey':_0x2497bf['journeyBundleName'],'displayName':_0x1e27bb,'icon':_0x3dbca5[_0x4d1b8e(0x182)]?_0x4d1b8e(0x19c):'','metadata':_0xeaf6bf});}_0x4ee4f1['sort']((_0x5e1695,_0x745992)=>_0x5e1695[_0x4d1b8e(0x196)][_0x4d1b8e(0x18a)](_0x745992['sortKey'],undefined,{'sensitivity':_0x4d1b8e(0x16f)}));if(_0x4ee4f1['length']===0x0)return _0x4d1b8e(0x183);const _0x358cd0=_0x4ee4f1[_0x4d1b8e(0x180)](_0x310bc5=>{const _0x2a57c3=_0x4d1b8e,_0x583be5=_0x310bc5[_0x2a57c3(0x19a)]?_0x310bc5['icon']+'\x20':'',_0x347cf2=_0x310bc5[_0x2a57c3(0x17e)]||'';return''+_0x583be5+_0x310bc5[_0x2a57c3(0x19b)]+_0x347cf2;});return _0x358cd0[_0x4d1b8e(0x181)]('\x0a');}function getJourneyStateIndicator(_0x11bf57){const _0x382826=a177_0xa212;switch(_0x11bf57){case _0x382826(0x173):return _0x382826(0x197);case'launched':return _0x382826(0x17a);case'paused':return'(paused)';case _0x382826(0x177):return _0x382826(0x190);default:return'('+_0x11bf57+')';}}
@@ -1 +1 @@
1
- const a178_0x1c80eb=a178_0x5a26;(function(_0x4cddb1,_0x2fef4e){const _0x3c58db=a178_0x5a26,_0x47b5ba=_0x4cddb1();while(!![]){try{const _0x13eff8=parseInt(_0x3c58db(0x134))/0x1*(parseInt(_0x3c58db(0x12f))/0x2)+parseInt(_0x3c58db(0x11a))/0x3*(-parseInt(_0x3c58db(0x12a))/0x4)+parseInt(_0x3c58db(0x11e))/0x5*(-parseInt(_0x3c58db(0x125))/0x6)+-parseInt(_0x3c58db(0x11d))/0x7*(-parseInt(_0x3c58db(0x120))/0x8)+parseInt(_0x3c58db(0x12d))/0x9*(-parseInt(_0x3c58db(0x138))/0xa)+-parseInt(_0x3c58db(0x11c))/0xb*(parseInt(_0x3c58db(0x130))/0xc)+parseInt(_0x3c58db(0x129))/0xd;if(_0x13eff8===_0x2fef4e)break;else _0x47b5ba['push'](_0x47b5ba['shift']());}catch(_0x16a0d4){_0x47b5ba['push'](_0x47b5ba['shift']());}}}(a178_0x5044,0xad4db));function a178_0x5044(){const _0x576213=['...','split','error','2010DLOqri','trim','(empty\x20response)','WORKFLOW_ARCHIVE_CORRUPTED','41416960ZsbLDG','16dHuxGt','helpText','utf-8','9FoWzUD','charCodeAt','6YmhEnd','7548DIquKK','slice','subarray','The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.','40019pSDKBI','length','filter','toString','3786820hWhKWb','Archive\x20validation\x20failed\x20with\x20unknown\x20error','Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.','1041645ufKEiT','\x20Server\x20response\x20preview:\x20','17039MBWqQL','161FygOSt','4570UDCXVX','from','157192dQcLKv','equals'];a178_0x5044=function(){return _0x576213;};return a178_0x5044();}function a178_0x5a26(_0x44edf0,_0x1ff1b3){_0x44edf0=_0x44edf0-0x11a;const _0x5044d9=a178_0x5044();let _0x5a262c=_0x5044d9[_0x44edf0];return _0x5a262c;}import{SDKError,ErrorCode}from'../errors.js';const GZIP_MAGIC=Buffer[a178_0x1c80eb(0x11f)]([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x5d8ea1){const _0x36cd60=a178_0x1c80eb;if(_0x5d8ea1[_0x36cd60(0x135)]<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x5d8ea1[_0x36cd60(0x135)],'error':{'message':'Downloaded\x20archive\x20is\x20too\x20small\x20('+_0x5d8ea1[_0x36cd60(0x135)]+'\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.','preview':getContentPreview(_0x5d8ea1),'helpText':'Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.'}};if(!_0x5d8ea1[_0x36cd60(0x132)](0x0,0x2)[_0x36cd60(0x121)](GZIP_MAGIC)){const _0x3c9a74=getContentPreview(_0x5d8ea1),_0x42e592=_0x3c9a74?_0x36cd60(0x11b)+_0x3c9a74:'';return{'isValid':![],'size':_0x5d8ea1[_0x36cd60(0x135)],'error':{'message':_0x36cd60(0x13a)+_0x42e592,'preview':_0x3c9a74,'helpText':_0x36cd60(0x133)}};}return{'isValid':!![],'size':_0x5d8ea1[_0x36cd60(0x135)]};}function getContentPreview(_0x10b63b){const _0x43e084=a178_0x1c80eb;if(_0x10b63b[_0x43e084(0x135)]===0x0)return _0x43e084(0x127);const _0x19df0a=_0x10b63b[_0x43e084(0x132)](0x0,0xc8)[_0x43e084(0x137)](_0x43e084(0x12c)),_0x1aefac=_0x19df0a[_0x43e084(0x123)]('')[_0x43e084(0x136)](_0x4999b5=>{const _0x21ed53=_0x43e084,_0x13ed03=_0x4999b5[_0x21ed53(0x12e)](0x0);return _0x13ed03>=0x20&&_0x13ed03<0x7f||_0x13ed03===0xa||_0x13ed03===0xd||_0x13ed03===0x9;})[_0x43e084(0x135)],_0x4fdceb=_0x1aefac/_0x19df0a['length'];if(_0x4fdceb>0.8){const _0x252c02=_0x19df0a[_0x43e084(0x131)](0x0,0x64)[_0x43e084(0x126)]();return _0x252c02[_0x43e084(0x135)]<_0x19df0a[_0x43e084(0x126)]()['length']?_0x252c02+_0x43e084(0x122):_0x252c02;}return undefined;}export function throwArchiveValidationError(_0x5c5bf3){const _0xf4e51d=a178_0x1c80eb;if(!_0x5c5bf3[_0xf4e51d(0x124)])throw new SDKError(ErrorCode[_0xf4e51d(0x128)],_0xf4e51d(0x139));throw new SDKError(ErrorCode[_0xf4e51d(0x128)],_0x5c5bf3[_0xf4e51d(0x124)]['message'],undefined,{'helpText':_0x5c5bf3[_0xf4e51d(0x124)][_0xf4e51d(0x12b)]});}
1
+ (function(_0x6e7704,_0x1b0c33){const _0x301283=a178_0x127b,_0x31c141=_0x6e7704();while(!![]){try{const _0x3135f9=-parseInt(_0x301283(0x1f6))/0x1*(-parseInt(_0x301283(0x200))/0x2)+parseInt(_0x301283(0x1f5))/0x3+-parseInt(_0x301283(0x1f2))/0x4+parseInt(_0x301283(0x1f1))/0x5+-parseInt(_0x301283(0x1ed))/0x6*(parseInt(_0x301283(0x204))/0x7)+parseInt(_0x301283(0x202))/0x8*(-parseInt(_0x301283(0x1f4))/0x9)+parseInt(_0x301283(0x1ef))/0xa;if(_0x3135f9===_0x1b0c33)break;else _0x31c141['push'](_0x31c141['shift']());}catch(_0xac7474){_0x31c141['push'](_0x31c141['shift']());}}}(a178_0x1ee4,0xd9c04));function a178_0x1ee4(){const _0x15ecfd=['WORKFLOW_ARCHIVE_CORRUPTED','460810vQtIyi','1262080LcYsaf','error','9gnQESo','2985675MjoiAg','945827oVgacT','Archive\x20validation\x20failed\x20with\x20unknown\x20error','slice','Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.','subarray','split','\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.','trim','length','utf-8','2xfdYQh','...','2830472dsEAaz','\x20Server\x20response\x20preview:\x20','2854887RMHnxF','message','toString','12bKMGeT','filter','3437050YVNOAQ'];a178_0x1ee4=function(){return _0x15ecfd;};return a178_0x1ee4();}import{SDKError,ErrorCode}from'../errors.js';function a178_0x127b(_0x178b68,_0x26629b){_0x178b68=_0x178b68-0x1eb;const _0x1ee4f6=a178_0x1ee4();let _0x127b04=_0x1ee4f6[_0x178b68];return _0x127b04;}const GZIP_MAGIC=Buffer['from']([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x1144af){const _0x30fa89=a178_0x127b;if(_0x1144af[_0x30fa89(0x1fe)]<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x1144af[_0x30fa89(0x1fe)],'error':{'message':'Downloaded\x20archive\x20is\x20too\x20small\x20('+_0x1144af[_0x30fa89(0x1fe)]+_0x30fa89(0x1fc),'preview':getContentPreview(_0x1144af),'helpText':'Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.'}};if(!_0x1144af[_0x30fa89(0x1fa)](0x0,0x2)['equals'](GZIP_MAGIC)){const _0xb2b758=getContentPreview(_0x1144af),_0x22d4a3=_0xb2b758?_0x30fa89(0x203)+_0xb2b758:'';return{'isValid':![],'size':_0x1144af[_0x30fa89(0x1fe)],'error':{'message':_0x30fa89(0x1f9)+_0x22d4a3,'preview':_0xb2b758,'helpText':'The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.'}};}return{'isValid':!![],'size':_0x1144af[_0x30fa89(0x1fe)]};}function getContentPreview(_0x3915f5){const _0x43d1c7=a178_0x127b;if(_0x3915f5[_0x43d1c7(0x1fe)]===0x0)return'(empty\x20response)';const _0xb2ad65=_0x3915f5[_0x43d1c7(0x1fa)](0x0,0xc8)[_0x43d1c7(0x1ec)](_0x43d1c7(0x1ff)),_0x22c363=_0xb2ad65[_0x43d1c7(0x1fb)]('')[_0x43d1c7(0x1ee)](_0x51c366=>{const _0x16745f=_0x51c366['charCodeAt'](0x0);return _0x16745f>=0x20&&_0x16745f<0x7f||_0x16745f===0xa||_0x16745f===0xd||_0x16745f===0x9;})['length'],_0x542947=_0x22c363/_0xb2ad65['length'];if(_0x542947>0.8){const _0x10380a=_0xb2ad65[_0x43d1c7(0x1f8)](0x0,0x64)[_0x43d1c7(0x1fd)]();return _0x10380a['length']<_0xb2ad65[_0x43d1c7(0x1fd)]()[_0x43d1c7(0x1fe)]?_0x10380a+_0x43d1c7(0x201):_0x10380a;}return undefined;}export function throwArchiveValidationError(_0x28f3ff){const _0x95cdd7=a178_0x127b;if(!_0x28f3ff['error'])throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x95cdd7(0x1f7));throw new SDKError(ErrorCode[_0x95cdd7(0x1f0)],_0x28f3ff[_0x95cdd7(0x1f3)][_0x95cdd7(0x1eb)],undefined,{'helpText':_0x28f3ff['error']['helpText']});}
@@ -1 +1 @@
1
- (function(_0xef9ba2,_0x1ad03c){const _0x13f0fb=a179_0x69ed,_0x17cf53=_0xef9ba2();while(!![]){try{const _0x30df24=parseInt(_0x13f0fb(0x14a))/0x1+parseInt(_0x13f0fb(0x163))/0x2*(parseInt(_0x13f0fb(0x153))/0x3)+parseInt(_0x13f0fb(0x15f))/0x4+parseInt(_0x13f0fb(0x15a))/0x5+parseInt(_0x13f0fb(0x150))/0x6*(-parseInt(_0x13f0fb(0x14c))/0x7)+parseInt(_0x13f0fb(0x149))/0x8+-parseInt(_0x13f0fb(0x15d))/0x9*(parseInt(_0x13f0fb(0x148))/0xa);if(_0x30df24===_0x1ad03c)break;else _0x17cf53['push'](_0x17cf53['shift']());}catch(_0x3d75d7){_0x17cf53['push'](_0x17cf53['shift']());}}}(a179_0x1f68,0x36fa7));import{promises as a179_0x2b0aec}from'fs';function a179_0x69ed(_0x1cd558,_0x2cc4f1){_0x1cd558=_0x1cd558-0x148;const _0x1f6814=a179_0x1f68();let _0x69ed56=_0x1f6814[_0x1cd558];return _0x69ed56;}import a179_0x563523 from'path';import a179_0x3e857d from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';function a179_0x1f68(){const _0x1b00e4=['skipValidation','436470NFHsJH','push','tdx.json','resolve','mkdtemp','tdx-wf-clone-','join','561760FvUqnc','sourceDir','replace','72gNWKqw','toISOString','450812VnXFwZ','endsWith','revision','length','2uiLUOA','create','uploadProjectArchive','newProjectName','264430YrBVsT','2733504vVqOzx','90754GTXAWC','No\x20','161joKWYY','data','readdir','find','95544UjCIRA','name'];a179_0x1f68=function(){return _0x1b00e4;};return a179_0x1f68();}export async function prepareCloneWorkflow(_0x48f588,_0x583a5b,_0x142947,_0x54809d={}){const _0x323e9c=a179_0x69ed,{client:_0x13b5f1}=_0x48f588,_0x193450=a179_0x563523[_0x323e9c(0x156)](_0x583a5b);try{await a179_0x2b0aec['access'](_0x193450);}catch{throw new Error('Source\x20directory\x20not\x20found:\x20'+_0x583a5b);}const _0xea924=tryFindWorkflowTdxConfig(_0x193450),_0x273450=_0xea924?.['config']['workflow_project'],_0x4c1c25=_0x54809d['revision']||new Date()[_0x323e9c(0x15e)]()[_0x323e9c(0x15c)](/[:.]/g,'-');if(!_0x54809d[_0x323e9c(0x152)]){const _0x16154c=await a179_0x2b0aec[_0x323e9c(0x14e)](_0x193450),_0x4d7721=_0x16154c['filter'](_0x262431=>_0x262431[_0x323e9c(0x160)](WORKFLOW_FILE_EXTENSION));if(_0x4d7721['length']===0x0)throw new Error(_0x323e9c(0x14b)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20'+_0x193450);}const _0x1464d0=await getProjectFiles(_0x193450);let _0x3775ec=![],_0x10cb5a;try{const _0x143b71=await _0x13b5f1['listProjects']({'name_pattern':_0x142947}),_0x5558f0=_0x143b71[_0x323e9c(0x14d)][_0x323e9c(0x14f)](_0x254a27=>_0x254a27['name']===_0x142947);_0x5558f0&&(_0x3775ec=!![],_0x10cb5a=_0x5558f0['id']);}catch{}return{'sourceDir':_0x193450,'sourceProjectName':_0x273450,'newProjectName':_0x142947,'revision':_0x4c1c25,'fileCount':_0x1464d0[_0x323e9c(0x162)],'files':_0x1464d0,'targetExists':_0x3775ec,'existingProjectId':_0x10cb5a};}export async function executeCloneWorkflow(_0x3f4cf9,_0x1b9760){const _0x3be87f=a179_0x69ed,_0x2a4ff4=await import('tar'),{client:_0x1ddaa5}=_0x3f4cf9,_0x749437=await getProjectFiles(_0x1b9760[_0x3be87f(0x15b)]),_0x2bd4bd=await a179_0x2b0aec[_0x3be87f(0x157)](a179_0x563523['join'](a179_0x3e857d['tmpdir'](),_0x3be87f(0x158))),_0x374980=a179_0x563523[_0x3be87f(0x159)](_0x2bd4bd,'archive.tar.gz');try{await _0x2a4ff4[_0x3be87f(0x164)]({'file':_0x374980,'gzip':!![],'cwd':_0x1b9760[_0x3be87f(0x15b)],'portable':!![]},_0x749437);const _0x31bcfa=await _0x1ddaa5[_0x3be87f(0x165)](_0x1b9760[_0x3be87f(0x166)],_0x1b9760[_0x3be87f(0x161)],_0x374980);return{'sourceDir':_0x1b9760[_0x3be87f(0x15b)],'sourceProjectName':_0x1b9760['sourceProjectName'],'newProjectName':_0x31bcfa[_0x3be87f(0x151)],'newProjectId':_0x31bcfa['id'],'revision':_0x31bcfa[_0x3be87f(0x161)],'fileCount':_0x749437[_0x3be87f(0x162)],'files':_0x749437};}finally{await a179_0x2b0aec['rm'](_0x2bd4bd,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x359a81,_0x27dd1a=''){const _0x12db1c=a179_0x69ed,_0x41dc59=[],_0x469354=await a179_0x2b0aec[_0x12db1c(0x14e)](_0x359a81,{'withFileTypes':!![]});for(const _0x1c4515 of _0x469354){const _0x1a8bb2=_0x27dd1a?a179_0x563523[_0x12db1c(0x159)](_0x27dd1a,_0x1c4515['name']):_0x1c4515[_0x12db1c(0x151)];if(_0x1c4515[_0x12db1c(0x151)]===_0x12db1c(0x155))continue;if(!shouldIncludeInArchive(_0x1c4515[_0x12db1c(0x151)]))continue;if(_0x1c4515['isDirectory']()){const _0x3253db=await getProjectFiles(a179_0x563523[_0x12db1c(0x159)](_0x359a81,_0x1c4515[_0x12db1c(0x151)]),_0x1a8bb2);_0x41dc59[_0x12db1c(0x154)](..._0x3253db);}else _0x41dc59[_0x12db1c(0x154)](_0x1a8bb2);}return _0x41dc59;}
1
+ (function(_0x5854e5,_0x5ce08a){const _0x4d89f2=a179_0x1bdf,_0x29b979=_0x5854e5();while(!![]){try{const _0x5d4cc6=parseInt(_0x4d89f2(0xb3))/0x1+-parseInt(_0x4d89f2(0xad))/0x2+parseInt(_0x4d89f2(0xa8))/0x3*(parseInt(_0x4d89f2(0xb1))/0x4)+parseInt(_0x4d89f2(0xb5))/0x5+parseInt(_0x4d89f2(0xc4))/0x6*(parseInt(_0x4d89f2(0xb9))/0x7)+-parseInt(_0x4d89f2(0xc3))/0x8*(parseInt(_0x4d89f2(0xbd))/0x9)+parseInt(_0x4d89f2(0xba))/0xa;if(_0x5d4cc6===_0x5ce08a)break;else _0x29b979['push'](_0x29b979['shift']());}catch(_0x3a4c10){_0x29b979['push'](_0x29b979['shift']());}}}(a179_0xe4e8,0x5f92e));function a179_0xe4e8(){const _0x384a1f=['name','641032OeTKek','tdx-wf-clone-','35188JZEbOY','filter','3611185ZeVMTp','isDirectory','join','readdir','41965uzRelT','3685430iusVjW','create','push','9dTeoPK','listProjects','length','replace','revision','newProjectName','4637176SVFNLY','426LXeygC','sourceProjectName','tdx.json','mkdtemp','config','access','tar','tmpdir','uploadProjectArchive','data','3zGzptm','skipValidation','resolve','endsWith','sourceDir','1481508eMzEYs','toISOString','\x20workflow\x20files\x20found\x20in\x20'];a179_0xe4e8=function(){return _0x384a1f;};return a179_0xe4e8();}import{promises as a179_0x23ac13}from'fs';import a179_0x7c1462 from'path';function a179_0x1bdf(_0x1b485f,_0x388cf7){_0x1b485f=_0x1b485f-0xa0;const _0xe4e8f4=a179_0xe4e8();let _0x1bdff3=_0xe4e8f4[_0x1b485f];return _0x1bdff3;}import a179_0x3c7aa7 from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';export async function prepareCloneWorkflow(_0x527195,_0x5c403,_0x4dc195,_0x412423={}){const _0x4d274a=a179_0x1bdf,{client:_0x124be8}=_0x527195,_0x3db087=a179_0x7c1462[_0x4d274a(0xaa)](_0x5c403);try{await a179_0x23ac13[_0x4d274a(0xa3)](_0x3db087);}catch{throw new Error('Source\x20directory\x20not\x20found:\x20'+_0x5c403);}const _0x3605cf=tryFindWorkflowTdxConfig(_0x3db087),_0x3ce5d2=_0x3605cf?.[_0x4d274a(0xa2)]['workflow_project'],_0x583ed3=_0x412423[_0x4d274a(0xc1)]||new Date()[_0x4d274a(0xae)]()[_0x4d274a(0xc0)](/[:.]/g,'-');if(!_0x412423[_0x4d274a(0xa9)]){const _0x361202=await a179_0x23ac13[_0x4d274a(0xb8)](_0x3db087),_0x58c778=_0x361202[_0x4d274a(0xb4)](_0x49397a=>_0x49397a[_0x4d274a(0xab)](WORKFLOW_FILE_EXTENSION));if(_0x58c778['length']===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+_0x4d274a(0xaf)+_0x3db087);}const _0x1122ac=await getProjectFiles(_0x3db087);let _0x117496=![],_0x31b188;try{const _0x16dc84=await _0x124be8[_0x4d274a(0xbe)]({'name_pattern':_0x4dc195}),_0x3ede13=_0x16dc84[_0x4d274a(0xa7)]['find'](_0x1d3431=>_0x1d3431[_0x4d274a(0xb0)]===_0x4dc195);_0x3ede13&&(_0x117496=!![],_0x31b188=_0x3ede13['id']);}catch{}return{'sourceDir':_0x3db087,'sourceProjectName':_0x3ce5d2,'newProjectName':_0x4dc195,'revision':_0x583ed3,'fileCount':_0x1122ac[_0x4d274a(0xbf)],'files':_0x1122ac,'targetExists':_0x117496,'existingProjectId':_0x31b188};}export async function executeCloneWorkflow(_0x10bc0b,_0x3f404b){const _0x4bcab4=a179_0x1bdf,_0x38ab6a=await import(_0x4bcab4(0xa4)),{client:_0x42567c}=_0x10bc0b,_0x5a25f1=await getProjectFiles(_0x3f404b[_0x4bcab4(0xac)]),_0x4e6d1b=await a179_0x23ac13[_0x4bcab4(0xa1)](a179_0x7c1462[_0x4bcab4(0xb7)](a179_0x3c7aa7[_0x4bcab4(0xa5)](),_0x4bcab4(0xb2))),_0x130878=a179_0x7c1462[_0x4bcab4(0xb7)](_0x4e6d1b,'archive.tar.gz');try{await _0x38ab6a[_0x4bcab4(0xbb)]({'file':_0x130878,'gzip':!![],'cwd':_0x3f404b['sourceDir'],'portable':!![]},_0x5a25f1);const _0x5a72df=await _0x42567c[_0x4bcab4(0xa6)](_0x3f404b[_0x4bcab4(0xc2)],_0x3f404b[_0x4bcab4(0xc1)],_0x130878);return{'sourceDir':_0x3f404b[_0x4bcab4(0xac)],'sourceProjectName':_0x3f404b[_0x4bcab4(0xc5)],'newProjectName':_0x5a72df['name'],'newProjectId':_0x5a72df['id'],'revision':_0x5a72df[_0x4bcab4(0xc1)],'fileCount':_0x5a25f1['length'],'files':_0x5a25f1};}finally{await a179_0x23ac13['rm'](_0x4e6d1b,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x9901fe,_0x58ad24=''){const _0x2ba542=a179_0x1bdf,_0x486fe1=[],_0x4def0a=await a179_0x23ac13[_0x2ba542(0xb8)](_0x9901fe,{'withFileTypes':!![]});for(const _0x380955 of _0x4def0a){const _0x3f30c1=_0x58ad24?a179_0x7c1462[_0x2ba542(0xb7)](_0x58ad24,_0x380955[_0x2ba542(0xb0)]):_0x380955['name'];if(_0x380955[_0x2ba542(0xb0)]===_0x2ba542(0xa0))continue;if(!shouldIncludeInArchive(_0x380955['name']))continue;if(_0x380955[_0x2ba542(0xb6)]()){const _0x547566=await getProjectFiles(a179_0x7c1462[_0x2ba542(0xb7)](_0x9901fe,_0x380955[_0x2ba542(0xb0)]),_0x3f30c1);_0x486fe1[_0x2ba542(0xbc)](..._0x547566);}else _0x486fe1[_0x2ba542(0xbc)](_0x3f30c1);}return _0x486fe1;}
@@ -1 +1 @@
1
- function a180_0x10b0(_0x554748,_0xf9b777){_0x554748=_0x554748-0x9a;const _0x136566=a180_0x1365();let _0x10b04d=_0x136566[_0x554748];return _0x10b04d;}const a180_0x53c093=a180_0x10b0;(function(_0xf09915,_0x4af965){const _0x470c90=a180_0x10b0,_0x2a30d8=_0xf09915();while(!![]){try{const _0x4d3cf0=parseInt(_0x470c90(0xea))/0x1*(parseInt(_0x470c90(0xb3))/0x2)+parseInt(_0x470c90(0xed))/0x3+-parseInt(_0x470c90(0xde))/0x4+-parseInt(_0x470c90(0x9a))/0x5+parseInt(_0x470c90(0xbd))/0x6+parseInt(_0x470c90(0x108))/0x7+-parseInt(_0x470c90(0xf9))/0x8;if(_0x4d3cf0===_0x4af965)break;else _0x2a30d8['push'](_0x2a30d8['shift']());}catch(_0x47566c){_0x2a30d8['push'](_0x2a30d8['shift']());}}}(a180_0x1365,0xc02c2));import{WorkflowApiClient}from'../client/workflow-client.js';function a180_0x1365(){const _0x4ae0db=['3613KKwdzz','unlink','length','4171527WjAiHg','deleteProject','projectName','from','push','fullName','isGroup','bind','preparePushProject','parentId','indexOf','map','14734336WsSsNY','toString','listProjects','min','lastId','Failed\x20to\x20download\x20log\x20file:\x20','direct','getAttempt','\x20workflow\x20files\x20found\x20in\x20project\x20directory','tdx-workflow-','executePushProject','retrySession','getProject','listAttempts','kill','7509614VGNWuQ','setSecret','listLogFiles','Failed\x20to\x20set\x20secret','includeRetried','executeCloneProject','access','sessions','NUMERIC_ID_PATTERN','killAttempt','deleteSecret','attempt','slice','utf-8','fromTime','sessionUuid','listWorkflows','applyPullProject','state','workflows','lastAttempt','Kill\x20request\x20accepted','tmpdir','Cannot\x20read\x20workflow\x20file:\x20','3856310byMYhj','createdAt','last_id','workflow','isDirectory','downloadProjectArchive','extract','gunzip','endsWith','pullProject','cancelRequested','force','name','tar','isFile','basename','rawCount','listSecrets','Project\x20not\x20found:\x20','prepareCloneProject','tasks','toTime','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','listSessions','retryAttemptName','514fAafGb','path','WORKFLOW_PROJECT_NOT_FOUND','exportParams','finishedAt','clearSchedule','retryAttempt','toISOString','status','stateParams','5008764xWWAnW','delete','revision','test','find','keys','Project\x20directory\x20not\x20found:\x20','logFiles','join','config','sessionTime','resolveProjectId','No\x20','sessionId','skipValidation','error','.tar.gz','create','success','clearScheduleAll','startedAt','retryParams','uploadProjectArchive','util','done','setSecrets','index','latest','run','download','now','projects','allSettled','3305816jTJNRo','Invalid\x20workflow\x20format:\x20','substring','readdir','project','updatedAt','limit','params','client','retryAt','filter','data'];a180_0x1365=function(){return _0x4ae0db;};return a180_0x1365();}import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x1f778b,_0x4c11ed,_0x4fb1f1=0x64){const _0x179158=a180_0x10b0,_0x4cfe6c=Math[_0x179158(0xfc)](_0x4c11ed,MAX_PAGINATION_LIMIT),_0x37e917=[];let _0x5b1602;while(_0x37e917[_0x179158(0xec)]<_0x4cfe6c){const _0x43b36e=await _0x1f778b(_0x4fb1f1,_0x5b1602),_0x598aac=_0x43b36e[_0x179158(0xaa)]??_0x43b36e[_0x179158(0xe9)][_0x179158(0xec)];if(_0x598aac===0x0)break;_0x37e917[_0x179158(0xf1)](..._0x43b36e['data']);if(!_0x43b36e[_0x179158(0xfd)]||_0x598aac<_0x4fb1f1)break;_0x5b1602=_0x43b36e[_0x179158(0xfd)];}return _0x37e917[_0x179158(0x114)](0x0,_0x4cfe6c);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a180_0x53c093(0x110)]=/^\d+$/;[a180_0x53c093(0xe6)];constructor(_0x52253f){const _0xe9a58e=a180_0x53c093;this[_0xe9a58e(0xe6)]=new WorkflowApiClient(_0x52253f);}async[a180_0x53c093(0xc8)](_0x11817e){const _0x56954a=a180_0x53c093;if(WorkflowSDK['NUMERIC_ID_PATTERN'][_0x56954a(0xc0)](_0x11817e)){const _0x239c79=await this['client'][_0x56954a(0x105)](_0x11817e);return{'id':_0x239c79['id'],'name':_0x239c79[_0x56954a(0xa6)]};}const _0x281e2d=await this[_0x56954a(0xe6)]['listProjects']({'name_pattern':_0x11817e}),_0x31f90c=_0x281e2d[_0x56954a(0xe9)]['find'](_0x49a6a9=>_0x49a6a9['name']===_0x11817e);if(!_0x31f90c)throw new SDKError(ErrorCode[_0x56954a(0xb5)],_0x56954a(0xac)+_0x11817e);return{'id':_0x31f90c['id'],'name':_0x31f90c['name']};}async[a180_0x53c093(0xdc)](_0x158bdb,_0x4147eb){const _0x1032a1=a180_0x53c093,_0x1666b9=_0x4147eb?.[_0x1032a1(0xe4)]||0x64,_0x13e0b5=await paginateResults((_0x5ab103,_0x32a57c)=>this['client'][_0x1032a1(0xfb)]({'name_pattern':_0x158bdb,'limit':_0x5ab103,'last_id':_0x32a57c??_0x4147eb?.['last_id']}),_0x1666b9);return _0x13e0b5[_0x1032a1(0xf8)](_0x5cd2e2=>({..._0x5cd2e2,'project_id':_0x5cd2e2['id'],'project_name':_0x5cd2e2['name']}));}async[a180_0x53c093(0x11b)](_0x3e11c2,_0x12568d){const _0xd99c8e=a180_0x53c093,_0xc5c335=_0x12568d?.[_0xd99c8e(0xe4)]||0x64,_0x1b5d24=await paginateResults((_0x56b068,_0x2e8faf)=>this[_0xd99c8e(0xe6)][_0xd99c8e(0x118)]({'project_name':_0x3e11c2,'limit':_0x56b068,'last_id':_0x2e8faf??_0x12568d?.[_0xd99c8e(0x9c)]}),_0xc5c335);return _0x1b5d24[_0xd99c8e(0xf8)](_0xe808cf=>({'project_id':_0xe808cf[_0xd99c8e(0xe2)]?.['id'],'project_name':_0xe808cf[_0xd99c8e(0xe2)]?.['name'],'workflow_id':_0xe808cf['id'],'workflow_name':_0xe808cf[_0xd99c8e(0xa6)],'revision':_0xe808cf[_0xd99c8e(0xbf)],'timezone':_0xe808cf['timezone'],'config':_0xe808cf[_0xd99c8e(0xc6)],'id':_0xe808cf['id'],'name':_0xe808cf['name'],'project':_0xe808cf['project']}));}async[a180_0x53c093(0x10f)](_0x26068c){const _0x408ec1=a180_0x53c093;let _0x1bc1ad;if(_0x26068c?.[_0x408ec1(0xef)]){let _0x4d41f3,_0x374893=![];while(!_0x374893){const _0x582999=await this['client']['listProjects']({'limit':0x64,'last_id':_0x4d41f3}),_0x4a218a=_0x582999[_0x408ec1(0xe9)][_0x408ec1(0xc1)](_0x32a727=>_0x32a727[_0x408ec1(0xa6)]===_0x26068c[_0x408ec1(0xef)]);if(_0x4a218a){_0x1bc1ad=_0x4a218a['id'],_0x374893=!![];break;}if(!_0x582999[_0x408ec1(0xfd)]||_0x582999[_0x408ec1(0xe9)]['length']===0x0)break;_0x4d41f3=_0x582999[_0x408ec1(0xfd)];}if(!_0x1bc1ad)throw new SDKError(ErrorCode[_0x408ec1(0xb5)],_0x408ec1(0xac)+_0x26068c[_0x408ec1(0xef)]);}const _0xf1c000=_0x26068c?.[_0x408ec1(0xe4)]||0x64,_0x7d7c6a=await paginateResults((_0x15bdff,_0xa70774)=>this['client'][_0x408ec1(0xb1)]({'project_id':_0x1bc1ad,'project_name':_0x26068c?.[_0x408ec1(0xef)],'workflow_name':_0x26068c?.['workflowName'],'status':_0x26068c?.['status'],'from_time':_0x26068c?.[_0x408ec1(0x116)],'to_time':_0x26068c?.[_0x408ec1(0xaf)],'limit':_0x15bdff,'last_id':_0xa70774??_0x26068c?.[_0x408ec1(0x9c)]}),_0xf1c000);return _0x7d7c6a[_0x408ec1(0xf8)](_0x34c8eb=>({'project_id':_0x34c8eb['project']?.['id'],'project_name':_0x34c8eb[_0x408ec1(0xe2)]?.[_0x408ec1(0xa6)],'workflow_id':_0x34c8eb[_0x408ec1(0x9d)]?.['id'],'workflow_name':_0x34c8eb['workflow']?.['name'],'session_id':_0x34c8eb['id'],'sessionUuid':_0x34c8eb[_0x408ec1(0x117)],'sessionTime':_0x34c8eb['sessionTime'],'lastAttempt':_0x34c8eb[_0x408ec1(0x11c)],'id':_0x34c8eb['id'],'project':_0x34c8eb[_0x408ec1(0xe2)],'workflow':_0x34c8eb[_0x408ec1(0x9d)]}));}async['attempts'](_0xcba6f3){const _0x3d72ab=a180_0x53c093,_0x3adc64=_0xcba6f3?.[_0x3d72ab(0xe4)]||0x64,_0x56b697=await paginateResults((_0x20f6cf,_0x3dc7c4)=>this[_0x3d72ab(0xe6)][_0x3d72ab(0x106)]({'project_name':_0xcba6f3?.[_0x3d72ab(0xef)],'workflow_name':_0xcba6f3?.['workflowName'],'include_retried':_0xcba6f3?.[_0x3d72ab(0x10c)],'limit':_0x20f6cf,'last_id':_0x3dc7c4??_0xcba6f3?.[_0x3d72ab(0x9c)]}),_0x3adc64);return _0x56b697[_0x3d72ab(0xf8)](_0x10ffcc=>({'project_id':_0x10ffcc['project']?.['id'],'project_name':_0x10ffcc[_0x3d72ab(0xe2)]?.[_0x3d72ab(0xa6)],'workflow_id':_0x10ffcc[_0x3d72ab(0x9d)]?.['id'],'workflow_name':_0x10ffcc['workflow']?.[_0x3d72ab(0xa6)],'session_id':_0x10ffcc[_0x3d72ab(0xca)],'sessionUuid':_0x10ffcc['sessionUuid'],'sessionTime':_0x10ffcc['sessionTime'],'attempt_id':_0x10ffcc['id'],'attempt_index':_0x10ffcc['index'],'retryAttemptName':_0x10ffcc[_0x3d72ab(0xb2)],'done':_0x10ffcc[_0x3d72ab(0xd5)],'success':_0x10ffcc[_0x3d72ab(0xcf)],'cancelRequested':_0x10ffcc[_0x3d72ab(0xa4)],'params':_0x10ffcc[_0x3d72ab(0xe5)],'createdAt':_0x10ffcc[_0x3d72ab(0x9b)],'finishedAt':_0x10ffcc[_0x3d72ab(0xb7)],'id':_0x10ffcc['id'],'index':_0x10ffcc[_0x3d72ab(0xd7)],'project':_0x10ffcc[_0x3d72ab(0xe2)],'workflow':_0x10ffcc[_0x3d72ab(0x9d)]}));}async[a180_0x53c093(0x113)](_0x514a25){const _0x29a361=a180_0x53c093,_0x970dad=await this[_0x29a361(0xe6)][_0x29a361(0x100)](_0x514a25);return _0x970dad;}async[a180_0x53c093(0xae)](_0x295e9b,_0x4c7295=![]){const _0x356d34=a180_0x53c093,_0x23a06d=await this[_0x356d34(0xe6)]['getAttemptTasks'](_0x295e9b,_0x4c7295);return _0x23a06d[_0x356d34(0xf8)](_0x137396=>({'task_id':_0x137396['id'],'task_name':_0x137396['fullName'],'parentId':_0x137396[_0x356d34(0xf6)],'config':_0x137396[_0x356d34(0xc6)],'upstreams':_0x137396['upstreams'],'state':_0x137396[_0x356d34(0x11a)],'exportParams':_0x137396[_0x356d34(0xb6)],'storeParams':_0x137396['storeParams'],'stateParams':_0x137396[_0x356d34(0xbc)],'updatedAt':_0x137396[_0x356d34(0xe3)],'retryAt':_0x137396[_0x356d34(0xe7)],'startedAt':_0x137396[_0x356d34(0xd1)],'error':_0x137396[_0x356d34(0xcc)],'isGroup':_0x137396[_0x356d34(0xf3)],'id':_0x137396['id'],'fullName':_0x137396[_0x356d34(0xf2)]}));}async[a180_0x53c093(0xc4)](_0x155dad,_0x30b376){const _0x41a5e8=a180_0x53c093;return await this['client'][_0x41a5e8(0x10a)](_0x155dad,_0x30b376);}async['logs'](_0x479dec,_0x24d368){const _0x41b0c2=a180_0x53c093,_0x1408c9=await import('zlib'),{promisify:_0x33f88e}=await import(_0x41b0c2(0xd4)),_0x34e942=_0x33f88e(_0x1408c9[_0x41b0c2(0xa1)]),_0x10774f=await this[_0x41b0c2(0xe6)][_0x41b0c2(0x10a)](_0x479dec,_0x24d368);if(_0x10774f[_0x41b0c2(0xec)]===0x0)return'';const _0x43157a=[];for(const _0x285fe0 of _0x10774f){if(!_0x285fe0['direct'])continue;const _0x29abfc=await fetch(_0x285fe0[_0x41b0c2(0xff)]);if(!_0x29abfc['ok'])throw new Error(_0x41b0c2(0xfe)+_0x29abfc[_0x41b0c2(0xbb)]);const _0x39dbad=Buffer[_0x41b0c2(0xf0)](await _0x29abfc['arrayBuffer']()),_0x292f88=await _0x34e942(_0x39dbad);_0x43157a['push'](_0x292f88[_0x41b0c2(0xfa)](_0x41b0c2(0x115)));}return _0x43157a[_0x41b0c2(0xc5)]('\x0a');}async[a180_0x53c093(0x107)](_0x2fa203,_0x2cc509){const _0x5d6792=a180_0x53c093,_0x449491=await this[_0x5d6792(0xe6)][_0x5d6792(0x111)](_0x2fa203,_0x2cc509);return _0x449491?.['message']??_0x5d6792(0x11d);}async[a180_0x53c093(0x104)](_0x2dd7da,_0x5a7771){const _0x1d08bb=a180_0x53c093,_0x5adf17=await this['client']['retrySession'](_0x2dd7da,{'from_task':_0x5a7771?.['fromTask'],'retry_params':_0x5a7771?.[_0x1d08bb(0xd2)]});return{'attemptId':_0x5adf17['id'],'sessionId':_0x5adf17[_0x1d08bb(0xca)]};}async[a180_0x53c093(0xb9)](_0x38f3ad,_0x2619ba){const _0x4d9159=a180_0x53c093,_0x30f89a=await this[_0x4d9159(0xe6)][_0x4d9159(0xb9)](_0x38f3ad,{'resume_from':_0x2619ba?.['resumeFrom'],'retry_params':_0x2619ba?.['retryParams'],'force':_0x2619ba?.[_0x4d9159(0xa5)]});return{'attemptId':_0x30f89a['id'],'sessionId':_0x30f89a[_0x4d9159(0xca)]};}async[a180_0x53c093(0xd9)](_0xfa353d,_0x2bc03b={},_0x2f9fb9){const _0x463485=a180_0x53c093,_0x55ebb6=_0xfa353d[_0x463485(0xf7)]('.');let _0x167a3b,_0x53fdc7;if(_0x55ebb6===-0x1)throw new Error(_0x463485(0xb0));_0x167a3b=_0xfa353d[_0x463485(0xe0)](0x0,_0x55ebb6),_0x53fdc7=_0xfa353d[_0x463485(0xe0)](_0x55ebb6+0x1);if(!_0x167a3b||!_0x53fdc7)throw new Error(_0x463485(0xdf)+_0xfa353d+'.\x20Expected\x20\x22project.workflow\x22');const _0x233016=_0x2f9fb9?.[_0x463485(0xc7)]||new Date()[_0x463485(0xba)]();return await this[_0x463485(0xe6)]['startAttempt']({'projectName':_0x167a3b,'workflowName':_0x53fdc7,'sessionTime':_0x233016,'params':_0x2bc03b});}async[a180_0x53c093(0xda)](_0x216087,_0x20689d,_0x1d4edd){const _0x5b3f1f=a180_0x53c093,{promises:_0xfaf1f6}=await import('fs'),_0x2873fc=await import('path'),_0x21983a=await import('os'),_0x11a57f=await import(_0x5b3f1f(0xa7)),{id:_0x135557,name:_0x7c0126}=await this[_0x5b3f1f(0xc8)](_0x216087),_0x11fb91=_0x21983a[_0x5b3f1f(0x11e)](),_0x5ecae8=_0x2873fc[_0x5b3f1f(0xc5)](_0x11fb91,_0x5b3f1f(0x102)+_0x135557+'-'+Date[_0x5b3f1f(0xdb)]()+_0x5b3f1f(0xcd));try{await this[_0x5b3f1f(0xe6)][_0x5b3f1f(0x9f)](_0x135557,_0x5ecae8,_0x1d4edd?.[_0x5b3f1f(0xbf)]);const _0x590488=_0x2873fc[_0x5b3f1f(0xc5)](_0x20689d,_0x7c0126);await _0xfaf1f6['mkdir'](_0x590488,{'recursive':!![]}),await _0x11a57f[_0x5b3f1f(0xa0)]({'file':_0x5ecae8,'cwd':_0x590488,'gzip':!![]});const _0x37cfdf=async _0x3828bc=>{const _0x5dce83=_0x5b3f1f;let _0x199e8e=0x0;const _0x436a45=await _0xfaf1f6[_0x5dce83(0xe1)](_0x3828bc,{'withFileTypes':!![]});for(const _0x830f7f of _0x436a45){const _0x1deea1=_0x2873fc['join'](_0x3828bc,_0x830f7f[_0x5dce83(0xa6)]);if(_0x830f7f[_0x5dce83(0xa8)]())_0x199e8e++;else _0x830f7f[_0x5dce83(0x9e)]()&&(_0x199e8e+=await _0x37cfdf(_0x1deea1));}return _0x199e8e;},_0x1facdd=await _0x37cfdf(_0x590488);return{'projectName':_0x7c0126,'revision':_0x1d4edd?.[_0x5b3f1f(0xbf)]||_0x5b3f1f(0xd8),'filesExtracted':_0x1facdd};}finally{try{await _0xfaf1f6['unlink'](_0x5ecae8);}catch{}}}async[a180_0x53c093(0xf1)](_0x4c0ad2,_0x5f2ef3){const _0xc6c9ca=a180_0x53c093,{promises:_0x1bb831}=await import('fs'),_0x3e2c3b=await import(_0xc6c9ca(0xb4)),_0x4bc7a0=await import(_0xc6c9ca(0xa7)),_0x40b853=_0x5f2ef3?.[_0xc6c9ca(0xef)]||_0x3e2c3b[_0xc6c9ca(0xa9)](_0x4c0ad2),_0xf9c666=_0x5f2ef3?.[_0xc6c9ca(0xbf)]||new Date()[_0xc6c9ca(0xba)]()['replace'](/[:.]/g,'-');try{await _0x1bb831[_0xc6c9ca(0x10e)](_0x4c0ad2);}catch{throw new Error(_0xc6c9ca(0xc3)+_0x4c0ad2);}if(!_0x5f2ef3?.[_0xc6c9ca(0xcb)]){const _0x2982ab=await _0x1bb831[_0xc6c9ca(0xe1)](_0x4c0ad2),_0x2da8ba=_0x2982ab[_0xc6c9ca(0xe8)](_0x77c2a6=>_0x77c2a6[_0xc6c9ca(0xa2)](WORKFLOW_FILE_EXTENSION));if(_0x2da8ba[_0xc6c9ca(0xec)]===0x0)throw new Error(_0xc6c9ca(0xc9)+WORKFLOW_FILE_EXTENSION+_0xc6c9ca(0x101));for(const _0x17d7a9 of _0x2da8ba){const _0x15d232=_0x3e2c3b[_0xc6c9ca(0xc5)](_0x4c0ad2,_0x17d7a9);try{await _0x1bb831[_0xc6c9ca(0x10e)](_0x15d232);}catch{throw new Error(_0xc6c9ca(0x11f)+_0x17d7a9);}}}const _0xea415f=async(_0x37b52a,_0xb5398c='')=>{const _0x379fe4=_0xc6c9ca,_0x12cd2d=await _0x1bb831[_0x379fe4(0xe1)](_0x37b52a,{'withFileTypes':!![]}),_0x12bb37=[];for(const _0x465fe1 of _0x12cd2d){const _0x58ec28=_0x3e2c3b['join'](_0xb5398c,_0x465fe1['name']),_0x110ecb=_0x3e2c3b[_0x379fe4(0xc5)](_0x37b52a,_0x465fe1['name']);if(!shouldIncludeInArchive(_0x465fe1['name']))continue;_0x465fe1[_0x379fe4(0x9e)]()?_0x12bb37[_0x379fe4(0xf1)](...await _0xea415f(_0x110ecb,_0x58ec28)):_0x12bb37[_0x379fe4(0xf1)](_0x58ec28);}return _0x12bb37;},_0x4d84d7=await _0xea415f(_0x4c0ad2),_0x32a2a8=await import('os'),_0x44d9fb=_0x32a2a8['tmpdir'](),_0x4918cc=_0x3e2c3b[_0xc6c9ca(0xc5)](_0x44d9fb,'tdx-workflow-push-'+Date['now']()+_0xc6c9ca(0xcd));try{await _0x4bc7a0[_0xc6c9ca(0xce)]({'file':_0x4918cc,'gzip':!![],'cwd':_0x4c0ad2,'portable':!![]},_0x4d84d7);const _0x541b69=await this[_0xc6c9ca(0xe6)][_0xc6c9ca(0xd3)](_0x40b853,_0xf9c666,_0x4918cc,{'scheduleFrom':_0x5f2ef3?.['scheduleFrom'],'clearSchedule':_0x5f2ef3?.[_0xc6c9ca(0xb8)],'clearScheduleAll':_0x5f2ef3?.[_0xc6c9ca(0xd0)]});return{'projectId':_0x541b69['id'],'projectName':_0x541b69[_0xc6c9ca(0xa6)],'revision':_0x541b69[_0xc6c9ca(0xbf)]};}finally{try{await _0x1bb831[_0xc6c9ca(0xeb)](_0x4918cc);}catch{}}}async[a180_0x53c093(0xbe)](_0xcfc367){const _0x28b30a=a180_0x53c093,{id:_0x63cdc1}=await this[_0x28b30a(0xc8)](_0xcfc367),_0x233660=await this[_0x28b30a(0xe6)][_0x28b30a(0xee)](_0x63cdc1);return{'projectId':_0x233660['id'],'projectName':_0x233660[_0x28b30a(0xa6)]};}async[a180_0x53c093(0xab)](_0x5a18ac){const _0x45b615=a180_0x53c093,{id:_0x475a25,name:_0x18fee0}=await this[_0x45b615(0xc8)](_0x5a18ac),_0x59977b=await this[_0x45b615(0xe6)]['listSecrets'](_0x475a25);return{'projectName':_0x18fee0,'secrets':_0x59977b};}async['setSecret'](_0x5bd775,_0x226191,_0x416f0a){const _0x12f474=a180_0x53c093,{id:_0x1041cd,name:_0x23fe1c}=await this['resolveProjectId'](_0x5bd775);return await this[_0x12f474(0xe6)]['setSecret'](_0x1041cd,_0x226191,_0x416f0a),{'projectName':_0x23fe1c,'key':_0x226191};}async[a180_0x53c093(0xd6)](_0x1a4e67,_0x4cbbfe){const _0x3067ef=a180_0x53c093,{id:_0x7abc1e,name:_0x4b17a8}=await this[_0x3067ef(0xc8)](_0x1a4e67),_0x453996=Object[_0x3067ef(0xc2)](_0x4cbbfe),_0x3b12f9=await Promise[_0x3067ef(0xdd)](_0x453996[_0x3067ef(0xf8)](_0x4af093=>this[_0x3067ef(0xe6)][_0x3067ef(0x109)](_0x7abc1e,_0x4af093,_0x4cbbfe[_0x4af093]))),_0x5169e0=_0x3b12f9[_0x3067ef(0xf8)]((_0x57958e,_0x4b5cf9)=>_0x57958e[_0x3067ef(0xbb)]==='rejected'?_0x453996[_0x4b5cf9]:null)[_0x3067ef(0xe8)](_0x256659=>_0x256659!==null);if(_0x5169e0[_0x3067ef(0xec)]>0x0)throw new SDKError(ErrorCode['WORKFLOW_SECRET_SET_FAILED'],_0x3067ef(0x10b)+(_0x5169e0[_0x3067ef(0xec)]>0x1?'s':'')+':\x20'+_0x5169e0[_0x3067ef(0xc5)](',\x20'));return{'projectName':_0x4b17a8,'keys':_0x453996};}async[a180_0x53c093(0x112)](_0x276143,_0x10a74d){const _0x11b71c=a180_0x53c093,{id:_0x3ffec5,name:_0x34082a}=await this[_0x11b71c(0xc8)](_0x276143);return await this[_0x11b71c(0xe6)][_0x11b71c(0x112)](_0x3ffec5,_0x10a74d),{'projectName':_0x34082a,'key':_0x10a74d};}async[a180_0x53c093(0xa3)](_0x3a9133,_0x3e4fc6){const _0x6361e2=a180_0x53c093;return pullWorkflow({'client':this['client'],'resolveProjectId':this[_0x6361e2(0xc8)]['bind'](this)},_0x3a9133,_0x3e4fc6);}async[a180_0x53c093(0x119)](_0xfb3cad,_0x4f90e7){const _0x18d715=a180_0x53c093;return applyPullResult({'client':this[_0x18d715(0xe6)],'resolveProjectId':this['resolveProjectId'][_0x18d715(0xf4)](this)},_0xfb3cad,_0x4f90e7);}async[a180_0x53c093(0xf5)](_0x5667ac){const _0x208506=a180_0x53c093;return preparePushWorkflow({'client':this[_0x208506(0xe6)],'resolveProjectId':this[_0x208506(0xc8)][_0x208506(0xf4)](this)},_0x5667ac);}async[a180_0x53c093(0x103)](_0x105161){const _0x3cd528=a180_0x53c093;return executePushWorkflow({'client':this[_0x3cd528(0xe6)],'resolveProjectId':this[_0x3cd528(0xc8)][_0x3cd528(0xf4)](this)},_0x105161);}async[a180_0x53c093(0xad)](_0x4c65ae,_0x4f7130,_0x1d47cb){const _0x221dad=a180_0x53c093;return prepareCloneWorkflow({'client':this[_0x221dad(0xe6)]},_0x4c65ae,_0x4f7130,_0x1d47cb);}async[a180_0x53c093(0x10d)](_0x53d12d){const _0x9f0ab=a180_0x53c093;return executeCloneWorkflow({'client':this[_0x9f0ab(0xe6)]},_0x53d12d);}}
1
+ const a180_0x5e2cc6=a180_0x4d05;function a180_0x16a0(){const _0x42189a=['force','setSecret','WORKFLOW_SECRET_SET_FAILED','.tar.gz','listSecrets','createdAt','36839335nnEIVb','index','skipValidation','sessionUuid','listSessions','deleteSecret','zlib','tmpdir','extract','retryAttemptName','slice','run','8083608idbqdT','workflowName','Kill\x20request\x20accepted','WORKFLOW_PROJECT_NOT_FOUND','listLogFiles','scheduleFrom','pullProject','retryAttempt','lastAttempt','attempts','includeRetried','direct','getProject','toISOString','mkdir','getAttempt','updatedAt','No\x20','done','toString','Failed\x20to\x20set\x20secret','data','projectName','sessionTime','bind','\x20workflow\x20files\x20found\x20in\x20project\x20directory','join','applyPullProject','readdir','stateParams','kill','fromTime','substring','projects','35NZBPhM','utf-8','9127737PqoVsk','retryAt','min','.\x20Expected\x20\x22project.workflow\x22','124235sfhhXk','startedAt','download','resolveProjectId','toTime','upstreams','client','revision','startAttempt','parentId','length','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','last_id','util','delete','error','arrayBuffer','config','unlink','tasks','clearSchedule','fromTask','workflow','message','limit','downloadProjectArchive','isDirectory','from','retryParams','fullName','378296tHhVMn','deleteProject','now','project','listProjects','logs','map','timezone','rawCount','lastId','138096FzzNfG','141738CxhmRd','find','tdx-workflow-','6hgJstb','basename','NUMERIC_ID_PATTERN','listAttempts','getAttemptTasks','11yTNmul','uploadProjectArchive','access','name','listWorkflows','executeCloneProject','push','prepareCloneProject','finishedAt','storeParams','filter','15iLMYkb','status','replace','Failed\x20to\x20download\x20log\x20file:\x20','gunzip','path','54gWnYiI','tar','logFiles','rejected','retrySession','allSettled','attempt','test','resumeFrom','sessionId','Project\x20not\x20found:\x20','10ATnZQd'];a180_0x16a0=function(){return _0x42189a;};return a180_0x16a0();}(function(_0x18732f,_0x477a0e){const _0x24713f=a180_0x4d05,_0x1fa01b=_0x18732f();while(!![]){try{const _0x105caf=parseInt(_0x24713f(0x12f))/0x1*(-parseInt(_0x24713f(0x11c))/0x2)+parseInt(_0x24713f(0x135))/0x3*(-parseInt(_0x24713f(0x11b))/0x4)+parseInt(_0x24713f(0x17b))/0x5*(parseInt(_0x24713f(0x11f))/0x6)+-parseInt(_0x24713f(0x175))/0x7*(parseInt(_0x24713f(0x111))/0x8)+parseInt(_0x24713f(0x177))/0x9*(-parseInt(_0x24713f(0x140))/0xa)+parseInt(_0x24713f(0x124))/0xb*(parseInt(_0x24713f(0x153))/0xc)+parseInt(_0x24713f(0x147))/0xd;if(_0x105caf===_0x477a0e)break;else _0x1fa01b['push'](_0x1fa01b['shift']());}catch(_0x4d4cbb){_0x1fa01b['push'](_0x1fa01b['shift']());}}}(a180_0x16a0,0x91cbd));import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x101919,_0x59c33f,_0x25d052=0x64){const _0x5d9f49=a180_0x4d05,_0x23856d=Math[_0x5d9f49(0x179)](_0x59c33f,MAX_PAGINATION_LIMIT),_0x314f30=[];let _0x34b7f2;while(_0x314f30['length']<_0x23856d){const _0x4168cc=await _0x101919(_0x25d052,_0x34b7f2),_0x2d1966=_0x4168cc[_0x5d9f49(0x119)]??_0x4168cc[_0x5d9f49(0x168)][_0x5d9f49(0x185)];if(_0x2d1966===0x0)break;_0x314f30[_0x5d9f49(0x12a)](..._0x4168cc[_0x5d9f49(0x168)]);if(!_0x4168cc['lastId']||_0x2d1966<_0x25d052)break;_0x34b7f2=_0x4168cc[_0x5d9f49(0x11a)];}return _0x314f30[_0x5d9f49(0x151)](0x0,_0x23856d);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';function a180_0x4d05(_0x1b98f1,_0x59970d){_0x1b98f1=_0x1b98f1-0x10c;const _0x16a012=a180_0x16a0();let _0x4d052d=_0x16a012[_0x1b98f1];return _0x4d052d;}import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a180_0x5e2cc6(0x121)]=/^\d+$/;[a180_0x5e2cc6(0x181)];constructor(_0x5f3dba){const _0x30fcc9=a180_0x5e2cc6;this[_0x30fcc9(0x181)]=new WorkflowApiClient(_0x5f3dba);}async[a180_0x5e2cc6(0x17e)](_0xb3f694){const _0x246e93=a180_0x5e2cc6;if(WorkflowSDK[_0x246e93(0x121)][_0x246e93(0x13c)](_0xb3f694)){const _0x79a24c=await this[_0x246e93(0x181)][_0x246e93(0x15f)](_0xb3f694);return{'id':_0x79a24c['id'],'name':_0x79a24c['name']};}const _0x11cff5=await this['client']['listProjects']({'name_pattern':_0xb3f694}),_0x4476f3=_0x11cff5[_0x246e93(0x168)][_0x246e93(0x11d)](_0x2d999b=>_0x2d999b[_0x246e93(0x127)]===_0xb3f694);if(!_0x4476f3)throw new SDKError(ErrorCode[_0x246e93(0x156)],_0x246e93(0x13f)+_0xb3f694);return{'id':_0x4476f3['id'],'name':_0x4476f3[_0x246e93(0x127)]};}async[a180_0x5e2cc6(0x174)](_0xa222a,_0x1bb6a5){const _0x5e9ad7=a180_0x5e2cc6,_0x3f110b=_0x1bb6a5?.[_0x5e9ad7(0x193)]||0x64,_0x52a9b3=await paginateResults((_0x426409,_0xbbf2e4)=>this[_0x5e9ad7(0x181)][_0x5e9ad7(0x115)]({'name_pattern':_0xa222a,'limit':_0x426409,'last_id':_0xbbf2e4??_0x1bb6a5?.[_0x5e9ad7(0x187)]}),_0x3f110b);return _0x52a9b3[_0x5e9ad7(0x117)](_0xdcf56c=>({..._0xdcf56c,'project_id':_0xdcf56c['id'],'project_name':_0xdcf56c[_0x5e9ad7(0x127)]}));}async['workflows'](_0x3ae691,_0x18ac55){const _0x219520=a180_0x5e2cc6,_0x5bf152=_0x18ac55?.[_0x219520(0x193)]||0x64,_0x35c901=await paginateResults((_0x34f498,_0x10bf04)=>this[_0x219520(0x181)][_0x219520(0x128)]({'project_name':_0x3ae691,'limit':_0x34f498,'last_id':_0x10bf04??_0x18ac55?.['last_id']}),_0x5bf152);return _0x35c901[_0x219520(0x117)](_0x175e6e=>({'project_id':_0x175e6e[_0x219520(0x114)]?.['id'],'project_name':_0x175e6e[_0x219520(0x114)]?.[_0x219520(0x127)],'workflow_id':_0x175e6e['id'],'workflow_name':_0x175e6e[_0x219520(0x127)],'revision':_0x175e6e[_0x219520(0x182)],'timezone':_0x175e6e[_0x219520(0x118)],'config':_0x175e6e[_0x219520(0x18c)],'id':_0x175e6e['id'],'name':_0x175e6e[_0x219520(0x127)],'project':_0x175e6e[_0x219520(0x114)]}));}async['sessions'](_0x2001a0){const _0x43b91f=a180_0x5e2cc6;let _0x5deb9f;if(_0x2001a0?.[_0x43b91f(0x169)]){let _0x4417fc,_0x5a83f1=![];while(!_0x5a83f1){const _0x342908=await this[_0x43b91f(0x181)][_0x43b91f(0x115)]({'limit':0x64,'last_id':_0x4417fc}),_0xa1355d=_0x342908[_0x43b91f(0x168)]['find'](_0x22163d=>_0x22163d[_0x43b91f(0x127)]===_0x2001a0[_0x43b91f(0x169)]);if(_0xa1355d){_0x5deb9f=_0xa1355d['id'],_0x5a83f1=!![];break;}if(!_0x342908[_0x43b91f(0x11a)]||_0x342908[_0x43b91f(0x168)][_0x43b91f(0x185)]===0x0)break;_0x4417fc=_0x342908['lastId'];}if(!_0x5deb9f)throw new SDKError(ErrorCode[_0x43b91f(0x156)],_0x43b91f(0x13f)+_0x2001a0[_0x43b91f(0x169)]);}const _0xd5826b=_0x2001a0?.[_0x43b91f(0x193)]||0x64,_0x431e2e=await paginateResults((_0x53fbdd,_0x5b8533)=>this[_0x43b91f(0x181)][_0x43b91f(0x14b)]({'project_id':_0x5deb9f,'project_name':_0x2001a0?.['projectName'],'workflow_name':_0x2001a0?.[_0x43b91f(0x154)],'status':_0x2001a0?.['status'],'from_time':_0x2001a0?.[_0x43b91f(0x172)],'to_time':_0x2001a0?.[_0x43b91f(0x17f)],'limit':_0x53fbdd,'last_id':_0x5b8533??_0x2001a0?.[_0x43b91f(0x187)]}),_0xd5826b);return _0x431e2e['map'](_0x155476=>({'project_id':_0x155476['project']?.['id'],'project_name':_0x155476[_0x43b91f(0x114)]?.[_0x43b91f(0x127)],'workflow_id':_0x155476['workflow']?.['id'],'workflow_name':_0x155476['workflow']?.['name'],'session_id':_0x155476['id'],'sessionUuid':_0x155476[_0x43b91f(0x14a)],'sessionTime':_0x155476[_0x43b91f(0x16a)],'lastAttempt':_0x155476[_0x43b91f(0x15b)],'id':_0x155476['id'],'project':_0x155476[_0x43b91f(0x114)],'workflow':_0x155476[_0x43b91f(0x191)]}));}async[a180_0x5e2cc6(0x15c)](_0x53f3a5){const _0x438e26=a180_0x5e2cc6,_0x587b2c=_0x53f3a5?.[_0x438e26(0x193)]||0x64,_0xb7e350=await paginateResults((_0x13029e,_0x4672fd)=>this[_0x438e26(0x181)][_0x438e26(0x122)]({'project_name':_0x53f3a5?.['projectName'],'workflow_name':_0x53f3a5?.[_0x438e26(0x154)],'include_retried':_0x53f3a5?.[_0x438e26(0x15d)],'limit':_0x13029e,'last_id':_0x4672fd??_0x53f3a5?.['last_id']}),_0x587b2c);return _0xb7e350[_0x438e26(0x117)](_0x56e0cd=>({'project_id':_0x56e0cd['project']?.['id'],'project_name':_0x56e0cd[_0x438e26(0x114)]?.[_0x438e26(0x127)],'workflow_id':_0x56e0cd[_0x438e26(0x191)]?.['id'],'workflow_name':_0x56e0cd[_0x438e26(0x191)]?.[_0x438e26(0x127)],'session_id':_0x56e0cd['sessionId'],'sessionUuid':_0x56e0cd[_0x438e26(0x14a)],'sessionTime':_0x56e0cd[_0x438e26(0x16a)],'attempt_id':_0x56e0cd['id'],'attempt_index':_0x56e0cd[_0x438e26(0x148)],'retryAttemptName':_0x56e0cd[_0x438e26(0x150)],'done':_0x56e0cd[_0x438e26(0x165)],'success':_0x56e0cd['success'],'cancelRequested':_0x56e0cd['cancelRequested'],'params':_0x56e0cd['params'],'createdAt':_0x56e0cd[_0x438e26(0x146)],'finishedAt':_0x56e0cd[_0x438e26(0x12c)],'id':_0x56e0cd['id'],'index':_0x56e0cd['index'],'project':_0x56e0cd['project'],'workflow':_0x56e0cd[_0x438e26(0x191)]}));}async[a180_0x5e2cc6(0x13b)](_0x509dc0){const _0x105afc=a180_0x5e2cc6,_0x207eef=await this[_0x105afc(0x181)][_0x105afc(0x162)](_0x509dc0);return _0x207eef;}async[a180_0x5e2cc6(0x18e)](_0x4d0931,_0x121344=![]){const _0x81cd99=a180_0x5e2cc6,_0x2144a0=await this['client'][_0x81cd99(0x123)](_0x4d0931,_0x121344);return _0x2144a0[_0x81cd99(0x117)](_0x15d942=>({'task_id':_0x15d942['id'],'task_name':_0x15d942[_0x81cd99(0x110)],'parentId':_0x15d942[_0x81cd99(0x184)],'config':_0x15d942[_0x81cd99(0x18c)],'upstreams':_0x15d942[_0x81cd99(0x180)],'state':_0x15d942['state'],'exportParams':_0x15d942['exportParams'],'storeParams':_0x15d942[_0x81cd99(0x12d)],'stateParams':_0x15d942[_0x81cd99(0x170)],'updatedAt':_0x15d942[_0x81cd99(0x163)],'retryAt':_0x15d942[_0x81cd99(0x178)],'startedAt':_0x15d942[_0x81cd99(0x17c)],'error':_0x15d942[_0x81cd99(0x18a)],'isGroup':_0x15d942['isGroup'],'id':_0x15d942['id'],'fullName':_0x15d942[_0x81cd99(0x110)]}));}async[a180_0x5e2cc6(0x137)](_0x19cd54,_0x411c83){const _0x125267=a180_0x5e2cc6;return await this[_0x125267(0x181)][_0x125267(0x157)](_0x19cd54,_0x411c83);}async[a180_0x5e2cc6(0x116)](_0x365e0b,_0x2b7b93){const _0x52e497=a180_0x5e2cc6,_0xeedf25=await import(_0x52e497(0x14d)),{promisify:_0x18f3e0}=await import(_0x52e497(0x188)),_0x488888=_0x18f3e0(_0xeedf25[_0x52e497(0x133)]),_0x5edb95=await this[_0x52e497(0x181)]['listLogFiles'](_0x365e0b,_0x2b7b93);if(_0x5edb95[_0x52e497(0x185)]===0x0)return'';const _0x1bbde8=[];for(const _0xe8600f of _0x5edb95){if(!_0xe8600f[_0x52e497(0x15e)])continue;const _0x85408d=await fetch(_0xe8600f[_0x52e497(0x15e)]);if(!_0x85408d['ok'])throw new Error(_0x52e497(0x132)+_0x85408d['status']);const _0x4d0253=Buffer[_0x52e497(0x10e)](await _0x85408d[_0x52e497(0x18b)]()),_0x58c4be=await _0x488888(_0x4d0253);_0x1bbde8[_0x52e497(0x12a)](_0x58c4be[_0x52e497(0x166)](_0x52e497(0x176)));}return _0x1bbde8[_0x52e497(0x16d)]('\x0a');}async[a180_0x5e2cc6(0x171)](_0x4ac467,_0x58b2d7){const _0x206a25=a180_0x5e2cc6,_0x2c1ecd=await this[_0x206a25(0x181)]['killAttempt'](_0x4ac467,_0x58b2d7);return _0x2c1ecd?.[_0x206a25(0x192)]??_0x206a25(0x155);}async[a180_0x5e2cc6(0x139)](_0x400b9f,_0x201ecc){const _0x442bff=a180_0x5e2cc6,_0x4c44be=await this[_0x442bff(0x181)][_0x442bff(0x139)](_0x400b9f,{'from_task':_0x201ecc?.[_0x442bff(0x190)],'retry_params':_0x201ecc?.['retryParams']});return{'attemptId':_0x4c44be['id'],'sessionId':_0x4c44be['sessionId']};}async[a180_0x5e2cc6(0x15a)](_0x4aec7d,_0x3c452e){const _0x5146ae=a180_0x5e2cc6,_0x389f64=await this[_0x5146ae(0x181)][_0x5146ae(0x15a)](_0x4aec7d,{'resume_from':_0x3c452e?.[_0x5146ae(0x13d)],'retry_params':_0x3c452e?.[_0x5146ae(0x10f)],'force':_0x3c452e?.[_0x5146ae(0x141)]});return{'attemptId':_0x389f64['id'],'sessionId':_0x389f64[_0x5146ae(0x13e)]};}async[a180_0x5e2cc6(0x152)](_0x53639a,_0x427208={},_0x517f28){const _0x316f5d=a180_0x5e2cc6,_0x41b701=_0x53639a['indexOf']('.');let _0x32804d,_0x10a301;if(_0x41b701===-0x1)throw new Error(_0x316f5d(0x186));_0x32804d=_0x53639a['substring'](0x0,_0x41b701),_0x10a301=_0x53639a[_0x316f5d(0x173)](_0x41b701+0x1);if(!_0x32804d||!_0x10a301)throw new Error('Invalid\x20workflow\x20format:\x20'+_0x53639a+_0x316f5d(0x17a));const _0x421a94=_0x517f28?.[_0x316f5d(0x16a)]||new Date()[_0x316f5d(0x160)]();return await this['client'][_0x316f5d(0x183)]({'projectName':_0x32804d,'workflowName':_0x10a301,'sessionTime':_0x421a94,'params':_0x427208});}async[a180_0x5e2cc6(0x17d)](_0x417ab4,_0x4f09b7,_0x2160d7){const _0x3959e1=a180_0x5e2cc6,{promises:_0x154698}=await import('fs'),_0x2332e4=await import(_0x3959e1(0x134)),_0x1a36ed=await import('os'),_0x33ee36=await import(_0x3959e1(0x136)),{id:_0x5ee280,name:_0x16a0e0}=await this['resolveProjectId'](_0x417ab4),_0x58a326=_0x1a36ed[_0x3959e1(0x14e)](),_0x55b298=_0x2332e4[_0x3959e1(0x16d)](_0x58a326,_0x3959e1(0x11e)+_0x5ee280+'-'+Date[_0x3959e1(0x113)]()+_0x3959e1(0x144));try{await this[_0x3959e1(0x181)][_0x3959e1(0x10c)](_0x5ee280,_0x55b298,_0x2160d7?.['revision']);const _0x440ebb=_0x2332e4['join'](_0x4f09b7,_0x16a0e0);await _0x154698[_0x3959e1(0x161)](_0x440ebb,{'recursive':!![]}),await _0x33ee36[_0x3959e1(0x14f)]({'file':_0x55b298,'cwd':_0x440ebb,'gzip':!![]});const _0x5289d8=async _0x18c451=>{const _0x4e6473=_0x3959e1;let _0x2b1021=0x0;const _0x5d33ea=await _0x154698[_0x4e6473(0x16f)](_0x18c451,{'withFileTypes':!![]});for(const _0xb17826 of _0x5d33ea){const _0x3d2578=_0x2332e4[_0x4e6473(0x16d)](_0x18c451,_0xb17826[_0x4e6473(0x127)]);if(_0xb17826['isFile']())_0x2b1021++;else _0xb17826[_0x4e6473(0x10d)]()&&(_0x2b1021+=await _0x5289d8(_0x3d2578));}return _0x2b1021;},_0x25d9b9=await _0x5289d8(_0x440ebb);return{'projectName':_0x16a0e0,'revision':_0x2160d7?.[_0x3959e1(0x182)]||'latest','filesExtracted':_0x25d9b9};}finally{try{await _0x154698[_0x3959e1(0x18d)](_0x55b298);}catch{}}}async[a180_0x5e2cc6(0x12a)](_0x41d4ca,_0x598175){const _0x282a4e=a180_0x5e2cc6,{promises:_0x2d24fb}=await import('fs'),_0x38f6eb=await import('path'),_0x584dec=await import(_0x282a4e(0x136)),_0x54497d=_0x598175?.[_0x282a4e(0x169)]||_0x38f6eb[_0x282a4e(0x120)](_0x41d4ca),_0x2dbb04=_0x598175?.['revision']||new Date()[_0x282a4e(0x160)]()[_0x282a4e(0x131)](/[:.]/g,'-');try{await _0x2d24fb[_0x282a4e(0x126)](_0x41d4ca);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0x41d4ca);}if(!_0x598175?.[_0x282a4e(0x149)]){const _0x26ed75=await _0x2d24fb[_0x282a4e(0x16f)](_0x41d4ca),_0xb7a55f=_0x26ed75[_0x282a4e(0x12e)](_0x2eb6ee=>_0x2eb6ee['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0xb7a55f[_0x282a4e(0x185)]===0x0)throw new Error(_0x282a4e(0x164)+WORKFLOW_FILE_EXTENSION+_0x282a4e(0x16c));for(const _0x1dcfd4 of _0xb7a55f){const _0x26611d=_0x38f6eb[_0x282a4e(0x16d)](_0x41d4ca,_0x1dcfd4);try{await _0x2d24fb[_0x282a4e(0x126)](_0x26611d);}catch{throw new Error('Cannot\x20read\x20workflow\x20file:\x20'+_0x1dcfd4);}}}const _0x535f32=async(_0x4412d1,_0x436508='')=>{const _0x3c0012=_0x282a4e,_0x37958d=await _0x2d24fb['readdir'](_0x4412d1,{'withFileTypes':!![]}),_0x2190ec=[];for(const _0x2c5fcb of _0x37958d){const _0x385275=_0x38f6eb[_0x3c0012(0x16d)](_0x436508,_0x2c5fcb[_0x3c0012(0x127)]),_0x860b04=_0x38f6eb[_0x3c0012(0x16d)](_0x4412d1,_0x2c5fcb[_0x3c0012(0x127)]);if(!shouldIncludeInArchive(_0x2c5fcb['name']))continue;_0x2c5fcb[_0x3c0012(0x10d)]()?_0x2190ec[_0x3c0012(0x12a)](...await _0x535f32(_0x860b04,_0x385275)):_0x2190ec[_0x3c0012(0x12a)](_0x385275);}return _0x2190ec;},_0x5afc3d=await _0x535f32(_0x41d4ca),_0x5ddb01=await import('os'),_0xa11ec=_0x5ddb01[_0x282a4e(0x14e)](),_0x477391=_0x38f6eb[_0x282a4e(0x16d)](_0xa11ec,'tdx-workflow-push-'+Date[_0x282a4e(0x113)]()+_0x282a4e(0x144));try{await _0x584dec['create']({'file':_0x477391,'gzip':!![],'cwd':_0x41d4ca,'portable':!![]},_0x5afc3d);const _0x3a4633=await this[_0x282a4e(0x181)][_0x282a4e(0x125)](_0x54497d,_0x2dbb04,_0x477391,{'scheduleFrom':_0x598175?.[_0x282a4e(0x158)],'clearSchedule':_0x598175?.[_0x282a4e(0x18f)],'clearScheduleAll':_0x598175?.['clearScheduleAll']});return{'projectId':_0x3a4633['id'],'projectName':_0x3a4633[_0x282a4e(0x127)],'revision':_0x3a4633[_0x282a4e(0x182)]};}finally{try{await _0x2d24fb['unlink'](_0x477391);}catch{}}}async[a180_0x5e2cc6(0x189)](_0x28eea7){const _0x21abe0=a180_0x5e2cc6,{id:_0x37d31b}=await this[_0x21abe0(0x17e)](_0x28eea7),_0x16d0e8=await this[_0x21abe0(0x181)][_0x21abe0(0x112)](_0x37d31b);return{'projectId':_0x16d0e8['id'],'projectName':_0x16d0e8['name']};}async[a180_0x5e2cc6(0x145)](_0x417c09){const _0x2de9e5=a180_0x5e2cc6,{id:_0x2ffadb,name:_0x55fd96}=await this['resolveProjectId'](_0x417c09),_0x54d84f=await this[_0x2de9e5(0x181)][_0x2de9e5(0x145)](_0x2ffadb);return{'projectName':_0x55fd96,'secrets':_0x54d84f};}async['setSecret'](_0x1d134c,_0x491e5f,_0x173a41){const {id:_0x2f55bf,name:_0x599c4a}=await this['resolveProjectId'](_0x1d134c);return await this['client']['setSecret'](_0x2f55bf,_0x491e5f,_0x173a41),{'projectName':_0x599c4a,'key':_0x491e5f};}async['setSecrets'](_0x56017b,_0x548c8a){const _0x4b9459=a180_0x5e2cc6,{id:_0x178d50,name:_0xbf6e7d}=await this[_0x4b9459(0x17e)](_0x56017b),_0x3e3f3d=Object['keys'](_0x548c8a),_0x308929=await Promise[_0x4b9459(0x13a)](_0x3e3f3d['map'](_0x5eb0f0=>this[_0x4b9459(0x181)][_0x4b9459(0x142)](_0x178d50,_0x5eb0f0,_0x548c8a[_0x5eb0f0]))),_0x80c928=_0x308929[_0x4b9459(0x117)]((_0x106159,_0x4ec694)=>_0x106159[_0x4b9459(0x130)]===_0x4b9459(0x138)?_0x3e3f3d[_0x4ec694]:null)[_0x4b9459(0x12e)](_0x4a3079=>_0x4a3079!==null);if(_0x80c928[_0x4b9459(0x185)]>0x0)throw new SDKError(ErrorCode[_0x4b9459(0x143)],_0x4b9459(0x167)+(_0x80c928[_0x4b9459(0x185)]>0x1?'s':'')+':\x20'+_0x80c928[_0x4b9459(0x16d)](',\x20'));return{'projectName':_0xbf6e7d,'keys':_0x3e3f3d};}async[a180_0x5e2cc6(0x14c)](_0x154984,_0x4fe355){const _0x494a0f=a180_0x5e2cc6,{id:_0x16da3d,name:_0x5e6d1b}=await this[_0x494a0f(0x17e)](_0x154984);return await this['client']['deleteSecret'](_0x16da3d,_0x4fe355),{'projectName':_0x5e6d1b,'key':_0x4fe355};}async[a180_0x5e2cc6(0x159)](_0x136f18,_0x4e959a){const _0x234715=a180_0x5e2cc6;return pullWorkflow({'client':this[_0x234715(0x181)],'resolveProjectId':this['resolveProjectId'][_0x234715(0x16b)](this)},_0x136f18,_0x4e959a);}async[a180_0x5e2cc6(0x16e)](_0x5cd6d5,_0x3b8545){const _0xf5d03d=a180_0x5e2cc6;return applyPullResult({'client':this[_0xf5d03d(0x181)],'resolveProjectId':this[_0xf5d03d(0x17e)][_0xf5d03d(0x16b)](this)},_0x5cd6d5,_0x3b8545);}async['preparePushProject'](_0x34d1c7){const _0xcd6a6f=a180_0x5e2cc6;return preparePushWorkflow({'client':this[_0xcd6a6f(0x181)],'resolveProjectId':this[_0xcd6a6f(0x17e)]['bind'](this)},_0x34d1c7);}async['executePushProject'](_0x4eb2ef){const _0x2bfcff=a180_0x5e2cc6;return executePushWorkflow({'client':this[_0x2bfcff(0x181)],'resolveProjectId':this['resolveProjectId']['bind'](this)},_0x4eb2ef);}async[a180_0x5e2cc6(0x12b)](_0x1e194e,_0x3ca2e0,_0xe9e9a2){const _0x2f6bcd=a180_0x5e2cc6;return prepareCloneWorkflow({'client':this[_0x2f6bcd(0x181)]},_0x1e194e,_0x3ca2e0,_0xe9e9a2);}async[a180_0x5e2cc6(0x129)](_0x571532){const _0x1b13f7=a180_0x5e2cc6;return executeCloneWorkflow({'client':this[_0x1b13f7(0x181)]},_0x571532);}}
@@ -1 +1 @@
1
- (function(_0x5de281,_0x2fd257){const _0x5c74ea=a181_0x2d6c,_0x1f85ee=_0x5de281();while(!![]){try{const _0xb03d6e=-parseInt(_0x5c74ea(0x10f))/0x1+-parseInt(_0x5c74ea(0x119))/0x2+-parseInt(_0x5c74ea(0xf3))/0x3*(parseInt(_0x5c74ea(0xff))/0x4)+-parseInt(_0x5c74ea(0x104))/0x5+-parseInt(_0x5c74ea(0xf1))/0x6*(parseInt(_0x5c74ea(0x105))/0x7)+-parseInt(_0x5c74ea(0xed))/0x8+parseInt(_0x5c74ea(0xeb))/0x9*(parseInt(_0x5c74ea(0x10c))/0xa);if(_0xb03d6e===_0x2fd257)break;else _0x1f85ee['push'](_0x1f85ee['shift']());}catch(_0x3a4d7d){_0x1f85ee['push'](_0x1f85ee['shift']());}}}(a181_0x509b,0x3ec0c));function a181_0x2d6c(_0x246988,_0x3e8280){_0x246988=_0x246988-0xe5;const _0x509b45=a181_0x509b();let _0x2d6cd0=_0x509b45[_0x246988];return _0x2d6cd0;}import{existsSync,promises as a181_0x41611c}from'fs';import a181_0x3bb6df from'path';import a181_0x53e3bd from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a181_0x509b(){const _0x757804=['tmpdir','latest','join','TAR_BAD_ARCHIVE','\x20(archive\x20size:\x20','extract','writeFile','503290ocTvnH','new','localeCompare','isNewProject','archive.tar.gz','message','size','downloadProjectArchive','\x20bytes)','zlib','projectId','push','path','27onPkfE','cwd','120456kuwOMk','readdir','revision','targetDir','1353822xgszuU','has','963633MHdSQG','mkdtemp','includes','modified','filter','catch','length','toISOString','The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.','sort','tar','isDirectory','4jdNWQl','unchanged','extracted','deleted','tdx.json','68665jNgxIC','14lujEEV','stat','mkdir','WORKFLOW_ARCHIVE_CORRUPTED','readFile','utf-8','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','4866930PHYXRJ','Failed\x20to\x20extract\x20project\x20archive','name','150123tYBhvy','changes','type'];a181_0x509b=function(){return _0x757804;};return a181_0x509b();}import{getWorkflowProjectDir,createWorkflowTdxConfigContent,updateWorkflowTdxConfig}from'./tdx-config.js';import{SDKError,ErrorCode}from'../errors.js';export async function pullWorkflow(_0x2d443f,_0xbbcec5,_0x9fe5ab={}){const _0x4f2206=a181_0x2d6c,_0x4a4c27=await import(_0x4f2206(0xfd)),{client:_0x510f2b,resolveProjectId:_0x2a08a9}=_0x2d443f,{id:_0x2ccee8,name:_0x49c919}=await _0x2a08a9(_0xbbcec5),_0x3502ba=_0x9fe5ab['baseDir']||process[_0x4f2206(0xec)](),_0x4edb08=_0x9fe5ab[_0x4f2206(0xf0)]||getWorkflowProjectDir(_0x49c919,_0x3502ba),_0x1bdab4=a181_0x3bb6df['join'](_0x4edb08,_0x4f2206(0x103)),_0x4384c5=!existsSync(_0x1bdab4),_0x119eca=await a181_0x41611c['mkdtemp'](a181_0x3bb6df[_0x4f2206(0x114)](a181_0x53e3bd[_0x4f2206(0x112)](),'tdx-wf-pull-')),_0x3e769c=a181_0x3bb6df['join'](_0x119eca,_0x4f2206(0x11d)),_0x1cabf8=a181_0x3bb6df[_0x4f2206(0x114)](_0x119eca,_0x4f2206(0x101));try{await _0x510f2b['downloadProjectArchive'](_0x2ccee8,_0x3e769c,_0x9fe5ab[_0x4f2206(0xef)]),await a181_0x41611c[_0x4f2206(0x107)](_0x1cabf8,{'recursive':!![]});try{await _0x4a4c27[_0x4f2206(0x117)]({'file':_0x3e769c,'cwd':_0x1cabf8,'gzip':!![]});}catch(_0x1b4113){const _0x1d39bb=_0x1b4113 instanceof Error?_0x1b4113[_0x4f2206(0x11e)]:String(_0x1b4113);if(_0x1d39bb[_0x4f2206(0xf5)](_0x4f2206(0x115))||_0x1d39bb['includes']('zlib')){const _0x22aef9=await a181_0x41611c[_0x4f2206(0x106)](_0x3e769c)[_0x4f2206(0xf8)](()=>null),_0x3c47eb=_0x22aef9?'\x20(archive\x20size:\x20'+_0x22aef9[_0x4f2206(0x11f)]+_0x4f2206(0xe6):'';throw new SDKError(ErrorCode[_0x4f2206(0x108)],_0x4f2206(0x10d)+_0x3c47eb+':\x20'+_0x1d39bb,_0x1b4113,{'helpText':'The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20'+_0x4f2206(0xfb)});}throw _0x1b4113;}const _0xaa6ff6=await _0x510f2b['getProject'](_0x2ccee8),_0x57ab94=_0x9fe5ab[_0x4f2206(0xef)]||_0xaa6ff6['revision']||_0x4f2206(0x113),_0x33f142=await calculateChanges(_0x4edb08,_0x1cabf8,_0x4384c5),_0x43b659={'new':_0x33f142['filter'](_0x3a3bd1=>_0x3a3bd1['type']==='new')['length'],'modified':_0x33f142['filter'](_0x552f54=>_0x552f54['type']===_0x4f2206(0xf6))[_0x4f2206(0xf9)],'deleted':_0x33f142[_0x4f2206(0xf7)](_0x109ab0=>_0x109ab0['type']===_0x4f2206(0x102))[_0x4f2206(0xf9)],'unchanged':_0x33f142[_0x4f2206(0xf7)](_0x32ffba=>_0x32ffba['type']===_0x4f2206(0x100))['length']};return{'projectName':_0x49c919,'projectId':_0x2ccee8,'revision':_0x57ab94,'targetDir':_0x4edb08,'changes':_0x33f142,'summary':_0x43b659,'hasChanges':_0x43b659[_0x4f2206(0x11a)]>0x0||_0x43b659[_0x4f2206(0xf6)]>0x0||_0x43b659[_0x4f2206(0x102)]>0x0,'isNewProject':_0x4384c5};}finally{await a181_0x41611c['rm'](_0x119eca,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0x2990fe,_0x395fc5,_0x6bc5d6={}){const _0x589312=a181_0x2d6c,_0x2c92e2=await import(_0x589312(0xfd)),{client:_0x3527cc}=_0x2990fe,_0x3ca9de=await a181_0x41611c[_0x589312(0xf4)](a181_0x3bb6df[_0x589312(0x114)](a181_0x53e3bd[_0x589312(0x112)](),'tdx-wf-apply-')),_0x2a49d2=a181_0x3bb6df[_0x589312(0x114)](_0x3ca9de,_0x589312(0x11d));try{await _0x3527cc[_0x589312(0xe5)](_0x395fc5[_0x589312(0xe8)],_0x2a49d2,_0x6bc5d6[_0x589312(0xef)]),await a181_0x41611c[_0x589312(0x107)](_0x395fc5[_0x589312(0xf0)],{'recursive':!![]});for(const _0xb8f518 of _0x395fc5[_0x589312(0x110)]){if(_0xb8f518[_0x589312(0x111)]===_0x589312(0x102)){const _0x1bf948=a181_0x3bb6df[_0x589312(0x114)](_0x395fc5[_0x589312(0xf0)],_0xb8f518[_0x589312(0xea)]);await a181_0x41611c['unlink'](_0x1bf948)['catch'](()=>{});}}try{await _0x2c92e2[_0x589312(0x117)]({'file':_0x2a49d2,'cwd':_0x395fc5[_0x589312(0xf0)],'gzip':!![]});}catch(_0x4f680f){const _0x16c250=_0x4f680f instanceof Error?_0x4f680f[_0x589312(0x11e)]:String(_0x4f680f);if(_0x16c250[_0x589312(0xf5)]('TAR_BAD_ARCHIVE')||_0x16c250[_0x589312(0xf5)](_0x589312(0xe7))){const _0xfebedc=await a181_0x41611c[_0x589312(0x106)](_0x2a49d2)[_0x589312(0xf8)](()=>null),_0x214123=_0xfebedc?_0x589312(0x116)+_0xfebedc['size']+'\x20bytes)':'';throw new SDKError(ErrorCode[_0x589312(0x108)],_0x589312(0x10d)+_0x214123+':\x20'+_0x16c250,_0x4f680f,{'helpText':_0x589312(0x10b)+_0x589312(0xfb)});}throw _0x4f680f;}const _0x2671a1=a181_0x3bb6df[_0x589312(0x114)](_0x395fc5[_0x589312(0xf0)],_0x589312(0x103));if(_0x395fc5[_0x589312(0x11c)]){const _0x465a7d=createWorkflowTdxConfigContent(_0x395fc5['projectName'],_0x395fc5['projectId'],_0x395fc5['revision']);await a181_0x41611c[_0x589312(0x118)](_0x2671a1,_0x465a7d,_0x589312(0x10a));}else updateWorkflowTdxConfig(_0x2671a1,{'last_pulled_revision':_0x395fc5['revision'],'last_pulled_at':new Date()[_0x589312(0xfa)]()});}finally{await a181_0x41611c['rm'](_0x3ca9de,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x1cb74d,_0x1ae4f8,_0x3a7e3c){const _0x18d0bf=a181_0x2d6c,_0x412735=[],_0x301ad9=await getAllFiles(_0x1ae4f8),_0x2c80e6=existsSync(_0x1cb74d)?await getAllFiles(_0x1cb74d):new Set();for(const _0x50e635 of _0x301ad9){const _0x493bd8=a181_0x3bb6df[_0x18d0bf(0x114)](_0x1cb74d,_0x50e635),_0x3b2227=a181_0x3bb6df[_0x18d0bf(0x114)](_0x1ae4f8,_0x50e635);if(_0x50e635===_0x18d0bf(0x103))continue;const _0x15ca06=await a181_0x41611c[_0x18d0bf(0x109)](_0x3b2227,_0x18d0bf(0x10a))[_0x18d0bf(0xf8)](()=>null);if(_0x15ca06===null)continue;if(!existsSync(_0x493bd8)||_0x3a7e3c)_0x412735[_0x18d0bf(0xe9)]({'path':_0x50e635,'type':_0x18d0bf(0x11a),'newContent':_0x15ca06});else{const _0x55702b=await a181_0x41611c[_0x18d0bf(0x109)](_0x493bd8,_0x18d0bf(0x10a))[_0x18d0bf(0xf8)](()=>null);if(_0x55702b===null)_0x412735[_0x18d0bf(0xe9)]({'path':_0x50e635,'type':'modified','newContent':_0x15ca06});else{if(_0x55702b!==_0x15ca06){const _0x1842f4=generateDiff(_0x55702b,_0x15ca06),_0x51e0a4=hasChanges(_0x1842f4)?formatDiffWithColors(_0x1842f4):undefined;_0x412735[_0x18d0bf(0xe9)]({'path':_0x50e635,'type':'modified','oldContent':_0x55702b,'newContent':_0x15ca06,'diff':_0x51e0a4});}else _0x412735[_0x18d0bf(0xe9)]({'path':_0x50e635,'type':_0x18d0bf(0x100)});}}}if(!_0x3a7e3c)for(const _0x54e13e of _0x2c80e6){if(_0x54e13e===_0x18d0bf(0x103))continue;if(!_0x301ad9[_0x18d0bf(0xf2)](_0x54e13e)){const _0x418874=a181_0x3bb6df[_0x18d0bf(0x114)](_0x1cb74d,_0x54e13e),_0x253f74=await a181_0x41611c[_0x18d0bf(0x109)](_0x418874,_0x18d0bf(0x10a))[_0x18d0bf(0xf8)](()=>undefined);_0x412735[_0x18d0bf(0xe9)]({'path':_0x54e13e,'type':'deleted','oldContent':_0x253f74});}}return _0x412735[_0x18d0bf(0xfc)]((_0x47ca25,_0x593b90)=>_0x47ca25[_0x18d0bf(0xea)][_0x18d0bf(0x11b)](_0x593b90[_0x18d0bf(0xea)])),_0x412735;}async function getAllFiles(_0xd1b4,_0x5d94ed=''){const _0x880b62=a181_0x2d6c,_0x184564=new Set();if(!existsSync(_0xd1b4))return _0x184564;const _0x12360c=await a181_0x41611c[_0x880b62(0xee)](_0xd1b4,{'withFileTypes':!![]});for(const _0x74e539 of _0x12360c){const _0x440dff=_0x5d94ed?a181_0x3bb6df['join'](_0x5d94ed,_0x74e539[_0x880b62(0x10e)]):_0x74e539['name'];if(_0x74e539[_0x880b62(0xfe)]()){const _0x56e0ab=await getAllFiles(a181_0x3bb6df[_0x880b62(0x114)](_0xd1b4,_0x74e539[_0x880b62(0x10e)]),_0x440dff);for(const _0x352403 of _0x56e0ab){_0x184564['add'](_0x352403);}}else _0x184564['add'](_0x440dff);}return _0x184564;}
1
+ (function(_0x15e8a6,_0x5cd20d){const _0x431f34=a181_0x237c,_0x5d81e5=_0x15e8a6();while(!![]){try{const _0x235b01=-parseInt(_0x431f34(0x197))/0x1*(-parseInt(_0x431f34(0x198))/0x2)+parseInt(_0x431f34(0x1a2))/0x3+-parseInt(_0x431f34(0x1c3))/0x4*(-parseInt(_0x431f34(0x1ad))/0x5)+-parseInt(_0x431f34(0x1ae))/0x6+parseInt(_0x431f34(0x19e))/0x7+parseInt(_0x431f34(0x194))/0x8+-parseInt(_0x431f34(0x199))/0x9;if(_0x235b01===_0x5cd20d)break;else _0x5d81e5['push'](_0x5d81e5['shift']());}catch(_0x408538){_0x5d81e5['push'](_0x5d81e5['shift']());}}}(a181_0x10c0,0x93fb0));import{existsSync,promises as a181_0x34b019}from'fs';function a181_0x10c0(){const _0x31fd6a=['unlink','stat','isDirectory','archive.tar.gz','modified','8945WlfklG','999342zWZpHD','projectName','utf-8','has','join','path','mkdir','name','The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.','size','WORKFLOW_ARCHIVE_CORRUPTED','tmpdir','projectId','baseDir','revision','targetDir','extract','tdx.json','changes','tdx-wf-pull-','writeFile','12qaDvuk','Failed\x20to\x20extract\x20project\x20archive','message','includes','deleted','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','TAR_BAD_ARCHIVE','add','tar','readFile','new','7736616EbONUk','sort','extracted','28229mPXnJV','48yxgebX','17132643XIMlsk','\x20(archive\x20size:\x20','mkdtemp','filter','push','4953942CPpYgJ','readdir','toISOString','unchanged','955998XCCtFs','zlib','length','catch','\x20bytes)','type'];a181_0x10c0=function(){return _0x31fd6a;};return a181_0x10c0();}import a181_0xc3ae8c from'path';import a181_0x2e23d7 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(_0x55945e,_0x1a6c88,_0x46439e={}){const _0x34a89d=a181_0x237c,_0x5a5e1d=await import(_0x34a89d(0x191)),{client:_0x15c077,resolveProjectId:_0x66f52c}=_0x55945e,{id:_0x90588a,name:_0x3f1412}=await _0x66f52c(_0x1a6c88),_0x547fe3=_0x46439e[_0x34a89d(0x1bb)]||process['cwd'](),_0x98cb80=_0x46439e[_0x34a89d(0x1bd)]||getWorkflowProjectDir(_0x3f1412,_0x547fe3),_0x221782=a181_0xc3ae8c['join'](_0x98cb80,'tdx.json'),_0x2fb638=!existsSync(_0x221782),_0x113eb7=await a181_0x34b019[_0x34a89d(0x19b)](a181_0xc3ae8c[_0x34a89d(0x1b2)](a181_0x2e23d7[_0x34a89d(0x1b9)](),_0x34a89d(0x1c1))),_0x1b5754=a181_0xc3ae8c['join'](_0x113eb7,_0x34a89d(0x1ab)),_0x415107=a181_0xc3ae8c['join'](_0x113eb7,_0x34a89d(0x196));try{await _0x15c077['downloadProjectArchive'](_0x90588a,_0x1b5754,_0x46439e['revision']),await a181_0x34b019[_0x34a89d(0x1b4)](_0x415107,{'recursive':!![]});try{await _0x5a5e1d[_0x34a89d(0x1be)]({'file':_0x1b5754,'cwd':_0x415107,'gzip':!![]});}catch(_0x5cae57){const _0x203de0=_0x5cae57 instanceof Error?_0x5cae57[_0x34a89d(0x1c5)]:String(_0x5cae57);if(_0x203de0['includes'](_0x34a89d(0x18f))||_0x203de0[_0x34a89d(0x1c6)]('zlib')){const _0x4e8fd3=await a181_0x34b019[_0x34a89d(0x1a9)](_0x1b5754)[_0x34a89d(0x1a5)](()=>null),_0x382bfe=_0x4e8fd3?'\x20(archive\x20size:\x20'+_0x4e8fd3[_0x34a89d(0x1b7)]+_0x34a89d(0x1a6):'';throw new SDKError(ErrorCode[_0x34a89d(0x1b8)],_0x34a89d(0x1c4)+_0x382bfe+':\x20'+_0x203de0,_0x5cae57,{'helpText':_0x34a89d(0x18e)+'The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.'});}throw _0x5cae57;}const _0xc9285=await _0x15c077['getProject'](_0x90588a),_0x22f7a2=_0x46439e[_0x34a89d(0x1bc)]||_0xc9285['revision']||'latest',_0x92f7f1=await calculateChanges(_0x98cb80,_0x415107,_0x2fb638),_0x2f1e3b={'new':_0x92f7f1[_0x34a89d(0x19c)](_0x3eafc3=>_0x3eafc3['type']===_0x34a89d(0x193))[_0x34a89d(0x1a4)],'modified':_0x92f7f1[_0x34a89d(0x19c)](_0x1568a7=>_0x1568a7[_0x34a89d(0x1a7)]===_0x34a89d(0x1ac))[_0x34a89d(0x1a4)],'deleted':_0x92f7f1[_0x34a89d(0x19c)](_0xed3482=>_0xed3482['type']==='deleted')[_0x34a89d(0x1a4)],'unchanged':_0x92f7f1[_0x34a89d(0x19c)](_0x2b4919=>_0x2b4919[_0x34a89d(0x1a7)]===_0x34a89d(0x1a1))[_0x34a89d(0x1a4)]};return{'projectName':_0x3f1412,'projectId':_0x90588a,'revision':_0x22f7a2,'targetDir':_0x98cb80,'changes':_0x92f7f1,'summary':_0x2f1e3b,'hasChanges':_0x2f1e3b[_0x34a89d(0x193)]>0x0||_0x2f1e3b[_0x34a89d(0x1ac)]>0x0||_0x2f1e3b['deleted']>0x0,'isNewProject':_0x2fb638};}finally{await a181_0x34b019['rm'](_0x113eb7,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0x52e053,_0x5cdd44,_0x39a710={}){const _0x192cfb=a181_0x237c,_0x2cf647=await import(_0x192cfb(0x191)),{client:_0x4edd0a}=_0x52e053,_0x3a9b5f=await a181_0x34b019[_0x192cfb(0x19b)](a181_0xc3ae8c[_0x192cfb(0x1b2)](a181_0x2e23d7[_0x192cfb(0x1b9)](),'tdx-wf-apply-')),_0x251c07=a181_0xc3ae8c[_0x192cfb(0x1b2)](_0x3a9b5f,_0x192cfb(0x1ab));try{await _0x4edd0a['downloadProjectArchive'](_0x5cdd44['projectId'],_0x251c07,_0x39a710[_0x192cfb(0x1bc)]),await a181_0x34b019[_0x192cfb(0x1b4)](_0x5cdd44[_0x192cfb(0x1bd)],{'recursive':!![]});for(const _0xb6f6f4 of _0x5cdd44[_0x192cfb(0x1c0)]){if(_0xb6f6f4[_0x192cfb(0x1a7)]===_0x192cfb(0x1c7)){const _0x17ed1f=a181_0xc3ae8c[_0x192cfb(0x1b2)](_0x5cdd44[_0x192cfb(0x1bd)],_0xb6f6f4[_0x192cfb(0x1b3)]);await a181_0x34b019[_0x192cfb(0x1a8)](_0x17ed1f)[_0x192cfb(0x1a5)](()=>{});}}try{await _0x2cf647['extract']({'file':_0x251c07,'cwd':_0x5cdd44[_0x192cfb(0x1bd)],'gzip':!![]});}catch(_0xbcb569){const _0x2e6fc9=_0xbcb569 instanceof Error?_0xbcb569['message']:String(_0xbcb569);if(_0x2e6fc9[_0x192cfb(0x1c6)](_0x192cfb(0x18f))||_0x2e6fc9[_0x192cfb(0x1c6)](_0x192cfb(0x1a3))){const _0x223492=await a181_0x34b019[_0x192cfb(0x1a9)](_0x251c07)[_0x192cfb(0x1a5)](()=>null),_0x4a2d92=_0x223492?_0x192cfb(0x19a)+_0x223492[_0x192cfb(0x1b7)]+_0x192cfb(0x1a6):'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],'Failed\x20to\x20extract\x20project\x20archive'+_0x4a2d92+':\x20'+_0x2e6fc9,_0xbcb569,{'helpText':_0x192cfb(0x18e)+_0x192cfb(0x1b6)});}throw _0xbcb569;}const _0x574750=a181_0xc3ae8c[_0x192cfb(0x1b2)](_0x5cdd44[_0x192cfb(0x1bd)],_0x192cfb(0x1bf));if(_0x5cdd44['isNewProject']){const _0xf4bd31=createWorkflowTdxConfigContent(_0x5cdd44[_0x192cfb(0x1af)],_0x5cdd44[_0x192cfb(0x1ba)],_0x5cdd44[_0x192cfb(0x1bc)]);await a181_0x34b019[_0x192cfb(0x1c2)](_0x574750,_0xf4bd31,_0x192cfb(0x1b0));}else updateWorkflowTdxConfig(_0x574750,{'last_pulled_revision':_0x5cdd44[_0x192cfb(0x1bc)],'last_pulled_at':new Date()[_0x192cfb(0x1a0)]()});}finally{await a181_0x34b019['rm'](_0x3a9b5f,{'recursive':!![],'force':!![]});}}function a181_0x237c(_0x3be669,_0x47a594){_0x3be669=_0x3be669-0x18e;const _0x10c0fc=a181_0x10c0();let _0x237cde=_0x10c0fc[_0x3be669];return _0x237cde;}async function calculateChanges(_0x570127,_0x39d199,_0x1efa12){const _0x3573ba=a181_0x237c,_0x59540d=[],_0x277fc7=await getAllFiles(_0x39d199),_0x121a29=existsSync(_0x570127)?await getAllFiles(_0x570127):new Set();for(const _0x1618df of _0x277fc7){const _0x915810=a181_0xc3ae8c[_0x3573ba(0x1b2)](_0x570127,_0x1618df),_0x1be673=a181_0xc3ae8c[_0x3573ba(0x1b2)](_0x39d199,_0x1618df);if(_0x1618df===_0x3573ba(0x1bf))continue;const _0x762e98=await a181_0x34b019[_0x3573ba(0x192)](_0x1be673,_0x3573ba(0x1b0))['catch'](()=>null);if(_0x762e98===null)continue;if(!existsSync(_0x915810)||_0x1efa12)_0x59540d['push']({'path':_0x1618df,'type':'new','newContent':_0x762e98});else{const _0x504a44=await a181_0x34b019[_0x3573ba(0x192)](_0x915810,_0x3573ba(0x1b0))[_0x3573ba(0x1a5)](()=>null);if(_0x504a44===null)_0x59540d[_0x3573ba(0x19d)]({'path':_0x1618df,'type':'modified','newContent':_0x762e98});else{if(_0x504a44!==_0x762e98){const _0x143c5b=generateDiff(_0x504a44,_0x762e98),_0x4cc4e0=hasChanges(_0x143c5b)?formatDiffWithColors(_0x143c5b):undefined;_0x59540d[_0x3573ba(0x19d)]({'path':_0x1618df,'type':_0x3573ba(0x1ac),'oldContent':_0x504a44,'newContent':_0x762e98,'diff':_0x4cc4e0});}else _0x59540d['push']({'path':_0x1618df,'type':'unchanged'});}}}if(!_0x1efa12)for(const _0x86c2ee of _0x121a29){if(_0x86c2ee===_0x3573ba(0x1bf))continue;if(!_0x277fc7[_0x3573ba(0x1b1)](_0x86c2ee)){const _0x243178=a181_0xc3ae8c['join'](_0x570127,_0x86c2ee),_0x3e7e66=await a181_0x34b019[_0x3573ba(0x192)](_0x243178,'utf-8')['catch'](()=>undefined);_0x59540d['push']({'path':_0x86c2ee,'type':_0x3573ba(0x1c7),'oldContent':_0x3e7e66});}}return _0x59540d[_0x3573ba(0x195)]((_0x500446,_0x113d1c)=>_0x500446[_0x3573ba(0x1b3)]['localeCompare'](_0x113d1c['path'])),_0x59540d;}async function getAllFiles(_0x551d5e,_0x599098=''){const _0x5e4a61=a181_0x237c,_0x7772cf=new Set();if(!existsSync(_0x551d5e))return _0x7772cf;const _0xdb9121=await a181_0x34b019[_0x5e4a61(0x19f)](_0x551d5e,{'withFileTypes':!![]});for(const _0x15bb94 of _0xdb9121){const _0x41952f=_0x599098?a181_0xc3ae8c[_0x5e4a61(0x1b2)](_0x599098,_0x15bb94['name']):_0x15bb94[_0x5e4a61(0x1b5)];if(_0x15bb94[_0x5e4a61(0x1aa)]()){const _0x4c45c0=await getAllFiles(a181_0xc3ae8c[_0x5e4a61(0x1b2)](_0x551d5e,_0x15bb94[_0x5e4a61(0x1b5)]),_0x41952f);for(const _0x324615 of _0x4c45c0){_0x7772cf[_0x5e4a61(0x190)](_0x324615);}}else _0x7772cf[_0x5e4a61(0x190)](_0x41952f);}return _0x7772cf;}
@@ -1 +1 @@
1
- function a182_0x274b(_0x323c85,_0x459298){_0x323c85=_0x323c85-0x12c;const _0x29f56e=a182_0x29f5();let _0x274b4c=_0x29f56e[_0x323c85];return _0x274b4c;}(function(_0x4f1370,_0x1346dc){const _0x5a4940=a182_0x274b,_0x4919ec=_0x4f1370();while(!![]){try{const _0x59cb47=parseInt(_0x5a4940(0x136))/0x1+parseInt(_0x5a4940(0x13f))/0x2*(parseInt(_0x5a4940(0x133))/0x3)+parseInt(_0x5a4940(0x14c))/0x4*(-parseInt(_0x5a4940(0x159))/0x5)+-parseInt(_0x5a4940(0x163))/0x6+-parseInt(_0x5a4940(0x162))/0x7*(parseInt(_0x5a4940(0x144))/0x8)+-parseInt(_0x5a4940(0x130))/0x9+parseInt(_0x5a4940(0x15e))/0xa;if(_0x59cb47===_0x1346dc)break;else _0x4919ec['push'](_0x4919ec['shift']());}catch(_0x4a051f){_0x4919ec['push'](_0x4919ec['shift']());}}}(a182_0x29f5,0xd7d29));import{promises as a182_0x5ae37d}from'fs';import a182_0x31f677 from'path';import a182_0x5c1693 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';import{SDKError,ErrorCode}from'../errors.js';export async function preparePushWorkflow(_0x1af787,_0x76044f={}){const _0x1a500e=a182_0x274b,_0x4c26c6=await import(_0x1a500e(0x151)),{client:_0xe45a5c,resolveProjectId:_0x4e15aa}=_0x1af787,_0x58ad42=_0x76044f['sourceDir']||process['cwd'](),_0x58e4f2=findWorkflowTdxConfig(_0x58ad42),{config:_0x4cd4c2,configDir:_0x4da549}=_0x58e4f2;let _0x2b6968,_0x412cbc=_0x4cd4c2[_0x1a500e(0x14a)];try{const _0x1b976d=await _0x4e15aa(_0x4cd4c2[_0x1a500e(0x14a)]);_0x2b6968=_0x1b976d['id'],_0x412cbc=_0x1b976d[_0x1a500e(0x145)];}catch{_0x2b6968='';}const _0x414639=_0x76044f['revision']||new Date()[_0x1a500e(0x15b)]()[_0x1a500e(0x12d)](/[:.]/g,'-');if(!_0x76044f['skipValidation']){const _0x30b02c=await a182_0x5ae37d[_0x1a500e(0x140)](_0x4da549),_0x23ae87=_0x30b02c[_0x1a500e(0x132)](_0x17e178=>_0x17e178[_0x1a500e(0x157)](WORKFLOW_FILE_EXTENSION));if(_0x23ae87[_0x1a500e(0x131)]===0x0)throw new Error(_0x1a500e(0x154)+WORKFLOW_FILE_EXTENSION+_0x1a500e(0x138)+_0x4da549);}const _0x47f399=await getProjectFiles(_0x4da549);let _0x38f1a0;if(_0x2b6968){const _0x5496e1=await a182_0x5ae37d['mkdtemp'](a182_0x31f677[_0x1a500e(0x147)](a182_0x5c1693[_0x1a500e(0x14b)](),'tdx-wf-push-')),_0x5ba48a=a182_0x31f677[_0x1a500e(0x147)](_0x5496e1,_0x1a500e(0x12c)),_0x3214b1=a182_0x31f677[_0x1a500e(0x147)](_0x5496e1,'extracted');try{await _0xe45a5c['downloadProjectArchive'](_0x2b6968,_0x5ba48a),await a182_0x5ae37d[_0x1a500e(0x15f)](_0x3214b1,{'recursive':!![]});try{await _0x4c26c6[_0x1a500e(0x14e)]({'file':_0x5ba48a,'cwd':_0x3214b1,'gzip':!![]});}catch(_0x1053c9){const _0x1929c4=_0x1053c9 instanceof Error?_0x1053c9['message']:String(_0x1053c9);if(_0x1929c4[_0x1a500e(0x14d)](_0x1a500e(0x15c))||_0x1929c4[_0x1a500e(0x14d)](_0x1a500e(0x135))){const _0x1432a1=await a182_0x5ae37d[_0x1a500e(0x141)](_0x5ba48a)[_0x1a500e(0x165)](()=>null),_0xca0a28=_0x1432a1?'\x20(archive\x20size:\x20'+_0x1432a1[_0x1a500e(0x12f)]+'\x20bytes)':'';throw new SDKError(ErrorCode[_0x1a500e(0x134)],_0x1a500e(0x148)+_0xca0a28+':\x20'+_0x1929c4,_0x1053c9,{'helpText':_0x1a500e(0x13a)});}throw _0x1053c9;}_0x38f1a0=await calculatePushChanges(_0x4da549,_0x3214b1,_0x47f399);}finally{await a182_0x5ae37d['rm'](_0x5496e1,{'recursive':!![],'force':!![]});}}else{_0x38f1a0=[];for(const _0x30104b of _0x47f399){const _0x42cc17=a182_0x31f677[_0x1a500e(0x147)](_0x4da549,_0x30104b),_0x461a14=await a182_0x5ae37d['readFile'](_0x42cc17,_0x1a500e(0x142))[_0x1a500e(0x165)](()=>null);_0x38f1a0['push']({'path':_0x30104b,'type':'new','newContent':_0x461a14||undefined});}}const _0x2951ec={'new':_0x38f1a0[_0x1a500e(0x132)](_0x2df310=>_0x2df310[_0x1a500e(0x13c)]===_0x1a500e(0x150))['length'],'modified':_0x38f1a0[_0x1a500e(0x132)](_0x109415=>_0x109415[_0x1a500e(0x13c)]===_0x1a500e(0x160))['length'],'deleted':_0x38f1a0[_0x1a500e(0x132)](_0x2b65fc=>_0x2b65fc['type']===_0x1a500e(0x13b))[_0x1a500e(0x131)],'unchanged':_0x38f1a0[_0x1a500e(0x132)](_0x539d81=>_0x539d81['type']===_0x1a500e(0x14f))[_0x1a500e(0x131)]};return{'projectName':_0x412cbc,'projectId':_0x2b6968,'revision':_0x414639,'sourceDir':_0x4da549,'changes':_0x38f1a0,'summary':_0x2951ec,'hasChanges':_0x2951ec['new']>0x0||_0x2951ec[_0x1a500e(0x160)]>0x0||_0x2951ec['deleted']>0x0,'configResult':_0x58e4f2};}export async function executePushWorkflow(_0x1e5c59,_0xae8150){const _0x41d412=a182_0x274b,_0x274fb4=await import(_0x41d412(0x151)),{client:_0x349f73}=_0x1e5c59,_0x4a0bf4=await getProjectFiles(_0xae8150[_0x41d412(0x13e)]),_0x5e39e8=await a182_0x5ae37d['mkdtemp'](a182_0x31f677['join'](a182_0x5c1693[_0x41d412(0x14b)](),_0x41d412(0x137))),_0x2309f8=a182_0x31f677['join'](_0x5e39e8,_0x41d412(0x12c));try{await _0x274fb4[_0x41d412(0x12e)]({'file':_0x2309f8,'gzip':!![],'cwd':_0xae8150[_0x41d412(0x13e)],'portable':!![]},_0x4a0bf4);const _0x5cd4ec=await _0x349f73[_0x41d412(0x152)](_0xae8150['projectName'],_0xae8150[_0x41d412(0x153)],_0x2309f8);return updateWorkflowTdxConfig(_0xae8150[_0x41d412(0x161)][_0x41d412(0x155)],{'workflow_project_id':_0x5cd4ec['id'],'last_pushed_revision':_0x5cd4ec[_0x41d412(0x153)],'last_pushed_at':new Date()[_0x41d412(0x15b)]()}),{'projectId':_0x5cd4ec['id'],'projectName':_0x5cd4ec[_0x41d412(0x145)],'revision':_0x5cd4ec[_0x41d412(0x153)]};}finally{await a182_0x5ae37d['rm'](_0x5e39e8,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x3873b8,_0x4805bf=_0x3873b8,_0x3050b4='',_0x1e31b2=null){const _0x11bc24=a182_0x274b,_0x2ae8ca=[];if(_0x1e31b2===null){_0x1e31b2=createIgnoreInstance();const _0x43f5b6=await loadDigdagignore(_0x3873b8);_0x43f5b6&&_0x1e31b2[_0x11bc24(0x146)](_0x43f5b6);}if(_0x3050b4!==''){const _0x1f23d5=await loadDigdagignore(_0x4805bf);_0x1f23d5&&addScopedPatterns(_0x1e31b2,_0x1f23d5,_0x3050b4);}const _0x308c7d=await a182_0x5ae37d[_0x11bc24(0x140)](_0x4805bf,{'withFileTypes':!![]});for(const _0x3301bd of _0x308c7d){const _0x5a0ff1=_0x3050b4?a182_0x31f677[_0x11bc24(0x13d)][_0x11bc24(0x147)](_0x3050b4,_0x3301bd[_0x11bc24(0x145)]):_0x3301bd[_0x11bc24(0x145)];if(_0x3301bd[_0x11bc24(0x145)]===_0x11bc24(0x139))continue;if(_0x3301bd[_0x11bc24(0x145)]===_0x11bc24(0x156))continue;if(!shouldIncludeInArchive(_0x3301bd[_0x11bc24(0x145)]))continue;if(shouldIgnoreWithInstance(_0x1e31b2,_0x5a0ff1,_0x3301bd[_0x11bc24(0x164)]()))continue;if(_0x3301bd[_0x11bc24(0x164)]()){const _0x31927e=await getProjectFiles(_0x3873b8,a182_0x31f677[_0x11bc24(0x147)](_0x4805bf,_0x3301bd['name']),_0x5a0ff1,_0x1e31b2);_0x2ae8ca[_0x11bc24(0x15a)](..._0x31927e);}else _0x2ae8ca[_0x11bc24(0x15a)](_0x5a0ff1);}return _0x2ae8ca;}async function calculatePushChanges(_0x3d655b,_0x22edb4,_0x44448b){const _0x38c720=a182_0x274b,_0x3129dd=[],_0x431f07=new Set(await getProjectFiles(_0x22edb4));for(const _0x51e729 of _0x44448b){const _0x5735ca=a182_0x31f677[_0x38c720(0x147)](_0x3d655b,_0x51e729),_0x5027b3=a182_0x31f677[_0x38c720(0x147)](_0x22edb4,_0x51e729),_0x183f84=await a182_0x5ae37d[_0x38c720(0x143)](_0x5735ca,'utf-8')[_0x38c720(0x165)](()=>null);if(_0x183f84===null)continue;if(!_0x431f07[_0x38c720(0x158)](_0x51e729))_0x3129dd[_0x38c720(0x15a)]({'path':_0x51e729,'type':_0x38c720(0x150),'newContent':_0x183f84});else{const _0x1a872f=await a182_0x5ae37d['readFile'](_0x5027b3,_0x38c720(0x142))[_0x38c720(0x165)](()=>null);if(_0x1a872f===null)_0x3129dd[_0x38c720(0x15a)]({'path':_0x51e729,'type':_0x38c720(0x160),'newContent':_0x183f84});else{if(_0x1a872f!==_0x183f84){const _0x39d856=generateDiff(_0x1a872f,_0x183f84),_0x4ecf1e=hasChanges(_0x39d856)?formatDiffWithColors(_0x39d856):undefined;_0x3129dd[_0x38c720(0x15a)]({'path':_0x51e729,'type':_0x38c720(0x160),'oldContent':_0x1a872f,'newContent':_0x183f84,'diff':_0x4ecf1e});}else _0x3129dd[_0x38c720(0x15a)]({'path':_0x51e729,'type':_0x38c720(0x14f)});}}}for(const _0x47fd0f of _0x431f07){if(!_0x44448b[_0x38c720(0x14d)](_0x47fd0f)){const _0x8d98b2=a182_0x31f677[_0x38c720(0x147)](_0x22edb4,_0x47fd0f),_0x20ac17=await a182_0x5ae37d[_0x38c720(0x143)](_0x8d98b2,_0x38c720(0x142))['catch'](()=>undefined);_0x3129dd[_0x38c720(0x15a)]({'path':_0x47fd0f,'type':_0x38c720(0x13b),'oldContent':_0x20ac17});}}return _0x3129dd[_0x38c720(0x149)]((_0x4ae40d,_0x376a61)=>_0x4ae40d['path'][_0x38c720(0x15d)](_0x376a61['path'])),_0x3129dd;}function a182_0x29f5(){const _0x4b35d7=['modified','configResult','28sbstcw','7125138YdhwHL','isDirectory','catch','archive.tar.gz','replace','create','size','5817618grNkHl','length','filter','25527EFmDPh','WORKFLOW_ARCHIVE_CORRUPTED','zlib','247996DJFnPd','tdx-wf-push-archive-','\x20workflow\x20files\x20found\x20in\x20','tdx.json','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','deleted','type','posix','sourceDir','120GISjmX','readdir','stat','utf-8','readFile','729560UoTZEb','name','add','join','Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison','sort','workflow_project','tmpdir','44LWNyfO','includes','extract','unchanged','new','tar','uploadProjectArchive','revision','No\x20','configPath','.digdagignore','endsWith','has','60575ySLmWY','push','toISOString','TAR_BAD_ARCHIVE','localeCompare','24574430eGEJOT','mkdir'];a182_0x29f5=function(){return _0x4b35d7;};return a182_0x29f5();}
1
+ (function(_0x4b0e24,_0x1e5090){const _0x59e7cd=a182_0x54a2,_0x9ef929=_0x4b0e24();while(!![]){try{const _0x44db6d=parseInt(_0x59e7cd(0x13d))/0x1+parseInt(_0x59e7cd(0x14d))/0x2+parseInt(_0x59e7cd(0x130))/0x3+parseInt(_0x59e7cd(0x131))/0x4+-parseInt(_0x59e7cd(0x14a))/0x5*(-parseInt(_0x59e7cd(0x134))/0x6)+-parseInt(_0x59e7cd(0x14e))/0x7*(parseInt(_0x59e7cd(0x137))/0x8)+-parseInt(_0x59e7cd(0x139))/0x9*(parseInt(_0x59e7cd(0x136))/0xa);if(_0x44db6d===_0x1e5090)break;else _0x9ef929['push'](_0x9ef929['shift']());}catch(_0x17a4bc){_0x9ef929['push'](_0x9ef929['shift']());}}}(a182_0x147f,0x1c131));import{promises as a182_0x30730f}from'fs';function a182_0x54a2(_0x2aed32,_0xfa95c5){_0x2aed32=_0x2aed32-0x117;const _0x147fab=a182_0x147f();let _0x54a2b0=_0x147fab[_0x2aed32];return _0x54a2b0;}import a182_0x57bf61 from'path';import a182_0x592463 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{findWorkflowTdxConfig,updateWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION,loadDigdagignore,createIgnoreInstance,addScopedPatterns,shouldIgnoreWithInstance}from'./workflow-utils.js';function a182_0x147f(){const _0x1429ec=['endsWith','tmpdir','tar','new','name','tdx.json','size','zlib','add','readdir','message','WORKFLOW_ARCHIVE_CORRUPTED','toISOString','path','localeCompare','workflow_project','includes','\x20workflow\x20files\x20found\x20in\x20','join','extracted','No\x20','extract','utf-8','downloadProjectArchive','sort','revision','tdx-wf-push-archive-','cwd','94449LkxqGd','9296FTAvoL','\x20bytes)','deleted','6CpaGRQ','replace','266540jwKHSU','96kFYEsp','unchanged','63KvMgXJ','catch','push','TAR_BAD_ARCHIVE','76715OrgrtS','filter','sourceDir','projectName','\x20(archive\x20size:\x20','modified','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','uploadProjectArchive','isDirectory','readFile','mkdtemp','create','stat','532670JhscQR','length','.digdagignore','356686pVhAnt','54733lOVsUC','type'];a182_0x147f=function(){return _0x1429ec;};return a182_0x147f();}import{SDKError,ErrorCode}from'../errors.js';export async function preparePushWorkflow(_0x1f1a11,_0x105703={}){const _0x52f19c=a182_0x54a2,_0x1b5f80=await import(_0x52f19c(0x152)),{client:_0x5eca14,resolveProjectId:_0x4dc75d}=_0x1f1a11,_0x148c08=_0x105703[_0x52f19c(0x13f)]||process[_0x52f19c(0x12f)](),_0x3bb379=findWorkflowTdxConfig(_0x148c08),{config:_0x228739,configDir:_0x35123b}=_0x3bb379;let _0x3d3273,_0x431d85=_0x228739[_0x52f19c(0x123)];try{const _0x13a186=await _0x4dc75d(_0x228739[_0x52f19c(0x123)]);_0x3d3273=_0x13a186['id'],_0x431d85=_0x13a186[_0x52f19c(0x118)];}catch{_0x3d3273='';}const _0x52f18e=_0x105703[_0x52f19c(0x12d)]||new Date()['toISOString']()[_0x52f19c(0x135)](/[:.]/g,'-');if(!_0x105703['skipValidation']){const _0x595991=await a182_0x30730f['readdir'](_0x35123b),_0x5e0b52=_0x595991[_0x52f19c(0x13e)](_0x21f184=>_0x21f184[_0x52f19c(0x150)](WORKFLOW_FILE_EXTENSION));if(_0x5e0b52[_0x52f19c(0x14b)]===0x0)throw new Error(_0x52f19c(0x128)+WORKFLOW_FILE_EXTENSION+_0x52f19c(0x125)+_0x35123b);}const _0x1ad716=await getProjectFiles(_0x35123b);let _0x466a17;if(_0x3d3273){const _0x41e654=await a182_0x30730f[_0x52f19c(0x147)](a182_0x57bf61[_0x52f19c(0x126)](a182_0x592463[_0x52f19c(0x151)](),'tdx-wf-push-')),_0x5f25dd=a182_0x57bf61['join'](_0x41e654,'archive.tar.gz'),_0x5d9f91=a182_0x57bf61[_0x52f19c(0x126)](_0x41e654,_0x52f19c(0x127));try{await _0x5eca14[_0x52f19c(0x12b)](_0x3d3273,_0x5f25dd),await a182_0x30730f['mkdir'](_0x5d9f91,{'recursive':!![]});try{await _0x1b5f80[_0x52f19c(0x129)]({'file':_0x5f25dd,'cwd':_0x5d9f91,'gzip':!![]});}catch(_0x3e599f){const _0x1c14cf=_0x3e599f instanceof Error?_0x3e599f[_0x52f19c(0x11e)]:String(_0x3e599f);if(_0x1c14cf[_0x52f19c(0x124)](_0x52f19c(0x13c))||_0x1c14cf[_0x52f19c(0x124)](_0x52f19c(0x11b))){const _0x29b200=await a182_0x30730f[_0x52f19c(0x149)](_0x5f25dd)['catch'](()=>null),_0x17a4d6=_0x29b200?_0x52f19c(0x141)+_0x29b200[_0x52f19c(0x11a)]+_0x52f19c(0x132):'';throw new SDKError(ErrorCode[_0x52f19c(0x11f)],'Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison'+_0x17a4d6+':\x20'+_0x1c14cf,_0x3e599f,{'helpText':_0x52f19c(0x143)});}throw _0x3e599f;}_0x466a17=await calculatePushChanges(_0x35123b,_0x5d9f91,_0x1ad716);}finally{await a182_0x30730f['rm'](_0x41e654,{'recursive':!![],'force':!![]});}}else{_0x466a17=[];for(const _0x566cc0 of _0x1ad716){const _0x46712c=a182_0x57bf61[_0x52f19c(0x126)](_0x35123b,_0x566cc0),_0x2af776=await a182_0x30730f[_0x52f19c(0x146)](_0x46712c,_0x52f19c(0x12a))[_0x52f19c(0x13a)](()=>null);_0x466a17['push']({'path':_0x566cc0,'type':_0x52f19c(0x117),'newContent':_0x2af776||undefined});}}const _0x1f7cdb={'new':_0x466a17[_0x52f19c(0x13e)](_0x80f1d0=>_0x80f1d0[_0x52f19c(0x14f)]===_0x52f19c(0x117))[_0x52f19c(0x14b)],'modified':_0x466a17[_0x52f19c(0x13e)](_0x444660=>_0x444660['type']===_0x52f19c(0x142))[_0x52f19c(0x14b)],'deleted':_0x466a17[_0x52f19c(0x13e)](_0x43304c=>_0x43304c[_0x52f19c(0x14f)]===_0x52f19c(0x133))['length'],'unchanged':_0x466a17['filter'](_0x27c833=>_0x27c833[_0x52f19c(0x14f)]===_0x52f19c(0x138))['length']};return{'projectName':_0x431d85,'projectId':_0x3d3273,'revision':_0x52f18e,'sourceDir':_0x35123b,'changes':_0x466a17,'summary':_0x1f7cdb,'hasChanges':_0x1f7cdb[_0x52f19c(0x117)]>0x0||_0x1f7cdb[_0x52f19c(0x142)]>0x0||_0x1f7cdb[_0x52f19c(0x133)]>0x0,'configResult':_0x3bb379};}export async function executePushWorkflow(_0x26100e,_0x4a5ad7){const _0x744a6f=a182_0x54a2,_0x2f1f04=await import(_0x744a6f(0x152)),{client:_0xf9a77f}=_0x26100e,_0x3bdb71=await getProjectFiles(_0x4a5ad7[_0x744a6f(0x13f)]),_0x53ec17=await a182_0x30730f[_0x744a6f(0x147)](a182_0x57bf61[_0x744a6f(0x126)](a182_0x592463[_0x744a6f(0x151)](),_0x744a6f(0x12e))),_0x7bf479=a182_0x57bf61[_0x744a6f(0x126)](_0x53ec17,'archive.tar.gz');try{await _0x2f1f04[_0x744a6f(0x148)]({'file':_0x7bf479,'gzip':!![],'cwd':_0x4a5ad7[_0x744a6f(0x13f)],'portable':!![]},_0x3bdb71);const _0x11bd90=await _0xf9a77f[_0x744a6f(0x144)](_0x4a5ad7[_0x744a6f(0x140)],_0x4a5ad7[_0x744a6f(0x12d)],_0x7bf479);return updateWorkflowTdxConfig(_0x4a5ad7['configResult']['configPath'],{'workflow_project_id':_0x11bd90['id'],'last_pushed_revision':_0x11bd90[_0x744a6f(0x12d)],'last_pushed_at':new Date()[_0x744a6f(0x120)]()}),{'projectId':_0x11bd90['id'],'projectName':_0x11bd90['name'],'revision':_0x11bd90['revision']};}finally{await a182_0x30730f['rm'](_0x53ec17,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x48d648,_0x5ece9c=_0x48d648,_0x4d6bef='',_0x1dac58=null){const _0xd2cfd6=a182_0x54a2,_0x24c41c=[];if(_0x1dac58===null){_0x1dac58=createIgnoreInstance();const _0x125251=await loadDigdagignore(_0x48d648);_0x125251&&_0x1dac58[_0xd2cfd6(0x11c)](_0x125251);}if(_0x4d6bef!==''){const _0x4a42bd=await loadDigdagignore(_0x5ece9c);_0x4a42bd&&addScopedPatterns(_0x1dac58,_0x4a42bd,_0x4d6bef);}const _0x139a5e=await a182_0x30730f[_0xd2cfd6(0x11d)](_0x5ece9c,{'withFileTypes':!![]});for(const _0x75f371 of _0x139a5e){const _0x5f45c0=_0x4d6bef?a182_0x57bf61['posix'][_0xd2cfd6(0x126)](_0x4d6bef,_0x75f371[_0xd2cfd6(0x118)]):_0x75f371[_0xd2cfd6(0x118)];if(_0x75f371[_0xd2cfd6(0x118)]===_0xd2cfd6(0x119))continue;if(_0x75f371[_0xd2cfd6(0x118)]===_0xd2cfd6(0x14c))continue;if(!shouldIncludeInArchive(_0x75f371['name']))continue;if(shouldIgnoreWithInstance(_0x1dac58,_0x5f45c0,_0x75f371[_0xd2cfd6(0x145)]()))continue;if(_0x75f371[_0xd2cfd6(0x145)]()){const _0x9151e9=await getProjectFiles(_0x48d648,a182_0x57bf61[_0xd2cfd6(0x126)](_0x5ece9c,_0x75f371[_0xd2cfd6(0x118)]),_0x5f45c0,_0x1dac58);_0x24c41c[_0xd2cfd6(0x13b)](..._0x9151e9);}else _0x24c41c[_0xd2cfd6(0x13b)](_0x5f45c0);}return _0x24c41c;}async function calculatePushChanges(_0x5f2eac,_0x271e11,_0x29e9e5){const _0x29b21a=a182_0x54a2,_0x6d1566=[],_0x1f82ac=new Set(await getProjectFiles(_0x271e11));for(const _0x5f3b6c of _0x29e9e5){const _0x2312fd=a182_0x57bf61[_0x29b21a(0x126)](_0x5f2eac,_0x5f3b6c),_0x46cc99=a182_0x57bf61[_0x29b21a(0x126)](_0x271e11,_0x5f3b6c),_0x29b47=await a182_0x30730f[_0x29b21a(0x146)](_0x2312fd,'utf-8')['catch'](()=>null);if(_0x29b47===null)continue;if(!_0x1f82ac['has'](_0x5f3b6c))_0x6d1566[_0x29b21a(0x13b)]({'path':_0x5f3b6c,'type':_0x29b21a(0x117),'newContent':_0x29b47});else{const _0x232f77=await a182_0x30730f[_0x29b21a(0x146)](_0x46cc99,_0x29b21a(0x12a))[_0x29b21a(0x13a)](()=>null);if(_0x232f77===null)_0x6d1566[_0x29b21a(0x13b)]({'path':_0x5f3b6c,'type':_0x29b21a(0x142),'newContent':_0x29b47});else{if(_0x232f77!==_0x29b47){const _0xbfca21=generateDiff(_0x232f77,_0x29b47),_0x5dbe85=hasChanges(_0xbfca21)?formatDiffWithColors(_0xbfca21):undefined;_0x6d1566['push']({'path':_0x5f3b6c,'type':'modified','oldContent':_0x232f77,'newContent':_0x29b47,'diff':_0x5dbe85});}else _0x6d1566['push']({'path':_0x5f3b6c,'type':'unchanged'});}}}for(const _0x1ea6fa of _0x1f82ac){if(!_0x29e9e5[_0x29b21a(0x124)](_0x1ea6fa)){const _0x58c870=a182_0x57bf61[_0x29b21a(0x126)](_0x271e11,_0x1ea6fa),_0x3d4e88=await a182_0x30730f[_0x29b21a(0x146)](_0x58c870,_0x29b21a(0x12a))[_0x29b21a(0x13a)](()=>undefined);_0x6d1566['push']({'path':_0x1ea6fa,'type':_0x29b21a(0x133),'oldContent':_0x3d4e88});}}return _0x6d1566[_0x29b21a(0x12c)]((_0x558d55,_0xf06586)=>_0x558d55[_0x29b21a(0x121)][_0x29b21a(0x122)](_0xf06586[_0x29b21a(0x121)])),_0x6d1566;}
@@ -1 +1 @@
1
- const a183_0x2a1e32=a183_0x5a78;(function(_0x589da8,_0x5de28d){const _0xae9f97=a183_0x5a78,_0x35b4a5=_0x589da8();while(!![]){try{const _0x278a75=parseInt(_0xae9f97(0x101))/0x1+parseInt(_0xae9f97(0x10e))/0x2+parseInt(_0xae9f97(0xf8))/0x3*(-parseInt(_0xae9f97(0x112))/0x4)+parseInt(_0xae9f97(0x111))/0x5*(parseInt(_0xae9f97(0x106))/0x6)+parseInt(_0xae9f97(0x10b))/0x7+parseInt(_0xae9f97(0x108))/0x8*(parseInt(_0xae9f97(0xfd))/0x9)+-parseInt(_0xae9f97(0x103))/0xa;if(_0x278a75===_0x5de28d)break;else _0x35b4a5['push'](_0x35b4a5['shift']());}catch(_0x1d4061){_0x35b4a5['push'](_0x35b4a5['shift']());}}}(a183_0x34e8,0xcc38f));import{existsSync,readFileSync,writeFileSync}from'fs';import a183_0x4c50a6 from'path';const TDX_CONFIG_FILE='tdx.json',WORKFLOWS_DIR=a183_0x2a1e32(0x113);export function findWorkflowTdxConfigPath(_0x1f3675=process[a183_0x2a1e32(0x104)]()){const _0x4931fe=a183_0x2a1e32;let _0x5b57e2=a183_0x4c50a6[_0x4931fe(0xfc)](_0x1f3675);const _0xec7ca2=a183_0x4c50a6['parse'](_0x5b57e2)[_0x4931fe(0x107)];while(_0x5b57e2!==_0xec7ca2){const _0x31ce13=a183_0x4c50a6['join'](_0x5b57e2,TDX_CONFIG_FILE);if(existsSync(_0x31ce13))try{const _0x512956=readFileSync(_0x31ce13,_0x4931fe(0x105)),_0x328556=JSON[_0x4931fe(0x10c)](_0x512956);if(_0x328556&&typeof _0x328556===_0x4931fe(0xfe)&&_0x4931fe(0xf5)in _0x328556)return _0x31ce13;}catch{}_0x5b57e2=a183_0x4c50a6[_0x4931fe(0xf6)](_0x5b57e2);}return null;}export function loadWorkflowTdxConfig(_0x3fbf60){const _0x40a601=a183_0x2a1e32,_0x3567cf=readFileSync(_0x3fbf60,_0x40a601(0x105));let _0xa007ff;try{_0xa007ff=JSON[_0x40a601(0x10c)](_0x3567cf);}catch{throw new Error(_0x40a601(0xfa)+_0x3fbf60);}if(!_0xa007ff||typeof _0xa007ff!==_0x40a601(0xfe))throw new Error(_0x40a601(0xfb));const _0x48f6a5=_0xa007ff;if(!_0x48f6a5['workflow_project']||typeof _0x48f6a5[_0x40a601(0xf5)]!=='string')throw new Error(_0x40a601(0x10a));return{'workflow_project':_0x48f6a5[_0x40a601(0xf5)],'workflow_project_id':typeof _0x48f6a5[_0x40a601(0x100)]===_0x40a601(0x10d)?_0x48f6a5[_0x40a601(0x100)]:undefined,'last_pulled_revision':typeof _0x48f6a5['last_pulled_revision']===_0x40a601(0x10d)?_0x48f6a5['last_pulled_revision']:undefined,'last_pulled_at':typeof _0x48f6a5[_0x40a601(0x102)]===_0x40a601(0x10d)?_0x48f6a5['last_pulled_at']:undefined,'last_pushed_revision':typeof _0x48f6a5[_0x40a601(0xff)]===_0x40a601(0x10d)?_0x48f6a5[_0x40a601(0xff)]:undefined,'last_pushed_at':typeof _0x48f6a5[_0x40a601(0x110)]===_0x40a601(0x10d)?_0x48f6a5[_0x40a601(0x110)]:undefined};}export function findWorkflowTdxConfig(_0x45b3f8=process['cwd']()){const _0x52fe=a183_0x2a1e32,_0x26947d=findWorkflowTdxConfigPath(_0x45b3f8);if(!_0x26947d)throw new Error(_0x52fe(0xf7));const _0x5d9286=loadWorkflowTdxConfig(_0x26947d),_0x1a1181=a183_0x4c50a6[_0x52fe(0xf6)](_0x26947d);return{'config':_0x5d9286,'configPath':_0x26947d,'configDir':_0x1a1181};}function a183_0x5a78(_0x3b0c4d,_0x4f1d15){_0x3b0c4d=_0x3b0c4d-0xf5;const _0x34e8c5=a183_0x34e8();let _0x5a7862=_0x34e8c5[_0x3b0c4d];return _0x5a7862;}export function tryFindWorkflowTdxConfig(_0x3a4509){try{return findWorkflowTdxConfig(_0x3a4509);}catch{return null;}}export function getWorkflowProjectDir(_0x53b5ea,_0x452785=process[a183_0x2a1e32(0x104)]()){const _0x149a67=a183_0x2a1e32;return a183_0x4c50a6[_0x149a67(0x10f)](_0x452785,WORKFLOWS_DIR,_0x53b5ea);}export function getWorkflowTdxConfigPath(_0x5d95bb,_0x32f6d9=process['cwd']()){const _0x29765b=a183_0x2a1e32;return a183_0x4c50a6[_0x29765b(0x10f)](getWorkflowProjectDir(_0x5d95bb,_0x32f6d9),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x4bb48c,_0x5d0de7,_0x15246a){const _0x19670c=a183_0x2a1e32,_0x5d6abc={'workflow_project':_0x4bb48c,..._0x5d0de7&&{'workflow_project_id':_0x5d0de7},..._0x15246a&&{'last_pulled_revision':_0x15246a},'last_pulled_at':new Date()[_0x19670c(0xf9)]()};return JSON[_0x19670c(0x109)](_0x5d6abc,null,0x2)+'\x0a';}export function saveWorkflowTdxConfig(_0x2700f6,_0x71c9ba){const _0x39b9c4=a183_0x2a1e32,_0x15d7a3=JSON[_0x39b9c4(0x109)](_0x71c9ba,null,0x2)+'\x0a';writeFileSync(_0x2700f6,_0x15d7a3,_0x39b9c4(0x105));}export function updateWorkflowTdxConfig(_0x595823,_0x389f39){const _0x1cf559=loadWorkflowTdxConfig(_0x595823),_0x4a3fa7={..._0x1cf559,..._0x389f39};saveWorkflowTdxConfig(_0x595823,_0x4a3fa7);}function a183_0x34e8(){const _0x207f52=['workflows','workflow_project','dirname','No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','33585VNfLel','toISOString','Invalid\x20JSON\x20in\x20','Invalid\x20tdx.json:\x20expected\x20object','resolve','9mLJOGx','object','last_pushed_revision','workflow_project_id','1639944AVliDI','last_pulled_at','16702950kmtWcK','cwd','utf-8','177306wFGpor','root','1089968LtwTAr','stringify','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field','1696331HezSpu','parse','string','1672438HUJRih','join','last_pushed_at','15fsgMQq','156LYAavJ'];a183_0x34e8=function(){return _0x207f52;};return a183_0x34e8();}
1
+ const a183_0x51f1be=a183_0x3d1b;(function(_0x126e9d,_0x5c038c){const _0x554071=a183_0x3d1b,_0x205454=_0x126e9d();while(!![]){try{const _0x447f6d=parseInt(_0x554071(0x162))/0x1+parseInt(_0x554071(0x168))/0x2+parseInt(_0x554071(0x163))/0x3+parseInt(_0x554071(0x17a))/0x4*(-parseInt(_0x554071(0x177))/0x5)+-parseInt(_0x554071(0x174))/0x6+parseInt(_0x554071(0x171))/0x7*(parseInt(_0x554071(0x169))/0x8)+parseInt(_0x554071(0x165))/0x9*(-parseInt(_0x554071(0x170))/0xa);if(_0x447f6d===_0x5c038c)break;else _0x205454['push'](_0x205454['shift']());}catch(_0x20d034){_0x205454['push'](_0x205454['shift']());}}}(a183_0x1aa6,0xa1be4));import{existsSync,readFileSync,writeFileSync}from'fs';function a183_0x3d1b(_0x5e258c,_0x2b4bc1){_0x5e258c=_0x5e258c-0x15d;const _0x1aa675=a183_0x1aa6();let _0x3d1b68=_0x1aa675[_0x5e258c];return _0x3d1b68;}import a183_0x5f5271 from'path';const TDX_CONFIG_FILE=a183_0x51f1be(0x173),WORKFLOWS_DIR='workflows';export function findWorkflowTdxConfigPath(_0x1078f2=process[a183_0x51f1be(0x160)]()){const _0x45109e=a183_0x51f1be;let _0x5e0799=a183_0x5f5271[_0x45109e(0x16d)](_0x1078f2);const _0x39b11d=a183_0x5f5271[_0x45109e(0x16b)](_0x5e0799)[_0x45109e(0x16e)];while(_0x5e0799!==_0x39b11d){const _0x52e5aa=a183_0x5f5271[_0x45109e(0x15d)](_0x5e0799,TDX_CONFIG_FILE);if(existsSync(_0x52e5aa))try{const _0x24a3fe=readFileSync(_0x52e5aa,_0x45109e(0x175)),_0xee3acc=JSON[_0x45109e(0x16b)](_0x24a3fe);if(_0xee3acc&&typeof _0xee3acc===_0x45109e(0x16f)&&_0x45109e(0x178)in _0xee3acc)return _0x52e5aa;}catch{}_0x5e0799=a183_0x5f5271['dirname'](_0x5e0799);}return null;}export function loadWorkflowTdxConfig(_0xb1c6fc){const _0x34c664=a183_0x51f1be,_0xf007b4=readFileSync(_0xb1c6fc,_0x34c664(0x175));let _0x32fa35;try{_0x32fa35=JSON[_0x34c664(0x16b)](_0xf007b4);}catch{throw new Error(_0x34c664(0x176)+_0xb1c6fc);}if(!_0x32fa35||typeof _0x32fa35!==_0x34c664(0x16f))throw new Error(_0x34c664(0x164));const _0x400256=_0x32fa35;if(!_0x400256[_0x34c664(0x178)]||typeof _0x400256[_0x34c664(0x178)]!=='string')throw new Error(_0x34c664(0x16c));return{'workflow_project':_0x400256[_0x34c664(0x178)],'workflow_project_id':typeof _0x400256[_0x34c664(0x172)]===_0x34c664(0x166)?_0x400256['workflow_project_id']:undefined,'last_pulled_revision':typeof _0x400256[_0x34c664(0x179)]===_0x34c664(0x166)?_0x400256[_0x34c664(0x179)]:undefined,'last_pulled_at':typeof _0x400256[_0x34c664(0x15e)]===_0x34c664(0x166)?_0x400256[_0x34c664(0x15e)]:undefined,'last_pushed_revision':typeof _0x400256['last_pushed_revision']==='string'?_0x400256['last_pushed_revision']:undefined,'last_pushed_at':typeof _0x400256[_0x34c664(0x16a)]===_0x34c664(0x166)?_0x400256['last_pushed_at']:undefined};}export function findWorkflowTdxConfig(_0x312641=process['cwd']()){const _0x453974=a183_0x51f1be,_0x5da5e1=findWorkflowTdxConfigPath(_0x312641);if(!_0x5da5e1)throw new Error(_0x453974(0x167));const _0x25b81f=loadWorkflowTdxConfig(_0x5da5e1),_0x275fb8=a183_0x5f5271[_0x453974(0x161)](_0x5da5e1);return{'config':_0x25b81f,'configPath':_0x5da5e1,'configDir':_0x275fb8};}export function tryFindWorkflowTdxConfig(_0x42271d){try{return findWorkflowTdxConfig(_0x42271d);}catch{return null;}}export function getWorkflowProjectDir(_0x3cf3e2,_0x2acb9c=process[a183_0x51f1be(0x160)]()){return a183_0x5f5271['join'](_0x2acb9c,WORKFLOWS_DIR,_0x3cf3e2);}export function getWorkflowTdxConfigPath(_0x23919d,_0x17aaa7=process['cwd']()){const _0x250cc4=a183_0x51f1be;return a183_0x5f5271[_0x250cc4(0x15d)](getWorkflowProjectDir(_0x23919d,_0x17aaa7),TDX_CONFIG_FILE);}function a183_0x1aa6(){const _0x2197a7=['workflow_project','last_pulled_revision','23740hKHjmU','join','last_pulled_at','stringify','cwd','dirname','378059IGdnwa','3119112oYTSsB','Invalid\x20tdx.json:\x20expected\x20object','54mOqKtK','string','No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.','39810SbvtxM','1608wxACOb','last_pushed_at','parse','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field','resolve','root','object','791460UIUyRQ','21469BOdplJ','workflow_project_id','tdx.json','2188824qNfLye','utf-8','Invalid\x20JSON\x20in\x20','465bQnEJI'];a183_0x1aa6=function(){return _0x2197a7;};return a183_0x1aa6();}export function createWorkflowTdxConfigContent(_0x345bb0,_0x250398,_0x470170){const _0x8c9048=a183_0x51f1be,_0x38328d={'workflow_project':_0x345bb0,..._0x250398&&{'workflow_project_id':_0x250398},..._0x470170&&{'last_pulled_revision':_0x470170},'last_pulled_at':new Date()['toISOString']()};return JSON[_0x8c9048(0x15f)](_0x38328d,null,0x2)+'\x0a';}export function saveWorkflowTdxConfig(_0x2ec495,_0x51076d){const _0x53cf14=a183_0x51f1be,_0x100a87=JSON[_0x53cf14(0x15f)](_0x51076d,null,0x2)+'\x0a';writeFileSync(_0x2ec495,_0x100a87,_0x53cf14(0x175));}export function updateWorkflowTdxConfig(_0xb87efd,_0x5973e9){const _0xdf1b8a=loadWorkflowTdxConfig(_0xb87efd),_0x3c6777={..._0xdf1b8a,..._0x5973e9};saveWorkflowTdxConfig(_0xb87efd,_0x3c6777);}