@treasuredata/tdx 2026.4.10 → 2026.4.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.d.ts +6 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.d.ts +2 -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/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.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.d.ts.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/templates.js.map +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a40_0x13ccb2=a40_0x4fec;(function(_0x4903e6,_0x14d376){const _0x5542a7=a40_0x4fec,_0x280b45=_0x4903e6();while(!![]){try{const _0x34ebb9=parseInt(_0x5542a7(0xcf))/0x1*(parseInt(_0x5542a7(0xe8))/0x2)+parseInt(_0x5542a7(0xaf))/0x3*(parseInt(_0x5542a7(0xca))/0x4)+parseInt(_0x5542a7(0xae))/0x5*(-parseInt(_0x5542a7(0xe5))/0x6)+-parseInt(_0x5542a7(0xd8))/0x7*(-parseInt(_0x5542a7(0xee))/0x8)+parseInt(_0x5542a7(0xd9))/0x9+parseInt(_0x5542a7(0xb8))/0xa+-parseInt(_0x5542a7(0xb1))/0xb;if(_0x34ebb9===_0x14d376)break;else _0x280b45['push'](_0x280b45['shift']());}catch(_0x26fe68){_0x280b45['push'](_0x280b45['shift']());}}}(a40_0x2396,0x273ce));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a40_0x2396(){const _0xa451ca=['no_parent','execute','length','isNew','parentSegment','file','filter','journeys','995064qFtesT','\x20activations','files','2RattEN','yellow','content','segment:pull','\x0aError:','parentName','2390448IRbQaT','parent_segment','counts','hasChanges','\x20changed\x20files','data','\x20versions)','error','\x20files\x20to\x20','✔\x20Context\x20set:\x20','Target\x20resource:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent','-\x20no\x20files\x20written','segments','journeyVersions','repeat','5wxWQSU','9FzazJr','red','5081725fkCDty','cyan','\x20=\x20','yes','\x20unchanged\x20files','segment','pullSegments','540020bUgYFd','setPhase','green','\x27...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','errorCode','Aborted.','Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files','Pulling\x20segments\x20from\x20\x27','helpText','site','message','\x20journeys','\x20with\x20','\x0aPull\x20summary\x20for\x20\x27','\x20\x20🎯\x20','relativePath','✔\x20Pulled\x20','297324PDMaND','verbose','cwd','\x20new\x20files','type','159437aKAcvR','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20segments','\x20files?','targetDir','\x0aChanges\x20to\x20\x27','\x20\x20🗺️\x20\x20','Site:\x20','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','7cwUlRQ','479691AeDZYX','\x20\x20Target:\x20','dim','absolutePath'];a40_0x2396=function(){return _0xa451ca;};return a40_0x2396();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x494e3e from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a40_0x27d48c from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';function a40_0x4fec(_0x1a57eb,_0xd24e73){_0x1a57eb=_0x1a57eb-0xab;const _0x239663=a40_0x2396();let _0x4fec32=_0x239663[_0x1a57eb];return _0x4fec32;}export class SegmentPullCommand extends BaseCommand{['name']=a40_0x13ccb2(0xeb);['description']=a40_0x13ccb2(0xbf);async[a40_0x13ccb2(0xde)](_0x5e3999){const _0x1e9e18=a40_0x13ccb2,{options:_0x1a87f7,args:_0x392260,tdx:_0x2db320}=_0x5e3999,_0x1d9cd2=_0x1a87f7,_0x4a49b0=await resolveTarget({'arg':_0x392260[0x0],'contextParent':_0x1a87f7[_0x1e9e18(0xe1)],'cwd':process[_0x1e9e18(0xcc)]()});if(!isSuccessfulResolution(_0x4a49b0))return _0x4a49b0[_0x1e9e18(0xbd)]===_0x1e9e18(0xdd)?(console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xe9)](_0x1e9e18(0xd0))),console[_0x1e9e18(0xf5)]('Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)'),console['error'](_0x1e9e18(0xf9)),console[_0x1e9e18(0xf5)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file')):(console['error'](a40_0x494e3e[_0x1e9e18(0xb0)]('Error:\x20'+_0x4a49b0[_0x1e9e18(0xc3)]+'\x0a')),_0x4a49b0[_0x1e9e18(0xc1)]&&console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xb2)](_0x4a49b0['helpText']))),0x1;const _0x556cc5=_0x4a49b0[_0x1e9e18(0xed)],_0x3086a4=_0x4a49b0[_0x1e9e18(0xd3)],_0x3be90b=_0x4a49b0[_0x1e9e18(0xce)]===_0x1e9e18(0xe2)?_0x4a49b0['resourceName']:undefined;_0x1d9cd2[_0x1e9e18(0xcb)]&&(console['error'](_0x1e9e18(0xd6)+_0x1d9cd2[_0x1e9e18(0xc2)]),console[_0x1e9e18(0xf5)]('Parent\x20segment:\x20'+_0x556cc5),_0x3be90b&&console[_0x1e9e18(0xf5)](_0x1e9e18(0xf8)+_0x3be90b));const _0x1a42cb=await withProgressSpinner(_0x1e9e18(0xc0)+_0x556cc5+_0x1e9e18(0xbb),_0x422a5b=>_0x2db320[_0x1e9e18(0xb6)][_0x1e9e18(0xb7)](_0x556cc5,{'targetDir':_0x3086a4,'targetResourceName':_0x3be90b,'verbose':_0x1d9cd2[_0x1e9e18(0xcb)],'progress':{'update':_0x5b17b8=>{const _0x10dccf=_0x1e9e18;_0x422a5b[_0x10dccf(0xb9)](_0x5b17b8),_0x1d9cd2[_0x10dccf(0xcb)]&&console[_0x10dccf(0xf5)]('\x20\x20'+_0x5b17b8);}}}),{'verbose':_0x1d9cd2[_0x1e9e18(0xcb)]}),_0x381eb5=_0x1a42cb[_0x1e9e18(0xf3)];if(_0x381eb5['counts']['segments']===0x0&&_0x381eb5[_0x1e9e18(0xf0)][_0x1e9e18(0xe4)]===0x0)return console[_0x1e9e18(0xf5)](a40_0x494e3e['yellow']('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x381eb5[_0x1e9e18(0xed)]+'\x27')),0x0;const _0xc5c776=_0x381eb5[_0x1e9e18(0xe7)][_0x1e9e18(0xe3)](_0x17f794=>_0x17f794[_0x1e9e18(0xe0)]),_0x276864=_0x381eb5[_0x1e9e18(0xe7)][_0x1e9e18(0xe3)](_0x57382a=>!_0x57382a[_0x1e9e18(0xe0)]&&_0x57382a[_0x1e9e18(0xf1)]),_0x229db8=_0x381eb5[_0x1e9e18(0xe7)]['filter'](_0x2608fc=>!_0x2608fc['isNew']&&!_0x2608fc[_0x1e9e18(0xf1)]);console[_0x1e9e18(0xf5)](_0x1e9e18(0xc6)+_0x381eb5['parentName']+'\x27:'),console[_0x1e9e18(0xf5)](_0x1e9e18(0xc7)+a40_0x494e3e[_0x1e9e18(0xb2)](_0x381eb5[_0x1e9e18(0xf0)][_0x1e9e18(0xab)]+_0x1e9e18(0xd1))+_0x1e9e18(0xc5)+a40_0x494e3e['cyan'](_0x381eb5[_0x1e9e18(0xf0)]['activations']+_0x1e9e18(0xe6)));if(_0x381eb5['counts'][_0x1e9e18(0xe4)]>0x0){const _0x143c11=_0x381eb5[_0x1e9e18(0xf0)][_0x1e9e18(0xac)]>_0x381eb5[_0x1e9e18(0xf0)][_0x1e9e18(0xe4)]?'\x20('+_0x381eb5[_0x1e9e18(0xf0)]['journeyVersions']+_0x1e9e18(0xf4):'';console[_0x1e9e18(0xf5)](_0x1e9e18(0xd5)+a40_0x494e3e['cyan'](_0x381eb5['counts'][_0x1e9e18(0xe4)]+_0x1e9e18(0xc4))+a40_0x494e3e[_0x1e9e18(0xdb)](_0x143c11));}console[_0x1e9e18(0xf5)]('\x20\x20'+a40_0x494e3e[_0x1e9e18(0xba)]('+\x20'+_0xc5c776[_0x1e9e18(0xdf)]+_0x1e9e18(0xcd))),console['error']('\x20\x20'+a40_0x494e3e[_0x1e9e18(0xe9)]('~\x20'+_0x276864[_0x1e9e18(0xdf)]+_0x1e9e18(0xf2))),console[_0x1e9e18(0xf5)]('\x20\x20'+a40_0x494e3e[_0x1e9e18(0xdb)]('=\x20'+_0x229db8[_0x1e9e18(0xdf)]+_0x1e9e18(0xb5))),console[_0x1e9e18(0xf5)](_0x1e9e18(0xda)+a40_0x494e3e[_0x1e9e18(0xb2)](_0x381eb5[_0x1e9e18(0xd3)])+'\x0a');if(_0x276864[_0x1e9e18(0xdf)]>0x0)for(const _0x345d17 of _0x276864){console[_0x1e9e18(0xf5)](_0x1e9e18(0xd4)+_0x345d17[_0x1e9e18(0xc8)]+'\x27:'),console[_0x1e9e18(0xf5)]('─'[_0x1e9e18(0xad)](0x3c)),console['error'](_0x345d17['diff']),console[_0x1e9e18(0xf5)]('─'[_0x1e9e18(0xad)](0x3c));}if(_0x1d9cd2['dryRun'])return console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xe9)](_0x1e9e18(0xd7))),0x0;if(_0xc5c776[_0x1e9e18(0xdf)]===0x0&&_0x276864[_0x1e9e18(0xdf)]===0x0)return console['error'](a40_0x494e3e[_0x1e9e18(0xba)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x381eb5['parentName']},_0x1d9cd2['session']),console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xba)](_0x1e9e18(0xf7)+a40_0x494e3e[_0x1e9e18(0xdb)]('parent_segment')+_0x1e9e18(0xb3)+a40_0x494e3e[_0x1e9e18(0xb2)](_0x381eb5[_0x1e9e18(0xed)]))),0x0;if(!_0x1d9cd2[_0x1e9e18(0xb4)]){if(!isInteractive())return console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xb0)](_0x1e9e18(0xec)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xdb)](_0x1e9e18(0xbc))),0x1;const _0x484aee=await confirmKey('Write\x20'+(_0xc5c776['length']+_0x276864[_0x1e9e18(0xdf)])+_0x1e9e18(0xd2));if(!_0x484aee)return console[_0x1e9e18(0xf5)](a40_0x494e3e[_0x1e9e18(0xe9)](_0x1e9e18(0xbe)),_0x1e9e18(0xfa)),0x1;}for(const _0x431bcf of _0x381eb5[_0x1e9e18(0xe7)]){if(_0x431bcf[_0x1e9e18(0xe0)]||_0x431bcf[_0x1e9e18(0xf1)]){const _0x5e0539=a40_0x27d48c['dirname'](_0x431bcf[_0x1e9e18(0xdc)]);!existsSync(_0x5e0539)&&mkdirSync(_0x5e0539,{'recursive':!![]}),writeFileSync(_0x431bcf[_0x1e9e18(0xdc)],_0x431bcf[_0x1e9e18(0xea)],'utf-8');}}return console[_0x1e9e18(0xf5)](a40_0x494e3e['green'](_0x1e9e18(0xc9)+(_0xc5c776['length']+_0x276864[_0x1e9e18(0xdf)])+_0x1e9e18(0xf6)+_0x381eb5[_0x1e9e18(0xd3)])),saveSessionContext({'parent_segment':_0x381eb5['parentName']},_0x1d9cd2['session']),console['error'](a40_0x494e3e['green'](_0x1e9e18(0xf7)+a40_0x494e3e[_0x1e9e18(0xdb)](_0x1e9e18(0xef))+_0x1e9e18(0xb3)+a40_0x494e3e[_0x1e9e18(0xb2)](_0x381eb5[_0x1e9e18(0xed)]))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a41_0x11c750=a41_0x1604;(function(_0x4d7958,_0xf117d4){const _0x51aaf5=a41_0x1604,_0x3c0337=_0x4d7958();while(!![]){try{const _0x43a514=-parseInt(_0x51aaf5(0xd2))/0x1*(-parseInt(_0x51aaf5(0xef))/0x2)+parseInt(_0x51aaf5(0xb8))/0x3+parseInt(_0x51aaf5(0x10d))/0x4*(parseInt(_0x51aaf5(0xf8))/0x5)+-parseInt(_0x51aaf5(0xcf))/0x6*(-parseInt(_0x51aaf5(0xdc))/0x7)+parseInt(_0x51aaf5(0x77))/0x8*(-parseInt(_0x51aaf5(0xed))/0x9)+parseInt(_0x51aaf5(0xc4))/0xa+-parseInt(_0x51aaf5(0xce))/0xb*(parseInt(_0x51aaf5(0x7c))/0xc);if(_0x43a514===_0xf117d4)break;else _0x3c0337['push'](_0x3c0337['shift']());}catch(_0x13288a){_0x3c0337['push'](_0x3c0337['shift']());}}}(a41_0x3e10,0xb0dfb));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x409a3b from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a41_0x3e10(){const _0xc9067d=['⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Resolving\x20parent\x20segment\x20\x27','scopedFolderPath','/e/','\x20activations]','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Activations:','\x20updated','1375JcPlsZ','6gJqhzz','type','yellow','6VsfWyE','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','add','folders','push','cyan','Error\x20parsing\x20YAML:\x20','user','Delete\x20journey:','\x20\x20Segments:\x20','269871cKGYRC','\x20\x20📊\x20Segments:','results','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','delete','folderPath','dryRun','\x0aError:','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/j/da/je','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20\x20Journeys:\x20','segment','updatedAt','setPhase','Scoped\x20to\x20folder:\x20','Fetching\x20existing\x20data...','18ffsnHu','Changes\x20to\x20journey:','397238eslgId','blue','name','/app/ps/','list','red','verbose','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','parent_name','20fwjMiV','\x20\x20Source:\x20','\x20YAML\x20files\x20found','\x20to\x20create','data','green','getJourney','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','diff','\x20unchanged','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','journeys','Fetching\x20connections\x20for\x20name\x20resolution...','createdSegmentIds','message','Parent\x20segment:\x20','existingSegment','Error:\x20','yamlConfig','targetDir','file','1142828Quqgpy','\x20created','Push\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','helpText','journeysOnly','no_parent','parentName','set','660184fhtZAB','connection','getOutputSchemaWithCache','activations','description','281772FueUNw','Source\x20directory:\x20','\x20deleted','paused','.yaml','dim','map','segmentFolderId','createdAt','isNew','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','listJourneysWithDetailsFromParentSegment','📁\x20','Delete\x20segment:','listActivations','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20folders\x20to\x20create','(Journey\x20will\x20be\x20deleted)','segment:push','toDelete','relationships','new','Folders\x20to\x20create:','journeyBundleName','toUpdate','updated','existingJourney','journeyId','nameToType','filePath','Error:\x20Directory\x20not\x20found:\x20','parentSegment','filter','\x20\x20\x20\x20','execute','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','toString','changed','\x20new','deleted','parentFolder','get','then','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Changes\x20to:','repeat','join','No\x20','.yml','site','\x0aValidation\x20failed:','cwd','\x20changed','created','\x0aPush\x20summary\x20for\x20\x27','\x20to\x20delete','isScoped','length','segments','New\x20segment:','3934227TzIaKD','attributes','unchanged','error','journey','\x20\x20🗺️\x20\x20Journeys:','nameToId','endsWith','resolveParentId','versionNumber','Aborted.','Preparing\x20journeys...','1401420ZLYGbR','Fetching\x20existing\x20activations...'];a41_0x3e10=function(){return _0xc9067d;};return a41_0x3e10();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';function a41_0x1604(_0x2db875,_0x5890d8){_0x2db875=_0x2db875-0x75;const _0x3e10d0=a41_0x3e10();let _0x1604cd=_0x3e10d0[_0x2db875];return _0x1604cd;}export class SegmentPushCommand extends BaseCommand{[a41_0x11c750(0xf1)]=a41_0x11c750(0x8e);[a41_0x11c750(0x7b)]=a41_0x11c750(0xe4);async[a41_0x11c750(0x9e)](_0xd1d369){const _0x21f187=a41_0x11c750,{options:_0x2b0f43,args:_0x49ec45,tdx:_0x1fcfd8}=_0xd1d369,_0x3e8406=_0x2b0f43,_0x45e230=await resolveTarget({'arg':_0x49ec45[0x0],'contextParent':_0x2b0f43[_0x21f187(0x9b)],'cwd':process[_0x21f187(0xaf)]()});if(!isSuccessfulResolution(_0x45e230))return _0x45e230['errorCode']===_0x21f187(0x113)?(console['error'](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xcb))),console[_0x21f187(0xbb)]('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'](_0x21f187(0x8b)),console[_0x21f187(0xbb)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0x109)+_0x45e230[_0x21f187(0x106)]+'\x0a')),_0x45e230[_0x21f187(0x111)]&&console[_0x21f187(0xbb)](a41_0x409a3b['cyan'](_0x45e230[_0x21f187(0x111)]))),0x1;if(_0x45e230[_0x21f187(0xd0)]===_0x21f187(0xf7))return console[_0x21f187(0xbb)](a41_0x409a3b['red'](_0x21f187(0x9a)+_0x45e230[_0x21f187(0x10b)]+'\x0a')),console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd7)](_0x21f187(0xa7))),0x1;const _0x50e828=_0x45e230[_0x21f187(0x75)],_0x1d274c=_0x45e230[_0x21f187(0x10b)],_0x6f8809=_0x45e230[_0x21f187(0xd0)]===_0x21f187(0x10c)?_0x45e230[_0x21f187(0x99)]:undefined,_0xe28f78=getScopedDetails(_0x45e230),_0x32c5b8=_0xe28f78?.[_0x21f187(0xb4)]??![],_0x413d1b=_0xe28f78?.[_0x21f187(0xc8)]??'';if(!existsSync(_0x1d274c))return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0x9a)+_0x1d274c+'\x0a')),console['error'](a41_0x409a3b[_0x21f187(0xd7)](_0x21f187(0xa7))),0x1;_0x3e8406[_0x21f187(0xf5)]&&(console[_0x21f187(0xbb)]('Site:\x20'+_0x3e8406[_0x21f187(0xad)]),console[_0x21f187(0xbb)](_0x21f187(0x107)+_0x50e828),console['error'](_0x21f187(0x7d)+_0x1d274c),_0x32c5b8&&console[_0x21f187(0xbb)](_0x21f187(0xeb)+_0x413d1b));const _0x4e9782=await withSpinner(_0x21f187(0xc7)+_0x50e828+'\x27...',()=>_0x1fcfd8[_0x21f187(0xe8)][_0x21f187(0xc0)](_0x50e828),{'verbose':_0x3e8406[_0x21f187(0xf5)]}),_0x552421=_0x4e9782['data'],{parentSegmentResult:_0x261228,segmentsResult:_0x909c84,foldersResult:_0x3bde4d,journeysWithDetailsResult:_0x2a6a67,userMaps:_0x401aca}=await withSpinner(_0x21f187(0xec),async()=>{const _0x6820d9=_0x21f187,[_0x2adb3b,_0x5ad769,_0x3069ca,_0x4626c0,_0x40e7f3]=await Promise['all']([_0x1fcfd8[_0x6820d9(0xe8)]['getParent'](_0x552421),_0x1fcfd8[_0x6820d9(0xe8)]['listSegments'](_0x552421),_0x1fcfd8[_0x6820d9(0xe8)]['listFolders'](_0x552421),_0x1fcfd8[_0x6820d9(0xbc)][_0x6820d9(0x87)](_0x552421,{'includeAllVersions':!![]}),_0x1fcfd8[_0x6820d9(0xd9)]['buildUserMaps']()]);return{'parentSegmentResult':_0x2adb3b,'segmentsResult':_0x5ad769,'foldersResult':_0x3069ca,'journeysWithDetailsResult':_0x4626c0,'userMaps':_0x40e7f3};},{'verbose':_0x3e8406[_0x21f187(0xf5)]})[_0x21f187(0xa6)](_0x1bca52=>_0x1bca52['data']),_0x5acc68=_0x261228,_0x63f345=extractRootFolderId(_0x5acc68),_0x50c0e5=_0x909c84,_0x461481=_0x3bde4d,{journeys:_0x1644a6,activationStepsById:_0x264605}=_0x2a6a67,_0x508802=new Map(_0x1644a6[_0x21f187(0x82)](_0x326d1f=>[_0x326d1f['id'],_0x326d1f])),_0x49391f=_0x1644a6[_0x21f187(0x82)](_0x552521=>({'id':_0x552521['id'],'name':_0x552521[_0x21f187(0xb9)][_0x21f187(0xf1)],'journeyBundleName':_0x552521['attributes'][_0x21f187(0x93)]||'','journeyBundleId':_0x552521[_0x21f187(0xb9)]['journeyBundleId']||'','versionNumber':_0x552521[_0x21f187(0xb9)][_0x21f187(0xc1)],'description':_0x552521[_0x21f187(0xb9)][_0x21f187(0x7b)],'state':_0x552521[_0x21f187(0xb9)]['state'],'paused':_0x552521[_0x21f187(0xb9)][_0x21f187(0x7f)],'audienceId':_0x552521[_0x21f187(0xb9)]['audienceId'],'folderId':_0x552521[_0x21f187(0x90)]?.[_0x21f187(0xa4)]?.['data']?.['id'],'createdAt':_0x552521[_0x21f187(0xb9)][_0x21f187(0x84)],'updatedAt':_0x552521[_0x21f187(0xb9)][_0x21f187(0xe9)]})),{emailToId:_0x37f1b9,idToEmail:_0x3b2e50}=_0x401aca,_0x1097e5=await withSpinner(_0x21f187(0x104),async()=>{const _0x5e8dd8=_0x21f187,_0x1c3804=await _0x1fcfd8[_0x5e8dd8(0x78)][_0x5e8dd8(0xf3)]();return buildConnectionMaps(_0x1c3804);},{'verbose':_0x3e8406['verbose']})[_0x21f187(0xa6)](_0x3ebd92=>_0x3ebd92['data']),_0x4392b2=_0x1097e5[_0x21f187(0xbe)],_0x1361e8=_0x1097e5['idToName'],_0x3888fa=_0x1097e5[_0x21f187(0x98)],_0x259121={'emailToIdMap':_0x37f1b9,'connectionNameToIdMap':_0x4392b2,'connectionNameToTypeMap':_0x3888fa,'getSchema':_0x58fa36=>_0x1fcfd8[_0x21f187(0x78)][_0x21f187(0x79)](_0x58fa36)};let {pathToId:_0x3936d7,idToPath:_0x37fcc2}=buildFolderMaps(_0x461481);const _0x76623f=buildSegmentLookupMap(_0x50c0e5,_0x37fcc2),_0xd0080a=buildSegmentNameToIdMap(_0x50c0e5),_0xcdde04=buildJourneyBundleLookupMap(_0x49391f,_0x37fcc2);let _0x2017fc;if(_0x6f8809){if(!_0x6f8809['endsWith'](_0x21f187(0xac))&&!_0x6f8809[_0x21f187(0xbf)](_0x21f187(0x80)))return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x6f8809+'\x0a')),0x1;_0x2017fc=[_0x6f8809];}else _0x2017fc=findYamlFiles(_0x1d274c);if(_0x2017fc[_0x21f187(0xb5)]===0x0)return console['error'](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0xff)+_0x1d274c+'\x0a')),console[_0x21f187(0xbb)](a41_0x409a3b['cyan'](_0x21f187(0xf6))),0x1;let _0xbf8fac,_0x450dda;try{const _0x42d30b=parseAndClassifyYamlFiles(_0x2017fc,_0x1d274c,{'skipSegments':_0x3e8406[_0x21f187(0x112)]});_0xbf8fac=_0x42d30b[_0x21f187(0xb6)],_0x450dda=_0x42d30b[_0x21f187(0x103)];const _0x295bb5=validateParsedFiles(_0x42d30b,_0x1d274c);if(_0x295bb5[_0x21f187(0xb5)]>0x0)return console[_0x21f187(0xbb)](a41_0x409a3b['red'](_0x21f187(0xae))),console[_0x21f187(0xbb)](formatValidationErrors(_0x295bb5)),console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xd3))),0x1;}catch(_0x5488b1){return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0xd8)+(_0x5488b1 instanceof Error?_0x5488b1[_0x21f187(0x106)]:_0x5488b1))),0x1;}if(_0xbf8fac[_0x21f187(0xb5)]===0x0&&_0x450dda[_0x21f187(0xb5)]===0x0){const _0x5ac3c9=_0x3e8406[_0x21f187(0x112)]?_0x21f187(0xbc):'segment\x20or\x20journey';return console[_0x21f187(0xbb)](a41_0x409a3b['yellow'](_0x21f187(0xab)+_0x5ac3c9+_0x21f187(0xfa))),0x0;}const _0x8b9ab7=new Map();_0x50c0e5[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)]&&await withSpinner(_0x21f187(0xc5),async()=>{await batchAsync(_0x50c0e5,async _0x17f4ef=>{const _0x3c2278=a41_0x1604,_0x5df7fa=await _0x1fcfd8[_0x3c2278(0xe8)][_0x3c2278(0x8a)](_0x552421,_0x17f4ef['id']);_0x8b9ab7[_0x3c2278(0x76)](_0x17f4ef['id'],_0x5df7fa);});},{'verbose':_0x3e8406[_0x21f187(0xf5)]});const {segmentFiles:_0xcf4a08,foldersToCreate:_0x2870a6}=await prepareSegmentFiles(_0xbf8fac,{'segmentByFolderAndName':_0x76623f,'activationsBySegmentId':_0x8b9ab7,'folderPathToId':_0x3936d7,'idToEmailMap':_0x3b2e50,'connectionIdToNameMap':_0x1361e8},_0x259121,_0x32c5b8,_0x413d1b),_0x555acf=_0x6f8809?[]:findSegmentsToDelete(_0x50c0e5,_0xbf8fac[_0x21f187(0x82)](({yamlConfig:_0x3f1503,folderPath:_0x3b4aa3})=>({'yamlConfig':_0x3f1503,'folderPath':resolveTDFolderPath(_0x3b4aa3,_0x32c5b8,_0x413d1b)})),_0x37fcc2,_0x413d1b,_0x32c5b8),{journeyFiles:_0x1d2a39,foldersToCreate:_0x524ae9}=await withProgressSpinner(_0x21f187(0xc3),async _0x3c6635=>prepareJourneyFiles(_0x450dda,{'fetchJourney':async _0x50e5f9=>_0x1fcfd8[_0x21f187(0xbc)][_0x21f187(0xfe)](_0x50e5f9[_0x21f187(0x97)]),'journeyBundlesByFolderAndName':_0xcdde04,'folderPathToId':_0x3936d7,'idToEmailMap':_0x3b2e50,'connectionIdToNameMap':_0x1361e8,'existingSegments':_0x50c0e5,'parentId':_0x552421,'deps':_0x1fcfd8,'progress':{'update':_0x2851e6=>{const _0x151020=_0x21f187;_0x3c6635[_0x151020(0xea)](_0x2851e6),_0x3e8406[_0x151020(0xf5)]&&console[_0x151020(0xbb)]('\x20\x20'+_0x2851e6);}},'journeyById':_0x508802,'activationStepsById':_0x264605},_0x32c5b8,_0x413d1b),{'verbose':_0x3e8406[_0x21f187(0xf5)]})[_0x21f187(0xa6)](_0x9b9018=>_0x9b9018[_0x21f187(0xfc)]);for(const _0x1c71ef of _0x524ae9){_0x2870a6[_0x21f187(0xd4)](_0x1c71ef);}const _0x4bf4dd=_0x6f8809?[]:findJourneysToDelete(_0x49391f,_0x450dda['map'](({yamlConfig:_0x5240aa,folderPath:_0x6e91c8})=>({'yamlConfig':_0x5240aa,'folderPath':resolveTDFolderPath(_0x6e91c8,_0x32c5b8,_0x413d1b)})),_0x37fcc2,_0x413d1b,_0x32c5b8),_0x14c039=calculatePushStats(_0xcf4a08,_0x1d2a39,_0x2870a6,_0x555acf,_0x4bf4dd,!!_0x3e8406[_0x21f187(0xe0)],!!_0x3e8406[_0x21f187(0x112)]),_0x3985f9=_0x14c039[_0x21f187(0xb6)]['new'],_0x12fbd7=_0x14c039[_0x21f187(0xb6)][_0x21f187(0xa1)],_0x4b0e6f=_0x14c039[_0x21f187(0xb6)][_0x21f187(0xba)],_0x3a72bc=_0x14c039[_0x21f187(0xb6)]['toDelete'],_0x3b94a2=_0x14c039[_0x21f187(0xd5)]['toCreate'],_0x3d9c77=_0x14c039[_0x21f187(0x103)][_0x21f187(0x91)],_0x428a9a=_0x14c039[_0x21f187(0x103)]['changed'],_0x3b4339=_0x14c039[_0x21f187(0x103)][_0x21f187(0xba)],_0xe6058=_0x14c039[_0x21f187(0x103)][_0x21f187(0x8f)],_0x529914=_0x14c039[_0x21f187(0x7a)]['all'],_0x18f996=_0x14c039[_0x21f187(0x7a)]['toCreate'],_0x123b65=_0x14c039['activations'][_0x21f187(0x94)],_0x5c3e04=_0x14c039[_0x21f187(0x7a)][_0x21f187(0x8f)];console[_0x21f187(0xbb)](_0x21f187(0xb2)+_0x50e828+'\x27:');_0x3b94a2[_0x21f187(0xb5)]>0x0&&console['error']('\x20\x20'+a41_0x409a3b['blue'](_0x21f187(0x88)+_0x3b94a2['length']+_0x21f187(0x8c)));if(!_0x3e8406[_0x21f187(0x112)]){console[_0x21f187(0xbb)](_0x21f187(0xdd)),console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xfd)]('+\x20'+_0x3985f9[_0x21f187(0xb5)]+_0x21f187(0xa2))),console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xd1)]('~\x20'+_0x12fbd7['length']+_0x21f187(0xb0)));if(_0x3a72bc[_0x21f187(0xb5)]>0x0)console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0xf4)]('-\x20'+_0x3a72bc[_0x21f187(0xb5)]+'\x20to\x20delete'));else _0x555acf['length']>0x0&&!_0x3e8406[_0x21f187(0xe0)]&&console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b['dim'](_0x555acf['length']+_0x21f187(0xe6)));console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0x81)]('=\x20'+_0x4b0e6f[_0x21f187(0xb5)]+_0x21f187(0x101)));}if(_0x1d2a39['length']>0x0||_0x4bf4dd[_0x21f187(0xb5)]>0x0){console['error'](_0x21f187(0xbd)),console['error'](_0x21f187(0x9d)+a41_0x409a3b['green']('+\x20'+_0x3d9c77[_0x21f187(0xb5)]+'\x20new')),console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0xd1)]('~\x20'+_0x428a9a['length']+'\x20changed'));if(_0xe6058[_0x21f187(0xb5)]>0x0)console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xf4)]('-\x20'+_0xe6058[_0x21f187(0xb5)]+_0x21f187(0xb3)));else _0x4bf4dd[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0xe0)]&&console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0x81)](_0x4bf4dd[_0x21f187(0xb5)]+_0x21f187(0xe6)));console['error'](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0x81)]('=\x20'+_0x3b4339[_0x21f187(0xb5)]+_0x21f187(0x101)));}_0x529914[_0x21f187(0xb5)]>0x0&&!_0x3e8406['journeysOnly']&&(console[_0x21f187(0xbb)](''),console['error'](_0x21f187(0xcc)),_0x18f996[_0x21f187(0xb5)]>0x0&&console['error'](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xfd)]('+\x20'+_0x18f996['length']+_0x21f187(0xfb))),_0x123b65['length']>0x0&&console[_0x21f187(0xbb)](_0x21f187(0x9d)+a41_0x409a3b[_0x21f187(0xd1)]('~\x20'+_0x123b65[_0x21f187(0xb5)]+'\x20to\x20update')),_0x5c3e04[_0x21f187(0xb5)]>0x0&&console[_0x21f187(0xbb)]('\x20\x20\x20\x20'+a41_0x409a3b[_0x21f187(0xf4)]('-\x20'+_0x5c3e04[_0x21f187(0xb5)]+_0x21f187(0xb3))));console[_0x21f187(0xbb)](_0x21f187(0xf9)+a41_0x409a3b[_0x21f187(0xd7)](_0x1d274c)+'\x0a');if(_0x3b94a2[_0x21f187(0xb5)]>0x0){console[_0x21f187(0xbb)](_0x21f187(0x92));for(const _0x232d7c of _0x3b94a2){console['error']('\x20\x20'+a41_0x409a3b['blue']('+')+'\x20'+_0x232d7c);}console[_0x21f187(0xbb)]('');}if(_0x3985f9[_0x21f187(0xb5)]>0x0&&!_0x3e8406['journeysOnly'])for(const _0x3c74f6 of _0x3985f9){const _0x44b2d6=_0x3c74f6[_0x21f187(0xe1)]?_0x3c74f6[_0x21f187(0xe1)]+'/'+_0x3c74f6[_0x21f187(0x10a)][_0x21f187(0xf1)]:_0x3c74f6[_0x21f187(0x10a)][_0x21f187(0xf1)],_0x3b218a=_0x3c74f6[_0x21f187(0x10a)][_0x21f187(0x7a)]?.[_0x21f187(0xb5)]||0x0,_0x1a9d7b=_0x3b218a>0x0?a41_0x409a3b['dim']('\x20['+_0x3b218a+_0x21f187(0xca)):'';console['error']('\x0a'+a41_0x409a3b[_0x21f187(0xfd)](_0x21f187(0xb7))+'\x20'+_0x44b2d6+_0x1a9d7b),console[_0x21f187(0xbb)]('─'['repeat'](0x3c)),_0x3c74f6['diff']&&console['error'](_0x3c74f6[_0x21f187(0x100)]),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));}if(_0x3a72bc[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)])for(const _0x584ace of _0x3a72bc){const _0x1089a6=_0x584ace[_0x21f187(0x83)]?_0x37fcc2['get'](_0x584ace[_0x21f187(0x83)][_0x21f187(0xa0)]())||'':'',_0x32040b=_0x1089a6?_0x1089a6+'/'+_0x584ace['name']:_0x584ace[_0x21f187(0xf1)],_0x732ae4=_0x8b9ab7[_0x21f187(0xa5)](_0x584ace['id'])||[],_0x1749f1=_0x732ae4[_0x21f187(0xb5)]>0x0?a41_0x409a3b['dim']('\x20['+_0x732ae4[_0x21f187(0xb5)]+_0x21f187(0xca)):'';console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b['red'](_0x21f187(0x89))+'\x20'+_0x32040b+_0x1749f1),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));const _0x15b789=segmentWithActivationsToYaml(_0x584ace,_0x732ae4,undefined,_0x3b2e50,_0x1361e8),_0x3587f7=segmentToYamlString(_0x15b789),_0x470269=generateDiff(_0x3587f7,'');console[_0x21f187(0xbb)](formatDiffWithColors(_0x470269)),console['error']('─'[_0x21f187(0xa9)](0x3c));}const _0x2c710e=_0xcf4a08[_0x21f187(0x9c)](_0x35538e=>!_0x35538e[_0x21f187(0x85)]&&_0x35538e[_0x21f187(0x100)]);if(_0x2c710e[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)])for(const _0x5cc286 of _0x2c710e){const _0x3d9803=_0x5cc286[_0x21f187(0xe1)]?_0x5cc286['folderPath']+'/'+_0x5cc286[_0x21f187(0x10a)][_0x21f187(0xf1)]:_0x5cc286[_0x21f187(0x10a)][_0x21f187(0xf1)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xa8))+'\x20'+_0x3d9803),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c)),console[_0x21f187(0xbb)](_0x5cc286[_0x21f187(0x100)]),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));}if(_0x3d9c77['length']>0x0)for(const _0x299420 of _0x3d9c77){const _0x3b725c=_0x299420[_0x21f187(0xe1)]?_0x299420[_0x21f187(0xe1)]+'/'+_0x299420['yamlConfig'][_0x21f187(0xf1)]:_0x299420['yamlConfig'][_0x21f187(0xf1)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xfd)]('New\x20journey:')+'\x20'+_0x3b725c),console['error']('─'[_0x21f187(0xa9)](0x3c)),_0x299420[_0x21f187(0x100)]&&console[_0x21f187(0xbb)](_0x299420[_0x21f187(0x100)]),console['error']('─'[_0x21f187(0xa9)](0x3c));}const _0x32a8ea=_0x1d2a39[_0x21f187(0x9c)](_0x255b3c=>!_0x255b3c[_0x21f187(0x85)]&&_0x255b3c[_0x21f187(0x100)]);if(_0x32a8ea[_0x21f187(0xb5)]>0x0)for(const _0x338300 of _0x32a8ea){const _0x37077f=_0x338300[_0x21f187(0xe1)]?_0x338300[_0x21f187(0xe1)]+'/'+_0x338300[_0x21f187(0x10a)][_0x21f187(0xf1)]:_0x338300['yamlConfig'][_0x21f187(0xf1)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xee))+'\x20'+_0x37077f),console[_0x21f187(0xbb)]('─'['repeat'](0x3c)),console[_0x21f187(0xbb)](_0x338300['diff']),console[_0x21f187(0xbb)]('─'[_0x21f187(0xa9)](0x3c));}if(_0xe6058[_0x21f187(0xb5)]>0x0)for(const _0x3befb4 of _0xe6058){const _0x598233=_0x3befb4['folderId']?_0x37fcc2[_0x21f187(0xa5)](_0x3befb4['folderId'])||'':'',_0x2f196a=_0x598233?_0x598233+'/'+_0x3befb4[_0x21f187(0x93)]:_0x3befb4[_0x21f187(0x93)];console[_0x21f187(0xbb)]('\x0a'+a41_0x409a3b[_0x21f187(0xf4)](_0x21f187(0xda))+'\x20'+_0x2f196a),console['error']('─'[_0x21f187(0xa9)](0x3c)),console[_0x21f187(0xbb)](a41_0x409a3b['red'](_0x21f187(0x8d))),console[_0x21f187(0xbb)]('─'['repeat'](0x3c));}if(_0x3e8406[_0x21f187(0xe2)])return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0x102))),0x0;const _0x28ecc4=_0x3e8406[_0x21f187(0x112)]?![]:_0x3985f9['length']>0x0||_0x12fbd7[_0x21f187(0xb5)]>0x0||_0x3a72bc[_0x21f187(0xb5)]>0x0,_0x178886=_0x3d9c77[_0x21f187(0xb5)]>0x0||_0x428a9a['length']>0x0||_0xe6058['length']>0x0,_0x28a50b=_0x3e8406[_0x21f187(0x112)]?![]:_0x529914['length']>0x0,_0x473ba3=_0x3b94a2[_0x21f187(0xb5)]>0x0;if(!_0x28ecc4&&!_0x178886&&!_0x28a50b&&!_0x473ba3){const _0x5a7c1e=_0x3e8406[_0x21f187(0x112)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x21f187(0x110);console['error'](a41_0x409a3b[_0x21f187(0xfd)](_0x5a7c1e));if(_0x6f8809&&_0x4b0e6f['length']===0x1){const _0x1eb594=_0x4b0e6f[0x0];if(_0x1eb594[_0x21f187(0x108)]?.['id']){const _0x477415=getConsoleNextUrl(_0x3e8406['site'],_0x21f187(0xf2)+_0x552421+'/e/'+_0x1eb594[_0x21f187(0x108)]['id']+'/sb/da/esr');console['error'](_0x21f187(0x86)+a41_0x409a3b['cyan'](_0x477415));}}if(_0x6f8809&&_0x3b4339['length']===0x1){const _0x164926=_0x3b4339[0x0];if(_0x164926[_0x21f187(0x96)]?.['id']){const _0x27fda4=getConsoleNextUrl(_0x3e8406['site'],'/app/ps/'+_0x552421+_0x21f187(0xc9)+_0x164926[_0x21f187(0x96)]['id']+_0x21f187(0xe5));console[_0x21f187(0xbb)]('\x20\x20'+a41_0x409a3b['cyan'](_0x27fda4));}}return 0x0;}const _0x5c741a=_0x3e8406['journeysOnly']?_0x3d9c77[_0x21f187(0xb5)]+_0x428a9a[_0x21f187(0xb5)]+_0xe6058[_0x21f187(0xb5)]+_0x3b94a2[_0x21f187(0xb5)]:_0x3985f9[_0x21f187(0xb5)]+_0x12fbd7['length']+_0x3a72bc['length']+_0x3d9c77[_0x21f187(0xb5)]+_0x428a9a[_0x21f187(0xb5)]+_0xe6058['length']+_0x3b94a2[_0x21f187(0xb5)]+_0x529914['length'];if(!_0x3e8406['yes']&&_0x5c741a>0x0){if(!isInteractive())return console['error'](a41_0x409a3b['red'](_0x21f187(0xe3)),_0x21f187(0x9f)),console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0x81)](_0x21f187(0xdf))),0x1;const _0x1c1ea2=await confirmKey(_0x21f187(0x10f)+_0x5c741a+'\x20changes?');if(!_0x1c1ea2)return console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xd1)](_0x21f187(0xc2))),0x1;}const _0x54af5b={'withProgress':async(_0x1c0916,_0x37a470)=>{const _0x40c91a=_0x21f187,_0x4051ed=await withSpinner(_0x1c0916,_0x37a470,{'verbose':_0x3e8406[_0x40c91a(0xf5)]});return{'data':_0x4051ed['data']};},'logInfo':_0x322a09=>console[_0x21f187(0xbb)](a41_0x409a3b[_0x21f187(0xf0)]('✔\x20'+_0x322a09)),'logSuccess':_0x5109a8=>console['error'](a41_0x409a3b[_0x21f187(0xfd)]('✔\x20'+_0x5109a8)),'logWarning':_0x514d0e=>console[_0x21f187(0xbb)](a41_0x409a3b['yellow']('⚠\x20'+_0x514d0e)),'logDeleted':_0x1539cb=>console[_0x21f187(0xbb)](a41_0x409a3b['red']('✔\x20'+_0x1539cb))},_0x45b0aa={'segment':_0x1fcfd8['segment'],'journey':_0x1fcfd8['journey'],'user':_0x1fcfd8['user'],'connection':_0x1fcfd8[_0x21f187(0x78)]};_0x3b94a2[_0x21f187(0xb5)]>0x0&&(_0x3936d7=await executePushFolders(_0x45b0aa,_0x3b94a2,_0x3936d7,{'parentId':_0x552421},_0x54af5b));const _0x1259d7={'rootFolderId':_0x63f345,'folderPathToId':_0x3936d7,'folderIdToPath':_0x37fcc2,'segmentNameToId':_0xd0080a,'activationsBySegmentId':_0x8b9ab7,'emailToIdMap':_0x37f1b9,'idToEmailMap':_0x3b2e50,'connectionNameToIdMap':_0x1097e5[_0x21f187(0xbe)],'connectionIdToNameMap':_0x1097e5['idToName'],'connectionNameToTypeMap':_0x3888fa},_0x35a3fb=await executePushSegments(_0x45b0aa,_0x3e8406['journeysOnly']?[]:_0xcf4a08,_0x1259d7,{'parentId':_0x552421},_0x54af5b),_0x22a77f=_0x35a3fb[_0x21f187(0xb1)],_0x21fbaf=_0x35a3fb[_0x21f187(0x95)],_0x24968a=_0x35a3fb[_0x21f187(0x7a)][_0x21f187(0xb1)],_0x46dd96=_0x35a3fb[_0x21f187(0x7a)][_0x21f187(0x95)],_0x1cd1b5=_0x35a3fb[_0x21f187(0x7a)][_0x21f187(0xa3)];let _0x1f1ab3;if(_0x6f8809&&_0xcf4a08[_0x21f187(0xb5)]===0x1){const _0x3d7cc5=_0xcf4a08[0x0];_0x1f1ab3=_0x3d7cc5[_0x21f187(0x108)]?.['id']??_0x35a3fb[_0x21f187(0x105)][_0x21f187(0xa5)](_0x3d7cc5[_0x21f187(0x10a)][_0x21f187(0xf1)]);}const _0x2d03f2=await executePushSegmentDeletions(_0x45b0aa,_0x3e8406[_0x21f187(0x112)]?[]:_0x3a72bc,_0x54af5b);let _0x4d4b5d=0x0,_0x37561c=0x0,_0x42937c=0x0;const _0x1e223e=new Map(_0xd0080a);for(const [_0x546d5f,_0x28b1e8]of _0x35a3fb[_0x21f187(0x105)]){_0x1e223e[_0x21f187(0x76)](_0x546d5f,_0x28b1e8);}if(_0x1d2a39[_0x21f187(0xb5)]>0x0){const _0x27ec5f={..._0x1259d7,'segmentNameToId':_0x1e223e,'existingSegments':_0x50c0e5,'activationContext':_0x259121},_0x5d0b54=await executePushJourneys(_0x45b0aa,_0x1d2a39,_0x27ec5f,{'parentId':_0x552421,'rootFolderId':_0x63f345,'verbose':_0x3e8406[_0x21f187(0xf5)]},_0x54af5b);_0x4d4b5d=_0x5d0b54[_0x21f187(0xb1)],_0x37561c=_0x5d0b54[_0x21f187(0x95)];if(_0x6f8809&&_0x5d0b54['results']['length']===0x1){const _0x4b2c96=_0x5d0b54[_0x21f187(0xde)][0x0];if(_0x4b2c96[_0x21f187(0x97)]){const _0x2d911a=getConsoleNextUrl(_0x3e8406[_0x21f187(0xad)],_0x21f187(0xf2)+_0x552421+_0x21f187(0xc9)+_0x4b2c96['journeyId']+_0x21f187(0xe5));console[_0x21f187(0xbb)]('\x20\x20'+a41_0x409a3b[_0x21f187(0xd7)](_0x2d911a));}}}for(const _0x41db65 of _0xe6058){console[_0x21f187(0xbb)](a41_0x409a3b['yellow'](_0x21f187(0xc6)+_0x41db65[_0x21f187(0x93)])),_0x42937c++;}const _0x239f2b=[];if(_0x22a77f>0x0)_0x239f2b[_0x21f187(0xd6)](_0x22a77f+_0x21f187(0x10e));if(_0x21fbaf>0x0)_0x239f2b[_0x21f187(0xd6)](_0x21fbaf+_0x21f187(0xcd));if(_0x2d03f2>0x0)_0x239f2b[_0x21f187(0xd6)](_0x2d03f2+_0x21f187(0x7e));const _0x686006=[];if(_0x4d4b5d>0x0)_0x686006[_0x21f187(0xd6)](_0x4d4b5d+_0x21f187(0x10e));if(_0x37561c>0x0)_0x686006[_0x21f187(0xd6)](_0x37561c+_0x21f187(0xcd));if(_0x42937c>0x0)_0x686006[_0x21f187(0xd6)](_0x42937c+'\x20deleted');const _0x50f46b=[];if(_0x24968a>0x0)_0x50f46b[_0x21f187(0xd6)](_0x24968a+'\x20created');if(_0x46dd96>0x0)_0x50f46b[_0x21f187(0xd6)](_0x46dd96+_0x21f187(0xcd));if(_0x1cd1b5>0x0)_0x50f46b['push'](_0x1cd1b5+'\x20deleted');console[_0x21f187(0xbb)](a41_0x409a3b['green']('\x0a✔\x20Push\x20complete'));_0x239f2b[_0x21f187(0xb5)]>0x0&&!_0x3e8406[_0x21f187(0x112)]&&console[_0x21f187(0xbb)](_0x21f187(0xdb)+_0x239f2b['join'](',\x20'));_0x686006[_0x21f187(0xb5)]>0x0&&console['error'](_0x21f187(0xe7)+_0x686006['join'](',\x20'));_0x50f46b['length']>0x0&&!_0x3e8406[_0x21f187(0x112)]&&console[_0x21f187(0xbb)]('\x20\x20Activations:\x20'+_0x50f46b[_0x21f187(0xaa)](',\x20'));if(_0x1f1ab3){const _0x2fd692=getConsoleNextUrl(_0x3e8406[_0x21f187(0xad)],'/app/ps/'+_0x552421+'/e/'+_0x1f1ab3+'/sb/da/esr');console[_0x21f187(0xbb)](_0x21f187(0x86)+a41_0x409a3b[_0x21f187(0xd7)](_0x2fd692));}return 0x0;}}
|
|
1
|
+
const a41_0x5c1e39=a41_0x2522;(function(_0x49525d,_0x4e09c7){const _0x1bc755=a41_0x2522,_0x25d60c=_0x49525d();while(!![]){try{const _0x14e78d=parseInt(_0x1bc755(0x17f))/0x1+-parseInt(_0x1bc755(0x205))/0x2*(parseInt(_0x1bc755(0x16d))/0x3)+-parseInt(_0x1bc755(0x212))/0x4*(parseInt(_0x1bc755(0x20c))/0x5)+parseInt(_0x1bc755(0x1fc))/0x6*(-parseInt(_0x1bc755(0x1ca))/0x7)+-parseInt(_0x1bc755(0x19d))/0x8*(-parseInt(_0x1bc755(0x1cd))/0x9)+parseInt(_0x1bc755(0x19a))/0xa+-parseInt(_0x1bc755(0x19e))/0xb*(parseInt(_0x1bc755(0x1c4))/0xc);if(_0x14e78d===_0x4e09c7)break;else _0x25d60c['push'](_0x25d60c['shift']());}catch(_0x244f55){_0x25d60c['push'](_0x25d60c['shift']());}}}(a41_0x4f22,0x2e20e));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';function a41_0x2522(_0x107496,_0x21772f){_0x107496=_0x107496-0x16d;const _0x4f2224=a41_0x4f22();let _0x2522a3=_0x4f2224[_0x107496];return _0x2522a3;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a41_0x520b0c from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a41_0x4f22(){const _0x102084=['\x20\x20Activations:\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','No\x20','message','unchanged','4wstoZI','\x20to\x20delete','results','map','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','type','list','10VlEvSC','created','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','Delete\x20journey:','\x20to\x20create','\x20to\x20update','191064Ritpxw','65028GhNnNN','no_parent','red','segments','dryRun','verbose','idToName','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journeyBundleName','folderId','connection','\x20new','New\x20segment:','\x20changed','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','\x20updated','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','getOutputSchemaWithCache','358986xvtUHT','Aborted.','repeat','/sb/da/esr','delete','resolveParentId','Error\x20parsing\x20YAML:\x20','\x20\x20📊\x20Segments:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','state','yamlConfig','parentName','diff','Error:\x20','\x20\x20\x20\x20','isScoped','\x20YAML\x20files\x20found','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','parent_name','toUpdate','targetDir','scopedFolderPath','parentFolder','\x20created','site','updated','Delete\x20segment:','194260qgnPjo','nameToId','existingSegment','384GuWzwi','11JeEWjO','activations','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','/e/','createdSegmentIds','folderPath','user','.yaml','listFolders','existingJourney','New\x20journey:','all','listSegments','journeyId','helpText','setPhase','\x20activations]','then','join','journey','Preparing\x20journeys...','/j/da/je','\x20\x20Source:\x20','/app/ps/','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','description','Changes\x20to\x20journey:','dim','changed','isNew','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toDelete','yes','yellow','endsWith','buildUserMaps','\x0aPush\x20summary\x20for\x20\x27','journeysOnly','984636OCsXYi','\x20\x20🗺️\x20\x20Journeys:','set','getParent','\x20unchanged','execute','306579tPlgQS','segmentFolderId','segment\x20or\x20journey','14112idNseX','\x20deleted','segment:push','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','parentSegment','push','Source\x20directory:\x20','\x0aValidation\x20failed:','listJourneysWithDetailsFromParentSegment','updatedAt','Resolving\x20parent\x20segment\x20\x27','green','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','error','attributes','length','(Journey\x20will\x20be\x20deleted)','\x0aError:','data','Parent\x20segment:\x20','Site:\x20','file','Scoped\x20to\x20folder:\x20','Folders\x20to\x20create:','Fetching\x20connections\x20for\x20name\x20resolution...','listActivations','toString','deleted','segment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','new','\x27...','name','folders','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','toCreate','Fetching\x20existing\x20data...','journeys','cwd','get','\x0a✔\x20Push\x20complete','paused','cyan','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20existing\x20activations...','blue','6qURqqS','add','Changes\x20to:','audienceId'];a41_0x4f22=function(){return _0x102084;};return a41_0x4f22();}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a41_0x5c1e39(0x1ed)]=a41_0x5c1e39(0x1cf);[a41_0x5c1e39(0x1b7)]=a41_0x5c1e39(0x1d9);async[a41_0x5c1e39(0x1c9)](_0x31463a){const _0x12c16c=a41_0x5c1e39,{options:_0x156039,args:_0x329fa4,tdx:_0x242946}=_0x31463a,_0x3c0b61=_0x156039,_0x85000a=await resolveTarget({'arg':_0x329fa4[0x0],'contextParent':_0x156039[_0x12c16c(0x1d1)],'cwd':process[_0x12c16c(0x1f3)]()});if(!isSuccessfulResolution(_0x85000a))return _0x85000a['errorCode']===_0x12c16c(0x16e)?(console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x12c16c(0x1da)](_0x12c16c(0x17b)),console[_0x12c16c(0x1da)](_0x12c16c(0x1d0)),console['error'](_0x12c16c(0x1ef))):(console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x18c)+_0x85000a[_0x12c16c(0x203)]+'\x0a')),_0x85000a[_0x12c16c(0x1ac)]&&console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1f7)](_0x85000a[_0x12c16c(0x1ac)]))),0x1;if(_0x85000a[_0x12c16c(0x20a)]===_0x12c16c(0x191))return console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1f9)+_0x85000a[_0x12c16c(0x193)]+'\x0a')),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1f7)](_0x12c16c(0x209))),0x1;const _0x17384e=_0x85000a[_0x12c16c(0x18a)],_0x4d0afe=_0x85000a[_0x12c16c(0x193)],_0x1c1441=_0x85000a[_0x12c16c(0x20a)]===_0x12c16c(0x1e2)?_0x85000a['filePath']:undefined,_0x2f6af0=getScopedDetails(_0x85000a),_0x16e459=_0x2f6af0?.[_0x12c16c(0x18e)]??![],_0x42bbde=_0x2f6af0?.[_0x12c16c(0x194)]??'';if(!existsSync(_0x4d0afe))return console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1f9)+_0x4d0afe+'\x0a')),console[_0x12c16c(0x1da)](a41_0x520b0c['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3c0b61['verbose']&&(console['error'](_0x12c16c(0x1e1)+_0x3c0b61[_0x12c16c(0x197)]),console[_0x12c16c(0x1da)](_0x12c16c(0x1e0)+_0x17384e),console[_0x12c16c(0x1da)](_0x12c16c(0x1d3)+_0x4d0afe),_0x16e459&&console[_0x12c16c(0x1da)](_0x12c16c(0x1e3)+_0x42bbde));const _0x43df30=await withSpinner(_0x12c16c(0x1d7)+_0x17384e+_0x12c16c(0x1ec),()=>_0x242946[_0x12c16c(0x1e9)][_0x12c16c(0x184)](_0x17384e),{'verbose':_0x3c0b61[_0x12c16c(0x172)]}),_0x5e4a86=_0x43df30[_0x12c16c(0x1df)],{parentSegmentResult:_0x19cbdf,segmentsResult:_0x275fce,foldersResult:_0x4b6cae,journeysWithDetailsResult:_0x46fd62,userMaps:_0x5cd9c5}=await withSpinner(_0x12c16c(0x1f1),async()=>{const _0x29ba14=_0x12c16c,[_0x34803b,_0x7adb3b,_0x268acb,_0x449cc1,_0x5e3df4]=await Promise[_0x29ba14(0x1a9)]([_0x242946[_0x29ba14(0x1e9)][_0x29ba14(0x1c7)](_0x5e4a86),_0x242946['segment'][_0x29ba14(0x1aa)](_0x5e4a86),_0x242946['segment'][_0x29ba14(0x1a6)](_0x5e4a86),_0x242946[_0x29ba14(0x1b1)][_0x29ba14(0x1d5)](_0x5e4a86,{'includeAllVersions':!![]}),_0x242946['user'][_0x29ba14(0x1c1)]()]);return{'parentSegmentResult':_0x34803b,'segmentsResult':_0x7adb3b,'foldersResult':_0x268acb,'journeysWithDetailsResult':_0x449cc1,'userMaps':_0x5e3df4};},{'verbose':_0x3c0b61[_0x12c16c(0x172)]})['then'](_0x110f13=>_0x110f13[_0x12c16c(0x1df)]),_0x44c6f8=_0x19cbdf,_0x429d29=extractRootFolderId(_0x44c6f8),_0x31e4cc=_0x275fce,_0x264a13=_0x4b6cae,{journeys:_0x45991d,activationStepsById:_0x92b039}=_0x46fd62,_0xd4102c=new Map(_0x45991d[_0x12c16c(0x208)](_0x566103=>[_0x566103['id'],_0x566103])),_0x285bfc=_0x45991d[_0x12c16c(0x208)](_0x142e32=>({'id':_0x142e32['id'],'name':_0x142e32['attributes'][_0x12c16c(0x1ed)],'journeyBundleName':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x175)]||'','journeyBundleId':_0x142e32[_0x12c16c(0x1db)]['journeyBundleId']||'','versionNumber':_0x142e32[_0x12c16c(0x1db)]['versionNumber'],'description':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1b7)],'state':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x188)],'paused':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1f6)],'audienceId':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1ff)],'folderId':_0x142e32['relationships']?.[_0x12c16c(0x195)]?.[_0x12c16c(0x1df)]?.['id'],'createdAt':_0x142e32[_0x12c16c(0x1db)]['createdAt'],'updatedAt':_0x142e32[_0x12c16c(0x1db)][_0x12c16c(0x1d6)]})),{emailToId:_0x243ccf,idToEmail:_0x3a3d39}=_0x5cd9c5,_0x299c6c=await withSpinner(_0x12c16c(0x1e5),async()=>{const _0x49201f=_0x12c16c,_0x45ac94=await _0x242946[_0x49201f(0x177)][_0x49201f(0x20b)]();return buildConnectionMaps(_0x45ac94);},{'verbose':_0x3c0b61[_0x12c16c(0x172)]})[_0x12c16c(0x1af)](_0x469a74=>_0x469a74['data']),_0x14882d=_0x299c6c['nameToId'],_0x4a12c5=_0x299c6c[_0x12c16c(0x173)],_0x376967=_0x299c6c['nameToType'],_0x536c7a={'emailToIdMap':_0x243ccf,'connectionNameToIdMap':_0x14882d,'connectionNameToTypeMap':_0x376967,'getSchema':_0x797aa=>_0x242946[_0x12c16c(0x177)][_0x12c16c(0x17e)](_0x797aa)};let {pathToId:_0x351ae4,idToPath:_0x20102c}=buildFolderMaps(_0x264a13);const _0x3bbe67=buildSegmentLookupMap(_0x31e4cc,_0x20102c),_0x343767=buildSegmentNameToIdMap(_0x31e4cc),_0xdee0fd=buildJourneyBundleLookupMap(_0x285bfc,_0x20102c);let _0x589f50;if(_0x1c1441){if(!_0x1c1441[_0x12c16c(0x1c0)]('.yml')&&!_0x1c1441[_0x12c16c(0x1c0)](_0x12c16c(0x1a5)))return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x1c1441+'\x0a')),0x1;_0x589f50=[_0x1c1441];}else _0x589f50=findYamlFiles(_0x4d0afe);if(_0x589f50['length']===0x0)return console['error'](a41_0x520b0c['red'](_0x12c16c(0x17d)+_0x4d0afe+'\x0a')),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1f7)](_0x12c16c(0x190))),0x1;let _0x3d97f4,_0x12d174;try{const _0x143eec=parseAndClassifyYamlFiles(_0x589f50,_0x4d0afe,{'skipSegments':_0x3c0b61[_0x12c16c(0x1c3)]});_0x3d97f4=_0x143eec['segments'],_0x12d174=_0x143eec[_0x12c16c(0x1f2)];const _0x34e878=validateParsedFiles(_0x143eec,_0x4d0afe);if(_0x34e878[_0x12c16c(0x1dc)]>0x0)return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1d4))),console[_0x12c16c(0x1da)](formatValidationErrors(_0x34e878)),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x174))),0x1;}catch(_0x5bf0f8){return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x185)+(_0x5bf0f8 instanceof Error?_0x5bf0f8['message']:_0x5bf0f8))),0x1;}if(_0x3d97f4[_0x12c16c(0x1dc)]===0x0&&_0x12d174['length']===0x0){const _0x7e2438=_0x3c0b61[_0x12c16c(0x1c3)]?_0x12c16c(0x1b1):_0x12c16c(0x1cc);return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x202)+_0x7e2438+_0x12c16c(0x18f))),0x0;}const _0x1db030=new Map();_0x31e4cc['length']>0x0&&!_0x3c0b61['journeysOnly']&&await withSpinner(_0x12c16c(0x1fa),async()=>{await batchAsync(_0x31e4cc,async _0x3a7de5=>{const _0x3b19c3=a41_0x2522,_0x5a845f=await _0x242946[_0x3b19c3(0x1e9)][_0x3b19c3(0x1e6)](_0x5e4a86,_0x3a7de5['id']);_0x1db030[_0x3b19c3(0x1c6)](_0x3a7de5['id'],_0x5a845f);});},{'verbose':_0x3c0b61[_0x12c16c(0x172)]});const {segmentFiles:_0xc90404,foldersToCreate:_0x149597}=await prepareSegmentFiles(_0x3d97f4,{'segmentByFolderAndName':_0x3bbe67,'activationsBySegmentId':_0x1db030,'folderPathToId':_0x351ae4,'idToEmailMap':_0x3a3d39,'connectionIdToNameMap':_0x4a12c5},_0x536c7a,_0x16e459,_0x42bbde),_0x11a3a7=_0x1c1441?[]:findSegmentsToDelete(_0x31e4cc,_0x3d97f4[_0x12c16c(0x208)](({yamlConfig:_0x39eae2,folderPath:_0x42109e})=>({'yamlConfig':_0x39eae2,'folderPath':resolveTDFolderPath(_0x42109e,_0x16e459,_0x42bbde)})),_0x20102c,_0x42bbde,_0x16e459),{journeyFiles:_0x6b5901,foldersToCreate:_0x276e9c}=await withProgressSpinner(_0x12c16c(0x1b2),async _0xe68b13=>prepareJourneyFiles(_0x12d174,{'fetchJourney':async _0x18d5c9=>_0x242946[_0x12c16c(0x1b1)]['getJourney'](_0x18d5c9[_0x12c16c(0x1ab)]),'journeyBundlesByFolderAndName':_0xdee0fd,'folderPathToId':_0x351ae4,'idToEmailMap':_0x3a3d39,'connectionIdToNameMap':_0x4a12c5,'existingSegments':_0x31e4cc,'parentId':_0x5e4a86,'deps':_0x242946,'progress':{'update':_0x5849ff=>{const _0x20ec2d=_0x12c16c;_0xe68b13[_0x20ec2d(0x1ad)](_0x5849ff),_0x3c0b61['verbose']&&console[_0x20ec2d(0x1da)]('\x20\x20'+_0x5849ff);}},'journeyById':_0xd4102c,'activationStepsById':_0x92b039},_0x16e459,_0x42bbde),{'verbose':_0x3c0b61['verbose']})[_0x12c16c(0x1af)](_0xc00c45=>_0xc00c45['data']);for(const _0x1afaca of _0x276e9c){_0x149597[_0x12c16c(0x1fd)](_0x1afaca);}const _0x37cfd9=_0x1c1441?[]:findJourneysToDelete(_0x285bfc,_0x12d174[_0x12c16c(0x208)](({yamlConfig:_0x1c4ff1,folderPath:_0x5cb1af})=>({'yamlConfig':_0x1c4ff1,'folderPath':resolveTDFolderPath(_0x5cb1af,_0x16e459,_0x42bbde)})),_0x20102c,_0x42bbde,_0x16e459),_0x2300b2=calculatePushStats(_0xc90404,_0x6b5901,_0x149597,_0x11a3a7,_0x37cfd9,!!_0x3c0b61[_0x12c16c(0x183)],!!_0x3c0b61['journeysOnly']),_0x419a38=_0x2300b2[_0x12c16c(0x170)][_0x12c16c(0x1eb)],_0x58b830=_0x2300b2['segments']['changed'],_0x4015b3=_0x2300b2[_0x12c16c(0x170)]['unchanged'],_0x2aea5c=_0x2300b2[_0x12c16c(0x170)][_0x12c16c(0x1bd)],_0x537f19=_0x2300b2[_0x12c16c(0x1ee)][_0x12c16c(0x1f0)],_0x24e526=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x1eb)],_0x142280=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x1ba)],_0x475e69=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x204)],_0x5cfe6b=_0x2300b2[_0x12c16c(0x1f2)][_0x12c16c(0x1bd)],_0x30500f=_0x2300b2[_0x12c16c(0x19f)][_0x12c16c(0x1a9)],_0x46e332=_0x2300b2[_0x12c16c(0x19f)]['toCreate'],_0x1ce0cb=_0x2300b2[_0x12c16c(0x19f)][_0x12c16c(0x192)],_0x1a1d0c=_0x2300b2[_0x12c16c(0x19f)][_0x12c16c(0x1bd)];console[_0x12c16c(0x1da)](_0x12c16c(0x1c2)+_0x17384e+'\x27:');_0x537f19[_0x12c16c(0x1dc)]>0x0&&console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c[_0x12c16c(0x1fb)]('📁\x20'+_0x537f19['length']+'\x20folders\x20to\x20create'));if(!_0x3c0b61['journeysOnly']){console[_0x12c16c(0x1da)](_0x12c16c(0x186)),console['error'](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1d8)]('+\x20'+_0x419a38[_0x12c16c(0x1dc)]+_0x12c16c(0x178))),console[_0x12c16c(0x1da)]('\x20\x20\x20\x20'+a41_0x520b0c[_0x12c16c(0x1bf)]('~\x20'+_0x58b830[_0x12c16c(0x1dc)]+_0x12c16c(0x17a)));if(_0x2aea5c['length']>0x0)console['error'](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x16f)]('-\x20'+_0x2aea5c[_0x12c16c(0x1dc)]+_0x12c16c(0x206)));else _0x11a3a7[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x183)]&&console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c['dim'](_0x11a3a7['length']+_0x12c16c(0x1bc)));console['error'](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1b9)]('=\x20'+_0x4015b3['length']+'\x20unchanged'));}if(_0x6b5901[_0x12c16c(0x1dc)]>0x0||_0x37cfd9[_0x12c16c(0x1dc)]>0x0){console[_0x12c16c(0x1da)](_0x12c16c(0x1c5)),console['error'](_0x12c16c(0x18d)+a41_0x520b0c['green']('+\x20'+_0x24e526[_0x12c16c(0x1dc)]+'\x20new')),console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1bf)]('~\x20'+_0x142280['length']+_0x12c16c(0x17a)));if(_0x5cfe6b[_0x12c16c(0x1dc)]>0x0)console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c['red']('-\x20'+_0x5cfe6b[_0x12c16c(0x1dc)]+_0x12c16c(0x206)));else _0x37cfd9[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61['delete']&&console[_0x12c16c(0x1da)]('\x20\x20\x20\x20'+a41_0x520b0c[_0x12c16c(0x1b9)](_0x37cfd9[_0x12c16c(0x1dc)]+_0x12c16c(0x1bc)));console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1b9)]('=\x20'+_0x475e69[_0x12c16c(0x1dc)]+_0x12c16c(0x1c8)));}_0x30500f['length']>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)]&&(console[_0x12c16c(0x1da)](''),console[_0x12c16c(0x1da)]('\x20\x20Activations:'),_0x46e332[_0x12c16c(0x1dc)]>0x0&&console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c[_0x12c16c(0x1d8)]('+\x20'+_0x46e332[_0x12c16c(0x1dc)]+_0x12c16c(0x210))),_0x1ce0cb[_0x12c16c(0x1dc)]>0x0&&console['error'](_0x12c16c(0x18d)+a41_0x520b0c['yellow']('~\x20'+_0x1ce0cb[_0x12c16c(0x1dc)]+_0x12c16c(0x211))),_0x1a1d0c[_0x12c16c(0x1dc)]>0x0&&console[_0x12c16c(0x1da)](_0x12c16c(0x18d)+a41_0x520b0c['red']('-\x20'+_0x1a1d0c[_0x12c16c(0x1dc)]+_0x12c16c(0x206))));console[_0x12c16c(0x1da)](_0x12c16c(0x1b4)+a41_0x520b0c[_0x12c16c(0x1f7)](_0x4d0afe)+'\x0a');if(_0x537f19[_0x12c16c(0x1dc)]>0x0){console[_0x12c16c(0x1da)](_0x12c16c(0x1e4));for(const _0x1259c0 of _0x537f19){console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c[_0x12c16c(0x1fb)]('+')+'\x20'+_0x1259c0);}console[_0x12c16c(0x1da)]('');}if(_0x419a38[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)])for(const _0x548ea1 of _0x419a38){const _0x2aa0d2=_0x548ea1[_0x12c16c(0x1a3)]?_0x548ea1[_0x12c16c(0x1a3)]+'/'+_0x548ea1[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x548ea1[_0x12c16c(0x189)]['name'],_0x29033e=_0x548ea1[_0x12c16c(0x189)]['activations']?.[_0x12c16c(0x1dc)]||0x0,_0x154196=_0x29033e>0x0?a41_0x520b0c[_0x12c16c(0x1b9)]('\x20['+_0x29033e+_0x12c16c(0x1ae)):'';console['error']('\x0a'+a41_0x520b0c['green'](_0x12c16c(0x179))+'\x20'+_0x2aa0d2+_0x154196),console['error']('─'[_0x12c16c(0x181)](0x3c)),_0x548ea1[_0x12c16c(0x18b)]&&console[_0x12c16c(0x1da)](_0x548ea1[_0x12c16c(0x18b)]),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}if(_0x2aea5c[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)])for(const _0xd76162 of _0x2aea5c){const _0x10d100=_0xd76162[_0x12c16c(0x1cb)]?_0x20102c[_0x12c16c(0x1f4)](_0xd76162[_0x12c16c(0x1cb)][_0x12c16c(0x1e7)]())||'':'',_0x4c7aa5=_0x10d100?_0x10d100+'/'+_0xd76162[_0x12c16c(0x1ed)]:_0xd76162[_0x12c16c(0x1ed)],_0x5224b9=_0x1db030[_0x12c16c(0x1f4)](_0xd76162['id'])||[],_0x2a0dac=_0x5224b9[_0x12c16c(0x1dc)]>0x0?a41_0x520b0c['dim']('\x20['+_0x5224b9[_0x12c16c(0x1dc)]+_0x12c16c(0x1ae)):'';console['error']('\x0a'+a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x199))+'\x20'+_0x4c7aa5+_0x2a0dac),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));const _0x4bceaf=segmentWithActivationsToYaml(_0xd76162,_0x5224b9,undefined,_0x3a3d39,_0x4a12c5),_0x280d72=segmentToYamlString(_0x4bceaf),_0x2163b2=generateDiff(_0x280d72,'');console['error'](formatDiffWithColors(_0x2163b2)),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}const _0x364d3c=_0xc90404['filter'](_0x33808c=>!_0x33808c[_0x12c16c(0x1bb)]&&_0x33808c[_0x12c16c(0x18b)]);if(_0x364d3c[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61['journeysOnly'])for(const _0x1739c3 of _0x364d3c){const _0x10f220=_0x1739c3['folderPath']?_0x1739c3['folderPath']+'/'+_0x1739c3[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x1739c3['yamlConfig'][_0x12c16c(0x1ed)];console[_0x12c16c(0x1da)]('\x0a'+a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x1fe))+'\x20'+_0x10f220),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c)),console[_0x12c16c(0x1da)](_0x1739c3[_0x12c16c(0x18b)]),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}if(_0x24e526[_0x12c16c(0x1dc)]>0x0)for(const _0x4f7ad4 of _0x24e526){const _0xea66fc=_0x4f7ad4[_0x12c16c(0x1a3)]?_0x4f7ad4[_0x12c16c(0x1a3)]+'/'+_0x4f7ad4[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x4f7ad4[_0x12c16c(0x189)][_0x12c16c(0x1ed)];console['error']('\x0a'+a41_0x520b0c[_0x12c16c(0x1d8)](_0x12c16c(0x1a8))+'\x20'+_0xea66fc),console[_0x12c16c(0x1da)]('─'['repeat'](0x3c)),_0x4f7ad4[_0x12c16c(0x18b)]&&console[_0x12c16c(0x1da)](_0x4f7ad4['diff']),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}const _0x47baa9=_0x6b5901['filter'](_0x323d72=>!_0x323d72[_0x12c16c(0x1bb)]&&_0x323d72[_0x12c16c(0x18b)]);if(_0x47baa9[_0x12c16c(0x1dc)]>0x0)for(const _0x378aaf of _0x47baa9){const _0x5672be=_0x378aaf[_0x12c16c(0x1a3)]?_0x378aaf[_0x12c16c(0x1a3)]+'/'+_0x378aaf[_0x12c16c(0x189)][_0x12c16c(0x1ed)]:_0x378aaf[_0x12c16c(0x189)][_0x12c16c(0x1ed)];console['error']('\x0a'+a41_0x520b0c['yellow'](_0x12c16c(0x1b8))+'\x20'+_0x5672be),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c)),console[_0x12c16c(0x1da)](_0x378aaf[_0x12c16c(0x18b)]),console['error']('─'[_0x12c16c(0x181)](0x3c));}if(_0x5cfe6b[_0x12c16c(0x1dc)]>0x0)for(const _0x48a4bc of _0x5cfe6b){const _0x1ba6fb=_0x48a4bc[_0x12c16c(0x176)]?_0x20102c[_0x12c16c(0x1f4)](_0x48a4bc['folderId'])||'':'',_0x525602=_0x1ba6fb?_0x1ba6fb+'/'+_0x48a4bc[_0x12c16c(0x175)]:_0x48a4bc[_0x12c16c(0x175)];console['error']('\x0a'+a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x20f))+'\x20'+_0x525602),console['error']('─'[_0x12c16c(0x181)](0x3c)),console['error'](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1dd))),console[_0x12c16c(0x1da)]('─'[_0x12c16c(0x181)](0x3c));}if(_0x3c0b61[_0x12c16c(0x171)])return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x1f8))),0x0;const _0x5274a7=_0x3c0b61[_0x12c16c(0x1c3)]?![]:_0x419a38[_0x12c16c(0x1dc)]>0x0||_0x58b830[_0x12c16c(0x1dc)]>0x0||_0x2aea5c['length']>0x0,_0x1c1322=_0x24e526[_0x12c16c(0x1dc)]>0x0||_0x142280['length']>0x0||_0x5cfe6b['length']>0x0,_0x2b71c6=_0x3c0b61[_0x12c16c(0x1c3)]?![]:_0x30500f[_0x12c16c(0x1dc)]>0x0,_0xd87fca=_0x537f19[_0x12c16c(0x1dc)]>0x0;if(!_0x5274a7&&!_0x1c1322&&!_0x2b71c6&&!_0xd87fca){const _0x428120=_0x3c0b61[_0x12c16c(0x1c3)]?_0x12c16c(0x201):_0x12c16c(0x20e);console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1d8)](_0x428120));if(_0x1c1441&&_0x4015b3[_0x12c16c(0x1dc)]===0x1){const _0x3643a7=_0x4015b3[0x0];if(_0x3643a7[_0x12c16c(0x19c)]?.['id']){const _0x4f3479=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],_0x12c16c(0x1b5)+_0x5e4a86+_0x12c16c(0x1a1)+_0x3643a7[_0x12c16c(0x19c)]['id']+_0x12c16c(0x182));console[_0x12c16c(0x1da)](_0x12c16c(0x1b6)+a41_0x520b0c[_0x12c16c(0x1f7)](_0x4f3479));}}if(_0x1c1441&&_0x475e69[_0x12c16c(0x1dc)]===0x1){const _0x625342=_0x475e69[0x0];if(_0x625342[_0x12c16c(0x1a7)]?.['id']){const _0x463daf=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],_0x12c16c(0x1b5)+_0x5e4a86+_0x12c16c(0x1a1)+_0x625342[_0x12c16c(0x1a7)]['id']+_0x12c16c(0x1b3));console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c['cyan'](_0x463daf));}}return 0x0;}const _0x596c4f=_0x3c0b61[_0x12c16c(0x1c3)]?_0x24e526['length']+_0x142280[_0x12c16c(0x1dc)]+_0x5cfe6b[_0x12c16c(0x1dc)]+_0x537f19[_0x12c16c(0x1dc)]:_0x419a38[_0x12c16c(0x1dc)]+_0x58b830[_0x12c16c(0x1dc)]+_0x2aea5c[_0x12c16c(0x1dc)]+_0x24e526['length']+_0x142280[_0x12c16c(0x1dc)]+_0x5cfe6b[_0x12c16c(0x1dc)]+_0x537f19[_0x12c16c(0x1dc)]+_0x30500f[_0x12c16c(0x1dc)];if(!_0x3c0b61[_0x12c16c(0x1be)]&&_0x596c4f>0x0){if(!isInteractive())return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)](_0x12c16c(0x1de)),_0x12c16c(0x1ea)),console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1b9)](_0x12c16c(0x1a0))),0x1;const _0x4b9c5a=await confirmKey('Push\x20'+_0x596c4f+'\x20changes?');if(!_0x4b9c5a)return console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)](_0x12c16c(0x180))),0x1;}const _0x205360={'withProgress':async(_0x347441,_0x1d327e)=>{const _0x4f16e=_0x12c16c,_0x3bdda3=await withSpinner(_0x347441,_0x1d327e,{'verbose':_0x3c0b61[_0x4f16e(0x172)]});return{'data':_0x3bdda3[_0x4f16e(0x1df)]};},'logInfo':_0x6265f4=>console['error'](a41_0x520b0c[_0x12c16c(0x1fb)]('✔\x20'+_0x6265f4)),'logSuccess':_0x556391=>console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1d8)]('✔\x20'+_0x556391)),'logWarning':_0x495ffd=>console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x1bf)]('⚠\x20'+_0x495ffd)),'logDeleted':_0x3fec25=>console[_0x12c16c(0x1da)](a41_0x520b0c[_0x12c16c(0x16f)]('✔\x20'+_0x3fec25))},_0x23f93a={'segment':_0x242946[_0x12c16c(0x1e9)],'journey':_0x242946[_0x12c16c(0x1b1)],'user':_0x242946[_0x12c16c(0x1a4)],'connection':_0x242946['connection']};_0x537f19['length']>0x0&&(_0x351ae4=await executePushFolders(_0x23f93a,_0x537f19,_0x351ae4,{'parentId':_0x5e4a86},_0x205360));const _0x50d9e3={'rootFolderId':_0x429d29,'folderPathToId':_0x351ae4,'folderIdToPath':_0x20102c,'segmentNameToId':_0x343767,'activationsBySegmentId':_0x1db030,'emailToIdMap':_0x243ccf,'idToEmailMap':_0x3a3d39,'connectionNameToIdMap':_0x299c6c[_0x12c16c(0x19b)],'connectionIdToNameMap':_0x299c6c['idToName'],'connectionNameToTypeMap':_0x376967},_0x470939=await executePushSegments(_0x23f93a,_0x3c0b61[_0x12c16c(0x1c3)]?[]:_0xc90404,_0x50d9e3,{'parentId':_0x5e4a86},_0x205360),_0x3e9f7e=_0x470939[_0x12c16c(0x20d)],_0x145e84=_0x470939[_0x12c16c(0x198)],_0x4fa6f5=_0x470939[_0x12c16c(0x19f)]['created'],_0x4bf6d7=_0x470939[_0x12c16c(0x19f)][_0x12c16c(0x198)],_0x58ee5c=_0x470939[_0x12c16c(0x19f)][_0x12c16c(0x1e8)];let _0x365296;if(_0x1c1441&&_0xc90404['length']===0x1){const _0x152962=_0xc90404[0x0];_0x365296=_0x152962[_0x12c16c(0x19c)]?.['id']??_0x470939[_0x12c16c(0x1a2)][_0x12c16c(0x1f4)](_0x152962[_0x12c16c(0x189)]['name']);}const _0x52914f=await executePushSegmentDeletions(_0x23f93a,_0x3c0b61[_0x12c16c(0x1c3)]?[]:_0x2aea5c,_0x205360);let _0x5c7cc2=0x0,_0x110590=0x0,_0x3677a4=0x0;const _0x4c1300=new Map(_0x343767);for(const [_0x2075d0,_0x41d00d]of _0x470939[_0x12c16c(0x1a2)]){_0x4c1300[_0x12c16c(0x1c6)](_0x2075d0,_0x41d00d);}if(_0x6b5901[_0x12c16c(0x1dc)]>0x0){const _0x262688={..._0x50d9e3,'segmentNameToId':_0x4c1300,'existingSegments':_0x31e4cc,'activationContext':_0x536c7a},_0x47c8b3=await executePushJourneys(_0x23f93a,_0x6b5901,_0x262688,{'parentId':_0x5e4a86,'rootFolderId':_0x429d29,'verbose':_0x3c0b61['verbose']},_0x205360);_0x5c7cc2=_0x47c8b3[_0x12c16c(0x20d)],_0x110590=_0x47c8b3[_0x12c16c(0x198)];if(_0x1c1441&&_0x47c8b3['results'][_0x12c16c(0x1dc)]===0x1){const _0x24bc33=_0x47c8b3[_0x12c16c(0x207)][0x0];if(_0x24bc33[_0x12c16c(0x1ab)]){const _0x4f7617=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],_0x12c16c(0x1b5)+_0x5e4a86+'/e/'+_0x24bc33[_0x12c16c(0x1ab)]+_0x12c16c(0x1b3));console[_0x12c16c(0x1da)]('\x20\x20'+a41_0x520b0c['cyan'](_0x4f7617));}}}for(const _0x309ac3 of _0x5cfe6b){console[_0x12c16c(0x1da)](a41_0x520b0c['yellow'](_0x12c16c(0x187)+_0x309ac3[_0x12c16c(0x175)])),_0x3677a4++;}const _0x309d87=[];if(_0x3e9f7e>0x0)_0x309d87[_0x12c16c(0x1d2)](_0x3e9f7e+_0x12c16c(0x196));if(_0x145e84>0x0)_0x309d87[_0x12c16c(0x1d2)](_0x145e84+_0x12c16c(0x17c));if(_0x52914f>0x0)_0x309d87['push'](_0x52914f+'\x20deleted');const _0x5bc7d8=[];if(_0x5c7cc2>0x0)_0x5bc7d8[_0x12c16c(0x1d2)](_0x5c7cc2+_0x12c16c(0x196));if(_0x110590>0x0)_0x5bc7d8[_0x12c16c(0x1d2)](_0x110590+_0x12c16c(0x17c));if(_0x3677a4>0x0)_0x5bc7d8[_0x12c16c(0x1d2)](_0x3677a4+_0x12c16c(0x1ce));const _0x1cb9e4=[];if(_0x4fa6f5>0x0)_0x1cb9e4['push'](_0x4fa6f5+_0x12c16c(0x196));if(_0x4bf6d7>0x0)_0x1cb9e4[_0x12c16c(0x1d2)](_0x4bf6d7+_0x12c16c(0x17c));if(_0x58ee5c>0x0)_0x1cb9e4[_0x12c16c(0x1d2)](_0x58ee5c+_0x12c16c(0x1ce));console[_0x12c16c(0x1da)](a41_0x520b0c['green'](_0x12c16c(0x1f5)));_0x309d87[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61['journeysOnly']&&console[_0x12c16c(0x1da)]('\x20\x20Segments:\x20'+_0x309d87[_0x12c16c(0x1b0)](',\x20'));_0x5bc7d8[_0x12c16c(0x1dc)]>0x0&&console['error']('\x20\x20Journeys:\x20'+_0x5bc7d8['join'](',\x20'));_0x1cb9e4[_0x12c16c(0x1dc)]>0x0&&!_0x3c0b61[_0x12c16c(0x1c3)]&&console[_0x12c16c(0x1da)](_0x12c16c(0x200)+_0x1cb9e4[_0x12c16c(0x1b0)](',\x20'));if(_0x365296){const _0x2d77b7=getConsoleNextUrl(_0x3c0b61[_0x12c16c(0x197)],'/app/ps/'+_0x5e4a86+_0x12c16c(0x1a1)+_0x365296+_0x12c16c(0x182));console['error'](_0x12c16c(0x1b6)+a41_0x520b0c[_0x12c16c(0x1f7)](_0x2d77b7));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x53ae96=a42_0x3f73;(function(_0xbc3a08,_0x13f935){const _0x59fbe8=a42_0x3f73,_0x5df94e=_0xbc3a08();while(!![]){try{const _0x1cbadc=-parseInt(_0x59fbe8(0x97))/0x1*(parseInt(_0x59fbe8(0x8e))/0x2)+parseInt(_0x59fbe8(0x84))/0x3+-parseInt(_0x59fbe8(0x88))/0x4*(parseInt(_0x59fbe8(0x7b))/0x5)+parseInt(_0x59fbe8(0x74))/0x6*(parseInt(_0x59fbe8(0x8b))/0x7)+-parseInt(_0x59fbe8(0x81))/0x8+parseInt(_0x59fbe8(0x70))/0x9+parseInt(_0x59fbe8(0x90))/0xa;if(_0x1cbadc===_0x13f935)break;else _0x5df94e['push'](_0x5df94e['shift']());}catch(_0x3969fd){_0x5df94e['push'](_0x5df94e['shift']());}}}(a42_0x4667,0xbd251));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a42_0x3f73(_0x15203a,_0x1ad293){_0x15203a=_0x15203a-0x68;const _0x4667d3=a42_0x4667();let _0x3f734f=_0x4667d3[_0x15203a];return _0x3f734f;}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a42_0x4667(){const _0x57a916=['Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','updateSegmentById','6674YKuVSk','ruleFile','\x20\x20\x20Path:\x20','Resolving\x20folder\x20\x27','rule','Updating\x20segment\x20\x27','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','length','description','segment','9428544Tdfpem','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','type','18ViDhPM','Segment\x20ID\x20missing\x20from\x20resolved\x20path','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','error','kind','INTERNAL','segmentPath','184080TiElLD','resolveFolderId','Resolved\x20type:\x20','Error:\x20Cannot\x20update\x20','Segment\x20ID:\x20','execute','3657232WxPUYs','✔\x20Updated\x20segment\x20\x27','includes','4038063EQfrjb','segment:update','Resolved\x20relative\x20path\x20to:\x20','\x27...','124OgyDZK','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Examples:','2249926TfNcAN','verbose','folder','298qYRqxx','name','97220xujDJk','data','resolvePathToResource','segmentId'];a42_0x4667=function(){return _0x57a916;};return a42_0x4667();}import a42_0x21cf4f from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x53ae96(0x8f)]=a42_0x53ae96(0x85);[a42_0x53ae96(0x6e)]='Update\x20existing\x20child\x20segment';async[a42_0x53ae96(0x80)](_0x33ba26){const _0x177286=a42_0x53ae96;console['error'](a42_0x21cf4f['yellow'](_0x177286(0x76))),console[_0x177286(0x77)](a42_0x21cf4f['yellow'](_0x177286(0x89)));const {options:_0x5d1224,args:_0x296c30,tdx:_0x43d0a1}=_0x33ba26,_0x34c4ac=_0x5d1224;if(_0x296c30[_0x177286(0x6d)]===0x0)return console[_0x177286(0x77)](_0x177286(0x72)),console[_0x177286(0x77)](_0x177286(0x6c)),console[_0x177286(0x77)](_0x177286(0x8a)),console[_0x177286(0x77)](_0x177286(0x71)),console[_0x177286(0x77)]('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x59868e=_0x296c30[0x0],_0x330d23=_0x5d1224[_0x177286(0x7a)];let _0x315411=_0x59868e;_0x330d23&&!_0x59868e[_0x177286(0x83)]('/')&&(_0x315411=_0x330d23+'/'+_0x59868e,_0x34c4ac[_0x177286(0x8c)]&&console['error'](_0x177286(0x86)+_0x315411));const _0x5218d2=await withSpinner(_0x177286(0x95)+_0x315411+_0x177286(0x87),()=>_0x43d0a1[_0x177286(0x6f)][_0x177286(0x92)](_0x315411),{'verbose':_0x34c4ac[_0x177286(0x8c)]}),_0x1c240a=_0x5218d2['data'];_0x34c4ac[_0x177286(0x8c)]&&console['error'](_0x177286(0x7d)+_0x1c240a[_0x177286(0x73)]);if(_0x1c240a['type']!=='segment')return console['error'](_0x177286(0x7e)+_0x1c240a[_0x177286(0x73)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x177286(0x77)](_0x177286(0x94)),0x1;if(!_0x1c240a[_0x177286(0x93)])throw new SDKError(ErrorCode[_0x177286(0x79)],_0x177286(0x75));const _0x517eb7=_0x1c240a['parentId'],_0xa55fdb=_0x1c240a['segmentId'];_0x34c4ac[_0x177286(0x8c)]&&(console['error']('Parent\x20ID:\x20'+_0x517eb7),console[_0x177286(0x77)](_0x177286(0x7f)+_0xa55fdb));let _0x5c825d;if(_0x34c4ac[_0x177286(0x8d)]){const _0x2ceb06=_0x34c4ac[_0x177286(0x8d)],_0x23941e=await withSpinner(_0x177286(0x69)+_0x2ceb06+_0x177286(0x87),()=>_0x43d0a1[_0x177286(0x6f)][_0x177286(0x7c)](_0x517eb7,_0x2ceb06),{'verbose':_0x34c4ac[_0x177286(0x8c)]});_0x5c825d=parseInt(_0x23941e[_0x177286(0x91)],0xa),_0x34c4ac[_0x177286(0x8c)]&&console['error']('Resolved\x20folder\x20ID:\x20'+_0x5c825d);}const _0x21dc6f=await loadJSONFromOptions(_0x34c4ac[_0x177286(0x6a)],_0x34c4ac[_0x177286(0x98)]),_0x462da6={'name':_0x34c4ac[_0x177286(0x8f)],'description':_0x34c4ac[_0x177286(0x6e)],'rule':_0x21dc6f,'kind':_0x34c4ac[_0x177286(0x78)]!==undefined?parseInt(_0x34c4ac[_0x177286(0x78)],0xa):undefined,'segmentFolderId':_0x5c825d},_0x56af79=await withSpinner(_0x177286(0x6b)+_0x1c240a['segmentName']+_0x177286(0x87),()=>_0x43d0a1[_0x177286(0x6f)][_0x177286(0x96)](_0x517eb7,_0xa55fdb,_0x462da6),{'verbose':_0x34c4ac['verbose']}),_0x449098=_0x56af79[_0x177286(0x91)];return console['error'](_0x177286(0x82)+_0x449098[_0x177286(0x8f)]+'\x27'),_0x315411!==_0x59868e&&console[_0x177286(0x77)](_0x177286(0x68)+_0x315411),await handleSDKOutput([_0x449098],_0x34c4ac),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x54d526=a43_0xf161;(function(_0x425b49,_0x352954){const _0x58dcb7=a43_0xf161,_0x3c4fbc=_0x425b49();while(!![]){try{const _0x50b19e=parseInt(_0x58dcb7(0x1b2))/0x1+parseInt(_0x58dcb7(0x1a3))/0x2+parseInt(_0x58dcb7(0x1ba))/0x3+parseInt(_0x58dcb7(0x1a7))/0x4+-parseInt(_0x58dcb7(0x1cd))/0x5*(parseInt(_0x58dcb7(0x1be))/0x6)+-parseInt(_0x58dcb7(0x1a6))/0x7+parseInt(_0x58dcb7(0x1c2))/0x8;if(_0x50b19e===_0x352954)break;else _0x3c4fbc['push'](_0x3c4fbc['shift']());}catch(_0x29021f){_0x3c4fbc['push'](_0x3c4fbc['shift']());}}}(a43_0xac79,0x45690));function a43_0xac79(){const _0x42b185=['181771mKgQgC','parentName','isDirectory','folderPath','segments','execute','folderId','description','424482lQYnib','Resolved\x20relative\x20path\x20to:\x20','log','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','1272ZDpAYb','Parent\x20ID:\x20','dim','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','159904dAgwFt','segment','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','Use:\x20tdx\x20segment\x20use\x20','parentId','Resolving\x20path\x20\x27','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','fullPath','error','7055JPusTf','cyan','length','type','green','✔\x20Context\x20set\x20to:\x20','data','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','parent_segment','872132ziCFOW','split','red','3093860tZemEM','984388DXPYSE','isAbsolute','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','segment:use','config','segmentPath','join','Site:\x20','verbose','Error:\x20Path\x20is\x20required\x0a'];a43_0xac79=function(){return _0x42b185;};return a43_0xac79();}import{existsSync,statSync}from'fs';import a43_0x599093 from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';function a43_0xf161(_0x35be0f,_0x1ca05a){_0x35be0f=_0x35be0f-0x1a3;const _0xac7999=a43_0xac79();let _0xf16137=_0xac7999[_0x35be0f];return _0xf16137;}export class SegmentUseCommand extends BaseCommand{['name']=a43_0x54d526(0x1ab);[a43_0x54d526(0x1b9)]=a43_0x54d526(0x1c9);async[a43_0x54d526(0x1b7)](_0xabc026){const _0x144e89=a43_0x54d526,{options:_0x4a0225,args:_0x272a32,tdx:_0x44dde8}=_0xabc026;if(_0x272a32[_0x144e89(0x1cf)]===0x0)return console['error'](a43_0x599093['red'](_0x144e89(0x1b1))),console[_0x144e89(0x1cc)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x144e89(0x1cc)]('Examples:'),console[_0x144e89(0x1cc)](_0x144e89(0x1ca)),console[_0x144e89(0x1cc)](_0x144e89(0x1d4)),console[_0x144e89(0x1cc)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console[_0x144e89(0x1cc)]('\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 _0x454bcd=_0x272a32[0x0],_0x2ec9ad=_0x4a0225['session'];try{if(_0x454bcd==='/')return saveSessionContext({'segment_path':undefined},_0x2ec9ad),console[_0x144e89(0x1bc)](a43_0x599093[_0x144e89(0x1d1)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x454bcd)&&statSync(_0x454bcd)[_0x144e89(0x1b4)]()){let _0x50520b;try{_0x50520b=findTdxConfig(_0x454bcd);}catch{return console['error'](a43_0x599093['red'](_0x144e89(0x1c8)+_0x454bcd)),console['error'](a43_0x599093['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x24181a=_0x50520b[_0x144e89(0x1ac)][_0x144e89(0x1d5)];return saveSessionContext({'segment_path':_0x24181a,'parent_segment':_0x24181a},_0x2ec9ad),console[_0x144e89(0x1bc)](a43_0x599093['green'](_0x144e89(0x1d2)+a43_0x599093[_0x144e89(0x1ce)](_0x24181a))),0x0;}const _0x583c83=_0x4a0225[_0x144e89(0x1ad)];let _0x475497=_0x454bcd;const _0x5c580b=parsePath(_0x454bcd);if(!_0x5c580b[_0x144e89(0x1a8)]){if(!_0x583c83)return console[_0x144e89(0x1cc)](a43_0x599093[_0x144e89(0x1a5)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console['error'](a43_0x599093['cyan'](_0x144e89(0x1c1))),0x1;if(_0x454bcd==='..'){const _0x7181c3=_0x583c83[_0x144e89(0x1a4)]('/')['slice'](0x0,-0x1)[_0x144e89(0x1ae)]('/');_0x475497=_0x7181c3||'/';}else _0x454bcd==='.'?_0x475497=_0x583c83:_0x475497=_0x583c83+'/'+_0x454bcd;_0x4a0225[_0x144e89(0x1b0)]&&console[_0x144e89(0x1cc)](_0x144e89(0x1bb)+_0x475497);}if(_0x475497==='/'||_0x475497==='')return saveSessionContext({'segment_path':undefined},_0x2ec9ad),console[_0x144e89(0x1bc)](a43_0x599093[_0x144e89(0x1d1)](_0x144e89(0x1aa))),0x0;_0x475497=normalizePath(_0x475497);const _0xe4b082=parsePath(_0x475497)[_0x144e89(0x1b6)];if(_0xe4b082[_0x144e89(0x1cf)]===0x0)return saveSessionContext({'segment_path':undefined},_0x2ec9ad),console['log'](a43_0x599093[_0x144e89(0x1d1)](_0x144e89(0x1aa))),0x0;_0x4a0225['verbose']&&(console[_0x144e89(0x1cc)](_0x144e89(0x1af)+_0x4a0225['site']),console['error']('Target\x20path:\x20'+_0x475497));const _0x4e08b1=await withSpinner(_0x144e89(0x1c7)+_0x475497+'\x27...',()=>_0x44dde8[_0x144e89(0x1c3)]['resolvePathToResource'](_0x475497),{'verbose':_0x4a0225[_0x144e89(0x1b0)]}),_0x1fc742=_0x4e08b1[_0x144e89(0x1d3)];_0x4a0225[_0x144e89(0x1b0)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x1fc742['type']),console[_0x144e89(0x1cc)](_0x144e89(0x1bf)+_0x1fc742[_0x144e89(0x1c6)]),_0x1fc742[_0x144e89(0x1b8)]&&console[_0x144e89(0x1cc)]('Folder\x20ID:\x20'+_0x1fc742['folderId']));if(_0x1fc742[_0x144e89(0x1d0)]===_0x144e89(0x1c3))return console['error'](a43_0x599093[_0x144e89(0x1a5)](_0x144e89(0x1a9))),console['error'](_0x144e89(0x1bd)),console[_0x144e89(0x1cc)](a43_0x599093[_0x144e89(0x1ce)](_0x144e89(0x1c5)+_0x1fc742[_0x144e89(0x1b3)]+(_0x1fc742[_0x144e89(0x1b5)]?'/'+_0x1fc742[_0x144e89(0x1b5)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x1fc742['fullPath'],'parent_segment':_0x1fc742[_0x144e89(0x1b3)]},_0x2ec9ad),console['log'](a43_0x599093[_0x144e89(0x1d1)]('✔\x20Context\x20set\x20to:\x20'+a43_0x599093[_0x144e89(0x1ce)](_0x1fc742[_0x144e89(0x1cb)]))),_0x4a0225[_0x144e89(0x1b0)]&&(console[_0x144e89(0x1cc)](a43_0x599093[_0x144e89(0x1c0)](_0x144e89(0x1c4))),console[_0x144e89(0x1cc)](a43_0x599093[_0x144e89(0x1c0)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0x41d777){throw _0x41d777;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a44_0x5b2a34=a44_0x9343;(function(_0x3468fc,_0x48cc00){const _0x36745d=a44_0x9343,_0x450a5c=_0x3468fc();while(!![]){try{const _0x194d7a=-parseInt(_0x36745d(0x10b))/0x1+-parseInt(_0x36745d(0x10d))/0x2+-parseInt(_0x36745d(0x11b))/0x3*(parseInt(_0x36745d(0x115))/0x4)+-parseInt(_0x36745d(0x10c))/0x5*(parseInt(_0x36745d(0x108))/0x6)+parseInt(_0x36745d(0xfe))/0x7*(-parseInt(_0x36745d(0x105))/0x8)+parseInt(_0x36745d(0xef))/0x9+parseInt(_0x36745d(0x10a))/0xa;if(_0x194d7a===_0x48cc00)break;else _0x450a5c['push'](_0x450a5c['shift']());}catch(_0x33069e){_0x450a5c['push'](_0x450a5c['shift']());}}}(a44_0x4b0a,0x37f42));import{BaseCommand}from'./command.js';function a44_0x4b0a(){const _0x322ef8=['12361030aGELvJ','127035LQMOSI','898320IHMfto','341664zeRbWw','error','cyan','errors','length','name','helpText','warnings','172xVCNMN','yellow','✔\x20All\x20','validCount','message','):\x20','30639jGiNdB','warningCount','endsWith','Error:\x20Directory\x20not\x20found:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','2993571MZNaQA','segment:validate','\x20file(s)\x20valid','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','red','\x20warning(s)\x20found','Error:\x20','targetDir','\x20valid','dim','parentSegment','file','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','filePath','\x20file(s)\x20with\x20errors,\x20','26194FjwejZ','valid','green','Validation\x20failed:\x20','log','.yml','hasErrors','904GblNLs','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','type','6dHDWKC','\x20warning(s)'];a44_0x4b0a=function(){return _0x322ef8;};return a44_0x4b0a();}function a44_0x9343(_0x3532dd,_0x34eeec){_0x3532dd=_0x3532dd-0xee;const _0x4b0ae5=a44_0x4b0a();let _0x9343b5=_0x4b0ae5[_0x3532dd];return _0x9343b5;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x4bf690 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x5b2a34(0x112)]=a44_0x5b2a34(0xf0);['description']='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async['execute'](_0x33585e){const _0x57e060=a44_0x5b2a34,{options:_0x27f16e,args:_0x494870}=_0x33585e,_0x100de6=_0x27f16e,_0x12642d=await resolveTarget({'arg':_0x494870[0x0],'contextParent':_0x27f16e[_0x57e060(0xf9)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x12642d))return _0x12642d['errorCode']==='no_parent'?(console[_0x57e060(0x10e)](a44_0x4bf690['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x57e060(0x10e)](_0x57e060(0xfb)),console[_0x57e060(0x10e)](_0x57e060(0xee)),console[_0x57e060(0x10e)](_0x57e060(0xf2))):(console[_0x57e060(0x10e)](a44_0x4bf690['red'](_0x57e060(0xf5)+_0x12642d[_0x57e060(0x119)]+'\x0a')),_0x12642d[_0x57e060(0x113)]&&console[_0x57e060(0x10e)](a44_0x4bf690[_0x57e060(0x10f)](_0x12642d[_0x57e060(0x113)]))),0x1;const _0xaa0035=_0x12642d[_0x57e060(0xf6)],_0x4e60e8=_0x12642d[_0x57e060(0x107)]===_0x57e060(0xfa)?_0x12642d[_0x57e060(0xfc)]:undefined;if(!_0x4e60e8&&!existsSync(_0xaa0035))return console[_0x57e060(0x10e)](a44_0x4bf690[_0x57e060(0xf3)](_0x57e060(0x11e)+_0xaa0035+'\x0a')),0x1;let _0x1120c4;if(_0x4e60e8){if(!_0x4e60e8[_0x57e060(0x11d)](_0x57e060(0x103))&&!_0x4e60e8['endsWith']('.yaml'))return console['error'](a44_0x4bf690['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x4e60e8+'\x0a')),0x1;_0x1120c4=[_0x4e60e8];}else _0x1120c4=findYamlFiles(_0xaa0035);if(_0x1120c4[_0x57e060(0x111)]===0x0)return console[_0x57e060(0x10e)](a44_0x4bf690[_0x57e060(0xf3)](_0x57e060(0x106)+_0xaa0035+'\x0a')),0x1;const _0x3e3cd9=validateYamlFiles(_0x1120c4,_0xaa0035),_0x2c9d63=calculateSummary(_0x3e3cd9);for(const _0x23d72f of _0x3e3cd9){if(!isValidationResult(_0x23d72f))continue;const {relativePath:_0x46dd34,source:_0x1dd108,result:_0x3be959,fileType:_0x403c95}=_0x23d72f,_0x2f628b=_0x403c95;if(_0x3be959[_0x57e060(0xff)]&&_0x3be959[_0x57e060(0x114)][_0x57e060(0x111)]===0x0)_0x100de6['verbose']&&console[_0x57e060(0x102)](a44_0x4bf690[_0x57e060(0x100)]('✔\x20'+_0x46dd34)+a44_0x4bf690[_0x57e060(0xf8)]('\x20('+_0x2f628b+')'));else _0x3be959['valid']?(console['log'](a44_0x4bf690[_0x57e060(0x116)]('⚠\x20'+_0x46dd34)+a44_0x4bf690[_0x57e060(0xf8)]('\x20('+_0x2f628b+_0x57e060(0x11a)+_0x3be959['warnings']['length']+_0x57e060(0x109))),console['log'](formatValidationResult(_0x3be959,_0x1dd108,_0x46dd34))):(console['log'](a44_0x4bf690[_0x57e060(0xf3)]('✖\x20'+_0x46dd34)+a44_0x4bf690['dim']('\x20('+_0x2f628b+_0x57e060(0x11a)+_0x3be959[_0x57e060(0x110)]['length']+'\x20error(s)')),console[_0x57e060(0x102)](formatValidationResult(_0x3be959,_0x1dd108,_0x46dd34)));}return console[_0x57e060(0x102)](''),_0x2c9d63[_0x57e060(0x104)]?(console['log'](a44_0x4bf690[_0x57e060(0xf3)](_0x57e060(0x101)+_0x2c9d63['invalidCount']+_0x57e060(0xfd)+_0x2c9d63['validCount']+_0x57e060(0xf7))),_0x2c9d63[_0x57e060(0x11c)]>0x0&&console['log'](a44_0x4bf690[_0x57e060(0x116)](_0x2c9d63['warningCount']+_0x57e060(0xf4))),0x1):(console[_0x57e060(0x102)](a44_0x4bf690[_0x57e060(0x100)](_0x57e060(0x117)+_0x2c9d63[_0x57e060(0x118)]+_0x57e060(0xf1))),_0x2c9d63[_0x57e060(0x11c)]>0x0&&console[_0x57e060(0x102)](a44_0x4bf690[_0x57e060(0x116)](_0x2c9d63[_0x57e060(0x11c)]+_0x57e060(0xf4))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a45_0x140fa6=a45_0x3bb7;(function(_0x2b8bd8,_0x54e066){const _0x31d734=a45_0x3bb7,_0x51d144=_0x2b8bd8();while(!![]){try{const _0x3bafbb=-parseInt(_0x31d734(0x168))/0x1+parseInt(_0x31d734(0x151))/0x2*(-parseInt(_0x31d734(0x16d))/0x3)+-parseInt(_0x31d734(0x166))/0x4+parseInt(_0x31d734(0x152))/0x5+parseInt(_0x31d734(0x146))/0x6*(parseInt(_0x31d734(0x17f))/0x7)+parseInt(_0x31d734(0x14e))/0x8+-parseInt(_0x31d734(0x16f))/0x9*(-parseInt(_0x31d734(0x174))/0xa);if(_0x3bafbb===_0x54e066)break;else _0x51d144['push'](_0x51d144['shift']());}catch(_0x590422){_0x51d144['push'](_0x51d144['shift']());}}}(a45_0x17f0,0x28f81));function a45_0x3bb7(_0x131ca0,_0x46642a){_0x131ca0=_0x131ca0-0x138;const _0x17f0d1=a45_0x17f0();let _0x3bb720=_0x17f0d1[_0x131ca0];return _0x3bb720;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a45_0x17f0(){const _0x134768=['folderId','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','execute','\x20journey','✔\x20Found\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','cause','message','maxDepth','description','children','Building\x20hierarchy\x20tree...','1029424dJjkcv','\x20segment','78960RsPbSs','name','segment','listUnified','replace','3GuuMEM','Parent\x20ID:\x20','30879ybpjRH','Site:\x20','Recursive\x20mode:\x20enabled','Resolving\x20path\x20\x27','sort','290zbFlOi','Error:\x20No\x20parent\x20segment\x20context\x20set.','(not\x20set)','includes','listUnifiedWithJourneys','(empty)','log','folders','Listing\x20folders,\x20segments,\x20and\x20journeys...','map','Folder\x20ID:\x20','847nKekqZ','resolvePathToResource','\x20folder','journeys','format','site','json','segments','/e/','/app/ps/','length','filter','✔\x20Built\x20tree\x20with\x20','/j/da','verbose','dim','listRecursive','Parent\x20segment\x20context:\x20','9582bkzTAd','\x27...','Folder/pattern\x20arg:\x20','parentId','type','data','No\x20items\x20match\x20pattern:\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','1763776AFDoLZ','folder',',\x20and\x20','624458RuvdYf','1515730eCfqSN','recursive','Set\x20a\x20parent\x20segment\x20context\x20first:','journey','test','listWithPattern','journeyBundleName','error'];a45_0x17f0=function(){return _0x134768;};return a45_0x17f0();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x256012 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x140fa6(0x169)]=a45_0x140fa6(0x13b);[a45_0x140fa6(0x163)]='List\x20folders\x20and\x20child\x20segments';async[a45_0x140fa6(0x15c)](_0x25cfe2){const _0x15b3a1=a45_0x140fa6,{options:_0x3437fe,args:_0x4f7e05}=_0x25cfe2,_0x41519c=_0x3437fe[_0x15b3a1(0x153)],_0x1f91fa=_0x4f7e05[0x0];try{const _0x224955=_0x3437fe['parentSegment'];_0x3437fe[_0x15b3a1(0x142)]&&(console[_0x15b3a1(0x159)](_0x15b3a1(0x170)+_0x3437fe[_0x15b3a1(0x139)]),console[_0x15b3a1(0x159)](_0x15b3a1(0x145)+(_0x224955||_0x15b3a1(0x176))),_0x1f91fa&&console[_0x15b3a1(0x159)](_0x15b3a1(0x148)+_0x1f91fa),_0x41519c&&console['error'](_0x15b3a1(0x171)));if(!_0x224955)return console[_0x15b3a1(0x159)](_0x15b3a1(0x175)),console['error'](''),console[_0x15b3a1(0x159)](_0x15b3a1(0x154)),console[_0x15b3a1(0x159)](_0x15b3a1(0x14d)),console[_0x15b3a1(0x159)](_0x15b3a1(0x15f)),console['error'](''),console[_0x15b3a1(0x159)](_0x15b3a1(0x15b)),0x1;const _0x340338=_0x1f91fa&&(_0x1f91fa[_0x15b3a1(0x177)]('*')||_0x1f91fa['includes']('?'));if(_0x340338)return await this[_0x15b3a1(0x157)](_0x25cfe2,_0x224955,_0x1f91fa);const _0x40382a=_0x1f91fa?_0x224955+'/'+_0x1f91fa:_0x224955;return _0x41519c?await this[_0x15b3a1(0x144)](_0x25cfe2,_0x40382a):await this[_0x15b3a1(0x16b)](_0x25cfe2,_0x40382a);}catch(_0x379763){if(_0x379763 instanceof SDKError)return console['error']('Error:\x20'+_0x379763[_0x15b3a1(0x161)]),_0x379763[_0x15b3a1(0x160)]&&console['error']('\x20\x20Cause:\x20'+_0x379763[_0x15b3a1(0x160)]),0x1;throw _0x379763;}}async['listWithPattern'](_0x8daf79,_0x515064,_0x4f5dbf){const _0x1d3c66=a45_0x140fa6,{options:_0x1c0553,tdx:_0x3062da}=_0x8daf79,_0xa1aabd=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x515064+_0x1d3c66(0x147),()=>_0x3062da[_0x1d3c66(0x16a)][_0x1d3c66(0x180)](_0x515064),{'verbose':_0x1c0553[_0x1d3c66(0x142)]}),_0x431c3d=_0xa1aabd[_0x1d3c66(0x14b)],_0x2e031f=await withSpinner(_0x1d3c66(0x17c),()=>_0x3062da[_0x1d3c66(0x16a)][_0x1d3c66(0x178)](_0x431c3d['parentId'],_0x431c3d['folderId']),{'verbose':_0x1c0553['verbose']}),{folders:_0x2a3d97,segments:_0x2c88ff,journeys:_0x4d4ea1}=_0x2e031f[_0x1d3c66(0x14b)],_0x2897bb=_0x4f5dbf[_0x1d3c66(0x16c)](/[.+^${}()|[\]\\]/g,'\x5c$&')[_0x1d3c66(0x16c)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x3aa96d=new RegExp('^'+_0x2897bb+'$','i'),_0x1fab05=_0x2a3d97[_0x1d3c66(0x13f)](_0x219fc7=>_0x3aa96d[_0x1d3c66(0x156)](_0x219fc7[_0x1d3c66(0x169)])),_0x375565=_0x2c88ff[_0x1d3c66(0x13f)](_0x1d6dcc=>_0x3aa96d[_0x1d3c66(0x156)](_0x1d6dcc[_0x1d3c66(0x169)])),_0x17ffa9=_0x4d4ea1[_0x1d3c66(0x13f)](_0x24110f=>_0x3aa96d[_0x1d3c66(0x156)](_0x24110f['journeyBundleName'])),_0x731867=_0x1fab05[_0x1d3c66(0x13e)]+_0x375565[_0x1d3c66(0x13e)]+_0x17ffa9[_0x1d3c66(0x13e)];console[_0x1d3c66(0x159)]('✔\x20Found\x20'+_0x1fab05[_0x1d3c66(0x13e)]+_0x1d3c66(0x181)+(_0x1fab05[_0x1d3c66(0x13e)]!==0x1?'s':'')+',\x20'+_0x375565[_0x1d3c66(0x13e)]+'\x20segment'+(_0x375565[_0x1d3c66(0x13e)]!==0x1?'s':'')+_0x1d3c66(0x150)+_0x17ffa9[_0x1d3c66(0x13e)]+_0x1d3c66(0x15d)+(_0x17ffa9[_0x1d3c66(0x13e)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x4f5dbf+'\x27');const _0x1b1637=_0xd03c9c=>{const _0x1c61a1=_0x1d3c66;return getConsoleNextUrl(_0x1c0553['site'],_0x1c61a1(0x13d)+_0x431c3d[_0x1c61a1(0x149)]+'/e/'+_0xd03c9c);},_0x41ac91=_0x1c0553[_0x1d3c66(0x138)]===_0x1d3c66(0x13a)||_0x1c0553['format']==='jsonl';if(_0x41ac91){const _0x11075b=[..._0x1fab05[_0x1d3c66(0x17d)](_0x5627ec=>({..._0x5627ec,'type':_0x1d3c66(0x14f)})),..._0x375565[_0x1d3c66(0x17d)](_0x1340d7=>({..._0x1340d7,'type':'segment','url':_0x1b1637(_0x1340d7['id'])})),..._0x17ffa9[_0x1d3c66(0x17d)](_0x324592=>({..._0x324592,'name':_0x324592[_0x1d3c66(0x158)],'type':_0x1d3c66(0x155)}))][_0x1d3c66(0x173)]((_0x3872d4,_0x5f1673)=>_0x3872d4[_0x1d3c66(0x169)]['localeCompare'](_0x5f1673[_0x1d3c66(0x169)]));await handleSDKOutput(_0x11075b,_0x1c0553);}else{if(_0x731867===0x0)console[_0x1d3c66(0x17a)](_0x1d3c66(0x14c)+_0x4f5dbf);else{console[_0x1d3c66(0x17a)](a45_0x256012[_0x1d3c66(0x143)]('['+_0x515064+']\x20matching\x20\x27'+_0x4f5dbf+'\x27'));const _0x25ce89=formatFlatList(_0x1fab05,_0x375565,{'showMetadata':!![],'getSegmentUrl':_0x1b1637},_0x17ffa9);console[_0x1d3c66(0x17a)](_0x25ce89);}}return 0x0;}async['listUnified'](_0x51b493,_0x13dc1e){const _0x27e8f4=a45_0x140fa6,{options:_0x457a59,tdx:_0x220550}=_0x51b493,_0x2c3070=await withSpinner(_0x27e8f4(0x172)+_0x13dc1e+_0x27e8f4(0x147),()=>_0x220550[_0x27e8f4(0x16a)][_0x27e8f4(0x180)](_0x13dc1e),{'verbose':_0x457a59['verbose']}),_0x52b10a=_0x2c3070[_0x27e8f4(0x14b)];_0x457a59[_0x27e8f4(0x142)]&&(console[_0x27e8f4(0x159)](_0x27e8f4(0x16e)+_0x52b10a[_0x27e8f4(0x149)]),_0x52b10a[_0x27e8f4(0x15a)]&&console[_0x27e8f4(0x159)](_0x27e8f4(0x17e)+_0x52b10a[_0x27e8f4(0x15a)]));const _0x292b97=await withSpinner(_0x27e8f4(0x17c),()=>_0x220550[_0x27e8f4(0x16a)]['listUnifiedWithJourneys'](_0x52b10a['parentId'],_0x52b10a['folderId']),{'verbose':_0x457a59[_0x27e8f4(0x142)]}),{folders:_0x29bccf,segments:_0x2d679b,journeys:_0x147273}=_0x292b97['data'],_0x1fcaa5=_0x29bccf[_0x27e8f4(0x13e)]+_0x2d679b[_0x27e8f4(0x13e)]+_0x147273[_0x27e8f4(0x13e)];console['error'](_0x27e8f4(0x15e)+_0x29bccf[_0x27e8f4(0x13e)]+_0x27e8f4(0x181)+(_0x29bccf[_0x27e8f4(0x13e)]!==0x1?'s':'')+',\x20'+_0x2d679b[_0x27e8f4(0x13e)]+_0x27e8f4(0x167)+(_0x2d679b['length']!==0x1?'s':'')+',\x20and\x20'+_0x147273[_0x27e8f4(0x13e)]+_0x27e8f4(0x15d)+(_0x147273['length']!==0x1?'s':''));const _0x5ce1cf=_0x364e47=>{const _0x3d3692=_0x27e8f4;return getConsoleNextUrl(_0x457a59[_0x3d3692(0x139)],'/app/ps/'+_0x52b10a[_0x3d3692(0x149)]+_0x3d3692(0x13c)+_0x364e47);},_0x3c82a3=_0x59f84b=>{const _0xe8db0d=_0x27e8f4;return getConsoleNextUrl(_0x457a59['site'],'/app/ps/'+_0x52b10a[_0xe8db0d(0x149)]+_0xe8db0d(0x13c)+_0x59f84b+'/j/da');},_0x2fdb93=_0x457a59['format']==='json'||_0x457a59[_0x27e8f4(0x138)]==='jsonl';if(_0x2fdb93){const _0x4eb76b=[..._0x29bccf[_0x27e8f4(0x17d)](_0x1011d7=>({..._0x1011d7,'type':_0x27e8f4(0x14f)})),..._0x2d679b['map'](_0x1abefe=>({..._0x1abefe,'type':_0x27e8f4(0x16a),'url':_0x5ce1cf(_0x1abefe['id'])})),..._0x147273['map'](_0x2873f5=>({..._0x2873f5,'name':_0x2873f5[_0x27e8f4(0x158)],'type':_0x27e8f4(0x155),'url':_0x3c82a3(_0x2873f5['id'])}))]['sort']((_0x4ee8dc,_0x489886)=>_0x4ee8dc['name']['localeCompare'](_0x489886['name']));await handleSDKOutput(_0x4eb76b,_0x457a59);}else{if(_0x1fcaa5===0x0)console[_0x27e8f4(0x17a)](a45_0x256012[_0x27e8f4(0x143)]('['+_0x13dc1e+']')),console[_0x27e8f4(0x17a)](_0x27e8f4(0x179));else{console[_0x27e8f4(0x17a)](a45_0x256012[_0x27e8f4(0x143)]('['+_0x13dc1e+']'));const _0x70b032=formatFlatList(_0x29bccf,_0x2d679b,{'showMetadata':!![],'getSegmentUrl':_0x5ce1cf,'getJourneyUrl':_0x3c82a3},_0x147273);console[_0x27e8f4(0x17a)](_0x70b032);}}return 0x0;}async['listRecursive'](_0x24f932,_0x1a2231){const _0x144461=a45_0x140fa6,{options:_0x542479,tdx:_0x2857c8}=_0x24f932,_0x1633da=await withSpinner(_0x144461(0x172)+_0x1a2231+_0x144461(0x147),()=>_0x2857c8['segment'][_0x144461(0x180)](_0x1a2231),{'verbose':_0x542479[_0x144461(0x142)]}),_0x2d12eb=_0x1633da[_0x144461(0x14b)];_0x542479[_0x144461(0x142)]&&(console[_0x144461(0x159)](_0x144461(0x16e)+_0x2d12eb[_0x144461(0x149)]),_0x2d12eb[_0x144461(0x15a)]&&console[_0x144461(0x159)](_0x144461(0x17e)+_0x2d12eb[_0x144461(0x15a)]));const _0x13aa3b=_0x542479[_0x144461(0x162)]||0xa,_0x4787af=await withSpinner(_0x144461(0x165),()=>_0x2857c8[_0x144461(0x16a)][_0x144461(0x144)](_0x2d12eb['parentId'],_0x2d12eb[_0x144461(0x15a)],0x0,_0x13aa3b),{'verbose':_0x542479[_0x144461(0x142)]}),_0x4db16a=_0x4787af[_0x144461(0x14b)],_0x511d58=_0x88f2a1=>{const _0x1e47f3=_0x144461;let _0xe04818=0x0,_0x38a609=0x0,_0x5600f5=0x0;for(const _0x4071c7 of _0x88f2a1){if(_0x4071c7[_0x1e47f3(0x14a)]===_0x1e47f3(0x14f))_0xe04818++;else{if(_0x4071c7[_0x1e47f3(0x14a)]===_0x1e47f3(0x16a))_0x38a609++;else{if(_0x4071c7[_0x1e47f3(0x14a)]==='journey')_0x5600f5++;}}if(_0x4071c7[_0x1e47f3(0x164)]){const _0x405746=_0x511d58(_0x4071c7[_0x1e47f3(0x164)]);_0xe04818+=_0x405746[_0x1e47f3(0x17b)],_0x38a609+=_0x405746['segments'],_0x5600f5+=_0x405746[_0x1e47f3(0x182)];}}return{'folders':_0xe04818,'segments':_0x38a609,'journeys':_0x5600f5};},_0x55c2a9=_0x511d58(_0x4db16a);console[_0x144461(0x159)](_0x144461(0x140)+_0x55c2a9[_0x144461(0x17b)]+_0x144461(0x181)+(_0x55c2a9[_0x144461(0x17b)]!==0x1?'s':'')+',\x20'+_0x55c2a9[_0x144461(0x13b)]+'\x20segment'+(_0x55c2a9[_0x144461(0x13b)]!==0x1?'s':'')+_0x144461(0x150)+_0x55c2a9['journeys']+_0x144461(0x15d)+(_0x55c2a9['journeys']!==0x1?'s':''));const _0x5f14ea=_0x34217c=>{const _0x39422e=_0x144461;return getConsoleNextUrl(_0x542479[_0x39422e(0x139)],'/app/ps/'+_0x2d12eb[_0x39422e(0x149)]+_0x39422e(0x13c)+_0x34217c);},_0x55e46f=_0x18b20e=>{const _0x3b1891=_0x144461;return getConsoleNextUrl(_0x542479[_0x3b1891(0x139)],'/app/ps/'+_0x2d12eb['parentId']+_0x3b1891(0x13c)+_0x18b20e+_0x3b1891(0x141));};if(_0x542479[_0x144461(0x138)]==='json'||_0x542479[_0x144461(0x138)]==='jsonl')await handleSDKOutput(_0x4db16a,_0x542479);else{console['log'](a45_0x256012[_0x144461(0x143)]('['+_0x1a2231+']'));const _0xf4192d=formatTree(_0x4db16a,{'showMetadata':!![],'getSegmentUrl':_0x5f14ea,'getJourneyUrl':_0x55e46f});console[_0x144461(0x17a)](_0xf4192d);}return 0x0;}}
|
|
1
|
+
const a45_0x221655=a45_0x73c3;function a45_0x3edc(){const _0x2da613=['\x20folder','json','data','message','listUnifiedWithJourneys','Folder\x20ID:\x20','8076580pgkBra','List\x20folders\x20and\x20child\x20segments','description','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','1MQIyug','sort','Resolving\x20parent\x20segment\x20\x27','6ZfSbEQ','map','Error:\x20No\x20parent\x20segment\x20context\x20set.','✔\x20Built\x20tree\x20with\x20','log','\x27...','children','replace','240zwoybU','Resolving\x20path\x20\x27','2407294smLcGj','length','parentId','60JbZexk','segments','Listing\x20folders,\x20segments,\x20and\x20journeys...','recursive','type','parentSegment','folderId','journeyBundleName','Building\x20hierarchy\x20tree...','name','folder','includes','filter','listWithPattern','folders','\x20matching\x20\x27',',\x20and\x20','jsonl','3084714keoiAY','✔\x20Found\x20','(not\x20set)','localeCompare','\x5c$&','Set\x20a\x20parent\x20segment\x20context\x20first:','Site:\x20','\x20segment','472900qlfWFJ','/app/ps/','Error:\x20','Parent\x20ID:\x20','test','resolvePathToResource','verbose','437022ubNUuj','/j/da','19271043YQCEBk','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','journeys','/e/','No\x20items\x20match\x20pattern:\x20','error','site','listUnified','maxDepth',']\x20matching\x20\x27','journey','dim','5043794XODpqn','listRecursive','format','Folder/pattern\x20arg:\x20','(empty)','segment','\x20\x20Cause:\x20','cause','\x20journey'];a45_0x3edc=function(){return _0x2da613;};return a45_0x3edc();}(function(_0x5b7af5,_0x3a9bf1){const _0xadd9f3=a45_0x73c3,_0x1f2fc2=_0x5b7af5();while(!![]){try{const _0x2bd0ce=-parseInt(_0xadd9f3(0x161))/0x1*(parseInt(_0xadd9f3(0x11c))/0x2)+parseInt(_0xadd9f3(0x131))/0x3+-parseInt(_0xadd9f3(0x139))/0x4*(-parseInt(_0xadd9f3(0x11f))/0x5)+-parseInt(_0xadd9f3(0x164))/0x6*(-parseInt(_0xadd9f3(0x14e))/0x7)+-parseInt(_0xadd9f3(0x11a))/0x8*(-parseInt(_0xadd9f3(0x140))/0x9)+-parseInt(_0xadd9f3(0x15d))/0xa+-parseInt(_0xadd9f3(0x142))/0xb;if(_0x2bd0ce===_0x3a9bf1)break;else _0x1f2fc2['push'](_0x1f2fc2['shift']());}catch(_0x1af1a1){_0x1f2fc2['push'](_0x1f2fc2['shift']());}}}(a45_0x3edc,0xd234a));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a45_0x73c3(_0x6eb9ec,_0x590f9e){_0x6eb9ec=_0x6eb9ec-0x117;const _0x3edc0f=a45_0x3edc();let _0x73c3bc=_0x3edc0f[_0x6eb9ec];return _0x73c3bc;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0xed71c6 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x221655(0x128)]=a45_0x221655(0x120);[a45_0x221655(0x15f)]=a45_0x221655(0x15e);async['execute'](_0x21f6fe){const _0x28eda6=a45_0x221655,{options:_0x4d62df,args:_0x27d4b7}=_0x21f6fe,_0x46b693=_0x4d62df[_0x28eda6(0x122)],_0x202471=_0x27d4b7[0x0];try{const _0x5e7743=_0x4d62df[_0x28eda6(0x124)];_0x4d62df[_0x28eda6(0x13f)]&&(console['error'](_0x28eda6(0x137)+_0x4d62df['site']),console['error']('Parent\x20segment\x20context:\x20'+(_0x5e7743||_0x28eda6(0x133))),_0x202471&&console[_0x28eda6(0x147)](_0x28eda6(0x151)+_0x202471),_0x46b693&&console[_0x28eda6(0x147)]('Recursive\x20mode:\x20enabled'));if(!_0x5e7743)return console[_0x28eda6(0x147)](_0x28eda6(0x166)),console[_0x28eda6(0x147)](''),console[_0x28eda6(0x147)](_0x28eda6(0x136)),console[_0x28eda6(0x147)](_0x28eda6(0x160)),console[_0x28eda6(0x147)](_0x28eda6(0x143)),console['error'](''),console[_0x28eda6(0x147)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x3958e1=_0x202471&&(_0x202471[_0x28eda6(0x12a)]('*')||_0x202471[_0x28eda6(0x12a)]('?'));if(_0x3958e1)return await this[_0x28eda6(0x12c)](_0x21f6fe,_0x5e7743,_0x202471);const _0x312e3d=_0x202471?_0x5e7743+'/'+_0x202471:_0x5e7743;return _0x46b693?await this[_0x28eda6(0x14f)](_0x21f6fe,_0x312e3d):await this[_0x28eda6(0x149)](_0x21f6fe,_0x312e3d);}catch(_0x3db925){if(_0x3db925 instanceof SDKError)return console[_0x28eda6(0x147)](_0x28eda6(0x13b)+_0x3db925[_0x28eda6(0x15a)]),_0x3db925[_0x28eda6(0x155)]&&console[_0x28eda6(0x147)](_0x28eda6(0x154)+_0x3db925[_0x28eda6(0x155)]),0x1;throw _0x3db925;}}async[a45_0x221655(0x12c)](_0xf12295,_0x3904bb,_0x58f346){const _0x2feb07=a45_0x221655,{options:_0x22dcd1,tdx:_0x15b8fe}=_0xf12295,_0x14ddb4=await withSpinner(_0x2feb07(0x163)+_0x3904bb+_0x2feb07(0x117),()=>_0x15b8fe['segment'][_0x2feb07(0x13e)](_0x3904bb),{'verbose':_0x22dcd1[_0x2feb07(0x13f)]}),_0x1e96c2=_0x14ddb4[_0x2feb07(0x159)],_0xedce58=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x15b8fe[_0x2feb07(0x153)][_0x2feb07(0x15b)](_0x1e96c2['parentId'],_0x1e96c2[_0x2feb07(0x125)]),{'verbose':_0x22dcd1[_0x2feb07(0x13f)]}),{folders:_0xdf6afc,segments:_0x292e7e,journeys:_0x7544c9}=_0xedce58[_0x2feb07(0x159)],_0x3e8a46=_0x58f346[_0x2feb07(0x119)](/[.+^${}()|[\]\\]/g,_0x2feb07(0x135))[_0x2feb07(0x119)](/\*/g,'.*')[_0x2feb07(0x119)](/\?/g,'.'),_0x184ca4=new RegExp('^'+_0x3e8a46+'$','i'),_0x33c6d4=_0xdf6afc[_0x2feb07(0x12b)](_0x42f613=>_0x184ca4[_0x2feb07(0x13d)](_0x42f613[_0x2feb07(0x128)])),_0x5bce52=_0x292e7e[_0x2feb07(0x12b)](_0x1c6740=>_0x184ca4[_0x2feb07(0x13d)](_0x1c6740['name'])),_0x574dbd=_0x7544c9[_0x2feb07(0x12b)](_0x1fa603=>_0x184ca4['test'](_0x1fa603[_0x2feb07(0x126)])),_0x4a96de=_0x33c6d4[_0x2feb07(0x11d)]+_0x5bce52[_0x2feb07(0x11d)]+_0x574dbd[_0x2feb07(0x11d)];console[_0x2feb07(0x147)]('✔\x20Found\x20'+_0x33c6d4['length']+_0x2feb07(0x157)+(_0x33c6d4[_0x2feb07(0x11d)]!==0x1?'s':'')+',\x20'+_0x5bce52['length']+_0x2feb07(0x138)+(_0x5bce52[_0x2feb07(0x11d)]!==0x1?'s':'')+_0x2feb07(0x12f)+_0x574dbd[_0x2feb07(0x11d)]+_0x2feb07(0x156)+(_0x574dbd[_0x2feb07(0x11d)]!==0x1?'s':'')+_0x2feb07(0x12e)+_0x58f346+'\x27');const _0x2c134b=_0x1c558d=>{const _0x360bb1=_0x2feb07;return getConsoleNextUrl(_0x22dcd1[_0x360bb1(0x148)],_0x360bb1(0x13a)+_0x1e96c2[_0x360bb1(0x11e)]+_0x360bb1(0x145)+_0x1c558d);},_0x474711=_0x22dcd1[_0x2feb07(0x150)]==='json'||_0x22dcd1[_0x2feb07(0x150)]==='jsonl';if(_0x474711){const _0x38d14b=[..._0x33c6d4['map'](_0x25f228=>({..._0x25f228,'type':_0x2feb07(0x129)})),..._0x5bce52[_0x2feb07(0x165)](_0x4f62f8=>({..._0x4f62f8,'type':'segment','url':_0x2c134b(_0x4f62f8['id'])})),..._0x574dbd[_0x2feb07(0x165)](_0x4d3756=>({..._0x4d3756,'name':_0x4d3756['journeyBundleName'],'type':_0x2feb07(0x14c)}))][_0x2feb07(0x162)]((_0x4ec56e,_0x4a32df)=>_0x4ec56e[_0x2feb07(0x128)][_0x2feb07(0x134)](_0x4a32df[_0x2feb07(0x128)]));await handleSDKOutput(_0x38d14b,_0x22dcd1);}else{if(_0x4a96de===0x0)console[_0x2feb07(0x168)](_0x2feb07(0x146)+_0x58f346);else{console[_0x2feb07(0x168)](a45_0xed71c6[_0x2feb07(0x14d)]('['+_0x3904bb+_0x2feb07(0x14b)+_0x58f346+'\x27'));const _0x2c9e7c=formatFlatList(_0x33c6d4,_0x5bce52,{'showMetadata':!![],'getSegmentUrl':_0x2c134b},_0x574dbd);console[_0x2feb07(0x168)](_0x2c9e7c);}}return 0x0;}async['listUnified'](_0x22c923,_0x15722b){const _0x5dccf0=a45_0x221655,{options:_0x46843a,tdx:_0x2903fe}=_0x22c923,_0x3178e6=await withSpinner(_0x5dccf0(0x11b)+_0x15722b+_0x5dccf0(0x117),()=>_0x2903fe['segment'][_0x5dccf0(0x13e)](_0x15722b),{'verbose':_0x46843a[_0x5dccf0(0x13f)]}),_0x11389d=_0x3178e6['data'];_0x46843a[_0x5dccf0(0x13f)]&&(console[_0x5dccf0(0x147)](_0x5dccf0(0x13c)+_0x11389d[_0x5dccf0(0x11e)]),_0x11389d[_0x5dccf0(0x125)]&&console[_0x5dccf0(0x147)](_0x5dccf0(0x15c)+_0x11389d[_0x5dccf0(0x125)]));const _0x586156=await withSpinner(_0x5dccf0(0x121),()=>_0x2903fe[_0x5dccf0(0x153)][_0x5dccf0(0x15b)](_0x11389d[_0x5dccf0(0x11e)],_0x11389d[_0x5dccf0(0x125)]),{'verbose':_0x46843a['verbose']}),{folders:_0x33004a,segments:_0x50bdbe,journeys:_0x13ce21}=_0x586156['data'],_0x15db1f=_0x33004a[_0x5dccf0(0x11d)]+_0x50bdbe[_0x5dccf0(0x11d)]+_0x13ce21[_0x5dccf0(0x11d)];console['error'](_0x5dccf0(0x132)+_0x33004a[_0x5dccf0(0x11d)]+'\x20folder'+(_0x33004a[_0x5dccf0(0x11d)]!==0x1?'s':'')+',\x20'+_0x50bdbe[_0x5dccf0(0x11d)]+'\x20segment'+(_0x50bdbe[_0x5dccf0(0x11d)]!==0x1?'s':'')+_0x5dccf0(0x12f)+_0x13ce21[_0x5dccf0(0x11d)]+_0x5dccf0(0x156)+(_0x13ce21[_0x5dccf0(0x11d)]!==0x1?'s':''));const _0x3d1753=_0x1bbe79=>{const _0x49428f=_0x5dccf0;return getConsoleNextUrl(_0x46843a[_0x49428f(0x148)],_0x49428f(0x13a)+_0x11389d[_0x49428f(0x11e)]+_0x49428f(0x145)+_0x1bbe79);},_0x338668=_0x59612e=>{const _0x570dab=_0x5dccf0;return getConsoleNextUrl(_0x46843a['site'],'/app/ps/'+_0x11389d['parentId']+_0x570dab(0x145)+_0x59612e+_0x570dab(0x141));},_0x5714ed=_0x46843a[_0x5dccf0(0x150)]==='json'||_0x46843a['format']==='jsonl';if(_0x5714ed){const _0x17e076=[..._0x33004a[_0x5dccf0(0x165)](_0x1da627=>({..._0x1da627,'type':'folder'})),..._0x50bdbe['map'](_0x5ae7fe=>({..._0x5ae7fe,'type':_0x5dccf0(0x153),'url':_0x3d1753(_0x5ae7fe['id'])})),..._0x13ce21['map'](_0x2dc0da=>({..._0x2dc0da,'name':_0x2dc0da['journeyBundleName'],'type':'journey','url':_0x338668(_0x2dc0da['id'])}))][_0x5dccf0(0x162)]((_0x580df4,_0x2036ac)=>_0x580df4[_0x5dccf0(0x128)]['localeCompare'](_0x2036ac['name']));await handleSDKOutput(_0x17e076,_0x46843a);}else{if(_0x15db1f===0x0)console[_0x5dccf0(0x168)](a45_0xed71c6[_0x5dccf0(0x14d)]('['+_0x15722b+']')),console[_0x5dccf0(0x168)](_0x5dccf0(0x152));else{console['log'](a45_0xed71c6[_0x5dccf0(0x14d)]('['+_0x15722b+']'));const _0x3f08cd=formatFlatList(_0x33004a,_0x50bdbe,{'showMetadata':!![],'getSegmentUrl':_0x3d1753,'getJourneyUrl':_0x338668},_0x13ce21);console[_0x5dccf0(0x168)](_0x3f08cd);}}return 0x0;}async[a45_0x221655(0x14f)](_0x3fbcb5,_0x251777){const _0x204baf=a45_0x221655,{options:_0xbc6979,tdx:_0xfaf786}=_0x3fbcb5,_0x325094=await withSpinner('Resolving\x20path\x20\x27'+_0x251777+_0x204baf(0x117),()=>_0xfaf786[_0x204baf(0x153)][_0x204baf(0x13e)](_0x251777),{'verbose':_0xbc6979[_0x204baf(0x13f)]}),_0x6735c5=_0x325094[_0x204baf(0x159)];_0xbc6979[_0x204baf(0x13f)]&&(console['error'](_0x204baf(0x13c)+_0x6735c5[_0x204baf(0x11e)]),_0x6735c5[_0x204baf(0x125)]&&console[_0x204baf(0x147)](_0x204baf(0x15c)+_0x6735c5[_0x204baf(0x125)]));const _0x6fdf56=_0xbc6979[_0x204baf(0x14a)]||0xa,_0x18bc0c=await withSpinner(_0x204baf(0x127),()=>_0xfaf786['segment'][_0x204baf(0x14f)](_0x6735c5['parentId'],_0x6735c5[_0x204baf(0x125)],0x0,_0x6fdf56),{'verbose':_0xbc6979['verbose']}),_0x137358=_0x18bc0c[_0x204baf(0x159)],_0x365d0e=_0x7de102=>{const _0x222b48=_0x204baf;let _0x47879f=0x0,_0x2bc4a3=0x0,_0x394c9c=0x0;for(const _0x4147b1 of _0x7de102){if(_0x4147b1[_0x222b48(0x123)]===_0x222b48(0x129))_0x47879f++;else{if(_0x4147b1[_0x222b48(0x123)]===_0x222b48(0x153))_0x2bc4a3++;else{if(_0x4147b1[_0x222b48(0x123)]===_0x222b48(0x14c))_0x394c9c++;}}if(_0x4147b1[_0x222b48(0x118)]){const _0x106f2a=_0x365d0e(_0x4147b1[_0x222b48(0x118)]);_0x47879f+=_0x106f2a['folders'],_0x2bc4a3+=_0x106f2a[_0x222b48(0x120)],_0x394c9c+=_0x106f2a[_0x222b48(0x144)];}}return{'folders':_0x47879f,'segments':_0x2bc4a3,'journeys':_0x394c9c};},_0x294b72=_0x365d0e(_0x137358);console[_0x204baf(0x147)](_0x204baf(0x167)+_0x294b72[_0x204baf(0x12d)]+_0x204baf(0x157)+(_0x294b72['folders']!==0x1?'s':'')+',\x20'+_0x294b72['segments']+'\x20segment'+(_0x294b72[_0x204baf(0x120)]!==0x1?'s':'')+_0x204baf(0x12f)+_0x294b72[_0x204baf(0x144)]+'\x20journey'+(_0x294b72['journeys']!==0x1?'s':''));const _0x5d3e4c=_0x2962fe=>{const _0x4c218b=_0x204baf;return getConsoleNextUrl(_0xbc6979[_0x4c218b(0x148)],'/app/ps/'+_0x6735c5[_0x4c218b(0x11e)]+_0x4c218b(0x145)+_0x2962fe);},_0x1b001c=_0x3acd9f=>{const _0x25279d=_0x204baf;return getConsoleNextUrl(_0xbc6979[_0x25279d(0x148)],'/app/ps/'+_0x6735c5['parentId']+_0x25279d(0x145)+_0x3acd9f+_0x25279d(0x141));};if(_0xbc6979['format']===_0x204baf(0x158)||_0xbc6979[_0x204baf(0x150)]===_0x204baf(0x130))await handleSDKOutput(_0x137358,_0xbc6979);else{console[_0x204baf(0x168)](a45_0xed71c6['dim']('['+_0x251777+']'));const _0x37b2f6=formatTree(_0x137358,{'showMetadata':!![],'getSegmentUrl':_0x5d3e4c,'getJourneyUrl':_0x1b001c});console['log'](_0x37b2f6);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x2d03df=a46_0x5739;(function(_0xf8a91c,_0x394156){const _0x3532d8=a46_0x5739,_0x272510=_0xf8a91c();while(!![]){try{const _0x41b263=-parseInt(_0x3532d8(0x17a))/0x1+-parseInt(_0x3532d8(0x16f))/0x2*(parseInt(_0x3532d8(0x171))/0x3)+parseInt(_0x3532d8(0x160))/0x4*(parseInt(_0x3532d8(0x17b))/0x5)+-parseInt(_0x3532d8(0x182))/0x6+-parseInt(_0x3532d8(0x16d))/0x7*(-parseInt(_0x3532d8(0x17d))/0x8)+-parseInt(_0x3532d8(0x15d))/0x9*(-parseInt(_0x3532d8(0x169))/0xa)+-parseInt(_0x3532d8(0x165))/0xb*(-parseInt(_0x3532d8(0x170))/0xc);if(_0x41b263===_0x394156)break;else _0x272510['push'](_0x272510['shift']());}catch(_0x54b509){_0x272510['push'](_0x272510['shift']());}}}(a46_0x5a2b,0x41a6d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a46_0x5739(_0x40abae,_0x51b06e){_0x40abae=_0x40abae-0x15b;const _0x5a2b5b=a46_0x5a2b();let _0x57392e=_0x5a2b5b[_0x40abae];return _0x57392e;}function a46_0x5a2b(){const _0x1873e7=['execute','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','641993SLzoxj','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','showTable','Site:\x20','1156040MbEpvs','limit','verbose','length','2051749mOkrdS','Show\x20table\x20contents','760642vybmfk','228xwoWnI','3ufQEgj','Usage:\x20tdx\x20show\x20<database.table>','data','validate','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','database','Querying\x20','✔\x20Retrieved\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','463764qNmSHs','260DKRLJa','\x20from\x20','8LAIIpO','error','cause','description','catalog','2586180fPKQdw','Table:\x20','Database:\x20','Limit:\x20','site','9DxpAhW','table','\x20\x20Cause:\x20','2032CrNpAd','message','query'];a46_0x5a2b=function(){return _0x1873e7;};return a46_0x5a2b();}export class ShowCommand extends BaseCommand{['name']='show';[a46_0x2d03df(0x180)]=a46_0x2d03df(0x16e);async[a46_0x2d03df(0x163)](_0xc93d90){const _0x3bc29d=a46_0x2d03df;return this[_0x3bc29d(0x167)](_0xc93d90);}async['showTable'](_0x35cb80){const _0x4e414b=a46_0x2d03df,{options:_0x36685a,args:_0xec38cc,tdx:_0x7c0fb6}=_0x35cb80;let _0x29d8aa;try{_0x29d8aa=parseTableReference(_0xec38cc[0x0]);const _0x2d94eb=_0x36685a[_0x4e414b(0x176)];!_0x29d8aa[_0x4e414b(0x176)]&&_0x2d94eb&&(_0x29d8aa[_0x4e414b(0x176)]=_0x2d94eb);const _0x4eb095=validateTableDescribeReference(_0x29d8aa);if(_0x4eb095)return console['error']('Error:\x20'+_0x4eb095),console['error'](_0x4e414b(0x172)),console[_0x4e414b(0x17e)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x4e414b(0x17e)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}catch(_0x200297){return console[_0x4e414b(0x17e)]('Error:\x20'+_0x200297[_0x4e414b(0x161)]),console[_0x4e414b(0x17e)](_0x4e414b(0x172)),console[_0x4e414b(0x17e)](_0x4e414b(0x166)),console[_0x4e414b(0x17e)](_0x4e414b(0x175)),0x1;}const _0x1b5984=_0x29d8aa[_0x4e414b(0x181)],_0x8afcb9=_0x29d8aa['database'],_0x3343d5=_0x29d8aa[_0x4e414b(0x15e)],_0x3a5085=resolveLimit(_0x36685a[_0x4e414b(0x16a)],DEFAULT_DISPLAY_LIMIT);try{_0x36685a[_0x4e414b(0x16b)]&&(console[_0x4e414b(0x17e)](_0x4e414b(0x168)+_0x36685a[_0x4e414b(0x15c)]),_0x1b5984&&console['error']('Catalog:\x20'+_0x1b5984),console[_0x4e414b(0x17e)](_0x4e414b(0x184)+_0x8afcb9),console[_0x4e414b(0x17e)](_0x4e414b(0x183)+_0x3343d5),console[_0x4e414b(0x17e)](_0x4e414b(0x15b)+_0x3a5085));const _0x190032=_0x1b5984?_0x1b5984+'.'+_0x8afcb9+'.'+_0x3343d5:_0x8afcb9+'.'+_0x3343d5,_0x205e98=await withSpinner(_0x4e414b(0x177)+_0x190032+'...',()=>_0x7c0fb6[_0x4e414b(0x162)][_0x4e414b(0x167)](_0x8afcb9,_0x3343d5,_0x3a5085,_0x1b5984),{'verbose':_0x36685a[_0x4e414b(0x16b)]}),_0x5e6a7f=_0x205e98[_0x4e414b(0x173)],_0x1129aa=_0x5e6a7f[_0x4e414b(0x173)];return _0x1129aa[_0x4e414b(0x16c)]===0x0?console[_0x4e414b(0x17e)](_0x4e414b(0x179)):console[_0x4e414b(0x17e)](_0x4e414b(0x178)+_0x1129aa[_0x4e414b(0x16c)]+'\x20row'+(_0x1129aa[_0x4e414b(0x16c)]!==0x1?'s':'')+_0x4e414b(0x17c)+_0x190032),await handleSDKOutput(_0x1129aa,_0x36685a),0x0;}catch(_0x2c2772){if(_0x2c2772 instanceof SDKError)return console['error']('Error:\x20'+_0x2c2772[_0x4e414b(0x161)]),_0x2c2772['cause']&&console[_0x4e414b(0x17e)](_0x4e414b(0x15f)+_0x2c2772[_0x4e414b(0x17f)]),0x1;throw _0x2c2772;}}[a46_0x2d03df(0x174)](_0x2a9dea){const _0x31b736=a46_0x2d03df;if(_0x2a9dea['args'][_0x31b736(0x16c)]===0x0)return'Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options';if(_0x2a9dea['args'][_0x31b736(0x16c)]>0x1)return _0x31b736(0x164);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x551d4f=a47_0x3367;(function(_0x462d5f,_0x203514){const _0x32b37c=a47_0x3367,_0x501e2c=_0x462d5f();while(!![]){try{const _0x388644=-parseInt(_0x32b37c(0xca))/0x1+parseInt(_0x32b37c(0xa9))/0x2*(-parseInt(_0x32b37c(0xc6))/0x3)+-parseInt(_0x32b37c(0xac))/0x4*(parseInt(_0x32b37c(0xc0))/0x5)+parseInt(_0x32b37c(0xd0))/0x6+parseInt(_0x32b37c(0xd2))/0x7*(parseInt(_0x32b37c(0xbf))/0x8)+-parseInt(_0x32b37c(0xcf))/0x9+parseInt(_0x32b37c(0xc2))/0xa*(parseInt(_0x32b37c(0xd7))/0xb);if(_0x388644===_0x203514)break;else _0x501e2c['push'](_0x501e2c['shift']());}catch(_0x319936){_0x501e2c['push'](_0x501e2c['shift']());}}}(a47_0x2711,0x6a82c));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';function a47_0x2711(){const _0x39b62e=['cyan','21923MWGKRs','1626334GjDJRc','config','message','16umJhkB','red','first_name','Credential\x20type:\x20','last_name','env','Name:','error','tdx','status','filter','site','Read\x20credential\x20from\x20','execute','N/A','site:\x20','email','yellow','session','8PNuWiQ','478585WnLvlp','getUserInfo','6460zFsixM','jobs','(from\x20','\x20profile:\x20','3ZgHbDj','OAuth','bold','log','187660yaANTy','cli','CLI\x20flag','✓\x20Authentication\x20successful\x0a','green','41301tLGERj','458922BiLXHj','dim','3224109CPVhuJ','Account\x20ID:','No\x20credential\x20found','name'];a47_0x2711=function(){return _0x39b62e;};return a47_0x2711();}import{GlobalContext}from'../core/global-context.js';import a47_0x55b93f from'chalk';function a47_0x3367(_0x659202,_0x9d2de7){_0x659202=_0x659202-0xa9;const _0x27110a=a47_0x2711();let _0x33673b=_0x27110a[_0x659202];return _0x33673b;}export class StatusCommand extends BaseCommand{[a47_0x551d4f(0xd5)]=a47_0x551d4f(0xb5);['description']='Show\x20authentication\x20status\x20and\x20current\x20context';async[a47_0x551d4f(0xb9)](_0x1640f8){const _0x3bcd6b=a47_0x551d4f,{options:_0x28495c,tdx:_0xabac11}=_0x1640f8,_0x1f4cb7=_0x28495c[_0x3bcd6b(0xb7)],_0x5e32ce=new GlobalContext(_0x28495c),_0x44340f=_0x5e32ce['profile'],_0xda2304=_0x5e32ce['profileSource'],_0x3f90a5=_0xda2304===_0x3bcd6b(0xcb)?_0x3bcd6b(0xcc):_0xda2304==='session'?_0x3bcd6b(0xbe):_0xda2304===_0x3bcd6b(0xb1)?'TDX_PROFILE\x20env':_0xda2304===_0x3bcd6b(0xaa)?'config':null,_0x56c546=_0x44340f?a47_0x55b93f[_0x3bcd6b(0xd6)](_0x44340f):a47_0x55b93f['dim'](_0x3bcd6b(0xba)),_0x3dcb3c=_0x3f90a5?'\x20'+a47_0x55b93f[_0x3bcd6b(0xd1)](_0x3bcd6b(0xc4)+_0x3f90a5+')'):'';console[_0x3bcd6b(0xc9)](a47_0x55b93f[_0x3bcd6b(0xc8)](_0x3bcd6b(0xb4))+_0x3bcd6b(0xc5)+_0x56c546+_0x3dcb3c+'\x20'+a47_0x55b93f[_0x3bcd6b(0xd1)]('(')+_0x3bcd6b(0xbb)+a47_0x55b93f[_0x3bcd6b(0xd6)](_0x1f4cb7)+a47_0x55b93f[_0x3bcd6b(0xd1)](')'));const _0x4e90e2=await getOAuthTokens(_0x44340f);if(_0x4e90e2)console[_0x3bcd6b(0xc9)](_0x3bcd6b(0xaf)+a47_0x55b93f['cyan'](_0x3bcd6b(0xc7)));else{const _0x6f50f9=await resolveAPIKeyAsync(_0x1f4cb7,_0x44340f);if(_0x6f50f9){const {source:_0x298d81,isDeprecated:_0x1fbcb7}=_0x6f50f9,_0x584792=_0x3bcd6b(0xb8)+a47_0x55b93f['cyan'](_0x298d81);console[_0x3bcd6b(0xc9)](_0x1fbcb7?a47_0x55b93f[_0x3bcd6b(0xbd)](_0x584792):_0x584792);}else console[_0x3bcd6b(0xc9)](a47_0x55b93f['yellow'](_0x3bcd6b(0xd4)));}let _0x3cba11=![];try{const _0x354117=await _0xabac11[_0x3bcd6b(0xc3)][_0x3bcd6b(0xc1)]();console['log'](a47_0x55b93f[_0x3bcd6b(0xce)](_0x3bcd6b(0xcd))),console[_0x3bcd6b(0xc9)](a47_0x55b93f['bold']('User:')+'\x20'+a47_0x55b93f['cyan'](_0x354117[_0x3bcd6b(0xbc)]));if(_0x354117[_0x3bcd6b(0xae)]||_0x354117['last_name']){const _0x34dbb3=[_0x354117[_0x3bcd6b(0xae)],_0x354117[_0x3bcd6b(0xb0)]][_0x3bcd6b(0xb6)](Boolean)['join']('\x20');console['log'](a47_0x55b93f[_0x3bcd6b(0xc8)](_0x3bcd6b(0xb2))+'\x20'+_0x34dbb3);}_0x354117['account_id']&&console['log'](a47_0x55b93f[_0x3bcd6b(0xc8)](_0x3bcd6b(0xd3))+'\x20'+a47_0x55b93f[_0x3bcd6b(0xbd)](_0x354117['account_id'])),_0x3cba11=!![];}catch(_0x104361){_0x104361 instanceof HTTPClientError&&_0x104361[_0x3bcd6b(0xb5)]===0x191?printAuthError(_0x104361,!![],_0x44340f):console[_0x3bcd6b(0xb3)](a47_0x55b93f[_0x3bcd6b(0xad)]('✗\x20Validation\x20failed:\x20'+(_0x104361 instanceof Error?_0x104361[_0x3bcd6b(0xab)]:String(_0x104361))));}return console[_0x3bcd6b(0xc9)](),_0x5e32ce['displayWithSources'](),_0x3cba11?0x0:0x1;}}
|