@treasuredata/tdx 0.11.0 → 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 +39 -5
- 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.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.js +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.js +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.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -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.js +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 +94 -0
- 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_0x1f4ab8=a25_0xffa8;(function(_0x5cd39a,_0x47159e){const _0x4a6d1f=a25_0xffa8,_0x28f39d=_0x5cd39a();while(!![]){try{const _0x10c121=parseInt(_0x4a6d1f(0x11c))/0x1*(-parseInt(_0x4a6d1f(0x13f))/0x2)+parseInt(_0x4a6d1f(0x129))/0x3+-parseInt(_0x4a6d1f(0x142))/0x4*(-parseInt(_0x4a6d1f(0xd1))/0x5)+parseInt(_0x4a6d1f(0x148))/0x6*(-parseInt(_0x4a6d1f(0x11b))/0x7)+-parseInt(_0x4a6d1f(0xc5))/0x8+parseInt(_0x4a6d1f(0x107))/0x9+parseInt(_0x4a6d1f(0x14c))/0xa;if(_0x10c121===_0x47159e)break;else _0x28f39d['push'](_0x28f39d['shift']());}catch(_0x52ac44){_0x28f39d['push'](_0x28f39d['shift']());}}}(a25_0x2590,0x4417c));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a25_0x2590(){const _0x4214cd=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Resolving\x20path\x20\x27','error','verbose','segmentPath','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolving\x20parent\x20segment\x20\x27','Resolving\x20folder\x20\x27','Resolving\x20\x27','Fetching\x20folder\x20\x27','parentFolder','Folder\x20ID\x20missing\x20from\x20resolved\x20path','segment:describe','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20<path/to/segment.yml>','getSegmentSQL','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Show\x20folder\x20or\x20child\x20segment\x20details','Resolved\x20type:\x20','SEGMENT_NOT_FOUND','Usage:\x20tdx\x20sg\x20desc\x20<name>','code','Parent\x20name:\x20','Use:\x20tdx\x20ps\x20view','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','folderId','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','parentSegment','Create\x20segment\x20folder\x20for\x20organization','parentId','segment:show','(root)','getFolder','Resolved\x20folder\x20ID:\x20','test','url','Folder\x20ID:\x20','Parent\x20ID:\x20','site','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','✖\x20Query\x20failed\x20[','resolveParentId','resolveFolderId','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','\x27\x20with\x20ID:\x20','Examples:','web','Creating\x20folder\x20\x27','✔\x20Query\x20completed:\x20Processed\x20','log','1045638pgQNjP','Target\x20path:\x20','Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results','Show\x20segment\x20folder\x20details','segment:folder:create','Fetching\x20segment\x20details...','data','cause','Show\x20segment\x20or\x20folder\x20details','Use:\x20tdx\x20ps\x20sql','parent','jsonl','length','description','Error:\x20Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.','\x20\x20tdx\x20sg\x20sql\x20segments/my-audience/premium-users.yml','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','folder','Error:\x20Parent\x20segment\x20name\x20is\x20required','segment:view','14jceeLa','1KViBFs','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','/e/','Listing\x20folders\x20for\x20parent\x20\x27','\x20[Job\x20ID:\x20','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','Folder\x20name:\x20','execute','stats','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','✔\x20Created\x20folder\x20\x27','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','Use:\x20tdx\x20ps\x20show','608568TzGHpw','Error:\x20Folder\x20reference\x20is\x20required','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','type','Error:\x20Path\x20or\x20name\x20is\x20required','json','\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22','SEGMENT_FOLDER_NOT_FOUND','Fetching\x20parent\x20segment\x20details...','Usage:\x20tdx\x20sg\x20sql\x20<name>','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','segmentId','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','\x20\x20Parent\x20segment:\x20','INVALID_ARGUMENT','information_schema','SELECT\x20*\x20FROM\x20(\x0a','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','folderPath','\x20\x20Full\x20path:\x20','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','740994GhDlwg','processedRows','jobId','12356YcsypB','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Segment\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','message','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','1524858JBcgIi','\x20\x20Folder\x20path:\x20','Usage:\x20tdx\x20segment\x20describe\x20<path>','trim','12430460BIicFw','in\x20','Resolved\x20YAML\x20file:\x20','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','segmentName','getSegment','Fetching\x20folder\x20details...','\x27...','segment:sql','/app/ps/','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Show\x20child\x20segment\x20schema\x20(column\x20types)','Use:\x20tdx\x20ps\x20desc','replace','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','resolvePathToResource','segment','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.','3457552gTlYLY','name','format','Resolved\x20parent\x20ID:\x20','\x20Opening\x20','segment:desc','Options:','Fetching\x20SQL\x20for\x20segment...','Parent\x20segment:\x20','query','\x20\x20Cause:\x20','fullPath','45hIWxYA'];a25_0x2590=function(){return _0x4214cd;};return a25_0x2590();}import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a25_0xddf546 from'chalk';async function resolveSegmentTarget(_0xc6e67a,_0x156d05,_0x5b01ac){const _0xb6031e=a25_0xffa8;if(isYamlFilePath(_0xc6e67a))try{const _0x425e2e=await resolveYamlFilePath(_0xc6e67a);return _0x5b01ac&&(console[_0xb6031e(0xd5)](_0xb6031e(0x14e)+_0xc6e67a),console[_0xb6031e(0xd5)](_0xb6031e(0x137)+_0x425e2e[_0xb6031e(0xee)]),console['error']('\x20\x20Segment\x20name:\x20'+_0x425e2e[_0xb6031e(0x150)]),console[_0xb6031e(0xd5)](_0xb6031e(0x149)+(_0x425e2e[_0xb6031e(0x13c)]||_0xb6031e(0xf2))),console['error'](_0xb6031e(0x13d)+_0x425e2e[_0xb6031e(0xd0)])),_0x425e2e[_0xb6031e(0xd0)];}catch(_0x1476b9){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0xb6031e(0x133)+_0x1476b9[_0xb6031e(0x146)]);}if(!_0x156d05)throw new SDKError(ErrorCode[_0xb6031e(0x138)],_0xb6031e(0x117));return _0x156d05+'/'+_0xc6e67a;}export class SegmentDescribeCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0xdf);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0x10f);async[a25_0x1f4ab8(0x123)](_0xb25dfc){const _0x2d3ca8=a25_0x1f4ab8,{options:_0x5d8f52,args:_0x3f1187,tdx:_0x4ba699}=_0xb25dfc,_0x4e1152=_0x3f1187[0x0],_0x441a06=!_0x4e1152&&!!_0x5d8f52['parentSegment'],_0x14e8df=_0x4e1152||_0x5d8f52[_0x2d3ca8(0xee)];if(!_0x14e8df)return console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x12d)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x14a)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x102)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xc3)),console['error'](_0x2d3ca8(0x13b)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xd3)),console[_0x2d3ca8(0xd5)](_0x2d3ca8(0x136)),0x1;try{const _0xeae13f=_0x5d8f52[_0x2d3ca8(0xd7)];let _0x255d2b=_0x14e8df;!_0x441a06&&_0xeae13f&&!_0x14e8df['includes']('/')&&(_0x255d2b=_0xeae13f+'/'+_0x14e8df,_0x5d8f52[_0x2d3ca8(0xd6)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x255d2b));const _0x34f7b1=await withSpinner(_0x2d3ca8(0xd4)+_0x255d2b+_0x2d3ca8(0x153),()=>_0x4ba699[_0x2d3ca8(0xc2)][_0x2d3ca8(0xc1)](_0x255d2b),{'verbose':_0x5d8f52['verbose']}),_0x24bc48=_0x34f7b1[_0x2d3ca8(0x10d)];_0x5d8f52['verbose']&&(console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xe4)+_0x24bc48[_0x2d3ca8(0x12c)]),console[_0x2d3ca8(0xd5)]('Parent\x20ID:\x20'+_0x24bc48[_0x2d3ca8(0xf0)]),_0x24bc48[_0x2d3ca8(0xeb)]&&console[_0x2d3ca8(0xd5)]('Folder\x20ID:\x20'+_0x24bc48['folderId']),_0x24bc48[_0x2d3ca8(0x134)]&&console['error'](_0x2d3ca8(0x144)+_0x24bc48[_0x2d3ca8(0x134)]));if(_0x24bc48[_0x2d3ca8(0x12c)]===_0x2d3ca8(0x111)){const _0x3e04eb=await withSpinner(_0x2d3ca8(0x131),()=>_0x4ba699[_0x2d3ca8(0xc2)]['getParent'](_0x24bc48['parentId']),{'verbose':_0x5d8f52[_0x2d3ca8(0xd6)]});await handleSingleObjectOutput(_0x3e04eb['data'],_0x5d8f52);}else{if(_0x24bc48[_0x2d3ca8(0x12c)]==='folder'){if(!_0x24bc48[_0x2d3ca8(0xeb)])throw new SDKError(ErrorCode[_0x2d3ca8(0x130)],_0x2d3ca8(0xde));const _0x4d47a3=await withSpinner(_0x2d3ca8(0x152),()=>_0x4ba699[_0x2d3ca8(0xc2)]['getFolder'](_0x24bc48[_0x2d3ca8(0xeb)]),{'verbose':_0x5d8f52['verbose']});await handleSingleObjectOutput(_0x4d47a3[_0x2d3ca8(0x10d)],_0x5d8f52);}else{if(_0x24bc48['type']===_0x2d3ca8(0xc2)){if(!_0x24bc48[_0x2d3ca8(0x134)])throw new SDKError(ErrorCode[_0x2d3ca8(0xe5)],_0x2d3ca8(0x145));const _0x45ee01=await withSpinner(_0x2d3ca8(0x10c),()=>_0x4ba699['segment'][_0x2d3ca8(0x151)](_0x24bc48[_0x2d3ca8(0xf0)],_0x24bc48[_0x2d3ca8(0x134)]),{'verbose':_0x5d8f52[_0x2d3ca8(0xd6)]});await handleSingleObjectOutput(_0x45ee01[_0x2d3ca8(0x10d)],_0x5d8f52);}}}return 0x0;}catch(_0x4eace4){if(_0x4eace4 instanceof SDKError)return console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xfb)+_0x4eace4[_0x2d3ca8(0x146)]),_0x4eace4[_0x2d3ca8(0x10e)]&&console[_0x2d3ca8(0xd5)](_0x2d3ca8(0xcf)+_0x4eace4['cause']),0x1;throw _0x4eace4;}}}export class SegmentShowCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0xf1);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0x109);async[a25_0x1f4ab8(0x123)](_0x215176){const _0x974f9c=a25_0x1f4ab8,{options:_0x456366,args:_0x410e7b,tdx:_0x46b58f}=_0x215176,_0x2b0b95=_0x410e7b[0x0];if(!_0x2b0b95)return console['error'](_0x974f9c(0xfc)),console[_0x974f9c(0xd5)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x974f9c(0xd5)](_0x974f9c(0xd2)),console[_0x974f9c(0xd5)](_0x974f9c(0x102)),console['error'](_0x974f9c(0x12f)),console[_0x974f9c(0xd5)]('\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x38ed49=_0x456366['parentSegment'],_0x460330=await resolveSegmentTarget(_0x2b0b95,_0x38ed49,_0x456366[_0x974f9c(0xd6)]);_0x456366[_0x974f9c(0xd6)]&&console['error']('Target\x20path:\x20'+_0x460330);const _0xa48f54=await withSpinner(_0x974f9c(0xdb)+_0x2b0b95+_0x974f9c(0x153),()=>_0x46b58f[_0x974f9c(0xc2)][_0x974f9c(0xc1)](_0x460330),{'verbose':_0x456366['verbose']}),_0x303ccb=_0xa48f54[_0x974f9c(0x10d)];_0x456366[_0x974f9c(0xd6)]&&(console['error']('Resolved\x20type:\x20'+_0x303ccb[_0x974f9c(0x12c)]),console[_0x974f9c(0xd5)](_0x974f9c(0xf8)+_0x303ccb[_0x974f9c(0xf0)]));if(_0x303ccb[_0x974f9c(0x12c)]===_0x974f9c(0x118))return console[_0x974f9c(0xd5)](_0x974f9c(0xc4)),console[_0x974f9c(0xd5)]('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x303ccb[_0x974f9c(0x12c)]==='parent')return console[_0x974f9c(0xd5)](_0x974f9c(0x11d)),console[_0x974f9c(0xd5)](_0x974f9c(0x128)),0x1;if(!_0x303ccb[_0x974f9c(0x134)])throw new SDKError(ErrorCode[_0x974f9c(0xe5)],_0x974f9c(0x145));const _0x44f3cc=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x46b58f[_0x974f9c(0xc2)][_0x974f9c(0xe1)](_0x303ccb[_0x974f9c(0xf0)],_0x303ccb[_0x974f9c(0x134)]),{'verbose':_0x456366[_0x974f9c(0xd6)]});let _0x12d95c=_0x44f3cc[_0x974f9c(0x10d)];const _0x11d5cc=resolveLimit(_0x456366['limit'],DEFAULT_DISPLAY_LIMIT),_0x443262=/\bLIMIT\s+\d+/i[_0x974f9c(0xf5)](_0x12d95c);!_0x443262&&(_0x12d95c=_0x12d95c[_0x974f9c(0x14b)]()[_0x974f9c(0xbf)](/;+$/,''),_0x12d95c=_0x974f9c(0x13a)+_0x12d95c+_0x974f9c(0xd8)+_0x11d5cc);_0x456366[_0x974f9c(0xd6)]&&console['error']('SQL\x20query:\x0a'+_0x12d95c);const _0x57a41f=await withProgressSpinner('Executing\x20segment\x20query...',async _0x3e6c91=>{const _0x4ec6a0=_0x974f9c,_0x171a24=await _0x46b58f[_0x4ec6a0(0xce)][_0x4ec6a0(0x123)](_0x12d95c,{'catalog':'td','schema':_0x4ec6a0(0x139),'onJobId':_0x5aa331=>{_0x3e6c91['setJobId'](_0x5aa331);}});return _0x171a24;},{'verbose':_0x456366[_0x974f9c(0xd6)]}),_0x56405a=_0x57a41f['data'],_0x4dec5c=_0x56405a[_0x974f9c(0x141)]?_0x974f9c(0x120)+_0x56405a['jobId']+']':'';return console[_0x974f9c(0xd5)](_0x974f9c(0x105)+_0x56405a[_0x974f9c(0x124)][_0x974f9c(0x140)]['toLocaleString']()+'\x20rows\x20'+(_0x974f9c(0x14d)+formatElapsed(_0x56405a['stats']['elapsedTimeMillis'])+_0x4dec5c)),await handleQueryOutput(_0x56405a,_0x456366),0x0;}catch(_0x17f2a0){if(_0x17f2a0 instanceof SDKError)return console[_0x974f9c(0xd5)](_0x974f9c(0xfd)+_0x17f2a0[_0x974f9c(0xe7)]+']'),console[_0x974f9c(0xd5)]('\x0a'+_0x17f2a0[_0x974f9c(0x146)]),0x1;throw _0x17f2a0;}}}function a25_0xffa8(_0x377863,_0x22c1e4){_0x377863=_0x377863-0xbb;const _0x259035=a25_0x2590();let _0xffa868=_0x259035[_0x377863];return _0xffa868;}export class SegmentFolderListCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]='segment:folder:list';[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0xed);async[a25_0x1f4ab8(0x123)](_0x32e91e){const _0x374ea7=a25_0x1f4ab8,{options:_0x12cd81,args:_0x1ce374,tdx:_0x50506f}=_0x32e91e;if(_0x1ce374['length']===0x0)return console[_0x374ea7(0xd5)](_0x374ea7(0x119)),console[_0x374ea7(0xd5)]('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x272f5f=_0x1ce374[0x0];try{_0x12cd81[_0x374ea7(0xd6)]&&(console[_0x374ea7(0xd5)]('Site:\x20'+_0x12cd81[_0x374ea7(0xf9)]),console[_0x374ea7(0xd5)](_0x374ea7(0xe8)+_0x272f5f));const _0x34949e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x272f5f+_0x374ea7(0x153),()=>_0x50506f[_0x374ea7(0xc2)][_0x374ea7(0xfe)](_0x272f5f),{'verbose':_0x12cd81[_0x374ea7(0xd6)]}),_0x261784=_0x34949e[_0x374ea7(0x10d)];_0x12cd81[_0x374ea7(0xd6)]&&console['error'](_0x374ea7(0xc8)+_0x261784);const _0x133021=await withSpinner(_0x374ea7(0x11f)+_0x272f5f+'\x27...',()=>_0x50506f[_0x374ea7(0xc2)]['listFolders'](_0x261784),{'verbose':_0x12cd81[_0x374ea7(0xd6)]}),_0x43d9e9=_0x133021['data'];return console[_0x374ea7(0xd5)]('✔\x20Found\x20'+_0x43d9e9[_0x374ea7(0x113)]+'\x20folder'+(_0x43d9e9['length']!==0x1?'s':'')),await handleSDKOutput(_0x43d9e9,_0x12cd81),0x0;}catch(_0x40c7e1){if(_0x40c7e1 instanceof SDKError)return console[_0x374ea7(0xd5)]('Error:\x20'+_0x40c7e1[_0x374ea7(0x146)]),_0x40c7e1[_0x374ea7(0x10e)]&&console[_0x374ea7(0xd5)](_0x374ea7(0xcf)+_0x40c7e1[_0x374ea7(0x10e)]),0x1;throw _0x40c7e1;}}}export class SegmentFolderShowCommand extends BaseCommand{['name']='segment:folder:show';[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0x10a);async[a25_0x1f4ab8(0x123)](_0x1df1fe){const _0x5e1de7=a25_0x1f4ab8,{options:_0x292c61,args:_0x3fc1d0,tdx:_0x2921b9}=_0x1df1fe;if(_0x3fc1d0[_0x5e1de7(0x113)]===0x0)return console[_0x5e1de7(0xd5)](_0x5e1de7(0x12a)),console[_0x5e1de7(0xd5)](_0x5e1de7(0xc0)),0x1;try{const {parentId:_0x33f62e,childId:_0x38b500}=parseSegmentRef(_0x3fc1d0[0x0]);_0x292c61[_0x5e1de7(0xd6)]&&(console[_0x5e1de7(0xd5)]('Site:\x20'+_0x292c61['site']),console[_0x5e1de7(0xd5)](_0x5e1de7(0xe8)+_0x33f62e),_0x38b500&&console[_0x5e1de7(0xd5)](_0x5e1de7(0x122)+_0x38b500));if(!_0x38b500)return console[_0x5e1de7(0xd5)]('Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)'),0x1;const _0x127930=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x33f62e+_0x5e1de7(0x153),()=>_0x2921b9['segment'][_0x5e1de7(0xfe)](_0x33f62e),{'verbose':_0x292c61[_0x5e1de7(0xd6)]}),_0x248e5f=_0x127930[_0x5e1de7(0x10d)];_0x292c61[_0x5e1de7(0xd6)]&&console[_0x5e1de7(0xd5)](_0x5e1de7(0xc8)+_0x248e5f);const _0x5116f8=await withSpinner(_0x5e1de7(0xda)+_0x38b500+_0x5e1de7(0x153),()=>_0x2921b9[_0x5e1de7(0xc2)][_0x5e1de7(0xff)](_0x248e5f,_0x38b500),{'verbose':_0x292c61['verbose']}),_0x2c7880=_0x5116f8[_0x5e1de7(0x10d)];_0x292c61[_0x5e1de7(0xd6)]&&console['error'](_0x5e1de7(0xf4)+_0x2c7880);const _0x5471e1=await withSpinner(_0x5e1de7(0xdc)+_0x38b500+_0x5e1de7(0x153),()=>_0x2921b9[_0x5e1de7(0xc2)]['getFolder'](_0x2c7880),{'verbose':_0x292c61[_0x5e1de7(0xd6)]});return await handleSDKOutput([_0x5471e1[_0x5e1de7(0x10d)]],_0x292c61),0x0;}catch(_0x2bc255){if(_0x2bc255 instanceof SDKError)return console['error'](_0x5e1de7(0xfb)+_0x2bc255[_0x5e1de7(0x146)]),_0x2bc255[_0x5e1de7(0x10e)]&&console['error'](_0x5e1de7(0xcf)+_0x2bc255['cause']),0x1;throw _0x2bc255;}}}export class SegmentSQLCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0x154);['description']=a25_0x1f4ab8(0x135);async[a25_0x1f4ab8(0x123)](_0x7730f0){const _0x20234d=a25_0x1f4ab8,{options:_0x370d8b,args:_0x25bab0,tdx:_0x5538a6}=_0x7730f0,_0x40aa19=_0x25bab0[0x0];if(!_0x40aa19)return console['error'](_0x20234d(0xfc)),console[_0x20234d(0xd5)](_0x20234d(0x132)),console[_0x20234d(0xd5)](_0x20234d(0xe0)),console[_0x20234d(0xd5)](_0x20234d(0x102)),console['error'](_0x20234d(0x143)),console['error'](_0x20234d(0x116)),0x1;try{const _0x5a34ff=_0x370d8b['parentSegment'],_0x44ac8f=await resolveSegmentTarget(_0x40aa19,_0x5a34ff,_0x370d8b[_0x20234d(0xd6)]);_0x370d8b['verbose']&&console[_0x20234d(0xd5)](_0x20234d(0x108)+_0x44ac8f);const _0x36cc5b=await withSpinner(_0x20234d(0xdb)+_0x40aa19+_0x20234d(0x153),()=>_0x5538a6[_0x20234d(0xc2)][_0x20234d(0xc1)](_0x44ac8f),{'verbose':_0x370d8b[_0x20234d(0xd6)]}),_0x41b685=_0x36cc5b[_0x20234d(0x10d)];_0x370d8b['verbose']&&(console[_0x20234d(0xd5)]('Resolved\x20type:\x20'+_0x41b685['type']),console['error'](_0x20234d(0xf8)+_0x41b685[_0x20234d(0xf0)]));if(_0x41b685[_0x20234d(0x12c)]===_0x20234d(0x118))return console[_0x20234d(0xd5)](_0x20234d(0x115)),console[_0x20234d(0xd5)](_0x20234d(0xbc)),0x1;if(_0x41b685['type']===_0x20234d(0x111))return console[_0x20234d(0xd5)]('Error:\x20Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console['error'](_0x20234d(0x110)),0x1;if(!_0x41b685[_0x20234d(0x134)])throw new SDKError(ErrorCode[_0x20234d(0xe5)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x176167=await withSpinner(_0x20234d(0xcc),()=>_0x5538a6[_0x20234d(0xc2)][_0x20234d(0xe1)](_0x41b685[_0x20234d(0xf0)],_0x41b685['segmentId']),{'verbose':_0x370d8b[_0x20234d(0xd6)]}),_0x8a2190=_0x176167['data'];return _0x370d8b[_0x20234d(0xc7)]===_0x20234d(0x12e)||_0x370d8b[_0x20234d(0xc7)]===_0x20234d(0x112)?await handleSDKOutput([{'sql':_0x8a2190}],_0x370d8b):console[_0x20234d(0x106)](_0x8a2190),0x0;}catch(_0x5d4f70){if(_0x5d4f70 instanceof SDKError)return console[_0x20234d(0xd5)](_0x20234d(0xfb)+_0x5d4f70[_0x20234d(0x146)]),_0x5d4f70['cause']&&console[_0x20234d(0xd5)](_0x20234d(0xcf)+_0x5d4f70[_0x20234d(0x10e)]),0x1;throw _0x5d4f70;}}}export class SegmentFolderCreateCommand extends BaseCommand{['name']=a25_0x1f4ab8(0x10b);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0xef);async[a25_0x1f4ab8(0x123)](_0x653bcc){const _0x1fb3e0=a25_0x1f4ab8,{options:_0x1bd71b,args:_0x26cb2d,tdx:_0x520e31}=_0x653bcc,_0x3d8cbd=_0x1bd71b;if(_0x26cb2d[_0x1fb3e0(0x113)]<0x2)return console[_0x1fb3e0(0xd5)]('Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required'),console[_0x1fb3e0(0xd5)](_0x1fb3e0(0x14f)),0x1;const _0x42f835=_0x26cb2d[0x0],_0x5977f7=_0x26cb2d[0x1];_0x3d8cbd[_0x1fb3e0(0xd6)]&&(console[_0x1fb3e0(0xd5)]('Site:\x20'+_0x3d8cbd['site']),console[_0x1fb3e0(0xd5)](_0x1fb3e0(0xcd)+_0x42f835),console[_0x1fb3e0(0xd5)]('Folder\x20name:\x20'+_0x5977f7));let _0x4627ec;if(_0x3d8cbd['parentFolder']){const _0x53b2d9=_0x3d8cbd[_0x1fb3e0(0xdd)],_0x5eaa4d=await withSpinner(_0x1fb3e0(0xd9)+_0x42f835+'\x27...',()=>_0x520e31[_0x1fb3e0(0xc2)][_0x1fb3e0(0xfe)](_0x42f835),{'verbose':_0x3d8cbd[_0x1fb3e0(0xd6)]}),_0x12f15a=_0x5eaa4d[_0x1fb3e0(0x10d)],_0x3cbcbf=await withSpinner('Resolving\x20parent\x20folder\x20\x27'+_0x53b2d9+_0x1fb3e0(0x153),()=>_0x520e31['segment']['resolveFolderId'](_0x12f15a,_0x53b2d9),{'verbose':_0x3d8cbd[_0x1fb3e0(0xd6)]});_0x4627ec=_0x3cbcbf[_0x1fb3e0(0x10d)],_0x3d8cbd[_0x1fb3e0(0xd6)]&&console[_0x1fb3e0(0xd5)]('Resolved\x20parent\x20folder\x20ID:\x20'+_0x4627ec);}const _0x246aec={'name':_0x5977f7,'description':_0x3d8cbd[_0x1fb3e0(0x114)],'parentFolderId':_0x4627ec},_0xc71955=await withSpinner(_0x1fb3e0(0x104)+_0x5977f7+_0x1fb3e0(0x153),()=>_0x520e31[_0x1fb3e0(0xc2)]['createFolder'](_0x42f835,_0x246aec),{'verbose':_0x3d8cbd[_0x1fb3e0(0xd6)]}),_0x5555e9=_0xc71955['data'];return console[_0x1fb3e0(0xd5)](_0x1fb3e0(0x126)+_0x5555e9[_0x1fb3e0(0xc6)]+_0x1fb3e0(0x101)+_0x5555e9['id']),await handleSDKOutput([_0x5555e9],_0x3d8cbd),0x0;}}export class SegmentViewCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0x11a);[a25_0x1f4ab8(0x114)]=a25_0x1f4ab8(0xe3);async[a25_0x1f4ab8(0x123)](_0x30acce){const _0x47fb7b=a25_0x1f4ab8,{options:_0x1978da,args:_0x525f00,tdx:_0x137da4}=_0x30acce,_0x4fca8d=_0x525f00[0x0];if(!_0x4fca8d)return console[_0x47fb7b(0xd5)](_0x47fb7b(0x12b)),console[_0x47fb7b(0xd5)](_0x47fb7b(0x127)),console[_0x47fb7b(0xd5)](_0x47fb7b(0xe2)),console[_0x47fb7b(0xd5)](_0x47fb7b(0xcb)),console[_0x47fb7b(0xd5)]('\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser'),console[_0x47fb7b(0xd5)]('Examples:'),console[_0x47fb7b(0xd5)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console['error']('\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details'),console[_0x47fb7b(0xd5)](_0x47fb7b(0xec)),console[_0x47fb7b(0xd5)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x451d38=_0x1978da[_0x47fb7b(0xee)],_0x42bd13=await resolveSegmentTarget(_0x4fca8d,_0x451d38,_0x1978da['verbose']);_0x1978da[_0x47fb7b(0xd6)]&&console[_0x47fb7b(0xd5)]('Target\x20path:\x20'+_0x42bd13);const _0x4c5562=await withSpinner('Resolving\x20\x27'+_0x4fca8d+_0x47fb7b(0x153),()=>_0x137da4[_0x47fb7b(0xc2)][_0x47fb7b(0xc1)](_0x42bd13),{'verbose':_0x1978da['verbose']}),_0x1aefdb=_0x4c5562['data'];_0x1978da[_0x47fb7b(0xd6)]&&(console[_0x47fb7b(0xd5)](_0x47fb7b(0xe4)+_0x1aefdb[_0x47fb7b(0x12c)]),console[_0x47fb7b(0xd5)](_0x47fb7b(0xf8)+_0x1aefdb['parentId']),_0x1aefdb['folderId']&&console[_0x47fb7b(0xd5)](_0x47fb7b(0xf7)+_0x1aefdb[_0x47fb7b(0xeb)]),_0x1aefdb[_0x47fb7b(0x134)]&&console[_0x47fb7b(0xd5)](_0x47fb7b(0x144)+_0x1aefdb['segmentId']));if(_0x1978da[_0x47fb7b(0x103)]){if(_0x1aefdb[_0x47fb7b(0x12c)]==='folder')return console[_0x47fb7b(0xd5)](_0x47fb7b(0xea)),0x1;if(_0x1aefdb[_0x47fb7b(0x12c)]===_0x47fb7b(0x111))return console[_0x47fb7b(0xd5)](_0x47fb7b(0xfa)),console[_0x47fb7b(0xd5)]('Use:\x20tdx\x20ps\x20view\x20-w'),0x1;if(!_0x1aefdb[_0x47fb7b(0x134)])throw new SDKError(ErrorCode[_0x47fb7b(0xe5)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2272b8=getConsoleNextUrl(_0x1978da[_0x47fb7b(0xf9)],_0x47fb7b(0xbb)+_0x1aefdb[_0x47fb7b(0xf0)]+_0x47fb7b(0x11e)+_0x1aefdb[_0x47fb7b(0x134)]);return console[_0x47fb7b(0xd5)](a25_0xddf546['green']('✔')+_0x47fb7b(0xc9)+a25_0xddf546['cyan'](_0x2272b8)),openBrowser(_0x2272b8),0x0;}if(_0x1aefdb[_0x47fb7b(0x12c)]===_0x47fb7b(0x118)){if(!_0x1aefdb['folderId'])throw new SDKError(ErrorCode[_0x47fb7b(0x130)],_0x47fb7b(0xde));const _0x26d023=await withSpinner(_0x47fb7b(0x152),()=>_0x137da4['segment'][_0x47fb7b(0xf3)](_0x1aefdb[_0x47fb7b(0xeb)]),{'verbose':_0x1978da[_0x47fb7b(0xd6)]});await handleSingleObjectOutput(_0x26d023[_0x47fb7b(0x10d)],_0x1978da);}else{if(_0x1aefdb[_0x47fb7b(0x12c)]==='segment'){if(!_0x1aefdb[_0x47fb7b(0x134)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x47fb7b(0x145));const _0x2b6a08=await withSpinner(_0x47fb7b(0x10c),()=>_0x137da4[_0x47fb7b(0xc2)]['getSegment'](_0x1aefdb[_0x47fb7b(0xf0)],_0x1aefdb['segmentId']),{'verbose':_0x1978da['verbose']}),_0x57f51e=getConsoleNextUrl(_0x1978da[_0x47fb7b(0xf9)],'/app/ps/'+_0x1aefdb['parentId']+_0x47fb7b(0x11e)+_0x1aefdb[_0x47fb7b(0x134)]),_0x504945=_0x2b6a08['data'];_0x504945[_0x47fb7b(0xf6)]=_0x57f51e,await handleSingleObjectOutput(_0x504945,_0x1978da);}else return console[_0x47fb7b(0xd5)](_0x47fb7b(0x121)),console[_0x47fb7b(0xd5)](_0x47fb7b(0xe9)),0x1;}return 0x0;}catch(_0x580e45){if(_0x580e45 instanceof SDKError)return console[_0x47fb7b(0xd5)](_0x47fb7b(0xfb)+_0x580e45[_0x47fb7b(0x146)]),_0x580e45[_0x47fb7b(0x10e)]&&console[_0x47fb7b(0xd5)](_0x47fb7b(0xcf)+_0x580e45['cause']),0x1;throw _0x580e45;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a25_0x1f4ab8(0xc6)]=a25_0x1f4ab8(0xca);['description']=a25_0x1f4ab8(0xbd);async[a25_0x1f4ab8(0x123)](_0x4679df){const _0x111b38=a25_0x1f4ab8,{options:_0x3964d2,args:_0x4d331b,tdx:_0xb4568}=_0x4679df,_0x1f0913=_0x4d331b[0x0];if(!_0x1f0913)return console[_0x111b38(0xd5)](_0x111b38(0xfc)),console[_0x111b38(0xd5)](_0x111b38(0xe6)),console[_0x111b38(0xd5)](_0x111b38(0x100)),console[_0x111b38(0xd5)](_0x111b38(0x102)),console['error']('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x111b38(0xd5)](_0x111b38(0x125)),0x1;try{const _0x5943b8=_0x3964d2[_0x111b38(0xee)],_0x20a714=await resolveSegmentTarget(_0x1f0913,_0x5943b8,_0x3964d2[_0x111b38(0xd6)]);_0x3964d2[_0x111b38(0xd6)]&&console[_0x111b38(0xd5)](_0x111b38(0x108)+_0x20a714);const _0x41cd24=await withSpinner(_0x111b38(0xdb)+_0x1f0913+_0x111b38(0x153),()=>_0xb4568[_0x111b38(0xc2)]['resolvePathToResource'](_0x20a714),{'verbose':_0x3964d2[_0x111b38(0xd6)]}),_0x3eb8ad=_0x41cd24[_0x111b38(0x10d)];_0x3964d2[_0x111b38(0xd6)]&&(console['error']('Resolved\x20type:\x20'+_0x3eb8ad[_0x111b38(0x12c)]),console[_0x111b38(0xd5)]('Parent\x20ID:\x20'+_0x3eb8ad['parentId']));if(_0x3eb8ad[_0x111b38(0x12c)]==='folder')return console[_0x111b38(0xd5)](_0x111b38(0x147)),console['error']('Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.'),0x1;if(_0x3eb8ad['type']===_0x111b38(0x111))return console['error'](_0x111b38(0x13e)),console['error'](_0x111b38(0xbe)),0x1;if(!_0x3eb8ad[_0x111b38(0x134)])throw new SDKError(ErrorCode[_0x111b38(0xe5)],_0x111b38(0x145));const _0x13e8f2=await withSpinner(_0x111b38(0xcc),()=>_0xb4568['segment'][_0x111b38(0xe1)](_0x3eb8ad['parentId'],_0x3eb8ad['segmentId']),{'verbose':_0x3964d2[_0x111b38(0xd6)]}),_0x5194dd=_0x13e8f2[_0x111b38(0x10d)],_0x235c54=await executeSchemaQuery(_0x5194dd,_0xb4568,_0x3964d2);return await handleQueryOutput(_0x235c54,_0x3964d2),0x0;}catch(_0x1049ab){if(_0x1049ab instanceof SDKError)return console[_0x111b38(0xd5)](_0x111b38(0xfb)+_0x1049ab[_0x111b38(0x146)]),_0x1049ab[_0x111b38(0x10e)]&&console['error'](_0x111b38(0xcf)+_0x1049ab[_0x111b38(0x10e)]),0x1;throw _0x1049ab;}}}
|
|
1
|
+
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
|
-
|
|
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_0x2c3d15=a29_0x3df0;(function(_0xb07671,_0x3e1c02){const _0x2e05be=a29_0x3df0,_0x4cdb95=_0xb07671();while(!![]){try{const _0xb6ed36=parseInt(_0x2e05be(0x211))/0x1*(-parseInt(_0x2e05be(0x236))/0x2)+parseInt(_0x2e05be(0x20b))/0x3*(-parseInt(_0x2e05be(0x1be))/0x4)+parseInt(_0x2e05be(0x21d))/0x5*(parseInt(_0x2e05be(0x22b))/0x6)+parseInt(_0x2e05be(0x238))/0x7+parseInt(_0x2e05be(0x201))/0x8*(parseInt(_0x2e05be(0x1bc))/0x9)+-parseInt(_0x2e05be(0x1f2))/0xa+parseInt(_0x2e05be(0x1e3))/0xb;if(_0xb6ed36===_0x3e1c02)break;else _0x4cdb95['push'](_0x4cdb95['shift']());}catch(_0x3bda17){_0x4cdb95['push'](_0x4cdb95['shift']());}}}(a29_0x53e8,0xcb0f2));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';function a29_0x3df0(_0x5cee,_0xc73432){_0x5cee=_0x5cee-0x1b6;const _0x53e880=a29_0x53e8();let _0x3df09d=_0x53e880[_0x5cee];return _0x3df09d;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a29_0x57bff8 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a29_0x53e8(){const _0x4ee03b=['nameToId','cyan','createdSegmentIds','journeys','resolveParentId','add','\x20to\x20delete','red','idToName','execute','description','getJourney','getOutputSchemaWithCache','filePath','\x20new','Changes\x20to:','\x20\x20Source:\x20','scopedFolderPath','activations','journey','folderId','message','new','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','25876818TldduZ','Push\x20','error','\x20to\x20create','name','green','\x0aPush\x20summary\x20for\x20\x27','Fetching\x20connections\x20for\x20name\x20resolution...','\x20to\x20update','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20📊\x20Segments:','Fetching\x20existing\x20folders...','targetDir','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x0aValidation\x20failed:','15451680gikBjB','Preparing\x20journeys...','\x20changed','No\x20','\x20unchanged','Folders\x20to\x20create:','\x20deleted','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/e/','/app/ps/','created','helpText','segment','\x20\x20Journeys:\x20','no_parent','104dvPXTJ','\x20\x20\x20\x20','site','Error:\x20Directory\x20not\x20found:\x20','attributes','verbose','yamlConfig','toDelete','errorCode','nameToType','75321wDXKoH','updated','get','connection','segments','type','1479585WMyRkW','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','then','Scoped\x20to\x20folder:\x20','journeyBundleName','results','Source\x20directory:\x20','Resolving\x20parent\x20segment\x20\x27','New\x20segment:','deleted','\x20\x20Segments:\x20','\x20activations]','7435GaBhRz','📁\x20','list','buildUserMaps','journeyBundleId','map','\x20updated','\x20created','user','listJourneysWithDetailsFromParentSegment','\x20\x20🗺️\x20\x20Journeys:','setPhase','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','folders','3162aGevGm','yellow','\x20folders\x20to\x20create','toUpdate','.yml','blue','parentFolder','\x20changes?','Aborted.','.yaml','segmentFolderId','2ptMGiy','folderPath','5163732HHMGWr','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','paused','listFolders','\x0a✔\x20Push\x20complete','join','existingJourney','segment\x20or\x20journey','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','segment:push','isNew','Fetching\x20existing\x20segments...','toString','dim','Delete\x20segment:','file','journeysOnly','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','filter','endsWith','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Fetching\x20existing\x20journeys...','New\x20journey:','length','set','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','parent_name','changed','unchanged','data','getParent','Changes\x20to\x20journey:','\x20YAML\x20files\x20found','\x20\x20Activations:','961416fRXktT','journeyId','224nwfeIi','push','/j/da/je','repeat','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Fetching\x20parent\x20segment\x20details...','createdAt','diff','delete','parentName','Error:\x20','\x27...','all'];a29_0x53e8=function(){return _0x4ee03b;};return a29_0x53e8();}import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a29_0x2c3d15(0x241);[a29_0x2c3d15(0x1d5)]=a29_0x2c3d15(0x251);async[a29_0x2c3d15(0x1d4)](_0x141a60){const _0x564bf7=a29_0x2c3d15,{options:_0x364e84,args:_0x5cc4f4,tdx:_0x3e41d1}=_0x141a60,_0xbff4b2=_0x364e84,_0x4cc232=await resolveTarget({'arg':_0x5cc4f4[0x0],'contextParent':_0x364e84['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4cc232))return _0x4cc232[_0x564bf7(0x209)]===_0x564bf7(0x200)?(console[_0x564bf7(0x1e5)](a29_0x57bff8['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x564bf7(0x1e5)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x564bf7(0x1e5)](_0x564bf7(0x1f0)),console['error'](_0x564bf7(0x24c))):(console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x1c8)+_0x4cc232[_0x564bf7(0x1e0)]+'\x0a')),_0x4cc232[_0x564bf7(0x1fd)]&&console[_0x564bf7(0x1e5)](a29_0x57bff8['cyan'](_0x4cc232[_0x564bf7(0x1fd)]))),0x1;if(_0x4cc232[_0x564bf7(0x210)]===_0x564bf7(0x252))return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x204)+_0x4cc232[_0x564bf7(0x1ef)]+'\x0a')),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1cc)](_0x564bf7(0x1f9))),0x1;const _0x1715fe=_0x4cc232[_0x564bf7(0x1c7)],_0x5319cf=_0x4cc232[_0x564bf7(0x1ef)],_0x31bb89=_0x4cc232[_0x564bf7(0x210)]===_0x564bf7(0x247)?_0x4cc232[_0x564bf7(0x1d8)]:undefined,_0x5c1d9a=getScopedDetails(_0x4cc232),_0x4c9c8d=_0x5c1d9a?.['isScoped']??![],_0x40e54b=_0x5c1d9a?.[_0x564bf7(0x1dc)]??'';if(!existsSync(_0x5319cf))return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x204)+_0x5319cf+'\x0a')),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1cc)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0xbff4b2[_0x564bf7(0x206)]&&(console[_0x564bf7(0x1e5)]('Site:\x20'+_0xbff4b2[_0x564bf7(0x203)]),console[_0x564bf7(0x1e5)]('Parent\x20segment:\x20'+_0x1715fe),console[_0x564bf7(0x1e5)](_0x564bf7(0x217)+_0x5319cf),_0x4c9c8d&&console['error'](_0x564bf7(0x214)+_0x40e54b));const _0x3bd9b4=await withSpinner(_0x564bf7(0x218)+_0x1715fe+_0x564bf7(0x1c9),()=>_0x3e41d1['segment'][_0x564bf7(0x1cf)](_0x1715fe),{'verbose':_0xbff4b2[_0x564bf7(0x206)]}),_0x486b22=_0x3bd9b4[_0x564bf7(0x1b7)],[_0x349980,_0x916f4,_0x359655,_0x2e5060,_0x321f02]=await Promise[_0x564bf7(0x1ca)]([withSpinner(_0x564bf7(0x1c3),()=>_0x3e41d1[_0x564bf7(0x1fe)][_0x564bf7(0x1b8)](_0x486b22),{'verbose':_0xbff4b2[_0x564bf7(0x206)]}),withSpinner(_0x564bf7(0x243),()=>_0x3e41d1[_0x564bf7(0x1fe)]['listSegments'](_0x486b22),{'verbose':_0xbff4b2['verbose']}),withSpinner(_0x564bf7(0x1ee),()=>_0x3e41d1['segment'][_0x564bf7(0x23b)](_0x486b22),{'verbose':_0xbff4b2['verbose']}),withSpinner(_0x564bf7(0x24d),()=>_0x3e41d1[_0x564bf7(0x1de)][_0x564bf7(0x226)](_0x486b22),{'verbose':_0xbff4b2[_0x564bf7(0x206)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x3e41d1[_0x564bf7(0x225)][_0x564bf7(0x220)](),{'verbose':_0xbff4b2[_0x564bf7(0x206)]})[_0x564bf7(0x213)](_0x33027f=>_0x33027f['data'])]),_0x4bca0b=_0x349980[_0x564bf7(0x1b7)],_0x4e3151=extractRootFolderId(_0x4bca0b),_0x5b957c=_0x916f4[_0x564bf7(0x1b7)],_0x3aad06=_0x359655[_0x564bf7(0x1b7)],{journeys:_0x432906,activationStepsById:_0x18f394}=_0x2e5060[_0x564bf7(0x1b7)],_0x16fbe7=new Map(_0x432906['map'](_0x59c444=>[_0x59c444['id'],_0x59c444])),_0x27be1b=_0x432906['map'](_0xc55420=>({'id':_0xc55420['id'],'name':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x1e7)],'journeyBundleName':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x215)]||'','journeyBundleId':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x221)]||'','versionNumber':_0xc55420['attributes']['versionNumber'],'description':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x1d5)],'state':_0xc55420[_0x564bf7(0x205)]['state'],'paused':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x23a)],'audienceId':_0xc55420[_0x564bf7(0x205)]['audienceId'],'folderId':_0xc55420['relationships']?.[_0x564bf7(0x231)]?.['data']?.['id'],'createdAt':_0xc55420[_0x564bf7(0x205)][_0x564bf7(0x1c4)],'updatedAt':_0xc55420[_0x564bf7(0x205)]['updatedAt']})),{emailToId:_0x45d6fa,idToEmail:_0x18d96c}=_0x321f02,_0x5f46eb=await withSpinner(_0x564bf7(0x1ea),async()=>{const _0x55b53e=_0x564bf7,_0x140a65=await _0x3e41d1[_0x55b53e(0x20e)][_0x55b53e(0x21f)]();return buildConnectionMaps(_0x140a65);},{'verbose':_0xbff4b2['verbose']})[_0x564bf7(0x213)](_0x1511b8=>_0x1511b8['data']),_0x465c2f=_0x5f46eb['nameToId'],_0x3f55df=_0x5f46eb['idToName'],_0x51715e=_0x5f46eb[_0x564bf7(0x20a)],_0x3313df={'emailToIdMap':_0x45d6fa,'connectionNameToIdMap':_0x465c2f,'connectionNameToTypeMap':_0x51715e,'getSchema':_0x33685a=>_0x3e41d1[_0x564bf7(0x20e)][_0x564bf7(0x1d7)](_0x33685a)};let {pathToId:_0x1b75d9,idToPath:_0x305d57}=buildFolderMaps(_0x3aad06);const _0x47e3ed=buildSegmentLookupMap(_0x5b957c,_0x305d57),_0x5b61ff=buildSegmentNameToIdMap(_0x5b957c),_0x1f30e8=buildJourneyBundleLookupMap(_0x27be1b,_0x305d57);let _0x29ad8a;if(_0x31bb89){if(!_0x31bb89[_0x564bf7(0x24b)](_0x564bf7(0x22f))&&!_0x31bb89[_0x564bf7(0x24b)](_0x564bf7(0x234)))return console['error'](a29_0x57bff8['red'](_0x564bf7(0x1c2)+_0x31bb89+'\x0a')),0x1;_0x29ad8a=[_0x31bb89];}else _0x29ad8a=findYamlFiles(_0x5319cf);if(_0x29ad8a[_0x564bf7(0x24f)]===0x0)return console[_0x564bf7(0x1e5)](a29_0x57bff8['red'](_0x564bf7(0x249)+_0x5319cf+'\x0a')),console[_0x564bf7(0x1e5)](a29_0x57bff8['cyan'](_0x564bf7(0x1ec))),0x1;let _0x15f949,_0x26f58a;try{const _0x3c1807=parseAndClassifyYamlFiles(_0x29ad8a,_0x5319cf,{'skipSegments':_0xbff4b2[_0x564bf7(0x248)]});_0x15f949=_0x3c1807[_0x564bf7(0x20f)],_0x26f58a=_0x3c1807[_0x564bf7(0x1ce)];const _0x11d696=validateParsedFiles(_0x3c1807,_0x5319cf);if(_0x11d696[_0x564bf7(0x24f)]>0x0)return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)](_0x564bf7(0x1f1))),console[_0x564bf7(0x1e5)](formatValidationErrors(_0x11d696)),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x22c)](_0x564bf7(0x229))),0x1;}catch(_0x3bd83e){return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)]('Error\x20parsing\x20YAML:\x20'+(_0x3bd83e instanceof Error?_0x3bd83e['message']:_0x3bd83e))),0x1;}if(_0x15f949[_0x564bf7(0x24f)]===0x0&&_0x26f58a[_0x564bf7(0x24f)]===0x0){const _0x24d0ab=_0xbff4b2['journeysOnly']?_0x564bf7(0x1de):_0x564bf7(0x23f);return console[_0x564bf7(0x1e5)](a29_0x57bff8['yellow'](_0x564bf7(0x1f5)+_0x24d0ab+_0x564bf7(0x1ba))),0x0;}const _0x4aca1c=new Map();_0x5b957c[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x5b957c,async _0x4ec704=>{const _0xb77b26=a29_0x3df0,_0x17bdf7=await _0x3e41d1[_0xb77b26(0x1fe)]['listActivations'](_0x486b22,_0x4ec704['id']);_0x4aca1c[_0xb77b26(0x250)](_0x4ec704['id'],_0x17bdf7);});},{'verbose':_0xbff4b2[_0x564bf7(0x206)]});const {segmentFiles:_0xd09378,foldersToCreate:_0x25bcdb}=await prepareSegmentFiles(_0x15f949,{'segmentByFolderAndName':_0x47e3ed,'activationsBySegmentId':_0x4aca1c,'folderPathToId':_0x1b75d9,'idToEmailMap':_0x18d96c,'connectionIdToNameMap':_0x3f55df},_0x3313df,_0x4c9c8d,_0x40e54b),_0x2ead6b=_0x31bb89?[]:findSegmentsToDelete(_0x5b957c,_0x15f949['map'](({yamlConfig:_0x425623,folderPath:_0x131ad3})=>({'yamlConfig':_0x425623,'folderPath':resolveTDFolderPath(_0x131ad3,_0x4c9c8d,_0x40e54b)})),_0x305d57,_0x40e54b,_0x4c9c8d),{journeyFiles:_0x2d98f9,foldersToCreate:_0x1ed6e1}=await withProgressSpinner(_0x564bf7(0x1f3),async _0x3c6370=>prepareJourneyFiles(_0x26f58a,{'fetchJourney':async _0xdb2ba7=>_0x3e41d1[_0x564bf7(0x1de)][_0x564bf7(0x1d6)](_0xdb2ba7[_0x564bf7(0x1bd)]),'journeyBundlesByFolderAndName':_0x1f30e8,'folderPathToId':_0x1b75d9,'idToEmailMap':_0x18d96c,'connectionIdToNameMap':_0x3f55df,'existingSegments':_0x5b957c,'parentId':_0x486b22,'deps':_0x3e41d1,'progress':{'update':_0x364d96=>{const _0x1abeb9=_0x564bf7;_0x3c6370[_0x1abeb9(0x228)](_0x364d96),_0xbff4b2[_0x1abeb9(0x206)]&&console[_0x1abeb9(0x1e5)]('\x20\x20'+_0x364d96);}},'journeyById':_0x16fbe7,'activationStepsById':_0x18f394},_0x4c9c8d,_0x40e54b),{'verbose':_0xbff4b2['verbose']})[_0x564bf7(0x213)](_0x43e49d=>_0x43e49d[_0x564bf7(0x1b7)]);for(const _0x9742bc of _0x1ed6e1){_0x25bcdb[_0x564bf7(0x1d0)](_0x9742bc);}const _0x3a93b1=_0x31bb89?[]:findJourneysToDelete(_0x27be1b,_0x26f58a[_0x564bf7(0x222)](({yamlConfig:_0x5489ae,folderPath:_0x16b23c})=>({'yamlConfig':_0x5489ae,'folderPath':resolveTDFolderPath(_0x16b23c,_0x4c9c8d,_0x40e54b)})),_0x305d57,_0x40e54b,_0x4c9c8d),_0x38609e=calculatePushStats(_0xd09378,_0x2d98f9,_0x25bcdb,_0x2ead6b,_0x3a93b1,!!_0xbff4b2[_0x564bf7(0x1c6)],!!_0xbff4b2[_0x564bf7(0x248)]),_0x23f765=_0x38609e['segments'][_0x564bf7(0x1e1)],_0x46774c=_0x38609e[_0x564bf7(0x20f)][_0x564bf7(0x253)],_0x42e718=_0x38609e[_0x564bf7(0x20f)][_0x564bf7(0x1b6)],_0x15e42c=_0x38609e[_0x564bf7(0x20f)][_0x564bf7(0x208)],_0x4c0899=_0x38609e[_0x564bf7(0x22a)]['toCreate'],_0x5b17e6=_0x38609e[_0x564bf7(0x1ce)][_0x564bf7(0x1e1)],_0x3c3c7d=_0x38609e['journeys'][_0x564bf7(0x253)],_0x1badb2=_0x38609e[_0x564bf7(0x1ce)][_0x564bf7(0x1b6)],_0x1f2e89=_0x38609e[_0x564bf7(0x1ce)]['toDelete'],_0x6636b3=_0x38609e[_0x564bf7(0x1dd)][_0x564bf7(0x1ca)],_0x2db30c=_0x38609e['activations']['toCreate'],_0x277052=_0x38609e[_0x564bf7(0x1dd)][_0x564bf7(0x22e)],_0x2fcba0=_0x38609e[_0x564bf7(0x1dd)][_0x564bf7(0x208)];console[_0x564bf7(0x1e5)](_0x564bf7(0x1e9)+_0x1715fe+'\x27:');_0x4c0899[_0x564bf7(0x24f)]>0x0&&console[_0x564bf7(0x1e5)]('\x20\x20'+a29_0x57bff8[_0x564bf7(0x230)](_0x564bf7(0x21e)+_0x4c0899[_0x564bf7(0x24f)]+_0x564bf7(0x22d)));if(!_0xbff4b2[_0x564bf7(0x248)]){console['error'](_0x564bf7(0x1ed)),console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8['green']('+\x20'+_0x23f765[_0x564bf7(0x24f)]+_0x564bf7(0x1d9))),console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8[_0x564bf7(0x22c)]('~\x20'+_0x46774c['length']+_0x564bf7(0x1f4)));if(_0x15e42c[_0x564bf7(0x24f)]>0x0)console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x1d2)]('-\x20'+_0x15e42c[_0x564bf7(0x24f)]+'\x20to\x20delete'));else _0x2ead6b[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x1c6)]&&console['error'](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x245)](_0x2ead6b['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x245)]('=\x20'+_0x42e718[_0x564bf7(0x24f)]+'\x20unchanged'));}if(_0x2d98f9[_0x564bf7(0x24f)]>0x0||_0x3a93b1[_0x564bf7(0x24f)]>0x0){console[_0x564bf7(0x1e5)](_0x564bf7(0x227)),console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8['green']('+\x20'+_0x5b17e6[_0x564bf7(0x24f)]+'\x20new')),console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x22c)]('~\x20'+_0x3c3c7d[_0x564bf7(0x24f)]+'\x20changed'));if(_0x1f2e89[_0x564bf7(0x24f)]>0x0)console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8[_0x564bf7(0x1d2)]('-\x20'+_0x1f2e89[_0x564bf7(0x24f)]+'\x20to\x20delete'));else _0x3a93b1['length']>0x0&&!_0xbff4b2[_0x564bf7(0x1c6)]&&console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8['dim'](_0x3a93b1[_0x564bf7(0x24f)]+_0x564bf7(0x1e2)));console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x245)]('=\x20'+_0x1badb2[_0x564bf7(0x24f)]+_0x564bf7(0x1f6)));}_0x6636b3['length']>0x0&&!_0xbff4b2[_0x564bf7(0x248)]&&(console['error'](''),console['error'](_0x564bf7(0x1bb)),_0x2db30c['length']>0x0&&console[_0x564bf7(0x1e5)](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x1e8)]('+\x20'+_0x2db30c['length']+_0x564bf7(0x1e6))),_0x277052[_0x564bf7(0x24f)]>0x0&&console[_0x564bf7(0x1e5)]('\x20\x20\x20\x20'+a29_0x57bff8[_0x564bf7(0x22c)]('~\x20'+_0x277052[_0x564bf7(0x24f)]+_0x564bf7(0x1eb))),_0x2fcba0[_0x564bf7(0x24f)]>0x0&&console['error'](_0x564bf7(0x202)+a29_0x57bff8[_0x564bf7(0x1d2)]('-\x20'+_0x2fcba0[_0x564bf7(0x24f)]+_0x564bf7(0x1d1))));console[_0x564bf7(0x1e5)](_0x564bf7(0x1db)+a29_0x57bff8['cyan'](_0x5319cf)+'\x0a');if(_0x4c0899[_0x564bf7(0x24f)]>0x0){console['error'](_0x564bf7(0x1f7));for(const _0x5c941d of _0x4c0899){console[_0x564bf7(0x1e5)]('\x20\x20'+a29_0x57bff8[_0x564bf7(0x230)]('+')+'\x20'+_0x5c941d);}console[_0x564bf7(0x1e5)]('');}if(_0x23f765[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)])for(const _0x3fe117 of _0x23f765){const _0x325345=_0x3fe117[_0x564bf7(0x237)]?_0x3fe117[_0x564bf7(0x237)]+'/'+_0x3fe117[_0x564bf7(0x207)][_0x564bf7(0x1e7)]:_0x3fe117[_0x564bf7(0x207)]['name'],_0x4f824b=_0x3fe117[_0x564bf7(0x207)][_0x564bf7(0x1dd)]?.[_0x564bf7(0x24f)]||0x0,_0x489c89=_0x4f824b>0x0?a29_0x57bff8['dim']('\x20['+_0x4f824b+'\x20activations]'):'';console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8[_0x564bf7(0x1e8)](_0x564bf7(0x219))+'\x20'+_0x325345+_0x489c89),console['error']('─'[_0x564bf7(0x1c1)](0x3c)),_0x3fe117[_0x564bf7(0x1c5)]&&console['error'](_0x3fe117[_0x564bf7(0x1c5)]),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c));}if(_0x15e42c['length']>0x0&&!_0xbff4b2[_0x564bf7(0x248)])for(const _0x3e819d of _0x15e42c){const _0x5d5d9d=_0x3e819d[_0x564bf7(0x235)]?_0x305d57[_0x564bf7(0x20d)](_0x3e819d[_0x564bf7(0x235)][_0x564bf7(0x244)]())||'':'',_0x4e6f72=_0x5d5d9d?_0x5d5d9d+'/'+_0x3e819d['name']:_0x3e819d[_0x564bf7(0x1e7)],_0x241b53=_0x4aca1c['get'](_0x3e819d['id'])||[],_0x503cdb=_0x241b53[_0x564bf7(0x24f)]>0x0?a29_0x57bff8['dim']('\x20['+_0x241b53[_0x564bf7(0x24f)]+_0x564bf7(0x21c)):'';console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8['red'](_0x564bf7(0x246))+'\x20'+_0x4e6f72+_0x503cdb),console[_0x564bf7(0x1e5)]('─'['repeat'](0x3c));const _0x402202=segmentWithActivationsToYaml(_0x3e819d,_0x241b53,undefined,_0x18d96c,_0x3f55df),_0x17c1f2=segmentToYamlString(_0x402202),_0x2d9058=generateDiff(_0x17c1f2,'');console['error'](formatDiffWithColors(_0x2d9058)),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c));}const _0x4a2bb5=_0xd09378[_0x564bf7(0x24a)](_0x319fe2=>!_0x319fe2[_0x564bf7(0x242)]&&_0x319fe2['diff']);if(_0x4a2bb5[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)])for(const _0x4d3b88 of _0x4a2bb5){const _0x178543=_0x4d3b88[_0x564bf7(0x237)]?_0x4d3b88['folderPath']+'/'+_0x4d3b88[_0x564bf7(0x207)][_0x564bf7(0x1e7)]:_0x4d3b88[_0x564bf7(0x207)][_0x564bf7(0x1e7)];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8['yellow'](_0x564bf7(0x1da))+'\x20'+_0x178543),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c)),console[_0x564bf7(0x1e5)](_0x4d3b88[_0x564bf7(0x1c5)]),console[_0x564bf7(0x1e5)]('─'['repeat'](0x3c));}if(_0x5b17e6[_0x564bf7(0x24f)]>0x0)for(const _0x1dd694 of _0x5b17e6){const _0x3c51cb=_0x1dd694[_0x564bf7(0x237)]?_0x1dd694[_0x564bf7(0x237)]+'/'+_0x1dd694[_0x564bf7(0x207)][_0x564bf7(0x1e7)]:_0x1dd694['yamlConfig'][_0x564bf7(0x1e7)];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8['green'](_0x564bf7(0x24e))+'\x20'+_0x3c51cb),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c)),_0x1dd694[_0x564bf7(0x1c5)]&&console[_0x564bf7(0x1e5)](_0x1dd694[_0x564bf7(0x1c5)]),console['error']('─'[_0x564bf7(0x1c1)](0x3c));}const _0x5b32a1=_0x2d98f9[_0x564bf7(0x24a)](_0x4570f2=>!_0x4570f2[_0x564bf7(0x242)]&&_0x4570f2[_0x564bf7(0x1c5)]);if(_0x5b32a1[_0x564bf7(0x24f)]>0x0)for(const _0x4e4ecd of _0x5b32a1){const _0xe6b659=_0x4e4ecd[_0x564bf7(0x237)]?_0x4e4ecd[_0x564bf7(0x237)]+'/'+_0x4e4ecd['yamlConfig'][_0x564bf7(0x1e7)]:_0x4e4ecd[_0x564bf7(0x207)]['name'];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8[_0x564bf7(0x22c)](_0x564bf7(0x1b9))+'\x20'+_0xe6b659),console[_0x564bf7(0x1e5)]('─'['repeat'](0x3c)),console[_0x564bf7(0x1e5)](_0x4e4ecd[_0x564bf7(0x1c5)]),console['error']('─'[_0x564bf7(0x1c1)](0x3c));}if(_0x1f2e89[_0x564bf7(0x24f)]>0x0)for(const _0x51ee0d of _0x1f2e89){const _0x426688=_0x51ee0d[_0x564bf7(0x1df)]?_0x305d57[_0x564bf7(0x20d)](_0x51ee0d[_0x564bf7(0x1df)])||'':'',_0x5ee445=_0x426688?_0x426688+'/'+_0x51ee0d[_0x564bf7(0x215)]:_0x51ee0d[_0x564bf7(0x215)];console[_0x564bf7(0x1e5)]('\x0a'+a29_0x57bff8[_0x564bf7(0x1d2)]('Delete\x20journey:')+'\x20'+_0x5ee445),console['error']('─'[_0x564bf7(0x1c1)](0x3c)),console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)]('(Journey\x20will\x20be\x20deleted)')),console[_0x564bf7(0x1e5)]('─'[_0x564bf7(0x1c1)](0x3c));}if(_0xbff4b2['dryRun'])return console['error'](a29_0x57bff8[_0x564bf7(0x22c)](_0x564bf7(0x240))),0x0;const _0x1e8353=_0xbff4b2[_0x564bf7(0x248)]?![]:_0x23f765[_0x564bf7(0x24f)]>0x0||_0x46774c[_0x564bf7(0x24f)]>0x0||_0x15e42c[_0x564bf7(0x24f)]>0x0,_0x2faaa6=_0x5b17e6[_0x564bf7(0x24f)]>0x0||_0x3c3c7d['length']>0x0||_0x1f2e89[_0x564bf7(0x24f)]>0x0,_0x3c1cf0=_0xbff4b2['journeysOnly']?![]:_0x6636b3['length']>0x0,_0x1d1429=_0x4c0899['length']>0x0;if(!_0x1e8353&&!_0x2faaa6&&!_0x3c1cf0&&!_0x1d1429){const _0x2d4e49=_0xbff4b2[_0x564bf7(0x248)]?_0x564bf7(0x239):_0x564bf7(0x212);console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1e8)](_0x2d4e49));if(_0x31bb89&&_0x1badb2[_0x564bf7(0x24f)]===0x1){const _0x3788a3=_0x1badb2[0x0];if(_0x3788a3[_0x564bf7(0x23e)]?.['id']){const _0x4ca696=getConsoleNextUrl(_0xbff4b2[_0x564bf7(0x203)],_0x564bf7(0x1fb)+_0x486b22+_0x564bf7(0x1fa)+_0x3788a3[_0x564bf7(0x23e)]['id']+_0x564bf7(0x1c0));console[_0x564bf7(0x1e5)]('\x20\x20'+a29_0x57bff8[_0x564bf7(0x1cc)](_0x4ca696));}}return 0x0;}const _0x4dae83=_0xbff4b2[_0x564bf7(0x248)]?_0x5b17e6[_0x564bf7(0x24f)]+_0x3c3c7d['length']+_0x1f2e89[_0x564bf7(0x24f)]+_0x4c0899[_0x564bf7(0x24f)]:_0x23f765[_0x564bf7(0x24f)]+_0x46774c[_0x564bf7(0x24f)]+_0x15e42c[_0x564bf7(0x24f)]+_0x5b17e6[_0x564bf7(0x24f)]+_0x3c3c7d[_0x564bf7(0x24f)]+_0x1f2e89[_0x564bf7(0x24f)]+_0x4c0899[_0x564bf7(0x24f)]+_0x6636b3[_0x564bf7(0x24f)];if(!_0xbff4b2['yes']&&_0x4dae83>0x0){const _0x5b93ff=await confirmKey(_0x564bf7(0x1e4)+_0x4dae83+_0x564bf7(0x232));if(!_0x5b93ff)return console[_0x564bf7(0x1e5)](_0x564bf7(0x233)),0x1;}const _0x1c0cd8={'withProgress':async(_0x3229ea,_0x22c69b)=>{const _0x317ab4=_0x564bf7,_0x500cc5=await withSpinner(_0x3229ea,_0x22c69b,{'verbose':_0xbff4b2[_0x317ab4(0x206)]});return{'data':_0x500cc5[_0x317ab4(0x1b7)]};},'logInfo':_0x4a6cd4=>console['error'](a29_0x57bff8[_0x564bf7(0x230)]('✔\x20'+_0x4a6cd4)),'logSuccess':_0x32986b=>console[_0x564bf7(0x1e5)](a29_0x57bff8['green']('✔\x20'+_0x32986b)),'logWarning':_0x4425a4=>console[_0x564bf7(0x1e5)](a29_0x57bff8['yellow']('⚠\x20'+_0x4425a4)),'logDeleted':_0x327d9b=>console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1d2)]('✔\x20'+_0x327d9b))},_0x26e833={'segment':_0x3e41d1[_0x564bf7(0x1fe)],'journey':_0x3e41d1['journey'],'user':_0x3e41d1[_0x564bf7(0x225)],'connection':_0x3e41d1[_0x564bf7(0x20e)]};_0x4c0899[_0x564bf7(0x24f)]>0x0&&(_0x1b75d9=await executePushFolders(_0x26e833,_0x4c0899,_0x1b75d9,{'parentId':_0x486b22},_0x1c0cd8));const _0x17336e={'rootFolderId':_0x4e3151,'folderPathToId':_0x1b75d9,'folderIdToPath':_0x305d57,'segmentNameToId':_0x5b61ff,'activationsBySegmentId':_0x4aca1c,'emailToIdMap':_0x45d6fa,'idToEmailMap':_0x18d96c,'connectionNameToIdMap':_0x5f46eb[_0x564bf7(0x1cb)],'connectionIdToNameMap':_0x5f46eb[_0x564bf7(0x1d3)],'connectionNameToTypeMap':_0x51715e},_0x57b598=await executePushSegments(_0x26e833,_0xbff4b2[_0x564bf7(0x248)]?[]:_0xd09378,_0x17336e,{'parentId':_0x486b22},_0x1c0cd8),_0x3ad85e=_0x57b598[_0x564bf7(0x1fc)],_0x53c002=_0x57b598[_0x564bf7(0x20c)],_0x40bf85=_0x57b598[_0x564bf7(0x1dd)][_0x564bf7(0x1fc)],_0x108434=_0x57b598[_0x564bf7(0x1dd)][_0x564bf7(0x20c)],_0x38dcec=_0x57b598[_0x564bf7(0x1dd)][_0x564bf7(0x21a)],_0x3981a4=await executePushSegmentDeletions(_0x26e833,_0xbff4b2[_0x564bf7(0x248)]?[]:_0x15e42c,_0x1c0cd8);let _0x21b865=0x0,_0x3d6f62=0x0,_0x509c88=0x0;const _0xc9eb6a=new Map(_0x5b61ff);for(const [_0x1b2e09,_0x3c92a4]of _0x57b598[_0x564bf7(0x1cd)]){_0xc9eb6a[_0x564bf7(0x250)](_0x1b2e09,_0x3c92a4);}if(_0x2d98f9['length']>0x0){const _0x529349={..._0x17336e,'segmentNameToId':_0xc9eb6a,'existingSegments':_0x5b957c,'activationContext':_0x3313df},_0xb12e38=await executePushJourneys(_0x26e833,_0x2d98f9,_0x529349,{'parentId':_0x486b22,'rootFolderId':_0x4e3151,'verbose':_0xbff4b2['verbose']},_0x1c0cd8);_0x21b865=_0xb12e38['created'],_0x3d6f62=_0xb12e38[_0x564bf7(0x20c)];if(_0x31bb89&&_0xb12e38[_0x564bf7(0x216)][_0x564bf7(0x24f)]===0x1){const _0x167f95=_0xb12e38['results'][0x0];if(_0x167f95[_0x564bf7(0x1bd)]){const _0x451610=getConsoleNextUrl(_0xbff4b2[_0x564bf7(0x203)],_0x564bf7(0x1fb)+_0x486b22+_0x564bf7(0x1fa)+_0x167f95['journeyId']+'/j/da/je');console['error']('\x20\x20'+a29_0x57bff8[_0x564bf7(0x1cc)](_0x451610));}}}for(const _0x2b8d6f of _0x1f2e89){console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x22c)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x2b8d6f[_0x564bf7(0x215)])),_0x509c88++;}const _0x549aa0=[];if(_0x3ad85e>0x0)_0x549aa0[_0x564bf7(0x1bf)](_0x3ad85e+_0x564bf7(0x224));if(_0x53c002>0x0)_0x549aa0[_0x564bf7(0x1bf)](_0x53c002+'\x20updated');if(_0x3981a4>0x0)_0x549aa0[_0x564bf7(0x1bf)](_0x3981a4+'\x20deleted');const _0x3111b0=[];if(_0x21b865>0x0)_0x3111b0[_0x564bf7(0x1bf)](_0x21b865+_0x564bf7(0x224));if(_0x3d6f62>0x0)_0x3111b0['push'](_0x3d6f62+_0x564bf7(0x223));if(_0x509c88>0x0)_0x3111b0[_0x564bf7(0x1bf)](_0x509c88+'\x20deleted');const _0x437b4a=[];if(_0x40bf85>0x0)_0x437b4a['push'](_0x40bf85+_0x564bf7(0x224));if(_0x108434>0x0)_0x437b4a[_0x564bf7(0x1bf)](_0x108434+_0x564bf7(0x223));if(_0x38dcec>0x0)_0x437b4a[_0x564bf7(0x1bf)](_0x38dcec+_0x564bf7(0x1f8));return console[_0x564bf7(0x1e5)](a29_0x57bff8[_0x564bf7(0x1e8)](_0x564bf7(0x23c))),_0x549aa0[_0x564bf7(0x24f)]>0x0&&!_0xbff4b2[_0x564bf7(0x248)]&&console[_0x564bf7(0x1e5)](_0x564bf7(0x21b)+_0x549aa0[_0x564bf7(0x23d)](',\x20')),_0x3111b0[_0x564bf7(0x24f)]>0x0&&console[_0x564bf7(0x1e5)](_0x564bf7(0x1ff)+_0x3111b0[_0x564bf7(0x23d)](',\x20')),_0x437b4a['length']>0x0&&!_0xbff4b2['journeysOnly']&&console[_0x564bf7(0x1e5)]('\x20\x20Activations:\x20'+_0x437b4a[_0x564bf7(0x23d)](',\x20')),0x0;}}
|
|
1
|
+
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
|
-
|
|
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;}}
|