@treasuredata/tdx 2026.3.48 → 2026.3.50
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.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.d.ts +22 -0
- package/dist/commands/auth-command.d.ts.map +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-command.js.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.d.ts +5 -5
- package/dist/commands/profile-command.d.ts.map +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profile-command.js.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.d.ts +6 -4
- 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.d.ts +12 -8
- package/dist/core/oauth.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.d.ts.map +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/mcp/utils.js.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +8 -0
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/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.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +29 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.d.ts +4 -1
- package/dist/sdk/workspace/git.d.ts.map +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/git.js.map +1 -1
- package/dist/sdk/workspace/index.d.ts +8 -15
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.d.ts +3 -13
- package/dist/sdk/workspace/weekly.d.ts.map +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/weekly.js.map +1 -1
- package/dist/sdk/workspace/wikilinks.d.ts +15 -0
- package/dist/sdk/workspace/wikilinks.d.ts.map +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/sdk/workspace/wikilinks.js.map +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
- package/dist/commands/auth-login-command.d.ts +0 -29
- package/dist/commands/auth-login-command.d.ts.map +0 -1
- package/dist/commands/auth-login-command.js +0 -1
- package/dist/commands/auth-login-command.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a38_0x55e35a=a38_0xde2a;(function(_0xc83b9a,_0x1fe16f){const _0xd3b14e=a38_0xde2a,_0x2e6ef8=_0xc83b9a();while(!![]){try{const _0x315cf6=-parseInt(_0xd3b14e(0x27a))/0x1*(-parseInt(_0xd3b14e(0x26f))/0x2)+parseInt(_0xd3b14e(0x21c))/0x3*(-parseInt(_0xd3b14e(0x1f6))/0x4)+-parseInt(_0xd3b14e(0x1f1))/0x5*(-parseInt(_0xd3b14e(0x1f4))/0x6)+-parseInt(_0xd3b14e(0x1f9))/0x7+parseInt(_0xd3b14e(0x205))/0x8+-parseInt(_0xd3b14e(0x23c))/0x9+parseInt(_0xd3b14e(0x268))/0xa*(parseInt(_0xd3b14e(0x1ec))/0xb);if(_0x315cf6===_0x1fe16f)break;else _0x2e6ef8['push'](_0x2e6ef8['shift']());}catch(_0x5f809f){_0x2e6ef8['push'](_0x2e6ef8['shift']());}}}(a38_0x3027,0x930ea));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';function a38_0xde2a(_0x24f2db,_0x1659ca){_0x24f2db=_0x24f2db-0x1eb;const _0x30276e=a38_0x3027();let _0xde2ac7=_0x30276e[_0x24f2db];return _0xde2ac7;}import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';function a38_0x3027(){const _0x1be696=['\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details','jobId','978jdVMZk','\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml','2480DpJpbT','Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>','INVALID_ARGUMENT','918288WLIFpv','/e/','Resolved\x20type:\x20','List\x20segment\x20folders\x20under\x20a\x20parent\x20segment','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','web','\x20folder','Parent\x20segment:\x20','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','parentSegment','\x20[Job\x20ID:\x20','4670856riUnDv','Fetching\x20segment\x20details...','red','Fetching\x20folder\x20details...','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Show\x20segment\x20or\x20folder\x20details','Resolving\x20folder\x20\x27','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','parentId','parentFolder','\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>','Error:\x20','Listing\x20folders\x20for\x20parent\x20\x27','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Usage:','getSegmentSQL','getFolder','segment:folder:create','Folder\x20ID\x20missing\x20from\x20resolved\x20path','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','Resolved\x20folder\x20ID:\x20','348SnImIL','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','Executing\x20segment\x20query...','\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml','segment:sql','stats','setJobId','verbose','fullPath','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','segmentName','Resolved\x20YAML\x20file:\x20','type','\x27...','SELECT\x20*\x20FROM\x20(\x0a','message','site','Folder\x20name:\x20','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','segment:show','Usage:\x20tdx\x20sg\x20desc\x20<name>','green','query','test','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>','Error:\x20Parent\x20segment\x20name\x20is\x20required','Segment\x20ID:\x20','url','Site:\x20','resolveFolderId','error','1845981BAPTCw','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','code','Examples:','data','parent','getSQLFromYamlFile','folderId','Error:\x20Path\x20or\x20name\x20is\x20required','✔\x20Found\x20','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','jsonl','Parent\x20ID:\x20','SQL\x20query:\x0a','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Fetching\x20parent\x20segment\x20details...','segment','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]','\x27\x20with\x20ID:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','information_schema','Resolving\x20\x27','segmentId','\x20\x20Parent\x20segment:\x20','Fetching\x20SQL\x20for\x20segment...','Options:','Use:\x20tdx\x20ps\x20view','Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.','Create\x20segment\x20folder\x20for\x20organization','SEGMENT_NOT_FOUND','getSegment','toLocaleString','json','\x20\x20tdx\x20sg\x20sql\x20--path\x20','execute','Fetching\x20SQL\x20from\x20rule...','Resolved\x20parent\x20ID:\x20','resolveParentId','segment:folder:list','resolvePathToResource','\x20\x20Cause:\x20','26070SaBXXC','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Resolved\x20parent\x20folder\x20ID:\x20','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','✖\x20Query\x20failed\x20[','\x20\x20Segment\x20name:\x20','includes','62fdZRId','segment:describe','in\x20','Use:\x20tdx\x20ps\x20show','\x20Opening\x20','name','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','Get\x20SQL\x20query\x20for\x20child\x20segment','✔\x20Query\x20completed:\x20Processed\x20','Use:\x20tdx\x20ps\x20desc','folder','12713GjTiAO','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','path','limit','length','Resolving\x20parent\x20segment\x20\x27','(root)','Creating\x20folder\x20\x27','processedRows','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','Use:\x20tdx\x20ps\x20view\x20-w','Parent\x20name:\x20','log','Resolving\x20parent\x20folder\x20\x27','\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22','content','SEGMENT_FOLDER_NOT_FOUND','format','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','✔\x20Created\x20folder\x20\x27','Fetching\x20folder\x20\x27','Show\x20folder\x20or\x20child\x20segment\x20details','createFolder','description','segment:folder:show','11LFLAIZ','Folder\x20ID:\x20','Target\x20path:\x20','Resolved\x20relative\x20path\x20to:\x20','cause','920pSysQU'];a38_0x3027=function(){return _0x1be696;};return a38_0x3027();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a38_0xfe4cc7 from'chalk';async function resolveSegmentTarget(_0x261bfa,_0x12b651,_0x58826d){const _0x4f2f2b=a38_0xde2a;if(isYamlFilePath(_0x261bfa))try{const _0xb512aa=await resolveYamlFilePath(_0x261bfa);return _0x58826d&&(console[_0x4f2f2b(0x23b)](_0x4f2f2b(0x227)+_0x261bfa),console[_0x4f2f2b(0x23b)](_0x4f2f2b(0x256)+_0xb512aa[_0x4f2f2b(0x203)]),console[_0x4f2f2b(0x23b)](_0x4f2f2b(0x26d)+_0xb512aa[_0x4f2f2b(0x226)]),console[_0x4f2f2b(0x23b)]('\x20\x20Folder\x20path:\x20'+(_0xb512aa['folderPath']||_0x4f2f2b(0x280))),console[_0x4f2f2b(0x23b)]('\x20\x20Full\x20path:\x20'+_0xb512aa['fullPath'])),_0xb512aa[_0x4f2f2b(0x224)];}catch(_0x3fa059){throw new SDKError(ErrorCode[_0x4f2f2b(0x1f8)],_0x4f2f2b(0x20c)+_0x3fa059[_0x4f2f2b(0x22b)]);}if(!_0x12b651)throw new SDKError(ErrorCode[_0x4f2f2b(0x1f8)],_0x4f2f2b(0x21d));return _0x12b651+'/'+_0x261bfa;}export class SegmentDescribeCommand extends BaseCommand{['name']=a38_0x55e35a(0x270);[a38_0x55e35a(0x292)]=a38_0x55e35a(0x20a);async[a38_0x55e35a(0x261)](_0x393a08){const _0x517f8d=a38_0x55e35a,{options:_0xea4aae,args:_0x2e102c,tdx:_0x1c9da3}=_0x393a08,_0x1b2a3d=_0x2e102c[0x0],_0x503088=!_0x1b2a3d&&!!_0xea4aae[_0x517f8d(0x203)],_0x526176=_0x1b2a3d||_0xea4aae[_0x517f8d(0x203)];if(!_0x526176)return console[_0x517f8d(0x23b)](_0x517f8d(0x244)),console['error']('Usage:\x20tdx\x20segment\x20describe\x20<path>'),console['error'](_0x517f8d(0x23f)),console[_0x517f8d(0x23b)](_0x517f8d(0x28d)),console['error'](_0x517f8d(0x225)),console['error'](_0x517f8d(0x212)),console[_0x517f8d(0x23b)](_0x517f8d(0x21a)),0x1;try{const _0x45653a=_0xea4aae['segmentPath'];let _0x4c210e=_0x526176;!_0x503088&&_0x45653a&&!_0x526176[_0x517f8d(0x26e)]('/')&&(_0x4c210e=_0x45653a+'/'+_0x526176,_0xea4aae[_0x517f8d(0x223)]&&console[_0x517f8d(0x23b)](_0x517f8d(0x1ef)+_0x4c210e));const _0x3d70cb=await withSpinner('Resolving\x20path\x20\x27'+_0x4c210e+_0x517f8d(0x229),()=>_0x1c9da3['segment'][_0x517f8d(0x266)](_0x4c210e),{'verbose':_0xea4aae['verbose']}),_0x2558b3=_0x3d70cb['data'];_0xea4aae[_0x517f8d(0x223)]&&(console[_0x517f8d(0x23b)](_0x517f8d(0x1fb)+_0x2558b3[_0x517f8d(0x228)]),console[_0x517f8d(0x23b)]('Parent\x20ID:\x20'+_0x2558b3['parentId']),_0x2558b3[_0x517f8d(0x243)]&&console[_0x517f8d(0x23b)](_0x517f8d(0x1ed)+_0x2558b3[_0x517f8d(0x243)]),_0x2558b3[_0x517f8d(0x255)]&&console[_0x517f8d(0x23b)]('Segment\x20ID:\x20'+_0x2558b3[_0x517f8d(0x255)]));if(_0x2558b3[_0x517f8d(0x228)]===_0x517f8d(0x241)){const _0x18ab72=await withSpinner(_0x517f8d(0x24c),()=>_0x1c9da3[_0x517f8d(0x24d)]['getParent'](_0x2558b3[_0x517f8d(0x20d)]),{'verbose':_0xea4aae[_0x517f8d(0x223)]});await handleSingleObjectOutput(_0x18ab72[_0x517f8d(0x240)],_0xea4aae);}else{if(_0x2558b3[_0x517f8d(0x228)]==='folder'){if(!_0x2558b3['folderId'])throw new SDKError(ErrorCode[_0x517f8d(0x28a)],_0x517f8d(0x218));const _0x111140=await withSpinner(_0x517f8d(0x208),()=>_0x1c9da3[_0x517f8d(0x24d)][_0x517f8d(0x216)](_0x2558b3['folderId']),{'verbose':_0xea4aae[_0x517f8d(0x223)]});await handleSingleObjectOutput(_0x111140[_0x517f8d(0x240)],_0xea4aae);}else{if(_0x2558b3['type']===_0x517f8d(0x24d)){if(!_0x2558b3['segmentId'])throw new SDKError(ErrorCode[_0x517f8d(0x25c)],_0x517f8d(0x252));const _0x1761e4=await withSpinner('Fetching\x20segment\x20details...',()=>_0x1c9da3['segment'][_0x517f8d(0x25d)](_0x2558b3['parentId'],_0x2558b3[_0x517f8d(0x255)]),{'verbose':_0xea4aae[_0x517f8d(0x223)]});await handleSingleObjectOutput(_0x1761e4['data'],_0xea4aae);}}}return 0x0;}catch(_0x3cca32){if(_0x3cca32 instanceof SDKError)return console[_0x517f8d(0x23b)](_0x517f8d(0x210)+_0x3cca32[_0x517f8d(0x22b)]),_0x3cca32[_0x517f8d(0x1f0)]&&console[_0x517f8d(0x23b)]('\x20\x20Cause:\x20'+_0x3cca32[_0x517f8d(0x1f0)]),0x1;throw _0x3cca32;}}}export class SegmentShowCommand extends BaseCommand{[a38_0x55e35a(0x274)]=a38_0x55e35a(0x22f);['description']='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x27586c){const _0x5c0cd6=a38_0x55e35a,{options:_0x5733ea,args:_0x5dee5c,tdx:_0x316ed6}=_0x27586c,_0xdf9ff=_0x5dee5c[0x0];if(!_0xdf9ff)return console[_0x5c0cd6(0x23b)](_0x5c0cd6(0x213)),console[_0x5c0cd6(0x23b)]('Usage:\x20tdx\x20sg\x20show\x20<name>'),console[_0x5c0cd6(0x23b)](_0x5c0cd6(0x235)),console[_0x5c0cd6(0x23b)](_0x5c0cd6(0x23f)),console['error']('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x5c0cd6(0x23b)](_0x5c0cd6(0x27b)),0x1;try{const _0x18844a=_0x5733ea[_0x5c0cd6(0x203)],_0x3e18ac=await resolveSegmentTarget(_0xdf9ff,_0x18844a,_0x5733ea[_0x5c0cd6(0x223)]);_0x5733ea[_0x5c0cd6(0x223)]&&console[_0x5c0cd6(0x23b)](_0x5c0cd6(0x1ee)+_0x3e18ac);const _0x5e924e=await withSpinner('Resolving\x20\x27'+_0xdf9ff+'\x27...',()=>_0x316ed6[_0x5c0cd6(0x24d)][_0x5c0cd6(0x266)](_0x3e18ac),{'verbose':_0x5733ea[_0x5c0cd6(0x223)]}),_0x16b5ff=_0x5e924e[_0x5c0cd6(0x240)];_0x5733ea[_0x5c0cd6(0x223)]&&(console[_0x5c0cd6(0x23b)](_0x5c0cd6(0x1fb)+_0x16b5ff[_0x5c0cd6(0x228)]),console[_0x5c0cd6(0x23b)]('Parent\x20ID:\x20'+_0x16b5ff[_0x5c0cd6(0x20d)]));if(_0x16b5ff[_0x5c0cd6(0x228)]===_0x5c0cd6(0x279))return console[_0x5c0cd6(0x23b)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console['error']('Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details'),0x1;if(_0x16b5ff[_0x5c0cd6(0x228)]===_0x5c0cd6(0x241))return console[_0x5c0cd6(0x23b)](_0x5c0cd6(0x202)),console[_0x5c0cd6(0x23b)](_0x5c0cd6(0x272)),0x1;if(!_0x16b5ff['segmentId'])throw new SDKError(ErrorCode[_0x5c0cd6(0x25c)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x2eb171=await withSpinner(_0x5c0cd6(0x257),()=>_0x316ed6['segment'][_0x5c0cd6(0x215)](_0x16b5ff[_0x5c0cd6(0x20d)],_0x16b5ff['segmentId']),{'verbose':_0x5733ea[_0x5c0cd6(0x223)]});let _0x493c59=_0x2eb171[_0x5c0cd6(0x240)];const _0x33224d=resolveLimit(_0x5733ea[_0x5c0cd6(0x27d)],DEFAULT_DISPLAY_LIMIT),_0x5b98d6=/\bLIMIT\s+\d+/i[_0x5c0cd6(0x233)](_0x493c59);!_0x5b98d6&&(_0x493c59=_0x493c59['trim']()['replace'](/;+$/,''),_0x493c59=_0x5c0cd6(0x22a)+_0x493c59+_0x5c0cd6(0x269)+_0x33224d);_0x5733ea[_0x5c0cd6(0x223)]&&console[_0x5c0cd6(0x23b)](_0x5c0cd6(0x24a)+_0x493c59);const _0xa3abb9=await withProgressSpinner(_0x5c0cd6(0x21e),async _0x271f9b=>{const _0x19ae1d=_0x5c0cd6,_0xc5f8d6=await _0x316ed6[_0x19ae1d(0x232)][_0x19ae1d(0x261)](_0x493c59,{'catalog':'td','schema':_0x19ae1d(0x253),'onJobId':_0x11b442=>{const _0x2b453f=_0x19ae1d;_0x271f9b[_0x2b453f(0x222)](_0x11b442);}});return _0xc5f8d6;},{'verbose':_0x5733ea['verbose']}),_0x2a7ec6=_0xa3abb9[_0x5c0cd6(0x240)],_0x169c58=_0x2a7ec6[_0x5c0cd6(0x1f3)]?_0x5c0cd6(0x204)+_0x2a7ec6[_0x5c0cd6(0x1f3)]+']':'';return console[_0x5c0cd6(0x23b)](_0x5c0cd6(0x277)+_0x2a7ec6[_0x5c0cd6(0x221)][_0x5c0cd6(0x282)][_0x5c0cd6(0x25e)]()+'\x20rows\x20'+(_0x5c0cd6(0x271)+formatElapsed(_0x2a7ec6[_0x5c0cd6(0x221)]['elapsedTimeMillis'])+_0x169c58)),await handleQueryOutput(_0x2a7ec6,_0x5733ea),0x0;}catch(_0x17ab37){if(_0x17ab37 instanceof SDKError)return console[_0x5c0cd6(0x23b)](_0x5c0cd6(0x26c)+_0x17ab37[_0x5c0cd6(0x23e)]+']'),console['error']('\x0a'+_0x17ab37[_0x5c0cd6(0x22b)]),0x1;throw _0x17ab37;}}}export class SegmentFolderListCommand extends BaseCommand{['name']=a38_0x55e35a(0x265);[a38_0x55e35a(0x292)]=a38_0x55e35a(0x1fc);async[a38_0x55e35a(0x261)](_0x1883ed){const _0x3608f0=a38_0x55e35a,{options:_0x403d02,args:_0x5cacf7,tdx:_0x26f27c}=_0x1883ed;if(_0x5cacf7[_0x3608f0(0x27e)]===0x0)return console[_0x3608f0(0x23b)](_0x3608f0(0x236)),console['error'](_0x3608f0(0x1f7)),0x1;const _0x5c568f=_0x5cacf7[0x0];try{_0x403d02[_0x3608f0(0x223)]&&(console[_0x3608f0(0x23b)](_0x3608f0(0x239)+_0x403d02[_0x3608f0(0x22c)]),console[_0x3608f0(0x23b)](_0x3608f0(0x285)+_0x5c568f));const _0x4b811d=await withSpinner(_0x3608f0(0x27f)+_0x5c568f+_0x3608f0(0x229),()=>_0x26f27c[_0x3608f0(0x24d)]['resolveParentId'](_0x5c568f),{'verbose':_0x403d02[_0x3608f0(0x223)]}),_0x423f4d=_0x4b811d['data'];_0x403d02[_0x3608f0(0x223)]&&console[_0x3608f0(0x23b)](_0x3608f0(0x263)+_0x423f4d);const _0xe3be02=await withSpinner(_0x3608f0(0x211)+_0x5c568f+_0x3608f0(0x229),()=>_0x26f27c[_0x3608f0(0x24d)]['listFolders'](_0x423f4d),{'verbose':_0x403d02[_0x3608f0(0x223)]}),_0x47e08c=_0xe3be02[_0x3608f0(0x240)];return console[_0x3608f0(0x23b)](_0x3608f0(0x245)+_0x47e08c['length']+_0x3608f0(0x200)+(_0x47e08c['length']!==0x1?'s':'')),await handleSDKOutput(_0x47e08c,_0x403d02),0x0;}catch(_0x25067e){if(_0x25067e instanceof SDKError)return console[_0x3608f0(0x23b)]('Error:\x20'+_0x25067e[_0x3608f0(0x22b)]),_0x25067e[_0x3608f0(0x1f0)]&&console[_0x3608f0(0x23b)](_0x3608f0(0x267)+_0x25067e[_0x3608f0(0x1f0)]),0x1;throw _0x25067e;}}}export class SegmentFolderShowCommand extends BaseCommand{[a38_0x55e35a(0x274)]=a38_0x55e35a(0x1eb);[a38_0x55e35a(0x292)]='Show\x20segment\x20folder\x20details';async[a38_0x55e35a(0x261)](_0x14c88e){const _0xa7be35=a38_0x55e35a,{options:_0x34ddf6,args:_0x2caad4,tdx:_0x586f92}=_0x14c88e;if(_0x2caad4['length']===0x0)return console[_0xa7be35(0x23b)]('Error:\x20Folder\x20reference\x20is\x20required'),console[_0xa7be35(0x23b)](_0xa7be35(0x26b)),0x1;try{const {parentId:_0x1485da,childId:_0x57d270}=parseSegmentRef(_0x2caad4[0x0]);_0x34ddf6[_0xa7be35(0x223)]&&(console[_0xa7be35(0x23b)]('Site:\x20'+_0x34ddf6['site']),console[_0xa7be35(0x23b)](_0xa7be35(0x285)+_0x1485da),_0x57d270&&console['error'](_0xa7be35(0x22d)+_0x57d270));if(!_0x57d270)return console[_0xa7be35(0x23b)](_0xa7be35(0x22e)),0x1;const _0x378ab2=await withSpinner(_0xa7be35(0x27f)+_0x1485da+_0xa7be35(0x229),()=>_0x586f92['segment']['resolveParentId'](_0x1485da),{'verbose':_0x34ddf6[_0xa7be35(0x223)]}),_0x1856b8=_0x378ab2[_0xa7be35(0x240)];_0x34ddf6[_0xa7be35(0x223)]&&console['error'](_0xa7be35(0x263)+_0x1856b8);const _0x164a0c=await withSpinner(_0xa7be35(0x20b)+_0x57d270+_0xa7be35(0x229),()=>_0x586f92[_0xa7be35(0x24d)][_0xa7be35(0x23a)](_0x1856b8,_0x57d270),{'verbose':_0x34ddf6['verbose']}),_0x31d438=_0x164a0c[_0xa7be35(0x240)];_0x34ddf6[_0xa7be35(0x223)]&&console[_0xa7be35(0x23b)](_0xa7be35(0x21b)+_0x31d438);const _0x2d5071=await withSpinner(_0xa7be35(0x28f)+_0x57d270+_0xa7be35(0x229),()=>_0x586f92[_0xa7be35(0x24d)][_0xa7be35(0x216)](_0x31d438),{'verbose':_0x34ddf6[_0xa7be35(0x223)]});return await handleSDKOutput([_0x2d5071['data']],_0x34ddf6),0x0;}catch(_0x109df8){if(_0x109df8 instanceof SDKError)return console['error'](_0xa7be35(0x210)+_0x109df8[_0xa7be35(0x22b)]),_0x109df8[_0xa7be35(0x1f0)]&&console[_0xa7be35(0x23b)](_0xa7be35(0x267)+_0x109df8[_0xa7be35(0x1f0)]),0x1;throw _0x109df8;}}}export class SegmentSQLCommand extends BaseCommand{[a38_0x55e35a(0x274)]=a38_0x55e35a(0x220);['description']=a38_0x55e35a(0x276);async[a38_0x55e35a(0x261)](_0xfbd7e7){const _0x2cc3c8=a38_0x55e35a,{options:_0x866392,args:_0x59215f}=_0xfbd7e7,_0x483ace=_0x866392,_0xacb5e0=_0x483ace[_0x2cc3c8(0x27c)],_0x85e8f4=_0x59215f[0x0];if(!_0x85e8f4&&!_0xacb5e0)return console['error'](a38_0xfe4cc7[_0x2cc3c8(0x207)](_0x2cc3c8(0x275))),console[_0x2cc3c8(0x23b)](_0x2cc3c8(0x214)),console[_0x2cc3c8(0x23b)](_0x2cc3c8(0x23d)),console[_0x2cc3c8(0x23b)](_0x2cc3c8(0x20f)),console[_0x2cc3c8(0x23b)]('Examples:'),console[_0x2cc3c8(0x23b)]('\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22'),console[_0x2cc3c8(0x23b)](_0x2cc3c8(0x24b)),0x1;if(_0x85e8f4&&_0xacb5e0)return console[_0x2cc3c8(0x23b)](a38_0xfe4cc7[_0x2cc3c8(0x207)](_0x2cc3c8(0x234))),0x1;try{let _0x3369e4;if(_0xacb5e0)_0x3369e4=await this[_0x2cc3c8(0x242)](_0xacb5e0,_0xfbd7e7);else{if(isYamlFilePath(_0x85e8f4))return console[_0x2cc3c8(0x23b)](a38_0xfe4cc7[_0x2cc3c8(0x207)](_0x2cc3c8(0x24f))),console[_0x2cc3c8(0x23b)](_0x2cc3c8(0x260)+_0x85e8f4),0x1;else _0x3369e4=await this['getSQLFromServerSegment'](_0x85e8f4,_0xfbd7e7);}return _0x866392[_0x2cc3c8(0x28b)]===_0x2cc3c8(0x25f)||_0x866392['format']===_0x2cc3c8(0x248)?await handleSDKOutput([{'sql':_0x3369e4}],_0x866392):console[_0x2cc3c8(0x286)](_0x3369e4),0x0;}catch(_0x445936){if(_0x445936 instanceof SDKError)return console['error'](_0x2cc3c8(0x210)+_0x445936[_0x2cc3c8(0x22b)]),_0x445936[_0x2cc3c8(0x1f0)]&&console[_0x2cc3c8(0x23b)]('\x20\x20Cause:\x20'+_0x445936[_0x2cc3c8(0x1f0)]),0x1;throw _0x445936;}}async[a38_0x55e35a(0x242)](_0x42d217,_0x4d1653){const _0x4454c2=a38_0x55e35a,{options:_0x2f4919,tdx:_0x4fcd86}=_0x4d1653;let _0x559664;try{_0x559664=await resolveYamlFilePath(_0x42d217);}catch(_0x5575db){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x4454c2(0x20c)+_0x5575db['message']);}_0x2f4919[_0x4454c2(0x223)]&&console[_0x4454c2(0x23b)]('Resolved:\x20'+_0x559664['parentSegment']+'/'+_0x559664[_0x4454c2(0x226)]);const _0x10363a=await withSpinner(_0x4454c2(0x262),()=>_0x4fcd86['segment']['getSegmentSQLFromYaml'](_0x559664[_0x4454c2(0x289)],_0x559664[_0x4454c2(0x203)],_0x559664[_0x4454c2(0x226)]),{'verbose':_0x2f4919['verbose']});return _0x10363a[_0x4454c2(0x240)];}async['getSQLFromServerSegment'](_0x16b046,_0x363b8a){const _0x4a8e94=a38_0x55e35a,{options:_0x3f3c9c,tdx:_0x48979f}=_0x363b8a,_0x3df76d=_0x3f3c9c[_0x4a8e94(0x203)],_0x5b3bb4=await resolveSegmentTarget(_0x16b046,_0x3df76d,_0x3f3c9c[_0x4a8e94(0x223)]);_0x3f3c9c[_0x4a8e94(0x223)]&&console[_0x4a8e94(0x23b)](_0x4a8e94(0x1ee)+_0x5b3bb4);const _0xf1494=await withSpinner(_0x4a8e94(0x254)+_0x16b046+_0x4a8e94(0x229),()=>_0x48979f[_0x4a8e94(0x24d)][_0x4a8e94(0x266)](_0x5b3bb4),{'verbose':_0x3f3c9c[_0x4a8e94(0x223)]}),_0x43355c=_0xf1494[_0x4a8e94(0x240)];_0x3f3c9c[_0x4a8e94(0x223)]&&(console['error'](_0x4a8e94(0x1fb)+_0x43355c['type']),console[_0x4a8e94(0x23b)](_0x4a8e94(0x249)+_0x43355c['parentId']));if(_0x43355c[_0x4a8e94(0x228)]===_0x4a8e94(0x279))throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.');if(_0x43355c[_0x4a8e94(0x228)]===_0x4a8e94(0x241))throw new SDKError(ErrorCode[_0x4a8e94(0x1f8)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x43355c[_0x4a8e94(0x255)])throw new SDKError(ErrorCode[_0x4a8e94(0x25c)],_0x4a8e94(0x252));const _0x190a2f=await withSpinner(_0x4a8e94(0x257),()=>_0x48979f[_0x4a8e94(0x24d)]['getSegmentSQL'](_0x43355c['parentId'],_0x43355c[_0x4a8e94(0x255)]),{'verbose':_0x3f3c9c[_0x4a8e94(0x223)]});return _0x190a2f['data'];}}export class SegmentFolderCreateCommand extends BaseCommand{[a38_0x55e35a(0x274)]=a38_0x55e35a(0x217);[a38_0x55e35a(0x292)]=a38_0x55e35a(0x25b);async[a38_0x55e35a(0x261)](_0x148aef){const _0x260d9c=a38_0x55e35a,{options:_0x223260,args:_0x40753b,tdx:_0x1e205e}=_0x148aef,_0x3eb7dd=_0x223260;if(_0x40753b[_0x260d9c(0x27e)]<0x2)return console['error'](_0x260d9c(0x209)),console['error'](_0x260d9c(0x250)),0x1;const _0x182688=_0x40753b[0x0],_0x19754e=_0x40753b[0x1];_0x3eb7dd[_0x260d9c(0x223)]&&(console['error'](_0x260d9c(0x239)+_0x3eb7dd[_0x260d9c(0x22c)]),console[_0x260d9c(0x23b)](_0x260d9c(0x201)+_0x182688),console[_0x260d9c(0x23b)](_0x260d9c(0x22d)+_0x19754e));let _0x1c25b0;if(_0x3eb7dd[_0x260d9c(0x20e)]){const _0x21ccf8=_0x3eb7dd[_0x260d9c(0x20e)],_0x596712=await withSpinner(_0x260d9c(0x27f)+_0x182688+_0x260d9c(0x229),()=>_0x1e205e['segment'][_0x260d9c(0x264)](_0x182688),{'verbose':_0x3eb7dd[_0x260d9c(0x223)]}),_0x4e6514=_0x596712[_0x260d9c(0x240)],_0x89deed=await withSpinner(_0x260d9c(0x287)+_0x21ccf8+_0x260d9c(0x229),()=>_0x1e205e[_0x260d9c(0x24d)][_0x260d9c(0x23a)](_0x4e6514,_0x21ccf8),{'verbose':_0x3eb7dd[_0x260d9c(0x223)]});_0x1c25b0=_0x89deed[_0x260d9c(0x240)],_0x3eb7dd[_0x260d9c(0x223)]&&console[_0x260d9c(0x23b)](_0x260d9c(0x26a)+_0x1c25b0);}const _0x5ad70f={'name':_0x19754e,'description':_0x3eb7dd['description'],'parentFolderId':_0x1c25b0},_0x51cec7=await withSpinner(_0x260d9c(0x281)+_0x19754e+_0x260d9c(0x229),()=>_0x1e205e['segment'][_0x260d9c(0x291)](_0x182688,_0x5ad70f),{'verbose':_0x3eb7dd[_0x260d9c(0x223)]}),_0x26e6ae=_0x51cec7['data'];return console[_0x260d9c(0x23b)](_0x260d9c(0x28e)+_0x26e6ae[_0x260d9c(0x274)]+_0x260d9c(0x251)+_0x26e6ae['id']),await handleSDKOutput([_0x26e6ae],_0x3eb7dd),0x0;}}export class SegmentViewCommand extends BaseCommand{['name']='segment:view';['description']=a38_0x55e35a(0x290);async[a38_0x55e35a(0x261)](_0x2b3a12){const _0x496777=a38_0x55e35a,{options:_0x15c440,args:_0x410dae,tdx:_0x5eb0a6}=_0x2b3a12,_0x25a30e=_0x410dae[0x0];if(!_0x25a30e)return console[_0x496777(0x23b)]('Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x496777(0x23b)](_0x496777(0x1fe)),console[_0x496777(0x23b)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>'),console[_0x496777(0x23b)](_0x496777(0x258)),console[_0x496777(0x23b)](_0x496777(0x246)),console[_0x496777(0x23b)]('Examples:'),console[_0x496777(0x23b)](_0x496777(0x1f2)),console[_0x496777(0x23b)](_0x496777(0x24e)),console[_0x496777(0x23b)](_0x496777(0x247)),console[_0x496777(0x23b)](_0x496777(0x1f5)),0x1;try{const _0x337913=_0x15c440[_0x496777(0x203)],_0x3bd608=await resolveSegmentTarget(_0x25a30e,_0x337913,_0x15c440['verbose']);_0x15c440[_0x496777(0x223)]&&console[_0x496777(0x23b)]('Target\x20path:\x20'+_0x3bd608);const _0xe8080e=await withSpinner(_0x496777(0x254)+_0x25a30e+_0x496777(0x229),()=>_0x5eb0a6[_0x496777(0x24d)][_0x496777(0x266)](_0x3bd608),{'verbose':_0x15c440[_0x496777(0x223)]}),_0x1ec7c0=_0xe8080e[_0x496777(0x240)];_0x15c440[_0x496777(0x223)]&&(console[_0x496777(0x23b)](_0x496777(0x1fb)+_0x1ec7c0[_0x496777(0x228)]),console['error'](_0x496777(0x249)+_0x1ec7c0[_0x496777(0x20d)]),_0x1ec7c0['folderId']&&console[_0x496777(0x23b)](_0x496777(0x1ed)+_0x1ec7c0[_0x496777(0x243)]),_0x1ec7c0[_0x496777(0x255)]&&console[_0x496777(0x23b)](_0x496777(0x237)+_0x1ec7c0[_0x496777(0x255)]));if(_0x15c440[_0x496777(0x1ff)]){if(_0x1ec7c0['type']===_0x496777(0x279))return console[_0x496777(0x23b)](_0x496777(0x283)),0x1;if(_0x1ec7c0[_0x496777(0x228)]===_0x496777(0x241))return console['error'](_0x496777(0x28c)),console[_0x496777(0x23b)](_0x496777(0x284)),0x1;if(!_0x1ec7c0[_0x496777(0x255)])throw new SDKError(ErrorCode[_0x496777(0x25c)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x19e829=getConsoleNextUrl(_0x15c440['site'],'/app/ps/'+_0x1ec7c0[_0x496777(0x20d)]+_0x496777(0x1fa)+_0x1ec7c0['segmentId']);return console[_0x496777(0x23b)](a38_0xfe4cc7[_0x496777(0x231)]('✔')+_0x496777(0x273)+a38_0xfe4cc7['cyan'](_0x19e829)),openBrowser(_0x19e829),0x0;}if(_0x1ec7c0[_0x496777(0x228)]===_0x496777(0x279)){if(!_0x1ec7c0['folderId'])throw new SDKError(ErrorCode[_0x496777(0x28a)],_0x496777(0x218));const _0x370ec3=await withSpinner(_0x496777(0x208),()=>_0x5eb0a6['segment'][_0x496777(0x216)](_0x1ec7c0[_0x496777(0x243)]),{'verbose':_0x15c440[_0x496777(0x223)]});await handleSingleObjectOutput(_0x370ec3[_0x496777(0x240)],_0x15c440);}else{if(_0x1ec7c0[_0x496777(0x228)]===_0x496777(0x24d)){if(!_0x1ec7c0['segmentId'])throw new SDKError(ErrorCode[_0x496777(0x25c)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x38c28c=await withSpinner(_0x496777(0x206),()=>_0x5eb0a6[_0x496777(0x24d)][_0x496777(0x25d)](_0x1ec7c0[_0x496777(0x20d)],_0x1ec7c0[_0x496777(0x255)]),{'verbose':_0x15c440[_0x496777(0x223)]}),_0x3eacf0=getConsoleNextUrl(_0x15c440['site'],'/app/ps/'+_0x1ec7c0[_0x496777(0x20d)]+'/e/'+_0x1ec7c0[_0x496777(0x255)]),_0x1d8ca9=_0x38c28c['data'];_0x1d8ca9[_0x496777(0x238)]=_0x3eacf0,await handleSingleObjectOutput(_0x1d8ca9,_0x15c440);}else return console[_0x496777(0x23b)]('Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.'),console[_0x496777(0x23b)](_0x496777(0x259)),0x1;}return 0x0;}catch(_0x57913c){if(_0x57913c instanceof SDKError)return console[_0x496777(0x23b)](_0x496777(0x210)+_0x57913c[_0x496777(0x22b)]),_0x57913c[_0x496777(0x1f0)]&&console[_0x496777(0x23b)]('\x20\x20Cause:\x20'+_0x57913c['cause']),0x1;throw _0x57913c;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a38_0x55e35a(0x274)]='segment:desc';[a38_0x55e35a(0x292)]='Show\x20child\x20segment\x20schema\x20(column\x20types)';async['execute'](_0x3aef68){const _0x37340f=a38_0x55e35a,{options:_0x105ddc,args:_0x1ca3d0,tdx:_0x534d33}=_0x3aef68,_0x49e8e5=_0x1ca3d0[0x0];if(!_0x49e8e5)return console['error']('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console['error'](_0x37340f(0x230)),console[_0x37340f(0x23b)](_0x37340f(0x1fd)),console[_0x37340f(0x23b)](_0x37340f(0x23f)),console[_0x37340f(0x23b)](_0x37340f(0x288)),console['error'](_0x37340f(0x21f)),0x1;try{const _0x39f9c6=_0x105ddc['parentSegment'],_0x39065e=await resolveSegmentTarget(_0x49e8e5,_0x39f9c6,_0x105ddc['verbose']);_0x105ddc['verbose']&&console[_0x37340f(0x23b)](_0x37340f(0x1ee)+_0x39065e);const _0x482026=await withSpinner('Resolving\x20\x27'+_0x49e8e5+'\x27...',()=>_0x534d33[_0x37340f(0x24d)]['resolvePathToResource'](_0x39065e),{'verbose':_0x105ddc[_0x37340f(0x223)]}),_0x1035fa=_0x482026[_0x37340f(0x240)];_0x105ddc[_0x37340f(0x223)]&&(console['error'](_0x37340f(0x1fb)+_0x1035fa[_0x37340f(0x228)]),console[_0x37340f(0x23b)](_0x37340f(0x249)+_0x1035fa['parentId']));if(_0x1035fa['type']===_0x37340f(0x279))return console[_0x37340f(0x23b)]('Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.'),console[_0x37340f(0x23b)](_0x37340f(0x219)),0x1;if(_0x1035fa['type']===_0x37340f(0x241))return console[_0x37340f(0x23b)](_0x37340f(0x25a)),console[_0x37340f(0x23b)](_0x37340f(0x278)),0x1;if(!_0x1035fa[_0x37340f(0x255)])throw new SDKError(ErrorCode[_0x37340f(0x25c)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x306b43=await withSpinner('Fetching\x20SQL\x20for\x20segment...',()=>_0x534d33['segment'][_0x37340f(0x215)](_0x1035fa[_0x37340f(0x20d)],_0x1035fa[_0x37340f(0x255)]),{'verbose':_0x105ddc[_0x37340f(0x223)]}),_0x5137bb=_0x306b43['data'],_0x59d2f8=await executeSchemaQuery(_0x5137bb,_0x534d33,_0x105ddc);return await handleQueryOutput(_0x59d2f8,_0x105ddc),0x0;}catch(_0x281458){if(_0x281458 instanceof SDKError)return console[_0x37340f(0x23b)]('Error:\x20'+_0x281458['message']),_0x281458[_0x37340f(0x1f0)]&&console[_0x37340f(0x23b)](_0x37340f(0x267)+_0x281458['cause']),0x1;throw _0x281458;}}}
|
|
1
|
+
const a37_0x21b2dc=a37_0x3e70;(function(_0x403a4a,_0x2e1e54){const _0x326db8=a37_0x3e70,_0x210127=_0x403a4a();while(!![]){try{const _0x52f280=-parseInt(_0x326db8(0x18c))/0x1*(-parseInt(_0x326db8(0x1e7))/0x2)+-parseInt(_0x326db8(0x1e2))/0x3+parseInt(_0x326db8(0x174))/0x4+parseInt(_0x326db8(0x184))/0x5+parseInt(_0x326db8(0x199))/0x6+-parseInt(_0x326db8(0x172))/0x7+-parseInt(_0x326db8(0x16a))/0x8*(parseInt(_0x326db8(0x1ce))/0x9);if(_0x52f280===_0x2e1e54)break;else _0x210127['push'](_0x210127['shift']());}catch(_0x19d2b9){_0x210127['push'](_0x210127['shift']());}}}(a37_0x153a,0xc604b));import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleQueryOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner,withProgressSpinner,formatElapsed}from'../utils/spinner.js';import{parseSegmentRef}from'../sdk/segment/segment-ref-parser.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';import{executeSchemaQuery}from'../sdk/segment/fields-display.js';import{isYamlFilePath,resolveYamlFilePath}from'../sdk/segment/segment-path-parser.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{openBrowser}from'../utils/process.js';import a37_0x5e0d32 from'chalk';async function resolveSegmentTarget(_0x1088fd,_0x12da83,_0x4b68bf){const _0x4aa283=a37_0x3e70;if(isYamlFilePath(_0x1088fd))try{const _0x4c29fd=await resolveYamlFilePath(_0x1088fd);return _0x4b68bf&&(console[_0x4aa283(0x19a)](_0x4aa283(0x1c3)+_0x1088fd),console['error'](_0x4aa283(0x1ea)+_0x4c29fd['parentSegment']),console[_0x4aa283(0x19a)](_0x4aa283(0x15f)+_0x4c29fd['segmentName']),console['error'](_0x4aa283(0x1e6)+(_0x4c29fd[_0x4aa283(0x17d)]||_0x4aa283(0x159))),console[_0x4aa283(0x19a)](_0x4aa283(0x19f)+_0x4c29fd[_0x4aa283(0x188)])),_0x4c29fd[_0x4aa283(0x188)];}catch(_0x173915){throw new SDKError(ErrorCode[_0x4aa283(0x1fb)],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x173915['message']);}if(!_0x12da83)throw new SDKError(ErrorCode[_0x4aa283(0x1fb)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return _0x12da83+'/'+_0x1088fd;}export class SegmentDescribeCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1b3);[a37_0x21b2dc(0x185)]='Show\x20segment\x20or\x20folder\x20details';async[a37_0x21b2dc(0x176)](_0x230cb0){const _0x2ed816=a37_0x21b2dc,{options:_0x2f319a,args:_0x364e1d,tdx:_0x1a23fb}=_0x230cb0,_0x4b905e=_0x364e1d[0x0],_0x3d8f22=!_0x4b905e&&!!_0x2f319a[_0x2ed816(0x196)],_0x333504=_0x4b905e||_0x2f319a[_0x2ed816(0x196)];if(!_0x333504)return console[_0x2ed816(0x19a)]('Error:\x20Path\x20or\x20name\x20is\x20required'),console[_0x2ed816(0x19a)](_0x2ed816(0x161)),console['error'](_0x2ed816(0x17b)),console[_0x2ed816(0x19a)](_0x2ed816(0x1c0)),console[_0x2ed816(0x19a)](_0x2ed816(0x1bb)),console[_0x2ed816(0x19a)](_0x2ed816(0x1e4)),console[_0x2ed816(0x19a)](_0x2ed816(0x1a7)),0x1;try{const _0x15e6fa=_0x2f319a[_0x2ed816(0x200)];let _0x417bc7=_0x333504;!_0x3d8f22&&_0x15e6fa&&!_0x333504[_0x2ed816(0x1b6)]('/')&&(_0x417bc7=_0x15e6fa+'/'+_0x333504,_0x2f319a['verbose']&&console[_0x2ed816(0x19a)](_0x2ed816(0x16b)+_0x417bc7));const _0x1367a2=await withSpinner(_0x2ed816(0x1f0)+_0x417bc7+_0x2ed816(0x1f5),()=>_0x1a23fb[_0x2ed816(0x1ef)][_0x2ed816(0x1eb)](_0x417bc7),{'verbose':_0x2f319a[_0x2ed816(0x1bd)]}),_0x11fdf8=_0x1367a2['data'];_0x2f319a[_0x2ed816(0x1bd)]&&(console[_0x2ed816(0x19a)](_0x2ed816(0x1d0)+_0x11fdf8['type']),console[_0x2ed816(0x19a)](_0x2ed816(0x1b2)+_0x11fdf8['parentId']),_0x11fdf8[_0x2ed816(0x15c)]&&console['error'](_0x2ed816(0x1ed)+_0x11fdf8[_0x2ed816(0x15c)]),_0x11fdf8['segmentId']&&console[_0x2ed816(0x19a)](_0x2ed816(0x1d1)+_0x11fdf8[_0x2ed816(0x183)]));if(_0x11fdf8[_0x2ed816(0x163)]==='parent'){const _0x3306cf=await withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x1a23fb['segment'][_0x2ed816(0x1ae)](_0x11fdf8[_0x2ed816(0x1ab)]),{'verbose':_0x2f319a['verbose']});await handleSingleObjectOutput(_0x3306cf[_0x2ed816(0x16c)],_0x2f319a);}else{if(_0x11fdf8[_0x2ed816(0x163)]===_0x2ed816(0x1c2)){if(!_0x11fdf8[_0x2ed816(0x15c)])throw new SDKError(ErrorCode[_0x2ed816(0x1ff)],'Folder\x20ID\x20missing\x20from\x20resolved\x20path');const _0x5ac3ab=await withSpinner(_0x2ed816(0x17f),()=>_0x1a23fb[_0x2ed816(0x1ef)][_0x2ed816(0x1a8)](_0x11fdf8[_0x2ed816(0x15c)]),{'verbose':_0x2f319a[_0x2ed816(0x1bd)]});await handleSingleObjectOutput(_0x5ac3ab[_0x2ed816(0x16c)],_0x2f319a);}else{if(_0x11fdf8[_0x2ed816(0x163)]===_0x2ed816(0x1ef)){if(!_0x11fdf8[_0x2ed816(0x183)])throw new SDKError(ErrorCode[_0x2ed816(0x1de)],_0x2ed816(0x1fa));const _0x31d373=await withSpinner(_0x2ed816(0x16f),()=>_0x1a23fb[_0x2ed816(0x1ef)]['getSegment'](_0x11fdf8[_0x2ed816(0x1ab)],_0x11fdf8[_0x2ed816(0x183)]),{'verbose':_0x2f319a[_0x2ed816(0x1bd)]});await handleSingleObjectOutput(_0x31d373['data'],_0x2f319a);}}}return 0x0;}catch(_0x4dde9c){if(_0x4dde9c instanceof SDKError)return console[_0x2ed816(0x19a)](_0x2ed816(0x1e8)+_0x4dde9c[_0x2ed816(0x164)]),_0x4dde9c[_0x2ed816(0x168)]&&console[_0x2ed816(0x19a)](_0x2ed816(0x1ca)+_0x4dde9c[_0x2ed816(0x168)]),0x1;throw _0x4dde9c;}}}function a37_0x3e70(_0x4c4a68,_0x1fca3e){_0x4c4a68=_0x4c4a68-0x159;const _0x153a0c=a37_0x153a();let _0x3e701d=_0x153a0c[_0x4c4a68];return _0x3e701d;}export class SegmentShowCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1db);[a37_0x21b2dc(0x185)]='Execute\x20child\x20segment\x20SQL\x20query\x20and\x20show\x20results';async['execute'](_0x5b67b5){const _0x4a5763=a37_0x21b2dc,{options:_0xc15026,args:_0x3390ff,tdx:_0x51dfa6}=_0x5b67b5,_0x5d14aa=_0x3390ff[0x0];if(!_0x5d14aa)return console[_0x4a5763(0x19a)]('Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required'),console[_0x4a5763(0x19a)](_0x4a5763(0x169)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20show\x20<path/to/segment.yml>'),console[_0x4a5763(0x19a)]('Examples:'),console[_0x4a5763(0x19a)]('\x20\x20tdx\x20sg\x20show\x20\x22Premium\x20Users\x22'),console[_0x4a5763(0x19a)](_0x4a5763(0x1fd)),0x1;try{const _0x48a993=_0xc15026[_0x4a5763(0x196)],_0x5b9b50=await resolveSegmentTarget(_0x5d14aa,_0x48a993,_0xc15026['verbose']);_0xc15026[_0x4a5763(0x1bd)]&&console[_0x4a5763(0x19a)](_0x4a5763(0x1f7)+_0x5b9b50);const _0x53111f=await withSpinner('Resolving\x20\x27'+_0x5d14aa+'\x27...',()=>_0x51dfa6[_0x4a5763(0x1ef)]['resolvePathToResource'](_0x5b9b50),{'verbose':_0xc15026['verbose']}),_0x382b1c=_0x53111f[_0x4a5763(0x16c)];_0xc15026[_0x4a5763(0x1bd)]&&(console[_0x4a5763(0x19a)](_0x4a5763(0x1d0)+_0x382b1c[_0x4a5763(0x163)]),console['error']('Parent\x20ID:\x20'+_0x382b1c[_0x4a5763(0x1ab)]));if(_0x382b1c['type']===_0x4a5763(0x1c2))return console[_0x4a5763(0x19a)]('Error:\x20Cannot\x20execute\x20SQL\x20query\x20on\x20a\x20folder.'),console[_0x4a5763(0x19a)](_0x4a5763(0x1f8)),0x1;if(_0x382b1c[_0x4a5763(0x163)]===_0x4a5763(0x197))return console[_0x4a5763(0x19a)](_0x4a5763(0x171)),console['error'](_0x4a5763(0x189)),0x1;if(!_0x382b1c[_0x4a5763(0x183)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x4d563a=await withSpinner(_0x4a5763(0x170),()=>_0x51dfa6[_0x4a5763(0x1ef)]['getSegmentSQL'](_0x382b1c[_0x4a5763(0x1ab)],_0x382b1c[_0x4a5763(0x183)]),{'verbose':_0xc15026['verbose']});let _0x4aeb92=_0x4d563a['data'];const _0x3b3661=resolveLimit(_0xc15026[_0x4a5763(0x1d9)],DEFAULT_DISPLAY_LIMIT),_0x154655=/\bLIMIT\s+\d+/i[_0x4a5763(0x1cc)](_0x4aeb92);!_0x154655&&(_0x4aeb92=_0x4aeb92[_0x4a5763(0x19e)]()[_0x4a5763(0x182)](/;+$/,''),_0x4aeb92=_0x4a5763(0x1d4)+_0x4aeb92+_0x4a5763(0x19c)+_0x3b3661);_0xc15026[_0x4a5763(0x1bd)]&&console['error'](_0x4a5763(0x15a)+_0x4aeb92);const _0x129ca5=await withProgressSpinner(_0x4a5763(0x1e3),async _0x20b646=>{const _0x6e2d4e=_0x4a5763,_0x28727f=await _0x51dfa6[_0x6e2d4e(0x1bc)]['execute'](_0x4aeb92,{'catalog':'td','schema':_0x6e2d4e(0x162),'onJobId':_0x6cb1c7=>{const _0x364821=_0x6e2d4e;_0x20b646[_0x364821(0x1fe)](_0x6cb1c7);}});return _0x28727f;},{'verbose':_0xc15026[_0x4a5763(0x1bd)]}),_0x5a8740=_0x129ca5[_0x4a5763(0x16c)],_0x1e67bf=_0x5a8740[_0x4a5763(0x1df)]?_0x4a5763(0x1f2)+_0x5a8740['jobId']+']':'';return console[_0x4a5763(0x19a)](_0x4a5763(0x191)+_0x5a8740[_0x4a5763(0x15b)]['processedRows'][_0x4a5763(0x18f)]()+_0x4a5763(0x1e0)+(_0x4a5763(0x1c1)+formatElapsed(_0x5a8740[_0x4a5763(0x15b)][_0x4a5763(0x201)])+_0x1e67bf)),await handleQueryOutput(_0x5a8740,_0xc15026),0x0;}catch(_0x4b14ab){if(_0x4b14ab instanceof SDKError)return console['error'](_0x4a5763(0x1b0)+_0x4b14ab[_0x4a5763(0x180)]+']'),console[_0x4a5763(0x19a)]('\x0a'+_0x4b14ab[_0x4a5763(0x164)]),0x1;throw _0x4b14ab;}}}export class SegmentFolderListCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1d2);[a37_0x21b2dc(0x185)]='List\x20segment\x20folders\x20under\x20a\x20parent\x20segment';async[a37_0x21b2dc(0x176)](_0x5c0398){const _0x2d5468=a37_0x21b2dc,{options:_0x450b26,args:_0x62f1b2,tdx:_0x204abc}=_0x5c0398;if(_0x62f1b2[_0x2d5468(0x1c9)]===0x0)return console['error']('Error:\x20Parent\x20segment\x20name\x20is\x20required'),console['error']('Usage:\x20tdx\x20segment\x20folder\x20list\x20<parent_name>'),0x1;const _0x56d8e8=_0x62f1b2[0x0];try{_0x450b26[_0x2d5468(0x1bd)]&&(console[_0x2d5468(0x19a)](_0x2d5468(0x1a2)+_0x450b26[_0x2d5468(0x192)]),console['error'](_0x2d5468(0x19d)+_0x56d8e8));const _0x51551e=await withSpinner(_0x2d5468(0x1aa)+_0x56d8e8+_0x2d5468(0x1f5),()=>_0x204abc[_0x2d5468(0x1ef)][_0x2d5468(0x186)](_0x56d8e8),{'verbose':_0x450b26[_0x2d5468(0x1bd)]}),_0x5b18ad=_0x51551e[_0x2d5468(0x16c)];_0x450b26['verbose']&&console[_0x2d5468(0x19a)](_0x2d5468(0x190)+_0x5b18ad);const _0x5d83ed=await withSpinner(_0x2d5468(0x165)+_0x56d8e8+_0x2d5468(0x1f5),()=>_0x204abc[_0x2d5468(0x1ef)][_0x2d5468(0x1c5)](_0x5b18ad),{'verbose':_0x450b26[_0x2d5468(0x1bd)]}),_0x3e63ab=_0x5d83ed['data'];return console['error'](_0x2d5468(0x16e)+_0x3e63ab[_0x2d5468(0x1c9)]+_0x2d5468(0x1b9)+(_0x3e63ab[_0x2d5468(0x1c9)]!==0x1?'s':'')),await handleSDKOutput(_0x3e63ab,_0x450b26),0x0;}catch(_0x1b49fb){if(_0x1b49fb instanceof SDKError)return console[_0x2d5468(0x19a)](_0x2d5468(0x1e8)+_0x1b49fb[_0x2d5468(0x164)]),_0x1b49fb[_0x2d5468(0x168)]&&console[_0x2d5468(0x19a)]('\x20\x20Cause:\x20'+_0x1b49fb[_0x2d5468(0x168)]),0x1;throw _0x1b49fb;}}}export class SegmentFolderShowCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1f9);[a37_0x21b2dc(0x185)]=a37_0x21b2dc(0x193);async[a37_0x21b2dc(0x176)](_0x33f3e1){const _0x2add3e=a37_0x21b2dc,{options:_0x5a13fb,args:_0x257edc,tdx:_0x164438}=_0x33f3e1;if(_0x257edc['length']===0x0)return console[_0x2add3e(0x19a)](_0x2add3e(0x1f4)),console['error'](_0x2add3e(0x1cd)),0x1;try{const {parentId:_0x2657ea,childId:_0x2a21de}=parseSegmentRef(_0x257edc[0x0]);_0x5a13fb[_0x2add3e(0x1bd)]&&(console[_0x2add3e(0x19a)](_0x2add3e(0x1a2)+_0x5a13fb['site']),console[_0x2add3e(0x19a)](_0x2add3e(0x19d)+_0x2657ea),_0x2a21de&&console['error']('Folder\x20name:\x20'+_0x2a21de));if(!_0x2a21de)return console['error'](_0x2add3e(0x1c6)),0x1;const _0x121e6e=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x2657ea+_0x2add3e(0x1f5),()=>_0x164438[_0x2add3e(0x1ef)][_0x2add3e(0x186)](_0x2657ea),{'verbose':_0x5a13fb[_0x2add3e(0x1bd)]}),_0x440811=_0x121e6e['data'];_0x5a13fb['verbose']&&console[_0x2add3e(0x19a)](_0x2add3e(0x190)+_0x440811);const _0x163984=await withSpinner(_0x2add3e(0x179)+_0x2a21de+_0x2add3e(0x1f5),()=>_0x164438['segment'][_0x2add3e(0x1a1)](_0x440811,_0x2a21de),{'verbose':_0x5a13fb[_0x2add3e(0x1bd)]}),_0x5195f8=_0x163984[_0x2add3e(0x16c)];_0x5a13fb[_0x2add3e(0x1bd)]&&console[_0x2add3e(0x19a)]('Resolved\x20folder\x20ID:\x20'+_0x5195f8);const _0x5caae9=await withSpinner(_0x2add3e(0x1d7)+_0x2a21de+_0x2add3e(0x1f5),()=>_0x164438[_0x2add3e(0x1ef)]['getFolder'](_0x5195f8),{'verbose':_0x5a13fb[_0x2add3e(0x1bd)]});return await handleSDKOutput([_0x5caae9[_0x2add3e(0x16c)]],_0x5a13fb),0x0;}catch(_0x1533f6){if(_0x1533f6 instanceof SDKError)return console[_0x2add3e(0x19a)](_0x2add3e(0x1e8)+_0x1533f6[_0x2add3e(0x164)]),_0x1533f6[_0x2add3e(0x168)]&&console[_0x2add3e(0x19a)](_0x2add3e(0x1ca)+_0x1533f6[_0x2add3e(0x168)]),0x1;throw _0x1533f6;}}}export class SegmentSQLCommand extends BaseCommand{['name']=a37_0x21b2dc(0x187);['description']=a37_0x21b2dc(0x1ba);async[a37_0x21b2dc(0x176)](_0x3eb250){const _0x3cfe40=a37_0x21b2dc,{options:_0x50af30,args:_0x53eb6d}=_0x3eb250,_0x530cf6=_0x50af30,_0x2f7cec=_0x530cf6['path'],_0x23917b=_0x53eb6d[0x0];if(!_0x23917b&&!_0x2f7cec)return console[_0x3cfe40(0x19a)](a37_0x5e0d32[_0x3cfe40(0x1a5)](_0x3cfe40(0x1da))),console[_0x3cfe40(0x19a)](_0x3cfe40(0x181)),console[_0x3cfe40(0x19a)](_0x3cfe40(0x167)),console['error']('\x20\x20Local\x20YAML\x20file:\x20\x20\x20\x20\x20\x20tdx\x20sg\x20sql\x20--path\x20<file-path>'),console[_0x3cfe40(0x19a)](_0x3cfe40(0x17b)),console[_0x3cfe40(0x19a)](_0x3cfe40(0x15d)),console[_0x3cfe40(0x19a)](_0x3cfe40(0x17e)),0x1;if(_0x23917b&&_0x2f7cec)return console[_0x3cfe40(0x19a)](a37_0x5e0d32['red'](_0x3cfe40(0x160))),0x1;try{let _0x2f4ac2;if(_0x2f7cec)_0x2f4ac2=await this[_0x3cfe40(0x1fc)](_0x2f7cec,_0x3eb250);else{if(isYamlFilePath(_0x23917b))return console[_0x3cfe40(0x19a)](a37_0x5e0d32[_0x3cfe40(0x1a5)](_0x3cfe40(0x1f6))),console['error'](_0x3cfe40(0x177)+_0x23917b),0x1;else _0x2f4ac2=await this[_0x3cfe40(0x1a3)](_0x23917b,_0x3eb250);}return _0x50af30[_0x3cfe40(0x1af)]===_0x3cfe40(0x1cf)||_0x50af30[_0x3cfe40(0x1af)]==='jsonl'?await handleSDKOutput([{'sql':_0x2f4ac2}],_0x50af30):console[_0x3cfe40(0x18a)](_0x2f4ac2),0x0;}catch(_0x1661a3){if(_0x1661a3 instanceof SDKError)return console['error'](_0x3cfe40(0x1e8)+_0x1661a3[_0x3cfe40(0x164)]),_0x1661a3['cause']&&console[_0x3cfe40(0x19a)]('\x20\x20Cause:\x20'+_0x1661a3[_0x3cfe40(0x168)]),0x1;throw _0x1661a3;}}async[a37_0x21b2dc(0x1fc)](_0x48ffe1,_0x827fbe){const _0x12af37=a37_0x21b2dc,{options:_0x170931,tdx:_0x52be96}=_0x827fbe;let _0x172091;try{_0x172091=await resolveYamlFilePath(_0x48ffe1);}catch(_0x5cedd3){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x12af37(0x18d)+_0x5cedd3[_0x12af37(0x164)]);}_0x170931[_0x12af37(0x1bd)]&&console[_0x12af37(0x19a)](_0x12af37(0x1cb)+_0x172091['parentSegment']+'/'+_0x172091[_0x12af37(0x1a6)]);const _0x5e70a2=await withSpinner('Fetching\x20SQL\x20from\x20rule...',()=>_0x52be96[_0x12af37(0x1ef)][_0x12af37(0x1ad)](_0x172091['content'],_0x172091[_0x12af37(0x196)],_0x172091[_0x12af37(0x1a6)]),{'verbose':_0x170931[_0x12af37(0x1bd)]});return _0x5e70a2[_0x12af37(0x16c)];}async['getSQLFromServerSegment'](_0x2a4c51,_0x56a2b9){const _0x424212=a37_0x21b2dc,{options:_0x1e48b3,tdx:_0xd3371b}=_0x56a2b9,_0x5f84a=_0x1e48b3['parentSegment'],_0x45d5cd=await resolveSegmentTarget(_0x2a4c51,_0x5f84a,_0x1e48b3[_0x424212(0x1bd)]);_0x1e48b3['verbose']&&console['error'](_0x424212(0x1f7)+_0x45d5cd);const _0x45447c=await withSpinner(_0x424212(0x16d)+_0x2a4c51+_0x424212(0x1f5),()=>_0xd3371b[_0x424212(0x1ef)][_0x424212(0x1eb)](_0x45d5cd),{'verbose':_0x1e48b3[_0x424212(0x1bd)]}),_0x525067=_0x45447c[_0x424212(0x16c)];_0x1e48b3[_0x424212(0x1bd)]&&(console[_0x424212(0x19a)](_0x424212(0x1d0)+_0x525067['type']),console[_0x424212(0x19a)](_0x424212(0x1b2)+_0x525067['parentId']));if(_0x525067[_0x424212(0x163)]===_0x424212(0x1c2))throw new SDKError(ErrorCode[_0x424212(0x1fb)],_0x424212(0x1c7));if(_0x525067[_0x424212(0x163)]===_0x424212(0x197))throw new SDKError(ErrorCode[_0x424212(0x1fb)],'Cannot\x20get\x20SQL\x20for\x20parent\x20segment\x20with\x20this\x20command.\x20Use:\x20tdx\x20ps\x20sql');if(!_0x525067['segmentId'])throw new SDKError(ErrorCode[_0x424212(0x1de)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x39f246=await withSpinner(_0x424212(0x170),()=>_0xd3371b[_0x424212(0x1ef)][_0x424212(0x1a4)](_0x525067[_0x424212(0x1ab)],_0x525067['segmentId']),{'verbose':_0x1e48b3[_0x424212(0x1bd)]});return _0x39f246['data'];}}export class SegmentFolderCreateCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x195);['description']=a37_0x21b2dc(0x1d6);async[a37_0x21b2dc(0x176)](_0x4ede91){const _0x348bf8=a37_0x21b2dc,{options:_0x52562a,args:_0x3db5c3,tdx:_0x45cf4e}=_0x4ede91,_0x155d5f=_0x52562a;if(_0x3db5c3[_0x348bf8(0x1c9)]<0x2)return console[_0x348bf8(0x19a)](_0x348bf8(0x17a)),console['error']('Usage:\x20tdx\x20segment\x20folder\x20create\x20<parent_name>\x20<folder_name>\x20[options]'),0x1;const _0x179fff=_0x3db5c3[0x0],_0xdec9b=_0x3db5c3[0x1];_0x155d5f[_0x348bf8(0x1bd)]&&(console['error'](_0x348bf8(0x1a2)+_0x155d5f['site']),console['error'](_0x348bf8(0x19b)+_0x179fff),console[_0x348bf8(0x19a)](_0x348bf8(0x175)+_0xdec9b));let _0x288a86;if(_0x155d5f['parentFolder']){const _0x30650a=_0x155d5f[_0x348bf8(0x1a0)],_0x20fb4f=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x179fff+_0x348bf8(0x1f5),()=>_0x45cf4e['segment']['resolveParentId'](_0x179fff),{'verbose':_0x155d5f[_0x348bf8(0x1bd)]}),_0xb3383=_0x20fb4f[_0x348bf8(0x16c)],_0x172d8a=await withSpinner(_0x348bf8(0x1a9)+_0x30650a+_0x348bf8(0x1f5),()=>_0x45cf4e[_0x348bf8(0x1ef)]['resolveFolderId'](_0xb3383,_0x30650a),{'verbose':_0x155d5f[_0x348bf8(0x1bd)]});_0x288a86=_0x172d8a[_0x348bf8(0x16c)],_0x155d5f[_0x348bf8(0x1bd)]&&console[_0x348bf8(0x19a)](_0x348bf8(0x1dd)+_0x288a86);}const _0x2a77a0={'name':_0xdec9b,'description':_0x155d5f[_0x348bf8(0x185)],'parentFolderId':_0x288a86},_0x208748=await withSpinner(_0x348bf8(0x15e)+_0xdec9b+_0x348bf8(0x1f5),()=>_0x45cf4e[_0x348bf8(0x1ef)]['createFolder'](_0x179fff,_0x2a77a0),{'verbose':_0x155d5f[_0x348bf8(0x1bd)]}),_0x5828ea=_0x208748[_0x348bf8(0x16c)];return console[_0x348bf8(0x19a)]('✔\x20Created\x20folder\x20\x27'+_0x5828ea[_0x348bf8(0x173)]+_0x348bf8(0x1e9)+_0x5828ea['id']),await handleSDKOutput([_0x5828ea],_0x155d5f),0x0;}}export class SegmentViewCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1f1);[a37_0x21b2dc(0x185)]='Show\x20folder\x20or\x20child\x20segment\x20details';async['execute'](_0x143f77){const _0x1a1f22=a37_0x21b2dc,{options:_0xaa8aa5,args:_0xd757b3,tdx:_0x1801a5}=_0x143f77,_0x22757a=_0xd757b3[0x0];if(!_0x22757a)return console[_0x1a1f22(0x19a)](_0x1a1f22(0x17c)),console[_0x1a1f22(0x19a)](_0x1a1f22(0x1ee)),console[_0x1a1f22(0x19a)](_0x1a1f22(0x1dc)),console['error'](_0x1a1f22(0x194)),console[_0x1a1f22(0x19a)](_0x1a1f22(0x1b8)),console[_0x1a1f22(0x19a)](_0x1a1f22(0x17b)),console[_0x1a1f22(0x19a)]('\x20\x20tdx\x20sg\x20view\x20\x22Marketing\x22\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20View\x20folder\x20details'),console[_0x1a1f22(0x19a)](_0x1a1f22(0x1bf)),console['error'](_0x1a1f22(0x18b)),console[_0x1a1f22(0x19a)]('\x20\x20tdx\x20sg\x20view\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x2509e2=_0xaa8aa5[_0x1a1f22(0x196)],_0x1dda1f=await resolveSegmentTarget(_0x22757a,_0x2509e2,_0xaa8aa5[_0x1a1f22(0x1bd)]);_0xaa8aa5[_0x1a1f22(0x1bd)]&&console[_0x1a1f22(0x19a)](_0x1a1f22(0x1f7)+_0x1dda1f);const _0x15c031=await withSpinner(_0x1a1f22(0x16d)+_0x22757a+_0x1a1f22(0x1f5),()=>_0x1801a5['segment'][_0x1a1f22(0x1eb)](_0x1dda1f),{'verbose':_0xaa8aa5[_0x1a1f22(0x1bd)]}),_0x2ecb9e=_0x15c031[_0x1a1f22(0x16c)];_0xaa8aa5[_0x1a1f22(0x1bd)]&&(console['error']('Resolved\x20type:\x20'+_0x2ecb9e[_0x1a1f22(0x163)]),console[_0x1a1f22(0x19a)](_0x1a1f22(0x1b2)+_0x2ecb9e['parentId']),_0x2ecb9e['folderId']&&console[_0x1a1f22(0x19a)](_0x1a1f22(0x1ed)+_0x2ecb9e[_0x1a1f22(0x15c)]),_0x2ecb9e[_0x1a1f22(0x183)]&&console[_0x1a1f22(0x19a)]('Segment\x20ID:\x20'+_0x2ecb9e[_0x1a1f22(0x183)]));if(_0xaa8aa5[_0x1a1f22(0x1b7)]){if(_0x2ecb9e[_0x1a1f22(0x163)]==='folder')return console['error'](_0x1a1f22(0x1c4)),0x1;if(_0x2ecb9e[_0x1a1f22(0x163)]===_0x1a1f22(0x197))return console[_0x1a1f22(0x19a)](_0x1a1f22(0x1f3)),console['error'](_0x1a1f22(0x1d5)),0x1;if(!_0x2ecb9e['segmentId'])throw new SDKError(ErrorCode[_0x1a1f22(0x1de)],_0x1a1f22(0x1fa));const _0x5ecc7c=getConsoleNextUrl(_0xaa8aa5[_0x1a1f22(0x192)],_0x1a1f22(0x1ac)+_0x2ecb9e[_0x1a1f22(0x1ab)]+_0x1a1f22(0x1d3)+_0x2ecb9e[_0x1a1f22(0x183)]);return console[_0x1a1f22(0x19a)](a37_0x5e0d32['green']('✔')+_0x1a1f22(0x18e)+a37_0x5e0d32['cyan'](_0x5ecc7c)),openBrowser(_0x5ecc7c),0x0;}if(_0x2ecb9e[_0x1a1f22(0x163)]===_0x1a1f22(0x1c2)){if(!_0x2ecb9e[_0x1a1f22(0x15c)])throw new SDKError(ErrorCode[_0x1a1f22(0x1ff)],_0x1a1f22(0x1d8));const _0xa0dac2=await withSpinner('Fetching\x20folder\x20details...',()=>_0x1801a5['segment'][_0x1a1f22(0x1a8)](_0x2ecb9e[_0x1a1f22(0x15c)]),{'verbose':_0xaa8aa5['verbose']});await handleSingleObjectOutput(_0xa0dac2[_0x1a1f22(0x16c)],_0xaa8aa5);}else{if(_0x2ecb9e[_0x1a1f22(0x163)]===_0x1a1f22(0x1ef)){if(!_0x2ecb9e[_0x1a1f22(0x183)])throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x1a1f22(0x1fa));const _0x407ef5=await withSpinner('Fetching\x20segment\x20details...',()=>_0x1801a5[_0x1a1f22(0x1ef)][_0x1a1f22(0x1b1)](_0x2ecb9e[_0x1a1f22(0x1ab)],_0x2ecb9e['segmentId']),{'verbose':_0xaa8aa5[_0x1a1f22(0x1bd)]}),_0x451630=getConsoleNextUrl(_0xaa8aa5[_0x1a1f22(0x192)],_0x1a1f22(0x1ac)+_0x2ecb9e[_0x1a1f22(0x1ab)]+'/e/'+_0x2ecb9e[_0x1a1f22(0x183)]),_0x2098bb=_0x407ef5[_0x1a1f22(0x16c)];_0x2098bb[_0x1a1f22(0x178)]=_0x451630,await handleSingleObjectOutput(_0x2098bb,_0xaa8aa5);}else return console[_0x1a1f22(0x19a)](_0x1a1f22(0x198)),console[_0x1a1f22(0x19a)](_0x1a1f22(0x166)),0x1;}return 0x0;}catch(_0xf2cb20){if(_0xf2cb20 instanceof SDKError)return console['error']('Error:\x20'+_0xf2cb20[_0x1a1f22(0x164)]),_0xf2cb20['cause']&&console[_0x1a1f22(0x19a)](_0x1a1f22(0x1ca)+_0xf2cb20['cause']),0x1;throw _0xf2cb20;}}}export const SegmentInfoCommand=SegmentViewCommand;export class SegmentDescCommand extends BaseCommand{[a37_0x21b2dc(0x173)]=a37_0x21b2dc(0x1be);['description']=a37_0x21b2dc(0x1ec);async[a37_0x21b2dc(0x176)](_0x1f773e){const _0x589686=a37_0x21b2dc,{options:_0x138f9f,args:_0x4af93d,tdx:_0x2ff124}=_0x1f773e,_0x582488=_0x4af93d[0x0];if(!_0x582488)return console['error'](_0x589686(0x1b4)),console[_0x589686(0x19a)]('Usage:\x20tdx\x20sg\x20desc\x20<name>'),console['error'](_0x589686(0x1e1)),console['error']('Examples:'),console[_0x589686(0x19a)]('\x20\x20tdx\x20sg\x20desc\x20\x22Premium\x20Users\x22'),console[_0x589686(0x19a)]('\x20\x20tdx\x20sg\x20desc\x20segments/my-audience/premium-users.yml'),0x1;try{const _0x5d7aa8=_0x138f9f['parentSegment'],_0x57507a=await resolveSegmentTarget(_0x582488,_0x5d7aa8,_0x138f9f[_0x589686(0x1bd)]);_0x138f9f['verbose']&&console['error'](_0x589686(0x1f7)+_0x57507a);const _0x5b59b0=await withSpinner(_0x589686(0x16d)+_0x582488+'\x27...',()=>_0x2ff124[_0x589686(0x1ef)][_0x589686(0x1eb)](_0x57507a),{'verbose':_0x138f9f[_0x589686(0x1bd)]}),_0x4c2230=_0x5b59b0['data'];_0x138f9f[_0x589686(0x1bd)]&&(console[_0x589686(0x19a)](_0x589686(0x1d0)+_0x4c2230['type']),console[_0x589686(0x19a)]('Parent\x20ID:\x20'+_0x4c2230[_0x589686(0x1ab)]));if(_0x4c2230['type']===_0x589686(0x1c2))return console['error'](_0x589686(0x1c8)),console[_0x589686(0x19a)](_0x589686(0x1b5)),0x1;if(_0x4c2230[_0x589686(0x163)]===_0x589686(0x197))return console[_0x589686(0x19a)]('Error:\x20Cannot\x20show\x20schema\x20for\x20parent\x20segment\x20with\x20this\x20command.'),console[_0x589686(0x19a)](_0x589686(0x1e5)),0x1;if(!_0x4c2230[_0x589686(0x183)])throw new SDKError(ErrorCode[_0x589686(0x1de)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x1a8015=await withSpinner(_0x589686(0x170),()=>_0x2ff124[_0x589686(0x1ef)]['getSegmentSQL'](_0x4c2230['parentId'],_0x4c2230['segmentId']),{'verbose':_0x138f9f['verbose']}),_0x53e96b=_0x1a8015[_0x589686(0x16c)],_0x39bfe5=await executeSchemaQuery(_0x53e96b,_0x2ff124,_0x138f9f);return await handleQueryOutput(_0x39bfe5,_0x138f9f),0x0;}catch(_0x1a0c70){if(_0x1a0c70 instanceof SDKError)return console[_0x589686(0x19a)](_0x589686(0x1e8)+_0x1a0c70[_0x589686(0x164)]),_0x1a0c70['cause']&&console[_0x589686(0x19a)](_0x589686(0x1ca)+_0x1a0c70[_0x589686(0x168)]),0x1;throw _0x1a0c70;}}}function a37_0x153a(){const _0x214fe9=['/e/','SELECT\x20*\x20FROM\x20(\x0a','Use:\x20tdx\x20ps\x20view\x20-w','Create\x20segment\x20folder\x20for\x20organization','Fetching\x20folder\x20\x27','Folder\x20ID\x20missing\x20from\x20resolved\x20path','limit','Error:\x20Segment\x20name\x20or\x20--path\x20is\x20required','segment:show','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20view\x20<path/to/segment.yml>','Resolved\x20parent\x20folder\x20ID:\x20','SEGMENT_NOT_FOUND','jobId','\x20rows\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20desc\x20<path/to/segment.yml>','2180757aSCbQP','Executing\x20segment\x20query...','\x20\x20tdx\x20segment\x20describe\x20\x22High\x20Value\x22\x20\x20\x20\x20#\x20Relative\x20to\x20current\x20context','Use:\x20tdx\x20ps\x20desc','\x20\x20Folder\x20path:\x20','12968NKdCTa','Error:\x20','\x27\x20with\x20ID:\x20','\x20\x20Parent\x20segment:\x20','resolvePathToResource','Show\x20child\x20segment\x20schema\x20(column\x20types)','Folder\x20ID:\x20','Usage:\x20tdx\x20sg\x20view\x20<name>\x20[-w]','segment','Resolving\x20path\x20\x27','segment:view','\x20[Job\x20ID:\x20','Error:\x20Cannot\x20open\x20parent\x20segment\x20with\x20this\x20command.','Error:\x20Folder\x20reference\x20is\x20required','\x27...','Error:\x20YAML\x20file\x20paths\x20must\x20be\x20specified\x20with\x20--path\x20option','Target\x20path:\x20','Use:\x20tdx\x20sg\x20view\x20<name>\x20\x20#\x20To\x20show\x20folder\x20details','segment:folder:show','Segment\x20ID\x20missing\x20from\x20resolved\x20path','INVALID_ARGUMENT','getSQLFromYamlFile','\x20\x20tdx\x20sg\x20show\x20segments/my-audience/premium-users.yml','setJobId','SEGMENT_FOLDER_NOT_FOUND','segmentPath','elapsedTimeMillis','(root)','SQL\x20query:\x0a','stats','folderId','\x20\x20tdx\x20sg\x20sql\x20\x22Premium\x20Users\x22','Creating\x20folder\x20\x27','\x20\x20Segment\x20name:\x20','Error:\x20Specify\x20either\x20segment\x20name\x20or\x20--path,\x20not\x20both','Usage:\x20tdx\x20segment\x20describe\x20<path>','information_schema','type','message','Listing\x20folders\x20for\x20parent\x20\x27','Use:\x20tdx\x20ps\x20view','\x20\x20Server-side\x20segment:\x20\x20tdx\x20sg\x20sql\x20<name>','cause','Usage:\x20tdx\x20sg\x20show\x20<name>','8lVjQXj','Resolved\x20relative\x20path\x20to:\x20','data','Resolving\x20\x27','✔\x20Found\x20','Fetching\x20segment\x20details...','Fetching\x20SQL\x20for\x20segment...','Error:\x20Cannot\x20execute\x20query\x20for\x20parent\x20segment\x20with\x20this\x20command.','4058488wiZCpv','name','3507504Okzams','Folder\x20name:\x20','execute','\x20\x20tdx\x20sg\x20sql\x20--path\x20','url','Resolving\x20folder\x20\x27','Error:\x20Parent\x20segment\x20name\x20and\x20folder\x20name\x20are\x20required','Examples:','Error:\x20Folder\x20or\x20segment\x20name,\x20or\x20YAML\x20file\x20path\x20is\x20required','folderPath','\x20\x20tdx\x20sg\x20sql\x20--path\x20segments/my-audience/premium-users.yml','Fetching\x20folder\x20details...','code','Usage:','replace','segmentId','4508755nTGBKu','description','resolveParentId','segment:sql','fullPath','Use:\x20tdx\x20ps\x20show','log','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20-w\x20\x20#\x20Open\x20segment\x20in\x20web\x20browser','226sdvSqF','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','\x20Opening\x20','toLocaleString','Resolved\x20parent\x20ID:\x20','✔\x20Query\x20completed:\x20Processed\x20','site','Show\x20segment\x20folder\x20details','Options:','segment:folder:create','parentSegment','parent','Error:\x20Cannot\x20view\x20parent\x20segment\x20details\x20with\x20this\x20command.','8339868vPJIyv','error','Parent\x20segment:\x20','\x0a)\x20AS\x20segment_query\x0aLIMIT\x20','Parent\x20name:\x20','trim','\x20\x20Full\x20path:\x20','parentFolder','resolveFolderId','Site:\x20','getSQLFromServerSegment','getSegmentSQL','red','segmentName','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','getFolder','Resolving\x20parent\x20folder\x20\x27','Resolving\x20parent\x20segment\x20\x27','parentId','/app/ps/','getSegmentSQLFromYaml','getParent','format','✖\x20Query\x20failed\x20[','getSegment','Parent\x20ID:\x20','segment:describe','Error:\x20Child\x20segment\x20name\x20or\x20YAML\x20file\x20path\x20is\x20required','Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','includes','web','\x20\x20-w,\x20--web\x20\x20Open\x20segment\x20in\x20web\x20browser','\x20folder','Get\x20SQL\x20query\x20for\x20child\x20segment','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience/Marketing/High\x20Value\x22','query','verbose','segment:desc','\x20\x20tdx\x20sg\x20view\x20\x22Premium\x20Users\x22\x20\x20\x20\x20\x20#\x20View\x20child\x20segment\x20details','\x20\x20tdx\x20segment\x20describe\x20\x22My\x20Audience\x22','in\x20','folder','Resolved\x20YAML\x20file:\x20','Error:\x20Cannot\x20open\x20folder\x20in\x20web\x20browser.\x20Use\x20a\x20segment\x20name\x20instead.','listFolders','Error:\x20Folder\x20name\x20is\x20required\x20(use\x20parent_name/folder_name\x20format)','Cannot\x20get\x20SQL\x20query\x20for\x20a\x20folder.\x20Folders\x20are\x20organizational\x20containers,\x20not\x20queryable\x20segments.','Error:\x20Cannot\x20show\x20schema\x20for\x20a\x20folder.','length','\x20\x20Cause:\x20','Resolved:\x20','test','Usage:\x20tdx\x20segment\x20folder\x20show\x20<parent_name/folder_name>','22645827tCqNMY','json','Resolved\x20type:\x20','Segment\x20ID:\x20','segment:folder:list'];a37_0x153a=function(){return _0x214fe9;};return a37_0x153a();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x68a3f4=a38_0x419e;(function(_0x24566f,_0xdf87eb){const _0x43c2c5=a38_0x419e,_0xd03cc0=_0x24566f();while(!![]){try{const _0x28d8c1=-parseInt(_0x43c2c5(0x106))/0x1+-parseInt(_0x43c2c5(0xfb))/0x2*(parseInt(_0x43c2c5(0xfe))/0x3)+-parseInt(_0x43c2c5(0x119))/0x4+parseInt(_0x43c2c5(0x110))/0x5+parseInt(_0x43c2c5(0x123))/0x6+-parseInt(_0x43c2c5(0x10a))/0x7*(-parseInt(_0x43c2c5(0x115))/0x8)+parseInt(_0x43c2c5(0x121))/0x9;if(_0x28d8c1===_0xdf87eb)break;else _0xd03cc0['push'](_0xd03cc0['shift']());}catch(_0x1abdf8){_0xd03cc0['push'](_0xd03cc0['shift']());}}}(a38_0x49a9,0x8b553));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';function a38_0x419e(_0x4a6a63,_0x3aa1e0){_0x4a6a63=_0x4a6a63-0xfb;const _0x49a9e0=a38_0x49a9();let _0x419ea1=_0x49a9e0[_0x4a6a63];return _0x419ea1;}function a38_0x49a9(){const _0x36308c=['3571390eDjFmV','length','type','data','yellow','2808xTlMWa','Target\x20path:\x20','Parent\x20path:\x20','Site:\x20','3718208azIIRB','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Error:\x20Cannot\x20create\x20segment\x20in\x20a\x20segment.\x20Parent\x20path\x20must\x20be\x20a\x20folder\x20or\x20parent.','segment','Usage:\x20tdx\x20segment\x20create\x20<parent/segment_name>\x20[options]','ruleFile','error','14584302CodGAL','invisible','3395070WQtHhF','execute','parent','segmentPath','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/Marketing/Premium\x22\x20--rule\x20\x27...\x27','site','description','34EVKYbO','\x27...','Creating\x20segment\x20\x27','74859IKJBti','Examples:','\x20\x20tdx\x20segment\x20create\x20\x22My\x20Audience/High\x20Value\x22\x20--rule\x20\x27...\x27','Create\x20child\x20segment\x20with\x20filtering\x20rules','Parent:\x20','verbose','name','kind','1003870ipkRyh','folder','resolveFolderId','includes','553LdbLJR','Usage:\x20tdx\x20segment\x20create\x20<path>\x20[options]','segments','Error:\x20Full\x20path\x20required\x20(parent/segment_name\x20or\x20parent/folder/segment_name)','Resolving\x20folder\x20path\x20\x27','folderId'];a38_0x49a9=function(){return _0x36308c;};return a38_0x49a9();}import{parsePath,getParentPath,getBaseName}from'../sdk/segment/segment-path-parser.js';import a38_0x252d7b from'chalk';export class SegmentCreateCommand extends BaseCommand{[a38_0x68a3f4(0x104)]='segment:create';[a38_0x68a3f4(0x129)]=a38_0x68a3f4(0x101);async[a38_0x68a3f4(0x124)](_0x20fe00){const _0x494446=a38_0x68a3f4;console[_0x494446(0x120)](a38_0x252d7b[_0x494446(0x114)]('⚠\x20Deprecation\x20warning:\x20`segment\x20create`\x20is\x20deprecated.')),console[_0x494446(0x120)](a38_0x252d7b[_0x494446(0x114)](_0x494446(0x11b)));const {options:_0x575a63,args:_0x4e782d,tdx:_0x476732}=_0x20fe00,_0x53c736=_0x575a63;if(_0x4e782d[_0x494446(0x111)]===0x0)return console[_0x494446(0x120)](_0x494446(0x11a)),console[_0x494446(0x120)](_0x494446(0x10b)),console[_0x494446(0x120)](_0x494446(0xff)),console[_0x494446(0x120)](_0x494446(0x100)),console[_0x494446(0x120)](_0x494446(0x127)),console[_0x494446(0x120)]('\x20\x20tdx\x20segment\x20create\x20\x22Premium\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x32cde6=_0x4e782d[0x0],_0x403653=_0x575a63[_0x494446(0x126)];let _0x11ad5c=_0x32cde6;_0x403653&&!_0x32cde6[_0x494446(0x109)]('/')&&(_0x11ad5c=_0x403653+'/'+_0x32cde6,_0x53c736[_0x494446(0x103)]&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x11ad5c));const _0x2e204d=parsePath(_0x11ad5c);if(_0x2e204d[_0x494446(0x10c)][_0x494446(0x111)]<0x2)return console[_0x494446(0x120)](_0x494446(0x10d)),console[_0x494446(0x120)](_0x494446(0x11e)),0x1;const _0x5ba859=_0x2e204d[_0x494446(0x10c)][0x0],_0xfea0e4=getBaseName(_0x11ad5c),_0x5db791=getParentPath(_0x11ad5c);_0x53c736[_0x494446(0x103)]&&(console[_0x494446(0x120)](_0x494446(0x118)+_0x53c736[_0x494446(0x128)]),console[_0x494446(0x120)](_0x494446(0x116)+_0x11ad5c),console[_0x494446(0x120)](_0x494446(0x102)+_0x5ba859),console[_0x494446(0x120)]('Segment\x20name:\x20'+_0xfea0e4),console[_0x494446(0x120)](_0x494446(0x117)+_0x5db791));const _0x3669c5=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x5ba859+_0x494446(0xfc),()=>_0x476732[_0x494446(0x11d)]['resolveParentId'](_0x5ba859),{'verbose':_0x53c736[_0x494446(0x103)]}),_0x4d0d28=_0x3669c5[_0x494446(0x113)];let _0x8c704b;if(_0x2e204d[_0x494446(0x10c)][_0x494446(0x111)]>0x2){const _0x527c02=await withSpinner(_0x494446(0x10e)+_0x5db791+_0x494446(0xfc),()=>_0x476732[_0x494446(0x11d)]['resolvePathToResource'](_0x5db791),{'verbose':_0x53c736[_0x494446(0x103)]}),_0x233613=_0x527c02[_0x494446(0x113)];if(_0x233613['type']!==_0x494446(0x107)&&_0x233613[_0x494446(0x112)]!==_0x494446(0x125))return console[_0x494446(0x120)](_0x494446(0x11c)),0x1;_0x8c704b=_0x233613[_0x494446(0x10f)];}else{if(_0x53c736[_0x494446(0x107)]){const _0x13b3a9=await withSpinner('Resolving\x20folder\x20\x27'+_0x53c736['folder']+_0x494446(0xfc),()=>_0x476732[_0x494446(0x11d)][_0x494446(0x108)](_0x4d0d28,_0x53c736[_0x494446(0x107)]),{'verbose':_0x53c736[_0x494446(0x103)]});_0x8c704b=_0x13b3a9[_0x494446(0x113)];}}_0x53c736[_0x494446(0x103)]&&_0x8c704b&&console[_0x494446(0x120)]('Resolved\x20folder\x20ID:\x20'+_0x8c704b);const _0x2a500e=await loadJSONFromOptions(_0x53c736['rule'],_0x53c736[_0x494446(0x11f)]),_0x558cc4={'name':_0xfea0e4,'description':_0x53c736[_0x494446(0x129)],'rule':_0x2a500e,'kind':_0x53c736[_0x494446(0x105)]!==undefined?parseInt(_0x53c736[_0x494446(0x105)],0xa):undefined,'isVisible':_0x53c736[_0x494446(0x122)]?![]:undefined,'segmentFolderId':_0x8c704b,'countPopulation':_0x53c736['noCountPopulation']?![]:undefined},_0x54bba5=await withSpinner(_0x494446(0xfd)+_0xfea0e4+_0x494446(0xfc),()=>_0x476732[_0x494446(0x11d)]['createSegment'](_0x4d0d28,_0x558cc4),{'verbose':_0x53c736['verbose']}),_0x4a17ce=_0x54bba5[_0x494446(0x113)];return console[_0x494446(0x120)]('✔\x20Created\x20segment\x20\x27'+_0x4a17ce[_0x494446(0x104)]+'\x27\x20with\x20ID:\x20'+_0x4a17ce['id']),_0x11ad5c!==_0x32cde6&&console[_0x494446(0x120)]('\x20\x20\x20Path:\x20'+_0x11ad5c),await handleSDKOutput([_0x4a17ce],_0x53c736),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a39_0x5ace(_0x298616,_0x1ae1e4){_0x298616=_0x298616-0x1c0;const _0x191faa=a39_0x191f();let _0x5ace77=_0x191faa[_0x298616];return _0x5ace77;}const a39_0x3b6a14=a39_0x5ace;(function(_0x548426,_0x183882){const _0x3b9b13=a39_0x5ace,_0x3da5c0=_0x548426();while(!![]){try{const _0x215bb0=parseInt(_0x3b9b13(0x1d9))/0x1+-parseInt(_0x3b9b13(0x1d6))/0x2+parseInt(_0x3b9b13(0x1ca))/0x3+-parseInt(_0x3b9b13(0x1c3))/0x4+parseInt(_0x3b9b13(0x1c7))/0x5+parseInt(_0x3b9b13(0x1d8))/0x6+-parseInt(_0x3b9b13(0x1db))/0x7;if(_0x215bb0===_0x183882)break;else _0x3da5c0['push'](_0x3da5c0['shift']());}catch(_0x28ced7){_0x3da5c0['push'](_0x3da5c0['shift']());}}}(a39_0x191f,0x6cfba));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{displayFieldsHumanReadable}from'../sdk/segment/fields-display.js';function a39_0x191f(){const _0x3283cb=['Site:\x20','Parent\x20segment:\x20','name','listFields','segment','223274AAmeol','length','1548696gSofvo','230225xylJPv','List\x20available\x20fields\x20for\x20segmentation','4007003REFbhn','data','\x27...','Error:\x20Parent\x20segment\x20name\x20is\x20required','1590096awijUl','Usage:\x20tdx\x20segment\x20fields\x20<parent_name>','error','verbose','1628985ymlBpz','description','\x20\x20Or\x20set\x20context:\x20tdx\x20use\x20parent_segment\x20<name>','2141538viIQEI','Listing\x20fields\x20for\x20\x27','segment:fields','✔\x20Found\x20','\x20field','parentSegment','json'];a39_0x191f=function(){return _0x3283cb;};return a39_0x191f();}export class SegmentFieldsCommand extends BaseCommand{[a39_0x3b6a14(0x1d3)]=a39_0x3b6a14(0x1cc);[a39_0x3b6a14(0x1c8)]=a39_0x3b6a14(0x1da);async['execute'](_0x1d4fe2){const _0x43c004=a39_0x3b6a14,{options:_0x4f44b4,args:_0x3da323,tdx:_0x2a6b65}=_0x1d4fe2,_0x3e56cf=_0x3da323[0x0]||_0x4f44b4[_0x43c004(0x1cf)];if(!_0x3e56cf)return console[_0x43c004(0x1c5)](_0x43c004(0x1c2)),console[_0x43c004(0x1c5)](_0x43c004(0x1c4)),console[_0x43c004(0x1c5)](_0x43c004(0x1c9)),0x1;_0x4f44b4[_0x43c004(0x1c6)]&&(console[_0x43c004(0x1c5)](_0x43c004(0x1d1)+_0x4f44b4['site']),console[_0x43c004(0x1c5)](_0x43c004(0x1d2)+_0x3e56cf));const _0x318ec8=await withSpinner(_0x43c004(0x1cb)+_0x3e56cf+_0x43c004(0x1c1),()=>_0x2a6b65[_0x43c004(0x1d5)][_0x43c004(0x1d4)](_0x3e56cf),{'verbose':_0x4f44b4[_0x43c004(0x1c6)]}),_0x4d8aaf=_0x318ec8[_0x43c004(0x1c0)];console[_0x43c004(0x1c5)](_0x43c004(0x1cd)+_0x4d8aaf[_0x43c004(0x1d7)]+_0x43c004(0x1ce)+(_0x4d8aaf[_0x43c004(0x1d7)]!==0x1?'s':''));if(_0x4f44b4[_0x43c004(0x1d0)]||_0x4f44b4['jsonl'])return await handleSDKOutput(_0x4d8aaf,_0x4f44b4),0x0;return displayFieldsHumanReadable(_0x4d8aaf,_0x3e56cf),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0x1b3357=a40_0x3ae7;function a40_0x6b1f(){const _0x27fd92=['\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','name','\x20activations','activations','journeyVersions','dirname','utf-8','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','length','files','352176AuutIH','\x27...','\x20\x20🎯\x20','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','1961225UQJAxd','errorCode','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','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)','type','yes','relativePath','cyan','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','3nByobZ','\x20versions)','Error:\x20','message','-\x20no\x20files\x20written','targetDir','\x20with\x20','\x20changed\x20files','description','content','absolutePath','✔\x20Pulled\x20','error','data','parentName','1410903xRkUjR','192437ZpWVzA','segment','yellow','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','resourceName','filter','2771242lxzJBx','segments','\x20files\x20to\x20','hasChanges','\x20\x20🗺️\x20\x20','helpText','green','dryRun','repeat','Target\x20resource:\x20','\x20segments','segment:pull','Parent\x20segment:\x20','\x20journeys','verbose','7FrdeWQ','113608YiGLrg','site','\x0aError:','\x20=\x20','✔\x20Context\x20set:\x20','\x0aChanges\x20to\x20\x27','parent_segment','\x20files?','journeys','1024160WxlyiG','isNew','red','✔\x20All\x20files\x20are\x20up\x20to\x20date','No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27','Pulling\x20segments\x20from\x20\x27','counts','\x0aPull\x20summary\x20for\x20\x27','Aborted.'];a40_0x6b1f=function(){return _0x27fd92;};return a40_0x6b1f();}(function(_0x5d239a,_0x56c357){const _0x258128=a40_0x3ae7,_0xac4ec4=_0x5d239a();while(!![]){try{const _0x103e1f=parseInt(_0x258128(0x138))/0x1+parseInt(_0x258128(0x13e))/0x2*(parseInt(_0x258128(0x128))/0x3)+-parseInt(_0x258128(0x157))/0x4+-parseInt(_0x258128(0x11f))/0x5+-parseInt(_0x258128(0x16a))/0x6+-parseInt(_0x258128(0x14d))/0x7*(parseInt(_0x258128(0x14e))/0x8)+-parseInt(_0x258128(0x137))/0x9;if(_0x103e1f===_0x56c357)break;else _0xac4ec4['push'](_0xac4ec4['shift']());}catch(_0xc37443){_0xac4ec4['push'](_0xac4ec4['shift']());}}}(a40_0x6b1f,0xaaecd));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x426727 from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0x3ae7(_0x467bcf,_0x473c30){_0x467bcf=_0x467bcf-0x11e;const _0x6b1f08=a40_0x6b1f();let _0x3ae795=_0x6b1f08[_0x467bcf];return _0x3ae795;}import a40_0x17f01d from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x1b3357(0x161)]=a40_0x1b3357(0x149);[a40_0x1b3357(0x130)]=a40_0x1b3357(0x13b);async['execute'](_0xed0cbe){const _0x4eb8bf=a40_0x1b3357,{options:_0xf0e94a,args:_0x4ff42b,tdx:_0x50e3fc}=_0xed0cbe,_0x3e4fcb=_0xf0e94a,_0x286396=await resolveTarget({'arg':_0x4ff42b[0x0],'contextParent':_0xf0e94a['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x286396))return _0x286396[_0x4eb8bf(0x120)]==='no_parent'?(console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x13a)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x4eb8bf(0x134)](_0x4eb8bf(0x122)),console[_0x4eb8bf(0x134)](_0x4eb8bf(0x11e)),console[_0x4eb8bf(0x134)](_0x4eb8bf(0x160))):(console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x159)](_0x4eb8bf(0x12a)+_0x286396[_0x4eb8bf(0x12b)]+'\x0a')),_0x286396[_0x4eb8bf(0x143)]&&console[_0x4eb8bf(0x134)](a40_0x426727['cyan'](_0x286396[_0x4eb8bf(0x143)]))),0x1;const _0x3e8f31=_0x286396['parentName'],_0x3f727f=_0x286396['targetDir'],_0x986512=_0x286396[_0x4eb8bf(0x123)]==='file'?_0x286396[_0x4eb8bf(0x13c)]:undefined;_0x3e4fcb[_0x4eb8bf(0x14c)]&&(console[_0x4eb8bf(0x134)]('Site:\x20'+_0x3e4fcb[_0x4eb8bf(0x14f)]),console[_0x4eb8bf(0x134)](_0x4eb8bf(0x14a)+_0x3e8f31),_0x986512&&console[_0x4eb8bf(0x134)](_0x4eb8bf(0x147)+_0x986512));const _0x1a7261=await withProgressSpinner(_0x4eb8bf(0x15c)+_0x3e8f31+_0x4eb8bf(0x16b),_0x7e692f=>_0x50e3fc[_0x4eb8bf(0x139)]['pullSegments'](_0x3e8f31,{'targetDir':_0x3f727f,'targetResourceName':_0x986512,'verbose':_0x3e4fcb[_0x4eb8bf(0x14c)],'progress':{'update':_0xca2351=>{const _0x2292eb=_0x4eb8bf;_0x7e692f['setPhase'](_0xca2351),_0x3e4fcb[_0x2292eb(0x14c)]&&console[_0x2292eb(0x134)]('\x20\x20'+_0xca2351);}}}),{'verbose':_0x3e4fcb['verbose']}),_0x280c31=_0x1a7261[_0x4eb8bf(0x135)];if(_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x13f)]===0x0&&_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x156)]===0x0)return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x13a)](_0x4eb8bf(0x15b)+_0x280c31['parentName']+'\x27')),0x0;const _0x3fb67e=_0x280c31[_0x4eb8bf(0x169)][_0x4eb8bf(0x13d)](_0x198acd=>_0x198acd['isNew']),_0x43bbaa=_0x280c31['files'][_0x4eb8bf(0x13d)](_0x3cd07d=>!_0x3cd07d[_0x4eb8bf(0x158)]&&_0x3cd07d[_0x4eb8bf(0x141)]),_0x5910c3=_0x280c31[_0x4eb8bf(0x169)]['filter'](_0x142db1=>!_0x142db1[_0x4eb8bf(0x158)]&&!_0x142db1[_0x4eb8bf(0x141)]);console['error'](_0x4eb8bf(0x15e)+_0x280c31[_0x4eb8bf(0x136)]+'\x27:'),console[_0x4eb8bf(0x134)](_0x4eb8bf(0x16c)+a40_0x426727['cyan'](_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x13f)]+_0x4eb8bf(0x148))+_0x4eb8bf(0x12e)+a40_0x426727['cyan'](_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x163)]+_0x4eb8bf(0x162)));if(_0x280c31['counts']['journeys']>0x0){const _0x5a041d=_0x280c31[_0x4eb8bf(0x15d)]['journeyVersions']>_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x156)]?'\x20('+_0x280c31[_0x4eb8bf(0x15d)][_0x4eb8bf(0x164)]+_0x4eb8bf(0x129):'';console[_0x4eb8bf(0x134)](_0x4eb8bf(0x142)+a40_0x426727['cyan'](_0x280c31[_0x4eb8bf(0x15d)]['journeys']+_0x4eb8bf(0x14b))+a40_0x426727[_0x4eb8bf(0x16d)](_0x5a041d));}console[_0x4eb8bf(0x134)]('\x20\x20'+a40_0x426727[_0x4eb8bf(0x144)]('+\x20'+_0x3fb67e[_0x4eb8bf(0x168)]+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x426727[_0x4eb8bf(0x13a)]('~\x20'+_0x43bbaa[_0x4eb8bf(0x168)]+_0x4eb8bf(0x12f))),console[_0x4eb8bf(0x134)]('\x20\x20'+a40_0x426727[_0x4eb8bf(0x16d)]('=\x20'+_0x5910c3['length']+'\x20unchanged\x20files')),console[_0x4eb8bf(0x134)]('\x20\x20Target:\x20'+a40_0x426727[_0x4eb8bf(0x126)](_0x280c31[_0x4eb8bf(0x12d)])+'\x0a');if(_0x43bbaa['length']>0x0)for(const _0x3a60a9 of _0x43bbaa){console['error'](_0x4eb8bf(0x153)+_0x3a60a9[_0x4eb8bf(0x125)]+'\x27:'),console[_0x4eb8bf(0x134)]('─'[_0x4eb8bf(0x146)](0x3c)),console[_0x4eb8bf(0x134)](_0x3a60a9['diff']),console['error']('─'[_0x4eb8bf(0x146)](0x3c));}if(_0x3e4fcb[_0x4eb8bf(0x145)])return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x13a)](_0x4eb8bf(0x127))),0x0;if(_0x3fb67e[_0x4eb8bf(0x168)]===0x0&&_0x43bbaa['length']===0x0)return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x144)](_0x4eb8bf(0x15a))),saveSessionContext({'parent_segment':_0x280c31[_0x4eb8bf(0x136)]},_0x3e4fcb['session']),console['error'](a40_0x426727[_0x4eb8bf(0x144)]('✔\x20Context\x20set:\x20'+a40_0x426727[_0x4eb8bf(0x16d)]('parent_segment')+_0x4eb8bf(0x151)+a40_0x426727[_0x4eb8bf(0x126)](_0x280c31['parentName']))),0x0;if(!_0x3e4fcb[_0x4eb8bf(0x124)]){if(!isInteractive())return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x159)](_0x4eb8bf(0x150)),_0x4eb8bf(0x167)),console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x16d)](_0x4eb8bf(0x121))),0x1;const _0x83bead=await confirmKey('Write\x20'+(_0x3fb67e[_0x4eb8bf(0x168)]+_0x43bbaa[_0x4eb8bf(0x168)])+_0x4eb8bf(0x155));if(!_0x83bead)return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x13a)](_0x4eb8bf(0x15f)),_0x4eb8bf(0x12c)),0x1;}for(const _0x43a395 of _0x280c31[_0x4eb8bf(0x169)]){if(_0x43a395[_0x4eb8bf(0x158)]||_0x43a395[_0x4eb8bf(0x141)]){const _0xddc272=a40_0x17f01d[_0x4eb8bf(0x165)](_0x43a395[_0x4eb8bf(0x132)]);!existsSync(_0xddc272)&&mkdirSync(_0xddc272,{'recursive':!![]}),writeFileSync(_0x43a395[_0x4eb8bf(0x132)],_0x43a395[_0x4eb8bf(0x131)],_0x4eb8bf(0x166));}}return console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x144)](_0x4eb8bf(0x133)+(_0x3fb67e['length']+_0x43bbaa['length'])+_0x4eb8bf(0x140)+_0x280c31[_0x4eb8bf(0x12d)])),saveSessionContext({'parent_segment':_0x280c31[_0x4eb8bf(0x136)]},_0x3e4fcb['session']),console[_0x4eb8bf(0x134)](a40_0x426727[_0x4eb8bf(0x144)](_0x4eb8bf(0x152)+a40_0x426727[_0x4eb8bf(0x16d)](_0x4eb8bf(0x154))+_0x4eb8bf(0x151)+a40_0x426727[_0x4eb8bf(0x126)](_0x280c31['parentName']))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a42_0x42edcb=a42_0x1bb8;(function(_0x81850b,_0x470c38){const _0x43e058=a42_0x1bb8,_0x37962b=_0x81850b();while(!![]){try{const _0x5c389e=-parseInt(_0x43e058(0xb1))/0x1+parseInt(_0x43e058(0xf9))/0x2*(-parseInt(_0x43e058(0xa1))/0x3)+-parseInt(_0x43e058(0x8e))/0x4*(-parseInt(_0x43e058(0xf7))/0x5)+-parseInt(_0x43e058(0xa2))/0x6+-parseInt(_0x43e058(0xe0))/0x7*(parseInt(_0x43e058(0xb7))/0x8)+-parseInt(_0x43e058(0x96))/0x9+parseInt(_0x43e058(0xad))/0xa*(parseInt(_0x43e058(0x78))/0xb);if(_0x5c389e===_0x470c38)break;else _0x37962b['push'](_0x37962b['shift']());}catch(_0x3ec8d7){_0x37962b['push'](_0x37962b['shift']());}}}(a42_0x2af0,0xc3d2d));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 a42_0x1bb8(_0xe494ba,_0x289324){_0xe494ba=_0xe494ba-0x73;const _0x2af097=a42_0x2af0();let _0x1bb821=_0x2af097[_0xe494ba];return _0x1bb821;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a42_0x1078c6 from'chalk';function a42_0x2af0(){const _0x42cdbd=['dim','state','\x0a✔\x20Push\x20complete','dryRun','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Parent\x20segment:\x20','segment','segments','\x0aValidation\x20failed:','\x20unchanged','paused','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','isScoped','toString','parentSegment','toCreate','parentName','\x20\x20Segments:\x20','length','10vLWbBR','\x20to\x20delete','73686HoRAsj','isNew','segmentFolderId','audienceId','getParent','all','\x20folders\x20to\x20create','/app/ps/','/e/','deleted','\x20\x20📊\x20Segments:','Fetching\x20existing\x20activations...','folderId','\x20\x20Source:\x20','\x20created','no_parent','get','Resolving\x20parent\x20segment\x20\x27','.yaml','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','yes','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20\x20🗺️\x20\x20Journeys:','.yml','attributes','user','activations','cwd','resolveParentId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','existingJourney','\x20\x20Journeys:\x20','execute','11icAZmL','\x20new','\x0aPush\x20summary\x20for\x20\x27','/j/da/je','journey','diff','targetDir','existingSegment','join','Error\x20parsing\x20YAML:\x20','\x20to\x20create','created','helpText','createdSegmentIds','blue','listActivations','setPhase','journeysOnly','idToName','toUpdate','push','cyan','1340668eFnQYh','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','delete','journeyId','\x20to\x20update','toDelete','journeys','Scoped\x20to\x20folder:\x20','12051000hvuNub','\x20deleted','set','Delete\x20segment:','segment\x20or\x20journey','folders','No\x20','relationships','yellow','\x20activations]','parentFolder','129WrXYtB','3168690afNOQZ','Source\x20directory:\x20','listFolders','buildUserMaps','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','new','/sb/da/esr','connection','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','filter','errorCode','59783170muBdpL','journeyBundleName','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','red','911694prWYKh','\x20\x20\x20\x20','changed','map','data','message','32ARsYiG','\x20changed','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','segment:push','\x27...','Error:\x20','then','repeat','listSegments','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','green','📁\x20','Preparing\x20journeys...','journeyBundleId','\x20updated','getOutputSchemaWithCache','scopedFolderPath','endsWith','createdAt','(Journey\x20will\x20be\x20deleted)','name','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','New\x20segment:','verbose','site','Push\x20','results','description','\x20\x20Activations:','\x20changes?','type','file','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Site:\x20','folderPath','unchanged','versionNumber','yamlConfig','nameToId','\x20YAML\x20files\x20found','2596125EOSvRm','error','updated'];a42_0x2af0=function(){return _0x42cdbd;};return a42_0x2af0();}import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a42_0x42edcb(0xcb)]=a42_0x42edcb(0xba);[a42_0x42edcb(0xd2)]=a42_0x42edcb(0x10c);async[a42_0x42edcb(0x77)](_0x4ba1d6){const _0x5c8567=a42_0x42edcb,{options:_0x1c9e1b,args:_0x46f4a6,tdx:_0x2c886d}=_0x4ba1d6,_0xd8a378=_0x1c9e1b,_0x3cc64d=await resolveTarget({'arg':_0x46f4a6[0x0],'contextParent':_0x1c9e1b[_0x5c8567(0xf2)],'cwd':process[_0x5c8567(0x115)]()});if(!isSuccessfulResolution(_0x3cc64d))return _0x3cc64d[_0x5c8567(0xac)]===_0x5c8567(0x108)?(console['error'](a42_0x1078c6[_0x5c8567(0x9e)](_0x5c8567(0xb9))),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x5c8567(0xe1)](_0x5c8567(0x8f))):(console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0xbc)+_0x3cc64d[_0x5c8567(0xb6)]+'\x0a')),_0x3cc64d[_0x5c8567(0x84)]&&console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x8d)](_0x3cc64d[_0x5c8567(0x84)]))),0x1;if(_0x3cc64d['type']==='parent_name')return console['error'](a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0xee)+_0x3cc64d[_0x5c8567(0x7e)]+'\x0a')),console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x8d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x5393e1=_0x3cc64d[_0x5c8567(0xf4)],_0x32e4a4=_0x3cc64d[_0x5c8567(0x7e)],_0x51b910=_0x3cc64d[_0x5c8567(0xd5)]===_0x5c8567(0xd6)?_0x3cc64d['filePath']:undefined,_0xeab36c=getScopedDetails(_0x3cc64d),_0x2ca4a4=_0xeab36c?.[_0x5c8567(0xf0)]??![],_0x4ead63=_0xeab36c?.[_0x5c8567(0xc7)]??'';if(!existsSync(_0x32e4a4))return console['error'](a42_0x1078c6['red'](_0x5c8567(0xee)+_0x32e4a4+'\x0a')),console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x8d)](_0x5c8567(0xd7))),0x1;_0xd8a378[_0x5c8567(0xce)]&&(console['error'](_0x5c8567(0xd9)+_0xd8a378['site']),console[_0x5c8567(0xe1)](_0x5c8567(0xe8)+_0x5393e1),console['error'](_0x5c8567(0xa3)+_0x32e4a4),_0x2ca4a4&&console[_0x5c8567(0xe1)](_0x5c8567(0x95)+_0x4ead63));const _0x49b6d8=await withSpinner(_0x5c8567(0x10a)+_0x5393e1+_0x5c8567(0xbb),()=>_0x2c886d[_0x5c8567(0xe9)][_0x5c8567(0x73)](_0x5393e1),{'verbose':_0xd8a378[_0x5c8567(0xce)]}),_0x29e129=_0x49b6d8[_0x5c8567(0xb5)],{parentSegmentResult:_0xe2b584,segmentsResult:_0x4f457e,foldersResult:_0x27e49d,journeysWithDetailsResult:_0x49003d,userMaps:_0x2234a3}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x47920d=_0x5c8567,[_0x1ef050,_0x673cbf,_0x1d0198,_0x8650ce,_0x53df08]=await Promise[_0x47920d(0xfe)]([_0x2c886d['segment'][_0x47920d(0xfd)](_0x29e129),_0x2c886d[_0x47920d(0xe9)][_0x47920d(0xbf)](_0x29e129),_0x2c886d[_0x47920d(0xe9)][_0x47920d(0xa4)](_0x29e129),_0x2c886d['journey']['listJourneysWithDetailsFromParentSegment'](_0x29e129,{'includeAllVersions':!![]}),_0x2c886d[_0x47920d(0x113)][_0x47920d(0xa5)]()]);return{'parentSegmentResult':_0x1ef050,'segmentsResult':_0x673cbf,'foldersResult':_0x1d0198,'journeysWithDetailsResult':_0x8650ce,'userMaps':_0x53df08};},{'verbose':_0xd8a378['verbose']})[_0x5c8567(0xbd)](_0xa036f2=>_0xa036f2['data']),_0x53c57a=_0xe2b584,_0x2b4e18=extractRootFolderId(_0x53c57a),_0x4388e8=_0x4f457e,_0x546f9b=_0x27e49d,{journeys:_0x4f25f9,activationStepsById:_0x46031b}=_0x49003d,_0x20a080=new Map(_0x4f25f9[_0x5c8567(0xb4)](_0x4642f9=>[_0x4642f9['id'],_0x4642f9])),_0x2c7b41=_0x4f25f9[_0x5c8567(0xb4)](_0x456fc2=>({'id':_0x456fc2['id'],'name':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xcb)],'journeyBundleName':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xae)]||'','journeyBundleId':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xc4)]||'','versionNumber':_0x456fc2['attributes'][_0x5c8567(0xdc)],'description':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xd2)],'state':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xe4)],'paused':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xed)],'audienceId':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xfc)],'folderId':_0x456fc2[_0x5c8567(0x9d)]?.[_0x5c8567(0xa0)]?.['data']?.['id'],'createdAt':_0x456fc2[_0x5c8567(0x112)][_0x5c8567(0xc9)],'updatedAt':_0x456fc2[_0x5c8567(0x112)]['updatedAt']})),{emailToId:_0x35ddff,idToEmail:_0x1eb3bf}=_0x2234a3,_0x32dcf3=await withSpinner(_0x5c8567(0xef),async()=>{const _0x19ed7a=_0x5c8567,_0x4184d8=await _0x2c886d[_0x19ed7a(0xa9)]['list']();return buildConnectionMaps(_0x4184d8);},{'verbose':_0xd8a378[_0x5c8567(0xce)]})[_0x5c8567(0xbd)](_0x434baa=>_0x434baa[_0x5c8567(0xb5)]),_0x59fe61=_0x32dcf3[_0x5c8567(0xde)],_0x137609=_0x32dcf3[_0x5c8567(0x8a)],_0x7dd3ba=_0x32dcf3['nameToType'],_0x59ea95={'emailToIdMap':_0x35ddff,'connectionNameToIdMap':_0x59fe61,'connectionNameToTypeMap':_0x7dd3ba,'getSchema':_0x970f76=>_0x2c886d['connection'][_0x5c8567(0xc6)](_0x970f76)};let {pathToId:_0x39efd9,idToPath:_0x1d3e85}=buildFolderMaps(_0x546f9b);const _0x13d80c=buildSegmentLookupMap(_0x4388e8,_0x1d3e85),_0x4058fc=buildSegmentNameToIdMap(_0x4388e8),_0x4fc950=buildJourneyBundleLookupMap(_0x2c7b41,_0x1d3e85);let _0x5fecde;if(_0x51b910){if(!_0x51b910[_0x5c8567(0xc8)](_0x5c8567(0x111))&&!_0x51b910[_0x5c8567(0xc8)](_0x5c8567(0x10b)))return console['error'](a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0xe7)+_0x51b910+'\x0a')),0x1;_0x5fecde=[_0x51b910];}else _0x5fecde=findYamlFiles(_0x32e4a4);if(_0x5fecde['length']===0x0)return console[_0x5c8567(0xe1)](a42_0x1078c6['red']('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x32e4a4+'\x0a')),console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x8d)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0xfcedab,_0x3be35b;try{const _0x42e7d9=parseAndClassifyYamlFiles(_0x5fecde,_0x32e4a4,{'skipSegments':_0xd8a378[_0x5c8567(0x89)]});_0xfcedab=_0x42e7d9[_0x5c8567(0xea)],_0x3be35b=_0x42e7d9['journeys'];const _0x532b52=validateParsedFiles(_0x42e7d9,_0x32e4a4);if(_0x532b52[_0x5c8567(0xf6)]>0x0)return console['error'](a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0xeb))),console[_0x5c8567(0xe1)](formatValidationErrors(_0x532b52)),console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x9e)](_0x5c8567(0xa6))),0x1;}catch(_0xb868cc){return console['error'](a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0x81)+(_0xb868cc instanceof Error?_0xb868cc[_0x5c8567(0xb6)]:_0xb868cc))),0x1;}if(_0xfcedab[_0x5c8567(0xf6)]===0x0&&_0x3be35b[_0x5c8567(0xf6)]===0x0){const _0x18588f=_0xd8a378[_0x5c8567(0x89)]?'journey':_0x5c8567(0x9a);return console['error'](a42_0x1078c6[_0x5c8567(0x9e)](_0x5c8567(0x9c)+_0x18588f+_0x5c8567(0xdf))),0x0;}const _0x411979=new Map();_0x4388e8[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x89)]&&await withSpinner(_0x5c8567(0x104),async()=>{await batchAsync(_0x4388e8,async _0x4940e8=>{const _0x3d8dd3=a42_0x1bb8,_0xf0eb29=await _0x2c886d[_0x3d8dd3(0xe9)][_0x3d8dd3(0x87)](_0x29e129,_0x4940e8['id']);_0x411979[_0x3d8dd3(0x98)](_0x4940e8['id'],_0xf0eb29);});},{'verbose':_0xd8a378[_0x5c8567(0xce)]});const {segmentFiles:_0x4c3580,foldersToCreate:_0x2ccea4}=await prepareSegmentFiles(_0xfcedab,{'segmentByFolderAndName':_0x13d80c,'activationsBySegmentId':_0x411979,'folderPathToId':_0x39efd9,'idToEmailMap':_0x1eb3bf,'connectionIdToNameMap':_0x137609},_0x59ea95,_0x2ca4a4,_0x4ead63),_0x1727ab=_0x51b910?[]:findSegmentsToDelete(_0x4388e8,_0xfcedab['map'](({yamlConfig:_0x208b70,folderPath:_0x46b1d9})=>({'yamlConfig':_0x208b70,'folderPath':resolveTDFolderPath(_0x46b1d9,_0x2ca4a4,_0x4ead63)})),_0x1d3e85,_0x4ead63,_0x2ca4a4),{journeyFiles:_0x1e83b1,foldersToCreate:_0x3f9062}=await withProgressSpinner(_0x5c8567(0xc3),async _0x36e8a2=>prepareJourneyFiles(_0x3be35b,{'fetchJourney':async _0x224860=>_0x2c886d[_0x5c8567(0x7c)]['getJourney'](_0x224860[_0x5c8567(0x91)]),'journeyBundlesByFolderAndName':_0x4fc950,'folderPathToId':_0x39efd9,'idToEmailMap':_0x1eb3bf,'connectionIdToNameMap':_0x137609,'existingSegments':_0x4388e8,'parentId':_0x29e129,'deps':_0x2c886d,'progress':{'update':_0x237944=>{const _0x2b3c81=_0x5c8567;_0x36e8a2[_0x2b3c81(0x88)](_0x237944),_0xd8a378[_0x2b3c81(0xce)]&&console[_0x2b3c81(0xe1)]('\x20\x20'+_0x237944);}},'journeyById':_0x20a080,'activationStepsById':_0x46031b},_0x2ca4a4,_0x4ead63),{'verbose':_0xd8a378[_0x5c8567(0xce)]})[_0x5c8567(0xbd)](_0x3311c=>_0x3311c[_0x5c8567(0xb5)]);for(const _0x2dfc98 of _0x3f9062){_0x2ccea4['add'](_0x2dfc98);}const _0x1ed413=_0x51b910?[]:findJourneysToDelete(_0x2c7b41,_0x3be35b[_0x5c8567(0xb4)](({yamlConfig:_0x2f451a,folderPath:_0x2868b1})=>({'yamlConfig':_0x2f451a,'folderPath':resolveTDFolderPath(_0x2868b1,_0x2ca4a4,_0x4ead63)})),_0x1d3e85,_0x4ead63,_0x2ca4a4),_0x58ae3d=calculatePushStats(_0x4c3580,_0x1e83b1,_0x2ccea4,_0x1727ab,_0x1ed413,!!_0xd8a378[_0x5c8567(0x90)],!!_0xd8a378[_0x5c8567(0x89)]),_0x4c5d6f=_0x58ae3d['segments'][_0x5c8567(0xa7)],_0xc33e17=_0x58ae3d[_0x5c8567(0xea)][_0x5c8567(0xb3)],_0x332161=_0x58ae3d[_0x5c8567(0xea)]['unchanged'],_0x24d237=_0x58ae3d['segments'][_0x5c8567(0x93)],_0x1998a6=_0x58ae3d[_0x5c8567(0x9b)][_0x5c8567(0xf3)],_0x48ad9e=_0x58ae3d[_0x5c8567(0x94)]['new'],_0x2dac7a=_0x58ae3d[_0x5c8567(0x94)][_0x5c8567(0xb3)],_0x347121=_0x58ae3d[_0x5c8567(0x94)][_0x5c8567(0xdb)],_0x5a1c68=_0x58ae3d[_0x5c8567(0x94)][_0x5c8567(0x93)],_0x4a6a28=_0x58ae3d[_0x5c8567(0x114)][_0x5c8567(0xfe)],_0x14438d=_0x58ae3d[_0x5c8567(0x114)][_0x5c8567(0xf3)],_0x5d38df=_0x58ae3d[_0x5c8567(0x114)][_0x5c8567(0x8b)],_0x2bcb5e=_0x58ae3d[_0x5c8567(0x114)][_0x5c8567(0x93)];console[_0x5c8567(0xe1)](_0x5c8567(0x7a)+_0x5393e1+'\x27:');_0x1998a6[_0x5c8567(0xf6)]>0x0&&console[_0x5c8567(0xe1)]('\x20\x20'+a42_0x1078c6[_0x5c8567(0x86)](_0x5c8567(0xc2)+_0x1998a6[_0x5c8567(0xf6)]+_0x5c8567(0xff)));if(!_0xd8a378[_0x5c8567(0x89)]){console[_0x5c8567(0xe1)](_0x5c8567(0x103)),console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0xc1)]('+\x20'+_0x4c5d6f[_0x5c8567(0xf6)]+_0x5c8567(0x79))),console['error'](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0x9e)]('~\x20'+_0xc33e17['length']+_0x5c8567(0xb8)));if(_0x24d237['length']>0x0)console['error'](_0x5c8567(0xb2)+a42_0x1078c6['red']('-\x20'+_0x24d237[_0x5c8567(0xf6)]+'\x20to\x20delete'));else _0x1727ab[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x90)]&&console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0xe3)](_0x1727ab['length']+_0x5c8567(0x74)));console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6['dim']('=\x20'+_0x332161[_0x5c8567(0xf6)]+_0x5c8567(0xec)));}if(_0x1e83b1[_0x5c8567(0xf6)]>0x0||_0x1ed413[_0x5c8567(0xf6)]>0x0){console[_0x5c8567(0xe1)](_0x5c8567(0x110)),console[_0x5c8567(0xe1)]('\x20\x20\x20\x20'+a42_0x1078c6['green']('+\x20'+_0x48ad9e['length']+_0x5c8567(0x79))),console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0x9e)]('~\x20'+_0x2dac7a[_0x5c8567(0xf6)]+_0x5c8567(0xb8)));if(_0x5a1c68[_0x5c8567(0xf6)]>0x0)console['error'](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0xb0)]('-\x20'+_0x5a1c68['length']+'\x20to\x20delete'));else _0x1ed413[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x90)]&&console['error'](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0xe3)](_0x1ed413[_0x5c8567(0xf6)]+_0x5c8567(0x74)));console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0xe3)]('=\x20'+_0x347121[_0x5c8567(0xf6)]+_0x5c8567(0xec)));}_0x4a6a28['length']>0x0&&!_0xd8a378[_0x5c8567(0x89)]&&(console[_0x5c8567(0xe1)](''),console[_0x5c8567(0xe1)](_0x5c8567(0xd3)),_0x14438d[_0x5c8567(0xf6)]>0x0&&console[_0x5c8567(0xe1)](_0x5c8567(0xb2)+a42_0x1078c6['green']('+\x20'+_0x14438d[_0x5c8567(0xf6)]+_0x5c8567(0x82))),_0x5d38df[_0x5c8567(0xf6)]>0x0&&console['error'](_0x5c8567(0xb2)+a42_0x1078c6[_0x5c8567(0x9e)]('~\x20'+_0x5d38df[_0x5c8567(0xf6)]+_0x5c8567(0x92))),_0x2bcb5e[_0x5c8567(0xf6)]>0x0&&console['error'](_0x5c8567(0xb2)+a42_0x1078c6['red']('-\x20'+_0x2bcb5e['length']+_0x5c8567(0xf8))));console[_0x5c8567(0xe1)](_0x5c8567(0x106)+a42_0x1078c6[_0x5c8567(0x8d)](_0x32e4a4)+'\x0a');if(_0x1998a6['length']>0x0){console[_0x5c8567(0xe1)]('Folders\x20to\x20create:');for(const _0x4bd7cf of _0x1998a6){console[_0x5c8567(0xe1)]('\x20\x20'+a42_0x1078c6[_0x5c8567(0x86)]('+')+'\x20'+_0x4bd7cf);}console[_0x5c8567(0xe1)]('');}if(_0x4c5d6f[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x89)])for(const _0x1548aa of _0x4c5d6f){const _0x3741c4=_0x1548aa[_0x5c8567(0xda)]?_0x1548aa[_0x5c8567(0xda)]+'/'+_0x1548aa['yamlConfig']['name']:_0x1548aa['yamlConfig'][_0x5c8567(0xcb)],_0x1921a5=_0x1548aa['yamlConfig'][_0x5c8567(0x114)]?.['length']||0x0,_0x1b6f24=_0x1921a5>0x0?a42_0x1078c6['dim']('\x20['+_0x1921a5+_0x5c8567(0x9f)):'';console[_0x5c8567(0xe1)]('\x0a'+a42_0x1078c6[_0x5c8567(0xc1)](_0x5c8567(0xcd))+'\x20'+_0x3741c4+_0x1b6f24),console['error']('─'[_0x5c8567(0xbe)](0x3c)),_0x1548aa[_0x5c8567(0x7d)]&&console[_0x5c8567(0xe1)](_0x1548aa['diff']),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c));}if(_0x24d237[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x89)])for(const _0x197418 of _0x24d237){const _0x5e9d31=_0x197418['segmentFolderId']?_0x1d3e85[_0x5c8567(0x109)](_0x197418[_0x5c8567(0xfb)][_0x5c8567(0xf1)]())||'':'',_0x59fb08=_0x5e9d31?_0x5e9d31+'/'+_0x197418[_0x5c8567(0xcb)]:_0x197418[_0x5c8567(0xcb)],_0xe2ad5b=_0x411979[_0x5c8567(0x109)](_0x197418['id'])||[],_0x3146d4=_0xe2ad5b[_0x5c8567(0xf6)]>0x0?a42_0x1078c6['dim']('\x20['+_0xe2ad5b[_0x5c8567(0xf6)]+_0x5c8567(0x9f)):'';console['error']('\x0a'+a42_0x1078c6[_0x5c8567(0xb0)](_0x5c8567(0x99))+'\x20'+_0x59fb08+_0x3146d4),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c));const _0x21aba7=segmentWithActivationsToYaml(_0x197418,_0xe2ad5b,undefined,_0x1eb3bf,_0x137609),_0x9c97e1=segmentToYamlString(_0x21aba7),_0x5eafcc=generateDiff(_0x9c97e1,'');console[_0x5c8567(0xe1)](formatDiffWithColors(_0x5eafcc)),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c));}const _0x40c614=_0x4c3580['filter'](_0x413e6b=>!_0x413e6b[_0x5c8567(0xfa)]&&_0x413e6b['diff']);if(_0x40c614[_0x5c8567(0xf6)]>0x0&&!_0xd8a378['journeysOnly'])for(const _0x5b8462 of _0x40c614){const _0x4cf4ce=_0x5b8462[_0x5c8567(0xda)]?_0x5b8462[_0x5c8567(0xda)]+'/'+_0x5b8462[_0x5c8567(0xdd)]['name']:_0x5b8462[_0x5c8567(0xdd)][_0x5c8567(0xcb)];console['error']('\x0a'+a42_0x1078c6['yellow']('Changes\x20to:')+'\x20'+_0x4cf4ce),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c)),console[_0x5c8567(0xe1)](_0x5b8462[_0x5c8567(0x7d)]),console['error']('─'[_0x5c8567(0xbe)](0x3c));}if(_0x48ad9e['length']>0x0)for(const _0x56d7fd of _0x48ad9e){const _0x5d0dd7=_0x56d7fd['folderPath']?_0x56d7fd[_0x5c8567(0xda)]+'/'+_0x56d7fd[_0x5c8567(0xdd)][_0x5c8567(0xcb)]:_0x56d7fd[_0x5c8567(0xdd)][_0x5c8567(0xcb)];console['error']('\x0a'+a42_0x1078c6[_0x5c8567(0xc1)]('New\x20journey:')+'\x20'+_0x5d0dd7),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c)),_0x56d7fd[_0x5c8567(0x7d)]&&console[_0x5c8567(0xe1)](_0x56d7fd[_0x5c8567(0x7d)]),console[_0x5c8567(0xe1)]('─'['repeat'](0x3c));}const _0x177b71=_0x1e83b1[_0x5c8567(0xab)](_0x16b340=>!_0x16b340[_0x5c8567(0xfa)]&&_0x16b340[_0x5c8567(0x7d)]);if(_0x177b71[_0x5c8567(0xf6)]>0x0)for(const _0x586cc9 of _0x177b71){const _0x56cb4b=_0x586cc9[_0x5c8567(0xda)]?_0x586cc9['folderPath']+'/'+_0x586cc9[_0x5c8567(0xdd)]['name']:_0x586cc9[_0x5c8567(0xdd)]['name'];console[_0x5c8567(0xe1)]('\x0a'+a42_0x1078c6[_0x5c8567(0x9e)]('Changes\x20to\x20journey:')+'\x20'+_0x56cb4b),console['error']('─'['repeat'](0x3c)),console[_0x5c8567(0xe1)](_0x586cc9[_0x5c8567(0x7d)]),console[_0x5c8567(0xe1)]('─'['repeat'](0x3c));}if(_0x5a1c68[_0x5c8567(0xf6)]>0x0)for(const _0x982030 of _0x5a1c68){const _0x1623ee=_0x982030['folderId']?_0x1d3e85['get'](_0x982030[_0x5c8567(0x105)])||'':'',_0x4cd5eb=_0x1623ee?_0x1623ee+'/'+_0x982030['journeyBundleName']:_0x982030[_0x5c8567(0xae)];console[_0x5c8567(0xe1)]('\x0a'+a42_0x1078c6['red']('Delete\x20journey:')+'\x20'+_0x4cd5eb),console[_0x5c8567(0xe1)]('─'[_0x5c8567(0xbe)](0x3c)),console[_0x5c8567(0xe1)](a42_0x1078c6['red'](_0x5c8567(0xca))),console[_0x5c8567(0xe1)]('─'['repeat'](0x3c));}if(_0xd8a378[_0x5c8567(0xe6)])return console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x9e)](_0x5c8567(0xd8))),0x0;const _0x129be6=_0xd8a378['journeysOnly']?![]:_0x4c5d6f[_0x5c8567(0xf6)]>0x0||_0xc33e17[_0x5c8567(0xf6)]>0x0||_0x24d237[_0x5c8567(0xf6)]>0x0,_0x4adc41=_0x48ad9e['length']>0x0||_0x2dac7a[_0x5c8567(0xf6)]>0x0||_0x5a1c68[_0x5c8567(0xf6)]>0x0,_0x78605=_0xd8a378[_0x5c8567(0x89)]?![]:_0x4a6a28[_0x5c8567(0xf6)]>0x0,_0x17b482=_0x1998a6[_0x5c8567(0xf6)]>0x0;if(!_0x129be6&&!_0x4adc41&&!_0x78605&&!_0x17b482){const _0x12cb98=_0xd8a378['journeysOnly']?_0x5c8567(0xcc):_0x5c8567(0xaf);console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xc1)](_0x12cb98));if(_0x51b910&&_0x332161[_0x5c8567(0xf6)]===0x1){const _0x2e979f=_0x332161[0x0];if(_0x2e979f[_0x5c8567(0x7f)]?.['id']){const _0x1402fd=getConsoleNextUrl(_0xd8a378['site'],'/app/ps/'+_0x29e129+_0x5c8567(0x101)+_0x2e979f[_0x5c8567(0x7f)]['id']+_0x5c8567(0xa8));console[_0x5c8567(0xe1)](_0x5c8567(0xaa)+a42_0x1078c6['cyan'](_0x1402fd));}}if(_0x51b910&&_0x347121['length']===0x1){const _0x4da5db=_0x347121[0x0];if(_0x4da5db[_0x5c8567(0x75)]?.['id']){const _0x436309=getConsoleNextUrl(_0xd8a378[_0x5c8567(0xcf)],_0x5c8567(0x100)+_0x29e129+_0x5c8567(0x101)+_0x4da5db[_0x5c8567(0x75)]['id']+'/j/da/je');console['error']('\x20\x20'+a42_0x1078c6[_0x5c8567(0x8d)](_0x436309));}}return 0x0;}const _0x564b26=_0xd8a378[_0x5c8567(0x89)]?_0x48ad9e[_0x5c8567(0xf6)]+_0x2dac7a['length']+_0x5a1c68['length']+_0x1998a6[_0x5c8567(0xf6)]:_0x4c5d6f[_0x5c8567(0xf6)]+_0xc33e17['length']+_0x24d237[_0x5c8567(0xf6)]+_0x48ad9e[_0x5c8567(0xf6)]+_0x2dac7a[_0x5c8567(0xf6)]+_0x5a1c68['length']+_0x1998a6[_0x5c8567(0xf6)]+_0x4a6a28[_0x5c8567(0xf6)];if(!_0xd8a378[_0x5c8567(0x10e)]&&_0x564b26>0x0){if(!isInteractive())return console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xb0)]('\x0aError:'),_0x5c8567(0x10d)),console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xe3)](_0x5c8567(0x10f))),0x1;const _0xcf5854=await confirmKey(_0x5c8567(0xd0)+_0x564b26+_0x5c8567(0xd4));if(!_0xcf5854)return console[_0x5c8567(0xe1)](a42_0x1078c6['yellow']('Aborted.')),0x1;}const _0x1f10b6={'withProgress':async(_0xedf095,_0x3244ac)=>{const _0x4a4456=_0x5c8567,_0x14bc06=await withSpinner(_0xedf095,_0x3244ac,{'verbose':_0xd8a378[_0x4a4456(0xce)]});return{'data':_0x14bc06[_0x4a4456(0xb5)]};},'logInfo':_0x53b701=>console['error'](a42_0x1078c6[_0x5c8567(0x86)]('✔\x20'+_0x53b701)),'logSuccess':_0x17f60c=>console[_0x5c8567(0xe1)](a42_0x1078c6['green']('✔\x20'+_0x17f60c)),'logWarning':_0x4e402d=>console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x9e)]('⚠\x20'+_0x4e402d)),'logDeleted':_0x410a5d=>console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xb0)]('✔\x20'+_0x410a5d))},_0x1fc7d5={'segment':_0x2c886d[_0x5c8567(0xe9)],'journey':_0x2c886d['journey'],'user':_0x2c886d[_0x5c8567(0x113)],'connection':_0x2c886d[_0x5c8567(0xa9)]};_0x1998a6[_0x5c8567(0xf6)]>0x0&&(_0x39efd9=await executePushFolders(_0x1fc7d5,_0x1998a6,_0x39efd9,{'parentId':_0x29e129},_0x1f10b6));const _0x23a5df={'rootFolderId':_0x2b4e18,'folderPathToId':_0x39efd9,'folderIdToPath':_0x1d3e85,'segmentNameToId':_0x4058fc,'activationsBySegmentId':_0x411979,'emailToIdMap':_0x35ddff,'idToEmailMap':_0x1eb3bf,'connectionNameToIdMap':_0x32dcf3[_0x5c8567(0xde)],'connectionIdToNameMap':_0x32dcf3[_0x5c8567(0x8a)],'connectionNameToTypeMap':_0x7dd3ba},_0x3a574a=await executePushSegments(_0x1fc7d5,_0xd8a378[_0x5c8567(0x89)]?[]:_0x4c3580,_0x23a5df,{'parentId':_0x29e129},_0x1f10b6),_0x5ded5d=_0x3a574a[_0x5c8567(0x83)],_0x3745cf=_0x3a574a[_0x5c8567(0xe2)],_0x42e31f=_0x3a574a[_0x5c8567(0x114)][_0x5c8567(0x83)],_0x14bed2=_0x3a574a[_0x5c8567(0x114)][_0x5c8567(0xe2)],_0x4ccf65=_0x3a574a['activations'][_0x5c8567(0x102)];let _0x58188a;if(_0x51b910&&_0x4c3580[_0x5c8567(0xf6)]===0x1){const _0x31ea91=_0x4c3580[0x0];_0x58188a=_0x31ea91[_0x5c8567(0x7f)]?.['id']??_0x3a574a[_0x5c8567(0x85)][_0x5c8567(0x109)](_0x31ea91['yamlConfig'][_0x5c8567(0xcb)]);}const _0xe0b9b4=await executePushSegmentDeletions(_0x1fc7d5,_0xd8a378['journeysOnly']?[]:_0x24d237,_0x1f10b6);let _0x499f2c=0x0,_0x4573d2=0x0,_0x4a3ee2=0x0;const _0x239266=new Map(_0x4058fc);for(const [_0x49fe0a,_0x8708d3]of _0x3a574a['createdSegmentIds']){_0x239266['set'](_0x49fe0a,_0x8708d3);}if(_0x1e83b1[_0x5c8567(0xf6)]>0x0){const _0x5482be={..._0x23a5df,'segmentNameToId':_0x239266,'existingSegments':_0x4388e8,'activationContext':_0x59ea95},_0x41a8b6=await executePushJourneys(_0x1fc7d5,_0x1e83b1,_0x5482be,{'parentId':_0x29e129,'rootFolderId':_0x2b4e18,'verbose':_0xd8a378['verbose']},_0x1f10b6);_0x499f2c=_0x41a8b6[_0x5c8567(0x83)],_0x4573d2=_0x41a8b6[_0x5c8567(0xe2)];if(_0x51b910&&_0x41a8b6[_0x5c8567(0xd1)][_0x5c8567(0xf6)]===0x1){const _0x1c8d51=_0x41a8b6['results'][0x0];if(_0x1c8d51['journeyId']){const _0x141cfe=getConsoleNextUrl(_0xd8a378[_0x5c8567(0xcf)],_0x5c8567(0x100)+_0x29e129+'/e/'+_0x1c8d51[_0x5c8567(0x91)]+_0x5c8567(0x7b));console[_0x5c8567(0xe1)]('\x20\x20'+a42_0x1078c6[_0x5c8567(0x8d)](_0x141cfe));}}}for(const _0x521216 of _0x5a1c68){console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0x9e)](_0x5c8567(0xc0)+_0x521216['journeyBundleName'])),_0x4a3ee2++;}const _0x18970d=[];if(_0x5ded5d>0x0)_0x18970d[_0x5c8567(0x8c)](_0x5ded5d+_0x5c8567(0x107));if(_0x3745cf>0x0)_0x18970d['push'](_0x3745cf+_0x5c8567(0xc5));if(_0xe0b9b4>0x0)_0x18970d['push'](_0xe0b9b4+'\x20deleted');const _0x25a570=[];if(_0x499f2c>0x0)_0x25a570[_0x5c8567(0x8c)](_0x499f2c+_0x5c8567(0x107));if(_0x4573d2>0x0)_0x25a570[_0x5c8567(0x8c)](_0x4573d2+_0x5c8567(0xc5));if(_0x4a3ee2>0x0)_0x25a570[_0x5c8567(0x8c)](_0x4a3ee2+_0x5c8567(0x97));const _0x43085d=[];if(_0x42e31f>0x0)_0x43085d[_0x5c8567(0x8c)](_0x42e31f+_0x5c8567(0x107));if(_0x14bed2>0x0)_0x43085d[_0x5c8567(0x8c)](_0x14bed2+_0x5c8567(0xc5));if(_0x4ccf65>0x0)_0x43085d[_0x5c8567(0x8c)](_0x4ccf65+_0x5c8567(0x97));console[_0x5c8567(0xe1)](a42_0x1078c6[_0x5c8567(0xc1)](_0x5c8567(0xe5)));_0x18970d[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x89)]&&console[_0x5c8567(0xe1)](_0x5c8567(0xf5)+_0x18970d[_0x5c8567(0x80)](',\x20'));_0x25a570[_0x5c8567(0xf6)]>0x0&&console[_0x5c8567(0xe1)](_0x5c8567(0x76)+_0x25a570['join'](',\x20'));_0x43085d[_0x5c8567(0xf6)]>0x0&&!_0xd8a378[_0x5c8567(0x89)]&&console[_0x5c8567(0xe1)]('\x20\x20Activations:\x20'+_0x43085d['join'](',\x20'));if(_0x58188a){const _0x51ab9a=getConsoleNextUrl(_0xd8a378[_0x5c8567(0xcf)],_0x5c8567(0x100)+_0x29e129+_0x5c8567(0x101)+_0x58188a+'/sb/da/esr');console[_0x5c8567(0xe1)](_0x5c8567(0xaa)+a42_0x1078c6['cyan'](_0x51ab9a));}return 0x0;}}
|
|
1
|
+
function a41_0x3194(){const _0x2a4bf9=['results','\x0aError:','then','journey','1107047zkdmrV','Push\x20','green','3529370iHdjvs','\x20created','description','/app/ps/','list','error','cyan','diff','Site:\x20','user','\x20to\x20delete','dim','folderId','relationships','listFolders','Parent\x20segment:\x20','Resolving\x20parent\x20segment\x20\x27','existingJourney','journeyId','/e/','toDelete','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20updated','.yaml','get','\x20\x20🗺️\x20\x20Journeys:','endsWith','8424768TVeiob','New\x20segment:','existingSegment','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','183tBmmKL','scopedFolderPath','paused','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','yamlConfig','\x0aValidation\x20failed:','setPhase','journeyBundleName','8MGJQeT','\x20deleted','site','targetDir','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','segment\x20or\x20journey','Fetching\x20existing\x20activations...','Delete\x20journey:','\x20YAML\x20files\x20found','nameToType','\x20\x20Journeys:\x20','\x20\x20📊\x20Segments:','\x20\x20Source:\x20','9354yToGgH','Changes\x20to:','getParent','journeyBundleId','buildUserMaps','folders','createdAt','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','connection','audienceId','segment:push','length','Folders\x20to\x20create:','No\x20','Error\x20parsing\x20YAML:\x20','no_parent','New\x20journey:','add','repeat','toString','\x20new','state','journeysOnly','folderPath','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','errorCode','Aborted.','/sb/da/esr','\x20unchanged','created','yes','verbose','parentName','push','yellow','parentSegment','type','segment','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20changes?','name','attributes','segmentFolderId','isNew','\x20\x20Activations:\x20','message','\x20changed','isScoped','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','map','4VjepOr','Delete\x20segment:','filter','new','segments','set','data','Error:\x20Directory\x20not\x20found:\x20','\x20to\x20update','dryRun','Error:\x20','35385840dMmAkG','join','changed','delete','\x0aPush\x20summary\x20for\x20\x27','versionNumber','11518020VgwFDB','Changes\x20to\x20journey:','parentFolder','blue','all','parent_name','\x20\x20Segments:\x20','\x20to\x20create','(Journey\x20will\x20be\x20deleted)','\x0a✔\x20Push\x20complete','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','nameToId','activations','idToName','\x20\x20Activations:','deleted','toUpdate','\x20folders\x20to\x20create','journeys','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)','updated','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20activations]','execute','/j/da/je','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','Fetching\x20existing\x20data...','createdSegmentIds','helpText','6431180jgnuIG','\x20\x20\x20\x20','getOutputSchemaWithCache'];a41_0x3194=function(){return _0x2a4bf9;};return a41_0x3194();}const a41_0x38a3d6=a41_0x323d;(function(_0x42e0a0,_0x177d5b){const _0x503975=a41_0x323d,_0x293320=_0x42e0a0();while(!![]){try{const _0x21a801=parseInt(_0x503975(0x111))/0x1+parseInt(_0x503975(0xa8))/0x2*(parseInt(_0x503975(0x93))/0x3)+-parseInt(_0x503975(0xdb))/0x4*(parseInt(_0x503975(0x114))/0x5)+parseInt(_0x503975(0x8f))/0x6+parseInt(_0x503975(0x10a))/0x7+parseInt(_0x503975(0x9b))/0x8*(parseInt(_0x503975(0xec))/0x9)+-parseInt(_0x503975(0xe6))/0xa;if(_0x21a801===_0x177d5b)break;else _0x293320['push'](_0x293320['shift']());}catch(_0x3ee77e){_0x293320['push'](_0x293320['shift']());}}}(a41_0x3194,0xb73c6));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a41_0x323d(_0x3567fb,_0x10fbae){_0x3567fb=_0x3567fb-0x7e;const _0x319430=a41_0x3194();let _0x323dc2=_0x319430[_0x3567fb];return _0x323dc2;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x492237 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{[a41_0x38a3d6(0xd1)]=a41_0x38a3d6(0xb2);[a41_0x38a3d6(0x116)]=a41_0x38a3d6(0xc1);async[a41_0x38a3d6(0x104)](_0x16e7c2){const _0x46782e=a41_0x38a3d6,{options:_0x41b856,args:_0x2aa4d9,tdx:_0x3fcacc}=_0x16e7c2,_0x419de6=_0x41b856,_0x46c569=await resolveTarget({'arg':_0x2aa4d9[0x0],'contextParent':_0x41b856[_0x46782e(0xcc)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x46c569))return _0x46c569[_0x46782e(0xc2)]===_0x46782e(0xb7)?(console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xcb)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x46782e(0x119)](_0x46782e(0x100)),console[_0x46782e(0x119)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x46782e(0x119)](_0x46782e(0xf7))):(console['error'](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xe5)+_0x46c569[_0x46782e(0xd6)]+'\x0a')),_0x46c569['helpText']&&console['error'](a41_0x492237[_0x46782e(0x11a)](_0x46c569[_0x46782e(0x109)]))),0x1;if(_0x46c569['type']===_0x46782e(0xf1))return console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xe2)+_0x46c569['targetDir']+'\x0a')),console[_0x46782e(0x119)](a41_0x492237['cyan'](_0x46782e(0xd9))),0x1;const _0x5c0639=_0x46c569[_0x46782e(0xc9)],_0x34c122=_0x46c569[_0x46782e(0x9e)],_0x106583=_0x46c569[_0x46782e(0xcd)]==='file'?_0x46c569['filePath']:undefined,_0x2b255d=getScopedDetails(_0x46c569),_0x10a81c=_0x2b255d?.[_0x46782e(0xd8)]??![],_0x575cd0=_0x2b255d?.[_0x46782e(0x94)]??'';if(!existsSync(_0x34c122))return console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xe2)+_0x34c122+'\x0a')),console['error'](a41_0x492237[_0x46782e(0x11a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x419de6[_0x46782e(0xc8)]&&(console[_0x46782e(0x119)](_0x46782e(0x11c)+_0x419de6['site']),console[_0x46782e(0x119)](_0x46782e(0x83)+_0x5c0639),console[_0x46782e(0x119)]('Source\x20directory:\x20'+_0x34c122),_0x10a81c&&console[_0x46782e(0x119)]('Scoped\x20to\x20folder:\x20'+_0x575cd0));const _0x30ff48=await withSpinner(_0x46782e(0x84)+_0x5c0639+'\x27...',()=>_0x3fcacc['segment']['resolveParentId'](_0x5c0639),{'verbose':_0x419de6['verbose']}),_0x41e08b=_0x30ff48[_0x46782e(0xe1)],{parentSegmentResult:_0x471212,segmentsResult:_0xa99167,foldersResult:_0x365edc,journeysWithDetailsResult:_0x34740e,userMaps:_0xb8864b}=await withSpinner(_0x46782e(0x107),async()=>{const _0x4e0423=_0x46782e,[_0xe9d1fb,_0x2562b2,_0x4de699,_0x5ae7eb,_0x8ff6af]=await Promise[_0x4e0423(0xf0)]([_0x3fcacc['segment'][_0x4e0423(0xaa)](_0x41e08b),_0x3fcacc[_0x4e0423(0xce)]['listSegments'](_0x41e08b),_0x3fcacc[_0x4e0423(0xce)][_0x4e0423(0x82)](_0x41e08b),_0x3fcacc[_0x4e0423(0x110)]['listJourneysWithDetailsFromParentSegment'](_0x41e08b,{'includeAllVersions':!![]}),_0x3fcacc[_0x4e0423(0x11d)][_0x4e0423(0xac)]()]);return{'parentSegmentResult':_0xe9d1fb,'segmentsResult':_0x2562b2,'foldersResult':_0x4de699,'journeysWithDetailsResult':_0x5ae7eb,'userMaps':_0x8ff6af};},{'verbose':_0x419de6[_0x46782e(0xc8)]})[_0x46782e(0x10f)](_0x49e403=>_0x49e403[_0x46782e(0xe1)]),_0x2d2bfe=_0x471212,_0x16dc91=extractRootFolderId(_0x2d2bfe),_0x427bcb=_0xa99167,_0x3975ed=_0x365edc,{journeys:_0x292b23,activationStepsById:_0x4fc8d5}=_0x34740e,_0x234b5f=new Map(_0x292b23[_0x46782e(0xda)](_0x1eedc3=>[_0x1eedc3['id'],_0x1eedc3])),_0x20a812=_0x292b23[_0x46782e(0xda)](_0x2d9f9e=>({'id':_0x2d9f9e['id'],'name':_0x2d9f9e['attributes'][_0x46782e(0xd1)],'journeyBundleName':_0x2d9f9e['attributes'][_0x46782e(0x9a)]||'','journeyBundleId':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0xab)]||'','versionNumber':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0xeb)],'description':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0x116)],'state':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0xbd)],'paused':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0x95)],'audienceId':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0xb1)],'folderId':_0x2d9f9e[_0x46782e(0x81)]?.[_0x46782e(0xee)]?.[_0x46782e(0xe1)]?.['id'],'createdAt':_0x2d9f9e[_0x46782e(0xd2)][_0x46782e(0xae)],'updatedAt':_0x2d9f9e[_0x46782e(0xd2)]['updatedAt']})),{emailToId:_0x58b3b9,idToEmail:_0x540ce7}=_0xb8864b,_0x35116a=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0xb7b24c=_0x46782e,_0x156ec6=await _0x3fcacc[_0xb7b24c(0xb0)][_0xb7b24c(0x118)]();return buildConnectionMaps(_0x156ec6);},{'verbose':_0x419de6[_0x46782e(0xc8)]})[_0x46782e(0x10f)](_0x4429a2=>_0x4429a2[_0x46782e(0xe1)]),_0x1e89c6=_0x35116a[_0x46782e(0xf8)],_0x4df79a=_0x35116a[_0x46782e(0xfa)],_0x4cd2a3=_0x35116a[_0x46782e(0xa4)],_0x59baa4={'emailToIdMap':_0x58b3b9,'connectionNameToIdMap':_0x1e89c6,'connectionNameToTypeMap':_0x4cd2a3,'getSchema':_0x1f4f0a=>_0x3fcacc[_0x46782e(0xb0)][_0x46782e(0x10c)](_0x1f4f0a)};let {pathToId:_0x531a8f,idToPath:_0x2073f7}=buildFolderMaps(_0x3975ed);const _0x4fa505=buildSegmentLookupMap(_0x427bcb,_0x2073f7),_0x4ab3ae=buildSegmentNameToIdMap(_0x427bcb),_0x289ad3=buildJourneyBundleLookupMap(_0x20a812,_0x2073f7);let _0x414620;if(_0x106583){if(!_0x106583[_0x46782e(0x8e)]('.yml')&&!_0x106583[_0x46782e(0x8e)](_0x46782e(0x8b)))return console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0x96)+_0x106583+'\x0a')),0x1;_0x414620=[_0x106583];}else _0x414620=findYamlFiles(_0x34c122);if(_0x414620[_0x46782e(0xb3)]===0x0)return console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0x89)+_0x34c122+'\x0a')),console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0x11a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x228174,_0x26240c;try{const _0x2a1ce3=parseAndClassifyYamlFiles(_0x414620,_0x34c122,{'skipSegments':_0x419de6['journeysOnly']});_0x228174=_0x2a1ce3['segments'],_0x26240c=_0x2a1ce3[_0x46782e(0xff)];const _0x6e1581=validateParsedFiles(_0x2a1ce3,_0x34c122);if(_0x6e1581[_0x46782e(0xb3)]>0x0)return console[_0x46782e(0x119)](a41_0x492237['red'](_0x46782e(0x98))),console['error'](formatValidationErrors(_0x6e1581)),console['error'](a41_0x492237[_0x46782e(0xcb)](_0x46782e(0x9f))),0x1;}catch(_0x567a46){return console['error'](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xb6)+(_0x567a46 instanceof Error?_0x567a46[_0x46782e(0xd6)]:_0x567a46))),0x1;}if(_0x228174['length']===0x0&&_0x26240c[_0x46782e(0xb3)]===0x0){const _0x42e838=_0x419de6['journeysOnly']?_0x46782e(0x110):_0x46782e(0xa0);return console['error'](a41_0x492237[_0x46782e(0xcb)](_0x46782e(0xb5)+_0x42e838+_0x46782e(0xa3))),0x0;}const _0x23ed5b=new Map();_0x427bcb[_0x46782e(0xb3)]>0x0&&!_0x419de6['journeysOnly']&&await withSpinner(_0x46782e(0xa1),async()=>{await batchAsync(_0x427bcb,async _0x1f3885=>{const _0x267802=a41_0x323d,_0x58080f=await _0x3fcacc[_0x267802(0xce)]['listActivations'](_0x41e08b,_0x1f3885['id']);_0x23ed5b[_0x267802(0xe0)](_0x1f3885['id'],_0x58080f);});},{'verbose':_0x419de6[_0x46782e(0xc8)]});const {segmentFiles:_0x3251c0,foldersToCreate:_0xfee179}=await prepareSegmentFiles(_0x228174,{'segmentByFolderAndName':_0x4fa505,'activationsBySegmentId':_0x23ed5b,'folderPathToId':_0x531a8f,'idToEmailMap':_0x540ce7,'connectionIdToNameMap':_0x4df79a},_0x59baa4,_0x10a81c,_0x575cd0),_0x413921=_0x106583?[]:findSegmentsToDelete(_0x427bcb,_0x228174[_0x46782e(0xda)](({yamlConfig:_0x449d1e,folderPath:_0x1b7f06})=>({'yamlConfig':_0x449d1e,'folderPath':resolveTDFolderPath(_0x1b7f06,_0x10a81c,_0x575cd0)})),_0x2073f7,_0x575cd0,_0x10a81c),{journeyFiles:_0x195f4d,foldersToCreate:_0x24adeb}=await withProgressSpinner('Preparing\x20journeys...',async _0x39b6a6=>prepareJourneyFiles(_0x26240c,{'fetchJourney':async _0x3a7517=>_0x3fcacc[_0x46782e(0x110)]['getJourney'](_0x3a7517[_0x46782e(0x86)]),'journeyBundlesByFolderAndName':_0x289ad3,'folderPathToId':_0x531a8f,'idToEmailMap':_0x540ce7,'connectionIdToNameMap':_0x4df79a,'existingSegments':_0x427bcb,'parentId':_0x41e08b,'deps':_0x3fcacc,'progress':{'update':_0x4bdb67=>{const _0x655c2b=_0x46782e;_0x39b6a6[_0x655c2b(0x99)](_0x4bdb67),_0x419de6[_0x655c2b(0xc8)]&&console['error']('\x20\x20'+_0x4bdb67);}},'journeyById':_0x234b5f,'activationStepsById':_0x4fc8d5},_0x10a81c,_0x575cd0),{'verbose':_0x419de6[_0x46782e(0xc8)]})[_0x46782e(0x10f)](_0x344ad7=>_0x344ad7['data']);for(const _0x1a7820 of _0x24adeb){_0xfee179[_0x46782e(0xb9)](_0x1a7820);}const _0x415183=_0x106583?[]:findJourneysToDelete(_0x20a812,_0x26240c[_0x46782e(0xda)](({yamlConfig:_0x3df9e0,folderPath:_0x31806e})=>({'yamlConfig':_0x3df9e0,'folderPath':resolveTDFolderPath(_0x31806e,_0x10a81c,_0x575cd0)})),_0x2073f7,_0x575cd0,_0x10a81c),_0x2206d1=calculatePushStats(_0x3251c0,_0x195f4d,_0xfee179,_0x413921,_0x415183,!!_0x419de6['delete'],!!_0x419de6[_0x46782e(0xbe)]),_0x52227d=_0x2206d1[_0x46782e(0xdf)][_0x46782e(0xde)],_0x9a4be=_0x2206d1[_0x46782e(0xdf)][_0x46782e(0xe8)],_0x562537=_0x2206d1[_0x46782e(0xdf)]['unchanged'],_0xff0b23=_0x2206d1[_0x46782e(0xdf)][_0x46782e(0x88)],_0xb98995=_0x2206d1[_0x46782e(0xad)]['toCreate'],_0x2c9d95=_0x2206d1[_0x46782e(0xff)][_0x46782e(0xde)],_0x52e71c=_0x2206d1[_0x46782e(0xff)][_0x46782e(0xe8)],_0x2bb382=_0x2206d1[_0x46782e(0xff)]['unchanged'],_0x4e5456=_0x2206d1[_0x46782e(0xff)]['toDelete'],_0x28851b=_0x2206d1[_0x46782e(0xf9)][_0x46782e(0xf0)],_0x4f33ba=_0x2206d1[_0x46782e(0xf9)]['toCreate'],_0x5af0fd=_0x2206d1['activations'][_0x46782e(0xfd)],_0x4eae74=_0x2206d1[_0x46782e(0xf9)][_0x46782e(0x88)];console[_0x46782e(0x119)](_0x46782e(0xea)+_0x5c0639+'\x27:');_0xb98995[_0x46782e(0xb3)]>0x0&&console[_0x46782e(0x119)]('\x20\x20'+a41_0x492237[_0x46782e(0xef)]('📁\x20'+_0xb98995[_0x46782e(0xb3)]+_0x46782e(0xfe)));if(!_0x419de6['journeysOnly']){console[_0x46782e(0x119)](_0x46782e(0xa6)),console['error'](_0x46782e(0x10b)+a41_0x492237[_0x46782e(0x113)]('+\x20'+_0x52227d['length']+_0x46782e(0xbc))),console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237['yellow']('~\x20'+_0x9a4be[_0x46782e(0xb3)]+_0x46782e(0xd7)));if(_0xff0b23[_0x46782e(0xb3)]>0x0)console['error']('\x20\x20\x20\x20'+a41_0x492237[_0x46782e(0xf6)]('-\x20'+_0xff0b23[_0x46782e(0xb3)]+_0x46782e(0x7e)));else _0x413921['length']>0x0&&!_0x419de6['delete']&&console[_0x46782e(0x119)]('\x20\x20\x20\x20'+a41_0x492237['dim'](_0x413921['length']+_0x46782e(0x92)));console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237[_0x46782e(0x7f)]('=\x20'+_0x562537[_0x46782e(0xb3)]+_0x46782e(0xc5)));}if(_0x195f4d[_0x46782e(0xb3)]>0x0||_0x415183[_0x46782e(0xb3)]>0x0){console[_0x46782e(0x119)](_0x46782e(0x8d)),console['error'](_0x46782e(0x10b)+a41_0x492237['green']('+\x20'+_0x2c9d95[_0x46782e(0xb3)]+_0x46782e(0xbc))),console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237['yellow']('~\x20'+_0x52e71c[_0x46782e(0xb3)]+'\x20changed'));if(_0x4e5456[_0x46782e(0xb3)]>0x0)console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237['red']('-\x20'+_0x4e5456[_0x46782e(0xb3)]+_0x46782e(0x7e)));else _0x415183[_0x46782e(0xb3)]>0x0&&!_0x419de6[_0x46782e(0xe9)]&&console['error'](_0x46782e(0x10b)+a41_0x492237['dim'](_0x415183[_0x46782e(0xb3)]+_0x46782e(0x92)));console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237[_0x46782e(0x7f)]('=\x20'+_0x2bb382[_0x46782e(0xb3)]+_0x46782e(0xc5)));}_0x28851b['length']>0x0&&!_0x419de6[_0x46782e(0xbe)]&&(console[_0x46782e(0x119)](''),console['error'](_0x46782e(0xfb)),_0x4f33ba[_0x46782e(0xb3)]>0x0&&console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237['green']('+\x20'+_0x4f33ba['length']+_0x46782e(0xf3))),_0x5af0fd[_0x46782e(0xb3)]>0x0&&console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237[_0x46782e(0xcb)]('~\x20'+_0x5af0fd[_0x46782e(0xb3)]+_0x46782e(0xe3))),_0x4eae74[_0x46782e(0xb3)]>0x0&&console[_0x46782e(0x119)](_0x46782e(0x10b)+a41_0x492237[_0x46782e(0xf6)]('-\x20'+_0x4eae74[_0x46782e(0xb3)]+_0x46782e(0x7e))));console[_0x46782e(0x119)](_0x46782e(0xa7)+a41_0x492237[_0x46782e(0x11a)](_0x34c122)+'\x0a');if(_0xb98995[_0x46782e(0xb3)]>0x0){console[_0x46782e(0x119)](_0x46782e(0xb4));for(const _0x4aabf9 of _0xb98995){console[_0x46782e(0x119)]('\x20\x20'+a41_0x492237[_0x46782e(0xef)]('+')+'\x20'+_0x4aabf9);}console[_0x46782e(0x119)]('');}if(_0x52227d['length']>0x0&&!_0x419de6[_0x46782e(0xbe)])for(const _0x21bd78 of _0x52227d){const _0x115366=_0x21bd78[_0x46782e(0xbf)]?_0x21bd78[_0x46782e(0xbf)]+'/'+_0x21bd78['yamlConfig'][_0x46782e(0xd1)]:_0x21bd78['yamlConfig'][_0x46782e(0xd1)],_0x229f08=_0x21bd78[_0x46782e(0x97)][_0x46782e(0xf9)]?.['length']||0x0,_0x1a3814=_0x229f08>0x0?a41_0x492237[_0x46782e(0x7f)]('\x20['+_0x229f08+_0x46782e(0x103)):'';console[_0x46782e(0x119)]('\x0a'+a41_0x492237['green'](_0x46782e(0x90))+'\x20'+_0x115366+_0x1a3814),console['error']('─'[_0x46782e(0xba)](0x3c)),_0x21bd78['diff']&&console[_0x46782e(0x119)](_0x21bd78['diff']),console[_0x46782e(0x119)]('─'['repeat'](0x3c));}if(_0xff0b23[_0x46782e(0xb3)]>0x0&&!_0x419de6['journeysOnly'])for(const _0x359325 of _0xff0b23){const _0x2203ce=_0x359325[_0x46782e(0xd3)]?_0x2073f7[_0x46782e(0x8c)](_0x359325[_0x46782e(0xd3)][_0x46782e(0xbb)]())||'':'',_0x37f981=_0x2203ce?_0x2203ce+'/'+_0x359325['name']:_0x359325[_0x46782e(0xd1)],_0x4db476=_0x23ed5b[_0x46782e(0x8c)](_0x359325['id'])||[],_0x1bd876=_0x4db476['length']>0x0?a41_0x492237[_0x46782e(0x7f)]('\x20['+_0x4db476[_0x46782e(0xb3)]+'\x20activations]'):'';console['error']('\x0a'+a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xdc))+'\x20'+_0x37f981+_0x1bd876),console['error']('─'['repeat'](0x3c));const _0x5ab4f1=segmentWithActivationsToYaml(_0x359325,_0x4db476,undefined,_0x540ce7,_0x4df79a),_0x592217=segmentToYamlString(_0x5ab4f1),_0x1f27d5=generateDiff(_0x592217,'');console[_0x46782e(0x119)](formatDiffWithColors(_0x1f27d5)),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c));}const _0x33e4a0=_0x3251c0[_0x46782e(0xdd)](_0x46b315=>!_0x46b315['isNew']&&_0x46b315[_0x46782e(0x11b)]);if(_0x33e4a0['length']>0x0&&!_0x419de6[_0x46782e(0xbe)])for(const _0x32233e of _0x33e4a0){const _0x32b64a=_0x32233e[_0x46782e(0xbf)]?_0x32233e['folderPath']+'/'+_0x32233e[_0x46782e(0x97)]['name']:_0x32233e[_0x46782e(0x97)][_0x46782e(0xd1)];console[_0x46782e(0x119)]('\x0a'+a41_0x492237[_0x46782e(0xcb)](_0x46782e(0xa9))+'\x20'+_0x32b64a),console[_0x46782e(0x119)]('─'['repeat'](0x3c)),console[_0x46782e(0x119)](_0x32233e[_0x46782e(0x11b)]),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c));}if(_0x2c9d95['length']>0x0)for(const _0x3a8e70 of _0x2c9d95){const _0x8d2fa6=_0x3a8e70[_0x46782e(0xbf)]?_0x3a8e70[_0x46782e(0xbf)]+'/'+_0x3a8e70['yamlConfig'][_0x46782e(0xd1)]:_0x3a8e70['yamlConfig'][_0x46782e(0xd1)];console[_0x46782e(0x119)]('\x0a'+a41_0x492237['green'](_0x46782e(0xb8))+'\x20'+_0x8d2fa6),console[_0x46782e(0x119)]('─'['repeat'](0x3c)),_0x3a8e70[_0x46782e(0x11b)]&&console[_0x46782e(0x119)](_0x3a8e70[_0x46782e(0x11b)]),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c));}const _0x3f63d5=_0x195f4d[_0x46782e(0xdd)](_0x47dafe=>!_0x47dafe[_0x46782e(0xd4)]&&_0x47dafe['diff']);if(_0x3f63d5[_0x46782e(0xb3)]>0x0)for(const _0x564d8d of _0x3f63d5){const _0x3b0a7f=_0x564d8d[_0x46782e(0xbf)]?_0x564d8d[_0x46782e(0xbf)]+'/'+_0x564d8d['yamlConfig'][_0x46782e(0xd1)]:_0x564d8d[_0x46782e(0x97)][_0x46782e(0xd1)];console['error']('\x0a'+a41_0x492237[_0x46782e(0xcb)](_0x46782e(0xed))+'\x20'+_0x3b0a7f),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c)),console[_0x46782e(0x119)](_0x564d8d[_0x46782e(0x11b)]),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c));}if(_0x4e5456['length']>0x0)for(const _0x5636cc of _0x4e5456){const _0x1d78f2=_0x5636cc[_0x46782e(0x80)]?_0x2073f7[_0x46782e(0x8c)](_0x5636cc['folderId'])||'':'',_0x14c195=_0x1d78f2?_0x1d78f2+'/'+_0x5636cc['journeyBundleName']:_0x5636cc['journeyBundleName'];console[_0x46782e(0x119)]('\x0a'+a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xa2))+'\x20'+_0x14c195),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c)),console['error'](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0xf4))),console[_0x46782e(0x119)]('─'[_0x46782e(0xba)](0x3c));}if(_0x419de6[_0x46782e(0xe4)])return console[_0x46782e(0x119)](a41_0x492237['yellow'](_0x46782e(0xc0))),0x0;const _0x4db75d=_0x419de6[_0x46782e(0xbe)]?![]:_0x52227d[_0x46782e(0xb3)]>0x0||_0x9a4be['length']>0x0||_0xff0b23['length']>0x0,_0x79657f=_0x2c9d95[_0x46782e(0xb3)]>0x0||_0x52e71c[_0x46782e(0xb3)]>0x0||_0x4e5456[_0x46782e(0xb3)]>0x0,_0x4f8eb4=_0x419de6[_0x46782e(0xbe)]?![]:_0x28851b[_0x46782e(0xb3)]>0x0,_0x2d9ff4=_0xb98995[_0x46782e(0xb3)]>0x0;if(!_0x4db75d&&!_0x79657f&&!_0x4f8eb4&&!_0x2d9ff4){const _0x5f4242=_0x419de6[_0x46782e(0xbe)]?_0x46782e(0x106):_0x46782e(0x102);console[_0x46782e(0x119)](a41_0x492237['green'](_0x5f4242));if(_0x106583&&_0x562537[_0x46782e(0xb3)]===0x1){const _0x4edfda=_0x562537[0x0];if(_0x4edfda[_0x46782e(0x91)]?.['id']){const _0x1df359=getConsoleNextUrl(_0x419de6[_0x46782e(0x9d)],_0x46782e(0x117)+_0x41e08b+'/e/'+_0x4edfda[_0x46782e(0x91)]['id']+_0x46782e(0xc4));console[_0x46782e(0x119)](_0x46782e(0xaf)+a41_0x492237[_0x46782e(0x11a)](_0x1df359));}}if(_0x106583&&_0x2bb382[_0x46782e(0xb3)]===0x1){const _0x4f284d=_0x2bb382[0x0];if(_0x4f284d[_0x46782e(0x85)]?.['id']){const _0x4dc94b=getConsoleNextUrl(_0x419de6[_0x46782e(0x9d)],_0x46782e(0x117)+_0x41e08b+_0x46782e(0x87)+_0x4f284d[_0x46782e(0x85)]['id']+_0x46782e(0x105));console['error']('\x20\x20'+a41_0x492237['cyan'](_0x4dc94b));}}return 0x0;}const _0x407d41=_0x419de6['journeysOnly']?_0x2c9d95[_0x46782e(0xb3)]+_0x52e71c['length']+_0x4e5456[_0x46782e(0xb3)]+_0xb98995[_0x46782e(0xb3)]:_0x52227d[_0x46782e(0xb3)]+_0x9a4be[_0x46782e(0xb3)]+_0xff0b23[_0x46782e(0xb3)]+_0x2c9d95['length']+_0x52e71c[_0x46782e(0xb3)]+_0x4e5456['length']+_0xb98995[_0x46782e(0xb3)]+_0x28851b[_0x46782e(0xb3)];if(!_0x419de6[_0x46782e(0xc7)]&&_0x407d41>0x0){if(!isInteractive())return console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)](_0x46782e(0x10e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a41_0x492237['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5b8706=await confirmKey(_0x46782e(0x112)+_0x407d41+_0x46782e(0xd0));if(!_0x5b8706)return console[_0x46782e(0x119)](a41_0x492237['yellow'](_0x46782e(0xc3))),0x1;}const _0x169816={'withProgress':async(_0x2d2359,_0x1d007d)=>{const _0x181a15=_0x46782e,_0x4aa91b=await withSpinner(_0x2d2359,_0x1d007d,{'verbose':_0x419de6[_0x181a15(0xc8)]});return{'data':_0x4aa91b['data']};},'logInfo':_0x41160f=>console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xef)]('✔\x20'+_0x41160f)),'logSuccess':_0x4067b5=>console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0x113)]('✔\x20'+_0x4067b5)),'logWarning':_0x4fadbc=>console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xcb)]('⚠\x20'+_0x4fadbc)),'logDeleted':_0x32709b=>console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xf6)]('✔\x20'+_0x32709b))},_0x26453c={'segment':_0x3fcacc['segment'],'journey':_0x3fcacc[_0x46782e(0x110)],'user':_0x3fcacc[_0x46782e(0x11d)],'connection':_0x3fcacc['connection']};_0xb98995[_0x46782e(0xb3)]>0x0&&(_0x531a8f=await executePushFolders(_0x26453c,_0xb98995,_0x531a8f,{'parentId':_0x41e08b},_0x169816));const _0xbd35ae={'rootFolderId':_0x16dc91,'folderPathToId':_0x531a8f,'folderIdToPath':_0x2073f7,'segmentNameToId':_0x4ab3ae,'activationsBySegmentId':_0x23ed5b,'emailToIdMap':_0x58b3b9,'idToEmailMap':_0x540ce7,'connectionNameToIdMap':_0x35116a[_0x46782e(0xf8)],'connectionIdToNameMap':_0x35116a[_0x46782e(0xfa)],'connectionNameToTypeMap':_0x4cd2a3},_0x6588b3=await executePushSegments(_0x26453c,_0x419de6[_0x46782e(0xbe)]?[]:_0x3251c0,_0xbd35ae,{'parentId':_0x41e08b},_0x169816),_0x41cf38=_0x6588b3['created'],_0x5ada58=_0x6588b3[_0x46782e(0x101)],_0x4565db=_0x6588b3[_0x46782e(0xf9)][_0x46782e(0xc6)],_0x115ad2=_0x6588b3[_0x46782e(0xf9)][_0x46782e(0x101)],_0x338828=_0x6588b3['activations'][_0x46782e(0xfc)];let _0x46cb5b;if(_0x106583&&_0x3251c0[_0x46782e(0xb3)]===0x1){const _0xc3ae2c=_0x3251c0[0x0];_0x46cb5b=_0xc3ae2c[_0x46782e(0x91)]?.['id']??_0x6588b3[_0x46782e(0x108)][_0x46782e(0x8c)](_0xc3ae2c[_0x46782e(0x97)]['name']);}const _0x33cdea=await executePushSegmentDeletions(_0x26453c,_0x419de6[_0x46782e(0xbe)]?[]:_0xff0b23,_0x169816);let _0x1d49b0=0x0,_0x31f446=0x0,_0x3632d8=0x0;const _0x61f4c1=new Map(_0x4ab3ae);for(const [_0x40fd63,_0x213d27]of _0x6588b3[_0x46782e(0x108)]){_0x61f4c1['set'](_0x40fd63,_0x213d27);}if(_0x195f4d[_0x46782e(0xb3)]>0x0){const _0x5060f0={..._0xbd35ae,'segmentNameToId':_0x61f4c1,'existingSegments':_0x427bcb,'activationContext':_0x59baa4},_0x122936=await executePushJourneys(_0x26453c,_0x195f4d,_0x5060f0,{'parentId':_0x41e08b,'rootFolderId':_0x16dc91,'verbose':_0x419de6['verbose']},_0x169816);_0x1d49b0=_0x122936[_0x46782e(0xc6)],_0x31f446=_0x122936[_0x46782e(0x101)];if(_0x106583&&_0x122936[_0x46782e(0x10d)][_0x46782e(0xb3)]===0x1){const _0x2bc21a=_0x122936[_0x46782e(0x10d)][0x0];if(_0x2bc21a[_0x46782e(0x86)]){const _0x9c9111=getConsoleNextUrl(_0x419de6['site'],_0x46782e(0x117)+_0x41e08b+'/e/'+_0x2bc21a[_0x46782e(0x86)]+_0x46782e(0x105));console[_0x46782e(0x119)]('\x20\x20'+a41_0x492237[_0x46782e(0x11a)](_0x9c9111));}}}for(const _0x57ffe8 of _0x4e5456){console[_0x46782e(0x119)](a41_0x492237[_0x46782e(0xcb)](_0x46782e(0xcf)+_0x57ffe8['journeyBundleName'])),_0x3632d8++;}const _0x5e32b9=[];if(_0x41cf38>0x0)_0x5e32b9[_0x46782e(0xca)](_0x41cf38+_0x46782e(0x115));if(_0x5ada58>0x0)_0x5e32b9[_0x46782e(0xca)](_0x5ada58+_0x46782e(0x8a));if(_0x33cdea>0x0)_0x5e32b9[_0x46782e(0xca)](_0x33cdea+_0x46782e(0x9c));const _0x2fc841=[];if(_0x1d49b0>0x0)_0x2fc841['push'](_0x1d49b0+_0x46782e(0x115));if(_0x31f446>0x0)_0x2fc841[_0x46782e(0xca)](_0x31f446+_0x46782e(0x8a));if(_0x3632d8>0x0)_0x2fc841[_0x46782e(0xca)](_0x3632d8+'\x20deleted');const _0x165fe6=[];if(_0x4565db>0x0)_0x165fe6[_0x46782e(0xca)](_0x4565db+_0x46782e(0x115));if(_0x115ad2>0x0)_0x165fe6['push'](_0x115ad2+_0x46782e(0x8a));if(_0x338828>0x0)_0x165fe6[_0x46782e(0xca)](_0x338828+_0x46782e(0x9c));console['error'](a41_0x492237[_0x46782e(0x113)](_0x46782e(0xf5)));_0x5e32b9[_0x46782e(0xb3)]>0x0&&!_0x419de6['journeysOnly']&&console[_0x46782e(0x119)](_0x46782e(0xf2)+_0x5e32b9[_0x46782e(0xe7)](',\x20'));_0x2fc841[_0x46782e(0xb3)]>0x0&&console[_0x46782e(0x119)](_0x46782e(0xa5)+_0x2fc841[_0x46782e(0xe7)](',\x20'));_0x165fe6[_0x46782e(0xb3)]>0x0&&!_0x419de6[_0x46782e(0xbe)]&&console[_0x46782e(0x119)](_0x46782e(0xd5)+_0x165fe6[_0x46782e(0xe7)](',\x20'));if(_0x46cb5b){const _0x1ee497=getConsoleNextUrl(_0x419de6[_0x46782e(0x9d)],_0x46782e(0x117)+_0x41e08b+_0x46782e(0x87)+_0x46cb5b+_0x46782e(0xc4));console[_0x46782e(0x119)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0x492237[_0x46782e(0x11a)](_0x1ee497));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a42_0x1c1334=a42_0x4caa;(function(_0x510485,_0x58ff2c){const _0x5c94d4=a42_0x4caa,_0x43b8ad=_0x510485();while(!![]){try{const _0x1ffa55=parseInt(_0x5c94d4(0xcd))/0x1+-parseInt(_0x5c94d4(0xb9))/0x2*(parseInt(_0x5c94d4(0xc3))/0x3)+-parseInt(_0x5c94d4(0xc6))/0x4*(-parseInt(_0x5c94d4(0xe1))/0x5)+-parseInt(_0x5c94d4(0xb8))/0x6*(-parseInt(_0x5c94d4(0xbd))/0x7)+parseInt(_0x5c94d4(0xdf))/0x8*(-parseInt(_0x5c94d4(0xbc))/0x9)+-parseInt(_0x5c94d4(0xda))/0xa+-parseInt(_0x5c94d4(0xbe))/0xb*(-parseInt(_0x5c94d4(0xd4))/0xc);if(_0x1ffa55===_0x58ff2c)break;else _0x43b8ad['push'](_0x43b8ad['shift']());}catch(_0x3573e8){_0x43b8ad['push'](_0x43b8ad['shift']());}}}(a42_0x51e5,0xcaf4d));function a42_0x51e5(){const _0x2b437e=['Resolving\x20folder\x20\x27','10940950hrXFzg','Parent\x20ID:\x20','kind','INTERNAL','Segment\x20ID:\x20','7960rujBWe','Segment\x20ID\x20missing\x20from\x20resolved\x20path','144405IvIUuN','error','folder','segment','parentId','updateSegmentById','ruleFile','yellow','Error:\x20Cannot\x20update\x20','verbose','rule','includes','segmentId','18bGQgCJ','4fvtmUN','Resolved\x20folder\x20ID:\x20','resolvePathToResource','11511lhYByq','1451338wZlwSY','973148pEzmJx','Examples:','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','data','segmentPath','1702998pSaODt','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','execute','44uxGksL','\x27...','length','Resolved\x20type:\x20','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','name','\x20\x20\x20Path:\x20','1447352qUqGhw','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','type','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segmentName','resolveFolderId','✔\x20Updated\x20segment\x20\x27','264YEknFW','Resolved\x20relative\x20path\x20to:\x20','description','Updating\x20segment\x20\x27','Update\x20existing\x20child\x20segment'];a42_0x51e5=function(){return _0x2b437e;};return a42_0x51e5();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x4caa(_0xfd9141,_0x48c616){_0xfd9141=_0xfd9141-0xb3;const _0x51e5ad=a42_0x51e5();let _0x4caaf0=_0x51e5ad[_0xfd9141];return _0x4caaf0;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0xe463aa from'chalk';export class SegmentUpdateCommand extends BaseCommand{['name']='segment:update';[a42_0x1c1334(0xd6)]=a42_0x1c1334(0xd8);async[a42_0x1c1334(0xc5)](_0x56c5b0){const _0x1c6d08=a42_0x1c1334;console[_0x1c6d08(0xe2)](a42_0xe463aa[_0x1c6d08(0xe8)](_0x1c6d08(0xc4))),console['error'](a42_0xe463aa[_0x1c6d08(0xe8)]('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x571e4a,args:_0x30797d,tdx:_0x4492e3}=_0x56c5b0,_0x122fa9=_0x571e4a;if(_0x30797d[_0x1c6d08(0xc8)]===0x0)return console[_0x1c6d08(0xe2)](_0x1c6d08(0xce)),console[_0x1c6d08(0xe2)](_0x1c6d08(0xd0)),console['error'](_0x1c6d08(0xbf)),console['error'](_0x1c6d08(0xc0)),console[_0x1c6d08(0xe2)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x17700e=_0x30797d[0x0],_0x1b01b1=_0x571e4a[_0x1c6d08(0xc2)];let _0x231e59=_0x17700e;_0x1b01b1&&!_0x17700e[_0x1c6d08(0xb6)]('/')&&(_0x231e59=_0x1b01b1+'/'+_0x17700e,_0x122fa9[_0x1c6d08(0xb4)]&&console[_0x1c6d08(0xe2)](_0x1c6d08(0xd5)+_0x231e59));const _0x2f6bce=await withSpinner('Resolving\x20path\x20\x27'+_0x231e59+_0x1c6d08(0xc7),()=>_0x4492e3[_0x1c6d08(0xe4)][_0x1c6d08(0xbb)](_0x231e59),{'verbose':_0x122fa9[_0x1c6d08(0xb4)]}),_0x195fcb=_0x2f6bce[_0x1c6d08(0xc1)];_0x122fa9[_0x1c6d08(0xb4)]&&console['error'](_0x1c6d08(0xc9)+_0x195fcb['type']);if(_0x195fcb[_0x1c6d08(0xcf)]!==_0x1c6d08(0xe4))return console[_0x1c6d08(0xe2)](_0x1c6d08(0xb3)+_0x195fcb[_0x1c6d08(0xcf)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0x1c6d08(0xca)),0x1;if(!_0x195fcb[_0x1c6d08(0xb7)])throw new SDKError(ErrorCode[_0x1c6d08(0xdd)],_0x1c6d08(0xe0));const _0x16f5e4=_0x195fcb[_0x1c6d08(0xe5)],_0x38c821=_0x195fcb['segmentId'];_0x122fa9[_0x1c6d08(0xb4)]&&(console['error'](_0x1c6d08(0xdb)+_0x16f5e4),console[_0x1c6d08(0xe2)](_0x1c6d08(0xde)+_0x38c821));let _0x1d5b95;if(_0x122fa9[_0x1c6d08(0xe3)]){const _0x2bda74=_0x122fa9[_0x1c6d08(0xe3)],_0x302986=await withSpinner(_0x1c6d08(0xd9)+_0x2bda74+'\x27...',()=>_0x4492e3[_0x1c6d08(0xe4)][_0x1c6d08(0xd2)](_0x16f5e4,_0x2bda74),{'verbose':_0x122fa9['verbose']});_0x1d5b95=parseInt(_0x302986[_0x1c6d08(0xc1)],0xa),_0x122fa9[_0x1c6d08(0xb4)]&&console[_0x1c6d08(0xe2)](_0x1c6d08(0xba)+_0x1d5b95);}const _0x301b3d=await loadJSONFromOptions(_0x122fa9[_0x1c6d08(0xb5)],_0x122fa9[_0x1c6d08(0xe7)]),_0xf32bae={'name':_0x122fa9[_0x1c6d08(0xcb)],'description':_0x122fa9['description'],'rule':_0x301b3d,'kind':_0x122fa9[_0x1c6d08(0xdc)]!==undefined?parseInt(_0x122fa9[_0x1c6d08(0xdc)],0xa):undefined,'segmentFolderId':_0x1d5b95},_0x29d22f=await withSpinner(_0x1c6d08(0xd7)+_0x195fcb[_0x1c6d08(0xd1)]+_0x1c6d08(0xc7),()=>_0x4492e3[_0x1c6d08(0xe4)][_0x1c6d08(0xe6)](_0x16f5e4,_0x38c821,_0xf32bae),{'verbose':_0x122fa9[_0x1c6d08(0xb4)]}),_0x3ab8b1=_0x29d22f[_0x1c6d08(0xc1)];return console[_0x1c6d08(0xe2)](_0x1c6d08(0xd3)+_0x3ab8b1[_0x1c6d08(0xcb)]+'\x27'),_0x231e59!==_0x17700e&&console[_0x1c6d08(0xe2)](_0x1c6d08(0xcc)+_0x231e59),await handleSDKOutput([_0x3ab8b1],_0x122fa9),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x36ccb3=a43_0x4bcc;(function(_0x7abe2,_0xbb6c28){const _0x23d2a9=a43_0x4bcc,_0x3452b8=_0x7abe2();while(!![]){try{const _0x13547d=-parseInt(_0x23d2a9(0x1dc))/0x1+-parseInt(_0x23d2a9(0x201))/0x2*(-parseInt(_0x23d2a9(0x1f7))/0x3)+-parseInt(_0x23d2a9(0x1e6))/0x4+parseInt(_0x23d2a9(0x1d7))/0x5*(-parseInt(_0x23d2a9(0x1ef))/0x6)+-parseInt(_0x23d2a9(0x1d9))/0x7*(-parseInt(_0x23d2a9(0x206))/0x8)+-parseInt(_0x23d2a9(0x1d4))/0x9+parseInt(_0x23d2a9(0x1de))/0xa*(parseInt(_0x23d2a9(0x1e9))/0xb);if(_0x13547d===_0xbb6c28)break;else _0x3452b8['push'](_0x3452b8['shift']());}catch(_0x52de03){_0x3452b8['push'](_0x3452b8['shift']());}}}(a43_0x4c20,0x99675));import{existsSync,statSync}from'fs';import a43_0x282b99 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a43_0x4bcc(_0x414478,_0xd0cd38){_0x414478=_0x414478-0x1d4;const _0x4c2011=a43_0x4c20();let _0x4bccb2=_0x4c2011[_0x414478];return _0x4bccb2;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x36ccb3(0x1e7)]=a43_0x36ccb3(0x1fa);['description']=a43_0x36ccb3(0x1f2);async[a43_0x36ccb3(0x20d)](_0x410080){const _0x3a284d=a43_0x36ccb3,{options:_0x3b83d8,args:_0x38a8b4,tdx:_0x4ad983}=_0x410080;if(_0x38a8b4[_0x3a284d(0x1fe)]===0x0)return console[_0x3a284d(0x20f)](a43_0x282b99['red']('Error:\x20Path\x20is\x20required\x0a')),console['error']('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x3a284d(0x20f)](_0x3a284d(0x1ec)),console[_0x3a284d(0x20f)](_0x3a284d(0x20c)),console['error'](_0x3a284d(0x1e8)),console[_0x3a284d(0x20f)](_0x3a284d(0x1dd)),console['error']('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0x266a87=_0x38a8b4[0x0],_0x13e7a5=_0x3b83d8[_0x3a284d(0x1f0)];try{if(_0x266a87==='/')return saveSessionContext({'segment_path':undefined},_0x13e7a5),console[_0x3a284d(0x207)](a43_0x282b99[_0x3a284d(0x20b)](_0x3a284d(0x1e5))),0x0;if(existsSync(_0x266a87)&&statSync(_0x266a87)[_0x3a284d(0x1da)]()){let _0x3ec3eb;try{_0x3ec3eb=findTdxConfig(_0x266a87);}catch{return console[_0x3a284d(0x20f)](a43_0x282b99['red']('Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20'+_0x266a87)),console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x209)](_0x3a284d(0x1f8))),0x1;}const _0x4dc255=_0x3ec3eb[_0x3a284d(0x1e1)][_0x3a284d(0x208)];return saveSessionContext({'segment_path':_0x4dc255,'parent_segment':_0x4dc255},_0x13e7a5),console[_0x3a284d(0x207)](a43_0x282b99[_0x3a284d(0x20b)]('✔\x20Context\x20set\x20to:\x20'+a43_0x282b99[_0x3a284d(0x209)](_0x4dc255))),0x0;}const _0x2fbcab=_0x3b83d8[_0x3a284d(0x205)];let _0x558834=_0x266a87;const _0x12328d=parsePath(_0x266a87);if(!_0x12328d['isAbsolute']){if(!_0x2fbcab)return console[_0x3a284d(0x20f)](a43_0x282b99['red'](_0x3a284d(0x200))),console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x209)](_0x3a284d(0x1d6))),0x1;if(_0x266a87==='..'){const _0x5b08e0=_0x2fbcab[_0x3a284d(0x1f4)]('/')[_0x3a284d(0x202)](0x0,-0x1)[_0x3a284d(0x1ff)]('/');_0x558834=_0x5b08e0||'/';}else _0x266a87==='.'?_0x558834=_0x2fbcab:_0x558834=_0x2fbcab+'/'+_0x266a87;_0x3b83d8[_0x3a284d(0x1f5)]&&console[_0x3a284d(0x20f)]('Resolved\x20relative\x20path\x20to:\x20'+_0x558834);}if(_0x558834==='/'||_0x558834==='')return saveSessionContext({'segment_path':undefined},_0x13e7a5),console[_0x3a284d(0x207)](a43_0x282b99[_0x3a284d(0x20b)](_0x3a284d(0x1e5))),0x0;_0x558834=normalizePath(_0x558834);const _0x1afcff=parsePath(_0x558834)[_0x3a284d(0x20a)];if(_0x1afcff[_0x3a284d(0x1fe)]===0x0)return saveSessionContext({'segment_path':undefined},_0x13e7a5),console[_0x3a284d(0x207)](a43_0x282b99[_0x3a284d(0x20b)](_0x3a284d(0x1e5))),0x0;_0x3b83d8['verbose']&&(console[_0x3a284d(0x20f)](_0x3a284d(0x1e4)+_0x3b83d8[_0x3a284d(0x1df)]),console[_0x3a284d(0x20f)](_0x3a284d(0x1fc)+_0x558834));const _0x1a92b4=await withSpinner(_0x3a284d(0x210)+_0x558834+_0x3a284d(0x1ed),()=>_0x4ad983[_0x3a284d(0x1e2)][_0x3a284d(0x1fd)](_0x558834),{'verbose':_0x3b83d8['verbose']}),_0x40dc6c=_0x1a92b4[_0x3a284d(0x1ea)];_0x3b83d8[_0x3a284d(0x1f5)]&&(console[_0x3a284d(0x20f)](_0x3a284d(0x20e)+_0x40dc6c[_0x3a284d(0x1eb)]),console[_0x3a284d(0x20f)](_0x3a284d(0x1ee)+_0x40dc6c[_0x3a284d(0x1e3)]),_0x40dc6c['folderId']&&console[_0x3a284d(0x20f)](_0x3a284d(0x212)+_0x40dc6c[_0x3a284d(0x1f9)]));if(_0x40dc6c[_0x3a284d(0x1eb)]===_0x3a284d(0x1e2))return console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x1fb)](_0x3a284d(0x211))),console[_0x3a284d(0x20f)](_0x3a284d(0x1d5)),console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x209)](_0x3a284d(0x1e0)+_0x40dc6c[_0x3a284d(0x1f6)]+(_0x40dc6c[_0x3a284d(0x1db)]?'/'+_0x40dc6c[_0x3a284d(0x1db)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x40dc6c[_0x3a284d(0x1f3)],'parent_segment':_0x40dc6c[_0x3a284d(0x1f6)]},_0x13e7a5),console[_0x3a284d(0x207)](a43_0x282b99['green'](_0x3a284d(0x1f1)+a43_0x282b99[_0x3a284d(0x209)](_0x40dc6c[_0x3a284d(0x1f3)]))),_0x3b83d8[_0x3a284d(0x1f5)]&&(console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x204)](_0x3a284d(0x1d8))),console[_0x3a284d(0x20f)](a43_0x282b99[_0x3a284d(0x204)](_0x3a284d(0x203)))),0x0;}catch(_0x146690){throw _0x146690;}}}function a43_0x4c20(){const _0xb61c46=['segments','green','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','execute','Resolved\x20path\x20type:\x20','error','Resolving\x20path\x20\x27','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Folder\x20ID:\x20','5553558yFIErG','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','105sOyHbQ','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','62349pzePWT','isDirectory','folderPath','478465qlqSAw','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','20HayKfG','site','Use:\x20tdx\x20segment\x20use\x20','config','segment','parentId','Site:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','1727740CjLgHC','name','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','5790257IbHZBH','data','type','Examples:','\x27...','Parent\x20ID:\x20','113070cJNKoG','session','✔\x20Context\x20set\x20to:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','fullPath','split','verbose','parentName','3qDDmzG','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','folderId','segment:use','red','Target\x20path:\x20','resolvePathToResource','length','join','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','1162706QzKuJG','slice','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','dim','segmentPath','824DiENVc','log','parent_segment','cyan'];a43_0x4c20=function(){return _0xb61c46;};return a43_0x4c20();}
|