@treasuredata/tdx 0.16.9 → 0.16.10
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/README.md +3 -2
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/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.d.ts.map +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/claude-usage-command.js.map +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/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/llm-proxy.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/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/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.d.ts +31 -0
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/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.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +0 -1
- package/dist/sdk/index.d.ts.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.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/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.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.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
- package/dist/sdk/claude-agent/claude-agent-client.d.ts +0 -73
- package/dist/sdk/claude-agent/claude-agent-client.d.ts.map +0 -1
- package/dist/sdk/claude-agent/claude-agent-client.js +0 -1
- package/dist/sdk/claude-agent/claude-agent-client.js.map +0 -1
- package/dist/sdk/claude-agent/environment.d.ts +0 -59
- package/dist/sdk/claude-agent/environment.d.ts.map +0 -1
- package/dist/sdk/claude-agent/environment.js +0 -1
- package/dist/sdk/claude-agent/environment.js.map +0 -1
- package/dist/sdk/claude-agent/index.d.ts +0 -15
- package/dist/sdk/claude-agent/index.d.ts.map +0 -1
- package/dist/sdk/claude-agent/index.js +0 -1
- package/dist/sdk/claude-agent/index.js.map +0 -1
- package/dist/sdk/claude-agent/system-prompts.d.ts +0 -22
- package/dist/sdk/claude-agent/system-prompts.d.ts.map +0 -1
- package/dist/sdk/claude-agent/system-prompts.js +0 -1
- package/dist/sdk/claude-agent/system-prompts.js.map +0 -1
- package/dist/sdk/claude-agent/types.d.ts +0 -107
- package/dist/sdk/claude-agent/types.d.ts.map +0 -1
- package/dist/sdk/claude-agent/types.js +0 -1
- package/dist/sdk/claude-agent/types.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function a31_0x3918(_0x463b7c,_0x4f64ea){_0x463b7c=_0x463b7c-0x64;const _0x16629f=a31_0x1662();let _0x39185d=_0x16629f[_0x463b7c];return _0x39185d;}const a31_0x4b215c=a31_0x3918;(function(_0x24be40,_0x27c1fa){const _0x519441=a31_0x3918,_0x4a4d17=_0x24be40();while(!![]){try{const _0x292da1=-parseInt(_0x519441(0xe7))/0x1+-parseInt(_0x519441(0xb3))/0x2*(parseInt(_0x519441(0x90))/0x3)+parseInt(_0x519441(0xad))/0x4+-parseInt(_0x519441(0xda))/0x5*(-parseInt(_0x519441(0xd2))/0x6)+parseInt(_0x519441(0xa6))/0x7+parseInt(_0x519441(0xb8))/0x8+parseInt(_0x519441(0xa4))/0x9;if(_0x292da1===_0x27c1fa)break;else _0x4a4d17['push'](_0x4a4d17['shift']());}catch(_0x59fc8d){_0x4a4d17['push'](_0x4a4d17['shift']());}}}(a31_0x1662,0x9dc4a));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x5688a0 from'chalk';function a31_0x1662(){const _0x492bf1=['name','\x20\x20Source:\x20','journeyBundleId','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','verbose','\x20\x20Segments:\x20','906080yVtdSF','isScoped','filePath','\x20\x20\x20\x20','createdSegmentIds','targetDir','290rtqpvg','updated','state','listSegments','Fetching\x20existing\x20journeys...','1944496TruFNK','versionNumber','\x20\x20Journeys:\x20','cyan','nameToId','\x27...','buildUserMaps','\x20to\x20create','createdAt','/j/da/je','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','parentFolder','isNew','user','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','get','journeysOnly','Changes\x20to:','journeys','existingJourney','Parent\x20segment:\x20','toDelete','\x20deleted','error','Scoped\x20to\x20folder:\x20','connection','3950310nqmNbC','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Preparing\x20journeys...','Fetching\x20users\x20for\x20email\x20resolution...','segment','segmentFolderId','diff','Fetching\x20existing\x20activations...','5TqzUsB','join','errorCode','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','toCreate','created','unchanged','\x20updated','Site:\x20','\x20created','all','then','\x0a✔\x20Push\x20complete','765054TJHInS','\x20YAML\x20files\x20found','attributes','Error\x20parsing\x20YAML:\x20','\x20new','Delete\x20segment:','description','segment:push','push','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','list','set','parentName','📁\x20','\x20\x20Activations:\x20','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)','new','cwd','Fetching\x20existing\x20folders...','dryRun','yellow','yes','getOutputSchemaWithCache','listJourneysWithDetailsFromParentSegment','\x20folders\x20to\x20create','/app/ps/','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','folderPath','yamlConfig','repeat','segments','New\x20journey:','helpText','endsWith','length','filter','getParent','Fetching\x20parent\x20segment\x20details...','\x20\x20🗺️\x20\x20Journeys:','changed','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Changes\x20to\x20journey:','Delete\x20journey:','/e/','\x20to\x20delete','updatedAt','No\x20','\x20\x20Activations:','delete','listFolders','Error:\x20Directory\x20not\x20found:\x20','type','results','nameToType','message','add','Push\x20','folderId','journeyId','\x20changed','deleted','listActivations','(Journey\x20will\x20be\x20deleted)','New\x20segment:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','Error:\x20','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','map','green','\x20\x20📊\x20Segments:','getJourney','22083XjZUsI','resolveParentId','site','journeyBundleName','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','setPhase','\x20unchanged','activations','red','\x20changes?','dim','scopedFolderPath','Resolving\x20parent\x20segment\x20\x27','Fetching\x20existing\x20segments...','\x20activations]','segment\x20or\x20journey','data','file','journey','Source\x20directory:\x20','12050910jtIEWo','blue','81620nMjPzT'];a31_0x1662=function(){return _0x492bf1;};return a31_0x1662();}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']=a31_0x4b215c(0xee);[a31_0x4b215c(0xed)]=a31_0x4b215c(0x71);async['execute'](_0x52b533){const _0x2d4e29=a31_0x4b215c,{options:_0x337b6c,args:_0x35c58f,tdx:_0x1c032a}=_0x52b533,_0x840566=_0x337b6c,_0x194340=await resolveTarget({'arg':_0x35c58f[0x0],'contextParent':_0x337b6c['parentSegment'],'cwd':process[_0x2d4e29(0xf8)]()});if(!isSuccessfulResolution(_0x194340))return _0x194340[_0x2d4e29(0xdc)]==='no_parent'?(console['error'](a31_0x5688a0[_0x2d4e29(0xfb)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x2d4e29(0xcf)](_0x2d4e29(0xf6)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent'),console[_0x2d4e29(0xcf)]('\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[_0x2d4e29(0xcf)](a31_0x5688a0['red'](_0x2d4e29(0x8a)+_0x194340[_0x2d4e29(0x7f)]+'\x0a')),_0x194340[_0x2d4e29(0x69)]&&console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0xbb)](_0x194340[_0x2d4e29(0x69)]))),0x1;if(_0x194340[_0x2d4e29(0x7c)]==='parent_name')return console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0x98)](_0x2d4e29(0x7b)+_0x194340[_0x2d4e29(0xb2)]+'\x0a')),console['error'](a31_0x5688a0[_0x2d4e29(0xbb)](_0x2d4e29(0xd3))),0x1;const _0x155bdf=_0x194340[_0x2d4e29(0xf3)],_0x179e10=_0x194340[_0x2d4e29(0xb2)],_0x49f628=_0x194340['type']===_0x2d4e29(0xa1)?_0x194340[_0x2d4e29(0xaf)]:undefined,_0x43fe63=getScopedDetails(_0x194340),_0x4a3061=_0x43fe63?.[_0x2d4e29(0xae)]??![],_0x25deb7=_0x43fe63?.[_0x2d4e29(0x9b)]??'';if(!existsSync(_0x179e10))return console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0x98)](_0x2d4e29(0x7b)+_0x179e10+'\x0a')),console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0xbb)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x840566['verbose']&&(console[_0x2d4e29(0xcf)](_0x2d4e29(0xe2)+_0x840566[_0x2d4e29(0x92)]),console[_0x2d4e29(0xcf)](_0x2d4e29(0xcc)+_0x155bdf),console[_0x2d4e29(0xcf)](_0x2d4e29(0xa3)+_0x179e10),_0x4a3061&&console[_0x2d4e29(0xcf)](_0x2d4e29(0xd0)+_0x25deb7));const _0x469bf5=await withSpinner(_0x2d4e29(0x9c)+_0x155bdf+_0x2d4e29(0xbd),()=>_0x1c032a['segment'][_0x2d4e29(0x91)](_0x155bdf),{'verbose':_0x840566[_0x2d4e29(0xab)]}),_0x1eca20=_0x469bf5[_0x2d4e29(0xa0)],[_0x3d1ffc,_0x1927af,_0x5d080c,_0xdfcdc3,_0x3ded6a]=await Promise['all']([withSpinner(_0x2d4e29(0x6e),()=>_0x1c032a[_0x2d4e29(0xd6)][_0x2d4e29(0x6d)](_0x1eca20),{'verbose':_0x840566[_0x2d4e29(0xab)]}),withSpinner(_0x2d4e29(0x9d),()=>_0x1c032a[_0x2d4e29(0xd6)][_0x2d4e29(0xb6)](_0x1eca20),{'verbose':_0x840566[_0x2d4e29(0xab)]}),withSpinner(_0x2d4e29(0xf9),()=>_0x1c032a[_0x2d4e29(0xd6)][_0x2d4e29(0x7a)](_0x1eca20),{'verbose':_0x840566['verbose']}),withSpinner(_0x2d4e29(0xb7),()=>_0x1c032a[_0x2d4e29(0xa2)][_0x2d4e29(0xfe)](_0x1eca20,{'includeAllVersions':!![]}),{'verbose':_0x840566[_0x2d4e29(0xab)]}),withSpinner(_0x2d4e29(0xd5),()=>_0x1c032a[_0x2d4e29(0xc5)][_0x2d4e29(0xbe)](),{'verbose':_0x840566['verbose']})[_0x2d4e29(0xe5)](_0x11a9f7=>_0x11a9f7[_0x2d4e29(0xa0)])]),_0x212df0=_0x3d1ffc[_0x2d4e29(0xa0)],_0x34aa7a=extractRootFolderId(_0x212df0),_0x29cf6b=_0x1927af[_0x2d4e29(0xa0)],_0x4288fb=_0x5d080c[_0x2d4e29(0xa0)],{journeys:_0x90aac8,activationStepsById:_0x346cef}=_0xdfcdc3[_0x2d4e29(0xa0)],_0x4ef21e=new Map(_0x90aac8[_0x2d4e29(0x8c)](_0x274f4b=>[_0x274f4b['id'],_0x274f4b])),_0x57e18e=_0x90aac8[_0x2d4e29(0x8c)](_0x550cff=>({'id':_0x550cff['id'],'name':_0x550cff[_0x2d4e29(0xe9)][_0x2d4e29(0xa7)],'journeyBundleName':_0x550cff['attributes'][_0x2d4e29(0x93)]||'','journeyBundleId':_0x550cff[_0x2d4e29(0xe9)][_0x2d4e29(0xa9)]||'','versionNumber':_0x550cff[_0x2d4e29(0xe9)][_0x2d4e29(0xb9)],'description':_0x550cff[_0x2d4e29(0xe9)][_0x2d4e29(0xed)],'state':_0x550cff[_0x2d4e29(0xe9)][_0x2d4e29(0xb5)],'paused':_0x550cff['attributes']['paused'],'audienceId':_0x550cff['attributes']['audienceId'],'folderId':_0x550cff['relationships']?.[_0x2d4e29(0xc3)]?.['data']?.['id'],'createdAt':_0x550cff['attributes'][_0x2d4e29(0xc0)],'updatedAt':_0x550cff[_0x2d4e29(0xe9)][_0x2d4e29(0x76)]})),{emailToId:_0x4a8c18,idToEmail:_0x1970cf}=_0x3ded6a,_0x2562b5=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x519e35=_0x2d4e29,_0x32155b=await _0x1c032a[_0x519e35(0xd1)][_0x519e35(0xf1)]();return buildConnectionMaps(_0x32155b);},{'verbose':_0x840566[_0x2d4e29(0xab)]})['then'](_0x7bbb7b=>_0x7bbb7b['data']),_0xa11630=_0x2562b5[_0x2d4e29(0xbc)],_0x69c33f=_0x2562b5['idToName'],_0x1d2429=_0x2562b5[_0x2d4e29(0x7e)],_0x2958b9={'emailToIdMap':_0x4a8c18,'connectionNameToIdMap':_0xa11630,'connectionNameToTypeMap':_0x1d2429,'getSchema':_0x56edf9=>_0x1c032a[_0x2d4e29(0xd1)][_0x2d4e29(0xfd)](_0x56edf9)};let {pathToId:_0xd31df1,idToPath:_0x108e03}=buildFolderMaps(_0x4288fb);const _0x43207b=buildSegmentLookupMap(_0x29cf6b,_0x108e03),_0x4241be=buildSegmentNameToIdMap(_0x29cf6b),_0x302049=buildJourneyBundleLookupMap(_0x57e18e,_0x108e03);let _0x4107f9;if(_0x49f628){if(!_0x49f628[_0x2d4e29(0x6a)]('.yml')&&!_0x49f628[_0x2d4e29(0x6a)]('.yaml'))return console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0x98)](_0x2d4e29(0xaa)+_0x49f628+'\x0a')),0x1;_0x4107f9=[_0x49f628];}else _0x4107f9=findYamlFiles(_0x179e10);if(_0x4107f9['length']===0x0)return console['error'](a31_0x5688a0['red'](_0x2d4e29(0xc6)+_0x179e10+'\x0a')),console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0xbb)](_0x2d4e29(0xdd))),0x1;let _0x1d55f3,_0x55e794;try{const _0x28858b=parseAndClassifyYamlFiles(_0x4107f9,_0x179e10,{'skipSegments':_0x840566['journeysOnly']});_0x1d55f3=_0x28858b[_0x2d4e29(0x67)],_0x55e794=_0x28858b['journeys'];const _0x24f533=validateParsedFiles(_0x28858b,_0x179e10);if(_0x24f533[_0x2d4e29(0x6b)]>0x0)return console[_0x2d4e29(0xcf)](a31_0x5688a0['red']('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x24f533)),console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0xfb)](_0x2d4e29(0x8b))),0x1;}catch(_0x50d23e){return console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0x98)](_0x2d4e29(0xea)+(_0x50d23e instanceof Error?_0x50d23e['message']:_0x50d23e))),0x1;}if(_0x1d55f3[_0x2d4e29(0x6b)]===0x0&&_0x55e794[_0x2d4e29(0x6b)]===0x0){const _0x352aa1=_0x840566[_0x2d4e29(0xc8)]?_0x2d4e29(0xa2):_0x2d4e29(0x9f);return console['error'](a31_0x5688a0[_0x2d4e29(0xfb)](_0x2d4e29(0x77)+_0x352aa1+_0x2d4e29(0xe8))),0x0;}const _0x1ade5c=new Map();_0x29cf6b[_0x2d4e29(0x6b)]>0x0&&!_0x840566[_0x2d4e29(0xc8)]&&await withSpinner(_0x2d4e29(0xd9),async()=>{await batchAsync(_0x29cf6b,async _0x137428=>{const _0x4ef357=a31_0x3918,_0x15b1e5=await _0x1c032a['segment'][_0x4ef357(0x86)](_0x1eca20,_0x137428['id']);_0x1ade5c[_0x4ef357(0xf2)](_0x137428['id'],_0x15b1e5);});},{'verbose':_0x840566['verbose']});const {segmentFiles:_0x577541,foldersToCreate:_0x32f079}=await prepareSegmentFiles(_0x1d55f3,{'segmentByFolderAndName':_0x43207b,'activationsBySegmentId':_0x1ade5c,'folderPathToId':_0xd31df1,'idToEmailMap':_0x1970cf,'connectionIdToNameMap':_0x69c33f},_0x2958b9,_0x4a3061,_0x25deb7),_0x3cf343=_0x49f628?[]:findSegmentsToDelete(_0x29cf6b,_0x1d55f3[_0x2d4e29(0x8c)](({yamlConfig:_0x3c834d,folderPath:_0x34ac3b})=>({'yamlConfig':_0x3c834d,'folderPath':resolveTDFolderPath(_0x34ac3b,_0x4a3061,_0x25deb7)})),_0x108e03,_0x25deb7,_0x4a3061),{journeyFiles:_0x3d6852,foldersToCreate:_0x22faae}=await withProgressSpinner(_0x2d4e29(0xd4),async _0x3ee185=>prepareJourneyFiles(_0x55e794,{'fetchJourney':async _0x58ed3b=>_0x1c032a['journey'][_0x2d4e29(0x8f)](_0x58ed3b['journeyId']),'journeyBundlesByFolderAndName':_0x302049,'folderPathToId':_0xd31df1,'idToEmailMap':_0x1970cf,'connectionIdToNameMap':_0x69c33f,'existingSegments':_0x29cf6b,'parentId':_0x1eca20,'deps':_0x1c032a,'progress':{'update':_0x1c5b38=>{const _0x138fb4=_0x2d4e29;_0x3ee185[_0x138fb4(0x95)](_0x1c5b38),_0x840566[_0x138fb4(0xab)]&&console[_0x138fb4(0xcf)]('\x20\x20'+_0x1c5b38);}},'journeyById':_0x4ef21e,'activationStepsById':_0x346cef},_0x4a3061,_0x25deb7),{'verbose':_0x840566[_0x2d4e29(0xab)]})['then'](_0x4d638f=>_0x4d638f[_0x2d4e29(0xa0)]);for(const _0x3b0cfe of _0x22faae){_0x32f079[_0x2d4e29(0x80)](_0x3b0cfe);}const _0xa17362=_0x49f628?[]:findJourneysToDelete(_0x57e18e,_0x55e794[_0x2d4e29(0x8c)](({yamlConfig:_0x451b20,folderPath:_0x2e2893})=>({'yamlConfig':_0x451b20,'folderPath':resolveTDFolderPath(_0x2e2893,_0x4a3061,_0x25deb7)})),_0x108e03,_0x25deb7,_0x4a3061),_0x1974dd=calculatePushStats(_0x577541,_0x3d6852,_0x32f079,_0x3cf343,_0xa17362,!!_0x840566[_0x2d4e29(0x79)],!!_0x840566[_0x2d4e29(0xc8)]),_0x2c59b7=_0x1974dd[_0x2d4e29(0x67)][_0x2d4e29(0xf7)],_0x475d30=_0x1974dd[_0x2d4e29(0x67)][_0x2d4e29(0x70)],_0x550539=_0x1974dd['segments'][_0x2d4e29(0xe0)],_0x28c921=_0x1974dd[_0x2d4e29(0x67)][_0x2d4e29(0xcd)],_0x390e5e=_0x1974dd['folders'][_0x2d4e29(0xde)],_0x304151=_0x1974dd[_0x2d4e29(0xca)][_0x2d4e29(0xf7)],_0x7f1ad7=_0x1974dd['journeys'][_0x2d4e29(0x70)],_0x3b8566=_0x1974dd[_0x2d4e29(0xca)][_0x2d4e29(0xe0)],_0x1d91f0=_0x1974dd[_0x2d4e29(0xca)][_0x2d4e29(0xcd)],_0x513320=_0x1974dd[_0x2d4e29(0x97)][_0x2d4e29(0xe4)],_0x4e1d82=_0x1974dd['activations'][_0x2d4e29(0xde)],_0x4cd216=_0x1974dd[_0x2d4e29(0x97)]['toUpdate'],_0x532fd2=_0x1974dd[_0x2d4e29(0x97)][_0x2d4e29(0xcd)];console[_0x2d4e29(0xcf)]('\x0aPush\x20summary\x20for\x20\x27'+_0x155bdf+'\x27:');_0x390e5e[_0x2d4e29(0x6b)]>0x0&&console['error']('\x20\x20'+a31_0x5688a0[_0x2d4e29(0xa5)](_0x2d4e29(0xf4)+_0x390e5e[_0x2d4e29(0x6b)]+_0x2d4e29(0xff)));if(!_0x840566[_0x2d4e29(0xc8)]){console[_0x2d4e29(0xcf)](_0x2d4e29(0x8e)),console[_0x2d4e29(0xcf)]('\x20\x20\x20\x20'+a31_0x5688a0['green']('+\x20'+_0x2c59b7[_0x2d4e29(0x6b)]+_0x2d4e29(0xeb))),console[_0x2d4e29(0xcf)]('\x20\x20\x20\x20'+a31_0x5688a0[_0x2d4e29(0xfb)]('~\x20'+_0x475d30[_0x2d4e29(0x6b)]+_0x2d4e29(0x84)));if(_0x28c921['length']>0x0)console['error']('\x20\x20\x20\x20'+a31_0x5688a0['red']('-\x20'+_0x28c921[_0x2d4e29(0x6b)]+_0x2d4e29(0x75)));else _0x3cf343['length']>0x0&&!_0x840566[_0x2d4e29(0x79)]&&console[_0x2d4e29(0xcf)](_0x2d4e29(0xb0)+a31_0x5688a0[_0x2d4e29(0x9a)](_0x3cf343['length']+_0x2d4e29(0x101)));console[_0x2d4e29(0xcf)](_0x2d4e29(0xb0)+a31_0x5688a0[_0x2d4e29(0x9a)]('=\x20'+_0x550539[_0x2d4e29(0x6b)]+_0x2d4e29(0x96)));}if(_0x3d6852[_0x2d4e29(0x6b)]>0x0||_0xa17362[_0x2d4e29(0x6b)]>0x0){console[_0x2d4e29(0xcf)](_0x2d4e29(0x6f)),console[_0x2d4e29(0xcf)](_0x2d4e29(0xb0)+a31_0x5688a0[_0x2d4e29(0x8d)]('+\x20'+_0x304151[_0x2d4e29(0x6b)]+_0x2d4e29(0xeb))),console['error']('\x20\x20\x20\x20'+a31_0x5688a0[_0x2d4e29(0xfb)]('~\x20'+_0x7f1ad7[_0x2d4e29(0x6b)]+_0x2d4e29(0x84)));if(_0x1d91f0['length']>0x0)console[_0x2d4e29(0xcf)](_0x2d4e29(0xb0)+a31_0x5688a0[_0x2d4e29(0x98)]('-\x20'+_0x1d91f0[_0x2d4e29(0x6b)]+'\x20to\x20delete'));else _0xa17362[_0x2d4e29(0x6b)]>0x0&&!_0x840566[_0x2d4e29(0x79)]&&console[_0x2d4e29(0xcf)]('\x20\x20\x20\x20'+a31_0x5688a0[_0x2d4e29(0x9a)](_0xa17362['length']+_0x2d4e29(0x101)));console[_0x2d4e29(0xcf)](_0x2d4e29(0xb0)+a31_0x5688a0[_0x2d4e29(0x9a)]('=\x20'+_0x3b8566[_0x2d4e29(0x6b)]+_0x2d4e29(0x96)));}_0x513320[_0x2d4e29(0x6b)]>0x0&&!_0x840566['journeysOnly']&&(console[_0x2d4e29(0xcf)](''),console[_0x2d4e29(0xcf)](_0x2d4e29(0x78)),_0x4e1d82[_0x2d4e29(0x6b)]>0x0&&console[_0x2d4e29(0xcf)](_0x2d4e29(0xb0)+a31_0x5688a0[_0x2d4e29(0x8d)]('+\x20'+_0x4e1d82[_0x2d4e29(0x6b)]+_0x2d4e29(0xbf))),_0x4cd216[_0x2d4e29(0x6b)]>0x0&&console[_0x2d4e29(0xcf)](_0x2d4e29(0xb0)+a31_0x5688a0[_0x2d4e29(0xfb)]('~\x20'+_0x4cd216[_0x2d4e29(0x6b)]+'\x20to\x20update')),_0x532fd2['length']>0x0&&console[_0x2d4e29(0xcf)](_0x2d4e29(0xb0)+a31_0x5688a0[_0x2d4e29(0x98)]('-\x20'+_0x532fd2[_0x2d4e29(0x6b)]+_0x2d4e29(0x75))));console[_0x2d4e29(0xcf)](_0x2d4e29(0xa8)+a31_0x5688a0[_0x2d4e29(0xbb)](_0x179e10)+'\x0a');if(_0x390e5e[_0x2d4e29(0x6b)]>0x0){console[_0x2d4e29(0xcf)]('Folders\x20to\x20create:');for(const _0x9c3e5a of _0x390e5e){console[_0x2d4e29(0xcf)]('\x20\x20'+a31_0x5688a0[_0x2d4e29(0xa5)]('+')+'\x20'+_0x9c3e5a);}console[_0x2d4e29(0xcf)]('');}if(_0x2c59b7['length']>0x0&&!_0x840566[_0x2d4e29(0xc8)])for(const _0xb703af of _0x2c59b7){const _0x121c4e=_0xb703af[_0x2d4e29(0x64)]?_0xb703af[_0x2d4e29(0x64)]+'/'+_0xb703af['yamlConfig'][_0x2d4e29(0xa7)]:_0xb703af['yamlConfig']['name'],_0x3ee645=_0xb703af[_0x2d4e29(0x65)][_0x2d4e29(0x97)]?.[_0x2d4e29(0x6b)]||0x0,_0x5a06d5=_0x3ee645>0x0?a31_0x5688a0[_0x2d4e29(0x9a)]('\x20['+_0x3ee645+'\x20activations]'):'';console['error']('\x0a'+a31_0x5688a0[_0x2d4e29(0x8d)](_0x2d4e29(0x88))+'\x20'+_0x121c4e+_0x5a06d5),console[_0x2d4e29(0xcf)]('─'['repeat'](0x3c)),_0xb703af[_0x2d4e29(0xd8)]&&console[_0x2d4e29(0xcf)](_0xb703af[_0x2d4e29(0xd8)]),console['error']('─'[_0x2d4e29(0x66)](0x3c));}if(_0x28c921[_0x2d4e29(0x6b)]>0x0&&!_0x840566[_0x2d4e29(0xc8)])for(const _0x16663f of _0x28c921){const _0x54e864=_0x16663f[_0x2d4e29(0xd7)]?_0x108e03['get'](_0x16663f['segmentFolderId']['toString']())||'':'',_0x24b1e3=_0x54e864?_0x54e864+'/'+_0x16663f[_0x2d4e29(0xa7)]:_0x16663f[_0x2d4e29(0xa7)],_0x179e4c=_0x1ade5c['get'](_0x16663f['id'])||[],_0x65f3a8=_0x179e4c['length']>0x0?a31_0x5688a0[_0x2d4e29(0x9a)]('\x20['+_0x179e4c['length']+_0x2d4e29(0x9e)):'';console[_0x2d4e29(0xcf)]('\x0a'+a31_0x5688a0[_0x2d4e29(0x98)](_0x2d4e29(0xec))+'\x20'+_0x24b1e3+_0x65f3a8),console[_0x2d4e29(0xcf)]('─'['repeat'](0x3c));const _0x12a562=segmentWithActivationsToYaml(_0x16663f,_0x179e4c,undefined,_0x1970cf,_0x69c33f),_0x119554=segmentToYamlString(_0x12a562),_0x207680=generateDiff(_0x119554,'');console['error'](formatDiffWithColors(_0x207680)),console['error']('─'[_0x2d4e29(0x66)](0x3c));}const _0x2243ae=_0x577541[_0x2d4e29(0x6c)](_0x131778=>!_0x131778[_0x2d4e29(0xc4)]&&_0x131778[_0x2d4e29(0xd8)]);if(_0x2243ae[_0x2d4e29(0x6b)]>0x0&&!_0x840566[_0x2d4e29(0xc8)])for(const _0x41e728 of _0x2243ae){const _0x3dff79=_0x41e728[_0x2d4e29(0x64)]?_0x41e728[_0x2d4e29(0x64)]+'/'+_0x41e728[_0x2d4e29(0x65)][_0x2d4e29(0xa7)]:_0x41e728[_0x2d4e29(0x65)][_0x2d4e29(0xa7)];console[_0x2d4e29(0xcf)]('\x0a'+a31_0x5688a0[_0x2d4e29(0xfb)](_0x2d4e29(0xc9))+'\x20'+_0x3dff79),console['error']('─'[_0x2d4e29(0x66)](0x3c)),console[_0x2d4e29(0xcf)](_0x41e728[_0x2d4e29(0xd8)]),console['error']('─'[_0x2d4e29(0x66)](0x3c));}if(_0x304151[_0x2d4e29(0x6b)]>0x0)for(const _0x563b46 of _0x304151){const _0x3d3b20=_0x563b46[_0x2d4e29(0x64)]?_0x563b46['folderPath']+'/'+_0x563b46[_0x2d4e29(0x65)][_0x2d4e29(0xa7)]:_0x563b46[_0x2d4e29(0x65)]['name'];console[_0x2d4e29(0xcf)]('\x0a'+a31_0x5688a0['green'](_0x2d4e29(0x68))+'\x20'+_0x3d3b20),console[_0x2d4e29(0xcf)]('─'['repeat'](0x3c)),_0x563b46[_0x2d4e29(0xd8)]&&console[_0x2d4e29(0xcf)](_0x563b46['diff']),console['error']('─'['repeat'](0x3c));}const _0x280954=_0x3d6852[_0x2d4e29(0x6c)](_0x9bde19=>!_0x9bde19[_0x2d4e29(0xc4)]&&_0x9bde19[_0x2d4e29(0xd8)]);if(_0x280954['length']>0x0)for(const _0x600d3 of _0x280954){const _0x223329=_0x600d3['folderPath']?_0x600d3[_0x2d4e29(0x64)]+'/'+_0x600d3[_0x2d4e29(0x65)]['name']:_0x600d3[_0x2d4e29(0x65)][_0x2d4e29(0xa7)];console[_0x2d4e29(0xcf)]('\x0a'+a31_0x5688a0[_0x2d4e29(0xfb)](_0x2d4e29(0x72))+'\x20'+_0x223329),console['error']('─'[_0x2d4e29(0x66)](0x3c)),console[_0x2d4e29(0xcf)](_0x600d3['diff']),console['error']('─'[_0x2d4e29(0x66)](0x3c));}if(_0x1d91f0['length']>0x0)for(const _0xa66039 of _0x1d91f0){const _0x557d45=_0xa66039[_0x2d4e29(0x82)]?_0x108e03[_0x2d4e29(0xc7)](_0xa66039[_0x2d4e29(0x82)])||'':'',_0x1adf92=_0x557d45?_0x557d45+'/'+_0xa66039[_0x2d4e29(0x93)]:_0xa66039[_0x2d4e29(0x93)];console[_0x2d4e29(0xcf)]('\x0a'+a31_0x5688a0[_0x2d4e29(0x98)](_0x2d4e29(0x73))+'\x20'+_0x1adf92),console[_0x2d4e29(0xcf)]('─'[_0x2d4e29(0x66)](0x3c)),console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0x98)](_0x2d4e29(0x87))),console['error']('─'[_0x2d4e29(0x66)](0x3c));}if(_0x840566[_0x2d4e29(0xfa)])return console[_0x2d4e29(0xcf)](a31_0x5688a0['yellow'](_0x2d4e29(0xc2))),0x0;const _0x26c280=_0x840566['journeysOnly']?![]:_0x2c59b7[_0x2d4e29(0x6b)]>0x0||_0x475d30[_0x2d4e29(0x6b)]>0x0||_0x28c921[_0x2d4e29(0x6b)]>0x0,_0x36f382=_0x304151[_0x2d4e29(0x6b)]>0x0||_0x7f1ad7[_0x2d4e29(0x6b)]>0x0||_0x1d91f0[_0x2d4e29(0x6b)]>0x0,_0x402746=_0x840566[_0x2d4e29(0xc8)]?![]:_0x513320[_0x2d4e29(0x6b)]>0x0,_0x45c6ea=_0x390e5e[_0x2d4e29(0x6b)]>0x0;if(!_0x26c280&&!_0x36f382&&!_0x402746&&!_0x45c6ea){const _0x5c9921=_0x840566[_0x2d4e29(0xc8)]?_0x2d4e29(0xf0):_0x2d4e29(0x94);console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0x8d)](_0x5c9921));if(_0x49f628&&_0x3b8566[_0x2d4e29(0x6b)]===0x1){const _0x11a0ac=_0x3b8566[0x0];if(_0x11a0ac[_0x2d4e29(0xcb)]?.['id']){const _0x2daa01=getConsoleNextUrl(_0x840566[_0x2d4e29(0x92)],_0x2d4e29(0x100)+_0x1eca20+_0x2d4e29(0x74)+_0x11a0ac[_0x2d4e29(0xcb)]['id']+_0x2d4e29(0xc1));console[_0x2d4e29(0xcf)]('\x20\x20'+a31_0x5688a0[_0x2d4e29(0xbb)](_0x2daa01));}}return 0x0;}const _0x444bad=_0x840566[_0x2d4e29(0xc8)]?_0x304151[_0x2d4e29(0x6b)]+_0x7f1ad7[_0x2d4e29(0x6b)]+_0x1d91f0[_0x2d4e29(0x6b)]+_0x390e5e[_0x2d4e29(0x6b)]:_0x2c59b7['length']+_0x475d30[_0x2d4e29(0x6b)]+_0x28c921[_0x2d4e29(0x6b)]+_0x304151[_0x2d4e29(0x6b)]+_0x7f1ad7[_0x2d4e29(0x6b)]+_0x1d91f0[_0x2d4e29(0x6b)]+_0x390e5e[_0x2d4e29(0x6b)]+_0x513320[_0x2d4e29(0x6b)];if(!_0x840566[_0x2d4e29(0xfc)]&&_0x444bad>0x0){const _0x17b675=await confirmKey(_0x2d4e29(0x81)+_0x444bad+_0x2d4e29(0x99));if(!_0x17b675)return console[_0x2d4e29(0xcf)]('Aborted.'),0x1;}const _0x573791={'withProgress':async(_0x3016e4,_0x1b3746)=>{const _0x5150b5=_0x2d4e29,_0x53e867=await withSpinner(_0x3016e4,_0x1b3746,{'verbose':_0x840566[_0x5150b5(0xab)]});return{'data':_0x53e867['data']};},'logInfo':_0x26cddd=>console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0xa5)]('✔\x20'+_0x26cddd)),'logSuccess':_0x4efb8e=>console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0x8d)]('✔\x20'+_0x4efb8e)),'logWarning':_0x8eb507=>console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0xfb)]('⚠\x20'+_0x8eb507)),'logDeleted':_0xbe4cb1=>console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0x98)]('✔\x20'+_0xbe4cb1))},_0x2d79c4={'segment':_0x1c032a[_0x2d4e29(0xd6)],'journey':_0x1c032a[_0x2d4e29(0xa2)],'user':_0x1c032a[_0x2d4e29(0xc5)],'connection':_0x1c032a[_0x2d4e29(0xd1)]};_0x390e5e[_0x2d4e29(0x6b)]>0x0&&(_0xd31df1=await executePushFolders(_0x2d79c4,_0x390e5e,_0xd31df1,{'parentId':_0x1eca20},_0x573791));const _0x38ec26={'rootFolderId':_0x34aa7a,'folderPathToId':_0xd31df1,'folderIdToPath':_0x108e03,'segmentNameToId':_0x4241be,'activationsBySegmentId':_0x1ade5c,'emailToIdMap':_0x4a8c18,'idToEmailMap':_0x1970cf,'connectionNameToIdMap':_0x2562b5[_0x2d4e29(0xbc)],'connectionIdToNameMap':_0x2562b5['idToName'],'connectionNameToTypeMap':_0x1d2429},_0x2e3b0f=await executePushSegments(_0x2d79c4,_0x840566[_0x2d4e29(0xc8)]?[]:_0x577541,_0x38ec26,{'parentId':_0x1eca20},_0x573791),_0x84468f=_0x2e3b0f[_0x2d4e29(0xdf)],_0x5b0f57=_0x2e3b0f['updated'],_0x5cc4f9=_0x2e3b0f[_0x2d4e29(0x97)][_0x2d4e29(0xdf)],_0x6dc70d=_0x2e3b0f[_0x2d4e29(0x97)][_0x2d4e29(0xb4)],_0x354428=_0x2e3b0f[_0x2d4e29(0x97)][_0x2d4e29(0x85)],_0x5488de=await executePushSegmentDeletions(_0x2d79c4,_0x840566[_0x2d4e29(0xc8)]?[]:_0x28c921,_0x573791);let _0x203b98=0x0,_0x511851=0x0,_0x39940f=0x0;const _0x4a641b=new Map(_0x4241be);for(const [_0x50a446,_0x8e6870]of _0x2e3b0f[_0x2d4e29(0xb1)]){_0x4a641b[_0x2d4e29(0xf2)](_0x50a446,_0x8e6870);}if(_0x3d6852[_0x2d4e29(0x6b)]>0x0){const _0x54685d={..._0x38ec26,'segmentNameToId':_0x4a641b,'existingSegments':_0x29cf6b,'activationContext':_0x2958b9},_0x5b397a=await executePushJourneys(_0x2d79c4,_0x3d6852,_0x54685d,{'parentId':_0x1eca20,'rootFolderId':_0x34aa7a,'verbose':_0x840566['verbose']},_0x573791);_0x203b98=_0x5b397a[_0x2d4e29(0xdf)],_0x511851=_0x5b397a[_0x2d4e29(0xb4)];if(_0x49f628&&_0x5b397a['results'][_0x2d4e29(0x6b)]===0x1){const _0x13a61e=_0x5b397a[_0x2d4e29(0x7d)][0x0];if(_0x13a61e[_0x2d4e29(0x83)]){const _0x3fe3ed=getConsoleNextUrl(_0x840566[_0x2d4e29(0x92)],'/app/ps/'+_0x1eca20+_0x2d4e29(0x74)+_0x13a61e['journeyId']+_0x2d4e29(0xc1));console[_0x2d4e29(0xcf)]('\x20\x20'+a31_0x5688a0['cyan'](_0x3fe3ed));}}}for(const _0x215042 of _0x1d91f0){console[_0x2d4e29(0xcf)](a31_0x5688a0[_0x2d4e29(0xfb)](_0x2d4e29(0x89)+_0x215042[_0x2d4e29(0x93)])),_0x39940f++;}const _0x2fe2da=[];if(_0x84468f>0x0)_0x2fe2da[_0x2d4e29(0xef)](_0x84468f+_0x2d4e29(0xe3));if(_0x5b0f57>0x0)_0x2fe2da['push'](_0x5b0f57+_0x2d4e29(0xe1));if(_0x5488de>0x0)_0x2fe2da[_0x2d4e29(0xef)](_0x5488de+_0x2d4e29(0xce));const _0x186c7e=[];if(_0x203b98>0x0)_0x186c7e[_0x2d4e29(0xef)](_0x203b98+_0x2d4e29(0xe3));if(_0x511851>0x0)_0x186c7e[_0x2d4e29(0xef)](_0x511851+_0x2d4e29(0xe1));if(_0x39940f>0x0)_0x186c7e[_0x2d4e29(0xef)](_0x39940f+_0x2d4e29(0xce));const _0x1743dd=[];if(_0x5cc4f9>0x0)_0x1743dd['push'](_0x5cc4f9+'\x20created');if(_0x6dc70d>0x0)_0x1743dd['push'](_0x6dc70d+_0x2d4e29(0xe1));if(_0x354428>0x0)_0x1743dd[_0x2d4e29(0xef)](_0x354428+_0x2d4e29(0xce));return console['error'](a31_0x5688a0[_0x2d4e29(0x8d)](_0x2d4e29(0xe6))),_0x2fe2da['length']>0x0&&!_0x840566[_0x2d4e29(0xc8)]&&console[_0x2d4e29(0xcf)](_0x2d4e29(0xac)+_0x2fe2da[_0x2d4e29(0xdb)](',\x20')),_0x186c7e[_0x2d4e29(0x6b)]>0x0&&console[_0x2d4e29(0xcf)](_0x2d4e29(0xba)+_0x186c7e[_0x2d4e29(0xdb)](',\x20')),_0x1743dd[_0x2d4e29(0x6b)]>0x0&&!_0x840566[_0x2d4e29(0xc8)]&&console[_0x2d4e29(0xcf)](_0x2d4e29(0xf5)+_0x1743dd[_0x2d4e29(0xdb)](',\x20')),0x0;}}
|
|
1
|
+
const a31_0x71464a=a31_0xd818;(function(_0x3ecfb3,_0x445200){const _0x5303c3=a31_0xd818,_0x35f3d6=_0x3ecfb3();while(!![]){try{const _0x5ca9dd=parseInt(_0x5303c3(0x141))/0x1*(-parseInt(_0x5303c3(0x12c))/0x2)+parseInt(_0x5303c3(0x17c))/0x3*(parseInt(_0x5303c3(0x118))/0x4)+-parseInt(_0x5303c3(0x191))/0x5+-parseInt(_0x5303c3(0x112))/0x6*(parseInt(_0x5303c3(0x149))/0x7)+-parseInt(_0x5303c3(0x12d))/0x8*(-parseInt(_0x5303c3(0x134))/0x9)+-parseInt(_0x5303c3(0x133))/0xa+parseInt(_0x5303c3(0x123))/0xb;if(_0x5ca9dd===_0x445200)break;else _0x35f3d6['push'](_0x35f3d6['shift']());}catch(_0x118f9b){_0x35f3d6['push'](_0x35f3d6['shift']());}}}(a31_0x318f,0xde5e0));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey}from'../utils/prompt.js';function a31_0xd818(_0x53a36e,_0x17ee55){_0x53a36e=_0x53a36e-0x110;const _0x318fc5=a31_0x318f();let _0xd81855=_0x318fc5[_0x53a36e];return _0xd81855;}import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a31_0x3d78e8 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';function a31_0x318f(){const _0x4cfd22=['4962445hzagFs','folderPath','\x20changes?','diff','push','connection','Site:\x20','Preparing\x20journeys...','then','\x20folders\x20to\x20create','get','\x20\x20📊\x20Segments:','Delete\x20journey:','map','/app/ps/','\x20created','description','message','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','📁\x20','parentFolder','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','listSegments','\x20new','cyan','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','journeyId','isNew','7080Wdgtml','journeysOnly','/e/','idToName','folderId','no_parent','4ZAWjpt','updated','Aborted.','name','green','createdAt','new','Push\x20','changed','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','37943752mFswkc','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','listActivations','data','repeat','resolveParentId','segment','type','parentSegment','2yyAFnu','214296wukdne','delete','\x0aPush\x20summary\x20for\x20\x27','paused','journey','Error:\x20Directory\x20not\x20found:\x20','2567640dKMgLh','27rmdzae','dim','attributes','Changes\x20to:','createdSegmentIds','isScoped','results','\x20\x20🗺️\x20\x20Journeys:','\x20updated','\x20YAML\x20files\x20found','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','segment:push','parent_name','1555391NylZAF','filePath','\x20unchanged','Fetching\x20existing\x20segments...','user','created','\x20changed','listJourneysWithDetailsFromParentSegment','2107Xcuysd','segmentFolderId','join','yamlConfig','\x20deleted','red','listFolders','journeys','\x20activations]','Fetching\x20existing\x20journeys...','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Delete\x20segment:','helpText','Fetching\x20existing\x20activations...','yellow','verbose','\x0a✔\x20Push\x20complete','\x20\x20Activations:','Error\x20parsing\x20YAML:\x20','unchanged','targetDir','relationships','nameToId','Scoped\x20to\x20folder:\x20','deleted','New\x20segment:','Resolving\x20parent\x20segment\x20\x27','set','getParent','toDelete','Folders\x20to\x20create:','list','length','\x0aValidation\x20failed:','site','journeyBundleName','Fetching\x20parent\x20segment\x20details...','updatedAt','activations','blue','existingJourney','errorCode','add','No\x20','\x20\x20\x20\x20','buildUserMaps','\x20to\x20create','filter','\x20\x20Source:\x20','Fetching\x20existing\x20folders...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','1622541nPsIpG','getOutputSchemaWithCache','segments','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','\x20\x20Journeys:\x20','setPhase','dryRun','(Journey\x20will\x20be\x20deleted)','\x20to\x20delete','folders','toUpdate','toString','parentName','nameToType','toCreate','error','endsWith','\x27...','Fetching\x20users\x20for\x20email\x20resolution...','scopedFolderPath','cwd'];a31_0x318f=function(){return _0x4cfd22;};return a31_0x318f();}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_0x71464a(0x11b)]=a31_0x71464a(0x13f);[a31_0x71464a(0x1a1)]=a31_0x71464a(0x17f);async['execute'](_0x1fbaa1){const _0x49dcda=a31_0x71464a,{options:_0x20ed85,args:_0x519619,tdx:_0x51616f}=_0x1fbaa1,_0x1b86c0=_0x20ed85,_0x2041e8=await resolveTarget({'arg':_0x519619[0x0],'contextParent':_0x20ed85[_0x49dcda(0x12b)],'cwd':process[_0x49dcda(0x190)]()});if(!isSuccessfulResolution(_0x2041e8))return _0x2041e8[_0x49dcda(0x172)]===_0x49dcda(0x117)?(console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x157)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x49dcda(0x18b)]('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[_0x49dcda(0x18b)](_0x49dcda(0x17b)),console[_0x49dcda(0x18b)](_0x49dcda(0x1a3))):(console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x14e)]('Error:\x20'+_0x2041e8['message']+'\x0a')),_0x2041e8['helpText']&&console[_0x49dcda(0x18b)](a31_0x3d78e8['cyan'](_0x2041e8[_0x49dcda(0x155)]))),0x1;if(_0x2041e8['type']===_0x49dcda(0x140))return console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x14e)](_0x49dcda(0x132)+_0x2041e8[_0x49dcda(0x15d)]+'\x0a')),console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x1a9)](_0x49dcda(0x153))),0x1;const _0x4ce127=_0x2041e8[_0x49dcda(0x188)],_0x5c5114=_0x2041e8[_0x49dcda(0x15d)],_0x20a397=_0x2041e8[_0x49dcda(0x12a)]==='file'?_0x2041e8[_0x49dcda(0x142)]:undefined,_0xe4756f=getScopedDetails(_0x2041e8),_0xe625d=_0xe4756f?.[_0x49dcda(0x139)]??![],_0x5c742c=_0xe4756f?.[_0x49dcda(0x18f)]??'';if(!existsSync(_0x5c5114))return console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x14e)](_0x49dcda(0x132)+_0x5c5114+'\x0a')),console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x1a9)](_0x49dcda(0x153))),0x1;_0x1b86c0[_0x49dcda(0x158)]&&(console[_0x49dcda(0x18b)](_0x49dcda(0x197)+_0x1b86c0['site']),console[_0x49dcda(0x18b)]('Parent\x20segment:\x20'+_0x4ce127),console[_0x49dcda(0x18b)]('Source\x20directory:\x20'+_0x5c5114),_0xe625d&&console[_0x49dcda(0x18b)](_0x49dcda(0x160)+_0x5c742c));const _0x1addfa=await withSpinner(_0x49dcda(0x163)+_0x4ce127+_0x49dcda(0x18d),()=>_0x51616f[_0x49dcda(0x129)][_0x49dcda(0x128)](_0x4ce127),{'verbose':_0x1b86c0['verbose']}),_0xaebcd8=_0x1addfa[_0x49dcda(0x126)],[_0xfecc4d,_0x138ea3,_0x3bb802,_0x5a7d8c,_0x542bf5]=await Promise['all']([withSpinner(_0x49dcda(0x16d),()=>_0x51616f['segment'][_0x49dcda(0x165)](_0xaebcd8),{'verbose':_0x1b86c0[_0x49dcda(0x158)]}),withSpinner(_0x49dcda(0x144),()=>_0x51616f['segment'][_0x49dcda(0x1a7)](_0xaebcd8),{'verbose':_0x1b86c0['verbose']}),withSpinner(_0x49dcda(0x17a),()=>_0x51616f[_0x49dcda(0x129)][_0x49dcda(0x14f)](_0xaebcd8),{'verbose':_0x1b86c0[_0x49dcda(0x158)]}),withSpinner(_0x49dcda(0x152),()=>_0x51616f['journey'][_0x49dcda(0x148)](_0xaebcd8,{'includeAllVersions':!![]}),{'verbose':_0x1b86c0[_0x49dcda(0x158)]}),withSpinner(_0x49dcda(0x18e),()=>_0x51616f[_0x49dcda(0x145)][_0x49dcda(0x176)](),{'verbose':_0x1b86c0[_0x49dcda(0x158)]})['then'](_0x3180b9=>_0x3180b9[_0x49dcda(0x126)])]),_0x39a531=_0xfecc4d['data'],_0x2c29fd=extractRootFolderId(_0x39a531),_0xd732f5=_0x138ea3[_0x49dcda(0x126)],_0x2bb4d1=_0x3bb802['data'],{journeys:_0x33a478,activationStepsById:_0x3ced0b}=_0x5a7d8c[_0x49dcda(0x126)],_0x3ebcf8=new Map(_0x33a478['map'](_0x3c9082=>[_0x3c9082['id'],_0x3c9082])),_0x45aa20=_0x33a478[_0x49dcda(0x19e)](_0x15ca49=>({'id':_0x15ca49['id'],'name':_0x15ca49[_0x49dcda(0x136)][_0x49dcda(0x11b)],'journeyBundleName':_0x15ca49[_0x49dcda(0x136)]['journeyBundleName']||'','journeyBundleId':_0x15ca49[_0x49dcda(0x136)]['journeyBundleId']||'','versionNumber':_0x15ca49['attributes']['versionNumber'],'description':_0x15ca49['attributes']['description'],'state':_0x15ca49[_0x49dcda(0x136)]['state'],'paused':_0x15ca49[_0x49dcda(0x136)][_0x49dcda(0x130)],'audienceId':_0x15ca49[_0x49dcda(0x136)]['audienceId'],'folderId':_0x15ca49[_0x49dcda(0x15e)]?.[_0x49dcda(0x1a5)]?.[_0x49dcda(0x126)]?.['id'],'createdAt':_0x15ca49[_0x49dcda(0x136)][_0x49dcda(0x11d)],'updatedAt':_0x15ca49['attributes'][_0x49dcda(0x16e)]})),{emailToId:_0x5cae77,idToEmail:_0x501ff5}=_0x542bf5,_0x14ecbc=await withSpinner(_0x49dcda(0x122),async()=>{const _0x243ea4=_0x49dcda,_0x31c55c=await _0x51616f[_0x243ea4(0x196)][_0x243ea4(0x168)]();return buildConnectionMaps(_0x31c55c);},{'verbose':_0x1b86c0[_0x49dcda(0x158)]})[_0x49dcda(0x199)](_0x450e20=>_0x450e20['data']),_0x304d76=_0x14ecbc[_0x49dcda(0x15f)],_0x1eb409=_0x14ecbc['idToName'],_0x1326c6=_0x14ecbc[_0x49dcda(0x189)],_0x2351c7={'emailToIdMap':_0x5cae77,'connectionNameToIdMap':_0x304d76,'connectionNameToTypeMap':_0x1326c6,'getSchema':_0x25dfbb=>_0x51616f[_0x49dcda(0x196)][_0x49dcda(0x17d)](_0x25dfbb)};let {pathToId:_0x3d2047,idToPath:_0x5df44d}=buildFolderMaps(_0x2bb4d1);const _0x3a20a6=buildSegmentLookupMap(_0xd732f5,_0x5df44d),_0x1a05ab=buildSegmentNameToIdMap(_0xd732f5),_0x39c1bd=buildJourneyBundleLookupMap(_0x45aa20,_0x5df44d);let _0x28943b;if(_0x20a397){if(!_0x20a397[_0x49dcda(0x18c)]('.yml')&&!_0x20a397[_0x49dcda(0x18c)]('.yaml'))return console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x14e)](_0x49dcda(0x121)+_0x20a397+'\x0a')),0x1;_0x28943b=[_0x20a397];}else _0x28943b=findYamlFiles(_0x5c5114);if(_0x28943b[_0x49dcda(0x169)]===0x0)return console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x14e)](_0x49dcda(0x124)+_0x5c5114+'\x0a')),console[_0x49dcda(0x18b)](a31_0x3d78e8['cyan']('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0xebdcfd,_0x19c824;try{const _0x2d006c=parseAndClassifyYamlFiles(_0x28943b,_0x5c5114,{'skipSegments':_0x1b86c0[_0x49dcda(0x113)]});_0xebdcfd=_0x2d006c['segments'],_0x19c824=_0x2d006c[_0x49dcda(0x150)];const _0x31ffca=validateParsedFiles(_0x2d006c,_0x5c5114);if(_0x31ffca['length']>0x0)return console['error'](a31_0x3d78e8[_0x49dcda(0x14e)](_0x49dcda(0x16a))),console[_0x49dcda(0x18b)](formatValidationErrors(_0x31ffca)),console['error'](a31_0x3d78e8['yellow']('\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.')),0x1;}catch(_0x26bcf8){return console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x14e)](_0x49dcda(0x15b)+(_0x26bcf8 instanceof Error?_0x26bcf8[_0x49dcda(0x1a2)]:_0x26bcf8))),0x1;}if(_0xebdcfd[_0x49dcda(0x169)]===0x0&&_0x19c824['length']===0x0){const _0x565585=_0x1b86c0[_0x49dcda(0x113)]?_0x49dcda(0x131):'segment\x20or\x20journey';return console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x157)](_0x49dcda(0x174)+_0x565585+_0x49dcda(0x13d))),0x0;}const _0x3dd800=new Map();_0xd732f5[_0x49dcda(0x169)]>0x0&&!_0x1b86c0[_0x49dcda(0x113)]&&await withSpinner(_0x49dcda(0x156),async()=>{await batchAsync(_0xd732f5,async _0x45c929=>{const _0x36c865=a31_0xd818,_0x33b0a7=await _0x51616f[_0x36c865(0x129)][_0x36c865(0x125)](_0xaebcd8,_0x45c929['id']);_0x3dd800[_0x36c865(0x164)](_0x45c929['id'],_0x33b0a7);});},{'verbose':_0x1b86c0[_0x49dcda(0x158)]});const {segmentFiles:_0x2b893e,foldersToCreate:_0x5b72a9}=await prepareSegmentFiles(_0xebdcfd,{'segmentByFolderAndName':_0x3a20a6,'activationsBySegmentId':_0x3dd800,'folderPathToId':_0x3d2047,'idToEmailMap':_0x501ff5,'connectionIdToNameMap':_0x1eb409},_0x2351c7,_0xe625d,_0x5c742c),_0x5768be=_0x20a397?[]:findSegmentsToDelete(_0xd732f5,_0xebdcfd[_0x49dcda(0x19e)](({yamlConfig:_0x36895b,folderPath:_0x4054d1})=>({'yamlConfig':_0x36895b,'folderPath':resolveTDFolderPath(_0x4054d1,_0xe625d,_0x5c742c)})),_0x5df44d,_0x5c742c,_0xe625d),{journeyFiles:_0x4640e9,foldersToCreate:_0x39bfa4}=await withProgressSpinner(_0x49dcda(0x198),async _0x3a70c6=>prepareJourneyFiles(_0x19c824,{'fetchJourney':async _0x5fdc5e=>_0x51616f[_0x49dcda(0x131)]['getJourney'](_0x5fdc5e[_0x49dcda(0x110)]),'journeyBundlesByFolderAndName':_0x39c1bd,'folderPathToId':_0x3d2047,'idToEmailMap':_0x501ff5,'connectionIdToNameMap':_0x1eb409,'existingSegments':_0xd732f5,'parentId':_0xaebcd8,'deps':_0x51616f,'progress':{'update':_0x4a6346=>{const _0x2d2836=_0x49dcda;_0x3a70c6[_0x2d2836(0x181)](_0x4a6346),_0x1b86c0['verbose']&&console[_0x2d2836(0x18b)]('\x20\x20'+_0x4a6346);}},'journeyById':_0x3ebcf8,'activationStepsById':_0x3ced0b},_0xe625d,_0x5c742c),{'verbose':_0x1b86c0[_0x49dcda(0x158)]})['then'](_0x3036e6=>_0x3036e6[_0x49dcda(0x126)]);for(const _0x354f69 of _0x39bfa4){_0x5b72a9[_0x49dcda(0x173)](_0x354f69);}const _0x58b0f2=_0x20a397?[]:findJourneysToDelete(_0x45aa20,_0x19c824[_0x49dcda(0x19e)](({yamlConfig:_0x23bd90,folderPath:_0x7fb272})=>({'yamlConfig':_0x23bd90,'folderPath':resolveTDFolderPath(_0x7fb272,_0xe625d,_0x5c742c)})),_0x5df44d,_0x5c742c,_0xe625d),_0x2ea4a9=calculatePushStats(_0x2b893e,_0x4640e9,_0x5b72a9,_0x5768be,_0x58b0f2,!!_0x1b86c0[_0x49dcda(0x12e)],!!_0x1b86c0[_0x49dcda(0x113)]),_0x1520b7=_0x2ea4a9['segments'][_0x49dcda(0x11e)],_0x274103=_0x2ea4a9[_0x49dcda(0x17e)][_0x49dcda(0x120)],_0x903ac=_0x2ea4a9[_0x49dcda(0x17e)][_0x49dcda(0x15c)],_0x5b2b7d=_0x2ea4a9[_0x49dcda(0x17e)][_0x49dcda(0x166)],_0x3669a6=_0x2ea4a9[_0x49dcda(0x185)][_0x49dcda(0x18a)],_0x898ef=_0x2ea4a9[_0x49dcda(0x150)][_0x49dcda(0x11e)],_0x20e157=_0x2ea4a9[_0x49dcda(0x150)][_0x49dcda(0x120)],_0x474dad=_0x2ea4a9[_0x49dcda(0x150)]['unchanged'],_0x3f263a=_0x2ea4a9[_0x49dcda(0x150)][_0x49dcda(0x166)],_0x43caf7=_0x2ea4a9[_0x49dcda(0x16f)]['all'],_0x18e172=_0x2ea4a9[_0x49dcda(0x16f)]['toCreate'],_0xed2375=_0x2ea4a9[_0x49dcda(0x16f)][_0x49dcda(0x186)],_0x45fa2c=_0x2ea4a9[_0x49dcda(0x16f)][_0x49dcda(0x166)];console[_0x49dcda(0x18b)](_0x49dcda(0x12f)+_0x4ce127+'\x27:');_0x3669a6['length']>0x0&&console[_0x49dcda(0x18b)]('\x20\x20'+a31_0x3d78e8[_0x49dcda(0x170)](_0x49dcda(0x1a4)+_0x3669a6['length']+_0x49dcda(0x19a)));if(!_0x1b86c0[_0x49dcda(0x113)]){console['error'](_0x49dcda(0x19c)),console[_0x49dcda(0x18b)](_0x49dcda(0x175)+a31_0x3d78e8['green']('+\x20'+_0x1520b7[_0x49dcda(0x169)]+_0x49dcda(0x1a8))),console[_0x49dcda(0x18b)]('\x20\x20\x20\x20'+a31_0x3d78e8['yellow']('~\x20'+_0x274103[_0x49dcda(0x169)]+'\x20changed'));if(_0x5b2b7d['length']>0x0)console[_0x49dcda(0x18b)](_0x49dcda(0x175)+a31_0x3d78e8['red']('-\x20'+_0x5b2b7d['length']+_0x49dcda(0x184)));else _0x5768be['length']>0x0&&!_0x1b86c0['delete']&&console[_0x49dcda(0x18b)](_0x49dcda(0x175)+a31_0x3d78e8[_0x49dcda(0x135)](_0x5768be[_0x49dcda(0x169)]+_0x49dcda(0x1aa)));console['error'](_0x49dcda(0x175)+a31_0x3d78e8[_0x49dcda(0x135)]('=\x20'+_0x903ac[_0x49dcda(0x169)]+_0x49dcda(0x143)));}if(_0x4640e9[_0x49dcda(0x169)]>0x0||_0x58b0f2[_0x49dcda(0x169)]>0x0){console['error'](_0x49dcda(0x13b)),console['error'](_0x49dcda(0x175)+a31_0x3d78e8[_0x49dcda(0x11c)]('+\x20'+_0x898ef[_0x49dcda(0x169)]+_0x49dcda(0x1a8))),console[_0x49dcda(0x18b)]('\x20\x20\x20\x20'+a31_0x3d78e8[_0x49dcda(0x157)]('~\x20'+_0x20e157[_0x49dcda(0x169)]+_0x49dcda(0x147)));if(_0x3f263a['length']>0x0)console[_0x49dcda(0x18b)]('\x20\x20\x20\x20'+a31_0x3d78e8['red']('-\x20'+_0x3f263a[_0x49dcda(0x169)]+'\x20to\x20delete'));else _0x58b0f2[_0x49dcda(0x169)]>0x0&&!_0x1b86c0[_0x49dcda(0x12e)]&&console[_0x49dcda(0x18b)]('\x20\x20\x20\x20'+a31_0x3d78e8[_0x49dcda(0x135)](_0x58b0f2['length']+_0x49dcda(0x1aa)));console[_0x49dcda(0x18b)]('\x20\x20\x20\x20'+a31_0x3d78e8['dim']('=\x20'+_0x474dad[_0x49dcda(0x169)]+'\x20unchanged'));}_0x43caf7['length']>0x0&&!_0x1b86c0[_0x49dcda(0x113)]&&(console['error'](''),console[_0x49dcda(0x18b)](_0x49dcda(0x15a)),_0x18e172[_0x49dcda(0x169)]>0x0&&console['error'](_0x49dcda(0x175)+a31_0x3d78e8[_0x49dcda(0x11c)]('+\x20'+_0x18e172['length']+_0x49dcda(0x177))),_0xed2375[_0x49dcda(0x169)]>0x0&&console[_0x49dcda(0x18b)](_0x49dcda(0x175)+a31_0x3d78e8[_0x49dcda(0x157)]('~\x20'+_0xed2375[_0x49dcda(0x169)]+'\x20to\x20update')),_0x45fa2c['length']>0x0&&console['error'](_0x49dcda(0x175)+a31_0x3d78e8['red']('-\x20'+_0x45fa2c[_0x49dcda(0x169)]+_0x49dcda(0x184))));console[_0x49dcda(0x18b)](_0x49dcda(0x179)+a31_0x3d78e8[_0x49dcda(0x1a9)](_0x5c5114)+'\x0a');if(_0x3669a6['length']>0x0){console[_0x49dcda(0x18b)](_0x49dcda(0x167));for(const _0x598955 of _0x3669a6){console[_0x49dcda(0x18b)]('\x20\x20'+a31_0x3d78e8[_0x49dcda(0x170)]('+')+'\x20'+_0x598955);}console[_0x49dcda(0x18b)]('');}if(_0x1520b7[_0x49dcda(0x169)]>0x0&&!_0x1b86c0['journeysOnly'])for(const _0xcb79f5 of _0x1520b7){const _0x37a3ae=_0xcb79f5[_0x49dcda(0x192)]?_0xcb79f5['folderPath']+'/'+_0xcb79f5[_0x49dcda(0x14c)][_0x49dcda(0x11b)]:_0xcb79f5[_0x49dcda(0x14c)][_0x49dcda(0x11b)],_0x5c07ca=_0xcb79f5['yamlConfig'][_0x49dcda(0x16f)]?.['length']||0x0,_0x2db584=_0x5c07ca>0x0?a31_0x3d78e8[_0x49dcda(0x135)]('\x20['+_0x5c07ca+_0x49dcda(0x151)):'';console[_0x49dcda(0x18b)]('\x0a'+a31_0x3d78e8[_0x49dcda(0x11c)](_0x49dcda(0x162))+'\x20'+_0x37a3ae+_0x2db584),console[_0x49dcda(0x18b)]('─'[_0x49dcda(0x127)](0x3c)),_0xcb79f5[_0x49dcda(0x194)]&&console[_0x49dcda(0x18b)](_0xcb79f5['diff']),console[_0x49dcda(0x18b)]('─'[_0x49dcda(0x127)](0x3c));}if(_0x5b2b7d[_0x49dcda(0x169)]>0x0&&!_0x1b86c0[_0x49dcda(0x113)])for(const _0x37b4c2 of _0x5b2b7d){const _0x4ca172=_0x37b4c2[_0x49dcda(0x14a)]?_0x5df44d[_0x49dcda(0x19b)](_0x37b4c2[_0x49dcda(0x14a)][_0x49dcda(0x187)]())||'':'',_0x585747=_0x4ca172?_0x4ca172+'/'+_0x37b4c2[_0x49dcda(0x11b)]:_0x37b4c2['name'],_0x7f75c9=_0x3dd800['get'](_0x37b4c2['id'])||[],_0x49f980=_0x7f75c9['length']>0x0?a31_0x3d78e8['dim']('\x20['+_0x7f75c9['length']+_0x49dcda(0x151)):'';console[_0x49dcda(0x18b)]('\x0a'+a31_0x3d78e8[_0x49dcda(0x14e)](_0x49dcda(0x154))+'\x20'+_0x585747+_0x49f980),console[_0x49dcda(0x18b)]('─'[_0x49dcda(0x127)](0x3c));const _0x37895f=segmentWithActivationsToYaml(_0x37b4c2,_0x7f75c9,undefined,_0x501ff5,_0x1eb409),_0xf5925d=segmentToYamlString(_0x37895f),_0x32ad8f=generateDiff(_0xf5925d,'');console[_0x49dcda(0x18b)](formatDiffWithColors(_0x32ad8f)),console['error']('─'[_0x49dcda(0x127)](0x3c));}const _0x5c3e18=_0x2b893e[_0x49dcda(0x178)](_0x59c0b9=>!_0x59c0b9['isNew']&&_0x59c0b9['diff']);if(_0x5c3e18['length']>0x0&&!_0x1b86c0[_0x49dcda(0x113)])for(const _0x4b66d1 of _0x5c3e18){const _0x24d925=_0x4b66d1[_0x49dcda(0x192)]?_0x4b66d1[_0x49dcda(0x192)]+'/'+_0x4b66d1[_0x49dcda(0x14c)][_0x49dcda(0x11b)]:_0x4b66d1[_0x49dcda(0x14c)][_0x49dcda(0x11b)];console['error']('\x0a'+a31_0x3d78e8['yellow'](_0x49dcda(0x137))+'\x20'+_0x24d925),console[_0x49dcda(0x18b)]('─'[_0x49dcda(0x127)](0x3c)),console[_0x49dcda(0x18b)](_0x4b66d1[_0x49dcda(0x194)]),console[_0x49dcda(0x18b)]('─'[_0x49dcda(0x127)](0x3c));}if(_0x898ef['length']>0x0)for(const _0x59264e of _0x898ef){const _0x47fb48=_0x59264e[_0x49dcda(0x192)]?_0x59264e[_0x49dcda(0x192)]+'/'+_0x59264e['yamlConfig'][_0x49dcda(0x11b)]:_0x59264e['yamlConfig'][_0x49dcda(0x11b)];console[_0x49dcda(0x18b)]('\x0a'+a31_0x3d78e8[_0x49dcda(0x11c)]('New\x20journey:')+'\x20'+_0x47fb48),console['error']('─'['repeat'](0x3c)),_0x59264e['diff']&&console['error'](_0x59264e['diff']),console['error']('─'['repeat'](0x3c));}const _0x48f3a5=_0x4640e9[_0x49dcda(0x178)](_0x4eb2e6=>!_0x4eb2e6[_0x49dcda(0x111)]&&_0x4eb2e6[_0x49dcda(0x194)]);if(_0x48f3a5['length']>0x0)for(const _0x3f6316 of _0x48f3a5){const _0x4d2fc8=_0x3f6316['folderPath']?_0x3f6316[_0x49dcda(0x192)]+'/'+_0x3f6316[_0x49dcda(0x14c)][_0x49dcda(0x11b)]:_0x3f6316['yamlConfig'][_0x49dcda(0x11b)];console[_0x49dcda(0x18b)]('\x0a'+a31_0x3d78e8['yellow']('Changes\x20to\x20journey:')+'\x20'+_0x4d2fc8),console[_0x49dcda(0x18b)]('─'[_0x49dcda(0x127)](0x3c)),console[_0x49dcda(0x18b)](_0x3f6316[_0x49dcda(0x194)]),console[_0x49dcda(0x18b)]('─'[_0x49dcda(0x127)](0x3c));}if(_0x3f263a[_0x49dcda(0x169)]>0x0)for(const _0x1bf431 of _0x3f263a){const _0x3efde8=_0x1bf431[_0x49dcda(0x116)]?_0x5df44d[_0x49dcda(0x19b)](_0x1bf431[_0x49dcda(0x116)])||'':'',_0x1f427f=_0x3efde8?_0x3efde8+'/'+_0x1bf431[_0x49dcda(0x16c)]:_0x1bf431[_0x49dcda(0x16c)];console['error']('\x0a'+a31_0x3d78e8[_0x49dcda(0x14e)](_0x49dcda(0x19d))+'\x20'+_0x1f427f),console[_0x49dcda(0x18b)]('─'[_0x49dcda(0x127)](0x3c)),console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x14e)](_0x49dcda(0x183))),console[_0x49dcda(0x18b)]('─'['repeat'](0x3c));}if(_0x1b86c0[_0x49dcda(0x182)])return console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x157)](_0x49dcda(0x13e))),0x0;const _0x149f0e=_0x1b86c0[_0x49dcda(0x113)]?![]:_0x1520b7[_0x49dcda(0x169)]>0x0||_0x274103[_0x49dcda(0x169)]>0x0||_0x5b2b7d[_0x49dcda(0x169)]>0x0,_0xfbe968=_0x898ef[_0x49dcda(0x169)]>0x0||_0x20e157['length']>0x0||_0x3f263a[_0x49dcda(0x169)]>0x0,_0x298571=_0x1b86c0[_0x49dcda(0x113)]?![]:_0x43caf7[_0x49dcda(0x169)]>0x0,_0x44848f=_0x3669a6[_0x49dcda(0x169)]>0x0;if(!_0x149f0e&&!_0xfbe968&&!_0x298571&&!_0x44848f){const _0x32adfc=_0x1b86c0['journeysOnly']?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x49dcda(0x1a6);console[_0x49dcda(0x18b)](a31_0x3d78e8['green'](_0x32adfc));if(_0x20a397&&_0x474dad[_0x49dcda(0x169)]===0x1){const _0x521f08=_0x474dad[0x0];if(_0x521f08[_0x49dcda(0x171)]?.['id']){const _0x168cb3=getConsoleNextUrl(_0x1b86c0[_0x49dcda(0x16b)],_0x49dcda(0x19f)+_0xaebcd8+_0x49dcda(0x114)+_0x521f08[_0x49dcda(0x171)]['id']+'/j/da/je');console[_0x49dcda(0x18b)]('\x20\x20'+a31_0x3d78e8[_0x49dcda(0x1a9)](_0x168cb3));}}return 0x0;}const _0x56669e=_0x1b86c0[_0x49dcda(0x113)]?_0x898ef[_0x49dcda(0x169)]+_0x20e157[_0x49dcda(0x169)]+_0x3f263a[_0x49dcda(0x169)]+_0x3669a6[_0x49dcda(0x169)]:_0x1520b7['length']+_0x274103[_0x49dcda(0x169)]+_0x5b2b7d['length']+_0x898ef['length']+_0x20e157['length']+_0x3f263a[_0x49dcda(0x169)]+_0x3669a6['length']+_0x43caf7['length'];if(!_0x1b86c0['yes']&&_0x56669e>0x0){const _0x573c83=await confirmKey(_0x49dcda(0x11f)+_0x56669e+_0x49dcda(0x193));if(!_0x573c83)return console[_0x49dcda(0x18b)](_0x49dcda(0x11a)),0x1;}const _0x1ef18c={'withProgress':async(_0x3ec2a1,_0x5d9a55)=>{const _0x5031d0=_0x49dcda,_0x284809=await withSpinner(_0x3ec2a1,_0x5d9a55,{'verbose':_0x1b86c0[_0x5031d0(0x158)]});return{'data':_0x284809['data']};},'logInfo':_0x56ed9d=>console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x170)]('✔\x20'+_0x56ed9d)),'logSuccess':_0x5d3ac0=>console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x11c)]('✔\x20'+_0x5d3ac0)),'logWarning':_0x548ac1=>console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x157)]('⚠\x20'+_0x548ac1)),'logDeleted':_0x51a7cb=>console[_0x49dcda(0x18b)](a31_0x3d78e8[_0x49dcda(0x14e)]('✔\x20'+_0x51a7cb))},_0x4a5520={'segment':_0x51616f[_0x49dcda(0x129)],'journey':_0x51616f[_0x49dcda(0x131)],'user':_0x51616f['user'],'connection':_0x51616f[_0x49dcda(0x196)]};_0x3669a6[_0x49dcda(0x169)]>0x0&&(_0x3d2047=await executePushFolders(_0x4a5520,_0x3669a6,_0x3d2047,{'parentId':_0xaebcd8},_0x1ef18c));const _0x56c769={'rootFolderId':_0x2c29fd,'folderPathToId':_0x3d2047,'folderIdToPath':_0x5df44d,'segmentNameToId':_0x1a05ab,'activationsBySegmentId':_0x3dd800,'emailToIdMap':_0x5cae77,'idToEmailMap':_0x501ff5,'connectionNameToIdMap':_0x14ecbc[_0x49dcda(0x15f)],'connectionIdToNameMap':_0x14ecbc[_0x49dcda(0x115)],'connectionNameToTypeMap':_0x1326c6},_0x1eeb36=await executePushSegments(_0x4a5520,_0x1b86c0[_0x49dcda(0x113)]?[]:_0x2b893e,_0x56c769,{'parentId':_0xaebcd8},_0x1ef18c),_0x59a931=_0x1eeb36[_0x49dcda(0x146)],_0x2890e6=_0x1eeb36[_0x49dcda(0x119)],_0x5e18fe=_0x1eeb36[_0x49dcda(0x16f)]['created'],_0x6ab55a=_0x1eeb36[_0x49dcda(0x16f)][_0x49dcda(0x119)],_0x2c764e=_0x1eeb36['activations'][_0x49dcda(0x161)],_0xac58b6=await executePushSegmentDeletions(_0x4a5520,_0x1b86c0[_0x49dcda(0x113)]?[]:_0x5b2b7d,_0x1ef18c);let _0x2517ab=0x0,_0x42f7a3=0x0,_0x1651e3=0x0;const _0x5ca887=new Map(_0x1a05ab);for(const [_0x192fa6,_0x1bae5e]of _0x1eeb36[_0x49dcda(0x138)]){_0x5ca887[_0x49dcda(0x164)](_0x192fa6,_0x1bae5e);}if(_0x4640e9[_0x49dcda(0x169)]>0x0){const _0x1d5036={..._0x56c769,'segmentNameToId':_0x5ca887,'existingSegments':_0xd732f5,'activationContext':_0x2351c7},_0x17a1c2=await executePushJourneys(_0x4a5520,_0x4640e9,_0x1d5036,{'parentId':_0xaebcd8,'rootFolderId':_0x2c29fd,'verbose':_0x1b86c0[_0x49dcda(0x158)]},_0x1ef18c);_0x2517ab=_0x17a1c2[_0x49dcda(0x146)],_0x42f7a3=_0x17a1c2['updated'];if(_0x20a397&&_0x17a1c2[_0x49dcda(0x13a)]['length']===0x1){const _0xa8de17=_0x17a1c2[_0x49dcda(0x13a)][0x0];if(_0xa8de17[_0x49dcda(0x110)]){const _0x463e28=getConsoleNextUrl(_0x1b86c0['site'],_0x49dcda(0x19f)+_0xaebcd8+'/e/'+_0xa8de17['journeyId']+'/j/da/je');console[_0x49dcda(0x18b)]('\x20\x20'+a31_0x3d78e8['cyan'](_0x463e28));}}}for(const _0x1753c8 of _0x3f263a){console[_0x49dcda(0x18b)](a31_0x3d78e8['yellow']('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x1753c8[_0x49dcda(0x16c)])),_0x1651e3++;}const _0x379b9d=[];if(_0x59a931>0x0)_0x379b9d[_0x49dcda(0x195)](_0x59a931+_0x49dcda(0x1a0));if(_0x2890e6>0x0)_0x379b9d[_0x49dcda(0x195)](_0x2890e6+_0x49dcda(0x13c));if(_0xac58b6>0x0)_0x379b9d[_0x49dcda(0x195)](_0xac58b6+_0x49dcda(0x14d));const _0x1705f0=[];if(_0x2517ab>0x0)_0x1705f0[_0x49dcda(0x195)](_0x2517ab+_0x49dcda(0x1a0));if(_0x42f7a3>0x0)_0x1705f0[_0x49dcda(0x195)](_0x42f7a3+_0x49dcda(0x13c));if(_0x1651e3>0x0)_0x1705f0[_0x49dcda(0x195)](_0x1651e3+'\x20deleted');const _0x3c1b70=[];if(_0x5e18fe>0x0)_0x3c1b70[_0x49dcda(0x195)](_0x5e18fe+_0x49dcda(0x1a0));if(_0x6ab55a>0x0)_0x3c1b70[_0x49dcda(0x195)](_0x6ab55a+_0x49dcda(0x13c));if(_0x2c764e>0x0)_0x3c1b70['push'](_0x2c764e+_0x49dcda(0x14d));return console['error'](a31_0x3d78e8[_0x49dcda(0x11c)](_0x49dcda(0x159))),_0x379b9d['length']>0x0&&!_0x1b86c0[_0x49dcda(0x113)]&&console[_0x49dcda(0x18b)]('\x20\x20Segments:\x20'+_0x379b9d['join'](',\x20')),_0x1705f0[_0x49dcda(0x169)]>0x0&&console[_0x49dcda(0x18b)](_0x49dcda(0x180)+_0x1705f0[_0x49dcda(0x14b)](',\x20')),_0x3c1b70[_0x49dcda(0x169)]>0x0&&!_0x1b86c0[_0x49dcda(0x113)]&&console[_0x49dcda(0x18b)]('\x20\x20Activations:\x20'+_0x3c1b70['join'](',\x20')),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a32_0x1f81a7=a32_0x2db7;(function(_0x3dc18d,_0xe0ebe5){const _0x323304=a32_0x2db7,_0x4c73ec=_0x3dc18d();while(!![]){try{const _0x392634=-parseInt(_0x323304(0x197))/0x1+-parseInt(_0x323304(0x180))/0x2*(parseInt(_0x323304(0x173))/0x3)+parseInt(_0x323304(0x17c))/0x4+parseInt(_0x323304(0x17d))/0x5+-parseInt(_0x323304(0x184))/0x6*(-parseInt(_0x323304(0x189))/0x7)+parseInt(_0x323304(0x193))/0x8*(parseInt(_0x323304(0x179))/0x9)+-parseInt(_0x323304(0x195))/0xa*(parseInt(_0x323304(0x19c))/0xb);if(_0x392634===_0xe0ebe5)break;else _0x4c73ec['push'](_0x4c73ec['shift']());}catch(_0x347164){_0x4c73ec['push'](_0x4c73ec['shift']());}}}(a32_0x1663,0x8d558));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a32_0x1663(){const _0x2444f6=['Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','rule','28310gKakOS','Parent\x20ID:\x20','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','5622684UYmAyw','resolvePathToResource','updateSegmentById','segmentPath','Resolved\x20type:\x20','7cdfmJa','Segment\x20ID\x20missing\x20from\x20resolved\x20path','yellow','segmentId','✔\x20Updated\x20segment\x20\x27','ruleFile','kind','error','\x27...','\x20\x20\x20Path:\x20','1575248qRuTHb','resolveFolderId','40NvtWVk','data','637123dtlDNm','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','description','name','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','3194213AWdKZi','verbose','length','Resolving\x20folder\x20\x27','Update\x20existing\x20child\x20segment','segment','141lXDzHT','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','segment:update','Updating\x20segment\x20\x27','type','Resolved\x20relative\x20path\x20to:\x20','36PcWRhg','segmentName','INTERNAL','2043064YxuXYT','4036700GswqUu'];a32_0x1663=function(){return _0x2444f6;};return a32_0x1663();}import a32_0xc6f34b from'chalk';function a32_0x2db7(_0x474aba,_0x518420){_0x474aba=_0x474aba-0x170;const _0x1663fb=a32_0x1663();let _0x2db723=_0x1663fb[_0x474aba];return _0x2db723;}export class SegmentUpdateCommand extends BaseCommand{[a32_0x1f81a7(0x19a)]=a32_0x1f81a7(0x175);[a32_0x1f81a7(0x199)]=a32_0x1f81a7(0x171);async['execute'](_0x197f86){const _0xe7593b=a32_0x1f81a7;console[_0xe7593b(0x190)](a32_0xc6f34b['yellow'](_0xe7593b(0x174))),console[_0xe7593b(0x190)](a32_0xc6f34b[_0xe7593b(0x18b)](_0xe7593b(0x183)));const {options:_0x24754c,args:_0x598dec,tdx:_0x3815c4}=_0x197f86,_0x25ef8f=_0x24754c;if(_0x598dec[_0xe7593b(0x19e)]===0x0)return console[_0xe7593b(0x190)](_0xe7593b(0x182)),console[_0xe7593b(0x190)](_0xe7593b(0x17e)),console[_0xe7593b(0x190)]('Examples:'),console[_0xe7593b(0x190)](_0xe7593b(0x198)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context'),0x1;const _0x4dc9ed=_0x598dec[0x0],_0x2a8ab9=_0x24754c[_0xe7593b(0x187)];let _0xc02c57=_0x4dc9ed;_0x2a8ab9&&!_0x4dc9ed['includes']('/')&&(_0xc02c57=_0x2a8ab9+'/'+_0x4dc9ed,_0x25ef8f[_0xe7593b(0x19d)]&&console['error'](_0xe7593b(0x178)+_0xc02c57));const _0x416929=await withSpinner('Resolving\x20path\x20\x27'+_0xc02c57+'\x27...',()=>_0x3815c4['segment'][_0xe7593b(0x185)](_0xc02c57),{'verbose':_0x25ef8f[_0xe7593b(0x19d)]}),_0x5de390=_0x416929[_0xe7593b(0x196)];_0x25ef8f['verbose']&&console['error'](_0xe7593b(0x188)+_0x5de390[_0xe7593b(0x177)]);if(_0x5de390[_0xe7593b(0x177)]!==_0xe7593b(0x172))return console[_0xe7593b(0x190)]('Error:\x20Cannot\x20update\x20'+_0x5de390[_0xe7593b(0x177)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0xe7593b(0x19b)),0x1;if(!_0x5de390['segmentId'])throw new SDKError(ErrorCode[_0xe7593b(0x17b)],_0xe7593b(0x18a));const _0x1afa90=_0x5de390['parentId'],_0x223243=_0x5de390[_0xe7593b(0x18c)];_0x25ef8f[_0xe7593b(0x19d)]&&(console[_0xe7593b(0x190)](_0xe7593b(0x181)+_0x1afa90),console[_0xe7593b(0x190)]('Segment\x20ID:\x20'+_0x223243));let _0x1f8e42;if(_0x25ef8f['folder']){const _0x25c0dd=_0x25ef8f['folder'],_0x4b914a=await withSpinner(_0xe7593b(0x170)+_0x25c0dd+_0xe7593b(0x191),()=>_0x3815c4[_0xe7593b(0x172)][_0xe7593b(0x194)](_0x1afa90,_0x25c0dd),{'verbose':_0x25ef8f[_0xe7593b(0x19d)]});_0x1f8e42=parseInt(_0x4b914a[_0xe7593b(0x196)],0xa),_0x25ef8f[_0xe7593b(0x19d)]&&console[_0xe7593b(0x190)]('Resolved\x20folder\x20ID:\x20'+_0x1f8e42);}const _0x443f5b=await loadJSONFromOptions(_0x25ef8f[_0xe7593b(0x17f)],_0x25ef8f[_0xe7593b(0x18e)]),_0x52e7ab={'name':_0x25ef8f['name'],'description':_0x25ef8f[_0xe7593b(0x199)],'rule':_0x443f5b,'kind':_0x25ef8f['kind']!==undefined?parseInt(_0x25ef8f[_0xe7593b(0x18f)],0xa):undefined,'segmentFolderId':_0x1f8e42},_0x7b7489=await withSpinner(_0xe7593b(0x176)+_0x5de390[_0xe7593b(0x17a)]+'\x27...',()=>_0x3815c4[_0xe7593b(0x172)][_0xe7593b(0x186)](_0x1afa90,_0x223243,_0x52e7ab),{'verbose':_0x25ef8f['verbose']}),_0x80cfd3=_0x7b7489[_0xe7593b(0x196)];return console[_0xe7593b(0x190)](_0xe7593b(0x18d)+_0x80cfd3[_0xe7593b(0x19a)]+'\x27'),_0xc02c57!==_0x4dc9ed&&console[_0xe7593b(0x190)](_0xe7593b(0x192)+_0xc02c57),await handleSDKOutput([_0x80cfd3],_0x25ef8f),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a33_0x26c7c8=a33_0x567d;function a33_0x567d(_0x1d7f55,_0x5d0907){_0x1d7f55=_0x1d7f55-0x138;const _0x3fde84=a33_0x3fde();let _0x567d57=_0x3fde84[_0x1d7f55];return _0x567d57;}(function(_0x34a142,_0xa9778c){const _0x563430=a33_0x567d,_0x3d17c5=_0x34a142();while(!![]){try{const _0x3f68b6=-parseInt(_0x563430(0x14e))/0x1+-parseInt(_0x563430(0x15c))/0x2+-parseInt(_0x563430(0x152))/0x3*(parseInt(_0x563430(0x156))/0x4)+parseInt(_0x563430(0x166))/0x5+-parseInt(_0x563430(0x149))/0x6+parseInt(_0x563430(0x15d))/0x7*(parseInt(_0x563430(0x145))/0x8)+parseInt(_0x563430(0x15e))/0x9;if(_0x3f68b6===_0xa9778c)break;else _0x3d17c5['push'](_0x3d17c5['shift']());}catch(_0x2dce53){_0x3d17c5['push'](_0x3d17c5['shift']());}}}(a33_0x3fde,0x60572));import{existsSync,statSync}from'fs';import a33_0x1d07dc from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a33_0x3fde(){const _0x5b7d5b=['38344SdAHXA','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Target\x20path:\x20','join','3051156uYROdg','folderId','green','folderPath','Folder\x20ID:\x20','122313OjkbmR','type','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','segmentPath','867NEnABL','Use:\x20tdx\x20segment\x20use\x20','segments','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','3748EiePAz','data','Resolving\x20path\x20\x27','parentName','Resolved\x20relative\x20path\x20to:\x20','segment','523030xTMIFa','749KEbFAT','5590134hkIkdu','isDirectory','Site:\x20','split','Usage:\x20tdx\x20segment\x20use\x20<path>','red','description','fullPath','2118900seWhXC','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','parentId','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','name','Examples:','Parent\x20ID:\x20','error','parent_segment','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','cyan','resolvePathToResource','\x27...','dim','verbose','segment:use','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','log','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','length','✔\x20Context\x20set\x20to:\x20'];a33_0x3fde=function(){return _0x5b7d5b;};return a33_0x3fde();}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a33_0x26c7c8(0x16b)]=a33_0x26c7c8(0x13f);[a33_0x26c7c8(0x164)]=a33_0x26c7c8(0x150);async['execute'](_0x362fa4){const _0x156709=a33_0x26c7c8,{options:_0x2a21d0,args:_0x26deee,tdx:_0x108add}=_0x362fa4;if(_0x26deee['length']===0x0)return console[_0x156709(0x16e)](a33_0x1d07dc[_0x156709(0x163)]('Error:\x20Path\x20is\x20required\x0a')),console[_0x156709(0x16e)](_0x156709(0x162)),console['error'](_0x156709(0x16c)),console['error'](_0x156709(0x155)),console['error'](_0x156709(0x169)),console[_0x156709(0x16e)](_0x156709(0x16a)),console[_0x156709(0x16e)](_0x156709(0x142)),0x1;const _0x4bc7c5=_0x26deee[0x0],_0x59a3de=_0x2a21d0['session'];try{if(_0x4bc7c5==='/')return saveSessionContext({'segment_path':undefined},_0x59a3de),console['log'](a33_0x1d07dc[_0x156709(0x14b)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;if(existsSync(_0x4bc7c5)&&statSync(_0x4bc7c5)[_0x156709(0x15f)]()){let _0x3e8e23;try{_0x3e8e23=findTdxConfig(_0x4bc7c5);}catch{return console[_0x156709(0x16e)](a33_0x1d07dc[_0x156709(0x163)](_0x156709(0x138)+_0x4bc7c5)),console[_0x156709(0x16e)](a33_0x1d07dc[_0x156709(0x13a)](_0x156709(0x139))),0x1;}const _0x1acec9=_0x3e8e23['config'][_0x156709(0x16f)];return saveSessionContext({'segment_path':_0x1acec9,'parent_segment':_0x1acec9},_0x59a3de),console[_0x156709(0x141)](a33_0x1d07dc['green'](_0x156709(0x144)+a33_0x1d07dc[_0x156709(0x13a)](_0x1acec9))),0x0;}const _0x35acbe=_0x2a21d0[_0x156709(0x151)];let _0x3a78b0=_0x4bc7c5;const _0x1aa518=parsePath(_0x4bc7c5);if(!_0x1aa518['isAbsolute']){if(!_0x35acbe)return console[_0x156709(0x16e)](a33_0x1d07dc[_0x156709(0x163)]('Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.')),console[_0x156709(0x16e)](a33_0x1d07dc[_0x156709(0x13a)]('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x4bc7c5==='..'){const _0x427be8=_0x35acbe[_0x156709(0x161)]('/')['slice'](0x0,-0x1)[_0x156709(0x148)]('/');_0x3a78b0=_0x427be8||'/';}else _0x4bc7c5==='.'?_0x3a78b0=_0x35acbe:_0x3a78b0=_0x35acbe+'/'+_0x4bc7c5;_0x2a21d0[_0x156709(0x13e)]&&console[_0x156709(0x16e)](_0x156709(0x15a)+_0x3a78b0);}if(_0x3a78b0==='/'||_0x3a78b0==='')return saveSessionContext({'segment_path':undefined},_0x59a3de),console[_0x156709(0x141)](a33_0x1d07dc[_0x156709(0x14b)](_0x156709(0x167))),0x0;_0x3a78b0=normalizePath(_0x3a78b0);const _0x2d3d20=parsePath(_0x3a78b0)[_0x156709(0x154)];if(_0x2d3d20[_0x156709(0x143)]===0x0)return saveSessionContext({'segment_path':undefined},_0x59a3de),console['log'](a33_0x1d07dc[_0x156709(0x14b)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x2a21d0[_0x156709(0x13e)]&&(console['error'](_0x156709(0x160)+_0x2a21d0['site']),console[_0x156709(0x16e)](_0x156709(0x147)+_0x3a78b0));const _0x2d1418=await withSpinner(_0x156709(0x158)+_0x3a78b0+_0x156709(0x13c),()=>_0x108add[_0x156709(0x15b)][_0x156709(0x13b)](_0x3a78b0),{'verbose':_0x2a21d0[_0x156709(0x13e)]}),_0x2681e9=_0x2d1418[_0x156709(0x157)];_0x2a21d0[_0x156709(0x13e)]&&(console['error']('Resolved\x20path\x20type:\x20'+_0x2681e9[_0x156709(0x14f)]),console['error'](_0x156709(0x16d)+_0x2681e9[_0x156709(0x168)]),_0x2681e9[_0x156709(0x14a)]&&console[_0x156709(0x16e)](_0x156709(0x14d)+_0x2681e9[_0x156709(0x14a)]));if(_0x2681e9[_0x156709(0x14f)]===_0x156709(0x15b))return console[_0x156709(0x16e)](a33_0x1d07dc[_0x156709(0x163)](_0x156709(0x146))),console[_0x156709(0x16e)]('Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.'),console['error'](a33_0x1d07dc[_0x156709(0x13a)](_0x156709(0x153)+_0x2681e9['parentName']+(_0x2681e9[_0x156709(0x14c)]?'/'+_0x2681e9[_0x156709(0x14c)][_0x156709(0x148)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x2681e9[_0x156709(0x165)],'parent_segment':_0x2681e9[_0x156709(0x159)]},_0x59a3de),console[_0x156709(0x141)](a33_0x1d07dc[_0x156709(0x14b)](_0x156709(0x144)+a33_0x1d07dc['cyan'](_0x2681e9[_0x156709(0x165)]))),_0x2a21d0[_0x156709(0x13e)]&&(console[_0x156709(0x16e)](a33_0x1d07dc['dim']('Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context')),console[_0x156709(0x16e)](a33_0x1d07dc[_0x156709(0x13d)](_0x156709(0x140)))),0x0;}catch(_0x351c1e){throw _0x351c1e;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a34_0x3bcd(_0x21568f,_0x404a8d){_0x21568f=_0x21568f-0x15f;const _0x17fce9=a34_0x17fc();let _0x3bcdf2=_0x17fce9[_0x21568f];return _0x3bcdf2;}const a34_0x2df369=a34_0x3bcd;(function(_0x3641e4,_0x15ea53){const _0x44b05b=a34_0x3bcd,_0xe388bb=_0x3641e4();while(!![]){try{const _0x31fcc8=parseInt(_0x44b05b(0x178))/0x1+-parseInt(_0x44b05b(0x18a))/0x2*(parseInt(_0x44b05b(0x160))/0x3)+parseInt(_0x44b05b(0x18b))/0x4*(parseInt(_0x44b05b(0x177))/0x5)+-parseInt(_0x44b05b(0x164))/0x6+parseInt(_0x44b05b(0x15f))/0x7*(parseInt(_0x44b05b(0x16c))/0x8)+-parseInt(_0x44b05b(0x17e))/0x9+-parseInt(_0x44b05b(0x189))/0xa*(-parseInt(_0x44b05b(0x16b))/0xb);if(_0x31fcc8===_0x15ea53)break;else _0xe388bb['push'](_0xe388bb['shift']());}catch(_0x40635e){_0xe388bb['push'](_0xe388bb['shift']());}}}(a34_0x17fc,0x20d16));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a34_0x49e02a from'chalk';function a34_0x17fc(){const _0x3b9b20=['120654oSjIJM','red','length','\x20file(s)\x20with\x20errors,\x20','error','\x20valid','):\x20','50831hAstVM','16DtZwPP','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','filePath','Validation\x20failed:\x20','errorCode','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','invalidCount','verbose','errors','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','warnings','5690XYDTOa','138613fURPJy','warningCount','execute','log','✔\x20All\x20','Validate\x20segment\x20and\x20journey\x20YAML\x20files','2164059VoJhkV','Error:\x20','no_parent','name','\x20warning(s)','dim','yellow','description','endsWith','valid','parentSegment','640yqqEBZ','938EBHrzJ','4mpAdAv','\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','\x20error(s)','file','hasErrors','validCount','green','helpText','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file','365428GGOVxK','927ZcBZaN','.yaml','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)\x20found'];a34_0x17fc=function(){return _0x3b9b20;};return a34_0x17fc();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a34_0x2df369(0x181)]='segment:validate';[a34_0x2df369(0x185)]=a34_0x2df369(0x17d);async[a34_0x2df369(0x17a)](_0x3bdaa2){const _0x1fa498=a34_0x2df369,{options:_0x2c59ea,args:_0x44817f}=_0x3bdaa2,_0x52b06d=_0x2c59ea,_0x238ae5=await resolveTarget({'arg':_0x44817f[0x0],'contextParent':_0x2c59ea[_0x1fa498(0x188)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x238ae5))return _0x238ae5[_0x1fa498(0x170)]===_0x1fa498(0x180)?(console[_0x1fa498(0x168)](a34_0x49e02a[_0x1fa498(0x184)](_0x1fa498(0x175))),console[_0x1fa498(0x168)](_0x1fa498(0x16d)),console[_0x1fa498(0x168)](_0x1fa498(0x18c)),console['error'](_0x1fa498(0x193))):(console['error'](a34_0x49e02a[_0x1fa498(0x165)](_0x1fa498(0x17f)+_0x238ae5['message']+'\x0a')),_0x238ae5[_0x1fa498(0x192)]&&console[_0x1fa498(0x168)](a34_0x49e02a['cyan'](_0x238ae5[_0x1fa498(0x192)]))),0x1;const _0x46ccab=_0x238ae5['targetDir'],_0x263bd3=_0x238ae5['type']===_0x1fa498(0x18e)?_0x238ae5[_0x1fa498(0x16e)]:undefined;if(!_0x263bd3&&!existsSync(_0x46ccab))return console[_0x1fa498(0x168)](a34_0x49e02a[_0x1fa498(0x165)]('Error:\x20Directory\x20not\x20found:\x20'+_0x46ccab+'\x0a')),0x1;let _0x12b362;if(_0x263bd3){if(!_0x263bd3[_0x1fa498(0x186)]('.yml')&&!_0x263bd3['endsWith'](_0x1fa498(0x161)))return console[_0x1fa498(0x168)](a34_0x49e02a[_0x1fa498(0x165)](_0x1fa498(0x171)+_0x263bd3+'\x0a')),0x1;_0x12b362=[_0x263bd3];}else _0x12b362=findYamlFiles(_0x46ccab);if(_0x12b362['length']===0x0)return console[_0x1fa498(0x168)](a34_0x49e02a[_0x1fa498(0x165)](_0x1fa498(0x162)+_0x46ccab+'\x0a')),0x1;const _0x26122e=validateYamlFiles(_0x12b362,_0x46ccab),_0x446120=calculateSummary(_0x26122e);for(const _0x2c59d9 of _0x26122e){if(!isValidationResult(_0x2c59d9))continue;const {relativePath:_0x4e8417,source:_0x52e135,result:_0x26f4cf,fileType:_0x34ec9c}=_0x2c59d9,_0x1f6093=_0x34ec9c;if(_0x26f4cf[_0x1fa498(0x187)]&&_0x26f4cf[_0x1fa498(0x176)][_0x1fa498(0x166)]===0x0)_0x52b06d[_0x1fa498(0x173)]&&console[_0x1fa498(0x17b)](a34_0x49e02a[_0x1fa498(0x191)]('✔\x20'+_0x4e8417)+a34_0x49e02a['dim']('\x20('+_0x1f6093+')'));else _0x26f4cf[_0x1fa498(0x187)]?(console[_0x1fa498(0x17b)](a34_0x49e02a[_0x1fa498(0x184)]('⚠\x20'+_0x4e8417)+a34_0x49e02a['dim']('\x20('+_0x1f6093+_0x1fa498(0x16a)+_0x26f4cf[_0x1fa498(0x176)][_0x1fa498(0x166)]+_0x1fa498(0x182))),console[_0x1fa498(0x17b)](formatValidationResult(_0x26f4cf,_0x52e135,_0x4e8417))):(console[_0x1fa498(0x17b)](a34_0x49e02a[_0x1fa498(0x165)]('✖\x20'+_0x4e8417)+a34_0x49e02a[_0x1fa498(0x183)]('\x20('+_0x1f6093+_0x1fa498(0x16a)+_0x26f4cf[_0x1fa498(0x174)][_0x1fa498(0x166)]+_0x1fa498(0x18d))),console[_0x1fa498(0x17b)](formatValidationResult(_0x26f4cf,_0x52e135,_0x4e8417)));}return console[_0x1fa498(0x17b)](''),_0x446120[_0x1fa498(0x18f)]?(console[_0x1fa498(0x17b)](a34_0x49e02a[_0x1fa498(0x165)](_0x1fa498(0x16f)+_0x446120[_0x1fa498(0x172)]+_0x1fa498(0x167)+_0x446120[_0x1fa498(0x190)]+_0x1fa498(0x169))),_0x446120[_0x1fa498(0x179)]>0x0&&console[_0x1fa498(0x17b)](a34_0x49e02a[_0x1fa498(0x184)](_0x446120[_0x1fa498(0x179)]+'\x20warning(s)\x20found')),0x1):(console[_0x1fa498(0x17b)](a34_0x49e02a[_0x1fa498(0x191)](_0x1fa498(0x17c)+_0x446120['validCount']+'\x20file(s)\x20valid')),_0x446120[_0x1fa498(0x179)]>0x0&&console[_0x1fa498(0x17b)](a34_0x49e02a['yellow'](_0x446120[_0x1fa498(0x179)]+_0x1fa498(0x163))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a35_0x51a9(_0xd41cdd,_0x21e901){_0xd41cdd=_0xd41cdd-0x88;const _0x5e623d=a35_0x5e62();let _0x51a99a=_0x5e623d[_0xd41cdd];return _0x51a99a;}const a35_0x267b01=a35_0x51a9;(function(_0x394b8e,_0x5665b5){const _0x354a96=a35_0x51a9,_0x355ca7=_0x394b8e();while(!![]){try{const _0x2409a0=-parseInt(_0x354a96(0xca))/0x1+-parseInt(_0x354a96(0x9d))/0x2+-parseInt(_0x354a96(0x94))/0x3+parseInt(_0x354a96(0xa3))/0x4*(-parseInt(_0x354a96(0xaf))/0x5)+parseInt(_0x354a96(0xa4))/0x6+parseInt(_0x354a96(0xd4))/0x7*(-parseInt(_0x354a96(0xbb))/0x8)+parseInt(_0x354a96(0xc1))/0x9*(parseInt(_0x354a96(0xa5))/0xa);if(_0x2409a0===_0x5665b5)break;else _0x355ca7['push'](_0x355ca7['shift']());}catch(_0x117f38){_0x355ca7['push'](_0x355ca7['shift']());}}}(a35_0x5e62,0x1ffc3));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a35_0x5e62(){const _0x3fe0c5=['listRecursive','length','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','journeyBundleName','Building\x20hierarchy\x20tree...','description','resolvePathToResource','25214ssgJBW','name','Set\x20a\x20parent\x20segment\x20context\x20first:','message','Site:\x20','Parent\x20ID:\x20','234204JPPowM','288486HXegBr','2750dAdvSz','children','data','Listing\x20folders,\x20segments,\x20and\x20journeys...','✔\x20Found\x20','Folder/pattern\x20arg:\x20','\x20segment','parentSegment','Resolving\x20parent\x20segment\x20\x27','journey','10mCVPNi','\x20journey','\x27...','No\x20items\x20match\x20pattern:\x20','type','jsonl','format','/app/ps/','folderId','Error:\x20','/j/da','listWithPattern','24qlJpRk','log','Recursive\x20mode:\x20enabled','journeys',',\x20and\x20','replace','17370nmeTUN','localeCompare',']\x20matching\x20\x27','Resolving\x20path\x20\x27','/e/','maxDepth','Error:\x20No\x20parent\x20segment\x20context\x20set.','sort','(empty)','10712ZUXMED','Parent\x20segment\x20context:\x20','segments','Folder\x20ID:\x20','dim','✔\x20Built\x20tree\x20with\x20','segment','filter','test','listUnifiedWithJourneys','582764fdiFTZ','site','\x20matching\x20\x27','error','verbose','map','parentId','listUnified','\x20folder','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','folder','cause','includes','json','172929iOxyNC','folders'];a35_0x5e62=function(){return _0x3fe0c5;};return a35_0x5e62();}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a35_0x24aaff from'chalk';export class SegmentsCommand extends BaseCommand{[a35_0x267b01(0x9e)]=a35_0x267b01(0xcc);[a35_0x267b01(0x9b)]='List\x20folders\x20and\x20child\x20segments';async['execute'](_0x4e01cf){const _0x201678=a35_0x267b01,{options:_0x3ab2f4,args:_0xad1947}=_0x4e01cf,_0x2a496b=_0x3ab2f4['recursive'],_0x4abd03=_0xad1947[0x0];try{const _0xd8fb36=_0x3ab2f4[_0x201678(0xac)];_0x3ab2f4[_0x201678(0x8a)]&&(console[_0x201678(0x89)](_0x201678(0xa1)+_0x3ab2f4[_0x201678(0xd5)]),console['error'](_0x201678(0xcb)+(_0xd8fb36||'(not\x20set)')),_0x4abd03&&console['error'](_0x201678(0xaa)+_0x4abd03),_0x2a496b&&console[_0x201678(0x89)](_0x201678(0xbd)));if(!_0xd8fb36)return console[_0x201678(0x89)](_0x201678(0xc7)),console[_0x201678(0x89)](''),console['error'](_0x201678(0x9f)),console[_0x201678(0x89)](_0x201678(0x8f)),console[_0x201678(0x89)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console['error'](''),console[_0x201678(0x89)](_0x201678(0x98)),0x1;const _0x2ea046=_0x4abd03&&(_0x4abd03['includes']('*')||_0x4abd03[_0x201678(0x92)]('?'));if(_0x2ea046)return await this[_0x201678(0xba)](_0x4e01cf,_0xd8fb36,_0x4abd03);const _0x1af91c=_0x4abd03?_0xd8fb36+'/'+_0x4abd03:_0xd8fb36;return _0x2a496b?await this[_0x201678(0x96)](_0x4e01cf,_0x1af91c):await this[_0x201678(0x8d)](_0x4e01cf,_0x1af91c);}catch(_0x1582a1){if(_0x1582a1 instanceof SDKError)return console[_0x201678(0x89)](_0x201678(0xb8)+_0x1582a1[_0x201678(0xa0)]),_0x1582a1['cause']&&console[_0x201678(0x89)]('\x20\x20Cause:\x20'+_0x1582a1[_0x201678(0x91)]),0x1;throw _0x1582a1;}}async['listWithPattern'](_0x1cfdfe,_0xf9ba89,_0x542592){const _0x27d6cf=a35_0x267b01,{options:_0x4dc434,tdx:_0x210c6f}=_0x1cfdfe,_0x2b8655=await withSpinner(_0x27d6cf(0xad)+_0xf9ba89+_0x27d6cf(0xb1),()=>_0x210c6f[_0x27d6cf(0xd0)][_0x27d6cf(0x9c)](_0xf9ba89),{'verbose':_0x4dc434[_0x27d6cf(0x8a)]}),_0x7ed0e2=_0x2b8655[_0x27d6cf(0xa7)],_0x514ccd=await withSpinner(_0x27d6cf(0xa8),()=>_0x210c6f[_0x27d6cf(0xd0)][_0x27d6cf(0xd3)](_0x7ed0e2[_0x27d6cf(0x8c)],_0x7ed0e2[_0x27d6cf(0xb7)]),{'verbose':_0x4dc434['verbose']}),{folders:_0x544b4b,segments:_0x31af63,journeys:_0x31de65}=_0x514ccd['data'],_0x6b2214=_0x542592[_0x27d6cf(0xc0)](/[.+^${}()|[\]\\]/g,'\x5c$&')['replace'](/\*/g,'.*')[_0x27d6cf(0xc0)](/\?/g,'.'),_0x417c7f=new RegExp('^'+_0x6b2214+'$','i'),_0x4d8e1b=_0x544b4b['filter'](_0x3716d1=>_0x417c7f['test'](_0x3716d1[_0x27d6cf(0x9e)])),_0x3d265d=_0x31af63[_0x27d6cf(0xd1)](_0x4f87e5=>_0x417c7f[_0x27d6cf(0xd2)](_0x4f87e5[_0x27d6cf(0x9e)])),_0x1a3936=_0x31de65[_0x27d6cf(0xd1)](_0x357b5d=>_0x417c7f[_0x27d6cf(0xd2)](_0x357b5d[_0x27d6cf(0x99)])),_0x8cb1ed=_0x4d8e1b['length']+_0x3d265d['length']+_0x1a3936[_0x27d6cf(0x97)];console[_0x27d6cf(0x89)](_0x27d6cf(0xa9)+_0x4d8e1b['length']+_0x27d6cf(0x8e)+(_0x4d8e1b[_0x27d6cf(0x97)]!==0x1?'s':'')+',\x20'+_0x3d265d[_0x27d6cf(0x97)]+'\x20segment'+(_0x3d265d[_0x27d6cf(0x97)]!==0x1?'s':'')+_0x27d6cf(0xbf)+_0x1a3936[_0x27d6cf(0x97)]+_0x27d6cf(0xb0)+(_0x1a3936[_0x27d6cf(0x97)]!==0x1?'s':'')+_0x27d6cf(0x88)+_0x542592+'\x27');const _0xb38354=_0x391bb1=>{const _0xf2525=_0x27d6cf;return getConsoleNextUrl(_0x4dc434[_0xf2525(0xd5)],_0xf2525(0xb6)+_0x7ed0e2[_0xf2525(0x8c)]+_0xf2525(0xc5)+_0x391bb1);},_0x17e941=_0x4dc434[_0x27d6cf(0xb5)]===_0x27d6cf(0x93)||_0x4dc434[_0x27d6cf(0xb5)]===_0x27d6cf(0xb4);if(_0x17e941){const _0x3be3f9=[..._0x4d8e1b[_0x27d6cf(0x8b)](_0xca0bf9=>({..._0xca0bf9,'type':_0x27d6cf(0x90)})),..._0x3d265d[_0x27d6cf(0x8b)](_0x145c1b=>({..._0x145c1b,'type':_0x27d6cf(0xd0),'url':_0xb38354(_0x145c1b['id'])})),..._0x1a3936[_0x27d6cf(0x8b)](_0x27cf20=>({..._0x27cf20,'name':_0x27cf20[_0x27d6cf(0x99)],'type':'journey'}))][_0x27d6cf(0xc8)]((_0x2a05ef,_0x279a6c)=>_0x2a05ef[_0x27d6cf(0x9e)][_0x27d6cf(0xc2)](_0x279a6c[_0x27d6cf(0x9e)]));await handleSDKOutput(_0x3be3f9,_0x4dc434);}else{if(_0x8cb1ed===0x0)console[_0x27d6cf(0xbc)](_0x27d6cf(0xb2)+_0x542592);else{console['log'](a35_0x24aaff[_0x27d6cf(0xce)]('['+_0xf9ba89+_0x27d6cf(0xc3)+_0x542592+'\x27'));const _0x122b81=formatFlatList(_0x4d8e1b,_0x3d265d,{'showMetadata':!![],'getSegmentUrl':_0xb38354},_0x1a3936);console[_0x27d6cf(0xbc)](_0x122b81);}}return 0x0;}async['listUnified'](_0x573aff,_0x5c1262){const _0x1985ed=a35_0x267b01,{options:_0x105347,tdx:_0x16d2e3}=_0x573aff,_0x3da1ca=await withSpinner(_0x1985ed(0xc4)+_0x5c1262+'\x27...',()=>_0x16d2e3['segment'][_0x1985ed(0x9c)](_0x5c1262),{'verbose':_0x105347[_0x1985ed(0x8a)]}),_0x32bbe0=_0x3da1ca[_0x1985ed(0xa7)];_0x105347[_0x1985ed(0x8a)]&&(console['error'](_0x1985ed(0xa2)+_0x32bbe0[_0x1985ed(0x8c)]),_0x32bbe0[_0x1985ed(0xb7)]&&console[_0x1985ed(0x89)]('Folder\x20ID:\x20'+_0x32bbe0[_0x1985ed(0xb7)]));const _0x27f2ad=await withSpinner(_0x1985ed(0xa8),()=>_0x16d2e3[_0x1985ed(0xd0)][_0x1985ed(0xd3)](_0x32bbe0['parentId'],_0x32bbe0['folderId']),{'verbose':_0x105347[_0x1985ed(0x8a)]}),{folders:_0x3f0f4a,segments:_0x3cbd45,journeys:_0x18bd52}=_0x27f2ad[_0x1985ed(0xa7)],_0x59e362=_0x3f0f4a[_0x1985ed(0x97)]+_0x3cbd45['length']+_0x18bd52[_0x1985ed(0x97)];console[_0x1985ed(0x89)](_0x1985ed(0xa9)+_0x3f0f4a[_0x1985ed(0x97)]+_0x1985ed(0x8e)+(_0x3f0f4a[_0x1985ed(0x97)]!==0x1?'s':'')+',\x20'+_0x3cbd45['length']+_0x1985ed(0xab)+(_0x3cbd45[_0x1985ed(0x97)]!==0x1?'s':'')+_0x1985ed(0xbf)+_0x18bd52[_0x1985ed(0x97)]+_0x1985ed(0xb0)+(_0x18bd52['length']!==0x1?'s':''));const _0xa2562e=_0x42c00b=>{const _0x3fb211=_0x1985ed;return getConsoleNextUrl(_0x105347[_0x3fb211(0xd5)],_0x3fb211(0xb6)+_0x32bbe0[_0x3fb211(0x8c)]+'/e/'+_0x42c00b);},_0x58fb9c=_0x2c059e=>{const _0x241b31=_0x1985ed;return getConsoleNextUrl(_0x105347[_0x241b31(0xd5)],'/app/ps/'+_0x32bbe0[_0x241b31(0x8c)]+_0x241b31(0xc5)+_0x2c059e+_0x241b31(0xb9));},_0x5a2ba5=_0x105347[_0x1985ed(0xb5)]==='json'||_0x105347[_0x1985ed(0xb5)]===_0x1985ed(0xb4);if(_0x5a2ba5){const _0x38df48=[..._0x3f0f4a['map'](_0x13e2da=>({..._0x13e2da,'type':_0x1985ed(0x90)})),..._0x3cbd45['map'](_0x21156f=>({..._0x21156f,'type':_0x1985ed(0xd0),'url':_0xa2562e(_0x21156f['id'])})),..._0x18bd52[_0x1985ed(0x8b)](_0x249b81=>({..._0x249b81,'name':_0x249b81[_0x1985ed(0x99)],'type':_0x1985ed(0xae),'url':_0x58fb9c(_0x249b81['id'])}))][_0x1985ed(0xc8)]((_0x2f7cd6,_0x23853c)=>_0x2f7cd6[_0x1985ed(0x9e)][_0x1985ed(0xc2)](_0x23853c['name']));await handleSDKOutput(_0x38df48,_0x105347);}else{if(_0x59e362===0x0)console['log'](a35_0x24aaff[_0x1985ed(0xce)]('['+_0x5c1262+']')),console[_0x1985ed(0xbc)](_0x1985ed(0xc9));else{console[_0x1985ed(0xbc)](a35_0x24aaff[_0x1985ed(0xce)]('['+_0x5c1262+']'));const _0x26ec3c=formatFlatList(_0x3f0f4a,_0x3cbd45,{'showMetadata':!![],'getSegmentUrl':_0xa2562e,'getJourneyUrl':_0x58fb9c},_0x18bd52);console[_0x1985ed(0xbc)](_0x26ec3c);}}return 0x0;}async[a35_0x267b01(0x96)](_0x5c3c6a,_0x391e01){const _0x23b2db=a35_0x267b01,{options:_0x51aa6f,tdx:_0x531bf5}=_0x5c3c6a,_0x52e599=await withSpinner('Resolving\x20path\x20\x27'+_0x391e01+_0x23b2db(0xb1),()=>_0x531bf5[_0x23b2db(0xd0)]['resolvePathToResource'](_0x391e01),{'verbose':_0x51aa6f[_0x23b2db(0x8a)]}),_0x337091=_0x52e599[_0x23b2db(0xa7)];_0x51aa6f[_0x23b2db(0x8a)]&&(console[_0x23b2db(0x89)]('Parent\x20ID:\x20'+_0x337091[_0x23b2db(0x8c)]),_0x337091[_0x23b2db(0xb7)]&&console[_0x23b2db(0x89)](_0x23b2db(0xcd)+_0x337091[_0x23b2db(0xb7)]));const _0x390671=_0x51aa6f[_0x23b2db(0xc6)]||0xa,_0x597032=await withSpinner(_0x23b2db(0x9a),()=>_0x531bf5[_0x23b2db(0xd0)][_0x23b2db(0x96)](_0x337091[_0x23b2db(0x8c)],_0x337091['folderId'],0x0,_0x390671),{'verbose':_0x51aa6f[_0x23b2db(0x8a)]}),_0x335b8e=_0x597032['data'],_0x3e89fc=_0x170748=>{const _0x4707a3=_0x23b2db;let _0x2f08bf=0x0,_0x37672d=0x0,_0x235985=0x0;for(const _0x890a8c of _0x170748){if(_0x890a8c[_0x4707a3(0xb3)]===_0x4707a3(0x90))_0x2f08bf++;else{if(_0x890a8c['type']===_0x4707a3(0xd0))_0x37672d++;else{if(_0x890a8c['type']===_0x4707a3(0xae))_0x235985++;}}if(_0x890a8c[_0x4707a3(0xa6)]){const _0x2f25ff=_0x3e89fc(_0x890a8c['children']);_0x2f08bf+=_0x2f25ff['folders'],_0x37672d+=_0x2f25ff[_0x4707a3(0xcc)],_0x235985+=_0x2f25ff[_0x4707a3(0xbe)];}}return{'folders':_0x2f08bf,'segments':_0x37672d,'journeys':_0x235985};},_0x38887f=_0x3e89fc(_0x335b8e);console[_0x23b2db(0x89)](_0x23b2db(0xcf)+_0x38887f[_0x23b2db(0x95)]+'\x20folder'+(_0x38887f[_0x23b2db(0x95)]!==0x1?'s':'')+',\x20'+_0x38887f[_0x23b2db(0xcc)]+_0x23b2db(0xab)+(_0x38887f[_0x23b2db(0xcc)]!==0x1?'s':'')+_0x23b2db(0xbf)+_0x38887f[_0x23b2db(0xbe)]+_0x23b2db(0xb0)+(_0x38887f[_0x23b2db(0xbe)]!==0x1?'s':''));const _0x54c1fa=_0x59b47b=>{const _0xdd2cd3=_0x23b2db;return getConsoleNextUrl(_0x51aa6f['site'],_0xdd2cd3(0xb6)+_0x337091[_0xdd2cd3(0x8c)]+_0xdd2cd3(0xc5)+_0x59b47b);},_0x2e4546=_0x526416=>{const _0x7a5932=_0x23b2db;return getConsoleNextUrl(_0x51aa6f[_0x7a5932(0xd5)],_0x7a5932(0xb6)+_0x337091[_0x7a5932(0x8c)]+_0x7a5932(0xc5)+_0x526416+_0x7a5932(0xb9));};if(_0x51aa6f[_0x23b2db(0xb5)]===_0x23b2db(0x93)||_0x51aa6f[_0x23b2db(0xb5)]===_0x23b2db(0xb4))await handleSDKOutput(_0x335b8e,_0x51aa6f);else{console['log'](a35_0x24aaff['dim']('['+_0x391e01+']'));const _0x243aca=formatTree(_0x335b8e,{'showMetadata':!![],'getSegmentUrl':_0x54c1fa,'getJourneyUrl':_0x2e4546});console[_0x23b2db(0xbc)](_0x243aca);}return 0x0;}}
|
|
1
|
+
function a35_0x247e(_0x10dbb0,_0x1c23fa){_0x10dbb0=_0x10dbb0-0x140;const _0x14f403=a35_0x14f4();let _0x247e48=_0x14f403[_0x10dbb0];return _0x247e48;}const a35_0x195e18=a35_0x247e;(function(_0x37cc95,_0x205d4b){const _0x52737c=a35_0x247e,_0x11abfa=_0x37cc95();while(!![]){try{const _0x4f972a=parseInt(_0x52737c(0x176))/0x1*(parseInt(_0x52737c(0x172))/0x2)+parseInt(_0x52737c(0x187))/0x3*(parseInt(_0x52737c(0x140))/0x4)+parseInt(_0x52737c(0x18b))/0x5+-parseInt(_0x52737c(0x148))/0x6*(parseInt(_0x52737c(0x14d))/0x7)+parseInt(_0x52737c(0x185))/0x8*(-parseInt(_0x52737c(0x15a))/0x9)+-parseInt(_0x52737c(0x149))/0xa+parseInt(_0x52737c(0x155))/0xb*(parseInt(_0x52737c(0x154))/0xc);if(_0x4f972a===_0x205d4b)break;else _0x11abfa['push'](_0x11abfa['shift']());}catch(_0xfe07c0){_0x11abfa['push'](_0x11abfa['shift']());}}}(a35_0x14f4,0xa4d0d));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a35_0x14f4(){const _0x474253=['type','4356162yVmnBD','\x20journey','verbose','journey','description','Resolving\x20parent\x20segment\x20\x27','Folder/pattern\x20arg:\x20','name','journeyBundleName','message','site',',\x20and\x20','Listing\x20folders,\x20segments,\x20and\x20journeys...','folder','sort','Building\x20hierarchy\x20tree...','includes','parentId','cause','/j/da','Parent\x20ID:\x20','map','data','json','672782QpeflC','Error:\x20','format','folderId','1BPUukr','\x20segment','test','No\x20items\x20match\x20pattern:\x20','error','children','listUnified','recursive','listRecursive','jsonl','✔\x20Found\x20','listWithPattern','segment','journeys','/e/','16TjDehl','\x20\x20Cause:\x20','568299AHUbYQ','segments','folders','parentSegment','2899595OWnkwv','Folder\x20ID:\x20','4wEjgvF','\x20folder','Parent\x20segment\x20context:\x20','localeCompare','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','replace','\x27...','listUnifiedWithJourneys','91194JRKdBh','12998390QCkvRG','Resolving\x20path\x20\x27','filter','Set\x20a\x20parent\x20segment\x20context\x20first:','7YFSSwv','resolvePathToResource','dim','length','log','\x5c$&','(not\x20set)','144GFzOoV','1698048xUnxRF','List\x20folders\x20and\x20child\x20segments','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','/app/ps/'];a35_0x14f4=function(){return _0x474253;};return a35_0x14f4();}import a35_0x2063b5 from'chalk';export class SegmentsCommand extends BaseCommand{[a35_0x195e18(0x161)]='segments';[a35_0x195e18(0x15e)]=a35_0x195e18(0x156);async['execute'](_0x197310){const _0x505154=a35_0x195e18,{options:_0x211670,args:_0x33cbae}=_0x197310,_0x272872=_0x211670[_0x505154(0x17d)],_0x1c5646=_0x33cbae[0x0];try{const _0x38a5bc=_0x211670[_0x505154(0x18a)];_0x211670[_0x505154(0x15c)]&&(console[_0x505154(0x17a)]('Site:\x20'+_0x211670['site']),console[_0x505154(0x17a)](_0x505154(0x142)+(_0x38a5bc||_0x505154(0x153))),_0x1c5646&&console['error'](_0x505154(0x160)+_0x1c5646),_0x272872&&console[_0x505154(0x17a)]('Recursive\x20mode:\x20enabled'));if(!_0x38a5bc)return console[_0x505154(0x17a)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x505154(0x17a)](''),console[_0x505154(0x17a)](_0x505154(0x14c)),console[_0x505154(0x17a)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x505154(0x17a)](_0x505154(0x144)),console[_0x505154(0x17a)](''),console[_0x505154(0x17a)](_0x505154(0x157)),0x1;const _0x2f1bb1=_0x1c5646&&(_0x1c5646['includes']('*')||_0x1c5646[_0x505154(0x16a)]('?'));if(_0x2f1bb1)return await this[_0x505154(0x181)](_0x197310,_0x38a5bc,_0x1c5646);const _0x2f4ce4=_0x1c5646?_0x38a5bc+'/'+_0x1c5646:_0x38a5bc;return _0x272872?await this['listRecursive'](_0x197310,_0x2f4ce4):await this[_0x505154(0x17c)](_0x197310,_0x2f4ce4);}catch(_0x19f37d){if(_0x19f37d instanceof SDKError)return console[_0x505154(0x17a)](_0x505154(0x173)+_0x19f37d[_0x505154(0x163)]),_0x19f37d[_0x505154(0x16c)]&&console[_0x505154(0x17a)](_0x505154(0x186)+_0x19f37d[_0x505154(0x16c)]),0x1;throw _0x19f37d;}}async[a35_0x195e18(0x181)](_0x4f98d0,_0x8741b,_0x16b09f){const _0x42386b=a35_0x195e18,{options:_0x5ca80d,tdx:_0x7fc06d}=_0x4f98d0,_0x55bd7c=await withSpinner(_0x42386b(0x15f)+_0x8741b+_0x42386b(0x146),()=>_0x7fc06d[_0x42386b(0x182)][_0x42386b(0x14e)](_0x8741b),{'verbose':_0x5ca80d[_0x42386b(0x15c)]}),_0x2630a0=_0x55bd7c['data'],_0x126a9e=await withSpinner(_0x42386b(0x166),()=>_0x7fc06d[_0x42386b(0x182)]['listUnifiedWithJourneys'](_0x2630a0[_0x42386b(0x16b)],_0x2630a0['folderId']),{'verbose':_0x5ca80d[_0x42386b(0x15c)]}),{folders:_0x571033,segments:_0x122fbe,journeys:_0x422608}=_0x126a9e[_0x42386b(0x170)],_0x2e66e0=_0x16b09f[_0x42386b(0x145)](/[.+^${}()|[\]\\]/g,_0x42386b(0x152))[_0x42386b(0x145)](/\*/g,'.*')[_0x42386b(0x145)](/\?/g,'.'),_0x34024c=new RegExp('^'+_0x2e66e0+'$','i'),_0x3d2ed8=_0x571033[_0x42386b(0x14b)](_0x4aa31d=>_0x34024c[_0x42386b(0x178)](_0x4aa31d['name'])),_0x136fa5=_0x122fbe[_0x42386b(0x14b)](_0x2e5afc=>_0x34024c[_0x42386b(0x178)](_0x2e5afc[_0x42386b(0x161)])),_0x3fa3d8=_0x422608[_0x42386b(0x14b)](_0x2d14e5=>_0x34024c['test'](_0x2d14e5[_0x42386b(0x162)])),_0x5a3034=_0x3d2ed8[_0x42386b(0x150)]+_0x136fa5['length']+_0x3fa3d8[_0x42386b(0x150)];console[_0x42386b(0x17a)](_0x42386b(0x180)+_0x3d2ed8[_0x42386b(0x150)]+_0x42386b(0x141)+(_0x3d2ed8['length']!==0x1?'s':'')+',\x20'+_0x136fa5[_0x42386b(0x150)]+'\x20segment'+(_0x136fa5[_0x42386b(0x150)]!==0x1?'s':'')+_0x42386b(0x165)+_0x3fa3d8[_0x42386b(0x150)]+_0x42386b(0x15b)+(_0x3fa3d8[_0x42386b(0x150)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x16b09f+'\x27');const _0x53c724=_0x1efad1=>{const _0x17d753=_0x42386b;return getConsoleNextUrl(_0x5ca80d['site'],_0x17d753(0x158)+_0x2630a0[_0x17d753(0x16b)]+_0x17d753(0x184)+_0x1efad1);},_0x2d08fb=_0x5ca80d['format']===_0x42386b(0x171)||_0x5ca80d[_0x42386b(0x174)]===_0x42386b(0x17f);if(_0x2d08fb){const _0x4b4811=[..._0x3d2ed8['map'](_0x8675c0=>({..._0x8675c0,'type':_0x42386b(0x167)})),..._0x136fa5['map'](_0x375b01=>({..._0x375b01,'type':_0x42386b(0x182),'url':_0x53c724(_0x375b01['id'])})),..._0x3fa3d8[_0x42386b(0x16f)](_0x34e239=>({..._0x34e239,'name':_0x34e239['journeyBundleName'],'type':_0x42386b(0x15d)}))][_0x42386b(0x168)]((_0x57864f,_0x5b3d7f)=>_0x57864f['name'][_0x42386b(0x143)](_0x5b3d7f[_0x42386b(0x161)]));await handleSDKOutput(_0x4b4811,_0x5ca80d);}else{if(_0x5a3034===0x0)console[_0x42386b(0x151)](_0x42386b(0x179)+_0x16b09f);else{console[_0x42386b(0x151)](a35_0x2063b5[_0x42386b(0x14f)]('['+_0x8741b+']\x20matching\x20\x27'+_0x16b09f+'\x27'));const _0x126233=formatFlatList(_0x3d2ed8,_0x136fa5,{'showMetadata':!![],'getSegmentUrl':_0x53c724},_0x3fa3d8);console['log'](_0x126233);}}return 0x0;}async[a35_0x195e18(0x17c)](_0x4c2825,_0x2f9138){const _0x3785af=a35_0x195e18,{options:_0x122c51,tdx:_0x21d6e8}=_0x4c2825,_0x49eac9=await withSpinner(_0x3785af(0x14a)+_0x2f9138+'\x27...',()=>_0x21d6e8[_0x3785af(0x182)][_0x3785af(0x14e)](_0x2f9138),{'verbose':_0x122c51['verbose']}),_0xb8af50=_0x49eac9['data'];_0x122c51['verbose']&&(console['error']('Parent\x20ID:\x20'+_0xb8af50[_0x3785af(0x16b)]),_0xb8af50[_0x3785af(0x175)]&&console[_0x3785af(0x17a)](_0x3785af(0x18c)+_0xb8af50['folderId']));const _0x576b95=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x21d6e8[_0x3785af(0x182)][_0x3785af(0x147)](_0xb8af50['parentId'],_0xb8af50[_0x3785af(0x175)]),{'verbose':_0x122c51[_0x3785af(0x15c)]}),{folders:_0x590d27,segments:_0x3b7e06,journeys:_0x4ddd61}=_0x576b95[_0x3785af(0x170)],_0x26fbab=_0x590d27['length']+_0x3b7e06[_0x3785af(0x150)]+_0x4ddd61[_0x3785af(0x150)];console[_0x3785af(0x17a)](_0x3785af(0x180)+_0x590d27[_0x3785af(0x150)]+_0x3785af(0x141)+(_0x590d27['length']!==0x1?'s':'')+',\x20'+_0x3b7e06[_0x3785af(0x150)]+_0x3785af(0x177)+(_0x3b7e06[_0x3785af(0x150)]!==0x1?'s':'')+_0x3785af(0x165)+_0x4ddd61[_0x3785af(0x150)]+'\x20journey'+(_0x4ddd61[_0x3785af(0x150)]!==0x1?'s':''));const _0xbe0e7d=_0x20a1ef=>{const _0xe13376=_0x3785af;return getConsoleNextUrl(_0x122c51[_0xe13376(0x164)],_0xe13376(0x158)+_0xb8af50[_0xe13376(0x16b)]+_0xe13376(0x184)+_0x20a1ef);},_0x774188=_0x4633df=>{const _0x53f4fa=_0x3785af;return getConsoleNextUrl(_0x122c51['site'],_0x53f4fa(0x158)+_0xb8af50[_0x53f4fa(0x16b)]+_0x53f4fa(0x184)+_0x4633df+_0x53f4fa(0x16d));},_0x2db19=_0x122c51['format']==='json'||_0x122c51[_0x3785af(0x174)]===_0x3785af(0x17f);if(_0x2db19){const _0x2e18ed=[..._0x590d27[_0x3785af(0x16f)](_0x448af9=>({..._0x448af9,'type':_0x3785af(0x167)})),..._0x3b7e06[_0x3785af(0x16f)](_0x13f86d=>({..._0x13f86d,'type':'segment','url':_0xbe0e7d(_0x13f86d['id'])})),..._0x4ddd61[_0x3785af(0x16f)](_0x5edd00=>({..._0x5edd00,'name':_0x5edd00[_0x3785af(0x162)],'type':_0x3785af(0x15d),'url':_0x774188(_0x5edd00['id'])}))][_0x3785af(0x168)]((_0x4aee06,_0x2abee3)=>_0x4aee06[_0x3785af(0x161)][_0x3785af(0x143)](_0x2abee3[_0x3785af(0x161)]));await handleSDKOutput(_0x2e18ed,_0x122c51);}else{if(_0x26fbab===0x0)console['log'](a35_0x2063b5[_0x3785af(0x14f)]('['+_0x2f9138+']')),console['log']('(empty)');else{console['log'](a35_0x2063b5[_0x3785af(0x14f)]('['+_0x2f9138+']'));const _0x1f6981=formatFlatList(_0x590d27,_0x3b7e06,{'showMetadata':!![],'getSegmentUrl':_0xbe0e7d,'getJourneyUrl':_0x774188},_0x4ddd61);console[_0x3785af(0x151)](_0x1f6981);}}return 0x0;}async[a35_0x195e18(0x17e)](_0x2f6339,_0x38ba6c){const _0x1ca34e=a35_0x195e18,{options:_0x22eb83,tdx:_0x52a513}=_0x2f6339,_0xbe1abe=await withSpinner(_0x1ca34e(0x14a)+_0x38ba6c+_0x1ca34e(0x146),()=>_0x52a513[_0x1ca34e(0x182)][_0x1ca34e(0x14e)](_0x38ba6c),{'verbose':_0x22eb83[_0x1ca34e(0x15c)]}),_0x951b01=_0xbe1abe[_0x1ca34e(0x170)];_0x22eb83[_0x1ca34e(0x15c)]&&(console['error'](_0x1ca34e(0x16e)+_0x951b01[_0x1ca34e(0x16b)]),_0x951b01['folderId']&&console['error'](_0x1ca34e(0x18c)+_0x951b01[_0x1ca34e(0x175)]));const _0xbd8091=_0x22eb83['maxDepth']||0xa,_0x375c8e=await withSpinner(_0x1ca34e(0x169),()=>_0x52a513['segment'][_0x1ca34e(0x17e)](_0x951b01['parentId'],_0x951b01[_0x1ca34e(0x175)],0x0,_0xbd8091),{'verbose':_0x22eb83[_0x1ca34e(0x15c)]}),_0x3283a1=_0x375c8e[_0x1ca34e(0x170)],_0x202d9c=_0xbbb01f=>{const _0x2546f4=_0x1ca34e;let _0xb7aa32=0x0,_0x12ed23=0x0,_0xd92a1d=0x0;for(const _0x300473 of _0xbbb01f){if(_0x300473[_0x2546f4(0x159)]==='folder')_0xb7aa32++;else{if(_0x300473['type']===_0x2546f4(0x182))_0x12ed23++;else{if(_0x300473[_0x2546f4(0x159)]===_0x2546f4(0x15d))_0xd92a1d++;}}if(_0x300473[_0x2546f4(0x17b)]){const _0x27cd40=_0x202d9c(_0x300473[_0x2546f4(0x17b)]);_0xb7aa32+=_0x27cd40[_0x2546f4(0x189)],_0x12ed23+=_0x27cd40['segments'],_0xd92a1d+=_0x27cd40['journeys'];}}return{'folders':_0xb7aa32,'segments':_0x12ed23,'journeys':_0xd92a1d};},_0x3d042d=_0x202d9c(_0x3283a1);console[_0x1ca34e(0x17a)]('✔\x20Built\x20tree\x20with\x20'+_0x3d042d['folders']+_0x1ca34e(0x141)+(_0x3d042d['folders']!==0x1?'s':'')+',\x20'+_0x3d042d[_0x1ca34e(0x188)]+_0x1ca34e(0x177)+(_0x3d042d[_0x1ca34e(0x188)]!==0x1?'s':'')+_0x1ca34e(0x165)+_0x3d042d[_0x1ca34e(0x183)]+_0x1ca34e(0x15b)+(_0x3d042d['journeys']!==0x1?'s':''));const _0x5387ca=_0xcb510d=>{const _0x2f8cda=_0x1ca34e;return getConsoleNextUrl(_0x22eb83[_0x2f8cda(0x164)],'/app/ps/'+_0x951b01['parentId']+_0x2f8cda(0x184)+_0xcb510d);},_0x30930b=_0x198d5c=>{const _0x2b4d62=_0x1ca34e;return getConsoleNextUrl(_0x22eb83['site'],_0x2b4d62(0x158)+_0x951b01[_0x2b4d62(0x16b)]+_0x2b4d62(0x184)+_0x198d5c+_0x2b4d62(0x16d));};if(_0x22eb83[_0x1ca34e(0x174)]==='json'||_0x22eb83[_0x1ca34e(0x174)]===_0x1ca34e(0x17f))await handleSDKOutput(_0x3283a1,_0x22eb83);else{console[_0x1ca34e(0x151)](a35_0x2063b5['dim']('['+_0x38ba6c+']'));const _0x3be377=formatTree(_0x3283a1,{'showMetadata':!![],'getSegmentUrl':_0x5387ca,'getJourneyUrl':_0x30930b});console[_0x1ca34e(0x151)](_0x3be377);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a36_0x2ea2(){const _0x271c29=['22JoyWOh','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','error','1013924EkPcuG','validate','Limit:\x20','length','11064897jAlihd','site','description','Show\x20table\x20contents','5zifUYN','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','✔\x20Retrieved\x20','catalog','\x20from\x20','13906980CBqjcC','Error:\x20','...','Site:\x20','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','2318630oBQADb','Querying\x20','3757722xlRmOz','Usage:\x20tdx\x20show\x20<database.table>','database','message','execute','Catalog:\x20','showTable','query','cause','limit','\x20row','7ylavkW','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','verbose','3wvBrfQ','4035656PXbBbI','1297179UQBiWM'];a36_0x2ea2=function(){return _0x271c29;};return a36_0x2ea2();}function a36_0x174b(_0x34e36a,_0x1baf49){_0x34e36a=_0x34e36a-0x94;const _0x2ea217=a36_0x2ea2();let _0x174b50=_0x2ea217[_0x34e36a];return _0x174b50;}const a36_0x419669=a36_0x174b;(function(_0x4ff523,_0x4262c9){const _0xab51e9=a36_0x174b,_0x221838=_0x4ff523();while(!![]){try{const _0x40b77e=-parseInt(_0xab51e9(0xa1))/0x1+-parseInt(_0xab51e9(0xb7))/0x2+parseInt(_0xab51e9(0x9f))/0x3*(parseInt(_0xab51e9(0xa5))/0x4)+-parseInt(_0xab51e9(0xad))/0x5*(parseInt(_0xab51e9(0xb9))/0x6)+parseInt(_0xab51e9(0x9c))/0x7*(-parseInt(_0xab51e9(0xa0))/0x8)+parseInt(_0xab51e9(0xa9))/0x9+-parseInt(_0xab51e9(0xb2))/0xa*(-parseInt(_0xab51e9(0xa2))/0xb);if(_0x40b77e===_0x4262c9)break;else _0x221838['push'](_0x221838['shift']());}catch(_0x488386){_0x221838['push'](_0x221838['shift']());}}}(a36_0x2ea2,0xa54d0));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']='show';[a36_0x419669(0xab)]=a36_0x419669(0xac);async[a36_0x419669(0x95)](_0x43e12a){const _0x129094=a36_0x419669;return this[_0x129094(0x97)](_0x43e12a);}async[a36_0x419669(0x97)](_0x451779){const _0x587f62=a36_0x419669,{options:_0x1059db,args:_0xb98d14,tdx:_0x47d5a5}=_0x451779;let _0x228768;try{_0x228768=parseTableReference(_0xb98d14[0x0]);const _0x11b53f=_0x1059db['database'];!_0x228768[_0x587f62(0xbb)]&&_0x11b53f&&(_0x228768[_0x587f62(0xbb)]=_0x11b53f);const _0x1eb2ca=validateTableDescribeReference(_0x228768);if(_0x1eb2ca)return console[_0x587f62(0xa4)](_0x587f62(0xb3)+_0x1eb2ca),console['error'](_0x587f62(0xba)),console[_0x587f62(0xa4)](_0x587f62(0x9d)),console[_0x587f62(0xa4)](_0x587f62(0xa3)),0x1;}catch(_0x5687f6){return console[_0x587f62(0xa4)](_0x587f62(0xb3)+_0x5687f6[_0x587f62(0x94)]),console[_0x587f62(0xa4)](_0x587f62(0xba)),console['error'](_0x587f62(0x9d)),console['error'](_0x587f62(0xa3)),0x1;}const _0x157328=_0x228768[_0x587f62(0xb0)],_0x2bb008=_0x228768[_0x587f62(0xbb)],_0x565f7e=_0x228768['table'],_0x543333=resolveLimit(_0x1059db[_0x587f62(0x9a)],DEFAULT_DISPLAY_LIMIT);try{_0x1059db[_0x587f62(0x9e)]&&(console[_0x587f62(0xa4)](_0x587f62(0xb5)+_0x1059db[_0x587f62(0xaa)]),_0x157328&&console[_0x587f62(0xa4)](_0x587f62(0x96)+_0x157328),console[_0x587f62(0xa4)]('Database:\x20'+_0x2bb008),console[_0x587f62(0xa4)]('Table:\x20'+_0x565f7e),console['error'](_0x587f62(0xa7)+_0x543333));const _0x1084ae=_0x157328?_0x157328+'.'+_0x2bb008+'.'+_0x565f7e:_0x2bb008+'.'+_0x565f7e,_0x1a63ea=await withSpinner(_0x587f62(0xb8)+_0x1084ae+_0x587f62(0xb4),()=>_0x47d5a5[_0x587f62(0x98)][_0x587f62(0x97)](_0x2bb008,_0x565f7e,_0x543333,_0x157328),{'verbose':_0x1059db[_0x587f62(0x9e)]}),_0x416cce=_0x1a63ea['data'],_0x57e8bc=_0x416cce['data'];return _0x57e8bc['length']===0x0?console['error']('✔\x20Query\x20successful\x20-\x200\x20rows\x20returned'):console[_0x587f62(0xa4)](_0x587f62(0xaf)+_0x57e8bc[_0x587f62(0xa8)]+_0x587f62(0x9b)+(_0x57e8bc[_0x587f62(0xa8)]!==0x1?'s':'')+_0x587f62(0xb1)+_0x1084ae),await handleSDKOutput(_0x57e8bc,_0x1059db),0x0;}catch(_0x2ba72f){if(_0x2ba72f instanceof SDKError)return console[_0x587f62(0xa4)](_0x587f62(0xb3)+_0x2ba72f[_0x587f62(0x94)]),_0x2ba72f[_0x587f62(0x99)]&&console['error']('\x20\x20Cause:\x20'+_0x2ba72f[_0x587f62(0x99)]),0x1;throw _0x2ba72f;}}[a36_0x419669(0xa6)](_0x25c684){const _0x49df81=a36_0x419669;if(_0x25c684['args'][_0x49df81(0xa8)]===0x0)return _0x49df81(0xb6);if(_0x25c684['args'][_0x49df81(0xa8)]>0x1)return _0x49df81(0xae);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x47e070=a37_0x3a79;(function(_0x3a86d7,_0x48e438){const _0x1ae69f=a37_0x3a79,_0x53bb78=_0x3a86d7();while(!![]){try{const _0x96fd21=-parseInt(_0x1ae69f(0xb0))/0x1+parseInt(_0x1ae69f(0x94))/0x2*(parseInt(_0x1ae69f(0x92))/0x3)+parseInt(_0x1ae69f(0x98))/0x4+parseInt(_0x1ae69f(0x95))/0x5*(parseInt(_0x1ae69f(0xaa))/0x6)+parseInt(_0x1ae69f(0xab))/0x7*(-parseInt(_0x1ae69f(0xae))/0x8)+parseInt(_0x1ae69f(0xa3))/0x9+-parseInt(_0x1ae69f(0x90))/0xa;if(_0x96fd21===_0x48e438)break;else _0x53bb78['push'](_0x53bb78['shift']());}catch(_0x3439e3){_0x53bb78['push'](_0x53bb78['shift']());}}}(a37_0x1439,0x6d25e));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_0x34cb5d from'chalk';function a37_0x3a79(_0x2aaf6d,_0x4d09e0){_0x2aaf6d=_0x2aaf6d-0x8b;const _0x1439b5=a37_0x1439();let _0x3a793c=_0x1439b5[_0x2aaf6d];return _0x3a793c;}export class StatusCommand extends BaseCommand{['name']=a37_0x47e070(0xa4);[a37_0x47e070(0xa1)]=a37_0x47e070(0xad);async[a37_0x47e070(0xa6)](_0x219038){const _0x2aaa7f=a37_0x47e070,{options:_0x7b1fc0,tdx:_0x59a624}=_0x219038,_0x5692bb=_0x7b1fc0[_0x2aaa7f(0xb1)],_0x4eb359=_0x7b1fc0[_0x2aaa7f(0x9f)],_0x3b7c58=_0x4eb359?a37_0x34cb5d[_0x2aaa7f(0xa8)](_0x4eb359):a37_0x34cb5d['dim'](_0x2aaa7f(0x8b));console['log'](a37_0x34cb5d[_0x2aaa7f(0xa0)](_0x2aaa7f(0x8d))+_0x2aaa7f(0x9b)+_0x3b7c58+'\x20'+a37_0x34cb5d[_0x2aaa7f(0xa7)]('(')+'site:\x20'+a37_0x34cb5d[_0x2aaa7f(0xa8)](_0x5692bb)+a37_0x34cb5d[_0x2aaa7f(0xa7)](')'));const _0x202c1d=await resolveAPIKeyAsync(_0x5692bb,_0x4eb359);if(_0x202c1d){const {source:_0x5e21f3,isDeprecated:_0x43909b}=_0x202c1d,_0x133f7f=_0x2aaa7f(0x91)+a37_0x34cb5d[_0x2aaa7f(0xa8)](_0x5e21f3);console[_0x2aaa7f(0x96)](_0x43909b?a37_0x34cb5d[_0x2aaa7f(0xa5)](_0x133f7f):_0x133f7f);}else console[_0x2aaa7f(0x96)](a37_0x34cb5d[_0x2aaa7f(0xa5)](_0x2aaa7f(0x99)));let _0x399dac=![];try{const _0x56e7ae=await _0x59a624[_0x2aaa7f(0xa9)][_0x2aaa7f(0x9e)]();console[_0x2aaa7f(0x96)](a37_0x34cb5d['green'](_0x2aaa7f(0x8c))),console[_0x2aaa7f(0x96)](a37_0x34cb5d['bold'](_0x2aaa7f(0x8e))+'\x20'+a37_0x34cb5d[_0x2aaa7f(0xa8)](_0x56e7ae['email']));if(_0x56e7ae[_0x2aaa7f(0x8f)]||_0x56e7ae[_0x2aaa7f(0x93)]){const _0x4c3649=[_0x56e7ae[_0x2aaa7f(0x8f)],_0x56e7ae[_0x2aaa7f(0x93)]][_0x2aaa7f(0xa2)](Boolean)[_0x2aaa7f(0x9c)]('\x20');console[_0x2aaa7f(0x96)](a37_0x34cb5d[_0x2aaa7f(0xa0)](_0x2aaa7f(0x9d))+'\x20'+_0x4c3649);}_0x56e7ae['account_id']&&console['log'](a37_0x34cb5d[_0x2aaa7f(0xa0)](_0x2aaa7f(0x97))+'\x20'+a37_0x34cb5d[_0x2aaa7f(0xa5)](_0x56e7ae[_0x2aaa7f(0x9a)])),_0x399dac=!![];}catch(_0x1ffa31){_0x1ffa31 instanceof HTTPClientError&&_0x1ffa31[_0x2aaa7f(0xa4)]===0x191?printAuthError(_0x1ffa31,!![],_0x4eb359):console['error'](a37_0x34cb5d[_0x2aaa7f(0xac)](_0x2aaa7f(0xaf)+(_0x1ffa31 instanceof Error?_0x1ffa31['message']:String(_0x1ffa31))));}console[_0x2aaa7f(0x96)]();const _0x58e268=new GlobalContext(_0x7b1fc0);return _0x58e268['displayWithSources'](),_0x399dac?0x0:0x1;}}function a37_0x1439(){const _0x35b581=['tdx','User:','first_name','5760WwiPMG','Read\x20credential\x20from\x20','12924WWQefb','last_name','258yzvxrQ','6305wAWeWn','log','Account\x20ID:','928484vzjwZY','No\x20credential\x20found','account_id','\x20profile:\x20','join','Name:','getUserInfo','profile','bold','description','filter','7933644BgXzyI','status','yellow','execute','dim','cyan','jobs','354UTiswh','7SjazRc','red','Show\x20authentication\x20status\x20and\x20current\x20context','6245256UdFbyP','✗\x20Validation\x20failed:\x20','515465pCYUCg','site','N/A','✓\x20Authentication\x20successful\x0a'];a37_0x1439=function(){return _0x35b581;};return a37_0x1439();}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a38_0x580901=a38_0x1a89;function a38_0x1a89(_0x2b0783,_0x5aface){_0x2b0783=_0x2b0783-0xdb;const _0x5d3952=a38_0x5d39();let _0x1a899f=_0x5d3952[_0x2b0783];return _0x1a899f;}(function(_0x81663b,_0x3139d3){const _0x238077=a38_0x1a89,_0x1c1c8d=_0x81663b();while(!![]){try{const _0xcb20b2=-parseInt(_0x238077(0xf8))/0x1*(parseInt(_0x238077(0xec))/0x2)+parseInt(_0x238077(0x109))/0x3+-parseInt(_0x238077(0xf4))/0x4*(-parseInt(_0x238077(0xed))/0x5)+parseInt(_0x238077(0xef))/0x6*(-parseInt(_0x238077(0xe0))/0x7)+-parseInt(_0x238077(0xdb))/0x8*(parseInt(_0x238077(0x100))/0x9)+-parseInt(_0x238077(0xea))/0xa+-parseInt(_0x238077(0xe1))/0xb*(-parseInt(_0x238077(0x105))/0xc);if(_0xcb20b2===_0x3139d3)break;else _0x1c1c8d['push'](_0x1c1c8d['shift']());}catch(_0x20689d){_0x1c1c8d['push'](_0x1c1c8d['shift']());}}}(a38_0x5d39,0xe8ecf));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a38_0x5d39(){const _0x440b9e=['length','List\x20tables\x20in\x20a\x20database','24zdFliA','Database\x20\x27','\x27\x20is\x20ambiguous.','validate','1588170skclHv','80EzghWN','name','\x20\x20Use:\x20tdx\x20tables\x20\x22','Database:\x20','error','3787qkUnow','13402048KaZdKi','verbose','Listing\x20tables...','limit','Note:\x20\x27','\x20table','execute','✖\x20No\x20tables\x20found','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','14660850ENdNIP','description','2Aiikwt','15KVMxXk','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','8358YPaWZZ','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Error:\x20','data','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','2422332unKXoZ','query','message','Error:\x20Pattern\x20\x27','1112634PllYXO','table','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','Or\x20use\x20--in\x20flag:','Database:\x20all','Database\x20pattern:\x20','cause','database','446832kaMEAu','\x20\x20Cause:\x20','includes'];a38_0x5d39=function(){return _0x440b9e;};return a38_0x5d39();}import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a38_0x580901(0xdc)]='tables';[a38_0x580901(0xeb)]=a38_0x580901(0x104);async[a38_0x580901(0xe7)](_0x43f5c4){const _0x45e392=a38_0x580901,{options:_0x4f0a36,args:_0x12727e,tdx:_0x5082bc}=_0x43f5c4;let _0x3ffba6;if(_0x12727e[_0x45e392(0x103)]===0x0)_0x3ffba6={'database':undefined,'table':undefined,'original':''};else{if(_0x12727e[_0x45e392(0x103)]===0x1)try{_0x3ffba6=parseTableReference(_0x12727e[0x0]);if(_0x3ffba6[_0x45e392(0xf9)]&&!_0x3ffba6[_0x45e392(0xff)]&&!_0x3ffba6['table'][_0x45e392(0x102)]('*')&&!_0x3ffba6['table'][_0x45e392(0x102)]('?'))return console[_0x45e392(0xdf)](_0x45e392(0xf7)+_0x12727e[0x0]+_0x45e392(0x107)),console[_0x45e392(0xdf)](_0x45e392(0xfa)+_0x3ffba6[_0x45e392(0xf9)]+'\x27?'),console[_0x45e392(0xdf)](_0x45e392(0xdd)+_0x3ffba6[_0x45e392(0xf9)]+'.*\x22'),console['error'](_0x45e392(0xe9)+_0x3ffba6['table']),console[_0x45e392(0xdf)]('\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20'+_0x3ffba6[_0x45e392(0xf9)]),console['error'](''),console['error'](_0x45e392(0xe5)+_0x12727e[0x0]+_0x45e392(0xee)+_0x3ffba6[_0x45e392(0xf9)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x2c67d3){return console[_0x45e392(0xdf)](_0x45e392(0xf1)+_0x2c67d3['message']),0x1;}else return console[_0x45e392(0xdf)]('Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:'),console[_0x45e392(0xdf)](_0x45e392(0xf3)),console['error']('\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),console[_0x45e392(0xdf)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x45e392(0xdf)](_0x45e392(0xf0)),console[_0x45e392(0xdf)](_0x45e392(0xfb)),console[_0x45e392(0xdf)]('\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb'),0x1;}const _0x27edb2=_0x4f0a36['database'];!_0x3ffba6['database']&&_0x27edb2&&(_0x3ffba6[_0x45e392(0xff)]=_0x27edb2);try{const _0x48c8de=_0x5c4cc6=>_0x5c4cc6&&(_0x5c4cc6[_0x45e392(0x102)]('*')||_0x5c4cc6['includes']('?')),_0x2f7829=_0x48c8de(_0x3ffba6[_0x45e392(0xff)]);_0x4f0a36[_0x45e392(0xe2)]&&(console[_0x45e392(0xdf)]('Site:\x20'+_0x4f0a36['site']),_0x3ffba6[_0x45e392(0xff)]?_0x2f7829?console[_0x45e392(0xdf)](_0x45e392(0xfd)+_0x3ffba6[_0x45e392(0xff)]):console[_0x45e392(0xdf)](_0x45e392(0xde)+_0x3ffba6['database']):console[_0x45e392(0xdf)](_0x45e392(0xfc)),_0x3ffba6['table']&&console[_0x45e392(0xdf)]('Table\x20pattern:\x20'+_0x3ffba6['table']));const _0x1a07e9=_0x3ffba6[_0x45e392(0xff)]&&!_0x2f7829?_0x3ffba6[_0x45e392(0xff)]:undefined,_0x5ef5f1=_0x2f7829?_0x3ffba6[_0x45e392(0xff)]:undefined,_0x5ee18f=_0x3ffba6[_0x45e392(0xf9)],_0x55c777=resolveLimit(_0x4f0a36[_0x45e392(0xe4)],DEFAULT_LISTING_LIMIT),_0x27ff75=await withSpinner(_0x45e392(0xe3),()=>_0x5082bc[_0x45e392(0xf5)]['listTables'](_0x1a07e9,_0x5ee18f,_0x5ef5f1,_0x55c777),{'verbose':_0x4f0a36[_0x45e392(0xe2)]}),_0x6d7da0=_0x27ff75[_0x45e392(0xf2)];if(_0x6d7da0[_0x45e392(0x103)]===0x0&&_0x3ffba6[_0x45e392(0xff)]&&!_0x2f7829)return console[_0x45e392(0xdf)](_0x45e392(0xe8)),console[_0x45e392(0xdf)](_0x45e392(0x106)+_0x3ffba6[_0x45e392(0xff)]+'\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables'),0x1;return console['error']('✔\x20Found\x20'+_0x6d7da0[_0x45e392(0x103)]+_0x45e392(0xe6)+(_0x6d7da0[_0x45e392(0x103)]!==0x1?'s':'')),await handleSDKOutput(_0x6d7da0,{..._0x4f0a36,'limit':_0x55c777}),0x0;}catch(_0x181bed){if(_0x181bed instanceof SDKError)return console[_0x45e392(0xdf)]('Error:\x20'+_0x181bed[_0x45e392(0xf6)]),_0x181bed[_0x45e392(0xfe)]&&console[_0x45e392(0xdf)](_0x45e392(0x101)+_0x181bed['cause']),0x1;throw _0x181bed;}}[a38_0x580901(0x108)](_0x8f51a5){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a39_0x452f(_0x2e06ea,_0x3829bc){_0x2e06ea=_0x2e06ea-0xeb;const _0x490435=a39_0x4904();let _0x452f25=_0x490435[_0x2e06ea];return _0x452f25;}const a39_0x295442=a39_0x452f;(function(_0x59fe90,_0x39173c){const _0x28a5c3=a39_0x452f,_0x160696=_0x59fe90();while(!![]){try{const _0x7ad355=parseInt(_0x28a5c3(0x104))/0x1*(parseInt(_0x28a5c3(0xfb))/0x2)+parseInt(_0x28a5c3(0xfa))/0x3+-parseInt(_0x28a5c3(0x105))/0x4+-parseInt(_0x28a5c3(0xfd))/0x5+parseInt(_0x28a5c3(0xee))/0x6*(parseInt(_0x28a5c3(0x108))/0x7)+-parseInt(_0x28a5c3(0xf1))/0x8+parseInt(_0x28a5c3(0x110))/0x9;if(_0x7ad355===_0x39173c)break;else _0x160696['push'](_0x160696['shift']());}catch(_0x4107fc){_0x160696['push'](_0x160696['shift']());}}}(a39_0x4904,0xc3d61));import{BaseCommand}from'./command.js';import{getCurrentSessionPID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';import a39_0x94e11e from'chalk';function a39_0x4904(){const _0x4dc5a6=['database','parent_segment','1004505eylpDM','896194usdSOE','Usage:\x20tdx\x20unset\x20<resource>\x0a','5190095tIKvWF','engage_workspace','toString','unset','length','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','default','2THYFFK','2315012MetVUE','site','green','427sZWrRZ','Session\x20','execute','.\x20Must\x20be\x20one\x20of:\x20','(session:\x20','llm_agent','includes','session','9288990fMJiSe','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','Clear\x20session-level\x20or\x20default\x20context\x20values','profile','validate','Default\x20profile\x20','tdx.json','log','19974jJqaLp','dim','name','378328XzRiOs','join','cleared','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','llm_project','\x0aUpdated:\x20'];a39_0x4904=function(){return _0x4dc5a6;};return a39_0x4904();}import*as a39_0x1e6d4c from'node:path';export class UnsetCommand extends BaseCommand{[a39_0x295442(0xf0)]=a39_0x295442(0x100);['description']=a39_0x295442(0x112);[a39_0x295442(0x114)](_0x1d3115){const _0x5a3dfb=a39_0x295442,{args:_0xb8d650,options:_0x645357}=_0x1d3115,_0x493900=_0x645357[_0x5a3dfb(0x103)];if(_0xb8d650[_0x5a3dfb(0x101)]===0x0)return _0x5a3dfb(0xfc)+_0x5a3dfb(0xf5)+_0x5a3dfb(0x111)+_0x5a3dfb(0x102);const _0x4870f4=_0xb8d650[0x0],_0xd9d308=['site',_0x5a3dfb(0xf8),_0x5a3dfb(0xf9),_0x5a3dfb(0xf6),'agent',_0x5a3dfb(0x113),_0x5a3dfb(0xfe)];if(!_0xd9d308[_0x5a3dfb(0x10e)](_0x4870f4))return'Invalid\x20resource:\x20'+_0x4870f4+_0x5a3dfb(0x10b)+_0xd9d308[_0x5a3dfb(0xf2)](',\x20');if(_0x493900&&_0x4870f4!==_0x5a3dfb(0x106)&&_0x4870f4!=='profile')return _0x5a3dfb(0xf4);return undefined;}async[a39_0x295442(0x10a)](_0x2a36ab){const _0x39795f=a39_0x295442,{args:_0x104d34,options:_0x4ae6e9}=_0x2a36ab,_0xe54a49=_0x4ae6e9[_0x39795f(0x103)];cleanExpiredSessions();try{const _0x3acaa4=_0x104d34[0x0],_0x333fe9=a39_0x1e6d4c['join'](getConfigDir(),_0x39795f(0xec));if(_0xe54a49){if(_0x3acaa4===_0x39795f(0x106))return clearDefaultSiteFromUserConfig(),console[_0x39795f(0xed)]('Default\x20site\x20'+a39_0x94e11e[_0x39795f(0x107)]('cleared')),console[_0x39795f(0xed)](a39_0x94e11e[_0x39795f(0xef)](_0x39795f(0xf7)+_0x333fe9)),0x0;if(_0x3acaa4===_0x39795f(0x113))return clearActiveProfileFromUserConfig(),console[_0x39795f(0xed)](_0x39795f(0xeb)+a39_0x94e11e[_0x39795f(0x107)]('cleared')),console[_0x39795f(0xed)](a39_0x94e11e['dim']('\x0aUpdated:\x20'+_0x333fe9)),0x0;}const _0x384386=_0x4ae6e9[_0x39795f(0x10f)]||getCurrentSessionPID()[_0x39795f(0xff)](),_0x5aea0c={'site':_0x39795f(0x106),'database':_0x39795f(0xf8),'parent_segment':_0x39795f(0xf9),'llm_project':_0x39795f(0xf6),'agent':_0x39795f(0x10d),'profile':_0x39795f(0x113),'engage_workspace':_0x39795f(0xfe)},_0x21ca41=_0x5aea0c[_0x3acaa4];return _0x21ca41&&(clearSessionContextField(_0x21ca41,_0x4ae6e9[_0x39795f(0x10f)]),console[_0x39795f(0xed)](_0x39795f(0x109)+_0x3acaa4+'\x20'+a39_0x94e11e['green'](_0x39795f(0xf3))+'\x20'+a39_0x94e11e[_0x39795f(0xef)](_0x39795f(0x10c)+_0x384386+')'))),0x0;}catch(_0x5cf2c1){return _0x5cf2c1 instanceof Error&&console['error']('Error:\x20'+_0x5cf2c1['message']),0x1;}}}
|