@treasuredata/tdx 2026.7.0 → 2026.7.1

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 (229) 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/cas-command.js +1 -1
  11. package/dist/commands/cas-segment-command.js +1 -1
  12. package/dist/commands/chat-command.js +1 -1
  13. package/dist/commands/claude-command.js +1 -1
  14. package/dist/commands/claude-statusline-command.js +1 -1
  15. package/dist/commands/claude-usage-command.js +1 -1
  16. package/dist/commands/command.js +1 -1
  17. package/dist/commands/connection-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/delivery-command.js +1 -1
  20. package/dist/commands/describe.js +1 -1
  21. package/dist/commands/engage-campaign-pull-command.js +1 -1
  22. package/dist/commands/engage-campaign-push-command.js +1 -1
  23. package/dist/commands/engage-campaign-validate-command.js +1 -1
  24. package/dist/commands/engage-command.js +1 -1
  25. package/dist/commands/engage-template-pull-command.js +1 -1
  26. package/dist/commands/engage-template-push-command.js +1 -1
  27. package/dist/commands/engage-template-validate-command.js +1 -1
  28. package/dist/commands/job-command.js +1 -1
  29. package/dist/commands/journey-command.js +1 -1
  30. package/dist/commands/journey-validate-command.js +1 -1
  31. package/dist/commands/llm-command.js +1 -1
  32. package/dist/commands/mcp-command.js +1 -1
  33. package/dist/commands/parent-segment-command.js +1 -1
  34. package/dist/commands/policy-command.js +1 -1
  35. package/dist/commands/profile-command.js +1 -1
  36. package/dist/commands/profiles-command.js +1 -1
  37. package/dist/commands/query-command.js +1 -1
  38. package/dist/commands/schedule-command.js +1 -1
  39. package/dist/commands/segment-command.js +1 -1
  40. package/dist/commands/segment-create-command.js +1 -1
  41. package/dist/commands/segment-fields-command.js +1 -1
  42. package/dist/commands/segment-move-command.js +1 -1
  43. package/dist/commands/segment-pull-command.js +1 -1
  44. package/dist/commands/segment-push-command.js +1 -1
  45. package/dist/commands/segment-update-command.js +1 -1
  46. package/dist/commands/segment-use-command.js +1 -1
  47. package/dist/commands/segment-validate-command.js +1 -1
  48. package/dist/commands/segments.js +1 -1
  49. package/dist/commands/show.js +1 -1
  50. package/dist/commands/status-command.js +1 -1
  51. package/dist/commands/table-deleted.js +1 -1
  52. package/dist/commands/tables.js +1 -1
  53. package/dist/commands/unset-command.js +1 -1
  54. package/dist/commands/upgrade-command.js +1 -1
  55. package/dist/commands/use-command.js +1 -1
  56. package/dist/commands/user-command.js +1 -1
  57. package/dist/commands/work-command.js +1 -1
  58. package/dist/commands/workflow-command.js +1 -1
  59. package/dist/core/auth.js +1 -1
  60. package/dist/core/command-output.js +1 -1
  61. package/dist/core/config.js +1 -1
  62. package/dist/core/connection-cache.js +1 -1
  63. package/dist/core/constants.js +1 -1
  64. package/dist/core/credential-cache.js +1 -1
  65. package/dist/core/global-context.js +1 -1
  66. package/dist/core/keychain.js +1 -1
  67. package/dist/core/oauth-keychain.js +1 -1
  68. package/dist/core/oauth.js +1 -1
  69. package/dist/core/profile.js +1 -1
  70. package/dist/core/project-config.js +1 -1
  71. package/dist/core/session.js +1 -1
  72. package/dist/core/user-cache.js +1 -1
  73. package/dist/core/version.js +1 -1
  74. package/dist/index.js +1 -1
  75. package/dist/mcp/server.js +1 -1
  76. package/dist/mcp/tools/index.js +1 -1
  77. package/dist/mcp/tools/tdx-run.js +1 -1
  78. package/dist/mcp/tools/tdx-search.js +1 -1
  79. package/dist/mcp/tools/work-create-item.js +1 -1
  80. package/dist/mcp/utils.js +1 -1
  81. package/dist/proxy/claude-usage-tracker.js +1 -1
  82. package/dist/proxy/passthrough-server.js +1 -1
  83. package/dist/proxy/sse-usage-parser.js +1 -1
  84. package/dist/sdk/agent/agent-config.js +1 -1
  85. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  86. package/dist/sdk/agent/agent-yaml.js +1 -1
  87. package/dist/sdk/agent/test/evaluator.js +1 -1
  88. package/dist/sdk/agent/test/executor.js +1 -1
  89. package/dist/sdk/agent/test/index.js +1 -1
  90. package/dist/sdk/agent/test/output.js +1 -1
  91. package/dist/sdk/agent/test/parser.js +1 -1
  92. package/dist/sdk/agent/tool-target-registry.js +1 -1
  93. package/dist/sdk/api.js +1 -1
  94. package/dist/sdk/cas/cas-api-client.js +1 -1
  95. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  96. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  97. package/dist/sdk/cas/index.js +1 -1
  98. package/dist/sdk/cas/pull-workflow.js +1 -1
  99. package/dist/sdk/cas/push-workflow.js +1 -1
  100. package/dist/sdk/client/cdp-api-client.js +1 -1
  101. package/dist/sdk/client/delivery-api-client.js +1 -1
  102. package/dist/sdk/client/endpoints.js +1 -1
  103. package/dist/sdk/client/engage-api-client.js +1 -1
  104. package/dist/sdk/client/http-client.d.ts +1 -0
  105. package/dist/sdk/client/http-client.d.ts.map +1 -1
  106. package/dist/sdk/client/http-client.js +1 -1
  107. package/dist/sdk/client/http-client.js.map +1 -1
  108. package/dist/sdk/client/llm-api-client.js +1 -1
  109. package/dist/sdk/client/oauth-refresh.js +1 -1
  110. package/dist/sdk/client/rate-limiter.js +1 -1
  111. package/dist/sdk/client/td-api-client.js +1 -1
  112. package/dist/sdk/client/trino-api-client.js +1 -1
  113. package/dist/sdk/client/workflow-client.js +1 -1
  114. package/dist/sdk/connection-validator.js +1 -1
  115. package/dist/sdk/connection.js +1 -1
  116. package/dist/sdk/delivery.js +1 -1
  117. package/dist/sdk/engage/campaign-pull.js +1 -1
  118. package/dist/sdk/engage/campaign-push.js +1 -1
  119. package/dist/sdk/engage/campaign-validator.js +1 -1
  120. package/dist/sdk/engage/campaign-yaml.js +1 -1
  121. package/dist/sdk/engage/template-pull.js +1 -1
  122. package/dist/sdk/engage/template-push.js +1 -1
  123. package/dist/sdk/engage/template-validator.js +1 -1
  124. package/dist/sdk/engage/template-yaml.js +1 -1
  125. package/dist/sdk/engage/types/campaign-def.js +1 -1
  126. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  127. package/dist/sdk/engage/types/template-schema.js +1 -1
  128. package/dist/sdk/engage.js +1 -1
  129. package/dist/sdk/errors.js +1 -1
  130. package/dist/sdk/index.js +1 -1
  131. package/dist/sdk/io/index.js +1 -1
  132. package/dist/sdk/io/node-filesystem.js +1 -1
  133. package/dist/sdk/job.js +1 -1
  134. package/dist/sdk/journey.js +1 -1
  135. package/dist/sdk/llm/chat-cache.js +1 -1
  136. package/dist/sdk/llm/index.js +1 -1
  137. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  138. package/dist/sdk/llm/model-factors.js +1 -1
  139. package/dist/sdk/llm/user-settings.js +1 -1
  140. package/dist/sdk/personalization.js +1 -1
  141. package/dist/sdk/policy.js +1 -1
  142. package/dist/sdk/query/deleted-table-validation.js +1 -1
  143. package/dist/sdk/query/index.js +1 -1
  144. package/dist/sdk/query/sql-parser.js +1 -1
  145. package/dist/sdk/realtime.js +1 -1
  146. package/dist/sdk/schedule.js +1 -1
  147. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  148. package/dist/sdk/segment/fields-display.js +1 -1
  149. package/dist/sdk/segment/file-discovery.js +1 -1
  150. package/dist/sdk/segment/journey-utils.js +1 -1
  151. package/dist/sdk/segment/journey-validator.js +1 -1
  152. package/dist/sdk/segment/journey-yaml.js +1 -1
  153. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  154. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  155. package/dist/sdk/segment/pull-workflow.js +1 -1
  156. package/dist/sdk/segment/push-recovery.js +1 -1
  157. package/dist/sdk/segment/push-workflow.js +1 -1
  158. package/dist/sdk/segment/resolution-context.js +1 -1
  159. package/dist/sdk/segment/segment-path-parser.js +1 -1
  160. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  161. package/dist/sdk/segment/segment-validator.js +1 -1
  162. package/dist/sdk/segment/target-resolution.js +1 -1
  163. package/dist/sdk/segment/tdx-config.js +1 -1
  164. package/dist/sdk/segment/types/activation-schema.js +1 -1
  165. package/dist/sdk/segment/types/journey-def.js +1 -1
  166. package/dist/sdk/segment/types/journey-schema.js +1 -1
  167. package/dist/sdk/segment/types/segment-def.js +1 -1
  168. package/dist/sdk/segment/types/segment-schema.js +1 -1
  169. package/dist/sdk/segment/validate-files.js +1 -1
  170. package/dist/sdk/segment/yaml-validator.js +1 -1
  171. package/dist/sdk/segment.js +1 -1
  172. package/dist/sdk/types/index.js +1 -1
  173. package/dist/sdk/types/progress.js +1 -1
  174. package/dist/sdk/types/workspace.js +1 -1
  175. package/dist/sdk/user.js +1 -1
  176. package/dist/sdk/util/format-detector.js +1 -1
  177. package/dist/sdk/util/formatters.js +1 -1
  178. package/dist/sdk/util/index.js +1 -1
  179. package/dist/sdk/util/paginate.js +1 -1
  180. package/dist/sdk/util/tree-formatter.js +1 -1
  181. package/dist/sdk/util/tree-search.js +1 -1
  182. package/dist/sdk/workflow/archive-validation.js +1 -1
  183. package/dist/sdk/workflow/clone-workflow.js +1 -1
  184. package/dist/sdk/workflow/index.js +1 -1
  185. package/dist/sdk/workflow/pull-workflow.js +1 -1
  186. package/dist/sdk/workflow/push-workflow.js +1 -1
  187. package/dist/sdk/workflow/task-graph.js +1 -1
  188. package/dist/sdk/workflow/tdx-config.js +1 -1
  189. package/dist/sdk/workflow/workflow-utils.js +1 -1
  190. package/dist/sdk/workspace/access-tracker.js +1 -1
  191. package/dist/sdk/workspace/frontmatter.js +1 -1
  192. package/dist/sdk/workspace/git.js +1 -1
  193. package/dist/sdk/workspace/index.js +1 -1
  194. package/dist/sdk/workspace/templates.js +1 -1
  195. package/dist/sdk/workspace/weekly.js +1 -1
  196. package/dist/sdk/workspace/wikilinks.js +1 -1
  197. package/dist/test-utils/command-runner.js +1 -1
  198. package/dist/test-utils/factories.js +1 -1
  199. package/dist/test-utils/fixtures.js +1 -1
  200. package/dist/test-utils/http-mock.js +1 -1
  201. package/dist/test-utils/index.js +1 -1
  202. package/dist/utils/async.js +1 -1
  203. package/dist/utils/colors.js +1 -1
  204. package/dist/utils/diff.js +1 -1
  205. package/dist/utils/file-permissions.js +1 -1
  206. package/dist/utils/file-reader.js +1 -1
  207. package/dist/utils/github-releases.js +1 -1
  208. package/dist/utils/global-cache.js +1 -1
  209. package/dist/utils/json-loader.js +1 -1
  210. package/dist/utils/local-cache.js +1 -1
  211. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  212. package/dist/utils/logger/formatters/index.js +1 -1
  213. package/dist/utils/logger/handlers/console-handler.js +1 -1
  214. package/dist/utils/logger/handlers/file-handler.js +1 -1
  215. package/dist/utils/logger/handlers/index.js +1 -1
  216. package/dist/utils/logger/handlers/null-handler.js +1 -1
  217. package/dist/utils/logger/index.js +1 -1
  218. package/dist/utils/logger/logger.js +1 -1
  219. package/dist/utils/logger/types.js +1 -1
  220. package/dist/utils/option-validation.js +1 -1
  221. package/dist/utils/process.js +1 -1
  222. package/dist/utils/prompt.js +1 -1
  223. package/dist/utils/spinner.js +1 -1
  224. package/dist/utils/sse-parser.js +1 -1
  225. package/dist/utils/string-utils.js +1 -1
  226. package/dist/utils/table-ref-parser.js +1 -1
  227. package/dist/utils/tdx-logger.js +1 -1
  228. package/dist/utils/version-check.js +1 -1
  229. package/package.json +1 -1
@@ -1 +1 @@
1
- function a153_0x4537(_0x554bb4,_0x315d55){_0x554bb4=_0x554bb4-0xbe;const _0x2d0d10=a153_0x2d0d();let _0x453756=_0x2d0d10[_0x554bb4];return _0x453756;}(function(_0x59d19f,_0xac0c27){const _0x4317bb=a153_0x4537,_0x6a1163=_0x59d19f();while(!![]){try{const _0x3232a8=parseInt(_0x4317bb(0xbe))/0x1*(parseInt(_0x4317bb(0xee))/0x2)+parseInt(_0x4317bb(0xe7))/0x3*(-parseInt(_0x4317bb(0xd1))/0x4)+parseInt(_0x4317bb(0xe3))/0x5+-parseInt(_0x4317bb(0x12a))/0x6*(parseInt(_0x4317bb(0x116))/0x7)+-parseInt(_0x4317bb(0xf7))/0x8+parseInt(_0x4317bb(0x118))/0x9*(parseInt(_0x4317bb(0xeb))/0xa)+-parseInt(_0x4317bb(0xfe))/0xb*(parseInt(_0x4317bb(0x108))/0xc);if(_0x3232a8===_0xac0c27)break;else _0x6a1163['push'](_0x6a1163['shift']());}catch(_0x14961d){_0x6a1163['push'](_0x6a1163['shift']());}}}(a153_0x2d0d,0x456b5));import*as a153_0x2bf8d0 from'yaml';function formatScheduleTime(_0x23beb2){const _0x498e7e=a153_0x4537;if(typeof _0x23beb2===_0x498e7e(0x117)){const _0x1d01e4=Math[_0x498e7e(0xcb)](_0x23beb2);return String(_0x1d01e4)[_0x498e7e(0xdc)](0x2,'0')+':00:00';}if(typeof _0x23beb2===_0x498e7e(0xf9)){if(/^\d{2}:\d{2}:\d{2}$/['test'](_0x23beb2))return _0x23beb2;if(/^\d{1,2}:\d{2}$/[_0x498e7e(0x119)](_0x23beb2)){const [_0x35d7a5,_0x132cec]=_0x23beb2[_0x498e7e(0xf0)](':');return _0x35d7a5[_0x498e7e(0xdc)](0x2,'0')+':'+_0x132cec+_0x498e7e(0xc5);}const _0x404a57=parseInt(_0x23beb2,0xa);if(!isNaN(_0x404a57)&&_0x23beb2[_0x498e7e(0xc7)](/^\d+$/))return String(_0x404a57)[_0x498e7e(0xdc)](0x2,'0')+_0x498e7e(0x105);return _0x23beb2;}return String(_0x23beb2);}export function apiToDef(_0x380bde){const _0x1ec1b2=a153_0x4537,_0x5097b6={'database':_0x380bde[_0x1ec1b2(0xc0)]?.[_0x1ec1b2(0xd4)]||'','table':_0x380bde['master']?.[_0x1ec1b2(0x109)]||''};_0x380bde['audienceFilters']&&_0x380bde[_0x1ec1b2(0xec)]['length']>0x0&&(_0x5097b6[_0x1ec1b2(0xd7)]=_0x380bde['audienceFilters'][_0x1ec1b2(0x106)](_0x5a0692=>({'column':_0x5a0692[_0x1ec1b2(0xc3)],'values':_0x5a0692['rightValues']})));let _0x5704a5;_0x380bde[_0x1ec1b2(0xd8)]&&_0x380bde[_0x1ec1b2(0xd8)]!==_0x1ec1b2(0xe4)&&(_0x5704a5={'type':_0x380bde[_0x1ec1b2(0xd8)]},_0x380bde[_0x1ec1b2(0xe1)]&&(_0x5704a5[_0x1ec1b2(0xd9)]=formatScheduleTime(_0x380bde[_0x1ec1b2(0xe1)])),_0x380bde[_0x1ec1b2(0xbf)]&&(_0x5704a5[_0x1ec1b2(0xbf)]=_0x380bde[_0x1ec1b2(0xbf)]));let _0x5d620b;(_0x380bde[_0x1ec1b2(0xd3)]||_0x380bde['hivePoolName']||_0x380bde[_0x1ec1b2(0x10c)])&&(_0x5d620b={},_0x380bde[_0x1ec1b2(0xd3)]&&(_0x5d620b[_0x1ec1b2(0xf2)]=_0x380bde[_0x1ec1b2(0xd3)]),_0x380bde[_0x1ec1b2(0xca)]&&(_0x5d620b['hive_pool']=_0x380bde[_0x1ec1b2(0xca)]),_0x380bde[_0x1ec1b2(0x10c)]&&(_0x5d620b[_0x1ec1b2(0x111)]=_0x380bde[_0x1ec1b2(0x10c)]));const _0x2d58dd=_0x380bde[_0x1ec1b2(0xd6)]&&_0x380bde[_0x1ec1b2(0xd6)][_0x1ec1b2(0xd2)]>0x0?groupAttributesBySource(_0x380bde[_0x1ec1b2(0xd6)]):undefined,_0x5f4250=_0x380bde[_0x1ec1b2(0x103)]&&_0x380bde['behaviors']['length']>0x0?_0x380bde[_0x1ec1b2(0x103)][_0x1ec1b2(0x106)](convertApiBehaviorToYaml):undefined;let _0x359d5a;_0x380bde[_0x1ec1b2(0x10d)]&&(_0x359d5a={'name':_0x380bde['customerGroup'][_0x1ec1b2(0x115)],'source':{'database':_0x380bde[_0x1ec1b2(0x10d)][_0x1ec1b2(0xd4)],'table':_0x380bde[_0x1ec1b2(0x10d)]['parentTableName']},'join':{'parent_key':_0x380bde[_0x1ec1b2(0x10d)][_0x1ec1b2(0xde)],'child_key':_0x380bde[_0x1ec1b2(0x10d)][_0x1ec1b2(0xfd)]}},_0x380bde['customerGroup'][_0x1ec1b2(0xc9)]&&_0x380bde[_0x1ec1b2(0x10d)][_0x1ec1b2(0xc9)][_0x1ec1b2(0xd2)]>0x0&&(_0x359d5a[_0x1ec1b2(0xd6)]=groupAttributesBySource(_0x380bde[_0x1ec1b2(0x10d)][_0x1ec1b2(0xc9)])),_0x380bde[_0x1ec1b2(0x10d)][_0x1ec1b2(0xc4)]&&_0x380bde['customerGroup'][_0x1ec1b2(0xc4)][_0x1ec1b2(0xd2)]>0x0&&(_0x359d5a[_0x1ec1b2(0x103)]=_0x380bde[_0x1ec1b2(0x10d)][_0x1ec1b2(0xc4)][_0x1ec1b2(0x106)](convertApiBehaviorToYaml)));const _0x1edef9={'name':_0x380bde[_0x1ec1b2(0x115)],..._0x380bde['description']&&{'description':_0x380bde[_0x1ec1b2(0x10e)]},'master':_0x5097b6,..._0x5704a5&&{'schedule':_0x5704a5},..._0x5d620b&&{'engine':_0x5d620b},..._0x2d58dd&&{'attributes':_0x2d58dd},..._0x5f4250&&{'behaviors':_0x5f4250},..._0x359d5a&&{'customer_group':_0x359d5a}};return _0x1edef9;}function groupAttributesBySource(_0x130eec){const _0x3afcec=a153_0x4537,_0x47b898=new Map();for(const _0x16d714 of _0x130eec){const _0x72e0a8=_0x16d714['parentDatabaseName']+'.'+_0x16d714['parentTableName']+'.'+_0x16d714['parentKey']+'.'+_0x16d714[_0x3afcec(0xde)];!_0x47b898[_0x3afcec(0xdf)](_0x72e0a8)&&_0x47b898[_0x3afcec(0xed)](_0x72e0a8,[]),_0x47b898[_0x3afcec(0xf6)](_0x72e0a8)['push'](_0x16d714);}const _0xa0a5a1=[];for(const [,_0x42c35c]of _0x47b898){const _0x48c568=_0x42c35c[0x0],_0xaf751c=_0x48c568['groupingName']||_0x48c568[_0x3afcec(0x109)];_0xa0a5a1[_0x3afcec(0x11d)]({'name':_0xaf751c,'source':{'database':_0x48c568[_0x3afcec(0xd4)],'table':_0x48c568[_0x3afcec(0x109)]},'join':{'parent_key':_0x48c568[_0x3afcec(0xde)],'child_key':_0x48c568[_0x3afcec(0xfd)]},'columns':_0x42c35c[_0x3afcec(0x106)](_0x245aff=>{const _0x4bc6fd=_0x3afcec,_0x291dd1={'column':_0x245aff[_0x4bc6fd(0x120)],'type':_0x245aff['type']};return _0x245aff['name']!==_0x245aff[_0x4bc6fd(0x120)]&&(_0x291dd1['label']=_0x245aff[_0x4bc6fd(0x115)]),_0x291dd1;})});}return _0xa0a5a1;}function convertApiBehaviorToYaml(_0x3457c1){const _0x4dd506=a153_0x4537,_0x46a367={'name':_0x3457c1[_0x4dd506(0x115)],'source':{'database':_0x3457c1[_0x4dd506(0xd4)],'table':_0x3457c1[_0x4dd506(0x109)]},'join':{'parent_key':_0x3457c1[_0x4dd506(0xde)],'child_key':_0x3457c1[_0x4dd506(0xfd)]}};if(_0x3457c1[_0x4dd506(0xe6)])_0x46a367['all_columns']=!![];else _0x3457c1[_0x4dd506(0xdb)]&&_0x3457c1[_0x4dd506(0xdb)][_0x4dd506(0xd2)]>0x0&&(_0x46a367[_0x4dd506(0xc8)]=_0x3457c1[_0x4dd506(0xdb)][_0x4dd506(0x106)](_0x2a321e=>{const _0x4bb4c5=_0x4dd506,_0x3c6e71={'column':_0x2a321e[_0x4bb4c5(0x120)],'type':_0x2a321e[_0x4bb4c5(0x114)]};return _0x2a321e[_0x4bb4c5(0x115)]!==_0x2a321e[_0x4bb4c5(0x120)]&&(_0x3c6e71[_0x4bb4c5(0x11c)]=_0x2a321e[_0x4bb4c5(0x115)]),_0x3c6e71;}));return _0x3457c1[_0x4dd506(0x104)]&&(_0x46a367[_0x4dd506(0x11e)]=_0x3457c1[_0x4dd506(0x104)]),_0x3457c1['isRealtime']&&(_0x46a367['realtime']=_0x3457c1['isRealtime']),_0x46a367;}function a153_0x2d0d(){const _0x232b99=['padStart','schedule:','foreignKey','has','all_columns','scheduleOption','realtime','1526010bUtoIJ','none','source','allColumns','287673CRHgik','YAML\x20config\x20missing\x20required\x20field:\x20master.database','values','behaviors:','6790OtFQmc','audienceFilters','set','565406cuuZDS','personalization_services:','split','personalization_services\x20must\x20be\x20an\x20array','hive_only','column','includes','YAML\x20config\x20missing\x20required\x20field:\x20master.table','get','3897480AJsiQA','database','string','realtime:','counter','attributes:','parentKey','143iwgyti','realtime.attributes[','isRealtime','column_name','parent_key','behaviors','defaultTimeFilterEnabled',':00:00','map','YAML\x20config\x20missing\x20required\x20field:\x20master','43992NdBcAg','parentTableName','UTC','customer_id','prestoPoolName','customerGroup','description','isArray','attribute_table','trino_pool','Display\x20Name','hive_pool','type','name','8799QXhIDH','number','7119QhBnvA','test','join','realtime.events[','label','push','default_time_filter','customer_group','parentColumn','master:','single','forEach',']:\x20Missing\x20required\x20field\x20\x27name\x27','Example\x20Attributes','):\x20Invalid\x20type\x20\x27','parse','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','Example\x20Events','1002IcZzZw',']\x20(','1OgwwsR','timezone','master','child_key','table','columnName','customerGroupBehaviors',':00','engine','match','columns','customerGroupAttributes','hivePoolName','floor','schedule','03:00','personalization_services','stringify','events','4HLSvEZ','length','workflowHiveOnly','parentDatabaseName','Parent\x20segment\x20description','attributes','filters','scheduleType','time','user_id','schema'];a153_0x2d0d=function(){return _0x232b99;};return a153_0x2d0d();}export function defToApi(_0x150489){const _0x1bed5f=a153_0x4537,_0x2d5402={'name':_0x150489[_0x1bed5f(0x115)],'master':{'parentDatabaseName':_0x150489[_0x1bed5f(0xc0)][_0x1bed5f(0xf8)],'parentTableName':_0x150489['master'][_0x1bed5f(0xc2)]}};_0x150489['description']&&(_0x2d5402[_0x1bed5f(0x10e)]=_0x150489[_0x1bed5f(0x10e)]);_0x150489[_0x1bed5f(0xc0)][_0x1bed5f(0xd7)]&&_0x150489[_0x1bed5f(0xc0)]['filters'][_0x1bed5f(0xd2)]>0x0&&(_0x2d5402[_0x1bed5f(0xec)]=_0x150489[_0x1bed5f(0xc0)][_0x1bed5f(0xd7)][_0x1bed5f(0x106)](_0x3763c3=>({'columnName':_0x3763c3['column'],'rightValues':_0x3763c3[_0x1bed5f(0xe9)]})));_0x150489[_0x1bed5f(0xcc)]&&(_0x2d5402[_0x1bed5f(0xd8)]=_0x150489[_0x1bed5f(0xcc)][_0x1bed5f(0x114)],_0x150489[_0x1bed5f(0xcc)]['time']&&(_0x2d5402[_0x1bed5f(0xe1)]=_0x150489[_0x1bed5f(0xcc)]['time']),_0x150489[_0x1bed5f(0xcc)][_0x1bed5f(0xbf)]&&(_0x2d5402['timezone']=_0x150489[_0x1bed5f(0xcc)]['timezone']));_0x150489['engine']&&(_0x150489['engine'][_0x1bed5f(0xf2)]!==undefined&&(_0x2d5402[_0x1bed5f(0xd3)]=_0x150489[_0x1bed5f(0xc6)][_0x1bed5f(0xf2)]),_0x150489[_0x1bed5f(0xc6)][_0x1bed5f(0x113)]!==undefined&&(_0x2d5402[_0x1bed5f(0xca)]=_0x150489[_0x1bed5f(0xc6)]['hive_pool']),_0x150489[_0x1bed5f(0xc6)][_0x1bed5f(0x111)]!==undefined&&(_0x2d5402[_0x1bed5f(0x10c)]=_0x150489['engine'][_0x1bed5f(0x111)]));_0x150489['attributes']&&_0x150489[_0x1bed5f(0xd6)][_0x1bed5f(0xd2)]>0x0&&(_0x2d5402[_0x1bed5f(0xd6)]=flattenAttributeGroups(_0x150489[_0x1bed5f(0xd6)]));_0x150489[_0x1bed5f(0x103)]&&_0x150489[_0x1bed5f(0x103)][_0x1bed5f(0xd2)]>0x0&&(_0x2d5402[_0x1bed5f(0x103)]=_0x150489['behaviors'][_0x1bed5f(0x106)](convertDefBehaviorToApi));if(_0x150489[_0x1bed5f(0x11f)]){const _0x23bd88=_0x150489[_0x1bed5f(0x11f)];_0x2d5402['customerGroup']={'name':_0x23bd88[_0x1bed5f(0x115)],'parentDatabaseName':_0x23bd88[_0x1bed5f(0xe5)]['database'],'parentTableName':_0x23bd88['source']['table'],'parentKey':_0x23bd88[_0x1bed5f(0x11a)][_0x1bed5f(0xc1)],'foreignKey':_0x23bd88[_0x1bed5f(0x11a)][_0x1bed5f(0x102)]},_0x23bd88[_0x1bed5f(0xd6)]&&_0x23bd88[_0x1bed5f(0xd6)][_0x1bed5f(0xd2)]>0x0&&(_0x2d5402[_0x1bed5f(0x10d)][_0x1bed5f(0xc9)]=flattenAttributeGroups(_0x23bd88[_0x1bed5f(0xd6)])[_0x1bed5f(0x106)](_0x800649=>({'name':_0x800649['name'],'type':_0x800649[_0x1bed5f(0x114)],'parentDatabaseName':_0x800649[_0x1bed5f(0xd4)],'parentTableName':_0x800649[_0x1bed5f(0x109)],'parentColumn':_0x800649[_0x1bed5f(0x120)],'parentKey':_0x800649[_0x1bed5f(0xfd)],'foreignKey':_0x800649['foreignKey']}))),_0x23bd88[_0x1bed5f(0x103)]&&_0x23bd88[_0x1bed5f(0x103)][_0x1bed5f(0xd2)]>0x0&&(_0x2d5402['customerGroup'][_0x1bed5f(0xc4)]=_0x23bd88['behaviors'][_0x1bed5f(0x106)](_0x4edd89=>({'name':_0x4edd89[_0x1bed5f(0x115)],'parentDatabaseName':_0x4edd89['source'][_0x1bed5f(0xf8)],'parentTableName':_0x4edd89[_0x1bed5f(0xe5)][_0x1bed5f(0xc2)],'parentKey':_0x4edd89[_0x1bed5f(0x11a)][_0x1bed5f(0xc1)],'foreignKey':_0x4edd89[_0x1bed5f(0x11a)][_0x1bed5f(0x102)],'allColumns':_0x4edd89['all_columns'],'schema':_0x4edd89[_0x1bed5f(0xc8)]?.['map'](_0x17f618=>({'name':_0x17f618[_0x1bed5f(0x11c)]||_0x17f618['column'],'type':_0x17f618[_0x1bed5f(0x114)],'parentColumn':_0x17f618['column']}))})));}return _0x2d5402;}function flattenAttributeGroups(_0xc686e7){const _0x5969ed=a153_0x4537,_0x344253=[];for(const _0x2653be of _0xc686e7){for(const _0x3b4831 of _0x2653be[_0x5969ed(0xc8)]){_0x344253[_0x5969ed(0x11d)]({'name':_0x3b4831['label']||_0x3b4831[_0x5969ed(0xf3)],'type':_0x3b4831['type'],'parentDatabaseName':_0x2653be[_0x5969ed(0xe5)][_0x5969ed(0xf8)],'parentTableName':_0x2653be[_0x5969ed(0xe5)][_0x5969ed(0xc2)],'parentColumn':_0x3b4831[_0x5969ed(0xf3)],'parentKey':_0x2653be['join'][_0x5969ed(0xc1)],'foreignKey':_0x2653be[_0x5969ed(0x11a)][_0x5969ed(0x102)],'groupingName':_0x2653be[_0x5969ed(0x115)]});}}return _0x344253;}function convertDefBehaviorToApi(_0x3e4336){const _0x4f842c=a153_0x4537,_0x525eb9={'name':_0x3e4336['name'],'parentDatabaseName':_0x3e4336[_0x4f842c(0xe5)][_0x4f842c(0xf8)],'parentTableName':_0x3e4336['source']['table'],'parentKey':_0x3e4336[_0x4f842c(0x11a)]['child_key'],'foreignKey':_0x3e4336[_0x4f842c(0x11a)][_0x4f842c(0x102)]};if(_0x3e4336[_0x4f842c(0xe0)])_0x525eb9[_0x4f842c(0xe6)]=!![];else _0x3e4336[_0x4f842c(0xc8)]&&_0x3e4336[_0x4f842c(0xc8)][_0x4f842c(0xd2)]>0x0&&(_0x525eb9[_0x4f842c(0xdb)]=_0x3e4336[_0x4f842c(0xc8)][_0x4f842c(0x106)](_0xd60425=>({'name':_0xd60425[_0x4f842c(0x11c)]||_0xd60425['column'],'type':_0xd60425['type'],'parentColumn':_0xd60425[_0x4f842c(0xf3)]})));return _0x3e4336[_0x4f842c(0x11e)]!==undefined&&(_0x525eb9[_0x4f842c(0x104)]=_0x3e4336[_0x4f842c(0x11e)]),_0x3e4336['realtime']!==undefined&&(_0x525eb9[_0x4f842c(0x100)]=_0x3e4336[_0x4f842c(0xe2)]),_0x525eb9;}export function serializeDef(_0x4e4a14){const _0x57486b=a153_0x4537,_0x455cd4=JSON[_0x57486b(0x127)](JSON[_0x57486b(0xcf)](_0x4e4a14)),_0x34611e=a153_0x2bf8d0[_0x57486b(0xcf)](_0x455cd4,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x483093=[_0x57486b(0x121),_0x57486b(0xdd),'engine:',_0x57486b(0xfc),_0x57486b(0xea),'customer_group:',_0x57486b(0xfa),_0x57486b(0xef)];let _0x1cc25f=_0x34611e;for(const _0x3bb4bc of _0x483093){_0x1cc25f=_0x1cc25f['replace'](new RegExp('^('+_0x3bb4bc+')','m'),(_0x510dfa,_0x1b89c8,_0x454b07)=>{if(_0x454b07===0x0||_0x1cc25f[_0x454b07-0x1]==='\x0a'&&_0x1cc25f[_0x454b07-0x2]==='\x0a')return _0x1b89c8;return'\x0a'+_0x1b89c8;});}return _0x1cc25f;}export function parseDef(_0x37a5d7){const _0x5118e5=a153_0x4537,_0x399f6e=a153_0x2bf8d0['parse'](_0x37a5d7);if(!_0x399f6e[_0x5118e5(0x115)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x399f6e[_0x5118e5(0xc0)])throw new Error(_0x5118e5(0x107));if(!_0x399f6e[_0x5118e5(0xc0)][_0x5118e5(0xf8)])throw new Error(_0x5118e5(0xe8));if(!_0x399f6e[_0x5118e5(0xc0)][_0x5118e5(0xc2)])throw new Error(_0x5118e5(0xf5));return _0x399f6e[_0x5118e5(0xe2)]&&validateRealtimeSection(_0x399f6e[_0x5118e5(0xe2)]),_0x399f6e[_0x5118e5(0xce)]&&validatePersonalizationServices(_0x399f6e[_0x5118e5(0xce)]),_0x399f6e;}function validateRealtimeSection(_0x4aedc4){const _0x5659e8=a153_0x4537,_0x11c0c7=[_0x5659e8(0x122),_0x5659e8(0xfb),_0x5659e8(0xed),'ordered_set','list','imported_batch'];_0x4aedc4[_0x5659e8(0xd0)]&&Array[_0x5659e8(0x10f)](_0x4aedc4['events'])&&_0x4aedc4[_0x5659e8(0xd0)][_0x5659e8(0x123)]((_0x51b157,_0x421b96)=>{const _0x28d173=_0x5659e8;if(!_0x51b157['name'])throw new Error(_0x28d173(0x11b)+_0x421b96+_0x28d173(0x124));});_0x4aedc4[_0x5659e8(0xd6)]&&Array[_0x5659e8(0x10f)](_0x4aedc4[_0x5659e8(0xd6)])&&_0x4aedc4['attributes'][_0x5659e8(0x123)]((_0x369585,_0x1b4e81)=>{const _0x3ab703=_0x5659e8;if(!_0x369585[_0x3ab703(0x115)])throw new Error(_0x3ab703(0xff)+_0x1b4e81+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x369585[_0x3ab703(0x114)]&&!_0x11c0c7[_0x3ab703(0xf4)](_0x369585[_0x3ab703(0x114)]))throw new Error(_0x3ab703(0xff)+_0x1b4e81+_0x3ab703(0x12b)+_0x369585[_0x3ab703(0x115)]+_0x3ab703(0x126)+_0x369585[_0x3ab703(0x114)]+'\x27.\x20Must\x20be\x20one\x20of:\x20'+_0x11c0c7[_0x3ab703(0x11a)](',\x20'));});if(_0x4aedc4['id_stitching']){if(!_0x4aedc4['id_stitching']['primary_key'])throw new Error(_0x5659e8(0x128));}}function validatePersonalizationServices(_0xf25b49){const _0x38ccd7=a153_0x4537;if(!Array[_0x38ccd7(0x10f)](_0xf25b49))throw new Error(_0x38ccd7(0xf1));_0xf25b49[_0x38ccd7(0x123)]((_0x2ff818,_0x36d775)=>{const _0x182b8b=_0x38ccd7;if(!_0x2ff818['name'])throw new Error('personalization_services['+_0x36d775+_0x182b8b(0x124));});}export function generateTemplate(_0x2a8de0,_0x250f22,_0x1d3dbb){const _0x4603e4=a153_0x4537,_0x21ced4={'name':_0x2a8de0,'description':_0x4603e4(0xd5),'master':{'database':_0x250f22,'table':_0x1d3dbb},'schedule':{'type':'daily','time':_0x4603e4(0xcd),'timezone':_0x4603e4(0x10a)},'attributes':[{'name':_0x4603e4(0x125),'source':{'database':_0x250f22,'table':_0x4603e4(0x110)},'join':{'parent_key':'id','child_key':_0x4603e4(0x10b)},'columns':[{'column':_0x4603e4(0x101),'label':_0x4603e4(0x112),'type':_0x4603e4(0xf9)}]}],'behaviors':[{'name':_0x4603e4(0x129),'source':{'database':_0x250f22,'table':'events_table'},'join':{'parent_key':_0x4603e4(0xda),'child_key':'customer_id'},'all_columns':!![]}]};return serializeDef(_0x21ced4);}
1
+ (function(_0x8abb97,_0x5e8816){const _0x48972f=a153_0x51db,_0x45dd20=_0x8abb97();while(!![]){try{const _0x2ab31c=parseInt(_0x48972f(0x1f8))/0x1*(-parseInt(_0x48972f(0x21e))/0x2)+-parseInt(_0x48972f(0x1fc))/0x3*(parseInt(_0x48972f(0x205))/0x4)+-parseInt(_0x48972f(0x202))/0x5*(-parseInt(_0x48972f(0x21b))/0x6)+parseInt(_0x48972f(0x1e5))/0x7*(parseInt(_0x48972f(0x22b))/0x8)+-parseInt(_0x48972f(0x1f2))/0x9+parseInt(_0x48972f(0x24c))/0xa+parseInt(_0x48972f(0x207))/0xb;if(_0x2ab31c===_0x5e8816)break;else _0x45dd20['push'](_0x45dd20['shift']());}catch(_0x2da7fa){_0x45dd20['push'](_0x45dd20['shift']());}}}(a153_0x1d35,0x68487));import*as a153_0x3d1c35 from'yaml';function formatScheduleTime(_0x394563){const _0x594042=a153_0x51db;if(typeof _0x394563===_0x594042(0x20f)){const _0x1db4b9=Math[_0x594042(0x244)](_0x394563);return String(_0x1db4b9)['padStart'](0x2,'0')+_0x594042(0x23a);}if(typeof _0x394563===_0x594042(0x1fb)){if(/^\d{2}:\d{2}:\d{2}$/[_0x594042(0x210)](_0x394563))return _0x394563;if(/^\d{1,2}:\d{2}$/[_0x594042(0x210)](_0x394563)){const [_0x361f88,_0x439e2e]=_0x394563[_0x594042(0x24b)](':');return _0x361f88['padStart'](0x2,'0')+':'+_0x439e2e+_0x594042(0x239);}const _0xa97723=parseInt(_0x394563,0xa);if(!isNaN(_0xa97723)&&_0x394563[_0x594042(0x211)](/^\d+$/))return String(_0xa97723)['padStart'](0x2,'0')+_0x594042(0x23a);return _0x394563;}return String(_0x394563);}export function apiToDef(_0x792c75){const _0x457d62=a153_0x51db,_0x440188={'database':_0x792c75[_0x457d62(0x22a)]?.[_0x457d62(0x242)]||'','table':_0x792c75['master']?.['parentTableName']||''};_0x792c75[_0x457d62(0x235)]&&_0x792c75['audienceFilters'][_0x457d62(0x238)]>0x0&&(_0x440188['filters']=_0x792c75[_0x457d62(0x235)][_0x457d62(0x1e8)](_0x399831=>({'column':_0x399831[_0x457d62(0x248)],'values':_0x399831[_0x457d62(0x221)]})));let _0x9c5639;_0x792c75[_0x457d62(0x20b)]&&_0x792c75['scheduleType']!==_0x457d62(0x22c)&&(_0x9c5639={'type':_0x792c75[_0x457d62(0x20b)]},_0x792c75[_0x457d62(0x1e6)]&&(_0x9c5639[_0x457d62(0x223)]=formatScheduleTime(_0x792c75[_0x457d62(0x1e6)])),_0x792c75[_0x457d62(0x240)]&&(_0x9c5639['timezone']=_0x792c75[_0x457d62(0x240)]));let _0x24ef84;(_0x792c75[_0x457d62(0x216)]||_0x792c75[_0x457d62(0x206)]||_0x792c75['prestoPoolName'])&&(_0x24ef84={},_0x792c75[_0x457d62(0x216)]&&(_0x24ef84[_0x457d62(0x1ff)]=_0x792c75[_0x457d62(0x216)]),_0x792c75['hivePoolName']&&(_0x24ef84['hive_pool']=_0x792c75[_0x457d62(0x206)]),_0x792c75[_0x457d62(0x1ef)]&&(_0x24ef84['trino_pool']=_0x792c75['prestoPoolName']));const _0x13418f=_0x792c75[_0x457d62(0x234)]&&_0x792c75[_0x457d62(0x234)][_0x457d62(0x238)]>0x0?groupAttributesBySource(_0x792c75['attributes']):undefined,_0xe6beb8=_0x792c75[_0x457d62(0x227)]&&_0x792c75[_0x457d62(0x227)][_0x457d62(0x238)]>0x0?_0x792c75[_0x457d62(0x227)]['map'](convertApiBehaviorToYaml):undefined;let _0x2f6513;_0x792c75[_0x457d62(0x1fe)]&&(_0x2f6513={'name':_0x792c75['customerGroup']['name'],'source':{'database':_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x242)],'table':_0x792c75[_0x457d62(0x1fe)]['parentTableName']},'join':{'parent_key':_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x1f0)],'child_key':_0x792c75[_0x457d62(0x1fe)]['parentKey']}},_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x219)]&&_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x219)]['length']>0x0&&(_0x2f6513[_0x457d62(0x234)]=groupAttributesBySource(_0x792c75['customerGroup'][_0x457d62(0x219)])),_0x792c75['customerGroup']['customerGroupBehaviors']&&_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x1e2)][_0x457d62(0x238)]>0x0&&(_0x2f6513[_0x457d62(0x227)]=_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x1e2)]['map'](convertApiBehaviorToYaml)));const _0x2434b0={'name':_0x792c75['name'],..._0x792c75['description']&&{'description':_0x792c75['description']},'master':_0x440188,..._0x9c5639&&{'schedule':_0x9c5639},..._0x24ef84&&{'engine':_0x24ef84},..._0x13418f&&{'attributes':_0x13418f},..._0xe6beb8&&{'behaviors':_0xe6beb8},..._0x2f6513&&{'customer_group':_0x2f6513}};return _0x2434b0;}function groupAttributesBySource(_0x154c2f){const _0x4d7d4c=a153_0x51db,_0x388f4b=new Map();for(const _0x2587a9 of _0x154c2f){const _0x3ecbbe=_0x2587a9['parentDatabaseName']+'.'+_0x2587a9['parentTableName']+'.'+_0x2587a9[_0x4d7d4c(0x20e)]+'.'+_0x2587a9[_0x4d7d4c(0x1f0)];!_0x388f4b[_0x4d7d4c(0x1e3)](_0x3ecbbe)&&_0x388f4b[_0x4d7d4c(0x23c)](_0x3ecbbe,[]),_0x388f4b[_0x4d7d4c(0x1ee)](_0x3ecbbe)[_0x4d7d4c(0x200)](_0x2587a9);}const _0x4bb1c3=[];for(const [,_0x48e004]of _0x388f4b){const _0x2fff96=_0x48e004[0x0],_0xc0bcb5=_0x2fff96[_0x4d7d4c(0x218)]||_0x2fff96[_0x4d7d4c(0x1ec)];_0x4bb1c3[_0x4d7d4c(0x200)]({'name':_0xc0bcb5,'source':{'database':_0x2fff96[_0x4d7d4c(0x242)],'table':_0x2fff96[_0x4d7d4c(0x1ec)]},'join':{'parent_key':_0x2fff96[_0x4d7d4c(0x1f0)],'child_key':_0x2fff96[_0x4d7d4c(0x20e)]},'columns':_0x48e004[_0x4d7d4c(0x1e8)](_0xfe1eb1=>{const _0x550084=_0x4d7d4c,_0x2b64ad={'column':_0xfe1eb1[_0x550084(0x20a)],'type':_0xfe1eb1[_0x550084(0x236)]};return _0xfe1eb1[_0x550084(0x228)]!==_0xfe1eb1[_0x550084(0x20a)]&&(_0x2b64ad[_0x550084(0x220)]=_0xfe1eb1[_0x550084(0x228)]),_0x2b64ad;})});}return _0x4bb1c3;}function convertApiBehaviorToYaml(_0x4754a6){const _0x2f035f=a153_0x51db,_0x2de2f3={'name':_0x4754a6['name'],'source':{'database':_0x4754a6[_0x2f035f(0x242)],'table':_0x4754a6[_0x2f035f(0x1ec)]},'join':{'parent_key':_0x4754a6[_0x2f035f(0x1f0)],'child_key':_0x4754a6[_0x2f035f(0x20e)]}};if(_0x4754a6['allColumns'])_0x2de2f3[_0x2f035f(0x230)]=!![];else _0x4754a6[_0x2f035f(0x1fd)]&&_0x4754a6[_0x2f035f(0x1fd)][_0x2f035f(0x238)]>0x0&&(_0x2de2f3[_0x2f035f(0x21d)]=_0x4754a6[_0x2f035f(0x1fd)][_0x2f035f(0x1e8)](_0x3cb408=>{const _0x49f3ae=_0x2f035f,_0x515a3e={'column':_0x3cb408['parentColumn'],'type':_0x3cb408[_0x49f3ae(0x236)]};return _0x3cb408['name']!==_0x3cb408[_0x49f3ae(0x20a)]&&(_0x515a3e[_0x49f3ae(0x220)]=_0x3cb408['name']),_0x515a3e;}));return _0x4754a6[_0x2f035f(0x20d)]&&(_0x2de2f3[_0x2f035f(0x215)]=_0x4754a6['defaultTimeFilterEnabled']),_0x4754a6[_0x2f035f(0x1fa)]&&(_0x2de2f3[_0x2f035f(0x22e)]=_0x4754a6[_0x2f035f(0x1fa)]),_0x2de2f3;}function a153_0x1d35(){const _0x158872=['column_name',']:\x20Missing\x20required\x20field\x20\x27name\x27','child_key','behaviors','name','YAML\x20config\x20missing\x20required\x20field:\x20name','master','8uPmrKv','none','parse','realtime','forEach','all_columns','values','customer_id','attributes:','attributes','audienceFilters','type','03:00','length',':00',':00:00','column','set','UTC','realtime.attributes[','id_stitching','timezone','engine:','parentDatabaseName','\x27.\x20Must\x20be\x20one\x20of:\x20','floor','includes','description','hive_pool','columnName','filters','events','split','6948020usihgF','customerGroupBehaviors','has','isArray','1903643jnvKOR','scheduleOption','trino_pool','map','YAML\x20config\x20missing\x20required\x20field:\x20master','Example\x20Events','parent_key','parentTableName','stringify','get','prestoPoolName','foreignKey',']\x20(','6565311leumUK','attribute_table','primary_key','source','personalization_services','table','80147RTLiRs','engine','isRealtime','string','288dTfccB','schema','customerGroup','hive_only','push','list','610XcFHUP','imported_batch','Parent\x20segment\x20description','8144fcZObB','hivePoolName','1542211cPSbws','schedule','daily','parentColumn','scheduleType','customer_group','defaultTimeFilterEnabled','parentKey','number','test','match','join','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','realtime.events[','default_time_filter','workflowHiveOnly','allColumns','groupingName','customerGroupAttributes','customer_group:','27822GuQvcd','Display\x20Name','columns','8lCsShL','Example\x20Attributes','label','rightValues','database','time'];a153_0x1d35=function(){return _0x158872;};return a153_0x1d35();}export function defToApi(_0x392cbd){const _0x2972a5=a153_0x51db,_0x18f966={'name':_0x392cbd[_0x2972a5(0x228)],'master':{'parentDatabaseName':_0x392cbd[_0x2972a5(0x22a)]['database'],'parentTableName':_0x392cbd[_0x2972a5(0x22a)][_0x2972a5(0x1f7)]}};_0x392cbd[_0x2972a5(0x246)]&&(_0x18f966[_0x2972a5(0x246)]=_0x392cbd[_0x2972a5(0x246)]);_0x392cbd[_0x2972a5(0x22a)]['filters']&&_0x392cbd['master'][_0x2972a5(0x249)][_0x2972a5(0x238)]>0x0&&(_0x18f966[_0x2972a5(0x235)]=_0x392cbd[_0x2972a5(0x22a)]['filters'][_0x2972a5(0x1e8)](_0x9d0e83=>({'columnName':_0x9d0e83[_0x2972a5(0x23b)],'rightValues':_0x9d0e83[_0x2972a5(0x231)]})));_0x392cbd[_0x2972a5(0x208)]&&(_0x18f966[_0x2972a5(0x20b)]=_0x392cbd[_0x2972a5(0x208)][_0x2972a5(0x236)],_0x392cbd[_0x2972a5(0x208)][_0x2972a5(0x223)]&&(_0x18f966[_0x2972a5(0x1e6)]=_0x392cbd[_0x2972a5(0x208)][_0x2972a5(0x223)]),_0x392cbd['schedule']['timezone']&&(_0x18f966[_0x2972a5(0x240)]=_0x392cbd['schedule']['timezone']));_0x392cbd[_0x2972a5(0x1f9)]&&(_0x392cbd['engine'][_0x2972a5(0x1ff)]!==undefined&&(_0x18f966[_0x2972a5(0x216)]=_0x392cbd['engine'][_0x2972a5(0x1ff)]),_0x392cbd[_0x2972a5(0x1f9)][_0x2972a5(0x247)]!==undefined&&(_0x18f966[_0x2972a5(0x206)]=_0x392cbd['engine'][_0x2972a5(0x247)]),_0x392cbd[_0x2972a5(0x1f9)][_0x2972a5(0x1e7)]!==undefined&&(_0x18f966[_0x2972a5(0x1ef)]=_0x392cbd[_0x2972a5(0x1f9)][_0x2972a5(0x1e7)]));_0x392cbd['attributes']&&_0x392cbd['attributes'][_0x2972a5(0x238)]>0x0&&(_0x18f966[_0x2972a5(0x234)]=flattenAttributeGroups(_0x392cbd[_0x2972a5(0x234)]));_0x392cbd[_0x2972a5(0x227)]&&_0x392cbd[_0x2972a5(0x227)]['length']>0x0&&(_0x18f966['behaviors']=_0x392cbd[_0x2972a5(0x227)][_0x2972a5(0x1e8)](convertDefBehaviorToApi));if(_0x392cbd[_0x2972a5(0x20c)]){const _0x256c18=_0x392cbd[_0x2972a5(0x20c)];_0x18f966[_0x2972a5(0x1fe)]={'name':_0x256c18[_0x2972a5(0x228)],'parentDatabaseName':_0x256c18[_0x2972a5(0x1f5)][_0x2972a5(0x222)],'parentTableName':_0x256c18['source']['table'],'parentKey':_0x256c18[_0x2972a5(0x212)][_0x2972a5(0x226)],'foreignKey':_0x256c18[_0x2972a5(0x212)][_0x2972a5(0x1eb)]},_0x256c18[_0x2972a5(0x234)]&&_0x256c18['attributes']['length']>0x0&&(_0x18f966[_0x2972a5(0x1fe)]['customerGroupAttributes']=flattenAttributeGroups(_0x256c18[_0x2972a5(0x234)])[_0x2972a5(0x1e8)](_0x6f73b5=>({'name':_0x6f73b5[_0x2972a5(0x228)],'type':_0x6f73b5[_0x2972a5(0x236)],'parentDatabaseName':_0x6f73b5[_0x2972a5(0x242)],'parentTableName':_0x6f73b5['parentTableName'],'parentColumn':_0x6f73b5[_0x2972a5(0x20a)],'parentKey':_0x6f73b5[_0x2972a5(0x20e)],'foreignKey':_0x6f73b5[_0x2972a5(0x1f0)]}))),_0x256c18[_0x2972a5(0x227)]&&_0x256c18['behaviors']['length']>0x0&&(_0x18f966[_0x2972a5(0x1fe)][_0x2972a5(0x1e2)]=_0x256c18[_0x2972a5(0x227)][_0x2972a5(0x1e8)](_0x8417dc=>({'name':_0x8417dc[_0x2972a5(0x228)],'parentDatabaseName':_0x8417dc[_0x2972a5(0x1f5)]['database'],'parentTableName':_0x8417dc[_0x2972a5(0x1f5)][_0x2972a5(0x1f7)],'parentKey':_0x8417dc['join'][_0x2972a5(0x226)],'foreignKey':_0x8417dc['join'][_0x2972a5(0x1eb)],'allColumns':_0x8417dc[_0x2972a5(0x230)],'schema':_0x8417dc[_0x2972a5(0x21d)]?.[_0x2972a5(0x1e8)](_0xe75f73=>({'name':_0xe75f73['label']||_0xe75f73[_0x2972a5(0x23b)],'type':_0xe75f73[_0x2972a5(0x236)],'parentColumn':_0xe75f73[_0x2972a5(0x23b)]}))})));}return _0x18f966;}function flattenAttributeGroups(_0x439b6a){const _0x206d6e=a153_0x51db,_0xf4acd7=[];for(const _0x24536c of _0x439b6a){for(const _0x4720e7 of _0x24536c[_0x206d6e(0x21d)]){_0xf4acd7[_0x206d6e(0x200)]({'name':_0x4720e7[_0x206d6e(0x220)]||_0x4720e7[_0x206d6e(0x23b)],'type':_0x4720e7[_0x206d6e(0x236)],'parentDatabaseName':_0x24536c[_0x206d6e(0x1f5)]['database'],'parentTableName':_0x24536c[_0x206d6e(0x1f5)][_0x206d6e(0x1f7)],'parentColumn':_0x4720e7[_0x206d6e(0x23b)],'parentKey':_0x24536c[_0x206d6e(0x212)][_0x206d6e(0x226)],'foreignKey':_0x24536c[_0x206d6e(0x212)]['parent_key'],'groupingName':_0x24536c['name']});}}return _0xf4acd7;}function convertDefBehaviorToApi(_0x44fb41){const _0x383479=a153_0x51db,_0x45cb14={'name':_0x44fb41[_0x383479(0x228)],'parentDatabaseName':_0x44fb41['source'][_0x383479(0x222)],'parentTableName':_0x44fb41[_0x383479(0x1f5)]['table'],'parentKey':_0x44fb41[_0x383479(0x212)][_0x383479(0x226)],'foreignKey':_0x44fb41['join'][_0x383479(0x1eb)]};if(_0x44fb41['all_columns'])_0x45cb14[_0x383479(0x217)]=!![];else _0x44fb41['columns']&&_0x44fb41[_0x383479(0x21d)][_0x383479(0x238)]>0x0&&(_0x45cb14[_0x383479(0x1fd)]=_0x44fb41['columns'][_0x383479(0x1e8)](_0x516f75=>({'name':_0x516f75[_0x383479(0x220)]||_0x516f75[_0x383479(0x23b)],'type':_0x516f75[_0x383479(0x236)],'parentColumn':_0x516f75[_0x383479(0x23b)]})));return _0x44fb41[_0x383479(0x215)]!==undefined&&(_0x45cb14[_0x383479(0x20d)]=_0x44fb41[_0x383479(0x215)]),_0x44fb41['realtime']!==undefined&&(_0x45cb14[_0x383479(0x1fa)]=_0x44fb41[_0x383479(0x22e)]),_0x45cb14;}export function serializeDef(_0x2aa2fe){const _0x1d2c81=a153_0x51db,_0x24d14b=JSON[_0x1d2c81(0x22d)](JSON['stringify'](_0x2aa2fe)),_0x3bca7f=a153_0x3d1c35[_0x1d2c81(0x1ed)](_0x24d14b,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x29fa25=['master:','schedule:',_0x1d2c81(0x241),_0x1d2c81(0x233),'behaviors:',_0x1d2c81(0x21a),'realtime:','personalization_services:'];let _0x464026=_0x3bca7f;for(const _0x46fed9 of _0x29fa25){_0x464026=_0x464026['replace'](new RegExp('^('+_0x46fed9+')','m'),(_0x5b2dfa,_0x338d70,_0x27eb98)=>{if(_0x27eb98===0x0||_0x464026[_0x27eb98-0x1]==='\x0a'&&_0x464026[_0x27eb98-0x2]==='\x0a')return _0x338d70;return'\x0a'+_0x338d70;});}return _0x464026;}export function parseDef(_0x216684){const _0x28580f=a153_0x51db,_0x126ce0=a153_0x3d1c35[_0x28580f(0x22d)](_0x216684);if(!_0x126ce0[_0x28580f(0x228)])throw new Error(_0x28580f(0x229));if(!_0x126ce0[_0x28580f(0x22a)])throw new Error(_0x28580f(0x1e9));if(!_0x126ce0[_0x28580f(0x22a)][_0x28580f(0x222)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x126ce0[_0x28580f(0x22a)][_0x28580f(0x1f7)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.table');return _0x126ce0[_0x28580f(0x22e)]&&validateRealtimeSection(_0x126ce0['realtime']),_0x126ce0[_0x28580f(0x1f6)]&&validatePersonalizationServices(_0x126ce0[_0x28580f(0x1f6)]),_0x126ce0;}function validateRealtimeSection(_0x138a0f){const _0x4f23f1=a153_0x51db,_0x4fe3fd=['single','counter',_0x4f23f1(0x23c),'ordered_set',_0x4f23f1(0x201),_0x4f23f1(0x203)];_0x138a0f[_0x4f23f1(0x24a)]&&Array[_0x4f23f1(0x1e4)](_0x138a0f['events'])&&_0x138a0f[_0x4f23f1(0x24a)][_0x4f23f1(0x22f)]((_0x1c6ce3,_0x11b81f)=>{const _0x44f838=_0x4f23f1;if(!_0x1c6ce3[_0x44f838(0x228)])throw new Error(_0x44f838(0x214)+_0x11b81f+']:\x20Missing\x20required\x20field\x20\x27name\x27');});_0x138a0f[_0x4f23f1(0x234)]&&Array[_0x4f23f1(0x1e4)](_0x138a0f[_0x4f23f1(0x234)])&&_0x138a0f[_0x4f23f1(0x234)][_0x4f23f1(0x22f)]((_0x37f2d3,_0x577538)=>{const _0x44ff08=_0x4f23f1;if(!_0x37f2d3['name'])throw new Error(_0x44ff08(0x23e)+_0x577538+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x37f2d3[_0x44ff08(0x236)]&&!_0x4fe3fd[_0x44ff08(0x245)](_0x37f2d3[_0x44ff08(0x236)]))throw new Error('realtime.attributes['+_0x577538+_0x44ff08(0x1f1)+_0x37f2d3['name']+'):\x20Invalid\x20type\x20\x27'+_0x37f2d3[_0x44ff08(0x236)]+_0x44ff08(0x243)+_0x4fe3fd['join'](',\x20'));});if(_0x138a0f[_0x4f23f1(0x23f)]){if(!_0x138a0f[_0x4f23f1(0x23f)][_0x4f23f1(0x1f4)])throw new Error(_0x4f23f1(0x213));}}function validatePersonalizationServices(_0x2e6aff){const _0x25015a=a153_0x51db;if(!Array[_0x25015a(0x1e4)](_0x2e6aff))throw new Error('personalization_services\x20must\x20be\x20an\x20array');_0x2e6aff[_0x25015a(0x22f)]((_0x2cceda,_0x25dafb)=>{const _0x5698ee=_0x25015a;if(!_0x2cceda[_0x5698ee(0x228)])throw new Error('personalization_services['+_0x25dafb+_0x5698ee(0x225));});}function a153_0x51db(_0x594b9f,_0x37f990){_0x594b9f=_0x594b9f-0x1e2;const _0x1d358e=a153_0x1d35();let _0x51db1a=_0x1d358e[_0x594b9f];return _0x51db1a;}export function generateTemplate(_0x327fe7,_0x5a4b36,_0x5d045b){const _0x5c633f=a153_0x51db,_0x281557={'name':_0x327fe7,'description':_0x5c633f(0x204),'master':{'database':_0x5a4b36,'table':_0x5d045b},'schedule':{'type':_0x5c633f(0x209),'time':_0x5c633f(0x237),'timezone':_0x5c633f(0x23d)},'attributes':[{'name':_0x5c633f(0x21f),'source':{'database':_0x5a4b36,'table':_0x5c633f(0x1f3)},'join':{'parent_key':'id','child_key':_0x5c633f(0x232)},'columns':[{'column':_0x5c633f(0x224),'label':_0x5c633f(0x21c),'type':'string'}]}],'behaviors':[{'name':_0x5c633f(0x1ea),'source':{'database':_0x5a4b36,'table':'events_table'},'join':{'parent_key':'user_id','child_key':_0x5c633f(0x232)},'all_columns':!![]}]};return serializeDef(_0x281557);}
@@ -1 +1 @@
1
- (function(_0x3ca4b6,_0x171d36){const _0x324ee1=a154_0xca44,_0x4af349=_0x3ca4b6();while(!![]){try{const _0x45a510=-parseInt(_0x324ee1(0x22d))/0x1*(-parseInt(_0x324ee1(0x221))/0x2)+-parseInt(_0x324ee1(0x20f))/0x3+parseInt(_0x324ee1(0x1f8))/0x4+parseInt(_0x324ee1(0x209))/0x5*(parseInt(_0x324ee1(0x234))/0x6)+-parseInt(_0x324ee1(0x1f2))/0x7+-parseInt(_0x324ee1(0x20c))/0x8*(-parseInt(_0x324ee1(0x21e))/0x9)+-parseInt(_0x324ee1(0x21f))/0xa*(-parseInt(_0x324ee1(0x208))/0xb);if(_0x45a510===_0x171d36)break;else _0x4af349['push'](_0x4af349['shift']());}catch(_0x26c66d){_0x4af349['push'](_0x4af349['shift']());}}}(a154_0x33d1,0xee7b0));import a154_0x35f350 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a154_0xefa645,normalizeJourneyDef,parseYamlString as a154_0x2bb66a}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';import{createTdxConfigContent}from'./tdx-config.js';function a154_0x33d1(){const _0x3e69a9=['Warning:\x20Journey\x20','map','filter','getParent','Processing\x20journeys','18FCfrFV','all','Processing\x20journey:\x20','toLowerCase','get','data','updatedAt','segmentFolderId','state','getSegment','tdx.json','9124619TmNOLD','listSegments','sort','.yml','listActivations','description','1881688ZTJjdz','Resolving\x20parent\x20segment','attributes','utf-8','size','segment','rule','versionNumber','values','connection','set','resolveParentId','createdAt','isNew','clear','kind','187mqHlaB','494010CDQLRh','targetResourceName','listJourneysWithDetailsFromParentSegment','32NGfZfi','slice','folderId','4519230qGpEpu','Fetching\x20activations','add','join','push','Fetching\x20parent\x20segment\x20info','listFolders','segments/','length','journeyBundleId','getActivation','activation_','reduce','journeyBundleName','getLatestJourneyId','2361735PwIHcn','804060EVRBfu','Processing\x20segments','38926oiGEOi','buildIdToEmailMap','relationships','journey','update','audienceId','from','hasChanges','activationParams','user','name','getJourney','31RfYYmZ','Fetching\x20segments,\x20folders,\x20and\x20journeys'];a154_0x33d1=function(){return _0x3e69a9;};return a154_0x33d1();}function prepareFile(_0x4eee58,_0x1c90a8,_0x6ed034){const _0x2ac753=a154_0xca44,_0x441b63=a154_0x35f350['relative'](_0x6ed034,_0x4eee58);if(existsSync(_0x4eee58)){const _0x41923d=readFileSync(_0x4eee58,_0x2ac753(0x1fb)),_0x74702=generateDiff(_0x41923d,_0x1c90a8),_0x3eb0e5=hasChanges(_0x74702);return{'relativePath':_0x441b63,'absolutePath':_0x4eee58,'content':_0x1c90a8,'isNew':![],'hasChanges':_0x3eb0e5,'diff':_0x3eb0e5?formatDiffWithColors(_0x74702):undefined};}return{'relativePath':_0x441b63,'absolutePath':_0x4eee58,'content':_0x1c90a8,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x360a6e,_0x26f980,_0x4f2872){const _0x2af94a=a154_0xca44,_0x20d66a=_0x360a6e+':'+_0x26f980,_0x5404de=_0x4f2872[_0x2af94a(0x238)](_0x20d66a)||0x0;_0x4f2872['set'](_0x20d66a,_0x5404de+0x1);if(_0x5404de===0x0)return _0x26f980;return _0x26f980+'_'+(_0x5404de+0x1);}export async function pullSegments(_0x338c98,_0x5020ed,_0x70d617={}){const _0xef4172=a154_0xca44,{targetDir:_0x332a08,progress:_0x2ee04b}=_0x70d617;_0x2ee04b?.[_0xef4172(0x225)](_0xef4172(0x1f9));const _0x4ccbb0=await _0x338c98[_0xef4172(0x1fd)][_0xef4172(0x203)](_0x5020ed);_0x2ee04b?.[_0xef4172(0x225)](_0xef4172(0x214));const _0x243ccf=await _0x338c98[_0xef4172(0x1fd)][_0xef4172(0x232)](_0x4ccbb0),_0x1fd166=_0x243ccf[_0xef4172(0x1fa)][_0xef4172(0x22b)];_0x2ee04b?.['update'](_0xef4172(0x22e));const [_0x4d01b2,_0x14f8fc,_0xac559e]=await Promise[_0xef4172(0x235)]([_0x338c98[_0xef4172(0x1fd)][_0xef4172(0x1f3)](_0x4ccbb0),_0x338c98[_0xef4172(0x1fd)][_0xef4172(0x215)](_0x4ccbb0),_0x338c98[_0xef4172(0x224)][_0xef4172(0x20b)](_0x4ccbb0,{'includeAllVersions':!![]})]),{journeys:_0x2d4643,activationStepsById:_0x3a7073}=_0xac559e,_0x3dc7e7=new Map();for(const _0x25d24c of _0x2d4643){_0x3dc7e7[_0xef4172(0x202)](_0x25d24c['id'],_0x25d24c);}const _0x177f01=_0x2d4643[_0xef4172(0x230)](_0xb49b03=>({'id':_0xb49b03['id'],'name':_0xb49b03[_0xef4172(0x1fa)][_0xef4172(0x22b)],'journeyBundleName':_0xb49b03[_0xef4172(0x1fa)][_0xef4172(0x21c)]||'','journeyBundleId':_0xb49b03[_0xef4172(0x1fa)][_0xef4172(0x218)]||'','versionNumber':_0xb49b03[_0xef4172(0x1fa)][_0xef4172(0x1ff)],'description':_0xb49b03[_0xef4172(0x1fa)][_0xef4172(0x1f7)],'state':_0xb49b03['attributes'][_0xef4172(0x23c)],'paused':_0xb49b03['attributes']['paused'],'audienceId':_0xb49b03[_0xef4172(0x1fa)]['audienceId'],'folderId':_0xb49b03[_0xef4172(0x223)]?.['parentFolder']?.[_0xef4172(0x239)]?.['id'],'createdAt':_0xb49b03[_0xef4172(0x1fa)][_0xef4172(0x204)],'updatedAt':_0xb49b03['attributes'][_0xef4172(0x23a)]})),_0x1c5647=buildFolderIdToPathMap(_0x14f8fc),_0x3b2cbc=_0x332a08||_0xef4172(0x216)+sanitizeFileName(_0x1fd166);_0x2ee04b?.[_0xef4172(0x225)](_0xef4172(0x210));const _0xc7b70c=new Map();await batchAsync(_0x4d01b2,async _0x4800f3=>{const _0x274051=_0xef4172,_0x59f400=await _0x338c98[_0x274051(0x1fd)][_0x274051(0x1f6)](_0x4ccbb0,_0x4800f3['id']);_0xc7b70c[_0x274051(0x202)](_0x4800f3['id'],_0x59f400);}),_0x2ee04b?.[_0xef4172(0x225)]('Fetching\x20users\x20and\x20connections');const [_0x18da59,_0x2a6f07]=await Promise[_0xef4172(0x235)]([_0x338c98[_0xef4172(0x22a)][_0xef4172(0x222)](),_0x338c98[_0xef4172(0x201)]['buildIdToNameMap']()]),_0x432e05=[],_0x1f1ca7=new Map(),_0x12035b=a154_0x35f350[_0xef4172(0x212)](_0x3b2cbc,_0xef4172(0x23e)),_0x44f897=createTdxConfigContent(_0x1fd166);_0x432e05[_0xef4172(0x213)](prepareFile(_0x12035b,_0x44f897,_0x3b2cbc));const _0x57b882=new Map();for(const _0x10628c of _0x4d01b2){_0x57b882[_0xef4172(0x202)](_0x10628c['id'],_0x10628c);}let _0x557735=_0x4d01b2;if(_0x70d617['targetResourceName']){const _0x319841=_0x4d01b2[_0xef4172(0x231)](_0x45bb16=>_0x45bb16[_0xef4172(0x22b)]['toLowerCase']()===_0x70d617['targetResourceName'][_0xef4172(0x237)]());_0x319841[_0xef4172(0x217)]>0x0&&(_0x557735=_0x319841);}_0x2ee04b?.[_0xef4172(0x225)](_0xef4172(0x220));for(const _0x5a509c of _0x557735){if(_0x5a509c[_0xef4172(0x207)]===SEGMENT_KIND_JOURNEY)continue;const _0x5713c4=_0x5a509c[_0xef4172(0x23b)]?_0x1c5647['get'](_0x5a509c[_0xef4172(0x23b)])||'':'',_0x27d80f=_0xc7b70c['get'](_0x5a509c['id'])||[],_0x40a59e=segmentWithActivationsToYaml(_0x5a509c,_0x27d80f,undefined,_0x18da59,_0x2a6f07),_0x31560f=_0x5713c4?a154_0x35f350[_0xef4172(0x212)](_0x3b2cbc,_0x5713c4):_0x3b2cbc,_0x3151dd=sanitizeFileName(_0x5a509c[_0xef4172(0x22b)]),_0x431abb=getUniqueFileName(_0x31560f,_0x3151dd,_0x1f1ca7),_0xac4d6a=a154_0x35f350['join'](_0x31560f,_0x431abb+'.yml'),_0x49358e=segmentToYamlString(_0x40a59e);_0x432e05[_0xef4172(0x213)](prepareFile(_0xac4d6a,_0x49358e,_0x3b2cbc));}const _0x2642b8=new Map();for(const _0x496c91 of _0x177f01){const _0x16972e=_0x496c91[_0xef4172(0x218)];!_0x2642b8['has'](_0x16972e)&&_0x2642b8[_0xef4172(0x202)](_0x16972e,[]),_0x2642b8[_0xef4172(0x238)](_0x16972e)[_0xef4172(0x213)](_0x496c91);}for(const _0x1e9fcc of _0x2642b8[_0xef4172(0x200)]()){_0x1e9fcc[_0xef4172(0x1f4)]((_0x4d49f9,_0x15c939)=>(_0x4d49f9['versionNumber']||0x0)-(_0x15c939[_0xef4172(0x1ff)]||0x0));}if(_0x70d617['targetResourceName']){const _0x493a0d=new Map();for(const [_0x19a2c5,_0x5eb72e]of _0x2642b8){const _0x11252e=_0x5eb72e[0x0][_0xef4172(0x21c)];if(_0x11252e[_0xef4172(0x237)]()===_0x70d617[_0xef4172(0x20a)][_0xef4172(0x237)]()){_0x493a0d[_0xef4172(0x202)](_0x19a2c5,_0x5eb72e);break;}}_0x2642b8[_0xef4172(0x206)]();for(const [_0x375083,_0xde9599]of _0x493a0d){_0x2642b8[_0xef4172(0x202)](_0x375083,_0xde9599);}}if(_0x2642b8[_0xef4172(0x1fc)]>0x0){_0x2ee04b?.[_0xef4172(0x225)](_0xef4172(0x233));const _0x1f6b55=Array[_0xef4172(0x227)](_0x2642b8['values']()),_0xde4785=0x5,{createYamlContext:_0x57a0a0}=createYamlContextForBundle(_0x338c98,_0x57b882,_0x18da59,_0x2a6f07,_0x3a7073,_0x3dc7e7);for(let _0x51a7af=0x0;_0x51a7af<_0x1f6b55['length'];_0x51a7af+=_0xde4785){const _0x3ce102=_0x1f6b55[_0xef4172(0x20d)](_0x51a7af,_0x51a7af+_0xde4785),_0xeec855=await Promise[_0xef4172(0x235)](_0x3ce102[_0xef4172(0x230)](async _0x4b49bc=>{const _0x3ccfd5=_0xef4172,_0x180040=_0x4b49bc[0x0],_0x643d26=_0x180040['journeyBundleName'];_0x2ee04b?.[_0x3ccfd5(0x225)](_0x3ccfd5(0x236)+_0x643d26);const _0x3448c6=_0x180040['folderId']?_0x1c5647[_0x3ccfd5(0x238)](_0x180040[_0x3ccfd5(0x20e)])||'':'',_0x30563f=_0x3448c6?a154_0x35f350[_0x3ccfd5(0x212)](_0x3b2cbc,_0x3448c6):_0x3b2cbc,_0x175866=sanitizeFileName(_0x643d26),_0x42f81b=a154_0x35f350['join'](_0x30563f,_0x175866+_0x3ccfd5(0x1f5));let _0xa41b23;if(existsSync(_0x42f81b))try{const _0x24c87e=readFileSync(_0x42f81b,_0x3ccfd5(0x1fb)),_0x3d270c=a154_0x2bb66a(_0x24c87e);_0xa41b23=buildLocalRuleToNameMappingFromJourney(_0x3d270c);}catch{}const _0x54162c=[];for(const _0x28812f of _0x4b49bc){const _0x179986=_0x3dc7e7['get'](_0x28812f['id']);if(!_0x179986){_0x2ee04b?.[_0x3ccfd5(0x225)](_0x3ccfd5(0x22f)+_0x28812f['id']+'\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping');continue;}const _0x37b02c=_0x179986['attributes']?.[_0x3ccfd5(0x226)],_0x4b4810=_0x57a0a0(_0x28812f['id'],_0x37b02c),_0x198db5=await journeyResponseToDef(_0x179986,_0x4b4810);_0x54162c['push']({'item':_0x28812f,'yaml':_0x198db5});}const _0x141d43=await _0x338c98[_0x3ccfd5(0x224)][_0x3ccfd5(0x21d)](_0x180040[_0x3ccfd5(0x218)]),_0x13a9fd=buildMergedJourneyDef(_0x54162c,_0xa41b23,_0x141d43);return{'bundleName':_0x643d26,'folderPath':_0x3448c6,'finalYaml':_0x13a9fd};}));for(const {bundleName:_0x35838b,folderPath:_0x668107,finalYaml:_0x561a7b}of _0xeec855){const _0x58447c=normalizeJourneyDef(_0x561a7b),_0x53c271=a154_0xefa645(_0x58447c),_0x3a1a4=_0x668107?a154_0x35f350[_0xef4172(0x212)](_0x3b2cbc,_0x668107):_0x3b2cbc,_0x518f22=sanitizeFileName(_0x35838b),_0xe28f46=getUniqueFileName(_0x3a1a4,_0x518f22,_0x1f1ca7),_0x1a91e9=a154_0x35f350[_0xef4172(0x212)](_0x3a1a4,_0xe28f46+'.yml');_0x432e05['push'](prepareFile(_0x1a91e9,_0x53c271,_0x3b2cbc));}}}const _0x20220d=Array[_0xef4172(0x227)](_0xc7b70c[_0xef4172(0x200)]())[_0xef4172(0x21b)]((_0x45551f,_0x3a45f4)=>_0x45551f+_0x3a45f4[_0xef4172(0x217)],0x0),_0x38ff1=_0x557735[_0xef4172(0x231)](_0x13efb0=>_0x13efb0['kind']!==SEGMENT_KIND_JOURNEY),_0x59c18c=_0x432e05[_0xef4172(0x231)](_0x1939c3=>_0x1939c3[_0xef4172(0x205)])[_0xef4172(0x217)],_0x9ef86a=_0x432e05['filter'](_0x315ea1=>!_0x315ea1[_0xef4172(0x205)]&&_0x315ea1[_0xef4172(0x228)])[_0xef4172(0x217)],_0x14e419=_0x432e05[_0xef4172(0x231)](_0x2b25e9=>!_0x2b25e9[_0xef4172(0x205)]&&!_0x2b25e9[_0xef4172(0x228)])[_0xef4172(0x217)],_0x29e9e1=Array[_0xef4172(0x227)](_0x2642b8['values']())[_0xef4172(0x21b)]((_0x153164,_0x4c6cc0)=>_0x153164+_0x4c6cc0['length'],0x0);return{'parentName':_0x1fd166,'parentId':_0x4ccbb0,'targetDir':_0x3b2cbc,'files':_0x432e05,'counts':{'segments':_0x38ff1['length'],'journeys':_0x2642b8[_0xef4172(0x1fc)],'journeyVersions':_0x29e9e1,'activations':_0x20220d},'newFiles':_0x59c18c,'changedFiles':_0x9ef86a,'unchangedFiles':_0x14e419};}function a154_0xca44(_0x58b6e2,_0x130ce1){_0x58b6e2=_0x58b6e2-0x1f2;const _0x33d177=a154_0x33d1();let _0xca4499=_0x33d177[_0x58b6e2];return _0xca4499;}function createYamlContextForBundle(_0x4bfb44,_0x5230e3,_0x7388e6,_0x52d042,_0x567479,_0x3948e6){const _0xde513c=new Set(),_0x1071c2=new Map(),_0x48a978=new Map(),_0x1a3a5d=createJumpTargetCache(),_0x4c568c=async(_0x34ec0d,_0x3e0fde)=>{const _0xcec5c8=a154_0xca44,_0x4edfd6=_0x1071c2[_0xcec5c8(0x238)](_0x34ec0d);if(_0x4edfd6!==undefined)return _0x4edfd6;if(!_0x3e0fde)return _0x34ec0d;try{let _0x571583=_0x5230e3[_0xcec5c8(0x238)](_0x34ec0d);!_0x571583&&(_0x571583=await _0x4bfb44[_0xcec5c8(0x1fd)][_0xcec5c8(0x23d)](_0x3e0fde,_0x34ec0d),_0x5230e3['set'](_0x34ec0d,_0x571583));const _0x3e7f44=generateJourneyLocalName(_0x571583[_0xcec5c8(0x22b)]),_0x2c5193=_0x571583[_0xcec5c8(0x207)]===SEGMENT_KIND_JOURNEY&&_0x3e7f44!==undefined;if(_0x2c5193&&_0x3e7f44){let _0x2762b1=_0x3e7f44,_0x1073d7=0x2;while(_0xde513c['has'](_0x2762b1)){_0x2762b1=_0x3e7f44+'_'+_0x1073d7,_0x1073d7++;}return _0xde513c[_0xcec5c8(0x211)](_0x2762b1),_0x1071c2['set'](_0x34ec0d,_0x2762b1),_0x2762b1;}return _0x571583['name'];}catch{return _0x34ec0d;}},_0x41dcb1=(_0x8e11d,_0x230ee2)=>({'resolveSegment':async _0x5f3f87=>{const _0x50ac31=a154_0xca44,_0x5e0e1d=_0x1071c2[_0x50ac31(0x238)](_0x5f3f87);if(_0x5e0e1d!==undefined)return{'name':_0x5e0e1d,'isJourneyLocal':!![]};if(!_0x230ee2)return{'name':_0x5f3f87,'isJourneyLocal':![]};try{let _0x22eff0=_0x5230e3['get'](_0x5f3f87);!_0x22eff0&&(_0x22eff0=await _0x4bfb44[_0x50ac31(0x1fd)]['getSegment'](_0x230ee2,_0x5f3f87),_0x5230e3['set'](_0x5f3f87,_0x22eff0));const _0x43e8e2=generateJourneyLocalName(_0x22eff0[_0x50ac31(0x22b)]),_0x2af9ac=_0x22eff0[_0x50ac31(0x207)]===SEGMENT_KIND_JOURNEY&&_0x43e8e2!==undefined;if(_0x2af9ac&&!_0x22eff0[_0x50ac31(0x1fe)]&&_0x230ee2)try{const _0x51fc5f=await _0x4bfb44[_0x50ac31(0x1fd)][_0x50ac31(0x23d)](_0x230ee2,_0x5f3f87);_0x5230e3[_0x50ac31(0x202)](_0x5f3f87,_0x51fc5f),_0x22eff0=_0x51fc5f;}catch{}const _0x3ca777=await _0x4c568c(_0x5f3f87,_0x230ee2);let _0x2b7746;if(_0x2af9ac&&_0x22eff0[_0x50ac31(0x1fe)]){const _0x56d070=await segmentResponseToDef(_0x22eff0,{'resolveSegmentName':_0x289074=>_0x4c568c(_0x289074,_0x230ee2)});_0x2b7746={'description':_0x22eff0['description'],'rule':_0x56d070[_0x50ac31(0x1fe)]};}return{'name':_0x3ca777,'isJourneyLocal':_0x2af9ac,'definition':_0x2b7746};}catch{return{'name':_0x5f3f87,'isJourneyLocal':![]};}},'resolveActivation':async _0x154dda=>{const _0x80703e=a154_0xca44,_0x4ec42d=_0x48a978[_0x80703e(0x238)](_0x154dda);if(_0x4ec42d!==undefined)return{'name':_0x4ec42d,'isJourneyLocal':!![]};try{let _0x2cf89b=_0x567479[_0x80703e(0x238)](_0x154dda);!_0x2cf89b&&(_0x2cf89b=await _0x4bfb44[_0x80703e(0x224)][_0x80703e(0x219)](_0x8e11d,_0x154dda));const _0x173456=_0x2cf89b[_0x80703e(0x1fa)][_0x80703e(0x229)][_0x80703e(0x22b)]||_0x154dda,_0x4a1878=sanitizeYamlKey(_0x173456)||_0x80703e(0x21a)+_0x154dda,_0x26e5e2=_0x4a1878;_0x48a978[_0x80703e(0x202)](_0x154dda,_0x26e5e2);const _0x3d6612=journeyActivationStepToYaml(_0x2cf89b,_0x7388e6,_0x52d042);return{'name':_0x26e5e2,'isJourneyLocal':!![],'definition':_0x3d6612};}catch{return{'name':_0x154dda,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x62d2ad,_0x1e92a7)=>resolveJumpTarget(_0x62d2ad,_0x1e92a7,_0x1a3a5d,async _0x593f5c=>{const _0x29b539=a154_0xca44,_0x1ebe2c=_0x3948e6[_0x29b539(0x238)](_0x593f5c);if(_0x1ebe2c)return _0x1ebe2c;return _0x4bfb44[_0x29b539(0x224)][_0x29b539(0x22c)](_0x593f5c);})});return{'createYamlContext':_0x41dcb1};}
1
+ function a154_0x1367(_0x98c526,_0x86bc2e){_0x98c526=_0x98c526-0x121;const _0x54ce20=a154_0x54ce();let _0x13675c=_0x54ce20[_0x98c526];return _0x13675c;}(function(_0x1bb168,_0x53c157){const _0x1c85bb=a154_0x1367,_0x174856=_0x1bb168();while(!![]){try{const _0x488b8b=parseInt(_0x1c85bb(0x137))/0x1+parseInt(_0x1c85bb(0x122))/0x2*(-parseInt(_0x1c85bb(0x128))/0x3)+-parseInt(_0x1c85bb(0x13f))/0x4+-parseInt(_0x1c85bb(0x12f))/0x5*(parseInt(_0x1c85bb(0x153))/0x6)+-parseInt(_0x1c85bb(0x15b))/0x7+-parseInt(_0x1c85bb(0x132))/0x8*(-parseInt(_0x1c85bb(0x13d))/0x9)+parseInt(_0x1c85bb(0x144))/0xa;if(_0x488b8b===_0x53c157)break;else _0x174856['push'](_0x174856['shift']());}catch(_0x2653df){_0x174856['push'](_0x174856['shift']());}}}(a154_0x54ce,0x3bc7c));import a154_0x173018 from'path';function a154_0x54ce(){const _0x43dfe2=['update','all','activationParams','isNew','Warning:\x20Journey\x20','3220VFCpjI','user','journey','968AIRdRC','from','listActivations','state','utf-8','153541iSXsHd','slice','length','versionNumber','join','buildIdToEmailMap','5301JCEUjD','toLowerCase','1414716QCsEQH','sort','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','.yml','buildIdToNameMap','11762690XXvvWT','paused','attributes','audienceId','Resolving\x20parent\x20segment','Fetching\x20activations','Processing\x20journey:\x20','rule','hasChanges','segment','relative','filter','kind','add','Processing\x20segments','3342kaHPST','Processing\x20journeys','getActivation','journeyBundleId','tdx.json','values','Fetching\x20parent\x20segment\x20info','name','202643dYzXIa','journeyBundleName','has','folderId','get','set','segmentFolderId','connection','Fetching\x20users\x20and\x20connections','reduce','getSegment','description','getParent','14uGwDhk','relationships','size','push','updatedAt','listFolders','177807KPNcVc','targetResourceName'];a154_0x54ce=function(){return _0x43dfe2;};return a154_0x54ce();}import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a154_0x104b82,normalizeJourneyDef,parseYamlString as a154_0x3091c9}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x9daa8b,_0x333605,_0x111b24){const _0x749674=a154_0x1367,_0x43c024=a154_0x173018[_0x749674(0x14e)](_0x111b24,_0x9daa8b);if(existsSync(_0x9daa8b)){const _0x4a9e2a=readFileSync(_0x9daa8b,_0x749674(0x136)),_0x4f6373=generateDiff(_0x4a9e2a,_0x333605),_0x44cc86=hasChanges(_0x4f6373);return{'relativePath':_0x43c024,'absolutePath':_0x9daa8b,'content':_0x333605,'isNew':![],'hasChanges':_0x44cc86,'diff':_0x44cc86?formatDiffWithColors(_0x4f6373):undefined};}return{'relativePath':_0x43c024,'absolutePath':_0x9daa8b,'content':_0x333605,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x5387b4,_0x5612ff,_0x4bb4cd){const _0x2b2797=a154_0x1367,_0x96cecc=_0x5387b4+':'+_0x5612ff,_0x2d60b2=_0x4bb4cd[_0x2b2797(0x15f)](_0x96cecc)||0x0;_0x4bb4cd[_0x2b2797(0x160)](_0x96cecc,_0x2d60b2+0x1);if(_0x2d60b2===0x0)return _0x5612ff;return _0x5612ff+'_'+(_0x2d60b2+0x1);}export async function pullSegments(_0x26fba7,_0x8e00d0,_0x4469b1={}){const _0x2c24c2=a154_0x1367,{targetDir:_0x222120,progress:_0x56f6b2}=_0x4469b1;_0x56f6b2?.['update'](_0x2c24c2(0x148));const _0x178687=await _0x26fba7[_0x2c24c2(0x14d)]['resolveParentId'](_0x8e00d0);_0x56f6b2?.[_0x2c24c2(0x12a)](_0x2c24c2(0x159));const _0x46a1f2=await _0x26fba7[_0x2c24c2(0x14d)][_0x2c24c2(0x121)](_0x178687),_0x215ee2=_0x46a1f2[_0x2c24c2(0x146)][_0x2c24c2(0x15a)];_0x56f6b2?.[_0x2c24c2(0x12a)]('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x4529e1,_0xe4780e,_0x294d04]=await Promise[_0x2c24c2(0x12b)]([_0x26fba7[_0x2c24c2(0x14d)]['listSegments'](_0x178687),_0x26fba7['segment'][_0x2c24c2(0x127)](_0x178687),_0x26fba7[_0x2c24c2(0x131)]['listJourneysWithDetailsFromParentSegment'](_0x178687,{'includeAllVersions':!![]})]),{journeys:_0x391522,activationStepsById:_0x39b82f}=_0x294d04,_0x15130a=new Map();for(const _0x4c8cd1 of _0x391522){_0x15130a[_0x2c24c2(0x160)](_0x4c8cd1['id'],_0x4c8cd1);}const _0x1a0df9=_0x391522['map'](_0x3783bd=>({'id':_0x3783bd['id'],'name':_0x3783bd['attributes']['name'],'journeyBundleName':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x15c)]||'','journeyBundleId':_0x3783bd['attributes']['journeyBundleId']||'','versionNumber':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x13a)],'description':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x166)],'state':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x135)],'paused':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x145)],'audienceId':_0x3783bd['attributes'][_0x2c24c2(0x147)],'folderId':_0x3783bd[_0x2c24c2(0x123)]?.['parentFolder']?.['data']?.['id'],'createdAt':_0x3783bd[_0x2c24c2(0x146)]['createdAt'],'updatedAt':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x126)]})),_0x144977=buildFolderIdToPathMap(_0xe4780e),_0x5320bf=_0x222120||'segments/'+sanitizeFileName(_0x215ee2);_0x56f6b2?.[_0x2c24c2(0x12a)](_0x2c24c2(0x149));const _0x2e443e=new Map();await batchAsync(_0x4529e1,async _0x4c96a8=>{const _0x59278f=_0x2c24c2,_0x55193e=await _0x26fba7['segment'][_0x59278f(0x134)](_0x178687,_0x4c96a8['id']);_0x2e443e['set'](_0x4c96a8['id'],_0x55193e);}),_0x56f6b2?.[_0x2c24c2(0x12a)](_0x2c24c2(0x163));const [_0x18babb,_0x11b6fb]=await Promise['all']([_0x26fba7[_0x2c24c2(0x130)][_0x2c24c2(0x13c)](),_0x26fba7[_0x2c24c2(0x162)][_0x2c24c2(0x143)]()]),_0x264b4e=[],_0x38cfd4=new Map(),_0x439c54=a154_0x173018[_0x2c24c2(0x13b)](_0x5320bf,_0x2c24c2(0x157)),_0x175db9=createTdxConfigContent(_0x215ee2);_0x264b4e['push'](prepareFile(_0x439c54,_0x175db9,_0x5320bf));const _0x5789ab=new Map();for(const _0x4073ba of _0x4529e1){_0x5789ab[_0x2c24c2(0x160)](_0x4073ba['id'],_0x4073ba);}let _0xd51648=_0x4529e1;if(_0x4469b1[_0x2c24c2(0x129)]){const _0x111f54=_0x4529e1['filter'](_0x428e23=>_0x428e23[_0x2c24c2(0x15a)][_0x2c24c2(0x13e)]()===_0x4469b1[_0x2c24c2(0x129)][_0x2c24c2(0x13e)]());_0x111f54['length']>0x0&&(_0xd51648=_0x111f54);}_0x56f6b2?.['update'](_0x2c24c2(0x152));for(const _0x4a36e1 of _0xd51648){if(_0x4a36e1[_0x2c24c2(0x150)]===SEGMENT_KIND_JOURNEY)continue;const _0xe9f810=_0x4a36e1[_0x2c24c2(0x161)]?_0x144977[_0x2c24c2(0x15f)](_0x4a36e1[_0x2c24c2(0x161)])||'':'',_0x2d3dae=_0x2e443e[_0x2c24c2(0x15f)](_0x4a36e1['id'])||[],_0x12de83=segmentWithActivationsToYaml(_0x4a36e1,_0x2d3dae,undefined,_0x18babb,_0x11b6fb),_0x50855a=_0xe9f810?a154_0x173018[_0x2c24c2(0x13b)](_0x5320bf,_0xe9f810):_0x5320bf,_0x9b004=sanitizeFileName(_0x4a36e1[_0x2c24c2(0x15a)]),_0x3f3891=getUniqueFileName(_0x50855a,_0x9b004,_0x38cfd4),_0x3af1a1=a154_0x173018[_0x2c24c2(0x13b)](_0x50855a,_0x3f3891+_0x2c24c2(0x142)),_0x536a1d=segmentToYamlString(_0x12de83);_0x264b4e['push'](prepareFile(_0x3af1a1,_0x536a1d,_0x5320bf));}const _0x405e94=new Map();for(const _0x4e9b01 of _0x1a0df9){const _0x52f95c=_0x4e9b01[_0x2c24c2(0x156)];!_0x405e94[_0x2c24c2(0x15d)](_0x52f95c)&&_0x405e94['set'](_0x52f95c,[]),_0x405e94[_0x2c24c2(0x15f)](_0x52f95c)['push'](_0x4e9b01);}for(const _0x6972d of _0x405e94[_0x2c24c2(0x158)]()){_0x6972d[_0x2c24c2(0x140)]((_0x2f8662,_0x1fec11)=>(_0x2f8662[_0x2c24c2(0x13a)]||0x0)-(_0x1fec11[_0x2c24c2(0x13a)]||0x0));}if(_0x4469b1[_0x2c24c2(0x129)]){const _0x4174ca=new Map();for(const [_0x1eb6c0,_0x339ac6]of _0x405e94){const _0x552c6b=_0x339ac6[0x0][_0x2c24c2(0x15c)];if(_0x552c6b[_0x2c24c2(0x13e)]()===_0x4469b1['targetResourceName']['toLowerCase']()){_0x4174ca['set'](_0x1eb6c0,_0x339ac6);break;}}_0x405e94['clear']();for(const [_0x571dcc,_0xceaf99]of _0x4174ca){_0x405e94[_0x2c24c2(0x160)](_0x571dcc,_0xceaf99);}}if(_0x405e94['size']>0x0){_0x56f6b2?.[_0x2c24c2(0x12a)](_0x2c24c2(0x154));const _0x5717a7=Array[_0x2c24c2(0x133)](_0x405e94['values']()),_0x416688=0x5,{createYamlContext:_0x3fc92b}=createYamlContextForBundle(_0x26fba7,_0x5789ab,_0x18babb,_0x11b6fb,_0x39b82f,_0x15130a);for(let _0x3d7642=0x0;_0x3d7642<_0x5717a7[_0x2c24c2(0x139)];_0x3d7642+=_0x416688){const _0x235029=_0x5717a7[_0x2c24c2(0x138)](_0x3d7642,_0x3d7642+_0x416688),_0x5de17d=await Promise['all'](_0x235029['map'](async _0x3b5fd2=>{const _0x48a910=_0x2c24c2,_0x17f252=_0x3b5fd2[0x0],_0x25b17b=_0x17f252[_0x48a910(0x15c)];_0x56f6b2?.[_0x48a910(0x12a)](_0x48a910(0x14a)+_0x25b17b);const _0x41088a=_0x17f252[_0x48a910(0x15e)]?_0x144977[_0x48a910(0x15f)](_0x17f252['folderId'])||'':'',_0xf88759=_0x41088a?a154_0x173018[_0x48a910(0x13b)](_0x5320bf,_0x41088a):_0x5320bf,_0x18e7aa=sanitizeFileName(_0x25b17b),_0x2ab21f=a154_0x173018[_0x48a910(0x13b)](_0xf88759,_0x18e7aa+'.yml');let _0x89ac91;if(existsSync(_0x2ab21f))try{const _0x123e53=readFileSync(_0x2ab21f,_0x48a910(0x136)),_0x3a30fb=a154_0x3091c9(_0x123e53);_0x89ac91=buildLocalRuleToNameMappingFromJourney(_0x3a30fb);}catch{}const _0x89d792=[];for(const _0x74e89d of _0x3b5fd2){const _0x357c9d=_0x15130a[_0x48a910(0x15f)](_0x74e89d['id']);if(!_0x357c9d){_0x56f6b2?.[_0x48a910(0x12a)](_0x48a910(0x12e)+_0x74e89d['id']+_0x48a910(0x141));continue;}const _0x203a21=_0x357c9d[_0x48a910(0x146)]?.[_0x48a910(0x147)],_0x26cef8=_0x3fc92b(_0x74e89d['id'],_0x203a21),_0x16df37=await journeyResponseToDef(_0x357c9d,_0x26cef8);_0x89d792[_0x48a910(0x125)]({'item':_0x74e89d,'yaml':_0x16df37});}const _0x1b8b66=await _0x26fba7[_0x48a910(0x131)]['getLatestJourneyId'](_0x17f252[_0x48a910(0x156)]),_0x295b5b=buildMergedJourneyDef(_0x89d792,_0x89ac91,_0x1b8b66);return{'bundleName':_0x25b17b,'folderPath':_0x41088a,'finalYaml':_0x295b5b};}));for(const {bundleName:_0x595bda,folderPath:_0x3e9e1f,finalYaml:_0x18a7a3}of _0x5de17d){const _0x16868b=normalizeJourneyDef(_0x18a7a3),_0x16393e=a154_0x104b82(_0x16868b),_0x193aa1=_0x3e9e1f?a154_0x173018[_0x2c24c2(0x13b)](_0x5320bf,_0x3e9e1f):_0x5320bf,_0x45b50f=sanitizeFileName(_0x595bda),_0x336421=getUniqueFileName(_0x193aa1,_0x45b50f,_0x38cfd4),_0x2941f9=a154_0x173018[_0x2c24c2(0x13b)](_0x193aa1,_0x336421+_0x2c24c2(0x142));_0x264b4e[_0x2c24c2(0x125)](prepareFile(_0x2941f9,_0x16393e,_0x5320bf));}}}const _0x49e8ec=Array[_0x2c24c2(0x133)](_0x2e443e[_0x2c24c2(0x158)]())[_0x2c24c2(0x164)]((_0xecccf0,_0x413fff)=>_0xecccf0+_0x413fff['length'],0x0),_0x3527b5=_0xd51648[_0x2c24c2(0x14f)](_0x3cd66e=>_0x3cd66e[_0x2c24c2(0x150)]!==SEGMENT_KIND_JOURNEY),_0x93fd11=_0x264b4e[_0x2c24c2(0x14f)](_0x37a767=>_0x37a767[_0x2c24c2(0x12d)])[_0x2c24c2(0x139)],_0x46d5ca=_0x264b4e[_0x2c24c2(0x14f)](_0x154cd1=>!_0x154cd1['isNew']&&_0x154cd1['hasChanges'])['length'],_0xceab46=_0x264b4e[_0x2c24c2(0x14f)](_0x438036=>!_0x438036[_0x2c24c2(0x12d)]&&!_0x438036[_0x2c24c2(0x14c)])[_0x2c24c2(0x139)],_0x206a6f=Array[_0x2c24c2(0x133)](_0x405e94['values']())[_0x2c24c2(0x164)]((_0x311837,_0x38efe5)=>_0x311837+_0x38efe5[_0x2c24c2(0x139)],0x0);return{'parentName':_0x215ee2,'parentId':_0x178687,'targetDir':_0x5320bf,'files':_0x264b4e,'counts':{'segments':_0x3527b5[_0x2c24c2(0x139)],'journeys':_0x405e94[_0x2c24c2(0x124)],'journeyVersions':_0x206a6f,'activations':_0x49e8ec},'newFiles':_0x93fd11,'changedFiles':_0x46d5ca,'unchangedFiles':_0xceab46};}function createYamlContextForBundle(_0x20461d,_0x2d8069,_0x13169c,_0x4f4f07,_0x139eb9,_0x117914){const _0x4670b9=new Set(),_0x3592e5=new Map(),_0x300d93=new Map(),_0x3c9e8d=createJumpTargetCache(),_0x182053=async(_0x52f396,_0x3ea63b)=>{const _0x17a652=a154_0x1367,_0x580b8e=_0x3592e5[_0x17a652(0x15f)](_0x52f396);if(_0x580b8e!==undefined)return _0x580b8e;if(!_0x3ea63b)return _0x52f396;try{let _0x4b2369=_0x2d8069[_0x17a652(0x15f)](_0x52f396);!_0x4b2369&&(_0x4b2369=await _0x20461d[_0x17a652(0x14d)][_0x17a652(0x165)](_0x3ea63b,_0x52f396),_0x2d8069['set'](_0x52f396,_0x4b2369));const _0x1f6ea9=generateJourneyLocalName(_0x4b2369[_0x17a652(0x15a)]),_0x3e89c1=_0x4b2369[_0x17a652(0x150)]===SEGMENT_KIND_JOURNEY&&_0x1f6ea9!==undefined;if(_0x3e89c1&&_0x1f6ea9){let _0x2d1307=_0x1f6ea9,_0x482fb6=0x2;while(_0x4670b9[_0x17a652(0x15d)](_0x2d1307)){_0x2d1307=_0x1f6ea9+'_'+_0x482fb6,_0x482fb6++;}return _0x4670b9[_0x17a652(0x151)](_0x2d1307),_0x3592e5[_0x17a652(0x160)](_0x52f396,_0x2d1307),_0x2d1307;}return _0x4b2369['name'];}catch{return _0x52f396;}},_0x851b69=(_0x1538e1,_0x2f1f8c)=>({'resolveSegment':async _0x4768d3=>{const _0x177f88=a154_0x1367,_0x49328e=_0x3592e5[_0x177f88(0x15f)](_0x4768d3);if(_0x49328e!==undefined)return{'name':_0x49328e,'isJourneyLocal':!![]};if(!_0x2f1f8c)return{'name':_0x4768d3,'isJourneyLocal':![]};try{let _0x55fc5b=_0x2d8069[_0x177f88(0x15f)](_0x4768d3);!_0x55fc5b&&(_0x55fc5b=await _0x20461d['segment'][_0x177f88(0x165)](_0x2f1f8c,_0x4768d3),_0x2d8069[_0x177f88(0x160)](_0x4768d3,_0x55fc5b));const _0x40be57=generateJourneyLocalName(_0x55fc5b[_0x177f88(0x15a)]),_0x990463=_0x55fc5b[_0x177f88(0x150)]===SEGMENT_KIND_JOURNEY&&_0x40be57!==undefined;if(_0x990463&&!_0x55fc5b[_0x177f88(0x14b)]&&_0x2f1f8c)try{const _0x5e0052=await _0x20461d[_0x177f88(0x14d)][_0x177f88(0x165)](_0x2f1f8c,_0x4768d3);_0x2d8069['set'](_0x4768d3,_0x5e0052),_0x55fc5b=_0x5e0052;}catch{}const _0x2778cf=await _0x182053(_0x4768d3,_0x2f1f8c);let _0x58af9d;if(_0x990463&&_0x55fc5b[_0x177f88(0x14b)]){const _0xef57f5=await segmentResponseToDef(_0x55fc5b,{'resolveSegmentName':_0x39800a=>_0x182053(_0x39800a,_0x2f1f8c)});_0x58af9d={'description':_0x55fc5b[_0x177f88(0x166)],'rule':_0xef57f5['rule']};}return{'name':_0x2778cf,'isJourneyLocal':_0x990463,'definition':_0x58af9d};}catch{return{'name':_0x4768d3,'isJourneyLocal':![]};}},'resolveActivation':async _0x4bf325=>{const _0x1314ed=a154_0x1367,_0x5c6dfb=_0x300d93[_0x1314ed(0x15f)](_0x4bf325);if(_0x5c6dfb!==undefined)return{'name':_0x5c6dfb,'isJourneyLocal':!![]};try{let _0x19c2d3=_0x139eb9[_0x1314ed(0x15f)](_0x4bf325);!_0x19c2d3&&(_0x19c2d3=await _0x20461d['journey'][_0x1314ed(0x155)](_0x1538e1,_0x4bf325));const _0x248700=_0x19c2d3['attributes'][_0x1314ed(0x12c)][_0x1314ed(0x15a)]||_0x4bf325,_0x371424=sanitizeYamlKey(_0x248700)||'activation_'+_0x4bf325,_0x35b653=_0x371424;_0x300d93[_0x1314ed(0x160)](_0x4bf325,_0x35b653);const _0x330eb9=journeyActivationStepToYaml(_0x19c2d3,_0x13169c,_0x4f4f07);return{'name':_0x35b653,'isJourneyLocal':!![],'definition':_0x330eb9};}catch{return{'name':_0x4bf325,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x45c516,_0x24582f)=>resolveJumpTarget(_0x45c516,_0x24582f,_0x3c9e8d,async _0x275017=>{const _0x4f0ff3=_0x117914['get'](_0x275017);if(_0x4f0ff3)return _0x4f0ff3;return _0x20461d['journey']['getJourney'](_0x275017);})});return{'createYamlContext':_0x851b69};}
@@ -1 +1 @@
1
- const a155_0x1eec03=a155_0x2107;function a155_0x4f10(){const _0x3223cb=['1060656YmXPPz','414673sPkbzs','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','utf-8','segments','38900auhyEU','50IEtnvI','journeyName','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','string','56gykOOL','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','basename','tdx.sdk.push-recovery','1589970qzRRoi','debug','60jkjPqT','parse','join','toISOString','dirname','code','1327007PnYGFX','8397obRVhm','108EKJaLn','stringify','293391oWneTd','.tmp','74hYpbnW'];a155_0x4f10=function(){return _0x3223cb;};return a155_0x4f10();}(function(_0x4197e4,_0x2e3f97){const _0x95db6b=a155_0x2107,_0x539d7c=_0x4197e4();while(!![]){try{const _0x259f5f=-parseInt(_0x95db6b(0x127))/0x1*(-parseInt(_0x95db6b(0x10f))/0x2)+parseInt(_0x95db6b(0x110))/0x3+parseInt(_0x95db6b(0x115))/0x4*(parseInt(_0x95db6b(0x120))/0x5)+parseInt(_0x95db6b(0x11e))/0x6+-parseInt(_0x95db6b(0x111))/0x7*(-parseInt(_0x95db6b(0x11a))/0x8)+parseInt(_0x95db6b(0x10d))/0x9*(-parseInt(_0x95db6b(0x116))/0xa)+parseInt(_0x95db6b(0x126))/0xb*(-parseInt(_0x95db6b(0x128))/0xc);if(_0x259f5f===_0x2e3f97)break;else _0x539d7c['push'](_0x539d7c['shift']());}catch(_0x5623c0){_0x539d7c['push'](_0x539d7c['shift']());}}}(a155_0x4f10,0x33ba9));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a155_0x3e94b7 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a155_0x1eec03(0x11d));export function getPushRecoveryPath(_0x225b31){const _0x7ab665=a155_0x1eec03,_0x55da32=a155_0x3e94b7[_0x7ab665(0x124)](_0x225b31),_0x29fa28=a155_0x3e94b7[_0x7ab665(0x11c)](_0x225b31);return a155_0x3e94b7[_0x7ab665(0x122)](_0x55da32,'.'+_0x29fa28+'.push-recovery.json');}export function readPushRecovery(_0x27da3f){const _0x2997fc=a155_0x1eec03,_0x8b94a0=getPushRecoveryPath(_0x27da3f);if(!existsSync(_0x8b94a0))return undefined;try{const _0xa6b951=readFileSync(_0x8b94a0,_0x2997fc(0x113)),_0x4b068b=JSON[_0x2997fc(0x121)](_0xa6b951);if(_0x4b068b?.['version']!==0x1||typeof _0x4b068b[_0x2997fc(0x117)]!==_0x2997fc(0x119))return undefined;return _0x4b068b;}catch(_0x5f4280){return _0x5f4280 instanceof SyntaxError?logger['debug'](_0x2997fc(0x112)+_0x5f4280):logger['warn'](_0x2997fc(0x118)+_0x5f4280),undefined;}}export function writePushRecovery(_0x2669d2,_0xfa4995){const _0x10b1f2=a155_0x1eec03,_0x20dca3=getPushRecoveryPath(_0x2669d2),_0x4a59d3=_0x20dca3+_0x10b1f2(0x10e);writeFileSync(_0x4a59d3,JSON[_0x10b1f2(0x10c)](_0xfa4995,null,0x2)+'\x0a',_0x10b1f2(0x113)),renameSync(_0x4a59d3,_0x20dca3);}function a155_0x2107(_0x34c14a,_0x530ba1){_0x34c14a=_0x34c14a-0x10c;const _0x4f10f2=a155_0x4f10();let _0x210794=_0x4f10f2[_0x34c14a];return _0x210794;}export function deletePushRecovery(_0x37aa5e){const _0x47e671=a155_0x1eec03,_0x481a30=getPushRecoveryPath(_0x37aa5e);try{unlinkSync(_0x481a30);}catch(_0x2cab8f){_0x2cab8f[_0x47e671(0x125)]!=='ENOENT'&&logger[_0x47e671(0x11f)](_0x47e671(0x11b)+_0x2cab8f);}}export function saveSegmentToPushRecovery(_0x574f2f,_0x283b72,_0x5c1b92,_0x209fd2){const _0x576b92=a155_0x1eec03,_0x469919=readPushRecovery(_0x574f2f),_0x451380=_0x469919?.[_0x576b92(0x117)]===_0x283b72?{..._0x469919,'updatedAt':new Date()[_0x576b92(0x123)]()}:{'version':0x1,'journeyName':_0x283b72,'updatedAt':new Date()[_0x576b92(0x123)](),'segments':{}};_0x451380[_0x576b92(0x114)][_0x5c1b92]=_0x209fd2,writePushRecovery(_0x574f2f,_0x451380);}
1
+ const a155_0x2a9bf4=a155_0x4d92;(function(_0x45229d,_0x57a140){const _0xe55133=a155_0x4d92,_0x3853fc=_0x45229d();while(!![]){try{const _0x3a970c=-parseInt(_0xe55133(0x197))/0x1*(-parseInt(_0xe55133(0x185))/0x2)+-parseInt(_0xe55133(0x182))/0x3+parseInt(_0xe55133(0x181))/0x4*(parseInt(_0xe55133(0x196))/0x5)+parseInt(_0xe55133(0x194))/0x6+-parseInt(_0xe55133(0x18b))/0x7*(-parseInt(_0xe55133(0x180))/0x8)+parseInt(_0xe55133(0x193))/0x9+parseInt(_0xe55133(0x187))/0xa;if(_0x3a970c===_0x57a140)break;else _0x3853fc['push'](_0x3853fc['shift']());}catch(_0x52b14a){_0x3853fc['push'](_0x3853fc['shift']());}}}(a155_0x1725,0x1af17));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a155_0x4792a9 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a155_0x2a9bf4(0x195));export function getPushRecoveryPath(_0x3d13f4){const _0x1cd77a=a155_0x2a9bf4,_0x543dc1=a155_0x4792a9['dirname'](_0x3d13f4),_0x3988da=a155_0x4792a9[_0x1cd77a(0x191)](_0x3d13f4);return a155_0x4792a9[_0x1cd77a(0x18d)](_0x543dc1,'.'+_0x3988da+_0x1cd77a(0x192));}function a155_0x4d92(_0x1212ac,_0x2a0626){_0x1212ac=_0x1212ac-0x17f;const _0x172509=a155_0x1725();let _0x4d922b=_0x172509[_0x1212ac];return _0x4d922b;}export function readPushRecovery(_0x47af8b){const _0x3c0301=a155_0x2a9bf4,_0x19a570=getPushRecoveryPath(_0x47af8b);if(!existsSync(_0x19a570))return undefined;try{const _0x1af798=readFileSync(_0x19a570,'utf-8'),_0xf4b42c=JSON['parse'](_0x1af798);if(_0xf4b42c?.[_0x3c0301(0x18f)]!==0x1||typeof _0xf4b42c[_0x3c0301(0x190)]!==_0x3c0301(0x186))return undefined;return _0xf4b42c;}catch(_0xb0850a){return _0xb0850a instanceof SyntaxError?logger[_0x3c0301(0x184)](_0x3c0301(0x18c)+_0xb0850a):logger['warn'](_0x3c0301(0x17f)+_0xb0850a),undefined;}}export function writePushRecovery(_0x2260df,_0x5bf0e8){const _0x137a4e=a155_0x2a9bf4,_0x369630=getPushRecoveryPath(_0x2260df),_0x1005df=_0x369630+_0x137a4e(0x183);writeFileSync(_0x1005df,JSON[_0x137a4e(0x189)](_0x5bf0e8,null,0x2)+'\x0a','utf-8'),renameSync(_0x1005df,_0x369630);}export function deletePushRecovery(_0x2e6822){const _0x29e8a6=a155_0x2a9bf4,_0x4b0631=getPushRecoveryPath(_0x2e6822);try{unlinkSync(_0x4b0631);}catch(_0x27ef8f){_0x27ef8f[_0x29e8a6(0x18e)]!==_0x29e8a6(0x18a)&&logger[_0x29e8a6(0x184)](_0x29e8a6(0x198)+_0x27ef8f);}}function a155_0x1725(){const _0x51c0b3=['177408inyJHc','tdx.sdk.push-recovery','145aDeJDG','2150RIlVtT','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','12808FdnMgS','9244SerZux','642519DUwZXN','.tmp','debug','164kxlQgB','string','140100dnIwvE','toISOString','stringify','ENOENT','126ipbOJy','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','join','code','version','journeyName','basename','.push-recovery.json','79353gFfBlJ'];a155_0x1725=function(){return _0x51c0b3;};return a155_0x1725();}export function saveSegmentToPushRecovery(_0x19b278,_0x587738,_0x4a76fb,_0x159475){const _0x47e28b=a155_0x2a9bf4,_0xa393bd=readPushRecovery(_0x19b278),_0x171da0=_0xa393bd?.[_0x47e28b(0x190)]===_0x587738?{..._0xa393bd,'updatedAt':new Date()[_0x47e28b(0x188)]()}:{'version':0x1,'journeyName':_0x587738,'updatedAt':new Date()[_0x47e28b(0x188)](),'segments':{}};_0x171da0['segments'][_0x4a76fb]=_0x159475,writePushRecovery(_0x19b278,_0x171da0);}