@treasuredata/tdx 2026.3.24 → 2026.3.26

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 (206) 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.js +1 -1
  5. package/dist/commands/activations.js +1 -1
  6. package/dist/commands/agent-command.js +1 -1
  7. package/dist/commands/agent-test-command.js +1 -1
  8. package/dist/commands/api-command.js +1 -1
  9. package/dist/commands/auth-command.js +1 -1
  10. package/dist/commands/auth-login-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/databases.js +1 -1
  18. package/dist/commands/delivery-command.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-campaign-pull-command.js +1 -1
  21. package/dist/commands/engage-campaign-push-command.js +1 -1
  22. package/dist/commands/engage-campaign-validate-command.js +1 -1
  23. package/dist/commands/engage-command.js +1 -1
  24. package/dist/commands/engage-template-pull-command.js +1 -1
  25. package/dist/commands/engage-template-push-command.js +1 -1
  26. package/dist/commands/engage-template-validate-command.js +1 -1
  27. package/dist/commands/job-command.js +1 -1
  28. package/dist/commands/journey-command.js +1 -1
  29. package/dist/commands/journey-validate-command.js +1 -1
  30. package/dist/commands/llm-command.js +1 -1
  31. package/dist/commands/mcp-command.js +1 -1
  32. package/dist/commands/parent-segment-command.js +1 -1
  33. package/dist/commands/policy-command.js +1 -1
  34. package/dist/commands/profile-command.js +1 -1
  35. package/dist/commands/profiles-command.js +1 -1
  36. package/dist/commands/query-command.js +1 -1
  37. package/dist/commands/schedule-command.js +1 -1
  38. package/dist/commands/segment-command.js +1 -1
  39. package/dist/commands/segment-create-command.js +1 -1
  40. package/dist/commands/segment-fields-command.js +1 -1
  41. package/dist/commands/segment-pull-command.js +1 -1
  42. package/dist/commands/segment-push-command.js +1 -1
  43. package/dist/commands/segment-update-command.js +1 -1
  44. package/dist/commands/segment-use-command.js +1 -1
  45. package/dist/commands/segment-validate-command.js +1 -1
  46. package/dist/commands/segments.js +1 -1
  47. package/dist/commands/show.js +1 -1
  48. package/dist/commands/status-command.js +1 -1
  49. package/dist/commands/tables.js +1 -1
  50. package/dist/commands/unset-command.js +1 -1
  51. package/dist/commands/upgrade-command.js +1 -1
  52. package/dist/commands/use-command.js +1 -1
  53. package/dist/commands/user-command.js +1 -1
  54. package/dist/commands/workflow-command.js +1 -1
  55. package/dist/core/auth.js +1 -1
  56. package/dist/core/command-output.js +1 -1
  57. package/dist/core/config.js +1 -1
  58. package/dist/core/connection-cache.js +1 -1
  59. package/dist/core/constants.js +1 -1
  60. package/dist/core/credential-cache.js +1 -1
  61. package/dist/core/global-context.js +1 -1
  62. package/dist/core/keychain.js +1 -1
  63. package/dist/core/oauth-keychain.js +1 -1
  64. package/dist/core/oauth.js +1 -1
  65. package/dist/core/profile.js +1 -1
  66. package/dist/core/project-config.js +1 -1
  67. package/dist/core/session.js +1 -1
  68. package/dist/core/user-cache.js +1 -1
  69. package/dist/core/version.js +1 -1
  70. package/dist/index.js +1 -1
  71. package/dist/mcp/server.js +1 -1
  72. package/dist/mcp/tools/index.js +1 -1
  73. package/dist/mcp/tools/tdx-run.js +1 -1
  74. package/dist/mcp/tools/tdx-search.js +1 -1
  75. package/dist/mcp/utils.js +1 -1
  76. package/dist/proxy/claude-usage-tracker.js +1 -1
  77. package/dist/proxy/passthrough-server.js +1 -1
  78. package/dist/proxy/sse-usage-parser.js +1 -1
  79. package/dist/sdk/agent/agent-config.js +1 -1
  80. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  81. package/dist/sdk/agent/agent-yaml.js +1 -1
  82. package/dist/sdk/agent/test/evaluator.js +1 -1
  83. package/dist/sdk/agent/test/executor.js +1 -1
  84. package/dist/sdk/agent/test/index.js +1 -1
  85. package/dist/sdk/agent/test/output.js +1 -1
  86. package/dist/sdk/agent/test/parser.js +1 -1
  87. package/dist/sdk/agent/tool-target-registry.js +1 -1
  88. package/dist/sdk/api.js +1 -1
  89. package/dist/sdk/client/cdp-api-client.js +1 -1
  90. package/dist/sdk/client/delivery-api-client.js +1 -1
  91. package/dist/sdk/client/endpoints.js +1 -1
  92. package/dist/sdk/client/engage-api-client.js +1 -1
  93. package/dist/sdk/client/http-client.js +1 -1
  94. package/dist/sdk/client/llm-api-client.js +1 -1
  95. package/dist/sdk/client/oauth-refresh.js +1 -1
  96. package/dist/sdk/client/rate-limiter.js +1 -1
  97. package/dist/sdk/client/td-api-client.js +1 -1
  98. package/dist/sdk/client/trino-api-client.js +1 -1
  99. package/dist/sdk/client/workflow-client.js +1 -1
  100. package/dist/sdk/connection-validator.js +1 -1
  101. package/dist/sdk/connection.js +1 -1
  102. package/dist/sdk/delivery.js +1 -1
  103. package/dist/sdk/engage/campaign-pull.js +1 -1
  104. package/dist/sdk/engage/campaign-push.js +1 -1
  105. package/dist/sdk/engage/campaign-validator.js +1 -1
  106. package/dist/sdk/engage/campaign-yaml.js +1 -1
  107. package/dist/sdk/engage/template-pull.js +1 -1
  108. package/dist/sdk/engage/template-push.js +1 -1
  109. package/dist/sdk/engage/template-validator.js +1 -1
  110. package/dist/sdk/engage/template-yaml.js +1 -1
  111. package/dist/sdk/engage/types/campaign-def.js +1 -1
  112. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  113. package/dist/sdk/engage/types/template-schema.js +1 -1
  114. package/dist/sdk/engage.js +1 -1
  115. package/dist/sdk/errors.js +1 -1
  116. package/dist/sdk/index.js +1 -1
  117. package/dist/sdk/io/index.js +1 -1
  118. package/dist/sdk/io/node-filesystem.js +1 -1
  119. package/dist/sdk/job.js +1 -1
  120. package/dist/sdk/journey.js +1 -1
  121. package/dist/sdk/llm/chat-cache.js +1 -1
  122. package/dist/sdk/llm/index.js +1 -1
  123. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  124. package/dist/sdk/llm/model-factors.js +1 -1
  125. package/dist/sdk/personalization.js +1 -1
  126. package/dist/sdk/policy.js +1 -1
  127. package/dist/sdk/query/index.js +1 -1
  128. package/dist/sdk/query/sql-parser.js +1 -1
  129. package/dist/sdk/realtime.js +1 -1
  130. package/dist/sdk/schedule.js +1 -1
  131. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  132. package/dist/sdk/segment/fields-display.js +1 -1
  133. package/dist/sdk/segment/file-discovery.js +1 -1
  134. package/dist/sdk/segment/journey-utils.js +1 -1
  135. package/dist/sdk/segment/journey-validator.js +1 -1
  136. package/dist/sdk/segment/journey-yaml.js +1 -1
  137. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  138. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  139. package/dist/sdk/segment/pull-workflow.js +1 -1
  140. package/dist/sdk/segment/push-recovery.js +1 -1
  141. package/dist/sdk/segment/push-workflow.js +1 -1
  142. package/dist/sdk/segment/resolution-context.js +1 -1
  143. package/dist/sdk/segment/segment-path-parser.js +1 -1
  144. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  145. package/dist/sdk/segment/segment-validator.js +1 -1
  146. package/dist/sdk/segment/target-resolution.js +1 -1
  147. package/dist/sdk/segment/tdx-config.js +1 -1
  148. package/dist/sdk/segment/types/activation-schema.js +1 -1
  149. package/dist/sdk/segment/types/journey-def.js +1 -1
  150. package/dist/sdk/segment/types/journey-schema.js +1 -1
  151. package/dist/sdk/segment/types/segment-def.js +1 -1
  152. package/dist/sdk/segment/types/segment-schema.js +1 -1
  153. package/dist/sdk/segment/validate-files.js +1 -1
  154. package/dist/sdk/segment/yaml-validator.js +1 -1
  155. package/dist/sdk/segment.d.ts +5 -0
  156. package/dist/sdk/segment.d.ts.map +1 -1
  157. package/dist/sdk/segment.js +1 -1
  158. package/dist/sdk/segment.js.map +1 -1
  159. package/dist/sdk/types/index.js +1 -1
  160. package/dist/sdk/types/progress.js +1 -1
  161. package/dist/sdk/user.js +1 -1
  162. package/dist/sdk/util/format-detector.js +1 -1
  163. package/dist/sdk/util/formatters.js +1 -1
  164. package/dist/sdk/util/index.js +1 -1
  165. package/dist/sdk/util/paginate.js +1 -1
  166. package/dist/sdk/util/tree-formatter.js +1 -1
  167. package/dist/sdk/workflow/archive-validation.js +1 -1
  168. package/dist/sdk/workflow/clone-workflow.js +1 -1
  169. package/dist/sdk/workflow/index.js +1 -1
  170. package/dist/sdk/workflow/pull-workflow.js +1 -1
  171. package/dist/sdk/workflow/push-workflow.js +1 -1
  172. package/dist/sdk/workflow/tdx-config.js +1 -1
  173. package/dist/sdk/workflow/workflow-utils.js +1 -1
  174. package/dist/test-utils/command-runner.js +1 -1
  175. package/dist/test-utils/factories.js +1 -1
  176. package/dist/test-utils/fixtures.js +1 -1
  177. package/dist/test-utils/http-mock.js +1 -1
  178. package/dist/test-utils/index.js +1 -1
  179. package/dist/utils/async.js +1 -1
  180. package/dist/utils/colors.js +1 -1
  181. package/dist/utils/diff.js +1 -1
  182. package/dist/utils/file-permissions.js +1 -1
  183. package/dist/utils/file-reader.js +1 -1
  184. package/dist/utils/github-releases.js +1 -1
  185. package/dist/utils/global-cache.js +1 -1
  186. package/dist/utils/json-loader.js +1 -1
  187. package/dist/utils/local-cache.js +1 -1
  188. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  189. package/dist/utils/logger/formatters/index.js +1 -1
  190. package/dist/utils/logger/handlers/console-handler.js +1 -1
  191. package/dist/utils/logger/handlers/file-handler.js +1 -1
  192. package/dist/utils/logger/handlers/index.js +1 -1
  193. package/dist/utils/logger/handlers/null-handler.js +1 -1
  194. package/dist/utils/logger/index.js +1 -1
  195. package/dist/utils/logger/logger.js +1 -1
  196. package/dist/utils/logger/types.js +1 -1
  197. package/dist/utils/option-validation.js +1 -1
  198. package/dist/utils/process.js +1 -1
  199. package/dist/utils/prompt.js +1 -1
  200. package/dist/utils/spinner.js +1 -1
  201. package/dist/utils/sse-parser.js +1 -1
  202. package/dist/utils/string-utils.js +1 -1
  203. package/dist/utils/table-ref-parser.js +1 -1
  204. package/dist/utils/tdx-logger.js +1 -1
  205. package/dist/utils/version-check.js +1 -1
  206. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x202473,_0x50c1d7){var _0x3145d6=a175_0x2dde,_0x561040=_0x202473();while(!![]){try{var _0x40fc9b=parseInt(_0x3145d6(0x1e2))/0x1+-parseInt(_0x3145d6(0x1e5))/0x2*(parseInt(_0x3145d6(0x1e3))/0x3)+parseInt(_0x3145d6(0x1e4))/0x4+parseInt(_0x3145d6(0x1dd))/0x5*(-parseInt(_0x3145d6(0x1df))/0x6)+-parseInt(_0x3145d6(0x1e7))/0x7+-parseInt(_0x3145d6(0x1e0))/0x8*(parseInt(_0x3145d6(0x1de))/0x9)+-parseInt(_0x3145d6(0x1e1))/0xa*(-parseInt(_0x3145d6(0x1e6))/0xb);if(_0x40fc9b===_0x50c1d7)break;else _0x561040['push'](_0x561040['shift']());}catch(_0x142c77){_0x561040['push'](_0x561040['shift']());}}}(a175_0x1656,0x2db42));export*from'./formatters.js';function a175_0x1656(){var _0x511841=['1048TaQoHO','113690fzwtiy','100351zNfovM','84jivuzp','967024zIGWgZ','12872syoFBf','143aiYhVi','330526LiKjdd','115uSEMlQ','2961sTgfVg','8394QdubUh'];a175_0x1656=function(){return _0x511841;};return a175_0x1656();}export*from'./format-detector.js';export*from'./tree-formatter.js';function a175_0x2dde(_0x1f45ea,_0x4633b7){_0x1f45ea=_0x1f45ea-0x1dd;var _0x16560e=a175_0x1656();var _0x2dde1a=_0x16560e[_0x1f45ea];return _0x2dde1a;}export*from'./paginate.js';
1
+ function a175_0x118c(){var _0x4c0269=['1821EgKwGs','455782DENpFS','1500237EvBMtE','8vVCGWS','6cdpZGy','1772VkQett','819610wdIIJe','348501EMipNJ','5053190DFgxUk','114926Ulsdgk'];a175_0x118c=function(){return _0x4c0269;};return a175_0x118c();}function a175_0x54a4(_0x1a048c,_0x5555e8){_0x1a048c=_0x1a048c-0x6d;var _0x118c51=a175_0x118c();var _0x54a429=_0x118c51[_0x1a048c];return _0x54a429;}(function(_0x5191bb,_0x47bc62){var _0x15c4e8=a175_0x54a4,_0x414941=_0x5191bb();while(!![]){try{var _0xa2e62b=-parseInt(_0x15c4e8(0x6d))/0x1+-parseInt(_0x15c4e8(0x71))/0x2+-parseInt(_0x15c4e8(0x70))/0x3*(-parseInt(_0x15c4e8(0x75))/0x4)+-parseInt(_0x15c4e8(0x76))/0x5+-parseInt(_0x15c4e8(0x74))/0x6*(parseInt(_0x15c4e8(0x6f))/0x7)+-parseInt(_0x15c4e8(0x73))/0x8*(-parseInt(_0x15c4e8(0x72))/0x9)+parseInt(_0x15c4e8(0x6e))/0xa;if(_0xa2e62b===_0x47bc62)break;else _0x414941['push'](_0x414941['shift']());}catch(_0x5c6f58){_0x414941['push'](_0x414941['shift']());}}}(a175_0x118c,0x2cf75));export*from'./formatters.js';export*from'./format-detector.js';export*from'./tree-formatter.js';export*from'./paginate.js';
@@ -1 +1 @@
1
- function a176_0x3167(_0x1d8769,_0x34ec24){_0x1d8769=_0x1d8769-0x1a1;const _0x5ddeaa=a176_0x5dde();let _0x316759=_0x5ddeaa[_0x1d8769];return _0x316759;}(function(_0x573466,_0x3b47a0){const _0x3d5ee0=a176_0x3167,_0x2dc3cd=_0x573466();while(!![]){try{const _0x19538f=-parseInt(_0x3d5ee0(0x1ab))/0x1+-parseInt(_0x3d5ee0(0x1ad))/0x2+parseInt(_0x3d5ee0(0x1ae))/0x3+-parseInt(_0x3d5ee0(0x1a1))/0x4*(parseInt(_0x3d5ee0(0x1a2))/0x5)+parseInt(_0x3d5ee0(0x1ac))/0x6*(parseInt(_0x3d5ee0(0x1a7))/0x7)+-parseInt(_0x3d5ee0(0x1aa))/0x8+parseInt(_0x3d5ee0(0x1a4))/0x9;if(_0x19538f===_0x3b47a0)break;else _0x2dc3cd['push'](_0x2dc3cd['shift']());}catch(_0x2ba822){_0x2dc3cd['push'](_0x2dc3cd['shift']());}}}(a176_0x5dde,0x1b69e));export const PAGE_SIZE=0x64;export const MAX_PAGINATION_LIMIT=0x2710;function a176_0x5dde(){const _0x3a2197=['260564LOZctX','580281mBGPYe','8696EjNSeg','65RDhvkP','data','3575799slqjze','length','push','10451bcfmPx','min','slice','1515440CTGUfT','221551DAuZql','366dcuslm'];a176_0x5dde=function(){return _0x3a2197;};return a176_0x5dde();}export async function paginate(_0x2be8cc,_0x5cea5c=MAX_PAGINATION_LIMIT,_0x1856ed=0x0){const _0x2cd0cc=a176_0x3167,_0x5d3eeb=Math[_0x2cd0cc(0x1a8)](_0x5cea5c,MAX_PAGINATION_LIMIT),_0x3c290d=[];let _0x377838=_0x1856ed;while(_0x3c290d[_0x2cd0cc(0x1a5)]<_0x5d3eeb){const _0x13a7aa=Math[_0x2cd0cc(0x1a8)](PAGE_SIZE,_0x5d3eeb-_0x3c290d['length']),_0x1b2a70=await _0x2be8cc(_0x13a7aa,_0x377838),_0x137633=Array['isArray'](_0x1b2a70[_0x2cd0cc(0x1a3)])?_0x1b2a70[_0x2cd0cc(0x1a3)]:[_0x1b2a70['data']];_0x3c290d[_0x2cd0cc(0x1a6)](..._0x137633);if(_0x137633[_0x2cd0cc(0x1a5)]<_0x13a7aa)break;_0x377838+=_0x13a7aa;}return _0x3c290d[_0x2cd0cc(0x1a5)]>_0x5d3eeb?_0x3c290d[_0x2cd0cc(0x1a9)](0x0,_0x5d3eeb):_0x3c290d;}
1
+ (function(_0x24a046,_0x58c834){const _0x2f0884=a176_0x10cc,_0x187db0=_0x24a046();while(!![]){try{const _0xbc8d67=-parseInt(_0x2f0884(0x1e9))/0x1*(parseInt(_0x2f0884(0x1e1))/0x2)+-parseInt(_0x2f0884(0x1dc))/0x3*(-parseInt(_0x2f0884(0x1df))/0x4)+-parseInt(_0x2f0884(0x1dd))/0x5+-parseInt(_0x2f0884(0x1eb))/0x6*(parseInt(_0x2f0884(0x1e6))/0x7)+parseInt(_0x2f0884(0x1db))/0x8+-parseInt(_0x2f0884(0x1de))/0x9*(parseInt(_0x2f0884(0x1ea))/0xa)+-parseInt(_0x2f0884(0x1e3))/0xb*(-parseInt(_0x2f0884(0x1e8))/0xc);if(_0xbc8d67===_0x58c834)break;else _0x187db0['push'](_0x187db0['shift']());}catch(_0x214a63){_0x187db0['push'](_0x187db0['shift']());}}}(a176_0x32b0,0x27bde));export const PAGE_SIZE=0x64;export const MAX_PAGINATION_LIMIT=0x2710;function a176_0x32b0(){const _0x3cfd3e=['57660uhqcNh','isArray','1667096LpTAIe','179844OnoDyD','179935bbsinl','18JRjgyQ','16zolMPF','length','98vuJeOy','min','33jUFUcO','push','data','140vgwUEK','slice','1966788YDgNNI','4961uGVAcr','1529090rLnpmJ'];a176_0x32b0=function(){return _0x3cfd3e;};return a176_0x32b0();}function a176_0x10cc(_0x5944c3,_0x951758){_0x5944c3=_0x5944c3-0x1da;const _0x32b055=a176_0x32b0();let _0x10cc78=_0x32b055[_0x5944c3];return _0x10cc78;}export async function paginate(_0x300878,_0x42b41e=MAX_PAGINATION_LIMIT,_0xfbbc44=0x0){const _0x2bfb95=a176_0x10cc,_0x120ebf=Math[_0x2bfb95(0x1e2)](_0x42b41e,MAX_PAGINATION_LIMIT),_0x59d461=[];let _0x1cc2f2=_0xfbbc44;while(_0x59d461[_0x2bfb95(0x1e0)]<_0x120ebf){const _0x30b765=Math[_0x2bfb95(0x1e2)](PAGE_SIZE,_0x120ebf-_0x59d461['length']),_0x444476=await _0x300878(_0x30b765,_0x1cc2f2),_0x31a017=Array[_0x2bfb95(0x1da)](_0x444476[_0x2bfb95(0x1e5)])?_0x444476[_0x2bfb95(0x1e5)]:[_0x444476[_0x2bfb95(0x1e5)]];_0x59d461[_0x2bfb95(0x1e4)](..._0x31a017);if(_0x31a017[_0x2bfb95(0x1e0)]<_0x30b765)break;_0x1cc2f2+=_0x30b765;}return _0x59d461['length']>_0x120ebf?_0x59d461[_0x2bfb95(0x1e7)](0x0,_0x120ebf):_0x59d461;}
@@ -1 +1 @@
1
- (function(_0x14f54a,_0x2c0f87){const _0x345c63=a177_0x1b0b,_0x43c844=_0x14f54a();while(!![]){try{const _0x338aa7=-parseInt(_0x345c63(0x1d1))/0x1*(parseInt(_0x345c63(0x1d9))/0x2)+parseInt(_0x345c63(0x1ba))/0x3*(-parseInt(_0x345c63(0x1c6))/0x4)+parseInt(_0x345c63(0x1d4))/0x5+parseInt(_0x345c63(0x1cf))/0x6*(-parseInt(_0x345c63(0x1b6))/0x7)+parseInt(_0x345c63(0x1ce))/0x8+-parseInt(_0x345c63(0x1bb))/0x9*(-parseInt(_0x345c63(0x1bc))/0xa)+parseInt(_0x345c63(0x1d6))/0xb;if(_0x338aa7===_0x2c0f87)break;else _0x43c844['push'](_0x43c844['shift']());}catch(_0x262b2d){_0x43c844['push'](_0x43c844['shift']());}}}(a177_0x234e,0xb7018));function a177_0x234e(){const _0x264416=['name','join','293732kIpzwv','segmentCount','sort','└──\x20','journeyBundleName','📁\x20','dim','showMetadata','6896152zkwdsm','18vHojFp','├──\x20','13bWFOYL','length','children','3916190OHgnzR','getSegmentUrl','14622124SuahjN','type','draft','146892RNstty','map','(draft)','journey','population','(completed)','journeyCount','🗺️','displayName','showTreeLines','state','metadata','\x20segment','folderCount','(paused)','showIcons','\x20\x20\x20\x20','folder','1855777QOlQFq','icon','indent','sortKey','57NRqJli','1183383LmEdyd','70SaNzUd','segment','push','(running)','paused','launched','🎯\x20','localeCompare'];a177_0x234e=function(){return _0x264416;};return a177_0x234e();}function a177_0x1b0b(_0x290f26,_0x1f4c7a){_0x290f26=_0x290f26-0x1b5;const _0x234eea=a177_0x234e();let _0x1b0bdf=_0x234eea[_0x290f26];return _0x1b0bdf;}import{formatRows,hyperlink}from'./formatters.js';import a177_0x4ad61f from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};export function formatTree(_0x357ad1,_0x113d6b={},_0x362422=0x0,_0x5ce11b=''){const _0x20c334=a177_0x1b0b,_0xb0709={...DEFAULT_OPTIONS,..._0x113d6b},_0x318905=[],_0x4e80b2=[..._0x357ad1]['sort']((_0x2d6e21,_0x4a218f)=>_0x2d6e21['name'][_0x20c334(0x1c3)](_0x4a218f['name'],undefined,{'sensitivity':'base'}));for(let _0x517659=0x0;_0x517659<_0x4e80b2['length'];_0x517659++){const _0x44b9fa=_0x4e80b2[_0x517659],_0x4dbf15=_0x517659===_0x4e80b2[_0x20c334(0x1d2)]-0x1;let _0x2bd24e='';_0x362422>0x0&&(_0x2bd24e+=_0x5ce11b);_0xb0709['showTreeLines']&&_0x362422>0x0&&(_0x2bd24e+=a177_0x4ad61f[_0x20c334(0x1cc)](_0x4dbf15?_0x20c334(0x1c9):_0x20c334(0x1d0)));if(_0xb0709[_0x20c334(0x1e8)]){if(_0x44b9fa[_0x20c334(0x1d7)]===_0x20c334(0x1b5))_0x2bd24e+=_0x20c334(0x1cb);else _0x44b9fa[_0x20c334(0x1d7)]===_0x20c334(0x1dc)?_0x2bd24e+='🗺️\x20':_0x2bd24e+=_0x20c334(0x1c2);}if(_0xb0709[_0x20c334(0x1d5)]&&_0x44b9fa[_0x20c334(0x1d7)]===_0x20c334(0x1bd))_0x2bd24e+=hyperlink(_0x44b9fa[_0x20c334(0x1c4)],_0xb0709['getSegmentUrl'](_0x44b9fa['id']));else _0xb0709['getJourneyUrl']&&_0x44b9fa[_0x20c334(0x1d7)]===_0x20c334(0x1dc)?_0x2bd24e+=hyperlink(_0x44b9fa['name'],_0xb0709['getJourneyUrl'](_0x44b9fa['id'])):_0x2bd24e+=_0x44b9fa[_0x20c334(0x1c4)];if(_0xb0709[_0x20c334(0x1cd)]){if(_0x44b9fa[_0x20c334(0x1d7)]===_0x20c334(0x1b5)){const _0x3796c0=[];_0x44b9fa['metadata'][_0x20c334(0x1c7)]&&_0x3796c0[_0x20c334(0x1be)](_0x44b9fa[_0x20c334(0x1e4)][_0x20c334(0x1c7)]+_0x20c334(0x1e5)+(_0x44b9fa['metadata'][_0x20c334(0x1c7)]!==0x1?'s':'')),_0x44b9fa[_0x20c334(0x1e4)][_0x20c334(0x1e6)]&&_0x3796c0[_0x20c334(0x1be)](_0x44b9fa[_0x20c334(0x1e4)][_0x20c334(0x1e6)]+'\x20folder'+(_0x44b9fa[_0x20c334(0x1e4)][_0x20c334(0x1e6)]!==0x1?'s':'')),_0x44b9fa[_0x20c334(0x1e4)][_0x20c334(0x1df)]&&_0x3796c0[_0x20c334(0x1be)](_0x44b9fa['metadata'][_0x20c334(0x1df)]+'\x20journey'+(_0x44b9fa[_0x20c334(0x1e4)]['journeyCount']!==0x1?'s':'')),_0x3796c0[_0x20c334(0x1d2)]>0x0&&(_0x2bd24e+=a177_0x4ad61f[_0x20c334(0x1cc)]('\x20('+_0x3796c0[_0x20c334(0x1c5)](',\x20')+')'));}else{if(_0x44b9fa[_0x20c334(0x1d7)]==='segment'&&_0x44b9fa[_0x20c334(0x1dd)]!==undefined)_0x2bd24e+=a177_0x4ad61f['dim']('\x20('+formatRows(_0x44b9fa[_0x20c334(0x1dd)])+')');else _0x44b9fa[_0x20c334(0x1d7)]===_0x20c334(0x1dc)&&_0x44b9fa[_0x20c334(0x1e3)]&&(_0x2bd24e+=a177_0x4ad61f[_0x20c334(0x1cc)]('\x20'+getJourneyStateIndicator(_0x44b9fa[_0x20c334(0x1e3)])));}}_0x318905['push'](_0x2bd24e);if(_0x44b9fa[_0x20c334(0x1d3)]&&_0x44b9fa[_0x20c334(0x1d3)][_0x20c334(0x1d2)]>0x0){let _0x466d93;if(_0x362422===0x0)_0x466d93='';else _0xb0709[_0x20c334(0x1e2)]?_0x466d93=_0x5ce11b+(_0x4dbf15?_0x20c334(0x1e9):a177_0x4ad61f[_0x20c334(0x1cc)]('│')+'\x20\x20\x20'):_0x466d93=_0x5ce11b+_0xb0709[_0x20c334(0x1b8)];const _0x54cf8a=formatTree(_0x44b9fa[_0x20c334(0x1d3)],_0xb0709,_0x362422+0x1,_0x466d93);_0x318905[_0x20c334(0x1be)](_0x54cf8a);}}return _0x318905[_0x20c334(0x1c5)]('\x0a');}export function formatFlatList(_0x1285da,_0x5b6ae5,_0xe768f8={},_0x3a92b2=[]){const _0x3ff673=a177_0x1b0b,_0x1c097e={...DEFAULT_OPTIONS,..._0xe768f8},_0x1bf997=[];for(const _0x2fda4d of _0x1285da){_0x1bf997[_0x3ff673(0x1be)]({'sortKey':_0x2fda4d[_0x3ff673(0x1c4)],'displayName':_0x2fda4d[_0x3ff673(0x1c4)],'icon':_0x1c097e[_0x3ff673(0x1e8)]?'📁':'','metadata':undefined});}for(const _0x1a39af of _0x5b6ae5){const _0x43db24=_0x1c097e[_0x3ff673(0x1cd)]&&_0x1a39af['population']!==undefined?a177_0x4ad61f[_0x3ff673(0x1cc)]('\x20('+formatRows(_0x1a39af['population'])+')'):'',_0x5691e7=_0x1c097e[_0x3ff673(0x1d5)]?hyperlink(_0x1a39af[_0x3ff673(0x1c4)],_0x1c097e[_0x3ff673(0x1d5)](_0x1a39af['id'])):_0x1a39af[_0x3ff673(0x1c4)];_0x1bf997[_0x3ff673(0x1be)]({'sortKey':_0x1a39af[_0x3ff673(0x1c4)],'displayName':_0x5691e7,'icon':_0x1c097e[_0x3ff673(0x1e8)]?'🎯':'','metadata':_0x43db24});}for(const _0x3ba9a6 of _0x3a92b2){const _0x17c131=getJourneyStateIndicator(_0x3ba9a6[_0x3ff673(0x1e3)]),_0x283e2c=_0x1c097e[_0x3ff673(0x1cd)]?a177_0x4ad61f[_0x3ff673(0x1cc)]('\x20'+_0x17c131):'',_0x520ec6=_0x1c097e['getJourneyUrl']?hyperlink(_0x3ba9a6['journeyBundleName'],_0x1c097e['getJourneyUrl'](_0x3ba9a6['id'])):_0x3ba9a6[_0x3ff673(0x1ca)];_0x1bf997['push']({'sortKey':_0x3ba9a6[_0x3ff673(0x1ca)],'displayName':_0x520ec6,'icon':_0x1c097e[_0x3ff673(0x1e8)]?_0x3ff673(0x1e0):'','metadata':_0x283e2c});}_0x1bf997[_0x3ff673(0x1c8)]((_0x1e1a43,_0x5baf59)=>_0x1e1a43['sortKey'][_0x3ff673(0x1c3)](_0x5baf59[_0x3ff673(0x1b9)],undefined,{'sensitivity':'base'}));if(_0x1bf997[_0x3ff673(0x1d2)]===0x0)return'(empty)';const _0x1f2f5a=_0x1bf997[_0x3ff673(0x1da)](_0x3451aa=>{const _0x3c46dd=_0x3ff673,_0x398b62=_0x3451aa[_0x3c46dd(0x1b7)]?_0x3451aa[_0x3c46dd(0x1b7)]+'\x20':'',_0x491022=_0x3451aa[_0x3c46dd(0x1e4)]||'';return''+_0x398b62+_0x3451aa[_0x3c46dd(0x1e1)]+_0x491022;});return _0x1f2f5a[_0x3ff673(0x1c5)]('\x0a');}function getJourneyStateIndicator(_0x396e4d){const _0x2493b2=a177_0x1b0b;switch(_0x396e4d){case _0x2493b2(0x1d8):return _0x2493b2(0x1db);case _0x2493b2(0x1c1):return _0x2493b2(0x1bf);case _0x2493b2(0x1c0):return _0x2493b2(0x1e7);case'completed':return _0x2493b2(0x1de);default:return'('+_0x396e4d+')';}}
1
+ function a177_0x13b6(_0x9c1b22,_0xb8e24b){_0x9c1b22=_0x9c1b22-0xed;const _0xec67cd=a177_0xec67();let _0x13b6f2=_0xec67cd[_0x9c1b22];return _0x13b6f2;}function a177_0xec67(){const _0x47d8b2=['state','152rNGSLf','segment','base','draft','842772RomCoi','└──\x20','6BTOMBA','486458jHoNLt','metadata','localeCompare','icon','join','completed','🗺️\x20','(completed)','(empty)','journey','273309zEsqdf','type','name','launched','(running)','getJourneyUrl','push','161538kJcRBh','📁\x20','\x20segment','25ppLvGV','├──\x20','displayName','folder','dim','(draft)','9298069MPfeLM','population','sortKey','segmentCount','showTreeLines','110gwBxTL','length','journeyCount','map','\x20folder','🗺️','children','12WMRfUF','showIcons','(paused)','journeyBundleName','showMetadata','folderCount','3555VfPKJr','getSegmentUrl','71319fdBHrY'];a177_0xec67=function(){return _0x47d8b2;};return a177_0xec67();}(function(_0x957aa0,_0x1b9856){const _0x1f10bf=a177_0x13b6,_0x168020=_0x957aa0();while(!![]){try{const _0x420964=parseInt(_0x1f10bf(0x118))/0x1+parseInt(_0x1f10bf(0x10d))/0x2*(parseInt(_0x1f10bf(0x105))/0x3)+parseInt(_0x1f10bf(0x10b))/0x4+-parseInt(_0x1f10bf(0x122))/0x5*(parseInt(_0x1f10bf(0x11f))/0x6)+parseInt(_0x1f10bf(0x10e))/0x7*(parseInt(_0x1f10bf(0x107))/0x8)+-parseInt(_0x1f10bf(0x103))/0x9*(-parseInt(_0x1f10bf(0xf6))/0xa)+parseInt(_0x1f10bf(0xf1))/0xb*(-parseInt(_0x1f10bf(0xfd))/0xc);if(_0x420964===_0x1b9856)break;else _0x168020['push'](_0x168020['shift']());}catch(_0x161339){_0x168020['push'](_0x168020['shift']());}}}(a177_0xec67,0xdbc3e));import{formatRows,hyperlink}from'./formatters.js';import a177_0x50f2de from'chalk';const DEFAULT_OPTIONS={'showTreeLines':!![],'showIcons':!![],'showMetadata':!![],'indent':'\x20\x20','getSegmentUrl':undefined,'getJourneyUrl':undefined};export function formatTree(_0x2eea1c,_0x545d2d={},_0x337153=0x0,_0x3e770d=''){const _0x2c4299=a177_0x13b6,_0x5a2322={...DEFAULT_OPTIONS,..._0x545d2d},_0x1be1b9=[],_0x120eff=[..._0x2eea1c]['sort']((_0x5c8683,_0xec2639)=>_0x5c8683[_0x2c4299(0x11a)]['localeCompare'](_0xec2639['name'],undefined,{'sensitivity':_0x2c4299(0x109)}));for(let _0x4dd487=0x0;_0x4dd487<_0x120eff[_0x2c4299(0xf7)];_0x4dd487++){const _0x433b53=_0x120eff[_0x4dd487],_0x597c93=_0x4dd487===_0x120eff['length']-0x1;let _0x1e01c0='';_0x337153>0x0&&(_0x1e01c0+=_0x3e770d);_0x5a2322['showTreeLines']&&_0x337153>0x0&&(_0x1e01c0+=a177_0x50f2de[_0x2c4299(0xef)](_0x597c93?_0x2c4299(0x10c):_0x2c4299(0x123)));if(_0x5a2322[_0x2c4299(0xfe)]){if(_0x433b53[_0x2c4299(0x119)]===_0x2c4299(0xee))_0x1e01c0+=_0x2c4299(0x120);else _0x433b53[_0x2c4299(0x119)]===_0x2c4299(0x117)?_0x1e01c0+=_0x2c4299(0x114):_0x1e01c0+='🎯\x20';}if(_0x5a2322[_0x2c4299(0x104)]&&_0x433b53['type']===_0x2c4299(0x108))_0x1e01c0+=hyperlink(_0x433b53[_0x2c4299(0x11a)],_0x5a2322['getSegmentUrl'](_0x433b53['id']));else _0x5a2322[_0x2c4299(0x11d)]&&_0x433b53[_0x2c4299(0x119)]==='journey'?_0x1e01c0+=hyperlink(_0x433b53[_0x2c4299(0x11a)],_0x5a2322[_0x2c4299(0x11d)](_0x433b53['id'])):_0x1e01c0+=_0x433b53[_0x2c4299(0x11a)];if(_0x5a2322['showMetadata']){if(_0x433b53[_0x2c4299(0x119)]===_0x2c4299(0xee)){const _0x20c31d=[];_0x433b53[_0x2c4299(0x10f)][_0x2c4299(0xf4)]&&_0x20c31d[_0x2c4299(0x11e)](_0x433b53[_0x2c4299(0x10f)][_0x2c4299(0xf4)]+_0x2c4299(0x121)+(_0x433b53['metadata'][_0x2c4299(0xf4)]!==0x1?'s':'')),_0x433b53[_0x2c4299(0x10f)][_0x2c4299(0x102)]&&_0x20c31d['push'](_0x433b53[_0x2c4299(0x10f)][_0x2c4299(0x102)]+_0x2c4299(0xfa)+(_0x433b53['metadata'][_0x2c4299(0x102)]!==0x1?'s':'')),_0x433b53[_0x2c4299(0x10f)][_0x2c4299(0xf8)]&&_0x20c31d[_0x2c4299(0x11e)](_0x433b53[_0x2c4299(0x10f)][_0x2c4299(0xf8)]+'\x20journey'+(_0x433b53[_0x2c4299(0x10f)][_0x2c4299(0xf8)]!==0x1?'s':'')),_0x20c31d['length']>0x0&&(_0x1e01c0+=a177_0x50f2de[_0x2c4299(0xef)]('\x20('+_0x20c31d[_0x2c4299(0x112)](',\x20')+')'));}else{if(_0x433b53[_0x2c4299(0x119)]===_0x2c4299(0x108)&&_0x433b53[_0x2c4299(0xf2)]!==undefined)_0x1e01c0+=a177_0x50f2de['dim']('\x20('+formatRows(_0x433b53[_0x2c4299(0xf2)])+')');else _0x433b53[_0x2c4299(0x119)]===_0x2c4299(0x117)&&_0x433b53[_0x2c4299(0x106)]&&(_0x1e01c0+=a177_0x50f2de[_0x2c4299(0xef)]('\x20'+getJourneyStateIndicator(_0x433b53[_0x2c4299(0x106)])));}}_0x1be1b9[_0x2c4299(0x11e)](_0x1e01c0);if(_0x433b53[_0x2c4299(0xfc)]&&_0x433b53[_0x2c4299(0xfc)][_0x2c4299(0xf7)]>0x0){let _0x1fac30;if(_0x337153===0x0)_0x1fac30='';else _0x5a2322[_0x2c4299(0xf5)]?_0x1fac30=_0x3e770d+(_0x597c93?'\x20\x20\x20\x20':a177_0x50f2de[_0x2c4299(0xef)]('│')+'\x20\x20\x20'):_0x1fac30=_0x3e770d+_0x5a2322['indent'];const _0x1e4f8b=formatTree(_0x433b53['children'],_0x5a2322,_0x337153+0x1,_0x1fac30);_0x1be1b9[_0x2c4299(0x11e)](_0x1e4f8b);}}return _0x1be1b9[_0x2c4299(0x112)]('\x0a');}export function formatFlatList(_0x1d795c,_0x2cac2e,_0x2382aa={},_0x24f289=[]){const _0x1c8029=a177_0x13b6,_0x254023={...DEFAULT_OPTIONS,..._0x2382aa},_0x436b9d=[];for(const _0x8bd5db of _0x1d795c){_0x436b9d[_0x1c8029(0x11e)]({'sortKey':_0x8bd5db[_0x1c8029(0x11a)],'displayName':_0x8bd5db['name'],'icon':_0x254023[_0x1c8029(0xfe)]?'📁':'','metadata':undefined});}for(const _0x2d136b of _0x2cac2e){const _0x14d183=_0x254023[_0x1c8029(0x101)]&&_0x2d136b[_0x1c8029(0xf2)]!==undefined?a177_0x50f2de[_0x1c8029(0xef)]('\x20('+formatRows(_0x2d136b[_0x1c8029(0xf2)])+')'):'',_0x5cfb18=_0x254023[_0x1c8029(0x104)]?hyperlink(_0x2d136b[_0x1c8029(0x11a)],_0x254023[_0x1c8029(0x104)](_0x2d136b['id'])):_0x2d136b[_0x1c8029(0x11a)];_0x436b9d[_0x1c8029(0x11e)]({'sortKey':_0x2d136b['name'],'displayName':_0x5cfb18,'icon':_0x254023['showIcons']?'🎯':'','metadata':_0x14d183});}for(const _0x151b94 of _0x24f289){const _0x3f35bc=getJourneyStateIndicator(_0x151b94[_0x1c8029(0x106)]),_0x7881c9=_0x254023[_0x1c8029(0x101)]?a177_0x50f2de[_0x1c8029(0xef)]('\x20'+_0x3f35bc):'',_0x32fd22=_0x254023[_0x1c8029(0x11d)]?hyperlink(_0x151b94[_0x1c8029(0x100)],_0x254023[_0x1c8029(0x11d)](_0x151b94['id'])):_0x151b94['journeyBundleName'];_0x436b9d[_0x1c8029(0x11e)]({'sortKey':_0x151b94['journeyBundleName'],'displayName':_0x32fd22,'icon':_0x254023['showIcons']?_0x1c8029(0xfb):'','metadata':_0x7881c9});}_0x436b9d['sort']((_0x10a11a,_0x3704d4)=>_0x10a11a['sortKey'][_0x1c8029(0x110)](_0x3704d4[_0x1c8029(0xf3)],undefined,{'sensitivity':_0x1c8029(0x109)}));if(_0x436b9d[_0x1c8029(0xf7)]===0x0)return _0x1c8029(0x116);const _0x1d6334=_0x436b9d[_0x1c8029(0xf9)](_0x187218=>{const _0x181abe=_0x1c8029,_0x33b271=_0x187218[_0x181abe(0x111)]?_0x187218[_0x181abe(0x111)]+'\x20':'',_0x32bd25=_0x187218[_0x181abe(0x10f)]||'';return''+_0x33b271+_0x187218[_0x181abe(0xed)]+_0x32bd25;});return _0x1d6334[_0x1c8029(0x112)]('\x0a');}function getJourneyStateIndicator(_0x3254c1){const _0x22d98a=a177_0x13b6;switch(_0x3254c1){case _0x22d98a(0x10a):return _0x22d98a(0xf0);case _0x22d98a(0x11b):return _0x22d98a(0x11c);case'paused':return _0x22d98a(0xff);case _0x22d98a(0x113):return _0x22d98a(0x115);default:return'('+_0x3254c1+')';}}
@@ -1 +1 @@
1
- const a178_0x3a40c0=a178_0x37aa;(function(_0x5077dc,_0x28fbe8){const _0x5b584b=a178_0x37aa,_0x529674=_0x5077dc();while(!![]){try{const _0x3fda85=-parseInt(_0x5b584b(0x193))/0x1+parseInt(_0x5b584b(0x1a5))/0x2*(-parseInt(_0x5b584b(0x1ad))/0x3)+-parseInt(_0x5b584b(0x1a8))/0x4*(parseInt(_0x5b584b(0x19e))/0x5)+-parseInt(_0x5b584b(0x19d))/0x6*(parseInt(_0x5b584b(0x1a1))/0x7)+-parseInt(_0x5b584b(0x19f))/0x8+parseInt(_0x5b584b(0x1ac))/0x9+parseInt(_0x5b584b(0x1a6))/0xa;if(_0x3fda85===_0x28fbe8)break;else _0x529674['push'](_0x529674['shift']());}catch(_0x14e7a1){_0x529674['push'](_0x529674['shift']());}}}(a178_0xe4bf,0x4d238));function a178_0x37aa(_0x5b7ff8,_0x3f84cf){_0x5b7ff8=_0x5b7ff8-0x192;const _0xe4bf34=a178_0xe4bf();let _0x37aa24=_0xe4bf34[_0x5b7ff8];return _0x37aa24;}import{SDKError,ErrorCode}from'../errors.js';const GZIP_MAGIC=Buffer[a178_0x3a40c0(0x1a9)]([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0xd5fbf){const _0x26628e=a178_0x3a40c0;if(_0xd5fbf[_0x26628e(0x1a4)]<MIN_GZIP_SIZE)return{'isValid':![],'size':_0xd5fbf[_0x26628e(0x1a4)],'error':{'message':'Downloaded\x20archive\x20is\x20too\x20small\x20('+_0xd5fbf['length']+_0x26628e(0x1b1),'preview':getContentPreview(_0xd5fbf),'helpText':_0x26628e(0x194)}};if(!_0xd5fbf[_0x26628e(0x1ab)](0x0,0x2)[_0x26628e(0x1ae)](GZIP_MAGIC)){const _0xf34235=getContentPreview(_0xd5fbf),_0x4a4bc5=_0xf34235?_0x26628e(0x1a3)+_0xf34235:'';return{'isValid':![],'size':_0xd5fbf[_0x26628e(0x1a4)],'error':{'message':_0x26628e(0x199)+_0x4a4bc5,'preview':_0xf34235,'helpText':_0x26628e(0x192)}};}return{'isValid':!![],'size':_0xd5fbf[_0x26628e(0x1a4)]};}function a178_0xe4bf(){const _0x5982a9=['Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.','slice','split','toString','1836vHLLcM','5wnYrCu','1504976UFWDsI','WORKFLOW_ARCHIVE_CORRUPTED','10633HxpxVN','error','\x20Server\x20response\x20preview:\x20','length','2OeCWtu','15530460TvAUmx','utf-8','831332NLecxr','from','...','subarray','1699524LrTgXs','1423467oPTcSz','equals','Archive\x20validation\x20failed\x20with\x20unknown\x20error','message','\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.','The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.','90664NIpKhi','Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.','trim','(empty\x20response)','filter','charCodeAt'];a178_0xe4bf=function(){return _0x5982a9;};return a178_0xe4bf();}function getContentPreview(_0x38c113){const _0x78618d=a178_0x3a40c0;if(_0x38c113[_0x78618d(0x1a4)]===0x0)return _0x78618d(0x196);const _0x5c9702=_0x38c113[_0x78618d(0x1ab)](0x0,0xc8)[_0x78618d(0x19c)](_0x78618d(0x1a7)),_0x340aab=_0x5c9702[_0x78618d(0x19b)]('')[_0x78618d(0x197)](_0x1cb4b5=>{const _0x225be3=_0x78618d,_0x334243=_0x1cb4b5[_0x225be3(0x198)](0x0);return _0x334243>=0x20&&_0x334243<0x7f||_0x334243===0xa||_0x334243===0xd||_0x334243===0x9;})[_0x78618d(0x1a4)],_0x1e446f=_0x340aab/_0x5c9702['length'];if(_0x1e446f>0.8){const _0x1f78ec=_0x5c9702[_0x78618d(0x19a)](0x0,0x64)['trim']();return _0x1f78ec[_0x78618d(0x1a4)]<_0x5c9702[_0x78618d(0x195)]()[_0x78618d(0x1a4)]?_0x1f78ec+_0x78618d(0x1aa):_0x1f78ec;}return undefined;}export function throwArchiveValidationError(_0x2c0643){const _0x4cfeb0=a178_0x3a40c0;if(!_0x2c0643[_0x4cfeb0(0x1a2)])throw new SDKError(ErrorCode[_0x4cfeb0(0x1a0)],_0x4cfeb0(0x1af));throw new SDKError(ErrorCode[_0x4cfeb0(0x1a0)],_0x2c0643['error'][_0x4cfeb0(0x1b0)],undefined,{'helpText':_0x2c0643['error']['helpText']});}
1
+ (function(_0x34345f,_0x2be098){const _0x552970=a178_0x31f0,_0x228c90=_0x34345f();while(!![]){try{const _0x15eac0=parseInt(_0x552970(0x188))/0x1+-parseInt(_0x552970(0x185))/0x2+parseInt(_0x552970(0x179))/0x3*(-parseInt(_0x552970(0x18d))/0x4)+-parseInt(_0x552970(0x17d))/0x5+-parseInt(_0x552970(0x17b))/0x6*(parseInt(_0x552970(0x187))/0x7)+-parseInt(_0x552970(0x17c))/0x8*(parseInt(_0x552970(0x176))/0x9)+parseInt(_0x552970(0x17f))/0xa*(parseInt(_0x552970(0x181))/0xb);if(_0x15eac0===_0x2be098)break;else _0x228c90['push'](_0x228c90['shift']());}catch(_0x6d0a19){_0x228c90['push'](_0x228c90['shift']());}}}(a178_0x181c,0x76319));function a178_0x31f0(_0xfe0b19,_0x5bf4f4){_0xfe0b19=_0xfe0b19-0x174;const _0x181cd1=a178_0x181c();let _0x31f0c2=_0x181cd1[_0xfe0b19];return _0x31f0c2;}import{SDKError,ErrorCode}from'../errors.js';const GZIP_MAGIC=Buffer['from']([0x1f,0x8b]),MIN_GZIP_SIZE=0x14;export function validateGzipArchive(_0x33f22b){const _0x3cb584=a178_0x31f0;if(_0x33f22b[_0x3cb584(0x175)]<MIN_GZIP_SIZE)return{'isValid':![],'size':_0x33f22b[_0x3cb584(0x175)],'error':{'message':'Downloaded\x20archive\x20is\x20too\x20small\x20('+_0x33f22b['length']+_0x3cb584(0x178),'preview':getContentPreview(_0x33f22b),'helpText':_0x3cb584(0x174)}};if(!_0x33f22b[_0x3cb584(0x18b)](0x0,0x2)[_0x3cb584(0x17a)](GZIP_MAGIC)){const _0x591438=getContentPreview(_0x33f22b),_0x53914b=_0x591438?_0x3cb584(0x18a)+_0x591438:'';return{'isValid':![],'size':_0x33f22b[_0x3cb584(0x175)],'error':{'message':_0x3cb584(0x186)+_0x53914b,'preview':_0x591438,'helpText':_0x3cb584(0x182)}};}return{'isValid':!![],'size':_0x33f22b[_0x3cb584(0x175)]};}function a178_0x181c(){const _0x57c7b4=['11744vcoyqJ','1746160BdrNNm','WORKFLOW_ARCHIVE_CORRUPTED','1291130eYZdFr','error','187EgnMRO','The\x20server\x20may\x20have\x20returned\x20an\x20error\x20page\x20instead\x20of\x20the\x20archive.\x20Try\x20pushing\x20a\x20new\x20revision.','toString','(empty\x20response)','1305166OowzYZ','Downloaded\x20file\x20is\x20not\x20a\x20valid\x20gzip\x20archive.','49tGRKkn','813708QQQmFz','helpText','\x20Server\x20response\x20preview:\x20','subarray','message','20WXDoDv','trim','Check\x20if\x20the\x20project\x20exists\x20and\x20has\x20been\x20pushed\x20at\x20least\x20once.','length','4392GMGMUy','split','\x20bytes).\x20The\x20server\x20may\x20have\x20returned\x20an\x20error\x20or\x20empty\x20response.','125895kINpzb','equals','511272lcZkdN'];a178_0x181c=function(){return _0x57c7b4;};return a178_0x181c();}function getContentPreview(_0x367807){const _0x5f50b8=a178_0x31f0;if(_0x367807[_0x5f50b8(0x175)]===0x0)return _0x5f50b8(0x184);const _0xe8ae76=_0x367807[_0x5f50b8(0x18b)](0x0,0xc8)[_0x5f50b8(0x183)]('utf-8'),_0x530058=_0xe8ae76[_0x5f50b8(0x177)]('')['filter'](_0x577453=>{const _0x2fa7af=_0x577453['charCodeAt'](0x0);return _0x2fa7af>=0x20&&_0x2fa7af<0x7f||_0x2fa7af===0xa||_0x2fa7af===0xd||_0x2fa7af===0x9;})[_0x5f50b8(0x175)],_0x3dbcd7=_0x530058/_0xe8ae76[_0x5f50b8(0x175)];if(_0x3dbcd7>0.8){const _0x4e0de4=_0xe8ae76['slice'](0x0,0x64)[_0x5f50b8(0x18e)]();return _0x4e0de4[_0x5f50b8(0x175)]<_0xe8ae76['trim']()[_0x5f50b8(0x175)]?_0x4e0de4+'...':_0x4e0de4;}return undefined;}export function throwArchiveValidationError(_0x5203c6){const _0x21a811=a178_0x31f0;if(!_0x5203c6['error'])throw new SDKError(ErrorCode[_0x21a811(0x17e)],'Archive\x20validation\x20failed\x20with\x20unknown\x20error');throw new SDKError(ErrorCode[_0x21a811(0x17e)],_0x5203c6[_0x21a811(0x180)][_0x21a811(0x18c)],undefined,{'helpText':_0x5203c6[_0x21a811(0x180)][_0x21a811(0x189)]});}
@@ -1 +1 @@
1
- (function(_0x5988f1,_0x4dcbab){const _0x321b1f=a179_0x5012,_0x41e387=_0x5988f1();while(!![]){try{const _0x29533d=parseInt(_0x321b1f(0x1ef))/0x1+parseInt(_0x321b1f(0x1dd))/0x2+parseInt(_0x321b1f(0x1e7))/0x3*(-parseInt(_0x321b1f(0x1d5))/0x4)+-parseInt(_0x321b1f(0x1e6))/0x5+parseInt(_0x321b1f(0x1ec))/0x6*(-parseInt(_0x321b1f(0x1ed))/0x7)+-parseInt(_0x321b1f(0x1f3))/0x8*(-parseInt(_0x321b1f(0x1d4))/0x9)+parseInt(_0x321b1f(0x1e4))/0xa*(parseInt(_0x321b1f(0x1d1))/0xb);if(_0x29533d===_0x4dcbab)break;else _0x41e387['push'](_0x41e387['shift']());}catch(_0x84ca08){_0x41e387['push'](_0x41e387['shift']());}}}(a179_0x2d4e,0x2929d));import{promises as a179_0x2e2f25}from'fs';function a179_0x5012(_0x8ae1fd,_0x6a8f36){_0x8ae1fd=_0x8ae1fd-0x1d1;const _0x2d4e74=a179_0x2d4e();let _0x501292=_0x2d4e74[_0x8ae1fd];return _0x501292;}function a179_0x2d4e(){const _0x3f4dd9=['uploadProjectArchive','newProjectName','343152fLLynT','388zjiLEQ','access','join','length','name','create','skipValidation','Source\x20directory\x20not\x20found:\x20','224088DpRFdt','push','replace','tdx.json','readdir','workflow_project','revision','1270HlprNd','\x20workflow\x20files\x20found\x20in\x20','158830LZVjWJ','9597qGXJTU','listProjects','sourceDir','resolve','toISOString','1500gGTYgq','8477PjeJSI','archive.tar.gz','205983nwXTLX','isDirectory','endsWith','data','64DhROap','find','tar','16489gVAuoi'];a179_0x2d4e=function(){return _0x3f4dd9;};return a179_0x2d4e();}import a179_0xe3b36e from'path';import a179_0xae1dc4 from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';export async function prepareCloneWorkflow(_0x27bc33,_0xdca43a,_0x1680de,_0x5bc59d={}){const _0x4f0b61=a179_0x5012,{client:_0x4cb2cf}=_0x27bc33,_0x52313f=a179_0xe3b36e[_0x4f0b61(0x1ea)](_0xdca43a);try{await a179_0x2e2f25[_0x4f0b61(0x1d6)](_0x52313f);}catch{throw new Error(_0x4f0b61(0x1dc)+_0xdca43a);}const _0x9e59e8=tryFindWorkflowTdxConfig(_0x52313f),_0x588f34=_0x9e59e8?.['config'][_0x4f0b61(0x1e2)],_0x5ed220=_0x5bc59d[_0x4f0b61(0x1e3)]||new Date()[_0x4f0b61(0x1eb)]()[_0x4f0b61(0x1df)](/[:.]/g,'-');if(!_0x5bc59d[_0x4f0b61(0x1db)]){const _0x5e598b=await a179_0x2e2f25[_0x4f0b61(0x1e1)](_0x52313f),_0x329953=_0x5e598b['filter'](_0x4eecc7=>_0x4eecc7[_0x4f0b61(0x1f1)](WORKFLOW_FILE_EXTENSION));if(_0x329953[_0x4f0b61(0x1d8)]===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+_0x4f0b61(0x1e5)+_0x52313f);}const _0x572850=await getProjectFiles(_0x52313f);let _0x4df86e=![],_0x20eea7;try{const _0x26731a=await _0x4cb2cf[_0x4f0b61(0x1e8)]({'name_pattern':_0x1680de}),_0x55d147=_0x26731a[_0x4f0b61(0x1f2)][_0x4f0b61(0x1f4)](_0x5d8d0e=>_0x5d8d0e[_0x4f0b61(0x1d9)]===_0x1680de);_0x55d147&&(_0x4df86e=!![],_0x20eea7=_0x55d147['id']);}catch{}return{'sourceDir':_0x52313f,'sourceProjectName':_0x588f34,'newProjectName':_0x1680de,'revision':_0x5ed220,'fileCount':_0x572850[_0x4f0b61(0x1d8)],'files':_0x572850,'targetExists':_0x4df86e,'existingProjectId':_0x20eea7};}export async function executeCloneWorkflow(_0xaa45a4,_0x70307f){const _0x2ec2f5=a179_0x5012,_0x31a4d=await import(_0x2ec2f5(0x1f5)),{client:_0x1c3c6a}=_0xaa45a4,_0x195d65=await getProjectFiles(_0x70307f[_0x2ec2f5(0x1e9)]),_0x4cf071=await a179_0x2e2f25['mkdtemp'](a179_0xe3b36e['join'](a179_0xae1dc4['tmpdir'](),'tdx-wf-clone-')),_0x7801dc=a179_0xe3b36e['join'](_0x4cf071,_0x2ec2f5(0x1ee));try{await _0x31a4d[_0x2ec2f5(0x1da)]({'file':_0x7801dc,'gzip':!![],'cwd':_0x70307f['sourceDir'],'portable':!![]},_0x195d65);const _0x2ab829=await _0x1c3c6a[_0x2ec2f5(0x1d2)](_0x70307f[_0x2ec2f5(0x1d3)],_0x70307f[_0x2ec2f5(0x1e3)],_0x7801dc);return{'sourceDir':_0x70307f[_0x2ec2f5(0x1e9)],'sourceProjectName':_0x70307f['sourceProjectName'],'newProjectName':_0x2ab829[_0x2ec2f5(0x1d9)],'newProjectId':_0x2ab829['id'],'revision':_0x2ab829[_0x2ec2f5(0x1e3)],'fileCount':_0x195d65[_0x2ec2f5(0x1d8)],'files':_0x195d65};}finally{await a179_0x2e2f25['rm'](_0x4cf071,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x1d2764,_0x595e9b=''){const _0x3cdc3c=a179_0x5012,_0x302864=[],_0x1f219b=await a179_0x2e2f25[_0x3cdc3c(0x1e1)](_0x1d2764,{'withFileTypes':!![]});for(const _0x8b3c1d of _0x1f219b){const _0x313c8b=_0x595e9b?a179_0xe3b36e[_0x3cdc3c(0x1d7)](_0x595e9b,_0x8b3c1d[_0x3cdc3c(0x1d9)]):_0x8b3c1d['name'];if(_0x8b3c1d['name']===_0x3cdc3c(0x1e0))continue;if(!shouldIncludeInArchive(_0x8b3c1d[_0x3cdc3c(0x1d9)]))continue;if(_0x8b3c1d[_0x3cdc3c(0x1f0)]()){const _0x333c3d=await getProjectFiles(a179_0xe3b36e['join'](_0x1d2764,_0x8b3c1d[_0x3cdc3c(0x1d9)]),_0x313c8b);_0x302864['push'](..._0x333c3d);}else _0x302864[_0x3cdc3c(0x1de)](_0x313c8b);}return _0x302864;}
1
+ (function(_0x2bc816,_0x1ff7c0){const _0x25eee5=a179_0x24eb,_0x57da18=_0x2bc816();while(!![]){try{const _0x5eaf94=-parseInt(_0x25eee5(0xd0))/0x1*(-parseInt(_0x25eee5(0xc1))/0x2)+parseInt(_0x25eee5(0xbc))/0x3*(-parseInt(_0x25eee5(0xb4))/0x4)+parseInt(_0x25eee5(0xb3))/0x5*(-parseInt(_0x25eee5(0xb2))/0x6)+-parseInt(_0x25eee5(0xcb))/0x7+parseInt(_0x25eee5(0xd5))/0x8+-parseInt(_0x25eee5(0xd1))/0x9*(-parseInt(_0x25eee5(0xbe))/0xa)+-parseInt(_0x25eee5(0xc5))/0xb*(parseInt(_0x25eee5(0xce))/0xc);if(_0x5eaf94===_0x1ff7c0)break;else _0x57da18['push'](_0x57da18['shift']());}catch(_0x353be1){_0x57da18['push'](_0x57da18['shift']());}}}(a179_0x57fd,0x19384));import{promises as a179_0x52656f}from'fs';import a179_0x24e8f8 from'path';function a179_0x57fd(){const _0x36b92f=['archive.tar.gz','access','isDirectory','create','\x20workflow\x20files\x20found\x20in\x20','tar','1209rTbcfG','toISOString','526290uQenAC','data','endsWith','2pSvogU','sourceDir','listProjects','Source\x20directory\x20not\x20found:\x20','33FUJqBc','tmpdir','tdx.json','No\x20','replace','newProjectName','142996TNRHOR','mkdtemp','find','507660hxcNBe','join','85427FLhJDk','27ClbiLC','name','skipValidation','config','1399016EbhWUQ','filter','uploadProjectArchive','push','readdir','revision','693366jrZGIy','5kStONz','516trcVpv','length'];a179_0x57fd=function(){return _0x36b92f;};return a179_0x57fd();}import a179_0x52f086 from'os';import{tryFindWorkflowTdxConfig}from'./tdx-config.js';import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';function a179_0x24eb(_0x581969,_0x57133d){_0x581969=_0x581969-0xad;const _0x57fd31=a179_0x57fd();let _0x24eb92=_0x57fd31[_0x581969];return _0x24eb92;}export async function prepareCloneWorkflow(_0x985cdf,_0xae89e1,_0x22ab4d,_0x77c5be={}){const _0x43a25=a179_0x24eb,{client:_0x33de6d}=_0x985cdf,_0x12f09f=a179_0x24e8f8['resolve'](_0xae89e1);try{await a179_0x52656f[_0x43a25(0xb7)](_0x12f09f);}catch{throw new Error(_0x43a25(0xc4)+_0xae89e1);}const _0xa924d8=tryFindWorkflowTdxConfig(_0x12f09f),_0x5c025f=_0xa924d8?.[_0x43a25(0xd4)]['workflow_project'],_0x5f04a6=_0x77c5be['revision']||new Date()[_0x43a25(0xbd)]()[_0x43a25(0xc9)](/[:.]/g,'-');if(!_0x77c5be[_0x43a25(0xd3)]){const _0x48d49c=await a179_0x52656f[_0x43a25(0xb0)](_0x12f09f),_0x2f0b56=_0x48d49c[_0x43a25(0xad)](_0x31ef47=>_0x31ef47[_0x43a25(0xc0)](WORKFLOW_FILE_EXTENSION));if(_0x2f0b56['length']===0x0)throw new Error(_0x43a25(0xc8)+WORKFLOW_FILE_EXTENSION+_0x43a25(0xba)+_0x12f09f);}const _0x184518=await getProjectFiles(_0x12f09f);let _0x279e9f=![],_0x303624;try{const _0x147108=await _0x33de6d[_0x43a25(0xc3)]({'name_pattern':_0x22ab4d}),_0x22234c=_0x147108[_0x43a25(0xbf)][_0x43a25(0xcd)](_0x30c483=>_0x30c483[_0x43a25(0xd2)]===_0x22ab4d);_0x22234c&&(_0x279e9f=!![],_0x303624=_0x22234c['id']);}catch{}return{'sourceDir':_0x12f09f,'sourceProjectName':_0x5c025f,'newProjectName':_0x22ab4d,'revision':_0x5f04a6,'fileCount':_0x184518[_0x43a25(0xb5)],'files':_0x184518,'targetExists':_0x279e9f,'existingProjectId':_0x303624};}export async function executeCloneWorkflow(_0x499414,_0xc016a5){const _0x3cfb5a=a179_0x24eb,_0x33e9c4=await import(_0x3cfb5a(0xbb)),{client:_0x15c8a1}=_0x499414,_0x2eccce=await getProjectFiles(_0xc016a5[_0x3cfb5a(0xc2)]),_0x495c4b=await a179_0x52656f[_0x3cfb5a(0xcc)](a179_0x24e8f8[_0x3cfb5a(0xcf)](a179_0x52f086[_0x3cfb5a(0xc6)](),'tdx-wf-clone-')),_0x35a11a=a179_0x24e8f8[_0x3cfb5a(0xcf)](_0x495c4b,_0x3cfb5a(0xb6));try{await _0x33e9c4[_0x3cfb5a(0xb9)]({'file':_0x35a11a,'gzip':!![],'cwd':_0xc016a5[_0x3cfb5a(0xc2)],'portable':!![]},_0x2eccce);const _0x16bfbc=await _0x15c8a1[_0x3cfb5a(0xae)](_0xc016a5[_0x3cfb5a(0xca)],_0xc016a5[_0x3cfb5a(0xb1)],_0x35a11a);return{'sourceDir':_0xc016a5['sourceDir'],'sourceProjectName':_0xc016a5['sourceProjectName'],'newProjectName':_0x16bfbc[_0x3cfb5a(0xd2)],'newProjectId':_0x16bfbc['id'],'revision':_0x16bfbc[_0x3cfb5a(0xb1)],'fileCount':_0x2eccce[_0x3cfb5a(0xb5)],'files':_0x2eccce};}finally{await a179_0x52656f['rm'](_0x495c4b,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x5670da,_0x4cb14b=''){const _0x555292=a179_0x24eb,_0x419cfa=[],_0x15e6b0=await a179_0x52656f[_0x555292(0xb0)](_0x5670da,{'withFileTypes':!![]});for(const _0xcdba56 of _0x15e6b0){const _0x4d398f=_0x4cb14b?a179_0x24e8f8[_0x555292(0xcf)](_0x4cb14b,_0xcdba56['name']):_0xcdba56['name'];if(_0xcdba56['name']===_0x555292(0xc7))continue;if(!shouldIncludeInArchive(_0xcdba56[_0x555292(0xd2)]))continue;if(_0xcdba56[_0x555292(0xb8)]()){const _0x3a3afb=await getProjectFiles(a179_0x24e8f8[_0x555292(0xcf)](_0x5670da,_0xcdba56[_0x555292(0xd2)]),_0x4d398f);_0x419cfa[_0x555292(0xaf)](..._0x3a3afb);}else _0x419cfa[_0x555292(0xaf)](_0x4d398f);}return _0x419cfa;}
@@ -1 +1 @@
1
- const a180_0x34029a=a180_0x4270;(function(_0x2c6914,_0x5a8bbc){const _0x2b3d04=a180_0x4270,_0x31641b=_0x2c6914();while(!![]){try{const _0x4c38cc=-parseInt(_0x2b3d04(0x14e))/0x1+-parseInt(_0x2b3d04(0x159))/0x2*(-parseInt(_0x2b3d04(0x1b3))/0x3)+parseInt(_0x2b3d04(0x141))/0x4*(-parseInt(_0x2b3d04(0x166))/0x5)+-parseInt(_0x2b3d04(0x13c))/0x6+-parseInt(_0x2b3d04(0x18b))/0x7*(-parseInt(_0x2b3d04(0x162))/0x8)+-parseInt(_0x2b3d04(0x175))/0x9*(parseInt(_0x2b3d04(0x1b1))/0xa)+parseInt(_0x2b3d04(0x197))/0xb;if(_0x4c38cc===_0x5a8bbc)break;else _0x31641b['push'](_0x31641b['shift']());}catch(_0x17cc6f){_0x31641b['push'](_0x31641b['shift']());}}}(a180_0x5eff,0xacaed));import{WorkflowApiClient}from'../client/workflow-client.js';function a180_0x5eff(){const _0xdfbf74=['slice','find','client','allSettled','extract','prepareCloneProject','toISOString','workflow','startAttempt','success','fullName','mkdir','Project\x20not\x20found:\x20','8840MFdvEo','substring','3oErtAn','getProject','index','WORKFLOW_PROJECT_NOT_FOUND','Cannot\x20read\x20workflow\x20file:\x20','lastId','Project\x20directory\x20not\x20found:\x20','unlink','indexOf','limit','includeRetried','startedAt','push','7078368yemqCN','listLogFiles','latest','name','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','1992iorZNN','Failed\x20to\x20set\x20secret','workflowName','sessionUuid','retryAttemptName','join','timezone','path','length','attempts','projects','downloadProjectArchive','delete','678323DGzPTn','map','sessions','setSecret','\x20workflow\x20files\x20found\x20in\x20project\x20directory','preparePushProject','rejected','retrySession','retryParams','project','test','2346802devRuk','createdAt','tdx-workflow-','tdx-workflow-push-','retryAt','tasks','sessionTime','arrayBuffer','replace','2534808nZJsTZ','download','clearScheduleAll','done','1075QkvYzk','resolveProjectId','resumeFrom','applyPullProject','run','pullProject','retryAttempt','from','kill','NUMERIC_ID_PATTERN','params','getAttemptTasks','error','deleteSecret','workflows','4005JbGfKc','logFiles','tmpdir','toString','readdir','zlib','create','storeParams','finishedAt','status','bind','last_id','projectName','upstreams','rawCount','.tar.gz','Kill\x20request\x20accepted','sessionId','listProjects','force','revision','.\x20Expected\x20\x22project.workflow\x22','14SxTdAa','isDirectory','attempt','endsWith','isGroup','tar','listSessions','lastAttempt','fromTime','utf-8','isFile','direct','13845777gFGAMm','updatedAt','Invalid\x20workflow\x20format:\x20','Failed\x20to\x20download\x20log\x20file:\x20','listSecrets','getAttempt','now','deleteProject','filter','config','fromTask','executeCloneProject','data'];a180_0x5eff=function(){return _0xdfbf74;};return a180_0x5eff();}import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x505ba4,_0x472e48,_0x121e33=0x64){const _0x429510=a180_0x4270,_0x3b22ce=Math['min'](_0x472e48,MAX_PAGINATION_LIMIT),_0x54a793=[];let _0x5da1b2;while(_0x54a793[_0x429510(0x149)]<_0x3b22ce){const _0x445117=await _0x505ba4(_0x121e33,_0x5da1b2),_0x41e6db=_0x445117[_0x429510(0x183)]??_0x445117['data']['length'];if(_0x41e6db===0x0)break;_0x54a793['push'](..._0x445117[_0x429510(0x1a3)]);if(!_0x445117[_0x429510(0x134)]||_0x41e6db<_0x121e33)break;_0x5da1b2=_0x445117[_0x429510(0x134)];}return _0x54a793[_0x429510(0x1a4)](0x0,_0x3b22ce);}import{shouldIncludeInArchive,WORKFLOW_FILE_EXTENSION}from'./workflow-utils.js';import{pullWorkflow,applyPullResult}from'./pull-workflow.js';import{preparePushWorkflow,executePushWorkflow}from'./push-workflow.js';function a180_0x4270(_0x2634dc,_0x3cff74){_0x2634dc=_0x2634dc-0x133;const _0x5effc3=a180_0x5eff();let _0x4270f1=_0x5effc3[_0x2634dc];return _0x4270f1;}import{prepareCloneWorkflow,executeCloneWorkflow}from'./clone-workflow.js';export class WorkflowSDK{static [a180_0x34029a(0x16f)]=/^\d+$/;['client'];constructor(_0x2947ff){const _0x1cfcae=a180_0x34029a;this[_0x1cfcae(0x1a6)]=new WorkflowApiClient(_0x2947ff);}async['resolveProjectId'](_0x5eaedb){const _0x4e7db9=a180_0x34029a;if(WorkflowSDK[_0x4e7db9(0x16f)][_0x4e7db9(0x158)](_0x5eaedb)){const _0x39d565=await this[_0x4e7db9(0x1a6)][_0x4e7db9(0x1b4)](_0x5eaedb);return{'id':_0x39d565['id'],'name':_0x39d565[_0x4e7db9(0x13f)]};}const _0x515cd6=await this[_0x4e7db9(0x1a6)][_0x4e7db9(0x187)]({'name_pattern':_0x5eaedb}),_0x1e7f6a=_0x515cd6[_0x4e7db9(0x1a3)][_0x4e7db9(0x1a5)](_0x209ace=>_0x209ace[_0x4e7db9(0x13f)]===_0x5eaedb);if(!_0x1e7f6a)throw new SDKError(ErrorCode['WORKFLOW_PROJECT_NOT_FOUND'],_0x4e7db9(0x1b0)+_0x5eaedb);return{'id':_0x1e7f6a['id'],'name':_0x1e7f6a[_0x4e7db9(0x13f)]};}async[a180_0x34029a(0x14b)](_0x201c5d,_0x4f83e8){const _0x1f52c9=a180_0x34029a,_0x410296=_0x4f83e8?.[_0x1f52c9(0x138)]||0x64,_0x320fb8=await paginateResults((_0x32e218,_0x8d5f17)=>this[_0x1f52c9(0x1a6)]['listProjects']({'name_pattern':_0x201c5d,'limit':_0x32e218,'last_id':_0x8d5f17??_0x4f83e8?.[_0x1f52c9(0x180)]}),_0x410296);return _0x320fb8[_0x1f52c9(0x14f)](_0x3b2957=>({..._0x3b2957,'project_id':_0x3b2957['id'],'project_name':_0x3b2957[_0x1f52c9(0x13f)]}));}async[a180_0x34029a(0x174)](_0x1f3ac2,_0x4c1714){const _0x192d75=a180_0x34029a,_0x21146c=_0x4c1714?.[_0x192d75(0x138)]||0x64,_0x2a05f0=await paginateResults((_0x27a1eb,_0x38b1e6)=>this['client']['listWorkflows']({'project_name':_0x1f3ac2,'limit':_0x27a1eb,'last_id':_0x38b1e6??_0x4c1714?.[_0x192d75(0x180)]}),_0x21146c);return _0x2a05f0[_0x192d75(0x14f)](_0x110313=>({'project_id':_0x110313[_0x192d75(0x157)]?.['id'],'project_name':_0x110313['project']?.['name'],'workflow_id':_0x110313['id'],'workflow_name':_0x110313['name'],'revision':_0x110313['revision'],'timezone':_0x110313[_0x192d75(0x147)],'config':_0x110313['config'],'id':_0x110313['id'],'name':_0x110313[_0x192d75(0x13f)],'project':_0x110313[_0x192d75(0x157)]}));}async[a180_0x34029a(0x150)](_0x24ee83){const _0x313dc1=a180_0x34029a;let _0x3d14c;if(_0x24ee83?.[_0x313dc1(0x181)]){let _0x125eb3,_0x47bb0c=![];while(!_0x47bb0c){const _0x4ff81e=await this[_0x313dc1(0x1a6)][_0x313dc1(0x187)]({'limit':0x64,'last_id':_0x125eb3}),_0x50e540=_0x4ff81e[_0x313dc1(0x1a3)][_0x313dc1(0x1a5)](_0x474131=>_0x474131['name']===_0x24ee83[_0x313dc1(0x181)]);if(_0x50e540){_0x3d14c=_0x50e540['id'],_0x47bb0c=!![];break;}if(!_0x4ff81e[_0x313dc1(0x134)]||_0x4ff81e[_0x313dc1(0x1a3)]['length']===0x0)break;_0x125eb3=_0x4ff81e[_0x313dc1(0x134)];}if(!_0x3d14c)throw new SDKError(ErrorCode[_0x313dc1(0x1b6)],'Project\x20not\x20found:\x20'+_0x24ee83[_0x313dc1(0x181)]);}const _0x2f30f1=_0x24ee83?.[_0x313dc1(0x138)]||0x64,_0x1b44a1=await paginateResults((_0x43338f,_0x4984d6)=>this[_0x313dc1(0x1a6)][_0x313dc1(0x191)]({'project_id':_0x3d14c,'project_name':_0x24ee83?.['projectName'],'workflow_name':_0x24ee83?.[_0x313dc1(0x143)],'status':_0x24ee83?.[_0x313dc1(0x17e)],'from_time':_0x24ee83?.[_0x313dc1(0x193)],'to_time':_0x24ee83?.['toTime'],'limit':_0x43338f,'last_id':_0x4984d6??_0x24ee83?.[_0x313dc1(0x180)]}),_0x2f30f1);return _0x1b44a1[_0x313dc1(0x14f)](_0x5b26bc=>({'project_id':_0x5b26bc[_0x313dc1(0x157)]?.['id'],'project_name':_0x5b26bc[_0x313dc1(0x157)]?.[_0x313dc1(0x13f)],'workflow_id':_0x5b26bc['workflow']?.['id'],'workflow_name':_0x5b26bc[_0x313dc1(0x1ab)]?.[_0x313dc1(0x13f)],'session_id':_0x5b26bc['id'],'sessionUuid':_0x5b26bc[_0x313dc1(0x144)],'sessionTime':_0x5b26bc[_0x313dc1(0x15f)],'lastAttempt':_0x5b26bc[_0x313dc1(0x192)],'id':_0x5b26bc['id'],'project':_0x5b26bc[_0x313dc1(0x157)],'workflow':_0x5b26bc[_0x313dc1(0x1ab)]}));}async[a180_0x34029a(0x14a)](_0xdb79ff){const _0x5a73bc=a180_0x34029a,_0x427986=_0xdb79ff?.[_0x5a73bc(0x138)]||0x64,_0x20c197=await paginateResults((_0x331771,_0x1bae9b)=>this['client']['listAttempts']({'project_name':_0xdb79ff?.[_0x5a73bc(0x181)],'workflow_name':_0xdb79ff?.[_0x5a73bc(0x143)],'include_retried':_0xdb79ff?.[_0x5a73bc(0x139)],'limit':_0x331771,'last_id':_0x1bae9b??_0xdb79ff?.['last_id']}),_0x427986);return _0x20c197[_0x5a73bc(0x14f)](_0x19396c=>({'project_id':_0x19396c[_0x5a73bc(0x157)]?.['id'],'project_name':_0x19396c['project']?.[_0x5a73bc(0x13f)],'workflow_id':_0x19396c['workflow']?.['id'],'workflow_name':_0x19396c['workflow']?.['name'],'session_id':_0x19396c['sessionId'],'sessionUuid':_0x19396c['sessionUuid'],'sessionTime':_0x19396c[_0x5a73bc(0x15f)],'attempt_id':_0x19396c['id'],'attempt_index':_0x19396c[_0x5a73bc(0x1b5)],'retryAttemptName':_0x19396c[_0x5a73bc(0x145)],'done':_0x19396c[_0x5a73bc(0x165)],'success':_0x19396c[_0x5a73bc(0x1ad)],'cancelRequested':_0x19396c['cancelRequested'],'params':_0x19396c[_0x5a73bc(0x170)],'createdAt':_0x19396c[_0x5a73bc(0x15a)],'finishedAt':_0x19396c[_0x5a73bc(0x17d)],'id':_0x19396c['id'],'index':_0x19396c[_0x5a73bc(0x1b5)],'project':_0x19396c[_0x5a73bc(0x157)],'workflow':_0x19396c[_0x5a73bc(0x1ab)]}));}async[a180_0x34029a(0x18d)](_0x3b6bef){const _0x379486=a180_0x34029a,_0x213a7b=await this[_0x379486(0x1a6)][_0x379486(0x19c)](_0x3b6bef);return _0x213a7b;}async[a180_0x34029a(0x15e)](_0x32a7b5,_0x28451d=![]){const _0xfb7f6e=a180_0x34029a,_0x4002f6=await this[_0xfb7f6e(0x1a6)][_0xfb7f6e(0x171)](_0x32a7b5,_0x28451d);return _0x4002f6[_0xfb7f6e(0x14f)](_0x57812a=>({'task_id':_0x57812a['id'],'task_name':_0x57812a['fullName'],'parentId':_0x57812a['parentId'],'config':_0x57812a[_0xfb7f6e(0x1a0)],'upstreams':_0x57812a[_0xfb7f6e(0x182)],'state':_0x57812a['state'],'exportParams':_0x57812a['exportParams'],'storeParams':_0x57812a[_0xfb7f6e(0x17c)],'stateParams':_0x57812a['stateParams'],'updatedAt':_0x57812a[_0xfb7f6e(0x198)],'retryAt':_0x57812a[_0xfb7f6e(0x15d)],'startedAt':_0x57812a[_0xfb7f6e(0x13a)],'error':_0x57812a[_0xfb7f6e(0x172)],'isGroup':_0x57812a[_0xfb7f6e(0x18f)],'id':_0x57812a['id'],'fullName':_0x57812a[_0xfb7f6e(0x1ae)]}));}async[a180_0x34029a(0x176)](_0x443407,_0x49707b){const _0x47125b=a180_0x34029a;return await this[_0x47125b(0x1a6)][_0x47125b(0x13d)](_0x443407,_0x49707b);}async['logs'](_0x58e026,_0x427a33){const _0x5155b5=a180_0x34029a,_0x567c73=await import(_0x5155b5(0x17a)),{promisify:_0x313c93}=await import('util'),_0x4a002b=_0x313c93(_0x567c73['gunzip']),_0x586d23=await this[_0x5155b5(0x1a6)]['listLogFiles'](_0x58e026,_0x427a33);if(_0x586d23['length']===0x0)return'';const _0x2ce14e=[];for(const _0x2e9715 of _0x586d23){if(!_0x2e9715[_0x5155b5(0x196)])continue;const _0x3cd62a=await fetch(_0x2e9715[_0x5155b5(0x196)]);if(!_0x3cd62a['ok'])throw new Error(_0x5155b5(0x19a)+_0x3cd62a[_0x5155b5(0x17e)]);const _0x1b7d40=Buffer[_0x5155b5(0x16d)](await _0x3cd62a[_0x5155b5(0x160)]()),_0x1efb99=await _0x4a002b(_0x1b7d40);_0x2ce14e[_0x5155b5(0x13b)](_0x1efb99[_0x5155b5(0x178)](_0x5155b5(0x194)));}return _0x2ce14e['join']('\x0a');}async[a180_0x34029a(0x16e)](_0x34ec42,_0x1edcc8){const _0x530c41=a180_0x34029a,_0x3a7114=await this['client']['killAttempt'](_0x34ec42,_0x1edcc8);return _0x3a7114?.['message']??_0x530c41(0x185);}async[a180_0x34029a(0x155)](_0x3f533b,_0x523089){const _0x37c3a0=a180_0x34029a,_0x2b9237=await this[_0x37c3a0(0x1a6)][_0x37c3a0(0x155)](_0x3f533b,{'from_task':_0x523089?.[_0x37c3a0(0x1a1)],'retry_params':_0x523089?.[_0x37c3a0(0x156)]});return{'attemptId':_0x2b9237['id'],'sessionId':_0x2b9237[_0x37c3a0(0x186)]};}async['retryAttempt'](_0xbac2e6,_0x5718e3){const _0x4aa5f1=a180_0x34029a,_0x581a38=await this[_0x4aa5f1(0x1a6)][_0x4aa5f1(0x16c)](_0xbac2e6,{'resume_from':_0x5718e3?.[_0x4aa5f1(0x168)],'retry_params':_0x5718e3?.[_0x4aa5f1(0x156)],'force':_0x5718e3?.[_0x4aa5f1(0x188)]});return{'attemptId':_0x581a38['id'],'sessionId':_0x581a38[_0x4aa5f1(0x186)]};}async[a180_0x34029a(0x16a)](_0x433e80,_0x51b75f={},_0x307104){const _0x4cb68a=a180_0x34029a,_0x494de5=_0x433e80[_0x4cb68a(0x137)]('.');let _0xd953f9,_0x47ba7e;if(_0x494de5===-0x1)throw new Error(_0x4cb68a(0x140));_0xd953f9=_0x433e80[_0x4cb68a(0x1b2)](0x0,_0x494de5),_0x47ba7e=_0x433e80[_0x4cb68a(0x1b2)](_0x494de5+0x1);if(!_0xd953f9||!_0x47ba7e)throw new Error(_0x4cb68a(0x199)+_0x433e80+_0x4cb68a(0x18a));const _0x9d9d8c=_0x307104?.[_0x4cb68a(0x15f)]||new Date()[_0x4cb68a(0x1aa)]();return await this[_0x4cb68a(0x1a6)][_0x4cb68a(0x1ac)]({'projectName':_0xd953f9,'workflowName':_0x47ba7e,'sessionTime':_0x9d9d8c,'params':_0x51b75f});}async[a180_0x34029a(0x163)](_0x444829,_0x202e84,_0x26c7e5){const _0x380c93=a180_0x34029a,{promises:_0x29d845}=await import('fs'),_0xa8b6df=await import(_0x380c93(0x148)),_0x12d2d6=await import('os'),_0x53b5eb=await import(_0x380c93(0x190)),{id:_0x1ef133,name:_0x1756d9}=await this['resolveProjectId'](_0x444829),_0x206e81=_0x12d2d6['tmpdir'](),_0x5cb844=_0xa8b6df[_0x380c93(0x146)](_0x206e81,_0x380c93(0x15b)+_0x1ef133+'-'+Date['now']()+_0x380c93(0x184));try{await this[_0x380c93(0x1a6)][_0x380c93(0x14c)](_0x1ef133,_0x5cb844,_0x26c7e5?.[_0x380c93(0x189)]);const _0x1f2892=_0xa8b6df['join'](_0x202e84,_0x1756d9);await _0x29d845[_0x380c93(0x1af)](_0x1f2892,{'recursive':!![]}),await _0x53b5eb[_0x380c93(0x1a8)]({'file':_0x5cb844,'cwd':_0x1f2892,'gzip':!![]});const _0x52d6e7=async _0x2f1d57=>{const _0x414125=_0x380c93;let _0x36344b=0x0;const _0x146bf8=await _0x29d845[_0x414125(0x179)](_0x2f1d57,{'withFileTypes':!![]});for(const _0x1f5af9 of _0x146bf8){const _0x27bccf=_0xa8b6df[_0x414125(0x146)](_0x2f1d57,_0x1f5af9[_0x414125(0x13f)]);if(_0x1f5af9[_0x414125(0x195)]())_0x36344b++;else _0x1f5af9[_0x414125(0x18c)]()&&(_0x36344b+=await _0x52d6e7(_0x27bccf));}return _0x36344b;},_0x13646f=await _0x52d6e7(_0x1f2892);return{'projectName':_0x1756d9,'revision':_0x26c7e5?.[_0x380c93(0x189)]||_0x380c93(0x13e),'filesExtracted':_0x13646f};}finally{try{await _0x29d845[_0x380c93(0x136)](_0x5cb844);}catch{}}}async[a180_0x34029a(0x13b)](_0x58d571,_0x2ed842){const _0x5acd8f=a180_0x34029a,{promises:_0x299e62}=await import('fs'),_0x75b524=await import(_0x5acd8f(0x148)),_0x91e69=await import(_0x5acd8f(0x190)),_0x3a2c6d=_0x2ed842?.[_0x5acd8f(0x181)]||_0x75b524['basename'](_0x58d571),_0x13a40d=_0x2ed842?.[_0x5acd8f(0x189)]||new Date()[_0x5acd8f(0x1aa)]()[_0x5acd8f(0x161)](/[:.]/g,'-');try{await _0x299e62['access'](_0x58d571);}catch{throw new Error(_0x5acd8f(0x135)+_0x58d571);}if(!_0x2ed842?.['skipValidation']){const _0x251129=await _0x299e62[_0x5acd8f(0x179)](_0x58d571),_0x39fc0b=_0x251129[_0x5acd8f(0x19f)](_0x756e96=>_0x756e96[_0x5acd8f(0x18e)](WORKFLOW_FILE_EXTENSION));if(_0x39fc0b[_0x5acd8f(0x149)]===0x0)throw new Error('No\x20'+WORKFLOW_FILE_EXTENSION+_0x5acd8f(0x152));for(const _0x4d346e of _0x39fc0b){const _0x3c059c=_0x75b524['join'](_0x58d571,_0x4d346e);try{await _0x299e62['access'](_0x3c059c);}catch{throw new Error(_0x5acd8f(0x133)+_0x4d346e);}}}const _0x3e8194=async(_0x1b9b16,_0x504178='')=>{const _0xffde8e=_0x5acd8f,_0x3edc32=await _0x299e62[_0xffde8e(0x179)](_0x1b9b16,{'withFileTypes':!![]}),_0x460119=[];for(const _0x43f330 of _0x3edc32){const _0x480164=_0x75b524[_0xffde8e(0x146)](_0x504178,_0x43f330['name']),_0x1010a0=_0x75b524[_0xffde8e(0x146)](_0x1b9b16,_0x43f330[_0xffde8e(0x13f)]);if(!shouldIncludeInArchive(_0x43f330[_0xffde8e(0x13f)]))continue;_0x43f330['isDirectory']()?_0x460119['push'](...await _0x3e8194(_0x1010a0,_0x480164)):_0x460119[_0xffde8e(0x13b)](_0x480164);}return _0x460119;},_0x489a9c=await _0x3e8194(_0x58d571),_0x590f7c=await import('os'),_0x1bf797=_0x590f7c[_0x5acd8f(0x177)](),_0x3ef093=_0x75b524['join'](_0x1bf797,_0x5acd8f(0x15c)+Date[_0x5acd8f(0x19d)]()+'.tar.gz');try{await _0x91e69[_0x5acd8f(0x17b)]({'file':_0x3ef093,'gzip':!![],'cwd':_0x58d571,'portable':!![]},_0x489a9c);const _0x249ead=await this[_0x5acd8f(0x1a6)]['uploadProjectArchive'](_0x3a2c6d,_0x13a40d,_0x3ef093,{'scheduleFrom':_0x2ed842?.['scheduleFrom'],'clearSchedule':_0x2ed842?.['clearSchedule'],'clearScheduleAll':_0x2ed842?.[_0x5acd8f(0x164)]});return{'projectId':_0x249ead['id'],'projectName':_0x249ead[_0x5acd8f(0x13f)],'revision':_0x249ead[_0x5acd8f(0x189)]};}finally{try{await _0x299e62[_0x5acd8f(0x136)](_0x3ef093);}catch{}}}async[a180_0x34029a(0x14d)](_0x308da0){const _0x188cc6=a180_0x34029a,{id:_0x5ce557}=await this[_0x188cc6(0x167)](_0x308da0),_0x358b08=await this[_0x188cc6(0x1a6)][_0x188cc6(0x19e)](_0x5ce557);return{'projectId':_0x358b08['id'],'projectName':_0x358b08[_0x188cc6(0x13f)]};}async['listSecrets'](_0x16c480){const _0x15b872=a180_0x34029a,{id:_0x398c00,name:_0x4be442}=await this[_0x15b872(0x167)](_0x16c480),_0x163529=await this[_0x15b872(0x1a6)][_0x15b872(0x19b)](_0x398c00);return{'projectName':_0x4be442,'secrets':_0x163529};}async['setSecret'](_0x443e2b,_0x42cf72,_0x25599c){const _0x424c48=a180_0x34029a,{id:_0xc974cd,name:_0x34735d}=await this[_0x424c48(0x167)](_0x443e2b);return await this[_0x424c48(0x1a6)][_0x424c48(0x151)](_0xc974cd,_0x42cf72,_0x25599c),{'projectName':_0x34735d,'key':_0x42cf72};}async['setSecrets'](_0x27bea4,_0x356a9a){const _0x13b819=a180_0x34029a,{id:_0x520ab7,name:_0x4690c6}=await this['resolveProjectId'](_0x27bea4),_0x3e72fd=Object['keys'](_0x356a9a),_0x71181=await Promise[_0x13b819(0x1a7)](_0x3e72fd[_0x13b819(0x14f)](_0x44bc11=>this[_0x13b819(0x1a6)][_0x13b819(0x151)](_0x520ab7,_0x44bc11,_0x356a9a[_0x44bc11]))),_0x99690d=_0x71181[_0x13b819(0x14f)]((_0x58575e,_0x1d430a)=>_0x58575e[_0x13b819(0x17e)]===_0x13b819(0x154)?_0x3e72fd[_0x1d430a]:null)[_0x13b819(0x19f)](_0x18fd30=>_0x18fd30!==null);if(_0x99690d[_0x13b819(0x149)]>0x0)throw new SDKError(ErrorCode['WORKFLOW_SECRET_SET_FAILED'],_0x13b819(0x142)+(_0x99690d[_0x13b819(0x149)]>0x1?'s':'')+':\x20'+_0x99690d[_0x13b819(0x146)](',\x20'));return{'projectName':_0x4690c6,'keys':_0x3e72fd};}async[a180_0x34029a(0x173)](_0x5ed946,_0x6ef952){const _0x513edf=a180_0x34029a,{id:_0x1a378e,name:_0x1f396f}=await this['resolveProjectId'](_0x5ed946);return await this[_0x513edf(0x1a6)][_0x513edf(0x173)](_0x1a378e,_0x6ef952),{'projectName':_0x1f396f,'key':_0x6ef952};}async[a180_0x34029a(0x16b)](_0x4ad979,_0x5ed088){const _0x33622b=a180_0x34029a;return pullWorkflow({'client':this[_0x33622b(0x1a6)],'resolveProjectId':this[_0x33622b(0x167)]['bind'](this)},_0x4ad979,_0x5ed088);}async[a180_0x34029a(0x169)](_0x544a7d,_0x2e65b6){const _0x55af64=a180_0x34029a;return applyPullResult({'client':this[_0x55af64(0x1a6)],'resolveProjectId':this['resolveProjectId'][_0x55af64(0x17f)](this)},_0x544a7d,_0x2e65b6);}async[a180_0x34029a(0x153)](_0x2cbbab){const _0x242f1f=a180_0x34029a;return preparePushWorkflow({'client':this[_0x242f1f(0x1a6)],'resolveProjectId':this[_0x242f1f(0x167)][_0x242f1f(0x17f)](this)},_0x2cbbab);}async['executePushProject'](_0x150f2c){const _0x457448=a180_0x34029a;return executePushWorkflow({'client':this[_0x457448(0x1a6)],'resolveProjectId':this[_0x457448(0x167)]['bind'](this)},_0x150f2c);}async[a180_0x34029a(0x1a9)](_0x2b50b9,_0x42983b,_0x18272c){return prepareCloneWorkflow({'client':this['client']},_0x2b50b9,_0x42983b,_0x18272c);}async[a180_0x34029a(0x1a2)](_0x169f52){const _0x424580=a180_0x34029a;return executeCloneWorkflow({'client':this[_0x424580(0x1a6)]},_0x169f52);}}
1
+ const a180_0x270530=a180_0x34dc;function a180_0x34dc(_0x62b818,_0x37b4c0){_0x62b818=_0x62b818-0x1b6;const _0x308b7d=a180_0x308b();let _0x34dc12=_0x308b7d[_0x62b818];return _0x34dc12;}(function(_0x2c7ab6,_0x12329a){const _0x4150bf=a180_0x34dc,_0x4379b7=_0x2c7ab6();while(!![]){try{const _0x48b207=parseInt(_0x4150bf(0x232))/0x1*(parseInt(_0x4150bf(0x22f))/0x2)+parseInt(_0x4150bf(0x216))/0x3+-parseInt(_0x4150bf(0x212))/0x4*(parseInt(_0x4150bf(0x227))/0x5)+parseInt(_0x4150bf(0x222))/0x6*(parseInt(_0x4150bf(0x210))/0x7)+parseInt(_0x4150bf(0x1df))/0x8+parseInt(_0x4150bf(0x1c3))/0x9+-parseInt(_0x4150bf(0x1de))/0xa*(parseInt(_0x4150bf(0x1c2))/0xb);if(_0x48b207===_0x12329a)break;else _0x4379b7['push'](_0x4379b7['shift']());}catch(_0x284238){_0x4379b7['push'](_0x4379b7['shift']());}}}(a180_0x308b,0x9af17));function a180_0x308b(){const _0x2fa655=['name','workflows','download','timezone','sessions','join','.\x20Expected\x20\x22project.workflow\x22','state','push','finishedAt','retryAttempt','getProject','access','setSecrets','last_id','map','cancelRequested','workflowName','limit','applyPullProject','force','substring','min','sessionUuid','keys','length','38560dGQWpa','5881360nokmee','now','extract','success','retrySession','revision','Cannot\x20read\x20workflow\x20file:\x20','upstreams','skipValidation','sessionTime','listLogFiles','listAttempts','unlink','toString','.tar.gz','clearSchedule','Workflow\x20must\x20be\x20specified\x20as\x20\x22project.workflow\x22\x20format','downloadProjectArchive','index','killAttempt','client','from','Failed\x20to\x20download\x20log\x20file:\x20','toTime','done','readdir','resumeFrom','Failed\x20to\x20set\x20secret','scheduleFrom','Invalid\x20workflow\x20format:\x20','indexOf','retryAt','kill','retryParams','pullProject','NUMERIC_ID_PATTERN','bind','logs','getAttemptTasks','config','zlib','WORKFLOW_SECRET_SET_FAILED','projectName','project','executeCloneProject','isGroup','workflow','projects','status','495621imAapt','fullName','9276dLBkgt','stateParams','lastAttempt','test','972243rTjrqG','prepareCloneProject','allSettled','WORKFLOW_PROJECT_NOT_FOUND','Project\x20not\x20found:\x20','mkdir','sessionId','toISOString','startedAt','replace','startAttempt','attempts','90BtVBHs','endsWith','listProjects','path','listSecrets','2555tEevMy','tmpdir','retryAttemptName','find','rawCount','basename','message','tdx-workflow-push-','207188daXPXk','lastId','gunzip','12yWKPEI','util','clearScheduleAll','No\x20','error','filter','resolveProjectId','isDirectory','tar','preparePushProject','listWorkflows','exportParams','executePushProject','tasks','direct','updatedAt','slice','\x20workflow\x20files\x20found\x20in\x20project\x20directory','data','storeParams','params','7612ZIddGl','10112256hkwzxU'];a180_0x308b=function(){return _0x2fa655;};return a180_0x308b();}import{WorkflowApiClient}from'../client/workflow-client.js';import{SDKError,ErrorCode}from'../errors.js';import{MAX_PAGINATION_LIMIT}from'../util/paginate.js';async function paginateResults(_0x249b03,_0xbef62c,_0x46cb96=0x64){const _0x39ed4b=a180_0x34dc,_0x3f63fe=Math[_0x39ed4b(0x1da)](_0xbef62c,MAX_PAGINATION_LIMIT),_0x2c3fe4=[];let _0x5dda9f;while(_0x2c3fe4[_0x39ed4b(0x1dd)]<_0x3f63fe){const _0x214579=await _0x249b03(_0x46cb96,_0x5dda9f),_0x3d5a6c=_0x214579[_0x39ed4b(0x22b)]??_0x214579[_0x39ed4b(0x1bf)][_0x39ed4b(0x1dd)];if(_0x3d5a6c===0x0)break;_0x2c3fe4[_0x39ed4b(0x1cc)](..._0x214579[_0x39ed4b(0x1bf)]);if(!_0x214579[_0x39ed4b(0x230)]||_0x3d5a6c<_0x46cb96)break;_0x5dda9f=_0x214579[_0x39ed4b(0x230)];}return _0x2c3fe4[_0x39ed4b(0x1bd)](0x0,_0x3f63fe);}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_0x270530(0x202)]=/^\d+$/;[a180_0x270530(0x1f3)];constructor(_0x18b331){const _0x4d7c16=a180_0x270530;this[_0x4d7c16(0x1f3)]=new WorkflowApiClient(_0x18b331);}async[a180_0x270530(0x238)](_0x51400c){const _0x5f4792=a180_0x270530;if(WorkflowSDK[_0x5f4792(0x202)][_0x5f4792(0x215)](_0x51400c)){const _0x3a3fbd=await this[_0x5f4792(0x1f3)][_0x5f4792(0x1cf)](_0x51400c);return{'id':_0x3a3fbd['id'],'name':_0x3a3fbd[_0x5f4792(0x1c4)]};}const _0x251424=await this[_0x5f4792(0x1f3)][_0x5f4792(0x224)]({'name_pattern':_0x51400c}),_0xc15df1=_0x251424[_0x5f4792(0x1bf)][_0x5f4792(0x22a)](_0x3bf5ef=>_0x3bf5ef[_0x5f4792(0x1c4)]===_0x51400c);if(!_0xc15df1)throw new SDKError(ErrorCode[_0x5f4792(0x219)],_0x5f4792(0x21a)+_0x51400c);return{'id':_0xc15df1['id'],'name':_0xc15df1[_0x5f4792(0x1c4)]};}async[a180_0x270530(0x20e)](_0x34525a,_0x1241b2){const _0x343fc7=a180_0x270530,_0xcc8337=_0x1241b2?.['limit']||0x64,_0x11bc9a=await paginateResults((_0x11d5c0,_0x2b10d6)=>this[_0x343fc7(0x1f3)][_0x343fc7(0x224)]({'name_pattern':_0x34525a,'limit':_0x11d5c0,'last_id':_0x2b10d6??_0x1241b2?.[_0x343fc7(0x1d2)]}),_0xcc8337);return _0x11bc9a[_0x343fc7(0x1d3)](_0x59b213=>({..._0x59b213,'project_id':_0x59b213['id'],'project_name':_0x59b213['name']}));}async[a180_0x270530(0x1c5)](_0x25cb1e,_0x26cf59){const _0x54eecf=a180_0x270530,_0x3a5333=_0x26cf59?.[_0x54eecf(0x1d6)]||0x64,_0x3f4c6a=await paginateResults((_0x2408a9,_0x15c864)=>this[_0x54eecf(0x1f3)][_0x54eecf(0x1b7)]({'project_name':_0x25cb1e,'limit':_0x2408a9,'last_id':_0x15c864??_0x26cf59?.[_0x54eecf(0x1d2)]}),_0x3a5333);return _0x3f4c6a[_0x54eecf(0x1d3)](_0x34e341=>({'project_id':_0x34e341[_0x54eecf(0x20a)]?.['id'],'project_name':_0x34e341['project']?.[_0x54eecf(0x1c4)],'workflow_id':_0x34e341['id'],'workflow_name':_0x34e341[_0x54eecf(0x1c4)],'revision':_0x34e341[_0x54eecf(0x1e4)],'timezone':_0x34e341[_0x54eecf(0x1c7)],'config':_0x34e341[_0x54eecf(0x206)],'id':_0x34e341['id'],'name':_0x34e341[_0x54eecf(0x1c4)],'project':_0x34e341[_0x54eecf(0x20a)]}));}async[a180_0x270530(0x1c8)](_0x8b4666){const _0x3f32ef=a180_0x270530;let _0x480c7b;if(_0x8b4666?.[_0x3f32ef(0x209)]){let _0x2f5af0,_0x5a5e2c=![];while(!_0x5a5e2c){const _0xca2a04=await this['client']['listProjects']({'limit':0x64,'last_id':_0x2f5af0}),_0x5da182=_0xca2a04['data'][_0x3f32ef(0x22a)](_0x512f64=>_0x512f64['name']===_0x8b4666['projectName']);if(_0x5da182){_0x480c7b=_0x5da182['id'],_0x5a5e2c=!![];break;}if(!_0xca2a04['lastId']||_0xca2a04[_0x3f32ef(0x1bf)]['length']===0x0)break;_0x2f5af0=_0xca2a04[_0x3f32ef(0x230)];}if(!_0x480c7b)throw new SDKError(ErrorCode[_0x3f32ef(0x219)],'Project\x20not\x20found:\x20'+_0x8b4666['projectName']);}const _0x479fe0=_0x8b4666?.[_0x3f32ef(0x1d6)]||0x64,_0x16e915=await paginateResults((_0x6e2b75,_0x4d4a94)=>this[_0x3f32ef(0x1f3)]['listSessions']({'project_id':_0x480c7b,'project_name':_0x8b4666?.[_0x3f32ef(0x209)],'workflow_name':_0x8b4666?.[_0x3f32ef(0x1d5)],'status':_0x8b4666?.['status'],'from_time':_0x8b4666?.['fromTime'],'to_time':_0x8b4666?.[_0x3f32ef(0x1f6)],'limit':_0x6e2b75,'last_id':_0x4d4a94??_0x8b4666?.['last_id']}),_0x479fe0);return _0x16e915['map'](_0x594fa0=>({'project_id':_0x594fa0[_0x3f32ef(0x20a)]?.['id'],'project_name':_0x594fa0[_0x3f32ef(0x20a)]?.[_0x3f32ef(0x1c4)],'workflow_id':_0x594fa0[_0x3f32ef(0x20d)]?.['id'],'workflow_name':_0x594fa0[_0x3f32ef(0x20d)]?.[_0x3f32ef(0x1c4)],'session_id':_0x594fa0['id'],'sessionUuid':_0x594fa0[_0x3f32ef(0x1db)],'sessionTime':_0x594fa0[_0x3f32ef(0x1e8)],'lastAttempt':_0x594fa0[_0x3f32ef(0x214)],'id':_0x594fa0['id'],'project':_0x594fa0[_0x3f32ef(0x20a)],'workflow':_0x594fa0[_0x3f32ef(0x20d)]}));}async[a180_0x270530(0x221)](_0x41194f){const _0x23e2fe=a180_0x270530,_0x2c0780=_0x41194f?.[_0x23e2fe(0x1d6)]||0x64,_0x1f71fb=await paginateResults((_0x118941,_0x317af1)=>this['client'][_0x23e2fe(0x1ea)]({'project_name':_0x41194f?.[_0x23e2fe(0x209)],'workflow_name':_0x41194f?.[_0x23e2fe(0x1d5)],'include_retried':_0x41194f?.['includeRetried'],'limit':_0x118941,'last_id':_0x317af1??_0x41194f?.[_0x23e2fe(0x1d2)]}),_0x2c0780);return _0x1f71fb[_0x23e2fe(0x1d3)](_0x4fa53f=>({'project_id':_0x4fa53f[_0x23e2fe(0x20a)]?.['id'],'project_name':_0x4fa53f[_0x23e2fe(0x20a)]?.[_0x23e2fe(0x1c4)],'workflow_id':_0x4fa53f['workflow']?.['id'],'workflow_name':_0x4fa53f[_0x23e2fe(0x20d)]?.[_0x23e2fe(0x1c4)],'session_id':_0x4fa53f['sessionId'],'sessionUuid':_0x4fa53f['sessionUuid'],'sessionTime':_0x4fa53f[_0x23e2fe(0x1e8)],'attempt_id':_0x4fa53f['id'],'attempt_index':_0x4fa53f['index'],'retryAttemptName':_0x4fa53f[_0x23e2fe(0x229)],'done':_0x4fa53f[_0x23e2fe(0x1f7)],'success':_0x4fa53f[_0x23e2fe(0x1e2)],'cancelRequested':_0x4fa53f[_0x23e2fe(0x1d4)],'params':_0x4fa53f[_0x23e2fe(0x1c1)],'createdAt':_0x4fa53f['createdAt'],'finishedAt':_0x4fa53f[_0x23e2fe(0x1cd)],'id':_0x4fa53f['id'],'index':_0x4fa53f[_0x23e2fe(0x1f1)],'project':_0x4fa53f[_0x23e2fe(0x20a)],'workflow':_0x4fa53f['workflow']}));}async['attempt'](_0x508e90){const _0x57faf2=await this['client']['getAttempt'](_0x508e90);return _0x57faf2;}async[a180_0x270530(0x1ba)](_0xb9f250,_0x303605=![]){const _0x1edc7a=a180_0x270530,_0x31a92f=await this[_0x1edc7a(0x1f3)][_0x1edc7a(0x205)](_0xb9f250,_0x303605);return _0x31a92f[_0x1edc7a(0x1d3)](_0x5155d4=>({'task_id':_0x5155d4['id'],'task_name':_0x5155d4[_0x1edc7a(0x211)],'parentId':_0x5155d4['parentId'],'config':_0x5155d4[_0x1edc7a(0x206)],'upstreams':_0x5155d4[_0x1edc7a(0x1e6)],'state':_0x5155d4[_0x1edc7a(0x1cb)],'exportParams':_0x5155d4[_0x1edc7a(0x1b8)],'storeParams':_0x5155d4[_0x1edc7a(0x1c0)],'stateParams':_0x5155d4[_0x1edc7a(0x213)],'updatedAt':_0x5155d4[_0x1edc7a(0x1bc)],'retryAt':_0x5155d4[_0x1edc7a(0x1fe)],'startedAt':_0x5155d4[_0x1edc7a(0x21e)],'error':_0x5155d4[_0x1edc7a(0x236)],'isGroup':_0x5155d4[_0x1edc7a(0x20c)],'id':_0x5155d4['id'],'fullName':_0x5155d4[_0x1edc7a(0x211)]}));}async['logFiles'](_0x410ae9,_0x59db65){const _0x44b40f=a180_0x270530;return await this[_0x44b40f(0x1f3)][_0x44b40f(0x1e9)](_0x410ae9,_0x59db65);}async[a180_0x270530(0x204)](_0x40b6dd,_0x118e8c){const _0x4b4487=a180_0x270530,_0x5ecbc5=await import(_0x4b4487(0x207)),{promisify:_0x17b56b}=await import(_0x4b4487(0x233)),_0x2043a5=_0x17b56b(_0x5ecbc5[_0x4b4487(0x231)]),_0x380d15=await this[_0x4b4487(0x1f3)]['listLogFiles'](_0x40b6dd,_0x118e8c);if(_0x380d15[_0x4b4487(0x1dd)]===0x0)return'';const _0x446a63=[];for(const _0x29b380 of _0x380d15){if(!_0x29b380[_0x4b4487(0x1bb)])continue;const _0x562237=await fetch(_0x29b380[_0x4b4487(0x1bb)]);if(!_0x562237['ok'])throw new Error(_0x4b4487(0x1f5)+_0x562237[_0x4b4487(0x20f)]);const _0x154849=Buffer[_0x4b4487(0x1f4)](await _0x562237['arrayBuffer']()),_0x40bad5=await _0x2043a5(_0x154849);_0x446a63['push'](_0x40bad5[_0x4b4487(0x1ec)]('utf-8'));}return _0x446a63['join']('\x0a');}async[a180_0x270530(0x1ff)](_0x22fcb4,_0x52720a){const _0x4bf585=a180_0x270530,_0x2d11ae=await this[_0x4bf585(0x1f3)][_0x4bf585(0x1f2)](_0x22fcb4,_0x52720a);return _0x2d11ae?.[_0x4bf585(0x22d)]??'Kill\x20request\x20accepted';}async[a180_0x270530(0x1e3)](_0x152c1b,_0x562a72){const _0x59724d=a180_0x270530,_0x4a378a=await this[_0x59724d(0x1f3)][_0x59724d(0x1e3)](_0x152c1b,{'from_task':_0x562a72?.['fromTask'],'retry_params':_0x562a72?.[_0x59724d(0x200)]});return{'attemptId':_0x4a378a['id'],'sessionId':_0x4a378a[_0x59724d(0x21c)]};}async[a180_0x270530(0x1ce)](_0x50c428,_0x16d869){const _0x43caca=a180_0x270530,_0x32f6b6=await this[_0x43caca(0x1f3)][_0x43caca(0x1ce)](_0x50c428,{'resume_from':_0x16d869?.[_0x43caca(0x1f9)],'retry_params':_0x16d869?.['retryParams'],'force':_0x16d869?.[_0x43caca(0x1d8)]});return{'attemptId':_0x32f6b6['id'],'sessionId':_0x32f6b6[_0x43caca(0x21c)]};}async['run'](_0x37a10c,_0x136c63={},_0xf83725){const _0x2bd12d=a180_0x270530,_0x425edf=_0x37a10c[_0x2bd12d(0x1fd)]('.');let _0x22b9d4,_0x1a722d;if(_0x425edf===-0x1)throw new Error(_0x2bd12d(0x1ef));_0x22b9d4=_0x37a10c[_0x2bd12d(0x1d9)](0x0,_0x425edf),_0x1a722d=_0x37a10c['substring'](_0x425edf+0x1);if(!_0x22b9d4||!_0x1a722d)throw new Error(_0x2bd12d(0x1fc)+_0x37a10c+_0x2bd12d(0x1ca));const _0x5c50a4=_0xf83725?.[_0x2bd12d(0x1e8)]||new Date()[_0x2bd12d(0x21d)]();return await this[_0x2bd12d(0x1f3)][_0x2bd12d(0x220)]({'projectName':_0x22b9d4,'workflowName':_0x1a722d,'sessionTime':_0x5c50a4,'params':_0x136c63});}async[a180_0x270530(0x1c6)](_0xf8e2d2,_0x3b59ab,_0x5b7532){const _0x5814eb=a180_0x270530,{promises:_0x3f6fdc}=await import('fs'),_0x554b7e=await import(_0x5814eb(0x225)),_0x5b7e4f=await import('os'),_0x362221=await import(_0x5814eb(0x23a)),{id:_0x1c4a43,name:_0x2b95b1}=await this[_0x5814eb(0x238)](_0xf8e2d2),_0x35af95=_0x5b7e4f[_0x5814eb(0x228)](),_0x3ff6d4=_0x554b7e['join'](_0x35af95,'tdx-workflow-'+_0x1c4a43+'-'+Date['now']()+_0x5814eb(0x1ed));try{await this[_0x5814eb(0x1f3)][_0x5814eb(0x1f0)](_0x1c4a43,_0x3ff6d4,_0x5b7532?.['revision']);const _0x4c61e8=_0x554b7e[_0x5814eb(0x1c9)](_0x3b59ab,_0x2b95b1);await _0x3f6fdc[_0x5814eb(0x21b)](_0x4c61e8,{'recursive':!![]}),await _0x362221[_0x5814eb(0x1e1)]({'file':_0x3ff6d4,'cwd':_0x4c61e8,'gzip':!![]});const _0x29110a=async _0xb34233=>{const _0x31ccf4=_0x5814eb;let _0x12fd34=0x0;const _0x50581d=await _0x3f6fdc['readdir'](_0xb34233,{'withFileTypes':!![]});for(const _0x1fe2b2 of _0x50581d){const _0x4219f5=_0x554b7e[_0x31ccf4(0x1c9)](_0xb34233,_0x1fe2b2['name']);if(_0x1fe2b2['isFile']())_0x12fd34++;else _0x1fe2b2[_0x31ccf4(0x239)]()&&(_0x12fd34+=await _0x29110a(_0x4219f5));}return _0x12fd34;},_0x131a0b=await _0x29110a(_0x4c61e8);return{'projectName':_0x2b95b1,'revision':_0x5b7532?.['revision']||'latest','filesExtracted':_0x131a0b};}finally{try{await _0x3f6fdc[_0x5814eb(0x1eb)](_0x3ff6d4);}catch{}}}async[a180_0x270530(0x1cc)](_0x1df64f,_0x36bc90){const _0x2c5606=a180_0x270530,{promises:_0x444239}=await import('fs'),_0x3aeedb=await import('path'),_0x45eb31=await import('tar'),_0x23827b=_0x36bc90?.[_0x2c5606(0x209)]||_0x3aeedb[_0x2c5606(0x22c)](_0x1df64f),_0xed45fa=_0x36bc90?.[_0x2c5606(0x1e4)]||new Date()[_0x2c5606(0x21d)]()[_0x2c5606(0x21f)](/[:.]/g,'-');try{await _0x444239[_0x2c5606(0x1d0)](_0x1df64f);}catch{throw new Error('Project\x20directory\x20not\x20found:\x20'+_0x1df64f);}if(!_0x36bc90?.[_0x2c5606(0x1e7)]){const _0x4367e5=await _0x444239[_0x2c5606(0x1f8)](_0x1df64f),_0x3282d1=_0x4367e5[_0x2c5606(0x237)](_0x178f54=>_0x178f54[_0x2c5606(0x223)](WORKFLOW_FILE_EXTENSION));if(_0x3282d1['length']===0x0)throw new Error(_0x2c5606(0x235)+WORKFLOW_FILE_EXTENSION+_0x2c5606(0x1be));for(const _0x61bd1d of _0x3282d1){const _0x333781=_0x3aeedb[_0x2c5606(0x1c9)](_0x1df64f,_0x61bd1d);try{await _0x444239[_0x2c5606(0x1d0)](_0x333781);}catch{throw new Error(_0x2c5606(0x1e5)+_0x61bd1d);}}}const _0x1c1d6d=async(_0x5b4edd,_0x3b4a7e='')=>{const _0x4e9bda=_0x2c5606,_0x304ca2=await _0x444239['readdir'](_0x5b4edd,{'withFileTypes':!![]}),_0x4e09b8=[];for(const _0x3e373f of _0x304ca2){const _0x265668=_0x3aeedb[_0x4e9bda(0x1c9)](_0x3b4a7e,_0x3e373f[_0x4e9bda(0x1c4)]),_0x1a4ba6=_0x3aeedb[_0x4e9bda(0x1c9)](_0x5b4edd,_0x3e373f[_0x4e9bda(0x1c4)]);if(!shouldIncludeInArchive(_0x3e373f[_0x4e9bda(0x1c4)]))continue;_0x3e373f[_0x4e9bda(0x239)]()?_0x4e09b8[_0x4e9bda(0x1cc)](...await _0x1c1d6d(_0x1a4ba6,_0x265668)):_0x4e09b8[_0x4e9bda(0x1cc)](_0x265668);}return _0x4e09b8;},_0x5edd69=await _0x1c1d6d(_0x1df64f),_0x43c7cf=await import('os'),_0x38927e=_0x43c7cf[_0x2c5606(0x228)](),_0x51f4de=_0x3aeedb[_0x2c5606(0x1c9)](_0x38927e,_0x2c5606(0x22e)+Date[_0x2c5606(0x1e0)]()+_0x2c5606(0x1ed));try{await _0x45eb31['create']({'file':_0x51f4de,'gzip':!![],'cwd':_0x1df64f,'portable':!![]},_0x5edd69);const _0x55e689=await this['client']['uploadProjectArchive'](_0x23827b,_0xed45fa,_0x51f4de,{'scheduleFrom':_0x36bc90?.[_0x2c5606(0x1fb)],'clearSchedule':_0x36bc90?.[_0x2c5606(0x1ee)],'clearScheduleAll':_0x36bc90?.[_0x2c5606(0x234)]});return{'projectId':_0x55e689['id'],'projectName':_0x55e689[_0x2c5606(0x1c4)],'revision':_0x55e689[_0x2c5606(0x1e4)]};}finally{try{await _0x444239[_0x2c5606(0x1eb)](_0x51f4de);}catch{}}}async['delete'](_0x204237){const _0x3f3f29=a180_0x270530,{id:_0x4c0092}=await this[_0x3f3f29(0x238)](_0x204237),_0x427f5a=await this[_0x3f3f29(0x1f3)]['deleteProject'](_0x4c0092);return{'projectId':_0x427f5a['id'],'projectName':_0x427f5a['name']};}async[a180_0x270530(0x226)](_0x4b6920){const _0x4a9584=a180_0x270530,{id:_0x66a9c8,name:_0x4188f1}=await this[_0x4a9584(0x238)](_0x4b6920),_0x272585=await this[_0x4a9584(0x1f3)][_0x4a9584(0x226)](_0x66a9c8);return{'projectName':_0x4188f1,'secrets':_0x272585};}async['setSecret'](_0x193f2d,_0x568965,_0x370a1e){const _0x27f5f7=a180_0x270530,{id:_0x1c5021,name:_0x130c69}=await this[_0x27f5f7(0x238)](_0x193f2d);return await this[_0x27f5f7(0x1f3)]['setSecret'](_0x1c5021,_0x568965,_0x370a1e),{'projectName':_0x130c69,'key':_0x568965};}async[a180_0x270530(0x1d1)](_0x2c4009,_0x1d4663){const _0x2880ea=a180_0x270530,{id:_0x4e2e9d,name:_0x224abc}=await this[_0x2880ea(0x238)](_0x2c4009),_0x110a07=Object[_0x2880ea(0x1dc)](_0x1d4663),_0x58fcec=await Promise[_0x2880ea(0x218)](_0x110a07[_0x2880ea(0x1d3)](_0x1d2b6b=>this[_0x2880ea(0x1f3)]['setSecret'](_0x4e2e9d,_0x1d2b6b,_0x1d4663[_0x1d2b6b]))),_0x87fe09=_0x58fcec[_0x2880ea(0x1d3)]((_0x2466d6,_0x1e356b)=>_0x2466d6['status']==='rejected'?_0x110a07[_0x1e356b]:null)[_0x2880ea(0x237)](_0x2f71ee=>_0x2f71ee!==null);if(_0x87fe09['length']>0x0)throw new SDKError(ErrorCode[_0x2880ea(0x208)],_0x2880ea(0x1fa)+(_0x87fe09[_0x2880ea(0x1dd)]>0x1?'s':'')+':\x20'+_0x87fe09[_0x2880ea(0x1c9)](',\x20'));return{'projectName':_0x224abc,'keys':_0x110a07};}async['deleteSecret'](_0x18ce81,_0x596924){const _0x1f7d1b=a180_0x270530,{id:_0x3346a9,name:_0x569fab}=await this[_0x1f7d1b(0x238)](_0x18ce81);return await this['client']['deleteSecret'](_0x3346a9,_0x596924),{'projectName':_0x569fab,'key':_0x596924};}async[a180_0x270530(0x201)](_0x26cc7f,_0x33d7d1){const _0x132779=a180_0x270530;return pullWorkflow({'client':this[_0x132779(0x1f3)],'resolveProjectId':this[_0x132779(0x238)][_0x132779(0x203)](this)},_0x26cc7f,_0x33d7d1);}async[a180_0x270530(0x1d7)](_0x465202,_0x555fcc){const _0x4ece36=a180_0x270530;return applyPullResult({'client':this[_0x4ece36(0x1f3)],'resolveProjectId':this['resolveProjectId'][_0x4ece36(0x203)](this)},_0x465202,_0x555fcc);}async[a180_0x270530(0x1b6)](_0x218260){const _0x44c70b=a180_0x270530;return preparePushWorkflow({'client':this[_0x44c70b(0x1f3)],'resolveProjectId':this[_0x44c70b(0x238)][_0x44c70b(0x203)](this)},_0x218260);}async[a180_0x270530(0x1b9)](_0x4fbce9){const _0x1e2189=a180_0x270530;return executePushWorkflow({'client':this[_0x1e2189(0x1f3)],'resolveProjectId':this[_0x1e2189(0x238)]['bind'](this)},_0x4fbce9);}async[a180_0x270530(0x217)](_0x3f5f0f,_0x3c802a,_0x348b32){const _0x479e52=a180_0x270530;return prepareCloneWorkflow({'client':this[_0x479e52(0x1f3)]},_0x3f5f0f,_0x3c802a,_0x348b32);}async[a180_0x270530(0x20b)](_0x2659bf){const _0x441916=a180_0x270530;return executeCloneWorkflow({'client':this[_0x441916(0x1f3)]},_0x2659bf);}}
@@ -1 +1 @@
1
- (function(_0x2915ec,_0x4cbfa8){const _0x8f940f=a181_0x1903,_0x18b2d3=_0x2915ec();while(!![]){try{const _0x3f63fc=parseInt(_0x8f940f(0xb3))/0x1*(-parseInt(_0x8f940f(0x82))/0x2)+-parseInt(_0x8f940f(0xa8))/0x3+-parseInt(_0x8f940f(0x9d))/0x4*(parseInt(_0x8f940f(0xa4))/0x5)+parseInt(_0x8f940f(0xab))/0x6*(-parseInt(_0x8f940f(0xb6))/0x7)+-parseInt(_0x8f940f(0x93))/0x8+-parseInt(_0x8f940f(0xb7))/0x9*(-parseInt(_0x8f940f(0xb2))/0xa)+parseInt(_0x8f940f(0x9e))/0xb;if(_0x3f63fc===_0x4cbfa8)break;else _0x18b2d3['push'](_0x18b2d3['shift']());}catch(_0x10d3f2){_0x18b2d3['push'](_0x18b2d3['shift']());}}}(a181_0xabfd,0xd0ec8));import{existsSync,promises as a181_0x56b3b3}from'fs';import a181_0x55a20c from'path';import a181_0x215914 from'os';function a181_0xabfd(){const _0x59b441=['TAR_BAD_ARCHIVE','3167101NPekQq','279zzSdBK','downloadProjectArchive','extract','getProject','latest','cwd','message','new','mkdir','Failed\x20to\x20extract\x20project\x20archive','unchanged','path','tdx-wf-pull-','sort','590AwAxOE','readFile','includes','tmpdir','readdir','unlink','\x20bytes)','changes','add','tdx-wf-apply-','stat','revision','toISOString','projectId','extracted','The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.','modified','4327048qqqbTs','zlib','WORKFLOW_ARCHIVE_CORRUPTED','size','targetDir','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','deleted','projectName','archive.tar.gz','isDirectory','964JnVCAg','27412176VZVIsA','name','localeCompare','type','\x20(archive\x20size:\x20','writeFile','17555KKkyjb','join','catch','tar','1877871USleNO','tdx.json','length','6WXTaYy','filter','has','push','utf-8','baseDir','isNewProject','333230NEVaKy','691wNrZNu','mkdtemp'];a181_0xabfd=function(){return _0x59b441;};return a181_0xabfd();}import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a181_0x1903(_0x4b3d6f,_0x352845){_0x4b3d6f=_0x4b3d6f-0x7d;const _0xabfd21=a181_0xabfd();let _0x19036c=_0xabfd21[_0x4b3d6f];return _0x19036c;}import{getWorkflowProjectDir,createWorkflowTdxConfigContent,updateWorkflowTdxConfig}from'./tdx-config.js';import{SDKError,ErrorCode}from'../errors.js';export async function pullWorkflow(_0x12f041,_0x5c26ae,_0x969a05={}){const _0x1d7cf9=a181_0x1903,_0x3b5a2a=await import('tar'),{client:_0x485f8a,resolveProjectId:_0x5dd4e4}=_0x12f041,{id:_0x26fa00,name:_0x2692bf}=await _0x5dd4e4(_0x5c26ae),_0x118c66=_0x969a05[_0x1d7cf9(0xb0)]||process[_0x1d7cf9(0xbc)](),_0x4b053d=_0x969a05[_0x1d7cf9(0x97)]||getWorkflowProjectDir(_0x2692bf,_0x118c66),_0x6006a4=a181_0x55a20c[_0x1d7cf9(0xa5)](_0x4b053d,'tdx.json'),_0x126f7f=!existsSync(_0x6006a4),_0x2df391=await a181_0x56b3b3['mkdtemp'](a181_0x55a20c[_0x1d7cf9(0xa5)](a181_0x215914[_0x1d7cf9(0x85)](),_0x1d7cf9(0x80))),_0x1f66a7=a181_0x55a20c[_0x1d7cf9(0xa5)](_0x2df391,'archive.tar.gz'),_0xebeffc=a181_0x55a20c[_0x1d7cf9(0xa5)](_0x2df391,_0x1d7cf9(0x90));try{await _0x485f8a['downloadProjectArchive'](_0x26fa00,_0x1f66a7,_0x969a05['revision']),await a181_0x56b3b3[_0x1d7cf9(0xbf)](_0xebeffc,{'recursive':!![]});try{await _0x3b5a2a[_0x1d7cf9(0xb9)]({'file':_0x1f66a7,'cwd':_0xebeffc,'gzip':!![]});}catch(_0x27ef23){const _0x2daba4=_0x27ef23 instanceof Error?_0x27ef23[_0x1d7cf9(0xbd)]:String(_0x27ef23);if(_0x2daba4[_0x1d7cf9(0x84)](_0x1d7cf9(0xb5))||_0x2daba4[_0x1d7cf9(0x84)]('zlib')){const _0x433bcc=await a181_0x56b3b3['stat'](_0x1f66a7)[_0x1d7cf9(0xa6)](()=>null),_0x53db82=_0x433bcc?_0x1d7cf9(0xa2)+_0x433bcc[_0x1d7cf9(0x96)]+'\x20bytes)':'';throw new SDKError(ErrorCode[_0x1d7cf9(0x95)],_0x1d7cf9(0x7d)+_0x53db82+':\x20'+_0x2daba4,_0x27ef23,{'helpText':'The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20'+_0x1d7cf9(0x91)});}throw _0x27ef23;}const _0x5ee9c7=await _0x485f8a[_0x1d7cf9(0xba)](_0x26fa00),_0x4ef110=_0x969a05[_0x1d7cf9(0x8d)]||_0x5ee9c7['revision']||_0x1d7cf9(0xbb),_0x5844ad=await calculateChanges(_0x4b053d,_0xebeffc,_0x126f7f),_0x4fa0e6={'new':_0x5844ad[_0x1d7cf9(0xac)](_0x5733d4=>_0x5733d4[_0x1d7cf9(0xa1)]===_0x1d7cf9(0xbe))[_0x1d7cf9(0xaa)],'modified':_0x5844ad[_0x1d7cf9(0xac)](_0x188b87=>_0x188b87['type']==='modified')[_0x1d7cf9(0xaa)],'deleted':_0x5844ad[_0x1d7cf9(0xac)](_0x462d27=>_0x462d27[_0x1d7cf9(0xa1)]==='deleted')[_0x1d7cf9(0xaa)],'unchanged':_0x5844ad[_0x1d7cf9(0xac)](_0x422252=>_0x422252[_0x1d7cf9(0xa1)]===_0x1d7cf9(0x7e))[_0x1d7cf9(0xaa)]};return{'projectName':_0x2692bf,'projectId':_0x26fa00,'revision':_0x4ef110,'targetDir':_0x4b053d,'changes':_0x5844ad,'summary':_0x4fa0e6,'hasChanges':_0x4fa0e6[_0x1d7cf9(0xbe)]>0x0||_0x4fa0e6[_0x1d7cf9(0x92)]>0x0||_0x4fa0e6[_0x1d7cf9(0x99)]>0x0,'isNewProject':_0x126f7f};}finally{await a181_0x56b3b3['rm'](_0x2df391,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0x3e399a,_0x292d84,_0x5ae8a1={}){const _0x2327c6=a181_0x1903,_0x113001=await import(_0x2327c6(0xa7)),{client:_0x35b74e}=_0x3e399a,_0x48d188=await a181_0x56b3b3[_0x2327c6(0xb4)](a181_0x55a20c['join'](a181_0x215914['tmpdir'](),_0x2327c6(0x8b))),_0x548216=a181_0x55a20c[_0x2327c6(0xa5)](_0x48d188,_0x2327c6(0x9b));try{await _0x35b74e[_0x2327c6(0xb8)](_0x292d84[_0x2327c6(0x8f)],_0x548216,_0x5ae8a1[_0x2327c6(0x8d)]),await a181_0x56b3b3['mkdir'](_0x292d84['targetDir'],{'recursive':!![]});for(const _0x252182 of _0x292d84[_0x2327c6(0x89)]){if(_0x252182[_0x2327c6(0xa1)]===_0x2327c6(0x99)){const _0x3fa643=a181_0x55a20c[_0x2327c6(0xa5)](_0x292d84[_0x2327c6(0x97)],_0x252182[_0x2327c6(0x7f)]);await a181_0x56b3b3[_0x2327c6(0x87)](_0x3fa643)[_0x2327c6(0xa6)](()=>{});}}try{await _0x113001[_0x2327c6(0xb9)]({'file':_0x548216,'cwd':_0x292d84[_0x2327c6(0x97)],'gzip':!![]});}catch(_0x58ec19){const _0x106682=_0x58ec19 instanceof Error?_0x58ec19[_0x2327c6(0xbd)]:String(_0x58ec19);if(_0x106682[_0x2327c6(0x84)](_0x2327c6(0xb5))||_0x106682['includes'](_0x2327c6(0x94))){const _0x11602e=await a181_0x56b3b3[_0x2327c6(0x8c)](_0x548216)[_0x2327c6(0xa6)](()=>null),_0x1d990a=_0x11602e?_0x2327c6(0xa2)+_0x11602e[_0x2327c6(0x96)]+_0x2327c6(0x88):'';throw new SDKError(ErrorCode[_0x2327c6(0x95)],_0x2327c6(0x7d)+_0x1d990a+':\x20'+_0x106682,_0x58ec19,{'helpText':_0x2327c6(0x98)+_0x2327c6(0x91)});}throw _0x58ec19;}const _0x322b4e=a181_0x55a20c[_0x2327c6(0xa5)](_0x292d84[_0x2327c6(0x97)],_0x2327c6(0xa9));if(_0x292d84[_0x2327c6(0xb1)]){const _0x3ceb8e=createWorkflowTdxConfigContent(_0x292d84[_0x2327c6(0x9a)],_0x292d84[_0x2327c6(0x8f)],_0x292d84[_0x2327c6(0x8d)]);await a181_0x56b3b3[_0x2327c6(0xa3)](_0x322b4e,_0x3ceb8e,_0x2327c6(0xaf));}else updateWorkflowTdxConfig(_0x322b4e,{'last_pulled_revision':_0x292d84[_0x2327c6(0x8d)],'last_pulled_at':new Date()[_0x2327c6(0x8e)]()});}finally{await a181_0x56b3b3['rm'](_0x48d188,{'recursive':!![],'force':!![]});}}async function calculateChanges(_0x127c70,_0x15cf52,_0x21eaeb){const _0x371027=a181_0x1903,_0x297a42=[],_0xa159e=await getAllFiles(_0x15cf52),_0x433ad8=existsSync(_0x127c70)?await getAllFiles(_0x127c70):new Set();for(const _0x2606f6 of _0xa159e){const _0x294db3=a181_0x55a20c['join'](_0x127c70,_0x2606f6),_0x25c414=a181_0x55a20c[_0x371027(0xa5)](_0x15cf52,_0x2606f6);if(_0x2606f6===_0x371027(0xa9))continue;const _0x4cfb9e=await a181_0x56b3b3['readFile'](_0x25c414,_0x371027(0xaf))[_0x371027(0xa6)](()=>null);if(_0x4cfb9e===null)continue;if(!existsSync(_0x294db3)||_0x21eaeb)_0x297a42[_0x371027(0xae)]({'path':_0x2606f6,'type':_0x371027(0xbe),'newContent':_0x4cfb9e});else{const _0x25ee11=await a181_0x56b3b3['readFile'](_0x294db3,_0x371027(0xaf))[_0x371027(0xa6)](()=>null);if(_0x25ee11===null)_0x297a42[_0x371027(0xae)]({'path':_0x2606f6,'type':_0x371027(0x92),'newContent':_0x4cfb9e});else{if(_0x25ee11!==_0x4cfb9e){const _0x415db2=generateDiff(_0x25ee11,_0x4cfb9e),_0x34023f=hasChanges(_0x415db2)?formatDiffWithColors(_0x415db2):undefined;_0x297a42['push']({'path':_0x2606f6,'type':_0x371027(0x92),'oldContent':_0x25ee11,'newContent':_0x4cfb9e,'diff':_0x34023f});}else _0x297a42['push']({'path':_0x2606f6,'type':_0x371027(0x7e)});}}}if(!_0x21eaeb)for(const _0x457130 of _0x433ad8){if(_0x457130===_0x371027(0xa9))continue;if(!_0xa159e[_0x371027(0xad)](_0x457130)){const _0x57a9e7=a181_0x55a20c[_0x371027(0xa5)](_0x127c70,_0x457130),_0x1cfc40=await a181_0x56b3b3[_0x371027(0x83)](_0x57a9e7,_0x371027(0xaf))[_0x371027(0xa6)](()=>undefined);_0x297a42[_0x371027(0xae)]({'path':_0x457130,'type':'deleted','oldContent':_0x1cfc40});}}return _0x297a42[_0x371027(0x81)]((_0x4e5c93,_0x2c4bcb)=>_0x4e5c93[_0x371027(0x7f)][_0x371027(0xa0)](_0x2c4bcb[_0x371027(0x7f)])),_0x297a42;}async function getAllFiles(_0x1b64c6,_0xdd9140=''){const _0x2ec47e=a181_0x1903,_0x11c8e7=new Set();if(!existsSync(_0x1b64c6))return _0x11c8e7;const _0x2db7ea=await a181_0x56b3b3[_0x2ec47e(0x86)](_0x1b64c6,{'withFileTypes':!![]});for(const _0x286283 of _0x2db7ea){const _0x41db35=_0xdd9140?a181_0x55a20c[_0x2ec47e(0xa5)](_0xdd9140,_0x286283[_0x2ec47e(0x9f)]):_0x286283[_0x2ec47e(0x9f)];if(_0x286283[_0x2ec47e(0x9c)]()){const _0x32269c=await getAllFiles(a181_0x55a20c[_0x2ec47e(0xa5)](_0x1b64c6,_0x286283['name']),_0x41db35);for(const _0x42fd2f of _0x32269c){_0x11c8e7[_0x2ec47e(0x8a)](_0x42fd2f);}}else _0x11c8e7[_0x2ec47e(0x8a)](_0x41db35);}return _0x11c8e7;}
1
+ (function(_0x28e027,_0x418965){const _0x4be564=a181_0x173a,_0x1b2509=_0x28e027();while(!![]){try{const _0x37e8b2=parseInt(_0x4be564(0x72))/0x1+parseInt(_0x4be564(0x64))/0x2+-parseInt(_0x4be564(0x9c))/0x3+-parseInt(_0x4be564(0x6a))/0x4*(parseInt(_0x4be564(0x7b))/0x5)+parseInt(_0x4be564(0x90))/0x6+-parseInt(_0x4be564(0x81))/0x7*(-parseInt(_0x4be564(0x9b))/0x8)+parseInt(_0x4be564(0x9a))/0x9*(-parseInt(_0x4be564(0x83))/0xa);if(_0x37e8b2===_0x418965)break;else _0x1b2509['push'](_0x1b2509['shift']());}catch(_0x50fd0e){_0x1b2509['push'](_0x1b2509['shift']());}}}(a181_0xe99d,0x88e15));import{existsSync,promises as a181_0x53a759}from'fs';import a181_0x2db781 from'path';import a181_0x4639f0 from'os';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a181_0xe99d(){const _0x57e45a=['add','tdx.json','filter','projectName','2654652GcbZYc','cwd','The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20','deleted','tdx-wf-apply-','type','readFile','isDirectory','readdir','tar','330732DVwlKZ','24fRHlzv','830271FbxlyD','downloadProjectArchive','The\x20archive\x20may\x20be\x20truncated\x20or\x20corrupted.\x20Try\x20pushing\x20a\x20new\x20revision\x20or\x20contact\x20support.','tmpdir','689054EcqzjS','archive.tar.gz','unlink','utf-8','push','size','12PCnKpl','TAR_BAD_ARCHIVE','modified','changes','name','unchanged','writeFile','revision','14273bJTGKn','getProject','join','message','baseDir','projectId','path','extracted','Failed\x20to\x20extract\x20project\x20archive','416415FyredF','localeCompare','has','WORKFLOW_ARCHIVE_CORRUPTED','catch','\x20(archive\x20size:\x20','2039317PDLStH','includes','160aDJRWE','mkdtemp','\x20bytes)','mkdir','length','targetDir','zlib','sort','stat'];a181_0xe99d=function(){return _0x57e45a;};return a181_0xe99d();}import{getWorkflowProjectDir,createWorkflowTdxConfigContent,updateWorkflowTdxConfig}from'./tdx-config.js';import{SDKError,ErrorCode}from'../errors.js';export async function pullWorkflow(_0x2d1e95,_0x49b660,_0x510974={}){const _0xe20a3f=a181_0x173a,_0x51d295=await import(_0xe20a3f(0x99)),{client:_0x3f3ff7,resolveProjectId:_0x4b5553}=_0x2d1e95,{id:_0xfbf58b,name:_0x389cb5}=await _0x4b5553(_0x49b660),_0xb8dc69=_0x510974[_0xe20a3f(0x76)]||process[_0xe20a3f(0x91)](),_0x2ea339=_0x510974['targetDir']||getWorkflowProjectDir(_0x389cb5,_0xb8dc69),_0x75e6af=a181_0x2db781[_0xe20a3f(0x74)](_0x2ea339,_0xe20a3f(0x8d)),_0x4e2755=!existsSync(_0x75e6af),_0x733c07=await a181_0x53a759[_0xe20a3f(0x84)](a181_0x2db781[_0xe20a3f(0x74)](a181_0x4639f0[_0xe20a3f(0x9f)](),'tdx-wf-pull-')),_0x303754=a181_0x2db781[_0xe20a3f(0x74)](_0x733c07,_0xe20a3f(0x65)),_0x5ddc8f=a181_0x2db781['join'](_0x733c07,_0xe20a3f(0x79));try{await _0x3f3ff7[_0xe20a3f(0x9d)](_0xfbf58b,_0x303754,_0x510974[_0xe20a3f(0x71)]),await a181_0x53a759[_0xe20a3f(0x86)](_0x5ddc8f,{'recursive':!![]});try{await _0x51d295['extract']({'file':_0x303754,'cwd':_0x5ddc8f,'gzip':!![]});}catch(_0x1943b0){const _0x21b189=_0x1943b0 instanceof Error?_0x1943b0[_0xe20a3f(0x75)]:String(_0x1943b0);if(_0x21b189[_0xe20a3f(0x82)](_0xe20a3f(0x6b))||_0x21b189[_0xe20a3f(0x82)](_0xe20a3f(0x89))){const _0x3e1c68=await a181_0x53a759['stat'](_0x303754)[_0xe20a3f(0x7f)](()=>null),_0x3bb68f=_0x3e1c68?'\x20(archive\x20size:\x20'+_0x3e1c68[_0xe20a3f(0x69)]+'\x20bytes)':'';throw new SDKError(ErrorCode[_0xe20a3f(0x7e)],_0xe20a3f(0x7a)+_0x3bb68f+':\x20'+_0x21b189,_0x1943b0,{'helpText':'The\x20archive\x20passed\x20initial\x20validation\x20but\x20extraction\x20failed.\x20'+_0xe20a3f(0x9e)});}throw _0x1943b0;}const _0x548567=await _0x3f3ff7[_0xe20a3f(0x73)](_0xfbf58b),_0x4274d4=_0x510974[_0xe20a3f(0x71)]||_0x548567[_0xe20a3f(0x71)]||'latest',_0x1a7745=await calculateChanges(_0x2ea339,_0x5ddc8f,_0x4e2755),_0x39af98={'new':_0x1a7745['filter'](_0xf76386=>_0xf76386[_0xe20a3f(0x95)]==='new')['length'],'modified':_0x1a7745[_0xe20a3f(0x8e)](_0x47decd=>_0x47decd[_0xe20a3f(0x95)]===_0xe20a3f(0x6c))[_0xe20a3f(0x87)],'deleted':_0x1a7745[_0xe20a3f(0x8e)](_0x4a73b8=>_0x4a73b8[_0xe20a3f(0x95)]===_0xe20a3f(0x93))[_0xe20a3f(0x87)],'unchanged':_0x1a7745[_0xe20a3f(0x8e)](_0x4a2adf=>_0x4a2adf[_0xe20a3f(0x95)]===_0xe20a3f(0x6f))[_0xe20a3f(0x87)]};return{'projectName':_0x389cb5,'projectId':_0xfbf58b,'revision':_0x4274d4,'targetDir':_0x2ea339,'changes':_0x1a7745,'summary':_0x39af98,'hasChanges':_0x39af98['new']>0x0||_0x39af98[_0xe20a3f(0x6c)]>0x0||_0x39af98[_0xe20a3f(0x93)]>0x0,'isNewProject':_0x4e2755};}finally{await a181_0x53a759['rm'](_0x733c07,{'recursive':!![],'force':!![]});}}export async function applyPullResult(_0xd32f5a,_0x1205c2,_0xcd60e5={}){const _0x3d562a=a181_0x173a,_0x5997ec=await import(_0x3d562a(0x99)),{client:_0x21a352}=_0xd32f5a,_0x236e44=await a181_0x53a759['mkdtemp'](a181_0x2db781[_0x3d562a(0x74)](a181_0x4639f0[_0x3d562a(0x9f)](),_0x3d562a(0x94))),_0x18740b=a181_0x2db781[_0x3d562a(0x74)](_0x236e44,_0x3d562a(0x65));try{await _0x21a352[_0x3d562a(0x9d)](_0x1205c2[_0x3d562a(0x77)],_0x18740b,_0xcd60e5[_0x3d562a(0x71)]),await a181_0x53a759[_0x3d562a(0x86)](_0x1205c2['targetDir'],{'recursive':!![]});for(const _0x1e0634 of _0x1205c2[_0x3d562a(0x6d)]){if(_0x1e0634[_0x3d562a(0x95)]===_0x3d562a(0x93)){const _0x1cab5f=a181_0x2db781[_0x3d562a(0x74)](_0x1205c2[_0x3d562a(0x88)],_0x1e0634[_0x3d562a(0x78)]);await a181_0x53a759[_0x3d562a(0x66)](_0x1cab5f)[_0x3d562a(0x7f)](()=>{});}}try{await _0x5997ec['extract']({'file':_0x18740b,'cwd':_0x1205c2[_0x3d562a(0x88)],'gzip':!![]});}catch(_0x1a72ca){const _0x27f7d5=_0x1a72ca instanceof Error?_0x1a72ca['message']:String(_0x1a72ca);if(_0x27f7d5[_0x3d562a(0x82)](_0x3d562a(0x6b))||_0x27f7d5[_0x3d562a(0x82)]('zlib')){const _0x59dbf1=await a181_0x53a759[_0x3d562a(0x8b)](_0x18740b)[_0x3d562a(0x7f)](()=>null),_0x5701e0=_0x59dbf1?_0x3d562a(0x80)+_0x59dbf1['size']+_0x3d562a(0x85):'';throw new SDKError(ErrorCode['WORKFLOW_ARCHIVE_CORRUPTED'],_0x3d562a(0x7a)+_0x5701e0+':\x20'+_0x27f7d5,_0x1a72ca,{'helpText':_0x3d562a(0x92)+_0x3d562a(0x9e)});}throw _0x1a72ca;}const _0x2a5ffe=a181_0x2db781['join'](_0x1205c2['targetDir'],_0x3d562a(0x8d));if(_0x1205c2['isNewProject']){const _0x51cebd=createWorkflowTdxConfigContent(_0x1205c2[_0x3d562a(0x8f)],_0x1205c2[_0x3d562a(0x77)],_0x1205c2[_0x3d562a(0x71)]);await a181_0x53a759[_0x3d562a(0x70)](_0x2a5ffe,_0x51cebd,_0x3d562a(0x67));}else updateWorkflowTdxConfig(_0x2a5ffe,{'last_pulled_revision':_0x1205c2[_0x3d562a(0x71)],'last_pulled_at':new Date()['toISOString']()});}finally{await a181_0x53a759['rm'](_0x236e44,{'recursive':!![],'force':!![]});}}function a181_0x173a(_0x29737b,_0x38bfae){_0x29737b=_0x29737b-0x64;const _0xe99d73=a181_0xe99d();let _0x173aaf=_0xe99d73[_0x29737b];return _0x173aaf;}async function calculateChanges(_0x28aa20,_0x3e10e3,_0x595be1){const _0x3c4d82=a181_0x173a,_0x5ecc99=[],_0xfca931=await getAllFiles(_0x3e10e3),_0x203184=existsSync(_0x28aa20)?await getAllFiles(_0x28aa20):new Set();for(const _0x171195 of _0xfca931){const _0x4d58fd=a181_0x2db781['join'](_0x28aa20,_0x171195),_0x1647b2=a181_0x2db781['join'](_0x3e10e3,_0x171195);if(_0x171195===_0x3c4d82(0x8d))continue;const _0x5ae8b7=await a181_0x53a759[_0x3c4d82(0x96)](_0x1647b2,_0x3c4d82(0x67))['catch'](()=>null);if(_0x5ae8b7===null)continue;if(!existsSync(_0x4d58fd)||_0x595be1)_0x5ecc99['push']({'path':_0x171195,'type':'new','newContent':_0x5ae8b7});else{const _0x24a669=await a181_0x53a759['readFile'](_0x4d58fd,_0x3c4d82(0x67))[_0x3c4d82(0x7f)](()=>null);if(_0x24a669===null)_0x5ecc99[_0x3c4d82(0x68)]({'path':_0x171195,'type':_0x3c4d82(0x6c),'newContent':_0x5ae8b7});else{if(_0x24a669!==_0x5ae8b7){const _0x33f429=generateDiff(_0x24a669,_0x5ae8b7),_0x33f149=hasChanges(_0x33f429)?formatDiffWithColors(_0x33f429):undefined;_0x5ecc99[_0x3c4d82(0x68)]({'path':_0x171195,'type':_0x3c4d82(0x6c),'oldContent':_0x24a669,'newContent':_0x5ae8b7,'diff':_0x33f149});}else _0x5ecc99['push']({'path':_0x171195,'type':'unchanged'});}}}if(!_0x595be1)for(const _0x2d1c1f of _0x203184){if(_0x2d1c1f===_0x3c4d82(0x8d))continue;if(!_0xfca931[_0x3c4d82(0x7d)](_0x2d1c1f)){const _0x46d2f1=a181_0x2db781[_0x3c4d82(0x74)](_0x28aa20,_0x2d1c1f),_0x3d6054=await a181_0x53a759[_0x3c4d82(0x96)](_0x46d2f1,_0x3c4d82(0x67))[_0x3c4d82(0x7f)](()=>undefined);_0x5ecc99['push']({'path':_0x2d1c1f,'type':_0x3c4d82(0x93),'oldContent':_0x3d6054});}}return _0x5ecc99[_0x3c4d82(0x8a)]((_0x509fcb,_0x268c00)=>_0x509fcb[_0x3c4d82(0x78)][_0x3c4d82(0x7c)](_0x268c00[_0x3c4d82(0x78)])),_0x5ecc99;}async function getAllFiles(_0xdb4f3a,_0x1a126b=''){const _0x1c965f=a181_0x173a,_0x3978b7=new Set();if(!existsSync(_0xdb4f3a))return _0x3978b7;const _0x3a55d9=await a181_0x53a759[_0x1c965f(0x98)](_0xdb4f3a,{'withFileTypes':!![]});for(const _0x18bcf1 of _0x3a55d9){const _0x134f92=_0x1a126b?a181_0x2db781['join'](_0x1a126b,_0x18bcf1[_0x1c965f(0x6e)]):_0x18bcf1[_0x1c965f(0x6e)];if(_0x18bcf1[_0x1c965f(0x97)]()){const _0x475d86=await getAllFiles(a181_0x2db781[_0x1c965f(0x74)](_0xdb4f3a,_0x18bcf1['name']),_0x134f92);for(const _0x875fb of _0x475d86){_0x3978b7[_0x1c965f(0x8c)](_0x875fb);}}else _0x3978b7[_0x1c965f(0x8c)](_0x134f92);}return _0x3978b7;}
@@ -1 +1 @@
1
- (function(_0x45427b,_0x5bd39c){const _0x37d955=a182_0x3b1a,_0x13104e=_0x45427b();while(!![]){try{const _0x7f1dce=parseInt(_0x37d955(0xaa))/0x1*(-parseInt(_0x37d955(0xa0))/0x2)+parseInt(_0x37d955(0x95))/0x3+-parseInt(_0x37d955(0x89))/0x4*(-parseInt(_0x37d955(0xb4))/0x5)+parseInt(_0x37d955(0xae))/0x6+-parseInt(_0x37d955(0x85))/0x7*(parseInt(_0x37d955(0xb8))/0x8)+-parseInt(_0x37d955(0xac))/0x9+parseInt(_0x37d955(0xa4))/0xa;if(_0x7f1dce===_0x5bd39c)break;else _0x13104e['push'](_0x13104e['shift']());}catch(_0x51c27c){_0x13104e['push'](_0x13104e['shift']());}}}(a182_0x4dbc,0x44d85));function a182_0x4dbc(){const _0x4965c9=['includes','230688qMnirI','tmpdir','new','uploadProjectArchive','length','zlib','Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison','size','add','tdx.json','workflow_project','608WtpCtX','No\x20','readFile','mkdtemp','5688710XxuDoZ','join','toISOString','TAR_BAD_ARCHIVE','configPath','projectName','320wLjJgz','unchanged','3152466fpOwNx','revision','1393632fmaSHY','catch','.digdagignore','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','extracted','skipValidation','895QwvMjy','name','isDirectory','tdx-wf-push-','8GNOtdv','deleted','path','WORKFLOW_ARCHIVE_CORRUPTED','filter','endsWith','replace','push','utf-8','has','3506629LEbliW','archive.tar.gz','cwd','posix','7876neAEiV','tdx-wf-push-archive-','sourceDir','modified','message','sort','configResult','type','tar','mkdir','localeCompare'];a182_0x4dbc=function(){return _0x4965c9;};return a182_0x4dbc();}import{promises as a182_0x19e6cd}from'fs';import a182_0x18cab7 from'path';import a182_0x1ced42 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_0x3b1a(_0x26cc55,_0x128af1){_0x26cc55=_0x26cc55-0x84;const _0x4dbcc0=a182_0x4dbc();let _0x3b1a26=_0x4dbcc0[_0x26cc55];return _0x3b1a26;}import{SDKError,ErrorCode}from'../errors.js';export async function preparePushWorkflow(_0x3b308d,_0x59d71e={}){const _0x3d320d=a182_0x3b1a,_0x369e07=await import(_0x3d320d(0x91)),{client:_0xdb9cbd,resolveProjectId:_0x7d3a21}=_0x3b308d,_0x363fc8=_0x59d71e['sourceDir']||process[_0x3d320d(0x87)](),_0x2c0d81=findWorkflowTdxConfig(_0x363fc8),{config:_0x2b7aff,configDir:_0x186322}=_0x2c0d81;let _0x14a7ad,_0x29f610=_0x2b7aff[_0x3d320d(0x9f)];try{const _0x618cbf=await _0x7d3a21(_0x2b7aff[_0x3d320d(0x9f)]);_0x14a7ad=_0x618cbf['id'],_0x29f610=_0x618cbf[_0x3d320d(0xb5)];}catch{_0x14a7ad='';}const _0x2ccf45=_0x59d71e[_0x3d320d(0xad)]||new Date()[_0x3d320d(0xa6)]()[_0x3d320d(0xbe)](/[:.]/g,'-');if(!_0x59d71e[_0x3d320d(0xb3)]){const _0x3462ac=await a182_0x19e6cd['readdir'](_0x186322),_0x381637=_0x3462ac['filter'](_0x102547=>_0x102547[_0x3d320d(0xbd)](WORKFLOW_FILE_EXTENSION));if(_0x381637[_0x3d320d(0x99)]===0x0)throw new Error(_0x3d320d(0xa1)+WORKFLOW_FILE_EXTENSION+'\x20workflow\x20files\x20found\x20in\x20'+_0x186322);}const _0x57160a=await getProjectFiles(_0x186322);let _0x5c5f4e;if(_0x14a7ad){const _0xb427a2=await a182_0x19e6cd[_0x3d320d(0xa3)](a182_0x18cab7[_0x3d320d(0xa5)](a182_0x1ced42[_0x3d320d(0x96)](),_0x3d320d(0xb7))),_0x305c59=a182_0x18cab7['join'](_0xb427a2,'archive.tar.gz'),_0x30bc0f=a182_0x18cab7[_0x3d320d(0xa5)](_0xb427a2,_0x3d320d(0xb2));try{await _0xdb9cbd['downloadProjectArchive'](_0x14a7ad,_0x305c59),await a182_0x19e6cd[_0x3d320d(0x92)](_0x30bc0f,{'recursive':!![]});try{await _0x369e07['extract']({'file':_0x305c59,'cwd':_0x30bc0f,'gzip':!![]});}catch(_0x14cd90){const _0x3abebb=_0x14cd90 instanceof Error?_0x14cd90[_0x3d320d(0x8d)]:String(_0x14cd90);if(_0x3abebb[_0x3d320d(0x94)](_0x3d320d(0xa7))||_0x3abebb['includes'](_0x3d320d(0x9a))){const _0x1ed542=await a182_0x19e6cd['stat'](_0x305c59)[_0x3d320d(0xaf)](()=>null),_0xc2046e=_0x1ed542?'\x20(archive\x20size:\x20'+_0x1ed542[_0x3d320d(0x9c)]+'\x20bytes)':'';throw new SDKError(ErrorCode[_0x3d320d(0xbb)],_0x3d320d(0x9b)+_0xc2046e+':\x20'+_0x3abebb,_0x14cd90,{'helpText':_0x3d320d(0xb1)});}throw _0x14cd90;}_0x5c5f4e=await calculatePushChanges(_0x186322,_0x30bc0f,_0x57160a);}finally{await a182_0x19e6cd['rm'](_0xb427a2,{'recursive':!![],'force':!![]});}}else{_0x5c5f4e=[];for(const _0x21e142 of _0x57160a){const _0x58922b=a182_0x18cab7['join'](_0x186322,_0x21e142),_0x1e4cca=await a182_0x19e6cd[_0x3d320d(0xa2)](_0x58922b,_0x3d320d(0xc0))[_0x3d320d(0xaf)](()=>null);_0x5c5f4e['push']({'path':_0x21e142,'type':'new','newContent':_0x1e4cca||undefined});}}const _0x597659={'new':_0x5c5f4e[_0x3d320d(0xbc)](_0x8128f2=>_0x8128f2['type']===_0x3d320d(0x97))[_0x3d320d(0x99)],'modified':_0x5c5f4e[_0x3d320d(0xbc)](_0x276ef6=>_0x276ef6[_0x3d320d(0x90)]===_0x3d320d(0x8c))['length'],'deleted':_0x5c5f4e[_0x3d320d(0xbc)](_0x579e31=>_0x579e31['type']===_0x3d320d(0xb9))[_0x3d320d(0x99)],'unchanged':_0x5c5f4e['filter'](_0x1176a0=>_0x1176a0[_0x3d320d(0x90)]===_0x3d320d(0xab))['length']};return{'projectName':_0x29f610,'projectId':_0x14a7ad,'revision':_0x2ccf45,'sourceDir':_0x186322,'changes':_0x5c5f4e,'summary':_0x597659,'hasChanges':_0x597659[_0x3d320d(0x97)]>0x0||_0x597659['modified']>0x0||_0x597659[_0x3d320d(0xb9)]>0x0,'configResult':_0x2c0d81};}export async function executePushWorkflow(_0x9f1b1d,_0x366f40){const _0x551260=a182_0x3b1a,_0x2b2cd2=await import(_0x551260(0x91)),{client:_0x414a35}=_0x9f1b1d,_0x375760=await getProjectFiles(_0x366f40[_0x551260(0x8b)]),_0x312f56=await a182_0x19e6cd[_0x551260(0xa3)](a182_0x18cab7[_0x551260(0xa5)](a182_0x1ced42[_0x551260(0x96)](),_0x551260(0x8a))),_0x449711=a182_0x18cab7['join'](_0x312f56,_0x551260(0x86));try{await _0x2b2cd2['create']({'file':_0x449711,'gzip':!![],'cwd':_0x366f40['sourceDir'],'portable':!![]},_0x375760);const _0xe71136=await _0x414a35[_0x551260(0x98)](_0x366f40[_0x551260(0xa9)],_0x366f40['revision'],_0x449711);return updateWorkflowTdxConfig(_0x366f40[_0x551260(0x8f)][_0x551260(0xa8)],{'workflow_project_id':_0xe71136['id'],'last_pushed_revision':_0xe71136[_0x551260(0xad)],'last_pushed_at':new Date()['toISOString']()}),{'projectId':_0xe71136['id'],'projectName':_0xe71136[_0x551260(0xb5)],'revision':_0xe71136[_0x551260(0xad)]};}finally{await a182_0x19e6cd['rm'](_0x312f56,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x2c60ab,_0x3081b7=_0x2c60ab,_0x2d7056='',_0xca7f8c=null){const _0x5cf3a9=a182_0x3b1a,_0x49f7ce=[];if(_0xca7f8c===null){_0xca7f8c=createIgnoreInstance();const _0xfbc91d=await loadDigdagignore(_0x2c60ab);_0xfbc91d&&_0xca7f8c[_0x5cf3a9(0x9d)](_0xfbc91d);}if(_0x2d7056!==''){const _0x2f5d55=await loadDigdagignore(_0x3081b7);_0x2f5d55&&addScopedPatterns(_0xca7f8c,_0x2f5d55,_0x2d7056);}const _0x596b8a=await a182_0x19e6cd['readdir'](_0x3081b7,{'withFileTypes':!![]});for(const _0x4c7406 of _0x596b8a){const _0x2cbb07=_0x2d7056?a182_0x18cab7[_0x5cf3a9(0x88)][_0x5cf3a9(0xa5)](_0x2d7056,_0x4c7406[_0x5cf3a9(0xb5)]):_0x4c7406[_0x5cf3a9(0xb5)];if(_0x4c7406[_0x5cf3a9(0xb5)]===_0x5cf3a9(0x9e))continue;if(_0x4c7406['name']===_0x5cf3a9(0xb0))continue;if(!shouldIncludeInArchive(_0x4c7406[_0x5cf3a9(0xb5)]))continue;if(shouldIgnoreWithInstance(_0xca7f8c,_0x2cbb07,_0x4c7406[_0x5cf3a9(0xb6)]()))continue;if(_0x4c7406['isDirectory']()){const _0x467fb2=await getProjectFiles(_0x2c60ab,a182_0x18cab7[_0x5cf3a9(0xa5)](_0x3081b7,_0x4c7406[_0x5cf3a9(0xb5)]),_0x2cbb07,_0xca7f8c);_0x49f7ce[_0x5cf3a9(0xbf)](..._0x467fb2);}else _0x49f7ce[_0x5cf3a9(0xbf)](_0x2cbb07);}return _0x49f7ce;}async function calculatePushChanges(_0x1df770,_0x4c3aed,_0x1ce1c2){const _0x30946f=a182_0x3b1a,_0x22871a=[],_0x25583d=new Set(await getProjectFiles(_0x4c3aed));for(const _0x167cea of _0x1ce1c2){const _0x369519=a182_0x18cab7[_0x30946f(0xa5)](_0x1df770,_0x167cea),_0x3335dc=a182_0x18cab7[_0x30946f(0xa5)](_0x4c3aed,_0x167cea),_0x139e98=await a182_0x19e6cd[_0x30946f(0xa2)](_0x369519,_0x30946f(0xc0))[_0x30946f(0xaf)](()=>null);if(_0x139e98===null)continue;if(!_0x25583d[_0x30946f(0x84)](_0x167cea))_0x22871a[_0x30946f(0xbf)]({'path':_0x167cea,'type':_0x30946f(0x97),'newContent':_0x139e98});else{const _0x9ae57e=await a182_0x19e6cd[_0x30946f(0xa2)](_0x3335dc,_0x30946f(0xc0))[_0x30946f(0xaf)](()=>null);if(_0x9ae57e===null)_0x22871a[_0x30946f(0xbf)]({'path':_0x167cea,'type':'modified','newContent':_0x139e98});else{if(_0x9ae57e!==_0x139e98){const _0xe0bda0=generateDiff(_0x9ae57e,_0x139e98),_0x1d9985=hasChanges(_0xe0bda0)?formatDiffWithColors(_0xe0bda0):undefined;_0x22871a['push']({'path':_0x167cea,'type':'modified','oldContent':_0x9ae57e,'newContent':_0x139e98,'diff':_0x1d9985});}else _0x22871a['push']({'path':_0x167cea,'type':_0x30946f(0xab)});}}}for(const _0x24cec9 of _0x25583d){if(!_0x1ce1c2[_0x30946f(0x94)](_0x24cec9)){const _0x169d0f=a182_0x18cab7[_0x30946f(0xa5)](_0x4c3aed,_0x24cec9),_0x2f8dc3=await a182_0x19e6cd['readFile'](_0x169d0f,'utf-8')['catch'](()=>undefined);_0x22871a['push']({'path':_0x24cec9,'type':_0x30946f(0xb9),'oldContent':_0x2f8dc3});}}return _0x22871a[_0x30946f(0x8e)]((_0x58220c,_0x1147ad)=>_0x58220c[_0x30946f(0xba)][_0x30946f(0x93)](_0x1147ad[_0x30946f(0xba)])),_0x22871a;}
1
+ (function(_0x4ec375,_0x4c135c){const _0x278b7d=a182_0xc4b1,_0x313ce1=_0x4ec375();while(!![]){try{const _0x1e48a9=parseInt(_0x278b7d(0x1c0))/0x1*(parseInt(_0x278b7d(0x1aa))/0x2)+parseInt(_0x278b7d(0x199))/0x3*(parseInt(_0x278b7d(0x1b5))/0x4)+-parseInt(_0x278b7d(0x181))/0x5*(parseInt(_0x278b7d(0x1a8))/0x6)+-parseInt(_0x278b7d(0x1b8))/0x7*(parseInt(_0x278b7d(0x18d))/0x8)+parseInt(_0x278b7d(0x1a6))/0x9+parseInt(_0x278b7d(0x1ab))/0xa*(-parseInt(_0x278b7d(0x18a))/0xb)+parseInt(_0x278b7d(0x197))/0xc;if(_0x1e48a9===_0x4c135c)break;else _0x313ce1['push'](_0x313ce1['shift']());}catch(_0x27eef6){_0x313ce1['push'](_0x313ce1['shift']());}}}(a182_0x4385,0x61257));function a182_0x4385(){const _0x56a719=['posix','2361890oNqEKW','No\x20','push','modified','Use\x20\x27tdx\x20wf\x20upload\x27\x20to\x20force\x20push\x20without\x20comparison.','configResult','isDirectory','catch','workflow_project','11IICDhg','utf-8','tdx.json','6110000gprTDD','type','has','zlib','\x20workflow\x20files\x20found\x20in\x20','tmpdir','deleted','\x20bytes)','readFile','projectName','17882088ZPnkGn','add','195eNpBlc','uploadProjectArchive','extract','unchanged','archive.tar.gz','revision','filter','stat','new','downloadProjectArchive','length','tar','sort','2160171jbBHQH','Failed\x20to\x20extract\x20remote\x20project\x20archive\x20for\x20comparison','6OeziKM','readdir','52nSIsse','5229310HbPmol','tdx-wf-push-','includes','extracted','join','.digdagignore','toISOString','\x20(archive\x20size:\x20','localeCompare','replace','4924ZkuEFn','sourceDir','TAR_BAD_ARCHIVE','7sqPLej','name','create','tdx-wf-push-archive-','cwd','mkdtemp','WORKFLOW_ARCHIVE_CORRUPTED','message','13337nColZh'];a182_0x4385=function(){return _0x56a719;};return a182_0x4385();}import{promises as a182_0x2eba10}from'fs';import a182_0x3d3f8b from'path';import a182_0x2b91ff 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(_0x11c1ca,_0x58d652={}){const _0x487696=a182_0xc4b1,_0x97c2fa=await import(_0x487696(0x1a4)),{client:_0x496f37,resolveProjectId:_0x2d4ee5}=_0x11c1ca,_0x3f37dd=_0x58d652[_0x487696(0x1b6)]||process[_0x487696(0x1bc)](),_0x38d743=findWorkflowTdxConfig(_0x3f37dd),{config:_0x2257aa,configDir:_0x1436a0}=_0x38d743;let _0x7f3223,_0x1a51a7=_0x2257aa[_0x487696(0x189)];try{const _0x508769=await _0x2d4ee5(_0x2257aa[_0x487696(0x189)]);_0x7f3223=_0x508769['id'],_0x1a51a7=_0x508769[_0x487696(0x1b9)];}catch{_0x7f3223='';}const _0x1d110c=_0x58d652['revision']||new Date()[_0x487696(0x1b1)]()[_0x487696(0x1b4)](/[:.]/g,'-');if(!_0x58d652['skipValidation']){const _0x23e8fb=await a182_0x2eba10[_0x487696(0x1a9)](_0x1436a0),_0x5498da=_0x23e8fb[_0x487696(0x19f)](_0x33987e=>_0x33987e['endsWith'](WORKFLOW_FILE_EXTENSION));if(_0x5498da[_0x487696(0x1a3)]===0x0)throw new Error(_0x487696(0x182)+WORKFLOW_FILE_EXTENSION+_0x487696(0x191)+_0x1436a0);}const _0x4480a1=await getProjectFiles(_0x1436a0);let _0x354971;if(_0x7f3223){const _0xcd9816=await a182_0x2eba10['mkdtemp'](a182_0x3d3f8b['join'](a182_0x2b91ff[_0x487696(0x192)](),_0x487696(0x1ac))),_0x22fc56=a182_0x3d3f8b[_0x487696(0x1af)](_0xcd9816,_0x487696(0x19d)),_0x12c2e9=a182_0x3d3f8b[_0x487696(0x1af)](_0xcd9816,_0x487696(0x1ae));try{await _0x496f37[_0x487696(0x1a2)](_0x7f3223,_0x22fc56),await a182_0x2eba10['mkdir'](_0x12c2e9,{'recursive':!![]});try{await _0x97c2fa[_0x487696(0x19b)]({'file':_0x22fc56,'cwd':_0x12c2e9,'gzip':!![]});}catch(_0x3dd485){const _0x95005=_0x3dd485 instanceof Error?_0x3dd485[_0x487696(0x1bf)]:String(_0x3dd485);if(_0x95005['includes'](_0x487696(0x1b7))||_0x95005[_0x487696(0x1ad)](_0x487696(0x190))){const _0x1cc872=await a182_0x2eba10[_0x487696(0x1a0)](_0x22fc56)[_0x487696(0x188)](()=>null),_0x4c301b=_0x1cc872?_0x487696(0x1b2)+_0x1cc872['size']+_0x487696(0x194):'';throw new SDKError(ErrorCode[_0x487696(0x1be)],_0x487696(0x1a7)+_0x4c301b+':\x20'+_0x95005,_0x3dd485,{'helpText':_0x487696(0x185)});}throw _0x3dd485;}_0x354971=await calculatePushChanges(_0x1436a0,_0x12c2e9,_0x4480a1);}finally{await a182_0x2eba10['rm'](_0xcd9816,{'recursive':!![],'force':!![]});}}else{_0x354971=[];for(const _0x339739 of _0x4480a1){const _0x384b12=a182_0x3d3f8b[_0x487696(0x1af)](_0x1436a0,_0x339739),_0x1a3883=await a182_0x2eba10[_0x487696(0x195)](_0x384b12,_0x487696(0x18b))[_0x487696(0x188)](()=>null);_0x354971['push']({'path':_0x339739,'type':'new','newContent':_0x1a3883||undefined});}}const _0x3a27f9={'new':_0x354971[_0x487696(0x19f)](_0x62c945=>_0x62c945[_0x487696(0x18e)]===_0x487696(0x1a1))[_0x487696(0x1a3)],'modified':_0x354971[_0x487696(0x19f)](_0x4afd99=>_0x4afd99[_0x487696(0x18e)]===_0x487696(0x184))[_0x487696(0x1a3)],'deleted':_0x354971['filter'](_0x41b194=>_0x41b194[_0x487696(0x18e)]===_0x487696(0x193))['length'],'unchanged':_0x354971[_0x487696(0x19f)](_0x4746a8=>_0x4746a8[_0x487696(0x18e)]==='unchanged')[_0x487696(0x1a3)]};return{'projectName':_0x1a51a7,'projectId':_0x7f3223,'revision':_0x1d110c,'sourceDir':_0x1436a0,'changes':_0x354971,'summary':_0x3a27f9,'hasChanges':_0x3a27f9['new']>0x0||_0x3a27f9[_0x487696(0x184)]>0x0||_0x3a27f9[_0x487696(0x193)]>0x0,'configResult':_0x38d743};}export async function executePushWorkflow(_0x184809,_0x357891){const _0x4a502f=a182_0xc4b1,_0xf310cb=await import('tar'),{client:_0x2925ca}=_0x184809,_0x516d31=await getProjectFiles(_0x357891[_0x4a502f(0x1b6)]),_0x54f8a0=await a182_0x2eba10[_0x4a502f(0x1bd)](a182_0x3d3f8b[_0x4a502f(0x1af)](a182_0x2b91ff[_0x4a502f(0x192)](),_0x4a502f(0x1bb))),_0x5396f1=a182_0x3d3f8b[_0x4a502f(0x1af)](_0x54f8a0,_0x4a502f(0x19d));try{await _0xf310cb[_0x4a502f(0x1ba)]({'file':_0x5396f1,'gzip':!![],'cwd':_0x357891[_0x4a502f(0x1b6)],'portable':!![]},_0x516d31);const _0x3ab124=await _0x2925ca[_0x4a502f(0x19a)](_0x357891[_0x4a502f(0x196)],_0x357891[_0x4a502f(0x19e)],_0x5396f1);return updateWorkflowTdxConfig(_0x357891[_0x4a502f(0x186)]['configPath'],{'workflow_project_id':_0x3ab124['id'],'last_pushed_revision':_0x3ab124[_0x4a502f(0x19e)],'last_pushed_at':new Date()['toISOString']()}),{'projectId':_0x3ab124['id'],'projectName':_0x3ab124[_0x4a502f(0x1b9)],'revision':_0x3ab124[_0x4a502f(0x19e)]};}finally{await a182_0x2eba10['rm'](_0x54f8a0,{'recursive':!![],'force':!![]});}}async function getProjectFiles(_0x106344,_0x44b8ed=_0x106344,_0x555a90='',_0x4fd6e9=null){const _0x1b0858=a182_0xc4b1,_0x2462bb=[];if(_0x4fd6e9===null){_0x4fd6e9=createIgnoreInstance();const _0x36ceec=await loadDigdagignore(_0x106344);_0x36ceec&&_0x4fd6e9[_0x1b0858(0x198)](_0x36ceec);}if(_0x555a90!==''){const _0x5e850b=await loadDigdagignore(_0x44b8ed);_0x5e850b&&addScopedPatterns(_0x4fd6e9,_0x5e850b,_0x555a90);}const _0x783839=await a182_0x2eba10['readdir'](_0x44b8ed,{'withFileTypes':!![]});for(const _0x3cb84c of _0x783839){const _0x119398=_0x555a90?a182_0x3d3f8b[_0x1b0858(0x1c1)][_0x1b0858(0x1af)](_0x555a90,_0x3cb84c[_0x1b0858(0x1b9)]):_0x3cb84c[_0x1b0858(0x1b9)];if(_0x3cb84c[_0x1b0858(0x1b9)]===_0x1b0858(0x18c))continue;if(_0x3cb84c[_0x1b0858(0x1b9)]===_0x1b0858(0x1b0))continue;if(!shouldIncludeInArchive(_0x3cb84c['name']))continue;if(shouldIgnoreWithInstance(_0x4fd6e9,_0x119398,_0x3cb84c['isDirectory']()))continue;if(_0x3cb84c[_0x1b0858(0x187)]()){const _0x5e438d=await getProjectFiles(_0x106344,a182_0x3d3f8b['join'](_0x44b8ed,_0x3cb84c['name']),_0x119398,_0x4fd6e9);_0x2462bb[_0x1b0858(0x183)](..._0x5e438d);}else _0x2462bb[_0x1b0858(0x183)](_0x119398);}return _0x2462bb;}function a182_0xc4b1(_0x33dd8c,_0x846c90){_0x33dd8c=_0x33dd8c-0x181;const _0x43853c=a182_0x4385();let _0xc4b1ca=_0x43853c[_0x33dd8c];return _0xc4b1ca;}async function calculatePushChanges(_0x235fe1,_0x38ef15,_0x346eb6){const _0x4e3cf4=a182_0xc4b1,_0x4fb841=[],_0xbd33c2=new Set(await getProjectFiles(_0x38ef15));for(const _0x2e6c4a of _0x346eb6){const _0x112b8b=a182_0x3d3f8b[_0x4e3cf4(0x1af)](_0x235fe1,_0x2e6c4a),_0x2f2b3c=a182_0x3d3f8b[_0x4e3cf4(0x1af)](_0x38ef15,_0x2e6c4a),_0x1854a7=await a182_0x2eba10[_0x4e3cf4(0x195)](_0x112b8b,_0x4e3cf4(0x18b))[_0x4e3cf4(0x188)](()=>null);if(_0x1854a7===null)continue;if(!_0xbd33c2[_0x4e3cf4(0x18f)](_0x2e6c4a))_0x4fb841[_0x4e3cf4(0x183)]({'path':_0x2e6c4a,'type':_0x4e3cf4(0x1a1),'newContent':_0x1854a7});else{const _0x2e5679=await a182_0x2eba10[_0x4e3cf4(0x195)](_0x2f2b3c,'utf-8')['catch'](()=>null);if(_0x2e5679===null)_0x4fb841[_0x4e3cf4(0x183)]({'path':_0x2e6c4a,'type':_0x4e3cf4(0x184),'newContent':_0x1854a7});else{if(_0x2e5679!==_0x1854a7){const _0x259dc7=generateDiff(_0x2e5679,_0x1854a7),_0x4d5f7a=hasChanges(_0x259dc7)?formatDiffWithColors(_0x259dc7):undefined;_0x4fb841[_0x4e3cf4(0x183)]({'path':_0x2e6c4a,'type':_0x4e3cf4(0x184),'oldContent':_0x2e5679,'newContent':_0x1854a7,'diff':_0x4d5f7a});}else _0x4fb841[_0x4e3cf4(0x183)]({'path':_0x2e6c4a,'type':_0x4e3cf4(0x19c)});}}}for(const _0xe41100 of _0xbd33c2){if(!_0x346eb6[_0x4e3cf4(0x1ad)](_0xe41100)){const _0x3aa16f=a182_0x3d3f8b[_0x4e3cf4(0x1af)](_0x38ef15,_0xe41100),_0x71010c=await a182_0x2eba10[_0x4e3cf4(0x195)](_0x3aa16f,'utf-8')[_0x4e3cf4(0x188)](()=>undefined);_0x4fb841[_0x4e3cf4(0x183)]({'path':_0xe41100,'type':'deleted','oldContent':_0x71010c});}}return _0x4fb841[_0x4e3cf4(0x1a5)]((_0x5c159f,_0x1ee78a)=>_0x5c159f['path'][_0x4e3cf4(0x1b3)](_0x1ee78a['path'])),_0x4fb841;}
@@ -1 +1 @@
1
- function a183_0xd4ea(){const _0x3bc4d8=['tdx.json','12031624lNCmvs','resolve','2237832nPdyfG','dirname','60QfkLfb','stringify','root','toISOString','object','workflow_project','last_pulled_revision','workflows','last_pulled_at','1724807VotEyN','parse','last_pushed_revision','188ceQLpF','utf-8','132720TDlSOn','cwd','3CAbKiI','184780iGEeEE','workflow_project_id','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field','last_pushed_at','108YzFIME','join','1412bVDLIp','string','1100212NGkiAs'];a183_0xd4ea=function(){return _0x3bc4d8;};return a183_0xd4ea();}const a183_0x4dc6a3=a183_0x23c3;(function(_0x5be143,_0x28ab1d){const _0x57bdf6=a183_0x23c3,_0xb4b85b=_0x5be143();while(!![]){try{const _0x39c66b=parseInt(_0x57bdf6(0x86))/0x1*(-parseInt(_0x57bdf6(0x9a))/0x2)+parseInt(_0x57bdf6(0x9e))/0x3*(-parseInt(_0x57bdf6(0x88))/0x4)+-parseInt(_0x57bdf6(0x9c))/0x5*(parseInt(_0x57bdf6(0x8e))/0x6)+parseInt(_0x57bdf6(0x97))/0x7+-parseInt(_0x57bdf6(0x8c))/0x8+-parseInt(_0x57bdf6(0x84))/0x9*(parseInt(_0x57bdf6(0x80))/0xa)+parseInt(_0x57bdf6(0x8a))/0xb;if(_0x39c66b===_0x28ab1d)break;else _0xb4b85b['push'](_0xb4b85b['shift']());}catch(_0x39f182){_0xb4b85b['push'](_0xb4b85b['shift']());}}}(a183_0xd4ea,0x2867b));import{existsSync,readFileSync,writeFileSync}from'fs';import a183_0x4f6535 from'path';const TDX_CONFIG_FILE=a183_0x4dc6a3(0x89),WORKFLOWS_DIR=a183_0x4dc6a3(0x95);export function findWorkflowTdxConfigPath(_0x109160=process[a183_0x4dc6a3(0x9d)]()){const _0x358443=a183_0x4dc6a3;let _0x19d1e9=a183_0x4f6535[_0x358443(0x8b)](_0x109160);const _0x958aa4=a183_0x4f6535[_0x358443(0x98)](_0x19d1e9)[_0x358443(0x90)];while(_0x19d1e9!==_0x958aa4){const _0x2897c9=a183_0x4f6535[_0x358443(0x85)](_0x19d1e9,TDX_CONFIG_FILE);if(existsSync(_0x2897c9))try{const _0x399c35=readFileSync(_0x2897c9,_0x358443(0x9b)),_0x58ee3e=JSON[_0x358443(0x98)](_0x399c35);if(_0x58ee3e&&typeof _0x58ee3e==='object'&&_0x358443(0x93)in _0x58ee3e)return _0x2897c9;}catch{}_0x19d1e9=a183_0x4f6535[_0x358443(0x8d)](_0x19d1e9);}return null;}function a183_0x23c3(_0x102d45,_0x16908f){_0x102d45=_0x102d45-0x80;const _0xd4eaab=a183_0xd4ea();let _0x23c32c=_0xd4eaab[_0x102d45];return _0x23c32c;}export function loadWorkflowTdxConfig(_0x38c8d8){const _0x1ec284=a183_0x4dc6a3,_0x2a85c3=readFileSync(_0x38c8d8,_0x1ec284(0x9b));let _0x50f6e3;try{_0x50f6e3=JSON[_0x1ec284(0x98)](_0x2a85c3);}catch{throw new Error('Invalid\x20JSON\x20in\x20'+_0x38c8d8);}if(!_0x50f6e3||typeof _0x50f6e3!==_0x1ec284(0x92))throw new Error('Invalid\x20tdx.json:\x20expected\x20object');const _0x435e78=_0x50f6e3;if(!_0x435e78['workflow_project']||typeof _0x435e78[_0x1ec284(0x93)]!==_0x1ec284(0x87))throw new Error(_0x1ec284(0x82));return{'workflow_project':_0x435e78['workflow_project'],'workflow_project_id':typeof _0x435e78[_0x1ec284(0x81)]===_0x1ec284(0x87)?_0x435e78[_0x1ec284(0x81)]:undefined,'last_pulled_revision':typeof _0x435e78[_0x1ec284(0x94)]===_0x1ec284(0x87)?_0x435e78[_0x1ec284(0x94)]:undefined,'last_pulled_at':typeof _0x435e78['last_pulled_at']===_0x1ec284(0x87)?_0x435e78[_0x1ec284(0x96)]:undefined,'last_pushed_revision':typeof _0x435e78['last_pushed_revision']===_0x1ec284(0x87)?_0x435e78[_0x1ec284(0x99)]:undefined,'last_pushed_at':typeof _0x435e78[_0x1ec284(0x83)]==='string'?_0x435e78[_0x1ec284(0x83)]:undefined};}export function findWorkflowTdxConfig(_0x1d423e=process['cwd']()){const _0x51f7fd=a183_0x4dc6a3,_0x3923b3=findWorkflowTdxConfigPath(_0x1d423e);if(!_0x3923b3)throw new Error('No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0xeab696=loadWorkflowTdxConfig(_0x3923b3),_0x3184ae=a183_0x4f6535[_0x51f7fd(0x8d)](_0x3923b3);return{'config':_0xeab696,'configPath':_0x3923b3,'configDir':_0x3184ae};}export function tryFindWorkflowTdxConfig(_0x53446a){try{return findWorkflowTdxConfig(_0x53446a);}catch{return null;}}export function getWorkflowProjectDir(_0x29c6e6,_0x55a4a8=process[a183_0x4dc6a3(0x9d)]()){const _0x291c03=a183_0x4dc6a3;return a183_0x4f6535[_0x291c03(0x85)](_0x55a4a8,WORKFLOWS_DIR,_0x29c6e6);}export function getWorkflowTdxConfigPath(_0x5ac71a,_0x23e6aa=process['cwd']()){return a183_0x4f6535['join'](getWorkflowProjectDir(_0x5ac71a,_0x23e6aa),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x5f53b5,_0x1d8043,_0x4f0042){const _0x3da544=a183_0x4dc6a3,_0x5b4cd1={'workflow_project':_0x5f53b5,..._0x1d8043&&{'workflow_project_id':_0x1d8043},..._0x4f0042&&{'last_pulled_revision':_0x4f0042},'last_pulled_at':new Date()[_0x3da544(0x91)]()};return JSON[_0x3da544(0x8f)](_0x5b4cd1,null,0x2)+'\x0a';}export function saveWorkflowTdxConfig(_0x352019,_0x452b52){const _0x37c4fc=a183_0x4dc6a3,_0x204de3=JSON[_0x37c4fc(0x8f)](_0x452b52,null,0x2)+'\x0a';writeFileSync(_0x352019,_0x204de3,_0x37c4fc(0x9b));}export function updateWorkflowTdxConfig(_0xf4cfa7,_0x2a35ff){const _0x1bfd15=loadWorkflowTdxConfig(_0xf4cfa7),_0x2de64e={..._0x1bfd15,..._0x2a35ff};saveWorkflowTdxConfig(_0xf4cfa7,_0x2de64e);}
1
+ function a183_0x2ebc(_0x14173f,_0x4b77ac){_0x14173f=_0x14173f-0xee;const _0x5cc87b=a183_0x5cc8();let _0x2ebcc3=_0x5cc87b[_0x14173f];return _0x2ebcc3;}const a183_0x295285=a183_0x2ebc;(function(_0x5940bc,_0xd511ea){const _0x3a8836=a183_0x2ebc,_0x2e5aec=_0x5940bc();while(!![]){try{const _0x464b2e=parseInt(_0x3a8836(0x101))/0x1+-parseInt(_0x3a8836(0x109))/0x2+parseInt(_0x3a8836(0xee))/0x3*(-parseInt(_0x3a8836(0x102))/0x4)+-parseInt(_0x3a8836(0xf5))/0x5+-parseInt(_0x3a8836(0xfd))/0x6*(parseInt(_0x3a8836(0x103))/0x7)+parseInt(_0x3a8836(0x108))/0x8*(parseInt(_0x3a8836(0xfc))/0x9)+parseInt(_0x3a8836(0x106))/0xa;if(_0x464b2e===_0xd511ea)break;else _0x2e5aec['push'](_0x2e5aec['shift']());}catch(_0xd29a33){_0x2e5aec['push'](_0x2e5aec['shift']());}}}(a183_0x5cc8,0x27189));import{existsSync,readFileSync,writeFileSync}from'fs';import a183_0x1d7946 from'path';const TDX_CONFIG_FILE='tdx.json',WORKFLOWS_DIR=a183_0x295285(0xf4);export function findWorkflowTdxConfigPath(_0xe9c9ef=process['cwd']()){const _0x36c9a9=a183_0x295285;let _0x28b1bd=a183_0x1d7946['resolve'](_0xe9c9ef);const _0x56a747=a183_0x1d7946[_0x36c9a9(0x107)](_0x28b1bd)[_0x36c9a9(0xf1)];while(_0x28b1bd!==_0x56a747){const _0xef19a4=a183_0x1d7946[_0x36c9a9(0xf3)](_0x28b1bd,TDX_CONFIG_FILE);if(existsSync(_0xef19a4))try{const _0x441302=readFileSync(_0xef19a4,_0x36c9a9(0x104)),_0xda1958=JSON[_0x36c9a9(0x107)](_0x441302);if(_0xda1958&&typeof _0xda1958===_0x36c9a9(0xf7)&&_0x36c9a9(0x105)in _0xda1958)return _0xef19a4;}catch{}_0x28b1bd=a183_0x1d7946[_0x36c9a9(0xff)](_0x28b1bd);}return null;}export function loadWorkflowTdxConfig(_0x6d7a1){const _0x3b7309=a183_0x295285,_0x2a12ef=readFileSync(_0x6d7a1,'utf-8');let _0x593c63;try{_0x593c63=JSON[_0x3b7309(0x107)](_0x2a12ef);}catch{throw new Error(_0x3b7309(0xfa)+_0x6d7a1);}if(!_0x593c63||typeof _0x593c63!=='object')throw new Error('Invalid\x20tdx.json:\x20expected\x20object');const _0x563cae=_0x593c63;if(!_0x563cae[_0x3b7309(0x105)]||typeof _0x563cae['workflow_project']!==_0x3b7309(0xf9))throw new Error(_0x3b7309(0x10a));return{'workflow_project':_0x563cae[_0x3b7309(0x105)],'workflow_project_id':typeof _0x563cae[_0x3b7309(0xfe)]==='string'?_0x563cae[_0x3b7309(0xfe)]:undefined,'last_pulled_revision':typeof _0x563cae[_0x3b7309(0x100)]==='string'?_0x563cae['last_pulled_revision']:undefined,'last_pulled_at':typeof _0x563cae['last_pulled_at']===_0x3b7309(0xf9)?_0x563cae[_0x3b7309(0xef)]:undefined,'last_pushed_revision':typeof _0x563cae[_0x3b7309(0xf8)]==='string'?_0x563cae[_0x3b7309(0xf8)]:undefined,'last_pushed_at':typeof _0x563cae[_0x3b7309(0xf0)]===_0x3b7309(0xf9)?_0x563cae['last_pushed_at']:undefined};}function a183_0x5cc8(){const _0x4f5ca9=['workflow_project_id','dirname','last_pulled_revision','56167hypmEC','4yatEBG','469TxVgSb','utf-8','workflow_project','7638120cWdQtc','parse','639608SWOLHF','332168MqRIHr','Invalid\x20tdx.json:\x20missing\x20or\x20invalid\x20\x27workflow_project\x27\x20field','869223HWwhRr','last_pulled_at','last_pushed_at','root','stringify','join','workflows','1584860LwLHcB','cwd','object','last_pushed_revision','string','Invalid\x20JSON\x20in\x20','toISOString','27arhBfy','11364DCNCbF'];a183_0x5cc8=function(){return _0x4f5ca9;};return a183_0x5cc8();}export function findWorkflowTdxConfig(_0x5beaf6=process[a183_0x295285(0xf6)]()){const _0x58914f=a183_0x295285,_0x406de6=findWorkflowTdxConfigPath(_0x5beaf6);if(!_0x406de6)throw new Error('No\x20workflow\x20tdx.json\x20found.\x20Please\x20run\x20\x27tdx\x20wf\x20pull\x20<project>\x27\x20first\x20to\x20create\x20the\x20folder\x20structure.');const _0xb80f82=loadWorkflowTdxConfig(_0x406de6),_0x5c9ce9=a183_0x1d7946[_0x58914f(0xff)](_0x406de6);return{'config':_0xb80f82,'configPath':_0x406de6,'configDir':_0x5c9ce9};}export function tryFindWorkflowTdxConfig(_0x836d73){try{return findWorkflowTdxConfig(_0x836d73);}catch{return null;}}export function getWorkflowProjectDir(_0x455526,_0x27ed57=process['cwd']()){return a183_0x1d7946['join'](_0x27ed57,WORKFLOWS_DIR,_0x455526);}export function getWorkflowTdxConfigPath(_0x6fb7bb,_0x44fa96=process['cwd']()){const _0x3fa2a5=a183_0x295285;return a183_0x1d7946[_0x3fa2a5(0xf3)](getWorkflowProjectDir(_0x6fb7bb,_0x44fa96),TDX_CONFIG_FILE);}export function createWorkflowTdxConfigContent(_0x22697b,_0x5e2cb2,_0x3d1412){const _0x54c9e6=a183_0x295285,_0x230f9f={'workflow_project':_0x22697b,..._0x5e2cb2&&{'workflow_project_id':_0x5e2cb2},..._0x3d1412&&{'last_pulled_revision':_0x3d1412},'last_pulled_at':new Date()[_0x54c9e6(0xfb)]()};return JSON[_0x54c9e6(0xf2)](_0x230f9f,null,0x2)+'\x0a';}export function saveWorkflowTdxConfig(_0x25db6b,_0xcf30b3){const _0x24b8c6=a183_0x295285,_0x3fee8a=JSON[_0x24b8c6(0xf2)](_0xcf30b3,null,0x2)+'\x0a';writeFileSync(_0x25db6b,_0x3fee8a,_0x24b8c6(0x104));}export function updateWorkflowTdxConfig(_0x1fae5a,_0x5a8fcc){const _0x173ee0=loadWorkflowTdxConfig(_0x1fae5a),_0x56f921={..._0x173ee0,..._0x5a8fcc};saveWorkflowTdxConfig(_0x1fae5a,_0x56f921);}
@@ -1 +1 @@
1
- const a184_0x57d1c7=a184_0x5d8e;function a184_0x2cd9(){const _0x3db35d=['1462654bWGesL','split','Thumbs.db','replace','ignores','3741pJkmRg','readFile','11146460igOJpZ','1060EtUEor','1ziwpup','startsWith','add','.dig','code','4952330EIJOtp','filter','.digdag','680VrpqvR','map','.DS_Store','length','5851986svqxDu','457992rSrBWP','.digdagignore','71113CtgIRH'];a184_0x2cd9=function(){return _0x3db35d;};return a184_0x2cd9();}(function(_0x1d9baa,_0x1afd96){const _0x18c0ba=a184_0x5d8e,_0x22423d=_0x1d9baa();while(!![]){try{const _0x3c577b=-parseInt(_0x18c0ba(0x17f))/0x1*(-parseInt(_0x18c0ba(0x176))/0x2)+-parseInt(_0x18c0ba(0x17b))/0x3*(parseInt(_0x18c0ba(0x17e))/0x4)+parseInt(_0x18c0ba(0x184))/0x5+-parseInt(_0x18c0ba(0x172))/0x6+parseInt(_0x18c0ba(0x175))/0x7*(-parseInt(_0x18c0ba(0x16e))/0x8)+parseInt(_0x18c0ba(0x173))/0x9+parseInt(_0x18c0ba(0x17d))/0xa;if(_0x3c577b===_0x1afd96)break;else _0x22423d['push'](_0x22423d['shift']());}catch(_0xecf016){_0x22423d['push'](_0x22423d['shift']());}}}(a184_0x2cd9,0xaf4ca));import{promises as a184_0x537f82}from'fs';import a184_0x24bd6f from'path';import a184_0x54ffff from'ignore';export const WORKFLOW_FILE_EXTENSION=a184_0x57d1c7(0x182);export function shouldIncludeInArchive(_0x4b7f9a){const _0x1c449d=a184_0x57d1c7;if(_0x4b7f9a===_0x1c449d(0x16d))return!![];if(_0x4b7f9a[_0x1c449d(0x180)]('.'))return![];if(_0x4b7f9a['endsWith']('~'))return![];if(_0x4b7f9a===_0x1c449d(0x178)||_0x4b7f9a===_0x1c449d(0x170))return![];return!![];}function a184_0x5d8e(_0x16de6f,_0x1564bb){_0x16de6f=_0x16de6f-0x16c;const _0x2cd984=a184_0x2cd9();let _0x5d8ee3=_0x2cd984[_0x16de6f];return _0x5d8ee3;}export function parseDigdagignore(_0xcc1451){const _0x2336ba=a184_0x57d1c7;return _0xcc1451[_0x2336ba(0x177)]('\x0a')[_0x2336ba(0x16f)](_0x383492=>_0x383492['trim']())[_0x2336ba(0x16c)](_0x3d8a16=>_0x3d8a16[_0x2336ba(0x171)]>0x0&&!_0x3d8a16[_0x2336ba(0x180)]('#'));}export async function loadDigdagignore(_0x10f3a0){const _0x517dd6=a184_0x57d1c7,_0x53a8a7=a184_0x24bd6f['join'](_0x10f3a0,_0x517dd6(0x174));try{const _0x2a9060=await a184_0x537f82[_0x517dd6(0x17c)](_0x53a8a7,'utf-8');return parseDigdagignore(_0x2a9060);}catch(_0x40faec){if(_0x40faec[_0x517dd6(0x183)]==='ENOENT')return null;throw _0x40faec;}}export function createIgnoreInstance(_0x16731d){const _0x23836e=a184_0x57d1c7,_0x210772=a184_0x54ffff();return _0x16731d&&_0x16731d[_0x23836e(0x171)]>0x0&&_0x210772[_0x23836e(0x181)](_0x16731d),_0x210772;}export function addScopedPatterns(_0x22c0a3,_0x329d57,_0x1d6c19){const _0xf1404=a184_0x57d1c7,_0x5938ec=_0x329d57[_0xf1404(0x16f)](_0x5e2ade=>{const _0x4cb2dc=_0xf1404;if(_0x5e2ade[_0x4cb2dc(0x180)]('!')){const _0x31f7fe=_0x5e2ade['slice'](0x1);if(_0x31f7fe['startsWith']('/'))return'!'+_0x1d6c19+_0x31f7fe;return'!'+_0x1d6c19+'/'+_0x31f7fe;}if(_0x5e2ade['startsWith']('/'))return''+_0x1d6c19+_0x5e2ade;return _0x1d6c19+'/'+_0x5e2ade;});return _0x22c0a3[_0xf1404(0x181)](_0x5938ec),_0x22c0a3;}export function shouldIgnoreWithInstance(_0x4a77d0,_0x5d6c0e,_0x3c5f51){const _0x55a465=a184_0x57d1c7,_0x5b7225=_0x5d6c0e[_0x55a465(0x179)](/\\/g,'/'),_0x269307=_0x3c5f51?_0x5b7225+'/':_0x5b7225;return _0x4a77d0[_0x55a465(0x17a)](_0x269307);}
1
+ const a184_0x55b496=a184_0x2718;(function(_0x13d8dd,_0xd06909){const _0x447602=a184_0x2718,_0x5f4837=_0x13d8dd();while(!![]){try{const _0x52214a=parseInt(_0x447602(0x1a2))/0x1*(-parseInt(_0x447602(0x19c))/0x2)+-parseInt(_0x447602(0x19b))/0x3+parseInt(_0x447602(0x1ac))/0x4*(-parseInt(_0x447602(0x1ad))/0x5)+parseInt(_0x447602(0x1a6))/0x6*(parseInt(_0x447602(0x19e))/0x7)+-parseInt(_0x447602(0x1a8))/0x8+-parseInt(_0x447602(0x193))/0x9*(-parseInt(_0x447602(0x198))/0xa)+parseInt(_0x447602(0x19f))/0xb;if(_0x52214a===_0xd06909)break;else _0x5f4837['push'](_0x5f4837['shift']());}catch(_0x56de52){_0x5f4837['push'](_0x5f4837['shift']());}}}(a184_0x1f48,0xe70de));import{promises as a184_0x5ee36e}from'fs';import a184_0x27916b from'path';import a184_0x4f9694 from'ignore';export const WORKFLOW_FILE_EXTENSION=a184_0x55b496(0x19a);export function shouldIncludeInArchive(_0x3cd892){const _0x40d3fe=a184_0x55b496;if(_0x3cd892===_0x40d3fe(0x199))return!![];if(_0x3cd892[_0x40d3fe(0x197)]('.'))return![];if(_0x3cd892[_0x40d3fe(0x1a5)]('~'))return![];if(_0x3cd892===_0x40d3fe(0x1a9)||_0x3cd892===_0x40d3fe(0x19d))return![];return!![];}export function parseDigdagignore(_0x54a1da){const _0x58cade=a184_0x55b496;return _0x54a1da[_0x58cade(0x1a1)]('\x0a')[_0x58cade(0x1a7)](_0x225e05=>_0x225e05[_0x58cade(0x1aa)]())['filter'](_0x2e8256=>_0x2e8256['length']>0x0&&!_0x2e8256['startsWith']('#'));}export async function loadDigdagignore(_0x38af11){const _0x855c9c=a184_0x55b496,_0x32dfe3=a184_0x27916b['join'](_0x38af11,'.digdagignore');try{const _0x2d1fd7=await a184_0x5ee36e['readFile'](_0x32dfe3,_0x855c9c(0x1a0));return parseDigdagignore(_0x2d1fd7);}catch(_0xdd595){if(_0xdd595[_0x855c9c(0x195)]===_0x855c9c(0x1a3))return null;throw _0xdd595;}}function a184_0x2718(_0x51610f,_0x157fa8){_0x51610f=_0x51610f-0x193;const _0x1f48b4=a184_0x1f48();let _0x27182d=_0x1f48b4[_0x51610f];return _0x27182d;}function a184_0x1f48(){const _0x2275d0=['startsWith','272290qwxJMz','.digdag','.dig','4491807sYRzEI','12OauVfQ','.DS_Store','56Qmexpx','31238878wdMzzV','utf-8','split','42034wFerBL','ENOENT','slice','endsWith','375942qOWlzU','map','12618320MXLPvt','Thumbs.db','trim','add','695512mSvfMg','10DcRQdJ','423UwhbfQ','ignores','code','length'];a184_0x1f48=function(){return _0x2275d0;};return a184_0x1f48();}export function createIgnoreInstance(_0x3a8fc3){const _0x17a501=a184_0x55b496,_0x1198fe=a184_0x4f9694();return _0x3a8fc3&&_0x3a8fc3[_0x17a501(0x196)]>0x0&&_0x1198fe[_0x17a501(0x1ab)](_0x3a8fc3),_0x1198fe;}export function addScopedPatterns(_0x14c79a,_0x50969c,_0x1db594){const _0x13d57e=a184_0x55b496,_0x460724=_0x50969c[_0x13d57e(0x1a7)](_0x1d813b=>{const _0xbfe78d=_0x13d57e;if(_0x1d813b[_0xbfe78d(0x197)]('!')){const _0x4a1297=_0x1d813b[_0xbfe78d(0x1a4)](0x1);if(_0x4a1297['startsWith']('/'))return'!'+_0x1db594+_0x4a1297;return'!'+_0x1db594+'/'+_0x4a1297;}if(_0x1d813b[_0xbfe78d(0x197)]('/'))return''+_0x1db594+_0x1d813b;return _0x1db594+'/'+_0x1d813b;});return _0x14c79a[_0x13d57e(0x1ab)](_0x460724),_0x14c79a;}export function shouldIgnoreWithInstance(_0x2f8d15,_0x1018e8,_0x4fa94c){const _0xa489b4=a184_0x55b496,_0x3715c0=_0x1018e8['replace'](/\\/g,'/'),_0x5be29f=_0x4fa94c?_0x3715c0+'/':_0x3715c0;return _0x2f8d15[_0xa489b4(0x194)](_0x5be29f);}
@@ -1 +1 @@
1
- const a185_0x3cc82d=a185_0x40be;function a185_0x40be(_0x548688,_0x1b47d4){_0x548688=_0x548688-0xed;const _0x49e6c1=a185_0x49e6();let _0x40be32=_0x49e6c1[_0x548688];return _0x40be32;}(function(_0x5bfab0,_0x1f552f){const _0x37848f=a185_0x40be,_0x9afeba=_0x5bfab0();while(!![]){try{const _0x248101=parseInt(_0x37848f(0xfe))/0x1+-parseInt(_0x37848f(0xfb))/0x2*(-parseInt(_0x37848f(0xf2))/0x3)+parseInt(_0x37848f(0x109))/0x4*(-parseInt(_0x37848f(0xf7))/0x5)+parseInt(_0x37848f(0xef))/0x6*(-parseInt(_0x37848f(0x104))/0x7)+-parseInt(_0x37848f(0xff))/0x8+-parseInt(_0x37848f(0x10a))/0x9+parseInt(_0x37848f(0xfa))/0xa;if(_0x248101===_0x1f552f)break;else _0x9afeba['push'](_0x9afeba['shift']());}catch(_0x2e1e99){_0x9afeba['push'](_0x9afeba['shift']());}}}(a185_0x49e6,0x344cb));import{TDX,LogLevel}from'../sdk/index.js';import{createHTTPMock}from'./http-mock.js';import{createTestGlobalOptions}from'./factories.js';export class CommandRunner{[a185_0x3cc82d(0x10b)];[a185_0x3cc82d(0xee)];constructor(){const _0x24ae21=a185_0x3cc82d;this[_0x24ae21(0x10b)]=createHTTPMock(),this['originalFetch']=global[_0x24ae21(0xfc)];}['setup'](){const _0x58f97d=a185_0x3cc82d;this[_0x58f97d(0xee)]=global[_0x58f97d(0xfc)],global['fetch']=this[_0x58f97d(0x10b)][_0x58f97d(0x106)]();}[a185_0x3cc82d(0xf9)](_0x38e1bd){const _0x77f149=a185_0x3cc82d;try{_0x38e1bd?.[_0x77f149(0xf6)]&&this['http'][_0x77f149(0xf4)](_0x38e1bd);}finally{global[_0x77f149(0xfc)]=this[_0x77f149(0xee)],this[_0x77f149(0x10b)][_0x77f149(0xf0)]();}}async['run'](_0x50176b,_0x4c520d={}){const _0x5c0340=a185_0x3cc82d,_0x4d6c96=[],_0x5b2868=[],_0x3bdaf8=console['log'],_0x502077=console[_0x5c0340(0x102)],_0xd2d148=console[_0x5c0340(0x100)];console[_0x5c0340(0xf8)]=(..._0x14f6f1)=>{const _0xb3f065=_0x5c0340;_0x4d6c96[_0xb3f065(0x101)](_0x14f6f1[_0xb3f065(0xfd)](String)[_0xb3f065(0x105)]('\x20'));},console[_0x5c0340(0x102)]=(..._0x590788)=>{const _0x550d1d=_0x5c0340;_0x5b2868[_0x550d1d(0x101)](_0x590788[_0x550d1d(0xfd)](String)[_0x550d1d(0x105)]('\x20'));},console[_0x5c0340(0x100)]=(..._0x471da9)=>{const _0xfb5dfe=_0x5c0340;_0x5b2868[_0xfb5dfe(0x101)](_0x471da9[_0xfb5dfe(0xfd)](String)['join']('\x20'));};try{const _0x4f6d13=new TDX({'site':_0x4c520d['options']?.[_0x5c0340(0x103)]??_0x5c0340(0xf1),'apiKey':_0x5c0340(0x108),'logLevel':LogLevel['ERROR']}),_0x37ac34={'options':createTestGlobalOptions(_0x4c520d[_0x5c0340(0xed)]),'args':_0x4c520d[_0x5c0340(0xf3)]??[],'tdx':_0x4f6d13},_0x54c25e=new _0x50176b(),_0x5b42c3=await _0x54c25e['run'](_0x37ac34);return{'exitCode':_0x5b42c3,'stdout':_0x4d6c96,'stderr':_0x5b2868};}finally{console['log']=_0x3bdaf8,console[_0x5c0340(0x102)]=_0x502077,console[_0x5c0340(0x100)]=_0xd2d148;}}async[a185_0x3cc82d(0xf5)](_0x4fbcbb){const _0x1644ca=a185_0x3cc82d,_0x5efa34=[];for(const {command:_0x3b9d69,options:_0x831cbe}of _0x4fbcbb){const _0xbcdfec=await this[_0x1644ca(0x107)](_0x3b9d69,_0x831cbe);_0x5efa34['push'](_0xbcdfec);if(_0xbcdfec['exitCode']!==0x0)break;}return _0x5efa34;}}function a185_0x49e6(){const _0x479357=['168138DjnDZj','1694064VVQujS','warn','push','error','site','63PiwPav','join','createFetch','run','test-api-key-id/test-api-key-secret','4erOBtS','1844424BLXOhN','http','options','originalFetch','71796wsWQYY','reset','us01','9ysrFqB','args','verify','runSequence','fail','210495AotHrh','log','teardown','4146970YnnREc','131914JKmFCX','fetch','map'];a185_0x49e6=function(){return _0x479357;};return a185_0x49e6();}export function createCommandRunner(){return new CommandRunner();}
1
+ function a185_0xcf80(_0x3a6fb3,_0x4295d7){_0x3a6fb3=_0x3a6fb3-0x9a;const _0x4907e0=a185_0x4907();let _0xcf80f3=_0x4907e0[_0x3a6fb3];return _0xcf80f3;}const a185_0x19bf88=a185_0xcf80;(function(_0xf5a91c,_0x1397d8){const _0x72b502=a185_0xcf80,_0x1c6188=_0xf5a91c();while(!![]){try{const _0x13abd1=parseInt(_0x72b502(0xb5))/0x1+parseInt(_0x72b502(0xb1))/0x2+parseInt(_0x72b502(0xb7))/0x3*(-parseInt(_0x72b502(0xb6))/0x4)+parseInt(_0x72b502(0x9c))/0x5+parseInt(_0x72b502(0xb0))/0x6+-parseInt(_0x72b502(0xa2))/0x7*(parseInt(_0x72b502(0x9f))/0x8)+parseInt(_0x72b502(0x9d))/0x9*(parseInt(_0x72b502(0xa1))/0xa);if(_0x13abd1===_0x1397d8)break;else _0x1c6188['push'](_0x1c6188['shift']());}catch(_0x18418f){_0x1c6188['push'](_0x1c6188['shift']());}}}(a185_0x4907,0x749fc));import{TDX,LogLevel}from'../sdk/index.js';import{createHTTPMock}from'./http-mock.js';import{createTestGlobalOptions}from'./factories.js';export class CommandRunner{[a185_0x19bf88(0xa7)];[a185_0x19bf88(0xb3)];constructor(){const _0x49e432=a185_0x19bf88;this[_0x49e432(0xa7)]=createHTTPMock(),this[_0x49e432(0xb3)]=global[_0x49e432(0xac)];}[a185_0x19bf88(0x9a)](){const _0x29fe84=a185_0x19bf88;this[_0x29fe84(0xb3)]=global['fetch'],global[_0x29fe84(0xac)]=this['http']['createFetch']();}['teardown'](_0x2c3f50){const _0x4b842c=a185_0x19bf88;try{_0x2c3f50?.[_0x4b842c(0xa5)]&&this[_0x4b842c(0xa7)][_0x4b842c(0xaf)](_0x2c3f50);}finally{global[_0x4b842c(0xac)]=this[_0x4b842c(0xb3)],this[_0x4b842c(0xa7)][_0x4b842c(0xab)]();}}async['run'](_0x3f5221,_0x4f87f9={}){const _0x8dc1db=a185_0x19bf88,_0x3d4c5c=[],_0x5a7fa1=[],_0x3f9dfa=console[_0x8dc1db(0xa0)],_0x3006d5=console['error'],_0x2940db=console[_0x8dc1db(0xa9)];console['log']=(..._0x3dcba1)=>{const _0x2c289d=_0x8dc1db;_0x3d4c5c['push'](_0x3dcba1['map'](String)[_0x2c289d(0xaa)]('\x20'));},console[_0x8dc1db(0xb2)]=(..._0x3c3599)=>{const _0x2a3431=_0x8dc1db;_0x5a7fa1[_0x2a3431(0xa8)](_0x3c3599[_0x2a3431(0xa4)](String)[_0x2a3431(0xaa)]('\x20'));},console[_0x8dc1db(0xa9)]=(..._0x30582d)=>{const _0x391342=_0x8dc1db;_0x5a7fa1[_0x391342(0xa8)](_0x30582d['map'](String)[_0x391342(0xaa)]('\x20'));};try{const _0x418fcb=new TDX({'site':_0x4f87f9[_0x8dc1db(0xb4)]?.['site']??'us01','apiKey':_0x8dc1db(0xad),'logLevel':LogLevel[_0x8dc1db(0x9b)]}),_0x16765e={'options':createTestGlobalOptions(_0x4f87f9[_0x8dc1db(0xb4)]),'args':_0x4f87f9[_0x8dc1db(0xae)]??[],'tdx':_0x418fcb},_0x3f2e10=new _0x3f5221(),_0xfab0ca=await _0x3f2e10[_0x8dc1db(0xa3)](_0x16765e);return{'exitCode':_0xfab0ca,'stdout':_0x3d4c5c,'stderr':_0x5a7fa1};}finally{console[_0x8dc1db(0xa0)]=_0x3f9dfa,console[_0x8dc1db(0xb2)]=_0x3006d5,console[_0x8dc1db(0xa9)]=_0x2940db;}}async[a185_0x19bf88(0x9e)](_0x1a6e5a){const _0x5e276e=a185_0x19bf88,_0x9093c4=[];for(const {command:_0x5a5b36,options:_0x4c3165}of _0x1a6e5a){const _0x54624b=await this['run'](_0x5a5b36,_0x4c3165);_0x9093c4[_0x5e276e(0xa8)](_0x54624b);if(_0x54624b[_0x5e276e(0xa6)]!==0x0)break;}return _0x9093c4;}}export function createCommandRunner(){return new CommandRunner();}function a185_0x4907(){const _0x526dd0=['7890ngUggT','758114bAwvOy','run','map','fail','exitCode','http','push','warn','join','reset','fetch','test-api-key-id/test-api-key-secret','args','verify','2175174TaQued','813832QBoUvo','error','originalFetch','options','192499WLNtWA','14228RCWdVN','369MxLAuW','setup','ERROR','2240280ldgEeg','4239UfNeZT','runSequence','64ltoPDB','log'];a185_0x4907=function(){return _0x526dd0;};return a185_0x4907();}