@treasuredata/tdx 2026.3.52 → 2026.3.54
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/cas-command.js +1 -1
- package/dist/commands/cas-segment-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/work-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.d.ts.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +2 -0
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/index.js.map +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.d.ts +50 -0
- package/dist/mcp/tools/work-create-item.d.ts.map +1 -0
- package/dist/mcp/tools/work-create-item.js +1 -0
- package/dist/mcp/tools/work-create-item.js.map +1 -0
- 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/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.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/types/workspace.d.ts +15 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.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/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts +14 -2
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.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
|
-
const
|
|
1
|
+
const a40_0x2c598d=a40_0x92c3;(function(_0x17439e,_0x15cd5f){const _0x30ff5a=a40_0x92c3,_0x520b89=_0x17439e();while(!![]){try{const _0x51da08=parseInt(_0x30ff5a(0xd0))/0x1*(-parseInt(_0x30ff5a(0xd3))/0x2)+-parseInt(_0x30ff5a(0xcc))/0x3+-parseInt(_0x30ff5a(0xb9))/0x4*(-parseInt(_0x30ff5a(0xbc))/0x5)+parseInt(_0x30ff5a(0xdf))/0x6+-parseInt(_0x30ff5a(0xab))/0x7+-parseInt(_0x30ff5a(0xd2))/0x8+-parseInt(_0x30ff5a(0x96))/0x9*(-parseInt(_0x30ff5a(0x99))/0xa);if(_0x51da08===_0x15cd5f)break;else _0x520b89['push'](_0x520b89['shift']());}catch(_0x566af6){_0x520b89['push'](_0x520b89['shift']());}}}(a40_0x34eb,0x3c418));function a40_0x92c3(_0x10887c,_0x4d7c9c){_0x10887c=_0x10887c-0x95;const _0x34eb21=a40_0x34eb();let _0x92c3a8=_0x34eb21[_0x10887c];return _0x92c3a8;}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext}from'../core/session.js';import a40_0x32bcfc from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';function a40_0x34eb(){const _0x34dd6e=['site','hasChanges','Pulling\x20segments\x20from\x20\x27','counts','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','cwd','cyan','\x20=\x20','message','yes','segment','description','Site:\x20','no_parent','dryRun','1107666XDLfPq','Target\x20resource:\x20','\x20activations','journeys','targetDir','journeyVersions','isNew','parent_segment','filter','length','Error:\x20','\x20with\x20','Usage:\x20tdx\x20sg\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20(requires\x20context\x20or\x20tdx.json)','\x20files\x20to\x20','4gqmhQl','parentName','dim','2365815MlsIos','\x0aChanges\x20to\x20\x27','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','relativePath','content','absolutePath','\x27...','\x20files?','\x20unchanged\x20files','\x0aError:','errorCode','session','error','helpText','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','\x20\x20🎯\x20','1227672rtTKGy','utf-8','-\x20no\x20files\x20written','segment:pull','1667oxCvno','dirname','1185256gkwrDA','134exGmST','✔\x20Context\x20set:\x20','pullSegments','\x20segments','green','parentSegment','red','files','\x20changed\x20files','Write\x20','name','\x20\x20🗺️\x20\x20','967278RBbFkR','resourceName','segments','type','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Pull\x20specific\x20segment\x20file','Aborted.','repeat','2268abPEfu','verbose','\x20versions)','17450QegIOJ','yellow','Parent\x20segment:\x20'];a40_0x34eb=function(){return _0x34dd6e;};return a40_0x34eb();}import a40_0x27f258 from'path';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';export{buildFolderIdToPathMap as buildFolderPathMap}from'../sdk/segment/resolution-context.js';export class SegmentPullCommand extends BaseCommand{[a40_0x2c598d(0xdd)]=a40_0x2c598d(0xcf);[a40_0x2c598d(0xa7)]='Pull\x20child\x20segments\x20and\x20journeys\x20to\x20YAML\x20files';async['execute'](_0x36c8db){const _0x254e92=a40_0x2c598d,{options:_0x35ee56,args:_0x4f06ca,tdx:_0x493309}=_0x36c8db,_0x50a978=_0x35ee56,_0x7d851=await resolveTarget({'arg':_0x4f06ca[0x0],'contextParent':_0x35ee56[_0x254e92(0xd8)],'cwd':process[_0x254e92(0xa1)]()});if(!isSuccessfulResolution(_0x7d851))return _0x7d851[_0x254e92(0xc6)]===_0x254e92(0xa9)?(console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0x9a)](_0x254e92(0xbe))),console[_0x254e92(0xc8)](_0x254e92(0xb7)),console[_0x254e92(0xc8)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20pull\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Pull\x20all\x20segments\x20from\x20parent'),console[_0x254e92(0xc8)](_0x254e92(0xe3))):(console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xd9)](_0x254e92(0xb5)+_0x7d851[_0x254e92(0xa4)]+'\x0a')),_0x7d851['helpText']&&console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xa2)](_0x7d851[_0x254e92(0xc9)]))),0x1;const _0x77b0c=_0x7d851[_0x254e92(0xba)],_0x4e7bc8=_0x7d851[_0x254e92(0xaf)],_0x5be467=_0x7d851[_0x254e92(0xe2)]==='file'?_0x7d851[_0x254e92(0xe0)]:undefined;_0x50a978[_0x254e92(0x97)]&&(console[_0x254e92(0xc8)](_0x254e92(0xa8)+_0x50a978[_0x254e92(0x9c)]),console['error'](_0x254e92(0x9b)+_0x77b0c),_0x5be467&&console[_0x254e92(0xc8)](_0x254e92(0xac)+_0x5be467));const _0x19737f=await withProgressSpinner(_0x254e92(0x9e)+_0x77b0c+_0x254e92(0xc2),_0xc66e9a=>_0x493309[_0x254e92(0xa6)][_0x254e92(0xd5)](_0x77b0c,{'targetDir':_0x4e7bc8,'targetResourceName':_0x5be467,'verbose':_0x50a978[_0x254e92(0x97)],'progress':{'update':_0x10809d=>{const _0x6c58ab=_0x254e92;_0xc66e9a['setPhase'](_0x10809d),_0x50a978[_0x6c58ab(0x97)]&&console['error']('\x20\x20'+_0x10809d);}}}),{'verbose':_0x50a978[_0x254e92(0x97)]}),_0x5f829b=_0x19737f['data'];if(_0x5f829b['counts'][_0x254e92(0xe1)]===0x0&&_0x5f829b[_0x254e92(0x9f)][_0x254e92(0xae)]===0x0)return console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0x9a)]('No\x20segments\x20or\x20journeys\x20found\x20in\x20parent\x20segment\x20\x27'+_0x5f829b['parentName']+'\x27')),0x0;const _0x3a6e33=_0x5f829b[_0x254e92(0xda)]['filter'](_0x3babce=>_0x3babce[_0x254e92(0xb1)]),_0x207a70=_0x5f829b[_0x254e92(0xda)][_0x254e92(0xb3)](_0x55987c=>!_0x55987c[_0x254e92(0xb1)]&&_0x55987c['hasChanges']),_0x5070cd=_0x5f829b[_0x254e92(0xda)][_0x254e92(0xb3)](_0x45f25c=>!_0x45f25c[_0x254e92(0xb1)]&&!_0x45f25c[_0x254e92(0x9d)]);console[_0x254e92(0xc8)]('\x0aPull\x20summary\x20for\x20\x27'+_0x5f829b[_0x254e92(0xba)]+'\x27:'),console[_0x254e92(0xc8)](_0x254e92(0xcb)+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b[_0x254e92(0x9f)][_0x254e92(0xe1)]+_0x254e92(0xd6))+_0x254e92(0xb6)+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b[_0x254e92(0x9f)]['activations']+_0x254e92(0xad)));if(_0x5f829b['counts']['journeys']>0x0){const _0x73fa55=_0x5f829b[_0x254e92(0x9f)]['journeyVersions']>_0x5f829b[_0x254e92(0x9f)][_0x254e92(0xae)]?'\x20('+_0x5f829b[_0x254e92(0x9f)][_0x254e92(0xb0)]+_0x254e92(0x98):'';console[_0x254e92(0xc8)](_0x254e92(0xde)+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b[_0x254e92(0x9f)][_0x254e92(0xae)]+'\x20journeys')+a40_0x32bcfc['dim'](_0x73fa55));}console[_0x254e92(0xc8)]('\x20\x20'+a40_0x32bcfc['green']('+\x20'+_0x3a6e33[_0x254e92(0xb4)]+'\x20new\x20files')),console['error']('\x20\x20'+a40_0x32bcfc[_0x254e92(0x9a)]('~\x20'+_0x207a70['length']+_0x254e92(0xdb))),console[_0x254e92(0xc8)]('\x20\x20'+a40_0x32bcfc[_0x254e92(0xbb)]('=\x20'+_0x5070cd[_0x254e92(0xb4)]+_0x254e92(0xc4))),console[_0x254e92(0xc8)]('\x20\x20Target:\x20'+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b['targetDir'])+'\x0a');if(_0x207a70['length']>0x0)for(const _0x16f075 of _0x207a70){console['error'](_0x254e92(0xbd)+_0x16f075[_0x254e92(0xbf)]+'\x27:'),console[_0x254e92(0xc8)]('─'['repeat'](0x3c)),console['error'](_0x16f075['diff']),console[_0x254e92(0xc8)]('─'[_0x254e92(0x95)](0x3c));}if(_0x50a978[_0x254e92(0xaa)])return console[_0x254e92(0xc8)](a40_0x32bcfc['yellow']('\x0a[Dry\x20run]\x20No\x20files\x20were\x20written')),0x0;if(_0x3a6e33[_0x254e92(0xb4)]===0x0&&_0x207a70[_0x254e92(0xb4)]===0x0)return console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xd7)]('✔\x20All\x20files\x20are\x20up\x20to\x20date')),saveSessionContext({'parent_segment':_0x5f829b['parentName']},_0x50a978[_0x254e92(0xc7)]),console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xd7)](_0x254e92(0xd4)+a40_0x32bcfc['dim'](_0x254e92(0xb2))+'\x20=\x20'+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b[_0x254e92(0xba)]))),0x0;if(!_0x50a978[_0x254e92(0xa5)]){if(!isInteractive())return console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xd9)](_0x254e92(0xc5)),_0x254e92(0xca)),console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xbb)](_0x254e92(0xa0))),0x1;const _0x6527da=await confirmKey(_0x254e92(0xdc)+(_0x3a6e33[_0x254e92(0xb4)]+_0x207a70[_0x254e92(0xb4)])+_0x254e92(0xc3));if(!_0x6527da)return console['error'](a40_0x32bcfc[_0x254e92(0x9a)](_0x254e92(0xe4)),_0x254e92(0xce)),0x1;}for(const _0x4c4691 of _0x5f829b[_0x254e92(0xda)]){if(_0x4c4691[_0x254e92(0xb1)]||_0x4c4691['hasChanges']){const _0x28b2cd=a40_0x27f258[_0x254e92(0xd1)](_0x4c4691[_0x254e92(0xc1)]);!existsSync(_0x28b2cd)&&mkdirSync(_0x28b2cd,{'recursive':!![]}),writeFileSync(_0x4c4691[_0x254e92(0xc1)],_0x4c4691[_0x254e92(0xc0)],_0x254e92(0xcd));}}return console[_0x254e92(0xc8)](a40_0x32bcfc['green']('✔\x20Pulled\x20'+(_0x3a6e33[_0x254e92(0xb4)]+_0x207a70[_0x254e92(0xb4)])+_0x254e92(0xb8)+_0x5f829b[_0x254e92(0xaf)])),saveSessionContext({'parent_segment':_0x5f829b[_0x254e92(0xba)]},_0x50a978[_0x254e92(0xc7)]),console[_0x254e92(0xc8)](a40_0x32bcfc[_0x254e92(0xd7)]('✔\x20Context\x20set:\x20'+a40_0x32bcfc['dim'](_0x254e92(0xb2))+_0x254e92(0xa3)+a40_0x32bcfc[_0x254e92(0xa2)](_0x5f829b['parentName']))),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a41_0x465aa7=a41_0x3b8f;(function(_0xf61859,_0x1d1297){const _0x3d110a=a41_0x3b8f,_0xee9707=_0xf61859();while(!![]){try{const _0x154b74=-parseInt(_0x3d110a(0x130))/0x1*(-parseInt(_0x3d110a(0x11e))/0x2)+parseInt(_0x3d110a(0x18f))/0x3+-parseInt(_0x3d110a(0x14a))/0x4*(-parseInt(_0x3d110a(0x106))/0x5)+-parseInt(_0x3d110a(0x17f))/0x6+-parseInt(_0x3d110a(0x14e))/0x7+-parseInt(_0x3d110a(0x15a))/0x8+parseInt(_0x3d110a(0x14c))/0x9*(-parseInt(_0x3d110a(0x174))/0xa);if(_0x154b74===_0x1d1297)break;else _0xee9707['push'](_0xee9707['shift']());}catch(_0x1996a4){_0xee9707['push'](_0xee9707['shift']());}}}(a41_0x992a,0x8eb51));function a41_0x3b8f(_0x2cdf20,_0x2c225c){_0x2cdf20=_0x2cdf20-0x102;const _0x992a26=a41_0x992a();let _0x3b8f9d=_0x992a26[_0x2cdf20];return _0x3b8f9d;}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 a41_0x38231d from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';function a41_0x992a(){const _0x5e9c40=['getJourney','existingSegment','New\x20journey:','scopedFolderPath','1965336DWiToD','state','journey','listFolders','\x0aError:','blue','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','\x20\x20Activations:','\x20activations]','parentFolder','idToName','journeyId','data','segment','Resolving\x20parent\x20segment\x20\x27','filePath','72170tmVcSJ','join','length','helpText','attributes','Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments','Preparing\x20journeys...','get','/app/ps/','Parent\x20segment:\x20','versionNumber','parentName','Scoped\x20to\x20folder:\x20','journeyBundleName','\x27...','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','buildUserMaps','error','site','Aborted.','map','(Journey\x20will\x20be\x20deleted)','segment:push','connection','11148uKwdAQ','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','createdAt','toDelete','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','\x20\x20Source:\x20','\x20\x20🗺️\x20\x20Journeys:','then','yellow','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','getOutputSchemaWithCache','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','Site:\x20','parent_name','delete','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','cwd','Error\x20parsing\x20YAML:\x20','197dcGJga','type','/e/','\x20\x20\x20\x20','listActivations','folderPath','journeyBundleId','isScoped','no_parent','\x0a✔\x20Push\x20complete','Error:\x20Directory\x20not\x20found:\x20','Fetching\x20existing\x20data...','dim','\x20folders\x20to\x20create','changed','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made','Delete\x20journey:','errorCode','.yml','push','\x0aValidation\x20failed:','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)','all','existingJourney','deleted','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','164FHUjnJ','nameToType','9TaYXTI','unchanged','5426029lPaBuA','journeysOnly','segment\x20or\x20journey','yamlConfig','\x20to\x20update','nameToId','created','updatedAt','toCreate','yes','Source\x20directory:\x20','user','3047824wkJeHX','parentSegment','red','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','verbose','repeat','diff','file','\x20updated','/sb/da/esr','paused','📁\x20','\x20\x20Segments:\x20','isNew','Delete\x20segment:','description','list','name','filter','results','segments','toUpdate','createdSegmentIds','\x20changed','folderId','cyan','1723010BHAodK','\x20created','targetDir','listSegments','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','new','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','resolveParentId','\x20deleted','execute','/j/da/je','2592174Pwtsxy','Fetching\x20connections\x20for\x20name\x20resolution...','activations','\x20unchanged','\x20YAML\x20files\x20found','set','journeys','green','\x20to\x20delete','\x20new','folders','updated'];a41_0x992a=function(){return _0x5e9c40;};return a41_0x992a();}import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{resolveTDFolderPath,findSegmentsToDelete,findJourneysToDelete,buildSegmentLookupMap,buildSegmentNameToIdMap,buildJourneyBundleLookupMap,parseAndClassifyYamlFiles,validateParsedFiles,formatValidationErrors,extractRootFolderId,buildConnectionMaps,calculatePushStats,prepareSegmentFiles,prepareJourneyFiles,executePushSegments,executePushFolders,executePushSegmentDeletions,executePushJourneys}from'../sdk/segment/push-workflow.js';export class SegmentPushCommand extends BaseCommand{['name']=a41_0x465aa7(0x11c);[a41_0x465aa7(0x169)]=a41_0x465aa7(0x10b);async[a41_0x465aa7(0x17d)](_0x1f8fca){const _0x3fd521=a41_0x465aa7,{options:_0x36f3cd,args:_0x46f68e,tdx:_0x552104}=_0x1f8fca,_0x3dbcb6=_0x36f3cd,_0x237218=await resolveTarget({'arg':_0x46f68e[0x0],'contextParent':_0x36f3cd[_0x3fd521(0x15b)],'cwd':process[_0x3fd521(0x12e)]()});if(!isSuccessfulResolution(_0x237218))return _0x237218[_0x3fd521(0x141)]===_0x3fd521(0x138)?(console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x126)](_0x3fd521(0x115))),console[_0x3fd521(0x117)](_0x3fd521(0x145)),console[_0x3fd521(0x117)](_0x3fd521(0x15d)),console[_0x3fd521(0x117)](_0x3fd521(0x11f))):(console['error'](a41_0x38231d[_0x3fd521(0x15c)]('Error:\x20'+_0x237218['message']+'\x0a')),_0x237218[_0x3fd521(0x109)]&&console[_0x3fd521(0x117)](a41_0x38231d['cyan'](_0x237218[_0x3fd521(0x109)]))),0x1;if(_0x237218[_0x3fd521(0x131)]===_0x3fd521(0x12b))return console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x13a)+_0x237218[_0x3fd521(0x176)]+'\x0a')),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x173)](_0x3fd521(0x17a))),0x1;const _0x502af3=_0x237218[_0x3fd521(0x111)],_0x4cc3a1=_0x237218[_0x3fd521(0x176)],_0xadd089=_0x237218[_0x3fd521(0x131)]===_0x3fd521(0x161)?_0x237218[_0x3fd521(0x105)]:undefined,_0x2802e9=getScopedDetails(_0x237218),_0x1cbbe0=_0x2802e9?.[_0x3fd521(0x137)]??![],_0xcccc74=_0x2802e9?.[_0x3fd521(0x18e)]??'';if(!existsSync(_0x4cc3a1))return console['error'](a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x13a)+_0x4cc3a1+'\x0a')),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x173)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;_0x3dbcb6[_0x3fd521(0x15e)]&&(console[_0x3fd521(0x117)](_0x3fd521(0x12a)+_0x3dbcb6[_0x3fd521(0x118)]),console['error'](_0x3fd521(0x10f)+_0x502af3),console[_0x3fd521(0x117)](_0x3fd521(0x158)+_0x4cc3a1),_0x1cbbe0&&console['error'](_0x3fd521(0x112)+_0xcccc74));const _0x50e409=await withSpinner(_0x3fd521(0x104)+_0x502af3+_0x3fd521(0x114),()=>_0x552104[_0x3fd521(0x103)][_0x3fd521(0x17b)](_0x502af3),{'verbose':_0x3dbcb6['verbose']}),_0x1e754f=_0x50e409[_0x3fd521(0x102)],{parentSegmentResult:_0x1a62d9,segmentsResult:_0x5bcae2,foldersResult:_0x4c560b,journeysWithDetailsResult:_0x272a05,userMaps:_0x2de18b}=await withSpinner(_0x3fd521(0x13b),async()=>{const _0xcc3341=_0x3fd521,[_0x4b4139,_0x18260e,_0x2cddef,_0x15c78e,_0x435d45]=await Promise[_0xcc3341(0x146)]([_0x552104[_0xcc3341(0x103)]['getParent'](_0x1e754f),_0x552104[_0xcc3341(0x103)][_0xcc3341(0x177)](_0x1e754f),_0x552104[_0xcc3341(0x103)][_0xcc3341(0x192)](_0x1e754f),_0x552104[_0xcc3341(0x191)]['listJourneysWithDetailsFromParentSegment'](_0x1e754f,{'includeAllVersions':!![]}),_0x552104[_0xcc3341(0x159)][_0xcc3341(0x116)]()]);return{'parentSegmentResult':_0x4b4139,'segmentsResult':_0x18260e,'foldersResult':_0x2cddef,'journeysWithDetailsResult':_0x15c78e,'userMaps':_0x435d45};},{'verbose':_0x3dbcb6[_0x3fd521(0x15e)]})['then'](_0x1132b9=>_0x1132b9[_0x3fd521(0x102)]),_0x1e33d5=_0x1a62d9,_0x18e5eb=extractRootFolderId(_0x1e33d5),_0x5546cd=_0x5bcae2,_0x3be49f=_0x4c560b,{journeys:_0x55a1f4,activationStepsById:_0x5bbfd9}=_0x272a05,_0x887269=new Map(_0x55a1f4[_0x3fd521(0x11a)](_0x64da3f=>[_0x64da3f['id'],_0x64da3f])),_0x300c67=_0x55a1f4['map'](_0x50f124=>({'id':_0x50f124['id'],'name':_0x50f124[_0x3fd521(0x10a)]['name'],'journeyBundleName':_0x50f124[_0x3fd521(0x10a)][_0x3fd521(0x113)]||'','journeyBundleId':_0x50f124[_0x3fd521(0x10a)][_0x3fd521(0x136)]||'','versionNumber':_0x50f124['attributes'][_0x3fd521(0x110)],'description':_0x50f124[_0x3fd521(0x10a)]['description'],'state':_0x50f124['attributes'][_0x3fd521(0x190)],'paused':_0x50f124[_0x3fd521(0x10a)][_0x3fd521(0x164)],'audienceId':_0x50f124[_0x3fd521(0x10a)]['audienceId'],'folderId':_0x50f124['relationships']?.[_0x3fd521(0x198)]?.[_0x3fd521(0x102)]?.['id'],'createdAt':_0x50f124[_0x3fd521(0x10a)][_0x3fd521(0x120)],'updatedAt':_0x50f124[_0x3fd521(0x10a)][_0x3fd521(0x155)]})),{emailToId:_0x9c44c1,idToEmail:_0x57358f}=_0x2de18b,_0x52ec0d=await withSpinner(_0x3fd521(0x180),async()=>{const _0x578e99=_0x3fd521,_0x4f3732=await _0x552104['connection'][_0x578e99(0x16a)]();return buildConnectionMaps(_0x4f3732);},{'verbose':_0x3dbcb6[_0x3fd521(0x15e)]})['then'](_0x3c4f7f=>_0x3c4f7f[_0x3fd521(0x102)]),_0x1baffa=_0x52ec0d[_0x3fd521(0x153)],_0x4c7a58=_0x52ec0d[_0x3fd521(0x199)],_0x54227a=_0x52ec0d[_0x3fd521(0x14b)],_0x3cb77d={'emailToIdMap':_0x9c44c1,'connectionNameToIdMap':_0x1baffa,'connectionNameToTypeMap':_0x54227a,'getSchema':_0x2a8a80=>_0x552104['connection'][_0x3fd521(0x128)](_0x2a8a80)};let {pathToId:_0x51b53e,idToPath:_0x882df4}=buildFolderMaps(_0x3be49f);const _0x1bfc26=buildSegmentLookupMap(_0x5546cd,_0x882df4),_0x26fbe9=buildSegmentNameToIdMap(_0x5546cd),_0x10cce2=buildJourneyBundleLookupMap(_0x300c67,_0x882df4);let _0x138bfc;if(_0xadd089){if(!_0xadd089['endsWith'](_0x3fd521(0x142))&&!_0xadd089['endsWith']('.yaml'))return console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)]('Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20'+_0xadd089+'\x0a')),0x1;_0x138bfc=[_0xadd089];}else _0x138bfc=findYamlFiles(_0x4cc3a1);if(_0x138bfc[_0x3fd521(0x108)]===0x0)return console[_0x3fd521(0x117)](a41_0x38231d['red'](_0x3fd521(0x178)+_0x4cc3a1+'\x0a')),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x173)](_0x3fd521(0x149))),0x1;let _0x11a8df,_0xe9e400;try{const _0x5aa914=parseAndClassifyYamlFiles(_0x138bfc,_0x4cc3a1,{'skipSegments':_0x3dbcb6[_0x3fd521(0x14f)]});_0x11a8df=_0x5aa914[_0x3fd521(0x16e)],_0xe9e400=_0x5aa914['journeys'];const _0x250086=validateParsedFiles(_0x5aa914,_0x4cc3a1);if(_0x250086[_0x3fd521(0x108)]>0x0)return console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x144))),console[_0x3fd521(0x117)](formatValidationErrors(_0x250086)),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x126)](_0x3fd521(0x122))),0x1;}catch(_0x24eff3){return console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x12f)+(_0x24eff3 instanceof Error?_0x24eff3['message']:_0x24eff3))),0x1;}if(_0x11a8df[_0x3fd521(0x108)]===0x0&&_0xe9e400[_0x3fd521(0x108)]===0x0){const _0x333697=_0x3dbcb6[_0x3fd521(0x14f)]?_0x3fd521(0x191):_0x3fd521(0x150);return console['error'](a41_0x38231d['yellow']('No\x20'+_0x333697+_0x3fd521(0x183))),0x0;}const _0x2eec62=new Map();_0x5546cd[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x14f)]&&await withSpinner('Fetching\x20existing\x20activations...',async()=>{await batchAsync(_0x5546cd,async _0x11d037=>{const _0x30a89b=a41_0x3b8f,_0x10ba08=await _0x552104[_0x30a89b(0x103)][_0x30a89b(0x134)](_0x1e754f,_0x11d037['id']);_0x2eec62[_0x30a89b(0x184)](_0x11d037['id'],_0x10ba08);});},{'verbose':_0x3dbcb6['verbose']});const {segmentFiles:_0x4d83cc,foldersToCreate:_0x573448}=await prepareSegmentFiles(_0x11a8df,{'segmentByFolderAndName':_0x1bfc26,'activationsBySegmentId':_0x2eec62,'folderPathToId':_0x51b53e,'idToEmailMap':_0x57358f,'connectionIdToNameMap':_0x4c7a58},_0x3cb77d,_0x1cbbe0,_0xcccc74),_0x5d1b64=_0xadd089?[]:findSegmentsToDelete(_0x5546cd,_0x11a8df[_0x3fd521(0x11a)](({yamlConfig:_0xfa3895,folderPath:_0x5a7b1d})=>({'yamlConfig':_0xfa3895,'folderPath':resolveTDFolderPath(_0x5a7b1d,_0x1cbbe0,_0xcccc74)})),_0x882df4,_0xcccc74,_0x1cbbe0),{journeyFiles:_0x3ac0ff,foldersToCreate:_0x32f6e9}=await withProgressSpinner(_0x3fd521(0x10c),async _0x5ed6fc=>prepareJourneyFiles(_0xe9e400,{'fetchJourney':async _0x1dfef3=>_0x552104[_0x3fd521(0x191)][_0x3fd521(0x18b)](_0x1dfef3['journeyId']),'journeyBundlesByFolderAndName':_0x10cce2,'folderPathToId':_0x51b53e,'idToEmailMap':_0x57358f,'connectionIdToNameMap':_0x4c7a58,'existingSegments':_0x5546cd,'parentId':_0x1e754f,'deps':_0x552104,'progress':{'update':_0xd053be=>{const _0x455602=_0x3fd521;_0x5ed6fc['setPhase'](_0xd053be),_0x3dbcb6[_0x455602(0x15e)]&&console['error']('\x20\x20'+_0xd053be);}},'journeyById':_0x887269,'activationStepsById':_0x5bbfd9},_0x1cbbe0,_0xcccc74),{'verbose':_0x3dbcb6[_0x3fd521(0x15e)]})[_0x3fd521(0x125)](_0x5e8996=>_0x5e8996[_0x3fd521(0x102)]);for(const _0x1e00c3 of _0x32f6e9){_0x573448['add'](_0x1e00c3);}const _0x1fa50e=_0xadd089?[]:findJourneysToDelete(_0x300c67,_0xe9e400[_0x3fd521(0x11a)](({yamlConfig:_0x56ba47,folderPath:_0x163257})=>({'yamlConfig':_0x56ba47,'folderPath':resolveTDFolderPath(_0x163257,_0x1cbbe0,_0xcccc74)})),_0x882df4,_0xcccc74,_0x1cbbe0),_0x23085a=calculatePushStats(_0x4d83cc,_0x3ac0ff,_0x573448,_0x5d1b64,_0x1fa50e,!!_0x3dbcb6[_0x3fd521(0x12c)],!!_0x3dbcb6[_0x3fd521(0x14f)]),_0x447431=_0x23085a['segments'][_0x3fd521(0x179)],_0x13d17d=_0x23085a[_0x3fd521(0x16e)][_0x3fd521(0x13e)],_0x292594=_0x23085a['segments']['unchanged'],_0x4d7ea5=_0x23085a[_0x3fd521(0x16e)][_0x3fd521(0x121)],_0x2f0ffb=_0x23085a[_0x3fd521(0x189)][_0x3fd521(0x156)],_0x460661=_0x23085a[_0x3fd521(0x185)][_0x3fd521(0x179)],_0x39a6a9=_0x23085a[_0x3fd521(0x185)][_0x3fd521(0x13e)],_0x14209d=_0x23085a[_0x3fd521(0x185)][_0x3fd521(0x14d)],_0x5947d8=_0x23085a[_0x3fd521(0x185)]['toDelete'],_0x1ba839=_0x23085a[_0x3fd521(0x181)][_0x3fd521(0x146)],_0x5646bc=_0x23085a[_0x3fd521(0x181)][_0x3fd521(0x156)],_0x4ab3f8=_0x23085a[_0x3fd521(0x181)][_0x3fd521(0x16f)],_0x2c61b2=_0x23085a['activations'][_0x3fd521(0x121)];console[_0x3fd521(0x117)]('\x0aPush\x20summary\x20for\x20\x27'+_0x502af3+'\x27:');_0x2f0ffb['length']>0x0&&console[_0x3fd521(0x117)]('\x20\x20'+a41_0x38231d[_0x3fd521(0x194)](_0x3fd521(0x165)+_0x2f0ffb[_0x3fd521(0x108)]+_0x3fd521(0x13d)));if(!_0x3dbcb6[_0x3fd521(0x14f)]){console['error']('\x20\x20📊\x20Segments:'),console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d['green']('+\x20'+_0x447431[_0x3fd521(0x108)]+_0x3fd521(0x188))),console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x126)]('~\x20'+_0x13d17d[_0x3fd521(0x108)]+_0x3fd521(0x171)));if(_0x4d7ea5[_0x3fd521(0x108)]>0x0)console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x15c)]('-\x20'+_0x4d7ea5['length']+_0x3fd521(0x187)));else _0x5d1b64[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x12c)]&&console['error'](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x13c)](_0x5d1b64[_0x3fd521(0x108)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console['error'](_0x3fd521(0x133)+a41_0x38231d['dim']('=\x20'+_0x292594['length']+'\x20unchanged'));}if(_0x3ac0ff[_0x3fd521(0x108)]>0x0||_0x1fa50e['length']>0x0){console[_0x3fd521(0x117)](_0x3fd521(0x124)),console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x186)]('+\x20'+_0x460661[_0x3fd521(0x108)]+_0x3fd521(0x188))),console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d['yellow']('~\x20'+_0x39a6a9[_0x3fd521(0x108)]+_0x3fd521(0x171)));if(_0x5947d8['length']>0x0)console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x15c)]('-\x20'+_0x5947d8['length']+_0x3fd521(0x187)));else _0x1fa50e[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x12c)]&&console['error'](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x13c)](_0x1fa50e[_0x3fd521(0x108)]+'\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)'));console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x13c)]('=\x20'+_0x14209d['length']+_0x3fd521(0x182)));}_0x1ba839[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x14f)]&&(console[_0x3fd521(0x117)](''),console[_0x3fd521(0x117)](_0x3fd521(0x196)),_0x5646bc[_0x3fd521(0x108)]>0x0&&console['error'](_0x3fd521(0x133)+a41_0x38231d[_0x3fd521(0x186)]('+\x20'+_0x5646bc[_0x3fd521(0x108)]+'\x20to\x20create')),_0x4ab3f8[_0x3fd521(0x108)]>0x0&&console[_0x3fd521(0x117)]('\x20\x20\x20\x20'+a41_0x38231d[_0x3fd521(0x126)]('~\x20'+_0x4ab3f8[_0x3fd521(0x108)]+_0x3fd521(0x152))),_0x2c61b2[_0x3fd521(0x108)]>0x0&&console[_0x3fd521(0x117)](_0x3fd521(0x133)+a41_0x38231d['red']('-\x20'+_0x2c61b2[_0x3fd521(0x108)]+_0x3fd521(0x187))));console[_0x3fd521(0x117)](_0x3fd521(0x123)+a41_0x38231d[_0x3fd521(0x173)](_0x4cc3a1)+'\x0a');if(_0x2f0ffb[_0x3fd521(0x108)]>0x0){console[_0x3fd521(0x117)]('Folders\x20to\x20create:');for(const _0x53c4de of _0x2f0ffb){console[_0x3fd521(0x117)]('\x20\x20'+a41_0x38231d['blue']('+')+'\x20'+_0x53c4de);}console[_0x3fd521(0x117)]('');}if(_0x447431[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6['journeysOnly'])for(const _0x1ef66f of _0x447431){const _0x1d108d=_0x1ef66f[_0x3fd521(0x135)]?_0x1ef66f[_0x3fd521(0x135)]+'/'+_0x1ef66f['yamlConfig'][_0x3fd521(0x16b)]:_0x1ef66f['yamlConfig'][_0x3fd521(0x16b)],_0x269478=_0x1ef66f[_0x3fd521(0x151)][_0x3fd521(0x181)]?.[_0x3fd521(0x108)]||0x0,_0x3f79fe=_0x269478>0x0?a41_0x38231d[_0x3fd521(0x13c)]('\x20['+_0x269478+_0x3fd521(0x197)):'';console['error']('\x0a'+a41_0x38231d['green']('New\x20segment:')+'\x20'+_0x1d108d+_0x3f79fe),console['error']('─'[_0x3fd521(0x15f)](0x3c)),_0x1ef66f[_0x3fd521(0x160)]&&console['error'](_0x1ef66f['diff']),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c));}if(_0x4d7ea5[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x14f)])for(const _0x5c3dfb of _0x4d7ea5){const _0x405e00=_0x5c3dfb['segmentFolderId']?_0x882df4[_0x3fd521(0x10d)](_0x5c3dfb['segmentFolderId']['toString']())||'':'',_0x48b3aa=_0x405e00?_0x405e00+'/'+_0x5c3dfb[_0x3fd521(0x16b)]:_0x5c3dfb[_0x3fd521(0x16b)],_0x59ab05=_0x2eec62['get'](_0x5c3dfb['id'])||[],_0x2a950f=_0x59ab05[_0x3fd521(0x108)]>0x0?a41_0x38231d[_0x3fd521(0x13c)]('\x20['+_0x59ab05[_0x3fd521(0x108)]+_0x3fd521(0x197)):'';console[_0x3fd521(0x117)]('\x0a'+a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x168))+'\x20'+_0x48b3aa+_0x2a950f),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c));const _0x4011db=segmentWithActivationsToYaml(_0x5c3dfb,_0x59ab05,undefined,_0x57358f,_0x4c7a58),_0x230318=segmentToYamlString(_0x4011db),_0x16e9f7=generateDiff(_0x230318,'');console[_0x3fd521(0x117)](formatDiffWithColors(_0x16e9f7)),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c));}const _0x482ab3=_0x4d83cc['filter'](_0x3c2d65=>!_0x3c2d65[_0x3fd521(0x167)]&&_0x3c2d65['diff']);if(_0x482ab3['length']>0x0&&!_0x3dbcb6[_0x3fd521(0x14f)])for(const _0x427a6e of _0x482ab3){const _0x2f0fa8=_0x427a6e[_0x3fd521(0x135)]?_0x427a6e[_0x3fd521(0x135)]+'/'+_0x427a6e[_0x3fd521(0x151)][_0x3fd521(0x16b)]:_0x427a6e[_0x3fd521(0x151)][_0x3fd521(0x16b)];console[_0x3fd521(0x117)]('\x0a'+a41_0x38231d[_0x3fd521(0x126)]('Changes\x20to:')+'\x20'+_0x2f0fa8),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c)),console[_0x3fd521(0x117)](_0x427a6e[_0x3fd521(0x160)]),console['error']('─'[_0x3fd521(0x15f)](0x3c));}if(_0x460661[_0x3fd521(0x108)]>0x0)for(const _0x110651 of _0x460661){const _0x21ba2d=_0x110651[_0x3fd521(0x135)]?_0x110651[_0x3fd521(0x135)]+'/'+_0x110651[_0x3fd521(0x151)]['name']:_0x110651[_0x3fd521(0x151)][_0x3fd521(0x16b)];console[_0x3fd521(0x117)]('\x0a'+a41_0x38231d[_0x3fd521(0x186)](_0x3fd521(0x18d))+'\x20'+_0x21ba2d),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c)),_0x110651[_0x3fd521(0x160)]&&console[_0x3fd521(0x117)](_0x110651['diff']),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c));}const _0x169b31=_0x3ac0ff[_0x3fd521(0x16c)](_0x45a33c=>!_0x45a33c[_0x3fd521(0x167)]&&_0x45a33c[_0x3fd521(0x160)]);if(_0x169b31['length']>0x0)for(const _0xfafef7 of _0x169b31){const _0x51db0b=_0xfafef7[_0x3fd521(0x135)]?_0xfafef7['folderPath']+'/'+_0xfafef7['yamlConfig'][_0x3fd521(0x16b)]:_0xfafef7[_0x3fd521(0x151)][_0x3fd521(0x16b)];console[_0x3fd521(0x117)]('\x0a'+a41_0x38231d[_0x3fd521(0x126)]('Changes\x20to\x20journey:')+'\x20'+_0x51db0b),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c)),console[_0x3fd521(0x117)](_0xfafef7[_0x3fd521(0x160)]),console[_0x3fd521(0x117)]('─'['repeat'](0x3c));}if(_0x5947d8[_0x3fd521(0x108)]>0x0)for(const _0x29dbd3 of _0x5947d8){const _0x23a3b9=_0x29dbd3[_0x3fd521(0x172)]?_0x882df4[_0x3fd521(0x10d)](_0x29dbd3[_0x3fd521(0x172)])||'':'',_0x279add=_0x23a3b9?_0x23a3b9+'/'+_0x29dbd3[_0x3fd521(0x113)]:_0x29dbd3['journeyBundleName'];console['error']('\x0a'+a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x140))+'\x20'+_0x279add),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c)),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)](_0x3fd521(0x11b))),console[_0x3fd521(0x117)]('─'[_0x3fd521(0x15f)](0x3c));}if(_0x3dbcb6['dryRun'])return console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x126)](_0x3fd521(0x13f))),0x0;const _0x152226=_0x3dbcb6['journeysOnly']?![]:_0x447431[_0x3fd521(0x108)]>0x0||_0x13d17d[_0x3fd521(0x108)]>0x0||_0x4d7ea5[_0x3fd521(0x108)]>0x0,_0x3b06b9=_0x460661[_0x3fd521(0x108)]>0x0||_0x39a6a9[_0x3fd521(0x108)]>0x0||_0x5947d8[_0x3fd521(0x108)]>0x0,_0x8f7f6=_0x3dbcb6[_0x3fd521(0x14f)]?![]:_0x1ba839[_0x3fd521(0x108)]>0x0,_0x4c0533=_0x2f0ffb[_0x3fd521(0x108)]>0x0;if(!_0x152226&&!_0x3b06b9&&!_0x8f7f6&&!_0x4c0533){const _0x50cf25=_0x3dbcb6[_0x3fd521(0x14f)]?_0x3fd521(0x195):'✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date';console['error'](a41_0x38231d[_0x3fd521(0x186)](_0x50cf25));if(_0xadd089&&_0x292594['length']===0x1){const _0x2806fd=_0x292594[0x0];if(_0x2806fd[_0x3fd521(0x18c)]?.['id']){const _0x5396b6=getConsoleNextUrl(_0x3dbcb6[_0x3fd521(0x118)],_0x3fd521(0x10e)+_0x1e754f+_0x3fd521(0x132)+_0x2806fd[_0x3fd521(0x18c)]['id']+_0x3fd521(0x163));console['error'](_0x3fd521(0x129)+a41_0x38231d[_0x3fd521(0x173)](_0x5396b6));}}if(_0xadd089&&_0x14209d[_0x3fd521(0x108)]===0x1){const _0x201a1f=_0x14209d[0x0];if(_0x201a1f['existingJourney']?.['id']){const _0x5eb545=getConsoleNextUrl(_0x3dbcb6[_0x3fd521(0x118)],_0x3fd521(0x10e)+_0x1e754f+'/e/'+_0x201a1f[_0x3fd521(0x147)]['id']+_0x3fd521(0x17e));console[_0x3fd521(0x117)]('\x20\x20'+a41_0x38231d[_0x3fd521(0x173)](_0x5eb545));}}return 0x0;}const _0x43575b=_0x3dbcb6[_0x3fd521(0x14f)]?_0x460661[_0x3fd521(0x108)]+_0x39a6a9[_0x3fd521(0x108)]+_0x5947d8[_0x3fd521(0x108)]+_0x2f0ffb[_0x3fd521(0x108)]:_0x447431[_0x3fd521(0x108)]+_0x13d17d[_0x3fd521(0x108)]+_0x4d7ea5[_0x3fd521(0x108)]+_0x460661[_0x3fd521(0x108)]+_0x39a6a9[_0x3fd521(0x108)]+_0x5947d8[_0x3fd521(0x108)]+_0x2f0ffb[_0x3fd521(0x108)]+_0x1ba839[_0x3fd521(0x108)];if(!_0x3dbcb6[_0x3fd521(0x157)]&&_0x43575b>0x0){if(!isInteractive())return console[_0x3fd521(0x117)](a41_0x38231d['red'](_0x3fd521(0x193)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x13c)](_0x3fd521(0x127))),0x1;const _0x2c6843=await confirmKey('Push\x20'+_0x43575b+'\x20changes?');if(!_0x2c6843)return console['error'](a41_0x38231d[_0x3fd521(0x126)](_0x3fd521(0x119))),0x1;}const _0x4ec05e={'withProgress':async(_0x36056e,_0x23acbf)=>{const _0x22234b=_0x3fd521,_0x3e206a=await withSpinner(_0x36056e,_0x23acbf,{'verbose':_0x3dbcb6[_0x22234b(0x15e)]});return{'data':_0x3e206a[_0x22234b(0x102)]};},'logInfo':_0x2320c1=>console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x194)]('✔\x20'+_0x2320c1)),'logSuccess':_0x2d7f96=>console[_0x3fd521(0x117)](a41_0x38231d['green']('✔\x20'+_0x2d7f96)),'logWarning':_0x2c6c7c=>console[_0x3fd521(0x117)](a41_0x38231d['yellow']('⚠\x20'+_0x2c6c7c)),'logDeleted':_0x216caa=>console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x15c)]('✔\x20'+_0x216caa))},_0x58f609={'segment':_0x552104[_0x3fd521(0x103)],'journey':_0x552104[_0x3fd521(0x191)],'user':_0x552104['user'],'connection':_0x552104[_0x3fd521(0x11d)]};_0x2f0ffb[_0x3fd521(0x108)]>0x0&&(_0x51b53e=await executePushFolders(_0x58f609,_0x2f0ffb,_0x51b53e,{'parentId':_0x1e754f},_0x4ec05e));const _0xa9598b={'rootFolderId':_0x18e5eb,'folderPathToId':_0x51b53e,'folderIdToPath':_0x882df4,'segmentNameToId':_0x26fbe9,'activationsBySegmentId':_0x2eec62,'emailToIdMap':_0x9c44c1,'idToEmailMap':_0x57358f,'connectionNameToIdMap':_0x52ec0d[_0x3fd521(0x153)],'connectionIdToNameMap':_0x52ec0d['idToName'],'connectionNameToTypeMap':_0x54227a},_0x27bacd=await executePushSegments(_0x58f609,_0x3dbcb6[_0x3fd521(0x14f)]?[]:_0x4d83cc,_0xa9598b,{'parentId':_0x1e754f},_0x4ec05e),_0x549367=_0x27bacd[_0x3fd521(0x154)],_0x2df2f4=_0x27bacd['updated'],_0x5e9b85=_0x27bacd['activations']['created'],_0x5835e9=_0x27bacd[_0x3fd521(0x181)][_0x3fd521(0x18a)],_0xfd990b=_0x27bacd['activations'][_0x3fd521(0x148)];let _0x5af3df;if(_0xadd089&&_0x4d83cc[_0x3fd521(0x108)]===0x1){const _0x530fff=_0x4d83cc[0x0];_0x5af3df=_0x530fff['existingSegment']?.['id']??_0x27bacd['createdSegmentIds'][_0x3fd521(0x10d)](_0x530fff['yamlConfig'][_0x3fd521(0x16b)]);}const _0x58ddd5=await executePushSegmentDeletions(_0x58f609,_0x3dbcb6[_0x3fd521(0x14f)]?[]:_0x4d7ea5,_0x4ec05e);let _0x12aede=0x0,_0x1c904e=0x0,_0x29ce53=0x0;const _0x27f84a=new Map(_0x26fbe9);for(const [_0x54d16e,_0x326549]of _0x27bacd[_0x3fd521(0x170)]){_0x27f84a[_0x3fd521(0x184)](_0x54d16e,_0x326549);}if(_0x3ac0ff['length']>0x0){const _0x93ae04={..._0xa9598b,'segmentNameToId':_0x27f84a,'existingSegments':_0x5546cd,'activationContext':_0x3cb77d},_0x5af1c8=await executePushJourneys(_0x58f609,_0x3ac0ff,_0x93ae04,{'parentId':_0x1e754f,'rootFolderId':_0x18e5eb,'verbose':_0x3dbcb6[_0x3fd521(0x15e)]},_0x4ec05e);_0x12aede=_0x5af1c8[_0x3fd521(0x154)],_0x1c904e=_0x5af1c8[_0x3fd521(0x18a)];if(_0xadd089&&_0x5af1c8['results']['length']===0x1){const _0x46dda9=_0x5af1c8[_0x3fd521(0x16d)][0x0];if(_0x46dda9[_0x3fd521(0x19a)]){const _0xb3d90a=getConsoleNextUrl(_0x3dbcb6[_0x3fd521(0x118)],'/app/ps/'+_0x1e754f+'/e/'+_0x46dda9[_0x3fd521(0x19a)]+'/j/da/je');console[_0x3fd521(0x117)]('\x20\x20'+a41_0x38231d['cyan'](_0xb3d90a));}}}for(const _0x13d909 of _0x5947d8){console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x126)](_0x3fd521(0x12d)+_0x13d909[_0x3fd521(0x113)])),_0x29ce53++;}const _0x17869d=[];if(_0x549367>0x0)_0x17869d[_0x3fd521(0x143)](_0x549367+_0x3fd521(0x175));if(_0x2df2f4>0x0)_0x17869d[_0x3fd521(0x143)](_0x2df2f4+_0x3fd521(0x162));if(_0x58ddd5>0x0)_0x17869d[_0x3fd521(0x143)](_0x58ddd5+_0x3fd521(0x17c));const _0x2466ee=[];if(_0x12aede>0x0)_0x2466ee['push'](_0x12aede+'\x20created');if(_0x1c904e>0x0)_0x2466ee[_0x3fd521(0x143)](_0x1c904e+'\x20updated');if(_0x29ce53>0x0)_0x2466ee[_0x3fd521(0x143)](_0x29ce53+_0x3fd521(0x17c));const _0x26b00f=[];if(_0x5e9b85>0x0)_0x26b00f[_0x3fd521(0x143)](_0x5e9b85+_0x3fd521(0x175));if(_0x5835e9>0x0)_0x26b00f[_0x3fd521(0x143)](_0x5835e9+_0x3fd521(0x162));if(_0xfd990b>0x0)_0x26b00f[_0x3fd521(0x143)](_0xfd990b+'\x20deleted');console[_0x3fd521(0x117)](a41_0x38231d[_0x3fd521(0x186)](_0x3fd521(0x139)));_0x17869d[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6[_0x3fd521(0x14f)]&&console[_0x3fd521(0x117)](_0x3fd521(0x166)+_0x17869d['join'](',\x20'));_0x2466ee[_0x3fd521(0x108)]>0x0&&console[_0x3fd521(0x117)]('\x20\x20Journeys:\x20'+_0x2466ee[_0x3fd521(0x107)](',\x20'));_0x26b00f[_0x3fd521(0x108)]>0x0&&!_0x3dbcb6['journeysOnly']&&console[_0x3fd521(0x117)]('\x20\x20Activations:\x20'+_0x26b00f[_0x3fd521(0x107)](',\x20'));if(_0x5af3df){const _0x5f08e2=getConsoleNextUrl(_0x3dbcb6[_0x3fd521(0x118)],_0x3fd521(0x10e)+_0x1e754f+'/e/'+_0x5af3df+_0x3fd521(0x163));console[_0x3fd521(0x117)](_0x3fd521(0x129)+a41_0x38231d[_0x3fd521(0x173)](_0x5f08e2));}return 0x0;}}
|
|
1
|
+
const a41_0x170762=a41_0x2eed;(function(_0x17ad70,_0x4a4666){const _0x3f949e=a41_0x2eed,_0x2ebe0d=_0x17ad70();while(!![]){try{const _0x17d36d=-parseInt(_0x3f949e(0xf4))/0x1*(parseInt(_0x3f949e(0x10e))/0x2)+parseInt(_0x3f949e(0x128))/0x3+parseInt(_0x3f949e(0x10d))/0x4*(parseInt(_0x3f949e(0x142))/0x5)+parseInt(_0x3f949e(0xb4))/0x6*(parseInt(_0x3f949e(0xe3))/0x7)+parseInt(_0x3f949e(0xa9))/0x8+-parseInt(_0x3f949e(0x143))/0x9*(-parseInt(_0x3f949e(0xc0))/0xa)+parseInt(_0x3f949e(0xfb))/0xb*(-parseInt(_0x3f949e(0xb3))/0xc);if(_0x17d36d===_0x4a4666)break;else _0x2ebe0d['push'](_0x2ebe0d['shift']());}catch(_0x28e535){_0x2ebe0d['push'](_0x2ebe0d['shift']());}}}(a41_0x468e,0x68f06));import{BaseCommand}from'./command.js';function a41_0x468e(){const _0x411737=['push','relationships','Tip:\x20Run\x20`tdx\x20sg\x20pull`\x20first\x20to\x20create\x20segment\x20and\x20journey\x20files','2450095bcYpPi','1187271vlHoqx','journeyId','\x0aPush\x20summary\x20for\x20\x27','/e/','idToName','journeyBundleId','Fetching\x20existing\x20activations...','4817640lXtIVW','endsWith','results','join','filter','listJourneysWithDetailsFromParentSegment','\x20unchanged','listActivations','Push\x20','listSegments','2691012NQHPaV','1428378bSHGXD','\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20','\x20folders\x20to\x20create','\x0aFix\x20the\x20errors\x20above\x20and\x20try\x20again.\x20Use\x20`tdx\x20sg\x20validate`\x20to\x20check\x20files\x20locally.','journeysOnly','Error:\x20Directory\x20not\x20found:\x20','\x20changed','toDelete','Fetching\x20existing\x20data...','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<file_path>\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20specific\x20segment\x20file','changed','connection','20VOTUSZ','Changes\x20to\x20journey:','⚠\x20Journey\x20deletion\x20not\x20yet\x20implemented:\x20','New\x20journey:','versionNumber','Parent\x20segment:\x20','activations','file','unchanged','\x20to\x20delete','\x20deleted','\x20\x20🗺️\x20\x20Journeys:','\x20\x20\x20\x20','/app/ps/','execute','user','\x20\x20Source:\x20','\x20YAML\x20files\x20found','parentSegment','toUpdate','audienceId','created','Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','\x20\x20Activations:','\x20new','journeyBundleName','createdSegmentIds','\x20updated','isNew','Error:\x20','segments','\x20to\x20create','new','state','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','7VoproR','description','dryRun','journeys','cwd','\x20to\x20update','type','scopedFolderPath','segment:push','list','createdAt','journey','\x20\x20📊\x20Segments:','folderId','toString','Source\x20directory:\x20','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','1754iQXxRw','site','\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20push\x20<parent_name>\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20segments\x20to\x20parent','📁\x20','red','get','\x0a✔\x20Push\x20complete','77yYsqKO','Site:\x20','attributes','set','Aborted.','✔\x20All\x20segments,\x20journeys,\x20and\x20activations\x20are\x20up\x20to\x20date','existingSegment','yellow','resolveParentId','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)','length','errorCode','\x20created','nameToId','Delete\x20journey:','\x20on\x20server\x20not\x20in\x20YAML\x20(use\x20--delete\x20to\x20remove)','\x0aError:','/j/da/je','4wAocUN','58gADUFX','\x0aValidation\x20failed:','\x20activations]','name','folders','getOutputSchemaWithCache','helpText','no_parent','\x20\x20Journeys:\x20','\x27...','all','data','error','dim','green','yamlConfig','delete','segmentFolderId','buildUserMaps','cyan','Delete\x20segment:','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','updatedAt','updated','Folders\x20to\x20create:','blue','1368984EEQXlJ','folderPath','verbose','map','targetDir','repeat','then','Resolving\x20parent\x20segment\x20\x27','/sb/da/esr','add','.yaml','(Journey\x20will\x20be\x20deleted)','diff','\x20changes?','Changes\x20to:','parentName','segment','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','toCreate','existingJourney','✔\x20All\x20journeys\x20are\x20up\x20to\x20date','New\x20segment:','segment\x20or\x20journey'];a41_0x468e=function(){return _0x411737;};return a41_0x468e();}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 a41_0xa86921 from'chalk';import{existsSync}from'fs';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import{resolveTarget,isSuccessfulResolution,getScopedDetails}from'../sdk/segment/target-resolution.js';import{buildFolderMaps}from'../sdk/segment/resolution-context.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';function a41_0x2eed(_0x1ac48a,_0x4e40e1){_0x1ac48a=_0x1ac48a-0xa4;const _0x468e9f=a41_0x468e();let _0x2eeda8=_0x468e9f[_0x1ac48a];return _0x2eeda8;}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{[a41_0x170762(0x111)]=a41_0x170762(0xeb);[a41_0x170762(0xe4)]='Push\x20YAML\x20files\x20to\x20Treasure\x20Data\x20as\x20child\x20segments';async[a41_0x170762(0xce)](_0x3faa59){const _0x20a92e=a41_0x170762,{options:_0x39ce9b,args:_0x5c9165,tdx:_0x39f2a3}=_0x3faa59,_0x2576a5=_0x39ce9b,_0x1c29f7=await resolveTarget({'arg':_0x5c9165[0x0],'contextParent':_0x39ce9b[_0x20a92e(0xd2)],'cwd':process[_0x20a92e(0xe7)]()});if(!isSuccessfulResolution(_0x1c29f7))return _0x1c29f7[_0x20a92e(0x106)]===_0x20a92e(0x115)?(console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x102)](_0x20a92e(0x139))),console[_0x20a92e(0x11a)](_0x20a92e(0x104)),console[_0x20a92e(0x11a)](_0x20a92e(0xf6)),console[_0x20a92e(0x11a)](_0x20a92e(0xbd))):(console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0xdd)+_0x1c29f7['message']+'\x0a')),_0x1c29f7[_0x20a92e(0x114)]&&console['error'](a41_0xa86921['cyan'](_0x1c29f7[_0x20a92e(0x114)]))),0x1;if(_0x1c29f7[_0x20a92e(0xe9)]==='parent_name')return console[_0x20a92e(0x11a)](a41_0xa86921['red'](_0x20a92e(0xb9)+_0x1c29f7[_0x20a92e(0x12c)]+'\x0a')),console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x121)](_0x20a92e(0xd6))),0x1;const _0x15a6f6=_0x1c29f7[_0x20a92e(0x137)],_0x50a937=_0x1c29f7[_0x20a92e(0x12c)],_0x129a18=_0x1c29f7[_0x20a92e(0xe9)]===_0x20a92e(0xc7)?_0x1c29f7['filePath']:undefined,_0x2f6244=getScopedDetails(_0x1c29f7),_0x36669d=_0x2f6244?.['isScoped']??![],_0x5d4707=_0x2f6244?.[_0x20a92e(0xea)]??'';if(!existsSync(_0x50a937))return console['error'](a41_0xa86921['red'](_0x20a92e(0xb9)+_0x50a937+'\x0a')),console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x121)](_0x20a92e(0xd6))),0x1;_0x2576a5[_0x20a92e(0x12a)]&&(console[_0x20a92e(0x11a)](_0x20a92e(0xfc)+_0x2576a5[_0x20a92e(0xf5)]),console[_0x20a92e(0x11a)](_0x20a92e(0xc5)+_0x15a6f6),console[_0x20a92e(0x11a)](_0x20a92e(0xf2)+_0x50a937),_0x36669d&&console[_0x20a92e(0x11a)]('Scoped\x20to\x20folder:\x20'+_0x5d4707));const _0x596f9e=await withSpinner(_0x20a92e(0x12f)+_0x15a6f6+_0x20a92e(0x117),()=>_0x39f2a3[_0x20a92e(0x138)][_0x20a92e(0x103)](_0x15a6f6),{'verbose':_0x2576a5[_0x20a92e(0x12a)]}),_0x34f929=_0x596f9e['data'],{parentSegmentResult:_0x3ad18a,segmentsResult:_0xe3296d,foldersResult:_0x1a0964,journeysWithDetailsResult:_0x10a5c3,userMaps:_0x2b753f}=await withSpinner(_0x20a92e(0xbc),async()=>{const _0xde39e3=_0x20a92e,[_0x40b907,_0x339163,_0x3899a7,_0x43fbb6,_0xf59843]=await Promise['all']([_0x39f2a3[_0xde39e3(0x138)]['getParent'](_0x34f929),_0x39f2a3[_0xde39e3(0x138)][_0xde39e3(0xb2)](_0x34f929),_0x39f2a3['segment']['listFolders'](_0x34f929),_0x39f2a3['journey'][_0xde39e3(0xae)](_0x34f929,{'includeAllVersions':!![]}),_0x39f2a3[_0xde39e3(0xcf)][_0xde39e3(0x120)]()]);return{'parentSegmentResult':_0x40b907,'segmentsResult':_0x339163,'foldersResult':_0x3899a7,'journeysWithDetailsResult':_0x43fbb6,'userMaps':_0xf59843};},{'verbose':_0x2576a5['verbose']})[_0x20a92e(0x12e)](_0x1ce3d0=>_0x1ce3d0[_0x20a92e(0x119)]),_0x48ec0c=_0x3ad18a,_0x248db2=extractRootFolderId(_0x48ec0c),_0x24213c=_0xe3296d,_0x20c0ba=_0x1a0964,{journeys:_0x30ceb0,activationStepsById:_0x4fc117}=_0x10a5c3,_0x23f5fe=new Map(_0x30ceb0[_0x20a92e(0x12b)](_0x2ee12e=>[_0x2ee12e['id'],_0x2ee12e])),_0x4ab426=_0x30ceb0[_0x20a92e(0x12b)](_0x35f043=>({'id':_0x35f043['id'],'name':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0x111)],'journeyBundleName':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xd9)]||'','journeyBundleId':_0x35f043['attributes'][_0x20a92e(0xa7)]||'','versionNumber':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xc4)],'description':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xe4)],'state':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xe1)],'paused':_0x35f043['attributes']['paused'],'audienceId':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xd4)],'folderId':_0x35f043[_0x20a92e(0x140)]?.['parentFolder']?.[_0x20a92e(0x119)]?.['id'],'createdAt':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0xed)],'updatedAt':_0x35f043[_0x20a92e(0xfd)][_0x20a92e(0x124)]})),{emailToId:_0x3083a7,idToEmail:_0x59e9bd}=_0x2b753f,_0x539783=await withSpinner('Fetching\x20connections\x20for\x20name\x20resolution...',async()=>{const _0x2714a2=_0x20a92e,_0x302b2e=await _0x39f2a3['connection'][_0x2714a2(0xec)]();return buildConnectionMaps(_0x302b2e);},{'verbose':_0x2576a5['verbose']})[_0x20a92e(0x12e)](_0x4010db=>_0x4010db[_0x20a92e(0x119)]),_0x1b6863=_0x539783[_0x20a92e(0x108)],_0xe05861=_0x539783[_0x20a92e(0xa6)],_0x23e937=_0x539783['nameToType'],_0x2313a0={'emailToIdMap':_0x3083a7,'connectionNameToIdMap':_0x1b6863,'connectionNameToTypeMap':_0x23e937,'getSchema':_0x1cbcc0=>_0x39f2a3[_0x20a92e(0xbf)][_0x20a92e(0x113)](_0x1cbcc0)};let {pathToId:_0x2106fd,idToPath:_0x42645e}=buildFolderMaps(_0x20c0ba);const _0x26323a=buildSegmentLookupMap(_0x24213c,_0x42645e),_0xcc8bdc=buildSegmentNameToIdMap(_0x24213c),_0x2ea2d5=buildJourneyBundleLookupMap(_0x4ab426,_0x42645e);let _0x3fa807;if(_0x129a18){if(!_0x129a18['endsWith']('.yml')&&!_0x129a18[_0x20a92e(0xaa)](_0x20a92e(0x132)))return console['error'](a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0xf3)+_0x129a18+'\x0a')),0x1;_0x3fa807=[_0x129a18];}else _0x3fa807=findYamlFiles(_0x50a937);if(_0x3fa807[_0x20a92e(0x105)]===0x0)return console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0xe2)+_0x50a937+'\x0a')),console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x121)](_0x20a92e(0x141))),0x1;let _0x370788,_0x113645;try{const _0x1e4be1=parseAndClassifyYamlFiles(_0x3fa807,_0x50a937,{'skipSegments':_0x2576a5['journeysOnly']});_0x370788=_0x1e4be1['segments'],_0x113645=_0x1e4be1['journeys'];const _0x50607e=validateParsedFiles(_0x1e4be1,_0x50a937);if(_0x50607e[_0x20a92e(0x105)]>0x0)return console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0x10f))),console['error'](formatValidationErrors(_0x50607e)),console['error'](a41_0xa86921[_0x20a92e(0x102)](_0x20a92e(0xb7))),0x1;}catch(_0x2f8ffc){return console['error'](a41_0xa86921['red']('Error\x20parsing\x20YAML:\x20'+(_0x2f8ffc instanceof Error?_0x2f8ffc['message']:_0x2f8ffc))),0x1;}if(_0x370788[_0x20a92e(0x105)]===0x0&&_0x113645[_0x20a92e(0x105)]===0x0){const _0x59e356=_0x2576a5[_0x20a92e(0xb8)]?_0x20a92e(0xee):_0x20a92e(0x13e);return console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x102)]('No\x20'+_0x59e356+_0x20a92e(0xd1))),0x0;}const _0x25a117=new Map();_0x24213c[_0x20a92e(0x105)]>0x0&&!_0x2576a5['journeysOnly']&&await withSpinner(_0x20a92e(0xa8),async()=>{await batchAsync(_0x24213c,async _0x5b2ad6=>{const _0x3adce8=a41_0x2eed,_0x54d73a=await _0x39f2a3[_0x3adce8(0x138)][_0x3adce8(0xb0)](_0x34f929,_0x5b2ad6['id']);_0x25a117[_0x3adce8(0xfe)](_0x5b2ad6['id'],_0x54d73a);});},{'verbose':_0x2576a5['verbose']});const {segmentFiles:_0x498294,foldersToCreate:_0x563a7b}=await prepareSegmentFiles(_0x370788,{'segmentByFolderAndName':_0x26323a,'activationsBySegmentId':_0x25a117,'folderPathToId':_0x2106fd,'idToEmailMap':_0x59e9bd,'connectionIdToNameMap':_0xe05861},_0x2313a0,_0x36669d,_0x5d4707),_0x531c69=_0x129a18?[]:findSegmentsToDelete(_0x24213c,_0x370788['map'](({yamlConfig:_0x372192,folderPath:_0x31eea2})=>({'yamlConfig':_0x372192,'folderPath':resolveTDFolderPath(_0x31eea2,_0x36669d,_0x5d4707)})),_0x42645e,_0x5d4707,_0x36669d),{journeyFiles:_0x536b95,foldersToCreate:_0x20d331}=await withProgressSpinner('Preparing\x20journeys...',async _0x4a7346=>prepareJourneyFiles(_0x113645,{'fetchJourney':async _0x1aeb15=>_0x39f2a3[_0x20a92e(0xee)]['getJourney'](_0x1aeb15['journeyId']),'journeyBundlesByFolderAndName':_0x2ea2d5,'folderPathToId':_0x2106fd,'idToEmailMap':_0x59e9bd,'connectionIdToNameMap':_0xe05861,'existingSegments':_0x24213c,'parentId':_0x34f929,'deps':_0x39f2a3,'progress':{'update':_0x4c3d00=>{const _0x1d6319=_0x20a92e;_0x4a7346['setPhase'](_0x4c3d00),_0x2576a5[_0x1d6319(0x12a)]&&console[_0x1d6319(0x11a)]('\x20\x20'+_0x4c3d00);}},'journeyById':_0x23f5fe,'activationStepsById':_0x4fc117},_0x36669d,_0x5d4707),{'verbose':_0x2576a5['verbose']})['then'](_0x57e10e=>_0x57e10e['data']);for(const _0x5b11f6 of _0x20d331){_0x563a7b[_0x20a92e(0x131)](_0x5b11f6);}const _0x1e3f06=_0x129a18?[]:findJourneysToDelete(_0x4ab426,_0x113645['map'](({yamlConfig:_0x551aca,folderPath:_0xa26c83})=>({'yamlConfig':_0x551aca,'folderPath':resolveTDFolderPath(_0xa26c83,_0x36669d,_0x5d4707)})),_0x42645e,_0x5d4707,_0x36669d),_0x250e6d=calculatePushStats(_0x498294,_0x536b95,_0x563a7b,_0x531c69,_0x1e3f06,!!_0x2576a5[_0x20a92e(0x11e)],!!_0x2576a5[_0x20a92e(0xb8)]),_0x4eb888=_0x250e6d[_0x20a92e(0xde)][_0x20a92e(0xe0)],_0x4f61b8=_0x250e6d[_0x20a92e(0xde)]['changed'],_0x5ac259=_0x250e6d['segments'][_0x20a92e(0xc8)],_0x2ef162=_0x250e6d[_0x20a92e(0xde)][_0x20a92e(0xbb)],_0x3e9013=_0x250e6d[_0x20a92e(0x112)][_0x20a92e(0x13a)],_0x27991c=_0x250e6d['journeys']['new'],_0x41e018=_0x250e6d[_0x20a92e(0xe6)][_0x20a92e(0xbe)],_0x1ff910=_0x250e6d[_0x20a92e(0xe6)][_0x20a92e(0xc8)],_0x219779=_0x250e6d[_0x20a92e(0xe6)]['toDelete'],_0x2d0552=_0x250e6d[_0x20a92e(0xc6)][_0x20a92e(0x118)],_0x421161=_0x250e6d[_0x20a92e(0xc6)][_0x20a92e(0x13a)],_0x4541d4=_0x250e6d[_0x20a92e(0xc6)][_0x20a92e(0xd3)],_0x28eb54=_0x250e6d['activations'][_0x20a92e(0xbb)];console['error'](_0x20a92e(0xa4)+_0x15a6f6+'\x27:');_0x3e9013[_0x20a92e(0x105)]>0x0&&console[_0x20a92e(0x11a)]('\x20\x20'+a41_0xa86921[_0x20a92e(0x127)](_0x20a92e(0xf7)+_0x3e9013[_0x20a92e(0x105)]+_0x20a92e(0xb6)));if(!_0x2576a5['journeysOnly']){console[_0x20a92e(0x11a)](_0x20a92e(0xef)),console['error']('\x20\x20\x20\x20'+a41_0xa86921[_0x20a92e(0x11c)]('+\x20'+_0x4eb888['length']+_0x20a92e(0xd8))),console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0x102)]('~\x20'+_0x4f61b8[_0x20a92e(0x105)]+_0x20a92e(0xba)));if(_0x2ef162['length']>0x0)console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0xf8)]('-\x20'+_0x2ef162[_0x20a92e(0x105)]+'\x20to\x20delete'));else _0x531c69[_0x20a92e(0x105)]>0x0&&!_0x2576a5[_0x20a92e(0x11e)]&&console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0x11b)](_0x531c69[_0x20a92e(0x105)]+_0x20a92e(0x10a)));console[_0x20a92e(0x11a)]('\x20\x20\x20\x20'+a41_0xa86921[_0x20a92e(0x11b)]('=\x20'+_0x5ac259[_0x20a92e(0x105)]+'\x20unchanged'));}if(_0x536b95[_0x20a92e(0x105)]>0x0||_0x1e3f06[_0x20a92e(0x105)]>0x0){console['error'](_0x20a92e(0xcb)),console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0x11c)]('+\x20'+_0x27991c['length']+_0x20a92e(0xd8))),console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0x102)]('~\x20'+_0x41e018[_0x20a92e(0x105)]+_0x20a92e(0xba)));if(_0x219779[_0x20a92e(0x105)]>0x0)console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0xf8)]('-\x20'+_0x219779[_0x20a92e(0x105)]+_0x20a92e(0xc9)));else _0x1e3f06[_0x20a92e(0x105)]>0x0&&!_0x2576a5[_0x20a92e(0x11e)]&&console[_0x20a92e(0x11a)]('\x20\x20\x20\x20'+a41_0xa86921[_0x20a92e(0x11b)](_0x1e3f06['length']+_0x20a92e(0x10a)));console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921[_0x20a92e(0x11b)]('=\x20'+_0x1ff910[_0x20a92e(0x105)]+_0x20a92e(0xaf)));}_0x2d0552['length']>0x0&&!_0x2576a5[_0x20a92e(0xb8)]&&(console['error'](''),console[_0x20a92e(0x11a)](_0x20a92e(0xd7)),_0x421161[_0x20a92e(0x105)]>0x0&&console['error'](_0x20a92e(0xcc)+a41_0xa86921['green']('+\x20'+_0x421161[_0x20a92e(0x105)]+_0x20a92e(0xdf))),_0x4541d4['length']>0x0&&console[_0x20a92e(0x11a)]('\x20\x20\x20\x20'+a41_0xa86921[_0x20a92e(0x102)]('~\x20'+_0x4541d4['length']+_0x20a92e(0xe8))),_0x28eb54['length']>0x0&&console[_0x20a92e(0x11a)](_0x20a92e(0xcc)+a41_0xa86921['red']('-\x20'+_0x28eb54['length']+_0x20a92e(0xc9))));console[_0x20a92e(0x11a)](_0x20a92e(0xd0)+a41_0xa86921['cyan'](_0x50a937)+'\x0a');if(_0x3e9013[_0x20a92e(0x105)]>0x0){console[_0x20a92e(0x11a)](_0x20a92e(0x126));for(const _0x2763b0 of _0x3e9013){console[_0x20a92e(0x11a)]('\x20\x20'+a41_0xa86921['blue']('+')+'\x20'+_0x2763b0);}console[_0x20a92e(0x11a)]('');}if(_0x4eb888['length']>0x0&&!_0x2576a5['journeysOnly'])for(const _0x4553b6 of _0x4eb888){const _0x89ce2c=_0x4553b6[_0x20a92e(0x129)]?_0x4553b6[_0x20a92e(0x129)]+'/'+_0x4553b6[_0x20a92e(0x11d)][_0x20a92e(0x111)]:_0x4553b6[_0x20a92e(0x11d)][_0x20a92e(0x111)],_0x46e979=_0x4553b6[_0x20a92e(0x11d)][_0x20a92e(0xc6)]?.[_0x20a92e(0x105)]||0x0,_0x140bbf=_0x46e979>0x0?a41_0xa86921['dim']('\x20['+_0x46e979+_0x20a92e(0x110)):'';console['error']('\x0a'+a41_0xa86921['green'](_0x20a92e(0x13d))+'\x20'+_0x89ce2c+_0x140bbf),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c)),_0x4553b6[_0x20a92e(0x134)]&&console['error'](_0x4553b6[_0x20a92e(0x134)]),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c));}if(_0x2ef162[_0x20a92e(0x105)]>0x0&&!_0x2576a5[_0x20a92e(0xb8)])for(const _0x50f483 of _0x2ef162){const _0x3d301e=_0x50f483['segmentFolderId']?_0x42645e[_0x20a92e(0xf9)](_0x50f483[_0x20a92e(0x11f)][_0x20a92e(0xf1)]())||'':'',_0x5077e8=_0x3d301e?_0x3d301e+'/'+_0x50f483[_0x20a92e(0x111)]:_0x50f483[_0x20a92e(0x111)],_0x173f81=_0x25a117[_0x20a92e(0xf9)](_0x50f483['id'])||[],_0x3931cb=_0x173f81[_0x20a92e(0x105)]>0x0?a41_0xa86921[_0x20a92e(0x11b)]('\x20['+_0x173f81[_0x20a92e(0x105)]+_0x20a92e(0x110)):'';console[_0x20a92e(0x11a)]('\x0a'+a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0x122))+'\x20'+_0x5077e8+_0x3931cb),console[_0x20a92e(0x11a)]('─'['repeat'](0x3c));const _0x34544c=segmentWithActivationsToYaml(_0x50f483,_0x173f81,undefined,_0x59e9bd,_0xe05861),_0x598b51=segmentToYamlString(_0x34544c),_0x2870c7=generateDiff(_0x598b51,'');console[_0x20a92e(0x11a)](formatDiffWithColors(_0x2870c7)),console['error']('─'['repeat'](0x3c));}const _0x3360d3=_0x498294['filter'](_0x2270ae=>!_0x2270ae[_0x20a92e(0xdc)]&&_0x2270ae[_0x20a92e(0x134)]);if(_0x3360d3[_0x20a92e(0x105)]>0x0&&!_0x2576a5['journeysOnly'])for(const _0x95fc22 of _0x3360d3){const _0x289b7c=_0x95fc22[_0x20a92e(0x129)]?_0x95fc22[_0x20a92e(0x129)]+'/'+_0x95fc22[_0x20a92e(0x11d)]['name']:_0x95fc22[_0x20a92e(0x11d)]['name'];console[_0x20a92e(0x11a)]('\x0a'+a41_0xa86921['yellow'](_0x20a92e(0x136))+'\x20'+_0x289b7c),console['error']('─'['repeat'](0x3c)),console[_0x20a92e(0x11a)](_0x95fc22['diff']),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c));}if(_0x27991c[_0x20a92e(0x105)]>0x0)for(const _0xdae3e6 of _0x27991c){const _0x2b07d9=_0xdae3e6[_0x20a92e(0x129)]?_0xdae3e6[_0x20a92e(0x129)]+'/'+_0xdae3e6[_0x20a92e(0x11d)][_0x20a92e(0x111)]:_0xdae3e6[_0x20a92e(0x11d)][_0x20a92e(0x111)];console[_0x20a92e(0x11a)]('\x0a'+a41_0xa86921[_0x20a92e(0x11c)](_0x20a92e(0xc3))+'\x20'+_0x2b07d9),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c)),_0xdae3e6['diff']&&console['error'](_0xdae3e6[_0x20a92e(0x134)]),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c));}const _0x323283=_0x536b95[_0x20a92e(0xad)](_0x5bd983=>!_0x5bd983[_0x20a92e(0xdc)]&&_0x5bd983['diff']);if(_0x323283[_0x20a92e(0x105)]>0x0)for(const _0x4e9dcd of _0x323283){const _0x94d0cf=_0x4e9dcd[_0x20a92e(0x129)]?_0x4e9dcd[_0x20a92e(0x129)]+'/'+_0x4e9dcd['yamlConfig'][_0x20a92e(0x111)]:_0x4e9dcd[_0x20a92e(0x11d)][_0x20a92e(0x111)];console[_0x20a92e(0x11a)]('\x0a'+a41_0xa86921[_0x20a92e(0x102)](_0x20a92e(0xc1))+'\x20'+_0x94d0cf),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c)),console[_0x20a92e(0x11a)](_0x4e9dcd[_0x20a92e(0x134)]),console['error']('─'[_0x20a92e(0x12d)](0x3c));}if(_0x219779[_0x20a92e(0x105)]>0x0)for(const _0x4c93dc of _0x219779){const _0x5ba159=_0x4c93dc[_0x20a92e(0xf0)]?_0x42645e[_0x20a92e(0xf9)](_0x4c93dc[_0x20a92e(0xf0)])||'':'',_0x3c2c56=_0x5ba159?_0x5ba159+'/'+_0x4c93dc[_0x20a92e(0xd9)]:_0x4c93dc[_0x20a92e(0xd9)];console[_0x20a92e(0x11a)]('\x0a'+a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0x109))+'\x20'+_0x3c2c56),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c)),console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0xf8)](_0x20a92e(0x133))),console[_0x20a92e(0x11a)]('─'[_0x20a92e(0x12d)](0x3c));}if(_0x2576a5[_0x20a92e(0xe5)])return console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x102)]('\x0a[Dry\x20run]\x20No\x20changes\x20were\x20made')),0x0;const _0x37ea67=_0x2576a5[_0x20a92e(0xb8)]?![]:_0x4eb888[_0x20a92e(0x105)]>0x0||_0x4f61b8[_0x20a92e(0x105)]>0x0||_0x2ef162[_0x20a92e(0x105)]>0x0,_0x51b26b=_0x27991c['length']>0x0||_0x41e018[_0x20a92e(0x105)]>0x0||_0x219779[_0x20a92e(0x105)]>0x0,_0x5c383b=_0x2576a5['journeysOnly']?![]:_0x2d0552['length']>0x0,_0x2d17c7=_0x3e9013['length']>0x0;if(!_0x37ea67&&!_0x51b26b&&!_0x5c383b&&!_0x2d17c7){const _0x200c71=_0x2576a5[_0x20a92e(0xb8)]?_0x20a92e(0x13c):_0x20a92e(0x100);console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x11c)](_0x200c71));if(_0x129a18&&_0x5ac259[_0x20a92e(0x105)]===0x1){const _0x4b9e62=_0x5ac259[0x0];if(_0x4b9e62[_0x20a92e(0x101)]?.['id']){const _0x43dbb0=getConsoleNextUrl(_0x2576a5['site'],_0x20a92e(0xcd)+_0x34f929+'/e/'+_0x4b9e62['existingSegment']['id']+_0x20a92e(0x130));console[_0x20a92e(0x11a)]('\x20\x20Console\x20URL\x20(share\x20with\x20client):\x20'+a41_0xa86921['cyan'](_0x43dbb0));}}if(_0x129a18&&_0x1ff910[_0x20a92e(0x105)]===0x1){const _0x59e499=_0x1ff910[0x0];if(_0x59e499['existingJourney']?.['id']){const _0x2b1caa=getConsoleNextUrl(_0x2576a5[_0x20a92e(0xf5)],_0x20a92e(0xcd)+_0x34f929+_0x20a92e(0xa5)+_0x59e499[_0x20a92e(0x13b)]['id']+_0x20a92e(0x10c));console[_0x20a92e(0x11a)]('\x20\x20'+a41_0xa86921[_0x20a92e(0x121)](_0x2b1caa));}}return 0x0;}const _0x43c25f=_0x2576a5[_0x20a92e(0xb8)]?_0x27991c[_0x20a92e(0x105)]+_0x41e018[_0x20a92e(0x105)]+_0x219779['length']+_0x3e9013['length']:_0x4eb888[_0x20a92e(0x105)]+_0x4f61b8[_0x20a92e(0x105)]+_0x2ef162['length']+_0x27991c[_0x20a92e(0x105)]+_0x41e018[_0x20a92e(0x105)]+_0x219779['length']+_0x3e9013[_0x20a92e(0x105)]+_0x2d0552[_0x20a92e(0x105)];if(!_0x2576a5['yes']&&_0x43c25f>0x0){if(!isInteractive())return console['error'](a41_0xa86921['red'](_0x20a92e(0x10b)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x11b)](_0x20a92e(0x123))),0x1;const _0x163781=await confirmKey(_0x20a92e(0xb1)+_0x43c25f+_0x20a92e(0x135));if(!_0x163781)return console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x102)](_0x20a92e(0xff))),0x1;}const _0x3042a1={'withProgress':async(_0x575414,_0x104579)=>{const _0x3a7a0d=_0x20a92e,_0x4ad2c9=await withSpinner(_0x575414,_0x104579,{'verbose':_0x2576a5[_0x3a7a0d(0x12a)]});return{'data':_0x4ad2c9[_0x3a7a0d(0x119)]};},'logInfo':_0x198a3e=>console[_0x20a92e(0x11a)](a41_0xa86921['blue']('✔\x20'+_0x198a3e)),'logSuccess':_0x2434e0=>console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x11c)]('✔\x20'+_0x2434e0)),'logWarning':_0x41be2c=>console[_0x20a92e(0x11a)](a41_0xa86921[_0x20a92e(0x102)]('⚠\x20'+_0x41be2c)),'logDeleted':_0x40d52e=>console['error'](a41_0xa86921[_0x20a92e(0xf8)]('✔\x20'+_0x40d52e))},_0x2b2946={'segment':_0x39f2a3[_0x20a92e(0x138)],'journey':_0x39f2a3[_0x20a92e(0xee)],'user':_0x39f2a3[_0x20a92e(0xcf)],'connection':_0x39f2a3[_0x20a92e(0xbf)]};_0x3e9013['length']>0x0&&(_0x2106fd=await executePushFolders(_0x2b2946,_0x3e9013,_0x2106fd,{'parentId':_0x34f929},_0x3042a1));const _0xc8ad08={'rootFolderId':_0x248db2,'folderPathToId':_0x2106fd,'folderIdToPath':_0x42645e,'segmentNameToId':_0xcc8bdc,'activationsBySegmentId':_0x25a117,'emailToIdMap':_0x3083a7,'idToEmailMap':_0x59e9bd,'connectionNameToIdMap':_0x539783['nameToId'],'connectionIdToNameMap':_0x539783[_0x20a92e(0xa6)],'connectionNameToTypeMap':_0x23e937},_0x350293=await executePushSegments(_0x2b2946,_0x2576a5[_0x20a92e(0xb8)]?[]:_0x498294,_0xc8ad08,{'parentId':_0x34f929},_0x3042a1),_0x2223ab=_0x350293[_0x20a92e(0xd5)],_0x144669=_0x350293[_0x20a92e(0x125)],_0x486754=_0x350293['activations'][_0x20a92e(0xd5)],_0x13497a=_0x350293[_0x20a92e(0xc6)][_0x20a92e(0x125)],_0x417f33=_0x350293[_0x20a92e(0xc6)]['deleted'];let _0x57ea65;if(_0x129a18&&_0x498294[_0x20a92e(0x105)]===0x1){const _0x4b4bce=_0x498294[0x0];_0x57ea65=_0x4b4bce[_0x20a92e(0x101)]?.['id']??_0x350293['createdSegmentIds'][_0x20a92e(0xf9)](_0x4b4bce['yamlConfig'][_0x20a92e(0x111)]);}const _0x144df3=await executePushSegmentDeletions(_0x2b2946,_0x2576a5[_0x20a92e(0xb8)]?[]:_0x2ef162,_0x3042a1);let _0xa060cb=0x0,_0x5ec5a5=0x0,_0x552882=0x0;const _0x5da5e2=new Map(_0xcc8bdc);for(const [_0x4d61be,_0x401fcc]of _0x350293[_0x20a92e(0xda)]){_0x5da5e2[_0x20a92e(0xfe)](_0x4d61be,_0x401fcc);}if(_0x536b95['length']>0x0){const _0x19ff28={..._0xc8ad08,'segmentNameToId':_0x5da5e2,'existingSegments':_0x24213c,'activationContext':_0x2313a0},_0x23c2d0=await executePushJourneys(_0x2b2946,_0x536b95,_0x19ff28,{'parentId':_0x34f929,'rootFolderId':_0x248db2,'verbose':_0x2576a5[_0x20a92e(0x12a)]},_0x3042a1);_0xa060cb=_0x23c2d0['created'],_0x5ec5a5=_0x23c2d0[_0x20a92e(0x125)];if(_0x129a18&&_0x23c2d0[_0x20a92e(0xab)][_0x20a92e(0x105)]===0x1){const _0x40e500=_0x23c2d0[_0x20a92e(0xab)][0x0];if(_0x40e500[_0x20a92e(0x144)]){const _0x2f6dce=getConsoleNextUrl(_0x2576a5[_0x20a92e(0xf5)],_0x20a92e(0xcd)+_0x34f929+'/e/'+_0x40e500[_0x20a92e(0x144)]+_0x20a92e(0x10c));console[_0x20a92e(0x11a)]('\x20\x20'+a41_0xa86921[_0x20a92e(0x121)](_0x2f6dce));}}}for(const _0x2d8284 of _0x219779){console['error'](a41_0xa86921[_0x20a92e(0x102)](_0x20a92e(0xc2)+_0x2d8284[_0x20a92e(0xd9)])),_0x552882++;}const _0x31ec9a=[];if(_0x2223ab>0x0)_0x31ec9a[_0x20a92e(0x13f)](_0x2223ab+_0x20a92e(0x107));if(_0x144669>0x0)_0x31ec9a[_0x20a92e(0x13f)](_0x144669+_0x20a92e(0xdb));if(_0x144df3>0x0)_0x31ec9a[_0x20a92e(0x13f)](_0x144df3+'\x20deleted');const _0x3c8a43=[];if(_0xa060cb>0x0)_0x3c8a43[_0x20a92e(0x13f)](_0xa060cb+_0x20a92e(0x107));if(_0x5ec5a5>0x0)_0x3c8a43[_0x20a92e(0x13f)](_0x5ec5a5+'\x20updated');if(_0x552882>0x0)_0x3c8a43['push'](_0x552882+_0x20a92e(0xca));const _0x5b94d=[];if(_0x486754>0x0)_0x5b94d[_0x20a92e(0x13f)](_0x486754+_0x20a92e(0x107));if(_0x13497a>0x0)_0x5b94d[_0x20a92e(0x13f)](_0x13497a+'\x20updated');if(_0x417f33>0x0)_0x5b94d[_0x20a92e(0x13f)](_0x417f33+_0x20a92e(0xca));console['error'](a41_0xa86921[_0x20a92e(0x11c)](_0x20a92e(0xfa)));_0x31ec9a[_0x20a92e(0x105)]>0x0&&!_0x2576a5['journeysOnly']&&console[_0x20a92e(0x11a)]('\x20\x20Segments:\x20'+_0x31ec9a[_0x20a92e(0xac)](',\x20'));_0x3c8a43[_0x20a92e(0x105)]>0x0&&console['error'](_0x20a92e(0x116)+_0x3c8a43['join'](',\x20'));_0x5b94d[_0x20a92e(0x105)]>0x0&&!_0x2576a5[_0x20a92e(0xb8)]&&console[_0x20a92e(0x11a)]('\x20\x20Activations:\x20'+_0x5b94d[_0x20a92e(0xac)](',\x20'));if(_0x57ea65){const _0x1bfff0=getConsoleNextUrl(_0x2576a5[_0x20a92e(0xf5)],_0x20a92e(0xcd)+_0x34f929+_0x20a92e(0xa5)+_0x57ea65+_0x20a92e(0x130));console[_0x20a92e(0x11a)](_0x20a92e(0xb5)+a41_0xa86921[_0x20a92e(0x121)](_0x1bfff0));}return 0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
const a42_0x205eca=a42_0xde6f;(function(_0x554ecc,_0x798ab3){const _0x2b1155=a42_0xde6f,_0x5d7e98=_0x554ecc();while(!![]){try{const _0xcdd25b=parseInt(_0x2b1155(0x8d))/0x1+-parseInt(_0x2b1155(0xab))/0x2+parseInt(_0x2b1155(0xa4))/0x3*(-parseInt(_0x2b1155(0x93))/0x4)+-parseInt(_0x2b1155(0xa6))/0x5+parseInt(_0x2b1155(0x98))/0x6+parseInt(_0x2b1155(0xa2))/0x7+parseInt(_0x2b1155(0x8f))/0x8;if(_0xcdd25b===_0x798ab3)break;else _0x5d7e98['push'](_0x5d7e98['shift']());}catch(_0x538c86){_0x5d7e98['push'](_0x5d7e98['shift']());}}}(a42_0x4956,0xc6036));function a42_0xde6f(_0x3a869d,_0x39dafe){_0x3a869d=_0x3a869d-0x89;const _0x4956ed=a42_0x4956();let _0xde6fb3=_0x4956ed[_0x3a869d];return _0xde6fb3;}import{BaseCommand}from'./command.js';function a42_0x4956(){const _0x4a7a49=['Examples:','name','segment:update','1247386nnpGsO','Resolved\x20folder\x20ID:\x20','15832760Qtmyny','ruleFile','rule','verbose','68SVjaEO','\x27...','parentId','\x20\x20Use\x20`tdx\x20sg\x20push`\x20with\x20YAML\x20files\x20instead.\x0a','Updating\x20segment\x20\x27','1392690uUBwkx','⚠\x20Deprecation\x20warning:\x20`segment\x20update`\x20is\x20deprecated.','segmentId','Resolving\x20path\x20\x27','Segment\x20ID:\x20','updateSegmentById','segmentPath','error','.\x20Only\x20child\x20segments\x20can\x20be\x20updated.','\x20\x20tdx\x20segment\x20update\x20\x22High\x20Value\x22\x20--rule\x20\x27...\x27\x20\x20#\x20Relative\x20to\x20context','2027725YgNGGm','type','227049PqQfvs','segment','3708380znHogn','✔\x20Updated\x20segment\x20\x27','Resolving\x20folder\x20\x27','Parent\x20ID:\x20','folder','1817844UtYWtO','kind','data','yellow','Usage:\x20tdx\x20segment\x20update\x20<path>\x20[options]'];a42_0x4956=function(){return _0x4a7a49;};return a42_0x4956();}import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{loadJSONFromOptions}from'../utils/json-loader.js';import{SDKError,ErrorCode}from'../sdk/index.js';import a42_0x241bfe from'chalk';export class SegmentUpdateCommand extends BaseCommand{[a42_0x205eca(0x8b)]=a42_0x205eca(0x8c);['description']='Update\x20existing\x20child\x20segment';async['execute'](_0x44fb41){const _0x119ad3=a42_0x205eca;console[_0x119ad3(0x9f)](a42_0x241bfe[_0x119ad3(0xae)](_0x119ad3(0x99))),console['error'](a42_0x241bfe[_0x119ad3(0xae)](_0x119ad3(0x96)));const {options:_0x14e5d2,args:_0x4148ae,tdx:_0x490651}=_0x44fb41,_0x12ff4b=_0x14e5d2;if(_0x4148ae['length']===0x0)return console[_0x119ad3(0x9f)]('Error:\x20Segment\x20path\x20or\x20name\x20is\x20required'),console[_0x119ad3(0x9f)](_0x119ad3(0x89)),console[_0x119ad3(0x9f)](_0x119ad3(0x8a)),console['error']('\x20\x20tdx\x20segment\x20update\x20\x22My\x20Audience/High\x20Value\x22\x20--description\x20\x22...\x22'),console[_0x119ad3(0x9f)](_0x119ad3(0xa1)),0x1;const _0x4eb43f=_0x4148ae[0x0],_0x5ece2e=_0x14e5d2[_0x119ad3(0x9e)];let _0x16571a=_0x4eb43f;_0x5ece2e&&!_0x4eb43f['includes']('/')&&(_0x16571a=_0x5ece2e+'/'+_0x4eb43f,_0x12ff4b[_0x119ad3(0x92)]&&console[_0x119ad3(0x9f)]('Resolved\x20relative\x20path\x20to:\x20'+_0x16571a));const _0x163544=await withSpinner(_0x119ad3(0x9b)+_0x16571a+_0x119ad3(0x94),()=>_0x490651[_0x119ad3(0xa5)]['resolvePathToResource'](_0x16571a),{'verbose':_0x12ff4b[_0x119ad3(0x92)]}),_0x2fdb55=_0x163544['data'];_0x12ff4b[_0x119ad3(0x92)]&&console['error']('Resolved\x20type:\x20'+_0x2fdb55['type']);if(_0x2fdb55[_0x119ad3(0xa3)]!==_0x119ad3(0xa5))return console[_0x119ad3(0x9f)]('Error:\x20Cannot\x20update\x20'+_0x2fdb55[_0x119ad3(0xa3)]+_0x119ad3(0xa0)),console[_0x119ad3(0x9f)]('Use:\x20tdx\x20segment\x20update\x20<path_to_segment>\x20[options]'),0x1;if(!_0x2fdb55[_0x119ad3(0x9a)])throw new SDKError(ErrorCode['INTERNAL'],'Segment\x20ID\x20missing\x20from\x20resolved\x20path');const _0x170bef=_0x2fdb55[_0x119ad3(0x95)],_0x3eb2b2=_0x2fdb55[_0x119ad3(0x9a)];_0x12ff4b['verbose']&&(console[_0x119ad3(0x9f)](_0x119ad3(0xa9)+_0x170bef),console[_0x119ad3(0x9f)](_0x119ad3(0x9c)+_0x3eb2b2));let _0x4147d3;if(_0x12ff4b[_0x119ad3(0xaa)]){const _0x51c2d6=_0x12ff4b[_0x119ad3(0xaa)],_0x11b438=await withSpinner(_0x119ad3(0xa8)+_0x51c2d6+'\x27...',()=>_0x490651['segment']['resolveFolderId'](_0x170bef,_0x51c2d6),{'verbose':_0x12ff4b[_0x119ad3(0x92)]});_0x4147d3=parseInt(_0x11b438[_0x119ad3(0xad)],0xa),_0x12ff4b[_0x119ad3(0x92)]&&console[_0x119ad3(0x9f)](_0x119ad3(0x8e)+_0x4147d3);}const _0x5efabf=await loadJSONFromOptions(_0x12ff4b[_0x119ad3(0x91)],_0x12ff4b[_0x119ad3(0x90)]),_0x456133={'name':_0x12ff4b[_0x119ad3(0x8b)],'description':_0x12ff4b['description'],'rule':_0x5efabf,'kind':_0x12ff4b[_0x119ad3(0xac)]!==undefined?parseInt(_0x12ff4b['kind'],0xa):undefined,'segmentFolderId':_0x4147d3},_0x58a2d3=await withSpinner(_0x119ad3(0x97)+_0x2fdb55['segmentName']+_0x119ad3(0x94),()=>_0x490651[_0x119ad3(0xa5)][_0x119ad3(0x9d)](_0x170bef,_0x3eb2b2,_0x456133),{'verbose':_0x12ff4b[_0x119ad3(0x92)]}),_0x21678e=_0x58a2d3['data'];return console[_0x119ad3(0x9f)](_0x119ad3(0xa7)+_0x21678e[_0x119ad3(0x8b)]+'\x27'),_0x16571a!==_0x4eb43f&&console[_0x119ad3(0x9f)]('\x20\x20\x20Path:\x20'+_0x16571a),await handleSDKOutput([_0x21678e],_0x12ff4b),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a43_0x494c31=a43_0xd14b;(function(_0x5c7990,_0x75dea4){const _0x2430a9=a43_0xd14b,_0x2b3a19=_0x5c7990();while(!![]){try{const _0x4d0f40=-parseInt(_0x2430a9(0x1b1))/0x1+parseInt(_0x2430a9(0x1c4))/0x2+parseInt(_0x2430a9(0x1d5))/0x3+parseInt(_0x2430a9(0x1d9))/0x4+-parseInt(_0x2430a9(0x1c8))/0x5*(parseInt(_0x2430a9(0x1d1))/0x6)+-parseInt(_0x2430a9(0x1d0))/0x7*(parseInt(_0x2430a9(0x1e4))/0x8)+parseInt(_0x2430a9(0x1d4))/0x9*(parseInt(_0x2430a9(0x1b2))/0xa);if(_0x4d0f40===_0x75dea4)break;else _0x2b3a19['push'](_0x2b3a19['shift']());}catch(_0xf2577e){_0x2b3a19['push'](_0x2b3a19['shift']());}}}(a43_0x16a3,0x83fcd));import{existsSync,statSync}from'fs';import a43_0x4df3e4 from'chalk';import{BaseCommand}from'./command.js';function a43_0x16a3(){const _0x345317=['\x20\x20tdx\x20segment\x20use\x20..\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Go\x20to\x20parent','data','error','segments','length','fullPath','green','Resolved\x20path\x20type:\x20','1659414tPwEgE','segment','✔\x20Context\x20cleared.\x20Back\x20to\x20root.','Parent\x20ID:\x20','819310IZYcRb','Use:\x20tdx\x20segment\x20use\x20','\x27...','segment:use','Error:\x20No\x20tdx.json\x20found\x20in\x20or\x20above:\x20','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience\x22','resolvePathToResource','red','16163Wmhnop','6YUPHcL','Use\x20\x22tdx\x20segments\x22\x20to\x20list\x20contents\x20in\x20this\x20context','execute','398448iTRTBf','1197783xSndcF','config','\x20\x20tdx\x20segment\x20use\x20\x22My\x20Audience/Marketing\x22','Set\x20current\x20segment/folder\x20context\x20for\x20navigation','4696lbiTjt','parent_segment','cyan','Error:\x20Path\x20is\x20required\x0a','Resolved\x20relative\x20path\x20to:\x20','session','type','Error:\x20No\x20context\x20set.\x20Cannot\x20use\x20relative\x20path.','folderId','segmentPath','log','2088vNqypJ','name','Folder\x20ID:\x20','Context\x20can\x20only\x20be\x20set\x20to\x20a\x20parent\x20segment\x20or\x20folder.','dim','folderPath','277186pkTUAt','80iYvvXP','isDirectory','site','✔\x20Context\x20set\x20to:\x20','description','parentId','verbose','Use\x20\x22tdx\x20use\x22\x20to\x20see\x20all\x20context\x20parameters','join','Error:\x20Cannot\x20set\x20context\x20to\x20a\x20segment.'];a43_0x16a3=function(){return _0x345317;};return a43_0x16a3();}import{saveSessionContext}from'../core/session.js';import{withSpinner}from'../utils/spinner.js';function a43_0xd14b(_0x10a003,_0x423847){_0x10a003=_0x10a003-0x1af;const _0x16a317=a43_0x16a3();let _0xd14b77=_0x16a317[_0x10a003];return _0xd14b77;}import{parsePath,normalizePath}from'../sdk/segment/segment-path-parser.js';import{findTdxConfig}from'../sdk/segment/tdx-config.js';export class SegmentUseCommand extends BaseCommand{[a43_0x494c31(0x1e5)]=a43_0x494c31(0x1cb);[a43_0x494c31(0x1b6)]=a43_0x494c31(0x1d8);async[a43_0x494c31(0x1d3)](_0x917ca6){const _0x50f00f=a43_0x494c31,{options:_0x19dc14,args:_0x1a444e,tdx:_0x4cb46c}=_0x917ca6;if(_0x1a444e[_0x50f00f(0x1c0)]===0x0)return console[_0x50f00f(0x1be)](a43_0x4df3e4[_0x50f00f(0x1cf)](_0x50f00f(0x1dc))),console[_0x50f00f(0x1be)]('Usage:\x20tdx\x20segment\x20use\x20<path>'),console[_0x50f00f(0x1be)]('Examples:'),console[_0x50f00f(0x1be)](_0x50f00f(0x1cd)),console[_0x50f00f(0x1be)](_0x50f00f(0x1d7)),console[_0x50f00f(0x1be)]('\x20\x20tdx\x20segment\x20use\x20/\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Clear\x20context'),console['error'](_0x50f00f(0x1bc)),0x1;const _0x37261d=_0x1a444e[0x0],_0x3544c8=_0x19dc14[_0x50f00f(0x1de)];try{if(_0x37261d==='/')return saveSessionContext({'segment_path':undefined},_0x3544c8),console[_0x50f00f(0x1e3)](a43_0x4df3e4[_0x50f00f(0x1c2)](_0x50f00f(0x1c6))),0x0;if(existsSync(_0x37261d)&&statSync(_0x37261d)[_0x50f00f(0x1b3)]()){let _0x53f28e;try{_0x53f28e=findTdxConfig(_0x37261d);}catch{return console[_0x50f00f(0x1be)](a43_0x4df3e4['red'](_0x50f00f(0x1cc)+_0x37261d)),console[_0x50f00f(0x1be)](a43_0x4df3e4[_0x50f00f(0x1db)]('Tip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure')),0x1;}const _0x3aba8a=_0x53f28e[_0x50f00f(0x1d6)][_0x50f00f(0x1da)];return saveSessionContext({'segment_path':_0x3aba8a,'parent_segment':_0x3aba8a},_0x3544c8),console[_0x50f00f(0x1e3)](a43_0x4df3e4[_0x50f00f(0x1c2)](_0x50f00f(0x1b5)+a43_0x4df3e4[_0x50f00f(0x1db)](_0x3aba8a))),0x0;}const _0x54b263=_0x19dc14[_0x50f00f(0x1e2)];let _0x1b2edd=_0x37261d;const _0x18e856=parsePath(_0x37261d);if(!_0x18e856['isAbsolute']){if(!_0x54b263)return console[_0x50f00f(0x1be)](a43_0x4df3e4[_0x50f00f(0x1cf)](_0x50f00f(0x1e0))),console[_0x50f00f(0x1be)](a43_0x4df3e4['cyan']('Use\x20an\x20absolute\x20path\x20or\x20set\x20context\x20with:\x20tdx\x20segment\x20use\x20<parent_name>')),0x1;if(_0x37261d==='..'){const _0x483566=_0x54b263['split']('/')['slice'](0x0,-0x1)['join']('/');_0x1b2edd=_0x483566||'/';}else _0x37261d==='.'?_0x1b2edd=_0x54b263:_0x1b2edd=_0x54b263+'/'+_0x37261d;_0x19dc14['verbose']&&console[_0x50f00f(0x1be)](_0x50f00f(0x1dd)+_0x1b2edd);}if(_0x1b2edd==='/'||_0x1b2edd==='')return saveSessionContext({'segment_path':undefined},_0x3544c8),console['log'](a43_0x4df3e4[_0x50f00f(0x1c2)](_0x50f00f(0x1c6))),0x0;_0x1b2edd=normalizePath(_0x1b2edd);const _0x46f017=parsePath(_0x1b2edd)[_0x50f00f(0x1bf)];if(_0x46f017[_0x50f00f(0x1c0)]===0x0)return saveSessionContext({'segment_path':undefined},_0x3544c8),console[_0x50f00f(0x1e3)](a43_0x4df3e4[_0x50f00f(0x1c2)](_0x50f00f(0x1c6))),0x0;_0x19dc14[_0x50f00f(0x1b8)]&&(console[_0x50f00f(0x1be)]('Site:\x20'+_0x19dc14[_0x50f00f(0x1b4)]),console[_0x50f00f(0x1be)]('Target\x20path:\x20'+_0x1b2edd));const _0x3bf3a4=await withSpinner('Resolving\x20path\x20\x27'+_0x1b2edd+_0x50f00f(0x1ca),()=>_0x4cb46c[_0x50f00f(0x1c5)][_0x50f00f(0x1ce)](_0x1b2edd),{'verbose':_0x19dc14[_0x50f00f(0x1b8)]}),_0x43c2f9=_0x3bf3a4[_0x50f00f(0x1bd)];_0x19dc14[_0x50f00f(0x1b8)]&&(console['error'](_0x50f00f(0x1c3)+_0x43c2f9[_0x50f00f(0x1df)]),console['error'](_0x50f00f(0x1c7)+_0x43c2f9[_0x50f00f(0x1b7)]),_0x43c2f9[_0x50f00f(0x1e1)]&&console['error'](_0x50f00f(0x1e6)+_0x43c2f9['folderId']));if(_0x43c2f9[_0x50f00f(0x1df)]===_0x50f00f(0x1c5))return console[_0x50f00f(0x1be)](a43_0x4df3e4[_0x50f00f(0x1cf)](_0x50f00f(0x1bb))),console[_0x50f00f(0x1be)](_0x50f00f(0x1e7)),console[_0x50f00f(0x1be)](a43_0x4df3e4['cyan'](_0x50f00f(0x1c9)+_0x43c2f9['parentName']+(_0x43c2f9[_0x50f00f(0x1b0)]?'/'+_0x43c2f9['folderPath'][_0x50f00f(0x1ba)]('/'):''))),0x1;return saveSessionContext({'segment_path':_0x43c2f9['fullPath'],'parent_segment':_0x43c2f9['parentName']},_0x3544c8),console[_0x50f00f(0x1e3)](a43_0x4df3e4['green'](_0x50f00f(0x1b5)+a43_0x4df3e4[_0x50f00f(0x1db)](_0x43c2f9[_0x50f00f(0x1c1)]))),_0x19dc14[_0x50f00f(0x1b8)]&&(console['error'](a43_0x4df3e4[_0x50f00f(0x1af)](_0x50f00f(0x1d2))),console[_0x50f00f(0x1be)](a43_0x4df3e4[_0x50f00f(0x1af)](_0x50f00f(0x1b9)))),0x0;}catch(_0x2026ac){throw _0x2026ac;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a44_0x20bd(){const _0x3a504f=['segment:validate','65838OInSBJ','targetDir','validCount','\x20valid','\x20warning(s)','warnings','green','message','invalidCount','409149SAszzl','error','1246864ukGRMT','90CXFElr','dim','Error:\x20Directory\x20not\x20found:\x20','79649ReTmAV','60KLcdTb','\x20error(s)','156166lGGnov','✔\x20All\x20','1277549plJNuZ','description','endsWith','):\x20','Error:\x20No\x20YAML\x20files\x20found\x20in\x20','Error:\x20','parentSegment','no_parent','parent_segment\x20is\x20not\x20set.\x20Use\x20`tdx\x20sg\x20use\x20<parent_name>`\x20to\x20set\x20it.\x0a','errors','verbose','warningCount','execute','type','3PsezSI','\x20file(s)\x20with\x20errors,\x20','valid','length','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','\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','filePath','620988PNHyZR','yellow','name','red','Validation\x20failed:\x20','hasErrors','log','\x20warning(s)\x20found','helpText','\x20file(s)\x20valid','Usage:\x20tdx\x20sg\x20validate\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Validate\x20all\x20(requires\x20context)'];a44_0x20bd=function(){return _0x3a504f;};return a44_0x20bd();}const a44_0x277851=a44_0x103a;(function(_0x265242,_0x3d81d2){const _0x153bca=a44_0x103a,_0x4ade1b=_0x265242();while(!![]){try{const _0x3bb22e=parseInt(_0x153bca(0x71))/0x1+parseInt(_0x153bca(0x74))/0x2+-parseInt(_0x153bca(0x84))/0x3*(-parseInt(_0x153bca(0x8b))/0x4)+-parseInt(_0x153bca(0x72))/0x5*(parseInt(_0x153bca(0x97))/0x6)+parseInt(_0x153bca(0x76))/0x7+parseInt(_0x153bca(0x6d))/0x8+parseInt(_0x153bca(0xa0))/0x9*(-parseInt(_0x153bca(0x6e))/0xa);if(_0x3bb22e===_0x3d81d2)break;else _0x4ade1b['push'](_0x4ade1b['shift']());}catch(_0x3be28a){_0x4ade1b['push'](_0x4ade1b['shift']());}}}(a44_0x20bd,0x1afb7));import{BaseCommand}from'./command.js';import{resolveTarget,isSuccessfulResolution}from'../sdk/segment/target-resolution.js';import{findYamlFiles}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a44_0x9b688e from'chalk';function a44_0x103a(_0x144576,_0x19d7a3){_0x144576=_0x144576-0x6d;const _0x20bd22=a44_0x20bd();let _0x103a57=_0x20bd22[_0x144576];return _0x103a57;}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class SegmentValidateCommand extends BaseCommand{[a44_0x277851(0x8d)]=a44_0x277851(0x96);[a44_0x277851(0x77)]='Validate\x20segment\x20and\x20journey\x20YAML\x20files';async[a44_0x277851(0x82)](_0x22b2fa){const _0xaf3697=a44_0x277851,{options:_0x46b753,args:_0xec6c89}=_0x22b2fa,_0x177d8a=_0x46b753,_0x5933a7=await resolveTarget({'arg':_0xec6c89[0x0],'contextParent':_0x46b753[_0xaf3697(0x7c)],'cwd':process['cwd']()});if(!isSuccessfulResolution(_0x5933a7))return _0x5933a7['errorCode']===_0xaf3697(0x7d)?(console['error'](a44_0x9b688e[_0xaf3697(0x8c)](_0xaf3697(0x7e))),console[_0xaf3697(0xa1)](_0xaf3697(0x95)),console[_0xaf3697(0xa1)](_0xaf3697(0x89)),console[_0xaf3697(0xa1)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20sg\x20validate\x20<file_path>\x20\x20#\x20Validate\x20specific\x20file')):(console[_0xaf3697(0xa1)](a44_0x9b688e[_0xaf3697(0x8e)](_0xaf3697(0x7b)+_0x5933a7[_0xaf3697(0x9e)]+'\x0a')),_0x5933a7[_0xaf3697(0x93)]&&console['error'](a44_0x9b688e['cyan'](_0x5933a7[_0xaf3697(0x93)]))),0x1;const _0x3350aa=_0x5933a7[_0xaf3697(0x98)],_0x5b4aed=_0x5933a7[_0xaf3697(0x83)]==='file'?_0x5933a7[_0xaf3697(0x8a)]:undefined;if(!_0x5b4aed&&!existsSync(_0x3350aa))return console[_0xaf3697(0xa1)](a44_0x9b688e['red'](_0xaf3697(0x70)+_0x3350aa+'\x0a')),0x1;let _0x15b66a;if(_0x5b4aed){if(!_0x5b4aed[_0xaf3697(0x78)]('.yml')&&!_0x5b4aed[_0xaf3697(0x78)]('.yaml'))return console[_0xaf3697(0xa1)](a44_0x9b688e[_0xaf3697(0x8e)](_0xaf3697(0x88)+_0x5b4aed+'\x0a')),0x1;_0x15b66a=[_0x5b4aed];}else _0x15b66a=findYamlFiles(_0x3350aa);if(_0x15b66a[_0xaf3697(0x87)]===0x0)return console[_0xaf3697(0xa1)](a44_0x9b688e[_0xaf3697(0x8e)](_0xaf3697(0x7a)+_0x3350aa+'\x0a')),0x1;const _0x5409b3=validateYamlFiles(_0x15b66a,_0x3350aa),_0x1efe6d=calculateSummary(_0x5409b3);for(const _0x470060 of _0x5409b3){if(!isValidationResult(_0x470060))continue;const {relativePath:_0x44ef0d,source:_0x31bb2f,result:_0x41deb7,fileType:_0x23131f}=_0x470060,_0x1c310c=_0x23131f;if(_0x41deb7[_0xaf3697(0x86)]&&_0x41deb7['warnings']['length']===0x0)_0x177d8a[_0xaf3697(0x80)]&&console[_0xaf3697(0x91)](a44_0x9b688e[_0xaf3697(0x9d)]('✔\x20'+_0x44ef0d)+a44_0x9b688e[_0xaf3697(0x6f)]('\x20('+_0x1c310c+')'));else _0x41deb7[_0xaf3697(0x86)]?(console[_0xaf3697(0x91)](a44_0x9b688e[_0xaf3697(0x8c)]('⚠\x20'+_0x44ef0d)+a44_0x9b688e[_0xaf3697(0x6f)]('\x20('+_0x1c310c+_0xaf3697(0x79)+_0x41deb7[_0xaf3697(0x9c)][_0xaf3697(0x87)]+_0xaf3697(0x9b))),console[_0xaf3697(0x91)](formatValidationResult(_0x41deb7,_0x31bb2f,_0x44ef0d))):(console[_0xaf3697(0x91)](a44_0x9b688e[_0xaf3697(0x8e)]('✖\x20'+_0x44ef0d)+a44_0x9b688e[_0xaf3697(0x6f)]('\x20('+_0x1c310c+'):\x20'+_0x41deb7[_0xaf3697(0x7f)][_0xaf3697(0x87)]+_0xaf3697(0x73))),console['log'](formatValidationResult(_0x41deb7,_0x31bb2f,_0x44ef0d)));}return console[_0xaf3697(0x91)](''),_0x1efe6d[_0xaf3697(0x90)]?(console['log'](a44_0x9b688e[_0xaf3697(0x8e)](_0xaf3697(0x8f)+_0x1efe6d[_0xaf3697(0x9f)]+_0xaf3697(0x85)+_0x1efe6d[_0xaf3697(0x99)]+_0xaf3697(0x9a))),_0x1efe6d[_0xaf3697(0x81)]>0x0&&console['log'](a44_0x9b688e[_0xaf3697(0x8c)](_0x1efe6d[_0xaf3697(0x81)]+_0xaf3697(0x92))),0x1):(console[_0xaf3697(0x91)](a44_0x9b688e[_0xaf3697(0x9d)](_0xaf3697(0x75)+_0x1efe6d['validCount']+_0xaf3697(0x94))),_0x1efe6d[_0xaf3697(0x81)]>0x0&&console[_0xaf3697(0x91)](a44_0x9b688e[_0xaf3697(0x8c)](_0x1efe6d[_0xaf3697(0x81)]+'\x20warning(s)\x20found')),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a45_0x30c7cd=a45_0x3bea;function a45_0x3b0c(){const _0x29de29=['folderId','Site:\x20','journeys','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','name','log','error','resolvePathToResource','maxDepth','replace','(empty)','Recursive\x20mode:\x20enabled','localeCompare','sort','jsonl','\x20folder','4228287MLYniY','children','verbose','data','test','Error:\x20','205362Dygdgd','format',']\x20matching\x20\x27','Resolving\x20path\x20\x27','listUnified','/app/ps/','description','listRecursive','\x20segment','\x20journey','site','\x20matching\x20\x27','\x27...','map','parentId','listWithPattern','63sboYfj','7374864hPpIiS','✔\x20Found\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','6vgDKFD','journey','filter','includes','type','Resolving\x20parent\x20segment\x20\x27',',\x20and\x20','Folder/pattern\x20arg:\x20','dim','764696xPDAHt','\x5c$&','cause','3244vsWOlt','10343487ENCLRK','folder','folders','List\x20folders\x20and\x20child\x20segments','32461300zESxWK','message','Building\x20hierarchy\x20tree...','✔\x20Built\x20tree\x20with\x20','segments','recursive','segment','journeyBundleName','Listing\x20folders,\x20segments,\x20and\x20journeys...','(not\x20set)','No\x20items\x20match\x20pattern:\x20','/e/','execute','Folder\x20ID:\x20','Parent\x20ID:\x20','length','1060aesFYV','json'];a45_0x3b0c=function(){return _0x29de29;};return a45_0x3b0c();}(function(_0x1a5cc7,_0x3739be){const _0xde6790=a45_0x3bea,_0x515fd6=_0x1a5cc7();while(!![]){try{const _0x2d177d=parseInt(_0xde6790(0x211))/0x1*(-parseInt(_0xde6790(0x1fd))/0x2)+parseInt(_0xde6790(0x1f7))/0x3+parseInt(_0xde6790(0x21d))/0x4*(-parseInt(_0xde6790(0x1e5))/0x5)+parseInt(_0xde6790(0x20e))/0x6+parseInt(_0xde6790(0x21e))/0x7+-parseInt(_0xde6790(0x21a))/0x8*(-parseInt(_0xde6790(0x20d))/0x9)+-parseInt(_0xde6790(0x1d5))/0xa;if(_0x2d177d===_0x3739be)break;else _0x515fd6['push'](_0x515fd6['shift']());}catch(_0x29192c){_0x515fd6['push'](_0x515fd6['shift']());}}}(a45_0x3b0c,0xb7647));function a45_0x3bea(_0x450634,_0x41d7a3){_0x450634=_0x450634-0x1d5;const _0x3b0c4c=a45_0x3b0c();let _0x3bea01=_0x3b0c4c[_0x450634];return _0x3bea01;}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0xe0926 from'chalk';export class SegmentsCommand extends BaseCommand{[a45_0x30c7cd(0x1eb)]=a45_0x30c7cd(0x1d9);[a45_0x30c7cd(0x203)]=a45_0x30c7cd(0x221);async[a45_0x30c7cd(0x1e1)](_0x550317){const _0x580b99=a45_0x30c7cd,{options:_0x4a3e29,args:_0x197264}=_0x550317,_0x5a9367=_0x4a3e29[_0x580b99(0x1da)],_0x25fa56=_0x197264[0x0];try{const _0x195244=_0x4a3e29['parentSegment'];_0x4a3e29[_0x580b99(0x1f9)]&&(console[_0x580b99(0x1ed)](_0x580b99(0x1e8)+_0x4a3e29[_0x580b99(0x207)]),console[_0x580b99(0x1ed)]('Parent\x20segment\x20context:\x20'+(_0x195244||_0x580b99(0x1de))),_0x25fa56&&console[_0x580b99(0x1ed)](_0x580b99(0x218)+_0x25fa56),_0x5a9367&&console[_0x580b99(0x1ed)](_0x580b99(0x1f2)));if(!_0x195244)return console[_0x580b99(0x1ed)]('Error:\x20No\x20parent\x20segment\x20context\x20set.'),console[_0x580b99(0x1ed)](''),console[_0x580b99(0x1ed)]('Set\x20a\x20parent\x20segment\x20context\x20first:'),console[_0x580b99(0x1ed)](_0x580b99(0x210)),console[_0x580b99(0x1ed)](_0x580b99(0x1ea)),console[_0x580b99(0x1ed)](''),console[_0x580b99(0x1ed)]('Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.'),0x1;const _0x4c982f=_0x25fa56&&(_0x25fa56[_0x580b99(0x214)]('*')||_0x25fa56[_0x580b99(0x214)]('?'));if(_0x4c982f)return await this[_0x580b99(0x20c)](_0x550317,_0x195244,_0x25fa56);const _0xb16b19=_0x25fa56?_0x195244+'/'+_0x25fa56:_0x195244;return _0x5a9367?await this[_0x580b99(0x204)](_0x550317,_0xb16b19):await this[_0x580b99(0x201)](_0x550317,_0xb16b19);}catch(_0x161e7d){if(_0x161e7d instanceof SDKError)return console[_0x580b99(0x1ed)](_0x580b99(0x1fc)+_0x161e7d[_0x580b99(0x1d6)]),_0x161e7d[_0x580b99(0x21c)]&&console[_0x580b99(0x1ed)]('\x20\x20Cause:\x20'+_0x161e7d[_0x580b99(0x21c)]),0x1;throw _0x161e7d;}}async[a45_0x30c7cd(0x20c)](_0xf1a4ab,_0x5459f3,_0xadc71e){const _0x5e58b0=a45_0x30c7cd,{options:_0x46566c,tdx:_0x366513}=_0xf1a4ab,_0x232c34=await withSpinner(_0x5e58b0(0x216)+_0x5459f3+_0x5e58b0(0x209),()=>_0x366513['segment'][_0x5e58b0(0x1ee)](_0x5459f3),{'verbose':_0x46566c['verbose']}),_0x29650b=_0x232c34[_0x5e58b0(0x1fa)],_0x4dc74d=await withSpinner(_0x5e58b0(0x1dd),()=>_0x366513[_0x5e58b0(0x1db)]['listUnifiedWithJourneys'](_0x29650b[_0x5e58b0(0x20b)],_0x29650b[_0x5e58b0(0x1e7)]),{'verbose':_0x46566c[_0x5e58b0(0x1f9)]}),{folders:_0x123dbd,segments:_0x3ec8c3,journeys:_0x15f0c5}=_0x4dc74d[_0x5e58b0(0x1fa)],_0xa96693=_0xadc71e[_0x5e58b0(0x1f0)](/[.+^${}()|[\]\\]/g,_0x5e58b0(0x21b))[_0x5e58b0(0x1f0)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x4cf95c=new RegExp('^'+_0xa96693+'$','i'),_0x13685b=_0x123dbd[_0x5e58b0(0x213)](_0x58c6ce=>_0x4cf95c[_0x5e58b0(0x1fb)](_0x58c6ce[_0x5e58b0(0x1eb)])),_0x14b7f3=_0x3ec8c3[_0x5e58b0(0x213)](_0x751e09=>_0x4cf95c['test'](_0x751e09[_0x5e58b0(0x1eb)])),_0x5308a7=_0x15f0c5[_0x5e58b0(0x213)](_0x591371=>_0x4cf95c[_0x5e58b0(0x1fb)](_0x591371[_0x5e58b0(0x1dc)])),_0x3919af=_0x13685b['length']+_0x14b7f3[_0x5e58b0(0x1e4)]+_0x5308a7[_0x5e58b0(0x1e4)];console[_0x5e58b0(0x1ed)](_0x5e58b0(0x20f)+_0x13685b['length']+_0x5e58b0(0x1f6)+(_0x13685b[_0x5e58b0(0x1e4)]!==0x1?'s':'')+',\x20'+_0x14b7f3[_0x5e58b0(0x1e4)]+_0x5e58b0(0x205)+(_0x14b7f3[_0x5e58b0(0x1e4)]!==0x1?'s':'')+_0x5e58b0(0x217)+_0x5308a7[_0x5e58b0(0x1e4)]+'\x20journey'+(_0x5308a7['length']!==0x1?'s':'')+_0x5e58b0(0x208)+_0xadc71e+'\x27');const _0x52a516=_0x217294=>{const _0x3de63d=_0x5e58b0;return getConsoleNextUrl(_0x46566c['site'],_0x3de63d(0x202)+_0x29650b[_0x3de63d(0x20b)]+_0x3de63d(0x1e0)+_0x217294);},_0x36c601=_0x46566c[_0x5e58b0(0x1fe)]===_0x5e58b0(0x1e6)||_0x46566c['format']===_0x5e58b0(0x1f5);if(_0x36c601){const _0x18f0c7=[..._0x13685b[_0x5e58b0(0x20a)](_0x4b43c7=>({..._0x4b43c7,'type':_0x5e58b0(0x21f)})),..._0x14b7f3[_0x5e58b0(0x20a)](_0x58d72f=>({..._0x58d72f,'type':'segment','url':_0x52a516(_0x58d72f['id'])})),..._0x5308a7['map'](_0x211ea9=>({..._0x211ea9,'name':_0x211ea9[_0x5e58b0(0x1dc)],'type':_0x5e58b0(0x212)}))]['sort']((_0x54f1e0,_0x54027f)=>_0x54f1e0[_0x5e58b0(0x1eb)][_0x5e58b0(0x1f3)](_0x54027f[_0x5e58b0(0x1eb)]));await handleSDKOutput(_0x18f0c7,_0x46566c);}else{if(_0x3919af===0x0)console[_0x5e58b0(0x1ec)](_0x5e58b0(0x1df)+_0xadc71e);else{console[_0x5e58b0(0x1ec)](a45_0xe0926[_0x5e58b0(0x219)]('['+_0x5459f3+_0x5e58b0(0x1ff)+_0xadc71e+'\x27'));const _0x4eac42=formatFlatList(_0x13685b,_0x14b7f3,{'showMetadata':!![],'getSegmentUrl':_0x52a516},_0x5308a7);console[_0x5e58b0(0x1ec)](_0x4eac42);}}return 0x0;}async[a45_0x30c7cd(0x201)](_0xaa8c59,_0x48f657){const _0x1c17bd=a45_0x30c7cd,{options:_0x5664ac,tdx:_0x5e72d7}=_0xaa8c59,_0x213710=await withSpinner(_0x1c17bd(0x200)+_0x48f657+_0x1c17bd(0x209),()=>_0x5e72d7[_0x1c17bd(0x1db)][_0x1c17bd(0x1ee)](_0x48f657),{'verbose':_0x5664ac[_0x1c17bd(0x1f9)]}),_0x4dc68b=_0x213710['data'];_0x5664ac['verbose']&&(console['error'](_0x1c17bd(0x1e3)+_0x4dc68b[_0x1c17bd(0x20b)]),_0x4dc68b[_0x1c17bd(0x1e7)]&&console[_0x1c17bd(0x1ed)](_0x1c17bd(0x1e2)+_0x4dc68b['folderId']));const _0x1b7f60=await withSpinner(_0x1c17bd(0x1dd),()=>_0x5e72d7['segment']['listUnifiedWithJourneys'](_0x4dc68b[_0x1c17bd(0x20b)],_0x4dc68b['folderId']),{'verbose':_0x5664ac['verbose']}),{folders:_0x524112,segments:_0x5b035e,journeys:_0x382f46}=_0x1b7f60[_0x1c17bd(0x1fa)],_0x4f23e4=_0x524112[_0x1c17bd(0x1e4)]+_0x5b035e[_0x1c17bd(0x1e4)]+_0x382f46[_0x1c17bd(0x1e4)];console[_0x1c17bd(0x1ed)](_0x1c17bd(0x20f)+_0x524112['length']+_0x1c17bd(0x1f6)+(_0x524112['length']!==0x1?'s':'')+',\x20'+_0x5b035e['length']+_0x1c17bd(0x205)+(_0x5b035e[_0x1c17bd(0x1e4)]!==0x1?'s':'')+_0x1c17bd(0x217)+_0x382f46[_0x1c17bd(0x1e4)]+_0x1c17bd(0x206)+(_0x382f46[_0x1c17bd(0x1e4)]!==0x1?'s':''));const _0x6e2cd7=_0x54225e=>{const _0x5b9bde=_0x1c17bd;return getConsoleNextUrl(_0x5664ac[_0x5b9bde(0x207)],_0x5b9bde(0x202)+_0x4dc68b[_0x5b9bde(0x20b)]+_0x5b9bde(0x1e0)+_0x54225e);},_0x5a045e=_0x590cf7=>{const _0x1fc988=_0x1c17bd;return getConsoleNextUrl(_0x5664ac[_0x1fc988(0x207)],_0x1fc988(0x202)+_0x4dc68b[_0x1fc988(0x20b)]+_0x1fc988(0x1e0)+_0x590cf7+'/j/da');},_0x4c1f6e=_0x5664ac[_0x1c17bd(0x1fe)]===_0x1c17bd(0x1e6)||_0x5664ac['format']==='jsonl';if(_0x4c1f6e){const _0xa3b532=[..._0x524112[_0x1c17bd(0x20a)](_0x39e522=>({..._0x39e522,'type':_0x1c17bd(0x21f)})),..._0x5b035e['map'](_0x2cde1d=>({..._0x2cde1d,'type':'segment','url':_0x6e2cd7(_0x2cde1d['id'])})),..._0x382f46[_0x1c17bd(0x20a)](_0x1945bd=>({..._0x1945bd,'name':_0x1945bd[_0x1c17bd(0x1dc)],'type':_0x1c17bd(0x212),'url':_0x5a045e(_0x1945bd['id'])}))][_0x1c17bd(0x1f4)]((_0x2612c7,_0x18e6e7)=>_0x2612c7['name']['localeCompare'](_0x18e6e7[_0x1c17bd(0x1eb)]));await handleSDKOutput(_0xa3b532,_0x5664ac);}else{if(_0x4f23e4===0x0)console[_0x1c17bd(0x1ec)](a45_0xe0926[_0x1c17bd(0x219)]('['+_0x48f657+']')),console['log'](_0x1c17bd(0x1f1));else{console['log'](a45_0xe0926[_0x1c17bd(0x219)]('['+_0x48f657+']'));const _0x821546=formatFlatList(_0x524112,_0x5b035e,{'showMetadata':!![],'getSegmentUrl':_0x6e2cd7,'getJourneyUrl':_0x5a045e},_0x382f46);console[_0x1c17bd(0x1ec)](_0x821546);}}return 0x0;}async['listRecursive'](_0x26336c,_0x112dfb){const _0x45fe5a=a45_0x30c7cd,{options:_0x4ef8cd,tdx:_0x5d7f7d}=_0x26336c,_0x4aae26=await withSpinner(_0x45fe5a(0x200)+_0x112dfb+'\x27...',()=>_0x5d7f7d[_0x45fe5a(0x1db)][_0x45fe5a(0x1ee)](_0x112dfb),{'verbose':_0x4ef8cd[_0x45fe5a(0x1f9)]}),_0x434b51=_0x4aae26['data'];_0x4ef8cd['verbose']&&(console[_0x45fe5a(0x1ed)](_0x45fe5a(0x1e3)+_0x434b51[_0x45fe5a(0x20b)]),_0x434b51[_0x45fe5a(0x1e7)]&&console[_0x45fe5a(0x1ed)]('Folder\x20ID:\x20'+_0x434b51[_0x45fe5a(0x1e7)]));const _0x1c5da8=_0x4ef8cd[_0x45fe5a(0x1ef)]||0xa,_0x44e3e7=await withSpinner(_0x45fe5a(0x1d7),()=>_0x5d7f7d[_0x45fe5a(0x1db)][_0x45fe5a(0x204)](_0x434b51['parentId'],_0x434b51['folderId'],0x0,_0x1c5da8),{'verbose':_0x4ef8cd[_0x45fe5a(0x1f9)]}),_0x499cbe=_0x44e3e7[_0x45fe5a(0x1fa)],_0x44819c=_0x167159=>{const _0xa3cf53=_0x45fe5a;let _0xca9b74=0x0,_0x3896ad=0x0,_0x2c1f5b=0x0;for(const _0x18258f of _0x167159){if(_0x18258f['type']===_0xa3cf53(0x21f))_0xca9b74++;else{if(_0x18258f[_0xa3cf53(0x215)]===_0xa3cf53(0x1db))_0x3896ad++;else{if(_0x18258f[_0xa3cf53(0x215)]===_0xa3cf53(0x212))_0x2c1f5b++;}}if(_0x18258f[_0xa3cf53(0x1f8)]){const _0x5f1e4f=_0x44819c(_0x18258f[_0xa3cf53(0x1f8)]);_0xca9b74+=_0x5f1e4f[_0xa3cf53(0x220)],_0x3896ad+=_0x5f1e4f[_0xa3cf53(0x1d9)],_0x2c1f5b+=_0x5f1e4f[_0xa3cf53(0x1e9)];}}return{'folders':_0xca9b74,'segments':_0x3896ad,'journeys':_0x2c1f5b};},_0x2ceabc=_0x44819c(_0x499cbe);console[_0x45fe5a(0x1ed)](_0x45fe5a(0x1d8)+_0x2ceabc[_0x45fe5a(0x220)]+_0x45fe5a(0x1f6)+(_0x2ceabc['folders']!==0x1?'s':'')+',\x20'+_0x2ceabc[_0x45fe5a(0x1d9)]+_0x45fe5a(0x205)+(_0x2ceabc['segments']!==0x1?'s':'')+_0x45fe5a(0x217)+_0x2ceabc['journeys']+_0x45fe5a(0x206)+(_0x2ceabc[_0x45fe5a(0x1e9)]!==0x1?'s':''));const _0x220849=_0x35ea61=>{const _0x4f6b3e=_0x45fe5a;return getConsoleNextUrl(_0x4ef8cd['site'],_0x4f6b3e(0x202)+_0x434b51[_0x4f6b3e(0x20b)]+_0x4f6b3e(0x1e0)+_0x35ea61);},_0x1283c1=_0x4985c8=>{const _0x42b4ec=_0x45fe5a;return getConsoleNextUrl(_0x4ef8cd['site'],_0x42b4ec(0x202)+_0x434b51[_0x42b4ec(0x20b)]+_0x42b4ec(0x1e0)+_0x4985c8+'/j/da');};if(_0x4ef8cd[_0x45fe5a(0x1fe)]===_0x45fe5a(0x1e6)||_0x4ef8cd[_0x45fe5a(0x1fe)]===_0x45fe5a(0x1f5))await handleSDKOutput(_0x499cbe,_0x4ef8cd);else{console[_0x45fe5a(0x1ec)](a45_0xe0926[_0x45fe5a(0x219)]('['+_0x112dfb+']'));const _0x2fa603=formatTree(_0x499cbe,{'showMetadata':!![],'getSegmentUrl':_0x220849,'getJourneyUrl':_0x1283c1});console[_0x45fe5a(0x1ec)](_0x2fa603);}return 0x0;}}
|
|
1
|
+
function a45_0x2797(){const _0x344c0d=['Use\x20tdx\x20ps\x20list\x20to\x20see\x20available\x20parent\x20segments.','journeyBundleName','log','error','9931042dvepXq','folders','segments','map','200365IwUiCI','parentId','Error:\x20','List\x20folders\x20and\x20child\x20segments','Resolving\x20parent\x20segment\x20\x27','sort','\x20\x20tdx\x20sg\x20use\x20\x22My\x20Audience\x22','4250350EFBOHD','\x20matching\x20\x27','verbose','format','\x27...','execute','\x20journey','87446XhmJDf','1WaBmXA','description','44uoeZdq','dim','\x20\x20Cause:\x20','1134ofqbAx','/app/ps/','message','\x20folder','parentSegment','maxDepth','1290303zgybiu','type','resolvePathToResource','replace','/j/da','name','data','listUnifiedWithJourneys','segment','cause','757539xeapks','filter','includes','journeys','test','folderId','jsonl','/e/','children','Parent\x20ID:\x20','site','Listing\x20folders,\x20segments,\x20and\x20journeys...','Site:\x20','No\x20items\x20match\x20pattern:\x20','listWithPattern','listRecursive','Set\x20a\x20parent\x20segment\x20context\x20first:','length','Folder\x20ID:\x20','\x20\x20tdx\x20sg\x20pull\x20\x22My\x20Audience\x22','(empty)','Error:\x20No\x20parent\x20segment\x20context\x20set.','Parent\x20segment\x20context:\x20',',\x20and\x20','48OwTPaq','localeCompare','recursive','\x5c$&','Resolving\x20path\x20\x27','\x20segment','folder','24339hYAtKi','journey'];a45_0x2797=function(){return _0x344c0d;};return a45_0x2797();}const a45_0x5da4d1=a45_0x51b5;(function(_0xc63862,_0x3e89ba){const _0x188be6=a45_0x51b5,_0x546e81=_0xc63862();while(!![]){try{const _0x4de41e=parseInt(_0x188be6(0xfc))/0x1*(parseInt(_0x188be6(0xfb))/0x2)+-parseInt(_0x188be6(0x107))/0x3+parseInt(_0x188be6(0xfe))/0x4*(-parseInt(_0x188be6(0xed))/0x5)+-parseInt(_0x188be6(0x101))/0x6*(parseInt(_0x188be6(0xe3))/0x7)+-parseInt(_0x188be6(0xdc))/0x8*(-parseInt(_0x188be6(0x111))/0x9)+parseInt(_0x188be6(0xf4))/0xa+parseInt(_0x188be6(0xe9))/0xb;if(_0x4de41e===_0x3e89ba)break;else _0x546e81['push'](_0x546e81['shift']());}catch(_0x232f7d){_0x546e81['push'](_0x546e81['shift']());}}}(a45_0x2797,0x55185));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{formatFlatList,formatTree}from'../sdk/util/tree-formatter.js';function a45_0x51b5(_0x927eb5,_0x1d0bb3){_0x927eb5=_0x927eb5-0xc6;const _0x279736=a45_0x2797();let _0x51b54d=_0x279736[_0x927eb5];return _0x51b54d;}import{getConsoleNextUrl}from'../sdk/client/endpoints.js';import a45_0x5f581b from'chalk';export class SegmentsCommand extends BaseCommand{['name']=a45_0x5da4d1(0xeb);[a45_0x5da4d1(0xfd)]=a45_0x5da4d1(0xf0);async[a45_0x5da4d1(0xf9)](_0x12ba9d){const _0x3d5ce6=a45_0x5da4d1,{options:_0x574af9,args:_0x3bfd21}=_0x12ba9d,_0x20379b=_0x574af9[_0x3d5ce6(0xde)],_0x11193e=_0x3bfd21[0x0];try{const _0x343504=_0x574af9[_0x3d5ce6(0x105)];_0x574af9['verbose']&&(console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xd0)+_0x574af9[_0x3d5ce6(0xce)]),console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xda)+(_0x343504||'(not\x20set)')),_0x11193e&&console[_0x3d5ce6(0xe8)]('Folder/pattern\x20arg:\x20'+_0x11193e),_0x20379b&&console[_0x3d5ce6(0xe8)]('Recursive\x20mode:\x20enabled'));if(!_0x343504)return console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xd9)),console['error'](''),console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xd4)),console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xd7)),console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xf3)),console[_0x3d5ce6(0xe8)](''),console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xe5)),0x1;const _0x4b2cb7=_0x11193e&&(_0x11193e['includes']('*')||_0x11193e[_0x3d5ce6(0xc6)]('?'));if(_0x4b2cb7)return await this['listWithPattern'](_0x12ba9d,_0x343504,_0x11193e);const _0x1101e7=_0x11193e?_0x343504+'/'+_0x11193e:_0x343504;return _0x20379b?await this['listRecursive'](_0x12ba9d,_0x1101e7):await this['listUnified'](_0x12ba9d,_0x1101e7);}catch(_0xe1f19f){if(_0xe1f19f instanceof SDKError)return console[_0x3d5ce6(0xe8)](_0x3d5ce6(0xef)+_0xe1f19f[_0x3d5ce6(0x103)]),_0xe1f19f[_0x3d5ce6(0x110)]&&console['error'](_0x3d5ce6(0x100)+_0xe1f19f['cause']),0x1;throw _0xe1f19f;}}async[a45_0x5da4d1(0xd2)](_0x2376b0,_0x1ec5c4,_0x3e8906){const _0x4cb282=a45_0x5da4d1,{options:_0x4ec1b3,tdx:_0x3661c5}=_0x2376b0,_0x345562=await withSpinner(_0x4cb282(0xf1)+_0x1ec5c4+_0x4cb282(0xf8),()=>_0x3661c5[_0x4cb282(0x10f)][_0x4cb282(0x109)](_0x1ec5c4),{'verbose':_0x4ec1b3[_0x4cb282(0xf6)]}),_0xdef1b0=_0x345562['data'],_0x8c2066=await withSpinner(_0x4cb282(0xcf),()=>_0x3661c5['segment'][_0x4cb282(0x10e)](_0xdef1b0[_0x4cb282(0xee)],_0xdef1b0[_0x4cb282(0xc9)]),{'verbose':_0x4ec1b3[_0x4cb282(0xf6)]}),{folders:_0x423e0e,segments:_0x435a4d,journeys:_0x365cd1}=_0x8c2066[_0x4cb282(0x10d)],_0x1b6a8d=_0x3e8906[_0x4cb282(0x10a)](/[.+^${}()|[\]\\]/g,_0x4cb282(0xdf))[_0x4cb282(0x10a)](/\*/g,'.*')['replace'](/\?/g,'.'),_0x1a8574=new RegExp('^'+_0x1b6a8d+'$','i'),_0x23b2a3=_0x423e0e[_0x4cb282(0x112)](_0x5cb112=>_0x1a8574[_0x4cb282(0xc8)](_0x5cb112[_0x4cb282(0x10c)])),_0x475d88=_0x435a4d['filter'](_0x141ed4=>_0x1a8574['test'](_0x141ed4[_0x4cb282(0x10c)])),_0x465e26=_0x365cd1[_0x4cb282(0x112)](_0x53d0b3=>_0x1a8574[_0x4cb282(0xc8)](_0x53d0b3[_0x4cb282(0xe6)])),_0x14a368=_0x23b2a3[_0x4cb282(0xd5)]+_0x475d88[_0x4cb282(0xd5)]+_0x465e26[_0x4cb282(0xd5)];console[_0x4cb282(0xe8)]('✔\x20Found\x20'+_0x23b2a3[_0x4cb282(0xd5)]+_0x4cb282(0x104)+(_0x23b2a3['length']!==0x1?'s':'')+',\x20'+_0x475d88[_0x4cb282(0xd5)]+_0x4cb282(0xe1)+(_0x475d88[_0x4cb282(0xd5)]!==0x1?'s':'')+',\x20and\x20'+_0x465e26[_0x4cb282(0xd5)]+_0x4cb282(0xfa)+(_0x465e26[_0x4cb282(0xd5)]!==0x1?'s':'')+_0x4cb282(0xf5)+_0x3e8906+'\x27');const _0x22e239=_0x1ee6f3=>{const _0xb449bd=_0x4cb282;return getConsoleNextUrl(_0x4ec1b3[_0xb449bd(0xce)],_0xb449bd(0x102)+_0xdef1b0['parentId']+_0xb449bd(0xcb)+_0x1ee6f3);},_0x152ef7=_0x4ec1b3[_0x4cb282(0xf7)]==='json'||_0x4ec1b3['format']===_0x4cb282(0xca);if(_0x152ef7){const _0x49f66f=[..._0x23b2a3[_0x4cb282(0xec)](_0x102696=>({..._0x102696,'type':_0x4cb282(0xe2)})),..._0x475d88['map'](_0x3cdd76=>({..._0x3cdd76,'type':_0x4cb282(0x10f),'url':_0x22e239(_0x3cdd76['id'])})),..._0x465e26[_0x4cb282(0xec)](_0x2df27a=>({..._0x2df27a,'name':_0x2df27a['journeyBundleName'],'type':'journey'}))][_0x4cb282(0xf2)]((_0x31c035,_0x2627cc)=>_0x31c035['name'][_0x4cb282(0xdd)](_0x2627cc['name']));await handleSDKOutput(_0x49f66f,_0x4ec1b3);}else{if(_0x14a368===0x0)console['log'](_0x4cb282(0xd1)+_0x3e8906);else{console[_0x4cb282(0xe7)](a45_0x5f581b[_0x4cb282(0xff)]('['+_0x1ec5c4+']\x20matching\x20\x27'+_0x3e8906+'\x27'));const _0x42a887=formatFlatList(_0x23b2a3,_0x475d88,{'showMetadata':!![],'getSegmentUrl':_0x22e239},_0x465e26);console[_0x4cb282(0xe7)](_0x42a887);}}return 0x0;}async['listUnified'](_0xb3517c,_0x6d8b71){const _0x21f8c1=a45_0x5da4d1,{options:_0xf6df8,tdx:_0x1e68f4}=_0xb3517c,_0x34458d=await withSpinner(_0x21f8c1(0xe0)+_0x6d8b71+'\x27...',()=>_0x1e68f4[_0x21f8c1(0x10f)][_0x21f8c1(0x109)](_0x6d8b71),{'verbose':_0xf6df8[_0x21f8c1(0xf6)]}),_0x5cc985=_0x34458d[_0x21f8c1(0x10d)];_0xf6df8[_0x21f8c1(0xf6)]&&(console[_0x21f8c1(0xe8)](_0x21f8c1(0xcd)+_0x5cc985[_0x21f8c1(0xee)]),_0x5cc985[_0x21f8c1(0xc9)]&&console['error'](_0x21f8c1(0xd6)+_0x5cc985[_0x21f8c1(0xc9)]));const _0x49a1b8=await withSpinner(_0x21f8c1(0xcf),()=>_0x1e68f4[_0x21f8c1(0x10f)]['listUnifiedWithJourneys'](_0x5cc985[_0x21f8c1(0xee)],_0x5cc985[_0x21f8c1(0xc9)]),{'verbose':_0xf6df8['verbose']}),{folders:_0x2bbf7e,segments:_0xdb18d9,journeys:_0x5e0ade}=_0x49a1b8[_0x21f8c1(0x10d)],_0x117cde=_0x2bbf7e['length']+_0xdb18d9[_0x21f8c1(0xd5)]+_0x5e0ade[_0x21f8c1(0xd5)];console[_0x21f8c1(0xe8)]('✔\x20Found\x20'+_0x2bbf7e[_0x21f8c1(0xd5)]+_0x21f8c1(0x104)+(_0x2bbf7e[_0x21f8c1(0xd5)]!==0x1?'s':'')+',\x20'+_0xdb18d9[_0x21f8c1(0xd5)]+_0x21f8c1(0xe1)+(_0xdb18d9[_0x21f8c1(0xd5)]!==0x1?'s':'')+',\x20and\x20'+_0x5e0ade[_0x21f8c1(0xd5)]+'\x20journey'+(_0x5e0ade['length']!==0x1?'s':''));const _0xa27661=_0x1229ea=>{const _0x6cbf72=_0x21f8c1;return getConsoleNextUrl(_0xf6df8[_0x6cbf72(0xce)],_0x6cbf72(0x102)+_0x5cc985['parentId']+'/e/'+_0x1229ea);},_0x5e68b0=_0x51e87c=>{const _0x310b1a=_0x21f8c1;return getConsoleNextUrl(_0xf6df8[_0x310b1a(0xce)],_0x310b1a(0x102)+_0x5cc985['parentId']+_0x310b1a(0xcb)+_0x51e87c+_0x310b1a(0x10b));},_0x1231f8=_0xf6df8[_0x21f8c1(0xf7)]==='json'||_0xf6df8[_0x21f8c1(0xf7)]===_0x21f8c1(0xca);if(_0x1231f8){const _0x1e6e32=[..._0x2bbf7e[_0x21f8c1(0xec)](_0x39af67=>({..._0x39af67,'type':_0x21f8c1(0xe2)})),..._0xdb18d9[_0x21f8c1(0xec)](_0x9151a6=>({..._0x9151a6,'type':_0x21f8c1(0x10f),'url':_0xa27661(_0x9151a6['id'])})),..._0x5e0ade[_0x21f8c1(0xec)](_0x5ee7b6=>({..._0x5ee7b6,'name':_0x5ee7b6[_0x21f8c1(0xe6)],'type':_0x21f8c1(0xe4),'url':_0x5e68b0(_0x5ee7b6['id'])}))][_0x21f8c1(0xf2)]((_0x127e2e,_0x4854e0)=>_0x127e2e[_0x21f8c1(0x10c)][_0x21f8c1(0xdd)](_0x4854e0[_0x21f8c1(0x10c)]));await handleSDKOutput(_0x1e6e32,_0xf6df8);}else{if(_0x117cde===0x0)console[_0x21f8c1(0xe7)](a45_0x5f581b['dim']('['+_0x6d8b71+']')),console['log'](_0x21f8c1(0xd8));else{console[_0x21f8c1(0xe7)](a45_0x5f581b['dim']('['+_0x6d8b71+']'));const _0x4fb2b0=formatFlatList(_0x2bbf7e,_0xdb18d9,{'showMetadata':!![],'getSegmentUrl':_0xa27661,'getJourneyUrl':_0x5e68b0},_0x5e0ade);console[_0x21f8c1(0xe7)](_0x4fb2b0);}}return 0x0;}async[a45_0x5da4d1(0xd3)](_0x4c6232,_0x4bf438){const _0x263e59=a45_0x5da4d1,{options:_0x479649,tdx:_0x570f9a}=_0x4c6232,_0x324636=await withSpinner('Resolving\x20path\x20\x27'+_0x4bf438+_0x263e59(0xf8),()=>_0x570f9a[_0x263e59(0x10f)][_0x263e59(0x109)](_0x4bf438),{'verbose':_0x479649[_0x263e59(0xf6)]}),_0x5540f4=_0x324636[_0x263e59(0x10d)];_0x479649[_0x263e59(0xf6)]&&(console[_0x263e59(0xe8)]('Parent\x20ID:\x20'+_0x5540f4[_0x263e59(0xee)]),_0x5540f4[_0x263e59(0xc9)]&&console['error']('Folder\x20ID:\x20'+_0x5540f4[_0x263e59(0xc9)]));const _0x3f08aa=_0x479649[_0x263e59(0x106)]||0xa,_0x2b41f4=await withSpinner('Building\x20hierarchy\x20tree...',()=>_0x570f9a[_0x263e59(0x10f)][_0x263e59(0xd3)](_0x5540f4['parentId'],_0x5540f4[_0x263e59(0xc9)],0x0,_0x3f08aa),{'verbose':_0x479649[_0x263e59(0xf6)]}),_0x7bf69a=_0x2b41f4[_0x263e59(0x10d)],_0x467be9=_0x58aae7=>{const _0x154847=_0x263e59;let _0x533516=0x0,_0x7fe01d=0x0,_0x4916cd=0x0;for(const _0x3b3c04 of _0x58aae7){if(_0x3b3c04[_0x154847(0x108)]===_0x154847(0xe2))_0x533516++;else{if(_0x3b3c04['type']===_0x154847(0x10f))_0x7fe01d++;else{if(_0x3b3c04['type']===_0x154847(0xe4))_0x4916cd++;}}if(_0x3b3c04['children']){const _0x29574a=_0x467be9(_0x3b3c04[_0x154847(0xcc)]);_0x533516+=_0x29574a['folders'],_0x7fe01d+=_0x29574a[_0x154847(0xeb)],_0x4916cd+=_0x29574a[_0x154847(0xc7)];}}return{'folders':_0x533516,'segments':_0x7fe01d,'journeys':_0x4916cd};},_0x41f728=_0x467be9(_0x7bf69a);console[_0x263e59(0xe8)]('✔\x20Built\x20tree\x20with\x20'+_0x41f728[_0x263e59(0xea)]+'\x20folder'+(_0x41f728['folders']!==0x1?'s':'')+',\x20'+_0x41f728['segments']+'\x20segment'+(_0x41f728[_0x263e59(0xeb)]!==0x1?'s':'')+_0x263e59(0xdb)+_0x41f728[_0x263e59(0xc7)]+'\x20journey'+(_0x41f728[_0x263e59(0xc7)]!==0x1?'s':''));const _0x244dd0=_0x5d37b7=>{const _0x452343=_0x263e59;return getConsoleNextUrl(_0x479649[_0x452343(0xce)],_0x452343(0x102)+_0x5540f4['parentId']+_0x452343(0xcb)+_0x5d37b7);},_0x1883fc=_0x3ad74a=>{const _0x38d8ff=_0x263e59;return getConsoleNextUrl(_0x479649['site'],_0x38d8ff(0x102)+_0x5540f4[_0x38d8ff(0xee)]+_0x38d8ff(0xcb)+_0x3ad74a+'/j/da');};if(_0x479649['format']==='json'||_0x479649[_0x263e59(0xf7)]===_0x263e59(0xca))await handleSDKOutput(_0x7bf69a,_0x479649);else{console[_0x263e59(0xe7)](a45_0x5f581b[_0x263e59(0xff)]('['+_0x4bf438+']'));const _0x399965=formatTree(_0x7bf69a,{'showMetadata':!![],'getSegmentUrl':_0x244dd0,'getJourneyUrl':_0x1883fc});console[_0x263e59(0xe7)](_0x399965);}return 0x0;}}
|
package/dist/commands/show.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a46_0x43fdb5=a46_0x5072;function a46_0x5072(_0xa7c9f2,_0x3f31b8){_0xa7c9f2=_0xa7c9f2-0xda;const _0x5cdf30=a46_0x5cdf();let _0x5072ff=_0x5cdf30[_0xa7c9f2];return _0x5072ff;}(function(_0x568bda,_0x1ed4e5){const _0x1a4b1a=a46_0x5072,_0x16bdf1=_0x568bda();while(!![]){try{const _0x20700c=-parseInt(_0x1a4b1a(0xe4))/0x1+parseInt(_0x1a4b1a(0xf8))/0x2*(-parseInt(_0x1a4b1a(0xdd))/0x3)+parseInt(_0x1a4b1a(0xdf))/0x4*(parseInt(_0x1a4b1a(0xf1))/0x5)+parseInt(_0x1a4b1a(0xe2))/0x6+-parseInt(_0x1a4b1a(0xfe))/0x7+-parseInt(_0x1a4b1a(0xe6))/0x8*(-parseInt(_0x1a4b1a(0xe9))/0x9)+-parseInt(_0x1a4b1a(0xf6))/0xa;if(_0x20700c===_0x1ed4e5)break;else _0x16bdf1['push'](_0x16bdf1['shift']());}catch(_0x327ec7){_0x16bdf1['push'](_0x16bdf1['shift']());}}}(a46_0x5cdf,0x37aa1));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{[a46_0x43fdb5(0xf0)]=a46_0x43fdb5(0xda);[a46_0x43fdb5(0xff)]=a46_0x43fdb5(0xdc);async[a46_0x43fdb5(0xef)](_0x4d2814){const _0x4574fe=a46_0x43fdb5;return this[_0x4574fe(0x102)](_0x4d2814);}async[a46_0x43fdb5(0x102)](_0x4598a6){const _0x547c36=a46_0x43fdb5,{options:_0x1b1879,args:_0x2bc746,tdx:_0x12e51f}=_0x4598a6;let _0x5a5a77;try{_0x5a5a77=parseTableReference(_0x2bc746[0x0]);const _0x60438a=_0x1b1879['database'];!_0x5a5a77[_0x547c36(0xea)]&&_0x60438a&&(_0x5a5a77[_0x547c36(0xea)]=_0x60438a);const _0x39c370=validateTableDescribeReference(_0x5a5a77);if(_0x39c370)return console[_0x547c36(0xec)](_0x547c36(0xed)+_0x39c370),console[_0x547c36(0xec)](_0x547c36(0xdb)),console[_0x547c36(0xec)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console['error'](_0x547c36(0xe0)),0x1;}catch(_0xc0d029){return console[_0x547c36(0xec)](_0x547c36(0xed)+_0xc0d029[_0x547c36(0xfc)]),console[_0x547c36(0xec)]('Usage:\x20tdx\x20show\x20<database.table>'),console[_0x547c36(0xec)]('\x20\x20\x20or:\x20tdx\x20show\x20<catalog.database.table>'),console[_0x547c36(0xec)](_0x547c36(0xe0)),0x1;}const _0x32f6a2=_0x5a5a77[_0x547c36(0xe7)],_0x4caf9c=_0x5a5a77[_0x547c36(0xea)],_0x325821=_0x5a5a77[_0x547c36(0xf2)],_0x214ebf=resolveLimit(_0x1b1879[_0x547c36(0xde)],DEFAULT_DISPLAY_LIMIT);try{_0x1b1879[_0x547c36(0xfd)]&&(console['error']('Site:\x20'+_0x1b1879['site']),_0x32f6a2&&console[_0x547c36(0xec)]('Catalog:\x20'+_0x32f6a2),console['error']('Database:\x20'+_0x4caf9c),console[_0x547c36(0xec)](_0x547c36(0xeb)+_0x325821),console[_0x547c36(0xec)](_0x547c36(0xee)+_0x214ebf));const _0x23bdfa=_0x32f6a2?_0x32f6a2+'.'+_0x4caf9c+'.'+_0x325821:_0x4caf9c+'.'+_0x325821,_0x10309f=await withSpinner(_0x547c36(0x101)+_0x23bdfa+_0x547c36(0xfa),()=>_0x12e51f[_0x547c36(0xe8)][_0x547c36(0x102)](_0x4caf9c,_0x325821,_0x214ebf,_0x32f6a2),{'verbose':_0x1b1879[_0x547c36(0xfd)]}),_0x830495=_0x10309f[_0x547c36(0xf3)],_0x534d05=_0x830495[_0x547c36(0xf3)];return _0x534d05['length']===0x0?console[_0x547c36(0xec)](_0x547c36(0xe1)):console[_0x547c36(0xec)](_0x547c36(0xf7)+_0x534d05[_0x547c36(0xe5)]+_0x547c36(0x100)+(_0x534d05[_0x547c36(0xe5)]!==0x1?'s':'')+_0x547c36(0xfb)+_0x23bdfa),await handleSDKOutput(_0x534d05,_0x1b1879),0x0;}catch(_0x2d7d7a){if(_0x2d7d7a instanceof SDKError)return console[_0x547c36(0xec)](_0x547c36(0xed)+_0x2d7d7a[_0x547c36(0xfc)]),_0x2d7d7a[_0x547c36(0xf4)]&&console[_0x547c36(0xec)]('\x20\x20Cause:\x20'+_0x2d7d7a['cause']),0x1;throw _0x2d7d7a;}}[a46_0x43fdb5(0xf5)](_0x578fc6){const _0x4ccf8c=a46_0x43fdb5;if(_0x578fc6[_0x4ccf8c(0xe3)][_0x4ccf8c(0xe5)]===0x0)return'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';if(_0x578fc6['args']['length']>0x1)return _0x4ccf8c(0xf9);return undefined;}}function a46_0x5cdf(){const _0x31cbe1=['16rBIxUA','catalog','query','1531377wvFfQY','database','Table:\x20','error','Error:\x20','Limit:\x20','execute','name','367860htyGRZ','table','data','cause','validate','2813900FxvawP','✔\x20Retrieved\x20','2IRRjDP','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','...','\x20from\x20','message','verbose','2623509ElUMyD','description','\x20row','Querying\x20','showTable','show','Usage:\x20tdx\x20show\x20<database.table>','Show\x20table\x20contents','2868aemxTZ','limit','24KYyogw','\x20\x20\x20or:\x20tdx\x20show\x20<table>\x20--database\x20<database>','✔\x20Query\x20successful\x20-\x200\x20rows\x20returned','1844544yZplec','args','204028PXTHgo','length'];a46_0x5cdf=function(){return _0x31cbe1;};return a46_0x5cdf();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a47_0x162d2a=a47_0x3760;(function(_0x34c0a1,_0x2c79ee){const _0x375538=a47_0x3760,_0x3afdbd=_0x34c0a1();while(!![]){try{const _0x3a8ea5=-parseInt(_0x375538(0xcb))/0x1*(-parseInt(_0x375538(0xdf))/0x2)+parseInt(_0x375538(0xd5))/0x3*(-parseInt(_0x375538(0xd7))/0x4)+-parseInt(_0x375538(0xd0))/0x5+parseInt(_0x375538(0xe3))/0x6*(parseInt(_0x375538(0xbc))/0x7)+-parseInt(_0x375538(0xdb))/0x8+-parseInt(_0x375538(0xce))/0x9+parseInt(_0x375538(0xe1))/0xa;if(_0x3a8ea5===_0x2c79ee)break;else _0x3afdbd['push'](_0x3afdbd['shift']());}catch(_0x738ceb){_0x3afdbd['push'](_0x3afdbd['shift']());}}}(a47_0x3154,0x615be));import{BaseCommand,printAuthError}from'./command.js';import{resolveAPIKeyAsync}from'../core/config.js';import{getOAuthTokens}from'../core/oauth-keychain.js';function a47_0x3760(_0x186ca3,_0x1a4e20){_0x186ca3=_0x186ca3-0xba;const _0x3154ed=a47_0x3154();let _0x376016=_0x3154ed[_0x186ca3];return _0x376016;}import{HTTPClientError}from'../sdk/client/http-client.js';import{GlobalContext}from'../core/global-context.js';import a47_0x41d1df from'chalk';function a47_0x3154(){const _0x33a2d0=['✓\x20Authentication\x20successful\x0a','session','green','Credential\x20type:\x20','status','No\x20credential\x20found','✗\x20Validation\x20failed:\x20','profileSource','getUserInfo','dim','profile','(from\x20','32866XBBPhg','Show\x20authentication\x20status\x20and\x20current\x20context','Name:','2253987GwmOrh','displayWithSources','1269430krRdrB','site:\x20','account_id','yellow','description','2397erAHWG','jobs','3852ZIWXSW','bold','filter','env','5393328WugEzP','message','cyan','last_name','26BmeNBc','name','17736670DrVpFw','Account\x20ID:','2118boRbKR','join','Read\x20credential\x20from\x20','User:','red','N/A','config','first_name','log','2891DfqCNR','CLI\x20flag','TDX_PROFILE\x20env'];a47_0x3154=function(){return _0x33a2d0;};return a47_0x3154();}export class StatusCommand extends BaseCommand{[a47_0x162d2a(0xe0)]=a47_0x162d2a(0xc3);[a47_0x162d2a(0xd4)]=a47_0x162d2a(0xcc);async['execute'](_0x33e1e4){const _0x2843ac=a47_0x162d2a,{options:_0x4db0aa,tdx:_0x364895}=_0x33e1e4,_0x73bcf2=_0x4db0aa['site'],_0x1480ae=new GlobalContext(_0x4db0aa),_0x4e55c0=_0x1480ae[_0x2843ac(0xc9)],_0xfb66f2=_0x1480ae[_0x2843ac(0xc6)],_0x5e59ae=_0xfb66f2==='cli'?_0x2843ac(0xbd):_0xfb66f2==='session'?_0x2843ac(0xc0):_0xfb66f2===_0x2843ac(0xda)?_0x2843ac(0xbe):_0xfb66f2===_0x2843ac(0xe9)?_0x2843ac(0xe9):null,_0x5be315=_0x4e55c0?a47_0x41d1df[_0x2843ac(0xdd)](_0x4e55c0):a47_0x41d1df[_0x2843ac(0xc8)](_0x2843ac(0xe8)),_0x26a1b1=_0x5e59ae?'\x20'+a47_0x41d1df[_0x2843ac(0xc8)](_0x2843ac(0xca)+_0x5e59ae+')'):'';console[_0x2843ac(0xbb)](a47_0x41d1df[_0x2843ac(0xd8)]('tdx')+'\x20profile:\x20'+_0x5be315+_0x26a1b1+'\x20'+a47_0x41d1df[_0x2843ac(0xc8)]('(')+_0x2843ac(0xd1)+a47_0x41d1df['cyan'](_0x73bcf2)+a47_0x41d1df[_0x2843ac(0xc8)](')'));const _0x321116=await getOAuthTokens(_0x4e55c0);if(_0x321116)console[_0x2843ac(0xbb)](_0x2843ac(0xc2)+a47_0x41d1df[_0x2843ac(0xdd)]('OAuth'));else{const _0x1cbd60=await resolveAPIKeyAsync(_0x73bcf2,_0x4e55c0);if(_0x1cbd60){const {source:_0x50b4e7,isDeprecated:_0x1d87fe}=_0x1cbd60,_0x1e3506=_0x2843ac(0xe5)+a47_0x41d1df[_0x2843ac(0xdd)](_0x50b4e7);console[_0x2843ac(0xbb)](_0x1d87fe?a47_0x41d1df[_0x2843ac(0xd3)](_0x1e3506):_0x1e3506);}else console[_0x2843ac(0xbb)](a47_0x41d1df['yellow'](_0x2843ac(0xc4)));}let _0x54315f=![];try{const _0x4f1f44=await _0x364895[_0x2843ac(0xd6)][_0x2843ac(0xc7)]();console['log'](a47_0x41d1df[_0x2843ac(0xc1)](_0x2843ac(0xbf))),console[_0x2843ac(0xbb)](a47_0x41d1df[_0x2843ac(0xd8)](_0x2843ac(0xe6))+'\x20'+a47_0x41d1df[_0x2843ac(0xdd)](_0x4f1f44['email']));if(_0x4f1f44[_0x2843ac(0xba)]||_0x4f1f44[_0x2843ac(0xde)]){const _0x33a457=[_0x4f1f44['first_name'],_0x4f1f44[_0x2843ac(0xde)]][_0x2843ac(0xd9)](Boolean)[_0x2843ac(0xe4)]('\x20');console['log'](a47_0x41d1df['bold'](_0x2843ac(0xcd))+'\x20'+_0x33a457);}_0x4f1f44[_0x2843ac(0xd2)]&&console[_0x2843ac(0xbb)](a47_0x41d1df[_0x2843ac(0xd8)](_0x2843ac(0xe2))+'\x20'+a47_0x41d1df[_0x2843ac(0xd3)](_0x4f1f44[_0x2843ac(0xd2)])),_0x54315f=!![];}catch(_0x739716){_0x739716 instanceof HTTPClientError&&_0x739716[_0x2843ac(0xc3)]===0x191?printAuthError(_0x739716,!![],_0x4e55c0):console['error'](a47_0x41d1df[_0x2843ac(0xe7)](_0x2843ac(0xc5)+(_0x739716 instanceof Error?_0x739716[_0x2843ac(0xdc)]:String(_0x739716))));}return console[_0x2843ac(0xbb)](),_0x1480ae[_0x2843ac(0xcf)](),_0x54315f?0x0:0x1;}}
|