@treasuredata/tdx 0.25.4 → 0.25.5
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.d.ts.map +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-command.js.map +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/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/describe.js +1 -1
- package/dist/commands/engage-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/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/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/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.d.ts +10 -0
- package/dist/sdk/agent/agent-config.d.ts.map +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-config.js.map +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.d.ts +83 -4
- package/dist/sdk/agent/agent-yaml.d.ts.map +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/agent-yaml.js.map +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/types/agent-def.d.ts +54 -1
- package/dist/sdk/agent/types/agent-def.d.ts.map +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-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.d.ts +89 -1
- package/dist/sdk/client/llm-api-client.d.ts.map +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js.map +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/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.d.ts.map +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/index.js.map +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.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-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-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/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/llm.d.ts +176 -2
- package/dist/sdk/types/llm.d.ts.map +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/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/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/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a31_0x4c8f1d=a31_0x1223;(function(_0x446138,_0x3ebc16){const _0x13db5b=a31_0x1223,_0x495e1c=_0x446138();while(!![]){try{const _0x14edb9=parseInt(_0x13db5b(0x184))/0x1+-parseInt(_0x13db5b(0x1a2))/0x2+-parseInt(_0x13db5b(0x209))/0x3*(parseInt(_0x13db5b(0x1d0))/0x4)+-parseInt(_0x13db5b(0x1f5))/0x5*(-parseInt(_0x13db5b(0x183))/0x6)+-parseInt(_0x13db5b(0x18b))/0x7*(parseInt(_0x13db5b(0x17a))/0x8)+-parseInt(_0x13db5b(0x189))/0x9*(parseInt(_0x13db5b(0x1dc))/0xa)+parseInt(_0x13db5b(0x1c3))/0xb*(parseInt(_0x13db5b(0x188))/0xc);if(_0x14edb9===_0x3ebc16)break;else _0x495e1c['push'](_0x495e1c['shift']());}catch(_0x14eb30){_0x495e1c['push'](_0x495e1c['shift']());}}}(a31_0x8a9b,0xb503f));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 a31_0x1a65e1 from'chalk';import{existsSync}from'fs';function a31_0x1223(_0x23c092,_0x42ee73){_0x23c092=_0x23c092-0x175;const _0x8a9b61=a31_0x8a9b();let _0x122303=_0x8a9b61[_0x23c092];return _0x122303;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a31_0x8a9b(){const _0x1eb3fc=['journeyId','6483016lOdzgz','Changes\x20to\x20journey:','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Push\x20','changed','green','paused','\x20YAML\x20files\x20found','\x20to\x20delete','3585522bHYABj','698381vJtblz','list','toDelete','delete','24EtfJqL','315AZUCBs','\x27...','7ZKUhXD','folderPath','New\x20journey:','\x20unchanged','created','\x0aValidation\x20failed:','yamlConfig','\x20deleted','\x20changed','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','updated','(Journey\x20will\x20be\x20deleted)','join','Fetching\x20existing\x20folders...','\x20\x20\x20\x20','segment','\x20\x20🗺️\x20\x20Journeys:','data','segment\x20or\x20journey','targetDir','journeyBundleId','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Delete\x20segment:','2225120JNCbhK','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','connection','getOutputSchemaWithCache','new','journeyBundleName','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','diff','\x20folders\x20to\x20create','description','get','attributes','blue','Site:\x20','Source\x20directory:\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','segmentFolderId','isScoped','errorCode','type','length','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','Fetching\x20existing\x20activations...','idToName','Fetching\x20connections\x20for\x20name\x20resolution...','parentFolder','file','Resolving\x20parent\x20segment\x20\x27','push','createdSegmentIds','map','createdAt','\x20changes?','12761683zRvJoz','yellow','yes','/app/ps/','name','dim','no_parent','filter','journey','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','parent_name','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','journeys','560VNDvQu','\x0aPush\x20summary\x20for\x20\x27','\x20new','segments','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','nameToId','getParent','Fetching\x20existing\x20journeys...','filePath','segment:push','site','.yml','163310OXPRYC','parentName','activations','\x0a✔\x20Push\x20complete','New\x20segment:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','verbose','\x20to\x20create','parentSegment','repeat','cyan','Error\x20parsing\x20YAML:\x20','red','No\x20','Delete\x20journey:','message','\x20\x20Activations:','.yaml','\x20\x20Source:\x20','/e/','listJourneysWithDetailsFromParentSegment','Error:\x20Directory\x20not\x20found:\x20','helpText','dryRun','then','10mhvxSG','isNew','nameToType','\x20created','toString','updatedAt','existingJourney','\x20updated','audienceId','cwd','setPhase','\x20\x20Activations:\x20','state','scopedFolderPath','\x20activations]','Error:\x20','execute','error','endsWith','listFolders','20955MwlZfO','\x20\x20📊\x20Segments:','all','user','journeysOnly','deleted','Folders\x20to\x20create:'];a31_0x8a9b=function(){return _0x1eb3fc;};return a31_0x8a9b();}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{[a31_0x4c8f1d(0x1c7)]=a31_0x4c8f1d(0x1d9);[a31_0x4c8f1d(0x1ab)]=a31_0x4c8f1d(0x1a0);async[a31_0x4c8f1d(0x205)](_0x19032e){const _0x15fe5c=a31_0x4c8f1d,{options:_0x7a161c,args:_0x446e41,tdx:_0x576f2d}=_0x19032e,_0x422ad6=_0x7a161c,_0x3fa8fd=await resolveTarget({'arg':_0x446e41[0x0],'contextParent':_0x7a161c[_0x15fe5c(0x1e4)],'cwd':process[_0x15fe5c(0x1fe)]()});if(!isSuccessfulResolution(_0x3fa8fd))return _0x3fa8fd[_0x15fe5c(0x1b4)]===_0x15fe5c(0x1c9)?(console['error'](a31_0x1a65e1['yellow'](_0x15fe5c(0x1a3))),console[_0x15fe5c(0x206)](_0x15fe5c(0x194)),console[_0x15fe5c(0x206)](_0x15fe5c(0x1ce)),console[_0x15fe5c(0x206)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console['error'](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x204)+_0x3fa8fd[_0x15fe5c(0x1eb)]+'\x0a')),_0x3fa8fd['helpText']&&console['error'](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x3fa8fd[_0x15fe5c(0x1f2)]))),0x1;if(_0x3fa8fd[_0x15fe5c(0x1b5)]===_0x15fe5c(0x1cd))return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3fa8fd['targetDir']+'\x0a')),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x15fe5c(0x1a8))),0x1;const _0x21f0a4=_0x3fa8fd[_0x15fe5c(0x1dd)],_0x3a82cb=_0x3fa8fd[_0x15fe5c(0x19e)],_0xd54682=_0x3fa8fd['type']===_0x15fe5c(0x1bc)?_0x3fa8fd[_0x15fe5c(0x1d8)]:undefined,_0x520e29=getScopedDetails(_0x3fa8fd),_0x17f431=_0x520e29?.[_0x15fe5c(0x1b3)]??![],_0x23d614=_0x520e29?.[_0x15fe5c(0x202)]??'';if(!existsSync(_0x3a82cb))return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1f1)+_0x3a82cb+'\x0a')),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x15fe5c(0x1a8))),0x1;_0x422ad6[_0x15fe5c(0x1e2)]&&(console[_0x15fe5c(0x206)](_0x15fe5c(0x1af)+_0x422ad6[_0x15fe5c(0x1da)]),console[_0x15fe5c(0x206)]('Parent\x20segment:\x20'+_0x21f0a4),console[_0x15fe5c(0x206)](_0x15fe5c(0x1b0)+_0x3a82cb),_0x17f431&&console[_0x15fe5c(0x206)]('Scoped\x20to\x20folder:\x20'+_0x23d614));const _0x3b9067=await withSpinner(_0x15fe5c(0x1bd)+_0x21f0a4+_0x15fe5c(0x18a),()=>_0x576f2d[_0x15fe5c(0x19a)]['resolveParentId'](_0x21f0a4),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),_0xb30465=_0x3b9067['data'],[_0x4020cf,_0x2e4b1a,_0x232991,_0x4ff5ef,_0x3e3bc6]=await Promise[_0x15fe5c(0x20b)]([withSpinner('Fetching\x20parent\x20segment\x20details...',()=>_0x576f2d[_0x15fe5c(0x19a)][_0x15fe5c(0x1d6)](_0xb30465),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x576f2d[_0x15fe5c(0x19a)]['listSegments'](_0xb30465),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner(_0x15fe5c(0x198),()=>_0x576f2d['segment'][_0x15fe5c(0x208)](_0xb30465),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner(_0x15fe5c(0x1d7),()=>_0x576f2d[_0x15fe5c(0x1cb)][_0x15fe5c(0x1f0)](_0xb30465,{'includeAllVersions':!![]}),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x576f2d[_0x15fe5c(0x175)]['buildUserMaps'](),{'verbose':_0x422ad6['verbose']})[_0x15fe5c(0x1f4)](_0x39d752=>_0x39d752[_0x15fe5c(0x19c)])]),_0x504ad1=_0x4020cf[_0x15fe5c(0x19c)],_0x34dade=extractRootFolderId(_0x504ad1),_0x599cdf=_0x2e4b1a[_0x15fe5c(0x19c)],_0x2cb2cc=_0x232991[_0x15fe5c(0x19c)],{journeys:_0x444a02,activationStepsById:_0x43da4a}=_0x4ff5ef[_0x15fe5c(0x19c)],_0x4c06db=new Map(_0x444a02['map'](_0x2ba83b=>[_0x2ba83b['id'],_0x2ba83b])),_0x6ca23d=_0x444a02[_0x15fe5c(0x1c0)](_0x12ac0e=>({'id':_0x12ac0e['id'],'name':_0x12ac0e['attributes'][_0x15fe5c(0x1c7)],'journeyBundleName':_0x12ac0e[_0x15fe5c(0x1ad)]['journeyBundleName']||'','journeyBundleId':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x19f)]||'','versionNumber':_0x12ac0e['attributes']['versionNumber'],'description':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1ab)],'state':_0x12ac0e['attributes'][_0x15fe5c(0x201)],'paused':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x180)],'audienceId':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1fd)],'folderId':_0x12ac0e['relationships']?.[_0x15fe5c(0x1bb)]?.[_0x15fe5c(0x19c)]?.['id'],'createdAt':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1c1)],'updatedAt':_0x12ac0e[_0x15fe5c(0x1ad)][_0x15fe5c(0x1fa)]})),{emailToId:_0x572b7f,idToEmail:_0x38bfad}=_0x3e3bc6,_0xe652b1=await withSpinner(_0x15fe5c(0x1ba),async()=>{const _0x272d69=_0x15fe5c,_0x1d4866=await _0x576f2d[_0x272d69(0x1a4)][_0x272d69(0x185)]();return buildConnectionMaps(_0x1d4866);},{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]})[_0x15fe5c(0x1f4)](_0x2b6c54=>_0x2b6c54[_0x15fe5c(0x19c)]),_0x350bd6=_0xe652b1['nameToId'],_0x577d77=_0xe652b1['idToName'],_0x548cef=_0xe652b1[_0x15fe5c(0x1f7)],_0x4a1e37={'emailToIdMap':_0x572b7f,'connectionNameToIdMap':_0x350bd6,'connectionNameToTypeMap':_0x548cef,'getSchema':_0x38fc72=>_0x576f2d[_0x15fe5c(0x1a4)][_0x15fe5c(0x1a5)](_0x38fc72)};let {pathToId:_0xd114e,idToPath:_0x1ce742}=buildFolderMaps(_0x2cb2cc);const _0x48d677=buildSegmentLookupMap(_0x599cdf,_0x1ce742),_0x275b9a=buildSegmentNameToIdMap(_0x599cdf),_0x141f0e=buildJourneyBundleLookupMap(_0x6ca23d,_0x1ce742);let _0x24e490;if(_0xd54682){if(!_0xd54682[_0x15fe5c(0x207)](_0x15fe5c(0x1db))&&!_0xd54682[_0x15fe5c(0x207)](_0x15fe5c(0x1ed)))return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x17c)+_0xd54682+'\x0a')),0x1;_0x24e490=[_0xd54682];}else _0x24e490=findYamlFiles(_0x3a82cb);if(_0x24e490[_0x15fe5c(0x1b6)]===0x0)return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e8)]('Error:\x20No\x20YAML\x20files\x20found\x20in\x20'+_0x3a82cb+'\x0a')),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x15fe5c(0x1b7))),0x1;let _0x2be9a5,_0x1edbe5;try{const _0x49542a=parseAndClassifyYamlFiles(_0x24e490,_0x3a82cb,{'skipSegments':_0x422ad6[_0x15fe5c(0x176)]});_0x2be9a5=_0x49542a[_0x15fe5c(0x1d3)],_0x1edbe5=_0x49542a[_0x15fe5c(0x1cf)];const _0x3b61f5=validateParsedFiles(_0x49542a,_0x3a82cb);if(_0x3b61f5[_0x15fe5c(0x1b6)]>0x0)return console['error'](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x190))),console[_0x15fe5c(0x206)](formatValidationErrors(_0x3b61f5)),console['error'](a31_0x1a65e1['yellow'](_0x15fe5c(0x1d4))),0x1;}catch(_0x1412ce){return console['error'](a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1e7)+(_0x1412ce instanceof Error?_0x1412ce[_0x15fe5c(0x1eb)]:_0x1412ce))),0x1;}if(_0x2be9a5['length']===0x0&&_0x1edbe5['length']===0x0){const _0x388342=_0x422ad6[_0x15fe5c(0x176)]?_0x15fe5c(0x1cb):_0x15fe5c(0x19d);return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c4)](_0x15fe5c(0x1e9)+_0x388342+_0x15fe5c(0x181))),0x0;}const _0x16e2f5=new Map();_0x599cdf[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&await withSpinner(_0x15fe5c(0x1b8),async()=>{await batchAsync(_0x599cdf,async _0x222247=>{const _0x1bdc19=a31_0x1223,_0x3a870a=await _0x576f2d[_0x1bdc19(0x19a)]['listActivations'](_0xb30465,_0x222247['id']);_0x16e2f5['set'](_0x222247['id'],_0x3a870a);});},{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]});const {segmentFiles:_0x2fb2da,foldersToCreate:_0x38d5fb}=await prepareSegmentFiles(_0x2be9a5,{'segmentByFolderAndName':_0x48d677,'activationsBySegmentId':_0x16e2f5,'folderPathToId':_0xd114e,'idToEmailMap':_0x38bfad,'connectionIdToNameMap':_0x577d77},_0x4a1e37,_0x17f431,_0x23d614),_0x4a92a7=_0xd54682?[]:findSegmentsToDelete(_0x599cdf,_0x2be9a5[_0x15fe5c(0x1c0)](({yamlConfig:_0x59e238,folderPath:_0x47b299})=>({'yamlConfig':_0x59e238,'folderPath':resolveTDFolderPath(_0x47b299,_0x17f431,_0x23d614)})),_0x1ce742,_0x23d614,_0x17f431),{journeyFiles:_0x269e75,foldersToCreate:_0x2a45d7}=await withProgressSpinner('Preparing\x20journeys...',async _0x397f2f=>prepareJourneyFiles(_0x1edbe5,{'fetchJourney':async _0x2dbac8=>_0x576f2d[_0x15fe5c(0x1cb)]['getJourney'](_0x2dbac8[_0x15fe5c(0x179)]),'journeyBundlesByFolderAndName':_0x141f0e,'folderPathToId':_0xd114e,'idToEmailMap':_0x38bfad,'connectionIdToNameMap':_0x577d77,'existingSegments':_0x599cdf,'parentId':_0xb30465,'deps':_0x576f2d,'progress':{'update':_0xb3f395=>{const _0xc21c9f=_0x15fe5c;_0x397f2f[_0xc21c9f(0x1ff)](_0xb3f395),_0x422ad6[_0xc21c9f(0x1e2)]&&console[_0xc21c9f(0x206)]('\x20\x20'+_0xb3f395);}},'journeyById':_0x4c06db,'activationStepsById':_0x43da4a},_0x17f431,_0x23d614),{'verbose':_0x422ad6[_0x15fe5c(0x1e2)]})[_0x15fe5c(0x1f4)](_0x2e7a41=>_0x2e7a41[_0x15fe5c(0x19c)]);for(const _0x3d931e of _0x2a45d7){_0x38d5fb['add'](_0x3d931e);}const _0x5d9cf9=_0xd54682?[]:findJourneysToDelete(_0x6ca23d,_0x1edbe5['map'](({yamlConfig:_0x14cd4a,folderPath:_0x561c18})=>({'yamlConfig':_0x14cd4a,'folderPath':resolveTDFolderPath(_0x561c18,_0x17f431,_0x23d614)})),_0x1ce742,_0x23d614,_0x17f431),_0x4f1c74=calculatePushStats(_0x2fb2da,_0x269e75,_0x38d5fb,_0x4a92a7,_0x5d9cf9,!!_0x422ad6[_0x15fe5c(0x187)],!!_0x422ad6['journeysOnly']),_0x5c5729=_0x4f1c74[_0x15fe5c(0x1d3)][_0x15fe5c(0x1a6)],_0xc1e05e=_0x4f1c74[_0x15fe5c(0x1d3)]['changed'],_0x5ebf23=_0x4f1c74['segments']['unchanged'],_0x575d00=_0x4f1c74['segments'][_0x15fe5c(0x186)],_0x4272b9=_0x4f1c74['folders']['toCreate'],_0xf32274=_0x4f1c74['journeys'][_0x15fe5c(0x1a6)],_0x975a7c=_0x4f1c74[_0x15fe5c(0x1cf)][_0x15fe5c(0x17e)],_0x4e925b=_0x4f1c74[_0x15fe5c(0x1cf)]['unchanged'],_0x2c2e7f=_0x4f1c74[_0x15fe5c(0x1cf)]['toDelete'],_0x3d09e5=_0x4f1c74[_0x15fe5c(0x1de)][_0x15fe5c(0x20b)],_0x44e731=_0x4f1c74[_0x15fe5c(0x1de)]['toCreate'],_0x12e97c=_0x4f1c74[_0x15fe5c(0x1de)]['toUpdate'],_0x6c4c5b=_0x4f1c74[_0x15fe5c(0x1de)][_0x15fe5c(0x186)];console[_0x15fe5c(0x206)](_0x15fe5c(0x1d1)+_0x21f0a4+'\x27:');_0x4272b9['length']>0x0&&console['error']('\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1ae)]('📁\x20'+_0x4272b9[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1aa)));if(!_0x422ad6[_0x15fe5c(0x176)]){console['error'](_0x15fe5c(0x20a)),console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x17f)]('+\x20'+_0x5c5729[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1d2))),console['error'](_0x15fe5c(0x199)+a31_0x1a65e1['yellow']('~\x20'+_0xc1e05e['length']+'\x20changed'));if(_0x575d00[_0x15fe5c(0x1b6)]>0x0)console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1e8)]('-\x20'+_0x575d00[_0x15fe5c(0x1b6)]+'\x20to\x20delete'));else _0x4a92a7[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x187)]&&console['error'](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c8)](_0x4a92a7[_0x15fe5c(0x1b6)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error']('\x20\x20\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1c8)]('=\x20'+_0x5ebf23['length']+_0x15fe5c(0x18e)));}if(_0x269e75['length']>0x0||_0x5d9cf9[_0x15fe5c(0x1b6)]>0x0){console[_0x15fe5c(0x206)](_0x15fe5c(0x19b)),console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x17f)]('+\x20'+_0xf32274[_0x15fe5c(0x1b6)]+'\x20new')),console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c4)]('~\x20'+_0x975a7c[_0x15fe5c(0x1b6)]+_0x15fe5c(0x193)));if(_0x2c2e7f[_0x15fe5c(0x1b6)]>0x0)console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1e8)]('-\x20'+_0x2c2e7f['length']+_0x15fe5c(0x182)));else _0x5d9cf9[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x187)]&&console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c8)](_0x5d9cf9[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1b1)));console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1['dim']('=\x20'+_0x4e925b[_0x15fe5c(0x1b6)]+_0x15fe5c(0x18e)));}_0x3d09e5[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&(console[_0x15fe5c(0x206)](''),console[_0x15fe5c(0x206)](_0x15fe5c(0x1ec)),_0x44e731['length']>0x0&&console['error']('\x20\x20\x20\x20'+a31_0x1a65e1['green']('+\x20'+_0x44e731[_0x15fe5c(0x1b6)]+_0x15fe5c(0x1e3))),_0x12e97c[_0x15fe5c(0x1b6)]>0x0&&console[_0x15fe5c(0x206)](_0x15fe5c(0x199)+a31_0x1a65e1[_0x15fe5c(0x1c4)]('~\x20'+_0x12e97c[_0x15fe5c(0x1b6)]+'\x20to\x20update')),_0x6c4c5b[_0x15fe5c(0x1b6)]>0x0&&console[_0x15fe5c(0x206)]('\x20\x20\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1e8)]('-\x20'+_0x6c4c5b['length']+_0x15fe5c(0x182))));console[_0x15fe5c(0x206)](_0x15fe5c(0x1ee)+a31_0x1a65e1[_0x15fe5c(0x1e6)](_0x3a82cb)+'\x0a');if(_0x4272b9[_0x15fe5c(0x1b6)]>0x0){console[_0x15fe5c(0x206)](_0x15fe5c(0x178));for(const _0x4ea13e of _0x4272b9){console[_0x15fe5c(0x206)]('\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1ae)]('+')+'\x20'+_0x4ea13e);}console['error']('');}if(_0x5c5729[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)])for(const _0x591d22 of _0x5c5729){const _0x409def=_0x591d22[_0x15fe5c(0x18c)]?_0x591d22[_0x15fe5c(0x18c)]+'/'+_0x591d22['yamlConfig'][_0x15fe5c(0x1c7)]:_0x591d22[_0x15fe5c(0x191)][_0x15fe5c(0x1c7)],_0x498807=_0x591d22['yamlConfig']['activations']?.[_0x15fe5c(0x1b6)]||0x0,_0x4ab1e6=_0x498807>0x0?a31_0x1a65e1[_0x15fe5c(0x1c8)]('\x20['+_0x498807+_0x15fe5c(0x203)):'';console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x17f)](_0x15fe5c(0x1e0))+'\x20'+_0x409def+_0x4ab1e6),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c)),_0x591d22[_0x15fe5c(0x1a9)]&&console['error'](_0x591d22[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c));}if(_0x575d00[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)])for(const _0x5ca8a0 of _0x575d00){const _0x1826bf=_0x5ca8a0[_0x15fe5c(0x1b2)]?_0x1ce742[_0x15fe5c(0x1ac)](_0x5ca8a0[_0x15fe5c(0x1b2)][_0x15fe5c(0x1f9)]())||'':'',_0x47b703=_0x1826bf?_0x1826bf+'/'+_0x5ca8a0[_0x15fe5c(0x1c7)]:_0x5ca8a0[_0x15fe5c(0x1c7)],_0x4ae487=_0x16e2f5[_0x15fe5c(0x1ac)](_0x5ca8a0['id'])||[],_0x4bfbd7=_0x4ae487[_0x15fe5c(0x1b6)]>0x0?a31_0x1a65e1[_0x15fe5c(0x1c8)]('\x20['+_0x4ae487[_0x15fe5c(0x1b6)]+'\x20activations]'):'';console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1a1))+'\x20'+_0x47b703+_0x4bfbd7),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));const _0x4b842c=segmentWithActivationsToYaml(_0x5ca8a0,_0x4ae487,undefined,_0x38bfad,_0x577d77),_0x192223=segmentToYamlString(_0x4b842c),_0x3671b8=generateDiff(_0x192223,'');console['error'](formatDiffWithColors(_0x3671b8)),console['error']('─'[_0x15fe5c(0x1e5)](0x3c));}const _0x199f88=_0x2fb2da[_0x15fe5c(0x1ca)](_0xe190b0=>!_0xe190b0['isNew']&&_0xe190b0['diff']);if(_0x199f88[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6['journeysOnly'])for(const _0x13d532 of _0x199f88){const _0x31385b=_0x13d532[_0x15fe5c(0x18c)]?_0x13d532[_0x15fe5c(0x18c)]+'/'+_0x13d532[_0x15fe5c(0x191)][_0x15fe5c(0x1c7)]:_0x13d532['yamlConfig'][_0x15fe5c(0x1c7)];console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x1c4)]('Changes\x20to:')+'\x20'+_0x31385b),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c)),console[_0x15fe5c(0x206)](_0x13d532[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));}if(_0xf32274['length']>0x0)for(const _0x3dca01 of _0xf32274){const _0x4fbf70=_0x3dca01[_0x15fe5c(0x18c)]?_0x3dca01[_0x15fe5c(0x18c)]+'/'+_0x3dca01[_0x15fe5c(0x191)][_0x15fe5c(0x1c7)]:_0x3dca01['yamlConfig'][_0x15fe5c(0x1c7)];console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x17f)](_0x15fe5c(0x18d))+'\x20'+_0x4fbf70),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c)),_0x3dca01[_0x15fe5c(0x1a9)]&&console[_0x15fe5c(0x206)](_0x3dca01[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));}const _0x27a919=_0x269e75['filter'](_0x707190=>!_0x707190[_0x15fe5c(0x1f6)]&&_0x707190[_0x15fe5c(0x1a9)]);if(_0x27a919[_0x15fe5c(0x1b6)]>0x0)for(const _0x395ff4 of _0x27a919){const _0x3b7905=_0x395ff4[_0x15fe5c(0x18c)]?_0x395ff4[_0x15fe5c(0x18c)]+'/'+_0x395ff4[_0x15fe5c(0x191)]['name']:_0x395ff4[_0x15fe5c(0x191)]['name'];console['error']('\x0a'+a31_0x1a65e1['yellow'](_0x15fe5c(0x17b))+'\x20'+_0x3b7905),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c)),console[_0x15fe5c(0x206)](_0x395ff4[_0x15fe5c(0x1a9)]),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c));}if(_0x2c2e7f['length']>0x0)for(const _0xbe8165 of _0x2c2e7f){const _0x10188b=_0xbe8165['folderId']?_0x1ce742[_0x15fe5c(0x1ac)](_0xbe8165['folderId'])||'':'',_0x5bf7a4=_0x10188b?_0x10188b+'/'+_0xbe8165[_0x15fe5c(0x1a7)]:_0xbe8165['journeyBundleName'];console[_0x15fe5c(0x206)]('\x0a'+a31_0x1a65e1[_0x15fe5c(0x1e8)](_0x15fe5c(0x1ea))+'\x20'+_0x5bf7a4),console[_0x15fe5c(0x206)]('─'['repeat'](0x3c)),console[_0x15fe5c(0x206)](a31_0x1a65e1['red'](_0x15fe5c(0x196))),console[_0x15fe5c(0x206)]('─'[_0x15fe5c(0x1e5)](0x3c));}if(_0x422ad6[_0x15fe5c(0x1f3)])return console['error'](a31_0x1a65e1['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x442a38=_0x422ad6[_0x15fe5c(0x176)]?![]:_0x5c5729[_0x15fe5c(0x1b6)]>0x0||_0xc1e05e[_0x15fe5c(0x1b6)]>0x0||_0x575d00['length']>0x0,_0x577676=_0xf32274[_0x15fe5c(0x1b6)]>0x0||_0x975a7c[_0x15fe5c(0x1b6)]>0x0||_0x2c2e7f[_0x15fe5c(0x1b6)]>0x0,_0x1fbb3a=_0x422ad6[_0x15fe5c(0x176)]?![]:_0x3d09e5['length']>0x0,_0x3c8539=_0x4272b9[_0x15fe5c(0x1b6)]>0x0;if(!_0x442a38&&!_0x577676&&!_0x1fbb3a&&!_0x3c8539){const _0x216bdb=_0x422ad6[_0x15fe5c(0x176)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x17f)](_0x216bdb));if(_0xd54682&&_0x4e925b[_0x15fe5c(0x1b6)]===0x1){const _0x245672=_0x4e925b[0x0];if(_0x245672[_0x15fe5c(0x1fb)]?.['id']){const _0x4775c3=getConsoleNextUrl(_0x422ad6[_0x15fe5c(0x1da)],_0x15fe5c(0x1c6)+_0xb30465+_0x15fe5c(0x1ef)+_0x245672[_0x15fe5c(0x1fb)]['id']+'/j/da/je');console[_0x15fe5c(0x206)]('\x20\x20'+a31_0x1a65e1['cyan'](_0x4775c3));}}return 0x0;}const _0x27da8e=_0x422ad6[_0x15fe5c(0x176)]?_0xf32274[_0x15fe5c(0x1b6)]+_0x975a7c[_0x15fe5c(0x1b6)]+_0x2c2e7f[_0x15fe5c(0x1b6)]+_0x4272b9['length']:_0x5c5729['length']+_0xc1e05e[_0x15fe5c(0x1b6)]+_0x575d00[_0x15fe5c(0x1b6)]+_0xf32274['length']+_0x975a7c['length']+_0x2c2e7f[_0x15fe5c(0x1b6)]+_0x4272b9[_0x15fe5c(0x1b6)]+_0x3d09e5['length'];if(!_0x422ad6[_0x15fe5c(0x1c5)]&&_0x27da8e>0x0){if(!isInteractive())return console[_0x15fe5c(0x206)](a31_0x1a65e1['red']('\x0aError:'),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c8)](_0x15fe5c(0x1cc))),0x1;const _0x3996f7=await confirmKey(_0x15fe5c(0x17d)+_0x27da8e+_0x15fe5c(0x1c2));if(!_0x3996f7)return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c4)]('Aborted.')),0x1;}const _0x3ea388={'withProgress':async(_0x47ac5b,_0x26e91f)=>{const _0xe2e518=_0x15fe5c,_0x5b7363=await withSpinner(_0x47ac5b,_0x26e91f,{'verbose':_0x422ad6[_0xe2e518(0x1e2)]});return{'data':_0x5b7363['data']};},'logInfo':_0x5a8463=>console[_0x15fe5c(0x206)](a31_0x1a65e1['blue']('✔\x20'+_0x5a8463)),'logSuccess':_0x2815f2=>console[_0x15fe5c(0x206)](a31_0x1a65e1['green']('✔\x20'+_0x2815f2)),'logWarning':_0x53fafe=>console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x1c4)]('⚠\x20'+_0x53fafe)),'logDeleted':_0x5b95f7=>console['error'](a31_0x1a65e1[_0x15fe5c(0x1e8)]('✔\x20'+_0x5b95f7))},_0x1db2da={'segment':_0x576f2d[_0x15fe5c(0x19a)],'journey':_0x576f2d[_0x15fe5c(0x1cb)],'user':_0x576f2d[_0x15fe5c(0x175)],'connection':_0x576f2d['connection']};_0x4272b9['length']>0x0&&(_0xd114e=await executePushFolders(_0x1db2da,_0x4272b9,_0xd114e,{'parentId':_0xb30465},_0x3ea388));const _0x68269e={'rootFolderId':_0x34dade,'folderPathToId':_0xd114e,'folderIdToPath':_0x1ce742,'segmentNameToId':_0x275b9a,'activationsBySegmentId':_0x16e2f5,'emailToIdMap':_0x572b7f,'idToEmailMap':_0x38bfad,'connectionNameToIdMap':_0xe652b1[_0x15fe5c(0x1d5)],'connectionIdToNameMap':_0xe652b1[_0x15fe5c(0x1b9)],'connectionNameToTypeMap':_0x548cef},_0xe7ddd=await executePushSegments(_0x1db2da,_0x422ad6['journeysOnly']?[]:_0x2fb2da,_0x68269e,{'parentId':_0xb30465},_0x3ea388),_0x3c2f16=_0xe7ddd[_0x15fe5c(0x18f)],_0x550a3b=_0xe7ddd[_0x15fe5c(0x195)],_0x30a8f0=_0xe7ddd[_0x15fe5c(0x1de)][_0x15fe5c(0x18f)],_0x10743f=_0xe7ddd['activations']['updated'],_0x5585a2=_0xe7ddd[_0x15fe5c(0x1de)][_0x15fe5c(0x177)],_0x29ec8d=await executePushSegmentDeletions(_0x1db2da,_0x422ad6[_0x15fe5c(0x176)]?[]:_0x575d00,_0x3ea388);let _0x4da51c=0x0,_0x3d500c=0x0,_0x4f231d=0x0;const _0x27e9b0=new Map(_0x275b9a);for(const [_0x27a4e4,_0x13dab8]of _0xe7ddd[_0x15fe5c(0x1bf)]){_0x27e9b0['set'](_0x27a4e4,_0x13dab8);}if(_0x269e75['length']>0x0){const _0x2aeea1={..._0x68269e,'segmentNameToId':_0x27e9b0,'existingSegments':_0x599cdf,'activationContext':_0x4a1e37},_0x3d2e52=await executePushJourneys(_0x1db2da,_0x269e75,_0x2aeea1,{'parentId':_0xb30465,'rootFolderId':_0x34dade,'verbose':_0x422ad6[_0x15fe5c(0x1e2)]},_0x3ea388);_0x4da51c=_0x3d2e52['created'],_0x3d500c=_0x3d2e52[_0x15fe5c(0x195)];if(_0xd54682&&_0x3d2e52['results'][_0x15fe5c(0x1b6)]===0x1){const _0x1e0786=_0x3d2e52['results'][0x0];if(_0x1e0786[_0x15fe5c(0x179)]){const _0xf02618=getConsoleNextUrl(_0x422ad6[_0x15fe5c(0x1da)],_0x15fe5c(0x1c6)+_0xb30465+'/e/'+_0x1e0786[_0x15fe5c(0x179)]+'/j/da/je');console['error']('\x20\x20'+a31_0x1a65e1[_0x15fe5c(0x1e6)](_0xf02618));}}}for(const _0x586ef1 of _0x2c2e7f){console['error'](a31_0x1a65e1[_0x15fe5c(0x1c4)](_0x15fe5c(0x1e1)+_0x586ef1[_0x15fe5c(0x1a7)])),_0x4f231d++;}const _0x33aa5f=[];if(_0x3c2f16>0x0)_0x33aa5f[_0x15fe5c(0x1be)](_0x3c2f16+_0x15fe5c(0x1f8));if(_0x550a3b>0x0)_0x33aa5f[_0x15fe5c(0x1be)](_0x550a3b+_0x15fe5c(0x1fc));if(_0x29ec8d>0x0)_0x33aa5f[_0x15fe5c(0x1be)](_0x29ec8d+_0x15fe5c(0x192));const _0x22bb54=[];if(_0x4da51c>0x0)_0x22bb54[_0x15fe5c(0x1be)](_0x4da51c+'\x20created');if(_0x3d500c>0x0)_0x22bb54[_0x15fe5c(0x1be)](_0x3d500c+_0x15fe5c(0x1fc));if(_0x4f231d>0x0)_0x22bb54[_0x15fe5c(0x1be)](_0x4f231d+_0x15fe5c(0x192));const _0x472489=[];if(_0x30a8f0>0x0)_0x472489[_0x15fe5c(0x1be)](_0x30a8f0+_0x15fe5c(0x1f8));if(_0x10743f>0x0)_0x472489[_0x15fe5c(0x1be)](_0x10743f+'\x20updated');if(_0x5585a2>0x0)_0x472489[_0x15fe5c(0x1be)](_0x5585a2+_0x15fe5c(0x192));return console[_0x15fe5c(0x206)](a31_0x1a65e1[_0x15fe5c(0x17f)](_0x15fe5c(0x1df))),_0x33aa5f['length']>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&console[_0x15fe5c(0x206)]('\x20\x20Segments:\x20'+_0x33aa5f['join'](',\x20')),_0x22bb54['length']>0x0&&console[_0x15fe5c(0x206)]('\x20\x20Journeys:\x20'+_0x22bb54['join'](',\x20')),_0x472489[_0x15fe5c(0x1b6)]>0x0&&!_0x422ad6[_0x15fe5c(0x176)]&&console[_0x15fe5c(0x206)](_0x15fe5c(0x200)+_0x472489[_0x15fe5c(0x197)](',\x20')),0x0;}}
|
|
1
|
+
const a31_0x169478=a31_0x3669;(function(_0x312aa7,_0x20d3f5){const _0x534774=a31_0x3669,_0x48e840=_0x312aa7();while(!![]){try{const _0x384561=-parseInt(_0x534774(0xf0))/0x1+parseInt(_0x534774(0xde))/0x2*(-parseInt(_0x534774(0x150))/0x3)+-parseInt(_0x534774(0x152))/0x4*(parseInt(_0x534774(0x139))/0x5)+parseInt(_0x534774(0xf7))/0x6*(-parseInt(_0x534774(0x14d))/0x7)+-parseInt(_0x534774(0x11d))/0x8+-parseInt(_0x534774(0xf3))/0x9+-parseInt(_0x534774(0xcd))/0xa*(-parseInt(_0x534774(0xd9))/0xb);if(_0x384561===_0x20d3f5)break;else _0x48e840['push'](_0x48e840['shift']());}catch(_0x14a53b){_0x48e840['push'](_0x48e840['shift']());}}}(a31_0x4097,0xae3e3));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';function a31_0x4097(){const _0x222b96=['New\x20segment:','message','\x20updated','filePath','diff','\x0aError:','segment','listFolders','\x20\x20📊\x20Segments:','state','\x20\x20Source:\x20','\x20created','segments','type','journeyBundleName','no_parent','segmentFolderId','\x20changed','toUpdate','filter','resolveParentId','description','green','\x20to\x20delete','62325FCpASI','\x20YAML\x20files\x20found','\x20\x20\x20\x20','targetDir','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','connection','Push\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','list','created','No\x20','push','listActivations','yellow','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','journeysOnly','getJourney','length','repeat','/app/ps/','7AveSxI','listSegments','parentFolder','21639vRSGiK','audienceId','252nmwoFp','verbose','errorCode','new','folderId','\x20\x20Segments:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','toCreate','then','get','parentSegment','\x27...','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20to\x20update','add','📁\x20','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','scopedFolderPath','data','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','attributes','updatedAt','5400qMmuqS','error','Delete\x20segment:','Preparing\x20journeys...','journeys','Aborted.','updated','dim','Error:\x20','\x20\x20Activations:\x20','yamlConfig','deleted','145420InBvPa','cyan','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','idToName','journey','272iATlXF','\x20folders\x20to\x20create','set','map','yes','name','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','helpText','/e/','delete','\x20new','activations','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','createdAt','user','\x0aPush\x20summary\x20for\x20\x27','Fetching\x20parent\x20segment\x20details...','Fetching\x20existing\x20activations...','647890LZtYha','Fetching\x20connections\x20for\x20name\x20resolution...','endsWith','12755430TtyFYC','Parent\x20segment:\x20','Error:\x20Directory\x20not\x20found:\x20','(Journey\x20will\x20be\x20deleted)','7960968zFCrGV','createdSegmentIds','\x20\x20🗺️\x20\x20Journeys:','isNew','Site:\x20','changed','Changes\x20to\x20journey:','\x20\x20Journeys:\x20','folderPath','Fetching\x20existing\x20journeys...','paused','join','\x20activations]','Source\x20directory:\x20','toDelete','parent_name','unchanged','New\x20journey:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','\x20deleted','parentName','\x20unchanged','journeyId','results','Fetching\x20existing\x20folders...','execute','/j/da/je','Delete\x20journey:','red','relationships','all','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Folders\x20to\x20create:','versionNumber','\x20changes?','\x20\x20Activations:','blue','segment\x20or\x20journey','10134800IHjlFd','dryRun','toString','\x20to\x20create'];a31_0x4097=function(){return _0x222b96;};return a31_0x4097();}function a31_0x3669(_0x11d7c7,_0x2c64d1){_0x11d7c7=_0x11d7c7-0xcd;const _0x409780=a31_0x4097();let _0x36691f=_0x409780[_0x11d7c7];return _0x36691f;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x26bb35 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{['name']='segment:push';[a31_0x169478(0x136)]=a31_0x169478(0x116);async[a31_0x169478(0x110)](_0x421f63){const _0xe33fd3=a31_0x169478,{options:_0x576d50,args:_0xabb22f,tdx:_0x2b1b08}=_0x421f63,_0x37f112=_0x576d50,_0x5b573f=await resolveTarget({'arg':_0xabb22f[0x0],'contextParent':_0x576d50[_0xe33fd3(0x15c)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5b573f))return _0x5b573f[_0xe33fd3(0x154)]===_0xe33fd3(0x130)?(console[_0xe33fd3(0xce)](a31_0x26bb35['yellow'](_0xe33fd3(0x162))),console['error']('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0xe33fd3(0xce)](_0xe33fd3(0x140)),console[_0xe33fd3(0xce)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file')):(console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0x113)](_0xe33fd3(0xd5)+_0x5b573f['message']+'\x0a')),_0x5b573f[_0xe33fd3(0xe5)]&&console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0xda)](_0x5b573f[_0xe33fd3(0xe5)]))),0x1;if(_0x5b573f[_0xe33fd3(0x12e)]===_0xe33fd3(0x106))return console['error'](a31_0x26bb35[_0xe33fd3(0x113)](_0xe33fd3(0xf5)+_0x5b573f[_0xe33fd3(0x13c)]+'\x0a')),console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0xda)](_0xe33fd3(0x165))),0x1;const _0x44871e=_0x5b573f[_0xe33fd3(0x10b)],_0xdf912c=_0x5b573f[_0xe33fd3(0x13c)],_0x203e5b=_0x5b573f['type']==='file'?_0x5b573f[_0xe33fd3(0x124)]:undefined,_0x16a4b2=getScopedDetails(_0x5b573f),_0x868758=_0x16a4b2?.['isScoped']??![],_0xc117c2=_0x16a4b2?.[_0xe33fd3(0x163)]??'';if(!existsSync(_0xdf912c))return console['error'](a31_0x26bb35[_0xe33fd3(0x113)](_0xe33fd3(0xf5)+_0xdf912c+'\x0a')),console['error'](a31_0x26bb35['cyan'](_0xe33fd3(0x165))),0x1;_0x37f112[_0xe33fd3(0x153)]&&(console[_0xe33fd3(0xce)](_0xe33fd3(0xfb)+_0x37f112['site']),console[_0xe33fd3(0xce)](_0xe33fd3(0xf4)+_0x44871e),console[_0xe33fd3(0xce)](_0xe33fd3(0x104)+_0xdf912c),_0x868758&&console['error']('Scoped\x20to\x20folder:\x20'+_0xc117c2));const _0x29d181=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x44871e+_0xe33fd3(0x15d),()=>_0x2b1b08[_0xe33fd3(0x127)][_0xe33fd3(0x135)](_0x44871e),{'verbose':_0x37f112[_0xe33fd3(0x153)]}),_0x14df1c=_0x29d181[_0xe33fd3(0x164)],[_0x1ac831,_0x250ee3,_0x95e1a5,_0x2a4f95,_0x3461df]=await Promise[_0xe33fd3(0x115)]([withSpinner(_0xe33fd3(0xee),()=>_0x2b1b08['segment']['getParent'](_0x14df1c),{'verbose':_0x37f112[_0xe33fd3(0x153)]}),withSpinner('Fetching\x20existing\x20segments...',()=>_0x2b1b08[_0xe33fd3(0x127)][_0xe33fd3(0x14e)](_0x14df1c),{'verbose':_0x37f112[_0xe33fd3(0x153)]}),withSpinner(_0xe33fd3(0x10f),()=>_0x2b1b08[_0xe33fd3(0x127)][_0xe33fd3(0x128)](_0x14df1c),{'verbose':_0x37f112[_0xe33fd3(0x153)]}),withSpinner(_0xe33fd3(0x100),()=>_0x2b1b08[_0xe33fd3(0xdd)]['listJourneysWithDetailsFromParentSegment'](_0x14df1c,{'includeAllVersions':!![]}),{'verbose':_0x37f112['verbose']}),withSpinner('Fetching\x20users\x20for\x20email\x20resolution...',()=>_0x2b1b08[_0xe33fd3(0xec)]['buildUserMaps'](),{'verbose':_0x37f112[_0xe33fd3(0x153)]})[_0xe33fd3(0x15a)](_0x338da5=>_0x338da5[_0xe33fd3(0x164)])]),_0x30b320=_0x1ac831[_0xe33fd3(0x164)],_0x42c854=extractRootFolderId(_0x30b320),_0xf9780f=_0x250ee3[_0xe33fd3(0x164)],_0x18b999=_0x95e1a5['data'],{journeys:_0x237444,activationStepsById:_0xcfde81}=_0x2a4f95['data'],_0x378590=new Map(_0x237444[_0xe33fd3(0xe1)](_0x4c18ae=>[_0x4c18ae['id'],_0x4c18ae])),_0x3bf9f4=_0x237444[_0xe33fd3(0xe1)](_0xe41177=>({'id':_0xe41177['id'],'name':_0xe41177[_0xe33fd3(0x166)][_0xe33fd3(0xe3)],'journeyBundleName':_0xe41177[_0xe33fd3(0x166)][_0xe33fd3(0x12f)]||'','journeyBundleId':_0xe41177[_0xe33fd3(0x166)]['journeyBundleId']||'','versionNumber':_0xe41177['attributes'][_0xe33fd3(0x118)],'description':_0xe41177[_0xe33fd3(0x166)][_0xe33fd3(0x136)],'state':_0xe41177[_0xe33fd3(0x166)][_0xe33fd3(0x12a)],'paused':_0xe41177[_0xe33fd3(0x166)][_0xe33fd3(0x101)],'audienceId':_0xe41177[_0xe33fd3(0x166)][_0xe33fd3(0x151)],'folderId':_0xe41177[_0xe33fd3(0x114)]?.[_0xe33fd3(0x14f)]?.[_0xe33fd3(0x164)]?.['id'],'createdAt':_0xe41177[_0xe33fd3(0x166)][_0xe33fd3(0xeb)],'updatedAt':_0xe41177[_0xe33fd3(0x166)][_0xe33fd3(0x167)]})),{emailToId:_0x5274ba,idToEmail:_0x40e34b}=_0x3461df,_0x1de229=await withSpinner(_0xe33fd3(0xf1),async()=>{const _0x130e10=_0xe33fd3,_0x2a9b5d=await _0x2b1b08['connection'][_0x130e10(0x141)]();return buildConnectionMaps(_0x2a9b5d);},{'verbose':_0x37f112['verbose']})['then'](_0xc0fc82=>_0xc0fc82['data']),_0x2c4a84=_0x1de229['nameToId'],_0x42d780=_0x1de229['idToName'],_0x2e4eb0=_0x1de229['nameToType'],_0x40af41={'emailToIdMap':_0x5274ba,'connectionNameToIdMap':_0x2c4a84,'connectionNameToTypeMap':_0x2e4eb0,'getSchema':_0x439de8=>_0x2b1b08[_0xe33fd3(0x13e)]['getOutputSchemaWithCache'](_0x439de8)};let {pathToId:_0x3b22c6,idToPath:_0xc64af3}=buildFolderMaps(_0x18b999);const _0x431ddb=buildSegmentLookupMap(_0xf9780f,_0xc64af3),_0x53107f=buildSegmentNameToIdMap(_0xf9780f),_0x5cb436=buildJourneyBundleLookupMap(_0x3bf9f4,_0xc64af3);let _0x67de71;if(_0x203e5b){if(!_0x203e5b[_0xe33fd3(0xf2)]('.yml')&&!_0x203e5b['endsWith']('.yaml'))return console['error'](a31_0x26bb35[_0xe33fd3(0x113)](_0xe33fd3(0x147)+_0x203e5b+'\x0a')),0x1;_0x67de71=[_0x203e5b];}else _0x67de71=findYamlFiles(_0xdf912c);if(_0x67de71[_0xe33fd3(0x14a)]===0x0)return console['error'](a31_0x26bb35[_0xe33fd3(0x113)](_0xe33fd3(0xea)+_0xdf912c+'\x0a')),console['error'](a31_0x26bb35[_0xe33fd3(0xda)](_0xe33fd3(0x158))),0x1;let _0x4311db,_0x531b16;try{const _0x33c8fe=parseAndClassifyYamlFiles(_0x67de71,_0xdf912c,{'skipSegments':_0x37f112[_0xe33fd3(0x148)]});_0x4311db=_0x33c8fe[_0xe33fd3(0x12d)],_0x531b16=_0x33c8fe[_0xe33fd3(0xd1)];const _0x3530d8=validateParsedFiles(_0x33c8fe,_0xdf912c);if(_0x3530d8['length']>0x0)return console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0x113)]('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x3530d8)),console[_0xe33fd3(0xce)](a31_0x26bb35['yellow'](_0xe33fd3(0x15e))),0x1;}catch(_0x116806){return console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0x113)]('Error\x20parsing\x20YAML:\x20'+(_0x116806 instanceof Error?_0x116806[_0xe33fd3(0x122)]:_0x116806))),0x1;}if(_0x4311db[_0xe33fd3(0x14a)]===0x0&&_0x531b16['length']===0x0){const _0x3f792e=_0x37f112[_0xe33fd3(0x148)]?_0xe33fd3(0xdd):_0xe33fd3(0x11c);return console[_0xe33fd3(0xce)](a31_0x26bb35['yellow'](_0xe33fd3(0x143)+_0x3f792e+_0xe33fd3(0x13a))),0x0;}const _0x15606c=new Map();_0xf9780f['length']>0x0&&!_0x37f112[_0xe33fd3(0x148)]&&await withSpinner(_0xe33fd3(0xef),async()=>{await batchAsync(_0xf9780f,async _0x246c90=>{const _0x259376=a31_0x3669,_0x555386=await _0x2b1b08[_0x259376(0x127)][_0x259376(0x145)](_0x14df1c,_0x246c90['id']);_0x15606c[_0x259376(0xe0)](_0x246c90['id'],_0x555386);});},{'verbose':_0x37f112['verbose']});const {segmentFiles:_0x1415ac,foldersToCreate:_0x56409d}=await prepareSegmentFiles(_0x4311db,{'segmentByFolderAndName':_0x431ddb,'activationsBySegmentId':_0x15606c,'folderPathToId':_0x3b22c6,'idToEmailMap':_0x40e34b,'connectionIdToNameMap':_0x42d780},_0x40af41,_0x868758,_0xc117c2),_0x284981=_0x203e5b?[]:findSegmentsToDelete(_0xf9780f,_0x4311db[_0xe33fd3(0xe1)](({yamlConfig:_0xba1b58,folderPath:_0x1a1ac1})=>({'yamlConfig':_0xba1b58,'folderPath':resolveTDFolderPath(_0x1a1ac1,_0x868758,_0xc117c2)})),_0xc64af3,_0xc117c2,_0x868758),{journeyFiles:_0x4970a7,foldersToCreate:_0x18ea4d}=await withProgressSpinner(_0xe33fd3(0xd0),async _0x386e30=>prepareJourneyFiles(_0x531b16,{'fetchJourney':async _0x1609a2=>_0x2b1b08['journey'][_0xe33fd3(0x149)](_0x1609a2[_0xe33fd3(0x10d)]),'journeyBundlesByFolderAndName':_0x5cb436,'folderPathToId':_0x3b22c6,'idToEmailMap':_0x40e34b,'connectionIdToNameMap':_0x42d780,'existingSegments':_0xf9780f,'parentId':_0x14df1c,'deps':_0x2b1b08,'progress':{'update':_0x2ee6f9=>{const _0x182c6c=_0xe33fd3;_0x386e30['setPhase'](_0x2ee6f9),_0x37f112[_0x182c6c(0x153)]&&console[_0x182c6c(0xce)]('\x20\x20'+_0x2ee6f9);}},'journeyById':_0x378590,'activationStepsById':_0xcfde81},_0x868758,_0xc117c2),{'verbose':_0x37f112['verbose']})[_0xe33fd3(0x15a)](_0x405526=>_0x405526[_0xe33fd3(0x164)]);for(const _0xefc7f of _0x18ea4d){_0x56409d[_0xe33fd3(0x160)](_0xefc7f);}const _0x5f085f=_0x203e5b?[]:findJourneysToDelete(_0x3bf9f4,_0x531b16['map'](({yamlConfig:_0x314873,folderPath:_0x2197b6})=>({'yamlConfig':_0x314873,'folderPath':resolveTDFolderPath(_0x2197b6,_0x868758,_0xc117c2)})),_0xc64af3,_0xc117c2,_0x868758),_0x493128=calculatePushStats(_0x1415ac,_0x4970a7,_0x56409d,_0x284981,_0x5f085f,!!_0x37f112[_0xe33fd3(0xe7)],!!_0x37f112[_0xe33fd3(0x148)]),_0x528d95=_0x493128['segments']['new'],_0x3bbec0=_0x493128[_0xe33fd3(0x12d)][_0xe33fd3(0xfc)],_0x3b9c20=_0x493128[_0xe33fd3(0x12d)]['unchanged'],_0xa62c7f=_0x493128[_0xe33fd3(0x12d)][_0xe33fd3(0x105)],_0x140697=_0x493128['folders'][_0xe33fd3(0x159)],_0xbfc2e0=_0x493128[_0xe33fd3(0xd1)][_0xe33fd3(0x155)],_0x5ead04=_0x493128[_0xe33fd3(0xd1)][_0xe33fd3(0xfc)],_0x2d63ac=_0x493128[_0xe33fd3(0xd1)][_0xe33fd3(0x107)],_0xb28c3f=_0x493128[_0xe33fd3(0xd1)][_0xe33fd3(0x105)],_0x174b36=_0x493128[_0xe33fd3(0xe9)][_0xe33fd3(0x115)],_0x53efa1=_0x493128[_0xe33fd3(0xe9)]['toCreate'],_0x192fe6=_0x493128[_0xe33fd3(0xe9)][_0xe33fd3(0x133)],_0x25cb4d=_0x493128['activations']['toDelete'];console[_0xe33fd3(0xce)](_0xe33fd3(0xed)+_0x44871e+'\x27:');_0x140697[_0xe33fd3(0x14a)]>0x0&&console[_0xe33fd3(0xce)]('\x20\x20'+a31_0x26bb35[_0xe33fd3(0x11b)](_0xe33fd3(0x161)+_0x140697[_0xe33fd3(0x14a)]+_0xe33fd3(0xdf)));if(!_0x37f112[_0xe33fd3(0x148)]){console[_0xe33fd3(0xce)](_0xe33fd3(0x129)),console[_0xe33fd3(0xce)](_0xe33fd3(0x13b)+a31_0x26bb35[_0xe33fd3(0x137)]('+\x20'+_0x528d95['length']+_0xe33fd3(0xe8))),console['error'](_0xe33fd3(0x13b)+a31_0x26bb35[_0xe33fd3(0x146)]('~\x20'+_0x3bbec0[_0xe33fd3(0x14a)]+_0xe33fd3(0x132)));if(_0xa62c7f[_0xe33fd3(0x14a)]>0x0)console[_0xe33fd3(0xce)]('\x20\x20\x20\x20'+a31_0x26bb35['red']('-\x20'+_0xa62c7f['length']+_0xe33fd3(0x138)));else _0x284981[_0xe33fd3(0x14a)]>0x0&&!_0x37f112['delete']&&console[_0xe33fd3(0xce)]('\x20\x20\x20\x20'+a31_0x26bb35[_0xe33fd3(0xd4)](_0x284981[_0xe33fd3(0x14a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0xe33fd3(0x13b)+a31_0x26bb35[_0xe33fd3(0xd4)]('=\x20'+_0x3b9c20[_0xe33fd3(0x14a)]+_0xe33fd3(0x10c)));}if(_0x4970a7['length']>0x0||_0x5f085f[_0xe33fd3(0x14a)]>0x0){console['error'](_0xe33fd3(0xf9)),console[_0xe33fd3(0xce)](_0xe33fd3(0x13b)+a31_0x26bb35['green']('+\x20'+_0xbfc2e0['length']+_0xe33fd3(0xe8))),console[_0xe33fd3(0xce)](_0xe33fd3(0x13b)+a31_0x26bb35[_0xe33fd3(0x146)]('~\x20'+_0x5ead04[_0xe33fd3(0x14a)]+_0xe33fd3(0x132)));if(_0xb28c3f[_0xe33fd3(0x14a)]>0x0)console[_0xe33fd3(0xce)](_0xe33fd3(0x13b)+a31_0x26bb35[_0xe33fd3(0x113)]('-\x20'+_0xb28c3f['length']+_0xe33fd3(0x138)));else _0x5f085f[_0xe33fd3(0x14a)]>0x0&&!_0x37f112['delete']&&console[_0xe33fd3(0xce)](_0xe33fd3(0x13b)+a31_0x26bb35[_0xe33fd3(0xd4)](_0x5f085f[_0xe33fd3(0x14a)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0xe33fd3(0xce)](_0xe33fd3(0x13b)+a31_0x26bb35[_0xe33fd3(0xd4)]('=\x20'+_0x2d63ac[_0xe33fd3(0x14a)]+_0xe33fd3(0x10c)));}_0x174b36[_0xe33fd3(0x14a)]>0x0&&!_0x37f112[_0xe33fd3(0x148)]&&(console['error'](''),console[_0xe33fd3(0xce)](_0xe33fd3(0x11a)),_0x53efa1[_0xe33fd3(0x14a)]>0x0&&console['error']('\x20\x20\x20\x20'+a31_0x26bb35[_0xe33fd3(0x137)]('+\x20'+_0x53efa1[_0xe33fd3(0x14a)]+_0xe33fd3(0x120))),_0x192fe6[_0xe33fd3(0x14a)]>0x0&&console[_0xe33fd3(0xce)](_0xe33fd3(0x13b)+a31_0x26bb35[_0xe33fd3(0x146)]('~\x20'+_0x192fe6[_0xe33fd3(0x14a)]+_0xe33fd3(0x15f))),_0x25cb4d['length']>0x0&&console[_0xe33fd3(0xce)](_0xe33fd3(0x13b)+a31_0x26bb35[_0xe33fd3(0x113)]('-\x20'+_0x25cb4d[_0xe33fd3(0x14a)]+'\x20to\x20delete')));console[_0xe33fd3(0xce)](_0xe33fd3(0x12b)+a31_0x26bb35[_0xe33fd3(0xda)](_0xdf912c)+'\x0a');if(_0x140697[_0xe33fd3(0x14a)]>0x0){console[_0xe33fd3(0xce)](_0xe33fd3(0x117));for(const _0xe72f0e of _0x140697){console[_0xe33fd3(0xce)]('\x20\x20'+a31_0x26bb35[_0xe33fd3(0x11b)]('+')+'\x20'+_0xe72f0e);}console[_0xe33fd3(0xce)]('');}if(_0x528d95[_0xe33fd3(0x14a)]>0x0&&!_0x37f112['journeysOnly'])for(const _0x33e352 of _0x528d95){const _0xee4caa=_0x33e352[_0xe33fd3(0xff)]?_0x33e352[_0xe33fd3(0xff)]+'/'+_0x33e352['yamlConfig'][_0xe33fd3(0xe3)]:_0x33e352[_0xe33fd3(0xd7)][_0xe33fd3(0xe3)],_0x5728a8=_0x33e352[_0xe33fd3(0xd7)][_0xe33fd3(0xe9)]?.['length']||0x0,_0x402cc7=_0x5728a8>0x0?a31_0x26bb35[_0xe33fd3(0xd4)]('\x20['+_0x5728a8+_0xe33fd3(0x103)):'';console[_0xe33fd3(0xce)]('\x0a'+a31_0x26bb35[_0xe33fd3(0x137)](_0xe33fd3(0x121))+'\x20'+_0xee4caa+_0x402cc7),console[_0xe33fd3(0xce)]('─'['repeat'](0x3c)),_0x33e352['diff']&&console[_0xe33fd3(0xce)](_0x33e352[_0xe33fd3(0x125)]),console[_0xe33fd3(0xce)]('─'[_0xe33fd3(0x14b)](0x3c));}if(_0xa62c7f['length']>0x0&&!_0x37f112[_0xe33fd3(0x148)])for(const _0x58081a of _0xa62c7f){const _0x57ebe4=_0x58081a[_0xe33fd3(0x131)]?_0xc64af3[_0xe33fd3(0x15b)](_0x58081a[_0xe33fd3(0x131)][_0xe33fd3(0x11f)]())||'':'',_0x51262=_0x57ebe4?_0x57ebe4+'/'+_0x58081a[_0xe33fd3(0xe3)]:_0x58081a[_0xe33fd3(0xe3)],_0x81f942=_0x15606c[_0xe33fd3(0x15b)](_0x58081a['id'])||[],_0x528d41=_0x81f942['length']>0x0?a31_0x26bb35[_0xe33fd3(0xd4)]('\x20['+_0x81f942[_0xe33fd3(0x14a)]+_0xe33fd3(0x103)):'';console[_0xe33fd3(0xce)]('\x0a'+a31_0x26bb35[_0xe33fd3(0x113)](_0xe33fd3(0xcf))+'\x20'+_0x51262+_0x528d41),console[_0xe33fd3(0xce)]('─'['repeat'](0x3c));const _0x4591ea=segmentWithActivationsToYaml(_0x58081a,_0x81f942,undefined,_0x40e34b,_0x42d780),_0x43c059=segmentToYamlString(_0x4591ea),_0x6324d8=generateDiff(_0x43c059,'');console[_0xe33fd3(0xce)](formatDiffWithColors(_0x6324d8)),console[_0xe33fd3(0xce)]('─'[_0xe33fd3(0x14b)](0x3c));}const _0x27031a=_0x1415ac[_0xe33fd3(0x134)](_0xbb9eb2=>!_0xbb9eb2[_0xe33fd3(0xfa)]&&_0xbb9eb2[_0xe33fd3(0x125)]);if(_0x27031a['length']>0x0&&!_0x37f112['journeysOnly'])for(const _0x1375ce of _0x27031a){const _0x5214e4=_0x1375ce[_0xe33fd3(0xff)]?_0x1375ce['folderPath']+'/'+_0x1375ce[_0xe33fd3(0xd7)][_0xe33fd3(0xe3)]:_0x1375ce['yamlConfig'][_0xe33fd3(0xe3)];console['error']('\x0a'+a31_0x26bb35[_0xe33fd3(0x146)]('Changes\x20to:')+'\x20'+_0x5214e4),console[_0xe33fd3(0xce)]('─'[_0xe33fd3(0x14b)](0x3c)),console[_0xe33fd3(0xce)](_0x1375ce[_0xe33fd3(0x125)]),console[_0xe33fd3(0xce)]('─'[_0xe33fd3(0x14b)](0x3c));}if(_0xbfc2e0[_0xe33fd3(0x14a)]>0x0)for(const _0x3303f1 of _0xbfc2e0){const _0x110875=_0x3303f1['folderPath']?_0x3303f1['folderPath']+'/'+_0x3303f1[_0xe33fd3(0xd7)][_0xe33fd3(0xe3)]:_0x3303f1[_0xe33fd3(0xd7)]['name'];console['error']('\x0a'+a31_0x26bb35['green'](_0xe33fd3(0x108))+'\x20'+_0x110875),console[_0xe33fd3(0xce)]('─'[_0xe33fd3(0x14b)](0x3c)),_0x3303f1[_0xe33fd3(0x125)]&&console[_0xe33fd3(0xce)](_0x3303f1[_0xe33fd3(0x125)]),console['error']('─'[_0xe33fd3(0x14b)](0x3c));}const _0x291f96=_0x4970a7[_0xe33fd3(0x134)](_0x5de010=>!_0x5de010[_0xe33fd3(0xfa)]&&_0x5de010['diff']);if(_0x291f96['length']>0x0)for(const _0x3908d0 of _0x291f96){const _0x499b99=_0x3908d0[_0xe33fd3(0xff)]?_0x3908d0[_0xe33fd3(0xff)]+'/'+_0x3908d0[_0xe33fd3(0xd7)][_0xe33fd3(0xe3)]:_0x3908d0['yamlConfig'][_0xe33fd3(0xe3)];console[_0xe33fd3(0xce)]('\x0a'+a31_0x26bb35[_0xe33fd3(0x146)](_0xe33fd3(0xfd))+'\x20'+_0x499b99),console['error']('─'[_0xe33fd3(0x14b)](0x3c)),console[_0xe33fd3(0xce)](_0x3908d0[_0xe33fd3(0x125)]),console['error']('─'['repeat'](0x3c));}if(_0xb28c3f[_0xe33fd3(0x14a)]>0x0)for(const _0x53524d of _0xb28c3f){const _0x10ad2d=_0x53524d['folderId']?_0xc64af3['get'](_0x53524d[_0xe33fd3(0x156)])||'':'',_0x11baf6=_0x10ad2d?_0x10ad2d+'/'+_0x53524d['journeyBundleName']:_0x53524d[_0xe33fd3(0x12f)];console['error']('\x0a'+a31_0x26bb35[_0xe33fd3(0x113)](_0xe33fd3(0x112))+'\x20'+_0x11baf6),console[_0xe33fd3(0xce)]('─'[_0xe33fd3(0x14b)](0x3c)),console['error'](a31_0x26bb35[_0xe33fd3(0x113)](_0xe33fd3(0xf6))),console['error']('─'[_0xe33fd3(0x14b)](0x3c));}if(_0x37f112[_0xe33fd3(0x11e)])return console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0x146)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x18c46f=_0x37f112['journeysOnly']?![]:_0x528d95[_0xe33fd3(0x14a)]>0x0||_0x3bbec0[_0xe33fd3(0x14a)]>0x0||_0xa62c7f[_0xe33fd3(0x14a)]>0x0,_0x43b613=_0xbfc2e0[_0xe33fd3(0x14a)]>0x0||_0x5ead04[_0xe33fd3(0x14a)]>0x0||_0xb28c3f[_0xe33fd3(0x14a)]>0x0,_0x509f7e=_0x37f112['journeysOnly']?![]:_0x174b36['length']>0x0,_0x485b09=_0x140697[_0xe33fd3(0x14a)]>0x0;if(!_0x18c46f&&!_0x43b613&&!_0x509f7e&&!_0x485b09){const _0x1404aa=_0x37f112[_0xe33fd3(0x148)]?_0xe33fd3(0x13d):_0xe33fd3(0xe4);console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0x137)](_0x1404aa));if(_0x203e5b&&_0x2d63ac[_0xe33fd3(0x14a)]===0x1){const _0x2ebd81=_0x2d63ac[0x0];if(_0x2ebd81['existingJourney']?.['id']){const _0x9a9136=getConsoleNextUrl(_0x37f112['site'],_0xe33fd3(0x14c)+_0x14df1c+_0xe33fd3(0xe6)+_0x2ebd81['existingJourney']['id']+_0xe33fd3(0x111));console[_0xe33fd3(0xce)]('\x20\x20'+a31_0x26bb35[_0xe33fd3(0xda)](_0x9a9136));}}return 0x0;}const _0x4d0827=_0x37f112[_0xe33fd3(0x148)]?_0xbfc2e0[_0xe33fd3(0x14a)]+_0x5ead04[_0xe33fd3(0x14a)]+_0xb28c3f[_0xe33fd3(0x14a)]+_0x140697['length']:_0x528d95[_0xe33fd3(0x14a)]+_0x3bbec0['length']+_0xa62c7f[_0xe33fd3(0x14a)]+_0xbfc2e0[_0xe33fd3(0x14a)]+_0x5ead04[_0xe33fd3(0x14a)]+_0xb28c3f[_0xe33fd3(0x14a)]+_0x140697[_0xe33fd3(0x14a)]+_0x174b36[_0xe33fd3(0x14a)];if(!_0x37f112[_0xe33fd3(0xe2)]&&_0x4d0827>0x0){if(!isInteractive())return console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0x113)](_0xe33fd3(0x126)),_0xe33fd3(0xdb)),console['error'](a31_0x26bb35['dim']('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x2e4633=await confirmKey(_0xe33fd3(0x13f)+_0x4d0827+_0xe33fd3(0x119));if(!_0x2e4633)return console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0x146)](_0xe33fd3(0xd2))),0x1;}const _0x22b00a={'withProgress':async(_0x371dca,_0x3a6bbe)=>{const _0x2fdbc8=_0xe33fd3,_0x5bee5f=await withSpinner(_0x371dca,_0x3a6bbe,{'verbose':_0x37f112[_0x2fdbc8(0x153)]});return{'data':_0x5bee5f[_0x2fdbc8(0x164)]};},'logInfo':_0x28c612=>console[_0xe33fd3(0xce)](a31_0x26bb35['blue']('✔\x20'+_0x28c612)),'logSuccess':_0x4585d8=>console['error'](a31_0x26bb35[_0xe33fd3(0x137)]('✔\x20'+_0x4585d8)),'logWarning':_0x464aa5=>console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0x146)]('⚠\x20'+_0x464aa5)),'logDeleted':_0x4084b3=>console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0x113)]('✔\x20'+_0x4084b3))},_0x382992={'segment':_0x2b1b08[_0xe33fd3(0x127)],'journey':_0x2b1b08[_0xe33fd3(0xdd)],'user':_0x2b1b08['user'],'connection':_0x2b1b08[_0xe33fd3(0x13e)]};_0x140697[_0xe33fd3(0x14a)]>0x0&&(_0x3b22c6=await executePushFolders(_0x382992,_0x140697,_0x3b22c6,{'parentId':_0x14df1c},_0x22b00a));const _0x2cdbd9={'rootFolderId':_0x42c854,'folderPathToId':_0x3b22c6,'folderIdToPath':_0xc64af3,'segmentNameToId':_0x53107f,'activationsBySegmentId':_0x15606c,'emailToIdMap':_0x5274ba,'idToEmailMap':_0x40e34b,'connectionNameToIdMap':_0x1de229['nameToId'],'connectionIdToNameMap':_0x1de229[_0xe33fd3(0xdc)],'connectionNameToTypeMap':_0x2e4eb0},_0x5e27b8=await executePushSegments(_0x382992,_0x37f112[_0xe33fd3(0x148)]?[]:_0x1415ac,_0x2cdbd9,{'parentId':_0x14df1c},_0x22b00a),_0x1f8c47=_0x5e27b8[_0xe33fd3(0x142)],_0x140a47=_0x5e27b8[_0xe33fd3(0xd3)],_0x35ca11=_0x5e27b8[_0xe33fd3(0xe9)][_0xe33fd3(0x142)],_0x4b283e=_0x5e27b8[_0xe33fd3(0xe9)][_0xe33fd3(0xd3)],_0x240285=_0x5e27b8[_0xe33fd3(0xe9)][_0xe33fd3(0xd8)],_0x5278ff=await executePushSegmentDeletions(_0x382992,_0x37f112[_0xe33fd3(0x148)]?[]:_0xa62c7f,_0x22b00a);let _0x48cf2a=0x0,_0x3e7b96=0x0,_0x266e90=0x0;const _0x49ee99=new Map(_0x53107f);for(const [_0x2dffb3,_0x49184b]of _0x5e27b8[_0xe33fd3(0xf8)]){_0x49ee99[_0xe33fd3(0xe0)](_0x2dffb3,_0x49184b);}if(_0x4970a7[_0xe33fd3(0x14a)]>0x0){const _0x292e32={..._0x2cdbd9,'segmentNameToId':_0x49ee99,'existingSegments':_0xf9780f,'activationContext':_0x40af41},_0x27f7c1=await executePushJourneys(_0x382992,_0x4970a7,_0x292e32,{'parentId':_0x14df1c,'rootFolderId':_0x42c854,'verbose':_0x37f112[_0xe33fd3(0x153)]},_0x22b00a);_0x48cf2a=_0x27f7c1[_0xe33fd3(0x142)],_0x3e7b96=_0x27f7c1[_0xe33fd3(0xd3)];if(_0x203e5b&&_0x27f7c1['results'][_0xe33fd3(0x14a)]===0x1){const _0x435d0e=_0x27f7c1[_0xe33fd3(0x10e)][0x0];if(_0x435d0e[_0xe33fd3(0x10d)]){const _0x311b0a=getConsoleNextUrl(_0x37f112['site'],_0xe33fd3(0x14c)+_0x14df1c+_0xe33fd3(0xe6)+_0x435d0e[_0xe33fd3(0x10d)]+_0xe33fd3(0x111));console[_0xe33fd3(0xce)]('\x20\x20'+a31_0x26bb35['cyan'](_0x311b0a));}}}for(const _0x2cc5ec of _0xb28c3f){console[_0xe33fd3(0xce)](a31_0x26bb35['yellow'](_0xe33fd3(0x109)+_0x2cc5ec[_0xe33fd3(0x12f)])),_0x266e90++;}const _0x2714bf=[];if(_0x1f8c47>0x0)_0x2714bf[_0xe33fd3(0x144)](_0x1f8c47+_0xe33fd3(0x12c));if(_0x140a47>0x0)_0x2714bf[_0xe33fd3(0x144)](_0x140a47+'\x20updated');if(_0x5278ff>0x0)_0x2714bf[_0xe33fd3(0x144)](_0x5278ff+_0xe33fd3(0x10a));const _0x343006=[];if(_0x48cf2a>0x0)_0x343006[_0xe33fd3(0x144)](_0x48cf2a+_0xe33fd3(0x12c));if(_0x3e7b96>0x0)_0x343006[_0xe33fd3(0x144)](_0x3e7b96+_0xe33fd3(0x123));if(_0x266e90>0x0)_0x343006[_0xe33fd3(0x144)](_0x266e90+_0xe33fd3(0x10a));const _0x25434c=[];if(_0x35ca11>0x0)_0x25434c['push'](_0x35ca11+_0xe33fd3(0x12c));if(_0x4b283e>0x0)_0x25434c[_0xe33fd3(0x144)](_0x4b283e+_0xe33fd3(0x123));if(_0x240285>0x0)_0x25434c[_0xe33fd3(0x144)](_0x240285+_0xe33fd3(0x10a));return console[_0xe33fd3(0xce)](a31_0x26bb35[_0xe33fd3(0x137)]('\x0a✔\x20Push\x20complete')),_0x2714bf['length']>0x0&&!_0x37f112[_0xe33fd3(0x148)]&&console[_0xe33fd3(0xce)](_0xe33fd3(0x157)+_0x2714bf[_0xe33fd3(0x102)](',\x20')),_0x343006[_0xe33fd3(0x14a)]>0x0&&console[_0xe33fd3(0xce)](_0xe33fd3(0xfe)+_0x343006['join'](',\x20')),_0x25434c[_0xe33fd3(0x14a)]>0x0&&!_0x37f112['journeysOnly']&&console[_0xe33fd3(0xce)](_0xe33fd3(0xd6)+_0x25434c['join'](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0xa721ba=a32_0x3b0e;function a32_0x3b0e(_0x395a3d,_0x88e53b){_0x395a3d=_0x395a3d-0x15e;const _0x4d4c0c=a32_0x4d4c();let _0x3b0e7d=_0x4d4c0c[_0x395a3d];return _0x3b0e7d;}(function(_0x2b31ee,_0xbdb36){const _0x4ef9a1=a32_0x3b0e,_0x2ee29e=_0x2b31ee();while(!![]){try{const _0x4dfc56=parseInt(_0x4ef9a1(0x17a))/0x1*(-parseInt(_0x4ef9a1(0x162))/0x2)+-parseInt(_0x4ef9a1(0x17c))/0x3+-parseInt(_0x4ef9a1(0x187))/0x4*(-parseInt(_0x4ef9a1(0x175))/0x5)+-parseInt(_0x4ef9a1(0x18a))/0x6*(parseInt(_0x4ef9a1(0x174))/0x7)+-parseInt(_0x4ef9a1(0x182))/0x8*(-parseInt(_0x4ef9a1(0x178))/0x9)+-parseInt(_0x4ef9a1(0x177))/0xa*(parseInt(_0x4ef9a1(0x176))/0xb)+parseInt(_0x4ef9a1(0x184))/0xc*(parseInt(_0x4ef9a1(0x167))/0xd);if(_0x4dfc56===_0xbdb36)break;else _0x2ee29e['push'](_0x2ee29e['shift']());}catch(_0x4e6e3d){_0x2ee29e['push'](_0x2ee29e['shift']());}}}(a32_0x4d4c,0x28c87));import{BaseCommand}from'./command.js';function a32_0x4d4c(){const _0x27a654=['\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','verbose','9170902UxyYIj','✔\x20Updated\x20segment\x20\x27','length','description','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','type','Resolved\x20folder\x20ID:\x20','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','folder','ruleFile','\x27...','Segment\x20ID:\x20','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','105sFVVUj','17125qoVWaM','204710sTJHrd','80xdsjOd','2846151AUAIgn','Updating\x20segment\x20\x27','240122McoFdZ','resolvePathToResource','752232sHMmWn','INTERNAL','data','Resolved\x20type:\x20','Resolving\x20folder\x20\x27','includes','8EUjqsL','updateSegmentById','12JfXurI','segment','Examples:','4FyykNV','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Error:\x20Cannot\x20update\x20','87330frERDP','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','yellow','kind','segmentId','rule','Resolving\x20path\x20\x27','segmentPath','parentId','2AXffEN','name','error'];a32_0x4d4c=function(){return _0x27a654;};return a32_0x4d4c();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a32_0x3062f1 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a32_0xa721ba(0x163)]='segment:update';[a32_0xa721ba(0x16a)]='Update\x20existing\x20child\x20segment';async['execute'](_0x56ca21){const _0x1b9595=a32_0xa721ba;console['error'](a32_0x3062f1[_0x1b9595(0x18c)](_0x1b9595(0x18b))),console[_0x1b9595(0x164)](a32_0x3062f1['yellow'](_0x1b9595(0x173)));const {options:_0x581eea,args:_0x4306d5,tdx:_0x1bc03d}=_0x56ca21,_0x17f2ec=_0x581eea;if(_0x4306d5[_0x1b9595(0x169)]===0x0)return console[_0x1b9595(0x164)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console['error'](_0x1b9595(0x16b)),console[_0x1b9595(0x164)](_0x1b9595(0x186)),console[_0x1b9595(0x164)](_0x1b9595(0x165)),console[_0x1b9595(0x164)](_0x1b9595(0x16e)),0x1;const _0x2d85a6=_0x4306d5[0x0],_0x22b1a3=_0x581eea[_0x1b9595(0x160)];let _0x15c536=_0x2d85a6;_0x22b1a3&&!_0x2d85a6[_0x1b9595(0x181)]('/')&&(_0x15c536=_0x22b1a3+'/'+_0x2d85a6,_0x17f2ec[_0x1b9595(0x166)]&&console[_0x1b9595(0x164)]('Resolved\x20relative\x20path\x20to:\x20'+_0x15c536));const _0x25dc39=await withSpinner(_0x1b9595(0x15f)+_0x15c536+'\x27...',()=>_0x1bc03d[_0x1b9595(0x185)][_0x1b9595(0x17b)](_0x15c536),{'verbose':_0x17f2ec[_0x1b9595(0x166)]}),_0xefbd8f=_0x25dc39[_0x1b9595(0x17e)];_0x17f2ec[_0x1b9595(0x166)]&&console[_0x1b9595(0x164)](_0x1b9595(0x17f)+_0xefbd8f['type']);if(_0xefbd8f[_0x1b9595(0x16c)]!=='segment')return console[_0x1b9595(0x164)](_0x1b9595(0x189)+_0xefbd8f[_0x1b9595(0x16c)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console[_0x1b9595(0x164)](_0x1b9595(0x188)),0x1;if(!_0xefbd8f['segmentId'])throw new SDKError(ErrorCode[_0x1b9595(0x17d)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x13aed1=_0xefbd8f[_0x1b9595(0x161)],_0x2fa0f9=_0xefbd8f[_0x1b9595(0x18e)];_0x17f2ec[_0x1b9595(0x166)]&&(console[_0x1b9595(0x164)]('Parent\x20ID:\x20'+_0x13aed1),console[_0x1b9595(0x164)](_0x1b9595(0x172)+_0x2fa0f9));let _0x3f865f;if(_0x17f2ec['folder']){const _0x4a1ae9=_0x17f2ec[_0x1b9595(0x16f)],_0x56b6b9=await withSpinner(_0x1b9595(0x180)+_0x4a1ae9+_0x1b9595(0x171),()=>_0x1bc03d[_0x1b9595(0x185)]['resolveFolderId'](_0x13aed1,_0x4a1ae9),{'verbose':_0x17f2ec['verbose']});_0x3f865f=parseInt(_0x56b6b9[_0x1b9595(0x17e)],0xa),_0x17f2ec[_0x1b9595(0x166)]&&console[_0x1b9595(0x164)](_0x1b9595(0x16d)+_0x3f865f);}const _0x4fa50f=await loadJSONFromOptions(_0x17f2ec[_0x1b9595(0x15e)],_0x17f2ec[_0x1b9595(0x170)]),_0x440510={'name':_0x17f2ec[_0x1b9595(0x163)],'description':_0x17f2ec[_0x1b9595(0x16a)],'rule':_0x4fa50f,'kind':_0x17f2ec['kind']!==undefined?parseInt(_0x17f2ec[_0x1b9595(0x18d)],0xa):undefined,'segmentFolderId':_0x3f865f},_0x21ac83=await withSpinner(_0x1b9595(0x179)+_0xefbd8f['segmentName']+_0x1b9595(0x171),()=>_0x1bc03d[_0x1b9595(0x185)][_0x1b9595(0x183)](_0x13aed1,_0x2fa0f9,_0x440510),{'verbose':_0x17f2ec['verbose']}),_0x47f28f=_0x21ac83['data'];return console[_0x1b9595(0x164)](_0x1b9595(0x168)+_0x47f28f[_0x1b9595(0x163)]+'\x27'),_0x15c536!==_0x2d85a6&&console['error']('\x20\x20\x20Path:\x20'+_0x15c536),await handleSDKOutput([_0x47f28f],_0x17f2ec),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a33_0x2f9dee=a33_0x4bdd;(function(_0x1a66a8,_0x5d8f93){const _0x1b30d2=a33_0x4bdd,_0x4aff99=_0x1a66a8();while(!![]){try{const _0x236700=-parseInt(_0x1b30d2(0x86))/0x1+parseInt(_0x1b30d2(0xae))/0x2+-parseInt(_0x1b30d2(0x87))/0x3*(-parseInt(_0x1b30d2(0x8c))/0x4)+-parseInt(_0x1b30d2(0xa8))/0x5*(-parseInt(_0x1b30d2(0x99))/0x6)+parseInt(_0x1b30d2(0xb4))/0x7*(-parseInt(_0x1b30d2(0xa2))/0x8)+-parseInt(_0x1b30d2(0xa7))/0x9*(-parseInt(_0x1b30d2(0xb1))/0xa)+parseInt(_0x1b30d2(0xb8))/0xb*(-parseInt(_0x1b30d2(0xb9))/0xc);if(_0x236700===_0x5d8f93)break;else _0x4aff99['push'](_0x4aff99['shift']());}catch(_0x5b451a){_0x4aff99['push'](_0x4aff99['shift']());}}}(a33_0xdd07,0xcffe8));import{existsSync,statSync}from'fs';import a33_0x31847b from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a33_0x4bdd(_0x72d3f1,_0x32f2c8){_0x72d3f1=_0x72d3f1-0x84;const _0xdd07af=a33_0xdd07();let _0x4bdd12=_0xdd07af[_0x72d3f1];return _0x4bdd12;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a33_0x2f9dee(0x85)]=a33_0x2f9dee(0xbd);[a33_0x2f9dee(0x9d)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a33_0x2f9dee(0xab)](_0x43969a){const _0x41afe7=a33_0x2f9dee,{options:_0x1d5497,args:_0x4d876f,tdx:_0xe5d9b5}=_0x43969a;if(_0x4d876f[_0x41afe7(0x95)]===0x0)return console[_0x41afe7(0x89)](a33_0x31847b[_0x41afe7(0xa9)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x41afe7(0x89)](_0x41afe7(0xb7)),console[_0x41afe7(0x89)](_0x41afe7(0x84)),console[_0x41afe7(0x89)](_0x41afe7(0x98)),console['error'](_0x41afe7(0x94)),console[_0x41afe7(0x89)](_0x41afe7(0xa1)),console['error'](_0x41afe7(0x9a)),0x1;const _0x41a753=_0x4d876f[0x0],_0x1285c3=_0x1d5497[_0x41afe7(0x8f)];try{if(_0x41a753==='/')return saveSessionContext({'segment_path':undefined},_0x1285c3),console['log'](a33_0x31847b[_0x41afe7(0x93)](_0x41afe7(0x91))),0x0;if(existsSync(_0x41a753)&&statSync(_0x41a753)[_0x41afe7(0x8d)]()){let _0x5ec88c;try{_0x5ec88c=findTdxConfig(_0x41a753);}catch{return console[_0x41afe7(0x89)](a33_0x31847b[_0x41afe7(0xa9)](_0x41afe7(0xa5)+_0x41a753)),console[_0x41afe7(0x89)](a33_0x31847b[_0x41afe7(0xba)](_0x41afe7(0x9f))),0x1;}const _0x20be94=_0x5ec88c['config'][_0x41afe7(0x92)];return saveSessionContext({'segment_path':_0x20be94,'parent_segment':_0x20be94},_0x1285c3),console[_0x41afe7(0x97)](a33_0x31847b[_0x41afe7(0x93)](_0x41afe7(0xb5)+a33_0x31847b[_0x41afe7(0xba)](_0x20be94))),0x0;}const _0x22800f=_0x1d5497['segmentPath'];let _0x79ffc3=_0x41a753;const _0x5c93b2=parsePath(_0x41a753);if(!_0x5c93b2[_0x41afe7(0x88)]){if(!_0x22800f)return console['error'](a33_0x31847b[_0x41afe7(0xa9)](_0x41afe7(0x96))),console[_0x41afe7(0x89)](a33_0x31847b[_0x41afe7(0xba)](_0x41afe7(0xbe))),0x1;if(_0x41a753==='..'){const _0x284bd6=_0x22800f[_0x41afe7(0xb0)]('/')[_0x41afe7(0xad)](0x0,-0x1)[_0x41afe7(0xa6)]('/');_0x79ffc3=_0x284bd6||'/';}else _0x41a753==='.'?_0x79ffc3=_0x22800f:_0x79ffc3=_0x22800f+'/'+_0x41a753;_0x1d5497['verbose']&&console['error']('Resolved\x20relative\x20path\x20to:\x20'+_0x79ffc3);}if(_0x79ffc3==='/'||_0x79ffc3==='')return saveSessionContext({'segment_path':undefined},_0x1285c3),console['log'](a33_0x31847b['green'](_0x41afe7(0x91))),0x0;_0x79ffc3=normalizePath(_0x79ffc3);const _0x33ce0e=parsePath(_0x79ffc3)['segments'];if(_0x33ce0e[_0x41afe7(0x95)]===0x0)return saveSessionContext({'segment_path':undefined},_0x1285c3),console['log'](a33_0x31847b[_0x41afe7(0x93)](_0x41afe7(0x91))),0x0;_0x1d5497[_0x41afe7(0x9b)]&&(console[_0x41afe7(0x89)](_0x41afe7(0xbc)+_0x1d5497[_0x41afe7(0xb3)]),console['error'](_0x41afe7(0xbf)+_0x79ffc3));const _0x25e3bd=await withSpinner(_0x41afe7(0xbb)+_0x79ffc3+_0x41afe7(0xaa),()=>_0xe5d9b5[_0x41afe7(0x8e)][_0x41afe7(0x9e)](_0x79ffc3),{'verbose':_0x1d5497['verbose']}),_0x2fcf6a=_0x25e3bd[_0x41afe7(0xaf)];_0x1d5497['verbose']&&(console['error'](_0x41afe7(0xb6)+_0x2fcf6a['type']),console['error'](_0x41afe7(0xa4)+_0x2fcf6a[_0x41afe7(0x8a)]),_0x2fcf6a['folderId']&&console['error'](_0x41afe7(0x90)+_0x2fcf6a['folderId']));if(_0x2fcf6a['type']===_0x41afe7(0x8e))return console['error'](a33_0x31847b[_0x41afe7(0xa9)]('Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.')),console[_0x41afe7(0x89)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error'](a33_0x31847b[_0x41afe7(0xba)](_0x41afe7(0xa3)+_0x2fcf6a[_0x41afe7(0x9c)]+(_0x2fcf6a[_0x41afe7(0xa0)]?'/'+_0x2fcf6a[_0x41afe7(0xa0)][_0x41afe7(0xa6)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2fcf6a['fullPath'],'parent_segment':_0x2fcf6a[_0x41afe7(0x9c)]},_0x1285c3),console[_0x41afe7(0x97)](a33_0x31847b['green'](_0x41afe7(0xb5)+a33_0x31847b[_0x41afe7(0xba)](_0x2fcf6a[_0x41afe7(0xac)]))),_0x1d5497[_0x41afe7(0x9b)]&&(console[_0x41afe7(0x89)](a33_0x31847b[_0x41afe7(0x8b)]('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x41afe7(0x89)](a33_0x31847b[_0x41afe7(0x8b)](_0x41afe7(0xb2)))),0x0;}catch(_0xfa6c60){throw _0xfa6c60;}}}function a33_0xdd07(){const _0x2e46de=['Site:\x20','segment:use','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','Target\x20path:\x20','Examples:','name','1603118zoGayp','6zxDgBZ','isAbsolute','error','parentId','dim','2382676zMzDmp','isDirectory','segment','session','Folder\x20ID:\x20','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','parent_segment','green','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','length','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','log','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','240AxdiJO','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','verbose','parentName','description','resolvePathToResource','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','folderPath','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','32UqLMNh','Use:\x20tdx\x20segment\x20use\x20','Parent\x20ID:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','join','60633noCdDz','5305gESJoA','red','\x27...','execute','fullPath','slice','892412JdebFK','data','split','1900EjPgoq','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','site','171605UeJKLB','✔\x20Context\x20set\x20to:\x20','Resolved\x20path\x20type:\x20','Usage:\x20tdx\x20segment\x20use\x20<path>','44DAKCQn','1220676AIAHJe','cyan','Resolving\x20path\x20\x27'];a33_0xdd07=function(){return _0x2e46de;};return a33_0xdd07();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a34_0x3ad9(){const _0x5b9231=['\x20valid','):\x20','hasErrors','length','error','253005lZcyTu','targetDir','\x20file(s)\x20valid','valid','.yml','312222tBdSnA','execute','\x20file(s)\x20with\x20errors,\x20','yellow','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','4827402vgmgGs','662375aBHxHz','\x20warning(s)','\x20warning(s)\x20found','message','Validation\x20failed:\x20','log','validCount','916wWQgXr','file','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','invalidCount','16IGEIsE','segment:validate','\x20error(s)','cwd','helpText','Validate\x20segment\x20and\x20journey\x20YAML\x20files','parentSegment','687714yQhmbV','dim','Error:\x20Directory\x20not\x20found:\x20','✔\x20All\x20','verbose','red','157011INQIQO','endsWith','filePath','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','green','3245ZMCCgB','warnings','.yaml','errorCode','warningCount','no_parent','name'];a34_0x3ad9=function(){return _0x5b9231;};return a34_0x3ad9();}const a34_0x5e4091=a34_0x5aa1;(function(_0x286678,_0x1c27a9){const _0x24a776=a34_0x5aa1,_0x533ec4=_0x286678();while(!![]){try{const _0x1220c1=parseInt(_0x24a776(0x183))/0x1+-parseInt(_0x24a776(0x188))/0x2+-parseInt(_0x24a776(0x1a6))/0x3+-parseInt(_0x24a776(0x195))/0x4*(parseInt(_0x24a776(0x177))/0x5)+-parseInt(_0x24a776(0x1a0))/0x6+-parseInt(_0x24a776(0x18e))/0x7*(parseInt(_0x24a776(0x199))/0x8)+parseInt(_0x24a776(0x18d))/0x9;if(_0x1220c1===_0x1c27a9)break;else _0x533ec4['push'](_0x533ec4['shift']());}catch(_0xe16748){_0x533ec4['push'](_0x533ec4['shift']());}}}(a34_0x3ad9,0x1f5bd));import{BaseCommand}from'./command.js';function a34_0x5aa1(_0x469eed,_0xbed661){_0x469eed=_0x469eed-0x174;const _0x3ad977=a34_0x3ad9();let _0x5aa1a6=_0x3ad977[_0x469eed];return _0x5aa1a6;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a34_0x2c9133 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a34_0x5e4091(0x17d)]=a34_0x5e4091(0x19a);['description']=a34_0x5e4091(0x19e);async[a34_0x5e4091(0x189)](_0x315214){const _0x542151=a34_0x5e4091,{options:_0x298937,args:_0x457d69}=_0x315214,_0x297990=_0x298937,_0x44f9ac=await resolveTarget({'arg':_0x457d69[0x0],'contextParent':_0x298937[_0x542151(0x19f)],'cwd':process[_0x542151(0x19c)]()});if(!isSuccessfulResolution(_0x44f9ac))return _0x44f9ac[_0x542151(0x17a)]===_0x542151(0x17c)?(console[_0x542151(0x182)](a34_0x2c9133[_0x542151(0x18b)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x542151(0x182)](_0x542151(0x175)),console[_0x542151(0x182)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x542151(0x182)](a34_0x2c9133['red']('Error:\x20'+_0x44f9ac[_0x542151(0x191)]+'\x0a')),_0x44f9ac[_0x542151(0x19d)]&&console[_0x542151(0x182)](a34_0x2c9133['cyan'](_0x44f9ac[_0x542151(0x19d)]))),0x1;const _0x1916cd=_0x44f9ac[_0x542151(0x184)],_0xd58c71=_0x44f9ac['type']===_0x542151(0x196)?_0x44f9ac[_0x542151(0x174)]:undefined;if(!_0xd58c71&&!existsSync(_0x1916cd))return console['error'](a34_0x2c9133['red'](_0x542151(0x1a2)+_0x1916cd+'\x0a')),0x1;let _0x378a0b;if(_0xd58c71){if(!_0xd58c71[_0x542151(0x1a7)](_0x542151(0x187))&&!_0xd58c71[_0x542151(0x1a7)](_0x542151(0x179)))return console[_0x542151(0x182)](a34_0x2c9133[_0x542151(0x1a5)](_0x542151(0x197)+_0xd58c71+'\x0a')),0x1;_0x378a0b=[_0xd58c71];}else _0x378a0b=findYamlFiles(_0x1916cd);if(_0x378a0b[_0x542151(0x181)]===0x0)return console['error'](a34_0x2c9133[_0x542151(0x1a5)](_0x542151(0x18c)+_0x1916cd+'\x0a')),0x1;const _0x20de9d=validateYamlFiles(_0x378a0b,_0x1916cd),_0x2c6118=calculateSummary(_0x20de9d);for(const _0x462124 of _0x20de9d){if(!isValidationResult(_0x462124))continue;const {relativePath:_0x5efc1f,source:_0x2875e9,result:_0x3f6d74,fileType:_0x28c8b8}=_0x462124,_0xb626e0=_0x28c8b8;if(_0x3f6d74[_0x542151(0x186)]&&_0x3f6d74[_0x542151(0x178)][_0x542151(0x181)]===0x0)_0x297990[_0x542151(0x1a4)]&&console[_0x542151(0x193)](a34_0x2c9133['green']('✔\x20'+_0x5efc1f)+a34_0x2c9133[_0x542151(0x1a1)]('\x20('+_0xb626e0+')'));else _0x3f6d74[_0x542151(0x186)]?(console[_0x542151(0x193)](a34_0x2c9133['yellow']('⚠\x20'+_0x5efc1f)+a34_0x2c9133['dim']('\x20('+_0xb626e0+_0x542151(0x17f)+_0x3f6d74[_0x542151(0x178)]['length']+_0x542151(0x18f))),console[_0x542151(0x193)](formatValidationResult(_0x3f6d74,_0x2875e9,_0x5efc1f))):(console['log'](a34_0x2c9133[_0x542151(0x1a5)]('✖\x20'+_0x5efc1f)+a34_0x2c9133['dim']('\x20('+_0xb626e0+_0x542151(0x17f)+_0x3f6d74['errors'][_0x542151(0x181)]+_0x542151(0x19b))),console[_0x542151(0x193)](formatValidationResult(_0x3f6d74,_0x2875e9,_0x5efc1f)));}return console['log'](''),_0x2c6118[_0x542151(0x180)]?(console[_0x542151(0x193)](a34_0x2c9133[_0x542151(0x1a5)](_0x542151(0x192)+_0x2c6118[_0x542151(0x198)]+_0x542151(0x18a)+_0x2c6118[_0x542151(0x194)]+_0x542151(0x17e))),_0x2c6118['warningCount']>0x0&&console[_0x542151(0x193)](a34_0x2c9133[_0x542151(0x18b)](_0x2c6118['warningCount']+_0x542151(0x190))),0x1):(console[_0x542151(0x193)](a34_0x2c9133[_0x542151(0x176)](_0x542151(0x1a3)+_0x2c6118[_0x542151(0x194)]+_0x542151(0x185))),_0x2c6118[_0x542151(0x17b)]>0x0&&console[_0x542151(0x193)](a34_0x2c9133[_0x542151(0x18b)](_0x2c6118[_0x542151(0x17b)]+_0x542151(0x190))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a35_0x5710(_0x5323ee,_0x46884e){_0x5323ee=_0x5323ee-0xcb;const _0x1418b5=a35_0x1418();let _0x5710b3=_0x1418b5[_0x5323ee];return _0x5710b3;}const a35_0x4d953d=a35_0x5710;(function(_0x2b6352,_0x5b216b){const _0x3d6175=a35_0x5710,_0x2bff58=_0x2b6352();while(!![]){try{const _0x43fb81=parseInt(_0x3d6175(0xf5))/0x1*(parseInt(_0x3d6175(0x106))/0x2)+parseInt(_0x3d6175(0xfa))/0x3*(parseInt(_0x3d6175(0x116))/0x4)+parseInt(_0x3d6175(0x10b))/0x5*(parseInt(_0x3d6175(0x11a))/0x6)+-parseInt(_0x3d6175(0xcd))/0x7*(-parseInt(_0x3d6175(0xd5))/0x8)+-parseInt(_0x3d6175(0xce))/0x9+-parseInt(_0x3d6175(0xda))/0xa+-parseInt(_0x3d6175(0xeb))/0xb*(parseInt(_0x3d6175(0xe1))/0xc);if(_0x43fb81===_0x5b216b)break;else _0x2bff58['push'](_0x2bff58['shift']());}catch(_0x141e4e){_0x2bff58['push'](_0x2bff58['shift']());}}}(a35_0x1418,0x59fca));import{BaseCommand}from'./command.js';function a35_0x1418(){const _0x436819=['cause','type','435fBaOtp','message','parentSegment','localeCompare','/app/ps/','\x5c$&','folders','resolvePathToResource','folder','✔\x20Built\x20tree\x20with\x20','\x20folder','4eJhdKT','children','\x20journey','\x20segment','13506zrsXkS','Resolving\x20path\x20\x27','Parent\x20segment\x20context:\x20','1967GQsdCY','1022193OsoiCC','listUnified','description','Error:\x20No\x20parent\x20segment\x20context\x20set.','Error:\x20','(not\x20set)','execute','5176BaKzjt','format','dim','Recursive\x20mode:\x20enabled','sort','5383990rfPFwL','Building\x20hierarchy\x20tree...','length',',\x20and\x20','\x27...','journeys','List\x20folders\x20and\x20child\x20segments','12hwYroL','journey','replace','listWithPattern','/e/','Folder/pattern\x20arg:\x20',']\x20matching\x20\x27','recursive','json','Listing\x20folders,\x20segments,\x20and\x20journeys...','5200613onAXdh','listRecursive','test','maxDepth','name','folderId','jsonl','Parent\x20ID:\x20','listUnifiedWithJourneys','segment','10THnLPQ','Folder\x20ID:\x20','filter','journeyBundleName','error','2059653kVvUuv','segments','site','\x20matching\x20\x27','includes','parentId','log','Resolving\x20parent\x20segment\x20\x27','✔\x20Found\x20','Site:\x20','map','/j/da','85830ScJYgy','data','verbose'];a35_0x1418=function(){return _0x436819;};return a35_0x1418();}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a35_0x4ebe70 from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a35_0x4d953d(0xfb);[a35_0x4d953d(0xd0)]=a35_0x4d953d(0xe0);async[a35_0x4d953d(0xd4)](_0x780214){const _0x388333=a35_0x4d953d,{options:_0x456177,args:_0x2a365c}=_0x780214,_0x16fa28=_0x456177[_0x388333(0xe8)],_0x63b220=_0x2a365c[0x0];try{const _0x2df718=_0x456177[_0x388333(0x10d)];_0x456177[_0x388333(0x108)]&&(console['error'](_0x388333(0x103)+_0x456177[_0x388333(0xfc)]),console[_0x388333(0xf9)](_0x388333(0xcc)+(_0x2df718||_0x388333(0xd3))),_0x63b220&&console['error'](_0x388333(0xe6)+_0x63b220),_0x16fa28&&console['error'](_0x388333(0xd8)));if(!_0x2df718)return console['error'](_0x388333(0xd1)),console['error'](''),console[_0x388333(0xf9)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x388333(0xf9)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x388333(0xf9)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x388333(0xf9)](''),console['error']('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x2c3037=_0x63b220&&(_0x63b220[_0x388333(0xfe)]('*')||_0x63b220[_0x388333(0xfe)]('?'));if(_0x2c3037)return await this[_0x388333(0xe4)](_0x780214,_0x2df718,_0x63b220);const _0x5286ca=_0x63b220?_0x2df718+'/'+_0x63b220:_0x2df718;return _0x16fa28?await this[_0x388333(0xec)](_0x780214,_0x5286ca):await this[_0x388333(0xcf)](_0x780214,_0x5286ca);}catch(_0x176883){if(_0x176883 instanceof SDKError)return console['error'](_0x388333(0xd2)+_0x176883[_0x388333(0x10c)]),_0x176883[_0x388333(0x109)]&&console['error']('\x20\x20Cause:\x20'+_0x176883[_0x388333(0x109)]),0x1;throw _0x176883;}}async[a35_0x4d953d(0xe4)](_0x275ba3,_0x5ab7b8,_0x509e07){const _0x5a47cf=a35_0x4d953d,{options:_0x47b600,tdx:_0x558890}=_0x275ba3,_0xddd5a8=await withSpinner(_0x5a47cf(0x101)+_0x5ab7b8+_0x5a47cf(0xde),()=>_0x558890[_0x5a47cf(0xf4)][_0x5a47cf(0x112)](_0x5ab7b8),{'verbose':_0x47b600[_0x5a47cf(0x108)]}),_0x4537c2=_0xddd5a8['data'],_0x5765c5=await withSpinner(_0x5a47cf(0xea),()=>_0x558890['segment'][_0x5a47cf(0xf3)](_0x4537c2[_0x5a47cf(0xff)],_0x4537c2[_0x5a47cf(0xf0)]),{'verbose':_0x47b600[_0x5a47cf(0x108)]}),{folders:_0x38094b,segments:_0x5c6a5,journeys:_0x18efef}=_0x5765c5['data'],_0xd7f888=_0x509e07[_0x5a47cf(0xe3)](/[.+^${}()|[\]\\]/g,_0x5a47cf(0x110))[_0x5a47cf(0xe3)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x842289=new RegExp('^'+_0xd7f888+'$','i'),_0x20dca9=_0x38094b[_0x5a47cf(0xf7)](_0x6a5ef0=>_0x842289['test'](_0x6a5ef0['name'])),_0x4f3602=_0x5c6a5['filter'](_0x4a334b=>_0x842289['test'](_0x4a334b[_0x5a47cf(0xef)])),_0x219396=_0x18efef[_0x5a47cf(0xf7)](_0x2db449=>_0x842289[_0x5a47cf(0xed)](_0x2db449[_0x5a47cf(0xf8)])),_0x155de0=_0x20dca9[_0x5a47cf(0xdc)]+_0x4f3602[_0x5a47cf(0xdc)]+_0x219396[_0x5a47cf(0xdc)];console[_0x5a47cf(0xf9)](_0x5a47cf(0x102)+_0x20dca9[_0x5a47cf(0xdc)]+'\x20folder'+(_0x20dca9[_0x5a47cf(0xdc)]!==0x1?'s':'')+',\x20'+_0x4f3602[_0x5a47cf(0xdc)]+'\x20segment'+(_0x4f3602[_0x5a47cf(0xdc)]!==0x1?'s':'')+_0x5a47cf(0xdd)+_0x219396[_0x5a47cf(0xdc)]+_0x5a47cf(0x118)+(_0x219396['length']!==0x1?'s':'')+_0x5a47cf(0xfd)+_0x509e07+'\x27');const _0x192b26=_0x2d3ea3=>{const _0x3c9425=_0x5a47cf;return getConsoleNextUrl(_0x47b600[_0x3c9425(0xfc)],_0x3c9425(0x10f)+_0x4537c2[_0x3c9425(0xff)]+'/e/'+_0x2d3ea3);},_0xfc038d=_0x47b600[_0x5a47cf(0xd6)]===_0x5a47cf(0xe9)||_0x47b600['format']===_0x5a47cf(0xf1);if(_0xfc038d){const _0x4e3009=[..._0x20dca9['map'](_0x4d05ab=>({..._0x4d05ab,'type':'folder'})),..._0x4f3602[_0x5a47cf(0x104)](_0x388d02=>({..._0x388d02,'type':'segment','url':_0x192b26(_0x388d02['id'])})),..._0x219396['map'](_0x44e7c8=>({..._0x44e7c8,'name':_0x44e7c8['journeyBundleName'],'type':'journey'}))]['sort']((_0x20a59f,_0x2cfed8)=>_0x20a59f[_0x5a47cf(0xef)][_0x5a47cf(0x10e)](_0x2cfed8[_0x5a47cf(0xef)]));await handleSDKOutput(_0x4e3009,_0x47b600);}else{if(_0x155de0===0x0)console[_0x5a47cf(0x100)]('No\x20items\x20match\x20pattern:\x20'+_0x509e07);else{console[_0x5a47cf(0x100)](a35_0x4ebe70['dim']('['+_0x5ab7b8+_0x5a47cf(0xe7)+_0x509e07+'\x27'));const _0x1b1cdb=formatFlatList(_0x20dca9,_0x4f3602,{'showMetadata':!![],'getSegmentUrl':_0x192b26},_0x219396);console[_0x5a47cf(0x100)](_0x1b1cdb);}}return 0x0;}async['listUnified'](_0x56ec89,_0x483b28){const _0x228130=a35_0x4d953d,{options:_0x474f01,tdx:_0x50e62e}=_0x56ec89,_0x259c35=await withSpinner(_0x228130(0xcb)+_0x483b28+_0x228130(0xde),()=>_0x50e62e['segment'][_0x228130(0x112)](_0x483b28),{'verbose':_0x474f01['verbose']}),_0x48af0f=_0x259c35[_0x228130(0x107)];_0x474f01[_0x228130(0x108)]&&(console['error'](_0x228130(0xf2)+_0x48af0f[_0x228130(0xff)]),_0x48af0f[_0x228130(0xf0)]&&console[_0x228130(0xf9)](_0x228130(0xf6)+_0x48af0f[_0x228130(0xf0)]));const _0x4ca17d=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x50e62e[_0x228130(0xf4)][_0x228130(0xf3)](_0x48af0f[_0x228130(0xff)],_0x48af0f['folderId']),{'verbose':_0x474f01[_0x228130(0x108)]}),{folders:_0x5d5168,segments:_0x3e3086,journeys:_0x41809f}=_0x4ca17d[_0x228130(0x107)],_0x4d61a5=_0x5d5168[_0x228130(0xdc)]+_0x3e3086['length']+_0x41809f[_0x228130(0xdc)];console[_0x228130(0xf9)](_0x228130(0x102)+_0x5d5168['length']+'\x20folder'+(_0x5d5168[_0x228130(0xdc)]!==0x1?'s':'')+',\x20'+_0x3e3086[_0x228130(0xdc)]+_0x228130(0x119)+(_0x3e3086[_0x228130(0xdc)]!==0x1?'s':'')+_0x228130(0xdd)+_0x41809f[_0x228130(0xdc)]+'\x20journey'+(_0x41809f[_0x228130(0xdc)]!==0x1?'s':''));const _0x5f42a0=_0x437c9d=>{const _0x20e212=_0x228130;return getConsoleNextUrl(_0x474f01[_0x20e212(0xfc)],_0x20e212(0x10f)+_0x48af0f['parentId']+_0x20e212(0xe5)+_0x437c9d);},_0x5b7dd3=_0x1f5cab=>{const _0xc74483=_0x228130;return getConsoleNextUrl(_0x474f01[_0xc74483(0xfc)],_0xc74483(0x10f)+_0x48af0f[_0xc74483(0xff)]+_0xc74483(0xe5)+_0x1f5cab+_0xc74483(0x105));},_0x4e04e3=_0x474f01['format']===_0x228130(0xe9)||_0x474f01[_0x228130(0xd6)]===_0x228130(0xf1);if(_0x4e04e3){const _0x57482d=[..._0x5d5168['map'](_0x13e0eb=>({..._0x13e0eb,'type':_0x228130(0x113)})),..._0x3e3086[_0x228130(0x104)](_0x17403b=>({..._0x17403b,'type':_0x228130(0xf4),'url':_0x5f42a0(_0x17403b['id'])})),..._0x41809f['map'](_0x2c2fcf=>({..._0x2c2fcf,'name':_0x2c2fcf[_0x228130(0xf8)],'type':_0x228130(0xe2),'url':_0x5b7dd3(_0x2c2fcf['id'])}))][_0x228130(0xd9)]((_0xdfffed,_0xd0a308)=>_0xdfffed[_0x228130(0xef)][_0x228130(0x10e)](_0xd0a308[_0x228130(0xef)]));await handleSDKOutput(_0x57482d,_0x474f01);}else{if(_0x4d61a5===0x0)console[_0x228130(0x100)](a35_0x4ebe70[_0x228130(0xd7)]('['+_0x483b28+']')),console['log']('(empty)');else{console[_0x228130(0x100)](a35_0x4ebe70['dim']('['+_0x483b28+']'));const _0x26538a=formatFlatList(_0x5d5168,_0x3e3086,{'showMetadata':!![],'getSegmentUrl':_0x5f42a0,'getJourneyUrl':_0x5b7dd3},_0x41809f);console['log'](_0x26538a);}}return 0x0;}async[a35_0x4d953d(0xec)](_0x50cec3,_0x4aaf9c){const _0x3a7f7a=a35_0x4d953d,{options:_0x23d51a,tdx:_0xd46678}=_0x50cec3,_0x46ed7e=await withSpinner(_0x3a7f7a(0xcb)+_0x4aaf9c+_0x3a7f7a(0xde),()=>_0xd46678['segment']['resolvePathToResource'](_0x4aaf9c),{'verbose':_0x23d51a['verbose']}),_0x50f0d7=_0x46ed7e[_0x3a7f7a(0x107)];_0x23d51a[_0x3a7f7a(0x108)]&&(console[_0x3a7f7a(0xf9)](_0x3a7f7a(0xf2)+_0x50f0d7[_0x3a7f7a(0xff)]),_0x50f0d7[_0x3a7f7a(0xf0)]&&console[_0x3a7f7a(0xf9)]('Folder\x20ID:\x20'+_0x50f0d7[_0x3a7f7a(0xf0)]));const _0x284425=_0x23d51a[_0x3a7f7a(0xee)]||0xa,_0x8ed3ea=await withSpinner(_0x3a7f7a(0xdb),()=>_0xd46678[_0x3a7f7a(0xf4)]['listRecursive'](_0x50f0d7[_0x3a7f7a(0xff)],_0x50f0d7['folderId'],0x0,_0x284425),{'verbose':_0x23d51a['verbose']}),_0x401b05=_0x8ed3ea[_0x3a7f7a(0x107)],_0x56f60a=_0x170854=>{const _0x4f56ea=_0x3a7f7a;let _0xaf63f2=0x0,_0xa23fd9=0x0,_0x4ad58f=0x0;for(const _0xdf1232 of _0x170854){if(_0xdf1232[_0x4f56ea(0x10a)]===_0x4f56ea(0x113))_0xaf63f2++;else{if(_0xdf1232[_0x4f56ea(0x10a)]==='segment')_0xa23fd9++;else{if(_0xdf1232[_0x4f56ea(0x10a)]===_0x4f56ea(0xe2))_0x4ad58f++;}}if(_0xdf1232[_0x4f56ea(0x117)]){const _0x175070=_0x56f60a(_0xdf1232['children']);_0xaf63f2+=_0x175070['folders'],_0xa23fd9+=_0x175070['segments'],_0x4ad58f+=_0x175070[_0x4f56ea(0xdf)];}}return{'folders':_0xaf63f2,'segments':_0xa23fd9,'journeys':_0x4ad58f};},_0x5a9712=_0x56f60a(_0x401b05);console['error'](_0x3a7f7a(0x114)+_0x5a9712[_0x3a7f7a(0x111)]+_0x3a7f7a(0x115)+(_0x5a9712['folders']!==0x1?'s':'')+',\x20'+_0x5a9712[_0x3a7f7a(0xfb)]+_0x3a7f7a(0x119)+(_0x5a9712[_0x3a7f7a(0xfb)]!==0x1?'s':'')+',\x20and\x20'+_0x5a9712[_0x3a7f7a(0xdf)]+_0x3a7f7a(0x118)+(_0x5a9712['journeys']!==0x1?'s':''));const _0xb6537e=_0x3807af=>{const _0x10e47a=_0x3a7f7a;return getConsoleNextUrl(_0x23d51a[_0x10e47a(0xfc)],_0x10e47a(0x10f)+_0x50f0d7[_0x10e47a(0xff)]+_0x10e47a(0xe5)+_0x3807af);},_0x18490c=_0x5c2bec=>{const _0x1e43f2=_0x3a7f7a;return getConsoleNextUrl(_0x23d51a[_0x1e43f2(0xfc)],'/app/ps/'+_0x50f0d7[_0x1e43f2(0xff)]+'/e/'+_0x5c2bec+_0x1e43f2(0x105));};if(_0x23d51a['format']===_0x3a7f7a(0xe9)||_0x23d51a[_0x3a7f7a(0xd6)]==='jsonl')await handleSDKOutput(_0x401b05,_0x23d51a);else{console[_0x3a7f7a(0x100)](a35_0x4ebe70[_0x3a7f7a(0xd7)]('['+_0x4aaf9c+']'));const _0x3b5562=formatTree(_0x401b05,{'showMetadata':!![],'getSegmentUrl':_0xb6537e,'getJourneyUrl':_0x18490c});console['log'](_0x3b5562);}return 0x0;}}
|
|
1
|
+
const a35_0x3b86ff=a35_0xf1b0;(function(_0x2ebf0f,_0x4ab361){const _0x374e4c=a35_0xf1b0,_0x81dea8=_0x2ebf0f();while(!![]){try{const _0x3e0370=-parseInt(_0x374e4c(0x13e))/0x1*(parseInt(_0x374e4c(0x121))/0x2)+-parseInt(_0x374e4c(0xf9))/0x3+parseInt(_0x374e4c(0x115))/0x4+-parseInt(_0x374e4c(0xf5))/0x5*(-parseInt(_0x374e4c(0x12a))/0x6)+parseInt(_0x374e4c(0xf7))/0x7+parseInt(_0x374e4c(0xfd))/0x8+parseInt(_0x374e4c(0x135))/0x9;if(_0x3e0370===_0x4ab361)break;else _0x81dea8['push'](_0x81dea8['shift']());}catch(_0xc35708){_0x81dea8['push'](_0x81dea8['shift']());}}}(a35_0x2ce7,0xba881));import{BaseCommand}from'./command.js';function a35_0x2ce7(){const _0x34d711=['7046469EmfaOY','Folder/pattern\x20arg:\x20','verbose','segment','data','folder','listUnifiedWithJourneys','segments','execute','2257mwCIuT','Set\x20a\x20parent\x20segment\x20context\x20first:','Error:\x20No\x20parent\x20segment\x20context\x20set.','parentId','355DXwSFX','Parent\x20ID:\x20','2612267sruuUC',',\x20and\x20','1853040AozAvz','sort','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','5255008vdmReN','test','\x5c$&','name','log','\x20matching\x20\x27','format','Folder\x20ID:\x20','\x20folder','No\x20items\x20match\x20pattern:\x20','Resolving\x20path\x20\x27','json','folderId','\x20journey','(not\x20set)','replace',']\x20matching\x20\x27','map','Error:\x20','\x27...','jsonl','error','✔\x20Found\x20','resolvePathToResource','3527596rlSdXr','type','includes','dim','parentSegment','Parent\x20segment\x20context:\x20','localeCompare','Recursive\x20mode:\x20enabled','journeyBundleName','Site:\x20','cause','/j/da','1216xuKIyL','journey','folders','Listing\x20folders,\x20segments,\x20and\x20journeys...','listRecursive','site','/e/','message','listUnified','4992yxXAKJ','\x20segment','journeys','listWithPattern','\x20\x20Cause:\x20','/app/ps/','description','length','children','filter','✔\x20Built\x20tree\x20with\x20'];a35_0x2ce7=function(){return _0x34d711;};return a35_0x2ce7();}import{SDKError}from'../sdk/index.js';function a35_0xf1b0(_0x1f656f,_0x4e0eba){_0x1f656f=_0x1f656f-0xf5;const _0x2ce7fa=a35_0x2ce7();let _0xf1b07a=_0x2ce7fa[_0x1f656f];return _0xf1b07a;}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 a35_0x5bc750 from'chalk';export class SegmentsCommand extends BaseCommand{[a35_0x3b86ff(0x100)]=a35_0x3b86ff(0x13c);[a35_0x3b86ff(0x130)]='List\x20folders\x20and\x20child\x20segments';async[a35_0x3b86ff(0x13d)](_0x328810){const _0x1fa1ae=a35_0x3b86ff,{options:_0x521029,args:_0x3a09a2}=_0x328810,_0x43c09e=_0x521029['recursive'],_0x4a2b6e=_0x3a09a2[0x0];try{const _0x1c66c8=_0x521029[_0x1fa1ae(0x119)];_0x521029['verbose']&&(console['error'](_0x1fa1ae(0x11e)+_0x521029['site']),console[_0x1fa1ae(0x112)](_0x1fa1ae(0x11a)+(_0x1c66c8||_0x1fa1ae(0x10b))),_0x4a2b6e&&console[_0x1fa1ae(0x112)](_0x1fa1ae(0x136)+_0x4a2b6e),_0x43c09e&&console[_0x1fa1ae(0x112)](_0x1fa1ae(0x11c)));if(!_0x1c66c8)return console[_0x1fa1ae(0x112)](_0x1fa1ae(0x140)),console[_0x1fa1ae(0x112)](''),console['error'](_0x1fa1ae(0x13f)),console[_0x1fa1ae(0x112)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x1fa1ae(0x112)](_0x1fa1ae(0xfc)),console[_0x1fa1ae(0x112)](''),console['error'](_0x1fa1ae(0xfb)),0x1;const _0x17ea4b=_0x4a2b6e&&(_0x4a2b6e[_0x1fa1ae(0x117)]('*')||_0x4a2b6e[_0x1fa1ae(0x117)]('?'));if(_0x17ea4b)return await this[_0x1fa1ae(0x12d)](_0x328810,_0x1c66c8,_0x4a2b6e);const _0x2ebbcf=_0x4a2b6e?_0x1c66c8+'/'+_0x4a2b6e:_0x1c66c8;return _0x43c09e?await this[_0x1fa1ae(0x125)](_0x328810,_0x2ebbcf):await this[_0x1fa1ae(0x129)](_0x328810,_0x2ebbcf);}catch(_0xa327ac){if(_0xa327ac instanceof SDKError)return console[_0x1fa1ae(0x112)](_0x1fa1ae(0x10f)+_0xa327ac[_0x1fa1ae(0x128)]),_0xa327ac['cause']&&console[_0x1fa1ae(0x112)](_0x1fa1ae(0x12e)+_0xa327ac[_0x1fa1ae(0x11f)]),0x1;throw _0xa327ac;}}async['listWithPattern'](_0x31ddc0,_0x48ecf6,_0xcf6109){const _0x139f78=a35_0x3b86ff,{options:_0x18b7cc,tdx:_0x3625df}=_0x31ddc0,_0x354bc9=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x48ecf6+_0x139f78(0x110),()=>_0x3625df['segment'][_0x139f78(0x114)](_0x48ecf6),{'verbose':_0x18b7cc[_0x139f78(0x137)]}),_0x4dfdc1=_0x354bc9[_0x139f78(0x139)],_0xda8bd1=await withSpinner(_0x139f78(0x124),()=>_0x3625df['segment'][_0x139f78(0x13b)](_0x4dfdc1['parentId'],_0x4dfdc1[_0x139f78(0x109)]),{'verbose':_0x18b7cc[_0x139f78(0x137)]}),{folders:_0x4cb4f3,segments:_0x5b78c3,journeys:_0x2492a9}=_0xda8bd1[_0x139f78(0x139)],_0xd45eb8=_0xcf6109[_0x139f78(0x10c)](/[.+^${}()|[\]\\]/g,_0x139f78(0xff))[_0x139f78(0x10c)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4a7b5d=new RegExp('^'+_0xd45eb8+'$','i'),_0x4df28d=_0x4cb4f3[_0x139f78(0x133)](_0x39a737=>_0x4a7b5d['test'](_0x39a737[_0x139f78(0x100)])),_0x52e0d3=_0x5b78c3['filter'](_0x4f0c71=>_0x4a7b5d['test'](_0x4f0c71[_0x139f78(0x100)])),_0x2b9bbd=_0x2492a9[_0x139f78(0x133)](_0x4edc1b=>_0x4a7b5d[_0x139f78(0xfe)](_0x4edc1b['journeyBundleName'])),_0x5b0197=_0x4df28d[_0x139f78(0x131)]+_0x52e0d3[_0x139f78(0x131)]+_0x2b9bbd[_0x139f78(0x131)];console[_0x139f78(0x112)](_0x139f78(0x113)+_0x4df28d[_0x139f78(0x131)]+_0x139f78(0x105)+(_0x4df28d[_0x139f78(0x131)]!==0x1?'s':'')+',\x20'+_0x52e0d3['length']+_0x139f78(0x12b)+(_0x52e0d3[_0x139f78(0x131)]!==0x1?'s':'')+_0x139f78(0xf8)+_0x2b9bbd['length']+_0x139f78(0x10a)+(_0x2b9bbd[_0x139f78(0x131)]!==0x1?'s':'')+_0x139f78(0x102)+_0xcf6109+'\x27');const _0x132157=_0x1d0a34=>{const _0x45214b=_0x139f78;return getConsoleNextUrl(_0x18b7cc[_0x45214b(0x126)],_0x45214b(0x12f)+_0x4dfdc1['parentId']+_0x45214b(0x127)+_0x1d0a34);},_0x2fe8eb=_0x18b7cc[_0x139f78(0x103)]===_0x139f78(0x108)||_0x18b7cc[_0x139f78(0x103)]===_0x139f78(0x111);if(_0x2fe8eb){const _0x17ac75=[..._0x4df28d['map'](_0x21fa3a=>({..._0x21fa3a,'type':_0x139f78(0x13a)})),..._0x52e0d3[_0x139f78(0x10e)](_0x4c7f08=>({..._0x4c7f08,'type':_0x139f78(0x138),'url':_0x132157(_0x4c7f08['id'])})),..._0x2b9bbd['map'](_0x24986c=>({..._0x24986c,'name':_0x24986c[_0x139f78(0x11d)],'type':_0x139f78(0x122)}))]['sort']((_0x1e42d0,_0x556b38)=>_0x1e42d0[_0x139f78(0x100)][_0x139f78(0x11b)](_0x556b38['name']));await handleSDKOutput(_0x17ac75,_0x18b7cc);}else{if(_0x5b0197===0x0)console[_0x139f78(0x101)](_0x139f78(0x106)+_0xcf6109);else{console[_0x139f78(0x101)](a35_0x5bc750[_0x139f78(0x118)]('['+_0x48ecf6+_0x139f78(0x10d)+_0xcf6109+'\x27'));const _0x27c3f2=formatFlatList(_0x4df28d,_0x52e0d3,{'showMetadata':!![],'getSegmentUrl':_0x132157},_0x2b9bbd);console['log'](_0x27c3f2);}}return 0x0;}async[a35_0x3b86ff(0x129)](_0x529fea,_0x58f6e1){const _0x15134e=a35_0x3b86ff,{options:_0x207c75,tdx:_0x293b98}=_0x529fea,_0x130385=await withSpinner('Resolving\x20path\x20\x27'+_0x58f6e1+_0x15134e(0x110),()=>_0x293b98[_0x15134e(0x138)]['resolvePathToResource'](_0x58f6e1),{'verbose':_0x207c75[_0x15134e(0x137)]}),_0x2c521a=_0x130385[_0x15134e(0x139)];_0x207c75['verbose']&&(console[_0x15134e(0x112)](_0x15134e(0xf6)+_0x2c521a['parentId']),_0x2c521a[_0x15134e(0x109)]&&console[_0x15134e(0x112)](_0x15134e(0x104)+_0x2c521a[_0x15134e(0x109)]));const _0x44749c=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x293b98[_0x15134e(0x138)]['listUnifiedWithJourneys'](_0x2c521a[_0x15134e(0x141)],_0x2c521a[_0x15134e(0x109)]),{'verbose':_0x207c75[_0x15134e(0x137)]}),{folders:_0x1d6931,segments:_0x2961fe,journeys:_0x137014}=_0x44749c[_0x15134e(0x139)],_0xb39a75=_0x1d6931[_0x15134e(0x131)]+_0x2961fe[_0x15134e(0x131)]+_0x137014[_0x15134e(0x131)];console[_0x15134e(0x112)]('✔\x20Found\x20'+_0x1d6931[_0x15134e(0x131)]+_0x15134e(0x105)+(_0x1d6931[_0x15134e(0x131)]!==0x1?'s':'')+',\x20'+_0x2961fe['length']+_0x15134e(0x12b)+(_0x2961fe[_0x15134e(0x131)]!==0x1?'s':'')+',\x20and\x20'+_0x137014[_0x15134e(0x131)]+'\x20journey'+(_0x137014['length']!==0x1?'s':''));const _0x2f0f4a=_0x41f686=>{const _0x56aabc=_0x15134e;return getConsoleNextUrl(_0x207c75[_0x56aabc(0x126)],'/app/ps/'+_0x2c521a['parentId']+_0x56aabc(0x127)+_0x41f686);},_0x476eaf=_0x3d6acf=>{const _0x4c275f=_0x15134e;return getConsoleNextUrl(_0x207c75[_0x4c275f(0x126)],_0x4c275f(0x12f)+_0x2c521a[_0x4c275f(0x141)]+_0x4c275f(0x127)+_0x3d6acf+_0x4c275f(0x120));},_0x243435=_0x207c75[_0x15134e(0x103)]===_0x15134e(0x108)||_0x207c75['format']===_0x15134e(0x111);if(_0x243435){const _0x144279=[..._0x1d6931[_0x15134e(0x10e)](_0x227ccc=>({..._0x227ccc,'type':_0x15134e(0x13a)})),..._0x2961fe[_0x15134e(0x10e)](_0x4108b1=>({..._0x4108b1,'type':_0x15134e(0x138),'url':_0x2f0f4a(_0x4108b1['id'])})),..._0x137014[_0x15134e(0x10e)](_0x5933d4=>({..._0x5933d4,'name':_0x5933d4['journeyBundleName'],'type':'journey','url':_0x476eaf(_0x5933d4['id'])}))][_0x15134e(0xfa)]((_0x163c34,_0x539a4a)=>_0x163c34['name'][_0x15134e(0x11b)](_0x539a4a[_0x15134e(0x100)]));await handleSDKOutput(_0x144279,_0x207c75);}else{if(_0xb39a75===0x0)console[_0x15134e(0x101)](a35_0x5bc750[_0x15134e(0x118)]('['+_0x58f6e1+']')),console[_0x15134e(0x101)]('(empty)');else{console[_0x15134e(0x101)](a35_0x5bc750[_0x15134e(0x118)]('['+_0x58f6e1+']'));const _0x5af1fe=formatFlatList(_0x1d6931,_0x2961fe,{'showMetadata':!![],'getSegmentUrl':_0x2f0f4a,'getJourneyUrl':_0x476eaf},_0x137014);console[_0x15134e(0x101)](_0x5af1fe);}}return 0x0;}async[a35_0x3b86ff(0x125)](_0x363ac1,_0x525274){const _0x4aef17=a35_0x3b86ff,{options:_0x17fdfa,tdx:_0x239efc}=_0x363ac1,_0x5d05bf=await withSpinner(_0x4aef17(0x107)+_0x525274+'\x27...',()=>_0x239efc[_0x4aef17(0x138)][_0x4aef17(0x114)](_0x525274),{'verbose':_0x17fdfa[_0x4aef17(0x137)]}),_0x4d20a0=_0x5d05bf[_0x4aef17(0x139)];_0x17fdfa[_0x4aef17(0x137)]&&(console[_0x4aef17(0x112)]('Parent\x20ID:\x20'+_0x4d20a0[_0x4aef17(0x141)]),_0x4d20a0['folderId']&&console[_0x4aef17(0x112)]('Folder\x20ID:\x20'+_0x4d20a0[_0x4aef17(0x109)]));const _0x19f066=_0x17fdfa['maxDepth']||0xa,_0x578f5f=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x239efc['segment'][_0x4aef17(0x125)](_0x4d20a0[_0x4aef17(0x141)],_0x4d20a0[_0x4aef17(0x109)],0x0,_0x19f066),{'verbose':_0x17fdfa[_0x4aef17(0x137)]}),_0x8ca4c7=_0x578f5f[_0x4aef17(0x139)],_0x506d5b=_0x190cc6=>{const _0x1075c1=_0x4aef17;let _0x20ac53=0x0,_0xa901b=0x0,_0x1d6bda=0x0;for(const _0x3d5232 of _0x190cc6){if(_0x3d5232['type']===_0x1075c1(0x13a))_0x20ac53++;else{if(_0x3d5232[_0x1075c1(0x116)]===_0x1075c1(0x138))_0xa901b++;else{if(_0x3d5232[_0x1075c1(0x116)]===_0x1075c1(0x122))_0x1d6bda++;}}if(_0x3d5232[_0x1075c1(0x132)]){const _0x381ed3=_0x506d5b(_0x3d5232['children']);_0x20ac53+=_0x381ed3[_0x1075c1(0x123)],_0xa901b+=_0x381ed3[_0x1075c1(0x13c)],_0x1d6bda+=_0x381ed3[_0x1075c1(0x12c)];}}return{'folders':_0x20ac53,'segments':_0xa901b,'journeys':_0x1d6bda};},_0x3749f1=_0x506d5b(_0x8ca4c7);console['error'](_0x4aef17(0x134)+_0x3749f1[_0x4aef17(0x123)]+_0x4aef17(0x105)+(_0x3749f1[_0x4aef17(0x123)]!==0x1?'s':'')+',\x20'+_0x3749f1[_0x4aef17(0x13c)]+_0x4aef17(0x12b)+(_0x3749f1[_0x4aef17(0x13c)]!==0x1?'s':'')+',\x20and\x20'+_0x3749f1[_0x4aef17(0x12c)]+_0x4aef17(0x10a)+(_0x3749f1[_0x4aef17(0x12c)]!==0x1?'s':''));const _0x1026c1=_0x42a9d1=>{const _0x547e0f=_0x4aef17;return getConsoleNextUrl(_0x17fdfa[_0x547e0f(0x126)],'/app/ps/'+_0x4d20a0[_0x547e0f(0x141)]+_0x547e0f(0x127)+_0x42a9d1);},_0x44f435=_0x33b46b=>{const _0x4d6828=_0x4aef17;return getConsoleNextUrl(_0x17fdfa[_0x4d6828(0x126)],_0x4d6828(0x12f)+_0x4d20a0[_0x4d6828(0x141)]+_0x4d6828(0x127)+_0x33b46b+_0x4d6828(0x120));};if(_0x17fdfa['format']===_0x4aef17(0x108)||_0x17fdfa[_0x4aef17(0x103)]===_0x4aef17(0x111))await handleSDKOutput(_0x8ca4c7,_0x17fdfa);else{console[_0x4aef17(0x101)](a35_0x5bc750[_0x4aef17(0x118)]('['+_0x525274+']'));const _0x93152d=formatTree(_0x8ca4c7,{'showMetadata':!![],'getSegmentUrl':_0x1026c1,'getJourneyUrl':_0x44f435});console[_0x4aef17(0x101)](_0x93152d);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a36_0x3464da=a36_0x25a7;(function(_0x20f480,_0x5aea99){const _0xfa49=a36_0x25a7,_0x9b0308=_0x20f480();while(!![]){try{const _0x541334=parseInt(_0xfa49(0x168))/0x1+-parseInt(_0xfa49(0x16a))/0x2+-parseInt(_0xfa49(0x172))/0x3*(parseInt(_0xfa49(0x14b))/0x4)+-parseInt(_0xfa49(0x151))/0x5+-parseInt(_0xfa49(0x154))/0x6*(-parseInt(_0xfa49(0x14f))/0x7)+-parseInt(_0xfa49(0x15b))/0x8*(-parseInt(_0xfa49(0x176))/0x9)+parseInt(_0xfa49(0x173))/0xa;if(_0x541334===_0x5aea99)break;else _0x9b0308['push'](_0x9b0308['shift']());}catch(_0x361fc6){_0x9b0308['push'](_0x9b0308['shift']());}}}(a36_0x4fff,0x7ec2e));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';function a36_0x25a7(_0xa6fd8,_0x1639c8){_0xa6fd8=_0xa6fd8-0x149;const _0x4fff29=a36_0x4fff();let _0x25a70d=_0x4fff29[_0xa6fd8];return _0x25a70d;}import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';function a36_0x4fff(){const _0x3630f7=['903gaFUyK','2261310QpcDOm','table','database','3753iVQRFh','verbose','catalog','limit','5484fXYcLF','...','name','Usage:\x20tdx\x20show\x20<database.table>','21YBZWSN','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','1466040qvlBXa','Error:\x20','site','1962318ovGQtP','query','execute','\x20\x20Cause:\x20','Catalog:\x20','Limit:\x20','data','14592KpYxpF','\x20row','show','\x20from\x20','Querying\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','message','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','validate','Site:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','args','Table:\x20','194924IxAoxB','description','1875458uWzuxr','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','length','error','showTable','Database:\x20','Show\x20table\x20contents','cause'];a36_0x4fff=function(){return _0x3630f7;};return a36_0x4fff();}export class ShowCommand extends BaseCommand{[a36_0x3464da(0x14d)]=a36_0x3464da(0x15d);[a36_0x3464da(0x169)]=a36_0x3464da(0x170);async[a36_0x3464da(0x156)](_0x3e73ed){const _0x55c7e1=a36_0x3464da;return this[_0x55c7e1(0x16e)](_0x3e73ed);}async[a36_0x3464da(0x16e)](_0x3eba4f){const _0x2bf2a=a36_0x3464da,{options:_0x5e6fd4,args:_0x276ec8,tdx:_0x5f2095}=_0x3eba4f;let _0x5a5fa6;try{_0x5a5fa6=parseTableReference(_0x276ec8[0x0]);const _0x1488b8=_0x5e6fd4[_0x2bf2a(0x175)];!_0x5a5fa6[_0x2bf2a(0x175)]&&_0x1488b8&&(_0x5a5fa6['database']=_0x1488b8);const _0x5acb24=validateTableDescribeReference(_0x5a5fa6);if(_0x5acb24)return console[_0x2bf2a(0x16d)](_0x2bf2a(0x152)+_0x5acb24),console['error']('Usage:\x20tdx\x20show\x20<database.table>'),console['error'](_0x2bf2a(0x162)),console['error'](_0x2bf2a(0x165)),0x1;}catch(_0x3f2917){return console[_0x2bf2a(0x16d)](_0x2bf2a(0x152)+_0x3f2917[_0x2bf2a(0x161)]),console[_0x2bf2a(0x16d)](_0x2bf2a(0x14e)),console['error'](_0x2bf2a(0x162)),console[_0x2bf2a(0x16d)]('\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>'),0x1;}const _0x8d7b52=_0x5a5fa6[_0x2bf2a(0x149)],_0x1dfb81=_0x5a5fa6['database'],_0x1f1c53=_0x5a5fa6[_0x2bf2a(0x174)],_0x24c6f0=resolveLimit(_0x5e6fd4[_0x2bf2a(0x14a)],DEFAULT_DISPLAY_LIMIT);try{_0x5e6fd4['verbose']&&(console[_0x2bf2a(0x16d)](_0x2bf2a(0x164)+_0x5e6fd4[_0x2bf2a(0x153)]),_0x8d7b52&&console[_0x2bf2a(0x16d)](_0x2bf2a(0x158)+_0x8d7b52),console[_0x2bf2a(0x16d)](_0x2bf2a(0x16f)+_0x1dfb81),console[_0x2bf2a(0x16d)](_0x2bf2a(0x167)+_0x1f1c53),console[_0x2bf2a(0x16d)](_0x2bf2a(0x159)+_0x24c6f0));const _0x45e568=_0x8d7b52?_0x8d7b52+'.'+_0x1dfb81+'.'+_0x1f1c53:_0x1dfb81+'.'+_0x1f1c53,_0x36f394=await withSpinner(_0x2bf2a(0x15f)+_0x45e568+_0x2bf2a(0x14c),()=>_0x5f2095[_0x2bf2a(0x155)][_0x2bf2a(0x16e)](_0x1dfb81,_0x1f1c53,_0x24c6f0,_0x8d7b52),{'verbose':_0x5e6fd4[_0x2bf2a(0x177)]}),_0x27ba84=_0x36f394[_0x2bf2a(0x15a)],_0x5d9615=_0x27ba84['data'];return _0x5d9615[_0x2bf2a(0x16c)]===0x0?console[_0x2bf2a(0x16d)](_0x2bf2a(0x160)):console[_0x2bf2a(0x16d)]('✔\x20Retrieved\x20'+_0x5d9615[_0x2bf2a(0x16c)]+_0x2bf2a(0x15c)+(_0x5d9615[_0x2bf2a(0x16c)]!==0x1?'s':'')+_0x2bf2a(0x15e)+_0x45e568),await handleSDKOutput(_0x5d9615,_0x5e6fd4),0x0;}catch(_0x3a095e){if(_0x3a095e instanceof SDKError)return console['error'](_0x2bf2a(0x152)+_0x3a095e['message']),_0x3a095e[_0x2bf2a(0x171)]&&console[_0x2bf2a(0x16d)](_0x2bf2a(0x157)+_0x3a095e[_0x2bf2a(0x171)]),0x1;throw _0x3a095e;}}[a36_0x3464da(0x163)](_0x1557cb){const _0x4f6649=a36_0x3464da;if(_0x1557cb['args'][_0x4f6649(0x16c)]===0x0)return _0x4f6649(0x150);if(_0x1557cb[_0x4f6649(0x166)][_0x4f6649(0x16c)]>0x1)return _0x4f6649(0x16b);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x6aec13=a37_0x27b2;(function(_0x115d37,_0x5d3cfe){const _0x31ab5a=a37_0x27b2,_0x37ea13=_0x115d37();while(!![]){try{const _0x562636=-parseInt(_0x31ab5a(0x1c8))/0x1+parseInt(_0x31ab5a(0x1cd))/0x2+-parseInt(_0x31ab5a(0x1b6))/0x3*(parseInt(_0x31ab5a(0x1ad))/0x4)+-parseInt(_0x31ab5a(0x1cc))/0x5+-parseInt(_0x31ab5a(0x1b2))/0x6*(-parseInt(_0x31ab5a(0x1d0))/0x7)+parseInt(_0x31ab5a(0x1d2))/0x8*(parseInt(_0x31ab5a(0x1b7))/0x9)+parseInt(_0x31ab5a(0x1af))/0xa;if(_0x562636===_0x5d3cfe)break;else _0x37ea13['push'](_0x37ea13['shift']());}catch(_0xfa6e9a){_0x37ea13['push'](_0x37ea13['shift']());}}}(a37_0xbf59,0xb0170));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a37_0x15536b from'chalk';function a37_0x27b2(_0x232202,_0x27c5d2){_0x232202=_0x232202-0x1a3;const _0xbf59df=a37_0xbf59();let _0x27b225=_0xbf59df[_0x232202];return _0x27b225;}function a37_0xbf59(){const _0x5d8296=['bold','Read\x20credential\x20from\x20','\x20profile:\x20','log','join','first_name','tdx','profileSource','275786lQcdWS','✓\x20Authentication\x20successful\x0a','Show\x20authentication\x20status\x20and\x20current\x20context','account_id','4304335jxpqmk','658780SMPtye','dim','cli','1520995yraQAk','Account\x20ID:','2509688ZeEemG','(from\x20','No\x20credential\x20found','cyan','jobs','config','email','last_name','displayWithSources','site','TDX_PROFILE\x20env','2639324EDWWOc','Name:','23171930HSfEbq','message','status','6DyQszY','✗\x20Validation\x20failed:\x20','execute','site:\x20','6PdcTce','9FqGPON','User:','filter','name','red','profile','green','yellow','session'];a37_0xbf59=function(){return _0x5d8296;};return a37_0xbf59();}export class StatusCommand extends BaseCommand{[a37_0x6aec13(0x1ba)]=a37_0x6aec13(0x1b1);['description']=a37_0x6aec13(0x1ca);async[a37_0x6aec13(0x1b4)](_0x43423f){const _0x534ec3=a37_0x6aec13,{options:_0x579452,tdx:_0x4c4a3e}=_0x43423f,_0x4b009b=_0x579452[_0x534ec3(0x1ab)],_0x5970a7=new GlobalContext(_0x579452),_0x1e6645=_0x5970a7[_0x534ec3(0x1bc)],_0x527b80=_0x5970a7[_0x534ec3(0x1c7)],_0x160fe8=_0x527b80===_0x534ec3(0x1cf)?'CLI\x20flag':_0x527b80===_0x534ec3(0x1bf)?_0x534ec3(0x1bf):_0x527b80==='env'?_0x534ec3(0x1ac):_0x527b80==='config'?_0x534ec3(0x1a7):null,_0x14374d=_0x1e6645?a37_0x15536b[_0x534ec3(0x1a5)](_0x1e6645):a37_0x15536b[_0x534ec3(0x1ce)]('N/A'),_0x27ae9e=_0x160fe8?'\x20'+a37_0x15536b[_0x534ec3(0x1ce)](_0x534ec3(0x1a3)+_0x160fe8+')'):'';console[_0x534ec3(0x1c3)](a37_0x15536b[_0x534ec3(0x1c0)](_0x534ec3(0x1c6))+_0x534ec3(0x1c2)+_0x14374d+_0x27ae9e+'\x20'+a37_0x15536b[_0x534ec3(0x1ce)]('(')+_0x534ec3(0x1b5)+a37_0x15536b[_0x534ec3(0x1a5)](_0x4b009b)+a37_0x15536b[_0x534ec3(0x1ce)](')'));const _0x683b9d=await resolveAPIKeyAsync(_0x4b009b,_0x1e6645);if(_0x683b9d){const {source:_0x2de45f,isDeprecated:_0x3360ed}=_0x683b9d,_0x1d9d52=_0x534ec3(0x1c1)+a37_0x15536b[_0x534ec3(0x1a5)](_0x2de45f);console[_0x534ec3(0x1c3)](_0x3360ed?a37_0x15536b[_0x534ec3(0x1be)](_0x1d9d52):_0x1d9d52);}else console[_0x534ec3(0x1c3)](a37_0x15536b['yellow'](_0x534ec3(0x1a4)));let _0x1bb4d0=![];try{const _0x3ff9e3=await _0x4c4a3e[_0x534ec3(0x1a6)]['getUserInfo']();console[_0x534ec3(0x1c3)](a37_0x15536b[_0x534ec3(0x1bd)](_0x534ec3(0x1c9))),console[_0x534ec3(0x1c3)](a37_0x15536b[_0x534ec3(0x1c0)](_0x534ec3(0x1b8))+'\x20'+a37_0x15536b['cyan'](_0x3ff9e3[_0x534ec3(0x1a8)]));if(_0x3ff9e3['first_name']||_0x3ff9e3[_0x534ec3(0x1a9)]){const _0x2588f4=[_0x3ff9e3[_0x534ec3(0x1c5)],_0x3ff9e3['last_name']][_0x534ec3(0x1b9)](Boolean)[_0x534ec3(0x1c4)]('\x20');console[_0x534ec3(0x1c3)](a37_0x15536b[_0x534ec3(0x1c0)](_0x534ec3(0x1ae))+'\x20'+_0x2588f4);}_0x3ff9e3['account_id']&&console[_0x534ec3(0x1c3)](a37_0x15536b[_0x534ec3(0x1c0)](_0x534ec3(0x1d1))+'\x20'+a37_0x15536b['yellow'](_0x3ff9e3[_0x534ec3(0x1cb)])),_0x1bb4d0=!![];}catch(_0x2ca0f9){_0x2ca0f9 instanceof HTTPClientError&&_0x2ca0f9[_0x534ec3(0x1b1)]===0x191?printAuthError(_0x2ca0f9,!![],_0x1e6645):console['error'](a37_0x15536b[_0x534ec3(0x1bb)](_0x534ec3(0x1b3)+(_0x2ca0f9 instanceof Error?_0x2ca0f9[_0x534ec3(0x1b0)]:String(_0x2ca0f9))));}return console[_0x534ec3(0x1c3)](),_0x5970a7[_0x534ec3(0x1aa)](),_0x1bb4d0?0x0:0x1;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a38_0x2608e4=a38_0xa182;(function(_0x57465e,_0x162db6){const _0x477d1d=a38_0xa182,_0x3a72e7=_0x57465e();while(!![]){try{const _0x562596=parseInt(_0x477d1d(0x12e))/0x1*(-parseInt(_0x477d1d(0x11a))/0x2)+-parseInt(_0x477d1d(0x115))/0x3*(parseInt(_0x477d1d(0x136))/0x4)+parseInt(_0x477d1d(0x138))/0x5*(-parseInt(_0x477d1d(0x12d))/0x6)+-parseInt(_0x477d1d(0x112))/0x7+-parseInt(_0x477d1d(0x128))/0x8+parseInt(_0x477d1d(0x123))/0x9*(parseInt(_0x477d1d(0x131))/0xa)+parseInt(_0x477d1d(0x132))/0xb;if(_0x562596===_0x162db6)break;else _0x3a72e7['push'](_0x3a72e7['shift']());}catch(_0x30d19b){_0x3a72e7['push'](_0x3a72e7['shift']());}}}(a38_0x42d3,0xa2bb1));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';function a38_0x42d3(){const _0x5c3240=['\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','cause','13306sLFXWw','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','tables','✖\x20No\x20tables\x20found','\x27\x20across\x20all\x20databases.','site','Error:\x20Pattern\x20\x27','Database:\x20','Note:\x20\x27','855vnJJsy','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','verbose','database','\x27\x20is\x20ambiguous.','400720nbYZqi','validate','listTables','limit','\x20\x20Use:\x20tdx\x20tables\x20\x22','30qSsKbq','78WbFwfS','error','message','74780kzUavS','19317155ppXAiv','includes','Or\x20use\x20--in\x20flag:','Database\x20\x27','42748ZpYinD','table','948585Ccdtsc','Table\x20pattern:\x20','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Database\x20pattern:\x20','length','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','Listing\x20tables...','name','Site:\x20','Error:\x20','query','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','✔\x20Found\x20','1752100EJTXLj','data','\x20table','9GWPfRo','.*\x22','\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'];a38_0x42d3=function(){return _0x5c3240;};return a38_0x42d3();}import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';function a38_0xa182(_0x49b84a,_0xdc7da9){_0x49b84a=_0x49b84a-0x112;const _0x42d3f6=a38_0x42d3();let _0xa18230=_0x42d3f6[_0x49b84a];return _0xa18230;}export class TablesCommand extends BaseCommand{[a38_0x2608e4(0x13f)]=a38_0x2608e4(0x11c);['description']='List\x20tables\x20in\x20a\x20database';async['execute'](_0x5202ad){const _0x77d38b=a38_0x2608e4,{options:_0x2be041,args:_0x3c190d,tdx:_0x458c1b}=_0x5202ad;let _0x3a16d7;if(_0x3c190d['length']===0x0)_0x3a16d7={'database':undefined,'table':undefined,'original':''};else{if(_0x3c190d[_0x77d38b(0x13c)]===0x1)try{_0x3a16d7=parseTableReference(_0x3c190d[0x0]);if(_0x3a16d7[_0x77d38b(0x137)]&&!_0x3a16d7[_0x77d38b(0x126)]&&!_0x3a16d7[_0x77d38b(0x137)][_0x77d38b(0x133)]('*')&&!_0x3a16d7[_0x77d38b(0x137)][_0x77d38b(0x133)]('?'))return console[_0x77d38b(0x12f)](_0x77d38b(0x120)+_0x3c190d[0x0]+_0x77d38b(0x127)),console[_0x77d38b(0x12f)]('Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27'+_0x3a16d7[_0x77d38b(0x137)]+'\x27?'),console[_0x77d38b(0x12f)](_0x77d38b(0x12c)+_0x3a16d7[_0x77d38b(0x137)]+_0x77d38b(0x116)),console['error'](_0x77d38b(0x118)+_0x3a16d7['table']),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x3a16d7[_0x77d38b(0x137)]),console[_0x77d38b(0x12f)](''),console['error'](_0x77d38b(0x122)+_0x3c190d[0x0]+_0x77d38b(0x13d)+_0x3a16d7[_0x77d38b(0x137)]+_0x77d38b(0x11e)),0x1;}catch(_0x2a0af6){return console[_0x77d38b(0x12f)](_0x77d38b(0x141)+_0x2a0af6[_0x77d38b(0x130)]),0x1;}else return console[_0x77d38b(0x12f)](_0x77d38b(0x11b)),console['error'](_0x77d38b(0x13a)),console[_0x77d38b(0x12f)]('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console['error'](_0x77d38b(0x117)),console[_0x77d38b(0x12f)](_0x77d38b(0x124)),console['error'](_0x77d38b(0x134)),console['error'](_0x77d38b(0x143)),0x1;}const _0x221e4a=_0x2be041[_0x77d38b(0x126)];!_0x3a16d7[_0x77d38b(0x126)]&&_0x221e4a&&(_0x3a16d7[_0x77d38b(0x126)]=_0x221e4a);try{const _0x240519=_0x19d36d=>_0x19d36d&&(_0x19d36d['includes']('*')||_0x19d36d[_0x77d38b(0x133)]('?')),_0x59878c=_0x240519(_0x3a16d7[_0x77d38b(0x126)]);_0x2be041[_0x77d38b(0x125)]&&(console['error'](_0x77d38b(0x140)+_0x2be041[_0x77d38b(0x11f)]),_0x3a16d7[_0x77d38b(0x126)]?_0x59878c?console[_0x77d38b(0x12f)](_0x77d38b(0x13b)+_0x3a16d7[_0x77d38b(0x126)]):console[_0x77d38b(0x12f)](_0x77d38b(0x121)+_0x3a16d7[_0x77d38b(0x126)]):console[_0x77d38b(0x12f)]('Database:\x20all'),_0x3a16d7['table']&&console['error'](_0x77d38b(0x139)+_0x3a16d7[_0x77d38b(0x137)]));const _0x1cd463=_0x3a16d7['database']&&!_0x59878c?_0x3a16d7['database']:undefined,_0x35c19e=_0x59878c?_0x3a16d7['database']:undefined,_0x47c202=_0x3a16d7[_0x77d38b(0x137)],_0x547b0e=resolveLimit(_0x2be041[_0x77d38b(0x12b)],DEFAULT_LISTING_LIMIT),_0x2d2f2b=await withSpinner(_0x77d38b(0x13e),()=>_0x458c1b[_0x77d38b(0x142)][_0x77d38b(0x12a)](_0x1cd463,_0x47c202,_0x35c19e,_0x547b0e),{'verbose':_0x2be041[_0x77d38b(0x125)]}),_0x293da6=_0x2d2f2b[_0x77d38b(0x113)];if(_0x293da6[_0x77d38b(0x13c)]===0x0&&_0x3a16d7[_0x77d38b(0x126)]&&!_0x59878c)return console[_0x77d38b(0x12f)](_0x77d38b(0x11d)),console[_0x77d38b(0x12f)](_0x77d38b(0x135)+_0x3a16d7[_0x77d38b(0x126)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console[_0x77d38b(0x12f)](_0x77d38b(0x144)+_0x293da6['length']+_0x77d38b(0x114)+(_0x293da6[_0x77d38b(0x13c)]!==0x1?'s':'')),await handleSDKOutput(_0x293da6,{..._0x2be041,'limit':_0x547b0e}),0x0;}catch(_0x3311){if(_0x3311 instanceof SDKError)return console[_0x77d38b(0x12f)]('Error:\x20'+_0x3311[_0x77d38b(0x130)]),_0x3311[_0x77d38b(0x119)]&&console[_0x77d38b(0x12f)]('\x20\x20Cause:\x20'+_0x3311['cause']),0x1;throw _0x3311;}}[a38_0x2608e4(0x129)](_0x1d360d){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a39_0x58e4e8=a39_0x48a6;(function(_0x255038,_0x46c4c4){const _0x201c60=a39_0x48a6,_0x341ee8=_0x255038();while(!![]){try{const _0x6d9f56=parseInt(_0x201c60(0x172))/0x1+parseInt(_0x201c60(0x18a))/0x2+parseInt(_0x201c60(0x17c))/0x3*(-parseInt(_0x201c60(0x16d))/0x4)+parseInt(_0x201c60(0x164))/0x5*(parseInt(_0x201c60(0x18b))/0x6)+-parseInt(_0x201c60(0x17d))/0x7*(parseInt(_0x201c60(0x180))/0x8)+parseInt(_0x201c60(0x179))/0x9*(parseInt(_0x201c60(0x167))/0xa)+parseInt(_0x201c60(0x175))/0xb;if(_0x6d9f56===_0x46c4c4)break;else _0x341ee8['push'](_0x341ee8['shift']());}catch(_0x4684b7){_0x341ee8['push'](_0x341ee8['shift']());}}}(a39_0x1b28,0x47dab));import{BaseCommand}from'./command.js';function a39_0x48a6(_0x88fd74,_0x6029ba){_0x88fd74=_0x88fd74-0x161;const _0x1b2805=a39_0x1b28();let _0x48a641=_0x1b2805[_0x88fd74];return _0x48a641;}import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a39_0x37c19e from'chalk';import*as a39_0x22ce21 from'node:path';export class UnsetCommand extends BaseCommand{['name']=a39_0x58e4e8(0x170);[a39_0x58e4e8(0x16b)]=a39_0x58e4e8(0x18c);[a39_0x58e4e8(0x185)](_0x115f86){const _0x2b26d8=a39_0x58e4e8,{args:_0x47442a,options:_0x2a93a0}=_0x115f86,_0x3dd163=_0x2a93a0[_0x2b26d8(0x187)];if(_0x47442a[_0x2b26d8(0x17f)]===0x0)return _0x2b26d8(0x174)+_0x2b26d8(0x189)+_0x2b26d8(0x16f)+_0x2b26d8(0x169);const _0x1ea998=_0x47442a[0x0],_0x127374=[_0x2b26d8(0x182),_0x2b26d8(0x16c),_0x2b26d8(0x181),_0x2b26d8(0x17a),_0x2b26d8(0x163),_0x2b26d8(0x161),_0x2b26d8(0x166)];if(!_0x127374[_0x2b26d8(0x171)](_0x1ea998))return'Invalid\x20resource:\x20'+_0x1ea998+_0x2b26d8(0x17e)+_0x127374[_0x2b26d8(0x186)](',\x20');if(_0x3dd163&&_0x1ea998!==_0x2b26d8(0x182)&&_0x1ea998!==_0x2b26d8(0x161))return _0x2b26d8(0x16e);return undefined;}async[a39_0x58e4e8(0x165)](_0x566769){const _0x272385=a39_0x58e4e8,{args:_0x47cd10,options:_0x3f96b3}=_0x566769,_0x1b7613=_0x3f96b3[_0x272385(0x187)];cleanExpiredSessions();try{const _0x1305e2=_0x47cd10[0x0],_0x3023ac=a39_0x22ce21['join'](getConfigDir(),_0x272385(0x184));if(_0x1b7613){if(_0x1305e2===_0x272385(0x182))return clearDefaultSiteFromUserConfig(),console['log'](_0x272385(0x162)+a39_0x37c19e[_0x272385(0x188)](_0x272385(0x168))),console[_0x272385(0x183)](a39_0x37c19e[_0x272385(0x177)](_0x272385(0x16a)+_0x3023ac)),0x0;if(_0x1305e2===_0x272385(0x161))return clearActiveProfileFromUserConfig(),console[_0x272385(0x183)]('Default\x20profile\x20'+a39_0x37c19e[_0x272385(0x188)](_0x272385(0x168))),console['log'](a39_0x37c19e[_0x272385(0x177)](_0x272385(0x16a)+_0x3023ac)),0x0;}const _0x4346be=getSessionID(_0x3f96b3[_0x272385(0x173)]),_0x5722ee={'site':_0x272385(0x182),'database':_0x272385(0x16c),'parent_segment':'parent_segment','llm_project':_0x272385(0x17a),'agent':'llm_agent','profile':_0x272385(0x161),'engage_workspace':_0x272385(0x166)},_0x2144a8=_0x5722ee[_0x1305e2];return _0x2144a8&&(clearSessionContextField(_0x2144a8,_0x3f96b3['session']),console[_0x272385(0x183)]('Session\x20'+_0x1305e2+'\x20'+a39_0x37c19e[_0x272385(0x188)](_0x272385(0x168))+'\x20'+a39_0x37c19e[_0x272385(0x177)](_0x272385(0x176)+_0x4346be+')'))),0x0;}catch(_0x2487e8){return _0x2487e8 instanceof Error&&console[_0x272385(0x178)](_0x272385(0x17b)+_0x2487e8['message']),0x1;}}}function a39_0x1b28(){const _0xcafadb=['87DRRJzD','28ctPEQk','.\x20Must\x20be\x20one\x20of:\x20','length','748232SzvGmU','parent_segment','site','log','tdx.json','validate','join','default','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','422600SIFMDy','13362riIYTD','Clear\x20session-level\x20or\x20default\x20context\x20values','profile','Default\x20site\x20','agent','105jSUSzP','execute','engage_workspace','10AmAnru','cleared','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','\x0aUpdated:\x20','description','database','69144UrhlkS','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','unset','includes','528529oBqRLn','session','Usage:\x20tdx\x20unset\x20<resource>\x0a','4041466lWLBbr','(session:\x20','dim','error','141507tYXCbn','llm_project','Error:\x20'];a39_0x1b28=function(){return _0xcafadb;};return a39_0x1b28();}
|