@treasuredata/tdx 2026.3.21 → 2026.3.23
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/auth-login-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/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/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/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/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/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
|
-
function a40_0x59a8(_0x4ff6a2,_0x6f166b){_0x4ff6a2=_0x4ff6a2-0x93;const _0x23f33b=a40_0x23f3();let _0x59a8d6=_0x23f33b[_0x4ff6a2];return _0x59a8d6;}const a40_0x21410e=a40_0x59a8;(function(_0x4ef3fc,_0x17d9e9){const _0x16280e=a40_0x59a8,_0x1e6eb5=_0x4ef3fc();while(!![]){try{const _0x4f265c=-parseInt(_0x16280e(0xab))/0x1+-parseInt(_0x16280e(0x93))/0x2*(-parseInt(_0x16280e(0xaf))/0x3)+-parseInt(_0x16280e(0xc8))/0x4*(-parseInt(_0x16280e(0xb3))/0x5)+-parseInt(_0x16280e(0xb6))/0x6*(parseInt(_0x16280e(0xfa))/0x7)+-parseInt(_0x16280e(0x96))/0x8+-parseInt(_0x16280e(0xaa))/0x9+parseInt(_0x16280e(0x103))/0xa;if(_0x4f265c===_0x17d9e9)break;else _0x1e6eb5['push'](_0x1e6eb5['shift']());}catch(_0x469f86){_0x1e6eb5['push'](_0x1e6eb5['shift']());}}}(a40_0x23f3,0x4a3ec));function a40_0x23f3(){const _0x3f99d6=['\x20updated','targetDir','\x20\x20\x20\x20','updatedAt','listFolders','endsWith','dim','Error:\x20Directory\x20not\x20found:\x20','nameToId','existingJourney','7zDxylY','then','/sb/da/esr','\x20\x20🗺️\x20\x20Journeys:','Delete\x20segment:','description','yes','site','createdAt','5955840cwqqtP','length','Error:\x20','\x20folders\x20to\x20create','\x20created','Error\x20parsing\x20YAML:\x20','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20to\x20delete','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20\x20Activations:','journeyId','yamlConfig','Fetching\x20existing\x20activations...','.yaml','Aborted.','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','diff','\x20changed','journeyBundleId','Delete\x20journey:','updated','map','/j/da/je','idToName','attributes','unchanged','new','getJourney','New\x20segment:','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','changed','journeys','yellow','buildUserMaps','.yml','connection','Push\x20','message','307654GezMhS','\x20new','\x20to\x20create','2217128JJPngn','\x27...','no_parent','deleted','createdSegmentIds','\x20\x20Journeys:\x20','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','all','folders','No\x20','errorCode','push','repeat','(Journey\x20will\x20be\x20deleted)','\x20\x20Source:\x20','created','resolveParentId','existingSegment','journeyBundleName','folderPath','1012824tkvUxO','88882bumcxu','cyan','folderId','Source\x20directory:\x20','3GliVSg','verbose','parentFolder','\x20deleted','1141575TTIeDk','journey','listJourneysWithDetailsFromParentSegment','1170354YEMUMH','\x20unchanged','listActivations','\x20activations]','toUpdate','delete','data','error','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','/app/ps/','green','get','segmentFolderId','📁\x20','segment','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','/e/','4BlWjrB','results','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','isScoped','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','relationships','\x20changes?','journeysOnly','filter','add','parent_name','segments','Parent\x20segment:\x20','\x0aValidation\x20failed:','activations','listSegments','red','\x0a✔\x20Push\x20complete','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','scopedFolderPath','isNew','type','blue','\x20to\x20update','join','versionNumber','toDelete','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','nameToType','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','\x20\x20Segments:\x20','segment:push','state','audienceId','toCreate','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','name','Changes\x20to\x20journey:','cwd'];a40_0x23f3=function(){return _0x3f99d6;};return a40_0x23f3();}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 a40_0x42b37b from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a40_0x21410e(0xed)]=a40_0x21410e(0xe8);[a40_0x21410e(0xff)]=a40_0x21410e(0xbf);async['execute'](_0x334835){const _0x3e280b=a40_0x21410e,{options:_0x1a52a2,args:_0x396f91,tdx:_0x3e26a8}=_0x334835,_0x18a54b=_0x1a52a2,_0x190eba=await resolveTarget({'arg':_0x396f91[0x0],'contextParent':_0x1a52a2['parentSegment'],'cwd':process[_0x3e280b(0xef)]()});if(!isSuccessfulResolution(_0x190eba))return _0x190eba[_0x3e280b(0xa0)]===_0x3e280b(0x98)?(console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0x123)](_0x3e280b(0xe6))),console[_0x3e280b(0xbd)](_0x3e280b(0xbe)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x3e280b(0xbd)](_0x3e280b(0xca))):(console[_0x3e280b(0xbd)](a40_0x42b37b['red'](_0x3e280b(0x105)+_0x190eba[_0x3e280b(0x128)]+'\x0a')),_0x190eba['helpText']&&console['error'](a40_0x42b37b[_0x3e280b(0xac)](_0x190eba['helpText']))),0x1;if(_0x190eba[_0x3e280b(0xdd)]===_0x3e280b(0xd2))return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0xf7)+_0x190eba[_0x3e280b(0xf1)]+'\x0a')),console[_0x3e280b(0xbd)](a40_0x42b37b['cyan'](_0x3e280b(0xda))),0x1;const _0x333dcc=_0x190eba['parentName'],_0x26e1b0=_0x190eba[_0x3e280b(0xf1)],_0xe300c5=_0x190eba[_0x3e280b(0xdd)]==='file'?_0x190eba['filePath']:undefined,_0x15e024=getScopedDetails(_0x190eba),_0x5a2937=_0x15e024?.[_0x3e280b(0xcb)]??![],_0x5c51e1=_0x15e024?.[_0x3e280b(0xdb)]??'';if(!existsSync(_0x26e1b0))return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0xf7)+_0x26e1b0+'\x0a')),console[_0x3e280b(0xbd)](a40_0x42b37b['cyan'](_0x3e280b(0xda))),0x1;_0x18a54b['verbose']&&(console[_0x3e280b(0xbd)]('Site:\x20'+_0x18a54b[_0x3e280b(0x101)]),console[_0x3e280b(0xbd)](_0x3e280b(0xd4)+_0x333dcc),console[_0x3e280b(0xbd)](_0x3e280b(0xae)+_0x26e1b0),_0x5a2937&&console[_0x3e280b(0xbd)]('Scoped\x20to\x20folder:\x20'+_0x5c51e1));const _0x1850fc=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x333dcc+_0x3e280b(0x97),()=>_0x3e26a8[_0x3e280b(0xc5)][_0x3e280b(0xa6)](_0x333dcc),{'verbose':_0x18a54b[_0x3e280b(0xb0)]}),_0xabeba1=_0x1850fc['data'],{parentSegmentResult:_0x2bd815,segmentsResult:_0x4cd52f,foldersResult:_0x249770,journeysWithDetailsResult:_0x1f220b,userMaps:_0x39854a}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x50007c=_0x3e280b,[_0x459303,_0x55a5f2,_0x34e9ff,_0x3950f0,_0xf2d304]=await Promise[_0x50007c(0x9d)]([_0x3e26a8[_0x50007c(0xc5)]['getParent'](_0xabeba1),_0x3e26a8[_0x50007c(0xc5)][_0x50007c(0xd7)](_0xabeba1),_0x3e26a8[_0x50007c(0xc5)][_0x50007c(0xf4)](_0xabeba1),_0x3e26a8[_0x50007c(0xb4)][_0x50007c(0xb5)](_0xabeba1,{'includeAllVersions':!![]}),_0x3e26a8['user'][_0x50007c(0x124)]()]);return{'parentSegmentResult':_0x459303,'segmentsResult':_0x55a5f2,'foldersResult':_0x34e9ff,'journeysWithDetailsResult':_0x3950f0,'userMaps':_0xf2d304};},{'verbose':_0x18a54b[_0x3e280b(0xb0)]})['then'](_0x1c399c=>_0x1c399c['data']),_0x20dc6a=_0x2bd815,_0x14fb4a=extractRootFolderId(_0x20dc6a),_0x42572a=_0x4cd52f,_0x4390ca=_0x249770,{journeys:_0x1f69c5,activationStepsById:_0x56e9c1}=_0x1f220b,_0x39c9e6=new Map(_0x1f69c5['map'](_0xaa6443=>[_0xaa6443['id'],_0xaa6443])),_0x4b330c=_0x1f69c5[_0x3e280b(0x118)](_0x53510a=>({'id':_0x53510a['id'],'name':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xed)],'journeyBundleName':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xa8)]||'','journeyBundleId':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0x115)]||'','versionNumber':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xe1)],'description':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xff)],'state':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xe9)],'paused':_0x53510a[_0x3e280b(0x11b)]['paused'],'audienceId':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xea)],'folderId':_0x53510a[_0x3e280b(0xcd)]?.[_0x3e280b(0xb1)]?.['data']?.['id'],'createdAt':_0x53510a['attributes'][_0x3e280b(0x102)],'updatedAt':_0x53510a[_0x3e280b(0x11b)][_0x3e280b(0xf3)]})),{emailToId:_0x25e733,idToEmail:_0x4526fc}=_0x39854a,_0x583204=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x1a6f03=await _0x3e26a8['connection']['list']();return buildConnectionMaps(_0x1a6f03);},{'verbose':_0x18a54b['verbose']})[_0x3e280b(0xfb)](_0x969001=>_0x969001[_0x3e280b(0xbc)]),_0x36b3ff=_0x583204[_0x3e280b(0xf8)],_0x34509b=_0x583204[_0x3e280b(0x11a)],_0xe4f2b3=_0x583204[_0x3e280b(0xe5)],_0x20aa86={'emailToIdMap':_0x25e733,'connectionNameToIdMap':_0x36b3ff,'connectionNameToTypeMap':_0xe4f2b3,'getSchema':_0x2175d0=>_0x3e26a8[_0x3e280b(0x126)]['getOutputSchemaWithCache'](_0x2175d0)};let {pathToId:_0x527680,idToPath:_0x56b7dd}=buildFolderMaps(_0x4390ca);const _0x2aadbd=buildSegmentLookupMap(_0x42572a,_0x56b7dd),_0x4de06e=buildSegmentNameToIdMap(_0x42572a),_0x1ce5e8=buildJourneyBundleLookupMap(_0x4b330c,_0x56b7dd);let _0x2b85f2;if(_0xe300c5){if(!_0xe300c5[_0x3e280b(0xf5)](_0x3e280b(0x125))&&!_0xe300c5['endsWith'](_0x3e280b(0x110)))return console['error'](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0xec)+_0xe300c5+'\x0a')),0x1;_0x2b85f2=[_0xe300c5];}else _0x2b85f2=findYamlFiles(_0x26e1b0);if(_0x2b85f2[_0x3e280b(0x104)]===0x0)return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0x112)+_0x26e1b0+'\x0a')),console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xac)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x18819a,_0x529246;try{const _0xf3fe76=parseAndClassifyYamlFiles(_0x2b85f2,_0x26e1b0,{'skipSegments':_0x18a54b['journeysOnly']});_0x18819a=_0xf3fe76[_0x3e280b(0xd3)],_0x529246=_0xf3fe76[_0x3e280b(0x122)];const _0x170726=validateParsedFiles(_0xf3fe76,_0x26e1b0);if(_0x170726[_0x3e280b(0x104)]>0x0)return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0xd5))),console[_0x3e280b(0xbd)](formatValidationErrors(_0x170726)),console['error'](a40_0x42b37b[_0x3e280b(0x123)]('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x42493d){return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0x108)+(_0x42493d instanceof Error?_0x42493d['message']:_0x42493d))),0x1;}if(_0x18819a[_0x3e280b(0x104)]===0x0&&_0x529246[_0x3e280b(0x104)]===0x0){const _0x5de9b5=_0x18a54b[_0x3e280b(0xcf)]?_0x3e280b(0xb4):'segment\x20or\x20journey';return console['error'](a40_0x42b37b[_0x3e280b(0x123)](_0x3e280b(0x9f)+_0x5de9b5+'\x20YAML\x20files\x20found')),0x0;}const _0x2f6c91=new Map();_0x42572a[_0x3e280b(0x104)]>0x0&&!_0x18a54b['journeysOnly']&&await withSpinner(_0x3e280b(0x10f),async()=>{await batchAsync(_0x42572a,async _0x3f8886=>{const _0x219746=a40_0x59a8,_0x20ddee=await _0x3e26a8[_0x219746(0xc5)][_0x219746(0xb8)](_0xabeba1,_0x3f8886['id']);_0x2f6c91['set'](_0x3f8886['id'],_0x20ddee);});},{'verbose':_0x18a54b[_0x3e280b(0xb0)]});const {segmentFiles:_0x3d5808,foldersToCreate:_0x408aab}=await prepareSegmentFiles(_0x18819a,{'segmentByFolderAndName':_0x2aadbd,'activationsBySegmentId':_0x2f6c91,'folderPathToId':_0x527680,'idToEmailMap':_0x4526fc,'connectionIdToNameMap':_0x34509b},_0x20aa86,_0x5a2937,_0x5c51e1),_0x32d974=_0xe300c5?[]:findSegmentsToDelete(_0x42572a,_0x18819a[_0x3e280b(0x118)](({yamlConfig:_0x30226b,folderPath:_0x5b114e})=>({'yamlConfig':_0x30226b,'folderPath':resolveTDFolderPath(_0x5b114e,_0x5a2937,_0x5c51e1)})),_0x56b7dd,_0x5c51e1,_0x5a2937),{journeyFiles:_0xc86c28,foldersToCreate:_0x4494aa}=await withProgressSpinner('Preparing\x20journeys...',async _0x5b4483=>prepareJourneyFiles(_0x529246,{'fetchJourney':async _0x4fe715=>_0x3e26a8[_0x3e280b(0xb4)][_0x3e280b(0x11e)](_0x4fe715[_0x3e280b(0x10d)]),'journeyBundlesByFolderAndName':_0x1ce5e8,'folderPathToId':_0x527680,'idToEmailMap':_0x4526fc,'connectionIdToNameMap':_0x34509b,'existingSegments':_0x42572a,'parentId':_0xabeba1,'deps':_0x3e26a8,'progress':{'update':_0x1611cb=>{const _0x18c6a5=_0x3e280b;_0x5b4483['setPhase'](_0x1611cb),_0x18a54b[_0x18c6a5(0xb0)]&&console[_0x18c6a5(0xbd)]('\x20\x20'+_0x1611cb);}},'journeyById':_0x39c9e6,'activationStepsById':_0x56e9c1},_0x5a2937,_0x5c51e1),{'verbose':_0x18a54b[_0x3e280b(0xb0)]})[_0x3e280b(0xfb)](_0x4c77b2=>_0x4c77b2[_0x3e280b(0xbc)]);for(const _0x34f255 of _0x4494aa){_0x408aab[_0x3e280b(0xd1)](_0x34f255);}const _0x32878e=_0xe300c5?[]:findJourneysToDelete(_0x4b330c,_0x529246['map'](({yamlConfig:_0x4c1097,folderPath:_0x24b681})=>({'yamlConfig':_0x4c1097,'folderPath':resolveTDFolderPath(_0x24b681,_0x5a2937,_0x5c51e1)})),_0x56b7dd,_0x5c51e1,_0x5a2937),_0x250b4b=calculatePushStats(_0x3d5808,_0xc86c28,_0x408aab,_0x32d974,_0x32878e,!!_0x18a54b[_0x3e280b(0xbb)],!!_0x18a54b[_0x3e280b(0xcf)]),_0x5cd162=_0x250b4b[_0x3e280b(0xd3)][_0x3e280b(0x11d)],_0x276557=_0x250b4b['segments'][_0x3e280b(0x121)],_0x31c56a=_0x250b4b[_0x3e280b(0xd3)][_0x3e280b(0x11c)],_0x40f922=_0x250b4b[_0x3e280b(0xd3)][_0x3e280b(0xe2)],_0x2b3da6=_0x250b4b[_0x3e280b(0x9e)]['toCreate'],_0x374a12=_0x250b4b[_0x3e280b(0x122)][_0x3e280b(0x11d)],_0x1b4494=_0x250b4b[_0x3e280b(0x122)]['changed'],_0x955b78=_0x250b4b[_0x3e280b(0x122)]['unchanged'],_0x298a47=_0x250b4b['journeys'][_0x3e280b(0xe2)],_0x4338a5=_0x250b4b[_0x3e280b(0xd6)]['all'],_0x418257=_0x250b4b[_0x3e280b(0xd6)][_0x3e280b(0xeb)],_0x21beb1=_0x250b4b[_0x3e280b(0xd6)][_0x3e280b(0xba)],_0x2738b9=_0x250b4b[_0x3e280b(0xd6)][_0x3e280b(0xe2)];console['error']('\x0aPush\x20summary\x20for\x20\x27'+_0x333dcc+'\x27:');_0x2b3da6[_0x3e280b(0x104)]>0x0&&console['error']('\x20\x20'+a40_0x42b37b[_0x3e280b(0xde)](_0x3e280b(0xc4)+_0x2b3da6[_0x3e280b(0x104)]+_0x3e280b(0x106)));if(!_0x18a54b[_0x3e280b(0xcf)]){console[_0x3e280b(0xbd)]('\x20\x20📊\x20Segments:'),console['error'](_0x3e280b(0xf2)+a40_0x42b37b['green']('+\x20'+_0x5cd162[_0x3e280b(0x104)]+'\x20new')),console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b['yellow']('~\x20'+_0x276557[_0x3e280b(0x104)]+_0x3e280b(0x114)));if(_0x40f922[_0x3e280b(0x104)]>0x0)console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xd8)]('-\x20'+_0x40f922[_0x3e280b(0x104)]+_0x3e280b(0x10a)));else _0x32d974[_0x3e280b(0x104)]>0x0&&!_0x18a54b[_0x3e280b(0xbb)]&&console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b['dim'](_0x32d974[_0x3e280b(0x104)]+_0x3e280b(0xe4)));console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xf6)]('=\x20'+_0x31c56a[_0x3e280b(0x104)]+_0x3e280b(0xb7)));}if(_0xc86c28[_0x3e280b(0x104)]>0x0||_0x32878e[_0x3e280b(0x104)]>0x0){console['error'](_0x3e280b(0xfd)),console[_0x3e280b(0xbd)]('\x20\x20\x20\x20'+a40_0x42b37b['green']('+\x20'+_0x374a12[_0x3e280b(0x104)]+_0x3e280b(0x94))),console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0x123)]('~\x20'+_0x1b4494['length']+'\x20changed'));if(_0x298a47[_0x3e280b(0x104)]>0x0)console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xd8)]('-\x20'+_0x298a47[_0x3e280b(0x104)]+_0x3e280b(0x10a)));else _0x32878e[_0x3e280b(0x104)]>0x0&&!_0x18a54b[_0x3e280b(0xbb)]&&console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xf6)](_0x32878e['length']+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xf6)]('=\x20'+_0x955b78[_0x3e280b(0x104)]+_0x3e280b(0xb7)));}_0x4338a5['length']>0x0&&!_0x18a54b[_0x3e280b(0xcf)]&&(console[_0x3e280b(0xbd)](''),console[_0x3e280b(0xbd)](_0x3e280b(0x10c)),_0x418257[_0x3e280b(0x104)]>0x0&&console[_0x3e280b(0xbd)]('\x20\x20\x20\x20'+a40_0x42b37b[_0x3e280b(0xc1)]('+\x20'+_0x418257[_0x3e280b(0x104)]+_0x3e280b(0x95))),_0x21beb1[_0x3e280b(0x104)]>0x0&&console['error'](_0x3e280b(0xf2)+a40_0x42b37b['yellow']('~\x20'+_0x21beb1[_0x3e280b(0x104)]+_0x3e280b(0xdf))),_0x2738b9[_0x3e280b(0x104)]>0x0&&console[_0x3e280b(0xbd)](_0x3e280b(0xf2)+a40_0x42b37b[_0x3e280b(0xd8)]('-\x20'+_0x2738b9[_0x3e280b(0x104)]+_0x3e280b(0x10a))));console[_0x3e280b(0xbd)](_0x3e280b(0xa4)+a40_0x42b37b[_0x3e280b(0xac)](_0x26e1b0)+'\x0a');if(_0x2b3da6[_0x3e280b(0x104)]>0x0){console['error']('Folders\x20to\x20create:');for(const _0x14c034 of _0x2b3da6){console['error']('\x20\x20'+a40_0x42b37b[_0x3e280b(0xde)]('+')+'\x20'+_0x14c034);}console[_0x3e280b(0xbd)]('');}if(_0x5cd162[_0x3e280b(0x104)]>0x0&&!_0x18a54b[_0x3e280b(0xcf)])for(const _0x2dfcbd of _0x5cd162){const _0xa5bf42=_0x2dfcbd['folderPath']?_0x2dfcbd[_0x3e280b(0xa9)]+'/'+_0x2dfcbd[_0x3e280b(0x10e)][_0x3e280b(0xed)]:_0x2dfcbd[_0x3e280b(0x10e)]['name'],_0xda182c=_0x2dfcbd['yamlConfig'][_0x3e280b(0xd6)]?.[_0x3e280b(0x104)]||0x0,_0x2bf026=_0xda182c>0x0?a40_0x42b37b[_0x3e280b(0xf6)]('\x20['+_0xda182c+_0x3e280b(0xb9)):'';console[_0x3e280b(0xbd)]('\x0a'+a40_0x42b37b[_0x3e280b(0xc1)](_0x3e280b(0x11f))+'\x20'+_0xa5bf42+_0x2bf026),console[_0x3e280b(0xbd)]('─'['repeat'](0x3c)),_0x2dfcbd[_0x3e280b(0x113)]&&console['error'](_0x2dfcbd[_0x3e280b(0x113)]),console[_0x3e280b(0xbd)]('─'['repeat'](0x3c));}if(_0x40f922[_0x3e280b(0x104)]>0x0&&!_0x18a54b[_0x3e280b(0xcf)])for(const _0x15687d of _0x40f922){const _0x2d6b50=_0x15687d[_0x3e280b(0xc3)]?_0x56b7dd[_0x3e280b(0xc2)](_0x15687d[_0x3e280b(0xc3)]['toString']())||'':'',_0x5234be=_0x2d6b50?_0x2d6b50+'/'+_0x15687d['name']:_0x15687d[_0x3e280b(0xed)],_0x500c5c=_0x2f6c91[_0x3e280b(0xc2)](_0x15687d['id'])||[],_0x842aba=_0x500c5c['length']>0x0?a40_0x42b37b[_0x3e280b(0xf6)]('\x20['+_0x500c5c[_0x3e280b(0x104)]+_0x3e280b(0xb9)):'';console['error']('\x0a'+a40_0x42b37b['red'](_0x3e280b(0xfe))+'\x20'+_0x5234be+_0x842aba),console[_0x3e280b(0xbd)]('─'['repeat'](0x3c));const _0x592046=segmentWithActivationsToYaml(_0x15687d,_0x500c5c,undefined,_0x4526fc,_0x34509b),_0x3f3c66=segmentToYamlString(_0x592046),_0x534337=generateDiff(_0x3f3c66,'');console[_0x3e280b(0xbd)](formatDiffWithColors(_0x534337)),console[_0x3e280b(0xbd)]('─'['repeat'](0x3c));}const _0x2e5ccd=_0x3d5808[_0x3e280b(0xd0)](_0x5922c9=>!_0x5922c9[_0x3e280b(0xdc)]&&_0x5922c9[_0x3e280b(0x113)]);if(_0x2e5ccd[_0x3e280b(0x104)]>0x0&&!_0x18a54b[_0x3e280b(0xcf)])for(const _0x45c199 of _0x2e5ccd){const _0x31aa7b=_0x45c199[_0x3e280b(0xa9)]?_0x45c199[_0x3e280b(0xa9)]+'/'+_0x45c199['yamlConfig']['name']:_0x45c199[_0x3e280b(0x10e)][_0x3e280b(0xed)];console[_0x3e280b(0xbd)]('\x0a'+a40_0x42b37b[_0x3e280b(0x123)]('Changes\x20to:')+'\x20'+_0x31aa7b),console[_0x3e280b(0xbd)]('─'['repeat'](0x3c)),console[_0x3e280b(0xbd)](_0x45c199[_0x3e280b(0x113)]),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c));}if(_0x374a12[_0x3e280b(0x104)]>0x0)for(const _0x4e3f45 of _0x374a12){const _0x13e95a=_0x4e3f45['folderPath']?_0x4e3f45[_0x3e280b(0xa9)]+'/'+_0x4e3f45['yamlConfig'][_0x3e280b(0xed)]:_0x4e3f45[_0x3e280b(0x10e)][_0x3e280b(0xed)];console[_0x3e280b(0xbd)]('\x0a'+a40_0x42b37b[_0x3e280b(0xc1)]('New\x20journey:')+'\x20'+_0x13e95a),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c)),_0x4e3f45[_0x3e280b(0x113)]&&console[_0x3e280b(0xbd)](_0x4e3f45['diff']),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c));}const _0x491a82=_0xc86c28[_0x3e280b(0xd0)](_0x3acfb5=>!_0x3acfb5[_0x3e280b(0xdc)]&&_0x3acfb5[_0x3e280b(0x113)]);if(_0x491a82[_0x3e280b(0x104)]>0x0)for(const _0x1028de of _0x491a82){const _0x1b2062=_0x1028de['folderPath']?_0x1028de[_0x3e280b(0xa9)]+'/'+_0x1028de[_0x3e280b(0x10e)][_0x3e280b(0xed)]:_0x1028de[_0x3e280b(0x10e)][_0x3e280b(0xed)];console[_0x3e280b(0xbd)]('\x0a'+a40_0x42b37b[_0x3e280b(0x123)](_0x3e280b(0xee))+'\x20'+_0x1b2062),console['error']('─'['repeat'](0x3c)),console[_0x3e280b(0xbd)](_0x1028de[_0x3e280b(0x113)]),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c));}if(_0x298a47[_0x3e280b(0x104)]>0x0)for(const _0x15d347 of _0x298a47){const _0x16dc38=_0x15d347['folderId']?_0x56b7dd[_0x3e280b(0xc2)](_0x15d347[_0x3e280b(0xad)])||'':'',_0x14aa75=_0x16dc38?_0x16dc38+'/'+_0x15d347[_0x3e280b(0xa8)]:_0x15d347[_0x3e280b(0xa8)];console[_0x3e280b(0xbd)]('\x0a'+a40_0x42b37b[_0x3e280b(0xd8)](_0x3e280b(0x116))+'\x20'+_0x14aa75),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c)),console['error'](a40_0x42b37b['red'](_0x3e280b(0xa3))),console[_0x3e280b(0xbd)]('─'[_0x3e280b(0xa2)](0x3c));}if(_0x18a54b['dryRun'])return console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0x123)](_0x3e280b(0x120))),0x0;const _0x280224=_0x18a54b['journeysOnly']?![]:_0x5cd162[_0x3e280b(0x104)]>0x0||_0x276557[_0x3e280b(0x104)]>0x0||_0x40f922[_0x3e280b(0x104)]>0x0,_0x5cdebf=_0x374a12[_0x3e280b(0x104)]>0x0||_0x1b4494['length']>0x0||_0x298a47[_0x3e280b(0x104)]>0x0,_0x3d6620=_0x18a54b['journeysOnly']?![]:_0x4338a5[_0x3e280b(0x104)]>0x0,_0x3abd57=_0x2b3da6[_0x3e280b(0x104)]>0x0;if(!_0x280224&&!_0x5cdebf&&!_0x3d6620&&!_0x3abd57){const _0x144022=_0x18a54b[_0x3e280b(0xcf)]?_0x3e280b(0x109):_0x3e280b(0xc6);console['error'](a40_0x42b37b[_0x3e280b(0xc1)](_0x144022));if(_0xe300c5&&_0x31c56a[_0x3e280b(0x104)]===0x1){const _0x12f55a=_0x31c56a[0x0];if(_0x12f55a[_0x3e280b(0xa7)]?.['id']){const _0x19a289=getConsoleNextUrl(_0x18a54b['site'],'/app/ps/'+_0xabeba1+_0x3e280b(0xc7)+_0x12f55a['existingSegment']['id']+_0x3e280b(0xfc));console[_0x3e280b(0xbd)](_0x3e280b(0xe3)+a40_0x42b37b[_0x3e280b(0xac)](_0x19a289));}}if(_0xe300c5&&_0x955b78[_0x3e280b(0x104)]===0x1){const _0x2b8c2f=_0x955b78[0x0];if(_0x2b8c2f['existingJourney']?.['id']){const _0x2ed402=getConsoleNextUrl(_0x18a54b[_0x3e280b(0x101)],_0x3e280b(0xc0)+_0xabeba1+_0x3e280b(0xc7)+_0x2b8c2f[_0x3e280b(0xf9)]['id']+_0x3e280b(0x119));console[_0x3e280b(0xbd)]('\x20\x20'+a40_0x42b37b[_0x3e280b(0xac)](_0x2ed402));}}return 0x0;}const _0x4f24cf=_0x18a54b[_0x3e280b(0xcf)]?_0x374a12[_0x3e280b(0x104)]+_0x1b4494[_0x3e280b(0x104)]+_0x298a47[_0x3e280b(0x104)]+_0x2b3da6[_0x3e280b(0x104)]:_0x5cd162['length']+_0x276557[_0x3e280b(0x104)]+_0x40f922[_0x3e280b(0x104)]+_0x374a12[_0x3e280b(0x104)]+_0x1b4494[_0x3e280b(0x104)]+_0x298a47[_0x3e280b(0x104)]+_0x2b3da6[_0x3e280b(0x104)]+_0x4338a5[_0x3e280b(0x104)];if(!_0x18a54b[_0x3e280b(0x100)]&&_0x4f24cf>0x0){if(!isInteractive())return console['error'](a40_0x42b37b[_0x3e280b(0xd8)]('\x0aError:'),_0x3e280b(0xcc)),console['error'](a40_0x42b37b['dim'](_0x3e280b(0x9c))),0x1;const _0x34bc53=await confirmKey(_0x3e280b(0x127)+_0x4f24cf+_0x3e280b(0xce));if(!_0x34bc53)return console[_0x3e280b(0xbd)](a40_0x42b37b['yellow'](_0x3e280b(0x111))),0x1;}const _0x1eee75={'withProgress':async(_0x20600e,_0x4218ca)=>{const _0x335b8a=_0x3e280b,_0x2c6947=await withSpinner(_0x20600e,_0x4218ca,{'verbose':_0x18a54b['verbose']});return{'data':_0x2c6947[_0x335b8a(0xbc)]};},'logInfo':_0x3bcc90=>console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xde)]('✔\x20'+_0x3bcc90)),'logSuccess':_0x586dde=>console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xc1)]('✔\x20'+_0x586dde)),'logWarning':_0x14b7d9=>console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0x123)]('⚠\x20'+_0x14b7d9)),'logDeleted':_0x154dba=>console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xd8)]('✔\x20'+_0x154dba))},_0x31d785={'segment':_0x3e26a8['segment'],'journey':_0x3e26a8[_0x3e280b(0xb4)],'user':_0x3e26a8['user'],'connection':_0x3e26a8[_0x3e280b(0x126)]};_0x2b3da6[_0x3e280b(0x104)]>0x0&&(_0x527680=await executePushFolders(_0x31d785,_0x2b3da6,_0x527680,{'parentId':_0xabeba1},_0x1eee75));const _0x409237={'rootFolderId':_0x14fb4a,'folderPathToId':_0x527680,'folderIdToPath':_0x56b7dd,'segmentNameToId':_0x4de06e,'activationsBySegmentId':_0x2f6c91,'emailToIdMap':_0x25e733,'idToEmailMap':_0x4526fc,'connectionNameToIdMap':_0x583204[_0x3e280b(0xf8)],'connectionIdToNameMap':_0x583204[_0x3e280b(0x11a)],'connectionNameToTypeMap':_0xe4f2b3},_0x5cbd0d=await executePushSegments(_0x31d785,_0x18a54b[_0x3e280b(0xcf)]?[]:_0x3d5808,_0x409237,{'parentId':_0xabeba1},_0x1eee75),_0x49cddc=_0x5cbd0d[_0x3e280b(0xa5)],_0x851a81=_0x5cbd0d['updated'],_0x1a4f27=_0x5cbd0d[_0x3e280b(0xd6)][_0x3e280b(0xa5)],_0x833be1=_0x5cbd0d[_0x3e280b(0xd6)][_0x3e280b(0x117)],_0x28d4e2=_0x5cbd0d['activations'][_0x3e280b(0x99)];let _0x496602;if(_0xe300c5&&_0x3d5808[_0x3e280b(0x104)]===0x1){const _0x52429d=_0x3d5808[0x0];_0x496602=_0x52429d['existingSegment']?.['id']??_0x5cbd0d[_0x3e280b(0x9a)][_0x3e280b(0xc2)](_0x52429d['yamlConfig'][_0x3e280b(0xed)]);}const _0x34946c=await executePushSegmentDeletions(_0x31d785,_0x18a54b['journeysOnly']?[]:_0x40f922,_0x1eee75);let _0x1a5a0d=0x0,_0x3ca7c0=0x0,_0x684ea1=0x0;const _0x1f48a6=new Map(_0x4de06e);for(const [_0x1bc5cc,_0x50e6b5]of _0x5cbd0d[_0x3e280b(0x9a)]){_0x1f48a6['set'](_0x1bc5cc,_0x50e6b5);}if(_0xc86c28[_0x3e280b(0x104)]>0x0){const _0x5d8076={..._0x409237,'segmentNameToId':_0x1f48a6,'existingSegments':_0x42572a,'activationContext':_0x20aa86},_0x5e8313=await executePushJourneys(_0x31d785,_0xc86c28,_0x5d8076,{'parentId':_0xabeba1,'rootFolderId':_0x14fb4a,'verbose':_0x18a54b[_0x3e280b(0xb0)]},_0x1eee75);_0x1a5a0d=_0x5e8313['created'],_0x3ca7c0=_0x5e8313[_0x3e280b(0x117)];if(_0xe300c5&&_0x5e8313[_0x3e280b(0xc9)][_0x3e280b(0x104)]===0x1){const _0x141697=_0x5e8313[_0x3e280b(0xc9)][0x0];if(_0x141697['journeyId']){const _0x1dbdf1=getConsoleNextUrl(_0x18a54b[_0x3e280b(0x101)],'/app/ps/'+_0xabeba1+_0x3e280b(0xc7)+_0x141697['journeyId']+'/j/da/je');console[_0x3e280b(0xbd)]('\x20\x20'+a40_0x42b37b['cyan'](_0x1dbdf1));}}}for(const _0x46f2d6 of _0x298a47){console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0x123)](_0x3e280b(0x10b)+_0x46f2d6[_0x3e280b(0xa8)])),_0x684ea1++;}const _0x4b5bef=[];if(_0x49cddc>0x0)_0x4b5bef[_0x3e280b(0xa1)](_0x49cddc+_0x3e280b(0x107));if(_0x851a81>0x0)_0x4b5bef[_0x3e280b(0xa1)](_0x851a81+_0x3e280b(0xf0));if(_0x34946c>0x0)_0x4b5bef[_0x3e280b(0xa1)](_0x34946c+_0x3e280b(0xb2));const _0x296db4=[];if(_0x1a5a0d>0x0)_0x296db4['push'](_0x1a5a0d+_0x3e280b(0x107));if(_0x3ca7c0>0x0)_0x296db4[_0x3e280b(0xa1)](_0x3ca7c0+'\x20updated');if(_0x684ea1>0x0)_0x296db4['push'](_0x684ea1+'\x20deleted');const _0x19a609=[];if(_0x1a4f27>0x0)_0x19a609[_0x3e280b(0xa1)](_0x1a4f27+_0x3e280b(0x107));if(_0x833be1>0x0)_0x19a609[_0x3e280b(0xa1)](_0x833be1+'\x20updated');if(_0x28d4e2>0x0)_0x19a609[_0x3e280b(0xa1)](_0x28d4e2+_0x3e280b(0xb2));console[_0x3e280b(0xbd)](a40_0x42b37b[_0x3e280b(0xc1)](_0x3e280b(0xd9)));_0x4b5bef[_0x3e280b(0x104)]>0x0&&!_0x18a54b['journeysOnly']&&console[_0x3e280b(0xbd)](_0x3e280b(0xe7)+_0x4b5bef[_0x3e280b(0xe0)](',\x20'));_0x296db4[_0x3e280b(0x104)]>0x0&&console['error'](_0x3e280b(0x9b)+_0x296db4[_0x3e280b(0xe0)](',\x20'));_0x19a609['length']>0x0&&!_0x18a54b['journeysOnly']&&console[_0x3e280b(0xbd)]('\x20\x20Activations:\x20'+_0x19a609[_0x3e280b(0xe0)](',\x20'));if(_0x496602){const _0x5cd0ec=getConsoleNextUrl(_0x18a54b[_0x3e280b(0x101)],_0x3e280b(0xc0)+_0xabeba1+_0x3e280b(0xc7)+_0x496602+'/sb/da/esr');console['error'](_0x3e280b(0xe3)+a40_0x42b37b[_0x3e280b(0xac)](_0x5cd0ec));}return 0x0;}}
|
|
1
|
+
const a40_0x2fcf53=a40_0x2f90;(function(_0x1ad24d,_0x4f4cfa){const _0x7c60c9=a40_0x2f90,_0x55f82a=_0x1ad24d();while(!![]){try{const _0x29f987=-parseInt(_0x7c60c9(0xfc))/0x1*(-parseInt(_0x7c60c9(0x12c))/0x2)+-parseInt(_0x7c60c9(0x149))/0x3+parseInt(_0x7c60c9(0x123))/0x4*(-parseInt(_0x7c60c9(0x114))/0x5)+-parseInt(_0x7c60c9(0x155))/0x6*(-parseInt(_0x7c60c9(0xff))/0x7)+-parseInt(_0x7c60c9(0x104))/0x8+parseInt(_0x7c60c9(0x113))/0x9+parseInt(_0x7c60c9(0xe3))/0xa;if(_0x29f987===_0x4f4cfa)break;else _0x55f82a['push'](_0x55f82a['shift']());}catch(_0x1acabc){_0x55f82a['push'](_0x55f82a['shift']());}}}(a40_0x47ec,0x5c3d9));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a40_0x2f90(_0x9b1aaf,_0x1adf5d){_0x9b1aaf=_0x9b1aaf-0xd1;const _0x47ec90=a40_0x47ec();let _0x2f90fb=_0x47ec90[_0x9b1aaf];return _0x2f90fb;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a40_0x22f913 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a40_0x47ec(){const _0x5032ca=['endsWith','\x20YAML\x20files\x20found','Delete\x20journey:','data','journeyBundleName','existingJourney','length','then','file','add','1773156jzkHVO','list','Fetching\x20existing\x20data...','message','journeysOnly','description','📁\x20','No\x20','\x20to\x20update','createdSegmentIds','yellow','segment\x20or\x20journey','3846NRVpGU','folderPath','Delete\x20segment:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','(Journey\x20will\x20be\x20deleted)','\x0aPush\x20summary\x20for\x20\x27','/j/da/je','execute','segments','New\x20segment:','set','no_parent','\x20changed','\x20\x20📊\x20Segments:','toString','filter','idToName','\x20changes?','delete','updatedAt','attributes','segment','\x20created','isNew','cwd','Parent\x20segment:\x20','get','\x20\x20🗺️\x20\x20Journeys:','Fetching\x20connections\x20for\x20name\x20resolution...','site','createdAt','filePath','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20Directory\x20not\x20found:\x20','created','blue','listFolders','Fetching\x20existing\x20activations...','\x20to\x20create','connection','journeys','toUpdate','/e/','\x20new','activations','445150BSClWP','Source\x20directory:\x20','.yml','\x20\x20Segments:\x20','/app/ps/','parentSegment','listSegments','versionNumber','\x27...','\x20\x20\x20\x20','error','Error\x20parsing\x20YAML:\x20','\x20activations]','/sb/da/esr','map','\x0a✔\x20Push\x20complete','buildUserMaps','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','join','diff','yamlConfig','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','repeat','\x20\x20Journeys:\x20','getOutputSchemaWithCache','1trdyzQ','updated','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','3878XtqoIN','changed','green','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','3632992CDePkZ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','segmentFolderId','\x20deleted','Aborted.','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','existingSegment','verbose','helpText','push','results','\x20\x20Source:\x20','parentName','journey','Preparing\x20journeys...','6483096wOrcJM','280655tgvrIF','segment:push','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','nameToId','unchanged','Changes\x20to:','targetDir','audienceId','type','new','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20updated','nameToType','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)','Push\x20','28wBcwCV','all','\x20\x20Activations:','errorCode','Site:\x20','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','getJourney','\x20to\x20delete','1391874hiahve','isScoped','cyan','journeyBundleId','red','dim','parent_name','toDelete','listActivations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeyId','setPhase','dryRun','getParent','resolveParentId','name','\x20unchanged','parentFolder','toCreate'];a40_0x47ec=function(){return _0x5032ca;};return a40_0x47ec();}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{[a40_0x2fcf53(0x13b)]=a40_0x2fcf53(0x115);[a40_0x2fcf53(0x14e)]=a40_0x2fcf53(0xfe);async[a40_0x2fcf53(0x15c)](_0x4f336e){const _0x439ecf=a40_0x2fcf53,{options:_0x25d6a1,args:_0x456591,tdx:_0x285d70}=_0x4f336e,_0x47e7eb=_0x25d6a1,_0x1c0e4c=await resolveTarget({'arg':_0x456591[0x0],'contextParent':_0x25d6a1[_0x439ecf(0xe8)],'cwd':process[_0x439ecf(0x16d)]()});if(!isSuccessfulResolution(_0x1c0e4c))return _0x1c0e4c[_0x439ecf(0x126)]===_0x439ecf(0x160)?(console[_0x439ecf(0xed)](a40_0x22f913['yellow'](_0x439ecf(0x158))),console[_0x439ecf(0xed)](_0x439ecf(0x121)),console[_0x439ecf(0xed)](_0x439ecf(0x129)),console[_0x439ecf(0xed)](_0x439ecf(0x105))):(console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)]('Error:\x20'+_0x1c0e4c[_0x439ecf(0x14c)]+'\x0a')),_0x1c0e4c[_0x439ecf(0x10c)]&&console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x12e)](_0x1c0e4c[_0x439ecf(0x10c)]))),0x1;if(_0x1c0e4c[_0x439ecf(0x11c)]===_0x439ecf(0x132))return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0xd7)+_0x1c0e4c[_0x439ecf(0x11a)]+'\x0a')),console['error'](a40_0x22f913['cyan'](_0x439ecf(0x102))),0x1;const _0x11c47f=_0x1c0e4c[_0x439ecf(0x110)],_0x3c26b9=_0x1c0e4c[_0x439ecf(0x11a)],_0x526070=_0x1c0e4c['type']===_0x439ecf(0x147)?_0x1c0e4c[_0x439ecf(0xd5)]:undefined,_0x101159=getScopedDetails(_0x1c0e4c),_0x56b228=_0x101159?.[_0x439ecf(0x12d)]??![],_0x31b0dd=_0x101159?.['scopedFolderPath']??'';if(!existsSync(_0x3c26b9))return console['error'](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0xd7)+_0x3c26b9+'\x0a')),console[_0x439ecf(0xed)](a40_0x22f913['cyan'](_0x439ecf(0x102))),0x1;_0x47e7eb[_0x439ecf(0x10b)]&&(console[_0x439ecf(0xed)](_0x439ecf(0x127)+_0x47e7eb[_0x439ecf(0xd3)]),console[_0x439ecf(0xed)](_0x439ecf(0x16e)+_0x11c47f),console[_0x439ecf(0xed)](_0x439ecf(0xe4)+_0x3c26b9),_0x56b228&&console[_0x439ecf(0xed)]('Scoped\x20to\x20folder:\x20'+_0x31b0dd));const _0xa9de90=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x11c47f+_0x439ecf(0xeb),()=>_0x285d70['segment'][_0x439ecf(0x13a)](_0x11c47f),{'verbose':_0x47e7eb[_0x439ecf(0x10b)]}),_0x42beaf=_0xa9de90[_0x439ecf(0x142)],{parentSegmentResult:_0x58b769,segmentsResult:_0x36a172,foldersResult:_0x250ab5,journeysWithDetailsResult:_0x10d7d2,userMaps:_0x2878a2}=await withSpinner(_0x439ecf(0x14b),async()=>{const _0x2e8ad8=_0x439ecf,[_0x569f8b,_0x3d5c63,_0x32dee9,_0x2f1186,_0x19e130]=await Promise[_0x2e8ad8(0x124)]([_0x285d70['segment'][_0x2e8ad8(0x139)](_0x42beaf),_0x285d70[_0x2e8ad8(0x16a)][_0x2e8ad8(0xe9)](_0x42beaf),_0x285d70[_0x2e8ad8(0x16a)][_0x2e8ad8(0xda)](_0x42beaf),_0x285d70['journey']['listJourneysWithDetailsFromParentSegment'](_0x42beaf,{'includeAllVersions':!![]}),_0x285d70['user'][_0x2e8ad8(0xf3)]()]);return{'parentSegmentResult':_0x569f8b,'segmentsResult':_0x3d5c63,'foldersResult':_0x32dee9,'journeysWithDetailsResult':_0x2f1186,'userMaps':_0x19e130};},{'verbose':_0x47e7eb[_0x439ecf(0x10b)]})[_0x439ecf(0x146)](_0x56af9d=>_0x56af9d[_0x439ecf(0x142)]),_0x39e061=_0x58b769,_0x1590dc=extractRootFolderId(_0x39e061),_0x2806f9=_0x36a172,_0x8fd04=_0x250ab5,{journeys:_0x5ef610,activationStepsById:_0x24f48a}=_0x10d7d2,_0x1afff1=new Map(_0x5ef610[_0x439ecf(0xf1)](_0x230fb7=>[_0x230fb7['id'],_0x230fb7])),_0x2ff95b=_0x5ef610[_0x439ecf(0xf1)](_0x235a04=>({'id':_0x235a04['id'],'name':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x13b)],'journeyBundleName':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x143)]||'','journeyBundleId':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x12f)]||'','versionNumber':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0xea)],'description':_0x235a04['attributes'][_0x439ecf(0x14e)],'state':_0x235a04[_0x439ecf(0x169)]['state'],'paused':_0x235a04['attributes']['paused'],'audienceId':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x11b)],'folderId':_0x235a04['relationships']?.[_0x439ecf(0x13d)]?.['data']?.['id'],'createdAt':_0x235a04['attributes'][_0x439ecf(0xd4)],'updatedAt':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x168)]})),{emailToId:_0x58589a,idToEmail:_0x35489e}=_0x2878a2,_0x2f77cf=await withSpinner(_0x439ecf(0xd2),async()=>{const _0x1db542=_0x439ecf,_0x10c130=await _0x285d70[_0x1db542(0xdd)][_0x1db542(0x14a)]();return buildConnectionMaps(_0x10c130);},{'verbose':_0x47e7eb[_0x439ecf(0x10b)]})[_0x439ecf(0x146)](_0x5b2a0a=>_0x5b2a0a[_0x439ecf(0x142)]),_0x2b56e6=_0x2f77cf['nameToId'],_0x5c6adb=_0x2f77cf[_0x439ecf(0x165)],_0x4dddb5=_0x2f77cf[_0x439ecf(0x120)],_0x4509d2={'emailToIdMap':_0x58589a,'connectionNameToIdMap':_0x2b56e6,'connectionNameToTypeMap':_0x4dddb5,'getSchema':_0x1d5e86=>_0x285d70[_0x439ecf(0xdd)][_0x439ecf(0xfb)](_0x1d5e86)};let {pathToId:_0x15f091,idToPath:_0x448c6c}=buildFolderMaps(_0x8fd04);const _0x929823=buildSegmentLookupMap(_0x2806f9,_0x448c6c),_0x199e59=buildSegmentNameToIdMap(_0x2806f9),_0x426542=buildJourneyBundleLookupMap(_0x2ff95b,_0x448c6c);let _0x33dd0e;if(_0x526070){if(!_0x526070[_0x439ecf(0x13f)](_0x439ecf(0xe5))&&!_0x526070['endsWith']('.yaml'))return console[_0x439ecf(0xed)](a40_0x22f913['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x526070+'\x0a')),0x1;_0x33dd0e=[_0x526070];}else _0x33dd0e=findYamlFiles(_0x3c26b9);if(_0x33dd0e[_0x439ecf(0x145)]===0x0)return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x11e)+_0x3c26b9+'\x0a')),console['error'](a40_0x22f913[_0x439ecf(0x12e)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x2cfbc0,_0x2481fd;try{const _0x5585fb=parseAndClassifyYamlFiles(_0x33dd0e,_0x3c26b9,{'skipSegments':_0x47e7eb[_0x439ecf(0x14d)]});_0x2cfbc0=_0x5585fb[_0x439ecf(0x15d)],_0x2481fd=_0x5585fb['journeys'];const _0x4ec4e2=validateParsedFiles(_0x5585fb,_0x3c26b9);if(_0x4ec4e2[_0x439ecf(0x145)]>0x0)return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)]('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x4ec4e2)),console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x109))),0x1;}catch(_0x17b30c){return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0xee)+(_0x17b30c instanceof Error?_0x17b30c[_0x439ecf(0x14c)]:_0x17b30c))),0x1;}if(_0x2cfbc0[_0x439ecf(0x145)]===0x0&&_0x2481fd[_0x439ecf(0x145)]===0x0){const _0x50f1c7=_0x47e7eb[_0x439ecf(0x14d)]?'journey':_0x439ecf(0x154);return console['error'](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x150)+_0x50f1c7+_0x439ecf(0x140))),0x0;}const _0x43ca50=new Map();_0x2806f9[_0x439ecf(0x145)]>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&await withSpinner(_0x439ecf(0xdb),async()=>{await batchAsync(_0x2806f9,async _0x4fba7d=>{const _0x43ec7d=a40_0x2f90,_0xe2063d=await _0x285d70[_0x43ec7d(0x16a)][_0x43ec7d(0x134)](_0x42beaf,_0x4fba7d['id']);_0x43ca50['set'](_0x4fba7d['id'],_0xe2063d);});},{'verbose':_0x47e7eb['verbose']});const {segmentFiles:_0x18e5c7,foldersToCreate:_0x14d5a5}=await prepareSegmentFiles(_0x2cfbc0,{'segmentByFolderAndName':_0x929823,'activationsBySegmentId':_0x43ca50,'folderPathToId':_0x15f091,'idToEmailMap':_0x35489e,'connectionIdToNameMap':_0x5c6adb},_0x4509d2,_0x56b228,_0x31b0dd),_0x3ba4c1=_0x526070?[]:findSegmentsToDelete(_0x2806f9,_0x2cfbc0[_0x439ecf(0xf1)](({yamlConfig:_0x3c77e0,folderPath:_0x428414})=>({'yamlConfig':_0x3c77e0,'folderPath':resolveTDFolderPath(_0x428414,_0x56b228,_0x31b0dd)})),_0x448c6c,_0x31b0dd,_0x56b228),{journeyFiles:_0x911338,foldersToCreate:_0xf4ffce}=await withProgressSpinner(_0x439ecf(0x112),async _0x379d4e=>prepareJourneyFiles(_0x2481fd,{'fetchJourney':async _0x15c8a7=>_0x285d70['journey'][_0x439ecf(0x12a)](_0x15c8a7[_0x439ecf(0x136)]),'journeyBundlesByFolderAndName':_0x426542,'folderPathToId':_0x15f091,'idToEmailMap':_0x35489e,'connectionIdToNameMap':_0x5c6adb,'existingSegments':_0x2806f9,'parentId':_0x42beaf,'deps':_0x285d70,'progress':{'update':_0x2ef27e=>{const _0x4e2f80=_0x439ecf;_0x379d4e[_0x4e2f80(0x137)](_0x2ef27e),_0x47e7eb[_0x4e2f80(0x10b)]&&console[_0x4e2f80(0xed)]('\x20\x20'+_0x2ef27e);}},'journeyById':_0x1afff1,'activationStepsById':_0x24f48a},_0x56b228,_0x31b0dd),{'verbose':_0x47e7eb[_0x439ecf(0x10b)]})[_0x439ecf(0x146)](_0x4b4cb6=>_0x4b4cb6[_0x439ecf(0x142)]);for(const _0x3165e4 of _0xf4ffce){_0x14d5a5[_0x439ecf(0x148)](_0x3165e4);}const _0x5f58db=_0x526070?[]:findJourneysToDelete(_0x2ff95b,_0x2481fd[_0x439ecf(0xf1)](({yamlConfig:_0x22b8f4,folderPath:_0x4e67ce})=>({'yamlConfig':_0x22b8f4,'folderPath':resolveTDFolderPath(_0x4e67ce,_0x56b228,_0x31b0dd)})),_0x448c6c,_0x31b0dd,_0x56b228),_0x1cea0b=calculatePushStats(_0x18e5c7,_0x911338,_0x14d5a5,_0x3ba4c1,_0x5f58db,!!_0x47e7eb['delete'],!!_0x47e7eb[_0x439ecf(0x14d)]),_0x1c9ccc=_0x1cea0b[_0x439ecf(0x15d)][_0x439ecf(0x11d)],_0x47ac70=_0x1cea0b['segments']['changed'],_0x4d3c4d=_0x1cea0b['segments'][_0x439ecf(0x118)],_0x265d72=_0x1cea0b['segments'][_0x439ecf(0x133)],_0x19619f=_0x1cea0b['folders'][_0x439ecf(0x13e)],_0x51bf39=_0x1cea0b[_0x439ecf(0xde)][_0x439ecf(0x11d)],_0x193fd4=_0x1cea0b['journeys'][_0x439ecf(0x100)],_0x2290ed=_0x1cea0b[_0x439ecf(0xde)][_0x439ecf(0x118)],_0xc85623=_0x1cea0b[_0x439ecf(0xde)][_0x439ecf(0x133)],_0x1905d3=_0x1cea0b[_0x439ecf(0xe2)]['all'],_0x58fabe=_0x1cea0b[_0x439ecf(0xe2)]['toCreate'],_0x453cf7=_0x1cea0b[_0x439ecf(0xe2)][_0x439ecf(0xdf)],_0x541c7c=_0x1cea0b[_0x439ecf(0xe2)][_0x439ecf(0x133)];console[_0x439ecf(0xed)](_0x439ecf(0x15a)+_0x11c47f+'\x27:');_0x19619f[_0x439ecf(0x145)]>0x0&&console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913['blue'](_0x439ecf(0x14f)+_0x19619f['length']+'\x20folders\x20to\x20create'));if(!_0x47e7eb[_0x439ecf(0x14d)]){console['error'](_0x439ecf(0x162)),console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x101)]('+\x20'+_0x1c9ccc[_0x439ecf(0x145)]+_0x439ecf(0xe1))),console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x153)]('~\x20'+_0x47ac70[_0x439ecf(0x145)]+'\x20changed'));if(_0x265d72['length']>0x0)console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x130)]('-\x20'+_0x265d72[_0x439ecf(0x145)]+_0x439ecf(0x12b)));else _0x3ba4c1['length']>0x0&&!_0x47e7eb[_0x439ecf(0x167)]&&console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913[_0x439ecf(0x131)](_0x3ba4c1[_0x439ecf(0x145)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913['dim']('=\x20'+_0x4d3c4d[_0x439ecf(0x145)]+_0x439ecf(0x13c)));}if(_0x911338[_0x439ecf(0x145)]>0x0||_0x5f58db[_0x439ecf(0x145)]>0x0){console['error'](_0x439ecf(0xd1)),console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913['green']('+\x20'+_0x51bf39[_0x439ecf(0x145)]+_0x439ecf(0xe1))),console['error'](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x153)]('~\x20'+_0x193fd4[_0x439ecf(0x145)]+_0x439ecf(0x161)));if(_0xc85623[_0x439ecf(0x145)]>0x0)console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x130)]('-\x20'+_0xc85623['length']+'\x20to\x20delete'));else _0x5f58db['length']>0x0&&!_0x47e7eb[_0x439ecf(0x167)]&&console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913[_0x439ecf(0x131)](_0x5f58db[_0x439ecf(0x145)]+_0x439ecf(0xf4)));console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913[_0x439ecf(0x131)]('=\x20'+_0x2290ed[_0x439ecf(0x145)]+_0x439ecf(0x13c)));}_0x1905d3[_0x439ecf(0x145)]>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&(console[_0x439ecf(0xed)](''),console[_0x439ecf(0xed)](_0x439ecf(0x125)),_0x58fabe[_0x439ecf(0x145)]>0x0&&console['error']('\x20\x20\x20\x20'+a40_0x22f913['green']('+\x20'+_0x58fabe[_0x439ecf(0x145)]+_0x439ecf(0xdc))),_0x453cf7[_0x439ecf(0x145)]>0x0&&console['error'](_0x439ecf(0xec)+a40_0x22f913['yellow']('~\x20'+_0x453cf7['length']+_0x439ecf(0x151))),_0x541c7c[_0x439ecf(0x145)]>0x0&&console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913['red']('-\x20'+_0x541c7c[_0x439ecf(0x145)]+_0x439ecf(0x12b))));console[_0x439ecf(0xed)](_0x439ecf(0x10f)+a40_0x22f913[_0x439ecf(0x12e)](_0x3c26b9)+'\x0a');if(_0x19619f['length']>0x0){console[_0x439ecf(0xed)]('Folders\x20to\x20create:');for(const _0x588c9a of _0x19619f){console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913[_0x439ecf(0xd9)]('+')+'\x20'+_0x588c9a);}console[_0x439ecf(0xed)]('');}if(_0x1c9ccc[_0x439ecf(0x145)]>0x0&&!_0x47e7eb[_0x439ecf(0x14d)])for(const _0x20d509 of _0x1c9ccc){const _0x6f7c8=_0x20d509[_0x439ecf(0x156)]?_0x20d509[_0x439ecf(0x156)]+'/'+_0x20d509[_0x439ecf(0xf7)][_0x439ecf(0x13b)]:_0x20d509[_0x439ecf(0xf7)]['name'],_0x4414d3=_0x20d509[_0x439ecf(0xf7)]['activations']?.['length']||0x0,_0x15fb98=_0x4414d3>0x0?a40_0x22f913['dim']('\x20['+_0x4414d3+_0x439ecf(0xef)):'';console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x101)](_0x439ecf(0x15e))+'\x20'+_0x6f7c8+_0x15fb98),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),_0x20d509[_0x439ecf(0xf6)]&&console['error'](_0x20d509[_0x439ecf(0xf6)]),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c));}if(_0x265d72['length']>0x0&&!_0x47e7eb['journeysOnly'])for(const _0x416dcc of _0x265d72){const _0x247dc9=_0x416dcc['segmentFolderId']?_0x448c6c['get'](_0x416dcc[_0x439ecf(0x106)][_0x439ecf(0x163)]())||'':'',_0x537e95=_0x247dc9?_0x247dc9+'/'+_0x416dcc[_0x439ecf(0x13b)]:_0x416dcc[_0x439ecf(0x13b)],_0x19f92d=_0x43ca50[_0x439ecf(0x16f)](_0x416dcc['id'])||[],_0x44e9e8=_0x19f92d[_0x439ecf(0x145)]>0x0?a40_0x22f913[_0x439ecf(0x131)]('\x20['+_0x19f92d[_0x439ecf(0x145)]+_0x439ecf(0xef)):'';console['error']('\x0a'+a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x157))+'\x20'+_0x537e95+_0x44e9e8),console[_0x439ecf(0xed)]('─'['repeat'](0x3c));const _0x4a7144=segmentWithActivationsToYaml(_0x416dcc,_0x19f92d,undefined,_0x35489e,_0x5c6adb),_0x25f37c=segmentToYamlString(_0x4a7144),_0x28d593=generateDiff(_0x25f37c,'');console[_0x439ecf(0xed)](formatDiffWithColors(_0x28d593)),console['error']('─'['repeat'](0x3c));}const _0x5adcb1=_0x18e5c7[_0x439ecf(0x164)](_0x300ab4=>!_0x300ab4[_0x439ecf(0x16c)]&&_0x300ab4['diff']);if(_0x5adcb1['length']>0x0&&!_0x47e7eb[_0x439ecf(0x14d)])for(const _0x249237 of _0x5adcb1){const _0x457511=_0x249237[_0x439ecf(0x156)]?_0x249237[_0x439ecf(0x156)]+'/'+_0x249237[_0x439ecf(0xf7)][_0x439ecf(0x13b)]:_0x249237[_0x439ecf(0xf7)][_0x439ecf(0x13b)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x119))+'\x20'+_0x457511),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),console[_0x439ecf(0xed)](_0x249237['diff']),console['error']('─'[_0x439ecf(0xf9)](0x3c));}if(_0x51bf39[_0x439ecf(0x145)]>0x0)for(const _0xd83ecb of _0x51bf39){const _0x39d2d1=_0xd83ecb['folderPath']?_0xd83ecb[_0x439ecf(0x156)]+'/'+_0xd83ecb['yamlConfig'][_0x439ecf(0x13b)]:_0xd83ecb[_0x439ecf(0xf7)][_0x439ecf(0x13b)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x101)]('New\x20journey:')+'\x20'+_0x39d2d1),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),_0xd83ecb[_0x439ecf(0xf6)]&&console[_0x439ecf(0xed)](_0xd83ecb['diff']),console[_0x439ecf(0xed)]('─'['repeat'](0x3c));}const _0x12110b=_0x911338[_0x439ecf(0x164)](_0x1ae281=>!_0x1ae281[_0x439ecf(0x16c)]&&_0x1ae281[_0x439ecf(0xf6)]);if(_0x12110b[_0x439ecf(0x145)]>0x0)for(const _0x211348 of _0x12110b){const _0x5cc581=_0x211348['folderPath']?_0x211348[_0x439ecf(0x156)]+'/'+_0x211348[_0x439ecf(0xf7)][_0x439ecf(0x13b)]:_0x211348[_0x439ecf(0xf7)][_0x439ecf(0x13b)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x153)]('Changes\x20to\x20journey:')+'\x20'+_0x5cc581),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),console[_0x439ecf(0xed)](_0x211348[_0x439ecf(0xf6)]),console['error']('─'[_0x439ecf(0xf9)](0x3c));}if(_0xc85623['length']>0x0)for(const _0xd2af60 of _0xc85623){const _0x30b27f=_0xd2af60['folderId']?_0x448c6c[_0x439ecf(0x16f)](_0xd2af60['folderId'])||'':'',_0x15928d=_0x30b27f?_0x30b27f+'/'+_0xd2af60[_0x439ecf(0x143)]:_0xd2af60[_0x439ecf(0x143)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x141))+'\x20'+_0x15928d),console['error']('─'['repeat'](0x3c)),console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x159))),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c));}if(_0x47e7eb[_0x439ecf(0x138)])return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x116))),0x0;const _0x4eac42=_0x47e7eb['journeysOnly']?![]:_0x1c9ccc[_0x439ecf(0x145)]>0x0||_0x47ac70[_0x439ecf(0x145)]>0x0||_0x265d72[_0x439ecf(0x145)]>0x0,_0xa6da66=_0x51bf39[_0x439ecf(0x145)]>0x0||_0x193fd4['length']>0x0||_0xc85623[_0x439ecf(0x145)]>0x0,_0x124066=_0x47e7eb[_0x439ecf(0x14d)]?![]:_0x1905d3['length']>0x0,_0x3adc7e=_0x19619f[_0x439ecf(0x145)]>0x0;if(!_0x4eac42&&!_0xa6da66&&!_0x124066&&!_0x3adc7e){const _0x5d7b05=_0x47e7eb[_0x439ecf(0x14d)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x439ecf(0x103);console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x101)](_0x5d7b05));if(_0x526070&&_0x4d3c4d[_0x439ecf(0x145)]===0x1){const _0x3461e1=_0x4d3c4d[0x0];if(_0x3461e1[_0x439ecf(0x10a)]?.['id']){const _0x15c760=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],_0x439ecf(0xe7)+_0x42beaf+'/e/'+_0x3461e1['existingSegment']['id']+_0x439ecf(0xf0));console[_0x439ecf(0xed)](_0x439ecf(0xf8)+a40_0x22f913['cyan'](_0x15c760));}}if(_0x526070&&_0x2290ed[_0x439ecf(0x145)]===0x1){const _0x285c24=_0x2290ed[0x0];if(_0x285c24[_0x439ecf(0x144)]?.['id']){const _0x439b9b=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],'/app/ps/'+_0x42beaf+_0x439ecf(0xe0)+_0x285c24[_0x439ecf(0x144)]['id']+_0x439ecf(0x15b));console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913[_0x439ecf(0x12e)](_0x439b9b));}}return 0x0;}const _0x129d59=_0x47e7eb[_0x439ecf(0x14d)]?_0x51bf39[_0x439ecf(0x145)]+_0x193fd4[_0x439ecf(0x145)]+_0xc85623[_0x439ecf(0x145)]+_0x19619f[_0x439ecf(0x145)]:_0x1c9ccc[_0x439ecf(0x145)]+_0x47ac70[_0x439ecf(0x145)]+_0x265d72[_0x439ecf(0x145)]+_0x51bf39[_0x439ecf(0x145)]+_0x193fd4[_0x439ecf(0x145)]+_0xc85623[_0x439ecf(0x145)]+_0x19619f[_0x439ecf(0x145)]+_0x1905d3[_0x439ecf(0x145)];if(!_0x47e7eb['yes']&&_0x129d59>0x0){if(!isInteractive())return console['error'](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x128)),_0x439ecf(0x135)),console[_0x439ecf(0xed)](a40_0x22f913['dim'](_0x439ecf(0xd6))),0x1;const _0x24f0b5=await confirmKey(_0x439ecf(0x122)+_0x129d59+_0x439ecf(0x166));if(!_0x24f0b5)return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x108))),0x1;}const _0x5b319c={'withProgress':async(_0x4e10f9,_0x5ed626)=>{const _0x283729=_0x439ecf,_0x581190=await withSpinner(_0x4e10f9,_0x5ed626,{'verbose':_0x47e7eb[_0x283729(0x10b)]});return{'data':_0x581190[_0x283729(0x142)]};},'logInfo':_0x26e3ff=>console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0xd9)]('✔\x20'+_0x26e3ff)),'logSuccess':_0xd72eb=>console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x101)]('✔\x20'+_0xd72eb)),'logWarning':_0x33d676=>console[_0x439ecf(0xed)](a40_0x22f913['yellow']('⚠\x20'+_0x33d676)),'logDeleted':_0xda803c=>console[_0x439ecf(0xed)](a40_0x22f913['red']('✔\x20'+_0xda803c))},_0x36cf71={'segment':_0x285d70[_0x439ecf(0x16a)],'journey':_0x285d70[_0x439ecf(0x111)],'user':_0x285d70['user'],'connection':_0x285d70[_0x439ecf(0xdd)]};_0x19619f['length']>0x0&&(_0x15f091=await executePushFolders(_0x36cf71,_0x19619f,_0x15f091,{'parentId':_0x42beaf},_0x5b319c));const _0x16c425={'rootFolderId':_0x1590dc,'folderPathToId':_0x15f091,'folderIdToPath':_0x448c6c,'segmentNameToId':_0x199e59,'activationsBySegmentId':_0x43ca50,'emailToIdMap':_0x58589a,'idToEmailMap':_0x35489e,'connectionNameToIdMap':_0x2f77cf[_0x439ecf(0x117)],'connectionIdToNameMap':_0x2f77cf[_0x439ecf(0x165)],'connectionNameToTypeMap':_0x4dddb5},_0x3105f3=await executePushSegments(_0x36cf71,_0x47e7eb[_0x439ecf(0x14d)]?[]:_0x18e5c7,_0x16c425,{'parentId':_0x42beaf},_0x5b319c),_0x4aed9c=_0x3105f3[_0x439ecf(0xd8)],_0x911748=_0x3105f3[_0x439ecf(0xfd)],_0x3664ab=_0x3105f3[_0x439ecf(0xe2)][_0x439ecf(0xd8)],_0x380b6b=_0x3105f3['activations'][_0x439ecf(0xfd)],_0x2f693b=_0x3105f3['activations']['deleted'];let _0xa1b0a4;if(_0x526070&&_0x18e5c7[_0x439ecf(0x145)]===0x1){const _0x52da06=_0x18e5c7[0x0];_0xa1b0a4=_0x52da06[_0x439ecf(0x10a)]?.['id']??_0x3105f3[_0x439ecf(0x152)]['get'](_0x52da06['yamlConfig'][_0x439ecf(0x13b)]);}const _0xb98543=await executePushSegmentDeletions(_0x36cf71,_0x47e7eb[_0x439ecf(0x14d)]?[]:_0x265d72,_0x5b319c);let _0x5140e0=0x0,_0x5042ab=0x0,_0x117b33=0x0;const _0x5c5451=new Map(_0x199e59);for(const [_0x4ba2a8,_0x298e33]of _0x3105f3[_0x439ecf(0x152)]){_0x5c5451[_0x439ecf(0x15f)](_0x4ba2a8,_0x298e33);}if(_0x911338[_0x439ecf(0x145)]>0x0){const _0x35596c={..._0x16c425,'segmentNameToId':_0x5c5451,'existingSegments':_0x2806f9,'activationContext':_0x4509d2},_0x144376=await executePushJourneys(_0x36cf71,_0x911338,_0x35596c,{'parentId':_0x42beaf,'rootFolderId':_0x1590dc,'verbose':_0x47e7eb[_0x439ecf(0x10b)]},_0x5b319c);_0x5140e0=_0x144376[_0x439ecf(0xd8)],_0x5042ab=_0x144376[_0x439ecf(0xfd)];if(_0x526070&&_0x144376[_0x439ecf(0x10e)]['length']===0x1){const _0x1cb558=_0x144376[_0x439ecf(0x10e)][0x0];if(_0x1cb558['journeyId']){const _0x30a2fc=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],'/app/ps/'+_0x42beaf+_0x439ecf(0xe0)+_0x1cb558[_0x439ecf(0x136)]+'/j/da/je');console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913[_0x439ecf(0x12e)](_0x30a2fc));}}}for(const _0x2254e9 of _0xc85623){console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x2254e9[_0x439ecf(0x143)])),_0x117b33++;}const _0x2c51f7=[];if(_0x4aed9c>0x0)_0x2c51f7[_0x439ecf(0x10d)](_0x4aed9c+_0x439ecf(0x16b));if(_0x911748>0x0)_0x2c51f7[_0x439ecf(0x10d)](_0x911748+'\x20updated');if(_0xb98543>0x0)_0x2c51f7[_0x439ecf(0x10d)](_0xb98543+'\x20deleted');const _0x56e0f7=[];if(_0x5140e0>0x0)_0x56e0f7[_0x439ecf(0x10d)](_0x5140e0+_0x439ecf(0x16b));if(_0x5042ab>0x0)_0x56e0f7[_0x439ecf(0x10d)](_0x5042ab+_0x439ecf(0x11f));if(_0x117b33>0x0)_0x56e0f7[_0x439ecf(0x10d)](_0x117b33+_0x439ecf(0x107));const _0x55e5c8=[];if(_0x3664ab>0x0)_0x55e5c8['push'](_0x3664ab+_0x439ecf(0x16b));if(_0x380b6b>0x0)_0x55e5c8['push'](_0x380b6b+'\x20updated');if(_0x2f693b>0x0)_0x55e5c8[_0x439ecf(0x10d)](_0x2f693b+'\x20deleted');console[_0x439ecf(0xed)](a40_0x22f913['green'](_0x439ecf(0xf2)));_0x2c51f7['length']>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&console[_0x439ecf(0xed)](_0x439ecf(0xe6)+_0x2c51f7[_0x439ecf(0xf5)](',\x20'));_0x56e0f7['length']>0x0&&console['error'](_0x439ecf(0xfa)+_0x56e0f7[_0x439ecf(0xf5)](',\x20'));_0x55e5c8['length']>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&console[_0x439ecf(0xed)]('\x20\x20Activations:\x20'+_0x55e5c8['join'](',\x20'));if(_0xa1b0a4){const _0x4dfb82=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],'/app/ps/'+_0x42beaf+_0x439ecf(0xe0)+_0xa1b0a4+'/sb/da/esr');console[_0x439ecf(0xed)](_0x439ecf(0xf8)+a40_0x22f913[_0x439ecf(0x12e)](_0x4dfb82));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a41_0x3121b3=a41_0x38d9;function a41_0x38d9(_0x50210c,_0x2b6985){_0x50210c=_0x50210c-0x159;const _0x17d028=a41_0x17d0();let _0x38d90b=_0x17d028[_0x50210c];return _0x38d90b;}(function(_0x1084d6,_0x5a312a){const _0x4a7ca3=a41_0x38d9,_0xc01ce9=_0x1084d6();while(!![]){try{const _0x1c2ce5=parseInt(_0x4a7ca3(0x15a))/0x1*(parseInt(_0x4a7ca3(0x16f))/0x2)+-parseInt(_0x4a7ca3(0x17f))/0x3+-parseInt(_0x4a7ca3(0x16b))/0x4+parseInt(_0x4a7ca3(0x159))/0x5*(-parseInt(_0x4a7ca3(0x188))/0x6)+parseInt(_0x4a7ca3(0x167))/0x7*(-parseInt(_0x4a7ca3(0x16c))/0x8)+-parseInt(_0x4a7ca3(0x160))/0x9+parseInt(_0x4a7ca3(0x17e))/0xa;if(_0x1c2ce5===_0x5a312a)break;else _0xc01ce9['push'](_0xc01ce9['shift']());}catch(_0xc5cd08){_0xc01ce9['push'](_0xc01ce9['shift']());}}}(a41_0x17d0,0xd8841));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a41_0x17d0(){const _0x1f9dc8=['Parent\x20ID:\x20','description','2632482ZqryJo','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','yellow','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','resolveFolderId','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Resolving\x20folder\x20\x27','796236uQRNUM','type','error','kind','3425612jPZAeo','112javdmu','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','parentId','2865686msXLDn','length','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolving\x20path\x20\x27','Error:\x20Cannot\x20update\x20','segment','Resolved\x20relative\x20path\x20to:\x20','data','segmentPath','ruleFile','\x27...','Segment\x20ID:\x20','name','folder','✔\x20Updated\x20segment\x20\x27','37977770PISjXu','3642381DZJMtT','segmentId','Update\x20existing\x20child\x20segment','updateSegmentById','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segmentName','\x20\x20\x20Path:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','INTERNAL','78NlNuKa','149335YNIlZK','1HNCWQQ','rule','verbose','segment:update'];a41_0x17d0=function(){return _0x1f9dc8;};return a41_0x17d0();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a41_0x42fc26 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a41_0x3121b3(0x17b)]=a41_0x3121b3(0x15d);['description']=a41_0x3121b3(0x181);async['execute'](_0x95bf80){const _0x5c8484=a41_0x3121b3;console['error'](a41_0x42fc26[_0x5c8484(0x162)](_0x5c8484(0x161))),console[_0x5c8484(0x169)](a41_0x42fc26['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x21dd93,args:_0x201e68,tdx:_0x3ab9f2}=_0x95bf80,_0x3ac0ea=_0x21dd93;if(_0x201e68[_0x5c8484(0x170)]===0x0)return console[_0x5c8484(0x169)](_0x5c8484(0x183)),console[_0x5c8484(0x169)](_0x5c8484(0x171)),console[_0x5c8484(0x169)]('Examples:'),console[_0x5c8484(0x169)](_0x5c8484(0x165)),console['error'](_0x5c8484(0x163)),0x1;const _0x515dbf=_0x201e68[0x0],_0x1326da=_0x21dd93[_0x5c8484(0x177)];let _0x2f5793=_0x515dbf;_0x1326da&&!_0x515dbf['includes']('/')&&(_0x2f5793=_0x1326da+'/'+_0x515dbf,_0x3ac0ea['verbose']&&console[_0x5c8484(0x169)](_0x5c8484(0x175)+_0x2f5793));const _0x2ca757=await withSpinner(_0x5c8484(0x172)+_0x2f5793+_0x5c8484(0x179),()=>_0x3ab9f2[_0x5c8484(0x174)]['resolvePathToResource'](_0x2f5793),{'verbose':_0x3ac0ea['verbose']}),_0x184135=_0x2ca757[_0x5c8484(0x176)];_0x3ac0ea[_0x5c8484(0x15c)]&&console[_0x5c8484(0x169)]('Resolved\x20type:\x20'+_0x184135[_0x5c8484(0x168)]);if(_0x184135['type']!==_0x5c8484(0x174))return console[_0x5c8484(0x169)](_0x5c8484(0x173)+_0x184135['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0x5c8484(0x16d)),0x1;if(!_0x184135[_0x5c8484(0x180)])throw new SDKError(ErrorCode[_0x5c8484(0x187)],_0x5c8484(0x186));const _0x48c269=_0x184135[_0x5c8484(0x16e)],_0x53cdd2=_0x184135[_0x5c8484(0x180)];_0x3ac0ea[_0x5c8484(0x15c)]&&(console[_0x5c8484(0x169)](_0x5c8484(0x15e)+_0x48c269),console['error'](_0x5c8484(0x17a)+_0x53cdd2));let _0x5b58c1;if(_0x3ac0ea[_0x5c8484(0x17c)]){const _0x411726=_0x3ac0ea['folder'],_0x4f41c0=await withSpinner(_0x5c8484(0x166)+_0x411726+_0x5c8484(0x179),()=>_0x3ab9f2[_0x5c8484(0x174)][_0x5c8484(0x164)](_0x48c269,_0x411726),{'verbose':_0x3ac0ea[_0x5c8484(0x15c)]});_0x5b58c1=parseInt(_0x4f41c0[_0x5c8484(0x176)],0xa),_0x3ac0ea[_0x5c8484(0x15c)]&&console[_0x5c8484(0x169)]('Resolved\x20folder\x20ID:\x20'+_0x5b58c1);}const _0x1ec574=await loadJSONFromOptions(_0x3ac0ea[_0x5c8484(0x15b)],_0x3ac0ea[_0x5c8484(0x178)]),_0x8314a3={'name':_0x3ac0ea[_0x5c8484(0x17b)],'description':_0x3ac0ea[_0x5c8484(0x15f)],'rule':_0x1ec574,'kind':_0x3ac0ea['kind']!==undefined?parseInt(_0x3ac0ea[_0x5c8484(0x16a)],0xa):undefined,'segmentFolderId':_0x5b58c1},_0x16c58f=await withSpinner('Updating\x20segment\x20\x27'+_0x184135[_0x5c8484(0x184)]+_0x5c8484(0x179),()=>_0x3ab9f2['segment'][_0x5c8484(0x182)](_0x48c269,_0x53cdd2,_0x8314a3),{'verbose':_0x3ac0ea[_0x5c8484(0x15c)]}),_0x89a624=_0x16c58f[_0x5c8484(0x176)];return console[_0x5c8484(0x169)](_0x5c8484(0x17d)+_0x89a624[_0x5c8484(0x17b)]+'\x27'),_0x2f5793!==_0x515dbf&&console[_0x5c8484(0x169)](_0x5c8484(0x185)+_0x2f5793),await handleSDKOutput([_0x89a624],_0x3ac0ea),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x12e949=a42_0xf5da;(function(_0x7a91ae,_0xba2ff6){const _0x378ca1=a42_0xf5da,_0x1c70f3=_0x7a91ae();while(!![]){try{const _0x29610d=parseInt(_0x378ca1(0x105))/0x1*(-parseInt(_0x378ca1(0x11d))/0x2)+-parseInt(_0x378ca1(0xf4))/0x3*(-parseInt(_0x378ca1(0x116))/0x4)+parseInt(_0x378ca1(0x10a))/0x5*(-parseInt(_0x378ca1(0x122))/0x6)+parseInt(_0x378ca1(0x104))/0x7+-parseInt(_0x378ca1(0x100))/0x8+parseInt(_0x378ca1(0xec))/0x9+parseInt(_0x378ca1(0x109))/0xa;if(_0x29610d===_0xba2ff6)break;else _0x1c70f3['push'](_0x1c70f3['shift']());}catch(_0x2ea0e3){_0x1c70f3['push'](_0x1c70f3['shift']());}}}(a42_0x5abb,0xeaf26));import{existsSync,statSync}from'fs';import a42_0x468baf from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a42_0x5abb(){const _0x2cf400=['94ZpUQyo','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','log','description','parentId','6PeIuYd','Resolving\x20path\x20\x27','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','3089691QzSqgi','✔\x20Context\x20set\x20to:\x20','\x27...','fullPath','green','isDirectory','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Parent\x20ID:\x20','1698906FTQNkN','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','red','dim','parentName','split','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','execute','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','segments','slice','segment','13695392gwpjiW','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','error','join','11710062rILhgu','2567fpUIis','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','folderId','verbose','408100xtnXkw','1973320ECPRGD','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Usage:\x20tdx\x20segment\x20use\x20<path>','name','resolvePathToResource','Site:\x20','isAbsolute','segment:use','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Examples:','data','8pwipst','Error:\x20Path\x20is\x20required\x0a','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','config','cyan','segmentPath','folderPath'];a42_0x5abb=function(){return _0x2cf400;};return a42_0x5abb();}function a42_0xf5da(_0xf145f7,_0x46b17a){_0xf145f7=_0xf145f7-0xec;const _0x5abb82=a42_0x5abb();let _0xf5da30=_0x5abb82[_0xf145f7];return _0xf5da30;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a42_0x12e949(0x10e)]=a42_0x12e949(0x112);[a42_0x12e949(0x120)]=a42_0x12e949(0x118);async[a42_0x12e949(0xfb)](_0x38125f){const _0x121290=a42_0x12e949,{options:_0x4f4cbf,args:_0x57fe46,tdx:_0x5d6899}=_0x38125f;if(_0x57fe46['length']===0x0)return console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf6)](_0x121290(0x117))),console[_0x121290(0x102)](_0x121290(0x10d)),console['error'](_0x121290(0x114)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error'](_0x121290(0xf5)),console['error'](_0x121290(0xf2)),console[_0x121290(0x102)](_0x121290(0x113)),0x1;const _0x4b73fb=_0x57fe46[0x0],_0x5b2482=_0x4f4cbf['session'];try{if(_0x4b73fb==='/')return saveSessionContext({'segment_path':undefined},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)](_0x121290(0x101))),0x0;if(existsSync(_0x4b73fb)&&statSync(_0x4b73fb)[_0x121290(0xf1)]()){let _0x1dca80;try{_0x1dca80=findTdxConfig(_0x4b73fb);}catch{return console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf6)](_0x121290(0xfc)+_0x4b73fb)),console[_0x121290(0x102)](a42_0x468baf[_0x121290(0x11a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x1bbe6b=_0x1dca80[_0x121290(0x119)]['parent_segment'];return saveSessionContext({'segment_path':_0x1bbe6b,'parent_segment':_0x1bbe6b},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)](_0x121290(0xed)+a42_0x468baf[_0x121290(0x11a)](_0x1bbe6b))),0x0;}const _0x549155=_0x4f4cbf[_0x121290(0x11b)];let _0x2055e2=_0x4b73fb;const _0x156e46=parsePath(_0x4b73fb);if(!_0x156e46[_0x121290(0x111)]){if(!_0x549155)return console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf6)](_0x121290(0xfa))),console['error'](a42_0x468baf[_0x121290(0x11a)](_0x121290(0x106))),0x1;if(_0x4b73fb==='..'){const _0x1284dc=_0x549155[_0x121290(0xf9)]('/')[_0x121290(0xfe)](0x0,-0x1)[_0x121290(0x103)]('/');_0x2055e2=_0x1284dc||'/';}else _0x4b73fb==='.'?_0x2055e2=_0x549155:_0x2055e2=_0x549155+'/'+_0x4b73fb;_0x4f4cbf['verbose']&&console[_0x121290(0x102)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2055e2);}if(_0x2055e2==='/'||_0x2055e2==='')return saveSessionContext({'segment_path':undefined},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x2055e2=normalizePath(_0x2055e2);const _0x53be2f=parsePath(_0x2055e2)[_0x121290(0xfd)];if(_0x53be2f['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)](_0x121290(0x101))),0x0;_0x4f4cbf[_0x121290(0x108)]&&(console[_0x121290(0x102)](_0x121290(0x110)+_0x4f4cbf['site']),console[_0x121290(0x102)]('Target\x20path:\x20'+_0x2055e2));const _0x1e5551=await withSpinner(_0x121290(0x123)+_0x2055e2+_0x121290(0xee),()=>_0x5d6899[_0x121290(0xff)][_0x121290(0x10f)](_0x2055e2),{'verbose':_0x4f4cbf[_0x121290(0x108)]}),_0x163f08=_0x1e5551[_0x121290(0x115)];_0x4f4cbf[_0x121290(0x108)]&&(console[_0x121290(0x102)]('Resolved\x20path\x20type:\x20'+_0x163f08['type']),console[_0x121290(0x102)](_0x121290(0xf3)+_0x163f08[_0x121290(0x121)]),_0x163f08[_0x121290(0x107)]&&console[_0x121290(0x102)]('Folder\x20ID:\x20'+_0x163f08[_0x121290(0x107)]));if(_0x163f08['type']===_0x121290(0xff))return console[_0x121290(0x102)](a42_0x468baf['red'](_0x121290(0x10b))),console[_0x121290(0x102)](_0x121290(0x10c)),console[_0x121290(0x102)](a42_0x468baf['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x163f08[_0x121290(0xf8)]+(_0x163f08[_0x121290(0x11c)]?'/'+_0x163f08[_0x121290(0x11c)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x163f08[_0x121290(0xef)],'parent_segment':_0x163f08[_0x121290(0xf8)]},_0x5b2482),console['log'](a42_0x468baf[_0x121290(0xf0)](_0x121290(0xed)+a42_0x468baf[_0x121290(0x11a)](_0x163f08[_0x121290(0xef)]))),_0x4f4cbf['verbose']&&(console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf7)](_0x121290(0x124))),console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf7)](_0x121290(0x11e)))),0x0;}catch(_0x18ffc6){throw _0x18ffc6;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0xf43d81=a43_0xdbf6;(function(_0x12c131,_0x4df28d){const _0x392852=a43_0xdbf6,_0x5c7a35=_0x12c131();while(!![]){try{const _0x24ba10=parseInt(_0x392852(0xc3))/0x1+parseInt(_0x392852(0xd4))/0x2*(-parseInt(_0x392852(0xc6))/0x3)+-parseInt(_0x392852(0xe1))/0x4*(-parseInt(_0x392852(0xdd))/0x5)+parseInt(_0x392852(0xbd))/0x6+parseInt(_0x392852(0xcc))/0x7*(-parseInt(_0x392852(0xba))/0x8)+parseInt(_0x392852(0xcb))/0x9*(parseInt(_0x392852(0xd8))/0xa)+-parseInt(_0x392852(0xe0))/0xb;if(_0x24ba10===_0x4df28d)break;else _0x5c7a35['push'](_0x5c7a35['shift']());}catch(_0x1da512){_0x5c7a35['push'](_0x5c7a35['shift']());}}}(a43_0x5b91,0x3c865));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a43_0x5b91(){const _0x210a2f=['warningCount','endsWith','\x20warning(s)\x20found','5142qYrHsb','validCount','log','red','21670XPnzqi','warnings','green','\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','\x20file(s)\x20with\x20errors,\x20','1704155bZWHZd','message','name','1012957VmffJE','4GrouAx','.yml','filePath','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error:\x20','error','\x20warning(s)','1240arGXCt','dim','yellow','935574GZIGRs','targetDir','):\x20','segment:validate','execute','verbose','210553pvbKup','file','invalidCount','123vTZNng','valid','helpText','\x20valid','description','333nSmuez','15449ubVnWC','Validate\x20segment\x20and\x20journey\x20YAML\x20files','no_parent','length','hasErrors'];a43_0x5b91=function(){return _0x210a2f;};return a43_0x5b91();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a43_0x108e2c from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a43_0xdbf6(_0x308879,_0x1a709a){_0x308879=_0x308879-0xba;const _0x5b91c3=a43_0x5b91();let _0xdbf64a=_0x5b91c3[_0x308879];return _0xdbf64a;}export class SegmentValidateCommand extends BaseCommand{[a43_0xf43d81(0xdf)]=a43_0xf43d81(0xc0);[a43_0xf43d81(0xca)]=a43_0xf43d81(0xcd);async[a43_0xf43d81(0xc1)](_0x7a5a32){const _0x1cedd2=a43_0xf43d81,{options:_0x417142,args:_0x50283d}=_0x7a5a32,_0x1f302e=_0x417142,_0x46cde0=await resolveTarget({'arg':_0x50283d[0x0],'contextParent':_0x417142['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x46cde0))return _0x46cde0['errorCode']===_0x1cedd2(0xce)?(console[_0x1cedd2(0xe6)](a43_0x108e2c['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x1cedd2(0xe6)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console['error'](_0x1cedd2(0xdb)),console[_0x1cedd2(0xe6)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x1cedd2(0xe6)](a43_0x108e2c[_0x1cedd2(0xd7)](_0x1cedd2(0xe5)+_0x46cde0[_0x1cedd2(0xde)]+'\x0a')),_0x46cde0[_0x1cedd2(0xc8)]&&console[_0x1cedd2(0xe6)](a43_0x108e2c['cyan'](_0x46cde0[_0x1cedd2(0xc8)]))),0x1;const _0x40de88=_0x46cde0[_0x1cedd2(0xbe)],_0x48465d=_0x46cde0['type']===_0x1cedd2(0xc4)?_0x46cde0[_0x1cedd2(0xe3)]:undefined;if(!_0x48465d&&!existsSync(_0x40de88))return console['error'](a43_0x108e2c[_0x1cedd2(0xd7)]('Error:\x20Directory\x20not\x20found:\x20'+_0x40de88+'\x0a')),0x1;let _0xef8d08;if(_0x48465d){if(!_0x48465d[_0x1cedd2(0xd2)](_0x1cedd2(0xe2))&&!_0x48465d[_0x1cedd2(0xd2)]('.yaml'))return console[_0x1cedd2(0xe6)](a43_0x108e2c[_0x1cedd2(0xd7)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x48465d+'\x0a')),0x1;_0xef8d08=[_0x48465d];}else _0xef8d08=findYamlFiles(_0x40de88);if(_0xef8d08[_0x1cedd2(0xcf)]===0x0)return console[_0x1cedd2(0xe6)](a43_0x108e2c['red'](_0x1cedd2(0xe4)+_0x40de88+'\x0a')),0x1;const _0x45d31f=validateYamlFiles(_0xef8d08,_0x40de88),_0x222f38=calculateSummary(_0x45d31f);for(const _0x5b5d61 of _0x45d31f){if(!isValidationResult(_0x5b5d61))continue;const {relativePath:_0x9fe6da,source:_0x45ac19,result:_0x4f86ff,fileType:_0x1f68c9}=_0x5b5d61,_0x1a38eb=_0x1f68c9;if(_0x4f86ff[_0x1cedd2(0xc7)]&&_0x4f86ff[_0x1cedd2(0xd9)][_0x1cedd2(0xcf)]===0x0)_0x1f302e[_0x1cedd2(0xc2)]&&console['log'](a43_0x108e2c[_0x1cedd2(0xda)]('✔\x20'+_0x9fe6da)+a43_0x108e2c[_0x1cedd2(0xbb)]('\x20('+_0x1a38eb+')'));else _0x4f86ff['valid']?(console[_0x1cedd2(0xd6)](a43_0x108e2c['yellow']('⚠\x20'+_0x9fe6da)+a43_0x108e2c[_0x1cedd2(0xbb)]('\x20('+_0x1a38eb+'):\x20'+_0x4f86ff[_0x1cedd2(0xd9)][_0x1cedd2(0xcf)]+_0x1cedd2(0xe7))),console[_0x1cedd2(0xd6)](formatValidationResult(_0x4f86ff,_0x45ac19,_0x9fe6da))):(console[_0x1cedd2(0xd6)](a43_0x108e2c[_0x1cedd2(0xd7)]('✖\x20'+_0x9fe6da)+a43_0x108e2c[_0x1cedd2(0xbb)]('\x20('+_0x1a38eb+_0x1cedd2(0xbf)+_0x4f86ff['errors'][_0x1cedd2(0xcf)]+'\x20error(s)')),console['log'](formatValidationResult(_0x4f86ff,_0x45ac19,_0x9fe6da)));}return console[_0x1cedd2(0xd6)](''),_0x222f38[_0x1cedd2(0xd0)]?(console['log'](a43_0x108e2c[_0x1cedd2(0xd7)]('Validation\x20failed:\x20'+_0x222f38[_0x1cedd2(0xc5)]+_0x1cedd2(0xdc)+_0x222f38['validCount']+_0x1cedd2(0xc9))),_0x222f38['warningCount']>0x0&&console[_0x1cedd2(0xd6)](a43_0x108e2c[_0x1cedd2(0xbc)](_0x222f38['warningCount']+'\x20warning(s)\x20found')),0x1):(console[_0x1cedd2(0xd6)](a43_0x108e2c['green']('✔\x20All\x20'+_0x222f38[_0x1cedd2(0xd5)]+'\x20file(s)\x20valid')),_0x222f38[_0x1cedd2(0xd1)]>0x0&&console[_0x1cedd2(0xd6)](a43_0x108e2c[_0x1cedd2(0xbc)](_0x222f38[_0x1cedd2(0xd1)]+_0x1cedd2(0xd3))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a44_0x233c5b=a44_0x4ebf;(function(_0x28af77,_0x4cb372){const _0x45196d=a44_0x4ebf,_0x5a65a6=_0x28af77();while(!![]){try{const _0x5bec08=-parseInt(_0x45196d(0x12c))/0x1+-parseInt(_0x45196d(0x123))/0x2+parseInt(_0x45196d(0x15b))/0x3*(-parseInt(_0x45196d(0x13b))/0x4)+-parseInt(_0x45196d(0x14b))/0x5*(parseInt(_0x45196d(0x168))/0x6)+-parseInt(_0x45196d(0x165))/0x7+parseInt(_0x45196d(0x158))/0x8*(parseInt(_0x45196d(0x14d))/0x9)+-parseInt(_0x45196d(0x127))/0xa*(-parseInt(_0x45196d(0x169))/0xb);if(_0x5bec08===_0x4cb372)break;else _0x5a65a6['push'](_0x5a65a6['shift']());}catch(_0x501dd2){_0x5a65a6['push'](_0x5a65a6['shift']());}}}(a44_0x34b2,0x93640));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0x4ebf(_0x5e6401,_0x538c87){_0x5e6401=_0x5e6401-0x120;const _0x34b2dc=a44_0x34b2();let _0x4ebf2a=_0x34b2dc[_0x5e6401];return _0x4ebf2a;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a44_0x4bbc06 from'chalk';export class SegmentsCommand extends BaseCommand{[a44_0x233c5b(0x142)]='segments';[a44_0x233c5b(0x129)]='List\x20folders\x20and\x20child\x20segments';async[a44_0x233c5b(0x155)](_0x3a9761){const _0x5586c5=a44_0x233c5b,{options:_0x4c0f7a,args:_0x2340bf}=_0x3a9761,_0x2c72e6=_0x4c0f7a[_0x5586c5(0x12b)],_0x33a565=_0x2340bf[0x0];try{const _0x4ccc36=_0x4c0f7a['parentSegment'];_0x4c0f7a[_0x5586c5(0x162)]&&(console['error'](_0x5586c5(0x154)+_0x4c0f7a[_0x5586c5(0x149)]),console[_0x5586c5(0x15d)]('Parent\x20segment\x20context:\x20'+(_0x4ccc36||'(not\x20set)')),_0x33a565&&console['error'](_0x5586c5(0x157)+_0x33a565),_0x2c72e6&&console[_0x5586c5(0x15d)]('Recursive\x20mode:\x20enabled'));if(!_0x4ccc36)return console[_0x5586c5(0x15d)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x5586c5(0x15d)](_0x5586c5(0x133)),console[_0x5586c5(0x15d)](_0x5586c5(0x14c)),console[_0x5586c5(0x15d)](_0x5586c5(0x148)),console[_0x5586c5(0x15d)](''),console[_0x5586c5(0x15d)](_0x5586c5(0x156)),0x1;const _0x3a4750=_0x33a565&&(_0x33a565['includes']('*')||_0x33a565[_0x5586c5(0x126)]('?'));if(_0x3a4750)return await this['listWithPattern'](_0x3a9761,_0x4ccc36,_0x33a565);const _0x53a07b=_0x33a565?_0x4ccc36+'/'+_0x33a565:_0x4ccc36;return _0x2c72e6?await this['listRecursive'](_0x3a9761,_0x53a07b):await this[_0x5586c5(0x137)](_0x3a9761,_0x53a07b);}catch(_0x35dfb9){if(_0x35dfb9 instanceof SDKError)return console[_0x5586c5(0x15d)](_0x5586c5(0x163)+_0x35dfb9[_0x5586c5(0x145)]),_0x35dfb9[_0x5586c5(0x141)]&&console['error'](_0x5586c5(0x132)+_0x35dfb9[_0x5586c5(0x141)]),0x1;throw _0x35dfb9;}}async[a44_0x233c5b(0x159)](_0x1f7b82,_0x4fba4f,_0x1b703b){const _0x4df989=a44_0x233c5b,{options:_0x28328f,tdx:_0x2693a7}=_0x1f7b82,_0x2b4a0e=await withSpinner(_0x4df989(0x161)+_0x4fba4f+_0x4df989(0x12f),()=>_0x2693a7[_0x4df989(0x15f)][_0x4df989(0x13a)](_0x4fba4f),{'verbose':_0x28328f[_0x4df989(0x162)]}),_0xee706c=_0x2b4a0e[_0x4df989(0x15e)],_0x40c6d6=await withSpinner(_0x4df989(0x120),()=>_0x2693a7[_0x4df989(0x15f)][_0x4df989(0x139)](_0xee706c['parentId'],_0xee706c[_0x4df989(0x135)]),{'verbose':_0x28328f[_0x4df989(0x162)]}),{folders:_0x44890c,segments:_0x98b871,journeys:_0x530c64}=_0x40c6d6[_0x4df989(0x15e)],_0xbe2a3c=_0x1b703b[_0x4df989(0x138)](/[.+^${}()|[\]\\]/g,_0x4df989(0x151))[_0x4df989(0x138)](/\*/g,'.*')[_0x4df989(0x138)](/\?/g,'.'),_0x5a053c=new RegExp('^'+_0xbe2a3c+'$','i'),_0x35a7b0=_0x44890c[_0x4df989(0x140)](_0x3f84a1=>_0x5a053c[_0x4df989(0x15c)](_0x3f84a1[_0x4df989(0x142)])),_0x4f8a7a=_0x98b871[_0x4df989(0x140)](_0x4963ec=>_0x5a053c[_0x4df989(0x15c)](_0x4963ec[_0x4df989(0x142)])),_0x126db9=_0x530c64['filter'](_0x4d51db=>_0x5a053c['test'](_0x4d51db['journeyBundleName'])),_0x535386=_0x35a7b0[_0x4df989(0x167)]+_0x4f8a7a[_0x4df989(0x167)]+_0x126db9[_0x4df989(0x167)];console[_0x4df989(0x15d)]('✔\x20Found\x20'+_0x35a7b0['length']+'\x20folder'+(_0x35a7b0[_0x4df989(0x167)]!==0x1?'s':'')+',\x20'+_0x4f8a7a[_0x4df989(0x167)]+_0x4df989(0x147)+(_0x4f8a7a['length']!==0x1?'s':'')+_0x4df989(0x13f)+_0x126db9[_0x4df989(0x167)]+'\x20journey'+(_0x126db9[_0x4df989(0x167)]!==0x1?'s':'')+_0x4df989(0x14a)+_0x1b703b+'\x27');const _0x2de61c=_0x2539f4=>{const _0x3af36b=_0x4df989;return getConsoleNextUrl(_0x28328f[_0x3af36b(0x149)],_0x3af36b(0x12a)+_0xee706c[_0x3af36b(0x134)]+_0x3af36b(0x124)+_0x2539f4);},_0x29e332=_0x28328f['format']===_0x4df989(0x146)||_0x28328f[_0x4df989(0x121)]===_0x4df989(0x153);if(_0x29e332){const _0x4db901=[..._0x35a7b0[_0x4df989(0x14f)](_0x3bb47a=>({..._0x3bb47a,'type':_0x4df989(0x136)})),..._0x4f8a7a[_0x4df989(0x14f)](_0x11151f=>({..._0x11151f,'type':_0x4df989(0x15f),'url':_0x2de61c(_0x11151f['id'])})),..._0x126db9['map'](_0x12a89c=>({..._0x12a89c,'name':_0x12a89c['journeyBundleName'],'type':'journey'}))]['sort']((_0x1d4136,_0x5aba7d)=>_0x1d4136['name'][_0x4df989(0x130)](_0x5aba7d[_0x4df989(0x142)]));await handleSDKOutput(_0x4db901,_0x28328f);}else{if(_0x535386===0x0)console[_0x4df989(0x13e)](_0x4df989(0x125)+_0x1b703b);else{console['log'](a44_0x4bbc06[_0x4df989(0x152)]('['+_0x4fba4f+']\x20matching\x20\x27'+_0x1b703b+'\x27'));const _0x4775a7=formatFlatList(_0x35a7b0,_0x4f8a7a,{'showMetadata':!![],'getSegmentUrl':_0x2de61c},_0x126db9);console[_0x4df989(0x13e)](_0x4775a7);}}return 0x0;}async[a44_0x233c5b(0x137)](_0x5dc058,_0xbaa1cb){const _0x841b5f=a44_0x233c5b,{options:_0x2692d0,tdx:_0x2906a1}=_0x5dc058,_0x40c123=await withSpinner(_0x841b5f(0x150)+_0xbaa1cb+_0x841b5f(0x12f),()=>_0x2906a1['segment'][_0x841b5f(0x13a)](_0xbaa1cb),{'verbose':_0x2692d0[_0x841b5f(0x162)]}),_0x2a9b3b=_0x40c123[_0x841b5f(0x15e)];_0x2692d0[_0x841b5f(0x162)]&&(console[_0x841b5f(0x15d)]('Parent\x20ID:\x20'+_0x2a9b3b[_0x841b5f(0x134)]),_0x2a9b3b[_0x841b5f(0x135)]&&console[_0x841b5f(0x15d)](_0x841b5f(0x12e)+_0x2a9b3b[_0x841b5f(0x135)]));const _0xc58971=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x2906a1[_0x841b5f(0x15f)][_0x841b5f(0x139)](_0x2a9b3b[_0x841b5f(0x134)],_0x2a9b3b[_0x841b5f(0x135)]),{'verbose':_0x2692d0[_0x841b5f(0x162)]}),{folders:_0x44fbc5,segments:_0x1fa32f,journeys:_0x5a7a73}=_0xc58971[_0x841b5f(0x15e)],_0x44b4ba=_0x44fbc5[_0x841b5f(0x167)]+_0x1fa32f['length']+_0x5a7a73[_0x841b5f(0x167)];console[_0x841b5f(0x15d)]('✔\x20Found\x20'+_0x44fbc5[_0x841b5f(0x167)]+_0x841b5f(0x160)+(_0x44fbc5[_0x841b5f(0x167)]!==0x1?'s':'')+',\x20'+_0x1fa32f[_0x841b5f(0x167)]+'\x20segment'+(_0x1fa32f[_0x841b5f(0x167)]!==0x1?'s':'')+_0x841b5f(0x13f)+_0x5a7a73[_0x841b5f(0x167)]+_0x841b5f(0x128)+(_0x5a7a73['length']!==0x1?'s':''));const _0x2731e4=_0xe0ebbc=>{const _0x19c1f6=_0x841b5f;return getConsoleNextUrl(_0x2692d0['site'],_0x19c1f6(0x12a)+_0x2a9b3b['parentId']+_0x19c1f6(0x124)+_0xe0ebbc);},_0x5033e=_0x220b88=>{const _0x3703aa=_0x841b5f;return getConsoleNextUrl(_0x2692d0[_0x3703aa(0x149)],_0x3703aa(0x12a)+_0x2a9b3b['parentId']+_0x3703aa(0x124)+_0x220b88+_0x3703aa(0x143));},_0x4c68b0=_0x2692d0[_0x841b5f(0x121)]===_0x841b5f(0x146)||_0x2692d0[_0x841b5f(0x121)]===_0x841b5f(0x153);if(_0x4c68b0){const _0x587df7=[..._0x44fbc5['map'](_0x4a0352=>({..._0x4a0352,'type':_0x841b5f(0x136)})),..._0x1fa32f[_0x841b5f(0x14f)](_0x3c734=>({..._0x3c734,'type':'segment','url':_0x2731e4(_0x3c734['id'])})),..._0x5a7a73['map'](_0x98436f=>({..._0x98436f,'name':_0x98436f['journeyBundleName'],'type':_0x841b5f(0x13d),'url':_0x5033e(_0x98436f['id'])}))]['sort']((_0x485022,_0x2cb531)=>_0x485022[_0x841b5f(0x142)][_0x841b5f(0x130)](_0x2cb531[_0x841b5f(0x142)]));await handleSDKOutput(_0x587df7,_0x2692d0);}else{if(_0x44b4ba===0x0)console[_0x841b5f(0x13e)](a44_0x4bbc06[_0x841b5f(0x152)]('['+_0xbaa1cb+']')),console[_0x841b5f(0x13e)](_0x841b5f(0x16a));else{console[_0x841b5f(0x13e)](a44_0x4bbc06[_0x841b5f(0x152)]('['+_0xbaa1cb+']'));const _0xe3bea6=formatFlatList(_0x44fbc5,_0x1fa32f,{'showMetadata':!![],'getSegmentUrl':_0x2731e4,'getJourneyUrl':_0x5033e},_0x5a7a73);console[_0x841b5f(0x13e)](_0xe3bea6);}}return 0x0;}async[a44_0x233c5b(0x131)](_0x309bb0,_0x3af9e2){const _0x118c98=a44_0x233c5b,{options:_0x5a3929,tdx:_0x2368d9}=_0x309bb0,_0xa576b6=await withSpinner('Resolving\x20path\x20\x27'+_0x3af9e2+_0x118c98(0x12f),()=>_0x2368d9[_0x118c98(0x15f)]['resolvePathToResource'](_0x3af9e2),{'verbose':_0x5a3929[_0x118c98(0x162)]}),_0x328ac5=_0xa576b6[_0x118c98(0x15e)];_0x5a3929['verbose']&&(console[_0x118c98(0x15d)](_0x118c98(0x122)+_0x328ac5[_0x118c98(0x134)]),_0x328ac5[_0x118c98(0x135)]&&console[_0x118c98(0x15d)](_0x118c98(0x12e)+_0x328ac5[_0x118c98(0x135)]));const _0x3dd486=_0x5a3929[_0x118c98(0x15a)]||0xa,_0x1be34a=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x2368d9[_0x118c98(0x15f)][_0x118c98(0x131)](_0x328ac5[_0x118c98(0x134)],_0x328ac5['folderId'],0x0,_0x3dd486),{'verbose':_0x5a3929['verbose']}),_0x48e74e=_0x1be34a[_0x118c98(0x15e)],_0x3b233b=_0x83bd05=>{const _0x7b08b5=_0x118c98;let _0x1bca2b=0x0,_0x5f5050=0x0,_0x2e7ddc=0x0;for(const _0x42fbea of _0x83bd05){if(_0x42fbea[_0x7b08b5(0x12d)]===_0x7b08b5(0x136))_0x1bca2b++;else{if(_0x42fbea[_0x7b08b5(0x12d)]==='segment')_0x5f5050++;else{if(_0x42fbea[_0x7b08b5(0x12d)]===_0x7b08b5(0x13d))_0x2e7ddc++;}}if(_0x42fbea[_0x7b08b5(0x166)]){const _0x3e134c=_0x3b233b(_0x42fbea[_0x7b08b5(0x166)]);_0x1bca2b+=_0x3e134c[_0x7b08b5(0x164)],_0x5f5050+=_0x3e134c[_0x7b08b5(0x13c)],_0x2e7ddc+=_0x3e134c['journeys'];}}return{'folders':_0x1bca2b,'segments':_0x5f5050,'journeys':_0x2e7ddc};},_0x83a309=_0x3b233b(_0x48e74e);console[_0x118c98(0x15d)](_0x118c98(0x144)+_0x83a309['folders']+_0x118c98(0x160)+(_0x83a309[_0x118c98(0x164)]!==0x1?'s':'')+',\x20'+_0x83a309[_0x118c98(0x13c)]+_0x118c98(0x147)+(_0x83a309[_0x118c98(0x13c)]!==0x1?'s':'')+_0x118c98(0x13f)+_0x83a309[_0x118c98(0x14e)]+_0x118c98(0x128)+(_0x83a309[_0x118c98(0x14e)]!==0x1?'s':''));const _0x312cd5=_0x2b4a27=>{const _0x16bde8=_0x118c98;return getConsoleNextUrl(_0x5a3929['site'],_0x16bde8(0x12a)+_0x328ac5[_0x16bde8(0x134)]+_0x16bde8(0x124)+_0x2b4a27);},_0x5d2032=_0x15b818=>{const _0x229492=_0x118c98;return getConsoleNextUrl(_0x5a3929['site'],_0x229492(0x12a)+_0x328ac5['parentId']+_0x229492(0x124)+_0x15b818+_0x229492(0x143));};if(_0x5a3929[_0x118c98(0x121)]===_0x118c98(0x146)||_0x5a3929[_0x118c98(0x121)]===_0x118c98(0x153))await handleSDKOutput(_0x48e74e,_0x5a3929);else{console[_0x118c98(0x13e)](a44_0x4bbc06[_0x118c98(0x152)]('['+_0x3af9e2+']'));const _0xc512d3=formatTree(_0x48e74e,{'showMetadata':!![],'getSegmentUrl':_0x312cd5,'getJourneyUrl':_0x5d2032});console['log'](_0xc512d3);}return 0x0;}}function a44_0x34b2(){const _0x29f810=['site','\x20matching\x20\x27','44430BxYWTV','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','1962693kTuaXk','journeys','map','Resolving\x20path\x20\x27','\x5c$&','dim','jsonl','Site:\x20','execute','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Folder/pattern\x20arg:\x20','8jHQLgG','listWithPattern','maxDepth','597aCewkF','test','error','data','segment','\x20folder','Resolving\x20parent\x20segment\x20\x27','verbose','Error:\x20','folders','2265039ijUoiL','children','length','30hLtPAG','1110153UnLdel','(empty)','Listing\x20folders,\x20segments,\x20and\x20journeys...','format','Parent\x20ID:\x20','744416xgEJYa','/e/','No\x20items\x20match\x20pattern:\x20','includes','210PYnDtU','\x20journey','description','/app/ps/','recursive','303202UYDHYX','type','Folder\x20ID:\x20','\x27...','localeCompare','listRecursive','\x20\x20Cause:\x20','Set\x20a\x20parent\x20segment\x20context\x20first:','parentId','folderId','folder','listUnified','replace','listUnifiedWithJourneys','resolvePathToResource','13876ahJRuv','segments','journey','log',',\x20and\x20','filter','cause','name','/j/da','✔\x20Built\x20tree\x20with\x20','message','json','\x20segment','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'];a44_0x34b2=function(){return _0x29f810;};return a44_0x34b2();}
|
|
1
|
+
function a44_0x3292(){const _0x28271f=['/e/','92olDVHo','listRecursive','\x5c$&','List\x20folders\x20and\x20child\x20segments','Folder\x20ID:\x20','name','\x27...','length','replace','5071392zkHYQb','96OtpptY','filter','Parent\x20segment\x20context:\x20','Parent\x20ID:\x20','log','test','journeys','✔\x20Built\x20tree\x20with\x20','\x20segment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','localeCompare','Resolving\x20parent\x20segment\x20\x27','14199rfiGgN','No\x20items\x20match\x20pattern:\x20','17085695EdNJuv','folderId','verbose',']\x20matching\x20\x27','Building\x20hierarchy\x20tree...','Recursive\x20mode:\x20enabled','listUnified','86832RjlGGa','format','17460hZJCWi','\x20\x20Cause:\x20','jsonl','\x20matching\x20\x27','Resolving\x20path\x20\x27','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x20journey','Folder/pattern\x20arg:\x20','includes','1746fkmTrk','(not\x20set)','/j/da','segments','/app/ps/','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20folder','site','parentId','execute','listWithPattern','folder','type','journey','sort','children','88vPWYoN','error','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Set\x20a\x20parent\x20segment\x20context\x20first:','folders','json','Error:\x20No\x20parent\x20segment\x20context\x20set.','map','journeyBundleName','651745mprIHL','260316SEWLFU','cause','recursive','resolvePathToResource','segment','data','dim'];a44_0x3292=function(){return _0x28271f;};return a44_0x3292();}const a44_0x3f2396=a44_0x4041;(function(_0x5a0c63,_0x17aaeb){const _0x9828dc=a44_0x4041,_0x1ccee9=_0x5a0c63();while(!![]){try{const _0x6daad0=parseInt(_0x9828dc(0x17e))/0x1*(-parseInt(_0x9828dc(0x168))/0x2)+parseInt(_0x9828dc(0x187))/0x3*(-parseInt(_0x9828dc(0x1a2))/0x4)+-parseInt(_0x9828dc(0x1ab))/0x5+-parseInt(_0x9828dc(0x172))/0x6*(-parseInt(_0x9828dc(0x1ac))/0x7)+-parseInt(_0x9828dc(0x171))/0x8+-parseInt(_0x9828dc(0x192))/0x9*(-parseInt(_0x9828dc(0x189))/0xa)+parseInt(_0x9828dc(0x180))/0xb;if(_0x6daad0===_0x17aaeb)break;else _0x1ccee9['push'](_0x1ccee9['shift']());}catch(_0x1114d1){_0x1ccee9['push'](_0x1ccee9['shift']());}}}(a44_0x3292,0x69a8e));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a44_0x4041(_0x556faf,_0x12f569){_0x556faf=_0x556faf-0x168;const _0x32923c=a44_0x3292();let _0x4041f4=_0x32923c[_0x556faf];return _0x4041f4;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a44_0x3c23d3 from'chalk';export class SegmentsCommand extends BaseCommand{[a44_0x3f2396(0x16d)]=a44_0x3f2396(0x195);['description']=a44_0x3f2396(0x16b);async[a44_0x3f2396(0x19b)](_0x5cd846){const _0x3b3585=a44_0x3f2396,{options:_0x26e8c7,args:_0x300643}=_0x5cd846,_0x490432=_0x26e8c7[_0x3b3585(0x1ae)],_0x3f7617=_0x300643[0x0];try{const _0xaf745f=_0x26e8c7['parentSegment'];_0x26e8c7[_0x3b3585(0x182)]&&(console[_0x3b3585(0x1a3)]('Site:\x20'+_0x26e8c7[_0x3b3585(0x199)]),console[_0x3b3585(0x1a3)](_0x3b3585(0x174)+(_0xaf745f||_0x3b3585(0x193))),_0x3f7617&&console[_0x3b3585(0x1a3)](_0x3b3585(0x190)+_0x3f7617),_0x490432&&console[_0x3b3585(0x1a3)](_0x3b3585(0x185)));if(!_0xaf745f)return console[_0x3b3585(0x1a3)](_0x3b3585(0x1a8)),console['error'](''),console[_0x3b3585(0x1a3)](_0x3b3585(0x1a5)),console[_0x3b3585(0x1a3)](_0x3b3585(0x17b)),console[_0x3b3585(0x1a3)](_0x3b3585(0x18e)),console[_0x3b3585(0x1a3)](''),console['error'](_0x3b3585(0x1a4)),0x1;const _0x2acd99=_0x3f7617&&(_0x3f7617[_0x3b3585(0x191)]('*')||_0x3f7617['includes']('?'));if(_0x2acd99)return await this['listWithPattern'](_0x5cd846,_0xaf745f,_0x3f7617);const _0x2d01e5=_0x3f7617?_0xaf745f+'/'+_0x3f7617:_0xaf745f;return _0x490432?await this['listRecursive'](_0x5cd846,_0x2d01e5):await this[_0x3b3585(0x186)](_0x5cd846,_0x2d01e5);}catch(_0x1511e9){if(_0x1511e9 instanceof SDKError)return console[_0x3b3585(0x1a3)]('Error:\x20'+_0x1511e9['message']),_0x1511e9[_0x3b3585(0x1ad)]&&console[_0x3b3585(0x1a3)](_0x3b3585(0x18a)+_0x1511e9['cause']),0x1;throw _0x1511e9;}}async[a44_0x3f2396(0x19c)](_0x5ae6be,_0x625d49,_0x285489){const _0x492125=a44_0x3f2396,{options:_0x325df3,tdx:_0x2a4b0e}=_0x5ae6be,_0x418328=await withSpinner(_0x492125(0x17d)+_0x625d49+'\x27...',()=>_0x2a4b0e[_0x492125(0x1b0)][_0x492125(0x1af)](_0x625d49),{'verbose':_0x325df3[_0x492125(0x182)]}),_0x368a47=_0x418328['data'],_0x98bae1=await withSpinner(_0x492125(0x197),()=>_0x2a4b0e[_0x492125(0x1b0)]['listUnifiedWithJourneys'](_0x368a47[_0x492125(0x19a)],_0x368a47[_0x492125(0x181)]),{'verbose':_0x325df3[_0x492125(0x182)]}),{folders:_0x47edd0,segments:_0x1a0118,journeys:_0xa2a398}=_0x98bae1[_0x492125(0x1b1)],_0x5c2286=_0x285489['replace'](/[.+^${}()|[\]\\]/g,_0x492125(0x16a))[_0x492125(0x170)](/\*/g,'.*')[_0x492125(0x170)](/\?/g,'.'),_0x3b1823=new RegExp('^'+_0x5c2286+'$','i'),_0x451062=_0x47edd0[_0x492125(0x173)](_0x264f77=>_0x3b1823[_0x492125(0x177)](_0x264f77[_0x492125(0x16d)])),_0x4f909f=_0x1a0118[_0x492125(0x173)](_0x1bbcde=>_0x3b1823[_0x492125(0x177)](_0x1bbcde[_0x492125(0x16d)])),_0x4fe20f=_0xa2a398[_0x492125(0x173)](_0x12d07c=>_0x3b1823[_0x492125(0x177)](_0x12d07c[_0x492125(0x1aa)])),_0x4d14f6=_0x451062[_0x492125(0x16f)]+_0x4f909f[_0x492125(0x16f)]+_0x4fe20f[_0x492125(0x16f)];console[_0x492125(0x1a3)]('✔\x20Found\x20'+_0x451062['length']+_0x492125(0x198)+(_0x451062[_0x492125(0x16f)]!==0x1?'s':'')+',\x20'+_0x4f909f['length']+_0x492125(0x17a)+(_0x4f909f['length']!==0x1?'s':'')+',\x20and\x20'+_0x4fe20f['length']+'\x20journey'+(_0x4fe20f['length']!==0x1?'s':'')+_0x492125(0x18c)+_0x285489+'\x27');const _0x594183=_0x4f0eb1=>{const _0x53bbce=_0x492125;return getConsoleNextUrl(_0x325df3[_0x53bbce(0x199)],_0x53bbce(0x196)+_0x368a47[_0x53bbce(0x19a)]+_0x53bbce(0x1b3)+_0x4f0eb1);},_0x2b5669=_0x325df3[_0x492125(0x188)]==='json'||_0x325df3['format']==='jsonl';if(_0x2b5669){const _0x193628=[..._0x451062[_0x492125(0x1a9)](_0xb45c35=>({..._0xb45c35,'type':_0x492125(0x19d)})),..._0x4f909f[_0x492125(0x1a9)](_0x3fea93=>({..._0x3fea93,'type':_0x492125(0x1b0),'url':_0x594183(_0x3fea93['id'])})),..._0x4fe20f[_0x492125(0x1a9)](_0x26fb24=>({..._0x26fb24,'name':_0x26fb24[_0x492125(0x1aa)],'type':_0x492125(0x19f)}))][_0x492125(0x1a0)]((_0x1a465a,_0x2d174b)=>_0x1a465a[_0x492125(0x16d)][_0x492125(0x17c)](_0x2d174b[_0x492125(0x16d)]));await handleSDKOutput(_0x193628,_0x325df3);}else{if(_0x4d14f6===0x0)console[_0x492125(0x176)](_0x492125(0x17f)+_0x285489);else{console['log'](a44_0x3c23d3[_0x492125(0x1b2)]('['+_0x625d49+_0x492125(0x183)+_0x285489+'\x27'));const _0x18cc0f=formatFlatList(_0x451062,_0x4f909f,{'showMetadata':!![],'getSegmentUrl':_0x594183},_0x4fe20f);console[_0x492125(0x176)](_0x18cc0f);}}return 0x0;}async['listUnified'](_0x18b332,_0x37ffb8){const _0x206060=a44_0x3f2396,{options:_0x5997c2,tdx:_0x37af3e}=_0x18b332,_0x54f1bf=await withSpinner('Resolving\x20path\x20\x27'+_0x37ffb8+_0x206060(0x16e),()=>_0x37af3e[_0x206060(0x1b0)][_0x206060(0x1af)](_0x37ffb8),{'verbose':_0x5997c2[_0x206060(0x182)]}),_0x31147f=_0x54f1bf[_0x206060(0x1b1)];_0x5997c2[_0x206060(0x182)]&&(console[_0x206060(0x1a3)](_0x206060(0x175)+_0x31147f[_0x206060(0x19a)]),_0x31147f['folderId']&&console[_0x206060(0x1a3)](_0x206060(0x16c)+_0x31147f[_0x206060(0x181)]));const _0x388047=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x37af3e['segment']['listUnifiedWithJourneys'](_0x31147f['parentId'],_0x31147f['folderId']),{'verbose':_0x5997c2[_0x206060(0x182)]}),{folders:_0x1cdbf2,segments:_0x424c3a,journeys:_0x3d63dd}=_0x388047[_0x206060(0x1b1)],_0x5be2c1=_0x1cdbf2['length']+_0x424c3a[_0x206060(0x16f)]+_0x3d63dd[_0x206060(0x16f)];console['error']('✔\x20Found\x20'+_0x1cdbf2[_0x206060(0x16f)]+_0x206060(0x198)+(_0x1cdbf2[_0x206060(0x16f)]!==0x1?'s':'')+',\x20'+_0x424c3a[_0x206060(0x16f)]+_0x206060(0x17a)+(_0x424c3a[_0x206060(0x16f)]!==0x1?'s':'')+',\x20and\x20'+_0x3d63dd['length']+_0x206060(0x18f)+(_0x3d63dd[_0x206060(0x16f)]!==0x1?'s':''));const _0x2940af=_0x44adfc=>{const _0x4ebbf7=_0x206060;return getConsoleNextUrl(_0x5997c2[_0x4ebbf7(0x199)],_0x4ebbf7(0x196)+_0x31147f['parentId']+'/e/'+_0x44adfc);},_0x1537a8=_0x3c8c5a=>{const _0x4cab3a=_0x206060;return getConsoleNextUrl(_0x5997c2[_0x4cab3a(0x199)],'/app/ps/'+_0x31147f[_0x4cab3a(0x19a)]+'/e/'+_0x3c8c5a+_0x4cab3a(0x194));},_0x230037=_0x5997c2[_0x206060(0x188)]==='json'||_0x5997c2[_0x206060(0x188)]===_0x206060(0x18b);if(_0x230037){const _0x3f3e64=[..._0x1cdbf2[_0x206060(0x1a9)](_0x45aa4f=>({..._0x45aa4f,'type':_0x206060(0x19d)})),..._0x424c3a[_0x206060(0x1a9)](_0x45f873=>({..._0x45f873,'type':'segment','url':_0x2940af(_0x45f873['id'])})),..._0x3d63dd[_0x206060(0x1a9)](_0x1e5d4c=>({..._0x1e5d4c,'name':_0x1e5d4c['journeyBundleName'],'type':_0x206060(0x19f),'url':_0x1537a8(_0x1e5d4c['id'])}))]['sort']((_0x364c3b,_0x566013)=>_0x364c3b[_0x206060(0x16d)][_0x206060(0x17c)](_0x566013[_0x206060(0x16d)]));await handleSDKOutput(_0x3f3e64,_0x5997c2);}else{if(_0x5be2c1===0x0)console[_0x206060(0x176)](a44_0x3c23d3[_0x206060(0x1b2)]('['+_0x37ffb8+']')),console[_0x206060(0x176)]('(empty)');else{console[_0x206060(0x176)](a44_0x3c23d3[_0x206060(0x1b2)]('['+_0x37ffb8+']'));const _0x1294ea=formatFlatList(_0x1cdbf2,_0x424c3a,{'showMetadata':!![],'getSegmentUrl':_0x2940af,'getJourneyUrl':_0x1537a8},_0x3d63dd);console[_0x206060(0x176)](_0x1294ea);}}return 0x0;}async[a44_0x3f2396(0x169)](_0x4e6c0b,_0x1f975b){const _0x3ffb12=a44_0x3f2396,{options:_0x5955a0,tdx:_0x1cad92}=_0x4e6c0b,_0x3ad697=await withSpinner(_0x3ffb12(0x18d)+_0x1f975b+_0x3ffb12(0x16e),()=>_0x1cad92[_0x3ffb12(0x1b0)][_0x3ffb12(0x1af)](_0x1f975b),{'verbose':_0x5955a0[_0x3ffb12(0x182)]}),_0x1f8833=_0x3ad697[_0x3ffb12(0x1b1)];_0x5955a0[_0x3ffb12(0x182)]&&(console[_0x3ffb12(0x1a3)]('Parent\x20ID:\x20'+_0x1f8833[_0x3ffb12(0x19a)]),_0x1f8833[_0x3ffb12(0x181)]&&console[_0x3ffb12(0x1a3)](_0x3ffb12(0x16c)+_0x1f8833['folderId']));const _0x52feed=_0x5955a0['maxDepth']||0xa,_0xb8d07c=await withSpinner(_0x3ffb12(0x184),()=>_0x1cad92['segment'][_0x3ffb12(0x169)](_0x1f8833[_0x3ffb12(0x19a)],_0x1f8833[_0x3ffb12(0x181)],0x0,_0x52feed),{'verbose':_0x5955a0[_0x3ffb12(0x182)]}),_0x301a8b=_0xb8d07c[_0x3ffb12(0x1b1)],_0x3b5399=_0x1d7a9c=>{const _0x14db62=_0x3ffb12;let _0x4995ed=0x0,_0x1d08d1=0x0,_0x1beb98=0x0;for(const _0x36068d of _0x1d7a9c){if(_0x36068d['type']==='folder')_0x4995ed++;else{if(_0x36068d[_0x14db62(0x19e)]==='segment')_0x1d08d1++;else{if(_0x36068d['type']===_0x14db62(0x19f))_0x1beb98++;}}if(_0x36068d[_0x14db62(0x1a1)]){const _0x3569c4=_0x3b5399(_0x36068d['children']);_0x4995ed+=_0x3569c4['folders'],_0x1d08d1+=_0x3569c4['segments'],_0x1beb98+=_0x3569c4[_0x14db62(0x178)];}}return{'folders':_0x4995ed,'segments':_0x1d08d1,'journeys':_0x1beb98};},_0x1b4be1=_0x3b5399(_0x301a8b);console[_0x3ffb12(0x1a3)](_0x3ffb12(0x179)+_0x1b4be1[_0x3ffb12(0x1a6)]+_0x3ffb12(0x198)+(_0x1b4be1[_0x3ffb12(0x1a6)]!==0x1?'s':'')+',\x20'+_0x1b4be1[_0x3ffb12(0x195)]+_0x3ffb12(0x17a)+(_0x1b4be1[_0x3ffb12(0x195)]!==0x1?'s':'')+',\x20and\x20'+_0x1b4be1[_0x3ffb12(0x178)]+_0x3ffb12(0x18f)+(_0x1b4be1[_0x3ffb12(0x178)]!==0x1?'s':''));const _0x293303=_0x4baa3=>{const _0x3ec6ec=_0x3ffb12;return getConsoleNextUrl(_0x5955a0['site'],_0x3ec6ec(0x196)+_0x1f8833['parentId']+_0x3ec6ec(0x1b3)+_0x4baa3);},_0x2d0be7=_0x5cb9d8=>{const _0x4b85fb=_0x3ffb12;return getConsoleNextUrl(_0x5955a0[_0x4b85fb(0x199)],_0x4b85fb(0x196)+_0x1f8833[_0x4b85fb(0x19a)]+'/e/'+_0x5cb9d8+'/j/da');};if(_0x5955a0[_0x3ffb12(0x188)]===_0x3ffb12(0x1a7)||_0x5955a0[_0x3ffb12(0x188)]==='jsonl')await handleSDKOutput(_0x301a8b,_0x5955a0);else{console[_0x3ffb12(0x176)](a44_0x3c23d3[_0x3ffb12(0x1b2)]('['+_0x1f975b+']'));const _0x26ea9d=formatTree(_0x301a8b,{'showMetadata':!![],'getSegmentUrl':_0x293303,'getJourneyUrl':_0x2d0be7});console[_0x3ffb12(0x176)](_0x26ea9d);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a45_0x37cccb=a45_0x5ec7;function a45_0x5ec7(_0x5bbba8,_0x5c6b21){_0x5bbba8=_0x5bbba8-0x144;const _0x1e73e8=a45_0x1e73();let _0x5ec7b1=_0x1e73e8[_0x5bbba8];return _0x5ec7b1;}(function(_0x44f6cc,_0xda5fa8){const _0x4b2555=a45_0x5ec7,_0x4f0f0b=_0x44f6cc();while(!![]){try{const _0x5028c3=parseInt(_0x4b2555(0x144))/0x1+parseInt(_0x4b2555(0x14f))/0x2+-parseInt(_0x4b2555(0x153))/0x3+-parseInt(_0x4b2555(0x147))/0x4+parseInt(_0x4b2555(0x159))/0x5+-parseInt(_0x4b2555(0x16c))/0x6+parseInt(_0x4b2555(0x154))/0x7;if(_0x5028c3===_0xda5fa8)break;else _0x4f0f0b['push'](_0x4f0f0b['shift']());}catch(_0x4c57d1){_0x4f0f0b['push'](_0x4f0f0b['shift']());}}}(a45_0x1e73,0x8be8a));function a45_0x1e73(){const _0x5f1158=['Site:\x20','...','database','execute','✔\x20Retrieved\x20','limit','Catalog:\x20','cause','length','query','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','table','6408072BuXANj','921761SNWSva','Limit:\x20','data','4078304KoInwo','message','Usage:\x20tdx\x20show\x20<database.table>','\x20row','verbose','\x20from\x20','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','showTable','1314510JmimUs','catalog','site','show','2048217nqxXyw','4932417TrdTjb','Error:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Querying\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','5298730AcDlap','Show\x20table\x20contents','error','description','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','\x20\x20Cause:\x20','validate'];a45_0x1e73=function(){return _0x5f1158;};return a45_0x1e73();}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';export class ShowCommand extends BaseCommand{['name']=a45_0x37cccb(0x152);[a45_0x37cccb(0x15c)]=a45_0x37cccb(0x15a);async[a45_0x37cccb(0x163)](_0x4689b1){const _0x2bd09f=a45_0x37cccb;return this[_0x2bd09f(0x14e)](_0x4689b1);}async[a45_0x37cccb(0x14e)](_0x3b727e){const _0x1deada=a45_0x37cccb,{options:_0x32a048,args:_0x21b84c,tdx:_0x4f1d67}=_0x3b727e;let _0x186772;try{_0x186772=parseTableReference(_0x21b84c[0x0]);const _0x4bd58c=_0x32a048[_0x1deada(0x162)];!_0x186772[_0x1deada(0x162)]&&_0x4bd58c&&(_0x186772[_0x1deada(0x162)]=_0x4bd58c);const _0x4f4660=validateTableDescribeReference(_0x186772);if(_0x4f4660)return console[_0x1deada(0x15b)](_0x1deada(0x155)+_0x4f4660),console[_0x1deada(0x15b)](_0x1deada(0x149)),console[_0x1deada(0x15b)](_0x1deada(0x16a)),console[_0x1deada(0x15b)](_0x1deada(0x156)),0x1;}catch(_0x16e5d6){return console[_0x1deada(0x15b)]('Error:\x20'+_0x16e5d6[_0x1deada(0x148)]),console[_0x1deada(0x15b)](_0x1deada(0x149)),console[_0x1deada(0x15b)](_0x1deada(0x16a)),console[_0x1deada(0x15b)](_0x1deada(0x156)),0x1;}const _0x3b73c4=_0x186772[_0x1deada(0x150)],_0x10aeb1=_0x186772['database'],_0x25465e=_0x186772[_0x1deada(0x16b)],_0x1bb1ef=resolveLimit(_0x32a048[_0x1deada(0x165)],DEFAULT_DISPLAY_LIMIT);try{_0x32a048[_0x1deada(0x14b)]&&(console[_0x1deada(0x15b)](_0x1deada(0x160)+_0x32a048[_0x1deada(0x151)]),_0x3b73c4&&console[_0x1deada(0x15b)](_0x1deada(0x166)+_0x3b73c4),console['error']('Database:\x20'+_0x10aeb1),console[_0x1deada(0x15b)]('Table:\x20'+_0x25465e),console[_0x1deada(0x15b)](_0x1deada(0x145)+_0x1bb1ef));const _0x42616c=_0x3b73c4?_0x3b73c4+'.'+_0x10aeb1+'.'+_0x25465e:_0x10aeb1+'.'+_0x25465e,_0x19954b=await withSpinner(_0x1deada(0x157)+_0x42616c+_0x1deada(0x161),()=>_0x4f1d67[_0x1deada(0x169)][_0x1deada(0x14e)](_0x10aeb1,_0x25465e,_0x1bb1ef,_0x3b73c4),{'verbose':_0x32a048[_0x1deada(0x14b)]}),_0x20d506=_0x19954b[_0x1deada(0x146)],_0x2d9155=_0x20d506[_0x1deada(0x146)];return _0x2d9155[_0x1deada(0x168)]===0x0?console[_0x1deada(0x15b)](_0x1deada(0x158)):console[_0x1deada(0x15b)](_0x1deada(0x164)+_0x2d9155[_0x1deada(0x168)]+_0x1deada(0x14a)+(_0x2d9155[_0x1deada(0x168)]!==0x1?'s':'')+_0x1deada(0x14c)+_0x42616c),await handleSDKOutput(_0x2d9155,_0x32a048),0x0;}catch(_0x59b412){if(_0x59b412 instanceof SDKError)return console['error'](_0x1deada(0x155)+_0x59b412['message']),_0x59b412[_0x1deada(0x167)]&&console[_0x1deada(0x15b)](_0x1deada(0x15e)+_0x59b412[_0x1deada(0x167)]),0x1;throw _0x59b412;}}[a45_0x37cccb(0x15f)](_0x37670f){const _0x22751a=a45_0x37cccb;if(_0x37670f['args']['length']===0x0)return _0x22751a(0x14d);if(_0x37670f['args'][_0x22751a(0x168)]>0x1)return _0x22751a(0x15d);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a46_0x47c9ef=a46_0x149d;(function(_0x15044e,_0x16d7f5){const _0x4419e9=a46_0x149d,_0x20c233=_0x15044e();while(!![]){try{const _0x32fc94=-parseInt(_0x4419e9(0x130))/0x1*(-parseInt(_0x4419e9(0x119))/0x2)+parseInt(_0x4419e9(0x10e))/0x3*(-parseInt(_0x4419e9(0x109))/0x4)+-parseInt(_0x4419e9(0x106))/0x5+parseInt(_0x4419e9(0x115))/0x6*(-parseInt(_0x4419e9(0x127))/0x7)+parseInt(_0x4419e9(0x120))/0x8+-parseInt(_0x4419e9(0x108))/0x9*(parseInt(_0x4419e9(0x121))/0xa)+parseInt(_0x4419e9(0x125))/0xb;if(_0x32fc94===_0x16d7f5)break;else _0x20c233['push'](_0x20c233['shift']());}catch(_0x10f62a){_0x20c233['push'](_0x20c233['shift']());}}}(a46_0x135d,0x8238b));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a46_0x135d(){const _0xa2cc66=['49FZSZqL','Show\x20authentication\x20status\x20and\x20current\x20context','Credential\x20type:\x20','✗\x20Validation\x20failed:\x20','config','email','\x20profile:\x20','dim','jobs','1PDXlER','execute','log','Account\x20ID:','getUserInfo','Name:','(from\x20','5221855UCCTnU','first_name','34947OZqsFd','20280bDqYFW','account_id','Read\x20credential\x20from\x20','No\x20credential\x20found','description','75Jyuvxr','bold','site','name','session','join','cli','453282yweInT','OAuth','TDX_PROFILE\x20env','last_name','770806nPVpIG','displayWithSources','cyan','red','env','yellow','site:\x20','3464776rNmwcT','370zABRjg','message','User:','✓\x20Authentication\x20successful\x0a','17143588QgcBJU','error'];a46_0x135d=function(){return _0xa2cc66;};return a46_0x135d();}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a46_0x149d(_0x450bd8,_0x34552d){_0x450bd8=_0x450bd8-0x103;const _0x135d3b=a46_0x135d();let _0x149d38=_0x135d3b[_0x450bd8];return _0x149d38;}import a46_0x4228d2 from'chalk';export class StatusCommand extends BaseCommand{[a46_0x47c9ef(0x111)]='status';[a46_0x47c9ef(0x10d)]=a46_0x47c9ef(0x128);async[a46_0x47c9ef(0x131)](_0x312346){const _0x1e8dad=a46_0x47c9ef,{options:_0x4c67e4,tdx:_0x24ff0a}=_0x312346,_0x489835=_0x4c67e4[_0x1e8dad(0x110)],_0x33a503=new GlobalContext(_0x4c67e4),_0x5068c0=_0x33a503['profile'],_0x1f6a37=_0x33a503['profileSource'],_0x2493c4=_0x1f6a37===_0x1e8dad(0x114)?'CLI\x20flag':_0x1f6a37===_0x1e8dad(0x112)?_0x1e8dad(0x112):_0x1f6a37===_0x1e8dad(0x11d)?_0x1e8dad(0x117):_0x1f6a37===_0x1e8dad(0x12b)?_0x1e8dad(0x12b):null,_0x4a0700=_0x5068c0?a46_0x4228d2[_0x1e8dad(0x11b)](_0x5068c0):a46_0x4228d2['dim']('N/A'),_0x24cb55=_0x2493c4?'\x20'+a46_0x4228d2[_0x1e8dad(0x12e)](_0x1e8dad(0x105)+_0x2493c4+')'):'';console[_0x1e8dad(0x132)](a46_0x4228d2[_0x1e8dad(0x10f)]('tdx')+_0x1e8dad(0x12d)+_0x4a0700+_0x24cb55+'\x20'+a46_0x4228d2[_0x1e8dad(0x12e)]('(')+_0x1e8dad(0x11f)+a46_0x4228d2[_0x1e8dad(0x11b)](_0x489835)+a46_0x4228d2['dim'](')'));const _0x5ae02a=await getOAuthTokens(_0x5068c0);if(_0x5ae02a)console[_0x1e8dad(0x132)](_0x1e8dad(0x129)+a46_0x4228d2['cyan'](_0x1e8dad(0x116)));else{const _0x4bbb63=await resolveAPIKeyAsync(_0x489835,_0x5068c0);if(_0x4bbb63){const {source:_0x1bb038,isDeprecated:_0x512e2e}=_0x4bbb63,_0x2291dd=_0x1e8dad(0x10b)+a46_0x4228d2[_0x1e8dad(0x11b)](_0x1bb038);console['log'](_0x512e2e?a46_0x4228d2[_0x1e8dad(0x11e)](_0x2291dd):_0x2291dd);}else console[_0x1e8dad(0x132)](a46_0x4228d2['yellow'](_0x1e8dad(0x10c)));}let _0x3ded01=![];try{const _0x24a276=await _0x24ff0a[_0x1e8dad(0x12f)][_0x1e8dad(0x103)]();console[_0x1e8dad(0x132)](a46_0x4228d2['green'](_0x1e8dad(0x124))),console[_0x1e8dad(0x132)](a46_0x4228d2['bold'](_0x1e8dad(0x123))+'\x20'+a46_0x4228d2['cyan'](_0x24a276[_0x1e8dad(0x12c)]));if(_0x24a276[_0x1e8dad(0x107)]||_0x24a276[_0x1e8dad(0x118)]){const _0x570f5e=[_0x24a276['first_name'],_0x24a276[_0x1e8dad(0x118)]]['filter'](Boolean)[_0x1e8dad(0x113)]('\x20');console[_0x1e8dad(0x132)](a46_0x4228d2[_0x1e8dad(0x10f)](_0x1e8dad(0x104))+'\x20'+_0x570f5e);}_0x24a276[_0x1e8dad(0x10a)]&&console[_0x1e8dad(0x132)](a46_0x4228d2[_0x1e8dad(0x10f)](_0x1e8dad(0x133))+'\x20'+a46_0x4228d2[_0x1e8dad(0x11e)](_0x24a276['account_id'])),_0x3ded01=!![];}catch(_0x25907f){_0x25907f instanceof HTTPClientError&&_0x25907f['status']===0x191?printAuthError(_0x25907f,!![],_0x5068c0):console[_0x1e8dad(0x126)](a46_0x4228d2[_0x1e8dad(0x11c)](_0x1e8dad(0x12a)+(_0x25907f instanceof Error?_0x25907f[_0x1e8dad(0x122)]:String(_0x25907f))));}return console['log'](),_0x33a503[_0x1e8dad(0x11a)](),_0x3ded01?0x0:0x1;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x56d92a=a47_0x2a59;(function(_0x477d6b,_0x1dffeb){const _0x324286=a47_0x2a59,_0x2f0c8d=_0x477d6b();while(!![]){try{const _0x53d7d6=parseInt(_0x324286(0xbc))/0x1*(-parseInt(_0x324286(0xb1))/0x2)+-parseInt(_0x324286(0xb4))/0x3+parseInt(_0x324286(0x95))/0x4+-parseInt(_0x324286(0xa6))/0x5*(-parseInt(_0x324286(0x9e))/0x6)+parseInt(_0x324286(0x87))/0x7+-parseInt(_0x324286(0x91))/0x8*(-parseInt(_0x324286(0x90))/0x9)+-parseInt(_0x324286(0xbb))/0xa;if(_0x53d7d6===_0x1dffeb)break;else _0x2f0c8d['push'](_0x2f0c8d['shift']());}catch(_0x130195){_0x2f0c8d['push'](_0x2f0c8d['shift']());}}}(a47_0x3ef6,0x253f7));function a47_0x2a59(_0x5b934c,_0x7e3f11){_0x5b934c=_0x5b934c-0x87;const _0x3ef65c=a47_0x3ef6();let _0x2a5953=_0x3ef65c[_0x5b934c];return _0x2a5953;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a47_0x56d92a(0xa9)]=a47_0x56d92a(0xb9);[a47_0x56d92a(0xb3)]='List\x20tables\x20in\x20a\x20database';async[a47_0x56d92a(0x9b)](_0x3d9db2){const _0x3525fb=a47_0x56d92a,{options:_0x2e5acb,args:_0x379b1b,tdx:_0x38559c}=_0x3d9db2;let _0x40780f;if(_0x379b1b[_0x3525fb(0x98)]===0x0)_0x40780f={'database':undefined,'table':undefined,'original':''};else{if(_0x379b1b['length']===0x1)try{_0x40780f=parseTableReference(_0x379b1b[0x0]);if(_0x40780f[_0x3525fb(0xa4)]&&!_0x40780f['database']&&!_0x40780f[_0x3525fb(0xa4)][_0x3525fb(0x9c)]('*')&&!_0x40780f[_0x3525fb(0xa4)][_0x3525fb(0x9c)]('?'))return console[_0x3525fb(0xb8)]('Error:\x20Pattern\x20\x27'+_0x379b1b[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x3525fb(0xb8)](_0x3525fb(0xa2)+_0x40780f['table']+'\x27?'),console['error'](_0x3525fb(0x8f)+_0x40780f[_0x3525fb(0xa4)]+_0x3525fb(0x9d)),console[_0x3525fb(0xb8)](_0x3525fb(0x93)+_0x40780f[_0x3525fb(0xa4)]),console['error'](_0x3525fb(0x8e)+_0x40780f[_0x3525fb(0xa4)]),console['error'](''),console[_0x3525fb(0xb8)](_0x3525fb(0xab)+_0x379b1b[0x0]+_0x3525fb(0x8a)+_0x40780f['table']+_0x3525fb(0xa0)),0x1;}catch(_0x254739){return console[_0x3525fb(0xb8)](_0x3525fb(0xb0)+_0x254739['message']),0x1;}else return console['error'](_0x3525fb(0xaf)),console[_0x3525fb(0xb8)](_0x3525fb(0xae)),console[_0x3525fb(0xb8)](_0x3525fb(0xb5)),console[_0x3525fb(0xb8)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x3525fb(0xaa)),console[_0x3525fb(0xb8)]('Or\x20use\x20--in\x20flag:'),console[_0x3525fb(0xb8)](_0x3525fb(0x92)),0x1;}const _0x32597f=_0x2e5acb[_0x3525fb(0x94)];!_0x40780f['database']&&_0x32597f&&(_0x40780f[_0x3525fb(0x94)]=_0x32597f);try{const _0x1527d4=_0x3e69da=>_0x3e69da&&(_0x3e69da[_0x3525fb(0x9c)]('*')||_0x3e69da[_0x3525fb(0x9c)]('?')),_0x680caf=_0x1527d4(_0x40780f[_0x3525fb(0x94)]);_0x2e5acb[_0x3525fb(0x8c)]&&(console['error'](_0x3525fb(0x9f)+_0x2e5acb[_0x3525fb(0xa5)]),_0x40780f[_0x3525fb(0x94)]?_0x680caf?console[_0x3525fb(0xb8)](_0x3525fb(0x96)+_0x40780f[_0x3525fb(0x94)]):console['error'](_0x3525fb(0xb2)+_0x40780f[_0x3525fb(0x94)]):console[_0x3525fb(0xb8)](_0x3525fb(0xac)),_0x40780f[_0x3525fb(0xa4)]&&console['error'](_0x3525fb(0x97)+_0x40780f[_0x3525fb(0xa4)]));const _0x40afa0=_0x40780f[_0x3525fb(0x94)]&&!_0x680caf?_0x40780f[_0x3525fb(0x94)]:undefined,_0x521873=_0x680caf?_0x40780f['database']:undefined,_0xc155cd=_0x40780f['table'],_0x41c425=resolveLimit(_0x2e5acb[_0x3525fb(0x8b)],DEFAULT_LISTING_LIMIT),_0x571722=await withSpinner(_0x3525fb(0x89),()=>_0x38559c[_0x3525fb(0xa1)][_0x3525fb(0xb7)](_0x40afa0,_0xc155cd,_0x521873,_0x41c425),{'verbose':_0x2e5acb['verbose']}),_0x3786d9=_0x571722[_0x3525fb(0x8d)];if(_0x3786d9['length']===0x0&&_0x40780f[_0x3525fb(0x94)]&&!_0x680caf)return console[_0x3525fb(0xb8)](_0x3525fb(0xa7)),console[_0x3525fb(0xb8)](_0x3525fb(0xad)+_0x40780f[_0x3525fb(0x94)]+_0x3525fb(0x99)),0x1;console['error']('✔\x20Found\x20'+_0x3786d9[_0x3525fb(0x98)]+'\x20table'+(_0x3786d9['length']!==0x1?'s':''));if(isStructuredFormat(_0x2e5acb))await handleSDKOutput(_0x3786d9,{..._0x2e5acb,'limit':_0x41c425});else for(const _0x5e62b7 of _0x3786d9){const _0x580a2b=_0x5e62b7['database_name']?_0x5e62b7[_0x3525fb(0xa3)]+'.':'';console['log'](_0x3525fb(0xa8)+_0x580a2b+_0x5e62b7['table_name']);}return 0x0;}catch(_0x41b3ed){if(_0x41b3ed instanceof SDKError)return console['error'](_0x3525fb(0xb0)+_0x41b3ed[_0x3525fb(0x88)]),_0x41b3ed[_0x3525fb(0xba)]&&console[_0x3525fb(0xb8)](_0x3525fb(0xb6)+_0x41b3ed[_0x3525fb(0xba)]),0x1;throw _0x41b3ed;}}[a47_0x56d92a(0x9a)](_0x3a6d82){return undefined;}}function a47_0x3ef6(){const _0x4c8b3f=['229954qwwbmk','Database:\x20','description','423234AgyKAb','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Cause:\x20','listTables','error','tables','cause','2462670gEtTac','2jEWxQQ','364532TLPvhe','message','Listing\x20tables...','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','limit','verbose','data','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','225vAEcXW','95672xAwgOc','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','database','860952gSSAPf','Database\x20pattern:\x20','Table\x20pattern:\x20','length','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','validate','execute','includes','.*\x22','198lgBYQU','Site:\x20','\x27\x20across\x20all\x20databases.','query','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','database_name','table','site','30845scRauP','✖\x20No\x20tables\x20found','📋\x20','name','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Note:\x20\x27','Database:\x20all','Database\x20\x27','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','Error:\x20'];a47_0x3ef6=function(){return _0x4c8b3f;};return a47_0x3ef6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x5e01a6=a48_0x1cd2;(function(_0x576456,_0x3e43b0){const _0x433a53=a48_0x1cd2,_0x5c6ecd=_0x576456();while(!![]){try{const _0x35617a=parseInt(_0x433a53(0xa4))/0x1+parseInt(_0x433a53(0x99))/0x2+-parseInt(_0x433a53(0x90))/0x3+parseInt(_0x433a53(0x9b))/0x4+-parseInt(_0x433a53(0xad))/0x5*(-parseInt(_0x433a53(0xb5))/0x6)+-parseInt(_0x433a53(0xa6))/0x7+parseInt(_0x433a53(0xa3))/0x8;if(_0x35617a===_0x3e43b0)break;else _0x5c6ecd['push'](_0x5c6ecd['shift']());}catch(_0x41a394){_0x5c6ecd['push'](_0x5c6ecd['shift']());}}}(a48_0x2a03,0xe4fea));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';function a48_0x2a03(){const _0x193a3a=['length','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','Invalid\x20resource:\x20','(session:\x20','Usage:\x20tdx\x20unset\x20<resource>\x0a','3878860AShkeb','join','engage_workspace','Error:\x20','agent','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','llm_project','default','6ClYErp','error','session','message','Session\x20','1215294nZHFzY','green','Default\x20site\x20','description','database','validate','profile','cleared','Default\x20profile\x20','342462WcmXPt','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','5536468vXfARu','\x0aUpdated:\x20','dim','unset','name','log','parent_segment','.\x20Must\x20be\x20one\x20of:\x20','260384cakMJL','518809oSjhwo','site','10775919HTzCaA'];a48_0x2a03=function(){return _0x193a3a;};return a48_0x2a03();}function a48_0x1cd2(_0x20d562,_0x334e0d){_0x20d562=_0x20d562-0x90;const _0x2a03ac=a48_0x2a03();let _0x1cd20f=_0x2a03ac[_0x20d562];return _0x1cd20f;}import a48_0xc0c1b from'chalk';import*as a48_0x5e1cb7 from'node:path';export class UnsetCommand extends BaseCommand{[a48_0x5e01a6(0x9f)]=a48_0x5e01a6(0x9e);[a48_0x5e01a6(0x93)]='Clear\x20session-level\x20or\x20default\x20context\x20values';[a48_0x5e01a6(0x95)](_0x36ae99){const _0x172dc8=a48_0x5e01a6,{args:_0x35f21d,options:_0x25e85e}=_0x36ae99,_0x1ca079=_0x25e85e[_0x172dc8(0xb4)];if(_0x35f21d[_0x172dc8(0xa7)]===0x0)return _0x172dc8(0xac)+_0x172dc8(0xa9)+_0x172dc8(0x9a)+_0x172dc8(0xb2);const _0x546e07=_0x35f21d[0x0],_0x1fc6d6=[_0x172dc8(0xa5),'database','parent_segment',_0x172dc8(0xb3),_0x172dc8(0xb1),'profile','engage_workspace'];if(!_0x1fc6d6['includes'](_0x546e07))return _0x172dc8(0xaa)+_0x546e07+_0x172dc8(0xa2)+_0x1fc6d6[_0x172dc8(0xae)](',\x20');if(_0x1ca079&&_0x546e07!==_0x172dc8(0xa5)&&_0x546e07!==_0x172dc8(0x96))return _0x172dc8(0xa8);return undefined;}async['execute'](_0x28c3f4){const _0x3df8f8=a48_0x5e01a6,{args:_0x3e2104,options:_0x453378}=_0x28c3f4,_0x39227a=_0x453378[_0x3df8f8(0xb4)];cleanExpiredSessions();try{const _0x2a21d3=_0x3e2104[0x0],_0x1c3a6f=a48_0x5e1cb7[_0x3df8f8(0xae)](getConfigDir(),'tdx.json');if(_0x39227a){if(_0x2a21d3===_0x3df8f8(0xa5))return clearDefaultSiteFromUserConfig(),console[_0x3df8f8(0xa0)](_0x3df8f8(0x92)+a48_0xc0c1b[_0x3df8f8(0x91)]('cleared')),console['log'](a48_0xc0c1b[_0x3df8f8(0x9d)]('\x0aUpdated:\x20'+_0x1c3a6f)),0x0;if(_0x2a21d3==='profile')return clearActiveProfileFromUserConfig(),console[_0x3df8f8(0xa0)](_0x3df8f8(0x98)+a48_0xc0c1b['green']('cleared')),console[_0x3df8f8(0xa0)](a48_0xc0c1b[_0x3df8f8(0x9d)](_0x3df8f8(0x9c)+_0x1c3a6f)),0x0;}const _0x496d69=getSessionID(_0x453378[_0x3df8f8(0xb7)]),_0xfa29ec={'site':_0x3df8f8(0xa5),'database':_0x3df8f8(0x94),'parent_segment':_0x3df8f8(0xa1),'llm_project':_0x3df8f8(0xb3),'agent':'llm_agent','profile':'profile','engage_workspace':_0x3df8f8(0xaf)},_0xea4ed3=_0xfa29ec[_0x2a21d3];return _0xea4ed3&&(clearSessionContextField(_0xea4ed3,_0x453378[_0x3df8f8(0xb7)]),console['log'](_0x3df8f8(0xb9)+_0x2a21d3+'\x20'+a48_0xc0c1b[_0x3df8f8(0x91)](_0x3df8f8(0x97))+'\x20'+a48_0xc0c1b[_0x3df8f8(0x9d)](_0x3df8f8(0xab)+_0x496d69+')'))),0x0;}catch(_0x5368f2){return _0x5368f2 instanceof Error&&console[_0x3df8f8(0xb6)](_0x3df8f8(0xb0)+_0x5368f2[_0x3df8f8(0xb8)]),0x1;}}}
|