@treasuredata/tdx 0.29.0 → 0.29.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.d.ts +8 -0
- package/dist/commands/segment-command.d.ts.map +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-command.js.map +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.d.ts +2 -2
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.d.ts +15 -0
- package/dist/sdk/client/cdp-api-client.d.ts.map +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/cdp-api-client.js.map +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.d.ts +5 -5
- 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/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.d.ts +1 -2
- package/dist/sdk/engage/types/campaign-schema.d.ts.map +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.d.ts +2 -2
- 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-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.d.ts +13 -6
- package/dist/sdk/segment/journey-validator.d.ts.map +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-validator.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.d.ts +2 -0
- package/dist/sdk/segment/segment-path-parser.d.ts.map +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js.map +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.d.ts.map +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/segment-validator.js.map +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.d.ts +184 -0
- package/dist/sdk/segment/types/activation-schema.d.ts.map +1 -0
- package/dist/sdk/segment/types/activation-schema.js +1 -0
- package/dist/sdk/segment/types/activation-schema.js.map +1 -0
- package/dist/sdk/segment/types/journey-def.d.ts +5 -0
- package/dist/sdk/segment/types/journey-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-def.js.map +1 -1
- package/dist/sdk/segment/types/journey-schema.d.ts +419 -0
- package/dist/sdk/segment/types/journey-schema.d.ts.map +1 -0
- package/dist/sdk/segment/types/journey-schema.js +1 -0
- package/dist/sdk/segment/types/journey-schema.js.map +1 -0
- package/dist/sdk/segment/types/segment-def.d.ts +4 -87
- package/dist/sdk/segment/types/segment-def.d.ts.map +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-def.js.map +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/validate-files.js.map +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts +14 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.d.ts +20 -1
- package/dist/sdk/segment.d.ts.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/segment.js.map +1 -1
- package/dist/sdk/types/cdp.d.ts +3 -3
- package/dist/sdk/types/cdp.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +3 -3
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.d.ts +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const a35_0x1bd200=a35_0x33a4;(function(_0x53aafc,_0x32a3c4){const _0x4a7c44=a35_0x33a4,_0x2d87e3=_0x53aafc();while(!![]){try{const _0x345166=-parseInt(_0x4a7c44(0x7d))/0x1+-parseInt(_0x4a7c44(0x10d))/0x2*(parseInt(_0x4a7c44(0x105))/0x3)+parseInt(_0x4a7c44(0xdf))/0x4+parseInt(_0x4a7c44(0x88))/0x5*(parseInt(_0x4a7c44(0xd9))/0x6)+parseInt(_0x4a7c44(0x8b))/0x7*(parseInt(_0x4a7c44(0x8d))/0x8)+-parseInt(_0x4a7c44(0xd6))/0x9*(parseInt(_0x4a7c44(0x83))/0xa)+parseInt(_0x4a7c44(0x7a))/0xb;if(_0x345166===_0x32a3c4)break;else _0x2d87e3['push'](_0x2d87e3['shift']());}catch(_0x2cb30f){_0x2d87e3['push'](_0x2d87e3['shift']());}}}(a35_0x3f62,0x49ce4));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a35_0x3f62(){const _0x52c481=['blue','length','segment\x20or\x20journey','errorCode','isScoped','paused','\x20folders\x20to\x20create','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x27...','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','New\x20segment:','journeyBundleName','\x20\x20\x20\x20','/sb/da/esr','existingSegment','journeysOnly','updated','journeyBundleId','existingJourney','push','Changes\x20to\x20journey:','data','activations','targetDir','relationships','connection','green','(Journey\x20will\x20be\x20deleted)','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','listFolders','Aborted.','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','listActivations','createdAt','map','📁\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Parent\x20segment:\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','Delete\x20journey:','parentSegment','red','listSegments','add','/e/','type','file','buildUserMaps','\x20YAML\x20files\x20found','created','\x0a✔\x20Push\x20complete','cyan','journeys','state','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x20changed','results','helpText','Folders\x20to\x20create:','Site:\x20','folderId','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','\x20new','folderPath','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','user','setPhase','repeat','dryRun','resolveParentId','1571328cnOcAD','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)','\x20\x20🗺️\x20\x20Journeys:','767172IcXoEZ','Fetching\x20existing\x20activations...','diff','\x20activations]','then','journeyId','1179636BwxClg','Push\x20','\x0aError:','\x20deleted','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\x20to\x20create','\x20to\x20delete','changed','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','audienceId','nameToType','Delete\x20segment:','New\x20journey:','scopedFolderPath','toUpdate','join','Changes\x20to:','\x20to\x20update','Error\x20parsing\x20YAML:\x20','No\x20','\x20\x20Source:\x20','Fetching\x20connections\x20for\x20name\x20resolution...','createdSegmentIds','Error:\x20Directory\x20not\x20found:\x20','segments','folders','new','\x0aPush\x20summary\x20for\x20\x27','get','\x20created','toString','segmentFolderId','getJourney','yellow','verbose','cwd','/app/ps/','toCreate','3153KBtrUc','message','segment','\x20changes?','isNew','error','\x20updated','yamlConfig','606UQgxOy','parentFolder','journey','idToName','3923007kIqCyM','no_parent','filter','142549DCEnpO','Error:\x20','attributes','\x20\x20Segments:\x20','endsWith','description','10URJVAH','nameToId','versionNumber','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','listJourneysWithDetailsFromParentSegment','5mWBwJO','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','site','1109458OzKpfP','name','8upAKcy','dim','toDelete'];a35_0x3f62=function(){return _0x52c481;};return a35_0x3f62();}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a35_0x54008c from'chalk';import{existsSync}from'fs';function a35_0x33a4(_0x4f7a90,_0x275fe8){_0x4f7a90=_0x4f7a90-0x79;const _0x3f6250=a35_0x3f62();let _0x33a483=_0x3f6250[_0x4f7a90];return _0x33a483;}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{[a35_0x1bd200(0x8c)]='segment:push';[a35_0x1bd200(0x82)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async['execute'](_0x227b55){const _0x287653=a35_0x1bd200,{options:_0x16836c,args:_0x3fdb9d,tdx:_0x1121ce}=_0x227b55,_0x1fb91e=_0x16836c,_0x2337fc=await resolveTarget({'arg':_0x3fdb9d[0x0],'contextParent':_0x16836c[_0x287653(0xb8)],'cwd':process[_0x287653(0x102)]()});if(!isSuccessfulResolution(_0x2337fc))return _0x2337fc[_0x287653(0x93)]===_0x287653(0x7b)?(console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0x100)]('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x287653(0x10a)](_0x287653(0xd7)),console[_0x287653(0x10a)](_0x287653(0xb6)),console['error'](_0x287653(0xe7))):(console['error'](a35_0x54008c[_0x287653(0xb9)](_0x287653(0x7e)+_0x2337fc[_0x287653(0x106)]+'\x0a')),_0x2337fc[_0x287653(0xc9)]&&console[_0x287653(0x10a)](a35_0x54008c['cyan'](_0x2337fc['helpText']))),0x1;if(_0x2337fc[_0x287653(0xbd)]==='parent_name')return console[_0x287653(0x10a)](a35_0x54008c['red']('Error:\x20Directory\x20not\x20found:\x20'+_0x2337fc[_0x287653(0xa7)]+'\x0a')),console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0xc3)](_0x287653(0xb4))),0x1;const _0x4b869f=_0x2337fc['parentName'],_0x4ebcef=_0x2337fc[_0x287653(0xa7)],_0x5cf42b=_0x2337fc[_0x287653(0xbd)]===_0x287653(0xbe)?_0x2337fc['filePath']:undefined,_0xc565e=getScopedDetails(_0x2337fc),_0x1b32ce=_0xc565e?.[_0x287653(0x94)]??![],_0x5a8ee0=_0xc565e?.[_0x287653(0xec)]??'';if(!existsSync(_0x4ebcef))return console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0xb9)](_0x287653(0xf6)+_0x4ebcef+'\x0a')),console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0xc3)](_0x287653(0xb4))),0x1;_0x1fb91e[_0x287653(0x101)]&&(console[_0x287653(0x10a)](_0x287653(0xcb)+_0x1fb91e[_0x287653(0x8a)]),console[_0x287653(0x10a)](_0x287653(0xb5)+_0x4b869f),console['error']('Source\x20directory:\x20'+_0x4ebcef),_0x1b32ce&&console[_0x287653(0x10a)]('Scoped\x20to\x20folder:\x20'+_0x5a8ee0));const _0x1fc396=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x4b869f+_0x287653(0x98),()=>_0x1121ce['segment'][_0x287653(0xd5)](_0x4b869f),{'verbose':_0x1fb91e[_0x287653(0x101)]}),_0x229721=_0x1fc396[_0x287653(0xa5)],{parentSegmentResult:_0x4a3bd8,segmentsResult:_0x3f3d1b,foldersResult:_0x2f0dc7,journeysWithDetailsResult:_0x21b546,userMaps:_0x52cfdb}=await withSpinner('Fetching\x20existing\x20data...',async()=>{const _0x438325=_0x287653,[_0x29ea5a,_0x27f927,_0x4952dd,_0x3d47c5,_0x58c3a8]=await Promise['all']([_0x1121ce['segment']['getParent'](_0x229721),_0x1121ce['segment'][_0x438325(0xba)](_0x229721),_0x1121ce[_0x438325(0x107)][_0x438325(0xad)](_0x229721),_0x1121ce[_0x438325(0x10f)][_0x438325(0x87)](_0x229721,{'includeAllVersions':!![]}),_0x1121ce[_0x438325(0xd1)][_0x438325(0xbf)]()]);return{'parentSegmentResult':_0x29ea5a,'segmentsResult':_0x27f927,'foldersResult':_0x4952dd,'journeysWithDetailsResult':_0x3d47c5,'userMaps':_0x58c3a8};},{'verbose':_0x1fb91e[_0x287653(0x101)]})['then'](_0x54e99b=>_0x54e99b[_0x287653(0xa5)]),_0x55fc3e=_0x4a3bd8,_0x50c4a3=extractRootFolderId(_0x55fc3e),_0x3b45c0=_0x3f3d1b,_0x9f9291=_0x2f0dc7,{journeys:_0x4a09f2,activationStepsById:_0x2779d2}=_0x21b546,_0x287b70=new Map(_0x4a09f2[_0x287653(0xb2)](_0x2f69c2=>[_0x2f69c2['id'],_0x2f69c2])),_0x522b61=_0x4a09f2[_0x287653(0xb2)](_0xd70214=>({'id':_0xd70214['id'],'name':_0xd70214['attributes'][_0x287653(0x8c)],'journeyBundleName':_0xd70214[_0x287653(0x7f)][_0x287653(0x9b)]||'','journeyBundleId':_0xd70214['attributes'][_0x287653(0xa1)]||'','versionNumber':_0xd70214[_0x287653(0x7f)][_0x287653(0x85)],'description':_0xd70214[_0x287653(0x7f)][_0x287653(0x82)],'state':_0xd70214[_0x287653(0x7f)][_0x287653(0xc5)],'paused':_0xd70214[_0x287653(0x7f)][_0x287653(0x95)],'audienceId':_0xd70214[_0x287653(0x7f)][_0x287653(0xe8)],'folderId':_0xd70214[_0x287653(0xa8)]?.[_0x287653(0x10e)]?.[_0x287653(0xa5)]?.['id'],'createdAt':_0xd70214['attributes'][_0x287653(0xb1)],'updatedAt':_0xd70214[_0x287653(0x7f)]['updatedAt']})),{emailToId:_0x5abc94,idToEmail:_0x3db390}=_0x52cfdb,_0x1bb449=await withSpinner(_0x287653(0xf4),async()=>{const _0x3b853d=_0x287653,_0x474df3=await _0x1121ce[_0x3b853d(0xa9)]['list']();return buildConnectionMaps(_0x474df3);},{'verbose':_0x1fb91e[_0x287653(0x101)]})[_0x287653(0xdd)](_0x34bdfb=>_0x34bdfb['data']),_0x560749=_0x1bb449[_0x287653(0x84)],_0x1e5227=_0x1bb449[_0x287653(0x79)],_0x3e39f7=_0x1bb449[_0x287653(0xe9)],_0x529b45={'emailToIdMap':_0x5abc94,'connectionNameToIdMap':_0x560749,'connectionNameToTypeMap':_0x3e39f7,'getSchema':_0x34e722=>_0x1121ce[_0x287653(0xa9)]['getOutputSchemaWithCache'](_0x34e722)};let {pathToId:_0x2f886b,idToPath:_0x4f71cd}=buildFolderMaps(_0x9f9291);const _0x3d0140=buildSegmentLookupMap(_0x3b45c0,_0x4f71cd),_0x35302a=buildSegmentNameToIdMap(_0x3b45c0),_0x2fcc1a=buildJourneyBundleLookupMap(_0x522b61,_0x4f71cd);let _0x165a85;if(_0x5cf42b){if(!_0x5cf42b[_0x287653(0x81)]('.yml')&&!_0x5cf42b[_0x287653(0x81)]('.yaml'))return console['error'](a35_0x54008c[_0x287653(0xb9)](_0x287653(0xe3)+_0x5cf42b+'\x0a')),0x1;_0x165a85=[_0x5cf42b];}else _0x165a85=findYamlFiles(_0x4ebcef);if(_0x165a85[_0x287653(0x91)]===0x0)return console['error'](a35_0x54008c[_0x287653(0xb9)](_0x287653(0xac)+_0x4ebcef+'\x0a')),console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0xc3)](_0x287653(0xd0))),0x1;let _0x355292,_0x5dece2;try{const _0x5ef7e2=parseAndClassifyYamlFiles(_0x165a85,_0x4ebcef,{'skipSegments':_0x1fb91e[_0x287653(0x9f)]});_0x355292=_0x5ef7e2[_0x287653(0xf7)],_0x5dece2=_0x5ef7e2[_0x287653(0xc4)];const _0x24c442=validateParsedFiles(_0x5ef7e2,_0x4ebcef);if(_0x24c442[_0x287653(0x91)]>0x0)return console[_0x287653(0x10a)](a35_0x54008c['red']('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x24c442)),console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0x100)](_0x287653(0x97))),0x1;}catch(_0x4ccae0){return console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0xb9)](_0x287653(0xf1)+(_0x4ccae0 instanceof Error?_0x4ccae0[_0x287653(0x106)]:_0x4ccae0))),0x1;}if(_0x355292[_0x287653(0x91)]===0x0&&_0x5dece2[_0x287653(0x91)]===0x0){const _0xddd5a9=_0x1fb91e['journeysOnly']?_0x287653(0x10f):_0x287653(0x92);return console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0x100)](_0x287653(0xf2)+_0xddd5a9+_0x287653(0xc0))),0x0;}const _0x373952=new Map();_0x3b45c0[_0x287653(0x91)]>0x0&&!_0x1fb91e['journeysOnly']&&await withSpinner(_0x287653(0xda),async()=>{await batchAsync(_0x3b45c0,async _0x130fc3=>{const _0x4e1ab1=a35_0x33a4,_0x74372b=await _0x1121ce[_0x4e1ab1(0x107)][_0x4e1ab1(0xb0)](_0x229721,_0x130fc3['id']);_0x373952['set'](_0x130fc3['id'],_0x74372b);});},{'verbose':_0x1fb91e['verbose']});const {segmentFiles:_0x15c8da,foldersToCreate:_0x3e6bc1}=await prepareSegmentFiles(_0x355292,{'segmentByFolderAndName':_0x3d0140,'activationsBySegmentId':_0x373952,'folderPathToId':_0x2f886b,'idToEmailMap':_0x3db390,'connectionIdToNameMap':_0x1e5227},_0x529b45,_0x1b32ce,_0x5a8ee0),_0x4f3799=_0x5cf42b?[]:findSegmentsToDelete(_0x3b45c0,_0x355292['map'](({yamlConfig:_0x4df9c5,folderPath:_0x4a9b78})=>({'yamlConfig':_0x4df9c5,'folderPath':resolveTDFolderPath(_0x4a9b78,_0x1b32ce,_0x5a8ee0)})),_0x4f71cd,_0x5a8ee0,_0x1b32ce),{journeyFiles:_0x2d9a0d,foldersToCreate:_0xa05564}=await withProgressSpinner('Preparing\x20journeys...',async _0x4870f2=>prepareJourneyFiles(_0x5dece2,{'fetchJourney':async _0x26d347=>_0x1121ce[_0x287653(0x10f)][_0x287653(0xff)](_0x26d347[_0x287653(0xde)]),'journeyBundlesByFolderAndName':_0x2fcc1a,'folderPathToId':_0x2f886b,'idToEmailMap':_0x3db390,'connectionIdToNameMap':_0x1e5227,'existingSegments':_0x3b45c0,'parentId':_0x229721,'deps':_0x1121ce,'progress':{'update':_0x57639b=>{const _0x21b6dd=_0x287653;_0x4870f2[_0x21b6dd(0xd2)](_0x57639b),_0x1fb91e['verbose']&&console[_0x21b6dd(0x10a)]('\x20\x20'+_0x57639b);}},'journeyById':_0x287b70,'activationStepsById':_0x2779d2},_0x1b32ce,_0x5a8ee0),{'verbose':_0x1fb91e[_0x287653(0x101)]})[_0x287653(0xdd)](_0x57a4fd=>_0x57a4fd[_0x287653(0xa5)]);for(const _0x384692 of _0xa05564){_0x3e6bc1[_0x287653(0xbb)](_0x384692);}const _0x52b0d8=_0x5cf42b?[]:findJourneysToDelete(_0x522b61,_0x5dece2[_0x287653(0xb2)](({yamlConfig:_0x58d647,folderPath:_0x2e5135})=>({'yamlConfig':_0x58d647,'folderPath':resolveTDFolderPath(_0x2e5135,_0x1b32ce,_0x5a8ee0)})),_0x4f71cd,_0x5a8ee0,_0x1b32ce),_0x15a40f=calculatePushStats(_0x15c8da,_0x2d9a0d,_0x3e6bc1,_0x4f3799,_0x52b0d8,!!_0x1fb91e['delete'],!!_0x1fb91e[_0x287653(0x9f)]),_0x1ea81e=_0x15a40f['segments'][_0x287653(0xf9)],_0x4e5b42=_0x15a40f[_0x287653(0xf7)][_0x287653(0xe6)],_0x346ba3=_0x15a40f['segments']['unchanged'],_0x4a6fd8=_0x15a40f[_0x287653(0xf7)]['toDelete'],_0xb0e9fb=_0x15a40f[_0x287653(0xf8)][_0x287653(0x104)],_0x41bb92=_0x15a40f[_0x287653(0xc4)][_0x287653(0xf9)],_0x327209=_0x15a40f[_0x287653(0xc4)]['changed'],_0xb319ea=_0x15a40f[_0x287653(0xc4)]['unchanged'],_0x328202=_0x15a40f[_0x287653(0xc4)][_0x287653(0x8f)],_0x2f64ff=_0x15a40f[_0x287653(0xa6)]['all'],_0x4e4876=_0x15a40f['activations']['toCreate'],_0x26ab64=_0x15a40f['activations'][_0x287653(0xed)],_0x4ab974=_0x15a40f['activations']['toDelete'];console['error'](_0x287653(0xfa)+_0x4b869f+'\x27:');_0xb0e9fb['length']>0x0&&console[_0x287653(0x10a)]('\x20\x20'+a35_0x54008c[_0x287653(0x90)](_0x287653(0xb3)+_0xb0e9fb[_0x287653(0x91)]+_0x287653(0x96)));if(!_0x1fb91e[_0x287653(0x9f)]){console[_0x287653(0x10a)]('\x20\x20📊\x20Segments:'),console[_0x287653(0x10a)]('\x20\x20\x20\x20'+a35_0x54008c['green']('+\x20'+_0x1ea81e[_0x287653(0x91)]+_0x287653(0xce))),console[_0x287653(0x10a)](_0x287653(0x9c)+a35_0x54008c[_0x287653(0x100)]('~\x20'+_0x4e5b42[_0x287653(0x91)]+_0x287653(0xc7)));if(_0x4a6fd8[_0x287653(0x91)]>0x0)console[_0x287653(0x10a)](_0x287653(0x9c)+a35_0x54008c[_0x287653(0xb9)]('-\x20'+_0x4a6fd8[_0x287653(0x91)]+_0x287653(0xe5)));else _0x4f3799[_0x287653(0x91)]>0x0&&!_0x1fb91e['delete']&&console['error'](_0x287653(0x9c)+a35_0x54008c[_0x287653(0x8e)](_0x4f3799[_0x287653(0x91)]+_0x287653(0x89)));console[_0x287653(0x10a)](_0x287653(0x9c)+a35_0x54008c[_0x287653(0x8e)]('=\x20'+_0x346ba3[_0x287653(0x91)]+'\x20unchanged'));}if(_0x2d9a0d[_0x287653(0x91)]>0x0||_0x52b0d8['length']>0x0){console[_0x287653(0x10a)](_0x287653(0xd8)),console['error'](_0x287653(0x9c)+a35_0x54008c[_0x287653(0xaa)]('+\x20'+_0x41bb92[_0x287653(0x91)]+'\x20new')),console['error']('\x20\x20\x20\x20'+a35_0x54008c[_0x287653(0x100)]('~\x20'+_0x327209[_0x287653(0x91)]+_0x287653(0xc7)));if(_0x328202[_0x287653(0x91)]>0x0)console[_0x287653(0x10a)](_0x287653(0x9c)+a35_0x54008c[_0x287653(0xb9)]('-\x20'+_0x328202[_0x287653(0x91)]+_0x287653(0xe5)));else _0x52b0d8['length']>0x0&&!_0x1fb91e['delete']&&console[_0x287653(0x10a)]('\x20\x20\x20\x20'+a35_0x54008c[_0x287653(0x8e)](_0x52b0d8[_0x287653(0x91)]+_0x287653(0x89)));console[_0x287653(0x10a)]('\x20\x20\x20\x20'+a35_0x54008c[_0x287653(0x8e)]('=\x20'+_0xb319ea[_0x287653(0x91)]+'\x20unchanged'));}_0x2f64ff[_0x287653(0x91)]>0x0&&!_0x1fb91e[_0x287653(0x9f)]&&(console[_0x287653(0x10a)](''),console[_0x287653(0x10a)]('\x20\x20Activations:'),_0x4e4876['length']>0x0&&console[_0x287653(0x10a)]('\x20\x20\x20\x20'+a35_0x54008c[_0x287653(0xaa)]('+\x20'+_0x4e4876['length']+_0x287653(0xe4))),_0x26ab64[_0x287653(0x91)]>0x0&&console[_0x287653(0x10a)](_0x287653(0x9c)+a35_0x54008c[_0x287653(0x100)]('~\x20'+_0x26ab64[_0x287653(0x91)]+_0x287653(0xf0))),_0x4ab974[_0x287653(0x91)]>0x0&&console['error'](_0x287653(0x9c)+a35_0x54008c[_0x287653(0xb9)]('-\x20'+_0x4ab974[_0x287653(0x91)]+'\x20to\x20delete')));console[_0x287653(0x10a)](_0x287653(0xf3)+a35_0x54008c[_0x287653(0xc3)](_0x4ebcef)+'\x0a');if(_0xb0e9fb[_0x287653(0x91)]>0x0){console[_0x287653(0x10a)](_0x287653(0xca));for(const _0x573866 of _0xb0e9fb){console[_0x287653(0x10a)]('\x20\x20'+a35_0x54008c['blue']('+')+'\x20'+_0x573866);}console[_0x287653(0x10a)]('');}if(_0x1ea81e[_0x287653(0x91)]>0x0&&!_0x1fb91e[_0x287653(0x9f)])for(const _0x14759a of _0x1ea81e){const _0x53c3b8=_0x14759a[_0x287653(0xcf)]?_0x14759a[_0x287653(0xcf)]+'/'+_0x14759a['yamlConfig']['name']:_0x14759a[_0x287653(0x10c)]['name'],_0x518925=_0x14759a[_0x287653(0x10c)][_0x287653(0xa6)]?.['length']||0x0,_0x3a8a1e=_0x518925>0x0?a35_0x54008c[_0x287653(0x8e)]('\x20['+_0x518925+_0x287653(0xdc)):'';console[_0x287653(0x10a)]('\x0a'+a35_0x54008c[_0x287653(0xaa)](_0x287653(0x9a))+'\x20'+_0x53c3b8+_0x3a8a1e),console[_0x287653(0x10a)]('─'[_0x287653(0xd3)](0x3c)),_0x14759a[_0x287653(0xdb)]&&console[_0x287653(0x10a)](_0x14759a[_0x287653(0xdb)]),console[_0x287653(0x10a)]('─'['repeat'](0x3c));}if(_0x4a6fd8['length']>0x0&&!_0x1fb91e[_0x287653(0x9f)])for(const _0x5df9ee of _0x4a6fd8){const _0x3d5f56=_0x5df9ee[_0x287653(0xfe)]?_0x4f71cd[_0x287653(0xfb)](_0x5df9ee[_0x287653(0xfe)][_0x287653(0xfd)]())||'':'',_0x5b0dd6=_0x3d5f56?_0x3d5f56+'/'+_0x5df9ee[_0x287653(0x8c)]:_0x5df9ee[_0x287653(0x8c)],_0x3d8fca=_0x373952[_0x287653(0xfb)](_0x5df9ee['id'])||[],_0x45c93c=_0x3d8fca[_0x287653(0x91)]>0x0?a35_0x54008c['dim']('\x20['+_0x3d8fca['length']+'\x20activations]'):'';console[_0x287653(0x10a)]('\x0a'+a35_0x54008c['red'](_0x287653(0xea))+'\x20'+_0x5b0dd6+_0x45c93c),console[_0x287653(0x10a)]('─'[_0x287653(0xd3)](0x3c));const _0xbc8f0e=segmentWithActivationsToYaml(_0x5df9ee,_0x3d8fca,undefined,_0x3db390,_0x1e5227),_0x2698e3=segmentToYamlString(_0xbc8f0e),_0x5cad6a=generateDiff(_0x2698e3,'');console['error'](formatDiffWithColors(_0x5cad6a)),console[_0x287653(0x10a)]('─'[_0x287653(0xd3)](0x3c));}const _0x55c952=_0x15c8da[_0x287653(0x7c)](_0x1d7f60=>!_0x1d7f60[_0x287653(0x109)]&&_0x1d7f60[_0x287653(0xdb)]);if(_0x55c952[_0x287653(0x91)]>0x0&&!_0x1fb91e['journeysOnly'])for(const _0x5d0d86 of _0x55c952){const _0x5f2d9c=_0x5d0d86[_0x287653(0xcf)]?_0x5d0d86[_0x287653(0xcf)]+'/'+_0x5d0d86[_0x287653(0x10c)]['name']:_0x5d0d86[_0x287653(0x10c)][_0x287653(0x8c)];console[_0x287653(0x10a)]('\x0a'+a35_0x54008c['yellow'](_0x287653(0xef))+'\x20'+_0x5f2d9c),console['error']('─'[_0x287653(0xd3)](0x3c)),console[_0x287653(0x10a)](_0x5d0d86['diff']),console['error']('─'[_0x287653(0xd3)](0x3c));}if(_0x41bb92['length']>0x0)for(const _0x469c3a of _0x41bb92){const _0x4fdde6=_0x469c3a[_0x287653(0xcf)]?_0x469c3a[_0x287653(0xcf)]+'/'+_0x469c3a[_0x287653(0x10c)][_0x287653(0x8c)]:_0x469c3a[_0x287653(0x10c)][_0x287653(0x8c)];console[_0x287653(0x10a)]('\x0a'+a35_0x54008c[_0x287653(0xaa)](_0x287653(0xeb))+'\x20'+_0x4fdde6),console[_0x287653(0x10a)]('─'[_0x287653(0xd3)](0x3c)),_0x469c3a['diff']&&console['error'](_0x469c3a[_0x287653(0xdb)]),console[_0x287653(0x10a)]('─'[_0x287653(0xd3)](0x3c));}const _0x25becb=_0x2d9a0d[_0x287653(0x7c)](_0x46f587=>!_0x46f587['isNew']&&_0x46f587[_0x287653(0xdb)]);if(_0x25becb[_0x287653(0x91)]>0x0)for(const _0x4d9527 of _0x25becb){const _0x31a48f=_0x4d9527[_0x287653(0xcf)]?_0x4d9527[_0x287653(0xcf)]+'/'+_0x4d9527[_0x287653(0x10c)][_0x287653(0x8c)]:_0x4d9527[_0x287653(0x10c)][_0x287653(0x8c)];console[_0x287653(0x10a)]('\x0a'+a35_0x54008c[_0x287653(0x100)](_0x287653(0xa4))+'\x20'+_0x31a48f),console['error']('─'[_0x287653(0xd3)](0x3c)),console['error'](_0x4d9527[_0x287653(0xdb)]),console['error']('─'[_0x287653(0xd3)](0x3c));}if(_0x328202[_0x287653(0x91)]>0x0)for(const _0x243ee2 of _0x328202){const _0x1051c4=_0x243ee2['folderId']?_0x4f71cd[_0x287653(0xfb)](_0x243ee2[_0x287653(0xcc)])||'':'',_0x5f2162=_0x1051c4?_0x1051c4+'/'+_0x243ee2[_0x287653(0x9b)]:_0x243ee2[_0x287653(0x9b)];console['error']('\x0a'+a35_0x54008c[_0x287653(0xb9)](_0x287653(0xb7))+'\x20'+_0x5f2162),console[_0x287653(0x10a)]('─'[_0x287653(0xd3)](0x3c)),console['error'](a35_0x54008c[_0x287653(0xb9)](_0x287653(0xab))),console['error']('─'[_0x287653(0xd3)](0x3c));}if(_0x1fb91e[_0x287653(0xd4)])return console[_0x287653(0x10a)](a35_0x54008c['yellow']('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x5b9fc2=_0x1fb91e['journeysOnly']?![]:_0x1ea81e[_0x287653(0x91)]>0x0||_0x4e5b42['length']>0x0||_0x4a6fd8[_0x287653(0x91)]>0x0,_0x453b96=_0x41bb92[_0x287653(0x91)]>0x0||_0x327209[_0x287653(0x91)]>0x0||_0x328202[_0x287653(0x91)]>0x0,_0x56306b=_0x1fb91e['journeysOnly']?![]:_0x2f64ff[_0x287653(0x91)]>0x0,_0x22f7b8=_0xb0e9fb[_0x287653(0x91)]>0x0;if(!_0x5b9fc2&&!_0x453b96&&!_0x56306b&&!_0x22f7b8){const _0x100c3d=_0x1fb91e[_0x287653(0x9f)]?_0x287653(0xaf):_0x287653(0xcd);console['error'](a35_0x54008c['green'](_0x100c3d));if(_0x5cf42b&&_0x346ba3[_0x287653(0x91)]===0x1){const _0x2fbba2=_0x346ba3[0x0];if(_0x2fbba2[_0x287653(0x9e)]?.['id']){const _0x2584e2=getConsoleNextUrl(_0x1fb91e[_0x287653(0x8a)],_0x287653(0x103)+_0x229721+_0x287653(0xbc)+_0x2fbba2[_0x287653(0x9e)]['id']+_0x287653(0x9d));console[_0x287653(0x10a)](_0x287653(0x86)+a35_0x54008c['cyan'](_0x2584e2));}}if(_0x5cf42b&&_0xb319ea[_0x287653(0x91)]===0x1){const _0x490a99=_0xb319ea[0x0];if(_0x490a99['existingJourney']?.['id']){const _0x169d87=getConsoleNextUrl(_0x1fb91e['site'],_0x287653(0x103)+_0x229721+_0x287653(0xbc)+_0x490a99[_0x287653(0xa2)]['id']+'/j/da/je');console['error']('\x20\x20'+a35_0x54008c['cyan'](_0x169d87));}}return 0x0;}const _0x197308=_0x1fb91e[_0x287653(0x9f)]?_0x41bb92[_0x287653(0x91)]+_0x327209['length']+_0x328202[_0x287653(0x91)]+_0xb0e9fb[_0x287653(0x91)]:_0x1ea81e[_0x287653(0x91)]+_0x4e5b42[_0x287653(0x91)]+_0x4a6fd8['length']+_0x41bb92[_0x287653(0x91)]+_0x327209['length']+_0x328202[_0x287653(0x91)]+_0xb0e9fb[_0x287653(0x91)]+_0x2f64ff[_0x287653(0x91)];if(!_0x1fb91e['yes']&&_0x197308>0x0){if(!isInteractive())return console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0xb9)](_0x287653(0xe1)),_0x287653(0x99)),console[_0x287653(0x10a)](a35_0x54008c['dim'](_0x287653(0xc6))),0x1;const _0x165cab=await confirmKey(_0x287653(0xe0)+_0x197308+_0x287653(0x108));if(!_0x165cab)return console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0x100)](_0x287653(0xae))),0x1;}const _0x20bcdf={'withProgress':async(_0x2d9eb4,_0x155824)=>{const _0x432bc7=_0x287653,_0x18de8b=await withSpinner(_0x2d9eb4,_0x155824,{'verbose':_0x1fb91e[_0x432bc7(0x101)]});return{'data':_0x18de8b[_0x432bc7(0xa5)]};},'logInfo':_0x3c9ecb=>console['error'](a35_0x54008c[_0x287653(0x90)]('✔\x20'+_0x3c9ecb)),'logSuccess':_0xd60bcd=>console[_0x287653(0x10a)](a35_0x54008c['green']('✔\x20'+_0xd60bcd)),'logWarning':_0x36ad0d=>console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0x100)]('⚠\x20'+_0x36ad0d)),'logDeleted':_0x1e6bc7=>console[_0x287653(0x10a)](a35_0x54008c['red']('✔\x20'+_0x1e6bc7))},_0x2590ba={'segment':_0x1121ce[_0x287653(0x107)],'journey':_0x1121ce[_0x287653(0x10f)],'user':_0x1121ce[_0x287653(0xd1)],'connection':_0x1121ce[_0x287653(0xa9)]};_0xb0e9fb[_0x287653(0x91)]>0x0&&(_0x2f886b=await executePushFolders(_0x2590ba,_0xb0e9fb,_0x2f886b,{'parentId':_0x229721},_0x20bcdf));const _0xf42697={'rootFolderId':_0x50c4a3,'folderPathToId':_0x2f886b,'folderIdToPath':_0x4f71cd,'segmentNameToId':_0x35302a,'activationsBySegmentId':_0x373952,'emailToIdMap':_0x5abc94,'idToEmailMap':_0x3db390,'connectionNameToIdMap':_0x1bb449['nameToId'],'connectionIdToNameMap':_0x1bb449[_0x287653(0x79)],'connectionNameToTypeMap':_0x3e39f7},_0x3fb424=await executePushSegments(_0x2590ba,_0x1fb91e[_0x287653(0x9f)]?[]:_0x15c8da,_0xf42697,{'parentId':_0x229721},_0x20bcdf),_0xc737ed=_0x3fb424[_0x287653(0xc1)],_0x1f6b12=_0x3fb424['updated'],_0x5c3a8a=_0x3fb424['activations']['created'],_0x3c917b=_0x3fb424[_0x287653(0xa6)][_0x287653(0xa0)],_0x32a67d=_0x3fb424[_0x287653(0xa6)]['deleted'];let _0x123755;if(_0x5cf42b&&_0x15c8da[_0x287653(0x91)]===0x1){const _0x422646=_0x15c8da[0x0];_0x123755=_0x422646[_0x287653(0x9e)]?.['id']??_0x3fb424[_0x287653(0xf5)][_0x287653(0xfb)](_0x422646[_0x287653(0x10c)][_0x287653(0x8c)]);}const _0x20374c=await executePushSegmentDeletions(_0x2590ba,_0x1fb91e['journeysOnly']?[]:_0x4a6fd8,_0x20bcdf);let _0x44528c=0x0,_0x467798=0x0,_0x52ecd2=0x0;const _0x560b6f=new Map(_0x35302a);for(const [_0x2500d0,_0x159132]of _0x3fb424[_0x287653(0xf5)]){_0x560b6f['set'](_0x2500d0,_0x159132);}if(_0x2d9a0d[_0x287653(0x91)]>0x0){const _0x392859={..._0xf42697,'segmentNameToId':_0x560b6f,'existingSegments':_0x3b45c0,'activationContext':_0x529b45},_0x597a34=await executePushJourneys(_0x2590ba,_0x2d9a0d,_0x392859,{'parentId':_0x229721,'rootFolderId':_0x50c4a3,'verbose':_0x1fb91e[_0x287653(0x101)]},_0x20bcdf);_0x44528c=_0x597a34[_0x287653(0xc1)],_0x467798=_0x597a34[_0x287653(0xa0)];if(_0x5cf42b&&_0x597a34[_0x287653(0xc8)][_0x287653(0x91)]===0x1){const _0x4d330e=_0x597a34[_0x287653(0xc8)][0x0];if(_0x4d330e['journeyId']){const _0x3059ff=getConsoleNextUrl(_0x1fb91e[_0x287653(0x8a)],'/app/ps/'+_0x229721+_0x287653(0xbc)+_0x4d330e[_0x287653(0xde)]+'/j/da/je');console[_0x287653(0x10a)]('\x20\x20'+a35_0x54008c['cyan'](_0x3059ff));}}}for(const _0xeac54 of _0x328202){console['error'](a35_0x54008c['yellow']('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0xeac54['journeyBundleName'])),_0x52ecd2++;}const _0x4afe71=[];if(_0xc737ed>0x0)_0x4afe71[_0x287653(0xa3)](_0xc737ed+_0x287653(0xfc));if(_0x1f6b12>0x0)_0x4afe71[_0x287653(0xa3)](_0x1f6b12+_0x287653(0x10b));if(_0x20374c>0x0)_0x4afe71[_0x287653(0xa3)](_0x20374c+_0x287653(0xe2));const _0x1f70d6=[];if(_0x44528c>0x0)_0x1f70d6[_0x287653(0xa3)](_0x44528c+_0x287653(0xfc));if(_0x467798>0x0)_0x1f70d6[_0x287653(0xa3)](_0x467798+'\x20updated');if(_0x52ecd2>0x0)_0x1f70d6['push'](_0x52ecd2+_0x287653(0xe2));const _0x2c5871=[];if(_0x5c3a8a>0x0)_0x2c5871[_0x287653(0xa3)](_0x5c3a8a+_0x287653(0xfc));if(_0x3c917b>0x0)_0x2c5871['push'](_0x3c917b+_0x287653(0x10b));if(_0x32a67d>0x0)_0x2c5871['push'](_0x32a67d+_0x287653(0xe2));console[_0x287653(0x10a)](a35_0x54008c[_0x287653(0xaa)](_0x287653(0xc2)));_0x4afe71[_0x287653(0x91)]>0x0&&!_0x1fb91e[_0x287653(0x9f)]&&console[_0x287653(0x10a)](_0x287653(0x80)+_0x4afe71['join'](',\x20'));_0x1f70d6['length']>0x0&&console[_0x287653(0x10a)]('\x20\x20Journeys:\x20'+_0x1f70d6[_0x287653(0xee)](',\x20'));_0x2c5871[_0x287653(0x91)]>0x0&&!_0x1fb91e[_0x287653(0x9f)]&&console[_0x287653(0x10a)]('\x20\x20Activations:\x20'+_0x2c5871[_0x287653(0xee)](',\x20'));if(_0x123755){const _0x3d6c3=getConsoleNextUrl(_0x1fb91e[_0x287653(0x8a)],_0x287653(0x103)+_0x229721+_0x287653(0xbc)+_0x123755+_0x287653(0x9d));console[_0x287653(0x10a)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a35_0x54008c['cyan'](_0x3d6c3));}return 0x0;}}
|
|
1
|
+
const a35_0x16cda1=a35_0x4462;(function(_0x4f87ff,_0x285cc6){const _0x4d4e6a=a35_0x4462,_0x16662c=_0x4f87ff();while(!![]){try{const _0x3703d6=-parseInt(_0x4d4e6a(0x247))/0x1+parseInt(_0x4d4e6a(0x229))/0x2+parseInt(_0x4d4e6a(0x20b))/0x3+-parseInt(_0x4d4e6a(0x245))/0x4*(-parseInt(_0x4d4e6a(0x1f6))/0x5)+parseInt(_0x4d4e6a(0x1f0))/0x6+parseInt(_0x4d4e6a(0x24f))/0x7+-parseInt(_0x4d4e6a(0x262))/0x8;if(_0x3703d6===_0x285cc6)break;else _0x16662c['push'](_0x16662c['shift']());}catch(_0x203a29){_0x16662c['push'](_0x16662c['shift']());}}}(a35_0x12bd,0xc0054));function a35_0x12bd(){const _0x16385d=['nameToId','parentFolder','New\x20journey:','392439GVzzrT','\x20\x20🗺️\x20\x20Journeys:','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','versionNumber','segment\x20or\x20journey','listFolders','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','type','delete','dryRun','changed','\x20activations]','\x20YAML\x20files\x20found','parent_name','helpText','unchanged','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','deleted','\x0aError:','message','listSegments','\x27...','user','createdAt','\x0a✔\x20Push\x20complete','toString','then','Error\x20parsing\x20YAML:\x20','audienceId','no_parent','1699338kenkak','description','\x20to\x20create','/sb/da/esr','Folders\x20to\x20create:','results','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','journeys','journeyBundleId','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x20new','isScoped','execute','Delete\x20segment:','\x20to\x20delete','buildUserMaps','add','push','journeyId','segment:push','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)','(Journey\x20will\x20be\x20deleted)','\x20to\x20update','Fetching\x20existing\x20activations...','Fetching\x20existing\x20data...','data','Fetching\x20connections\x20for\x20name\x20resolution...','Error:\x20Directory\x20not\x20found:\x20','11708jJyXYo','map','526607bNQcOv','yamlConfig','segment','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','join','activations','.yml','setPhase','9448327SgARIh','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','errorCode','attributes','journeyBundleName','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','length','\x20updated','Push\x20','parentName','green','scopedFolderPath','folderPath','\x20\x20Activations:','/app/ps/','updated','filter','listActivations','Error:\x20','19484352XtxZxS','created','site','\x20created','cyan','\x20\x20Activations:\x20','\x20deleted','toDelete','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20\x20\x20','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','journey','getParent','Changes\x20to:','error','toUpdate','segmentFolderId','.yaml','idToName','file','Site:\x20','get','yellow','New\x20segment:','targetDir','listJourneysWithDetailsFromParentSegment','all','state','existingSegment','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','\x0aValidation\x20failed:','\x20\x20📊\x20Segments:','diff','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','name','Resolving\x20parent\x20segment\x20\x27','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','/e/','updatedAt','existingJourney','red','/j/da/je','3435126emiNrB','\x20changes?','getJourney','\x0aPush\x20summary\x20for\x20\x27','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','blue','1445hGxYGk','\x20unchanged','connection','createdSegmentIds','journeysOnly','verbose','No\x20','segments','dim','isNew','getOutputSchemaWithCache','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','\x20\x20Journeys:\x20','repeat','new','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20changed','Preparing\x20journeys...'];a35_0x12bd=function(){return _0x16385d;};return a35_0x12bd();}import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a35_0x5d6580 from'chalk';import{existsSync}from'fs';function a35_0x4462(_0x3ba3fd,_0x20d75d){_0x3ba3fd=_0x3ba3fd-0x1e5;const _0x12bdf3=a35_0x12bd();let _0x4462ef=_0x12bdf3[_0x3ba3fd];return _0x4462ef;}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{[a35_0x16cda1(0x1e8)]=a35_0x16cda1(0x23c);[a35_0x16cda1(0x22a)]=a35_0x16cda1(0x211);async[a35_0x16cda1(0x235)](_0x12f78b){const _0x51963d=a35_0x16cda1,{options:_0x4fa69f,args:_0x29f460,tdx:_0x501d76}=_0x12f78b,_0x586acc=_0x4fa69f,_0x3af288=await resolveTarget({'arg':_0x29f460[0x0],'contextParent':_0x4fa69f['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x3af288))return _0x3af288[_0x51963d(0x251)]===_0x51963d(0x228)?(console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x278)](_0x51963d(0x21b))),console[_0x51963d(0x270)](_0x51963d(0x23d)),console[_0x51963d(0x270)](_0x51963d(0x201)),console[_0x51963d(0x270)](_0x51963d(0x250))):(console['error'](a35_0x5d6580[_0x51963d(0x1ee)](_0x51963d(0x261)+_0x3af288[_0x51963d(0x21e)]+'\x0a')),_0x3af288[_0x51963d(0x219)]&&console[_0x51963d(0x270)](a35_0x5d6580['cyan'](_0x3af288[_0x51963d(0x219)]))),0x1;if(_0x3af288['type']===_0x51963d(0x218))return console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1ee)]('Error:\x20Directory\x20not\x20found:\x20'+_0x3af288[_0x51963d(0x27a)]+'\x0a')),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x266)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;const _0x39fbde=_0x3af288[_0x51963d(0x258)],_0x108f0f=_0x3af288[_0x51963d(0x27a)],_0x304180=_0x3af288[_0x51963d(0x212)]===_0x51963d(0x275)?_0x3af288['filePath']:undefined,_0xad1551=getScopedDetails(_0x3af288),_0x2cd0ae=_0xad1551?.[_0x51963d(0x234)]??![],_0x44cd79=_0xad1551?.[_0x51963d(0x25a)]??'';if(!existsSync(_0x108f0f))return console[_0x51963d(0x270)](a35_0x5d6580['red'](_0x51963d(0x244)+_0x108f0f+'\x0a')),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x266)](_0x51963d(0x26a))),0x1;_0x586acc[_0x51963d(0x1fb)]&&(console['error'](_0x51963d(0x276)+_0x586acc['site']),console[_0x51963d(0x270)]('Parent\x20segment:\x20'+_0x39fbde),console[_0x51963d(0x270)]('Source\x20directory:\x20'+_0x108f0f),_0x2cd0ae&&console[_0x51963d(0x270)]('Scoped\x20to\x20folder:\x20'+_0x44cd79));const _0x886ba6=await withSpinner(_0x51963d(0x1e9)+_0x39fbde+_0x51963d(0x220),()=>_0x501d76[_0x51963d(0x249)]['resolveParentId'](_0x39fbde),{'verbose':_0x586acc[_0x51963d(0x1fb)]}),_0x169f03=_0x886ba6['data'],{parentSegmentResult:_0x43f834,segmentsResult:_0x252a4f,foldersResult:_0x3ea2dd,journeysWithDetailsResult:_0x16d791,userMaps:_0x2849fa}=await withSpinner(_0x51963d(0x241),async()=>{const _0x16c675=_0x51963d,[_0x448f00,_0x1d17fa,_0x473786,_0x122990,_0x562a8e]=await Promise[_0x16c675(0x27c)]([_0x501d76['segment'][_0x16c675(0x26e)](_0x169f03),_0x501d76['segment'][_0x16c675(0x21f)](_0x169f03),_0x501d76[_0x16c675(0x249)][_0x16c675(0x210)](_0x169f03),_0x501d76[_0x16c675(0x26d)][_0x16c675(0x27b)](_0x169f03,{'includeAllVersions':!![]}),_0x501d76[_0x16c675(0x221)][_0x16c675(0x238)]()]);return{'parentSegmentResult':_0x448f00,'segmentsResult':_0x1d17fa,'foldersResult':_0x473786,'journeysWithDetailsResult':_0x122990,'userMaps':_0x562a8e};},{'verbose':_0x586acc[_0x51963d(0x1fb)]})['then'](_0x2250d=>_0x2250d[_0x51963d(0x242)]),_0x527d14=_0x43f834,_0x2e277c=extractRootFolderId(_0x527d14),_0x4ff995=_0x252a4f,_0xcca10c=_0x3ea2dd,{journeys:_0x1e1a35,activationStepsById:_0x28a4dd}=_0x16d791,_0x57fccc=new Map(_0x1e1a35[_0x51963d(0x246)](_0x25fe95=>[_0x25fe95['id'],_0x25fe95])),_0x4b5746=_0x1e1a35[_0x51963d(0x246)](_0x3356b1=>({'id':_0x3356b1['id'],'name':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x1e8)],'journeyBundleName':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x253)]||'','journeyBundleId':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x231)]||'','versionNumber':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x20e)],'description':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x22a)],'state':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x27d)],'paused':_0x3356b1[_0x51963d(0x252)]['paused'],'audienceId':_0x3356b1['attributes'][_0x51963d(0x227)],'folderId':_0x3356b1['relationships']?.[_0x51963d(0x209)]?.[_0x51963d(0x242)]?.['id'],'createdAt':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x222)],'updatedAt':_0x3356b1[_0x51963d(0x252)][_0x51963d(0x1ec)]})),{emailToId:_0x54815f,idToEmail:_0x264422}=_0x2849fa,_0x3365c2=await withSpinner(_0x51963d(0x243),async()=>{const _0x4209ab=_0x51963d,_0x5eca4b=await _0x501d76[_0x4209ab(0x1f8)]['list']();return buildConnectionMaps(_0x5eca4b);},{'verbose':_0x586acc[_0x51963d(0x1fb)]})[_0x51963d(0x225)](_0x34016e=>_0x34016e['data']),_0x22e886=_0x3365c2[_0x51963d(0x208)],_0x154c86=_0x3365c2[_0x51963d(0x274)],_0xea5794=_0x3365c2['nameToType'],_0x3e2586={'emailToIdMap':_0x54815f,'connectionNameToIdMap':_0x22e886,'connectionNameToTypeMap':_0xea5794,'getSchema':_0x24717a=>_0x501d76['connection'][_0x51963d(0x200)](_0x24717a)};let {pathToId:_0x44335d,idToPath:_0x2cec11}=buildFolderMaps(_0xcca10c);const _0x4c1719=buildSegmentLookupMap(_0x4ff995,_0x2cec11),_0x38df0e=buildSegmentNameToIdMap(_0x4ff995),_0x3aac25=buildJourneyBundleLookupMap(_0x4b5746,_0x2cec11);let _0x5ae501;if(_0x304180){if(!_0x304180['endsWith'](_0x51963d(0x24d))&&!_0x304180['endsWith'](_0x51963d(0x273)))return console[_0x51963d(0x270)](a35_0x5d6580['red'](_0x51963d(0x1e7)+_0x304180+'\x0a')),0x1;_0x5ae501=[_0x304180];}else _0x5ae501=findYamlFiles(_0x108f0f);if(_0x5ae501['length']===0x0)return console[_0x51963d(0x270)](a35_0x5d6580['red'](_0x51963d(0x22f)+_0x108f0f+'\x0a')),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x266)](_0x51963d(0x27f))),0x1;let _0x3a3196,_0x415cab;try{const _0x1b5b98=parseAndClassifyYamlFiles(_0x5ae501,_0x108f0f,{'skipSegments':_0x586acc[_0x51963d(0x1fa)]});_0x3a3196=_0x1b5b98[_0x51963d(0x1fd)],_0x415cab=_0x1b5b98['journeys'];const _0x24dea0=validateParsedFiles(_0x1b5b98,_0x108f0f);if(_0x24dea0[_0x51963d(0x255)]>0x0)return console['error'](a35_0x5d6580['red'](_0x51963d(0x280))),console[_0x51963d(0x270)](formatValidationErrors(_0x24dea0)),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x278)](_0x51963d(0x20d))),0x1;}catch(_0x4e93a4){return console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1ee)](_0x51963d(0x226)+(_0x4e93a4 instanceof Error?_0x4e93a4[_0x51963d(0x21e)]:_0x4e93a4))),0x1;}if(_0x3a3196[_0x51963d(0x255)]===0x0&&_0x415cab[_0x51963d(0x255)]===0x0){const _0x30abbd=_0x586acc[_0x51963d(0x1fa)]?'journey':_0x51963d(0x20f);return console['error'](a35_0x5d6580[_0x51963d(0x278)](_0x51963d(0x1fc)+_0x30abbd+_0x51963d(0x217))),0x0;}const _0x24cc19=new Map();_0x4ff995[_0x51963d(0x255)]>0x0&&!_0x586acc[_0x51963d(0x1fa)]&&await withSpinner(_0x51963d(0x240),async()=>{await batchAsync(_0x4ff995,async _0x23abef=>{const _0x2d9b80=a35_0x4462,_0x3ecff6=await _0x501d76[_0x2d9b80(0x249)][_0x2d9b80(0x260)](_0x169f03,_0x23abef['id']);_0x24cc19['set'](_0x23abef['id'],_0x3ecff6);});},{'verbose':_0x586acc[_0x51963d(0x1fb)]});const {segmentFiles:_0x5ba468,foldersToCreate:_0x34cf54}=await prepareSegmentFiles(_0x3a3196,{'segmentByFolderAndName':_0x4c1719,'activationsBySegmentId':_0x24cc19,'folderPathToId':_0x44335d,'idToEmailMap':_0x264422,'connectionIdToNameMap':_0x154c86},_0x3e2586,_0x2cd0ae,_0x44cd79),_0x257e9b=_0x304180?[]:findSegmentsToDelete(_0x4ff995,_0x3a3196['map'](({yamlConfig:_0x553808,folderPath:_0x7e84b7})=>({'yamlConfig':_0x553808,'folderPath':resolveTDFolderPath(_0x7e84b7,_0x2cd0ae,_0x44cd79)})),_0x2cec11,_0x44cd79,_0x2cd0ae),{journeyFiles:_0x403169,foldersToCreate:_0x5f1bf3}=await withProgressSpinner(_0x51963d(0x207),async _0x41f327=>prepareJourneyFiles(_0x415cab,{'fetchJourney':async _0x50ec5c=>_0x501d76[_0x51963d(0x26d)][_0x51963d(0x1f2)](_0x50ec5c[_0x51963d(0x23b)]),'journeyBundlesByFolderAndName':_0x3aac25,'folderPathToId':_0x44335d,'idToEmailMap':_0x264422,'connectionIdToNameMap':_0x154c86,'existingSegments':_0x4ff995,'parentId':_0x169f03,'deps':_0x501d76,'progress':{'update':_0x281a87=>{const _0x3fa507=_0x51963d;_0x41f327[_0x3fa507(0x24e)](_0x281a87),_0x586acc[_0x3fa507(0x1fb)]&&console[_0x3fa507(0x270)]('\x20\x20'+_0x281a87);}},'journeyById':_0x57fccc,'activationStepsById':_0x28a4dd},_0x2cd0ae,_0x44cd79),{'verbose':_0x586acc[_0x51963d(0x1fb)]})[_0x51963d(0x225)](_0x57d389=>_0x57d389[_0x51963d(0x242)]);for(const _0x3bc117 of _0x5f1bf3){_0x34cf54[_0x51963d(0x239)](_0x3bc117);}const _0x19c8ef=_0x304180?[]:findJourneysToDelete(_0x4b5746,_0x415cab[_0x51963d(0x246)](({yamlConfig:_0x1ae5d7,folderPath:_0x5d9152})=>({'yamlConfig':_0x1ae5d7,'folderPath':resolveTDFolderPath(_0x5d9152,_0x2cd0ae,_0x44cd79)})),_0x2cec11,_0x44cd79,_0x2cd0ae),_0x1f73bf=calculatePushStats(_0x5ba468,_0x403169,_0x34cf54,_0x257e9b,_0x19c8ef,!!_0x586acc[_0x51963d(0x213)],!!_0x586acc[_0x51963d(0x1fa)]),_0x4a033e=_0x1f73bf[_0x51963d(0x1fd)][_0x51963d(0x204)],_0x5c788a=_0x1f73bf['segments'][_0x51963d(0x215)],_0x5247f8=_0x1f73bf[_0x51963d(0x1fd)][_0x51963d(0x21a)],_0x4d80ad=_0x1f73bf[_0x51963d(0x1fd)][_0x51963d(0x269)],_0x5d3275=_0x1f73bf['folders']['toCreate'],_0x26207a=_0x1f73bf[_0x51963d(0x230)]['new'],_0x57c657=_0x1f73bf['journeys'][_0x51963d(0x215)],_0x312aac=_0x1f73bf[_0x51963d(0x230)][_0x51963d(0x21a)],_0xb3cce4=_0x1f73bf[_0x51963d(0x230)]['toDelete'],_0x390c32=_0x1f73bf[_0x51963d(0x24c)][_0x51963d(0x27c)],_0x1193ca=_0x1f73bf[_0x51963d(0x24c)]['toCreate'],_0x237bcc=_0x1f73bf[_0x51963d(0x24c)][_0x51963d(0x271)],_0x4eabe1=_0x1f73bf['activations']['toDelete'];console['error'](_0x51963d(0x1f3)+_0x39fbde+'\x27:');_0x5d3275[_0x51963d(0x255)]>0x0&&console[_0x51963d(0x270)]('\x20\x20'+a35_0x5d6580[_0x51963d(0x1f5)]('📁\x20'+_0x5d3275[_0x51963d(0x255)]+'\x20folders\x20to\x20create'));if(!_0x586acc[_0x51963d(0x1fa)]){console[_0x51963d(0x270)](_0x51963d(0x1e5)),console['error']('\x20\x20\x20\x20'+a35_0x5d6580['green']('+\x20'+_0x4a033e[_0x51963d(0x255)]+_0x51963d(0x233))),console['error']('\x20\x20\x20\x20'+a35_0x5d6580[_0x51963d(0x278)]('~\x20'+_0x5c788a[_0x51963d(0x255)]+'\x20changed'));if(_0x4d80ad[_0x51963d(0x255)]>0x0)console['error'](_0x51963d(0x26b)+a35_0x5d6580[_0x51963d(0x1ee)]('-\x20'+_0x4d80ad[_0x51963d(0x255)]+_0x51963d(0x237)));else _0x257e9b[_0x51963d(0x255)]>0x0&&!_0x586acc['delete']&&console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580['dim'](_0x257e9b[_0x51963d(0x255)]+_0x51963d(0x232)));console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580[_0x51963d(0x1fe)]('=\x20'+_0x5247f8[_0x51963d(0x255)]+_0x51963d(0x1f7)));}if(_0x403169[_0x51963d(0x255)]>0x0||_0x19c8ef[_0x51963d(0x255)]>0x0){console['error'](_0x51963d(0x20c)),console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580['green']('+\x20'+_0x26207a['length']+_0x51963d(0x233))),console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580[_0x51963d(0x278)]('~\x20'+_0x57c657['length']+_0x51963d(0x206)));if(_0xb3cce4[_0x51963d(0x255)]>0x0)console['error'](_0x51963d(0x26b)+a35_0x5d6580[_0x51963d(0x1ee)]('-\x20'+_0xb3cce4[_0x51963d(0x255)]+_0x51963d(0x237)));else _0x19c8ef['length']>0x0&&!_0x586acc[_0x51963d(0x213)]&&console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580['dim'](_0x19c8ef[_0x51963d(0x255)]+_0x51963d(0x232)));console['error']('\x20\x20\x20\x20'+a35_0x5d6580['dim']('=\x20'+_0x312aac[_0x51963d(0x255)]+_0x51963d(0x1f7)));}_0x390c32['length']>0x0&&!_0x586acc[_0x51963d(0x1fa)]&&(console['error'](''),console['error'](_0x51963d(0x25c)),_0x1193ca[_0x51963d(0x255)]>0x0&&console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580[_0x51963d(0x259)]('+\x20'+_0x1193ca[_0x51963d(0x255)]+_0x51963d(0x22b))),_0x237bcc[_0x51963d(0x255)]>0x0&&console['error']('\x20\x20\x20\x20'+a35_0x5d6580[_0x51963d(0x278)]('~\x20'+_0x237bcc['length']+_0x51963d(0x23f))),_0x4eabe1[_0x51963d(0x255)]>0x0&&console[_0x51963d(0x270)](_0x51963d(0x26b)+a35_0x5d6580['red']('-\x20'+_0x4eabe1[_0x51963d(0x255)]+_0x51963d(0x237))));console[_0x51963d(0x270)]('\x20\x20Source:\x20'+a35_0x5d6580[_0x51963d(0x266)](_0x108f0f)+'\x0a');if(_0x5d3275['length']>0x0){console[_0x51963d(0x270)](_0x51963d(0x22d));for(const _0x5bd3e1 of _0x5d3275){console[_0x51963d(0x270)]('\x20\x20'+a35_0x5d6580[_0x51963d(0x1f5)]('+')+'\x20'+_0x5bd3e1);}console[_0x51963d(0x270)]('');}if(_0x4a033e[_0x51963d(0x255)]>0x0&&!_0x586acc[_0x51963d(0x1fa)])for(const _0x8b9f86 of _0x4a033e){const _0x3e070f=_0x8b9f86[_0x51963d(0x25b)]?_0x8b9f86[_0x51963d(0x25b)]+'/'+_0x8b9f86[_0x51963d(0x248)][_0x51963d(0x1e8)]:_0x8b9f86['yamlConfig']['name'],_0x416f42=_0x8b9f86[_0x51963d(0x248)][_0x51963d(0x24c)]?.[_0x51963d(0x255)]||0x0,_0x993e6a=_0x416f42>0x0?a35_0x5d6580[_0x51963d(0x1fe)]('\x20['+_0x416f42+_0x51963d(0x216)):'';console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580[_0x51963d(0x259)](_0x51963d(0x279))+'\x20'+_0x3e070f+_0x993e6a),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c)),_0x8b9f86['diff']&&console[_0x51963d(0x270)](_0x8b9f86[_0x51963d(0x1e6)]),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c));}if(_0x4d80ad[_0x51963d(0x255)]>0x0&&!_0x586acc[_0x51963d(0x1fa)])for(const _0xa4834a of _0x4d80ad){const _0x58f6c7=_0xa4834a[_0x51963d(0x272)]?_0x2cec11[_0x51963d(0x277)](_0xa4834a[_0x51963d(0x272)][_0x51963d(0x224)]())||'':'',_0x1f6a09=_0x58f6c7?_0x58f6c7+'/'+_0xa4834a[_0x51963d(0x1e8)]:_0xa4834a[_0x51963d(0x1e8)],_0x470b18=_0x24cc19['get'](_0xa4834a['id'])||[],_0xdecee5=_0x470b18[_0x51963d(0x255)]>0x0?a35_0x5d6580[_0x51963d(0x1fe)]('\x20['+_0x470b18[_0x51963d(0x255)]+_0x51963d(0x216)):'';console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580[_0x51963d(0x1ee)](_0x51963d(0x236))+'\x20'+_0x1f6a09+_0xdecee5),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c));const _0x37fc8e=segmentWithActivationsToYaml(_0xa4834a,_0x470b18,undefined,_0x264422,_0x154c86),_0x5b1d17=segmentToYamlString(_0x37fc8e),_0xebeee4=generateDiff(_0x5b1d17,'');console[_0x51963d(0x270)](formatDiffWithColors(_0xebeee4)),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c));}const _0x5b28fc=_0x5ba468[_0x51963d(0x25f)](_0x3ad646=>!_0x3ad646[_0x51963d(0x1ff)]&&_0x3ad646[_0x51963d(0x1e6)]);if(_0x5b28fc[_0x51963d(0x255)]>0x0&&!_0x586acc['journeysOnly'])for(const _0x51b9cb of _0x5b28fc){const _0x11bf89=_0x51b9cb[_0x51963d(0x25b)]?_0x51b9cb[_0x51963d(0x25b)]+'/'+_0x51b9cb[_0x51963d(0x248)][_0x51963d(0x1e8)]:_0x51b9cb['yamlConfig'][_0x51963d(0x1e8)];console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580['yellow'](_0x51963d(0x26f))+'\x20'+_0x11bf89),console[_0x51963d(0x270)]('─'['repeat'](0x3c)),console[_0x51963d(0x270)](_0x51b9cb[_0x51963d(0x1e6)]),console[_0x51963d(0x270)]('─'['repeat'](0x3c));}if(_0x26207a[_0x51963d(0x255)]>0x0)for(const _0x4367f0 of _0x26207a){const _0x1fc72f=_0x4367f0[_0x51963d(0x25b)]?_0x4367f0[_0x51963d(0x25b)]+'/'+_0x4367f0[_0x51963d(0x248)][_0x51963d(0x1e8)]:_0x4367f0['yamlConfig'][_0x51963d(0x1e8)];console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580[_0x51963d(0x259)](_0x51963d(0x20a))+'\x20'+_0x1fc72f),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c)),_0x4367f0[_0x51963d(0x1e6)]&&console['error'](_0x4367f0['diff']),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c));}const _0x4d8a08=_0x403169[_0x51963d(0x25f)](_0x2c8bae=>!_0x2c8bae[_0x51963d(0x1ff)]&&_0x2c8bae[_0x51963d(0x1e6)]);if(_0x4d8a08[_0x51963d(0x255)]>0x0)for(const _0x4a81f0 of _0x4d8a08){const _0x2bb45c=_0x4a81f0[_0x51963d(0x25b)]?_0x4a81f0[_0x51963d(0x25b)]+'/'+_0x4a81f0['yamlConfig']['name']:_0x4a81f0[_0x51963d(0x248)][_0x51963d(0x1e8)];console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580[_0x51963d(0x278)]('Changes\x20to\x20journey:')+'\x20'+_0x2bb45c),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c)),console['error'](_0x4a81f0['diff']),console[_0x51963d(0x270)]('─'['repeat'](0x3c));}if(_0xb3cce4[_0x51963d(0x255)]>0x0)for(const _0x5aafd2 of _0xb3cce4){const _0x59c78e=_0x5aafd2['folderId']?_0x2cec11[_0x51963d(0x277)](_0x5aafd2['folderId'])||'':'',_0x1177d0=_0x59c78e?_0x59c78e+'/'+_0x5aafd2[_0x51963d(0x253)]:_0x5aafd2['journeyBundleName'];console[_0x51963d(0x270)]('\x0a'+a35_0x5d6580[_0x51963d(0x1ee)]('Delete\x20journey:')+'\x20'+_0x1177d0),console[_0x51963d(0x270)]('─'['repeat'](0x3c)),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1ee)](_0x51963d(0x23e))),console[_0x51963d(0x270)]('─'[_0x51963d(0x203)](0x3c));}if(_0x586acc[_0x51963d(0x214)])return console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x278)](_0x51963d(0x1ea))),0x0;const _0xe3b2a7=_0x586acc[_0x51963d(0x1fa)]?![]:_0x4a033e[_0x51963d(0x255)]>0x0||_0x5c788a[_0x51963d(0x255)]>0x0||_0x4d80ad[_0x51963d(0x255)]>0x0,_0x2eaa2e=_0x26207a[_0x51963d(0x255)]>0x0||_0x57c657['length']>0x0||_0xb3cce4[_0x51963d(0x255)]>0x0,_0x38f65c=_0x586acc['journeysOnly']?![]:_0x390c32[_0x51963d(0x255)]>0x0,_0x396530=_0x5d3275['length']>0x0;if(!_0xe3b2a7&&!_0x2eaa2e&&!_0x38f65c&&!_0x396530){const _0x33e1b9=_0x586acc[_0x51963d(0x1fa)]?_0x51963d(0x254):_0x51963d(0x26c);console[_0x51963d(0x270)](a35_0x5d6580['green'](_0x33e1b9));if(_0x304180&&_0x5247f8[_0x51963d(0x255)]===0x1){const _0x5200a1=_0x5247f8[0x0];if(_0x5200a1[_0x51963d(0x27e)]?.['id']){const _0x23c90d=getConsoleNextUrl(_0x586acc[_0x51963d(0x264)],_0x51963d(0x25d)+_0x169f03+'/e/'+_0x5200a1['existingSegment']['id']+_0x51963d(0x22c));console[_0x51963d(0x270)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a35_0x5d6580[_0x51963d(0x266)](_0x23c90d));}}if(_0x304180&&_0x312aac['length']===0x1){const _0x58c314=_0x312aac[0x0];if(_0x58c314['existingJourney']?.['id']){const _0x4077ef=getConsoleNextUrl(_0x586acc[_0x51963d(0x264)],_0x51963d(0x25d)+_0x169f03+_0x51963d(0x1eb)+_0x58c314[_0x51963d(0x1ed)]['id']+'/j/da/je');console[_0x51963d(0x270)]('\x20\x20'+a35_0x5d6580[_0x51963d(0x266)](_0x4077ef));}}return 0x0;}const _0x1afbdd=_0x586acc[_0x51963d(0x1fa)]?_0x26207a[_0x51963d(0x255)]+_0x57c657[_0x51963d(0x255)]+_0xb3cce4[_0x51963d(0x255)]+_0x5d3275[_0x51963d(0x255)]:_0x4a033e['length']+_0x5c788a['length']+_0x4d80ad[_0x51963d(0x255)]+_0x26207a[_0x51963d(0x255)]+_0x57c657['length']+_0xb3cce4[_0x51963d(0x255)]+_0x5d3275['length']+_0x390c32['length'];if(!_0x586acc['yes']&&_0x1afbdd>0x0){if(!isInteractive())return console['error'](a35_0x5d6580[_0x51963d(0x1ee)](_0x51963d(0x21d)),_0x51963d(0x24a)),console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1fe)](_0x51963d(0x1f4))),0x1;const _0x13df07=await confirmKey(_0x51963d(0x257)+_0x1afbdd+_0x51963d(0x1f1));if(!_0x13df07)return console['error'](a35_0x5d6580['yellow']('Aborted.')),0x1;}const _0x323a93={'withProgress':async(_0x5393df,_0x14b741)=>{const _0x3a00ff=_0x51963d,_0x1b16c7=await withSpinner(_0x5393df,_0x14b741,{'verbose':_0x586acc['verbose']});return{'data':_0x1b16c7[_0x3a00ff(0x242)]};},'logInfo':_0x24df40=>console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1f5)]('✔\x20'+_0x24df40)),'logSuccess':_0x483d8f=>console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x259)]('✔\x20'+_0x483d8f)),'logWarning':_0x40171b=>console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x278)]('⚠\x20'+_0x40171b)),'logDeleted':_0x42b325=>console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x1ee)]('✔\x20'+_0x42b325))},_0x48070c={'segment':_0x501d76[_0x51963d(0x249)],'journey':_0x501d76[_0x51963d(0x26d)],'user':_0x501d76[_0x51963d(0x221)],'connection':_0x501d76[_0x51963d(0x1f8)]};_0x5d3275[_0x51963d(0x255)]>0x0&&(_0x44335d=await executePushFolders(_0x48070c,_0x5d3275,_0x44335d,{'parentId':_0x169f03},_0x323a93));const _0x2c597a={'rootFolderId':_0x2e277c,'folderPathToId':_0x44335d,'folderIdToPath':_0x2cec11,'segmentNameToId':_0x38df0e,'activationsBySegmentId':_0x24cc19,'emailToIdMap':_0x54815f,'idToEmailMap':_0x264422,'connectionNameToIdMap':_0x3365c2[_0x51963d(0x208)],'connectionIdToNameMap':_0x3365c2[_0x51963d(0x274)],'connectionNameToTypeMap':_0xea5794},_0x15f0b0=await executePushSegments(_0x48070c,_0x586acc[_0x51963d(0x1fa)]?[]:_0x5ba468,_0x2c597a,{'parentId':_0x169f03},_0x323a93),_0x188155=_0x15f0b0[_0x51963d(0x263)],_0x1571f7=_0x15f0b0[_0x51963d(0x25e)],_0x38a659=_0x15f0b0[_0x51963d(0x24c)][_0x51963d(0x263)],_0x1c20ec=_0x15f0b0[_0x51963d(0x24c)][_0x51963d(0x25e)],_0x3afd67=_0x15f0b0[_0x51963d(0x24c)][_0x51963d(0x21c)];let _0x2d35a3;if(_0x304180&&_0x5ba468['length']===0x1){const _0xcb743e=_0x5ba468[0x0];_0x2d35a3=_0xcb743e[_0x51963d(0x27e)]?.['id']??_0x15f0b0[_0x51963d(0x1f9)][_0x51963d(0x277)](_0xcb743e[_0x51963d(0x248)][_0x51963d(0x1e8)]);}const _0x29c6a2=await executePushSegmentDeletions(_0x48070c,_0x586acc['journeysOnly']?[]:_0x4d80ad,_0x323a93);let _0x3104b1=0x0,_0xeb411d=0x0,_0x51548f=0x0;const _0x36ff5e=new Map(_0x38df0e);for(const [_0x234092,_0x31b29d]of _0x15f0b0[_0x51963d(0x1f9)]){_0x36ff5e['set'](_0x234092,_0x31b29d);}if(_0x403169['length']>0x0){const _0x3af011={..._0x2c597a,'segmentNameToId':_0x36ff5e,'existingSegments':_0x4ff995,'activationContext':_0x3e2586},_0x36a174=await executePushJourneys(_0x48070c,_0x403169,_0x3af011,{'parentId':_0x169f03,'rootFolderId':_0x2e277c,'verbose':_0x586acc['verbose']},_0x323a93);_0x3104b1=_0x36a174[_0x51963d(0x263)],_0xeb411d=_0x36a174['updated'];if(_0x304180&&_0x36a174[_0x51963d(0x22e)][_0x51963d(0x255)]===0x1){const _0x30fc45=_0x36a174[_0x51963d(0x22e)][0x0];if(_0x30fc45[_0x51963d(0x23b)]){const _0x72eabb=getConsoleNextUrl(_0x586acc[_0x51963d(0x264)],_0x51963d(0x25d)+_0x169f03+_0x51963d(0x1eb)+_0x30fc45['journeyId']+_0x51963d(0x1ef));console[_0x51963d(0x270)]('\x20\x20'+a35_0x5d6580[_0x51963d(0x266)](_0x72eabb));}}}for(const _0x2cdcc0 of _0xb3cce4){console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x278)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x2cdcc0[_0x51963d(0x253)])),_0x51548f++;}const _0x46cd1f=[];if(_0x188155>0x0)_0x46cd1f[_0x51963d(0x23a)](_0x188155+_0x51963d(0x265));if(_0x1571f7>0x0)_0x46cd1f[_0x51963d(0x23a)](_0x1571f7+_0x51963d(0x256));if(_0x29c6a2>0x0)_0x46cd1f['push'](_0x29c6a2+_0x51963d(0x268));const _0x41770f=[];if(_0x3104b1>0x0)_0x41770f[_0x51963d(0x23a)](_0x3104b1+_0x51963d(0x265));if(_0xeb411d>0x0)_0x41770f[_0x51963d(0x23a)](_0xeb411d+'\x20updated');if(_0x51548f>0x0)_0x41770f['push'](_0x51548f+_0x51963d(0x268));const _0x67b9d3=[];if(_0x38a659>0x0)_0x67b9d3[_0x51963d(0x23a)](_0x38a659+'\x20created');if(_0x1c20ec>0x0)_0x67b9d3['push'](_0x1c20ec+_0x51963d(0x256));if(_0x3afd67>0x0)_0x67b9d3[_0x51963d(0x23a)](_0x3afd67+_0x51963d(0x268));console[_0x51963d(0x270)](a35_0x5d6580[_0x51963d(0x259)](_0x51963d(0x223)));_0x46cd1f[_0x51963d(0x255)]>0x0&&!_0x586acc[_0x51963d(0x1fa)]&&console[_0x51963d(0x270)]('\x20\x20Segments:\x20'+_0x46cd1f[_0x51963d(0x24b)](',\x20'));_0x41770f['length']>0x0&&console['error'](_0x51963d(0x202)+_0x41770f[_0x51963d(0x24b)](',\x20'));_0x67b9d3['length']>0x0&&!_0x586acc[_0x51963d(0x1fa)]&&console[_0x51963d(0x270)](_0x51963d(0x267)+_0x67b9d3['join'](',\x20'));if(_0x2d35a3){const _0x172a3a=getConsoleNextUrl(_0x586acc[_0x51963d(0x264)],_0x51963d(0x25d)+_0x169f03+_0x51963d(0x1eb)+_0x2d35a3+_0x51963d(0x22c));console[_0x51963d(0x270)](_0x51963d(0x205)+a35_0x5d6580[_0x51963d(0x266)](_0x172a3a));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a36_0x549b65=a36_0x559a;(function(_0x5bcab7,_0x20a9eb){const _0x532ef6=a36_0x559a,_0x540101=_0x5bcab7();while(!![]){try{const _0x277e74=parseInt(_0x532ef6(0x146))/0x1+-parseInt(_0x532ef6(0x13d))/0x2*(-parseInt(_0x532ef6(0x13e))/0x3)+parseInt(_0x532ef6(0x128))/0x4+-parseInt(_0x532ef6(0x122))/0x5*(parseInt(_0x532ef6(0x12f))/0x6)+-parseInt(_0x532ef6(0x11e))/0x7*(parseInt(_0x532ef6(0x125))/0x8)+parseInt(_0x532ef6(0x114))/0x9*(-parseInt(_0x532ef6(0x124))/0xa)+parseInt(_0x532ef6(0x143))/0xb;if(_0x277e74===_0x20a9eb)break;else _0x540101['push'](_0x540101['shift']());}catch(_0x398647){_0x540101['push'](_0x540101['shift']());}}}(a36_0xbb5e,0x72576));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';function a36_0x559a(_0x307977,_0xa2b9f){_0x307977=_0x307977-0x114;const _0xbb5e5c=a36_0xbb5e();let _0x559a0b=_0xbb5e5c[_0x307977];return _0x559a0b;}import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';function a36_0xbb5e(){const _0xb4ff69=['\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Parent\x20ID:\x20','rule','9877UGBlTX','✔\x20Updated\x20segment\x20\x27','ruleFile','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','87095WjBNHK','segment','2390eVamZF','2864QUASIW','error','Resolved\x20type:\x20','293056WwemPh','verbose','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','data','type','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','segment:update','12nkrtRk','Segment\x20ID:\x20','description','execute','Updating\x20segment\x20\x27','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','resolvePathToResource','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','Resolving\x20path\x20\x27','name','parentId','Resolving\x20folder\x20\x27','INTERNAL','resolveFolderId','4EnMYxc','111678KVuqdc','yellow','kind','segmentId','\x27...','13107006eQktWf','folder','\x20\x20\x20Path:\x20','446523zFVRkD','Error:\x20Cannot\x20update\x20','29277kTOXGS','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','includes','Resolved\x20folder\x20ID:\x20','Resolved\x20relative\x20path\x20to:\x20','Examples:','Update\x20existing\x20child\x20segment'];a36_0xbb5e=function(){return _0xb4ff69;};return a36_0xbb5e();}import a36_0x13ec96 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a36_0x549b65(0x138)]=a36_0x549b65(0x12e);[a36_0x549b65(0x131)]=a36_0x549b65(0x11a);async[a36_0x549b65(0x132)](_0x3e8560){const _0x2760ab=a36_0x549b65;console['error'](a36_0x13ec96[_0x2760ab(0x13f)](_0x2760ab(0x121))),console[_0x2760ab(0x126)](a36_0x13ec96[_0x2760ab(0x13f)](_0x2760ab(0x134)));const {options:_0x2645af,args:_0x43c70f,tdx:_0x253f99}=_0x3e8560,_0x3bd744=_0x2645af;if(_0x43c70f['length']===0x0)return console[_0x2760ab(0x126)](_0x2760ab(0x12a)),console['error'](_0x2760ab(0x12d)),console[_0x2760ab(0x126)](_0x2760ab(0x119)),console[_0x2760ab(0x126)](_0x2760ab(0x11b)),console[_0x2760ab(0x126)](_0x2760ab(0x115)),0x1;const _0x41bf0b=_0x43c70f[0x0],_0x57d9e7=_0x2645af['segmentPath'];let _0xe48436=_0x41bf0b;_0x57d9e7&&!_0x41bf0b[_0x2760ab(0x116)]('/')&&(_0xe48436=_0x57d9e7+'/'+_0x41bf0b,_0x3bd744[_0x2760ab(0x129)]&&console[_0x2760ab(0x126)](_0x2760ab(0x118)+_0xe48436));const _0x1a8c4e=await withSpinner(_0x2760ab(0x137)+_0xe48436+_0x2760ab(0x142),()=>_0x253f99['segment'][_0x2760ab(0x135)](_0xe48436),{'verbose':_0x3bd744['verbose']}),_0x795be=_0x1a8c4e[_0x2760ab(0x12b)];_0x3bd744[_0x2760ab(0x129)]&&console[_0x2760ab(0x126)](_0x2760ab(0x127)+_0x795be[_0x2760ab(0x12c)]);if(_0x795be[_0x2760ab(0x12c)]!=='segment')return console[_0x2760ab(0x126)](_0x2760ab(0x147)+_0x795be[_0x2760ab(0x12c)]+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0x2760ab(0x136)),0x1;if(!_0x795be[_0x2760ab(0x141)])throw new SDKError(ErrorCode[_0x2760ab(0x13b)],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x591c45=_0x795be[_0x2760ab(0x139)],_0x45018a=_0x795be[_0x2760ab(0x141)];_0x3bd744[_0x2760ab(0x129)]&&(console['error'](_0x2760ab(0x11c)+_0x591c45),console[_0x2760ab(0x126)](_0x2760ab(0x130)+_0x45018a));let _0x52d0de;if(_0x3bd744['folder']){const _0x3713a6=_0x3bd744[_0x2760ab(0x144)],_0x15a0a4=await withSpinner(_0x2760ab(0x13a)+_0x3713a6+_0x2760ab(0x142),()=>_0x253f99['segment'][_0x2760ab(0x13c)](_0x591c45,_0x3713a6),{'verbose':_0x3bd744[_0x2760ab(0x129)]});_0x52d0de=parseInt(_0x15a0a4[_0x2760ab(0x12b)],0xa),_0x3bd744[_0x2760ab(0x129)]&&console[_0x2760ab(0x126)](_0x2760ab(0x117)+_0x52d0de);}const _0x3be088=await loadJSONFromOptions(_0x3bd744[_0x2760ab(0x11d)],_0x3bd744[_0x2760ab(0x120)]),_0x615312={'name':_0x3bd744[_0x2760ab(0x138)],'description':_0x3bd744[_0x2760ab(0x131)],'rule':_0x3be088,'kind':_0x3bd744[_0x2760ab(0x140)]!==undefined?parseInt(_0x3bd744[_0x2760ab(0x140)],0xa):undefined,'segmentFolderId':_0x52d0de},_0x3b7312=await withSpinner(_0x2760ab(0x133)+_0x795be['segmentName']+'\x27...',()=>_0x253f99[_0x2760ab(0x123)]['updateSegmentById'](_0x591c45,_0x45018a,_0x615312),{'verbose':_0x3bd744[_0x2760ab(0x129)]}),_0x379087=_0x3b7312[_0x2760ab(0x12b)];return console[_0x2760ab(0x126)](_0x2760ab(0x11f)+_0x379087[_0x2760ab(0x138)]+'\x27'),_0xe48436!==_0x41bf0b&&console['error'](_0x2760ab(0x145)+_0xe48436),await handleSDKOutput([_0x379087],_0x3bd744),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a37_0x4d44ef=a37_0x5743;(function(_0x5d4574,_0x3d62ee){const _0x413b78=a37_0x5743,_0x9a04e7=_0x5d4574();while(!![]){try{const _0x5e7ca7=-parseInt(_0x413b78(0x10a))/0x1*(parseInt(_0x413b78(0x10f))/0x2)+-parseInt(_0x413b78(0x125))/0x3*(-parseInt(_0x413b78(0x108))/0x4)+-parseInt(_0x413b78(0x11d))/0x5+parseInt(_0x413b78(0x132))/0x6*(parseInt(_0x413b78(0x103))/0x7)+parseInt(_0x413b78(0x102))/0x8*(parseInt(_0x413b78(0x115))/0x9)+-parseInt(_0x413b78(0x131))/0xa+parseInt(_0x413b78(0x137))/0xb;if(_0x5e7ca7===_0x3d62ee)break;else _0x9a04e7['push'](_0x9a04e7['shift']());}catch(_0x1a1112){_0x9a04e7['push'](_0x9a04e7['shift']());}}}(a37_0x49ed,0xbd1dc));function a37_0x49ed(){const _0x102451=['179097MtBhkr','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','join','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','✔\x20Context\x20set\x20to:\x20','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','Target\x20path:\x20','slice','log','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','12816020HJLhFe','24UneHNw','isAbsolute','split','segmentPath','execute','11874137JsGMmW','Folder\x20ID:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','verbose','Resolved\x20path\x20type:\x20','dim','64DqzJox','732886yxbAVF','parent_segment','description','folderPath','Resolved\x20relative\x20path\x20to:\x20','40AMYLYz','length','2lGZRQd','green','segments','segment','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','976026WjOCyp','error','type','Parent\x20ID:\x20','site','fullPath','1341477hoeuRW','\x27...','cyan','Resolving\x20path\x20\x27','session','resolvePathToResource','folderId','Examples:','1277125WppuIH','config','Use:\x20tdx\x20segment\x20use\x20','segment:use','parentName','red','data','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>'];a37_0x49ed=function(){return _0x102451;};return a37_0x49ed();}import{existsSync,statSync}from'fs';import a37_0x950b7e from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';function a37_0x5743(_0x9ba9cb,_0x492638){_0x9ba9cb=_0x9ba9cb-0x101;const _0x49ed72=a37_0x49ed();let _0x5743d5=_0x49ed72[_0x9ba9cb];return _0x5743d5;}import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{['name']=a37_0x4d44ef(0x120);[a37_0x4d44ef(0x105)]='Set\x20current\x20segment/folder\x20context\x20for\x20navigation';async[a37_0x4d44ef(0x136)](_0x4de4d0){const _0xf2cb64=a37_0x4d44ef,{options:_0x4f05e9,args:_0x1ea2a1,tdx:_0x43b308}=_0x4de4d0;if(_0x1ea2a1[_0xf2cb64(0x109)]===0x0)return console[_0xf2cb64(0x110)](a37_0x950b7e[_0xf2cb64(0x122)]('Error:\x20Path\x20is\x20required\x0a')),console[_0xf2cb64(0x110)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0xf2cb64(0x110)](_0xf2cb64(0x11c)),console[_0xf2cb64(0x110)]('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console[_0xf2cb64(0x110)](_0xf2cb64(0x139)),console[_0xf2cb64(0x110)](_0xf2cb64(0x126)),console[_0xf2cb64(0x110)]('\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent'),0x1;const _0xeb9a76=_0x1ea2a1[0x0],_0x538a1e=_0x4f05e9[_0xf2cb64(0x119)];try{if(_0xeb9a76==='/')return saveSessionContext({'segment_path':undefined},_0x538a1e),console[_0xf2cb64(0x12e)](a37_0x950b7e[_0xf2cb64(0x10b)](_0xf2cb64(0x10e))),0x0;if(existsSync(_0xeb9a76)&&statSync(_0xeb9a76)['isDirectory']()){let _0xdcd2e1;try{_0xdcd2e1=findTdxConfig(_0xeb9a76);}catch{return console[_0xf2cb64(0x110)](a37_0x950b7e[_0xf2cb64(0x122)](_0xf2cb64(0x12a)+_0xeb9a76)),console[_0xf2cb64(0x110)](a37_0x950b7e['cyan'](_0xf2cb64(0x12b))),0x1;}const _0x2170cf=_0xdcd2e1[_0xf2cb64(0x11e)][_0xf2cb64(0x104)];return saveSessionContext({'segment_path':_0x2170cf,'parent_segment':_0x2170cf},_0x538a1e),console['log'](a37_0x950b7e[_0xf2cb64(0x10b)](_0xf2cb64(0x129)+a37_0x950b7e[_0xf2cb64(0x117)](_0x2170cf))),0x0;}const _0xdb3ce=_0x4f05e9[_0xf2cb64(0x135)];let _0x53019f=_0xeb9a76;const _0x5ba9ad=parsePath(_0xeb9a76);if(!_0x5ba9ad[_0xf2cb64(0x133)]){if(!_0xdb3ce)return console[_0xf2cb64(0x110)](a37_0x950b7e[_0xf2cb64(0x122)](_0xf2cb64(0x130))),console[_0xf2cb64(0x110)](a37_0x950b7e[_0xf2cb64(0x117)](_0xf2cb64(0x124))),0x1;if(_0xeb9a76==='..'){const _0x7645ee=_0xdb3ce[_0xf2cb64(0x134)]('/')[_0xf2cb64(0x12d)](0x0,-0x1)[_0xf2cb64(0x127)]('/');_0x53019f=_0x7645ee||'/';}else _0xeb9a76==='.'?_0x53019f=_0xdb3ce:_0x53019f=_0xdb3ce+'/'+_0xeb9a76;_0x4f05e9[_0xf2cb64(0x13b)]&&console[_0xf2cb64(0x110)](_0xf2cb64(0x107)+_0x53019f);}if(_0x53019f==='/'||_0x53019f==='')return saveSessionContext({'segment_path':undefined},_0x538a1e),console[_0xf2cb64(0x12e)](a37_0x950b7e[_0xf2cb64(0x10b)](_0xf2cb64(0x10e))),0x0;_0x53019f=normalizePath(_0x53019f);const _0xd14017=parsePath(_0x53019f)[_0xf2cb64(0x10c)];if(_0xd14017[_0xf2cb64(0x109)]===0x0)return saveSessionContext({'segment_path':undefined},_0x538a1e),console[_0xf2cb64(0x12e)](a37_0x950b7e['green'](_0xf2cb64(0x10e))),0x0;_0x4f05e9[_0xf2cb64(0x13b)]&&(console[_0xf2cb64(0x110)]('Site:\x20'+_0x4f05e9[_0xf2cb64(0x113)]),console[_0xf2cb64(0x110)](_0xf2cb64(0x12c)+_0x53019f));const _0x39eee2=await withSpinner(_0xf2cb64(0x118)+_0x53019f+_0xf2cb64(0x116),()=>_0x43b308[_0xf2cb64(0x10d)][_0xf2cb64(0x11a)](_0x53019f),{'verbose':_0x4f05e9['verbose']}),_0xf5bfd5=_0x39eee2[_0xf2cb64(0x123)];_0x4f05e9[_0xf2cb64(0x13b)]&&(console[_0xf2cb64(0x110)](_0xf2cb64(0x13c)+_0xf5bfd5['type']),console['error'](_0xf2cb64(0x112)+_0xf5bfd5['parentId']),_0xf5bfd5['folderId']&&console['error'](_0xf2cb64(0x138)+_0xf5bfd5[_0xf2cb64(0x11b)]));if(_0xf5bfd5[_0xf2cb64(0x111)]===_0xf2cb64(0x10d))return console['error'](a37_0x950b7e[_0xf2cb64(0x122)](_0xf2cb64(0x12f))),console[_0xf2cb64(0x110)](_0xf2cb64(0x128)),console[_0xf2cb64(0x110)](a37_0x950b7e['cyan'](_0xf2cb64(0x11f)+_0xf5bfd5['parentName']+(_0xf5bfd5[_0xf2cb64(0x106)]?'/'+_0xf5bfd5['folderPath']['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0xf5bfd5['fullPath'],'parent_segment':_0xf5bfd5[_0xf2cb64(0x121)]},_0x538a1e),console['log'](a37_0x950b7e[_0xf2cb64(0x10b)](_0xf2cb64(0x129)+a37_0x950b7e['cyan'](_0xf5bfd5[_0xf2cb64(0x114)]))),_0x4f05e9[_0xf2cb64(0x13b)]&&(console[_0xf2cb64(0x110)](a37_0x950b7e[_0xf2cb64(0x101)](_0xf2cb64(0x13a))),console[_0xf2cb64(0x110)](a37_0x950b7e[_0xf2cb64(0x101)]('Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters'))),0x0;}catch(_0xb697b5){throw _0xb697b5;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function a38_0x57a7(){const _0x2c2552=['Error:\x20Directory\x20not\x20found:\x20','96336fZclgF','red','.yml','name','336445ONbYDi','1184932IShRaA','log','dim','695508WqoGHa','yellow','endsWith','length','\x20file(s)\x20with\x20errors,\x20','571184SjrZNn','Error:\x20','no_parent','valid','269EdpyBp','hasErrors','\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','type','validCount','Validation\x20failed:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','description','green','\x20valid','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)','segment:validate','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','warningCount','):\x20','verbose','filePath','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','cwd','155610eulAgf','parentSegment','errors','cyan','file','2118nFwOrB','error','\x20warning(s)\x20found','6NDrBWy','execute','helpText','warnings'];a38_0x57a7=function(){return _0x2c2552;};return a38_0x57a7();}const a38_0x51d3e8=a38_0x318f;(function(_0x1abf1c,_0x4ca27c){const _0x385523=a38_0x318f,_0x543e63=_0x1abf1c();while(!![]){try{const _0x5be758=-parseInt(_0x385523(0x158))/0x1*(-parseInt(_0x385523(0x170))/0x2)+parseInt(_0x385523(0x14f))/0x3+-parseInt(_0x385523(0x14c))/0x4+-parseInt(_0x385523(0x14b))/0x5*(parseInt(_0x385523(0x173))/0x6)+-parseInt(_0x385523(0x16b))/0x7+parseInt(_0x385523(0x154))/0x8+-parseInt(_0x385523(0x147))/0x9;if(_0x5be758===_0x4ca27c)break;else _0x543e63['push'](_0x543e63['shift']());}catch(_0x225ad7){_0x543e63['push'](_0x543e63['shift']());}}}(a38_0x57a7,0x2eca1));import{BaseCommand}from'./command.js';function a38_0x318f(_0x5ba4ce,_0x4df222){_0x5ba4ce=_0x5ba4ce-0x146;const _0x57a7f6=a38_0x57a7();let _0x318f23=_0x57a7f6[_0x5ba4ce];return _0x318f23;}import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a38_0x4c5fb8 from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a38_0x51d3e8(0x14a)]=a38_0x51d3e8(0x163);[a38_0x51d3e8(0x15f)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a38_0x51d3e8(0x174)](_0x438c2e){const _0x47ddc1=a38_0x51d3e8,{options:_0x5f19b8,args:_0x19df6f}=_0x438c2e,_0x2aacb6=_0x5f19b8,_0x5b56fb=await resolveTarget({'arg':_0x19df6f[0x0],'contextParent':_0x5f19b8[_0x47ddc1(0x16c)],'cwd':process[_0x47ddc1(0x16a)]()});if(!isSuccessfulResolution(_0x5b56fb))return _0x5b56fb['errorCode']===_0x47ddc1(0x156)?(console['error'](a38_0x4c5fb8[_0x47ddc1(0x150)](_0x47ddc1(0x164))),console[_0x47ddc1(0x171)](_0x47ddc1(0x162)),console[_0x47ddc1(0x171)](_0x47ddc1(0x15a)),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console['error'](a38_0x4c5fb8[_0x47ddc1(0x148)](_0x47ddc1(0x155)+_0x5b56fb['message']+'\x0a')),_0x5b56fb['helpText']&&console[_0x47ddc1(0x171)](a38_0x4c5fb8[_0x47ddc1(0x16e)](_0x5b56fb[_0x47ddc1(0x175)]))),0x1;const _0xb5fe15=_0x5b56fb['targetDir'],_0x1e73a7=_0x5b56fb[_0x47ddc1(0x15b)]===_0x47ddc1(0x16f)?_0x5b56fb[_0x47ddc1(0x168)]:undefined;if(!_0x1e73a7&&!existsSync(_0xb5fe15))return console[_0x47ddc1(0x171)](a38_0x4c5fb8[_0x47ddc1(0x148)](_0x47ddc1(0x146)+_0xb5fe15+'\x0a')),0x1;let _0x5aac3c;if(_0x1e73a7){if(!_0x1e73a7[_0x47ddc1(0x151)](_0x47ddc1(0x149))&&!_0x1e73a7[_0x47ddc1(0x151)]('.yaml'))return console[_0x47ddc1(0x171)](a38_0x4c5fb8[_0x47ddc1(0x148)](_0x47ddc1(0x15e)+_0x1e73a7+'\x0a')),0x1;_0x5aac3c=[_0x1e73a7];}else _0x5aac3c=findYamlFiles(_0xb5fe15);if(_0x5aac3c[_0x47ddc1(0x152)]===0x0)return console[_0x47ddc1(0x171)](a38_0x4c5fb8[_0x47ddc1(0x148)](_0x47ddc1(0x169)+_0xb5fe15+'\x0a')),0x1;const _0x478571=validateYamlFiles(_0x5aac3c,_0xb5fe15),_0xfe1bab=calculateSummary(_0x478571);for(const _0x47f084 of _0x478571){if(!isValidationResult(_0x47f084))continue;const {relativePath:_0x2cbc25,source:_0x5d73e7,result:_0x1319f5,fileType:_0x40fd68}=_0x47f084,_0x1c54e0=_0x40fd68;if(_0x1319f5[_0x47ddc1(0x157)]&&_0x1319f5[_0x47ddc1(0x176)]['length']===0x0)_0x2aacb6[_0x47ddc1(0x167)]&&console[_0x47ddc1(0x14d)](a38_0x4c5fb8[_0x47ddc1(0x160)]('✔\x20'+_0x2cbc25)+a38_0x4c5fb8['dim']('\x20('+_0x1c54e0+')'));else _0x1319f5[_0x47ddc1(0x157)]?(console['log'](a38_0x4c5fb8[_0x47ddc1(0x150)]('⚠\x20'+_0x2cbc25)+a38_0x4c5fb8[_0x47ddc1(0x14e)]('\x20('+_0x1c54e0+_0x47ddc1(0x166)+_0x1319f5[_0x47ddc1(0x176)]['length']+'\x20warning(s)')),console[_0x47ddc1(0x14d)](formatValidationResult(_0x1319f5,_0x5d73e7,_0x2cbc25))):(console[_0x47ddc1(0x14d)](a38_0x4c5fb8[_0x47ddc1(0x148)]('✖\x20'+_0x2cbc25)+a38_0x4c5fb8[_0x47ddc1(0x14e)]('\x20('+_0x1c54e0+_0x47ddc1(0x166)+_0x1319f5[_0x47ddc1(0x16d)][_0x47ddc1(0x152)]+'\x20error(s)')),console[_0x47ddc1(0x14d)](formatValidationResult(_0x1319f5,_0x5d73e7,_0x2cbc25)));}return console[_0x47ddc1(0x14d)](''),_0xfe1bab[_0x47ddc1(0x159)]?(console[_0x47ddc1(0x14d)](a38_0x4c5fb8[_0x47ddc1(0x148)](_0x47ddc1(0x15d)+_0xfe1bab['invalidCount']+_0x47ddc1(0x153)+_0xfe1bab[_0x47ddc1(0x15c)]+_0x47ddc1(0x161))),_0xfe1bab[_0x47ddc1(0x165)]>0x0&&console[_0x47ddc1(0x14d)](a38_0x4c5fb8[_0x47ddc1(0x150)](_0xfe1bab[_0x47ddc1(0x165)]+'\x20warning(s)\x20found')),0x1):(console['log'](a38_0x4c5fb8[_0x47ddc1(0x160)]('✔\x20All\x20'+_0xfe1bab[_0x47ddc1(0x15c)]+'\x20file(s)\x20valid')),_0xfe1bab[_0x47ddc1(0x165)]>0x0&&console[_0x47ddc1(0x14d)](a38_0x4c5fb8[_0x47ddc1(0x150)](_0xfe1bab[_0x47ddc1(0x165)]+_0x47ddc1(0x172))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a39_0x446de6=a39_0x50ec;(function(_0xedf527,_0x99b2){const _0x2ddff7=a39_0x50ec,_0x2a04a1=_0xedf527();while(!![]){try{const _0x177a30=-parseInt(_0x2ddff7(0xba))/0x1*(-parseInt(_0x2ddff7(0xeb))/0x2)+parseInt(_0x2ddff7(0xe6))/0x3+-parseInt(_0x2ddff7(0xe3))/0x4+-parseInt(_0x2ddff7(0xce))/0x5+-parseInt(_0x2ddff7(0xaf))/0x6*(parseInt(_0x2ddff7(0xec))/0x7)+parseInt(_0x2ddff7(0xc7))/0x8*(-parseInt(_0x2ddff7(0xd7))/0x9)+parseInt(_0x2ddff7(0xd9))/0xa*(-parseInt(_0x2ddff7(0xac))/0xb);if(_0x177a30===_0x99b2)break;else _0x2a04a1['push'](_0x2a04a1['shift']());}catch(_0x3b8f28){_0x2a04a1['push'](_0x2a04a1['shift']());}}}(a39_0x5edb,0x5d965));import{BaseCommand}from'./command.js';function a39_0x50ec(_0x3d08f3,_0x33e7e8){_0x3d08f3=_0x3d08f3-0xa7;const _0x5edbeb=a39_0x5edb();let _0x50ec99=_0x5edbeb[_0x3d08f3];return _0x50ec99;}import{SDKError}from'../sdk/index.js';function a39_0x5edb(){const _0xe4e8bd=['/e/','log','Resolving\x20path\x20\x27','✔\x20Found\x20','length','test','Recursive\x20mode:\x20enabled','localeCompare','folders','\x20folder','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','1644592SBGhlZ','parentId','json','Parent\x20segment\x20context:\x20','Parent\x20ID:\x20','name','\x20\x20Cause:\x20','98675SNHJSs','listRecursive','format','Site:\x20','verbose','Error:\x20','folder','\x27...','execute','9MmQQhJ','journey','1696220TJnsHK',',\x20and\x20','map','type','error','✔\x20Built\x20tree\x20with\x20','journeys','parentSegment','jsonl','site','755396BbZLbt','resolvePathToResource','\x20segment','2145354zQiPGx','sort','cause','segment','listUnifiedWithJourneys','1532uZdacj','21BEsmtt','Building\x20hierarchy\x20tree...','replace','Set\x20a\x20parent\x20segment\x20context\x20first:','data','/app/ps/','dim','Resolving\x20parent\x20segment\x20\x27','includes','Folder/pattern\x20arg:\x20','11IuJNSV','folderId','segments','899322jAAVKp','listWithPattern','\x5c$&','\x20journey','listUnified','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.',']\x20matching\x20\x27','(not\x20set)','journeyBundleName','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','Folder\x20ID:\x20','916XIAqkK','filter'];a39_0x5edb=function(){return _0xe4e8bd;};return a39_0x5edb();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a39_0x5ab481 from'chalk';export class SegmentsCommand extends BaseCommand{[a39_0x446de6(0xcc)]=a39_0x446de6(0xae);['description']='List\x20folders\x20and\x20child\x20segments';async[a39_0x446de6(0xd6)](_0x2c4cd7){const _0x3f36da=a39_0x446de6,{options:_0x1ba583,args:_0x4aeb4a}=_0x2c4cd7,_0x3de908=_0x1ba583['recursive'],_0x20a16f=_0x4aeb4a[0x0];try{const _0x38da4e=_0x1ba583[_0x3f36da(0xe0)];_0x1ba583[_0x3f36da(0xd2)]&&(console[_0x3f36da(0xdd)](_0x3f36da(0xd1)+_0x1ba583[_0x3f36da(0xe2)]),console[_0x3f36da(0xdd)](_0x3f36da(0xca)+(_0x38da4e||_0x3f36da(0xb6))),_0x20a16f&&console[_0x3f36da(0xdd)](_0x3f36da(0xab)+_0x20a16f),_0x3de908&&console[_0x3f36da(0xdd)](_0x3f36da(0xc2)));if(!_0x38da4e)return console['error']('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x3f36da(0xdd)](_0x3f36da(0xef)),console['error'](_0x3f36da(0xc6)),console[_0x3f36da(0xdd)](_0x3f36da(0xb8)),console[_0x3f36da(0xdd)](''),console['error'](_0x3f36da(0xb4)),0x1;const _0x294a09=_0x20a16f&&(_0x20a16f[_0x3f36da(0xaa)]('*')||_0x20a16f[_0x3f36da(0xaa)]('?'));if(_0x294a09)return await this[_0x3f36da(0xb0)](_0x2c4cd7,_0x38da4e,_0x20a16f);const _0x488e07=_0x20a16f?_0x38da4e+'/'+_0x20a16f:_0x38da4e;return _0x3de908?await this[_0x3f36da(0xcf)](_0x2c4cd7,_0x488e07):await this[_0x3f36da(0xb3)](_0x2c4cd7,_0x488e07);}catch(_0x395dac){if(_0x395dac instanceof SDKError)return console['error'](_0x3f36da(0xd3)+_0x395dac['message']),_0x395dac[_0x3f36da(0xe8)]&&console[_0x3f36da(0xdd)](_0x3f36da(0xcd)+_0x395dac[_0x3f36da(0xe8)]),0x1;throw _0x395dac;}}async[a39_0x446de6(0xb0)](_0x4662a4,_0x279640,_0x34ac03){const _0x29ae95=a39_0x446de6,{options:_0xe54024,tdx:_0xf132f3}=_0x4662a4,_0x54b5b=await withSpinner(_0x29ae95(0xa9)+_0x279640+_0x29ae95(0xd5),()=>_0xf132f3[_0x29ae95(0xe9)][_0x29ae95(0xe4)](_0x279640),{'verbose':_0xe54024['verbose']}),_0x3f8433=_0x54b5b['data'],_0x37a5ef=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0xf132f3['segment'][_0x29ae95(0xea)](_0x3f8433['parentId'],_0x3f8433[_0x29ae95(0xad)]),{'verbose':_0xe54024[_0x29ae95(0xd2)]}),{folders:_0x5d8415,segments:_0x50eb44,journeys:_0x4e6f6a}=_0x37a5ef[_0x29ae95(0xf0)],_0x274128=_0x34ac03[_0x29ae95(0xee)](/[.+^${}()|[\]\\]/g,_0x29ae95(0xb1))[_0x29ae95(0xee)](/\*/g,'.*')[_0x29ae95(0xee)](/\?/g,'.'),_0x18db44=new RegExp('^'+_0x274128+'$','i'),_0x40c19e=_0x5d8415[_0x29ae95(0xbb)](_0xdd5b3a=>_0x18db44['test'](_0xdd5b3a[_0x29ae95(0xcc)])),_0x49162e=_0x50eb44[_0x29ae95(0xbb)](_0x41db33=>_0x18db44[_0x29ae95(0xc1)](_0x41db33['name'])),_0x1ea8f8=_0x4e6f6a[_0x29ae95(0xbb)](_0x26acbe=>_0x18db44[_0x29ae95(0xc1)](_0x26acbe[_0x29ae95(0xb7)])),_0xb01b16=_0x40c19e['length']+_0x49162e[_0x29ae95(0xc0)]+_0x1ea8f8['length'];console[_0x29ae95(0xdd)](_0x29ae95(0xbf)+_0x40c19e[_0x29ae95(0xc0)]+_0x29ae95(0xc5)+(_0x40c19e[_0x29ae95(0xc0)]!==0x1?'s':'')+',\x20'+_0x49162e['length']+_0x29ae95(0xe5)+(_0x49162e['length']!==0x1?'s':'')+_0x29ae95(0xda)+_0x1ea8f8[_0x29ae95(0xc0)]+_0x29ae95(0xb2)+(_0x1ea8f8[_0x29ae95(0xc0)]!==0x1?'s':'')+'\x20matching\x20\x27'+_0x34ac03+'\x27');const _0x4d61b2=_0x4fb862=>{const _0x4b88b8=_0x29ae95;return getConsoleNextUrl(_0xe54024[_0x4b88b8(0xe2)],_0x4b88b8(0xa7)+_0x3f8433[_0x4b88b8(0xc8)]+_0x4b88b8(0xbc)+_0x4fb862);},_0x32d1e8=_0xe54024[_0x29ae95(0xd0)]==='json'||_0xe54024[_0x29ae95(0xd0)]===_0x29ae95(0xe1);if(_0x32d1e8){const _0x1f7409=[..._0x40c19e[_0x29ae95(0xdb)](_0x561929=>({..._0x561929,'type':_0x29ae95(0xd4)})),..._0x49162e[_0x29ae95(0xdb)](_0x5e9461=>({..._0x5e9461,'type':_0x29ae95(0xe9),'url':_0x4d61b2(_0x5e9461['id'])})),..._0x1ea8f8[_0x29ae95(0xdb)](_0x3f18c2=>({..._0x3f18c2,'name':_0x3f18c2[_0x29ae95(0xb7)],'type':'journey'}))][_0x29ae95(0xe7)]((_0x1ad73d,_0x4987f3)=>_0x1ad73d['name'][_0x29ae95(0xc3)](_0x4987f3['name']));await handleSDKOutput(_0x1f7409,_0xe54024);}else{if(_0xb01b16===0x0)console[_0x29ae95(0xbd)]('No\x20items\x20match\x20pattern:\x20'+_0x34ac03);else{console['log'](a39_0x5ab481[_0x29ae95(0xa8)]('['+_0x279640+_0x29ae95(0xb5)+_0x34ac03+'\x27'));const _0x5969be=formatFlatList(_0x40c19e,_0x49162e,{'showMetadata':!![],'getSegmentUrl':_0x4d61b2},_0x1ea8f8);console[_0x29ae95(0xbd)](_0x5969be);}}return 0x0;}async[a39_0x446de6(0xb3)](_0x354b88,_0x5e08dd){const _0x15857c=a39_0x446de6,{options:_0x30e66f,tdx:_0x8e4188}=_0x354b88,_0x38b4bd=await withSpinner(_0x15857c(0xbe)+_0x5e08dd+_0x15857c(0xd5),()=>_0x8e4188['segment']['resolvePathToResource'](_0x5e08dd),{'verbose':_0x30e66f[_0x15857c(0xd2)]}),_0x5a13be=_0x38b4bd[_0x15857c(0xf0)];_0x30e66f[_0x15857c(0xd2)]&&(console['error'](_0x15857c(0xcb)+_0x5a13be[_0x15857c(0xc8)]),_0x5a13be[_0x15857c(0xad)]&&console[_0x15857c(0xdd)]('Folder\x20ID:\x20'+_0x5a13be['folderId']));const _0x57095e=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x8e4188[_0x15857c(0xe9)][_0x15857c(0xea)](_0x5a13be[_0x15857c(0xc8)],_0x5a13be[_0x15857c(0xad)]),{'verbose':_0x30e66f[_0x15857c(0xd2)]}),{folders:_0x1403f3,segments:_0x2a1960,journeys:_0x23ed77}=_0x57095e[_0x15857c(0xf0)],_0x540c3b=_0x1403f3[_0x15857c(0xc0)]+_0x2a1960[_0x15857c(0xc0)]+_0x23ed77[_0x15857c(0xc0)];console['error']('✔\x20Found\x20'+_0x1403f3[_0x15857c(0xc0)]+_0x15857c(0xc5)+(_0x1403f3[_0x15857c(0xc0)]!==0x1?'s':'')+',\x20'+_0x2a1960[_0x15857c(0xc0)]+_0x15857c(0xe5)+(_0x2a1960[_0x15857c(0xc0)]!==0x1?'s':'')+_0x15857c(0xda)+_0x23ed77['length']+_0x15857c(0xb2)+(_0x23ed77[_0x15857c(0xc0)]!==0x1?'s':''));const _0x812c6e=_0x557265=>{const _0x1747c1=_0x15857c;return getConsoleNextUrl(_0x30e66f[_0x1747c1(0xe2)],_0x1747c1(0xa7)+_0x5a13be[_0x1747c1(0xc8)]+_0x1747c1(0xbc)+_0x557265);},_0x240aba=_0x4eb4ef=>{const _0x35288f=_0x15857c;return getConsoleNextUrl(_0x30e66f['site'],_0x35288f(0xa7)+_0x5a13be[_0x35288f(0xc8)]+'/e/'+_0x4eb4ef+'/j/da');},_0x22f01d=_0x30e66f[_0x15857c(0xd0)]===_0x15857c(0xc9)||_0x30e66f[_0x15857c(0xd0)]===_0x15857c(0xe1);if(_0x22f01d){const _0x15bf53=[..._0x1403f3[_0x15857c(0xdb)](_0x195b6b=>({..._0x195b6b,'type':_0x15857c(0xd4)})),..._0x2a1960[_0x15857c(0xdb)](_0x335ac8=>({..._0x335ac8,'type':_0x15857c(0xe9),'url':_0x812c6e(_0x335ac8['id'])})),..._0x23ed77[_0x15857c(0xdb)](_0x5cec89=>({..._0x5cec89,'name':_0x5cec89[_0x15857c(0xb7)],'type':_0x15857c(0xd8),'url':_0x240aba(_0x5cec89['id'])}))]['sort']((_0x3d8c98,_0x181f1c)=>_0x3d8c98['name']['localeCompare'](_0x181f1c['name']));await handleSDKOutput(_0x15bf53,_0x30e66f);}else{if(_0x540c3b===0x0)console['log'](a39_0x5ab481[_0x15857c(0xa8)]('['+_0x5e08dd+']')),console[_0x15857c(0xbd)]('(empty)');else{console[_0x15857c(0xbd)](a39_0x5ab481['dim']('['+_0x5e08dd+']'));const _0x22c070=formatFlatList(_0x1403f3,_0x2a1960,{'showMetadata':!![],'getSegmentUrl':_0x812c6e,'getJourneyUrl':_0x240aba},_0x23ed77);console['log'](_0x22c070);}}return 0x0;}async[a39_0x446de6(0xcf)](_0x3b794f,_0x3c8bce){const _0x33683d=a39_0x446de6,{options:_0x52edec,tdx:_0x5761f4}=_0x3b794f,_0x5be62d=await withSpinner(_0x33683d(0xbe)+_0x3c8bce+_0x33683d(0xd5),()=>_0x5761f4[_0x33683d(0xe9)][_0x33683d(0xe4)](_0x3c8bce),{'verbose':_0x52edec['verbose']}),_0x55ea5b=_0x5be62d[_0x33683d(0xf0)];_0x52edec['verbose']&&(console[_0x33683d(0xdd)](_0x33683d(0xcb)+_0x55ea5b['parentId']),_0x55ea5b['folderId']&&console[_0x33683d(0xdd)](_0x33683d(0xb9)+_0x55ea5b[_0x33683d(0xad)]));const _0x2010a1=_0x52edec['maxDepth']||0xa,_0x16d34e=await withSpinner(_0x33683d(0xed),()=>_0x5761f4[_0x33683d(0xe9)][_0x33683d(0xcf)](_0x55ea5b['parentId'],_0x55ea5b['folderId'],0x0,_0x2010a1),{'verbose':_0x52edec[_0x33683d(0xd2)]}),_0x1f5b8d=_0x16d34e[_0x33683d(0xf0)],_0x5915e3=_0x330c96=>{const _0x3b955b=_0x33683d;let _0x1f0a21=0x0,_0x36e0a0=0x0,_0x19a9fc=0x0;for(const _0x46c6c2 of _0x330c96){if(_0x46c6c2['type']===_0x3b955b(0xd4))_0x1f0a21++;else{if(_0x46c6c2[_0x3b955b(0xdc)]===_0x3b955b(0xe9))_0x36e0a0++;else{if(_0x46c6c2[_0x3b955b(0xdc)]===_0x3b955b(0xd8))_0x19a9fc++;}}if(_0x46c6c2['children']){const _0x258e77=_0x5915e3(_0x46c6c2['children']);_0x1f0a21+=_0x258e77[_0x3b955b(0xc4)],_0x36e0a0+=_0x258e77[_0x3b955b(0xae)],_0x19a9fc+=_0x258e77[_0x3b955b(0xdf)];}}return{'folders':_0x1f0a21,'segments':_0x36e0a0,'journeys':_0x19a9fc};},_0x37be32=_0x5915e3(_0x1f5b8d);console['error'](_0x33683d(0xde)+_0x37be32[_0x33683d(0xc4)]+_0x33683d(0xc5)+(_0x37be32[_0x33683d(0xc4)]!==0x1?'s':'')+',\x20'+_0x37be32[_0x33683d(0xae)]+'\x20segment'+(_0x37be32[_0x33683d(0xae)]!==0x1?'s':'')+_0x33683d(0xda)+_0x37be32['journeys']+'\x20journey'+(_0x37be32[_0x33683d(0xdf)]!==0x1?'s':''));const _0x25a746=_0x91d15a=>{const _0x2ecada=_0x33683d;return getConsoleNextUrl(_0x52edec['site'],_0x2ecada(0xa7)+_0x55ea5b[_0x2ecada(0xc8)]+_0x2ecada(0xbc)+_0x91d15a);},_0x424dc4=_0x324f3f=>{const _0x3412eb=_0x33683d;return getConsoleNextUrl(_0x52edec[_0x3412eb(0xe2)],'/app/ps/'+_0x55ea5b[_0x3412eb(0xc8)]+_0x3412eb(0xbc)+_0x324f3f+'/j/da');};if(_0x52edec[_0x33683d(0xd0)]==='json'||_0x52edec[_0x33683d(0xd0)]===_0x33683d(0xe1))await handleSDKOutput(_0x1f5b8d,_0x52edec);else{console['log'](a39_0x5ab481[_0x33683d(0xa8)]('['+_0x3c8bce+']'));const _0x12ca08=formatTree(_0x1f5b8d,{'showMetadata':!![],'getSegmentUrl':_0x25a746,'getJourneyUrl':_0x424dc4});console[_0x33683d(0xbd)](_0x12ca08);}return 0x0;}}
|
|
1
|
+
const a39_0x2ff0e3=a39_0xcc31;function a39_0x18d7(){const _0x31bc5a=['\x20journey','Parent\x20segment\x20context:\x20','Folder\x20ID:\x20','2wZBcYP','replace','test','length','verbose','listUnified','folders','874099lZuWUr','/e/','Resolving\x20parent\x20segment\x20\x27','1381311tjghBk','(empty)','folder','data','jsonl','segment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','Parent\x20ID:\x20','json','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Error:\x20','12xyeFLw','10ftJbbH','/j/da','error','No\x20items\x20match\x20pattern:\x20','localeCompare','5487335UeWExf','recursive','message','journey','resolvePathToResource','listRecursive','\x20\x20Cause:\x20','27555jwbDOL','166347pWxskZ','Listing\x20folders,\x20segments,\x20and\x20journeys...',',\x20and\x20','listWithPattern','listUnifiedWithJourneys','/app/ps/','map','parentSegment','cause','folderId','Folder/pattern\x20arg:\x20','10579290eFceuF','children','Set\x20a\x20parent\x20segment\x20context\x20first:','✔\x20Found\x20','type','Resolving\x20path\x20\x27','\x27...','name','sort','journeys','\x5c$&','6996puzghz','\x20matching\x20\x27','filter','format','site','Site:\x20','dim','List\x20folders\x20and\x20child\x20segments','\x20segment',']\x20matching\x20\x27','log','\x20folder','segments','includes','3472746FjVYMB','parentId','journeyBundleName','152bvzqIE'];a39_0x18d7=function(){return _0x31bc5a;};return a39_0x18d7();}(function(_0x169aa5,_0x132c6e){const _0x8fbcd=a39_0xcc31,_0x4cbf96=_0x169aa5();while(!![]){try{const _0x210ab3=parseInt(_0x8fbcd(0xe8))/0x1*(-parseInt(_0x8fbcd(0xe1))/0x2)+-parseInt(_0x8fbcd(0xeb))/0x3*(-parseInt(_0x8fbcd(0xf6))/0x4)+-parseInt(_0x8fbcd(0xf7))/0x5*(parseInt(_0x8fbcd(0xda))/0x6)+parseInt(_0x8fbcd(0xfc))/0x7+parseInt(_0x8fbcd(0xdd))/0x8*(parseInt(_0x8fbcd(0x104))/0x9)+-parseInt(_0x8fbcd(0xc1))/0xa+-parseInt(_0x8fbcd(0x103))/0xb*(-parseInt(_0x8fbcd(0xcc))/0xc);if(_0x210ab3===_0x132c6e)break;else _0x4cbf96['push'](_0x4cbf96['shift']());}catch(_0x4d94e0){_0x4cbf96['push'](_0x4cbf96['shift']());}}}(a39_0x18d7,0xd899e));import{BaseCommand}from'./command.js';function a39_0xcc31(_0x20bfd3,_0x5d5a4d){_0x20bfd3=_0x20bfd3-0xbc;const _0x18d732=a39_0x18d7();let _0xcc3165=_0x18d732[_0x20bfd3];return _0xcc3165;}import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a39_0x1683fc from'chalk';export class SegmentsCommand extends BaseCommand{['name']='segments';['description']=a39_0x2ff0e3(0xd3);async['execute'](_0x5413f2){const _0x56e8c3=a39_0x2ff0e3,{options:_0x35e508,args:_0x18ccbc}=_0x5413f2,_0x4d3174=_0x35e508[_0x56e8c3(0xfd)],_0x1d9d28=_0x18ccbc[0x0];try{const _0x96ca24=_0x35e508[_0x56e8c3(0xbd)];_0x35e508[_0x56e8c3(0xe5)]&&(console['error'](_0x56e8c3(0xd1)+_0x35e508['site']),console['error'](_0x56e8c3(0xdf)+(_0x96ca24||'(not\x20set)')),_0x1d9d28&&console[_0x56e8c3(0xf9)](_0x56e8c3(0xc0)+_0x1d9d28),_0x4d3174&&console[_0x56e8c3(0xf9)]('Recursive\x20mode:\x20enabled'));if(!_0x96ca24)return console[_0x56e8c3(0xf9)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console['error'](''),console[_0x56e8c3(0xf9)](_0x56e8c3(0xc3)),console[_0x56e8c3(0xf9)](_0x56e8c3(0xf1)),console[_0x56e8c3(0xf9)]('\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22'),console[_0x56e8c3(0xf9)](''),console['error'](_0x56e8c3(0xf4)),0x1;const _0x55f970=_0x1d9d28&&(_0x1d9d28[_0x56e8c3(0xd9)]('*')||_0x1d9d28['includes']('?'));if(_0x55f970)return await this['listWithPattern'](_0x5413f2,_0x96ca24,_0x1d9d28);const _0x5395ac=_0x1d9d28?_0x96ca24+'/'+_0x1d9d28:_0x96ca24;return _0x4d3174?await this[_0x56e8c3(0x101)](_0x5413f2,_0x5395ac):await this[_0x56e8c3(0xe6)](_0x5413f2,_0x5395ac);}catch(_0x49e112){if(_0x49e112 instanceof SDKError)return console['error'](_0x56e8c3(0xf5)+_0x49e112[_0x56e8c3(0xfe)]),_0x49e112[_0x56e8c3(0xbe)]&&console['error'](_0x56e8c3(0x102)+_0x49e112[_0x56e8c3(0xbe)]),0x1;throw _0x49e112;}}async[a39_0x2ff0e3(0x107)](_0x4f537e,_0x56f13b,_0xd6b01){const _0x287896=a39_0x2ff0e3,{options:_0x458ffa,tdx:_0x477071}=_0x4f537e,_0x24e75e=await withSpinner(_0x287896(0xea)+_0x56f13b+_0x287896(0xc7),()=>_0x477071[_0x287896(0xf0)]['resolvePathToResource'](_0x56f13b),{'verbose':_0x458ffa[_0x287896(0xe5)]}),_0x880fdb=_0x24e75e[_0x287896(0xee)],_0x1143fd=await withSpinner(_0x287896(0x105),()=>_0x477071[_0x287896(0xf0)][_0x287896(0x108)](_0x880fdb[_0x287896(0xdb)],_0x880fdb['folderId']),{'verbose':_0x458ffa[_0x287896(0xe5)]}),{folders:_0x5e174f,segments:_0x139256,journeys:_0x1c4d54}=_0x1143fd[_0x287896(0xee)],_0x2bf34f=_0xd6b01[_0x287896(0xe2)](/[.+^${}()|[\]\\]/g,_0x287896(0xcb))[_0x287896(0xe2)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x390842=new RegExp('^'+_0x2bf34f+'$','i'),_0x379589=_0x5e174f['filter'](_0xd64180=>_0x390842[_0x287896(0xe3)](_0xd64180[_0x287896(0xc8)])),_0x11c31e=_0x139256['filter'](_0x580f83=>_0x390842['test'](_0x580f83[_0x287896(0xc8)])),_0x1e52e0=_0x1c4d54[_0x287896(0xce)](_0x2f1b1a=>_0x390842[_0x287896(0xe3)](_0x2f1b1a[_0x287896(0xdc)])),_0x53119e=_0x379589['length']+_0x11c31e[_0x287896(0xe4)]+_0x1e52e0[_0x287896(0xe4)];console[_0x287896(0xf9)](_0x287896(0xc4)+_0x379589[_0x287896(0xe4)]+'\x20folder'+(_0x379589[_0x287896(0xe4)]!==0x1?'s':'')+',\x20'+_0x11c31e[_0x287896(0xe4)]+'\x20segment'+(_0x11c31e[_0x287896(0xe4)]!==0x1?'s':'')+',\x20and\x20'+_0x1e52e0[_0x287896(0xe4)]+'\x20journey'+(_0x1e52e0[_0x287896(0xe4)]!==0x1?'s':'')+_0x287896(0xcd)+_0xd6b01+'\x27');const _0x14bbe6=_0x8f93c=>{const _0x477508=_0x287896;return getConsoleNextUrl(_0x458ffa[_0x477508(0xd0)],_0x477508(0x109)+_0x880fdb['parentId']+_0x477508(0xe9)+_0x8f93c);},_0x69c64d=_0x458ffa['format']===_0x287896(0xf3)||_0x458ffa[_0x287896(0xcf)]===_0x287896(0xef);if(_0x69c64d){const _0x290881=[..._0x379589[_0x287896(0xbc)](_0x28fa52=>({..._0x28fa52,'type':_0x287896(0xed)})),..._0x11c31e[_0x287896(0xbc)](_0x3cefb7=>({..._0x3cefb7,'type':_0x287896(0xf0),'url':_0x14bbe6(_0x3cefb7['id'])})),..._0x1e52e0['map'](_0x5b6712=>({..._0x5b6712,'name':_0x5b6712[_0x287896(0xdc)],'type':'journey'}))]['sort']((_0x13c648,_0x1ab650)=>_0x13c648[_0x287896(0xc8)][_0x287896(0xfb)](_0x1ab650[_0x287896(0xc8)]));await handleSDKOutput(_0x290881,_0x458ffa);}else{if(_0x53119e===0x0)console[_0x287896(0xd6)](_0x287896(0xfa)+_0xd6b01);else{console[_0x287896(0xd6)](a39_0x1683fc[_0x287896(0xd2)]('['+_0x56f13b+_0x287896(0xd5)+_0xd6b01+'\x27'));const _0x4b6844=formatFlatList(_0x379589,_0x11c31e,{'showMetadata':!![],'getSegmentUrl':_0x14bbe6},_0x1e52e0);console[_0x287896(0xd6)](_0x4b6844);}}return 0x0;}async[a39_0x2ff0e3(0xe6)](_0x4808fd,_0x1c2f4a){const _0x2af097=a39_0x2ff0e3,{options:_0x45cb23,tdx:_0x4fb88b}=_0x4808fd,_0x5f3be3=await withSpinner(_0x2af097(0xc6)+_0x1c2f4a+_0x2af097(0xc7),()=>_0x4fb88b[_0x2af097(0xf0)][_0x2af097(0x100)](_0x1c2f4a),{'verbose':_0x45cb23[_0x2af097(0xe5)]}),_0x3a7750=_0x5f3be3[_0x2af097(0xee)];_0x45cb23[_0x2af097(0xe5)]&&(console[_0x2af097(0xf9)](_0x2af097(0xf2)+_0x3a7750[_0x2af097(0xdb)]),_0x3a7750[_0x2af097(0xbf)]&&console['error'](_0x2af097(0xe0)+_0x3a7750[_0x2af097(0xbf)]));const _0x5f0b04=await withSpinner(_0x2af097(0x105),()=>_0x4fb88b['segment']['listUnifiedWithJourneys'](_0x3a7750[_0x2af097(0xdb)],_0x3a7750[_0x2af097(0xbf)]),{'verbose':_0x45cb23['verbose']}),{folders:_0x5c0b5d,segments:_0x8b62e,journeys:_0x2b152c}=_0x5f0b04[_0x2af097(0xee)],_0x37e4d5=_0x5c0b5d[_0x2af097(0xe4)]+_0x8b62e[_0x2af097(0xe4)]+_0x2b152c[_0x2af097(0xe4)];console[_0x2af097(0xf9)](_0x2af097(0xc4)+_0x5c0b5d[_0x2af097(0xe4)]+_0x2af097(0xd7)+(_0x5c0b5d[_0x2af097(0xe4)]!==0x1?'s':'')+',\x20'+_0x8b62e['length']+_0x2af097(0xd4)+(_0x8b62e[_0x2af097(0xe4)]!==0x1?'s':'')+_0x2af097(0x106)+_0x2b152c[_0x2af097(0xe4)]+_0x2af097(0xde)+(_0x2b152c[_0x2af097(0xe4)]!==0x1?'s':''));const _0x370647=_0x42a4dc=>{const _0x394021=_0x2af097;return getConsoleNextUrl(_0x45cb23[_0x394021(0xd0)],'/app/ps/'+_0x3a7750[_0x394021(0xdb)]+'/e/'+_0x42a4dc);},_0x3068b8=_0x28277c=>{const _0x48d82a=_0x2af097;return getConsoleNextUrl(_0x45cb23['site'],'/app/ps/'+_0x3a7750[_0x48d82a(0xdb)]+_0x48d82a(0xe9)+_0x28277c+'/j/da');},_0xd8f570=_0x45cb23[_0x2af097(0xcf)]===_0x2af097(0xf3)||_0x45cb23[_0x2af097(0xcf)]===_0x2af097(0xef);if(_0xd8f570){const _0x31837a=[..._0x5c0b5d[_0x2af097(0xbc)](_0x52d357=>({..._0x52d357,'type':_0x2af097(0xed)})),..._0x8b62e[_0x2af097(0xbc)](_0x3de98c=>({..._0x3de98c,'type':_0x2af097(0xf0),'url':_0x370647(_0x3de98c['id'])})),..._0x2b152c[_0x2af097(0xbc)](_0xccb508=>({..._0xccb508,'name':_0xccb508[_0x2af097(0xdc)],'type':_0x2af097(0xff),'url':_0x3068b8(_0xccb508['id'])}))][_0x2af097(0xc9)]((_0xa3dfd5,_0x53db09)=>_0xa3dfd5['name']['localeCompare'](_0x53db09['name']));await handleSDKOutput(_0x31837a,_0x45cb23);}else{if(_0x37e4d5===0x0)console[_0x2af097(0xd6)](a39_0x1683fc[_0x2af097(0xd2)]('['+_0x1c2f4a+']')),console[_0x2af097(0xd6)](_0x2af097(0xec));else{console[_0x2af097(0xd6)](a39_0x1683fc[_0x2af097(0xd2)]('['+_0x1c2f4a+']'));const _0x39230c=formatFlatList(_0x5c0b5d,_0x8b62e,{'showMetadata':!![],'getSegmentUrl':_0x370647,'getJourneyUrl':_0x3068b8},_0x2b152c);console[_0x2af097(0xd6)](_0x39230c);}}return 0x0;}async[a39_0x2ff0e3(0x101)](_0x3c8151,_0x181bf4){const _0x1f6587=a39_0x2ff0e3,{options:_0x46c6d1,tdx:_0x491f45}=_0x3c8151,_0x474000=await withSpinner('Resolving\x20path\x20\x27'+_0x181bf4+_0x1f6587(0xc7),()=>_0x491f45[_0x1f6587(0xf0)][_0x1f6587(0x100)](_0x181bf4),{'verbose':_0x46c6d1[_0x1f6587(0xe5)]}),_0x4a0667=_0x474000[_0x1f6587(0xee)];_0x46c6d1['verbose']&&(console['error']('Parent\x20ID:\x20'+_0x4a0667[_0x1f6587(0xdb)]),_0x4a0667['folderId']&&console[_0x1f6587(0xf9)](_0x1f6587(0xe0)+_0x4a0667['folderId']));const _0x23879b=_0x46c6d1['maxDepth']||0xa,_0x5a8559=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x491f45[_0x1f6587(0xf0)][_0x1f6587(0x101)](_0x4a0667[_0x1f6587(0xdb)],_0x4a0667[_0x1f6587(0xbf)],0x0,_0x23879b),{'verbose':_0x46c6d1[_0x1f6587(0xe5)]}),_0x46cc4d=_0x5a8559[_0x1f6587(0xee)],_0x419887=_0x1c90fd=>{const _0x1b59eb=_0x1f6587;let _0x5f16b0=0x0,_0x245aef=0x0,_0x43a846=0x0;for(const _0x578363 of _0x1c90fd){if(_0x578363[_0x1b59eb(0xc5)]===_0x1b59eb(0xed))_0x5f16b0++;else{if(_0x578363[_0x1b59eb(0xc5)]===_0x1b59eb(0xf0))_0x245aef++;else{if(_0x578363[_0x1b59eb(0xc5)]===_0x1b59eb(0xff))_0x43a846++;}}if(_0x578363[_0x1b59eb(0xc2)]){const _0xfae44c=_0x419887(_0x578363[_0x1b59eb(0xc2)]);_0x5f16b0+=_0xfae44c['folders'],_0x245aef+=_0xfae44c[_0x1b59eb(0xd8)],_0x43a846+=_0xfae44c[_0x1b59eb(0xca)];}}return{'folders':_0x5f16b0,'segments':_0x245aef,'journeys':_0x43a846};},_0x2ded3d=_0x419887(_0x46cc4d);console[_0x1f6587(0xf9)]('✔\x20Built\x20tree\x20with\x20'+_0x2ded3d[_0x1f6587(0xe7)]+_0x1f6587(0xd7)+(_0x2ded3d[_0x1f6587(0xe7)]!==0x1?'s':'')+',\x20'+_0x2ded3d[_0x1f6587(0xd8)]+_0x1f6587(0xd4)+(_0x2ded3d[_0x1f6587(0xd8)]!==0x1?'s':'')+',\x20and\x20'+_0x2ded3d[_0x1f6587(0xca)]+'\x20journey'+(_0x2ded3d[_0x1f6587(0xca)]!==0x1?'s':''));const _0x3c9c66=_0x4ea794=>{const _0x49cbc1=_0x1f6587;return getConsoleNextUrl(_0x46c6d1[_0x49cbc1(0xd0)],_0x49cbc1(0x109)+_0x4a0667[_0x49cbc1(0xdb)]+'/e/'+_0x4ea794);},_0xdfcf82=_0x232fad=>{const _0x31d96e=_0x1f6587;return getConsoleNextUrl(_0x46c6d1['site'],'/app/ps/'+_0x4a0667['parentId']+_0x31d96e(0xe9)+_0x232fad+_0x31d96e(0xf8));};if(_0x46c6d1[_0x1f6587(0xcf)]===_0x1f6587(0xf3)||_0x46c6d1['format']===_0x1f6587(0xef))await handleSDKOutput(_0x46cc4d,_0x46c6d1);else{console['log'](a39_0x1683fc[_0x1f6587(0xd2)]('['+_0x181bf4+']'));const _0x169bad=formatTree(_0x46cc4d,{'showMetadata':!![],'getSegmentUrl':_0x3c9c66,'getJourneyUrl':_0xdfcf82});console[_0x1f6587(0xd6)](_0x169bad);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a40_0x153bfb=a40_0x44ff;function a40_0x5f33(){const _0x435ea4=['\x20row','message','2958248CIQNPb','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','1275799zZliNa','10HCXEHL','Site:\x20','error','limit','3046350QVKbJh','verbose','6918BmAzgZ','4049368GgXoHv','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','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','data','name','Usage:\x20tdx\x20show\x20<database.table>','table','2202456uYIkgD','✔\x20Retrieved\x20','description','validate','showTable','...','Error:\x20','10vlTCMo','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','Database:\x20','query','Limit:\x20','args','site','show','catalog','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','9xjGwba','database','length','execute','\x20\x20Cause:\x20','Catalog:\x20','Show\x20table\x20contents','12700743yoOXje','cause','\x20from\x20','Querying\x20','309gJUJrc'];a40_0x5f33=function(){return _0x435ea4;};return a40_0x5f33();}(function(_0x5ea93c,_0x567a62){const _0x41d4ec=a40_0x44ff,_0x483753=_0x5ea93c();while(!![]){try{const _0x3eb95b=parseInt(_0x41d4ec(0x16b))/0x1*(parseInt(_0x41d4ec(0x147))/0x2)+parseInt(_0x41d4ec(0x14f))/0x3+-parseInt(_0x41d4ec(0x148))/0x4+parseInt(_0x41d4ec(0x141))/0x5*(-parseInt(_0x41d4ec(0x145))/0x6)+parseInt(_0x41d4ec(0x170))/0x7+parseInt(_0x41d4ec(0x16e))/0x8*(-parseInt(_0x41d4ec(0x160))/0x9)+parseInt(_0x41d4ec(0x156))/0xa*(parseInt(_0x41d4ec(0x167))/0xb);if(_0x3eb95b===_0x567a62)break;else _0x483753['push'](_0x483753['shift']());}catch(_0x380a9c){_0x483753['push'](_0x483753['shift']());}}}(a40_0x5f33,0xb5388));import{BaseCommand}from'./command.js';function a40_0x44ff(_0x40b243,_0xf13ac2){_0x40b243=_0x40b243-0x141;const _0x5f33a5=a40_0x5f33();let _0x44ff12=_0x5f33a5[_0x40b243];return _0x44ff12;}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{[a40_0x153bfb(0x14c)]=a40_0x153bfb(0x15d);[a40_0x153bfb(0x151)]=a40_0x153bfb(0x166);async[a40_0x153bfb(0x163)](_0x8d6da6){const _0x21c62e=a40_0x153bfb;return this[_0x21c62e(0x153)](_0x8d6da6);}async[a40_0x153bfb(0x153)](_0x251ccc){const _0x36a1f6=a40_0x153bfb,{options:_0x3c7c56,args:_0xa60eb6,tdx:_0x560a03}=_0x251ccc;let _0x46b63f;try{_0x46b63f=parseTableReference(_0xa60eb6[0x0]);const _0x1d1902=_0x3c7c56[_0x36a1f6(0x161)];!_0x46b63f[_0x36a1f6(0x161)]&&_0x1d1902&&(_0x46b63f[_0x36a1f6(0x161)]=_0x1d1902);const _0x4193dc=validateTableDescribeReference(_0x46b63f);if(_0x4193dc)return console['error'](_0x36a1f6(0x155)+_0x4193dc),console[_0x36a1f6(0x143)](_0x36a1f6(0x14d)),console[_0x36a1f6(0x143)](_0x36a1f6(0x16f)),console['error'](_0x36a1f6(0x15f)),0x1;}catch(_0x183811){return console[_0x36a1f6(0x143)](_0x36a1f6(0x155)+_0x183811[_0x36a1f6(0x16d)]),console['error'](_0x36a1f6(0x14d)),console[_0x36a1f6(0x143)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x36a1f6(0x143)](_0x36a1f6(0x15f)),0x1;}const _0x5dbb69=_0x46b63f[_0x36a1f6(0x15e)],_0x192029=_0x46b63f[_0x36a1f6(0x161)],_0x1fa706=_0x46b63f[_0x36a1f6(0x14e)],_0x39dcfb=resolveLimit(_0x3c7c56[_0x36a1f6(0x144)],DEFAULT_DISPLAY_LIMIT);try{_0x3c7c56[_0x36a1f6(0x146)]&&(console[_0x36a1f6(0x143)](_0x36a1f6(0x142)+_0x3c7c56[_0x36a1f6(0x15c)]),_0x5dbb69&&console['error'](_0x36a1f6(0x165)+_0x5dbb69),console[_0x36a1f6(0x143)](_0x36a1f6(0x158)+_0x192029),console[_0x36a1f6(0x143)]('Table:\x20'+_0x1fa706),console[_0x36a1f6(0x143)](_0x36a1f6(0x15a)+_0x39dcfb));const _0xfb9070=_0x5dbb69?_0x5dbb69+'.'+_0x192029+'.'+_0x1fa706:_0x192029+'.'+_0x1fa706,_0xcb9ffb=await withSpinner(_0x36a1f6(0x16a)+_0xfb9070+_0x36a1f6(0x154),()=>_0x560a03[_0x36a1f6(0x159)][_0x36a1f6(0x153)](_0x192029,_0x1fa706,_0x39dcfb,_0x5dbb69),{'verbose':_0x3c7c56[_0x36a1f6(0x146)]}),_0x1e8923=_0xcb9ffb['data'],_0x4329fa=_0x1e8923[_0x36a1f6(0x14b)];return _0x4329fa[_0x36a1f6(0x162)]===0x0?console['error'](_0x36a1f6(0x157)):console[_0x36a1f6(0x143)](_0x36a1f6(0x150)+_0x4329fa[_0x36a1f6(0x162)]+_0x36a1f6(0x16c)+(_0x4329fa['length']!==0x1?'s':'')+_0x36a1f6(0x169)+_0xfb9070),await handleSDKOutput(_0x4329fa,_0x3c7c56),0x0;}catch(_0x4c95c4){if(_0x4c95c4 instanceof SDKError)return console[_0x36a1f6(0x143)](_0x36a1f6(0x155)+_0x4c95c4[_0x36a1f6(0x16d)]),_0x4c95c4[_0x36a1f6(0x168)]&&console[_0x36a1f6(0x143)](_0x36a1f6(0x164)+_0x4c95c4[_0x36a1f6(0x168)]),0x1;throw _0x4c95c4;}}[a40_0x153bfb(0x152)](_0x2529fb){const _0x4cce43=a40_0x153bfb;if(_0x2529fb[_0x4cce43(0x15b)][_0x4cce43(0x162)]===0x0)return _0x4cce43(0x149);if(_0x2529fb[_0x4cce43(0x15b)]['length']>0x1)return _0x4cce43(0x14a);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a41_0x4dd6(_0x5f521a,_0x36591a){_0x5f521a=_0x5f521a-0x1b8;const _0x2ff97d=a41_0x2ff9();let _0x4dd607=_0x2ff97d[_0x5f521a];return _0x4dd607;}const a41_0x2b26c0=a41_0x4dd6;(function(_0xa68f7e,_0x11cba3){const _0x66f2d2=a41_0x4dd6,_0x38a423=_0xa68f7e();while(!![]){try{const _0x560083=parseInt(_0x66f2d2(0x1cc))/0x1+-parseInt(_0x66f2d2(0x1d4))/0x2+parseInt(_0x66f2d2(0x1b8))/0x3+-parseInt(_0x66f2d2(0x1d7))/0x4+-parseInt(_0x66f2d2(0x1c4))/0x5*(parseInt(_0x66f2d2(0x1dc))/0x6)+parseInt(_0x66f2d2(0x1e4))/0x7*(parseInt(_0x66f2d2(0x1ba))/0x8)+-parseInt(_0x66f2d2(0x1d0))/0x9*(-parseInt(_0x66f2d2(0x1c9))/0xa);if(_0x560083===_0x11cba3)break;else _0x38a423['push'](_0x38a423['shift']());}catch(_0x31ce38){_0x38a423['push'](_0x38a423['shift']());}}}(a41_0x2ff9,0x8d38a));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 a41_0x1593b6 from'chalk';export class StatusCommand extends BaseCommand{[a41_0x2b26c0(0x1d9)]=a41_0x2b26c0(0x1d2);['description']=a41_0x2b26c0(0x1da);async[a41_0x2b26c0(0x1be)](_0x199a49){const _0x236b5a=a41_0x2b26c0,{options:_0x180741,tdx:_0x41d6b7}=_0x199a49,_0x3d3101=_0x180741['site'],_0x16c277=new GlobalContext(_0x180741),_0x37697e=_0x16c277[_0x236b5a(0x1c3)],_0x1adda5=_0x16c277['profileSource'],_0x2c171e=_0x1adda5===_0x236b5a(0x1d6)?_0x236b5a(0x1cb):_0x1adda5===_0x236b5a(0x1c5)?_0x236b5a(0x1c5):_0x1adda5===_0x236b5a(0x1ca)?'TDX_PROFILE\x20env':_0x1adda5===_0x236b5a(0x1bb)?_0x236b5a(0x1bb):null,_0x44a506=_0x37697e?a41_0x1593b6[_0x236b5a(0x1db)](_0x37697e):a41_0x1593b6[_0x236b5a(0x1cf)](_0x236b5a(0x1e0)),_0x16ba46=_0x2c171e?'\x20'+a41_0x1593b6[_0x236b5a(0x1cf)]('(from\x20'+_0x2c171e+')'):'';console[_0x236b5a(0x1b9)](a41_0x1593b6['bold'](_0x236b5a(0x1c2))+_0x236b5a(0x1bf)+_0x44a506+_0x16ba46+'\x20'+a41_0x1593b6[_0x236b5a(0x1cf)]('(')+_0x236b5a(0x1bc)+a41_0x1593b6['cyan'](_0x3d3101)+a41_0x1593b6[_0x236b5a(0x1cf)](')'));const _0x3154d5=await resolveAPIKeyAsync(_0x3d3101,_0x37697e);if(_0x3154d5){const {source:_0x10da49,isDeprecated:_0x3da6f4}=_0x3154d5,_0x1e392a=_0x236b5a(0x1d1)+a41_0x1593b6[_0x236b5a(0x1db)](_0x10da49);console[_0x236b5a(0x1b9)](_0x3da6f4?a41_0x1593b6[_0x236b5a(0x1c0)](_0x1e392a):_0x1e392a);}else console[_0x236b5a(0x1b9)](a41_0x1593b6[_0x236b5a(0x1c0)](_0x236b5a(0x1c1)));let _0x5ce59c=![];try{const _0x56328c=await _0x41d6b7[_0x236b5a(0x1e2)][_0x236b5a(0x1c8)]();console[_0x236b5a(0x1b9)](a41_0x1593b6[_0x236b5a(0x1e3)]('✓\x20Authentication\x20successful\x0a')),console[_0x236b5a(0x1b9)](a41_0x1593b6[_0x236b5a(0x1de)](_0x236b5a(0x1d3))+'\x20'+a41_0x1593b6[_0x236b5a(0x1db)](_0x56328c[_0x236b5a(0x1e1)]));if(_0x56328c[_0x236b5a(0x1ce)]||_0x56328c[_0x236b5a(0x1cd)]){const _0x283176=[_0x56328c['first_name'],_0x56328c[_0x236b5a(0x1cd)]][_0x236b5a(0x1df)](Boolean)[_0x236b5a(0x1d8)]('\x20');console[_0x236b5a(0x1b9)](a41_0x1593b6[_0x236b5a(0x1de)](_0x236b5a(0x1c7))+'\x20'+_0x283176);}_0x56328c[_0x236b5a(0x1c6)]&&console[_0x236b5a(0x1b9)](a41_0x1593b6['bold']('Account\x20ID:')+'\x20'+a41_0x1593b6['yellow'](_0x56328c[_0x236b5a(0x1c6)])),_0x5ce59c=!![];}catch(_0x3d537d){_0x3d537d instanceof HTTPClientError&&_0x3d537d['status']===0x191?printAuthError(_0x3d537d,!![],_0x37697e):console['error'](a41_0x1593b6[_0x236b5a(0x1bd)]('✗\x20Validation\x20failed:\x20'+(_0x3d537d instanceof Error?_0x3d537d[_0x236b5a(0x1dd)]:String(_0x3d537d))));}return console['log'](),_0x16c277[_0x236b5a(0x1d5)](),_0x5ce59c?0x0:0x1;}}function a41_0x2ff9(){const _0x180e61=['CLI\x20flag','185628cEOLej','last_name','first_name','dim','126531JKQRVN','Read\x20credential\x20from\x20','status','User:','1346328NiFwjH','displayWithSources','cli','864496TDEGBW','join','name','Show\x20authentication\x20status\x20and\x20current\x20context','cyan','246444SLDUlx','message','bold','filter','N/A','email','jobs','green','7kjzdGI','1686870tPWXEk','log','8376168bFOHWU','config','site:\x20','red','execute','\x20profile:\x20','yellow','No\x20credential\x20found','tdx','profile','110jYzllN','session','account_id','Name:','getUserInfo','410VvDSms','env'];a41_0x2ff9=function(){return _0x180e61;};return a41_0x2ff9();}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x1ffca7=a42_0x4745;(function(_0x2f0b9c,_0x56b46f){const _0x5a1ce2=a42_0x4745,_0x3d07be=_0x2f0b9c();while(!![]){try{const _0xaba8bc=parseInt(_0x5a1ce2(0x1ba))/0x1*(-parseInt(_0x5a1ce2(0x1c2))/0x2)+parseInt(_0x5a1ce2(0x1ad))/0x3*(parseInt(_0x5a1ce2(0x1c6))/0x4)+-parseInt(_0x5a1ce2(0x1bf))/0x5+-parseInt(_0x5a1ce2(0x1b8))/0x6*(parseInt(_0x5a1ce2(0x1a2))/0x7)+-parseInt(_0x5a1ce2(0x197))/0x8+parseInt(_0x5a1ce2(0x1a0))/0x9*(-parseInt(_0x5a1ce2(0x1c1))/0xa)+-parseInt(_0x5a1ce2(0x1a9))/0xb*(-parseInt(_0x5a1ce2(0x1b6))/0xc);if(_0xaba8bc===_0x56b46f)break;else _0x3d07be['push'](_0x3d07be['shift']());}catch(_0x3df9e8){_0x3d07be['push'](_0x3d07be['shift']());}}}(a42_0x23fa,0xa76b5));function a42_0x4745(_0x43ab01,_0x3bea5a){_0x43ab01=_0x43ab01-0x197;const _0x23fa86=a42_0x23fa();let _0x474569=_0x23fa86[_0x43ab01];return _0x474569;}function a42_0x23fa(){const _0x1b3d99=['includes','3118625vnBDWt','\x20table','3331190oSmYCJ','7074kXOyjd','\x27\x20is\x20ambiguous.','Listing\x20tables...','listTables','316uVBfdm','limit','Database:\x20all','5234048ohvOpx','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','table','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','length','Error:\x20','site','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','9lZyebD','execute','21PCcyPh','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','description','\x20\x20Cause:\x20','List\x20tables\x20in\x20a\x20database','Site:\x20','query','41569cmpEJE','database','message','\x20\x20Use:\x20tdx\x20tables\x20\x22','51699paXfVF','name','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','cause','Error:\x20Pattern\x20\x27','Or\x20use\x20--in\x20flag:','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','error','Database\x20pattern:\x20','8460jKQtty','.*\x22','2170038mtbFFQ','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','182lWFTtO','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','Table\x20pattern:\x20','✔\x20Found\x20'];a42_0x23fa=function(){return _0x1b3d99;};return a42_0x23fa();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a42_0x1ffca7(0x1ae)]='tables';[a42_0x1ffca7(0x1a4)]=a42_0x1ffca7(0x1a6);async[a42_0x1ffca7(0x1a1)](_0x2e37c7){const _0x3d07c9=a42_0x1ffca7,{options:_0x168c09,args:_0x4f6d5b,tdx:_0x40d3b8}=_0x2e37c7;let _0x4a99ca;if(_0x4f6d5b[_0x3d07c9(0x19b)]===0x0)_0x4a99ca={'database':undefined,'table':undefined,'original':''};else{if(_0x4f6d5b[_0x3d07c9(0x19b)]===0x1)try{_0x4a99ca=parseTableReference(_0x4f6d5b[0x0]);if(_0x4a99ca['table']&&!_0x4a99ca['database']&&!_0x4a99ca['table']['includes']('*')&&!_0x4a99ca['table']['includes']('?'))return console[_0x3d07c9(0x1b4)](_0x3d07c9(0x1b1)+_0x4f6d5b[0x0]+_0x3d07c9(0x1c3)),console[_0x3d07c9(0x1b4)](_0x3d07c9(0x19e)+_0x4a99ca[_0x3d07c9(0x199)]+'\x27?'),console[_0x3d07c9(0x1b4)](_0x3d07c9(0x1ac)+_0x4a99ca[_0x3d07c9(0x199)]+_0x3d07c9(0x1b7)),console['error']('\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20'+_0x4a99ca[_0x3d07c9(0x199)]),console[_0x3d07c9(0x1b4)](_0x3d07c9(0x1bb)+_0x4a99ca['table']),console[_0x3d07c9(0x1b4)](''),console['error']('Note:\x20\x27'+_0x4f6d5b[0x0]+_0x3d07c9(0x1a3)+_0x4a99ca[_0x3d07c9(0x199)]+'\x27\x20across\x20all\x20databases.'),0x1;}catch(_0x20c3e5){return console[_0x3d07c9(0x1b4)](_0x3d07c9(0x19c)+_0x20c3e5[_0x3d07c9(0x1ab)]),0x1;}else return console[_0x3d07c9(0x1b4)](_0x3d07c9(0x1b3)),console['error'](_0x3d07c9(0x1af)),console[_0x3d07c9(0x1b4)](_0x3d07c9(0x19f)),console[_0x3d07c9(0x1b4)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console[_0x3d07c9(0x1b4)](_0x3d07c9(0x1b9)),console['error'](_0x3d07c9(0x1b2)),console[_0x3d07c9(0x1b4)](_0x3d07c9(0x19a)),0x1;}const _0x5ef05e=_0x168c09[_0x3d07c9(0x1aa)];!_0x4a99ca[_0x3d07c9(0x1aa)]&&_0x5ef05e&&(_0x4a99ca[_0x3d07c9(0x1aa)]=_0x5ef05e);try{const _0x51d7b4=_0x43a084=>_0x43a084&&(_0x43a084[_0x3d07c9(0x1be)]('*')||_0x43a084[_0x3d07c9(0x1be)]('?')),_0x266b75=_0x51d7b4(_0x4a99ca[_0x3d07c9(0x1aa)]);_0x168c09['verbose']&&(console[_0x3d07c9(0x1b4)](_0x3d07c9(0x1a7)+_0x168c09[_0x3d07c9(0x19d)]),_0x4a99ca[_0x3d07c9(0x1aa)]?_0x266b75?console[_0x3d07c9(0x1b4)](_0x3d07c9(0x1b5)+_0x4a99ca[_0x3d07c9(0x1aa)]):console[_0x3d07c9(0x1b4)]('Database:\x20'+_0x4a99ca['database']):console[_0x3d07c9(0x1b4)](_0x3d07c9(0x1c8)),_0x4a99ca[_0x3d07c9(0x199)]&&console[_0x3d07c9(0x1b4)](_0x3d07c9(0x1bc)+_0x4a99ca[_0x3d07c9(0x199)]));const _0x5e27a9=_0x4a99ca[_0x3d07c9(0x1aa)]&&!_0x266b75?_0x4a99ca[_0x3d07c9(0x1aa)]:undefined,_0x56f34f=_0x266b75?_0x4a99ca['database']:undefined,_0x240c87=_0x4a99ca[_0x3d07c9(0x199)],_0x2c0e60=resolveLimit(_0x168c09[_0x3d07c9(0x1c7)],DEFAULT_LISTING_LIMIT),_0x329fb0=await withSpinner(_0x3d07c9(0x1c4),()=>_0x40d3b8[_0x3d07c9(0x1a8)][_0x3d07c9(0x1c5)](_0x5e27a9,_0x240c87,_0x56f34f,_0x2c0e60),{'verbose':_0x168c09['verbose']}),_0x475497=_0x329fb0['data'];if(_0x475497[_0x3d07c9(0x19b)]===0x0&&_0x4a99ca['database']&&!_0x266b75)return console[_0x3d07c9(0x1b4)]('✖\x20No\x20tables\x20found'),console[_0x3d07c9(0x1b4)]('Database\x20\x27'+_0x4a99ca['database']+_0x3d07c9(0x198)),0x1;return console[_0x3d07c9(0x1b4)](_0x3d07c9(0x1bd)+_0x475497['length']+_0x3d07c9(0x1c0)+(_0x475497[_0x3d07c9(0x19b)]!==0x1?'s':'')),await handleSDKOutput(_0x475497,{..._0x168c09,'limit':_0x2c0e60}),0x0;}catch(_0x547bdf){if(_0x547bdf instanceof SDKError)return console[_0x3d07c9(0x1b4)](_0x3d07c9(0x19c)+_0x547bdf[_0x3d07c9(0x1ab)]),_0x547bdf[_0x3d07c9(0x1b0)]&&console[_0x3d07c9(0x1b4)](_0x3d07c9(0x1a5)+_0x547bdf['cause']),0x1;throw _0x547bdf;}}['validate'](_0x4571a9){return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a43_0x7a64(){const _0x7e5c3c=['97761vxepmU','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','58914tWsfcI','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','session','8313yIGCEQ','engage_workspace','description','validate','cleared','default','join','agent','length','dim','green','390Hzcfcq','(session:\x20','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','name','55575SnppJs','Invalid\x20resource:\x20','parent_segment','site','includes','Usage:\x20tdx\x20unset\x20<resource>\x0a','2428680ppbWeJ','Error:\x20','33615gBAeVR','database','463864BKFTih','unset','.\x20Must\x20be\x20one\x20of:\x20','Default\x20profile\x20','436dOYujv','Clear\x20session-level\x20or\x20default\x20context\x20values','log','Session\x20','error','91oHTjpn','profile','tdx.json','llm_project','Default\x20site\x20','\x0aUpdated:\x20'];a43_0x7a64=function(){return _0x7e5c3c;};return a43_0x7a64();}const a43_0x396ffb=a43_0x406a;(function(_0x4c3d39,_0x17c499){const _0x2988a9=a43_0x406a,_0x246979=_0x4c3d39();while(!![]){try{const _0x3159df=-parseInt(_0x2988a9(0x1e6))/0x1+-parseInt(_0x2988a9(0x1d7))/0x2+-parseInt(_0x2988a9(0x1eb))/0x3*(-parseInt(_0x2988a9(0x1db))/0x4)+-parseInt(_0x2988a9(0x1d5))/0x5+-parseInt(_0x2988a9(0x1e8))/0x6*(-parseInt(_0x2988a9(0x1e0))/0x7)+parseInt(_0x2988a9(0x1d3))/0x8+-parseInt(_0x2988a9(0x1cd))/0x9*(parseInt(_0x2988a9(0x1f6))/0xa);if(_0x3159df===_0x17c499)break;else _0x246979['push'](_0x246979['shift']());}catch(_0x28c684){_0x246979['push'](_0x246979['shift']());}}}(a43_0x7a64,0x2617e));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';function a43_0x406a(_0x2033a7,_0x2e96f5){_0x2033a7=_0x2033a7-0x1ca;const _0x7a6496=a43_0x7a64();let _0x406a6a=_0x7a6496[_0x2033a7];return _0x406a6a;}import a43_0x24a45d from'chalk';import*as a43_0x39d795 from'node:path';export class UnsetCommand extends BaseCommand{[a43_0x396ffb(0x1cc)]=a43_0x396ffb(0x1d8);[a43_0x396ffb(0x1ed)]=a43_0x396ffb(0x1dc);[a43_0x396ffb(0x1ee)](_0x43b8ca){const _0x5d160c=a43_0x396ffb,{args:_0x2b8d99,options:_0x58e951}=_0x43b8ca,_0x5a340b=_0x58e951[_0x5d160c(0x1f0)];if(_0x2b8d99[_0x5d160c(0x1f3)]===0x0)return _0x5d160c(0x1d2)+_0x5d160c(0x1e7)+_0x5d160c(0x1cb)+'\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options';const _0x3b16da=_0x2b8d99[0x0],_0x49a950=[_0x5d160c(0x1d0),_0x5d160c(0x1d6),_0x5d160c(0x1cf),_0x5d160c(0x1e3),_0x5d160c(0x1f2),'profile',_0x5d160c(0x1ec)];if(!_0x49a950[_0x5d160c(0x1d1)](_0x3b16da))return _0x5d160c(0x1ce)+_0x3b16da+_0x5d160c(0x1d9)+_0x49a950[_0x5d160c(0x1f1)](',\x20');if(_0x5a340b&&_0x3b16da!==_0x5d160c(0x1d0)&&_0x3b16da!==_0x5d160c(0x1e1))return _0x5d160c(0x1e9);return undefined;}async['execute'](_0x29ca75){const _0x50f36c=a43_0x396ffb,{args:_0x41ef0c,options:_0x57d8c0}=_0x29ca75,_0x50b2eb=_0x57d8c0['default'];cleanExpiredSessions();try{const _0x4cb9b3=_0x41ef0c[0x0],_0x58d282=a43_0x39d795[_0x50f36c(0x1f1)](getConfigDir(),_0x50f36c(0x1e2));if(_0x50b2eb){if(_0x4cb9b3===_0x50f36c(0x1d0))return clearDefaultSiteFromUserConfig(),console[_0x50f36c(0x1dd)](_0x50f36c(0x1e4)+a43_0x24a45d[_0x50f36c(0x1f5)]('cleared')),console['log'](a43_0x24a45d[_0x50f36c(0x1f4)]('\x0aUpdated:\x20'+_0x58d282)),0x0;if(_0x4cb9b3===_0x50f36c(0x1e1))return clearActiveProfileFromUserConfig(),console[_0x50f36c(0x1dd)](_0x50f36c(0x1da)+a43_0x24a45d[_0x50f36c(0x1f5)](_0x50f36c(0x1ef))),console[_0x50f36c(0x1dd)](a43_0x24a45d['dim'](_0x50f36c(0x1e5)+_0x58d282)),0x0;}const _0xfe433e=getSessionID(_0x57d8c0[_0x50f36c(0x1ea)]),_0x404022={'site':'site','database':'database','parent_segment':'parent_segment','llm_project':'llm_project','agent':'llm_agent','profile':_0x50f36c(0x1e1),'engage_workspace':_0x50f36c(0x1ec)},_0x46650a=_0x404022[_0x4cb9b3];return _0x46650a&&(clearSessionContextField(_0x46650a,_0x57d8c0[_0x50f36c(0x1ea)]),console[_0x50f36c(0x1dd)](_0x50f36c(0x1de)+_0x4cb9b3+'\x20'+a43_0x24a45d[_0x50f36c(0x1f5)](_0x50f36c(0x1ef))+'\x20'+a43_0x24a45d[_0x50f36c(0x1f4)](_0x50f36c(0x1ca)+_0xfe433e+')'))),0x0;}catch(_0x5be21a){return _0x5be21a instanceof Error&&console[_0x50f36c(0x1df)](_0x50f36c(0x1d4)+_0x5be21a['message']),0x1;}}}
|