@treasuredata/tdx 2026.4.13 → 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_0xbfb39f=a41_0x5f1a;(function(_0x2a7efb,_0xcb6e72){const _0x2b2b17=a41_0x5f1a,_0x2cfcac=_0x2a7efb();while(!![]){try{const _0x21d991=parseInt(_0x2b2b17(0x28d))/0x1+parseInt(_0x2b2b17(0x246))/0x2*(-parseInt(_0x2b2b17(0x241))/0x3)+-parseInt(_0x2b2b17(0x1fe))/0x4*(parseInt(_0x2b2b17(0x21c))/0x5)+-parseInt(_0x2b2b17(0x289))/0x6+-parseInt(_0x2b2b17(0x27f))/0x7*(-parseInt(_0x2b2b17(0x248))/0x8)+parseInt(_0x2b2b17(0x208))/0x9*(parseInt(_0x2b2b17(0x285))/0xa)+-parseInt(_0x2b2b17(0x268))/0xb*(-parseInt(_0x2b2b17(0x259))/0xc);if(_0x21d991===_0xcb6e72)break;else _0x2cfcac['push'](_0x2cfcac['shift']());}catch(_0xd18b13){_0x2cfcac['push'](_0x2cfcac['shift']());}}}(a41_0x34db,0xccd0c));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x25444a from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a41_0x5f1a(_0xeedf96,_0x162072){_0xeedf96=_0xeedf96-0x1ef;const _0x34db41=a41_0x34db();let _0x5f1a5f=_0x34db41[_0xeedf96];return _0x5f1a5f;}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';function a41_0x34db(){const _0x1916b1=['red','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','New\x20journey:','\x20\x20📊\x20Segments:','\x20YAML\x20files\x20found','error','name','push','96nfJgdN','parent_name','Resolving\x20parent\x20segment\x20\x27','buildUserMaps','nameToId','createdSegmentIds','relationships','\x20changed','\x20\x20\x20\x20','\x20\x20Segments:\x20','folderPath','state','activations','segment\x20or\x20journey','targetDir','2327149ADyjBP','user','created','listJourneysWithDetailsFromParentSegment','parentFolder','toString','folderId','createdAt','folders','yamlConfig','list','results','Preparing\x20journeys...','journeyId','\x20\x20Journeys:\x20','cyan','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','versionNumber','\x20changes?','message','Changes\x20to:','Delete\x20journey:','toCreate','4959619wOOUFY','journeyBundleId','verbose','changed','\x20\x20Source:\x20','/e/','90pYoGHW','deleted','\x0aError:','filePath','7956996MDUWUd','\x0aValidation\x20failed:','existingSegment','/sb/da/esr','257355tExZsE','data','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','map','toUpdate','\x20folders\x20to\x20create','get','parentName','paused','.yml','Parent\x20segment:\x20','toDelete','No\x20','endsWith','\x20updated','filter','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','287748yRWtKo','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x0a✔\x20Push\x20complete','segment:push','then','no_parent','updatedAt','add','green','description','984078ilhYYq','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','site','isNew','new','setPhase','Scoped\x20to\x20folder:\x20','attributes','connection','Fetching\x20connections\x20for\x20name\x20resolution...','Folders\x20to\x20create:','\x20to\x20create','\x20\x20🗺️\x20\x20Journeys:','\x20deleted','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','/j/da/je','New\x20segment:','execute','📁\x20','file','55Whshrr','join','\x20unchanged','(Journey\x20will\x20be\x20deleted)','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','listSegments','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','unchanged','yellow','\x20\x20Activations:\x20','getJourney','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','delete','journeys','\x20to\x20delete','dim','length','/app/ps/','journeysOnly','existingJourney','\x20activations]','listFolders','getParent','type','errorCode','all','Aborted.','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','diff','Delete\x20segment:','updated','segments','set','\x20new','\x20\x20Activations:','segmentFolderId','nameToType','15OBNEFO','\x20created','Source\x20directory:\x20','repeat','blue','274410tAZhdC','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','8QHuvyX','journey','Changes\x20to\x20journey:','\x27...','\x0aPush\x20summary\x20for\x20\x27','idToName','segment','journeyBundleName','✔\x20All\x20journeys\x20are\x20up\x20to\x20date'];a41_0x34db=function(){return _0x1916b1;};return a41_0x34db();}export class SegmentPushCommand extends BaseCommand{[a41_0xbfb39f(0x257)]=a41_0xbfb39f(0x201);[a41_0xbfb39f(0x207)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a41_0xbfb39f(0x219)](_0x28e5d8){const _0x3c1579=a41_0xbfb39f,{options:_0x4f19dd,args:_0x45bb1d,tdx:_0x146132}=_0x28e5d8,_0x13944b=_0x4f19dd,_0xd6d004=await resolveTarget({'arg':_0x45bb1d[0x0],'contextParent':_0x4f19dd['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0xd6d004))return _0xd6d004[_0x3c1579(0x234)]===_0x3c1579(0x203)?(console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x224)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x3c1579(0x256)]('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[_0x3c1579(0x256)](_0x3c1579(0x227)),console[_0x3c1579(0x256)](_0x3c1579(0x1fd))):(console['error'](a41_0x25444a[_0x3c1579(0x251)]('Error:\x20'+_0xd6d004[_0x3c1579(0x27b)]+'\x0a')),_0xd6d004['helpText']&&console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x277)](_0xd6d004['helpText']))),0x1;if(_0xd6d004[_0x3c1579(0x233)]===_0x3c1579(0x25a))return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)]('Error:\x20Directory\x20not\x20found:\x20'+_0xd6d004[_0x3c1579(0x267)]+'\x0a')),console['error'](a41_0x25444a[_0x3c1579(0x277)](_0x3c1579(0x28f))),0x1;const _0x4506f1=_0xd6d004[_0x3c1579(0x1f3)],_0x7e8f60=_0xd6d004[_0x3c1579(0x267)],_0x1c5623=_0xd6d004['type']===_0x3c1579(0x21b)?_0xd6d004[_0x3c1579(0x288)]:undefined,_0x1bd13d=getScopedDetails(_0xd6d004),_0x209e84=_0x1bd13d?.['isScoped']??![],_0x1242eb=_0x1bd13d?.['scopedFolderPath']??'';if(!existsSync(_0x7e8f60))return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)]('Error:\x20Directory\x20not\x20found:\x20'+_0x7e8f60+'\x0a')),console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x277)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x13944b[_0x3c1579(0x281)]&&(console[_0x3c1579(0x256)]('Site:\x20'+_0x13944b['site']),console[_0x3c1579(0x256)](_0x3c1579(0x1f6)+_0x4506f1),console['error'](_0x3c1579(0x243)+_0x7e8f60),_0x209e84&&console['error'](_0x3c1579(0x20e)+_0x1242eb));const _0x5292d7=await withSpinner(_0x3c1579(0x25b)+_0x4506f1+_0x3c1579(0x24b),()=>_0x146132['segment']['resolveParentId'](_0x4506f1),{'verbose':_0x13944b['verbose']}),_0x41990a=_0x5292d7['data'],{parentSegmentResult:_0x48470a,segmentsResult:_0x21b1fe,foldersResult:_0x1a6f3a,journeysWithDetailsResult:_0x37d6ba,userMaps:_0x2c62ac}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x35d735=_0x3c1579,[_0x11c16a,_0x3c2e0b,_0x43c0d2,_0x249db5,_0x5453c6]=await Promise[_0x35d735(0x235)]([_0x146132[_0x35d735(0x24e)][_0x35d735(0x232)](_0x41990a),_0x146132[_0x35d735(0x24e)][_0x35d735(0x221)](_0x41990a),_0x146132[_0x35d735(0x24e)][_0x35d735(0x231)](_0x41990a),_0x146132[_0x35d735(0x249)][_0x35d735(0x26b)](_0x41990a,{'includeAllVersions':!![]}),_0x146132['user'][_0x35d735(0x25c)]()]);return{'parentSegmentResult':_0x11c16a,'segmentsResult':_0x3c2e0b,'foldersResult':_0x43c0d2,'journeysWithDetailsResult':_0x249db5,'userMaps':_0x5453c6};},{'verbose':_0x13944b['verbose']})[_0x3c1579(0x202)](_0x5d44b1=>_0x5d44b1[_0x3c1579(0x28e)]),_0x354137=_0x48470a,_0x3ddc61=extractRootFolderId(_0x354137),_0x36dce2=_0x21b1fe,_0x1bd7af=_0x1a6f3a,{journeys:_0x4277f4,activationStepsById:_0x15c8ae}=_0x37d6ba,_0x18258a=new Map(_0x4277f4[_0x3c1579(0x1ef)](_0x9a7493=>[_0x9a7493['id'],_0x9a7493])),_0x1434c5=_0x4277f4['map'](_0x291d2d=>({'id':_0x291d2d['id'],'name':_0x291d2d[_0x3c1579(0x20f)]['name'],'journeyBundleName':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x24f)]||'','journeyBundleId':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x280)]||'','versionNumber':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x279)],'description':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x207)],'state':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x264)],'paused':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x1f4)],'audienceId':_0x291d2d[_0x3c1579(0x20f)]['audienceId'],'folderId':_0x291d2d[_0x3c1579(0x25f)]?.[_0x3c1579(0x26c)]?.['data']?.['id'],'createdAt':_0x291d2d['attributes'][_0x3c1579(0x26f)],'updatedAt':_0x291d2d[_0x3c1579(0x20f)][_0x3c1579(0x204)]})),{emailToId:_0x4e0850,idToEmail:_0x513eae}=_0x2c62ac,_0x4a29b0=await withSpinner(_0x3c1579(0x211),async()=>{const _0x30d396=_0x3c1579,_0x45da79=await _0x146132['connection'][_0x30d396(0x272)]();return buildConnectionMaps(_0x45da79);},{'verbose':_0x13944b[_0x3c1579(0x281)]})[_0x3c1579(0x202)](_0x5acf1f=>_0x5acf1f[_0x3c1579(0x28e)]),_0x85212f=_0x4a29b0['nameToId'],_0x3bb562=_0x4a29b0[_0x3c1579(0x24d)],_0x475d6a=_0x4a29b0[_0x3c1579(0x240)],_0x2fb0c5={'emailToIdMap':_0x4e0850,'connectionNameToIdMap':_0x85212f,'connectionNameToTypeMap':_0x475d6a,'getSchema':_0x515e3e=>_0x146132[_0x3c1579(0x210)]['getOutputSchemaWithCache'](_0x515e3e)};let {pathToId:_0x2671c3,idToPath:_0x1af09c}=buildFolderMaps(_0x1bd7af);const _0x35c145=buildSegmentLookupMap(_0x36dce2,_0x1af09c),_0x551ed5=buildSegmentNameToIdMap(_0x36dce2),_0x3cf54d=buildJourneyBundleLookupMap(_0x1434c5,_0x1af09c);let _0x32757c;if(_0x1c5623){if(!_0x1c5623[_0x3c1579(0x1f9)](_0x3c1579(0x1f5))&&!_0x1c5623[_0x3c1579(0x1f9)]('.yaml'))return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x209)+_0x1c5623+'\x0a')),0x1;_0x32757c=[_0x1c5623];}else _0x32757c=findYamlFiles(_0x7e8f60);if(_0x32757c[_0x3c1579(0x22c)]===0x0)return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x278)+_0x7e8f60+'\x0a')),console['error'](a41_0x25444a['cyan'](_0x3c1579(0x237))),0x1;let _0x384973,_0x30adcc;try{const _0x87f6d9=parseAndClassifyYamlFiles(_0x32757c,_0x7e8f60,{'skipSegments':_0x13944b[_0x3c1579(0x22e)]});_0x384973=_0x87f6d9['segments'],_0x30adcc=_0x87f6d9['journeys'];const _0x5867b9=validateParsedFiles(_0x87f6d9,_0x7e8f60);if(_0x5867b9[_0x3c1579(0x22c)]>0x0)return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x28a))),console[_0x3c1579(0x256)](formatValidationErrors(_0x5867b9)),console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x224)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x5f82ba){return console[_0x3c1579(0x256)](a41_0x25444a['red']('Error\x20parsing\x20YAML:\x20'+(_0x5f82ba instanceof Error?_0x5f82ba['message']:_0x5f82ba))),0x1;}if(_0x384973[_0x3c1579(0x22c)]===0x0&&_0x30adcc[_0x3c1579(0x22c)]===0x0){const _0x12a1f2=_0x13944b['journeysOnly']?_0x3c1579(0x249):_0x3c1579(0x266);return console['error'](a41_0x25444a[_0x3c1579(0x224)](_0x3c1579(0x1f8)+_0x12a1f2+_0x3c1579(0x255))),0x0;}const _0x23273a=new Map();_0x36dce2[_0x3c1579(0x22c)]>0x0&&!_0x13944b[_0x3c1579(0x22e)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x36dce2,async _0x4d2165=>{const _0x56bd32=a41_0x5f1a,_0x3f2278=await _0x146132[_0x56bd32(0x24e)]['listActivations'](_0x41990a,_0x4d2165['id']);_0x23273a['set'](_0x4d2165['id'],_0x3f2278);});},{'verbose':_0x13944b[_0x3c1579(0x281)]});const {segmentFiles:_0x2f5798,foldersToCreate:_0x2d73e0}=await prepareSegmentFiles(_0x384973,{'segmentByFolderAndName':_0x35c145,'activationsBySegmentId':_0x23273a,'folderPathToId':_0x2671c3,'idToEmailMap':_0x513eae,'connectionIdToNameMap':_0x3bb562},_0x2fb0c5,_0x209e84,_0x1242eb),_0x10e982=_0x1c5623?[]:findSegmentsToDelete(_0x36dce2,_0x384973[_0x3c1579(0x1ef)](({yamlConfig:_0x34d39a,folderPath:_0x1a8526})=>({'yamlConfig':_0x34d39a,'folderPath':resolveTDFolderPath(_0x1a8526,_0x209e84,_0x1242eb)})),_0x1af09c,_0x1242eb,_0x209e84),{journeyFiles:_0x247893,foldersToCreate:_0x58c79e}=await withProgressSpinner(_0x3c1579(0x274),async _0x5dabe1=>prepareJourneyFiles(_0x30adcc,{'fetchJourney':async _0x3ab3a5=>_0x146132[_0x3c1579(0x249)][_0x3c1579(0x226)](_0x3ab3a5[_0x3c1579(0x275)]),'journeyBundlesByFolderAndName':_0x3cf54d,'folderPathToId':_0x2671c3,'idToEmailMap':_0x513eae,'connectionIdToNameMap':_0x3bb562,'existingSegments':_0x36dce2,'parentId':_0x41990a,'deps':_0x146132,'progress':{'update':_0x10c65b=>{const _0x35fd00=_0x3c1579;_0x5dabe1[_0x35fd00(0x20d)](_0x10c65b),_0x13944b[_0x35fd00(0x281)]&&console[_0x35fd00(0x256)]('\x20\x20'+_0x10c65b);}},'journeyById':_0x18258a,'activationStepsById':_0x15c8ae},_0x209e84,_0x1242eb),{'verbose':_0x13944b[_0x3c1579(0x281)]})[_0x3c1579(0x202)](_0x3520a9=>_0x3520a9[_0x3c1579(0x28e)]);for(const _0x5cb9a3 of _0x58c79e){_0x2d73e0[_0x3c1579(0x205)](_0x5cb9a3);}const _0x5e98bc=_0x1c5623?[]:findJourneysToDelete(_0x1434c5,_0x30adcc[_0x3c1579(0x1ef)](({yamlConfig:_0x2e5091,folderPath:_0x6a1b42})=>({'yamlConfig':_0x2e5091,'folderPath':resolveTDFolderPath(_0x6a1b42,_0x209e84,_0x1242eb)})),_0x1af09c,_0x1242eb,_0x209e84),_0x5d7dc4=calculatePushStats(_0x2f5798,_0x247893,_0x2d73e0,_0x10e982,_0x5e98bc,!!_0x13944b[_0x3c1579(0x228)],!!_0x13944b[_0x3c1579(0x22e)]),_0x53f150=_0x5d7dc4[_0x3c1579(0x23b)][_0x3c1579(0x20c)],_0x424343=_0x5d7dc4[_0x3c1579(0x23b)][_0x3c1579(0x282)],_0x158215=_0x5d7dc4[_0x3c1579(0x23b)]['unchanged'],_0x21e577=_0x5d7dc4['segments']['toDelete'],_0x5576b2=_0x5d7dc4[_0x3c1579(0x270)][_0x3c1579(0x27e)],_0x23096a=_0x5d7dc4[_0x3c1579(0x229)][_0x3c1579(0x20c)],_0x1241e2=_0x5d7dc4['journeys']['changed'],_0x267aff=_0x5d7dc4[_0x3c1579(0x229)][_0x3c1579(0x223)],_0x22bca9=_0x5d7dc4[_0x3c1579(0x229)][_0x3c1579(0x1f7)],_0x7f77c9=_0x5d7dc4[_0x3c1579(0x265)][_0x3c1579(0x235)],_0x2ece6e=_0x5d7dc4[_0x3c1579(0x265)][_0x3c1579(0x27e)],_0x2166a0=_0x5d7dc4[_0x3c1579(0x265)][_0x3c1579(0x1f0)],_0x3537dd=_0x5d7dc4[_0x3c1579(0x265)][_0x3c1579(0x1f7)];console['error'](_0x3c1579(0x24c)+_0x4506f1+'\x27:');_0x5576b2[_0x3c1579(0x22c)]>0x0&&console['error']('\x20\x20'+a41_0x25444a['blue'](_0x3c1579(0x21a)+_0x5576b2[_0x3c1579(0x22c)]+_0x3c1579(0x1f1)));if(!_0x13944b['journeysOnly']){console['error'](_0x3c1579(0x254)),console['error']('\x20\x20\x20\x20'+a41_0x25444a[_0x3c1579(0x206)]('+\x20'+_0x53f150[_0x3c1579(0x22c)]+_0x3c1579(0x23d))),console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a['yellow']('~\x20'+_0x424343[_0x3c1579(0x22c)]+_0x3c1579(0x260)));if(_0x21e577[_0x3c1579(0x22c)]>0x0)console[_0x3c1579(0x256)]('\x20\x20\x20\x20'+a41_0x25444a[_0x3c1579(0x251)]('-\x20'+_0x21e577[_0x3c1579(0x22c)]+'\x20to\x20delete'));else _0x10e982[_0x3c1579(0x22c)]>0x0&&!_0x13944b[_0x3c1579(0x228)]&&console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a['dim'](_0x10e982[_0x3c1579(0x22c)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a[_0x3c1579(0x22b)]('=\x20'+_0x158215[_0x3c1579(0x22c)]+_0x3c1579(0x21e)));}if(_0x247893[_0x3c1579(0x22c)]>0x0||_0x5e98bc['length']>0x0){console[_0x3c1579(0x256)](_0x3c1579(0x214)),console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a['green']('+\x20'+_0x23096a[_0x3c1579(0x22c)]+'\x20new')),console['error'](_0x3c1579(0x261)+a41_0x25444a['yellow']('~\x20'+_0x1241e2['length']+'\x20changed'));if(_0x22bca9[_0x3c1579(0x22c)]>0x0)console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a[_0x3c1579(0x251)]('-\x20'+_0x22bca9[_0x3c1579(0x22c)]+_0x3c1579(0x22a)));else _0x5e98bc['length']>0x0&&!_0x13944b[_0x3c1579(0x228)]&&console[_0x3c1579(0x256)]('\x20\x20\x20\x20'+a41_0x25444a[_0x3c1579(0x22b)](_0x5e98bc[_0x3c1579(0x22c)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x3c1579(0x261)+a41_0x25444a[_0x3c1579(0x22b)]('=\x20'+_0x267aff[_0x3c1579(0x22c)]+'\x20unchanged'));}_0x7f77c9[_0x3c1579(0x22c)]>0x0&&!_0x13944b[_0x3c1579(0x22e)]&&(console[_0x3c1579(0x256)](''),console[_0x3c1579(0x256)](_0x3c1579(0x23e)),_0x2ece6e[_0x3c1579(0x22c)]>0x0&&console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a[_0x3c1579(0x206)]('+\x20'+_0x2ece6e[_0x3c1579(0x22c)]+_0x3c1579(0x213))),_0x2166a0['length']>0x0&&console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a['yellow']('~\x20'+_0x2166a0['length']+'\x20to\x20update')),_0x3537dd[_0x3c1579(0x22c)]>0x0&&console[_0x3c1579(0x256)](_0x3c1579(0x261)+a41_0x25444a[_0x3c1579(0x251)]('-\x20'+_0x3537dd[_0x3c1579(0x22c)]+_0x3c1579(0x22a))));console[_0x3c1579(0x256)](_0x3c1579(0x283)+a41_0x25444a['cyan'](_0x7e8f60)+'\x0a');if(_0x5576b2[_0x3c1579(0x22c)]>0x0){console[_0x3c1579(0x256)](_0x3c1579(0x212));for(const _0x399974 of _0x5576b2){console['error']('\x20\x20'+a41_0x25444a[_0x3c1579(0x245)]('+')+'\x20'+_0x399974);}console['error']('');}if(_0x53f150[_0x3c1579(0x22c)]>0x0&&!_0x13944b[_0x3c1579(0x22e)])for(const _0x1943c5 of _0x53f150){const _0x10c21f=_0x1943c5[_0x3c1579(0x263)]?_0x1943c5[_0x3c1579(0x263)]+'/'+_0x1943c5[_0x3c1579(0x271)][_0x3c1579(0x257)]:_0x1943c5[_0x3c1579(0x271)][_0x3c1579(0x257)],_0x6837a5=_0x1943c5[_0x3c1579(0x271)][_0x3c1579(0x265)]?.[_0x3c1579(0x22c)]||0x0,_0x330653=_0x6837a5>0x0?a41_0x25444a[_0x3c1579(0x22b)]('\x20['+_0x6837a5+_0x3c1579(0x230)):'';console[_0x3c1579(0x256)]('\x0a'+a41_0x25444a[_0x3c1579(0x206)](_0x3c1579(0x218))+'\x20'+_0x10c21f+_0x330653),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c)),_0x1943c5['diff']&&console[_0x3c1579(0x256)](_0x1943c5[_0x3c1579(0x238)]),console[_0x3c1579(0x256)]('─'['repeat'](0x3c));}if(_0x21e577[_0x3c1579(0x22c)]>0x0&&!_0x13944b[_0x3c1579(0x22e)])for(const _0x3cc312 of _0x21e577){const _0x1546e2=_0x3cc312[_0x3c1579(0x23f)]?_0x1af09c[_0x3c1579(0x1f2)](_0x3cc312[_0x3c1579(0x23f)][_0x3c1579(0x26d)]())||'':'',_0xc37551=_0x1546e2?_0x1546e2+'/'+_0x3cc312[_0x3c1579(0x257)]:_0x3cc312[_0x3c1579(0x257)],_0x9b5088=_0x23273a[_0x3c1579(0x1f2)](_0x3cc312['id'])||[],_0x4b6555=_0x9b5088['length']>0x0?a41_0x25444a['dim']('\x20['+_0x9b5088[_0x3c1579(0x22c)]+_0x3c1579(0x230)):'';console[_0x3c1579(0x256)]('\x0a'+a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x239))+'\x20'+_0xc37551+_0x4b6555),console['error']('─'['repeat'](0x3c));const _0x20d7dd=segmentWithActivationsToYaml(_0x3cc312,_0x9b5088,undefined,_0x513eae,_0x3bb562),_0x3dbdc0=segmentToYamlString(_0x20d7dd),_0x20c8ce=generateDiff(_0x3dbdc0,'');console['error'](formatDiffWithColors(_0x20c8ce)),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c));}const _0x5da5a2=_0x2f5798[_0x3c1579(0x1fb)](_0x59bf81=>!_0x59bf81[_0x3c1579(0x20b)]&&_0x59bf81[_0x3c1579(0x238)]);if(_0x5da5a2['length']>0x0&&!_0x13944b[_0x3c1579(0x22e)])for(const _0x5a44ab of _0x5da5a2){const _0x2928f1=_0x5a44ab['folderPath']?_0x5a44ab[_0x3c1579(0x263)]+'/'+_0x5a44ab[_0x3c1579(0x271)][_0x3c1579(0x257)]:_0x5a44ab['yamlConfig'][_0x3c1579(0x257)];console['error']('\x0a'+a41_0x25444a[_0x3c1579(0x224)](_0x3c1579(0x27c))+'\x20'+_0x2928f1),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c)),console[_0x3c1579(0x256)](_0x5a44ab['diff']),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c));}if(_0x23096a[_0x3c1579(0x22c)]>0x0)for(const _0x2f42f1 of _0x23096a){const _0x4077ec=_0x2f42f1[_0x3c1579(0x263)]?_0x2f42f1[_0x3c1579(0x263)]+'/'+_0x2f42f1[_0x3c1579(0x271)][_0x3c1579(0x257)]:_0x2f42f1['yamlConfig'][_0x3c1579(0x257)];console[_0x3c1579(0x256)]('\x0a'+a41_0x25444a['green'](_0x3c1579(0x253))+'\x20'+_0x4077ec),console['error']('─'[_0x3c1579(0x244)](0x3c)),_0x2f42f1[_0x3c1579(0x238)]&&console[_0x3c1579(0x256)](_0x2f42f1[_0x3c1579(0x238)]),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c));}const _0x3c96ea=_0x247893[_0x3c1579(0x1fb)](_0x3fedec=>!_0x3fedec[_0x3c1579(0x20b)]&&_0x3fedec[_0x3c1579(0x238)]);if(_0x3c96ea[_0x3c1579(0x22c)]>0x0)for(const _0x599b14 of _0x3c96ea){const _0x1fb293=_0x599b14[_0x3c1579(0x263)]?_0x599b14[_0x3c1579(0x263)]+'/'+_0x599b14[_0x3c1579(0x271)][_0x3c1579(0x257)]:_0x599b14['yamlConfig'][_0x3c1579(0x257)];console['error']('\x0a'+a41_0x25444a[_0x3c1579(0x224)](_0x3c1579(0x24a))+'\x20'+_0x1fb293),console['error']('─'[_0x3c1579(0x244)](0x3c)),console[_0x3c1579(0x256)](_0x599b14['diff']),console[_0x3c1579(0x256)]('─'[_0x3c1579(0x244)](0x3c));}if(_0x22bca9[_0x3c1579(0x22c)]>0x0)for(const _0x1ae800 of _0x22bca9){const _0x336481=_0x1ae800[_0x3c1579(0x26e)]?_0x1af09c[_0x3c1579(0x1f2)](_0x1ae800['folderId'])||'':'',_0x437e68=_0x336481?_0x336481+'/'+_0x1ae800[_0x3c1579(0x24f)]:_0x1ae800['journeyBundleName'];console[_0x3c1579(0x256)]('\x0a'+a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x27d))+'\x20'+_0x437e68),console['error']('─'[_0x3c1579(0x244)](0x3c)),console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x21f))),console['error']('─'[_0x3c1579(0x244)](0x3c));}if(_0x13944b[_0x3c1579(0x1fc)])return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x224)](_0x3c1579(0x216))),0x0;const _0xc4574f=_0x13944b[_0x3c1579(0x22e)]?![]:_0x53f150[_0x3c1579(0x22c)]>0x0||_0x424343[_0x3c1579(0x22c)]>0x0||_0x21e577[_0x3c1579(0x22c)]>0x0,_0x4009b3=_0x23096a['length']>0x0||_0x1241e2[_0x3c1579(0x22c)]>0x0||_0x22bca9[_0x3c1579(0x22c)]>0x0,_0x3fd9cb=_0x13944b[_0x3c1579(0x22e)]?![]:_0x7f77c9['length']>0x0,_0x216c1a=_0x5576b2[_0x3c1579(0x22c)]>0x0;if(!_0xc4574f&&!_0x4009b3&&!_0x3fd9cb&&!_0x216c1a){const _0xd7048f=_0x13944b[_0x3c1579(0x22e)]?_0x3c1579(0x250):_0x3c1579(0x222);console['error'](a41_0x25444a[_0x3c1579(0x206)](_0xd7048f));if(_0x1c5623&&_0x158215[_0x3c1579(0x22c)]===0x1){const _0x4fd206=_0x158215[0x0];if(_0x4fd206[_0x3c1579(0x28b)]?.['id']){const _0x3fb930=getConsoleNextUrl(_0x13944b[_0x3c1579(0x20a)],_0x3c1579(0x22d)+_0x41990a+_0x3c1579(0x284)+_0x4fd206[_0x3c1579(0x28b)]['id']+'/sb/da/esr');console[_0x3c1579(0x256)](_0x3c1579(0x252)+a41_0x25444a[_0x3c1579(0x277)](_0x3fb930));}}if(_0x1c5623&&_0x267aff['length']===0x1){const _0x13a092=_0x267aff[0x0];if(_0x13a092[_0x3c1579(0x22f)]?.['id']){const _0x4bb712=getConsoleNextUrl(_0x13944b[_0x3c1579(0x20a)],_0x3c1579(0x22d)+_0x41990a+_0x3c1579(0x284)+_0x13a092[_0x3c1579(0x22f)]['id']+'/j/da/je');console[_0x3c1579(0x256)]('\x20\x20'+a41_0x25444a[_0x3c1579(0x277)](_0x4bb712));}}return 0x0;}const _0x5d3bfe=_0x13944b[_0x3c1579(0x22e)]?_0x23096a[_0x3c1579(0x22c)]+_0x1241e2[_0x3c1579(0x22c)]+_0x22bca9[_0x3c1579(0x22c)]+_0x5576b2['length']:_0x53f150['length']+_0x424343[_0x3c1579(0x22c)]+_0x21e577[_0x3c1579(0x22c)]+_0x23096a[_0x3c1579(0x22c)]+_0x1241e2[_0x3c1579(0x22c)]+_0x22bca9[_0x3c1579(0x22c)]+_0x5576b2[_0x3c1579(0x22c)]+_0x7f77c9[_0x3c1579(0x22c)];if(!_0x13944b['yes']&&_0x5d3bfe>0x0){if(!isInteractive())return console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x251)](_0x3c1579(0x287)),_0x3c1579(0x1ff)),console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x22b)](_0x3c1579(0x220))),0x1;const _0x3a6724=await confirmKey('Push\x20'+_0x5d3bfe+_0x3c1579(0x27a));if(!_0x3a6724)return console['error'](a41_0x25444a['yellow'](_0x3c1579(0x236))),0x1;}const _0x4f6b64={'withProgress':async(_0x8c3678,_0x2025e1)=>{const _0x2352ac=_0x3c1579,_0x195707=await withSpinner(_0x8c3678,_0x2025e1,{'verbose':_0x13944b[_0x2352ac(0x281)]});return{'data':_0x195707[_0x2352ac(0x28e)]};},'logInfo':_0x481d91=>console['error'](a41_0x25444a[_0x3c1579(0x245)]('✔\x20'+_0x481d91)),'logSuccess':_0xf57d3f=>console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x206)]('✔\x20'+_0xf57d3f)),'logWarning':_0x525f97=>console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x224)]('⚠\x20'+_0x525f97)),'logDeleted':_0x19f547=>console['error'](a41_0x25444a[_0x3c1579(0x251)]('✔\x20'+_0x19f547))},_0x514791={'segment':_0x146132[_0x3c1579(0x24e)],'journey':_0x146132[_0x3c1579(0x249)],'user':_0x146132[_0x3c1579(0x269)],'connection':_0x146132[_0x3c1579(0x210)]};_0x5576b2[_0x3c1579(0x22c)]>0x0&&(_0x2671c3=await executePushFolders(_0x514791,_0x5576b2,_0x2671c3,{'parentId':_0x41990a},_0x4f6b64));const _0x29ad08={'rootFolderId':_0x3ddc61,'folderPathToId':_0x2671c3,'folderIdToPath':_0x1af09c,'segmentNameToId':_0x551ed5,'activationsBySegmentId':_0x23273a,'emailToIdMap':_0x4e0850,'idToEmailMap':_0x513eae,'connectionNameToIdMap':_0x4a29b0[_0x3c1579(0x25d)],'connectionIdToNameMap':_0x4a29b0[_0x3c1579(0x24d)],'connectionNameToTypeMap':_0x475d6a},_0x17fd3f=await executePushSegments(_0x514791,_0x13944b[_0x3c1579(0x22e)]?[]:_0x2f5798,_0x29ad08,{'parentId':_0x41990a},_0x4f6b64),_0x534099=_0x17fd3f['created'],_0x46e8b2=_0x17fd3f[_0x3c1579(0x23a)],_0x5057f5=_0x17fd3f[_0x3c1579(0x265)][_0x3c1579(0x26a)],_0x1134af=_0x17fd3f[_0x3c1579(0x265)][_0x3c1579(0x23a)],_0x144d7e=_0x17fd3f[_0x3c1579(0x265)][_0x3c1579(0x286)];let _0x4eb7d9;if(_0x1c5623&&_0x2f5798[_0x3c1579(0x22c)]===0x1){const _0x45a49d=_0x2f5798[0x0];_0x4eb7d9=_0x45a49d['existingSegment']?.['id']??_0x17fd3f[_0x3c1579(0x25e)][_0x3c1579(0x1f2)](_0x45a49d['yamlConfig'][_0x3c1579(0x257)]);}const _0x32160f=await executePushSegmentDeletions(_0x514791,_0x13944b[_0x3c1579(0x22e)]?[]:_0x21e577,_0x4f6b64);let _0x26be9f=0x0,_0x1ae5bd=0x0,_0x577646=0x0;const _0x4a939b=new Map(_0x551ed5);for(const [_0xbf59ac,_0x1ff7eb]of _0x17fd3f['createdSegmentIds']){_0x4a939b[_0x3c1579(0x23c)](_0xbf59ac,_0x1ff7eb);}if(_0x247893['length']>0x0){const _0x1fd559={..._0x29ad08,'segmentNameToId':_0x4a939b,'existingSegments':_0x36dce2,'activationContext':_0x2fb0c5},_0x45018b=await executePushJourneys(_0x514791,_0x247893,_0x1fd559,{'parentId':_0x41990a,'rootFolderId':_0x3ddc61,'verbose':_0x13944b[_0x3c1579(0x281)]},_0x4f6b64);_0x26be9f=_0x45018b[_0x3c1579(0x26a)],_0x1ae5bd=_0x45018b[_0x3c1579(0x23a)];if(_0x1c5623&&_0x45018b[_0x3c1579(0x273)]['length']===0x1){const _0x2a2a92=_0x45018b[_0x3c1579(0x273)][0x0];if(_0x2a2a92['journeyId']){const _0x30cd44=getConsoleNextUrl(_0x13944b['site'],'/app/ps/'+_0x41990a+_0x3c1579(0x284)+_0x2a2a92[_0x3c1579(0x275)]+_0x3c1579(0x217));console[_0x3c1579(0x256)]('\x20\x20'+a41_0x25444a[_0x3c1579(0x277)](_0x30cd44));}}}for(const _0x1598e5 of _0x22bca9){console[_0x3c1579(0x256)](a41_0x25444a['yellow'](_0x3c1579(0x247)+_0x1598e5['journeyBundleName'])),_0x577646++;}const _0x169633=[];if(_0x534099>0x0)_0x169633[_0x3c1579(0x258)](_0x534099+'\x20created');if(_0x46e8b2>0x0)_0x169633['push'](_0x46e8b2+_0x3c1579(0x1fa));if(_0x32160f>0x0)_0x169633[_0x3c1579(0x258)](_0x32160f+_0x3c1579(0x215));const _0x54d8f1=[];if(_0x26be9f>0x0)_0x54d8f1[_0x3c1579(0x258)](_0x26be9f+'\x20created');if(_0x1ae5bd>0x0)_0x54d8f1[_0x3c1579(0x258)](_0x1ae5bd+'\x20updated');if(_0x577646>0x0)_0x54d8f1['push'](_0x577646+_0x3c1579(0x215));const _0xa43179=[];if(_0x5057f5>0x0)_0xa43179[_0x3c1579(0x258)](_0x5057f5+_0x3c1579(0x242));if(_0x1134af>0x0)_0xa43179['push'](_0x1134af+_0x3c1579(0x1fa));if(_0x144d7e>0x0)_0xa43179[_0x3c1579(0x258)](_0x144d7e+_0x3c1579(0x215));console[_0x3c1579(0x256)](a41_0x25444a[_0x3c1579(0x206)](_0x3c1579(0x200)));_0x169633['length']>0x0&&!_0x13944b[_0x3c1579(0x22e)]&&console['error'](_0x3c1579(0x262)+_0x169633['join'](',\x20'));_0x54d8f1['length']>0x0&&console[_0x3c1579(0x256)](_0x3c1579(0x276)+_0x54d8f1[_0x3c1579(0x21d)](',\x20'));_0xa43179['length']>0x0&&!_0x13944b[_0x3c1579(0x22e)]&&console[_0x3c1579(0x256)](_0x3c1579(0x225)+_0xa43179[_0x3c1579(0x21d)](',\x20'));if(_0x4eb7d9){const _0x46a80e=getConsoleNextUrl(_0x13944b[_0x3c1579(0x20a)],_0x3c1579(0x22d)+_0x41990a+_0x3c1579(0x284)+_0x4eb7d9+_0x3c1579(0x28c));console[_0x3c1579(0x256)](_0x3c1579(0x252)+a41_0x25444a[_0x3c1579(0x277)](_0x46a80e));}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_0x5e01bf=a45_0x3e9c;(function(_0x2d3ec6,_0x4e043c){const _0x4e771d=a45_0x3e9c,_0xa9275e=_0x2d3ec6();while(!![]){try{const _0x244551=-parseInt(_0x4e771d(0x147))/0x1*(parseInt(_0x4e771d(0x15d))/0x2)+-parseInt(_0x4e771d(0x140))/0x3*(parseInt(_0x4e771d(0x167))/0x4)+-parseInt(_0x4e771d(0x146))/0x5*(-parseInt(_0x4e771d(0x132))/0x6)+-parseInt(_0x4e771d(0x172))/0x7+-parseInt(_0x4e771d(0x13d))/0x8*(-parseInt(_0x4e771d(0x14f))/0x9)+parseInt(_0x4e771d(0x159))/0xa*(-parseInt(_0x4e771d(0x13a))/0xb)+parseInt(_0x4e771d(0x15b))/0xc;if(_0x244551===_0x4e043c)break;else _0xa9275e['push'](_0xa9275e['shift']());}catch(_0x488090){_0xa9275e['push'](_0xa9275e['shift']());}}}(a45_0x1f29,0x9aa26));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a45_0x3e9c(_0x189e6b,_0x1e6a2f){_0x189e6b=_0x189e6b-0x12b;const _0x1f2925=a45_0x1f29();let _0x3e9c71=_0x1f2925[_0x189e6b];return _0x3e9c71;}import{handleSDKOutput}from'../core/command-output.js';function a45_0x1f29(){const _0xce543d=['length','22YGQEGA','map','jsonl','737544MFbHqc','\x27...','dim','369813MMpQaQ','listUnifiedWithJourneys','segments','\x20\x20Cause:\x20','\x20folder','sort','30lmVmOw','3309AjSTDL','format','maxDepth','folderId','listRecursive','includes','resolvePathToResource','name','99ydGhnC','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','replace','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x5c$&','localeCompare','journey','Parent\x20ID:\x20','✔\x20Found\x20','folder','2081530ByLmYB','/app/ps/','6219900gKzZRv','Resolving\x20path\x20\x27','276nFTUrW','Parent\x20segment\x20context:\x20','Recursive\x20mode:\x20enabled','type','journeys','execute','cause','Building\x20hierarchy\x20tree...','message','\x20journey','32aEhrlI','description','(empty)','Resolving\x20parent\x20segment\x20\x27',',\x20and\x20','site','List\x20folders\x20and\x20child\x20segments','parentId',']\x20matching\x20\x27','parentSegment','verbose','1064014gsIios','Folder\x20ID:\x20','folders','\x20matching\x20\x27','Site:\x20','test','No\x20items\x20match\x20pattern:\x20','json','children','recursive','Set\x20a\x20parent\x20segment\x20context\x20first:','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20segment','log','/j/da','error','listUnified','listWithPattern','1112052ruiwFY','data','segment','filter','journeyBundleName','/e/','Folder/pattern\x20arg:\x20'];a45_0x1f29=function(){return _0xce543d;};return a45_0x1f29();}import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x12945b from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x5e01bf(0x14e)]=a45_0x5e01bf(0x142);[a45_0x5e01bf(0x168)]=a45_0x5e01bf(0x16d);async[a45_0x5e01bf(0x162)](_0x3faf12){const _0x5d5d42=a45_0x5e01bf,{options:_0x3e62f9,args:_0x3edeb7}=_0x3faf12,_0x2af59e=_0x3e62f9[_0x5d5d42(0x17b)],_0x382903=_0x3edeb7[0x0];try{const _0xa1ee36=_0x3e62f9[_0x5d5d42(0x170)];_0x3e62f9[_0x5d5d42(0x171)]&&(console['error'](_0x5d5d42(0x176)+_0x3e62f9[_0x5d5d42(0x16c)]),console[_0x5d5d42(0x12f)](_0x5d5d42(0x15e)+(_0xa1ee36||'(not\x20set)')),_0x382903&&console[_0x5d5d42(0x12f)](_0x5d5d42(0x138)+_0x382903),_0x2af59e&&console['error'](_0x5d5d42(0x15f)));if(!_0xa1ee36)return console['error']('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x5d5d42(0x12f)](''),console[_0x5d5d42(0x12f)](_0x5d5d42(0x17c)),console[_0x5d5d42(0x12f)](_0x5d5d42(0x150)),console[_0x5d5d42(0x12f)](_0x5d5d42(0x152)),console[_0x5d5d42(0x12f)](''),console[_0x5d5d42(0x12f)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x55b744=_0x382903&&(_0x382903[_0x5d5d42(0x14c)]('*')||_0x382903['includes']('?'));if(_0x55b744)return await this[_0x5d5d42(0x131)](_0x3faf12,_0xa1ee36,_0x382903);const _0x36a96d=_0x382903?_0xa1ee36+'/'+_0x382903:_0xa1ee36;return _0x2af59e?await this[_0x5d5d42(0x14b)](_0x3faf12,_0x36a96d):await this[_0x5d5d42(0x130)](_0x3faf12,_0x36a96d);}catch(_0x85e16){if(_0x85e16 instanceof SDKError)return console[_0x5d5d42(0x12f)]('Error:\x20'+_0x85e16[_0x5d5d42(0x165)]),_0x85e16[_0x5d5d42(0x163)]&&console[_0x5d5d42(0x12f)](_0x5d5d42(0x143)+_0x85e16[_0x5d5d42(0x163)]),0x1;throw _0x85e16;}}async[a45_0x5e01bf(0x131)](_0x5c890d,_0x3703e4,_0x59ec4a){const _0x432be9=a45_0x5e01bf,{options:_0x5703d5,tdx:_0x5d3434}=_0x5c890d,_0x3ca8c9=await withSpinner(_0x432be9(0x16a)+_0x3703e4+_0x432be9(0x13e),()=>_0x5d3434[_0x432be9(0x134)][_0x432be9(0x14d)](_0x3703e4),{'verbose':_0x5703d5['verbose']}),_0x2e7646=_0x3ca8c9['data'],_0x24586d=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x5d3434[_0x432be9(0x134)][_0x432be9(0x141)](_0x2e7646[_0x432be9(0x16e)],_0x2e7646[_0x432be9(0x14a)]),{'verbose':_0x5703d5[_0x432be9(0x171)]}),{folders:_0x413ed4,segments:_0x566d1d,journeys:_0x4d4548}=_0x24586d[_0x432be9(0x133)],_0x29a30b=_0x59ec4a['replace'](/[.+^${}()|[\]\\]/g,_0x432be9(0x153))[_0x432be9(0x151)](/\*/g,'.*')[_0x432be9(0x151)](/\?/g,'.'),_0x45e8eb=new RegExp('^'+_0x29a30b+'$','i'),_0x10b833=_0x413ed4[_0x432be9(0x135)](_0x47cfc7=>_0x45e8eb['test'](_0x47cfc7[_0x432be9(0x14e)])),_0x193e20=_0x566d1d[_0x432be9(0x135)](_0x17afcf=>_0x45e8eb['test'](_0x17afcf[_0x432be9(0x14e)])),_0x510935=_0x4d4548['filter'](_0x16e204=>_0x45e8eb[_0x432be9(0x177)](_0x16e204[_0x432be9(0x136)])),_0xafad9e=_0x10b833[_0x432be9(0x139)]+_0x193e20[_0x432be9(0x139)]+_0x510935['length'];console[_0x432be9(0x12f)](_0x432be9(0x157)+_0x10b833[_0x432be9(0x139)]+_0x432be9(0x144)+(_0x10b833[_0x432be9(0x139)]!==0x1?'s':'')+',\x20'+_0x193e20[_0x432be9(0x139)]+_0x432be9(0x12c)+(_0x193e20[_0x432be9(0x139)]!==0x1?'s':'')+_0x432be9(0x16b)+_0x510935[_0x432be9(0x139)]+_0x432be9(0x166)+(_0x510935['length']!==0x1?'s':'')+_0x432be9(0x175)+_0x59ec4a+'\x27');const _0x1be8b2=_0x54420a=>{const _0x533dd=_0x432be9;return getConsoleNextUrl(_0x5703d5['site'],_0x533dd(0x15a)+_0x2e7646['parentId']+_0x533dd(0x137)+_0x54420a);},_0x2c5bda=_0x5703d5[_0x432be9(0x148)]===_0x432be9(0x179)||_0x5703d5[_0x432be9(0x148)]==='jsonl';if(_0x2c5bda){const _0x58ce22=[..._0x10b833['map'](_0x5b5022=>({..._0x5b5022,'type':'folder'})),..._0x193e20[_0x432be9(0x13b)](_0x3d3867=>({..._0x3d3867,'type':'segment','url':_0x1be8b2(_0x3d3867['id'])})),..._0x510935['map'](_0x1924d7=>({..._0x1924d7,'name':_0x1924d7[_0x432be9(0x136)],'type':_0x432be9(0x155)}))][_0x432be9(0x145)]((_0x43909d,_0x51e085)=>_0x43909d['name'][_0x432be9(0x154)](_0x51e085['name']));await handleSDKOutput(_0x58ce22,_0x5703d5);}else{if(_0xafad9e===0x0)console[_0x432be9(0x12d)](_0x432be9(0x178)+_0x59ec4a);else{console[_0x432be9(0x12d)](a45_0x12945b['dim']('['+_0x3703e4+_0x432be9(0x16f)+_0x59ec4a+'\x27'));const _0xbca2e3=formatFlatList(_0x10b833,_0x193e20,{'showMetadata':!![],'getSegmentUrl':_0x1be8b2},_0x510935);console[_0x432be9(0x12d)](_0xbca2e3);}}return 0x0;}async['listUnified'](_0xec7962,_0x2fb781){const _0x4ae0e1=a45_0x5e01bf,{options:_0x186edf,tdx:_0x26f750}=_0xec7962,_0x582a6b=await withSpinner(_0x4ae0e1(0x15c)+_0x2fb781+'\x27...',()=>_0x26f750[_0x4ae0e1(0x134)]['resolvePathToResource'](_0x2fb781),{'verbose':_0x186edf[_0x4ae0e1(0x171)]}),_0x21c135=_0x582a6b[_0x4ae0e1(0x133)];_0x186edf[_0x4ae0e1(0x171)]&&(console['error']('Parent\x20ID:\x20'+_0x21c135[_0x4ae0e1(0x16e)]),_0x21c135[_0x4ae0e1(0x14a)]&&console[_0x4ae0e1(0x12f)](_0x4ae0e1(0x173)+_0x21c135[_0x4ae0e1(0x14a)]));const _0x16f232=await withSpinner(_0x4ae0e1(0x12b),()=>_0x26f750['segment']['listUnifiedWithJourneys'](_0x21c135[_0x4ae0e1(0x16e)],_0x21c135[_0x4ae0e1(0x14a)]),{'verbose':_0x186edf['verbose']}),{folders:_0x28fb61,segments:_0x5d913a,journeys:_0x5c3eb3}=_0x16f232['data'],_0x437aee=_0x28fb61[_0x4ae0e1(0x139)]+_0x5d913a[_0x4ae0e1(0x139)]+_0x5c3eb3[_0x4ae0e1(0x139)];console[_0x4ae0e1(0x12f)](_0x4ae0e1(0x157)+_0x28fb61[_0x4ae0e1(0x139)]+'\x20folder'+(_0x28fb61[_0x4ae0e1(0x139)]!==0x1?'s':'')+',\x20'+_0x5d913a[_0x4ae0e1(0x139)]+'\x20segment'+(_0x5d913a[_0x4ae0e1(0x139)]!==0x1?'s':'')+_0x4ae0e1(0x16b)+_0x5c3eb3[_0x4ae0e1(0x139)]+'\x20journey'+(_0x5c3eb3[_0x4ae0e1(0x139)]!==0x1?'s':''));const _0xc4d826=_0x31401a=>{const _0x2704af=_0x4ae0e1;return getConsoleNextUrl(_0x186edf[_0x2704af(0x16c)],_0x2704af(0x15a)+_0x21c135[_0x2704af(0x16e)]+_0x2704af(0x137)+_0x31401a);},_0x1920c8=_0x48fca=>{const _0x50c100=_0x4ae0e1;return getConsoleNextUrl(_0x186edf[_0x50c100(0x16c)],_0x50c100(0x15a)+_0x21c135[_0x50c100(0x16e)]+'/e/'+_0x48fca+'/j/da');},_0x3a6d50=_0x186edf[_0x4ae0e1(0x148)]==='json'||_0x186edf['format']===_0x4ae0e1(0x13c);if(_0x3a6d50){const _0x1ba92a=[..._0x28fb61[_0x4ae0e1(0x13b)](_0x553d1a=>({..._0x553d1a,'type':_0x4ae0e1(0x158)})),..._0x5d913a[_0x4ae0e1(0x13b)](_0x5de0d3=>({..._0x5de0d3,'type':'segment','url':_0xc4d826(_0x5de0d3['id'])})),..._0x5c3eb3[_0x4ae0e1(0x13b)](_0x2d872f=>({..._0x2d872f,'name':_0x2d872f[_0x4ae0e1(0x136)],'type':_0x4ae0e1(0x155),'url':_0x1920c8(_0x2d872f['id'])}))][_0x4ae0e1(0x145)]((_0x19c6f2,_0x4d4d84)=>_0x19c6f2[_0x4ae0e1(0x14e)][_0x4ae0e1(0x154)](_0x4d4d84[_0x4ae0e1(0x14e)]));await handleSDKOutput(_0x1ba92a,_0x186edf);}else{if(_0x437aee===0x0)console[_0x4ae0e1(0x12d)](a45_0x12945b[_0x4ae0e1(0x13f)]('['+_0x2fb781+']')),console[_0x4ae0e1(0x12d)](_0x4ae0e1(0x169));else{console['log'](a45_0x12945b['dim']('['+_0x2fb781+']'));const _0x2f546d=formatFlatList(_0x28fb61,_0x5d913a,{'showMetadata':!![],'getSegmentUrl':_0xc4d826,'getJourneyUrl':_0x1920c8},_0x5c3eb3);console[_0x4ae0e1(0x12d)](_0x2f546d);}}return 0x0;}async[a45_0x5e01bf(0x14b)](_0x23ef89,_0x4bbb4e){const _0x5940e3=a45_0x5e01bf,{options:_0x446dda,tdx:_0x496874}=_0x23ef89,_0x3f9cda=await withSpinner(_0x5940e3(0x15c)+_0x4bbb4e+'\x27...',()=>_0x496874[_0x5940e3(0x134)][_0x5940e3(0x14d)](_0x4bbb4e),{'verbose':_0x446dda[_0x5940e3(0x171)]}),_0x226b5b=_0x3f9cda[_0x5940e3(0x133)];_0x446dda[_0x5940e3(0x171)]&&(console[_0x5940e3(0x12f)](_0x5940e3(0x156)+_0x226b5b[_0x5940e3(0x16e)]),_0x226b5b[_0x5940e3(0x14a)]&&console[_0x5940e3(0x12f)](_0x5940e3(0x173)+_0x226b5b[_0x5940e3(0x14a)]));const _0x1af085=_0x446dda[_0x5940e3(0x149)]||0xa,_0x5c9d3e=await withSpinner(_0x5940e3(0x164),()=>_0x496874[_0x5940e3(0x134)][_0x5940e3(0x14b)](_0x226b5b[_0x5940e3(0x16e)],_0x226b5b['folderId'],0x0,_0x1af085),{'verbose':_0x446dda[_0x5940e3(0x171)]}),_0x4a1ece=_0x5c9d3e[_0x5940e3(0x133)],_0x1b381f=_0x7b7d40=>{const _0x177a87=_0x5940e3;let _0x449c23=0x0,_0x39f841=0x0,_0x23de77=0x0;for(const _0x4b8c98 of _0x7b7d40){if(_0x4b8c98[_0x177a87(0x160)]===_0x177a87(0x158))_0x449c23++;else{if(_0x4b8c98[_0x177a87(0x160)]===_0x177a87(0x134))_0x39f841++;else{if(_0x4b8c98[_0x177a87(0x160)]===_0x177a87(0x155))_0x23de77++;}}if(_0x4b8c98[_0x177a87(0x17a)]){const _0x54a8ab=_0x1b381f(_0x4b8c98[_0x177a87(0x17a)]);_0x449c23+=_0x54a8ab['folders'],_0x39f841+=_0x54a8ab['segments'],_0x23de77+=_0x54a8ab[_0x177a87(0x161)];}}return{'folders':_0x449c23,'segments':_0x39f841,'journeys':_0x23de77};},_0x4a5592=_0x1b381f(_0x4a1ece);console[_0x5940e3(0x12f)]('✔\x20Built\x20tree\x20with\x20'+_0x4a5592[_0x5940e3(0x174)]+'\x20folder'+(_0x4a5592[_0x5940e3(0x174)]!==0x1?'s':'')+',\x20'+_0x4a5592[_0x5940e3(0x142)]+_0x5940e3(0x12c)+(_0x4a5592[_0x5940e3(0x142)]!==0x1?'s':'')+',\x20and\x20'+_0x4a5592[_0x5940e3(0x161)]+_0x5940e3(0x166)+(_0x4a5592['journeys']!==0x1?'s':''));const _0x2fc16e=_0xcf3bf=>{const _0x465402=_0x5940e3;return getConsoleNextUrl(_0x446dda['site'],'/app/ps/'+_0x226b5b['parentId']+_0x465402(0x137)+_0xcf3bf);},_0x45489b=_0x4a96e9=>{const _0xfe3b1=_0x5940e3;return getConsoleNextUrl(_0x446dda[_0xfe3b1(0x16c)],_0xfe3b1(0x15a)+_0x226b5b[_0xfe3b1(0x16e)]+_0xfe3b1(0x137)+_0x4a96e9+_0xfe3b1(0x12e));};if(_0x446dda[_0x5940e3(0x148)]==='json'||_0x446dda['format']==='jsonl')await handleSDKOutput(_0x4a1ece,_0x446dda);else{console[_0x5940e3(0x12d)](a45_0x12945b[_0x5940e3(0x13f)]('['+_0x4bbb4e+']'));const _0x498265=formatTree(_0x4a1ece,{'showMetadata':!![],'getSegmentUrl':_0x2fc16e,'getJourneyUrl':_0x45489b});console['log'](_0x498265);}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;}}
|