@treasuredata/tdx 2026.3.51 → 2026.3.52

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 (218) 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-pull-command.js +1 -1
  43. package/dist/commands/segment-push-command.js +1 -1
  44. package/dist/commands/segment-update-command.js +1 -1
  45. package/dist/commands/segment-use-command.js +1 -1
  46. package/dist/commands/segment-validate-command.js +1 -1
  47. package/dist/commands/segments.js +1 -1
  48. package/dist/commands/show.js +1 -1
  49. package/dist/commands/status-command.js +1 -1
  50. package/dist/commands/tables.js +1 -1
  51. package/dist/commands/unset-command.js +1 -1
  52. package/dist/commands/upgrade-command.js +1 -1
  53. package/dist/commands/use-command.js +1 -1
  54. package/dist/commands/user-command.js +1 -1
  55. package/dist/commands/work-command.js +1 -1
  56. package/dist/commands/workflow-command.js +1 -1
  57. package/dist/core/auth.js +1 -1
  58. package/dist/core/command-output.js +1 -1
  59. package/dist/core/config.js +1 -1
  60. package/dist/core/connection-cache.js +1 -1
  61. package/dist/core/constants.js +1 -1
  62. package/dist/core/credential-cache.js +1 -1
  63. package/dist/core/global-context.js +1 -1
  64. package/dist/core/keychain.js +1 -1
  65. package/dist/core/oauth-keychain.js +1 -1
  66. package/dist/core/oauth.js +1 -1
  67. package/dist/core/profile.js +1 -1
  68. package/dist/core/project-config.js +1 -1
  69. package/dist/core/session.js +1 -1
  70. package/dist/core/user-cache.js +1 -1
  71. package/dist/core/version.js +1 -1
  72. package/dist/index.js +1 -1
  73. package/dist/mcp/server.js +1 -1
  74. package/dist/mcp/tools/index.js +1 -1
  75. package/dist/mcp/tools/tdx-run.js +1 -1
  76. package/dist/mcp/tools/tdx-search.js +1 -1
  77. package/dist/mcp/utils.js +1 -1
  78. package/dist/proxy/claude-usage-tracker.js +1 -1
  79. package/dist/proxy/passthrough-server.js +1 -1
  80. package/dist/proxy/sse-usage-parser.js +1 -1
  81. package/dist/sdk/agent/agent-config.js +1 -1
  82. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  83. package/dist/sdk/agent/agent-yaml.js +1 -1
  84. package/dist/sdk/agent/test/evaluator.js +1 -1
  85. package/dist/sdk/agent/test/executor.js +1 -1
  86. package/dist/sdk/agent/test/index.js +1 -1
  87. package/dist/sdk/agent/test/output.js +1 -1
  88. package/dist/sdk/agent/test/parser.js +1 -1
  89. package/dist/sdk/agent/tool-target-registry.js +1 -1
  90. package/dist/sdk/api.js +1 -1
  91. package/dist/sdk/cas/cas-api-client.js +1 -1
  92. package/dist/sdk/cas/cas-audience-yaml.js +1 -1
  93. package/dist/sdk/cas/cas-segment-yaml.js +1 -1
  94. package/dist/sdk/cas/index.js +1 -1
  95. package/dist/sdk/cas/pull-workflow.js +1 -1
  96. package/dist/sdk/cas/push-workflow.js +1 -1
  97. package/dist/sdk/client/cdp-api-client.js +1 -1
  98. package/dist/sdk/client/delivery-api-client.js +1 -1
  99. package/dist/sdk/client/endpoints.js +1 -1
  100. package/dist/sdk/client/engage-api-client.js +1 -1
  101. package/dist/sdk/client/http-client.js +1 -1
  102. package/dist/sdk/client/llm-api-client.js +1 -1
  103. package/dist/sdk/client/oauth-refresh.js +1 -1
  104. package/dist/sdk/client/rate-limiter.js +1 -1
  105. package/dist/sdk/client/td-api-client.js +1 -1
  106. package/dist/sdk/client/trino-api-client.js +1 -1
  107. package/dist/sdk/client/workflow-client.js +1 -1
  108. package/dist/sdk/connection-validator.js +1 -1
  109. package/dist/sdk/connection.js +1 -1
  110. package/dist/sdk/delivery.js +1 -1
  111. package/dist/sdk/engage/campaign-pull.js +1 -1
  112. package/dist/sdk/engage/campaign-push.js +1 -1
  113. package/dist/sdk/engage/campaign-validator.js +1 -1
  114. package/dist/sdk/engage/campaign-yaml.js +1 -1
  115. package/dist/sdk/engage/template-pull.js +1 -1
  116. package/dist/sdk/engage/template-push.js +1 -1
  117. package/dist/sdk/engage/template-validator.js +1 -1
  118. package/dist/sdk/engage/template-yaml.js +1 -1
  119. package/dist/sdk/engage/types/campaign-def.js +1 -1
  120. package/dist/sdk/engage/types/campaign-schema.js +1 -1
  121. package/dist/sdk/engage/types/template-schema.js +1 -1
  122. package/dist/sdk/engage.js +1 -1
  123. package/dist/sdk/errors.js +1 -1
  124. package/dist/sdk/index.js +1 -1
  125. package/dist/sdk/io/index.js +1 -1
  126. package/dist/sdk/io/node-filesystem.js +1 -1
  127. package/dist/sdk/job.js +1 -1
  128. package/dist/sdk/journey.js +1 -1
  129. package/dist/sdk/llm/chat-cache.js +1 -1
  130. package/dist/sdk/llm/index.js +1 -1
  131. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  132. package/dist/sdk/llm/model-factors.js +1 -1
  133. package/dist/sdk/personalization.js +1 -1
  134. package/dist/sdk/policy.js +1 -1
  135. package/dist/sdk/query/index.js +1 -1
  136. package/dist/sdk/query/sql-parser.js +1 -1
  137. package/dist/sdk/realtime.js +1 -1
  138. package/dist/sdk/schedule.js +1 -1
  139. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  140. package/dist/sdk/segment/fields-display.js +1 -1
  141. package/dist/sdk/segment/file-discovery.js +1 -1
  142. package/dist/sdk/segment/journey-utils.js +1 -1
  143. package/dist/sdk/segment/journey-validator.js +1 -1
  144. package/dist/sdk/segment/journey-yaml.js +1 -1
  145. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  146. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  147. package/dist/sdk/segment/pull-workflow.js +1 -1
  148. package/dist/sdk/segment/push-recovery.js +1 -1
  149. package/dist/sdk/segment/push-workflow.js +1 -1
  150. package/dist/sdk/segment/resolution-context.js +1 -1
  151. package/dist/sdk/segment/segment-path-parser.js +1 -1
  152. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  153. package/dist/sdk/segment/segment-validator.js +1 -1
  154. package/dist/sdk/segment/target-resolution.js +1 -1
  155. package/dist/sdk/segment/tdx-config.js +1 -1
  156. package/dist/sdk/segment/types/activation-schema.js +1 -1
  157. package/dist/sdk/segment/types/journey-def.js +1 -1
  158. package/dist/sdk/segment/types/journey-schema.js +1 -1
  159. package/dist/sdk/segment/types/segment-def.js +1 -1
  160. package/dist/sdk/segment/types/segment-schema.js +1 -1
  161. package/dist/sdk/segment/validate-files.js +1 -1
  162. package/dist/sdk/segment/yaml-validator.js +1 -1
  163. package/dist/sdk/segment.js +1 -1
  164. package/dist/sdk/types/index.js +1 -1
  165. package/dist/sdk/types/progress.js +1 -1
  166. package/dist/sdk/types/workspace.js +1 -1
  167. package/dist/sdk/user.js +1 -1
  168. package/dist/sdk/util/format-detector.js +1 -1
  169. package/dist/sdk/util/formatters.js +1 -1
  170. package/dist/sdk/util/index.js +1 -1
  171. package/dist/sdk/util/paginate.js +1 -1
  172. package/dist/sdk/util/tree-formatter.js +1 -1
  173. package/dist/sdk/workflow/archive-validation.js +1 -1
  174. package/dist/sdk/workflow/clone-workflow.js +1 -1
  175. package/dist/sdk/workflow/index.js +1 -1
  176. package/dist/sdk/workflow/pull-workflow.js +1 -1
  177. package/dist/sdk/workflow/push-workflow.js +1 -1
  178. package/dist/sdk/workflow/tdx-config.js +1 -1
  179. package/dist/sdk/workflow/workflow-utils.js +1 -1
  180. package/dist/sdk/workspace/frontmatter.js +1 -1
  181. package/dist/sdk/workspace/git.js +1 -1
  182. package/dist/sdk/workspace/index.js +1 -1
  183. package/dist/sdk/workspace/templates.js +1 -1
  184. package/dist/sdk/workspace/weekly.js +1 -1
  185. package/dist/sdk/workspace/wikilinks.js +1 -1
  186. package/dist/test-utils/command-runner.js +1 -1
  187. package/dist/test-utils/factories.js +1 -1
  188. package/dist/test-utils/fixtures.js +1 -1
  189. package/dist/test-utils/http-mock.js +1 -1
  190. package/dist/test-utils/index.js +1 -1
  191. package/dist/utils/async.js +1 -1
  192. package/dist/utils/colors.js +1 -1
  193. package/dist/utils/diff.js +1 -1
  194. package/dist/utils/file-permissions.js +1 -1
  195. package/dist/utils/file-reader.js +1 -1
  196. package/dist/utils/github-releases.js +1 -1
  197. package/dist/utils/global-cache.js +1 -1
  198. package/dist/utils/json-loader.js +1 -1
  199. package/dist/utils/local-cache.js +1 -1
  200. package/dist/utils/logger/formatters/default-formatter.js +1 -1
  201. package/dist/utils/logger/formatters/index.js +1 -1
  202. package/dist/utils/logger/handlers/console-handler.js +1 -1
  203. package/dist/utils/logger/handlers/file-handler.js +1 -1
  204. package/dist/utils/logger/handlers/index.js +1 -1
  205. package/dist/utils/logger/handlers/null-handler.js +1 -1
  206. package/dist/utils/logger/index.js +1 -1
  207. package/dist/utils/logger/logger.js +1 -1
  208. package/dist/utils/logger/types.js +1 -1
  209. package/dist/utils/option-validation.js +1 -1
  210. package/dist/utils/process.js +1 -1
  211. package/dist/utils/prompt.js +1 -1
  212. package/dist/utils/spinner.js +1 -1
  213. package/dist/utils/sse-parser.js +1 -1
  214. package/dist/utils/string-utils.js +1 -1
  215. package/dist/utils/table-ref-parser.js +1 -1
  216. package/dist/utils/tdx-logger.js +1 -1
  217. package/dist/utils/version-check.js +1 -1
  218. package/package.json +1 -1
@@ -1 +1 @@
1
- (function(_0x7b9800,_0x4980fd){const _0x4e9392=a148_0x326f,_0x1fadef=_0x7b9800();while(!![]){try{const _0x357272=-parseInt(_0x4e9392(0xe5))/0x1+parseInt(_0x4e9392(0xfa))/0x2+-parseInt(_0x4e9392(0x131))/0x3*(-parseInt(_0x4e9392(0xf2))/0x4)+-parseInt(_0x4e9392(0xfd))/0x5+-parseInt(_0x4e9392(0x112))/0x6+-parseInt(_0x4e9392(0xee))/0x7+parseInt(_0x4e9392(0x101))/0x8;if(_0x357272===_0x4980fd)break;else _0x1fadef['push'](_0x1fadef['shift']());}catch(_0x222e36){_0x1fadef['push'](_0x1fadef['shift']());}}}(a148_0xd3ac,0x45974));function a148_0x326f(_0xd7eada,_0x15739d){_0xd7eada=_0xd7eada-0xc8;const _0xd3ac7=a148_0xd3ac();let _0x326f8=_0xd3ac7[_0xd7eada];return _0x326f8;}import*as a148_0x3ddf14 from'yaml';function a148_0xd3ac(){const _0x5b7520=['id_stitching','YAML\x20config\x20missing\x20required\x20field:\x20master.table','1729847cDZvwj','database','match','number','4jhYLkm','source','string','column','padStart','realtime:','attribute_table','columnName','506134DIXOTM',':00','customerGroupAttributes','677645CUROcQ','prestoPoolName','name','hivePoolName','7463056iShgVL','includes','null','schedule','columns','defaultTimeFilterEnabled','trino_pool','filters','foreignKey','YAML\x20config\x20missing\x20required\x20field:\x20master','imported_batch','realtime.events[','Example\x20Events','personalization_services','split',':00:00','hive_pool','2090874ncubJD','parentDatabaseName','floor','scheduleOption','workflowHiveOnly','replace','behaviors','engine','scheduleType','isRealtime','isArray','personalization_services\x20must\x20be\x20an\x20array','customerGroup','timezone','user_id','customerGroupBehaviors','length','table','default_time_filter','groupingName','daily','engine:','master:','allColumns','stringify','push','parentKey','Example\x20Attributes','Display\x20Name','join','rightValues','137388hZkAqb','customer_group:','):\x20Invalid\x20type\x20\x27','map','set','customer_id','list','\x27.\x20Must\x20be\x20one\x20of:\x20','parentTableName','parent_key','personalization_services:','audienceFilters','Parent\x20segment\x20description','realtime','label','child_key','time','realtime.attributes[','events_table','attributes','attributes:','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','counter','YAML\x20config\x20missing\x20required\x20field:\x20master.database','hive_only','type','has','none','values','schema','behaviors:','test','parentColumn','forEach',']:\x20Missing\x20required\x20field\x20\x27name\x27','215572PihNgk','all_columns','events','master','primary_key','single','description'];a148_0xd3ac=function(){return _0x5b7520;};return a148_0xd3ac();}function formatScheduleTime(_0x1fc2b7){const _0x9e8e3a=a148_0x326f;if(typeof _0x1fc2b7===_0x9e8e3a(0xf1)){const _0xb02b7a=Math[_0x9e8e3a(0x114)](_0x1fc2b7);return String(_0xb02b7a)[_0x9e8e3a(0xf6)](0x2,'0')+_0x9e8e3a(0x110);}if(typeof _0x1fc2b7===_0x9e8e3a(0xf4)){if(/^\d{2}:\d{2}:\d{2}$/[_0x9e8e3a(0xe1)](_0x1fc2b7))return _0x1fc2b7;if(/^\d{1,2}:\d{2}$/[_0x9e8e3a(0xe1)](_0x1fc2b7)){const [_0x168795,_0x552d9b]=_0x1fc2b7[_0x9e8e3a(0x10f)](':');return _0x168795[_0x9e8e3a(0xf6)](0x2,'0')+':'+_0x552d9b+_0x9e8e3a(0xfb);}const _0x2b5fa0=parseInt(_0x1fc2b7,0xa);if(!isNaN(_0x2b5fa0)&&_0x1fc2b7[_0x9e8e3a(0xf0)](/^\d+$/))return String(_0x2b5fa0)[_0x9e8e3a(0xf6)](0x2,'0')+_0x9e8e3a(0x110);return _0x1fc2b7;}return String(_0x1fc2b7);}export function apiToDef(_0x4abe1e){const _0x4f57d9=a148_0x326f,_0x392c07={'database':_0x4abe1e[_0x4f57d9(0xe8)]?.[_0x4f57d9(0x113)]||'','table':_0x4abe1e[_0x4f57d9(0xe8)]?.[_0x4f57d9(0xca)]||''};_0x4abe1e[_0x4f57d9(0xcd)]&&_0x4abe1e['audienceFilters'][_0x4f57d9(0x122)]>0x0&&(_0x392c07[_0x4f57d9(0x108)]=_0x4abe1e[_0x4f57d9(0xcd)][_0x4f57d9(0x134)](_0x573390=>({'column':_0x573390[_0x4f57d9(0xf9)],'values':_0x573390[_0x4f57d9(0x130)]})));let _0x5077a4;_0x4abe1e['scheduleType']&&_0x4abe1e[_0x4f57d9(0x11a)]!==_0x4f57d9(0xdd)&&(_0x5077a4={'type':_0x4abe1e[_0x4f57d9(0x11a)]},_0x4abe1e[_0x4f57d9(0x115)]&&(_0x5077a4['time']=formatScheduleTime(_0x4abe1e['scheduleOption'])),_0x4abe1e[_0x4f57d9(0x11f)]&&(_0x5077a4[_0x4f57d9(0x11f)]=_0x4abe1e[_0x4f57d9(0x11f)]));let _0x245443;(_0x4abe1e[_0x4f57d9(0x116)]||_0x4abe1e['hivePoolName']||_0x4abe1e[_0x4f57d9(0xfe)])&&(_0x245443={},_0x4abe1e[_0x4f57d9(0x116)]&&(_0x245443['hive_only']=_0x4abe1e[_0x4f57d9(0x116)]),_0x4abe1e[_0x4f57d9(0x100)]&&(_0x245443[_0x4f57d9(0x111)]=_0x4abe1e[_0x4f57d9(0x100)]),_0x4abe1e[_0x4f57d9(0xfe)]&&(_0x245443['trino_pool']=_0x4abe1e[_0x4f57d9(0xfe)]));const _0x2f1a7a=_0x4abe1e[_0x4f57d9(0xd5)]&&_0x4abe1e['attributes'][_0x4f57d9(0x122)]>0x0?groupAttributesBySource(_0x4abe1e['attributes']):undefined,_0x4d7748=_0x4abe1e[_0x4f57d9(0x118)]&&_0x4abe1e[_0x4f57d9(0x118)]['length']>0x0?_0x4abe1e['behaviors']['map'](convertApiBehaviorToYaml):undefined;let _0x586d6b;_0x4abe1e[_0x4f57d9(0x11e)]&&(_0x586d6b={'name':_0x4abe1e['customerGroup'][_0x4f57d9(0xff)],'source':{'database':_0x4abe1e[_0x4f57d9(0x11e)]['parentDatabaseName'],'table':_0x4abe1e[_0x4f57d9(0x11e)]['parentTableName']},'join':{'parent_key':_0x4abe1e['customerGroup']['foreignKey'],'child_key':_0x4abe1e[_0x4f57d9(0x11e)][_0x4f57d9(0x12c)]}},_0x4abe1e[_0x4f57d9(0x11e)][_0x4f57d9(0xfc)]&&_0x4abe1e[_0x4f57d9(0x11e)][_0x4f57d9(0xfc)][_0x4f57d9(0x122)]>0x0&&(_0x586d6b[_0x4f57d9(0xd5)]=groupAttributesBySource(_0x4abe1e['customerGroup'][_0x4f57d9(0xfc)])),_0x4abe1e[_0x4f57d9(0x11e)][_0x4f57d9(0x121)]&&_0x4abe1e['customerGroup'][_0x4f57d9(0x121)][_0x4f57d9(0x122)]>0x0&&(_0x586d6b[_0x4f57d9(0x118)]=_0x4abe1e[_0x4f57d9(0x11e)][_0x4f57d9(0x121)]['map'](convertApiBehaviorToYaml)));const _0x25db97={'name':_0x4abe1e[_0x4f57d9(0xff)],..._0x4abe1e['description']&&{'description':_0x4abe1e[_0x4f57d9(0xeb)]},'master':_0x392c07,..._0x5077a4&&{'schedule':_0x5077a4},..._0x245443&&{'engine':_0x245443},..._0x2f1a7a&&{'attributes':_0x2f1a7a},..._0x4d7748&&{'behaviors':_0x4d7748},..._0x586d6b&&{'customer_group':_0x586d6b}};return _0x25db97;}function groupAttributesBySource(_0x41062){const _0xcd5b2e=a148_0x326f,_0x259779=new Map();for(const _0x1c37f9 of _0x41062){const _0x2dae9d=_0x1c37f9[_0xcd5b2e(0x113)]+'.'+_0x1c37f9[_0xcd5b2e(0xca)]+'.'+_0x1c37f9[_0xcd5b2e(0x12c)]+'.'+_0x1c37f9[_0xcd5b2e(0x109)];!_0x259779[_0xcd5b2e(0xdc)](_0x2dae9d)&&_0x259779[_0xcd5b2e(0x135)](_0x2dae9d,[]),_0x259779['get'](_0x2dae9d)['push'](_0x1c37f9);}const _0x2577cf=[];for(const [,_0x45496f]of _0x259779){const _0x4ec836=_0x45496f[0x0],_0x148441=_0x4ec836[_0xcd5b2e(0x125)]||_0x4ec836[_0xcd5b2e(0xca)];_0x2577cf[_0xcd5b2e(0x12b)]({'name':_0x148441,'source':{'database':_0x4ec836[_0xcd5b2e(0x113)],'table':_0x4ec836['parentTableName']},'join':{'parent_key':_0x4ec836[_0xcd5b2e(0x109)],'child_key':_0x4ec836[_0xcd5b2e(0x12c)]},'columns':_0x45496f[_0xcd5b2e(0x134)](_0x500bea=>{const _0x2b7871=_0xcd5b2e,_0x4d27da={'column':_0x500bea[_0x2b7871(0xe2)],'type':_0x500bea[_0x2b7871(0xdb)]};return _0x500bea[_0x2b7871(0xff)]!==_0x500bea[_0x2b7871(0xe2)]&&(_0x4d27da['label']=_0x500bea[_0x2b7871(0xff)]),_0x4d27da;})});}return _0x2577cf;}function convertApiBehaviorToYaml(_0x361beb){const _0xafcefe=a148_0x326f,_0x2377b5={'name':_0x361beb[_0xafcefe(0xff)],'source':{'database':_0x361beb[_0xafcefe(0x113)],'table':_0x361beb['parentTableName']},'join':{'parent_key':_0x361beb[_0xafcefe(0x109)],'child_key':_0x361beb['parentKey']}};if(_0x361beb[_0xafcefe(0x129)])_0x2377b5[_0xafcefe(0xe6)]=!![];else _0x361beb[_0xafcefe(0xdf)]&&_0x361beb[_0xafcefe(0xdf)][_0xafcefe(0x122)]>0x0&&(_0x2377b5[_0xafcefe(0x105)]=_0x361beb[_0xafcefe(0xdf)][_0xafcefe(0x134)](_0x790714=>{const _0x39b065=_0xafcefe,_0x86716={'column':_0x790714['parentColumn'],'type':_0x790714[_0x39b065(0xdb)]};return _0x790714[_0x39b065(0xff)]!==_0x790714[_0x39b065(0xe2)]&&(_0x86716[_0x39b065(0xd0)]=_0x790714[_0x39b065(0xff)]),_0x86716;}));return _0x361beb['defaultTimeFilterEnabled']&&(_0x2377b5[_0xafcefe(0x124)]=_0x361beb[_0xafcefe(0x106)]),_0x361beb[_0xafcefe(0x11b)]&&(_0x2377b5['realtime']=_0x361beb[_0xafcefe(0x11b)]),_0x2377b5;}export function defToApi(_0x102296){const _0x46d50a=a148_0x326f,_0x414a2e={'name':_0x102296['name'],'master':{'parentDatabaseName':_0x102296['master'][_0x46d50a(0xef)],'parentTableName':_0x102296[_0x46d50a(0xe8)]['table']}};_0x102296[_0x46d50a(0xeb)]&&(_0x414a2e[_0x46d50a(0xeb)]=_0x102296[_0x46d50a(0xeb)]);_0x102296[_0x46d50a(0xe8)][_0x46d50a(0x108)]&&_0x102296[_0x46d50a(0xe8)][_0x46d50a(0x108)][_0x46d50a(0x122)]>0x0&&(_0x414a2e[_0x46d50a(0xcd)]=_0x102296[_0x46d50a(0xe8)][_0x46d50a(0x108)][_0x46d50a(0x134)](_0x435f79=>({'columnName':_0x435f79[_0x46d50a(0xf5)],'rightValues':_0x435f79[_0x46d50a(0xde)]})));_0x102296['schedule']&&(_0x414a2e['scheduleType']=_0x102296[_0x46d50a(0x104)]['type'],_0x102296['schedule']['time']&&(_0x414a2e[_0x46d50a(0x115)]=_0x102296[_0x46d50a(0x104)][_0x46d50a(0xd2)]),_0x102296[_0x46d50a(0x104)]['timezone']&&(_0x414a2e[_0x46d50a(0x11f)]=_0x102296[_0x46d50a(0x104)][_0x46d50a(0x11f)]));_0x102296[_0x46d50a(0x119)]&&(_0x102296[_0x46d50a(0x119)][_0x46d50a(0xda)]!==undefined&&(_0x414a2e[_0x46d50a(0x116)]=_0x102296[_0x46d50a(0x119)][_0x46d50a(0xda)]),_0x102296[_0x46d50a(0x119)][_0x46d50a(0x111)]!==undefined&&(_0x414a2e[_0x46d50a(0x100)]=_0x102296[_0x46d50a(0x119)][_0x46d50a(0x111)]),_0x102296[_0x46d50a(0x119)][_0x46d50a(0x107)]!==undefined&&(_0x414a2e[_0x46d50a(0xfe)]=_0x102296[_0x46d50a(0x119)][_0x46d50a(0x107)]));_0x102296[_0x46d50a(0xd5)]&&_0x102296[_0x46d50a(0xd5)][_0x46d50a(0x122)]>0x0&&(_0x414a2e['attributes']=flattenAttributeGroups(_0x102296[_0x46d50a(0xd5)]));_0x102296[_0x46d50a(0x118)]&&_0x102296[_0x46d50a(0x118)][_0x46d50a(0x122)]>0x0&&(_0x414a2e[_0x46d50a(0x118)]=_0x102296[_0x46d50a(0x118)][_0x46d50a(0x134)](convertDefBehaviorToApi));if(_0x102296['customer_group']){const _0x2662b7=_0x102296['customer_group'];_0x414a2e[_0x46d50a(0x11e)]={'name':_0x2662b7['name'],'parentDatabaseName':_0x2662b7[_0x46d50a(0xf3)][_0x46d50a(0xef)],'parentTableName':_0x2662b7[_0x46d50a(0xf3)][_0x46d50a(0x123)],'parentKey':_0x2662b7[_0x46d50a(0x12f)][_0x46d50a(0xd1)],'foreignKey':_0x2662b7[_0x46d50a(0x12f)][_0x46d50a(0xcb)]},_0x2662b7[_0x46d50a(0xd5)]&&_0x2662b7[_0x46d50a(0xd5)]['length']>0x0&&(_0x414a2e[_0x46d50a(0x11e)][_0x46d50a(0xfc)]=flattenAttributeGroups(_0x2662b7[_0x46d50a(0xd5)])[_0x46d50a(0x134)](_0x1b884b=>({'name':_0x1b884b[_0x46d50a(0xff)],'type':_0x1b884b['type'],'parentDatabaseName':_0x1b884b[_0x46d50a(0x113)],'parentTableName':_0x1b884b['parentTableName'],'parentColumn':_0x1b884b[_0x46d50a(0xe2)],'parentKey':_0x1b884b[_0x46d50a(0x12c)],'foreignKey':_0x1b884b[_0x46d50a(0x109)]}))),_0x2662b7[_0x46d50a(0x118)]&&_0x2662b7['behaviors']['length']>0x0&&(_0x414a2e[_0x46d50a(0x11e)][_0x46d50a(0x121)]=_0x2662b7[_0x46d50a(0x118)]['map'](_0x4f6438=>({'name':_0x4f6438['name'],'parentDatabaseName':_0x4f6438[_0x46d50a(0xf3)][_0x46d50a(0xef)],'parentTableName':_0x4f6438[_0x46d50a(0xf3)][_0x46d50a(0x123)],'parentKey':_0x4f6438[_0x46d50a(0x12f)][_0x46d50a(0xd1)],'foreignKey':_0x4f6438[_0x46d50a(0x12f)][_0x46d50a(0xcb)],'allColumns':_0x4f6438[_0x46d50a(0xe6)],'schema':_0x4f6438[_0x46d50a(0x105)]?.[_0x46d50a(0x134)](_0x5bbc1b=>({'name':_0x5bbc1b[_0x46d50a(0xd0)]||_0x5bbc1b[_0x46d50a(0xf5)],'type':_0x5bbc1b[_0x46d50a(0xdb)],'parentColumn':_0x5bbc1b[_0x46d50a(0xf5)]}))})));}return _0x414a2e;}function flattenAttributeGroups(_0x157094){const _0x9ee792=a148_0x326f,_0x526674=[];for(const _0x378180 of _0x157094){for(const _0x4a0ec2 of _0x378180[_0x9ee792(0x105)]){_0x526674[_0x9ee792(0x12b)]({'name':_0x4a0ec2[_0x9ee792(0xd0)]||_0x4a0ec2[_0x9ee792(0xf5)],'type':_0x4a0ec2[_0x9ee792(0xdb)],'parentDatabaseName':_0x378180[_0x9ee792(0xf3)][_0x9ee792(0xef)],'parentTableName':_0x378180[_0x9ee792(0xf3)][_0x9ee792(0x123)],'parentColumn':_0x4a0ec2['column'],'parentKey':_0x378180[_0x9ee792(0x12f)][_0x9ee792(0xd1)],'foreignKey':_0x378180[_0x9ee792(0x12f)][_0x9ee792(0xcb)],'groupingName':_0x378180[_0x9ee792(0xff)]});}}return _0x526674;}function convertDefBehaviorToApi(_0x38d2ba){const _0x16a8e6=a148_0x326f,_0x55304c={'name':_0x38d2ba[_0x16a8e6(0xff)],'parentDatabaseName':_0x38d2ba[_0x16a8e6(0xf3)][_0x16a8e6(0xef)],'parentTableName':_0x38d2ba[_0x16a8e6(0xf3)][_0x16a8e6(0x123)],'parentKey':_0x38d2ba[_0x16a8e6(0x12f)]['child_key'],'foreignKey':_0x38d2ba['join'][_0x16a8e6(0xcb)]};if(_0x38d2ba[_0x16a8e6(0xe6)])_0x55304c[_0x16a8e6(0x129)]=!![];else _0x38d2ba[_0x16a8e6(0x105)]&&_0x38d2ba['columns'][_0x16a8e6(0x122)]>0x0&&(_0x55304c[_0x16a8e6(0xdf)]=_0x38d2ba[_0x16a8e6(0x105)][_0x16a8e6(0x134)](_0x340647=>({'name':_0x340647[_0x16a8e6(0xd0)]||_0x340647[_0x16a8e6(0xf5)],'type':_0x340647[_0x16a8e6(0xdb)],'parentColumn':_0x340647[_0x16a8e6(0xf5)]})));return _0x38d2ba[_0x16a8e6(0x124)]!==undefined&&(_0x55304c[_0x16a8e6(0x106)]=_0x38d2ba[_0x16a8e6(0x124)]),_0x38d2ba[_0x16a8e6(0xcf)]!==undefined&&(_0x55304c[_0x16a8e6(0x11b)]=_0x38d2ba[_0x16a8e6(0xcf)]),_0x55304c;}export function serializeDef(_0xfdd2ce){const _0x5bc531=a148_0x326f,_0x56ff5b=JSON['parse'](JSON[_0x5bc531(0x12a)](_0xfdd2ce)),_0x1450e1=a148_0x3ddf14[_0x5bc531(0x12a)](_0x56ff5b,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x5bc531(0x103)}),_0x52b3ed=[_0x5bc531(0x128),'schedule:',_0x5bc531(0x127),_0x5bc531(0xd6),_0x5bc531(0xe0),_0x5bc531(0x132),_0x5bc531(0xf7),_0x5bc531(0xcc)];let _0x167d73=_0x1450e1;for(const _0x5550a5 of _0x52b3ed){_0x167d73=_0x167d73[_0x5bc531(0x117)](new RegExp('^('+_0x5550a5+')','m'),(_0xe9756f,_0x3b6295,_0x3734b)=>{if(_0x3734b===0x0||_0x167d73[_0x3734b-0x1]==='\x0a'&&_0x167d73[_0x3734b-0x2]==='\x0a')return _0x3b6295;return'\x0a'+_0x3b6295;});}return _0x167d73;}export function parseDef(_0x42f806){const _0x476194=a148_0x326f,_0x1f9f42=a148_0x3ddf14['parse'](_0x42f806);if(!_0x1f9f42[_0x476194(0xff)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x1f9f42[_0x476194(0xe8)])throw new Error(_0x476194(0x10a));if(!_0x1f9f42[_0x476194(0xe8)][_0x476194(0xef)])throw new Error(_0x476194(0xd9));if(!_0x1f9f42['master'][_0x476194(0x123)])throw new Error(_0x476194(0xed));return _0x1f9f42[_0x476194(0xcf)]&&validateRealtimeSection(_0x1f9f42[_0x476194(0xcf)]),_0x1f9f42[_0x476194(0x10e)]&&validatePersonalizationServices(_0x1f9f42['personalization_services']),_0x1f9f42;}function validateRealtimeSection(_0x48dec0){const _0x554d2f=a148_0x326f,_0x1041bf=[_0x554d2f(0xea),_0x554d2f(0xd8),_0x554d2f(0x135),'ordered_set',_0x554d2f(0xc8),_0x554d2f(0x10b)];_0x48dec0['events']&&Array[_0x554d2f(0x11c)](_0x48dec0[_0x554d2f(0xe7)])&&_0x48dec0[_0x554d2f(0xe7)][_0x554d2f(0xe3)]((_0xb6128f,_0x45d09d)=>{const _0x2151c1=_0x554d2f;if(!_0xb6128f[_0x2151c1(0xff)])throw new Error(_0x2151c1(0x10c)+_0x45d09d+']:\x20Missing\x20required\x20field\x20\x27name\x27');});_0x48dec0[_0x554d2f(0xd5)]&&Array[_0x554d2f(0x11c)](_0x48dec0[_0x554d2f(0xd5)])&&_0x48dec0[_0x554d2f(0xd5)][_0x554d2f(0xe3)]((_0x836b20,_0x19507)=>{const _0x5b2288=_0x554d2f;if(!_0x836b20[_0x5b2288(0xff)])throw new Error(_0x5b2288(0xd3)+_0x19507+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x836b20[_0x5b2288(0xdb)]&&!_0x1041bf[_0x5b2288(0x102)](_0x836b20[_0x5b2288(0xdb)]))throw new Error(_0x5b2288(0xd3)+_0x19507+']\x20('+_0x836b20[_0x5b2288(0xff)]+_0x5b2288(0x133)+_0x836b20['type']+_0x5b2288(0xc9)+_0x1041bf[_0x5b2288(0x12f)](',\x20'));});if(_0x48dec0['id_stitching']){if(!_0x48dec0[_0x554d2f(0xec)][_0x554d2f(0xe9)])throw new Error(_0x554d2f(0xd7));}}function validatePersonalizationServices(_0x4d436a){const _0x3180be=a148_0x326f;if(!Array[_0x3180be(0x11c)](_0x4d436a))throw new Error(_0x3180be(0x11d));_0x4d436a[_0x3180be(0xe3)]((_0x12efbf,_0x8f2a01)=>{const _0x503e10=_0x3180be;if(!_0x12efbf['name'])throw new Error('personalization_services['+_0x8f2a01+_0x503e10(0xe4));});}export function generateTemplate(_0x1ea01,_0x319591,_0x69e66e){const _0x47975f=a148_0x326f,_0x282035={'name':_0x1ea01,'description':_0x47975f(0xce),'master':{'database':_0x319591,'table':_0x69e66e},'schedule':{'type':_0x47975f(0x126),'time':'03:00','timezone':'UTC'},'attributes':[{'name':_0x47975f(0x12d),'source':{'database':_0x319591,'table':_0x47975f(0xf8)},'join':{'parent_key':'id','child_key':_0x47975f(0x136)},'columns':[{'column':'column_name','label':_0x47975f(0x12e),'type':_0x47975f(0xf4)}]}],'behaviors':[{'name':_0x47975f(0x10d),'source':{'database':_0x319591,'table':_0x47975f(0xd4)},'join':{'parent_key':_0x47975f(0x120),'child_key':_0x47975f(0x136)},'all_columns':!![]}]};return serializeDef(_0x282035);}
1
+ function a148_0x21a6(){const _0x17a1ca=['1pHdbPi','column_name','realtime.events[','foreignKey','311262wqckoc','71972MwFKIg','schema','hivePoolName','schedule:','realtime:','personalization_services:','length','forEach','timezone','2331544qtSCQY','type','parentKey','isArray','number','realtime.attributes[','prestoPoolName','Example\x20Attributes','18Ywgtru','match','trino_pool','YAML\x20config\x20missing\x20required\x20field:\x20master.database','default_time_filter','columns',']\x20(','Example\x20Events',':00:00','03:00','master:',':00','events','ordered_set','personalization_services','scheduleType','padStart','none','\x27.\x20Must\x20be\x20one\x20of:\x20','engine','schedule','includes','filters','audienceFilters','column','30mzIneH','parent_key','set','parentDatabaseName','database','5540370iYAHGn','behaviors','customerGroup','1175529YOOXoU','customer_group','customer_id','scheduleOption','Parent\x20segment\x20description','isRealtime','allColumns','id_stitching','test','YAML\x20config\x20missing\x20required\x20field:\x20master','join','table','customer_group:','workflowHiveOnly','description','engine:','list','floor','parentColumn','parse','child_key','master','realtime','time','groupingName','customerGroupBehaviors','name','rightValues','77aRsLxv','stringify','split','personalization_services\x20must\x20be\x20an\x20array','423214cneNlV','has','hive_only','replace','all_columns',']:\x20Missing\x20required\x20field\x20\x27name\x27','620068kPpwIV','parentTableName','values','single','):\x20Invalid\x20type\x20\x27','push','attributes:','null','string','label','source','daily','attributes','personalization_services[','defaultTimeFilterEnabled','customerGroupAttributes','map','hive_pool','primary_key','columnName'];a148_0x21a6=function(){return _0x17a1ca;};return a148_0x21a6();}(function(_0xd21e96,_0x215e79){const _0x596cb5=a148_0x3683,_0x278c74=_0xd21e96();while(!![]){try{const _0x5755aa=-parseInt(_0x596cb5(0x156))/0x1*(-parseInt(_0x596cb5(0x142))/0x2)+-parseInt(_0x596cb5(0x11c))/0x3+-parseInt(_0x596cb5(0x15b))/0x4*(parseInt(_0x596cb5(0x114))/0x5)+parseInt(_0x596cb5(0x15a))/0x6*(-parseInt(_0x596cb5(0x138))/0x7)+parseInt(_0x596cb5(0x164))/0x8*(parseInt(_0x596cb5(0x16c))/0x9)+parseInt(_0x596cb5(0x119))/0xa+-parseInt(_0x596cb5(0x13c))/0xb;if(_0x5755aa===_0x215e79)break;else _0x278c74['push'](_0x278c74['shift']());}catch(_0x35c494){_0x278c74['push'](_0x278c74['shift']());}}}(a148_0x21a6,0x52873));import*as a148_0x1f57b8 from'yaml';function formatScheduleTime(_0x4cce69){const _0x427a80=a148_0x3683;if(typeof _0x4cce69===_0x427a80(0x168)){const _0x220f2a=Math[_0x427a80(0x12d)](_0x4cce69);return String(_0x220f2a)['padStart'](0x2,'0')+_0x427a80(0x174);}if(typeof _0x4cce69===_0x427a80(0x14a)){if(/^\d{2}:\d{2}:\d{2}$/[_0x427a80(0x124)](_0x4cce69))return _0x4cce69;if(/^\d{1,2}:\d{2}$/['test'](_0x4cce69)){const [_0x44e37d,_0x2fc1ff]=_0x4cce69[_0x427a80(0x13a)](':');return _0x44e37d[_0x427a80(0x17c)](0x2,'0')+':'+_0x2fc1ff+_0x427a80(0x177);}const _0xe1424c=parseInt(_0x4cce69,0xa);if(!isNaN(_0xe1424c)&&_0x4cce69[_0x427a80(0x16d)](/^\d+$/))return String(_0xe1424c)[_0x427a80(0x17c)](0x2,'0')+_0x427a80(0x174);return _0x4cce69;}return String(_0x4cce69);}export function apiToDef(_0x1e6d5f){const _0xa19b49=a148_0x3683,_0x284f0a={'database':_0x1e6d5f[_0xa19b49(0x131)]?.[_0xa19b49(0x117)]||'','table':_0x1e6d5f['master']?.[_0xa19b49(0x143)]||''};_0x1e6d5f['audienceFilters']&&_0x1e6d5f[_0xa19b49(0x112)][_0xa19b49(0x161)]>0x0&&(_0x284f0a['filters']=_0x1e6d5f[_0xa19b49(0x112)]['map'](_0x1ed4f1=>({'column':_0x1ed4f1[_0xa19b49(0x155)],'values':_0x1ed4f1[_0xa19b49(0x137)]})));let _0x277281;_0x1e6d5f['scheduleType']&&_0x1e6d5f['scheduleType']!==_0xa19b49(0x17d)&&(_0x277281={'type':_0x1e6d5f['scheduleType']},_0x1e6d5f[_0xa19b49(0x11f)]&&(_0x277281[_0xa19b49(0x133)]=formatScheduleTime(_0x1e6d5f[_0xa19b49(0x11f)])),_0x1e6d5f[_0xa19b49(0x163)]&&(_0x277281[_0xa19b49(0x163)]=_0x1e6d5f[_0xa19b49(0x163)]));let _0x142768;(_0x1e6d5f['workflowHiveOnly']||_0x1e6d5f[_0xa19b49(0x15d)]||_0x1e6d5f[_0xa19b49(0x16a)])&&(_0x142768={},_0x1e6d5f[_0xa19b49(0x129)]&&(_0x142768[_0xa19b49(0x13e)]=_0x1e6d5f[_0xa19b49(0x129)]),_0x1e6d5f[_0xa19b49(0x15d)]&&(_0x142768[_0xa19b49(0x153)]=_0x1e6d5f[_0xa19b49(0x15d)]),_0x1e6d5f[_0xa19b49(0x16a)]&&(_0x142768[_0xa19b49(0x16e)]=_0x1e6d5f[_0xa19b49(0x16a)]));const _0x19021a=_0x1e6d5f[_0xa19b49(0x14e)]&&_0x1e6d5f[_0xa19b49(0x14e)][_0xa19b49(0x161)]>0x0?groupAttributesBySource(_0x1e6d5f['attributes']):undefined,_0x440a3d=_0x1e6d5f['behaviors']&&_0x1e6d5f[_0xa19b49(0x11a)][_0xa19b49(0x161)]>0x0?_0x1e6d5f[_0xa19b49(0x11a)][_0xa19b49(0x152)](convertApiBehaviorToYaml):undefined;let _0x2c5f50;_0x1e6d5f['customerGroup']&&(_0x2c5f50={'name':_0x1e6d5f[_0xa19b49(0x11b)]['name'],'source':{'database':_0x1e6d5f['customerGroup'][_0xa19b49(0x117)],'table':_0x1e6d5f[_0xa19b49(0x11b)][_0xa19b49(0x143)]},'join':{'parent_key':_0x1e6d5f[_0xa19b49(0x11b)]['foreignKey'],'child_key':_0x1e6d5f['customerGroup']['parentKey']}},_0x1e6d5f[_0xa19b49(0x11b)][_0xa19b49(0x151)]&&_0x1e6d5f[_0xa19b49(0x11b)][_0xa19b49(0x151)]['length']>0x0&&(_0x2c5f50['attributes']=groupAttributesBySource(_0x1e6d5f[_0xa19b49(0x11b)]['customerGroupAttributes'])),_0x1e6d5f[_0xa19b49(0x11b)]['customerGroupBehaviors']&&_0x1e6d5f[_0xa19b49(0x11b)][_0xa19b49(0x135)][_0xa19b49(0x161)]>0x0&&(_0x2c5f50[_0xa19b49(0x11a)]=_0x1e6d5f['customerGroup']['customerGroupBehaviors'][_0xa19b49(0x152)](convertApiBehaviorToYaml)));const _0x18ec26={'name':_0x1e6d5f[_0xa19b49(0x136)],..._0x1e6d5f[_0xa19b49(0x12a)]&&{'description':_0x1e6d5f[_0xa19b49(0x12a)]},'master':_0x284f0a,..._0x277281&&{'schedule':_0x277281},..._0x142768&&{'engine':_0x142768},..._0x19021a&&{'attributes':_0x19021a},..._0x440a3d&&{'behaviors':_0x440a3d},..._0x2c5f50&&{'customer_group':_0x2c5f50}};return _0x18ec26;}function groupAttributesBySource(_0x1e649c){const _0x3c0fe8=a148_0x3683,_0x5b4a0f=new Map();for(const _0x55122b of _0x1e649c){const _0x2e8be8=_0x55122b[_0x3c0fe8(0x117)]+'.'+_0x55122b[_0x3c0fe8(0x143)]+'.'+_0x55122b[_0x3c0fe8(0x166)]+'.'+_0x55122b[_0x3c0fe8(0x159)];!_0x5b4a0f[_0x3c0fe8(0x13d)](_0x2e8be8)&&_0x5b4a0f[_0x3c0fe8(0x116)](_0x2e8be8,[]),_0x5b4a0f['get'](_0x2e8be8)[_0x3c0fe8(0x147)](_0x55122b);}const _0x553d2b=[];for(const [,_0x3b62f1]of _0x5b4a0f){const _0x249023=_0x3b62f1[0x0],_0x45b037=_0x249023[_0x3c0fe8(0x134)]||_0x249023[_0x3c0fe8(0x143)];_0x553d2b['push']({'name':_0x45b037,'source':{'database':_0x249023[_0x3c0fe8(0x117)],'table':_0x249023[_0x3c0fe8(0x143)]},'join':{'parent_key':_0x249023[_0x3c0fe8(0x159)],'child_key':_0x249023[_0x3c0fe8(0x166)]},'columns':_0x3b62f1[_0x3c0fe8(0x152)](_0x473892=>{const _0x573114=_0x3c0fe8,_0x229513={'column':_0x473892['parentColumn'],'type':_0x473892['type']};return _0x473892['name']!==_0x473892[_0x573114(0x12e)]&&(_0x229513['label']=_0x473892[_0x573114(0x136)]),_0x229513;})});}return _0x553d2b;}function convertApiBehaviorToYaml(_0x8659f){const _0x41c0c6=a148_0x3683,_0x349d6a={'name':_0x8659f[_0x41c0c6(0x136)],'source':{'database':_0x8659f[_0x41c0c6(0x117)],'table':_0x8659f[_0x41c0c6(0x143)]},'join':{'parent_key':_0x8659f[_0x41c0c6(0x159)],'child_key':_0x8659f[_0x41c0c6(0x166)]}};if(_0x8659f[_0x41c0c6(0x122)])_0x349d6a[_0x41c0c6(0x140)]=!![];else _0x8659f[_0x41c0c6(0x15c)]&&_0x8659f['schema'][_0x41c0c6(0x161)]>0x0&&(_0x349d6a[_0x41c0c6(0x171)]=_0x8659f[_0x41c0c6(0x15c)]['map'](_0x2f5fd2=>{const _0x467d48=_0x41c0c6,_0x37c6ad={'column':_0x2f5fd2[_0x467d48(0x12e)],'type':_0x2f5fd2[_0x467d48(0x165)]};return _0x2f5fd2[_0x467d48(0x136)]!==_0x2f5fd2[_0x467d48(0x12e)]&&(_0x37c6ad[_0x467d48(0x14b)]=_0x2f5fd2[_0x467d48(0x136)]),_0x37c6ad;}));return _0x8659f[_0x41c0c6(0x150)]&&(_0x349d6a['default_time_filter']=_0x8659f[_0x41c0c6(0x150)]),_0x8659f[_0x41c0c6(0x121)]&&(_0x349d6a[_0x41c0c6(0x132)]=_0x8659f[_0x41c0c6(0x121)]),_0x349d6a;}export function defToApi(_0x6321ce){const _0x4a3fc6=a148_0x3683,_0x43396d={'name':_0x6321ce['name'],'master':{'parentDatabaseName':_0x6321ce[_0x4a3fc6(0x131)][_0x4a3fc6(0x118)],'parentTableName':_0x6321ce[_0x4a3fc6(0x131)][_0x4a3fc6(0x127)]}};_0x6321ce[_0x4a3fc6(0x12a)]&&(_0x43396d[_0x4a3fc6(0x12a)]=_0x6321ce[_0x4a3fc6(0x12a)]);_0x6321ce[_0x4a3fc6(0x131)][_0x4a3fc6(0x111)]&&_0x6321ce[_0x4a3fc6(0x131)][_0x4a3fc6(0x111)][_0x4a3fc6(0x161)]>0x0&&(_0x43396d['audienceFilters']=_0x6321ce['master']['filters'][_0x4a3fc6(0x152)](_0x187eb6=>({'columnName':_0x187eb6[_0x4a3fc6(0x113)],'rightValues':_0x187eb6[_0x4a3fc6(0x144)]})));_0x6321ce[_0x4a3fc6(0x10f)]&&(_0x43396d[_0x4a3fc6(0x17b)]=_0x6321ce[_0x4a3fc6(0x10f)]['type'],_0x6321ce[_0x4a3fc6(0x10f)][_0x4a3fc6(0x133)]&&(_0x43396d['scheduleOption']=_0x6321ce[_0x4a3fc6(0x10f)]['time']),_0x6321ce[_0x4a3fc6(0x10f)][_0x4a3fc6(0x163)]&&(_0x43396d[_0x4a3fc6(0x163)]=_0x6321ce['schedule']['timezone']));_0x6321ce[_0x4a3fc6(0x17f)]&&(_0x6321ce['engine'][_0x4a3fc6(0x13e)]!==undefined&&(_0x43396d[_0x4a3fc6(0x129)]=_0x6321ce[_0x4a3fc6(0x17f)][_0x4a3fc6(0x13e)]),_0x6321ce[_0x4a3fc6(0x17f)][_0x4a3fc6(0x153)]!==undefined&&(_0x43396d[_0x4a3fc6(0x15d)]=_0x6321ce[_0x4a3fc6(0x17f)][_0x4a3fc6(0x153)]),_0x6321ce[_0x4a3fc6(0x17f)][_0x4a3fc6(0x16e)]!==undefined&&(_0x43396d[_0x4a3fc6(0x16a)]=_0x6321ce[_0x4a3fc6(0x17f)][_0x4a3fc6(0x16e)]));_0x6321ce['attributes']&&_0x6321ce[_0x4a3fc6(0x14e)][_0x4a3fc6(0x161)]>0x0&&(_0x43396d['attributes']=flattenAttributeGroups(_0x6321ce[_0x4a3fc6(0x14e)]));_0x6321ce[_0x4a3fc6(0x11a)]&&_0x6321ce[_0x4a3fc6(0x11a)][_0x4a3fc6(0x161)]>0x0&&(_0x43396d['behaviors']=_0x6321ce[_0x4a3fc6(0x11a)][_0x4a3fc6(0x152)](convertDefBehaviorToApi));if(_0x6321ce['customer_group']){const _0x133725=_0x6321ce[_0x4a3fc6(0x11d)];_0x43396d['customerGroup']={'name':_0x133725[_0x4a3fc6(0x136)],'parentDatabaseName':_0x133725[_0x4a3fc6(0x14c)]['database'],'parentTableName':_0x133725[_0x4a3fc6(0x14c)][_0x4a3fc6(0x127)],'parentKey':_0x133725['join'][_0x4a3fc6(0x130)],'foreignKey':_0x133725[_0x4a3fc6(0x126)][_0x4a3fc6(0x115)]},_0x133725[_0x4a3fc6(0x14e)]&&_0x133725['attributes']['length']>0x0&&(_0x43396d[_0x4a3fc6(0x11b)]['customerGroupAttributes']=flattenAttributeGroups(_0x133725[_0x4a3fc6(0x14e)])['map'](_0x304939=>({'name':_0x304939[_0x4a3fc6(0x136)],'type':_0x304939['type'],'parentDatabaseName':_0x304939[_0x4a3fc6(0x117)],'parentTableName':_0x304939[_0x4a3fc6(0x143)],'parentColumn':_0x304939['parentColumn'],'parentKey':_0x304939[_0x4a3fc6(0x166)],'foreignKey':_0x304939[_0x4a3fc6(0x159)]}))),_0x133725[_0x4a3fc6(0x11a)]&&_0x133725['behaviors'][_0x4a3fc6(0x161)]>0x0&&(_0x43396d['customerGroup']['customerGroupBehaviors']=_0x133725['behaviors']['map'](_0x9d34c6=>({'name':_0x9d34c6[_0x4a3fc6(0x136)],'parentDatabaseName':_0x9d34c6[_0x4a3fc6(0x14c)][_0x4a3fc6(0x118)],'parentTableName':_0x9d34c6[_0x4a3fc6(0x14c)][_0x4a3fc6(0x127)],'parentKey':_0x9d34c6[_0x4a3fc6(0x126)]['child_key'],'foreignKey':_0x9d34c6[_0x4a3fc6(0x126)]['parent_key'],'allColumns':_0x9d34c6[_0x4a3fc6(0x140)],'schema':_0x9d34c6[_0x4a3fc6(0x171)]?.[_0x4a3fc6(0x152)](_0x2e426a=>({'name':_0x2e426a[_0x4a3fc6(0x14b)]||_0x2e426a[_0x4a3fc6(0x113)],'type':_0x2e426a[_0x4a3fc6(0x165)],'parentColumn':_0x2e426a[_0x4a3fc6(0x113)]}))})));}return _0x43396d;}function flattenAttributeGroups(_0x4d6bdf){const _0x54dae8=a148_0x3683,_0x45e258=[];for(const _0x1abf11 of _0x4d6bdf){for(const _0x143153 of _0x1abf11[_0x54dae8(0x171)]){_0x45e258[_0x54dae8(0x147)]({'name':_0x143153[_0x54dae8(0x14b)]||_0x143153['column'],'type':_0x143153[_0x54dae8(0x165)],'parentDatabaseName':_0x1abf11[_0x54dae8(0x14c)][_0x54dae8(0x118)],'parentTableName':_0x1abf11['source'][_0x54dae8(0x127)],'parentColumn':_0x143153['column'],'parentKey':_0x1abf11[_0x54dae8(0x126)][_0x54dae8(0x130)],'foreignKey':_0x1abf11['join']['parent_key'],'groupingName':_0x1abf11[_0x54dae8(0x136)]});}}return _0x45e258;}function convertDefBehaviorToApi(_0x4b7499){const _0xc7ebfd=a148_0x3683,_0xd68e70={'name':_0x4b7499[_0xc7ebfd(0x136)],'parentDatabaseName':_0x4b7499[_0xc7ebfd(0x14c)][_0xc7ebfd(0x118)],'parentTableName':_0x4b7499[_0xc7ebfd(0x14c)][_0xc7ebfd(0x127)],'parentKey':_0x4b7499['join'][_0xc7ebfd(0x130)],'foreignKey':_0x4b7499[_0xc7ebfd(0x126)]['parent_key']};if(_0x4b7499[_0xc7ebfd(0x140)])_0xd68e70[_0xc7ebfd(0x122)]=!![];else _0x4b7499[_0xc7ebfd(0x171)]&&_0x4b7499[_0xc7ebfd(0x171)][_0xc7ebfd(0x161)]>0x0&&(_0xd68e70[_0xc7ebfd(0x15c)]=_0x4b7499[_0xc7ebfd(0x171)][_0xc7ebfd(0x152)](_0x4af16f=>({'name':_0x4af16f[_0xc7ebfd(0x14b)]||_0x4af16f[_0xc7ebfd(0x113)],'type':_0x4af16f[_0xc7ebfd(0x165)],'parentColumn':_0x4af16f[_0xc7ebfd(0x113)]})));return _0x4b7499[_0xc7ebfd(0x170)]!==undefined&&(_0xd68e70[_0xc7ebfd(0x150)]=_0x4b7499[_0xc7ebfd(0x170)]),_0x4b7499[_0xc7ebfd(0x132)]!==undefined&&(_0xd68e70[_0xc7ebfd(0x121)]=_0x4b7499['realtime']),_0xd68e70;}export function serializeDef(_0x1afb92){const _0x351629=a148_0x3683,_0x31dcaf=JSON[_0x351629(0x12f)](JSON[_0x351629(0x139)](_0x1afb92)),_0x55ec1b=a148_0x1f57b8[_0x351629(0x139)](_0x31dcaf,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x351629(0x149)}),_0x10f9d0=[_0x351629(0x176),_0x351629(0x15e),_0x351629(0x12b),_0x351629(0x148),'behaviors:',_0x351629(0x128),_0x351629(0x15f),_0x351629(0x160)];let _0x2b08e=_0x55ec1b;for(const _0x172891 of _0x10f9d0){_0x2b08e=_0x2b08e[_0x351629(0x13f)](new RegExp('^('+_0x172891+')','m'),(_0x1a293b,_0x28fa10,_0x5dd9e5)=>{if(_0x5dd9e5===0x0||_0x2b08e[_0x5dd9e5-0x1]==='\x0a'&&_0x2b08e[_0x5dd9e5-0x2]==='\x0a')return _0x28fa10;return'\x0a'+_0x28fa10;});}return _0x2b08e;}export function parseDef(_0x36ce5c){const _0x277e79=a148_0x3683,_0x54f1e6=a148_0x1f57b8['parse'](_0x36ce5c);if(!_0x54f1e6[_0x277e79(0x136)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x54f1e6['master'])throw new Error(_0x277e79(0x125));if(!_0x54f1e6['master']['database'])throw new Error(_0x277e79(0x16f));if(!_0x54f1e6[_0x277e79(0x131)][_0x277e79(0x127)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.table');return _0x54f1e6[_0x277e79(0x132)]&&validateRealtimeSection(_0x54f1e6[_0x277e79(0x132)]),_0x54f1e6[_0x277e79(0x17a)]&&validatePersonalizationServices(_0x54f1e6['personalization_services']),_0x54f1e6;}function validateRealtimeSection(_0x26223e){const _0x431441=a148_0x3683,_0x1711e8=[_0x431441(0x145),'counter','set',_0x431441(0x179),_0x431441(0x12c),'imported_batch'];_0x26223e[_0x431441(0x178)]&&Array[_0x431441(0x167)](_0x26223e[_0x431441(0x178)])&&_0x26223e[_0x431441(0x178)][_0x431441(0x162)]((_0x3276b8,_0x7d3e4d)=>{const _0x15fa26=_0x431441;if(!_0x3276b8[_0x15fa26(0x136)])throw new Error(_0x15fa26(0x158)+_0x7d3e4d+_0x15fa26(0x141));});_0x26223e[_0x431441(0x14e)]&&Array[_0x431441(0x167)](_0x26223e['attributes'])&&_0x26223e['attributes'][_0x431441(0x162)]((_0x959ebd,_0x39e7b1)=>{const _0x4e83f0=_0x431441;if(!_0x959ebd[_0x4e83f0(0x136)])throw new Error(_0x4e83f0(0x169)+_0x39e7b1+_0x4e83f0(0x141));if(_0x959ebd[_0x4e83f0(0x165)]&&!_0x1711e8[_0x4e83f0(0x110)](_0x959ebd['type']))throw new Error(_0x4e83f0(0x169)+_0x39e7b1+_0x4e83f0(0x172)+_0x959ebd['name']+_0x4e83f0(0x146)+_0x959ebd[_0x4e83f0(0x165)]+_0x4e83f0(0x17e)+_0x1711e8[_0x4e83f0(0x126)](',\x20'));});if(_0x26223e[_0x431441(0x123)]){if(!_0x26223e[_0x431441(0x123)][_0x431441(0x154)])throw new Error('realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27');}}function a148_0x3683(_0x1210c4,_0x36e185){_0x1210c4=_0x1210c4-0x10f;const _0x21a683=a148_0x21a6();let _0x36836c=_0x21a683[_0x1210c4];return _0x36836c;}function validatePersonalizationServices(_0xe13bd9){const _0x2a60e7=a148_0x3683;if(!Array['isArray'](_0xe13bd9))throw new Error(_0x2a60e7(0x13b));_0xe13bd9['forEach']((_0x556bed,_0x71a574)=>{const _0x4a64ee=_0x2a60e7;if(!_0x556bed[_0x4a64ee(0x136)])throw new Error(_0x4a64ee(0x14f)+_0x71a574+_0x4a64ee(0x141));});}export function generateTemplate(_0x5cedd2,_0x4f47f2,_0xf3e6cf){const _0xac6b90=a148_0x3683,_0x51741d={'name':_0x5cedd2,'description':_0xac6b90(0x120),'master':{'database':_0x4f47f2,'table':_0xf3e6cf},'schedule':{'type':_0xac6b90(0x14d),'time':_0xac6b90(0x175),'timezone':'UTC'},'attributes':[{'name':_0xac6b90(0x16b),'source':{'database':_0x4f47f2,'table':'attribute_table'},'join':{'parent_key':'id','child_key':'customer_id'},'columns':[{'column':_0xac6b90(0x157),'label':'Display\x20Name','type':_0xac6b90(0x14a)}]}],'behaviors':[{'name':_0xac6b90(0x173),'source':{'database':_0x4f47f2,'table':'events_table'},'join':{'parent_key':'user_id','child_key':_0xac6b90(0x11e)},'all_columns':!![]}]};return serializeDef(_0x51741d);}
@@ -1 +1 @@
1
- (function(_0xbd8a94,_0x6ab621){const _0x100b5e=a149_0x4f78,_0x4274d0=_0xbd8a94();while(!![]){try{const _0x380299=parseInt(_0x100b5e(0x13f))/0x1*(parseInt(_0x100b5e(0x108))/0x2)+parseInt(_0x100b5e(0x134))/0x3+parseInt(_0x100b5e(0x104))/0x4*(-parseInt(_0x100b5e(0x13c))/0x5)+-parseInt(_0x100b5e(0xfe))/0x6+-parseInt(_0x100b5e(0x144))/0x7*(parseInt(_0x100b5e(0x11b))/0x8)+-parseInt(_0x100b5e(0x131))/0x9+parseInt(_0x100b5e(0x127))/0xa*(parseInt(_0x100b5e(0x114))/0xb);if(_0x380299===_0x6ab621)break;else _0x4274d0['push'](_0x4274d0['shift']());}catch(_0x3fbb8f){_0x4274d0['push'](_0x4274d0['shift']());}}}(a149_0xaeb9,0x8cf69));import a149_0x5bb147 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';function a149_0xaeb9(){const _0x5b64d1=['Resolving\x20parent\x20segment','journeyBundleId','size','.yml','paused','20wKJBGQ','relationships','segmentFolderId','167SOuoLn','resolveParentId','parentFolder','journeyBundleName','filter','5878159OCoVIw','listJourneysWithDetailsFromParentSegment','from','description','779562ABlrTJ','activation_','sort','Processing\x20segments','toLowerCase','Processing\x20journeys','479664YfWEMb','listActivations','buildIdToNameMap','getLatestJourneyId','302WHNITY','Fetching\x20users\x20and\x20connections','utf-8','push','targetResourceName','versionNumber','activationParams','data','attributes','getActivation','all','listSegments','22JDEjTZ','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','getJourney','folderId','has','getSegment','update','8fDJTLF','join','getParent','values','slice','add','Fetching\x20activations','createdAt','set','isNew','kind','reduce','8692990EoVXxo','user','journey','rule','get','segment','Fetching\x20parent\x20segment\x20info','listFolders','hasChanges','map','2207340gFXTzi','length','audienceId','1524474LbsGNG','relative','name'];a149_0xaeb9=function(){return _0x5b64d1;};return a149_0xaeb9();}import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a149_0x184806,normalizeJourneyDef,parseYamlString as a149_0x2fcd61}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';function a149_0x4f78(_0x3e46fd,_0x34e4ba){_0x3e46fd=_0x3e46fd-0xfe;const _0xaeb91a=a149_0xaeb9();let _0x4f78ed=_0xaeb91a[_0x3e46fd];return _0x4f78ed;}import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x1fd281,_0x8524b0,_0x425d77){const _0x4e2b10=a149_0x4f78,_0x492c76=a149_0x5bb147[_0x4e2b10(0x135)](_0x425d77,_0x1fd281);if(existsSync(_0x1fd281)){const _0xd9335=readFileSync(_0x1fd281,_0x4e2b10(0x10a)),_0x27de66=generateDiff(_0xd9335,_0x8524b0),_0x522aac=hasChanges(_0x27de66);return{'relativePath':_0x492c76,'absolutePath':_0x1fd281,'content':_0x8524b0,'isNew':![],'hasChanges':_0x522aac,'diff':_0x522aac?formatDiffWithColors(_0x27de66):undefined};}return{'relativePath':_0x492c76,'absolutePath':_0x1fd281,'content':_0x8524b0,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x118907,_0x1e3475,_0x42630a){const _0x528a5a=a149_0x4f78,_0x2c3b24=_0x118907+':'+_0x1e3475,_0x2d1cf4=_0x42630a['get'](_0x2c3b24)||0x0;_0x42630a[_0x528a5a(0x123)](_0x2c3b24,_0x2d1cf4+0x1);if(_0x2d1cf4===0x0)return _0x1e3475;return _0x1e3475+'_'+(_0x2d1cf4+0x1);}export async function pullSegments(_0x21d8cf,_0x2c25fd,_0x50f846={}){const _0x172181=a149_0x4f78,{targetDir:_0xc27a51,progress:_0xe8468d}=_0x50f846;_0xe8468d?.[_0x172181(0x11a)](_0x172181(0x137));const _0x53adfb=await _0x21d8cf['segment'][_0x172181(0x140)](_0x2c25fd);_0xe8468d?.[_0x172181(0x11a)](_0x172181(0x12d));const _0x27b408=await _0x21d8cf[_0x172181(0x12c)][_0x172181(0x11d)](_0x53adfb),_0x26651c=_0x27b408['attributes'][_0x172181(0x136)];_0xe8468d?.['update']('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x526c29,_0x35cfa0,_0x42c4cb]=await Promise[_0x172181(0x112)]([_0x21d8cf[_0x172181(0x12c)][_0x172181(0x113)](_0x53adfb),_0x21d8cf[_0x172181(0x12c)][_0x172181(0x12e)](_0x53adfb),_0x21d8cf[_0x172181(0x129)][_0x172181(0x145)](_0x53adfb,{'includeAllVersions':!![]})]),{journeys:_0x50975d,activationStepsById:_0x38f702}=_0x42c4cb,_0x2d6ced=new Map();for(const _0x65718f of _0x50975d){_0x2d6ced[_0x172181(0x123)](_0x65718f['id'],_0x65718f);}const _0x2b311f=_0x50975d[_0x172181(0x130)](_0x2930f0=>({'id':_0x2930f0['id'],'name':_0x2930f0[_0x172181(0x110)][_0x172181(0x136)],'journeyBundleName':_0x2930f0[_0x172181(0x110)][_0x172181(0x142)]||'','journeyBundleId':_0x2930f0[_0x172181(0x110)][_0x172181(0x138)]||'','versionNumber':_0x2930f0[_0x172181(0x110)]['versionNumber'],'description':_0x2930f0[_0x172181(0x110)]['description'],'state':_0x2930f0[_0x172181(0x110)]['state'],'paused':_0x2930f0[_0x172181(0x110)][_0x172181(0x13b)],'audienceId':_0x2930f0['attributes'][_0x172181(0x133)],'folderId':_0x2930f0[_0x172181(0x13d)]?.[_0x172181(0x141)]?.[_0x172181(0x10f)]?.['id'],'createdAt':_0x2930f0[_0x172181(0x110)][_0x172181(0x122)],'updatedAt':_0x2930f0[_0x172181(0x110)]['updatedAt']})),_0x486591=buildFolderIdToPathMap(_0x35cfa0),_0x28428c=_0xc27a51||'segments/'+sanitizeFileName(_0x26651c);_0xe8468d?.[_0x172181(0x11a)](_0x172181(0x121));const _0x44a6e0=new Map();await batchAsync(_0x526c29,async _0x38c42d=>{const _0x4662de=_0x172181,_0x4d5c19=await _0x21d8cf['segment'][_0x4662de(0x105)](_0x53adfb,_0x38c42d['id']);_0x44a6e0['set'](_0x38c42d['id'],_0x4d5c19);}),_0xe8468d?.['update'](_0x172181(0x109));const [_0x53608a,_0x2ec108]=await Promise[_0x172181(0x112)]([_0x21d8cf[_0x172181(0x128)]['buildIdToEmailMap'](),_0x21d8cf['connection'][_0x172181(0x106)]()]),_0x12ea92=[],_0x1d93e6=new Map(),_0xf01f5d=a149_0x5bb147['join'](_0x28428c,'tdx.json'),_0x1d1602=createTdxConfigContent(_0x26651c);_0x12ea92[_0x172181(0x10b)](prepareFile(_0xf01f5d,_0x1d1602,_0x28428c));const _0x59fc07=new Map();for(const _0x4ae1ea of _0x526c29){_0x59fc07['set'](_0x4ae1ea['id'],_0x4ae1ea);}let _0xb5230b=_0x526c29;if(_0x50f846[_0x172181(0x10c)]){const _0x188a72=_0x526c29['filter'](_0x152fcc=>_0x152fcc[_0x172181(0x136)][_0x172181(0x102)]()===_0x50f846['targetResourceName'][_0x172181(0x102)]());_0x188a72['length']>0x0&&(_0xb5230b=_0x188a72);}_0xe8468d?.[_0x172181(0x11a)](_0x172181(0x101));for(const _0x413ddd of _0xb5230b){if(_0x413ddd[_0x172181(0x125)]===SEGMENT_KIND_JOURNEY)continue;const _0x1d46b5=_0x413ddd[_0x172181(0x13e)]?_0x486591[_0x172181(0x12b)](_0x413ddd[_0x172181(0x13e)])||'':'',_0x24aa93=_0x44a6e0[_0x172181(0x12b)](_0x413ddd['id'])||[],_0x284b4f=segmentWithActivationsToYaml(_0x413ddd,_0x24aa93,undefined,_0x53608a,_0x2ec108),_0x2f57bc=_0x1d46b5?a149_0x5bb147[_0x172181(0x11c)](_0x28428c,_0x1d46b5):_0x28428c,_0x19bd53=sanitizeFileName(_0x413ddd[_0x172181(0x136)]),_0x2103b7=getUniqueFileName(_0x2f57bc,_0x19bd53,_0x1d93e6),_0x1d1edf=a149_0x5bb147[_0x172181(0x11c)](_0x2f57bc,_0x2103b7+_0x172181(0x13a)),_0x4057ee=segmentToYamlString(_0x284b4f);_0x12ea92['push'](prepareFile(_0x1d1edf,_0x4057ee,_0x28428c));}const _0x2dc865=new Map();for(const _0x3e179b of _0x2b311f){const _0x4c8162=_0x3e179b['journeyBundleId'];!_0x2dc865[_0x172181(0x118)](_0x4c8162)&&_0x2dc865['set'](_0x4c8162,[]),_0x2dc865[_0x172181(0x12b)](_0x4c8162)['push'](_0x3e179b);}for(const _0x438fba of _0x2dc865[_0x172181(0x11e)]()){_0x438fba[_0x172181(0x100)]((_0x6293bf,_0x67b14d)=>(_0x6293bf[_0x172181(0x10d)]||0x0)-(_0x67b14d[_0x172181(0x10d)]||0x0));}if(_0x50f846[_0x172181(0x10c)]){const _0xd5eff1=new Map();for(const [_0x2281a6,_0x192dba]of _0x2dc865){const _0x3b57dd=_0x192dba[0x0][_0x172181(0x142)];if(_0x3b57dd[_0x172181(0x102)]()===_0x50f846['targetResourceName']['toLowerCase']()){_0xd5eff1['set'](_0x2281a6,_0x192dba);break;}}_0x2dc865['clear']();for(const [_0x239e36,_0x146598]of _0xd5eff1){_0x2dc865[_0x172181(0x123)](_0x239e36,_0x146598);}}if(_0x2dc865[_0x172181(0x139)]>0x0){_0xe8468d?.[_0x172181(0x11a)](_0x172181(0x103));const _0x266e04=Array[_0x172181(0x146)](_0x2dc865[_0x172181(0x11e)]()),_0x435820=0x5,{createYamlContext:_0x4aba77}=createYamlContextForBundle(_0x21d8cf,_0x59fc07,_0x53608a,_0x2ec108,_0x38f702,_0x2d6ced);for(let _0x118d39=0x0;_0x118d39<_0x266e04['length'];_0x118d39+=_0x435820){const _0x59e6a5=_0x266e04[_0x172181(0x11f)](_0x118d39,_0x118d39+_0x435820),_0x59efea=await Promise[_0x172181(0x112)](_0x59e6a5[_0x172181(0x130)](async _0xf4d1f7=>{const _0xb57545=_0x172181,_0x134a2d=_0xf4d1f7[0x0],_0x35f132=_0x134a2d[_0xb57545(0x142)];_0xe8468d?.['update']('Processing\x20journey:\x20'+_0x35f132);const _0x3b083a=_0x134a2d['folderId']?_0x486591[_0xb57545(0x12b)](_0x134a2d[_0xb57545(0x117)])||'':'',_0x2e02d2=_0x3b083a?a149_0x5bb147[_0xb57545(0x11c)](_0x28428c,_0x3b083a):_0x28428c,_0x48023a=sanitizeFileName(_0x35f132),_0x1353b2=a149_0x5bb147[_0xb57545(0x11c)](_0x2e02d2,_0x48023a+'.yml');let _0x25bbdf;if(existsSync(_0x1353b2))try{const _0x20707b=readFileSync(_0x1353b2,'utf-8'),_0x13be9a=a149_0x2fcd61(_0x20707b);_0x25bbdf=buildLocalRuleToNameMappingFromJourney(_0x13be9a);}catch{}const _0x3ab78b=[];for(const _0x39b383 of _0xf4d1f7){const _0x44b631=_0x2d6ced[_0xb57545(0x12b)](_0x39b383['id']);if(!_0x44b631){_0xe8468d?.[_0xb57545(0x11a)]('Warning:\x20Journey\x20'+_0x39b383['id']+_0xb57545(0x115));continue;}const _0x3b804c=_0x44b631[_0xb57545(0x110)]?.[_0xb57545(0x133)],_0x2448d5=_0x4aba77(_0x39b383['id'],_0x3b804c),_0x2eb45e=await journeyResponseToDef(_0x44b631,_0x2448d5);_0x3ab78b[_0xb57545(0x10b)]({'item':_0x39b383,'yaml':_0x2eb45e});}const _0x2206d4=await _0x21d8cf[_0xb57545(0x129)][_0xb57545(0x107)](_0x134a2d[_0xb57545(0x138)]),_0x2ac086=buildMergedJourneyDef(_0x3ab78b,_0x25bbdf,_0x2206d4);return{'bundleName':_0x35f132,'folderPath':_0x3b083a,'finalYaml':_0x2ac086};}));for(const {bundleName:_0x4c2870,folderPath:_0x4bf347,finalYaml:_0x2ae51a}of _0x59efea){const _0x4ccca2=normalizeJourneyDef(_0x2ae51a),_0x500cab=a149_0x184806(_0x4ccca2),_0x46ccde=_0x4bf347?a149_0x5bb147['join'](_0x28428c,_0x4bf347):_0x28428c,_0x4abc86=sanitizeFileName(_0x4c2870),_0x36bb35=getUniqueFileName(_0x46ccde,_0x4abc86,_0x1d93e6),_0x5e6b87=a149_0x5bb147[_0x172181(0x11c)](_0x46ccde,_0x36bb35+'.yml');_0x12ea92['push'](prepareFile(_0x5e6b87,_0x500cab,_0x28428c));}}}const _0x4263a0=Array[_0x172181(0x146)](_0x44a6e0[_0x172181(0x11e)]())[_0x172181(0x126)]((_0x2d6864,_0x1a875c)=>_0x2d6864+_0x1a875c[_0x172181(0x132)],0x0),_0x49ed6d=_0xb5230b[_0x172181(0x143)](_0x107e56=>_0x107e56[_0x172181(0x125)]!==SEGMENT_KIND_JOURNEY),_0x4b3964=_0x12ea92[_0x172181(0x143)](_0x184e4a=>_0x184e4a[_0x172181(0x124)])[_0x172181(0x132)],_0x23f24c=_0x12ea92[_0x172181(0x143)](_0x5b8bb9=>!_0x5b8bb9['isNew']&&_0x5b8bb9[_0x172181(0x12f)])[_0x172181(0x132)],_0x2b579a=_0x12ea92[_0x172181(0x143)](_0x37e2e5=>!_0x37e2e5[_0x172181(0x124)]&&!_0x37e2e5['hasChanges'])[_0x172181(0x132)],_0x5231ff=Array[_0x172181(0x146)](_0x2dc865[_0x172181(0x11e)]())['reduce']((_0x21c875,_0x5dc115)=>_0x21c875+_0x5dc115[_0x172181(0x132)],0x0);return{'parentName':_0x26651c,'parentId':_0x53adfb,'targetDir':_0x28428c,'files':_0x12ea92,'counts':{'segments':_0x49ed6d[_0x172181(0x132)],'journeys':_0x2dc865[_0x172181(0x139)],'journeyVersions':_0x5231ff,'activations':_0x4263a0},'newFiles':_0x4b3964,'changedFiles':_0x23f24c,'unchangedFiles':_0x2b579a};}function createYamlContextForBundle(_0x3d20be,_0x3ccd59,_0x13589c,_0x1c3bc3,_0x43bc26,_0x1eb997){const _0x4b6b9f=new Set(),_0x4c3736=new Map(),_0x591a35=new Map(),_0x5d6cc9=createJumpTargetCache(),_0xd8d3cc=async(_0x3a8645,_0x5e4407)=>{const _0x4a3faf=a149_0x4f78,_0x4a3be6=_0x4c3736[_0x4a3faf(0x12b)](_0x3a8645);if(_0x4a3be6!==undefined)return _0x4a3be6;if(!_0x5e4407)return _0x3a8645;try{let _0x4774b8=_0x3ccd59[_0x4a3faf(0x12b)](_0x3a8645);!_0x4774b8&&(_0x4774b8=await _0x3d20be[_0x4a3faf(0x12c)]['getSegment'](_0x5e4407,_0x3a8645),_0x3ccd59[_0x4a3faf(0x123)](_0x3a8645,_0x4774b8));const _0x3b856f=generateJourneyLocalName(_0x4774b8[_0x4a3faf(0x136)]),_0x110cd5=_0x4774b8[_0x4a3faf(0x125)]===SEGMENT_KIND_JOURNEY&&_0x3b856f!==undefined;if(_0x110cd5&&_0x3b856f){let _0x245596=_0x3b856f,_0x1165a8=0x2;while(_0x4b6b9f[_0x4a3faf(0x118)](_0x245596)){_0x245596=_0x3b856f+'_'+_0x1165a8,_0x1165a8++;}return _0x4b6b9f[_0x4a3faf(0x120)](_0x245596),_0x4c3736[_0x4a3faf(0x123)](_0x3a8645,_0x245596),_0x245596;}return _0x4774b8['name'];}catch{return _0x3a8645;}},_0x148019=(_0x76f8e0,_0x21d89c)=>({'resolveSegment':async _0x3fedd5=>{const _0xd0b4e5=a149_0x4f78,_0x2603ed=_0x4c3736[_0xd0b4e5(0x12b)](_0x3fedd5);if(_0x2603ed!==undefined)return{'name':_0x2603ed,'isJourneyLocal':!![]};if(!_0x21d89c)return{'name':_0x3fedd5,'isJourneyLocal':![]};try{let _0x2b3d73=_0x3ccd59['get'](_0x3fedd5);!_0x2b3d73&&(_0x2b3d73=await _0x3d20be[_0xd0b4e5(0x12c)][_0xd0b4e5(0x119)](_0x21d89c,_0x3fedd5),_0x3ccd59[_0xd0b4e5(0x123)](_0x3fedd5,_0x2b3d73));const _0x3cccd9=generateJourneyLocalName(_0x2b3d73['name']),_0x4c74f7=_0x2b3d73[_0xd0b4e5(0x125)]===SEGMENT_KIND_JOURNEY&&_0x3cccd9!==undefined;if(_0x4c74f7&&!_0x2b3d73[_0xd0b4e5(0x12a)]&&_0x21d89c)try{const _0x5c091f=await _0x3d20be[_0xd0b4e5(0x12c)]['getSegment'](_0x21d89c,_0x3fedd5);_0x3ccd59[_0xd0b4e5(0x123)](_0x3fedd5,_0x5c091f),_0x2b3d73=_0x5c091f;}catch{}const _0x33422a=await _0xd8d3cc(_0x3fedd5,_0x21d89c);let _0x516600;if(_0x4c74f7&&_0x2b3d73['rule']){const _0x41f64d=await segmentResponseToDef(_0x2b3d73,{'resolveSegmentName':_0x22b4a8=>_0xd8d3cc(_0x22b4a8,_0x21d89c)});_0x516600={'description':_0x2b3d73[_0xd0b4e5(0x147)],'rule':_0x41f64d['rule']};}return{'name':_0x33422a,'isJourneyLocal':_0x4c74f7,'definition':_0x516600};}catch{return{'name':_0x3fedd5,'isJourneyLocal':![]};}},'resolveActivation':async _0x3c3c0b=>{const _0x409cab=a149_0x4f78,_0x5afc0f=_0x591a35[_0x409cab(0x12b)](_0x3c3c0b);if(_0x5afc0f!==undefined)return{'name':_0x5afc0f,'isJourneyLocal':!![]};try{let _0x40c4e1=_0x43bc26[_0x409cab(0x12b)](_0x3c3c0b);!_0x40c4e1&&(_0x40c4e1=await _0x3d20be[_0x409cab(0x129)][_0x409cab(0x111)](_0x76f8e0,_0x3c3c0b));const _0x2c946f=_0x40c4e1[_0x409cab(0x110)][_0x409cab(0x10e)]['name']||_0x3c3c0b,_0x8d77f8=sanitizeYamlKey(_0x2c946f)||_0x409cab(0xff)+_0x3c3c0b,_0x2c0560=_0x8d77f8;_0x591a35[_0x409cab(0x123)](_0x3c3c0b,_0x2c0560);const _0x5d1cd5=journeyActivationStepToYaml(_0x40c4e1,_0x13589c,_0x1c3bc3);return{'name':_0x2c0560,'isJourneyLocal':!![],'definition':_0x5d1cd5};}catch{return{'name':_0x3c3c0b,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1d0eb0,_0x1e70b6)=>resolveJumpTarget(_0x1d0eb0,_0x1e70b6,_0x5d6cc9,async _0x3b1f70=>{const _0x45ca77=a149_0x4f78,_0x4f82d6=_0x1eb997['get'](_0x3b1f70);if(_0x4f82d6)return _0x4f82d6;return _0x3d20be['journey'][_0x45ca77(0x116)](_0x3b1f70);})});return{'createYamlContext':_0x148019};}
1
+ (function(_0x16a2d6,_0xe5ceba){const _0x5efe43=a149_0x54f7,_0x12ee9e=_0x16a2d6();while(!![]){try{const _0x2c2bf4=parseInt(_0x5efe43(0x18d))/0x1+-parseInt(_0x5efe43(0x193))/0x2*(-parseInt(_0x5efe43(0x180))/0x3)+parseInt(_0x5efe43(0x19b))/0x4*(-parseInt(_0x5efe43(0x172))/0x5)+parseInt(_0x5efe43(0x1af))/0x6+-parseInt(_0x5efe43(0x1a6))/0x7+parseInt(_0x5efe43(0x18e))/0x8+-parseInt(_0x5efe43(0x185))/0x9;if(_0x2c2bf4===_0xe5ceba)break;else _0x12ee9e['push'](_0x12ee9e['shift']());}catch(_0xfc5d82){_0x12ee9e['push'](_0x12ee9e['shift']());}}}(a149_0x22c2,0x888f0));import a149_0x4501fa from'path';function a149_0x54f7(_0x11ddab,_0x563731){_0x11ddab=_0x11ddab-0x171;const _0x22c2ac=a149_0x22c2();let _0x54f773=_0x22c2ac[_0x11ddab];return _0x54f773;}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 a149_0x52c31f,normalizeJourneyDef,parseYamlString as a149_0x446224}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 a149_0x22c2(){const _0x8d4d99=['getActivation','tdx.json','toLowerCase','from','set','kind','push','rule','journeyBundleId','3OLvMvd','segments/','update','listFolders','folderId','19468350MIyyXM','getSegment','createdAt','updatedAt','data','.yml','relative','clear','1076661vXHxor','2703152KjoDlT','state','name','get','journeyBundleName','1703038fySHrL','description','buildIdToNameMap','versionNumber','utf-8','size','journey','getLatestJourneyId','9936znhDhL','user','paused','hasChanges','values','Fetching\x20segments,\x20folders,\x20and\x20journeys','Fetching\x20activations','audienceId','Warning:\x20Journey\x20','join','Fetching\x20parent\x20segment\x20info','982863cwTtfJ','isNew','activation_','slice','resolveParentId','length','Processing\x20journeys','sort','has','4788198SMbpLy','Processing\x20segments','attributes','all','Processing\x20journey:\x20','listJourneysWithDetailsFromParentSegment','map','listActivations','add','405MxakwZ','filter','segmentFolderId','segment','targetResourceName'];a149_0x22c2=function(){return _0x8d4d99;};return a149_0x22c2();}function prepareFile(_0x5b59ad,_0x139bcb,_0x167107){const _0x28a2b9=a149_0x54f7,_0xb7f634=a149_0x4501fa[_0x28a2b9(0x18b)](_0x167107,_0x5b59ad);if(existsSync(_0x5b59ad)){const _0x55444e=readFileSync(_0x5b59ad,'utf-8'),_0x52be26=generateDiff(_0x55444e,_0x139bcb),_0x58ee1d=hasChanges(_0x52be26);return{'relativePath':_0xb7f634,'absolutePath':_0x5b59ad,'content':_0x139bcb,'isNew':![],'hasChanges':_0x58ee1d,'diff':_0x58ee1d?formatDiffWithColors(_0x52be26):undefined};}return{'relativePath':_0xb7f634,'absolutePath':_0x5b59ad,'content':_0x139bcb,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x33b339,_0x3c0c0b,_0x322a1f){const _0x4f1860=a149_0x54f7,_0x61ba68=_0x33b339+':'+_0x3c0c0b,_0x494112=_0x322a1f['get'](_0x61ba68)||0x0;_0x322a1f[_0x4f1860(0x17b)](_0x61ba68,_0x494112+0x1);if(_0x494112===0x0)return _0x3c0c0b;return _0x3c0c0b+'_'+(_0x494112+0x1);}export async function pullSegments(_0x2aa2d5,_0x174cf7,_0x33bc55={}){const _0x285d36=a149_0x54f7,{targetDir:_0x4e9221,progress:_0x1e9310}=_0x33bc55;_0x1e9310?.[_0x285d36(0x182)]('Resolving\x20parent\x20segment');const _0x547078=await _0x2aa2d5[_0x285d36(0x175)][_0x285d36(0x1aa)](_0x174cf7);_0x1e9310?.[_0x285d36(0x182)](_0x285d36(0x1a5));const _0x506663=await _0x2aa2d5['segment']['getParent'](_0x547078),_0x5834e4=_0x506663[_0x285d36(0x1b1)][_0x285d36(0x190)];_0x1e9310?.['update'](_0x285d36(0x1a0));const [_0x5b9dc9,_0x36678b,_0x479860]=await Promise[_0x285d36(0x1b2)]([_0x2aa2d5[_0x285d36(0x175)]['listSegments'](_0x547078),_0x2aa2d5[_0x285d36(0x175)][_0x285d36(0x183)](_0x547078),_0x2aa2d5['journey'][_0x285d36(0x1b4)](_0x547078,{'includeAllVersions':!![]})]),{journeys:_0x34cf0d,activationStepsById:_0x17d9cd}=_0x479860,_0x29af03=new Map();for(const _0x5f24a1 of _0x34cf0d){_0x29af03['set'](_0x5f24a1['id'],_0x5f24a1);}const _0x3efb73=_0x34cf0d[_0x285d36(0x1b5)](_0x2d64fe=>({'id':_0x2d64fe['id'],'name':_0x2d64fe[_0x285d36(0x1b1)]['name'],'journeyBundleName':_0x2d64fe[_0x285d36(0x1b1)]['journeyBundleName']||'','journeyBundleId':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x17f)]||'','versionNumber':_0x2d64fe[_0x285d36(0x1b1)]['versionNumber'],'description':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x194)],'state':_0x2d64fe['attributes'][_0x285d36(0x18f)],'paused':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x19d)],'audienceId':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x1a2)],'folderId':_0x2d64fe['relationships']?.['parentFolder']?.[_0x285d36(0x189)]?.['id'],'createdAt':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x187)],'updatedAt':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x188)]})),_0x595ee3=buildFolderIdToPathMap(_0x36678b),_0x369660=_0x4e9221||_0x285d36(0x181)+sanitizeFileName(_0x5834e4);_0x1e9310?.['update'](_0x285d36(0x1a1));const _0x30489b=new Map();await batchAsync(_0x5b9dc9,async _0x30ff89=>{const _0x145216=_0x285d36,_0x15a4ae=await _0x2aa2d5[_0x145216(0x175)][_0x145216(0x1b6)](_0x547078,_0x30ff89['id']);_0x30489b[_0x145216(0x17b)](_0x30ff89['id'],_0x15a4ae);}),_0x1e9310?.[_0x285d36(0x182)]('Fetching\x20users\x20and\x20connections');const [_0x4f0cd6,_0x38ed7a]=await Promise[_0x285d36(0x1b2)]([_0x2aa2d5[_0x285d36(0x19c)]['buildIdToEmailMap'](),_0x2aa2d5['connection'][_0x285d36(0x195)]()]),_0x4bb726=[],_0x2e7163=new Map(),_0x2b2a4f=a149_0x4501fa[_0x285d36(0x1a4)](_0x369660,_0x285d36(0x178)),_0x3dfd1f=createTdxConfigContent(_0x5834e4);_0x4bb726['push'](prepareFile(_0x2b2a4f,_0x3dfd1f,_0x369660));const _0x1af509=new Map();for(const _0x29b288 of _0x5b9dc9){_0x1af509['set'](_0x29b288['id'],_0x29b288);}let _0x3dd718=_0x5b9dc9;if(_0x33bc55['targetResourceName']){const _0x4a2610=_0x5b9dc9[_0x285d36(0x173)](_0xdb573f=>_0xdb573f[_0x285d36(0x190)]['toLowerCase']()===_0x33bc55[_0x285d36(0x176)][_0x285d36(0x179)]());_0x4a2610[_0x285d36(0x1ab)]>0x0&&(_0x3dd718=_0x4a2610);}_0x1e9310?.['update'](_0x285d36(0x1b0));for(const _0x372cac of _0x3dd718){if(_0x372cac[_0x285d36(0x17c)]===SEGMENT_KIND_JOURNEY)continue;const _0x1ffaec=_0x372cac[_0x285d36(0x174)]?_0x595ee3[_0x285d36(0x191)](_0x372cac[_0x285d36(0x174)])||'':'',_0x2aacf2=_0x30489b[_0x285d36(0x191)](_0x372cac['id'])||[],_0x5683d1=segmentWithActivationsToYaml(_0x372cac,_0x2aacf2,undefined,_0x4f0cd6,_0x38ed7a),_0x56d92a=_0x1ffaec?a149_0x4501fa[_0x285d36(0x1a4)](_0x369660,_0x1ffaec):_0x369660,_0x51cc9b=sanitizeFileName(_0x372cac[_0x285d36(0x190)]),_0x1bc872=getUniqueFileName(_0x56d92a,_0x51cc9b,_0x2e7163),_0x17e0f0=a149_0x4501fa[_0x285d36(0x1a4)](_0x56d92a,_0x1bc872+_0x285d36(0x18a)),_0x3087a9=segmentToYamlString(_0x5683d1);_0x4bb726[_0x285d36(0x17d)](prepareFile(_0x17e0f0,_0x3087a9,_0x369660));}const _0x48ca67=new Map();for(const _0x4e012a of _0x3efb73){const _0x1fc498=_0x4e012a['journeyBundleId'];!_0x48ca67[_0x285d36(0x1ae)](_0x1fc498)&&_0x48ca67[_0x285d36(0x17b)](_0x1fc498,[]),_0x48ca67[_0x285d36(0x191)](_0x1fc498)[_0x285d36(0x17d)](_0x4e012a);}for(const _0x1d1476 of _0x48ca67[_0x285d36(0x19f)]()){_0x1d1476[_0x285d36(0x1ad)]((_0x26f18c,_0x396dc0)=>(_0x26f18c[_0x285d36(0x196)]||0x0)-(_0x396dc0['versionNumber']||0x0));}if(_0x33bc55[_0x285d36(0x176)]){const _0x2285eb=new Map();for(const [_0x1cda6f,_0x5861ce]of _0x48ca67){const _0x223a89=_0x5861ce[0x0][_0x285d36(0x192)];if(_0x223a89[_0x285d36(0x179)]()===_0x33bc55[_0x285d36(0x176)]['toLowerCase']()){_0x2285eb[_0x285d36(0x17b)](_0x1cda6f,_0x5861ce);break;}}_0x48ca67[_0x285d36(0x18c)]();for(const [_0xdd67b7,_0x26f6ee]of _0x2285eb){_0x48ca67[_0x285d36(0x17b)](_0xdd67b7,_0x26f6ee);}}if(_0x48ca67['size']>0x0){_0x1e9310?.[_0x285d36(0x182)](_0x285d36(0x1ac));const _0x444772=Array[_0x285d36(0x17a)](_0x48ca67[_0x285d36(0x19f)]()),_0xf91dfe=0x5,{createYamlContext:_0x112ce5}=createYamlContextForBundle(_0x2aa2d5,_0x1af509,_0x4f0cd6,_0x38ed7a,_0x17d9cd,_0x29af03);for(let _0x295e79=0x0;_0x295e79<_0x444772[_0x285d36(0x1ab)];_0x295e79+=_0xf91dfe){const _0x50647e=_0x444772[_0x285d36(0x1a9)](_0x295e79,_0x295e79+_0xf91dfe),_0x11fda1=await Promise[_0x285d36(0x1b2)](_0x50647e[_0x285d36(0x1b5)](async _0x1193d8=>{const _0x4d3549=_0x285d36,_0x479185=_0x1193d8[0x0],_0x48e7db=_0x479185[_0x4d3549(0x192)];_0x1e9310?.[_0x4d3549(0x182)](_0x4d3549(0x1b3)+_0x48e7db);const _0x41e167=_0x479185[_0x4d3549(0x184)]?_0x595ee3[_0x4d3549(0x191)](_0x479185[_0x4d3549(0x184)])||'':'',_0x137f2b=_0x41e167?a149_0x4501fa[_0x4d3549(0x1a4)](_0x369660,_0x41e167):_0x369660,_0x5b719e=sanitizeFileName(_0x48e7db),_0x13dfc7=a149_0x4501fa['join'](_0x137f2b,_0x5b719e+_0x4d3549(0x18a));let _0x5c7051;if(existsSync(_0x13dfc7))try{const _0x44bdc1=readFileSync(_0x13dfc7,_0x4d3549(0x197)),_0x74a001=a149_0x446224(_0x44bdc1);_0x5c7051=buildLocalRuleToNameMappingFromJourney(_0x74a001);}catch{}const _0x465ea0=[];for(const _0x2cdb03 of _0x1193d8){const _0x551309=_0x29af03['get'](_0x2cdb03['id']);if(!_0x551309){_0x1e9310?.[_0x4d3549(0x182)](_0x4d3549(0x1a3)+_0x2cdb03['id']+'\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping');continue;}const _0x2f308f=_0x551309[_0x4d3549(0x1b1)]?.[_0x4d3549(0x1a2)],_0xa7a2e5=_0x112ce5(_0x2cdb03['id'],_0x2f308f),_0x1c14dc=await journeyResponseToDef(_0x551309,_0xa7a2e5);_0x465ea0[_0x4d3549(0x17d)]({'item':_0x2cdb03,'yaml':_0x1c14dc});}const _0x1ded43=await _0x2aa2d5['journey'][_0x4d3549(0x19a)](_0x479185[_0x4d3549(0x17f)]),_0x201c81=buildMergedJourneyDef(_0x465ea0,_0x5c7051,_0x1ded43);return{'bundleName':_0x48e7db,'folderPath':_0x41e167,'finalYaml':_0x201c81};}));for(const {bundleName:_0x429fda,folderPath:_0x5f3a49,finalYaml:_0x3aba80}of _0x11fda1){const _0x5e8425=normalizeJourneyDef(_0x3aba80),_0x5a97df=a149_0x52c31f(_0x5e8425),_0x5dfe0a=_0x5f3a49?a149_0x4501fa['join'](_0x369660,_0x5f3a49):_0x369660,_0x24e871=sanitizeFileName(_0x429fda),_0x220c61=getUniqueFileName(_0x5dfe0a,_0x24e871,_0x2e7163),_0x11b41e=a149_0x4501fa[_0x285d36(0x1a4)](_0x5dfe0a,_0x220c61+_0x285d36(0x18a));_0x4bb726[_0x285d36(0x17d)](prepareFile(_0x11b41e,_0x5a97df,_0x369660));}}}const _0x23924a=Array['from'](_0x30489b['values']())['reduce']((_0x39e954,_0x112d0c)=>_0x39e954+_0x112d0c[_0x285d36(0x1ab)],0x0),_0x37639d=_0x3dd718[_0x285d36(0x173)](_0x4265cd=>_0x4265cd[_0x285d36(0x17c)]!==SEGMENT_KIND_JOURNEY),_0x5d3df6=_0x4bb726[_0x285d36(0x173)](_0x8393c9=>_0x8393c9[_0x285d36(0x1a7)])[_0x285d36(0x1ab)],_0x31b04d=_0x4bb726[_0x285d36(0x173)](_0x27b308=>!_0x27b308['isNew']&&_0x27b308['hasChanges'])['length'],_0x4651f1=_0x4bb726[_0x285d36(0x173)](_0x56d497=>!_0x56d497[_0x285d36(0x1a7)]&&!_0x56d497[_0x285d36(0x19e)])['length'],_0x4f4615=Array[_0x285d36(0x17a)](_0x48ca67[_0x285d36(0x19f)]())['reduce']((_0x1c7745,_0x343e5a)=>_0x1c7745+_0x343e5a['length'],0x0);return{'parentName':_0x5834e4,'parentId':_0x547078,'targetDir':_0x369660,'files':_0x4bb726,'counts':{'segments':_0x37639d[_0x285d36(0x1ab)],'journeys':_0x48ca67[_0x285d36(0x198)],'journeyVersions':_0x4f4615,'activations':_0x23924a},'newFiles':_0x5d3df6,'changedFiles':_0x31b04d,'unchangedFiles':_0x4651f1};}function createYamlContextForBundle(_0x22d8aa,_0x498c04,_0x16ff3c,_0x522767,_0x40248f,_0x5e48c7){const _0x168952=new Set(),_0x57a3c0=new Map(),_0x1b96e0=new Map(),_0x2c3a28=createJumpTargetCache(),_0x144c26=async(_0x2ffdc6,_0x5d79e2)=>{const _0x3cad76=a149_0x54f7,_0x4dd701=_0x57a3c0[_0x3cad76(0x191)](_0x2ffdc6);if(_0x4dd701!==undefined)return _0x4dd701;if(!_0x5d79e2)return _0x2ffdc6;try{let _0x123861=_0x498c04[_0x3cad76(0x191)](_0x2ffdc6);!_0x123861&&(_0x123861=await _0x22d8aa[_0x3cad76(0x175)][_0x3cad76(0x186)](_0x5d79e2,_0x2ffdc6),_0x498c04[_0x3cad76(0x17b)](_0x2ffdc6,_0x123861));const _0x2e453f=generateJourneyLocalName(_0x123861[_0x3cad76(0x190)]),_0x460619=_0x123861['kind']===SEGMENT_KIND_JOURNEY&&_0x2e453f!==undefined;if(_0x460619&&_0x2e453f){let _0x506a7a=_0x2e453f,_0x3b5be7=0x2;while(_0x168952['has'](_0x506a7a)){_0x506a7a=_0x2e453f+'_'+_0x3b5be7,_0x3b5be7++;}return _0x168952[_0x3cad76(0x171)](_0x506a7a),_0x57a3c0[_0x3cad76(0x17b)](_0x2ffdc6,_0x506a7a),_0x506a7a;}return _0x123861[_0x3cad76(0x190)];}catch{return _0x2ffdc6;}},_0x125a04=(_0x558140,_0x4c40e6)=>({'resolveSegment':async _0x474d46=>{const _0x15fab6=a149_0x54f7,_0x3bcd4d=_0x57a3c0['get'](_0x474d46);if(_0x3bcd4d!==undefined)return{'name':_0x3bcd4d,'isJourneyLocal':!![]};if(!_0x4c40e6)return{'name':_0x474d46,'isJourneyLocal':![]};try{let _0x52ef95=_0x498c04['get'](_0x474d46);!_0x52ef95&&(_0x52ef95=await _0x22d8aa['segment'][_0x15fab6(0x186)](_0x4c40e6,_0x474d46),_0x498c04[_0x15fab6(0x17b)](_0x474d46,_0x52ef95));const _0x63f5fa=generateJourneyLocalName(_0x52ef95[_0x15fab6(0x190)]),_0x3510ef=_0x52ef95[_0x15fab6(0x17c)]===SEGMENT_KIND_JOURNEY&&_0x63f5fa!==undefined;if(_0x3510ef&&!_0x52ef95[_0x15fab6(0x17e)]&&_0x4c40e6)try{const _0x4b1ff2=await _0x22d8aa[_0x15fab6(0x175)][_0x15fab6(0x186)](_0x4c40e6,_0x474d46);_0x498c04[_0x15fab6(0x17b)](_0x474d46,_0x4b1ff2),_0x52ef95=_0x4b1ff2;}catch{}const _0x55a5b8=await _0x144c26(_0x474d46,_0x4c40e6);let _0xaba9b5;if(_0x3510ef&&_0x52ef95[_0x15fab6(0x17e)]){const _0x1ac97e=await segmentResponseToDef(_0x52ef95,{'resolveSegmentName':_0x1f89b7=>_0x144c26(_0x1f89b7,_0x4c40e6)});_0xaba9b5={'description':_0x52ef95[_0x15fab6(0x194)],'rule':_0x1ac97e[_0x15fab6(0x17e)]};}return{'name':_0x55a5b8,'isJourneyLocal':_0x3510ef,'definition':_0xaba9b5};}catch{return{'name':_0x474d46,'isJourneyLocal':![]};}},'resolveActivation':async _0x305a8c=>{const _0xc372aa=a149_0x54f7,_0x3751ed=_0x1b96e0[_0xc372aa(0x191)](_0x305a8c);if(_0x3751ed!==undefined)return{'name':_0x3751ed,'isJourneyLocal':!![]};try{let _0x57f878=_0x40248f[_0xc372aa(0x191)](_0x305a8c);!_0x57f878&&(_0x57f878=await _0x22d8aa['journey'][_0xc372aa(0x177)](_0x558140,_0x305a8c));const _0x2bac9b=_0x57f878['attributes']['activationParams']['name']||_0x305a8c,_0x58a93c=sanitizeYamlKey(_0x2bac9b)||_0xc372aa(0x1a8)+_0x305a8c,_0x475a6a=_0x58a93c;_0x1b96e0[_0xc372aa(0x17b)](_0x305a8c,_0x475a6a);const _0x38eb30=journeyActivationStepToYaml(_0x57f878,_0x16ff3c,_0x522767);return{'name':_0x475a6a,'isJourneyLocal':!![],'definition':_0x38eb30};}catch{return{'name':_0x305a8c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4e6c6f,_0xa6e4b2)=>resolveJumpTarget(_0x4e6c6f,_0xa6e4b2,_0x2c3a28,async _0xb183b2=>{const _0x316afe=a149_0x54f7,_0x7bd2a2=_0x5e48c7['get'](_0xb183b2);if(_0x7bd2a2)return _0x7bd2a2;return _0x22d8aa[_0x316afe(0x199)]['getJourney'](_0xb183b2);})});return{'createYamlContext':_0x125a04};}
@@ -1 +1 @@
1
- const a150_0x3d225d=a150_0x5c49;(function(_0x3c6f38,_0x1b9c60){const _0xd318b9=a150_0x5c49,_0x3fdba2=_0x3c6f38();while(!![]){try{const _0x4e6ef0=-parseInt(_0xd318b9(0x95))/0x1*(-parseInt(_0xd318b9(0xa9))/0x2)+-parseInt(_0xd318b9(0x9f))/0x3*(parseInt(_0xd318b9(0x93))/0x4)+-parseInt(_0xd318b9(0xa6))/0x5*(-parseInt(_0xd318b9(0xa2))/0x6)+parseInt(_0xd318b9(0x99))/0x7+-parseInt(_0xd318b9(0xaa))/0x8+parseInt(_0xd318b9(0x96))/0x9*(parseInt(_0xd318b9(0xa3))/0xa)+parseInt(_0xd318b9(0xa7))/0xb;if(_0x4e6ef0===_0x1b9c60)break;else _0x3fdba2['push'](_0x3fdba2['shift']());}catch(_0x41cfc8){_0x3fdba2['push'](_0x3fdba2['shift']());}}}(a150_0x27e2,0x49a0f));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a150_0x23c460 from'path';function a150_0x5c49(_0x5d46da,_0xbc62db){_0x5d46da=_0x5d46da-0x92;const _0x27e21e=a150_0x27e2();let _0x5c4926=_0x27e21e[_0x5d46da];return _0x5c4926;}function a150_0x27e2(){const _0x4f9409=['2735464INOYPj','join','string','2129336JmeyNK','basename','18464mjgVmb','675018MWDRVF','parse','.push-recovery.json','2240042kxuZqK','.tmp','segments','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','stringify','journeyName','3kUWOsz','toISOString','ENOENT','9822lMETvT','50wrZDCz','warn','debug','365ACcCyU','1131207iCremS','tdx.sdk.push-recovery','28wdFyDI'];a150_0x27e2=function(){return _0x4f9409;};return a150_0x27e2();}import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a150_0x3d225d(0xa8));export function getPushRecoveryPath(_0x4ca94f){const _0x38ff9a=a150_0x3d225d,_0x7d0b56=a150_0x23c460['dirname'](_0x4ca94f),_0x4e6271=a150_0x23c460[_0x38ff9a(0x94)](_0x4ca94f);return a150_0x23c460[_0x38ff9a(0xab)](_0x7d0b56,'.'+_0x4e6271+_0x38ff9a(0x98));}export function readPushRecovery(_0x5c0a95){const _0x3f9d84=a150_0x3d225d,_0x538eb1=getPushRecoveryPath(_0x5c0a95);if(!existsSync(_0x538eb1))return undefined;try{const _0x59c2d4=readFileSync(_0x538eb1,'utf-8'),_0x4e56fc=JSON[_0x3f9d84(0x97)](_0x59c2d4);if(_0x4e56fc?.['version']!==0x1||typeof _0x4e56fc[_0x3f9d84(0x9e)]!==_0x3f9d84(0x92))return undefined;return _0x4e56fc;}catch(_0x1ed62f){return _0x1ed62f instanceof SyntaxError?logger[_0x3f9d84(0xa5)](_0x3f9d84(0x9c)+_0x1ed62f):logger[_0x3f9d84(0xa4)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x1ed62f),undefined;}}export function writePushRecovery(_0x4ad1b5,_0x41a050){const _0x44b3c0=a150_0x3d225d,_0x37da35=getPushRecoveryPath(_0x4ad1b5),_0xbab503=_0x37da35+_0x44b3c0(0x9a);writeFileSync(_0xbab503,JSON[_0x44b3c0(0x9d)](_0x41a050,null,0x2)+'\x0a','utf-8'),renameSync(_0xbab503,_0x37da35);}export function deletePushRecovery(_0x52df3a){const _0x51f1a2=a150_0x3d225d,_0x535d0d=getPushRecoveryPath(_0x52df3a);try{unlinkSync(_0x535d0d);}catch(_0x38cb13){_0x38cb13['code']!==_0x51f1a2(0xa1)&&logger[_0x51f1a2(0xa5)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x38cb13);}}export function saveSegmentToPushRecovery(_0x8f2c30,_0x454d0c,_0x3206cc,_0x24df6b){const _0x4a7e82=a150_0x3d225d,_0x4fe006=readPushRecovery(_0x8f2c30),_0x3a57e8=_0x4fe006?.[_0x4a7e82(0x9e)]===_0x454d0c?{..._0x4fe006,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x454d0c,'updatedAt':new Date()[_0x4a7e82(0xa0)](),'segments':{}};_0x3a57e8[_0x4a7e82(0x9b)][_0x3206cc]=_0x24df6b,writePushRecovery(_0x8f2c30,_0x3a57e8);}
1
+ const a150_0x595e7f=a150_0x2041;(function(_0x4eaede,_0x38296f){const _0x2f7b6f=a150_0x2041,_0x16ebfe=_0x4eaede();while(!![]){try{const _0x16d5d1=-parseInt(_0x2f7b6f(0x119))/0x1+parseInt(_0x2f7b6f(0x106))/0x2*(-parseInt(_0x2f7b6f(0x114))/0x3)+parseInt(_0x2f7b6f(0x113))/0x4+-parseInt(_0x2f7b6f(0x10e))/0x5*(-parseInt(_0x2f7b6f(0x10a))/0x6)+-parseInt(_0x2f7b6f(0x109))/0x7*(-parseInt(_0x2f7b6f(0x110))/0x8)+parseInt(_0x2f7b6f(0x10c))/0x9*(parseInt(_0x2f7b6f(0x11d))/0xa)+parseInt(_0x2f7b6f(0x118))/0xb;if(_0x16d5d1===_0x38296f)break;else _0x16ebfe['push'](_0x16ebfe['shift']());}catch(_0x5246d8){_0x16ebfe['push'](_0x16ebfe['shift']());}}}(a150_0x435c,0x665dd));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a150_0x11ea79 from'path';function a150_0x435c(){const _0x9a2798=['join','dirname','14yqjfTZ','13722bbcNgy','journeyName','1633779YOvWob','ENOENT','85TUiKUg','.push-recovery.json','108232OIrioG','toISOString','segments','1729404PuYWEn','3hzPUhb','string','debug','warn','1946890bvwgUU','421266kthDfL','utf-8','stringify','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','40rFMMht','version','basename','code','tdx.sdk.push-recovery','1121686STRYSd'];a150_0x435c=function(){return _0x9a2798;};return a150_0x435c();}import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a150_0x595e7f(0x105));export function getPushRecoveryPath(_0x3aa4f4){const _0x377926=a150_0x595e7f,_0x87f830=a150_0x11ea79[_0x377926(0x108)](_0x3aa4f4),_0x5c7304=a150_0x11ea79[_0x377926(0x103)](_0x3aa4f4);return a150_0x11ea79[_0x377926(0x107)](_0x87f830,'.'+_0x5c7304+_0x377926(0x10f));}export function readPushRecovery(_0x5a2c3f){const _0x3622c2=a150_0x595e7f,_0x1f72cd=getPushRecoveryPath(_0x5a2c3f);if(!existsSync(_0x1f72cd))return undefined;try{const _0x46d306=readFileSync(_0x1f72cd,_0x3622c2(0x11a)),_0x18f759=JSON['parse'](_0x46d306);if(_0x18f759?.[_0x3622c2(0x102)]!==0x1||typeof _0x18f759[_0x3622c2(0x10b)]!==_0x3622c2(0x115))return undefined;return _0x18f759;}catch(_0x3d0e27){return _0x3d0e27 instanceof SyntaxError?logger[_0x3622c2(0x116)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x3d0e27):logger[_0x3622c2(0x117)](_0x3622c2(0x11c)+_0x3d0e27),undefined;}}export function writePushRecovery(_0x3a55e7,_0x423305){const _0x146f20=a150_0x595e7f,_0x3c6e69=getPushRecoveryPath(_0x3a55e7),_0x3bd842=_0x3c6e69+'.tmp';writeFileSync(_0x3bd842,JSON[_0x146f20(0x11b)](_0x423305,null,0x2)+'\x0a',_0x146f20(0x11a)),renameSync(_0x3bd842,_0x3c6e69);}export function deletePushRecovery(_0xb8f8fe){const _0x3f8652=a150_0x595e7f,_0xec21aa=getPushRecoveryPath(_0xb8f8fe);try{unlinkSync(_0xec21aa);}catch(_0x172694){_0x172694[_0x3f8652(0x104)]!==_0x3f8652(0x10d)&&logger['debug']('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x172694);}}function a150_0x2041(_0x5e9d07,_0x5dc5be){_0x5e9d07=_0x5e9d07-0x102;const _0x435ccb=a150_0x435c();let _0x204168=_0x435ccb[_0x5e9d07];return _0x204168;}export function saveSegmentToPushRecovery(_0x20530e,_0xbe48cf,_0xe60124,_0x1a12ec){const _0x525842=a150_0x595e7f,_0x43dfd0=readPushRecovery(_0x20530e),_0x21c354=_0x43dfd0?.['journeyName']===_0xbe48cf?{..._0x43dfd0,'updatedAt':new Date()[_0x525842(0x111)]()}:{'version':0x1,'journeyName':_0xbe48cf,'updatedAt':new Date()[_0x525842(0x111)](),'segments':{}};_0x21c354[_0x525842(0x112)][_0xe60124]=_0x1a12ec,writePushRecovery(_0x20530e,_0x21c354);}