@treasuredata/tdx 0.10.0 → 0.11.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 (163) hide show
  1. package/dist/bin.js +1 -1
  2. package/dist/build-info.json +2 -2
  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/api-command.js +1 -1
  10. package/dist/commands/auth-command.js +1 -1
  11. package/dist/commands/chat-command.js +1 -1
  12. package/dist/commands/claude-command.js +1 -1
  13. package/dist/commands/claude-statusline-command.js +1 -1
  14. package/dist/commands/claude-usage-command.js +1 -1
  15. package/dist/commands/command.js +1 -1
  16. package/dist/commands/connection-command.js +1 -1
  17. package/dist/commands/context-command.js +1 -1
  18. package/dist/commands/databases.js +1 -1
  19. package/dist/commands/describe.js +1 -1
  20. package/dist/commands/engage-command.js +1 -1
  21. package/dist/commands/job-command.js +1 -1
  22. package/dist/commands/journey-command.js +1 -1
  23. package/dist/commands/journey-validate-command.js +1 -1
  24. package/dist/commands/llm-command.js +1 -1
  25. package/dist/commands/llm-proxy.js +1 -1
  26. package/dist/commands/parent-segment-command.js +1 -1
  27. package/dist/commands/profiles-command.js +1 -1
  28. package/dist/commands/query-command.js +1 -1
  29. package/dist/commands/segment-command.js +1 -1
  30. package/dist/commands/segment-create-command.js +1 -1
  31. package/dist/commands/segment-fields-command.js +1 -1
  32. package/dist/commands/segment-pull-command.js +1 -1
  33. package/dist/commands/segment-push-command.js +1 -1
  34. package/dist/commands/segment-update-command.js +1 -1
  35. package/dist/commands/segment-use-command.js +1 -1
  36. package/dist/commands/segment-validate-command.js +1 -1
  37. package/dist/commands/segments.js +1 -1
  38. package/dist/commands/show.js +1 -1
  39. package/dist/commands/tables.js +1 -1
  40. package/dist/commands/use-command.js +1 -1
  41. package/dist/commands/user-command.js +1 -1
  42. package/dist/commands/workflow-command.d.ts +73 -3
  43. package/dist/commands/workflow-command.d.ts.map +1 -1
  44. package/dist/commands/workflow-command.js +1 -1
  45. package/dist/commands/workflow-command.js.map +1 -1
  46. package/dist/core/auth.js +1 -1
  47. package/dist/core/command-output.d.ts +1 -1
  48. package/dist/core/command-output.d.ts.map +1 -1
  49. package/dist/core/command-output.js +1 -1
  50. package/dist/core/config.js +1 -1
  51. package/dist/core/connection-cache.js +1 -1
  52. package/dist/core/constants.js +1 -1
  53. package/dist/core/credential-cache.js +1 -1
  54. package/dist/core/global-context.d.ts +1 -0
  55. package/dist/core/global-context.d.ts.map +1 -1
  56. package/dist/core/global-context.js +1 -1
  57. package/dist/core/global-context.js.map +1 -1
  58. package/dist/core/keychain.js +1 -1
  59. package/dist/core/profile.js +1 -1
  60. package/dist/core/project-config.js +1 -1
  61. package/dist/core/session.d.ts +1 -0
  62. package/dist/core/session.d.ts.map +1 -1
  63. package/dist/core/session.js +1 -1
  64. package/dist/core/session.js.map +1 -1
  65. package/dist/core/user-cache.js +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/proxy/anthropic-adapter.js +1 -1
  68. package/dist/proxy/claude-usage-tracker.js +1 -1
  69. package/dist/proxy/context-signature.js +1 -1
  70. package/dist/proxy/conversation-utils.js +1 -1
  71. package/dist/proxy/server.js +1 -1
  72. package/dist/proxy/session-cache.js +1 -1
  73. package/dist/sdk/agent/agent-config.js +1 -1
  74. package/dist/sdk/agent/agent-ref-parser.js +1 -1
  75. package/dist/sdk/agent/agent-yaml.js +1 -1
  76. package/dist/sdk/api.js +1 -1
  77. package/dist/sdk/client/cdp-api-client.js +1 -1
  78. package/dist/sdk/client/endpoints.js +1 -1
  79. package/dist/sdk/client/engage-api-client.js +1 -1
  80. package/dist/sdk/client/http-client.js +1 -1
  81. package/dist/sdk/client/llm-api-client.js +1 -1
  82. package/dist/sdk/client/rate-limiter.js +1 -1
  83. package/dist/sdk/client/td-api-client.js +1 -1
  84. package/dist/sdk/client/trino-api-client.js +1 -1
  85. package/dist/sdk/client/workflow-client.d.ts +32 -4
  86. package/dist/sdk/client/workflow-client.d.ts.map +1 -1
  87. package/dist/sdk/client/workflow-client.js +1 -1
  88. package/dist/sdk/client/workflow-client.js.map +1 -1
  89. package/dist/sdk/connection-validator.d.ts +10 -6
  90. package/dist/sdk/connection-validator.d.ts.map +1 -1
  91. package/dist/sdk/connection-validator.js +1 -1
  92. package/dist/sdk/connection-validator.js.map +1 -1
  93. package/dist/sdk/connection.js +1 -1
  94. package/dist/sdk/engage.js +1 -1
  95. package/dist/sdk/errors.d.ts +2 -0
  96. package/dist/sdk/errors.d.ts.map +1 -1
  97. package/dist/sdk/errors.js +1 -1
  98. package/dist/sdk/errors.js.map +1 -1
  99. package/dist/sdk/index.js +1 -1
  100. package/dist/sdk/io/index.js +1 -1
  101. package/dist/sdk/io/node-filesystem.js +1 -1
  102. package/dist/sdk/job.js +1 -1
  103. package/dist/sdk/journey.js +1 -1
  104. package/dist/sdk/llm/chat-cache.js +1 -1
  105. package/dist/sdk/llm/index.js +1 -1
  106. package/dist/sdk/llm/llm-backup-utils.js +1 -1
  107. package/dist/sdk/llm/model-aliases.js +1 -1
  108. package/dist/sdk/llm/model-factors.js +1 -1
  109. package/dist/sdk/query/index.js +1 -1
  110. package/dist/sdk/query/sql-parser.js +1 -1
  111. package/dist/sdk/segment/child-segment-yaml.js +1 -1
  112. package/dist/sdk/segment/fields-display.js +1 -1
  113. package/dist/sdk/segment/file-discovery.js +1 -1
  114. package/dist/sdk/segment/journey-utils.js +1 -1
  115. package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
  116. package/dist/sdk/segment/journey-yaml.js +1 -1
  117. package/dist/sdk/segment/journey-yaml.js.map +1 -1
  118. package/dist/sdk/segment/parent-segment-preview.js +1 -1
  119. package/dist/sdk/segment/parent-segment-yaml.js +1 -1
  120. package/dist/sdk/segment/pull-workflow.js +1 -1
  121. package/dist/sdk/segment/push-workflow.js +1 -1
  122. package/dist/sdk/segment/push-workflow.js.map +1 -1
  123. package/dist/sdk/segment/resolution-context.js +1 -1
  124. package/dist/sdk/segment/segment-path-parser.js +1 -1
  125. package/dist/sdk/segment/segment-ref-parser.js +1 -1
  126. package/dist/sdk/segment/target-resolution.js +1 -1
  127. package/dist/sdk/segment/tdx-config.js +1 -1
  128. package/dist/sdk/segment/validate-files.js +1 -1
  129. package/dist/sdk/segment/yaml-validator.js +1 -1
  130. package/dist/sdk/segment.js +1 -1
  131. package/dist/sdk/types/cdp.d.ts +5 -2
  132. package/dist/sdk/types/cdp.d.ts.map +1 -1
  133. package/dist/sdk/types/index.d.ts +1 -0
  134. package/dist/sdk/types/index.d.ts.map +1 -1
  135. package/dist/sdk/types/index.js +1 -1
  136. package/dist/sdk/types/index.js.map +1 -1
  137. package/dist/sdk/types/progress.js +1 -1
  138. package/dist/sdk/user.js +1 -1
  139. package/dist/sdk/util/format-detector.js +1 -1
  140. package/dist/sdk/util/formatters.js +1 -1
  141. package/dist/sdk/util/index.js +1 -1
  142. package/dist/sdk/util/tree-formatter.js +1 -1
  143. package/dist/sdk/workflow/index.d.ts +74 -4
  144. package/dist/sdk/workflow/index.d.ts.map +1 -1
  145. package/dist/sdk/workflow/index.js +1 -1
  146. package/dist/sdk/workflow/index.js.map +1 -1
  147. package/dist/sdk/workflow/workflow-utils.js +1 -1
  148. package/dist/utils/async.js +1 -1
  149. package/dist/utils/colors.js +1 -1
  150. package/dist/utils/diff.js +1 -1
  151. package/dist/utils/file-permissions.js +1 -1
  152. package/dist/utils/json-loader.js +1 -1
  153. package/dist/utils/option-validation.js +1 -1
  154. package/dist/utils/port.js +1 -1
  155. package/dist/utils/process.js +1 -1
  156. package/dist/utils/prompt.js +1 -1
  157. package/dist/utils/spinner.js +1 -1
  158. package/dist/utils/sse-parser.js +1 -1
  159. package/dist/utils/string-utils.js +1 -1
  160. package/dist/utils/table-ref-parser.js +1 -1
  161. package/dist/utils/tdx-logger.js +1 -1
  162. package/dist/utils/version-check.js +1 -1
  163. package/package.json +1 -1
@@ -1 +1 @@
1
- const a24_0x3095c9=a24_0x2c51;(function(_0x57551e,_0x3cce12){const _0x59fa4e=a24_0x2c51,_0x17adc4=_0x57551e();while(!![]){try{const _0x48e9e7=parseInt(_0x59fa4e(0x197))/0x1*(parseInt(_0x59fa4e(0x1b7))/0x2)+-parseInt(_0x59fa4e(0x1a2))/0x3*(-parseInt(_0x59fa4e(0x18b))/0x4)+parseInt(_0x59fa4e(0x193))/0x5*(parseInt(_0x59fa4e(0x1aa))/0x6)+parseInt(_0x59fa4e(0x190))/0x7+parseInt(_0x59fa4e(0x184))/0x8*(-parseInt(_0x59fa4e(0x18a))/0x9)+-parseInt(_0x59fa4e(0x1a6))/0xa+-parseInt(_0x59fa4e(0x1b3))/0xb*(parseInt(_0x59fa4e(0x1ac))/0xc);if(_0x48e9e7===_0x3cce12)break;else _0x17adc4['push'](_0x17adc4['shift']());}catch(_0x3059eb){_0x17adc4['push'](_0x17adc4['shift']());}}}(a24_0x5769,0xee2b4));import{BaseCommand}from'./command.js';function a24_0x2c51(_0x3d0f52,_0x4b7834){_0x3d0f52=_0x3d0f52-0x184;const _0x576942=a24_0x5769();let _0x2c515c=_0x576942[_0x3d0f52];return _0x2c515c;}import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';function a24_0x5769(){const _0x152297=['5TWRrWz','stats','Schema:\x20','\x20rows\x20','267kodKEY','description','push','file','setPhase','elapsedTimeMillis','Executing\x20query...','validate','No\x20SQL\x20provided','completedSplits','Error:\x20','466197yQERbt','output','\x20splits','execute','1326080pxCCxp','verbose','site','error','205284dMgqtP','Site:\x20','24jbFUrZ','information_schema','args','jobId','Catalog:\x20','message','\x20[Job\x20ID:\x20','12268058nPPudG','Run\x20Trino\x20queries\x20(streaming)','\x0aAll\x20results\x20saved\x20to\x20','setExtra','13506atBDLc','length','totalSplits','...','Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options','setJobId','processedRows','Statement\x20','8GNHLQI','state','query','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','catalog','originalMessage','6814638SWHrsP','44OvybEy','data','join','Query\x20completed:\x20Processed\x20','database','3844624ELzHHX','options','Executing\x20statement\x20'];a24_0x5769=function(){return _0x152297;};return a24_0x5769();}export class QueryCommand extends BaseCommand{['name']=a24_0x3095c9(0x186);[a24_0x3095c9(0x198)]=a24_0x3095c9(0x1b4);async['execute'](_0x2e2629){const _0xc51519=a24_0x3095c9,{options:_0x2b65cc,args:_0x5157f0,tdx:_0x3dfa70}=_0x2e2629,_0x11f073=_0x5157f0[0x0],_0x1822d3=_0x2b65cc[_0xc51519(0x19a)];let _0x470efe;try{if(_0x1822d3)_0x470efe=readSqlStatementsFromFile(_0x1822d3);else{if(_0x11f073==='-')_0x470efe=await readSqlStatementsFromStdin();else{if(_0x11f073&&isSqlFilePath(_0x11f073))_0x470efe=readSqlStatementsFromFile(_0x11f073);else{if(_0x11f073)_0x470efe=splitSqlStatements(_0x11f073);else throw new Error(_0xc51519(0x19f));}}}}catch(_0x26d363){return console[_0xc51519(0x1a9)](_0xc51519(0x1a1)+_0x26d363['message']),0x1;}const _0x6bc25e=_0x2b65cc[_0xc51519(0x18f)]||_0xc51519(0x1ad),_0x3fbcf1=_0x2b65cc[_0xc51519(0x188)];try{const _0x83d933=[],_0x57efef=!!_0x2b65cc[_0xc51519(0x1a3)];for(let _0x5d1559=0x0;_0x5d1559<_0x470efe[_0xc51519(0x1b8)];_0x5d1559++){const _0x590018=_0x470efe[_0x5d1559],_0x3ea185=_0x5d1559+0x1,_0x50ace8=_0x470efe['length'],_0x54a0f1=_0x50ace8>0x1;_0x2b65cc[_0xc51519(0x1a7)]&&(console[_0xc51519(0x1a9)]('\x0a'+(_0x54a0f1?_0xc51519(0x1be)+_0x3ea185+'/'+_0x50ace8+':':'')),console[_0xc51519(0x1a9)](_0xc51519(0x1ab)+_0x2b65cc[_0xc51519(0x1a8)]),console[_0xc51519(0x1a9)](_0xc51519(0x1b0)+(_0x3fbcf1||'td')),console[_0xc51519(0x1a9)](_0xc51519(0x195)+_0x6bc25e),console[_0xc51519(0x1a9)]('SQL:\x20'+_0x590018));const _0x5cbf5f=_0x54a0f1?_0xc51519(0x192)+_0x3ea185+'/'+_0x50ace8+_0xc51519(0x1ba):_0xc51519(0x19d);try{const _0x3ac77a=await withProgressSpinner(_0x5cbf5f,async _0x80b481=>{const _0x4ea307=_0xc51519,_0x445a3f=await _0x3dfa70[_0x4ea307(0x186)][_0x4ea307(0x1a5)](_0x590018,{'catalog':_0x3fbcf1,'schema':_0x6bc25e,'onJobId':_0x5b5906=>{const _0xe95716=_0x4ea307;_0x80b481[_0xe95716(0x1bc)](_0x5b5906);},'onProgress':_0x694634=>{const _0x711e1b=_0x4ea307;_0x80b481[_0x711e1b(0x19b)]('Executing\x20query\x20['+_0x694634[_0x711e1b(0x185)]+']'),_0x80b481[_0x711e1b(0x1b6)](formatRows(_0x694634[_0x711e1b(0x1bd)])+'\x20rows\x20'+_0x694634[_0x711e1b(0x1a0)]+'/'+_0x694634[_0x711e1b(0x1b9)]+_0x711e1b(0x1a4));}});return _0x445a3f;},{'verbose':_0x2b65cc['verbose']}),_0x20ded2=_0x3ac77a[_0xc51519(0x18c)],_0x20d9d0=_0x20ded2[_0xc51519(0x1af)]?_0xc51519(0x1b2)+_0x20ded2[_0xc51519(0x1af)]+']':'',_0x34a13d=_0x54a0f1?_0xc51519(0x1be)+_0x3ea185+'/'+_0x50ace8+'\x20-\x20':'';console[_0xc51519(0x1a9)]('✔\x20'+_0x34a13d+_0xc51519(0x18e)+formatRows(_0x20ded2['stats'][_0xc51519(0x1bd)])+_0xc51519(0x196)+('in\x20'+formatElapsed(_0x20ded2[_0xc51519(0x194)][_0xc51519(0x19c)])+_0x20d9d0));if(_0x54a0f1&&_0x57efef){const _0x58fc84=resolveOutputOptions(_0x2b65cc),_0x81b1e2=await formatQueryOutput(_0x20ded2,_0x58fc84);_0x83d933[_0xc51519(0x199)](_0x81b1e2);}else await handleQueryOutput(_0x20ded2,_0x2b65cc);}catch(_0x46e676){const _0x385e6a=_0x54a0f1?_0xc51519(0x1be)+_0x3ea185+'/'+_0x50ace8+':\x0a':'',_0x2e7b38=_0x46e676 instanceof SDKError?_0x46e676[_0xc51519(0x189)]:_0x46e676[_0xc51519(0x1b1)];return console[_0xc51519(0x1a9)](''+_0x385e6a+_0x2e7b38),0x1;}}if(_0x470efe[_0xc51519(0x1b8)]>0x1&&_0x57efef&&_0x83d933['length']>0x0){const _0x1d12e1=_0x83d933[_0xc51519(0x18d)]('\x0a');writeFileSync(_0x2b65cc[_0xc51519(0x1a3)],_0x1d12e1),console[_0xc51519(0x1a9)](_0xc51519(0x1b5)+_0x2b65cc[_0xc51519(0x1a3)]);}return 0x0;}catch(_0xaed478){throw _0xaed478;}}[a24_0x3095c9(0x19e)](_0x293d4c){const _0x41535a=a24_0x3095c9,_0x3133de=_0x293d4c[_0x41535a(0x1ae)][0x0],_0x187489=_0x293d4c[_0x41535a(0x191)][_0x41535a(0x19a)];if(!_0x3133de&&!_0x187489)return _0x41535a(0x1bb);if(_0x3133de&&_0x187489)return _0x41535a(0x187);return undefined;}}
1
+ const a24_0x53d713=a24_0x1c6b;(function(_0x5aa665,_0x4fc59b){const _0x2850d0=a24_0x1c6b,_0x367a28=_0x5aa665();while(!![]){try{const _0x3744e6=-parseInt(_0x2850d0(0x1ba))/0x1*(parseInt(_0x2850d0(0x1be))/0x2)+-parseInt(_0x2850d0(0x1e3))/0x3*(parseInt(_0x2850d0(0x1df))/0x4)+-parseInt(_0x2850d0(0x1e7))/0x5+parseInt(_0x2850d0(0x1c1))/0x6*(parseInt(_0x2850d0(0x1c8))/0x7)+parseInt(_0x2850d0(0x1e5))/0x8+-parseInt(_0x2850d0(0x1d8))/0x9*(-parseInt(_0x2850d0(0x1db))/0xa)+-parseInt(_0x2850d0(0x1d3))/0xb;if(_0x3744e6===_0x4fc59b)break;else _0x367a28['push'](_0x367a28['shift']());}catch(_0x19132a){_0x367a28['push'](_0x367a28['shift']());}}}(a24_0x2279,0xe0fba));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';import{readSqlStatementsFromFile,readSqlStatementsFromStdin,splitSqlStatements,isSqlFilePath}from'../sdk/query/sql-parser.js';import{writeFileSync}from'fs';import{withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{formatRows}from'../sdk/util/formatters.js';export class QueryCommand extends BaseCommand{[a24_0x53d713(0x1e0)]=a24_0x53d713(0x1b9);[a24_0x53d713(0x1d1)]=a24_0x53d713(0x1c6);async['execute'](_0x3c2501){const _0x4d39d1=a24_0x53d713,{options:_0x61224d,args:_0x163b09,tdx:_0x196be8}=_0x3c2501,_0x838f71=_0x163b09[0x0],_0x40d690=_0x61224d[_0x4d39d1(0x1cb)];let _0x19fe98;try{if(_0x40d690)_0x19fe98=readSqlStatementsFromFile(_0x40d690);else{if(_0x838f71==='-')_0x19fe98=await readSqlStatementsFromStdin();else{if(_0x838f71&&isSqlFilePath(_0x838f71))_0x19fe98=readSqlStatementsFromFile(_0x838f71);else{if(_0x838f71)_0x19fe98=splitSqlStatements(_0x838f71);else throw new Error(_0x4d39d1(0x1e9));}}}}catch(_0x2d7a9d){return console[_0x4d39d1(0x1dd)](_0x4d39d1(0x1e4)+_0x2d7a9d[_0x4d39d1(0x1d5)]),0x1;}const _0x20a162=_0x61224d[_0x4d39d1(0x1bd)]||_0x4d39d1(0x1d9),_0x547ebe=_0x61224d[_0x4d39d1(0x1cf)];try{const _0x3ca96f=[],_0x2a8081=!!_0x61224d[_0x4d39d1(0x1d0)];for(let _0x2d11b8=0x0;_0x2d11b8<_0x19fe98[_0x4d39d1(0x1dc)];_0x2d11b8++){const _0x4e35e9=_0x19fe98[_0x2d11b8],_0x5bc4d3=_0x2d11b8+0x1,_0x31951d=_0x19fe98[_0x4d39d1(0x1dc)],_0x1bb64a=_0x31951d>0x1;_0x61224d['verbose']&&(console[_0x4d39d1(0x1dd)]('\x0a'+(_0x1bb64a?'Statement\x20'+_0x5bc4d3+'/'+_0x31951d+':':'')),console['error']('Site:\x20'+_0x61224d['site']),console[_0x4d39d1(0x1dd)]('Catalog:\x20'+(_0x547ebe||'td')),console[_0x4d39d1(0x1dd)](_0x4d39d1(0x1bb)+_0x20a162),console[_0x4d39d1(0x1dd)](_0x4d39d1(0x1cc)+_0x4e35e9));const _0x26259d=_0x1bb64a?_0x4d39d1(0x1c4)+_0x5bc4d3+'/'+_0x31951d+_0x4d39d1(0x1d7):_0x4d39d1(0x1ca);try{const _0x455113=await withProgressSpinner(_0x26259d,async _0x15a3bb=>{const _0xa3bd1d=_0x4d39d1,_0xc67de4=await _0x196be8[_0xa3bd1d(0x1b9)][_0xa3bd1d(0x1bc)](_0x4e35e9,{'catalog':_0x547ebe,'schema':_0x20a162,'onJobId':_0x4f1010=>{_0x15a3bb['setJobId'](_0x4f1010);},'onProgress':_0x2cfe02=>{const _0x158b41=_0xa3bd1d;_0x15a3bb[_0x158b41(0x1e2)](_0x158b41(0x1c5)+_0x2cfe02[_0x158b41(0x1e6)]+']'),_0x15a3bb[_0x158b41(0x1c7)](formatRows(_0x2cfe02[_0x158b41(0x1c2)])+_0x158b41(0x1cd)+_0x2cfe02[_0x158b41(0x1ea)]+'/'+_0x2cfe02['totalSplits']+_0x158b41(0x1c0));}});return _0xc67de4;},{'verbose':_0x61224d['verbose']}),_0x3ca766=_0x455113['data'],_0x5cc79b=_0x3ca766[_0x4d39d1(0x1c9)]?'\x20[Job\x20ID:\x20'+_0x3ca766[_0x4d39d1(0x1c9)]+']':'',_0x5e314d=_0x1bb64a?_0x4d39d1(0x1d6)+_0x5bc4d3+'/'+_0x31951d+_0x4d39d1(0x1ce):'';console[_0x4d39d1(0x1dd)]('✔\x20'+_0x5e314d+_0x4d39d1(0x1da)+formatRows(_0x3ca766[_0x4d39d1(0x1e1)][_0x4d39d1(0x1c2)])+_0x4d39d1(0x1cd)+('in\x20'+formatElapsed(_0x3ca766[_0x4d39d1(0x1e1)]['elapsedTimeMillis'])+_0x5cc79b));if(_0x1bb64a&&_0x2a8081){const _0x2012aa=resolveOutputOptions(_0x61224d),_0x5c437b=await formatQueryOutput(_0x3ca766,_0x2012aa);_0x3ca96f[_0x4d39d1(0x1bf)](_0x5c437b);}else await handleQueryOutput(_0x3ca766,_0x61224d);}catch(_0x440ec9){const _0x5db097=_0x1bb64a?_0x4d39d1(0x1d6)+_0x5bc4d3+'/'+_0x31951d+':\x0a':'',_0x460782=_0x440ec9 instanceof SDKError?_0x440ec9[_0x4d39d1(0x1e8)]:_0x440ec9[_0x4d39d1(0x1d5)];return console['error'](''+_0x5db097+_0x460782),0x1;}}if(_0x19fe98['length']>0x1&&_0x2a8081&&_0x3ca96f[_0x4d39d1(0x1dc)]>0x0){const _0x11ef1f=_0x3ca96f['join']('\x0a');writeFileSync(_0x61224d[_0x4d39d1(0x1d0)],_0x11ef1f),console['error'](_0x4d39d1(0x1b8)+_0x61224d['output']);}return 0x0;}catch(_0x41e0e2){throw _0x41e0e2;}}[a24_0x53d713(0x1d4)](_0x31d3dc){const _0x322d30=a24_0x53d713,_0x4a18d8=_0x31d3dc[_0x322d30(0x1c3)][0x0],_0x58dbf4=_0x31d3dc[_0x322d30(0x1de)][_0x322d30(0x1cb)];if(!_0x4a18d8&&!_0x58dbf4)return'Usage:\x20tdx\x20query\x20\x22SELECT\x20*\x20FROM\x20table\x22\x0a\x20\x20\x20or:\x20tdx\x20query\x20query.sql\x0a\x20\x20\x20or:\x20echo\x20\x22SELECT\x201\x22\x20|\x20tdx\x20query\x20-\x0a\x0aRun\x20\x27tdx\x20query\x20--help\x27\x20for\x20more\x20options';if(_0x4a18d8&&_0x58dbf4)return _0x322d30(0x1d2);return undefined;}}function a24_0x1c6b(_0xde9bc2,_0x30b255){_0xde9bc2=_0xde9bc2-0x1b8;const _0x2279ef=a24_0x2279();let _0x1c6bf5=_0x2279ef[_0xde9bc2];return _0x1c6bf5;}function a24_0x2279(){const _0x183d5c=['\x0aAll\x20results\x20saved\x20to\x20','query','10540gLWwdC','Schema:\x20','execute','database','8zaojLh','push','\x20splits','9022326LVcNcZ','processedRows','args','Executing\x20statement\x20','Executing\x20query\x20[','Run\x20Trino\x20queries\x20(streaming)','setExtra','7smlQZp','jobId','Executing\x20query...','file','SQL:\x20','\x20rows\x20','\x20-\x20','catalog','output','description','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','13206193zAiNBk','validate','message','Statement\x20','...','1807479PQRhrD','information_schema','Query\x20completed:\x20Processed\x20','40alNuBQ','length','error','options','12CPdehL','name','stats','setPhase','1024317QdxzWO','Error:\x20','12165632bLwaws','state','3195895HbWbWj','originalMessage','No\x20SQL\x20provided','completedSplits'];a24_0x2279=function(){return _0x183d5c;};return a24_0x2279();}
@@ -1 +1 @@
1
- const a25_0x29b0fd=a25_0x52ee;(function(_0x20b287,_0xff2c69){const _0xa32e52=a25_0x52ee,_0x410659=_0x20b287();while(!![]){try{const _0x4c9a0f=parseInt(_0xa32e52(0x151))/0x1+parseInt(_0xa32e52(0xdc))/0x2*(parseInt(_0xa32e52(0xd2))/0x3)+parseInt(_0xa32e52(0xc7))/0x4*(parseInt(_0xa32e52(0x10b))/0x5)+parseInt(_0xa32e52(0x141))/0x6+-parseInt(_0xa32e52(0xcc))/0x7*(parseInt(_0xa32e52(0x146))/0x8)+parseInt(_0xa32e52(0x10d))/0x9+-parseInt(_0xa32e52(0x155))/0xa*(parseInt(_0xa32e52(0xc3))/0xb);if(_0x4c9a0f===_0xff2c69)break;else _0x410659['push'](_0x410659['shift']());}catch(_0x208afd){_0x410659['push'](_0x410659['shift']());}}}(a25_0x48a6,0xda3fb));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';function a25_0x52ee(_0x51239d,_0x34214c){_0x51239d=_0x51239d-0xbe;const _0x48a614=a25_0x48a6();let _0x52eec5=_0x48a614[_0x51239d];return _0x52eec5;}import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x19b9f5 from'chalk';async function resolveSegmentTarget(_0x1d91f5,_0x15e21d,_0x3c59cd){const _0x20d3fc=a25_0x52ee;if(isYamlFilePath(_0x1d91f5))try{const _0x54f707=await resolveYamlFilePath(_0x1d91f5);return _0x3c59cd&&(console[_0x20d3fc(0x14d)](_0x20d3fc(0x135)+_0x1d91f5),console[_0x20d3fc(0x14d)]('\x20\x20Parent\x20segment:\x20'+_0x54f707[_0x20d3fc(0x127)]),console[_0x20d3fc(0x14d)](_0x20d3fc(0x121)+_0x54f707[_0x20d3fc(0xfa)]),console[_0x20d3fc(0x14d)](_0x20d3fc(0x138)+(_0x54f707[_0x20d3fc(0xdb)]||'(root)')),console[_0x20d3fc(0x14d)](_0x20d3fc(0x15a)+_0x54f707[_0x20d3fc(0x102)])),_0x54f707[_0x20d3fc(0x102)];}catch(_0x32c650){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x32c650[_0x20d3fc(0x130)]);}if(!_0x15e21d)throw new SDKError(ErrorCode[_0x20d3fc(0x140)],_0x20d3fc(0xd3));return _0x15e21d+'/'+_0x1d91f5;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x29b0fd(0x113)]=a25_0x29b0fd(0xe0);[a25_0x29b0fd(0xdd)]=a25_0x29b0fd(0xda);async[a25_0x29b0fd(0xe9)](_0x5d2506){const _0x1b0377=a25_0x29b0fd,{options:_0x5ccef5,args:_0x1a0206,tdx:_0x351fca}=_0x5d2506,_0x3a2ec6=_0x1a0206[0x0],_0xc3934a=!_0x3a2ec6&&!!_0x5ccef5[_0x1b0377(0x127)],_0x199bf6=_0x3a2ec6||_0x5ccef5['parentSegment'];if(!_0x199bf6)return console['error'](_0x1b0377(0x150)),console[_0x1b0377(0x14d)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0x1b0377(0x14d)](_0x1b0377(0x12d)),console[_0x1b0377(0x14d)](_0x1b0377(0xc8)),console['error'](_0x1b0377(0xcb)),console[_0x1b0377(0x14d)](_0x1b0377(0x11e)),console[_0x1b0377(0x14d)]('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x246eff=_0x5ccef5[_0x1b0377(0xf5)];let _0x4fde52=_0x199bf6;!_0xc3934a&&_0x246eff&&!_0x199bf6[_0x1b0377(0xfc)]('/')&&(_0x4fde52=_0x246eff+'/'+_0x199bf6,_0x5ccef5[_0x1b0377(0xcd)]&&console[_0x1b0377(0x14d)](_0x1b0377(0x10c)+_0x4fde52));const _0x3cb201=await withSpinner('Resolving\x20path\x20\x27'+_0x4fde52+_0x1b0377(0x14f),()=>_0x351fca[_0x1b0377(0x15b)]['resolvePathToResource'](_0x4fde52),{'verbose':_0x5ccef5[_0x1b0377(0xcd)]}),_0x8b2f24=_0x3cb201[_0x1b0377(0x11a)];_0x5ccef5[_0x1b0377(0xcd)]&&(console[_0x1b0377(0x14d)](_0x1b0377(0x157)+_0x8b2f24[_0x1b0377(0xc2)]),console['error'](_0x1b0377(0x123)+_0x8b2f24[_0x1b0377(0x118)]),_0x8b2f24[_0x1b0377(0xf0)]&&console[_0x1b0377(0x14d)](_0x1b0377(0xc1)+_0x8b2f24[_0x1b0377(0xf0)]),_0x8b2f24[_0x1b0377(0x13e)]&&console[_0x1b0377(0x14d)](_0x1b0377(0xbf)+_0x8b2f24[_0x1b0377(0x13e)]));if(_0x8b2f24['type']===_0x1b0377(0xd5)){const _0x31dcbf=await withSpinner(_0x1b0377(0x105),()=>_0x351fca[_0x1b0377(0x15b)][_0x1b0377(0xed)](_0x8b2f24[_0x1b0377(0x118)]),{'verbose':_0x5ccef5[_0x1b0377(0xcd)]});await handleSingleObjectOutput(_0x31dcbf[_0x1b0377(0x11a)],_0x5ccef5);}else{if(_0x8b2f24[_0x1b0377(0xc2)]==='folder'){if(!_0x8b2f24[_0x1b0377(0xf0)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x1b0377(0xc6));const _0x43d85d=await withSpinner(_0x1b0377(0xff),()=>_0x351fca[_0x1b0377(0x15b)]['getFolder'](_0x8b2f24[_0x1b0377(0xf0)]),{'verbose':_0x5ccef5[_0x1b0377(0xcd)]});await handleSingleObjectOutput(_0x43d85d[_0x1b0377(0x11a)],_0x5ccef5);}else{if(_0x8b2f24[_0x1b0377(0xc2)]===_0x1b0377(0x15b)){if(!_0x8b2f24['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1b0377(0xe2));const _0xd33121=await withSpinner(_0x1b0377(0x13d),()=>_0x351fca['segment']['getSegment'](_0x8b2f24[_0x1b0377(0x118)],_0x8b2f24[_0x1b0377(0x13e)]),{'verbose':_0x5ccef5[_0x1b0377(0xcd)]});await handleSingleObjectOutput(_0xd33121[_0x1b0377(0x11a)],_0x5ccef5);}}}return 0x0;}catch(_0x4b042c){if(_0x4b042c instanceof SDKError)return console[_0x1b0377(0x14d)]('Error:\x20'+_0x4b042c['message']),_0x4b042c['cause']&&console[_0x1b0377(0x14d)](_0x1b0377(0xef)+_0x4b042c[_0x1b0377(0xe7)]),0x1;throw _0x4b042c;}}}export class SegmentShowCommand extends BaseCommand{['name']=a25_0x29b0fd(0xc0);[a25_0x29b0fd(0xdd)]=a25_0x29b0fd(0xf8);async[a25_0x29b0fd(0xe9)](_0x541ad5){const _0x123add=a25_0x29b0fd,{options:_0x2f885d,args:_0x1f2870,tdx:_0x277206}=_0x541ad5,_0x577028=_0x1f2870[0x0];if(!_0x577028)return console['error'](_0x123add(0x11f)),console['error'](_0x123add(0xf2)),console['error'](_0x123add(0x107)),console[_0x123add(0x14d)](_0x123add(0x12d)),console['error'](_0x123add(0x15c)),console[_0x123add(0x14d)](_0x123add(0x145)),0x1;try{const _0x336760=_0x2f885d['parentSegment'],_0x324830=await resolveSegmentTarget(_0x577028,_0x336760,_0x2f885d['verbose']);_0x2f885d[_0x123add(0xcd)]&&console[_0x123add(0x14d)](_0x123add(0xce)+_0x324830);const _0x8f791f=await withSpinner(_0x123add(0x108)+_0x577028+_0x123add(0x14f),()=>_0x277206[_0x123add(0x15b)][_0x123add(0x14b)](_0x324830),{'verbose':_0x2f885d[_0x123add(0xcd)]}),_0x5bfca8=_0x8f791f[_0x123add(0x11a)];_0x2f885d[_0x123add(0xcd)]&&(console[_0x123add(0x14d)](_0x123add(0x157)+_0x5bfca8[_0x123add(0xc2)]),console[_0x123add(0x14d)](_0x123add(0x123)+_0x5bfca8[_0x123add(0x118)]));if(_0x5bfca8[_0x123add(0xc2)]===_0x123add(0x132))return console[_0x123add(0x14d)](_0x123add(0xe1)),console[_0x123add(0x14d)](_0x123add(0x129)),0x1;if(_0x5bfca8['type']===_0x123add(0xd5))return console[_0x123add(0x14d)]('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x123add(0x14d)]('Use:\x20tdx\x20ps\x20show'),0x1;if(!_0x5bfca8[_0x123add(0x13e)])throw new SDKError(ErrorCode[_0x123add(0xdf)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0xebb37e=await withSpinner(_0x123add(0x13a),()=>_0x277206[_0x123add(0x15b)][_0x123add(0x131)](_0x5bfca8[_0x123add(0x118)],_0x5bfca8['segmentId']),{'verbose':_0x2f885d[_0x123add(0xcd)]});let _0x386ec3=_0xebb37e[_0x123add(0x11a)];const _0x167930=resolveLimit(_0x2f885d[_0x123add(0x13b)],DEFAULT_DISPLAY_LIMIT),_0x2ea52d=/\bLIMIT\s+\d+/i[_0x123add(0x103)](_0x386ec3);!_0x2ea52d&&(_0x386ec3=_0x386ec3[_0x123add(0x154)]()['replace'](/;+$/,''),_0x386ec3='SELECT\x20*\x20FROM\x20(\x0a'+_0x386ec3+_0x123add(0x136)+_0x167930);_0x2f885d[_0x123add(0xcd)]&&console['error'](_0x123add(0x126)+_0x386ec3);const _0x26af13=await withProgressSpinner(_0x123add(0x134),async _0x31a118=>{const _0x508932=_0x123add,_0x447215=await _0x277206[_0x508932(0xd0)]['execute'](_0x386ec3,{'catalog':'td','schema':_0x508932(0xd4),'onJobId':_0x1bd4ed=>{const _0x170388=_0x508932;_0x31a118[_0x170388(0x14e)](_0x1bd4ed);}});return _0x447215;},{'verbose':_0x2f885d[_0x123add(0xcd)]}),_0x56bcff=_0x26af13[_0x123add(0x11a)],_0x48b46f=_0x56bcff['jobId']?_0x123add(0x144)+_0x56bcff['jobId']+']':'';return console['error'](_0x123add(0x124)+_0x56bcff[_0x123add(0x159)][_0x123add(0xe3)]['toLocaleString']()+_0x123add(0x158)+(_0x123add(0x128)+formatElapsed(_0x56bcff['stats']['elapsedTimeMillis'])+_0x48b46f)),await handleQueryOutput(_0x56bcff,_0x2f885d),0x0;}catch(_0x12fc83){if(_0x12fc83 instanceof SDKError)return console[_0x123add(0x14d)](_0x123add(0xf7)+_0x12fc83[_0x123add(0x156)]+']'),console['error']('\x0a'+_0x12fc83['message']),0x1;throw _0x12fc83;}}}export class SegmentFolderListCommand extends BaseCommand{['name']='segment:folder:list';[a25_0x29b0fd(0xdd)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a25_0x29b0fd(0xe9)](_0x8ce95){const _0x125161=a25_0x29b0fd,{options:_0x3a6cb5,args:_0x3ea11f,tdx:_0x2aa57d}=_0x8ce95;if(_0x3ea11f[_0x125161(0x12e)]===0x0)return console[_0x125161(0x14d)](_0x125161(0x139)),console[_0x125161(0x14d)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x436ce0=_0x3ea11f[0x0];try{_0x3a6cb5[_0x125161(0xcd)]&&(console[_0x125161(0x14d)](_0x125161(0x12a)+_0x3a6cb5[_0x125161(0x133)]),console['error'](_0x125161(0x137)+_0x436ce0));const _0x2d6d18=await withSpinner(_0x125161(0x152)+_0x436ce0+_0x125161(0x14f),()=>_0x2aa57d[_0x125161(0x15b)]['resolveParentId'](_0x436ce0),{'verbose':_0x3a6cb5['verbose']}),_0x2998fd=_0x2d6d18[_0x125161(0x11a)];_0x3a6cb5[_0x125161(0xcd)]&&console['error'](_0x125161(0x106)+_0x2998fd);const _0x6112fb=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x436ce0+_0x125161(0x14f),()=>_0x2aa57d['segment']['listFolders'](_0x2998fd),{'verbose':_0x3a6cb5[_0x125161(0xcd)]}),_0x57e654=_0x6112fb[_0x125161(0x11a)];return console[_0x125161(0x14d)]('✔\x20Found\x20'+_0x57e654[_0x125161(0x12e)]+'\x20folder'+(_0x57e654[_0x125161(0x12e)]!==0x1?'s':'')),await handleSDKOutput(_0x57e654,_0x3a6cb5),0x0;}catch(_0x17af34){if(_0x17af34 instanceof SDKError)return console[_0x125161(0x14d)](_0x125161(0xc4)+_0x17af34[_0x125161(0x130)]),_0x17af34[_0x125161(0xe7)]&&console[_0x125161(0x14d)](_0x125161(0xef)+_0x17af34[_0x125161(0xe7)]),0x1;throw _0x17af34;}}}function a25_0x48a6(){const _0x4419bb=['description','jsonl','SEGMENT_NOT_FOUND','segment:describe','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','Segment\x20ID\x20missing\x20from\x20resolved\x20path','processedRows','json','Resolving\x20folder\x20\x27','Use:\x20tdx\x20ps\x20desc','cause','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','execute','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','format','getParent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x20\x20Cause:\x20','folderId','parentFolder','Usage:\x20tdx\x20sg\x20show\x20<name>','Resolved\x20parent\x20folder\x20ID:\x20','Parent\x20segment:\x20','segmentPath','createFolder','✖\x20Query\x20failed\x20[','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','segmentName','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','includes','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Fetching\x20folder\x20details...','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','segment:view','fullPath','test','Creating\x20folder\x20\x27','Fetching\x20parent\x20segment\x20details...','Resolved\x20parent\x20ID:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Resolving\x20\x27','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','2094005KuWLSI','Resolved\x20relative\x20path\x20to:\x20','9814797UHTzOE','getFolder','segment:folder:create','segment:folder:show','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','resolveFolderId','name','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Create\x20segment\x20folder\x20for\x20organization','Use:\x20tdx\x20ps\x20view\x20-w','parentId','Usage:\x20tdx\x20sg\x20desc\x20<name>','data','Show\x20folder\x20or\x20child\x20segment\x20details','Use:\x20tdx\x20ps\x20sql','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','\x20\x20Segment\x20name:\x20','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Parent\x20ID:\x20','✔\x20Query\x20completed:\x20Processed\x20','/app/ps/','SQL\x20query:\x0a','parentSegment','in\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','Site:\x20','Use:\x20tdx\x20ps\x20view','green','Examples:','length','Usage:\x20tdx\x20sg\x20sql\x20<name>','message','getSegmentSQL','folder','site','Executing\x20segment\x20query...','Resolved\x20YAML\x20file:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Parent\x20name:\x20','\x20\x20Folder\x20path:\x20','Error:\x20Parent\x20segment\x20name\x20is\x20required','Fetching\x20SQL\x20for\x20segment...','limit','resolveParentId','Fetching\x20segment\x20details...','segmentId','SEGMENT_FOLDER_NOT_FOUND','INVALID_ARGUMENT','7674750apsGgE','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20[Job\x20ID:\x20','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','328ZUZXTx','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','cyan','/e/','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','resolvePathToResource','segment:sql','error','setJobId','\x27...','Error:\x20Path\x20or\x20name\x20is\x20required','81082fNPckh','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','trim','20BZknyT','code','Resolved\x20type:\x20','\x20rows\x20','stats','\x20\x20Full\x20path:\x20','segment','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','getSegment','Segment\x20ID:\x20','segment:show','Folder\x20ID:\x20','type','11388443eybYeo','Error:\x20','log','Folder\x20ID\x20missing\x20from\x20resolved\x20path','4cWzXxo','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Folder\x20reference\x20is\x20required','Folder\x20name:\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','83909BaiCNi','verbose','Target\x20path:\x20','\x20Opening\x20','query','\x27\x20with\x20ID:\x20','1759497MugDcb','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','information_schema','parent','Resolving\x20parent\x20folder\x20\x27','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','Resolved\x20folder\x20ID:\x20','Fetching\x20folder\x20\x27','Show\x20segment\x20or\x20folder\x20details','folderPath','2cbQtAb'];a25_0x48a6=function(){return _0x4419bb;};return a25_0x48a6();}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x29b0fd(0x113)]=a25_0x29b0fd(0x110);[a25_0x29b0fd(0xdd)]='Show\x20segment\x20folder\x20details';async[a25_0x29b0fd(0xe9)](_0x300adb){const _0x33b6c9=a25_0x29b0fd,{options:_0x4acec6,args:_0x132ded,tdx:_0x2c7dfa}=_0x300adb;if(_0x132ded['length']===0x0)return console[_0x33b6c9(0x14d)](_0x33b6c9(0xc9)),console[_0x33b6c9(0x14d)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x4e835e,childId:_0x2b6a83}=parseSegmentRef(_0x132ded[0x0]);_0x4acec6[_0x33b6c9(0xcd)]&&(console[_0x33b6c9(0x14d)](_0x33b6c9(0x12a)+_0x4acec6[_0x33b6c9(0x133)]),console[_0x33b6c9(0x14d)](_0x33b6c9(0x137)+_0x4e835e),_0x2b6a83&&console[_0x33b6c9(0x14d)]('Folder\x20name:\x20'+_0x2b6a83));if(!_0x2b6a83)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x5fcd26=await withSpinner(_0x33b6c9(0x152)+_0x4e835e+_0x33b6c9(0x14f),()=>_0x2c7dfa[_0x33b6c9(0x15b)]['resolveParentId'](_0x4e835e),{'verbose':_0x4acec6[_0x33b6c9(0xcd)]}),_0x18c297=_0x5fcd26[_0x33b6c9(0x11a)];_0x4acec6[_0x33b6c9(0xcd)]&&console[_0x33b6c9(0x14d)](_0x33b6c9(0x106)+_0x18c297);const _0x9b36f1=await withSpinner(_0x33b6c9(0xe5)+_0x2b6a83+_0x33b6c9(0x14f),()=>_0x2c7dfa[_0x33b6c9(0x15b)][_0x33b6c9(0x112)](_0x18c297,_0x2b6a83),{'verbose':_0x4acec6[_0x33b6c9(0xcd)]}),_0x1e5d5f=_0x9b36f1['data'];_0x4acec6['verbose']&&console[_0x33b6c9(0x14d)](_0x33b6c9(0xd8)+_0x1e5d5f);const _0x790e02=await withSpinner(_0x33b6c9(0xd9)+_0x2b6a83+_0x33b6c9(0x14f),()=>_0x2c7dfa[_0x33b6c9(0x15b)][_0x33b6c9(0x10e)](_0x1e5d5f),{'verbose':_0x4acec6[_0x33b6c9(0xcd)]});return await handleSDKOutput([_0x790e02['data']],_0x4acec6),0x0;}catch(_0x1f5f8f){if(_0x1f5f8f instanceof SDKError)return console['error'](_0x33b6c9(0xc4)+_0x1f5f8f[_0x33b6c9(0x130)]),_0x1f5f8f[_0x33b6c9(0xe7)]&&console[_0x33b6c9(0x14d)]('\x20\x20Cause:\x20'+_0x1f5f8f[_0x33b6c9(0xe7)]),0x1;throw _0x1f5f8f;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x29b0fd(0x113)]=a25_0x29b0fd(0x14c);[a25_0x29b0fd(0xdd)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a25_0x29b0fd(0xe9)](_0x2751ee){const _0x47b1cf=a25_0x29b0fd,{options:_0x33b9b8,args:_0x3faab4,tdx:_0x4eac34}=_0x2751ee,_0x7fcf6f=_0x3faab4[0x0];if(!_0x7fcf6f)return console['error'](_0x47b1cf(0x11f)),console['error'](_0x47b1cf(0x12f)),console[_0x47b1cf(0x14d)](_0x47b1cf(0xf9)),console[_0x47b1cf(0x14d)](_0x47b1cf(0x12d)),console[_0x47b1cf(0x14d)](_0x47b1cf(0x120)),console['error'](_0x47b1cf(0x122)),0x1;try{const _0x4af21e=_0x33b9b8['parentSegment'],_0x310b97=await resolveSegmentTarget(_0x7fcf6f,_0x4af21e,_0x33b9b8[_0x47b1cf(0xcd)]);_0x33b9b8[_0x47b1cf(0xcd)]&&console['error'](_0x47b1cf(0xce)+_0x310b97);const _0x436dfd=await withSpinner('Resolving\x20\x27'+_0x7fcf6f+'\x27...',()=>_0x4eac34['segment'][_0x47b1cf(0x14b)](_0x310b97),{'verbose':_0x33b9b8[_0x47b1cf(0xcd)]}),_0x3818b4=_0x436dfd[_0x47b1cf(0x11a)];_0x33b9b8['verbose']&&(console['error'](_0x47b1cf(0x157)+_0x3818b4[_0x47b1cf(0xc2)]),console['error'](_0x47b1cf(0x123)+_0x3818b4['parentId']));if(_0x3818b4[_0x47b1cf(0xc2)]===_0x47b1cf(0x132))return console[_0x47b1cf(0x14d)](_0x47b1cf(0x111)),console['error'](_0x47b1cf(0x114)),0x1;if(_0x3818b4['type']===_0x47b1cf(0xd5))return console[_0x47b1cf(0x14d)](_0x47b1cf(0xd7)),console[_0x47b1cf(0x14d)](_0x47b1cf(0x11c)),0x1;if(!_0x3818b4[_0x47b1cf(0x13e)])throw new SDKError(ErrorCode[_0x47b1cf(0xdf)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x20f637=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x4eac34[_0x47b1cf(0x15b)][_0x47b1cf(0x131)](_0x3818b4[_0x47b1cf(0x118)],_0x3818b4[_0x47b1cf(0x13e)]),{'verbose':_0x33b9b8[_0x47b1cf(0xcd)]}),_0x4a522d=_0x20f637[_0x47b1cf(0x11a)];return _0x33b9b8[_0x47b1cf(0xec)]===_0x47b1cf(0xe4)||_0x33b9b8['format']===_0x47b1cf(0xde)?await handleSDKOutput([{'sql':_0x4a522d}],_0x33b9b8):console[_0x47b1cf(0xc5)](_0x4a522d),0x0;}catch(_0x1be333){if(_0x1be333 instanceof SDKError)return console[_0x47b1cf(0x14d)]('Error:\x20'+_0x1be333['message']),_0x1be333[_0x47b1cf(0xe7)]&&console['error'](_0x47b1cf(0xef)+_0x1be333[_0x47b1cf(0xe7)]),0x1;throw _0x1be333;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x29b0fd(0x113)]=a25_0x29b0fd(0x10f);[a25_0x29b0fd(0xdd)]=a25_0x29b0fd(0x116);async['execute'](_0x193ade){const _0x1a1566=a25_0x29b0fd,{options:_0x2caf18,args:_0x44bd42,tdx:_0x2d6ab5}=_0x193ade,_0x438eb1=_0x2caf18;if(_0x44bd42[_0x1a1566(0x12e)]<0x2)return console[_0x1a1566(0x14d)](_0x1a1566(0x11d)),console['error'](_0x1a1566(0x153)),0x1;const _0x25bb6b=_0x44bd42[0x0],_0x424055=_0x44bd42[0x1];_0x438eb1[_0x1a1566(0xcd)]&&(console['error'](_0x1a1566(0x12a)+_0x438eb1[_0x1a1566(0x133)]),console[_0x1a1566(0x14d)](_0x1a1566(0xf4)+_0x25bb6b),console['error'](_0x1a1566(0xca)+_0x424055));let _0x4c5b56;if(_0x438eb1[_0x1a1566(0xf1)]){const _0x46cd2d=_0x438eb1[_0x1a1566(0xf1)],_0x4fbd64=await withSpinner(_0x1a1566(0x152)+_0x25bb6b+_0x1a1566(0x14f),()=>_0x2d6ab5[_0x1a1566(0x15b)][_0x1a1566(0x13c)](_0x25bb6b),{'verbose':_0x438eb1[_0x1a1566(0xcd)]}),_0x108f8a=_0x4fbd64[_0x1a1566(0x11a)],_0x437cb3=await withSpinner(_0x1a1566(0xd6)+_0x46cd2d+_0x1a1566(0x14f),()=>_0x2d6ab5['segment'][_0x1a1566(0x112)](_0x108f8a,_0x46cd2d),{'verbose':_0x438eb1[_0x1a1566(0xcd)]});_0x4c5b56=_0x437cb3[_0x1a1566(0x11a)],_0x438eb1[_0x1a1566(0xcd)]&&console[_0x1a1566(0x14d)](_0x1a1566(0xf3)+_0x4c5b56);}const _0xfeba02={'name':_0x424055,'description':_0x438eb1[_0x1a1566(0xdd)],'parentFolderId':_0x4c5b56},_0x423efd=await withSpinner(_0x1a1566(0x104)+_0x424055+_0x1a1566(0x14f),()=>_0x2d6ab5[_0x1a1566(0x15b)][_0x1a1566(0xf6)](_0x25bb6b,_0xfeba02),{'verbose':_0x438eb1[_0x1a1566(0xcd)]}),_0x205256=_0x423efd[_0x1a1566(0x11a)];return console['error']('✔\x20Created\x20folder\x20\x27'+_0x205256[_0x1a1566(0x113)]+_0x1a1566(0xd1)+_0x205256['id']),await handleSDKOutput([_0x205256],_0x438eb1),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']=a25_0x29b0fd(0x101);[a25_0x29b0fd(0xdd)]=a25_0x29b0fd(0x11b);async['execute'](_0x294ebd){const _0x33edb5=a25_0x29b0fd,{options:_0x32941a,args:_0x562687,tdx:_0x98e67f}=_0x294ebd,_0x319ee7=_0x562687[0x0];if(!_0x319ee7)return console['error'](_0x33edb5(0xfd)),console[_0x33edb5(0x14d)](_0x33edb5(0x109)),console[_0x33edb5(0x14d)](_0x33edb5(0xfb)),console[_0x33edb5(0x14d)]('Options:'),console[_0x33edb5(0x14d)](_0x33edb5(0x100)),console['error'](_0x33edb5(0x12d)),console[_0x33edb5(0x14d)](_0x33edb5(0x14a)),console['error'](_0x33edb5(0x142)),console[_0x33edb5(0x14d)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser'),console['error'](_0x33edb5(0xe8)),0x1;try{const _0x109812=_0x32941a[_0x33edb5(0x127)],_0x2d9ad5=await resolveSegmentTarget(_0x319ee7,_0x109812,_0x32941a[_0x33edb5(0xcd)]);_0x32941a[_0x33edb5(0xcd)]&&console[_0x33edb5(0x14d)](_0x33edb5(0xce)+_0x2d9ad5);const _0x34e9f5=await withSpinner('Resolving\x20\x27'+_0x319ee7+_0x33edb5(0x14f),()=>_0x98e67f[_0x33edb5(0x15b)][_0x33edb5(0x14b)](_0x2d9ad5),{'verbose':_0x32941a[_0x33edb5(0xcd)]}),_0x3df01a=_0x34e9f5[_0x33edb5(0x11a)];_0x32941a['verbose']&&(console['error'](_0x33edb5(0x157)+_0x3df01a['type']),console['error'](_0x33edb5(0x123)+_0x3df01a[_0x33edb5(0x118)]),_0x3df01a['folderId']&&console[_0x33edb5(0x14d)](_0x33edb5(0xc1)+_0x3df01a[_0x33edb5(0xf0)]),_0x3df01a[_0x33edb5(0x13e)]&&console[_0x33edb5(0x14d)](_0x33edb5(0xbf)+_0x3df01a[_0x33edb5(0x13e)]));if(_0x32941a['web']){if(_0x3df01a[_0x33edb5(0xc2)]===_0x33edb5(0x132))return console['error'](_0x33edb5(0x115)),0x1;if(_0x3df01a[_0x33edb5(0xc2)]===_0x33edb5(0xd5))return console[_0x33edb5(0x14d)](_0x33edb5(0x143)),console['error'](_0x33edb5(0x117)),0x1;if(!_0x3df01a[_0x33edb5(0x13e)])throw new SDKError(ErrorCode[_0x33edb5(0xdf)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2e3a31=getConsoleNextUrl(_0x32941a['site'],_0x33edb5(0x125)+_0x3df01a[_0x33edb5(0x118)]+_0x33edb5(0x149)+_0x3df01a[_0x33edb5(0x13e)]);return console[_0x33edb5(0x14d)](a25_0x19b9f5[_0x33edb5(0x12c)]('✔')+_0x33edb5(0xcf)+a25_0x19b9f5[_0x33edb5(0x148)](_0x2e3a31)),openBrowser(_0x2e3a31),0x0;}if(_0x3df01a['type']===_0x33edb5(0x132)){if(!_0x3df01a[_0x33edb5(0xf0)])throw new SDKError(ErrorCode[_0x33edb5(0x13f)],_0x33edb5(0xc6));const _0x14c3cf=await withSpinner(_0x33edb5(0xff),()=>_0x98e67f[_0x33edb5(0x15b)][_0x33edb5(0x10e)](_0x3df01a[_0x33edb5(0xf0)]),{'verbose':_0x32941a[_0x33edb5(0xcd)]});await handleSingleObjectOutput(_0x14c3cf[_0x33edb5(0x11a)],_0x32941a);}else{if(_0x3df01a['type']===_0x33edb5(0x15b)){if(!_0x3df01a[_0x33edb5(0x13e)])throw new SDKError(ErrorCode[_0x33edb5(0xdf)],_0x33edb5(0xe2));const _0x210da9=await withSpinner(_0x33edb5(0x13d),()=>_0x98e67f[_0x33edb5(0x15b)][_0x33edb5(0xbe)](_0x3df01a[_0x33edb5(0x118)],_0x3df01a[_0x33edb5(0x13e)]),{'verbose':_0x32941a[_0x33edb5(0xcd)]}),_0x271516=getConsoleNextUrl(_0x32941a[_0x33edb5(0x133)],_0x33edb5(0x125)+_0x3df01a[_0x33edb5(0x118)]+_0x33edb5(0x149)+_0x3df01a[_0x33edb5(0x13e)]),_0x402fb2=_0x210da9['data'];_0x402fb2['url']=_0x271516,await handleSingleObjectOutput(_0x402fb2,_0x32941a);}else return console[_0x33edb5(0x14d)](_0x33edb5(0xea)),console[_0x33edb5(0x14d)](_0x33edb5(0x12b)),0x1;}return 0x0;}catch(_0x1a6871){if(_0x1a6871 instanceof SDKError)return console[_0x33edb5(0x14d)]('Error:\x20'+_0x1a6871[_0x33edb5(0x130)]),_0x1a6871['cause']&&console[_0x33edb5(0x14d)](_0x33edb5(0xef)+_0x1a6871[_0x33edb5(0xe7)]),0x1;throw _0x1a6871;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x29b0fd(0x113)]='segment:desc';[a25_0x29b0fd(0xdd)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async[a25_0x29b0fd(0xe9)](_0x1f1eca){const _0x31d273=a25_0x29b0fd,{options:_0x21c335,args:_0x19e159,tdx:_0x46e9e1}=_0x1f1eca,_0x2b9c23=_0x19e159[0x0];if(!_0x2b9c23)return console['error'](_0x31d273(0x11f)),console['error'](_0x31d273(0x119)),console[_0x31d273(0x14d)](_0x31d273(0xee)),console[_0x31d273(0x14d)](_0x31d273(0x12d)),console[_0x31d273(0x14d)](_0x31d273(0x10a)),console['error'](_0x31d273(0xeb)),0x1;try{const _0x58b477=_0x21c335['parentSegment'],_0x5b76c9=await resolveSegmentTarget(_0x2b9c23,_0x58b477,_0x21c335['verbose']);_0x21c335[_0x31d273(0xcd)]&&console[_0x31d273(0x14d)](_0x31d273(0xce)+_0x5b76c9);const _0x528f48=await withSpinner('Resolving\x20\x27'+_0x2b9c23+_0x31d273(0x14f),()=>_0x46e9e1[_0x31d273(0x15b)][_0x31d273(0x14b)](_0x5b76c9),{'verbose':_0x21c335[_0x31d273(0xcd)]}),_0x4cf142=_0x528f48['data'];_0x21c335[_0x31d273(0xcd)]&&(console[_0x31d273(0x14d)](_0x31d273(0x157)+_0x4cf142[_0x31d273(0xc2)]),console[_0x31d273(0x14d)](_0x31d273(0x123)+_0x4cf142['parentId']));if(_0x4cf142[_0x31d273(0xc2)]===_0x31d273(0x132))return console[_0x31d273(0x14d)](_0x31d273(0x147)),console[_0x31d273(0x14d)](_0x31d273(0x114)),0x1;if(_0x4cf142[_0x31d273(0xc2)]===_0x31d273(0xd5))return console[_0x31d273(0x14d)](_0x31d273(0xfe)),console[_0x31d273(0x14d)](_0x31d273(0xe6)),0x1;if(!_0x4cf142[_0x31d273(0x13e)])throw new SDKError(ErrorCode[_0x31d273(0xdf)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4bd8ce=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x46e9e1[_0x31d273(0x15b)][_0x31d273(0x131)](_0x4cf142[_0x31d273(0x118)],_0x4cf142[_0x31d273(0x13e)]),{'verbose':_0x21c335[_0x31d273(0xcd)]}),_0x2fd5b4=_0x4bd8ce['data'],_0x5c3903=await executeSchemaQuery(_0x2fd5b4,_0x46e9e1,_0x21c335);return await handleQueryOutput(_0x5c3903,_0x21c335),0x0;}catch(_0x45247a){if(_0x45247a instanceof SDKError)return console[_0x31d273(0x14d)]('Error:\x20'+_0x45247a['message']),_0x45247a['cause']&&console[_0x31d273(0x14d)]('\x20\x20Cause:\x20'+_0x45247a['cause']),0x1;throw _0x45247a;}}}
1
+ const a25_0x1f4ab8=a25_0xffa8;(function(_0x5cd39a,_0x47159e){const _0x4a6d1f=a25_0xffa8,_0x28f39d=_0x5cd39a();while(!![]){try{const _0x10c121=parseInt(_0x4a6d1f(0x11c))/0x1*(-parseInt(_0x4a6d1f(0x13f))/0x2)+parseInt(_0x4a6d1f(0x129))/0x3+-parseInt(_0x4a6d1f(0x142))/0x4*(-parseInt(_0x4a6d1f(0xd1))/0x5)+parseInt(_0x4a6d1f(0x148))/0x6*(-parseInt(_0x4a6d1f(0x11b))/0x7)+-parseInt(_0x4a6d1f(0xc5))/0x8+parseInt(_0x4a6d1f(0x107))/0x9+parseInt(_0x4a6d1f(0x14c))/0xa;if(_0x10c121===_0x47159e)break;else _0x28f39d['push'](_0x28f39d['shift']());}catch(_0x52ac44){_0x28f39d['push'](_0x28f39d['shift']());}}}(a25_0x2590,0x4417c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a25_0x2590(){const _0x4214cd=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolving\x20path\x20\x27','error','verbose','segmentPath','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolving\x20parent\x20segment\x20\x27','Resolving\x20folder\x20\x27','Resolving\x20\x27','Fetching\x20folder\x20\x27','parentFolder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:describe','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','getSegmentSQL','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Show\x20folder\x20or\x20child\x20segment\x20details','Resolved\x20type:\x20','SEGMENT_NOT_FOUND','Usage:\x20tdx\x20sg\x20desc\x20<name>','code','Parent\x20name:\x20','Use:\x20tdx\x20ps\x20view','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','folderId','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','parentSegment','Create\x20segment\x20folder\x20for\x20organization','parentId','segment:show','(root)','getFolder','Resolved\x20folder\x20ID:\x20','test','url','Folder\x20ID:\x20','Parent\x20ID:\x20','site','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','✖\x20Query\x20failed\x20[','resolveParentId','resolveFolderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x27\x20with\x20ID:\x20','Examples:','web','Creating\x20folder\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','log','1045638pgQNjP','Target\x20path:\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Show\x20segment\x20folder\x20details','segment:folder:create','Fetching\x20segment\x20details...','data','cause','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20sql','parent','jsonl','length','description','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','folder','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment:view','14jceeLa','1KViBFs','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','/e/','Listing\x20folders\x20for\x20parent\x20\x27','\x20[Job\x20ID:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Folder\x20name:\x20','execute','stats','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','✔\x20Created\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Use:\x20tdx\x20ps\x20show','608568TzGHpw','Error:\x20Folder\x20reference\x20is\x20required','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','type','Error:\x20Path\x20or\x20name\x20is\x20required','json','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20parent\x20segment\x20details...','Usage:\x20tdx\x20sg\x20sql\x20<name>','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','segmentId','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20\x20Parent\x20segment:\x20','INVALID_ARGUMENT','information_schema','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folderPath','\x20\x20Full\x20path:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','740994GhDlwg','processedRows','jobId','12356YcsypB','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Segment\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','message','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','1524858JBcgIi','\x20\x20Folder\x20path:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','trim','12430460BIicFw','in\x20','Resolved\x20YAML\x20file:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segmentName','getSegment','Fetching\x20folder\x20details...','\x27...','segment:sql','/app/ps/','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Show\x20child\x20segment\x20schema\x20(column\x20types)','Use:\x20tdx\x20ps\x20desc','replace','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','resolvePathToResource','segment','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','3457552gTlYLY','name','format','Resolved\x20parent\x20ID:\x20','\x20Opening\x20','segment:desc','Options:','Fetching\x20SQL\x20for\x20segment...','Parent\x20segment:\x20','query','\x20\x20Cause:\x20','fullPath','45hIWxYA'];a25_0x2590=function(){return _0x4214cd;};return a25_0x2590();}import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0xddf546 from'chalk';async function resolveSegmentTarget(_0xc6e67a,_0x156d05,_0x5b01ac){const _0xb6031e=a25_0xffa8;if(isYamlFilePath(_0xc6e67a))try{const _0x425e2e=await resolveYamlFilePath(_0xc6e67a);return _0x5b01ac&&(console[_0xb6031e(0xd5)](_0xb6031e(0x14e)+_0xc6e67a),console[_0xb6031e(0xd5)](_0xb6031e(0x137)+_0x425e2e[_0xb6031e(0xee)]),console['error']('\x20\x20Segment\x20name:\x20'+_0x425e2e[_0xb6031e(0x150)]),console[_0xb6031e(0xd5)](_0xb6031e(0x149)+(_0x425e2e[_0xb6031e(0x13c)]||_0xb6031e(0xf2))),console['error'](_0xb6031e(0x13d)+_0x425e2e[_0xb6031e(0xd0)])),_0x425e2e[_0xb6031e(0xd0)];}catch(_0x1476b9){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xb6031e(0x133)+_0x1476b9[_0xb6031e(0x146)]);}if(!_0x156d05)throw new SDKError(ErrorCode[_0xb6031e(0x138)],_0xb6031e(0x117));return _0x156d05+'/'+_0xc6e67a;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0xdf);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0x10f);async[a25_0x1f4ab8(0x123)](_0xb25dfc){const _0x2d3ca8=a25_0x1f4ab8,{options:_0x5d8f52,args:_0x3f1187,tdx:_0x4ba699}=_0xb25dfc,_0x4e1152=_0x3f1187[0x0],_0x441a06=!_0x4e1152&&!!_0x5d8f52['parentSegment'],_0x14e8df=_0x4e1152||_0x5d8f52[_0x2d3ca8(0xee)];if(!_0x14e8df)return console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x12d)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x14a)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x102)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xc3)),console['error'](_0x2d3ca8(0x13b)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xd3)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x136)),0x1;try{const _0xeae13f=_0x5d8f52[_0x2d3ca8(0xd7)];let _0x255d2b=_0x14e8df;!_0x441a06&&_0xeae13f&&!_0x14e8df['includes']('/')&&(_0x255d2b=_0xeae13f+'/'+_0x14e8df,_0x5d8f52[_0x2d3ca8(0xd6)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x255d2b));const _0x34f7b1=await withSpinner(_0x2d3ca8(0xd4)+_0x255d2b+_0x2d3ca8(0x153),()=>_0x4ba699[_0x2d3ca8(0xc2)][_0x2d3ca8(0xc1)](_0x255d2b),{'verbose':_0x5d8f52['verbose']}),_0x24bc48=_0x34f7b1[_0x2d3ca8(0x10d)];_0x5d8f52['verbose']&&(console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xe4)+_0x24bc48[_0x2d3ca8(0x12c)]),console[_0x2d3ca8(0xd5)]('Parent\x20ID:\x20'+_0x24bc48[_0x2d3ca8(0xf0)]),_0x24bc48[_0x2d3ca8(0xeb)]&&console[_0x2d3ca8(0xd5)]('Folder\x20ID:\x20'+_0x24bc48['folderId']),_0x24bc48[_0x2d3ca8(0x134)]&&console['error'](_0x2d3ca8(0x144)+_0x24bc48[_0x2d3ca8(0x134)]));if(_0x24bc48[_0x2d3ca8(0x12c)]===_0x2d3ca8(0x111)){const _0x3e04eb=await withSpinner(_0x2d3ca8(0x131),()=>_0x4ba699[_0x2d3ca8(0xc2)]['getParent'](_0x24bc48['parentId']),{'verbose':_0x5d8f52[_0x2d3ca8(0xd6)]});await handleSingleObjectOutput(_0x3e04eb['data'],_0x5d8f52);}else{if(_0x24bc48[_0x2d3ca8(0x12c)]==='folder'){if(!_0x24bc48[_0x2d3ca8(0xeb)])throw new SDKError(ErrorCode[_0x2d3ca8(0x130)],_0x2d3ca8(0xde));const _0x4d47a3=await withSpinner(_0x2d3ca8(0x152),()=>_0x4ba699[_0x2d3ca8(0xc2)]['getFolder'](_0x24bc48[_0x2d3ca8(0xeb)]),{'verbose':_0x5d8f52['verbose']});await handleSingleObjectOutput(_0x4d47a3[_0x2d3ca8(0x10d)],_0x5d8f52);}else{if(_0x24bc48['type']===_0x2d3ca8(0xc2)){if(!_0x24bc48[_0x2d3ca8(0x134)])throw new SDKError(ErrorCode[_0x2d3ca8(0xe5)],_0x2d3ca8(0x145));const _0x45ee01=await withSpinner(_0x2d3ca8(0x10c),()=>_0x4ba699['segment'][_0x2d3ca8(0x151)](_0x24bc48[_0x2d3ca8(0xf0)],_0x24bc48[_0x2d3ca8(0x134)]),{'verbose':_0x5d8f52[_0x2d3ca8(0xd6)]});await handleSingleObjectOutput(_0x45ee01[_0x2d3ca8(0x10d)],_0x5d8f52);}}}return 0x0;}catch(_0x4eace4){if(_0x4eace4 instanceof SDKError)return console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xfb)+_0x4eace4[_0x2d3ca8(0x146)]),_0x4eace4[_0x2d3ca8(0x10e)]&&console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xcf)+_0x4eace4['cause']),0x1;throw _0x4eace4;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0xf1);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0x109);async[a25_0x1f4ab8(0x123)](_0x215176){const _0x974f9c=a25_0x1f4ab8,{options:_0x456366,args:_0x410e7b,tdx:_0x46b58f}=_0x215176,_0x2b0b95=_0x410e7b[0x0];if(!_0x2b0b95)return console['error'](_0x974f9c(0xfc)),console[_0x974f9c(0xd5)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x974f9c(0xd5)](_0x974f9c(0xd2)),console[_0x974f9c(0xd5)](_0x974f9c(0x102)),console['error'](_0x974f9c(0x12f)),console[_0x974f9c(0xd5)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x38ed49=_0x456366['parentSegment'],_0x460330=await resolveSegmentTarget(_0x2b0b95,_0x38ed49,_0x456366[_0x974f9c(0xd6)]);_0x456366[_0x974f9c(0xd6)]&&console['error']('Target\x20path:\x20'+_0x460330);const _0xa48f54=await withSpinner(_0x974f9c(0xdb)+_0x2b0b95+_0x974f9c(0x153),()=>_0x46b58f[_0x974f9c(0xc2)][_0x974f9c(0xc1)](_0x460330),{'verbose':_0x456366['verbose']}),_0x303ccb=_0xa48f54[_0x974f9c(0x10d)];_0x456366[_0x974f9c(0xd6)]&&(console['error']('Resolved\x20type:\x20'+_0x303ccb[_0x974f9c(0x12c)]),console[_0x974f9c(0xd5)](_0x974f9c(0xf8)+_0x303ccb[_0x974f9c(0xf0)]));if(_0x303ccb[_0x974f9c(0x12c)]===_0x974f9c(0x118))return console[_0x974f9c(0xd5)](_0x974f9c(0xc4)),console[_0x974f9c(0xd5)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x303ccb[_0x974f9c(0x12c)]==='parent')return console[_0x974f9c(0xd5)](_0x974f9c(0x11d)),console[_0x974f9c(0xd5)](_0x974f9c(0x128)),0x1;if(!_0x303ccb[_0x974f9c(0x134)])throw new SDKError(ErrorCode[_0x974f9c(0xe5)],_0x974f9c(0x145));const _0x44f3cc=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x46b58f[_0x974f9c(0xc2)][_0x974f9c(0xe1)](_0x303ccb[_0x974f9c(0xf0)],_0x303ccb[_0x974f9c(0x134)]),{'verbose':_0x456366[_0x974f9c(0xd6)]});let _0x12d95c=_0x44f3cc[_0x974f9c(0x10d)];const _0x11d5cc=resolveLimit(_0x456366['limit'],DEFAULT_DISPLAY_LIMIT),_0x443262=/\bLIMIT\s+\d+/i[_0x974f9c(0xf5)](_0x12d95c);!_0x443262&&(_0x12d95c=_0x12d95c[_0x974f9c(0x14b)]()[_0x974f9c(0xbf)](/;+$/,''),_0x12d95c=_0x974f9c(0x13a)+_0x12d95c+_0x974f9c(0xd8)+_0x11d5cc);_0x456366[_0x974f9c(0xd6)]&&console['error']('SQL\x20query:\x0a'+_0x12d95c);const _0x57a41f=await withProgressSpinner('Executing\x20segment\x20query...',async _0x3e6c91=>{const _0x4ec6a0=_0x974f9c,_0x171a24=await _0x46b58f[_0x4ec6a0(0xce)][_0x4ec6a0(0x123)](_0x12d95c,{'catalog':'td','schema':_0x4ec6a0(0x139),'onJobId':_0x5aa331=>{_0x3e6c91['setJobId'](_0x5aa331);}});return _0x171a24;},{'verbose':_0x456366[_0x974f9c(0xd6)]}),_0x56405a=_0x57a41f['data'],_0x4dec5c=_0x56405a[_0x974f9c(0x141)]?_0x974f9c(0x120)+_0x56405a['jobId']+']':'';return console[_0x974f9c(0xd5)](_0x974f9c(0x105)+_0x56405a[_0x974f9c(0x124)][_0x974f9c(0x140)]['toLocaleString']()+'\x20rows\x20'+(_0x974f9c(0x14d)+formatElapsed(_0x56405a['stats']['elapsedTimeMillis'])+_0x4dec5c)),await handleQueryOutput(_0x56405a,_0x456366),0x0;}catch(_0x17f2a0){if(_0x17f2a0 instanceof SDKError)return console[_0x974f9c(0xd5)](_0x974f9c(0xfd)+_0x17f2a0[_0x974f9c(0xe7)]+']'),console[_0x974f9c(0xd5)]('\x0a'+_0x17f2a0[_0x974f9c(0x146)]),0x1;throw _0x17f2a0;}}}function a25_0xffa8(_0x377863,_0x22c1e4){_0x377863=_0x377863-0xbb;const _0x259035=a25_0x2590();let _0xffa868=_0x259035[_0x377863];return _0xffa868;}export class SegmentFolderListCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]='segment:folder:list';[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0xed);async[a25_0x1f4ab8(0x123)](_0x32e91e){const _0x374ea7=a25_0x1f4ab8,{options:_0x12cd81,args:_0x1ce374,tdx:_0x50506f}=_0x32e91e;if(_0x1ce374['length']===0x0)return console[_0x374ea7(0xd5)](_0x374ea7(0x119)),console[_0x374ea7(0xd5)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x272f5f=_0x1ce374[0x0];try{_0x12cd81[_0x374ea7(0xd6)]&&(console[_0x374ea7(0xd5)]('Site:\x20'+_0x12cd81[_0x374ea7(0xf9)]),console[_0x374ea7(0xd5)](_0x374ea7(0xe8)+_0x272f5f));const _0x34949e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x272f5f+_0x374ea7(0x153),()=>_0x50506f[_0x374ea7(0xc2)][_0x374ea7(0xfe)](_0x272f5f),{'verbose':_0x12cd81[_0x374ea7(0xd6)]}),_0x261784=_0x34949e[_0x374ea7(0x10d)];_0x12cd81[_0x374ea7(0xd6)]&&console['error'](_0x374ea7(0xc8)+_0x261784);const _0x133021=await withSpinner(_0x374ea7(0x11f)+_0x272f5f+'\x27...',()=>_0x50506f[_0x374ea7(0xc2)]['listFolders'](_0x261784),{'verbose':_0x12cd81[_0x374ea7(0xd6)]}),_0x43d9e9=_0x133021['data'];return console[_0x374ea7(0xd5)]('✔\x20Found\x20'+_0x43d9e9[_0x374ea7(0x113)]+'\x20folder'+(_0x43d9e9['length']!==0x1?'s':'')),await handleSDKOutput(_0x43d9e9,_0x12cd81),0x0;}catch(_0x40c7e1){if(_0x40c7e1 instanceof SDKError)return console[_0x374ea7(0xd5)]('Error:\x20'+_0x40c7e1[_0x374ea7(0x146)]),_0x40c7e1[_0x374ea7(0x10e)]&&console[_0x374ea7(0xd5)](_0x374ea7(0xcf)+_0x40c7e1[_0x374ea7(0x10e)]),0x1;throw _0x40c7e1;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0x10a);async[a25_0x1f4ab8(0x123)](_0x1df1fe){const _0x5e1de7=a25_0x1f4ab8,{options:_0x292c61,args:_0x3fc1d0,tdx:_0x2921b9}=_0x1df1fe;if(_0x3fc1d0[_0x5e1de7(0x113)]===0x0)return console[_0x5e1de7(0xd5)](_0x5e1de7(0x12a)),console[_0x5e1de7(0xd5)](_0x5e1de7(0xc0)),0x1;try{const {parentId:_0x33f62e,childId:_0x38b500}=parseSegmentRef(_0x3fc1d0[0x0]);_0x292c61[_0x5e1de7(0xd6)]&&(console[_0x5e1de7(0xd5)]('Site:\x20'+_0x292c61['site']),console[_0x5e1de7(0xd5)](_0x5e1de7(0xe8)+_0x33f62e),_0x38b500&&console[_0x5e1de7(0xd5)](_0x5e1de7(0x122)+_0x38b500));if(!_0x38b500)return console[_0x5e1de7(0xd5)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x127930=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x33f62e+_0x5e1de7(0x153),()=>_0x2921b9['segment'][_0x5e1de7(0xfe)](_0x33f62e),{'verbose':_0x292c61[_0x5e1de7(0xd6)]}),_0x248e5f=_0x127930[_0x5e1de7(0x10d)];_0x292c61[_0x5e1de7(0xd6)]&&console[_0x5e1de7(0xd5)](_0x5e1de7(0xc8)+_0x248e5f);const _0x5116f8=await withSpinner(_0x5e1de7(0xda)+_0x38b500+_0x5e1de7(0x153),()=>_0x2921b9[_0x5e1de7(0xc2)][_0x5e1de7(0xff)](_0x248e5f,_0x38b500),{'verbose':_0x292c61['verbose']}),_0x2c7880=_0x5116f8[_0x5e1de7(0x10d)];_0x292c61[_0x5e1de7(0xd6)]&&console['error'](_0x5e1de7(0xf4)+_0x2c7880);const _0x5471e1=await withSpinner(_0x5e1de7(0xdc)+_0x38b500+_0x5e1de7(0x153),()=>_0x2921b9[_0x5e1de7(0xc2)]['getFolder'](_0x2c7880),{'verbose':_0x292c61[_0x5e1de7(0xd6)]});return await handleSDKOutput([_0x5471e1[_0x5e1de7(0x10d)]],_0x292c61),0x0;}catch(_0x2bc255){if(_0x2bc255 instanceof SDKError)return console['error'](_0x5e1de7(0xfb)+_0x2bc255[_0x5e1de7(0x146)]),_0x2bc255[_0x5e1de7(0x10e)]&&console['error'](_0x5e1de7(0xcf)+_0x2bc255['cause']),0x1;throw _0x2bc255;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0x154);['description']=a25_0x1f4ab8(0x135);async[a25_0x1f4ab8(0x123)](_0x7730f0){const _0x20234d=a25_0x1f4ab8,{options:_0x370d8b,args:_0x25bab0,tdx:_0x5538a6}=_0x7730f0,_0x40aa19=_0x25bab0[0x0];if(!_0x40aa19)return console['error'](_0x20234d(0xfc)),console[_0x20234d(0xd5)](_0x20234d(0x132)),console[_0x20234d(0xd5)](_0x20234d(0xe0)),console[_0x20234d(0xd5)](_0x20234d(0x102)),console['error'](_0x20234d(0x143)),console['error'](_0x20234d(0x116)),0x1;try{const _0x5a34ff=_0x370d8b['parentSegment'],_0x44ac8f=await resolveSegmentTarget(_0x40aa19,_0x5a34ff,_0x370d8b[_0x20234d(0xd6)]);_0x370d8b['verbose']&&console[_0x20234d(0xd5)](_0x20234d(0x108)+_0x44ac8f);const _0x36cc5b=await withSpinner(_0x20234d(0xdb)+_0x40aa19+_0x20234d(0x153),()=>_0x5538a6[_0x20234d(0xc2)][_0x20234d(0xc1)](_0x44ac8f),{'verbose':_0x370d8b[_0x20234d(0xd6)]}),_0x41b685=_0x36cc5b[_0x20234d(0x10d)];_0x370d8b['verbose']&&(console[_0x20234d(0xd5)]('Resolved\x20type:\x20'+_0x41b685['type']),console['error'](_0x20234d(0xf8)+_0x41b685[_0x20234d(0xf0)]));if(_0x41b685[_0x20234d(0x12c)]===_0x20234d(0x118))return console[_0x20234d(0xd5)](_0x20234d(0x115)),console[_0x20234d(0xd5)](_0x20234d(0xbc)),0x1;if(_0x41b685['type']===_0x20234d(0x111))return console[_0x20234d(0xd5)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x20234d(0x110)),0x1;if(!_0x41b685[_0x20234d(0x134)])throw new SDKError(ErrorCode[_0x20234d(0xe5)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x176167=await withSpinner(_0x20234d(0xcc),()=>_0x5538a6[_0x20234d(0xc2)][_0x20234d(0xe1)](_0x41b685[_0x20234d(0xf0)],_0x41b685['segmentId']),{'verbose':_0x370d8b[_0x20234d(0xd6)]}),_0x8a2190=_0x176167['data'];return _0x370d8b[_0x20234d(0xc7)]===_0x20234d(0x12e)||_0x370d8b[_0x20234d(0xc7)]===_0x20234d(0x112)?await handleSDKOutput([{'sql':_0x8a2190}],_0x370d8b):console[_0x20234d(0x106)](_0x8a2190),0x0;}catch(_0x5d4f70){if(_0x5d4f70 instanceof SDKError)return console[_0x20234d(0xd5)](_0x20234d(0xfb)+_0x5d4f70[_0x20234d(0x146)]),_0x5d4f70['cause']&&console[_0x20234d(0xd5)](_0x20234d(0xcf)+_0x5d4f70[_0x20234d(0x10e)]),0x1;throw _0x5d4f70;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a25_0x1f4ab8(0x10b);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0xef);async[a25_0x1f4ab8(0x123)](_0x653bcc){const _0x1fb3e0=a25_0x1f4ab8,{options:_0x1bd71b,args:_0x26cb2d,tdx:_0x520e31}=_0x653bcc,_0x3d8cbd=_0x1bd71b;if(_0x26cb2d[_0x1fb3e0(0x113)]<0x2)return console[_0x1fb3e0(0xd5)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x1fb3e0(0xd5)](_0x1fb3e0(0x14f)),0x1;const _0x42f835=_0x26cb2d[0x0],_0x5977f7=_0x26cb2d[0x1];_0x3d8cbd[_0x1fb3e0(0xd6)]&&(console[_0x1fb3e0(0xd5)]('Site:\x20'+_0x3d8cbd['site']),console[_0x1fb3e0(0xd5)](_0x1fb3e0(0xcd)+_0x42f835),console[_0x1fb3e0(0xd5)]('Folder\x20name:\x20'+_0x5977f7));let _0x4627ec;if(_0x3d8cbd['parentFolder']){const _0x53b2d9=_0x3d8cbd[_0x1fb3e0(0xdd)],_0x5eaa4d=await withSpinner(_0x1fb3e0(0xd9)+_0x42f835+'\x27...',()=>_0x520e31[_0x1fb3e0(0xc2)][_0x1fb3e0(0xfe)](_0x42f835),{'verbose':_0x3d8cbd[_0x1fb3e0(0xd6)]}),_0x12f15a=_0x5eaa4d[_0x1fb3e0(0x10d)],_0x3cbcbf=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x53b2d9+_0x1fb3e0(0x153),()=>_0x520e31['segment']['resolveFolderId'](_0x12f15a,_0x53b2d9),{'verbose':_0x3d8cbd[_0x1fb3e0(0xd6)]});_0x4627ec=_0x3cbcbf[_0x1fb3e0(0x10d)],_0x3d8cbd[_0x1fb3e0(0xd6)]&&console[_0x1fb3e0(0xd5)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x4627ec);}const _0x246aec={'name':_0x5977f7,'description':_0x3d8cbd[_0x1fb3e0(0x114)],'parentFolderId':_0x4627ec},_0xc71955=await withSpinner(_0x1fb3e0(0x104)+_0x5977f7+_0x1fb3e0(0x153),()=>_0x520e31[_0x1fb3e0(0xc2)]['createFolder'](_0x42f835,_0x246aec),{'verbose':_0x3d8cbd[_0x1fb3e0(0xd6)]}),_0x5555e9=_0xc71955['data'];return console[_0x1fb3e0(0xd5)](_0x1fb3e0(0x126)+_0x5555e9[_0x1fb3e0(0xc6)]+_0x1fb3e0(0x101)+_0x5555e9['id']),await handleSDKOutput([_0x5555e9],_0x3d8cbd),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0x11a);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0xe3);async[a25_0x1f4ab8(0x123)](_0x30acce){const _0x47fb7b=a25_0x1f4ab8,{options:_0x1978da,args:_0x525f00,tdx:_0x137da4}=_0x30acce,_0x4fca8d=_0x525f00[0x0];if(!_0x4fca8d)return console[_0x47fb7b(0xd5)](_0x47fb7b(0x12b)),console[_0x47fb7b(0xd5)](_0x47fb7b(0x127)),console[_0x47fb7b(0xd5)](_0x47fb7b(0xe2)),console[_0x47fb7b(0xd5)](_0x47fb7b(0xcb)),console[_0x47fb7b(0xd5)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x47fb7b(0xd5)]('Examples:'),console[_0x47fb7b(0xd5)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x47fb7b(0xd5)](_0x47fb7b(0xec)),console[_0x47fb7b(0xd5)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x451d38=_0x1978da[_0x47fb7b(0xee)],_0x42bd13=await resolveSegmentTarget(_0x4fca8d,_0x451d38,_0x1978da['verbose']);_0x1978da[_0x47fb7b(0xd6)]&&console[_0x47fb7b(0xd5)]('Target\x20path:\x20'+_0x42bd13);const _0x4c5562=await withSpinner('Resolving\x20\x27'+_0x4fca8d+_0x47fb7b(0x153),()=>_0x137da4[_0x47fb7b(0xc2)][_0x47fb7b(0xc1)](_0x42bd13),{'verbose':_0x1978da['verbose']}),_0x1aefdb=_0x4c5562['data'];_0x1978da[_0x47fb7b(0xd6)]&&(console[_0x47fb7b(0xd5)](_0x47fb7b(0xe4)+_0x1aefdb[_0x47fb7b(0x12c)]),console[_0x47fb7b(0xd5)](_0x47fb7b(0xf8)+_0x1aefdb['parentId']),_0x1aefdb['folderId']&&console[_0x47fb7b(0xd5)](_0x47fb7b(0xf7)+_0x1aefdb[_0x47fb7b(0xeb)]),_0x1aefdb[_0x47fb7b(0x134)]&&console[_0x47fb7b(0xd5)](_0x47fb7b(0x144)+_0x1aefdb['segmentId']));if(_0x1978da[_0x47fb7b(0x103)]){if(_0x1aefdb[_0x47fb7b(0x12c)]==='folder')return console[_0x47fb7b(0xd5)](_0x47fb7b(0xea)),0x1;if(_0x1aefdb[_0x47fb7b(0x12c)]===_0x47fb7b(0x111))return console[_0x47fb7b(0xd5)](_0x47fb7b(0xfa)),console[_0x47fb7b(0xd5)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x1aefdb[_0x47fb7b(0x134)])throw new SDKError(ErrorCode[_0x47fb7b(0xe5)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2272b8=getConsoleNextUrl(_0x1978da[_0x47fb7b(0xf9)],_0x47fb7b(0xbb)+_0x1aefdb[_0x47fb7b(0xf0)]+_0x47fb7b(0x11e)+_0x1aefdb[_0x47fb7b(0x134)]);return console[_0x47fb7b(0xd5)](a25_0xddf546['green']('✔')+_0x47fb7b(0xc9)+a25_0xddf546['cyan'](_0x2272b8)),openBrowser(_0x2272b8),0x0;}if(_0x1aefdb[_0x47fb7b(0x12c)]===_0x47fb7b(0x118)){if(!_0x1aefdb['folderId'])throw new SDKError(ErrorCode[_0x47fb7b(0x130)],_0x47fb7b(0xde));const _0x26d023=await withSpinner(_0x47fb7b(0x152),()=>_0x137da4['segment'][_0x47fb7b(0xf3)](_0x1aefdb[_0x47fb7b(0xeb)]),{'verbose':_0x1978da[_0x47fb7b(0xd6)]});await handleSingleObjectOutput(_0x26d023[_0x47fb7b(0x10d)],_0x1978da);}else{if(_0x1aefdb[_0x47fb7b(0x12c)]==='segment'){if(!_0x1aefdb[_0x47fb7b(0x134)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x47fb7b(0x145));const _0x2b6a08=await withSpinner(_0x47fb7b(0x10c),()=>_0x137da4[_0x47fb7b(0xc2)]['getSegment'](_0x1aefdb[_0x47fb7b(0xf0)],_0x1aefdb['segmentId']),{'verbose':_0x1978da['verbose']}),_0x57f51e=getConsoleNextUrl(_0x1978da[_0x47fb7b(0xf9)],'/app/ps/'+_0x1aefdb['parentId']+_0x47fb7b(0x11e)+_0x1aefdb[_0x47fb7b(0x134)]),_0x504945=_0x2b6a08['data'];_0x504945[_0x47fb7b(0xf6)]=_0x57f51e,await handleSingleObjectOutput(_0x504945,_0x1978da);}else return console[_0x47fb7b(0xd5)](_0x47fb7b(0x121)),console[_0x47fb7b(0xd5)](_0x47fb7b(0xe9)),0x1;}return 0x0;}catch(_0x580e45){if(_0x580e45 instanceof SDKError)return console[_0x47fb7b(0xd5)](_0x47fb7b(0xfb)+_0x580e45[_0x47fb7b(0x146)]),_0x580e45[_0x47fb7b(0x10e)]&&console[_0x47fb7b(0xd5)](_0x47fb7b(0xcf)+_0x580e45['cause']),0x1;throw _0x580e45;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0xca);['description']=a25_0x1f4ab8(0xbd);async[a25_0x1f4ab8(0x123)](_0x4679df){const _0x111b38=a25_0x1f4ab8,{options:_0x3964d2,args:_0x4d331b,tdx:_0xb4568}=_0x4679df,_0x1f0913=_0x4d331b[0x0];if(!_0x1f0913)return console[_0x111b38(0xd5)](_0x111b38(0xfc)),console[_0x111b38(0xd5)](_0x111b38(0xe6)),console[_0x111b38(0xd5)](_0x111b38(0x100)),console[_0x111b38(0xd5)](_0x111b38(0x102)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x111b38(0xd5)](_0x111b38(0x125)),0x1;try{const _0x5943b8=_0x3964d2[_0x111b38(0xee)],_0x20a714=await resolveSegmentTarget(_0x1f0913,_0x5943b8,_0x3964d2[_0x111b38(0xd6)]);_0x3964d2[_0x111b38(0xd6)]&&console[_0x111b38(0xd5)](_0x111b38(0x108)+_0x20a714);const _0x41cd24=await withSpinner(_0x111b38(0xdb)+_0x1f0913+_0x111b38(0x153),()=>_0xb4568[_0x111b38(0xc2)]['resolvePathToResource'](_0x20a714),{'verbose':_0x3964d2[_0x111b38(0xd6)]}),_0x3eb8ad=_0x41cd24[_0x111b38(0x10d)];_0x3964d2[_0x111b38(0xd6)]&&(console['error']('Resolved\x20type:\x20'+_0x3eb8ad[_0x111b38(0x12c)]),console[_0x111b38(0xd5)]('Parent\x20ID:\x20'+_0x3eb8ad['parentId']));if(_0x3eb8ad[_0x111b38(0x12c)]==='folder')return console[_0x111b38(0xd5)](_0x111b38(0x147)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x3eb8ad['type']===_0x111b38(0x111))return console['error'](_0x111b38(0x13e)),console['error'](_0x111b38(0xbe)),0x1;if(!_0x3eb8ad[_0x111b38(0x134)])throw new SDKError(ErrorCode[_0x111b38(0xe5)],_0x111b38(0x145));const _0x13e8f2=await withSpinner(_0x111b38(0xcc),()=>_0xb4568['segment'][_0x111b38(0xe1)](_0x3eb8ad['parentId'],_0x3eb8ad['segmentId']),{'verbose':_0x3964d2[_0x111b38(0xd6)]}),_0x5194dd=_0x13e8f2[_0x111b38(0x10d)],_0x235c54=await executeSchemaQuery(_0x5194dd,_0xb4568,_0x3964d2);return await handleQueryOutput(_0x235c54,_0x3964d2),0x0;}catch(_0x1049ab){if(_0x1049ab instanceof SDKError)return console[_0x111b38(0xd5)](_0x111b38(0xfb)+_0x1049ab[_0x111b38(0x146)]),_0x1049ab[_0x111b38(0x10e)]&&console['error'](_0x111b38(0xcf)+_0x1049ab[_0x111b38(0x10e)]),0x1;throw _0x1049ab;}}}
@@ -1 +1 @@
1
- function a26_0x45fa(_0x364fd6,_0x13d7fb){_0x364fd6=_0x364fd6-0x167;const _0x351f5c=a26_0x351f();let _0x45fa86=_0x351f5c[_0x364fd6];return _0x45fa86;}const a26_0x2bf1db=a26_0x45fa;(function(_0x1a530c,_0x25eb30){const _0x2e1ba3=a26_0x45fa,_0x3fc940=_0x1a530c();while(!![]){try{const _0x343fa2=parseInt(_0x2e1ba3(0x170))/0x1*(-parseInt(_0x2e1ba3(0x18f))/0x2)+-parseInt(_0x2e1ba3(0x169))/0x3+-parseInt(_0x2e1ba3(0x189))/0x4+-parseInt(_0x2e1ba3(0x16c))/0x5*(-parseInt(_0x2e1ba3(0x195))/0x6)+parseInt(_0x2e1ba3(0x17e))/0x7+parseInt(_0x2e1ba3(0x167))/0x8+parseInt(_0x2e1ba3(0x18c))/0x9;if(_0x343fa2===_0x25eb30)break;else _0x3fc940['push'](_0x3fc940['shift']());}catch(_0x4a56d5){_0x3fc940['push'](_0x3fc940['shift']());}}}(a26_0x351f,0x37a49));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a26_0x351f(){const _0x298239=['segments','kind','Resolved\x20relative\x20path\x20to:\x20','\x20\x20\x20Path:\x20','resolveParentId','segment:create','Segment\x20name:\x20','775876JCwKUd','folderId','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','7247871DEOLgv','data','folder','5228ifGPZX','resolvePathToResource','yellow','name','resolveFolderId','type','18oZMJFf','includes','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','segment','description','site','371400kyApXM','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','999615fAkuPu','Examples:','\x27...','159985YLshRb','Target\x20path:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','parent','133TpDQTN','Parent\x20path:\x20','Resolving\x20folder\x20\x27','✔\x20Created\x20segment\x20\x27','Resolving\x20folder\x20path\x20\x27','rule','noCountPopulation','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','length','createSegment','Resolved\x20folder\x20ID:\x20','verbose','⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.','\x27\x20with\x20ID:\x20','1085098vhmeZK','ruleFile','segmentPath','error'];a26_0x351f=function(){return _0x298239;};return a26_0x351f();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0x993169 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x2bf1db(0x192)]=a26_0x2bf1db(0x187);['description']='Create\x20child\x20segment\x20with\x20filtering\x20rules';async['execute'](_0xfb2efa){const _0x2f4538=a26_0x2bf1db;console[_0x2f4538(0x181)](a26_0x993169[_0x2f4538(0x191)](_0x2f4538(0x17c))),console[_0x2f4538(0x181)](a26_0x993169[_0x2f4538(0x191)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x53f7a1,args:_0x5412f2,tdx:_0x4d0f36}=_0xfb2efa,_0x4b8b49=_0x53f7a1;if(_0x5412f2[_0x2f4538(0x178)]===0x0)return console[_0x2f4538(0x181)](_0x2f4538(0x16e)),console[_0x2f4538(0x181)](_0x2f4538(0x168)),console[_0x2f4538(0x181)](_0x2f4538(0x16a)),console[_0x2f4538(0x181)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'),console[_0x2f4538(0x181)](_0x2f4538(0x18b)),console[_0x2f4538(0x181)](_0x2f4538(0x177)),0x1;const _0x23511e=_0x5412f2[0x0],_0x4d4cad=_0x53f7a1[_0x2f4538(0x180)];let _0x571838=_0x23511e;_0x4d4cad&&!_0x23511e[_0x2f4538(0x196)]('/')&&(_0x571838=_0x4d4cad+'/'+_0x23511e,_0x4b8b49[_0x2f4538(0x17b)]&&console['error'](_0x2f4538(0x184)+_0x571838));const _0x2b70e0=parsePath(_0x571838);if(_0x2b70e0[_0x2f4538(0x182)][_0x2f4538(0x178)]<0x2)return console[_0x2f4538(0x181)]('Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)'),console[_0x2f4538(0x181)](_0x2f4538(0x197)),0x1;const _0x3d4a2a=_0x2b70e0[_0x2f4538(0x182)][0x0],_0x3465ef=getBaseName(_0x571838),_0x2cf66c=getParentPath(_0x571838);_0x4b8b49[_0x2f4538(0x17b)]&&(console['error']('Site:\x20'+_0x4b8b49[_0x2f4538(0x19a)]),console[_0x2f4538(0x181)](_0x2f4538(0x16d)+_0x571838),console['error']('Parent:\x20'+_0x3d4a2a),console[_0x2f4538(0x181)](_0x2f4538(0x188)+_0x3465ef),console['error'](_0x2f4538(0x171)+_0x2cf66c));const _0x272c5a=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3d4a2a+_0x2f4538(0x16b),()=>_0x4d0f36[_0x2f4538(0x198)][_0x2f4538(0x186)](_0x3d4a2a),{'verbose':_0x4b8b49['verbose']}),_0x1c38a2=_0x272c5a[_0x2f4538(0x18d)];let _0x515e64;if(_0x2b70e0[_0x2f4538(0x182)][_0x2f4538(0x178)]>0x2){const _0x35ff1e=await withSpinner(_0x2f4538(0x174)+_0x2cf66c+'\x27...',()=>_0x4d0f36[_0x2f4538(0x198)][_0x2f4538(0x190)](_0x2cf66c),{'verbose':_0x4b8b49['verbose']}),_0x4a9f4d=_0x35ff1e[_0x2f4538(0x18d)];if(_0x4a9f4d[_0x2f4538(0x194)]!==_0x2f4538(0x18e)&&_0x4a9f4d[_0x2f4538(0x194)]!==_0x2f4538(0x16f))return console['error']('Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.'),0x1;_0x515e64=_0x4a9f4d[_0x2f4538(0x18a)];}else{if(_0x4b8b49[_0x2f4538(0x18e)]){const _0x54cc9f=await withSpinner(_0x2f4538(0x172)+_0x4b8b49[_0x2f4538(0x18e)]+_0x2f4538(0x16b),()=>_0x4d0f36['segment'][_0x2f4538(0x193)](_0x1c38a2,_0x4b8b49['folder']),{'verbose':_0x4b8b49[_0x2f4538(0x17b)]});_0x515e64=_0x54cc9f['data'];}}_0x4b8b49[_0x2f4538(0x17b)]&&_0x515e64&&console['error'](_0x2f4538(0x17a)+_0x515e64);const _0x414eee=await loadJSONFromOptions(_0x4b8b49[_0x2f4538(0x175)],_0x4b8b49[_0x2f4538(0x17f)]),_0x4b575b={'name':_0x3465ef,'description':_0x4b8b49[_0x2f4538(0x199)],'rule':_0x414eee,'kind':_0x4b8b49[_0x2f4538(0x183)]!==undefined?parseInt(_0x4b8b49[_0x2f4538(0x183)],0xa):undefined,'isVisible':_0x4b8b49['invisible']?![]:undefined,'segmentFolderId':_0x515e64,'countPopulation':_0x4b8b49[_0x2f4538(0x176)]?![]:undefined},_0x262287=await withSpinner('Creating\x20segment\x20\x27'+_0x3465ef+_0x2f4538(0x16b),()=>_0x4d0f36[_0x2f4538(0x198)][_0x2f4538(0x179)](_0x1c38a2,_0x4b575b),{'verbose':_0x4b8b49['verbose']}),_0x3aae27=_0x262287['data'];return console[_0x2f4538(0x181)](_0x2f4538(0x173)+_0x3aae27[_0x2f4538(0x192)]+_0x2f4538(0x17d)+_0x3aae27['id']),_0x571838!==_0x23511e&&console[_0x2f4538(0x181)](_0x2f4538(0x185)+_0x571838),await handleSDKOutput([_0x3aae27],_0x4b8b49),0x0;}}
1
+ const a26_0x2f8e47=a26_0x76f4;function a26_0x76f4(_0x3f14df,_0x16605a){_0x3f14df=_0x3f14df-0xf3;const _0x24ae03=a26_0x24ae();let _0x76f4d9=_0x24ae03[_0x3f14df];return _0x76f4d9;}(function(_0x296c1c,_0x4fea95){const _0x4657cc=a26_0x76f4,_0xcfd95=_0x296c1c();while(!![]){try{const _0x5b80ae=parseInt(_0x4657cc(0x10f))/0x1+parseInt(_0x4657cc(0x10e))/0x2*(-parseInt(_0x4657cc(0x104))/0x3)+parseInt(_0x4657cc(0x103))/0x4*(-parseInt(_0x4657cc(0xf8))/0x5)+-parseInt(_0x4657cc(0x11e))/0x6*(-parseInt(_0x4657cc(0xfe))/0x7)+parseInt(_0x4657cc(0xf9))/0x8+-parseInt(_0x4657cc(0x112))/0x9+-parseInt(_0x4657cc(0x10c))/0xa*(-parseInt(_0x4657cc(0x121))/0xb);if(_0x5b80ae===_0x4fea95)break;else _0xcfd95['push'](_0xcfd95['shift']());}catch(_0x1bfe70){_0xcfd95['push'](_0xcfd95['shift']());}}}(a26_0x24ae,0x1ad56));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a26_0x24ae(){const _0x196a17=['includes','Site:\x20','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Parent\x20path:\x20','Resolving\x20folder\x20path\x20\x27','Examples:','5YlEPnO','44216coMGRn','resolvePathToResource','✔\x20Created\x20segment\x20\x27','yellow','parent','749126lUjVHJ','description','Resolving\x20parent\x20segment\x20\x27','\x27...','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','397704KbxsIn','142119PVxQQG','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','resolveFolderId','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','rule','folder','Resolved\x20folder\x20ID:\x20','\x27\x20with\x20ID:\x20','10boBPvY','execute','4ZSFKZG','97805TlDHaW','segments','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','1010169HLanzf','verbose','length','noCountPopulation','invisible','ruleFile','type','name','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','data','Resolved\x20relative\x20path\x20to:\x20','Target\x20path:\x20','6iloYpA','createSegment','Parent:\x20','2265703kRKDUP','Resolving\x20folder\x20\x27','site','Segment\x20name:\x20','kind','error','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27'];a26_0x24ae=function(){return _0x196a17;};return a26_0x24ae();}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a26_0xb703bc from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x2f8e47(0x119)]='segment:create';['description']='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a26_0x2f8e47(0x10d)](_0x435189){const _0x29534c=a26_0x2f8e47;console[_0x29534c(0x126)](a26_0xb703bc[_0x29534c(0xfc)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x29534c(0x126)](a26_0xb703bc[_0x29534c(0xfc)](_0x29534c(0x105)));const {options:_0x52d695,args:_0x40f8c6,tdx:_0x5647d9}=_0x435189,_0x5e73e0=_0x52d695;if(_0x40f8c6['length']===0x0)return console[_0x29534c(0x126)](_0x29534c(0x102)),console[_0x29534c(0x126)](_0x29534c(0x111)),console[_0x29534c(0x126)](_0x29534c(0xf7)),console[_0x29534c(0x126)](_0x29534c(0x127)),console[_0x29534c(0x126)]('\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27'),console[_0x29534c(0x126)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x5e5b79=_0x40f8c6[0x0],_0x32e3d5=_0x52d695['segmentPath'];let _0xb10e7c=_0x5e5b79;_0x32e3d5&&!_0x5e5b79[_0x29534c(0x128)]('/')&&(_0xb10e7c=_0x32e3d5+'/'+_0x5e5b79,_0x5e73e0[_0x29534c(0x113)]&&console['error'](_0x29534c(0x11c)+_0xb10e7c));const _0x345fe7=parsePath(_0xb10e7c);if(_0x345fe7[_0x29534c(0x110)][_0x29534c(0x114)]<0x2)return console['error'](_0x29534c(0x107)),console['error'](_0x29534c(0x11a)),0x1;const _0x2cb524=_0x345fe7[_0x29534c(0x110)][0x0],_0x3c4b81=getBaseName(_0xb10e7c),_0x551553=getParentPath(_0xb10e7c);_0x5e73e0[_0x29534c(0x113)]&&(console[_0x29534c(0x126)](_0x29534c(0xf3)+_0x5e73e0[_0x29534c(0x123)]),console[_0x29534c(0x126)](_0x29534c(0x11d)+_0xb10e7c),console[_0x29534c(0x126)](_0x29534c(0x120)+_0x2cb524),console[_0x29534c(0x126)](_0x29534c(0x124)+_0x3c4b81),console[_0x29534c(0x126)](_0x29534c(0xf5)+_0x551553));const _0x310c2c=await withSpinner(_0x29534c(0x100)+_0x2cb524+_0x29534c(0x101),()=>_0x5647d9['segment']['resolveParentId'](_0x2cb524),{'verbose':_0x5e73e0[_0x29534c(0x113)]}),_0x20a8ab=_0x310c2c[_0x29534c(0x11b)];let _0x554877;if(_0x345fe7[_0x29534c(0x110)][_0x29534c(0x114)]>0x2){const _0x181ef1=await withSpinner(_0x29534c(0xf6)+_0x551553+_0x29534c(0x101),()=>_0x5647d9['segment'][_0x29534c(0xfa)](_0x551553),{'verbose':_0x5e73e0[_0x29534c(0x113)]}),_0x37c5d8=_0x181ef1[_0x29534c(0x11b)];if(_0x37c5d8[_0x29534c(0x118)]!==_0x29534c(0x109)&&_0x37c5d8['type']!==_0x29534c(0xfd))return console[_0x29534c(0x126)](_0x29534c(0xf4)),0x1;_0x554877=_0x37c5d8['folderId'];}else{if(_0x5e73e0[_0x29534c(0x109)]){const _0x5b7d7e=await withSpinner(_0x29534c(0x122)+_0x5e73e0[_0x29534c(0x109)]+_0x29534c(0x101),()=>_0x5647d9['segment'][_0x29534c(0x106)](_0x20a8ab,_0x5e73e0['folder']),{'verbose':_0x5e73e0['verbose']});_0x554877=_0x5b7d7e[_0x29534c(0x11b)];}}_0x5e73e0['verbose']&&_0x554877&&console[_0x29534c(0x126)](_0x29534c(0x10a)+_0x554877);const _0x356426=await loadJSONFromOptions(_0x5e73e0[_0x29534c(0x108)],_0x5e73e0[_0x29534c(0x117)]),_0x30543d={'name':_0x3c4b81,'description':_0x5e73e0[_0x29534c(0xff)],'rule':_0x356426,'kind':_0x5e73e0[_0x29534c(0x125)]!==undefined?parseInt(_0x5e73e0[_0x29534c(0x125)],0xa):undefined,'isVisible':_0x5e73e0[_0x29534c(0x116)]?![]:undefined,'segmentFolderId':_0x554877,'countPopulation':_0x5e73e0[_0x29534c(0x115)]?![]:undefined},_0xbbd71=await withSpinner('Creating\x20segment\x20\x27'+_0x3c4b81+_0x29534c(0x101),()=>_0x5647d9['segment'][_0x29534c(0x11f)](_0x20a8ab,_0x30543d),{'verbose':_0x5e73e0[_0x29534c(0x113)]}),_0x17bffb=_0xbbd71['data'];return console[_0x29534c(0x126)](_0x29534c(0xfb)+_0x17bffb[_0x29534c(0x119)]+_0x29534c(0x10b)+_0x17bffb['id']),_0xb10e7c!==_0x5e5b79&&console[_0x29534c(0x126)]('\x20\x20\x20Path:\x20'+_0xb10e7c),await handleSDKOutput([_0x17bffb],_0x5e73e0),0x0;}}
@@ -1 +1 @@
1
- const a27_0x143650=a27_0x5574;(function(_0x2e43ee,_0x203427){const _0x3cc696=a27_0x5574,_0x4ae89f=_0x2e43ee();while(!![]){try{const _0x14fe6e=-parseInt(_0x3cc696(0x121))/0x1*(parseInt(_0x3cc696(0x10a))/0x2)+parseInt(_0x3cc696(0x116))/0x3*(-parseInt(_0x3cc696(0x11e))/0x4)+parseInt(_0x3cc696(0x120))/0x5*(-parseInt(_0x3cc696(0x10c))/0x6)+parseInt(_0x3cc696(0x117))/0x7*(-parseInt(_0x3cc696(0x107))/0x8)+parseInt(_0x3cc696(0x105))/0x9+-parseInt(_0x3cc696(0x104))/0xa+-parseInt(_0x3cc696(0x108))/0xb*(-parseInt(_0x3cc696(0x10e))/0xc);if(_0x14fe6e===_0x203427)break;else _0x4ae89f['push'](_0x4ae89f['shift']());}catch(_0x4e4b27){_0x4ae89f['push'](_0x4ae89f['shift']());}}}(a27_0xa2fd,0x26139));import{BaseCommand}from'./command.js';function a27_0xa2fd(){const _0xb7df10=['Parent\x20segment:\x20','843nTfTSs','10171MIGjXH','error','listFields','List\x20available\x20fields\x20for\x20segmentation','\x27...','\x20field','Error:\x20Parent\x20segment\x20name\x20is\x20required','2284coMOzt','verbose','1000GXnEpc','246607iRHppr','2261180himdTa','1178748OkQdEC','✔\x20Found\x20','664DUbjSK','11iePTdV','site','2PplZIb','parentSegment','3702gvCkGv','execute','10825968vRUetx','Site:\x20','segment','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','json','length','Listing\x20fields\x20for\x20\x27'];a27_0xa2fd=function(){return _0xb7df10;};return a27_0xa2fd();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a27_0x5574(_0x44d161,_0x37ddaf){_0x44d161=_0x44d161-0x104;const _0xa2fd6a=a27_0xa2fd();let _0x557445=_0xa2fd6a[_0x44d161];return _0x557445;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{['name']='segment:fields';['description']=a27_0x143650(0x11a);async[a27_0x143650(0x10d)](_0x19340d){const _0x33af55=a27_0x143650,{options:_0x2b7ea5,args:_0x88c20,tdx:_0x2509e4}=_0x19340d,_0x2f9dae=_0x88c20[0x0]||_0x2b7ea5[_0x33af55(0x10b)];if(!_0x2f9dae)return console[_0x33af55(0x118)](_0x33af55(0x11d)),console[_0x33af55(0x118)](_0x33af55(0x111)),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;_0x2b7ea5['verbose']&&(console['error'](_0x33af55(0x10f)+_0x2b7ea5[_0x33af55(0x109)]),console[_0x33af55(0x118)](_0x33af55(0x115)+_0x2f9dae));const _0x5e92db=await withSpinner(_0x33af55(0x114)+_0x2f9dae+_0x33af55(0x11b),()=>_0x2509e4[_0x33af55(0x110)][_0x33af55(0x119)](_0x2f9dae),{'verbose':_0x2b7ea5[_0x33af55(0x11f)]}),_0x4eeab5=_0x5e92db['data'];console[_0x33af55(0x118)](_0x33af55(0x106)+_0x4eeab5[_0x33af55(0x113)]+_0x33af55(0x11c)+(_0x4eeab5['length']!==0x1?'s':''));if(_0x2b7ea5[_0x33af55(0x112)]||_0x2b7ea5['jsonl'])return await handleSDKOutput(_0x4eeab5,_0x2b7ea5),0x0;return displayFieldsHumanReadable(_0x4eeab5,_0x2f9dae),0x0;}}
1
+ const a27_0x361d20=a27_0x2f58;(function(_0x3e04c2,_0x53403a){const _0x3a8060=a27_0x2f58,_0x1e081e=_0x3e04c2();while(!![]){try{const _0x18a016=-parseInt(_0x3a8060(0x18e))/0x1*(parseInt(_0x3a8060(0x188))/0x2)+-parseInt(_0x3a8060(0x187))/0x3+-parseInt(_0x3a8060(0x180))/0x4*(parseInt(_0x3a8060(0x173))/0x5)+-parseInt(_0x3a8060(0x175))/0x6+-parseInt(_0x3a8060(0x17d))/0x7+parseInt(_0x3a8060(0x186))/0x8+parseInt(_0x3a8060(0x177))/0x9;if(_0x18a016===_0x53403a)break;else _0x1e081e['push'](_0x1e081e['shift']());}catch(_0x4d5176){_0x1e081e['push'](_0x1e081e['shift']());}}}(a27_0x14c8,0x40de2));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a27_0x2f58(_0x2d1b05,_0x5cf729){_0x2d1b05=_0x2d1b05-0x172;const _0x14c886=a27_0x14c8();let _0x2f5899=_0x14c886[_0x2d1b05];return _0x2f5899;}function a27_0x14c8(){const _0x44ca7b=['136NCAFYW','execute','segment','Error:\x20Parent\x20segment\x20name\x20is\x20required','name','Site:\x20','7390jSCVnL','site','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','5wXylaE','✔\x20Found\x20','327426fTRuOs','description','15175926FdzZnr','\x27...','Listing\x20fields\x20for\x20\x27','parentSegment','json','segment:fields','3266599iVYmko','\x20field','verbose','973208zYOUHN','jsonl','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','List\x20available\x20fields\x20for\x20segmentation','error','data','2007416dfOCUe','1213179OnslBv'];a27_0x14c8=function(){return _0x44ca7b;};return a27_0x14c8();}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x361d20(0x18c)]=a27_0x361d20(0x17c);[a27_0x361d20(0x176)]=a27_0x361d20(0x183);async[a27_0x361d20(0x189)](_0x4ad5f0){const _0x4fef4e=a27_0x361d20,{options:_0x2a71b8,args:_0xfbc0d,tdx:_0x2b4b5d}=_0x4ad5f0,_0x570e6f=_0xfbc0d[0x0]||_0x2a71b8[_0x4fef4e(0x17a)];if(!_0x570e6f)return console['error'](_0x4fef4e(0x18b)),console['error'](_0x4fef4e(0x172)),console[_0x4fef4e(0x184)](_0x4fef4e(0x182)),0x1;_0x2a71b8['verbose']&&(console[_0x4fef4e(0x184)](_0x4fef4e(0x18d)+_0x2a71b8[_0x4fef4e(0x18f)]),console[_0x4fef4e(0x184)]('Parent\x20segment:\x20'+_0x570e6f));const _0x3195ef=await withSpinner(_0x4fef4e(0x179)+_0x570e6f+_0x4fef4e(0x178),()=>_0x2b4b5d[_0x4fef4e(0x18a)]['listFields'](_0x570e6f),{'verbose':_0x2a71b8[_0x4fef4e(0x17f)]}),_0x579113=_0x3195ef[_0x4fef4e(0x185)];console['error'](_0x4fef4e(0x174)+_0x579113['length']+_0x4fef4e(0x17e)+(_0x579113['length']!==0x1?'s':''));if(_0x2a71b8[_0x4fef4e(0x17b)]||_0x2a71b8[_0x4fef4e(0x181)])return await handleSDKOutput(_0x579113,_0x2a71b8),0x0;return displayFieldsHumanReadable(_0x579113,_0x570e6f),0x0;}}
@@ -1 +1 @@
1
- const a28_0x1e5bd1=a28_0x1ea9;(function(_0x21bf6f,_0x34c529){const _0x3053ba=a28_0x1ea9,_0x2c4dd3=_0x21bf6f();while(!![]){try{const _0x1b3686=parseInt(_0x3053ba(0xaf))/0x1*(-parseInt(_0x3053ba(0xa7))/0x2)+parseInt(_0x3053ba(0xa1))/0x3*(parseInt(_0x3053ba(0xd1))/0x4)+parseInt(_0x3053ba(0xe2))/0x5+parseInt(_0x3053ba(0xc4))/0x6+-parseInt(_0x3053ba(0xb8))/0x7*(-parseInt(_0x3053ba(0xc8))/0x8)+-parseInt(_0x3053ba(0xb6))/0x9+-parseInt(_0x3053ba(0xda))/0xa;if(_0x1b3686===_0x34c529)break;else _0x2c4dd3['push'](_0x2c4dd3['shift']());}catch(_0x4f624e){_0x2c4dd3['push'](_0x2c4dd3['shift']());}}}(a28_0x2ba9,0x5580d));function a28_0x2ba9(){const _0xc465cb=['journeys','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','no_parent','dim','error','activations','green','files','2390826JFnbFw','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x20journeys','\x20segments','296yNtpXm','description','\x0aPull\x20summary\x20for\x20\x27','filter','red','absolutePath','\x20unchanged\x20files','segment:pull','dirname','1135628dlCxWZ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','content','errorCode','\x20\x20🎯\x20','diff','name','\x20changed\x20files','journeyVersions','3031980HOlfce','relativePath','isNew','pullSegments','session','✔\x20All\x20files\x20are\x20up\x20to\x20date','segment','message','2043555kDYGap','data','\x20versions)','Pulling\x20segments\x20from\x20\x27','\x20files?','length','3KYwVyI','\x20new\x20files','\x27...','verbose','targetDir','\x0aChanges\x20to\x20\x27','2rnuazG','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','execute','\x20files\x20to\x20','parentName','dryRun','✔\x20Context\x20set:\x20','\x20\x20Target:\x20','616079MJJmTF','Error:\x20','segments','counts','hasChanges','cyan','yellow','851526ZXAstI','parentSegment','51653lWcKsi','\x20=\x20','repeat','yes'];a28_0x2ba9=function(){return _0xc465cb;};return a28_0x2ba9();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0x377f4f from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x580ad5 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a28_0x1ea9(_0x192814,_0x1ac698){_0x192814=_0x192814-0xa0;const _0x2ba985=a28_0x2ba9();let _0x1ea916=_0x2ba985[_0x192814];return _0x1ea916;}export class SegmentPullCommand extends BaseCommand{[a28_0x1e5bd1(0xd7)]=a28_0x1e5bd1(0xcf);[a28_0x1e5bd1(0xc9)]=a28_0x1e5bd1(0xa8);async[a28_0x1e5bd1(0xa9)](_0x338185){const _0x373029=a28_0x1e5bd1,{options:_0x289179,args:_0x2c7f31,tdx:_0x107477}=_0x338185,_0x44ac55=_0x289179,_0x54edbb=await resolveTarget({'arg':_0x2c7f31[0x0],'contextParent':_0x289179[_0x373029(0xb7)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x54edbb))return _0x54edbb[_0x373029(0xd4)]===_0x373029(0xbe)?(console[_0x373029(0xc0)](a28_0x377f4f[_0x373029(0xb5)](_0x373029(0xbd))),console[_0x373029(0xc0)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console[_0x373029(0xc0)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x373029(0xc0)](_0x373029(0xd2))):(console[_0x373029(0xc0)](a28_0x377f4f[_0x373029(0xcc)](_0x373029(0xb0)+_0x54edbb[_0x373029(0xe1)]+'\x0a')),_0x54edbb['helpText']&&console[_0x373029(0xc0)](a28_0x377f4f[_0x373029(0xb4)](_0x54edbb['helpText']))),0x1;const _0x160176=_0x54edbb['parentName'],_0xbe2184=_0x54edbb[_0x373029(0xa5)];_0x44ac55[_0x373029(0xa4)]&&(console[_0x373029(0xc0)]('Site:\x20'+_0x44ac55['site']),console[_0x373029(0xc0)]('Parent\x20segment:\x20'+_0x160176));const _0x4fd566=await withProgressSpinner(_0x373029(0xe5)+_0x160176+_0x373029(0xa3),_0x405f51=>_0x107477[_0x373029(0xe0)][_0x373029(0xdd)](_0x160176,{'targetDir':_0xbe2184,'verbose':_0x44ac55[_0x373029(0xa4)],'progress':{'update':_0x2d9de5=>{const _0x3c7aae=_0x373029;_0x405f51['setPhase'](_0x2d9de5),_0x44ac55[_0x3c7aae(0xa4)]&&console[_0x3c7aae(0xc0)]('\x20\x20'+_0x2d9de5);}}}),{'verbose':_0x44ac55[_0x373029(0xa4)]}),_0x5baea9=_0x4fd566[_0x373029(0xe3)];if(_0x5baea9[_0x373029(0xb2)][_0x373029(0xb1)]===0x0&&_0x5baea9[_0x373029(0xb2)][_0x373029(0xbc)]===0x0)return console[_0x373029(0xc0)](a28_0x377f4f[_0x373029(0xb5)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x5baea9[_0x373029(0xab)]+'\x27')),0x0;const _0x527aaa=_0x5baea9[_0x373029(0xc3)][_0x373029(0xcb)](_0x22d1c9=>_0x22d1c9[_0x373029(0xdc)]),_0xcae220=_0x5baea9[_0x373029(0xc3)][_0x373029(0xcb)](_0x57ff84=>!_0x57ff84[_0x373029(0xdc)]&&_0x57ff84[_0x373029(0xb3)]),_0x3b449c=_0x5baea9[_0x373029(0xc3)]['filter'](_0xd51b59=>!_0xd51b59['isNew']&&!_0xd51b59[_0x373029(0xb3)]);console[_0x373029(0xc0)](_0x373029(0xca)+_0x5baea9[_0x373029(0xab)]+'\x27:'),console['error'](_0x373029(0xd5)+a28_0x377f4f[_0x373029(0xb4)](_0x5baea9['counts'][_0x373029(0xb1)]+_0x373029(0xc7))+'\x20with\x20'+a28_0x377f4f['cyan'](_0x5baea9[_0x373029(0xb2)][_0x373029(0xc1)]+'\x20activations'));if(_0x5baea9[_0x373029(0xb2)][_0x373029(0xbc)]>0x0){const _0xc1d9a=_0x5baea9[_0x373029(0xb2)][_0x373029(0xd9)]>_0x5baea9[_0x373029(0xb2)]['journeys']?'\x20('+_0x5baea9[_0x373029(0xb2)][_0x373029(0xd9)]+_0x373029(0xe4):'';console['error']('\x20\x20🗺️\x20\x20'+a28_0x377f4f[_0x373029(0xb4)](_0x5baea9[_0x373029(0xb2)][_0x373029(0xbc)]+_0x373029(0xc6))+a28_0x377f4f['dim'](_0xc1d9a));}console[_0x373029(0xc0)]('\x20\x20'+a28_0x377f4f['green']('+\x20'+_0x527aaa[_0x373029(0xa0)]+_0x373029(0xa2))),console['error']('\x20\x20'+a28_0x377f4f[_0x373029(0xb5)]('~\x20'+_0xcae220[_0x373029(0xa0)]+_0x373029(0xd8))),console['error']('\x20\x20'+a28_0x377f4f[_0x373029(0xbf)]('=\x20'+_0x3b449c[_0x373029(0xa0)]+_0x373029(0xce))),console[_0x373029(0xc0)](_0x373029(0xae)+a28_0x377f4f[_0x373029(0xb4)](_0x5baea9[_0x373029(0xa5)])+'\x0a');if(_0xcae220['length']>0x0)for(const _0x14574f of _0xcae220){console[_0x373029(0xc0)](_0x373029(0xa6)+_0x14574f[_0x373029(0xdb)]+'\x27:'),console[_0x373029(0xc0)]('─'[_0x373029(0xba)](0x3c)),console['error'](_0x14574f[_0x373029(0xd6)]),console[_0x373029(0xc0)]('─'[_0x373029(0xba)](0x3c));}if(_0x44ac55[_0x373029(0xac)])return console['error'](a28_0x377f4f[_0x373029(0xb5)](_0x373029(0xc5))),0x0;if(_0x527aaa['length']===0x0&&_0xcae220['length']===0x0)return console[_0x373029(0xc0)](a28_0x377f4f[_0x373029(0xc2)](_0x373029(0xdf))),saveSessionContext({'parent_segment':_0x5baea9[_0x373029(0xab)]},_0x44ac55[_0x373029(0xde)]),console['error'](a28_0x377f4f['green'](_0x373029(0xad)+a28_0x377f4f[_0x373029(0xbf)]('parent_segment')+_0x373029(0xb9)+a28_0x377f4f[_0x373029(0xb4)](_0x5baea9[_0x373029(0xab)]))),0x0;if(!_0x44ac55[_0x373029(0xbb)]){const _0x2c8572=await confirmKey('Write\x20'+(_0x527aaa[_0x373029(0xa0)]+_0xcae220[_0x373029(0xa0)])+_0x373029(0xe6));if(!_0x2c8572)return console[_0x373029(0xc0)]('Aborted.'),0x1;}for(const _0x483f28 of _0x5baea9[_0x373029(0xc3)]){if(_0x483f28['isNew']||_0x483f28[_0x373029(0xb3)]){const _0x1f8844=a28_0x580ad5[_0x373029(0xd0)](_0x483f28[_0x373029(0xcd)]);!existsSync(_0x1f8844)&&mkdirSync(_0x1f8844,{'recursive':!![]}),writeFileSync(_0x483f28[_0x373029(0xcd)],_0x483f28[_0x373029(0xd3)],'utf-8');}}return console[_0x373029(0xc0)](a28_0x377f4f[_0x373029(0xc2)]('✔\x20Pulled\x20'+(_0x527aaa[_0x373029(0xa0)]+_0xcae220[_0x373029(0xa0)])+_0x373029(0xaa)+_0x5baea9[_0x373029(0xa5)])),saveSessionContext({'parent_segment':_0x5baea9[_0x373029(0xab)]},_0x44ac55[_0x373029(0xde)]),console[_0x373029(0xc0)](a28_0x377f4f['green']('✔\x20Context\x20set:\x20'+a28_0x377f4f[_0x373029(0xbf)]('parent_segment')+_0x373029(0xb9)+a28_0x377f4f[_0x373029(0xb4)](_0x5baea9[_0x373029(0xab)]))),0x0;}}
1
+ function a28_0xcf9a(){const _0x4bf156=['green','journeys','dirname','site','parentSegment','targetDir','Site:\x20','cwd','no_parent','journeyVersions','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','200952QGgQcU','1843280rgeHcY','173378RFDbtn','\x20journeys','execute','segment:pull','yellow','description','\x20\x20🗺️\x20\x20','\x0aPull\x20summary\x20for\x20\x27','length','\x20unchanged\x20files','setPhase','activations','\x20segments','7330DIFveH','cyan','session','\x20=\x20','\x20changed\x20files','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','segment','utf-8','filter','files','helpText','relativePath','6KURfQD','name','1070550hcsAqz','repeat','Aborted.','data','segments','901033euIsND','parent_segment','\x20files?','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','error','✔\x20Context\x20set:\x20','Parent\x20segment:\x20','isNew','54juzxiS','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','diff','\x20activations','counts','dim','dryRun','2057XGPjnw','536276QTSiGJ','Pulling\x20segments\x20from\x20\x27','4izTbRI','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x0aChanges\x20to\x20\x27','\x20\x20Target:\x20','content','verbose','hasChanges','\x20files\x20to\x20','\x20versions)','parentName','\x20new\x20files','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'];a28_0xcf9a=function(){return _0x4bf156;};return a28_0xcf9a();}const a28_0xc62009=a28_0x2d01;(function(_0x433ba4,_0x37465c){const _0xc6de38=a28_0x2d01,_0x3a8452=_0x433ba4();while(!![]){try{const _0x9786eb=-parseInt(_0xc6de38(0xd5))/0x1+parseInt(_0xc6de38(0x105))/0x2+parseInt(_0xc6de38(0xf0))/0x3+-parseInt(_0xc6de38(0x107))/0x4*(parseInt(_0xc6de38(0xd4))/0x5)+parseInt(_0xc6de38(0xee))/0x6*(-parseInt(_0xc6de38(0xf5))/0x7)+-parseInt(_0xc6de38(0x11e))/0x8*(-parseInt(_0xc6de38(0xfd))/0x9)+-parseInt(_0xc6de38(0xe2))/0xa*(-parseInt(_0xc6de38(0x104))/0xb);if(_0x9786eb===_0x37465c)break;else _0x3a8452['push'](_0x3a8452['shift']());}catch(_0x231400){_0x3a8452['push'](_0x3a8452['shift']());}}}(a28_0xcf9a,0x3b164));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a28_0xf302e8 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a28_0x2d01(_0x1f3578,_0x19488c){_0x1f3578=_0x1f3578-0xd4;const _0xcf9a36=a28_0xcf9a();let _0x2d01bb=_0xcf9a36[_0x1f3578];return _0x2d01bb;}import a28_0x4e1c4e from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a28_0xc62009(0xef)]=a28_0xc62009(0xd8);[a28_0xc62009(0xda)]=a28_0xc62009(0x11d);async[a28_0xc62009(0xd7)](_0x13d5bd){const _0x2c7a3e=a28_0xc62009,{options:_0x3f4099,args:_0x31b0d8,tdx:_0x3b36a9}=_0x13d5bd,_0x5041f9=_0x3f4099,_0x9011=await resolveTarget({'arg':_0x31b0d8[0x0],'contextParent':_0x3f4099[_0x2c7a3e(0x117)],'cwd':process[_0x2c7a3e(0x11a)]()});if(!isSuccessfulResolution(_0x9011))return _0x9011['errorCode']===_0x2c7a3e(0x11b)?(console[_0x2c7a3e(0xf9)](a28_0xf302e8[_0x2c7a3e(0xd9)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2c7a3e(0xf9)](_0x2c7a3e(0x112)),console[_0x2c7a3e(0xf9)](_0x2c7a3e(0x108)),console[_0x2c7a3e(0xf9)](_0x2c7a3e(0xe7))):(console[_0x2c7a3e(0xf9)](a28_0xf302e8['red']('Error:\x20'+_0x9011['message']+'\x0a')),_0x9011[_0x2c7a3e(0xec)]&&console[_0x2c7a3e(0xf9)](a28_0xf302e8[_0x2c7a3e(0xe3)](_0x9011[_0x2c7a3e(0xec)]))),0x1;const _0x41613c=_0x9011[_0x2c7a3e(0x110)],_0x23f7a9=_0x9011[_0x2c7a3e(0x118)];_0x5041f9[_0x2c7a3e(0x10c)]&&(console[_0x2c7a3e(0xf9)](_0x2c7a3e(0x119)+_0x5041f9[_0x2c7a3e(0x116)]),console['error'](_0x2c7a3e(0xfb)+_0x41613c));const _0x2315df=await withProgressSpinner(_0x2c7a3e(0x106)+_0x41613c+'\x27...',_0x57032d=>_0x3b36a9[_0x2c7a3e(0xe8)]['pullSegments'](_0x41613c,{'targetDir':_0x23f7a9,'verbose':_0x5041f9[_0x2c7a3e(0x10c)],'progress':{'update':_0x29c0ec=>{const _0x6c9b5d=_0x2c7a3e;_0x57032d[_0x6c9b5d(0xdf)](_0x29c0ec),_0x5041f9['verbose']&&console['error']('\x20\x20'+_0x29c0ec);}}}),{'verbose':_0x5041f9[_0x2c7a3e(0x10c)]}),_0x18af65=_0x2315df[_0x2c7a3e(0xf3)];if(_0x18af65[_0x2c7a3e(0x101)]['segments']===0x0&&_0x18af65[_0x2c7a3e(0x101)][_0x2c7a3e(0x114)]===0x0)return console[_0x2c7a3e(0xf9)](a28_0xf302e8[_0x2c7a3e(0xd9)](_0x2c7a3e(0xf8)+_0x18af65[_0x2c7a3e(0x110)]+'\x27')),0x0;const _0x272d32=_0x18af65[_0x2c7a3e(0xeb)][_0x2c7a3e(0xea)](_0x16aa9d=>_0x16aa9d[_0x2c7a3e(0xfc)]),_0x2c94c5=_0x18af65[_0x2c7a3e(0xeb)]['filter'](_0x58ad42=>!_0x58ad42['isNew']&&_0x58ad42[_0x2c7a3e(0x10d)]),_0xa38db3=_0x18af65[_0x2c7a3e(0xeb)][_0x2c7a3e(0xea)](_0x247d9f=>!_0x247d9f[_0x2c7a3e(0xfc)]&&!_0x247d9f[_0x2c7a3e(0x10d)]);console[_0x2c7a3e(0xf9)](_0x2c7a3e(0xdc)+_0x18af65[_0x2c7a3e(0x110)]+'\x27:'),console[_0x2c7a3e(0xf9)]('\x20\x20🎯\x20'+a28_0xf302e8[_0x2c7a3e(0xe3)](_0x18af65[_0x2c7a3e(0x101)][_0x2c7a3e(0xf4)]+_0x2c7a3e(0xe1))+'\x20with\x20'+a28_0xf302e8['cyan'](_0x18af65[_0x2c7a3e(0x101)][_0x2c7a3e(0xe0)]+_0x2c7a3e(0x100)));if(_0x18af65[_0x2c7a3e(0x101)][_0x2c7a3e(0x114)]>0x0){const _0x47f298=_0x18af65['counts'][_0x2c7a3e(0x11c)]>_0x18af65['counts']['journeys']?'\x20('+_0x18af65[_0x2c7a3e(0x101)][_0x2c7a3e(0x11c)]+_0x2c7a3e(0x10f):'';console['error'](_0x2c7a3e(0xdb)+a28_0xf302e8[_0x2c7a3e(0xe3)](_0x18af65[_0x2c7a3e(0x101)][_0x2c7a3e(0x114)]+_0x2c7a3e(0xd6))+a28_0xf302e8[_0x2c7a3e(0x102)](_0x47f298));}console[_0x2c7a3e(0xf9)]('\x20\x20'+a28_0xf302e8[_0x2c7a3e(0x113)]('+\x20'+_0x272d32['length']+_0x2c7a3e(0x111))),console['error']('\x20\x20'+a28_0xf302e8[_0x2c7a3e(0xd9)]('~\x20'+_0x2c94c5[_0x2c7a3e(0xdd)]+_0x2c7a3e(0xe6))),console[_0x2c7a3e(0xf9)]('\x20\x20'+a28_0xf302e8[_0x2c7a3e(0x102)]('=\x20'+_0xa38db3[_0x2c7a3e(0xdd)]+_0x2c7a3e(0xde))),console[_0x2c7a3e(0xf9)](_0x2c7a3e(0x10a)+a28_0xf302e8[_0x2c7a3e(0xe3)](_0x18af65[_0x2c7a3e(0x118)])+'\x0a');if(_0x2c94c5[_0x2c7a3e(0xdd)]>0x0)for(const _0x5a9e11 of _0x2c94c5){console[_0x2c7a3e(0xf9)](_0x2c7a3e(0x109)+_0x5a9e11[_0x2c7a3e(0xed)]+'\x27:'),console[_0x2c7a3e(0xf9)]('─'['repeat'](0x3c)),console[_0x2c7a3e(0xf9)](_0x5a9e11[_0x2c7a3e(0xff)]),console[_0x2c7a3e(0xf9)]('─'[_0x2c7a3e(0xf1)](0x3c));}if(_0x5041f9[_0x2c7a3e(0x103)])return console[_0x2c7a3e(0xf9)](a28_0xf302e8[_0x2c7a3e(0xd9)](_0x2c7a3e(0xfe))),0x0;if(_0x272d32[_0x2c7a3e(0xdd)]===0x0&&_0x2c94c5[_0x2c7a3e(0xdd)]===0x0)return console[_0x2c7a3e(0xf9)](a28_0xf302e8[_0x2c7a3e(0x113)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x18af65['parentName']},_0x5041f9[_0x2c7a3e(0xe4)]),console['error'](a28_0xf302e8['green'](_0x2c7a3e(0xfa)+a28_0xf302e8[_0x2c7a3e(0x102)]('parent_segment')+_0x2c7a3e(0xe5)+a28_0xf302e8[_0x2c7a3e(0xe3)](_0x18af65[_0x2c7a3e(0x110)]))),0x0;if(!_0x5041f9['yes']){const _0x5e0f3f=await confirmKey('Write\x20'+(_0x272d32[_0x2c7a3e(0xdd)]+_0x2c94c5[_0x2c7a3e(0xdd)])+_0x2c7a3e(0xf7));if(!_0x5e0f3f)return console[_0x2c7a3e(0xf9)](_0x2c7a3e(0xf2)),0x1;}for(const _0x38743f of _0x18af65['files']){if(_0x38743f['isNew']||_0x38743f['hasChanges']){const _0x14a92d=a28_0x4e1c4e[_0x2c7a3e(0x115)](_0x38743f['absolutePath']);!existsSync(_0x14a92d)&&mkdirSync(_0x14a92d,{'recursive':!![]}),writeFileSync(_0x38743f['absolutePath'],_0x38743f[_0x2c7a3e(0x10b)],_0x2c7a3e(0xe9));}}return console[_0x2c7a3e(0xf9)](a28_0xf302e8[_0x2c7a3e(0x113)]('✔\x20Pulled\x20'+(_0x272d32[_0x2c7a3e(0xdd)]+_0x2c94c5['length'])+_0x2c7a3e(0x10e)+_0x18af65[_0x2c7a3e(0x118)])),saveSessionContext({'parent_segment':_0x18af65[_0x2c7a3e(0x110)]},_0x5041f9[_0x2c7a3e(0xe4)]),console['error'](a28_0xf302e8[_0x2c7a3e(0x113)](_0x2c7a3e(0xfa)+a28_0xf302e8[_0x2c7a3e(0x102)](_0x2c7a3e(0xf6))+_0x2c7a3e(0xe5)+a28_0xf302e8[_0x2c7a3e(0xe3)](_0x18af65[_0x2c7a3e(0x110)]))),0x0;}}
@@ -1 +1 @@
1
- const a29_0x224275=a29_0x31eb;(function(_0x36fcbd,_0x4ad8c6){const _0x41d92e=a29_0x31eb,_0x5cbb5a=_0x36fcbd();while(!![]){try{const _0x5f324e=-parseInt(_0x41d92e(0xde))/0x1+-parseInt(_0x41d92e(0x11c))/0x2*(-parseInt(_0x41d92e(0xbe))/0x3)+parseInt(_0x41d92e(0x122))/0x4*(parseInt(_0x41d92e(0xed))/0x5)+parseInt(_0x41d92e(0x145))/0x6+-parseInt(_0x41d92e(0xf1))/0x7*(-parseInt(_0x41d92e(0x112))/0x8)+parseInt(_0x41d92e(0xd5))/0x9+-parseInt(_0x41d92e(0x146))/0xa;if(_0x5f324e===_0x4ad8c6)break;else _0x5cbb5a['push'](_0x5cbb5a['shift']());}catch(_0xda9581){_0x5cbb5a['push'](_0x5cbb5a['shift']());}}}(a29_0x42c0,0xc470a));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a29_0x31eb(_0x401b65,_0x11fb11){_0x401b65=_0x401b65-0xb9;const _0x42c09a=a29_0x42c0();let _0x31ebac=_0x42c09a[_0x401b65];return _0x31ebac;}import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x1ee904 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a29_0x42c0(){const _0x62e091=['Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','attributes','audienceId','helpText','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20parent\x20segment\x20details...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','deleted','buildUserMaps','delete','8276553IcYkzH','endsWith','error','verbose','/j/da/je','toCreate','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','No\x20','1491994iNzPHx','journeysOnly','getParent','\x20changes?','type','add','\x20\x20\x20\x20','journeys','push','join','setPhase','connection','nameToType','relationships','journeyBundleName','30085ItfhLe','(Journey\x20will\x20be\x20deleted)','\x20created','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','63aoPGrA','description','segment:push','Delete\x20segment:','toDelete','paused','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20to\x20delete','\x20activations]','\x20deleted','isNew','\x20unchanged','cyan','listSegments','scopedFolderPath','folderPath','data','\x20to\x20update','folders','Changes\x20to\x20journey:','set','listFolders','site','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/e/','message','journey','Site:\x20','red','green','Push\x20','updatedAt','list','1224904RKKXBz','\x27...','blue','map','\x20\x20📊\x20Segments:','createdSegmentIds','journeyId','yes','versionNumber','execute','3984laHubB','.yml','\x20\x20Source:\x20','segment','\x20updated','changed','392gVHUNb','Fetching\x20existing\x20journeys...','/app/ps/','user','toString','filePath','segment\x20or\x20journey','\x20\x20Activations:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Activations:\x20','\x20folders\x20to\x20create','\x20changed','unchanged','dim','\x20\x20🗺️\x20\x20Journeys:','Folders\x20to\x20create:','idToName','parent_name','Parent\x20segment:\x20','📁\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Delete\x20journey:','listActivations','name','updated','segmentFolderId','yamlConfig','Scoped\x20to\x20folder:\x20','existingJourney','parentSegment','.yaml','diff','journeyBundleId','\x20new','created','1356060xoJTRZ','15079220cmrcGe','results','yellow','all','getOutputSchemaWithCache','then','errorCode','length','folderId','filter','New\x20journey:','segments','1041AdjZtX','Source\x20directory:\x20','Fetching\x20existing\x20segments...','nameToId','getJourney','New\x20segment:','get','\x20\x20Segments:\x20','cwd','repeat','activations','✔\x20All\x20journeys\x20are\x20up\x20to\x20date'];a29_0x42c0=function(){return _0x62e091;};return a29_0x42c0();}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a29_0x224275(0x139)]=a29_0x224275(0xf3);['description']=a29_0x224275(0x108);async[a29_0x224275(0x11b)](_0x46c5a0){const _0x443d5e=a29_0x224275,{options:_0x46ae5e,args:_0x2b5c4f,tdx:_0x32104d}=_0x46c5a0,_0x561725=_0x46ae5e,_0x18c0f7=await resolveTarget({'arg':_0x2b5c4f[0x0],'contextParent':_0x46ae5e[_0x443d5e(0x13f)],'cwd':process[_0x443d5e(0xc6)]()});if(!isSuccessfulResolution(_0x18c0f7))return _0x18c0f7[_0x443d5e(0x14c)]==='no_parent'?(console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x148)](_0x443d5e(0x12a))),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x443d5e(0xd7)](_0x443d5e(0xd1)),console[_0x443d5e(0xd7)](_0x443d5e(0xdb))):(console['error'](a29_0x1ee904[_0x443d5e(0x10d)]('Error:\x20'+_0x18c0f7[_0x443d5e(0x10a)]+'\x0a')),_0x18c0f7[_0x443d5e(0xcd)]&&console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0xfd)](_0x18c0f7['helpText']))),0x1;if(_0x18c0f7['type']===_0x443d5e(0x133))return console['error'](a29_0x1ee904[_0x443d5e(0x10d)](_0x443d5e(0xcf)+_0x18c0f7['targetDir']+'\x0a')),console['error'](a29_0x1ee904[_0x443d5e(0xfd)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x4ee266=_0x18c0f7['parentName'],_0x596fed=_0x18c0f7['targetDir'],_0x58d384=_0x18c0f7[_0x443d5e(0xe2)]==='file'?_0x18c0f7[_0x443d5e(0x127)]:undefined,_0x42a9cc=getScopedDetails(_0x18c0f7),_0x286ade=_0x42a9cc?.['isScoped']??![],_0x30a371=_0x42a9cc?.[_0x443d5e(0xff)]??'';if(!existsSync(_0x596fed))return console['error'](a29_0x1ee904['red'](_0x443d5e(0xcf)+_0x596fed+'\x0a')),console['error'](a29_0x1ee904['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x561725[_0x443d5e(0xd8)]&&(console[_0x443d5e(0xd7)](_0x443d5e(0x10c)+_0x561725[_0x443d5e(0x107)]),console[_0x443d5e(0xd7)](_0x443d5e(0x134)+_0x4ee266),console[_0x443d5e(0xd7)](_0x443d5e(0xbf)+_0x596fed),_0x286ade&&console[_0x443d5e(0xd7)](_0x443d5e(0x13d)+_0x30a371));const _0x2003ab=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4ee266+_0x443d5e(0x113),()=>_0x32104d[_0x443d5e(0x11f)]['resolveParentId'](_0x4ee266),{'verbose':_0x561725[_0x443d5e(0xd8)]}),_0x4852f3=_0x2003ab[_0x443d5e(0x101)],[_0x1dffa0,_0x587398,_0x41918e,_0x49d82b,_0x9fe65c]=await Promise[_0x443d5e(0x149)]([withSpinner(_0x443d5e(0xd0),()=>_0x32104d[_0x443d5e(0x11f)][_0x443d5e(0xe0)](_0x4852f3),{'verbose':_0x561725[_0x443d5e(0xd8)]}),withSpinner(_0x443d5e(0xc0),()=>_0x32104d[_0x443d5e(0x11f)][_0x443d5e(0xfe)](_0x4852f3),{'verbose':_0x561725['verbose']}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x32104d[_0x443d5e(0x11f)][_0x443d5e(0x106)](_0x4852f3),{'verbose':_0x561725[_0x443d5e(0xd8)]}),withSpinner(_0x443d5e(0x123),()=>_0x32104d[_0x443d5e(0x10b)]['listJourneysWithDetailsFromParentSegment'](_0x4852f3),{'verbose':_0x561725['verbose']}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x32104d[_0x443d5e(0x125)][_0x443d5e(0xd3)](),{'verbose':_0x561725[_0x443d5e(0xd8)]})[_0x443d5e(0x14b)](_0x3ffbf=>_0x3ffbf[_0x443d5e(0x101)])]),_0x5205af=_0x1dffa0[_0x443d5e(0x101)],_0x458502=extractRootFolderId(_0x5205af),_0x67ff74=_0x587398[_0x443d5e(0x101)],_0x3371a1=_0x41918e[_0x443d5e(0x101)],{journeys:_0x527e45,activationStepsById:_0x2f51f4}=_0x49d82b[_0x443d5e(0x101)],_0x287e3e=new Map(_0x527e45[_0x443d5e(0x115)](_0x35e342=>[_0x35e342['id'],_0x35e342])),_0x367032=_0x527e45[_0x443d5e(0x115)](_0x5257aa=>({'id':_0x5257aa['id'],'name':_0x5257aa[_0x443d5e(0xcb)][_0x443d5e(0x139)],'journeyBundleName':_0x5257aa['attributes']['journeyBundleName']||'','journeyBundleId':_0x5257aa[_0x443d5e(0xcb)][_0x443d5e(0x142)]||'','versionNumber':_0x5257aa['attributes'][_0x443d5e(0x11a)],'description':_0x5257aa[_0x443d5e(0xcb)][_0x443d5e(0xf2)],'state':_0x5257aa['attributes']['state'],'paused':_0x5257aa[_0x443d5e(0xcb)][_0x443d5e(0xf6)],'audienceId':_0x5257aa[_0x443d5e(0xcb)][_0x443d5e(0xcc)],'folderId':_0x5257aa[_0x443d5e(0xeb)]?.['parentFolder']?.[_0x443d5e(0x101)]?.['id'],'createdAt':_0x5257aa[_0x443d5e(0xcb)]['createdAt'],'updatedAt':_0x5257aa[_0x443d5e(0xcb)][_0x443d5e(0x110)]})),{emailToId:_0x4faa42,idToEmail:_0x41fbb1}=_0x9fe65c,_0x588868=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x4e8687=_0x443d5e,_0x4dd0b5=await _0x32104d[_0x4e8687(0xe9)][_0x4e8687(0x111)]();return buildConnectionMaps(_0x4dd0b5);},{'verbose':_0x561725['verbose']})[_0x443d5e(0x14b)](_0x27d4a0=>_0x27d4a0[_0x443d5e(0x101)]),_0xc2efe4=_0x588868[_0x443d5e(0xc1)],_0x1a659c=_0x588868[_0x443d5e(0x132)],_0x151025=_0x588868[_0x443d5e(0xea)],_0x4e28df={'emailToIdMap':_0x4faa42,'connectionNameToIdMap':_0xc2efe4,'connectionNameToTypeMap':_0x151025,'getSchema':_0x14ca79=>_0x32104d[_0x443d5e(0xe9)][_0x443d5e(0x14a)](_0x14ca79)};let {pathToId:_0x26e8a4,idToPath:_0x84cb0b}=buildFolderMaps(_0x3371a1);const _0x4433a2=buildSegmentLookupMap(_0x67ff74,_0x84cb0b),_0x1b138d=buildSegmentNameToIdMap(_0x67ff74),_0x53ae61=buildJourneyBundleLookupMap(_0x367032,_0x84cb0b);let _0x1b44bd;if(_0x58d384){if(!_0x58d384[_0x443d5e(0xd6)](_0x443d5e(0x11d))&&!_0x58d384[_0x443d5e(0xd6)](_0x443d5e(0x140)))return console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x10d)](_0x443d5e(0xca)+_0x58d384+'\x0a')),0x1;_0x1b44bd=[_0x58d384];}else _0x1b44bd=findYamlFiles(_0x596fed);if(_0x1b44bd[_0x443d5e(0xb9)]===0x0)return console['error'](a29_0x1ee904[_0x443d5e(0x10d)](_0x443d5e(0x136)+_0x596fed+'\x0a')),console[_0x443d5e(0xd7)](a29_0x1ee904['cyan'](_0x443d5e(0xf7))),0x1;let _0x10f72e,_0x1b9f88;try{const _0x12d644=parseAndClassifyYamlFiles(_0x1b44bd,_0x596fed,{'skipSegments':_0x561725['journeysOnly']});_0x10f72e=_0x12d644[_0x443d5e(0xbd)],_0x1b9f88=_0x12d644[_0x443d5e(0xe5)];const _0xa1be24=validateParsedFiles(_0x12d644,_0x596fed);if(_0xa1be24[_0x443d5e(0xb9)]>0x0)return console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x10d)]('\x0aValidation\x20failed:')),console[_0x443d5e(0xd7)](formatValidationErrors(_0xa1be24)),console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x148)](_0x443d5e(0xf0))),0x1;}catch(_0x2ebe94){return console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x10d)]('Error\x20parsing\x20YAML:\x20'+(_0x2ebe94 instanceof Error?_0x2ebe94[_0x443d5e(0x10a)]:_0x2ebe94))),0x1;}if(_0x10f72e[_0x443d5e(0xb9)]===0x0&&_0x1b9f88['length']===0x0){const _0x3ca4f4=_0x561725[_0x443d5e(0xdf)]?_0x443d5e(0x10b):_0x443d5e(0x128);return console['error'](a29_0x1ee904['yellow'](_0x443d5e(0xdd)+_0x3ca4f4+'\x20YAML\x20files\x20found')),0x0;}const _0x5b1b7e=new Map();_0x67ff74[_0x443d5e(0xb9)]>0x0&&!_0x561725['journeysOnly']&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x67ff74,async _0x59957e=>{const _0x457735=a29_0x31eb,_0x12d53c=await _0x32104d[_0x457735(0x11f)][_0x457735(0x138)](_0x4852f3,_0x59957e['id']);_0x5b1b7e['set'](_0x59957e['id'],_0x12d53c);});},{'verbose':_0x561725['verbose']});const {segmentFiles:_0x55cb0f,foldersToCreate:_0x47efe2}=await prepareSegmentFiles(_0x10f72e,{'segmentByFolderAndName':_0x4433a2,'activationsBySegmentId':_0x5b1b7e,'folderPathToId':_0x26e8a4,'idToEmailMap':_0x41fbb1,'connectionIdToNameMap':_0x1a659c},_0x4e28df,_0x286ade,_0x30a371),_0x3385cd=_0x58d384?[]:findSegmentsToDelete(_0x67ff74,_0x10f72e[_0x443d5e(0x115)](({yamlConfig:_0xbf9f92,folderPath:_0x4b97e2})=>({'yamlConfig':_0xbf9f92,'folderPath':resolveTDFolderPath(_0x4b97e2,_0x286ade,_0x30a371)})),_0x84cb0b,_0x30a371,_0x286ade),{journeyFiles:_0x2e678c,foldersToCreate:_0x37c96b}=await withProgressSpinner('Preparing\x20journeys...',async _0x4b34a6=>prepareJourneyFiles(_0x1b9f88,{'fetchJourney':async _0x4b8cfb=>_0x32104d[_0x443d5e(0x10b)][_0x443d5e(0xc2)](_0x4b8cfb['journeyId']),'journeyBundlesByFolderAndName':_0x53ae61,'folderPathToId':_0x26e8a4,'idToEmailMap':_0x41fbb1,'connectionIdToNameMap':_0x1a659c,'existingSegments':_0x67ff74,'parentId':_0x4852f3,'deps':_0x32104d,'progress':{'update':_0x9effac=>{const _0x57bb96=_0x443d5e;_0x4b34a6[_0x57bb96(0xe8)](_0x9effac),_0x561725[_0x57bb96(0xd8)]&&console[_0x57bb96(0xd7)]('\x20\x20'+_0x9effac);}},'journeyById':_0x287e3e,'activationStepsById':_0x2f51f4},_0x286ade,_0x30a371),{'verbose':_0x561725[_0x443d5e(0xd8)]})[_0x443d5e(0x14b)](_0x4d83bc=>_0x4d83bc[_0x443d5e(0x101)]);for(const _0x2d364d of _0x37c96b){_0x47efe2[_0x443d5e(0xe3)](_0x2d364d);}const _0x355565=_0x58d384?[]:findJourneysToDelete(_0x367032,_0x1b9f88['map'](({yamlConfig:_0x62be77,folderPath:_0x3c09cc})=>({'yamlConfig':_0x62be77,'folderPath':resolveTDFolderPath(_0x3c09cc,_0x286ade,_0x30a371)})),_0x84cb0b,_0x30a371,_0x286ade),_0x1701a9=calculatePushStats(_0x55cb0f,_0x2e678c,_0x47efe2,_0x3385cd,_0x355565,!!_0x561725['delete'],!!_0x561725[_0x443d5e(0xdf)]),_0x364054=_0x1701a9[_0x443d5e(0xbd)]['new'],_0x3f7c50=_0x1701a9[_0x443d5e(0xbd)][_0x443d5e(0x121)],_0x59042a=_0x1701a9[_0x443d5e(0xbd)][_0x443d5e(0x12e)],_0x1d00ee=_0x1701a9[_0x443d5e(0xbd)][_0x443d5e(0xf5)],_0xc22e9a=_0x1701a9[_0x443d5e(0x103)][_0x443d5e(0xda)],_0xdc9185=_0x1701a9['journeys']['new'],_0x1f6254=_0x1701a9[_0x443d5e(0xe5)][_0x443d5e(0x121)],_0x27d73a=_0x1701a9[_0x443d5e(0xe5)][_0x443d5e(0x12e)],_0x51d62a=_0x1701a9['journeys'][_0x443d5e(0xf5)],_0x1a8129=_0x1701a9['activations'][_0x443d5e(0x149)],_0x51d7ff=_0x1701a9[_0x443d5e(0xc8)][_0x443d5e(0xda)],_0x320ff7=_0x1701a9[_0x443d5e(0xc8)]['toUpdate'],_0x17e44c=_0x1701a9['activations'][_0x443d5e(0xf5)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x4ee266+'\x27:');_0xc22e9a[_0x443d5e(0xb9)]>0x0&&console['error']('\x20\x20'+a29_0x1ee904[_0x443d5e(0x114)](_0x443d5e(0x135)+_0xc22e9a[_0x443d5e(0xb9)]+_0x443d5e(0x12c)));if(!_0x561725[_0x443d5e(0xdf)]){console['error'](_0x443d5e(0x116)),console[_0x443d5e(0xd7)](_0x443d5e(0xe4)+a29_0x1ee904['green']('+\x20'+_0x364054['length']+'\x20new')),console[_0x443d5e(0xd7)](_0x443d5e(0xe4)+a29_0x1ee904[_0x443d5e(0x148)]('~\x20'+_0x3f7c50[_0x443d5e(0xb9)]+_0x443d5e(0x12d)));if(_0x1d00ee[_0x443d5e(0xb9)]>0x0)console[_0x443d5e(0xd7)](_0x443d5e(0xe4)+a29_0x1ee904[_0x443d5e(0x10d)]('-\x20'+_0x1d00ee[_0x443d5e(0xb9)]+_0x443d5e(0xf8)));else _0x3385cd[_0x443d5e(0xb9)]>0x0&&!_0x561725['delete']&&console[_0x443d5e(0xd7)](_0x443d5e(0xe4)+a29_0x1ee904[_0x443d5e(0x12f)](_0x3385cd[_0x443d5e(0xb9)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x443d5e(0xd7)](_0x443d5e(0xe4)+a29_0x1ee904[_0x443d5e(0x12f)]('=\x20'+_0x59042a[_0x443d5e(0xb9)]+_0x443d5e(0xfc)));}if(_0x2e678c[_0x443d5e(0xb9)]>0x0||_0x355565['length']>0x0){console['error'](_0x443d5e(0x130)),console[_0x443d5e(0xd7)]('\x20\x20\x20\x20'+a29_0x1ee904[_0x443d5e(0x10e)]('+\x20'+_0xdc9185[_0x443d5e(0xb9)]+_0x443d5e(0x143))),console[_0x443d5e(0xd7)]('\x20\x20\x20\x20'+a29_0x1ee904[_0x443d5e(0x148)]('~\x20'+_0x1f6254[_0x443d5e(0xb9)]+_0x443d5e(0x12d)));if(_0x51d62a[_0x443d5e(0xb9)]>0x0)console[_0x443d5e(0xd7)](_0x443d5e(0xe4)+a29_0x1ee904['red']('-\x20'+_0x51d62a[_0x443d5e(0xb9)]+_0x443d5e(0xf8)));else _0x355565['length']>0x0&&!_0x561725[_0x443d5e(0xd4)]&&console[_0x443d5e(0xd7)](_0x443d5e(0xe4)+a29_0x1ee904[_0x443d5e(0x12f)](_0x355565['length']+_0x443d5e(0xce)));console[_0x443d5e(0xd7)]('\x20\x20\x20\x20'+a29_0x1ee904[_0x443d5e(0x12f)]('=\x20'+_0x27d73a[_0x443d5e(0xb9)]+_0x443d5e(0xfc)));}_0x1a8129[_0x443d5e(0xb9)]>0x0&&!_0x561725['journeysOnly']&&(console[_0x443d5e(0xd7)](''),console[_0x443d5e(0xd7)](_0x443d5e(0x129)),_0x51d7ff[_0x443d5e(0xb9)]>0x0&&console['error'](_0x443d5e(0xe4)+a29_0x1ee904[_0x443d5e(0x10e)]('+\x20'+_0x51d7ff[_0x443d5e(0xb9)]+'\x20to\x20create')),_0x320ff7[_0x443d5e(0xb9)]>0x0&&console['error']('\x20\x20\x20\x20'+a29_0x1ee904[_0x443d5e(0x148)]('~\x20'+_0x320ff7[_0x443d5e(0xb9)]+_0x443d5e(0x102))),_0x17e44c[_0x443d5e(0xb9)]>0x0&&console[_0x443d5e(0xd7)](_0x443d5e(0xe4)+a29_0x1ee904[_0x443d5e(0x10d)]('-\x20'+_0x17e44c['length']+_0x443d5e(0xf8))));console[_0x443d5e(0xd7)](_0x443d5e(0x11e)+a29_0x1ee904['cyan'](_0x596fed)+'\x0a');if(_0xc22e9a[_0x443d5e(0xb9)]>0x0){console[_0x443d5e(0xd7)](_0x443d5e(0x131));for(const _0x102359 of _0xc22e9a){console['error']('\x20\x20'+a29_0x1ee904[_0x443d5e(0x114)]('+')+'\x20'+_0x102359);}console[_0x443d5e(0xd7)]('');}if(_0x364054[_0x443d5e(0xb9)]>0x0&&!_0x561725[_0x443d5e(0xdf)])for(const _0x1a8eb1 of _0x364054){const _0x46755f=_0x1a8eb1[_0x443d5e(0x100)]?_0x1a8eb1['folderPath']+'/'+_0x1a8eb1[_0x443d5e(0x13c)]['name']:_0x1a8eb1[_0x443d5e(0x13c)][_0x443d5e(0x139)],_0x1bf140=_0x1a8eb1['yamlConfig'][_0x443d5e(0xc8)]?.['length']||0x0,_0x43e09c=_0x1bf140>0x0?a29_0x1ee904[_0x443d5e(0x12f)]('\x20['+_0x1bf140+'\x20activations]'):'';console[_0x443d5e(0xd7)]('\x0a'+a29_0x1ee904[_0x443d5e(0x10e)](_0x443d5e(0xc3))+'\x20'+_0x46755f+_0x43e09c),console[_0x443d5e(0xd7)]('─'[_0x443d5e(0xc7)](0x3c)),_0x1a8eb1[_0x443d5e(0x141)]&&console[_0x443d5e(0xd7)](_0x1a8eb1[_0x443d5e(0x141)]),console[_0x443d5e(0xd7)]('─'['repeat'](0x3c));}if(_0x1d00ee['length']>0x0&&!_0x561725['journeysOnly'])for(const _0x42ad12 of _0x1d00ee){const _0x4dee8a=_0x42ad12['segmentFolderId']?_0x84cb0b[_0x443d5e(0xc4)](_0x42ad12[_0x443d5e(0x13b)][_0x443d5e(0x126)]())||'':'',_0x36bfe0=_0x4dee8a?_0x4dee8a+'/'+_0x42ad12[_0x443d5e(0x139)]:_0x42ad12[_0x443d5e(0x139)],_0x32cd59=_0x5b1b7e[_0x443d5e(0xc4)](_0x42ad12['id'])||[],_0x172534=_0x32cd59[_0x443d5e(0xb9)]>0x0?a29_0x1ee904[_0x443d5e(0x12f)]('\x20['+_0x32cd59[_0x443d5e(0xb9)]+_0x443d5e(0xf9)):'';console['error']('\x0a'+a29_0x1ee904[_0x443d5e(0x10d)](_0x443d5e(0xf4))+'\x20'+_0x36bfe0+_0x172534),console[_0x443d5e(0xd7)]('─'[_0x443d5e(0xc7)](0x3c));const _0x4ca73d=segmentWithActivationsToYaml(_0x42ad12,_0x32cd59,undefined,_0x41fbb1,_0x1a659c),_0x150cf6=segmentToYamlString(_0x4ca73d),_0x2a5994=generateDiff(_0x150cf6,'');console[_0x443d5e(0xd7)](formatDiffWithColors(_0x2a5994)),console[_0x443d5e(0xd7)]('─'['repeat'](0x3c));}const _0x5a4489=_0x55cb0f[_0x443d5e(0xbb)](_0x53032a=>!_0x53032a[_0x443d5e(0xfb)]&&_0x53032a['diff']);if(_0x5a4489[_0x443d5e(0xb9)]>0x0&&!_0x561725[_0x443d5e(0xdf)])for(const _0x674153 of _0x5a4489){const _0x29c4b3=_0x674153[_0x443d5e(0x100)]?_0x674153[_0x443d5e(0x100)]+'/'+_0x674153[_0x443d5e(0x13c)][_0x443d5e(0x139)]:_0x674153[_0x443d5e(0x13c)][_0x443d5e(0x139)];console[_0x443d5e(0xd7)]('\x0a'+a29_0x1ee904[_0x443d5e(0x148)]('Changes\x20to:')+'\x20'+_0x29c4b3),console['error']('─'['repeat'](0x3c)),console[_0x443d5e(0xd7)](_0x674153[_0x443d5e(0x141)]),console[_0x443d5e(0xd7)]('─'['repeat'](0x3c));}if(_0xdc9185[_0x443d5e(0xb9)]>0x0)for(const _0xdc6bcf of _0xdc9185){const _0x3ae037=_0xdc6bcf[_0x443d5e(0x100)]?_0xdc6bcf[_0x443d5e(0x100)]+'/'+_0xdc6bcf[_0x443d5e(0x13c)][_0x443d5e(0x139)]:_0xdc6bcf[_0x443d5e(0x13c)][_0x443d5e(0x139)];console[_0x443d5e(0xd7)]('\x0a'+a29_0x1ee904['green'](_0x443d5e(0xbc))+'\x20'+_0x3ae037),console['error']('─'[_0x443d5e(0xc7)](0x3c)),_0xdc6bcf[_0x443d5e(0x141)]&&console['error'](_0xdc6bcf[_0x443d5e(0x141)]),console[_0x443d5e(0xd7)]('─'[_0x443d5e(0xc7)](0x3c));}const _0x402305=_0x2e678c[_0x443d5e(0xbb)](_0x39452b=>!_0x39452b[_0x443d5e(0xfb)]&&_0x39452b[_0x443d5e(0x141)]);if(_0x402305[_0x443d5e(0xb9)]>0x0)for(const _0x50b296 of _0x402305){const _0x331ef6=_0x50b296[_0x443d5e(0x100)]?_0x50b296[_0x443d5e(0x100)]+'/'+_0x50b296[_0x443d5e(0x13c)][_0x443d5e(0x139)]:_0x50b296[_0x443d5e(0x13c)][_0x443d5e(0x139)];console[_0x443d5e(0xd7)]('\x0a'+a29_0x1ee904[_0x443d5e(0x148)](_0x443d5e(0x104))+'\x20'+_0x331ef6),console[_0x443d5e(0xd7)]('─'[_0x443d5e(0xc7)](0x3c)),console[_0x443d5e(0xd7)](_0x50b296[_0x443d5e(0x141)]),console[_0x443d5e(0xd7)]('─'[_0x443d5e(0xc7)](0x3c));}if(_0x51d62a[_0x443d5e(0xb9)]>0x0)for(const _0x58a9e9 of _0x51d62a){const _0x3d3e72=_0x58a9e9[_0x443d5e(0xba)]?_0x84cb0b[_0x443d5e(0xc4)](_0x58a9e9[_0x443d5e(0xba)])||'':'',_0x3787e5=_0x3d3e72?_0x3d3e72+'/'+_0x58a9e9[_0x443d5e(0xec)]:_0x58a9e9[_0x443d5e(0xec)];console[_0x443d5e(0xd7)]('\x0a'+a29_0x1ee904[_0x443d5e(0x10d)](_0x443d5e(0x137))+'\x20'+_0x3787e5),console[_0x443d5e(0xd7)]('─'[_0x443d5e(0xc7)](0x3c)),console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x10d)](_0x443d5e(0xee))),console[_0x443d5e(0xd7)]('─'[_0x443d5e(0xc7)](0x3c));}if(_0x561725['dryRun'])return console[_0x443d5e(0xd7)](a29_0x1ee904['yellow'](_0x443d5e(0xdc))),0x0;const _0x55eac6=_0x561725[_0x443d5e(0xdf)]?![]:_0x364054[_0x443d5e(0xb9)]>0x0||_0x3f7c50[_0x443d5e(0xb9)]>0x0||_0x1d00ee[_0x443d5e(0xb9)]>0x0,_0x401f1d=_0xdc9185['length']>0x0||_0x1f6254[_0x443d5e(0xb9)]>0x0||_0x51d62a[_0x443d5e(0xb9)]>0x0,_0x2debdc=_0x561725[_0x443d5e(0xdf)]?![]:_0x1a8129['length']>0x0,_0x4948bf=_0xc22e9a['length']>0x0;if(!_0x55eac6&&!_0x401f1d&&!_0x2debdc&&!_0x4948bf){const _0x288bc9=_0x561725['journeysOnly']?_0x443d5e(0xc9):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a29_0x1ee904[_0x443d5e(0x10e)](_0x288bc9));if(_0x58d384&&_0x27d73a[_0x443d5e(0xb9)]===0x1){const _0x1800b8=_0x27d73a[0x0];if(_0x1800b8[_0x443d5e(0x13e)]?.['id']){const _0x56d802=getConsoleNextUrl(_0x561725[_0x443d5e(0x107)],'/app/ps/'+_0x4852f3+_0x443d5e(0x109)+_0x1800b8['existingJourney']['id']+_0x443d5e(0xd9));console[_0x443d5e(0xd7)]('\x20\x20'+a29_0x1ee904[_0x443d5e(0xfd)](_0x56d802));}}return 0x0;}const _0x521ea5=_0x561725['journeysOnly']?_0xdc9185['length']+_0x1f6254['length']+_0x51d62a[_0x443d5e(0xb9)]+_0xc22e9a['length']:_0x364054[_0x443d5e(0xb9)]+_0x3f7c50[_0x443d5e(0xb9)]+_0x1d00ee[_0x443d5e(0xb9)]+_0xdc9185['length']+_0x1f6254[_0x443d5e(0xb9)]+_0x51d62a[_0x443d5e(0xb9)]+_0xc22e9a[_0x443d5e(0xb9)]+_0x1a8129[_0x443d5e(0xb9)];if(!_0x561725[_0x443d5e(0x119)]&&_0x521ea5>0x0){const _0x2792e0=await confirmKey(_0x443d5e(0x10f)+_0x521ea5+_0x443d5e(0xe1));if(!_0x2792e0)return console['error']('Aborted.'),0x1;}const _0x2db905={'withProgress':async(_0x459a21,_0x3a15a5)=>{const _0x794d97=_0x443d5e,_0x1bbe70=await withSpinner(_0x459a21,_0x3a15a5,{'verbose':_0x561725[_0x794d97(0xd8)]});return{'data':_0x1bbe70['data']};},'logInfo':_0x4ae2e7=>console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x114)]('✔\x20'+_0x4ae2e7)),'logSuccess':_0x5e7253=>console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x10e)]('✔\x20'+_0x5e7253)),'logWarning':_0x2b372d=>console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x148)]('⚠\x20'+_0x2b372d)),'logDeleted':_0x17264b=>console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x10d)]('✔\x20'+_0x17264b))},_0x523491={'segment':_0x32104d[_0x443d5e(0x11f)],'journey':_0x32104d[_0x443d5e(0x10b)],'user':_0x32104d[_0x443d5e(0x125)],'connection':_0x32104d['connection']};_0xc22e9a[_0x443d5e(0xb9)]>0x0&&(_0x26e8a4=await executePushFolders(_0x523491,_0xc22e9a,_0x26e8a4,{'parentId':_0x4852f3},_0x2db905));const _0x2daf56={'rootFolderId':_0x458502,'folderPathToId':_0x26e8a4,'folderIdToPath':_0x84cb0b,'segmentNameToId':_0x1b138d,'activationsBySegmentId':_0x5b1b7e,'emailToIdMap':_0x4faa42,'idToEmailMap':_0x41fbb1,'connectionNameToIdMap':_0x588868[_0x443d5e(0xc1)],'connectionIdToNameMap':_0x588868[_0x443d5e(0x132)],'connectionNameToTypeMap':_0x151025},_0x1da5c1=await executePushSegments(_0x523491,_0x561725[_0x443d5e(0xdf)]?[]:_0x55cb0f,_0x2daf56,{'parentId':_0x4852f3},_0x2db905),_0x3a54b3=_0x1da5c1[_0x443d5e(0x144)],_0x1ba48f=_0x1da5c1['updated'],_0x1924c3=_0x1da5c1[_0x443d5e(0xc8)][_0x443d5e(0x144)],_0x4e1bd4=_0x1da5c1[_0x443d5e(0xc8)][_0x443d5e(0x13a)],_0x450530=_0x1da5c1[_0x443d5e(0xc8)][_0x443d5e(0xd2)],_0x9f9388=await executePushSegmentDeletions(_0x523491,_0x561725['journeysOnly']?[]:_0x1d00ee,_0x2db905);let _0x52a757=0x0,_0x201fed=0x0,_0x293e5f=0x0;const _0xa2b9d0=new Map(_0x1b138d);for(const [_0x170ced,_0xbea17d]of _0x1da5c1[_0x443d5e(0x117)]){_0xa2b9d0[_0x443d5e(0x105)](_0x170ced,_0xbea17d);}if(_0x2e678c[_0x443d5e(0xb9)]>0x0){const _0x327a24={..._0x2daf56,'segmentNameToId':_0xa2b9d0,'existingSegments':_0x67ff74,'activationContext':_0x4e28df},_0x561634=await executePushJourneys(_0x523491,_0x2e678c,_0x327a24,{'parentId':_0x4852f3,'rootFolderId':_0x458502,'verbose':_0x561725[_0x443d5e(0xd8)]},_0x2db905);_0x52a757=_0x561634[_0x443d5e(0x144)],_0x201fed=_0x561634[_0x443d5e(0x13a)];if(_0x58d384&&_0x561634[_0x443d5e(0x147)][_0x443d5e(0xb9)]===0x1){const _0x3ae097=_0x561634[_0x443d5e(0x147)][0x0];if(_0x3ae097[_0x443d5e(0x118)]){const _0x53b32d=getConsoleNextUrl(_0x561725[_0x443d5e(0x107)],_0x443d5e(0x124)+_0x4852f3+'/e/'+_0x3ae097['journeyId']+'/j/da/je');console[_0x443d5e(0xd7)]('\x20\x20'+a29_0x1ee904['cyan'](_0x53b32d));}}}for(const _0x5f0321 of _0x51d62a){console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x148)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x5f0321['journeyBundleName'])),_0x293e5f++;}const _0x53c243=[];if(_0x3a54b3>0x0)_0x53c243[_0x443d5e(0xe6)](_0x3a54b3+_0x443d5e(0xef));if(_0x1ba48f>0x0)_0x53c243[_0x443d5e(0xe6)](_0x1ba48f+'\x20updated');if(_0x9f9388>0x0)_0x53c243[_0x443d5e(0xe6)](_0x9f9388+_0x443d5e(0xfa));const _0x19c35b=[];if(_0x52a757>0x0)_0x19c35b[_0x443d5e(0xe6)](_0x52a757+_0x443d5e(0xef));if(_0x201fed>0x0)_0x19c35b[_0x443d5e(0xe6)](_0x201fed+_0x443d5e(0x120));if(_0x293e5f>0x0)_0x19c35b[_0x443d5e(0xe6)](_0x293e5f+'\x20deleted');const _0x5521df=[];if(_0x1924c3>0x0)_0x5521df['push'](_0x1924c3+_0x443d5e(0xef));if(_0x4e1bd4>0x0)_0x5521df[_0x443d5e(0xe6)](_0x4e1bd4+_0x443d5e(0x120));if(_0x450530>0x0)_0x5521df[_0x443d5e(0xe6)](_0x450530+_0x443d5e(0xfa));return console[_0x443d5e(0xd7)](a29_0x1ee904[_0x443d5e(0x10e)]('\x0a✔\x20Push\x20complete')),_0x53c243[_0x443d5e(0xb9)]>0x0&&!_0x561725[_0x443d5e(0xdf)]&&console[_0x443d5e(0xd7)](_0x443d5e(0xc5)+_0x53c243['join'](',\x20')),_0x19c35b[_0x443d5e(0xb9)]>0x0&&console[_0x443d5e(0xd7)]('\x20\x20Journeys:\x20'+_0x19c35b[_0x443d5e(0xe7)](',\x20')),_0x5521df[_0x443d5e(0xb9)]>0x0&&!_0x561725[_0x443d5e(0xdf)]&&console[_0x443d5e(0xd7)](_0x443d5e(0x12b)+_0x5521df[_0x443d5e(0xe7)](',\x20')),0x0;}}
1
+ const a29_0x2c3d15=a29_0x3df0;(function(_0xb07671,_0x3e1c02){const _0x2e05be=a29_0x3df0,_0x4cdb95=_0xb07671();while(!![]){try{const _0xb6ed36=parseInt(_0x2e05be(0x211))/0x1*(-parseInt(_0x2e05be(0x236))/0x2)+parseInt(_0x2e05be(0x20b))/0x3*(-parseInt(_0x2e05be(0x1be))/0x4)+parseInt(_0x2e05be(0x21d))/0x5*(parseInt(_0x2e05be(0x22b))/0x6)+parseInt(_0x2e05be(0x238))/0x7+parseInt(_0x2e05be(0x201))/0x8*(parseInt(_0x2e05be(0x1bc))/0x9)+-parseInt(_0x2e05be(0x1f2))/0xa+parseInt(_0x2e05be(0x1e3))/0xb;if(_0xb6ed36===_0x3e1c02)break;else _0x4cdb95['push'](_0x4cdb95['shift']());}catch(_0x3bda17){_0x4cdb95['push'](_0x4cdb95['shift']());}}}(a29_0x53e8,0xcb0f2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';function a29_0x3df0(_0x5cee,_0xc73432){_0x5cee=_0x5cee-0x1b6;const _0x53e880=a29_0x53e8();let _0x3df09d=_0x53e880[_0x5cee];return _0x3df09d;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x57bff8 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a29_0x53e8(){const _0x4ee03b=['nameToId','cyan','createdSegmentIds','journeys','resolveParentId','add','\x20to\x20delete','red','idToName','execute','description','getJourney','getOutputSchemaWithCache','filePath','\x20new','Changes\x20to:','\x20\x20Source:\x20','scopedFolderPath','activations','journey','folderId','message','new','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','25876818TldduZ','Push\x20','error','\x20to\x20create','name','green','\x0aPush\x20summary\x20for\x20\x27','Fetching\x20connections\x20for\x20name\x20resolution...','\x20to\x20update','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20📊\x20Segments:','Fetching\x20existing\x20folders...','targetDir','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x0aValidation\x20failed:','15451680gikBjB','Preparing\x20journeys...','\x20changed','No\x20','\x20unchanged','Folders\x20to\x20create:','\x20deleted','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/e/','/app/ps/','created','helpText','segment','\x20\x20Journeys:\x20','no_parent','104dvPXTJ','\x20\x20\x20\x20','site','Error:\x20Directory\x20not\x20found:\x20','attributes','verbose','yamlConfig','toDelete','errorCode','nameToType','75321wDXKoH','updated','get','connection','segments','type','1479585WMyRkW','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','then','Scoped\x20to\x20folder:\x20','journeyBundleName','results','Source\x20directory:\x20','Resolving\x20parent\x20segment\x20\x27','New\x20segment:','deleted','\x20\x20Segments:\x20','\x20activations]','7435GaBhRz','📁\x20','list','buildUserMaps','journeyBundleId','map','\x20updated','\x20created','user','listJourneysWithDetailsFromParentSegment','\x20\x20🗺️\x20\x20Journeys:','setPhase','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','folders','3162aGevGm','yellow','\x20folders\x20to\x20create','toUpdate','.yml','blue','parentFolder','\x20changes?','Aborted.','.yaml','segmentFolderId','2ptMGiy','folderPath','5163732HHMGWr','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','paused','listFolders','\x0a✔\x20Push\x20complete','join','existingJourney','segment\x20or\x20journey','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','segment:push','isNew','Fetching\x20existing\x20segments...','toString','dim','Delete\x20segment:','file','journeysOnly','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','filter','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Fetching\x20existing\x20journeys...','New\x20journey:','length','set','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','parent_name','changed','unchanged','data','getParent','Changes\x20to\x20journey:','\x20YAML\x20files\x20found','\x20\x20Activations:','961416fRXktT','journeyId','224nwfeIi','push','/j/da/je','repeat','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Fetching\x20parent\x20segment\x20details...','createdAt','diff','delete','parentName','Error:\x20','\x27...','all'];a29_0x53e8=function(){return _0x4ee03b;};return a29_0x53e8();}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a29_0x2c3d15(0x241);[a29_0x2c3d15(0x1d5)]=a29_0x2c3d15(0x251);async[a29_0x2c3d15(0x1d4)](_0x141a60){const _0x564bf7=a29_0x2c3d15,{options:_0x364e84,args:_0x5cc4f4,tdx:_0x3e41d1}=_0x141a60,_0xbff4b2=_0x364e84,_0x4cc232=await resolveTarget({'arg':_0x5cc4f4[0x0],'contextParent':_0x364e84['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4cc232))return _0x4cc232[_0x564bf7(0x209)]===_0x564bf7(0x200)?(console[_0x564bf7(0x1e5)](a29_0x57bff8['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x564bf7(0x1e5)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x564bf7(0x1e5)](_0x564bf7(0x1f0)),console['error'](_0x564bf7(0x24c))):(console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x1c8)+_0x4cc232[_0x564bf7(0x1e0)]+'\x0a')),_0x4cc232[_0x564bf7(0x1fd)]&&console[_0x564bf7(0x1e5)](a29_0x57bff8['cyan'](_0x4cc232[_0x564bf7(0x1fd)]))),0x1;if(_0x4cc232[_0x564bf7(0x210)]===_0x564bf7(0x252))return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x204)+_0x4cc232[_0x564bf7(0x1ef)]+'\x0a')),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1cc)](_0x564bf7(0x1f9))),0x1;const _0x1715fe=_0x4cc232[_0x564bf7(0x1c7)],_0x5319cf=_0x4cc232[_0x564bf7(0x1ef)],_0x31bb89=_0x4cc232[_0x564bf7(0x210)]===_0x564bf7(0x247)?_0x4cc232[_0x564bf7(0x1d8)]:undefined,_0x5c1d9a=getScopedDetails(_0x4cc232),_0x4c9c8d=_0x5c1d9a?.['isScoped']??![],_0x40e54b=_0x5c1d9a?.[_0x564bf7(0x1dc)]??'';if(!existsSync(_0x5319cf))return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x204)+_0x5319cf+'\x0a')),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1cc)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0xbff4b2[_0x564bf7(0x206)]&&(console[_0x564bf7(0x1e5)]('Site:\x20'+_0xbff4b2[_0x564bf7(0x203)]),console[_0x564bf7(0x1e5)]('Parent\x20segment:\x20'+_0x1715fe),console[_0x564bf7(0x1e5)](_0x564bf7(0x217)+_0x5319cf),_0x4c9c8d&&console['error'](_0x564bf7(0x214)+_0x40e54b));const _0x3bd9b4=await withSpinner(_0x564bf7(0x218)+_0x1715fe+_0x564bf7(0x1c9),()=>_0x3e41d1['segment'][_0x564bf7(0x1cf)](_0x1715fe),{'verbose':_0xbff4b2[_0x564bf7(0x206)]}),_0x486b22=_0x3bd9b4[_0x564bf7(0x1b7)],[_0x349980,_0x916f4,_0x359655,_0x2e5060,_0x321f02]=await Promise[_0x564bf7(0x1ca)]([withSpinner(_0x564bf7(0x1c3),()=>_0x3e41d1[_0x564bf7(0x1fe)][_0x564bf7(0x1b8)](_0x486b22),{'verbose':_0xbff4b2[_0x564bf7(0x206)]}),withSpinner(_0x564bf7(0x243),()=>_0x3e41d1[_0x564bf7(0x1fe)]['listSegments'](_0x486b22),{'verbose':_0xbff4b2['verbose']}),withSpinner(_0x564bf7(0x1ee),()=>_0x3e41d1['segment'][_0x564bf7(0x23b)](_0x486b22),{'verbose':_0xbff4b2['verbose']}),withSpinner(_0x564bf7(0x24d),()=>_0x3e41d1[_0x564bf7(0x1de)][_0x564bf7(0x226)](_0x486b22),{'verbose':_0xbff4b2[_0x564bf7(0x206)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x3e41d1[_0x564bf7(0x225)][_0x564bf7(0x220)](),{'verbose':_0xbff4b2[_0x564bf7(0x206)]})[_0x564bf7(0x213)](_0x33027f=>_0x33027f['data'])]),_0x4bca0b=_0x349980[_0x564bf7(0x1b7)],_0x4e3151=extractRootFolderId(_0x4bca0b),_0x5b957c=_0x916f4[_0x564bf7(0x1b7)],_0x3aad06=_0x359655[_0x564bf7(0x1b7)],{journeys:_0x432906,activationStepsById:_0x18f394}=_0x2e5060[_0x564bf7(0x1b7)],_0x16fbe7=new Map(_0x432906['map'](_0x59c444=>[_0x59c444['id'],_0x59c444])),_0x27be1b=_0x432906['map'](_0xc55420=>({'id':_0xc55420['id'],'name':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x1e7)],'journeyBundleName':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x215)]||'','journeyBundleId':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x221)]||'','versionNumber':_0xc55420['attributes']['versionNumber'],'description':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x1d5)],'state':_0xc55420[_0x564bf7(0x205)]['state'],'paused':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x23a)],'audienceId':_0xc55420[_0x564bf7(0x205)]['audienceId'],'folderId':_0xc55420['relationships']?.[_0x564bf7(0x231)]?.['data']?.['id'],'createdAt':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x1c4)],'updatedAt':_0xc55420[_0x564bf7(0x205)]['updatedAt']})),{emailToId:_0x45d6fa,idToEmail:_0x18d96c}=_0x321f02,_0x5f46eb=await withSpinner(_0x564bf7(0x1ea),async()=>{const _0x55b53e=_0x564bf7,_0x140a65=await _0x3e41d1[_0x55b53e(0x20e)][_0x55b53e(0x21f)]();return buildConnectionMaps(_0x140a65);},{'verbose':_0xbff4b2['verbose']})[_0x564bf7(0x213)](_0x1511b8=>_0x1511b8['data']),_0x465c2f=_0x5f46eb['nameToId'],_0x3f55df=_0x5f46eb['idToName'],_0x51715e=_0x5f46eb[_0x564bf7(0x20a)],_0x3313df={'emailToIdMap':_0x45d6fa,'connectionNameToIdMap':_0x465c2f,'connectionNameToTypeMap':_0x51715e,'getSchema':_0x33685a=>_0x3e41d1[_0x564bf7(0x20e)][_0x564bf7(0x1d7)](_0x33685a)};let {pathToId:_0x1b75d9,idToPath:_0x305d57}=buildFolderMaps(_0x3aad06);const _0x47e3ed=buildSegmentLookupMap(_0x5b957c,_0x305d57),_0x5b61ff=buildSegmentNameToIdMap(_0x5b957c),_0x1f30e8=buildJourneyBundleLookupMap(_0x27be1b,_0x305d57);let _0x29ad8a;if(_0x31bb89){if(!_0x31bb89[_0x564bf7(0x24b)](_0x564bf7(0x22f))&&!_0x31bb89[_0x564bf7(0x24b)](_0x564bf7(0x234)))return console['error'](a29_0x57bff8['red'](_0x564bf7(0x1c2)+_0x31bb89+'\x0a')),0x1;_0x29ad8a=[_0x31bb89];}else _0x29ad8a=findYamlFiles(_0x5319cf);if(_0x29ad8a[_0x564bf7(0x24f)]===0x0)return console[_0x564bf7(0x1e5)](a29_0x57bff8['red'](_0x564bf7(0x249)+_0x5319cf+'\x0a')),console[_0x564bf7(0x1e5)](a29_0x57bff8['cyan'](_0x564bf7(0x1ec))),0x1;let _0x15f949,_0x26f58a;try{const _0x3c1807=parseAndClassifyYamlFiles(_0x29ad8a,_0x5319cf,{'skipSegments':_0xbff4b2[_0x564bf7(0x248)]});_0x15f949=_0x3c1807[_0x564bf7(0x20f)],_0x26f58a=_0x3c1807[_0x564bf7(0x1ce)];const _0x11d696=validateParsedFiles(_0x3c1807,_0x5319cf);if(_0x11d696[_0x564bf7(0x24f)]>0x0)return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x1f1))),console[_0x564bf7(0x1e5)](formatValidationErrors(_0x11d696)),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x22c)](_0x564bf7(0x229))),0x1;}catch(_0x3bd83e){return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)]('Error\x20parsing\x20YAML:\x20'+(_0x3bd83e instanceof Error?_0x3bd83e['message']:_0x3bd83e))),0x1;}if(_0x15f949[_0x564bf7(0x24f)]===0x0&&_0x26f58a[_0x564bf7(0x24f)]===0x0){const _0x24d0ab=_0xbff4b2['journeysOnly']?_0x564bf7(0x1de):_0x564bf7(0x23f);return console[_0x564bf7(0x1e5)](a29_0x57bff8['yellow'](_0x564bf7(0x1f5)+_0x24d0ab+_0x564bf7(0x1ba))),0x0;}const _0x4aca1c=new Map();_0x5b957c[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x5b957c,async _0x4ec704=>{const _0xb77b26=a29_0x3df0,_0x17bdf7=await _0x3e41d1[_0xb77b26(0x1fe)]['listActivations'](_0x486b22,_0x4ec704['id']);_0x4aca1c[_0xb77b26(0x250)](_0x4ec704['id'],_0x17bdf7);});},{'verbose':_0xbff4b2[_0x564bf7(0x206)]});const {segmentFiles:_0xd09378,foldersToCreate:_0x25bcdb}=await prepareSegmentFiles(_0x15f949,{'segmentByFolderAndName':_0x47e3ed,'activationsBySegmentId':_0x4aca1c,'folderPathToId':_0x1b75d9,'idToEmailMap':_0x18d96c,'connectionIdToNameMap':_0x3f55df},_0x3313df,_0x4c9c8d,_0x40e54b),_0x2ead6b=_0x31bb89?[]:findSegmentsToDelete(_0x5b957c,_0x15f949['map'](({yamlConfig:_0x425623,folderPath:_0x131ad3})=>({'yamlConfig':_0x425623,'folderPath':resolveTDFolderPath(_0x131ad3,_0x4c9c8d,_0x40e54b)})),_0x305d57,_0x40e54b,_0x4c9c8d),{journeyFiles:_0x2d98f9,foldersToCreate:_0x1ed6e1}=await withProgressSpinner(_0x564bf7(0x1f3),async _0x3c6370=>prepareJourneyFiles(_0x26f58a,{'fetchJourney':async _0xdb2ba7=>_0x3e41d1[_0x564bf7(0x1de)][_0x564bf7(0x1d6)](_0xdb2ba7[_0x564bf7(0x1bd)]),'journeyBundlesByFolderAndName':_0x1f30e8,'folderPathToId':_0x1b75d9,'idToEmailMap':_0x18d96c,'connectionIdToNameMap':_0x3f55df,'existingSegments':_0x5b957c,'parentId':_0x486b22,'deps':_0x3e41d1,'progress':{'update':_0x364d96=>{const _0x1abeb9=_0x564bf7;_0x3c6370[_0x1abeb9(0x228)](_0x364d96),_0xbff4b2[_0x1abeb9(0x206)]&&console[_0x1abeb9(0x1e5)]('\x20\x20'+_0x364d96);}},'journeyById':_0x16fbe7,'activationStepsById':_0x18f394},_0x4c9c8d,_0x40e54b),{'verbose':_0xbff4b2['verbose']})[_0x564bf7(0x213)](_0x43e49d=>_0x43e49d[_0x564bf7(0x1b7)]);for(const _0x9742bc of _0x1ed6e1){_0x25bcdb[_0x564bf7(0x1d0)](_0x9742bc);}const _0x3a93b1=_0x31bb89?[]:findJourneysToDelete(_0x27be1b,_0x26f58a[_0x564bf7(0x222)](({yamlConfig:_0x5489ae,folderPath:_0x16b23c})=>({'yamlConfig':_0x5489ae,'folderPath':resolveTDFolderPath(_0x16b23c,_0x4c9c8d,_0x40e54b)})),_0x305d57,_0x40e54b,_0x4c9c8d),_0x38609e=calculatePushStats(_0xd09378,_0x2d98f9,_0x25bcdb,_0x2ead6b,_0x3a93b1,!!_0xbff4b2[_0x564bf7(0x1c6)],!!_0xbff4b2[_0x564bf7(0x248)]),_0x23f765=_0x38609e['segments'][_0x564bf7(0x1e1)],_0x46774c=_0x38609e[_0x564bf7(0x20f)][_0x564bf7(0x253)],_0x42e718=_0x38609e[_0x564bf7(0x20f)][_0x564bf7(0x1b6)],_0x15e42c=_0x38609e[_0x564bf7(0x20f)][_0x564bf7(0x208)],_0x4c0899=_0x38609e[_0x564bf7(0x22a)]['toCreate'],_0x5b17e6=_0x38609e[_0x564bf7(0x1ce)][_0x564bf7(0x1e1)],_0x3c3c7d=_0x38609e['journeys'][_0x564bf7(0x253)],_0x1badb2=_0x38609e[_0x564bf7(0x1ce)][_0x564bf7(0x1b6)],_0x1f2e89=_0x38609e[_0x564bf7(0x1ce)]['toDelete'],_0x6636b3=_0x38609e[_0x564bf7(0x1dd)][_0x564bf7(0x1ca)],_0x2db30c=_0x38609e['activations']['toCreate'],_0x277052=_0x38609e[_0x564bf7(0x1dd)][_0x564bf7(0x22e)],_0x2fcba0=_0x38609e[_0x564bf7(0x1dd)][_0x564bf7(0x208)];console[_0x564bf7(0x1e5)](_0x564bf7(0x1e9)+_0x1715fe+'\x27:');_0x4c0899[_0x564bf7(0x24f)]>0x0&&console[_0x564bf7(0x1e5)]('\x20\x20'+a29_0x57bff8[_0x564bf7(0x230)](_0x564bf7(0x21e)+_0x4c0899[_0x564bf7(0x24f)]+_0x564bf7(0x22d)));if(!_0xbff4b2[_0x564bf7(0x248)]){console['error'](_0x564bf7(0x1ed)),console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8['green']('+\x20'+_0x23f765[_0x564bf7(0x24f)]+_0x564bf7(0x1d9))),console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8[_0x564bf7(0x22c)]('~\x20'+_0x46774c['length']+_0x564bf7(0x1f4)));if(_0x15e42c[_0x564bf7(0x24f)]>0x0)console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x1d2)]('-\x20'+_0x15e42c[_0x564bf7(0x24f)]+'\x20to\x20delete'));else _0x2ead6b[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x1c6)]&&console['error'](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x245)](_0x2ead6b['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x245)]('=\x20'+_0x42e718[_0x564bf7(0x24f)]+'\x20unchanged'));}if(_0x2d98f9[_0x564bf7(0x24f)]>0x0||_0x3a93b1[_0x564bf7(0x24f)]>0x0){console[_0x564bf7(0x1e5)](_0x564bf7(0x227)),console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8['green']('+\x20'+_0x5b17e6[_0x564bf7(0x24f)]+'\x20new')),console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x22c)]('~\x20'+_0x3c3c7d[_0x564bf7(0x24f)]+'\x20changed'));if(_0x1f2e89[_0x564bf7(0x24f)]>0x0)console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8[_0x564bf7(0x1d2)]('-\x20'+_0x1f2e89[_0x564bf7(0x24f)]+'\x20to\x20delete'));else _0x3a93b1['length']>0x0&&!_0xbff4b2[_0x564bf7(0x1c6)]&&console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8['dim'](_0x3a93b1[_0x564bf7(0x24f)]+_0x564bf7(0x1e2)));console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x245)]('=\x20'+_0x1badb2[_0x564bf7(0x24f)]+_0x564bf7(0x1f6)));}_0x6636b3['length']>0x0&&!_0xbff4b2[_0x564bf7(0x248)]&&(console['error'](''),console['error'](_0x564bf7(0x1bb)),_0x2db30c['length']>0x0&&console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x1e8)]('+\x20'+_0x2db30c['length']+_0x564bf7(0x1e6))),_0x277052[_0x564bf7(0x24f)]>0x0&&console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8[_0x564bf7(0x22c)]('~\x20'+_0x277052[_0x564bf7(0x24f)]+_0x564bf7(0x1eb))),_0x2fcba0[_0x564bf7(0x24f)]>0x0&&console['error'](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x1d2)]('-\x20'+_0x2fcba0[_0x564bf7(0x24f)]+_0x564bf7(0x1d1))));console[_0x564bf7(0x1e5)](_0x564bf7(0x1db)+a29_0x57bff8['cyan'](_0x5319cf)+'\x0a');if(_0x4c0899[_0x564bf7(0x24f)]>0x0){console['error'](_0x564bf7(0x1f7));for(const _0x5c941d of _0x4c0899){console[_0x564bf7(0x1e5)]('\x20\x20'+a29_0x57bff8[_0x564bf7(0x230)]('+')+'\x20'+_0x5c941d);}console[_0x564bf7(0x1e5)]('');}if(_0x23f765[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)])for(const _0x3fe117 of _0x23f765){const _0x325345=_0x3fe117[_0x564bf7(0x237)]?_0x3fe117[_0x564bf7(0x237)]+'/'+_0x3fe117[_0x564bf7(0x207)][_0x564bf7(0x1e7)]:_0x3fe117[_0x564bf7(0x207)]['name'],_0x4f824b=_0x3fe117[_0x564bf7(0x207)][_0x564bf7(0x1dd)]?.[_0x564bf7(0x24f)]||0x0,_0x489c89=_0x4f824b>0x0?a29_0x57bff8['dim']('\x20['+_0x4f824b+'\x20activations]'):'';console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8[_0x564bf7(0x1e8)](_0x564bf7(0x219))+'\x20'+_0x325345+_0x489c89),console['error']('─'[_0x564bf7(0x1c1)](0x3c)),_0x3fe117[_0x564bf7(0x1c5)]&&console['error'](_0x3fe117[_0x564bf7(0x1c5)]),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c));}if(_0x15e42c['length']>0x0&&!_0xbff4b2[_0x564bf7(0x248)])for(const _0x3e819d of _0x15e42c){const _0x5d5d9d=_0x3e819d[_0x564bf7(0x235)]?_0x305d57[_0x564bf7(0x20d)](_0x3e819d[_0x564bf7(0x235)][_0x564bf7(0x244)]())||'':'',_0x4e6f72=_0x5d5d9d?_0x5d5d9d+'/'+_0x3e819d['name']:_0x3e819d[_0x564bf7(0x1e7)],_0x241b53=_0x4aca1c['get'](_0x3e819d['id'])||[],_0x503cdb=_0x241b53[_0x564bf7(0x24f)]>0x0?a29_0x57bff8['dim']('\x20['+_0x241b53[_0x564bf7(0x24f)]+_0x564bf7(0x21c)):'';console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8['red'](_0x564bf7(0x246))+'\x20'+_0x4e6f72+_0x503cdb),console[_0x564bf7(0x1e5)]('─'['repeat'](0x3c));const _0x402202=segmentWithActivationsToYaml(_0x3e819d,_0x241b53,undefined,_0x18d96c,_0x3f55df),_0x17c1f2=segmentToYamlString(_0x402202),_0x2d9058=generateDiff(_0x17c1f2,'');console['error'](formatDiffWithColors(_0x2d9058)),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c));}const _0x4a2bb5=_0xd09378[_0x564bf7(0x24a)](_0x319fe2=>!_0x319fe2[_0x564bf7(0x242)]&&_0x319fe2['diff']);if(_0x4a2bb5[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)])for(const _0x4d3b88 of _0x4a2bb5){const _0x178543=_0x4d3b88[_0x564bf7(0x237)]?_0x4d3b88['folderPath']+'/'+_0x4d3b88[_0x564bf7(0x207)][_0x564bf7(0x1e7)]:_0x4d3b88[_0x564bf7(0x207)][_0x564bf7(0x1e7)];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8['yellow'](_0x564bf7(0x1da))+'\x20'+_0x178543),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c)),console[_0x564bf7(0x1e5)](_0x4d3b88[_0x564bf7(0x1c5)]),console[_0x564bf7(0x1e5)]('─'['repeat'](0x3c));}if(_0x5b17e6[_0x564bf7(0x24f)]>0x0)for(const _0x1dd694 of _0x5b17e6){const _0x3c51cb=_0x1dd694[_0x564bf7(0x237)]?_0x1dd694[_0x564bf7(0x237)]+'/'+_0x1dd694[_0x564bf7(0x207)][_0x564bf7(0x1e7)]:_0x1dd694['yamlConfig'][_0x564bf7(0x1e7)];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8['green'](_0x564bf7(0x24e))+'\x20'+_0x3c51cb),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c)),_0x1dd694[_0x564bf7(0x1c5)]&&console[_0x564bf7(0x1e5)](_0x1dd694[_0x564bf7(0x1c5)]),console['error']('─'[_0x564bf7(0x1c1)](0x3c));}const _0x5b32a1=_0x2d98f9[_0x564bf7(0x24a)](_0x4570f2=>!_0x4570f2[_0x564bf7(0x242)]&&_0x4570f2[_0x564bf7(0x1c5)]);if(_0x5b32a1[_0x564bf7(0x24f)]>0x0)for(const _0x4e4ecd of _0x5b32a1){const _0xe6b659=_0x4e4ecd[_0x564bf7(0x237)]?_0x4e4ecd[_0x564bf7(0x237)]+'/'+_0x4e4ecd['yamlConfig'][_0x564bf7(0x1e7)]:_0x4e4ecd[_0x564bf7(0x207)]['name'];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8[_0x564bf7(0x22c)](_0x564bf7(0x1b9))+'\x20'+_0xe6b659),console[_0x564bf7(0x1e5)]('─'['repeat'](0x3c)),console[_0x564bf7(0x1e5)](_0x4e4ecd[_0x564bf7(0x1c5)]),console['error']('─'[_0x564bf7(0x1c1)](0x3c));}if(_0x1f2e89[_0x564bf7(0x24f)]>0x0)for(const _0x51ee0d of _0x1f2e89){const _0x426688=_0x51ee0d[_0x564bf7(0x1df)]?_0x305d57[_0x564bf7(0x20d)](_0x51ee0d[_0x564bf7(0x1df)])||'':'',_0x5ee445=_0x426688?_0x426688+'/'+_0x51ee0d[_0x564bf7(0x215)]:_0x51ee0d[_0x564bf7(0x215)];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8[_0x564bf7(0x1d2)]('Delete\x20journey:')+'\x20'+_0x5ee445),console['error']('─'[_0x564bf7(0x1c1)](0x3c)),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)]('(Journey\x20will\x20be\x20deleted)')),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c));}if(_0xbff4b2['dryRun'])return console['error'](a29_0x57bff8[_0x564bf7(0x22c)](_0x564bf7(0x240))),0x0;const _0x1e8353=_0xbff4b2[_0x564bf7(0x248)]?![]:_0x23f765[_0x564bf7(0x24f)]>0x0||_0x46774c[_0x564bf7(0x24f)]>0x0||_0x15e42c[_0x564bf7(0x24f)]>0x0,_0x2faaa6=_0x5b17e6[_0x564bf7(0x24f)]>0x0||_0x3c3c7d['length']>0x0||_0x1f2e89[_0x564bf7(0x24f)]>0x0,_0x3c1cf0=_0xbff4b2['journeysOnly']?![]:_0x6636b3['length']>0x0,_0x1d1429=_0x4c0899['length']>0x0;if(!_0x1e8353&&!_0x2faaa6&&!_0x3c1cf0&&!_0x1d1429){const _0x2d4e49=_0xbff4b2[_0x564bf7(0x248)]?_0x564bf7(0x239):_0x564bf7(0x212);console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1e8)](_0x2d4e49));if(_0x31bb89&&_0x1badb2[_0x564bf7(0x24f)]===0x1){const _0x3788a3=_0x1badb2[0x0];if(_0x3788a3[_0x564bf7(0x23e)]?.['id']){const _0x4ca696=getConsoleNextUrl(_0xbff4b2[_0x564bf7(0x203)],_0x564bf7(0x1fb)+_0x486b22+_0x564bf7(0x1fa)+_0x3788a3[_0x564bf7(0x23e)]['id']+_0x564bf7(0x1c0));console[_0x564bf7(0x1e5)]('\x20\x20'+a29_0x57bff8[_0x564bf7(0x1cc)](_0x4ca696));}}return 0x0;}const _0x4dae83=_0xbff4b2[_0x564bf7(0x248)]?_0x5b17e6[_0x564bf7(0x24f)]+_0x3c3c7d['length']+_0x1f2e89[_0x564bf7(0x24f)]+_0x4c0899[_0x564bf7(0x24f)]:_0x23f765[_0x564bf7(0x24f)]+_0x46774c[_0x564bf7(0x24f)]+_0x15e42c[_0x564bf7(0x24f)]+_0x5b17e6[_0x564bf7(0x24f)]+_0x3c3c7d[_0x564bf7(0x24f)]+_0x1f2e89[_0x564bf7(0x24f)]+_0x4c0899[_0x564bf7(0x24f)]+_0x6636b3[_0x564bf7(0x24f)];if(!_0xbff4b2['yes']&&_0x4dae83>0x0){const _0x5b93ff=await confirmKey(_0x564bf7(0x1e4)+_0x4dae83+_0x564bf7(0x232));if(!_0x5b93ff)return console[_0x564bf7(0x1e5)](_0x564bf7(0x233)),0x1;}const _0x1c0cd8={'withProgress':async(_0x3229ea,_0x22c69b)=>{const _0x317ab4=_0x564bf7,_0x500cc5=await withSpinner(_0x3229ea,_0x22c69b,{'verbose':_0xbff4b2[_0x317ab4(0x206)]});return{'data':_0x500cc5[_0x317ab4(0x1b7)]};},'logInfo':_0x4a6cd4=>console['error'](a29_0x57bff8[_0x564bf7(0x230)]('✔\x20'+_0x4a6cd4)),'logSuccess':_0x32986b=>console[_0x564bf7(0x1e5)](a29_0x57bff8['green']('✔\x20'+_0x32986b)),'logWarning':_0x4425a4=>console[_0x564bf7(0x1e5)](a29_0x57bff8['yellow']('⚠\x20'+_0x4425a4)),'logDeleted':_0x327d9b=>console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)]('✔\x20'+_0x327d9b))},_0x26e833={'segment':_0x3e41d1[_0x564bf7(0x1fe)],'journey':_0x3e41d1['journey'],'user':_0x3e41d1[_0x564bf7(0x225)],'connection':_0x3e41d1[_0x564bf7(0x20e)]};_0x4c0899[_0x564bf7(0x24f)]>0x0&&(_0x1b75d9=await executePushFolders(_0x26e833,_0x4c0899,_0x1b75d9,{'parentId':_0x486b22},_0x1c0cd8));const _0x17336e={'rootFolderId':_0x4e3151,'folderPathToId':_0x1b75d9,'folderIdToPath':_0x305d57,'segmentNameToId':_0x5b61ff,'activationsBySegmentId':_0x4aca1c,'emailToIdMap':_0x45d6fa,'idToEmailMap':_0x18d96c,'connectionNameToIdMap':_0x5f46eb[_0x564bf7(0x1cb)],'connectionIdToNameMap':_0x5f46eb[_0x564bf7(0x1d3)],'connectionNameToTypeMap':_0x51715e},_0x57b598=await executePushSegments(_0x26e833,_0xbff4b2[_0x564bf7(0x248)]?[]:_0xd09378,_0x17336e,{'parentId':_0x486b22},_0x1c0cd8),_0x3ad85e=_0x57b598[_0x564bf7(0x1fc)],_0x53c002=_0x57b598[_0x564bf7(0x20c)],_0x40bf85=_0x57b598[_0x564bf7(0x1dd)][_0x564bf7(0x1fc)],_0x108434=_0x57b598[_0x564bf7(0x1dd)][_0x564bf7(0x20c)],_0x38dcec=_0x57b598[_0x564bf7(0x1dd)][_0x564bf7(0x21a)],_0x3981a4=await executePushSegmentDeletions(_0x26e833,_0xbff4b2[_0x564bf7(0x248)]?[]:_0x15e42c,_0x1c0cd8);let _0x21b865=0x0,_0x3d6f62=0x0,_0x509c88=0x0;const _0xc9eb6a=new Map(_0x5b61ff);for(const [_0x1b2e09,_0x3c92a4]of _0x57b598[_0x564bf7(0x1cd)]){_0xc9eb6a[_0x564bf7(0x250)](_0x1b2e09,_0x3c92a4);}if(_0x2d98f9['length']>0x0){const _0x529349={..._0x17336e,'segmentNameToId':_0xc9eb6a,'existingSegments':_0x5b957c,'activationContext':_0x3313df},_0xb12e38=await executePushJourneys(_0x26e833,_0x2d98f9,_0x529349,{'parentId':_0x486b22,'rootFolderId':_0x4e3151,'verbose':_0xbff4b2['verbose']},_0x1c0cd8);_0x21b865=_0xb12e38['created'],_0x3d6f62=_0xb12e38[_0x564bf7(0x20c)];if(_0x31bb89&&_0xb12e38[_0x564bf7(0x216)][_0x564bf7(0x24f)]===0x1){const _0x167f95=_0xb12e38['results'][0x0];if(_0x167f95[_0x564bf7(0x1bd)]){const _0x451610=getConsoleNextUrl(_0xbff4b2[_0x564bf7(0x203)],_0x564bf7(0x1fb)+_0x486b22+_0x564bf7(0x1fa)+_0x167f95['journeyId']+'/j/da/je');console['error']('\x20\x20'+a29_0x57bff8[_0x564bf7(0x1cc)](_0x451610));}}}for(const _0x2b8d6f of _0x1f2e89){console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x22c)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x2b8d6f[_0x564bf7(0x215)])),_0x509c88++;}const _0x549aa0=[];if(_0x3ad85e>0x0)_0x549aa0[_0x564bf7(0x1bf)](_0x3ad85e+_0x564bf7(0x224));if(_0x53c002>0x0)_0x549aa0[_0x564bf7(0x1bf)](_0x53c002+'\x20updated');if(_0x3981a4>0x0)_0x549aa0[_0x564bf7(0x1bf)](_0x3981a4+'\x20deleted');const _0x3111b0=[];if(_0x21b865>0x0)_0x3111b0[_0x564bf7(0x1bf)](_0x21b865+_0x564bf7(0x224));if(_0x3d6f62>0x0)_0x3111b0['push'](_0x3d6f62+_0x564bf7(0x223));if(_0x509c88>0x0)_0x3111b0[_0x564bf7(0x1bf)](_0x509c88+'\x20deleted');const _0x437b4a=[];if(_0x40bf85>0x0)_0x437b4a['push'](_0x40bf85+_0x564bf7(0x224));if(_0x108434>0x0)_0x437b4a[_0x564bf7(0x1bf)](_0x108434+_0x564bf7(0x223));if(_0x38dcec>0x0)_0x437b4a[_0x564bf7(0x1bf)](_0x38dcec+_0x564bf7(0x1f8));return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1e8)](_0x564bf7(0x23c))),_0x549aa0[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)]&&console[_0x564bf7(0x1e5)](_0x564bf7(0x21b)+_0x549aa0[_0x564bf7(0x23d)](',\x20')),_0x3111b0[_0x564bf7(0x24f)]>0x0&&console[_0x564bf7(0x1e5)](_0x564bf7(0x1ff)+_0x3111b0[_0x564bf7(0x23d)](',\x20')),_0x437b4a['length']>0x0&&!_0xbff4b2['journeysOnly']&&console[_0x564bf7(0x1e5)]('\x20\x20Activations:\x20'+_0x437b4a[_0x564bf7(0x23d)](',\x20')),0x0;}}
@@ -1 +1 @@
1
- const a30_0x1f7e9f=a30_0x31c0;(function(_0x4a64d5,_0x177812){const _0x47206e=a30_0x31c0,_0x2e05c4=_0x4a64d5();while(!![]){try{const _0x2fe897=-parseInt(_0x47206e(0x96))/0x1+parseInt(_0x47206e(0x8f))/0x2*(-parseInt(_0x47206e(0x95))/0x3)+parseInt(_0x47206e(0x8d))/0x4+-parseInt(_0x47206e(0x74))/0x5*(parseInt(_0x47206e(0x85))/0x6)+-parseInt(_0x47206e(0x7c))/0x7+parseInt(_0x47206e(0x70))/0x8*(parseInt(_0x47206e(0x9d))/0x9)+parseInt(_0x47206e(0x8a))/0xa;if(_0x2fe897===_0x177812)break;else _0x2e05c4['push'](_0x2e05c4['shift']());}catch(_0x24c28e){_0x2e05c4['push'](_0x2e05c4['shift']());}}}(a30_0x17db,0xebf5b));function a30_0x17db(){const _0x1affdd=['type','description','11931185YJqKRc','updateSegmentById','folder','INTERNAL','Update\x20existing\x20child\x20segment','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','segment','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','6NZThrb','verbose','parentId','\x20\x20\x20Path:\x20','resolvePathToResource','19285910pPrTiO','segment:update','data','6325972hwMGbh','kind','52tyIHyk','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','includes','ruleFile','Segment\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','7962fWVPpR','1141079FAWbjF','Error:\x20Cannot\x20update\x20','\x27...','length','✔\x20Updated\x20segment\x20\x27','segmentId','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','81kIwHsQ','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','resolveFolderId','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Updating\x20segment\x20\x27','1670392VJxYSz','segmentName','segmentPath','Parent\x20ID:\x20','7541230znQHJX','yellow','name','Resolved\x20type:\x20','error','Resolving\x20path\x20\x27'];a30_0x17db=function(){return _0x1affdd;};return a30_0x17db();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a30_0x31c0(_0x32a528,_0x186f5b){_0x32a528=_0x32a528-0x6c;const _0x17dbc1=a30_0x17db();let _0x31c053=_0x17dbc1[_0x32a528];return _0x31c053;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x560042 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x1f7e9f(0x76)]=a30_0x1f7e9f(0x8b);[a30_0x1f7e9f(0x7b)]=a30_0x1f7e9f(0x80);async['execute'](_0x1a072e){const _0x517122=a30_0x1f7e9f;console['error'](a30_0x560042['yellow'](_0x517122(0x9c))),console[_0x517122(0x78)](a30_0x560042[_0x517122(0x75)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0xfb4f98,args:_0x49dfab,tdx:_0x4fb311}=_0x1a072e,_0x53d6d9=_0xfb4f98;if(_0x49dfab[_0x517122(0x99)]===0x0)return console[_0x517122(0x78)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x517122(0x78)](_0x517122(0x6c)),console[_0x517122(0x78)]('Examples:'),console[_0x517122(0x78)](_0x517122(0x82)),console[_0x517122(0x78)](_0x517122(0x90)),0x1;const _0x4fb46e=_0x49dfab[0x0],_0x2d1935=_0xfb4f98[_0x517122(0x72)];let _0x4feff3=_0x4fb46e;_0x2d1935&&!_0x4fb46e[_0x517122(0x91)]('/')&&(_0x4feff3=_0x2d1935+'/'+_0x4fb46e,_0x53d6d9[_0x517122(0x86)]&&console[_0x517122(0x78)](_0x517122(0x94)+_0x4feff3));const _0xba7dd7=await withSpinner(_0x517122(0x79)+_0x4feff3+_0x517122(0x98),()=>_0x4fb311['segment'][_0x517122(0x89)](_0x4feff3),{'verbose':_0x53d6d9[_0x517122(0x86)]}),_0x58d81b=_0xba7dd7[_0x517122(0x8c)];_0x53d6d9[_0x517122(0x86)]&&console[_0x517122(0x78)](_0x517122(0x77)+_0x58d81b[_0x517122(0x7a)]);if(_0x58d81b[_0x517122(0x7a)]!==_0x517122(0x83))return console[_0x517122(0x78)](_0x517122(0x97)+_0x58d81b[_0x517122(0x7a)]+_0x517122(0x84)),console[_0x517122(0x78)](_0x517122(0x6e)),0x1;if(!_0x58d81b[_0x517122(0x9b)])throw new SDKError(ErrorCode[_0x517122(0x7f)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x51cfe1=_0x58d81b[_0x517122(0x87)],_0x1c92a4=_0x58d81b[_0x517122(0x9b)];_0x53d6d9[_0x517122(0x86)]&&(console[_0x517122(0x78)](_0x517122(0x73)+_0x51cfe1),console[_0x517122(0x78)](_0x517122(0x93)+_0x1c92a4));let _0x279377;if(_0x53d6d9[_0x517122(0x7e)]){const _0x509b7b=_0x53d6d9[_0x517122(0x7e)],_0x2b796b=await withSpinner('Resolving\x20folder\x20\x27'+_0x509b7b+'\x27...',()=>_0x4fb311['segment'][_0x517122(0x6d)](_0x51cfe1,_0x509b7b),{'verbose':_0x53d6d9[_0x517122(0x86)]});_0x279377=parseInt(_0x2b796b[_0x517122(0x8c)],0xa),_0x53d6d9[_0x517122(0x86)]&&console[_0x517122(0x78)](_0x517122(0x81)+_0x279377);}const _0x3bdda8=await loadJSONFromOptions(_0x53d6d9['rule'],_0x53d6d9[_0x517122(0x92)]),_0x50240b={'name':_0x53d6d9[_0x517122(0x76)],'description':_0x53d6d9[_0x517122(0x7b)],'rule':_0x3bdda8,'kind':_0x53d6d9['kind']!==undefined?parseInt(_0x53d6d9[_0x517122(0x8e)],0xa):undefined,'segmentFolderId':_0x279377},_0x16e5db=await withSpinner(_0x517122(0x6f)+_0x58d81b[_0x517122(0x71)]+_0x517122(0x98),()=>_0x4fb311[_0x517122(0x83)][_0x517122(0x7d)](_0x51cfe1,_0x1c92a4,_0x50240b),{'verbose':_0x53d6d9[_0x517122(0x86)]}),_0x396400=_0x16e5db['data'];return console[_0x517122(0x78)](_0x517122(0x9a)+_0x396400['name']+'\x27'),_0x4feff3!==_0x4fb46e&&console[_0x517122(0x78)](_0x517122(0x88)+_0x4feff3),await handleSDKOutput([_0x396400],_0x53d6d9),0x0;}}
1
+ const a30_0x2d7abf=a30_0x2a02;function a30_0x2a02(_0x4e559b,_0xd8ae49){_0x4e559b=_0x4e559b-0x1d9;const _0x52f8e2=a30_0x52f8();let _0x2a029e=_0x52f8e2[_0x4e559b];return _0x2a029e;}(function(_0x12ea39,_0x588f75){const _0x100dcd=a30_0x2a02,_0x4ae9a5=_0x12ea39();while(!![]){try{const _0x4e9495=parseInt(_0x100dcd(0x1f1))/0x1*(parseInt(_0x100dcd(0x205))/0x2)+-parseInt(_0x100dcd(0x1e5))/0x3+parseInt(_0x100dcd(0x1dc))/0x4*(-parseInt(_0x100dcd(0x1df))/0x5)+-parseInt(_0x100dcd(0x207))/0x6*(-parseInt(_0x100dcd(0x1db))/0x7)+parseInt(_0x100dcd(0x1de))/0x8+parseInt(_0x100dcd(0x20e))/0x9*(parseInt(_0x100dcd(0x1f3))/0xa)+parseInt(_0x100dcd(0x1ff))/0xb*(-parseInt(_0x100dcd(0x1f0))/0xc);if(_0x4e9495===_0x588f75)break;else _0x4ae9a5['push'](_0x4ae9a5['shift']());}catch(_0xcd5a22){_0x4ae9a5['push'](_0x4ae9a5['shift']());}}}(a30_0x52f8,0x75b3a));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a30_0x52f8(){const _0x3235f3=['resolvePathToResource','1844194yiBGOF','Segment\x20ID\x20missing\x20from\x20resolved\x20path','yellow','Resolved\x20type:\x20','updateSegmentById','kind','2pQGzkI','length','108MSdNYb','segmentName','segment:update','description','INTERNAL','\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','28818WMICVN','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','error','239351rYhoMU','4316FQAGaJ','name','730424vxOuPa','2195rBySDP','Examples:','resolveFolderId','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','type','Resolving\x20folder\x20\x27','787581dNOqmV','Parent\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','ruleFile','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','✔\x20Updated\x20segment\x20\x27','segmentId','Error:\x20Cannot\x20update\x20','rule','includes','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','24SSzCcf','843643qOoVrq','Resolved\x20folder\x20ID:\x20','10CHNCef','segmentPath','folder','execute','Updating\x20segment\x20\x27','verbose','data','\x27...','Resolving\x20path\x20\x27','segment','Segment\x20ID:\x20'];a30_0x52f8=function(){return _0x3235f3;};return a30_0x52f8();}import a30_0x32f2ba from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x2d7abf(0x1dd)]=a30_0x2d7abf(0x209);['description']='Update\x20existing\x20child\x20segment';async[a30_0x2d7abf(0x1f6)](_0x2ed53d){const _0x50c6d5=a30_0x2d7abf;console[_0x50c6d5(0x1da)](a30_0x32f2ba[_0x50c6d5(0x201)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x50c6d5(0x1da)](a30_0x32f2ba['yellow'](_0x50c6d5(0x1e7)));const {options:_0x3643c8,args:_0x147d5f,tdx:_0xe228d0}=_0x2ed53d,_0x4869ba=_0x3643c8;if(_0x147d5f[_0x50c6d5(0x206)]===0x0)return console[_0x50c6d5(0x1da)](_0x50c6d5(0x1ef)),console[_0x50c6d5(0x1da)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x50c6d5(0x1da)](_0x50c6d5(0x1e0)),console[_0x50c6d5(0x1da)](_0x50c6d5(0x20d)),console[_0x50c6d5(0x1da)](_0x50c6d5(0x1e2)),0x1;const _0xb887b9=_0x147d5f[0x0],_0x3140fa=_0x3643c8[_0x50c6d5(0x1f4)];let _0x8159cf=_0xb887b9;_0x3140fa&&!_0xb887b9[_0x50c6d5(0x1ee)]('/')&&(_0x8159cf=_0x3140fa+'/'+_0xb887b9,_0x4869ba[_0x50c6d5(0x1f8)]&&console[_0x50c6d5(0x1da)]('Resolved\x20relative\x20path\x20to:\x20'+_0x8159cf));const _0x1f02ec=await withSpinner(_0x50c6d5(0x1fb)+_0x8159cf+_0x50c6d5(0x1fa),()=>_0xe228d0['segment'][_0x50c6d5(0x1fe)](_0x8159cf),{'verbose':_0x4869ba[_0x50c6d5(0x1f8)]}),_0x4abf09=_0x1f02ec[_0x50c6d5(0x1f9)];_0x4869ba[_0x50c6d5(0x1f8)]&&console[_0x50c6d5(0x1da)](_0x50c6d5(0x202)+_0x4abf09[_0x50c6d5(0x1e3)]);if(_0x4abf09['type']!=='segment')return console['error'](_0x50c6d5(0x1ec)+_0x4abf09[_0x50c6d5(0x1e3)]+_0x50c6d5(0x1e9)),console[_0x50c6d5(0x1da)](_0x50c6d5(0x1d9)),0x1;if(!_0x4abf09[_0x50c6d5(0x1eb)])throw new SDKError(ErrorCode[_0x50c6d5(0x20b)],_0x50c6d5(0x200));const _0x7abb57=_0x4abf09['parentId'],_0xd79b27=_0x4abf09['segmentId'];_0x4869ba['verbose']&&(console[_0x50c6d5(0x1da)](_0x50c6d5(0x1e6)+_0x7abb57),console[_0x50c6d5(0x1da)](_0x50c6d5(0x1fd)+_0xd79b27));let _0x3d0b13;if(_0x4869ba[_0x50c6d5(0x1f5)]){const _0x33a170=_0x4869ba[_0x50c6d5(0x1f5)],_0x174f79=await withSpinner(_0x50c6d5(0x1e4)+_0x33a170+_0x50c6d5(0x1fa),()=>_0xe228d0['segment'][_0x50c6d5(0x1e1)](_0x7abb57,_0x33a170),{'verbose':_0x4869ba[_0x50c6d5(0x1f8)]});_0x3d0b13=parseInt(_0x174f79['data'],0xa),_0x4869ba[_0x50c6d5(0x1f8)]&&console[_0x50c6d5(0x1da)](_0x50c6d5(0x1f2)+_0x3d0b13);}const _0x44b881=await loadJSONFromOptions(_0x4869ba[_0x50c6d5(0x1ed)],_0x4869ba[_0x50c6d5(0x1e8)]),_0x13b43d={'name':_0x4869ba['name'],'description':_0x4869ba[_0x50c6d5(0x20a)],'rule':_0x44b881,'kind':_0x4869ba[_0x50c6d5(0x204)]!==undefined?parseInt(_0x4869ba[_0x50c6d5(0x204)],0xa):undefined,'segmentFolderId':_0x3d0b13},_0x3d5021=await withSpinner(_0x50c6d5(0x1f7)+_0x4abf09[_0x50c6d5(0x208)]+_0x50c6d5(0x1fa),()=>_0xe228d0[_0x50c6d5(0x1fc)][_0x50c6d5(0x203)](_0x7abb57,_0xd79b27,_0x13b43d),{'verbose':_0x4869ba[_0x50c6d5(0x1f8)]}),_0x350375=_0x3d5021[_0x50c6d5(0x1f9)];return console[_0x50c6d5(0x1da)](_0x50c6d5(0x1ea)+_0x350375[_0x50c6d5(0x1dd)]+'\x27'),_0x8159cf!==_0xb887b9&&console[_0x50c6d5(0x1da)](_0x50c6d5(0x20c)+_0x8159cf),await handleSDKOutput([_0x350375],_0x4869ba),0x0;}}