@treasuredata/tdx 0.10.1 → 0.12.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.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.d.ts +111 -7
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.d.ts +1 -1
- package/dist/core/command-output.d.ts.map +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.d.ts +1 -0
- package/dist/core/global-context.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.d.ts +1 -0
- package/dist/core/session.d.ts.map +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/session.js.map +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +8 -0
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.d.ts +32 -4
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +1 -1
- package/dist/sdk/connection-validator.d.ts +10 -6
- package/dist/sdk/connection-validator.d.ts.map +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection-validator.js.map +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +4 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -0
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.d.ts +80 -0
- package/dist/sdk/workflow/clone-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/clone-workflow.js +1 -0
- package/dist/sdk/workflow/clone-workflow.js.map +1 -0
- package/dist/sdk/workflow/index.d.ts +168 -4
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.d.ts +77 -0
- package/dist/sdk/workflow/pull-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/pull-workflow.js +1 -0
- package/dist/sdk/workflow/pull-workflow.js.map +1 -0
- package/dist/sdk/workflow/push-workflow.d.ts +66 -0
- package/dist/sdk/workflow/push-workflow.d.ts.map +1 -0
- package/dist/sdk/workflow/push-workflow.js +1 -0
- package/dist/sdk/workflow/push-workflow.js.map +1 -0
- package/dist/sdk/workflow/tdx-config.d.ts +110 -0
- package/dist/sdk/workflow/tdx-config.d.ts.map +1 -0
- package/dist/sdk/workflow/tdx-config.js +1 -0
- package/dist/sdk/workflow/tdx-config.js.map +1 -0
- package/dist/sdk/workflow/workflow-utils.d.ts +10 -7
- package/dist/sdk/workflow/workflow-utils.d.ts.map +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js.map +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a24_0x5c32f4=a24_0x5c19;(function(_0x233d87,_0x192251){const _0x88d07c=a24_0x5c19,_0x2ea918=_0x233d87();while(!![]){try{const _0xf53e93=-parseInt(_0x88d07c(0x203))/0x1+parseInt(_0x88d07c(0x1ee))/0x2*(parseInt(_0x88d07c(0x1fe))/0x3)+parseInt(_0x88d07c(0x1df))/0x4+parseInt(_0x88d07c(0x1f5))/0x5+-parseInt(_0x88d07c(0x1f7))/0x6*(-parseInt(_0x88d07c(0x207))/0x7)+parseInt(_0x88d07c(0x1f4))/0x8*(-parseInt(_0x88d07c(0x209))/0x9)+parseInt(_0x88d07c(0x1e6))/0xa;if(_0xf53e93===_0x192251)break;else _0x2ea918['push'](_0x2ea918['shift']());}catch(_0x1d96d5){_0x2ea918['push'](_0x2ea918['shift']());}}}(a24_0x4079,0x94f2c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a24_0x4079(){const _0xdc0148=['42DcHWpA','state','setPhase','stats','error','1100610xNCjTz','No\x20SQL\x20provided','\x20[Job\x20ID:\x20','completedSplits','2543233YvQsvj','Site:\x20','54DzELDt','in\x20','Statement\x20','options','387128ktnpkc','message','Executing\x20statement\x20','execute','\x20rows\x20','\x20-\x20','totalSplits','12135330mAqUks','jobId','args','query','verbose','Cannot\x20specify\x20both\x20SQL\x20argument\x20and\x20--file\x20option','Executing\x20query...','site','59018unvzqm','Executing\x20query\x20[','output','Schema:\x20','originalMessage','processedRows','590584hxPAHD','334400MwEAcn','\x0aAll\x20results\x20saved\x20to\x20','6XzYKsK','file','join','setExtra','data','length','database'];a24_0x4079=function(){return _0xdc0148;};return a24_0x4079();}import{handleQueryOutput,formatQueryOutput,resolveOutputOptions}from'../core/command-output.js';function a24_0x5c19(_0x47bb22,_0x251acd){_0x47bb22=_0x47bb22-0x1df;const _0x4079c0=a24_0x4079();let _0x5c199c=_0x4079c0[_0x47bb22];return _0x5c199c;}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{['name']=a24_0x5c32f4(0x1e9);['description']='Run\x20Trino\x20queries\x20(streaming)';async[a24_0x5c32f4(0x1e2)](_0x458d2b){const _0x33c9b1=a24_0x5c32f4,{options:_0x4fb90d,args:_0x5b8508,tdx:_0x2698e0}=_0x458d2b,_0x5c5069=_0x5b8508[0x0],_0x1fb715=_0x4fb90d[_0x33c9b1(0x1f8)];let _0x1c466b;try{if(_0x1fb715)_0x1c466b=readSqlStatementsFromFile(_0x1fb715);else{if(_0x5c5069==='-')_0x1c466b=await readSqlStatementsFromStdin();else{if(_0x5c5069&&isSqlFilePath(_0x5c5069))_0x1c466b=readSqlStatementsFromFile(_0x5c5069);else{if(_0x5c5069)_0x1c466b=splitSqlStatements(_0x5c5069);else throw new Error(_0x33c9b1(0x204));}}}}catch(_0x28ccef){return console['error']('Error:\x20'+_0x28ccef[_0x33c9b1(0x1e0)]),0x1;}const _0x2a760a=_0x4fb90d[_0x33c9b1(0x1fd)]||'information_schema',_0x4d4f44=_0x4fb90d['catalog'];try{const _0x16db5f=[],_0x3f39f5=!!_0x4fb90d[_0x33c9b1(0x1f0)];for(let _0x7051ef=0x0;_0x7051ef<_0x1c466b[_0x33c9b1(0x1fc)];_0x7051ef++){const _0x40caa5=_0x1c466b[_0x7051ef],_0x11accb=_0x7051ef+0x1,_0x51a3c4=_0x1c466b[_0x33c9b1(0x1fc)],_0x4fe34b=_0x51a3c4>0x1;_0x4fb90d[_0x33c9b1(0x1ea)]&&(console[_0x33c9b1(0x202)]('\x0a'+(_0x4fe34b?_0x33c9b1(0x20b)+_0x11accb+'/'+_0x51a3c4+':':'')),console[_0x33c9b1(0x202)](_0x33c9b1(0x208)+_0x4fb90d[_0x33c9b1(0x1ed)]),console[_0x33c9b1(0x202)]('Catalog:\x20'+(_0x4d4f44||'td')),console[_0x33c9b1(0x202)](_0x33c9b1(0x1f1)+_0x2a760a),console[_0x33c9b1(0x202)]('SQL:\x20'+_0x40caa5));const _0x2e6d64=_0x4fe34b?_0x33c9b1(0x1e1)+_0x11accb+'/'+_0x51a3c4+'...':_0x33c9b1(0x1ec);try{const _0x479b98=await withProgressSpinner(_0x2e6d64,async _0x969570=>{const _0x2bc1e6=_0x33c9b1,_0x42e04f=await _0x2698e0['query'][_0x2bc1e6(0x1e2)](_0x40caa5,{'catalog':_0x4d4f44,'schema':_0x2a760a,'onJobId':_0x221a12=>{_0x969570['setJobId'](_0x221a12);},'onProgress':_0x36f9db=>{const _0x30e8db=_0x2bc1e6;_0x969570[_0x30e8db(0x200)](_0x30e8db(0x1ef)+_0x36f9db[_0x30e8db(0x1ff)]+']'),_0x969570[_0x30e8db(0x1fa)](formatRows(_0x36f9db[_0x30e8db(0x1f3)])+_0x30e8db(0x1e3)+_0x36f9db[_0x30e8db(0x206)]+'/'+_0x36f9db[_0x30e8db(0x1e5)]+'\x20splits');}});return _0x42e04f;},{'verbose':_0x4fb90d[_0x33c9b1(0x1ea)]}),_0x3712ce=_0x479b98[_0x33c9b1(0x1fb)],_0x336bf5=_0x3712ce[_0x33c9b1(0x1e7)]?_0x33c9b1(0x205)+_0x3712ce[_0x33c9b1(0x1e7)]+']':'',_0x2f2a0c=_0x4fe34b?'Statement\x20'+_0x11accb+'/'+_0x51a3c4+_0x33c9b1(0x1e4):'';console[_0x33c9b1(0x202)]('✔\x20'+_0x2f2a0c+'Query\x20completed:\x20Processed\x20'+formatRows(_0x3712ce['stats']['processedRows'])+_0x33c9b1(0x1e3)+(_0x33c9b1(0x20a)+formatElapsed(_0x3712ce[_0x33c9b1(0x201)]['elapsedTimeMillis'])+_0x336bf5));if(_0x4fe34b&&_0x3f39f5){const _0x5e7629=resolveOutputOptions(_0x4fb90d),_0x29656c=await formatQueryOutput(_0x3712ce,_0x5e7629);_0x16db5f['push'](_0x29656c);}else await handleQueryOutput(_0x3712ce,_0x4fb90d);}catch(_0x5bf325){const _0x2b0a86=_0x4fe34b?_0x33c9b1(0x20b)+_0x11accb+'/'+_0x51a3c4+':\x0a':'',_0x38e344=_0x5bf325 instanceof SDKError?_0x5bf325[_0x33c9b1(0x1f2)]:_0x5bf325[_0x33c9b1(0x1e0)];return console[_0x33c9b1(0x202)](''+_0x2b0a86+_0x38e344),0x1;}}if(_0x1c466b[_0x33c9b1(0x1fc)]>0x1&&_0x3f39f5&&_0x16db5f[_0x33c9b1(0x1fc)]>0x0){const _0x34f96d=_0x16db5f[_0x33c9b1(0x1f9)]('\x0a');writeFileSync(_0x4fb90d[_0x33c9b1(0x1f0)],_0x34f96d),console[_0x33c9b1(0x202)](_0x33c9b1(0x1f6)+_0x4fb90d[_0x33c9b1(0x1f0)]);}return 0x0;}catch(_0x4c769c){throw _0x4c769c;}}['validate'](_0x262fc3){const _0x1a28ad=a24_0x5c32f4,_0x380583=_0x262fc3[_0x1a28ad(0x1e8)][0x0],_0x50c002=_0x262fc3[_0x1a28ad(0x20c)][_0x1a28ad(0x1f8)];if(!_0x380583&&!_0x50c002)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(_0x380583&&_0x50c002)return _0x1a28ad(0x1eb);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x5180b4=a25_0x4f40;(function(_0x257f4c,_0x4bccf6){const _0x842cd8=a25_0x4f40,_0x579b7b=_0x257f4c();while(!![]){try{const _0x47dd8d=parseInt(_0x842cd8(0x15c))/0x1+parseInt(_0x842cd8(0x17e))/0x2+parseInt(_0x842cd8(0x14c))/0x3+parseInt(_0x842cd8(0x17a))/0x4*(parseInt(_0x842cd8(0x193))/0x5)+-parseInt(_0x842cd8(0x13d))/0x6+parseInt(_0x842cd8(0x19b))/0x7+parseInt(_0x842cd8(0x168))/0x8*(-parseInt(_0x842cd8(0x14d))/0x9);if(_0x47dd8d===_0x4bccf6)break;else _0x579b7b['push'](_0x579b7b['shift']());}catch(_0x326512){_0x579b7b['push'](_0x579b7b['shift']());}}}(a25_0x1fa1,0xe2b86));import{BaseCommand}from'./command.js';function a25_0x1fa1(){const _0x29a738=['jobId','folderId','Usage:\x20tdx\x20sg\x20desc\x20<name>','Create\x20segment\x20folder\x20for\x20organization','21712392bWxIYa','✔\x20Created\x20folder\x20\x27','Show\x20folder\x20or\x20child\x20segment\x20details','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','json','\x20\x20Segment\x20name:\x20','Resolving\x20parent\x20segment\x20\x27','SELECT\x20*\x20FROM\x20(\x0a','Parent\x20ID:\x20','Fetching\x20parent\x20segment\x20details...','segmentId','parentId','parentSegment','Resolved\x20relative\x20path\x20to:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','execute','getSegmentSQL','68756yHEFFM','fullPath','log','Fetching\x20folder\x20\x27','151964zmiqZG','Usage:\x20tdx\x20sg\x20show\x20<name>','site','Resolving\x20\x27','Resolved\x20YAML\x20file:\x20','message','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','description','Fetching\x20SQL\x20for\x20segment...','Parent\x20name:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','trim','(root)','\x20\x20Cause:\x20','folder','\x20Opening\x20','getFolder','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','toLocaleString','✔\x20Found\x20','245fSvwxz','getParent','Use:\x20tdx\x20ps\x20view','segment:desc','segmentName','/e/','Fetching\x20segment\x20details...','Target\x20path:\x20','7930062nkPTBf','segmentPath','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','Examples:','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','Folder\x20ID:\x20','Options:','/app/ps/','Site:\x20','Use:\x20tdx\x20ps\x20sql','parentFolder','error','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','code','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','cause','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','Error:\x20Path\x20or\x20name\x20is\x20required','getSegment','Error:\x20Parent\x20segment\x20name\x20is\x20required','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','Show\x20child\x20segment\x20schema\x20(column\x20types)','resolveParentId','\x20[Job\x20ID:\x20','Usage:\x20tdx\x20sg\x20sql\x20<name>','Resolving\x20path\x20\x27','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','verbose','\x27\x20with\x20ID:\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','parent','format','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','name','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','Fetching\x20folder\x20details...','includes','web','Resolved\x20folder\x20ID:\x20','Segment\x20ID:\x20','folderPath','segment','information_schema','Creating\x20folder\x20\x27','Resolved\x20type:\x20','data','INVALID_ARGUMENT','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','✖\x20Query\x20failed\x20[','resolvePathToResource','listFolders','Use:\x20tdx\x20ps\x20show','cyan','Show\x20segment\x20or\x20folder\x20details','type','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20Parent\x20segment:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','2920902nmeHYQ','Segment\x20ID\x20missing\x20from\x20resolved\x20path','Error:\x20','SEGMENT_NOT_FOUND','resolveFolderId','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:sql','query','\x27...','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','SEGMENT_FOLDER_NOT_FOUND','Executing\x20segment\x20query...','✔\x20Query\x20completed:\x20Processed\x20','setJobId','replace','4590645AgXvyo','9kgkFra','test','\x20\x20Folder\x20path:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','stats','Resolved\x20parent\x20ID:\x20','segment:folder:create','\x20folder','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','limit','Use:\x20tdx\x20ps\x20view\x20-w','segment:view','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','length','548188ukjXoc','Folder\x20name:\x20','segment:folder:list','Listing\x20folders\x20for\x20parent\x20\x27','\x20rows\x20','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'];a25_0x1fa1=function(){return _0x29a738;};return a25_0x1fa1();}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';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a25_0x4f40(_0xfa9d06,_0x44220f){_0xfa9d06=_0xfa9d06-0x13d;const _0x1fa1b4=a25_0x1fa1();let _0x4f4063=_0x1fa1b4[_0xfa9d06];return _0x4f4063;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0x2ed445 from'chalk';async function resolveSegmentTarget(_0x30ea65,_0x36c767,_0x315dbc){const _0x3aa182=a25_0x4f40;if(isYamlFilePath(_0x30ea65))try{const _0x4ff15b=await resolveYamlFilePath(_0x30ea65);return _0x315dbc&&(console[_0x3aa182(0x1a8)](_0x3aa182(0x182)+_0x30ea65),console[_0x3aa182(0x1a8)](_0x3aa182(0x1d8)+_0x4ff15b[_0x3aa182(0x174)]),console[_0x3aa182(0x1a8)](_0x3aa182(0x16d)+_0x4ff15b[_0x3aa182(0x197)]),console[_0x3aa182(0x1a8)](_0x3aa182(0x14f)+(_0x4ff15b[_0x3aa182(0x1c8)]||_0x3aa182(0x18a))),console['error']('\x20\x20Full\x20path:\x20'+_0x4ff15b[_0x3aa182(0x17b)])),_0x4ff15b['fullPath'];}catch(_0x41ae52){throw new SDKError(ErrorCode[_0x3aa182(0x1ce)],_0x3aa182(0x1b9)+_0x41ae52[_0x3aa182(0x183)]);}if(!_0x36c767)throw new SDKError(ErrorCode[_0x3aa182(0x1ce)],_0x3aa182(0x18f));return _0x36c767+'/'+_0x30ea65;}export class SegmentDescribeCommand extends BaseCommand{['name']='segment:describe';[a25_0x5180b4(0x185)]=a25_0x5180b4(0x1d5);async[a25_0x5180b4(0x178)](_0x2b949f){const _0xbef1dd=a25_0x5180b4,{options:_0x29d9c7,args:_0xba7235,tdx:_0x4739f4}=_0x2b949f,_0x49f752=_0xba7235[0x0],_0xa03e9=!_0x49f752&&!!_0x29d9c7[_0xbef1dd(0x174)],_0x4e374c=_0x49f752||_0x29d9c7[_0xbef1dd(0x174)];if(!_0x4e374c)return console[_0xbef1dd(0x1a8)](_0xbef1dd(0x1b0)),console[_0xbef1dd(0x1a8)]('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console[_0xbef1dd(0x1a8)](_0xbef1dd(0x19f)),console[_0xbef1dd(0x1a8)](_0xbef1dd(0x1a0)),console[_0xbef1dd(0x1a8)](_0xbef1dd(0x161)),console[_0xbef1dd(0x1a8)]('\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context'),console['error']('\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>'),0x1;try{const _0x1c0ebf=_0x29d9c7[_0xbef1dd(0x19c)];let _0x1260ab=_0x4e374c;!_0xa03e9&&_0x1c0ebf&&!_0x4e374c[_0xbef1dd(0x1c4)]('/')&&(_0x1260ab=_0x1c0ebf+'/'+_0x4e374c,_0x29d9c7[_0xbef1dd(0x1ba)]&&console[_0xbef1dd(0x1a8)](_0xbef1dd(0x175)+_0x1260ab));const _0x1d6ced=await withSpinner(_0xbef1dd(0x1b8)+_0x1260ab+_0xbef1dd(0x145),()=>_0x4739f4['segment'][_0xbef1dd(0x1d1)](_0x1260ab),{'verbose':_0x29d9c7[_0xbef1dd(0x1ba)]}),_0x138e08=_0x1d6ced[_0xbef1dd(0x1cd)];_0x29d9c7[_0xbef1dd(0x1ba)]&&(console[_0xbef1dd(0x1a8)](_0xbef1dd(0x1cc)+_0x138e08[_0xbef1dd(0x1d6)]),console[_0xbef1dd(0x1a8)](_0xbef1dd(0x170)+_0x138e08['parentId']),_0x138e08['folderId']&&console['error'](_0xbef1dd(0x1a2)+_0x138e08[_0xbef1dd(0x165)]),_0x138e08[_0xbef1dd(0x172)]&&console[_0xbef1dd(0x1a8)](_0xbef1dd(0x1c7)+_0x138e08[_0xbef1dd(0x172)]));if(_0x138e08[_0xbef1dd(0x1d6)]===_0xbef1dd(0x1bd)){const _0x59cf5d=await withSpinner(_0xbef1dd(0x171),()=>_0x4739f4[_0xbef1dd(0x1c9)][_0xbef1dd(0x194)](_0x138e08[_0xbef1dd(0x173)]),{'verbose':_0x29d9c7['verbose']});await handleSingleObjectOutput(_0x59cf5d[_0xbef1dd(0x1cd)],_0x29d9c7);}else{if(_0x138e08[_0xbef1dd(0x1d6)]===_0xbef1dd(0x18c)){if(!_0x138e08['folderId'])throw new SDKError(ErrorCode[_0xbef1dd(0x147)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x375a1c=await withSpinner(_0xbef1dd(0x1c3),()=>_0x4739f4[_0xbef1dd(0x1c9)][_0xbef1dd(0x18e)](_0x138e08[_0xbef1dd(0x165)]),{'verbose':_0x29d9c7[_0xbef1dd(0x1ba)]});await handleSingleObjectOutput(_0x375a1c[_0xbef1dd(0x1cd)],_0x29d9c7);}else{if(_0x138e08['type']===_0xbef1dd(0x1c9)){if(!_0x138e08[_0xbef1dd(0x172)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0xbef1dd(0x13e));const _0x3a3228=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4739f4[_0xbef1dd(0x1c9)]['getSegment'](_0x138e08[_0xbef1dd(0x173)],_0x138e08[_0xbef1dd(0x172)]),{'verbose':_0x29d9c7[_0xbef1dd(0x1ba)]});await handleSingleObjectOutput(_0x3a3228[_0xbef1dd(0x1cd)],_0x29d9c7);}}}return 0x0;}catch(_0x53eff7){if(_0x53eff7 instanceof SDKError)return console['error'](_0xbef1dd(0x13f)+_0x53eff7[_0xbef1dd(0x183)]),_0x53eff7[_0xbef1dd(0x1ae)]&&console[_0xbef1dd(0x1a8)](_0xbef1dd(0x18b)+_0x53eff7[_0xbef1dd(0x1ae)]),0x1;throw _0x53eff7;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x5180b4(0x1c0)]='segment:show';['description']=a25_0x5180b4(0x16b);async['execute'](_0x469ed7){const _0x4f7b78=a25_0x5180b4,{options:_0x39400d,args:_0x2eb616,tdx:_0xcb60ad}=_0x469ed7,_0x3701ec=_0x2eb616[0x0];if(!_0x3701ec)return console[_0x4f7b78(0x1a8)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4f7b78(0x1a8)](_0x4f7b78(0x17f)),console[_0x4f7b78(0x1a8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x4f7b78(0x1a8)](_0x4f7b78(0x19f)),console[_0x4f7b78(0x1a8)](_0x4f7b78(0x146)),console[_0x4f7b78(0x1a8)](_0x4f7b78(0x1b3)),0x1;try{const _0x7edf42=_0x39400d[_0x4f7b78(0x174)],_0x4ac3f5=await resolveSegmentTarget(_0x3701ec,_0x7edf42,_0x39400d[_0x4f7b78(0x1ba)]);_0x39400d[_0x4f7b78(0x1ba)]&&console[_0x4f7b78(0x1a8)](_0x4f7b78(0x19a)+_0x4ac3f5);const _0x3106d0=await withSpinner(_0x4f7b78(0x181)+_0x3701ec+_0x4f7b78(0x145),()=>_0xcb60ad[_0x4f7b78(0x1c9)]['resolvePathToResource'](_0x4ac3f5),{'verbose':_0x39400d[_0x4f7b78(0x1ba)]}),_0x5b038e=_0x3106d0[_0x4f7b78(0x1cd)];_0x39400d[_0x4f7b78(0x1ba)]&&(console[_0x4f7b78(0x1a8)](_0x4f7b78(0x1cc)+_0x5b038e['type']),console[_0x4f7b78(0x1a8)](_0x4f7b78(0x170)+_0x5b038e[_0x4f7b78(0x173)]));if(_0x5b038e[_0x4f7b78(0x1d6)]==='folder')return console['error'](_0x4f7b78(0x1c1)),console[_0x4f7b78(0x1a8)](_0x4f7b78(0x1bf)),0x1;if(_0x5b038e['type']===_0x4f7b78(0x1bd))return console['error']('Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x4f7b78(0x1a8)](_0x4f7b78(0x1d3)),0x1;if(!_0x5b038e[_0x4f7b78(0x172)])throw new SDKError(ErrorCode[_0x4f7b78(0x140)],_0x4f7b78(0x13e));const _0x4bf4d0=await withSpinner(_0x4f7b78(0x186),()=>_0xcb60ad[_0x4f7b78(0x1c9)][_0x4f7b78(0x179)](_0x5b038e[_0x4f7b78(0x173)],_0x5b038e[_0x4f7b78(0x172)]),{'verbose':_0x39400d[_0x4f7b78(0x1ba)]});let _0x59ed88=_0x4bf4d0[_0x4f7b78(0x1cd)];const _0xf04482=resolveLimit(_0x39400d[_0x4f7b78(0x157)],DEFAULT_DISPLAY_LIMIT),_0xc27511=/\bLIMIT\s+\d+/i[_0x4f7b78(0x14e)](_0x59ed88);!_0xc27511&&(_0x59ed88=_0x59ed88[_0x4f7b78(0x189)]()[_0x4f7b78(0x14b)](/;+$/,''),_0x59ed88=_0x4f7b78(0x16f)+_0x59ed88+_0x4f7b78(0x1d9)+_0xf04482);_0x39400d[_0x4f7b78(0x1ba)]&&console['error']('SQL\x20query:\x0a'+_0x59ed88);const _0x1c3019=await withProgressSpinner(_0x4f7b78(0x148),async _0x2c0caf=>{const _0x55d22f=_0x4f7b78,_0x3f4ac4=await _0xcb60ad[_0x55d22f(0x144)][_0x55d22f(0x178)](_0x59ed88,{'catalog':'td','schema':_0x55d22f(0x1ca),'onJobId':_0x14cc21=>{const _0x349cf2=_0x55d22f;_0x2c0caf[_0x349cf2(0x14a)](_0x14cc21);}});return _0x3f4ac4;},{'verbose':_0x39400d[_0x4f7b78(0x1ba)]}),_0x254300=_0x1c3019[_0x4f7b78(0x1cd)],_0x151bce=_0x254300[_0x4f7b78(0x164)]?_0x4f7b78(0x1b6)+_0x254300[_0x4f7b78(0x164)]+']':'';return console[_0x4f7b78(0x1a8)](_0x4f7b78(0x149)+_0x254300['stats']['processedRows'][_0x4f7b78(0x191)]()+_0x4f7b78(0x160)+('in\x20'+formatElapsed(_0x254300[_0x4f7b78(0x152)]['elapsedTimeMillis'])+_0x151bce)),await handleQueryOutput(_0x254300,_0x39400d),0x0;}catch(_0x44e1c1){if(_0x44e1c1 instanceof SDKError)return console['error'](_0x4f7b78(0x1d0)+_0x44e1c1[_0x4f7b78(0x1ab)]+']'),console[_0x4f7b78(0x1a8)]('\x0a'+_0x44e1c1[_0x4f7b78(0x183)]),0x1;throw _0x44e1c1;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x5180b4(0x1c0)]=a25_0x5180b4(0x15e);[a25_0x5180b4(0x185)]=a25_0x5180b4(0x1cf);async[a25_0x5180b4(0x178)](_0x2a6105){const _0x43afea=a25_0x5180b4,{options:_0x52b0d4,args:_0x5f3a6d,tdx:_0x3e0e25}=_0x2a6105;if(_0x5f3a6d['length']===0x0)return console[_0x43afea(0x1a8)](_0x43afea(0x1b2)),console['error'](_0x43afea(0x163)),0x1;const _0x502ea1=_0x5f3a6d[0x0];try{_0x52b0d4[_0x43afea(0x1ba)]&&(console[_0x43afea(0x1a8)](_0x43afea(0x1a5)+_0x52b0d4[_0x43afea(0x180)]),console['error'](_0x43afea(0x187)+_0x502ea1));const _0x5d71d3=await withSpinner(_0x43afea(0x16e)+_0x502ea1+_0x43afea(0x145),()=>_0x3e0e25[_0x43afea(0x1c9)][_0x43afea(0x1b5)](_0x502ea1),{'verbose':_0x52b0d4[_0x43afea(0x1ba)]}),_0x36986f=_0x5d71d3['data'];_0x52b0d4[_0x43afea(0x1ba)]&&console[_0x43afea(0x1a8)]('Resolved\x20parent\x20ID:\x20'+_0x36986f);const _0x2aac5b=await withSpinner(_0x43afea(0x15f)+_0x502ea1+'\x27...',()=>_0x3e0e25[_0x43afea(0x1c9)][_0x43afea(0x1d2)](_0x36986f),{'verbose':_0x52b0d4[_0x43afea(0x1ba)]}),_0x56df77=_0x2aac5b[_0x43afea(0x1cd)];return console[_0x43afea(0x1a8)](_0x43afea(0x192)+_0x56df77[_0x43afea(0x15b)]+_0x43afea(0x155)+(_0x56df77[_0x43afea(0x15b)]!==0x1?'s':'')),await handleSDKOutput(_0x56df77,_0x52b0d4),0x0;}catch(_0x3a8291){if(_0x3a8291 instanceof SDKError)return console[_0x43afea(0x1a8)](_0x43afea(0x13f)+_0x3a8291[_0x43afea(0x183)]),_0x3a8291['cause']&&console['error'](_0x43afea(0x18b)+_0x3a8291[_0x43afea(0x1ae)]),0x1;throw _0x3a8291;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x5180b4(0x1c0)]='segment:folder:show';[a25_0x5180b4(0x185)]='Show\x20segment\x20folder\x20details';async[a25_0x5180b4(0x178)](_0x1f2602){const _0x1b41b7=a25_0x5180b4,{options:_0x312e3f,args:_0x354abb,tdx:_0x373fa3}=_0x1f2602;if(_0x354abb[_0x1b41b7(0x15b)]===0x0)return console[_0x1b41b7(0x1a8)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0x1b41b7(0x1a8)](_0x1b41b7(0x156)),0x1;try{const {parentId:_0x5100e6,childId:_0x158a7c}=parseSegmentRef(_0x354abb[0x0]);_0x312e3f['verbose']&&(console[_0x1b41b7(0x1a8)](_0x1b41b7(0x1a5)+_0x312e3f['site']),console['error'](_0x1b41b7(0x187)+_0x5100e6),_0x158a7c&&console[_0x1b41b7(0x1a8)](_0x1b41b7(0x15d)+_0x158a7c));if(!_0x158a7c)return console['error']('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x747c04=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5100e6+_0x1b41b7(0x145),()=>_0x373fa3[_0x1b41b7(0x1c9)]['resolveParentId'](_0x5100e6),{'verbose':_0x312e3f[_0x1b41b7(0x1ba)]}),_0x57ba1f=_0x747c04[_0x1b41b7(0x1cd)];_0x312e3f[_0x1b41b7(0x1ba)]&&console[_0x1b41b7(0x1a8)](_0x1b41b7(0x153)+_0x57ba1f);const _0x36a904=await withSpinner('Resolving\x20folder\x20\x27'+_0x158a7c+_0x1b41b7(0x145),()=>_0x373fa3['segment'][_0x1b41b7(0x141)](_0x57ba1f,_0x158a7c),{'verbose':_0x312e3f['verbose']}),_0x165b21=_0x36a904[_0x1b41b7(0x1cd)];_0x312e3f[_0x1b41b7(0x1ba)]&&console['error'](_0x1b41b7(0x1c6)+_0x165b21);const _0x3bf19d=await withSpinner(_0x1b41b7(0x17d)+_0x158a7c+_0x1b41b7(0x145),()=>_0x373fa3[_0x1b41b7(0x1c9)]['getFolder'](_0x165b21),{'verbose':_0x312e3f['verbose']});return await handleSDKOutput([_0x3bf19d[_0x1b41b7(0x1cd)]],_0x312e3f),0x0;}catch(_0x3ef871){if(_0x3ef871 instanceof SDKError)return console[_0x1b41b7(0x1a8)](_0x1b41b7(0x13f)+_0x3ef871[_0x1b41b7(0x183)]),_0x3ef871[_0x1b41b7(0x1ae)]&&console[_0x1b41b7(0x1a8)](_0x1b41b7(0x18b)+_0x3ef871[_0x1b41b7(0x1ae)]),0x1;throw _0x3ef871;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x5180b4(0x1c0)]=a25_0x5180b4(0x143);[a25_0x5180b4(0x185)]=a25_0x5180b4(0x1d7);async[a25_0x5180b4(0x178)](_0x1a25ac){const _0x56ebab=a25_0x5180b4,{options:_0x99bb95,args:_0x38a133,tdx:_0x3b944d}=_0x1a25ac,_0x5d6ee0=_0x38a133[0x0];if(!_0x5d6ee0)return console[_0x56ebab(0x1a8)](_0x56ebab(0x1aa)),console['error'](_0x56ebab(0x1b7)),console[_0x56ebab(0x1a8)](_0x56ebab(0x1af)),console[_0x56ebab(0x1a8)](_0x56ebab(0x19f)),console[_0x56ebab(0x1a8)](_0x56ebab(0x15a)),console[_0x56ebab(0x1a8)](_0x56ebab(0x19e)),0x1;try{const _0x150f0d=_0x99bb95[_0x56ebab(0x174)],_0x57b2b7=await resolveSegmentTarget(_0x5d6ee0,_0x150f0d,_0x99bb95[_0x56ebab(0x1ba)]);_0x99bb95[_0x56ebab(0x1ba)]&&console[_0x56ebab(0x1a8)]('Target\x20path:\x20'+_0x57b2b7);const _0x6079cd=await withSpinner('Resolving\x20\x27'+_0x5d6ee0+_0x56ebab(0x145),()=>_0x3b944d[_0x56ebab(0x1c9)][_0x56ebab(0x1d1)](_0x57b2b7),{'verbose':_0x99bb95[_0x56ebab(0x1ba)]}),_0x1a879b=_0x6079cd[_0x56ebab(0x1cd)];_0x99bb95['verbose']&&(console['error'](_0x56ebab(0x1cc)+_0x1a879b[_0x56ebab(0x1d6)]),console[_0x56ebab(0x1a8)]('Parent\x20ID:\x20'+_0x1a879b[_0x56ebab(0x173)]));if(_0x1a879b[_0x56ebab(0x1d6)]===_0x56ebab(0x18c))return console['error'](_0x56ebab(0x184)),console[_0x56ebab(0x1a8)](_0x56ebab(0x19d)),0x1;if(_0x1a879b[_0x56ebab(0x1d6)]===_0x56ebab(0x1bd))return console[_0x56ebab(0x1a8)](_0x56ebab(0x190)),console['error'](_0x56ebab(0x1a6)),0x1;if(!_0x1a879b[_0x56ebab(0x172)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x56ebab(0x13e));const _0x22de17=await withSpinner(_0x56ebab(0x186),()=>_0x3b944d['segment'][_0x56ebab(0x179)](_0x1a879b[_0x56ebab(0x173)],_0x1a879b[_0x56ebab(0x172)]),{'verbose':_0x99bb95[_0x56ebab(0x1ba)]}),_0x1df827=_0x22de17[_0x56ebab(0x1cd)];return _0x99bb95[_0x56ebab(0x1be)]===_0x56ebab(0x16c)||_0x99bb95['format']==='jsonl'?await handleSDKOutput([{'sql':_0x1df827}],_0x99bb95):console[_0x56ebab(0x17c)](_0x1df827),0x0;}catch(_0xcd5a70){if(_0xcd5a70 instanceof SDKError)return console[_0x56ebab(0x1a8)](_0x56ebab(0x13f)+_0xcd5a70[_0x56ebab(0x183)]),_0xcd5a70['cause']&&console[_0x56ebab(0x1a8)](_0x56ebab(0x18b)+_0xcd5a70['cause']),0x1;throw _0xcd5a70;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x5180b4(0x1c0)]=a25_0x5180b4(0x154);[a25_0x5180b4(0x185)]=a25_0x5180b4(0x167);async[a25_0x5180b4(0x178)](_0x11b637){const _0x4a011d=a25_0x5180b4,{options:_0xde90d0,args:_0x5d67d0,tdx:_0x330c0b}=_0x11b637,_0x5f20cc=_0xde90d0;if(_0x5d67d0[_0x4a011d(0x15b)]<0x2)return console[_0x4a011d(0x1a8)](_0x4a011d(0x1ad)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x5c4572=_0x5d67d0[0x0],_0x5a2133=_0x5d67d0[0x1];_0x5f20cc['verbose']&&(console['error'](_0x4a011d(0x1a5)+_0x5f20cc[_0x4a011d(0x180)]),console[_0x4a011d(0x1a8)]('Parent\x20segment:\x20'+_0x5c4572),console[_0x4a011d(0x1a8)](_0x4a011d(0x15d)+_0x5a2133));let _0x368eef;if(_0x5f20cc[_0x4a011d(0x1a7)]){const _0xe3dd28=_0x5f20cc[_0x4a011d(0x1a7)],_0x56cb6f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5c4572+_0x4a011d(0x145),()=>_0x330c0b[_0x4a011d(0x1c9)]['resolveParentId'](_0x5c4572),{'verbose':_0x5f20cc[_0x4a011d(0x1ba)]}),_0x4312cc=_0x56cb6f[_0x4a011d(0x1cd)],_0x5418ee=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0xe3dd28+'\x27...',()=>_0x330c0b[_0x4a011d(0x1c9)]['resolveFolderId'](_0x4312cc,_0xe3dd28),{'verbose':_0x5f20cc[_0x4a011d(0x1ba)]});_0x368eef=_0x5418ee[_0x4a011d(0x1cd)],_0x5f20cc[_0x4a011d(0x1ba)]&&console[_0x4a011d(0x1a8)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x368eef);}const _0xc2c869={'name':_0x5a2133,'description':_0x5f20cc[_0x4a011d(0x185)],'parentFolderId':_0x368eef},_0x24764e=await withSpinner(_0x4a011d(0x1cb)+_0x5a2133+_0x4a011d(0x145),()=>_0x330c0b[_0x4a011d(0x1c9)]['createFolder'](_0x5c4572,_0xc2c869),{'verbose':_0x5f20cc[_0x4a011d(0x1ba)]}),_0x4db898=_0x24764e[_0x4a011d(0x1cd)];return console[_0x4a011d(0x1a8)](_0x4a011d(0x169)+_0x4db898[_0x4a011d(0x1c0)]+_0x4a011d(0x1bb)+_0x4db898['id']),await handleSDKOutput([_0x4db898],_0x5f20cc),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x5180b4(0x1c0)]=a25_0x5180b4(0x159);[a25_0x5180b4(0x185)]=a25_0x5180b4(0x16a);async['execute'](_0x52db71){const _0x47dc75=a25_0x5180b4,{options:_0x59b3a2,args:_0x245566,tdx:_0xa77d5b}=_0x52db71,_0x4e9b1c=_0x245566[0x0];if(!_0x4e9b1c)return console[_0x47dc75(0x1a8)](_0x47dc75(0x162)),console[_0x47dc75(0x1a8)]('Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]'),console[_0x47dc75(0x1a8)](_0x47dc75(0x150)),console[_0x47dc75(0x1a8)](_0x47dc75(0x1a3)),console[_0x47dc75(0x1a8)](_0x47dc75(0x1bc)),console['error'](_0x47dc75(0x19f)),console[_0x47dc75(0x1a8)](_0x47dc75(0x1c2)),console[_0x47dc75(0x1a8)]('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x47dc75(0x1a8)](_0x47dc75(0x1a1)),console[_0x47dc75(0x1a8)](_0x47dc75(0x151)),0x1;try{const _0x543c3b=_0x59b3a2['parentSegment'],_0x1975ab=await resolveSegmentTarget(_0x4e9b1c,_0x543c3b,_0x59b3a2['verbose']);_0x59b3a2[_0x47dc75(0x1ba)]&&console[_0x47dc75(0x1a8)](_0x47dc75(0x19a)+_0x1975ab);const _0x4d79bf=await withSpinner(_0x47dc75(0x181)+_0x4e9b1c+_0x47dc75(0x145),()=>_0xa77d5b[_0x47dc75(0x1c9)][_0x47dc75(0x1d1)](_0x1975ab),{'verbose':_0x59b3a2['verbose']}),_0x593a5a=_0x4d79bf[_0x47dc75(0x1cd)];_0x59b3a2[_0x47dc75(0x1ba)]&&(console['error'](_0x47dc75(0x1cc)+_0x593a5a[_0x47dc75(0x1d6)]),console[_0x47dc75(0x1a8)](_0x47dc75(0x170)+_0x593a5a['parentId']),_0x593a5a[_0x47dc75(0x165)]&&console[_0x47dc75(0x1a8)]('Folder\x20ID:\x20'+_0x593a5a[_0x47dc75(0x165)]),_0x593a5a['segmentId']&&console[_0x47dc75(0x1a8)]('Segment\x20ID:\x20'+_0x593a5a['segmentId']));if(_0x59b3a2[_0x47dc75(0x1c5)]){if(_0x593a5a[_0x47dc75(0x1d6)]===_0x47dc75(0x18c))return console['error'](_0x47dc75(0x1ac)),0x1;if(_0x593a5a['type']===_0x47dc75(0x1bd))return console[_0x47dc75(0x1a8)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x47dc75(0x1a8)](_0x47dc75(0x158)),0x1;if(!_0x593a5a[_0x47dc75(0x172)])throw new SDKError(ErrorCode[_0x47dc75(0x140)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1b36ac=getConsoleNextUrl(_0x59b3a2[_0x47dc75(0x180)],'/app/ps/'+_0x593a5a[_0x47dc75(0x173)]+_0x47dc75(0x198)+_0x593a5a[_0x47dc75(0x172)]);return console[_0x47dc75(0x1a8)](a25_0x2ed445['green']('✔')+_0x47dc75(0x18d)+a25_0x2ed445[_0x47dc75(0x1d4)](_0x1b36ac)),openBrowser(_0x1b36ac),0x0;}if(_0x593a5a['type']===_0x47dc75(0x18c)){if(!_0x593a5a['folderId'])throw new SDKError(ErrorCode[_0x47dc75(0x147)],_0x47dc75(0x142));const _0x5d6ced=await withSpinner(_0x47dc75(0x1c3),()=>_0xa77d5b[_0x47dc75(0x1c9)]['getFolder'](_0x593a5a['folderId']),{'verbose':_0x59b3a2[_0x47dc75(0x1ba)]});await handleSingleObjectOutput(_0x5d6ced[_0x47dc75(0x1cd)],_0x59b3a2);}else{if(_0x593a5a[_0x47dc75(0x1d6)]===_0x47dc75(0x1c9)){if(!_0x593a5a['segmentId'])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x533002=await withSpinner(_0x47dc75(0x199),()=>_0xa77d5b[_0x47dc75(0x1c9)][_0x47dc75(0x1b1)](_0x593a5a[_0x47dc75(0x173)],_0x593a5a[_0x47dc75(0x172)]),{'verbose':_0x59b3a2[_0x47dc75(0x1ba)]}),_0x483b2d=getConsoleNextUrl(_0x59b3a2[_0x47dc75(0x180)],_0x47dc75(0x1a4)+_0x593a5a[_0x47dc75(0x173)]+_0x47dc75(0x198)+_0x593a5a[_0x47dc75(0x172)]),_0x150861=_0x533002[_0x47dc75(0x1cd)];_0x150861['url']=_0x483b2d,await handleSingleObjectOutput(_0x150861,_0x59b3a2);}else return console[_0x47dc75(0x1a8)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console['error'](_0x47dc75(0x195)),0x1;}return 0x0;}catch(_0x207a79){if(_0x207a79 instanceof SDKError)return console[_0x47dc75(0x1a8)](_0x47dc75(0x13f)+_0x207a79[_0x47dc75(0x183)]),_0x207a79[_0x47dc75(0x1ae)]&&console[_0x47dc75(0x1a8)](_0x47dc75(0x18b)+_0x207a79[_0x47dc75(0x1ae)]),0x1;throw _0x207a79;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x5180b4(0x1c0)]=a25_0x5180b4(0x196);[a25_0x5180b4(0x185)]=a25_0x5180b4(0x1b4);async['execute'](_0x5db59c){const _0x7890f0=a25_0x5180b4,{options:_0x2a4587,args:_0x212298,tdx:_0x4878b0}=_0x5db59c,_0x488263=_0x212298[0x0];if(!_0x488263)return console['error'](_0x7890f0(0x1aa)),console[_0x7890f0(0x1a8)](_0x7890f0(0x166)),console[_0x7890f0(0x1a8)](_0x7890f0(0x188)),console[_0x7890f0(0x1a8)](_0x7890f0(0x19f)),console[_0x7890f0(0x1a8)](_0x7890f0(0x177)),console[_0x7890f0(0x1a8)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x576a95=_0x2a4587[_0x7890f0(0x174)],_0x34ba27=await resolveSegmentTarget(_0x488263,_0x576a95,_0x2a4587[_0x7890f0(0x1ba)]);_0x2a4587[_0x7890f0(0x1ba)]&&console[_0x7890f0(0x1a8)](_0x7890f0(0x19a)+_0x34ba27);const _0xc63504=await withSpinner(_0x7890f0(0x181)+_0x488263+'\x27...',()=>_0x4878b0[_0x7890f0(0x1c9)][_0x7890f0(0x1d1)](_0x34ba27),{'verbose':_0x2a4587[_0x7890f0(0x1ba)]}),_0x1e4c1e=_0xc63504[_0x7890f0(0x1cd)];_0x2a4587['verbose']&&(console['error'](_0x7890f0(0x1cc)+_0x1e4c1e[_0x7890f0(0x1d6)]),console[_0x7890f0(0x1a8)](_0x7890f0(0x170)+_0x1e4c1e[_0x7890f0(0x173)]));if(_0x1e4c1e[_0x7890f0(0x1d6)]===_0x7890f0(0x18c))return console['error'](_0x7890f0(0x176)),console['error'](_0x7890f0(0x19d)),0x1;if(_0x1e4c1e['type']===_0x7890f0(0x1bd))return console[_0x7890f0(0x1a8)](_0x7890f0(0x1a9)),console['error']('Use:\x20tdx\x20ps\x20desc'),0x1;if(!_0x1e4c1e[_0x7890f0(0x172)])throw new SDKError(ErrorCode[_0x7890f0(0x140)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1233f2=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x4878b0['segment']['getSegmentSQL'](_0x1e4c1e[_0x7890f0(0x173)],_0x1e4c1e[_0x7890f0(0x172)]),{'verbose':_0x2a4587[_0x7890f0(0x1ba)]}),_0x1b67e4=_0x1233f2[_0x7890f0(0x1cd)],_0x59a162=await executeSchemaQuery(_0x1b67e4,_0x4878b0,_0x2a4587);return await handleQueryOutput(_0x59a162,_0x2a4587),0x0;}catch(_0x28729a){if(_0x28729a instanceof SDKError)return console[_0x7890f0(0x1a8)]('Error:\x20'+_0x28729a[_0x7890f0(0x183)]),_0x28729a[_0x7890f0(0x1ae)]&&console[_0x7890f0(0x1a8)](_0x7890f0(0x18b)+_0x28729a[_0x7890f0(0x1ae)]),0x1;throw _0x28729a;}}}
|
|
1
|
+
function a25_0x4d4a(){const _0x413cc9=['getSegmentSQL','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','folderPath','Resolving\x20path\x20\x27','✔\x20Found\x20','Fetching\x20folder\x20details...','message','\x20\x20Segment\x20name:\x20','Use:\x20tdx\x20ps\x20desc','\x27...','4MpIojy','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','segment','Executing\x20segment\x20query...','Resolved\x20type:\x20','Parent\x20ID:\x20','stats','test','jobId','Examples:','Segment\x20ID\x20missing\x20from\x20resolved\x20path','✔\x20Query\x20completed:\x20Processed\x20','site','Folder\x20ID:\x20','(root)','trim','SQL\x20query:\x0a','Target\x20path:\x20','elapsedTimeMillis','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','getParent','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','3788240hFuaAA','Usage:\x20tdx\x20segment\x20describe\x20<path>','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','6LdvxiU','\x20\x20Cause:\x20','url','/app/ps/','replace','/e/','resolveFolderId','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','SEGMENT_NOT_FOUND','query','Resolving\x20folder\x20\x27','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','name','type','listFolders','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','getSegment','folderId','Usage:\x20tdx\x20sg\x20show\x20<name>','672444pGOpkN','execute','Resolved\x20parent\x20folder\x20ID:\x20','\x20\x20Folder\x20path:\x20','1983879jEGTwg','Fetching\x20SQL\x20for\x20segment...','Fetching\x20segment\x20details...','length','Use:\x20tdx\x20ps\x20show','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x20folder','folder','resolvePathToResource','segment:folder:list','parentFolder','\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','resolveParentId','in\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','cause','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment:desc','verbose','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','json','Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.','segmentId','Parent\x20segment:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Fetching\x20parent\x20segment\x20details...','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','SEGMENT_FOLDER_NOT_FOUND','createFolder','segment:sql','✖\x20Query\x20failed\x20[','error','toLocaleString','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','setJobId','Show\x20folder\x20or\x20child\x20segment\x20details','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','cyan','limit','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Segment\x20ID:\x20','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Site:\x20','Error:\x20Folder\x20reference\x20is\x20required','segment:folder:show','3212455uOwrSO','Use:\x20tdx\x20ps\x20view','data','Resolved\x20YAML\x20file:\x20','parentSegment','log','parentId','\x20\x20Parent\x20segment:\x20','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','Use:\x20tdx\x20ps\x20view\x20-w','parent','\x20rows\x20','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','segment:folder:create','description','getFolder','✔\x20Created\x20folder\x20\x27','segmentPath','Show\x20segment\x20or\x20folder\x20details','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','format','processedRows','Error:\x20','Parent\x20name:\x20','Show\x20segment\x20folder\x20details','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','458269IuNVWH','Resolved\x20parent\x20ID:\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Resolving\x20parent\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','2471721WYgaQL','Show\x20child\x20segment\x20schema\x20(column\x20types)','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','\x20[Job\x20ID:\x20','10OmGYHZ','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolving\x20\x27','Resolved\x20relative\x20path\x20to:\x20','segment:show','INVALID_ARGUMENT','Use:\x20tdx\x20ps\x20sql','1284399iNHMUr'];a25_0x4d4a=function(){return _0x413cc9;};return a25_0x4d4a();}const a25_0x84662d=a25_0x4a74;(function(_0x3afbd3,_0x94d702){const _0x739f4b=a25_0x4a74,_0x2a169e=_0x3afbd3();while(!![]){try{const _0x4c55d4=parseInt(_0x739f4b(0x1d2))/0x1+parseInt(_0x739f4b(0x21c))/0x2+-parseInt(_0x739f4b(0x1e2))/0x3*(parseInt(_0x739f4b(0x1ed))/0x4)+parseInt(_0x739f4b(0x24e))/0x5*(-parseInt(_0x739f4b(0x208))/0x6)+parseInt(_0x739f4b(0x1d7))/0x7+parseInt(_0x739f4b(0x205))/0x8+parseInt(_0x739f4b(0x220))/0x9*(-parseInt(_0x739f4b(0x1db))/0xa);if(_0x4c55d4===_0x94d702)break;else _0x2a169e['push'](_0x2a169e['shift']());}catch(_0x363d65){_0x2a169e['push'](_0x2a169e['shift']());}}}(a25_0x4d4a,0x50955));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';function a25_0x4a74(_0x2d6bba,_0x501b9c){_0x2d6bba=_0x2d6bba-0x1b7;const _0x4d4a50=a25_0x4d4a();let _0x4a7447=_0x4d4a50[_0x2d6bba];return _0x4a7447;}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_0x4d6f96 from'chalk';async function resolveSegmentTarget(_0xf59013,_0x503ccb,_0x354bc4){const _0x56c4d4=a25_0x4a74;if(isYamlFilePath(_0xf59013))try{const _0x201b6a=await resolveYamlFilePath(_0xf59013);return _0x354bc4&&(console[_0x56c4d4(0x240)](_0x56c4d4(0x1b9)+_0xf59013),console[_0x56c4d4(0x240)](_0x56c4d4(0x1bd)+_0x201b6a['parentSegment']),console[_0x56c4d4(0x240)](_0x56c4d4(0x1ea)+_0x201b6a['segmentName']),console[_0x56c4d4(0x240)](_0x56c4d4(0x21f)+(_0x201b6a[_0x56c4d4(0x1e5)]||_0x56c4d4(0x1fb))),console[_0x56c4d4(0x240)]('\x20\x20Full\x20path:\x20'+_0x201b6a['fullPath'])),_0x201b6a['fullPath'];}catch(_0x48b195){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x56c4d4(0x239)+_0x48b195['message']);}if(!_0x503ccb)throw new SDKError(ErrorCode[_0x56c4d4(0x1e0)],_0x56c4d4(0x20f));return _0x503ccb+'/'+_0xf59013;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x84662d(0x215)]='segment:describe';[a25_0x84662d(0x1c4)]=a25_0x84662d(0x1c8);async[a25_0x84662d(0x21d)](_0x130ed8){const _0x3abf7c=a25_0x84662d,{options:_0x6f2cdb,args:_0xfeac7f,tdx:_0x2a9e26}=_0x130ed8,_0xd89a6=_0xfeac7f[0x0],_0x3995ac=!_0xd89a6&&!!_0x6f2cdb[_0x3abf7c(0x1ba)],_0x26b84b=_0xd89a6||_0x6f2cdb[_0x3abf7c(0x1ba)];if(!_0x26b84b)return console['error']('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x3abf7c(0x240)](_0x3abf7c(0x206)),console['error']('Examples:'),console[_0x3abf7c(0x240)](_0x3abf7c(0x1d9)),console[_0x3abf7c(0x240)]('\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22'),console[_0x3abf7c(0x240)](_0x3abf7c(0x203)),console[_0x3abf7c(0x240)](_0x3abf7c(0x200)),0x1;try{const _0x405ab1=_0x6f2cdb[_0x3abf7c(0x1c7)];let _0x37efa=_0x26b84b;!_0x3995ac&&_0x405ab1&&!_0x26b84b['includes']('/')&&(_0x37efa=_0x405ab1+'/'+_0x26b84b,_0x6f2cdb[_0x3abf7c(0x233)]&&console[_0x3abf7c(0x240)](_0x3abf7c(0x1de)+_0x37efa));const _0x358104=await withSpinner(_0x3abf7c(0x1e6)+_0x37efa+_0x3abf7c(0x1ec),()=>_0x2a9e26[_0x3abf7c(0x1ef)][_0x3abf7c(0x229)](_0x37efa),{'verbose':_0x6f2cdb['verbose']}),_0x529024=_0x358104[_0x3abf7c(0x1b8)];_0x6f2cdb[_0x3abf7c(0x233)]&&(console[_0x3abf7c(0x240)](_0x3abf7c(0x1f1)+_0x529024[_0x3abf7c(0x216)]),console['error'](_0x3abf7c(0x1f2)+_0x529024['parentId']),_0x529024['folderId']&&console['error'](_0x3abf7c(0x1fa)+_0x529024[_0x3abf7c(0x21a)]),_0x529024[_0x3abf7c(0x237)]&&console[_0x3abf7c(0x240)](_0x3abf7c(0x249)+_0x529024[_0x3abf7c(0x237)]));if(_0x529024['type']===_0x3abf7c(0x1c0)){const _0x57906f=await withSpinner(_0x3abf7c(0x23a),()=>_0x2a9e26[_0x3abf7c(0x1ef)][_0x3abf7c(0x202)](_0x529024[_0x3abf7c(0x1bc)]),{'verbose':_0x6f2cdb[_0x3abf7c(0x233)]});await handleSingleObjectOutput(_0x57906f[_0x3abf7c(0x1b8)],_0x6f2cdb);}else{if(_0x529024[_0x3abf7c(0x216)]===_0x3abf7c(0x228)){if(!_0x529024['folderId'])throw new SDKError(ErrorCode[_0x3abf7c(0x23c)],_0x3abf7c(0x248));const _0x17923f=await withSpinner('Fetching\x20folder\x20details...',()=>_0x2a9e26[_0x3abf7c(0x1ef)]['getFolder'](_0x529024[_0x3abf7c(0x21a)]),{'verbose':_0x6f2cdb[_0x3abf7c(0x233)]});await handleSingleObjectOutput(_0x17923f['data'],_0x6f2cdb);}else{if(_0x529024[_0x3abf7c(0x216)]===_0x3abf7c(0x1ef)){if(!_0x529024[_0x3abf7c(0x237)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3abf7c(0x1f7));const _0x4a3dd0=await withSpinner(_0x3abf7c(0x222),()=>_0x2a9e26['segment']['getSegment'](_0x529024[_0x3abf7c(0x1bc)],_0x529024[_0x3abf7c(0x237)]),{'verbose':_0x6f2cdb[_0x3abf7c(0x233)]});await handleSingleObjectOutput(_0x4a3dd0[_0x3abf7c(0x1b8)],_0x6f2cdb);}}}return 0x0;}catch(_0xaadec8){if(_0xaadec8 instanceof SDKError)return console[_0x3abf7c(0x240)]('Error:\x20'+_0xaadec8[_0x3abf7c(0x1e9)]),_0xaadec8['cause']&&console[_0x3abf7c(0x240)](_0x3abf7c(0x209)+_0xaadec8['cause']),0x1;throw _0xaadec8;}}}export class SegmentShowCommand extends BaseCommand{['name']=a25_0x84662d(0x1df);[a25_0x84662d(0x1c4)]=a25_0x84662d(0x1d4);async['execute'](_0x1174be){const _0x83886a=a25_0x84662d,{options:_0x110f38,args:_0x355725,tdx:_0x45a2a7}=_0x1174be,_0x5ccee8=_0x355725[0x0];if(!_0x5ccee8)return console[_0x83886a(0x240)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x83886a(0x21b)),console['error'](_0x83886a(0x1cb)),console[_0x83886a(0x240)]('Examples:'),console[_0x83886a(0x240)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x83886a(0x240)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x5436ea=_0x110f38[_0x83886a(0x1ba)],_0x291c91=await resolveSegmentTarget(_0x5ccee8,_0x5436ea,_0x110f38[_0x83886a(0x233)]);_0x110f38['verbose']&&console[_0x83886a(0x240)](_0x83886a(0x1fe)+_0x291c91);const _0x253955=await withSpinner('Resolving\x20\x27'+_0x5ccee8+_0x83886a(0x1ec),()=>_0x45a2a7[_0x83886a(0x1ef)]['resolvePathToResource'](_0x291c91),{'verbose':_0x110f38[_0x83886a(0x233)]}),_0x135e25=_0x253955[_0x83886a(0x1b8)];_0x110f38[_0x83886a(0x233)]&&(console[_0x83886a(0x240)]('Resolved\x20type:\x20'+_0x135e25[_0x83886a(0x216)]),console['error'](_0x83886a(0x1f2)+_0x135e25[_0x83886a(0x1bc)]));if(_0x135e25[_0x83886a(0x216)]===_0x83886a(0x228))return console[_0x83886a(0x240)](_0x83886a(0x218)),console[_0x83886a(0x240)](_0x83886a(0x201)),0x1;if(_0x135e25[_0x83886a(0x216)]===_0x83886a(0x1c0))return console[_0x83886a(0x240)](_0x83886a(0x22f)),console[_0x83886a(0x240)](_0x83886a(0x224)),0x1;if(!_0x135e25[_0x83886a(0x237)])throw new SDKError(ErrorCode[_0x83886a(0x211)],_0x83886a(0x1f7));const _0x1c641f=await withSpinner(_0x83886a(0x221),()=>_0x45a2a7[_0x83886a(0x1ef)]['getSegmentSQL'](_0x135e25[_0x83886a(0x1bc)],_0x135e25[_0x83886a(0x237)]),{'verbose':_0x110f38[_0x83886a(0x233)]});let _0x2632ec=_0x1c641f['data'];const _0x17995f=resolveLimit(_0x110f38[_0x83886a(0x247)],DEFAULT_DISPLAY_LIMIT),_0x51a5af=/\bLIMIT\s+\d+/i[_0x83886a(0x1f4)](_0x2632ec);!_0x51a5af&&(_0x2632ec=_0x2632ec[_0x83886a(0x1fc)]()[_0x83886a(0x20c)](/;+$/,''),_0x2632ec='SELECT\x20*\x20FROM\x20(\x0a'+_0x2632ec+_0x83886a(0x1dc)+_0x17995f);_0x110f38[_0x83886a(0x233)]&&console[_0x83886a(0x240)](_0x83886a(0x1fd)+_0x2632ec);const _0x84700e=await withProgressSpinner(_0x83886a(0x1f0),async _0x28755d=>{const _0x323663=_0x83886a,_0x563d2b=await _0x45a2a7[_0x323663(0x212)][_0x323663(0x21d)](_0x2632ec,{'catalog':'td','schema':'information_schema','onJobId':_0x273131=>{const _0x12871c=_0x323663;_0x28755d[_0x12871c(0x243)](_0x273131);}});return _0x563d2b;},{'verbose':_0x110f38['verbose']}),_0xd566e9=_0x84700e[_0x83886a(0x1b8)],_0x1cc884=_0xd566e9[_0x83886a(0x1f5)]?_0x83886a(0x1da)+_0xd566e9[_0x83886a(0x1f5)]+']':'';return console['error'](_0x83886a(0x1f8)+_0xd566e9[_0x83886a(0x1f3)][_0x83886a(0x1cd)][_0x83886a(0x241)]()+_0x83886a(0x1c1)+(_0x83886a(0x22e)+formatElapsed(_0xd566e9[_0x83886a(0x1f3)][_0x83886a(0x1ff)])+_0x1cc884)),await handleQueryOutput(_0xd566e9,_0x110f38),0x0;}catch(_0x38ad8f){if(_0x38ad8f instanceof SDKError)return console[_0x83886a(0x240)](_0x83886a(0x23f)+_0x38ad8f['code']+']'),console[_0x83886a(0x240)]('\x0a'+_0x38ad8f[_0x83886a(0x1e9)]),0x1;throw _0x38ad8f;}}}export class SegmentFolderListCommand extends BaseCommand{[a25_0x84662d(0x215)]=a25_0x84662d(0x22a);[a25_0x84662d(0x1c4)]=a25_0x84662d(0x225);async[a25_0x84662d(0x21d)](_0x25714e){const _0x1618bd=a25_0x84662d,{options:_0x2545bc,args:_0x5c3676,tdx:_0x819ed4}=_0x25714e;if(_0x5c3676[_0x1618bd(0x223)]===0x0)return console[_0x1618bd(0x240)]('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x301416=_0x5c3676[0x0];try{_0x2545bc[_0x1618bd(0x233)]&&(console[_0x1618bd(0x240)](_0x1618bd(0x24b)+_0x2545bc[_0x1618bd(0x1f9)]),console[_0x1618bd(0x240)](_0x1618bd(0x1cf)+_0x301416));const _0x213476=await withSpinner(_0x1618bd(0x1d5)+_0x301416+'\x27...',()=>_0x819ed4[_0x1618bd(0x1ef)]['resolveParentId'](_0x301416),{'verbose':_0x2545bc['verbose']}),_0x592d91=_0x213476['data'];_0x2545bc[_0x1618bd(0x233)]&&console[_0x1618bd(0x240)](_0x1618bd(0x1d3)+_0x592d91);const _0x4ff812=await withSpinner('Listing\x20folders\x20for\x20parent\x20\x27'+_0x301416+_0x1618bd(0x1ec),()=>_0x819ed4[_0x1618bd(0x1ef)][_0x1618bd(0x217)](_0x592d91),{'verbose':_0x2545bc[_0x1618bd(0x233)]}),_0x55fc91=_0x4ff812[_0x1618bd(0x1b8)];return console[_0x1618bd(0x240)](_0x1618bd(0x1e7)+_0x55fc91[_0x1618bd(0x223)]+_0x1618bd(0x227)+(_0x55fc91[_0x1618bd(0x223)]!==0x1?'s':'')),await handleSDKOutput(_0x55fc91,_0x2545bc),0x0;}catch(_0x49d170){if(_0x49d170 instanceof SDKError)return console[_0x1618bd(0x240)](_0x1618bd(0x1ce)+_0x49d170[_0x1618bd(0x1e9)]),_0x49d170['cause']&&console[_0x1618bd(0x240)](_0x1618bd(0x209)+_0x49d170['cause']),0x1;throw _0x49d170;}}}export class SegmentFolderShowCommand extends BaseCommand{[a25_0x84662d(0x215)]=a25_0x84662d(0x24d);[a25_0x84662d(0x1c4)]=a25_0x84662d(0x1d0);async['execute'](_0x4bd64c){const _0x48102e=a25_0x84662d,{options:_0x47aaa1,args:_0xe46565,tdx:_0x14a519}=_0x4bd64c;if(_0xe46565[_0x48102e(0x223)]===0x0)return console['error'](_0x48102e(0x24c)),console[_0x48102e(0x240)]('Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>'),0x1;try{const {parentId:_0x39d911,childId:_0x1f63f0}=parseSegmentRef(_0xe46565[0x0]);_0x47aaa1[_0x48102e(0x233)]&&(console[_0x48102e(0x240)](_0x48102e(0x24b)+_0x47aaa1[_0x48102e(0x1f9)]),console[_0x48102e(0x240)]('Parent\x20name:\x20'+_0x39d911),_0x1f63f0&&console['error']('Folder\x20name:\x20'+_0x1f63f0));if(!_0x1f63f0)return console[_0x48102e(0x240)](_0x48102e(0x234)),0x1;const _0x1c14a0=await withSpinner(_0x48102e(0x1d5)+_0x39d911+'\x27...',()=>_0x14a519[_0x48102e(0x1ef)][_0x48102e(0x22d)](_0x39d911),{'verbose':_0x47aaa1[_0x48102e(0x233)]}),_0x156151=_0x1c14a0['data'];_0x47aaa1[_0x48102e(0x233)]&&console[_0x48102e(0x240)](_0x48102e(0x1d3)+_0x156151);const _0x1ac625=await withSpinner(_0x48102e(0x213)+_0x1f63f0+'\x27...',()=>_0x14a519[_0x48102e(0x1ef)]['resolveFolderId'](_0x156151,_0x1f63f0),{'verbose':_0x47aaa1['verbose']}),_0x3c4dd5=_0x1ac625[_0x48102e(0x1b8)];_0x47aaa1[_0x48102e(0x233)]&&console[_0x48102e(0x240)]('Resolved\x20folder\x20ID:\x20'+_0x3c4dd5);const _0x5ea0b9=await withSpinner('Fetching\x20folder\x20\x27'+_0x1f63f0+_0x48102e(0x1ec),()=>_0x14a519[_0x48102e(0x1ef)][_0x48102e(0x1c5)](_0x3c4dd5),{'verbose':_0x47aaa1[_0x48102e(0x233)]});return await handleSDKOutput([_0x5ea0b9['data']],_0x47aaa1),0x0;}catch(_0xf55f8){if(_0xf55f8 instanceof SDKError)return console['error']('Error:\x20'+_0xf55f8[_0x48102e(0x1e9)]),_0xf55f8[_0x48102e(0x230)]&&console[_0x48102e(0x240)](_0x48102e(0x209)+_0xf55f8['cause']),0x1;throw _0xf55f8;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x84662d(0x215)]=a25_0x84662d(0x23e);[a25_0x84662d(0x1c4)]='Get\x20SQL\x20query\x20for\x20child\x20segment';async[a25_0x84662d(0x21d)](_0xfa664c){const _0x53ea6c=a25_0x84662d,{options:_0x333236,args:_0x33e0a6,tdx:_0x1f0731}=_0xfa664c,_0xeb93a4=_0x33e0a6[0x0];if(!_0xeb93a4)return console[_0x53ea6c(0x240)](_0x53ea6c(0x23b)),console[_0x53ea6c(0x240)]('Usage:\x20tdx\x20sg\x20sql\x20<name>'),console[_0x53ea6c(0x240)](_0x53ea6c(0x204)),console[_0x53ea6c(0x240)]('Examples:'),console[_0x53ea6c(0x240)](_0x53ea6c(0x24a)),console[_0x53ea6c(0x240)]('\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x1d138e=_0x333236['parentSegment'],_0x5699c9=await resolveSegmentTarget(_0xeb93a4,_0x1d138e,_0x333236['verbose']);_0x333236[_0x53ea6c(0x233)]&&console['error'](_0x53ea6c(0x1fe)+_0x5699c9);const _0x1c723a=await withSpinner('Resolving\x20\x27'+_0xeb93a4+'\x27...',()=>_0x1f0731[_0x53ea6c(0x1ef)][_0x53ea6c(0x229)](_0x5699c9),{'verbose':_0x333236[_0x53ea6c(0x233)]}),_0x2e0f72=_0x1c723a[_0x53ea6c(0x1b8)];_0x333236[_0x53ea6c(0x233)]&&(console['error'](_0x53ea6c(0x1f1)+_0x2e0f72[_0x53ea6c(0x216)]),console[_0x53ea6c(0x240)](_0x53ea6c(0x1f2)+_0x2e0f72[_0x53ea6c(0x1bc)]));if(_0x2e0f72[_0x53ea6c(0x216)]===_0x53ea6c(0x228))return console[_0x53ea6c(0x240)](_0x53ea6c(0x226)),console[_0x53ea6c(0x240)](_0x53ea6c(0x242)),0x1;if(_0x2e0f72[_0x53ea6c(0x216)]==='parent')return console[_0x53ea6c(0x240)](_0x53ea6c(0x236)),console[_0x53ea6c(0x240)](_0x53ea6c(0x1e1)),0x1;if(!_0x2e0f72['segmentId'])throw new SDKError(ErrorCode[_0x53ea6c(0x211)],_0x53ea6c(0x1f7));const _0x31ca95=await withSpinner(_0x53ea6c(0x221),()=>_0x1f0731[_0x53ea6c(0x1ef)]['getSegmentSQL'](_0x2e0f72[_0x53ea6c(0x1bc)],_0x2e0f72[_0x53ea6c(0x237)]),{'verbose':_0x333236[_0x53ea6c(0x233)]}),_0x4de6d6=_0x31ca95[_0x53ea6c(0x1b8)];return _0x333236[_0x53ea6c(0x1cc)]===_0x53ea6c(0x235)||_0x333236['format']==='jsonl'?await handleSDKOutput([{'sql':_0x4de6d6}],_0x333236):console[_0x53ea6c(0x1bb)](_0x4de6d6),0x0;}catch(_0x254510){if(_0x254510 instanceof SDKError)return console[_0x53ea6c(0x240)](_0x53ea6c(0x1ce)+_0x254510[_0x53ea6c(0x1e9)]),_0x254510[_0x53ea6c(0x230)]&&console['error']('\x20\x20Cause:\x20'+_0x254510[_0x53ea6c(0x230)]),0x1;throw _0x254510;}}}export class SegmentFolderCreateCommand extends BaseCommand{[a25_0x84662d(0x215)]=a25_0x84662d(0x1c3);[a25_0x84662d(0x1c4)]='Create\x20segment\x20folder\x20for\x20organization';async[a25_0x84662d(0x21d)](_0xf505b3){const _0x1a94cf=a25_0x84662d,{options:_0x218982,args:_0x1d2b35,tdx:_0x3cf492}=_0xf505b3,_0xfeb081=_0x218982;if(_0x1d2b35['length']<0x2)return console[_0x1a94cf(0x240)](_0x1a94cf(0x245)),console[_0x1a94cf(0x240)](_0x1a94cf(0x1d6)),0x1;const _0x5e0e02=_0x1d2b35[0x0],_0x3f2430=_0x1d2b35[0x1];_0xfeb081['verbose']&&(console['error']('Site:\x20'+_0xfeb081[_0x1a94cf(0x1f9)]),console[_0x1a94cf(0x240)](_0x1a94cf(0x238)+_0x5e0e02),console[_0x1a94cf(0x240)]('Folder\x20name:\x20'+_0x3f2430));let _0x288dcc;if(_0xfeb081[_0x1a94cf(0x22b)]){const _0x5d2276=_0xfeb081[_0x1a94cf(0x22b)],_0x457e4b=await withSpinner(_0x1a94cf(0x1d5)+_0x5e0e02+'\x27...',()=>_0x3cf492[_0x1a94cf(0x1ef)][_0x1a94cf(0x22d)](_0x5e0e02),{'verbose':_0xfeb081[_0x1a94cf(0x233)]}),_0x57ff03=_0x457e4b[_0x1a94cf(0x1b8)],_0x9ccce9=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x5d2276+'\x27...',()=>_0x3cf492['segment'][_0x1a94cf(0x20e)](_0x57ff03,_0x5d2276),{'verbose':_0xfeb081[_0x1a94cf(0x233)]});_0x288dcc=_0x9ccce9[_0x1a94cf(0x1b8)],_0xfeb081[_0x1a94cf(0x233)]&&console[_0x1a94cf(0x240)](_0x1a94cf(0x21e)+_0x288dcc);}const _0x1ce18e={'name':_0x3f2430,'description':_0xfeb081['description'],'parentFolderId':_0x288dcc},_0x36c69f=await withSpinner('Creating\x20folder\x20\x27'+_0x3f2430+_0x1a94cf(0x1ec),()=>_0x3cf492[_0x1a94cf(0x1ef)][_0x1a94cf(0x23d)](_0x5e0e02,_0x1ce18e),{'verbose':_0xfeb081['verbose']}),_0x1cf060=_0x36c69f[_0x1a94cf(0x1b8)];return console[_0x1a94cf(0x240)](_0x1a94cf(0x1c6)+_0x1cf060[_0x1a94cf(0x215)]+'\x27\x20with\x20ID:\x20'+_0x1cf060['id']),await handleSDKOutput([_0x1cf060],_0xfeb081),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x84662d(0x215)]='segment:view';[a25_0x84662d(0x1c4)]=a25_0x84662d(0x244);async['execute'](_0x4ff1a8){const _0x5dda93=a25_0x84662d,{options:_0xaba9ab,args:_0x4d3bdb,tdx:_0x4c7e4a}=_0x4ff1a8,_0x5a4212=_0x4d3bdb[0x0];if(!_0x5a4212)return console[_0x5dda93(0x240)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x5dda93(0x240)](_0x5dda93(0x231)),console[_0x5dda93(0x240)](_0x5dda93(0x207)),console['error']('Options:'),console[_0x5dda93(0x240)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x5dda93(0x240)]('Examples:'),console[_0x5dda93(0x240)](_0x5dda93(0x22c)),console['error'](_0x5dda93(0x1e4)),console['error'](_0x5dda93(0x210)),console[_0x5dda93(0x240)](_0x5dda93(0x1c2)),0x1;try{const _0x101160=_0xaba9ab['parentSegment'],_0x455db1=await resolveSegmentTarget(_0x5a4212,_0x101160,_0xaba9ab['verbose']);_0xaba9ab['verbose']&&console[_0x5dda93(0x240)](_0x5dda93(0x1fe)+_0x455db1);const _0x275c13=await withSpinner(_0x5dda93(0x1dd)+_0x5a4212+_0x5dda93(0x1ec),()=>_0x4c7e4a[_0x5dda93(0x1ef)][_0x5dda93(0x229)](_0x455db1),{'verbose':_0xaba9ab[_0x5dda93(0x233)]}),_0x2751ea=_0x275c13[_0x5dda93(0x1b8)];_0xaba9ab[_0x5dda93(0x233)]&&(console['error'](_0x5dda93(0x1f1)+_0x2751ea[_0x5dda93(0x216)]),console['error'](_0x5dda93(0x1f2)+_0x2751ea[_0x5dda93(0x1bc)]),_0x2751ea[_0x5dda93(0x21a)]&&console[_0x5dda93(0x240)](_0x5dda93(0x1fa)+_0x2751ea['folderId']),_0x2751ea[_0x5dda93(0x237)]&&console['error'](_0x5dda93(0x249)+_0x2751ea[_0x5dda93(0x237)]));if(_0xaba9ab['web']){if(_0x2751ea[_0x5dda93(0x216)]===_0x5dda93(0x228))return console[_0x5dda93(0x240)](_0x5dda93(0x1ee)),0x1;if(_0x2751ea[_0x5dda93(0x216)]===_0x5dda93(0x1c0))return console[_0x5dda93(0x240)]('Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x5dda93(0x240)](_0x5dda93(0x1bf)),0x1;if(!_0x2751ea[_0x5dda93(0x237)])throw new SDKError(ErrorCode[_0x5dda93(0x211)],_0x5dda93(0x1f7));const _0x3a06eb=getConsoleNextUrl(_0xaba9ab[_0x5dda93(0x1f9)],_0x5dda93(0x20b)+_0x2751ea[_0x5dda93(0x1bc)]+_0x5dda93(0x20d)+_0x2751ea[_0x5dda93(0x237)]);return console[_0x5dda93(0x240)](a25_0x4d6f96['green']('✔')+'\x20Opening\x20'+a25_0x4d6f96[_0x5dda93(0x246)](_0x3a06eb)),openBrowser(_0x3a06eb),0x0;}if(_0x2751ea[_0x5dda93(0x216)]===_0x5dda93(0x228)){if(!_0x2751ea[_0x5dda93(0x21a)])throw new SDKError(ErrorCode['SEGMENT_FOLDER_NOT_FOUND'],_0x5dda93(0x248));const _0x1cc5ac=await withSpinner(_0x5dda93(0x1e8),()=>_0x4c7e4a[_0x5dda93(0x1ef)]['getFolder'](_0x2751ea[_0x5dda93(0x21a)]),{'verbose':_0xaba9ab[_0x5dda93(0x233)]});await handleSingleObjectOutput(_0x1cc5ac[_0x5dda93(0x1b8)],_0xaba9ab);}else{if(_0x2751ea[_0x5dda93(0x216)]===_0x5dda93(0x1ef)){if(!_0x2751ea[_0x5dda93(0x237)])throw new SDKError(ErrorCode[_0x5dda93(0x211)],_0x5dda93(0x1f7));const _0x18db73=await withSpinner('Fetching\x20segment\x20details...',()=>_0x4c7e4a[_0x5dda93(0x1ef)][_0x5dda93(0x219)](_0x2751ea[_0x5dda93(0x1bc)],_0x2751ea[_0x5dda93(0x237)]),{'verbose':_0xaba9ab[_0x5dda93(0x233)]}),_0x48c11d=getConsoleNextUrl(_0xaba9ab[_0x5dda93(0x1f9)],_0x5dda93(0x20b)+_0x2751ea[_0x5dda93(0x1bc)]+_0x5dda93(0x20d)+_0x2751ea[_0x5dda93(0x237)]),_0x12d41b=_0x18db73['data'];_0x12d41b[_0x5dda93(0x20a)]=_0x48c11d,await handleSingleObjectOutput(_0x12d41b,_0xaba9ab);}else return console[_0x5dda93(0x240)](_0x5dda93(0x1ca)),console['error'](_0x5dda93(0x1b7)),0x1;}return 0x0;}catch(_0x50cd73){if(_0x50cd73 instanceof SDKError)return console['error']('Error:\x20'+_0x50cd73[_0x5dda93(0x1e9)]),_0x50cd73[_0x5dda93(0x230)]&&console['error'](_0x5dda93(0x209)+_0x50cd73[_0x5dda93(0x230)]),0x1;throw _0x50cd73;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x84662d(0x215)]=a25_0x84662d(0x232);['description']=a25_0x84662d(0x1d8);async[a25_0x84662d(0x21d)](_0x5cd7f9){const _0x3083ad=a25_0x84662d,{options:_0x2150cc,args:_0x17debf,tdx:_0x178397}=_0x5cd7f9,_0x4030db=_0x17debf[0x0];if(!_0x4030db)return console[_0x3083ad(0x240)](_0x3083ad(0x23b)),console['error']('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x3083ad(0x1c9)),console[_0x3083ad(0x240)](_0x3083ad(0x1f6)),console[_0x3083ad(0x240)](_0x3083ad(0x1d1)),console[_0x3083ad(0x240)](_0x3083ad(0x1be)),0x1;try{const _0x908878=_0x2150cc['parentSegment'],_0x188326=await resolveSegmentTarget(_0x4030db,_0x908878,_0x2150cc['verbose']);_0x2150cc['verbose']&&console['error'](_0x3083ad(0x1fe)+_0x188326);const _0x3eb875=await withSpinner(_0x3083ad(0x1dd)+_0x4030db+_0x3083ad(0x1ec),()=>_0x178397[_0x3083ad(0x1ef)][_0x3083ad(0x229)](_0x188326),{'verbose':_0x2150cc[_0x3083ad(0x233)]}),_0x3743ec=_0x3eb875[_0x3083ad(0x1b8)];_0x2150cc[_0x3083ad(0x233)]&&(console[_0x3083ad(0x240)](_0x3083ad(0x1f1)+_0x3743ec['type']),console[_0x3083ad(0x240)](_0x3083ad(0x1f2)+_0x3743ec[_0x3083ad(0x1bc)]));if(_0x3743ec[_0x3083ad(0x216)]==='folder')return console[_0x3083ad(0x240)](_0x3083ad(0x214)),console[_0x3083ad(0x240)](_0x3083ad(0x242)),0x1;if(_0x3743ec[_0x3083ad(0x216)]===_0x3083ad(0x1c0))return console[_0x3083ad(0x240)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x3083ad(0x240)](_0x3083ad(0x1eb)),0x1;if(!_0x3743ec[_0x3083ad(0x237)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x3083ad(0x1f7));const _0x541218=await withSpinner(_0x3083ad(0x221),()=>_0x178397[_0x3083ad(0x1ef)][_0x3083ad(0x1e3)](_0x3743ec[_0x3083ad(0x1bc)],_0x3743ec[_0x3083ad(0x237)]),{'verbose':_0x2150cc[_0x3083ad(0x233)]}),_0x249eb2=_0x541218['data'],_0x53d330=await executeSchemaQuery(_0x249eb2,_0x178397,_0x2150cc);return await handleQueryOutput(_0x53d330,_0x2150cc),0x0;}catch(_0x55bf93){if(_0x55bf93 instanceof SDKError)return console['error'](_0x3083ad(0x1ce)+_0x55bf93['message']),_0x55bf93['cause']&&console[_0x3083ad(0x240)](_0x3083ad(0x209)+_0x55bf93[_0x3083ad(0x230)]),0x1;throw _0x55bf93;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a26_0x23be9a=a26_0x54ba;(function(_0x49b89d,_0x4b8827){const _0x567a7a=a26_0x54ba,_0x642ed3=_0x49b89d();while(!![]){try{const _0x2c9789=parseInt(_0x567a7a(0x1ed))/0x1+-parseInt(_0x567a7a(0x1c3))/0x2*(-parseInt(_0x567a7a(0x1e1))/0x3)+-parseInt(_0x567a7a(0x1e8))/0x4+-parseInt(_0x567a7a(0x1cb))/0x5*(-parseInt(_0x567a7a(0x1c5))/0x6)+-parseInt(_0x567a7a(0x1cd))/0x7+parseInt(_0x567a7a(0x1f1))/0x8+parseInt(_0x567a7a(0x1ee))/0x9*(-parseInt(_0x567a7a(0x1dd))/0xa);if(_0x2c9789===_0x4b8827)break;else _0x642ed3['push'](_0x642ed3['shift']());}catch(_0x3fc67d){_0x642ed3['push'](_0x642ed3['shift']());}}}(a26_0x3525,0x30e11));import{BaseCommand}from'./command.js';function a26_0x3525(){const _0x4ffa2a=['\x20\x20\x20Path:\x20','\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','data','folder','error','length','resolveParentId','Site:\x20','execute','verbose','60otvhyQ','parent','Resolved\x20folder\x20ID:\x20','rule','3609TeQigm','resolveFolderId','includes','✔\x20Created\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','Resolving\x20folder\x20\x27','635608KPcrNO','site','Resolved\x20relative\x20path\x20to:\x20','Resolving\x20folder\x20path\x20\x27','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','190490HGEBeg','709209OlIqVR','Parent\x20path:\x20','Examples:','2277584jzbIPl','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','segmentPath','createSegment','folderId','invisible','Parent:\x20','386irWWSu','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','162zddbZx','type','noCountPopulation','description','ruleFile','segment','58095ujeGKO','yellow','1324141EEUJAK','\x27\x20with\x20ID:\x20','segments','kind','name','\x27...'];a26_0x3525=function(){return _0x4ffa2a;};return a26_0x3525();}import{handleSDKOutput}from'../core/command-output.js';function a26_0x54ba(_0x3dbe46,_0x1667c2){_0x3dbe46=_0x3dbe46-0x1bf;const _0x352515=a26_0x3525();let _0x54ba4f=_0x352515[_0x3dbe46];return _0x54ba4f;}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_0x453cb4 from'chalk';export class SegmentCreateCommand extends BaseCommand{[a26_0x23be9a(0x1d1)]='segment:create';[a26_0x23be9a(0x1c8)]='Create\x20child\x20segment\x20with\x20filtering\x20rules';async[a26_0x23be9a(0x1db)](_0xf4ca74){const _0x2b372e=a26_0x23be9a;console[_0x2b372e(0x1d7)](a26_0x453cb4[_0x2b372e(0x1cc)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x2b372e(0x1d7)](a26_0x453cb4[_0x2b372e(0x1cc)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x442e05,args:_0x37d377,tdx:_0x4549ea}=_0xf4ca74,_0x1607a6=_0x442e05;if(_0x37d377[_0x2b372e(0x1d8)]===0x0)return console['error']('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x2b372e(0x1d7)](_0x2b372e(0x1e5)),console[_0x2b372e(0x1d7)](_0x2b372e(0x1f0)),console['error'](_0x2b372e(0x1ec)),console['error'](_0x2b372e(0x1c4)),console[_0x2b372e(0x1d7)](_0x2b372e(0x1d4)),0x1;const _0x41fb7c=_0x37d377[0x0],_0x146669=_0x442e05[_0x2b372e(0x1f3)];let _0x47c085=_0x41fb7c;_0x146669&&!_0x41fb7c[_0x2b372e(0x1e3)]('/')&&(_0x47c085=_0x146669+'/'+_0x41fb7c,_0x1607a6[_0x2b372e(0x1dc)]&&console[_0x2b372e(0x1d7)](_0x2b372e(0x1ea)+_0x47c085));const _0x32f70f=parsePath(_0x47c085);if(_0x32f70f[_0x2b372e(0x1cf)][_0x2b372e(0x1d8)]<0x2)return console['error'](_0x2b372e(0x1f2)),console[_0x2b372e(0x1d7)]('Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]'),0x1;const _0x2f3ab5=_0x32f70f['segments'][0x0],_0x5bbdfc=getBaseName(_0x47c085),_0x5566bd=getParentPath(_0x47c085);_0x1607a6[_0x2b372e(0x1dc)]&&(console[_0x2b372e(0x1d7)](_0x2b372e(0x1da)+_0x1607a6[_0x2b372e(0x1e9)]),console[_0x2b372e(0x1d7)]('Target\x20path:\x20'+_0x47c085),console[_0x2b372e(0x1d7)](_0x2b372e(0x1c2)+_0x2f3ab5),console[_0x2b372e(0x1d7)]('Segment\x20name:\x20'+_0x5bbdfc),console['error'](_0x2b372e(0x1ef)+_0x5566bd));const _0x3749ff=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2f3ab5+_0x2b372e(0x1d2),()=>_0x4549ea[_0x2b372e(0x1ca)][_0x2b372e(0x1d9)](_0x2f3ab5),{'verbose':_0x1607a6[_0x2b372e(0x1dc)]}),_0x38a3f2=_0x3749ff[_0x2b372e(0x1d5)];let _0x168b03;if(_0x32f70f[_0x2b372e(0x1cf)][_0x2b372e(0x1d8)]>0x2){const _0x25dfa2=await withSpinner(_0x2b372e(0x1eb)+_0x5566bd+'\x27...',()=>_0x4549ea[_0x2b372e(0x1ca)]['resolvePathToResource'](_0x5566bd),{'verbose':_0x1607a6[_0x2b372e(0x1dc)]}),_0x27e32c=_0x25dfa2[_0x2b372e(0x1d5)];if(_0x27e32c[_0x2b372e(0x1c6)]!==_0x2b372e(0x1d6)&&_0x27e32c['type']!==_0x2b372e(0x1de))return console['error'](_0x2b372e(0x1e6)),0x1;_0x168b03=_0x27e32c[_0x2b372e(0x1c0)];}else{if(_0x1607a6[_0x2b372e(0x1d6)]){const _0x2c23ce=await withSpinner(_0x2b372e(0x1e7)+_0x1607a6[_0x2b372e(0x1d6)]+_0x2b372e(0x1d2),()=>_0x4549ea[_0x2b372e(0x1ca)][_0x2b372e(0x1e2)](_0x38a3f2,_0x1607a6['folder']),{'verbose':_0x1607a6['verbose']});_0x168b03=_0x2c23ce[_0x2b372e(0x1d5)];}}_0x1607a6[_0x2b372e(0x1dc)]&&_0x168b03&&console[_0x2b372e(0x1d7)](_0x2b372e(0x1df)+_0x168b03);const _0x3f626d=await loadJSONFromOptions(_0x1607a6[_0x2b372e(0x1e0)],_0x1607a6[_0x2b372e(0x1c9)]),_0x3c93b0={'name':_0x5bbdfc,'description':_0x1607a6[_0x2b372e(0x1c8)],'rule':_0x3f626d,'kind':_0x1607a6['kind']!==undefined?parseInt(_0x1607a6[_0x2b372e(0x1d0)],0xa):undefined,'isVisible':_0x1607a6[_0x2b372e(0x1c1)]?![]:undefined,'segmentFolderId':_0x168b03,'countPopulation':_0x1607a6[_0x2b372e(0x1c7)]?![]:undefined},_0x1db7fc=await withSpinner('Creating\x20segment\x20\x27'+_0x5bbdfc+_0x2b372e(0x1d2),()=>_0x4549ea[_0x2b372e(0x1ca)][_0x2b372e(0x1bf)](_0x38a3f2,_0x3c93b0),{'verbose':_0x1607a6[_0x2b372e(0x1dc)]}),_0x57fee9=_0x1db7fc[_0x2b372e(0x1d5)];return console[_0x2b372e(0x1d7)](_0x2b372e(0x1e4)+_0x57fee9[_0x2b372e(0x1d1)]+_0x2b372e(0x1ce)+_0x57fee9['id']),_0x47c085!==_0x41fb7c&&console[_0x2b372e(0x1d7)](_0x2b372e(0x1d3)+_0x47c085),await handleSDKOutput([_0x57fee9],_0x1607a6),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a27_0x42f032=a27_0x3c81;(function(_0x3a5891,_0x52afa7){const _0x396fae=a27_0x3c81,_0x9b8b91=_0x3a5891();while(!![]){try{const _0x51a889=parseInt(_0x396fae(0x91))/0x1+-parseInt(_0x396fae(0x8d))/0x2+-parseInt(_0x396fae(0x8c))/0x3+-parseInt(_0x396fae(0xa5))/0x4*(parseInt(_0x396fae(0xa2))/0x5)+parseInt(_0x396fae(0x98))/0x6*(-parseInt(_0x396fae(0x9d))/0x7)+parseInt(_0x396fae(0xa0))/0x8*(parseInt(_0x396fae(0x90))/0x9)+parseInt(_0x396fae(0xa1))/0xa*(parseInt(_0x396fae(0x93))/0xb);if(_0x51a889===_0x52afa7)break;else _0x9b8b91['push'](_0x9b8b91['shift']());}catch(_0xcf2dac){_0x9b8b91['push'](_0x9b8b91['shift']());}}}(a27_0x5e4c,0x89a52));function a27_0x5e4c(){const _0x301302=['List\x20available\x20fields\x20for\x20segmentation','13683527DjNTTZ','Error:\x20Parent\x20segment\x20name\x20is\x20required','verbose','data','✔\x20Found\x20','6rOOUTI','\x27...','jsonl','error','Listing\x20fields\x20for\x20\x27','3037223DYcyzo','parentSegment','name','6766616YIBgMx','10TRGwMC','1743785UnAERV','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','\x20field','12hhDxQN','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','segment','length','1361649NedZrA','1084044GodPBY','listFields','site','9MBHQpP','950075bWZyDB'];a27_0x5e4c=function(){return _0x301302;};return a27_0x5e4c();}function a27_0x3c81(_0x2d76c0,_0x5108b5){_0x2d76c0=_0x2d76c0-0x8b;const _0x5e4c60=a27_0x5e4c();let _0x3c8113=_0x5e4c60[_0x2d76c0];return _0x3c8113;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a27_0x42f032(0x9f)]='segment:fields';['description']=a27_0x42f032(0x92);async['execute'](_0x48e148){const _0x3dad50=a27_0x42f032,{options:_0x404b39,args:_0x17d770,tdx:_0xa0e0fc}=_0x48e148,_0x3bfc5d=_0x17d770[0x0]||_0x404b39[_0x3dad50(0x9e)];if(!_0x3bfc5d)return console[_0x3dad50(0x9b)](_0x3dad50(0x94)),console[_0x3dad50(0x9b)](_0x3dad50(0xa3)),console['error'](_0x3dad50(0xa6)),0x1;_0x404b39[_0x3dad50(0x95)]&&(console[_0x3dad50(0x9b)]('Site:\x20'+_0x404b39[_0x3dad50(0x8f)]),console[_0x3dad50(0x9b)]('Parent\x20segment:\x20'+_0x3bfc5d));const _0x3f83ed=await withSpinner(_0x3dad50(0x9c)+_0x3bfc5d+_0x3dad50(0x99),()=>_0xa0e0fc[_0x3dad50(0xa7)][_0x3dad50(0x8e)](_0x3bfc5d),{'verbose':_0x404b39[_0x3dad50(0x95)]}),_0x2b2b43=_0x3f83ed[_0x3dad50(0x96)];console[_0x3dad50(0x9b)](_0x3dad50(0x97)+_0x2b2b43['length']+_0x3dad50(0xa4)+(_0x2b2b43[_0x3dad50(0x8b)]!==0x1?'s':''));if(_0x404b39['json']||_0x404b39[_0x3dad50(0x9a)])return await handleSDKOutput(_0x2b2b43,_0x404b39),0x0;return displayFieldsHumanReadable(_0x2b2b43,_0x3bfc5d),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a28_0x3e9182=a28_0x1733;(function(_0x2a803b,_0x4b5bde){const _0x1c86db=a28_0x1733,_0xdbcf33=_0x2a803b();while(!![]){try{const _0x123d94=-parseInt(_0x1c86db(0xaa))/0x1+-parseInt(_0x1c86db(0x97))/0x2+parseInt(_0x1c86db(0x9c))/0x3+-parseInt(_0x1c86db(0xc5))/0x4*(-parseInt(_0x1c86db(0xa6))/0x5)+-parseInt(_0x1c86db(0x89))/0x6*(-parseInt(_0x1c86db(0x9f))/0x7)+parseInt(_0x1c86db(0x7c))/0x8*(parseInt(_0x1c86db(0xb2))/0x9)+-parseInt(_0x1c86db(0x86))/0xa*(parseInt(_0x1c86db(0x8d))/0xb);if(_0x123d94===_0x4b5bde)break;else _0xdbcf33['push'](_0xdbcf33['shift']());}catch(_0x17594f){_0xdbcf33['push'](_0xdbcf33['shift']());}}}(a28_0x16d0,0xb95ca));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_0x3605e8 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a28_0x342755 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a28_0x1733(_0x3916d8,_0x703fb3){_0x3916d8=_0x3916d8-0x77;const _0x16d0c4=a28_0x16d0();let _0x173361=_0x16d0c4[_0x3916d8];return _0x173361;}export class SegmentPullCommand extends BaseCommand{[a28_0x3e9182(0xb0)]=a28_0x3e9182(0xb7);['description']=a28_0x3e9182(0xc1);async[a28_0x3e9182(0xba)](_0x22c754){const _0x43cf1d=a28_0x3e9182,{options:_0x36635f,args:_0x3b418c,tdx:_0x2b3cb4}=_0x22c754,_0x271d0f=_0x36635f,_0x3de353=await resolveTarget({'arg':_0x3b418c[0x0],'contextParent':_0x36635f[_0x43cf1d(0xaf)],'cwd':process[_0x43cf1d(0xb3)]()});if(!isSuccessfulResolution(_0x3de353))return _0x3de353[_0x43cf1d(0x80)]===_0x43cf1d(0xb8)?(console['error'](a28_0x3605e8[_0x43cf1d(0x7d)](_0x43cf1d(0x98))),console[_0x43cf1d(0x9e)](_0x43cf1d(0xa1)),console[_0x43cf1d(0x9e)](_0x43cf1d(0x94)),console[_0x43cf1d(0x9e)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console[_0x43cf1d(0x9e)](a28_0x3605e8[_0x43cf1d(0xbf)]('Error:\x20'+_0x3de353['message']+'\x0a')),_0x3de353[_0x43cf1d(0xb1)]&&console[_0x43cf1d(0x9e)](a28_0x3605e8[_0x43cf1d(0xa2)](_0x3de353['helpText']))),0x1;const _0x5d4d66=_0x3de353['parentName'],_0x4701f4=_0x3de353[_0x43cf1d(0xc0)];_0x271d0f[_0x43cf1d(0xb9)]&&(console[_0x43cf1d(0x9e)](_0x43cf1d(0x9a)+_0x271d0f[_0x43cf1d(0x92)]),console[_0x43cf1d(0x9e)](_0x43cf1d(0xa3)+_0x5d4d66));const _0x285f80=await withProgressSpinner(_0x43cf1d(0x84)+_0x5d4d66+'\x27...',_0x296f8a=>_0x2b3cb4[_0x43cf1d(0x96)][_0x43cf1d(0x87)](_0x5d4d66,{'targetDir':_0x4701f4,'verbose':_0x271d0f[_0x43cf1d(0xb9)],'progress':{'update':_0x1a8f66=>{const _0x1198e5=_0x43cf1d;_0x296f8a[_0x1198e5(0x8b)](_0x1a8f66),_0x271d0f[_0x1198e5(0xb9)]&&console[_0x1198e5(0x9e)]('\x20\x20'+_0x1a8f66);}}}),{'verbose':_0x271d0f['verbose']}),_0x32c18f=_0x285f80['data'];if(_0x32c18f[_0x43cf1d(0xa7)][_0x43cf1d(0xc2)]===0x0&&_0x32c18f['counts']['journeys']===0x0)return console[_0x43cf1d(0x9e)](a28_0x3605e8[_0x43cf1d(0x7d)](_0x43cf1d(0xc4)+_0x32c18f['parentName']+'\x27')),0x0;const _0x29f7df=_0x32c18f[_0x43cf1d(0xa5)][_0x43cf1d(0x85)](_0x27da44=>_0x27da44[_0x43cf1d(0x93)]),_0x1e0b9d=_0x32c18f['files'][_0x43cf1d(0x85)](_0x5342a8=>!_0x5342a8['isNew']&&_0x5342a8[_0x43cf1d(0xb4)]),_0x2c533d=_0x32c18f['files']['filter'](_0x44b7b1=>!_0x44b7b1[_0x43cf1d(0x93)]&&!_0x44b7b1[_0x43cf1d(0xb4)]);console[_0x43cf1d(0x9e)](_0x43cf1d(0x7f)+_0x32c18f[_0x43cf1d(0xac)]+'\x27:'),console[_0x43cf1d(0x9e)]('\x20\x20🎯\x20'+a28_0x3605e8[_0x43cf1d(0xa2)](_0x32c18f[_0x43cf1d(0xa7)][_0x43cf1d(0xc2)]+_0x43cf1d(0x91))+_0x43cf1d(0xb6)+a28_0x3605e8[_0x43cf1d(0xa2)](_0x32c18f[_0x43cf1d(0xa7)][_0x43cf1d(0x8a)]+_0x43cf1d(0x7e)));if(_0x32c18f[_0x43cf1d(0xa7)][_0x43cf1d(0xbb)]>0x0){const _0x5927e9=_0x32c18f[_0x43cf1d(0xa7)][_0x43cf1d(0xb5)]>_0x32c18f[_0x43cf1d(0xa7)][_0x43cf1d(0xbb)]?'\x20('+_0x32c18f['counts'][_0x43cf1d(0xb5)]+_0x43cf1d(0xa4):'';console[_0x43cf1d(0x9e)](_0x43cf1d(0x88)+a28_0x3605e8[_0x43cf1d(0xa2)](_0x32c18f['counts']['journeys']+_0x43cf1d(0x95))+a28_0x3605e8[_0x43cf1d(0x90)](_0x5927e9));}console[_0x43cf1d(0x9e)]('\x20\x20'+a28_0x3605e8['green']('+\x20'+_0x29f7df[_0x43cf1d(0x78)]+_0x43cf1d(0xbc))),console['error']('\x20\x20'+a28_0x3605e8['yellow']('~\x20'+_0x1e0b9d[_0x43cf1d(0x78)]+'\x20changed\x20files')),console[_0x43cf1d(0x9e)]('\x20\x20'+a28_0x3605e8['dim']('=\x20'+_0x2c533d[_0x43cf1d(0x78)]+'\x20unchanged\x20files')),console[_0x43cf1d(0x9e)](_0x43cf1d(0xa8)+a28_0x3605e8[_0x43cf1d(0xa2)](_0x32c18f[_0x43cf1d(0xc0)])+'\x0a');if(_0x1e0b9d[_0x43cf1d(0x78)]>0x0)for(const _0xfa0e0a of _0x1e0b9d){console[_0x43cf1d(0x9e)](_0x43cf1d(0x8c)+_0xfa0e0a[_0x43cf1d(0x79)]+'\x27:'),console[_0x43cf1d(0x9e)]('─'[_0x43cf1d(0xbe)](0x3c)),console['error'](_0xfa0e0a[_0x43cf1d(0x81)]),console[_0x43cf1d(0x9e)]('─'['repeat'](0x3c));}if(_0x271d0f[_0x43cf1d(0x9d)])return console['error'](a28_0x3605e8[_0x43cf1d(0x7d)](_0x43cf1d(0x7b))),0x0;if(_0x29f7df[_0x43cf1d(0x78)]===0x0&&_0x1e0b9d[_0x43cf1d(0x78)]===0x0)return console[_0x43cf1d(0x9e)](a28_0x3605e8[_0x43cf1d(0xbd)](_0x43cf1d(0x82))),saveSessionContext({'parent_segment':_0x32c18f['parentName']},_0x271d0f[_0x43cf1d(0x99)]),console[_0x43cf1d(0x9e)](a28_0x3605e8[_0x43cf1d(0xbd)](_0x43cf1d(0x9b)+a28_0x3605e8['dim']('parent_segment')+_0x43cf1d(0xa9)+a28_0x3605e8[_0x43cf1d(0xa2)](_0x32c18f[_0x43cf1d(0xac)]))),0x0;if(!_0x271d0f[_0x43cf1d(0xa0)]){const _0x248a6c=await confirmKey(_0x43cf1d(0x7a)+(_0x29f7df[_0x43cf1d(0x78)]+_0x1e0b9d['length'])+_0x43cf1d(0x8e));if(!_0x248a6c)return console[_0x43cf1d(0x9e)](_0x43cf1d(0xab)),0x1;}for(const _0x1bf64b of _0x32c18f['files']){if(_0x1bf64b[_0x43cf1d(0x93)]||_0x1bf64b[_0x43cf1d(0xb4)]){const _0x127a19=a28_0x342755[_0x43cf1d(0x83)](_0x1bf64b[_0x43cf1d(0x77)]);!existsSync(_0x127a19)&&mkdirSync(_0x127a19,{'recursive':!![]}),writeFileSync(_0x1bf64b['absolutePath'],_0x1bf64b['content'],_0x43cf1d(0xad));}}return console[_0x43cf1d(0x9e)](a28_0x3605e8[_0x43cf1d(0xbd)](_0x43cf1d(0x8f)+(_0x29f7df['length']+_0x1e0b9d['length'])+_0x43cf1d(0xc3)+_0x32c18f['targetDir'])),saveSessionContext({'parent_segment':_0x32c18f[_0x43cf1d(0xac)]},_0x271d0f[_0x43cf1d(0x99)]),console[_0x43cf1d(0x9e)](a28_0x3605e8[_0x43cf1d(0xbd)](_0x43cf1d(0x9b)+a28_0x3605e8[_0x43cf1d(0x90)](_0x43cf1d(0xae))+'\x20=\x20'+a28_0x3605e8[_0x43cf1d(0xa2)](_0x32c18f[_0x43cf1d(0xac)]))),0x0;}}function a28_0x16d0(){const _0x52b006=['error','93205zbbJUb','yes','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)','cyan','Parent\x20segment:\x20','\x20versions)','files','75PWjIHU','counts','\x20\x20Target:\x20','\x20=\x20','657131UmEhcS','Aborted.','parentName','utf-8','parent_segment','parentSegment','name','helpText','513477MXGrTH','cwd','hasChanges','journeyVersions','\x20with\x20','segment:pull','no_parent','verbose','execute','journeys','\x20new\x20files','green','repeat','red','targetDir','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','segments','\x20files\x20to\x20','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','393644QjOeSv','absolutePath','length','relativePath','Write\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','72yVJfhP','yellow','\x20activations','\x0aPull\x20summary\x20for\x20\x27','errorCode','diff','✔\x20All\x20files\x20are\x20up\x20to\x20date','dirname','Pulling\x20segments\x20from\x20\x27','filter','2155310mJQhan','pullSegments','\x20\x20🗺️\x20\x20','6IPdoSi','activations','setPhase','\x0aChanges\x20to\x20\x27','11wCOAoX','\x20files?','✔\x20Pulled\x20','dim','\x20segments','site','isNew','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20journeys','segment','1651294LWqrTe','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','session','Site:\x20','✔\x20Context\x20set:\x20','1363782ivKAol','dryRun'];a28_0x16d0=function(){return _0x52b006;};return a28_0x16d0();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a29_0x1d6f4d=a29_0x3b91;(function(_0x5bf461,_0x4012d1){const _0x1cd15c=a29_0x3b91,_0x1c6da0=_0x5bf461();while(!![]){try{const _0x299cb1=parseInt(_0x1cd15c(0xfd))/0x1*(-parseInt(_0x1cd15c(0xf5))/0x2)+parseInt(_0x1cd15c(0x10c))/0x3*(-parseInt(_0x1cd15c(0xfe))/0x4)+parseInt(_0x1cd15c(0xfb))/0x5+parseInt(_0x1cd15c(0x16c))/0x6*(-parseInt(_0x1cd15c(0xff))/0x7)+-parseInt(_0x1cd15c(0x104))/0x8+parseInt(_0x1cd15c(0xf4))/0x9*(-parseInt(_0x1cd15c(0xe3))/0xa)+parseInt(_0x1cd15c(0x135))/0xb*(parseInt(_0x1cd15c(0x167))/0xc);if(_0x299cb1===_0x4012d1)break;else _0x1c6da0['push'](_0x1c6da0['shift']());}catch(_0x2535d2){_0x1c6da0['push'](_0x1c6da0['shift']());}}}(a29_0x501c,0x8a62e));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a29_0x3b91(_0x37c75b,_0x5c3fa1){_0x37c75b=_0x37c75b-0xd5;const _0x501c59=a29_0x501c();let _0x3b918c=_0x501c59[_0x37c75b];return _0x3b918c;}import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x2028c8 from'chalk';import{existsSync}from'fs';function a29_0x501c(){const _0x48b2a9=['updated','segments','\x20changed','yellow','Aborted.','getJourney','36QpNVdb','📁\x20','/j/da/je','cyan','/app/ps/','4878660cOYeQR','verbose','targetDir','getParent','deleted','scopedFolderPath','red','Delete\x20journey:','existingJourney','isScoped','length','audienceId','Folders\x20to\x20create:','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','list','attributes','state','user','green','map','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)','push','10yDcGOQ','Fetching\x20existing\x20journeys...','\x20created','created','\x20\x20📊\x20Segments:','\x20activations]','Resolving\x20parent\x20segment\x20\x27','name','Fetching\x20connections\x20for\x20name\x20resolution...','folderId','.yaml','Error\x20parsing\x20YAML:\x20','parentFolder','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','paused','segment','\x20unchanged','9324837KaiFzZ','8uFWOAY','file','relationships','journeyBundleName','versionNumber','yes','577190VoxMsw','filePath','100690kZVtpN','1311752wjORjy','7LtTAZg','toCreate','listActivations','parent_name','toUpdate','4947592ZvStyo','get','join','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','Delete\x20segment:','no_parent','\x0aValidation\x20failed:','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','9TSOcYt','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','new','journeysOnly','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20changes?','journeys','listFolders','Preparing\x20journeys...','filter','connection','updatedAt','dim','\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\x20parent\x20segment\x20details...','Source\x20directory:\x20','No\x20','site','\x20to\x20delete','toString','listSegments','Error:\x20','.yml','\x27...','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','idToName','data','activations','New\x20segment:','cwd','dryRun','errorCode','Fetching\x20existing\x20activations...','description','nameToId','\x20YAML\x20files\x20found','diff','\x20\x20Journeys:\x20','set','type','changed','15787266DpTUIw','journeyId','message','\x20to\x20update','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20new','Parent\x20segment:\x20','parentSegment','\x20to\x20create','execute','delete','\x20folders\x20to\x20create','segmentFolderId','folders','blue','helpText','Push\x20','\x20updated','results','/e/','Error:\x20Directory\x20not\x20found:\x20','folderPath','all','toDelete','error','\x0a✔\x20Push\x20complete','setPhase','yamlConfig','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','isNew','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Changes\x20to:','\x20\x20Activations:','\x20\x20Segments:\x20','unchanged','journey','\x20\x20\x20\x20','then','Changes\x20to\x20journey:','listJourneysWithDetailsFromParentSegment','\x20\x20Activations:\x20','\x20deleted','segment\x20or\x20journey','repeat'];a29_0x501c=function(){return _0x48b2a9;};return a29_0x501c();}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';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']='segment:push';[a29_0x1d6f4d(0x12d)]=a29_0x1d6f4d(0x153);async[a29_0x1d6f4d(0x13e)](_0x25a124){const _0x492f60=a29_0x1d6f4d,{options:_0x37018f,args:_0x129e3e,tdx:_0x50cccb}=_0x25a124,_0x35b8ff=_0x37018f,_0x243e46=await resolveTarget({'arg':_0x129e3e[0x0],'contextParent':_0x37018f[_0x492f60(0x13c)],'cwd':process[_0x492f60(0x129)]()});if(!isSuccessfulResolution(_0x243e46))return _0x243e46[_0x492f60(0x12b)]===_0x492f60(0x109)?(console['error'](a29_0x2028c8[_0x492f60(0x164)](_0x492f60(0x107))),console['error'](_0x492f60(0xe1)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x492f60(0x14d)](_0x492f60(0x119))):(console[_0x492f60(0x14d)](a29_0x2028c8[_0x492f60(0x172)](_0x492f60(0x121)+_0x243e46['message']+'\x0a')),_0x243e46[_0x492f60(0x144)]&&console[_0x492f60(0x14d)](a29_0x2028c8[_0x492f60(0x16a)](_0x243e46[_0x492f60(0x144)]))),0x1;if(_0x243e46['type']===_0x492f60(0x102))return console[_0x492f60(0x14d)](a29_0x2028c8['red'](_0x492f60(0x149)+_0x243e46[_0x492f60(0x16e)]+'\x0a')),console[_0x492f60(0x14d)](a29_0x2028c8[_0x492f60(0x16a)](_0x492f60(0xf0))),0x1;const _0x4faf0a=_0x243e46['parentName'],_0x2efe3b=_0x243e46['targetDir'],_0x319d3c=_0x243e46[_0x492f60(0x133)]===_0x492f60(0xf6)?_0x243e46[_0x492f60(0xfc)]:undefined,_0x402a4a=getScopedDetails(_0x243e46),_0x27e136=_0x402a4a?.[_0x492f60(0xd6)]??![],_0x209355=_0x402a4a?.[_0x492f60(0x171)]??'';if(!existsSync(_0x2efe3b))return console['error'](a29_0x2028c8['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x2efe3b+'\x0a')),console[_0x492f60(0x14d)](a29_0x2028c8['cyan'](_0x492f60(0xf0))),0x1;_0x35b8ff[_0x492f60(0x16d)]&&(console[_0x492f60(0x14d)]('Site:\x20'+_0x35b8ff[_0x492f60(0x11d)]),console['error'](_0x492f60(0x13b)+_0x4faf0a),console[_0x492f60(0x14d)](_0x492f60(0x11b)+_0x2efe3b),_0x27e136&&console[_0x492f60(0x14d)]('Scoped\x20to\x20folder:\x20'+_0x209355));const _0x1079bb=await withSpinner(_0x492f60(0xe9)+_0x4faf0a+_0x492f60(0x123),()=>_0x50cccb[_0x492f60(0xf2)]['resolveParentId'](_0x4faf0a),{'verbose':_0x35b8ff[_0x492f60(0x16d)]}),_0x56bb69=_0x1079bb['data'],[_0x146d13,_0xca46e2,_0x29db1e,_0x274365,_0x1fd654]=await Promise[_0x492f60(0x14b)]([withSpinner(_0x492f60(0x11a),()=>_0x50cccb['segment'][_0x492f60(0x16f)](_0x56bb69),{'verbose':_0x35b8ff[_0x492f60(0x16d)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x50cccb[_0x492f60(0xf2)][_0x492f60(0x120)](_0x56bb69),{'verbose':_0x35b8ff[_0x492f60(0x16d)]}),withSpinner('Fetching\x20existing\x20folders...',()=>_0x50cccb[_0x492f60(0xf2)][_0x492f60(0x113)](_0x56bb69),{'verbose':_0x35b8ff[_0x492f60(0x16d)]}),withSpinner(_0x492f60(0xe4),()=>_0x50cccb['journey'][_0x492f60(0x15c)](_0x56bb69),{'verbose':_0x35b8ff['verbose']}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x50cccb['user']['buildUserMaps'](),{'verbose':_0x35b8ff[_0x492f60(0x16d)]})[_0x492f60(0x15a)](_0x594681=>_0x594681['data'])]),_0x451e54=_0x146d13[_0x492f60(0x126)],_0x295548=extractRootFolderId(_0x451e54),_0x462117=_0xca46e2[_0x492f60(0x126)],_0x388d96=_0x29db1e[_0x492f60(0x126)],{journeys:_0x5d6356,activationStepsById:_0x362b6c}=_0x274365[_0x492f60(0x126)],_0x2bd04c=new Map(_0x5d6356['map'](_0x40b9f1=>[_0x40b9f1['id'],_0x40b9f1])),_0x2f1155=_0x5d6356[_0x492f60(0xe0)](_0x26be4e=>({'id':_0x26be4e['id'],'name':_0x26be4e[_0x492f60(0xdc)][_0x492f60(0xea)],'journeyBundleName':_0x26be4e[_0x492f60(0xdc)][_0x492f60(0xf8)]||'','journeyBundleId':_0x26be4e[_0x492f60(0xdc)]['journeyBundleId']||'','versionNumber':_0x26be4e['attributes'][_0x492f60(0xf9)],'description':_0x26be4e[_0x492f60(0xdc)][_0x492f60(0x12d)],'state':_0x26be4e[_0x492f60(0xdc)][_0x492f60(0xdd)],'paused':_0x26be4e['attributes'][_0x492f60(0xf1)],'audienceId':_0x26be4e[_0x492f60(0xdc)][_0x492f60(0xd8)],'folderId':_0x26be4e[_0x492f60(0xf7)]?.[_0x492f60(0xef)]?.[_0x492f60(0x126)]?.['id'],'createdAt':_0x26be4e[_0x492f60(0xdc)]['createdAt'],'updatedAt':_0x26be4e[_0x492f60(0xdc)][_0x492f60(0x117)]})),{emailToId:_0x56de51,idToEmail:_0x35c743}=_0x1fd654,_0x193e7d=await withSpinner(_0x492f60(0xeb),async()=>{const _0x3cad44=_0x492f60,_0x1149b6=await _0x50cccb['connection'][_0x3cad44(0xdb)]();return buildConnectionMaps(_0x1149b6);},{'verbose':_0x35b8ff[_0x492f60(0x16d)]})[_0x492f60(0x15a)](_0x22cbb3=>_0x22cbb3['data']),_0x3b8bd4=_0x193e7d[_0x492f60(0x12e)],_0x4daa4c=_0x193e7d[_0x492f60(0x125)],_0x3cd568=_0x193e7d['nameToType'],_0x10088c={'emailToIdMap':_0x56de51,'connectionNameToIdMap':_0x3b8bd4,'connectionNameToTypeMap':_0x3cd568,'getSchema':_0xb71c8e=>_0x50cccb['connection']['getOutputSchemaWithCache'](_0xb71c8e)};let {pathToId:_0x3c00bf,idToPath:_0xd93894}=buildFolderMaps(_0x388d96);const _0x516bbf=buildSegmentLookupMap(_0x462117,_0xd93894),_0xe1dad7=buildSegmentNameToIdMap(_0x462117),_0x4f5f42=buildJourneyBundleLookupMap(_0x2f1155,_0xd93894);let _0x5c7b07;if(_0x319d3c){if(!_0x319d3c['endsWith'](_0x492f60(0x122))&&!_0x319d3c['endsWith'](_0x492f60(0xed)))return console[_0x492f60(0x14d)](a29_0x2028c8[_0x492f60(0x172)](_0x492f60(0x151)+_0x319d3c+'\x0a')),0x1;_0x5c7b07=[_0x319d3c];}else _0x5c7b07=findYamlFiles(_0x2efe3b);if(_0x5c7b07[_0x492f60(0xd7)]===0x0)return console[_0x492f60(0x14d)](a29_0x2028c8[_0x492f60(0x172)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x2efe3b+'\x0a')),console['error'](a29_0x2028c8[_0x492f60(0x16a)](_0x492f60(0x10b))),0x1;let _0x49c26d,_0x4d34d8;try{const _0x41dca1=parseAndClassifyYamlFiles(_0x5c7b07,_0x2efe3b,{'skipSegments':_0x35b8ff['journeysOnly']});_0x49c26d=_0x41dca1[_0x492f60(0x162)],_0x4d34d8=_0x41dca1[_0x492f60(0x112)];const _0x5e4392=validateParsedFiles(_0x41dca1,_0x2efe3b);if(_0x5e4392[_0x492f60(0xd7)]>0x0)return console[_0x492f60(0x14d)](a29_0x2028c8[_0x492f60(0x172)](_0x492f60(0x10a))),console[_0x492f60(0x14d)](formatValidationErrors(_0x5e4392)),console[_0x492f60(0x14d)](a29_0x2028c8[_0x492f60(0x164)](_0x492f60(0x10d))),0x1;}catch(_0x398e3e){return console[_0x492f60(0x14d)](a29_0x2028c8['red'](_0x492f60(0xee)+(_0x398e3e instanceof Error?_0x398e3e[_0x492f60(0x137)]:_0x398e3e))),0x1;}if(_0x49c26d[_0x492f60(0xd7)]===0x0&&_0x4d34d8[_0x492f60(0xd7)]===0x0){const _0x424a49=_0x35b8ff[_0x492f60(0x10f)]?'journey':_0x492f60(0x15f);return console['error'](a29_0x2028c8[_0x492f60(0x164)](_0x492f60(0x11c)+_0x424a49+_0x492f60(0x12f))),0x0;}const _0x1515d2=new Map();_0x462117[_0x492f60(0xd7)]>0x0&&!_0x35b8ff[_0x492f60(0x10f)]&&await withSpinner(_0x492f60(0x12c),async()=>{await batchAsync(_0x462117,async _0x21cf19=>{const _0x45cfec=a29_0x3b91,_0x1f0e40=await _0x50cccb[_0x45cfec(0xf2)][_0x45cfec(0x101)](_0x56bb69,_0x21cf19['id']);_0x1515d2[_0x45cfec(0x132)](_0x21cf19['id'],_0x1f0e40);});},{'verbose':_0x35b8ff['verbose']});const {segmentFiles:_0xade78e,foldersToCreate:_0x509a14}=await prepareSegmentFiles(_0x49c26d,{'segmentByFolderAndName':_0x516bbf,'activationsBySegmentId':_0x1515d2,'folderPathToId':_0x3c00bf,'idToEmailMap':_0x35c743,'connectionIdToNameMap':_0x4daa4c},_0x10088c,_0x27e136,_0x209355),_0x5ecc6d=_0x319d3c?[]:findSegmentsToDelete(_0x462117,_0x49c26d[_0x492f60(0xe0)](({yamlConfig:_0xd4f418,folderPath:_0x35e935})=>({'yamlConfig':_0xd4f418,'folderPath':resolveTDFolderPath(_0x35e935,_0x27e136,_0x209355)})),_0xd93894,_0x209355,_0x27e136),{journeyFiles:_0x298512,foldersToCreate:_0x2b5535}=await withProgressSpinner(_0x492f60(0x114),async _0xecb6de=>prepareJourneyFiles(_0x4d34d8,{'fetchJourney':async _0x466ecf=>_0x50cccb[_0x492f60(0x158)][_0x492f60(0x166)](_0x466ecf[_0x492f60(0x136)]),'journeyBundlesByFolderAndName':_0x4f5f42,'folderPathToId':_0x3c00bf,'idToEmailMap':_0x35c743,'connectionIdToNameMap':_0x4daa4c,'existingSegments':_0x462117,'parentId':_0x56bb69,'deps':_0x50cccb,'progress':{'update':_0x37152c=>{const _0xb01103=_0x492f60;_0xecb6de[_0xb01103(0x14f)](_0x37152c),_0x35b8ff[_0xb01103(0x16d)]&&console['error']('\x20\x20'+_0x37152c);}},'journeyById':_0x2bd04c,'activationStepsById':_0x362b6c},_0x27e136,_0x209355),{'verbose':_0x35b8ff[_0x492f60(0x16d)]})[_0x492f60(0x15a)](_0x6daca3=>_0x6daca3['data']);for(const _0x1e5d6c of _0x2b5535){_0x509a14['add'](_0x1e5d6c);}const _0x277963=_0x319d3c?[]:findJourneysToDelete(_0x2f1155,_0x4d34d8[_0x492f60(0xe0)](({yamlConfig:_0x56f913,folderPath:_0x339101})=>({'yamlConfig':_0x56f913,'folderPath':resolveTDFolderPath(_0x339101,_0x27e136,_0x209355)})),_0xd93894,_0x209355,_0x27e136),_0x4bebad=calculatePushStats(_0xade78e,_0x298512,_0x509a14,_0x5ecc6d,_0x277963,!!_0x35b8ff[_0x492f60(0x13f)],!!_0x35b8ff[_0x492f60(0x10f)]),_0x3e0636=_0x4bebad['segments'][_0x492f60(0x10e)],_0x22b3df=_0x4bebad[_0x492f60(0x162)]['changed'],_0x4257b4=_0x4bebad['segments'][_0x492f60(0x157)],_0x5ea866=_0x4bebad[_0x492f60(0x162)][_0x492f60(0x14c)],_0x4773a7=_0x4bebad[_0x492f60(0x142)][_0x492f60(0x100)],_0x15ba81=_0x4bebad[_0x492f60(0x112)][_0x492f60(0x10e)],_0x48e00d=_0x4bebad[_0x492f60(0x112)][_0x492f60(0x134)],_0x4029a5=_0x4bebad[_0x492f60(0x112)][_0x492f60(0x157)],_0x272d42=_0x4bebad['journeys'][_0x492f60(0x14c)],_0x65d64d=_0x4bebad[_0x492f60(0x127)][_0x492f60(0x14b)],_0x4a5c05=_0x4bebad[_0x492f60(0x127)][_0x492f60(0x100)],_0x284ce1=_0x4bebad['activations'][_0x492f60(0x103)],_0x25f722=_0x4bebad[_0x492f60(0x127)][_0x492f60(0x14c)];console[_0x492f60(0x14d)]('\x0aPush\x20summary\x20for\x20\x27'+_0x4faf0a+'\x27:');_0x4773a7['length']>0x0&&console[_0x492f60(0x14d)]('\x20\x20'+a29_0x2028c8[_0x492f60(0x143)](_0x492f60(0x168)+_0x4773a7[_0x492f60(0xd7)]+_0x492f60(0x140)));if(!_0x35b8ff[_0x492f60(0x10f)]){console['error'](_0x492f60(0xe7)),console[_0x492f60(0x14d)]('\x20\x20\x20\x20'+a29_0x2028c8[_0x492f60(0xdf)]('+\x20'+_0x3e0636[_0x492f60(0xd7)]+'\x20new')),console[_0x492f60(0x14d)](_0x492f60(0x159)+a29_0x2028c8[_0x492f60(0x164)]('~\x20'+_0x22b3df[_0x492f60(0xd7)]+'\x20changed'));if(_0x5ea866[_0x492f60(0xd7)]>0x0)console[_0x492f60(0x14d)](_0x492f60(0x159)+a29_0x2028c8[_0x492f60(0x172)]('-\x20'+_0x5ea866[_0x492f60(0xd7)]+_0x492f60(0x11e)));else _0x5ecc6d[_0x492f60(0xd7)]>0x0&&!_0x35b8ff['delete']&&console[_0x492f60(0x14d)]('\x20\x20\x20\x20'+a29_0x2028c8[_0x492f60(0x118)](_0x5ecc6d['length']+_0x492f60(0x139)));console[_0x492f60(0x14d)](_0x492f60(0x159)+a29_0x2028c8[_0x492f60(0x118)]('=\x20'+_0x4257b4['length']+_0x492f60(0xf3)));}if(_0x298512['length']>0x0||_0x277963[_0x492f60(0xd7)]>0x0){console[_0x492f60(0x14d)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x492f60(0x14d)](_0x492f60(0x159)+a29_0x2028c8[_0x492f60(0xdf)]('+\x20'+_0x15ba81['length']+_0x492f60(0x13a))),console['error'](_0x492f60(0x159)+a29_0x2028c8[_0x492f60(0x164)]('~\x20'+_0x48e00d['length']+_0x492f60(0x163)));if(_0x272d42[_0x492f60(0xd7)]>0x0)console[_0x492f60(0x14d)](_0x492f60(0x159)+a29_0x2028c8[_0x492f60(0x172)]('-\x20'+_0x272d42[_0x492f60(0xd7)]+_0x492f60(0x11e)));else _0x277963[_0x492f60(0xd7)]>0x0&&!_0x35b8ff[_0x492f60(0x13f)]&&console['error'](_0x492f60(0x159)+a29_0x2028c8[_0x492f60(0x118)](_0x277963[_0x492f60(0xd7)]+_0x492f60(0x139)));console['error']('\x20\x20\x20\x20'+a29_0x2028c8[_0x492f60(0x118)]('=\x20'+_0x4029a5[_0x492f60(0xd7)]+_0x492f60(0xf3)));}_0x65d64d[_0x492f60(0xd7)]>0x0&&!_0x35b8ff['journeysOnly']&&(console[_0x492f60(0x14d)](''),console[_0x492f60(0x14d)](_0x492f60(0x155)),_0x4a5c05[_0x492f60(0xd7)]>0x0&&console[_0x492f60(0x14d)](_0x492f60(0x159)+a29_0x2028c8[_0x492f60(0xdf)]('+\x20'+_0x4a5c05[_0x492f60(0xd7)]+_0x492f60(0x13d))),_0x284ce1[_0x492f60(0xd7)]>0x0&&console['error'](_0x492f60(0x159)+a29_0x2028c8[_0x492f60(0x164)]('~\x20'+_0x284ce1['length']+_0x492f60(0x138))),_0x25f722['length']>0x0&&console[_0x492f60(0x14d)](_0x492f60(0x159)+a29_0x2028c8[_0x492f60(0x172)]('-\x20'+_0x25f722[_0x492f60(0xd7)]+_0x492f60(0x11e))));console[_0x492f60(0x14d)]('\x20\x20Source:\x20'+a29_0x2028c8[_0x492f60(0x16a)](_0x2efe3b)+'\x0a');if(_0x4773a7['length']>0x0){console['error'](_0x492f60(0xd9));for(const _0x56d959 of _0x4773a7){console[_0x492f60(0x14d)]('\x20\x20'+a29_0x2028c8[_0x492f60(0x143)]('+')+'\x20'+_0x56d959);}console[_0x492f60(0x14d)]('');}if(_0x3e0636[_0x492f60(0xd7)]>0x0&&!_0x35b8ff['journeysOnly'])for(const _0x1d3a46 of _0x3e0636){const _0x2ff341=_0x1d3a46[_0x492f60(0x14a)]?_0x1d3a46[_0x492f60(0x14a)]+'/'+_0x1d3a46['yamlConfig'][_0x492f60(0xea)]:_0x1d3a46[_0x492f60(0x150)][_0x492f60(0xea)],_0xf2d8da=_0x1d3a46[_0x492f60(0x150)][_0x492f60(0x127)]?.[_0x492f60(0xd7)]||0x0,_0x15b169=_0xf2d8da>0x0?a29_0x2028c8['dim']('\x20['+_0xf2d8da+'\x20activations]'):'';console[_0x492f60(0x14d)]('\x0a'+a29_0x2028c8[_0x492f60(0xdf)](_0x492f60(0x128))+'\x20'+_0x2ff341+_0x15b169),console[_0x492f60(0x14d)]('─'['repeat'](0x3c)),_0x1d3a46[_0x492f60(0x130)]&&console[_0x492f60(0x14d)](_0x1d3a46['diff']),console[_0x492f60(0x14d)]('─'[_0x492f60(0x160)](0x3c));}if(_0x5ea866[_0x492f60(0xd7)]>0x0&&!_0x35b8ff[_0x492f60(0x10f)])for(const _0x1bb1fd of _0x5ea866){const _0x2afecb=_0x1bb1fd[_0x492f60(0x141)]?_0xd93894[_0x492f60(0x105)](_0x1bb1fd[_0x492f60(0x141)][_0x492f60(0x11f)]())||'':'',_0x207362=_0x2afecb?_0x2afecb+'/'+_0x1bb1fd[_0x492f60(0xea)]:_0x1bb1fd['name'],_0x2b7ef3=_0x1515d2[_0x492f60(0x105)](_0x1bb1fd['id'])||[],_0x37eb3a=_0x2b7ef3[_0x492f60(0xd7)]>0x0?a29_0x2028c8[_0x492f60(0x118)]('\x20['+_0x2b7ef3[_0x492f60(0xd7)]+_0x492f60(0xe8)):'';console['error']('\x0a'+a29_0x2028c8['red'](_0x492f60(0x108))+'\x20'+_0x207362+_0x37eb3a),console[_0x492f60(0x14d)]('─'[_0x492f60(0x160)](0x3c));const _0x18e8b5=segmentWithActivationsToYaml(_0x1bb1fd,_0x2b7ef3,undefined,_0x35c743,_0x4daa4c),_0xc7f83b=segmentToYamlString(_0x18e8b5),_0xca14f6=generateDiff(_0xc7f83b,'');console[_0x492f60(0x14d)](formatDiffWithColors(_0xca14f6)),console['error']('─'['repeat'](0x3c));}const _0xb7bc82=_0xade78e[_0x492f60(0x115)](_0x255f3d=>!_0x255f3d['isNew']&&_0x255f3d[_0x492f60(0x130)]);if(_0xb7bc82[_0x492f60(0xd7)]>0x0&&!_0x35b8ff[_0x492f60(0x10f)])for(const _0x5c0f73 of _0xb7bc82){const _0x3c5cf6=_0x5c0f73[_0x492f60(0x14a)]?_0x5c0f73['folderPath']+'/'+_0x5c0f73[_0x492f60(0x150)][_0x492f60(0xea)]:_0x5c0f73['yamlConfig'][_0x492f60(0xea)];console['error']('\x0a'+a29_0x2028c8[_0x492f60(0x164)](_0x492f60(0x154))+'\x20'+_0x3c5cf6),console[_0x492f60(0x14d)]('─'[_0x492f60(0x160)](0x3c)),console[_0x492f60(0x14d)](_0x5c0f73[_0x492f60(0x130)]),console[_0x492f60(0x14d)]('─'['repeat'](0x3c));}if(_0x15ba81[_0x492f60(0xd7)]>0x0)for(const _0x145958 of _0x15ba81){const _0x1ce4ae=_0x145958[_0x492f60(0x14a)]?_0x145958[_0x492f60(0x14a)]+'/'+_0x145958['yamlConfig'][_0x492f60(0xea)]:_0x145958[_0x492f60(0x150)]['name'];console['error']('\x0a'+a29_0x2028c8[_0x492f60(0xdf)]('New\x20journey:')+'\x20'+_0x1ce4ae),console[_0x492f60(0x14d)]('─'[_0x492f60(0x160)](0x3c)),_0x145958[_0x492f60(0x130)]&&console[_0x492f60(0x14d)](_0x145958[_0x492f60(0x130)]),console[_0x492f60(0x14d)]('─'[_0x492f60(0x160)](0x3c));}const _0x11c54d=_0x298512[_0x492f60(0x115)](_0x2e10b6=>!_0x2e10b6[_0x492f60(0x152)]&&_0x2e10b6['diff']);if(_0x11c54d['length']>0x0)for(const _0x1a1b0f of _0x11c54d){const _0x262a0d=_0x1a1b0f[_0x492f60(0x14a)]?_0x1a1b0f['folderPath']+'/'+_0x1a1b0f[_0x492f60(0x150)][_0x492f60(0xea)]:_0x1a1b0f[_0x492f60(0x150)]['name'];console[_0x492f60(0x14d)]('\x0a'+a29_0x2028c8[_0x492f60(0x164)](_0x492f60(0x15b))+'\x20'+_0x262a0d),console['error']('─'['repeat'](0x3c)),console[_0x492f60(0x14d)](_0x1a1b0f[_0x492f60(0x130)]),console[_0x492f60(0x14d)]('─'['repeat'](0x3c));}if(_0x272d42['length']>0x0)for(const _0x101d45 of _0x272d42){const _0x11ae8f=_0x101d45[_0x492f60(0xec)]?_0xd93894[_0x492f60(0x105)](_0x101d45[_0x492f60(0xec)])||'':'',_0x48a9cb=_0x11ae8f?_0x11ae8f+'/'+_0x101d45[_0x492f60(0xf8)]:_0x101d45['journeyBundleName'];console[_0x492f60(0x14d)]('\x0a'+a29_0x2028c8[_0x492f60(0x172)](_0x492f60(0x173))+'\x20'+_0x48a9cb),console[_0x492f60(0x14d)]('─'[_0x492f60(0x160)](0x3c)),console[_0x492f60(0x14d)](a29_0x2028c8[_0x492f60(0x172)]('(Journey\x20will\x20be\x20deleted)')),console['error']('─'[_0x492f60(0x160)](0x3c));}if(_0x35b8ff[_0x492f60(0x12a)])return console['error'](a29_0x2028c8[_0x492f60(0x164)](_0x492f60(0x124))),0x0;const _0xe5ad8f=_0x35b8ff[_0x492f60(0x10f)]?![]:_0x3e0636['length']>0x0||_0x22b3df['length']>0x0||_0x5ea866[_0x492f60(0xd7)]>0x0,_0x562c24=_0x15ba81[_0x492f60(0xd7)]>0x0||_0x48e00d[_0x492f60(0xd7)]>0x0||_0x272d42[_0x492f60(0xd7)]>0x0,_0x779c81=_0x35b8ff[_0x492f60(0x10f)]?![]:_0x65d64d[_0x492f60(0xd7)]>0x0,_0x4426bf=_0x4773a7[_0x492f60(0xd7)]>0x0;if(!_0xe5ad8f&&!_0x562c24&&!_0x779c81&&!_0x4426bf){const _0x181f29=_0x35b8ff['journeysOnly']?_0x492f60(0xda):_0x492f60(0x110);console[_0x492f60(0x14d)](a29_0x2028c8[_0x492f60(0xdf)](_0x181f29));if(_0x319d3c&&_0x4029a5['length']===0x1){const _0x53ac3b=_0x4029a5[0x0];if(_0x53ac3b[_0x492f60(0xd5)]?.['id']){const _0x115f93=getConsoleNextUrl(_0x35b8ff[_0x492f60(0x11d)],_0x492f60(0x16b)+_0x56bb69+_0x492f60(0x148)+_0x53ac3b[_0x492f60(0xd5)]['id']+_0x492f60(0x169));console['error']('\x20\x20'+a29_0x2028c8[_0x492f60(0x16a)](_0x115f93));}}return 0x0;}const _0x276b14=_0x35b8ff[_0x492f60(0x10f)]?_0x15ba81[_0x492f60(0xd7)]+_0x48e00d[_0x492f60(0xd7)]+_0x272d42['length']+_0x4773a7[_0x492f60(0xd7)]:_0x3e0636['length']+_0x22b3df[_0x492f60(0xd7)]+_0x5ea866[_0x492f60(0xd7)]+_0x15ba81[_0x492f60(0xd7)]+_0x48e00d[_0x492f60(0xd7)]+_0x272d42['length']+_0x4773a7[_0x492f60(0xd7)]+_0x65d64d[_0x492f60(0xd7)];if(!_0x35b8ff[_0x492f60(0xfa)]&&_0x276b14>0x0){const _0x13026f=await confirmKey(_0x492f60(0x145)+_0x276b14+_0x492f60(0x111));if(!_0x13026f)return console[_0x492f60(0x14d)](_0x492f60(0x165)),0x1;}const _0x5f1df5={'withProgress':async(_0xe017cf,_0x252b35)=>{const _0x3a43a7=_0x492f60,_0x2e7962=await withSpinner(_0xe017cf,_0x252b35,{'verbose':_0x35b8ff[_0x3a43a7(0x16d)]});return{'data':_0x2e7962[_0x3a43a7(0x126)]};},'logInfo':_0x475dc8=>console[_0x492f60(0x14d)](a29_0x2028c8[_0x492f60(0x143)]('✔\x20'+_0x475dc8)),'logSuccess':_0x42b638=>console[_0x492f60(0x14d)](a29_0x2028c8['green']('✔\x20'+_0x42b638)),'logWarning':_0x126016=>console['error'](a29_0x2028c8[_0x492f60(0x164)]('⚠\x20'+_0x126016)),'logDeleted':_0x5363b3=>console['error'](a29_0x2028c8[_0x492f60(0x172)]('✔\x20'+_0x5363b3))},_0x88e782={'segment':_0x50cccb[_0x492f60(0xf2)],'journey':_0x50cccb[_0x492f60(0x158)],'user':_0x50cccb[_0x492f60(0xde)],'connection':_0x50cccb[_0x492f60(0x116)]};_0x4773a7['length']>0x0&&(_0x3c00bf=await executePushFolders(_0x88e782,_0x4773a7,_0x3c00bf,{'parentId':_0x56bb69},_0x5f1df5));const _0x1ff9e4={'rootFolderId':_0x295548,'folderPathToId':_0x3c00bf,'folderIdToPath':_0xd93894,'segmentNameToId':_0xe1dad7,'activationsBySegmentId':_0x1515d2,'emailToIdMap':_0x56de51,'idToEmailMap':_0x35c743,'connectionNameToIdMap':_0x193e7d['nameToId'],'connectionIdToNameMap':_0x193e7d['idToName'],'connectionNameToTypeMap':_0x3cd568},_0xd2bae0=await executePushSegments(_0x88e782,_0x35b8ff['journeysOnly']?[]:_0xade78e,_0x1ff9e4,{'parentId':_0x56bb69},_0x5f1df5),_0x586193=_0xd2bae0[_0x492f60(0xe6)],_0x5efb2f=_0xd2bae0[_0x492f60(0x161)],_0x17fe50=_0xd2bae0[_0x492f60(0x127)][_0x492f60(0xe6)],_0x3ba658=_0xd2bae0[_0x492f60(0x127)][_0x492f60(0x161)],_0x819822=_0xd2bae0[_0x492f60(0x127)][_0x492f60(0x170)],_0x1bcfaf=await executePushSegmentDeletions(_0x88e782,_0x35b8ff[_0x492f60(0x10f)]?[]:_0x5ea866,_0x5f1df5);let _0xdd8b72=0x0,_0x1cc254=0x0,_0x1a17ea=0x0;const _0x1c455c=new Map(_0xe1dad7);for(const [_0x4fd1d5,_0x38992c]of _0xd2bae0['createdSegmentIds']){_0x1c455c[_0x492f60(0x132)](_0x4fd1d5,_0x38992c);}if(_0x298512[_0x492f60(0xd7)]>0x0){const _0x28a0a4={..._0x1ff9e4,'segmentNameToId':_0x1c455c,'existingSegments':_0x462117,'activationContext':_0x10088c},_0x46602a=await executePushJourneys(_0x88e782,_0x298512,_0x28a0a4,{'parentId':_0x56bb69,'rootFolderId':_0x295548,'verbose':_0x35b8ff[_0x492f60(0x16d)]},_0x5f1df5);_0xdd8b72=_0x46602a['created'],_0x1cc254=_0x46602a['updated'];if(_0x319d3c&&_0x46602a[_0x492f60(0x147)]['length']===0x1){const _0x42d86b=_0x46602a[_0x492f60(0x147)][0x0];if(_0x42d86b[_0x492f60(0x136)]){const _0x2ba6a3=getConsoleNextUrl(_0x35b8ff[_0x492f60(0x11d)],_0x492f60(0x16b)+_0x56bb69+_0x492f60(0x148)+_0x42d86b[_0x492f60(0x136)]+_0x492f60(0x169));console['error']('\x20\x20'+a29_0x2028c8[_0x492f60(0x16a)](_0x2ba6a3));}}}for(const _0x4ee97d of _0x272d42){console[_0x492f60(0x14d)](a29_0x2028c8[_0x492f60(0x164)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x4ee97d['journeyBundleName'])),_0x1a17ea++;}const _0x2bf6f6=[];if(_0x586193>0x0)_0x2bf6f6[_0x492f60(0xe2)](_0x586193+_0x492f60(0xe5));if(_0x5efb2f>0x0)_0x2bf6f6[_0x492f60(0xe2)](_0x5efb2f+_0x492f60(0x146));if(_0x1bcfaf>0x0)_0x2bf6f6[_0x492f60(0xe2)](_0x1bcfaf+_0x492f60(0x15e));const _0x85adcd=[];if(_0xdd8b72>0x0)_0x85adcd['push'](_0xdd8b72+_0x492f60(0xe5));if(_0x1cc254>0x0)_0x85adcd[_0x492f60(0xe2)](_0x1cc254+'\x20updated');if(_0x1a17ea>0x0)_0x85adcd['push'](_0x1a17ea+_0x492f60(0x15e));const _0x240023=[];if(_0x17fe50>0x0)_0x240023[_0x492f60(0xe2)](_0x17fe50+_0x492f60(0xe5));if(_0x3ba658>0x0)_0x240023[_0x492f60(0xe2)](_0x3ba658+_0x492f60(0x146));if(_0x819822>0x0)_0x240023[_0x492f60(0xe2)](_0x819822+_0x492f60(0x15e));return console['error'](a29_0x2028c8[_0x492f60(0xdf)](_0x492f60(0x14e))),_0x2bf6f6[_0x492f60(0xd7)]>0x0&&!_0x35b8ff[_0x492f60(0x10f)]&&console[_0x492f60(0x14d)](_0x492f60(0x156)+_0x2bf6f6[_0x492f60(0x106)](',\x20')),_0x85adcd[_0x492f60(0xd7)]>0x0&&console[_0x492f60(0x14d)](_0x492f60(0x131)+_0x85adcd[_0x492f60(0x106)](',\x20')),_0x240023[_0x492f60(0xd7)]>0x0&&!_0x35b8ff[_0x492f60(0x10f)]&&console[_0x492f60(0x14d)](_0x492f60(0x15d)+_0x240023[_0x492f60(0x106)](',\x20')),0x0;}}
|
|
1
|
+
const a29_0x44a7ab=a29_0x2997;(function(_0x56788f,_0x841ee1){const _0x3c2c14=a29_0x2997,_0x5d7387=_0x56788f();while(!![]){try{const _0x138549=-parseInt(_0x3c2c14(0x1d0))/0x1*(parseInt(_0x3c2c14(0x1c2))/0x2)+parseInt(_0x3c2c14(0x17c))/0x3+parseInt(_0x3c2c14(0x1d3))/0x4*(parseInt(_0x3c2c14(0x198))/0x5)+-parseInt(_0x3c2c14(0x1eb))/0x6*(parseInt(_0x3c2c14(0x176))/0x7)+-parseInt(_0x3c2c14(0x19c))/0x8*(parseInt(_0x3c2c14(0x17f))/0x9)+-parseInt(_0x3c2c14(0x1db))/0xa*(-parseInt(_0x3c2c14(0x1cb))/0xb)+parseInt(_0x3c2c14(0x1a4))/0xc;if(_0x138549===_0x841ee1)break;else _0x5d7387['push'](_0x5d7387['shift']());}catch(_0x251af0){_0x5d7387['push'](_0x5d7387['shift']());}}}(a29_0xb274,0xe19bd));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a29_0x2997(_0x32f95a,_0x566e4c){_0x32f95a=_0x32f95a-0x16e;const _0xb27404=a29_0xb274();let _0x29970b=_0xb27404[_0x32f95a];return _0x29970b;}import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x1fe9af 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_0xb274(){const _0x470023=['getOutputSchemaWithCache','Aborted.','delete','createdSegmentIds','\x20\x20Activations:\x20','\x20\x20Segments:\x20','activations','setPhase','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','verbose','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x0a✔\x20Push\x20complete','filter','results','Changes\x20to\x20journey:','journey','(Journey\x20will\x20be\x20deleted)','dim','segment','no_parent','segmentFolderId','\x20\x20🗺️\x20\x20Journeys:','.yaml','folders','nameToId','data','error','New\x20journey:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','endsWith','join','resolveParentId','\x27...','\x20to\x20update','repeat','journeysOnly','\x20changes?','10570308VoDZMN','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','helpText','cyan','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Folders\x20to\x20create:','1338945QvRDPT','segment:push','created','3529422PfDNvm','add','Site:\x20','listJourneysWithDetailsFromParentSegment','yamlConfig','\x20unchanged','list','blue','/app/ps/','listActivations','parent_name','journeys','file','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','No\x20','yellow','Fetching\x20existing\x20journeys...','map','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','.yml','updatedAt','\x20changed','\x20\x20Activations:','nameToType','push','410HpFMmO','updated','\x0aValidation\x20failed:','all','24NQgBrm','isScoped','Fetching\x20connections\x20for\x20name\x20resolution...','cwd','deleted','toCreate','listFolders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','42637944XkSScr','then','state','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)','red','idToName','Delete\x20journey:','connection','type','message','\x20activations]','diff','filePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20created','folderId','\x20folders\x20to\x20create','\x20updated','folderPath','Push\x20','\x20to\x20delete','parentName','relationships','site','user','length','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','unchanged','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','60392ibfGDG','journeyId','listSegments','get','yes','Fetching\x20parent\x20segment\x20details...','\x20\x20Journeys:\x20','journeyBundleName','new','44fGRUSR','segments','New\x20segment:','Error:\x20Directory\x20not\x20found:\x20','\x20\x20\x20\x20','24edMcMz','Fetching\x20existing\x20activations...','parentSegment','6068JtpCeL','\x0aPush\x20summary\x20for\x20\x27','Fetching\x20existing\x20segments...','Fetching\x20existing\x20folders...','set','targetDir','toUpdate','/e/','528610sORzWE','/j/da/je','\x20deleted','name','journeyBundleId','Source\x20directory:\x20','versionNumber','toString','segment\x20or\x20journey','\x20\x20📊\x20Segments:','\x20new','toDelete','createdAt','attributes','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','green','6OJjynz','changed','isNew'];a29_0xb274=function(){return _0x470023;};return a29_0xb274();}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{['name']=a29_0x44a7ab(0x17d);['description']='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x446058){const _0x3da3af=a29_0x44a7ab,{options:_0x526b0a,args:_0x57a34e,tdx:_0x47b0b3}=_0x446058,_0x123038=_0x526b0a,_0x1efac5=await resolveTarget({'arg':_0x57a34e[0x0],'contextParent':_0x526b0a[_0x3da3af(0x1d2)],'cwd':process[_0x3da3af(0x19f)]()});if(!isSuccessfulResolution(_0x1efac5))return _0x1efac5['errorCode']===_0x3da3af(0x201)?(console['error'](a29_0x1fe9af[_0x3da3af(0x18e)](_0x3da3af(0x1b1))),console[_0x3da3af(0x208)](_0x3da3af(0x1a7)),console['error'](_0x3da3af(0x1a3)),console[_0x3da3af(0x208)](_0x3da3af(0x1bf))):(console[_0x3da3af(0x208)](a29_0x1fe9af['red']('Error:\x20'+_0x1efac5[_0x3da3af(0x1ad)]+'\x0a')),_0x1efac5[_0x3da3af(0x178)]&&console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x179)](_0x1efac5['helpText']))),0x1;if(_0x1efac5[_0x3da3af(0x1ac)]===_0x3da3af(0x189))return console[_0x3da3af(0x208)](a29_0x1fe9af['red'](_0x3da3af(0x1ce)+_0x1efac5[_0x3da3af(0x1d8)]+'\x0a')),console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x179)](_0x3da3af(0x1e9))),0x1;const _0x3b4e9d=_0x1efac5[_0x3da3af(0x1b9)],_0x2c9d90=_0x1efac5['targetDir'],_0x1d28b4=_0x1efac5[_0x3da3af(0x1ac)]===_0x3da3af(0x18b)?_0x1efac5[_0x3da3af(0x1b0)]:undefined,_0x29d364=getScopedDetails(_0x1efac5),_0x4df482=_0x29d364?.[_0x3da3af(0x19d)]??![],_0x528da8=_0x29d364?.['scopedFolderPath']??'';if(!existsSync(_0x2c9d90))return console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x1a8)](_0x3da3af(0x1ce)+_0x2c9d90+'\x0a')),console[_0x3da3af(0x208)](a29_0x1fe9af['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x123038[_0x3da3af(0x1f7)]&&(console[_0x3da3af(0x208)](_0x3da3af(0x181)+_0x123038[_0x3da3af(0x1bb)]),console[_0x3da3af(0x208)]('Parent\x20segment:\x20'+_0x3b4e9d),console[_0x3da3af(0x208)](_0x3da3af(0x1e0)+_0x2c9d90),_0x4df482&&console['error']('Scoped\x20to\x20folder:\x20'+_0x528da8));const _0x4df5c0=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x3b4e9d+_0x3da3af(0x171),()=>_0x47b0b3[_0x3da3af(0x200)][_0x3da3af(0x170)](_0x3b4e9d),{'verbose':_0x123038['verbose']}),_0x1f423a=_0x4df5c0[_0x3da3af(0x207)],[_0x402440,_0x1ef4e6,_0x2a49db,_0x2b67e9,_0x4a636e]=await Promise['all']([withSpinner(_0x3da3af(0x1c7),()=>_0x47b0b3[_0x3da3af(0x200)]['getParent'](_0x1f423a),{'verbose':_0x123038['verbose']}),withSpinner(_0x3da3af(0x1d5),()=>_0x47b0b3[_0x3da3af(0x200)][_0x3da3af(0x1c4)](_0x1f423a),{'verbose':_0x123038[_0x3da3af(0x1f7)]}),withSpinner(_0x3da3af(0x1d6),()=>_0x47b0b3[_0x3da3af(0x200)][_0x3da3af(0x1a2)](_0x1f423a),{'verbose':_0x123038[_0x3da3af(0x1f7)]}),withSpinner(_0x3da3af(0x18f),()=>_0x47b0b3[_0x3da3af(0x1fd)][_0x3da3af(0x182)](_0x1f423a),{'verbose':_0x123038[_0x3da3af(0x1f7)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x47b0b3[_0x3da3af(0x1bc)]['buildUserMaps'](),{'verbose':_0x123038[_0x3da3af(0x1f7)]})[_0x3da3af(0x1a5)](_0x4eb141=>_0x4eb141[_0x3da3af(0x207)])]),_0x4559ed=_0x402440[_0x3da3af(0x207)],_0x5f02a1=extractRootFolderId(_0x4559ed),_0x2714f1=_0x1ef4e6[_0x3da3af(0x207)],_0x288404=_0x2a49db[_0x3da3af(0x207)],{journeys:_0x1a118b,activationStepsById:_0x1dcdf3}=_0x2b67e9[_0x3da3af(0x207)],_0x306c19=new Map(_0x1a118b[_0x3da3af(0x190)](_0x3f8e46=>[_0x3f8e46['id'],_0x3f8e46])),_0x3c8e42=_0x1a118b[_0x3da3af(0x190)](_0x3eae09=>({'id':_0x3eae09['id'],'name':_0x3eae09[_0x3da3af(0x1e8)][_0x3da3af(0x1de)],'journeyBundleName':_0x3eae09[_0x3da3af(0x1e8)][_0x3da3af(0x1c9)]||'','journeyBundleId':_0x3eae09[_0x3da3af(0x1e8)][_0x3da3af(0x1df)]||'','versionNumber':_0x3eae09[_0x3da3af(0x1e8)][_0x3da3af(0x1e1)],'description':_0x3eae09[_0x3da3af(0x1e8)]['description'],'state':_0x3eae09['attributes'][_0x3da3af(0x1a6)],'paused':_0x3eae09[_0x3da3af(0x1e8)]['paused'],'audienceId':_0x3eae09[_0x3da3af(0x1e8)]['audienceId'],'folderId':_0x3eae09[_0x3da3af(0x1ba)]?.['parentFolder']?.[_0x3da3af(0x207)]?.['id'],'createdAt':_0x3eae09['attributes'][_0x3da3af(0x1e7)],'updatedAt':_0x3eae09[_0x3da3af(0x1e8)][_0x3da3af(0x193)]})),{emailToId:_0x1a6fb8,idToEmail:_0x8d3419}=_0x4a636e,_0x2524da=await withSpinner(_0x3da3af(0x19e),async()=>{const _0x931ba2=_0x3da3af,_0x563641=await _0x47b0b3[_0x931ba2(0x1ab)][_0x931ba2(0x185)]();return buildConnectionMaps(_0x563641);},{'verbose':_0x123038[_0x3da3af(0x1f7)]})[_0x3da3af(0x1a5)](_0xd65c69=>_0xd65c69[_0x3da3af(0x207)]),_0x36ab37=_0x2524da[_0x3da3af(0x206)],_0x386854=_0x2524da[_0x3da3af(0x1a9)],_0xdceb7=_0x2524da[_0x3da3af(0x196)],_0x649a56={'emailToIdMap':_0x1a6fb8,'connectionNameToIdMap':_0x36ab37,'connectionNameToTypeMap':_0xdceb7,'getSchema':_0x30d80e=>_0x47b0b3[_0x3da3af(0x1ab)][_0x3da3af(0x1ee)](_0x30d80e)};let {pathToId:_0x1c5cb9,idToPath:_0x311437}=buildFolderMaps(_0x288404);const _0xdc5a79=buildSegmentLookupMap(_0x2714f1,_0x311437),_0x5f66cb=buildSegmentNameToIdMap(_0x2714f1),_0x3067c5=buildJourneyBundleLookupMap(_0x3c8e42,_0x311437);let _0x2d6a8e;if(_0x1d28b4){if(!_0x1d28b4[_0x3da3af(0x16e)](_0x3da3af(0x192))&&!_0x1d28b4[_0x3da3af(0x16e)](_0x3da3af(0x204)))return console['error'](a29_0x1fe9af[_0x3da3af(0x1a8)](_0x3da3af(0x17a)+_0x1d28b4+'\x0a')),0x1;_0x2d6a8e=[_0x1d28b4];}else _0x2d6a8e=findYamlFiles(_0x2c9d90);if(_0x2d6a8e['length']===0x0)return console[_0x3da3af(0x208)](a29_0x1fe9af['red'](_0x3da3af(0x191)+_0x2c9d90+'\x0a')),console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x179)](_0x3da3af(0x1f6))),0x1;let _0x329aaf,_0x12af83;try{const _0x1fee4a=parseAndClassifyYamlFiles(_0x2d6a8e,_0x2c9d90,{'skipSegments':_0x123038[_0x3da3af(0x174)]});_0x329aaf=_0x1fee4a[_0x3da3af(0x1cc)],_0x12af83=_0x1fee4a[_0x3da3af(0x18a)];const _0x527b38=validateParsedFiles(_0x1fee4a,_0x2c9d90);if(_0x527b38[_0x3da3af(0x1bd)]>0x0)return console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x1a8)](_0x3da3af(0x19a))),console[_0x3da3af(0x208)](formatValidationErrors(_0x527b38)),console['error'](a29_0x1fe9af[_0x3da3af(0x18e)](_0x3da3af(0x18c))),0x1;}catch(_0x1b1527){return console['error'](a29_0x1fe9af['red']('Error\x20parsing\x20YAML:\x20'+(_0x1b1527 instanceof Error?_0x1b1527[_0x3da3af(0x1ad)]:_0x1b1527))),0x1;}if(_0x329aaf[_0x3da3af(0x1bd)]===0x0&&_0x12af83[_0x3da3af(0x1bd)]===0x0){const _0x47b3cc=_0x123038[_0x3da3af(0x174)]?_0x3da3af(0x1fd):_0x3da3af(0x1e3);return console[_0x3da3af(0x208)](a29_0x1fe9af['yellow'](_0x3da3af(0x18d)+_0x47b3cc+'\x20YAML\x20files\x20found')),0x0;}const _0x4beab7=new Map();_0x2714f1[_0x3da3af(0x1bd)]>0x0&&!_0x123038['journeysOnly']&&await withSpinner(_0x3da3af(0x1d1),async()=>{await batchAsync(_0x2714f1,async _0xcc7da=>{const _0x335522=a29_0x2997,_0x2f57b3=await _0x47b0b3[_0x335522(0x200)][_0x335522(0x188)](_0x1f423a,_0xcc7da['id']);_0x4beab7[_0x335522(0x1d7)](_0xcc7da['id'],_0x2f57b3);});},{'verbose':_0x123038[_0x3da3af(0x1f7)]});const {segmentFiles:_0x34ce1f,foldersToCreate:_0x1f95f3}=await prepareSegmentFiles(_0x329aaf,{'segmentByFolderAndName':_0xdc5a79,'activationsBySegmentId':_0x4beab7,'folderPathToId':_0x1c5cb9,'idToEmailMap':_0x8d3419,'connectionIdToNameMap':_0x386854},_0x649a56,_0x4df482,_0x528da8),_0x58b000=_0x1d28b4?[]:findSegmentsToDelete(_0x2714f1,_0x329aaf[_0x3da3af(0x190)](({yamlConfig:_0x363b93,folderPath:_0x4196e6})=>({'yamlConfig':_0x363b93,'folderPath':resolveTDFolderPath(_0x4196e6,_0x4df482,_0x528da8)})),_0x311437,_0x528da8,_0x4df482),{journeyFiles:_0xebe1b3,foldersToCreate:_0x3138de}=await withProgressSpinner('Preparing\x20journeys...',async _0x4fa41a=>prepareJourneyFiles(_0x12af83,{'fetchJourney':async _0x4e66fc=>_0x47b0b3[_0x3da3af(0x1fd)]['getJourney'](_0x4e66fc['journeyId']),'journeyBundlesByFolderAndName':_0x3067c5,'folderPathToId':_0x1c5cb9,'idToEmailMap':_0x8d3419,'connectionIdToNameMap':_0x386854,'existingSegments':_0x2714f1,'parentId':_0x1f423a,'deps':_0x47b0b3,'progress':{'update':_0x4e0621=>{const _0x16adde=_0x3da3af;_0x4fa41a[_0x16adde(0x1f5)](_0x4e0621),_0x123038[_0x16adde(0x1f7)]&&console[_0x16adde(0x208)]('\x20\x20'+_0x4e0621);}},'journeyById':_0x306c19,'activationStepsById':_0x1dcdf3},_0x4df482,_0x528da8),{'verbose':_0x123038[_0x3da3af(0x1f7)]})['then'](_0x36cbc7=>_0x36cbc7[_0x3da3af(0x207)]);for(const _0x2650bc of _0x3138de){_0x1f95f3[_0x3da3af(0x180)](_0x2650bc);}const _0x4b8c64=_0x1d28b4?[]:findJourneysToDelete(_0x3c8e42,_0x12af83[_0x3da3af(0x190)](({yamlConfig:_0x1e5632,folderPath:_0x76b2c6})=>({'yamlConfig':_0x1e5632,'folderPath':resolveTDFolderPath(_0x76b2c6,_0x4df482,_0x528da8)})),_0x311437,_0x528da8,_0x4df482),_0x4f0056=calculatePushStats(_0x34ce1f,_0xebe1b3,_0x1f95f3,_0x58b000,_0x4b8c64,!!_0x123038['delete'],!!_0x123038[_0x3da3af(0x174)]),_0x307353=_0x4f0056[_0x3da3af(0x1cc)]['new'],_0x3be8aa=_0x4f0056[_0x3da3af(0x1cc)][_0x3da3af(0x1ec)],_0x58a4e0=_0x4f0056[_0x3da3af(0x1cc)][_0x3da3af(0x1c0)],_0x387e8d=_0x4f0056[_0x3da3af(0x1cc)][_0x3da3af(0x1e6)],_0x328e88=_0x4f0056[_0x3da3af(0x205)][_0x3da3af(0x1a1)],_0x5c9f2c=_0x4f0056[_0x3da3af(0x18a)][_0x3da3af(0x1ca)],_0x577119=_0x4f0056['journeys'][_0x3da3af(0x1ec)],_0x431f3c=_0x4f0056['journeys']['unchanged'],_0x2da1c1=_0x4f0056['journeys'][_0x3da3af(0x1e6)],_0x26bd33=_0x4f0056[_0x3da3af(0x1f4)][_0x3da3af(0x19b)],_0x133765=_0x4f0056[_0x3da3af(0x1f4)][_0x3da3af(0x1a1)],_0x7594d2=_0x4f0056[_0x3da3af(0x1f4)][_0x3da3af(0x1d9)],_0x2f6212=_0x4f0056[_0x3da3af(0x1f4)][_0x3da3af(0x1e6)];console[_0x3da3af(0x208)](_0x3da3af(0x1d4)+_0x3b4e9d+'\x27:');_0x328e88[_0x3da3af(0x1bd)]>0x0&&console[_0x3da3af(0x208)]('\x20\x20'+a29_0x1fe9af[_0x3da3af(0x186)]('📁\x20'+_0x328e88[_0x3da3af(0x1bd)]+_0x3da3af(0x1b4)));if(!_0x123038[_0x3da3af(0x174)]){console[_0x3da3af(0x208)](_0x3da3af(0x1e4)),console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x1ea)]('+\x20'+_0x307353['length']+_0x3da3af(0x1e5))),console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x18e)]('~\x20'+_0x3be8aa[_0x3da3af(0x1bd)]+_0x3da3af(0x194)));if(_0x387e8d['length']>0x0)console['error']('\x20\x20\x20\x20'+a29_0x1fe9af[_0x3da3af(0x1a8)]('-\x20'+_0x387e8d[_0x3da3af(0x1bd)]+_0x3da3af(0x1b8)));else _0x58b000[_0x3da3af(0x1bd)]>0x0&&!_0x123038[_0x3da3af(0x1f0)]&&console['error'](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x1ff)](_0x58b000['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x1ff)]('=\x20'+_0x58a4e0[_0x3da3af(0x1bd)]+'\x20unchanged'));}if(_0xebe1b3['length']>0x0||_0x4b8c64[_0x3da3af(0x1bd)]>0x0){console[_0x3da3af(0x208)](_0x3da3af(0x203)),console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x1ea)]('+\x20'+_0x5c9f2c[_0x3da3af(0x1bd)]+'\x20new')),console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af[_0x3da3af(0x18e)]('~\x20'+_0x577119[_0x3da3af(0x1bd)]+_0x3da3af(0x194)));if(_0x2da1c1['length']>0x0)console[_0x3da3af(0x208)]('\x20\x20\x20\x20'+a29_0x1fe9af[_0x3da3af(0x1a8)]('-\x20'+_0x2da1c1['length']+_0x3da3af(0x1b8)));else _0x4b8c64[_0x3da3af(0x1bd)]>0x0&&!_0x123038['delete']&&console['error']('\x20\x20\x20\x20'+a29_0x1fe9af[_0x3da3af(0x1ff)](_0x4b8c64[_0x3da3af(0x1bd)]+_0x3da3af(0x177)));console[_0x3da3af(0x208)](_0x3da3af(0x1cf)+a29_0x1fe9af['dim']('=\x20'+_0x431f3c[_0x3da3af(0x1bd)]+_0x3da3af(0x184)));}_0x26bd33[_0x3da3af(0x1bd)]>0x0&&!_0x123038[_0x3da3af(0x174)]&&(console[_0x3da3af(0x208)](''),console[_0x3da3af(0x208)](_0x3da3af(0x195)),_0x133765[_0x3da3af(0x1bd)]>0x0&&console['error']('\x20\x20\x20\x20'+a29_0x1fe9af[_0x3da3af(0x1ea)]('+\x20'+_0x133765[_0x3da3af(0x1bd)]+'\x20to\x20create')),_0x7594d2[_0x3da3af(0x1bd)]>0x0&&console['error'](_0x3da3af(0x1cf)+a29_0x1fe9af['yellow']('~\x20'+_0x7594d2[_0x3da3af(0x1bd)]+_0x3da3af(0x172))),_0x2f6212['length']>0x0&&console[_0x3da3af(0x208)]('\x20\x20\x20\x20'+a29_0x1fe9af['red']('-\x20'+_0x2f6212[_0x3da3af(0x1bd)]+_0x3da3af(0x1b8))));console[_0x3da3af(0x208)]('\x20\x20Source:\x20'+a29_0x1fe9af[_0x3da3af(0x179)](_0x2c9d90)+'\x0a');if(_0x328e88[_0x3da3af(0x1bd)]>0x0){console[_0x3da3af(0x208)](_0x3da3af(0x17b));for(const _0x28c228 of _0x328e88){console['error']('\x20\x20'+a29_0x1fe9af['blue']('+')+'\x20'+_0x28c228);}console[_0x3da3af(0x208)]('');}if(_0x307353[_0x3da3af(0x1bd)]>0x0&&!_0x123038['journeysOnly'])for(const _0x236085 of _0x307353){const _0x5c3282=_0x236085[_0x3da3af(0x1b6)]?_0x236085['folderPath']+'/'+_0x236085['yamlConfig'][_0x3da3af(0x1de)]:_0x236085[_0x3da3af(0x183)]['name'],_0xf68f0a=_0x236085[_0x3da3af(0x183)][_0x3da3af(0x1f4)]?.[_0x3da3af(0x1bd)]||0x0,_0x21b187=_0xf68f0a>0x0?a29_0x1fe9af[_0x3da3af(0x1ff)]('\x20['+_0xf68f0a+_0x3da3af(0x1ae)):'';console['error']('\x0a'+a29_0x1fe9af[_0x3da3af(0x1ea)](_0x3da3af(0x1cd))+'\x20'+_0x5c3282+_0x21b187),console[_0x3da3af(0x208)]('─'[_0x3da3af(0x173)](0x3c)),_0x236085['diff']&&console[_0x3da3af(0x208)](_0x236085[_0x3da3af(0x1af)]),console[_0x3da3af(0x208)]('─'['repeat'](0x3c));}if(_0x387e8d[_0x3da3af(0x1bd)]>0x0&&!_0x123038[_0x3da3af(0x174)])for(const _0x586989 of _0x387e8d){const _0x555b01=_0x586989[_0x3da3af(0x202)]?_0x311437['get'](_0x586989[_0x3da3af(0x202)][_0x3da3af(0x1e2)]())||'':'',_0x2d8843=_0x555b01?_0x555b01+'/'+_0x586989[_0x3da3af(0x1de)]:_0x586989['name'],_0x2bd98e=_0x4beab7[_0x3da3af(0x1c5)](_0x586989['id'])||[],_0x37e803=_0x2bd98e[_0x3da3af(0x1bd)]>0x0?a29_0x1fe9af[_0x3da3af(0x1ff)]('\x20['+_0x2bd98e[_0x3da3af(0x1bd)]+_0x3da3af(0x1ae)):'';console[_0x3da3af(0x208)]('\x0a'+a29_0x1fe9af[_0x3da3af(0x1a8)]('Delete\x20segment:')+'\x20'+_0x2d8843+_0x37e803),console[_0x3da3af(0x208)]('─'['repeat'](0x3c));const _0x480d8e=segmentWithActivationsToYaml(_0x586989,_0x2bd98e,undefined,_0x8d3419,_0x386854),_0x2dbbac=segmentToYamlString(_0x480d8e),_0x3f0f5d=generateDiff(_0x2dbbac,'');console['error'](formatDiffWithColors(_0x3f0f5d)),console['error']('─'[_0x3da3af(0x173)](0x3c));}const _0x583f30=_0x34ce1f[_0x3da3af(0x1fa)](_0x19d3a1=>!_0x19d3a1[_0x3da3af(0x1ed)]&&_0x19d3a1[_0x3da3af(0x1af)]);if(_0x583f30['length']>0x0&&!_0x123038['journeysOnly'])for(const _0x424043 of _0x583f30){const _0x2a23de=_0x424043['folderPath']?_0x424043['folderPath']+'/'+_0x424043[_0x3da3af(0x183)]['name']:_0x424043[_0x3da3af(0x183)][_0x3da3af(0x1de)];console[_0x3da3af(0x208)]('\x0a'+a29_0x1fe9af[_0x3da3af(0x18e)]('Changes\x20to:')+'\x20'+_0x2a23de),console[_0x3da3af(0x208)]('─'[_0x3da3af(0x173)](0x3c)),console['error'](_0x424043['diff']),console['error']('─'['repeat'](0x3c));}if(_0x5c9f2c[_0x3da3af(0x1bd)]>0x0)for(const _0x34610f of _0x5c9f2c){const _0x1456a0=_0x34610f[_0x3da3af(0x1b6)]?_0x34610f['folderPath']+'/'+_0x34610f[_0x3da3af(0x183)][_0x3da3af(0x1de)]:_0x34610f['yamlConfig'][_0x3da3af(0x1de)];console[_0x3da3af(0x208)]('\x0a'+a29_0x1fe9af[_0x3da3af(0x1ea)](_0x3da3af(0x209))+'\x20'+_0x1456a0),console[_0x3da3af(0x208)]('─'['repeat'](0x3c)),_0x34610f[_0x3da3af(0x1af)]&&console[_0x3da3af(0x208)](_0x34610f[_0x3da3af(0x1af)]),console[_0x3da3af(0x208)]('─'[_0x3da3af(0x173)](0x3c));}const _0x3c9fb9=_0xebe1b3[_0x3da3af(0x1fa)](_0x400ed1=>!_0x400ed1[_0x3da3af(0x1ed)]&&_0x400ed1[_0x3da3af(0x1af)]);if(_0x3c9fb9[_0x3da3af(0x1bd)]>0x0)for(const _0x5dc00b of _0x3c9fb9){const _0x41ac83=_0x5dc00b['folderPath']?_0x5dc00b['folderPath']+'/'+_0x5dc00b[_0x3da3af(0x183)][_0x3da3af(0x1de)]:_0x5dc00b[_0x3da3af(0x183)][_0x3da3af(0x1de)];console[_0x3da3af(0x208)]('\x0a'+a29_0x1fe9af[_0x3da3af(0x18e)](_0x3da3af(0x1fc))+'\x20'+_0x41ac83),console[_0x3da3af(0x208)]('─'[_0x3da3af(0x173)](0x3c)),console[_0x3da3af(0x208)](_0x5dc00b['diff']),console['error']('─'['repeat'](0x3c));}if(_0x2da1c1[_0x3da3af(0x1bd)]>0x0)for(const _0x252779 of _0x2da1c1){const _0x592353=_0x252779['folderId']?_0x311437[_0x3da3af(0x1c5)](_0x252779[_0x3da3af(0x1b3)])||'':'',_0x33332d=_0x592353?_0x592353+'/'+_0x252779['journeyBundleName']:_0x252779[_0x3da3af(0x1c9)];console[_0x3da3af(0x208)]('\x0a'+a29_0x1fe9af[_0x3da3af(0x1a8)](_0x3da3af(0x1aa))+'\x20'+_0x33332d),console[_0x3da3af(0x208)]('─'['repeat'](0x3c)),console[_0x3da3af(0x208)](a29_0x1fe9af['red'](_0x3da3af(0x1fe))),console[_0x3da3af(0x208)]('─'[_0x3da3af(0x173)](0x3c));}if(_0x123038[_0x3da3af(0x1be)])return console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x18e)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x28dc9b=_0x123038['journeysOnly']?![]:_0x307353[_0x3da3af(0x1bd)]>0x0||_0x3be8aa['length']>0x0||_0x387e8d[_0x3da3af(0x1bd)]>0x0,_0x25464a=_0x5c9f2c[_0x3da3af(0x1bd)]>0x0||_0x577119[_0x3da3af(0x1bd)]>0x0||_0x2da1c1[_0x3da3af(0x1bd)]>0x0,_0x59a5ad=_0x123038[_0x3da3af(0x174)]?![]:_0x26bd33[_0x3da3af(0x1bd)]>0x0,_0x404b06=_0x328e88['length']>0x0;if(!_0x28dc9b&&!_0x25464a&&!_0x59a5ad&&!_0x404b06){const _0x26dd58=_0x123038[_0x3da3af(0x174)]?_0x3da3af(0x1c1):_0x3da3af(0x1f8);console['error'](a29_0x1fe9af[_0x3da3af(0x1ea)](_0x26dd58));if(_0x1d28b4&&_0x431f3c[_0x3da3af(0x1bd)]===0x1){const _0x847428=_0x431f3c[0x0];if(_0x847428['existingJourney']?.['id']){const _0x50302d=getConsoleNextUrl(_0x123038[_0x3da3af(0x1bb)],'/app/ps/'+_0x1f423a+_0x3da3af(0x1da)+_0x847428['existingJourney']['id']+'/j/da/je');console[_0x3da3af(0x208)]('\x20\x20'+a29_0x1fe9af[_0x3da3af(0x179)](_0x50302d));}}return 0x0;}const _0x28f0f7=_0x123038[_0x3da3af(0x174)]?_0x5c9f2c['length']+_0x577119[_0x3da3af(0x1bd)]+_0x2da1c1[_0x3da3af(0x1bd)]+_0x328e88[_0x3da3af(0x1bd)]:_0x307353[_0x3da3af(0x1bd)]+_0x3be8aa[_0x3da3af(0x1bd)]+_0x387e8d['length']+_0x5c9f2c[_0x3da3af(0x1bd)]+_0x577119[_0x3da3af(0x1bd)]+_0x2da1c1[_0x3da3af(0x1bd)]+_0x328e88[_0x3da3af(0x1bd)]+_0x26bd33[_0x3da3af(0x1bd)];if(!_0x123038[_0x3da3af(0x1c6)]&&_0x28f0f7>0x0){const _0x263462=await confirmKey(_0x3da3af(0x1b7)+_0x28f0f7+_0x3da3af(0x175));if(!_0x263462)return console[_0x3da3af(0x208)](_0x3da3af(0x1ef)),0x1;}const _0x33e758={'withProgress':async(_0x3e54a5,_0x3e0d60)=>{const _0x3bb635=_0x3da3af,_0x47f9e1=await withSpinner(_0x3e54a5,_0x3e0d60,{'verbose':_0x123038[_0x3bb635(0x1f7)]});return{'data':_0x47f9e1['data']};},'logInfo':_0x4b0501=>console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x186)]('✔\x20'+_0x4b0501)),'logSuccess':_0x5907e9=>console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x1ea)]('✔\x20'+_0x5907e9)),'logWarning':_0x3c6f01=>console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x18e)]('⚠\x20'+_0x3c6f01)),'logDeleted':_0x2b2f5a=>console[_0x3da3af(0x208)](a29_0x1fe9af['red']('✔\x20'+_0x2b2f5a))},_0x41ac63={'segment':_0x47b0b3[_0x3da3af(0x200)],'journey':_0x47b0b3['journey'],'user':_0x47b0b3[_0x3da3af(0x1bc)],'connection':_0x47b0b3[_0x3da3af(0x1ab)]};_0x328e88['length']>0x0&&(_0x1c5cb9=await executePushFolders(_0x41ac63,_0x328e88,_0x1c5cb9,{'parentId':_0x1f423a},_0x33e758));const _0x461a79={'rootFolderId':_0x5f02a1,'folderPathToId':_0x1c5cb9,'folderIdToPath':_0x311437,'segmentNameToId':_0x5f66cb,'activationsBySegmentId':_0x4beab7,'emailToIdMap':_0x1a6fb8,'idToEmailMap':_0x8d3419,'connectionNameToIdMap':_0x2524da[_0x3da3af(0x206)],'connectionIdToNameMap':_0x2524da[_0x3da3af(0x1a9)],'connectionNameToTypeMap':_0xdceb7},_0x2f6c4b=await executePushSegments(_0x41ac63,_0x123038['journeysOnly']?[]:_0x34ce1f,_0x461a79,{'parentId':_0x1f423a},_0x33e758),_0x192890=_0x2f6c4b['created'],_0x9f1304=_0x2f6c4b[_0x3da3af(0x199)],_0x3f80b9=_0x2f6c4b[_0x3da3af(0x1f4)][_0x3da3af(0x17e)],_0x4050af=_0x2f6c4b[_0x3da3af(0x1f4)][_0x3da3af(0x199)],_0x3116eb=_0x2f6c4b[_0x3da3af(0x1f4)][_0x3da3af(0x1a0)],_0x2782b9=await executePushSegmentDeletions(_0x41ac63,_0x123038[_0x3da3af(0x174)]?[]:_0x387e8d,_0x33e758);let _0x30f78a=0x0,_0xc6df7d=0x0,_0x5056d4=0x0;const _0x4710fb=new Map(_0x5f66cb);for(const [_0x2c7515,_0x4558a3]of _0x2f6c4b[_0x3da3af(0x1f1)]){_0x4710fb[_0x3da3af(0x1d7)](_0x2c7515,_0x4558a3);}if(_0xebe1b3[_0x3da3af(0x1bd)]>0x0){const _0x829948={..._0x461a79,'segmentNameToId':_0x4710fb,'existingSegments':_0x2714f1,'activationContext':_0x649a56},_0x41c463=await executePushJourneys(_0x41ac63,_0xebe1b3,_0x829948,{'parentId':_0x1f423a,'rootFolderId':_0x5f02a1,'verbose':_0x123038['verbose']},_0x33e758);_0x30f78a=_0x41c463['created'],_0xc6df7d=_0x41c463[_0x3da3af(0x199)];if(_0x1d28b4&&_0x41c463[_0x3da3af(0x1fb)][_0x3da3af(0x1bd)]===0x1){const _0xfa1a92=_0x41c463[_0x3da3af(0x1fb)][0x0];if(_0xfa1a92[_0x3da3af(0x1c3)]){const _0x313276=getConsoleNextUrl(_0x123038[_0x3da3af(0x1bb)],_0x3da3af(0x187)+_0x1f423a+_0x3da3af(0x1da)+_0xfa1a92['journeyId']+_0x3da3af(0x1dc));console[_0x3da3af(0x208)]('\x20\x20'+a29_0x1fe9af[_0x3da3af(0x179)](_0x313276));}}}for(const _0x453eb2 of _0x2da1c1){console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x18e)](_0x3da3af(0x20a)+_0x453eb2['journeyBundleName'])),_0x5056d4++;}const _0x1bbc5e=[];if(_0x192890>0x0)_0x1bbc5e['push'](_0x192890+_0x3da3af(0x1b2));if(_0x9f1304>0x0)_0x1bbc5e[_0x3da3af(0x197)](_0x9f1304+_0x3da3af(0x1b5));if(_0x2782b9>0x0)_0x1bbc5e[_0x3da3af(0x197)](_0x2782b9+_0x3da3af(0x1dd));const _0x4ace2f=[];if(_0x30f78a>0x0)_0x4ace2f[_0x3da3af(0x197)](_0x30f78a+_0x3da3af(0x1b2));if(_0xc6df7d>0x0)_0x4ace2f[_0x3da3af(0x197)](_0xc6df7d+'\x20updated');if(_0x5056d4>0x0)_0x4ace2f[_0x3da3af(0x197)](_0x5056d4+_0x3da3af(0x1dd));const _0xd56d92=[];if(_0x3f80b9>0x0)_0xd56d92[_0x3da3af(0x197)](_0x3f80b9+_0x3da3af(0x1b2));if(_0x4050af>0x0)_0xd56d92[_0x3da3af(0x197)](_0x4050af+_0x3da3af(0x1b5));if(_0x3116eb>0x0)_0xd56d92[_0x3da3af(0x197)](_0x3116eb+_0x3da3af(0x1dd));return console[_0x3da3af(0x208)](a29_0x1fe9af[_0x3da3af(0x1ea)](_0x3da3af(0x1f9))),_0x1bbc5e[_0x3da3af(0x1bd)]>0x0&&!_0x123038['journeysOnly']&&console[_0x3da3af(0x208)](_0x3da3af(0x1f3)+_0x1bbc5e[_0x3da3af(0x16f)](',\x20')),_0x4ace2f[_0x3da3af(0x1bd)]>0x0&&console[_0x3da3af(0x208)](_0x3da3af(0x1c8)+_0x4ace2f[_0x3da3af(0x16f)](',\x20')),_0xd56d92[_0x3da3af(0x1bd)]>0x0&&!_0x123038[_0x3da3af(0x174)]&&console[_0x3da3af(0x208)](_0x3da3af(0x1f2)+_0xd56d92[_0x3da3af(0x16f)](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a30_0x1ebc(){const _0x4afd92=['length','Resolved\x20type:\x20','Examples:','6YIeOGH','type','2686fXaQxJ','name','includes','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','resolvePathToResource','execute','Resolving\x20folder\x20\x27','920619cQGGtM','segmentId','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','INTERNAL','2536ognfli','Parent\x20ID:\x20','data','Resolved\x20folder\x20ID:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','segmentPath','\x27...','error','Update\x20existing\x20child\x20segment','130vGIPvQ','kind','240335eIYpEk','Error:\x20Cannot\x20update\x20','1317946TfksMc','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','yellow','\x20\x20\x20Path:\x20','verbose','description','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','Segment\x20ID\x20missing\x20from\x20resolved\x20path','folder','segment:update','rule','resolveFolderId','1244838uGAuZC','segmentName','1995788DygiQk','segment','updateSegmentById','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Updating\x20segment\x20\x27','449flQCBc'];a30_0x1ebc=function(){return _0x4afd92;};return a30_0x1ebc();}const a30_0x3a64f8=a30_0x2a2a;(function(_0x1fc397,_0x55df35){const _0x4260bb=a30_0x2a2a,_0x277a81=_0x1fc397();while(!![]){try{const _0x5782a5=parseInt(_0x4260bb(0x159))/0x1*(parseInt(_0x4260bb(0x15f))/0x2)+parseInt(_0x4260bb(0x152))/0x3+parseInt(_0x4260bb(0x154))/0x4+-parseInt(_0x4260bb(0x175))/0x5+parseInt(_0x4260bb(0x15d))/0x6*(parseInt(_0x4260bb(0x177))/0x7)+parseInt(_0x4260bb(0x16a))/0x8+-parseInt(_0x4260bb(0x166))/0x9*(parseInt(_0x4260bb(0x173))/0xa);if(_0x5782a5===_0x55df35)break;else _0x277a81['push'](_0x277a81['shift']());}catch(_0x2badcc){_0x277a81['push'](_0x277a81['shift']());}}}(a30_0x1ebc,0x4ffdd));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';function a30_0x2a2a(_0x185b28,_0xf49a51){_0x185b28=_0x185b28-0x14e;const _0x1ebc62=a30_0x1ebc();let _0x2a2a83=_0x1ebc62[_0x185b28];return _0x2a2a83;}import{SDKError,ErrorCode}from'../sdk/index.js';import a30_0x3ba45f from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a30_0x3a64f8(0x160)]=a30_0x3a64f8(0x14f);[a30_0x3a64f8(0x17c)]=a30_0x3a64f8(0x172);async[a30_0x3a64f8(0x164)](_0x1625c5){const _0x32783f=a30_0x3a64f8;console[_0x32783f(0x171)](a30_0x3ba45f[_0x32783f(0x179)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console['error'](a30_0x3ba45f[_0x32783f(0x179)](_0x32783f(0x157)));const {options:_0x578ceb,args:_0x2ab94c,tdx:_0x1c8b42}=_0x1625c5,_0xd8998b=_0x578ceb;if(_0x2ab94c[_0x32783f(0x15a)]===0x0)return console[_0x32783f(0x171)](_0x32783f(0x178)),console[_0x32783f(0x171)](_0x32783f(0x162)),console['error'](_0x32783f(0x15c)),console[_0x32783f(0x171)](_0x32783f(0x168)),console[_0x32783f(0x171)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x90ba6e=_0x2ab94c[0x0],_0x40f2ec=_0x578ceb[_0x32783f(0x16f)];let _0x397a11=_0x90ba6e;_0x40f2ec&&!_0x90ba6e[_0x32783f(0x161)]('/')&&(_0x397a11=_0x40f2ec+'/'+_0x90ba6e,_0xd8998b[_0x32783f(0x17b)]&&console[_0x32783f(0x171)]('Resolved\x20relative\x20path\x20to:\x20'+_0x397a11));const _0x12450b=await withSpinner('Resolving\x20path\x20\x27'+_0x397a11+_0x32783f(0x170),()=>_0x1c8b42[_0x32783f(0x155)][_0x32783f(0x163)](_0x397a11),{'verbose':_0xd8998b[_0x32783f(0x17b)]}),_0x1db556=_0x12450b[_0x32783f(0x16c)];_0xd8998b[_0x32783f(0x17b)]&&console[_0x32783f(0x171)](_0x32783f(0x15b)+_0x1db556[_0x32783f(0x15e)]);if(_0x1db556[_0x32783f(0x15e)]!==_0x32783f(0x155))return console['error'](_0x32783f(0x176)+_0x1db556[_0x32783f(0x15e)]+_0x32783f(0x17d)),console['error'](_0x32783f(0x16e)),0x1;if(!_0x1db556[_0x32783f(0x167)])throw new SDKError(ErrorCode[_0x32783f(0x169)],_0x32783f(0x17e));const _0x1b2731=_0x1db556['parentId'],_0x125783=_0x1db556[_0x32783f(0x167)];_0xd8998b['verbose']&&(console[_0x32783f(0x171)](_0x32783f(0x16b)+_0x1b2731),console[_0x32783f(0x171)]('Segment\x20ID:\x20'+_0x125783));let _0x41666f;if(_0xd8998b[_0x32783f(0x14e)]){const _0xcd794f=_0xd8998b[_0x32783f(0x14e)],_0x3c3b60=await withSpinner(_0x32783f(0x165)+_0xcd794f+_0x32783f(0x170),()=>_0x1c8b42[_0x32783f(0x155)][_0x32783f(0x151)](_0x1b2731,_0xcd794f),{'verbose':_0xd8998b[_0x32783f(0x17b)]});_0x41666f=parseInt(_0x3c3b60['data'],0xa),_0xd8998b[_0x32783f(0x17b)]&&console['error'](_0x32783f(0x16d)+_0x41666f);}const _0x405e02=await loadJSONFromOptions(_0xd8998b[_0x32783f(0x150)],_0xd8998b['ruleFile']),_0x3c98ed={'name':_0xd8998b[_0x32783f(0x160)],'description':_0xd8998b[_0x32783f(0x17c)],'rule':_0x405e02,'kind':_0xd8998b[_0x32783f(0x174)]!==undefined?parseInt(_0xd8998b[_0x32783f(0x174)],0xa):undefined,'segmentFolderId':_0x41666f},_0x2be642=await withSpinner(_0x32783f(0x158)+_0x1db556[_0x32783f(0x153)]+_0x32783f(0x170),()=>_0x1c8b42[_0x32783f(0x155)][_0x32783f(0x156)](_0x1b2731,_0x125783,_0x3c98ed),{'verbose':_0xd8998b[_0x32783f(0x17b)]}),_0x181f46=_0x2be642[_0x32783f(0x16c)];return console[_0x32783f(0x171)]('✔\x20Updated\x20segment\x20\x27'+_0x181f46['name']+'\x27'),_0x397a11!==_0x90ba6e&&console['error'](_0x32783f(0x17a)+_0x397a11),await handleSDKOutput([_0x181f46],_0xd8998b),0x0;}}
|