@treasuredata/tdx 2026.3.22 → 2026.3.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
function a40_0x42d2(_0x4b297c,_0x493ad4){_0x4b297c=_0x4b297c-0x7d;const _0x2161b0=a40_0x2161();let _0x42d24b=_0x2161b0[_0x4b297c];return _0x42d24b;}const a40_0x3b2e81=a40_0x42d2;(function(_0x2f185f,_0x7762c2){const _0x37ccfb=a40_0x42d2,_0x634ff4=_0x2f185f();while(!![]){try{const _0x1471b0=-parseInt(_0x37ccfb(0xd3))/0x1*(-parseInt(_0x37ccfb(0xc8))/0x2)+parseInt(_0x37ccfb(0x9e))/0x3*(-parseInt(_0x37ccfb(0xd2))/0x4)+-parseInt(_0x37ccfb(0x10e))/0x5+parseInt(_0x37ccfb(0xb3))/0x6+parseInt(_0x37ccfb(0xe1))/0x7+-parseInt(_0x37ccfb(0x8c))/0x8+parseInt(_0x37ccfb(0x91))/0x9;if(_0x1471b0===_0x7762c2)break;else _0x634ff4['push'](_0x634ff4['shift']());}catch(_0x59dff0){_0x634ff4['push'](_0x634ff4['shift']());}}}(a40_0x2161,0xbe9a3));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a40_0x7eaf6d from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';function a40_0x2161(){const _0x577e23=['repeat','yes','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20new','listSegments','cwd','Resolving\x20parent\x20segment\x20\x27','24uABvPI','unchanged','parentFolder','map','Preparing\x20journeys...','resolveParentId','Fetching\x20existing\x20data...','helpText','\x20\x20Source:\x20','name','4GMbAbq','31134DZkAeu','getJourney','journeyBundleName','segments','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','endsWith','segment:push','Push\x20','listActivations','getOutputSchemaWithCache','\x20\x20Activations:\x20','\x20\x20Journeys:\x20','toCreate','listFolders','10858022YbtuQP','\x20to\x20delete','📁\x20','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','add','join','.yml','Fetching\x20existing\x20activations...','Error:\x20Directory\x20not\x20found:\x20','error','createdSegmentIds','isScoped','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','nameToId','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','/e/','\x20deleted','\x20changed','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','diff','cyan','versionNumber','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','/j/da/je','No\x20','journeyId','audienceId','folders','verbose','toDelete','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','isNew','existingJourney','journeysOnly','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','targetDir','errorCode','\x20folders\x20to\x20create','Folders\x20to\x20create:','nameToType','/sb/da/esr','connection','delete','type','parentName','5928435aVeQjt','created','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20to\x20update','Aborted.','\x0a✔\x20Push\x20complete','\x20\x20\x20\x20','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','toString','Changes\x20to:','paused','\x0aPush\x20summary\x20for\x20\x27','set','attributes','\x20updated','idToName','all','activations','8871272vLRXjd','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','data','filter','length','8059545pHjriG','site','green','\x20activations]','/app/ps/','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','red','dim','results','folderPath','push','then','Source\x20directory:\x20','347457PFbJhx','journeys','buildUserMaps','blue','relationships','Fetching\x20connections\x20for\x20name\x20resolution...','\x20YAML\x20files\x20found','Delete\x20journey:','existingSegment','scopedFolderPath','updated','\x20created','segmentFolderId','yamlConfig','folderId','\x0aValidation\x20failed:','parentSegment','execute','segment\x20or\x20journey','new','.yaml','2225178qShXmg','filePath','New\x20journey:','journey','dryRun','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','segment','state','yellow','Changes\x20to\x20journey:','description','user','file','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files'];a40_0x2161=function(){return _0x577e23;};return a40_0x2161();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a40_0x3b2e81(0xd1)]=a40_0x3b2e81(0xd9);[a40_0x3b2e81(0xbd)]=a40_0x3b2e81(0x103);async[a40_0x3b2e81(0xaf)](_0x4aec34){const _0x46ff65=a40_0x3b2e81,{options:_0x174b49,args:_0x30f4c1,tdx:_0x4efe7b}=_0x4aec34,_0x5b2931=_0x174b49,_0xdfb7c2=await resolveTarget({'arg':_0x30f4c1[0x0],'contextParent':_0x174b49[_0x46ff65(0xae)],'cwd':process[_0x46ff65(0xc6)]()});if(!isSuccessfulResolution(_0xdfb7c2))return _0xdfb7c2[_0x46ff65(0x105)]==='no_parent'?(console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0xff))),console[_0x46ff65(0xea)]('Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)'),console[_0x46ff65(0xea)](_0x46ff65(0xf7)),console[_0x46ff65(0xea)](_0x46ff65(0x8d))):(console[_0x46ff65(0xea)](a40_0x7eaf6d['red']('Error:\x20'+_0xdfb7c2['message']+'\x0a')),_0xdfb7c2[_0x46ff65(0xcf)]&&console['error'](a40_0x7eaf6d[_0x46ff65(0xf5)](_0xdfb7c2[_0x46ff65(0xcf)]))),0x1;if(_0xdfb7c2[_0x46ff65(0x10c)]==='parent_name')return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)]('Error:\x20Directory\x20not\x20found:\x20'+_0xdfb7c2[_0x46ff65(0x104)]+'\x0a')),console['error'](a40_0x7eaf6d[_0x46ff65(0xf5)](_0x46ff65(0xe4))),0x1;const _0x2490fc=_0xdfb7c2[_0x46ff65(0x10d)],_0xfce0e=_0xdfb7c2[_0x46ff65(0x104)],_0x28602a=_0xdfb7c2['type']===_0x46ff65(0xbf)?_0xdfb7c2[_0x46ff65(0xb4)]:undefined,_0x3be430=getScopedDetails(_0xdfb7c2),_0x1d0bb9=_0x3be430?.[_0x46ff65(0xec)]??![],_0x48f524=_0x3be430?.[_0x46ff65(0xa7)]??'';if(!existsSync(_0xfce0e))return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)](_0x46ff65(0xe9)+_0xfce0e+'\x0a')),console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xf5)](_0x46ff65(0xe4))),0x1;_0x5b2931[_0x46ff65(0xfd)]&&(console[_0x46ff65(0xea)]('Site:\x20'+_0x5b2931[_0x46ff65(0x92)]),console[_0x46ff65(0xea)]('Parent\x20segment:\x20'+_0x2490fc),console[_0x46ff65(0xea)](_0x46ff65(0x9d)+_0xfce0e),_0x1d0bb9&&console['error']('Scoped\x20to\x20folder:\x20'+_0x48f524));const _0x1325b0=await withSpinner(_0x46ff65(0xc7)+_0x2490fc+'\x27...',()=>_0x4efe7b['segment'][_0x46ff65(0xcd)](_0x2490fc),{'verbose':_0x5b2931['verbose']}),_0x211185=_0x1325b0[_0x46ff65(0x8e)],{parentSegmentResult:_0x47b9b9,segmentsResult:_0x1223e7,foldersResult:_0x17322d,journeysWithDetailsResult:_0x4fba05,userMaps:_0xabe7a0}=await withSpinner(_0x46ff65(0xce),async()=>{const _0x3ce3f3=_0x46ff65,[_0x577770,_0x2b9722,_0x450400,_0x100b01,_0x400c00]=await Promise[_0x3ce3f3(0x8a)]([_0x4efe7b[_0x3ce3f3(0xb9)]['getParent'](_0x211185),_0x4efe7b[_0x3ce3f3(0xb9)][_0x3ce3f3(0xc5)](_0x211185),_0x4efe7b[_0x3ce3f3(0xb9)][_0x3ce3f3(0xe0)](_0x211185),_0x4efe7b['journey']['listJourneysWithDetailsFromParentSegment'](_0x211185,{'includeAllVersions':!![]}),_0x4efe7b[_0x3ce3f3(0xbe)][_0x3ce3f3(0xa0)]()]);return{'parentSegmentResult':_0x577770,'segmentsResult':_0x2b9722,'foldersResult':_0x450400,'journeysWithDetailsResult':_0x100b01,'userMaps':_0x400c00};},{'verbose':_0x5b2931[_0x46ff65(0xfd)]})[_0x46ff65(0x9c)](_0x2f0ef3=>_0x2f0ef3[_0x46ff65(0x8e)]),_0x94097d=_0x47b9b9,_0x2b31bf=extractRootFolderId(_0x94097d),_0xd4ea33=_0x1223e7,_0x5edf6f=_0x17322d,{journeys:_0x573b05,activationStepsById:_0x1e2fce}=_0x4fba05,_0x486cb7=new Map(_0x573b05['map'](_0x1fdc3a=>[_0x1fdc3a['id'],_0x1fdc3a])),_0x25658e=_0x573b05[_0x46ff65(0xcb)](_0x1a07d8=>({'id':_0x1a07d8['id'],'name':_0x1a07d8[_0x46ff65(0x87)][_0x46ff65(0xd1)],'journeyBundleName':_0x1a07d8[_0x46ff65(0x87)][_0x46ff65(0xd5)]||'','journeyBundleId':_0x1a07d8[_0x46ff65(0x87)]['journeyBundleId']||'','versionNumber':_0x1a07d8['attributes'][_0x46ff65(0xf6)],'description':_0x1a07d8['attributes'][_0x46ff65(0xbd)],'state':_0x1a07d8[_0x46ff65(0x87)][_0x46ff65(0xba)],'paused':_0x1a07d8['attributes'][_0x46ff65(0x84)],'audienceId':_0x1a07d8[_0x46ff65(0x87)][_0x46ff65(0xfb)],'folderId':_0x1a07d8[_0x46ff65(0xa2)]?.[_0x46ff65(0xca)]?.[_0x46ff65(0x8e)]?.['id'],'createdAt':_0x1a07d8[_0x46ff65(0x87)]['createdAt'],'updatedAt':_0x1a07d8[_0x46ff65(0x87)]['updatedAt']})),{emailToId:_0x1ba1e6,idToEmail:_0x2a9164}=_0xabe7a0,_0x10d59a=await withSpinner(_0x46ff65(0xa3),async()=>{const _0x45feae=_0x46ff65,_0x1ac61f=await _0x4efe7b[_0x45feae(0x10a)]['list']();return buildConnectionMaps(_0x1ac61f);},{'verbose':_0x5b2931[_0x46ff65(0xfd)]})[_0x46ff65(0x9c)](_0x31db68=>_0x31db68['data']),_0x5ed6be=_0x10d59a[_0x46ff65(0xee)],_0x1c6f28=_0x10d59a[_0x46ff65(0x89)],_0x3f010f=_0x10d59a[_0x46ff65(0x108)],_0x3ccb19={'emailToIdMap':_0x1ba1e6,'connectionNameToIdMap':_0x5ed6be,'connectionNameToTypeMap':_0x3f010f,'getSchema':_0x6e5935=>_0x4efe7b[_0x46ff65(0x10a)][_0x46ff65(0xdc)](_0x6e5935)};let {pathToId:_0x41cd50,idToPath:_0x267c16}=buildFolderMaps(_0x5edf6f);const _0x32b7f2=buildSegmentLookupMap(_0xd4ea33,_0x267c16),_0x1182de=buildSegmentNameToIdMap(_0xd4ea33),_0x39b346=buildJourneyBundleLookupMap(_0x25658e,_0x267c16);let _0xab53ff;if(_0x28602a){if(!_0x28602a['endsWith'](_0x46ff65(0xe7))&&!_0x28602a[_0x46ff65(0xd8)](_0x46ff65(0xb2)))return console[_0x46ff65(0xea)](a40_0x7eaf6d['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x28602a+'\x0a')),0x1;_0xab53ff=[_0x28602a];}else _0xab53ff=findYamlFiles(_0xfce0e);if(_0xab53ff[_0x46ff65(0x90)]===0x0)return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)](_0x46ff65(0x96)+_0xfce0e+'\x0a')),console[_0x46ff65(0xea)](a40_0x7eaf6d['cyan'](_0x46ff65(0xc0))),0x1;let _0x471228,_0x4a9241;try{const _0x3ab596=parseAndClassifyYamlFiles(_0xab53ff,_0xfce0e,{'skipSegments':_0x5b2931[_0x46ff65(0x102)]});_0x471228=_0x3ab596['segments'],_0x4a9241=_0x3ab596['journeys'];const _0x886d11=validateParsedFiles(_0x3ab596,_0xfce0e);if(_0x886d11[_0x46ff65(0x90)]>0x0)return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)](_0x46ff65(0xad))),console[_0x46ff65(0xea)](formatValidationErrors(_0x886d11)),console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0xef))),0x1;}catch(_0x239dc8){return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)]('Error\x20parsing\x20YAML:\x20'+(_0x239dc8 instanceof Error?_0x239dc8['message']:_0x239dc8))),0x1;}if(_0x471228['length']===0x0&&_0x4a9241['length']===0x0){const _0x2fbbd4=_0x5b2931[_0x46ff65(0x102)]?_0x46ff65(0xb6):_0x46ff65(0xb0);return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0xf9)+_0x2fbbd4+_0x46ff65(0xa4))),0x0;}const _0x3239b4=new Map();_0xd4ea33[_0x46ff65(0x90)]>0x0&&!_0x5b2931[_0x46ff65(0x102)]&&await withSpinner(_0x46ff65(0xe8),async()=>{await batchAsync(_0xd4ea33,async _0x16d52f=>{const _0x2f96fe=a40_0x42d2,_0x520b0b=await _0x4efe7b[_0x2f96fe(0xb9)][_0x2f96fe(0xdb)](_0x211185,_0x16d52f['id']);_0x3239b4[_0x2f96fe(0x86)](_0x16d52f['id'],_0x520b0b);});},{'verbose':_0x5b2931[_0x46ff65(0xfd)]});const {segmentFiles:_0x4b6312,foldersToCreate:_0x208bd5}=await prepareSegmentFiles(_0x471228,{'segmentByFolderAndName':_0x32b7f2,'activationsBySegmentId':_0x3239b4,'folderPathToId':_0x41cd50,'idToEmailMap':_0x2a9164,'connectionIdToNameMap':_0x1c6f28},_0x3ccb19,_0x1d0bb9,_0x48f524),_0x8f8ba2=_0x28602a?[]:findSegmentsToDelete(_0xd4ea33,_0x471228[_0x46ff65(0xcb)](({yamlConfig:_0x5b65ae,folderPath:_0x552baa})=>({'yamlConfig':_0x5b65ae,'folderPath':resolveTDFolderPath(_0x552baa,_0x1d0bb9,_0x48f524)})),_0x267c16,_0x48f524,_0x1d0bb9),{journeyFiles:_0x431c55,foldersToCreate:_0xcfc2c6}=await withProgressSpinner(_0x46ff65(0xcc),async _0x1e0b74=>prepareJourneyFiles(_0x4a9241,{'fetchJourney':async _0x1828b7=>_0x4efe7b[_0x46ff65(0xb6)][_0x46ff65(0xd4)](_0x1828b7[_0x46ff65(0xfa)]),'journeyBundlesByFolderAndName':_0x39b346,'folderPathToId':_0x41cd50,'idToEmailMap':_0x2a9164,'connectionIdToNameMap':_0x1c6f28,'existingSegments':_0xd4ea33,'parentId':_0x211185,'deps':_0x4efe7b,'progress':{'update':_0x29e782=>{_0x1e0b74['setPhase'](_0x29e782),_0x5b2931['verbose']&&console['error']('\x20\x20'+_0x29e782);}},'journeyById':_0x486cb7,'activationStepsById':_0x1e2fce},_0x1d0bb9,_0x48f524),{'verbose':_0x5b2931['verbose']})[_0x46ff65(0x9c)](_0x59ca9e=>_0x59ca9e[_0x46ff65(0x8e)]);for(const _0x4e5671 of _0xcfc2c6){_0x208bd5[_0x46ff65(0xe5)](_0x4e5671);}const _0x28ce98=_0x28602a?[]:findJourneysToDelete(_0x25658e,_0x4a9241[_0x46ff65(0xcb)](({yamlConfig:_0x1de08b,folderPath:_0x75b3a6})=>({'yamlConfig':_0x1de08b,'folderPath':resolveTDFolderPath(_0x75b3a6,_0x1d0bb9,_0x48f524)})),_0x267c16,_0x48f524,_0x1d0bb9),_0xbf4efe=calculatePushStats(_0x4b6312,_0x431c55,_0x208bd5,_0x8f8ba2,_0x28ce98,!!_0x5b2931[_0x46ff65(0x10b)],!!_0x5b2931[_0x46ff65(0x102)]),_0x54801e=_0xbf4efe['segments']['new'],_0x5c09bf=_0xbf4efe['segments']['changed'],_0x187c21=_0xbf4efe[_0x46ff65(0xd6)][_0x46ff65(0xc9)],_0x4ce36c=_0xbf4efe[_0x46ff65(0xd6)][_0x46ff65(0xfe)],_0x460bf2=_0xbf4efe[_0x46ff65(0xfc)]['toCreate'],_0x1704e3=_0xbf4efe[_0x46ff65(0x9f)][_0x46ff65(0xb1)],_0x1900d1=_0xbf4efe['journeys']['changed'],_0x89a4eb=_0xbf4efe[_0x46ff65(0x9f)][_0x46ff65(0xc9)],_0x4a1a5b=_0xbf4efe[_0x46ff65(0x9f)][_0x46ff65(0xfe)],_0x41ed84=_0xbf4efe[_0x46ff65(0x8b)][_0x46ff65(0x8a)],_0x556b45=_0xbf4efe[_0x46ff65(0x8b)][_0x46ff65(0xdf)],_0x373b54=_0xbf4efe[_0x46ff65(0x8b)]['toUpdate'],_0x29425a=_0xbf4efe['activations'][_0x46ff65(0xfe)];console['error'](_0x46ff65(0x85)+_0x2490fc+'\x27:');_0x460bf2[_0x46ff65(0x90)]>0x0&&console['error']('\x20\x20'+a40_0x7eaf6d['blue'](_0x46ff65(0xe3)+_0x460bf2[_0x46ff65(0x90)]+_0x46ff65(0x106)));if(!_0x5b2931[_0x46ff65(0x102)]){console[_0x46ff65(0xea)]('\x20\x20📊\x20Segments:'),console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x93)]('+\x20'+_0x54801e[_0x46ff65(0x90)]+_0x46ff65(0xc4))),console['error'](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0xbb)]('~\x20'+_0x5c09bf[_0x46ff65(0x90)]+_0x46ff65(0xf2)));if(_0x4ce36c[_0x46ff65(0x90)]>0x0)console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x97)]('-\x20'+_0x4ce36c[_0x46ff65(0x90)]+_0x46ff65(0xe2)));else _0x8f8ba2[_0x46ff65(0x90)]>0x0&&!_0x5b2931[_0x46ff65(0x10b)]&&console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x98)](_0x8f8ba2[_0x46ff65(0x90)]+_0x46ff65(0x81)));console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x98)]('=\x20'+_0x187c21[_0x46ff65(0x90)]+'\x20unchanged'));}if(_0x431c55[_0x46ff65(0x90)]>0x0||_0x28ce98[_0x46ff65(0x90)]>0x0){console['error']('\x20\x20🗺️\x20\x20Journeys:'),console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x93)]('+\x20'+_0x1704e3[_0x46ff65(0x90)]+'\x20new')),console[_0x46ff65(0xea)]('\x20\x20\x20\x20'+a40_0x7eaf6d['yellow']('~\x20'+_0x1900d1[_0x46ff65(0x90)]+'\x20changed'));if(_0x4a1a5b['length']>0x0)console['error'](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x97)]('-\x20'+_0x4a1a5b[_0x46ff65(0x90)]+_0x46ff65(0xe2)));else _0x28ce98['length']>0x0&&!_0x5b2931[_0x46ff65(0x10b)]&&console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d['dim'](_0x28ce98[_0x46ff65(0x90)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x46ff65(0xea)]('\x20\x20\x20\x20'+a40_0x7eaf6d['dim']('=\x20'+_0x89a4eb[_0x46ff65(0x90)]+'\x20unchanged'));}_0x41ed84[_0x46ff65(0x90)]>0x0&&!_0x5b2931[_0x46ff65(0x102)]&&(console[_0x46ff65(0xea)](''),console[_0x46ff65(0xea)]('\x20\x20Activations:'),_0x556b45[_0x46ff65(0x90)]>0x0&&console[_0x46ff65(0xea)]('\x20\x20\x20\x20'+a40_0x7eaf6d[_0x46ff65(0x93)]('+\x20'+_0x556b45[_0x46ff65(0x90)]+'\x20to\x20create')),_0x373b54['length']>0x0&&console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0xbb)]('~\x20'+_0x373b54[_0x46ff65(0x90)]+_0x46ff65(0x7d))),_0x29425a[_0x46ff65(0x90)]>0x0&&console[_0x46ff65(0xea)](_0x46ff65(0x80)+a40_0x7eaf6d[_0x46ff65(0x97)]('-\x20'+_0x29425a[_0x46ff65(0x90)]+_0x46ff65(0xe2))));console['error'](_0x46ff65(0xd0)+a40_0x7eaf6d[_0x46ff65(0xf5)](_0xfce0e)+'\x0a');if(_0x460bf2[_0x46ff65(0x90)]>0x0){console[_0x46ff65(0xea)](_0x46ff65(0x107));for(const _0x1a58f7 of _0x460bf2){console[_0x46ff65(0xea)]('\x20\x20'+a40_0x7eaf6d[_0x46ff65(0xa1)]('+')+'\x20'+_0x1a58f7);}console[_0x46ff65(0xea)]('');}if(_0x54801e['length']>0x0&&!_0x5b2931[_0x46ff65(0x102)])for(const _0x3f1e2c of _0x54801e){const _0x2a3364=_0x3f1e2c[_0x46ff65(0x9a)]?_0x3f1e2c[_0x46ff65(0x9a)]+'/'+_0x3f1e2c[_0x46ff65(0xab)][_0x46ff65(0xd1)]:_0x3f1e2c[_0x46ff65(0xab)][_0x46ff65(0xd1)],_0x1f9cb4=_0x3f1e2c[_0x46ff65(0xab)][_0x46ff65(0x8b)]?.[_0x46ff65(0x90)]||0x0,_0x24b766=_0x1f9cb4>0x0?a40_0x7eaf6d['dim']('\x20['+_0x1f9cb4+_0x46ff65(0x94)):'';console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d[_0x46ff65(0x93)]('New\x20segment:')+'\x20'+_0x2a3364+_0x24b766),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c)),_0x3f1e2c[_0x46ff65(0xf4)]&&console['error'](_0x3f1e2c[_0x46ff65(0xf4)]),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c));}if(_0x4ce36c[_0x46ff65(0x90)]>0x0&&!_0x5b2931[_0x46ff65(0x102)])for(const _0x5e1549 of _0x4ce36c){const _0x33b7d5=_0x5e1549['segmentFolderId']?_0x267c16['get'](_0x5e1549[_0x46ff65(0xaa)][_0x46ff65(0x82)]())||'':'',_0x430c5a=_0x33b7d5?_0x33b7d5+'/'+_0x5e1549[_0x46ff65(0xd1)]:_0x5e1549[_0x46ff65(0xd1)],_0x44d35c=_0x3239b4['get'](_0x5e1549['id'])||[],_0x412cfb=_0x44d35c[_0x46ff65(0x90)]>0x0?a40_0x7eaf6d[_0x46ff65(0x98)]('\x20['+_0x44d35c[_0x46ff65(0x90)]+_0x46ff65(0x94)):'';console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d[_0x46ff65(0x97)]('Delete\x20segment:')+'\x20'+_0x430c5a+_0x412cfb),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c));const _0x2a75e5=segmentWithActivationsToYaml(_0x5e1549,_0x44d35c,undefined,_0x2a9164,_0x1c6f28),_0x484be2=segmentToYamlString(_0x2a75e5),_0x1d5cfb=generateDiff(_0x484be2,'');console[_0x46ff65(0xea)](formatDiffWithColors(_0x1d5cfb)),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c));}const _0x4cbab2=_0x4b6312['filter'](_0x3d0809=>!_0x3d0809['isNew']&&_0x3d0809[_0x46ff65(0xf4)]);if(_0x4cbab2[_0x46ff65(0x90)]>0x0&&!_0x5b2931[_0x46ff65(0x102)])for(const _0x197d6d of _0x4cbab2){const _0x92355f=_0x197d6d['folderPath']?_0x197d6d['folderPath']+'/'+_0x197d6d[_0x46ff65(0xab)][_0x46ff65(0xd1)]:_0x197d6d[_0x46ff65(0xab)][_0x46ff65(0xd1)];console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0x83))+'\x20'+_0x92355f),console['error']('─'['repeat'](0x3c)),console[_0x46ff65(0xea)](_0x197d6d[_0x46ff65(0xf4)]),console[_0x46ff65(0xea)]('─'['repeat'](0x3c));}if(_0x1704e3[_0x46ff65(0x90)]>0x0)for(const _0x1bf9cb of _0x1704e3){const _0x4b37a5=_0x1bf9cb[_0x46ff65(0x9a)]?_0x1bf9cb[_0x46ff65(0x9a)]+'/'+_0x1bf9cb[_0x46ff65(0xab)][_0x46ff65(0xd1)]:_0x1bf9cb[_0x46ff65(0xab)][_0x46ff65(0xd1)];console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d['green'](_0x46ff65(0xb5))+'\x20'+_0x4b37a5),console['error']('─'[_0x46ff65(0xc1)](0x3c)),_0x1bf9cb[_0x46ff65(0xf4)]&&console[_0x46ff65(0xea)](_0x1bf9cb['diff']),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c));}const _0x560fc3=_0x431c55[_0x46ff65(0x8f)](_0x473b2e=>!_0x473b2e[_0x46ff65(0x100)]&&_0x473b2e[_0x46ff65(0xf4)]);if(_0x560fc3[_0x46ff65(0x90)]>0x0)for(const _0x3ad462 of _0x560fc3){const _0x2d0032=_0x3ad462[_0x46ff65(0x9a)]?_0x3ad462['folderPath']+'/'+_0x3ad462[_0x46ff65(0xab)][_0x46ff65(0xd1)]:_0x3ad462[_0x46ff65(0xab)][_0x46ff65(0xd1)];console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0xbc))+'\x20'+_0x2d0032),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c)),console[_0x46ff65(0xea)](_0x3ad462['diff']),console[_0x46ff65(0xea)]('─'['repeat'](0x3c));}if(_0x4a1a5b[_0x46ff65(0x90)]>0x0)for(const _0x248174 of _0x4a1a5b){const _0x14137c=_0x248174[_0x46ff65(0xac)]?_0x267c16['get'](_0x248174['folderId'])||'':'',_0x271b6d=_0x14137c?_0x14137c+'/'+_0x248174[_0x46ff65(0xd5)]:_0x248174[_0x46ff65(0xd5)];console[_0x46ff65(0xea)]('\x0a'+a40_0x7eaf6d['red'](_0x46ff65(0xa5))+'\x20'+_0x271b6d),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c)),console[_0x46ff65(0xea)](a40_0x7eaf6d['red']('(Journey\x20will\x20be\x20deleted)')),console[_0x46ff65(0xea)]('─'[_0x46ff65(0xc1)](0x3c));}if(_0x5b2931[_0x46ff65(0xb7)])return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x2b6fd4=_0x5b2931[_0x46ff65(0x102)]?![]:_0x54801e[_0x46ff65(0x90)]>0x0||_0x5c09bf[_0x46ff65(0x90)]>0x0||_0x4ce36c[_0x46ff65(0x90)]>0x0,_0x5d7dc1=_0x1704e3['length']>0x0||_0x1900d1[_0x46ff65(0x90)]>0x0||_0x4a1a5b[_0x46ff65(0x90)]>0x0,_0x9b7795=_0x5b2931['journeysOnly']?![]:_0x41ed84['length']>0x0,_0x5e9caa=_0x460bf2[_0x46ff65(0x90)]>0x0;if(!_0x2b6fd4&&!_0x5d7dc1&&!_0x9b7795&&!_0x5e9caa){const _0xf8fc1=_0x5b2931[_0x46ff65(0x102)]?_0x46ff65(0xb8):_0x46ff65(0xf3);console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x93)](_0xf8fc1));if(_0x28602a&&_0x187c21[_0x46ff65(0x90)]===0x1){const _0x6dc4e1=_0x187c21[0x0];if(_0x6dc4e1[_0x46ff65(0xa6)]?.['id']){const _0x150fd3=getConsoleNextUrl(_0x5b2931[_0x46ff65(0x92)],_0x46ff65(0x95)+_0x211185+_0x46ff65(0xf0)+_0x6dc4e1['existingSegment']['id']+_0x46ff65(0x109));console[_0x46ff65(0xea)](_0x46ff65(0x110)+a40_0x7eaf6d[_0x46ff65(0xf5)](_0x150fd3));}}if(_0x28602a&&_0x89a4eb[_0x46ff65(0x90)]===0x1){const _0x25e258=_0x89a4eb[0x0];if(_0x25e258[_0x46ff65(0x101)]?.['id']){const _0x29d3cf=getConsoleNextUrl(_0x5b2931['site'],'/app/ps/'+_0x211185+_0x46ff65(0xf0)+_0x25e258['existingJourney']['id']+'/j/da/je');console[_0x46ff65(0xea)]('\x20\x20'+a40_0x7eaf6d[_0x46ff65(0xf5)](_0x29d3cf));}}return 0x0;}const _0x1cb719=_0x5b2931['journeysOnly']?_0x1704e3[_0x46ff65(0x90)]+_0x1900d1[_0x46ff65(0x90)]+_0x4a1a5b[_0x46ff65(0x90)]+_0x460bf2['length']:_0x54801e[_0x46ff65(0x90)]+_0x5c09bf[_0x46ff65(0x90)]+_0x4ce36c[_0x46ff65(0x90)]+_0x1704e3[_0x46ff65(0x90)]+_0x1900d1[_0x46ff65(0x90)]+_0x4a1a5b[_0x46ff65(0x90)]+_0x460bf2[_0x46ff65(0x90)]+_0x41ed84[_0x46ff65(0x90)];if(!_0x5b2931[_0x46ff65(0xc2)]&&_0x1cb719>0x0){if(!isInteractive())return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x97)]('\x0aError:'),_0x46ff65(0xc3)),console['error'](a40_0x7eaf6d['dim'](_0x46ff65(0xed))),0x1;const _0x4ffea9=await confirmKey(_0x46ff65(0xda)+_0x1cb719+'\x20changes?');if(!_0x4ffea9)return console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0x7e))),0x1;}const _0x5bb532={'withProgress':async(_0x1a683e,_0x5f053a)=>{const _0x293389=_0x46ff65,_0x3ffbea=await withSpinner(_0x1a683e,_0x5f053a,{'verbose':_0x5b2931[_0x293389(0xfd)]});return{'data':_0x3ffbea[_0x293389(0x8e)]};},'logInfo':_0x505493=>console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xa1)]('✔\x20'+_0x505493)),'logSuccess':_0x5c4120=>console[_0x46ff65(0xea)](a40_0x7eaf6d['green']('✔\x20'+_0x5c4120)),'logWarning':_0x23efe3=>console[_0x46ff65(0xea)](a40_0x7eaf6d['yellow']('⚠\x20'+_0x23efe3)),'logDeleted':_0x3de8cd=>console['error'](a40_0x7eaf6d[_0x46ff65(0x97)]('✔\x20'+_0x3de8cd))},_0x5039ec={'segment':_0x4efe7b['segment'],'journey':_0x4efe7b['journey'],'user':_0x4efe7b[_0x46ff65(0xbe)],'connection':_0x4efe7b[_0x46ff65(0x10a)]};_0x460bf2[_0x46ff65(0x90)]>0x0&&(_0x41cd50=await executePushFolders(_0x5039ec,_0x460bf2,_0x41cd50,{'parentId':_0x211185},_0x5bb532));const _0x4f7428={'rootFolderId':_0x2b31bf,'folderPathToId':_0x41cd50,'folderIdToPath':_0x267c16,'segmentNameToId':_0x1182de,'activationsBySegmentId':_0x3239b4,'emailToIdMap':_0x1ba1e6,'idToEmailMap':_0x2a9164,'connectionNameToIdMap':_0x10d59a[_0x46ff65(0xee)],'connectionIdToNameMap':_0x10d59a[_0x46ff65(0x89)],'connectionNameToTypeMap':_0x3f010f},_0x441b16=await executePushSegments(_0x5039ec,_0x5b2931[_0x46ff65(0x102)]?[]:_0x4b6312,_0x4f7428,{'parentId':_0x211185},_0x5bb532),_0x328be6=_0x441b16[_0x46ff65(0x10f)],_0x503f31=_0x441b16['updated'],_0x24a226=_0x441b16[_0x46ff65(0x8b)][_0x46ff65(0x10f)],_0x3858bc=_0x441b16[_0x46ff65(0x8b)][_0x46ff65(0xa8)],_0x217eb4=_0x441b16[_0x46ff65(0x8b)]['deleted'];let _0x33c27e;if(_0x28602a&&_0x4b6312['length']===0x1){const _0x1fe266=_0x4b6312[0x0];_0x33c27e=_0x1fe266[_0x46ff65(0xa6)]?.['id']??_0x441b16['createdSegmentIds']['get'](_0x1fe266[_0x46ff65(0xab)][_0x46ff65(0xd1)]);}const _0x5a019c=await executePushSegmentDeletions(_0x5039ec,_0x5b2931[_0x46ff65(0x102)]?[]:_0x4ce36c,_0x5bb532);let _0x3933fb=0x0,_0x789372=0x0,_0x3f6944=0x0;const _0x288126=new Map(_0x1182de);for(const [_0x53ff0c,_0x2ddb82]of _0x441b16[_0x46ff65(0xeb)]){_0x288126[_0x46ff65(0x86)](_0x53ff0c,_0x2ddb82);}if(_0x431c55[_0x46ff65(0x90)]>0x0){const _0x7bc1c8={..._0x4f7428,'segmentNameToId':_0x288126,'existingSegments':_0xd4ea33,'activationContext':_0x3ccb19},_0x14424c=await executePushJourneys(_0x5039ec,_0x431c55,_0x7bc1c8,{'parentId':_0x211185,'rootFolderId':_0x2b31bf,'verbose':_0x5b2931[_0x46ff65(0xfd)]},_0x5bb532);_0x3933fb=_0x14424c[_0x46ff65(0x10f)],_0x789372=_0x14424c[_0x46ff65(0xa8)];if(_0x28602a&&_0x14424c[_0x46ff65(0x99)][_0x46ff65(0x90)]===0x1){const _0x5d33b7=_0x14424c[_0x46ff65(0x99)][0x0];if(_0x5d33b7[_0x46ff65(0xfa)]){const _0x3001c4=getConsoleNextUrl(_0x5b2931[_0x46ff65(0x92)],_0x46ff65(0x95)+_0x211185+'/e/'+_0x5d33b7[_0x46ff65(0xfa)]+_0x46ff65(0xf8));console[_0x46ff65(0xea)]('\x20\x20'+a40_0x7eaf6d['cyan'](_0x3001c4));}}}for(const _0x9276cf of _0x4a1a5b){console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0xbb)](_0x46ff65(0xd7)+_0x9276cf[_0x46ff65(0xd5)])),_0x3f6944++;}const _0x33e5ad=[];if(_0x328be6>0x0)_0x33e5ad[_0x46ff65(0x9b)](_0x328be6+'\x20created');if(_0x503f31>0x0)_0x33e5ad[_0x46ff65(0x9b)](_0x503f31+_0x46ff65(0x88));if(_0x5a019c>0x0)_0x33e5ad['push'](_0x5a019c+_0x46ff65(0xf1));const _0x288c9e=[];if(_0x3933fb>0x0)_0x288c9e['push'](_0x3933fb+_0x46ff65(0xa9));if(_0x789372>0x0)_0x288c9e[_0x46ff65(0x9b)](_0x789372+_0x46ff65(0x88));if(_0x3f6944>0x0)_0x288c9e[_0x46ff65(0x9b)](_0x3f6944+'\x20deleted');const _0x188424=[];if(_0x24a226>0x0)_0x188424[_0x46ff65(0x9b)](_0x24a226+_0x46ff65(0xa9));if(_0x3858bc>0x0)_0x188424['push'](_0x3858bc+_0x46ff65(0x88));if(_0x217eb4>0x0)_0x188424['push'](_0x217eb4+_0x46ff65(0xf1));console[_0x46ff65(0xea)](a40_0x7eaf6d[_0x46ff65(0x93)](_0x46ff65(0x7f)));_0x33e5ad[_0x46ff65(0x90)]>0x0&&!_0x5b2931['journeysOnly']&&console[_0x46ff65(0xea)]('\x20\x20Segments:\x20'+_0x33e5ad['join'](',\x20'));_0x288c9e['length']>0x0&&console[_0x46ff65(0xea)](_0x46ff65(0xde)+_0x288c9e[_0x46ff65(0xe6)](',\x20'));_0x188424[_0x46ff65(0x90)]>0x0&&!_0x5b2931['journeysOnly']&&console['error'](_0x46ff65(0xdd)+_0x188424[_0x46ff65(0xe6)](',\x20'));if(_0x33c27e){const _0x389f5a=getConsoleNextUrl(_0x5b2931[_0x46ff65(0x92)],_0x46ff65(0x95)+_0x211185+'/e/'+_0x33c27e+'/sb/da/esr');console[_0x46ff65(0xea)](_0x46ff65(0x110)+a40_0x7eaf6d[_0x46ff65(0xf5)](_0x389f5a));}return 0x0;}}
|
|
1
|
+
const a40_0x2fcf53=a40_0x2f90;(function(_0x1ad24d,_0x4f4cfa){const _0x7c60c9=a40_0x2f90,_0x55f82a=_0x1ad24d();while(!![]){try{const _0x29f987=-parseInt(_0x7c60c9(0xfc))/0x1*(-parseInt(_0x7c60c9(0x12c))/0x2)+-parseInt(_0x7c60c9(0x149))/0x3+parseInt(_0x7c60c9(0x123))/0x4*(-parseInt(_0x7c60c9(0x114))/0x5)+-parseInt(_0x7c60c9(0x155))/0x6*(-parseInt(_0x7c60c9(0xff))/0x7)+-parseInt(_0x7c60c9(0x104))/0x8+parseInt(_0x7c60c9(0x113))/0x9+parseInt(_0x7c60c9(0xe3))/0xa;if(_0x29f987===_0x4f4cfa)break;else _0x55f82a['push'](_0x55f82a['shift']());}catch(_0x1acabc){_0x55f82a['push'](_0x55f82a['shift']());}}}(a40_0x47ec,0x5c3d9));import{BaseCommand}from'./command.js';import{withSpinner,withProgressSpinner}from'../utils/spinner.js';import{generateDiff,formatDiffWithColors}from'../utils/diff.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{batchAsync}from'../utils/async.js';function a40_0x2f90(_0x9b1aaf,_0x1adf5d){_0x9b1aaf=_0x9b1aaf-0xd1;const _0x47ec90=a40_0x47ec();let _0x2f90fb=_0x47ec90[_0x9b1aaf];return _0x2f90fb;}import{segmentToYamlString,segmentWithActivationsToYaml}from'../sdk/segment/child-segment-yaml.js';import a40_0x22f913 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';function a40_0x47ec(){const _0x5032ca=['endsWith','\x20YAML\x20files\x20found','Delete\x20journey:','data','journeyBundleName','existingJourney','length','then','file','add','1773156jzkHVO','list','Fetching\x20existing\x20data...','message','journeysOnly','description','📁\x20','No\x20','\x20to\x20update','createdSegmentIds','yellow','segment\x20or\x20journey','3846NRVpGU','folderPath','Delete\x20segment:','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','(Journey\x20will\x20be\x20deleted)','\x0aPush\x20summary\x20for\x20\x27','/j/da/je','execute','segments','New\x20segment:','set','no_parent','\x20changed','\x20\x20📊\x20Segments:','toString','filter','idToName','\x20changes?','delete','updatedAt','attributes','segment','\x20created','isNew','cwd','Parent\x20segment:\x20','get','\x20\x20🗺️\x20\x20Journeys:','Fetching\x20connections\x20for\x20name\x20resolution...','site','createdAt','filePath','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','Error:\x20Directory\x20not\x20found:\x20','created','blue','listFolders','Fetching\x20existing\x20activations...','\x20to\x20create','connection','journeys','toUpdate','/e/','\x20new','activations','445150BSClWP','Source\x20directory:\x20','.yml','\x20\x20Segments:\x20','/app/ps/','parentSegment','listSegments','versionNumber','\x27...','\x20\x20\x20\x20','error','Error\x20parsing\x20YAML:\x20','\x20activations]','/sb/da/esr','map','\x0a✔\x20Push\x20complete','buildUserMaps','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','join','diff','yamlConfig','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','repeat','\x20\x20Journeys:\x20','getOutputSchemaWithCache','1trdyzQ','updated','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','3878XtqoIN','changed','green','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','3632992CDePkZ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','segmentFolderId','\x20deleted','Aborted.','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','existingSegment','verbose','helpText','push','results','\x20\x20Source:\x20','parentName','journey','Preparing\x20journeys...','6483096wOrcJM','280655tgvrIF','segment:push','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','nameToId','unchanged','Changes\x20to:','targetDir','audienceId','type','new','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20updated','nameToType','Usage:\x20tdx\x20sg\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20(requires\x20context)','Push\x20','28wBcwCV','all','\x20\x20Activations:','errorCode','Site:\x20','\x0aError:','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','getJourney','\x20to\x20delete','1391874hiahve','isScoped','cyan','journeyBundleId','red','dim','parent_name','toDelete','listActivations','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','journeyId','setPhase','dryRun','getParent','resolveParentId','name','\x20unchanged','parentFolder','toCreate'];a40_0x47ec=function(){return _0x5032ca;};return a40_0x47ec();}import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{[a40_0x2fcf53(0x13b)]=a40_0x2fcf53(0x115);[a40_0x2fcf53(0x14e)]=a40_0x2fcf53(0xfe);async[a40_0x2fcf53(0x15c)](_0x4f336e){const _0x439ecf=a40_0x2fcf53,{options:_0x25d6a1,args:_0x456591,tdx:_0x285d70}=_0x4f336e,_0x47e7eb=_0x25d6a1,_0x1c0e4c=await resolveTarget({'arg':_0x456591[0x0],'contextParent':_0x25d6a1[_0x439ecf(0xe8)],'cwd':process[_0x439ecf(0x16d)]()});if(!isSuccessfulResolution(_0x1c0e4c))return _0x1c0e4c[_0x439ecf(0x126)]===_0x439ecf(0x160)?(console[_0x439ecf(0xed)](a40_0x22f913['yellow'](_0x439ecf(0x158))),console[_0x439ecf(0xed)](_0x439ecf(0x121)),console[_0x439ecf(0xed)](_0x439ecf(0x129)),console[_0x439ecf(0xed)](_0x439ecf(0x105))):(console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)]('Error:\x20'+_0x1c0e4c[_0x439ecf(0x14c)]+'\x0a')),_0x1c0e4c[_0x439ecf(0x10c)]&&console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x12e)](_0x1c0e4c[_0x439ecf(0x10c)]))),0x1;if(_0x1c0e4c[_0x439ecf(0x11c)]===_0x439ecf(0x132))return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0xd7)+_0x1c0e4c[_0x439ecf(0x11a)]+'\x0a')),console['error'](a40_0x22f913['cyan'](_0x439ecf(0x102))),0x1;const _0x11c47f=_0x1c0e4c[_0x439ecf(0x110)],_0x3c26b9=_0x1c0e4c[_0x439ecf(0x11a)],_0x526070=_0x1c0e4c['type']===_0x439ecf(0x147)?_0x1c0e4c[_0x439ecf(0xd5)]:undefined,_0x101159=getScopedDetails(_0x1c0e4c),_0x56b228=_0x101159?.[_0x439ecf(0x12d)]??![],_0x31b0dd=_0x101159?.['scopedFolderPath']??'';if(!existsSync(_0x3c26b9))return console['error'](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0xd7)+_0x3c26b9+'\x0a')),console[_0x439ecf(0xed)](a40_0x22f913['cyan'](_0x439ecf(0x102))),0x1;_0x47e7eb[_0x439ecf(0x10b)]&&(console[_0x439ecf(0xed)](_0x439ecf(0x127)+_0x47e7eb[_0x439ecf(0xd3)]),console[_0x439ecf(0xed)](_0x439ecf(0x16e)+_0x11c47f),console[_0x439ecf(0xed)](_0x439ecf(0xe4)+_0x3c26b9),_0x56b228&&console[_0x439ecf(0xed)]('Scoped\x20to\x20folder:\x20'+_0x31b0dd));const _0xa9de90=await withSpinner('Resolving\x20parent\x20segment\x20\x27'+_0x11c47f+_0x439ecf(0xeb),()=>_0x285d70['segment'][_0x439ecf(0x13a)](_0x11c47f),{'verbose':_0x47e7eb[_0x439ecf(0x10b)]}),_0x42beaf=_0xa9de90[_0x439ecf(0x142)],{parentSegmentResult:_0x58b769,segmentsResult:_0x36a172,foldersResult:_0x250ab5,journeysWithDetailsResult:_0x10d7d2,userMaps:_0x2878a2}=await withSpinner(_0x439ecf(0x14b),async()=>{const _0x2e8ad8=_0x439ecf,[_0x569f8b,_0x3d5c63,_0x32dee9,_0x2f1186,_0x19e130]=await Promise[_0x2e8ad8(0x124)]([_0x285d70['segment'][_0x2e8ad8(0x139)](_0x42beaf),_0x285d70[_0x2e8ad8(0x16a)][_0x2e8ad8(0xe9)](_0x42beaf),_0x285d70[_0x2e8ad8(0x16a)][_0x2e8ad8(0xda)](_0x42beaf),_0x285d70['journey']['listJourneysWithDetailsFromParentSegment'](_0x42beaf,{'includeAllVersions':!![]}),_0x285d70['user'][_0x2e8ad8(0xf3)]()]);return{'parentSegmentResult':_0x569f8b,'segmentsResult':_0x3d5c63,'foldersResult':_0x32dee9,'journeysWithDetailsResult':_0x2f1186,'userMaps':_0x19e130};},{'verbose':_0x47e7eb[_0x439ecf(0x10b)]})[_0x439ecf(0x146)](_0x56af9d=>_0x56af9d[_0x439ecf(0x142)]),_0x39e061=_0x58b769,_0x1590dc=extractRootFolderId(_0x39e061),_0x2806f9=_0x36a172,_0x8fd04=_0x250ab5,{journeys:_0x5ef610,activationStepsById:_0x24f48a}=_0x10d7d2,_0x1afff1=new Map(_0x5ef610[_0x439ecf(0xf1)](_0x230fb7=>[_0x230fb7['id'],_0x230fb7])),_0x2ff95b=_0x5ef610[_0x439ecf(0xf1)](_0x235a04=>({'id':_0x235a04['id'],'name':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x13b)],'journeyBundleName':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x143)]||'','journeyBundleId':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x12f)]||'','versionNumber':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0xea)],'description':_0x235a04['attributes'][_0x439ecf(0x14e)],'state':_0x235a04[_0x439ecf(0x169)]['state'],'paused':_0x235a04['attributes']['paused'],'audienceId':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x11b)],'folderId':_0x235a04['relationships']?.[_0x439ecf(0x13d)]?.['data']?.['id'],'createdAt':_0x235a04['attributes'][_0x439ecf(0xd4)],'updatedAt':_0x235a04[_0x439ecf(0x169)][_0x439ecf(0x168)]})),{emailToId:_0x58589a,idToEmail:_0x35489e}=_0x2878a2,_0x2f77cf=await withSpinner(_0x439ecf(0xd2),async()=>{const _0x1db542=_0x439ecf,_0x10c130=await _0x285d70[_0x1db542(0xdd)][_0x1db542(0x14a)]();return buildConnectionMaps(_0x10c130);},{'verbose':_0x47e7eb[_0x439ecf(0x10b)]})[_0x439ecf(0x146)](_0x5b2a0a=>_0x5b2a0a[_0x439ecf(0x142)]),_0x2b56e6=_0x2f77cf['nameToId'],_0x5c6adb=_0x2f77cf[_0x439ecf(0x165)],_0x4dddb5=_0x2f77cf[_0x439ecf(0x120)],_0x4509d2={'emailToIdMap':_0x58589a,'connectionNameToIdMap':_0x2b56e6,'connectionNameToTypeMap':_0x4dddb5,'getSchema':_0x1d5e86=>_0x285d70[_0x439ecf(0xdd)][_0x439ecf(0xfb)](_0x1d5e86)};let {pathToId:_0x15f091,idToPath:_0x448c6c}=buildFolderMaps(_0x8fd04);const _0x929823=buildSegmentLookupMap(_0x2806f9,_0x448c6c),_0x199e59=buildSegmentNameToIdMap(_0x2806f9),_0x426542=buildJourneyBundleLookupMap(_0x2ff95b,_0x448c6c);let _0x33dd0e;if(_0x526070){if(!_0x526070[_0x439ecf(0x13f)](_0x439ecf(0xe5))&&!_0x526070['endsWith']('.yaml'))return console[_0x439ecf(0xed)](a40_0x22f913['red']('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x526070+'\x0a')),0x1;_0x33dd0e=[_0x526070];}else _0x33dd0e=findYamlFiles(_0x3c26b9);if(_0x33dd0e[_0x439ecf(0x145)]===0x0)return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x11e)+_0x3c26b9+'\x0a')),console['error'](a40_0x22f913[_0x439ecf(0x12e)]('Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files')),0x1;let _0x2cfbc0,_0x2481fd;try{const _0x5585fb=parseAndClassifyYamlFiles(_0x33dd0e,_0x3c26b9,{'skipSegments':_0x47e7eb[_0x439ecf(0x14d)]});_0x2cfbc0=_0x5585fb[_0x439ecf(0x15d)],_0x2481fd=_0x5585fb['journeys'];const _0x4ec4e2=validateParsedFiles(_0x5585fb,_0x3c26b9);if(_0x4ec4e2[_0x439ecf(0x145)]>0x0)return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)]('\x0aValidation\x20failed:')),console['error'](formatValidationErrors(_0x4ec4e2)),console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x109))),0x1;}catch(_0x17b30c){return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0xee)+(_0x17b30c instanceof Error?_0x17b30c[_0x439ecf(0x14c)]:_0x17b30c))),0x1;}if(_0x2cfbc0[_0x439ecf(0x145)]===0x0&&_0x2481fd[_0x439ecf(0x145)]===0x0){const _0x50f1c7=_0x47e7eb[_0x439ecf(0x14d)]?'journey':_0x439ecf(0x154);return console['error'](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x150)+_0x50f1c7+_0x439ecf(0x140))),0x0;}const _0x43ca50=new Map();_0x2806f9[_0x439ecf(0x145)]>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&await withSpinner(_0x439ecf(0xdb),async()=>{await batchAsync(_0x2806f9,async _0x4fba7d=>{const _0x43ec7d=a40_0x2f90,_0xe2063d=await _0x285d70[_0x43ec7d(0x16a)][_0x43ec7d(0x134)](_0x42beaf,_0x4fba7d['id']);_0x43ca50['set'](_0x4fba7d['id'],_0xe2063d);});},{'verbose':_0x47e7eb['verbose']});const {segmentFiles:_0x18e5c7,foldersToCreate:_0x14d5a5}=await prepareSegmentFiles(_0x2cfbc0,{'segmentByFolderAndName':_0x929823,'activationsBySegmentId':_0x43ca50,'folderPathToId':_0x15f091,'idToEmailMap':_0x35489e,'connectionIdToNameMap':_0x5c6adb},_0x4509d2,_0x56b228,_0x31b0dd),_0x3ba4c1=_0x526070?[]:findSegmentsToDelete(_0x2806f9,_0x2cfbc0[_0x439ecf(0xf1)](({yamlConfig:_0x3c77e0,folderPath:_0x428414})=>({'yamlConfig':_0x3c77e0,'folderPath':resolveTDFolderPath(_0x428414,_0x56b228,_0x31b0dd)})),_0x448c6c,_0x31b0dd,_0x56b228),{journeyFiles:_0x911338,foldersToCreate:_0xf4ffce}=await withProgressSpinner(_0x439ecf(0x112),async _0x379d4e=>prepareJourneyFiles(_0x2481fd,{'fetchJourney':async _0x15c8a7=>_0x285d70['journey'][_0x439ecf(0x12a)](_0x15c8a7[_0x439ecf(0x136)]),'journeyBundlesByFolderAndName':_0x426542,'folderPathToId':_0x15f091,'idToEmailMap':_0x35489e,'connectionIdToNameMap':_0x5c6adb,'existingSegments':_0x2806f9,'parentId':_0x42beaf,'deps':_0x285d70,'progress':{'update':_0x2ef27e=>{const _0x4e2f80=_0x439ecf;_0x379d4e[_0x4e2f80(0x137)](_0x2ef27e),_0x47e7eb[_0x4e2f80(0x10b)]&&console[_0x4e2f80(0xed)]('\x20\x20'+_0x2ef27e);}},'journeyById':_0x1afff1,'activationStepsById':_0x24f48a},_0x56b228,_0x31b0dd),{'verbose':_0x47e7eb[_0x439ecf(0x10b)]})[_0x439ecf(0x146)](_0x4b4cb6=>_0x4b4cb6[_0x439ecf(0x142)]);for(const _0x3165e4 of _0xf4ffce){_0x14d5a5[_0x439ecf(0x148)](_0x3165e4);}const _0x5f58db=_0x526070?[]:findJourneysToDelete(_0x2ff95b,_0x2481fd[_0x439ecf(0xf1)](({yamlConfig:_0x22b8f4,folderPath:_0x4e67ce})=>({'yamlConfig':_0x22b8f4,'folderPath':resolveTDFolderPath(_0x4e67ce,_0x56b228,_0x31b0dd)})),_0x448c6c,_0x31b0dd,_0x56b228),_0x1cea0b=calculatePushStats(_0x18e5c7,_0x911338,_0x14d5a5,_0x3ba4c1,_0x5f58db,!!_0x47e7eb['delete'],!!_0x47e7eb[_0x439ecf(0x14d)]),_0x1c9ccc=_0x1cea0b[_0x439ecf(0x15d)][_0x439ecf(0x11d)],_0x47ac70=_0x1cea0b['segments']['changed'],_0x4d3c4d=_0x1cea0b['segments'][_0x439ecf(0x118)],_0x265d72=_0x1cea0b['segments'][_0x439ecf(0x133)],_0x19619f=_0x1cea0b['folders'][_0x439ecf(0x13e)],_0x51bf39=_0x1cea0b[_0x439ecf(0xde)][_0x439ecf(0x11d)],_0x193fd4=_0x1cea0b['journeys'][_0x439ecf(0x100)],_0x2290ed=_0x1cea0b[_0x439ecf(0xde)][_0x439ecf(0x118)],_0xc85623=_0x1cea0b[_0x439ecf(0xde)][_0x439ecf(0x133)],_0x1905d3=_0x1cea0b[_0x439ecf(0xe2)]['all'],_0x58fabe=_0x1cea0b[_0x439ecf(0xe2)]['toCreate'],_0x453cf7=_0x1cea0b[_0x439ecf(0xe2)][_0x439ecf(0xdf)],_0x541c7c=_0x1cea0b[_0x439ecf(0xe2)][_0x439ecf(0x133)];console[_0x439ecf(0xed)](_0x439ecf(0x15a)+_0x11c47f+'\x27:');_0x19619f[_0x439ecf(0x145)]>0x0&&console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913['blue'](_0x439ecf(0x14f)+_0x19619f['length']+'\x20folders\x20to\x20create'));if(!_0x47e7eb[_0x439ecf(0x14d)]){console['error'](_0x439ecf(0x162)),console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x101)]('+\x20'+_0x1c9ccc[_0x439ecf(0x145)]+_0x439ecf(0xe1))),console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x153)]('~\x20'+_0x47ac70[_0x439ecf(0x145)]+'\x20changed'));if(_0x265d72['length']>0x0)console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x130)]('-\x20'+_0x265d72[_0x439ecf(0x145)]+_0x439ecf(0x12b)));else _0x3ba4c1['length']>0x0&&!_0x47e7eb[_0x439ecf(0x167)]&&console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913[_0x439ecf(0x131)](_0x3ba4c1[_0x439ecf(0x145)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913['dim']('=\x20'+_0x4d3c4d[_0x439ecf(0x145)]+_0x439ecf(0x13c)));}if(_0x911338[_0x439ecf(0x145)]>0x0||_0x5f58db[_0x439ecf(0x145)]>0x0){console['error'](_0x439ecf(0xd1)),console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913['green']('+\x20'+_0x51bf39[_0x439ecf(0x145)]+_0x439ecf(0xe1))),console['error'](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x153)]('~\x20'+_0x193fd4[_0x439ecf(0x145)]+_0x439ecf(0x161)));if(_0xc85623[_0x439ecf(0x145)]>0x0)console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913[_0x439ecf(0x130)]('-\x20'+_0xc85623['length']+'\x20to\x20delete'));else _0x5f58db['length']>0x0&&!_0x47e7eb[_0x439ecf(0x167)]&&console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913[_0x439ecf(0x131)](_0x5f58db[_0x439ecf(0x145)]+_0x439ecf(0xf4)));console[_0x439ecf(0xed)]('\x20\x20\x20\x20'+a40_0x22f913[_0x439ecf(0x131)]('=\x20'+_0x2290ed[_0x439ecf(0x145)]+_0x439ecf(0x13c)));}_0x1905d3[_0x439ecf(0x145)]>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&(console[_0x439ecf(0xed)](''),console[_0x439ecf(0xed)](_0x439ecf(0x125)),_0x58fabe[_0x439ecf(0x145)]>0x0&&console['error']('\x20\x20\x20\x20'+a40_0x22f913['green']('+\x20'+_0x58fabe[_0x439ecf(0x145)]+_0x439ecf(0xdc))),_0x453cf7[_0x439ecf(0x145)]>0x0&&console['error'](_0x439ecf(0xec)+a40_0x22f913['yellow']('~\x20'+_0x453cf7['length']+_0x439ecf(0x151))),_0x541c7c[_0x439ecf(0x145)]>0x0&&console[_0x439ecf(0xed)](_0x439ecf(0xec)+a40_0x22f913['red']('-\x20'+_0x541c7c[_0x439ecf(0x145)]+_0x439ecf(0x12b))));console[_0x439ecf(0xed)](_0x439ecf(0x10f)+a40_0x22f913[_0x439ecf(0x12e)](_0x3c26b9)+'\x0a');if(_0x19619f['length']>0x0){console[_0x439ecf(0xed)]('Folders\x20to\x20create:');for(const _0x588c9a of _0x19619f){console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913[_0x439ecf(0xd9)]('+')+'\x20'+_0x588c9a);}console[_0x439ecf(0xed)]('');}if(_0x1c9ccc[_0x439ecf(0x145)]>0x0&&!_0x47e7eb[_0x439ecf(0x14d)])for(const _0x20d509 of _0x1c9ccc){const _0x6f7c8=_0x20d509[_0x439ecf(0x156)]?_0x20d509[_0x439ecf(0x156)]+'/'+_0x20d509[_0x439ecf(0xf7)][_0x439ecf(0x13b)]:_0x20d509[_0x439ecf(0xf7)]['name'],_0x4414d3=_0x20d509[_0x439ecf(0xf7)]['activations']?.['length']||0x0,_0x15fb98=_0x4414d3>0x0?a40_0x22f913['dim']('\x20['+_0x4414d3+_0x439ecf(0xef)):'';console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x101)](_0x439ecf(0x15e))+'\x20'+_0x6f7c8+_0x15fb98),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),_0x20d509[_0x439ecf(0xf6)]&&console['error'](_0x20d509[_0x439ecf(0xf6)]),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c));}if(_0x265d72['length']>0x0&&!_0x47e7eb['journeysOnly'])for(const _0x416dcc of _0x265d72){const _0x247dc9=_0x416dcc['segmentFolderId']?_0x448c6c['get'](_0x416dcc[_0x439ecf(0x106)][_0x439ecf(0x163)]())||'':'',_0x537e95=_0x247dc9?_0x247dc9+'/'+_0x416dcc[_0x439ecf(0x13b)]:_0x416dcc[_0x439ecf(0x13b)],_0x19f92d=_0x43ca50[_0x439ecf(0x16f)](_0x416dcc['id'])||[],_0x44e9e8=_0x19f92d[_0x439ecf(0x145)]>0x0?a40_0x22f913[_0x439ecf(0x131)]('\x20['+_0x19f92d[_0x439ecf(0x145)]+_0x439ecf(0xef)):'';console['error']('\x0a'+a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x157))+'\x20'+_0x537e95+_0x44e9e8),console[_0x439ecf(0xed)]('─'['repeat'](0x3c));const _0x4a7144=segmentWithActivationsToYaml(_0x416dcc,_0x19f92d,undefined,_0x35489e,_0x5c6adb),_0x25f37c=segmentToYamlString(_0x4a7144),_0x28d593=generateDiff(_0x25f37c,'');console[_0x439ecf(0xed)](formatDiffWithColors(_0x28d593)),console['error']('─'['repeat'](0x3c));}const _0x5adcb1=_0x18e5c7[_0x439ecf(0x164)](_0x300ab4=>!_0x300ab4[_0x439ecf(0x16c)]&&_0x300ab4['diff']);if(_0x5adcb1['length']>0x0&&!_0x47e7eb[_0x439ecf(0x14d)])for(const _0x249237 of _0x5adcb1){const _0x457511=_0x249237[_0x439ecf(0x156)]?_0x249237[_0x439ecf(0x156)]+'/'+_0x249237[_0x439ecf(0xf7)][_0x439ecf(0x13b)]:_0x249237[_0x439ecf(0xf7)][_0x439ecf(0x13b)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x119))+'\x20'+_0x457511),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),console[_0x439ecf(0xed)](_0x249237['diff']),console['error']('─'[_0x439ecf(0xf9)](0x3c));}if(_0x51bf39[_0x439ecf(0x145)]>0x0)for(const _0xd83ecb of _0x51bf39){const _0x39d2d1=_0xd83ecb['folderPath']?_0xd83ecb[_0x439ecf(0x156)]+'/'+_0xd83ecb['yamlConfig'][_0x439ecf(0x13b)]:_0xd83ecb[_0x439ecf(0xf7)][_0x439ecf(0x13b)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x101)]('New\x20journey:')+'\x20'+_0x39d2d1),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),_0xd83ecb[_0x439ecf(0xf6)]&&console[_0x439ecf(0xed)](_0xd83ecb['diff']),console[_0x439ecf(0xed)]('─'['repeat'](0x3c));}const _0x12110b=_0x911338[_0x439ecf(0x164)](_0x1ae281=>!_0x1ae281[_0x439ecf(0x16c)]&&_0x1ae281[_0x439ecf(0xf6)]);if(_0x12110b[_0x439ecf(0x145)]>0x0)for(const _0x211348 of _0x12110b){const _0x5cc581=_0x211348['folderPath']?_0x211348[_0x439ecf(0x156)]+'/'+_0x211348[_0x439ecf(0xf7)][_0x439ecf(0x13b)]:_0x211348[_0x439ecf(0xf7)][_0x439ecf(0x13b)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x153)]('Changes\x20to\x20journey:')+'\x20'+_0x5cc581),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c)),console[_0x439ecf(0xed)](_0x211348[_0x439ecf(0xf6)]),console['error']('─'[_0x439ecf(0xf9)](0x3c));}if(_0xc85623['length']>0x0)for(const _0xd2af60 of _0xc85623){const _0x30b27f=_0xd2af60['folderId']?_0x448c6c[_0x439ecf(0x16f)](_0xd2af60['folderId'])||'':'',_0x15928d=_0x30b27f?_0x30b27f+'/'+_0xd2af60[_0x439ecf(0x143)]:_0xd2af60[_0x439ecf(0x143)];console[_0x439ecf(0xed)]('\x0a'+a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x141))+'\x20'+_0x15928d),console['error']('─'['repeat'](0x3c)),console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x159))),console[_0x439ecf(0xed)]('─'[_0x439ecf(0xf9)](0x3c));}if(_0x47e7eb[_0x439ecf(0x138)])return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x116))),0x0;const _0x4eac42=_0x47e7eb['journeysOnly']?![]:_0x1c9ccc[_0x439ecf(0x145)]>0x0||_0x47ac70[_0x439ecf(0x145)]>0x0||_0x265d72[_0x439ecf(0x145)]>0x0,_0xa6da66=_0x51bf39[_0x439ecf(0x145)]>0x0||_0x193fd4['length']>0x0||_0xc85623[_0x439ecf(0x145)]>0x0,_0x124066=_0x47e7eb[_0x439ecf(0x14d)]?![]:_0x1905d3['length']>0x0,_0x3adc7e=_0x19619f[_0x439ecf(0x145)]>0x0;if(!_0x4eac42&&!_0xa6da66&&!_0x124066&&!_0x3adc7e){const _0x5d7b05=_0x47e7eb[_0x439ecf(0x14d)]?'✔\x20All\x20journeys\x20are\x20up\x20to\x20date':_0x439ecf(0x103);console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x101)](_0x5d7b05));if(_0x526070&&_0x4d3c4d[_0x439ecf(0x145)]===0x1){const _0x3461e1=_0x4d3c4d[0x0];if(_0x3461e1[_0x439ecf(0x10a)]?.['id']){const _0x15c760=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],_0x439ecf(0xe7)+_0x42beaf+'/e/'+_0x3461e1['existingSegment']['id']+_0x439ecf(0xf0));console[_0x439ecf(0xed)](_0x439ecf(0xf8)+a40_0x22f913['cyan'](_0x15c760));}}if(_0x526070&&_0x2290ed[_0x439ecf(0x145)]===0x1){const _0x285c24=_0x2290ed[0x0];if(_0x285c24[_0x439ecf(0x144)]?.['id']){const _0x439b9b=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],'/app/ps/'+_0x42beaf+_0x439ecf(0xe0)+_0x285c24[_0x439ecf(0x144)]['id']+_0x439ecf(0x15b));console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913[_0x439ecf(0x12e)](_0x439b9b));}}return 0x0;}const _0x129d59=_0x47e7eb[_0x439ecf(0x14d)]?_0x51bf39[_0x439ecf(0x145)]+_0x193fd4[_0x439ecf(0x145)]+_0xc85623[_0x439ecf(0x145)]+_0x19619f[_0x439ecf(0x145)]:_0x1c9ccc[_0x439ecf(0x145)]+_0x47ac70[_0x439ecf(0x145)]+_0x265d72[_0x439ecf(0x145)]+_0x51bf39[_0x439ecf(0x145)]+_0x193fd4[_0x439ecf(0x145)]+_0xc85623[_0x439ecf(0x145)]+_0x19619f[_0x439ecf(0x145)]+_0x1905d3[_0x439ecf(0x145)];if(!_0x47e7eb['yes']&&_0x129d59>0x0){if(!isInteractive())return console['error'](a40_0x22f913[_0x439ecf(0x130)](_0x439ecf(0x128)),_0x439ecf(0x135)),console[_0x439ecf(0xed)](a40_0x22f913['dim'](_0x439ecf(0xd6))),0x1;const _0x24f0b5=await confirmKey(_0x439ecf(0x122)+_0x129d59+_0x439ecf(0x166));if(!_0x24f0b5)return console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)](_0x439ecf(0x108))),0x1;}const _0x5b319c={'withProgress':async(_0x4e10f9,_0x5ed626)=>{const _0x283729=_0x439ecf,_0x581190=await withSpinner(_0x4e10f9,_0x5ed626,{'verbose':_0x47e7eb[_0x283729(0x10b)]});return{'data':_0x581190[_0x283729(0x142)]};},'logInfo':_0x26e3ff=>console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0xd9)]('✔\x20'+_0x26e3ff)),'logSuccess':_0xd72eb=>console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x101)]('✔\x20'+_0xd72eb)),'logWarning':_0x33d676=>console[_0x439ecf(0xed)](a40_0x22f913['yellow']('⚠\x20'+_0x33d676)),'logDeleted':_0xda803c=>console[_0x439ecf(0xed)](a40_0x22f913['red']('✔\x20'+_0xda803c))},_0x36cf71={'segment':_0x285d70[_0x439ecf(0x16a)],'journey':_0x285d70[_0x439ecf(0x111)],'user':_0x285d70['user'],'connection':_0x285d70[_0x439ecf(0xdd)]};_0x19619f['length']>0x0&&(_0x15f091=await executePushFolders(_0x36cf71,_0x19619f,_0x15f091,{'parentId':_0x42beaf},_0x5b319c));const _0x16c425={'rootFolderId':_0x1590dc,'folderPathToId':_0x15f091,'folderIdToPath':_0x448c6c,'segmentNameToId':_0x199e59,'activationsBySegmentId':_0x43ca50,'emailToIdMap':_0x58589a,'idToEmailMap':_0x35489e,'connectionNameToIdMap':_0x2f77cf[_0x439ecf(0x117)],'connectionIdToNameMap':_0x2f77cf[_0x439ecf(0x165)],'connectionNameToTypeMap':_0x4dddb5},_0x3105f3=await executePushSegments(_0x36cf71,_0x47e7eb[_0x439ecf(0x14d)]?[]:_0x18e5c7,_0x16c425,{'parentId':_0x42beaf},_0x5b319c),_0x4aed9c=_0x3105f3[_0x439ecf(0xd8)],_0x911748=_0x3105f3[_0x439ecf(0xfd)],_0x3664ab=_0x3105f3[_0x439ecf(0xe2)][_0x439ecf(0xd8)],_0x380b6b=_0x3105f3['activations'][_0x439ecf(0xfd)],_0x2f693b=_0x3105f3['activations']['deleted'];let _0xa1b0a4;if(_0x526070&&_0x18e5c7[_0x439ecf(0x145)]===0x1){const _0x52da06=_0x18e5c7[0x0];_0xa1b0a4=_0x52da06[_0x439ecf(0x10a)]?.['id']??_0x3105f3[_0x439ecf(0x152)]['get'](_0x52da06['yamlConfig'][_0x439ecf(0x13b)]);}const _0xb98543=await executePushSegmentDeletions(_0x36cf71,_0x47e7eb[_0x439ecf(0x14d)]?[]:_0x265d72,_0x5b319c);let _0x5140e0=0x0,_0x5042ab=0x0,_0x117b33=0x0;const _0x5c5451=new Map(_0x199e59);for(const [_0x4ba2a8,_0x298e33]of _0x3105f3[_0x439ecf(0x152)]){_0x5c5451[_0x439ecf(0x15f)](_0x4ba2a8,_0x298e33);}if(_0x911338[_0x439ecf(0x145)]>0x0){const _0x35596c={..._0x16c425,'segmentNameToId':_0x5c5451,'existingSegments':_0x2806f9,'activationContext':_0x4509d2},_0x144376=await executePushJourneys(_0x36cf71,_0x911338,_0x35596c,{'parentId':_0x42beaf,'rootFolderId':_0x1590dc,'verbose':_0x47e7eb[_0x439ecf(0x10b)]},_0x5b319c);_0x5140e0=_0x144376[_0x439ecf(0xd8)],_0x5042ab=_0x144376[_0x439ecf(0xfd)];if(_0x526070&&_0x144376[_0x439ecf(0x10e)]['length']===0x1){const _0x1cb558=_0x144376[_0x439ecf(0x10e)][0x0];if(_0x1cb558['journeyId']){const _0x30a2fc=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],'/app/ps/'+_0x42beaf+_0x439ecf(0xe0)+_0x1cb558[_0x439ecf(0x136)]+'/j/da/je');console[_0x439ecf(0xed)]('\x20\x20'+a40_0x22f913[_0x439ecf(0x12e)](_0x30a2fc));}}}for(const _0x2254e9 of _0xc85623){console[_0x439ecf(0xed)](a40_0x22f913[_0x439ecf(0x153)]('⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20'+_0x2254e9[_0x439ecf(0x143)])),_0x117b33++;}const _0x2c51f7=[];if(_0x4aed9c>0x0)_0x2c51f7[_0x439ecf(0x10d)](_0x4aed9c+_0x439ecf(0x16b));if(_0x911748>0x0)_0x2c51f7[_0x439ecf(0x10d)](_0x911748+'\x20updated');if(_0xb98543>0x0)_0x2c51f7[_0x439ecf(0x10d)](_0xb98543+'\x20deleted');const _0x56e0f7=[];if(_0x5140e0>0x0)_0x56e0f7[_0x439ecf(0x10d)](_0x5140e0+_0x439ecf(0x16b));if(_0x5042ab>0x0)_0x56e0f7[_0x439ecf(0x10d)](_0x5042ab+_0x439ecf(0x11f));if(_0x117b33>0x0)_0x56e0f7[_0x439ecf(0x10d)](_0x117b33+_0x439ecf(0x107));const _0x55e5c8=[];if(_0x3664ab>0x0)_0x55e5c8['push'](_0x3664ab+_0x439ecf(0x16b));if(_0x380b6b>0x0)_0x55e5c8['push'](_0x380b6b+'\x20updated');if(_0x2f693b>0x0)_0x55e5c8[_0x439ecf(0x10d)](_0x2f693b+'\x20deleted');console[_0x439ecf(0xed)](a40_0x22f913['green'](_0x439ecf(0xf2)));_0x2c51f7['length']>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&console[_0x439ecf(0xed)](_0x439ecf(0xe6)+_0x2c51f7[_0x439ecf(0xf5)](',\x20'));_0x56e0f7['length']>0x0&&console['error'](_0x439ecf(0xfa)+_0x56e0f7[_0x439ecf(0xf5)](',\x20'));_0x55e5c8['length']>0x0&&!_0x47e7eb[_0x439ecf(0x14d)]&&console[_0x439ecf(0xed)]('\x20\x20Activations:\x20'+_0x55e5c8['join'](',\x20'));if(_0xa1b0a4){const _0x4dfb82=getConsoleNextUrl(_0x47e7eb[_0x439ecf(0xd3)],'/app/ps/'+_0x42beaf+_0x439ecf(0xe0)+_0xa1b0a4+'/sb/da/esr');console[_0x439ecf(0xed)](_0x439ecf(0xf8)+a40_0x22f913[_0x439ecf(0x12e)](_0x4dfb82));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a41_0x3121b3=a41_0x38d9;function a41_0x38d9(_0x50210c,_0x2b6985){_0x50210c=_0x50210c-0x159;const _0x17d028=a41_0x17d0();let _0x38d90b=_0x17d028[_0x50210c];return _0x38d90b;}(function(_0x1084d6,_0x5a312a){const _0x4a7ca3=a41_0x38d9,_0xc01ce9=_0x1084d6();while(!![]){try{const _0x1c2ce5=parseInt(_0x4a7ca3(0x15a))/0x1*(parseInt(_0x4a7ca3(0x16f))/0x2)+-parseInt(_0x4a7ca3(0x17f))/0x3+-parseInt(_0x4a7ca3(0x16b))/0x4+parseInt(_0x4a7ca3(0x159))/0x5*(-parseInt(_0x4a7ca3(0x188))/0x6)+parseInt(_0x4a7ca3(0x167))/0x7*(-parseInt(_0x4a7ca3(0x16c))/0x8)+-parseInt(_0x4a7ca3(0x160))/0x9+parseInt(_0x4a7ca3(0x17e))/0xa;if(_0x1c2ce5===_0x5a312a)break;else _0xc01ce9['push'](_0xc01ce9['shift']());}catch(_0xc5cd08){_0xc01ce9['push'](_0xc01ce9['shift']());}}}(a41_0x17d0,0xd8841));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a41_0x17d0(){const _0x1f9dc8=['Parent\x20ID:\x20','description','2632482ZqryJo','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','yellow','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','resolveFolderId','\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22','Resolving\x20folder\x20\x27','796236uQRNUM','type','error','kind','3425612jPZAeo','112javdmu','Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]','parentId','2865686msXLDn','length','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]','Resolving\x20path\x20\x27','Error:\x20Cannot\x20update\x20','segment','Resolved\x20relative\x20path\x20to:\x20','data','segmentPath','ruleFile','\x27...','Segment\x20ID:\x20','name','folder','✔\x20Updated\x20segment\x20\x27','37977770PISjXu','3642381DZJMtT','segmentId','Update\x20existing\x20child\x20segment','updateSegmentById','Error:\x20Segment\x20path\x20or\x20name\x20is\x20required','segmentName','\x20\x20\x20Path:\x20','Segment\x20ID\x20missing\x20from\x20resolved\x20path','INTERNAL','78NlNuKa','149335YNIlZK','1HNCWQQ','rule','verbose','segment:update'];a41_0x17d0=function(){return _0x1f9dc8;};return a41_0x17d0();}import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a41_0x42fc26 from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a41_0x3121b3(0x17b)]=a41_0x3121b3(0x15d);['description']=a41_0x3121b3(0x181);async['execute'](_0x95bf80){const _0x5c8484=a41_0x3121b3;console['error'](a41_0x42fc26[_0x5c8484(0x162)](_0x5c8484(0x161))),console[_0x5c8484(0x169)](a41_0x42fc26['yellow']('\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a'));const {options:_0x21dd93,args:_0x201e68,tdx:_0x3ab9f2}=_0x95bf80,_0x3ac0ea=_0x21dd93;if(_0x201e68[_0x5c8484(0x170)]===0x0)return console[_0x5c8484(0x169)](_0x5c8484(0x183)),console[_0x5c8484(0x169)](_0x5c8484(0x171)),console[_0x5c8484(0x169)]('Examples:'),console[_0x5c8484(0x169)](_0x5c8484(0x165)),console['error'](_0x5c8484(0x163)),0x1;const _0x515dbf=_0x201e68[0x0],_0x1326da=_0x21dd93[_0x5c8484(0x177)];let _0x2f5793=_0x515dbf;_0x1326da&&!_0x515dbf['includes']('/')&&(_0x2f5793=_0x1326da+'/'+_0x515dbf,_0x3ac0ea['verbose']&&console[_0x5c8484(0x169)](_0x5c8484(0x175)+_0x2f5793));const _0x2ca757=await withSpinner(_0x5c8484(0x172)+_0x2f5793+_0x5c8484(0x179),()=>_0x3ab9f2[_0x5c8484(0x174)]['resolvePathToResource'](_0x2f5793),{'verbose':_0x3ac0ea['verbose']}),_0x184135=_0x2ca757[_0x5c8484(0x176)];_0x3ac0ea[_0x5c8484(0x15c)]&&console[_0x5c8484(0x169)]('Resolved\x20type:\x20'+_0x184135[_0x5c8484(0x168)]);if(_0x184135['type']!==_0x5c8484(0x174))return console[_0x5c8484(0x169)](_0x5c8484(0x173)+_0x184135['type']+'.\x20Only\x20child\x20segments\x20can\x20be\x20updated.'),console['error'](_0x5c8484(0x16d)),0x1;if(!_0x184135[_0x5c8484(0x180)])throw new SDKError(ErrorCode[_0x5c8484(0x187)],_0x5c8484(0x186));const _0x48c269=_0x184135[_0x5c8484(0x16e)],_0x53cdd2=_0x184135[_0x5c8484(0x180)];_0x3ac0ea[_0x5c8484(0x15c)]&&(console[_0x5c8484(0x169)](_0x5c8484(0x15e)+_0x48c269),console['error'](_0x5c8484(0x17a)+_0x53cdd2));let _0x5b58c1;if(_0x3ac0ea[_0x5c8484(0x17c)]){const _0x411726=_0x3ac0ea['folder'],_0x4f41c0=await withSpinner(_0x5c8484(0x166)+_0x411726+_0x5c8484(0x179),()=>_0x3ab9f2[_0x5c8484(0x174)][_0x5c8484(0x164)](_0x48c269,_0x411726),{'verbose':_0x3ac0ea[_0x5c8484(0x15c)]});_0x5b58c1=parseInt(_0x4f41c0[_0x5c8484(0x176)],0xa),_0x3ac0ea[_0x5c8484(0x15c)]&&console[_0x5c8484(0x169)]('Resolved\x20folder\x20ID:\x20'+_0x5b58c1);}const _0x1ec574=await loadJSONFromOptions(_0x3ac0ea[_0x5c8484(0x15b)],_0x3ac0ea[_0x5c8484(0x178)]),_0x8314a3={'name':_0x3ac0ea[_0x5c8484(0x17b)],'description':_0x3ac0ea[_0x5c8484(0x15f)],'rule':_0x1ec574,'kind':_0x3ac0ea['kind']!==undefined?parseInt(_0x3ac0ea[_0x5c8484(0x16a)],0xa):undefined,'segmentFolderId':_0x5b58c1},_0x16c58f=await withSpinner('Updating\x20segment\x20\x27'+_0x184135[_0x5c8484(0x184)]+_0x5c8484(0x179),()=>_0x3ab9f2['segment'][_0x5c8484(0x182)](_0x48c269,_0x53cdd2,_0x8314a3),{'verbose':_0x3ac0ea[_0x5c8484(0x15c)]}),_0x89a624=_0x16c58f[_0x5c8484(0x176)];return console[_0x5c8484(0x169)](_0x5c8484(0x17d)+_0x89a624[_0x5c8484(0x17b)]+'\x27'),_0x2f5793!==_0x515dbf&&console[_0x5c8484(0x169)](_0x5c8484(0x185)+_0x2f5793),await handleSDKOutput([_0x89a624],_0x3ac0ea),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a42_0x12e949=a42_0xf5da;(function(_0x7a91ae,_0xba2ff6){const _0x378ca1=a42_0xf5da,_0x1c70f3=_0x7a91ae();while(!![]){try{const _0x29610d=parseInt(_0x378ca1(0x105))/0x1*(-parseInt(_0x378ca1(0x11d))/0x2)+-parseInt(_0x378ca1(0xf4))/0x3*(-parseInt(_0x378ca1(0x116))/0x4)+parseInt(_0x378ca1(0x10a))/0x5*(-parseInt(_0x378ca1(0x122))/0x6)+parseInt(_0x378ca1(0x104))/0x7+-parseInt(_0x378ca1(0x100))/0x8+parseInt(_0x378ca1(0xec))/0x9+parseInt(_0x378ca1(0x109))/0xa;if(_0x29610d===_0xba2ff6)break;else _0x1c70f3['push'](_0x1c70f3['shift']());}catch(_0x2ea0e3){_0x1c70f3['push'](_0x1c70f3['shift']());}}}(a42_0x5abb,0xeaf26));import{existsSync,statSync}from'fs';import a42_0x468baf from'chalk';import{BaseCommand}from'./command.js';import{saveSessionContext}from'../core/session.js';function a42_0x5abb(){const _0x2cf400=['94ZpUQyo','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','log','description','parentId','6PeIuYd','Resolving\x20path\x20\x27','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','3089691QzSqgi','✔\x20Context\x20set\x20to:\x20','\x27...','fullPath','green','isDirectory','\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context','Parent\x20ID:\x20','1698906FTQNkN','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','red','dim','parentName','split','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','execute','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','segments','slice','segment','13695392gwpjiW','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','error','join','11710062rILhgu','2567fpUIis','Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>','folderId','verbose','408100xtnXkw','1973320ECPRGD','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','Usage:\x20tdx\x20segment\x20use\x20<path>','name','resolvePathToResource','Site:\x20','isAbsolute','segment:use','\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','Examples:','data','8pwipst','Error:\x20Path\x20is\x20required\x0a','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','config','cyan','segmentPath','folderPath'];a42_0x5abb=function(){return _0x2cf400;};return a42_0x5abb();}function a42_0xf5da(_0xf145f7,_0x46b17a){_0xf145f7=_0xf145f7-0xec;const _0x5abb82=a42_0x5abb();let _0xf5da30=_0x5abb82[_0xf145f7];return _0xf5da30;}import{withSpinner}from'../utils/spinner.js';import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a42_0x12e949(0x10e)]=a42_0x12e949(0x112);[a42_0x12e949(0x120)]=a42_0x12e949(0x118);async[a42_0x12e949(0xfb)](_0x38125f){const _0x121290=a42_0x12e949,{options:_0x4f4cbf,args:_0x57fe46,tdx:_0x5d6899}=_0x38125f;if(_0x57fe46['length']===0x0)return console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf6)](_0x121290(0x117))),console[_0x121290(0x102)](_0x121290(0x10d)),console['error'](_0x121290(0x114)),console['error']('\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22'),console['error'](_0x121290(0xf5)),console['error'](_0x121290(0xf2)),console[_0x121290(0x102)](_0x121290(0x113)),0x1;const _0x4b73fb=_0x57fe46[0x0],_0x5b2482=_0x4f4cbf['session'];try{if(_0x4b73fb==='/')return saveSessionContext({'segment_path':undefined},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)](_0x121290(0x101))),0x0;if(existsSync(_0x4b73fb)&&statSync(_0x4b73fb)[_0x121290(0xf1)]()){let _0x1dca80;try{_0x1dca80=findTdxConfig(_0x4b73fb);}catch{return console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf6)](_0x121290(0xfc)+_0x4b73fb)),console[_0x121290(0x102)](a42_0x468baf[_0x121290(0x11a)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x1bbe6b=_0x1dca80[_0x121290(0x119)]['parent_segment'];return saveSessionContext({'segment_path':_0x1bbe6b,'parent_segment':_0x1bbe6b},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)](_0x121290(0xed)+a42_0x468baf[_0x121290(0x11a)](_0x1bbe6b))),0x0;}const _0x549155=_0x4f4cbf[_0x121290(0x11b)];let _0x2055e2=_0x4b73fb;const _0x156e46=parsePath(_0x4b73fb);if(!_0x156e46[_0x121290(0x111)]){if(!_0x549155)return console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf6)](_0x121290(0xfa))),console['error'](a42_0x468baf[_0x121290(0x11a)](_0x121290(0x106))),0x1;if(_0x4b73fb==='..'){const _0x1284dc=_0x549155[_0x121290(0xf9)]('/')[_0x121290(0xfe)](0x0,-0x1)[_0x121290(0x103)]('/');_0x2055e2=_0x1284dc||'/';}else _0x4b73fb==='.'?_0x2055e2=_0x549155:_0x2055e2=_0x549155+'/'+_0x4b73fb;_0x4f4cbf['verbose']&&console[_0x121290(0x102)]('Resolved\x20relative\x20path\x20to:\x20'+_0x2055e2);}if(_0x2055e2==='/'||_0x2055e2==='')return saveSessionContext({'segment_path':undefined},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)]('✔\x20Context\x20cleared.\x20Back\x20to\x20root.')),0x0;_0x2055e2=normalizePath(_0x2055e2);const _0x53be2f=parsePath(_0x2055e2)[_0x121290(0xfd)];if(_0x53be2f['length']===0x0)return saveSessionContext({'segment_path':undefined},_0x5b2482),console[_0x121290(0x11f)](a42_0x468baf[_0x121290(0xf0)](_0x121290(0x101))),0x0;_0x4f4cbf[_0x121290(0x108)]&&(console[_0x121290(0x102)](_0x121290(0x110)+_0x4f4cbf['site']),console[_0x121290(0x102)]('Target\x20path:\x20'+_0x2055e2));const _0x1e5551=await withSpinner(_0x121290(0x123)+_0x2055e2+_0x121290(0xee),()=>_0x5d6899[_0x121290(0xff)][_0x121290(0x10f)](_0x2055e2),{'verbose':_0x4f4cbf[_0x121290(0x108)]}),_0x163f08=_0x1e5551[_0x121290(0x115)];_0x4f4cbf[_0x121290(0x108)]&&(console[_0x121290(0x102)]('Resolved\x20path\x20type:\x20'+_0x163f08['type']),console[_0x121290(0x102)](_0x121290(0xf3)+_0x163f08[_0x121290(0x121)]),_0x163f08[_0x121290(0x107)]&&console[_0x121290(0x102)]('Folder\x20ID:\x20'+_0x163f08[_0x121290(0x107)]));if(_0x163f08['type']===_0x121290(0xff))return console[_0x121290(0x102)](a42_0x468baf['red'](_0x121290(0x10b))),console[_0x121290(0x102)](_0x121290(0x10c)),console[_0x121290(0x102)](a42_0x468baf['cyan']('Use:\x20tdx\x20segment\x20use\x20'+_0x163f08[_0x121290(0xf8)]+(_0x163f08[_0x121290(0x11c)]?'/'+_0x163f08[_0x121290(0x11c)]['join']('/'):''))),0x1;return saveSessionContext({'segment_path':_0x163f08[_0x121290(0xef)],'parent_segment':_0x163f08[_0x121290(0xf8)]},_0x5b2482),console['log'](a42_0x468baf[_0x121290(0xf0)](_0x121290(0xed)+a42_0x468baf[_0x121290(0x11a)](_0x163f08[_0x121290(0xef)]))),_0x4f4cbf['verbose']&&(console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf7)](_0x121290(0x124))),console[_0x121290(0x102)](a42_0x468baf[_0x121290(0xf7)](_0x121290(0x11e)))),0x0;}catch(_0x18ffc6){throw _0x18ffc6;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a43_0xf43d81=a43_0xdbf6;(function(_0x12c131,_0x4df28d){const _0x392852=a43_0xdbf6,_0x5c7a35=_0x12c131();while(!![]){try{const _0x24ba10=parseInt(_0x392852(0xc3))/0x1+parseInt(_0x392852(0xd4))/0x2*(-parseInt(_0x392852(0xc6))/0x3)+-parseInt(_0x392852(0xe1))/0x4*(-parseInt(_0x392852(0xdd))/0x5)+parseInt(_0x392852(0xbd))/0x6+parseInt(_0x392852(0xcc))/0x7*(-parseInt(_0x392852(0xba))/0x8)+parseInt(_0x392852(0xcb))/0x9*(parseInt(_0x392852(0xd8))/0xa)+-parseInt(_0x392852(0xe0))/0xb;if(_0x24ba10===_0x4df28d)break;else _0x5c7a35['push'](_0x5c7a35['shift']());}catch(_0x1da512){_0x5c7a35['push'](_0x5c7a35['shift']());}}}(a43_0x5b91,0x3c865));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';function a43_0x5b91(){const _0x210a2f=['warningCount','endsWith','\x20warning(s)\x20found','5142qYrHsb','validCount','log','red','21670XPnzqi','warnings','green','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20.\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20current\x20directory','\x20file(s)\x20with\x20errors,\x20','1704155bZWHZd','message','name','1012957VmffJE','4GrouAx','.yml','filePath','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error:\x20','error','\x20warning(s)','1240arGXCt','dim','yellow','935574GZIGRs','targetDir','):\x20','segment:validate','execute','verbose','210553pvbKup','file','invalidCount','123vTZNng','valid','helpText','\x20valid','description','333nSmuez','15449ubVnWC','Validate\x20segment\x20and\x20journey\x20YAML\x20files','no_parent','length','hasErrors'];a43_0x5b91=function(){return _0x210a2f;};return a43_0x5b91();}import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a43_0x108e2c from'chalk';import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';function a43_0xdbf6(_0x308879,_0x1a709a){_0x308879=_0x308879-0xba;const _0x5b91c3=a43_0x5b91();let _0xdbf64a=_0x5b91c3[_0x308879];return _0xdbf64a;}export class SegmentValidateCommand extends BaseCommand{[a43_0xf43d81(0xdf)]=a43_0xf43d81(0xc0);[a43_0xf43d81(0xca)]=a43_0xf43d81(0xcd);async[a43_0xf43d81(0xc1)](_0x7a5a32){const _0x1cedd2=a43_0xf43d81,{options:_0x417142,args:_0x50283d}=_0x7a5a32,_0x1f302e=_0x417142,_0x46cde0=await resolveTarget({'arg':_0x50283d[0x0],'contextParent':_0x417142['parentSegment'],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x46cde0))return _0x46cde0['errorCode']===_0x1cedd2(0xce)?(console[_0x1cedd2(0xe6)](a43_0x108e2c['yellow']('parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a')),console[_0x1cedd2(0xe6)]('Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'),console['error'](_0x1cedd2(0xdb)),console[_0x1cedd2(0xe6)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0x1cedd2(0xe6)](a43_0x108e2c[_0x1cedd2(0xd7)](_0x1cedd2(0xe5)+_0x46cde0[_0x1cedd2(0xde)]+'\x0a')),_0x46cde0[_0x1cedd2(0xc8)]&&console[_0x1cedd2(0xe6)](a43_0x108e2c['cyan'](_0x46cde0[_0x1cedd2(0xc8)]))),0x1;const _0x40de88=_0x46cde0[_0x1cedd2(0xbe)],_0x48465d=_0x46cde0['type']===_0x1cedd2(0xc4)?_0x46cde0[_0x1cedd2(0xe3)]:undefined;if(!_0x48465d&&!existsSync(_0x40de88))return console['error'](a43_0x108e2c[_0x1cedd2(0xd7)]('Error:\x20Directory\x20not\x20found:\x20'+_0x40de88+'\x0a')),0x1;let _0xef8d08;if(_0x48465d){if(!_0x48465d[_0x1cedd2(0xd2)](_0x1cedd2(0xe2))&&!_0x48465d[_0x1cedd2(0xd2)]('.yaml'))return console[_0x1cedd2(0xe6)](a43_0x108e2c[_0x1cedd2(0xd7)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0x48465d+'\x0a')),0x1;_0xef8d08=[_0x48465d];}else _0xef8d08=findYamlFiles(_0x40de88);if(_0xef8d08[_0x1cedd2(0xcf)]===0x0)return console[_0x1cedd2(0xe6)](a43_0x108e2c['red'](_0x1cedd2(0xe4)+_0x40de88+'\x0a')),0x1;const _0x45d31f=validateYamlFiles(_0xef8d08,_0x40de88),_0x222f38=calculateSummary(_0x45d31f);for(const _0x5b5d61 of _0x45d31f){if(!isValidationResult(_0x5b5d61))continue;const {relativePath:_0x9fe6da,source:_0x45ac19,result:_0x4f86ff,fileType:_0x1f68c9}=_0x5b5d61,_0x1a38eb=_0x1f68c9;if(_0x4f86ff[_0x1cedd2(0xc7)]&&_0x4f86ff[_0x1cedd2(0xd9)][_0x1cedd2(0xcf)]===0x0)_0x1f302e[_0x1cedd2(0xc2)]&&console['log'](a43_0x108e2c[_0x1cedd2(0xda)]('✔\x20'+_0x9fe6da)+a43_0x108e2c[_0x1cedd2(0xbb)]('\x20('+_0x1a38eb+')'));else _0x4f86ff['valid']?(console[_0x1cedd2(0xd6)](a43_0x108e2c['yellow']('⚠\x20'+_0x9fe6da)+a43_0x108e2c[_0x1cedd2(0xbb)]('\x20('+_0x1a38eb+'):\x20'+_0x4f86ff[_0x1cedd2(0xd9)][_0x1cedd2(0xcf)]+_0x1cedd2(0xe7))),console[_0x1cedd2(0xd6)](formatValidationResult(_0x4f86ff,_0x45ac19,_0x9fe6da))):(console[_0x1cedd2(0xd6)](a43_0x108e2c[_0x1cedd2(0xd7)]('✖\x20'+_0x9fe6da)+a43_0x108e2c[_0x1cedd2(0xbb)]('\x20('+_0x1a38eb+_0x1cedd2(0xbf)+_0x4f86ff['errors'][_0x1cedd2(0xcf)]+'\x20error(s)')),console['log'](formatValidationResult(_0x4f86ff,_0x45ac19,_0x9fe6da)));}return console[_0x1cedd2(0xd6)](''),_0x222f38[_0x1cedd2(0xd0)]?(console['log'](a43_0x108e2c[_0x1cedd2(0xd7)]('Validation\x20failed:\x20'+_0x222f38[_0x1cedd2(0xc5)]+_0x1cedd2(0xdc)+_0x222f38['validCount']+_0x1cedd2(0xc9))),_0x222f38['warningCount']>0x0&&console[_0x1cedd2(0xd6)](a43_0x108e2c[_0x1cedd2(0xbc)](_0x222f38['warningCount']+'\x20warning(s)\x20found')),0x1):(console[_0x1cedd2(0xd6)](a43_0x108e2c['green']('✔\x20All\x20'+_0x222f38[_0x1cedd2(0xd5)]+'\x20file(s)\x20valid')),_0x222f38[_0x1cedd2(0xd1)]>0x0&&console[_0x1cedd2(0xd6)](a43_0x108e2c[_0x1cedd2(0xbc)](_0x222f38[_0x1cedd2(0xd1)]+_0x1cedd2(0xd3))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a44_0x48886d=a44_0xf27c;(function(_0x4c0fc6,_0x56bb99){const _0x55eba4=a44_0xf27c,_0x144552=_0x4c0fc6();while(!![]){try{const _0x130c71=-parseInt(_0x55eba4(0x1ef))/0x1+parseInt(_0x55eba4(0x1d6))/0x2+-parseInt(_0x55eba4(0x1c2))/0x3+-parseInt(_0x55eba4(0x1e4))/0x4+parseInt(_0x55eba4(0x1eb))/0x5*(-parseInt(_0x55eba4(0x1f1))/0x6)+parseInt(_0x55eba4(0x1e7))/0x7*(-parseInt(_0x55eba4(0x1d9))/0x8)+-parseInt(_0x55eba4(0x1b7))/0x9*(-parseInt(_0x55eba4(0x1c8))/0xa);if(_0x130c71===_0x56bb99)break;else _0x144552['push'](_0x144552['shift']());}catch(_0x34e71e){_0x144552['push'](_0x144552['shift']());}}}(a44_0x3787,0xc3703));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';function a44_0xf27c(_0x8c1349,_0x20aaa7){_0x8c1349=_0x8c1349-0x1b3;const _0x37876b=a44_0x3787();let _0xf27c4d=_0x37876b[_0x8c1349];return _0xf27c4d;}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a44_0x3787(){const _0x291359=['type','localeCompare','104EMuluK','folders','\x27...','List\x20folders\x20and\x20child\x20segments','replace','Parent\x20segment\x20context:\x20','\x20\x20Cause:\x20','Resolving\x20path\x20\x27','children','sort','journeys','899972BsZiSQ','/j/da','/app/ps/','342181tEjMxU','Error:\x20No\x20parent\x20segment\x20context\x20set.','\x5c$&','dim','290yIJtUg','error','jsonl','Recursive\x20mode:\x20enabled','367847mdKuoF','format','98778pipEiN','Folder\x20ID:\x20','Resolving\x20parent\x20segment\x20\x27','folder','✔\x20Built\x20tree\x20with\x20','recursive','parentId','(empty)','listRecursive','site','json','Listing\x20folders,\x20segments,\x20and\x20journeys...','journeyBundleName','/e/','message','verbose','resolvePathToResource','\x20matching\x20\x27',']\x20matching\x20\x27','✔\x20Found\x20','listUnified','folderId','2907bqYBGS','filter','map','length','Parent\x20ID:\x20','Error:\x20','parentSegment','Site:\x20','data','cause','\x20folder','4634646ywjqfw','includes','\x20journey','\x20segment',',\x20and\x20','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','113530ZOFpES','description','Set\x20a\x20parent\x20segment\x20context\x20first:','segment','Building\x20hierarchy\x20tree...','maxDepth','name','log','listUnifiedWithJourneys','execute','segments','test','journey','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','1723102uXGWrf'];a44_0x3787=function(){return _0x291359;};return a44_0x3787();}import a44_0x389449 from'chalk';export class SegmentsCommand extends BaseCommand{[a44_0x48886d(0x1ce)]=a44_0x48886d(0x1d2);[a44_0x48886d(0x1c9)]=a44_0x48886d(0x1dc);async[a44_0x48886d(0x1d1)](_0x79e02f){const _0x500d83=a44_0x48886d,{options:_0x1639b1,args:_0x15a18a}=_0x79e02f,_0x1da925=_0x1639b1[_0x500d83(0x1f6)],_0x3f6179=_0x15a18a[0x0];try{const _0x361515=_0x1639b1[_0x500d83(0x1bd)];_0x1639b1[_0x500d83(0x200)]&&(console[_0x500d83(0x1ec)](_0x500d83(0x1be)+_0x1639b1['site']),console[_0x500d83(0x1ec)](_0x500d83(0x1de)+(_0x361515||'(not\x20set)')),_0x3f6179&&console[_0x500d83(0x1ec)]('Folder/pattern\x20arg:\x20'+_0x3f6179),_0x1da925&&console[_0x500d83(0x1ec)](_0x500d83(0x1ee)));if(!_0x361515)return console[_0x500d83(0x1ec)](_0x500d83(0x1e8)),console[_0x500d83(0x1ec)](''),console[_0x500d83(0x1ec)](_0x500d83(0x1ca)),console[_0x500d83(0x1ec)]('\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22'),console[_0x500d83(0x1ec)](_0x500d83(0x1c7)),console['error'](''),console[_0x500d83(0x1ec)](_0x500d83(0x1d5)),0x1;const _0x5820ce=_0x3f6179&&(_0x3f6179['includes']('*')||_0x3f6179[_0x500d83(0x1c3)]('?'));if(_0x5820ce)return await this['listWithPattern'](_0x79e02f,_0x361515,_0x3f6179);const _0x11659d=_0x3f6179?_0x361515+'/'+_0x3f6179:_0x361515;return _0x1da925?await this[_0x500d83(0x1f9)](_0x79e02f,_0x11659d):await this['listUnified'](_0x79e02f,_0x11659d);}catch(_0xfbbbb6){if(_0xfbbbb6 instanceof SDKError)return console['error'](_0x500d83(0x1bc)+_0xfbbbb6[_0x500d83(0x1ff)]),_0xfbbbb6[_0x500d83(0x1c0)]&&console[_0x500d83(0x1ec)](_0x500d83(0x1df)+_0xfbbbb6['cause']),0x1;throw _0xfbbbb6;}}async['listWithPattern'](_0x537057,_0x59f588,_0x1fa38b){const _0x2d77cd=a44_0x48886d,{options:_0xa60b16,tdx:_0x574614}=_0x537057,_0x97ae0f=await withSpinner(_0x2d77cd(0x1f3)+_0x59f588+'\x27...',()=>_0x574614[_0x2d77cd(0x1cb)]['resolvePathToResource'](_0x59f588),{'verbose':_0xa60b16[_0x2d77cd(0x200)]}),_0x21c457=_0x97ae0f[_0x2d77cd(0x1bf)],_0x367714=await withSpinner(_0x2d77cd(0x1fc),()=>_0x574614[_0x2d77cd(0x1cb)][_0x2d77cd(0x1d0)](_0x21c457['parentId'],_0x21c457[_0x2d77cd(0x1b6)]),{'verbose':_0xa60b16[_0x2d77cd(0x200)]}),{folders:_0x406df,segments:_0x64ede6,journeys:_0x57db63}=_0x367714[_0x2d77cd(0x1bf)],_0x3b00f4=_0x1fa38b[_0x2d77cd(0x1dd)](/[.+^${}()|[\]\\]/g,_0x2d77cd(0x1e9))['replace'](/\*/g,'.*')[_0x2d77cd(0x1dd)](/\?/g,'.'),_0x5152f6=new RegExp('^'+_0x3b00f4+'$','i'),_0xfc0f3e=_0x406df[_0x2d77cd(0x1b8)](_0x181aba=>_0x5152f6[_0x2d77cd(0x1d3)](_0x181aba[_0x2d77cd(0x1ce)])),_0x4c6892=_0x64ede6[_0x2d77cd(0x1b8)](_0x26cd57=>_0x5152f6[_0x2d77cd(0x1d3)](_0x26cd57[_0x2d77cd(0x1ce)])),_0x454fd6=_0x57db63[_0x2d77cd(0x1b8)](_0x1a30a6=>_0x5152f6[_0x2d77cd(0x1d3)](_0x1a30a6[_0x2d77cd(0x1fd)])),_0x1c1e8e=_0xfc0f3e['length']+_0x4c6892[_0x2d77cd(0x1ba)]+_0x454fd6[_0x2d77cd(0x1ba)];console[_0x2d77cd(0x1ec)](_0x2d77cd(0x1b4)+_0xfc0f3e[_0x2d77cd(0x1ba)]+_0x2d77cd(0x1c1)+(_0xfc0f3e[_0x2d77cd(0x1ba)]!==0x1?'s':'')+',\x20'+_0x4c6892[_0x2d77cd(0x1ba)]+_0x2d77cd(0x1c5)+(_0x4c6892[_0x2d77cd(0x1ba)]!==0x1?'s':'')+_0x2d77cd(0x1c6)+_0x454fd6[_0x2d77cd(0x1ba)]+_0x2d77cd(0x1c4)+(_0x454fd6[_0x2d77cd(0x1ba)]!==0x1?'s':'')+_0x2d77cd(0x202)+_0x1fa38b+'\x27');const _0x505d46=_0x27b415=>{const _0x409b71=_0x2d77cd;return getConsoleNextUrl(_0xa60b16[_0x409b71(0x1fa)],_0x409b71(0x1e6)+_0x21c457[_0x409b71(0x1f7)]+_0x409b71(0x1fe)+_0x27b415);},_0x311d86=_0xa60b16[_0x2d77cd(0x1f0)]===_0x2d77cd(0x1fb)||_0xa60b16['format']===_0x2d77cd(0x1ed);if(_0x311d86){const _0x10f243=[..._0xfc0f3e['map'](_0x5e24c4=>({..._0x5e24c4,'type':_0x2d77cd(0x1f4)})),..._0x4c6892[_0x2d77cd(0x1b9)](_0x419ac4=>({..._0x419ac4,'type':_0x2d77cd(0x1cb),'url':_0x505d46(_0x419ac4['id'])})),..._0x454fd6[_0x2d77cd(0x1b9)](_0x308ef6=>({..._0x308ef6,'name':_0x308ef6[_0x2d77cd(0x1fd)],'type':_0x2d77cd(0x1d4)}))][_0x2d77cd(0x1e2)]((_0x4e36d8,_0x8339ba)=>_0x4e36d8[_0x2d77cd(0x1ce)][_0x2d77cd(0x1d8)](_0x8339ba[_0x2d77cd(0x1ce)]));await handleSDKOutput(_0x10f243,_0xa60b16);}else{if(_0x1c1e8e===0x0)console[_0x2d77cd(0x1cf)]('No\x20items\x20match\x20pattern:\x20'+_0x1fa38b);else{console['log'](a44_0x389449[_0x2d77cd(0x1ea)]('['+_0x59f588+_0x2d77cd(0x1b3)+_0x1fa38b+'\x27'));const _0x4fc96e=formatFlatList(_0xfc0f3e,_0x4c6892,{'showMetadata':!![],'getSegmentUrl':_0x505d46},_0x454fd6);console['log'](_0x4fc96e);}}return 0x0;}async[a44_0x48886d(0x1b5)](_0xe8b3f0,_0x277634){const _0x41d16f=a44_0x48886d,{options:_0x7d2dce,tdx:_0x53f67b}=_0xe8b3f0,_0xe5a65d=await withSpinner('Resolving\x20path\x20\x27'+_0x277634+_0x41d16f(0x1db),()=>_0x53f67b['segment']['resolvePathToResource'](_0x277634),{'verbose':_0x7d2dce[_0x41d16f(0x200)]}),_0x4a9276=_0xe5a65d[_0x41d16f(0x1bf)];_0x7d2dce[_0x41d16f(0x200)]&&(console[_0x41d16f(0x1ec)](_0x41d16f(0x1bb)+_0x4a9276[_0x41d16f(0x1f7)]),_0x4a9276['folderId']&&console[_0x41d16f(0x1ec)](_0x41d16f(0x1f2)+_0x4a9276['folderId']));const _0xc4f1e2=await withSpinner(_0x41d16f(0x1fc),()=>_0x53f67b[_0x41d16f(0x1cb)][_0x41d16f(0x1d0)](_0x4a9276['parentId'],_0x4a9276[_0x41d16f(0x1b6)]),{'verbose':_0x7d2dce[_0x41d16f(0x200)]}),{folders:_0x369a6a,segments:_0x55143e,journeys:_0x5ec205}=_0xc4f1e2[_0x41d16f(0x1bf)],_0x1b7a21=_0x369a6a[_0x41d16f(0x1ba)]+_0x55143e[_0x41d16f(0x1ba)]+_0x5ec205[_0x41d16f(0x1ba)];console[_0x41d16f(0x1ec)]('✔\x20Found\x20'+_0x369a6a[_0x41d16f(0x1ba)]+'\x20folder'+(_0x369a6a[_0x41d16f(0x1ba)]!==0x1?'s':'')+',\x20'+_0x55143e[_0x41d16f(0x1ba)]+_0x41d16f(0x1c5)+(_0x55143e[_0x41d16f(0x1ba)]!==0x1?'s':'')+',\x20and\x20'+_0x5ec205[_0x41d16f(0x1ba)]+_0x41d16f(0x1c4)+(_0x5ec205[_0x41d16f(0x1ba)]!==0x1?'s':''));const _0x210215=_0xeab791=>{const _0x42c72f=_0x41d16f;return getConsoleNextUrl(_0x7d2dce[_0x42c72f(0x1fa)],_0x42c72f(0x1e6)+_0x4a9276['parentId']+'/e/'+_0xeab791);},_0x18ff11=_0x435731=>{const _0x1494dc=_0x41d16f;return getConsoleNextUrl(_0x7d2dce[_0x1494dc(0x1fa)],_0x1494dc(0x1e6)+_0x4a9276[_0x1494dc(0x1f7)]+_0x1494dc(0x1fe)+_0x435731+_0x1494dc(0x1e5));},_0x35b7d1=_0x7d2dce['format']===_0x41d16f(0x1fb)||_0x7d2dce[_0x41d16f(0x1f0)]==='jsonl';if(_0x35b7d1){const _0x1e3db6=[..._0x369a6a[_0x41d16f(0x1b9)](_0x2eaa4c=>({..._0x2eaa4c,'type':_0x41d16f(0x1f4)})),..._0x55143e['map'](_0x2e0fb1=>({..._0x2e0fb1,'type':_0x41d16f(0x1cb),'url':_0x210215(_0x2e0fb1['id'])})),..._0x5ec205[_0x41d16f(0x1b9)](_0x1266fa=>({..._0x1266fa,'name':_0x1266fa[_0x41d16f(0x1fd)],'type':_0x41d16f(0x1d4),'url':_0x18ff11(_0x1266fa['id'])}))][_0x41d16f(0x1e2)]((_0x589fee,_0x46bb64)=>_0x589fee[_0x41d16f(0x1ce)]['localeCompare'](_0x46bb64[_0x41d16f(0x1ce)]));await handleSDKOutput(_0x1e3db6,_0x7d2dce);}else{if(_0x1b7a21===0x0)console[_0x41d16f(0x1cf)](a44_0x389449[_0x41d16f(0x1ea)]('['+_0x277634+']')),console[_0x41d16f(0x1cf)](_0x41d16f(0x1f8));else{console[_0x41d16f(0x1cf)](a44_0x389449['dim']('['+_0x277634+']'));const _0x2508b4=formatFlatList(_0x369a6a,_0x55143e,{'showMetadata':!![],'getSegmentUrl':_0x210215,'getJourneyUrl':_0x18ff11},_0x5ec205);console[_0x41d16f(0x1cf)](_0x2508b4);}}return 0x0;}async['listRecursive'](_0x4de7e5,_0x1c49c9){const _0x16f79b=a44_0x48886d,{options:_0x14b734,tdx:_0x45215c}=_0x4de7e5,_0x45e7a2=await withSpinner(_0x16f79b(0x1e0)+_0x1c49c9+_0x16f79b(0x1db),()=>_0x45215c[_0x16f79b(0x1cb)][_0x16f79b(0x201)](_0x1c49c9),{'verbose':_0x14b734[_0x16f79b(0x200)]}),_0x51b679=_0x45e7a2[_0x16f79b(0x1bf)];_0x14b734[_0x16f79b(0x200)]&&(console[_0x16f79b(0x1ec)](_0x16f79b(0x1bb)+_0x51b679[_0x16f79b(0x1f7)]),_0x51b679[_0x16f79b(0x1b6)]&&console[_0x16f79b(0x1ec)](_0x16f79b(0x1f2)+_0x51b679[_0x16f79b(0x1b6)]));const _0x14b699=_0x14b734[_0x16f79b(0x1cd)]||0xa,_0x1b08c2=await withSpinner(_0x16f79b(0x1cc),()=>_0x45215c[_0x16f79b(0x1cb)][_0x16f79b(0x1f9)](_0x51b679[_0x16f79b(0x1f7)],_0x51b679['folderId'],0x0,_0x14b699),{'verbose':_0x14b734[_0x16f79b(0x200)]}),_0x54201b=_0x1b08c2['data'],_0x323e92=_0x33f43d=>{const _0x2584c1=_0x16f79b;let _0x32af3f=0x0,_0x352ba9=0x0,_0x225ee8=0x0;for(const _0xcda32b of _0x33f43d){if(_0xcda32b[_0x2584c1(0x1d7)]===_0x2584c1(0x1f4))_0x32af3f++;else{if(_0xcda32b[_0x2584c1(0x1d7)]===_0x2584c1(0x1cb))_0x352ba9++;else{if(_0xcda32b[_0x2584c1(0x1d7)]===_0x2584c1(0x1d4))_0x225ee8++;}}if(_0xcda32b['children']){const _0x164dbb=_0x323e92(_0xcda32b[_0x2584c1(0x1e1)]);_0x32af3f+=_0x164dbb[_0x2584c1(0x1da)],_0x352ba9+=_0x164dbb[_0x2584c1(0x1d2)],_0x225ee8+=_0x164dbb[_0x2584c1(0x1e3)];}}return{'folders':_0x32af3f,'segments':_0x352ba9,'journeys':_0x225ee8};},_0x27bfff=_0x323e92(_0x54201b);console[_0x16f79b(0x1ec)](_0x16f79b(0x1f5)+_0x27bfff[_0x16f79b(0x1da)]+'\x20folder'+(_0x27bfff['folders']!==0x1?'s':'')+',\x20'+_0x27bfff[_0x16f79b(0x1d2)]+_0x16f79b(0x1c5)+(_0x27bfff[_0x16f79b(0x1d2)]!==0x1?'s':'')+_0x16f79b(0x1c6)+_0x27bfff['journeys']+_0x16f79b(0x1c4)+(_0x27bfff['journeys']!==0x1?'s':''));const _0x16d3d1=_0x4e19e2=>{const _0x5a3ffa=_0x16f79b;return getConsoleNextUrl(_0x14b734[_0x5a3ffa(0x1fa)],_0x5a3ffa(0x1e6)+_0x51b679['parentId']+_0x5a3ffa(0x1fe)+_0x4e19e2);},_0x496cab=_0xb37d33=>{const _0xcc59c8=_0x16f79b;return getConsoleNextUrl(_0x14b734[_0xcc59c8(0x1fa)],_0xcc59c8(0x1e6)+_0x51b679[_0xcc59c8(0x1f7)]+_0xcc59c8(0x1fe)+_0xb37d33+'/j/da');};if(_0x14b734[_0x16f79b(0x1f0)]===_0x16f79b(0x1fb)||_0x14b734['format']===_0x16f79b(0x1ed))await handleSDKOutput(_0x54201b,_0x14b734);else{console[_0x16f79b(0x1cf)](a44_0x389449[_0x16f79b(0x1ea)]('['+_0x1c49c9+']'));const _0x4b859e=formatTree(_0x54201b,{'showMetadata':!![],'getSegmentUrl':_0x16d3d1,'getJourneyUrl':_0x496cab});console[_0x16f79b(0x1cf)](_0x4b859e);}return 0x0;}}
|
|
1
|
+
function a44_0x3292(){const _0x28271f=['/e/','92olDVHo','listRecursive','\x5c$&','List\x20folders\x20and\x20child\x20segments','Folder\x20ID:\x20','name','\x27...','length','replace','5071392zkHYQb','96OtpptY','filter','Parent\x20segment\x20context:\x20','Parent\x20ID:\x20','log','test','journeys','✔\x20Built\x20tree\x20with\x20','\x20segment','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','localeCompare','Resolving\x20parent\x20segment\x20\x27','14199rfiGgN','No\x20items\x20match\x20pattern:\x20','17085695EdNJuv','folderId','verbose',']\x20matching\x20\x27','Building\x20hierarchy\x20tree...','Recursive\x20mode:\x20enabled','listUnified','86832RjlGGa','format','17460hZJCWi','\x20\x20Cause:\x20','jsonl','\x20matching\x20\x27','Resolving\x20path\x20\x27','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','\x20journey','Folder/pattern\x20arg:\x20','includes','1746fkmTrk','(not\x20set)','/j/da','segments','/app/ps/','Listing\x20folders,\x20segments,\x20and\x20journeys...','\x20folder','site','parentId','execute','listWithPattern','folder','type','journey','sort','children','88vPWYoN','error','Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','Set\x20a\x20parent\x20segment\x20context\x20first:','folders','json','Error:\x20No\x20parent\x20segment\x20context\x20set.','map','journeyBundleName','651745mprIHL','260316SEWLFU','cause','recursive','resolvePathToResource','segment','data','dim'];a44_0x3292=function(){return _0x28271f;};return a44_0x3292();}const a44_0x3f2396=a44_0x4041;(function(_0x5a0c63,_0x17aaeb){const _0x9828dc=a44_0x4041,_0x1ccee9=_0x5a0c63();while(!![]){try{const _0x6daad0=parseInt(_0x9828dc(0x17e))/0x1*(-parseInt(_0x9828dc(0x168))/0x2)+parseInt(_0x9828dc(0x187))/0x3*(-parseInt(_0x9828dc(0x1a2))/0x4)+-parseInt(_0x9828dc(0x1ab))/0x5+-parseInt(_0x9828dc(0x172))/0x6*(-parseInt(_0x9828dc(0x1ac))/0x7)+-parseInt(_0x9828dc(0x171))/0x8+-parseInt(_0x9828dc(0x192))/0x9*(-parseInt(_0x9828dc(0x189))/0xa)+parseInt(_0x9828dc(0x180))/0xb;if(_0x6daad0===_0x17aaeb)break;else _0x1ccee9['push'](_0x1ccee9['shift']());}catch(_0x1114d1){_0x1ccee9['push'](_0x1ccee9['shift']());}}}(a44_0x3292,0x69a8e));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';function a44_0x4041(_0x556faf,_0x12f569){_0x556faf=_0x556faf-0x168;const _0x32923c=a44_0x3292();let _0x4041f4=_0x32923c[_0x556faf];return _0x4041f4;}import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a44_0x3c23d3 from'chalk';export class SegmentsCommand extends BaseCommand{[a44_0x3f2396(0x16d)]=a44_0x3f2396(0x195);['description']=a44_0x3f2396(0x16b);async[a44_0x3f2396(0x19b)](_0x5cd846){const _0x3b3585=a44_0x3f2396,{options:_0x26e8c7,args:_0x300643}=_0x5cd846,_0x490432=_0x26e8c7[_0x3b3585(0x1ae)],_0x3f7617=_0x300643[0x0];try{const _0xaf745f=_0x26e8c7['parentSegment'];_0x26e8c7[_0x3b3585(0x182)]&&(console[_0x3b3585(0x1a3)]('Site:\x20'+_0x26e8c7[_0x3b3585(0x199)]),console[_0x3b3585(0x1a3)](_0x3b3585(0x174)+(_0xaf745f||_0x3b3585(0x193))),_0x3f7617&&console[_0x3b3585(0x1a3)](_0x3b3585(0x190)+_0x3f7617),_0x490432&&console[_0x3b3585(0x1a3)](_0x3b3585(0x185)));if(!_0xaf745f)return console[_0x3b3585(0x1a3)](_0x3b3585(0x1a8)),console['error'](''),console[_0x3b3585(0x1a3)](_0x3b3585(0x1a5)),console[_0x3b3585(0x1a3)](_0x3b3585(0x17b)),console[_0x3b3585(0x1a3)](_0x3b3585(0x18e)),console[_0x3b3585(0x1a3)](''),console['error'](_0x3b3585(0x1a4)),0x1;const _0x2acd99=_0x3f7617&&(_0x3f7617[_0x3b3585(0x191)]('*')||_0x3f7617['includes']('?'));if(_0x2acd99)return await this['listWithPattern'](_0x5cd846,_0xaf745f,_0x3f7617);const _0x2d01e5=_0x3f7617?_0xaf745f+'/'+_0x3f7617:_0xaf745f;return _0x490432?await this['listRecursive'](_0x5cd846,_0x2d01e5):await this[_0x3b3585(0x186)](_0x5cd846,_0x2d01e5);}catch(_0x1511e9){if(_0x1511e9 instanceof SDKError)return console[_0x3b3585(0x1a3)]('Error:\x20'+_0x1511e9['message']),_0x1511e9[_0x3b3585(0x1ad)]&&console[_0x3b3585(0x1a3)](_0x3b3585(0x18a)+_0x1511e9['cause']),0x1;throw _0x1511e9;}}async[a44_0x3f2396(0x19c)](_0x5ae6be,_0x625d49,_0x285489){const _0x492125=a44_0x3f2396,{options:_0x325df3,tdx:_0x2a4b0e}=_0x5ae6be,_0x418328=await withSpinner(_0x492125(0x17d)+_0x625d49+'\x27...',()=>_0x2a4b0e[_0x492125(0x1b0)][_0x492125(0x1af)](_0x625d49),{'verbose':_0x325df3[_0x492125(0x182)]}),_0x368a47=_0x418328['data'],_0x98bae1=await withSpinner(_0x492125(0x197),()=>_0x2a4b0e[_0x492125(0x1b0)]['listUnifiedWithJourneys'](_0x368a47[_0x492125(0x19a)],_0x368a47[_0x492125(0x181)]),{'verbose':_0x325df3[_0x492125(0x182)]}),{folders:_0x47edd0,segments:_0x1a0118,journeys:_0xa2a398}=_0x98bae1[_0x492125(0x1b1)],_0x5c2286=_0x285489['replace'](/[.+^${}()|[\]\\]/g,_0x492125(0x16a))[_0x492125(0x170)](/\*/g,'.*')[_0x492125(0x170)](/\?/g,'.'),_0x3b1823=new RegExp('^'+_0x5c2286+'$','i'),_0x451062=_0x47edd0[_0x492125(0x173)](_0x264f77=>_0x3b1823[_0x492125(0x177)](_0x264f77[_0x492125(0x16d)])),_0x4f909f=_0x1a0118[_0x492125(0x173)](_0x1bbcde=>_0x3b1823[_0x492125(0x177)](_0x1bbcde[_0x492125(0x16d)])),_0x4fe20f=_0xa2a398[_0x492125(0x173)](_0x12d07c=>_0x3b1823[_0x492125(0x177)](_0x12d07c[_0x492125(0x1aa)])),_0x4d14f6=_0x451062[_0x492125(0x16f)]+_0x4f909f[_0x492125(0x16f)]+_0x4fe20f[_0x492125(0x16f)];console[_0x492125(0x1a3)]('✔\x20Found\x20'+_0x451062['length']+_0x492125(0x198)+(_0x451062[_0x492125(0x16f)]!==0x1?'s':'')+',\x20'+_0x4f909f['length']+_0x492125(0x17a)+(_0x4f909f['length']!==0x1?'s':'')+',\x20and\x20'+_0x4fe20f['length']+'\x20journey'+(_0x4fe20f['length']!==0x1?'s':'')+_0x492125(0x18c)+_0x285489+'\x27');const _0x594183=_0x4f0eb1=>{const _0x53bbce=_0x492125;return getConsoleNextUrl(_0x325df3[_0x53bbce(0x199)],_0x53bbce(0x196)+_0x368a47[_0x53bbce(0x19a)]+_0x53bbce(0x1b3)+_0x4f0eb1);},_0x2b5669=_0x325df3[_0x492125(0x188)]==='json'||_0x325df3['format']==='jsonl';if(_0x2b5669){const _0x193628=[..._0x451062[_0x492125(0x1a9)](_0xb45c35=>({..._0xb45c35,'type':_0x492125(0x19d)})),..._0x4f909f[_0x492125(0x1a9)](_0x3fea93=>({..._0x3fea93,'type':_0x492125(0x1b0),'url':_0x594183(_0x3fea93['id'])})),..._0x4fe20f[_0x492125(0x1a9)](_0x26fb24=>({..._0x26fb24,'name':_0x26fb24[_0x492125(0x1aa)],'type':_0x492125(0x19f)}))][_0x492125(0x1a0)]((_0x1a465a,_0x2d174b)=>_0x1a465a[_0x492125(0x16d)][_0x492125(0x17c)](_0x2d174b[_0x492125(0x16d)]));await handleSDKOutput(_0x193628,_0x325df3);}else{if(_0x4d14f6===0x0)console[_0x492125(0x176)](_0x492125(0x17f)+_0x285489);else{console['log'](a44_0x3c23d3[_0x492125(0x1b2)]('['+_0x625d49+_0x492125(0x183)+_0x285489+'\x27'));const _0x18cc0f=formatFlatList(_0x451062,_0x4f909f,{'showMetadata':!![],'getSegmentUrl':_0x594183},_0x4fe20f);console[_0x492125(0x176)](_0x18cc0f);}}return 0x0;}async['listUnified'](_0x18b332,_0x37ffb8){const _0x206060=a44_0x3f2396,{options:_0x5997c2,tdx:_0x37af3e}=_0x18b332,_0x54f1bf=await withSpinner('Resolving\x20path\x20\x27'+_0x37ffb8+_0x206060(0x16e),()=>_0x37af3e[_0x206060(0x1b0)][_0x206060(0x1af)](_0x37ffb8),{'verbose':_0x5997c2[_0x206060(0x182)]}),_0x31147f=_0x54f1bf[_0x206060(0x1b1)];_0x5997c2[_0x206060(0x182)]&&(console[_0x206060(0x1a3)](_0x206060(0x175)+_0x31147f[_0x206060(0x19a)]),_0x31147f['folderId']&&console[_0x206060(0x1a3)](_0x206060(0x16c)+_0x31147f[_0x206060(0x181)]));const _0x388047=await withSpinner('Listing\x20folders,\x20segments,\x20and\x20journeys...',()=>_0x37af3e['segment']['listUnifiedWithJourneys'](_0x31147f['parentId'],_0x31147f['folderId']),{'verbose':_0x5997c2[_0x206060(0x182)]}),{folders:_0x1cdbf2,segments:_0x424c3a,journeys:_0x3d63dd}=_0x388047[_0x206060(0x1b1)],_0x5be2c1=_0x1cdbf2['length']+_0x424c3a[_0x206060(0x16f)]+_0x3d63dd[_0x206060(0x16f)];console['error']('✔\x20Found\x20'+_0x1cdbf2[_0x206060(0x16f)]+_0x206060(0x198)+(_0x1cdbf2[_0x206060(0x16f)]!==0x1?'s':'')+',\x20'+_0x424c3a[_0x206060(0x16f)]+_0x206060(0x17a)+(_0x424c3a[_0x206060(0x16f)]!==0x1?'s':'')+',\x20and\x20'+_0x3d63dd['length']+_0x206060(0x18f)+(_0x3d63dd[_0x206060(0x16f)]!==0x1?'s':''));const _0x2940af=_0x44adfc=>{const _0x4ebbf7=_0x206060;return getConsoleNextUrl(_0x5997c2[_0x4ebbf7(0x199)],_0x4ebbf7(0x196)+_0x31147f['parentId']+'/e/'+_0x44adfc);},_0x1537a8=_0x3c8c5a=>{const _0x4cab3a=_0x206060;return getConsoleNextUrl(_0x5997c2[_0x4cab3a(0x199)],'/app/ps/'+_0x31147f[_0x4cab3a(0x19a)]+'/e/'+_0x3c8c5a+_0x4cab3a(0x194));},_0x230037=_0x5997c2[_0x206060(0x188)]==='json'||_0x5997c2[_0x206060(0x188)]===_0x206060(0x18b);if(_0x230037){const _0x3f3e64=[..._0x1cdbf2[_0x206060(0x1a9)](_0x45aa4f=>({..._0x45aa4f,'type':_0x206060(0x19d)})),..._0x424c3a[_0x206060(0x1a9)](_0x45f873=>({..._0x45f873,'type':'segment','url':_0x2940af(_0x45f873['id'])})),..._0x3d63dd[_0x206060(0x1a9)](_0x1e5d4c=>({..._0x1e5d4c,'name':_0x1e5d4c['journeyBundleName'],'type':_0x206060(0x19f),'url':_0x1537a8(_0x1e5d4c['id'])}))]['sort']((_0x364c3b,_0x566013)=>_0x364c3b[_0x206060(0x16d)][_0x206060(0x17c)](_0x566013[_0x206060(0x16d)]));await handleSDKOutput(_0x3f3e64,_0x5997c2);}else{if(_0x5be2c1===0x0)console[_0x206060(0x176)](a44_0x3c23d3[_0x206060(0x1b2)]('['+_0x37ffb8+']')),console[_0x206060(0x176)]('(empty)');else{console[_0x206060(0x176)](a44_0x3c23d3[_0x206060(0x1b2)]('['+_0x37ffb8+']'));const _0x1294ea=formatFlatList(_0x1cdbf2,_0x424c3a,{'showMetadata':!![],'getSegmentUrl':_0x2940af,'getJourneyUrl':_0x1537a8},_0x3d63dd);console[_0x206060(0x176)](_0x1294ea);}}return 0x0;}async[a44_0x3f2396(0x169)](_0x4e6c0b,_0x1f975b){const _0x3ffb12=a44_0x3f2396,{options:_0x5955a0,tdx:_0x1cad92}=_0x4e6c0b,_0x3ad697=await withSpinner(_0x3ffb12(0x18d)+_0x1f975b+_0x3ffb12(0x16e),()=>_0x1cad92[_0x3ffb12(0x1b0)][_0x3ffb12(0x1af)](_0x1f975b),{'verbose':_0x5955a0[_0x3ffb12(0x182)]}),_0x1f8833=_0x3ad697[_0x3ffb12(0x1b1)];_0x5955a0[_0x3ffb12(0x182)]&&(console[_0x3ffb12(0x1a3)]('Parent\x20ID:\x20'+_0x1f8833[_0x3ffb12(0x19a)]),_0x1f8833[_0x3ffb12(0x181)]&&console[_0x3ffb12(0x1a3)](_0x3ffb12(0x16c)+_0x1f8833['folderId']));const _0x52feed=_0x5955a0['maxDepth']||0xa,_0xb8d07c=await withSpinner(_0x3ffb12(0x184),()=>_0x1cad92['segment'][_0x3ffb12(0x169)](_0x1f8833[_0x3ffb12(0x19a)],_0x1f8833[_0x3ffb12(0x181)],0x0,_0x52feed),{'verbose':_0x5955a0[_0x3ffb12(0x182)]}),_0x301a8b=_0xb8d07c[_0x3ffb12(0x1b1)],_0x3b5399=_0x1d7a9c=>{const _0x14db62=_0x3ffb12;let _0x4995ed=0x0,_0x1d08d1=0x0,_0x1beb98=0x0;for(const _0x36068d of _0x1d7a9c){if(_0x36068d['type']==='folder')_0x4995ed++;else{if(_0x36068d[_0x14db62(0x19e)]==='segment')_0x1d08d1++;else{if(_0x36068d['type']===_0x14db62(0x19f))_0x1beb98++;}}if(_0x36068d[_0x14db62(0x1a1)]){const _0x3569c4=_0x3b5399(_0x36068d['children']);_0x4995ed+=_0x3569c4['folders'],_0x1d08d1+=_0x3569c4['segments'],_0x1beb98+=_0x3569c4[_0x14db62(0x178)];}}return{'folders':_0x4995ed,'segments':_0x1d08d1,'journeys':_0x1beb98};},_0x1b4be1=_0x3b5399(_0x301a8b);console[_0x3ffb12(0x1a3)](_0x3ffb12(0x179)+_0x1b4be1[_0x3ffb12(0x1a6)]+_0x3ffb12(0x198)+(_0x1b4be1[_0x3ffb12(0x1a6)]!==0x1?'s':'')+',\x20'+_0x1b4be1[_0x3ffb12(0x195)]+_0x3ffb12(0x17a)+(_0x1b4be1[_0x3ffb12(0x195)]!==0x1?'s':'')+',\x20and\x20'+_0x1b4be1[_0x3ffb12(0x178)]+_0x3ffb12(0x18f)+(_0x1b4be1[_0x3ffb12(0x178)]!==0x1?'s':''));const _0x293303=_0x4baa3=>{const _0x3ec6ec=_0x3ffb12;return getConsoleNextUrl(_0x5955a0['site'],_0x3ec6ec(0x196)+_0x1f8833['parentId']+_0x3ec6ec(0x1b3)+_0x4baa3);},_0x2d0be7=_0x5cb9d8=>{const _0x4b85fb=_0x3ffb12;return getConsoleNextUrl(_0x5955a0[_0x4b85fb(0x199)],_0x4b85fb(0x196)+_0x1f8833[_0x4b85fb(0x19a)]+'/e/'+_0x5cb9d8+'/j/da');};if(_0x5955a0[_0x3ffb12(0x188)]===_0x3ffb12(0x1a7)||_0x5955a0[_0x3ffb12(0x188)]==='jsonl')await handleSDKOutput(_0x301a8b,_0x5955a0);else{console[_0x3ffb12(0x176)](a44_0x3c23d3[_0x3ffb12(0x1b2)]('['+_0x1f975b+']'));const _0x26ea9d=formatTree(_0x301a8b,{'showMetadata':!![],'getSegmentUrl':_0x293303,'getJourneyUrl':_0x2d0be7});console[_0x3ffb12(0x176)](_0x26ea9d);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a45_0x37cccb=a45_0x5ec7;function a45_0x5ec7(_0x5bbba8,_0x5c6b21){_0x5bbba8=_0x5bbba8-0x144;const _0x1e73e8=a45_0x1e73();let _0x5ec7b1=_0x1e73e8[_0x5bbba8];return _0x5ec7b1;}(function(_0x44f6cc,_0xda5fa8){const _0x4b2555=a45_0x5ec7,_0x4f0f0b=_0x44f6cc();while(!![]){try{const _0x5028c3=parseInt(_0x4b2555(0x144))/0x1+parseInt(_0x4b2555(0x14f))/0x2+-parseInt(_0x4b2555(0x153))/0x3+-parseInt(_0x4b2555(0x147))/0x4+parseInt(_0x4b2555(0x159))/0x5+-parseInt(_0x4b2555(0x16c))/0x6+parseInt(_0x4b2555(0x154))/0x7;if(_0x5028c3===_0xda5fa8)break;else _0x4f0f0b['push'](_0x4f0f0b['shift']());}catch(_0x4c57d1){_0x4f0f0b['push'](_0x4f0f0b['shift']());}}}(a45_0x1e73,0x8be8a));function a45_0x1e73(){const _0x5f1158=['Site:\x20','...','database','execute','✔\x20Retrieved\x20','limit','Catalog:\x20','cause','length','query','\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>','table','6408072BuXANj','921761SNWSva','Limit:\x20','data','4078304KoInwo','message','Usage:\x20tdx\x20show\x20<database.table>','\x20row','verbose','\x20from\x20','Usage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','showTable','1314510JmimUs','catalog','site','show','2048217nqxXyw','4932417TrdTjb','Error:\x20','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','Querying\x20','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','5298730AcDlap','Show\x20table\x20contents','error','description','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20show\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20show\x20--help\x27\x20for\x20more\x20options','\x20\x20Cause:\x20','validate'];a45_0x1e73=function(){return _0x5f1158;};return a45_0x1e73();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../core/constants.js';export class ShowCommand extends BaseCommand{['name']=a45_0x37cccb(0x152);[a45_0x37cccb(0x15c)]=a45_0x37cccb(0x15a);async[a45_0x37cccb(0x163)](_0x4689b1){const _0x2bd09f=a45_0x37cccb;return this[_0x2bd09f(0x14e)](_0x4689b1);}async[a45_0x37cccb(0x14e)](_0x3b727e){const _0x1deada=a45_0x37cccb,{options:_0x32a048,args:_0x21b84c,tdx:_0x4f1d67}=_0x3b727e;let _0x186772;try{_0x186772=parseTableReference(_0x21b84c[0x0]);const _0x4bd58c=_0x32a048[_0x1deada(0x162)];!_0x186772[_0x1deada(0x162)]&&_0x4bd58c&&(_0x186772[_0x1deada(0x162)]=_0x4bd58c);const _0x4f4660=validateTableDescribeReference(_0x186772);if(_0x4f4660)return console[_0x1deada(0x15b)](_0x1deada(0x155)+_0x4f4660),console[_0x1deada(0x15b)](_0x1deada(0x149)),console[_0x1deada(0x15b)](_0x1deada(0x16a)),console[_0x1deada(0x15b)](_0x1deada(0x156)),0x1;}catch(_0x16e5d6){return console[_0x1deada(0x15b)]('Error:\x20'+_0x16e5d6[_0x1deada(0x148)]),console[_0x1deada(0x15b)](_0x1deada(0x149)),console[_0x1deada(0x15b)](_0x1deada(0x16a)),console[_0x1deada(0x15b)](_0x1deada(0x156)),0x1;}const _0x3b73c4=_0x186772[_0x1deada(0x150)],_0x10aeb1=_0x186772['database'],_0x25465e=_0x186772[_0x1deada(0x16b)],_0x1bb1ef=resolveLimit(_0x32a048[_0x1deada(0x165)],DEFAULT_DISPLAY_LIMIT);try{_0x32a048[_0x1deada(0x14b)]&&(console[_0x1deada(0x15b)](_0x1deada(0x160)+_0x32a048[_0x1deada(0x151)]),_0x3b73c4&&console[_0x1deada(0x15b)](_0x1deada(0x166)+_0x3b73c4),console['error']('Database:\x20'+_0x10aeb1),console[_0x1deada(0x15b)]('Table:\x20'+_0x25465e),console[_0x1deada(0x15b)](_0x1deada(0x145)+_0x1bb1ef));const _0x42616c=_0x3b73c4?_0x3b73c4+'.'+_0x10aeb1+'.'+_0x25465e:_0x10aeb1+'.'+_0x25465e,_0x19954b=await withSpinner(_0x1deada(0x157)+_0x42616c+_0x1deada(0x161),()=>_0x4f1d67[_0x1deada(0x169)][_0x1deada(0x14e)](_0x10aeb1,_0x25465e,_0x1bb1ef,_0x3b73c4),{'verbose':_0x32a048[_0x1deada(0x14b)]}),_0x20d506=_0x19954b[_0x1deada(0x146)],_0x2d9155=_0x20d506[_0x1deada(0x146)];return _0x2d9155[_0x1deada(0x168)]===0x0?console[_0x1deada(0x15b)](_0x1deada(0x158)):console[_0x1deada(0x15b)](_0x1deada(0x164)+_0x2d9155[_0x1deada(0x168)]+_0x1deada(0x14a)+(_0x2d9155[_0x1deada(0x168)]!==0x1?'s':'')+_0x1deada(0x14c)+_0x42616c),await handleSDKOutput(_0x2d9155,_0x32a048),0x0;}catch(_0x59b412){if(_0x59b412 instanceof SDKError)return console['error'](_0x1deada(0x155)+_0x59b412['message']),_0x59b412[_0x1deada(0x167)]&&console[_0x1deada(0x15b)](_0x1deada(0x15e)+_0x59b412[_0x1deada(0x167)]),0x1;throw _0x59b412;}}[a45_0x37cccb(0x15f)](_0x37670f){const _0x22751a=a45_0x37cccb;if(_0x37670f['args']['length']===0x0)return _0x22751a(0x14d);if(_0x37670f['args'][_0x22751a(0x168)]>0x1)return _0x22751a(0x15d);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a46_0x47c9ef=a46_0x149d;(function(_0x15044e,_0x16d7f5){const _0x4419e9=a46_0x149d,_0x20c233=_0x15044e();while(!![]){try{const _0x32fc94=-parseInt(_0x4419e9(0x130))/0x1*(-parseInt(_0x4419e9(0x119))/0x2)+parseInt(_0x4419e9(0x10e))/0x3*(-parseInt(_0x4419e9(0x109))/0x4)+-parseInt(_0x4419e9(0x106))/0x5+parseInt(_0x4419e9(0x115))/0x6*(-parseInt(_0x4419e9(0x127))/0x7)+parseInt(_0x4419e9(0x120))/0x8+-parseInt(_0x4419e9(0x108))/0x9*(parseInt(_0x4419e9(0x121))/0xa)+parseInt(_0x4419e9(0x125))/0xb;if(_0x32fc94===_0x16d7f5)break;else _0x20c233['push'](_0x20c233['shift']());}catch(_0x10f62a){_0x20c233['push'](_0x20c233['shift']());}}}(a46_0x135d,0x8238b));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';function a46_0x135d(){const _0xa2cc66=['49FZSZqL','Show\x20authentication\x20status\x20and\x20current\x20context','Credential\x20type:\x20','✗\x20Validation\x20failed:\x20','config','email','\x20profile:\x20','dim','jobs','1PDXlER','execute','log','Account\x20ID:','getUserInfo','Name:','(from\x20','5221855UCCTnU','first_name','34947OZqsFd','20280bDqYFW','account_id','Read\x20credential\x20from\x20','No\x20credential\x20found','description','75Jyuvxr','bold','site','name','session','join','cli','453282yweInT','OAuth','TDX_PROFILE\x20env','last_name','770806nPVpIG','displayWithSources','cyan','red','env','yellow','site:\x20','3464776rNmwcT','370zABRjg','message','User:','✓\x20Authentication\x20successful\x0a','17143588QgcBJU','error'];a46_0x135d=function(){return _0xa2cc66;};return a46_0x135d();}import{getOAuthTokens}from'../core/oauth-keychain.js';import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';function a46_0x149d(_0x450bd8,_0x34552d){_0x450bd8=_0x450bd8-0x103;const _0x135d3b=a46_0x135d();let _0x149d38=_0x135d3b[_0x450bd8];return _0x149d38;}import a46_0x4228d2 from'chalk';export class StatusCommand extends BaseCommand{[a46_0x47c9ef(0x111)]='status';[a46_0x47c9ef(0x10d)]=a46_0x47c9ef(0x128);async[a46_0x47c9ef(0x131)](_0x312346){const _0x1e8dad=a46_0x47c9ef,{options:_0x4c67e4,tdx:_0x24ff0a}=_0x312346,_0x489835=_0x4c67e4[_0x1e8dad(0x110)],_0x33a503=new GlobalContext(_0x4c67e4),_0x5068c0=_0x33a503['profile'],_0x1f6a37=_0x33a503['profileSource'],_0x2493c4=_0x1f6a37===_0x1e8dad(0x114)?'CLI\x20flag':_0x1f6a37===_0x1e8dad(0x112)?_0x1e8dad(0x112):_0x1f6a37===_0x1e8dad(0x11d)?_0x1e8dad(0x117):_0x1f6a37===_0x1e8dad(0x12b)?_0x1e8dad(0x12b):null,_0x4a0700=_0x5068c0?a46_0x4228d2[_0x1e8dad(0x11b)](_0x5068c0):a46_0x4228d2['dim']('N/A'),_0x24cb55=_0x2493c4?'\x20'+a46_0x4228d2[_0x1e8dad(0x12e)](_0x1e8dad(0x105)+_0x2493c4+')'):'';console[_0x1e8dad(0x132)](a46_0x4228d2[_0x1e8dad(0x10f)]('tdx')+_0x1e8dad(0x12d)+_0x4a0700+_0x24cb55+'\x20'+a46_0x4228d2[_0x1e8dad(0x12e)]('(')+_0x1e8dad(0x11f)+a46_0x4228d2[_0x1e8dad(0x11b)](_0x489835)+a46_0x4228d2['dim'](')'));const _0x5ae02a=await getOAuthTokens(_0x5068c0);if(_0x5ae02a)console[_0x1e8dad(0x132)](_0x1e8dad(0x129)+a46_0x4228d2['cyan'](_0x1e8dad(0x116)));else{const _0x4bbb63=await resolveAPIKeyAsync(_0x489835,_0x5068c0);if(_0x4bbb63){const {source:_0x1bb038,isDeprecated:_0x512e2e}=_0x4bbb63,_0x2291dd=_0x1e8dad(0x10b)+a46_0x4228d2[_0x1e8dad(0x11b)](_0x1bb038);console['log'](_0x512e2e?a46_0x4228d2[_0x1e8dad(0x11e)](_0x2291dd):_0x2291dd);}else console[_0x1e8dad(0x132)](a46_0x4228d2['yellow'](_0x1e8dad(0x10c)));}let _0x3ded01=![];try{const _0x24a276=await _0x24ff0a[_0x1e8dad(0x12f)][_0x1e8dad(0x103)]();console[_0x1e8dad(0x132)](a46_0x4228d2['green'](_0x1e8dad(0x124))),console[_0x1e8dad(0x132)](a46_0x4228d2['bold'](_0x1e8dad(0x123))+'\x20'+a46_0x4228d2['cyan'](_0x24a276[_0x1e8dad(0x12c)]));if(_0x24a276[_0x1e8dad(0x107)]||_0x24a276[_0x1e8dad(0x118)]){const _0x570f5e=[_0x24a276['first_name'],_0x24a276[_0x1e8dad(0x118)]]['filter'](Boolean)[_0x1e8dad(0x113)]('\x20');console[_0x1e8dad(0x132)](a46_0x4228d2[_0x1e8dad(0x10f)](_0x1e8dad(0x104))+'\x20'+_0x570f5e);}_0x24a276[_0x1e8dad(0x10a)]&&console[_0x1e8dad(0x132)](a46_0x4228d2[_0x1e8dad(0x10f)](_0x1e8dad(0x133))+'\x20'+a46_0x4228d2[_0x1e8dad(0x11e)](_0x24a276['account_id'])),_0x3ded01=!![];}catch(_0x25907f){_0x25907f instanceof HTTPClientError&&_0x25907f['status']===0x191?printAuthError(_0x25907f,!![],_0x5068c0):console[_0x1e8dad(0x126)](a46_0x4228d2[_0x1e8dad(0x11c)](_0x1e8dad(0x12a)+(_0x25907f instanceof Error?_0x25907f[_0x1e8dad(0x122)]:String(_0x25907f))));}return console['log'](),_0x33a503[_0x1e8dad(0x11a)](),_0x3ded01?0x0:0x1;}}
|
package/dist/commands/tables.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x56d92a=a47_0x2a59;(function(_0x477d6b,_0x1dffeb){const _0x324286=a47_0x2a59,_0x2f0c8d=_0x477d6b();while(!![]){try{const _0x53d7d6=parseInt(_0x324286(0xbc))/0x1*(-parseInt(_0x324286(0xb1))/0x2)+-parseInt(_0x324286(0xb4))/0x3+parseInt(_0x324286(0x95))/0x4+-parseInt(_0x324286(0xa6))/0x5*(-parseInt(_0x324286(0x9e))/0x6)+parseInt(_0x324286(0x87))/0x7+-parseInt(_0x324286(0x91))/0x8*(-parseInt(_0x324286(0x90))/0x9)+-parseInt(_0x324286(0xbb))/0xa;if(_0x53d7d6===_0x1dffeb)break;else _0x2f0c8d['push'](_0x2f0c8d['shift']());}catch(_0x130195){_0x2f0c8d['push'](_0x2f0c8d['shift']());}}}(a47_0x3ef6,0x253f7));function a47_0x2a59(_0x5b934c,_0x7e3f11){_0x5b934c=_0x5b934c-0x87;const _0x3ef65c=a47_0x3ef6();let _0x2a5953=_0x3ef65c[_0x5b934c];return _0x2a5953;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,isStructuredFormat}from'../core/command-output.js';import{parseTableReference}from'../utils/table-ref-parser.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../core/constants.js';import{withSpinner}from'../utils/spinner.js';export class TablesCommand extends BaseCommand{[a47_0x56d92a(0xa9)]=a47_0x56d92a(0xb9);[a47_0x56d92a(0xb3)]='List\x20tables\x20in\x20a\x20database';async[a47_0x56d92a(0x9b)](_0x3d9db2){const _0x3525fb=a47_0x56d92a,{options:_0x2e5acb,args:_0x379b1b,tdx:_0x38559c}=_0x3d9db2;let _0x40780f;if(_0x379b1b[_0x3525fb(0x98)]===0x0)_0x40780f={'database':undefined,'table':undefined,'original':''};else{if(_0x379b1b['length']===0x1)try{_0x40780f=parseTableReference(_0x379b1b[0x0]);if(_0x40780f[_0x3525fb(0xa4)]&&!_0x40780f['database']&&!_0x40780f[_0x3525fb(0xa4)][_0x3525fb(0x9c)]('*')&&!_0x40780f[_0x3525fb(0xa4)][_0x3525fb(0x9c)]('?'))return console[_0x3525fb(0xb8)]('Error:\x20Pattern\x20\x27'+_0x379b1b[0x0]+'\x27\x20is\x20ambiguous.'),console[_0x3525fb(0xb8)](_0x3525fb(0xa2)+_0x40780f['table']+'\x27?'),console['error'](_0x3525fb(0x8f)+_0x40780f[_0x3525fb(0xa4)]+_0x3525fb(0x9d)),console[_0x3525fb(0xb8)](_0x3525fb(0x93)+_0x40780f[_0x3525fb(0xa4)]),console['error'](_0x3525fb(0x8e)+_0x40780f[_0x3525fb(0xa4)]),console['error'](''),console[_0x3525fb(0xb8)](_0x3525fb(0xab)+_0x379b1b[0x0]+_0x3525fb(0x8a)+_0x40780f['table']+_0x3525fb(0xa0)),0x1;}catch(_0x254739){return console[_0x3525fb(0xb8)](_0x3525fb(0xb0)+_0x254739['message']),0x1;}else return console['error'](_0x3525fb(0xaf)),console[_0x3525fb(0xb8)](_0x3525fb(0xae)),console[_0x3525fb(0xb8)](_0x3525fb(0xb5)),console[_0x3525fb(0xb8)]('\x20\x20tdx\x20tables\x20\x22mydb.users\x22\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20in\x20database\x20mydb'),console['error'](_0x3525fb(0xaa)),console[_0x3525fb(0xb8)]('Or\x20use\x20--in\x20flag:'),console[_0x3525fb(0xb8)](_0x3525fb(0x92)),0x1;}const _0x32597f=_0x2e5acb[_0x3525fb(0x94)];!_0x40780f['database']&&_0x32597f&&(_0x40780f[_0x3525fb(0x94)]=_0x32597f);try{const _0x1527d4=_0x3e69da=>_0x3e69da&&(_0x3e69da[_0x3525fb(0x9c)]('*')||_0x3e69da[_0x3525fb(0x9c)]('?')),_0x680caf=_0x1527d4(_0x40780f[_0x3525fb(0x94)]);_0x2e5acb[_0x3525fb(0x8c)]&&(console['error'](_0x3525fb(0x9f)+_0x2e5acb[_0x3525fb(0xa5)]),_0x40780f[_0x3525fb(0x94)]?_0x680caf?console[_0x3525fb(0xb8)](_0x3525fb(0x96)+_0x40780f[_0x3525fb(0x94)]):console['error'](_0x3525fb(0xb2)+_0x40780f[_0x3525fb(0x94)]):console[_0x3525fb(0xb8)](_0x3525fb(0xac)),_0x40780f[_0x3525fb(0xa4)]&&console['error'](_0x3525fb(0x97)+_0x40780f[_0x3525fb(0xa4)]));const _0x40afa0=_0x40780f[_0x3525fb(0x94)]&&!_0x680caf?_0x40780f[_0x3525fb(0x94)]:undefined,_0x521873=_0x680caf?_0x40780f['database']:undefined,_0xc155cd=_0x40780f['table'],_0x41c425=resolveLimit(_0x2e5acb[_0x3525fb(0x8b)],DEFAULT_LISTING_LIMIT),_0x571722=await withSpinner(_0x3525fb(0x89),()=>_0x38559c[_0x3525fb(0xa1)][_0x3525fb(0xb7)](_0x40afa0,_0xc155cd,_0x521873,_0x41c425),{'verbose':_0x2e5acb['verbose']}),_0x3786d9=_0x571722[_0x3525fb(0x8d)];if(_0x3786d9['length']===0x0&&_0x40780f[_0x3525fb(0x94)]&&!_0x680caf)return console[_0x3525fb(0xb8)](_0x3525fb(0xa7)),console[_0x3525fb(0xb8)](_0x3525fb(0xad)+_0x40780f[_0x3525fb(0x94)]+_0x3525fb(0x99)),0x1;console['error']('✔\x20Found\x20'+_0x3786d9[_0x3525fb(0x98)]+'\x20table'+(_0x3786d9['length']!==0x1?'s':''));if(isStructuredFormat(_0x2e5acb))await handleSDKOutput(_0x3786d9,{..._0x2e5acb,'limit':_0x41c425});else for(const _0x5e62b7 of _0x3786d9){const _0x580a2b=_0x5e62b7['database_name']?_0x5e62b7[_0x3525fb(0xa3)]+'.':'';console['log'](_0x3525fb(0xa8)+_0x580a2b+_0x5e62b7['table_name']);}return 0x0;}catch(_0x41b3ed){if(_0x41b3ed instanceof SDKError)return console['error'](_0x3525fb(0xb0)+_0x41b3ed[_0x3525fb(0x88)]),_0x41b3ed[_0x3525fb(0xba)]&&console[_0x3525fb(0xb8)](_0x3525fb(0xb6)+_0x41b3ed[_0x3525fb(0xba)]),0x1;throw _0x41b3ed;}}[a47_0x56d92a(0x9a)](_0x3a6d82){return undefined;}}function a47_0x3ef6(){const _0x4c8b3f=['229954qwwbmk','Database:\x20','description','423234AgyKAb','\x20\x20tdx\x20tables\x20\x22mydb.*\x22\x20\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Cause:\x20','listTables','error','tables','cause','2462670gEtTac','2jEWxQQ','364532TLPvhe','message','Listing\x20tables...','\x27\x20without\x20wildcards\x20would\x20search\x20for\x20tables\x20named\x20\x27','limit','verbose','data','\x20\x20Or:\x20\x20tdx\x20tables\x20--database\x20','\x20\x20Use:\x20tdx\x20tables\x20\x22','225vAEcXW','95672xAwgOc','\x20\x20tdx\x20tables\x20--in\x20mydb\x20\x20\x20\x20\x20\x20\x20->\x20all\x20tables\x20from\x20mydb','\x20\x20Or:\x20\x20tdx\x20tables\x20--in\x20','database','860952gSSAPf','Database\x20pattern:\x20','Table\x20pattern:\x20','length','\x27\x20may\x20not\x20exist\x20or\x20contains\x20no\x20tables','validate','execute','includes','.*\x22','198lgBYQU','Site:\x20','\x27\x20across\x20all\x20databases.','query','Did\x20you\x20mean\x20to\x20list\x20all\x20tables\x20from\x20database\x20\x27','database_name','table','site','30845scRauP','✖\x20No\x20tables\x20found','📋\x20','name','\x20\x20tdx\x20tables\x20\x22*.user*\x22\x20\x20\x20\x20\x20\x20\x20->\x20tables\x20matching\x20user*\x20across\x20databases','Note:\x20\x27','Database:\x20all','Database\x20\x27','\x20\x20tdx\x20tables\x20users\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20->\x20table\x20\x22users\x22\x20across\x20all\x20databases','Error:\x20Too\x20many\x20arguments.\x20Use\x20single\x20argument:','Error:\x20'];a47_0x3ef6=function(){return _0x4c8b3f;};return a47_0x3ef6();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a48_0x5e01a6=a48_0x1cd2;(function(_0x576456,_0x3e43b0){const _0x433a53=a48_0x1cd2,_0x5c6ecd=_0x576456();while(!![]){try{const _0x35617a=parseInt(_0x433a53(0xa4))/0x1+parseInt(_0x433a53(0x99))/0x2+-parseInt(_0x433a53(0x90))/0x3+parseInt(_0x433a53(0x9b))/0x4+-parseInt(_0x433a53(0xad))/0x5*(-parseInt(_0x433a53(0xb5))/0x6)+-parseInt(_0x433a53(0xa6))/0x7+parseInt(_0x433a53(0xa3))/0x8;if(_0x35617a===_0x3e43b0)break;else _0x5c6ecd['push'](_0x5c6ecd['shift']());}catch(_0x41a394){_0x5c6ecd['push'](_0x5c6ecd['shift']());}}}(a48_0x2a03,0xe4fea));import{BaseCommand}from'./command.js';import{getSessionID,cleanExpiredSessions,clearSessionContextField}from'../core/session.js';import{clearDefaultSiteFromUserConfig,clearActiveProfileFromUserConfig}from'../core/profile.js';import{getConfigDir}from'../core/config.js';function a48_0x2a03(){const _0x193a3a=['length','--default\x20can\x20only\x20be\x20used\x20with\x20\x27site\x27\x20or\x20\x27profile\x27.\x20Other\x20resources\x20are\x20session-level\x20only.','\x20\x20\x20\x20\x20\x20\x20tdx\x20unset\x20--default\x20<resource>\x20\x20#\x20Clear\x20default\x20from\x20config\x0a','Invalid\x20resource:\x20','(session:\x20','Usage:\x20tdx\x20unset\x20<resource>\x0a','3878860AShkeb','join','engage_workspace','Error:\x20','agent','\x0aRun\x20\x27tdx\x20unset\x20--help\x27\x20for\x20more\x20options','llm_project','default','6ClYErp','error','session','message','Session\x20','1215294nZHFzY','green','Default\x20site\x20','description','database','validate','profile','cleared','Default\x20profile\x20','342462WcmXPt','\x0aResources:\x20site,\x20database,\x20parent_segment,\x20llm_project,\x20agent,\x20profile,\x20engage_workspace\x0a','5536468vXfARu','\x0aUpdated:\x20','dim','unset','name','log','parent_segment','.\x20Must\x20be\x20one\x20of:\x20','260384cakMJL','518809oSjhwo','site','10775919HTzCaA'];a48_0x2a03=function(){return _0x193a3a;};return a48_0x2a03();}function a48_0x1cd2(_0x20d562,_0x334e0d){_0x20d562=_0x20d562-0x90;const _0x2a03ac=a48_0x2a03();let _0x1cd20f=_0x2a03ac[_0x20d562];return _0x1cd20f;}import a48_0xc0c1b from'chalk';import*as a48_0x5e1cb7 from'node:path';export class UnsetCommand extends BaseCommand{[a48_0x5e01a6(0x9f)]=a48_0x5e01a6(0x9e);[a48_0x5e01a6(0x93)]='Clear\x20session-level\x20or\x20default\x20context\x20values';[a48_0x5e01a6(0x95)](_0x36ae99){const _0x172dc8=a48_0x5e01a6,{args:_0x35f21d,options:_0x25e85e}=_0x36ae99,_0x1ca079=_0x25e85e[_0x172dc8(0xb4)];if(_0x35f21d[_0x172dc8(0xa7)]===0x0)return _0x172dc8(0xac)+_0x172dc8(0xa9)+_0x172dc8(0x9a)+_0x172dc8(0xb2);const _0x546e07=_0x35f21d[0x0],_0x1fc6d6=[_0x172dc8(0xa5),'database','parent_segment',_0x172dc8(0xb3),_0x172dc8(0xb1),'profile','engage_workspace'];if(!_0x1fc6d6['includes'](_0x546e07))return _0x172dc8(0xaa)+_0x546e07+_0x172dc8(0xa2)+_0x1fc6d6[_0x172dc8(0xae)](',\x20');if(_0x1ca079&&_0x546e07!==_0x172dc8(0xa5)&&_0x546e07!==_0x172dc8(0x96))return _0x172dc8(0xa8);return undefined;}async['execute'](_0x28c3f4){const _0x3df8f8=a48_0x5e01a6,{args:_0x3e2104,options:_0x453378}=_0x28c3f4,_0x39227a=_0x453378[_0x3df8f8(0xb4)];cleanExpiredSessions();try{const _0x2a21d3=_0x3e2104[0x0],_0x1c3a6f=a48_0x5e1cb7[_0x3df8f8(0xae)](getConfigDir(),'tdx.json');if(_0x39227a){if(_0x2a21d3===_0x3df8f8(0xa5))return clearDefaultSiteFromUserConfig(),console[_0x3df8f8(0xa0)](_0x3df8f8(0x92)+a48_0xc0c1b[_0x3df8f8(0x91)]('cleared')),console['log'](a48_0xc0c1b[_0x3df8f8(0x9d)]('\x0aUpdated:\x20'+_0x1c3a6f)),0x0;if(_0x2a21d3==='profile')return clearActiveProfileFromUserConfig(),console[_0x3df8f8(0xa0)](_0x3df8f8(0x98)+a48_0xc0c1b['green']('cleared')),console[_0x3df8f8(0xa0)](a48_0xc0c1b[_0x3df8f8(0x9d)](_0x3df8f8(0x9c)+_0x1c3a6f)),0x0;}const _0x496d69=getSessionID(_0x453378[_0x3df8f8(0xb7)]),_0xfa29ec={'site':_0x3df8f8(0xa5),'database':_0x3df8f8(0x94),'parent_segment':_0x3df8f8(0xa1),'llm_project':_0x3df8f8(0xb3),'agent':'llm_agent','profile':'profile','engage_workspace':_0x3df8f8(0xaf)},_0xea4ed3=_0xfa29ec[_0x2a21d3];return _0xea4ed3&&(clearSessionContextField(_0xea4ed3,_0x453378[_0x3df8f8(0xb7)]),console['log'](_0x3df8f8(0xb9)+_0x2a21d3+'\x20'+a48_0xc0c1b[_0x3df8f8(0x91)](_0x3df8f8(0x97))+'\x20'+a48_0xc0c1b[_0x3df8f8(0x9d)](_0x3df8f8(0xab)+_0x496d69+')'))),0x0;}catch(_0x5368f2){return _0x5368f2 instanceof Error&&console[_0x3df8f8(0xb6)](_0x3df8f8(0xb0)+_0x5368f2[_0x3df8f8(0xb8)]),0x1;}}}
|