@treasuredata/tdx 2026.3.40 → 2026.3.42
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 +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-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/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-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/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-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/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +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/oauth-keychain.js +1 -1
- package/dist/core/oauth.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/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.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/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +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/oauth-refresh.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/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +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-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +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-validator.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-recovery.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/segment-validator.js +1 -1
- package/dist/sdk/segment/segment-validator.js.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.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/cdp.d.ts +3 -0
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.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/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +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/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.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 a41_0x3b9d46=a41_0x2b47;(function(_0x204c55,_0x56e854){const _0x2de237=a41_0x2b47,_0x3f556c=_0x204c55();while(!![]){try{const _0x3fe232=-parseInt(_0x2de237(0x1e2))/0x1*(-parseInt(_0x2de237(0x1e3))/0x2)+parseInt(_0x2de237(0x1d5))/0x3*(-parseInt(_0x2de237(0x1d8))/0x4)+-parseInt(_0x2de237(0x1df))/0x5*(parseInt(_0x2de237(0x1d4))/0x6)+-parseInt(_0x2de237(0x1f1))/0x7+parseInt(_0x2de237(0x1d9))/0x8*(-parseInt(_0x2de237(0x1ce))/0x9)+-parseInt(_0x2de237(0x1e5))/0xa+parseInt(_0x2de237(0x1e4))/0xb*(parseInt(_0x2de237(0x1c5))/0xc);if(_0x3fe232===_0x56e854)break;else _0x3f556c['push'](_0x3f556c['shift']());}catch(_0x5ddc69){_0x3f556c['push'](_0x3f556c['shift']());}}}(a41_0x4742,0xb93f4));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';function a41_0x4742(){const _0x31950f=['✔\x20Pulled\x20','verbose','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)','journeys','Parent\x20segment:\x20','filter','counts','✔\x20All\x20files\x20are\x20up\x20to\x20date','content','yellow','pullSegments','length','segment:pull','message','cyan','\x20=\x20','execute','hasChanges','targetDir','absolutePath','dryRun','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','segment','parent_segment','relativePath','description','\x20unchanged\x20files','\x20\x20🗺️\x20\x20','files','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','green','dim','data','-\x20no\x20files\x20written','\x0aPull\x20summary\x20for\x20\x27','Target\x20resource:\x20','43043724Zqtljb','type','\x20with\x20','\x20activations','isNew','red','parentSegment','Error:\x20','Aborted.','7789905UJVEEG','parentName','helpText','name','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','file','68982qutBnV','1492434ZYpRBe','resourceName','error','12tMrakf','8GsIlWy','dirname','session','activations','\x20versions)','cwd','110iuZgHy','\x0aChanges\x20to\x20\x27','diff','590558MqhdnR','4zmQycu','11LhBzdc','5436900cEWeza','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Target:\x20','errorCode','journeyVersions','repeat','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x0aError:','Pulling\x20segments\x20from\x20\x27','yes','✔\x20Context\x20set:\x20','segments','5983026GDGvmd'];a41_0x4742=function(){return _0x31950f;};return a41_0x4742();}import a41_0x497ea5 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a41_0x16aba7 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a41_0x2b47(_0x11bb4a,_0x44890a){_0x11bb4a=_0x11bb4a-0x1b8;const _0x474272=a41_0x4742();let _0x2b47e2=_0x474272[_0x11bb4a];return _0x2b47e2;}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a41_0x3b9d46(0x1d1)]=a41_0x3b9d46(0x1fe);[a41_0x3b9d46(0x1ba)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async[a41_0x3b9d46(0x202)](_0x301cc7){const _0x3cb215=a41_0x3b9d46,{options:_0x494a8b,args:_0x5e9dcf,tdx:_0x29dbb1}=_0x301cc7,_0x370e61=_0x494a8b,_0x5ae703=await resolveTarget({'arg':_0x5e9dcf[0x0],'contextParent':_0x494a8b[_0x3cb215(0x1cb)],'cwd':process[_0x3cb215(0x1de)]()});if(!isSuccessfulResolution(_0x5ae703))return _0x5ae703[_0x3cb215(0x1e8)]==='no_parent'?(console[_0x3cb215(0x1d7)](a41_0x497ea5[_0x3cb215(0x1fb)](_0x3cb215(0x1e6))),console[_0x3cb215(0x1d7)](_0x3cb215(0x1f4)),console[_0x3cb215(0x1d7)](_0x3cb215(0x1eb)),console['error']('\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[_0x3cb215(0x1d7)](a41_0x497ea5[_0x3cb215(0x1ca)](_0x3cb215(0x1cc)+_0x5ae703[_0x3cb215(0x1ff)]+'\x0a')),_0x5ae703['helpText']&&console[_0x3cb215(0x1d7)](a41_0x497ea5[_0x3cb215(0x200)](_0x5ae703[_0x3cb215(0x1d0)]))),0x1;const _0x4c3821=_0x5ae703['parentName'],_0x26107a=_0x5ae703[_0x3cb215(0x204)],_0x27369d=_0x5ae703[_0x3cb215(0x1c6)]===_0x3cb215(0x1d3)?_0x5ae703[_0x3cb215(0x1d6)]:undefined;_0x370e61['verbose']&&(console['error']('Site:\x20'+_0x370e61['site']),console[_0x3cb215(0x1d7)](_0x3cb215(0x1f6)+_0x4c3821),_0x27369d&&console[_0x3cb215(0x1d7)](_0x3cb215(0x1c4)+_0x27369d));const _0x479aac=await withProgressSpinner(_0x3cb215(0x1ed)+_0x4c3821+'\x27...',_0x1e7770=>_0x29dbb1[_0x3cb215(0x208)][_0x3cb215(0x1fc)](_0x4c3821,{'targetDir':_0x26107a,'targetResourceName':_0x27369d,'verbose':_0x370e61['verbose'],'progress':{'update':_0x606e8d=>{const _0x5a29da=_0x3cb215;_0x1e7770['setPhase'](_0x606e8d),_0x370e61[_0x5a29da(0x1f3)]&&console[_0x5a29da(0x1d7)]('\x20\x20'+_0x606e8d);}}}),{'verbose':_0x370e61[_0x3cb215(0x1f3)]}),_0x5523c1=_0x479aac[_0x3cb215(0x1c1)];if(_0x5523c1[_0x3cb215(0x1f8)][_0x3cb215(0x1f0)]===0x0&&_0x5523c1[_0x3cb215(0x1f8)][_0x3cb215(0x1f5)]===0x0)return console[_0x3cb215(0x1d7)](a41_0x497ea5['yellow'](_0x3cb215(0x207)+_0x5523c1['parentName']+'\x27')),0x0;const _0x586cdf=_0x5523c1['files'][_0x3cb215(0x1f7)](_0x5b596d=>_0x5b596d[_0x3cb215(0x1c9)]),_0x225b15=_0x5523c1[_0x3cb215(0x1bd)][_0x3cb215(0x1f7)](_0x490ffc=>!_0x490ffc[_0x3cb215(0x1c9)]&&_0x490ffc[_0x3cb215(0x203)]),_0x440469=_0x5523c1['files'][_0x3cb215(0x1f7)](_0x1ed9c0=>!_0x1ed9c0[_0x3cb215(0x1c9)]&&!_0x1ed9c0[_0x3cb215(0x203)]);console['error'](_0x3cb215(0x1c3)+_0x5523c1[_0x3cb215(0x1cf)]+'\x27:'),console[_0x3cb215(0x1d7)]('\x20\x20🎯\x20'+a41_0x497ea5[_0x3cb215(0x200)](_0x5523c1[_0x3cb215(0x1f8)]['segments']+'\x20segments')+_0x3cb215(0x1c7)+a41_0x497ea5[_0x3cb215(0x200)](_0x5523c1[_0x3cb215(0x1f8)][_0x3cb215(0x1dc)]+_0x3cb215(0x1c8)));if(_0x5523c1['counts'][_0x3cb215(0x1f5)]>0x0){const _0x2149b6=_0x5523c1[_0x3cb215(0x1f8)]['journeyVersions']>_0x5523c1[_0x3cb215(0x1f8)][_0x3cb215(0x1f5)]?'\x20('+_0x5523c1['counts'][_0x3cb215(0x1e9)]+_0x3cb215(0x1dd):'';console[_0x3cb215(0x1d7)](_0x3cb215(0x1bc)+a41_0x497ea5['cyan'](_0x5523c1[_0x3cb215(0x1f8)][_0x3cb215(0x1f5)]+'\x20journeys')+a41_0x497ea5[_0x3cb215(0x1c0)](_0x2149b6));}console[_0x3cb215(0x1d7)]('\x20\x20'+a41_0x497ea5[_0x3cb215(0x1bf)]('+\x20'+_0x586cdf[_0x3cb215(0x1fd)]+'\x20new\x20files')),console['error']('\x20\x20'+a41_0x497ea5[_0x3cb215(0x1fb)]('~\x20'+_0x225b15[_0x3cb215(0x1fd)]+'\x20changed\x20files')),console[_0x3cb215(0x1d7)]('\x20\x20'+a41_0x497ea5[_0x3cb215(0x1c0)]('=\x20'+_0x440469['length']+_0x3cb215(0x1bb))),console[_0x3cb215(0x1d7)](_0x3cb215(0x1e7)+a41_0x497ea5[_0x3cb215(0x200)](_0x5523c1[_0x3cb215(0x204)])+'\x0a');if(_0x225b15[_0x3cb215(0x1fd)]>0x0)for(const _0x41422c of _0x225b15){console[_0x3cb215(0x1d7)](_0x3cb215(0x1e0)+_0x41422c[_0x3cb215(0x1b9)]+'\x27:'),console[_0x3cb215(0x1d7)]('─'[_0x3cb215(0x1ea)](0x3c)),console[_0x3cb215(0x1d7)](_0x41422c[_0x3cb215(0x1e1)]),console[_0x3cb215(0x1d7)]('─'['repeat'](0x3c));}if(_0x370e61[_0x3cb215(0x206)])return console['error'](a41_0x497ea5[_0x3cb215(0x1fb)]('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x586cdf['length']===0x0&&_0x225b15[_0x3cb215(0x1fd)]===0x0)return console[_0x3cb215(0x1d7)](a41_0x497ea5['green'](_0x3cb215(0x1f9))),saveSessionContext({'parent_segment':_0x5523c1[_0x3cb215(0x1cf)]},_0x370e61[_0x3cb215(0x1db)]),console[_0x3cb215(0x1d7)](a41_0x497ea5[_0x3cb215(0x1bf)](_0x3cb215(0x1ef)+a41_0x497ea5[_0x3cb215(0x1c0)](_0x3cb215(0x1b8))+_0x3cb215(0x201)+a41_0x497ea5[_0x3cb215(0x200)](_0x5523c1[_0x3cb215(0x1cf)]))),0x0;if(!_0x370e61[_0x3cb215(0x1ee)]){if(!isInteractive())return console[_0x3cb215(0x1d7)](a41_0x497ea5[_0x3cb215(0x1ca)](_0x3cb215(0x1ec)),_0x3cb215(0x1be)),console[_0x3cb215(0x1d7)](a41_0x497ea5[_0x3cb215(0x1c0)](_0x3cb215(0x1d2))),0x1;const _0x126a72=await confirmKey('Write\x20'+(_0x586cdf[_0x3cb215(0x1fd)]+_0x225b15['length'])+'\x20files?');if(!_0x126a72)return console[_0x3cb215(0x1d7)](a41_0x497ea5['yellow'](_0x3cb215(0x1cd)),_0x3cb215(0x1c2)),0x1;}for(const _0x6eafcd of _0x5523c1[_0x3cb215(0x1bd)]){if(_0x6eafcd[_0x3cb215(0x1c9)]||_0x6eafcd[_0x3cb215(0x203)]){const _0xf4adc2=a41_0x16aba7[_0x3cb215(0x1da)](_0x6eafcd[_0x3cb215(0x205)]);!existsSync(_0xf4adc2)&&mkdirSync(_0xf4adc2,{'recursive':!![]}),writeFileSync(_0x6eafcd[_0x3cb215(0x205)],_0x6eafcd[_0x3cb215(0x1fa)],'utf-8');}}return console['error'](a41_0x497ea5[_0x3cb215(0x1bf)](_0x3cb215(0x1f2)+(_0x586cdf['length']+_0x225b15['length'])+'\x20files\x20to\x20'+_0x5523c1[_0x3cb215(0x204)])),saveSessionContext({'parent_segment':_0x5523c1[_0x3cb215(0x1cf)]},_0x370e61[_0x3cb215(0x1db)]),console['error'](a41_0x497ea5[_0x3cb215(0x1bf)]('✔\x20Context\x20set:\x20'+a41_0x497ea5['dim']('parent_segment')+_0x3cb215(0x201)+a41_0x497ea5[_0x3cb215(0x200)](_0x5523c1[_0x3cb215(0x1cf)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0x40c0c0=a42_0x5182;(function(_0x2b768f,_0x5b3660){const _0x5924dc=a42_0x5182,_0xe3008e=_0x2b768f();while(!![]){try{const _0x3e5800=parseInt(_0x5924dc(0x1ec))/0x1+parseInt(_0x5924dc(0x1e3))/0x2+parseInt(_0x5924dc(0x197))/0x3*(-parseInt(_0x5924dc(0x1ca))/0x4)+-parseInt(_0x5924dc(0x1b3))/0x5*(-parseInt(_0x5924dc(0x185))/0x6)+-parseInt(_0x5924dc(0x1df))/0x7+-parseInt(_0x5924dc(0x1ed))/0x8+parseInt(_0x5924dc(0x189))/0x9;if(_0x3e5800===_0x5b3660)break;else _0xe3008e['push'](_0xe3008e['shift']());}catch(_0x451604){_0xe3008e['push'](_0xe3008e['shift']());}}}(a42_0x35e4,0x6d2c9));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a42_0x21ccdb from'chalk';function a42_0x5182(_0x1a7c2d,_0x5d3696){_0x1a7c2d=_0x1a7c2d-0x183;const _0x35e499=a42_0x35e4();let _0x51827a=_0x35e499[_0x1a7c2d];return _0x51827a;}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a42_0x35e4(){const _0x1b41b9=['yamlConfig','segment','\x0a✔\x20Push\x20complete','paused','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','Delete\x20journey:','segment\x20or\x20journey','repeat','cwd','Folders\x20to\x20create:','error','activations','4161094bKnlyW','nameToId','\x20updated','join','245314mgOmLc','\x20to\x20delete','scopedFolderPath','changed','isNew','\x20changed','\x20\x20\x20\x20','folderId','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','854160dMmpEs','6492496HNypbH','\x0aValidation\x20failed:','push','\x20created','segments','\x20\x20Activations:\x20','\x20deleted','\x20\x20Journeys:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','setPhase','Delete\x20segment:','\x20folders\x20to\x20create','New\x20segment:','listSegments','name','no_parent','parentSegment','filePath','dryRun','folderPath','📁\x20','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)','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','createdSegmentIds','folders','\x20new','file','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Error\x20parsing\x20YAML:\x20','toCreate','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','toUpdate','diff','get','getOutputSchemaWithCache','segment:push','Preparing\x20journeys...','Aborted.','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','existingJourney','Fetching\x20existing\x20data...','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Parent\x20segment:\x20','message','delete','Resolving\x20parent\x20segment\x20\x27','type','\x0aPush\x20summary\x20for\x20\x27','set','parentFolder','(Journey\x20will\x20be\x20deleted)','add','823590iyMEYA','state','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','yes','10352304nUONVx','user','journeyBundleName','yellow','list','Changes\x20to\x20journey:','site','journey','/j/da/je','results','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','blue','journeyBundleId','journeysOnly','3CNWZIQ','updated','verbose','getJourney','versionNumber','\x20activations]','cyan','unchanged','filter','/app/ps/','created','data','/sb/da/esr','parent_name','Scoped\x20to\x20folder:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','toDelete','description','\x20to\x20update','relationships','listJourneysWithDetailsFromParentSegment','\x0aError:','.yml','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','toString','\x20\x20Activations:','segmentFolderId','Site:\x20','5sjGieF','then','\x20\x20Segments:\x20','targetDir','journeys','all','helpText','parentName','map','red','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Changes\x20to:','/e/','green','idToName','createdAt','existingSegment','attributes','Source\x20directory:\x20','new','connection','Error:\x20Directory\x20not\x20found:\x20','errorCode','1644628PeMTrd','isScoped','endsWith','Fetching\x20existing\x20activations...','resolveParentId','\x27...','Error:\x20','dim','length'];a42_0x35e4=function(){return _0x1b41b9;};return a42_0x35e4();}import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a42_0x40c0c0(0x211);['description']=a42_0x40c0c0(0x187);async['execute'](_0x2a8e60){const _0x572dd8=a42_0x40c0c0,{options:_0x4fab84,args:_0x19b688,tdx:_0x3102e9}=_0x2a8e60,_0x3d4dc5=_0x4fab84,_0x14bb6a=await resolveTarget({'arg':_0x19b688[0x0],'contextParent':_0x4fab84[_0x572dd8(0x1fd)],'cwd':process[_0x572dd8(0x1db)]()});if(!isSuccessfulResolution(_0x14bb6a))return _0x14bb6a[_0x572dd8(0x1c9)]===_0x572dd8(0x1fc)?(console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x18c)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x572dd8(0x1dd)](_0x572dd8(0x202)),console[_0x572dd8(0x1dd)](_0x572dd8(0x20c)),console[_0x572dd8(0x1dd)](_0x572dd8(0x1d7))):(console[_0x572dd8(0x1dd)](a42_0x21ccdb['red'](_0x572dd8(0x1d0)+_0x14bb6a[_0x572dd8(0x219)]+'\x0a')),_0x14bb6a[_0x572dd8(0x1b9)]&&console[_0x572dd8(0x1dd)](a42_0x21ccdb['cyan'](_0x14bb6a[_0x572dd8(0x1b9)]))),0x1;if(_0x14bb6a['type']===_0x572dd8(0x1a4))return console['error'](a42_0x21ccdb[_0x572dd8(0x1bc)]('Error:\x20Directory\x20not\x20found:\x20'+_0x14bb6a[_0x572dd8(0x1b6)]+'\x0a')),console[_0x572dd8(0x1dd)](a42_0x21ccdb['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x186dec=_0x14bb6a[_0x572dd8(0x1ba)],_0x4b22ae=_0x14bb6a[_0x572dd8(0x1b6)],_0x282654=_0x14bb6a[_0x572dd8(0x21c)]===_0x572dd8(0x207)?_0x14bb6a[_0x572dd8(0x1fe)]:undefined,_0x340f16=getScopedDetails(_0x14bb6a),_0x2a9b68=_0x340f16?.[_0x572dd8(0x1cb)]??![],_0x45fbac=_0x340f16?.[_0x572dd8(0x1e5)]??'';if(!existsSync(_0x4b22ae))return console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x1bc)](_0x572dd8(0x1c8)+_0x4b22ae+'\x0a')),console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x19d)](_0x572dd8(0x209))),0x1;_0x3d4dc5[_0x572dd8(0x199)]&&(console[_0x572dd8(0x1dd)](_0x572dd8(0x1b2)+_0x3d4dc5[_0x572dd8(0x18f)]),console['error'](_0x572dd8(0x218)+_0x186dec),console['error'](_0x572dd8(0x1c5)+_0x4b22ae),_0x2a9b68&&console[_0x572dd8(0x1dd)](_0x572dd8(0x1a5)+_0x45fbac));const _0x196a38=await withSpinner(_0x572dd8(0x21b)+_0x186dec+_0x572dd8(0x1cf),()=>_0x3102e9[_0x572dd8(0x1d4)][_0x572dd8(0x1ce)](_0x186dec),{'verbose':_0x3d4dc5[_0x572dd8(0x199)]}),_0x3b6ce9=_0x196a38[_0x572dd8(0x1a2)],{parentSegmentResult:_0x5e2020,segmentsResult:_0x57efd8,foldersResult:_0x196978,journeysWithDetailsResult:_0x58ee3a,userMaps:_0x1ee042}=await withSpinner(_0x572dd8(0x216),async()=>{const _0x488c3d=_0x572dd8,[_0xd6242,_0x227a19,_0x23d442,_0x27149c,_0x5e4080]=await Promise[_0x488c3d(0x1b8)]([_0x3102e9[_0x488c3d(0x1d4)]['getParent'](_0x3b6ce9),_0x3102e9['segment'][_0x488c3d(0x1fa)](_0x3b6ce9),_0x3102e9['segment']['listFolders'](_0x3b6ce9),_0x3102e9[_0x488c3d(0x190)][_0x488c3d(0x1ab)](_0x3b6ce9,{'includeAllVersions':!![]}),_0x3102e9[_0x488c3d(0x18a)]['buildUserMaps']()]);return{'parentSegmentResult':_0xd6242,'segmentsResult':_0x227a19,'foldersResult':_0x23d442,'journeysWithDetailsResult':_0x27149c,'userMaps':_0x5e4080};},{'verbose':_0x3d4dc5['verbose']})[_0x572dd8(0x1b4)](_0x54bcd9=>_0x54bcd9['data']),_0x4b7bad=_0x5e2020,_0x3a3706=extractRootFolderId(_0x4b7bad),_0x3879cb=_0x57efd8,_0x22a418=_0x196978,{journeys:_0x53bc2d,activationStepsById:_0x182189}=_0x58ee3a,_0x3f752e=new Map(_0x53bc2d[_0x572dd8(0x1bb)](_0x5042db=>[_0x5042db['id'],_0x5042db])),_0x522bef=_0x53bc2d['map'](_0x214139=>({'id':_0x214139['id'],'name':_0x214139[_0x572dd8(0x1c4)][_0x572dd8(0x1fb)],'journeyBundleName':_0x214139[_0x572dd8(0x1c4)][_0x572dd8(0x18b)]||'','journeyBundleId':_0x214139['attributes'][_0x572dd8(0x195)]||'','versionNumber':_0x214139['attributes'][_0x572dd8(0x19b)],'description':_0x214139[_0x572dd8(0x1c4)][_0x572dd8(0x1a8)],'state':_0x214139[_0x572dd8(0x1c4)][_0x572dd8(0x186)],'paused':_0x214139['attributes'][_0x572dd8(0x1d6)],'audienceId':_0x214139[_0x572dd8(0x1c4)]['audienceId'],'folderId':_0x214139[_0x572dd8(0x1aa)]?.[_0x572dd8(0x21f)]?.[_0x572dd8(0x1a2)]?.['id'],'createdAt':_0x214139[_0x572dd8(0x1c4)][_0x572dd8(0x1c2)],'updatedAt':_0x214139['attributes']['updatedAt']})),{emailToId:_0x8b94ac,idToEmail:_0x4c7129}=_0x1ee042,_0x1389dc=await withSpinner(_0x572dd8(0x1a6),async()=>{const _0x13983a=_0x572dd8,_0x1cf6aa=await _0x3102e9[_0x13983a(0x1c7)][_0x13983a(0x18d)]();return buildConnectionMaps(_0x1cf6aa);},{'verbose':_0x3d4dc5[_0x572dd8(0x199)]})[_0x572dd8(0x1b4)](_0x16b18e=>_0x16b18e[_0x572dd8(0x1a2)]),_0x210db0=_0x1389dc['nameToId'],_0x389d4b=_0x1389dc[_0x572dd8(0x1c1)],_0x18abc7=_0x1389dc['nameToType'],_0x214daf={'emailToIdMap':_0x8b94ac,'connectionNameToIdMap':_0x210db0,'connectionNameToTypeMap':_0x18abc7,'getSchema':_0x33b1b8=>_0x3102e9['connection'][_0x572dd8(0x210)](_0x33b1b8)};let {pathToId:_0x29b9bb,idToPath:_0x3ed3b0}=buildFolderMaps(_0x22a418);const _0x3b4e95=buildSegmentLookupMap(_0x3879cb,_0x3ed3b0),_0x7b2d37=buildSegmentNameToIdMap(_0x3879cb),_0x3579b1=buildJourneyBundleLookupMap(_0x522bef,_0x3ed3b0);let _0x49746f;if(_0x282654){if(!_0x282654[_0x572dd8(0x1cc)](_0x572dd8(0x1ad))&&!_0x282654[_0x572dd8(0x1cc)]('.yaml'))return console[_0x572dd8(0x1dd)](a42_0x21ccdb['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x282654+'\x0a')),0x1;_0x49746f=[_0x282654];}else _0x49746f=findYamlFiles(_0x4b22ae);if(_0x49746f[_0x572dd8(0x1d2)]===0x0)return console['error'](a42_0x21ccdb[_0x572dd8(0x1bc)](_0x572dd8(0x1eb)+_0x4b22ae+'\x0a')),console['error'](a42_0x21ccdb[_0x572dd8(0x19d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x1624ae,_0x5c8770;try{const _0x382fb7=parseAndClassifyYamlFiles(_0x49746f,_0x4b22ae,{'skipSegments':_0x3d4dc5[_0x572dd8(0x196)]});_0x1624ae=_0x382fb7[_0x572dd8(0x1f1)],_0x5c8770=_0x382fb7[_0x572dd8(0x1b7)];const _0x183de9=validateParsedFiles(_0x382fb7,_0x4b22ae);if(_0x183de9[_0x572dd8(0x1d2)]>0x0)return console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x1bc)](_0x572dd8(0x1ee))),console[_0x572dd8(0x1dd)](formatValidationErrors(_0x183de9)),console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x18c)](_0x572dd8(0x217))),0x1;}catch(_0x4bdf6f){return console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x1bc)](_0x572dd8(0x20a)+(_0x4bdf6f instanceof Error?_0x4bdf6f[_0x572dd8(0x219)]:_0x4bdf6f))),0x1;}if(_0x1624ae[_0x572dd8(0x1d2)]===0x0&&_0x5c8770[_0x572dd8(0x1d2)]===0x0){const _0x5dba90=_0x3d4dc5[_0x572dd8(0x196)]?_0x572dd8(0x190):_0x572dd8(0x1d9);return console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x18c)]('No\x20'+_0x5dba90+'\x20YAML\x20files\x20found')),0x0;}const _0x55f85d=new Map();_0x3879cb[_0x572dd8(0x1d2)]>0x0&&!_0x3d4dc5['journeysOnly']&&await withSpinner(_0x572dd8(0x1cd),async()=>{await batchAsync(_0x3879cb,async _0x5aede2=>{const _0x260ae3=a42_0x5182,_0x4c8f54=await _0x3102e9[_0x260ae3(0x1d4)]['listActivations'](_0x3b6ce9,_0x5aede2['id']);_0x55f85d[_0x260ae3(0x21e)](_0x5aede2['id'],_0x4c8f54);});},{'verbose':_0x3d4dc5[_0x572dd8(0x199)]});const {segmentFiles:_0x3bde12,foldersToCreate:_0x125bd1}=await prepareSegmentFiles(_0x1624ae,{'segmentByFolderAndName':_0x3b4e95,'activationsBySegmentId':_0x55f85d,'folderPathToId':_0x29b9bb,'idToEmailMap':_0x4c7129,'connectionIdToNameMap':_0x389d4b},_0x214daf,_0x2a9b68,_0x45fbac),_0x2469d7=_0x282654?[]:findSegmentsToDelete(_0x3879cb,_0x1624ae[_0x572dd8(0x1bb)](({yamlConfig:_0x2e79d1,folderPath:_0x172556})=>({'yamlConfig':_0x2e79d1,'folderPath':resolveTDFolderPath(_0x172556,_0x2a9b68,_0x45fbac)})),_0x3ed3b0,_0x45fbac,_0x2a9b68),{journeyFiles:_0x52fff0,foldersToCreate:_0x4ec875}=await withProgressSpinner(_0x572dd8(0x212),async _0x190cdd=>prepareJourneyFiles(_0x5c8770,{'fetchJourney':async _0x1c18e8=>_0x3102e9[_0x572dd8(0x190)][_0x572dd8(0x19a)](_0x1c18e8['journeyId']),'journeyBundlesByFolderAndName':_0x3579b1,'folderPathToId':_0x29b9bb,'idToEmailMap':_0x4c7129,'connectionIdToNameMap':_0x389d4b,'existingSegments':_0x3879cb,'parentId':_0x3b6ce9,'deps':_0x3102e9,'progress':{'update':_0x5d18d8=>{const _0x1dc9f1=_0x572dd8;_0x190cdd[_0x1dc9f1(0x1f6)](_0x5d18d8),_0x3d4dc5['verbose']&&console[_0x1dc9f1(0x1dd)]('\x20\x20'+_0x5d18d8);}},'journeyById':_0x3f752e,'activationStepsById':_0x182189},_0x2a9b68,_0x45fbac),{'verbose':_0x3d4dc5[_0x572dd8(0x199)]})[_0x572dd8(0x1b4)](_0x55c2c3=>_0x55c2c3[_0x572dd8(0x1a2)]);for(const _0x3215da of _0x4ec875){_0x125bd1[_0x572dd8(0x184)](_0x3215da);}const _0x1e392f=_0x282654?[]:findJourneysToDelete(_0x522bef,_0x5c8770[_0x572dd8(0x1bb)](({yamlConfig:_0x272398,folderPath:_0x13be4a})=>({'yamlConfig':_0x272398,'folderPath':resolveTDFolderPath(_0x13be4a,_0x2a9b68,_0x45fbac)})),_0x3ed3b0,_0x45fbac,_0x2a9b68),_0x1b7cbe=calculatePushStats(_0x3bde12,_0x52fff0,_0x125bd1,_0x2469d7,_0x1e392f,!!_0x3d4dc5['delete'],!!_0x3d4dc5[_0x572dd8(0x196)]),_0x5c9fd0=_0x1b7cbe[_0x572dd8(0x1f1)][_0x572dd8(0x1c6)],_0x539139=_0x1b7cbe[_0x572dd8(0x1f1)][_0x572dd8(0x1e6)],_0x2d6744=_0x1b7cbe[_0x572dd8(0x1f1)][_0x572dd8(0x19e)],_0x379546=_0x1b7cbe['segments'][_0x572dd8(0x1a7)],_0x12ff70=_0x1b7cbe[_0x572dd8(0x205)][_0x572dd8(0x20b)],_0x53f93b=_0x1b7cbe[_0x572dd8(0x1b7)]['new'],_0xaf81ef=_0x1b7cbe[_0x572dd8(0x1b7)][_0x572dd8(0x1e6)],_0x788e66=_0x1b7cbe[_0x572dd8(0x1b7)][_0x572dd8(0x19e)],_0x54d1a8=_0x1b7cbe['journeys'][_0x572dd8(0x1a7)],_0x5cfeb7=_0x1b7cbe[_0x572dd8(0x1de)]['all'],_0xaf53b7=_0x1b7cbe[_0x572dd8(0x1de)][_0x572dd8(0x20b)],_0x16b7a7=_0x1b7cbe[_0x572dd8(0x1de)][_0x572dd8(0x20d)],_0x55f912=_0x1b7cbe[_0x572dd8(0x1de)]['toDelete'];console['error'](_0x572dd8(0x21d)+_0x186dec+'\x27:');_0x12ff70[_0x572dd8(0x1d2)]>0x0&&console[_0x572dd8(0x1dd)]('\x20\x20'+a42_0x21ccdb['blue'](_0x572dd8(0x201)+_0x12ff70[_0x572dd8(0x1d2)]+_0x572dd8(0x1f8)));if(!_0x3d4dc5['journeysOnly']){console[_0x572dd8(0x1dd)]('\x20\x20📊\x20Segments:'),console[_0x572dd8(0x1dd)](_0x572dd8(0x1e9)+a42_0x21ccdb[_0x572dd8(0x1c0)]('+\x20'+_0x5c9fd0['length']+_0x572dd8(0x206))),console[_0x572dd8(0x1dd)](_0x572dd8(0x1e9)+a42_0x21ccdb[_0x572dd8(0x18c)]('~\x20'+_0x539139[_0x572dd8(0x1d2)]+_0x572dd8(0x1e8)));if(_0x379546[_0x572dd8(0x1d2)]>0x0)console['error']('\x20\x20\x20\x20'+a42_0x21ccdb[_0x572dd8(0x1bc)]('-\x20'+_0x379546[_0x572dd8(0x1d2)]+_0x572dd8(0x1e4)));else _0x2469d7[_0x572dd8(0x1d2)]>0x0&&!_0x3d4dc5[_0x572dd8(0x21a)]&&console[_0x572dd8(0x1dd)]('\x20\x20\x20\x20'+a42_0x21ccdb['dim'](_0x2469d7[_0x572dd8(0x1d2)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x572dd8(0x1dd)](_0x572dd8(0x1e9)+a42_0x21ccdb[_0x572dd8(0x1d1)]('=\x20'+_0x2d6744[_0x572dd8(0x1d2)]+'\x20unchanged'));}if(_0x52fff0[_0x572dd8(0x1d2)]>0x0||_0x1e392f[_0x572dd8(0x1d2)]>0x0){console[_0x572dd8(0x1dd)]('\x20\x20🗺️\x20\x20Journeys:'),console['error'](_0x572dd8(0x1e9)+a42_0x21ccdb[_0x572dd8(0x1c0)]('+\x20'+_0x53f93b['length']+_0x572dd8(0x206))),console[_0x572dd8(0x1dd)](_0x572dd8(0x1e9)+a42_0x21ccdb[_0x572dd8(0x18c)]('~\x20'+_0xaf81ef[_0x572dd8(0x1d2)]+'\x20changed'));if(_0x54d1a8['length']>0x0)console[_0x572dd8(0x1dd)](_0x572dd8(0x1e9)+a42_0x21ccdb[_0x572dd8(0x1bc)]('-\x20'+_0x54d1a8[_0x572dd8(0x1d2)]+_0x572dd8(0x1e4)));else _0x1e392f[_0x572dd8(0x1d2)]>0x0&&!_0x3d4dc5[_0x572dd8(0x21a)]&&console[_0x572dd8(0x1dd)](_0x572dd8(0x1e9)+a42_0x21ccdb['dim'](_0x1e392f[_0x572dd8(0x1d2)]+_0x572dd8(0x1f5)));console['error'](_0x572dd8(0x1e9)+a42_0x21ccdb[_0x572dd8(0x1d1)]('=\x20'+_0x788e66[_0x572dd8(0x1d2)]+'\x20unchanged'));}_0x5cfeb7[_0x572dd8(0x1d2)]>0x0&&!_0x3d4dc5[_0x572dd8(0x196)]&&(console[_0x572dd8(0x1dd)](''),console[_0x572dd8(0x1dd)](_0x572dd8(0x1b0)),_0xaf53b7[_0x572dd8(0x1d2)]>0x0&&console[_0x572dd8(0x1dd)](_0x572dd8(0x1e9)+a42_0x21ccdb['green']('+\x20'+_0xaf53b7[_0x572dd8(0x1d2)]+'\x20to\x20create')),_0x16b7a7[_0x572dd8(0x1d2)]>0x0&&console['error']('\x20\x20\x20\x20'+a42_0x21ccdb['yellow']('~\x20'+_0x16b7a7[_0x572dd8(0x1d2)]+_0x572dd8(0x1a9))),_0x55f912[_0x572dd8(0x1d2)]>0x0&&console[_0x572dd8(0x1dd)]('\x20\x20\x20\x20'+a42_0x21ccdb[_0x572dd8(0x1bc)]('-\x20'+_0x55f912[_0x572dd8(0x1d2)]+'\x20to\x20delete')));console[_0x572dd8(0x1dd)]('\x20\x20Source:\x20'+a42_0x21ccdb[_0x572dd8(0x19d)](_0x4b22ae)+'\x0a');if(_0x12ff70['length']>0x0){console[_0x572dd8(0x1dd)](_0x572dd8(0x1dc));for(const _0x372101 of _0x12ff70){console[_0x572dd8(0x1dd)]('\x20\x20'+a42_0x21ccdb[_0x572dd8(0x194)]('+')+'\x20'+_0x372101);}console[_0x572dd8(0x1dd)]('');}if(_0x5c9fd0[_0x572dd8(0x1d2)]>0x0&&!_0x3d4dc5[_0x572dd8(0x196)])for(const _0x426a71 of _0x5c9fd0){const _0x3f97c0=_0x426a71[_0x572dd8(0x200)]?_0x426a71[_0x572dd8(0x200)]+'/'+_0x426a71[_0x572dd8(0x1d3)][_0x572dd8(0x1fb)]:_0x426a71['yamlConfig'][_0x572dd8(0x1fb)],_0x20ef38=_0x426a71[_0x572dd8(0x1d3)][_0x572dd8(0x1de)]?.[_0x572dd8(0x1d2)]||0x0,_0x3ac180=_0x20ef38>0x0?a42_0x21ccdb['dim']('\x20['+_0x20ef38+_0x572dd8(0x19c)):'';console['error']('\x0a'+a42_0x21ccdb['green'](_0x572dd8(0x1f9))+'\x20'+_0x3f97c0+_0x3ac180),console[_0x572dd8(0x1dd)]('─'[_0x572dd8(0x1da)](0x3c)),_0x426a71[_0x572dd8(0x20e)]&&console[_0x572dd8(0x1dd)](_0x426a71[_0x572dd8(0x20e)]),console['error']('─'[_0x572dd8(0x1da)](0x3c));}if(_0x379546[_0x572dd8(0x1d2)]>0x0&&!_0x3d4dc5[_0x572dd8(0x196)])for(const _0x414425 of _0x379546){const _0x5b43d3=_0x414425[_0x572dd8(0x1b1)]?_0x3ed3b0[_0x572dd8(0x20f)](_0x414425[_0x572dd8(0x1b1)][_0x572dd8(0x1af)]())||'':'',_0x5be268=_0x5b43d3?_0x5b43d3+'/'+_0x414425[_0x572dd8(0x1fb)]:_0x414425[_0x572dd8(0x1fb)],_0x198011=_0x55f85d[_0x572dd8(0x20f)](_0x414425['id'])||[],_0x1f4180=_0x198011['length']>0x0?a42_0x21ccdb[_0x572dd8(0x1d1)]('\x20['+_0x198011[_0x572dd8(0x1d2)]+_0x572dd8(0x19c)):'';console[_0x572dd8(0x1dd)]('\x0a'+a42_0x21ccdb[_0x572dd8(0x1bc)](_0x572dd8(0x1f7))+'\x20'+_0x5be268+_0x1f4180),console[_0x572dd8(0x1dd)]('─'[_0x572dd8(0x1da)](0x3c));const _0x517dca=segmentWithActivationsToYaml(_0x414425,_0x198011,undefined,_0x4c7129,_0x389d4b),_0x46341c=segmentToYamlString(_0x517dca),_0x15d26f=generateDiff(_0x46341c,'');console[_0x572dd8(0x1dd)](formatDiffWithColors(_0x15d26f)),console['error']('─'[_0x572dd8(0x1da)](0x3c));}const _0x1b7db1=_0x3bde12[_0x572dd8(0x19f)](_0x212f25=>!_0x212f25[_0x572dd8(0x1e7)]&&_0x212f25[_0x572dd8(0x20e)]);if(_0x1b7db1[_0x572dd8(0x1d2)]>0x0&&!_0x3d4dc5[_0x572dd8(0x196)])for(const _0x123b20 of _0x1b7db1){const _0x1a3744=_0x123b20[_0x572dd8(0x200)]?_0x123b20['folderPath']+'/'+_0x123b20[_0x572dd8(0x1d3)]['name']:_0x123b20[_0x572dd8(0x1d3)][_0x572dd8(0x1fb)];console[_0x572dd8(0x1dd)]('\x0a'+a42_0x21ccdb[_0x572dd8(0x18c)](_0x572dd8(0x1be))+'\x20'+_0x1a3744),console[_0x572dd8(0x1dd)]('─'[_0x572dd8(0x1da)](0x3c)),console[_0x572dd8(0x1dd)](_0x123b20[_0x572dd8(0x20e)]),console['error']('─'[_0x572dd8(0x1da)](0x3c));}if(_0x53f93b[_0x572dd8(0x1d2)]>0x0)for(const _0x256ff8 of _0x53f93b){const _0x1d6aa1=_0x256ff8['folderPath']?_0x256ff8['folderPath']+'/'+_0x256ff8[_0x572dd8(0x1d3)][_0x572dd8(0x1fb)]:_0x256ff8[_0x572dd8(0x1d3)][_0x572dd8(0x1fb)];console[_0x572dd8(0x1dd)]('\x0a'+a42_0x21ccdb[_0x572dd8(0x1c0)]('New\x20journey:')+'\x20'+_0x1d6aa1),console[_0x572dd8(0x1dd)]('─'[_0x572dd8(0x1da)](0x3c)),_0x256ff8[_0x572dd8(0x20e)]&&console[_0x572dd8(0x1dd)](_0x256ff8['diff']),console[_0x572dd8(0x1dd)]('─'[_0x572dd8(0x1da)](0x3c));}const _0x29a2a1=_0x52fff0[_0x572dd8(0x19f)](_0x11842d=>!_0x11842d[_0x572dd8(0x1e7)]&&_0x11842d[_0x572dd8(0x20e)]);if(_0x29a2a1[_0x572dd8(0x1d2)]>0x0)for(const _0x4a5a0d of _0x29a2a1){const _0x379910=_0x4a5a0d[_0x572dd8(0x200)]?_0x4a5a0d[_0x572dd8(0x200)]+'/'+_0x4a5a0d['yamlConfig']['name']:_0x4a5a0d['yamlConfig']['name'];console[_0x572dd8(0x1dd)]('\x0a'+a42_0x21ccdb['yellow'](_0x572dd8(0x18e))+'\x20'+_0x379910),console[_0x572dd8(0x1dd)]('─'[_0x572dd8(0x1da)](0x3c)),console[_0x572dd8(0x1dd)](_0x4a5a0d['diff']),console[_0x572dd8(0x1dd)]('─'[_0x572dd8(0x1da)](0x3c));}if(_0x54d1a8[_0x572dd8(0x1d2)]>0x0)for(const _0x2f4fb6 of _0x54d1a8){const _0x36b25a=_0x2f4fb6[_0x572dd8(0x1ea)]?_0x3ed3b0[_0x572dd8(0x20f)](_0x2f4fb6['folderId'])||'':'',_0x44947c=_0x36b25a?_0x36b25a+'/'+_0x2f4fb6['journeyBundleName']:_0x2f4fb6[_0x572dd8(0x18b)];console[_0x572dd8(0x1dd)]('\x0a'+a42_0x21ccdb[_0x572dd8(0x1bc)](_0x572dd8(0x1d8))+'\x20'+_0x44947c),console[_0x572dd8(0x1dd)]('─'[_0x572dd8(0x1da)](0x3c)),console['error'](a42_0x21ccdb[_0x572dd8(0x1bc)](_0x572dd8(0x183))),console[_0x572dd8(0x1dd)]('─'[_0x572dd8(0x1da)](0x3c));}if(_0x3d4dc5[_0x572dd8(0x1ff)])return console['error'](a42_0x21ccdb['yellow'](_0x572dd8(0x214))),0x0;const _0x3045e3=_0x3d4dc5[_0x572dd8(0x196)]?![]:_0x5c9fd0[_0x572dd8(0x1d2)]>0x0||_0x539139[_0x572dd8(0x1d2)]>0x0||_0x379546[_0x572dd8(0x1d2)]>0x0,_0x30193e=_0x53f93b[_0x572dd8(0x1d2)]>0x0||_0xaf81ef['length']>0x0||_0x54d1a8['length']>0x0,_0x986e1b=_0x3d4dc5['journeysOnly']?![]:_0x5cfeb7[_0x572dd8(0x1d2)]>0x0,_0x220371=_0x12ff70['length']>0x0;if(!_0x3045e3&&!_0x30193e&&!_0x986e1b&&!_0x220371){const _0x2540ca=_0x3d4dc5['journeysOnly']?_0x572dd8(0x1bd):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a42_0x21ccdb[_0x572dd8(0x1c0)](_0x2540ca));if(_0x282654&&_0x2d6744[_0x572dd8(0x1d2)]===0x1){const _0x49799f=_0x2d6744[0x0];if(_0x49799f[_0x572dd8(0x1c3)]?.['id']){const _0x478217=getConsoleNextUrl(_0x3d4dc5['site'],_0x572dd8(0x1a0)+_0x3b6ce9+_0x572dd8(0x1bf)+_0x49799f[_0x572dd8(0x1c3)]['id']+_0x572dd8(0x1a3));console[_0x572dd8(0x1dd)](_0x572dd8(0x1ae)+a42_0x21ccdb[_0x572dd8(0x19d)](_0x478217));}}if(_0x282654&&_0x788e66[_0x572dd8(0x1d2)]===0x1){const _0x319ef8=_0x788e66[0x0];if(_0x319ef8[_0x572dd8(0x215)]?.['id']){const _0x141a49=getConsoleNextUrl(_0x3d4dc5[_0x572dd8(0x18f)],_0x572dd8(0x1a0)+_0x3b6ce9+'/e/'+_0x319ef8[_0x572dd8(0x215)]['id']+'/j/da/je');console[_0x572dd8(0x1dd)]('\x20\x20'+a42_0x21ccdb['cyan'](_0x141a49));}}return 0x0;}const _0x53414e=_0x3d4dc5[_0x572dd8(0x196)]?_0x53f93b['length']+_0xaf81ef['length']+_0x54d1a8[_0x572dd8(0x1d2)]+_0x12ff70['length']:_0x5c9fd0['length']+_0x539139[_0x572dd8(0x1d2)]+_0x379546['length']+_0x53f93b[_0x572dd8(0x1d2)]+_0xaf81ef[_0x572dd8(0x1d2)]+_0x54d1a8['length']+_0x12ff70[_0x572dd8(0x1d2)]+_0x5cfeb7[_0x572dd8(0x1d2)];if(!_0x3d4dc5[_0x572dd8(0x188)]&&_0x53414e>0x0){if(!isInteractive())return console[_0x572dd8(0x1dd)](a42_0x21ccdb['red'](_0x572dd8(0x1ac)),_0x572dd8(0x203)),console['error'](a42_0x21ccdb['dim'](_0x572dd8(0x193))),0x1;const _0x56d2bc=await confirmKey('Push\x20'+_0x53414e+'\x20changes?');if(!_0x56d2bc)return console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x18c)](_0x572dd8(0x213))),0x1;}const _0x4f89c0={'withProgress':async(_0xf4e1f0,_0x407d3a)=>{const _0x324dfd=_0x572dd8,_0x4bcd76=await withSpinner(_0xf4e1f0,_0x407d3a,{'verbose':_0x3d4dc5['verbose']});return{'data':_0x4bcd76[_0x324dfd(0x1a2)]};},'logInfo':_0x2cc2a0=>console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x194)]('✔\x20'+_0x2cc2a0)),'logSuccess':_0x4afb9e=>console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x1c0)]('✔\x20'+_0x4afb9e)),'logWarning':_0x2b11be=>console['error'](a42_0x21ccdb[_0x572dd8(0x18c)]('⚠\x20'+_0x2b11be)),'logDeleted':_0x2f2695=>console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x1bc)]('✔\x20'+_0x2f2695))},_0x3e8df2={'segment':_0x3102e9['segment'],'journey':_0x3102e9[_0x572dd8(0x190)],'user':_0x3102e9[_0x572dd8(0x18a)],'connection':_0x3102e9[_0x572dd8(0x1c7)]};_0x12ff70[_0x572dd8(0x1d2)]>0x0&&(_0x29b9bb=await executePushFolders(_0x3e8df2,_0x12ff70,_0x29b9bb,{'parentId':_0x3b6ce9},_0x4f89c0));const _0x55e569={'rootFolderId':_0x3a3706,'folderPathToId':_0x29b9bb,'folderIdToPath':_0x3ed3b0,'segmentNameToId':_0x7b2d37,'activationsBySegmentId':_0x55f85d,'emailToIdMap':_0x8b94ac,'idToEmailMap':_0x4c7129,'connectionNameToIdMap':_0x1389dc[_0x572dd8(0x1e0)],'connectionIdToNameMap':_0x1389dc['idToName'],'connectionNameToTypeMap':_0x18abc7},_0x7d712e=await executePushSegments(_0x3e8df2,_0x3d4dc5[_0x572dd8(0x196)]?[]:_0x3bde12,_0x55e569,{'parentId':_0x3b6ce9},_0x4f89c0),_0x562b25=_0x7d712e[_0x572dd8(0x1a1)],_0x1119fc=_0x7d712e[_0x572dd8(0x198)],_0x40d97c=_0x7d712e[_0x572dd8(0x1de)][_0x572dd8(0x1a1)],_0x220ca5=_0x7d712e['activations'][_0x572dd8(0x198)],_0xd5dfb6=_0x7d712e[_0x572dd8(0x1de)]['deleted'];let _0x7da7c;if(_0x282654&&_0x3bde12['length']===0x1){const _0x10436b=_0x3bde12[0x0];_0x7da7c=_0x10436b['existingSegment']?.['id']??_0x7d712e[_0x572dd8(0x204)][_0x572dd8(0x20f)](_0x10436b[_0x572dd8(0x1d3)][_0x572dd8(0x1fb)]);}const _0x5bafe0=await executePushSegmentDeletions(_0x3e8df2,_0x3d4dc5['journeysOnly']?[]:_0x379546,_0x4f89c0);let _0x2c5bb6=0x0,_0xf9732d=0x0,_0x187524=0x0;const _0x32cee1=new Map(_0x7b2d37);for(const [_0x418c90,_0x52a146]of _0x7d712e[_0x572dd8(0x204)]){_0x32cee1[_0x572dd8(0x21e)](_0x418c90,_0x52a146);}if(_0x52fff0['length']>0x0){const _0x2b3782={..._0x55e569,'segmentNameToId':_0x32cee1,'existingSegments':_0x3879cb,'activationContext':_0x214daf},_0x1e2ed8=await executePushJourneys(_0x3e8df2,_0x52fff0,_0x2b3782,{'parentId':_0x3b6ce9,'rootFolderId':_0x3a3706,'verbose':_0x3d4dc5['verbose']},_0x4f89c0);_0x2c5bb6=_0x1e2ed8[_0x572dd8(0x1a1)],_0xf9732d=_0x1e2ed8['updated'];if(_0x282654&&_0x1e2ed8[_0x572dd8(0x192)]['length']===0x1){const _0x4f7fbc=_0x1e2ed8[_0x572dd8(0x192)][0x0];if(_0x4f7fbc['journeyId']){const _0xed1983=getConsoleNextUrl(_0x3d4dc5[_0x572dd8(0x18f)],_0x572dd8(0x1a0)+_0x3b6ce9+_0x572dd8(0x1bf)+_0x4f7fbc['journeyId']+_0x572dd8(0x191));console[_0x572dd8(0x1dd)]('\x20\x20'+a42_0x21ccdb[_0x572dd8(0x19d)](_0xed1983));}}}for(const _0x3218af of _0x54d1a8){console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x18c)](_0x572dd8(0x208)+_0x3218af['journeyBundleName'])),_0x187524++;}const _0x1f7753=[];if(_0x562b25>0x0)_0x1f7753[_0x572dd8(0x1ef)](_0x562b25+_0x572dd8(0x1f0));if(_0x1119fc>0x0)_0x1f7753[_0x572dd8(0x1ef)](_0x1119fc+_0x572dd8(0x1e1));if(_0x5bafe0>0x0)_0x1f7753[_0x572dd8(0x1ef)](_0x5bafe0+_0x572dd8(0x1f3));const _0x3e7d80=[];if(_0x2c5bb6>0x0)_0x3e7d80[_0x572dd8(0x1ef)](_0x2c5bb6+_0x572dd8(0x1f0));if(_0xf9732d>0x0)_0x3e7d80[_0x572dd8(0x1ef)](_0xf9732d+'\x20updated');if(_0x187524>0x0)_0x3e7d80[_0x572dd8(0x1ef)](_0x187524+_0x572dd8(0x1f3));const _0x2680f0=[];if(_0x40d97c>0x0)_0x2680f0['push'](_0x40d97c+_0x572dd8(0x1f0));if(_0x220ca5>0x0)_0x2680f0[_0x572dd8(0x1ef)](_0x220ca5+_0x572dd8(0x1e1));if(_0xd5dfb6>0x0)_0x2680f0[_0x572dd8(0x1ef)](_0xd5dfb6+_0x572dd8(0x1f3));console[_0x572dd8(0x1dd)](a42_0x21ccdb[_0x572dd8(0x1c0)](_0x572dd8(0x1d5)));_0x1f7753[_0x572dd8(0x1d2)]>0x0&&!_0x3d4dc5['journeysOnly']&&console[_0x572dd8(0x1dd)](_0x572dd8(0x1b5)+_0x1f7753[_0x572dd8(0x1e2)](',\x20'));_0x3e7d80[_0x572dd8(0x1d2)]>0x0&&console[_0x572dd8(0x1dd)](_0x572dd8(0x1f4)+_0x3e7d80[_0x572dd8(0x1e2)](',\x20'));_0x2680f0[_0x572dd8(0x1d2)]>0x0&&!_0x3d4dc5[_0x572dd8(0x196)]&&console[_0x572dd8(0x1dd)](_0x572dd8(0x1f2)+_0x2680f0[_0x572dd8(0x1e2)](',\x20'));if(_0x7da7c){const _0x13adaf=getConsoleNextUrl(_0x3d4dc5[_0x572dd8(0x18f)],_0x572dd8(0x1a0)+_0x3b6ce9+_0x572dd8(0x1bf)+_0x7da7c+_0x572dd8(0x1a3));console[_0x572dd8(0x1dd)](_0x572dd8(0x1ae)+a42_0x21ccdb[_0x572dd8(0x19d)](_0x13adaf));}return 0x0;}}
|
|
1
|
+
const a42_0x4f09d1=a42_0x38c6;(function(_0x2e48dd,_0x764383){const _0x347e73=a42_0x38c6,_0xae7482=_0x2e48dd();while(!![]){try{const _0x37d277=-parseInt(_0x347e73(0x11c))/0x1*(parseInt(_0x347e73(0x18b))/0x2)+-parseInt(_0x347e73(0x14c))/0x3+parseInt(_0x347e73(0x13b))/0x4+parseInt(_0x347e73(0x123))/0x5+-parseInt(_0x347e73(0x145))/0x6+-parseInt(_0x347e73(0x114))/0x7+parseInt(_0x347e73(0x17a))/0x8;if(_0x37d277===_0x764383)break;else _0xae7482['push'](_0xae7482['shift']());}catch(_0xc06700){_0xae7482['push'](_0xae7482['shift']());}}}(a42_0x57ed,0xb16db));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a42_0x38c6(_0x21e8cf,_0x5e8179){_0x21e8cf=_0x21e8cf-0xfd;const _0x57edd5=a42_0x57ed();let _0x38c652=_0x57edd5[_0x21e8cf];return _0x38c652;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';function a42_0x57ed(){const _0x124ce8=['journeys','Resolving\x20parent\x20segment\x20\x27','journeyId','5387yiDsVZ','cyan','Delete\x20segment:','getParent','\x20to\x20update','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','segment','4137415ZpsLdQ','\x0aError:','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','updatedAt','targetDir','updated','yes','\x20to\x20delete','\x20to\x20create','\x20\x20Activations:','isScoped','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20new','nameToType','Fetching\x20existing\x20data...','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','add','segments','toDelete','audienceId','/e/','connection','filter','dim','658596HPKfFX','yamlConfig','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','existingJourney','journeysOnly','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','push','toString','deleted','errorCode','911256SxmAfL','folderId','Parent\x20segment:\x20','new','listSegments','idToName','blue','3634023NSAbdJ','Site:\x20','endsWith','\x20unchanged','paused','/app/ps/','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','nameToId','data','listJourneysWithDetailsFromParentSegment','join','state','Preparing\x20journeys...','\x20changed','\x20\x20📊\x20Segments:','diff','toCreate','Error:\x20','red','Fetching\x20existing\x20activations...','dryRun','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','existingSegment','📁\x20','type','name','cwd','\x20folders\x20to\x20create','length','Error:\x20Directory\x20not\x20found:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','get','yellow','getOutputSchemaWithCache','\x0aPush\x20summary\x20for\x20\x27','delete','green','created','\x20\x20Segments:\x20','versionNumber','journeyBundleName','activations','parent_name','execute','\x20deleted','changed','17480264KuHrwq','\x20changes?','\x20created','(Journey\x20will\x20be\x20deleted)','\x20activations]','isNew','journey','then','Changes\x20to\x20journey:','\x0aValidation\x20failed:','message','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Delete\x20journey:','parentName','segmentFolderId','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','results','226ttMXup','\x20\x20Journeys:\x20','verbose','user','folderPath','description','listFolders','relationships','setPhase','repeat','site','\x20\x20Source:\x20','Changes\x20to:','Push\x20','\x20\x20Activations:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20YAML\x20files\x20found','createdSegmentIds','.yml','set','parentFolder','\x27...','Error\x20parsing\x20YAML:\x20','toUpdate','Folders\x20to\x20create:','/sb/da/esr','\x20\x20\x20\x20','unchanged','\x20updated','/j/da/je','attributes','file','segment\x20or\x20journey','scopedFolderPath','error','Source\x20directory:\x20','3349290CwOTcy','Fetching\x20connections\x20for\x20name\x20resolution...','New\x20journey:','helpText','map'];a42_0x57ed=function(){return _0x124ce8;};return a42_0x57ed();}import a42_0x4a954e 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';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{[a42_0x4f09d1(0x165)]='segment:push';[a42_0x4f09d1(0x190)]=a42_0x4f09d1(0x189);async[a42_0x4f09d1(0x177)](_0x515e43){const _0x4df836=a42_0x4f09d1,{options:_0x44e78c,args:_0x1dc3c8,tdx:_0x4f5d4d}=_0x515e43,_0x195602=_0x44e78c,_0x1ed6e9=await resolveTarget({'arg':_0x1dc3c8[0x0],'contextParent':_0x44e78c['parentSegment'],'cwd':process[_0x4df836(0x166)]()});if(!isSuccessfulResolution(_0x1ed6e9))return _0x1ed6e9[_0x4df836(0x144)]==='no_parent'?(console[_0x4df836(0x112)](a42_0x4a954e['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x4df836(0x112)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x4df836(0x112)](_0x4df836(0x16a))):(console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x15e)](_0x4df836(0x15d)+_0x1ed6e9[_0x4df836(0x184)]+'\x0a')),_0x1ed6e9['helpText']&&console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x11d)](_0x1ed6e9[_0x4df836(0x117)]))),0x1;if(_0x1ed6e9[_0x4df836(0x164)]===_0x4df836(0x176))return console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x15e)](_0x4df836(0x169)+_0x1ed6e9[_0x4df836(0x127)]+'\x0a')),console['error'](a42_0x4a954e[_0x4df836(0x11d)](_0x4df836(0xff))),0x1;const _0x592980=_0x1ed6e9[_0x4df836(0x187)],_0x53fc09=_0x1ed6e9['targetDir'],_0xfcfcf=_0x1ed6e9[_0x4df836(0x164)]===_0x4df836(0x10f)?_0x1ed6e9['filePath']:undefined,_0x2b3e8d=getScopedDetails(_0x1ed6e9),_0x3acbfa=_0x2b3e8d?.[_0x4df836(0x12d)]??![],_0x4b9618=_0x2b3e8d?.[_0x4df836(0x111)]??'';if(!existsSync(_0x53fc09))return console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x15e)](_0x4df836(0x169)+_0x53fc09+'\x0a')),console['error'](a42_0x4a954e['cyan'](_0x4df836(0xff))),0x1;_0x195602[_0x4df836(0x18d)]&&(console['error'](_0x4df836(0x14d)+_0x195602[_0x4df836(0x195)]),console['error'](_0x4df836(0x147)+_0x592980),console[_0x4df836(0x112)](_0x4df836(0x113)+_0x53fc09),_0x3acbfa&&console[_0x4df836(0x112)]('Scoped\x20to\x20folder:\x20'+_0x4b9618));const _0x3681d3=await withSpinner(_0x4df836(0x11a)+_0x592980+_0x4df836(0x105),()=>_0x4f5d4d[_0x4df836(0x122)]['resolveParentId'](_0x592980),{'verbose':_0x195602[_0x4df836(0x18d)]}),_0x4018a7=_0x3681d3[_0x4df836(0x154)],{parentSegmentResult:_0x3fed4a,segmentsResult:_0xde7e5,foldersResult:_0x4a92d5,journeysWithDetailsResult:_0x2c0d7c,userMaps:_0x12d967}=await withSpinner(_0x4df836(0x131),async()=>{const _0x6b1afa=_0x4df836,[_0x1b1bd1,_0x73cda9,_0x202c82,_0x27fc6d,_0x8b1d11]=await Promise['all']([_0x4f5d4d[_0x6b1afa(0x122)][_0x6b1afa(0x11f)](_0x4018a7),_0x4f5d4d[_0x6b1afa(0x122)][_0x6b1afa(0x149)](_0x4018a7),_0x4f5d4d[_0x6b1afa(0x122)][_0x6b1afa(0x191)](_0x4018a7),_0x4f5d4d[_0x6b1afa(0x180)][_0x6b1afa(0x155)](_0x4018a7,{'includeAllVersions':!![]}),_0x4f5d4d[_0x6b1afa(0x18e)]['buildUserMaps']()]);return{'parentSegmentResult':_0x1b1bd1,'segmentsResult':_0x73cda9,'foldersResult':_0x202c82,'journeysWithDetailsResult':_0x27fc6d,'userMaps':_0x8b1d11};},{'verbose':_0x195602[_0x4df836(0x18d)]})[_0x4df836(0x181)](_0xd34474=>_0xd34474[_0x4df836(0x154)]),_0x40b36e=_0x3fed4a,_0xa6d8fe=extractRootFolderId(_0x40b36e),_0x331952=_0xde7e5,_0x173b2b=_0x4a92d5,{journeys:_0x19b84a,activationStepsById:_0xe2ca1c}=_0x2c0d7c,_0x2ab07a=new Map(_0x19b84a[_0x4df836(0x118)](_0x416a85=>[_0x416a85['id'],_0x416a85])),_0x549041=_0x19b84a['map'](_0x39243e=>({'id':_0x39243e['id'],'name':_0x39243e[_0x4df836(0x10e)]['name'],'journeyBundleName':_0x39243e['attributes']['journeyBundleName']||'','journeyBundleId':_0x39243e['attributes']['journeyBundleId']||'','versionNumber':_0x39243e[_0x4df836(0x10e)][_0x4df836(0x173)],'description':_0x39243e[_0x4df836(0x10e)][_0x4df836(0x190)],'state':_0x39243e['attributes'][_0x4df836(0x157)],'paused':_0x39243e['attributes'][_0x4df836(0x150)],'audienceId':_0x39243e[_0x4df836(0x10e)][_0x4df836(0x136)],'folderId':_0x39243e[_0x4df836(0x192)]?.[_0x4df836(0x104)]?.[_0x4df836(0x154)]?.['id'],'createdAt':_0x39243e[_0x4df836(0x10e)]['createdAt'],'updatedAt':_0x39243e[_0x4df836(0x10e)][_0x4df836(0x126)]})),{emailToId:_0x9c456b,idToEmail:_0x1edcab}=_0x12d967,_0x52a22b=await withSpinner(_0x4df836(0x115),async()=>{const _0x54a09c=_0x4df836,_0x5b1677=await _0x4f5d4d[_0x54a09c(0x138)]['list']();return buildConnectionMaps(_0x5b1677);},{'verbose':_0x195602[_0x4df836(0x18d)]})[_0x4df836(0x181)](_0x5cca38=>_0x5cca38[_0x4df836(0x154)]),_0x32f275=_0x52a22b[_0x4df836(0x153)],_0x1b645c=_0x52a22b['idToName'],_0x35e774=_0x52a22b[_0x4df836(0x130)],_0x157daf={'emailToIdMap':_0x9c456b,'connectionNameToIdMap':_0x32f275,'connectionNameToTypeMap':_0x35e774,'getSchema':_0x3620b7=>_0x4f5d4d[_0x4df836(0x138)][_0x4df836(0x16d)](_0x3620b7)};let {pathToId:_0x475d5f,idToPath:_0x307ff0}=buildFolderMaps(_0x173b2b);const _0x48ab81=buildSegmentLookupMap(_0x331952,_0x307ff0),_0x5aa587=buildSegmentNameToIdMap(_0x331952),_0x703a6e=buildJourneyBundleLookupMap(_0x549041,_0x307ff0);let _0x47915d;if(_0xfcfcf){if(!_0xfcfcf[_0x4df836(0x14e)](_0x4df836(0x102))&&!_0xfcfcf['endsWith']('.yaml'))return console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x15e)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0xfcfcf+'\x0a')),0x1;_0x47915d=[_0xfcfcf];}else _0x47915d=findYamlFiles(_0x53fc09);if(_0x47915d[_0x4df836(0x168)]===0x0)return console[_0x4df836(0x112)](a42_0x4a954e['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x53fc09+'\x0a')),console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x11d)](_0x4df836(0x121))),0x1;let _0x25be79,_0x544b86;try{const _0x2c370c=parseAndClassifyYamlFiles(_0x47915d,_0x53fc09,{'skipSegments':_0x195602[_0x4df836(0x13f)]});_0x25be79=_0x2c370c[_0x4df836(0x134)],_0x544b86=_0x2c370c[_0x4df836(0x119)];const _0x2474e3=validateParsedFiles(_0x2c370c,_0x53fc09);if(_0x2474e3['length']>0x0)return console['error'](a42_0x4a954e[_0x4df836(0x15e)](_0x4df836(0x183))),console['error'](formatValidationErrors(_0x2474e3)),console['error'](a42_0x4a954e[_0x4df836(0x16c)](_0x4df836(0x161))),0x1;}catch(_0x301cbe){return console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x15e)](_0x4df836(0x106)+(_0x301cbe instanceof Error?_0x301cbe[_0x4df836(0x184)]:_0x301cbe))),0x1;}if(_0x25be79['length']===0x0&&_0x544b86[_0x4df836(0x168)]===0x0){const _0x5c05cd=_0x195602[_0x4df836(0x13f)]?_0x4df836(0x180):_0x4df836(0x110);return console['error'](a42_0x4a954e['yellow']('No\x20'+_0x5c05cd+_0x4df836(0x100))),0x0;}const _0x51b9db=new Map();_0x331952[_0x4df836(0x168)]>0x0&&!_0x195602['journeysOnly']&&await withSpinner(_0x4df836(0x15f),async()=>{await batchAsync(_0x331952,async _0x29f866=>{const _0x51fee0=a42_0x38c6,_0x47c98=await _0x4f5d4d[_0x51fee0(0x122)]['listActivations'](_0x4018a7,_0x29f866['id']);_0x51b9db[_0x51fee0(0x103)](_0x29f866['id'],_0x47c98);});},{'verbose':_0x195602[_0x4df836(0x18d)]});const {segmentFiles:_0x5865de,foldersToCreate:_0x37d742}=await prepareSegmentFiles(_0x25be79,{'segmentByFolderAndName':_0x48ab81,'activationsBySegmentId':_0x51b9db,'folderPathToId':_0x475d5f,'idToEmailMap':_0x1edcab,'connectionIdToNameMap':_0x1b645c},_0x157daf,_0x3acbfa,_0x4b9618),_0x4ddd4e=_0xfcfcf?[]:findSegmentsToDelete(_0x331952,_0x25be79[_0x4df836(0x118)](({yamlConfig:_0x7c9aaa,folderPath:_0x28a858})=>({'yamlConfig':_0x7c9aaa,'folderPath':resolveTDFolderPath(_0x28a858,_0x3acbfa,_0x4b9618)})),_0x307ff0,_0x4b9618,_0x3acbfa),{journeyFiles:_0x25e33c,foldersToCreate:_0x47bd69}=await withProgressSpinner(_0x4df836(0x158),async _0x1b7474=>prepareJourneyFiles(_0x544b86,{'fetchJourney':async _0x14e153=>_0x4f5d4d[_0x4df836(0x180)]['getJourney'](_0x14e153[_0x4df836(0x11b)]),'journeyBundlesByFolderAndName':_0x703a6e,'folderPathToId':_0x475d5f,'idToEmailMap':_0x1edcab,'connectionIdToNameMap':_0x1b645c,'existingSegments':_0x331952,'parentId':_0x4018a7,'deps':_0x4f5d4d,'progress':{'update':_0x549785=>{const _0x92a170=_0x4df836;_0x1b7474[_0x92a170(0x193)](_0x549785),_0x195602['verbose']&&console[_0x92a170(0x112)]('\x20\x20'+_0x549785);}},'journeyById':_0x2ab07a,'activationStepsById':_0xe2ca1c},_0x3acbfa,_0x4b9618),{'verbose':_0x195602['verbose']})[_0x4df836(0x181)](_0x2f2f06=>_0x2f2f06[_0x4df836(0x154)]);for(const _0x424b92 of _0x47bd69){_0x37d742[_0x4df836(0x133)](_0x424b92);}const _0x1b1432=_0xfcfcf?[]:findJourneysToDelete(_0x549041,_0x544b86[_0x4df836(0x118)](({yamlConfig:_0xf0410d,folderPath:_0x8e4405})=>({'yamlConfig':_0xf0410d,'folderPath':resolveTDFolderPath(_0x8e4405,_0x3acbfa,_0x4b9618)})),_0x307ff0,_0x4b9618,_0x3acbfa),_0x4e5854=calculatePushStats(_0x5865de,_0x25e33c,_0x37d742,_0x4ddd4e,_0x1b1432,!!_0x195602[_0x4df836(0x16f)],!!_0x195602[_0x4df836(0x13f)]),_0x4ed389=_0x4e5854[_0x4df836(0x134)]['new'],_0x337977=_0x4e5854['segments']['changed'],_0x4e31c7=_0x4e5854[_0x4df836(0x134)][_0x4df836(0x10b)],_0x10130a=_0x4e5854[_0x4df836(0x134)][_0x4df836(0x135)],_0xdcb498=_0x4e5854['folders'][_0x4df836(0x15c)],_0x2adaac=_0x4e5854[_0x4df836(0x119)][_0x4df836(0x148)],_0x20905d=_0x4e5854[_0x4df836(0x119)][_0x4df836(0x179)],_0x555731=_0x4e5854[_0x4df836(0x119)][_0x4df836(0x10b)],_0x3b0441=_0x4e5854[_0x4df836(0x119)][_0x4df836(0x135)],_0x3e734d=_0x4e5854[_0x4df836(0x175)]['all'],_0x56cad7=_0x4e5854[_0x4df836(0x175)]['toCreate'],_0x5c5615=_0x4e5854[_0x4df836(0x175)][_0x4df836(0x107)],_0x5ab814=_0x4e5854['activations'][_0x4df836(0x135)];console['error'](_0x4df836(0x16e)+_0x592980+'\x27:');_0xdcb498[_0x4df836(0x168)]>0x0&&console['error']('\x20\x20'+a42_0x4a954e[_0x4df836(0x14b)](_0x4df836(0x163)+_0xdcb498[_0x4df836(0x168)]+_0x4df836(0x167)));if(!_0x195602[_0x4df836(0x13f)]){console['error'](_0x4df836(0x15a)),console[_0x4df836(0x112)](_0x4df836(0x10a)+a42_0x4a954e[_0x4df836(0x170)]('+\x20'+_0x4ed389[_0x4df836(0x168)]+_0x4df836(0x12f))),console['error'](_0x4df836(0x10a)+a42_0x4a954e[_0x4df836(0x16c)]('~\x20'+_0x337977['length']+_0x4df836(0x159)));if(_0x10130a[_0x4df836(0x168)]>0x0)console[_0x4df836(0x112)](_0x4df836(0x10a)+a42_0x4a954e[_0x4df836(0x15e)]('-\x20'+_0x10130a[_0x4df836(0x168)]+'\x20to\x20delete'));else _0x4ddd4e['length']>0x0&&!_0x195602[_0x4df836(0x16f)]&&console[_0x4df836(0x112)](_0x4df836(0x10a)+a42_0x4a954e[_0x4df836(0x13a)](_0x4ddd4e[_0x4df836(0x168)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x4df836(0x112)](_0x4df836(0x10a)+a42_0x4a954e['dim']('=\x20'+_0x4e31c7[_0x4df836(0x168)]+'\x20unchanged'));}if(_0x25e33c[_0x4df836(0x168)]>0x0||_0x1b1432[_0x4df836(0x168)]>0x0){console[_0x4df836(0x112)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x4df836(0x112)](_0x4df836(0x10a)+a42_0x4a954e[_0x4df836(0x170)]('+\x20'+_0x2adaac['length']+_0x4df836(0x12f))),console[_0x4df836(0x112)]('\x20\x20\x20\x20'+a42_0x4a954e[_0x4df836(0x16c)]('~\x20'+_0x20905d[_0x4df836(0x168)]+'\x20changed'));if(_0x3b0441[_0x4df836(0x168)]>0x0)console[_0x4df836(0x112)](_0x4df836(0x10a)+a42_0x4a954e[_0x4df836(0x15e)]('-\x20'+_0x3b0441[_0x4df836(0x168)]+_0x4df836(0x12a)));else _0x1b1432['length']>0x0&&!_0x195602['delete']&&console['error']('\x20\x20\x20\x20'+a42_0x4a954e[_0x4df836(0x13a)](_0x1b1432[_0x4df836(0x168)]+_0x4df836(0x125)));console['error'](_0x4df836(0x10a)+a42_0x4a954e['dim']('=\x20'+_0x555731[_0x4df836(0x168)]+_0x4df836(0x14f)));}_0x3e734d[_0x4df836(0x168)]>0x0&&!_0x195602['journeysOnly']&&(console['error'](''),console[_0x4df836(0x112)](_0x4df836(0x12c)),_0x56cad7[_0x4df836(0x168)]>0x0&&console[_0x4df836(0x112)](_0x4df836(0x10a)+a42_0x4a954e[_0x4df836(0x170)]('+\x20'+_0x56cad7[_0x4df836(0x168)]+_0x4df836(0x12b))),_0x5c5615['length']>0x0&&console[_0x4df836(0x112)](_0x4df836(0x10a)+a42_0x4a954e['yellow']('~\x20'+_0x5c5615[_0x4df836(0x168)]+_0x4df836(0x120))),_0x5ab814[_0x4df836(0x168)]>0x0&&console[_0x4df836(0x112)]('\x20\x20\x20\x20'+a42_0x4a954e[_0x4df836(0x15e)]('-\x20'+_0x5ab814[_0x4df836(0x168)]+_0x4df836(0x12a))));console[_0x4df836(0x112)](_0x4df836(0x196)+a42_0x4a954e[_0x4df836(0x11d)](_0x53fc09)+'\x0a');if(_0xdcb498[_0x4df836(0x168)]>0x0){console[_0x4df836(0x112)](_0x4df836(0x108));for(const _0x192aa2 of _0xdcb498){console[_0x4df836(0x112)]('\x20\x20'+a42_0x4a954e[_0x4df836(0x14b)]('+')+'\x20'+_0x192aa2);}console['error']('');}if(_0x4ed389[_0x4df836(0x168)]>0x0&&!_0x195602[_0x4df836(0x13f)])for(const _0x31bedf of _0x4ed389){const _0x53a5d6=_0x31bedf['folderPath']?_0x31bedf[_0x4df836(0x18f)]+'/'+_0x31bedf['yamlConfig']['name']:_0x31bedf['yamlConfig']['name'],_0x203470=_0x31bedf[_0x4df836(0x13c)][_0x4df836(0x175)]?.[_0x4df836(0x168)]||0x0,_0x4a8b4f=_0x203470>0x0?a42_0x4a954e['dim']('\x20['+_0x203470+_0x4df836(0x17e)):'';console[_0x4df836(0x112)]('\x0a'+a42_0x4a954e[_0x4df836(0x170)]('New\x20segment:')+'\x20'+_0x53a5d6+_0x4a8b4f),console['error']('─'[_0x4df836(0x194)](0x3c)),_0x31bedf[_0x4df836(0x15b)]&&console[_0x4df836(0x112)](_0x31bedf['diff']),console[_0x4df836(0x112)]('─'[_0x4df836(0x194)](0x3c));}if(_0x10130a[_0x4df836(0x168)]>0x0&&!_0x195602[_0x4df836(0x13f)])for(const _0x3442a2 of _0x10130a){const _0x64e214=_0x3442a2[_0x4df836(0x188)]?_0x307ff0[_0x4df836(0x16b)](_0x3442a2[_0x4df836(0x188)][_0x4df836(0x142)]())||'':'',_0x57acdf=_0x64e214?_0x64e214+'/'+_0x3442a2[_0x4df836(0x165)]:_0x3442a2[_0x4df836(0x165)],_0x47c922=_0x51b9db[_0x4df836(0x16b)](_0x3442a2['id'])||[],_0x4a4f29=_0x47c922[_0x4df836(0x168)]>0x0?a42_0x4a954e[_0x4df836(0x13a)]('\x20['+_0x47c922['length']+'\x20activations]'):'';console[_0x4df836(0x112)]('\x0a'+a42_0x4a954e[_0x4df836(0x15e)](_0x4df836(0x11e))+'\x20'+_0x57acdf+_0x4a4f29),console['error']('─'[_0x4df836(0x194)](0x3c));const _0x5b4829=segmentWithActivationsToYaml(_0x3442a2,_0x47c922,undefined,_0x1edcab,_0x1b645c),_0x38f51a=segmentToYamlString(_0x5b4829),_0x1a3447=generateDiff(_0x38f51a,'');console['error'](formatDiffWithColors(_0x1a3447)),console[_0x4df836(0x112)]('─'[_0x4df836(0x194)](0x3c));}const _0x34dc68=_0x5865de[_0x4df836(0x139)](_0x1149c1=>!_0x1149c1[_0x4df836(0x17f)]&&_0x1149c1[_0x4df836(0x15b)]);if(_0x34dc68[_0x4df836(0x168)]>0x0&&!_0x195602['journeysOnly'])for(const _0x2f8168 of _0x34dc68){const _0x4b0b01=_0x2f8168['folderPath']?_0x2f8168[_0x4df836(0x18f)]+'/'+_0x2f8168[_0x4df836(0x13c)][_0x4df836(0x165)]:_0x2f8168[_0x4df836(0x13c)]['name'];console['error']('\x0a'+a42_0x4a954e['yellow'](_0x4df836(0x197))+'\x20'+_0x4b0b01),console[_0x4df836(0x112)]('─'[_0x4df836(0x194)](0x3c)),console[_0x4df836(0x112)](_0x2f8168[_0x4df836(0x15b)]),console[_0x4df836(0x112)]('─'['repeat'](0x3c));}if(_0x2adaac[_0x4df836(0x168)]>0x0)for(const _0x21661e of _0x2adaac){const _0x337fa5=_0x21661e['folderPath']?_0x21661e[_0x4df836(0x18f)]+'/'+_0x21661e[_0x4df836(0x13c)][_0x4df836(0x165)]:_0x21661e[_0x4df836(0x13c)]['name'];console['error']('\x0a'+a42_0x4a954e[_0x4df836(0x170)](_0x4df836(0x116))+'\x20'+_0x337fa5),console[_0x4df836(0x112)]('─'[_0x4df836(0x194)](0x3c)),_0x21661e[_0x4df836(0x15b)]&&console[_0x4df836(0x112)](_0x21661e[_0x4df836(0x15b)]),console[_0x4df836(0x112)]('─'[_0x4df836(0x194)](0x3c));}const _0x178af8=_0x25e33c[_0x4df836(0x139)](_0x49c598=>!_0x49c598[_0x4df836(0x17f)]&&_0x49c598[_0x4df836(0x15b)]);if(_0x178af8[_0x4df836(0x168)]>0x0)for(const _0x4e2726 of _0x178af8){const _0x398f6c=_0x4e2726['folderPath']?_0x4e2726['folderPath']+'/'+_0x4e2726[_0x4df836(0x13c)][_0x4df836(0x165)]:_0x4e2726[_0x4df836(0x13c)][_0x4df836(0x165)];console[_0x4df836(0x112)]('\x0a'+a42_0x4a954e[_0x4df836(0x16c)](_0x4df836(0x182))+'\x20'+_0x398f6c),console[_0x4df836(0x112)]('─'['repeat'](0x3c)),console[_0x4df836(0x112)](_0x4e2726[_0x4df836(0x15b)]),console[_0x4df836(0x112)]('─'[_0x4df836(0x194)](0x3c));}if(_0x3b0441['length']>0x0)for(const _0x3f4cbd of _0x3b0441){const _0x40c853=_0x3f4cbd['folderId']?_0x307ff0[_0x4df836(0x16b)](_0x3f4cbd[_0x4df836(0x146)])||'':'',_0x1656b5=_0x40c853?_0x40c853+'/'+_0x3f4cbd['journeyBundleName']:_0x3f4cbd[_0x4df836(0x174)];console[_0x4df836(0x112)]('\x0a'+a42_0x4a954e['red'](_0x4df836(0x186))+'\x20'+_0x1656b5),console[_0x4df836(0x112)]('─'['repeat'](0x3c)),console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x15e)](_0x4df836(0x17d))),console[_0x4df836(0x112)]('─'[_0x4df836(0x194)](0x3c));}if(_0x195602[_0x4df836(0x160)])return console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x16c)](_0x4df836(0x13d))),0x0;const _0x25352e=_0x195602[_0x4df836(0x13f)]?![]:_0x4ed389['length']>0x0||_0x337977[_0x4df836(0x168)]>0x0||_0x10130a[_0x4df836(0x168)]>0x0,_0x28b00e=_0x2adaac[_0x4df836(0x168)]>0x0||_0x20905d['length']>0x0||_0x3b0441[_0x4df836(0x168)]>0x0,_0x887ecf=_0x195602['journeysOnly']?![]:_0x3e734d[_0x4df836(0x168)]>0x0,_0x11c843=_0xdcb498[_0x4df836(0x168)]>0x0;if(!_0x25352e&&!_0x28b00e&&!_0x887ecf&&!_0x11c843){const _0x17835b=_0x195602['journeysOnly']?_0x4df836(0x140):_0x4df836(0x152);console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x170)](_0x17835b));if(_0xfcfcf&&_0x4e31c7[_0x4df836(0x168)]===0x1){const _0x38805c=_0x4e31c7[0x0];if(_0x38805c[_0x4df836(0x162)]?.['id']){const _0x2e3601=getConsoleNextUrl(_0x195602[_0x4df836(0x195)],_0x4df836(0x151)+_0x4018a7+_0x4df836(0x137)+_0x38805c[_0x4df836(0x162)]['id']+_0x4df836(0x109));console['error'](_0x4df836(0x132)+a42_0x4a954e[_0x4df836(0x11d)](_0x2e3601));}}if(_0xfcfcf&&_0x555731[_0x4df836(0x168)]===0x1){const _0x1db8a4=_0x555731[0x0];if(_0x1db8a4['existingJourney']?.['id']){const _0x2a8596=getConsoleNextUrl(_0x195602[_0x4df836(0x195)],_0x4df836(0x151)+_0x4018a7+_0x4df836(0x137)+_0x1db8a4[_0x4df836(0x13e)]['id']+_0x4df836(0x10d));console[_0x4df836(0x112)]('\x20\x20'+a42_0x4a954e[_0x4df836(0x11d)](_0x2a8596));}}return 0x0;}const _0x532839=_0x195602[_0x4df836(0x13f)]?_0x2adaac[_0x4df836(0x168)]+_0x20905d[_0x4df836(0x168)]+_0x3b0441[_0x4df836(0x168)]+_0xdcb498['length']:_0x4ed389[_0x4df836(0x168)]+_0x337977[_0x4df836(0x168)]+_0x10130a['length']+_0x2adaac['length']+_0x20905d[_0x4df836(0x168)]+_0x3b0441[_0x4df836(0x168)]+_0xdcb498[_0x4df836(0x168)]+_0x3e734d['length'];if(!_0x195602[_0x4df836(0x129)]&&_0x532839>0x0){if(!isInteractive())return console['error'](a42_0x4a954e[_0x4df836(0x15e)](_0x4df836(0x124)),_0x4df836(0x185)),console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x13a)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x51f514=await confirmKey(_0x4df836(0xfd)+_0x532839+_0x4df836(0x17b));if(!_0x51f514)return console['error'](a42_0x4a954e[_0x4df836(0x16c)]('Aborted.')),0x1;}const _0x1f063b={'withProgress':async(_0x32ca1c,_0x4dc049)=>{const _0x2f58dd=_0x4df836,_0x108a65=await withSpinner(_0x32ca1c,_0x4dc049,{'verbose':_0x195602[_0x2f58dd(0x18d)]});return{'data':_0x108a65[_0x2f58dd(0x154)]};},'logInfo':_0x480437=>console[_0x4df836(0x112)](a42_0x4a954e['blue']('✔\x20'+_0x480437)),'logSuccess':_0x4f782f=>console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x170)]('✔\x20'+_0x4f782f)),'logWarning':_0x34b8e7=>console['error'](a42_0x4a954e['yellow']('⚠\x20'+_0x34b8e7)),'logDeleted':_0x4cec15=>console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x15e)]('✔\x20'+_0x4cec15))},_0x2f7470={'segment':_0x4f5d4d['segment'],'journey':_0x4f5d4d['journey'],'user':_0x4f5d4d[_0x4df836(0x18e)],'connection':_0x4f5d4d[_0x4df836(0x138)]};_0xdcb498[_0x4df836(0x168)]>0x0&&(_0x475d5f=await executePushFolders(_0x2f7470,_0xdcb498,_0x475d5f,{'parentId':_0x4018a7},_0x1f063b));const _0x3bafa4={'rootFolderId':_0xa6d8fe,'folderPathToId':_0x475d5f,'folderIdToPath':_0x307ff0,'segmentNameToId':_0x5aa587,'activationsBySegmentId':_0x51b9db,'emailToIdMap':_0x9c456b,'idToEmailMap':_0x1edcab,'connectionNameToIdMap':_0x52a22b[_0x4df836(0x153)],'connectionIdToNameMap':_0x52a22b[_0x4df836(0x14a)],'connectionNameToTypeMap':_0x35e774},_0x16bf63=await executePushSegments(_0x2f7470,_0x195602[_0x4df836(0x13f)]?[]:_0x5865de,_0x3bafa4,{'parentId':_0x4018a7},_0x1f063b),_0x331f3c=_0x16bf63['created'],_0x2ab4c2=_0x16bf63['updated'],_0x55c698=_0x16bf63[_0x4df836(0x175)]['created'],_0x2ab76b=_0x16bf63['activations'][_0x4df836(0x128)],_0x4e5abc=_0x16bf63[_0x4df836(0x175)][_0x4df836(0x143)];let _0x963142;if(_0xfcfcf&&_0x5865de[_0x4df836(0x168)]===0x1){const _0x2190e9=_0x5865de[0x0];_0x963142=_0x2190e9[_0x4df836(0x162)]?.['id']??_0x16bf63[_0x4df836(0x101)][_0x4df836(0x16b)](_0x2190e9[_0x4df836(0x13c)][_0x4df836(0x165)]);}const _0x323d17=await executePushSegmentDeletions(_0x2f7470,_0x195602[_0x4df836(0x13f)]?[]:_0x10130a,_0x1f063b);let _0x3a38f2=0x0,_0x1f3150=0x0,_0x2c189c=0x0;const _0x8717cf=new Map(_0x5aa587);for(const [_0x22c53c,_0x773677]of _0x16bf63['createdSegmentIds']){_0x8717cf['set'](_0x22c53c,_0x773677);}if(_0x25e33c[_0x4df836(0x168)]>0x0){const _0x565528={..._0x3bafa4,'segmentNameToId':_0x8717cf,'existingSegments':_0x331952,'activationContext':_0x157daf},_0x1cad33=await executePushJourneys(_0x2f7470,_0x25e33c,_0x565528,{'parentId':_0x4018a7,'rootFolderId':_0xa6d8fe,'verbose':_0x195602['verbose']},_0x1f063b);_0x3a38f2=_0x1cad33[_0x4df836(0x171)],_0x1f3150=_0x1cad33[_0x4df836(0x128)];if(_0xfcfcf&&_0x1cad33[_0x4df836(0x18a)]['length']===0x1){const _0x359f04=_0x1cad33[_0x4df836(0x18a)][0x0];if(_0x359f04[_0x4df836(0x11b)]){const _0x455f10=getConsoleNextUrl(_0x195602[_0x4df836(0x195)],_0x4df836(0x151)+_0x4018a7+_0x4df836(0x137)+_0x359f04[_0x4df836(0x11b)]+_0x4df836(0x10d));console['error']('\x20\x20'+a42_0x4a954e[_0x4df836(0x11d)](_0x455f10));}}}for(const _0x567b54 of _0x3b0441){console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x16c)](_0x4df836(0x12e)+_0x567b54[_0x4df836(0x174)])),_0x2c189c++;}const _0x2bc30b=[];if(_0x331f3c>0x0)_0x2bc30b[_0x4df836(0x141)](_0x331f3c+'\x20created');if(_0x2ab4c2>0x0)_0x2bc30b[_0x4df836(0x141)](_0x2ab4c2+_0x4df836(0x10c));if(_0x323d17>0x0)_0x2bc30b[_0x4df836(0x141)](_0x323d17+'\x20deleted');const _0x296004=[];if(_0x3a38f2>0x0)_0x296004[_0x4df836(0x141)](_0x3a38f2+_0x4df836(0x17c));if(_0x1f3150>0x0)_0x296004['push'](_0x1f3150+_0x4df836(0x10c));if(_0x2c189c>0x0)_0x296004[_0x4df836(0x141)](_0x2c189c+'\x20deleted');const _0x48c2fc=[];if(_0x55c698>0x0)_0x48c2fc['push'](_0x55c698+'\x20created');if(_0x2ab76b>0x0)_0x48c2fc[_0x4df836(0x141)](_0x2ab76b+_0x4df836(0x10c));if(_0x4e5abc>0x0)_0x48c2fc[_0x4df836(0x141)](_0x4e5abc+_0x4df836(0x178));console[_0x4df836(0x112)](a42_0x4a954e[_0x4df836(0x170)]('\x0a✔\x20Push\x20complete'));_0x2bc30b['length']>0x0&&!_0x195602['journeysOnly']&&console[_0x4df836(0x112)](_0x4df836(0x172)+_0x2bc30b[_0x4df836(0x156)](',\x20'));_0x296004['length']>0x0&&console[_0x4df836(0x112)](_0x4df836(0x18c)+_0x296004[_0x4df836(0x156)](',\x20'));_0x48c2fc[_0x4df836(0x168)]>0x0&&!_0x195602['journeysOnly']&&console['error'](_0x4df836(0xfe)+_0x48c2fc[_0x4df836(0x156)](',\x20'));if(_0x963142){const _0x4dd2aa=getConsoleNextUrl(_0x195602['site'],_0x4df836(0x151)+_0x4018a7+'/e/'+_0x963142+'/sb/da/esr');console[_0x4df836(0x112)](_0x4df836(0x132)+a42_0x4a954e['cyan'](_0x4dd2aa));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x516289=a43_0x4d80;(function(_0x3eee0f,_0xa2ccd2){const _0x274689=a43_0x4d80,_0x53326f=_0x3eee0f();while(!![]){try{const _0x12028f=-parseInt(_0x274689(0x1e0))/0x1*(parseInt(_0x274689(0x1de))/0x2)+parseInt(_0x274689(0x1d8))/0x3*(-parseInt(_0x274689(0x1e4))/0x4)+parseInt(_0x274689(0x1d1))/0x5+-parseInt(_0x274689(0x1fd))/0x6+parseInt(_0x274689(0x1f5))/0x7*(parseInt(_0x274689(0x1f8))/0x8)+parseInt(_0x274689(0x1ee))/0x9+-parseInt(_0x274689(0x1ef))/0xa;if(_0x12028f===_0xa2ccd2)break;else _0x53326f['push'](_0x53326f['shift']());}catch(_0x44d229){_0x53326f['push'](_0x53326f['shift']());}}}(a43_0x4e1e,0xb49db));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a43_0x4e1e(){const _0x462873=['Parent\x20ID:\x20','1964712uMXqxD','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Segment\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','Update\x20existing\x20child\x20segment','Resolving\x20path\x20\x27','segment:update','5293940rpktKd','rule','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','includes','ruleFile','\x27...','Segment\x20ID\x20missing\x20from\x20resolved\x20path','144ehmGgz','description','segment','segmentPath','execute','name','10DNzgMb','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','106612ILolWh','Resolving\x20folder\x20\x27','type','✔\x20Updated\x20segment\x20\x27','63156QpDGOi','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','verbose','Examples:','error','INTERNAL','segmentId','segmentName','Updating\x20segment\x20\x27','resolveFolderId','10924947vsxSlp','3051580YXMxqe','Resolved\x20type:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','data','folder','yellow','1603TiSgJR','updateSegmentById','Resolved\x20folder\x20ID:\x20','13648dINDLl','kind','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','length'];a43_0x4e1e=function(){return _0x462873;};return a43_0x4e1e();}function a43_0x4d80(_0x56d9e5,_0x90806d){_0x56d9e5=_0x56d9e5-0x1cc;const _0x4e1e01=a43_0x4e1e();let _0x4d8009=_0x4e1e01[_0x56d9e5];return _0x4d8009;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a43_0x506bd9 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a43_0x516289(0x1dd)]=a43_0x516289(0x1d0);[a43_0x516289(0x1d9)]=a43_0x516289(0x1ce);async[a43_0x516289(0x1dc)](_0x364353){const _0x218ad4=a43_0x516289;console[_0x218ad4(0x1e8)](a43_0x506bd9[_0x218ad4(0x1f4)](_0x218ad4(0x1df))),console['error'](a43_0x506bd9[_0x218ad4(0x1f4)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x3bd7af,args:_0x533b63,tdx:_0x52956f}=_0x364353,_0x367a86=_0x3bd7af;if(_0x533b63[_0x218ad4(0x1fb)]===0x0)return console[_0x218ad4(0x1e8)](_0x218ad4(0x1f1)),console[_0x218ad4(0x1e8)](_0x218ad4(0x1d3)),console[_0x218ad4(0x1e8)](_0x218ad4(0x1e7)),console['error'](_0x218ad4(0x1e5)),console[_0x218ad4(0x1e8)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x99808f=_0x533b63[0x0],_0x3cd55b=_0x3bd7af[_0x218ad4(0x1db)];let _0xf62d9d=_0x99808f;_0x3cd55b&&!_0x99808f[_0x218ad4(0x1d4)]('/')&&(_0xf62d9d=_0x3cd55b+'/'+_0x99808f,_0x367a86['verbose']&&console[_0x218ad4(0x1e8)](_0x218ad4(0x1cd)+_0xf62d9d));const _0xb52781=await withSpinner(_0x218ad4(0x1cf)+_0xf62d9d+_0x218ad4(0x1d6),()=>_0x52956f[_0x218ad4(0x1da)]['resolvePathToResource'](_0xf62d9d),{'verbose':_0x367a86[_0x218ad4(0x1e6)]}),_0x1c3cfc=_0xb52781[_0x218ad4(0x1f2)];_0x367a86['verbose']&&console[_0x218ad4(0x1e8)](_0x218ad4(0x1f0)+_0x1c3cfc['type']);if(_0x1c3cfc[_0x218ad4(0x1e2)]!==_0x218ad4(0x1da))return console[_0x218ad4(0x1e8)]('Error:\x20Cannot\x20update\x20'+_0x1c3cfc[_0x218ad4(0x1e2)]+_0x218ad4(0x1fa)),console[_0x218ad4(0x1e8)](_0x218ad4(0x1fe)),0x1;if(!_0x1c3cfc[_0x218ad4(0x1ea)])throw new SDKError(ErrorCode[_0x218ad4(0x1e9)],_0x218ad4(0x1d7));const _0x4ea52f=_0x1c3cfc['parentId'],_0x30e532=_0x1c3cfc[_0x218ad4(0x1ea)];_0x367a86['verbose']&&(console['error'](_0x218ad4(0x1fc)+_0x4ea52f),console['error'](_0x218ad4(0x1cc)+_0x30e532));let _0x3f60a4;if(_0x367a86[_0x218ad4(0x1f3)]){const _0x22c4a1=_0x367a86[_0x218ad4(0x1f3)],_0x17f45f=await withSpinner(_0x218ad4(0x1e1)+_0x22c4a1+'\x27...',()=>_0x52956f[_0x218ad4(0x1da)][_0x218ad4(0x1ed)](_0x4ea52f,_0x22c4a1),{'verbose':_0x367a86[_0x218ad4(0x1e6)]});_0x3f60a4=parseInt(_0x17f45f['data'],0xa),_0x367a86[_0x218ad4(0x1e6)]&&console[_0x218ad4(0x1e8)](_0x218ad4(0x1f7)+_0x3f60a4);}const _0x14eede=await loadJSONFromOptions(_0x367a86[_0x218ad4(0x1d2)],_0x367a86[_0x218ad4(0x1d5)]),_0x341dc6={'name':_0x367a86[_0x218ad4(0x1dd)],'description':_0x367a86[_0x218ad4(0x1d9)],'rule':_0x14eede,'kind':_0x367a86[_0x218ad4(0x1f9)]!==undefined?parseInt(_0x367a86[_0x218ad4(0x1f9)],0xa):undefined,'segmentFolderId':_0x3f60a4},_0x5d02ef=await withSpinner(_0x218ad4(0x1ec)+_0x1c3cfc[_0x218ad4(0x1eb)]+_0x218ad4(0x1d6),()=>_0x52956f[_0x218ad4(0x1da)][_0x218ad4(0x1f6)](_0x4ea52f,_0x30e532,_0x341dc6),{'verbose':_0x367a86[_0x218ad4(0x1e6)]}),_0x1e29d7=_0x5d02ef[_0x218ad4(0x1f2)];return console[_0x218ad4(0x1e8)](_0x218ad4(0x1e3)+_0x1e29d7[_0x218ad4(0x1dd)]+'\x27'),_0xf62d9d!==_0x99808f&&console[_0x218ad4(0x1e8)]('\x20\x20\x20Path:\x20'+_0xf62d9d),await handleSDKOutput([_0x1e29d7],_0x367a86),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x2d4a45=a44_0x2047;(function(_0x3b61d3,_0x4eca2c){const _0x5f3218=a44_0x2047,_0x478a8c=_0x3b61d3();while(!![]){try{const _0x3de3f0=parseInt(_0x5f3218(0x197))/0x1*(-parseInt(_0x5f3218(0x1a5))/0x2)+-parseInt(_0x5f3218(0x187))/0x3+-parseInt(_0x5f3218(0x17b))/0x4*(-parseInt(_0x5f3218(0x1ad))/0x5)+parseInt(_0x5f3218(0x1af))/0x6+parseInt(_0x5f3218(0x186))/0x7*(parseInt(_0x5f3218(0x1b4))/0x8)+parseInt(_0x5f3218(0x18f))/0x9*(-parseInt(_0x5f3218(0x199))/0xa)+parseInt(_0x5f3218(0x182))/0xb*(parseInt(_0x5f3218(0x1a8))/0xc);if(_0x3de3f0===_0x4eca2c)break;else _0x478a8c['push'](_0x478a8c['shift']());}catch(_0x3a8141){_0x478a8c['push'](_0x478a8c['shift']());}}}(a44_0x25aa,0xb26ed));function a44_0x2047(_0x4bf07e,_0x36f99c){_0x4bf07e=_0x4bf07e-0x17a;const _0x25aa33=a44_0x25aa();let _0x204730=_0x25aa33[_0x4bf07e];return _0x204730;}import{existsSync,statSync}from'fs';import a44_0x54fbec from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a44_0x25aa(){const _0x2b3912=['split','type','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','630XEnBPJ','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Site:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Resolved\x20relative\x20path\x20to:\x20','✔\x20Context\x20set\x20to:\x20','green','segment','535CFApBK','resolvePathToResource','107260WJtjDw','isAbsolute','config','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','log','\x27...','name','isDirectory','folderPath','Resolved\x20path\x20type:\x20','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','error','4458tZBYbO','Examples:','dim','84wFzoTE','Folder\x20ID:\x20','segment:use','data','Resolving\x20path\x20\x27','936115uuUpQs','length','2277390vDpqJL','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','verbose','segments','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','64jVKrBt','fullPath','segmentPath','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','8BYaDjc','red','description','Use:\x20tdx\x20segment\x20use\x20','join','parentId','cyan','3367694wQeVWk','execute','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Target\x20path:\x20','97076EBXwue','1001511BOOVgc','parentName','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','Error:\x20Path\x20is\x20required\x0a','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'];a44_0x25aa=function(){return _0x2b3912;};return a44_0x25aa();}export class SegmentUseCommand extends BaseCommand{[a44_0x2d4a45(0x19f)]=a44_0x2d4a45(0x1aa);[a44_0x2d4a45(0x17d)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a44_0x2d4a45(0x183)](_0x1843cb){const _0x4fc747=a44_0x2d4a45,{options:_0x332a20,args:_0x44bd14,tdx:_0x16312c}=_0x1843cb;if(_0x44bd14[_0x4fc747(0x1ae)]===0x0)return console[_0x4fc747(0x1a4)](a44_0x54fbec[_0x4fc747(0x17c)](_0x4fc747(0x18a))),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x4fc747(0x1a4)](_0x4fc747(0x1a6)),console[_0x4fc747(0x1a4)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x4fc747(0x1a4)](_0x4fc747(0x19c)),console[_0x4fc747(0x1a4)](_0x4fc747(0x190)),console[_0x4fc747(0x1a4)](_0x4fc747(0x184)),0x1;const _0x1d4656=_0x44bd14[0x0],_0x4cec58=_0x332a20['session'];try{if(_0x1d4656==='/')return saveSessionContext({'segment_path':undefined},_0x4cec58),console[_0x4fc747(0x19d)](a44_0x54fbec[_0x4fc747(0x195)](_0x4fc747(0x17a))),0x0;if(existsSync(_0x1d4656)&&statSync(_0x1d4656)[_0x4fc747(0x1a0)]()){let _0x19b19d;try{_0x19b19d=findTdxConfig(_0x1d4656);}catch{return console['error'](a44_0x54fbec[_0x4fc747(0x17c)](_0x4fc747(0x18b)+_0x1d4656)),console['error'](a44_0x54fbec[_0x4fc747(0x181)](_0x4fc747(0x192))),0x1;}const _0x5234ea=_0x19b19d[_0x4fc747(0x19b)]['parent_segment'];return saveSessionContext({'segment_path':_0x5234ea,'parent_segment':_0x5234ea},_0x4cec58),console[_0x4fc747(0x19d)](a44_0x54fbec[_0x4fc747(0x195)](_0x4fc747(0x194)+a44_0x54fbec[_0x4fc747(0x181)](_0x5234ea))),0x0;}const _0x4cb8aa=_0x332a20[_0x4fc747(0x1b6)];let _0x44998d=_0x1d4656;const _0x2320f5=parsePath(_0x1d4656);if(!_0x2320f5[_0x4fc747(0x19a)]){if(!_0x4cb8aa)return console[_0x4fc747(0x1a4)](a44_0x54fbec['red'](_0x4fc747(0x189))),console[_0x4fc747(0x1a4)](a44_0x54fbec['cyan'](_0x4fc747(0x1b3))),0x1;if(_0x1d4656==='..'){const _0x48db9f=_0x4cb8aa[_0x4fc747(0x18c)]('/')['slice'](0x0,-0x1)[_0x4fc747(0x17f)]('/');_0x44998d=_0x48db9f||'/';}else _0x1d4656==='.'?_0x44998d=_0x4cb8aa:_0x44998d=_0x4cb8aa+'/'+_0x1d4656;_0x332a20[_0x4fc747(0x1b1)]&&console[_0x4fc747(0x1a4)](_0x4fc747(0x193)+_0x44998d);}if(_0x44998d==='/'||_0x44998d==='')return saveSessionContext({'segment_path':undefined},_0x4cec58),console[_0x4fc747(0x19d)](a44_0x54fbec[_0x4fc747(0x195)](_0x4fc747(0x17a))),0x0;_0x44998d=normalizePath(_0x44998d);const _0x490a89=parsePath(_0x44998d)[_0x4fc747(0x1b2)];if(_0x490a89[_0x4fc747(0x1ae)]===0x0)return saveSessionContext({'segment_path':undefined},_0x4cec58),console[_0x4fc747(0x19d)](a44_0x54fbec[_0x4fc747(0x195)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x332a20[_0x4fc747(0x1b1)]&&(console[_0x4fc747(0x1a4)](_0x4fc747(0x191)+_0x332a20['site']),console[_0x4fc747(0x1a4)](_0x4fc747(0x185)+_0x44998d));const _0x4dc932=await withSpinner(_0x4fc747(0x1ac)+_0x44998d+_0x4fc747(0x19e),()=>_0x16312c[_0x4fc747(0x196)][_0x4fc747(0x198)](_0x44998d),{'verbose':_0x332a20[_0x4fc747(0x1b1)]}),_0x4097f7=_0x4dc932[_0x4fc747(0x1ab)];_0x332a20['verbose']&&(console[_0x4fc747(0x1a4)](_0x4fc747(0x1a2)+_0x4097f7['type']),console['error']('Parent\x20ID:\x20'+_0x4097f7[_0x4fc747(0x180)]),_0x4097f7['folderId']&&console[_0x4fc747(0x1a4)](_0x4fc747(0x1a9)+_0x4097f7['folderId']));if(_0x4097f7[_0x4fc747(0x18d)]===_0x4fc747(0x196))return console['error'](a44_0x54fbec[_0x4fc747(0x17c)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x4fc747(0x1a4)](_0x4fc747(0x1b0)),console[_0x4fc747(0x1a4)](a44_0x54fbec[_0x4fc747(0x181)](_0x4fc747(0x17e)+_0x4097f7[_0x4fc747(0x188)]+(_0x4097f7[_0x4fc747(0x1a1)]?'/'+_0x4097f7[_0x4fc747(0x1a1)][_0x4fc747(0x17f)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x4097f7[_0x4fc747(0x1b5)],'parent_segment':_0x4097f7['parentName']},_0x4cec58),console[_0x4fc747(0x19d)](a44_0x54fbec[_0x4fc747(0x195)]('✔\x20Context\x20set\x20to:\x20'+a44_0x54fbec['cyan'](_0x4097f7['fullPath']))),_0x332a20[_0x4fc747(0x1b1)]&&(console[_0x4fc747(0x1a4)](a44_0x54fbec[_0x4fc747(0x1a7)](_0x4fc747(0x18e))),console[_0x4fc747(0x1a4)](a44_0x54fbec[_0x4fc747(0x1a7)](_0x4fc747(0x1a3)))),0x0;}catch(_0x788bc8){throw _0x788bc8;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a45_0x5ce5(){const _0x18b1e1=['45kvLhWu','):\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files','✔\x20All\x20','\x20warning(s)','Error:\x20','segment:validate','13496QPgAZT','649390ZuIGmV','invalidCount','1233olvddG','red','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20valid','4314080LbJsLf','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','errorCode','137136MnKHMC','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','helpText','validCount','error','436503hQFikC','dim','targetDir','605520zlljJP','cyan','length','\x20warning(s)\x20found','.yaml','warningCount','message','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','green','\x20file(s)\x20valid','valid','execute','parentSegment','Error:\x20Directory\x20not\x20found:\x20','filePath','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','3791oNkXGi','\x20file(s)\x20with\x20errors,\x20','114JppzCf','description','cwd','name','file','hasErrors','no_parent','log','yellow'];a45_0x5ce5=function(){return _0x18b1e1;};return a45_0x5ce5();}const a45_0x38ba16=a45_0x8e65;(function(_0x395570,_0x5bae97){const _0x2afb5c=a45_0x8e65,_0x4c2219=_0x395570();while(!![]){try{const _0x55e267=-parseInt(_0x2afb5c(0x155))/0x1*(-parseInt(_0x2afb5c(0x157))/0x2)+-parseInt(_0x2afb5c(0x142))/0x3+parseInt(_0x2afb5c(0x145))/0x4+-parseInt(_0x2afb5c(0x160))/0x5*(parseInt(_0x2afb5c(0x13c))/0x6)+-parseInt(_0x2afb5c(0x133))/0x7+-parseInt(_0x2afb5c(0x132))/0x8*(parseInt(_0x2afb5c(0x135))/0x9)+parseInt(_0x2afb5c(0x139))/0xa;if(_0x55e267===_0x5bae97)break;else _0x4c2219['push'](_0x4c2219['shift']());}catch(_0xf9c90){_0x4c2219['push'](_0x4c2219['shift']());}}}(a45_0x5ce5,0x1e385));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a45_0x8e65(_0x16ec29,_0x598311){_0x16ec29=_0x16ec29-0x12f;const _0x5ce5e1=a45_0x5ce5();let _0x8e654c=_0x5ce5e1[_0x16ec29];return _0x8e654c;}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a45_0x221247 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a45_0x38ba16(0x15a)]=a45_0x38ba16(0x131);[a45_0x38ba16(0x158)]=a45_0x38ba16(0x162);async[a45_0x38ba16(0x150)](_0x1b5761){const _0x1e6ba9=a45_0x38ba16,{options:_0x3df60e,args:_0x34f358}=_0x1b5761,_0xf7e0fc=_0x3df60e,_0x1714ee=await resolveTarget({'arg':_0x34f358[0x0],'contextParent':_0x3df60e[_0x1e6ba9(0x151)],'cwd':process[_0x1e6ba9(0x159)]()});if(!isSuccessfulResolution(_0x1714ee))return _0x1714ee[_0x1e6ba9(0x13b)]===_0x1e6ba9(0x15d)?(console[_0x1e6ba9(0x141)](a45_0x221247[_0x1e6ba9(0x15f)](_0x1e6ba9(0x154))),console['error'](_0x1e6ba9(0x14c)),console[_0x1e6ba9(0x141)](_0x1e6ba9(0x13a)),console['error'](_0x1e6ba9(0x13e))):(console[_0x1e6ba9(0x141)](a45_0x221247[_0x1e6ba9(0x136)](_0x1e6ba9(0x130)+_0x1714ee[_0x1e6ba9(0x14b)]+'\x0a')),_0x1714ee[_0x1e6ba9(0x13f)]&&console['error'](a45_0x221247[_0x1e6ba9(0x146)](_0x1714ee[_0x1e6ba9(0x13f)]))),0x1;const _0x4ba8cc=_0x1714ee[_0x1e6ba9(0x144)],_0x4a7688=_0x1714ee['type']===_0x1e6ba9(0x15b)?_0x1714ee[_0x1e6ba9(0x153)]:undefined;if(!_0x4a7688&&!existsSync(_0x4ba8cc))return console['error'](a45_0x221247[_0x1e6ba9(0x136)](_0x1e6ba9(0x152)+_0x4ba8cc+'\x0a')),0x1;let _0x1092db;if(_0x4a7688){if(!_0x4a7688['endsWith']('.yml')&&!_0x4a7688['endsWith'](_0x1e6ba9(0x149)))return console[_0x1e6ba9(0x141)](a45_0x221247[_0x1e6ba9(0x136)](_0x1e6ba9(0x13d)+_0x4a7688+'\x0a')),0x1;_0x1092db=[_0x4a7688];}else _0x1092db=findYamlFiles(_0x4ba8cc);if(_0x1092db[_0x1e6ba9(0x147)]===0x0)return console[_0x1e6ba9(0x141)](a45_0x221247['red'](_0x1e6ba9(0x137)+_0x4ba8cc+'\x0a')),0x1;const _0x5235eb=validateYamlFiles(_0x1092db,_0x4ba8cc),_0x2192e1=calculateSummary(_0x5235eb);for(const _0x26866a of _0x5235eb){if(!isValidationResult(_0x26866a))continue;const {relativePath:_0x1848da,source:_0x336757,result:_0x4caffc,fileType:_0x338251}=_0x26866a,_0x43f5e6=_0x338251;if(_0x4caffc[_0x1e6ba9(0x14f)]&&_0x4caffc['warnings'][_0x1e6ba9(0x147)]===0x0)_0xf7e0fc['verbose']&&console[_0x1e6ba9(0x15e)](a45_0x221247[_0x1e6ba9(0x14d)]('✔\x20'+_0x1848da)+a45_0x221247[_0x1e6ba9(0x143)]('\x20('+_0x43f5e6+')'));else _0x4caffc[_0x1e6ba9(0x14f)]?(console[_0x1e6ba9(0x15e)](a45_0x221247['yellow']('⚠\x20'+_0x1848da)+a45_0x221247[_0x1e6ba9(0x143)]('\x20('+_0x43f5e6+_0x1e6ba9(0x161)+_0x4caffc['warnings'][_0x1e6ba9(0x147)]+_0x1e6ba9(0x12f))),console[_0x1e6ba9(0x15e)](formatValidationResult(_0x4caffc,_0x336757,_0x1848da))):(console[_0x1e6ba9(0x15e)](a45_0x221247['red']('✖\x20'+_0x1848da)+a45_0x221247[_0x1e6ba9(0x143)]('\x20('+_0x43f5e6+_0x1e6ba9(0x161)+_0x4caffc['errors']['length']+'\x20error(s)')),console[_0x1e6ba9(0x15e)](formatValidationResult(_0x4caffc,_0x336757,_0x1848da)));}return console['log'](''),_0x2192e1[_0x1e6ba9(0x15c)]?(console[_0x1e6ba9(0x15e)](a45_0x221247[_0x1e6ba9(0x136)]('Validation\x20failed:\x20'+_0x2192e1[_0x1e6ba9(0x134)]+_0x1e6ba9(0x156)+_0x2192e1[_0x1e6ba9(0x140)]+_0x1e6ba9(0x138))),_0x2192e1['warningCount']>0x0&&console[_0x1e6ba9(0x15e)](a45_0x221247[_0x1e6ba9(0x15f)](_0x2192e1[_0x1e6ba9(0x14a)]+_0x1e6ba9(0x148))),0x1):(console['log'](a45_0x221247[_0x1e6ba9(0x14d)](_0x1e6ba9(0x163)+_0x2192e1['validCount']+_0x1e6ba9(0x14e))),_0x2192e1['warningCount']>0x0&&console['log'](a45_0x221247[_0x1e6ba9(0x15f)](_0x2192e1[_0x1e6ba9(0x14a)]+_0x1e6ba9(0x148))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a46_0x3e8134=a46_0x1005;(function(_0x3b5528,_0x441c67){const _0x5f31f1=a46_0x1005,_0x51668d=_0x3b5528();while(!![]){try{const _0x6169f3=-parseInt(_0x5f31f1(0x170))/0x1*(parseInt(_0x5f31f1(0x1a3))/0x2)+parseInt(_0x5f31f1(0x19e))/0x3+parseInt(_0x5f31f1(0x175))/0x4*(-parseInt(_0x5f31f1(0x16a))/0x5)+parseInt(_0x5f31f1(0x15f))/0x6*(parseInt(_0x5f31f1(0x184))/0x7)+parseInt(_0x5f31f1(0x181))/0x8+parseInt(_0x5f31f1(0x1a5))/0x9*(parseInt(_0x5f31f1(0x18f))/0xa)+parseInt(_0x5f31f1(0x18c))/0xb*(-parseInt(_0x5f31f1(0x17a))/0xc);if(_0x6169f3===_0x441c67)break;else _0x51668d['push'](_0x51668d['shift']());}catch(_0x10dd9f){_0x51668d['push'](_0x51668d['shift']());}}}(a46_0x2c47,0x503b2));function a46_0x2c47(){const _0xba326c=['dim','folderId','1YUiCWm',']\x20matching\x20\x27','replace','filter','maxDepth','54084BzldJN','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','test','/j/da','Resolving\x20path\x20\x27','8706084usyawD','journeyBundleName','Error:\x20No\x20parent\x20segment\x20context\x20set.','Parent\x20ID:\x20','✔\x20Found\x20','json','jsonl','5179488mTtNDo','\x20journey','/app/ps/','4504955huPMpJ','execute','Resolving\x20parent\x20segment\x20\x27','Set\x20a\x20parent\x20segment\x20context\x20first:','\x5c$&','name','recursive','parentSegment','11nMIVkq','/e/','log','1287330YdhXgF','children','cause','Parent\x20segment\x20context:\x20','length','\x27...','Error:\x20','localeCompare','journeys','(not\x20set)','\x20segment','parentId','type','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x20folder','1117638UXQSYy','data','listUnifiedWithJourneys','error','Listing\x20folders,\x20segments,\x20and\x20journeys...','773202mseMay','resolvePathToResource','9nXCGEw','List\x20folders\x20and\x20child\x20segments','listUnified','format','listRecursive','listWithPattern','6RCdMpC','map','Folder/pattern\x20arg:\x20','site','verbose','segment','folders','folder','sort',',\x20and\x20','Recursive\x20mode:\x20enabled','130uoSAeM','\x20\x20Cause:\x20','segments','journey'];a46_0x2c47=function(){return _0xba326c;};return a46_0x2c47();}import{BaseCommand}from'./command.js';function a46_0x1005(_0x29915e,_0x231e92){_0x29915e=_0x29915e-0x15c;const _0x2c47fa=a46_0x2c47();let _0x100535=_0x2c47fa[_0x29915e];return _0x100535;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a46_0x11ae20 from'chalk';export class SegmentsCommand extends BaseCommand{[a46_0x3e8134(0x189)]=a46_0x3e8134(0x16c);['description']=a46_0x3e8134(0x1a6);async[a46_0x3e8134(0x185)](_0x22f609){const _0x43414c=a46_0x3e8134,{options:_0x21b72f,args:_0x117707}=_0x22f609,_0x32f024=_0x21b72f[_0x43414c(0x18a)],_0x1b9e1e=_0x117707[0x0];try{const _0xdaf53b=_0x21b72f[_0x43414c(0x18b)];_0x21b72f['verbose']&&(console[_0x43414c(0x1a1)]('Site:\x20'+_0x21b72f[_0x43414c(0x162)]),console[_0x43414c(0x1a1)](_0x43414c(0x192)+(_0xdaf53b||_0x43414c(0x198))),_0x1b9e1e&&console[_0x43414c(0x1a1)](_0x43414c(0x161)+_0x1b9e1e),_0x32f024&&console[_0x43414c(0x1a1)](_0x43414c(0x169)));if(!_0xdaf53b)return console[_0x43414c(0x1a1)](_0x43414c(0x17c)),console[_0x43414c(0x1a1)](''),console[_0x43414c(0x1a1)](_0x43414c(0x187)),console[_0x43414c(0x1a1)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x43414c(0x1a1)](_0x43414c(0x19c)),console[_0x43414c(0x1a1)](''),console[_0x43414c(0x1a1)](_0x43414c(0x176)),0x1;const _0x3ca7b9=_0x1b9e1e&&(_0x1b9e1e['includes']('*')||_0x1b9e1e['includes']('?'));if(_0x3ca7b9)return await this[_0x43414c(0x15e)](_0x22f609,_0xdaf53b,_0x1b9e1e);const _0x145e82=_0x1b9e1e?_0xdaf53b+'/'+_0x1b9e1e:_0xdaf53b;return _0x32f024?await this['listRecursive'](_0x22f609,_0x145e82):await this['listUnified'](_0x22f609,_0x145e82);}catch(_0x100319){if(_0x100319 instanceof SDKError)return console[_0x43414c(0x1a1)](_0x43414c(0x195)+_0x100319['message']),_0x100319[_0x43414c(0x191)]&&console[_0x43414c(0x1a1)](_0x43414c(0x16b)+_0x100319[_0x43414c(0x191)]),0x1;throw _0x100319;}}async['listWithPattern'](_0xd68720,_0x2e3d06,_0x304f33){const _0x1d9709=a46_0x3e8134,{options:_0xaadcbd,tdx:_0xbb9a74}=_0xd68720,_0x47df22=await withSpinner(_0x1d9709(0x186)+_0x2e3d06+_0x1d9709(0x194),()=>_0xbb9a74[_0x1d9709(0x164)]['resolvePathToResource'](_0x2e3d06),{'verbose':_0xaadcbd[_0x1d9709(0x163)]}),_0x22b0b1=_0x47df22[_0x1d9709(0x19f)],_0xb694ce=await withSpinner(_0x1d9709(0x1a2),()=>_0xbb9a74['segment'][_0x1d9709(0x1a0)](_0x22b0b1[_0x1d9709(0x19a)],_0x22b0b1[_0x1d9709(0x16f)]),{'verbose':_0xaadcbd[_0x1d9709(0x163)]}),{folders:_0x5d31b2,segments:_0x509f8a,journeys:_0x2fccf8}=_0xb694ce[_0x1d9709(0x19f)],_0x53578a=_0x304f33[_0x1d9709(0x172)](/[.+^${}()|[\]\\]/g,_0x1d9709(0x188))['replace'](/\*/g,'.*')[_0x1d9709(0x172)](/\?/g,'.'),_0x3642a1=new RegExp('^'+_0x53578a+'$','i'),_0x5e2f6c=_0x5d31b2['filter'](_0x5aeae8=>_0x3642a1['test'](_0x5aeae8['name'])),_0x38fda3=_0x509f8a[_0x1d9709(0x173)](_0x4e2302=>_0x3642a1['test'](_0x4e2302['name'])),_0x3c197d=_0x2fccf8[_0x1d9709(0x173)](_0x4406b6=>_0x3642a1[_0x1d9709(0x177)](_0x4406b6[_0x1d9709(0x17b)])),_0x93d66=_0x5e2f6c['length']+_0x38fda3['length']+_0x3c197d[_0x1d9709(0x193)];console[_0x1d9709(0x1a1)]('✔\x20Found\x20'+_0x5e2f6c[_0x1d9709(0x193)]+'\x20folder'+(_0x5e2f6c[_0x1d9709(0x193)]!==0x1?'s':'')+',\x20'+_0x38fda3['length']+_0x1d9709(0x199)+(_0x38fda3[_0x1d9709(0x193)]!==0x1?'s':'')+_0x1d9709(0x168)+_0x3c197d[_0x1d9709(0x193)]+'\x20journey'+(_0x3c197d[_0x1d9709(0x193)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x304f33+'\x27');const _0x7f7a08=_0x350d5c=>{const _0x888d49=_0x1d9709;return getConsoleNextUrl(_0xaadcbd[_0x888d49(0x162)],_0x888d49(0x183)+_0x22b0b1[_0x888d49(0x19a)]+_0x888d49(0x18d)+_0x350d5c);},_0x29f06d=_0xaadcbd[_0x1d9709(0x15c)]===_0x1d9709(0x17f)||_0xaadcbd[_0x1d9709(0x15c)]===_0x1d9709(0x180);if(_0x29f06d){const _0x233eeb=[..._0x5e2f6c[_0x1d9709(0x160)](_0x4c2a4e=>({..._0x4c2a4e,'type':_0x1d9709(0x166)})),..._0x38fda3[_0x1d9709(0x160)](_0x55d806=>({..._0x55d806,'type':_0x1d9709(0x164),'url':_0x7f7a08(_0x55d806['id'])})),..._0x3c197d[_0x1d9709(0x160)](_0x5afa5f=>({..._0x5afa5f,'name':_0x5afa5f[_0x1d9709(0x17b)],'type':_0x1d9709(0x16d)}))][_0x1d9709(0x167)]((_0xafed60,_0x249c9f)=>_0xafed60[_0x1d9709(0x189)][_0x1d9709(0x196)](_0x249c9f[_0x1d9709(0x189)]));await handleSDKOutput(_0x233eeb,_0xaadcbd);}else{if(_0x93d66===0x0)console[_0x1d9709(0x18e)]('No\x20items\x20match\x20pattern:\x20'+_0x304f33);else{console[_0x1d9709(0x18e)](a46_0x11ae20[_0x1d9709(0x16e)]('['+_0x2e3d06+_0x1d9709(0x171)+_0x304f33+'\x27'));const _0x34d32d=formatFlatList(_0x5e2f6c,_0x38fda3,{'showMetadata':!![],'getSegmentUrl':_0x7f7a08},_0x3c197d);console['log'](_0x34d32d);}}return 0x0;}async[a46_0x3e8134(0x1a7)](_0x122330,_0x528d0f){const _0x4bd975=a46_0x3e8134,{options:_0x2286ab,tdx:_0x1536ed}=_0x122330,_0x2b11c6=await withSpinner(_0x4bd975(0x179)+_0x528d0f+'\x27...',()=>_0x1536ed[_0x4bd975(0x164)]['resolvePathToResource'](_0x528d0f),{'verbose':_0x2286ab[_0x4bd975(0x163)]}),_0xc0f442=_0x2b11c6[_0x4bd975(0x19f)];_0x2286ab['verbose']&&(console[_0x4bd975(0x1a1)](_0x4bd975(0x17d)+_0xc0f442['parentId']),_0xc0f442[_0x4bd975(0x16f)]&&console[_0x4bd975(0x1a1)]('Folder\x20ID:\x20'+_0xc0f442[_0x4bd975(0x16f)]));const _0x137ace=await withSpinner(_0x4bd975(0x1a2),()=>_0x1536ed[_0x4bd975(0x164)][_0x4bd975(0x1a0)](_0xc0f442[_0x4bd975(0x19a)],_0xc0f442[_0x4bd975(0x16f)]),{'verbose':_0x2286ab[_0x4bd975(0x163)]}),{folders:_0x5d9a1f,segments:_0x254775,journeys:_0x36b673}=_0x137ace['data'],_0x31fa53=_0x5d9a1f[_0x4bd975(0x193)]+_0x254775[_0x4bd975(0x193)]+_0x36b673[_0x4bd975(0x193)];console[_0x4bd975(0x1a1)](_0x4bd975(0x17e)+_0x5d9a1f[_0x4bd975(0x193)]+'\x20folder'+(_0x5d9a1f['length']!==0x1?'s':'')+',\x20'+_0x254775['length']+_0x4bd975(0x199)+(_0x254775['length']!==0x1?'s':'')+_0x4bd975(0x168)+_0x36b673['length']+_0x4bd975(0x182)+(_0x36b673[_0x4bd975(0x193)]!==0x1?'s':''));const _0x2d3686=_0xae9534=>{const _0x279ce7=_0x4bd975;return getConsoleNextUrl(_0x2286ab['site'],_0x279ce7(0x183)+_0xc0f442[_0x279ce7(0x19a)]+_0x279ce7(0x18d)+_0xae9534);},_0x5a9855=_0x3e8669=>{const _0x20c967=_0x4bd975;return getConsoleNextUrl(_0x2286ab[_0x20c967(0x162)],'/app/ps/'+_0xc0f442[_0x20c967(0x19a)]+'/e/'+_0x3e8669+_0x20c967(0x178));},_0x47ebd2=_0x2286ab[_0x4bd975(0x15c)]===_0x4bd975(0x17f)||_0x2286ab[_0x4bd975(0x15c)]===_0x4bd975(0x180);if(_0x47ebd2){const _0x19c04d=[..._0x5d9a1f[_0x4bd975(0x160)](_0x33019c=>({..._0x33019c,'type':'folder'})),..._0x254775[_0x4bd975(0x160)](_0x1f706b=>({..._0x1f706b,'type':_0x4bd975(0x164),'url':_0x2d3686(_0x1f706b['id'])})),..._0x36b673['map'](_0x17bd82=>({..._0x17bd82,'name':_0x17bd82[_0x4bd975(0x17b)],'type':'journey','url':_0x5a9855(_0x17bd82['id'])}))][_0x4bd975(0x167)]((_0x3c6938,_0x223821)=>_0x3c6938['name'][_0x4bd975(0x196)](_0x223821['name']));await handleSDKOutput(_0x19c04d,_0x2286ab);}else{if(_0x31fa53===0x0)console['log'](a46_0x11ae20[_0x4bd975(0x16e)]('['+_0x528d0f+']')),console[_0x4bd975(0x18e)]('(empty)');else{console[_0x4bd975(0x18e)](a46_0x11ae20[_0x4bd975(0x16e)]('['+_0x528d0f+']'));const _0x11aa03=formatFlatList(_0x5d9a1f,_0x254775,{'showMetadata':!![],'getSegmentUrl':_0x2d3686,'getJourneyUrl':_0x5a9855},_0x36b673);console[_0x4bd975(0x18e)](_0x11aa03);}}return 0x0;}async[a46_0x3e8134(0x15d)](_0x5b29ff,_0xf3a555){const _0x35c18b=a46_0x3e8134,{options:_0x9949d8,tdx:_0x278ca1}=_0x5b29ff,_0x422fd8=await withSpinner('Resolving\x20path\x20\x27'+_0xf3a555+_0x35c18b(0x194),()=>_0x278ca1[_0x35c18b(0x164)][_0x35c18b(0x1a4)](_0xf3a555),{'verbose':_0x9949d8[_0x35c18b(0x163)]}),_0x186e49=_0x422fd8[_0x35c18b(0x19f)];_0x9949d8[_0x35c18b(0x163)]&&(console[_0x35c18b(0x1a1)](_0x35c18b(0x17d)+_0x186e49[_0x35c18b(0x19a)]),_0x186e49[_0x35c18b(0x16f)]&&console[_0x35c18b(0x1a1)]('Folder\x20ID:\x20'+_0x186e49['folderId']));const _0x3bcdab=_0x9949d8[_0x35c18b(0x174)]||0xa,_0x2b81e3=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x278ca1[_0x35c18b(0x164)][_0x35c18b(0x15d)](_0x186e49[_0x35c18b(0x19a)],_0x186e49[_0x35c18b(0x16f)],0x0,_0x3bcdab),{'verbose':_0x9949d8[_0x35c18b(0x163)]}),_0x523ec1=_0x2b81e3[_0x35c18b(0x19f)],_0x5a269f=_0xab8d11=>{const _0x31cf1a=_0x35c18b;let _0x267d82=0x0,_0x4978ff=0x0,_0x2fd72c=0x0;for(const _0xe14b2d of _0xab8d11){if(_0xe14b2d[_0x31cf1a(0x19b)]===_0x31cf1a(0x166))_0x267d82++;else{if(_0xe14b2d[_0x31cf1a(0x19b)]===_0x31cf1a(0x164))_0x4978ff++;else{if(_0xe14b2d[_0x31cf1a(0x19b)]==='journey')_0x2fd72c++;}}if(_0xe14b2d[_0x31cf1a(0x190)]){const _0x7d1d9b=_0x5a269f(_0xe14b2d[_0x31cf1a(0x190)]);_0x267d82+=_0x7d1d9b[_0x31cf1a(0x165)],_0x4978ff+=_0x7d1d9b[_0x31cf1a(0x16c)],_0x2fd72c+=_0x7d1d9b[_0x31cf1a(0x197)];}}return{'folders':_0x267d82,'segments':_0x4978ff,'journeys':_0x2fd72c};},_0x28c18f=_0x5a269f(_0x523ec1);console[_0x35c18b(0x1a1)]('✔\x20Built\x20tree\x20with\x20'+_0x28c18f[_0x35c18b(0x165)]+_0x35c18b(0x19d)+(_0x28c18f[_0x35c18b(0x165)]!==0x1?'s':'')+',\x20'+_0x28c18f['segments']+_0x35c18b(0x199)+(_0x28c18f[_0x35c18b(0x16c)]!==0x1?'s':'')+_0x35c18b(0x168)+_0x28c18f[_0x35c18b(0x197)]+_0x35c18b(0x182)+(_0x28c18f['journeys']!==0x1?'s':''));const _0x3f027a=_0x3df0cf=>{const _0x7c9d02=_0x35c18b;return getConsoleNextUrl(_0x9949d8[_0x7c9d02(0x162)],_0x7c9d02(0x183)+_0x186e49[_0x7c9d02(0x19a)]+_0x7c9d02(0x18d)+_0x3df0cf);},_0x5e5cc3=_0x291292=>{const _0x161261=_0x35c18b;return getConsoleNextUrl(_0x9949d8[_0x161261(0x162)],_0x161261(0x183)+_0x186e49[_0x161261(0x19a)]+'/e/'+_0x291292+_0x161261(0x178));};if(_0x9949d8['format']===_0x35c18b(0x17f)||_0x9949d8[_0x35c18b(0x15c)]===_0x35c18b(0x180))await handleSDKOutput(_0x523ec1,_0x9949d8);else{console['log'](a46_0x11ae20[_0x35c18b(0x16e)]('['+_0xf3a555+']'));const _0xad1723=formatTree(_0x523ec1,{'showMetadata':!![],'getSegmentUrl':_0x3f027a,'getJourneyUrl':_0x5e5cc3});console['log'](_0xad1723);}return 0x0;}}
|
|
1
|
+
const a46_0x1779d3=a46_0x23ac;(function(_0x4be943,_0x42142d){const _0x735348=a46_0x23ac,_0x56d5d0=_0x4be943();while(!![]){try{const _0x487a8b=parseInt(_0x735348(0xc7))/0x1*(-parseInt(_0x735348(0xd7))/0x2)+-parseInt(_0x735348(0xbf))/0x3*(-parseInt(_0x735348(0xd0))/0x4)+-parseInt(_0x735348(0xca))/0x5*(-parseInt(_0x735348(0xbc))/0x6)+parseInt(_0x735348(0xef))/0x7+-parseInt(_0x735348(0xba))/0x8*(-parseInt(_0x735348(0x101))/0x9)+-parseInt(_0x735348(0xc3))/0xa*(parseInt(_0x735348(0xbe))/0xb)+parseInt(_0x735348(0xfa))/0xc*(-parseInt(_0x735348(0xee))/0xd);if(_0x487a8b===_0x42142d)break;else _0x56d5d0['push'](_0x56d5d0['shift']());}catch(_0x4aa0cb){_0x56d5d0['push'](_0x56d5d0['shift']());}}}(a46_0x16a5,0x1c84a));import{BaseCommand}from'./command.js';function a46_0x23ac(_0x2920f9,_0x3c7944){_0x2920f9=_0x2920f9-0xba;const _0x16a5b5=a46_0x16a5();let _0x23ac01=_0x16a5b5[_0x2920f9];return _0x23ac01;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a46_0x16a5(){const _0x201e17=['listUnified','\x20folder','Parent\x20segment\x20context:\x20','type','Folder/pattern\x20arg:\x20','map','10KNbuIx','listRecursive','/e/','Folder\x20ID:\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','cause','listWithPattern','\x20segment','segment','sort','Site:\x20','Error:\x20No\x20parent\x20segment\x20context\x20set.','parentId','message','\x27...','log','folderId','journeys','execute','json','\x20matching\x20\x27','/app/ps/','jsonl','65VsTlBq','6321nEukqv','Parent\x20ID:\x20','includes','parentSegment','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Error:\x20','\x5c$&','\x20journey','✔\x20Found\x20','resolvePathToResource','data','77736ZcRjql','verbose','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','name','dim','folder','No\x20items\x20match\x20pattern:\x20','240417xQhdLb','Building\x20hierarchy\x20tree...','replace','folders','segments',']\x20matching\x20\x27','64XjUYfU','site','12378HUOatX',',\x20and\x20','11parzYe','30576JGtJIO','error','test','recursive','1268360XbBLsG','Recursive\x20mode:\x20enabled','journeyBundleName','localeCompare','44795bUKwbu','length','(not\x20set)','420RpXyPw','filter','format','listUnifiedWithJourneys','journey','List\x20folders\x20and\x20child\x20segments','44RYelHQ'];a46_0x16a5=function(){return _0x201e17;};return a46_0x16a5();}import a46_0x573c02 from'chalk';export class SegmentsCommand extends BaseCommand{[a46_0x1779d3(0xfd)]='segments';['description']=a46_0x1779d3(0xcf);async[a46_0x1779d3(0xe9)](_0x230d84){const _0xe24c05=a46_0x1779d3,{options:_0x430f02,args:_0x5a5591}=_0x230d84,_0x105a0a=_0x430f02[_0xe24c05(0xc2)],_0x55839c=_0x5a5591[0x0];try{const _0xbd26a1=_0x430f02[_0xe24c05(0xf2)];_0x430f02['verbose']&&(console['error'](_0xe24c05(0xe1)+_0x430f02['site']),console[_0xe24c05(0xc0)](_0xe24c05(0xd3)+(_0xbd26a1||_0xe24c05(0xc9))),_0x55839c&&console[_0xe24c05(0xc0)](_0xe24c05(0xd5)+_0x55839c),_0x105a0a&&console['error'](_0xe24c05(0xc4)));if(!_0xbd26a1)return console[_0xe24c05(0xc0)](_0xe24c05(0xe2)),console[_0xe24c05(0xc0)](''),console['error']('Set\x20a\x20parent\x20segment\x20context\x20first:'),console['error'](_0xe24c05(0xfc)),console['error']('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0xe24c05(0xc0)](''),console[_0xe24c05(0xc0)](_0xe24c05(0xf3)),0x1;const _0x2bed4a=_0x55839c&&(_0x55839c[_0xe24c05(0xf1)]('*')||_0x55839c[_0xe24c05(0xf1)]('?'));if(_0x2bed4a)return await this[_0xe24c05(0xdd)](_0x230d84,_0xbd26a1,_0x55839c);const _0x1448f7=_0x55839c?_0xbd26a1+'/'+_0x55839c:_0xbd26a1;return _0x105a0a?await this['listRecursive'](_0x230d84,_0x1448f7):await this[_0xe24c05(0xd1)](_0x230d84,_0x1448f7);}catch(_0x3f39ad){if(_0x3f39ad instanceof SDKError)return console[_0xe24c05(0xc0)](_0xe24c05(0xf4)+_0x3f39ad[_0xe24c05(0xe4)]),_0x3f39ad[_0xe24c05(0xdc)]&&console['error']('\x20\x20Cause:\x20'+_0x3f39ad[_0xe24c05(0xdc)]),0x1;throw _0x3f39ad;}}async[a46_0x1779d3(0xdd)](_0x2b7ef0,_0x5a0235,_0x219fd3){const _0x5aa454=a46_0x1779d3,{options:_0x3d0e41,tdx:_0xc878db}=_0x2b7ef0,_0x9c068d=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5a0235+'\x27...',()=>_0xc878db[_0x5aa454(0xdf)][_0x5aa454(0xf8)](_0x5a0235),{'verbose':_0x3d0e41['verbose']}),_0x23f4c4=_0x9c068d['data'],_0x4e5eb1=await withSpinner(_0x5aa454(0xdb),()=>_0xc878db[_0x5aa454(0xdf)][_0x5aa454(0xcd)](_0x23f4c4[_0x5aa454(0xe3)],_0x23f4c4['folderId']),{'verbose':_0x3d0e41['verbose']}),{folders:_0x21f4dd,segments:_0xe65c09,journeys:_0x53bea7}=_0x4e5eb1[_0x5aa454(0xf9)],_0x5ae226=_0x219fd3['replace'](/[.+^${}()|[\]\\]/g,_0x5aa454(0xf5))[_0x5aa454(0x103)](/\*/g,'.*')[_0x5aa454(0x103)](/\?/g,'.'),_0x4aef98=new RegExp('^'+_0x5ae226+'$','i'),_0x59c78a=_0x21f4dd['filter'](_0x8f8d70=>_0x4aef98['test'](_0x8f8d70['name'])),_0x3df1ad=_0xe65c09[_0x5aa454(0xcb)](_0x405ac8=>_0x4aef98[_0x5aa454(0xc1)](_0x405ac8[_0x5aa454(0xfd)])),_0x566726=_0x53bea7['filter'](_0x1cd3e9=>_0x4aef98[_0x5aa454(0xc1)](_0x1cd3e9[_0x5aa454(0xc5)])),_0x53a0ec=_0x59c78a['length']+_0x3df1ad['length']+_0x566726[_0x5aa454(0xc8)];console[_0x5aa454(0xc0)]('✔\x20Found\x20'+_0x59c78a[_0x5aa454(0xc8)]+'\x20folder'+(_0x59c78a['length']!==0x1?'s':'')+',\x20'+_0x3df1ad[_0x5aa454(0xc8)]+'\x20segment'+(_0x3df1ad['length']!==0x1?'s':'')+_0x5aa454(0xbd)+_0x566726[_0x5aa454(0xc8)]+_0x5aa454(0xf6)+(_0x566726[_0x5aa454(0xc8)]!==0x1?'s':'')+_0x5aa454(0xeb)+_0x219fd3+'\x27');const _0x2ef7a8=_0x15e8d0=>{const _0xa97686=_0x5aa454;return getConsoleNextUrl(_0x3d0e41[_0xa97686(0xbb)],_0xa97686(0xec)+_0x23f4c4['parentId']+'/e/'+_0x15e8d0);},_0x44d077=_0x3d0e41[_0x5aa454(0xcc)]==='json'||_0x3d0e41[_0x5aa454(0xcc)]===_0x5aa454(0xed);if(_0x44d077){const _0x591dba=[..._0x59c78a['map'](_0x5196c0=>({..._0x5196c0,'type':_0x5aa454(0xff)})),..._0x3df1ad['map'](_0x29ca47=>({..._0x29ca47,'type':_0x5aa454(0xdf),'url':_0x2ef7a8(_0x29ca47['id'])})),..._0x566726[_0x5aa454(0xd6)](_0x33280a=>({..._0x33280a,'name':_0x33280a[_0x5aa454(0xc5)],'type':_0x5aa454(0xce)}))][_0x5aa454(0xe0)]((_0x40ea8a,_0x3b5746)=>_0x40ea8a[_0x5aa454(0xfd)][_0x5aa454(0xc6)](_0x3b5746[_0x5aa454(0xfd)]));await handleSDKOutput(_0x591dba,_0x3d0e41);}else{if(_0x53a0ec===0x0)console['log'](_0x5aa454(0x100)+_0x219fd3);else{console[_0x5aa454(0xe6)](a46_0x573c02[_0x5aa454(0xfe)]('['+_0x5a0235+_0x5aa454(0x106)+_0x219fd3+'\x27'));const _0x497800=formatFlatList(_0x59c78a,_0x3df1ad,{'showMetadata':!![],'getSegmentUrl':_0x2ef7a8},_0x566726);console[_0x5aa454(0xe6)](_0x497800);}}return 0x0;}async[a46_0x1779d3(0xd1)](_0x5c8c29,_0x3d3e35){const _0x1a92a7=a46_0x1779d3,{options:_0x1dc2e7,tdx:_0xe5c4}=_0x5c8c29,_0x2883f8=await withSpinner('Resolving\x20path\x20\x27'+_0x3d3e35+_0x1a92a7(0xe5),()=>_0xe5c4['segment'][_0x1a92a7(0xf8)](_0x3d3e35),{'verbose':_0x1dc2e7['verbose']}),_0x597596=_0x2883f8[_0x1a92a7(0xf9)];_0x1dc2e7[_0x1a92a7(0xfb)]&&(console['error']('Parent\x20ID:\x20'+_0x597596[_0x1a92a7(0xe3)]),_0x597596['folderId']&&console['error'](_0x1a92a7(0xda)+_0x597596[_0x1a92a7(0xe7)]));const _0x4415db=await withSpinner(_0x1a92a7(0xdb),()=>_0xe5c4[_0x1a92a7(0xdf)][_0x1a92a7(0xcd)](_0x597596[_0x1a92a7(0xe3)],_0x597596[_0x1a92a7(0xe7)]),{'verbose':_0x1dc2e7[_0x1a92a7(0xfb)]}),{folders:_0xa5ce94,segments:_0x471c77,journeys:_0x4f9b5b}=_0x4415db['data'],_0x5911cc=_0xa5ce94[_0x1a92a7(0xc8)]+_0x471c77['length']+_0x4f9b5b[_0x1a92a7(0xc8)];console[_0x1a92a7(0xc0)](_0x1a92a7(0xf7)+_0xa5ce94[_0x1a92a7(0xc8)]+_0x1a92a7(0xd2)+(_0xa5ce94[_0x1a92a7(0xc8)]!==0x1?'s':'')+',\x20'+_0x471c77['length']+'\x20segment'+(_0x471c77[_0x1a92a7(0xc8)]!==0x1?'s':'')+_0x1a92a7(0xbd)+_0x4f9b5b[_0x1a92a7(0xc8)]+_0x1a92a7(0xf6)+(_0x4f9b5b[_0x1a92a7(0xc8)]!==0x1?'s':''));const _0x21c10f=_0x4d26f4=>{const _0x21851d=_0x1a92a7;return getConsoleNextUrl(_0x1dc2e7['site'],_0x21851d(0xec)+_0x597596[_0x21851d(0xe3)]+_0x21851d(0xd9)+_0x4d26f4);},_0x273599=_0x52e70e=>{const _0x4d60e1=_0x1a92a7;return getConsoleNextUrl(_0x1dc2e7[_0x4d60e1(0xbb)],_0x4d60e1(0xec)+_0x597596[_0x4d60e1(0xe3)]+'/e/'+_0x52e70e+'/j/da');},_0xa2c604=_0x1dc2e7[_0x1a92a7(0xcc)]===_0x1a92a7(0xea)||_0x1dc2e7[_0x1a92a7(0xcc)]===_0x1a92a7(0xed);if(_0xa2c604){const _0x326cc6=[..._0xa5ce94[_0x1a92a7(0xd6)](_0xfd5d9=>({..._0xfd5d9,'type':_0x1a92a7(0xff)})),..._0x471c77['map'](_0x46c1ed=>({..._0x46c1ed,'type':'segment','url':_0x21c10f(_0x46c1ed['id'])})),..._0x4f9b5b[_0x1a92a7(0xd6)](_0x5b16d9=>({..._0x5b16d9,'name':_0x5b16d9[_0x1a92a7(0xc5)],'type':'journey','url':_0x273599(_0x5b16d9['id'])}))][_0x1a92a7(0xe0)]((_0x25bd18,_0x1428a0)=>_0x25bd18['name'][_0x1a92a7(0xc6)](_0x1428a0[_0x1a92a7(0xfd)]));await handleSDKOutput(_0x326cc6,_0x1dc2e7);}else{if(_0x5911cc===0x0)console[_0x1a92a7(0xe6)](a46_0x573c02[_0x1a92a7(0xfe)]('['+_0x3d3e35+']')),console[_0x1a92a7(0xe6)]('(empty)');else{console['log'](a46_0x573c02[_0x1a92a7(0xfe)]('['+_0x3d3e35+']'));const _0x1946ad=formatFlatList(_0xa5ce94,_0x471c77,{'showMetadata':!![],'getSegmentUrl':_0x21c10f,'getJourneyUrl':_0x273599},_0x4f9b5b);console['log'](_0x1946ad);}}return 0x0;}async['listRecursive'](_0x3d938d,_0x1ca5f0){const _0x5774f6=a46_0x1779d3,{options:_0x475af7,tdx:_0x1a6bc3}=_0x3d938d,_0x3a9125=await withSpinner('Resolving\x20path\x20\x27'+_0x1ca5f0+_0x5774f6(0xe5),()=>_0x1a6bc3['segment'][_0x5774f6(0xf8)](_0x1ca5f0),{'verbose':_0x475af7[_0x5774f6(0xfb)]}),_0x33fc9c=_0x3a9125[_0x5774f6(0xf9)];_0x475af7[_0x5774f6(0xfb)]&&(console[_0x5774f6(0xc0)](_0x5774f6(0xf0)+_0x33fc9c[_0x5774f6(0xe3)]),_0x33fc9c[_0x5774f6(0xe7)]&&console['error'](_0x5774f6(0xda)+_0x33fc9c['folderId']));const _0x2d2ddf=_0x475af7['maxDepth']||0xa,_0x175db9=await withSpinner(_0x5774f6(0x102),()=>_0x1a6bc3[_0x5774f6(0xdf)][_0x5774f6(0xd8)](_0x33fc9c[_0x5774f6(0xe3)],_0x33fc9c[_0x5774f6(0xe7)],0x0,_0x2d2ddf),{'verbose':_0x475af7[_0x5774f6(0xfb)]}),_0x36bad7=_0x175db9[_0x5774f6(0xf9)],_0x47eb8a=_0x4b4d12=>{const _0x571f70=_0x5774f6;let _0x4a1d57=0x0,_0x1e7a9a=0x0,_0x1bb911=0x0;for(const _0x137745 of _0x4b4d12){if(_0x137745[_0x571f70(0xd4)]===_0x571f70(0xff))_0x4a1d57++;else{if(_0x137745[_0x571f70(0xd4)]===_0x571f70(0xdf))_0x1e7a9a++;else{if(_0x137745[_0x571f70(0xd4)]===_0x571f70(0xce))_0x1bb911++;}}if(_0x137745['children']){const _0x28b64b=_0x47eb8a(_0x137745['children']);_0x4a1d57+=_0x28b64b[_0x571f70(0x104)],_0x1e7a9a+=_0x28b64b[_0x571f70(0x105)],_0x1bb911+=_0x28b64b[_0x571f70(0xe8)];}}return{'folders':_0x4a1d57,'segments':_0x1e7a9a,'journeys':_0x1bb911};},_0x437661=_0x47eb8a(_0x36bad7);console[_0x5774f6(0xc0)]('✔\x20Built\x20tree\x20with\x20'+_0x437661['folders']+_0x5774f6(0xd2)+(_0x437661[_0x5774f6(0x104)]!==0x1?'s':'')+',\x20'+_0x437661[_0x5774f6(0x105)]+_0x5774f6(0xde)+(_0x437661[_0x5774f6(0x105)]!==0x1?'s':'')+_0x5774f6(0xbd)+_0x437661[_0x5774f6(0xe8)]+_0x5774f6(0xf6)+(_0x437661['journeys']!==0x1?'s':''));const _0x296c54=_0x1318d0=>{const _0x3ab247=_0x5774f6;return getConsoleNextUrl(_0x475af7[_0x3ab247(0xbb)],_0x3ab247(0xec)+_0x33fc9c['parentId']+'/e/'+_0x1318d0);},_0x1c5397=_0x38e4d3=>{const _0x3f090b=_0x5774f6;return getConsoleNextUrl(_0x475af7[_0x3f090b(0xbb)],'/app/ps/'+_0x33fc9c['parentId']+'/e/'+_0x38e4d3+'/j/da');};if(_0x475af7[_0x5774f6(0xcc)]===_0x5774f6(0xea)||_0x475af7[_0x5774f6(0xcc)]===_0x5774f6(0xed))await handleSDKOutput(_0x36bad7,_0x475af7);else{console[_0x5774f6(0xe6)](a46_0x573c02[_0x5774f6(0xfe)]('['+_0x1ca5f0+']'));const _0x425ca9=formatTree(_0x36bad7,{'showMetadata':!![],'getSegmentUrl':_0x296c54,'getJourneyUrl':_0x1c5397});console[_0x5774f6(0xe6)](_0x425ca9);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a47_0x3684d0=a47_0x2251;(function(_0x471ba3,_0x3819c5){const _0x33a5ed=a47_0x2251,_0x5a3171=_0x471ba3();while(!![]){try{const _0x205fef=parseInt(_0x33a5ed(0x181))/0x1+-parseInt(_0x33a5ed(0x170))/0x2*(-parseInt(_0x33a5ed(0x177))/0x3)+-parseInt(_0x33a5ed(0x178))/0x4*(-parseInt(_0x33a5ed(0x17c))/0x5)+parseInt(_0x33a5ed(0x176))/0x6*(parseInt(_0x33a5ed(0x179))/0x7)+-parseInt(_0x33a5ed(0x172))/0x8*(parseInt(_0x33a5ed(0x18d))/0x9)+parseInt(_0x33a5ed(0x18f))/0xa+-parseInt(_0x33a5ed(0x187))/0xb*(parseInt(_0x33a5ed(0x184))/0xc);if(_0x205fef===_0x3819c5)break;else _0x5a3171['push'](_0x5a3171['shift']());}catch(_0x785cdf){_0x5a3171['push'](_0x5a3171['shift']());}}}(a47_0x2c4e,0x83933));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a47_0x2251(_0x16523e,_0xa2565c){_0x16523e=_0x16523e-0x16e;const _0x2c4e12=a47_0x2c4e();let _0x22511d=_0x2c4e12[_0x16523e];return _0x22511d;}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a47_0x2c4e(){const _0x29dd0e=['length','show','table','\x20row','validate','catalog','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','database','\x20\x20Cause:\x20','limit','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','Usage:\x20tdx\x20show\x20<database.table>','1150978pmePdv','query','24kGBttu','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','cause','Catalog:\x20','31632sFGsZo','3gWhPJa','263252TTsNng','749xlTZVN','showTable','data','80TNlCYg','message','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Retrieved\x20','args','836341NLotrx','name','description','240bRBUNk','error','site','1519309aOCVtc','Table:\x20','...','Database:\x20','\x20from\x20','Error:\x20','1221867nrfImt','verbose','6796580PuHzel','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'];a47_0x2c4e=function(){return _0x29dd0e;};return a47_0x2c4e();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a47_0x3684d0(0x182)]=a47_0x3684d0(0x192);[a47_0x3684d0(0x183)]='Show\x20table\x20contents';async['execute'](_0x278691){const _0x46078f=a47_0x3684d0;return this[_0x46078f(0x17a)](_0x278691);}async[a47_0x3684d0(0x17a)](_0x9437b5){const _0x143cad=a47_0x3684d0,{options:_0x2fa6ef,args:_0x47d6c9,tdx:_0x37dc83}=_0x9437b5;let _0x4cdebc;try{_0x4cdebc=parseTableReference(_0x47d6c9[0x0]);const _0x25d373=_0x2fa6ef[_0x143cad(0x198)];!_0x4cdebc['database']&&_0x25d373&&(_0x4cdebc[_0x143cad(0x198)]=_0x25d373);const _0x2c1ca1=validateTableDescribeReference(_0x4cdebc);if(_0x2c1ca1)return console[_0x143cad(0x185)](_0x143cad(0x18c)+_0x2c1ca1),console[_0x143cad(0x185)](_0x143cad(0x16f)),console['error'](_0x143cad(0x190)),console[_0x143cad(0x185)](_0x143cad(0x17e)),0x1;}catch(_0xad4d62){return console[_0x143cad(0x185)](_0x143cad(0x18c)+_0xad4d62[_0x143cad(0x17d)]),console['error'](_0x143cad(0x16f)),console[_0x143cad(0x185)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x143cad(0x17e)),0x1;}const _0x4c6ba6=_0x4cdebc[_0x143cad(0x196)],_0x4d2d26=_0x4cdebc['database'],_0x46fc28=_0x4cdebc[_0x143cad(0x193)],_0x4e4bd0=resolveLimit(_0x2fa6ef[_0x143cad(0x19a)],DEFAULT_DISPLAY_LIMIT);try{_0x2fa6ef[_0x143cad(0x18e)]&&(console['error']('Site:\x20'+_0x2fa6ef[_0x143cad(0x186)]),_0x4c6ba6&&console[_0x143cad(0x185)](_0x143cad(0x175)+_0x4c6ba6),console[_0x143cad(0x185)](_0x143cad(0x18a)+_0x4d2d26),console[_0x143cad(0x185)](_0x143cad(0x188)+_0x46fc28),console[_0x143cad(0x185)]('Limit:\x20'+_0x4e4bd0));const _0x3ab8fd=_0x4c6ba6?_0x4c6ba6+'.'+_0x4d2d26+'.'+_0x46fc28:_0x4d2d26+'.'+_0x46fc28,_0x5a2404=await withSpinner('Querying\x20'+_0x3ab8fd+_0x143cad(0x189),()=>_0x37dc83[_0x143cad(0x171)][_0x143cad(0x17a)](_0x4d2d26,_0x46fc28,_0x4e4bd0,_0x4c6ba6),{'verbose':_0x2fa6ef[_0x143cad(0x18e)]}),_0x1823c5=_0x5a2404[_0x143cad(0x17b)],_0x1e67af=_0x1823c5[_0x143cad(0x17b)];return _0x1e67af['length']===0x0?console[_0x143cad(0x185)](_0x143cad(0x197)):console[_0x143cad(0x185)](_0x143cad(0x17f)+_0x1e67af[_0x143cad(0x191)]+_0x143cad(0x194)+(_0x1e67af['length']!==0x1?'s':'')+_0x143cad(0x18b)+_0x3ab8fd),await handleSDKOutput(_0x1e67af,_0x2fa6ef),0x0;}catch(_0x300e9c){if(_0x300e9c instanceof SDKError)return console[_0x143cad(0x185)](_0x143cad(0x18c)+_0x300e9c['message']),_0x300e9c['cause']&&console[_0x143cad(0x185)](_0x143cad(0x199)+_0x300e9c[_0x143cad(0x174)]),0x1;throw _0x300e9c;}}[a47_0x3684d0(0x195)](_0xdb2bc6){const _0x1e550d=a47_0x3684d0;if(_0xdb2bc6[_0x1e550d(0x180)][_0x1e550d(0x191)]===0x0)return _0x1e550d(0x16e);if(_0xdb2bc6[_0x1e550d(0x180)]['length']>0x1)return _0x1e550d(0x173);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a48_0x42e430=a48_0x59fc;function a48_0x59fc(_0x5147a9,_0x3391f6){_0x5147a9=_0x5147a9-0x7b;const _0x132a84=a48_0x132a();let _0x59fc36=_0x132a84[_0x5147a9];return _0x59fc36;}(function(_0x21e9f3,_0x7c8a8c){const _0x26edfc=a48_0x59fc,_0xf7203d=_0x21e9f3();while(!![]){try{const _0x5be35=-parseInt(_0x26edfc(0x84))/0x1*(-parseInt(_0x26edfc(0xa5))/0x2)+-parseInt(_0x26edfc(0x8d))/0x3+parseInt(_0x26edfc(0x87))/0x4+-parseInt(_0x26edfc(0x94))/0x5*(parseInt(_0x26edfc(0x9d))/0x6)+parseInt(_0x26edfc(0x81))/0x7+-parseInt(_0x26edfc(0x99))/0x8+parseInt(_0x26edfc(0xa2))/0x9;if(_0x5be35===_0x7c8a8c)break;else _0xf7203d['push'](_0xf7203d['shift']());}catch(_0x245268){_0xf7203d['push'](_0xf7203d['shift']());}}}(a48_0x132a,0x45e06));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a48_0x132a(){const _0x319626=['status','session','N/A','Name:','jobs','email','5QfDqwv','bold','execute','join','CLI\x20flag','1126912qDFJiZ','error','site:\x20','red','434922LNIkwK','OAuth','User:','last_name','green','2695554VlMZcH','cyan','message','227878yYtqTG','No\x20credential\x20found','yellow','first_name','account_id','log','cli','description','Read\x20credential\x20from\x20','1298304gqRcsW','dim','name','3lZqBZL','Account\x20ID:','filter','105920TYPlkk','config','displayWithSources','profile','\x20profile:\x20','(from\x20','1061130wlfzAc'];a48_0x132a=function(){return _0x319626;};return a48_0x132a();}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a48_0x5e316c from'chalk';export class StatusCommand extends BaseCommand{[a48_0x42e430(0x83)]=a48_0x42e430(0x8e);[a48_0x42e430(0x7f)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a48_0x42e430(0x96)](_0x177787){const _0x465d84=a48_0x42e430,{options:_0x3253dd,tdx:_0x46e493}=_0x177787,_0x135331=_0x3253dd['site'],_0x2fa203=new GlobalContext(_0x3253dd),_0x5a2878=_0x2fa203[_0x465d84(0x8a)],_0x2dee7f=_0x2fa203['profileSource'],_0x192a3e=_0x2dee7f===_0x465d84(0x7e)?_0x465d84(0x98):_0x2dee7f===_0x465d84(0x8f)?_0x465d84(0x8f):_0x2dee7f==='env'?'TDX_PROFILE\x20env':_0x2dee7f==='config'?_0x465d84(0x88):null,_0x5d64e4=_0x5a2878?a48_0x5e316c[_0x465d84(0xa3)](_0x5a2878):a48_0x5e316c[_0x465d84(0x82)](_0x465d84(0x90)),_0x50d59c=_0x192a3e?'\x20'+a48_0x5e316c['dim'](_0x465d84(0x8c)+_0x192a3e+')'):'';console[_0x465d84(0x7d)](a48_0x5e316c[_0x465d84(0x95)]('tdx')+_0x465d84(0x8b)+_0x5d64e4+_0x50d59c+'\x20'+a48_0x5e316c[_0x465d84(0x82)]('(')+_0x465d84(0x9b)+a48_0x5e316c[_0x465d84(0xa3)](_0x135331)+a48_0x5e316c['dim'](')'));const _0x4233ba=await getOAuthTokens(_0x5a2878);if(_0x4233ba)console[_0x465d84(0x7d)]('Credential\x20type:\x20'+a48_0x5e316c['cyan'](_0x465d84(0x9e)));else{const _0x3bf53c=await resolveAPIKeyAsync(_0x135331,_0x5a2878);if(_0x3bf53c){const {source:_0x57ec32,isDeprecated:_0x1507a6}=_0x3bf53c,_0x4f29a7=_0x465d84(0x80)+a48_0x5e316c[_0x465d84(0xa3)](_0x57ec32);console[_0x465d84(0x7d)](_0x1507a6?a48_0x5e316c[_0x465d84(0xa7)](_0x4f29a7):_0x4f29a7);}else console['log'](a48_0x5e316c[_0x465d84(0xa7)](_0x465d84(0xa6)));}let _0x41c726=![];try{const _0x30db77=await _0x46e493[_0x465d84(0x92)]['getUserInfo']();console[_0x465d84(0x7d)](a48_0x5e316c[_0x465d84(0xa1)]('✓\x20Authentication\x20successful\x0a')),console['log'](a48_0x5e316c[_0x465d84(0x95)](_0x465d84(0x9f))+'\x20'+a48_0x5e316c[_0x465d84(0xa3)](_0x30db77[_0x465d84(0x93)]));if(_0x30db77[_0x465d84(0x7b)]||_0x30db77['last_name']){const _0x3d4edf=[_0x30db77[_0x465d84(0x7b)],_0x30db77[_0x465d84(0xa0)]][_0x465d84(0x86)](Boolean)[_0x465d84(0x97)]('\x20');console[_0x465d84(0x7d)](a48_0x5e316c['bold'](_0x465d84(0x91))+'\x20'+_0x3d4edf);}_0x30db77[_0x465d84(0x7c)]&&console['log'](a48_0x5e316c[_0x465d84(0x95)](_0x465d84(0x85))+'\x20'+a48_0x5e316c[_0x465d84(0xa7)](_0x30db77['account_id'])),_0x41c726=!![];}catch(_0x107181){_0x107181 instanceof HTTPClientError&&_0x107181[_0x465d84(0x8e)]===0x191?printAuthError(_0x107181,!![],_0x5a2878):console[_0x465d84(0x9a)](a48_0x5e316c[_0x465d84(0x9c)]('✗\x20Validation\x20failed:\x20'+(_0x107181 instanceof Error?_0x107181[_0x465d84(0xa4)]:String(_0x107181))));}return console[_0x465d84(0x7d)](),_0x2fa203[_0x465d84(0x89)](),_0x41c726?0x0:0x1;}}
|