@treasuredata/tdx 2026.4.15 → 2026.4.16
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/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/tools/work-create-item.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.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-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/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/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/access-tracker.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
|
-
|
|
1
|
+
const a40_0x399312=a40_0x5186;(function(_0x58a744,_0x22fccf){const _0x21889a=a40_0x5186,_0x5c6716=_0x58a744();while(!![]){try{const _0x56c5ef=parseInt(_0x21889a(0xf5))/0x1+-parseInt(_0x21889a(0x11d))/0x2*(parseInt(_0x21889a(0x118))/0x3)+parseInt(_0x21889a(0x106))/0x4*(-parseInt(_0x21889a(0x103))/0x5)+parseInt(_0x21889a(0x121))/0x6*(parseInt(_0x21889a(0x11f))/0x7)+parseInt(_0x21889a(0x135))/0x8*(-parseInt(_0x21889a(0x124))/0x9)+parseInt(_0x21889a(0xec))/0xa*(parseInt(_0x21889a(0x129))/0xb)+parseInt(_0x21889a(0x12d))/0xc;if(_0x56c5ef===_0x22fccf)break;else _0x5c6716['push'](_0x5c6716['shift']());}catch(_0x30ad86){_0x5c6716['push'](_0x5c6716['shift']());}}}(a40_0x91ff,0xde9f0));import{BaseCommand}from'./command.js';function a40_0x5186(_0x36c921,_0xd35949){_0x36c921=_0x36c921-0xe8;const _0x91ffc1=a40_0x91ff();let _0x51867a=_0x91ffc1[_0x36c921];return _0x51867a;}import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a40_0x91ff(){const _0x3916a1=['\x20unchanged\x20files','✔\x20Context\x20set:\x20','4488DKkXEW','\x0aError:','journeys','files','27976488iDJdXS','Parent\x20segment:\x20','counts','hasChanges','filter','cwd','parent_segment','no_parent','43776diCrQC','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','✔\x20All\x20files\x20are\x20up\x20to\x20date','dirname','\x20new\x20files','session','description','helpText','relativePath','22140oIjGxc','error','journeyVersions','cyan','\x20\x20🎯\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','segment','\x20journeys','✔\x20Pulled\x20','34069ANbeIJ','segment:pull','parentSegment','\x20segments','Aborted.','Site:\x20','resourceName','yes','length','\x27...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','yellow','pullSegments','verbose','3770dHhxDC','content','targetDir','7204qPfiHz','parentName','\x0aPull\x20summary\x20for\x20\x27','errorCode','isNew','message','segments','\x20files?','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','\x0aChanges\x20to\x20\x27','file','absolutePath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','diff','dim','Write\x20','red','\x20=\x20','4728189IMBsUG','type','repeat','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','2KLFTTg','-\x20no\x20files\x20written','49zabpuG','utf-8','846444oRoYYE','\x20versions)','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)','675YeLAOM','\x20with\x20','\x20\x20🗺️\x20\x20'];a40_0x91ff=function(){return _0x3916a1;};return a40_0x91ff();}import{saveSessionContext}from'../core/session.js';import a40_0x208dcd from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x303894 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{['name']=a40_0x399312(0xf6);[a40_0x399312(0xe9)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x3378c9){const _0x12776e=a40_0x399312,{options:_0x3cef4e,args:_0x4e551a,tdx:_0x280b7a}=_0x3378c9,_0x47d876=_0x3cef4e,_0x5d7076=await resolveTarget({'arg':_0x4e551a[0x0],'contextParent':_0x3cef4e[_0x12776e(0xf7)],'cwd':process[_0x12776e(0x132)]()});if(!isSuccessfulResolution(_0x5d7076))return _0x5d7076[_0x12776e(0x109)]===_0x12776e(0x134)?(console['error'](a40_0x208dcd['yellow'](_0x12776e(0x136))),console[_0x12776e(0xed)](_0x12776e(0x123)),console[_0x12776e(0xed)](_0x12776e(0xff)),console[_0x12776e(0xed)](_0x12776e(0x11c))):(console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x116)]('Error:\x20'+_0x5d7076[_0x12776e(0x10b)]+'\x0a')),_0x5d7076[_0x12776e(0xea)]&&console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0xef)](_0x5d7076[_0x12776e(0xea)]))),0x1;const _0x11535f=_0x5d7076[_0x12776e(0x107)],_0x467f9a=_0x5d7076[_0x12776e(0x105)],_0x5751a9=_0x5d7076[_0x12776e(0x119)]===_0x12776e(0x110)?_0x5d7076[_0x12776e(0xfb)]:undefined;_0x47d876[_0x12776e(0x102)]&&(console[_0x12776e(0xed)](_0x12776e(0xfa)+_0x47d876['site']),console[_0x12776e(0xed)](_0x12776e(0x12e)+_0x11535f),_0x5751a9&&console[_0x12776e(0xed)]('Target\x20resource:\x20'+_0x5751a9));const _0x12d520=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x11535f+_0x12776e(0xfe),_0x52ec61=>_0x280b7a[_0x12776e(0xf2)][_0x12776e(0x101)](_0x11535f,{'targetDir':_0x467f9a,'targetResourceName':_0x5751a9,'verbose':_0x47d876['verbose'],'progress':{'update':_0x1f4cd5=>{const _0x381aa6=_0x12776e;_0x52ec61['setPhase'](_0x1f4cd5),_0x47d876[_0x381aa6(0x102)]&&console[_0x381aa6(0xed)]('\x20\x20'+_0x1f4cd5);}}}),{'verbose':_0x47d876[_0x12776e(0x102)]}),_0x5dd71a=_0x12d520['data'];if(_0x5dd71a[_0x12776e(0x12f)][_0x12776e(0x10c)]===0x0&&_0x5dd71a[_0x12776e(0x12f)][_0x12776e(0x12b)]===0x0)return console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x100)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x5dd71a[_0x12776e(0x107)]+'\x27')),0x0;const _0x5656a0=_0x5dd71a[_0x12776e(0x12c)]['filter'](_0x4a25ad=>_0x4a25ad[_0x12776e(0x10a)]),_0x4065d2=_0x5dd71a['files']['filter'](_0x2a5978=>!_0x2a5978[_0x12776e(0x10a)]&&_0x2a5978[_0x12776e(0x130)]),_0x85494f=_0x5dd71a[_0x12776e(0x12c)][_0x12776e(0x131)](_0x3cdaee=>!_0x3cdaee[_0x12776e(0x10a)]&&!_0x3cdaee[_0x12776e(0x130)]);console[_0x12776e(0xed)](_0x12776e(0x108)+_0x5dd71a['parentName']+'\x27:'),console['error'](_0x12776e(0xf0)+a40_0x208dcd[_0x12776e(0xef)](_0x5dd71a[_0x12776e(0x12f)]['segments']+_0x12776e(0xf8))+_0x12776e(0x125)+a40_0x208dcd[_0x12776e(0xef)](_0x5dd71a[_0x12776e(0x12f)]['activations']+'\x20activations'));if(_0x5dd71a[_0x12776e(0x12f)][_0x12776e(0x12b)]>0x0){const _0x170347=_0x5dd71a[_0x12776e(0x12f)][_0x12776e(0xee)]>_0x5dd71a[_0x12776e(0x12f)]['journeys']?'\x20('+_0x5dd71a[_0x12776e(0x12f)]['journeyVersions']+_0x12776e(0x122):'';console[_0x12776e(0xed)](_0x12776e(0x126)+a40_0x208dcd[_0x12776e(0xef)](_0x5dd71a[_0x12776e(0x12f)][_0x12776e(0x12b)]+_0x12776e(0xf3))+a40_0x208dcd[_0x12776e(0x114)](_0x170347));}console[_0x12776e(0xed)]('\x20\x20'+a40_0x208dcd[_0x12776e(0x11b)]('+\x20'+_0x5656a0[_0x12776e(0xfd)]+_0x12776e(0x139))),console['error']('\x20\x20'+a40_0x208dcd['yellow']('~\x20'+_0x4065d2[_0x12776e(0xfd)]+'\x20changed\x20files')),console['error']('\x20\x20'+a40_0x208dcd[_0x12776e(0x114)]('=\x20'+_0x85494f['length']+_0x12776e(0x127))),console[_0x12776e(0xed)]('\x20\x20Target:\x20'+a40_0x208dcd[_0x12776e(0xef)](_0x5dd71a['targetDir'])+'\x0a');if(_0x4065d2['length']>0x0)for(const _0x7031ef of _0x4065d2){console[_0x12776e(0xed)](_0x12776e(0x10f)+_0x7031ef[_0x12776e(0xeb)]+'\x27:'),console[_0x12776e(0xed)]('─'[_0x12776e(0x11a)](0x3c)),console['error'](_0x7031ef[_0x12776e(0x113)]),console[_0x12776e(0xed)]('─'[_0x12776e(0x11a)](0x3c));}if(_0x47d876['dryRun'])return console[_0x12776e(0xed)](a40_0x208dcd['yellow'](_0x12776e(0x10e))),0x0;if(_0x5656a0[_0x12776e(0xfd)]===0x0&&_0x4065d2[_0x12776e(0xfd)]===0x0)return console['error'](a40_0x208dcd['green'](_0x12776e(0x137))),saveSessionContext({'parent_segment':_0x5dd71a['parentName']},_0x47d876[_0x12776e(0xe8)]),console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x11b)](_0x12776e(0x128)+a40_0x208dcd[_0x12776e(0x114)](_0x12776e(0x133))+_0x12776e(0x117)+a40_0x208dcd[_0x12776e(0xef)](_0x5dd71a[_0x12776e(0x107)]))),0x0;if(!_0x47d876[_0x12776e(0xfc)]){if(!isInteractive())return console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x116)](_0x12776e(0x12a)),_0x12776e(0x112)),console['error'](a40_0x208dcd[_0x12776e(0x114)](_0x12776e(0xf1))),0x1;const _0x413916=await confirmKey(_0x12776e(0x115)+(_0x5656a0['length']+_0x4065d2[_0x12776e(0xfd)])+_0x12776e(0x10d));if(!_0x413916)return console[_0x12776e(0xed)](a40_0x208dcd['yellow'](_0x12776e(0xf9)),_0x12776e(0x11e)),0x1;}for(const _0x1f15f7 of _0x5dd71a[_0x12776e(0x12c)]){if(_0x1f15f7[_0x12776e(0x10a)]||_0x1f15f7[_0x12776e(0x130)]){const _0x23d2bf=a40_0x303894[_0x12776e(0x138)](_0x1f15f7[_0x12776e(0x111)]);!existsSync(_0x23d2bf)&&mkdirSync(_0x23d2bf,{'recursive':!![]}),writeFileSync(_0x1f15f7['absolutePath'],_0x1f15f7[_0x12776e(0x104)],_0x12776e(0x120));}}return console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x11b)](_0x12776e(0xf4)+(_0x5656a0[_0x12776e(0xfd)]+_0x4065d2['length'])+'\x20files\x20to\x20'+_0x5dd71a[_0x12776e(0x105)])),saveSessionContext({'parent_segment':_0x5dd71a['parentName']},_0x47d876[_0x12776e(0xe8)]),console[_0x12776e(0xed)](a40_0x208dcd[_0x12776e(0x11b)]('✔\x20Context\x20set:\x20'+a40_0x208dcd[_0x12776e(0x114)](_0x12776e(0x133))+_0x12776e(0x117)+a40_0x208dcd['cyan'](_0x5dd71a['parentName']))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a41_0x1d1430=a41_0x3591;(function(_0x4a4ce1,_0x2873df){const _0x245ad3=a41_0x3591,_0x76a2c6=_0x4a4ce1();while(!![]){try{const _0x4940f0=-parseInt(_0x245ad3(0x23a))/0x1+-parseInt(_0x245ad3(0x25d))/0x2*(-parseInt(_0x245ad3(0x223))/0x3)+parseInt(_0x245ad3(0x205))/0x4+parseInt(_0x245ad3(0x207))/0x5*(-parseInt(_0x245ad3(0x1da))/0x6)+parseInt(_0x245ad3(0x22a))/0x7*(-parseInt(_0x245ad3(0x1fe))/0x8)+-parseInt(_0x245ad3(0x201))/0x9+parseInt(_0x245ad3(0x275))/0xa*(parseInt(_0x245ad3(0x257))/0xb);if(_0x4940f0===_0x2873df)break;else _0x76a2c6['push'](_0x76a2c6['shift']());}catch(_0x2fb87e){_0x76a2c6['push'](_0x76a2c6['shift']());}}}(a41_0x4d9d,0x23750));function a41_0x3591(_0x480cd1,_0x3f7d7c){_0x480cd1=_0x480cd1-0x1d4;const _0x4d9dad=a41_0x4d9d();let _0x359130=_0x4d9dad[_0x480cd1];return _0x359130;}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';function a41_0x4d9d(){const _0xd26161=['site','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','journeys','results','existingSegment','\x20\x20📊\x20Segments:','Site:\x20','\x27...','new','createdSegmentIds','Error:\x20','\x20changed','\x20folders\x20to\x20create','relationships','parentSegment','no_parent','355287XglpRT','segmentFolderId','journeyBundleId','resolveParentId','journeyId','\x0aPush\x20summary\x20for\x20\x27','changed','2870MXoknZ','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20to\x20create','segment\x20or\x20journey','.yaml','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','map','New\x20segment:','\x20changes?','message','existingJourney','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','dim','nameToType','filter','77183yGlOts','Fetching\x20connections\x20for\x20name\x20resolution...','error','created','add','push','Changes\x20to:','helpText','activations','listSegments','.yml','\x20\x20\x20\x20','green','blue','type','Aborted.','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','folderId','\x20new','\x0a✔\x20Push\x20complete','filePath','\x20created','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','then','all','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','/sb/da/esr','\x20\x20Segments:\x20','parentFolder','4631MwVTMn','buildUserMaps','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','yamlConfig','errorCode','Fetching\x20existing\x20data...','2UtDxzJ','length','yellow','repeat','connection','state','Scoped\x20to\x20folder:\x20','cwd','folderPath','get','/app/ps/','updatedAt','audienceId','\x20\x20Journeys:\x20','diff','Delete\x20journey:','\x20\x20🗺️\x20\x20Journeys:','data','file','getParent','Parent\x20segment:\x20','folders','toCreate','endsWith','7980dGZfWN','parent_name','\x0aValidation\x20failed:','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Error:\x20Directory\x20not\x20found:\x20','deleted','scopedFolderPath','updated','segment','6vdCoRW','name','journeyBundleName','listFolders','(Journey\x20will\x20be\x20deleted)','listActivations','getJourney','journeysOnly','toString','join','description','attributes','Changes\x20to\x20journey:','\x20\x20Source:\x20','/e/','\x20deleted','\x20unchanged','paused','Error\x20parsing\x20YAML:\x20','nameToId','toUpdate','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','idToName','red','setPhase','isNew','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)','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','/j/da/je','segments','targetDir','execute','list','toDelete','Resolving\x20parent\x20segment\x20\x27','\x20activations]','1976WoCeSi','Preparing\x20journeys...','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','310041StzUaD','\x20YAML\x20files\x20found','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Fetching\x20existing\x20activations...','680296eNzgSd','user','1331635IUAUFV','\x20to\x20delete','\x20\x20Activations:','\x20updated','dryRun','New\x20journey:','isScoped','Push\x20','verbose','\x0aError:','cyan','journey'];a41_0x4d9d=function(){return _0xd26161;};return a41_0x4d9d();}import a41_0x6bfc0 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{['name']='segment:push';[a41_0x1d1430(0x1e4)]=a41_0x1d1430(0x22b);async[a41_0x1d1430(0x1f9)](_0x6f48ae){const _0x4c5a08=a41_0x1d1430,{options:_0x298e42,args:_0x52d6c2,tdx:_0x14e949}=_0x6f48ae,_0xadf5a7=_0x298e42,_0x279ea9=await resolveTarget({'arg':_0x52d6c2[0x0],'contextParent':_0x298e42[_0x4c5a08(0x221)],'cwd':process[_0x4c5a08(0x264)]()});if(!isSuccessfulResolution(_0x279ea9))return _0x279ea9[_0x4c5a08(0x25b)]===_0x4c5a08(0x222)?(console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x25f)](_0x4c5a08(0x214))),console[_0x4c5a08(0x23c)](_0x4c5a08(0x1f4)),console[_0x4c5a08(0x23c)](_0x4c5a08(0x250)),console[_0x4c5a08(0x23c)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x1f1)](_0x4c5a08(0x21d)+_0x279ea9[_0x4c5a08(0x234)]+'\x0a')),_0x279ea9[_0x4c5a08(0x241)]&&console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x211)](_0x279ea9['helpText']))),0x1;if(_0x279ea9[_0x4c5a08(0x248)]===_0x4c5a08(0x276))return console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x1f1)]('Error:\x20Directory\x20not\x20found:\x20'+_0x279ea9[_0x4c5a08(0x1f8)]+'\x0a')),console[_0x4c5a08(0x23c)](a41_0x6bfc0['cyan'](_0x4c5a08(0x253))),0x1;const _0x5d2d05=_0x279ea9['parentName'],_0x33eeec=_0x279ea9['targetDir'],_0x428e78=_0x279ea9[_0x4c5a08(0x248)]===_0x4c5a08(0x26f)?_0x279ea9[_0x4c5a08(0x24e)]:undefined,_0x29efb6=getScopedDetails(_0x279ea9),_0x2085cf=_0x29efb6?.[_0x4c5a08(0x20d)]??![],_0x28929b=_0x29efb6?.[_0x4c5a08(0x1d7)]??'';if(!existsSync(_0x33eeec))return console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x1f1)](_0x4c5a08(0x1d5)+_0x33eeec+'\x0a')),console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x211)](_0x4c5a08(0x253))),0x1;_0xadf5a7['verbose']&&(console['error'](_0x4c5a08(0x219)+_0xadf5a7[_0x4c5a08(0x213)]),console['error'](_0x4c5a08(0x271)+_0x5d2d05),console[_0x4c5a08(0x23c)]('Source\x20directory:\x20'+_0x33eeec),_0x2085cf&&console[_0x4c5a08(0x23c)](_0x4c5a08(0x263)+_0x28929b));const _0x2ec5c2=await withSpinner(_0x4c5a08(0x1fc)+_0x5d2d05+_0x4c5a08(0x21a),()=>_0x14e949[_0x4c5a08(0x1d9)][_0x4c5a08(0x226)](_0x5d2d05),{'verbose':_0xadf5a7[_0x4c5a08(0x20f)]}),_0x5aeb54=_0x2ec5c2[_0x4c5a08(0x26e)],{parentSegmentResult:_0x7c66d5,segmentsResult:_0x5996eb,foldersResult:_0xb8bd43,journeysWithDetailsResult:_0x481c4b,userMaps:_0x5d1507}=await withSpinner(_0x4c5a08(0x25c),async()=>{const _0x8b096=_0x4c5a08,[_0x517db8,_0x37fda1,_0x33e666,_0x56d153,_0xd4320d]=await Promise['all']([_0x14e949[_0x8b096(0x1d9)][_0x8b096(0x270)](_0x5aeb54),_0x14e949['segment'][_0x8b096(0x243)](_0x5aeb54),_0x14e949['segment'][_0x8b096(0x1dd)](_0x5aeb54),_0x14e949[_0x8b096(0x212)]['listJourneysWithDetailsFromParentSegment'](_0x5aeb54,{'includeAllVersions':!![]}),_0x14e949[_0x8b096(0x206)][_0x8b096(0x258)]()]);return{'parentSegmentResult':_0x517db8,'segmentsResult':_0x37fda1,'foldersResult':_0x33e666,'journeysWithDetailsResult':_0x56d153,'userMaps':_0xd4320d};},{'verbose':_0xadf5a7['verbose']})[_0x4c5a08(0x251)](_0x4dc9ef=>_0x4dc9ef[_0x4c5a08(0x26e)]),_0x583df5=_0x7c66d5,_0x3fbefb=extractRootFolderId(_0x583df5),_0x480610=_0x5996eb,_0x3b8a53=_0xb8bd43,{journeys:_0x3f7945,activationStepsById:_0x264ede}=_0x481c4b,_0x292a65=new Map(_0x3f7945[_0x4c5a08(0x231)](_0x4cc062=>[_0x4cc062['id'],_0x4cc062])),_0x53ab0d=_0x3f7945[_0x4c5a08(0x231)](_0xabe0ee=>({'id':_0xabe0ee['id'],'name':_0xabe0ee[_0x4c5a08(0x1e5)]['name'],'journeyBundleName':_0xabe0ee[_0x4c5a08(0x1e5)][_0x4c5a08(0x1dc)]||'','journeyBundleId':_0xabe0ee[_0x4c5a08(0x1e5)][_0x4c5a08(0x225)]||'','versionNumber':_0xabe0ee[_0x4c5a08(0x1e5)]['versionNumber'],'description':_0xabe0ee[_0x4c5a08(0x1e5)][_0x4c5a08(0x1e4)],'state':_0xabe0ee[_0x4c5a08(0x1e5)][_0x4c5a08(0x262)],'paused':_0xabe0ee[_0x4c5a08(0x1e5)][_0x4c5a08(0x1eb)],'audienceId':_0xabe0ee[_0x4c5a08(0x1e5)][_0x4c5a08(0x269)],'folderId':_0xabe0ee[_0x4c5a08(0x220)]?.[_0x4c5a08(0x256)]?.['data']?.['id'],'createdAt':_0xabe0ee[_0x4c5a08(0x1e5)]['createdAt'],'updatedAt':_0xabe0ee[_0x4c5a08(0x1e5)][_0x4c5a08(0x268)]})),{emailToId:_0x56f190,idToEmail:_0x414c9b}=_0x5d1507,_0x2e9fe9=await withSpinner(_0x4c5a08(0x23b),async()=>{const _0x1e80f6=_0x4c5a08,_0x1f5417=await _0x14e949[_0x1e80f6(0x261)][_0x1e80f6(0x1fa)]();return buildConnectionMaps(_0x1f5417);},{'verbose':_0xadf5a7[_0x4c5a08(0x20f)]})[_0x4c5a08(0x251)](_0x5240fc=>_0x5240fc['data']),_0x338e40=_0x2e9fe9[_0x4c5a08(0x1ed)],_0x5079ff=_0x2e9fe9[_0x4c5a08(0x1f0)],_0x5d2240=_0x2e9fe9[_0x4c5a08(0x238)],_0x15b665={'emailToIdMap':_0x56f190,'connectionNameToIdMap':_0x338e40,'connectionNameToTypeMap':_0x5d2240,'getSchema':_0x21594f=>_0x14e949[_0x4c5a08(0x261)]['getOutputSchemaWithCache'](_0x21594f)};let {pathToId:_0x20ec49,idToPath:_0x440a85}=buildFolderMaps(_0x3b8a53);const _0x232439=buildSegmentLookupMap(_0x480610,_0x440a85),_0x10ccc0=buildSegmentNameToIdMap(_0x480610),_0x365a7f=buildJourneyBundleLookupMap(_0x53ab0d,_0x440a85);let _0x2e63fd;if(_0x428e78){if(!_0x428e78[_0x4c5a08(0x274)](_0x4c5a08(0x244))&&!_0x428e78['endsWith'](_0x4c5a08(0x22f)))return console[_0x4c5a08(0x23c)](a41_0x6bfc0['red'](_0x4c5a08(0x259)+_0x428e78+'\x0a')),0x1;_0x2e63fd=[_0x428e78];}else _0x2e63fd=findYamlFiles(_0x33eeec);if(_0x2e63fd[_0x4c5a08(0x25e)]===0x0)return console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x1f1)](_0x4c5a08(0x236)+_0x33eeec+'\x0a')),console[_0x4c5a08(0x23c)](a41_0x6bfc0['cyan'](_0x4c5a08(0x24a))),0x1;let _0x3f58c2,_0x32ff40;try{const _0x223684=parseAndClassifyYamlFiles(_0x2e63fd,_0x33eeec,{'skipSegments':_0xadf5a7[_0x4c5a08(0x1e1)]});_0x3f58c2=_0x223684['segments'],_0x32ff40=_0x223684[_0x4c5a08(0x215)];const _0x2fbcb8=validateParsedFiles(_0x223684,_0x33eeec);if(_0x2fbcb8[_0x4c5a08(0x25e)]>0x0)return console['error'](a41_0x6bfc0[_0x4c5a08(0x1f1)](_0x4c5a08(0x277))),console[_0x4c5a08(0x23c)](formatValidationErrors(_0x2fbcb8)),console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x25f)](_0x4c5a08(0x203))),0x1;}catch(_0x5f07fd){return console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x1f1)](_0x4c5a08(0x1ec)+(_0x5f07fd instanceof Error?_0x5f07fd[_0x4c5a08(0x234)]:_0x5f07fd))),0x1;}if(_0x3f58c2[_0x4c5a08(0x25e)]===0x0&&_0x32ff40['length']===0x0){const _0x50e519=_0xadf5a7[_0x4c5a08(0x1e1)]?_0x4c5a08(0x212):_0x4c5a08(0x22e);return console[_0x4c5a08(0x23c)](a41_0x6bfc0['yellow']('No\x20'+_0x50e519+_0x4c5a08(0x202))),0x0;}const _0x5db99f=new Map();_0x480610[_0x4c5a08(0x25e)]>0x0&&!_0xadf5a7['journeysOnly']&&await withSpinner(_0x4c5a08(0x204),async()=>{await batchAsync(_0x480610,async _0x3abb9d=>{const _0x26d34d=a41_0x3591,_0x442f3c=await _0x14e949[_0x26d34d(0x1d9)][_0x26d34d(0x1df)](_0x5aeb54,_0x3abb9d['id']);_0x5db99f['set'](_0x3abb9d['id'],_0x442f3c);});},{'verbose':_0xadf5a7['verbose']});const {segmentFiles:_0x59afbf,foldersToCreate:_0x15a4e8}=await prepareSegmentFiles(_0x3f58c2,{'segmentByFolderAndName':_0x232439,'activationsBySegmentId':_0x5db99f,'folderPathToId':_0x20ec49,'idToEmailMap':_0x414c9b,'connectionIdToNameMap':_0x5079ff},_0x15b665,_0x2085cf,_0x28929b),_0x5f4f75=_0x428e78?[]:findSegmentsToDelete(_0x480610,_0x3f58c2[_0x4c5a08(0x231)](({yamlConfig:_0x1bc06c,folderPath:_0x46f758})=>({'yamlConfig':_0x1bc06c,'folderPath':resolveTDFolderPath(_0x46f758,_0x2085cf,_0x28929b)})),_0x440a85,_0x28929b,_0x2085cf),{journeyFiles:_0x209ef8,foldersToCreate:_0x4ae9a6}=await withProgressSpinner(_0x4c5a08(0x1ff),async _0x3ace3c=>prepareJourneyFiles(_0x32ff40,{'fetchJourney':async _0x1c6f05=>_0x14e949[_0x4c5a08(0x212)][_0x4c5a08(0x1e0)](_0x1c6f05[_0x4c5a08(0x227)]),'journeyBundlesByFolderAndName':_0x365a7f,'folderPathToId':_0x20ec49,'idToEmailMap':_0x414c9b,'connectionIdToNameMap':_0x5079ff,'existingSegments':_0x480610,'parentId':_0x5aeb54,'deps':_0x14e949,'progress':{'update':_0x5bdedf=>{const _0x32824e=_0x4c5a08;_0x3ace3c[_0x32824e(0x1f2)](_0x5bdedf),_0xadf5a7[_0x32824e(0x20f)]&&console[_0x32824e(0x23c)]('\x20\x20'+_0x5bdedf);}},'journeyById':_0x292a65,'activationStepsById':_0x264ede},_0x2085cf,_0x28929b),{'verbose':_0xadf5a7[_0x4c5a08(0x20f)]})[_0x4c5a08(0x251)](_0xd85414=>_0xd85414[_0x4c5a08(0x26e)]);for(const _0x5a9f95 of _0x4ae9a6){_0x15a4e8[_0x4c5a08(0x23e)](_0x5a9f95);}const _0x3a2a48=_0x428e78?[]:findJourneysToDelete(_0x53ab0d,_0x32ff40[_0x4c5a08(0x231)](({yamlConfig:_0x17ae4a,folderPath:_0x476a0b})=>({'yamlConfig':_0x17ae4a,'folderPath':resolveTDFolderPath(_0x476a0b,_0x2085cf,_0x28929b)})),_0x440a85,_0x28929b,_0x2085cf),_0x47186d=calculatePushStats(_0x59afbf,_0x209ef8,_0x15a4e8,_0x5f4f75,_0x3a2a48,!!_0xadf5a7['delete'],!!_0xadf5a7['journeysOnly']),_0x1fcbfa=_0x47186d[_0x4c5a08(0x1f7)][_0x4c5a08(0x21b)],_0x1db8f3=_0x47186d[_0x4c5a08(0x1f7)][_0x4c5a08(0x229)],_0x3c1feb=_0x47186d[_0x4c5a08(0x1f7)]['unchanged'],_0x24b745=_0x47186d['segments'][_0x4c5a08(0x1fb)],_0x40517b=_0x47186d[_0x4c5a08(0x272)][_0x4c5a08(0x273)],_0x45ed9e=_0x47186d['journeys'][_0x4c5a08(0x21b)],_0x1684f8=_0x47186d['journeys'][_0x4c5a08(0x229)],_0x358467=_0x47186d[_0x4c5a08(0x215)]['unchanged'],_0x178e2a=_0x47186d['journeys'][_0x4c5a08(0x1fb)],_0x2c1139=_0x47186d[_0x4c5a08(0x242)][_0x4c5a08(0x252)],_0x2b5399=_0x47186d[_0x4c5a08(0x242)]['toCreate'],_0x1b1b6d=_0x47186d[_0x4c5a08(0x242)][_0x4c5a08(0x1ee)],_0x5dbd7a=_0x47186d[_0x4c5a08(0x242)][_0x4c5a08(0x1fb)];console['error'](_0x4c5a08(0x228)+_0x5d2d05+'\x27:');_0x40517b[_0x4c5a08(0x25e)]>0x0&&console[_0x4c5a08(0x23c)]('\x20\x20'+a41_0x6bfc0[_0x4c5a08(0x247)]('📁\x20'+_0x40517b['length']+_0x4c5a08(0x21f)));if(!_0xadf5a7[_0x4c5a08(0x1e1)]){console[_0x4c5a08(0x23c)](_0x4c5a08(0x218)),console[_0x4c5a08(0x23c)](_0x4c5a08(0x245)+a41_0x6bfc0[_0x4c5a08(0x246)]('+\x20'+_0x1fcbfa[_0x4c5a08(0x25e)]+_0x4c5a08(0x24c))),console[_0x4c5a08(0x23c)](_0x4c5a08(0x245)+a41_0x6bfc0[_0x4c5a08(0x25f)]('~\x20'+_0x1db8f3[_0x4c5a08(0x25e)]+'\x20changed'));if(_0x24b745['length']>0x0)console[_0x4c5a08(0x23c)](_0x4c5a08(0x245)+a41_0x6bfc0['red']('-\x20'+_0x24b745[_0x4c5a08(0x25e)]+'\x20to\x20delete'));else _0x5f4f75['length']>0x0&&!_0xadf5a7['delete']&&console[_0x4c5a08(0x23c)](_0x4c5a08(0x245)+a41_0x6bfc0['dim'](_0x5f4f75[_0x4c5a08(0x25e)]+_0x4c5a08(0x1ef)));console['error'](_0x4c5a08(0x245)+a41_0x6bfc0[_0x4c5a08(0x237)]('=\x20'+_0x3c1feb[_0x4c5a08(0x25e)]+_0x4c5a08(0x1ea)));}if(_0x209ef8[_0x4c5a08(0x25e)]>0x0||_0x3a2a48[_0x4c5a08(0x25e)]>0x0){console[_0x4c5a08(0x23c)](_0x4c5a08(0x26d)),console[_0x4c5a08(0x23c)](_0x4c5a08(0x245)+a41_0x6bfc0['green']('+\x20'+_0x45ed9e[_0x4c5a08(0x25e)]+'\x20new')),console['error'](_0x4c5a08(0x245)+a41_0x6bfc0[_0x4c5a08(0x25f)]('~\x20'+_0x1684f8['length']+_0x4c5a08(0x21e)));if(_0x178e2a[_0x4c5a08(0x25e)]>0x0)console['error']('\x20\x20\x20\x20'+a41_0x6bfc0['red']('-\x20'+_0x178e2a[_0x4c5a08(0x25e)]+'\x20to\x20delete'));else _0x3a2a48['length']>0x0&&!_0xadf5a7['delete']&&console[_0x4c5a08(0x23c)](_0x4c5a08(0x245)+a41_0x6bfc0['dim'](_0x3a2a48[_0x4c5a08(0x25e)]+_0x4c5a08(0x1ef)));console[_0x4c5a08(0x23c)](_0x4c5a08(0x245)+a41_0x6bfc0[_0x4c5a08(0x237)]('=\x20'+_0x358467[_0x4c5a08(0x25e)]+'\x20unchanged'));}_0x2c1139[_0x4c5a08(0x25e)]>0x0&&!_0xadf5a7[_0x4c5a08(0x1e1)]&&(console['error'](''),console[_0x4c5a08(0x23c)](_0x4c5a08(0x209)),_0x2b5399[_0x4c5a08(0x25e)]>0x0&&console[_0x4c5a08(0x23c)]('\x20\x20\x20\x20'+a41_0x6bfc0['green']('+\x20'+_0x2b5399[_0x4c5a08(0x25e)]+_0x4c5a08(0x22d))),_0x1b1b6d[_0x4c5a08(0x25e)]>0x0&&console[_0x4c5a08(0x23c)](_0x4c5a08(0x245)+a41_0x6bfc0[_0x4c5a08(0x25f)]('~\x20'+_0x1b1b6d[_0x4c5a08(0x25e)]+'\x20to\x20update')),_0x5dbd7a[_0x4c5a08(0x25e)]>0x0&&console[_0x4c5a08(0x23c)](_0x4c5a08(0x245)+a41_0x6bfc0[_0x4c5a08(0x1f1)]('-\x20'+_0x5dbd7a['length']+_0x4c5a08(0x208))));console['error'](_0x4c5a08(0x1e7)+a41_0x6bfc0[_0x4c5a08(0x211)](_0x33eeec)+'\x0a');if(_0x40517b[_0x4c5a08(0x25e)]>0x0){console[_0x4c5a08(0x23c)]('Folders\x20to\x20create:');for(const _0x535351 of _0x40517b){console['error']('\x20\x20'+a41_0x6bfc0[_0x4c5a08(0x247)]('+')+'\x20'+_0x535351);}console[_0x4c5a08(0x23c)]('');}if(_0x1fcbfa['length']>0x0&&!_0xadf5a7[_0x4c5a08(0x1e1)])for(const _0x35ecf8 of _0x1fcbfa){const _0x323e26=_0x35ecf8[_0x4c5a08(0x265)]?_0x35ecf8[_0x4c5a08(0x265)]+'/'+_0x35ecf8[_0x4c5a08(0x25a)][_0x4c5a08(0x1db)]:_0x35ecf8[_0x4c5a08(0x25a)][_0x4c5a08(0x1db)],_0x531ad6=_0x35ecf8[_0x4c5a08(0x25a)][_0x4c5a08(0x242)]?.[_0x4c5a08(0x25e)]||0x0,_0x3185ad=_0x531ad6>0x0?a41_0x6bfc0[_0x4c5a08(0x237)]('\x20['+_0x531ad6+'\x20activations]'):'';console['error']('\x0a'+a41_0x6bfc0['green'](_0x4c5a08(0x232))+'\x20'+_0x323e26+_0x3185ad),console['error']('─'['repeat'](0x3c)),_0x35ecf8['diff']&&console[_0x4c5a08(0x23c)](_0x35ecf8[_0x4c5a08(0x26b)]),console[_0x4c5a08(0x23c)]('─'['repeat'](0x3c));}if(_0x24b745[_0x4c5a08(0x25e)]>0x0&&!_0xadf5a7[_0x4c5a08(0x1e1)])for(const _0x39c5ae of _0x24b745){const _0x19a2f4=_0x39c5ae['segmentFolderId']?_0x440a85[_0x4c5a08(0x266)](_0x39c5ae[_0x4c5a08(0x224)][_0x4c5a08(0x1e2)]())||'':'',_0x1f6b1b=_0x19a2f4?_0x19a2f4+'/'+_0x39c5ae['name']:_0x39c5ae[_0x4c5a08(0x1db)],_0x5859d6=_0x5db99f[_0x4c5a08(0x266)](_0x39c5ae['id'])||[],_0x4e9c8d=_0x5859d6[_0x4c5a08(0x25e)]>0x0?a41_0x6bfc0[_0x4c5a08(0x237)]('\x20['+_0x5859d6['length']+_0x4c5a08(0x1fd)):'';console[_0x4c5a08(0x23c)]('\x0a'+a41_0x6bfc0[_0x4c5a08(0x1f1)]('Delete\x20segment:')+'\x20'+_0x1f6b1b+_0x4e9c8d),console[_0x4c5a08(0x23c)]('─'[_0x4c5a08(0x260)](0x3c));const _0x5acbf0=segmentWithActivationsToYaml(_0x39c5ae,_0x5859d6,undefined,_0x414c9b,_0x5079ff),_0x264df7=segmentToYamlString(_0x5acbf0),_0x1436ee=generateDiff(_0x264df7,'');console[_0x4c5a08(0x23c)](formatDiffWithColors(_0x1436ee)),console[_0x4c5a08(0x23c)]('─'[_0x4c5a08(0x260)](0x3c));}const _0x708ca0=_0x59afbf[_0x4c5a08(0x239)](_0x1c7d54=>!_0x1c7d54[_0x4c5a08(0x1f3)]&&_0x1c7d54[_0x4c5a08(0x26b)]);if(_0x708ca0[_0x4c5a08(0x25e)]>0x0&&!_0xadf5a7[_0x4c5a08(0x1e1)])for(const _0xb31429 of _0x708ca0){const _0x41c855=_0xb31429['folderPath']?_0xb31429[_0x4c5a08(0x265)]+'/'+_0xb31429[_0x4c5a08(0x25a)][_0x4c5a08(0x1db)]:_0xb31429[_0x4c5a08(0x25a)][_0x4c5a08(0x1db)];console[_0x4c5a08(0x23c)]('\x0a'+a41_0x6bfc0[_0x4c5a08(0x25f)](_0x4c5a08(0x240))+'\x20'+_0x41c855),console['error']('─'[_0x4c5a08(0x260)](0x3c)),console['error'](_0xb31429[_0x4c5a08(0x26b)]),console[_0x4c5a08(0x23c)]('─'['repeat'](0x3c));}if(_0x45ed9e[_0x4c5a08(0x25e)]>0x0)for(const _0x3d1c6b of _0x45ed9e){const _0x26baa2=_0x3d1c6b[_0x4c5a08(0x265)]?_0x3d1c6b[_0x4c5a08(0x265)]+'/'+_0x3d1c6b['yamlConfig'][_0x4c5a08(0x1db)]:_0x3d1c6b[_0x4c5a08(0x25a)][_0x4c5a08(0x1db)];console[_0x4c5a08(0x23c)]('\x0a'+a41_0x6bfc0[_0x4c5a08(0x246)](_0x4c5a08(0x20c))+'\x20'+_0x26baa2),console[_0x4c5a08(0x23c)]('─'[_0x4c5a08(0x260)](0x3c)),_0x3d1c6b[_0x4c5a08(0x26b)]&&console['error'](_0x3d1c6b['diff']),console[_0x4c5a08(0x23c)]('─'[_0x4c5a08(0x260)](0x3c));}const _0x2e4ab=_0x209ef8[_0x4c5a08(0x239)](_0x1aaec8=>!_0x1aaec8[_0x4c5a08(0x1f3)]&&_0x1aaec8[_0x4c5a08(0x26b)]);if(_0x2e4ab[_0x4c5a08(0x25e)]>0x0)for(const _0xd38b54 of _0x2e4ab){const _0x1d6e98=_0xd38b54[_0x4c5a08(0x265)]?_0xd38b54[_0x4c5a08(0x265)]+'/'+_0xd38b54['yamlConfig'][_0x4c5a08(0x1db)]:_0xd38b54[_0x4c5a08(0x25a)][_0x4c5a08(0x1db)];console[_0x4c5a08(0x23c)]('\x0a'+a41_0x6bfc0[_0x4c5a08(0x25f)](_0x4c5a08(0x1e6))+'\x20'+_0x1d6e98),console[_0x4c5a08(0x23c)]('─'[_0x4c5a08(0x260)](0x3c)),console[_0x4c5a08(0x23c)](_0xd38b54[_0x4c5a08(0x26b)]),console[_0x4c5a08(0x23c)]('─'['repeat'](0x3c));}if(_0x178e2a[_0x4c5a08(0x25e)]>0x0)for(const _0x2906bd of _0x178e2a){const _0x123bfe=_0x2906bd[_0x4c5a08(0x24b)]?_0x440a85[_0x4c5a08(0x266)](_0x2906bd['folderId'])||'':'',_0x1083d2=_0x123bfe?_0x123bfe+'/'+_0x2906bd[_0x4c5a08(0x1dc)]:_0x2906bd['journeyBundleName'];console[_0x4c5a08(0x23c)]('\x0a'+a41_0x6bfc0[_0x4c5a08(0x1f1)](_0x4c5a08(0x26c))+'\x20'+_0x1083d2),console['error']('─'[_0x4c5a08(0x260)](0x3c)),console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x1f1)](_0x4c5a08(0x1de))),console[_0x4c5a08(0x23c)]('─'[_0x4c5a08(0x260)](0x3c));}if(_0xadf5a7[_0x4c5a08(0x20b)])return console['error'](a41_0x6bfc0['yellow'](_0x4c5a08(0x200))),0x0;const _0x36e711=_0xadf5a7[_0x4c5a08(0x1e1)]?![]:_0x1fcbfa[_0x4c5a08(0x25e)]>0x0||_0x1db8f3[_0x4c5a08(0x25e)]>0x0||_0x24b745[_0x4c5a08(0x25e)]>0x0,_0x210037=_0x45ed9e['length']>0x0||_0x1684f8[_0x4c5a08(0x25e)]>0x0||_0x178e2a[_0x4c5a08(0x25e)]>0x0,_0x3a2b0a=_0xadf5a7[_0x4c5a08(0x1e1)]?![]:_0x2c1139['length']>0x0,_0x2d2144=_0x40517b[_0x4c5a08(0x25e)]>0x0;if(!_0x36e711&&!_0x210037&&!_0x3a2b0a&&!_0x2d2144){const _0x411161=_0xadf5a7['journeysOnly']?_0x4c5a08(0x1f5):_0x4c5a08(0x1d4);console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x246)](_0x411161));if(_0x428e78&&_0x3c1feb['length']===0x1){const _0x693c57=_0x3c1feb[0x0];if(_0x693c57['existingSegment']?.['id']){const _0x4313cb=getConsoleNextUrl(_0xadf5a7[_0x4c5a08(0x213)],_0x4c5a08(0x267)+_0x5aeb54+_0x4c5a08(0x1e8)+_0x693c57[_0x4c5a08(0x217)]['id']+'/sb/da/esr');console[_0x4c5a08(0x23c)](_0x4c5a08(0x230)+a41_0x6bfc0[_0x4c5a08(0x211)](_0x4313cb));}}if(_0x428e78&&_0x358467[_0x4c5a08(0x25e)]===0x1){const _0x388fd8=_0x358467[0x0];if(_0x388fd8[_0x4c5a08(0x235)]?.['id']){const _0x43a51b=getConsoleNextUrl(_0xadf5a7[_0x4c5a08(0x213)],_0x4c5a08(0x267)+_0x5aeb54+_0x4c5a08(0x1e8)+_0x388fd8[_0x4c5a08(0x235)]['id']+_0x4c5a08(0x1f6));console[_0x4c5a08(0x23c)]('\x20\x20'+a41_0x6bfc0[_0x4c5a08(0x211)](_0x43a51b));}}return 0x0;}const _0x2088d2=_0xadf5a7['journeysOnly']?_0x45ed9e[_0x4c5a08(0x25e)]+_0x1684f8[_0x4c5a08(0x25e)]+_0x178e2a[_0x4c5a08(0x25e)]+_0x40517b[_0x4c5a08(0x25e)]:_0x1fcbfa[_0x4c5a08(0x25e)]+_0x1db8f3[_0x4c5a08(0x25e)]+_0x24b745['length']+_0x45ed9e[_0x4c5a08(0x25e)]+_0x1684f8[_0x4c5a08(0x25e)]+_0x178e2a[_0x4c5a08(0x25e)]+_0x40517b[_0x4c5a08(0x25e)]+_0x2c1139['length'];if(!_0xadf5a7['yes']&&_0x2088d2>0x0){if(!isInteractive())return console['error'](a41_0x6bfc0[_0x4c5a08(0x1f1)](_0x4c5a08(0x210)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a41_0x6bfc0[_0x4c5a08(0x237)](_0x4c5a08(0x22c))),0x1;const _0xc5dd29=await confirmKey(_0x4c5a08(0x20e)+_0x2088d2+_0x4c5a08(0x233));if(!_0xc5dd29)return console['error'](a41_0x6bfc0[_0x4c5a08(0x25f)](_0x4c5a08(0x249))),0x1;}const _0x42a206={'withProgress':async(_0x2fe91a,_0x2070ea)=>{const _0x59840d=_0x4c5a08,_0x81db0c=await withSpinner(_0x2fe91a,_0x2070ea,{'verbose':_0xadf5a7[_0x59840d(0x20f)]});return{'data':_0x81db0c[_0x59840d(0x26e)]};},'logInfo':_0x3c2a93=>console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x247)]('✔\x20'+_0x3c2a93)),'logSuccess':_0x58971b=>console[_0x4c5a08(0x23c)](a41_0x6bfc0['green']('✔\x20'+_0x58971b)),'logWarning':_0xc6fe34=>console['error'](a41_0x6bfc0[_0x4c5a08(0x25f)]('⚠\x20'+_0xc6fe34)),'logDeleted':_0x3a2797=>console[_0x4c5a08(0x23c)](a41_0x6bfc0[_0x4c5a08(0x1f1)]('✔\x20'+_0x3a2797))},_0x192e15={'segment':_0x14e949['segment'],'journey':_0x14e949[_0x4c5a08(0x212)],'user':_0x14e949[_0x4c5a08(0x206)],'connection':_0x14e949[_0x4c5a08(0x261)]};_0x40517b[_0x4c5a08(0x25e)]>0x0&&(_0x20ec49=await executePushFolders(_0x192e15,_0x40517b,_0x20ec49,{'parentId':_0x5aeb54},_0x42a206));const _0x526b07={'rootFolderId':_0x3fbefb,'folderPathToId':_0x20ec49,'folderIdToPath':_0x440a85,'segmentNameToId':_0x10ccc0,'activationsBySegmentId':_0x5db99f,'emailToIdMap':_0x56f190,'idToEmailMap':_0x414c9b,'connectionNameToIdMap':_0x2e9fe9[_0x4c5a08(0x1ed)],'connectionIdToNameMap':_0x2e9fe9['idToName'],'connectionNameToTypeMap':_0x5d2240},_0x2b676f=await executePushSegments(_0x192e15,_0xadf5a7['journeysOnly']?[]:_0x59afbf,_0x526b07,{'parentId':_0x5aeb54},_0x42a206),_0x523e56=_0x2b676f['created'],_0x5c8ec3=_0x2b676f[_0x4c5a08(0x1d8)],_0x339bdf=_0x2b676f[_0x4c5a08(0x242)]['created'],_0x55a37a=_0x2b676f['activations'][_0x4c5a08(0x1d8)],_0x243e6f=_0x2b676f['activations'][_0x4c5a08(0x1d6)];let _0x28fa21;if(_0x428e78&&_0x59afbf[_0x4c5a08(0x25e)]===0x1){const _0x2a4f2f=_0x59afbf[0x0];_0x28fa21=_0x2a4f2f[_0x4c5a08(0x217)]?.['id']??_0x2b676f[_0x4c5a08(0x21c)][_0x4c5a08(0x266)](_0x2a4f2f[_0x4c5a08(0x25a)][_0x4c5a08(0x1db)]);}const _0x4b0643=await executePushSegmentDeletions(_0x192e15,_0xadf5a7['journeysOnly']?[]:_0x24b745,_0x42a206);let _0x1fc8fc=0x0,_0x34cd79=0x0,_0x31ff97=0x0;const _0x2f12f2=new Map(_0x10ccc0);for(const [_0x207b81,_0x3dede8]of _0x2b676f[_0x4c5a08(0x21c)]){_0x2f12f2['set'](_0x207b81,_0x3dede8);}if(_0x209ef8[_0x4c5a08(0x25e)]>0x0){const _0x45f8e4={..._0x526b07,'segmentNameToId':_0x2f12f2,'existingSegments':_0x480610,'activationContext':_0x15b665},_0x3e53e6=await executePushJourneys(_0x192e15,_0x209ef8,_0x45f8e4,{'parentId':_0x5aeb54,'rootFolderId':_0x3fbefb,'verbose':_0xadf5a7[_0x4c5a08(0x20f)]},_0x42a206);_0x1fc8fc=_0x3e53e6[_0x4c5a08(0x23d)],_0x34cd79=_0x3e53e6[_0x4c5a08(0x1d8)];if(_0x428e78&&_0x3e53e6[_0x4c5a08(0x216)][_0x4c5a08(0x25e)]===0x1){const _0x1c7978=_0x3e53e6[_0x4c5a08(0x216)][0x0];if(_0x1c7978[_0x4c5a08(0x227)]){const _0x524423=getConsoleNextUrl(_0xadf5a7[_0x4c5a08(0x213)],_0x4c5a08(0x267)+_0x5aeb54+_0x4c5a08(0x1e8)+_0x1c7978[_0x4c5a08(0x227)]+_0x4c5a08(0x1f6));console[_0x4c5a08(0x23c)]('\x20\x20'+a41_0x6bfc0['cyan'](_0x524423));}}}for(const _0x5cfb67 of _0x178e2a){console['error'](a41_0x6bfc0[_0x4c5a08(0x25f)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x5cfb67['journeyBundleName'])),_0x31ff97++;}const _0x181b1c=[];if(_0x523e56>0x0)_0x181b1c[_0x4c5a08(0x23f)](_0x523e56+_0x4c5a08(0x24f));if(_0x5c8ec3>0x0)_0x181b1c[_0x4c5a08(0x23f)](_0x5c8ec3+_0x4c5a08(0x20a));if(_0x4b0643>0x0)_0x181b1c[_0x4c5a08(0x23f)](_0x4b0643+_0x4c5a08(0x1e9));const _0x276c72=[];if(_0x1fc8fc>0x0)_0x276c72[_0x4c5a08(0x23f)](_0x1fc8fc+_0x4c5a08(0x24f));if(_0x34cd79>0x0)_0x276c72[_0x4c5a08(0x23f)](_0x34cd79+_0x4c5a08(0x20a));if(_0x31ff97>0x0)_0x276c72['push'](_0x31ff97+'\x20deleted');const _0x5b5201=[];if(_0x339bdf>0x0)_0x5b5201[_0x4c5a08(0x23f)](_0x339bdf+_0x4c5a08(0x24f));if(_0x55a37a>0x0)_0x5b5201[_0x4c5a08(0x23f)](_0x55a37a+_0x4c5a08(0x20a));if(_0x243e6f>0x0)_0x5b5201[_0x4c5a08(0x23f)](_0x243e6f+_0x4c5a08(0x1e9));console['error'](a41_0x6bfc0[_0x4c5a08(0x246)](_0x4c5a08(0x24d)));_0x181b1c[_0x4c5a08(0x25e)]>0x0&&!_0xadf5a7['journeysOnly']&&console[_0x4c5a08(0x23c)](_0x4c5a08(0x255)+_0x181b1c[_0x4c5a08(0x1e3)](',\x20'));_0x276c72['length']>0x0&&console[_0x4c5a08(0x23c)](_0x4c5a08(0x26a)+_0x276c72[_0x4c5a08(0x1e3)](',\x20'));_0x5b5201[_0x4c5a08(0x25e)]>0x0&&!_0xadf5a7['journeysOnly']&&console[_0x4c5a08(0x23c)]('\x20\x20Activations:\x20'+_0x5b5201[_0x4c5a08(0x1e3)](',\x20'));if(_0x28fa21){const _0x183216=getConsoleNextUrl(_0xadf5a7['site'],_0x4c5a08(0x267)+_0x5aeb54+'/e/'+_0x28fa21+_0x4c5a08(0x254));console[_0x4c5a08(0x23c)](_0x4c5a08(0x230)+a41_0x6bfc0[_0x4c5a08(0x211)](_0x183216));}return 0x0;}}
|
|
1
|
+
const a41_0x263525=a41_0x1be6;(function(_0xcf9baa,_0x325d3f){const _0x4c07e5=a41_0x1be6,_0x4a6bc6=_0xcf9baa();while(!![]){try{const _0x4ac89a=parseInt(_0x4c07e5(0x143))/0x1+parseInt(_0x4c07e5(0x111))/0x2+-parseInt(_0x4c07e5(0x125))/0x3+parseInt(_0x4c07e5(0x146))/0x4+-parseInt(_0x4c07e5(0x184))/0x5*(-parseInt(_0x4c07e5(0x161))/0x6)+-parseInt(_0x4c07e5(0x149))/0x7*(-parseInt(_0x4c07e5(0x127))/0x8)+-parseInt(_0x4c07e5(0xf1))/0x9;if(_0x4ac89a===_0x325d3f)break;else _0x4a6bc6['push'](_0x4a6bc6['shift']());}catch(_0x2bf69b){_0x4a6bc6['push'](_0x4a6bc6['shift']());}}}(a41_0x18f8,0x19eac));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 a41_0x18f8(){const _0x145b29=['Fetching\x20connections\x20for\x20name\x20resolution...','Site:\x20','journeysOnly','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','verbose','add','229611LBESLo','description','2224JbGFRl','join','Scoped\x20to\x20folder:\x20','new','journeyBundleId','all','filePath','name','green','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','filter','created','yamlConfig','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','parentSegment','idToName','\x20unchanged','list','resolveParentId','createdSegmentIds','toDelete','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Resolving\x20parent\x20segment\x20\x27','\x20created','/sb/da/esr','listFolders','toUpdate','\x20\x20Activations:','166295JYpTYo','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)','listActivations','475316sdYKTC','audienceId','\x0aError:','4718URNDJe','\x20\x20🗺️\x20\x20Journeys:','diff','attributes','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','segment:push','\x20changes?','map','New\x20segment:','message','scopedFolderPath','Source\x20directory:\x20','red','blue','errorCode','isNew','getParent','\x20\x20\x20\x20','endsWith','existingSegment','folders','cyan','Changes\x20to:','Delete\x20journey:','12972cRlfoD','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20Directory\x20not\x20found:\x20','data','parentFolder','length','listSegments','site','journeyBundleName','set','nameToId','updatedAt','\x0a✔\x20Push\x20complete','state','📁\x20','\x20new','versionNumber','createdAt','execute','type','repeat','activations','Folders\x20to\x20create:','user','no_parent','\x20\x20Segments:\x20','/app/ps/','/e/','journeys','results','parent_name','\x0aPush\x20summary\x20for\x20\x27','helpText','targetDir','then','430FBUAmh','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toCreate','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20changed','segmentFolderId','getJourney','existingJourney','get','\x20activations]','4731453kozgiu','push','segment','No\x20','segments','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20deleted','Parent\x20segment:\x20','Delete\x20segment:','journey','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','yellow','(Journey\x20will\x20be\x20deleted)','\x20\x20Source:\x20','folderPath','\x20folders\x20to\x20create','getOutputSchemaWithCache','setPhase','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','/j/da/je','isScoped','\x20to\x20delete','delete','dim','changed','Changes\x20to\x20journey:','Error:\x20','Fetching\x20existing\x20activations...','nameToType','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','folderId','99964gFJmzJ','\x20\x20Activations:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x20\x20Journeys:\x20','journeyId','Error\x20parsing\x20YAML:\x20','relationships','\x20updated','toString','unchanged','error','\x20to\x20create','updated','\x27...'];a41_0x18f8=function(){return _0x145b29;};return a41_0x18f8();}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x5d3ea3 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';function a41_0x1be6(_0x22176c,_0x3eacc1){_0x22176c=_0x22176c-0xec;const _0x18f8c9=a41_0x18f8();let _0x1be6d2=_0x18f8c9[_0x22176c];return _0x1be6d2;}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{[a41_0x263525(0x12e)]=a41_0x263525(0x14e);['description']=a41_0x263525(0x122);async[a41_0x263525(0x173)](_0x199588){const _0x5c3b52=a41_0x263525,{options:_0x108be5,args:_0xab8d0e,tdx:_0x5885a9}=_0x199588,_0x11fc33=_0x108be5,_0x595536=await resolveTarget({'arg':_0xab8d0e[0x0],'contextParent':_0x108be5[_0x5c3b52(0x135)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x595536))return _0x595536[_0x5c3b52(0x157)]===_0x5c3b52(0x179)?(console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0xf7))),console['error'](_0x5c3b52(0x144)),console[_0x5c3b52(0x11b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x5c3b52(0x11b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0x10c)+_0x595536[_0x5c3b52(0x152)]+'\x0a')),_0x595536[_0x5c3b52(0x181)]&&console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x595536[_0x5c3b52(0x181)]))),0x1;if(_0x595536[_0x5c3b52(0x174)]===_0x5c3b52(0x17f))return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)]('Error:\x20Directory\x20not\x20found:\x20'+_0x595536[_0x5c3b52(0x182)]+'\x0a')),console['error'](a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x5c3b52(0x13c))),0x1;const _0x18b692=_0x595536['parentName'],_0x13feeb=_0x595536['targetDir'],_0x28cdf0=_0x595536[_0x5c3b52(0x174)]==='file'?_0x595536[_0x5c3b52(0x12d)]:undefined,_0x222d3d=getScopedDetails(_0x595536),_0x471423=_0x222d3d?.[_0x5c3b52(0x106)]??![],_0x26e3d8=_0x222d3d?.[_0x5c3b52(0x153)]??'';if(!existsSync(_0x13feeb))return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0x163)+_0x13feeb+'\x0a')),console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x5c3b52(0x13c))),0x1;_0x11fc33[_0x5c3b52(0x123)]&&(console['error'](_0x5c3b52(0x120)+_0x11fc33[_0x5c3b52(0x168)]),console[_0x5c3b52(0x11b)](_0x5c3b52(0xf9)+_0x18b692),console[_0x5c3b52(0x11b)](_0x5c3b52(0x154)+_0x13feeb),_0x471423&&console[_0x5c3b52(0x11b)](_0x5c3b52(0x129)+_0x26e3d8));const _0x190aa5=await withSpinner(_0x5c3b52(0x13d)+_0x18b692+_0x5c3b52(0x11e),()=>_0x5885a9['segment'][_0x5c3b52(0x139)](_0x18b692),{'verbose':_0x11fc33[_0x5c3b52(0x123)]}),_0x1c4957=_0x190aa5[_0x5c3b52(0x164)],{parentSegmentResult:_0x2b26cb,segmentsResult:_0x4c33fc,foldersResult:_0x3869d2,journeysWithDetailsResult:_0x3f1466,userMaps:_0x552c4a}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x46098f=_0x5c3b52,[_0x5c8e77,_0x2cdcb5,_0x54cb12,_0x1bf066,_0x4b4ec8]=await Promise[_0x46098f(0x12c)]([_0x5885a9[_0x46098f(0xf3)][_0x46098f(0x159)](_0x1c4957),_0x5885a9[_0x46098f(0xf3)][_0x46098f(0x167)](_0x1c4957),_0x5885a9[_0x46098f(0xf3)][_0x46098f(0x140)](_0x1c4957),_0x5885a9[_0x46098f(0xfb)]['listJourneysWithDetailsFromParentSegment'](_0x1c4957,{'includeAllVersions':!![]}),_0x5885a9['user']['buildUserMaps']()]);return{'parentSegmentResult':_0x5c8e77,'segmentsResult':_0x2cdcb5,'foldersResult':_0x54cb12,'journeysWithDetailsResult':_0x1bf066,'userMaps':_0x4b4ec8};},{'verbose':_0x11fc33[_0x5c3b52(0x123)]})[_0x5c3b52(0x183)](_0x615413=>_0x615413['data']),_0xf96e17=_0x2b26cb,_0x4bd8f0=extractRootFolderId(_0xf96e17),_0x301d8f=_0x4c33fc,_0x1183e2=_0x3869d2,{journeys:_0x3b9214,activationStepsById:_0x45af02}=_0x3f1466,_0x392ee9=new Map(_0x3b9214[_0x5c3b52(0x150)](_0x311c31=>[_0x311c31['id'],_0x311c31])),_0x27abcc=_0x3b9214['map'](_0x3503d2=>({'id':_0x3503d2['id'],'name':_0x3503d2[_0x5c3b52(0x14c)]['name'],'journeyBundleName':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x169)]||'','journeyBundleId':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x12b)]||'','versionNumber':_0x3503d2['attributes'][_0x5c3b52(0x171)],'description':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x126)],'state':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x16e)],'paused':_0x3503d2[_0x5c3b52(0x14c)]['paused'],'audienceId':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x147)],'folderId':_0x3503d2[_0x5c3b52(0x117)]?.[_0x5c3b52(0x165)]?.[_0x5c3b52(0x164)]?.['id'],'createdAt':_0x3503d2['attributes'][_0x5c3b52(0x172)],'updatedAt':_0x3503d2[_0x5c3b52(0x14c)][_0x5c3b52(0x16c)]})),{emailToId:_0x4729f1,idToEmail:_0x154aea}=_0x552c4a,_0x36a945=await withSpinner(_0x5c3b52(0x11f),async()=>{const _0x580f5f=_0x5c3b52,_0x4699bd=await _0x5885a9['connection'][_0x580f5f(0x138)]();return buildConnectionMaps(_0x4699bd);},{'verbose':_0x11fc33[_0x5c3b52(0x123)]})['then'](_0x1ee170=>_0x1ee170[_0x5c3b52(0x164)]),_0x464936=_0x36a945[_0x5c3b52(0x16b)],_0x284116=_0x36a945['idToName'],_0x3d6f19=_0x36a945[_0x5c3b52(0x10e)],_0x1fe579={'emailToIdMap':_0x4729f1,'connectionNameToIdMap':_0x464936,'connectionNameToTypeMap':_0x3d6f19,'getSchema':_0x3e7d27=>_0x5885a9['connection'][_0x5c3b52(0x102)](_0x3e7d27)};let {pathToId:_0x291dad,idToPath:_0x1aab53}=buildFolderMaps(_0x1183e2);const _0x3ee905=buildSegmentLookupMap(_0x301d8f,_0x1aab53),_0x3bcce0=buildSegmentNameToIdMap(_0x301d8f),_0x40e4ba=buildJourneyBundleLookupMap(_0x27abcc,_0x1aab53);let _0x30b92d;if(_0x28cdf0){if(!_0x28cdf0[_0x5c3b52(0x15b)]('.yml')&&!_0x28cdf0['endsWith']('.yaml'))return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0x14d)+_0x28cdf0+'\x0a')),0x1;_0x30b92d=[_0x28cdf0];}else _0x30b92d=findYamlFiles(_0x13feeb);if(_0x30b92d[_0x5c3b52(0x166)]===0x0)return console['error'](a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0xfc)+_0x13feeb+'\x0a')),console[_0x5c3b52(0x11b)](a41_0x5d3ea3['cyan'](_0x5c3b52(0x113))),0x1;let _0x2a6bb7,_0x5c517b;try{const _0x2d165b=parseAndClassifyYamlFiles(_0x30b92d,_0x13feeb,{'skipSegments':_0x11fc33[_0x5c3b52(0x121)]});_0x2a6bb7=_0x2d165b[_0x5c3b52(0xf5)],_0x5c517b=_0x2d165b[_0x5c3b52(0x17d)];const _0xa2a83c=validateParsedFiles(_0x2d165b,_0x13feeb);if(_0xa2a83c['length']>0x0)return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)]('\x0aValidation\x20failed:')),console[_0x5c3b52(0x11b)](formatValidationErrors(_0xa2a83c)),console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0xf6))),0x1;}catch(_0x59505d){return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0x116)+(_0x59505d instanceof Error?_0x59505d[_0x5c3b52(0x152)]:_0x59505d))),0x1;}if(_0x2a6bb7['length']===0x0&&_0x5c517b[_0x5c3b52(0x166)]===0x0){const _0x3203d8=_0x11fc33['journeysOnly']?_0x5c3b52(0xfb):'segment\x20or\x20journey';return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0xf4)+_0x3203d8+'\x20YAML\x20files\x20found')),0x0;}const _0x43c393=new Map();_0x301d8f[_0x5c3b52(0x166)]>0x0&&!_0x11fc33['journeysOnly']&&await withSpinner(_0x5c3b52(0x10d),async()=>{await batchAsync(_0x301d8f,async _0x574756=>{const _0x34cc43=a41_0x1be6,_0x2695fc=await _0x5885a9[_0x34cc43(0xf3)][_0x34cc43(0x145)](_0x1c4957,_0x574756['id']);_0x43c393[_0x34cc43(0x16a)](_0x574756['id'],_0x2695fc);});},{'verbose':_0x11fc33[_0x5c3b52(0x123)]});const {segmentFiles:_0x40f4b7,foldersToCreate:_0x32f96b}=await prepareSegmentFiles(_0x2a6bb7,{'segmentByFolderAndName':_0x3ee905,'activationsBySegmentId':_0x43c393,'folderPathToId':_0x291dad,'idToEmailMap':_0x154aea,'connectionIdToNameMap':_0x284116},_0x1fe579,_0x471423,_0x26e3d8),_0x4b90a3=_0x28cdf0?[]:findSegmentsToDelete(_0x301d8f,_0x2a6bb7[_0x5c3b52(0x150)](({yamlConfig:_0x149c08,folderPath:_0x320735})=>({'yamlConfig':_0x149c08,'folderPath':resolveTDFolderPath(_0x320735,_0x471423,_0x26e3d8)})),_0x1aab53,_0x26e3d8,_0x471423),{journeyFiles:_0x1baac3,foldersToCreate:_0x334b9a}=await withProgressSpinner('Preparing\x20journeys...',async _0x39e1f7=>prepareJourneyFiles(_0x5c517b,{'fetchJourney':async _0x34f47d=>_0x5885a9['journey'][_0x5c3b52(0xed)](_0x34f47d[_0x5c3b52(0x115)]),'journeyBundlesByFolderAndName':_0x40e4ba,'folderPathToId':_0x291dad,'idToEmailMap':_0x154aea,'connectionIdToNameMap':_0x284116,'existingSegments':_0x301d8f,'parentId':_0x1c4957,'deps':_0x5885a9,'progress':{'update':_0x14ad0e=>{const _0x4d18af=_0x5c3b52;_0x39e1f7[_0x4d18af(0x103)](_0x14ad0e),_0x11fc33[_0x4d18af(0x123)]&&console[_0x4d18af(0x11b)]('\x20\x20'+_0x14ad0e);}},'journeyById':_0x392ee9,'activationStepsById':_0x45af02},_0x471423,_0x26e3d8),{'verbose':_0x11fc33[_0x5c3b52(0x123)]})[_0x5c3b52(0x183)](_0x305f45=>_0x305f45[_0x5c3b52(0x164)]);for(const _0x21df85 of _0x334b9a){_0x32f96b[_0x5c3b52(0x124)](_0x21df85);}const _0x15b934=_0x28cdf0?[]:findJourneysToDelete(_0x27abcc,_0x5c517b['map'](({yamlConfig:_0x598ba6,folderPath:_0x5b4ca1})=>({'yamlConfig':_0x598ba6,'folderPath':resolveTDFolderPath(_0x5b4ca1,_0x471423,_0x26e3d8)})),_0x1aab53,_0x26e3d8,_0x471423),_0x5a7aa0=calculatePushStats(_0x40f4b7,_0x1baac3,_0x32f96b,_0x4b90a3,_0x15b934,!!_0x11fc33[_0x5c3b52(0x108)],!!_0x11fc33['journeysOnly']),_0x22c071=_0x5a7aa0[_0x5c3b52(0xf5)][_0x5c3b52(0x12a)],_0x33dde5=_0x5a7aa0['segments'][_0x5c3b52(0x10a)],_0x1a9c3e=_0x5a7aa0[_0x5c3b52(0xf5)]['unchanged'],_0x243bda=_0x5a7aa0[_0x5c3b52(0xf5)][_0x5c3b52(0x13b)],_0x30bf32=_0x5a7aa0[_0x5c3b52(0x15d)]['toCreate'],_0x59b2cf=_0x5a7aa0[_0x5c3b52(0x17d)][_0x5c3b52(0x12a)],_0x44bd35=_0x5a7aa0[_0x5c3b52(0x17d)]['changed'],_0x52f71a=_0x5a7aa0[_0x5c3b52(0x17d)][_0x5c3b52(0x11a)],_0xd87840=_0x5a7aa0['journeys']['toDelete'],_0x50268f=_0x5a7aa0['activations'][_0x5c3b52(0x12c)],_0x58b745=_0x5a7aa0['activations'][_0x5c3b52(0x186)],_0x2ae1c0=_0x5a7aa0[_0x5c3b52(0x176)][_0x5c3b52(0x141)],_0x26ff5d=_0x5a7aa0[_0x5c3b52(0x176)][_0x5c3b52(0x13b)];console[_0x5c3b52(0x11b)](_0x5c3b52(0x180)+_0x18b692+'\x27:');_0x30bf32[_0x5c3b52(0x166)]>0x0&&console[_0x5c3b52(0x11b)]('\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0x156)](_0x5c3b52(0x16f)+_0x30bf32[_0x5c3b52(0x166)]+_0x5c3b52(0x101)));if(!_0x11fc33[_0x5c3b52(0x121)]){console[_0x5c3b52(0x11b)]('\x20\x20📊\x20Segments:'),console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x12f)]('+\x20'+_0x22c071[_0x5c3b52(0x166)]+_0x5c3b52(0x170))),console['error']('\x20\x20\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0xfd)]('~\x20'+_0x33dde5['length']+'\x20changed'));if(_0x243bda[_0x5c3b52(0x166)]>0x0)console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x155)]('-\x20'+_0x243bda[_0x5c3b52(0x166)]+_0x5c3b52(0x107)));else _0x4b90a3[_0x5c3b52(0x166)]>0x0&&!_0x11fc33[_0x5c3b52(0x108)]&&console['error'](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x109)](_0x4b90a3[_0x5c3b52(0x166)]+_0x5c3b52(0x185)));console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3['dim']('=\x20'+_0x1a9c3e[_0x5c3b52(0x166)]+_0x5c3b52(0x137)));}if(_0x1baac3[_0x5c3b52(0x166)]>0x0||_0x15b934['length']>0x0){console['error'](_0x5c3b52(0x14a)),console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x12f)]('+\x20'+_0x59b2cf[_0x5c3b52(0x166)]+_0x5c3b52(0x170))),console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0xfd)]('~\x20'+_0x44bd35[_0x5c3b52(0x166)]+_0x5c3b52(0x188)));if(_0xd87840[_0x5c3b52(0x166)]>0x0)console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3['red']('-\x20'+_0xd87840['length']+_0x5c3b52(0x107)));else _0x15b934[_0x5c3b52(0x166)]>0x0&&!_0x11fc33[_0x5c3b52(0x108)]&&console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x109)](_0x15b934[_0x5c3b52(0x166)]+_0x5c3b52(0x185)));console[_0x5c3b52(0x11b)]('\x20\x20\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0x109)]('=\x20'+_0x52f71a['length']+'\x20unchanged'));}_0x50268f[_0x5c3b52(0x166)]>0x0&&!_0x11fc33['journeysOnly']&&(console[_0x5c3b52(0x11b)](''),console[_0x5c3b52(0x11b)](_0x5c3b52(0x142)),_0x58b745[_0x5c3b52(0x166)]>0x0&&console['error'](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x12f)]('+\x20'+_0x58b745[_0x5c3b52(0x166)]+_0x5c3b52(0x11c))),_0x2ae1c0[_0x5c3b52(0x166)]>0x0&&console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3['yellow']('~\x20'+_0x2ae1c0[_0x5c3b52(0x166)]+'\x20to\x20update')),_0x26ff5d[_0x5c3b52(0x166)]>0x0&&console[_0x5c3b52(0x11b)](_0x5c3b52(0x15a)+a41_0x5d3ea3[_0x5c3b52(0x155)]('-\x20'+_0x26ff5d[_0x5c3b52(0x166)]+_0x5c3b52(0x107))));console[_0x5c3b52(0x11b)](_0x5c3b52(0xff)+a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x13feeb)+'\x0a');if(_0x30bf32[_0x5c3b52(0x166)]>0x0){console['error'](_0x5c3b52(0x177));for(const _0x71a539 of _0x30bf32){console[_0x5c3b52(0x11b)]('\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0x156)]('+')+'\x20'+_0x71a539);}console[_0x5c3b52(0x11b)]('');}if(_0x22c071[_0x5c3b52(0x166)]>0x0&&!_0x11fc33['journeysOnly'])for(const _0x1b5b3e of _0x22c071){const _0x3bff8e=_0x1b5b3e[_0x5c3b52(0x100)]?_0x1b5b3e[_0x5c3b52(0x100)]+'/'+_0x1b5b3e[_0x5c3b52(0x133)][_0x5c3b52(0x12e)]:_0x1b5b3e[_0x5c3b52(0x133)][_0x5c3b52(0x12e)],_0x230be0=_0x1b5b3e[_0x5c3b52(0x133)][_0x5c3b52(0x176)]?.[_0x5c3b52(0x166)]||0x0,_0x1a1ae5=_0x230be0>0x0?a41_0x5d3ea3[_0x5c3b52(0x109)]('\x20['+_0x230be0+'\x20activations]'):'';console[_0x5c3b52(0x11b)]('\x0a'+a41_0x5d3ea3[_0x5c3b52(0x12f)](_0x5c3b52(0x151))+'\x20'+_0x3bff8e+_0x1a1ae5),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c)),_0x1b5b3e[_0x5c3b52(0x14b)]&&console[_0x5c3b52(0x11b)](_0x1b5b3e[_0x5c3b52(0x14b)]),console[_0x5c3b52(0x11b)]('─'['repeat'](0x3c));}if(_0x243bda[_0x5c3b52(0x166)]>0x0&&!_0x11fc33[_0x5c3b52(0x121)])for(const _0x2ae467 of _0x243bda){const _0x54e759=_0x2ae467[_0x5c3b52(0xec)]?_0x1aab53['get'](_0x2ae467[_0x5c3b52(0xec)][_0x5c3b52(0x119)]())||'':'',_0x693c7=_0x54e759?_0x54e759+'/'+_0x2ae467[_0x5c3b52(0x12e)]:_0x2ae467[_0x5c3b52(0x12e)],_0x389005=_0x43c393[_0x5c3b52(0xef)](_0x2ae467['id'])||[],_0x5ef8be=_0x389005[_0x5c3b52(0x166)]>0x0?a41_0x5d3ea3[_0x5c3b52(0x109)]('\x20['+_0x389005['length']+_0x5c3b52(0xf0)):'';console[_0x5c3b52(0x11b)]('\x0a'+a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0xfa))+'\x20'+_0x693c7+_0x5ef8be),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c));const _0x242614=segmentWithActivationsToYaml(_0x2ae467,_0x389005,undefined,_0x154aea,_0x284116),_0x475fd7=segmentToYamlString(_0x242614),_0x37071d=generateDiff(_0x475fd7,'');console[_0x5c3b52(0x11b)](formatDiffWithColors(_0x37071d)),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c));}const _0x792b48=_0x40f4b7[_0x5c3b52(0x131)](_0x5561ee=>!_0x5561ee[_0x5c3b52(0x158)]&&_0x5561ee[_0x5c3b52(0x14b)]);if(_0x792b48[_0x5c3b52(0x166)]>0x0&&!_0x11fc33['journeysOnly'])for(const _0x2e7229 of _0x792b48){const _0x5d6cb5=_0x2e7229[_0x5c3b52(0x100)]?_0x2e7229[_0x5c3b52(0x100)]+'/'+_0x2e7229[_0x5c3b52(0x133)][_0x5c3b52(0x12e)]:_0x2e7229[_0x5c3b52(0x133)][_0x5c3b52(0x12e)];console[_0x5c3b52(0x11b)]('\x0a'+a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0x15f))+'\x20'+_0x5d6cb5),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c)),console[_0x5c3b52(0x11b)](_0x2e7229['diff']),console['error']('─'['repeat'](0x3c));}if(_0x59b2cf[_0x5c3b52(0x166)]>0x0)for(const _0x1a4d84 of _0x59b2cf){const _0x44224f=_0x1a4d84[_0x5c3b52(0x100)]?_0x1a4d84[_0x5c3b52(0x100)]+'/'+_0x1a4d84['yamlConfig']['name']:_0x1a4d84[_0x5c3b52(0x133)][_0x5c3b52(0x12e)];console[_0x5c3b52(0x11b)]('\x0a'+a41_0x5d3ea3['green']('New\x20journey:')+'\x20'+_0x44224f),console['error']('─'['repeat'](0x3c)),_0x1a4d84[_0x5c3b52(0x14b)]&&console['error'](_0x1a4d84[_0x5c3b52(0x14b)]),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c));}const _0x1e6cf5=_0x1baac3[_0x5c3b52(0x131)](_0x1ea40d=>!_0x1ea40d['isNew']&&_0x1ea40d[_0x5c3b52(0x14b)]);if(_0x1e6cf5['length']>0x0)for(const _0xc49036 of _0x1e6cf5){const _0x9f8879=_0xc49036[_0x5c3b52(0x100)]?_0xc49036[_0x5c3b52(0x100)]+'/'+_0xc49036[_0x5c3b52(0x133)]['name']:_0xc49036[_0x5c3b52(0x133)]['name'];console['error']('\x0a'+a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0x10b))+'\x20'+_0x9f8879),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c)),console[_0x5c3b52(0x11b)](_0xc49036[_0x5c3b52(0x14b)]),console['error']('─'[_0x5c3b52(0x175)](0x3c));}if(_0xd87840['length']>0x0)for(const _0x4a69d1 of _0xd87840){const _0x30963a=_0x4a69d1[_0x5c3b52(0x110)]?_0x1aab53[_0x5c3b52(0xef)](_0x4a69d1[_0x5c3b52(0x110)])||'':'',_0x439a18=_0x30963a?_0x30963a+'/'+_0x4a69d1[_0x5c3b52(0x169)]:_0x4a69d1['journeyBundleName'];console['error']('\x0a'+a41_0x5d3ea3['red'](_0x5c3b52(0x160))+'\x20'+_0x439a18),console[_0x5c3b52(0x11b)]('─'[_0x5c3b52(0x175)](0x3c)),console[_0x5c3b52(0x11b)](a41_0x5d3ea3['red'](_0x5c3b52(0xfe))),console[_0x5c3b52(0x11b)]('─'['repeat'](0x3c));}if(_0x11fc33['dryRun'])return console[_0x5c3b52(0x11b)](a41_0x5d3ea3['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x1c690c=_0x11fc33['journeysOnly']?![]:_0x22c071[_0x5c3b52(0x166)]>0x0||_0x33dde5[_0x5c3b52(0x166)]>0x0||_0x243bda[_0x5c3b52(0x166)]>0x0,_0x35fef9=_0x59b2cf[_0x5c3b52(0x166)]>0x0||_0x44bd35[_0x5c3b52(0x166)]>0x0||_0xd87840[_0x5c3b52(0x166)]>0x0,_0x581bcd=_0x11fc33['journeysOnly']?![]:_0x50268f[_0x5c3b52(0x166)]>0x0,_0x40e71d=_0x30bf32[_0x5c3b52(0x166)]>0x0;if(!_0x1c690c&&!_0x35fef9&&!_0x581bcd&&!_0x40e71d){const _0x48c4de=_0x11fc33[_0x5c3b52(0x121)]?_0x5c3b52(0x10f):_0x5c3b52(0x104);console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x12f)](_0x48c4de));if(_0x28cdf0&&_0x1a9c3e['length']===0x1){const _0x4e6872=_0x1a9c3e[0x0];if(_0x4e6872[_0x5c3b52(0x15c)]?.['id']){const _0x220a36=getConsoleNextUrl(_0x11fc33['site'],_0x5c3b52(0x17b)+_0x1c4957+_0x5c3b52(0x17c)+_0x4e6872[_0x5c3b52(0x15c)]['id']+'/sb/da/esr');console[_0x5c3b52(0x11b)](_0x5c3b52(0x187)+a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x220a36));}}if(_0x28cdf0&&_0x52f71a[_0x5c3b52(0x166)]===0x1){const _0x580ba9=_0x52f71a[0x0];if(_0x580ba9[_0x5c3b52(0xee)]?.['id']){const _0x3a5f5b=getConsoleNextUrl(_0x11fc33[_0x5c3b52(0x168)],'/app/ps/'+_0x1c4957+_0x5c3b52(0x17c)+_0x580ba9[_0x5c3b52(0xee)]['id']+_0x5c3b52(0x105));console[_0x5c3b52(0x11b)]('\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x3a5f5b));}}return 0x0;}const _0x3b9fc3=_0x11fc33[_0x5c3b52(0x121)]?_0x59b2cf[_0x5c3b52(0x166)]+_0x44bd35[_0x5c3b52(0x166)]+_0xd87840[_0x5c3b52(0x166)]+_0x30bf32[_0x5c3b52(0x166)]:_0x22c071[_0x5c3b52(0x166)]+_0x33dde5[_0x5c3b52(0x166)]+_0x243bda[_0x5c3b52(0x166)]+_0x59b2cf[_0x5c3b52(0x166)]+_0x44bd35['length']+_0xd87840[_0x5c3b52(0x166)]+_0x30bf32[_0x5c3b52(0x166)]+_0x50268f['length'];if(!_0x11fc33['yes']&&_0x3b9fc3>0x0){if(!isInteractive())return console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x155)](_0x5c3b52(0x148)),_0x5c3b52(0x130)),console[_0x5c3b52(0x11b)](a41_0x5d3ea3['dim'](_0x5c3b52(0x162))),0x1;const _0x446b44=await confirmKey('Push\x20'+_0x3b9fc3+_0x5c3b52(0x14f));if(!_0x446b44)return console[_0x5c3b52(0x11b)](a41_0x5d3ea3['yellow']('Aborted.')),0x1;}const _0x57c78f={'withProgress':async(_0x49bbc3,_0x3ee478)=>{const _0x2748da=_0x5c3b52,_0x2808a7=await withSpinner(_0x49bbc3,_0x3ee478,{'verbose':_0x11fc33[_0x2748da(0x123)]});return{'data':_0x2808a7[_0x2748da(0x164)]};},'logInfo':_0x3cfbc1=>console['error'](a41_0x5d3ea3[_0x5c3b52(0x156)]('✔\x20'+_0x3cfbc1)),'logSuccess':_0x40e68e=>console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x12f)]('✔\x20'+_0x40e68e)),'logWarning':_0x5d49c4=>console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0xfd)]('⚠\x20'+_0x5d49c4)),'logDeleted':_0x92dfdc=>console['error'](a41_0x5d3ea3[_0x5c3b52(0x155)]('✔\x20'+_0x92dfdc))},_0x29489b={'segment':_0x5885a9[_0x5c3b52(0xf3)],'journey':_0x5885a9[_0x5c3b52(0xfb)],'user':_0x5885a9[_0x5c3b52(0x178)],'connection':_0x5885a9['connection']};_0x30bf32[_0x5c3b52(0x166)]>0x0&&(_0x291dad=await executePushFolders(_0x29489b,_0x30bf32,_0x291dad,{'parentId':_0x1c4957},_0x57c78f));const _0x58694c={'rootFolderId':_0x4bd8f0,'folderPathToId':_0x291dad,'folderIdToPath':_0x1aab53,'segmentNameToId':_0x3bcce0,'activationsBySegmentId':_0x43c393,'emailToIdMap':_0x4729f1,'idToEmailMap':_0x154aea,'connectionNameToIdMap':_0x36a945[_0x5c3b52(0x16b)],'connectionIdToNameMap':_0x36a945[_0x5c3b52(0x136)],'connectionNameToTypeMap':_0x3d6f19},_0xe23928=await executePushSegments(_0x29489b,_0x11fc33[_0x5c3b52(0x121)]?[]:_0x40f4b7,_0x58694c,{'parentId':_0x1c4957},_0x57c78f),_0x3e07c3=_0xe23928[_0x5c3b52(0x132)],_0x5539f6=_0xe23928['updated'],_0x1feb17=_0xe23928[_0x5c3b52(0x176)]['created'],_0x5e98dc=_0xe23928[_0x5c3b52(0x176)][_0x5c3b52(0x11d)],_0x3508f8=_0xe23928[_0x5c3b52(0x176)]['deleted'];let _0x7b2a4f;if(_0x28cdf0&&_0x40f4b7[_0x5c3b52(0x166)]===0x1){const _0x4bc7b5=_0x40f4b7[0x0];_0x7b2a4f=_0x4bc7b5[_0x5c3b52(0x15c)]?.['id']??_0xe23928[_0x5c3b52(0x13a)][_0x5c3b52(0xef)](_0x4bc7b5[_0x5c3b52(0x133)]['name']);}const _0x110998=await executePushSegmentDeletions(_0x29489b,_0x11fc33['journeysOnly']?[]:_0x243bda,_0x57c78f);let _0xa7cc9e=0x0,_0x3a4fa4=0x0,_0x411035=0x0;const _0x1f7b94=new Map(_0x3bcce0);for(const [_0x4bcd8b,_0x4adec0]of _0xe23928[_0x5c3b52(0x13a)]){_0x1f7b94[_0x5c3b52(0x16a)](_0x4bcd8b,_0x4adec0);}if(_0x1baac3[_0x5c3b52(0x166)]>0x0){const _0x145995={..._0x58694c,'segmentNameToId':_0x1f7b94,'existingSegments':_0x301d8f,'activationContext':_0x1fe579},_0x5785bd=await executePushJourneys(_0x29489b,_0x1baac3,_0x145995,{'parentId':_0x1c4957,'rootFolderId':_0x4bd8f0,'verbose':_0x11fc33[_0x5c3b52(0x123)]},_0x57c78f);_0xa7cc9e=_0x5785bd['created'],_0x3a4fa4=_0x5785bd[_0x5c3b52(0x11d)];if(_0x28cdf0&&_0x5785bd[_0x5c3b52(0x17e)][_0x5c3b52(0x166)]===0x1){const _0x4eaec1=_0x5785bd['results'][0x0];if(_0x4eaec1[_0x5c3b52(0x115)]){const _0x866b63=getConsoleNextUrl(_0x11fc33[_0x5c3b52(0x168)],'/app/ps/'+_0x1c4957+_0x5c3b52(0x17c)+_0x4eaec1[_0x5c3b52(0x115)]+_0x5c3b52(0x105));console['error']('\x20\x20'+a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x866b63));}}}for(const _0x28a73f of _0xd87840){console['error'](a41_0x5d3ea3[_0x5c3b52(0xfd)](_0x5c3b52(0x134)+_0x28a73f[_0x5c3b52(0x169)])),_0x411035++;}const _0x4cc74b=[];if(_0x3e07c3>0x0)_0x4cc74b[_0x5c3b52(0xf2)](_0x3e07c3+_0x5c3b52(0x13e));if(_0x5539f6>0x0)_0x4cc74b[_0x5c3b52(0xf2)](_0x5539f6+_0x5c3b52(0x118));if(_0x110998>0x0)_0x4cc74b[_0x5c3b52(0xf2)](_0x110998+_0x5c3b52(0xf8));const _0xd50048=[];if(_0xa7cc9e>0x0)_0xd50048[_0x5c3b52(0xf2)](_0xa7cc9e+'\x20created');if(_0x3a4fa4>0x0)_0xd50048[_0x5c3b52(0xf2)](_0x3a4fa4+_0x5c3b52(0x118));if(_0x411035>0x0)_0xd50048[_0x5c3b52(0xf2)](_0x411035+_0x5c3b52(0xf8));const _0x41722e=[];if(_0x1feb17>0x0)_0x41722e[_0x5c3b52(0xf2)](_0x1feb17+_0x5c3b52(0x13e));if(_0x5e98dc>0x0)_0x41722e[_0x5c3b52(0xf2)](_0x5e98dc+_0x5c3b52(0x118));if(_0x3508f8>0x0)_0x41722e['push'](_0x3508f8+_0x5c3b52(0xf8));console[_0x5c3b52(0x11b)](a41_0x5d3ea3[_0x5c3b52(0x12f)](_0x5c3b52(0x16d)));_0x4cc74b['length']>0x0&&!_0x11fc33[_0x5c3b52(0x121)]&&console['error'](_0x5c3b52(0x17a)+_0x4cc74b[_0x5c3b52(0x128)](',\x20'));_0xd50048[_0x5c3b52(0x166)]>0x0&&console['error'](_0x5c3b52(0x114)+_0xd50048[_0x5c3b52(0x128)](',\x20'));_0x41722e['length']>0x0&&!_0x11fc33['journeysOnly']&&console[_0x5c3b52(0x11b)](_0x5c3b52(0x112)+_0x41722e[_0x5c3b52(0x128)](',\x20'));if(_0x7b2a4f){const _0x5a15f4=getConsoleNextUrl(_0x11fc33[_0x5c3b52(0x168)],'/app/ps/'+_0x1c4957+_0x5c3b52(0x17c)+_0x7b2a4f+_0x5c3b52(0x13f));console['error'](_0x5c3b52(0x187)+a41_0x5d3ea3[_0x5c3b52(0x15e)](_0x5a15f4));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x54f4a3=a42_0x28b2;(function(_0x2284c1,_0x2c7e68){const _0x2ed59c=a42_0x28b2,_0x252016=_0x2284c1();while(!![]){try{const _0x2d6ed7=parseInt(_0x2ed59c(0x1ea))/0x1*(parseInt(_0x2ed59c(0x1f0))/0x2)+parseInt(_0x2ed59c(0x1f1))/0x3+-parseInt(_0x2ed59c(0x1ed))/0x4+-parseInt(_0x2ed59c(0x1f7))/0x5*(parseInt(_0x2ed59c(0x1e3))/0x6)+-parseInt(_0x2ed59c(0x1c9))/0x7+parseInt(_0x2ed59c(0x1f3))/0x8*(-parseInt(_0x2ed59c(0x1de))/0x9)+-parseInt(_0x2ed59c(0x1d7))/0xa*(-parseInt(_0x2ed59c(0x1d1))/0xb);if(_0x2d6ed7===_0x2c7e68)break;else _0x252016['push'](_0x252016['shift']());}catch(_0x6772e9){_0x252016['push'](_0x252016['shift']());}}}(a42_0x31c7,0xf046a));import{BaseCommand}from'./command.js';function a42_0x28b2(_0x3c9826,_0x5342ea){_0x3c9826=_0x3c9826-0x1c6;const _0x31c7b1=a42_0x31c7();let _0x28b26b=_0x31c7b1[_0x3c9826];return _0x28b26b;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x28f56b from'chalk';function a42_0x31c7(){const _0x2cd0e6=['13315617gzzrIE','Segment\x20ID\x20missing\x20from\x20resolved\x20path','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','Segment\x20ID:\x20','type','segmentId','Examples:','\x20\x20\x20Path:\x20','99TKVfBH','Parent\x20ID:\x20','name','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolving\x20folder\x20\x27','yellow','5173400bMWiuZ','resolvePathToResource','Updating\x20segment\x20\x27','execute','Error:\x20Cannot\x20update\x20','Resolved\x20relative\x20path\x20to:\x20','resolveFolderId','9QSYVao','description','includes','\x27...','rule','1671006aivNgr','kind','folder','segment','segment:update','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','1IgXqkO','ruleFile','Resolving\x20path\x20\x27','2428860IxZScf','error','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','550166CnjbLk','4055169AtdYYt','Resolved\x20folder\x20ID:\x20','15629976PrVXMK','length','verbose','data','15cAvQyg','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','✔\x20Updated\x20segment\x20\x27'];a42_0x31c7=function(){return _0x2cd0e6;};return a42_0x31c7();}export class SegmentUpdateCommand extends BaseCommand{['name']=a42_0x54f4a3(0x1e7);[a42_0x54f4a3(0x1df)]='Update\x20existing\x20child\x20segment';async[a42_0x54f4a3(0x1da)](_0x303db8){const _0x4f9131=a42_0x54f4a3;console['error'](a42_0x28f56b['yellow'](_0x4f9131(0x1cb))),console['error'](a42_0x28f56b[_0x4f9131(0x1d6)](_0x4f9131(0x1d4)));const {options:_0x399503,args:_0xa172e5,tdx:_0x17a250}=_0x303db8,_0x2deab7=_0x399503;if(_0xa172e5[_0x4f9131(0x1f4)]===0x0)return console[_0x4f9131(0x1ee)](_0x4f9131(0x1e8)),console[_0x4f9131(0x1ee)]('Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'),console[_0x4f9131(0x1ee)](_0x4f9131(0x1cf)),console[_0x4f9131(0x1ee)](_0x4f9131(0x1e9)),console[_0x4f9131(0x1ee)](_0x4f9131(0x1c7)),0x1;const _0x550726=_0xa172e5[0x0],_0x56219e=_0x399503['segmentPath'];let _0x59e817=_0x550726;_0x56219e&&!_0x550726[_0x4f9131(0x1e0)]('/')&&(_0x59e817=_0x56219e+'/'+_0x550726,_0x2deab7[_0x4f9131(0x1f5)]&&console[_0x4f9131(0x1ee)](_0x4f9131(0x1dc)+_0x59e817));const _0x6aae3c=await withSpinner(_0x4f9131(0x1ec)+_0x59e817+_0x4f9131(0x1e1),()=>_0x17a250[_0x4f9131(0x1e6)][_0x4f9131(0x1d8)](_0x59e817),{'verbose':_0x2deab7[_0x4f9131(0x1f5)]}),_0x4a0e19=_0x6aae3c[_0x4f9131(0x1f6)];_0x2deab7[_0x4f9131(0x1f5)]&&console[_0x4f9131(0x1ee)]('Resolved\x20type:\x20'+_0x4a0e19['type']);if(_0x4a0e19[_0x4f9131(0x1cd)]!=='segment')return console[_0x4f9131(0x1ee)](_0x4f9131(0x1db)+_0x4a0e19[_0x4f9131(0x1cd)]+_0x4f9131(0x1ef)),console[_0x4f9131(0x1ee)](_0x4f9131(0x1c6)),0x1;if(!_0x4a0e19[_0x4f9131(0x1ce)])throw new SDKError(ErrorCode['INTERNAL'],_0x4f9131(0x1ca));const _0x137fca=_0x4a0e19['parentId'],_0x13b7ab=_0x4a0e19[_0x4f9131(0x1ce)];_0x2deab7[_0x4f9131(0x1f5)]&&(console[_0x4f9131(0x1ee)](_0x4f9131(0x1d2)+_0x137fca),console[_0x4f9131(0x1ee)](_0x4f9131(0x1cc)+_0x13b7ab));let _0x1bdc7f;if(_0x2deab7[_0x4f9131(0x1e5)]){const _0x27487b=_0x2deab7[_0x4f9131(0x1e5)],_0x2236a3=await withSpinner(_0x4f9131(0x1d5)+_0x27487b+_0x4f9131(0x1e1),()=>_0x17a250[_0x4f9131(0x1e6)][_0x4f9131(0x1dd)](_0x137fca,_0x27487b),{'verbose':_0x2deab7[_0x4f9131(0x1f5)]});_0x1bdc7f=parseInt(_0x2236a3['data'],0xa),_0x2deab7[_0x4f9131(0x1f5)]&&console[_0x4f9131(0x1ee)](_0x4f9131(0x1f2)+_0x1bdc7f);}const _0x57ea0f=await loadJSONFromOptions(_0x2deab7[_0x4f9131(0x1e2)],_0x2deab7[_0x4f9131(0x1eb)]),_0x35aa94={'name':_0x2deab7[_0x4f9131(0x1d3)],'description':_0x2deab7[_0x4f9131(0x1df)],'rule':_0x57ea0f,'kind':_0x2deab7[_0x4f9131(0x1e4)]!==undefined?parseInt(_0x2deab7['kind'],0xa):undefined,'segmentFolderId':_0x1bdc7f},_0x4bb205=await withSpinner(_0x4f9131(0x1d9)+_0x4a0e19['segmentName']+'\x27...',()=>_0x17a250[_0x4f9131(0x1e6)]['updateSegmentById'](_0x137fca,_0x13b7ab,_0x35aa94),{'verbose':_0x2deab7['verbose']}),_0x4a8a3f=_0x4bb205[_0x4f9131(0x1f6)];return console[_0x4f9131(0x1ee)](_0x4f9131(0x1c8)+_0x4a8a3f[_0x4f9131(0x1d3)]+'\x27'),_0x59e817!==_0x550726&&console[_0x4f9131(0x1ee)](_0x4f9131(0x1d0)+_0x59e817),await handleSDKOutput([_0x4a8a3f],_0x2deab7),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a43_0x21e73f=a43_0x28b0;(function(_0x3926f5,_0x5d5d3d){const _0x279552=a43_0x28b0,_0x3bbb34=_0x3926f5();while(!![]){try{const _0x5ebd57=parseInt(_0x279552(0x11a))/0x1+parseInt(_0x279552(0x114))/0x2+parseInt(_0x279552(0xe3))/0x3+parseInt(_0x279552(0x104))/0x4*(parseInt(_0x279552(0x11b))/0x5)+parseInt(_0x279552(0x113))/0x6*(parseInt(_0x279552(0x111))/0x7)+-parseInt(_0x279552(0x105))/0x8*(-parseInt(_0x279552(0xf6))/0x9)+-parseInt(_0x279552(0x107))/0xa;if(_0x5ebd57===_0x5d5d3d)break;else _0x3bbb34['push'](_0x3bbb34['shift']());}catch(_0x5b01a1){_0x3bbb34['push'](_0x3bbb34['shift']());}}}(a43_0x3b1d,0xb2e0c));import{existsSync,statSync}from'fs';import a43_0x3d61c9 from'chalk';import{BaseCommand}from'./command.js';function a43_0x28b0(_0x513d29,_0x930101){_0x513d29=_0x513d29-0xe3;const _0x3b1d94=a43_0x3b1d();let _0x28b0e7=_0x3b1d94[_0x513d29];return _0x28b0e7;}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a43_0x3b1d(){const _0x282f40=['703773UKBgLf','join','18XVJwPs','2645576GCMSuU','length','Resolving\x20path\x20\x27','segments','dim','resolvePathToResource','992397zPrrpo','2715310CrtNed','log','2898228sOxWrA','slice','type','split','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','folderPath','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','folderId','parent_segment','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','isDirectory','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','parentName','cyan','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','parentId','data','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','session','9800550PxVBrL','name','fullPath','Error:\x20Path\x20is\x20required\x0a','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Usage:\x20tdx\x20segment\x20use\x20<path>','Resolved\x20relative\x20path\x20to:\x20','red','green','error','Resolved\x20path\x20type:\x20','Examples:','8XKqkDd','8AQKhJx','Site:\x20','50252680iljgMp','segment','Folder\x20ID:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','✔\x20Context\x20set\x20to:\x20','execute','verbose','site','Target\x20path:\x20'];a43_0x3b1d=function(){return _0x282f40;};return a43_0x3b1d();}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x21e73f(0xf7)]='segment:use';['description']=a43_0x21e73f(0xfb);async[a43_0x21e73f(0x10d)](_0x1567a5){const _0x2dccc0=a43_0x21e73f,{options:_0x276b63,args:_0x1d3ebd,tdx:_0x4a3e77}=_0x1567a5;if(_0x1d3ebd[_0x2dccc0(0x115)]===0x0)return console['error'](a43_0x3d61c9[_0x2dccc0(0xff)](_0x2dccc0(0xf9))),console[_0x2dccc0(0x101)](_0x2dccc0(0xfd)),console[_0x2dccc0(0x101)](_0x2dccc0(0x103)),console[_0x2dccc0(0x101)](_0x2dccc0(0xe9)),console[_0x2dccc0(0x101)](_0x2dccc0(0x10b)),console[_0x2dccc0(0x101)](_0x2dccc0(0xfc)),console['error'](_0x2dccc0(0xe7)),0x1;const _0x4df313=_0x1d3ebd[0x0],_0x2ff9ec=_0x276b63[_0x2dccc0(0xf5)];try{if(_0x4df313==='/')return saveSessionContext({'segment_path':undefined},_0x2ff9ec),console[_0x2dccc0(0x11c)](a43_0x3d61c9['green'](_0x2dccc0(0x10a))),0x0;if(existsSync(_0x4df313)&&statSync(_0x4df313)[_0x2dccc0(0xed)]()){let _0x1ab9c8;try{_0x1ab9c8=findTdxConfig(_0x4df313);}catch{return console[_0x2dccc0(0x101)](a43_0x3d61c9[_0x2dccc0(0xff)](_0x2dccc0(0xf1)+_0x4df313)),console['error'](a43_0x3d61c9[_0x2dccc0(0xf0)](_0x2dccc0(0xec))),0x1;}const _0x1afc8b=_0x1ab9c8['config'][_0x2dccc0(0xeb)];return saveSessionContext({'segment_path':_0x1afc8b,'parent_segment':_0x1afc8b},_0x2ff9ec),console[_0x2dccc0(0x11c)](a43_0x3d61c9[_0x2dccc0(0x100)]('✔\x20Context\x20set\x20to:\x20'+a43_0x3d61c9[_0x2dccc0(0xf0)](_0x1afc8b))),0x0;}const _0x17d2fa=_0x276b63['segmentPath'];let _0x47e213=_0x4df313;const _0x26d36c=parsePath(_0x4df313);if(!_0x26d36c['isAbsolute']){if(!_0x17d2fa)return console[_0x2dccc0(0x101)](a43_0x3d61c9[_0x2dccc0(0xff)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x2dccc0(0x101)](a43_0x3d61c9[_0x2dccc0(0xf0)](_0x2dccc0(0xee))),0x1;if(_0x4df313==='..'){const _0xbd16bf=_0x17d2fa[_0x2dccc0(0xe6)]('/')[_0x2dccc0(0xe4)](0x0,-0x1)[_0x2dccc0(0x112)]('/');_0x47e213=_0xbd16bf||'/';}else _0x4df313==='.'?_0x47e213=_0x17d2fa:_0x47e213=_0x17d2fa+'/'+_0x4df313;_0x276b63['verbose']&&console[_0x2dccc0(0x101)](_0x2dccc0(0xfe)+_0x47e213);}if(_0x47e213==='/'||_0x47e213==='')return saveSessionContext({'segment_path':undefined},_0x2ff9ec),console[_0x2dccc0(0x11c)](a43_0x3d61c9[_0x2dccc0(0x100)](_0x2dccc0(0x10a))),0x0;_0x47e213=normalizePath(_0x47e213);const _0x341f00=parsePath(_0x47e213)[_0x2dccc0(0x117)];if(_0x341f00[_0x2dccc0(0x115)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2ff9ec),console[_0x2dccc0(0x11c)](a43_0x3d61c9[_0x2dccc0(0x100)](_0x2dccc0(0x10a))),0x0;_0x276b63[_0x2dccc0(0x10e)]&&(console['error'](_0x2dccc0(0x106)+_0x276b63[_0x2dccc0(0x10f)]),console[_0x2dccc0(0x101)](_0x2dccc0(0x110)+_0x47e213));const _0x21df59=await withSpinner(_0x2dccc0(0x116)+_0x47e213+'\x27...',()=>_0x4a3e77['segment'][_0x2dccc0(0x119)](_0x47e213),{'verbose':_0x276b63[_0x2dccc0(0x10e)]}),_0x236789=_0x21df59[_0x2dccc0(0xf3)];_0x276b63[_0x2dccc0(0x10e)]&&(console[_0x2dccc0(0x101)](_0x2dccc0(0x102)+_0x236789[_0x2dccc0(0xe5)]),console['error']('Parent\x20ID:\x20'+_0x236789[_0x2dccc0(0xf2)]),_0x236789['folderId']&&console[_0x2dccc0(0x101)](_0x2dccc0(0x109)+_0x236789[_0x2dccc0(0xea)]));if(_0x236789[_0x2dccc0(0xe5)]===_0x2dccc0(0x108))return console[_0x2dccc0(0x101)](a43_0x3d61c9[_0x2dccc0(0xff)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x2dccc0(0x101)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console[_0x2dccc0(0x101)](a43_0x3d61c9[_0x2dccc0(0xf0)]('Use:\x20tdx\x20segment\x20use\x20'+_0x236789[_0x2dccc0(0xef)]+(_0x236789[_0x2dccc0(0xe8)]?'/'+_0x236789[_0x2dccc0(0xe8)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x236789[_0x2dccc0(0xf8)],'parent_segment':_0x236789[_0x2dccc0(0xef)]},_0x2ff9ec),console[_0x2dccc0(0x11c)](a43_0x3d61c9[_0x2dccc0(0x100)](_0x2dccc0(0x10c)+a43_0x3d61c9['cyan'](_0x236789[_0x2dccc0(0xf8)]))),_0x276b63['verbose']&&(console[_0x2dccc0(0x101)](a43_0x3d61c9['dim'](_0x2dccc0(0xfa))),console['error'](a43_0x3d61c9[_0x2dccc0(0x118)](_0x2dccc0(0xf4)))),0x0;}catch(_0x4a873a){throw _0x4a873a;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x2a0751=a44_0x3beb;function a44_0x3beb(_0x27c8b7,_0x3fbd5e){_0x27c8b7=_0x27c8b7-0x9e;const _0x367e22=a44_0x367e();let _0x3beb55=_0x367e22[_0x27c8b7];return _0x3beb55;}(function(_0x4fa8c6,_0x22eb70){const _0x3ffe5f=a44_0x3beb,_0x1d731f=_0x4fa8c6();while(!![]){try{const _0x24228f=parseInt(_0x3ffe5f(0xd2))/0x1*(parseInt(_0x3ffe5f(0xae))/0x2)+-parseInt(_0x3ffe5f(0xd5))/0x3+-parseInt(_0x3ffe5f(0xb9))/0x4*(-parseInt(_0x3ffe5f(0xce))/0x5)+-parseInt(_0x3ffe5f(0xc3))/0x6+-parseInt(_0x3ffe5f(0xa8))/0x7+parseInt(_0x3ffe5f(0xc8))/0x8*(parseInt(_0x3ffe5f(0xaa))/0x9)+parseInt(_0x3ffe5f(0xd3))/0xa*(parseInt(_0x3ffe5f(0xc2))/0xb);if(_0x24228f===_0x22eb70)break;else _0x1d731f['push'](_0x1d731f['shift']());}catch(_0x308a08){_0x1d731f['push'](_0x1d731f['shift']());}}}(a44_0x367e,0xbaac7));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';function a44_0x367e(){const _0x7f3fff=['Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20valid','name','yellow','endsWith','cwd','length','1661LrwGwc','6269748ktoREy','file','warningCount','error','type','6421200zACnhV','\x20error(s)','\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','\x20warning(s)','red','✔\x20All\x20','8795nAZkEj','warnings','validCount','segment:validate','72139JToCwm','29010NNWtcE','description','915501oaZZVe','no_parent','parentSegment','helpText','green','errorCode','):\x20','valid','Error:\x20Directory\x20not\x20found:\x20','.yaml','\x20warning(s)\x20found','7403781jjfnfY','verbose','9EHsKVP','hasErrors','log','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','34EbFFpP','targetDir','Validate\x20segment\x20and\x20journey\x20YAML\x20files','invalidCount','\x20file(s)\x20with\x20errors,\x20','\x20file(s)\x20valid','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','cyan','execute','dim','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','1604lWnsfa','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file'];a44_0x367e=function(){return _0x7f3fff;};return a44_0x367e();}import a44_0x29d6ba 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{[a44_0x2a0751(0xbd)]=a44_0x2a0751(0xd1);[a44_0x2a0751(0xd4)]=a44_0x2a0751(0xb0);async[a44_0x2a0751(0xb6)](_0x34bdbe){const _0x3bb89a=a44_0x2a0751,{options:_0x44f504,args:_0x2f94ec}=_0x34bdbe,_0x5f3d7c=_0x44f504,_0xc29e4b=await resolveTarget({'arg':_0x2f94ec[0x0],'contextParent':_0x44f504[_0x3bb89a(0x9f)],'cwd':process[_0x3bb89a(0xc0)]()});if(!isSuccessfulResolution(_0xc29e4b))return _0xc29e4b[_0x3bb89a(0xa2)]===_0x3bb89a(0x9e)?(console['error'](a44_0x29d6ba[_0x3bb89a(0xbe)](_0x3bb89a(0xb8))),console[_0x3bb89a(0xc6)](_0x3bb89a(0xad)),console[_0x3bb89a(0xc6)](_0x3bb89a(0xca)),console[_0x3bb89a(0xc6)](_0x3bb89a(0xba))):(console[_0x3bb89a(0xc6)](a44_0x29d6ba[_0x3bb89a(0xcc)]('Error:\x20'+_0xc29e4b['message']+'\x0a')),_0xc29e4b[_0x3bb89a(0xa0)]&&console[_0x3bb89a(0xc6)](a44_0x29d6ba[_0x3bb89a(0xb5)](_0xc29e4b[_0x3bb89a(0xa0)]))),0x1;const _0x1be2cf=_0xc29e4b[_0x3bb89a(0xaf)],_0x492f1a=_0xc29e4b[_0x3bb89a(0xc7)]===_0x3bb89a(0xc4)?_0xc29e4b['filePath']:undefined;if(!_0x492f1a&&!existsSync(_0x1be2cf))return console[_0x3bb89a(0xc6)](a44_0x29d6ba[_0x3bb89a(0xcc)](_0x3bb89a(0xa5)+_0x1be2cf+'\x0a')),0x1;let _0x262b40;if(_0x492f1a){if(!_0x492f1a['endsWith']('.yml')&&!_0x492f1a[_0x3bb89a(0xbf)](_0x3bb89a(0xa6)))return console[_0x3bb89a(0xc6)](a44_0x29d6ba[_0x3bb89a(0xcc)](_0x3bb89a(0xbb)+_0x492f1a+'\x0a')),0x1;_0x262b40=[_0x492f1a];}else _0x262b40=findYamlFiles(_0x1be2cf);if(_0x262b40[_0x3bb89a(0xc1)]===0x0)return console[_0x3bb89a(0xc6)](a44_0x29d6ba[_0x3bb89a(0xcc)](_0x3bb89a(0xb4)+_0x1be2cf+'\x0a')),0x1;const _0x607edd=validateYamlFiles(_0x262b40,_0x1be2cf),_0x43ac59=calculateSummary(_0x607edd);for(const _0x49a823 of _0x607edd){if(!isValidationResult(_0x49a823))continue;const {relativePath:_0x31745e,source:_0x54f066,result:_0x5812cc,fileType:_0x5636cb}=_0x49a823,_0x19dad7=_0x5636cb;if(_0x5812cc[_0x3bb89a(0xa4)]&&_0x5812cc[_0x3bb89a(0xcf)][_0x3bb89a(0xc1)]===0x0)_0x5f3d7c[_0x3bb89a(0xa9)]&&console[_0x3bb89a(0xac)](a44_0x29d6ba[_0x3bb89a(0xa1)]('✔\x20'+_0x31745e)+a44_0x29d6ba['dim']('\x20('+_0x19dad7+')'));else _0x5812cc['valid']?(console[_0x3bb89a(0xac)](a44_0x29d6ba[_0x3bb89a(0xbe)]('⚠\x20'+_0x31745e)+a44_0x29d6ba[_0x3bb89a(0xb7)]('\x20('+_0x19dad7+_0x3bb89a(0xa3)+_0x5812cc[_0x3bb89a(0xcf)]['length']+_0x3bb89a(0xcb))),console[_0x3bb89a(0xac)](formatValidationResult(_0x5812cc,_0x54f066,_0x31745e))):(console[_0x3bb89a(0xac)](a44_0x29d6ba[_0x3bb89a(0xcc)]('✖\x20'+_0x31745e)+a44_0x29d6ba[_0x3bb89a(0xb7)]('\x20('+_0x19dad7+'):\x20'+_0x5812cc['errors'][_0x3bb89a(0xc1)]+_0x3bb89a(0xc9))),console[_0x3bb89a(0xac)](formatValidationResult(_0x5812cc,_0x54f066,_0x31745e)));}return console[_0x3bb89a(0xac)](''),_0x43ac59[_0x3bb89a(0xab)]?(console[_0x3bb89a(0xac)](a44_0x29d6ba['red']('Validation\x20failed:\x20'+_0x43ac59[_0x3bb89a(0xb1)]+_0x3bb89a(0xb2)+_0x43ac59[_0x3bb89a(0xd0)]+_0x3bb89a(0xbc))),_0x43ac59[_0x3bb89a(0xc5)]>0x0&&console['log'](a44_0x29d6ba[_0x3bb89a(0xbe)](_0x43ac59['warningCount']+_0x3bb89a(0xa7))),0x1):(console['log'](a44_0x29d6ba[_0x3bb89a(0xa1)](_0x3bb89a(0xcd)+_0x43ac59[_0x3bb89a(0xd0)]+_0x3bb89a(0xb3))),_0x43ac59['warningCount']>0x0&&console[_0x3bb89a(0xac)](a44_0x29d6ba[_0x3bb89a(0xbe)](_0x43ac59[_0x3bb89a(0xc5)]+'\x20warning(s)\x20found')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a45_0x44ac84=a45_0x1339;(function(_0x48683d,_0x58350e){const _0x7246e8=a45_0x1339,_0x1d5739=_0x48683d();while(!![]){try{const _0x1b0fae=-parseInt(_0x7246e8(0x1f3))/0x1*(-parseInt(_0x7246e8(0x1e6))/0x2)+-parseInt(_0x7246e8(0x1c1))/0x3+parseInt(_0x7246e8(0x1e1))/0x4+parseInt(_0x7246e8(0x1ce))/0x5+parseInt(_0x7246e8(0x1c3))/0x6*(-parseInt(_0x7246e8(0x1d2))/0x7)+parseInt(_0x7246e8(0x1d6))/0x8*(-parseInt(_0x7246e8(0x1b2))/0x9)+-parseInt(_0x7246e8(0x1b5))/0xa;if(_0x1b0fae===_0x58350e)break;else _0x1d5739['push'](_0x1d5739['shift']());}catch(_0x5b47db){_0x1d5739['push'](_0x1d5739['shift']());}}}(a45_0x5755,0x19e67));import{BaseCommand}from'./command.js';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 a45_0x1a7f56 from'chalk';function a45_0x1339(_0x18d29d,_0x5c6f52){_0x18d29d=_0x18d29d-0x1b0;const _0x57550b=a45_0x5755();let _0x133984=_0x57550b[_0x18d29d];return _0x133984;}export class SegmentsCommand extends BaseCommand{[a45_0x44ac84(0x1c6)]=a45_0x44ac84(0x1d1);[a45_0x44ac84(0x1b0)]=a45_0x44ac84(0x1dd);async[a45_0x44ac84(0x1c0)](_0x5ba7d2){const _0x1c2491=a45_0x44ac84,{options:_0xd94ea7,args:_0x5467fc}=_0x5ba7d2,_0x3bb8dd=_0xd94ea7[_0x1c2491(0x1db)],_0x2175cc=_0x5467fc[0x0];try{const _0x2e4684=_0xd94ea7[_0x1c2491(0x1b1)];_0xd94ea7[_0x1c2491(0x1b4)]&&(console[_0x1c2491(0x1e7)](_0x1c2491(0x1bb)+_0xd94ea7['site']),console[_0x1c2491(0x1e7)](_0x1c2491(0x1bd)+(_0x2e4684||_0x1c2491(0x1c9))),_0x2175cc&&console[_0x1c2491(0x1e7)](_0x1c2491(0x1b7)+_0x2175cc),_0x3bb8dd&&console[_0x1c2491(0x1e7)](_0x1c2491(0x1fc)));if(!_0x2e4684)return console['error'](_0x1c2491(0x1fb)),console[_0x1c2491(0x1e7)](''),console[_0x1c2491(0x1e7)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x1c2491(0x1e7)](_0x1c2491(0x1ec)),console[_0x1c2491(0x1e7)](_0x1c2491(0x1bc)),console[_0x1c2491(0x1e7)](''),console[_0x1c2491(0x1e7)](_0x1c2491(0x1ca)),0x1;const _0x4ea187=_0x2175cc&&(_0x2175cc[_0x1c2491(0x1f9)]('*')||_0x2175cc[_0x1c2491(0x1f9)]('?'));if(_0x4ea187)return await this[_0x1c2491(0x1d8)](_0x5ba7d2,_0x2e4684,_0x2175cc);const _0x2909ec=_0x2175cc?_0x2e4684+'/'+_0x2175cc:_0x2e4684;return _0x3bb8dd?await this[_0x1c2491(0x1d7)](_0x5ba7d2,_0x2909ec):await this[_0x1c2491(0x1b6)](_0x5ba7d2,_0x2909ec);}catch(_0x52cc81){if(_0x52cc81 instanceof SDKError)return console['error']('Error:\x20'+_0x52cc81['message']),_0x52cc81[_0x1c2491(0x1ee)]&&console[_0x1c2491(0x1e7)](_0x1c2491(0x1b3)+_0x52cc81['cause']),0x1;throw _0x52cc81;}}async['listWithPattern'](_0x170fc1,_0x1c2437,_0x40e12e){const _0x2d0c3a=a45_0x44ac84,{options:_0x2645a9,tdx:_0x2c1cf0}=_0x170fc1,_0x255d0f=await withSpinner(_0x2d0c3a(0x1e2)+_0x1c2437+_0x2d0c3a(0x1b9),()=>_0x2c1cf0[_0x2d0c3a(0x1f4)][_0x2d0c3a(0x1df)](_0x1c2437),{'verbose':_0x2645a9[_0x2d0c3a(0x1b4)]}),_0x1c56d5=_0x255d0f[_0x2d0c3a(0x1d3)],_0x4e1605=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x2c1cf0[_0x2d0c3a(0x1f4)][_0x2d0c3a(0x1dc)](_0x1c56d5[_0x2d0c3a(0x1e0)],_0x1c56d5[_0x2d0c3a(0x1d9)]),{'verbose':_0x2645a9[_0x2d0c3a(0x1b4)]}),{folders:_0x304a71,segments:_0x4fdc75,journeys:_0x2380ca}=_0x4e1605[_0x2d0c3a(0x1d3)],_0x158067=_0x40e12e[_0x2d0c3a(0x1de)](/[.+^${}()|[\]\\]/g,_0x2d0c3a(0x1d5))[_0x2d0c3a(0x1de)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x157985=new RegExp('^'+_0x158067+'$','i'),_0xb4b2a5=_0x304a71[_0x2d0c3a(0x1cf)](_0x40bde5=>_0x157985['test'](_0x40bde5[_0x2d0c3a(0x1c6)])),_0x31f4e2=_0x4fdc75[_0x2d0c3a(0x1cf)](_0x79daf8=>_0x157985[_0x2d0c3a(0x1cd)](_0x79daf8[_0x2d0c3a(0x1c6)])),_0x4e81e7=_0x2380ca[_0x2d0c3a(0x1cf)](_0x2615f1=>_0x157985[_0x2d0c3a(0x1cd)](_0x2615f1[_0x2d0c3a(0x1ef)])),_0x3c66ca=_0xb4b2a5[_0x2d0c3a(0x1e3)]+_0x31f4e2['length']+_0x4e81e7[_0x2d0c3a(0x1e3)];console[_0x2d0c3a(0x1e7)](_0x2d0c3a(0x1ea)+_0xb4b2a5[_0x2d0c3a(0x1e3)]+_0x2d0c3a(0x1e5)+(_0xb4b2a5[_0x2d0c3a(0x1e3)]!==0x1?'s':'')+',\x20'+_0x31f4e2['length']+_0x2d0c3a(0x1c2)+(_0x31f4e2['length']!==0x1?'s':'')+_0x2d0c3a(0x1c8)+_0x4e81e7[_0x2d0c3a(0x1e3)]+'\x20journey'+(_0x4e81e7['length']!==0x1?'s':'')+'\x20matching\x20\x27'+_0x40e12e+'\x27');const _0x1feac4=_0x23a526=>{const _0x50d2ea=_0x2d0c3a;return getConsoleNextUrl(_0x2645a9[_0x50d2ea(0x1f2)],_0x50d2ea(0x1cb)+_0x1c56d5[_0x50d2ea(0x1e0)]+_0x50d2ea(0x1f5)+_0x23a526);},_0x293549=_0x2645a9[_0x2d0c3a(0x1c7)]===_0x2d0c3a(0x1f6)||_0x2645a9['format']===_0x2d0c3a(0x1ed);if(_0x293549){const _0x45d7b1=[..._0xb4b2a5[_0x2d0c3a(0x1eb)](_0x29727d=>({..._0x29727d,'type':_0x2d0c3a(0x1cc)})),..._0x31f4e2[_0x2d0c3a(0x1eb)](_0x3ef088=>({..._0x3ef088,'type':'segment','url':_0x1feac4(_0x3ef088['id'])})),..._0x4e81e7[_0x2d0c3a(0x1eb)](_0x7caf1b=>({..._0x7caf1b,'name':_0x7caf1b[_0x2d0c3a(0x1ef)],'type':_0x2d0c3a(0x1bf)}))]['sort']((_0x2ea18c,_0x4eee6b)=>_0x2ea18c[_0x2d0c3a(0x1c6)][_0x2d0c3a(0x1d0)](_0x4eee6b[_0x2d0c3a(0x1c6)]));await handleSDKOutput(_0x45d7b1,_0x2645a9);}else{if(_0x3c66ca===0x0)console[_0x2d0c3a(0x1d4)](_0x2d0c3a(0x1f0)+_0x40e12e);else{console['log'](a45_0x1a7f56[_0x2d0c3a(0x1f7)]('['+_0x1c2437+_0x2d0c3a(0x1e8)+_0x40e12e+'\x27'));const _0x39077c=formatFlatList(_0xb4b2a5,_0x31f4e2,{'showMetadata':!![],'getSegmentUrl':_0x1feac4},_0x4e81e7);console[_0x2d0c3a(0x1d4)](_0x39077c);}}return 0x0;}async['listUnified'](_0x17cdd8,_0x5dd383){const _0x357f19=a45_0x44ac84,{options:_0x1c64ef,tdx:_0x5ee066}=_0x17cdd8,_0x2e2040=await withSpinner('Resolving\x20path\x20\x27'+_0x5dd383+_0x357f19(0x1b9),()=>_0x5ee066[_0x357f19(0x1f4)][_0x357f19(0x1df)](_0x5dd383),{'verbose':_0x1c64ef['verbose']}),_0x1145cf=_0x2e2040['data'];_0x1c64ef[_0x357f19(0x1b4)]&&(console['error']('Parent\x20ID:\x20'+_0x1145cf['parentId']),_0x1145cf[_0x357f19(0x1d9)]&&console[_0x357f19(0x1e7)](_0x357f19(0x1f1)+_0x1145cf['folderId']));const _0x56d9a1=await withSpinner(_0x357f19(0x1be),()=>_0x5ee066[_0x357f19(0x1f4)][_0x357f19(0x1dc)](_0x1145cf[_0x357f19(0x1e0)],_0x1145cf['folderId']),{'verbose':_0x1c64ef[_0x357f19(0x1b4)]}),{folders:_0x461655,segments:_0x1482d8,journeys:_0x4c9533}=_0x56d9a1[_0x357f19(0x1d3)],_0x5c54b7=_0x461655[_0x357f19(0x1e3)]+_0x1482d8['length']+_0x4c9533[_0x357f19(0x1e3)];console[_0x357f19(0x1e7)](_0x357f19(0x1ea)+_0x461655[_0x357f19(0x1e3)]+_0x357f19(0x1e5)+(_0x461655[_0x357f19(0x1e3)]!==0x1?'s':'')+',\x20'+_0x1482d8[_0x357f19(0x1e3)]+'\x20segment'+(_0x1482d8['length']!==0x1?'s':'')+_0x357f19(0x1c8)+_0x4c9533[_0x357f19(0x1e3)]+_0x357f19(0x1c4)+(_0x4c9533['length']!==0x1?'s':''));const _0x4e7733=_0x3c8c17=>{const _0x5f31ea=_0x357f19;return getConsoleNextUrl(_0x1c64ef[_0x5f31ea(0x1f2)],_0x5f31ea(0x1cb)+_0x1145cf['parentId']+_0x5f31ea(0x1f5)+_0x3c8c17);},_0x4987f8=_0x5df14d=>{const _0x1f21de=_0x357f19;return getConsoleNextUrl(_0x1c64ef[_0x1f21de(0x1f2)],'/app/ps/'+_0x1145cf[_0x1f21de(0x1e0)]+_0x1f21de(0x1f5)+_0x5df14d+'/j/da');},_0x255776=_0x1c64ef['format']==='json'||_0x1c64ef['format']===_0x357f19(0x1ed);if(_0x255776){const _0x24a44b=[..._0x461655['map'](_0x3026b7=>({..._0x3026b7,'type':'folder'})),..._0x1482d8[_0x357f19(0x1eb)](_0x135f1a=>({..._0x135f1a,'type':_0x357f19(0x1f4),'url':_0x4e7733(_0x135f1a['id'])})),..._0x4c9533[_0x357f19(0x1eb)](_0x10cda8=>({..._0x10cda8,'name':_0x10cda8[_0x357f19(0x1ef)],'type':_0x357f19(0x1bf),'url':_0x4987f8(_0x10cda8['id'])}))][_0x357f19(0x1e9)]((_0x3185f8,_0x51f533)=>_0x3185f8[_0x357f19(0x1c6)][_0x357f19(0x1d0)](_0x51f533['name']));await handleSDKOutput(_0x24a44b,_0x1c64ef);}else{if(_0x5c54b7===0x0)console[_0x357f19(0x1d4)](a45_0x1a7f56[_0x357f19(0x1f7)]('['+_0x5dd383+']')),console[_0x357f19(0x1d4)](_0x357f19(0x1fa));else{console[_0x357f19(0x1d4)](a45_0x1a7f56[_0x357f19(0x1f7)]('['+_0x5dd383+']'));const _0xe22438=formatFlatList(_0x461655,_0x1482d8,{'showMetadata':!![],'getSegmentUrl':_0x4e7733,'getJourneyUrl':_0x4987f8},_0x4c9533);console[_0x357f19(0x1d4)](_0xe22438);}}return 0x0;}async[a45_0x44ac84(0x1d7)](_0x2cc1af,_0x39bc9){const _0x41e427=a45_0x44ac84,{options:_0x17759a,tdx:_0x5efd5f}=_0x2cc1af,_0x2e6b2a=await withSpinner('Resolving\x20path\x20\x27'+_0x39bc9+_0x41e427(0x1b9),()=>_0x5efd5f['segment'][_0x41e427(0x1df)](_0x39bc9),{'verbose':_0x17759a['verbose']}),_0x13690e=_0x2e6b2a[_0x41e427(0x1d3)];_0x17759a[_0x41e427(0x1b4)]&&(console[_0x41e427(0x1e7)]('Parent\x20ID:\x20'+_0x13690e[_0x41e427(0x1e0)]),_0x13690e[_0x41e427(0x1d9)]&&console[_0x41e427(0x1e7)](_0x41e427(0x1f1)+_0x13690e[_0x41e427(0x1d9)]));const _0x21c4f4=_0x17759a[_0x41e427(0x1da)]||0xa,_0x67218=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x5efd5f[_0x41e427(0x1f4)][_0x41e427(0x1d7)](_0x13690e[_0x41e427(0x1e0)],_0x13690e[_0x41e427(0x1d9)],0x0,_0x21c4f4),{'verbose':_0x17759a[_0x41e427(0x1b4)]}),_0x5a8576=_0x67218[_0x41e427(0x1d3)],_0x298c16=_0x4b7b2f=>{const _0x144e7b=_0x41e427;let _0x450c6b=0x0,_0x93d88e=0x0,_0x1f52a6=0x0;for(const _0x2e9586 of _0x4b7b2f){if(_0x2e9586[_0x144e7b(0x1ba)]===_0x144e7b(0x1cc))_0x450c6b++;else{if(_0x2e9586[_0x144e7b(0x1ba)]===_0x144e7b(0x1f4))_0x93d88e++;else{if(_0x2e9586['type']===_0x144e7b(0x1bf))_0x1f52a6++;}}if(_0x2e9586[_0x144e7b(0x1c5)]){const _0x75948b=_0x298c16(_0x2e9586['children']);_0x450c6b+=_0x75948b[_0x144e7b(0x1b8)],_0x93d88e+=_0x75948b['segments'],_0x1f52a6+=_0x75948b[_0x144e7b(0x1f8)];}}return{'folders':_0x450c6b,'segments':_0x93d88e,'journeys':_0x1f52a6};},_0x1c45a1=_0x298c16(_0x5a8576);console['error'](_0x41e427(0x1e4)+_0x1c45a1[_0x41e427(0x1b8)]+_0x41e427(0x1e5)+(_0x1c45a1[_0x41e427(0x1b8)]!==0x1?'s':'')+',\x20'+_0x1c45a1[_0x41e427(0x1d1)]+_0x41e427(0x1c2)+(_0x1c45a1[_0x41e427(0x1d1)]!==0x1?'s':'')+_0x41e427(0x1c8)+_0x1c45a1[_0x41e427(0x1f8)]+'\x20journey'+(_0x1c45a1[_0x41e427(0x1f8)]!==0x1?'s':''));const _0x2fb258=_0x1116c2=>{const _0x181add=_0x41e427;return getConsoleNextUrl(_0x17759a['site'],_0x181add(0x1cb)+_0x13690e[_0x181add(0x1e0)]+_0x181add(0x1f5)+_0x1116c2);},_0x2e91d1=_0x34d557=>{const _0x5161c3=_0x41e427;return getConsoleNextUrl(_0x17759a[_0x5161c3(0x1f2)],_0x5161c3(0x1cb)+_0x13690e[_0x5161c3(0x1e0)]+_0x5161c3(0x1f5)+_0x34d557+'/j/da');};if(_0x17759a['format']===_0x41e427(0x1f6)||_0x17759a[_0x41e427(0x1c7)]===_0x41e427(0x1ed))await handleSDKOutput(_0x5a8576,_0x17759a);else{console['log'](a45_0x1a7f56[_0x41e427(0x1f7)]('['+_0x39bc9+']'));const _0x3bf51a=formatTree(_0x5a8576,{'showMetadata':!![],'getSegmentUrl':_0x2fb258,'getJourneyUrl':_0x2e91d1});console['log'](_0x3bf51a);}return 0x0;}}function a45_0x5755(){const _0x79a41d=['Site:\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Parent\x20segment\x20context:\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','journey','execute','303876QDTdtq','\x20segment','1010118ftqaSk','\x20journey','children','name','format',',\x20and\x20','(not\x20set)','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','/app/ps/','folder','test','1026430PObfHv','filter','localeCompare','segments','7FqSlGo','data','log','\x5c$&','88ueQZBs','listRecursive','listWithPattern','folderId','maxDepth','recursive','listUnifiedWithJourneys','List\x20folders\x20and\x20child\x20segments','replace','resolvePathToResource','parentId','576280VpoDyU','Resolving\x20parent\x20segment\x20\x27','length','✔\x20Built\x20tree\x20with\x20','\x20folder','2gDyJAK','error',']\x20matching\x20\x27','sort','✔\x20Found\x20','map','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','jsonl','cause','journeyBundleName','No\x20items\x20match\x20pattern:\x20','Folder\x20ID:\x20','site','172941LbNIZs','segment','/e/','json','dim','journeys','includes','(empty)','Error:\x20No\x20parent\x20segment\x20context\x20set.','Recursive\x20mode:\x20enabled','description','parentSegment','61515kIoKoP','\x20\x20Cause:\x20','verbose','713800zLbMlY','listUnified','Folder/pattern\x20arg:\x20','folders','\x27...','type'];a45_0x5755=function(){return _0x79a41d;};return a45_0x5755();}
|
|
1
|
+
const a45_0x1ba5ee=a45_0x4224;(function(_0x22a23a,_0x273d34){const _0x3fe538=a45_0x4224,_0x2a99b2=_0x22a23a();while(!![]){try{const _0x1ff945=parseInt(_0x3fe538(0x118))/0x1*(parseInt(_0x3fe538(0x111))/0x2)+-parseInt(_0x3fe538(0x105))/0x3+-parseInt(_0x3fe538(0x12b))/0x4+parseInt(_0x3fe538(0x10a))/0x5+-parseInt(_0x3fe538(0x10d))/0x6+parseInt(_0x3fe538(0x10f))/0x7*(-parseInt(_0x3fe538(0x109))/0x8)+parseInt(_0x3fe538(0x110))/0x9*(parseInt(_0x3fe538(0x129))/0xa);if(_0x1ff945===_0x273d34)break;else _0x2a99b2['push'](_0x2a99b2['shift']());}catch(_0x3fc06a){_0x2a99b2['push'](_0x2a99b2['shift']());}}}(a45_0x2344,0x9fcce));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a45_0x4224(_0x93a702,_0x1c7a57){_0x93a702=_0x93a702-0x103;const _0x234446=a45_0x2344();let _0x4224d0=_0x234446[_0x93a702];return _0x4224d0;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a45_0x2344(){const _0x4219aa=['listUnifiedWithJourneys','name','parentId','Listing\x20folders,\x20segments,\x20and\x20journeys...','/app/ps/','format','/j/da','recursive','maxDepth','journeys','\x20folder','journey','Resolving\x20parent\x20segment\x20\x27','json','Set\x20a\x20parent\x20segment\x20context\x20first:','8748310oEFVoE','data','3066472UdElon','folderId','segments',',\x20and\x20','folders','No\x20items\x20match\x20pattern:\x20','folder','List\x20folders\x20and\x20child\x20segments','Error:\x20','listRecursive','description','message','map','jsonl','includes','parentSegment','\x20journey','✔\x20Built\x20tree\x20with\x20','dim','\x20segment','resolvePathToResource','(empty)','\x27...','\x20\x20Cause:\x20','listWithPattern',']\x20matching\x20\x27','Resolving\x20path\x20\x27','Parent\x20segment\x20context:\x20','segment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','✔\x20Found\x20','Parent\x20ID:\x20','log','verbose','cause','length','821619cQHXzc','site','replace','journeyBundleName','632wpzunK','4805230rxIsUr','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','listUnified','1532010RiTbnf','test','96614ozHkhq','18oZUIhk','12AmACrD','Folder\x20ID:\x20','error','/e/','type','filter','children','55003XklAPd','sort'];a45_0x2344=function(){return _0x4219aa;};return a45_0x2344();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x3ffe80 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x1ba5ee(0x11b)]=a45_0x1ba5ee(0x12d);[a45_0x1ba5ee(0x135)]=a45_0x1ba5ee(0x132);async['execute'](_0x1ef75c){const _0x34c85e=a45_0x1ba5ee,{options:_0x364b58,args:_0xacc024}=_0x1ef75c,_0x10689d=_0x364b58[_0x34c85e(0x121)],_0x30cda1=_0xacc024[0x0];try{const _0x20de14=_0x364b58[_0x34c85e(0x13a)];_0x364b58['verbose']&&(console[_0x34c85e(0x113)]('Site:\x20'+_0x364b58[_0x34c85e(0x106)]),console[_0x34c85e(0x113)](_0x34c85e(0x146)+(_0x20de14||'(not\x20set)')),_0x30cda1&&console[_0x34c85e(0x113)]('Folder/pattern\x20arg:\x20'+_0x30cda1),_0x10689d&&console[_0x34c85e(0x113)]('Recursive\x20mode:\x20enabled'));if(!_0x20de14)return console[_0x34c85e(0x113)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x34c85e(0x113)](''),console[_0x34c85e(0x113)](_0x34c85e(0x128)),console[_0x34c85e(0x113)](_0x34c85e(0x148)),console[_0x34c85e(0x113)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x34c85e(0x113)](''),console['error'](_0x34c85e(0x10b)),0x1;const _0x107ca5=_0x30cda1&&(_0x30cda1[_0x34c85e(0x139)]('*')||_0x30cda1[_0x34c85e(0x139)]('?'));if(_0x107ca5)return await this[_0x34c85e(0x143)](_0x1ef75c,_0x20de14,_0x30cda1);const _0x4870aa=_0x30cda1?_0x20de14+'/'+_0x30cda1:_0x20de14;return _0x10689d?await this[_0x34c85e(0x134)](_0x1ef75c,_0x4870aa):await this[_0x34c85e(0x10c)](_0x1ef75c,_0x4870aa);}catch(_0x3d9ca6){if(_0x3d9ca6 instanceof SDKError)return console[_0x34c85e(0x113)](_0x34c85e(0x133)+_0x3d9ca6[_0x34c85e(0x136)]),_0x3d9ca6[_0x34c85e(0x103)]&&console['error'](_0x34c85e(0x142)+_0x3d9ca6[_0x34c85e(0x103)]),0x1;throw _0x3d9ca6;}}async[a45_0x1ba5ee(0x143)](_0xaac24,_0x461361,_0xa90f3d){const _0x495fe8=a45_0x1ba5ee,{options:_0x27e9bd,tdx:_0x4ae0b2}=_0xaac24,_0x1ba0a1=await withSpinner(_0x495fe8(0x126)+_0x461361+_0x495fe8(0x141),()=>_0x4ae0b2['segment']['resolvePathToResource'](_0x461361),{'verbose':_0x27e9bd[_0x495fe8(0x14c)]}),_0x576f5d=_0x1ba0a1['data'],_0x54e475=await withSpinner(_0x495fe8(0x11d),()=>_0x4ae0b2[_0x495fe8(0x147)][_0x495fe8(0x11a)](_0x576f5d[_0x495fe8(0x11c)],_0x576f5d[_0x495fe8(0x12c)]),{'verbose':_0x27e9bd[_0x495fe8(0x14c)]}),{folders:_0x24e852,segments:_0x51116d,journeys:_0xdaca63}=_0x54e475[_0x495fe8(0x12a)],_0x5191ce=_0xa90f3d[_0x495fe8(0x107)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x495fe8(0x107)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x377476=new RegExp('^'+_0x5191ce+'$','i'),_0x4f7737=_0x24e852[_0x495fe8(0x116)](_0x37dead=>_0x377476['test'](_0x37dead['name'])),_0x316ec6=_0x51116d[_0x495fe8(0x116)](_0x1d7892=>_0x377476[_0x495fe8(0x10e)](_0x1d7892['name'])),_0x4d34c5=_0xdaca63[_0x495fe8(0x116)](_0x2a28f7=>_0x377476[_0x495fe8(0x10e)](_0x2a28f7[_0x495fe8(0x108)])),_0x2f44e=_0x4f7737['length']+_0x316ec6['length']+_0x4d34c5[_0x495fe8(0x104)];console[_0x495fe8(0x113)](_0x495fe8(0x149)+_0x4f7737[_0x495fe8(0x104)]+_0x495fe8(0x124)+(_0x4f7737[_0x495fe8(0x104)]!==0x1?'s':'')+',\x20'+_0x316ec6[_0x495fe8(0x104)]+_0x495fe8(0x13e)+(_0x316ec6[_0x495fe8(0x104)]!==0x1?'s':'')+_0x495fe8(0x12e)+_0x4d34c5[_0x495fe8(0x104)]+_0x495fe8(0x13b)+(_0x4d34c5['length']!==0x1?'s':'')+'\x20matching\x20\x27'+_0xa90f3d+'\x27');const _0x22c7b6=_0x3c0f9b=>{const _0x3df283=_0x495fe8;return getConsoleNextUrl(_0x27e9bd[_0x3df283(0x106)],_0x3df283(0x11e)+_0x576f5d[_0x3df283(0x11c)]+_0x3df283(0x114)+_0x3c0f9b);},_0x1e6697=_0x27e9bd[_0x495fe8(0x11f)]===_0x495fe8(0x127)||_0x27e9bd[_0x495fe8(0x11f)]===_0x495fe8(0x138);if(_0x1e6697){const _0x58dde5=[..._0x4f7737[_0x495fe8(0x137)](_0x3f7155=>({..._0x3f7155,'type':_0x495fe8(0x131)})),..._0x316ec6[_0x495fe8(0x137)](_0x256c99=>({..._0x256c99,'type':_0x495fe8(0x147),'url':_0x22c7b6(_0x256c99['id'])})),..._0x4d34c5[_0x495fe8(0x137)](_0x1d6eff=>({..._0x1d6eff,'name':_0x1d6eff['journeyBundleName'],'type':'journey'}))][_0x495fe8(0x119)]((_0x2d82b0,_0x15db03)=>_0x2d82b0['name']['localeCompare'](_0x15db03[_0x495fe8(0x11b)]));await handleSDKOutput(_0x58dde5,_0x27e9bd);}else{if(_0x2f44e===0x0)console['log'](_0x495fe8(0x130)+_0xa90f3d);else{console[_0x495fe8(0x14b)](a45_0x3ffe80[_0x495fe8(0x13d)]('['+_0x461361+_0x495fe8(0x144)+_0xa90f3d+'\x27'));const _0x237b45=formatFlatList(_0x4f7737,_0x316ec6,{'showMetadata':!![],'getSegmentUrl':_0x22c7b6},_0x4d34c5);console[_0x495fe8(0x14b)](_0x237b45);}}return 0x0;}async[a45_0x1ba5ee(0x10c)](_0x496667,_0x322a44){const _0x30c629=a45_0x1ba5ee,{options:_0x193459,tdx:_0x37c264}=_0x496667,_0x64cc7=await withSpinner(_0x30c629(0x145)+_0x322a44+_0x30c629(0x141),()=>_0x37c264[_0x30c629(0x147)][_0x30c629(0x13f)](_0x322a44),{'verbose':_0x193459[_0x30c629(0x14c)]}),_0x3a1223=_0x64cc7[_0x30c629(0x12a)];_0x193459['verbose']&&(console['error']('Parent\x20ID:\x20'+_0x3a1223[_0x30c629(0x11c)]),_0x3a1223[_0x30c629(0x12c)]&&console[_0x30c629(0x113)](_0x30c629(0x112)+_0x3a1223['folderId']));const _0xedfb14=await withSpinner(_0x30c629(0x11d),()=>_0x37c264[_0x30c629(0x147)][_0x30c629(0x11a)](_0x3a1223[_0x30c629(0x11c)],_0x3a1223[_0x30c629(0x12c)]),{'verbose':_0x193459[_0x30c629(0x14c)]}),{folders:_0x419165,segments:_0x261f99,journeys:_0xc86898}=_0xedfb14[_0x30c629(0x12a)],_0x141457=_0x419165[_0x30c629(0x104)]+_0x261f99[_0x30c629(0x104)]+_0xc86898['length'];console[_0x30c629(0x113)]('✔\x20Found\x20'+_0x419165[_0x30c629(0x104)]+_0x30c629(0x124)+(_0x419165['length']!==0x1?'s':'')+',\x20'+_0x261f99[_0x30c629(0x104)]+_0x30c629(0x13e)+(_0x261f99['length']!==0x1?'s':'')+',\x20and\x20'+_0xc86898[_0x30c629(0x104)]+_0x30c629(0x13b)+(_0xc86898[_0x30c629(0x104)]!==0x1?'s':''));const _0xedaabc=_0x8a2b59=>{const _0x5a46d4=_0x30c629;return getConsoleNextUrl(_0x193459[_0x5a46d4(0x106)],_0x5a46d4(0x11e)+_0x3a1223[_0x5a46d4(0x11c)]+_0x5a46d4(0x114)+_0x8a2b59);},_0x10be80=_0x2ad1e3=>{const _0x3c6bff=_0x30c629;return getConsoleNextUrl(_0x193459[_0x3c6bff(0x106)],_0x3c6bff(0x11e)+_0x3a1223[_0x3c6bff(0x11c)]+_0x3c6bff(0x114)+_0x2ad1e3+_0x3c6bff(0x120));},_0x5621bd=_0x193459[_0x30c629(0x11f)]===_0x30c629(0x127)||_0x193459[_0x30c629(0x11f)]===_0x30c629(0x138);if(_0x5621bd){const _0x18dc08=[..._0x419165[_0x30c629(0x137)](_0x424e2c=>({..._0x424e2c,'type':'folder'})),..._0x261f99[_0x30c629(0x137)](_0x51fb92=>({..._0x51fb92,'type':'segment','url':_0xedaabc(_0x51fb92['id'])})),..._0xc86898['map'](_0x4cc16c=>({..._0x4cc16c,'name':_0x4cc16c[_0x30c629(0x108)],'type':'journey','url':_0x10be80(_0x4cc16c['id'])}))][_0x30c629(0x119)]((_0x59e82d,_0x435dd8)=>_0x59e82d[_0x30c629(0x11b)]['localeCompare'](_0x435dd8['name']));await handleSDKOutput(_0x18dc08,_0x193459);}else{if(_0x141457===0x0)console[_0x30c629(0x14b)](a45_0x3ffe80[_0x30c629(0x13d)]('['+_0x322a44+']')),console['log'](_0x30c629(0x140));else{console[_0x30c629(0x14b)](a45_0x3ffe80[_0x30c629(0x13d)]('['+_0x322a44+']'));const _0x3e5a8b=formatFlatList(_0x419165,_0x261f99,{'showMetadata':!![],'getSegmentUrl':_0xedaabc,'getJourneyUrl':_0x10be80},_0xc86898);console[_0x30c629(0x14b)](_0x3e5a8b);}}return 0x0;}async[a45_0x1ba5ee(0x134)](_0x4e8a55,_0x38d536){const _0x38765c=a45_0x1ba5ee,{options:_0x25492b,tdx:_0xb7f589}=_0x4e8a55,_0x34565f=await withSpinner(_0x38765c(0x145)+_0x38d536+_0x38765c(0x141),()=>_0xb7f589[_0x38765c(0x147)][_0x38765c(0x13f)](_0x38d536),{'verbose':_0x25492b[_0x38765c(0x14c)]}),_0x3885dd=_0x34565f[_0x38765c(0x12a)];_0x25492b[_0x38765c(0x14c)]&&(console[_0x38765c(0x113)](_0x38765c(0x14a)+_0x3885dd['parentId']),_0x3885dd[_0x38765c(0x12c)]&&console[_0x38765c(0x113)](_0x38765c(0x112)+_0x3885dd['folderId']));const _0x31ed06=_0x25492b[_0x38765c(0x122)]||0xa,_0x2accd0=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0xb7f589[_0x38765c(0x147)]['listRecursive'](_0x3885dd[_0x38765c(0x11c)],_0x3885dd[_0x38765c(0x12c)],0x0,_0x31ed06),{'verbose':_0x25492b['verbose']}),_0x508fe1=_0x2accd0[_0x38765c(0x12a)],_0x1a110e=_0x335084=>{const _0x1937bf=_0x38765c;let _0x4ed60b=0x0,_0x10fcd8=0x0,_0xa866d3=0x0;for(const _0x4a4097 of _0x335084){if(_0x4a4097['type']==='folder')_0x4ed60b++;else{if(_0x4a4097['type']===_0x1937bf(0x147))_0x10fcd8++;else{if(_0x4a4097[_0x1937bf(0x115)]===_0x1937bf(0x125))_0xa866d3++;}}if(_0x4a4097[_0x1937bf(0x117)]){const _0x14ae79=_0x1a110e(_0x4a4097[_0x1937bf(0x117)]);_0x4ed60b+=_0x14ae79[_0x1937bf(0x12f)],_0x10fcd8+=_0x14ae79[_0x1937bf(0x12d)],_0xa866d3+=_0x14ae79[_0x1937bf(0x123)];}}return{'folders':_0x4ed60b,'segments':_0x10fcd8,'journeys':_0xa866d3};},_0x3d0fa5=_0x1a110e(_0x508fe1);console[_0x38765c(0x113)](_0x38765c(0x13c)+_0x3d0fa5['folders']+_0x38765c(0x124)+(_0x3d0fa5[_0x38765c(0x12f)]!==0x1?'s':'')+',\x20'+_0x3d0fa5[_0x38765c(0x12d)]+_0x38765c(0x13e)+(_0x3d0fa5[_0x38765c(0x12d)]!==0x1?'s':'')+_0x38765c(0x12e)+_0x3d0fa5[_0x38765c(0x123)]+_0x38765c(0x13b)+(_0x3d0fa5[_0x38765c(0x123)]!==0x1?'s':''));const _0x10d9c2=_0x2c657b=>{const _0x37c339=_0x38765c;return getConsoleNextUrl(_0x25492b['site'],_0x37c339(0x11e)+_0x3885dd[_0x37c339(0x11c)]+_0x37c339(0x114)+_0x2c657b);},_0x202597=_0x31464a=>{const _0x13a2bc=_0x38765c;return getConsoleNextUrl(_0x25492b[_0x13a2bc(0x106)],_0x13a2bc(0x11e)+_0x3885dd[_0x13a2bc(0x11c)]+_0x13a2bc(0x114)+_0x31464a+_0x13a2bc(0x120));};if(_0x25492b[_0x38765c(0x11f)]==='json'||_0x25492b[_0x38765c(0x11f)]===_0x38765c(0x138))await handleSDKOutput(_0x508fe1,_0x25492b);else{console[_0x38765c(0x14b)](a45_0x3ffe80[_0x38765c(0x13d)]('['+_0x38d536+']'));const _0x2d5a7e=formatTree(_0x508fe1,{'showMetadata':!![],'getSegmentUrl':_0x10d9c2,'getJourneyUrl':_0x202597});console[_0x38765c(0x14b)](_0x2d5a7e);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x15ff6f=a46_0x1108;(function(_0x1f64e7,_0x12b0b9){const _0x26d139=a46_0x1108,_0xab0aec=_0x1f64e7();while(!![]){try{const _0x4be7e9=-parseInt(_0x26d139(0x12f))/0x1+-parseInt(_0x26d139(0x10b))/0x2+-parseInt(_0x26d139(0x12c))/0x3+parseInt(_0x26d139(0x11b))/0x4+-parseInt(_0x26d139(0x11a))/0x5+parseInt(_0x26d139(0x10f))/0x6*(-parseInt(_0x26d139(0x115))/0x7)+parseInt(_0x26d139(0x10d))/0x8;if(_0x4be7e9===_0x12b0b9)break;else _0xab0aec['push'](_0xab0aec['shift']());}catch(_0x1e287d){_0xab0aec['push'](_0xab0aec['shift']());}}}(a46_0x5079,0x2a329));function a46_0x1108(_0x240af6,_0x5263c4){_0x240af6=_0x240af6-0x10b;const _0x50792e=a46_0x5079();let _0x1108ad=_0x50792e[_0x240af6];return _0x1108ad;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';function a46_0x5079(){const _0x5ec0a6=['site','cause','args','Error:\x20','catalog','Database:\x20','Table:\x20','Querying\x20','851025JqKDpf','error','\x20\x20Cause:\x20','184298xAFTQU','data','Usage:\x20tdx\x20show\x20<database.table>','query','verbose','532422yJzukY','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','6918640aLwadU','table','28662YfRBLZ','...','✔\x20Retrieved\x20','database','name','message','42UDnkrX','length','Site:\x20','showTable','\x20row','1168640POgwun','1218340mJflxX','description','limit','Catalog:\x20','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','validate','\x20from\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','show'];a46_0x5079=function(){return _0x5ec0a6;};return a46_0x5079();}import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{[a46_0x15ff6f(0x113)]=a46_0x15ff6f(0x123);[a46_0x15ff6f(0x11c)]='Show\x20table\x20contents';async['execute'](_0x1f31d1){const _0x5bd0c3=a46_0x15ff6f;return this[_0x5bd0c3(0x118)](_0x1f31d1);}async['showTable'](_0x48028e){const _0x18bbd3=a46_0x15ff6f,{options:_0x587392,args:_0x496cd1,tdx:_0x31a734}=_0x48028e;let _0x385390;try{_0x385390=parseTableReference(_0x496cd1[0x0]);const _0x1370bf=_0x587392[_0x18bbd3(0x112)];!_0x385390[_0x18bbd3(0x112)]&&_0x1370bf&&(_0x385390[_0x18bbd3(0x112)]=_0x1370bf);const _0x4efd81=validateTableDescribeReference(_0x385390);if(_0x4efd81)return console[_0x18bbd3(0x12d)](_0x18bbd3(0x127)+_0x4efd81),console[_0x18bbd3(0x12d)](_0x18bbd3(0x131)),console[_0x18bbd3(0x12d)](_0x18bbd3(0x10c)),console['error'](_0x18bbd3(0x122)),0x1;}catch(_0x515241){return console['error'](_0x18bbd3(0x127)+_0x515241['message']),console[_0x18bbd3(0x12d)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x18bbd3(0x12d)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x18bbd3(0x12d)](_0x18bbd3(0x122)),0x1;}const _0x3bb6b4=_0x385390[_0x18bbd3(0x128)],_0x3bf2a5=_0x385390[_0x18bbd3(0x112)],_0x566177=_0x385390[_0x18bbd3(0x10e)],_0x3833b8=resolveLimit(_0x587392[_0x18bbd3(0x11d)],DEFAULT_DISPLAY_LIMIT);try{_0x587392[_0x18bbd3(0x133)]&&(console[_0x18bbd3(0x12d)](_0x18bbd3(0x117)+_0x587392[_0x18bbd3(0x124)]),_0x3bb6b4&&console['error'](_0x18bbd3(0x11e)+_0x3bb6b4),console[_0x18bbd3(0x12d)](_0x18bbd3(0x129)+_0x3bf2a5),console[_0x18bbd3(0x12d)](_0x18bbd3(0x12a)+_0x566177),console[_0x18bbd3(0x12d)]('Limit:\x20'+_0x3833b8));const _0x2c4b8c=_0x3bb6b4?_0x3bb6b4+'.'+_0x3bf2a5+'.'+_0x566177:_0x3bf2a5+'.'+_0x566177,_0x512761=await withSpinner(_0x18bbd3(0x12b)+_0x2c4b8c+_0x18bbd3(0x110),()=>_0x31a734[_0x18bbd3(0x132)][_0x18bbd3(0x118)](_0x3bf2a5,_0x566177,_0x3833b8,_0x3bb6b4),{'verbose':_0x587392[_0x18bbd3(0x133)]}),_0x4ec12c=_0x512761['data'],_0x1b34d9=_0x4ec12c[_0x18bbd3(0x130)];return _0x1b34d9[_0x18bbd3(0x116)]===0x0?console[_0x18bbd3(0x12d)]('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x18bbd3(0x12d)](_0x18bbd3(0x111)+_0x1b34d9['length']+_0x18bbd3(0x119)+(_0x1b34d9[_0x18bbd3(0x116)]!==0x1?'s':'')+_0x18bbd3(0x121)+_0x2c4b8c),await handleSDKOutput(_0x1b34d9,_0x587392),0x0;}catch(_0x263fc2){if(_0x263fc2 instanceof SDKError)return console[_0x18bbd3(0x12d)](_0x18bbd3(0x127)+_0x263fc2[_0x18bbd3(0x114)]),_0x263fc2[_0x18bbd3(0x125)]&&console[_0x18bbd3(0x12d)](_0x18bbd3(0x12e)+_0x263fc2['cause']),0x1;throw _0x263fc2;}}[a46_0x15ff6f(0x120)](_0x960bd4){const _0x45bd54=a46_0x15ff6f;if(_0x960bd4['args'][_0x45bd54(0x116)]===0x0)return'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';if(_0x960bd4[_0x45bd54(0x126)][_0x45bd54(0x116)]>0x1)return _0x45bd54(0x11f);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x40b47d=a47_0x5a2e;(function(_0x3fd9c8,_0x129a53){const _0x5a7930=a47_0x5a2e,_0x5e5cf0=_0x3fd9c8();while(!![]){try{const _0x36713e=-parseInt(_0x5a7930(0x197))/0x1*(-parseInt(_0x5a7930(0x196))/0x2)+-parseInt(_0x5a7930(0x1aa))/0x3+-parseInt(_0x5a7930(0x1ab))/0x4*(-parseInt(_0x5a7930(0x19d))/0x5)+parseInt(_0x5a7930(0x19b))/0x6*(-parseInt(_0x5a7930(0x1b6))/0x7)+-parseInt(_0x5a7930(0x1a6))/0x8+parseInt(_0x5a7930(0x1a2))/0x9+-parseInt(_0x5a7930(0x1a3))/0xa;if(_0x36713e===_0x129a53)break;else _0x5e5cf0['push'](_0x5e5cf0['shift']());}catch(_0x7c5398){_0x5e5cf0['push'](_0x5e5cf0['shift']());}}}(a47_0x59a8,0xa8229));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a47_0x5a2e(_0x595c31,_0x1fd125){_0x595c31=_0x595c31-0x192;const _0x59a8c8=a47_0x59a8();let _0x5a2e0a=_0x59a8c8[_0x595c31];return _0x5a2e0a;}function a47_0x59a8(){const _0x339334=['env','1385wvpkin','✓\x20Authentication\x20successful\x0a','config','\x20profile:\x20','bold','11583135aogvBG','2335670zvjkEu','profileSource','join','7718848vcMXaC','CLI\x20flag','log','last_name','3155808ctXoeR','17332qqHUHq','first_name','status','Show\x20authentication\x20status\x20and\x20current\x20context','green','Credential\x20type:\x20','cli','Read\x20credential\x20from\x20','TDX_PROFILE\x20env','site','profile','101003rseKvo','email','execute','Name:','session','account_id','displayWithSources','getUserInfo','Account\x20ID:','yellow','tdx','description','red','message','filter','242fMniYt','3853zjCDlP','dim','error','cyan','6ISndfq'];a47_0x59a8=function(){return _0x339334;};return a47_0x59a8();}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x3eb86c from'chalk';export class StatusCommand extends BaseCommand{['name']='status';[a47_0x40b47d(0x192)]=a47_0x40b47d(0x1ae);async[a47_0x40b47d(0x1b8)](_0x1ccc98){const _0x5dbfa0=a47_0x40b47d,{options:_0x541a45,tdx:_0x1cf898}=_0x1ccc98,_0x144363=_0x541a45[_0x5dbfa0(0x1b4)],_0x4367dc=new GlobalContext(_0x541a45),_0x2148cf=_0x4367dc[_0x5dbfa0(0x1b5)],_0x538b1f=_0x4367dc[_0x5dbfa0(0x1a4)],_0x5a69f7=_0x538b1f===_0x5dbfa0(0x1b1)?_0x5dbfa0(0x1a7):_0x538b1f===_0x5dbfa0(0x1ba)?_0x5dbfa0(0x1ba):_0x538b1f===_0x5dbfa0(0x19c)?_0x5dbfa0(0x1b3):_0x538b1f===_0x5dbfa0(0x19f)?_0x5dbfa0(0x19f):null,_0x38da35=_0x2148cf?a47_0x3eb86c[_0x5dbfa0(0x19a)](_0x2148cf):a47_0x3eb86c[_0x5dbfa0(0x198)]('N/A'),_0x170e59=_0x5a69f7?'\x20'+a47_0x3eb86c[_0x5dbfa0(0x198)]('(from\x20'+_0x5a69f7+')'):'';console[_0x5dbfa0(0x1a8)](a47_0x3eb86c['bold'](_0x5dbfa0(0x1c0))+_0x5dbfa0(0x1a0)+_0x38da35+_0x170e59+'\x20'+a47_0x3eb86c['dim']('(')+'site:\x20'+a47_0x3eb86c[_0x5dbfa0(0x19a)](_0x144363)+a47_0x3eb86c[_0x5dbfa0(0x198)](')'));const _0x5ccaa7=await getOAuthTokens(_0x2148cf);if(_0x5ccaa7)console[_0x5dbfa0(0x1a8)](_0x5dbfa0(0x1b0)+a47_0x3eb86c[_0x5dbfa0(0x19a)]('OAuth'));else{const _0x24f9a7=await resolveAPIKeyAsync(_0x144363,_0x2148cf);if(_0x24f9a7){const {source:_0x39cd4e,isDeprecated:_0x328d68}=_0x24f9a7,_0x3ed589=_0x5dbfa0(0x1b2)+a47_0x3eb86c[_0x5dbfa0(0x19a)](_0x39cd4e);console[_0x5dbfa0(0x1a8)](_0x328d68?a47_0x3eb86c[_0x5dbfa0(0x1bf)](_0x3ed589):_0x3ed589);}else console['log'](a47_0x3eb86c[_0x5dbfa0(0x1bf)]('No\x20credential\x20found'));}let _0x29407a=![];try{const _0x5690ff=await _0x1cf898['jobs'][_0x5dbfa0(0x1bd)]();console[_0x5dbfa0(0x1a8)](a47_0x3eb86c[_0x5dbfa0(0x1af)](_0x5dbfa0(0x19e))),console[_0x5dbfa0(0x1a8)](a47_0x3eb86c[_0x5dbfa0(0x1a1)]('User:')+'\x20'+a47_0x3eb86c[_0x5dbfa0(0x19a)](_0x5690ff[_0x5dbfa0(0x1b7)]));if(_0x5690ff['first_name']||_0x5690ff['last_name']){const _0x48df75=[_0x5690ff[_0x5dbfa0(0x1ac)],_0x5690ff[_0x5dbfa0(0x1a9)]][_0x5dbfa0(0x195)](Boolean)[_0x5dbfa0(0x1a5)]('\x20');console[_0x5dbfa0(0x1a8)](a47_0x3eb86c[_0x5dbfa0(0x1a1)](_0x5dbfa0(0x1b9))+'\x20'+_0x48df75);}_0x5690ff['account_id']&&console[_0x5dbfa0(0x1a8)](a47_0x3eb86c['bold'](_0x5dbfa0(0x1be))+'\x20'+a47_0x3eb86c[_0x5dbfa0(0x1bf)](_0x5690ff[_0x5dbfa0(0x1bb)])),_0x29407a=!![];}catch(_0x30a51e){_0x30a51e instanceof HTTPClientError&&_0x30a51e[_0x5dbfa0(0x1ad)]===0x191?printAuthError(_0x30a51e,!![],_0x2148cf):console[_0x5dbfa0(0x199)](a47_0x3eb86c[_0x5dbfa0(0x193)]('✗\x20Validation\x20failed:\x20'+(_0x30a51e instanceof Error?_0x30a51e[_0x5dbfa0(0x194)]:String(_0x30a51e))));}return console[_0x5dbfa0(0x1a8)](),_0x4367dc[_0x5dbfa0(0x1bc)](),_0x29407a?0x0:0x1;}}
|