@treasuredata/tdx 2026.4.12 → 2026.4.14
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
|
-
const
|
|
1
|
+
const a40_0xa5699a=a40_0x35b8;function a40_0x35b8(_0x1d4bcc,_0x5d0382){_0x1d4bcc=_0x1d4bcc-0x160;const _0x15d905=a40_0x15d9();let _0x35b87a=_0x15d905[_0x1d4bcc];return _0x35b87a;}(function(_0x1a82b6,_0x8680ed){const _0x323c2c=a40_0x35b8,_0x17c60d=_0x1a82b6();while(!![]){try{const _0x2c6bf1=-parseInt(_0x323c2c(0x1a3))/0x1+parseInt(_0x323c2c(0x1a8))/0x2+-parseInt(_0x323c2c(0x190))/0x3+parseInt(_0x323c2c(0x19a))/0x4+-parseInt(_0x323c2c(0x19e))/0x5+parseInt(_0x323c2c(0x1ad))/0x6*(-parseInt(_0x323c2c(0x18c))/0x7)+-parseInt(_0x323c2c(0x16f))/0x8*(-parseInt(_0x323c2c(0x181))/0x9);if(_0x2c6bf1===_0x8680ed)break;else _0x17c60d['push'](_0x17c60d['shift']());}catch(_0x2d288e){_0x17c60d['push'](_0x17c60d['shift']());}}}(a40_0x15d9,0x95050));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x219c53 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0x15d9(){const _0x25b4a1=['journeys','\x20versions)','repeat','\x20\x20🎯\x20','Aborted.','\x20journeys','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','activations','\x20activations','1460168EHSnrD','parent_segment','name','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','1411525lryTqJ','type','message','✔\x20Pulled\x20','-\x20no\x20files\x20written','486349iTpAOc','Target\x20resource:\x20','counts','execute','errorCode','1433184OfATYG','\x20files\x20to\x20','error','targetDir','yellow','393900uvXyDK','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20segments','\x0aChanges\x20to\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','parentName','\x27...','journeyVersions','✔\x20Context\x20set:\x20','dryRun','\x0aError:','description','\x20changed\x20files','filter','\x20with\x20','red','8532296FJOHeB','setPhase','cyan','\x20\x20Target:\x20','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)','diff','parentSegment','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','green','length','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','helpText','dim','verbose','\x20\x20🗺️\x20\x20','Pulling\x20segments\x20from\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','Write\x20','18IJMLEa','\x0aPull\x20summary\x20for\x20\x27','hasChanges','content','session','files','✔\x20All\x20files\x20are\x20up\x20to\x20date','dirname','resourceName','segment','segments','112nBHirx','Parent\x20segment:\x20','isNew','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','2355810fvvkvw'];a40_0x15d9=function(){return _0x25b4a1;};return a40_0x15d9();}import a40_0x155586 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{[a40_0xa5699a(0x19c)]='segment:pull';[a40_0xa5699a(0x16a)]=a40_0xa5699a(0x19d);async[a40_0xa5699a(0x1a6)](_0x3bf037){const _0x3faaa6=a40_0xa5699a,{options:_0x5d840f,args:_0x51638c,tdx:_0x4993df}=_0x3bf037,_0x51270e=_0x5d840f,_0x1d9aed=await resolveTarget({'arg':_0x51638c[0x0],'contextParent':_0x5d840f[_0x3faaa6(0x175)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x1d9aed))return _0x1d9aed[_0x3faaa6(0x1a7)]==='no_parent'?(console[_0x3faaa6(0x1aa)](a40_0x219c53[_0x3faaa6(0x1ac)](_0x3faaa6(0x163))),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x173)),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x17f)),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x179))):(console['error'](a40_0x219c53[_0x3faaa6(0x16e)]('Error:\x20'+_0x1d9aed[_0x3faaa6(0x1a0)]+'\x0a')),_0x1d9aed[_0x3faaa6(0x17a)]&&console['error'](a40_0x219c53[_0x3faaa6(0x171)](_0x1d9aed[_0x3faaa6(0x17a)]))),0x1;const _0x382eb0=_0x1d9aed[_0x3faaa6(0x164)],_0x3d7997=_0x1d9aed[_0x3faaa6(0x1ab)],_0x244e55=_0x1d9aed[_0x3faaa6(0x19f)]==='file'?_0x1d9aed[_0x3faaa6(0x189)]:undefined;_0x51270e[_0x3faaa6(0x17c)]&&(console[_0x3faaa6(0x1aa)]('Site:\x20'+_0x51270e['site']),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x18d)+_0x382eb0),_0x244e55&&console[_0x3faaa6(0x1aa)](_0x3faaa6(0x1a4)+_0x244e55));const _0x1679da=await withProgressSpinner(_0x3faaa6(0x17e)+_0x382eb0+_0x3faaa6(0x165),_0xb23d32=>_0x4993df[_0x3faaa6(0x18a)]['pullSegments'](_0x382eb0,{'targetDir':_0x3d7997,'targetResourceName':_0x244e55,'verbose':_0x51270e[_0x3faaa6(0x17c)],'progress':{'update':_0x3a6603=>{const _0x55a851=_0x3faaa6;_0xb23d32[_0x55a851(0x170)](_0x3a6603),_0x51270e[_0x55a851(0x17c)]&&console['error']('\x20\x20'+_0x3a6603);}}}),{'verbose':_0x51270e['verbose']}),_0x10190b=_0x1679da['data'];if(_0x10190b['counts'][_0x3faaa6(0x18b)]===0x0&&_0x10190b[_0x3faaa6(0x1a5)][_0x3faaa6(0x191)]===0x0)return console['error'](a40_0x219c53['yellow'](_0x3faaa6(0x197)+_0x10190b[_0x3faaa6(0x164)]+'\x27')),0x0;const _0x125fbf=_0x10190b['files'][_0x3faaa6(0x16c)](_0x2fc9e4=>_0x2fc9e4[_0x3faaa6(0x18e)]),_0x35eb13=_0x10190b[_0x3faaa6(0x186)][_0x3faaa6(0x16c)](_0x18ee6b=>!_0x18ee6b[_0x3faaa6(0x18e)]&&_0x18ee6b['hasChanges']),_0x40b15e=_0x10190b[_0x3faaa6(0x186)][_0x3faaa6(0x16c)](_0x551192=>!_0x551192[_0x3faaa6(0x18e)]&&!_0x551192[_0x3faaa6(0x183)]);console['error'](_0x3faaa6(0x182)+_0x10190b[_0x3faaa6(0x164)]+'\x27:'),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x194)+a40_0x219c53[_0x3faaa6(0x171)](_0x10190b[_0x3faaa6(0x1a5)][_0x3faaa6(0x18b)]+_0x3faaa6(0x161))+_0x3faaa6(0x16d)+a40_0x219c53[_0x3faaa6(0x171)](_0x10190b[_0x3faaa6(0x1a5)][_0x3faaa6(0x198)]+_0x3faaa6(0x199)));if(_0x10190b['counts'][_0x3faaa6(0x191)]>0x0){const _0x1058d5=_0x10190b[_0x3faaa6(0x1a5)][_0x3faaa6(0x166)]>_0x10190b[_0x3faaa6(0x1a5)]['journeys']?'\x20('+_0x10190b['counts']['journeyVersions']+_0x3faaa6(0x192):'';console[_0x3faaa6(0x1aa)](_0x3faaa6(0x17d)+a40_0x219c53['cyan'](_0x10190b[_0x3faaa6(0x1a5)][_0x3faaa6(0x191)]+_0x3faaa6(0x196))+a40_0x219c53[_0x3faaa6(0x17b)](_0x1058d5));}console[_0x3faaa6(0x1aa)]('\x20\x20'+a40_0x219c53[_0x3faaa6(0x177)]('+\x20'+_0x125fbf[_0x3faaa6(0x178)]+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x219c53[_0x3faaa6(0x1ac)]('~\x20'+_0x35eb13['length']+_0x3faaa6(0x16b))),console[_0x3faaa6(0x1aa)]('\x20\x20'+a40_0x219c53[_0x3faaa6(0x17b)]('=\x20'+_0x40b15e[_0x3faaa6(0x178)]+'\x20unchanged\x20files')),console[_0x3faaa6(0x1aa)](_0x3faaa6(0x172)+a40_0x219c53[_0x3faaa6(0x171)](_0x10190b[_0x3faaa6(0x1ab)])+'\x0a');if(_0x35eb13[_0x3faaa6(0x178)]>0x0)for(const _0x348c40 of _0x35eb13){console[_0x3faaa6(0x1aa)](_0x3faaa6(0x162)+_0x348c40['relativePath']+'\x27:'),console[_0x3faaa6(0x1aa)]('─'['repeat'](0x3c)),console['error'](_0x348c40[_0x3faaa6(0x174)]),console[_0x3faaa6(0x1aa)]('─'[_0x3faaa6(0x193)](0x3c));}if(_0x51270e[_0x3faaa6(0x168)])return console[_0x3faaa6(0x1aa)](a40_0x219c53['yellow'](_0x3faaa6(0x176))),0x0;if(_0x125fbf[_0x3faaa6(0x178)]===0x0&&_0x35eb13[_0x3faaa6(0x178)]===0x0)return console[_0x3faaa6(0x1aa)](a40_0x219c53['green'](_0x3faaa6(0x187))),saveSessionContext({'parent_segment':_0x10190b[_0x3faaa6(0x164)]},_0x51270e[_0x3faaa6(0x185)]),console[_0x3faaa6(0x1aa)](a40_0x219c53['green']('✔\x20Context\x20set:\x20'+a40_0x219c53[_0x3faaa6(0x17b)](_0x3faaa6(0x19b))+'\x20=\x20'+a40_0x219c53[_0x3faaa6(0x171)](_0x10190b[_0x3faaa6(0x164)]))),0x0;if(!_0x51270e['yes']){if(!isInteractive())return console[_0x3faaa6(0x1aa)](a40_0x219c53[_0x3faaa6(0x16e)](_0x3faaa6(0x169)),_0x3faaa6(0x160)),console[_0x3faaa6(0x1aa)](a40_0x219c53['dim'](_0x3faaa6(0x18f))),0x1;const _0x374b79=await confirmKey(_0x3faaa6(0x180)+(_0x125fbf[_0x3faaa6(0x178)]+_0x35eb13[_0x3faaa6(0x178)])+'\x20files?');if(!_0x374b79)return console[_0x3faaa6(0x1aa)](a40_0x219c53[_0x3faaa6(0x1ac)](_0x3faaa6(0x195)),_0x3faaa6(0x1a2)),0x1;}for(const _0x1c4833 of _0x10190b[_0x3faaa6(0x186)]){if(_0x1c4833[_0x3faaa6(0x18e)]||_0x1c4833['hasChanges']){const _0x540a96=a40_0x155586[_0x3faaa6(0x188)](_0x1c4833['absolutePath']);!existsSync(_0x540a96)&&mkdirSync(_0x540a96,{'recursive':!![]}),writeFileSync(_0x1c4833['absolutePath'],_0x1c4833[_0x3faaa6(0x184)],'utf-8');}}return console['error'](a40_0x219c53['green'](_0x3faaa6(0x1a1)+(_0x125fbf[_0x3faaa6(0x178)]+_0x35eb13[_0x3faaa6(0x178)])+_0x3faaa6(0x1a9)+_0x10190b[_0x3faaa6(0x1ab)])),saveSessionContext({'parent_segment':_0x10190b[_0x3faaa6(0x164)]},_0x51270e[_0x3faaa6(0x185)]),console[_0x3faaa6(0x1aa)](a40_0x219c53['green'](_0x3faaa6(0x167)+a40_0x219c53['dim']('parent_segment')+'\x20=\x20'+a40_0x219c53['cyan'](_0x10190b['parentName']))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a41_0x5c1e39=a41_0x2522;(function(_0x49525d,_0x4e09c7){const _0x1bc755=a41_0x2522,_0x25d60c=_0x49525d();while(!![]){try{const _0x14e78d=parseInt(_0x1bc755(0x17f))/0x1+-parseInt(_0x1bc755(0x205))/0x2*(parseInt(_0x1bc755(0x16d))/0x3)+-parseInt(_0x1bc755(0x212))/0x4*(parseInt(_0x1bc755(0x20c))/0x5)+parseInt(_0x1bc755(0x1fc))/0x6*(-parseInt(_0x1bc755(0x1ca))/0x7)+-parseInt(_0x1bc755(0x19d))/0x8*(-parseInt(_0x1bc755(0x1cd))/0x9)+parseInt(_0x1bc755(0x19a))/0xa+-parseInt(_0x1bc755(0x19e))/0xb*(parseInt(_0x1bc755(0x1c4))/0xc);if(_0x14e78d===_0x4e09c7)break;else _0x25d60c['push'](_0x25d60c['shift']());}catch(_0x244f55){_0x25d60c['push'](_0x25d60c['shift']());}}}(a41_0x4f22,0x2e20e));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a41_0x2522(_0x107496,_0x21772f){_0x107496=_0x107496-0x16d;const _0x4f2224=a41_0x4f22();let _0x2522a3=_0x4f2224[_0x107496];return _0x2522a3;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x520b0c from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a41_0x4f22(){const _0x102084=['\x20\x20Activations:\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','No\x20','message','unchanged','4wstoZI','\x20to\x20delete','results','map','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','type','list','10VlEvSC','created','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Delete\x20journey:','\x20to\x20create','\x20to\x20update','191064Ritpxw','65028GhNnNN','no_parent','red','segments','dryRun','verbose','idToName','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journeyBundleName','folderId','connection','\x20new','New\x20segment:','\x20changed','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)','\x20updated','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','getOutputSchemaWithCache','358986xvtUHT','Aborted.','repeat','/sb/da/esr','delete','resolveParentId','Error\x20parsing\x20YAML:\x20','\x20\x20📊\x20Segments:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','state','yamlConfig','parentName','diff','Error:\x20','\x20\x20\x20\x20','isScoped','\x20YAML\x20files\x20found','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','parent_name','toUpdate','targetDir','scopedFolderPath','parentFolder','\x20created','site','updated','Delete\x20segment:','194260qgnPjo','nameToId','existingSegment','384GuWzwi','11JeEWjO','activations','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','/e/','createdSegmentIds','folderPath','user','.yaml','listFolders','existingJourney','New\x20journey:','all','listSegments','journeyId','helpText','setPhase','\x20activations]','then','join','journey','Preparing\x20journeys...','/j/da/je','\x20\x20Source:\x20','/app/ps/','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','description','Changes\x20to\x20journey:','dim','changed','isNew','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toDelete','yes','yellow','endsWith','buildUserMaps','\x0aPush\x20summary\x20for\x20\x27','journeysOnly','984636OCsXYi','\x20\x20🗺️\x20\x20Journeys:','set','getParent','\x20unchanged','execute','306579tPlgQS','segmentFolderId','segment\x20or\x20journey','14112idNseX','\x20deleted','segment:push','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','parentSegment','push','Source\x20directory:\x20','\x0aValidation\x20failed:','listJourneysWithDetailsFromParentSegment','updatedAt','Resolving\x20parent\x20segment\x20\x27','green','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','error','attributes','length','(Journey\x20will\x20be\x20deleted)','\x0aError:','data','Parent\x20segment:\x20','Site:\x20','file','Scoped\x20to\x20folder:\x20','Folders\x20to\x20create:','Fetching\x20connections\x20for\x20name\x20resolution...','listActivations','toString','deleted','segment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','new','\x27...','name','folders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','toCreate','Fetching\x20existing\x20data...','journeys','cwd','get','\x0a✔\x20Push\x20complete','paused','cyan','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20existing\x20activations...','blue','6qURqqS','add','Changes\x20to:','audienceId'];a41_0x4f22=function(){return _0x102084;};return a41_0x4f22();}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{[a41_0x5c1e39(0x1ed)]=a41_0x5c1e39(0x1cf);[a41_0x5c1e39(0x1b7)]=a41_0x5c1e39(0x1d9);async[a41_0x5c1e39(0x1c9)](_0x31463a){const _0x12c16c=a41_0x5c1e39,{options:_0x156039,args:_0x329fa4,tdx:_0x242946}=_0x31463a,_0x3c0b61=_0x156039,_0x85000a=await resolveTarget({'arg':_0x329fa4[0x0],'contextParent':_0x156039[_0x12c16c(0x1d1)],'cwd':process[_0x12c16c(0x1f3)]()});if(!isSuccessfulResolution(_0x85000a))return _0x85000a['errorCode']===_0x12c16c(0x16e)?(console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x12c16c(0x1da)](_0x12c16c(0x17b)),console[_0x12c16c(0x1da)](_0x12c16c(0x1d0)),console['error'](_0x12c16c(0x1ef))):(console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x18c)+_0x85000a[_0x12c16c(0x203)]+'\x0a')),_0x85000a[_0x12c16c(0x1ac)]&&console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1f7)](_0x85000a[_0x12c16c(0x1ac)]))),0x1;if(_0x85000a[_0x12c16c(0x20a)]===_0x12c16c(0x191))return console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1f9)+_0x85000a[_0x12c16c(0x193)]+'\x0a')),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1f7)](_0x12c16c(0x209))),0x1;const _0x17384e=_0x85000a[_0x12c16c(0x18a)],_0x4d0afe=_0x85000a[_0x12c16c(0x193)],_0x1c1441=_0x85000a[_0x12c16c(0x20a)]===_0x12c16c(0x1e2)?_0x85000a['filePath']:undefined,_0x2f6af0=getScopedDetails(_0x85000a),_0x16e459=_0x2f6af0?.[_0x12c16c(0x18e)]??![],_0x42bbde=_0x2f6af0?.[_0x12c16c(0x194)]??'';if(!existsSync(_0x4d0afe))return console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1f9)+_0x4d0afe+'\x0a')),console[_0x12c16c(0x1da)](a41_0x520b0c['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3c0b61['verbose']&&(console['error'](_0x12c16c(0x1e1)+_0x3c0b61[_0x12c16c(0x197)]),console[_0x12c16c(0x1da)](_0x12c16c(0x1e0)+_0x17384e),console[_0x12c16c(0x1da)](_0x12c16c(0x1d3)+_0x4d0afe),_0x16e459&&console[_0x12c16c(0x1da)](_0x12c16c(0x1e3)+_0x42bbde));const _0x43df30=await withSpinner(_0x12c16c(0x1d7)+_0x17384e+_0x12c16c(0x1ec),()=>_0x242946[_0x12c16c(0x1e9)][_0x12c16c(0x184)](_0x17384e),{'verbose':_0x3c0b61[_0x12c16c(0x172)]}),_0x5e4a86=_0x43df30[_0x12c16c(0x1df)],{parentSegmentResult:_0x19cbdf,segmentsResult:_0x275fce,foldersResult:_0x4b6cae,journeysWithDetailsResult:_0x46fd62,userMaps:_0x5cd9c5}=await withSpinner(_0x12c16c(0x1f1),async()=>{const _0x29ba14=_0x12c16c,[_0x34803b,_0x7adb3b,_0x268acb,_0x449cc1,_0x5e3df4]=await Promise[_0x29ba14(0x1a9)]([_0x242946[_0x29ba14(0x1e9)][_0x29ba14(0x1c7)](_0x5e4a86),_0x242946['segment'][_0x29ba14(0x1aa)](_0x5e4a86),_0x242946['segment'][_0x29ba14(0x1a6)](_0x5e4a86),_0x242946[_0x29ba14(0x1b1)][_0x29ba14(0x1d5)](_0x5e4a86,{'includeAllVersions':!![]}),_0x242946['user'][_0x29ba14(0x1c1)]()]);return{'parentSegmentResult':_0x34803b,'segmentsResult':_0x7adb3b,'foldersResult':_0x268acb,'journeysWithDetailsResult':_0x449cc1,'userMaps':_0x5e3df4};},{'verbose':_0x3c0b61[_0x12c16c(0x172)]})['then'](_0x110f13=>_0x110f13[_0x12c16c(0x1df)]),_0x44c6f8=_0x19cbdf,_0x429d29=extractRootFolderId(_0x44c6f8),_0x31e4cc=_0x275fce,_0x264a13=_0x4b6cae,{journeys:_0x45991d,activationStepsById:_0x92b039}=_0x46fd62,_0xd4102c=new Map(_0x45991d[_0x12c16c(0x208)](_0x566103=>[_0x566103['id'],_0x566103])),_0x285bfc=_0x45991d[_0x12c16c(0x208)](_0x142e32=>({'id':_0x142e32['id'],'name':_0x142e32['attributes'][_0x12c16c(0x1ed)],'journeyBundleName':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x175)]||'','journeyBundleId':_0x142e32[_0x12c16c(0x1db)]['journeyBundleId']||'','versionNumber':_0x142e32[_0x12c16c(0x1db)]['versionNumber'],'description':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1b7)],'state':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x188)],'paused':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1f6)],'audienceId':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1ff)],'folderId':_0x142e32['relationships']?.[_0x12c16c(0x195)]?.[_0x12c16c(0x1df)]?.['id'],'createdAt':_0x142e32[_0x12c16c(0x1db)]['createdAt'],'updatedAt':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1d6)]})),{emailToId:_0x243ccf,idToEmail:_0x3a3d39}=_0x5cd9c5,_0x299c6c=await withSpinner(_0x12c16c(0x1e5),async()=>{const _0x49201f=_0x12c16c,_0x45ac94=await _0x242946[_0x49201f(0x177)][_0x49201f(0x20b)]();return buildConnectionMaps(_0x45ac94);},{'verbose':_0x3c0b61[_0x12c16c(0x172)]})[_0x12c16c(0x1af)](_0x469a74=>_0x469a74['data']),_0x14882d=_0x299c6c['nameToId'],_0x4a12c5=_0x299c6c[_0x12c16c(0x173)],_0x376967=_0x299c6c['nameToType'],_0x536c7a={'emailToIdMap':_0x243ccf,'connectionNameToIdMap':_0x14882d,'connectionNameToTypeMap':_0x376967,'getSchema':_0x797aa=>_0x242946[_0x12c16c(0x177)][_0x12c16c(0x17e)](_0x797aa)};let {pathToId:_0x351ae4,idToPath:_0x20102c}=buildFolderMaps(_0x264a13);const _0x3bbe67=buildSegmentLookupMap(_0x31e4cc,_0x20102c),_0x343767=buildSegmentNameToIdMap(_0x31e4cc),_0xdee0fd=buildJourneyBundleLookupMap(_0x285bfc,_0x20102c);let _0x589f50;if(_0x1c1441){if(!_0x1c1441[_0x12c16c(0x1c0)]('.yml')&&!_0x1c1441[_0x12c16c(0x1c0)](_0x12c16c(0x1a5)))return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1c1441+'\x0a')),0x1;_0x589f50=[_0x1c1441];}else _0x589f50=findYamlFiles(_0x4d0afe);if(_0x589f50['length']===0x0)return console['error'](a41_0x520b0c['red'](_0x12c16c(0x17d)+_0x4d0afe+'\x0a')),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1f7)](_0x12c16c(0x190))),0x1;let _0x3d97f4,_0x12d174;try{const _0x143eec=parseAndClassifyYamlFiles(_0x589f50,_0x4d0afe,{'skipSegments':_0x3c0b61[_0x12c16c(0x1c3)]});_0x3d97f4=_0x143eec['segments'],_0x12d174=_0x143eec[_0x12c16c(0x1f2)];const _0x34e878=validateParsedFiles(_0x143eec,_0x4d0afe);if(_0x34e878[_0x12c16c(0x1dc)]>0x0)return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1d4))),console[_0x12c16c(0x1da)](formatValidationErrors(_0x34e878)),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x174))),0x1;}catch(_0x5bf0f8){return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x185)+(_0x5bf0f8 instanceof Error?_0x5bf0f8['message']:_0x5bf0f8))),0x1;}if(_0x3d97f4[_0x12c16c(0x1dc)]===0x0&&_0x12d174['length']===0x0){const _0x7e2438=_0x3c0b61[_0x12c16c(0x1c3)]?_0x12c16c(0x1b1):_0x12c16c(0x1cc);return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x202)+_0x7e2438+_0x12c16c(0x18f))),0x0;}const _0x1db030=new Map();_0x31e4cc['length']>0x0&&!_0x3c0b61['journeysOnly']&&await withSpinner(_0x12c16c(0x1fa),async()=>{await batchAsync(_0x31e4cc,async _0x3a7de5=>{const _0x3b19c3=a41_0x2522,_0x5a845f=await _0x242946[_0x3b19c3(0x1e9)][_0x3b19c3(0x1e6)](_0x5e4a86,_0x3a7de5['id']);_0x1db030[_0x3b19c3(0x1c6)](_0x3a7de5['id'],_0x5a845f);});},{'verbose':_0x3c0b61[_0x12c16c(0x172)]});const {segmentFiles:_0xc90404,foldersToCreate:_0x149597}=await prepareSegmentFiles(_0x3d97f4,{'segmentByFolderAndName':_0x3bbe67,'activationsBySegmentId':_0x1db030,'folderPathToId':_0x351ae4,'idToEmailMap':_0x3a3d39,'connectionIdToNameMap':_0x4a12c5},_0x536c7a,_0x16e459,_0x42bbde),_0x11a3a7=_0x1c1441?[]:findSegmentsToDelete(_0x31e4cc,_0x3d97f4[_0x12c16c(0x208)](({yamlConfig:_0x39eae2,folderPath:_0x42109e})=>({'yamlConfig':_0x39eae2,'folderPath':resolveTDFolderPath(_0x42109e,_0x16e459,_0x42bbde)})),_0x20102c,_0x42bbde,_0x16e459),{journeyFiles:_0x6b5901,foldersToCreate:_0x276e9c}=await withProgressSpinner(_0x12c16c(0x1b2),async _0xe68b13=>prepareJourneyFiles(_0x12d174,{'fetchJourney':async _0x18d5c9=>_0x242946[_0x12c16c(0x1b1)]['getJourney'](_0x18d5c9[_0x12c16c(0x1ab)]),'journeyBundlesByFolderAndName':_0xdee0fd,'folderPathToId':_0x351ae4,'idToEmailMap':_0x3a3d39,'connectionIdToNameMap':_0x4a12c5,'existingSegments':_0x31e4cc,'parentId':_0x5e4a86,'deps':_0x242946,'progress':{'update':_0x5849ff=>{const _0x20ec2d=_0x12c16c;_0xe68b13[_0x20ec2d(0x1ad)](_0x5849ff),_0x3c0b61['verbose']&&console[_0x20ec2d(0x1da)]('\x20\x20'+_0x5849ff);}},'journeyById':_0xd4102c,'activationStepsById':_0x92b039},_0x16e459,_0x42bbde),{'verbose':_0x3c0b61['verbose']})[_0x12c16c(0x1af)](_0xc00c45=>_0xc00c45['data']);for(const _0x1afaca of _0x276e9c){_0x149597[_0x12c16c(0x1fd)](_0x1afaca);}const _0x37cfd9=_0x1c1441?[]:findJourneysToDelete(_0x285bfc,_0x12d174[_0x12c16c(0x208)](({yamlConfig:_0x1c4ff1,folderPath:_0x5cb1af})=>({'yamlConfig':_0x1c4ff1,'folderPath':resolveTDFolderPath(_0x5cb1af,_0x16e459,_0x42bbde)})),_0x20102c,_0x42bbde,_0x16e459),_0x2300b2=calculatePushStats(_0xc90404,_0x6b5901,_0x149597,_0x11a3a7,_0x37cfd9,!!_0x3c0b61[_0x12c16c(0x183)],!!_0x3c0b61['journeysOnly']),_0x419a38=_0x2300b2[_0x12c16c(0x170)][_0x12c16c(0x1eb)],_0x58b830=_0x2300b2['segments']['changed'],_0x4015b3=_0x2300b2[_0x12c16c(0x170)]['unchanged'],_0x2aea5c=_0x2300b2[_0x12c16c(0x170)][_0x12c16c(0x1bd)],_0x537f19=_0x2300b2[_0x12c16c(0x1ee)][_0x12c16c(0x1f0)],_0x24e526=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x1eb)],_0x142280=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x1ba)],_0x475e69=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x204)],_0x5cfe6b=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x1bd)],_0x30500f=_0x2300b2[_0x12c16c(0x19f)][_0x12c16c(0x1a9)],_0x46e332=_0x2300b2[_0x12c16c(0x19f)]['toCreate'],_0x1ce0cb=_0x2300b2[_0x12c16c(0x19f)][_0x12c16c(0x192)],_0x1a1d0c=_0x2300b2[_0x12c16c(0x19f)][_0x12c16c(0x1bd)];console[_0x12c16c(0x1da)](_0x12c16c(0x1c2)+_0x17384e+'\x27:');_0x537f19[_0x12c16c(0x1dc)]>0x0&&console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c[_0x12c16c(0x1fb)]('📁\x20'+_0x537f19['length']+'\x20folders\x20to\x20create'));if(!_0x3c0b61['journeysOnly']){console[_0x12c16c(0x1da)](_0x12c16c(0x186)),console['error'](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1d8)]('+\x20'+_0x419a38[_0x12c16c(0x1dc)]+_0x12c16c(0x178))),console[_0x12c16c(0x1da)]('\x20\x20\x20\x20'+a41_0x520b0c[_0x12c16c(0x1bf)]('~\x20'+_0x58b830[_0x12c16c(0x1dc)]+_0x12c16c(0x17a)));if(_0x2aea5c['length']>0x0)console['error'](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x16f)]('-\x20'+_0x2aea5c[_0x12c16c(0x1dc)]+_0x12c16c(0x206)));else _0x11a3a7[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x183)]&&console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c['dim'](_0x11a3a7['length']+_0x12c16c(0x1bc)));console['error'](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1b9)]('=\x20'+_0x4015b3['length']+'\x20unchanged'));}if(_0x6b5901[_0x12c16c(0x1dc)]>0x0||_0x37cfd9[_0x12c16c(0x1dc)]>0x0){console[_0x12c16c(0x1da)](_0x12c16c(0x1c5)),console['error'](_0x12c16c(0x18d)+a41_0x520b0c['green']('+\x20'+_0x24e526[_0x12c16c(0x1dc)]+'\x20new')),console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1bf)]('~\x20'+_0x142280['length']+_0x12c16c(0x17a)));if(_0x5cfe6b[_0x12c16c(0x1dc)]>0x0)console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c['red']('-\x20'+_0x5cfe6b[_0x12c16c(0x1dc)]+_0x12c16c(0x206)));else _0x37cfd9[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61['delete']&&console[_0x12c16c(0x1da)]('\x20\x20\x20\x20'+a41_0x520b0c[_0x12c16c(0x1b9)](_0x37cfd9[_0x12c16c(0x1dc)]+_0x12c16c(0x1bc)));console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1b9)]('=\x20'+_0x475e69[_0x12c16c(0x1dc)]+_0x12c16c(0x1c8)));}_0x30500f['length']>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)]&&(console[_0x12c16c(0x1da)](''),console[_0x12c16c(0x1da)]('\x20\x20Activations:'),_0x46e332[_0x12c16c(0x1dc)]>0x0&&console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1d8)]('+\x20'+_0x46e332[_0x12c16c(0x1dc)]+_0x12c16c(0x210))),_0x1ce0cb[_0x12c16c(0x1dc)]>0x0&&console['error'](_0x12c16c(0x18d)+a41_0x520b0c['yellow']('~\x20'+_0x1ce0cb[_0x12c16c(0x1dc)]+_0x12c16c(0x211))),_0x1a1d0c[_0x12c16c(0x1dc)]>0x0&&console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c['red']('-\x20'+_0x1a1d0c[_0x12c16c(0x1dc)]+_0x12c16c(0x206))));console[_0x12c16c(0x1da)](_0x12c16c(0x1b4)+a41_0x520b0c[_0x12c16c(0x1f7)](_0x4d0afe)+'\x0a');if(_0x537f19[_0x12c16c(0x1dc)]>0x0){console[_0x12c16c(0x1da)](_0x12c16c(0x1e4));for(const _0x1259c0 of _0x537f19){console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c[_0x12c16c(0x1fb)]('+')+'\x20'+_0x1259c0);}console[_0x12c16c(0x1da)]('');}if(_0x419a38[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)])for(const _0x548ea1 of _0x419a38){const _0x2aa0d2=_0x548ea1[_0x12c16c(0x1a3)]?_0x548ea1[_0x12c16c(0x1a3)]+'/'+_0x548ea1[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x548ea1[_0x12c16c(0x189)]['name'],_0x29033e=_0x548ea1[_0x12c16c(0x189)]['activations']?.[_0x12c16c(0x1dc)]||0x0,_0x154196=_0x29033e>0x0?a41_0x520b0c[_0x12c16c(0x1b9)]('\x20['+_0x29033e+_0x12c16c(0x1ae)):'';console['error']('\x0a'+a41_0x520b0c['green'](_0x12c16c(0x179))+'\x20'+_0x2aa0d2+_0x154196),console['error']('─'[_0x12c16c(0x181)](0x3c)),_0x548ea1[_0x12c16c(0x18b)]&&console[_0x12c16c(0x1da)](_0x548ea1[_0x12c16c(0x18b)]),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}if(_0x2aea5c[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)])for(const _0xd76162 of _0x2aea5c){const _0x10d100=_0xd76162[_0x12c16c(0x1cb)]?_0x20102c[_0x12c16c(0x1f4)](_0xd76162[_0x12c16c(0x1cb)][_0x12c16c(0x1e7)]())||'':'',_0x4c7aa5=_0x10d100?_0x10d100+'/'+_0xd76162[_0x12c16c(0x1ed)]:_0xd76162[_0x12c16c(0x1ed)],_0x5224b9=_0x1db030[_0x12c16c(0x1f4)](_0xd76162['id'])||[],_0x2a0dac=_0x5224b9[_0x12c16c(0x1dc)]>0x0?a41_0x520b0c['dim']('\x20['+_0x5224b9[_0x12c16c(0x1dc)]+_0x12c16c(0x1ae)):'';console['error']('\x0a'+a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x199))+'\x20'+_0x4c7aa5+_0x2a0dac),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));const _0x4bceaf=segmentWithActivationsToYaml(_0xd76162,_0x5224b9,undefined,_0x3a3d39,_0x4a12c5),_0x280d72=segmentToYamlString(_0x4bceaf),_0x2163b2=generateDiff(_0x280d72,'');console['error'](formatDiffWithColors(_0x2163b2)),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}const _0x364d3c=_0xc90404['filter'](_0x33808c=>!_0x33808c[_0x12c16c(0x1bb)]&&_0x33808c[_0x12c16c(0x18b)]);if(_0x364d3c[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61['journeysOnly'])for(const _0x1739c3 of _0x364d3c){const _0x10f220=_0x1739c3['folderPath']?_0x1739c3['folderPath']+'/'+_0x1739c3[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x1739c3['yamlConfig'][_0x12c16c(0x1ed)];console[_0x12c16c(0x1da)]('\x0a'+a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x1fe))+'\x20'+_0x10f220),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c)),console[_0x12c16c(0x1da)](_0x1739c3[_0x12c16c(0x18b)]),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}if(_0x24e526[_0x12c16c(0x1dc)]>0x0)for(const _0x4f7ad4 of _0x24e526){const _0xea66fc=_0x4f7ad4[_0x12c16c(0x1a3)]?_0x4f7ad4[_0x12c16c(0x1a3)]+'/'+_0x4f7ad4[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x4f7ad4[_0x12c16c(0x189)][_0x12c16c(0x1ed)];console['error']('\x0a'+a41_0x520b0c[_0x12c16c(0x1d8)](_0x12c16c(0x1a8))+'\x20'+_0xea66fc),console[_0x12c16c(0x1da)]('─'['repeat'](0x3c)),_0x4f7ad4[_0x12c16c(0x18b)]&&console[_0x12c16c(0x1da)](_0x4f7ad4['diff']),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}const _0x47baa9=_0x6b5901['filter'](_0x323d72=>!_0x323d72[_0x12c16c(0x1bb)]&&_0x323d72[_0x12c16c(0x18b)]);if(_0x47baa9[_0x12c16c(0x1dc)]>0x0)for(const _0x378aaf of _0x47baa9){const _0x5672be=_0x378aaf[_0x12c16c(0x1a3)]?_0x378aaf[_0x12c16c(0x1a3)]+'/'+_0x378aaf[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x378aaf[_0x12c16c(0x189)][_0x12c16c(0x1ed)];console['error']('\x0a'+a41_0x520b0c['yellow'](_0x12c16c(0x1b8))+'\x20'+_0x5672be),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c)),console[_0x12c16c(0x1da)](_0x378aaf[_0x12c16c(0x18b)]),console['error']('─'[_0x12c16c(0x181)](0x3c));}if(_0x5cfe6b[_0x12c16c(0x1dc)]>0x0)for(const _0x48a4bc of _0x5cfe6b){const _0x1ba6fb=_0x48a4bc[_0x12c16c(0x176)]?_0x20102c[_0x12c16c(0x1f4)](_0x48a4bc['folderId'])||'':'',_0x525602=_0x1ba6fb?_0x1ba6fb+'/'+_0x48a4bc[_0x12c16c(0x175)]:_0x48a4bc[_0x12c16c(0x175)];console['error']('\x0a'+a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x20f))+'\x20'+_0x525602),console['error']('─'[_0x12c16c(0x181)](0x3c)),console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1dd))),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}if(_0x3c0b61[_0x12c16c(0x171)])return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x1f8))),0x0;const _0x5274a7=_0x3c0b61[_0x12c16c(0x1c3)]?![]:_0x419a38[_0x12c16c(0x1dc)]>0x0||_0x58b830[_0x12c16c(0x1dc)]>0x0||_0x2aea5c['length']>0x0,_0x1c1322=_0x24e526[_0x12c16c(0x1dc)]>0x0||_0x142280['length']>0x0||_0x5cfe6b['length']>0x0,_0x2b71c6=_0x3c0b61[_0x12c16c(0x1c3)]?![]:_0x30500f[_0x12c16c(0x1dc)]>0x0,_0xd87fca=_0x537f19[_0x12c16c(0x1dc)]>0x0;if(!_0x5274a7&&!_0x1c1322&&!_0x2b71c6&&!_0xd87fca){const _0x428120=_0x3c0b61[_0x12c16c(0x1c3)]?_0x12c16c(0x201):_0x12c16c(0x20e);console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1d8)](_0x428120));if(_0x1c1441&&_0x4015b3[_0x12c16c(0x1dc)]===0x1){const _0x3643a7=_0x4015b3[0x0];if(_0x3643a7[_0x12c16c(0x19c)]?.['id']){const _0x4f3479=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],_0x12c16c(0x1b5)+_0x5e4a86+_0x12c16c(0x1a1)+_0x3643a7[_0x12c16c(0x19c)]['id']+_0x12c16c(0x182));console[_0x12c16c(0x1da)](_0x12c16c(0x1b6)+a41_0x520b0c[_0x12c16c(0x1f7)](_0x4f3479));}}if(_0x1c1441&&_0x475e69[_0x12c16c(0x1dc)]===0x1){const _0x625342=_0x475e69[0x0];if(_0x625342[_0x12c16c(0x1a7)]?.['id']){const _0x463daf=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],_0x12c16c(0x1b5)+_0x5e4a86+_0x12c16c(0x1a1)+_0x625342[_0x12c16c(0x1a7)]['id']+_0x12c16c(0x1b3));console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c['cyan'](_0x463daf));}}return 0x0;}const _0x596c4f=_0x3c0b61[_0x12c16c(0x1c3)]?_0x24e526['length']+_0x142280[_0x12c16c(0x1dc)]+_0x5cfe6b[_0x12c16c(0x1dc)]+_0x537f19[_0x12c16c(0x1dc)]:_0x419a38[_0x12c16c(0x1dc)]+_0x58b830[_0x12c16c(0x1dc)]+_0x2aea5c[_0x12c16c(0x1dc)]+_0x24e526['length']+_0x142280[_0x12c16c(0x1dc)]+_0x5cfe6b[_0x12c16c(0x1dc)]+_0x537f19[_0x12c16c(0x1dc)]+_0x30500f[_0x12c16c(0x1dc)];if(!_0x3c0b61[_0x12c16c(0x1be)]&&_0x596c4f>0x0){if(!isInteractive())return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1de)),_0x12c16c(0x1ea)),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1b9)](_0x12c16c(0x1a0))),0x1;const _0x4b9c5a=await confirmKey('Push\x20'+_0x596c4f+'\x20changes?');if(!_0x4b9c5a)return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x180))),0x1;}const _0x205360={'withProgress':async(_0x347441,_0x1d327e)=>{const _0x4f16e=_0x12c16c,_0x3bdda3=await withSpinner(_0x347441,_0x1d327e,{'verbose':_0x3c0b61[_0x4f16e(0x172)]});return{'data':_0x3bdda3[_0x4f16e(0x1df)]};},'logInfo':_0x6265f4=>console['error'](a41_0x520b0c[_0x12c16c(0x1fb)]('✔\x20'+_0x6265f4)),'logSuccess':_0x556391=>console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1d8)]('✔\x20'+_0x556391)),'logWarning':_0x495ffd=>console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)]('⚠\x20'+_0x495ffd)),'logDeleted':_0x3fec25=>console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)]('✔\x20'+_0x3fec25))},_0x23f93a={'segment':_0x242946[_0x12c16c(0x1e9)],'journey':_0x242946[_0x12c16c(0x1b1)],'user':_0x242946[_0x12c16c(0x1a4)],'connection':_0x242946['connection']};_0x537f19['length']>0x0&&(_0x351ae4=await executePushFolders(_0x23f93a,_0x537f19,_0x351ae4,{'parentId':_0x5e4a86},_0x205360));const _0x50d9e3={'rootFolderId':_0x429d29,'folderPathToId':_0x351ae4,'folderIdToPath':_0x20102c,'segmentNameToId':_0x343767,'activationsBySegmentId':_0x1db030,'emailToIdMap':_0x243ccf,'idToEmailMap':_0x3a3d39,'connectionNameToIdMap':_0x299c6c[_0x12c16c(0x19b)],'connectionIdToNameMap':_0x299c6c['idToName'],'connectionNameToTypeMap':_0x376967},_0x470939=await executePushSegments(_0x23f93a,_0x3c0b61[_0x12c16c(0x1c3)]?[]:_0xc90404,_0x50d9e3,{'parentId':_0x5e4a86},_0x205360),_0x3e9f7e=_0x470939[_0x12c16c(0x20d)],_0x145e84=_0x470939[_0x12c16c(0x198)],_0x4fa6f5=_0x470939[_0x12c16c(0x19f)]['created'],_0x4bf6d7=_0x470939[_0x12c16c(0x19f)][_0x12c16c(0x198)],_0x58ee5c=_0x470939[_0x12c16c(0x19f)][_0x12c16c(0x1e8)];let _0x365296;if(_0x1c1441&&_0xc90404['length']===0x1){const _0x152962=_0xc90404[0x0];_0x365296=_0x152962[_0x12c16c(0x19c)]?.['id']??_0x470939[_0x12c16c(0x1a2)][_0x12c16c(0x1f4)](_0x152962[_0x12c16c(0x189)]['name']);}const _0x52914f=await executePushSegmentDeletions(_0x23f93a,_0x3c0b61[_0x12c16c(0x1c3)]?[]:_0x2aea5c,_0x205360);let _0x5c7cc2=0x0,_0x110590=0x0,_0x3677a4=0x0;const _0x4c1300=new Map(_0x343767);for(const [_0x2075d0,_0x41d00d]of _0x470939[_0x12c16c(0x1a2)]){_0x4c1300[_0x12c16c(0x1c6)](_0x2075d0,_0x41d00d);}if(_0x6b5901[_0x12c16c(0x1dc)]>0x0){const _0x262688={..._0x50d9e3,'segmentNameToId':_0x4c1300,'existingSegments':_0x31e4cc,'activationContext':_0x536c7a},_0x47c8b3=await executePushJourneys(_0x23f93a,_0x6b5901,_0x262688,{'parentId':_0x5e4a86,'rootFolderId':_0x429d29,'verbose':_0x3c0b61['verbose']},_0x205360);_0x5c7cc2=_0x47c8b3[_0x12c16c(0x20d)],_0x110590=_0x47c8b3[_0x12c16c(0x198)];if(_0x1c1441&&_0x47c8b3['results'][_0x12c16c(0x1dc)]===0x1){const _0x24bc33=_0x47c8b3[_0x12c16c(0x207)][0x0];if(_0x24bc33[_0x12c16c(0x1ab)]){const _0x4f7617=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],_0x12c16c(0x1b5)+_0x5e4a86+'/e/'+_0x24bc33[_0x12c16c(0x1ab)]+_0x12c16c(0x1b3));console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c['cyan'](_0x4f7617));}}}for(const _0x309ac3 of _0x5cfe6b){console[_0x12c16c(0x1da)](a41_0x520b0c['yellow'](_0x12c16c(0x187)+_0x309ac3[_0x12c16c(0x175)])),_0x3677a4++;}const _0x309d87=[];if(_0x3e9f7e>0x0)_0x309d87[_0x12c16c(0x1d2)](_0x3e9f7e+_0x12c16c(0x196));if(_0x145e84>0x0)_0x309d87[_0x12c16c(0x1d2)](_0x145e84+_0x12c16c(0x17c));if(_0x52914f>0x0)_0x309d87['push'](_0x52914f+'\x20deleted');const _0x5bc7d8=[];if(_0x5c7cc2>0x0)_0x5bc7d8[_0x12c16c(0x1d2)](_0x5c7cc2+_0x12c16c(0x196));if(_0x110590>0x0)_0x5bc7d8[_0x12c16c(0x1d2)](_0x110590+_0x12c16c(0x17c));if(_0x3677a4>0x0)_0x5bc7d8[_0x12c16c(0x1d2)](_0x3677a4+_0x12c16c(0x1ce));const _0x1cb9e4=[];if(_0x4fa6f5>0x0)_0x1cb9e4['push'](_0x4fa6f5+_0x12c16c(0x196));if(_0x4bf6d7>0x0)_0x1cb9e4[_0x12c16c(0x1d2)](_0x4bf6d7+_0x12c16c(0x17c));if(_0x58ee5c>0x0)_0x1cb9e4[_0x12c16c(0x1d2)](_0x58ee5c+_0x12c16c(0x1ce));console[_0x12c16c(0x1da)](a41_0x520b0c['green'](_0x12c16c(0x1f5)));_0x309d87[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61['journeysOnly']&&console[_0x12c16c(0x1da)]('\x20\x20Segments:\x20'+_0x309d87[_0x12c16c(0x1b0)](',\x20'));_0x5bc7d8[_0x12c16c(0x1dc)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x5bc7d8['join'](',\x20'));_0x1cb9e4[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)]&&console[_0x12c16c(0x1da)](_0x12c16c(0x200)+_0x1cb9e4[_0x12c16c(0x1b0)](',\x20'));if(_0x365296){const _0x2d77b7=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],'/app/ps/'+_0x5e4a86+_0x12c16c(0x1a1)+_0x365296+_0x12c16c(0x182));console['error'](_0x12c16c(0x1b6)+a41_0x520b0c[_0x12c16c(0x1f7)](_0x2d77b7));}return 0x0;}}
|
|
1
|
+
const a41_0x4491ab=a41_0x4e8e;(function(_0x291a87,_0x231c4c){const _0xff7f1f=a41_0x4e8e,_0x3498a8=_0x291a87();while(!![]){try{const _0x2fc4a9=-parseInt(_0xff7f1f(0x20f))/0x1+-parseInt(_0xff7f1f(0x223))/0x2*(parseInt(_0xff7f1f(0x1df))/0x3)+parseInt(_0xff7f1f(0x258))/0x4+-parseInt(_0xff7f1f(0x1d9))/0x5*(-parseInt(_0xff7f1f(0x227))/0x6)+parseInt(_0xff7f1f(0x232))/0x7+parseInt(_0xff7f1f(0x256))/0x8+-parseInt(_0xff7f1f(0x1e0))/0x9;if(_0x2fc4a9===_0x231c4c)break;else _0x3498a8['push'](_0x3498a8['shift']());}catch(_0x106baa){_0x3498a8['push'](_0x3498a8['shift']());}}}(a41_0x463c,0x76dd0));import{BaseCommand}from'./command.js';function a41_0x463c(){const _0x5599cc=['Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','created','folderId','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Scoped\x20to\x20folder:\x20','endsWith','filter','data','description','Error:\x20','targetDir','\x20created','parentSegment','\x20changed','Resolving\x20parent\x20segment\x20\x27','yamlConfig','attributes','existingSegment','journeysOnly','journeyBundleName','/e/','createdSegmentIds','repeat','add','get','Changes\x20to\x20journey:','deleted','journeys','parentFolder','.yaml','419312tCYrZc','diff','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segment:push','folderPath','connection','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','unchanged','/app/ps/','📁\x20','execute','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','toUpdate','list','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','all','then','Fetching\x20existing\x20activations...','Folders\x20to\x20create:','existingJourney','6316LgnUqz','\x20deleted','Error:\x20Directory\x20not\x20found:\x20','dryRun','102DzeMEv','new','name','/j/da/je','segments','\x20updated','Fetching\x20existing\x20data...','versionNumber','toDelete','segment','audienceId','4693857OuLWtE','folders','site','user','listActivations','idToName','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','activations','\x0aValidation\x20failed:','(Journey\x20will\x20be\x20deleted)','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','.yml','\x0a✔\x20Push\x20complete','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','delete','listJourneysWithDetailsFromParentSegment','\x20to\x20update','journeyId','getOutputSchemaWithCache','nameToType','set','state','\x20\x20\x20\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20to\x20delete','Aborted.','\x20new','journeyBundleId','red','yellow','\x20YAML\x20files\x20found','error','New\x20segment:','type','nameToId','toCreate','724984KWCOkH','Delete\x20segment:','1708620FPBOyh','map','cyan','/sb/da/esr','segmentFolderId','updated','changed','setPhase','push','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Parent\x20segment:\x20','join','file','createdAt','green','Changes\x20to:','Push\x20','errorCode','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','message','\x20\x20Activations:','parent_name','dim','109415lRcTLO','isScoped','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','length','\x20\x20Activations:\x20','paused','420vtNhlc','1908396guZvtf','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','getJourney','\x20\x20📊\x20Segments:','\x20unchanged','resolveParentId','blue','verbose','filePath','helpText','relationships','Site:\x20','isNew','journey','toString','listSegments','listFolders'];a41_0x463c=function(){return _0x5599cc;};return a41_0x463c();}import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x46fc59 from'chalk';function a41_0x4e8e(_0x40459b,_0x4e5d4c){_0x40459b=_0x40459b-0x1d3;const _0x463cb0=a41_0x463c();let _0x4e8e2b=_0x463cb0[_0x40459b];return _0x4e8e2b;}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{[a41_0x4491ab(0x229)]=a41_0x4491ab(0x212);[a41_0x4491ab(0x1f9)]=a41_0x4491ab(0x1f4);async[a41_0x4491ab(0x219)](_0x11fb34){const _0x28cbf7=a41_0x4491ab,{options:_0x11a60e,args:_0x1e6f4e,tdx:_0x5bef7a}=_0x11fb34,_0x9b0375=_0x11a60e,_0x4716a4=await resolveTarget({'arg':_0x1e6f4e[0x0],'contextParent':_0x11a60e[_0x28cbf7(0x1fd)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x4716a4))return _0x4716a4[_0x28cbf7(0x1d3)]==='no_parent'?(console[_0x28cbf7(0x251)](a41_0x46fc59['yellow'](_0x28cbf7(0x215))),console[_0x28cbf7(0x251)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error'](_0x28cbf7(0x23c)),console['error']('\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[_0x28cbf7(0x251)](a41_0x46fc59['red'](_0x28cbf7(0x1fa)+_0x4716a4[_0x28cbf7(0x1d5)]+'\x0a')),_0x4716a4[_0x28cbf7(0x1e9)]&&console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x25a)](_0x4716a4['helpText']))),0x1;if(_0x4716a4[_0x28cbf7(0x253)]===_0x28cbf7(0x1d7))return console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24e)](_0x28cbf7(0x225)+_0x4716a4['targetDir']+'\x0a')),console['error'](a41_0x46fc59[_0x28cbf7(0x25a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x3c5720=_0x4716a4['parentName'],_0x47f69a=_0x4716a4[_0x28cbf7(0x1fb)],_0x4f2ac1=_0x4716a4[_0x28cbf7(0x253)]===_0x28cbf7(0x264)?_0x4716a4[_0x28cbf7(0x1e8)]:undefined,_0x1f3325=getScopedDetails(_0x4716a4),_0x2212c8=_0x1f3325?.[_0x28cbf7(0x1da)]??![],_0x598ad2=_0x1f3325?.['scopedFolderPath']??'';if(!existsSync(_0x47f69a))return console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24e)](_0x28cbf7(0x225)+_0x47f69a+'\x0a')),console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x25a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x9b0375['verbose']&&(console[_0x28cbf7(0x251)](_0x28cbf7(0x1eb)+_0x9b0375[_0x28cbf7(0x234)]),console[_0x28cbf7(0x251)](_0x28cbf7(0x262)+_0x3c5720),console['error']('Source\x20directory:\x20'+_0x47f69a),_0x2212c8&&console[_0x28cbf7(0x251)](_0x28cbf7(0x1f5)+_0x598ad2));const _0x36b955=await withSpinner(_0x28cbf7(0x1ff)+_0x3c5720+'\x27...',()=>_0x5bef7a[_0x28cbf7(0x230)][_0x28cbf7(0x1e5)](_0x3c5720),{'verbose':_0x9b0375[_0x28cbf7(0x1e7)]}),_0x5d7710=_0x36b955[_0x28cbf7(0x1f8)],{parentSegmentResult:_0x51c51a,segmentsResult:_0x3d98d6,foldersResult:_0x2fdc22,journeysWithDetailsResult:_0x269078,userMaps:_0x363391}=await withSpinner(_0x28cbf7(0x22d),async()=>{const _0x5f4329=_0x28cbf7,[_0x48842c,_0x26bb24,_0x167697,_0x1aa8bb,_0x267c3a]=await Promise[_0x5f4329(0x21e)]([_0x5bef7a[_0x5f4329(0x230)]['getParent'](_0x5d7710),_0x5bef7a[_0x5f4329(0x230)][_0x5f4329(0x1ef)](_0x5d7710),_0x5bef7a['segment'][_0x5f4329(0x1f0)](_0x5d7710),_0x5bef7a[_0x5f4329(0x1ed)][_0x5f4329(0x241)](_0x5d7710,{'includeAllVersions':!![]}),_0x5bef7a[_0x5f4329(0x235)]['buildUserMaps']()]);return{'parentSegmentResult':_0x48842c,'segmentsResult':_0x26bb24,'foldersResult':_0x167697,'journeysWithDetailsResult':_0x1aa8bb,'userMaps':_0x267c3a};},{'verbose':_0x9b0375[_0x28cbf7(0x1e7)]})[_0x28cbf7(0x21f)](_0xa59d34=>_0xa59d34['data']),_0x37364c=_0x51c51a,_0x14713b=extractRootFolderId(_0x37364c),_0x1f9237=_0x3d98d6,_0x2605b2=_0x2fdc22,{journeys:_0x3e33af,activationStepsById:_0x1d7141}=_0x269078,_0x492ea1=new Map(_0x3e33af[_0x28cbf7(0x259)](_0x2d4a78=>[_0x2d4a78['id'],_0x2d4a78])),_0xb13528=_0x3e33af[_0x28cbf7(0x259)](_0x1e0ea2=>({'id':_0x1e0ea2['id'],'name':_0x1e0ea2['attributes'][_0x28cbf7(0x229)],'journeyBundleName':_0x1e0ea2[_0x28cbf7(0x201)][_0x28cbf7(0x204)]||'','journeyBundleId':_0x1e0ea2[_0x28cbf7(0x201)][_0x28cbf7(0x24d)]||'','versionNumber':_0x1e0ea2['attributes'][_0x28cbf7(0x22e)],'description':_0x1e0ea2[_0x28cbf7(0x201)]['description'],'state':_0x1e0ea2[_0x28cbf7(0x201)][_0x28cbf7(0x247)],'paused':_0x1e0ea2['attributes'][_0x28cbf7(0x1de)],'audienceId':_0x1e0ea2['attributes'][_0x28cbf7(0x231)],'folderId':_0x1e0ea2[_0x28cbf7(0x1ea)]?.[_0x28cbf7(0x20d)]?.[_0x28cbf7(0x1f8)]?.['id'],'createdAt':_0x1e0ea2[_0x28cbf7(0x201)][_0x28cbf7(0x265)],'updatedAt':_0x1e0ea2[_0x28cbf7(0x201)]['updatedAt']})),{emailToId:_0x25283b,idToEmail:_0x319809}=_0x363391,_0x2ebb65=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x2e89da=_0x28cbf7,_0x4f56cc=await _0x5bef7a[_0x2e89da(0x214)][_0x2e89da(0x21c)]();return buildConnectionMaps(_0x4f56cc);},{'verbose':_0x9b0375[_0x28cbf7(0x1e7)]})[_0x28cbf7(0x21f)](_0x457ac9=>_0x457ac9['data']),_0x5d865f=_0x2ebb65[_0x28cbf7(0x254)],_0x3297ed=_0x2ebb65[_0x28cbf7(0x237)],_0x2c82a1=_0x2ebb65[_0x28cbf7(0x245)],_0x17c935={'emailToIdMap':_0x25283b,'connectionNameToIdMap':_0x5d865f,'connectionNameToTypeMap':_0x2c82a1,'getSchema':_0x42cff5=>_0x5bef7a['connection'][_0x28cbf7(0x244)](_0x42cff5)};let {pathToId:_0x396ab7,idToPath:_0x40a74e}=buildFolderMaps(_0x2605b2);const _0x50aac2=buildSegmentLookupMap(_0x1f9237,_0x40a74e),_0x1b9240=buildSegmentNameToIdMap(_0x1f9237),_0x1ac331=buildJourneyBundleLookupMap(_0xb13528,_0x40a74e);let _0x413e3d;if(_0x4f2ac1){if(!_0x4f2ac1[_0x28cbf7(0x1f6)](_0x28cbf7(0x23d))&&!_0x4f2ac1[_0x28cbf7(0x1f6)](_0x28cbf7(0x20e)))return console['error'](a41_0x46fc59[_0x28cbf7(0x24e)](_0x28cbf7(0x249)+_0x4f2ac1+'\x0a')),0x1;_0x413e3d=[_0x4f2ac1];}else _0x413e3d=findYamlFiles(_0x47f69a);if(_0x413e3d[_0x28cbf7(0x1dc)]===0x0)return console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24e)](_0x28cbf7(0x1d4)+_0x47f69a+'\x0a')),console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x25a)](_0x28cbf7(0x1f1))),0x1;let _0x15291f,_0x58d7e1;try{const _0x1c1e7f=parseAndClassifyYamlFiles(_0x413e3d,_0x47f69a,{'skipSegments':_0x9b0375[_0x28cbf7(0x203)]});_0x15291f=_0x1c1e7f['segments'],_0x58d7e1=_0x1c1e7f[_0x28cbf7(0x20c)];const _0x36cf59=validateParsedFiles(_0x1c1e7f,_0x47f69a);if(_0x36cf59[_0x28cbf7(0x1dc)]>0x0)return console[_0x28cbf7(0x251)](a41_0x46fc59['red'](_0x28cbf7(0x23a))),console['error'](formatValidationErrors(_0x36cf59)),console['error'](a41_0x46fc59[_0x28cbf7(0x24f)](_0x28cbf7(0x238))),0x1;}catch(_0x25b821){return console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24e)]('Error\x20parsing\x20YAML:\x20'+(_0x25b821 instanceof Error?_0x25b821['message']:_0x25b821))),0x1;}if(_0x15291f[_0x28cbf7(0x1dc)]===0x0&&_0x58d7e1[_0x28cbf7(0x1dc)]===0x0){const _0x3344d2=_0x9b0375[_0x28cbf7(0x203)]?_0x28cbf7(0x1ed):'segment\x20or\x20journey';return console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24f)]('No\x20'+_0x3344d2+_0x28cbf7(0x250))),0x0;}const _0x3b15c5=new Map();_0x1f9237[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375['journeysOnly']&&await withSpinner(_0x28cbf7(0x220),async()=>{await batchAsync(_0x1f9237,async _0x4e513d=>{const _0x154ec9=a41_0x4e8e,_0x23e492=await _0x5bef7a[_0x154ec9(0x230)][_0x154ec9(0x236)](_0x5d7710,_0x4e513d['id']);_0x3b15c5['set'](_0x4e513d['id'],_0x23e492);});},{'verbose':_0x9b0375[_0x28cbf7(0x1e7)]});const {segmentFiles:_0x12c4d9,foldersToCreate:_0x4d8d54}=await prepareSegmentFiles(_0x15291f,{'segmentByFolderAndName':_0x50aac2,'activationsBySegmentId':_0x3b15c5,'folderPathToId':_0x396ab7,'idToEmailMap':_0x319809,'connectionIdToNameMap':_0x3297ed},_0x17c935,_0x2212c8,_0x598ad2),_0x3cead4=_0x4f2ac1?[]:findSegmentsToDelete(_0x1f9237,_0x15291f[_0x28cbf7(0x259)](({yamlConfig:_0x3ca79e,folderPath:_0x1f606a})=>({'yamlConfig':_0x3ca79e,'folderPath':resolveTDFolderPath(_0x1f606a,_0x2212c8,_0x598ad2)})),_0x40a74e,_0x598ad2,_0x2212c8),{journeyFiles:_0x30c7fa,foldersToCreate:_0xd6a7d7}=await withProgressSpinner('Preparing\x20journeys...',async _0x1e13a4=>prepareJourneyFiles(_0x58d7e1,{'fetchJourney':async _0x9a7b68=>_0x5bef7a['journey'][_0x28cbf7(0x1e2)](_0x9a7b68[_0x28cbf7(0x243)]),'journeyBundlesByFolderAndName':_0x1ac331,'folderPathToId':_0x396ab7,'idToEmailMap':_0x319809,'connectionIdToNameMap':_0x3297ed,'existingSegments':_0x1f9237,'parentId':_0x5d7710,'deps':_0x5bef7a,'progress':{'update':_0x3bd06a=>{const _0x214f70=_0x28cbf7;_0x1e13a4[_0x214f70(0x25f)](_0x3bd06a),_0x9b0375['verbose']&&console[_0x214f70(0x251)]('\x20\x20'+_0x3bd06a);}},'journeyById':_0x492ea1,'activationStepsById':_0x1d7141},_0x2212c8,_0x598ad2),{'verbose':_0x9b0375[_0x28cbf7(0x1e7)]})[_0x28cbf7(0x21f)](_0x4b267b=>_0x4b267b[_0x28cbf7(0x1f8)]);for(const _0x4bc622 of _0xd6a7d7){_0x4d8d54[_0x28cbf7(0x208)](_0x4bc622);}const _0x52f2fd=_0x4f2ac1?[]:findJourneysToDelete(_0xb13528,_0x58d7e1[_0x28cbf7(0x259)](({yamlConfig:_0x535217,folderPath:_0x1b336e})=>({'yamlConfig':_0x535217,'folderPath':resolveTDFolderPath(_0x1b336e,_0x2212c8,_0x598ad2)})),_0x40a74e,_0x598ad2,_0x2212c8),_0x208ab4=calculatePushStats(_0x12c4d9,_0x30c7fa,_0x4d8d54,_0x3cead4,_0x52f2fd,!!_0x9b0375[_0x28cbf7(0x240)],!!_0x9b0375[_0x28cbf7(0x203)]),_0x41be80=_0x208ab4[_0x28cbf7(0x22b)][_0x28cbf7(0x228)],_0x20e116=_0x208ab4['segments'][_0x28cbf7(0x25e)],_0x2fc568=_0x208ab4[_0x28cbf7(0x22b)]['unchanged'],_0x3a5f30=_0x208ab4[_0x28cbf7(0x22b)][_0x28cbf7(0x22f)],_0x371043=_0x208ab4[_0x28cbf7(0x233)][_0x28cbf7(0x255)],_0x3a8bd7=_0x208ab4['journeys']['new'],_0x1d1325=_0x208ab4[_0x28cbf7(0x20c)][_0x28cbf7(0x25e)],_0x3791bd=_0x208ab4[_0x28cbf7(0x20c)][_0x28cbf7(0x216)],_0x5206be=_0x208ab4[_0x28cbf7(0x20c)][_0x28cbf7(0x22f)],_0x5af43f=_0x208ab4[_0x28cbf7(0x239)][_0x28cbf7(0x21e)],_0x4378a2=_0x208ab4['activations'][_0x28cbf7(0x255)],_0x30f667=_0x208ab4[_0x28cbf7(0x239)][_0x28cbf7(0x21b)],_0x52a4e3=_0x208ab4[_0x28cbf7(0x239)][_0x28cbf7(0x22f)];console[_0x28cbf7(0x251)]('\x0aPush\x20summary\x20for\x20\x27'+_0x3c5720+'\x27:');_0x371043[_0x28cbf7(0x1dc)]>0x0&&console['error']('\x20\x20'+a41_0x46fc59[_0x28cbf7(0x1e6)](_0x28cbf7(0x218)+_0x371043[_0x28cbf7(0x1dc)]+'\x20folders\x20to\x20create'));if(!_0x9b0375['journeysOnly']){console[_0x28cbf7(0x251)](_0x28cbf7(0x1e3)),console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x266)]('+\x20'+_0x41be80[_0x28cbf7(0x1dc)]+'\x20new')),console['error'](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x24f)]('~\x20'+_0x20e116[_0x28cbf7(0x1dc)]+_0x28cbf7(0x1fe)));if(_0x3a5f30[_0x28cbf7(0x1dc)]>0x0)console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x24e)]('-\x20'+_0x3a5f30[_0x28cbf7(0x1dc)]+_0x28cbf7(0x24a)));else _0x3cead4['length']>0x0&&!_0x9b0375[_0x28cbf7(0x240)]&&console[_0x28cbf7(0x251)]('\x20\x20\x20\x20'+a41_0x46fc59['dim'](_0x3cead4[_0x28cbf7(0x1dc)]+_0x28cbf7(0x211)));console[_0x28cbf7(0x251)]('\x20\x20\x20\x20'+a41_0x46fc59[_0x28cbf7(0x1d8)]('=\x20'+_0x2fc568[_0x28cbf7(0x1dc)]+_0x28cbf7(0x1e4)));}if(_0x30c7fa['length']>0x0||_0x52f2fd[_0x28cbf7(0x1dc)]>0x0){console[_0x28cbf7(0x251)]('\x20\x20🗺️\x20\x20Journeys:'),console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x266)]('+\x20'+_0x3a8bd7[_0x28cbf7(0x1dc)]+_0x28cbf7(0x24c))),console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x24f)]('~\x20'+_0x1d1325[_0x28cbf7(0x1dc)]+_0x28cbf7(0x1fe)));if(_0x5206be[_0x28cbf7(0x1dc)]>0x0)console['error'](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x24e)]('-\x20'+_0x5206be['length']+_0x28cbf7(0x24a)));else _0x52f2fd[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375[_0x28cbf7(0x240)]&&console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59[_0x28cbf7(0x1d8)](_0x52f2fd[_0x28cbf7(0x1dc)]+_0x28cbf7(0x211)));console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59['dim']('=\x20'+_0x3791bd[_0x28cbf7(0x1dc)]+_0x28cbf7(0x1e4)));}_0x5af43f[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375[_0x28cbf7(0x203)]&&(console[_0x28cbf7(0x251)](''),console[_0x28cbf7(0x251)](_0x28cbf7(0x1d6)),_0x4378a2[_0x28cbf7(0x1dc)]>0x0&&console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59['green']('+\x20'+_0x4378a2[_0x28cbf7(0x1dc)]+'\x20to\x20create')),_0x30f667['length']>0x0&&console[_0x28cbf7(0x251)]('\x20\x20\x20\x20'+a41_0x46fc59['yellow']('~\x20'+_0x30f667['length']+_0x28cbf7(0x242))),_0x52a4e3[_0x28cbf7(0x1dc)]>0x0&&console[_0x28cbf7(0x251)](_0x28cbf7(0x248)+a41_0x46fc59['red']('-\x20'+_0x52a4e3[_0x28cbf7(0x1dc)]+_0x28cbf7(0x24a))));console[_0x28cbf7(0x251)]('\x20\x20Source:\x20'+a41_0x46fc59[_0x28cbf7(0x25a)](_0x47f69a)+'\x0a');if(_0x371043['length']>0x0){console[_0x28cbf7(0x251)](_0x28cbf7(0x221));for(const _0x5e629f of _0x371043){console[_0x28cbf7(0x251)]('\x20\x20'+a41_0x46fc59['blue']('+')+'\x20'+_0x5e629f);}console['error']('');}if(_0x41be80[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375[_0x28cbf7(0x203)])for(const _0x67edc6 of _0x41be80){const _0x36ae6e=_0x67edc6['folderPath']?_0x67edc6[_0x28cbf7(0x213)]+'/'+_0x67edc6[_0x28cbf7(0x200)][_0x28cbf7(0x229)]:_0x67edc6['yamlConfig'][_0x28cbf7(0x229)],_0x36ff8e=_0x67edc6[_0x28cbf7(0x200)]['activations']?.[_0x28cbf7(0x1dc)]||0x0,_0x48f1d0=_0x36ff8e>0x0?a41_0x46fc59['dim']('\x20['+_0x36ff8e+'\x20activations]'):'';console[_0x28cbf7(0x251)]('\x0a'+a41_0x46fc59[_0x28cbf7(0x266)](_0x28cbf7(0x252))+'\x20'+_0x36ae6e+_0x48f1d0),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c)),_0x67edc6['diff']&&console[_0x28cbf7(0x251)](_0x67edc6[_0x28cbf7(0x210)]),console['error']('─'[_0x28cbf7(0x207)](0x3c));}if(_0x3a5f30[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375[_0x28cbf7(0x203)])for(const _0x4ae1eb of _0x3a5f30){const _0x4746a0=_0x4ae1eb[_0x28cbf7(0x25c)]?_0x40a74e[_0x28cbf7(0x209)](_0x4ae1eb[_0x28cbf7(0x25c)][_0x28cbf7(0x1ee)]())||'':'',_0x51b994=_0x4746a0?_0x4746a0+'/'+_0x4ae1eb[_0x28cbf7(0x229)]:_0x4ae1eb[_0x28cbf7(0x229)],_0x381d7f=_0x3b15c5['get'](_0x4ae1eb['id'])||[],_0x47f2c8=_0x381d7f[_0x28cbf7(0x1dc)]>0x0?a41_0x46fc59[_0x28cbf7(0x1d8)]('\x20['+_0x381d7f[_0x28cbf7(0x1dc)]+'\x20activations]'):'';console[_0x28cbf7(0x251)]('\x0a'+a41_0x46fc59['red'](_0x28cbf7(0x257))+'\x20'+_0x51b994+_0x47f2c8),console['error']('─'['repeat'](0x3c));const _0x55f2ea=segmentWithActivationsToYaml(_0x4ae1eb,_0x381d7f,undefined,_0x319809,_0x3297ed),_0x3b9b2a=segmentToYamlString(_0x55f2ea),_0x1632e0=generateDiff(_0x3b9b2a,'');console[_0x28cbf7(0x251)](formatDiffWithColors(_0x1632e0)),console[_0x28cbf7(0x251)]('─'['repeat'](0x3c));}const _0x31ab96=_0x12c4d9[_0x28cbf7(0x1f7)](_0xd3541b=>!_0xd3541b[_0x28cbf7(0x1ec)]&&_0xd3541b[_0x28cbf7(0x210)]);if(_0x31ab96[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375[_0x28cbf7(0x203)])for(const _0x5c2ff3 of _0x31ab96){const _0x4835bc=_0x5c2ff3['folderPath']?_0x5c2ff3['folderPath']+'/'+_0x5c2ff3[_0x28cbf7(0x200)][_0x28cbf7(0x229)]:_0x5c2ff3[_0x28cbf7(0x200)]['name'];console['error']('\x0a'+a41_0x46fc59['yellow'](_0x28cbf7(0x267))+'\x20'+_0x4835bc),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c)),console[_0x28cbf7(0x251)](_0x5c2ff3[_0x28cbf7(0x210)]),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c));}if(_0x3a8bd7['length']>0x0)for(const _0x372b6b of _0x3a8bd7){const _0xc40da0=_0x372b6b['folderPath']?_0x372b6b['folderPath']+'/'+_0x372b6b['yamlConfig'][_0x28cbf7(0x229)]:_0x372b6b[_0x28cbf7(0x200)][_0x28cbf7(0x229)];console[_0x28cbf7(0x251)]('\x0a'+a41_0x46fc59[_0x28cbf7(0x266)]('New\x20journey:')+'\x20'+_0xc40da0),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c)),_0x372b6b['diff']&&console['error'](_0x372b6b[_0x28cbf7(0x210)]),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c));}const _0x40e96f=_0x30c7fa[_0x28cbf7(0x1f7)](_0xc16820=>!_0xc16820[_0x28cbf7(0x1ec)]&&_0xc16820[_0x28cbf7(0x210)]);if(_0x40e96f['length']>0x0)for(const _0x3a0cc4 of _0x40e96f){const _0x21d327=_0x3a0cc4['folderPath']?_0x3a0cc4['folderPath']+'/'+_0x3a0cc4['yamlConfig'][_0x28cbf7(0x229)]:_0x3a0cc4['yamlConfig'][_0x28cbf7(0x229)];console[_0x28cbf7(0x251)]('\x0a'+a41_0x46fc59['yellow'](_0x28cbf7(0x20a))+'\x20'+_0x21d327),console[_0x28cbf7(0x251)]('─'['repeat'](0x3c)),console[_0x28cbf7(0x251)](_0x3a0cc4[_0x28cbf7(0x210)]),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c));}if(_0x5206be[_0x28cbf7(0x1dc)]>0x0)for(const _0x5ba162 of _0x5206be){const _0x562369=_0x5ba162[_0x28cbf7(0x1f3)]?_0x40a74e[_0x28cbf7(0x209)](_0x5ba162['folderId'])||'':'',_0x187bf4=_0x562369?_0x562369+'/'+_0x5ba162[_0x28cbf7(0x204)]:_0x5ba162[_0x28cbf7(0x204)];console['error']('\x0a'+a41_0x46fc59[_0x28cbf7(0x24e)]('Delete\x20journey:')+'\x20'+_0x187bf4),console[_0x28cbf7(0x251)]('─'['repeat'](0x3c)),console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24e)](_0x28cbf7(0x23b))),console[_0x28cbf7(0x251)]('─'[_0x28cbf7(0x207)](0x3c));}if(_0x9b0375[_0x28cbf7(0x226)])return console['error'](a41_0x46fc59[_0x28cbf7(0x24f)](_0x28cbf7(0x23f))),0x0;const _0x2a2ebe=_0x9b0375[_0x28cbf7(0x203)]?![]:_0x41be80['length']>0x0||_0x20e116['length']>0x0||_0x3a5f30[_0x28cbf7(0x1dc)]>0x0,_0x284f3f=_0x3a8bd7[_0x28cbf7(0x1dc)]>0x0||_0x1d1325[_0x28cbf7(0x1dc)]>0x0||_0x5206be[_0x28cbf7(0x1dc)]>0x0,_0x436c8a=_0x9b0375[_0x28cbf7(0x203)]?![]:_0x5af43f[_0x28cbf7(0x1dc)]>0x0,_0x22eea1=_0x371043['length']>0x0;if(!_0x2a2ebe&&!_0x284f3f&&!_0x436c8a&&!_0x22eea1){const _0x49c41e=_0x9b0375[_0x28cbf7(0x203)]?_0x28cbf7(0x1db):_0x28cbf7(0x261);console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x266)](_0x49c41e));if(_0x4f2ac1&&_0x2fc568[_0x28cbf7(0x1dc)]===0x1){const _0x2e720e=_0x2fc568[0x0];if(_0x2e720e['existingSegment']?.['id']){const _0x2b130f=getConsoleNextUrl(_0x9b0375['site'],_0x28cbf7(0x217)+_0x5d7710+_0x28cbf7(0x205)+_0x2e720e[_0x28cbf7(0x202)]['id']+_0x28cbf7(0x25b));console['error'](_0x28cbf7(0x1e1)+a41_0x46fc59[_0x28cbf7(0x25a)](_0x2b130f));}}if(_0x4f2ac1&&_0x3791bd[_0x28cbf7(0x1dc)]===0x1){const _0x15a964=_0x3791bd[0x0];if(_0x15a964['existingJourney']?.['id']){const _0x461e29=getConsoleNextUrl(_0x9b0375['site'],_0x28cbf7(0x217)+_0x5d7710+'/e/'+_0x15a964[_0x28cbf7(0x222)]['id']+_0x28cbf7(0x22a));console['error']('\x20\x20'+a41_0x46fc59[_0x28cbf7(0x25a)](_0x461e29));}}return 0x0;}const _0x4ad48d=_0x9b0375[_0x28cbf7(0x203)]?_0x3a8bd7['length']+_0x1d1325['length']+_0x5206be['length']+_0x371043[_0x28cbf7(0x1dc)]:_0x41be80['length']+_0x20e116[_0x28cbf7(0x1dc)]+_0x3a5f30[_0x28cbf7(0x1dc)]+_0x3a8bd7['length']+_0x1d1325[_0x28cbf7(0x1dc)]+_0x5206be[_0x28cbf7(0x1dc)]+_0x371043[_0x28cbf7(0x1dc)]+_0x5af43f[_0x28cbf7(0x1dc)];if(!_0x9b0375['yes']&&_0x4ad48d>0x0){if(!isInteractive())return console[_0x28cbf7(0x251)](a41_0x46fc59['red']('\x0aError:'),_0x28cbf7(0x21d)),console[_0x28cbf7(0x251)](a41_0x46fc59['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0xefd14b=await confirmKey(_0x28cbf7(0x268)+_0x4ad48d+'\x20changes?');if(!_0xefd14b)return console[_0x28cbf7(0x251)](a41_0x46fc59['yellow'](_0x28cbf7(0x24b))),0x1;}const _0x2739a7={'withProgress':async(_0x5542e4,_0x16c4f5)=>{const _0x28d435=_0x28cbf7,_0x21c531=await withSpinner(_0x5542e4,_0x16c4f5,{'verbose':_0x9b0375[_0x28d435(0x1e7)]});return{'data':_0x21c531[_0x28d435(0x1f8)]};},'logInfo':_0x3454ea=>console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x1e6)]('✔\x20'+_0x3454ea)),'logSuccess':_0x5129ab=>console[_0x28cbf7(0x251)](a41_0x46fc59['green']('✔\x20'+_0x5129ab)),'logWarning':_0x2994b7=>console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24f)]('⚠\x20'+_0x2994b7)),'logDeleted':_0x410ea9=>console['error'](a41_0x46fc59[_0x28cbf7(0x24e)]('✔\x20'+_0x410ea9))},_0x4bb8a4={'segment':_0x5bef7a[_0x28cbf7(0x230)],'journey':_0x5bef7a[_0x28cbf7(0x1ed)],'user':_0x5bef7a['user'],'connection':_0x5bef7a[_0x28cbf7(0x214)]};_0x371043[_0x28cbf7(0x1dc)]>0x0&&(_0x396ab7=await executePushFolders(_0x4bb8a4,_0x371043,_0x396ab7,{'parentId':_0x5d7710},_0x2739a7));const _0x2a3633={'rootFolderId':_0x14713b,'folderPathToId':_0x396ab7,'folderIdToPath':_0x40a74e,'segmentNameToId':_0x1b9240,'activationsBySegmentId':_0x3b15c5,'emailToIdMap':_0x25283b,'idToEmailMap':_0x319809,'connectionNameToIdMap':_0x2ebb65[_0x28cbf7(0x254)],'connectionIdToNameMap':_0x2ebb65[_0x28cbf7(0x237)],'connectionNameToTypeMap':_0x2c82a1},_0x8d4c52=await executePushSegments(_0x4bb8a4,_0x9b0375[_0x28cbf7(0x203)]?[]:_0x12c4d9,_0x2a3633,{'parentId':_0x5d7710},_0x2739a7),_0xaf272d=_0x8d4c52[_0x28cbf7(0x1f2)],_0x406a49=_0x8d4c52['updated'],_0x5f5b0a=_0x8d4c52[_0x28cbf7(0x239)][_0x28cbf7(0x1f2)],_0x5324b2=_0x8d4c52['activations'][_0x28cbf7(0x25d)],_0x948af9=_0x8d4c52[_0x28cbf7(0x239)][_0x28cbf7(0x20b)];let _0x52af73;if(_0x4f2ac1&&_0x12c4d9['length']===0x1){const _0x5c45f1=_0x12c4d9[0x0];_0x52af73=_0x5c45f1[_0x28cbf7(0x202)]?.['id']??_0x8d4c52[_0x28cbf7(0x206)][_0x28cbf7(0x209)](_0x5c45f1[_0x28cbf7(0x200)][_0x28cbf7(0x229)]);}const _0x293764=await executePushSegmentDeletions(_0x4bb8a4,_0x9b0375[_0x28cbf7(0x203)]?[]:_0x3a5f30,_0x2739a7);let _0x3d2aa7=0x0,_0x35fbcb=0x0,_0x5b7a35=0x0;const _0x45a119=new Map(_0x1b9240);for(const [_0x281e66,_0x15dc8c]of _0x8d4c52[_0x28cbf7(0x206)]){_0x45a119[_0x28cbf7(0x246)](_0x281e66,_0x15dc8c);}if(_0x30c7fa[_0x28cbf7(0x1dc)]>0x0){const _0x52b251={..._0x2a3633,'segmentNameToId':_0x45a119,'existingSegments':_0x1f9237,'activationContext':_0x17c935},_0x434fc8=await executePushJourneys(_0x4bb8a4,_0x30c7fa,_0x52b251,{'parentId':_0x5d7710,'rootFolderId':_0x14713b,'verbose':_0x9b0375[_0x28cbf7(0x1e7)]},_0x2739a7);_0x3d2aa7=_0x434fc8['created'],_0x35fbcb=_0x434fc8[_0x28cbf7(0x25d)];if(_0x4f2ac1&&_0x434fc8['results'][_0x28cbf7(0x1dc)]===0x1){const _0x41d325=_0x434fc8['results'][0x0];if(_0x41d325['journeyId']){const _0x1709da=getConsoleNextUrl(_0x9b0375['site'],_0x28cbf7(0x217)+_0x5d7710+_0x28cbf7(0x205)+_0x41d325[_0x28cbf7(0x243)]+_0x28cbf7(0x22a));console[_0x28cbf7(0x251)]('\x20\x20'+a41_0x46fc59[_0x28cbf7(0x25a)](_0x1709da));}}}for(const _0x5b714c of _0x5206be){console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x24f)](_0x28cbf7(0x21a)+_0x5b714c[_0x28cbf7(0x204)])),_0x5b7a35++;}const _0x6d4f84=[];if(_0xaf272d>0x0)_0x6d4f84['push'](_0xaf272d+_0x28cbf7(0x1fc));if(_0x406a49>0x0)_0x6d4f84[_0x28cbf7(0x260)](_0x406a49+_0x28cbf7(0x22c));if(_0x293764>0x0)_0x6d4f84[_0x28cbf7(0x260)](_0x293764+_0x28cbf7(0x224));const _0xc8eb61=[];if(_0x3d2aa7>0x0)_0xc8eb61[_0x28cbf7(0x260)](_0x3d2aa7+_0x28cbf7(0x1fc));if(_0x35fbcb>0x0)_0xc8eb61[_0x28cbf7(0x260)](_0x35fbcb+_0x28cbf7(0x22c));if(_0x5b7a35>0x0)_0xc8eb61[_0x28cbf7(0x260)](_0x5b7a35+_0x28cbf7(0x224));const _0x177ea2=[];if(_0x5f5b0a>0x0)_0x177ea2[_0x28cbf7(0x260)](_0x5f5b0a+'\x20created');if(_0x5324b2>0x0)_0x177ea2[_0x28cbf7(0x260)](_0x5324b2+'\x20updated');if(_0x948af9>0x0)_0x177ea2[_0x28cbf7(0x260)](_0x948af9+_0x28cbf7(0x224));console[_0x28cbf7(0x251)](a41_0x46fc59[_0x28cbf7(0x266)](_0x28cbf7(0x23e)));_0x6d4f84['length']>0x0&&!_0x9b0375[_0x28cbf7(0x203)]&&console['error']('\x20\x20Segments:\x20'+_0x6d4f84[_0x28cbf7(0x263)](',\x20'));_0xc8eb61[_0x28cbf7(0x1dc)]>0x0&&console[_0x28cbf7(0x251)]('\x20\x20Journeys:\x20'+_0xc8eb61[_0x28cbf7(0x263)](',\x20'));_0x177ea2[_0x28cbf7(0x1dc)]>0x0&&!_0x9b0375['journeysOnly']&&console['error'](_0x28cbf7(0x1dd)+_0x177ea2['join'](',\x20'));if(_0x52af73){const _0x112add=getConsoleNextUrl(_0x9b0375[_0x28cbf7(0x234)],_0x28cbf7(0x217)+_0x5d7710+_0x28cbf7(0x205)+_0x52af73+_0x28cbf7(0x25b));console[_0x28cbf7(0x251)](_0x28cbf7(0x1e1)+a41_0x46fc59[_0x28cbf7(0x25a)](_0x112add));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x3cc1c0=a42_0x8ca3;(function(_0xfab12e,_0x1edd47){const _0x290243=a42_0x8ca3,_0x5f1012=_0xfab12e();while(!![]){try{const _0x220292=-parseInt(_0x290243(0x1cc))/0x1*(parseInt(_0x290243(0x1ad))/0x2)+-parseInt(_0x290243(0x1c5))/0x3+parseInt(_0x290243(0x1ac))/0x4*(parseInt(_0x290243(0x1d6))/0x5)+parseInt(_0x290243(0x1c0))/0x6*(-parseInt(_0x290243(0x1d3))/0x7)+parseInt(_0x290243(0x1bc))/0x8*(-parseInt(_0x290243(0x1d7))/0x9)+-parseInt(_0x290243(0x1bb))/0xa+parseInt(_0x290243(0x1cf))/0xb;if(_0x220292===_0x1edd47)break;else _0x5f1012['push'](_0x5f1012['shift']());}catch(_0x1b7c14){_0x5f1012['push'](_0x5f1012['shift']());}}}(a42_0x48f8,0xda8f2));function a42_0x48f8(){const _0x285fc6=['\x20\x20\x20Path:\x20','61360585GrmbCb','name','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','resolveFolderId','21UeGOSR','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','description','80MUaeah','48771TkCrap','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','rule','170792xpGeoW','19736aMjvFU','Resolving\x20folder\x20\x27','parentId','segmentName','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','folder','Resolved\x20relative\x20path\x20to:\x20','Segment\x20ID:\x20','kind','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','verbose','Resolved\x20folder\x20ID:\x20','includes','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','16534410AIszlO','2128EsnCFj','Examples:','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x27...','1206438pjteDp','✔\x20Updated\x20segment\x20\x27','segment:update','type','resolvePathToResource','2458269kJheUm','Parent\x20ID:\x20','data','error','yellow','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','86DsMFOa','segment'];a42_0x48f8=function(){return _0x285fc6;};return a42_0x48f8();}function a42_0x8ca3(_0x2b14bb,_0x3fd89c){_0x2b14bb=_0x2b14bb-0x1ac;const _0x48f89c=a42_0x48f8();let _0x8ca3bb=_0x48f89c[_0x2b14bb];return _0x8ca3bb;}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0xb71434 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x3cc1c0(0x1d0)]=a42_0x3cc1c0(0x1c2);[a42_0x3cc1c0(0x1d5)]='Update\x20existing\x20child\x20segment';async['execute'](_0x1dbb07){const _0x42ac7c=a42_0x3cc1c0;console[_0x42ac7c(0x1c8)](a42_0xb71434[_0x42ac7c(0x1c9)](_0x42ac7c(0x1ba))),console['error'](a42_0xb71434[_0x42ac7c(0x1c9)](_0x42ac7c(0x1d4)));const {options:_0x678954,args:_0x1153e2,tdx:_0x457422}=_0x1dbb07,_0x2522ce=_0x678954;if(_0x1153e2['length']===0x0)return console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1b1)),console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1be)),console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1bd)),console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1d1)),console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1d8)),0x1;const _0x4380a6=_0x1153e2[0x0],_0x5c2bf6=_0x678954['segmentPath'];let _0x1ae354=_0x4380a6;_0x5c2bf6&&!_0x4380a6[_0x42ac7c(0x1b9)]('/')&&(_0x1ae354=_0x5c2bf6+'/'+_0x4380a6,_0x2522ce[_0x42ac7c(0x1b7)]&&console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1b3)+_0x1ae354));const _0x211db9=await withSpinner(_0x42ac7c(0x1cb)+_0x1ae354+_0x42ac7c(0x1bf),()=>_0x457422[_0x42ac7c(0x1cd)][_0x42ac7c(0x1c4)](_0x1ae354),{'verbose':_0x2522ce[_0x42ac7c(0x1b7)]}),_0x973a85=_0x211db9[_0x42ac7c(0x1c7)];_0x2522ce[_0x42ac7c(0x1b7)]&&console[_0x42ac7c(0x1c8)]('Resolved\x20type:\x20'+_0x973a85['type']);if(_0x973a85[_0x42ac7c(0x1c3)]!=='segment')return console[_0x42ac7c(0x1c8)]('Error:\x20Cannot\x20update\x20'+_0x973a85[_0x42ac7c(0x1c3)]+_0x42ac7c(0x1b6)),console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1ca)),0x1;if(!_0x973a85['segmentId'])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4145d0=_0x973a85[_0x42ac7c(0x1af)],_0x458c20=_0x973a85['segmentId'];_0x2522ce['verbose']&&(console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1c6)+_0x4145d0),console['error'](_0x42ac7c(0x1b4)+_0x458c20));let _0x5f1a1b;if(_0x2522ce[_0x42ac7c(0x1b2)]){const _0x540b0d=_0x2522ce['folder'],_0x4801cb=await withSpinner(_0x42ac7c(0x1ae)+_0x540b0d+_0x42ac7c(0x1bf),()=>_0x457422[_0x42ac7c(0x1cd)][_0x42ac7c(0x1d2)](_0x4145d0,_0x540b0d),{'verbose':_0x2522ce[_0x42ac7c(0x1b7)]});_0x5f1a1b=parseInt(_0x4801cb[_0x42ac7c(0x1c7)],0xa),_0x2522ce['verbose']&&console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1b8)+_0x5f1a1b);}const _0x2c1d4a=await loadJSONFromOptions(_0x2522ce[_0x42ac7c(0x1d9)],_0x2522ce['ruleFile']),_0x4ce54b={'name':_0x2522ce[_0x42ac7c(0x1d0)],'description':_0x2522ce[_0x42ac7c(0x1d5)],'rule':_0x2c1d4a,'kind':_0x2522ce[_0x42ac7c(0x1b5)]!==undefined?parseInt(_0x2522ce['kind'],0xa):undefined,'segmentFolderId':_0x5f1a1b},_0x3a3f37=await withSpinner('Updating\x20segment\x20\x27'+_0x973a85[_0x42ac7c(0x1b0)]+_0x42ac7c(0x1bf),()=>_0x457422[_0x42ac7c(0x1cd)]['updateSegmentById'](_0x4145d0,_0x458c20,_0x4ce54b),{'verbose':_0x2522ce[_0x42ac7c(0x1b7)]}),_0x42eea0=_0x3a3f37[_0x42ac7c(0x1c7)];return console['error'](_0x42ac7c(0x1c1)+_0x42eea0[_0x42ac7c(0x1d0)]+'\x27'),_0x1ae354!==_0x4380a6&&console[_0x42ac7c(0x1c8)](_0x42ac7c(0x1ce)+_0x1ae354),await handleSDKOutput([_0x42eea0],_0x2522ce),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x53103e=a43_0x36d6;(function(_0x55fe25,_0x1ff374){const _0x19439d=a43_0x36d6,_0x476133=_0x55fe25();while(!![]){try{const _0x50669f=parseInt(_0x19439d(0x212))/0x1+parseInt(_0x19439d(0x20e))/0x2+parseInt(_0x19439d(0x220))/0x3+parseInt(_0x19439d(0x223))/0x4+parseInt(_0x19439d(0x21a))/0x5*(-parseInt(_0x19439d(0x20f))/0x6)+parseInt(_0x19439d(0x22c))/0x7*(-parseInt(_0x19439d(0x1f8))/0x8)+-parseInt(_0x19439d(0x200))/0x9*(-parseInt(_0x19439d(0x202))/0xa);if(_0x50669f===_0x1ff374)break;else _0x476133['push'](_0x476133['shift']());}catch(_0x150d1e){_0x476133['push'](_0x476133['shift']());}}}(a43_0x3b01,0x8ea45));import{existsSync,statSync}from'fs';import a43_0x1ff959 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a43_0x36d6(_0x39073f,_0x127b92){_0x39073f=_0x39073f-0x1f3;const _0x3b01b7=a43_0x3b01();let _0x36d6a0=_0x3b01b7[_0x39073f];return _0x36d6a0;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a43_0x3b01(){const _0x54bd09=['\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','Examples:','type','7XBTXQw','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','execute','parent_segment','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Resolved\x20relative\x20path\x20to:\x20','fullPath','description','parentName','✔\x20Context\x20set\x20to:\x20','Site:\x20','3500896uQESXn','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Target\x20path:\x20','error','\x27...','site','join','green','45JcFhwW','dim','1605790bgEGCd','cyan','verbose','name','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','split','segmentPath','Resolving\x20path\x20\x27','session','length','Use:\x20tdx\x20segment\x20use\x20','segment:use','3128GJlVGw','3147510UgNoKs','segment','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','96658plVyYO','parentId','isAbsolute','data','log','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','5XWKLwK','Error:\x20Path\x20is\x20required\x0a','folderPath','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Usage:\x20tdx\x20segment\x20use\x20<path>','144978vtchne','slice','folderId','2388060eyEIXC','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','isDirectory','red','segments'];a43_0x3b01=function(){return _0x54bd09;};return a43_0x3b01();}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x53103e(0x205)]=a43_0x53103e(0x20d);[a43_0x53103e(0x1f4)]=a43_0x53103e(0x211);async[a43_0x53103e(0x22e)](_0x2f09c1){const _0x50319c=a43_0x53103e,{options:_0x5bf790,args:_0x5d7690,tdx:_0x4bf7c7}=_0x2f09c1;if(_0x5d7690['length']===0x0)return console['error'](a43_0x1ff959[_0x50319c(0x226)](_0x50319c(0x21b))),console[_0x50319c(0x1fb)](_0x50319c(0x21f)),console[_0x50319c(0x1fb)](_0x50319c(0x22a)),console[_0x50319c(0x1fb)](_0x50319c(0x229)),console['error'](_0x50319c(0x228)),console[_0x50319c(0x1fb)](_0x50319c(0x218)),console['error'](_0x50319c(0x219)),0x1;const _0x51113c=_0x5d7690[0x0],_0x11573e=_0x5bf790[_0x50319c(0x20a)];try{if(_0x51113c==='/')return saveSessionContext({'segment_path':undefined},_0x11573e),console[_0x50319c(0x216)](a43_0x1ff959['green']('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x51113c)&&statSync(_0x51113c)[_0x50319c(0x225)]()){let _0x565da0;try{_0x565da0=findTdxConfig(_0x51113c);}catch{return console['error'](a43_0x1ff959[_0x50319c(0x226)](_0x50319c(0x230)+_0x51113c)),console['error'](a43_0x1ff959['cyan'](_0x50319c(0x217))),0x1;}const _0x471371=_0x565da0['config'][_0x50319c(0x22f)];return saveSessionContext({'segment_path':_0x471371,'parent_segment':_0x471371},_0x11573e),console['log'](a43_0x1ff959[_0x50319c(0x1ff)](_0x50319c(0x1f6)+a43_0x1ff959[_0x50319c(0x203)](_0x471371))),0x0;}const _0x1e1628=_0x5bf790[_0x50319c(0x208)];let _0x5c68c6=_0x51113c;const _0x118078=parsePath(_0x51113c);if(!_0x118078[_0x50319c(0x214)]){if(!_0x1e1628)return console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x226)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x203)](_0x50319c(0x1f9))),0x1;if(_0x51113c==='..'){const _0x1fc4fc=_0x1e1628[_0x50319c(0x207)]('/')[_0x50319c(0x221)](0x0,-0x1)[_0x50319c(0x1fe)]('/');_0x5c68c6=_0x1fc4fc||'/';}else _0x51113c==='.'?_0x5c68c6=_0x1e1628:_0x5c68c6=_0x1e1628+'/'+_0x51113c;_0x5bf790['verbose']&&console[_0x50319c(0x1fb)](_0x50319c(0x231)+_0x5c68c6);}if(_0x5c68c6==='/'||_0x5c68c6==='')return saveSessionContext({'segment_path':undefined},_0x11573e),console['log'](a43_0x1ff959[_0x50319c(0x1ff)](_0x50319c(0x21e))),0x0;_0x5c68c6=normalizePath(_0x5c68c6);const _0x572f5e=parsePath(_0x5c68c6)[_0x50319c(0x227)];if(_0x572f5e[_0x50319c(0x20b)]===0x0)return saveSessionContext({'segment_path':undefined},_0x11573e),console['log'](a43_0x1ff959[_0x50319c(0x1ff)](_0x50319c(0x21e))),0x0;_0x5bf790['verbose']&&(console[_0x50319c(0x1fb)](_0x50319c(0x1f7)+_0x5bf790[_0x50319c(0x1fd)]),console['error'](_0x50319c(0x1fa)+_0x5c68c6));const _0x30286d=await withSpinner(_0x50319c(0x209)+_0x5c68c6+_0x50319c(0x1fc),()=>_0x4bf7c7[_0x50319c(0x210)]['resolvePathToResource'](_0x5c68c6),{'verbose':_0x5bf790[_0x50319c(0x204)]}),_0xdc53c7=_0x30286d[_0x50319c(0x215)];_0x5bf790[_0x50319c(0x204)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0xdc53c7['type']),console[_0x50319c(0x1fb)]('Parent\x20ID:\x20'+_0xdc53c7[_0x50319c(0x213)]),_0xdc53c7[_0x50319c(0x222)]&&console['error']('Folder\x20ID:\x20'+_0xdc53c7[_0x50319c(0x222)]));if(_0xdc53c7[_0x50319c(0x22b)]===_0x50319c(0x210))return console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x226)](_0x50319c(0x21d))),console[_0x50319c(0x1fb)](_0x50319c(0x206)),console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x203)](_0x50319c(0x20c)+_0xdc53c7[_0x50319c(0x1f5)]+(_0xdc53c7[_0x50319c(0x21c)]?'/'+_0xdc53c7['folderPath'][_0x50319c(0x1fe)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0xdc53c7[_0x50319c(0x1f3)],'parent_segment':_0xdc53c7['parentName']},_0x11573e),console[_0x50319c(0x216)](a43_0x1ff959[_0x50319c(0x1ff)](_0x50319c(0x1f6)+a43_0x1ff959['cyan'](_0xdc53c7[_0x50319c(0x1f3)]))),_0x5bf790[_0x50319c(0x204)]&&(console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x201)](_0x50319c(0x22d))),console[_0x50319c(0x1fb)](a43_0x1ff959[_0x50319c(0x201)](_0x50319c(0x224)))),0x0;}catch(_0x3e693d){throw _0x3e693d;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x5adbae=a44_0x29ca;(function(_0x839bbd,_0x4c445f){const _0x5179c0=a44_0x29ca,_0x5dbe92=_0x839bbd();while(!![]){try{const _0xcb9aea=-parseInt(_0x5179c0(0x95))/0x1*(parseInt(_0x5179c0(0x8d))/0x2)+parseInt(_0x5179c0(0x89))/0x3+parseInt(_0x5179c0(0x72))/0x4*(parseInt(_0x5179c0(0x9c))/0x5)+parseInt(_0x5179c0(0x85))/0x6+parseInt(_0x5179c0(0x90))/0x7+-parseInt(_0x5179c0(0x93))/0x8+-parseInt(_0x5179c0(0x71))/0x9;if(_0xcb9aea===_0x4c445f)break;else _0x5dbe92['push'](_0x5dbe92['shift']());}catch(_0x2948b0){_0x5dbe92['push'](_0x5dbe92['shift']());}}}(a44_0x15b5,0x61518));function a44_0x29ca(_0x4dde57,_0x4f3f62){_0x4dde57=_0x4dde57-0x6a;const _0x15b51f=a44_0x15b5();let _0x29ca05=_0x15b51f[_0x4dde57];return _0x29ca05;}import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a44_0x15b5(){const _0x5d330a=['warningCount','Validation\x20failed:\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','cyan','Validate\x20segment\x20and\x20journey\x20YAML\x20files','10551429cnEPrq','40DtTkzQ','log','warnings','invalidCount','\x20warning(s)\x20found','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20error(s)','endsWith','no_parent','filePath','file','Error:\x20Directory\x20not\x20found:\x20','yellow','\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','verbose','\x20valid','cwd','Error:\x20','\x20file(s)\x20valid','4196964JzUDOf','execute','helpText','validCount','1215291TugUZF','message','error','.yaml','2IwhrfR','name','length','3450118XWceDB','hasErrors','valid','3112856NDQeUx','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','259321DdWSDa','green','.yml','\x20file(s)\x20with\x20errors,\x20','\x20warning(s)','dim','errorCode','310980aXaAkz','type','segment:validate','):\x20','red'];a44_0x15b5=function(){return _0x5d330a;};return a44_0x15b5();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0xe6f513 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_0x5adbae(0x8e)]=a44_0x5adbae(0x9e);['description']=a44_0x5adbae(0x70);async[a44_0x5adbae(0x86)](_0x4bccb3){const _0x227946=a44_0x5adbae,{options:_0x43356d,args:_0x3c92dc}=_0x4bccb3,_0x44aff3=_0x43356d,_0x4b04cc=await resolveTarget({'arg':_0x3c92dc[0x0],'contextParent':_0x43356d['parentSegment'],'cwd':process[_0x227946(0x82)]()});if(!isSuccessfulResolution(_0x4b04cc))return _0x4b04cc[_0x227946(0x9b)]===_0x227946(0x7a)?(console['error'](a44_0xe6f513[_0x227946(0x7e)](_0x227946(0x77))),console[_0x227946(0x8b)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console[_0x227946(0x8b)](_0x227946(0x7f)),console[_0x227946(0x8b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a44_0xe6f513[_0x227946(0x6b)](_0x227946(0x83)+_0x4b04cc[_0x227946(0x8a)]+'\x0a')),_0x4b04cc[_0x227946(0x87)]&&console[_0x227946(0x8b)](a44_0xe6f513[_0x227946(0x6f)](_0x4b04cc[_0x227946(0x87)]))),0x1;const _0xccabbe=_0x4b04cc['targetDir'],_0x3d3e5f=_0x4b04cc[_0x227946(0x9d)]===_0x227946(0x7c)?_0x4b04cc[_0x227946(0x7b)]:undefined;if(!_0x3d3e5f&&!existsSync(_0xccabbe))return console['error'](a44_0xe6f513[_0x227946(0x6b)](_0x227946(0x7d)+_0xccabbe+'\x0a')),0x1;let _0x25f279;if(_0x3d3e5f){if(!_0x3d3e5f[_0x227946(0x79)](_0x227946(0x97))&&!_0x3d3e5f[_0x227946(0x79)](_0x227946(0x8c)))return console['error'](a44_0xe6f513[_0x227946(0x6b)](_0x227946(0x94)+_0x3d3e5f+'\x0a')),0x1;_0x25f279=[_0x3d3e5f];}else _0x25f279=findYamlFiles(_0xccabbe);if(_0x25f279[_0x227946(0x8f)]===0x0)return console[_0x227946(0x8b)](a44_0xe6f513['red'](_0x227946(0x6e)+_0xccabbe+'\x0a')),0x1;const _0x5f20b4=validateYamlFiles(_0x25f279,_0xccabbe),_0x300cfc=calculateSummary(_0x5f20b4);for(const _0x4ccfc6 of _0x5f20b4){if(!isValidationResult(_0x4ccfc6))continue;const {relativePath:_0x3440c6,source:_0x170269,result:_0x325181,fileType:_0x2ace35}=_0x4ccfc6,_0x44f434=_0x2ace35;if(_0x325181[_0x227946(0x92)]&&_0x325181['warnings'][_0x227946(0x8f)]===0x0)_0x44aff3[_0x227946(0x80)]&&console['log'](a44_0xe6f513['green']('✔\x20'+_0x3440c6)+a44_0xe6f513[_0x227946(0x9a)]('\x20('+_0x44f434+')'));else _0x325181['valid']?(console['log'](a44_0xe6f513['yellow']('⚠\x20'+_0x3440c6)+a44_0xe6f513[_0x227946(0x9a)]('\x20('+_0x44f434+'):\x20'+_0x325181[_0x227946(0x74)][_0x227946(0x8f)]+_0x227946(0x99))),console[_0x227946(0x73)](formatValidationResult(_0x325181,_0x170269,_0x3440c6))):(console[_0x227946(0x73)](a44_0xe6f513[_0x227946(0x6b)]('✖\x20'+_0x3440c6)+a44_0xe6f513[_0x227946(0x9a)]('\x20('+_0x44f434+_0x227946(0x6a)+_0x325181['errors'][_0x227946(0x8f)]+_0x227946(0x78))),console['log'](formatValidationResult(_0x325181,_0x170269,_0x3440c6)));}return console[_0x227946(0x73)](''),_0x300cfc[_0x227946(0x91)]?(console['log'](a44_0xe6f513[_0x227946(0x6b)](_0x227946(0x6d)+_0x300cfc[_0x227946(0x75)]+_0x227946(0x98)+_0x300cfc[_0x227946(0x88)]+_0x227946(0x81))),_0x300cfc[_0x227946(0x6c)]>0x0&&console[_0x227946(0x73)](a44_0xe6f513['yellow'](_0x300cfc[_0x227946(0x6c)]+_0x227946(0x76))),0x1):(console[_0x227946(0x73)](a44_0xe6f513[_0x227946(0x96)]('✔\x20All\x20'+_0x300cfc['validCount']+_0x227946(0x84))),_0x300cfc[_0x227946(0x6c)]>0x0&&console[_0x227946(0x73)](a44_0xe6f513[_0x227946(0x7e)](_0x300cfc['warningCount']+_0x227946(0x76))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a45_0x221655=a45_0x73c3;function a45_0x3edc(){const _0x2da613=['\x20folder','json','data','message','listUnifiedWithJourneys','Folder\x20ID:\x20','8076580pgkBra','List\x20folders\x20and\x20child\x20segments','description','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','1MQIyug','sort','Resolving\x20parent\x20segment\x20\x27','6ZfSbEQ','map','Error:\x20No\x20parent\x20segment\x20context\x20set.','✔\x20Built\x20tree\x20with\x20','log','\x27...','children','replace','240zwoybU','Resolving\x20path\x20\x27','2407294smLcGj','length','parentId','60JbZexk','segments','Listing\x20folders,\x20segments,\x20and\x20journeys...','recursive','type','parentSegment','folderId','journeyBundleName','Building\x20hierarchy\x20tree...','name','folder','includes','filter','listWithPattern','folders','\x20matching\x20\x27',',\x20and\x20','jsonl','3084714keoiAY','✔\x20Found\x20','(not\x20set)','localeCompare','\x5c$&','Set\x20a\x20parent\x20segment\x20context\x20first:','Site:\x20','\x20segment','472900qlfWFJ','/app/ps/','Error:\x20','Parent\x20ID:\x20','test','resolvePathToResource','verbose','437022ubNUuj','/j/da','19271043YQCEBk','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','journeys','/e/','No\x20items\x20match\x20pattern:\x20','error','site','listUnified','maxDepth',']\x20matching\x20\x27','journey','dim','5043794XODpqn','listRecursive','format','Folder/pattern\x20arg:\x20','(empty)','segment','\x20\x20Cause:\x20','cause','\x20journey'];a45_0x3edc=function(){return _0x2da613;};return a45_0x3edc();}(function(_0x5b7af5,_0x3a9bf1){const _0xadd9f3=a45_0x73c3,_0x1f2fc2=_0x5b7af5();while(!![]){try{const _0x2bd0ce=-parseInt(_0xadd9f3(0x161))/0x1*(parseInt(_0xadd9f3(0x11c))/0x2)+parseInt(_0xadd9f3(0x131))/0x3+-parseInt(_0xadd9f3(0x139))/0x4*(-parseInt(_0xadd9f3(0x11f))/0x5)+-parseInt(_0xadd9f3(0x164))/0x6*(-parseInt(_0xadd9f3(0x14e))/0x7)+-parseInt(_0xadd9f3(0x11a))/0x8*(-parseInt(_0xadd9f3(0x140))/0x9)+-parseInt(_0xadd9f3(0x15d))/0xa+-parseInt(_0xadd9f3(0x142))/0xb;if(_0x2bd0ce===_0x3a9bf1)break;else _0x1f2fc2['push'](_0x1f2fc2['shift']());}catch(_0x1af1a1){_0x1f2fc2['push'](_0x1f2fc2['shift']());}}}(a45_0x3edc,0xd234a));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';function a45_0x73c3(_0x6eb9ec,_0x590f9e){_0x6eb9ec=_0x6eb9ec-0x117;const _0x3edc0f=a45_0x3edc();let _0x73c3bc=_0x3edc0f[_0x6eb9ec];return _0x73c3bc;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0xed71c6 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x221655(0x128)]=a45_0x221655(0x120);[a45_0x221655(0x15f)]=a45_0x221655(0x15e);async['execute'](_0x21f6fe){const _0x28eda6=a45_0x221655,{options:_0x4d62df,args:_0x27d4b7}=_0x21f6fe,_0x46b693=_0x4d62df[_0x28eda6(0x122)],_0x202471=_0x27d4b7[0x0];try{const _0x5e7743=_0x4d62df[_0x28eda6(0x124)];_0x4d62df[_0x28eda6(0x13f)]&&(console['error'](_0x28eda6(0x137)+_0x4d62df['site']),console['error']('Parent\x20segment\x20context:\x20'+(_0x5e7743||_0x28eda6(0x133))),_0x202471&&console[_0x28eda6(0x147)](_0x28eda6(0x151)+_0x202471),_0x46b693&&console[_0x28eda6(0x147)]('Recursive\x20mode:\x20enabled'));if(!_0x5e7743)return console[_0x28eda6(0x147)](_0x28eda6(0x166)),console[_0x28eda6(0x147)](''),console[_0x28eda6(0x147)](_0x28eda6(0x136)),console[_0x28eda6(0x147)](_0x28eda6(0x160)),console[_0x28eda6(0x147)](_0x28eda6(0x143)),console['error'](''),console[_0x28eda6(0x147)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x3958e1=_0x202471&&(_0x202471[_0x28eda6(0x12a)]('*')||_0x202471[_0x28eda6(0x12a)]('?'));if(_0x3958e1)return await this[_0x28eda6(0x12c)](_0x21f6fe,_0x5e7743,_0x202471);const _0x312e3d=_0x202471?_0x5e7743+'/'+_0x202471:_0x5e7743;return _0x46b693?await this[_0x28eda6(0x14f)](_0x21f6fe,_0x312e3d):await this[_0x28eda6(0x149)](_0x21f6fe,_0x312e3d);}catch(_0x3db925){if(_0x3db925 instanceof SDKError)return console[_0x28eda6(0x147)](_0x28eda6(0x13b)+_0x3db925[_0x28eda6(0x15a)]),_0x3db925[_0x28eda6(0x155)]&&console[_0x28eda6(0x147)](_0x28eda6(0x154)+_0x3db925[_0x28eda6(0x155)]),0x1;throw _0x3db925;}}async[a45_0x221655(0x12c)](_0xf12295,_0x3904bb,_0x58f346){const _0x2feb07=a45_0x221655,{options:_0x22dcd1,tdx:_0x15b8fe}=_0xf12295,_0x14ddb4=await withSpinner(_0x2feb07(0x163)+_0x3904bb+_0x2feb07(0x117),()=>_0x15b8fe['segment'][_0x2feb07(0x13e)](_0x3904bb),{'verbose':_0x22dcd1[_0x2feb07(0x13f)]}),_0x1e96c2=_0x14ddb4[_0x2feb07(0x159)],_0xedce58=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x15b8fe[_0x2feb07(0x153)][_0x2feb07(0x15b)](_0x1e96c2['parentId'],_0x1e96c2[_0x2feb07(0x125)]),{'verbose':_0x22dcd1[_0x2feb07(0x13f)]}),{folders:_0xdf6afc,segments:_0x292e7e,journeys:_0x7544c9}=_0xedce58[_0x2feb07(0x159)],_0x3e8a46=_0x58f346[_0x2feb07(0x119)](/[.+^${}()|[\]\\]/g,_0x2feb07(0x135))[_0x2feb07(0x119)](/\*/g,'.*')[_0x2feb07(0x119)](/\?/g,'.'),_0x184ca4=new RegExp('^'+_0x3e8a46+'$','i'),_0x33c6d4=_0xdf6afc[_0x2feb07(0x12b)](_0x42f613=>_0x184ca4[_0x2feb07(0x13d)](_0x42f613[_0x2feb07(0x128)])),_0x5bce52=_0x292e7e[_0x2feb07(0x12b)](_0x1c6740=>_0x184ca4[_0x2feb07(0x13d)](_0x1c6740['name'])),_0x574dbd=_0x7544c9[_0x2feb07(0x12b)](_0x1fa603=>_0x184ca4['test'](_0x1fa603[_0x2feb07(0x126)])),_0x4a96de=_0x33c6d4[_0x2feb07(0x11d)]+_0x5bce52[_0x2feb07(0x11d)]+_0x574dbd[_0x2feb07(0x11d)];console[_0x2feb07(0x147)]('✔\x20Found\x20'+_0x33c6d4['length']+_0x2feb07(0x157)+(_0x33c6d4[_0x2feb07(0x11d)]!==0x1?'s':'')+',\x20'+_0x5bce52['length']+_0x2feb07(0x138)+(_0x5bce52[_0x2feb07(0x11d)]!==0x1?'s':'')+_0x2feb07(0x12f)+_0x574dbd[_0x2feb07(0x11d)]+_0x2feb07(0x156)+(_0x574dbd[_0x2feb07(0x11d)]!==0x1?'s':'')+_0x2feb07(0x12e)+_0x58f346+'\x27');const _0x2c134b=_0x1c558d=>{const _0x360bb1=_0x2feb07;return getConsoleNextUrl(_0x22dcd1[_0x360bb1(0x148)],_0x360bb1(0x13a)+_0x1e96c2[_0x360bb1(0x11e)]+_0x360bb1(0x145)+_0x1c558d);},_0x474711=_0x22dcd1[_0x2feb07(0x150)]==='json'||_0x22dcd1[_0x2feb07(0x150)]==='jsonl';if(_0x474711){const _0x38d14b=[..._0x33c6d4['map'](_0x25f228=>({..._0x25f228,'type':_0x2feb07(0x129)})),..._0x5bce52[_0x2feb07(0x165)](_0x4f62f8=>({..._0x4f62f8,'type':'segment','url':_0x2c134b(_0x4f62f8['id'])})),..._0x574dbd[_0x2feb07(0x165)](_0x4d3756=>({..._0x4d3756,'name':_0x4d3756['journeyBundleName'],'type':_0x2feb07(0x14c)}))][_0x2feb07(0x162)]((_0x4ec56e,_0x4a32df)=>_0x4ec56e[_0x2feb07(0x128)][_0x2feb07(0x134)](_0x4a32df[_0x2feb07(0x128)]));await handleSDKOutput(_0x38d14b,_0x22dcd1);}else{if(_0x4a96de===0x0)console[_0x2feb07(0x168)](_0x2feb07(0x146)+_0x58f346);else{console[_0x2feb07(0x168)](a45_0xed71c6[_0x2feb07(0x14d)]('['+_0x3904bb+_0x2feb07(0x14b)+_0x58f346+'\x27'));const _0x2c9e7c=formatFlatList(_0x33c6d4,_0x5bce52,{'showMetadata':!![],'getSegmentUrl':_0x2c134b},_0x574dbd);console[_0x2feb07(0x168)](_0x2c9e7c);}}return 0x0;}async['listUnified'](_0x22c923,_0x15722b){const _0x5dccf0=a45_0x221655,{options:_0x46843a,tdx:_0x2903fe}=_0x22c923,_0x3178e6=await withSpinner(_0x5dccf0(0x11b)+_0x15722b+_0x5dccf0(0x117),()=>_0x2903fe['segment'][_0x5dccf0(0x13e)](_0x15722b),{'verbose':_0x46843a[_0x5dccf0(0x13f)]}),_0x11389d=_0x3178e6['data'];_0x46843a[_0x5dccf0(0x13f)]&&(console[_0x5dccf0(0x147)](_0x5dccf0(0x13c)+_0x11389d[_0x5dccf0(0x11e)]),_0x11389d[_0x5dccf0(0x125)]&&console[_0x5dccf0(0x147)](_0x5dccf0(0x15c)+_0x11389d[_0x5dccf0(0x125)]));const _0x586156=await withSpinner(_0x5dccf0(0x121),()=>_0x2903fe[_0x5dccf0(0x153)][_0x5dccf0(0x15b)](_0x11389d[_0x5dccf0(0x11e)],_0x11389d[_0x5dccf0(0x125)]),{'verbose':_0x46843a['verbose']}),{folders:_0x33004a,segments:_0x50bdbe,journeys:_0x13ce21}=_0x586156['data'],_0x15db1f=_0x33004a[_0x5dccf0(0x11d)]+_0x50bdbe[_0x5dccf0(0x11d)]+_0x13ce21[_0x5dccf0(0x11d)];console['error'](_0x5dccf0(0x132)+_0x33004a[_0x5dccf0(0x11d)]+'\x20folder'+(_0x33004a[_0x5dccf0(0x11d)]!==0x1?'s':'')+',\x20'+_0x50bdbe[_0x5dccf0(0x11d)]+'\x20segment'+(_0x50bdbe[_0x5dccf0(0x11d)]!==0x1?'s':'')+_0x5dccf0(0x12f)+_0x13ce21[_0x5dccf0(0x11d)]+_0x5dccf0(0x156)+(_0x13ce21[_0x5dccf0(0x11d)]!==0x1?'s':''));const _0x3d1753=_0x1bbe79=>{const _0x49428f=_0x5dccf0;return getConsoleNextUrl(_0x46843a[_0x49428f(0x148)],_0x49428f(0x13a)+_0x11389d[_0x49428f(0x11e)]+_0x49428f(0x145)+_0x1bbe79);},_0x338668=_0x59612e=>{const _0x570dab=_0x5dccf0;return getConsoleNextUrl(_0x46843a['site'],'/app/ps/'+_0x11389d['parentId']+_0x570dab(0x145)+_0x59612e+_0x570dab(0x141));},_0x5714ed=_0x46843a[_0x5dccf0(0x150)]==='json'||_0x46843a['format']==='jsonl';if(_0x5714ed){const _0x17e076=[..._0x33004a[_0x5dccf0(0x165)](_0x1da627=>({..._0x1da627,'type':'folder'})),..._0x50bdbe['map'](_0x5ae7fe=>({..._0x5ae7fe,'type':_0x5dccf0(0x153),'url':_0x3d1753(_0x5ae7fe['id'])})),..._0x13ce21['map'](_0x2dc0da=>({..._0x2dc0da,'name':_0x2dc0da['journeyBundleName'],'type':'journey','url':_0x338668(_0x2dc0da['id'])}))][_0x5dccf0(0x162)]((_0x580df4,_0x2036ac)=>_0x580df4[_0x5dccf0(0x128)]['localeCompare'](_0x2036ac['name']));await handleSDKOutput(_0x17e076,_0x46843a);}else{if(_0x15db1f===0x0)console[_0x5dccf0(0x168)](a45_0xed71c6[_0x5dccf0(0x14d)]('['+_0x15722b+']')),console[_0x5dccf0(0x168)](_0x5dccf0(0x152));else{console['log'](a45_0xed71c6[_0x5dccf0(0x14d)]('['+_0x15722b+']'));const _0x3f08cd=formatFlatList(_0x33004a,_0x50bdbe,{'showMetadata':!![],'getSegmentUrl':_0x3d1753,'getJourneyUrl':_0x338668},_0x13ce21);console[_0x5dccf0(0x168)](_0x3f08cd);}}return 0x0;}async[a45_0x221655(0x14f)](_0x3fbcb5,_0x251777){const _0x204baf=a45_0x221655,{options:_0xbc6979,tdx:_0xfaf786}=_0x3fbcb5,_0x325094=await withSpinner('Resolving\x20path\x20\x27'+_0x251777+_0x204baf(0x117),()=>_0xfaf786[_0x204baf(0x153)][_0x204baf(0x13e)](_0x251777),{'verbose':_0xbc6979[_0x204baf(0x13f)]}),_0x6735c5=_0x325094[_0x204baf(0x159)];_0xbc6979[_0x204baf(0x13f)]&&(console['error'](_0x204baf(0x13c)+_0x6735c5[_0x204baf(0x11e)]),_0x6735c5[_0x204baf(0x125)]&&console[_0x204baf(0x147)](_0x204baf(0x15c)+_0x6735c5[_0x204baf(0x125)]));const _0x6fdf56=_0xbc6979[_0x204baf(0x14a)]||0xa,_0x18bc0c=await withSpinner(_0x204baf(0x127),()=>_0xfaf786['segment'][_0x204baf(0x14f)](_0x6735c5['parentId'],_0x6735c5[_0x204baf(0x125)],0x0,_0x6fdf56),{'verbose':_0xbc6979['verbose']}),_0x137358=_0x18bc0c[_0x204baf(0x159)],_0x365d0e=_0x7de102=>{const _0x222b48=_0x204baf;let _0x47879f=0x0,_0x2bc4a3=0x0,_0x394c9c=0x0;for(const _0x4147b1 of _0x7de102){if(_0x4147b1[_0x222b48(0x123)]===_0x222b48(0x129))_0x47879f++;else{if(_0x4147b1[_0x222b48(0x123)]===_0x222b48(0x153))_0x2bc4a3++;else{if(_0x4147b1[_0x222b48(0x123)]===_0x222b48(0x14c))_0x394c9c++;}}if(_0x4147b1[_0x222b48(0x118)]){const _0x106f2a=_0x365d0e(_0x4147b1[_0x222b48(0x118)]);_0x47879f+=_0x106f2a['folders'],_0x2bc4a3+=_0x106f2a[_0x222b48(0x120)],_0x394c9c+=_0x106f2a[_0x222b48(0x144)];}}return{'folders':_0x47879f,'segments':_0x2bc4a3,'journeys':_0x394c9c};},_0x294b72=_0x365d0e(_0x137358);console[_0x204baf(0x147)](_0x204baf(0x167)+_0x294b72[_0x204baf(0x12d)]+_0x204baf(0x157)+(_0x294b72['folders']!==0x1?'s':'')+',\x20'+_0x294b72['segments']+'\x20segment'+(_0x294b72[_0x204baf(0x120)]!==0x1?'s':'')+_0x204baf(0x12f)+_0x294b72[_0x204baf(0x144)]+'\x20journey'+(_0x294b72['journeys']!==0x1?'s':''));const _0x5d3e4c=_0x2962fe=>{const _0x4c218b=_0x204baf;return getConsoleNextUrl(_0xbc6979[_0x4c218b(0x148)],'/app/ps/'+_0x6735c5[_0x4c218b(0x11e)]+_0x4c218b(0x145)+_0x2962fe);},_0x1b001c=_0x3acd9f=>{const _0x25279d=_0x204baf;return getConsoleNextUrl(_0xbc6979[_0x25279d(0x148)],'/app/ps/'+_0x6735c5['parentId']+_0x25279d(0x145)+_0x3acd9f+_0x25279d(0x141));};if(_0xbc6979['format']===_0x204baf(0x158)||_0xbc6979[_0x204baf(0x150)]===_0x204baf(0x130))await handleSDKOutput(_0x137358,_0xbc6979);else{console[_0x204baf(0x168)](a45_0xed71c6['dim']('['+_0x251777+']'));const _0x37b2f6=formatTree(_0x137358,{'showMetadata':!![],'getSegmentUrl':_0x5d3e4c,'getJourneyUrl':_0x1b001c});console['log'](_0x37b2f6);}return 0x0;}}
|
|
1
|
+
const a45_0x4260e1=a45_0x475c;function a45_0x475c(_0x5a94a9,_0x4a756a){_0x5a94a9=_0x5a94a9-0x176;const _0x5df7c5=a45_0x5df7();let _0x475c49=_0x5df7c5[_0x5a94a9];return _0x475c49;}(function(_0x19abf9,_0x4b8625){const _0x4a8948=a45_0x475c,_0x43d3a3=_0x19abf9();while(!![]){try{const _0x51811b=-parseInt(_0x4a8948(0x17f))/0x1+-parseInt(_0x4a8948(0x1a6))/0x2+-parseInt(_0x4a8948(0x18f))/0x3+-parseInt(_0x4a8948(0x1b3))/0x4+parseInt(_0x4a8948(0x183))/0x5*(-parseInt(_0x4a8948(0x1ac))/0x6)+parseInt(_0x4a8948(0x1a1))/0x7*(-parseInt(_0x4a8948(0x199))/0x8)+parseInt(_0x4a8948(0x184))/0x9;if(_0x51811b===_0x4b8625)break;else _0x43d3a3['push'](_0x43d3a3['shift']());}catch(_0x2469d8){_0x43d3a3['push'](_0x43d3a3['shift']());}}}(a45_0x5df7,0xb3f5a));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_0x5df7(){const _0x522168=['test','\x20segment','log','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','verbose','12sJixVb','resolvePathToResource','(empty)','format','replace','Site:\x20','/j/da','2551356DEoZqZ','\x5c$&','listUnified','folders','Parent\x20segment\x20context:\x20','localeCompare','jsonl','cause','journey','✔\x20Found\x20',']\x20matching\x20\x27','/e/','name','✔\x20Built\x20tree\x20with\x20','\x20folder','Folder\x20ID:\x20','children','includes','map','parentSegment','parentId','data','Parent\x20ID:\x20','Building\x20hierarchy\x20tree...','Resolving\x20path\x20\x27','/app/ps/','88284BtUGMt','length','type','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','1424355RhPYbR','32988267LNchKC',',\x20and\x20','journeys','maxDepth','journeyBundleName','Resolving\x20parent\x20segment\x20\x27','dim','listUnifiedWithJourneys','Error:\x20No\x20parent\x20segment\x20context\x20set.','listWithPattern','Folder/pattern\x20arg:\x20','3128493IgHDhO','error','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','\x20matching\x20\x27','\x20journey','listRecursive','No\x20items\x20match\x20pattern:\x20','filter','folderId','26120FVdCRV','sort','segment','Error:\x20','folder','Set\x20a\x20parent\x20segment\x20context\x20first:','execute','segments','889rrKOaC','json','(not\x20set)','site','description','349796RyrNXc'];a45_0x5df7=function(){return _0x522168;};return a45_0x5df7();}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0xf41dc from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x4260e1(0x1bf)]=a45_0x4260e1(0x1a0);[a45_0x4260e1(0x1a5)]='List\x20folders\x20and\x20child\x20segments';async[a45_0x4260e1(0x19f)](_0x51e3c6){const _0x1c05be=a45_0x4260e1,{options:_0xfc9645,args:_0xd755ad}=_0x51e3c6,_0xf2b28=_0xfc9645['recursive'],_0x53ff25=_0xd755ad[0x0];try{const _0x13b6c2=_0xfc9645[_0x1c05be(0x178)];_0xfc9645[_0x1c05be(0x1ab)]&&(console[_0x1c05be(0x190)](_0x1c05be(0x1b1)+_0xfc9645[_0x1c05be(0x1a4)]),console['error'](_0x1c05be(0x1b7)+(_0x13b6c2||_0x1c05be(0x1a3))),_0x53ff25&&console[_0x1c05be(0x190)](_0x1c05be(0x18e)+_0x53ff25),_0xf2b28&&console[_0x1c05be(0x190)]('Recursive\x20mode:\x20enabled'));if(!_0x13b6c2)return console['error'](_0x1c05be(0x18c)),console['error'](''),console['error'](_0x1c05be(0x19e)),console['error'](_0x1c05be(0x192)),console[_0x1c05be(0x190)](_0x1c05be(0x182)),console['error'](''),console['error'](_0x1c05be(0x1aa)),0x1;const _0x48fdb5=_0x53ff25&&(_0x53ff25[_0x1c05be(0x176)]('*')||_0x53ff25[_0x1c05be(0x176)]('?'));if(_0x48fdb5)return await this[_0x1c05be(0x18d)](_0x51e3c6,_0x13b6c2,_0x53ff25);const _0x1e268e=_0x53ff25?_0x13b6c2+'/'+_0x53ff25:_0x13b6c2;return _0xf2b28?await this[_0x1c05be(0x195)](_0x51e3c6,_0x1e268e):await this[_0x1c05be(0x1b5)](_0x51e3c6,_0x1e268e);}catch(_0x559cc5){if(_0x559cc5 instanceof SDKError)return console[_0x1c05be(0x190)](_0x1c05be(0x19c)+_0x559cc5['message']),_0x559cc5[_0x1c05be(0x1ba)]&&console['error']('\x20\x20Cause:\x20'+_0x559cc5['cause']),0x1;throw _0x559cc5;}}async[a45_0x4260e1(0x18d)](_0x479723,_0x5a61fc,_0x39f317){const _0x57cab3=a45_0x4260e1,{options:_0x534d7a,tdx:_0x3eade2}=_0x479723,_0x19d73e=await withSpinner(_0x57cab3(0x189)+_0x5a61fc+'\x27...',()=>_0x3eade2['segment'][_0x57cab3(0x1ad)](_0x5a61fc),{'verbose':_0x534d7a[_0x57cab3(0x1ab)]}),_0x541872=_0x19d73e[_0x57cab3(0x17a)],_0x930372=await withSpinner(_0x57cab3(0x191),()=>_0x3eade2['segment']['listUnifiedWithJourneys'](_0x541872[_0x57cab3(0x179)],_0x541872[_0x57cab3(0x198)]),{'verbose':_0x534d7a[_0x57cab3(0x1ab)]}),{folders:_0x41fb53,segments:_0x2ea04e,journeys:_0x1f3bb6}=_0x930372['data'],_0x19df27=_0x39f317[_0x57cab3(0x1b0)](/[.+^${}()|[\]\\]/g,_0x57cab3(0x1b4))[_0x57cab3(0x1b0)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x504bee=new RegExp('^'+_0x19df27+'$','i'),_0x1ae581=_0x41fb53[_0x57cab3(0x197)](_0x2a5314=>_0x504bee['test'](_0x2a5314[_0x57cab3(0x1bf)])),_0x46116b=_0x2ea04e[_0x57cab3(0x197)](_0x13bc91=>_0x504bee[_0x57cab3(0x1a7)](_0x13bc91[_0x57cab3(0x1bf)])),_0xe2a6ce=_0x1f3bb6[_0x57cab3(0x197)](_0x36b2f4=>_0x504bee[_0x57cab3(0x1a7)](_0x36b2f4['journeyBundleName'])),_0x566236=_0x1ae581[_0x57cab3(0x180)]+_0x46116b['length']+_0xe2a6ce['length'];console[_0x57cab3(0x190)](_0x57cab3(0x1bc)+_0x1ae581['length']+_0x57cab3(0x1c1)+(_0x1ae581[_0x57cab3(0x180)]!==0x1?'s':'')+',\x20'+_0x46116b[_0x57cab3(0x180)]+_0x57cab3(0x1a8)+(_0x46116b[_0x57cab3(0x180)]!==0x1?'s':'')+_0x57cab3(0x185)+_0xe2a6ce[_0x57cab3(0x180)]+'\x20journey'+(_0xe2a6ce[_0x57cab3(0x180)]!==0x1?'s':'')+_0x57cab3(0x193)+_0x39f317+'\x27');const _0x2de856=_0x576c3e=>{const _0x28753b=_0x57cab3;return getConsoleNextUrl(_0x534d7a[_0x28753b(0x1a4)],'/app/ps/'+_0x541872['parentId']+_0x28753b(0x1be)+_0x576c3e);},_0x2d983d=_0x534d7a['format']===_0x57cab3(0x1a2)||_0x534d7a[_0x57cab3(0x1af)]===_0x57cab3(0x1b9);if(_0x2d983d){const _0x128687=[..._0x1ae581['map'](_0x3c64b3=>({..._0x3c64b3,'type':_0x57cab3(0x19d)})),..._0x46116b[_0x57cab3(0x177)](_0x39d8b3=>({..._0x39d8b3,'type':_0x57cab3(0x19b),'url':_0x2de856(_0x39d8b3['id'])})),..._0xe2a6ce[_0x57cab3(0x177)](_0x50d672=>({..._0x50d672,'name':_0x50d672[_0x57cab3(0x188)],'type':_0x57cab3(0x1bb)}))]['sort']((_0x4998ed,_0x2a14b7)=>_0x4998ed['name']['localeCompare'](_0x2a14b7[_0x57cab3(0x1bf)]));await handleSDKOutput(_0x128687,_0x534d7a);}else{if(_0x566236===0x0)console[_0x57cab3(0x1a9)](_0x57cab3(0x196)+_0x39f317);else{console[_0x57cab3(0x1a9)](a45_0xf41dc[_0x57cab3(0x18a)]('['+_0x5a61fc+_0x57cab3(0x1bd)+_0x39f317+'\x27'));const _0x4b7193=formatFlatList(_0x1ae581,_0x46116b,{'showMetadata':!![],'getSegmentUrl':_0x2de856},_0xe2a6ce);console[_0x57cab3(0x1a9)](_0x4b7193);}}return 0x0;}async[a45_0x4260e1(0x1b5)](_0x5f8c7d,_0x120a6c){const _0x105330=a45_0x4260e1,{options:_0x2457c1,tdx:_0x5a7e3d}=_0x5f8c7d,_0x50d4b3=await withSpinner(_0x105330(0x17d)+_0x120a6c+'\x27...',()=>_0x5a7e3d[_0x105330(0x19b)][_0x105330(0x1ad)](_0x120a6c),{'verbose':_0x2457c1[_0x105330(0x1ab)]}),_0x54fc03=_0x50d4b3['data'];_0x2457c1[_0x105330(0x1ab)]&&(console[_0x105330(0x190)]('Parent\x20ID:\x20'+_0x54fc03[_0x105330(0x179)]),_0x54fc03['folderId']&&console[_0x105330(0x190)](_0x105330(0x1c2)+_0x54fc03[_0x105330(0x198)]));const _0x6792e8=await withSpinner(_0x105330(0x191),()=>_0x5a7e3d[_0x105330(0x19b)][_0x105330(0x18b)](_0x54fc03[_0x105330(0x179)],_0x54fc03['folderId']),{'verbose':_0x2457c1[_0x105330(0x1ab)]}),{folders:_0x430da9,segments:_0x213b9c,journeys:_0x2744e5}=_0x6792e8[_0x105330(0x17a)],_0x21cd4f=_0x430da9[_0x105330(0x180)]+_0x213b9c[_0x105330(0x180)]+_0x2744e5['length'];console[_0x105330(0x190)]('✔\x20Found\x20'+_0x430da9[_0x105330(0x180)]+_0x105330(0x1c1)+(_0x430da9['length']!==0x1?'s':'')+',\x20'+_0x213b9c[_0x105330(0x180)]+_0x105330(0x1a8)+(_0x213b9c[_0x105330(0x180)]!==0x1?'s':'')+',\x20and\x20'+_0x2744e5[_0x105330(0x180)]+_0x105330(0x194)+(_0x2744e5[_0x105330(0x180)]!==0x1?'s':''));const _0x4660a4=_0x227f04=>{const _0x18426e=_0x105330;return getConsoleNextUrl(_0x2457c1[_0x18426e(0x1a4)],_0x18426e(0x17e)+_0x54fc03[_0x18426e(0x179)]+_0x18426e(0x1be)+_0x227f04);},_0x468564=_0x414541=>{const _0x8fd2ce=_0x105330;return getConsoleNextUrl(_0x2457c1['site'],_0x8fd2ce(0x17e)+_0x54fc03[_0x8fd2ce(0x179)]+_0x8fd2ce(0x1be)+_0x414541+_0x8fd2ce(0x1b2));},_0x169ec0=_0x2457c1[_0x105330(0x1af)]==='json'||_0x2457c1[_0x105330(0x1af)]==='jsonl';if(_0x169ec0){const _0x19a784=[..._0x430da9['map'](_0x337af9=>({..._0x337af9,'type':_0x105330(0x19d)})),..._0x213b9c[_0x105330(0x177)](_0x54f164=>({..._0x54f164,'type':_0x105330(0x19b),'url':_0x4660a4(_0x54f164['id'])})),..._0x2744e5[_0x105330(0x177)](_0x4b3931=>({..._0x4b3931,'name':_0x4b3931[_0x105330(0x188)],'type':_0x105330(0x1bb),'url':_0x468564(_0x4b3931['id'])}))][_0x105330(0x19a)]((_0x5c243c,_0x367ca8)=>_0x5c243c[_0x105330(0x1bf)][_0x105330(0x1b8)](_0x367ca8[_0x105330(0x1bf)]));await handleSDKOutput(_0x19a784,_0x2457c1);}else{if(_0x21cd4f===0x0)console['log'](a45_0xf41dc[_0x105330(0x18a)]('['+_0x120a6c+']')),console[_0x105330(0x1a9)](_0x105330(0x1ae));else{console[_0x105330(0x1a9)](a45_0xf41dc['dim']('['+_0x120a6c+']'));const _0x50cfb1=formatFlatList(_0x430da9,_0x213b9c,{'showMetadata':!![],'getSegmentUrl':_0x4660a4,'getJourneyUrl':_0x468564},_0x2744e5);console['log'](_0x50cfb1);}}return 0x0;}async['listRecursive'](_0x4b75bf,_0xe8304){const _0x3df135=a45_0x4260e1,{options:_0x379e49,tdx:_0x2ffc5f}=_0x4b75bf,_0x489542=await withSpinner('Resolving\x20path\x20\x27'+_0xe8304+'\x27...',()=>_0x2ffc5f['segment'][_0x3df135(0x1ad)](_0xe8304),{'verbose':_0x379e49[_0x3df135(0x1ab)]}),_0x326e5f=_0x489542[_0x3df135(0x17a)];_0x379e49[_0x3df135(0x1ab)]&&(console[_0x3df135(0x190)](_0x3df135(0x17b)+_0x326e5f[_0x3df135(0x179)]),_0x326e5f[_0x3df135(0x198)]&&console[_0x3df135(0x190)](_0x3df135(0x1c2)+_0x326e5f[_0x3df135(0x198)]));const _0x4ca61a=_0x379e49[_0x3df135(0x187)]||0xa,_0x27fe8e=await withSpinner(_0x3df135(0x17c),()=>_0x2ffc5f[_0x3df135(0x19b)][_0x3df135(0x195)](_0x326e5f[_0x3df135(0x179)],_0x326e5f[_0x3df135(0x198)],0x0,_0x4ca61a),{'verbose':_0x379e49['verbose']}),_0x1374ee=_0x27fe8e[_0x3df135(0x17a)],_0x538281=_0x44a4d6=>{const _0x44441f=_0x3df135;let _0x27bd12=0x0,_0x38af74=0x0,_0xae25b1=0x0;for(const _0x1067d8 of _0x44a4d6){if(_0x1067d8[_0x44441f(0x181)]==='folder')_0x27bd12++;else{if(_0x1067d8[_0x44441f(0x181)]===_0x44441f(0x19b))_0x38af74++;else{if(_0x1067d8[_0x44441f(0x181)]===_0x44441f(0x1bb))_0xae25b1++;}}if(_0x1067d8[_0x44441f(0x1c3)]){const _0x17816b=_0x538281(_0x1067d8['children']);_0x27bd12+=_0x17816b[_0x44441f(0x1b6)],_0x38af74+=_0x17816b[_0x44441f(0x1a0)],_0xae25b1+=_0x17816b[_0x44441f(0x186)];}}return{'folders':_0x27bd12,'segments':_0x38af74,'journeys':_0xae25b1};},_0x3c1591=_0x538281(_0x1374ee);console[_0x3df135(0x190)](_0x3df135(0x1c0)+_0x3c1591[_0x3df135(0x1b6)]+_0x3df135(0x1c1)+(_0x3c1591['folders']!==0x1?'s':'')+',\x20'+_0x3c1591[_0x3df135(0x1a0)]+'\x20segment'+(_0x3c1591['segments']!==0x1?'s':'')+_0x3df135(0x185)+_0x3c1591['journeys']+_0x3df135(0x194)+(_0x3c1591[_0x3df135(0x186)]!==0x1?'s':''));const _0x33ecbd=_0x45f0f1=>{const _0x245fb9=_0x3df135;return getConsoleNextUrl(_0x379e49[_0x245fb9(0x1a4)],_0x245fb9(0x17e)+_0x326e5f['parentId']+_0x245fb9(0x1be)+_0x45f0f1);},_0x219a61=_0x40f863=>{const _0x369ccf=_0x3df135;return getConsoleNextUrl(_0x379e49[_0x369ccf(0x1a4)],'/app/ps/'+_0x326e5f[_0x369ccf(0x179)]+_0x369ccf(0x1be)+_0x40f863+_0x369ccf(0x1b2));};if(_0x379e49[_0x3df135(0x1af)]===_0x3df135(0x1a2)||_0x379e49[_0x3df135(0x1af)]===_0x3df135(0x1b9))await handleSDKOutput(_0x1374ee,_0x379e49);else{console['log'](a45_0xf41dc[_0x3df135(0x18a)]('['+_0xe8304+']'));const _0x44c084=formatTree(_0x1374ee,{'showMetadata':!![],'getSegmentUrl':_0x33ecbd,'getJourneyUrl':_0x219a61});console[_0x3df135(0x1a9)](_0x44c084);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x22bc79=a46_0x51a1;function a46_0x4cc7(){const _0x3173ad=['4378864RSdYPu','Limit:\x20','463931ZqsHex','validate','verbose','description','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','\x20\x20Cause:\x20','112FcrVSb','Catalog:\x20','Querying\x20','table','showTable','error','Site:\x20','cause','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','1215mxDGCg','query','3126966dZGjRB','4084MBpubF','catalog','2002672hunfsm','data','limit','...','192699LQhCDp','length','\x20row','✔\x20Retrieved\x20','Show\x20table\x20contents','args','2373855fYrrMn','Table:\x20','site','show','database','message','Usage:\x20tdx\x20show\x20<database.table>','Database:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'];a46_0x4cc7=function(){return _0x3173ad;};return a46_0x4cc7();}(function(_0x1bcf06,_0xa6f4d8){const _0x3add99=a46_0x51a1,_0x5ec34a=_0x1bcf06();while(!![]){try{const _0x27751b=parseInt(_0x3add99(0xe8))/0x1+-parseInt(_0x3add99(0xd1))/0x2*(parseInt(_0x3add99(0xf7))/0x3)+parseInt(_0x3add99(0xd3))/0x4+-parseInt(_0x3add99(0xdd))/0x5+parseInt(_0x3add99(0xd0))/0x6+parseInt(_0x3add99(0xe6))/0x7+-parseInt(_0x3add99(0xee))/0x8*(parseInt(_0x3add99(0xd7))/0x9);if(_0x27751b===_0xa6f4d8)break;else _0x5ec34a['push'](_0x5ec34a['shift']());}catch(_0x15a925){_0x5ec34a['push'](_0x5ec34a['shift']());}}}(a46_0x4cc7,0x7c751));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a46_0x51a1(_0x1c71d1,_0xeeb94b){_0x1c71d1=_0x1c71d1-0xcf;const _0x4cc74f=a46_0x4cc7();let _0x51a1c6=_0x4cc74f[_0x1c71d1];return _0x51a1c6;}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a46_0x22bc79(0xe0);[a46_0x22bc79(0xeb)]=a46_0x22bc79(0xdb);async['execute'](_0x1cc193){const _0x15d4de=a46_0x22bc79;return this[_0x15d4de(0xf2)](_0x1cc193);}async[a46_0x22bc79(0xf2)](_0x70cd5d){const _0x4ecfdb=a46_0x22bc79,{options:_0x1b2d86,args:_0x23175e,tdx:_0x1c572a}=_0x70cd5d;let _0x6e68e9;try{_0x6e68e9=parseTableReference(_0x23175e[0x0]);const _0x18c48e=_0x1b2d86[_0x4ecfdb(0xe1)];!_0x6e68e9[_0x4ecfdb(0xe1)]&&_0x18c48e&&(_0x6e68e9[_0x4ecfdb(0xe1)]=_0x18c48e);const _0x37260f=validateTableDescribeReference(_0x6e68e9);if(_0x37260f)return console[_0x4ecfdb(0xf3)]('Error:\x20'+_0x37260f),console[_0x4ecfdb(0xf3)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x4ecfdb(0xf3)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xe5)),0x1;}catch(_0x104279){return console[_0x4ecfdb(0xf3)]('Error:\x20'+_0x104279[_0x4ecfdb(0xe2)]),console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xe3)),console[_0x4ecfdb(0xf3)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x4ecfdb(0xe5)),0x1;}const _0x30a90b=_0x6e68e9[_0x4ecfdb(0xd2)],_0x15361d=_0x6e68e9[_0x4ecfdb(0xe1)],_0x5e358=_0x6e68e9[_0x4ecfdb(0xf1)],_0x47678c=resolveLimit(_0x1b2d86[_0x4ecfdb(0xd5)],DEFAULT_DISPLAY_LIMIT);try{_0x1b2d86[_0x4ecfdb(0xea)]&&(console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xf4)+_0x1b2d86[_0x4ecfdb(0xdf)]),_0x30a90b&&console['error'](_0x4ecfdb(0xef)+_0x30a90b),console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xe4)+_0x15361d),console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xde)+_0x5e358),console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xe7)+_0x47678c));const _0x4b55f7=_0x30a90b?_0x30a90b+'.'+_0x15361d+'.'+_0x5e358:_0x15361d+'.'+_0x5e358,_0x29ad4b=await withSpinner(_0x4ecfdb(0xf0)+_0x4b55f7+_0x4ecfdb(0xd6),()=>_0x1c572a[_0x4ecfdb(0xcf)][_0x4ecfdb(0xf2)](_0x15361d,_0x5e358,_0x47678c,_0x30a90b),{'verbose':_0x1b2d86[_0x4ecfdb(0xea)]}),_0x5caef1=_0x29ad4b[_0x4ecfdb(0xd4)],_0x527a93=_0x5caef1[_0x4ecfdb(0xd4)];return _0x527a93[_0x4ecfdb(0xd8)]===0x0?console['error']('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xda)+_0x527a93[_0x4ecfdb(0xd8)]+_0x4ecfdb(0xd9)+(_0x527a93[_0x4ecfdb(0xd8)]!==0x1?'s':'')+'\x20from\x20'+_0x4b55f7),await handleSDKOutput(_0x527a93,_0x1b2d86),0x0;}catch(_0x597352){if(_0x597352 instanceof SDKError)return console[_0x4ecfdb(0xf3)]('Error:\x20'+_0x597352[_0x4ecfdb(0xe2)]),_0x597352['cause']&&console[_0x4ecfdb(0xf3)](_0x4ecfdb(0xed)+_0x597352[_0x4ecfdb(0xf5)]),0x1;throw _0x597352;}}[a46_0x22bc79(0xe9)](_0x1eaec9){const _0xd98b5d=a46_0x22bc79;if(_0x1eaec9[_0xd98b5d(0xdc)][_0xd98b5d(0xd8)]===0x0)return _0xd98b5d(0xf6);if(_0x1eaec9[_0xd98b5d(0xdc)][_0xd98b5d(0xd8)]>0x1)return _0xd98b5d(0xec);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x5bd5ce=a47_0x1c5c;(function(_0x18971a,_0x236613){const _0x4b08c5=a47_0x1c5c,_0x1f7f2f=_0x18971a();while(!![]){try{const _0x2a1156=parseInt(_0x4b08c5(0x117))/0x1+parseInt(_0x4b08c5(0x100))/0x2+-parseInt(_0x4b08c5(0x111))/0x3+-parseInt(_0x4b08c5(0x11f))/0x4*(-parseInt(_0x4b08c5(0x105))/0x5)+-parseInt(_0x4b08c5(0x114))/0x6*(parseInt(_0x4b08c5(0x123))/0x7)+-parseInt(_0x4b08c5(0x10f))/0x8+parseInt(_0x4b08c5(0x107))/0x9;if(_0x2a1156===_0x236613)break;else _0x1f7f2f['push'](_0x1f7f2f['shift']());}catch(_0x51c177){_0x1f7f2f['push'](_0x1f7f2f['shift']());}}}(a47_0x52d3,0x1fcfa));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a47_0x1c5c(_0x161e00,_0x8bdaa0){_0x161e00=_0x161e00-0xf9;const _0x52d358=a47_0x52d3();let _0x1c5c79=_0x52d358[_0x161e00];return _0x1c5c79;}import a47_0x22c78a from'chalk';function a47_0x52d3(){const _0x4cd59c=['Credential\x20type:\x20','Read\x20credential\x20from\x20','bold','log','✓\x20Authentication\x20successful\x0a','TDX_PROFILE\x20env','No\x20credential\x20found','99868xCDDjM','tdx','filter','first_name','879851sYlZjM','description','yellow','status','\x20profile:\x20','execute','User:','last_name','Account\x20ID:','367628GdEMJy','site:\x20','session','config','message','10pBQQfW','env','2739852GBSWtB','site','account_id','profile','cyan','Name:','cli','green','1605112mwfTfg','error','253713VrKHNo','name','dim','6fFvrMd','N/A','profileSource','3025IVSTQR'];a47_0x52d3=function(){return _0x4cd59c;};return a47_0x52d3();}export class StatusCommand extends BaseCommand{[a47_0x5bd5ce(0x112)]=a47_0x5bd5ce(0xfa);[a47_0x5bd5ce(0x124)]='Show\x20authentication\x20status\x20and\x20current\x20context';async[a47_0x5bd5ce(0xfc)](_0x30c93c){const _0x4ba12f=a47_0x5bd5ce,{options:_0x39b3c3,tdx:_0x3fe3c6}=_0x30c93c,_0x157532=_0x39b3c3[_0x4ba12f(0x108)],_0x2fae96=new GlobalContext(_0x39b3c3),_0x2f8571=_0x2fae96[_0x4ba12f(0x10a)],_0x298d52=_0x2fae96[_0x4ba12f(0x116)],_0x5a9377=_0x298d52===_0x4ba12f(0x10d)?'CLI\x20flag':_0x298d52===_0x4ba12f(0x102)?_0x4ba12f(0x102):_0x298d52===_0x4ba12f(0x106)?_0x4ba12f(0x11d):_0x298d52==='config'?_0x4ba12f(0x103):null,_0x58c610=_0x2f8571?a47_0x22c78a['cyan'](_0x2f8571):a47_0x22c78a[_0x4ba12f(0x113)](_0x4ba12f(0x115)),_0x4e5cf4=_0x5a9377?'\x20'+a47_0x22c78a['dim']('(from\x20'+_0x5a9377+')'):'';console[_0x4ba12f(0x11b)](a47_0x22c78a[_0x4ba12f(0x11a)](_0x4ba12f(0x120))+_0x4ba12f(0xfb)+_0x58c610+_0x4e5cf4+'\x20'+a47_0x22c78a[_0x4ba12f(0x113)]('(')+_0x4ba12f(0x101)+a47_0x22c78a[_0x4ba12f(0x10b)](_0x157532)+a47_0x22c78a['dim'](')'));const _0x5e2302=await getOAuthTokens(_0x2f8571);if(_0x5e2302)console[_0x4ba12f(0x11b)](_0x4ba12f(0x118)+a47_0x22c78a[_0x4ba12f(0x10b)]('OAuth'));else{const _0x1ed8fa=await resolveAPIKeyAsync(_0x157532,_0x2f8571);if(_0x1ed8fa){const {source:_0x38dd6e,isDeprecated:_0x4f4cc1}=_0x1ed8fa,_0x67e919=_0x4ba12f(0x119)+a47_0x22c78a[_0x4ba12f(0x10b)](_0x38dd6e);console['log'](_0x4f4cc1?a47_0x22c78a[_0x4ba12f(0xf9)](_0x67e919):_0x67e919);}else console[_0x4ba12f(0x11b)](a47_0x22c78a['yellow'](_0x4ba12f(0x11e)));}let _0x1d4c4c=![];try{const _0x8155bc=await _0x3fe3c6['jobs']['getUserInfo']();console[_0x4ba12f(0x11b)](a47_0x22c78a[_0x4ba12f(0x10e)](_0x4ba12f(0x11c))),console[_0x4ba12f(0x11b)](a47_0x22c78a[_0x4ba12f(0x11a)](_0x4ba12f(0xfd))+'\x20'+a47_0x22c78a['cyan'](_0x8155bc['email']));if(_0x8155bc[_0x4ba12f(0x122)]||_0x8155bc[_0x4ba12f(0xfe)]){const _0xcf50c9=[_0x8155bc[_0x4ba12f(0x122)],_0x8155bc[_0x4ba12f(0xfe)]][_0x4ba12f(0x121)](Boolean)['join']('\x20');console[_0x4ba12f(0x11b)](a47_0x22c78a[_0x4ba12f(0x11a)](_0x4ba12f(0x10c))+'\x20'+_0xcf50c9);}_0x8155bc[_0x4ba12f(0x109)]&&console[_0x4ba12f(0x11b)](a47_0x22c78a[_0x4ba12f(0x11a)](_0x4ba12f(0xff))+'\x20'+a47_0x22c78a[_0x4ba12f(0xf9)](_0x8155bc[_0x4ba12f(0x109)])),_0x1d4c4c=!![];}catch(_0x4f4f56){_0x4f4f56 instanceof HTTPClientError&&_0x4f4f56[_0x4ba12f(0xfa)]===0x191?printAuthError(_0x4f4f56,!![],_0x2f8571):console[_0x4ba12f(0x110)](a47_0x22c78a['red']('✗\x20Validation\x20failed:\x20'+(_0x4f4f56 instanceof Error?_0x4f4f56[_0x4ba12f(0x104)]:String(_0x4f4f56))));}return console[_0x4ba12f(0x11b)](),_0x2fae96['displayWithSources'](),_0x1d4c4c?0x0:0x1;}}
|