@treasuredata/tdx 2026.10.0 → 2026.10.2
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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/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-journey-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.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.d.ts.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-statusline-command.js.map +1 -1
- package/dist/commands/codex-command.d.ts.map +1 -1
- package/dist/commands/codex-command.js +1 -1
- package/dist/commands/codex-command.js.map +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-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.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-readiness-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-in-browser-message-command.js +1 -1
- package/dist/commands/engage-landing-page-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/engage-workspace-assignment-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/opencode-command.d.ts +10 -3
- package/dist/commands/opencode-command.d.ts.map +1 -1
- package/dist/commands/opencode-command.js +1 -1
- package/dist/commands/opencode-command.js.map +1 -1
- package/dist/commands/p13n-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.d.ts.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/profiles-command.js.map +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-move-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/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.d.ts +8 -0
- package/dist/commands/upgrade-command.d.ts.map +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/upgrade-command.js.map +1 -1
- package/dist/commands/usage-command.d.ts +10 -0
- package/dist/commands/usage-command.d.ts.map +1 -0
- package/dist/commands/usage-command.js +1 -0
- package/dist/commands/usage-command.js.map +1 -0
- 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.d.ts +2 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.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.d.ts +5 -4
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +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/auth-token.js +1 -1
- package/dist/sdk/cas/audience-context.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-schema.js +1 -1
- package/dist/sdk/cas/cas-segment-validator.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/cas/validate-files.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/p13n-studio-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.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-readiness-workflow.js +1 -1
- package/dist/sdk/engage/campaign-readiness.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/in-browser-message-pull.js +1 -1
- package/dist/sdk/engage/in-browser-message-push.js +1 -1
- package/dist/sdk/engage/in-browser-message-validator.js +1 -1
- package/dist/sdk/engage/in-browser-message-yaml.js +1 -1
- package/dist/sdk/engage/landing-page-init.js +1 -1
- package/dist/sdk/engage/landing-page-public-asset.js +1 -1
- package/dist/sdk/engage/landing-page-pull.js +1 -1
- package/dist/sdk/engage/landing-page-push.js +1 -1
- package/dist/sdk/engage/landing-page-static-site.js +1 -1
- package/dist/sdk/engage/landing-page-validator.js +1 -1
- package/dist/sdk/engage/landing-page-workspace.js +1 -1
- package/dist/sdk/engage/landing-page-yaml.js +1 -1
- package/dist/sdk/engage/list-campaign-schema.js +1 -1
- package/dist/sdk/engage/list-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/always-on-campaign-schema.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/in-browser-message-schema.js +1 -1
- package/dist/sdk/engage/types/landing-page-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage/workspace-assignments.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/codex-usage.d.ts +13 -0
- package/dist/sdk/llm/codex-usage.d.ts.map +1 -0
- package/dist/sdk/llm/codex-usage.js +1 -0
- package/dist/sdk/llm/codex-usage.js.map +1 -0
- 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/llm/user-settings.js +1 -1
- package/dist/sdk/llm/work-models.d.ts +52 -0
- package/dist/sdk/llm/work-models.d.ts.map +1 -0
- package/dist/sdk/llm/work-models.js +1 -0
- package/dist/sdk/llm/work-models.js.map +1 -0
- package/dist/sdk/p13n-studio-errors.js +1 -1
- package/dist/sdk/p13n-studio.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.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/audience-context.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/util/tree-search.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/task-graph.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/claude-code-state.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/proxy-fetch.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/td-user.d.ts +3 -0
- package/dist/utils/td-user.d.ts.map +1 -0
- package/dist/utils/td-user.js +1 -0
- package/dist/utils/td-user.js.map +1 -0
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
- package/dist/commands/ai-usage-command-base.d.ts +0 -26
- package/dist/commands/ai-usage-command-base.d.ts.map +0 -1
- package/dist/commands/ai-usage-command-base.js +0 -1
- package/dist/commands/ai-usage-command-base.js.map +0 -1
- package/dist/commands/claude-usage-command.d.ts +0 -19
- package/dist/commands/claude-usage-command.d.ts.map +0 -1
- package/dist/commands/claude-usage-command.js +0 -1
- package/dist/commands/claude-usage-command.js.map +0 -1
- package/dist/commands/opencode-usage-command.d.ts +0 -19
- package/dist/commands/opencode-usage-command.d.ts.map +0 -1
- package/dist/commands/opencode-usage-command.js +0 -1
- package/dist/commands/opencode-usage-command.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a49_0x4ea1fc=a49_0x299a;(function(_0x15fdad,_0x162d39){const _0x24c648=a49_0x299a,_0x1fb5ee=_0x15fdad();while(!![]){try{const _0x162789=-parseInt(_0x24c648(0x69))/0x1*(-parseInt(_0x24c648(0x65))/0x2)+parseInt(_0x24c648(0x6a))/0x3+parseInt(_0x24c648(0x64))/0x4+parseInt(_0x24c648(0x68))/0x5+-parseInt(_0x24c648(0x66))/0x6+-parseInt(_0x24c648(0x6f))/0x7+-parseInt(_0x24c648(0x70))/0x8;if(_0x162789===_0x162d39)break;else _0x1fb5ee['push'](_0x1fb5ee['shift']());}catch(_0x2813be){_0x1fb5ee['push'](_0x1fb5ee['shift']());}}}(a49_0xcd3e,0x919ba));function a49_0xcd3e(){const _0x942466=['verbose','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','4948909EAcNEn','9701632CthBPa','execute','Parent\x20segment:\x20','\x20field','description','✔\x20Found\x20','\x27...','segment','length','Error:\x20Parent\x20segment\x20name\x20is\x20required','error','953108XkwgXR','18774YvSCUY','1869654pjINMr','Site:\x20','5821920WePJLM','59vlDkAp','2613648HzZThK','name','jsonl'];a49_0xcd3e=function(){return _0x942466;};return a49_0xcd3e();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a49_0x299a(_0xd3a6bd,_0x4d2b88){_0xd3a6bd=_0xd3a6bd-0x64;const _0xcd3e32=a49_0xcd3e();let _0x299ac0=_0xcd3e32[_0xd3a6bd];return _0x299ac0;}import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';export class SegmentFieldsCommand extends BaseCommand{[a49_0x4ea1fc(0x6b)]='segment:fields';[a49_0x4ea1fc(0x74)]='List\x20available\x20fields\x20for\x20segmentation';async[a49_0x4ea1fc(0x71)](_0x5a8a97){const _0x359418=a49_0x4ea1fc,{options:_0x45ccc3,args:_0x3d546c,tdx:_0x4ee1b3}=_0x5a8a97,_0x3a749d=_0x3d546c[0x0]||_0x45ccc3['parentSegment'];if(!_0x3a749d)return console[_0x359418(0x7a)](_0x359418(0x79)),console[_0x359418(0x7a)]('Usage:\x20tdx\x20segment\x20fields\x20<parent_name>'),console[_0x359418(0x7a)](_0x359418(0x6e)),0x1;_0x45ccc3[_0x359418(0x6d)]&&(console[_0x359418(0x7a)](_0x359418(0x67)+_0x45ccc3['site']),console['error'](_0x359418(0x72)+_0x3a749d));const _0x3ed81e=await withSpinner('Listing\x20fields\x20for\x20\x27'+_0x3a749d+_0x359418(0x76),()=>_0x4ee1b3[_0x359418(0x77)]['listFields'](_0x3a749d),{'verbose':_0x45ccc3['verbose']}),_0x566e56=_0x3ed81e['data'];console['error'](_0x359418(0x75)+_0x566e56[_0x359418(0x78)]+_0x359418(0x73)+(_0x566e56['length']!==0x1?'s':''));if(_0x45ccc3['json']||_0x45ccc3[_0x359418(0x6c)])return await handleSDKOutput(_0x566e56,_0x45ccc3),0x0;return displayFieldsHumanReadable(_0x566e56,_0x3a749d),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a50_0x1fed(_0x3e369b,_0x2ac048){_0x3e369b=_0x3e369b-0x170;const _0x2cd44c=a50_0x2cd4();let _0x1fedca=_0x2cd44c[_0x3e369b];return _0x1fedca;}const a50_0x2d3dcd=a50_0x1fed;(function(_0x1f3370,_0x548c63){const _0x3d8b40=a50_0x1fed,_0x2a7571=_0x1f3370();while(!![]){try{const _0x56c202=parseInt(_0x3d8b40(0x178))/0x1*(parseInt(_0x3d8b40(0x18c))/0x2)+parseInt(_0x3d8b40(0x195))/0x3+-parseInt(_0x3d8b40(0x179))/0x4*(-parseInt(_0x3d8b40(0x19b))/0x5)+-parseInt(_0x3d8b40(0x197))/0x6+-parseInt(_0x3d8b40(0x19d))/0x7+-parseInt(_0x3d8b40(0x1ae))/0x8*(-parseInt(_0x3d8b40(0x17a))/0x9)+-parseInt(_0x3d8b40(0x1b2))/0xa;if(_0x56c202===_0x548c63)break;else _0x2a7571['push'](_0x2a7571['shift']());}catch(_0x42374e){_0x2a7571['push'](_0x2a7571['shift']());}}}(a50_0x2cd4,0x41058));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a50_0x2cd4(){const _0x23150a=['has','ruleConditionCount','dryRun','\x20segment(s)\x20would\x20be\x20moved.','resolveEntitiesInParent','path','some','data','Target\x20folder:\x20','push','Error:\x20at\x20least\x20one\x20<segment>\x20and\x20--folder\x20<folder>\x20are\x20required\x0a','resolvePathToResource','\x27\x20to\x20folder\x20\x27','\x0aTip:\x20run\x20`tdx\x20segment\x20list\x20-r`\x20to\x20find\x20segment\x20and\x20folder\x20names/IDs.','Segments:\x20','28378fGLUrr','\x20\x20tdx\x20segment\x20move\x201603887\x20--folder\x208299501','\x20\x20tdx\x20segment\x20move\x20\x22VIP\x20Customers\x22\x20--folder\x20\x22Archive\x22\x20\x20\x20#\x20by\x20name\x20(needs\x20parent\x20context)','\x20\x20•\x20','map','Re-run\x20`tdx\x20sg\x20move`\x20with\x20that\x20full\x20path\x20(or\x20the\x20id).','test','[dry-run]\x20No\x20changes\x20made.\x20','explainAmbiguousName','453417tVBHgS','segment:move','1140534jQYRXc','\x27\x20matches\x20','error','\x20\x20(id\x20','30ToNZHd','description','1736672iKOXSL','\x20\x20tdx\x20segment\x20move\x201603887\x201603888\x201603889\x20--folder\x208299501','•\x20[dry-run]\x20Would\x20move\x20segment\x20\x27','toLowerCase','join','Moving','Searching\x20folders\x20for\x20\x27','name','Error:\x20\x27','preserved:','moveSegments','forEach','folderId','get','filter','Or\x20pass\x20flag:\x20\x20--parent-segment\x20\x22<name>\x22','red','1727984eCqnDN','\x20segment','\x27...','green','532430MBRJjg','Usage:\x20tdx\x20segment\x20move\x20<segment...>\x20--folder\x20<folder>','\x20segments\x20moved,\x20all\x20rules\x20verified\x20intact','Checking','Or\x20use\x20IDs:\x20\x20\x20\x20tdx\x20sg\x20list\x20-r\x20--json\x20\x20(then\x20pass\x20the\x20numeric\x20ids)','verbose','rule\x20','\x20folder\x20\x27','segment','execute','\x27\x20isn\x27t\x20at\x20the\x20top\x20level\x20—\x20it\x27s\x20nested\x20at:','cyan','SEGMENT_NOT_FOUND','for\x20move\x20to','segmentFolderId','\x27\x20—\x20','\x20→\x20','\x20condition','parentId','length','Set\x20context:\x20\x20\x20tdx\x20use\x20parent_segment\x20\x22<name>\x22','5rTKxDl','213116tHlUnI','9jqgjvs','Examples:','set'];a50_0x2cd4=function(){return _0x23150a;};return a50_0x2cd4();}import{withSpinner}from'../utils/spinner.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{searchTreeByName}from'../sdk/util/tree-search.js';import a50_0x375feb from'chalk';export class SegmentMoveCommand extends BaseCommand{[a50_0x2d3dcd(0x1a4)]=a50_0x2d3dcd(0x196);[a50_0x2d3dcd(0x19c)]='Move\x20one\x20or\x20more\x20segments\x20to\x20a\x20different\x20folder';async[a50_0x2d3dcd(0x1bb)](_0x341ddf){const _0x1e8e51=a50_0x2d3dcd,{options:_0x3a36a5,args:_0x1abcff,tdx:_0x8a5c84}=_0x341ddf,_0x486208=_0x1abcff,_0x8eb251=_0x3a36a5['folder'];if(_0x486208[_0x1e8e51(0x176)]===0x0||!_0x8eb251)return console[_0x1e8e51(0x199)](a50_0x375feb[_0x1e8e51(0x1ad)](_0x1e8e51(0x187))),console[_0x1e8e51(0x199)](_0x1e8e51(0x1b3)),console[_0x1e8e51(0x199)](_0x1e8e51(0x17b)),console['error'](_0x1e8e51(0x18d)),console[_0x1e8e51(0x199)](_0x1e8e51(0x19e)),console[_0x1e8e51(0x199)](_0x1e8e51(0x18e)),console['error'](_0x1e8e51(0x18a)),0x1;_0x3a36a5[_0x1e8e51(0x1b7)]&&(console[_0x1e8e51(0x199)](_0x1e8e51(0x18b)+_0x486208[_0x1e8e51(0x1a1)](',\x20')),console[_0x1e8e51(0x199)](_0x1e8e51(0x185)+_0x8eb251));const _0x5cfc15=[...new Set(_0x486208)];_0x5cfc15[_0x1e8e51(0x176)]<_0x486208[_0x1e8e51(0x176)]&&console[_0x1e8e51(0x199)](a50_0x375feb['yellow']('Duplicate\x20segments\x20removed\x20('+_0x486208[_0x1e8e51(0x176)]+_0x1e8e51(0x173)+_0x5cfc15[_0x1e8e51(0x176)]+').'));const _0x456dd8=/^\d+$/,_0x45c946=_0x3a36a5['parentSegment'],_0x3989ed=[..._0x5cfc15,_0x8eb251][_0x1e8e51(0x183)](_0x10e06e=>!_0x456dd8[_0x1e8e51(0x192)](_0x10e06e));if(_0x3989ed&&!_0x45c946)return console['error'](a50_0x375feb['red']('Error:\x20no\x20parent\x20segment\x20context\x20—\x20moving\x20by\x20name\x20needs\x20one.\x0a')),console[_0x1e8e51(0x199)](_0x1e8e51(0x177)),console[_0x1e8e51(0x199)](_0x1e8e51(0x1ac)),console[_0x1e8e51(0x199)](_0x1e8e51(0x1b6)),0x1;const _0x3b3aa5=_0x5cfc15[_0x1e8e51(0x176)],_0x1fa57e=_0x3a36a5[_0x1e8e51(0x17f)]===!![];let _0x119e4f;try{const _0x2399a5=await withSpinner((_0x1fa57e?_0x1e8e51(0x1b5):_0x1e8e51(0x1a2))+'\x20'+_0x3b3aa5+_0x1e8e51(0x1af)+(_0x3b3aa5===0x1?'':'s')+'\x20'+((_0x1fa57e?_0x1e8e51(0x170):'to')+_0x1e8e51(0x1b9)+_0x8eb251+_0x1e8e51(0x1b0)),async()=>{const _0x355596=_0x1e8e51,_0x5b32c5=[];_0x5cfc15['forEach']((_0x4eb44,_0x381035)=>{const _0x51557b=a50_0x1fed;if(!_0x456dd8[_0x51557b(0x192)](_0x4eb44))_0x5b32c5[_0x51557b(0x186)]({'name':_0x4eb44,'expectType':'segment','slot':_0x381035});});if(!_0x456dd8[_0x355596(0x192)](_0x8eb251))_0x5b32c5['push']({'name':_0x8eb251,'expectType':'folder','slot':-0x1});const _0x282a31=new Map();if(_0x5b32c5[_0x355596(0x176)]>0x0){const _0x5ed786=await _0x8a5c84[_0x355596(0x1ba)][_0x355596(0x181)](_0x45c946,_0x5b32c5[_0x355596(0x190)](({name:_0x4fa5bf,expectType:_0xfee04c})=>({'name':_0x4fa5bf,'expectType':_0xfee04c})));_0x5ed786[_0x355596(0x1a8)]((_0x4ee7c2,_0x54ff7c)=>_0x282a31[_0x355596(0x17c)](_0x5b32c5[_0x54ff7c]['slot'],_0x4ee7c2['id']));}const _0x373411=_0x5cfc15[_0x355596(0x190)]((_0x37c8d3,_0x44cb72)=>_0x456dd8[_0x355596(0x192)](_0x37c8d3)?_0x37c8d3:_0x282a31[_0x355596(0x1aa)](_0x44cb72)),_0x56d21c=_0x456dd8[_0x355596(0x192)](_0x8eb251)?_0x8eb251:_0x282a31[_0x355596(0x1aa)](-0x1);return _0x8a5c84['segment'][_0x355596(0x1a7)](_0x373411,_0x56d21c,_0x1fa57e);},{'verbose':_0x3a36a5['verbose']});_0x119e4f=_0x2399a5[_0x1e8e51(0x184)];}catch(_0x4867a0){if(_0x4867a0 instanceof SDKError&&_0x4867a0['code']===ErrorCode[_0x1e8e51(0x1be)]&&_0x45c946)try{if(await this[_0x1e8e51(0x194)](_0x8a5c84,_0x45c946,_0x5cfc15,_0x3a36a5))return 0x1;}catch{}throw _0x4867a0;}for(const _0x13f025 of _0x119e4f){const _0x493e8e=_0x13f025[_0x1e8e51(0x17e)],_0x515f9c=_0x1e8e51(0x1b8)+(_0x1fa57e?_0x1e8e51(0x17d):_0x1e8e51(0x1a6))+'\x20'+_0x493e8e+_0x1e8e51(0x174)+(_0x493e8e===0x1?'':'s');console[_0x1e8e51(0x199)](_0x1fa57e?a50_0x375feb[_0x1e8e51(0x1bd)](_0x1e8e51(0x19f)+_0x13f025['id']+_0x1e8e51(0x189)+_0x13f025[_0x1e8e51(0x171)]+_0x1e8e51(0x172)+_0x515f9c):a50_0x375feb['green']('✔\x20Moved\x20segment\x20\x27'+_0x13f025['id']+_0x1e8e51(0x189)+_0x13f025[_0x1e8e51(0x171)]+_0x1e8e51(0x172)+_0x515f9c+'\x20(verified\x20by\x20re-read)'));}if(_0x1fa57e)console[_0x1e8e51(0x199)](a50_0x375feb['cyan'](_0x1e8e51(0x193)+_0x3b3aa5+_0x1e8e51(0x180)));else _0x119e4f[_0x1e8e51(0x176)]>0x1&&console[_0x1e8e51(0x199)](a50_0x375feb[_0x1e8e51(0x1b1)]('✔\x20'+_0x119e4f['length']+_0x1e8e51(0x1b4)));return await handleSDKOutput(_0x119e4f,_0x3a36a5),0x0;}async[a50_0x2d3dcd(0x194)](_0x35b1eb,_0x219243,_0x57d28b,_0x40de39){const _0x4b8ff7=a50_0x2d3dcd,_0x132778=_0x57d28b[_0x4b8ff7(0x1ab)](_0x4e3fe3=>!/^\d+$/['test'](_0x4e3fe3)&&!_0x4e3fe3['includes']('/'));if(_0x132778[_0x4b8ff7(0x176)]===0x0)return![];const _0x38e122=await withSpinner(_0x4b8ff7(0x1a3)+_0x132778[_0x4b8ff7(0x1a1)]('\x27,\x20\x27')+_0x4b8ff7(0x1b0),()=>_0x35b1eb[_0x4b8ff7(0x1ba)][_0x4b8ff7(0x188)](_0x219243),{'verbose':_0x40de39[_0x4b8ff7(0x1b7)]}),_0x3cc77e=(await withSpinner('Searching\x20the\x20tree...',()=>_0x35b1eb['segment']['listRecursive'](_0x38e122['data'][_0x4b8ff7(0x175)],_0x38e122[_0x4b8ff7(0x184)][_0x4b8ff7(0x1a9)],0x0,0xa),{'verbose':_0x40de39['verbose']}))[_0x4b8ff7(0x184)];let _0x5bfc50=![];for(const _0x592f53 of _0x132778){const _0x51ea70=searchTreeByName(_0x3cc77e,_0x592f53)[_0x4b8ff7(0x1ab)](_0x5d4b5d=>_0x5d4b5d['type']===_0x4b8ff7(0x1ba)&&_0x5d4b5d[_0x4b8ff7(0x1a4)]['toLowerCase']()===_0x592f53[_0x4b8ff7(0x1a0)]());if(_0x51ea70[_0x4b8ff7(0x176)]>0x1){_0x5bfc50=!![],console[_0x4b8ff7(0x199)](a50_0x375feb[_0x4b8ff7(0x1ad)](_0x4b8ff7(0x1a5)+_0x592f53+_0x4b8ff7(0x198)+_0x51ea70[_0x4b8ff7(0x176)]+'\x20segments\x20—\x20refusing\x20to\x20guess.\x20Pass\x20the\x20full\x20path\x20(or\x20id)\x20of\x20the\x20one\x20you\x20mean:'));for(const _0x88868b of _0x51ea70)console[_0x4b8ff7(0x199)](_0x4b8ff7(0x18f)+_0x88868b[_0x4b8ff7(0x182)]+_0x4b8ff7(0x19a)+_0x88868b['id']+')');}else _0x51ea70[_0x4b8ff7(0x176)]===0x1&&(_0x5bfc50=!![],console[_0x4b8ff7(0x199)](a50_0x375feb[_0x4b8ff7(0x1ad)](_0x4b8ff7(0x1a5)+_0x592f53+_0x4b8ff7(0x1bc))),console[_0x4b8ff7(0x199)]('\x20\x20'+_0x51ea70[0x0]['path']+_0x4b8ff7(0x19a)+_0x51ea70[0x0]['id']+')'),console[_0x4b8ff7(0x199)](_0x4b8ff7(0x191)));}return _0x5bfc50;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a51_0x396b7b=a51_0x5599;function a51_0x5599(_0x67a046,_0x5be89c){_0x67a046=_0x67a046-0x1af;const _0x29b51f=a51_0x29b5();let _0x55995=_0x29b51f[_0x67a046];return _0x55995;}(function(_0x5acd68,_0x33fb8d){const _0xa4f39a=a51_0x5599,_0x117148=_0x5acd68();while(!![]){try{const _0xde6d26=-parseInt(_0xa4f39a(0x1bb))/0x1*(-parseInt(_0xa4f39a(0x1f9))/0x2)+parseInt(_0xa4f39a(0x1d5))/0x3*(parseInt(_0xa4f39a(0x1e4))/0x4)+-parseInt(_0xa4f39a(0x1ec))/0x5+parseInt(_0xa4f39a(0x1e5))/0x6*(parseInt(_0xa4f39a(0x1c8))/0x7)+parseInt(_0xa4f39a(0x1fa))/0x8*(-parseInt(_0xa4f39a(0x1ed))/0x9)+-parseInt(_0xa4f39a(0x1b2))/0xa*(-parseInt(_0xa4f39a(0x1e1))/0xb)+-parseInt(_0xa4f39a(0x1d4))/0xc*(parseInt(_0xa4f39a(0x1b3))/0xd);if(_0xde6d26===_0x33fb8d)break;else _0x117148['push'](_0x117148['shift']());}catch(_0x4fb509){_0x117148['push'](_0x117148['shift']());}}}(a51_0x29b5,0x41c63));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 a51_0x13752b from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a51_0x1889d8 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a51_0x29b5(){const _0x380e5b=['\x0aChanges\x20to\x20\x27','\x20activations','427165mXobHM','195849WRFMyx','\x20\x20🗺️\x20\x20','\x20\x20Target:\x20','targetDir','Parent\x20segment:\x20','green','dirname','hasChanges','segments','session','file','isNew','2UDdvdC','8iZYWLY','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','dim','\x20changed\x20files','description','yes','320KpVZam','26kOkgIc','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','relativePath','repeat','verbose','\x20unchanged\x20files','content','280918fcFHcS','\x20new\x20files','helpText','filter','dryRun','files','journeys','-\x20no\x20files\x20written','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','utf-8','type','site','yellow','1211QgsmdP','message','execute','counts','name','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20=\x20','\x20with\x20','no_parent','cwd','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20files?','6074592DtzBPx','804597tKxlZw','parent_segment','\x20versions)','activations','✔\x20Context\x20set:\x20','journeyVersions','error','Aborted.','length','resourceName','\x20files\x20to\x20','parentName','26389raGOKZ','absolutePath','diff','8SHorjy','17166qfywbz','✔\x20Pulled\x20','segment','cyan','red'];a51_0x29b5=function(){return _0x380e5b;};return a51_0x29b5();}export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a51_0x396b7b(0x1cc)]='segment:pull';[a51_0x396b7b(0x1b0)]=a51_0x396b7b(0x1c3);async[a51_0x396b7b(0x1ca)](_0x1441c2){const _0x2f4632=a51_0x396b7b,{options:_0x18ce62,args:_0x3e97f2,tdx:_0x3ac3ac}=_0x1441c2,_0x5ba493=_0x18ce62,_0x27cdff=await resolveTarget({'arg':_0x3e97f2[0x0],'contextParent':_0x18ce62['parentSegment'],'cwd':process[_0x2f4632(0x1d1)]()});if(!isSuccessfulResolution(_0x27cdff))return _0x27cdff['errorCode']===_0x2f4632(0x1d0)?(console[_0x2f4632(0x1db)](a51_0x13752b['yellow'](_0x2f4632(0x1cd))),console['error']('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)'),console['error'](_0x2f4632(0x1b4)),console[_0x2f4632(0x1db)](_0x2f4632(0x1b5))):(console[_0x2f4632(0x1db)](a51_0x13752b[_0x2f4632(0x1e9)]('Error:\x20'+_0x27cdff[_0x2f4632(0x1c9)]+'\x0a')),_0x27cdff[_0x2f4632(0x1bd)]&&console[_0x2f4632(0x1db)](a51_0x13752b['cyan'](_0x27cdff[_0x2f4632(0x1bd)]))),0x1;const _0x5d8e0c=_0x27cdff[_0x2f4632(0x1e0)],_0x2ff506=_0x27cdff[_0x2f4632(0x1f0)],_0x53a8d0=_0x27cdff[_0x2f4632(0x1c5)]===_0x2f4632(0x1f7)?_0x27cdff[_0x2f4632(0x1de)]:undefined;_0x5ba493['verbose']&&(console[_0x2f4632(0x1db)]('Site:\x20'+_0x5ba493[_0x2f4632(0x1c6)]),console[_0x2f4632(0x1db)](_0x2f4632(0x1f1)+_0x5d8e0c),_0x53a8d0&&console[_0x2f4632(0x1db)]('Target\x20resource:\x20'+_0x53a8d0));const _0x156936=await withProgressSpinner('Pulling\x20segments\x20from\x20\x27'+_0x5d8e0c+'\x27...',_0x499f04=>_0x3ac3ac[_0x2f4632(0x1e7)]['pullSegments'](_0x5d8e0c,{'targetDir':_0x2ff506,'targetResourceName':_0x53a8d0,'verbose':_0x5ba493[_0x2f4632(0x1b8)],'progress':{'update':_0x57e585=>{const _0x23d720=_0x2f4632;_0x499f04['setPhase'](_0x57e585),_0x5ba493[_0x23d720(0x1b8)]&&console['error']('\x20\x20'+_0x57e585);}}}),{'verbose':_0x5ba493[_0x2f4632(0x1b8)]}),_0x36e997=_0x156936['data'];if(_0x36e997['counts']['segments']===0x0&&_0x36e997['counts']['journeys']===0x0)return console['error'](a51_0x13752b[_0x2f4632(0x1c7)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x36e997[_0x2f4632(0x1e0)]+'\x27')),0x0;const _0x22d908=_0x36e997[_0x2f4632(0x1c0)][_0x2f4632(0x1be)](_0x575e28=>_0x575e28[_0x2f4632(0x1f8)]),_0x31dc3d=_0x36e997[_0x2f4632(0x1c0)]['filter'](_0x463585=>!_0x463585[_0x2f4632(0x1f8)]&&_0x463585[_0x2f4632(0x1f4)]),_0xce29fc=_0x36e997[_0x2f4632(0x1c0)][_0x2f4632(0x1be)](_0x38ca62=>!_0x38ca62[_0x2f4632(0x1f8)]&&!_0x38ca62['hasChanges']);console[_0x2f4632(0x1db)]('\x0aPull\x20summary\x20for\x20\x27'+_0x36e997['parentName']+'\x27:'),console['error']('\x20\x20🎯\x20'+a51_0x13752b['cyan'](_0x36e997['counts'][_0x2f4632(0x1f5)]+'\x20segments')+_0x2f4632(0x1cf)+a51_0x13752b[_0x2f4632(0x1e8)](_0x36e997[_0x2f4632(0x1cb)][_0x2f4632(0x1d8)]+_0x2f4632(0x1eb)));if(_0x36e997['counts'][_0x2f4632(0x1c1)]>0x0){const _0x51f2f9=_0x36e997[_0x2f4632(0x1cb)][_0x2f4632(0x1da)]>_0x36e997[_0x2f4632(0x1cb)][_0x2f4632(0x1c1)]?'\x20('+_0x36e997[_0x2f4632(0x1cb)]['journeyVersions']+_0x2f4632(0x1d7):'';console[_0x2f4632(0x1db)](_0x2f4632(0x1ee)+a51_0x13752b[_0x2f4632(0x1e8)](_0x36e997['counts']['journeys']+'\x20journeys')+a51_0x13752b['dim'](_0x51f2f9));}console[_0x2f4632(0x1db)]('\x20\x20'+a51_0x13752b[_0x2f4632(0x1f2)]('+\x20'+_0x22d908['length']+_0x2f4632(0x1bc))),console[_0x2f4632(0x1db)]('\x20\x20'+a51_0x13752b[_0x2f4632(0x1c7)]('~\x20'+_0x31dc3d[_0x2f4632(0x1dd)]+_0x2f4632(0x1af))),console['error']('\x20\x20'+a51_0x13752b[_0x2f4632(0x1fc)]('=\x20'+_0xce29fc[_0x2f4632(0x1dd)]+_0x2f4632(0x1b9))),console[_0x2f4632(0x1db)](_0x2f4632(0x1ef)+a51_0x13752b['cyan'](_0x36e997[_0x2f4632(0x1f0)])+'\x0a');if(_0x31dc3d[_0x2f4632(0x1dd)]>0x0)for(const _0x4ff730 of _0x31dc3d){console[_0x2f4632(0x1db)](_0x2f4632(0x1ea)+_0x4ff730[_0x2f4632(0x1b6)]+'\x27:'),console[_0x2f4632(0x1db)]('─'[_0x2f4632(0x1b7)](0x3c)),console[_0x2f4632(0x1db)](_0x4ff730[_0x2f4632(0x1e3)]),console['error']('─'[_0x2f4632(0x1b7)](0x3c));}if(_0x5ba493[_0x2f4632(0x1bf)])return console[_0x2f4632(0x1db)](a51_0x13752b['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x22d908['length']===0x0&&_0x31dc3d[_0x2f4632(0x1dd)]===0x0)return console[_0x2f4632(0x1db)](a51_0x13752b['green']('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x36e997[_0x2f4632(0x1e0)]},_0x5ba493['session']),console[_0x2f4632(0x1db)](a51_0x13752b[_0x2f4632(0x1f2)](_0x2f4632(0x1d9)+a51_0x13752b['dim'](_0x2f4632(0x1d6))+_0x2f4632(0x1ce)+a51_0x13752b[_0x2f4632(0x1e8)](_0x36e997[_0x2f4632(0x1e0)]))),0x0;if(!_0x5ba493[_0x2f4632(0x1b1)]){if(!isInteractive())return console[_0x2f4632(0x1db)](a51_0x13752b['red']('\x0aError:'),_0x2f4632(0x1d2)),console['error'](a51_0x13752b[_0x2f4632(0x1fc)](_0x2f4632(0x1fb))),0x1;const _0x1dc0b7=await confirmKey('Write\x20'+(_0x22d908[_0x2f4632(0x1dd)]+_0x31dc3d[_0x2f4632(0x1dd)])+_0x2f4632(0x1d3));if(!_0x1dc0b7)return console['error'](a51_0x13752b[_0x2f4632(0x1c7)](_0x2f4632(0x1dc)),_0x2f4632(0x1c2)),0x1;}for(const _0x3d1225 of _0x36e997[_0x2f4632(0x1c0)]){if(_0x3d1225[_0x2f4632(0x1f8)]||_0x3d1225[_0x2f4632(0x1f4)]){const _0x32995e=a51_0x1889d8[_0x2f4632(0x1f3)](_0x3d1225[_0x2f4632(0x1e2)]);!existsSync(_0x32995e)&&mkdirSync(_0x32995e,{'recursive':!![]}),writeFileSync(_0x3d1225['absolutePath'],_0x3d1225[_0x2f4632(0x1ba)],_0x2f4632(0x1c4));}}return console[_0x2f4632(0x1db)](a51_0x13752b['green'](_0x2f4632(0x1e6)+(_0x22d908['length']+_0x31dc3d[_0x2f4632(0x1dd)])+_0x2f4632(0x1df)+_0x36e997[_0x2f4632(0x1f0)])),saveSessionContext({'parent_segment':_0x36e997[_0x2f4632(0x1e0)]},_0x5ba493[_0x2f4632(0x1f6)]),console[_0x2f4632(0x1db)](a51_0x13752b['green'](_0x2f4632(0x1d9)+a51_0x13752b[_0x2f4632(0x1fc)](_0x2f4632(0x1d6))+_0x2f4632(0x1ce)+a51_0x13752b[_0x2f4632(0x1e8)](_0x36e997[_0x2f4632(0x1e0)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a55_0x7b511b=a55_0x55d1;(function(_0x1bbab1,_0x43bd4c){const _0x38e27f=a55_0x55d1,_0x59826d=_0x1bbab1();while(!![]){try{const _0x163870=parseInt(_0x38e27f(0x21b))/0x1*(parseInt(_0x38e27f(0x211))/0x2)+parseInt(_0x38e27f(0x216))/0x3+parseInt(_0x38e27f(0x265))/0x4*(-parseInt(_0x38e27f(0x1f6))/0x5)+parseInt(_0x38e27f(0x205))/0x6+parseInt(_0x38e27f(0x20a))/0x7+parseInt(_0x38e27f(0x1df))/0x8*(parseInt(_0x38e27f(0x22a))/0x9)+parseInt(_0x38e27f(0x25e))/0xa*(-parseInt(_0x38e27f(0x209))/0xb);if(_0x163870===_0x43bd4c)break;else _0x59826d['push'](_0x59826d['shift']());}catch(_0x53b23e){_0x59826d['push'](_0x59826d['shift']());}}}(a55_0x317c,0xf145c));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 a55_0x12f718 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 a55_0x55d1(_0xe3c7cb,_0xa44853){_0xe3c7cb=_0xe3c7cb-0x1dc;const _0x317c15=a55_0x317c();let _0x55d12a=_0x317c15[_0xe3c7cb];return _0x55d12a;}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{[a55_0x7b511b(0x271)]=a55_0x7b511b(0x253);[a55_0x7b511b(0x266)]=a55_0x7b511b(0x1e0);async['execute'](_0x5a67b8){const _0x175024=a55_0x7b511b,{options:_0x311947,args:_0x45b816,tdx:_0x5804c8}=_0x5a67b8,_0x143a9d=_0x311947,_0x2eddf4=await resolveTarget({'arg':_0x45b816[0x0],'contextParent':_0x311947[_0x175024(0x21c)],'cwd':process[_0x175024(0x21e)]()});if(!isSuccessfulResolution(_0x2eddf4))return _0x2eddf4[_0x175024(0x1f4)]===_0x175024(0x202)?(console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x218)](_0x175024(0x22c))),console[_0x175024(0x1e8)](_0x175024(0x245)),console[_0x175024(0x1e8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console['error'](_0x175024(0x21f))):(console['error'](a55_0x12f718['red'](_0x175024(0x1e5)+_0x2eddf4[_0x175024(0x1fa)]+'\x0a')),_0x2eddf4[_0x175024(0x206)]&&console[_0x175024(0x1e8)](a55_0x12f718['cyan'](_0x2eddf4['helpText']))),0x1;if(_0x2eddf4['type']===_0x175024(0x270))return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)]('Error:\x20Directory\x20not\x20found:\x20'+_0x2eddf4[_0x175024(0x1ef)]+'\x0a')),console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x20b)](_0x175024(0x210))),0x1;const _0x2869be=_0x2eddf4['parentName'],_0x3b0006=_0x2eddf4[_0x175024(0x1ef)],_0x26316a=_0x2eddf4[_0x175024(0x1e1)]===_0x175024(0x260)?_0x2eddf4[_0x175024(0x26f)]:undefined,_0x409104=getScopedDetails(_0x2eddf4),_0x21102b=_0x409104?.[_0x175024(0x24a)]??![],_0x43e80c=_0x409104?.[_0x175024(0x249)]??'';if(!existsSync(_0x3b0006))return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3b0006+'\x0a')),console['error'](a55_0x12f718['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x143a9d[_0x175024(0x1e2)]&&(console[_0x175024(0x1e8)](_0x175024(0x1e7)+_0x143a9d['site']),console[_0x175024(0x1e8)]('Parent\x20segment:\x20'+_0x2869be),console[_0x175024(0x1e8)](_0x175024(0x238)+_0x3b0006),_0x21102b&&console[_0x175024(0x1e8)](_0x175024(0x26a)+_0x43e80c));const _0x53127a=await withSpinner(_0x175024(0x1fc)+_0x2869be+_0x175024(0x25f),()=>_0x5804c8[_0x175024(0x262)]['resolveParentId'](_0x2869be),{'verbose':_0x143a9d[_0x175024(0x1e2)]}),_0x25a2cd=_0x53127a[_0x175024(0x277)],{parentSegmentResult:_0x3c8040,segmentsResult:_0x498db8,foldersResult:_0x3c48dc,journeysWithDetailsResult:_0x4ec7c1,userMaps:_0x3173d3}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x286eb0=_0x175024,[_0xb82e5a,_0x82b754,_0x317f06,_0x54062d,_0x37f0ba]=await Promise[_0x286eb0(0x23f)]([_0x5804c8[_0x286eb0(0x262)][_0x286eb0(0x200)](_0x25a2cd),_0x5804c8['segment']['listSegments'](_0x25a2cd),_0x5804c8[_0x286eb0(0x262)][_0x286eb0(0x208)](_0x25a2cd),_0x5804c8[_0x286eb0(0x234)][_0x286eb0(0x214)](_0x25a2cd,{'includeAllVersions':!![]}),_0x5804c8[_0x286eb0(0x22f)][_0x286eb0(0x25d)]()]);return{'parentSegmentResult':_0xb82e5a,'segmentsResult':_0x82b754,'foldersResult':_0x317f06,'journeysWithDetailsResult':_0x54062d,'userMaps':_0x37f0ba};},{'verbose':_0x143a9d['verbose']})[_0x175024(0x272)](_0x1d0198=>_0x1d0198[_0x175024(0x277)]),_0x11d20d=_0x3c8040,_0x1c92a9=extractRootFolderId(_0x11d20d),_0x5af5bd=_0x498db8,_0x1cb598=_0x3c48dc,{journeys:_0x217888,activationStepsById:_0x14c417}=_0x4ec7c1,_0x4118f8=new Map(_0x217888['map'](_0x1ecff2=>[_0x1ecff2['id'],_0x1ecff2])),_0x2e9f11=_0x217888[_0x175024(0x212)](_0x3f3e98=>({'id':_0x3f3e98['id'],'name':_0x3f3e98['attributes']['name'],'journeyBundleName':_0x3f3e98[_0x175024(0x268)][_0x175024(0x1f3)]||'','journeyBundleId':_0x3f3e98[_0x175024(0x268)][_0x175024(0x25b)]||'','versionNumber':_0x3f3e98[_0x175024(0x268)]['versionNumber'],'description':_0x3f3e98[_0x175024(0x268)][_0x175024(0x266)],'state':_0x3f3e98[_0x175024(0x268)][_0x175024(0x1eb)],'paused':_0x3f3e98[_0x175024(0x268)][_0x175024(0x25c)],'audienceId':_0x3f3e98[_0x175024(0x268)][_0x175024(0x215)],'folderId':_0x3f3e98[_0x175024(0x246)]?.[_0x175024(0x222)]?.['data']?.['id'],'createdAt':_0x3f3e98['attributes']['createdAt'],'updatedAt':_0x3f3e98[_0x175024(0x268)][_0x175024(0x226)]})),{emailToId:_0x275c87,idToEmail:_0x131eff}=_0x3173d3,_0x50dec2=await withSpinner(_0x175024(0x225),async()=>{const _0x441a0d=_0x175024,_0x238d07=await _0x5804c8[_0x441a0d(0x23a)][_0x441a0d(0x263)]();return buildConnectionMaps(_0x238d07);},{'verbose':_0x143a9d[_0x175024(0x1e2)]})['then'](_0x38ad30=>_0x38ad30['data']),_0x479330=_0x50dec2[_0x175024(0x269)],_0x3d4431=_0x50dec2[_0x175024(0x1de)],_0x352f11=_0x50dec2[_0x175024(0x228)],_0x20ab22={'emailToIdMap':_0x275c87,'connectionNameToIdMap':_0x479330,'connectionNameToTypeMap':_0x352f11,'getSchema':_0x1bd4a9=>_0x5804c8[_0x175024(0x23a)][_0x175024(0x24b)](_0x1bd4a9),'getMetadata':_0x21f16c=>_0x5804c8['connection']['getMetadataWithCache'](_0x21f16c)};let {pathToId:_0x1d475f,idToPath:_0x2a8e8e}=buildFolderMaps(_0x1cb598);const _0x28c596=buildSegmentLookupMap(_0x5af5bd,_0x2a8e8e),_0x538d21=buildSegmentNameToIdMap(_0x5af5bd),_0x1fa2ac=buildJourneyBundleLookupMap(_0x2e9f11,_0x2a8e8e);let _0x2fb20b;if(_0x26316a){if(!_0x26316a['endsWith'](_0x175024(0x221))&&!_0x26316a[_0x175024(0x240)](_0x175024(0x213)))return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)](_0x175024(0x248)+_0x26316a+'\x0a')),0x1;_0x2fb20b=[_0x26316a];}else _0x2fb20b=findYamlFiles(_0x3b0006);if(_0x2fb20b['length']===0x0)return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)](_0x175024(0x267)+_0x3b0006+'\x0a')),console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x20b)](_0x175024(0x279))),0x1;let _0x518cb6,_0x26a88c;try{const _0x3fe462=parseAndClassifyYamlFiles(_0x2fb20b,_0x3b0006,{'skipSegments':_0x143a9d[_0x175024(0x237)]});_0x518cb6=_0x3fe462[_0x175024(0x235)],_0x26a88c=_0x3fe462[_0x175024(0x1dc)];const _0x1a5311=validateParsedFiles(_0x3fe462,_0x3b0006);if(_0x1a5311[_0x175024(0x224)]>0x0)return console[_0x175024(0x1e8)](a55_0x12f718['red']('\x0aValidation\x20failed:')),console[_0x175024(0x1e8)](formatValidationErrors(_0x1a5311)),console[_0x175024(0x1e8)](a55_0x12f718['yellow'](_0x175024(0x1e9))),0x1;}catch(_0x3ebff1){return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)](_0x175024(0x274)+(_0x3ebff1 instanceof Error?_0x3ebff1[_0x175024(0x1fa)]:_0x3ebff1))),0x1;}if(_0x518cb6['length']===0x0&&_0x26a88c[_0x175024(0x224)]===0x0){const _0x34ca38=_0x143a9d['journeysOnly']?'journey':_0x175024(0x252);return console[_0x175024(0x1e8)](a55_0x12f718['yellow'](_0x175024(0x1ed)+_0x34ca38+_0x175024(0x26d))),0x0;}const _0x36692c=new Map();_0x5af5bd[_0x175024(0x224)]>0x0&&!_0x143a9d['journeysOnly']&&await withSpinner(_0x175024(0x1fe),async()=>{await batchAsync(_0x5af5bd,async _0x1e66ca=>{const _0x305e0f=a55_0x55d1,_0x50e098=await _0x5804c8['segment'][_0x305e0f(0x22e)](_0x25a2cd,_0x1e66ca['id']);_0x36692c['set'](_0x1e66ca['id'],_0x50e098);});},{'verbose':_0x143a9d[_0x175024(0x1e2)]});const {segmentFiles:_0xea7a00,foldersToCreate:_0x2b549e}=await prepareSegmentFiles(_0x518cb6,{'segmentByFolderAndName':_0x28c596,'activationsBySegmentId':_0x36692c,'folderPathToId':_0x1d475f,'idToEmailMap':_0x131eff,'connectionIdToNameMap':_0x3d4431},_0x20ab22,_0x21102b,_0x43e80c),_0x46c021=_0x26316a?[]:findSegmentsToDelete(_0x5af5bd,_0x518cb6[_0x175024(0x212)](({yamlConfig:_0x3bcc3c,folderPath:_0x4ec712})=>({'yamlConfig':_0x3bcc3c,'folderPath':resolveTDFolderPath(_0x4ec712,_0x21102b,_0x43e80c)})),_0x2a8e8e,_0x43e80c,_0x21102b),{journeyFiles:_0x4d4d95,foldersToCreate:_0x530955}=await withProgressSpinner(_0x175024(0x26c),async _0xa92db8=>prepareJourneyFiles(_0x26a88c,{'fetchJourney':async _0x1249fe=>_0x5804c8[_0x175024(0x234)][_0x175024(0x23d)](_0x1249fe[_0x175024(0x244)]),'journeyBundlesByFolderAndName':_0x1fa2ac,'folderPathToId':_0x1d475f,'idToEmailMap':_0x131eff,'connectionIdToNameMap':_0x3d4431,'existingSegments':_0x5af5bd,'parentId':_0x25a2cd,'deps':_0x5804c8,'progress':{'update':_0x87fcbb=>{const _0x22e9db=_0x175024;_0xa92db8[_0x22e9db(0x258)](_0x87fcbb),_0x143a9d[_0x22e9db(0x1e2)]&&console[_0x22e9db(0x1e8)]('\x20\x20'+_0x87fcbb);}},'journeyById':_0x4118f8,'activationStepsById':_0x14c417},_0x21102b,_0x43e80c),{'verbose':_0x143a9d[_0x175024(0x1e2)]})[_0x175024(0x272)](_0x7cb77b=>_0x7cb77b['data']);for(const _0x522882 of _0x530955){_0x2b549e['add'](_0x522882);}const _0x512ea5=_0x26316a?[]:findJourneysToDelete(_0x2e9f11,_0x26a88c[_0x175024(0x212)](({yamlConfig:_0x596043,folderPath:_0x483271})=>({'yamlConfig':_0x596043,'folderPath':resolveTDFolderPath(_0x483271,_0x21102b,_0x43e80c)})),_0x2a8e8e,_0x43e80c,_0x21102b),_0x340315=calculatePushStats(_0xea7a00,_0x4d4d95,_0x2b549e,_0x46c021,_0x512ea5,!!_0x143a9d[_0x175024(0x257)],!!_0x143a9d[_0x175024(0x237)]),_0x33353f=_0x340315[_0x175024(0x235)][_0x175024(0x250)],_0x1ae4d4=_0x340315['segments']['changed'],_0x51e345=_0x340315[_0x175024(0x235)][_0x175024(0x223)],_0x112f69=_0x340315['segments']['toDelete'],_0x5bad2a=_0x340315[_0x175024(0x25a)][_0x175024(0x204)],_0x56a825=_0x340315[_0x175024(0x1dc)][_0x175024(0x250)],_0x3f1c9e=_0x340315[_0x175024(0x1dc)]['changed'],_0x1dfe8e=_0x340315['journeys'][_0x175024(0x223)],_0x59ec30=_0x340315[_0x175024(0x1dc)][_0x175024(0x20c)],_0x27f159=_0x340315[_0x175024(0x276)][_0x175024(0x23f)],_0x457b25=_0x340315[_0x175024(0x276)][_0x175024(0x204)],_0x3accea=_0x340315[_0x175024(0x276)][_0x175024(0x278)],_0x33fc28=_0x340315['activations']['toDelete'];console[_0x175024(0x1e8)](_0x175024(0x247)+_0x2869be+'\x27:');_0x5bad2a[_0x175024(0x224)]>0x0&&console[_0x175024(0x1e8)]('\x20\x20'+a55_0x12f718[_0x175024(0x256)](_0x175024(0x275)+_0x5bad2a[_0x175024(0x224)]+_0x175024(0x22d)));if(!_0x143a9d['journeysOnly']){console['error']('\x20\x20📊\x20Segments:'),console['error'](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x264)]('+\x20'+_0x33353f[_0x175024(0x224)]+_0x175024(0x24f))),console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x218)]('~\x20'+_0x1ae4d4[_0x175024(0x224)]+_0x175024(0x1f1)));if(_0x112f69[_0x175024(0x224)]>0x0)console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x23b)]('-\x20'+_0x112f69[_0x175024(0x224)]+_0x175024(0x24c)));else _0x46c021[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x257)]&&console['error'](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x1f5)](_0x46c021['length']+_0x175024(0x236)));console['error'](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x1f5)]('=\x20'+_0x51e345[_0x175024(0x224)]+_0x175024(0x26e)));}if(_0x4d4d95[_0x175024(0x224)]>0x0||_0x512ea5[_0x175024(0x224)]>0x0){console[_0x175024(0x1e8)](_0x175024(0x1fb)),console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718['green']('+\x20'+_0x56a825[_0x175024(0x224)]+'\x20new')),console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x218)]('~\x20'+_0x3f1c9e[_0x175024(0x224)]+_0x175024(0x1f1)));if(_0x59ec30['length']>0x0)console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x23b)]('-\x20'+_0x59ec30['length']+_0x175024(0x24c)));else _0x512ea5[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x257)]&&console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x1f5)](_0x512ea5[_0x175024(0x224)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x1f5)]('=\x20'+_0x1dfe8e['length']+_0x175024(0x26e)));}_0x27f159[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x237)]&&(console[_0x175024(0x1e8)](''),console[_0x175024(0x1e8)]('\x20\x20Activations:'),_0x457b25[_0x175024(0x224)]>0x0&&console['error'](_0x175024(0x1f8)+a55_0x12f718[_0x175024(0x264)]('+\x20'+_0x457b25[_0x175024(0x224)]+'\x20to\x20create')),_0x3accea[_0x175024(0x224)]>0x0&&console[_0x175024(0x1e8)]('\x20\x20\x20\x20'+a55_0x12f718[_0x175024(0x218)]('~\x20'+_0x3accea[_0x175024(0x224)]+_0x175024(0x21a))),_0x33fc28[_0x175024(0x224)]>0x0&&console[_0x175024(0x1e8)](_0x175024(0x1f8)+a55_0x12f718['red']('-\x20'+_0x33fc28[_0x175024(0x224)]+_0x175024(0x24c))));console[_0x175024(0x1e8)](_0x175024(0x261)+a55_0x12f718['cyan'](_0x3b0006)+'\x0a');if(_0x5bad2a[_0x175024(0x224)]>0x0){console['error'](_0x175024(0x243));for(const _0x5262f6 of _0x5bad2a){console['error']('\x20\x20'+a55_0x12f718['blue']('+')+'\x20'+_0x5262f6);}console[_0x175024(0x1e8)]('');}if(_0x33353f[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x237)])for(const _0x29437d of _0x33353f){const _0x2f11b7=_0x29437d['folderPath']?_0x29437d[_0x175024(0x1ee)]+'/'+_0x29437d[_0x175024(0x273)][_0x175024(0x271)]:_0x29437d[_0x175024(0x273)][_0x175024(0x271)],_0x144c02=_0x29437d[_0x175024(0x273)][_0x175024(0x276)]?.[_0x175024(0x224)]||0x0,_0x208b1c=_0x144c02>0x0?a55_0x12f718[_0x175024(0x1f5)]('\x20['+_0x144c02+_0x175024(0x233)):'';console[_0x175024(0x1e8)]('\x0a'+a55_0x12f718[_0x175024(0x264)]('New\x20segment:')+'\x20'+_0x2f11b7+_0x208b1c),console[_0x175024(0x1e8)]('─'[_0x175024(0x217)](0x3c)),_0x29437d['diff']&&console[_0x175024(0x1e8)](_0x29437d[_0x175024(0x1f0)]),console['error']('─'[_0x175024(0x217)](0x3c));}if(_0x112f69[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x237)])for(const _0x69485c of _0x112f69){const _0x1acc2f=_0x69485c['segmentFolderId']?_0x2a8e8e['get'](_0x69485c['segmentFolderId'][_0x175024(0x1e6)]())||'':'',_0x444e47=_0x1acc2f?_0x1acc2f+'/'+_0x69485c['name']:_0x69485c[_0x175024(0x271)],_0x4be3a2=_0x36692c['get'](_0x69485c['id'])||[],_0x1d3fee=_0x4be3a2['length']>0x0?a55_0x12f718[_0x175024(0x1f5)]('\x20['+_0x4be3a2[_0x175024(0x224)]+_0x175024(0x233)):'';console['error']('\x0a'+a55_0x12f718[_0x175024(0x23b)](_0x175024(0x1ff))+'\x20'+_0x444e47+_0x1d3fee),console[_0x175024(0x1e8)]('─'[_0x175024(0x217)](0x3c));const _0x4ea129=segmentWithActivationsToYaml(_0x69485c,_0x4be3a2,undefined,_0x131eff,_0x3d4431),_0x422e4c=segmentToYamlString(_0x4ea129),_0x3b0fb9=generateDiff(_0x422e4c,'');console['error'](formatDiffWithColors(_0x3b0fb9)),console['error']('─'[_0x175024(0x217)](0x3c));}const _0x2502d8=_0xea7a00[_0x175024(0x1e3)](_0x1981ce=>!_0x1981ce[_0x175024(0x23c)]&&_0x1981ce[_0x175024(0x1f0)]);if(_0x2502d8['length']>0x0&&!_0x143a9d['journeysOnly'])for(const _0x4b269e of _0x2502d8){const _0x35f883=_0x4b269e[_0x175024(0x1ee)]?_0x4b269e['folderPath']+'/'+_0x4b269e[_0x175024(0x273)][_0x175024(0x271)]:_0x4b269e['yamlConfig'][_0x175024(0x271)];console['error']('\x0a'+a55_0x12f718[_0x175024(0x218)]('Changes\x20to:')+'\x20'+_0x35f883),console[_0x175024(0x1e8)]('─'['repeat'](0x3c)),console[_0x175024(0x1e8)](_0x4b269e[_0x175024(0x1f0)]),console['error']('─'['repeat'](0x3c));}if(_0x56a825[_0x175024(0x224)]>0x0)for(const _0x3ccddb of _0x56a825){const _0x553304=_0x3ccddb[_0x175024(0x1ee)]?_0x3ccddb['folderPath']+'/'+_0x3ccddb[_0x175024(0x273)][_0x175024(0x271)]:_0x3ccddb[_0x175024(0x273)][_0x175024(0x271)];console['error']('\x0a'+a55_0x12f718[_0x175024(0x264)]('New\x20journey:')+'\x20'+_0x553304),console['error']('─'[_0x175024(0x217)](0x3c)),_0x3ccddb[_0x175024(0x1f0)]&&console[_0x175024(0x1e8)](_0x3ccddb['diff']),console[_0x175024(0x1e8)]('─'[_0x175024(0x217)](0x3c));}const _0x307189=_0x4d4d95[_0x175024(0x1e3)](_0x42f744=>!_0x42f744['isNew']&&_0x42f744[_0x175024(0x1f0)]);if(_0x307189[_0x175024(0x224)]>0x0)for(const _0x3e4f9a of _0x307189){const _0x2f8dfc=_0x3e4f9a[_0x175024(0x1ee)]?_0x3e4f9a['folderPath']+'/'+_0x3e4f9a[_0x175024(0x273)][_0x175024(0x271)]:_0x3e4f9a[_0x175024(0x273)][_0x175024(0x271)];console['error']('\x0a'+a55_0x12f718['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x2f8dfc),console[_0x175024(0x1e8)]('─'[_0x175024(0x217)](0x3c)),console[_0x175024(0x1e8)](_0x3e4f9a[_0x175024(0x1f0)]),console['error']('─'[_0x175024(0x217)](0x3c));}if(_0x59ec30[_0x175024(0x224)]>0x0)for(const _0x19f586 of _0x59ec30){const _0x2889ae=_0x19f586[_0x175024(0x230)]?_0x2a8e8e['get'](_0x19f586[_0x175024(0x230)])||'':'',_0x19cd28=_0x2889ae?_0x2889ae+'/'+_0x19f586[_0x175024(0x1f3)]:_0x19f586[_0x175024(0x1f3)];console[_0x175024(0x1e8)]('\x0a'+a55_0x12f718[_0x175024(0x23b)](_0x175024(0x22b))+'\x20'+_0x19cd28),console[_0x175024(0x1e8)]('─'['repeat'](0x3c)),console['error'](a55_0x12f718[_0x175024(0x23b)](_0x175024(0x239))),console[_0x175024(0x1e8)]('─'[_0x175024(0x217)](0x3c));}if(_0x143a9d['dryRun'])return console['error'](a55_0x12f718[_0x175024(0x218)](_0x175024(0x1ea))),0x0;const _0x1ad57d=_0x143a9d[_0x175024(0x237)]?![]:_0x33353f[_0x175024(0x224)]>0x0||_0x1ae4d4[_0x175024(0x224)]>0x0||_0x112f69[_0x175024(0x224)]>0x0,_0x186d27=_0x56a825[_0x175024(0x224)]>0x0||_0x3f1c9e['length']>0x0||_0x59ec30[_0x175024(0x224)]>0x0,_0x213a5a=_0x143a9d[_0x175024(0x237)]?![]:_0x27f159[_0x175024(0x224)]>0x0,_0x438dfc=_0x5bad2a[_0x175024(0x224)]>0x0;if(!_0x1ad57d&&!_0x186d27&&!_0x213a5a&&!_0x438dfc){const _0x376d22=_0x143a9d[_0x175024(0x237)]?_0x175024(0x1ec):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x175024(0x1e8)](a55_0x12f718['green'](_0x376d22));if(_0x26316a&&_0x51e345[_0x175024(0x224)]===0x1){const _0x5505da=_0x51e345[0x0];if(_0x5505da[_0x175024(0x231)]?.['id']){const _0xe7dcdb=getConsoleNextUrl(_0x143a9d['site'],_0x175024(0x207)+_0x25a2cd+'/e/'+_0x5505da[_0x175024(0x231)]['id']+'/sb/da/esr');console[_0x175024(0x1e8)](_0x175024(0x20d)+a55_0x12f718['cyan'](_0xe7dcdb));}}if(_0x26316a&&_0x1dfe8e['length']===0x1){const _0x586182=_0x1dfe8e[0x0];if(_0x586182[_0x175024(0x1dd)]?.['id']){const _0x324b02=getConsoleNextUrl(_0x143a9d[_0x175024(0x26b)],_0x175024(0x207)+_0x25a2cd+_0x175024(0x227)+_0x586182['existingJourney']['id']+'/j/da/je');console[_0x175024(0x1e8)]('\x20\x20'+a55_0x12f718[_0x175024(0x20b)](_0x324b02));}}return 0x0;}const _0x3df1c4=_0x143a9d['journeysOnly']?_0x56a825[_0x175024(0x224)]+_0x3f1c9e['length']+_0x59ec30[_0x175024(0x224)]+_0x5bad2a[_0x175024(0x224)]:_0x33353f[_0x175024(0x224)]+_0x1ae4d4[_0x175024(0x224)]+_0x112f69[_0x175024(0x224)]+_0x56a825[_0x175024(0x224)]+_0x3f1c9e[_0x175024(0x224)]+_0x59ec30['length']+_0x5bad2a['length']+_0x27f159[_0x175024(0x224)];if(!_0x143a9d[_0x175024(0x1e4)]&&_0x3df1c4>0x0){if(!isInteractive())return console['error'](a55_0x12f718['red'](_0x175024(0x1f7)),_0x175024(0x254)),console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x1f5)](_0x175024(0x203))),0x1;const _0x4d6500=await confirmKey(_0x175024(0x255)+_0x3df1c4+_0x175024(0x20f));if(!_0x4d6500)return console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x218)](_0x175024(0x232))),0x1;}const _0x4da282={'withProgress':async(_0x458c2e,_0x18a846)=>{const _0x438627=_0x175024,_0x1ec54a=await withSpinner(_0x458c2e,_0x18a846,{'verbose':_0x143a9d[_0x438627(0x1e2)]});return{'data':_0x1ec54a[_0x438627(0x277)]};},'logInfo':_0x5544f3=>console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x256)]('✔\x20'+_0x5544f3)),'logSuccess':_0xdd8d3=>console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x264)]('✔\x20'+_0xdd8d3)),'logWarning':_0x3446d4=>console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x218)]('⚠\x20'+_0x3446d4)),'logDeleted':_0xdf8d09=>console[_0x175024(0x1e8)](a55_0x12f718[_0x175024(0x23b)]('✔\x20'+_0xdf8d09))},_0x256056={'segment':_0x5804c8[_0x175024(0x262)],'journey':_0x5804c8['journey'],'user':_0x5804c8[_0x175024(0x22f)],'connection':_0x5804c8[_0x175024(0x23a)]};_0x5bad2a[_0x175024(0x224)]>0x0&&(_0x1d475f=await executePushFolders(_0x256056,_0x5bad2a,_0x1d475f,{'parentId':_0x25a2cd},_0x4da282));const _0x102cd2={'rootFolderId':_0x1c92a9,'folderPathToId':_0x1d475f,'folderIdToPath':_0x2a8e8e,'segmentNameToId':_0x538d21,'activationsBySegmentId':_0x36692c,'emailToIdMap':_0x275c87,'idToEmailMap':_0x131eff,'connectionNameToIdMap':_0x50dec2[_0x175024(0x269)],'connectionIdToNameMap':_0x50dec2[_0x175024(0x1de)],'connectionNameToTypeMap':_0x352f11},_0x27ddd9=await executePushSegments(_0x256056,_0x143a9d[_0x175024(0x237)]?[]:_0xea7a00,_0x102cd2,{'parentId':_0x25a2cd},_0x4da282),_0x8452fb=_0x27ddd9[_0x175024(0x21d)],_0x2d5ef2=_0x27ddd9['updated'],_0x57c9f3=_0x27ddd9[_0x175024(0x276)][_0x175024(0x21d)],_0x2df9fe=_0x27ddd9[_0x175024(0x276)]['updated'],_0x32e30=_0x27ddd9[_0x175024(0x276)]['deleted'];let _0x798477;if(_0x26316a&&_0xea7a00[_0x175024(0x224)]===0x1){const _0x1c25d2=_0xea7a00[0x0];_0x798477=_0x1c25d2[_0x175024(0x231)]?.['id']??_0x27ddd9[_0x175024(0x1f9)]['get'](_0x1c25d2[_0x175024(0x273)][_0x175024(0x271)]);}const _0x277885=await executePushSegmentDeletions(_0x256056,_0x143a9d[_0x175024(0x237)]?[]:_0x112f69,_0x4da282);let _0x42cca3=0x0,_0xb7a30=0x0,_0x45a9a1=0x0;const _0x1eaf22=new Map(_0x538d21);for(const [_0x375e92,_0xb6895f]of _0x27ddd9[_0x175024(0x1f9)]){_0x1eaf22[_0x175024(0x241)](_0x375e92,_0xb6895f);}if(_0x4d4d95[_0x175024(0x224)]>0x0){const _0x396309={..._0x102cd2,'segmentNameToId':_0x1eaf22,'existingSegments':_0x5af5bd,'activationContext':_0x20ab22},_0x5bd1b2=await executePushJourneys(_0x256056,_0x4d4d95,_0x396309,{'parentId':_0x25a2cd,'rootFolderId':_0x1c92a9,'verbose':_0x143a9d['verbose']},_0x4da282);_0x42cca3=_0x5bd1b2[_0x175024(0x21d)],_0xb7a30=_0x5bd1b2[_0x175024(0x242)];if(_0x26316a&&_0x5bd1b2[_0x175024(0x229)][_0x175024(0x224)]===0x1){const _0x4c454f=_0x5bd1b2['results'][0x0];if(_0x4c454f[_0x175024(0x244)]){const _0xd867eb=getConsoleNextUrl(_0x143a9d[_0x175024(0x26b)],_0x175024(0x207)+_0x25a2cd+'/e/'+_0x4c454f[_0x175024(0x244)]+_0x175024(0x259));console[_0x175024(0x1e8)]('\x20\x20'+a55_0x12f718[_0x175024(0x20b)](_0xd867eb));}}}for(const _0x49541a of _0x59ec30){console['error'](a55_0x12f718['yellow'](_0x175024(0x251)+_0x49541a['journeyBundleName'])),_0x45a9a1++;}const _0x2d7b64=[];if(_0x8452fb>0x0)_0x2d7b64[_0x175024(0x20e)](_0x8452fb+_0x175024(0x220));if(_0x2d5ef2>0x0)_0x2d7b64[_0x175024(0x20e)](_0x2d5ef2+'\x20updated');if(_0x277885>0x0)_0x2d7b64[_0x175024(0x20e)](_0x277885+_0x175024(0x1fd));const _0x49f934=[];if(_0x42cca3>0x0)_0x49f934[_0x175024(0x20e)](_0x42cca3+'\x20created');if(_0xb7a30>0x0)_0x49f934[_0x175024(0x20e)](_0xb7a30+_0x175024(0x1f2));if(_0x45a9a1>0x0)_0x49f934['push'](_0x45a9a1+_0x175024(0x1fd));const _0x223a97=[];if(_0x57c9f3>0x0)_0x223a97[_0x175024(0x20e)](_0x57c9f3+'\x20created');if(_0x2df9fe>0x0)_0x223a97[_0x175024(0x20e)](_0x2df9fe+'\x20updated');if(_0x32e30>0x0)_0x223a97['push'](_0x32e30+_0x175024(0x1fd));console['error'](a55_0x12f718[_0x175024(0x264)](_0x175024(0x24e)));_0x2d7b64[_0x175024(0x224)]>0x0&&!_0x143a9d[_0x175024(0x237)]&&console[_0x175024(0x1e8)]('\x20\x20Segments:\x20'+_0x2d7b64[_0x175024(0x24d)](',\x20'));_0x49f934[_0x175024(0x224)]>0x0&&console[_0x175024(0x1e8)](_0x175024(0x201)+_0x49f934['join'](',\x20'));_0x223a97['length']>0x0&&!_0x143a9d[_0x175024(0x237)]&&console[_0x175024(0x1e8)](_0x175024(0x219)+_0x223a97['join'](',\x20'));if(_0x798477){const _0x2c7b10=getConsoleNextUrl(_0x143a9d[_0x175024(0x26b)],_0x175024(0x207)+_0x25a2cd+_0x175024(0x227)+_0x798477+_0x175024(0x23e));console[_0x175024(0x1e8)](_0x175024(0x20d)+a55_0x12f718[_0x175024(0x20b)](_0x2c7b10));}return 0x0;}}function a55_0x317c(){const _0x47a14f=['listJourneysWithDetailsFromParentSegment','audienceId','4497522wVrjXn','repeat','yellow','\x20\x20Activations:\x20','\x20to\x20update','3254CfYVBu','parentSegment','created','cwd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','\x20created','.yml','parentFolder','unchanged','length','Fetching\x20connections\x20for\x20name\x20resolution...','updatedAt','/e/','nameToType','results','63wzyYhY','Delete\x20journey:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20folders\x20to\x20create','listActivations','user','folderId','existingSegment','Aborted.','\x20activations]','journey','segments','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeysOnly','Source\x20directory:\x20','(Journey\x20will\x20be\x20deleted)','connection','red','isNew','getJourney','/sb/da/esr','all','endsWith','set','updated','Folders\x20to\x20create:','journeyId','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)','relationships','\x0aPush\x20summary\x20for\x20\x27','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','scopedFolderPath','isScoped','getOutputSchemaWithCache','\x20to\x20delete','join','\x0a✔\x20Push\x20complete','\x20new','new','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','segment\x20or\x20journey','segment:push','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','Push\x20','blue','delete','setPhase','/j/da/je','folders','journeyBundleId','paused','buildUserMaps','17482610SqubPD','\x27...','file','\x20\x20Source:\x20','segment','list','green','834512ShKHpl','description','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','attributes','nameToId','Scoped\x20to\x20folder:\x20','site','Preparing\x20journeys...','\x20YAML\x20files\x20found','\x20unchanged','filePath','parent_name','name','then','yamlConfig','Error\x20parsing\x20YAML:\x20','📁\x20','activations','data','toUpdate','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','journeys','existingJourney','idToName','1630744IGrqNi','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','type','verbose','filter','yes','Error:\x20','toString','Site:\x20','error','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','state','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','No\x20','folderPath','targetDir','diff','\x20changed','\x20updated','journeyBundleName','errorCode','dim','25fVzADu','\x0aError:','\x20\x20\x20\x20','createdSegmentIds','message','\x20\x20🗺️\x20\x20Journeys:','Resolving\x20parent\x20segment\x20\x27','\x20deleted','Fetching\x20existing\x20activations...','Delete\x20segment:','getParent','\x20\x20Journeys:\x20','no_parent','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','toCreate','4817358YstzLa','helpText','/app/ps/','listFolders','33WGixKj','13373115WUOEVu','cyan','toDelete','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','push','\x20changes?','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','1006gBWeaH','map','.yaml'];a55_0x317c=function(){return _0x47a14f;};return a55_0x317c();}
|
|
1
|
+
const a52_0x466d62=a52_0x3a9a;function a52_0x3a9a(_0x3f0a33,_0x397587){_0x3f0a33=_0x3f0a33-0x160;const _0x2cbb2f=a52_0x2cbb();let _0x3a9aa6=_0x2cbb2f[_0x3f0a33];return _0x3a9aa6;}(function(_0x23d274,_0x28c916){const _0x2249d7=a52_0x3a9a,_0x24b360=_0x23d274();while(!![]){try{const _0x41d31b=parseInt(_0x2249d7(0x1e0))/0x1+-parseInt(_0x2249d7(0x1ca))/0x2*(-parseInt(_0x2249d7(0x1b0))/0x3)+-parseInt(_0x2249d7(0x1c1))/0x4+parseInt(_0x2249d7(0x1fc))/0x5*(parseInt(_0x2249d7(0x164))/0x6)+parseInt(_0x2249d7(0x167))/0x7*(-parseInt(_0x2249d7(0x1d8))/0x8)+parseInt(_0x2249d7(0x1f8))/0x9+parseInt(_0x2249d7(0x18a))/0xa*(parseInt(_0x2249d7(0x193))/0xb);if(_0x41d31b===_0x28c916)break;else _0x24b360['push'](_0x24b360['shift']());}catch(_0x36fac1){_0x24b360['push'](_0x24b360['shift']());}}}(a52_0x2cbb,0xb27bc));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';function a52_0x2cbb(){const _0x270927=['.yaml','attributes','/app/ps/','diff','getJourney','updated','results','connection','Error:\x20','9056Ptigkb','\x20\x20\x20\x20','then','all','\x27...','green','toDelete','deleted','57912nuFxMy','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Fetching\x20existing\x20activations...','filter','journey','journeyBundleName','errorCode','\x20\x20Journeys:\x20','(Journey\x20will\x20be\x20deleted)','dim','error','journeys','createdSegmentIds','execute','getOutputSchemaWithCache','/sb/da/esr','blue','segments','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','yamlConfig','add','\x20\x20🗺️\x20\x20Journeys:','\x20YAML\x20files\x20found','Delete\x20segment:','10595457sjJYJv','\x0aValidation\x20failed:','\x20\x20Activations:\x20','\x0aPush\x20summary\x20for\x20\x27','1021975hylZUa','Fetching\x20connections\x20for\x20name\x20resolution...','nameToId','Changes\x20to\x20journey:','relationships','6TCCgWx','isScoped','cyan','8547SEaxxZ','Resolving\x20parent\x20segment\x20\x27','journeysOnly','\x20updated','state','map','segmentFolderId','yes','\x20\x20Segments:\x20','folderId','type','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','Push\x20YAML\x20files\x20to\x20Treasure\x20AI\x20as\x20child\x20segments','journeyId','Fetching\x20existing\x20data...','Parent\x20segment:\x20','created','Error:\x20Directory\x20not\x20found:\x20','Source\x20directory:\x20','verbose','endsWith','toUpdate','\x20to\x20create','data','Push\x20','existingSegment','\x0aError:','segment\x20or\x20journey','list','yellow','repeat','\x20\x20Source:\x20','name','\x0a✔\x20Push\x20complete','/e/','1049410oZqdqC','scopedFolderPath','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','message','\x20to\x20delete','\x20activations]','New\x20segment:','delete','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','77jmdBTN','.yml','user','buildUserMaps','folderPath','cwd','listJourneysWithDetailsFromParentSegment','versionNumber','get','file','join','activations','\x20deleted','\x20\x20Activations:','nameToType','unchanged','set','changed','toString','\x20created','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','/j/da/je','existingJourney','filePath','helpText','new','\x20changes?','push','length','480171eMSuQs','\x20unchanged','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)','folders','\x20to\x20update','toCreate','red','resolveParentId','listActivations','segment','Site:\x20','Folders\x20to\x20create:','targetDir','dryRun','\x20changed','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','setPhase','2804620VhyLpA','no_parent','parent_name','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','segment:push','\x20new','parentFolder','createdAt','listSegments','8NMPUxV','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','site','No\x20','New\x20journey:'];a52_0x2cbb=function(){return _0x270927;};return a52_0x2cbb();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a52_0x2a49b2 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a52_0x466d62(0x187)]=a52_0x466d62(0x1c5);['description']=a52_0x466d62(0x173);async[a52_0x466d62(0x1ed)](_0x939b53){const _0x10ad3f=a52_0x466d62,{options:_0x2d980a,args:_0x2da824,tdx:_0x50eb30}=_0x939b53,_0x3785e5=_0x2d980a,_0x3858b1=await resolveTarget({'arg':_0x2da824[0x0],'contextParent':_0x2d980a['parentSegment'],'cwd':process[_0x10ad3f(0x198)]()});if(!isSuccessfulResolution(_0x3858b1))return _0x3858b1[_0x10ad3f(0x1e6)]===_0x10ad3f(0x1c2)?(console['error'](a52_0x2a49b2[_0x10ad3f(0x184)](_0x10ad3f(0x1bf))),console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1b2)),console[_0x10ad3f(0x1ea)](_0x10ad3f(0x192)),console[_0x10ad3f(0x1ea)]('\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[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x1b6)](_0x10ad3f(0x1d7)+_0x3858b1[_0x10ad3f(0x18d)]+'\x0a')),_0x3858b1['helpText']&&console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x166)](_0x3858b1[_0x10ad3f(0x1ab)]))),0x1;if(_0x3858b1[_0x10ad3f(0x171)]===_0x10ad3f(0x1c3))return console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x1b6)](_0x10ad3f(0x178)+_0x3858b1[_0x10ad3f(0x1bc)]+'\x0a')),console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x166)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x15c402=_0x3858b1['parentName'],_0x1158e1=_0x3858b1[_0x10ad3f(0x1bc)],_0x31b991=_0x3858b1[_0x10ad3f(0x171)]===_0x10ad3f(0x19c)?_0x3858b1[_0x10ad3f(0x1aa)]:undefined,_0x2f2ba3=getScopedDetails(_0x3858b1),_0x513e2c=_0x2f2ba3?.[_0x10ad3f(0x165)]??![],_0x5068f7=_0x2f2ba3?.[_0x10ad3f(0x18b)]??'';if(!existsSync(_0x1158e1))return console[_0x10ad3f(0x1ea)](a52_0x2a49b2['red'](_0x10ad3f(0x178)+_0x1158e1+'\x0a')),console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x166)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3785e5['verbose']&&(console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1ba)+_0x3785e5[_0x10ad3f(0x1cc)]),console[_0x10ad3f(0x1ea)](_0x10ad3f(0x176)+_0x15c402),console['error'](_0x10ad3f(0x179)+_0x1158e1),_0x513e2c&&console['error']('Scoped\x20to\x20folder:\x20'+_0x5068f7));const _0x3f1f27=await withSpinner(_0x10ad3f(0x168)+_0x15c402+_0x10ad3f(0x1dc),()=>_0x50eb30[_0x10ad3f(0x1b9)][_0x10ad3f(0x1b7)](_0x15c402),{'verbose':_0x3785e5[_0x10ad3f(0x17a)]}),_0x4f45f7=_0x3f1f27[_0x10ad3f(0x17e)],{parentSegmentResult:_0x2f47a1,segmentsResult:_0x453d8b,foldersResult:_0x1a400a,journeysWithDetailsResult:_0x1e9bd1,userMaps:_0x286eeb}=await withSpinner(_0x10ad3f(0x175),async()=>{const _0x493f54=_0x10ad3f,[_0xb3c63c,_0x42bbf5,_0x177945,_0x2c0a0d,_0x43a04c]=await Promise[_0x493f54(0x1db)]([_0x50eb30['segment']['getParent'](_0x4f45f7),_0x50eb30['segment'][_0x493f54(0x1c9)](_0x4f45f7),_0x50eb30[_0x493f54(0x1b9)]['listFolders'](_0x4f45f7),_0x50eb30[_0x493f54(0x1e4)][_0x493f54(0x199)](_0x4f45f7,{'includeAllVersions':!![]}),_0x50eb30[_0x493f54(0x195)][_0x493f54(0x196)]()]);return{'parentSegmentResult':_0xb3c63c,'segmentsResult':_0x42bbf5,'foldersResult':_0x177945,'journeysWithDetailsResult':_0x2c0a0d,'userMaps':_0x43a04c};},{'verbose':_0x3785e5[_0x10ad3f(0x17a)]})[_0x10ad3f(0x1da)](_0x4b2192=>_0x4b2192[_0x10ad3f(0x17e)]),_0x9e6d42=_0x2f47a1,_0x5ddff0=extractRootFolderId(_0x9e6d42),_0x31b996=_0x453d8b,_0x22787f=_0x1a400a,{journeys:_0x218c77,activationStepsById:_0x240b3d}=_0x1e9bd1,_0x1a71ad=new Map(_0x218c77[_0x10ad3f(0x16c)](_0x2af10f=>[_0x2af10f['id'],_0x2af10f])),_0x9ed459=_0x218c77['map'](_0x36cd80=>({'id':_0x36cd80['id'],'name':_0x36cd80['attributes'][_0x10ad3f(0x187)],'journeyBundleName':_0x36cd80[_0x10ad3f(0x1d0)][_0x10ad3f(0x1e5)]||'','journeyBundleId':_0x36cd80[_0x10ad3f(0x1d0)]['journeyBundleId']||'','versionNumber':_0x36cd80[_0x10ad3f(0x1d0)][_0x10ad3f(0x19a)],'description':_0x36cd80[_0x10ad3f(0x1d0)]['description'],'state':_0x36cd80[_0x10ad3f(0x1d0)][_0x10ad3f(0x16b)],'paused':_0x36cd80['attributes']['paused'],'audienceId':_0x36cd80[_0x10ad3f(0x1d0)]['audienceId'],'folderId':_0x36cd80[_0x10ad3f(0x163)]?.[_0x10ad3f(0x1c7)]?.['data']?.['id'],'createdAt':_0x36cd80['attributes'][_0x10ad3f(0x1c8)],'updatedAt':_0x36cd80[_0x10ad3f(0x1d0)]['updatedAt']})),{emailToId:_0x428511,idToEmail:_0x3b9bb1}=_0x286eeb,_0x116e67=await withSpinner(_0x10ad3f(0x160),async()=>{const _0xef9daf=_0x10ad3f,_0x2bbb2e=await _0x50eb30[_0xef9daf(0x1d6)][_0xef9daf(0x183)]();return buildConnectionMaps(_0x2bbb2e);},{'verbose':_0x3785e5[_0x10ad3f(0x17a)]})[_0x10ad3f(0x1da)](_0x5d7937=>_0x5d7937[_0x10ad3f(0x17e)]),_0xea3136=_0x116e67[_0x10ad3f(0x161)],_0x448cf5=_0x116e67['idToName'],_0x2b2c03=_0x116e67[_0x10ad3f(0x1a1)],_0x1de324={'emailToIdMap':_0x428511,'connectionNameToIdMap':_0xea3136,'connectionNameToTypeMap':_0x2b2c03,'getSchema':_0x45cec6=>_0x50eb30[_0x10ad3f(0x1d6)][_0x10ad3f(0x1ee)](_0x45cec6),'getMetadata':_0xf0fde5=>_0x50eb30[_0x10ad3f(0x1d6)]['getMetadataWithCache'](_0xf0fde5)};let {pathToId:_0x3d1d91,idToPath:_0x11a58d}=buildFolderMaps(_0x22787f);const _0x30f950=buildSegmentLookupMap(_0x31b996,_0x11a58d),_0x52d82a=buildSegmentNameToIdMap(_0x31b996),_0x98c931=buildJourneyBundleLookupMap(_0x9ed459,_0x11a58d);let _0x380562;if(_0x31b991){if(!_0x31b991[_0x10ad3f(0x17b)](_0x10ad3f(0x194))&&!_0x31b991[_0x10ad3f(0x17b)](_0x10ad3f(0x1cf)))return console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x1b6)](_0x10ad3f(0x1a7)+_0x31b991+'\x0a')),0x1;_0x380562=[_0x31b991];}else _0x380562=findYamlFiles(_0x1158e1);if(_0x380562['length']===0x0)return console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x1b6)](_0x10ad3f(0x1e1)+_0x1158e1+'\x0a')),console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x166)](_0x10ad3f(0x18c))),0x1;let _0x3b07ff,_0x225d15;try{const _0x3eb11a=parseAndClassifyYamlFiles(_0x380562,_0x1158e1,{'skipSegments':_0x3785e5[_0x10ad3f(0x169)]});_0x3b07ff=_0x3eb11a[_0x10ad3f(0x1f1)],_0x225d15=_0x3eb11a[_0x10ad3f(0x1eb)];const _0x2768cb=validateParsedFiles(_0x3eb11a,_0x1158e1);if(_0x2768cb[_0x10ad3f(0x1af)]>0x0)return console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x1b6)](_0x10ad3f(0x1f9))),console[_0x10ad3f(0x1ea)](formatValidationErrors(_0x2768cb)),console[_0x10ad3f(0x1ea)](a52_0x2a49b2['yellow'](_0x10ad3f(0x172))),0x1;}catch(_0x1300b3){return console[_0x10ad3f(0x1ea)](a52_0x2a49b2['red']('Error\x20parsing\x20YAML:\x20'+(_0x1300b3 instanceof Error?_0x1300b3[_0x10ad3f(0x18d)]:_0x1300b3))),0x1;}if(_0x3b07ff['length']===0x0&&_0x225d15[_0x10ad3f(0x1af)]===0x0){const _0x34e409=_0x3785e5[_0x10ad3f(0x169)]?_0x10ad3f(0x1e4):_0x10ad3f(0x182);return console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x184)](_0x10ad3f(0x1cd)+_0x34e409+_0x10ad3f(0x1f6))),0x0;}const _0x591e4b=new Map();_0x31b996[_0x10ad3f(0x1af)]>0x0&&!_0x3785e5[_0x10ad3f(0x169)]&&await withSpinner(_0x10ad3f(0x1e2),async()=>{await batchAsync(_0x31b996,async _0x3c1370=>{const _0x1822a5=a52_0x3a9a,_0x42c3ee=await _0x50eb30[_0x1822a5(0x1b9)][_0x1822a5(0x1b8)](_0x4f45f7,_0x3c1370['id']);_0x591e4b[_0x1822a5(0x1a3)](_0x3c1370['id'],_0x42c3ee);});},{'verbose':_0x3785e5['verbose']});const {segmentFiles:_0x26bcc1,foldersToCreate:_0xed2b54}=await prepareSegmentFiles(_0x3b07ff,{'segmentByFolderAndName':_0x30f950,'activationsBySegmentId':_0x591e4b,'folderPathToId':_0x3d1d91,'idToEmailMap':_0x3b9bb1,'connectionIdToNameMap':_0x448cf5},_0x1de324,_0x513e2c,_0x5068f7),_0x5a8ce5=_0x31b991?[]:findSegmentsToDelete(_0x31b996,_0x3b07ff['map'](({yamlConfig:_0xd3be1d,folderPath:_0x4fc448})=>({'yamlConfig':_0xd3be1d,'folderPath':resolveTDFolderPath(_0x4fc448,_0x513e2c,_0x5068f7)})),_0x11a58d,_0x5068f7,_0x513e2c),{journeyFiles:_0x2d067a,foldersToCreate:_0x58bf4d}=await withProgressSpinner('Preparing\x20journeys...',async _0x1d8446=>prepareJourneyFiles(_0x225d15,{'fetchJourney':async _0x19bb08=>_0x50eb30['journey'][_0x10ad3f(0x1d3)](_0x19bb08[_0x10ad3f(0x174)]),'journeyBundlesByFolderAndName':_0x98c931,'folderPathToId':_0x3d1d91,'idToEmailMap':_0x3b9bb1,'connectionIdToNameMap':_0x448cf5,'existingSegments':_0x31b996,'parentId':_0x4f45f7,'deps':_0x50eb30,'progress':{'update':_0x4e663e=>{const _0x5b4a44=_0x10ad3f;_0x1d8446[_0x5b4a44(0x1c0)](_0x4e663e),_0x3785e5[_0x5b4a44(0x17a)]&&console[_0x5b4a44(0x1ea)]('\x20\x20'+_0x4e663e);}},'journeyById':_0x1a71ad,'activationStepsById':_0x240b3d},_0x513e2c,_0x5068f7),{'verbose':_0x3785e5[_0x10ad3f(0x17a)]})[_0x10ad3f(0x1da)](_0x2f7da9=>_0x2f7da9[_0x10ad3f(0x17e)]);for(const _0x1b096f of _0x58bf4d){_0xed2b54[_0x10ad3f(0x1f4)](_0x1b096f);}const _0x5a6e8d=_0x31b991?[]:findJourneysToDelete(_0x9ed459,_0x225d15[_0x10ad3f(0x16c)](({yamlConfig:_0x543a58,folderPath:_0x4ed563})=>({'yamlConfig':_0x543a58,'folderPath':resolveTDFolderPath(_0x4ed563,_0x513e2c,_0x5068f7)})),_0x11a58d,_0x5068f7,_0x513e2c),_0x61f606=calculatePushStats(_0x26bcc1,_0x2d067a,_0xed2b54,_0x5a8ce5,_0x5a6e8d,!!_0x3785e5[_0x10ad3f(0x191)],!!_0x3785e5['journeysOnly']),_0x1b1031=_0x61f606[_0x10ad3f(0x1f1)][_0x10ad3f(0x1ac)],_0x3ca0f0=_0x61f606[_0x10ad3f(0x1f1)][_0x10ad3f(0x1a4)],_0x5d73ac=_0x61f606['segments'][_0x10ad3f(0x1a2)],_0x525289=_0x61f606[_0x10ad3f(0x1f1)][_0x10ad3f(0x1de)],_0x73d03a=_0x61f606[_0x10ad3f(0x1b3)][_0x10ad3f(0x1b5)],_0x38229a=_0x61f606[_0x10ad3f(0x1eb)][_0x10ad3f(0x1ac)],_0x55d8a6=_0x61f606[_0x10ad3f(0x1eb)]['changed'],_0x5480a0=_0x61f606[_0x10ad3f(0x1eb)][_0x10ad3f(0x1a2)],_0x43a63c=_0x61f606[_0x10ad3f(0x1eb)][_0x10ad3f(0x1de)],_0x297375=_0x61f606[_0x10ad3f(0x19e)][_0x10ad3f(0x1db)],_0x3c5614=_0x61f606[_0x10ad3f(0x19e)][_0x10ad3f(0x1b5)],_0x2a6fac=_0x61f606[_0x10ad3f(0x19e)][_0x10ad3f(0x17c)],_0x19b3e6=_0x61f606[_0x10ad3f(0x19e)]['toDelete'];console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1fb)+_0x15c402+'\x27:');_0x73d03a[_0x10ad3f(0x1af)]>0x0&&console[_0x10ad3f(0x1ea)]('\x20\x20'+a52_0x2a49b2[_0x10ad3f(0x1f0)]('📁\x20'+_0x73d03a[_0x10ad3f(0x1af)]+'\x20folders\x20to\x20create'));if(!_0x3785e5[_0x10ad3f(0x169)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1d9)+a52_0x2a49b2[_0x10ad3f(0x1dd)]('+\x20'+_0x1b1031['length']+_0x10ad3f(0x1c6))),console['error'](_0x10ad3f(0x1d9)+a52_0x2a49b2[_0x10ad3f(0x184)]('~\x20'+_0x3ca0f0[_0x10ad3f(0x1af)]+_0x10ad3f(0x1be)));if(_0x525289['length']>0x0)console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1d9)+a52_0x2a49b2[_0x10ad3f(0x1b6)]('-\x20'+_0x525289[_0x10ad3f(0x1af)]+_0x10ad3f(0x18e)));else _0x5a8ce5[_0x10ad3f(0x1af)]>0x0&&!_0x3785e5['delete']&&console['error'](_0x10ad3f(0x1d9)+a52_0x2a49b2[_0x10ad3f(0x1e9)](_0x5a8ce5['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1d9)+a52_0x2a49b2[_0x10ad3f(0x1e9)]('=\x20'+_0x5d73ac['length']+_0x10ad3f(0x1b1)));}if(_0x2d067a[_0x10ad3f(0x1af)]>0x0||_0x5a6e8d[_0x10ad3f(0x1af)]>0x0){console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1f5)),console['error'](_0x10ad3f(0x1d9)+a52_0x2a49b2[_0x10ad3f(0x1dd)]('+\x20'+_0x38229a['length']+'\x20new')),console['error']('\x20\x20\x20\x20'+a52_0x2a49b2['yellow']('~\x20'+_0x55d8a6[_0x10ad3f(0x1af)]+'\x20changed'));if(_0x43a63c[_0x10ad3f(0x1af)]>0x0)console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1d9)+a52_0x2a49b2['red']('-\x20'+_0x43a63c[_0x10ad3f(0x1af)]+_0x10ad3f(0x18e)));else _0x5a6e8d[_0x10ad3f(0x1af)]>0x0&&!_0x3785e5['delete']&&console['error']('\x20\x20\x20\x20'+a52_0x2a49b2[_0x10ad3f(0x1e9)](_0x5a6e8d[_0x10ad3f(0x1af)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1d9)+a52_0x2a49b2[_0x10ad3f(0x1e9)]('=\x20'+_0x5480a0[_0x10ad3f(0x1af)]+'\x20unchanged'));}_0x297375[_0x10ad3f(0x1af)]>0x0&&!_0x3785e5[_0x10ad3f(0x169)]&&(console[_0x10ad3f(0x1ea)](''),console['error'](_0x10ad3f(0x1a0)),_0x3c5614[_0x10ad3f(0x1af)]>0x0&&console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1d9)+a52_0x2a49b2[_0x10ad3f(0x1dd)]('+\x20'+_0x3c5614[_0x10ad3f(0x1af)]+_0x10ad3f(0x17d))),_0x2a6fac['length']>0x0&&console[_0x10ad3f(0x1ea)]('\x20\x20\x20\x20'+a52_0x2a49b2[_0x10ad3f(0x184)]('~\x20'+_0x2a6fac[_0x10ad3f(0x1af)]+_0x10ad3f(0x1b4))),_0x19b3e6[_0x10ad3f(0x1af)]>0x0&&console['error']('\x20\x20\x20\x20'+a52_0x2a49b2['red']('-\x20'+_0x19b3e6[_0x10ad3f(0x1af)]+_0x10ad3f(0x18e))));console[_0x10ad3f(0x1ea)](_0x10ad3f(0x186)+a52_0x2a49b2[_0x10ad3f(0x166)](_0x1158e1)+'\x0a');if(_0x73d03a[_0x10ad3f(0x1af)]>0x0){console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1bb));for(const _0x537d1e of _0x73d03a){console[_0x10ad3f(0x1ea)]('\x20\x20'+a52_0x2a49b2[_0x10ad3f(0x1f0)]('+')+'\x20'+_0x537d1e);}console[_0x10ad3f(0x1ea)]('');}if(_0x1b1031[_0x10ad3f(0x1af)]>0x0&&!_0x3785e5['journeysOnly'])for(const _0xb22185 of _0x1b1031){const _0x17ad2e=_0xb22185['folderPath']?_0xb22185[_0x10ad3f(0x197)]+'/'+_0xb22185[_0x10ad3f(0x1f3)][_0x10ad3f(0x187)]:_0xb22185['yamlConfig'][_0x10ad3f(0x187)],_0x3110d2=_0xb22185[_0x10ad3f(0x1f3)][_0x10ad3f(0x19e)]?.['length']||0x0,_0x15ab58=_0x3110d2>0x0?a52_0x2a49b2[_0x10ad3f(0x1e9)]('\x20['+_0x3110d2+_0x10ad3f(0x18f)):'';console[_0x10ad3f(0x1ea)]('\x0a'+a52_0x2a49b2[_0x10ad3f(0x1dd)](_0x10ad3f(0x190))+'\x20'+_0x17ad2e+_0x15ab58),console[_0x10ad3f(0x1ea)]('─'['repeat'](0x3c)),_0xb22185[_0x10ad3f(0x1d2)]&&console[_0x10ad3f(0x1ea)](_0xb22185['diff']),console[_0x10ad3f(0x1ea)]('─'['repeat'](0x3c));}if(_0x525289[_0x10ad3f(0x1af)]>0x0&&!_0x3785e5[_0x10ad3f(0x169)])for(const _0x24ca19 of _0x525289){const _0x4740e7=_0x24ca19[_0x10ad3f(0x16d)]?_0x11a58d[_0x10ad3f(0x19b)](_0x24ca19[_0x10ad3f(0x16d)][_0x10ad3f(0x1a5)]())||'':'',_0x2140e1=_0x4740e7?_0x4740e7+'/'+_0x24ca19[_0x10ad3f(0x187)]:_0x24ca19[_0x10ad3f(0x187)],_0x48cd06=_0x591e4b[_0x10ad3f(0x19b)](_0x24ca19['id'])||[],_0x37503c=_0x48cd06[_0x10ad3f(0x1af)]>0x0?a52_0x2a49b2[_0x10ad3f(0x1e9)]('\x20['+_0x48cd06[_0x10ad3f(0x1af)]+'\x20activations]'):'';console[_0x10ad3f(0x1ea)]('\x0a'+a52_0x2a49b2['red'](_0x10ad3f(0x1f7))+'\x20'+_0x2140e1+_0x37503c),console['error']('─'[_0x10ad3f(0x185)](0x3c));const _0xdced74=segmentWithActivationsToYaml(_0x24ca19,_0x48cd06,undefined,_0x3b9bb1,_0x448cf5),_0x4c7473=segmentToYamlString(_0xdced74),_0x20ae00=generateDiff(_0x4c7473,'');console['error'](formatDiffWithColors(_0x20ae00)),console[_0x10ad3f(0x1ea)]('─'[_0x10ad3f(0x185)](0x3c));}const _0x41281a=_0x26bcc1[_0x10ad3f(0x1e3)](_0x295942=>!_0x295942['isNew']&&_0x295942[_0x10ad3f(0x1d2)]);if(_0x41281a[_0x10ad3f(0x1af)]>0x0&&!_0x3785e5[_0x10ad3f(0x169)])for(const _0x17781d of _0x41281a){const _0x2ee388=_0x17781d['folderPath']?_0x17781d[_0x10ad3f(0x197)]+'/'+_0x17781d[_0x10ad3f(0x1f3)]['name']:_0x17781d[_0x10ad3f(0x1f3)][_0x10ad3f(0x187)];console[_0x10ad3f(0x1ea)]('\x0a'+a52_0x2a49b2[_0x10ad3f(0x184)]('Changes\x20to:')+'\x20'+_0x2ee388),console[_0x10ad3f(0x1ea)]('─'[_0x10ad3f(0x185)](0x3c)),console[_0x10ad3f(0x1ea)](_0x17781d[_0x10ad3f(0x1d2)]),console[_0x10ad3f(0x1ea)]('─'[_0x10ad3f(0x185)](0x3c));}if(_0x38229a[_0x10ad3f(0x1af)]>0x0)for(const _0x210c64 of _0x38229a){const _0x5eb7d9=_0x210c64[_0x10ad3f(0x197)]?_0x210c64[_0x10ad3f(0x197)]+'/'+_0x210c64[_0x10ad3f(0x1f3)][_0x10ad3f(0x187)]:_0x210c64[_0x10ad3f(0x1f3)]['name'];console[_0x10ad3f(0x1ea)]('\x0a'+a52_0x2a49b2[_0x10ad3f(0x1dd)](_0x10ad3f(0x1ce))+'\x20'+_0x5eb7d9),console[_0x10ad3f(0x1ea)]('─'[_0x10ad3f(0x185)](0x3c)),_0x210c64[_0x10ad3f(0x1d2)]&&console['error'](_0x210c64[_0x10ad3f(0x1d2)]),console['error']('─'['repeat'](0x3c));}const _0x3e7065=_0x2d067a[_0x10ad3f(0x1e3)](_0x2fe984=>!_0x2fe984['isNew']&&_0x2fe984[_0x10ad3f(0x1d2)]);if(_0x3e7065['length']>0x0)for(const _0x46d03a of _0x3e7065){const _0x5794d8=_0x46d03a[_0x10ad3f(0x197)]?_0x46d03a[_0x10ad3f(0x197)]+'/'+_0x46d03a[_0x10ad3f(0x1f3)]['name']:_0x46d03a['yamlConfig'][_0x10ad3f(0x187)];console[_0x10ad3f(0x1ea)]('\x0a'+a52_0x2a49b2[_0x10ad3f(0x184)](_0x10ad3f(0x162))+'\x20'+_0x5794d8),console[_0x10ad3f(0x1ea)]('─'[_0x10ad3f(0x185)](0x3c)),console[_0x10ad3f(0x1ea)](_0x46d03a[_0x10ad3f(0x1d2)]),console[_0x10ad3f(0x1ea)]('─'[_0x10ad3f(0x185)](0x3c));}if(_0x43a63c[_0x10ad3f(0x1af)]>0x0)for(const _0x523b9d of _0x43a63c){const _0x4b18a1=_0x523b9d[_0x10ad3f(0x170)]?_0x11a58d['get'](_0x523b9d[_0x10ad3f(0x170)])||'':'',_0x18da1d=_0x4b18a1?_0x4b18a1+'/'+_0x523b9d[_0x10ad3f(0x1e5)]:_0x523b9d[_0x10ad3f(0x1e5)];console[_0x10ad3f(0x1ea)]('\x0a'+a52_0x2a49b2[_0x10ad3f(0x1b6)]('Delete\x20journey:')+'\x20'+_0x18da1d),console[_0x10ad3f(0x1ea)]('─'['repeat'](0x3c)),console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x1b6)](_0x10ad3f(0x1e8))),console[_0x10ad3f(0x1ea)]('─'[_0x10ad3f(0x185)](0x3c));}if(_0x3785e5[_0x10ad3f(0x1bd)])return console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x184)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x2108d1=_0x3785e5[_0x10ad3f(0x169)]?![]:_0x1b1031['length']>0x0||_0x3ca0f0[_0x10ad3f(0x1af)]>0x0||_0x525289['length']>0x0,_0x283027=_0x38229a[_0x10ad3f(0x1af)]>0x0||_0x55d8a6[_0x10ad3f(0x1af)]>0x0||_0x43a63c[_0x10ad3f(0x1af)]>0x0,_0x4d3082=_0x3785e5[_0x10ad3f(0x169)]?![]:_0x297375[_0x10ad3f(0x1af)]>0x0,_0x167ec8=_0x73d03a[_0x10ad3f(0x1af)]>0x0;if(!_0x2108d1&&!_0x283027&&!_0x4d3082&&!_0x167ec8){const _0x20b8bc=_0x3785e5['journeysOnly']?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a52_0x2a49b2['green'](_0x20b8bc));if(_0x31b991&&_0x5d73ac[_0x10ad3f(0x1af)]===0x1){const _0x54f60a=_0x5d73ac[0x0];if(_0x54f60a['existingSegment']?.['id']){const _0x392be0=getConsoleNextUrl(_0x3785e5[_0x10ad3f(0x1cc)],_0x10ad3f(0x1d1)+_0x4f45f7+'/e/'+_0x54f60a['existingSegment']['id']+_0x10ad3f(0x1ef));console['error'](_0x10ad3f(0x1c4)+a52_0x2a49b2[_0x10ad3f(0x166)](_0x392be0));}}if(_0x31b991&&_0x5480a0[_0x10ad3f(0x1af)]===0x1){const _0x41f5f1=_0x5480a0[0x0];if(_0x41f5f1['existingJourney']?.['id']){const _0xc01261=getConsoleNextUrl(_0x3785e5[_0x10ad3f(0x1cc)],_0x10ad3f(0x1d1)+_0x4f45f7+_0x10ad3f(0x189)+_0x41f5f1[_0x10ad3f(0x1a9)]['id']+_0x10ad3f(0x1a8));console['error']('\x20\x20'+a52_0x2a49b2['cyan'](_0xc01261));}}return 0x0;}const _0x48e7f1=_0x3785e5['journeysOnly']?_0x38229a[_0x10ad3f(0x1af)]+_0x55d8a6[_0x10ad3f(0x1af)]+_0x43a63c[_0x10ad3f(0x1af)]+_0x73d03a['length']:_0x1b1031[_0x10ad3f(0x1af)]+_0x3ca0f0['length']+_0x525289[_0x10ad3f(0x1af)]+_0x38229a['length']+_0x55d8a6[_0x10ad3f(0x1af)]+_0x43a63c['length']+_0x73d03a[_0x10ad3f(0x1af)]+_0x297375[_0x10ad3f(0x1af)];if(!_0x3785e5[_0x10ad3f(0x16e)]&&_0x48e7f1>0x0){if(!isInteractive())return console[_0x10ad3f(0x1ea)](a52_0x2a49b2['red'](_0x10ad3f(0x181)),_0x10ad3f(0x1cb)),console['error'](a52_0x2a49b2[_0x10ad3f(0x1e9)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x14e64a=await confirmKey(_0x10ad3f(0x17f)+_0x48e7f1+_0x10ad3f(0x1ad));if(!_0x14e64a)return console['error'](a52_0x2a49b2['yellow']('Aborted.')),0x1;}const _0x5ae591={'withProgress':async(_0x580dd6,_0x3eb6f9)=>{const _0x5578a0=_0x10ad3f,_0x4aeed9=await withSpinner(_0x580dd6,_0x3eb6f9,{'verbose':_0x3785e5['verbose']});return{'data':_0x4aeed9[_0x5578a0(0x17e)]};},'logInfo':_0x30f433=>console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x1f0)]('✔\x20'+_0x30f433)),'logSuccess':_0x5babf2=>console[_0x10ad3f(0x1ea)](a52_0x2a49b2['green']('✔\x20'+_0x5babf2)),'logWarning':_0x292a72=>console[_0x10ad3f(0x1ea)](a52_0x2a49b2['yellow']('⚠\x20'+_0x292a72)),'logDeleted':_0x544e38=>console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x1b6)]('✔\x20'+_0x544e38))},_0xc9edd5={'segment':_0x50eb30[_0x10ad3f(0x1b9)],'journey':_0x50eb30[_0x10ad3f(0x1e4)],'user':_0x50eb30[_0x10ad3f(0x195)],'connection':_0x50eb30['connection']};_0x73d03a['length']>0x0&&(_0x3d1d91=await executePushFolders(_0xc9edd5,_0x73d03a,_0x3d1d91,{'parentId':_0x4f45f7},_0x5ae591));const _0x223d7d={'rootFolderId':_0x5ddff0,'folderPathToId':_0x3d1d91,'folderIdToPath':_0x11a58d,'segmentNameToId':_0x52d82a,'activationsBySegmentId':_0x591e4b,'emailToIdMap':_0x428511,'idToEmailMap':_0x3b9bb1,'connectionNameToIdMap':_0x116e67['nameToId'],'connectionIdToNameMap':_0x116e67['idToName'],'connectionNameToTypeMap':_0x2b2c03},_0x56c1a9=await executePushSegments(_0xc9edd5,_0x3785e5[_0x10ad3f(0x169)]?[]:_0x26bcc1,_0x223d7d,{'parentId':_0x4f45f7},_0x5ae591),_0x265f14=_0x56c1a9[_0x10ad3f(0x177)],_0x392f5c=_0x56c1a9[_0x10ad3f(0x1d4)],_0x1ee8c1=_0x56c1a9['activations'][_0x10ad3f(0x177)],_0x1cea82=_0x56c1a9['activations'][_0x10ad3f(0x1d4)],_0x5554ea=_0x56c1a9['activations'][_0x10ad3f(0x1df)];let _0x41cdcc;if(_0x31b991&&_0x26bcc1['length']===0x1){const _0x4ac29f=_0x26bcc1[0x0];_0x41cdcc=_0x4ac29f[_0x10ad3f(0x180)]?.['id']??_0x56c1a9[_0x10ad3f(0x1ec)]['get'](_0x4ac29f['yamlConfig']['name']);}const _0x6eedaf=await executePushSegmentDeletions(_0xc9edd5,_0x3785e5[_0x10ad3f(0x169)]?[]:_0x525289,_0x5ae591);let _0x42a059=0x0,_0x4bf053=0x0,_0x51a765=0x0;const _0x49f599=new Map(_0x52d82a);for(const [_0x1f7dcf,_0x66aa41]of _0x56c1a9[_0x10ad3f(0x1ec)]){_0x49f599[_0x10ad3f(0x1a3)](_0x1f7dcf,_0x66aa41);}if(_0x2d067a[_0x10ad3f(0x1af)]>0x0){const _0x3eaf04={..._0x223d7d,'segmentNameToId':_0x49f599,'existingSegments':_0x31b996,'activationContext':_0x1de324},_0x38cb54=await executePushJourneys(_0xc9edd5,_0x2d067a,_0x3eaf04,{'parentId':_0x4f45f7,'rootFolderId':_0x5ddff0,'verbose':_0x3785e5['verbose']},_0x5ae591);_0x42a059=_0x38cb54[_0x10ad3f(0x177)],_0x4bf053=_0x38cb54[_0x10ad3f(0x1d4)];if(_0x31b991&&_0x38cb54[_0x10ad3f(0x1d5)][_0x10ad3f(0x1af)]===0x1){const _0x6ca844=_0x38cb54[_0x10ad3f(0x1d5)][0x0];if(_0x6ca844[_0x10ad3f(0x174)]){const _0x3d44aa=getConsoleNextUrl(_0x3785e5[_0x10ad3f(0x1cc)],_0x10ad3f(0x1d1)+_0x4f45f7+_0x10ad3f(0x189)+_0x6ca844['journeyId']+_0x10ad3f(0x1a8));console[_0x10ad3f(0x1ea)]('\x20\x20'+a52_0x2a49b2['cyan'](_0x3d44aa));}}}for(const _0x20e6ab of _0x43a63c){console[_0x10ad3f(0x1ea)](a52_0x2a49b2['yellow'](_0x10ad3f(0x1f2)+_0x20e6ab[_0x10ad3f(0x1e5)])),_0x51a765++;}const _0x2c2693=[];if(_0x265f14>0x0)_0x2c2693[_0x10ad3f(0x1ae)](_0x265f14+_0x10ad3f(0x1a6));if(_0x392f5c>0x0)_0x2c2693[_0x10ad3f(0x1ae)](_0x392f5c+_0x10ad3f(0x16a));if(_0x6eedaf>0x0)_0x2c2693[_0x10ad3f(0x1ae)](_0x6eedaf+_0x10ad3f(0x19f));const _0x3b2454=[];if(_0x42a059>0x0)_0x3b2454[_0x10ad3f(0x1ae)](_0x42a059+'\x20created');if(_0x4bf053>0x0)_0x3b2454['push'](_0x4bf053+_0x10ad3f(0x16a));if(_0x51a765>0x0)_0x3b2454['push'](_0x51a765+_0x10ad3f(0x19f));const _0x236013=[];if(_0x1ee8c1>0x0)_0x236013[_0x10ad3f(0x1ae)](_0x1ee8c1+_0x10ad3f(0x1a6));if(_0x1cea82>0x0)_0x236013[_0x10ad3f(0x1ae)](_0x1cea82+_0x10ad3f(0x16a));if(_0x5554ea>0x0)_0x236013[_0x10ad3f(0x1ae)](_0x5554ea+_0x10ad3f(0x19f));console[_0x10ad3f(0x1ea)](a52_0x2a49b2[_0x10ad3f(0x1dd)](_0x10ad3f(0x188)));_0x2c2693[_0x10ad3f(0x1af)]>0x0&&!_0x3785e5[_0x10ad3f(0x169)]&&console[_0x10ad3f(0x1ea)](_0x10ad3f(0x16f)+_0x2c2693[_0x10ad3f(0x19d)](',\x20'));_0x3b2454['length']>0x0&&console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1e7)+_0x3b2454[_0x10ad3f(0x19d)](',\x20'));_0x236013['length']>0x0&&!_0x3785e5[_0x10ad3f(0x169)]&&console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1fa)+_0x236013[_0x10ad3f(0x19d)](',\x20'));if(_0x41cdcc){const _0x1ed07f=getConsoleNextUrl(_0x3785e5[_0x10ad3f(0x1cc)],_0x10ad3f(0x1d1)+_0x4f45f7+_0x10ad3f(0x189)+_0x41cdcc+'/sb/da/esr');console[_0x10ad3f(0x1ea)](_0x10ad3f(0x1c4)+a52_0x2a49b2['cyan'](_0x1ed07f));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a53_0x5484f0=a53_0x2f2c;(function(_0x5aff2e,_0x139bb4){const _0x334262=a53_0x2f2c,_0x2c4266=_0x5aff2e();while(!![]){try{const _0x51dafe=parseInt(_0x334262(0x17c))/0x1*(-parseInt(_0x334262(0x177))/0x2)+-parseInt(_0x334262(0x15d))/0x3*(-parseInt(_0x334262(0x151))/0x4)+-parseInt(_0x334262(0x16d))/0x5*(parseInt(_0x334262(0x160))/0x6)+parseInt(_0x334262(0x16b))/0x7*(parseInt(_0x334262(0x159))/0x8)+-parseInt(_0x334262(0x15e))/0x9+-parseInt(_0x334262(0x16c))/0xa+-parseInt(_0x334262(0x15a))/0xb*(-parseInt(_0x334262(0x166))/0xc);if(_0x51dafe===_0x139bb4)break;else _0x2c4266['push'](_0x2c4266['shift']());}catch(_0x13f564){_0x2c4266['push'](_0x2c4266['shift']());}}}(a53_0x53a4,0x63f19));function a53_0x53a4(){const _0x249a93=['✔\x20Updated\x20segment\x20\x27','type','segmentPath','parentId','356856zufsYW','verbose','data','Resolved\x20type:\x20','description','4235FaAvsL','8123260QFYSFI','228255hsHGSz','\x20\x20\x20Path:\x20','segmentName','name','kind','segment:update','Parent\x20ID:\x20','Examples:','error','resolvePathToResource','14928vNBviQ','length','execute','Segment\x20ID\x20missing\x20from\x20resolved\x20path','segment','60CUwRiE','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','rule','4GuPKbW','Error:\x20Cannot\x20update\x20','folder','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Resolved\x20relative\x20path\x20to:\x20','segmentId','updateSegmentById','10504cBMoJE','220skgZup','Update\x20existing\x20child\x20segment','Resolving\x20folder\x20\x27','1594614wirvGz','205857GbyfFm','yellow','30cLZOqI','\x27...'];a53_0x53a4=function(){return _0x249a93;};return a53_0x53a4();}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 a53_0x11716e from'chalk';function a53_0x2f2c(_0x43363f,_0x736a13){_0x43363f=_0x43363f-0x14e;const _0x53a4c7=a53_0x53a4();let _0x2f2c6b=_0x53a4c7[_0x43363f];return _0x2f2c6b;}export class SegmentUpdateCommand extends BaseCommand{[a53_0x5484f0(0x170)]=a53_0x5484f0(0x172);[a53_0x5484f0(0x16a)]=a53_0x5484f0(0x15b);async[a53_0x5484f0(0x179)](_0x1dd555){const _0x522c94=a53_0x5484f0;console[_0x522c94(0x175)](a53_0x11716e[_0x522c94(0x15f)]('⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.')),console[_0x522c94(0x175)](a53_0x11716e[_0x522c94(0x15f)](_0x522c94(0x155)));const {options:_0x3686c3,args:_0x760a26,tdx:_0x4d48d9}=_0x1dd555,_0x3a4428=_0x3686c3;if(_0x760a26[_0x522c94(0x178)]===0x0)return console[_0x522c94(0x175)](_0x522c94(0x14f)),console[_0x522c94(0x175)](_0x522c94(0x154)),console[_0x522c94(0x175)](_0x522c94(0x174)),console[_0x522c94(0x175)]('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x522c94(0x175)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x1142b5=_0x760a26[0x0],_0x4a2785=_0x3686c3[_0x522c94(0x164)];let _0x18a699=_0x1142b5;_0x4a2785&&!_0x1142b5['includes']('/')&&(_0x18a699=_0x4a2785+'/'+_0x1142b5,_0x3a4428[_0x522c94(0x167)]&&console[_0x522c94(0x175)](_0x522c94(0x156)+_0x18a699));const _0x34b8e8=await withSpinner('Resolving\x20path\x20\x27'+_0x18a699+_0x522c94(0x161),()=>_0x4d48d9[_0x522c94(0x17b)][_0x522c94(0x176)](_0x18a699),{'verbose':_0x3a4428[_0x522c94(0x167)]}),_0x4a73de=_0x34b8e8[_0x522c94(0x168)];_0x3a4428[_0x522c94(0x167)]&&console['error'](_0x522c94(0x169)+_0x4a73de[_0x522c94(0x163)]);if(_0x4a73de['type']!==_0x522c94(0x17b))return console[_0x522c94(0x175)](_0x522c94(0x152)+_0x4a73de[_0x522c94(0x163)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0x522c94(0x14e)),0x1;if(!_0x4a73de[_0x522c94(0x157)])throw new SDKError(ErrorCode['INTERNAL'],_0x522c94(0x17a));const _0x383bfd=_0x4a73de[_0x522c94(0x165)],_0x3cb82a=_0x4a73de[_0x522c94(0x157)];_0x3a4428['verbose']&&(console['error'](_0x522c94(0x173)+_0x383bfd),console[_0x522c94(0x175)]('Segment\x20ID:\x20'+_0x3cb82a));let _0x4c18c2;if(_0x3a4428[_0x522c94(0x153)]){const _0x49efae=_0x3a4428[_0x522c94(0x153)],_0x42056c=await withSpinner(_0x522c94(0x15c)+_0x49efae+_0x522c94(0x161),()=>_0x4d48d9['segment']['resolveFolderId'](_0x383bfd,_0x49efae),{'verbose':_0x3a4428[_0x522c94(0x167)]});_0x4c18c2=parseInt(_0x42056c['data'],0xa),_0x3a4428[_0x522c94(0x167)]&&console[_0x522c94(0x175)]('Resolved\x20folder\x20ID:\x20'+_0x4c18c2);}const _0x36d424=await loadJSONFromOptions(_0x3a4428[_0x522c94(0x150)],_0x3a4428['ruleFile']),_0x5b871c={'name':_0x3a4428[_0x522c94(0x170)],'description':_0x3a4428[_0x522c94(0x16a)],'rule':_0x36d424,'kind':_0x3a4428[_0x522c94(0x171)]!==undefined?parseInt(_0x3a4428[_0x522c94(0x171)],0xa):undefined,'segmentFolderId':_0x4c18c2},_0x584918=await withSpinner('Updating\x20segment\x20\x27'+_0x4a73de[_0x522c94(0x16f)]+_0x522c94(0x161),()=>_0x4d48d9[_0x522c94(0x17b)][_0x522c94(0x158)](_0x383bfd,_0x3cb82a,_0x5b871c),{'verbose':_0x3a4428[_0x522c94(0x167)]}),_0x5bc03f=_0x584918[_0x522c94(0x168)];return console[_0x522c94(0x175)](_0x522c94(0x162)+_0x5bc03f[_0x522c94(0x170)]+'\x27'),_0x18a699!==_0x1142b5&&console[_0x522c94(0x175)](_0x522c94(0x16e)+_0x18a699),await handleSDKOutput([_0x5bc03f],_0x3a4428),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a54_0x552fe8=a54_0x52f9;(function(_0x3b50ab,_0x3288a4){const _0xbaa521=a54_0x52f9,_0x1f45d2=_0x3b50ab();while(!![]){try{const _0x482b1c=parseInt(_0xbaa521(0x17b))/0x1+-parseInt(_0xbaa521(0x189))/0x2+-parseInt(_0xbaa521(0x163))/0x3+-parseInt(_0xbaa521(0x18a))/0x4*(parseInt(_0xbaa521(0x17a))/0x5)+-parseInt(_0xbaa521(0x169))/0x6+-parseInt(_0xbaa521(0x17e))/0x7+parseInt(_0xbaa521(0x160))/0x8;if(_0x482b1c===_0x3288a4)break;else _0x1f45d2['push'](_0x1f45d2['shift']());}catch(_0x2ff228){_0x1f45d2['push'](_0x1f45d2['shift']());}}}(a54_0x3afe,0x9aaa4));import{existsSync,statSync}from'fs';import a54_0x33c13f from'chalk';import{BaseCommand}from'./command.js';function a54_0x52f9(_0x1b82dd,_0xc38f4d){_0x1b82dd=_0x1b82dd-0x157;const _0x3afeb2=a54_0x3afe();let _0x52f914=_0x3afeb2[_0x1b82dd];return _0x52f914;}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a54_0x3afe(){const _0x260e35=['Parent\x20ID:\x20','27671352KyPoTc','segments','✔\x20Context\x20set\x20to:\x20','1293546ztJQHH','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','folderPath','verbose','session','1559670AJCaRp','site','slice','name','cyan','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','parentName','dim','log','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Folder\x20ID:\x20','length','isDirectory','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','error','5JFNqXj','158091siNzpL','fullPath','segment','5570194MHhHju','Usage:\x20tdx\x20segment\x20use\x20<path>','folderId','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','type','Use:\x20tdx\x20segment\x20use\x20','green','Site:\x20','Error:\x20Path\x20is\x20required\x0a','Resolving\x20path\x20\x27','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','2038050KjTPdP','1910432gsrqPE','red','join','isAbsolute','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','split','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Resolved\x20relative\x20path\x20to:\x20','Target\x20path:\x20','data','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'];a54_0x3afe=function(){return _0x260e35;};return a54_0x3afe();}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a54_0x552fe8(0x16c)]='segment:use';['description']=a54_0x552fe8(0x170);async['execute'](_0x4544e1){const _0x15ce3e=a54_0x552fe8,{options:_0x3f613d,args:_0x329098,tdx:_0x44794c}=_0x4544e1;if(_0x329098['length']===0x0)return console[_0x15ce3e(0x179)](a54_0x33c13f[_0x15ce3e(0x18b)](_0x15ce3e(0x186))),console['error'](_0x15ce3e(0x17f)),console['error']('Examples:'),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0x15ce3e(0x179)](_0x15ce3e(0x178)),console['error'](_0x15ce3e(0x16f)),console[_0x15ce3e(0x179)](_0x15ce3e(0x15e)),0x1;const _0x2121f1=_0x329098[0x0],_0x445bfb=_0x3f613d[_0x15ce3e(0x168)];try{if(_0x2121f1==='/')return saveSessionContext({'segment_path':undefined},_0x445bfb),console['log'](a54_0x33c13f[_0x15ce3e(0x184)](_0x15ce3e(0x158))),0x0;if(existsSync(_0x2121f1)&&statSync(_0x2121f1)[_0x15ce3e(0x177)]()){let _0x2c8255;try{_0x2c8255=findTdxConfig(_0x2121f1);}catch{return console[_0x15ce3e(0x179)](a54_0x33c13f[_0x15ce3e(0x18b)](_0x15ce3e(0x16e)+_0x2121f1)),console[_0x15ce3e(0x179)](a54_0x33c13f[_0x15ce3e(0x16d)](_0x15ce3e(0x188))),0x1;}const _0x4a1000=_0x2c8255['config']['parent_segment'];return saveSessionContext({'segment_path':_0x4a1000,'parent_segment':_0x4a1000},_0x445bfb),console[_0x15ce3e(0x173)](a54_0x33c13f[_0x15ce3e(0x184)](_0x15ce3e(0x162)+a54_0x33c13f[_0x15ce3e(0x16d)](_0x4a1000))),0x0;}const _0x1a85bd=_0x3f613d['segmentPath'];let _0x30e821=_0x2121f1;const _0x3ff4f4=parsePath(_0x2121f1);if(!_0x3ff4f4[_0x15ce3e(0x157)]){if(!_0x1a85bd)return console[_0x15ce3e(0x179)](a54_0x33c13f[_0x15ce3e(0x18b)](_0x15ce3e(0x181))),console['error'](a54_0x33c13f[_0x15ce3e(0x16d)](_0x15ce3e(0x174))),0x1;if(_0x2121f1==='..'){const _0x2b16fb=_0x1a85bd[_0x15ce3e(0x159)]('/')[_0x15ce3e(0x16b)](0x0,-0x1)[_0x15ce3e(0x18c)]('/');_0x30e821=_0x2b16fb||'/';}else _0x2121f1==='.'?_0x30e821=_0x1a85bd:_0x30e821=_0x1a85bd+'/'+_0x2121f1;_0x3f613d['verbose']&&console[_0x15ce3e(0x179)](_0x15ce3e(0x15b)+_0x30e821);}if(_0x30e821==='/'||_0x30e821==='')return saveSessionContext({'segment_path':undefined},_0x445bfb),console[_0x15ce3e(0x173)](a54_0x33c13f[_0x15ce3e(0x184)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x30e821=normalizePath(_0x30e821);const _0x493ddd=parsePath(_0x30e821)[_0x15ce3e(0x161)];if(_0x493ddd[_0x15ce3e(0x176)]===0x0)return saveSessionContext({'segment_path':undefined},_0x445bfb),console[_0x15ce3e(0x173)](a54_0x33c13f['green'](_0x15ce3e(0x158))),0x0;_0x3f613d[_0x15ce3e(0x167)]&&(console[_0x15ce3e(0x179)](_0x15ce3e(0x185)+_0x3f613d[_0x15ce3e(0x16a)]),console['error'](_0x15ce3e(0x15c)+_0x30e821));const _0x5ca1c2=await withSpinner(_0x15ce3e(0x187)+_0x30e821+'\x27...',()=>_0x44794c[_0x15ce3e(0x17d)]['resolvePathToResource'](_0x30e821),{'verbose':_0x3f613d['verbose']}),_0x5840f9=_0x5ca1c2[_0x15ce3e(0x15d)];_0x3f613d['verbose']&&(console[_0x15ce3e(0x179)]('Resolved\x20path\x20type:\x20'+_0x5840f9[_0x15ce3e(0x182)]),console[_0x15ce3e(0x179)](_0x15ce3e(0x15f)+_0x5840f9['parentId']),_0x5840f9[_0x15ce3e(0x180)]&&console[_0x15ce3e(0x179)](_0x15ce3e(0x175)+_0x5840f9[_0x15ce3e(0x180)]));if(_0x5840f9[_0x15ce3e(0x182)]==='segment')return console['error'](a54_0x33c13f['red'](_0x15ce3e(0x164))),console[_0x15ce3e(0x179)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error'](a54_0x33c13f['cyan'](_0x15ce3e(0x183)+_0x5840f9['parentName']+(_0x5840f9['folderPath']?'/'+_0x5840f9[_0x15ce3e(0x166)][_0x15ce3e(0x18c)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x5840f9[_0x15ce3e(0x17c)],'parent_segment':_0x5840f9[_0x15ce3e(0x171)]},_0x445bfb),console[_0x15ce3e(0x173)](a54_0x33c13f[_0x15ce3e(0x184)](_0x15ce3e(0x162)+a54_0x33c13f[_0x15ce3e(0x16d)](_0x5840f9[_0x15ce3e(0x17c)]))),_0x3f613d[_0x15ce3e(0x167)]&&(console['error'](a54_0x33c13f['dim'](_0x15ce3e(0x15a))),console[_0x15ce3e(0x179)](a54_0x33c13f[_0x15ce3e(0x172)](_0x15ce3e(0x165)))),0x0;}catch(_0x3b9341){throw _0x3b9341;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a55_0x526e(_0x5a4c3b,_0x35826e){_0x5a4c3b=_0x5a4c3b-0x19c;const _0x47b0d0=a55_0x47b0();let _0x526e01=_0x47b0d0[_0x5a4c3b];return _0x526e01;}const a55_0x161f71=a55_0x526e;(function(_0x122f21,_0x3a6e96){const _0x26afad=a55_0x526e,_0x1e0fe4=_0x122f21();while(!![]){try{const _0x1f6e96=parseInt(_0x26afad(0x1cc))/0x1*(-parseInt(_0x26afad(0x1aa))/0x2)+-parseInt(_0x26afad(0x1cd))/0x3+-parseInt(_0x26afad(0x1ca))/0x4+-parseInt(_0x26afad(0x1c3))/0x5*(parseInt(_0x26afad(0x1b7))/0x6)+-parseInt(_0x26afad(0x1a2))/0x7+parseInt(_0x26afad(0x1ac))/0x8*(parseInt(_0x26afad(0x1b9))/0x9)+parseInt(_0x26afad(0x1a0))/0xa*(parseInt(_0x26afad(0x1a9))/0xb);if(_0x1f6e96===_0x3a6e96)break;else _0x1e0fe4['push'](_0x1e0fe4['shift']());}catch(_0x5fbf43){_0x1e0fe4['push'](_0x1e0fe4['shift']());}}}(a55_0x47b0,0xec71d));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a55_0x5b5157 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';function a55_0x47b0(){const _0x39b914=['type','file','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','5WijxaX','\x20valid','\x20error(s)','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','log','helpText','.yml','5495912kJWslH','warningCount','3442ARFdhc','1759725tDifHH','dim','):\x20','Error:\x20Directory\x20not\x20found:\x20','verbose','error','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','1812230wWxISy','targetDir','6115963DEQzdg','\x20warning(s)\x20found','Validation\x20failed:\x20','\x20file(s)\x20with\x20errors,\x20','length','cyan','hasErrors','297BOcMhd','852pjovxx','Validate\x20segment\x20and\x20journey\x20YAML\x20files','8CVCoPE','parentSegment','segment:validate','no_parent','red','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','execute','name','.yaml','\x20warning(s)','\x20file(s)\x20valid','8344458ohgIuh','cwd','15900777MDVpxr','yellow','endsWith','invalidCount','green','✔\x20All\x20','valid'];a55_0x47b0=function(){return _0x39b914;};return a55_0x47b0();}import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a55_0x161f71(0x1b3)]=a55_0x161f71(0x1ae);['description']=a55_0x161f71(0x1ab);async[a55_0x161f71(0x1b2)](_0xdd6fdf){const _0x29ace2=a55_0x161f71,{options:_0x233f7d,args:_0x337ebc}=_0xdd6fdf,_0x21cb9b=_0x233f7d,_0x102dab=await resolveTarget({'arg':_0x337ebc[0x0],'contextParent':_0x233f7d[_0x29ace2(0x1ad)],'cwd':process[_0x29ace2(0x1b8)]()});if(!isSuccessfulResolution(_0x102dab))return _0x102dab['errorCode']===_0x29ace2(0x1af)?(console[_0x29ace2(0x19e)](a55_0x5b5157['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x29ace2(0x19e)](_0x29ace2(0x1b1)),console[_0x29ace2(0x19e)]('\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'),console[_0x29ace2(0x19e)](_0x29ace2(0x19f))):(console[_0x29ace2(0x19e)](a55_0x5b5157[_0x29ace2(0x1b0)]('Error:\x20'+_0x102dab['message']+'\x0a')),_0x102dab['helpText']&&console['error'](a55_0x5b5157[_0x29ace2(0x1a7)](_0x102dab[_0x29ace2(0x1c8)]))),0x1;const _0x2b8c60=_0x102dab[_0x29ace2(0x1a1)],_0x21f1fd=_0x102dab[_0x29ace2(0x1c0)]===_0x29ace2(0x1c1)?_0x102dab['filePath']:undefined;if(!_0x21f1fd&&!existsSync(_0x2b8c60))return console[_0x29ace2(0x19e)](a55_0x5b5157[_0x29ace2(0x1b0)](_0x29ace2(0x19c)+_0x2b8c60+'\x0a')),0x1;let _0x27a5f3;if(_0x21f1fd){if(!_0x21f1fd[_0x29ace2(0x1bb)](_0x29ace2(0x1c9))&&!_0x21f1fd[_0x29ace2(0x1bb)](_0x29ace2(0x1b4)))return console[_0x29ace2(0x19e)](a55_0x5b5157['red'](_0x29ace2(0x1c6)+_0x21f1fd+'\x0a')),0x1;_0x27a5f3=[_0x21f1fd];}else _0x27a5f3=findYamlFiles(_0x2b8c60);if(_0x27a5f3[_0x29ace2(0x1a6)]===0x0)return console[_0x29ace2(0x19e)](a55_0x5b5157['red'](_0x29ace2(0x1c2)+_0x2b8c60+'\x0a')),0x1;const _0x467d55=validateYamlFiles(_0x27a5f3,_0x2b8c60),_0x5f3a1c=calculateSummary(_0x467d55);for(const _0x25ad2e of _0x467d55){if(!isValidationResult(_0x25ad2e))continue;const {relativePath:_0x2965ff,source:_0x583671,result:_0x18d350,fileType:_0x4edb9d}=_0x25ad2e,_0xc27f04=_0x4edb9d;if(_0x18d350[_0x29ace2(0x1bf)]&&_0x18d350['warnings'][_0x29ace2(0x1a6)]===0x0)_0x21cb9b[_0x29ace2(0x19d)]&&console[_0x29ace2(0x1c7)](a55_0x5b5157[_0x29ace2(0x1bd)]('✔\x20'+_0x2965ff)+a55_0x5b5157[_0x29ace2(0x1ce)]('\x20('+_0xc27f04+')'));else _0x18d350[_0x29ace2(0x1bf)]?(console['log'](a55_0x5b5157[_0x29ace2(0x1ba)]('⚠\x20'+_0x2965ff)+a55_0x5b5157[_0x29ace2(0x1ce)]('\x20('+_0xc27f04+_0x29ace2(0x1cf)+_0x18d350['warnings'][_0x29ace2(0x1a6)]+_0x29ace2(0x1b5))),console[_0x29ace2(0x1c7)](formatValidationResult(_0x18d350,_0x583671,_0x2965ff))):(console['log'](a55_0x5b5157[_0x29ace2(0x1b0)]('✖\x20'+_0x2965ff)+a55_0x5b5157[_0x29ace2(0x1ce)]('\x20('+_0xc27f04+_0x29ace2(0x1cf)+_0x18d350['errors']['length']+_0x29ace2(0x1c5))),console[_0x29ace2(0x1c7)](formatValidationResult(_0x18d350,_0x583671,_0x2965ff)));}return console['log'](''),_0x5f3a1c[_0x29ace2(0x1a8)]?(console['log'](a55_0x5b5157[_0x29ace2(0x1b0)](_0x29ace2(0x1a4)+_0x5f3a1c[_0x29ace2(0x1bc)]+_0x29ace2(0x1a5)+_0x5f3a1c['validCount']+_0x29ace2(0x1c4))),_0x5f3a1c[_0x29ace2(0x1cb)]>0x0&&console['log'](a55_0x5b5157[_0x29ace2(0x1ba)](_0x5f3a1c[_0x29ace2(0x1cb)]+'\x20warning(s)\x20found')),0x1):(console[_0x29ace2(0x1c7)](a55_0x5b5157[_0x29ace2(0x1bd)](_0x29ace2(0x1be)+_0x5f3a1c['validCount']+_0x29ace2(0x1b6))),_0x5f3a1c[_0x29ace2(0x1cb)]>0x0&&console['log'](a55_0x5b5157[_0x29ace2(0x1ba)](_0x5f3a1c[_0x29ace2(0x1cb)]+_0x29ace2(0x1a3))),0x0);}}
|