@treasuredata/tdx 2026.5.0 → 2026.6.0

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 (244) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +3 -3
  3. package/dist/cli-categories.js +1 -1
  4. package/dist/cli.d.ts.map +1 -1
  5. package/dist/cli.js +1 -1
  6. package/dist/cli.js.map +1 -1
  7. package/dist/commands/activations.js +1 -1
  8. package/dist/commands/agent-command.js +1 -1
  9. package/dist/commands/agent-test-command.js +1 -1
  10. package/dist/commands/api-command.js +1 -1
  11. package/dist/commands/auth-command.js +1 -1
  12. package/dist/commands/cas-command.js +1 -1
  13. package/dist/commands/cas-segment-command.js +1 -1
  14. package/dist/commands/chat-command.js +1 -1
  15. package/dist/commands/claude-command.js +1 -1
  16. package/dist/commands/claude-statusline-command.js +1 -1
  17. package/dist/commands/claude-usage-command.js +1 -1
  18. package/dist/commands/command.js +1 -1
  19. package/dist/commands/connection-command.js +1 -1
  20. package/dist/commands/databases.js +1 -1
  21. package/dist/commands/delivery-command.js +1 -1
  22. package/dist/commands/describe.js +1 -1
  23. package/dist/commands/engage-campaign-pull-command.js +1 -1
  24. package/dist/commands/engage-campaign-push-command.js +1 -1
  25. package/dist/commands/engage-campaign-validate-command.js +1 -1
  26. package/dist/commands/engage-command.js +1 -1
  27. package/dist/commands/engage-template-pull-command.js +1 -1
  28. package/dist/commands/engage-template-push-command.js +1 -1
  29. package/dist/commands/engage-template-validate-command.js +1 -1
  30. package/dist/commands/job-command.js +1 -1
  31. package/dist/commands/journey-command.d.ts +9 -0
  32. package/dist/commands/journey-command.d.ts.map +1 -1
  33. package/dist/commands/journey-command.js +1 -1
  34. package/dist/commands/journey-command.js.map +1 -1
  35. package/dist/commands/journey-validate-command.js +1 -1
  36. package/dist/commands/llm-command.js +1 -1
  37. package/dist/commands/mcp-command.js +1 -1
  38. package/dist/commands/parent-segment-command.js +1 -1
  39. package/dist/commands/policy-command.js +1 -1
  40. package/dist/commands/profile-command.js +1 -1
  41. package/dist/commands/profiles-command.js +1 -1
  42. package/dist/commands/query-command.js +1 -1
  43. package/dist/commands/schedule-command.js +1 -1
  44. package/dist/commands/segment-command.js +1 -1
  45. package/dist/commands/segment-create-command.js +1 -1
  46. package/dist/commands/segment-fields-command.js +1 -1
  47. package/dist/commands/segment-pull-command.js +1 -1
  48. package/dist/commands/segment-push-command.js +1 -1
  49. package/dist/commands/segment-update-command.js +1 -1
  50. package/dist/commands/segment-use-command.js +1 -1
  51. package/dist/commands/segment-validate-command.js +1 -1
  52. package/dist/commands/segments.js +1 -1
  53. package/dist/commands/show.js +1 -1
  54. package/dist/commands/status-command.js +1 -1
  55. package/dist/commands/table-deleted.js +1 -1
  56. package/dist/commands/tables.js +1 -1
  57. package/dist/commands/unset-command.js +1 -1
  58. package/dist/commands/upgrade-command.js +1 -1
  59. package/dist/commands/use-command.js +1 -1
  60. package/dist/commands/user-command.js +1 -1
  61. package/dist/commands/work-command.js +1 -1
  62. package/dist/commands/workflow-command.js +1 -1
  63. package/dist/core/auth.js +1 -1
  64. package/dist/core/command-output.js +1 -1
  65. package/dist/core/config.js +1 -1
  66. package/dist/core/connection-cache.js +1 -1
  67. package/dist/core/constants.js +1 -1
  68. package/dist/core/credential-cache.js +1 -1
  69. package/dist/core/global-context.js +1 -1
  70. package/dist/core/keychain.js +1 -1
  71. package/dist/core/oauth-keychain.js +1 -1
  72. package/dist/core/oauth.js +1 -1
  73. package/dist/core/profile.js +1 -1
  74. package/dist/core/project-config.js +1 -1
  75. package/dist/core/session.js +1 -1
  76. package/dist/core/user-cache.js +1 -1
  77. package/dist/core/version.js +1 -1
  78. package/dist/index.js +1 -1
  79. package/dist/mcp/server.js +1 -1
  80. package/dist/mcp/tools/index.js +1 -1
  81. package/dist/mcp/tools/tdx-run.js +1 -1
  82. package/dist/mcp/tools/tdx-search.js +1 -1
  83. package/dist/mcp/tools/work-create-item.js +1 -1
  84. package/dist/mcp/utils.js +1 -1
  85. package/dist/proxy/claude-usage-tracker.js +1 -1
  86. package/dist/proxy/passthrough-server.js +1 -1
  87. package/dist/proxy/sse-usage-parser.js +1 -1
  88. package/dist/sdk/agent/agent-config.js +1 -1
  89. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  90. package/dist/sdk/agent/agent-yaml.js +1 -1
  91. package/dist/sdk/agent/test/evaluator.js +1 -1
  92. package/dist/sdk/agent/test/executor.js +1 -1
  93. package/dist/sdk/agent/test/index.js +1 -1
  94. package/dist/sdk/agent/test/output.js +1 -1
  95. package/dist/sdk/agent/test/parser.js +1 -1
  96. package/dist/sdk/agent/tool-target-registry.js +1 -1
  97. package/dist/sdk/api.js +1 -1
  98. package/dist/sdk/cas/cas-api-client.js +1 -1
  99. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  100. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  101. package/dist/sdk/cas/index.js +1 -1
  102. package/dist/sdk/cas/pull-workflow.js +1 -1
  103. package/dist/sdk/cas/push-workflow.js +1 -1
  104. package/dist/sdk/client/cdp-api-client.d.ts +8 -1
  105. package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
  106. package/dist/sdk/client/cdp-api-client.js +1 -1
  107. package/dist/sdk/client/cdp-api-client.js.map +1 -1
  108. package/dist/sdk/client/delivery-api-client.js +1 -1
  109. package/dist/sdk/client/endpoints.js +1 -1
  110. package/dist/sdk/client/engage-api-client.js +1 -1
  111. package/dist/sdk/client/http-client.js +1 -1
  112. package/dist/sdk/client/llm-api-client.js +1 -1
  113. package/dist/sdk/client/oauth-refresh.js +1 -1
  114. package/dist/sdk/client/rate-limiter.js +1 -1
  115. package/dist/sdk/client/td-api-client.js +1 -1
  116. package/dist/sdk/client/trino-api-client.js +1 -1
  117. package/dist/sdk/client/workflow-client.js +1 -1
  118. package/dist/sdk/connection-validator.js +1 -1
  119. package/dist/sdk/connection.js +1 -1
  120. package/dist/sdk/delivery.js +1 -1
  121. package/dist/sdk/engage/campaign-pull.js +1 -1
  122. package/dist/sdk/engage/campaign-push.js +1 -1
  123. package/dist/sdk/engage/campaign-validator.js +1 -1
  124. package/dist/sdk/engage/campaign-yaml.js +1 -1
  125. package/dist/sdk/engage/template-pull.js +1 -1
  126. package/dist/sdk/engage/template-push.js +1 -1
  127. package/dist/sdk/engage/template-validator.js +1 -1
  128. package/dist/sdk/engage/template-yaml.js +1 -1
  129. package/dist/sdk/engage/types/campaign-def.js +1 -1
  130. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  131. package/dist/sdk/engage/types/template-schema.js +1 -1
  132. package/dist/sdk/engage.js +1 -1
  133. package/dist/sdk/errors.js +1 -1
  134. package/dist/sdk/index.js +1 -1
  135. package/dist/sdk/io/index.js +1 -1
  136. package/dist/sdk/io/node-filesystem.js +1 -1
  137. package/dist/sdk/job.js +1 -1
  138. package/dist/sdk/journey.d.ts +8 -1
  139. package/dist/sdk/journey.d.ts.map +1 -1
  140. package/dist/sdk/journey.js +1 -1
  141. package/dist/sdk/journey.js.map +1 -1
  142. package/dist/sdk/llm/chat-cache.js +1 -1
  143. package/dist/sdk/llm/index.js +1 -1
  144. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  145. package/dist/sdk/llm/model-factors.js +1 -1
  146. package/dist/sdk/llm/user-settings.js +1 -1
  147. package/dist/sdk/personalization.js +1 -1
  148. package/dist/sdk/policy.js +1 -1
  149. package/dist/sdk/query/deleted-table-validation.js +1 -1
  150. package/dist/sdk/query/index.js +1 -1
  151. package/dist/sdk/query/sql-parser.js +1 -1
  152. package/dist/sdk/realtime.js +1 -1
  153. package/dist/sdk/schedule.js +1 -1
  154. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  155. package/dist/sdk/segment/fields-display.js +1 -1
  156. package/dist/sdk/segment/file-discovery.js +1 -1
  157. package/dist/sdk/segment/journey-utils.js +1 -1
  158. package/dist/sdk/segment/journey-validator.js +1 -1
  159. package/dist/sdk/segment/journey-yaml.js +1 -1
  160. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  161. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  162. package/dist/sdk/segment/pull-workflow.js +1 -1
  163. package/dist/sdk/segment/push-recovery.js +1 -1
  164. package/dist/sdk/segment/push-workflow.js +1 -1
  165. package/dist/sdk/segment/resolution-context.js +1 -1
  166. package/dist/sdk/segment/segment-path-parser.js +1 -1
  167. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  168. package/dist/sdk/segment/segment-validator.js +1 -1
  169. package/dist/sdk/segment/segment-validator.js.map +1 -1
  170. package/dist/sdk/segment/target-resolution.js +1 -1
  171. package/dist/sdk/segment/tdx-config.js +1 -1
  172. package/dist/sdk/segment/types/activation-schema.js +1 -1
  173. package/dist/sdk/segment/types/journey-def.js +1 -1
  174. package/dist/sdk/segment/types/journey-schema.js +1 -1
  175. package/dist/sdk/segment/types/segment-def.js +1 -1
  176. package/dist/sdk/segment/types/segment-schema.js +1 -1
  177. package/dist/sdk/segment/validate-files.js +1 -1
  178. package/dist/sdk/segment/yaml-validator.d.ts +1 -1
  179. package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
  180. package/dist/sdk/segment/yaml-validator.js +1 -1
  181. package/dist/sdk/segment/yaml-validator.js.map +1 -1
  182. package/dist/sdk/segment.js +1 -1
  183. package/dist/sdk/types/cdp.d.ts +19 -0
  184. package/dist/sdk/types/cdp.d.ts.map +1 -1
  185. package/dist/sdk/types/index.d.ts +1 -1
  186. package/dist/sdk/types/index.d.ts.map +1 -1
  187. package/dist/sdk/types/index.js +1 -1
  188. package/dist/sdk/types/index.js.map +1 -1
  189. package/dist/sdk/types/progress.js +1 -1
  190. package/dist/sdk/types/workspace.js +1 -1
  191. package/dist/sdk/user.js +1 -1
  192. package/dist/sdk/util/format-detector.js +1 -1
  193. package/dist/sdk/util/formatters.js +1 -1
  194. package/dist/sdk/util/index.js +1 -1
  195. package/dist/sdk/util/paginate.js +1 -1
  196. package/dist/sdk/util/tree-formatter.js +1 -1
  197. package/dist/sdk/workflow/archive-validation.js +1 -1
  198. package/dist/sdk/workflow/clone-workflow.js +1 -1
  199. package/dist/sdk/workflow/index.js +1 -1
  200. package/dist/sdk/workflow/pull-workflow.js +1 -1
  201. package/dist/sdk/workflow/push-workflow.js +1 -1
  202. package/dist/sdk/workflow/task-graph.js +1 -1
  203. package/dist/sdk/workflow/tdx-config.js +1 -1
  204. package/dist/sdk/workflow/workflow-utils.js +1 -1
  205. package/dist/sdk/workspace/access-tracker.js +1 -1
  206. package/dist/sdk/workspace/frontmatter.js +1 -1
  207. package/dist/sdk/workspace/git.js +1 -1
  208. package/dist/sdk/workspace/index.js +1 -1
  209. package/dist/sdk/workspace/templates.js +1 -1
  210. package/dist/sdk/workspace/weekly.js +1 -1
  211. package/dist/sdk/workspace/wikilinks.js +1 -1
  212. package/dist/test-utils/command-runner.js +1 -1
  213. package/dist/test-utils/factories.js +1 -1
  214. package/dist/test-utils/fixtures.js +1 -1
  215. package/dist/test-utils/http-mock.js +1 -1
  216. package/dist/test-utils/index.js +1 -1
  217. package/dist/utils/async.js +1 -1
  218. package/dist/utils/colors.js +1 -1
  219. package/dist/utils/diff.js +1 -1
  220. package/dist/utils/file-permissions.js +1 -1
  221. package/dist/utils/file-reader.js +1 -1
  222. package/dist/utils/github-releases.js +1 -1
  223. package/dist/utils/global-cache.js +1 -1
  224. package/dist/utils/json-loader.js +1 -1
  225. package/dist/utils/local-cache.js +1 -1
  226. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  227. package/dist/utils/logger/formatters/index.js +1 -1
  228. package/dist/utils/logger/handlers/console-handler.js +1 -1
  229. package/dist/utils/logger/handlers/file-handler.js +1 -1
  230. package/dist/utils/logger/handlers/index.js +1 -1
  231. package/dist/utils/logger/handlers/null-handler.js +1 -1
  232. package/dist/utils/logger/index.js +1 -1
  233. package/dist/utils/logger/logger.js +1 -1
  234. package/dist/utils/logger/types.js +1 -1
  235. package/dist/utils/option-validation.js +1 -1
  236. package/dist/utils/process.js +1 -1
  237. package/dist/utils/prompt.js +1 -1
  238. package/dist/utils/spinner.js +1 -1
  239. package/dist/utils/sse-parser.js +1 -1
  240. package/dist/utils/string-utils.js +1 -1
  241. package/dist/utils/table-ref-parser.js +1 -1
  242. package/dist/utils/tdx-logger.js +1 -1
  243. package/dist/utils/version-check.js +1 -1
  244. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x215a35,_0x94d356){const _0x3f5301=a152_0x940b,_0x6eef07=_0x215a35();while(!![]){try{const _0x106e71=-parseInt(_0x3f5301(0x21a))/0x1*(-parseInt(_0x3f5301(0x1d4))/0x2)+-parseInt(_0x3f5301(0x20a))/0x3+parseInt(_0x3f5301(0x1d7))/0x4*(-parseInt(_0x3f5301(0x238))/0x5)+-parseInt(_0x3f5301(0x1f5))/0x6*(parseInt(_0x3f5301(0x205))/0x7)+-parseInt(_0x3f5301(0x1d5))/0x8*(parseInt(_0x3f5301(0x20f))/0x9)+-parseInt(_0x3f5301(0x230))/0xa+parseInt(_0x3f5301(0x1e1))/0xb;if(_0x106e71===_0x94d356)break;else _0x6eef07['push'](_0x6eef07['shift']());}catch(_0x3e2234){_0x6eef07['push'](_0x6eef07['shift']());}}}(a152_0x5417,0x70b7a));import*as a152_0x4e4310 from'yaml';function formatScheduleTime(_0x4da11a){const _0x44d9f8=a152_0x940b;if(typeof _0x4da11a===_0x44d9f8(0x20e)){const _0x142118=Math[_0x44d9f8(0x22e)](_0x4da11a);return String(_0x142118)[_0x44d9f8(0x201)](0x2,'0')+_0x44d9f8(0x1fb);}if(typeof _0x4da11a===_0x44d9f8(0x232)){if(/^\d{2}:\d{2}:\d{2}$/['test'](_0x4da11a))return _0x4da11a;if(/^\d{1,2}:\d{2}$/[_0x44d9f8(0x217)](_0x4da11a)){const [_0x393ef6,_0x1fe55a]=_0x4da11a[_0x44d9f8(0x1d3)](':');return _0x393ef6[_0x44d9f8(0x201)](0x2,'0')+':'+_0x1fe55a+_0x44d9f8(0x1e9);}const _0x44551c=parseInt(_0x4da11a,0xa);if(!isNaN(_0x44551c)&&_0x4da11a[_0x44d9f8(0x225)](/^\d+$/))return String(_0x44551c)[_0x44d9f8(0x201)](0x2,'0')+_0x44d9f8(0x1fb);return _0x4da11a;}return String(_0x4da11a);}export function apiToDef(_0x568cc8){const _0x56f552=a152_0x940b,_0x142ab9={'database':_0x568cc8[_0x56f552(0x20b)]?.['parentDatabaseName']||'','table':_0x568cc8[_0x56f552(0x20b)]?.[_0x56f552(0x20c)]||''};_0x568cc8['audienceFilters']&&_0x568cc8['audienceFilters'][_0x56f552(0x1eb)]>0x0&&(_0x142ab9[_0x56f552(0x204)]=_0x568cc8['audienceFilters'][_0x56f552(0x239)](_0x36adbb=>({'column':_0x36adbb[_0x56f552(0x229)],'values':_0x36adbb['rightValues']})));let _0x516029;_0x568cc8[_0x56f552(0x222)]&&_0x568cc8[_0x56f552(0x222)]!=='none'&&(_0x516029={'type':_0x568cc8[_0x56f552(0x222)]},_0x568cc8[_0x56f552(0x227)]&&(_0x516029['time']=formatScheduleTime(_0x568cc8[_0x56f552(0x227)])),_0x568cc8[_0x56f552(0x21c)]&&(_0x516029[_0x56f552(0x21c)]=_0x568cc8['timezone']));let _0x358d0d;(_0x568cc8['workflowHiveOnly']||_0x568cc8[_0x56f552(0x210)]||_0x568cc8[_0x56f552(0x1d6)])&&(_0x358d0d={},_0x568cc8[_0x56f552(0x1e5)]&&(_0x358d0d[_0x56f552(0x21b)]=_0x568cc8['workflowHiveOnly']),_0x568cc8[_0x56f552(0x210)]&&(_0x358d0d['hive_pool']=_0x568cc8[_0x56f552(0x210)]),_0x568cc8[_0x56f552(0x1d6)]&&(_0x358d0d[_0x56f552(0x1e8)]=_0x568cc8[_0x56f552(0x1d6)]));const _0x234fe3=_0x568cc8[_0x56f552(0x215)]&&_0x568cc8[_0x56f552(0x215)][_0x56f552(0x1eb)]>0x0?groupAttributesBySource(_0x568cc8[_0x56f552(0x215)]):undefined,_0x294087=_0x568cc8[_0x56f552(0x1ef)]&&_0x568cc8[_0x56f552(0x1ef)][_0x56f552(0x1eb)]>0x0?_0x568cc8['behaviors'][_0x56f552(0x239)](convertApiBehaviorToYaml):undefined;let _0x1a776b;_0x568cc8['customerGroup']&&(_0x1a776b={'name':_0x568cc8[_0x56f552(0x22d)][_0x56f552(0x23d)],'source':{'database':_0x568cc8['customerGroup'][_0x56f552(0x203)],'table':_0x568cc8['customerGroup'][_0x56f552(0x20c)]},'join':{'parent_key':_0x568cc8['customerGroup'][_0x56f552(0x23a)],'child_key':_0x568cc8[_0x56f552(0x22d)]['parentKey']}},_0x568cc8[_0x56f552(0x22d)][_0x56f552(0x1e4)]&&_0x568cc8[_0x56f552(0x22d)]['customerGroupAttributes'][_0x56f552(0x1eb)]>0x0&&(_0x1a776b[_0x56f552(0x215)]=groupAttributesBySource(_0x568cc8[_0x56f552(0x22d)]['customerGroupAttributes'])),_0x568cc8[_0x56f552(0x22d)][_0x56f552(0x1ec)]&&_0x568cc8[_0x56f552(0x22d)][_0x56f552(0x1ec)][_0x56f552(0x1eb)]>0x0&&(_0x1a776b[_0x56f552(0x1ef)]=_0x568cc8[_0x56f552(0x22d)]['customerGroupBehaviors'][_0x56f552(0x239)](convertApiBehaviorToYaml)));const _0x19fd89={'name':_0x568cc8['name'],..._0x568cc8['description']&&{'description':_0x568cc8[_0x56f552(0x22f)]},'master':_0x142ab9,..._0x516029&&{'schedule':_0x516029},..._0x358d0d&&{'engine':_0x358d0d},..._0x234fe3&&{'attributes':_0x234fe3},..._0x294087&&{'behaviors':_0x294087},..._0x1a776b&&{'customer_group':_0x1a776b}};return _0x19fd89;}function groupAttributesBySource(_0x414f15){const _0x383a11=a152_0x940b,_0x180c32=new Map();for(const _0x6a01c4 of _0x414f15){const _0x3a3662=_0x6a01c4[_0x383a11(0x203)]+'.'+_0x6a01c4[_0x383a11(0x20c)]+'.'+_0x6a01c4[_0x383a11(0x1d9)]+'.'+_0x6a01c4[_0x383a11(0x23a)];!_0x180c32[_0x383a11(0x221)](_0x3a3662)&&_0x180c32[_0x383a11(0x206)](_0x3a3662,[]),_0x180c32[_0x383a11(0x1ed)](_0x3a3662)[_0x383a11(0x208)](_0x6a01c4);}const _0x53fce0=[];for(const [,_0x108661]of _0x180c32){const _0x99ed05=_0x108661[0x0],_0x2f346e=_0x99ed05[_0x383a11(0x1d1)]||_0x99ed05[_0x383a11(0x20c)];_0x53fce0[_0x383a11(0x208)]({'name':_0x2f346e,'source':{'database':_0x99ed05[_0x383a11(0x203)],'table':_0x99ed05[_0x383a11(0x20c)]},'join':{'parent_key':_0x99ed05[_0x383a11(0x23a)],'child_key':_0x99ed05['parentKey']},'columns':_0x108661[_0x383a11(0x239)](_0x4ce2d3=>{const _0x39c0df=_0x383a11,_0x2329e6={'column':_0x4ce2d3[_0x39c0df(0x1f0)],'type':_0x4ce2d3['type']};return _0x4ce2d3['name']!==_0x4ce2d3['parentColumn']&&(_0x2329e6[_0x39c0df(0x1d8)]=_0x4ce2d3[_0x39c0df(0x23d)]),_0x2329e6;})});}return _0x53fce0;}function convertApiBehaviorToYaml(_0x7b57ce){const _0x32d10e=a152_0x940b,_0x4b2169={'name':_0x7b57ce['name'],'source':{'database':_0x7b57ce[_0x32d10e(0x203)],'table':_0x7b57ce[_0x32d10e(0x20c)]},'join':{'parent_key':_0x7b57ce[_0x32d10e(0x23a)],'child_key':_0x7b57ce[_0x32d10e(0x1d9)]}};if(_0x7b57ce[_0x32d10e(0x1ee)])_0x4b2169[_0x32d10e(0x1da)]=!![];else _0x7b57ce['schema']&&_0x7b57ce[_0x32d10e(0x20d)][_0x32d10e(0x1eb)]>0x0&&(_0x4b2169['columns']=_0x7b57ce['schema'][_0x32d10e(0x239)](_0x48b064=>{const _0xac9a05=_0x32d10e,_0x4d135c={'column':_0x48b064[_0xac9a05(0x1f0)],'type':_0x48b064[_0xac9a05(0x21e)]};return _0x48b064[_0xac9a05(0x23d)]!==_0x48b064[_0xac9a05(0x1f0)]&&(_0x4d135c[_0xac9a05(0x1d8)]=_0x48b064['name']),_0x4d135c;}));return _0x7b57ce[_0x32d10e(0x1de)]&&(_0x4b2169[_0x32d10e(0x1d2)]=_0x7b57ce['defaultTimeFilterEnabled']),_0x7b57ce['isRealtime']&&(_0x4b2169[_0x32d10e(0x200)]=_0x7b57ce[_0x32d10e(0x214)]),_0x4b2169;}export function defToApi(_0x58f7fc){const _0x14c659=a152_0x940b,_0x4f341c={'name':_0x58f7fc[_0x14c659(0x23d)],'master':{'parentDatabaseName':_0x58f7fc[_0x14c659(0x20b)][_0x14c659(0x216)],'parentTableName':_0x58f7fc[_0x14c659(0x20b)][_0x14c659(0x1e3)]}};_0x58f7fc[_0x14c659(0x22f)]&&(_0x4f341c[_0x14c659(0x22f)]=_0x58f7fc[_0x14c659(0x22f)]);_0x58f7fc[_0x14c659(0x20b)][_0x14c659(0x204)]&&_0x58f7fc[_0x14c659(0x20b)]['filters'][_0x14c659(0x1eb)]>0x0&&(_0x4f341c['audienceFilters']=_0x58f7fc[_0x14c659(0x20b)][_0x14c659(0x204)][_0x14c659(0x239)](_0x567c34=>({'columnName':_0x567c34[_0x14c659(0x231)],'rightValues':_0x567c34[_0x14c659(0x1dd)]})));_0x58f7fc[_0x14c659(0x22c)]&&(_0x4f341c[_0x14c659(0x222)]=_0x58f7fc[_0x14c659(0x22c)]['type'],_0x58f7fc[_0x14c659(0x22c)][_0x14c659(0x1f7)]&&(_0x4f341c['scheduleOption']=_0x58f7fc[_0x14c659(0x22c)][_0x14c659(0x1f7)]),_0x58f7fc[_0x14c659(0x22c)]['timezone']&&(_0x4f341c[_0x14c659(0x21c)]=_0x58f7fc[_0x14c659(0x22c)][_0x14c659(0x21c)]));_0x58f7fc[_0x14c659(0x223)]&&(_0x58f7fc[_0x14c659(0x223)][_0x14c659(0x21b)]!==undefined&&(_0x4f341c[_0x14c659(0x1e5)]=_0x58f7fc[_0x14c659(0x223)]['hive_only']),_0x58f7fc[_0x14c659(0x223)]['hive_pool']!==undefined&&(_0x4f341c[_0x14c659(0x210)]=_0x58f7fc[_0x14c659(0x223)][_0x14c659(0x1fe)]),_0x58f7fc[_0x14c659(0x223)][_0x14c659(0x1e8)]!==undefined&&(_0x4f341c[_0x14c659(0x1d6)]=_0x58f7fc['engine']['trino_pool']));_0x58f7fc[_0x14c659(0x215)]&&_0x58f7fc[_0x14c659(0x215)][_0x14c659(0x1eb)]>0x0&&(_0x4f341c[_0x14c659(0x215)]=flattenAttributeGroups(_0x58f7fc[_0x14c659(0x215)]));_0x58f7fc[_0x14c659(0x1ef)]&&_0x58f7fc['behaviors'][_0x14c659(0x1eb)]>0x0&&(_0x4f341c[_0x14c659(0x1ef)]=_0x58f7fc[_0x14c659(0x1ef)][_0x14c659(0x239)](convertDefBehaviorToApi));if(_0x58f7fc['customer_group']){const _0x1c0363=_0x58f7fc[_0x14c659(0x235)];_0x4f341c[_0x14c659(0x22d)]={'name':_0x1c0363[_0x14c659(0x23d)],'parentDatabaseName':_0x1c0363[_0x14c659(0x202)][_0x14c659(0x216)],'parentTableName':_0x1c0363[_0x14c659(0x202)][_0x14c659(0x1e3)],'parentKey':_0x1c0363[_0x14c659(0x228)][_0x14c659(0x213)],'foreignKey':_0x1c0363[_0x14c659(0x228)][_0x14c659(0x218)]},_0x1c0363[_0x14c659(0x215)]&&_0x1c0363[_0x14c659(0x215)][_0x14c659(0x1eb)]>0x0&&(_0x4f341c[_0x14c659(0x22d)][_0x14c659(0x1e4)]=flattenAttributeGroups(_0x1c0363[_0x14c659(0x215)])['map'](_0x2703fe=>({'name':_0x2703fe['name'],'type':_0x2703fe['type'],'parentDatabaseName':_0x2703fe[_0x14c659(0x203)],'parentTableName':_0x2703fe[_0x14c659(0x20c)],'parentColumn':_0x2703fe[_0x14c659(0x1f0)],'parentKey':_0x2703fe[_0x14c659(0x1d9)],'foreignKey':_0x2703fe[_0x14c659(0x23a)]}))),_0x1c0363[_0x14c659(0x1ef)]&&_0x1c0363[_0x14c659(0x1ef)][_0x14c659(0x1eb)]>0x0&&(_0x4f341c[_0x14c659(0x22d)][_0x14c659(0x1ec)]=_0x1c0363[_0x14c659(0x1ef)]['map'](_0x1fb3ec=>({'name':_0x1fb3ec[_0x14c659(0x23d)],'parentDatabaseName':_0x1fb3ec[_0x14c659(0x202)]['database'],'parentTableName':_0x1fb3ec[_0x14c659(0x202)][_0x14c659(0x1e3)],'parentKey':_0x1fb3ec[_0x14c659(0x228)]['child_key'],'foreignKey':_0x1fb3ec[_0x14c659(0x228)][_0x14c659(0x218)],'allColumns':_0x1fb3ec[_0x14c659(0x1da)],'schema':_0x1fb3ec[_0x14c659(0x1e7)]?.[_0x14c659(0x239)](_0x3ea05c=>({'name':_0x3ea05c['label']||_0x3ea05c[_0x14c659(0x231)],'type':_0x3ea05c[_0x14c659(0x21e)],'parentColumn':_0x3ea05c['column']}))})));}return _0x4f341c;}function flattenAttributeGroups(_0x31ddb1){const _0x3c1a52=a152_0x940b,_0x5ee211=[];for(const _0x13fc71 of _0x31ddb1){for(const _0x348f38 of _0x13fc71[_0x3c1a52(0x1e7)]){_0x5ee211[_0x3c1a52(0x208)]({'name':_0x348f38[_0x3c1a52(0x1d8)]||_0x348f38[_0x3c1a52(0x231)],'type':_0x348f38[_0x3c1a52(0x21e)],'parentDatabaseName':_0x13fc71['source'][_0x3c1a52(0x216)],'parentTableName':_0x13fc71[_0x3c1a52(0x202)][_0x3c1a52(0x1e3)],'parentColumn':_0x348f38[_0x3c1a52(0x231)],'parentKey':_0x13fc71[_0x3c1a52(0x228)][_0x3c1a52(0x213)],'foreignKey':_0x13fc71[_0x3c1a52(0x228)][_0x3c1a52(0x218)],'groupingName':_0x13fc71[_0x3c1a52(0x23d)]});}}return _0x5ee211;}function convertDefBehaviorToApi(_0x366492){const _0xfe4d02=a152_0x940b,_0x49a5f9={'name':_0x366492['name'],'parentDatabaseName':_0x366492['source'][_0xfe4d02(0x216)],'parentTableName':_0x366492['source'][_0xfe4d02(0x1e3)],'parentKey':_0x366492[_0xfe4d02(0x228)]['child_key'],'foreignKey':_0x366492[_0xfe4d02(0x228)][_0xfe4d02(0x218)]};if(_0x366492[_0xfe4d02(0x1da)])_0x49a5f9['allColumns']=!![];else _0x366492[_0xfe4d02(0x1e7)]&&_0x366492[_0xfe4d02(0x1e7)][_0xfe4d02(0x1eb)]>0x0&&(_0x49a5f9[_0xfe4d02(0x20d)]=_0x366492['columns'][_0xfe4d02(0x239)](_0x538eca=>({'name':_0x538eca[_0xfe4d02(0x1d8)]||_0x538eca['column'],'type':_0x538eca[_0xfe4d02(0x21e)],'parentColumn':_0x538eca[_0xfe4d02(0x231)]})));return _0x366492[_0xfe4d02(0x1d2)]!==undefined&&(_0x49a5f9[_0xfe4d02(0x1de)]=_0x366492[_0xfe4d02(0x1d2)]),_0x366492['realtime']!==undefined&&(_0x49a5f9[_0xfe4d02(0x214)]=_0x366492[_0xfe4d02(0x200)]),_0x49a5f9;}function a152_0x5417(){const _0x1edf4a=['personalization_services:','time','single','Parent\x20segment\x20description','list',':00:00','stringify','attribute_table','hive_pool','YAML\x20config\x20missing\x20required\x20field:\x20master','realtime','padStart','source','parentDatabaseName','filters','21nmQdOg','set','behaviors:','push','realtime:','2331447ZOFFIF','master','parentTableName','schema','number','252GjINPY','hivePoolName','master:','events','child_key','isRealtime','attributes','database','test','parent_key','personalization_services','515ubhLBs','hive_only','timezone','\x27.\x20Must\x20be\x20one\x20of:\x20','type','counter','Display\x20Name','has','scheduleType','engine','Example\x20Events','match','replace','scheduleOption','join','columnName','YAML\x20config\x20missing\x20required\x20field:\x20master.table','):\x20Invalid\x20type\x20\x27','schedule','customerGroup','floor','description','6103390UgSrOJ','column','string','personalization_services\x20must\x20be\x20an\x20array','id_stitching','customer_group','03:00','parse','15OcPYKJ','map','foreignKey',']:\x20Missing\x20required\x20field\x20\x27name\x27','personalization_services[','name','realtime.attributes[','customer_id','engine:','groupingName','default_time_filter','split','1318QRFOJF','79544aWAOXV','prestoPoolName','43504QdyBtW','label','parentKey','all_columns','schedule:','column_name','values','defaultTimeFilterEnabled','isArray','customer_group:','25767016Rdofxc','primary_key','table','customerGroupAttributes','workflowHiveOnly','includes','columns','trino_pool',':00',']\x20(','length','customerGroupBehaviors','get','allColumns','behaviors','parentColumn','realtime.events[','YAML\x20config\x20missing\x20required\x20field:\x20name','UTC','events_table','1043262XGLGZN'];a152_0x5417=function(){return _0x1edf4a;};return a152_0x5417();}export function serializeDef(_0x300823){const _0x241fe9=a152_0x940b,_0x40ef3c=JSON[_0x241fe9(0x237)](JSON[_0x241fe9(0x1fc)](_0x300823)),_0x39ee1d=a152_0x4e4310[_0x241fe9(0x1fc)](_0x40ef3c,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x34bc00=[_0x241fe9(0x211),_0x241fe9(0x1db),_0x241fe9(0x1d0),'attributes:',_0x241fe9(0x207),_0x241fe9(0x1e0),_0x241fe9(0x209),_0x241fe9(0x1f6)];let _0x4fe765=_0x39ee1d;for(const _0x171245 of _0x34bc00){_0x4fe765=_0x4fe765[_0x241fe9(0x226)](new RegExp('^('+_0x171245+')','m'),(_0x928f7c,_0x15ae05,_0x5d54de)=>{if(_0x5d54de===0x0||_0x4fe765[_0x5d54de-0x1]==='\x0a'&&_0x4fe765[_0x5d54de-0x2]==='\x0a')return _0x15ae05;return'\x0a'+_0x15ae05;});}return _0x4fe765;}export function parseDef(_0x3debef){const _0x2fb895=a152_0x940b,_0x4e951c=a152_0x4e4310['parse'](_0x3debef);if(!_0x4e951c[_0x2fb895(0x23d)])throw new Error(_0x2fb895(0x1f2));if(!_0x4e951c['master'])throw new Error(_0x2fb895(0x1ff));if(!_0x4e951c[_0x2fb895(0x20b)][_0x2fb895(0x216)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x4e951c[_0x2fb895(0x20b)][_0x2fb895(0x1e3)])throw new Error(_0x2fb895(0x22a));return _0x4e951c[_0x2fb895(0x200)]&&validateRealtimeSection(_0x4e951c['realtime']),_0x4e951c['personalization_services']&&validatePersonalizationServices(_0x4e951c[_0x2fb895(0x219)]),_0x4e951c;}function validateRealtimeSection(_0x37b43b){const _0x916747=a152_0x940b,_0x2df7ea=[_0x916747(0x1f8),_0x916747(0x21f),_0x916747(0x206),'ordered_set',_0x916747(0x1fa),'imported_batch'];_0x37b43b['events']&&Array[_0x916747(0x1df)](_0x37b43b[_0x916747(0x212)])&&_0x37b43b[_0x916747(0x212)]['forEach']((_0x2429ae,_0x3e5114)=>{const _0x2cc36=_0x916747;if(!_0x2429ae['name'])throw new Error(_0x2cc36(0x1f1)+_0x3e5114+_0x2cc36(0x23b));});_0x37b43b['attributes']&&Array[_0x916747(0x1df)](_0x37b43b[_0x916747(0x215)])&&_0x37b43b[_0x916747(0x215)]['forEach']((_0x5187dc,_0x5cd40c)=>{const _0x411fa6=_0x916747;if(!_0x5187dc[_0x411fa6(0x23d)])throw new Error(_0x411fa6(0x23e)+_0x5cd40c+_0x411fa6(0x23b));if(_0x5187dc[_0x411fa6(0x21e)]&&!_0x2df7ea[_0x411fa6(0x1e6)](_0x5187dc[_0x411fa6(0x21e)]))throw new Error(_0x411fa6(0x23e)+_0x5cd40c+_0x411fa6(0x1ea)+_0x5187dc[_0x411fa6(0x23d)]+_0x411fa6(0x22b)+_0x5187dc[_0x411fa6(0x21e)]+_0x411fa6(0x21d)+_0x2df7ea[_0x411fa6(0x228)](',\x20'));});if(_0x37b43b[_0x916747(0x234)]){if(!_0x37b43b[_0x916747(0x234)][_0x916747(0x1e2)])throw new Error('realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27');}}function a152_0x940b(_0x34d69e,_0x3d3684){_0x34d69e=_0x34d69e-0x1cf;const _0x5417ca=a152_0x5417();let _0x940b20=_0x5417ca[_0x34d69e];return _0x940b20;}function validatePersonalizationServices(_0x314046){const _0x480441=a152_0x940b;if(!Array[_0x480441(0x1df)](_0x314046))throw new Error(_0x480441(0x233));_0x314046['forEach']((_0x5ac217,_0x5d34e1)=>{const _0x744745=_0x480441;if(!_0x5ac217['name'])throw new Error(_0x744745(0x23c)+_0x5d34e1+']:\x20Missing\x20required\x20field\x20\x27name\x27');});}export function generateTemplate(_0x59a5fa,_0x316d3d,_0x8ebf50){const _0x5df53e=a152_0x940b,_0x350628={'name':_0x59a5fa,'description':_0x5df53e(0x1f9),'master':{'database':_0x316d3d,'table':_0x8ebf50},'schedule':{'type':'daily','time':_0x5df53e(0x236),'timezone':_0x5df53e(0x1f3)},'attributes':[{'name':'Example\x20Attributes','source':{'database':_0x316d3d,'table':_0x5df53e(0x1fd)},'join':{'parent_key':'id','child_key':_0x5df53e(0x1cf)},'columns':[{'column':_0x5df53e(0x1dc),'label':_0x5df53e(0x220),'type':'string'}]}],'behaviors':[{'name':_0x5df53e(0x224),'source':{'database':_0x316d3d,'table':_0x5df53e(0x1f4)},'join':{'parent_key':'user_id','child_key':_0x5df53e(0x1cf)},'all_columns':!![]}]};return serializeDef(_0x350628);}
1
+ (function(_0x17ca80,_0x22fe52){const _0x48e6ff=a152_0x224c,_0x5d62d=_0x17ca80();while(!![]){try{const _0x32df53=-parseInt(_0x48e6ff(0x95))/0x1+parseInt(_0x48e6ff(0xa9))/0x2*(parseInt(_0x48e6ff(0x81))/0x3)+-parseInt(_0x48e6ff(0x9c))/0x4*(parseInt(_0x48e6ff(0xd4))/0x5)+-parseInt(_0x48e6ff(0x9e))/0x6*(-parseInt(_0x48e6ff(0xdf))/0x7)+parseInt(_0x48e6ff(0x9d))/0x8+-parseInt(_0x48e6ff(0xae))/0x9*(-parseInt(_0x48e6ff(0xb6))/0xa)+parseInt(_0x48e6ff(0xa3))/0xb;if(_0x32df53===_0x22fe52)break;else _0x5d62d['push'](_0x5d62d['shift']());}catch(_0x1c02af){_0x5d62d['push'](_0x5d62d['shift']());}}}(a152_0x7cb9,0xdcf6c));import*as a152_0x389cb8 from'yaml';function formatScheduleTime(_0x34d4f0){const _0x4074d8=a152_0x224c;if(typeof _0x34d4f0===_0x4074d8(0xc7)){const _0x3694ec=Math[_0x4074d8(0x90)](_0x34d4f0);return String(_0x3694ec)[_0x4074d8(0x97)](0x2,'0')+_0x4074d8(0xa8);}if(typeof _0x34d4f0===_0x4074d8(0xbc)){if(/^\d{2}:\d{2}:\d{2}$/[_0x4074d8(0xa5)](_0x34d4f0))return _0x34d4f0;if(/^\d{1,2}:\d{2}$/[_0x4074d8(0xa5)](_0x34d4f0)){const [_0x21a2fe,_0x7abd85]=_0x34d4f0[_0x4074d8(0x88)](':');return _0x21a2fe[_0x4074d8(0x97)](0x2,'0')+':'+_0x7abd85+_0x4074d8(0xaf);}const _0x309bf1=parseInt(_0x34d4f0,0xa);if(!isNaN(_0x309bf1)&&_0x34d4f0[_0x4074d8(0xe4)](/^\d+$/))return String(_0x309bf1)[_0x4074d8(0x97)](0x2,'0')+':00:00';return _0x34d4f0;}return String(_0x34d4f0);}export function apiToDef(_0x246b6e){const _0x318456=a152_0x224c,_0x5a3de1={'database':_0x246b6e[_0x318456(0xc9)]?.[_0x318456(0x9a)]||'','table':_0x246b6e['master']?.['parentTableName']||''};_0x246b6e[_0x318456(0xd3)]&&_0x246b6e['audienceFilters'][_0x318456(0x99)]>0x0&&(_0x5a3de1['filters']=_0x246b6e['audienceFilters'][_0x318456(0x83)](_0x1e4ed0=>({'column':_0x1e4ed0['columnName'],'values':_0x1e4ed0[_0x318456(0xa6)]})));let _0xb8be1e;_0x246b6e[_0x318456(0x8f)]&&_0x246b6e[_0x318456(0x8f)]!==_0x318456(0x91)&&(_0xb8be1e={'type':_0x246b6e['scheduleType']},_0x246b6e['scheduleOption']&&(_0xb8be1e[_0x318456(0xcf)]=formatScheduleTime(_0x246b6e[_0x318456(0xca)])),_0x246b6e['timezone']&&(_0xb8be1e['timezone']=_0x246b6e[_0x318456(0xb7)]));let _0x107b23;(_0x246b6e[_0x318456(0xd6)]||_0x246b6e[_0x318456(0xc4)]||_0x246b6e[_0x318456(0x8a)])&&(_0x107b23={},_0x246b6e[_0x318456(0xd6)]&&(_0x107b23[_0x318456(0xcd)]=_0x246b6e[_0x318456(0xd6)]),_0x246b6e[_0x318456(0xc4)]&&(_0x107b23[_0x318456(0xcc)]=_0x246b6e['hivePoolName']),_0x246b6e[_0x318456(0x8a)]&&(_0x107b23['trino_pool']=_0x246b6e[_0x318456(0x8a)]));const _0x187d4b=_0x246b6e[_0x318456(0x8e)]&&_0x246b6e[_0x318456(0x8e)][_0x318456(0x99)]>0x0?groupAttributesBySource(_0x246b6e[_0x318456(0x8e)]):undefined,_0x4c9b83=_0x246b6e[_0x318456(0xe1)]&&_0x246b6e[_0x318456(0xe1)]['length']>0x0?_0x246b6e[_0x318456(0xe1)][_0x318456(0x83)](convertApiBehaviorToYaml):undefined;let _0x243316;_0x246b6e[_0x318456(0x8b)]&&(_0x243316={'name':_0x246b6e[_0x318456(0x8b)][_0x318456(0xb9)],'source':{'database':_0x246b6e['customerGroup'][_0x318456(0x9a)],'table':_0x246b6e[_0x318456(0x8b)][_0x318456(0xd2)]},'join':{'parent_key':_0x246b6e[_0x318456(0x8b)][_0x318456(0xbe)],'child_key':_0x246b6e[_0x318456(0x8b)][_0x318456(0xad)]}},_0x246b6e['customerGroup'][_0x318456(0xe3)]&&_0x246b6e[_0x318456(0x8b)][_0x318456(0xe3)][_0x318456(0x99)]>0x0&&(_0x243316['attributes']=groupAttributesBySource(_0x246b6e[_0x318456(0x8b)][_0x318456(0xe3)])),_0x246b6e[_0x318456(0x8b)][_0x318456(0xd0)]&&_0x246b6e[_0x318456(0x8b)]['customerGroupBehaviors']['length']>0x0&&(_0x243316[_0x318456(0xe1)]=_0x246b6e[_0x318456(0x8b)]['customerGroupBehaviors'][_0x318456(0x83)](convertApiBehaviorToYaml)));const _0x4cc85b={'name':_0x246b6e[_0x318456(0xb9)],..._0x246b6e[_0x318456(0xa4)]&&{'description':_0x246b6e[_0x318456(0xa4)]},'master':_0x5a3de1,..._0xb8be1e&&{'schedule':_0xb8be1e},..._0x107b23&&{'engine':_0x107b23},..._0x187d4b&&{'attributes':_0x187d4b},..._0x4c9b83&&{'behaviors':_0x4c9b83},..._0x243316&&{'customer_group':_0x243316}};return _0x4cc85b;}function groupAttributesBySource(_0x22ab35){const _0x4f1e59=a152_0x224c,_0x2495fb=new Map();for(const _0x547cfd of _0x22ab35){const _0x4beb42=_0x547cfd[_0x4f1e59(0x9a)]+'.'+_0x547cfd[_0x4f1e59(0xd2)]+'.'+_0x547cfd[_0x4f1e59(0xad)]+'.'+_0x547cfd['foreignKey'];!_0x2495fb['has'](_0x4beb42)&&_0x2495fb[_0x4f1e59(0xe8)](_0x4beb42,[]),_0x2495fb[_0x4f1e59(0x80)](_0x4beb42)[_0x4f1e59(0xde)](_0x547cfd);}const _0x4db870=[];for(const [,_0x33857e]of _0x2495fb){const _0x2e5acf=_0x33857e[0x0],_0x53d5be=_0x2e5acf['groupingName']||_0x2e5acf[_0x4f1e59(0xd2)];_0x4db870[_0x4f1e59(0xde)]({'name':_0x53d5be,'source':{'database':_0x2e5acf[_0x4f1e59(0x9a)],'table':_0x2e5acf[_0x4f1e59(0xd2)]},'join':{'parent_key':_0x2e5acf[_0x4f1e59(0xbe)],'child_key':_0x2e5acf['parentKey']},'columns':_0x33857e[_0x4f1e59(0x83)](_0xafa595=>{const _0x89c64d=_0x4f1e59,_0x3b73a6={'column':_0xafa595[_0x89c64d(0xe0)],'type':_0xafa595[_0x89c64d(0xe9)]};return _0xafa595[_0x89c64d(0xb9)]!==_0xafa595[_0x89c64d(0xe0)]&&(_0x3b73a6[_0x89c64d(0xa7)]=_0xafa595['name']),_0x3b73a6;})});}return _0x4db870;}function convertApiBehaviorToYaml(_0x156f7e){const _0x5d3f48=a152_0x224c,_0xe5c920={'name':_0x156f7e[_0x5d3f48(0xb9)],'source':{'database':_0x156f7e[_0x5d3f48(0x9a)],'table':_0x156f7e['parentTableName']},'join':{'parent_key':_0x156f7e[_0x5d3f48(0xbe)],'child_key':_0x156f7e[_0x5d3f48(0xad)]}};if(_0x156f7e[_0x5d3f48(0x87)])_0xe5c920[_0x5d3f48(0xb1)]=!![];else _0x156f7e[_0x5d3f48(0xbb)]&&_0x156f7e['schema']['length']>0x0&&(_0xe5c920[_0x5d3f48(0xb0)]=_0x156f7e[_0x5d3f48(0xbb)][_0x5d3f48(0x83)](_0x15839a=>{const _0x342083=_0x5d3f48,_0x27b114={'column':_0x15839a[_0x342083(0xe0)],'type':_0x15839a[_0x342083(0xe9)]};return _0x15839a[_0x342083(0xb9)]!==_0x15839a[_0x342083(0xe0)]&&(_0x27b114[_0x342083(0xa7)]=_0x15839a['name']),_0x27b114;}));return _0x156f7e[_0x5d3f48(0xd5)]&&(_0xe5c920[_0x5d3f48(0xc1)]=_0x156f7e['defaultTimeFilterEnabled']),_0x156f7e[_0x5d3f48(0xab)]&&(_0xe5c920['realtime']=_0x156f7e[_0x5d3f48(0xab)]),_0xe5c920;}function a152_0x224c(_0x1d51b0,_0x380643){_0x1d51b0=_0x1d51b0-0x7d;const _0x7cb9d6=a152_0x7cb9();let _0x224c95=_0x7cb9d6[_0x1d51b0];return _0x224c95;}export function defToApi(_0x4b443b){const _0xfb716b=a152_0x224c,_0x247d67={'name':_0x4b443b[_0xfb716b(0xb9)],'master':{'parentDatabaseName':_0x4b443b[_0xfb716b(0xc9)][_0xfb716b(0xd8)],'parentTableName':_0x4b443b[_0xfb716b(0xc9)]['table']}};_0x4b443b[_0xfb716b(0xa4)]&&(_0x247d67['description']=_0x4b443b['description']);_0x4b443b[_0xfb716b(0xc9)][_0xfb716b(0xc5)]&&_0x4b443b[_0xfb716b(0xc9)][_0xfb716b(0xc5)]['length']>0x0&&(_0x247d67[_0xfb716b(0xd3)]=_0x4b443b['master'][_0xfb716b(0xc5)]['map'](_0x1237f6=>({'columnName':_0x1237f6[_0xfb716b(0xe2)],'rightValues':_0x1237f6[_0xfb716b(0xd9)]})));_0x4b443b[_0xfb716b(0xba)]&&(_0x247d67[_0xfb716b(0x8f)]=_0x4b443b['schedule'][_0xfb716b(0xe9)],_0x4b443b['schedule'][_0xfb716b(0xcf)]&&(_0x247d67['scheduleOption']=_0x4b443b[_0xfb716b(0xba)][_0xfb716b(0xcf)]),_0x4b443b[_0xfb716b(0xba)]['timezone']&&(_0x247d67[_0xfb716b(0xb7)]=_0x4b443b[_0xfb716b(0xba)]['timezone']));_0x4b443b[_0xfb716b(0x8c)]&&(_0x4b443b[_0xfb716b(0x8c)][_0xfb716b(0xcd)]!==undefined&&(_0x247d67[_0xfb716b(0xd6)]=_0x4b443b[_0xfb716b(0x8c)][_0xfb716b(0xcd)]),_0x4b443b['engine'][_0xfb716b(0xcc)]!==undefined&&(_0x247d67[_0xfb716b(0xc4)]=_0x4b443b[_0xfb716b(0x8c)][_0xfb716b(0xcc)]),_0x4b443b[_0xfb716b(0x8c)][_0xfb716b(0x96)]!==undefined&&(_0x247d67[_0xfb716b(0x8a)]=_0x4b443b[_0xfb716b(0x8c)][_0xfb716b(0x96)]));_0x4b443b[_0xfb716b(0x8e)]&&_0x4b443b[_0xfb716b(0x8e)][_0xfb716b(0x99)]>0x0&&(_0x247d67[_0xfb716b(0x8e)]=flattenAttributeGroups(_0x4b443b[_0xfb716b(0x8e)]));_0x4b443b[_0xfb716b(0xe1)]&&_0x4b443b[_0xfb716b(0xe1)]['length']>0x0&&(_0x247d67[_0xfb716b(0xe1)]=_0x4b443b['behaviors'][_0xfb716b(0x83)](convertDefBehaviorToApi));if(_0x4b443b[_0xfb716b(0x8d)]){const _0x41f01d=_0x4b443b[_0xfb716b(0x8d)];_0x247d67[_0xfb716b(0x8b)]={'name':_0x41f01d['name'],'parentDatabaseName':_0x41f01d[_0xfb716b(0xbf)]['database'],'parentTableName':_0x41f01d[_0xfb716b(0xbf)][_0xfb716b(0xdb)],'parentKey':_0x41f01d[_0xfb716b(0xc2)][_0xfb716b(0x9b)],'foreignKey':_0x41f01d[_0xfb716b(0xc2)]['parent_key']},_0x41f01d['attributes']&&_0x41f01d[_0xfb716b(0x8e)][_0xfb716b(0x99)]>0x0&&(_0x247d67['customerGroup'][_0xfb716b(0xe3)]=flattenAttributeGroups(_0x41f01d[_0xfb716b(0x8e)])[_0xfb716b(0x83)](_0xb79026=>({'name':_0xb79026[_0xfb716b(0xb9)],'type':_0xb79026[_0xfb716b(0xe9)],'parentDatabaseName':_0xb79026['parentDatabaseName'],'parentTableName':_0xb79026[_0xfb716b(0xd2)],'parentColumn':_0xb79026[_0xfb716b(0xe0)],'parentKey':_0xb79026[_0xfb716b(0xad)],'foreignKey':_0xb79026[_0xfb716b(0xbe)]}))),_0x41f01d[_0xfb716b(0xe1)]&&_0x41f01d['behaviors']['length']>0x0&&(_0x247d67[_0xfb716b(0x8b)]['customerGroupBehaviors']=_0x41f01d[_0xfb716b(0xe1)][_0xfb716b(0x83)](_0x7b5134=>({'name':_0x7b5134[_0xfb716b(0xb9)],'parentDatabaseName':_0x7b5134['source']['database'],'parentTableName':_0x7b5134['source'][_0xfb716b(0xdb)],'parentKey':_0x7b5134['join'][_0xfb716b(0x9b)],'foreignKey':_0x7b5134[_0xfb716b(0xc2)][_0xfb716b(0xd1)],'allColumns':_0x7b5134['all_columns'],'schema':_0x7b5134[_0xfb716b(0xb0)]?.['map'](_0x54d903=>({'name':_0x54d903['label']||_0x54d903['column'],'type':_0x54d903[_0xfb716b(0xe9)],'parentColumn':_0x54d903['column']}))})));}return _0x247d67;}function flattenAttributeGroups(_0x40085a){const _0x2dab29=a152_0x224c,_0x1177b3=[];for(const _0x43fa3a of _0x40085a){for(const _0xc5315e of _0x43fa3a['columns']){_0x1177b3[_0x2dab29(0xde)]({'name':_0xc5315e[_0x2dab29(0xa7)]||_0xc5315e[_0x2dab29(0xe2)],'type':_0xc5315e[_0x2dab29(0xe9)],'parentDatabaseName':_0x43fa3a[_0x2dab29(0xbf)][_0x2dab29(0xd8)],'parentTableName':_0x43fa3a[_0x2dab29(0xbf)][_0x2dab29(0xdb)],'parentColumn':_0xc5315e[_0x2dab29(0xe2)],'parentKey':_0x43fa3a[_0x2dab29(0xc2)]['child_key'],'foreignKey':_0x43fa3a[_0x2dab29(0xc2)][_0x2dab29(0xd1)],'groupingName':_0x43fa3a[_0x2dab29(0xb9)]});}}return _0x1177b3;}function convertDefBehaviorToApi(_0x5adff4){const _0x43def5=a152_0x224c,_0x59aefe={'name':_0x5adff4[_0x43def5(0xb9)],'parentDatabaseName':_0x5adff4[_0x43def5(0xbf)][_0x43def5(0xd8)],'parentTableName':_0x5adff4[_0x43def5(0xbf)][_0x43def5(0xdb)],'parentKey':_0x5adff4['join'][_0x43def5(0x9b)],'foreignKey':_0x5adff4[_0x43def5(0xc2)]['parent_key']};if(_0x5adff4[_0x43def5(0xb1)])_0x59aefe[_0x43def5(0x87)]=!![];else _0x5adff4['columns']&&_0x5adff4[_0x43def5(0xb0)][_0x43def5(0x99)]>0x0&&(_0x59aefe['schema']=_0x5adff4[_0x43def5(0xb0)][_0x43def5(0x83)](_0x18caca=>({'name':_0x18caca[_0x43def5(0xa7)]||_0x18caca[_0x43def5(0xe2)],'type':_0x18caca[_0x43def5(0xe9)],'parentColumn':_0x18caca[_0x43def5(0xe2)]})));return _0x5adff4[_0x43def5(0xc1)]!==undefined&&(_0x59aefe['defaultTimeFilterEnabled']=_0x5adff4[_0x43def5(0xc1)]),_0x5adff4[_0x43def5(0x94)]!==undefined&&(_0x59aefe[_0x43def5(0xab)]=_0x5adff4[_0x43def5(0x94)]),_0x59aefe;}export function serializeDef(_0x3d6e0e){const _0x57eb39=a152_0x224c,_0x2c214e=JSON[_0x57eb39(0xb2)](JSON['stringify'](_0x3d6e0e)),_0x4f6b0d=a152_0x389cb8[_0x57eb39(0x82)](_0x2c214e,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x19d316=[_0x57eb39(0x85),'schedule:',_0x57eb39(0xb4),_0x57eb39(0xe7),_0x57eb39(0xdc),_0x57eb39(0xb3),_0x57eb39(0x89),_0x57eb39(0xd7)];let _0x12e67b=_0x4f6b0d;for(const _0x483400 of _0x19d316){_0x12e67b=_0x12e67b['replace'](new RegExp('^('+_0x483400+')','m'),(_0x3b2808,_0x3e4c8d,_0x2518e6)=>{if(_0x2518e6===0x0||_0x12e67b[_0x2518e6-0x1]==='\x0a'&&_0x12e67b[_0x2518e6-0x2]==='\x0a')return _0x3e4c8d;return'\x0a'+_0x3e4c8d;});}return _0x12e67b;}export function parseDef(_0xfe18a6){const _0x8657b1=a152_0x224c,_0x26cc9b=a152_0x389cb8[_0x8657b1(0xb2)](_0xfe18a6);if(!_0x26cc9b[_0x8657b1(0xb9)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x26cc9b['master'])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master');if(!_0x26cc9b[_0x8657b1(0xc9)][_0x8657b1(0xd8)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x26cc9b['master'][_0x8657b1(0xdb)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.table');return _0x26cc9b[_0x8657b1(0x94)]&&validateRealtimeSection(_0x26cc9b[_0x8657b1(0x94)]),_0x26cc9b[_0x8657b1(0xdd)]&&validatePersonalizationServices(_0x26cc9b['personalization_services']),_0x26cc9b;}function a152_0x7cb9(){const _0x3d772e=['includes','user_id',']:\x20Missing\x20required\x20field\x20\x27name\x27','get','357753ITvZkJ','stringify','map','id_stitching','master:','daily','allColumns','split','realtime:','prestoPoolName','customerGroup','engine','customer_group','attributes','scheduleType','floor','none','Example\x20Events','Example\x20Attributes','realtime','1395979LgbBGN','trino_pool','padStart','personalization_services[','length','parentDatabaseName','child_key','1785844lYpiPd','5235632bCVWTu','246kScBDZ','single','personalization_services\x20must\x20be\x20an\x20array','\x27.\x20Must\x20be\x20one\x20of:\x20','Display\x20Name','2606604xyEwjG','description','test','rightValues','label',':00:00','16BTMpEi','Parent\x20segment\x20description','isRealtime','customer_id','parentKey','1229139TKjhKb',':00','columns','all_columns','parse','customer_group:','engine:','realtime.events[','40ogaRGa','timezone','imported_batch','name','schedule','schema','string','counter','foreignKey','source','isArray','default_time_filter','join','03:00','hivePoolName','filters','forEach','number','UTC','master','scheduleOption','ordered_set','hive_pool','hive_only',']\x20(','time','customerGroupBehaviors','parent_key','parentTableName','audienceFilters','5zxFJnl','defaultTimeFilterEnabled','workflowHiveOnly','personalization_services:','database','values','attribute_table','table','behaviors:','personalization_services','push','60746bCmPAx','parentColumn','behaviors','column','customerGroupAttributes','match','events','primary_key','attributes:','set','type'];a152_0x7cb9=function(){return _0x3d772e;};return a152_0x7cb9();}function validateRealtimeSection(_0x487552){const _0x52e84b=a152_0x224c,_0x56deb9=[_0x52e84b(0x9f),_0x52e84b(0xbd),_0x52e84b(0xe8),_0x52e84b(0xcb),'list',_0x52e84b(0xb8)];_0x487552[_0x52e84b(0xe5)]&&Array['isArray'](_0x487552[_0x52e84b(0xe5)])&&_0x487552[_0x52e84b(0xe5)][_0x52e84b(0xc6)]((_0x31251d,_0x341ee7)=>{const _0x4f1032=_0x52e84b;if(!_0x31251d['name'])throw new Error(_0x4f1032(0xb5)+_0x341ee7+_0x4f1032(0x7f));});_0x487552['attributes']&&Array[_0x52e84b(0xc0)](_0x487552['attributes'])&&_0x487552['attributes'][_0x52e84b(0xc6)]((_0x5f4d64,_0x5c9698)=>{const _0x2ec61b=_0x52e84b;if(!_0x5f4d64['name'])throw new Error('realtime.attributes['+_0x5c9698+_0x2ec61b(0x7f));if(_0x5f4d64[_0x2ec61b(0xe9)]&&!_0x56deb9[_0x2ec61b(0x7d)](_0x5f4d64['type']))throw new Error('realtime.attributes['+_0x5c9698+_0x2ec61b(0xce)+_0x5f4d64[_0x2ec61b(0xb9)]+'):\x20Invalid\x20type\x20\x27'+_0x5f4d64['type']+_0x2ec61b(0xa1)+_0x56deb9[_0x2ec61b(0xc2)](',\x20'));});if(_0x487552[_0x52e84b(0x84)]){if(!_0x487552[_0x52e84b(0x84)][_0x52e84b(0xe6)])throw new Error('realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27');}}function validatePersonalizationServices(_0x4cbb04){const _0x307d2a=a152_0x224c;if(!Array[_0x307d2a(0xc0)](_0x4cbb04))throw new Error(_0x307d2a(0xa0));_0x4cbb04[_0x307d2a(0xc6)]((_0x1af622,_0x158ec1)=>{const _0x32ab86=_0x307d2a;if(!_0x1af622['name'])throw new Error(_0x32ab86(0x98)+_0x158ec1+_0x32ab86(0x7f));});}export function generateTemplate(_0x2b40f0,_0x53285a,_0x2cee19){const _0x306cda=a152_0x224c,_0x37401a={'name':_0x2b40f0,'description':_0x306cda(0xaa),'master':{'database':_0x53285a,'table':_0x2cee19},'schedule':{'type':_0x306cda(0x86),'time':_0x306cda(0xc3),'timezone':_0x306cda(0xc8)},'attributes':[{'name':_0x306cda(0x93),'source':{'database':_0x53285a,'table':_0x306cda(0xda)},'join':{'parent_key':'id','child_key':'customer_id'},'columns':[{'column':'column_name','label':_0x306cda(0xa2),'type':_0x306cda(0xbc)}]}],'behaviors':[{'name':_0x306cda(0x92),'source':{'database':_0x53285a,'table':'events_table'},'join':{'parent_key':_0x306cda(0x7e),'child_key':_0x306cda(0xac)},'all_columns':!![]}]};return serializeDef(_0x37401a);}
@@ -1 +1 @@
1
- (function(_0x210cf4,_0x36c90b){const _0xbe93aa=a153_0x4b05,_0x146461=_0x210cf4();while(!![]){try{const _0x3f7ac1=-parseInt(_0xbe93aa(0x176))/0x1*(-parseInt(_0xbe93aa(0x189))/0x2)+parseInt(_0xbe93aa(0x172))/0x3*(-parseInt(_0xbe93aa(0x173))/0x4)+-parseInt(_0xbe93aa(0x195))/0x5*(parseInt(_0xbe93aa(0x19b))/0x6)+parseInt(_0xbe93aa(0x184))/0x7+parseInt(_0xbe93aa(0x171))/0x8+-parseInt(_0xbe93aa(0x16e))/0x9+parseInt(_0xbe93aa(0x18c))/0xa*(parseInt(_0xbe93aa(0x18b))/0xb);if(_0x3f7ac1===_0x36c90b)break;else _0x146461['push'](_0x146461['shift']());}catch(_0x136c0a){_0x146461['push'](_0x146461['shift']());}}}(a153_0x1366,0xb8533));import a153_0x4a0c33 from'path';function a153_0x1366(){const _0x480465=['listActivations','Processing\x20journeys','data','description','values','Processing\x20segments','208990VxnMDz','createdAt','rule','folderId','Fetching\x20activations','has','216ZghkyC','set','listSegments','update','hasChanges','Fetching\x20parent\x20segment\x20info','buildIdToNameMap','toLowerCase','Resolving\x20parent\x20segment','journeyBundleId','utf-8','sort','Fetching\x20users\x20and\x20connections','activation_','tdx.json','journey','Warning:\x20Journey\x20','paused','push','Fetching\x20segments,\x20folders,\x20and\x20journeys','getSegment','.yml','journeyBundleName','state','isNew','attributes','map','13438368hVJuLk','from','get','10314392aUucWH','141627tVuAXk','28yCNpSi','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','Processing\x20journey:\x20','2429ecCALu','kind','buildIdToEmailMap','name','audienceId','connection','targetResourceName','length','filter','join','activationParams','versionNumber','all','size','3547775Rmncid','slice','segment','resolveParentId','segmentFolderId','790FQLaam','user','14605349nUBhSp','10XVYfQe','reduce','updatedAt'];a153_0x1366=function(){return _0x480465;};return a153_0x1366();}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';function a153_0x4b05(_0xae58d4,_0x2aafde){_0xae58d4=_0xae58d4-0x15f;const _0x136669=a153_0x1366();let _0x4b05ba=_0x136669[_0xae58d4];return _0x4b05ba;}import{journeyResponseToDef,toYamlString as a153_0x3f807c,normalizeJourneyDef,parseYamlString as a153_0x528d73}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(_0x9c4246,_0x3c5dc0,_0x386b32){const _0xd65dea=a153_0x4b05,_0x225fa8=a153_0x4a0c33['relative'](_0x386b32,_0x9c4246);if(existsSync(_0x9c4246)){const _0x594c8c=readFileSync(_0x9c4246,_0xd65dea(0x1a5)),_0x298967=generateDiff(_0x594c8c,_0x3c5dc0),_0x723f29=hasChanges(_0x298967);return{'relativePath':_0x225fa8,'absolutePath':_0x9c4246,'content':_0x3c5dc0,'isNew':![],'hasChanges':_0x723f29,'diff':_0x723f29?formatDiffWithColors(_0x298967):undefined};}return{'relativePath':_0x225fa8,'absolutePath':_0x9c4246,'content':_0x3c5dc0,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x4d0413,_0x56a0f5,_0x524a44){const _0x1eca08=a153_0x4b05,_0x2e2f6f=_0x4d0413+':'+_0x56a0f5,_0x1fbbb2=_0x524a44['get'](_0x2e2f6f)||0x0;_0x524a44[_0x1eca08(0x19c)](_0x2e2f6f,_0x1fbbb2+0x1);if(_0x1fbbb2===0x0)return _0x56a0f5;return _0x56a0f5+'_'+(_0x1fbbb2+0x1);}export async function pullSegments(_0x30ce8e,_0x148c68,_0x1b3873={}){const _0x23318b=a153_0x4b05,{targetDir:_0x201e59,progress:_0x1a6765}=_0x1b3873;_0x1a6765?.[_0x23318b(0x19e)](_0x23318b(0x1a3));const _0x239210=await _0x30ce8e['segment'][_0x23318b(0x187)](_0x148c68);_0x1a6765?.[_0x23318b(0x19e)](_0x23318b(0x1a0));const _0x5c70d9=await _0x30ce8e['segment']['getParent'](_0x239210),_0x3d2b9d=_0x5c70d9['attributes']['name'];_0x1a6765?.[_0x23318b(0x19e)](_0x23318b(0x166));const [_0x2fa805,_0x22c983,_0x469d5a]=await Promise[_0x23318b(0x182)]([_0x30ce8e[_0x23318b(0x186)][_0x23318b(0x19d)](_0x239210),_0x30ce8e[_0x23318b(0x186)]['listFolders'](_0x239210),_0x30ce8e['journey']['listJourneysWithDetailsFromParentSegment'](_0x239210,{'includeAllVersions':!![]})]),{journeys:_0x44eb58,activationStepsById:_0x2ff599}=_0x469d5a,_0x10db55=new Map();for(const _0x4cf499 of _0x44eb58){_0x10db55[_0x23318b(0x19c)](_0x4cf499['id'],_0x4cf499);}const _0xb671fa=_0x44eb58[_0x23318b(0x16d)](_0x54f134=>({'id':_0x54f134['id'],'name':_0x54f134[_0x23318b(0x16c)][_0x23318b(0x179)],'journeyBundleName':_0x54f134[_0x23318b(0x16c)][_0x23318b(0x169)]||'','journeyBundleId':_0x54f134[_0x23318b(0x16c)]['journeyBundleId']||'','versionNumber':_0x54f134[_0x23318b(0x16c)][_0x23318b(0x181)],'description':_0x54f134[_0x23318b(0x16c)][_0x23318b(0x192)],'state':_0x54f134['attributes'][_0x23318b(0x16a)],'paused':_0x54f134['attributes'][_0x23318b(0x164)],'audienceId':_0x54f134[_0x23318b(0x16c)][_0x23318b(0x17a)],'folderId':_0x54f134['relationships']?.['parentFolder']?.[_0x23318b(0x191)]?.['id'],'createdAt':_0x54f134['attributes'][_0x23318b(0x196)],'updatedAt':_0x54f134[_0x23318b(0x16c)][_0x23318b(0x18e)]})),_0x5f0413=buildFolderIdToPathMap(_0x22c983),_0x32b791=_0x201e59||'segments/'+sanitizeFileName(_0x3d2b9d);_0x1a6765?.[_0x23318b(0x19e)](_0x23318b(0x199));const _0x47fb1f=new Map();await batchAsync(_0x2fa805,async _0x892d2c=>{const _0x37c874=_0x23318b,_0x322597=await _0x30ce8e[_0x37c874(0x186)][_0x37c874(0x18f)](_0x239210,_0x892d2c['id']);_0x47fb1f[_0x37c874(0x19c)](_0x892d2c['id'],_0x322597);}),_0x1a6765?.['update'](_0x23318b(0x15f));const [_0x5e67fe,_0x288166]=await Promise[_0x23318b(0x182)]([_0x30ce8e[_0x23318b(0x18a)][_0x23318b(0x178)](),_0x30ce8e[_0x23318b(0x17b)][_0x23318b(0x1a1)]()]),_0x51e7dc=[],_0x185cfb=new Map(),_0x4b11e7=a153_0x4a0c33[_0x23318b(0x17f)](_0x32b791,_0x23318b(0x161)),_0x29f7e8=createTdxConfigContent(_0x3d2b9d);_0x51e7dc[_0x23318b(0x165)](prepareFile(_0x4b11e7,_0x29f7e8,_0x32b791));const _0x53d607=new Map();for(const _0x238b47 of _0x2fa805){_0x53d607['set'](_0x238b47['id'],_0x238b47);}let _0x5e1a60=_0x2fa805;if(_0x1b3873[_0x23318b(0x17c)]){const _0x4e68d2=_0x2fa805[_0x23318b(0x17e)](_0x13a500=>_0x13a500[_0x23318b(0x179)][_0x23318b(0x1a2)]()===_0x1b3873[_0x23318b(0x17c)][_0x23318b(0x1a2)]());_0x4e68d2[_0x23318b(0x17d)]>0x0&&(_0x5e1a60=_0x4e68d2);}_0x1a6765?.[_0x23318b(0x19e)](_0x23318b(0x194));for(const _0x258ca4 of _0x5e1a60){if(_0x258ca4[_0x23318b(0x177)]===SEGMENT_KIND_JOURNEY)continue;const _0x3f86cf=_0x258ca4['segmentFolderId']?_0x5f0413[_0x23318b(0x170)](_0x258ca4[_0x23318b(0x188)])||'':'',_0x52ac2c=_0x47fb1f[_0x23318b(0x170)](_0x258ca4['id'])||[],_0x5a146f=segmentWithActivationsToYaml(_0x258ca4,_0x52ac2c,undefined,_0x5e67fe,_0x288166),_0x2b831c=_0x3f86cf?a153_0x4a0c33[_0x23318b(0x17f)](_0x32b791,_0x3f86cf):_0x32b791,_0x1cec3c=sanitizeFileName(_0x258ca4[_0x23318b(0x179)]),_0x30aaa0=getUniqueFileName(_0x2b831c,_0x1cec3c,_0x185cfb),_0x11963f=a153_0x4a0c33[_0x23318b(0x17f)](_0x2b831c,_0x30aaa0+'.yml'),_0x1e3853=segmentToYamlString(_0x5a146f);_0x51e7dc[_0x23318b(0x165)](prepareFile(_0x11963f,_0x1e3853,_0x32b791));}const _0x443047=new Map();for(const _0x11c14e of _0xb671fa){const _0x2db9d4=_0x11c14e['journeyBundleId'];!_0x443047[_0x23318b(0x19a)](_0x2db9d4)&&_0x443047[_0x23318b(0x19c)](_0x2db9d4,[]),_0x443047[_0x23318b(0x170)](_0x2db9d4)[_0x23318b(0x165)](_0x11c14e);}for(const _0x36ad03 of _0x443047['values']()){_0x36ad03[_0x23318b(0x1a6)]((_0x340930,_0x115830)=>(_0x340930['versionNumber']||0x0)-(_0x115830[_0x23318b(0x181)]||0x0));}if(_0x1b3873[_0x23318b(0x17c)]){const _0x5c0630=new Map();for(const [_0x1256c6,_0x1d84d9]of _0x443047){const _0x29f87f=_0x1d84d9[0x0]['journeyBundleName'];if(_0x29f87f[_0x23318b(0x1a2)]()===_0x1b3873[_0x23318b(0x17c)]['toLowerCase']()){_0x5c0630['set'](_0x1256c6,_0x1d84d9);break;}}_0x443047['clear']();for(const [_0xb0dfd5,_0x22d3f7]of _0x5c0630){_0x443047[_0x23318b(0x19c)](_0xb0dfd5,_0x22d3f7);}}if(_0x443047[_0x23318b(0x183)]>0x0){_0x1a6765?.[_0x23318b(0x19e)](_0x23318b(0x190));const _0x5b7e0f=Array[_0x23318b(0x16f)](_0x443047[_0x23318b(0x193)]()),_0x1d2f75=0x5,{createYamlContext:_0x2b2204}=createYamlContextForBundle(_0x30ce8e,_0x53d607,_0x5e67fe,_0x288166,_0x2ff599,_0x10db55);for(let _0x3ded8b=0x0;_0x3ded8b<_0x5b7e0f[_0x23318b(0x17d)];_0x3ded8b+=_0x1d2f75){const _0x5cdb94=_0x5b7e0f[_0x23318b(0x185)](_0x3ded8b,_0x3ded8b+_0x1d2f75),_0x57ac14=await Promise[_0x23318b(0x182)](_0x5cdb94[_0x23318b(0x16d)](async _0x46a5fd=>{const _0x5b7339=_0x23318b,_0x2bc95d=_0x46a5fd[0x0],_0x2a0ffd=_0x2bc95d['journeyBundleName'];_0x1a6765?.['update'](_0x5b7339(0x175)+_0x2a0ffd);const _0x490802=_0x2bc95d['folderId']?_0x5f0413[_0x5b7339(0x170)](_0x2bc95d[_0x5b7339(0x198)])||'':'',_0x1887da=_0x490802?a153_0x4a0c33[_0x5b7339(0x17f)](_0x32b791,_0x490802):_0x32b791,_0x4db44b=sanitizeFileName(_0x2a0ffd),_0x332292=a153_0x4a0c33['join'](_0x1887da,_0x4db44b+_0x5b7339(0x168));let _0x5dc41a;if(existsSync(_0x332292))try{const _0x43eff1=readFileSync(_0x332292,_0x5b7339(0x1a5)),_0x15eb6a=a153_0x528d73(_0x43eff1);_0x5dc41a=buildLocalRuleToNameMappingFromJourney(_0x15eb6a);}catch{}const _0x2290b9=[];for(const _0x4f69a2 of _0x46a5fd){const _0x23423f=_0x10db55['get'](_0x4f69a2['id']);if(!_0x23423f){_0x1a6765?.[_0x5b7339(0x19e)](_0x5b7339(0x163)+_0x4f69a2['id']+_0x5b7339(0x174));continue;}const _0x298d96=_0x23423f['attributes']?.['audienceId'],_0x116af3=_0x2b2204(_0x4f69a2['id'],_0x298d96),_0x367f13=await journeyResponseToDef(_0x23423f,_0x116af3);_0x2290b9['push']({'item':_0x4f69a2,'yaml':_0x367f13});}const _0x3d58ed=await _0x30ce8e[_0x5b7339(0x162)]['getLatestJourneyId'](_0x2bc95d[_0x5b7339(0x1a4)]),_0x38cfd3=buildMergedJourneyDef(_0x2290b9,_0x5dc41a,_0x3d58ed);return{'bundleName':_0x2a0ffd,'folderPath':_0x490802,'finalYaml':_0x38cfd3};}));for(const {bundleName:_0x1ff8d5,folderPath:_0x552dcc,finalYaml:_0x2fe22f}of _0x57ac14){const _0xf5fabc=normalizeJourneyDef(_0x2fe22f),_0x11cd1c=a153_0x3f807c(_0xf5fabc),_0x2a23d4=_0x552dcc?a153_0x4a0c33[_0x23318b(0x17f)](_0x32b791,_0x552dcc):_0x32b791,_0x37cc29=sanitizeFileName(_0x1ff8d5),_0x1e6a31=getUniqueFileName(_0x2a23d4,_0x37cc29,_0x185cfb),_0x190f32=a153_0x4a0c33[_0x23318b(0x17f)](_0x2a23d4,_0x1e6a31+_0x23318b(0x168));_0x51e7dc[_0x23318b(0x165)](prepareFile(_0x190f32,_0x11cd1c,_0x32b791));}}}const _0x48d222=Array['from'](_0x47fb1f[_0x23318b(0x193)]())[_0x23318b(0x18d)]((_0x352332,_0x24cb86)=>_0x352332+_0x24cb86[_0x23318b(0x17d)],0x0),_0x3f2628=_0x5e1a60[_0x23318b(0x17e)](_0xe09163=>_0xe09163['kind']!==SEGMENT_KIND_JOURNEY),_0x707a74=_0x51e7dc[_0x23318b(0x17e)](_0x3dce0c=>_0x3dce0c[_0x23318b(0x16b)])[_0x23318b(0x17d)],_0x4a46f7=_0x51e7dc[_0x23318b(0x17e)](_0x3e9d02=>!_0x3e9d02[_0x23318b(0x16b)]&&_0x3e9d02[_0x23318b(0x19f)])['length'],_0x599fee=_0x51e7dc[_0x23318b(0x17e)](_0x157c89=>!_0x157c89[_0x23318b(0x16b)]&&!_0x157c89[_0x23318b(0x19f)])[_0x23318b(0x17d)],_0x1572b3=Array['from'](_0x443047[_0x23318b(0x193)]())['reduce']((_0x1e1da8,_0x3f1650)=>_0x1e1da8+_0x3f1650[_0x23318b(0x17d)],0x0);return{'parentName':_0x3d2b9d,'parentId':_0x239210,'targetDir':_0x32b791,'files':_0x51e7dc,'counts':{'segments':_0x3f2628[_0x23318b(0x17d)],'journeys':_0x443047['size'],'journeyVersions':_0x1572b3,'activations':_0x48d222},'newFiles':_0x707a74,'changedFiles':_0x4a46f7,'unchangedFiles':_0x599fee};}function createYamlContextForBundle(_0x58297b,_0x17fca3,_0x25d5ad,_0x40d218,_0x3cdde0,_0x38c9c7){const _0x140ff1=new Set(),_0x4e5b1a=new Map(),_0x3d3a76=new Map(),_0x8d7d8d=createJumpTargetCache(),_0x55cd8b=async(_0x3047d2,_0x4c6a25)=>{const _0x5b0035=a153_0x4b05,_0x8d9d43=_0x4e5b1a[_0x5b0035(0x170)](_0x3047d2);if(_0x8d9d43!==undefined)return _0x8d9d43;if(!_0x4c6a25)return _0x3047d2;try{let _0x35845f=_0x17fca3[_0x5b0035(0x170)](_0x3047d2);!_0x35845f&&(_0x35845f=await _0x58297b[_0x5b0035(0x186)]['getSegment'](_0x4c6a25,_0x3047d2),_0x17fca3[_0x5b0035(0x19c)](_0x3047d2,_0x35845f));const _0x19f5a4=generateJourneyLocalName(_0x35845f[_0x5b0035(0x179)]),_0x1b198e=_0x35845f[_0x5b0035(0x177)]===SEGMENT_KIND_JOURNEY&&_0x19f5a4!==undefined;if(_0x1b198e&&_0x19f5a4){let _0x56e83b=_0x19f5a4,_0x22be3b=0x2;while(_0x140ff1[_0x5b0035(0x19a)](_0x56e83b)){_0x56e83b=_0x19f5a4+'_'+_0x22be3b,_0x22be3b++;}return _0x140ff1['add'](_0x56e83b),_0x4e5b1a[_0x5b0035(0x19c)](_0x3047d2,_0x56e83b),_0x56e83b;}return _0x35845f[_0x5b0035(0x179)];}catch{return _0x3047d2;}},_0x124d92=(_0x2d1913,_0x533ce9)=>({'resolveSegment':async _0x1d20e5=>{const _0x583480=a153_0x4b05,_0x4f6a5c=_0x4e5b1a['get'](_0x1d20e5);if(_0x4f6a5c!==undefined)return{'name':_0x4f6a5c,'isJourneyLocal':!![]};if(!_0x533ce9)return{'name':_0x1d20e5,'isJourneyLocal':![]};try{let _0x133c5f=_0x17fca3[_0x583480(0x170)](_0x1d20e5);!_0x133c5f&&(_0x133c5f=await _0x58297b['segment']['getSegment'](_0x533ce9,_0x1d20e5),_0x17fca3[_0x583480(0x19c)](_0x1d20e5,_0x133c5f));const _0x39c64e=generateJourneyLocalName(_0x133c5f[_0x583480(0x179)]),_0xb48d44=_0x133c5f[_0x583480(0x177)]===SEGMENT_KIND_JOURNEY&&_0x39c64e!==undefined;if(_0xb48d44&&!_0x133c5f[_0x583480(0x197)]&&_0x533ce9)try{const _0x3d0b0b=await _0x58297b[_0x583480(0x186)][_0x583480(0x167)](_0x533ce9,_0x1d20e5);_0x17fca3[_0x583480(0x19c)](_0x1d20e5,_0x3d0b0b),_0x133c5f=_0x3d0b0b;}catch{}const _0x31cdcc=await _0x55cd8b(_0x1d20e5,_0x533ce9);let _0x2d437a;if(_0xb48d44&&_0x133c5f[_0x583480(0x197)]){const _0x4f6499=await segmentResponseToDef(_0x133c5f,{'resolveSegmentName':_0x4e86b7=>_0x55cd8b(_0x4e86b7,_0x533ce9)});_0x2d437a={'description':_0x133c5f[_0x583480(0x192)],'rule':_0x4f6499[_0x583480(0x197)]};}return{'name':_0x31cdcc,'isJourneyLocal':_0xb48d44,'definition':_0x2d437a};}catch{return{'name':_0x1d20e5,'isJourneyLocal':![]};}},'resolveActivation':async _0x257d5e=>{const _0x474ccd=a153_0x4b05,_0xf10929=_0x3d3a76['get'](_0x257d5e);if(_0xf10929!==undefined)return{'name':_0xf10929,'isJourneyLocal':!![]};try{let _0x399e9b=_0x3cdde0[_0x474ccd(0x170)](_0x257d5e);!_0x399e9b&&(_0x399e9b=await _0x58297b[_0x474ccd(0x162)]['getActivation'](_0x2d1913,_0x257d5e));const _0x3353f0=_0x399e9b[_0x474ccd(0x16c)][_0x474ccd(0x180)]['name']||_0x257d5e,_0x2a07af=sanitizeYamlKey(_0x3353f0)||_0x474ccd(0x160)+_0x257d5e,_0x59feb0=_0x2a07af;_0x3d3a76['set'](_0x257d5e,_0x59feb0);const _0x3a4bed=journeyActivationStepToYaml(_0x399e9b,_0x25d5ad,_0x40d218);return{'name':_0x59feb0,'isJourneyLocal':!![],'definition':_0x3a4bed};}catch{return{'name':_0x257d5e,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x48cc1d,_0x37915a)=>resolveJumpTarget(_0x48cc1d,_0x37915a,_0x8d7d8d,async _0x38b68d=>{const _0x3c05dc=a153_0x4b05,_0x56eed1=_0x38c9c7['get'](_0x38b68d);if(_0x56eed1)return _0x56eed1;return _0x58297b[_0x3c05dc(0x162)]['getJourney'](_0x38b68d);})});return{'createYamlContext':_0x124d92};}
1
+ (function(_0x2b6c5b,_0x442389){const _0x3be081=a153_0x144d,_0x3fc2db=_0x2b6c5b();while(!![]){try{const _0x5872e8=parseInt(_0x3be081(0x16f))/0x1+parseInt(_0x3be081(0x137))/0x2*(parseInt(_0x3be081(0x13f))/0x3)+parseInt(_0x3be081(0x167))/0x4*(parseInt(_0x3be081(0x14b))/0x5)+parseInt(_0x3be081(0x133))/0x6+parseInt(_0x3be081(0x13b))/0x7+parseInt(_0x3be081(0x131))/0x8*(-parseInt(_0x3be081(0x176))/0x9)+parseInt(_0x3be081(0x149))/0xa*(-parseInt(_0x3be081(0x15d))/0xb);if(_0x5872e8===_0x442389)break;else _0x3fc2db['push'](_0x3fc2db['shift']());}catch(_0x2ef2a1){_0x3fc2db['push'](_0x3fc2db['shift']());}}}(a153_0x4acb,0x688d3));import a153_0x2d1145 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';function a153_0x144d(_0x1eca09,_0x336155){_0x1eca09=_0x1eca09-0x129;const _0x4acb56=a153_0x4acb();let _0x144de3=_0x4acb56[_0x1eca09];return _0x144de3;}import{journeyResponseToDef,toYamlString as a153_0x296e56,normalizeJourneyDef,parseYamlString as a153_0x4ddbaa}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 a153_0x4acb(){const _0x16d419=['rule','.yml','11KivTMm','Resolving\x20parent\x20segment','activationParams','push','get','values','update','listFolders','toLowerCase','buildIdToEmailMap','1764044KAoXhi','user','has','updatedAt','Processing\x20journey:\x20','getJourney','versionNumber','segment','136348GjEjJZ','all','Warning:\x20Journey\x20','filter','getParent','connection','resolveParentId','9pPjiAi','Fetching\x20activations','kind','size','journey','utf-8','parentFolder','isNew','folderId','5288952RLYcTr','buildIdToNameMap','4230384yimLiC','journeyBundleId','add','targetResourceName','102314khGYSf','audienceId','Fetching\x20users\x20and\x20connections','name','3991239ZqvYCs','listActivations','reduce','listJourneysWithDetailsFromParentSegment','42LdWcPm','journeyBundleName','hasChanges','set','listSegments','data','attributes','getSegment','segmentFolderId','sort','14794360EcNKac','segments/','5ztyRck','clear','join','tdx.json','description','paused','getActivation','state','relative','Fetching\x20parent\x20segment\x20info','map','relationships','from','createdAt','length','activation_'];a153_0x4acb=function(){return _0x16d419;};return a153_0x4acb();}function prepareFile(_0x579ffa,_0x23f09b,_0x1d923a){const _0x36055c=a153_0x144d,_0x416968=a153_0x2d1145[_0x36055c(0x153)](_0x1d923a,_0x579ffa);if(existsSync(_0x579ffa)){const _0x31f900=readFileSync(_0x579ffa,_0x36055c(0x12d)),_0x304613=generateDiff(_0x31f900,_0x23f09b),_0x2bbff0=hasChanges(_0x304613);return{'relativePath':_0x416968,'absolutePath':_0x579ffa,'content':_0x23f09b,'isNew':![],'hasChanges':_0x2bbff0,'diff':_0x2bbff0?formatDiffWithColors(_0x304613):undefined};}return{'relativePath':_0x416968,'absolutePath':_0x579ffa,'content':_0x23f09b,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x2764a4,_0x5009d7,_0x31d199){const _0x131604=a153_0x144d,_0x8a103f=_0x2764a4+':'+_0x5009d7,_0x2edcf0=_0x31d199[_0x131604(0x161)](_0x8a103f)||0x0;_0x31d199[_0x131604(0x142)](_0x8a103f,_0x2edcf0+0x1);if(_0x2edcf0===0x0)return _0x5009d7;return _0x5009d7+'_'+(_0x2edcf0+0x1);}export async function pullSegments(_0x3f09a3,_0xe164ec,_0x1bb4b1={}){const _0x33c86a=a153_0x144d,{targetDir:_0x473c1b,progress:_0x3db0d8}=_0x1bb4b1;_0x3db0d8?.['update'](_0x33c86a(0x15e));const _0x453482=await _0x3f09a3[_0x33c86a(0x16e)][_0x33c86a(0x175)](_0xe164ec);_0x3db0d8?.['update'](_0x33c86a(0x154));const _0x247631=await _0x3f09a3['segment'][_0x33c86a(0x173)](_0x453482),_0x25f689=_0x247631[_0x33c86a(0x145)][_0x33c86a(0x13a)];_0x3db0d8?.[_0x33c86a(0x163)]('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x48d240,_0x38bcd3,_0x47435a]=await Promise[_0x33c86a(0x170)]([_0x3f09a3[_0x33c86a(0x16e)][_0x33c86a(0x143)](_0x453482),_0x3f09a3[_0x33c86a(0x16e)][_0x33c86a(0x164)](_0x453482),_0x3f09a3[_0x33c86a(0x12c)][_0x33c86a(0x13e)](_0x453482,{'includeAllVersions':!![]})]),{journeys:_0x217a3c,activationStepsById:_0x2be971}=_0x47435a,_0xc02b2e=new Map();for(const _0x47ff91 of _0x217a3c){_0xc02b2e[_0x33c86a(0x142)](_0x47ff91['id'],_0x47ff91);}const _0x2d842c=_0x217a3c[_0x33c86a(0x155)](_0xdfbd93=>({'id':_0xdfbd93['id'],'name':_0xdfbd93[_0x33c86a(0x145)]['name'],'journeyBundleName':_0xdfbd93[_0x33c86a(0x145)][_0x33c86a(0x140)]||'','journeyBundleId':_0xdfbd93[_0x33c86a(0x145)]['journeyBundleId']||'','versionNumber':_0xdfbd93[_0x33c86a(0x145)][_0x33c86a(0x16d)],'description':_0xdfbd93[_0x33c86a(0x145)]['description'],'state':_0xdfbd93[_0x33c86a(0x145)][_0x33c86a(0x152)],'paused':_0xdfbd93[_0x33c86a(0x145)][_0x33c86a(0x150)],'audienceId':_0xdfbd93[_0x33c86a(0x145)][_0x33c86a(0x138)],'folderId':_0xdfbd93[_0x33c86a(0x156)]?.[_0x33c86a(0x12e)]?.[_0x33c86a(0x144)]?.['id'],'createdAt':_0xdfbd93['attributes'][_0x33c86a(0x158)],'updatedAt':_0xdfbd93[_0x33c86a(0x145)][_0x33c86a(0x16a)]})),_0x150158=buildFolderIdToPathMap(_0x38bcd3),_0x44d5e6=_0x473c1b||_0x33c86a(0x14a)+sanitizeFileName(_0x25f689);_0x3db0d8?.[_0x33c86a(0x163)](_0x33c86a(0x129));const _0x4170a5=new Map();await batchAsync(_0x48d240,async _0x3528c4=>{const _0xfbb88e=_0x33c86a,_0x1ddfcf=await _0x3f09a3[_0xfbb88e(0x16e)][_0xfbb88e(0x13c)](_0x453482,_0x3528c4['id']);_0x4170a5[_0xfbb88e(0x142)](_0x3528c4['id'],_0x1ddfcf);}),_0x3db0d8?.[_0x33c86a(0x163)](_0x33c86a(0x139));const [_0x171371,_0x3fb347]=await Promise['all']([_0x3f09a3[_0x33c86a(0x168)][_0x33c86a(0x166)](),_0x3f09a3[_0x33c86a(0x174)][_0x33c86a(0x132)]()]),_0x23a106=[],_0x5a4e2a=new Map(),_0x2a6116=a153_0x2d1145[_0x33c86a(0x14d)](_0x44d5e6,_0x33c86a(0x14e)),_0x3ed678=createTdxConfigContent(_0x25f689);_0x23a106[_0x33c86a(0x160)](prepareFile(_0x2a6116,_0x3ed678,_0x44d5e6));const _0x129305=new Map();for(const _0x289d4e of _0x48d240){_0x129305['set'](_0x289d4e['id'],_0x289d4e);}let _0x49f17f=_0x48d240;if(_0x1bb4b1[_0x33c86a(0x136)]){const _0x519e0e=_0x48d240[_0x33c86a(0x172)](_0x3c3ff2=>_0x3c3ff2[_0x33c86a(0x13a)][_0x33c86a(0x165)]()===_0x1bb4b1[_0x33c86a(0x136)][_0x33c86a(0x165)]());_0x519e0e['length']>0x0&&(_0x49f17f=_0x519e0e);}_0x3db0d8?.[_0x33c86a(0x163)]('Processing\x20segments');for(const _0x1551eb of _0x49f17f){if(_0x1551eb[_0x33c86a(0x12a)]===SEGMENT_KIND_JOURNEY)continue;const _0x2fbfbb=_0x1551eb[_0x33c86a(0x147)]?_0x150158['get'](_0x1551eb[_0x33c86a(0x147)])||'':'',_0x39207b=_0x4170a5[_0x33c86a(0x161)](_0x1551eb['id'])||[],_0x27d294=segmentWithActivationsToYaml(_0x1551eb,_0x39207b,undefined,_0x171371,_0x3fb347),_0x6cd4c6=_0x2fbfbb?a153_0x2d1145[_0x33c86a(0x14d)](_0x44d5e6,_0x2fbfbb):_0x44d5e6,_0x103842=sanitizeFileName(_0x1551eb[_0x33c86a(0x13a)]),_0x1b61b9=getUniqueFileName(_0x6cd4c6,_0x103842,_0x5a4e2a),_0x323403=a153_0x2d1145[_0x33c86a(0x14d)](_0x6cd4c6,_0x1b61b9+'.yml'),_0x16180c=segmentToYamlString(_0x27d294);_0x23a106[_0x33c86a(0x160)](prepareFile(_0x323403,_0x16180c,_0x44d5e6));}const _0x18fce1=new Map();for(const _0x1cc7f1 of _0x2d842c){const _0x212e00=_0x1cc7f1[_0x33c86a(0x134)];!_0x18fce1[_0x33c86a(0x169)](_0x212e00)&&_0x18fce1[_0x33c86a(0x142)](_0x212e00,[]),_0x18fce1[_0x33c86a(0x161)](_0x212e00)[_0x33c86a(0x160)](_0x1cc7f1);}for(const _0x156b12 of _0x18fce1[_0x33c86a(0x162)]()){_0x156b12[_0x33c86a(0x148)]((_0x3755fa,_0x236a1e)=>(_0x3755fa[_0x33c86a(0x16d)]||0x0)-(_0x236a1e[_0x33c86a(0x16d)]||0x0));}if(_0x1bb4b1[_0x33c86a(0x136)]){const _0x1dcde9=new Map();for(const [_0x593276,_0x38a859]of _0x18fce1){const _0x1cbfb5=_0x38a859[0x0][_0x33c86a(0x140)];if(_0x1cbfb5[_0x33c86a(0x165)]()===_0x1bb4b1['targetResourceName'][_0x33c86a(0x165)]()){_0x1dcde9[_0x33c86a(0x142)](_0x593276,_0x38a859);break;}}_0x18fce1[_0x33c86a(0x14c)]();for(const [_0x417618,_0x5ab7db]of _0x1dcde9){_0x18fce1['set'](_0x417618,_0x5ab7db);}}if(_0x18fce1[_0x33c86a(0x12b)]>0x0){_0x3db0d8?.['update']('Processing\x20journeys');const _0x844a91=Array[_0x33c86a(0x157)](_0x18fce1['values']()),_0x168893=0x5,{createYamlContext:_0x5570cd}=createYamlContextForBundle(_0x3f09a3,_0x129305,_0x171371,_0x3fb347,_0x2be971,_0xc02b2e);for(let _0x158620=0x0;_0x158620<_0x844a91[_0x33c86a(0x159)];_0x158620+=_0x168893){const _0x19f80a=_0x844a91['slice'](_0x158620,_0x158620+_0x168893),_0x4456fe=await Promise[_0x33c86a(0x170)](_0x19f80a['map'](async _0x1f0672=>{const _0x1a5f79=_0x33c86a,_0x9497ee=_0x1f0672[0x0],_0x476ac7=_0x9497ee[_0x1a5f79(0x140)];_0x3db0d8?.[_0x1a5f79(0x163)](_0x1a5f79(0x16b)+_0x476ac7);const _0x4e5f60=_0x9497ee[_0x1a5f79(0x130)]?_0x150158[_0x1a5f79(0x161)](_0x9497ee[_0x1a5f79(0x130)])||'':'',_0x226569=_0x4e5f60?a153_0x2d1145[_0x1a5f79(0x14d)](_0x44d5e6,_0x4e5f60):_0x44d5e6,_0x2acb44=sanitizeFileName(_0x476ac7),_0x215186=a153_0x2d1145[_0x1a5f79(0x14d)](_0x226569,_0x2acb44+_0x1a5f79(0x15c));let _0x38b088;if(existsSync(_0x215186))try{const _0x22fad4=readFileSync(_0x215186,'utf-8'),_0x514374=a153_0x4ddbaa(_0x22fad4);_0x38b088=buildLocalRuleToNameMappingFromJourney(_0x514374);}catch{}const _0x383a8e=[];for(const _0x4e5858 of _0x1f0672){const _0x8fc01e=_0xc02b2e[_0x1a5f79(0x161)](_0x4e5858['id']);if(!_0x8fc01e){_0x3db0d8?.[_0x1a5f79(0x163)](_0x1a5f79(0x171)+_0x4e5858['id']+'\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping');continue;}const _0x1f5325=_0x8fc01e[_0x1a5f79(0x145)]?.['audienceId'],_0x2fc2b8=_0x5570cd(_0x4e5858['id'],_0x1f5325),_0x5da753=await journeyResponseToDef(_0x8fc01e,_0x2fc2b8);_0x383a8e[_0x1a5f79(0x160)]({'item':_0x4e5858,'yaml':_0x5da753});}const _0x38b1dc=await _0x3f09a3[_0x1a5f79(0x12c)]['getLatestJourneyId'](_0x9497ee[_0x1a5f79(0x134)]),_0x5a2dee=buildMergedJourneyDef(_0x383a8e,_0x38b088,_0x38b1dc);return{'bundleName':_0x476ac7,'folderPath':_0x4e5f60,'finalYaml':_0x5a2dee};}));for(const {bundleName:_0x4aff32,folderPath:_0x55c2df,finalYaml:_0xce44ab}of _0x4456fe){const _0x16fce9=normalizeJourneyDef(_0xce44ab),_0x529fce=a153_0x296e56(_0x16fce9),_0x5e8cf7=_0x55c2df?a153_0x2d1145[_0x33c86a(0x14d)](_0x44d5e6,_0x55c2df):_0x44d5e6,_0x4f70be=sanitizeFileName(_0x4aff32),_0x3bfd78=getUniqueFileName(_0x5e8cf7,_0x4f70be,_0x5a4e2a),_0x36ecd2=a153_0x2d1145['join'](_0x5e8cf7,_0x3bfd78+_0x33c86a(0x15c));_0x23a106['push'](prepareFile(_0x36ecd2,_0x529fce,_0x44d5e6));}}}const _0x5a2069=Array[_0x33c86a(0x157)](_0x4170a5[_0x33c86a(0x162)]())[_0x33c86a(0x13d)]((_0x1ee178,_0x513266)=>_0x1ee178+_0x513266['length'],0x0),_0x5dc720=_0x49f17f[_0x33c86a(0x172)](_0x4ac4c1=>_0x4ac4c1[_0x33c86a(0x12a)]!==SEGMENT_KIND_JOURNEY),_0x1a77d8=_0x23a106['filter'](_0x1211d4=>_0x1211d4[_0x33c86a(0x12f)])['length'],_0x1d45f6=_0x23a106['filter'](_0xba261b=>!_0xba261b[_0x33c86a(0x12f)]&&_0xba261b['hasChanges'])[_0x33c86a(0x159)],_0x5a3355=_0x23a106['filter'](_0x1245ce=>!_0x1245ce[_0x33c86a(0x12f)]&&!_0x1245ce[_0x33c86a(0x141)])[_0x33c86a(0x159)],_0x476735=Array[_0x33c86a(0x157)](_0x18fce1[_0x33c86a(0x162)]())[_0x33c86a(0x13d)]((_0x191051,_0xabec9f)=>_0x191051+_0xabec9f[_0x33c86a(0x159)],0x0);return{'parentName':_0x25f689,'parentId':_0x453482,'targetDir':_0x44d5e6,'files':_0x23a106,'counts':{'segments':_0x5dc720[_0x33c86a(0x159)],'journeys':_0x18fce1[_0x33c86a(0x12b)],'journeyVersions':_0x476735,'activations':_0x5a2069},'newFiles':_0x1a77d8,'changedFiles':_0x1d45f6,'unchangedFiles':_0x5a3355};}function createYamlContextForBundle(_0x371c2c,_0x2dbe35,_0xf01de,_0x9b8b4c,_0x216aae,_0x1977df){const _0x47a8e6=new Set(),_0x16b708=new Map(),_0x212758=new Map(),_0x44b812=createJumpTargetCache(),_0x1efc22=async(_0x1eae19,_0x5b7aa7)=>{const _0x5e79cb=a153_0x144d,_0x1b9d13=_0x16b708['get'](_0x1eae19);if(_0x1b9d13!==undefined)return _0x1b9d13;if(!_0x5b7aa7)return _0x1eae19;try{let _0xc43871=_0x2dbe35[_0x5e79cb(0x161)](_0x1eae19);!_0xc43871&&(_0xc43871=await _0x371c2c['segment'][_0x5e79cb(0x146)](_0x5b7aa7,_0x1eae19),_0x2dbe35['set'](_0x1eae19,_0xc43871));const _0x1512ae=generateJourneyLocalName(_0xc43871[_0x5e79cb(0x13a)]),_0x50d8ae=_0xc43871[_0x5e79cb(0x12a)]===SEGMENT_KIND_JOURNEY&&_0x1512ae!==undefined;if(_0x50d8ae&&_0x1512ae){let _0x558c2d=_0x1512ae,_0x1e776d=0x2;while(_0x47a8e6[_0x5e79cb(0x169)](_0x558c2d)){_0x558c2d=_0x1512ae+'_'+_0x1e776d,_0x1e776d++;}return _0x47a8e6[_0x5e79cb(0x135)](_0x558c2d),_0x16b708[_0x5e79cb(0x142)](_0x1eae19,_0x558c2d),_0x558c2d;}return _0xc43871[_0x5e79cb(0x13a)];}catch{return _0x1eae19;}},_0x2dfb6e=(_0x55b6dd,_0x350dab)=>({'resolveSegment':async _0x32147b=>{const _0x3f3014=a153_0x144d,_0x224034=_0x16b708[_0x3f3014(0x161)](_0x32147b);if(_0x224034!==undefined)return{'name':_0x224034,'isJourneyLocal':!![]};if(!_0x350dab)return{'name':_0x32147b,'isJourneyLocal':![]};try{let _0x5c5141=_0x2dbe35[_0x3f3014(0x161)](_0x32147b);!_0x5c5141&&(_0x5c5141=await _0x371c2c['segment']['getSegment'](_0x350dab,_0x32147b),_0x2dbe35['set'](_0x32147b,_0x5c5141));const _0x5c40f5=generateJourneyLocalName(_0x5c5141[_0x3f3014(0x13a)]),_0x421b85=_0x5c5141['kind']===SEGMENT_KIND_JOURNEY&&_0x5c40f5!==undefined;if(_0x421b85&&!_0x5c5141[_0x3f3014(0x15b)]&&_0x350dab)try{const _0x15dba7=await _0x371c2c[_0x3f3014(0x16e)][_0x3f3014(0x146)](_0x350dab,_0x32147b);_0x2dbe35[_0x3f3014(0x142)](_0x32147b,_0x15dba7),_0x5c5141=_0x15dba7;}catch{}const _0x28d090=await _0x1efc22(_0x32147b,_0x350dab);let _0x7b3964;if(_0x421b85&&_0x5c5141[_0x3f3014(0x15b)]){const _0x46bea4=await segmentResponseToDef(_0x5c5141,{'resolveSegmentName':_0xb8ea08=>_0x1efc22(_0xb8ea08,_0x350dab)});_0x7b3964={'description':_0x5c5141[_0x3f3014(0x14f)],'rule':_0x46bea4[_0x3f3014(0x15b)]};}return{'name':_0x28d090,'isJourneyLocal':_0x421b85,'definition':_0x7b3964};}catch{return{'name':_0x32147b,'isJourneyLocal':![]};}},'resolveActivation':async _0x483a95=>{const _0x52f2b5=a153_0x144d,_0x2cc70f=_0x212758[_0x52f2b5(0x161)](_0x483a95);if(_0x2cc70f!==undefined)return{'name':_0x2cc70f,'isJourneyLocal':!![]};try{let _0x35de1f=_0x216aae['get'](_0x483a95);!_0x35de1f&&(_0x35de1f=await _0x371c2c['journey'][_0x52f2b5(0x151)](_0x55b6dd,_0x483a95));const _0x1916c7=_0x35de1f[_0x52f2b5(0x145)][_0x52f2b5(0x15f)][_0x52f2b5(0x13a)]||_0x483a95,_0x27001e=sanitizeYamlKey(_0x1916c7)||_0x52f2b5(0x15a)+_0x483a95,_0x62df18=_0x27001e;_0x212758[_0x52f2b5(0x142)](_0x483a95,_0x62df18);const _0x35a528=journeyActivationStepToYaml(_0x35de1f,_0xf01de,_0x9b8b4c);return{'name':_0x62df18,'isJourneyLocal':!![],'definition':_0x35a528};}catch{return{'name':_0x483a95,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2669c4,_0xdb8a61)=>resolveJumpTarget(_0x2669c4,_0xdb8a61,_0x44b812,async _0x5b0835=>{const _0x52c646=a153_0x144d,_0x5345c0=_0x1977df[_0x52c646(0x161)](_0x5b0835);if(_0x5345c0)return _0x5345c0;return _0x371c2c[_0x52c646(0x12c)][_0x52c646(0x16c)](_0x5b0835);})});return{'createYamlContext':_0x2dfb6e};}
@@ -1 +1 @@
1
- function a154_0x70cc(_0xa74253,_0x1d5e22){_0xa74253=_0xa74253-0x1cb;const _0x57a6f1=a154_0x57a6();let _0x70cccb=_0x57a6f1[_0xa74253];return _0x70cccb;}const a154_0x2becae=a154_0x70cc;function a154_0x57a6(){const _0x31f21b=['130uhzvTS','segments','code','980VGrMBE','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','12912XClGFZ','debug','version','dirname','utf-8','6KBRJwR','journeyName','tdx.sdk.push-recovery','.push-recovery.json','toISOString','warn','2670579GCpRbY','2oRkknk','513751BczqJD','496cSDjJm','join','parse','.tmp','472571CQUEOu','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','4706484sueLog','477258AseyWo','43569ilLDYy','ENOENT','stringify'];a154_0x57a6=function(){return _0x31f21b;};return a154_0x57a6();}(function(_0x3ce6b0,_0x414fc7){const _0x541cd1=a154_0x70cc,_0x27e701=_0x3ce6b0();while(!![]){try{const _0x39397b=-parseInt(_0x541cd1(0x1e5))/0x1+parseInt(_0x541cd1(0x1dc))/0x2*(parseInt(_0x541cd1(0x1db))/0x3)+-parseInt(_0x541cd1(0x1d0))/0x4*(-parseInt(_0x541cd1(0x1ce))/0x5)+parseInt(_0x541cd1(0x1d5))/0x6*(parseInt(_0x541cd1(0x1dd))/0x7)+-parseInt(_0x541cd1(0x1de))/0x8*(-parseInt(_0x541cd1(0x1e6))/0x9)+-parseInt(_0x541cd1(0x1cb))/0xa*(parseInt(_0x541cd1(0x1e2))/0xb)+-parseInt(_0x541cd1(0x1e4))/0xc;if(_0x39397b===_0x414fc7)break;else _0x27e701['push'](_0x27e701['shift']());}catch(_0x5495c8){_0x27e701['push'](_0x27e701['shift']());}}}(a154_0x57a6,0x725ea));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a154_0xdc8089 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a154_0x2becae(0x1d7));export function getPushRecoveryPath(_0x24b3ac){const _0x2b0323=a154_0x2becae,_0x12adb3=a154_0xdc8089[_0x2b0323(0x1d3)](_0x24b3ac),_0x1dc7e6=a154_0xdc8089['basename'](_0x24b3ac);return a154_0xdc8089[_0x2b0323(0x1df)](_0x12adb3,'.'+_0x1dc7e6+_0x2b0323(0x1d8));}export function readPushRecovery(_0x53e566){const _0x6168d1=a154_0x2becae,_0x5c501c=getPushRecoveryPath(_0x53e566);if(!existsSync(_0x5c501c))return undefined;try{const _0x2a393d=readFileSync(_0x5c501c,_0x6168d1(0x1d4)),_0x2d7881=JSON[_0x6168d1(0x1e0)](_0x2a393d);if(_0x2d7881?.[_0x6168d1(0x1d2)]!==0x1||typeof _0x2d7881[_0x6168d1(0x1d6)]!=='string')return undefined;return _0x2d7881;}catch(_0x15cb17){return _0x15cb17 instanceof SyntaxError?logger[_0x6168d1(0x1d1)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x15cb17):logger[_0x6168d1(0x1da)](_0x6168d1(0x1cf)+_0x15cb17),undefined;}}export function writePushRecovery(_0x4b8d1d,_0xf465bf){const _0xe3e642=a154_0x2becae,_0x4530c0=getPushRecoveryPath(_0x4b8d1d),_0x4f4f3f=_0x4530c0+_0xe3e642(0x1e1);writeFileSync(_0x4f4f3f,JSON[_0xe3e642(0x1e8)](_0xf465bf,null,0x2)+'\x0a',_0xe3e642(0x1d4)),renameSync(_0x4f4f3f,_0x4530c0);}export function deletePushRecovery(_0x4f1789){const _0xb4bd9f=a154_0x2becae,_0x26af05=getPushRecoveryPath(_0x4f1789);try{unlinkSync(_0x26af05);}catch(_0x52ba40){_0x52ba40[_0xb4bd9f(0x1cd)]!==_0xb4bd9f(0x1e7)&&logger[_0xb4bd9f(0x1d1)](_0xb4bd9f(0x1e3)+_0x52ba40);}}export function saveSegmentToPushRecovery(_0x2d7fa6,_0x2c8ec2,_0x29df80,_0x24c3ed){const _0x21f4eb=a154_0x2becae,_0x103549=readPushRecovery(_0x2d7fa6),_0x5bb3b2=_0x103549?.[_0x21f4eb(0x1d6)]===_0x2c8ec2?{..._0x103549,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x2c8ec2,'updatedAt':new Date()[_0x21f4eb(0x1d9)](),'segments':{}};_0x5bb3b2[_0x21f4eb(0x1cc)][_0x29df80]=_0x24c3ed,writePushRecovery(_0x2d7fa6,_0x5bb3b2);}
1
+ (function(_0x27d095,_0xd38d83){const _0x4645b4=a154_0x3c9d,_0x5481d7=_0x27d095();while(!![]){try{const _0x4f0616=-parseInt(_0x4645b4(0x1bc))/0x1+parseInt(_0x4645b4(0x1af))/0x2+-parseInt(_0x4645b4(0x1c3))/0x3*(-parseInt(_0x4645b4(0x1c4))/0x4)+-parseInt(_0x4645b4(0x1ad))/0x5+parseInt(_0x4645b4(0x1b1))/0x6+-parseInt(_0x4645b4(0x1b2))/0x7*(parseInt(_0x4645b4(0x1b9))/0x8)+parseInt(_0x4645b4(0x1c1))/0x9;if(_0x4f0616===_0xd38d83)break;else _0x5481d7['push'](_0x5481d7['shift']());}catch(_0x570a87){_0x5481d7['push'](_0x5481d7['shift']());}}}(a154_0x3f62,0x3e188));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a154_0xf9a604 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x5da0de){const _0xf57c5=a154_0x3c9d,_0x277ed9=a154_0xf9a604[_0xf57c5(0x1c2)](_0x5da0de),_0x4ce19c=a154_0xf9a604[_0xf57c5(0x1c6)](_0x5da0de);return a154_0xf9a604[_0xf57c5(0x1b4)](_0x277ed9,'.'+_0x4ce19c+'.push-recovery.json');}function a154_0x3c9d(_0x577f69,_0xe14978){_0x577f69=_0x577f69-0x1ad;const _0x3f625d=a154_0x3f62();let _0x3c9df5=_0x3f625d[_0x577f69];return _0x3c9df5;}export function readPushRecovery(_0x6e24b){const _0x5f9ed1=a154_0x3c9d,_0x289e74=getPushRecoveryPath(_0x6e24b);if(!existsSync(_0x289e74))return undefined;try{const _0x33dadd=readFileSync(_0x289e74,_0x5f9ed1(0x1bd)),_0x167fee=JSON['parse'](_0x33dadd);if(_0x167fee?.['version']!==0x1||typeof _0x167fee['journeyName']!==_0x5f9ed1(0x1c5))return undefined;return _0x167fee;}catch(_0x4ff0bb){return _0x4ff0bb instanceof SyntaxError?logger[_0x5f9ed1(0x1b6)](_0x5f9ed1(0x1b0)+_0x4ff0bb):logger[_0x5f9ed1(0x1b7)](_0x5f9ed1(0x1c0)+_0x4ff0bb),undefined;}}function a154_0x3f62(){const _0x555470=['4376CAygvr','segments','code','440085adXEvC','utf-8','toISOString','ENOENT','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','4922991eVfziM','dirname','12GOopRP','246620nBbysL','string','basename','1162045KiNngY','.tmp','179840jxBZqX','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','1300188kalmkO','2219tcyKHB','stringify','join','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','debug','warn','journeyName'];a154_0x3f62=function(){return _0x555470;};return a154_0x3f62();}export function writePushRecovery(_0x4c33d1,_0x1af8c6){const _0x267738=a154_0x3c9d,_0x46daaa=getPushRecoveryPath(_0x4c33d1),_0x53bdbb=_0x46daaa+_0x267738(0x1ae);writeFileSync(_0x53bdbb,JSON[_0x267738(0x1b3)](_0x1af8c6,null,0x2)+'\x0a',_0x267738(0x1bd)),renameSync(_0x53bdbb,_0x46daaa);}export function deletePushRecovery(_0x3e4633){const _0x1c2cf3=a154_0x3c9d,_0x20bd06=getPushRecoveryPath(_0x3e4633);try{unlinkSync(_0x20bd06);}catch(_0x405db0){_0x405db0[_0x1c2cf3(0x1bb)]!==_0x1c2cf3(0x1bf)&&logger['debug'](_0x1c2cf3(0x1b5)+_0x405db0);}}export function saveSegmentToPushRecovery(_0x1b81cb,_0x236fbc,_0x2ac1d7,_0x4c635d){const _0x35fc44=a154_0x3c9d,_0x5a7aea=readPushRecovery(_0x1b81cb),_0x56ff5e=_0x5a7aea?.[_0x35fc44(0x1b8)]===_0x236fbc?{..._0x5a7aea,'updatedAt':new Date()[_0x35fc44(0x1be)]()}:{'version':0x1,'journeyName':_0x236fbc,'updatedAt':new Date()[_0x35fc44(0x1be)](),'segments':{}};_0x56ff5e[_0x35fc44(0x1ba)][_0x2ac1d7]=_0x4c635d,writePushRecovery(_0x1b81cb,_0x56ff5e);}