@treasuredata/tdx 2026.4.11 → 2026.4.13
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.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/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.d.ts +6 -0
- package/dist/sdk/journey.d.ts.map +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/journey.js.map +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 +2 -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/access-tracker.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.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.d.ts.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/templates.js.map +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
|
-
|
|
1
|
+
const a17_0x4a6579=a17_0x540e;(function(_0x275e24,_0x37d2fc){const _0x283c43=a17_0x540e,_0x57e81c=_0x275e24();while(!![]){try{const _0x5a2838=-parseInt(_0x283c43(0x16f))/0x1*(parseInt(_0x283c43(0x15f))/0x2)+parseInt(_0x283c43(0x164))/0x3*(-parseInt(_0x283c43(0x170))/0x4)+parseInt(_0x283c43(0x166))/0x5+-parseInt(_0x283c43(0x162))/0x6*(-parseInt(_0x283c43(0x16c))/0x7)+parseInt(_0x283c43(0x16e))/0x8+parseInt(_0x283c43(0x165))/0x9+-parseInt(_0x283c43(0x172))/0xa*(-parseInt(_0x283c43(0x169))/0xb);if(_0x5a2838===_0x37d2fc)break;else _0x57e81c['push'](_0x57e81c['shift']());}catch(_0x4b8c73){_0x57e81c['push'](_0x57e81c['shift']());}}}(a17_0x2f01,0x21a70));function a17_0x540e(_0x323737,_0x44d337){_0x323737=_0x323737-0x15e;const _0x2f0176=a17_0x2f01();let _0x540ec0=_0x2f0176[_0x323737];return _0x540ec0;}function a17_0x2f01(){const _0x5902f6=['1841utPGVS','129652yxQzDo','name','480830FEEjec','verbose','List\x20email\x20senders','294idDNbO','delivery','Fetching\x20email\x20senders...','181122wriqtl','delivery:senders','9ulOgqZ','1617273kjlKYb','692355qjKJsG','description','data','11vMTNAQ','limit','filter','21PzNXat','execute','391152fLUBpQ'];a17_0x2f01=function(){return _0x5902f6;};return a17_0x2f01();}import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{resolveWorkspaceIdFromOptions}from'./engage-command.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';export class DeliveryEmailSendersCommand extends BaseCommand{['name']=a17_0x4a6579(0x163);[a17_0x4a6579(0x167)]=a17_0x4a6579(0x15e);async[a17_0x4a6579(0x16d)](_0x1aa906){const _0x552f2b=a17_0x4a6579,{options:_0x42ea77,args:_0x5189da,tdx:_0x1791bb}=_0x1aa906,_0x212915=_0x5189da[0x0],_0x363308=resolveLimit(_0x42ea77[_0x552f2b(0x16a)],DEFAULT_LLM_LIMIT),_0x10a1e0=_0x42ea77,_0xcba9a2=await resolveWorkspaceIdFromOptions(_0x10a1e0,_0x1791bb),_0x3043a2=await withSpinner(_0x552f2b(0x161),()=>_0x1791bb[_0x552f2b(0x160)]['listEmailSenders']({'workspaceId':_0xcba9a2,'limit':_0x363308}),{'verbose':_0x42ea77[_0x552f2b(0x173)]});let _0x167fe2=_0x3043a2[_0x552f2b(0x168)];return _0x212915&&(_0x167fe2=_0x3043a2['data'][_0x552f2b(0x16b)](_0x227121=>matchGlobPattern(_0x227121[_0x552f2b(0x171)],_0x212915))),await handleSDKOutput(_0x167fe2,_0x42ea77),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a18_0x47f336=a18_0x50d3;(function(_0x11f717,_0x2d1e40){const _0x1d6b14=a18_0x50d3,_0x1791a7=_0x11f717();while(!![]){try{const _0x11ca36=parseInt(_0x1d6b14(0x134))/0x1*(-parseInt(_0x1d6b14(0x12e))/0x2)+-parseInt(_0x1d6b14(0x128))/0x3+parseInt(_0x1d6b14(0x130))/0x4*(-parseInt(_0x1d6b14(0x12c))/0x5)+parseInt(_0x1d6b14(0x13a))/0x6+-parseInt(_0x1d6b14(0x123))/0x7+parseInt(_0x1d6b14(0x140))/0x8*(parseInt(_0x1d6b14(0x138))/0x9)+parseInt(_0x1d6b14(0x11c))/0xa*(parseInt(_0x1d6b14(0x132))/0xb);if(_0x11ca36===_0x2d1e40)break;else _0x1791a7['push'](_0x1791a7['shift']());}catch(_0x136082){_0x1791a7['push'](_0x1791a7['shift']());}}}(a18_0x3f18,0x2e8f6));import{BaseCommand}from'./command.js';function a18_0x50d3(_0x569bae,_0x3ae9a0){_0x569bae=_0x569bae-0x11b;const _0x3f1840=a18_0x3f18();let _0x50d30b=_0x3f1840[_0x569bae];return _0x50d30b;}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';export class DescribeCommand extends BaseCommand{[a18_0x47f336(0x136)]='describe';[a18_0x47f336(0x131)]=a18_0x47f336(0x135);async[a18_0x47f336(0x129)](_0x24d0a9){const _0x45cd5e=a18_0x47f336;return this[_0x45cd5e(0x11e)](_0x24d0a9);}async['describeTable'](_0x138164){const _0x5672e3=a18_0x47f336,{options:_0x3e8281,args:_0x5e4d26,tdx:_0x25ed94}=_0x138164;let _0x324f47;try{_0x324f47=parseTableReference(_0x5e4d26[0x0]);const _0x45b32e=_0x3e8281[_0x5672e3(0x124)];!_0x324f47[_0x5672e3(0x124)]&&_0x45b32e&&(_0x324f47[_0x5672e3(0x124)]=_0x45b32e);const _0x2cf31e=validateTableDescribeReference(_0x324f47);if(_0x2cf31e)return console[_0x5672e3(0x127)](_0x5672e3(0x12a)+_0x2cf31e),0x1;}catch(_0x1fbe7d){return console[_0x5672e3(0x127)]('Error:\x20'+_0x1fbe7d[_0x5672e3(0x11d)]),0x1;}const _0x1a14c2=_0x324f47[_0x5672e3(0x124)],_0x5340da=_0x324f47[_0x5672e3(0x120)];try{_0x3e8281[_0x5672e3(0x125)]&&(console['error'](_0x5672e3(0x13f)+_0x3e8281[_0x5672e3(0x12f)]),console['error'](_0x5672e3(0x11f)+_0x1a14c2),console[_0x5672e3(0x127)](_0x5672e3(0x121)+_0x5340da));const _0xe76fd5=await withSpinner(_0x5672e3(0x11b)+_0x1a14c2+'.'+_0x5340da+'...',()=>_0x25ed94['query']['describeTable'](_0x1a14c2,_0x5340da),{'verbose':_0x3e8281[_0x5672e3(0x125)]}),_0x3ebd1d=_0xe76fd5[_0x5672e3(0x133)];if(_0x3ebd1d[_0x5672e3(0x13b)]===0x0)return console[_0x5672e3(0x127)]('✖\x20Table\x20not\x20found'),console[_0x5672e3(0x127)]('Table\x20\x27'+_0x1a14c2+'.'+_0x5340da+_0x5672e3(0x12b)),0x1;return console[_0x5672e3(0x127)](_0x5672e3(0x13c)+_0x3ebd1d[_0x5672e3(0x13b)]+_0x5672e3(0x137)+(_0x3ebd1d[_0x5672e3(0x13b)]!==0x1?'s':'')+'\x20in\x20'+_0x1a14c2+'.'+_0x5340da),await handleSDKOutput(_0x3ebd1d,_0x3e8281),0x0;}catch(_0x165e0e){if(_0x165e0e instanceof SDKError)return console['error'](_0x5672e3(0x12a)+_0x165e0e[_0x5672e3(0x11d)]),_0x165e0e[_0x5672e3(0x126)]&&console[_0x5672e3(0x127)](_0x5672e3(0x139)+_0x165e0e[_0x5672e3(0x126)]),0x1;throw _0x165e0e;}}[a18_0x47f336(0x13d)](_0x368732){const _0x2ff800=a18_0x47f336;if(_0x368732[_0x2ff800(0x13e)][_0x2ff800(0x13b)]===0x0)return _0x2ff800(0x122);if(_0x368732[_0x2ff800(0x13e)][_0x2ff800(0x13b)]>0x1)return _0x2ff800(0x12d);return undefined;}}function a18_0x3f18(){const _0x74ce9f=['1pUrybh','Describe\x20table\x20schema','name','\x20column','1190025fqcfWI','\x20\x20Cause:\x20','45900sgXWXw','length','✔\x20Found\x20','validate','args','Site:\x20','8zdywTD','Describing\x20table\x20','80sdeaKB','message','describeTable','Database:\x20','table','Table:\x20','Usage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--in\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','590303FOrcTo','database','verbose','cause','error','901191quyxvK','execute','Error:\x20','\x27\x20does\x20not\x20exist','90xYhWrt','Too\x20many\x20arguments\x0aUsage:\x20tdx\x20describe\x20<database.table>\x0a\x20\x20\x20or:\x20tdx\x20describe\x20<table>\x20--database\x20<database>\x0a\x0aRun\x20\x27tdx\x20describe\x20--help\x27\x20for\x20more\x20options','411962gLMRam','site','18868jJqbxK','description','998866HbXDXI','data'];a18_0x3f18=function(){return _0x74ce9f;};return a18_0x3f18();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x3b00fa=a19_0x3898;(function(_0x4da39a,_0x5c2ad1){const _0x287c98=a19_0x3898,_0x2d7a45=_0x4da39a();while(!![]){try{const _0xc082fc=parseInt(_0x287c98(0x1e0))/0x1+-parseInt(_0x287c98(0x1d4))/0x2+-parseInt(_0x287c98(0x1e6))/0x3*(parseInt(_0x287c98(0x1e1))/0x4)+parseInt(_0x287c98(0x206))/0x5+parseInt(_0x287c98(0x1ea))/0x6+-parseInt(_0x287c98(0x1f4))/0x7*(-parseInt(_0x287c98(0x1fe))/0x8)+parseInt(_0x287c98(0x1f0))/0x9*(-parseInt(_0x287c98(0x1f5))/0xa);if(_0xc082fc===_0x5c2ad1)break;else _0x2d7a45['push'](_0x2d7a45['shift']());}catch(_0x24bde9){_0x2d7a45['push'](_0x2d7a45['shift']());}}}(a19_0x8fbc,0x88001));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import a19_0x11cd59 from'chalk';function a19_0x8fbc(){const _0x2546a5=['Aborted.','Pulling\x20campaigns\x20from\x20\x27','utf-8','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','engage_workspace','594426VXjMsd','workspace','\x0aError:','execute','hasChanges','files','\x0aUsage:\x20tdx\x20engage\x20campaign\x20pull\x20<workspace-name>','\x20files\x20to\x20','absolutePath','content','\x0aChanges\x20to\x20\x27','error','648032LWOXVM','23176kYtuMx','Write\x20','segment','dryRun','targetDir','207LCfiIQ','\x0aPull\x20summary\x20for\x20workspace\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','yes','2610588NjPVVD','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','diff','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','dim','\x20files?','9UjOHGI','\x20=\x20','\x27...','\x20unchanged\x20files','217MsgJBg','1441270KlUDfs','campaigns','filter','dirname','length','data','isNew','relativePath','session','57560SNgVJg','\x20new\x20files','green','description','\x20campaigns','✔\x20Pulled\x20','config','Workspace\x20is\x20required.','460040PCfwWU','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20pull\x20--workspace\x20<name>','repeat','setPhase','cyan','name','yellow','counts','-\x20no\x20files\x20written','Pull\x20campaigns\x20to\x20YAML\x20files','engage','No\x20campaigns\x20found\x20in\x20workspace\x20\x27','\x20changed\x20files','workspaceName'];a19_0x8fbc=function(){return _0x2546a5;};return a19_0x8fbc();}import{existsSync,mkdirSync,writeFileSync}from'fs';function a19_0x3898(_0x1bab6a,_0x333fac){_0x1bab6a=_0x1bab6a-0x1d2;const _0x8fbc0e=a19_0x8fbc();let _0x38988d=_0x8fbc0e[_0x1bab6a];return _0x38988d;}import a19_0x1095d5 from'path';import{pullCampaigns}from'../sdk/engage/campaign-pull.js';export class EngageCampaignPullCommand extends BaseCommand{['name']='engage:campaign:pull';[a19_0x3b00fa(0x201)]=a19_0x3b00fa(0x20f);async[a19_0x3b00fa(0x1d7)](_0x507f02){const _0x36cc81=a19_0x3b00fa,{options:_0xe9888e,args:_0x4f6d3b,tdx:_0xcb8719}=_0x507f02,_0x2ceeec=_0xe9888e,_0x49527f=await resolveWorkspaceName(_0x4f6d3b[0x0],_0x2ceeec);if(!_0x49527f)return console[_0x36cc81(0x1df)](a19_0x11cd59['yellow'](_0x36cc81(0x205))),console[_0x36cc81(0x1df)](_0x36cc81(0x1da)),console[_0x36cc81(0x1df)](_0x36cc81(0x207)),console[_0x36cc81(0x1df)](_0x36cc81(0x1d2)),0x1;const _0x3026ed=await withProgressSpinner(_0x36cc81(0x215)+_0x49527f+_0x36cc81(0x1f2),_0xcb136e=>pullCampaigns({'engage':_0xcb8719[_0x36cc81(0x210)],'segment':_0xcb8719[_0x36cc81(0x1e3)]},_0x49527f,{'campaignName':_0x2ceeec[_0x36cc81(0x20b)],'campaignType':_0x2ceeec['type'],'progress':{'update':_0x41cc6b=>{const _0x131ca6=_0x36cc81;_0xcb136e[_0x131ca6(0x209)](_0x41cc6b);}}}),{'verbose':_0x2ceeec['verbose']}),_0x1c45f3=_0x3026ed[_0x36cc81(0x1fa)];if(_0x1c45f3[_0x36cc81(0x20d)][_0x36cc81(0x1f6)]===0x0)return console['error'](a19_0x11cd59[_0x36cc81(0x20c)](_0x36cc81(0x211)+_0x1c45f3[_0x36cc81(0x213)]+'\x27')),0x0;const _0x67345e=_0x1c45f3[_0x36cc81(0x1d9)]['filter'](_0x17ba33=>_0x17ba33[_0x36cc81(0x1fb)]),_0x2d5574=_0x1c45f3['files'][_0x36cc81(0x1f7)](_0x3d7ab4=>!_0x3d7ab4[_0x36cc81(0x1fb)]&&_0x3d7ab4[_0x36cc81(0x1d8)]),_0xce476a=_0x1c45f3['files'][_0x36cc81(0x1f7)](_0x222f9d=>!_0x222f9d[_0x36cc81(0x1fb)]&&!_0x222f9d[_0x36cc81(0x1d8)]);console[_0x36cc81(0x1df)](_0x36cc81(0x1e7)+_0x1c45f3[_0x36cc81(0x213)]+'\x27:'),console[_0x36cc81(0x1df)]('\x20\x20'+a19_0x11cd59[_0x36cc81(0x20a)](_0x1c45f3['counts'][_0x36cc81(0x1f6)]+_0x36cc81(0x202))),console[_0x36cc81(0x1df)]('\x20\x20'+a19_0x11cd59[_0x36cc81(0x200)]('+\x20'+_0x67345e[_0x36cc81(0x1f9)]+_0x36cc81(0x1ff))),console[_0x36cc81(0x1df)]('\x20\x20'+a19_0x11cd59['yellow']('~\x20'+_0x2d5574[_0x36cc81(0x1f9)]+_0x36cc81(0x212))),console[_0x36cc81(0x1df)]('\x20\x20'+a19_0x11cd59[_0x36cc81(0x1ee)]('=\x20'+_0xce476a['length']+_0x36cc81(0x1f3))),console[_0x36cc81(0x1df)]('\x20\x20Target:\x20'+a19_0x11cd59['cyan'](_0x1c45f3[_0x36cc81(0x1e5)])+'\x0a');if(_0x2d5574[_0x36cc81(0x1f9)]>0x0)for(const _0x1967bb of _0x2d5574){console[_0x36cc81(0x1df)](_0x36cc81(0x1de)+_0x1967bb[_0x36cc81(0x1fc)]+'\x27:'),console[_0x36cc81(0x1df)]('─'[_0x36cc81(0x208)](0x3c)),console[_0x36cc81(0x1df)](_0x1967bb[_0x36cc81(0x1ec)]),console[_0x36cc81(0x1df)]('─'['repeat'](0x3c));}if(_0x2ceeec[_0x36cc81(0x1e4)])return console[_0x36cc81(0x1df)](a19_0x11cd59[_0x36cc81(0x20c)](_0x36cc81(0x1ed))),0x0;if(_0x67345e[_0x36cc81(0x1f9)]===0x0&&_0x2d5574[_0x36cc81(0x1f9)]===0x0)return console[_0x36cc81(0x1df)](a19_0x11cd59[_0x36cc81(0x200)](_0x36cc81(0x1e8))),saveSessionContext({'engage_workspace':_0x1c45f3[_0x36cc81(0x213)]},_0x2ceeec[_0x36cc81(0x1fd)]),0x0;if(!_0x2ceeec[_0x36cc81(0x1e9)]){if(!isInteractive())return console[_0x36cc81(0x1df)](a19_0x11cd59['red'](_0x36cc81(0x1d6)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x36cc81(0x1df)](a19_0x11cd59[_0x36cc81(0x1ee)](_0x36cc81(0x1eb))),0x1;const _0x3474a6=await confirmKey(_0x36cc81(0x1e2)+(_0x67345e['length']+_0x2d5574[_0x36cc81(0x1f9)])+_0x36cc81(0x1ef));if(!_0x3474a6)return console[_0x36cc81(0x1df)](a19_0x11cd59[_0x36cc81(0x20c)](_0x36cc81(0x214)),_0x36cc81(0x20e)),0x1;}for(const _0xb64480 of _0x1c45f3[_0x36cc81(0x1d9)]){if(_0xb64480[_0x36cc81(0x1fb)]||_0xb64480['hasChanges']){const _0x5e5679=a19_0x1095d5[_0x36cc81(0x1f8)](_0xb64480[_0x36cc81(0x1dc)]);!existsSync(_0x5e5679)&&mkdirSync(_0x5e5679,{'recursive':!![]}),writeFileSync(_0xb64480['absolutePath'],_0xb64480[_0x36cc81(0x1dd)],_0x36cc81(0x216));}}return console[_0x36cc81(0x1df)](a19_0x11cd59['green'](_0x36cc81(0x203)+(_0x67345e[_0x36cc81(0x1f9)]+_0x2d5574[_0x36cc81(0x1f9)])+_0x36cc81(0x1db)+_0x1c45f3[_0x36cc81(0x1e5)])),saveSessionContext({'engage_workspace':_0x1c45f3[_0x36cc81(0x213)]},_0x2ceeec['session']),console['error'](a19_0x11cd59[_0x36cc81(0x200)]('✔\x20Context\x20set:\x20'+a19_0x11cd59[_0x36cc81(0x1ee)](_0x36cc81(0x1d3))+_0x36cc81(0x1f1)+a19_0x11cd59['cyan'](_0x1c45f3[_0x36cc81(0x213)]))),0x0;}}async function resolveWorkspaceName(_0x71d96e,_0x26c183){const _0x3af6e6=a19_0x3b00fa;if(_0x71d96e)return _0x71d96e;if(_0x26c183[_0x3af6e6(0x1d5)])return _0x26c183[_0x3af6e6(0x1d5)];const _0x5ca829=tryFindTdxConfig(process['cwd']());if(_0x5ca829?.['config']['engage_workspace'])return _0x5ca829[_0x3af6e6(0x204)]['engage_workspace'];const _0x203ef5=loadSessionContext(_0x26c183[_0x3af6e6(0x1fd)]);if(_0x203ef5?.[_0x3af6e6(0x1d3)])return _0x203ef5[_0x3af6e6(0x1d3)];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a20_0x295c7b=a20_0x45d9;(function(_0x107956,_0x56d479){const _0x17785a=a20_0x45d9,_0x443d15=_0x107956();while(!![]){try{const _0x4ded5c=-parseInt(_0x17785a(0xcc))/0x1+-parseInt(_0x17785a(0xd7))/0x2*(parseInt(_0x17785a(0x105))/0x3)+parseInt(_0x17785a(0x103))/0x4*(parseInt(_0x17785a(0x101))/0x5)+parseInt(_0x17785a(0xf3))/0x6+parseInt(_0x17785a(0xf7))/0x7+-parseInt(_0x17785a(0xd9))/0x8+parseInt(_0x17785a(0xfe))/0x9;if(_0x4ded5c===_0x56d479)break;else _0x443d15['push'](_0x443d15['shift']());}catch(_0x438cd6){_0x443d15['push'](_0x443d15['shift']());}}}(a20_0x1192,0xb2eb3));function a20_0x1192(){const _0x455af0=['created','update','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','filter','5542458MPKNyG','1\x20campaign\x20file:\x20','dirname','campaignId','5484521QfebnY','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','Found\x20','config','\x20campaigns','results','setPhase','8831781smusZP','Push\x20','updated','335FlKrNa','cwd','7748HmSbQl','message','102327SSdFNl','-\x20no\x20changes\x20applied','errors','configDir','red','dim','segment','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x0aPush\x20summary\x20for\x20workspace\x20\x27','Aborted.','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','green','649803bcXxKV','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','yellow','description','relativePath','length','\x27...','✔\x20Updated\x20','error','def','Resolving\x20references...','24gcLzYm','engage_workspace','8210976ShmWow','\x20\x20\x20\x20','execute','data','create','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','\x0aError:','\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','resolveWorkspaceId','yes','map','path','engage','Workspace\x20is\x20required.','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','\x20campaign\x20files','\x20errors:','verbose','session','action','name','campaign_type'];a20_0x1192=function(){return _0x455af0;};return a20_0x1192();}import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a20_0x45d9(_0x5ee901,_0x33587b){_0x5ee901=_0x5ee901-0xc8;const _0x1192a2=a20_0x1192();let _0x45d9e6=_0x1192a2[_0x5ee901];return _0x45d9e6;}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a20_0x4db7e6 from'chalk';import a20_0x2caede from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';import{getCampaignUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageCampaignPushCommand extends BaseCommand{['name']='engage:campaign:push';[a20_0x295c7b(0xcf)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns';async[a20_0x295c7b(0xdb)](_0x11467e){const _0x57fa3a=a20_0x295c7b,{options:_0x3b49bd,args:_0x29abb4,tdx:_0x549f31}=_0x11467e,_0x239364=_0x3b49bd,_0x1b3705=_0x29abb4[0x0],_0x4c62dc=_0x1b3705?a20_0x2caede['resolve'](_0x1b3705):undefined,_0x51df5e=_0x4c62dc?isYamlFile(_0x4c62dc):![];let _0x3b8362;if(_0x51df5e&&_0x4c62dc)_0x3b8362=a20_0x2caede[_0x57fa3a(0xf5)](_0x4c62dc);else _0x4c62dc?_0x3b8362=_0x4c62dc:_0x3b8362=process[_0x57fa3a(0x102)]();let _0x25ab7f;const _0x3ed17d=tryFindTdxConfig(_0x3b8362);_0x3ed17d?.['config']['engage_workspace']&&(_0x25ab7f=_0x3ed17d[_0x57fa3a(0xfa)][_0x57fa3a(0xd8)],!_0x51df5e&&(_0x3b8362=_0x3ed17d[_0x57fa3a(0x108)]));_0x239364['workspace']&&(_0x25ab7f=_0x239364['workspace']);if(!_0x25ab7f){const _0x207428=loadSessionContext(_0x239364[_0x57fa3a(0xeb)]);_0x207428?.[_0x57fa3a(0xd8)]&&(_0x25ab7f=_0x207428[_0x57fa3a(0xd8)]);}if(!_0x25ab7f)return console[_0x57fa3a(0xd4)](a20_0x4db7e6['yellow'](_0x57fa3a(0xe6))),console[_0x57fa3a(0xd4)](_0x57fa3a(0xe0)),console[_0x57fa3a(0xd4)](_0x57fa3a(0xcd)),console[_0x57fa3a(0xd4)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace'),console['error'](_0x57fa3a(0x10c)),0x1;let _0x41797b;_0x51df5e&&_0x4c62dc?_0x41797b=[_0x4c62dc]:_0x41797b=discoverCampaignFiles(_0x3b8362);if(_0x41797b[_0x57fa3a(0xd1)]===0x0)return console[_0x57fa3a(0xd4)](a20_0x4db7e6[_0x57fa3a(0xce)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x3b8362)),console[_0x57fa3a(0xd4)](a20_0x4db7e6['dim']('Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.')),0x1;const _0xd5b43f=_0x41797b[_0x57fa3a(0xe3)](_0xa7f4de=>parseCampaignFile(_0xa7f4de,a20_0x2caede[_0x57fa3a(0xf5)](_0xa7f4de))),_0x5d231a=_0xd5b43f[_0x57fa3a(0xd1)]===0x1?_0x57fa3a(0xf4)+_0xd5b43f[0x0]['def']['name']:_0xd5b43f[_0x57fa3a(0xd1)]+_0x57fa3a(0xe8);console[_0x57fa3a(0xd4)](_0x57fa3a(0xf9)+a20_0x4db7e6['cyan'](_0x5d231a));let _0x39bb75=![];for(const _0x183696 of _0xd5b43f){const _0x1bb8ad=validateCampaignDef(_0x183696['def']);if(!_0x1bb8ad['valid']){_0x39bb75=!![],console['error'](a20_0x4db7e6[_0x57fa3a(0x109)]('\x0aValidation\x20errors\x20in\x20'+_0x183696[_0x57fa3a(0xd0)]+':'));for(const _0x2214db of _0x1bb8ad[_0x57fa3a(0x107)]){console[_0x57fa3a(0xd4)]('\x20\x20'+a20_0x4db7e6[_0x57fa3a(0x109)]('✗')+'\x20'+_0x2214db[_0x57fa3a(0xe4)]+':\x20'+_0x2214db[_0x57fa3a(0x104)]);}}for(const _0x180e9c of _0x1bb8ad['warnings']){console['error']('\x20\x20'+a20_0x4db7e6[_0x57fa3a(0xce)]('⚠')+'\x20'+_0x180e9c[_0x57fa3a(0xe4)]+':\x20'+_0x180e9c[_0x57fa3a(0x104)]);}}if(_0x39bb75)return console['error'](a20_0x4db7e6[_0x57fa3a(0x109)](_0x57fa3a(0xde))),0x1;const _0x593e48=await _0x549f31[_0x57fa3a(0xe5)][_0x57fa3a(0xe1)](_0x25ab7f),_0x136653=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x25ab7f+_0x57fa3a(0xd2),_0x12e778=>preparePush({'engage':_0x549f31['engage'],'segment':_0x549f31[_0x57fa3a(0x10b)]},_0xd5b43f,_0x593e48,{'progress':{'update':_0xe16924=>_0x12e778[_0x57fa3a(0xfd)](_0xe16924)}}),{'verbose':_0x239364[_0x57fa3a(0xea)]}),_0x456074=_0x136653[_0x57fa3a(0xdc)];await withProgressSpinner(_0x57fa3a(0xd6),_0x548f4b=>resolveAndBuildInputs({'engage':_0x549f31['engage'],'segment':_0x549f31[_0x57fa3a(0x10b)]},_0x456074,_0x593e48,{'progress':{'update':_0x4b1c5c=>_0x548f4b['setPhase'](_0x4b1c5c)}}),{'verbose':_0x239364[_0x57fa3a(0xea)]});const _0x2afee2=_0x456074[_0x57fa3a(0xf2)](_0x1e620a=>_0x1e620a[_0x57fa3a(0xec)]===_0x57fa3a(0xdd)),_0x2b0341=_0x456074[_0x57fa3a(0xf2)](_0x4bd61d=>_0x4bd61d[_0x57fa3a(0xec)]===_0x57fa3a(0xf0));console['error'](_0x57fa3a(0xc8)+_0x25ab7f+'\x27:');if(_0x2afee2[_0x57fa3a(0xd1)]>0x0){console[_0x57fa3a(0xd4)]('\x20\x20'+a20_0x4db7e6[_0x57fa3a(0xcb)]('+\x20'+_0x2afee2[_0x57fa3a(0xd1)]+'\x20new\x20campaigns:'));for(const _0x2b58a2 of _0x2afee2){console[_0x57fa3a(0xd4)](_0x57fa3a(0xda)+a20_0x4db7e6[_0x57fa3a(0xcb)]('+')+'\x20'+_0x2b58a2[_0x57fa3a(0xd5)][_0x57fa3a(0xed)]+'\x20('+_0x2b58a2['def'][_0x57fa3a(0xee)]+')');}}if(_0x2b0341[_0x57fa3a(0xd1)]>0x0){console[_0x57fa3a(0xd4)]('\x20\x20'+a20_0x4db7e6[_0x57fa3a(0xce)]('~\x20'+_0x2b0341['length']+'\x20campaigns\x20to\x20update:'));for(const _0x5e85a9 of _0x2b0341){console[_0x57fa3a(0xd4)](_0x57fa3a(0xda)+a20_0x4db7e6[_0x57fa3a(0xce)]('~')+'\x20'+_0x5e85a9[_0x57fa3a(0xd5)][_0x57fa3a(0xed)]+'\x20('+_0x5e85a9['def'][_0x57fa3a(0xee)]+')');}}if(_0x2afee2[_0x57fa3a(0xd1)]===0x0&&_0x2b0341[_0x57fa3a(0xd1)]===0x0)return console['error'](a20_0x4db7e6[_0x57fa3a(0xcb)](_0x57fa3a(0xf8))),0x0;if(_0x239364['dryRun'])return console[_0x57fa3a(0xd4)](a20_0x4db7e6[_0x57fa3a(0xce)](_0x57fa3a(0xe7))),0x0;if(!_0x239364[_0x57fa3a(0xe2)]){if(!isInteractive())return console[_0x57fa3a(0xd4)](a20_0x4db7e6['red'](_0x57fa3a(0xdf)),_0x57fa3a(0xf1)),console[_0x57fa3a(0xd4)](a20_0x4db7e6[_0x57fa3a(0x10a)](_0x57fa3a(0xca))),0x1;const _0x550238=await confirmKey(_0x57fa3a(0xff)+(_0x2afee2[_0x57fa3a(0xd1)]+_0x2b0341[_0x57fa3a(0xd1)])+'\x20campaigns?');if(!_0x550238)return console[_0x57fa3a(0xd4)](a20_0x4db7e6[_0x57fa3a(0xce)](_0x57fa3a(0xc9)),_0x57fa3a(0x106)),0x1;}const _0x37d60e=await withProgressSpinner('Pushing\x20campaigns...',_0x429ddf=>executePush({'engage':_0x549f31[_0x57fa3a(0xe5)],'segment':_0x549f31[_0x57fa3a(0x10b)]},_0x456074,{'progress':{'update':_0x3ff3db=>_0x429ddf['setPhase'](_0x3ff3db)}}),{'verbose':_0x239364[_0x57fa3a(0xea)]}),_0x372c83=_0x37d60e[_0x57fa3a(0xdc)];for(const _0x2f469f of _0x372c83[_0x57fa3a(0xfc)]){if(_0x2f469f[_0x57fa3a(0xf6)]&&(_0x2f469f['action']==='created'||_0x2f469f[_0x57fa3a(0xec)]===_0x57fa3a(0x100))){const _0x59375b=getCampaignUrl(_0x239364['site'],_0x593e48,_0x2f469f[_0x57fa3a(0xf6)]),_0x1c8f06=_0x2f469f[_0x57fa3a(0xec)]===_0x57fa3a(0xef)?'+':'~',_0x3e0ac5=_0x2f469f[_0x57fa3a(0xec)]==='created'?a20_0x4db7e6[_0x57fa3a(0xcb)](_0x1c8f06):a20_0x4db7e6[_0x57fa3a(0xce)](_0x1c8f06);console['error']('\x20\x20'+_0x3e0ac5+'\x20'+hyperlink(_0x2f469f[_0x57fa3a(0xed)],_0x59375b)+'\x20'+a20_0x4db7e6[_0x57fa3a(0x10a)](_0x59375b));}}_0x372c83[_0x57fa3a(0xef)]>0x0&&console[_0x57fa3a(0xd4)](a20_0x4db7e6['green']('✔\x20Created\x20'+_0x372c83[_0x57fa3a(0xef)]+_0x57fa3a(0xfb)));_0x372c83[_0x57fa3a(0x100)]>0x0&&console['error'](a20_0x4db7e6[_0x57fa3a(0xcb)](_0x57fa3a(0xd3)+_0x372c83[_0x57fa3a(0x100)]+'\x20campaigns'));if(_0x372c83[_0x57fa3a(0x107)]['length']>0x0){console[_0x57fa3a(0xd4)](a20_0x4db7e6[_0x57fa3a(0x109)]('✘\x20'+_0x372c83[_0x57fa3a(0x107)]['length']+_0x57fa3a(0xe9)));for(const _0x1ab288 of _0x372c83[_0x57fa3a(0x107)]){console[_0x57fa3a(0xd4)]('\x20\x20'+a20_0x4db7e6[_0x57fa3a(0x109)](_0x1ab288['name'])+':\x20'+_0x1ab288['error']);}}return saveSessionContext({'engage_workspace':_0x25ab7f},_0x239364[_0x57fa3a(0xeb)]),_0x372c83[_0x57fa3a(0x107)]['length']>0x0?0x1:0x0;}}
|
|
1
|
+
const a20_0x2682b3=a20_0x15b3;(function(_0x5529ee,_0x180ad2){const _0x2ceb79=a20_0x15b3,_0x3f8bed=_0x5529ee();while(!![]){try{const _0x3b6f1f=parseInt(_0x2ceb79(0xec))/0x1+parseInt(_0x2ceb79(0x10d))/0x2+-parseInt(_0x2ceb79(0x131))/0x3+parseInt(_0x2ceb79(0x10b))/0x4*(parseInt(_0x2ceb79(0xf8))/0x5)+-parseInt(_0x2ceb79(0x130))/0x6+parseInt(_0x2ceb79(0xfa))/0x7*(parseInt(_0x2ceb79(0x115))/0x8)+parseInt(_0x2ceb79(0xfd))/0x9*(parseInt(_0x2ceb79(0x123))/0xa);if(_0x3b6f1f===_0x180ad2)break;else _0x3f8bed['push'](_0x3f8bed['shift']());}catch(_0x3f90e2){_0x3f8bed['push'](_0x3f8bed['shift']());}}}(a20_0x5eea,0x978cf));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a20_0x12c8bd from'chalk';import a20_0x450fb0 from'path';import{discoverCampaignFiles,parseCampaignFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/campaign-push.js';import{validateCampaignDef}from'../sdk/engage/campaign-validator.js';function a20_0x15b3(_0x3bf0fe,_0x34b2eb){_0x3bf0fe=_0x3bf0fe-0xe7;const _0x5eea5d=a20_0x5eea();let _0x15b38e=_0x5eea5d[_0x3bf0fe];return _0x15b38e;}import{getCampaignUrl}from'../sdk/client/endpoints.js';function a20_0x5eea(){const _0x488b15=['dirname','update','engage','\x0aPush\x20summary\x20for\x20workspace\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','\x0aError:','Aborted.','verbose','data','engage_workspace','12611210uzDpxh','created','session','errors','site','setPhase','dim','campaign_type','length','Push\x20','updated','\x20campaign\x20files','\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.','5257590zXguyH','3344235osFKlH','def','cwd','name','message','-\x20no\x20changes\x20applied','filter','Campaign\x20YAML\x20files\x20must\x20have\x20type:\x20campaign\x20in\x20their\x20definition.','1\x20campaign\x20file:\x20','segment','17468KAbsuc','Pushing\x20campaigns...','✔\x20Updated\x20','resolveWorkspaceId','green','results','✔\x20All\x20campaigns\x20are\x20up\x20to\x20date','config','\x0aUsage:\x20tdx\x20engage\x20campaign\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','\x27...','cyan','create','10JxkxWZ','path','7xKwTWb','\x20errors:','\x20campaigns?','9JCQjFc','✔\x20Created\x20','map','\x20campaigns\x20to\x20update:','\x20campaigns','valid','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20campaigns','dryRun','yellow','campaignId','\x20\x20\x20\x20','description','error','\x20new\x20campaigns:','357852HglIVj','red','1447630EAQXnK','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','engage:campaign:push','action','Found\x20','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20campaign\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','resolve','Workspace\x20is\x20required.','3443448OKUCtT','configDir','\x0aValidation\x20errors\x20in\x20','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied'];a20_0x5eea=function(){return _0x488b15;};return a20_0x5eea();}import{hyperlink}from'../sdk/util/formatters.js';export class EngageCampaignPushCommand extends BaseCommand{[a20_0x2682b3(0x134)]=a20_0x2682b3(0x10f);[a20_0x2682b3(0x108)]=a20_0x2682b3(0x103);async['execute'](_0x157d97){const _0x48398f=a20_0x2682b3,{options:_0x413b0a,args:_0x4ef3d8,tdx:_0xd11d38}=_0x157d97,_0x3f1ea9=_0x413b0a,_0x43fd8b=_0x4ef3d8[0x0],_0x39a8a3=_0x43fd8b?a20_0x450fb0[_0x48398f(0x113)](_0x43fd8b):undefined,_0x27382f=_0x39a8a3?isYamlFile(_0x39a8a3):![];let _0x250a87;if(_0x27382f&&_0x39a8a3)_0x250a87=a20_0x450fb0[_0x48398f(0x119)](_0x39a8a3);else _0x39a8a3?_0x250a87=_0x39a8a3:_0x250a87=process[_0x48398f(0x133)]();let _0x3d2f97;const _0x1f8279=tryFindTdxConfig(_0x250a87);_0x1f8279?.[_0x48398f(0xf3)][_0x48398f(0x122)]&&(_0x3d2f97=_0x1f8279[_0x48398f(0xf3)]['engage_workspace'],!_0x27382f&&(_0x250a87=_0x1f8279[_0x48398f(0x116)]));_0x3f1ea9['workspace']&&(_0x3d2f97=_0x3f1ea9['workspace']);if(!_0x3d2f97){const _0x5e10dd=loadSessionContext(_0x3f1ea9[_0x48398f(0x125)]);_0x5e10dd?.[_0x48398f(0x122)]&&(_0x3d2f97=_0x5e10dd[_0x48398f(0x122)]);}if(!_0x3d2f97)return console['error'](a20_0x12c8bd['yellow'](_0x48398f(0x114))),console[_0x48398f(0x109)](_0x48398f(0xf4)),console[_0x48398f(0x109)](_0x48398f(0x112)),console[_0x48398f(0x109)](_0x48398f(0x11d)),console[_0x48398f(0x109)](_0x48398f(0x10e)),0x1;let _0x1e16f0;_0x27382f&&_0x39a8a3?_0x1e16f0=[_0x39a8a3]:_0x1e16f0=discoverCampaignFiles(_0x250a87);if(_0x1e16f0[_0x48398f(0x12b)]===0x0)return console[_0x48398f(0x109)](a20_0x12c8bd[_0x48398f(0x105)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x250a87)),console[_0x48398f(0x109)](a20_0x12c8bd[_0x48398f(0x129)](_0x48398f(0xe9))),0x1;const _0x1ba726=_0x1e16f0[_0x48398f(0xff)](_0x2ed8eb=>parseCampaignFile(_0x2ed8eb,a20_0x450fb0[_0x48398f(0x119)](_0x2ed8eb))),_0x104d05=_0x1ba726[_0x48398f(0x12b)]===0x1?_0x48398f(0xea)+_0x1ba726[0x0]['def'][_0x48398f(0x134)]:_0x1ba726[_0x48398f(0x12b)]+_0x48398f(0x12e);console[_0x48398f(0x109)](_0x48398f(0x111)+a20_0x12c8bd[_0x48398f(0xf6)](_0x104d05));let _0x14f7b9=![];for(const _0x351b36 of _0x1ba726){const _0x32e015=validateCampaignDef(_0x351b36[_0x48398f(0x132)]);if(!_0x32e015[_0x48398f(0x102)]){_0x14f7b9=!![],console[_0x48398f(0x109)](a20_0x12c8bd[_0x48398f(0x10c)](_0x48398f(0x117)+_0x351b36['relativePath']+':'));for(const _0x385ac6 of _0x32e015['errors']){console[_0x48398f(0x109)]('\x20\x20'+a20_0x12c8bd['red']('✗')+'\x20'+_0x385ac6[_0x48398f(0xf9)]+':\x20'+_0x385ac6[_0x48398f(0x135)]);}}for(const _0x2a4a0c of _0x32e015['warnings']){console['error']('\x20\x20'+a20_0x12c8bd['yellow']('⚠')+'\x20'+_0x2a4a0c[_0x48398f(0xf9)]+':\x20'+_0x2a4a0c[_0x48398f(0x135)]);}}if(_0x14f7b9)return console[_0x48398f(0x109)](a20_0x12c8bd[_0x48398f(0x10c)](_0x48398f(0x12f))),0x1;const _0x2caf6b=await _0xd11d38[_0x48398f(0x11b)][_0x48398f(0xef)](_0x3d2f97),_0x511e9a=await withProgressSpinner('Preparing\x20push\x20to\x20workspace\x20\x27'+_0x3d2f97+_0x48398f(0xf5),_0x1f999c=>preparePush({'engage':_0xd11d38[_0x48398f(0x11b)],'segment':_0xd11d38[_0x48398f(0xeb)]},_0x1ba726,_0x2caf6b,{'progress':{'update':_0x482971=>_0x1f999c[_0x48398f(0x128)](_0x482971)}}),{'verbose':_0x3f1ea9[_0x48398f(0x120)]}),_0xf35a80=_0x511e9a['data'];await withProgressSpinner('Resolving\x20references...',_0x2b8eab=>resolveAndBuildInputs({'engage':_0xd11d38[_0x48398f(0x11b)],'segment':_0xd11d38[_0x48398f(0xeb)]},_0xf35a80,_0x2caf6b,{'progress':{'update':_0x11f72b=>_0x2b8eab[_0x48398f(0x128)](_0x11f72b)}}),{'verbose':_0x3f1ea9[_0x48398f(0x120)]});const _0x2a1337=_0xf35a80[_0x48398f(0xe8)](_0x4c8fcc=>_0x4c8fcc[_0x48398f(0x110)]===_0x48398f(0xf7)),_0x498256=_0xf35a80['filter'](_0x4a3c68=>_0x4a3c68['action']===_0x48398f(0x11a));console['error'](_0x48398f(0x11c)+_0x3d2f97+'\x27:');if(_0x2a1337[_0x48398f(0x12b)]>0x0){console[_0x48398f(0x109)]('\x20\x20'+a20_0x12c8bd[_0x48398f(0xf0)]('+\x20'+_0x2a1337[_0x48398f(0x12b)]+_0x48398f(0x10a)));for(const _0x5d47a9 of _0x2a1337){console['error'](_0x48398f(0x107)+a20_0x12c8bd[_0x48398f(0xf0)]('+')+'\x20'+_0x5d47a9['def']['name']+'\x20('+_0x5d47a9[_0x48398f(0x132)][_0x48398f(0x12a)]+')');}}if(_0x498256[_0x48398f(0x12b)]>0x0){console[_0x48398f(0x109)]('\x20\x20'+a20_0x12c8bd[_0x48398f(0x105)]('~\x20'+_0x498256[_0x48398f(0x12b)]+_0x48398f(0x100)));for(const _0x290844 of _0x498256){console['error']('\x20\x20\x20\x20'+a20_0x12c8bd[_0x48398f(0x105)]('~')+'\x20'+_0x290844['def'][_0x48398f(0x134)]+'\x20('+_0x290844[_0x48398f(0x132)][_0x48398f(0x12a)]+')');}}if(_0x2a1337[_0x48398f(0x12b)]===0x0&&_0x498256['length']===0x0)return console['error'](a20_0x12c8bd[_0x48398f(0xf0)](_0x48398f(0xf2))),0x0;if(_0x3f1ea9[_0x48398f(0x104)])return console['error'](a20_0x12c8bd[_0x48398f(0x105)](_0x48398f(0x118))),0x0;if(!_0x3f1ea9['yes']){if(!isInteractive())return console[_0x48398f(0x109)](a20_0x12c8bd[_0x48398f(0x10c)](_0x48398f(0x11e)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console[_0x48398f(0x109)](a20_0x12c8bd[_0x48398f(0x129)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x22ef24=await confirmKey(_0x48398f(0x12c)+(_0x2a1337[_0x48398f(0x12b)]+_0x498256[_0x48398f(0x12b)])+_0x48398f(0xfc));if(!_0x22ef24)return console[_0x48398f(0x109)](a20_0x12c8bd['yellow'](_0x48398f(0x11f)),_0x48398f(0xe7)),0x1;}const _0x1084b9=await withProgressSpinner(_0x48398f(0xed),_0x3d1b63=>executePush({'engage':_0xd11d38[_0x48398f(0x11b)],'segment':_0xd11d38[_0x48398f(0xeb)]},_0xf35a80,{'progress':{'update':_0x44f17b=>_0x3d1b63[_0x48398f(0x128)](_0x44f17b)}}),{'verbose':_0x3f1ea9[_0x48398f(0x120)]}),_0x40e856=_0x1084b9[_0x48398f(0x121)];for(const _0x480de4 of _0x40e856[_0x48398f(0xf1)]){if(_0x480de4[_0x48398f(0x106)]&&(_0x480de4['action']===_0x48398f(0x124)||_0x480de4[_0x48398f(0x110)]===_0x48398f(0x12d))){const _0x27edc4=getCampaignUrl(_0x3f1ea9[_0x48398f(0x127)],_0x2caf6b,_0x480de4[_0x48398f(0x106)]),_0x5cafe3=_0x480de4[_0x48398f(0x110)]===_0x48398f(0x124)?'+':'~',_0x46ba87=_0x480de4[_0x48398f(0x110)]==='created'?a20_0x12c8bd[_0x48398f(0xf0)](_0x5cafe3):a20_0x12c8bd[_0x48398f(0x105)](_0x5cafe3);console['error']('\x20\x20'+_0x46ba87+'\x20'+hyperlink(_0x480de4[_0x48398f(0x134)],_0x27edc4)+'\x20'+a20_0x12c8bd[_0x48398f(0x129)](_0x27edc4));}}_0x40e856[_0x48398f(0x124)]>0x0&&console[_0x48398f(0x109)](a20_0x12c8bd[_0x48398f(0xf0)](_0x48398f(0xfe)+_0x40e856[_0x48398f(0x124)]+'\x20campaigns'));_0x40e856[_0x48398f(0x12d)]>0x0&&console[_0x48398f(0x109)](a20_0x12c8bd['green'](_0x48398f(0xee)+_0x40e856['updated']+_0x48398f(0x101)));if(_0x40e856[_0x48398f(0x126)][_0x48398f(0x12b)]>0x0){console[_0x48398f(0x109)](a20_0x12c8bd[_0x48398f(0x10c)]('✘\x20'+_0x40e856[_0x48398f(0x126)][_0x48398f(0x12b)]+_0x48398f(0xfb)));for(const _0x404e0f of _0x40e856[_0x48398f(0x126)]){console[_0x48398f(0x109)]('\x20\x20'+a20_0x12c8bd[_0x48398f(0x10c)](_0x404e0f['name'])+':\x20'+_0x404e0f[_0x48398f(0x109)]);}}return saveSessionContext({'engage_workspace':_0x3d2f97},_0x3f1ea9[_0x48398f(0x125)]),_0x40e856[_0x48398f(0x126)]['length']>0x0?0x1:0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a21_0x4606(_0x52d4f1,_0x3bee21){_0x52d4f1=_0x52d4f1-0x143;const _0x289948=a21_0x2899();let _0x4606b=_0x289948[_0x52d4f1];return _0x4606b;}const a21_0x11ef2c=a21_0x4606;(function(_0x50ed7c,_0xe4e848){const _0x16dc33=a21_0x4606,_0x273e50=_0x50ed7c();while(!![]){try{const _0x439acf=-parseInt(_0x16dc33(0x159))/0x1*(-parseInt(_0x16dc33(0x149))/0x2)+parseInt(_0x16dc33(0x164))/0x3+-parseInt(_0x16dc33(0x143))/0x4+-parseInt(_0x16dc33(0x169))/0x5+-parseInt(_0x16dc33(0x158))/0x6*(-parseInt(_0x16dc33(0x150))/0x7)+-parseInt(_0x16dc33(0x15f))/0x8*(parseInt(_0x16dc33(0x148))/0x9)+-parseInt(_0x16dc33(0x153))/0xa*(-parseInt(_0x16dc33(0x16a))/0xb);if(_0x439acf===_0xe4e848)break;else _0x273e50['push'](_0x273e50['shift']());}catch(_0x55121f){_0x273e50['push'](_0x273e50['shift']());}}}(a21_0x2899,0x1afb7));import{BaseCommand}from'./command.js';import{findYamlFiles,isYamlFile}from'../sdk/segment/file-discovery.js';import{existsSync}from'fs';import a21_0x520dbe from'chalk';import a21_0x53cccd from'path';function a21_0x2899(){const _0x50ba1c=['Error:\x20No\x20YAML\x20files\x20found\x20in\x20','\x20warning(s)','\x20warning(s)\x20found','7MfmnHY','hasErrors','endsWith','1331410wGHboC','green','\x20non-campaign\x20file(s)\x20skipped)','length','invalidCount','429450XtCWcP','4IKXtYT','red','warnings','\x20(skipped:\x20','description','\x20error(s)','36136LdJxTp','\x20non-campaign\x20file(s)\x20skipped','dirname','execute','name','362469JcuTxr','warningCount','validCount','verbose','Error:\x20File\x20must\x20have\x20.yml\x20or\x20.yaml\x20extension:\x20','979850rfpnXV','11hcnVcM','reason','filter','errors','skippedCount','\x20campaign(s)\x20valid','.yml','Validate\x20campaign\x20YAML\x20files','dim','.yaml','error','12196CbCyEV','Validation\x20failed:\x20','valid','yellow','log','261rbFDhp','57496AnRJMH','campaign','relativePath','\x20campaign(s)\x20with\x20errors,\x20'];a21_0x2899=function(){return _0x50ba1c;};return a21_0x2899();}import{formatValidationResult}from'../sdk/segment/yaml-validator.js';import{validateYamlFiles,isValidationResult,calculateSummary}from'../sdk/segment/validate-files.js';export class EngageCampaignValidateCommand extends BaseCommand{[a21_0x11ef2c(0x163)]='engage:campaign:validate';[a21_0x11ef2c(0x15d)]=a21_0x11ef2c(0x171);async[a21_0x11ef2c(0x162)](_0x2526f7){const _0x49b77b=a21_0x11ef2c,{options:_0x36098f,args:_0x592e3a}=_0x2526f7,_0x1107d0=_0x36098f,_0x2f8803=_0x592e3a[0x0],_0xd034fd=_0x2f8803?a21_0x53cccd['resolve'](_0x2f8803):undefined,_0x8145e8=_0xd034fd?isYamlFile(_0xd034fd):![];let _0x118d67,_0x47bf6f;if(_0x8145e8&&_0xd034fd)_0x118d67=a21_0x53cccd[_0x49b77b(0x161)](_0xd034fd),_0x47bf6f=_0xd034fd;else _0xd034fd?_0x118d67=_0xd034fd:_0x118d67=process['cwd']();if(!_0x47bf6f&&!existsSync(_0x118d67))return console['error'](a21_0x520dbe[_0x49b77b(0x15a)]('Error:\x20Directory\x20not\x20found:\x20'+_0x118d67+'\x0a')),0x1;let _0x17d676;if(_0x47bf6f){if(!_0x47bf6f[_0x49b77b(0x152)](_0x49b77b(0x170))&&!_0x47bf6f['endsWith'](_0x49b77b(0x173)))return console[_0x49b77b(0x174)](a21_0x520dbe[_0x49b77b(0x15a)](_0x49b77b(0x168)+_0x47bf6f+'\x0a')),0x1;_0x17d676=[_0x47bf6f];}else _0x17d676=findYamlFiles(_0x118d67);if(_0x17d676[_0x49b77b(0x156)]===0x0)return console['error'](a21_0x520dbe[_0x49b77b(0x15a)](_0x49b77b(0x14d)+_0x118d67+'\x0a')),0x1;const _0x35e67a=validateYamlFiles(_0x17d676,_0x118d67,{'filterType':_0x49b77b(0x14a)}),_0x12f9eb=calculateSummary(_0x35e67a),_0xc4af13=_0x35e67a[_0x49b77b(0x16c)](isValidationResult);if(_0xc4af13[_0x49b77b(0x156)]===0x0)return console[_0x49b77b(0x174)](a21_0x520dbe[_0x49b77b(0x146)]('No\x20campaign\x20YAML\x20files\x20found\x20in\x20'+_0x118d67+'\x0a')),_0x12f9eb[_0x49b77b(0x16e)]>0x0&&console[_0x49b77b(0x174)](a21_0x520dbe[_0x49b77b(0x172)]('('+_0x12f9eb[_0x49b77b(0x16e)]+_0x49b77b(0x155))),0x0;for(const _0x10ec4a of _0x35e67a){if(!isValidationResult(_0x10ec4a)){_0x1107d0['verbose']&&console[_0x49b77b(0x147)](a21_0x520dbe[_0x49b77b(0x172)]('-\x20'+_0x10ec4a[_0x49b77b(0x14b)]+_0x49b77b(0x15c)+_0x10ec4a[_0x49b77b(0x16b)]+')'));continue;}const {relativePath:_0xd18c93,source:_0x3863f0,result:_0x2ca06c}=_0x10ec4a;if(_0x2ca06c[_0x49b77b(0x145)]&&_0x2ca06c[_0x49b77b(0x15b)][_0x49b77b(0x156)]===0x0)_0x1107d0[_0x49b77b(0x167)]&&console[_0x49b77b(0x147)](a21_0x520dbe[_0x49b77b(0x154)]('✔\x20'+_0xd18c93));else _0x2ca06c['valid']?(console[_0x49b77b(0x147)](a21_0x520dbe['yellow']('⚠\x20'+_0xd18c93+':\x20'+_0x2ca06c[_0x49b77b(0x15b)][_0x49b77b(0x156)]+_0x49b77b(0x14e))),console[_0x49b77b(0x147)](formatValidationResult(_0x2ca06c,_0x3863f0,_0xd18c93))):(console[_0x49b77b(0x147)](a21_0x520dbe['red']('✖\x20'+_0xd18c93+':\x20'+_0x2ca06c[_0x49b77b(0x16d)][_0x49b77b(0x156)]+_0x49b77b(0x15e))),console[_0x49b77b(0x147)](formatValidationResult(_0x2ca06c,_0x3863f0,_0xd18c93)));}return console[_0x49b77b(0x147)](''),_0x12f9eb[_0x49b77b(0x151)]?(console['log'](a21_0x520dbe['red'](_0x49b77b(0x144)+_0x12f9eb[_0x49b77b(0x157)]+_0x49b77b(0x14c)+_0x12f9eb['validCount']+'\x20valid')),_0x12f9eb[_0x49b77b(0x165)]>0x0&&console[_0x49b77b(0x147)](a21_0x520dbe[_0x49b77b(0x146)](_0x12f9eb[_0x49b77b(0x165)]+_0x49b77b(0x14f))),_0x12f9eb[_0x49b77b(0x16e)]>0x0&&console[_0x49b77b(0x147)](a21_0x520dbe[_0x49b77b(0x172)](_0x12f9eb[_0x49b77b(0x16e)]+'\x20non-campaign\x20file(s)\x20skipped')),0x1):(console[_0x49b77b(0x147)](a21_0x520dbe[_0x49b77b(0x154)]('✔\x20All\x20'+_0x12f9eb[_0x49b77b(0x166)]+_0x49b77b(0x16f))),_0x12f9eb[_0x49b77b(0x165)]>0x0&&console['log'](a21_0x520dbe[_0x49b77b(0x146)](_0x12f9eb['warningCount']+'\x20warning(s)\x20found')),_0x12f9eb[_0x49b77b(0x16e)]>0x0&&console['log'](a21_0x520dbe[_0x49b77b(0x172)](_0x12f9eb[_0x49b77b(0x16e)]+_0x49b77b(0x160))),0x0);}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a22_0x15ef4a=a22_0x38de;(function(_0xa20871,_0x85f386){const _0x518971=a22_0x38de,_0x2a37ef=_0xa20871();while(!![]){try{const _0x222675=parseInt(_0x518971(0x9d))/0x1+parseInt(_0x518971(0x12b))/0x2*(-parseInt(_0x518971(0x15d))/0x3)+parseInt(_0x518971(0xaa))/0x4+-parseInt(_0x518971(0xc0))/0x5*(-parseInt(_0x518971(0x156))/0x6)+parseInt(_0x518971(0xa4))/0x7+parseInt(_0x518971(0xa7))/0x8+-parseInt(_0x518971(0x127))/0x9;if(_0x222675===_0x85f386)break;else _0x2a37ef['push'](_0x2a37ef['shift']());}catch(_0x371736){_0x2a37ef['push'](_0x2a37ef['shift']());}}}(a22_0x3e19,0x7b2fc));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{readFileContent}from'../utils/file-reader.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';import{getCampaignUrl,getTemplateUrl,getWorkspaceUrl}from'../sdk/client/endpoints.js';function a22_0x3e19(){const _0x1ac5e9=['engage:always-on-campaign:launch','startAt','78SNvIaF','engage:always-on-campaign:delete','toLowerCase','Usage:\x20tdx\x20engage\x20always-on-campaign\x20resume\x20<name-or-id>','Campaign\x20\x27','type','Fetching\x20always-on\x20campaigns...','24OYhBUS','Updating\x20template\x20\x27','Launch\x20a\x20campaign','Create\x20a\x20new\x20always-on\x20campaign','engage:template:update','Fetching\x20workspaces...','getAlwaysOnCampaign','Pausing\x20campaign\x20\x27','\x27?\x20This\x20cannot\x20be\x20undone.','Duplicate\x20an\x20always-on\x20campaign','PAUSED','Create\x20a\x20workspace','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext','809956GVtOwe','entries','List\x20campaigns','engage:workspace:update','engage:campaign:create','updateWorkspace','session','4525402knciTO','log','emailSenderId','2176816OcMHBd','engage:campaign:delete','MISSING_ARGUMENT','2936636eOhTjU','Pause\x20a\x20campaign','Usage:\x20tdx\x20engage\x20always-on-campaign\x20pause\x20<name-or-id>','Options:\x20--name,\x20--description,\x20--audience-id,\x20--enable-utm-tracking','engage:always-on-campaign:show','📝\x20','Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>','resumeAlwaysOnCampaign','Deleting\x20always-on\x20campaign\x20\x27','Fetching\x20workspace\x20\x27','execute','\x27...','engage:always-on-campaign:update','deleteAlwaysOnCampaign','status','engage:campaign:show','Delete\x20an\x20always-on\x20campaign','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','workspaceId','launchCampaign','name','listTemplates','277655EAtoaX','subject','engage:always-on-campaign:pause','engage:campaigns','updateTemplate','📧\x20','join','getTemplateFull','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','\x27\x20finished\x20successfully','map','Show\x20email\x20template\x20details','site','engage:campaign:resume','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Update\x20an\x20always-on\x20campaign','engage','getWorkspaceFull','parentId','Create\x20an\x20email\x20template','segment','Verifying\x20workspace\x20\x27','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','engage:campaign:duplicate','Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22','\x22.\x20Valid\x20values:\x20','Error:\x20--name\x20is\x20required','Delete\x20a\x20campaign','getWorkspace','Show\x20campaign\x20details','Delete\x20a\x20workspace','workspace','listCampaigns','description','jsonColumns','getCampaign','getAlwaysOnCampaignFull','Error:\x20--subject\x20is\x20required','dim','data','🏢\x20','error','engage_workspace','fromEntries','updateCampaign','Update\x20a\x20workspace','Error:\x20Invalid\x20status\x20\x22','resolvePathToResource','\x27\x20deleted\x20successfully','List\x20always-on\x20campaigns','Pause\x20an\x20always-on\x20campaign','Error:\x20Workspace\x20name\x20is\x20required','verbose','pauseCampaign','Resuming\x20campaign\x20\x27','includes','duplicateCampaign','\x27\x20paused\x20successfully','engage:workspaces','Creating\x20always-on\x20campaign\x20\x27','Deleting\x20template\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','pauseAlwaysOnCampaign','engage:always-on-campaign:create','DRAFT','Finishing\x20always-on\x20campaign\x20\x27','filter','Always-on\x20campaign\x20\x27','FINISHED','parentName','Launching\x20always-on\x20campaign\x20\x27','toUpperCase','plaintext','html','Usage:\x20tdx\x20engage\x20always-on-campaign\x20duplicate\x20<name-or-id>\x20[--name\x20<new-name>]','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','Usage:\x20tdx\x20engage\x20always-on-campaign\x20launch\x20<name-or-id>','Usage:\x20tdx\x20engage\x20always-on-campaign\x20delete\x20<name-or-id>','Template\x20\x27','htmlFile','Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','keys','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','Fetching\x20campaign\x20\x27','enableUtmTracking','Create\x20a\x20new\x20campaign','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','full','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','createAlwaysOnCampaign','Fetching\x20always-on\x20campaign\x20\x27','segmentId','engage:workspace:use','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Show\x20workspace\x20details','resolveWorkspaceId','List\x20email\x20templates','Set\x20workspace\x20context\x20for\x20Engage\x20commands','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Launch\x20an\x20always-on\x20campaign','getCampaignFull','engage:campaign:launch','22899546hgsonp','Duplicating\x20always-on\x20campaign\x20\x27','Operation\x20cancelled','Workspace\x20\x27','33910FfNTXW','length','Fetching\x20template\x20\x27','engage:workspace:create','Update\x20an\x20email\x20template','\x27\x20launched\x20successfully','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20always-on\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20always-on-campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','attributes','audienceName','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','engage:always-on-campaigns','createCampaign','engage:templates','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','engage:campaign:pause','Engage\x20workspace\x20set\x20to:\x20','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','createTemplate','timezone','duplicateAlwaysOnCampaign','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','editorType','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','Updating\x20campaign\x20\x27','limit','Deleting\x20campaign\x20\x27','audienceId','updateAlwaysOnCampaign','Creating\x20workspace\x20\x27','deleteCampaign','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','yes','\x27\x20resumed\x20successfully','engage:campaign:update','segmentName','Workspace\x20is\x20required\x20for\x20this\x20operation','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','COMPLETED'];a22_0x3e19=function(){return _0x1ac5e9;};return a22_0x3e19();}import{isStructuredFormat}from'../core/command-output.js';import{hyperlink}from'../sdk/util/formatters.js';import a22_0x464f89 from'chalk';export async function resolveWorkspaceIdFromOptions(_0xc7e30d,_0x1b1379,_0x174f80=![]){const _0x38b6f4=a22_0x38de;if(_0xc7e30d['workspace'])return await _0x1b1379[_0x38b6f4(0xd1)][_0x38b6f4(0x120)](_0xc7e30d[_0x38b6f4(0xe0)]);const _0x732b20=loadSessionContext(_0xc7e30d['session']);if(_0x732b20?.[_0x38b6f4(0xeb)])return await _0x1b1379[_0x38b6f4(0xd1)][_0x38b6f4(0x120)](_0x732b20[_0x38b6f4(0xeb)]);if(_0x174f80)throw new SDKError(ErrorCode[_0x38b6f4(0xa9)],_0x38b6f4(0x151),undefined,{'helpText':_0x38b6f4(0xd9)});return undefined;}async function resolveSegmentFromOptions(_0x53987d,_0x44a125){const _0x5061ca=a22_0x38de;if(!_0x53987d['segment'])return{};const _0x38a451=_0x53987d['segment'],_0x5cea19=await _0x44a125[_0x5061ca(0xd5)][_0x5061ca(0xf0)](_0x38a451);return{'audienceId':_0x5cea19[_0x5061ca(0xd3)],'audienceName':_0x5cea19[_0x5061ca(0x106)],..._0x5cea19[_0x5061ca(0x11c)]&&{'segmentId':_0x5cea19[_0x5061ca(0x11c)],'segmentName':_0x5cea19[_0x5061ca(0x150)]}};}function buildConnectorConfig(_0x2ddb65){const _0x6bc42=a22_0x38de,_0x53247d=_0x2ddb65[_0x6bc42(0xa6)],_0x581395=_0x2ddb65[_0x6bc42(0xe3)];if(!_0x53247d&&!_0x581395)return undefined;return{..._0x53247d&&{'emailSenderId':_0x53247d},..._0x581395&&{'jsonColumns':_0x581395}};}export class EngageCampaignsCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xc3);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x9f);async[a22_0x15ef4a(0xb4)](_0xa556a){const _0x55c498=a22_0x15ef4a,{options:_0x56d347,args:_0x43702e,tdx:_0x38b82f}=_0xa556a,_0x313a11=_0x43702e[0x0],_0x28ebfc=resolveLimit(_0x56d347['limit'],DEFAULT_LLM_LIMIT),_0xedd2b8=_0x56d347,_0x5a1e4c=_0xedd2b8[_0x55c498(0x15b)],_0x5656a7=[_0x55c498(0x101),'ACTIVE',_0x55c498(0x98),_0x55c498(0x153)],_0x3d8c8c=_0xedd2b8[_0x55c498(0xb8)],_0x52348f=_0x3d8c8c?.[_0x55c498(0x108)]();if(_0x52348f&&!_0x5656a7[_0x55c498(0xf8)](_0x52348f))return console[_0x55c498(0xea)](_0x55c498(0xef)+_0x3d8c8c+_0x55c498(0xda)+_0x5656a7[_0x55c498(0xc6)](',\x20')),0x1;const _0x4bebea=await resolveWorkspaceIdFromOptions(_0xedd2b8,_0x38b82f),_0x517293=await withSpinner('Fetching\x20campaigns...',()=>_0x38b82f[_0x55c498(0xd1)][_0x55c498(0xe1)]({'type':_0x5a1e4c,'status':_0x52348f,'workspaceId':_0x4bebea,'limit':_0x28ebfc}),{'verbose':_0x56d347[_0x55c498(0xf5)]});let _0x5dea31=_0x517293[_0x55c498(0xe8)];_0x52348f&&(_0x5dea31=_0x5dea31[_0x55c498(0x103)](_0x5b2316=>_0x5b2316['status'][_0x55c498(0x108)]()===_0x52348f));_0x313a11&&(_0x5dea31=_0x5dea31[_0x55c498(0x103)](_0x234b98=>matchGlobPattern(_0x234b98[_0x55c498(0xbe)],_0x313a11)));const _0x2d28ed=_0x56d347[_0x55c498(0xcc)];if(isStructuredFormat(_0x56d347)){const _0x2f9631=_0x5dea31[_0x55c498(0xca)](_0x2ca30e=>({..._0x2ca30e,'url':_0x2ca30e[_0x55c498(0xbc)]?getCampaignUrl(_0x2d28ed,_0x2ca30e['workspaceId'],_0x2ca30e['id']):undefined}));await handleSDKOutput(_0x2f9631,_0x56d347);}else for(const _0x2d00db of _0x5dea31){const _0x3cce7d=a22_0x464f89['dim']('\x20('+_0x2d00db['status'][_0x55c498(0x158)]()+')'),_0x436e4c=_0x2d00db[_0x55c498(0xbc)]?getCampaignUrl(_0x2d28ed,_0x2d00db[_0x55c498(0xbc)],_0x2d00db['id']):undefined,_0x3125b0=_0x436e4c?hyperlink(_0x2d00db['name'],_0x436e4c):_0x2d00db['name'];console['log'](_0x55c498(0xc5)+_0x3125b0+_0x3cce7d);}return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xb9);['description']=a22_0x15ef4a(0xde);async[a22_0x15ef4a(0xb4)](_0x3012f7){const _0x43e7c7=a22_0x15ef4a,{options:_0x30d6e5,args:_0xc57f08,tdx:_0x4f9754}=_0x3012f7;if(_0xc57f08[_0x43e7c7(0x12c)]===0x0)return console[_0x43e7c7(0xea)](_0x43e7c7(0x139)),console['error'](_0x43e7c7(0xfe)),0x1;const _0x63faf4=_0xc57f08[0x0],_0x45644d=_0x30d6e5,_0xf496e7=await resolveWorkspaceIdFromOptions(_0x45644d,_0x4f9754),_0x1cb46d=_0x45644d[_0x43e7c7(0x118)],_0x3398aa=_0x30d6e5['site'];if(_0x1cb46d){const _0x4be568=await withSpinner(_0x43e7c7(0x114)+_0x63faf4+_0x43e7c7(0xb5),()=>_0x4f9754[_0x43e7c7(0xd1)][_0x43e7c7(0x125)](_0x63faf4,_0xf496e7),{'verbose':_0x30d6e5[_0x43e7c7(0xf5)]}),_0x474353=_0x4be568[_0x43e7c7(0xe8)],_0x461827=_0x474353['attributes']['workspaceId']?getCampaignUrl(_0x3398aa,_0x474353[_0x43e7c7(0x133)][_0x43e7c7(0xbc)],_0x474353['id']):undefined;await handleSDKOutput([{..._0x474353,..._0x461827&&{'url':_0x461827}}],_0x30d6e5);}else{const _0x1989c9=await withSpinner(_0x43e7c7(0x114)+_0x63faf4+'\x27...',()=>_0x4f9754['engage'][_0x43e7c7(0xe4)](_0x63faf4,_0xf496e7),{'verbose':_0x30d6e5[_0x43e7c7(0xf5)]}),_0x43485f=_0x1989c9[_0x43e7c7(0xe8)],_0x1dc2a6=_0x43485f[_0x43e7c7(0xbc)]?getCampaignUrl(_0x3398aa,_0x43485f[_0x43e7c7(0xbc)],_0x43485f['id']):undefined;await handleSingleObjectOutput({..._0x43485f,..._0x1dc2a6&&{'url':_0x1dc2a6}},_0x30d6e5);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xa1);['description']=a22_0x15ef4a(0x116);async[a22_0x15ef4a(0xb4)](_0x2baaa5){const _0x1f2c87=a22_0x15ef4a,{options:_0x5a5ecf,tdx:_0x2bc1b3}=_0x2baaa5,_0x20f0f2=_0x5a5ecf,_0x3f7765=_0x20f0f2[_0x1f2c87(0xbe)],_0x4289ce=_0x20f0f2['type'];if(!_0x3f7765)return console[_0x1f2c87(0xea)](_0x1f2c87(0xdb)),console['error'](_0x1f2c87(0x123)),0x1;if(!_0x4289ce)return console['error'](_0x1f2c87(0x141)),console[_0x1f2c87(0xea)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;const _0x4ea876=await resolveWorkspaceIdFromOptions(_0x20f0f2,_0x2bc1b3,!![]),_0x336f4f=await resolveSegmentFromOptions(_0x20f0f2,_0x2bc1b3),_0x45d7d5=buildConnectorConfig(_0x20f0f2),_0xb053fe={'name':_0x3f7765,'campaignType':_0x4289ce,'workspaceId':_0x4ea876,'description':_0x20f0f2['description'],..._0x336f4f,'connectorConfig':_0x45d7d5,'startAt':_0x20f0f2[_0x1f2c87(0x155)],'timezone':_0x20f0f2[_0x1f2c87(0x13e)]},_0x2445fe=await withSpinner('Creating\x20campaign\x20\x27'+_0x3f7765+'\x27...',()=>_0x2bc1b3['engage'][_0x1f2c87(0x137)](_0xb053fe));return await handleSDKOutput([_0x2445fe[_0x1f2c87(0xe8)]],_0x5a5ecf),0x0;}}function a22_0x38de(_0x313b6e,_0x461be7){_0x313b6e=_0x313b6e-0x8f;const _0x3e19ad=a22_0x3e19();let _0x38de68=_0x3e19ad[_0x313b6e];return _0x38de68;}export class EngageCampaignUpdateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x14f);['description']='Update\x20a\x20campaign';async[a22_0x15ef4a(0xb4)](_0x5513ec){const _0x5d2787=a22_0x15ef4a,{options:_0x2c147d,args:_0x1e5e97,tdx:_0x1b797b}=_0x5513ec;if(_0x1e5e97[_0x5d2787(0x12c)]===0x0)return console[_0x5d2787(0xea)](_0x5d2787(0x139)),console[_0x5d2787(0xea)]('Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x5eeae6=_0x1e5e97[0x0],_0x3e2782=_0x2c147d,_0x5cd780=await resolveWorkspaceIdFromOptions(_0x3e2782,_0x1b797b),_0x3899c1=await resolveSegmentFromOptions(_0x3e2782,_0x1b797b),_0x37352e=buildConnectorConfig(_0x3e2782),_0x1c5091={'name':_0x3e2782['name'],'description':_0x3e2782[_0x5d2787(0xe2)],..._0x3899c1,'connectorConfig':_0x37352e,'startAt':_0x3e2782[_0x5d2787(0x155)],'timezone':_0x3e2782[_0x5d2787(0x13e)]},_0x15b8bf=Object[_0x5d2787(0xec)](Object[_0x5d2787(0x9e)](_0x1c5091)[_0x5d2787(0x103)](([,_0x278e91])=>_0x278e91!==undefined));if(Object[_0x5d2787(0x112)](_0x15b8bf)[_0x5d2787(0x12c)]===0x0)return console[_0x5d2787(0xea)](_0x5d2787(0x140)),console[_0x5d2787(0xea)](_0x5d2787(0x142)),0x1;const _0x3d1600=await withSpinner(_0x5d2787(0x145)+_0x5eeae6+'\x27...',()=>_0x1b797b[_0x5d2787(0xd1)][_0x5d2787(0xed)](_0x5eeae6,_0x15b8bf,_0x5cd780),{'verbose':_0x2c147d[_0x5d2787(0xf5)]});return await handleSDKOutput([_0x3d1600['data']],_0x2c147d),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xa8);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xdc);async[a22_0x15ef4a(0xb4)](_0x5bf77c){const _0xcfe7f4=a22_0x15ef4a,{options:_0x34928a,args:_0x9e5607,tdx:_0x23d643}=_0x5bf77c;if(_0x9e5607[_0xcfe7f4(0x12c)]===0x0)return console[_0xcfe7f4(0xea)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0xcfe7f4(0xea)](_0xcfe7f4(0x10c)),0x1;const _0x1b07de=_0x9e5607[0x0],_0x3554ce=_0x34928a,_0x2589d2=await resolveWorkspaceIdFromOptions(_0x3554ce,_0x23d643);if(!_0x34928a[_0xcfe7f4(0x14d)]){const _0x50c34e=await confirm(_0xcfe7f4(0x9b)+_0x1b07de+_0xcfe7f4(0x96));if(!_0x50c34e)return console[_0xcfe7f4(0xa5)](_0xcfe7f4(0x129)),0x0;}return await withSpinner(_0xcfe7f4(0x147)+_0x1b07de+_0xcfe7f4(0xb5),()=>_0x23d643[_0xcfe7f4(0xd1)][_0xcfe7f4(0x14b)](_0x1b07de,_0x2589d2),{'verbose':_0x34928a[_0xcfe7f4(0xf5)]}),console[_0xcfe7f4(0xa5)](_0xcfe7f4(0x15a)+_0x1b07de+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{['name']=a22_0x15ef4a(0x126);['description']=a22_0x15ef4a(0x90);async['execute'](_0xd9268e){const _0xa5693c=a22_0x15ef4a,{options:_0x290704,args:_0x2f63d2,tdx:_0x3b5cc7}=_0xd9268e;if(_0x2f63d2['length']===0x0)return console[_0xa5693c(0xea)](_0xa5693c(0x139)),console[_0xa5693c(0xea)]('Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'),0x1;const _0x3c30be=_0x2f63d2[0x0],_0x2964b3=_0x290704,_0x295b33=await resolveWorkspaceIdFromOptions(_0x2964b3,_0x3b5cc7);return await withSpinner('Launching\x20campaign\x20\x27'+_0x3c30be+_0xa5693c(0xb5),()=>_0x3b5cc7[_0xa5693c(0xd1)][_0xa5693c(0xbd)](_0x3c30be,_0x295b33),{'verbose':_0x290704[_0xa5693c(0xf5)]}),console[_0xa5693c(0xa5)](_0xa5693c(0x15a)+_0x3c30be+_0xa5693c(0x130)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x13a);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xab);async['execute'](_0x1424ba){const _0x305b69=a22_0x15ef4a,{options:_0x5b7419,args:_0x1430bf,tdx:_0x28a776}=_0x1424ba;if(_0x1430bf[_0x305b69(0x12c)]===0x0)return console[_0x305b69(0xea)](_0x305b69(0x139)),console[_0x305b69(0xea)](_0x305b69(0x113)),0x1;const _0x4bbcc0=_0x1430bf[0x0],_0x23f4a8=_0x5b7419,_0x367de4=await resolveWorkspaceIdFromOptions(_0x23f4a8,_0x28a776);return await withSpinner(_0x305b69(0x95)+_0x4bbcc0+_0x305b69(0xb5),()=>_0x28a776['engage'][_0x305b69(0xf6)](_0x4bbcc0,_0x367de4),{'verbose':_0x5b7419[_0x305b69(0xf5)]}),console[_0x305b69(0xa5)](_0x305b69(0x15a)+_0x4bbcc0+_0x305b69(0xfa)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xcd);[a22_0x15ef4a(0xe2)]='Resume\x20a\x20paused\x20campaign';async[a22_0x15ef4a(0xb4)](_0x2c7299){const _0x44aa8a=a22_0x15ef4a,{options:_0x35ff3f,args:_0x55f6ac,tdx:_0x36cbee}=_0x2c7299;if(_0x55f6ac['length']===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x44aa8a(0xea)](_0x44aa8a(0x119)),0x1;const _0x19fc15=_0x55f6ac[0x0],_0x458aed=_0x35ff3f,_0x559ffb=await resolveWorkspaceIdFromOptions(_0x458aed,_0x36cbee);return await withSpinner(_0x44aa8a(0xf7)+_0x19fc15+_0x44aa8a(0xb5),()=>_0x36cbee[_0x44aa8a(0xd1)]['resumeCampaign'](_0x19fc15,_0x559ffb),{'verbose':_0x35ff3f[_0x44aa8a(0xf5)]}),console[_0x44aa8a(0xa5)]('Campaign\x20\x27'+_0x19fc15+_0x44aa8a(0x14e)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xd8);[a22_0x15ef4a(0xe2)]='Duplicate\x20a\x20campaign';async[a22_0x15ef4a(0xb4)](_0x3dc0f1){const _0x46d143=a22_0x15ef4a,{options:_0x24696d,args:_0x2a3ca6,tdx:_0x155e71}=_0x3dc0f1;if(_0x2a3ca6[_0x46d143(0x12c)]===0x0)return console['error'](_0x46d143(0x139)),console[_0x46d143(0xea)]('Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>'),0x1;const _0x5d3e51=_0x2a3ca6[0x0],_0x3737de=_0x24696d,_0x5b3bc8=await resolveWorkspaceIdFromOptions(_0x3737de,_0x155e71),_0x481da7=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x5d3e51+'\x27...',()=>_0x155e71[_0x46d143(0xd1)][_0x46d143(0xf9)](_0x5d3e51,_0x5b3bc8),{'verbose':_0x24696d[_0x46d143(0xf5)]});return await handleSDKOutput([_0x481da7[_0x46d143(0xe8)]],_0x24696d),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x138);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x121);async['execute'](_0x43bd42){const _0x5e2eea=a22_0x15ef4a,{options:_0x514c36,args:_0x2ffdc9,tdx:_0x4c1acf}=_0x43bd42,_0x5511af=_0x2ffdc9[0x0],_0x357b11=resolveLimit(_0x514c36['limit'],DEFAULT_LLM_LIMIT),_0xe38ea0=_0x514c36,_0x952edc=await resolveWorkspaceIdFromOptions(_0xe38ea0,_0x4c1acf),_0x1615d7=await withSpinner('Fetching\x20templates...',()=>_0x4c1acf['engage'][_0x5e2eea(0xbf)]({'workspaceId':_0x952edc,'limit':_0x357b11}),{'verbose':_0x514c36[_0x5e2eea(0xf5)]});let _0x42a886=_0x1615d7[_0x5e2eea(0xe8)];_0x5511af&&(_0x42a886=_0x1615d7[_0x5e2eea(0xe8)][_0x5e2eea(0x103)](_0x18f777=>matchGlobPattern(_0x18f777['name'],_0x5511af)));const _0x76f585=_0x514c36['site'];if(isStructuredFormat(_0x514c36))await handleSDKOutput(_0x42a886,_0x514c36);else for(const _0x523eb9 of _0x42a886){const _0x15f42e=_0x523eb9[_0x5e2eea(0xbc)]?getTemplateUrl(_0x76f585,_0x523eb9[_0x5e2eea(0xbc)],_0x523eb9['id']):undefined,_0x4ab3b3=_0x15f42e?hyperlink(_0x523eb9['name'],_0x15f42e):_0x523eb9[_0x5e2eea(0xbe)];console[_0x5e2eea(0xa5)](_0x5e2eea(0xaf)+_0x4ab3b3);}return 0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']='engage:template:show';['description']=a22_0x15ef4a(0xcb);async[a22_0x15ef4a(0xb4)](_0x4e4499){const _0x3faa38=a22_0x15ef4a,{options:_0x228872,args:_0x559ace,tdx:_0x8d7c3b}=_0x4e4499;if(_0x559ace[_0x3faa38(0x12c)]===0x0)return console['error'](_0x3faa38(0x144)),console[_0x3faa38(0xea)](_0x3faa38(0x11e)),0x1;const _0x3c5e63=_0x559ace[0x0],_0x26c8db=_0x228872,_0x59db35=await resolveWorkspaceIdFromOptions(_0x26c8db,_0x8d7c3b),_0x5ad72a=_0x26c8db[_0x3faa38(0x118)];if(_0x5ad72a){const _0x1927ff=await withSpinner(_0x3faa38(0x12d)+_0x3c5e63+_0x3faa38(0xb5),()=>_0x8d7c3b['engage'][_0x3faa38(0xc7)](_0x3c5e63,_0x59db35),{'verbose':_0x228872['verbose']});await handleSDKOutput([_0x1927ff],_0x228872);}else{const _0x588804=await withSpinner(_0x3faa38(0x12d)+_0x3c5e63+_0x3faa38(0xb5),()=>_0x8d7c3b[_0x3faa38(0xd1)]['getTemplate'](_0x3c5e63,_0x59db35),{'verbose':_0x228872[_0x3faa38(0xf5)]});await handleSDKOutput([_0x588804],_0x228872);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']='engage:template:create';[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xd4);async[a22_0x15ef4a(0xb4)](_0x4c63ff){const _0x46a782=a22_0x15ef4a,{options:_0x653994,tdx:_0x547f5a}=_0x4c63ff,_0x489f36=_0x653994,_0x3b0cbb=_0x489f36[_0x46a782(0xbe)],_0x3a3160=_0x489f36[_0x46a782(0xc1)],_0x3cc209=_0x489f36[_0x46a782(0x10a)],_0x571c80=_0x489f36[_0x46a782(0x110)];if(!_0x3b0cbb)return console[_0x46a782(0xea)](_0x46a782(0xdb)),console[_0x46a782(0xea)](_0x46a782(0xc8)),0x1;if(!_0x3a3160)return console[_0x46a782(0xea)](_0x46a782(0xe6)),0x1;if(_0x3cc209&&_0x571c80)return console[_0x46a782(0xea)](_0x46a782(0x117)),0x1;const _0x86192e=_0x571c80?readFileContent(_0x571c80):_0x3cc209;if(!_0x86192e)return console['error']('Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required'),0x1;const _0x4edfeb=await resolveWorkspaceIdFromOptions(_0x489f36,_0x547f5a,!![]),_0x52a3d={'name':_0x3b0cbb,'subjectTemplate':_0x3a3160,'htmlTemplate':_0x86192e,'workspaceId':_0x4edfeb,'plaintextTemplate':_0x489f36[_0x46a782(0x109)],'editorType':_0x489f36[_0x46a782(0x143)]??'grapesjs'},_0x337890=await withSpinner('Creating\x20template\x20\x27'+_0x3b0cbb+_0x46a782(0xb5),()=>_0x547f5a[_0x46a782(0xd1)][_0x46a782(0x13d)](_0x52a3d));return await handleSDKOutput([_0x337890[_0x46a782(0xe8)]],_0x653994),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a22_0x15ef4a(0x92);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x12f);async[a22_0x15ef4a(0xb4)](_0x4487cd){const _0x55dc10=a22_0x15ef4a,{options:_0x20a915,args:_0x1b2186,tdx:_0xce3505}=_0x4487cd;if(_0x1b2186[_0x55dc10(0x12c)]===0x0)return console[_0x55dc10(0xea)](_0x55dc10(0x144)),console[_0x55dc10(0xea)](_0x55dc10(0x152)),0x1;const _0x55d3d1=_0x1b2186[0x0],_0x5835f6=_0x20a915,_0x228850=_0x5835f6[_0x55dc10(0x10a)],_0x852f59=_0x5835f6[_0x55dc10(0x110)];if(_0x228850&&_0x852f59)return console[_0x55dc10(0xea)]('Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file'),0x1;const _0x297061=_0x852f59?readFileContent(_0x852f59):_0x228850,_0x3eeeb7=await resolveWorkspaceIdFromOptions(_0x5835f6,_0xce3505),_0x1fb678={'name':_0x5835f6['name'],'subjectTemplate':_0x5835f6['subject'],'htmlTemplate':_0x297061,'plaintextTemplate':_0x5835f6[_0x55dc10(0x109)]},_0x1dddac=Object[_0x55dc10(0xec)](Object[_0x55dc10(0x9e)](_0x1fb678)['filter'](([,_0x3793ad])=>_0x3793ad!==undefined));if(Object[_0x55dc10(0x112)](_0x1dddac)[_0x55dc10(0x12c)]===0x0)return console[_0x55dc10(0xea)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0x55dc10(0x9c)),0x1;const _0x1b31fb=await withSpinner(_0x55dc10(0x8f)+_0x55d3d1+_0x55dc10(0xb5),()=>_0xce3505[_0x55dc10(0xd1)][_0x55dc10(0xc4)](_0x55d3d1,_0x1dddac,_0x3eeeb7),{'verbose':_0x20a915['verbose']});return await handleSDKOutput([_0x1b31fb[_0x55dc10(0xe8)]],_0x20a915),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{['name']='engage:template:delete';['description']='Delete\x20an\x20email\x20template';async[a22_0x15ef4a(0xb4)](_0x45ca6a){const _0x4c6fb9=a22_0x15ef4a,{options:_0x1c51e0,args:_0x29f3ca,tdx:_0x134fdc}=_0x45ca6a;if(_0x29f3ca['length']===0x0)return console['error'](_0x4c6fb9(0x144)),console['error'](_0x4c6fb9(0xce)),0x1;const _0x102c1a=_0x29f3ca[0x0],_0x166c07=_0x1c51e0,_0xf4604f=await resolveWorkspaceIdFromOptions(_0x166c07,_0x134fdc);if(!_0x1c51e0[_0x4c6fb9(0x14d)]){const _0xc38ccf=await confirm(_0x4c6fb9(0xd7)+_0x102c1a+_0x4c6fb9(0x96));if(!_0xc38ccf)return console['log'](_0x4c6fb9(0x129)),0x0;}return await withSpinner(_0x4c6fb9(0xfd)+_0x102c1a+'\x27...',()=>_0x134fdc[_0x4c6fb9(0xd1)]['deleteTemplate'](_0x102c1a,_0xf4604f),{'verbose':_0x1c51e0['verbose']}),console[_0x4c6fb9(0xa5)](_0x4c6fb9(0x10f)+_0x102c1a+_0x4c6fb9(0xf1)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xfb);['description']='List\x20workspaces';async[a22_0x15ef4a(0xb4)](_0x35427f){const _0xde0864=a22_0x15ef4a,{options:_0xa4b132,args:_0x1709a1,tdx:_0x4f3506}=_0x35427f,_0x5789be=_0x1709a1[0x0],_0xcfb97b=resolveLimit(_0xa4b132[_0xde0864(0x146)],DEFAULT_LLM_LIMIT),_0x98692b=await withSpinner(_0xde0864(0x93),()=>_0x4f3506[_0xde0864(0xd1)]['listWorkspaces']({'limit':_0xcfb97b}),{'verbose':_0xa4b132[_0xde0864(0xf5)]});let _0x5eac8a=_0x98692b[_0xde0864(0xe8)];_0x5789be&&(_0x5eac8a=_0x98692b[_0xde0864(0xe8)][_0xde0864(0x103)](_0x4cb5da=>matchGlobPattern(_0x4cb5da['name'],_0x5789be)));const _0x121c36=_0xa4b132[_0xde0864(0xcc)];if(isStructuredFormat(_0xa4b132))await handleSDKOutput(_0x5eac8a,_0xa4b132);else for(const _0x11f451 of _0x5eac8a){const _0x5c7617=getWorkspaceUrl(_0x121c36,_0x11f451['id']),_0x516f98=hyperlink(_0x11f451[_0xde0864(0xbe)],_0x5c7617);console[_0xde0864(0xa5)](_0xde0864(0xe9)+_0x516f98);}return 0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]='engage:workspace:show';[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x11f);async[a22_0x15ef4a(0xb4)](_0x225a08){const _0x4e13d1=a22_0x15ef4a,{options:_0x44ea4c,args:_0x3300d1,tdx:_0x35da85}=_0x225a08;if(_0x3300d1[_0x4e13d1(0x12c)]===0x0)return console[_0x4e13d1(0xea)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x4e13d1(0xea)](_0x4e13d1(0xb0)),0x1;const _0x1b9028=_0x3300d1[0x0],_0x2f25d0=_0x44ea4c,_0x122218=_0x2f25d0[_0x4e13d1(0x118)];if(_0x122218){const _0x1d99da=await withSpinner('Fetching\x20workspace\x20\x27'+_0x1b9028+_0x4e13d1(0xb5),()=>_0x35da85[_0x4e13d1(0xd1)][_0x4e13d1(0xd2)](_0x1b9028),{'verbose':_0x44ea4c[_0x4e13d1(0xf5)]});await handleSDKOutput([_0x1d99da],_0x44ea4c);}else{const _0x3d1b19=await withSpinner(_0x4e13d1(0xb3)+_0x1b9028+_0x4e13d1(0xb5),()=>_0x35da85[_0x4e13d1(0xd1)][_0x4e13d1(0xdd)](_0x1b9028),{'verbose':_0x44ea4c['verbose']});await handleSDKOutput([_0x3d1b19],_0x44ea4c);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a22_0x15ef4a(0x12e);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x99);async[a22_0x15ef4a(0xb4)](_0x34106b){const _0x2b11bc=a22_0x15ef4a,{options:_0x54bc1a,tdx:_0x3752b7}=_0x34106b,_0x2cb48d=_0x54bc1a,_0x6e3107=_0x2cb48d[_0x2b11bc(0xbe)];if(!_0x6e3107)return console['error'](_0x2b11bc(0xdb)),console[_0x2b11bc(0xea)](_0x2b11bc(0xbb)),0x1;const _0x260471={'name':_0x6e3107,'description':_0x2cb48d[_0x2b11bc(0xe2)]},_0x5dca73=await withSpinner(_0x2b11bc(0x14a)+_0x6e3107+_0x2b11bc(0xb5),()=>_0x3752b7['engage']['createWorkspace'](_0x260471));return await handleSDKOutput([_0x5dca73['data']],_0x54bc1a),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xa0);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xee);async[a22_0x15ef4a(0xb4)](_0x5dc959){const _0x38ca2b=a22_0x15ef4a,{options:_0x5cc600,args:_0x15c64c,tdx:_0x19486a}=_0x5dc959;if(_0x15c64c[_0x38ca2b(0x12c)]===0x0)return console[_0x38ca2b(0xea)](_0x38ca2b(0x14c)),console[_0x38ca2b(0xea)]('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x107051=_0x15c64c[0x0],_0x21d9d8=_0x5cc600,_0x5b459e={'name':_0x21d9d8[_0x38ca2b(0xbe)],'description':_0x21d9d8[_0x38ca2b(0xe2)]},_0x134505=Object[_0x38ca2b(0xec)](Object['entries'](_0x5b459e)[_0x38ca2b(0x103)](([,_0x471b08])=>_0x471b08!==undefined));if(Object[_0x38ca2b(0x112)](_0x134505)[_0x38ca2b(0x12c)]===0x0)return console['error'](_0x38ca2b(0x140)),console[_0x38ca2b(0xea)]('Options:\x20--name,\x20--description'),0x1;const _0x54009c=await withSpinner('Updating\x20workspace\x20\x27'+_0x107051+_0x38ca2b(0xb5),()=>_0x19486a['engage'][_0x38ca2b(0xa2)](_0x107051,_0x134505),{'verbose':_0x5cc600[_0x38ca2b(0xf5)]});return await handleSDKOutput([_0x54009c['data']],_0x5cc600),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]='engage:workspace:delete';[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xdf);async[a22_0x15ef4a(0xb4)](_0xb71af9){const _0x275300=a22_0x15ef4a,{options:_0xab8203,args:_0x360e4b,tdx:_0x7c19b6}=_0xb71af9;if(_0x360e4b['length']===0x0)return console[_0x275300(0xea)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x275300(0x9a)),0x1;const _0x17e8cc=_0x360e4b[0x0];if(!_0xab8203[_0x275300(0x14d)]){const _0x27ca62=await confirm(_0x275300(0x135)+_0x17e8cc+_0x275300(0x96));if(!_0x27ca62)return console[_0x275300(0xa5)](_0x275300(0x129)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x17e8cc+_0x275300(0xb5),()=>_0x7c19b6[_0x275300(0xd1)]['deleteWorkspace'](_0x17e8cc),{'verbose':_0xab8203['verbose']}),console[_0x275300(0xa5)](_0x275300(0x12a)+_0x17e8cc+_0x275300(0xf1)),0x0;}}export class EngageAlwaysOnCampaignsCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x136);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xf2);async[a22_0x15ef4a(0xb4)](_0x384f45){const _0x24579f=a22_0x15ef4a,{options:_0xf6a73f,args:_0x2f60c2,tdx:_0x59bec2}=_0x384f45,_0x51bdb5=_0x2f60c2[0x0],_0x397dc0=resolveLimit(_0xf6a73f['limit'],DEFAULT_LLM_LIMIT),_0x516da9=_0xf6a73f,_0x1bbb8a=_0x516da9[_0x24579f(0x15b)],_0x236025=[_0x24579f(0x101),'LIVE',_0x24579f(0x98),_0x24579f(0x105)],_0x500c9c=_0x516da9[_0x24579f(0xb8)],_0x4755fc=_0x500c9c?.['toUpperCase']();if(_0x4755fc&&!_0x236025[_0x24579f(0xf8)](_0x4755fc))return console[_0x24579f(0xea)](_0x24579f(0xef)+_0x500c9c+_0x24579f(0xda)+_0x236025[_0x24579f(0xc6)](',\x20')),0x1;const _0x1b3490=await resolveWorkspaceIdFromOptions(_0x516da9,_0x59bec2,!![]),_0x4621b8=await withSpinner(_0x24579f(0x15c),()=>_0x59bec2[_0x24579f(0xd1)]['listAlwaysOnCampaigns']({'workspaceId':_0x1b3490,'type':_0x1bbb8a,'status':_0x4755fc,'limit':_0x397dc0}),{'verbose':_0xf6a73f[_0x24579f(0xf5)]});let _0x337b89=_0x4621b8[_0x24579f(0xe8)];_0x4755fc&&(_0x337b89=_0x337b89[_0x24579f(0x103)](_0x26cb97=>_0x26cb97[_0x24579f(0xb8)][_0x24579f(0x108)]()===_0x4755fc));_0x51bdb5&&(_0x337b89=_0x337b89[_0x24579f(0x103)](_0x11ab35=>matchGlobPattern(_0x11ab35[_0x24579f(0xbe)],_0x51bdb5)));const _0x343c35=_0xf6a73f['site'];if(isStructuredFormat(_0xf6a73f)){const _0x334b9c=_0x337b89[_0x24579f(0xca)](_0x252d28=>({..._0x252d28,'url':getCampaignUrl(_0x343c35,_0x252d28[_0x24579f(0xbc)],_0x252d28['id'])}));await handleSDKOutput(_0x334b9c,_0xf6a73f);}else for(const _0x4112cf of _0x337b89){const _0x36791f=a22_0x464f89[_0x24579f(0xe7)]('\x20('+_0x4112cf[_0x24579f(0xb8)][_0x24579f(0x158)]()+')'),_0x21213d=getCampaignUrl(_0x343c35,_0x4112cf[_0x24579f(0xbc)],_0x4112cf['id']),_0x2138d8=hyperlink(_0x4112cf['name'],_0x21213d);console[_0x24579f(0xa5)](_0x24579f(0xc5)+_0x2138d8+_0x36791f);}return 0x0;}}export class EngageAlwaysOnCampaignShowCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0xae);[a22_0x15ef4a(0xe2)]='Show\x20always-on\x20campaign\x20details';async[a22_0x15ef4a(0xb4)](_0x2b0c1e){const _0xc488e6=a22_0x15ef4a,{options:_0x4b94dd,args:_0x598da7,tdx:_0x41adde}=_0x2b0c1e;if(_0x598da7[_0xc488e6(0x12c)]===0x0)return console[_0xc488e6(0xea)](_0xc488e6(0x139)),console[_0xc488e6(0xea)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20show\x20<name-or-id>'),0x1;const _0x5728e1=_0x598da7[0x0],_0x2ec56e=_0x4b94dd,_0x1d11d2=await resolveWorkspaceIdFromOptions(_0x2ec56e,_0x41adde,!![]),_0x3d2925=_0x2ec56e[_0xc488e6(0x118)],_0x44e12e=_0x4b94dd[_0xc488e6(0xcc)];if(_0x3d2925){const _0x1b201c=await withSpinner(_0xc488e6(0x11b)+_0x5728e1+_0xc488e6(0xb5),()=>_0x41adde[_0xc488e6(0xd1)][_0xc488e6(0xe5)](_0x1d11d2,_0x5728e1),{'verbose':_0x4b94dd[_0xc488e6(0xf5)]}),_0xb1ee55=_0x1b201c[_0xc488e6(0xe8)],_0x5e2d72=getCampaignUrl(_0x44e12e,_0xb1ee55[_0xc488e6(0x133)][_0xc488e6(0xbc)],_0xb1ee55['id']);await handleSDKOutput([{..._0xb1ee55,'url':_0x5e2d72}],_0x4b94dd);}else{const _0x36354f=await withSpinner(_0xc488e6(0x11b)+_0x5728e1+'\x27...',()=>_0x41adde[_0xc488e6(0xd1)][_0xc488e6(0x94)](_0x1d11d2,_0x5728e1),{'verbose':_0x4b94dd['verbose']}),_0x18ded5=_0x36354f[_0xc488e6(0xe8)],_0x4ee02b=getCampaignUrl(_0x44e12e,_0x18ded5[_0xc488e6(0xbc)],_0x18ded5['id']);await handleSingleObjectOutput({..._0x18ded5,'url':_0x4ee02b},_0x4b94dd);}return 0x0;}}export class EngageAlwaysOnCampaignCreateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x100);['description']=a22_0x15ef4a(0x91);async[a22_0x15ef4a(0xb4)](_0x23f8aa){const _0x2a06b6=a22_0x15ef4a,{options:_0x1ab345,tdx:_0xf6f02a}=_0x23f8aa,_0x5ad94d=_0x1ab345,_0x639abc=_0x5ad94d[_0x2a06b6(0xbe)],_0x508366=_0x5ad94d[_0x2a06b6(0x15b)];if(!_0x639abc)return console['error'](_0x2a06b6(0xdb)),console[_0x2a06b6(0xea)](_0x2a06b6(0x111)),0x1;if(!_0x508366)return console['error'](_0x2a06b6(0x141)),console[_0x2a06b6(0xea)](_0x2a06b6(0x111)),0x1;const _0x5146b5=await resolveWorkspaceIdFromOptions(_0x5ad94d,_0xf6f02a,!![]),_0x393a3b=await resolveSegmentFromOptions(_0x5ad94d,_0xf6f02a),_0x5174f6={'name':_0x639abc,'campaignType':_0x508366,'workspaceId':_0x5146b5,'description':_0x5ad94d['description'],'audienceId':_0x393a3b['audienceId'],'audienceName':_0x393a3b['audienceName'],'enableUtmTracking':_0x5ad94d[_0x2a06b6(0x115)]},_0x422673=await withSpinner(_0x2a06b6(0xfc)+_0x639abc+_0x2a06b6(0xb5),()=>_0xf6f02a[_0x2a06b6(0xd1)][_0x2a06b6(0x11a)](_0x5146b5,_0x5174f6));return await handleSDKOutput([_0x422673[_0x2a06b6(0xe8)]],_0x1ab345),0x0;}}export class EngageAlwaysOnCampaignUpdateCommand extends BaseCommand{['name']=a22_0x15ef4a(0xb6);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xd0);async['execute'](_0xc3e622){const _0x2a4318=a22_0x15ef4a,{options:_0x47dbcd,args:_0x5cd1d4,tdx:_0x49a63c}=_0xc3e622;if(_0x5cd1d4['length']===0x0)return console[_0x2a4318(0xea)](_0x2a4318(0x139)),console[_0x2a4318(0xea)](_0x2a4318(0x132)),0x1;const _0x286970=_0x5cd1d4[0x0],_0x292496=_0x47dbcd,_0x2d846f=await resolveWorkspaceIdFromOptions(_0x292496,_0x49a63c,!![]),_0x3cfb36=await resolveSegmentFromOptions(_0x292496,_0x49a63c),_0x535620={'name':_0x292496['name'],'description':_0x292496[_0x2a4318(0xe2)],'audienceId':_0x3cfb36[_0x2a4318(0x148)],'audienceName':_0x3cfb36[_0x2a4318(0x134)],'enableUtmTracking':_0x292496[_0x2a4318(0x115)]},_0x4de48b=Object[_0x2a4318(0xec)](Object[_0x2a4318(0x9e)](_0x535620)['filter'](([,_0x4afea3])=>_0x4afea3!==undefined));if(Object['keys'](_0x4de48b)['length']===0x0)return console[_0x2a4318(0xea)](_0x2a4318(0x140)),console[_0x2a4318(0xea)](_0x2a4318(0xad)),0x1;const _0x5e0210=await withSpinner('Updating\x20always-on\x20campaign\x20\x27'+_0x286970+_0x2a4318(0xb5),()=>_0x49a63c[_0x2a4318(0xd1)][_0x2a4318(0x149)](_0x2d846f,_0x286970,_0x4de48b),{'verbose':_0x47dbcd['verbose']});return await handleSDKOutput([_0x5e0210[_0x2a4318(0xe8)]],_0x47dbcd),0x0;}}export class EngageAlwaysOnCampaignDeleteCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x157);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xba);async[a22_0x15ef4a(0xb4)](_0x385fdd){const _0x1f25f7=a22_0x15ef4a,{options:_0x36fad0,args:_0x33d83c,tdx:_0x325acb}=_0x385fdd;if(_0x33d83c[_0x1f25f7(0x12c)]===0x0)return console[_0x1f25f7(0xea)](_0x1f25f7(0x139)),console[_0x1f25f7(0xea)](_0x1f25f7(0x10e)),0x1;const _0xd0f621=_0x33d83c[0x0],_0x41b7cc=_0x36fad0,_0x26088e=await resolveWorkspaceIdFromOptions(_0x41b7cc,_0x325acb,!![]);if(!_0x36fad0['yes']){const _0x4c1cde=await confirm(_0x1f25f7(0x131)+_0xd0f621+_0x1f25f7(0x96));if(!_0x4c1cde)return console[_0x1f25f7(0xa5)](_0x1f25f7(0x129)),0x0;}return await withSpinner(_0x1f25f7(0xb2)+_0xd0f621+'\x27...',()=>_0x325acb[_0x1f25f7(0xd1)][_0x1f25f7(0xb7)](_0x26088e,_0xd0f621),{'verbose':_0x36fad0[_0x1f25f7(0xf5)]}),console[_0x1f25f7(0xa5)](_0x1f25f7(0x104)+_0xd0f621+_0x1f25f7(0xf1)),0x0;}}export class EngageAlwaysOnCampaignLaunchCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x154);['description']=a22_0x15ef4a(0x124);async[a22_0x15ef4a(0xb4)](_0x5a3306){const _0x188646=a22_0x15ef4a,{options:_0xf9c224,args:_0x4c628e,tdx:_0x17f8db}=_0x5a3306;if(_0x4c628e['length']===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x188646(0x10d)),0x1;const _0xa67c78=_0x4c628e[0x0],_0x30555d=_0xf9c224,_0x2fe9bd=await resolveWorkspaceIdFromOptions(_0x30555d,_0x17f8db,!![]);return await withSpinner(_0x188646(0x107)+_0xa67c78+_0x188646(0xb5),()=>_0x17f8db[_0x188646(0xd1)]['launchAlwaysOnCampaign'](_0x2fe9bd,_0xa67c78),{'verbose':_0xf9c224[_0x188646(0xf5)]}),console[_0x188646(0xa5)](_0x188646(0x104)+_0xa67c78+_0x188646(0x130)),0x0;}}export class EngageAlwaysOnCampaignPauseCommand extends BaseCommand{['name']=a22_0x15ef4a(0xc2);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0xf3);async[a22_0x15ef4a(0xb4)](_0x225ead){const _0x4105f0=a22_0x15ef4a,{options:_0x47a58b,args:_0x52e07c,tdx:_0x9f9760}=_0x225ead;if(_0x52e07c['length']===0x0)return console[_0x4105f0(0xea)](_0x4105f0(0x139)),console[_0x4105f0(0xea)](_0x4105f0(0xac)),0x1;const _0x2dd909=_0x52e07c[0x0],_0xe29dd4=_0x47a58b,_0x20b6c2=await resolveWorkspaceIdFromOptions(_0xe29dd4,_0x9f9760,!![]);return await withSpinner('Pausing\x20always-on\x20campaign\x20\x27'+_0x2dd909+_0x4105f0(0xb5),()=>_0x9f9760[_0x4105f0(0xd1)][_0x4105f0(0xff)](_0x20b6c2,_0x2dd909),{'verbose':_0x47a58b['verbose']}),console[_0x4105f0(0xa5)](_0x4105f0(0x104)+_0x2dd909+_0x4105f0(0xfa)),0x0;}}export class EngageAlwaysOnCampaignResumeCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]='engage:always-on-campaign:resume';[a22_0x15ef4a(0xe2)]='Resume\x20a\x20paused\x20always-on\x20campaign';async[a22_0x15ef4a(0xb4)](_0x56cd12){const _0x5611e1=a22_0x15ef4a,{options:_0x5579b1,args:_0x44098c,tdx:_0x3c8d7f}=_0x56cd12;if(_0x44098c[_0x5611e1(0x12c)]===0x0)return console['error'](_0x5611e1(0x139)),console['error'](_0x5611e1(0x159)),0x1;const _0x581b11=_0x44098c[0x0],_0xab6b95=_0x5579b1,_0x94d5f7=await resolveWorkspaceIdFromOptions(_0xab6b95,_0x3c8d7f,!![]);return await withSpinner('Resuming\x20always-on\x20campaign\x20\x27'+_0x581b11+'\x27...',()=>_0x3c8d7f[_0x5611e1(0xd1)][_0x5611e1(0xb1)](_0x94d5f7,_0x581b11),{'verbose':_0x5579b1['verbose']}),console[_0x5611e1(0xa5)](_0x5611e1(0x104)+_0x581b11+_0x5611e1(0x14e)),0x0;}}export class EngageAlwaysOnCampaignFinishCommand extends BaseCommand{['name']='engage:always-on-campaign:finish';[a22_0x15ef4a(0xe2)]='Finish\x20an\x20always-on\x20campaign';async[a22_0x15ef4a(0xb4)](_0x2462b3){const _0x4fca5a=a22_0x15ef4a,{options:_0x32fdaa,args:_0x30a846,tdx:_0x20bb10}=_0x2462b3;if(_0x30a846['length']===0x0)return console[_0x4fca5a(0xea)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20always-on-campaign\x20finish\x20<name-or-id>'),0x1;const _0x33df49=_0x30a846[0x0],_0x1b4ac2=_0x32fdaa,_0x4d622b=await resolveWorkspaceIdFromOptions(_0x1b4ac2,_0x20bb10,!![]);if(!_0x32fdaa['yes']){const _0x1993db=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20finish\x20campaign\x20\x27'+_0x33df49+_0x4fca5a(0x96));if(!_0x1993db)return console['log'](_0x4fca5a(0x129)),0x0;}return await withSpinner(_0x4fca5a(0x102)+_0x33df49+_0x4fca5a(0xb5),()=>_0x20bb10['engage']['finishAlwaysOnCampaign'](_0x4d622b,_0x33df49),{'verbose':_0x32fdaa[_0x4fca5a(0xf5)]}),console[_0x4fca5a(0xa5)]('Always-on\x20campaign\x20\x27'+_0x33df49+_0x4fca5a(0xc9)),0x0;}}export class EngageAlwaysOnCampaignDuplicateCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]='engage:always-on-campaign:duplicate';[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x97);async[a22_0x15ef4a(0xb4)](_0x26c6f7){const _0x31f645=a22_0x15ef4a,{options:_0x5dab04,args:_0x99d50e,tdx:_0x3a9f45}=_0x26c6f7;if(_0x99d50e[_0x31f645(0x12c)]===0x0)return console[_0x31f645(0xea)](_0x31f645(0x139)),console[_0x31f645(0xea)](_0x31f645(0x10b)),0x1;const _0x3ca3ed=_0x99d50e[0x0],_0x492172=_0x5dab04,_0x10037c=await resolveWorkspaceIdFromOptions(_0x492172,_0x3a9f45,!![]),_0x50dd70=_0x492172[_0x31f645(0xbe)],_0x474aa4=await withSpinner(_0x31f645(0x128)+_0x3ca3ed+_0x31f645(0xb5),()=>_0x3a9f45['engage'][_0x31f645(0x13f)](_0x10037c,_0x3ca3ed,_0x50dd70),{'verbose':_0x5dab04['verbose']});return await handleSDKOutput([_0x474aa4[_0x31f645(0xe8)]],_0x5dab04),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a22_0x15ef4a(0xbe)]=a22_0x15ef4a(0x11d);[a22_0x15ef4a(0xe2)]=a22_0x15ef4a(0x122);async[a22_0x15ef4a(0xb4)](_0x44c646){const _0x532dc4=a22_0x15ef4a,{options:_0x4a0763,args:_0x41c04e,tdx:_0x442211}=_0x44c646;if(_0x41c04e[_0x532dc4(0x12c)]===0x0)return console[_0x532dc4(0xea)](_0x532dc4(0xf4)),console[_0x532dc4(0xea)](_0x532dc4(0x13c)),0x1;const _0x25629c=_0x41c04e[0x0];await withSpinner(_0x532dc4(0xd6)+_0x25629c+_0x532dc4(0xb5),()=>_0x442211[_0x532dc4(0xd1)][_0x532dc4(0x120)](_0x25629c));const _0x5b212d=_0x4a0763[_0x532dc4(0xa3)]||undefined;return saveSessionContext({'engage_workspace':_0x25629c},_0x5b212d),console[_0x532dc4(0xa5)](_0x532dc4(0x13b)+_0x25629c),console[_0x532dc4(0xa5)](_0x532dc4(0xcf)),0x0;}}
|
|
1
|
+
const a22_0x24a660=a22_0x4fc9;(function(_0x140814,_0x3ea65e){const _0x5b82ed=a22_0x4fc9,_0x161b68=_0x140814();while(!![]){try{const _0x179a9e=parseInt(_0x5b82ed(0x1d9))/0x1*(parseInt(_0x5b82ed(0x1b4))/0x2)+parseInt(_0x5b82ed(0x204))/0x3+parseInt(_0x5b82ed(0x176))/0x4*(-parseInt(_0x5b82ed(0x1f1))/0x5)+-parseInt(_0x5b82ed(0x195))/0x6*(parseInt(_0x5b82ed(0x167))/0x7)+-parseInt(_0x5b82ed(0x20e))/0x8+-parseInt(_0x5b82ed(0x17c))/0x9+-parseInt(_0x5b82ed(0x198))/0xa*(-parseInt(_0x5b82ed(0x19d))/0xb);if(_0x179a9e===_0x3ea65e)break;else _0x161b68['push'](_0x161b68['shift']());}catch(_0x55b7ae){_0x161b68['push'](_0x161b68['shift']());}}}(a22_0x5275,0xab569));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput}from'../core/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';import{loadSessionContext,saveSessionContext}from'../core/session.js';import{readFileContent}from'../utils/file-reader.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../core/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';function a22_0x4fc9(_0x2c70a0,_0xb454d0){_0x2c70a0=_0x2c70a0-0x14d;const _0x5275bf=a22_0x5275();let _0x4fc918=_0x5275bf[_0x2c70a0];return _0x4fc918;}import{getCampaignUrl,getTemplateUrl,getWorkspaceUrl}from'../sdk/client/endpoints.js';import{isStructuredFormat}from'../core/command-output.js';import{hyperlink}from'../sdk/util/formatters.js';import a22_0x55b1ba from'chalk';export async function resolveWorkspaceIdFromOptions(_0x1a79f4,_0xa71371,_0xb62fa=![]){const _0x209a6b=a22_0x4fc9;if(_0x1a79f4[_0x209a6b(0x170)])return await _0xa71371[_0x209a6b(0x1ff)][_0x209a6b(0x1dd)](_0x1a79f4[_0x209a6b(0x170)]);const _0x3eafca=loadSessionContext(_0x1a79f4[_0x209a6b(0x152)]);if(_0x3eafca?.[_0x209a6b(0x1c1)])return await _0xa71371[_0x209a6b(0x1ff)]['resolveWorkspaceId'](_0x3eafca['engage_workspace']);if(_0xb62fa)throw new SDKError(ErrorCode[_0x209a6b(0x18f)],_0x209a6b(0x1db),undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x5ab480,_0x163df1){const _0x377e83=a22_0x4fc9;if(!_0x5ab480[_0x377e83(0x1df)])return{};const _0x42f88a=_0x5ab480[_0x377e83(0x1df)],_0x5ba36d=await _0x163df1[_0x377e83(0x1df)][_0x377e83(0x1be)](_0x42f88a);return{'audienceId':_0x5ba36d['parentId'],'audienceName':_0x5ba36d[_0x377e83(0x17e)],..._0x5ba36d[_0x377e83(0x15c)]&&{'segmentId':_0x5ba36d[_0x377e83(0x15c)],'segmentName':_0x5ba36d[_0x377e83(0x1aa)]}};}function buildConnectorConfig(_0x3ea04b){const _0x4f5c80=a22_0x4fc9,_0x466ae4=_0x3ea04b[_0x4f5c80(0x1ba)],_0x36b6de=_0x3ea04b[_0x4f5c80(0x179)];if(!_0x466ae4&&!_0x36b6de)return undefined;return{..._0x466ae4&&{'emailSenderId':_0x466ae4},..._0x36b6de&&{'jsonColumns':_0x36b6de}};}export class EngageCampaignsCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x1ce);[a22_0x24a660(0x1d4)]=a22_0x24a660(0x1e3);async[a22_0x24a660(0x14d)](_0x13a767){const _0x4462d6=a22_0x24a660,{options:_0x1507c0,args:_0x1d190d,tdx:_0x2ed67d}=_0x13a767,_0x345333=_0x1d190d[0x0],_0x42b63b=resolveLimit(_0x1507c0['limit'],DEFAULT_LLM_LIMIT),_0xb7665a=_0x1507c0,_0x4e472c=_0xb7665a[_0x4462d6(0x1e4)],_0x443c28=[_0x4462d6(0x21f),_0x4462d6(0x1d3),_0x4462d6(0x200),_0x4462d6(0x178)],_0x5a5663=_0xb7665a[_0x4462d6(0x14e)],_0x2f48f4=_0x5a5663?.[_0x4462d6(0x16e)]();if(_0x2f48f4&&!_0x443c28[_0x4462d6(0x168)](_0x2f48f4))return console[_0x4462d6(0x1f0)]('Error:\x20Invalid\x20status\x20\x22'+_0x5a5663+'\x22.\x20Valid\x20values:\x20'+_0x443c28[_0x4462d6(0x17a)](',\x20')),0x1;const _0x2582f9=await resolveWorkspaceIdFromOptions(_0xb7665a,_0x2ed67d),_0x1e4093=await withSpinner('Fetching\x20campaigns...',()=>_0x2ed67d[_0x4462d6(0x1ff)][_0x4462d6(0x1ae)]({'type':_0x4e472c,'status':_0x2f48f4,'workspaceId':_0x2582f9,'limit':_0x42b63b}),{'verbose':_0x1507c0[_0x4462d6(0x166)]});let _0x59d1c7=_0x1e4093[_0x4462d6(0x1e6)];_0x2f48f4&&(_0x59d1c7=_0x59d1c7['filter'](_0x356756=>_0x356756[_0x4462d6(0x14e)][_0x4462d6(0x16e)]()===_0x2f48f4));_0x345333&&(_0x59d1c7=_0x59d1c7[_0x4462d6(0x1b9)](_0x491a99=>matchGlobPattern(_0x491a99[_0x4462d6(0x1eb)],_0x345333)));const _0xcedfb=_0x1507c0[_0x4462d6(0x1f6)];if(isStructuredFormat(_0x1507c0)){const _0x4dc223=_0x59d1c7[_0x4462d6(0x172)](_0x1e1000=>({..._0x1e1000,'url':_0x1e1000[_0x4462d6(0x20a)]?getCampaignUrl(_0xcedfb,_0x1e1000[_0x4462d6(0x20a)],_0x1e1000['id']):undefined}));await handleSDKOutput(_0x4dc223,_0x1507c0);}else for(const _0x5b90a6 of _0x59d1c7){const _0x44eaed=a22_0x55b1ba[_0x4462d6(0x17f)]('\x20('+_0x5b90a6[_0x4462d6(0x14e)][_0x4462d6(0x1cc)]()+')'),_0x159580=_0x5b90a6[_0x4462d6(0x20a)]?getCampaignUrl(_0xcedfb,_0x5b90a6[_0x4462d6(0x20a)],_0x5b90a6['id']):undefined,_0x4b165f=_0x159580?hyperlink(_0x5b90a6['name'],_0x159580):_0x5b90a6['name'];console['log'](_0x4462d6(0x222)+_0x4b165f+_0x44eaed);}return 0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x1d2);[a22_0x24a660(0x1d4)]=a22_0x24a660(0x1d6);async[a22_0x24a660(0x14d)](_0xdfcec7){const _0x566e4b=a22_0x24a660,{options:_0x27f137,args:_0x5e819e,tdx:_0x2c1cda}=_0xdfcec7;if(_0x5e819e[_0x566e4b(0x1ef)]===0x0)return console[_0x566e4b(0x1f0)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x566e4b(0x1f0)](_0x566e4b(0x206)),0x1;const _0x4dad9a=_0x5e819e[0x0],_0x538c9e=_0x27f137,_0x1cd26e=await resolveWorkspaceIdFromOptions(_0x538c9e,_0x2c1cda),_0x4b17c3=_0x538c9e[_0x566e4b(0x1e8)],_0x16db6c=_0x27f137[_0x566e4b(0x1f6)];if(_0x4b17c3){const _0x1d4d34=await withSpinner(_0x566e4b(0x165)+_0x4dad9a+_0x566e4b(0x1f9),()=>_0x2c1cda[_0x566e4b(0x1ff)][_0x566e4b(0x18d)](_0x4dad9a,_0x1cd26e),{'verbose':_0x27f137[_0x566e4b(0x166)]}),_0x12224d=_0x1d4d34[_0x566e4b(0x1e6)],_0x3c96cf=_0x12224d['attributes'][_0x566e4b(0x20a)]?getCampaignUrl(_0x16db6c,_0x12224d[_0x566e4b(0x1e2)][_0x566e4b(0x20a)],_0x12224d['id']):undefined;await handleSDKOutput([{..._0x12224d,..._0x3c96cf&&{'url':_0x3c96cf}}],_0x27f137);}else{const _0x2a0462=await withSpinner(_0x566e4b(0x165)+_0x4dad9a+_0x566e4b(0x1f9),()=>_0x2c1cda[_0x566e4b(0x1ff)][_0x566e4b(0x190)](_0x4dad9a,_0x1cd26e),{'verbose':_0x27f137['verbose']}),_0x4ce198=_0x2a0462[_0x566e4b(0x1e6)],_0x5e7f21=_0x4ce198['workspaceId']?getCampaignUrl(_0x16db6c,_0x4ce198[_0x566e4b(0x20a)],_0x4ce198['id']):undefined;await handleSingleObjectOutput({..._0x4ce198,..._0x5e7f21&&{'url':_0x5e7f21}},_0x27f137);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x16b);['description']=a22_0x24a660(0x15a);async['execute'](_0x4d93d3){const _0x3f4272=a22_0x24a660,{options:_0x25db59,tdx:_0xb5cf4}=_0x4d93d3,_0x4fcd69=_0x25db59,_0x11cb0d=_0x4fcd69[_0x3f4272(0x1eb)],_0x4790bb=_0x4fcd69[_0x3f4272(0x1e4)];if(!_0x11cb0d)return console['error'](_0x3f4272(0x1bc)),console[_0x3f4272(0x1f0)]('Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x4790bb)return console[_0x3f4272(0x1f0)](_0x3f4272(0x19e)),console[_0x3f4272(0x1f0)](_0x3f4272(0x155)),0x1;const _0x3fd875=await resolveWorkspaceIdFromOptions(_0x4fcd69,_0xb5cf4,!![]),_0x489a7d=await resolveSegmentFromOptions(_0x4fcd69,_0xb5cf4),_0x5bb0b0=buildConnectorConfig(_0x4fcd69),_0x4d71a3={'name':_0x11cb0d,'campaignType':_0x4790bb,'workspaceId':_0x3fd875,'description':_0x4fcd69['description'],..._0x489a7d,'connectorConfig':_0x5bb0b0,'startAt':_0x4fcd69['startAt'],'timezone':_0x4fcd69[_0x3f4272(0x187)]},_0x140e7d=await withSpinner(_0x3f4272(0x1b0)+_0x11cb0d+'\x27...',()=>_0xb5cf4[_0x3f4272(0x1ff)][_0x3f4272(0x1c7)](_0x4d71a3));return await handleSDKOutput([_0x140e7d[_0x3f4272(0x1e6)]],_0x25db59),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{['name']=a22_0x24a660(0x21c);[a22_0x24a660(0x1d4)]='Update\x20a\x20campaign';async['execute'](_0x53a133){const _0x5bf0b7=a22_0x24a660,{options:_0x4f3ceb,args:_0x2b366e,tdx:_0x36a0fe}=_0x53a133;if(_0x2b366e[_0x5bf0b7(0x1ef)]===0x0)return console[_0x5bf0b7(0x1f0)](_0x5bf0b7(0x14f)),console[_0x5bf0b7(0x1f0)](_0x5bf0b7(0x1f8)),0x1;const _0x18436f=_0x2b366e[0x0],_0x2e4469=_0x4f3ceb,_0x297b34=await resolveWorkspaceIdFromOptions(_0x2e4469,_0x36a0fe),_0x94fd39=await resolveSegmentFromOptions(_0x2e4469,_0x36a0fe),_0x306c05=buildConnectorConfig(_0x2e4469),_0x12422e={'name':_0x2e4469[_0x5bf0b7(0x1eb)],'description':_0x2e4469[_0x5bf0b7(0x1d4)],..._0x94fd39,'connectorConfig':_0x306c05,'startAt':_0x2e4469[_0x5bf0b7(0x18c)],'timezone':_0x2e4469[_0x5bf0b7(0x187)]},_0x18bda1=Object[_0x5bf0b7(0x1c5)](Object[_0x5bf0b7(0x196)](_0x12422e)['filter'](([,_0xfa8d9b])=>_0xfa8d9b!==undefined));if(Object[_0x5bf0b7(0x213)](_0x18bda1)[_0x5bf0b7(0x1ef)]===0x0)return console[_0x5bf0b7(0x1f0)](_0x5bf0b7(0x159)),console[_0x5bf0b7(0x1f0)](_0x5bf0b7(0x1b2)),0x1;const _0x307395=await withSpinner('Updating\x20campaign\x20\x27'+_0x18436f+_0x5bf0b7(0x1f9),()=>_0x36a0fe[_0x5bf0b7(0x1ff)][_0x5bf0b7(0x1ac)](_0x18436f,_0x18bda1,_0x297b34),{'verbose':_0x4f3ceb['verbose']});return await handleSDKOutput([_0x307395['data']],_0x4f3ceb),0x0;}}function a22_0x5275(){const _0x5dd755=['FINISHED','Update\x20an\x20always-on\x20campaign','engage','PAUSED','duplicateCampaign','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20always-on\x20campaign\x20\x27','Show\x20email\x20template\x20details','808608ytIGyN','Always-on\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Resuming\x20campaign\x20\x27','listTemplates','Duplicate\x20a\x20campaign','workspaceId','Usage:\x20tdx\x20engage\x20always-on-campaign\x20pause\x20<name-or-id>','Creating\x20workspace\x20\x27','\x0aTip:\x20Use\x20\x27tdx\x20use\x20--clear\x27\x20to\x20clear\x20session\x20overrides','4291000JATqIp','Duplicate\x20an\x20always-on\x20campaign','Deleting\x20always-on\x20campaign\x20\x27','Engage\x20workspace\x20set\x20to:\x20','engage:always-on-campaign:finish','keys','subject','Launching\x20always-on\x20campaign\x20\x27','audienceName','log','html','engage:campaign:launch','yes','Usage:\x20tdx\x20engage\x20always-on-campaign\x20finish\x20<name-or-id>','engage:campaign:update','Create\x20a\x20workspace','Updating\x20template\x20\x27','DRAFT','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27','📧\x20','execute','status','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','createWorkspace','engage:always-on-campaign:duplicate','session','Creating\x20always-on\x20campaign\x20\x27','Fetching\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','\x27?\x20This\x20cannot\x20be\x20undone.','listWorkspaces','Usage:\x20tdx\x20engage\x20always-on-campaign\x20delete\x20<name-or-id>','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Create\x20a\x20new\x20campaign','Error:\x20Either\x20--html\x20or\x20--html-file\x20is\x20required','segmentId','engage:always-on-campaigns','Pausing\x20campaign\x20\x27','Delete\x20a\x20campaign','engage:workspace:create','engage:always-on-campaign:pause','engage:always-on-campaign:create','resumeAlwaysOnCampaign','\x27\x20resumed\x20successfully','Fetching\x20campaign\x20\x27','verbose','12677FZKLXU','includes','engage:template:update','Campaign\x20\x27','engage:campaign:create','Options:\x20--name,\x20--description,\x20--audience-id,\x20--enable-utm-tracking','Finish\x20an\x20always-on\x20campaign','toUpperCase','Usage:\x20tdx\x20engage\x20always-on-campaign\x20show\x20<name-or-id>','workspace','getTemplate','map','Resuming\x20always-on\x20campaign\x20\x27','Duplicating\x20campaign\x20\x27','engage:always-on-campaign:delete','1540azqqGW','Verifying\x20workspace\x20\x27','COMPLETED','jsonColumns','join','Deleting\x20campaign\x20\x27','10746918dtDoeH','\x27\x20deleted\x20successfully','parentName','dim','getAlwaysOnCampaignFull','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','deleteCampaign','Fetching\x20templates...','Pause\x20a\x20campaign','deleteTemplate','timezone','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','engage:workspaces','listAlwaysOnCampaigns','engage:template:show','startAt','getCampaignFull','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27','MISSING_ARGUMENT','getCampaign','Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>','Fetching\x20always-on\x20campaign\x20\x27','Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file','🏢\x20','1326oGSWEz','entries','htmlFile','1060pDYzZF','updateWorkspace','deleteWorkspace','Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Error:\x20--subject\x20is\x20required','271359PYaikd','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Show\x20always-on\x20campaign\x20details','audienceId','Update\x20a\x20workspace','Delete\x20an\x20always-on\x20campaign','Template\x20\x27','engage:campaign:duplicate','engage:always-on-campaign:update','pauseAlwaysOnCampaign','\x27\x20paused\x20successfully','limit','segmentName','Launch\x20an\x20always-on\x20campaign','updateCampaign','createTemplate','listCampaigns','editorType','Creating\x20campaign\x20\x27','Create\x20an\x20email\x20template','Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone','updateAlwaysOnCampaign','716gsLOZX','Pausing\x20always-on\x20campaign\x20\x27','launchAlwaysOnCampaign','\x27\x20launched\x20successfully','Resume\x20a\x20paused\x20campaign','filter','emailSenderId','Delete\x20a\x20workspace','Error:\x20--name\x20is\x20required','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','resolvePathToResource','Deleting\x20template\x20\x27','Set\x20workspace\x20context\x20for\x20Engage\x20commands','engage_workspace','getAlwaysOnCampaign','Fetching\x20template\x20\x27','Finishing\x20always-on\x20campaign\x20\x27','fromEntries','updateTemplate','createCampaign','engage:always-on-campaign:resume','Creating\x20template\x20\x27','Usage:\x20tdx\x20engage\x20always-on-campaign\x20launch\x20<name-or-id>','\x22.\x20Valid\x20values:\x20','toLowerCase','Usage:\x20tdx\x20engage\x20always-on-campaign\x20resume\x20<name-or-id>','engage:campaigns','📝\x20','Error:\x20Workspace\x20name\x20is\x20required','Show\x20workspace\x20details','engage:campaign:show','ACTIVE','description','enableUtmTracking','Show\x20campaign\x20details','engage:campaign:resume','List\x20workspaces','1553jHOuSJ','engage:campaign:pause','Workspace\x20is\x20required\x20for\x20this\x20operation','Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>','resolveWorkspaceId','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','segment','getTemplateFull','Usage:\x20tdx\x20engage\x20always-on-campaign\x20duplicate\x20<name-or-id>\x20[--name\x20<new-name>]','attributes','List\x20campaigns','type','pauseCampaign','data','getWorkspace','full','engage:workspace:update','plaintext','name','Options:\x20--name,\x20--description','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','engage:templates','length','error','7895oRKVNU','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','deleteAlwaysOnCampaign','Delete\x20an\x20email\x20template','Launch\x20a\x20campaign','site','Pause\x20an\x20always-on\x20campaign','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','\x27...','Operation\x20cancelled','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Fetching\x20always-on\x20campaigns...'];a22_0x5275=function(){return _0x5dd755;};return a22_0x5275();}export class EngageCampaignDeleteCommand extends BaseCommand{['name']='engage:campaign:delete';[a22_0x24a660(0x1d4)]=a22_0x24a660(0x15f);async[a22_0x24a660(0x14d)](_0x1a61bc){const _0x29484c=a22_0x24a660,{options:_0x1c3dfc,args:_0x1a2877,tdx:_0x3c8725}=_0x1a61bc;if(_0x1a2877['length']===0x0)return console[_0x29484c(0x1f0)](_0x29484c(0x14f)),console['error'](_0x29484c(0x1ed)),0x1;const _0x5a0930=_0x1a2877[0x0],_0x54c015=_0x1c3dfc,_0x2c5e39=await resolveWorkspaceIdFromOptions(_0x54c015,_0x3c8725);if(!_0x1c3dfc[_0x29484c(0x21a)]){const _0x5c4637=await confirm(_0x29484c(0x18e)+_0x5a0930+_0x29484c(0x156));if(!_0x5c4637)return console[_0x29484c(0x217)](_0x29484c(0x1fa)),0x0;}return await withSpinner(_0x29484c(0x17b)+_0x5a0930+_0x29484c(0x1f9),()=>_0x3c8725[_0x29484c(0x1ff)][_0x29484c(0x183)](_0x5a0930,_0x2c5e39),{'verbose':_0x1c3dfc[_0x29484c(0x166)]}),console[_0x29484c(0x217)]('Campaign\x20\x27'+_0x5a0930+_0x29484c(0x17d)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x219);[a22_0x24a660(0x1d4)]=a22_0x24a660(0x1f5);async['execute'](_0x53efe6){const _0xcadb36=a22_0x24a660,{options:_0x4612ff,args:_0x1f23d8,tdx:_0x2f75f1}=_0x53efe6;if(_0x1f23d8['length']===0x0)return console[_0xcadb36(0x1f0)](_0xcadb36(0x14f)),console[_0xcadb36(0x1f0)]('Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'),0x1;const _0x2c0bf9=_0x1f23d8[0x0],_0x285702=_0x4612ff,_0x31214d=await resolveWorkspaceIdFromOptions(_0x285702,_0x2f75f1);return await withSpinner('Launching\x20campaign\x20\x27'+_0x2c0bf9+_0xcadb36(0x1f9),()=>_0x2f75f1[_0xcadb36(0x1ff)]['launchCampaign'](_0x2c0bf9,_0x31214d),{'verbose':_0x4612ff[_0xcadb36(0x166)]}),console[_0xcadb36(0x217)](_0xcadb36(0x16a)+_0x2c0bf9+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x1da);[a22_0x24a660(0x1d4)]=a22_0x24a660(0x185);async[a22_0x24a660(0x14d)](_0x45effa){const _0x46bb64=a22_0x24a660,{options:_0x5dec78,args:_0xed9fd9,tdx:_0xe09905}=_0x45effa;if(_0xed9fd9[_0x46bb64(0x1ef)]===0x0)return console[_0x46bb64(0x1f0)](_0x46bb64(0x14f)),console[_0x46bb64(0x1f0)](_0x46bb64(0x1dc)),0x1;const _0x4babb2=_0xed9fd9[0x0],_0x26d98c=_0x5dec78,_0x2f5836=await resolveWorkspaceIdFromOptions(_0x26d98c,_0xe09905);return await withSpinner(_0x46bb64(0x15e)+_0x4babb2+'\x27...',()=>_0xe09905[_0x46bb64(0x1ff)][_0x46bb64(0x1e5)](_0x4babb2,_0x2f5836),{'verbose':_0x5dec78['verbose']}),console['log'](_0x46bb64(0x16a)+_0x4babb2+_0x46bb64(0x1a8)),0x0;}}export class EngageCampaignResumeCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x1d7);['description']=a22_0x24a660(0x1b8);async[a22_0x24a660(0x14d)](_0x5ef0ee){const _0x4033c7=a22_0x24a660,{options:_0x5eb8ae,args:_0x47c280,tdx:_0x2065cf}=_0x5ef0ee;if(_0x47c280['length']===0x0)return console['error'](_0x4033c7(0x14f)),console['error'](_0x4033c7(0x1de)),0x1;const _0x701650=_0x47c280[0x0],_0x37652c=_0x5eb8ae,_0x408a37=await resolveWorkspaceIdFromOptions(_0x37652c,_0x2065cf);return await withSpinner(_0x4033c7(0x207)+_0x701650+_0x4033c7(0x1f9),()=>_0x2065cf[_0x4033c7(0x1ff)]['resumeCampaign'](_0x701650,_0x408a37),{'verbose':_0x5eb8ae[_0x4033c7(0x166)]}),console[_0x4033c7(0x217)](_0x4033c7(0x16a)+_0x701650+_0x4033c7(0x164)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x1a5);[a22_0x24a660(0x1d4)]=a22_0x24a660(0x209);async['execute'](_0x1fcdc5){const _0x56a8ad=a22_0x24a660,{options:_0x6bfc6d,args:_0x1e2c8e,tdx:_0xd956af}=_0x1fcdc5;if(_0x1e2c8e[_0x56a8ad(0x1ef)]===0x0)return console[_0x56a8ad(0x1f0)](_0x56a8ad(0x14f)),console[_0x56a8ad(0x1f0)](_0x56a8ad(0x182)),0x1;const _0x3c098c=_0x1e2c8e[0x0],_0x1b5826=_0x6bfc6d,_0xa9e2c9=await resolveWorkspaceIdFromOptions(_0x1b5826,_0xd956af),_0x3e526e=await withSpinner(_0x56a8ad(0x174)+_0x3c098c+_0x56a8ad(0x1f9),()=>_0xd956af[_0x56a8ad(0x1ff)][_0x56a8ad(0x201)](_0x3c098c,_0xa9e2c9),{'verbose':_0x6bfc6d[_0x56a8ad(0x166)]});return await handleSDKOutput([_0x3e526e['data']],_0x6bfc6d),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x1ee);[a22_0x24a660(0x1d4)]='List\x20email\x20templates';async[a22_0x24a660(0x14d)](_0x1fe762){const _0x54c76f=a22_0x24a660,{options:_0x4819e4,args:_0x43c7af,tdx:_0x154db6}=_0x1fe762,_0x138303=_0x43c7af[0x0],_0x471706=resolveLimit(_0x4819e4['limit'],DEFAULT_LLM_LIMIT),_0x14725d=_0x4819e4,_0x5b6920=await resolveWorkspaceIdFromOptions(_0x14725d,_0x154db6),_0x36c474=await withSpinner(_0x54c76f(0x184),()=>_0x154db6[_0x54c76f(0x1ff)][_0x54c76f(0x208)]({'workspaceId':_0x5b6920,'limit':_0x471706}),{'verbose':_0x4819e4[_0x54c76f(0x166)]});let _0x1b249b=_0x36c474['data'];_0x138303&&(_0x1b249b=_0x36c474['data']['filter'](_0x1c1ec8=>matchGlobPattern(_0x1c1ec8[_0x54c76f(0x1eb)],_0x138303)));const _0x2a9c86=_0x4819e4[_0x54c76f(0x1f6)];if(isStructuredFormat(_0x4819e4))await handleSDKOutput(_0x1b249b,_0x4819e4);else for(const _0x142c35 of _0x1b249b){const _0x47c406=_0x142c35[_0x54c76f(0x20a)]?getTemplateUrl(_0x2a9c86,_0x142c35['workspaceId'],_0x142c35['id']):undefined,_0x39669c=_0x47c406?hyperlink(_0x142c35[_0x54c76f(0x1eb)],_0x47c406):_0x142c35['name'];console[_0x54c76f(0x217)](_0x54c76f(0x1cf)+_0x39669c);}return 0x0;}}export class EngageTemplateShowCommand extends BaseCommand{['name']=a22_0x24a660(0x18b);[a22_0x24a660(0x1d4)]=a22_0x24a660(0x203);async[a22_0x24a660(0x14d)](_0x17a676){const _0x29ba01=a22_0x24a660,{options:_0xaa556d,args:_0x2b675e,tdx:_0x1f0cab}=_0x17a676;if(_0x2b675e[_0x29ba01(0x1ef)]===0x0)return console[_0x29ba01(0x1f0)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x29ba01(0x19f)),0x1;const _0x448d42=_0x2b675e[0x0],_0x32fe44=_0xaa556d,_0x25beea=await resolveWorkspaceIdFromOptions(_0x32fe44,_0x1f0cab),_0x264358=_0x32fe44[_0x29ba01(0x1e8)];if(_0x264358){const _0x1ac992=await withSpinner(_0x29ba01(0x1c3)+_0x448d42+_0x29ba01(0x1f9),()=>_0x1f0cab[_0x29ba01(0x1ff)][_0x29ba01(0x1e0)](_0x448d42,_0x25beea),{'verbose':_0xaa556d['verbose']});await handleSDKOutput([_0x1ac992],_0xaa556d);}else{const _0x517cb6=await withSpinner(_0x29ba01(0x1c3)+_0x448d42+_0x29ba01(0x1f9),()=>_0x1f0cab['engage'][_0x29ba01(0x171)](_0x448d42,_0x25beea),{'verbose':_0xaa556d[_0x29ba01(0x166)]});await handleSDKOutput([_0x517cb6],_0xaa556d);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{['name']='engage:template:create';[a22_0x24a660(0x1d4)]=a22_0x24a660(0x1b1);async[a22_0x24a660(0x14d)](_0x41a418){const _0xf22da=a22_0x24a660,{options:_0x397238,tdx:_0x5b933d}=_0x41a418,_0x554af6=_0x397238,_0x5a14ba=_0x554af6[_0xf22da(0x1eb)],_0x23ed77=_0x554af6[_0xf22da(0x214)],_0x37c51d=_0x554af6['html'],_0x5b5e04=_0x554af6[_0xf22da(0x197)];if(!_0x5a14ba)return console[_0xf22da(0x1f0)]('Error:\x20--name\x20is\x20required'),console['error'](_0xf22da(0x191)),0x1;if(!_0x23ed77)return console[_0xf22da(0x1f0)](_0xf22da(0x19c)),0x1;if(_0x37c51d&&_0x5b5e04)return console['error'](_0xf22da(0x193)),0x1;const _0x30254f=_0x5b5e04?readFileContent(_0x5b5e04):_0x37c51d;if(!_0x30254f)return console[_0xf22da(0x1f0)](_0xf22da(0x15b)),0x1;const _0x1b2ad0=await resolveWorkspaceIdFromOptions(_0x554af6,_0x5b933d,!![]),_0x2ea3d4={'name':_0x5a14ba,'subjectTemplate':_0x23ed77,'htmlTemplate':_0x30254f,'workspaceId':_0x1b2ad0,'plaintextTemplate':_0x554af6[_0xf22da(0x1ea)],'editorType':_0x554af6[_0xf22da(0x1af)]??'grapesjs'},_0x1ca434=await withSpinner(_0xf22da(0x1c9)+_0x5a14ba+_0xf22da(0x1f9),()=>_0x5b933d[_0xf22da(0x1ff)][_0xf22da(0x1ad)](_0x2ea3d4));return await handleSDKOutput([_0x1ca434[_0xf22da(0x1e6)]],_0x397238),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x169);[a22_0x24a660(0x1d4)]='Update\x20an\x20email\x20template';async[a22_0x24a660(0x14d)](_0x5f5b5f){const _0x51af05=a22_0x24a660,{options:_0xf09193,args:_0x4832b5,tdx:_0x1a8bb4}=_0x5f5b5f;if(_0x4832b5[_0x51af05(0x1ef)]===0x0)return console[_0x51af05(0x1f0)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x51af05(0x1f0)](_0x51af05(0x1bd)),0x1;const _0xee2fe2=_0x4832b5[0x0],_0x39c4d0=_0xf09193,_0x3a1642=_0x39c4d0[_0x51af05(0x218)],_0x1aefe1=_0x39c4d0['htmlFile'];if(_0x3a1642&&_0x1aefe1)return console[_0x51af05(0x1f0)]('Error:\x20Cannot\x20specify\x20both\x20--html\x20and\x20--html-file'),0x1;const _0x1f1819=_0x1aefe1?readFileContent(_0x1aefe1):_0x3a1642,_0x312c79=await resolveWorkspaceIdFromOptions(_0x39c4d0,_0x1a8bb4),_0x1e631d={'name':_0x39c4d0['name'],'subjectTemplate':_0x39c4d0[_0x51af05(0x214)],'htmlTemplate':_0x1f1819,'plaintextTemplate':_0x39c4d0[_0x51af05(0x1ea)]},_0x3a4592=Object[_0x51af05(0x1c5)](Object['entries'](_0x1e631d)[_0x51af05(0x1b9)](([,_0x2911e0])=>_0x2911e0!==undefined));if(Object[_0x51af05(0x213)](_0x3a4592)[_0x51af05(0x1ef)]===0x0)return console[_0x51af05(0x1f0)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console[_0x51af05(0x1f0)]('Options:\x20--name,\x20--subject,\x20--html,\x20--html-file,\x20--plaintext'),0x1;const _0x3240e2=await withSpinner(_0x51af05(0x21e)+_0xee2fe2+'\x27...',()=>_0x1a8bb4['engage'][_0x51af05(0x1c6)](_0xee2fe2,_0x3a4592,_0x312c79),{'verbose':_0xf09193[_0x51af05(0x166)]});return await handleSDKOutput([_0x3240e2['data']],_0xf09193),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a22_0x24a660(0x1eb)]='engage:template:delete';[a22_0x24a660(0x1d4)]=a22_0x24a660(0x1f4);async[a22_0x24a660(0x14d)](_0x20104a){const _0x18a510=a22_0x24a660,{options:_0x126289,args:_0x342ff9,tdx:_0x39763d}=_0x20104a;if(_0x342ff9[_0x18a510(0x1ef)]===0x0)return console[_0x18a510(0x1f0)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x18a510(0x1f0)](_0x18a510(0x220)),0x1;const _0x33b299=_0x342ff9[0x0],_0x191bae=_0x126289,_0x132030=await resolveWorkspaceIdFromOptions(_0x191bae,_0x39763d);if(!_0x126289['yes']){const _0x1a0a7b=await confirm(_0x18a510(0x221)+_0x33b299+_0x18a510(0x156));if(!_0x1a0a7b)return console[_0x18a510(0x217)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x18a510(0x1bf)+_0x33b299+_0x18a510(0x1f9),()=>_0x39763d[_0x18a510(0x1ff)][_0x18a510(0x186)](_0x33b299,_0x132030),{'verbose':_0x126289[_0x18a510(0x166)]}),console[_0x18a510(0x217)](_0x18a510(0x1a4)+_0x33b299+_0x18a510(0x17d)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x189);[a22_0x24a660(0x1d4)]=a22_0x24a660(0x1d8);async['execute'](_0x3c3d62){const _0x2f10a0=a22_0x24a660,{options:_0x23eb43,args:_0x253b2d,tdx:_0x1fc622}=_0x3c3d62,_0x36cc78=_0x253b2d[0x0],_0xd603df=resolveLimit(_0x23eb43[_0x2f10a0(0x1a9)],DEFAULT_LLM_LIMIT),_0x55f84b=await withSpinner('Fetching\x20workspaces...',()=>_0x1fc622[_0x2f10a0(0x1ff)][_0x2f10a0(0x157)]({'limit':_0xd603df}),{'verbose':_0x23eb43[_0x2f10a0(0x166)]});let _0x6d5c01=_0x55f84b[_0x2f10a0(0x1e6)];_0x36cc78&&(_0x6d5c01=_0x55f84b[_0x2f10a0(0x1e6)]['filter'](_0x599904=>matchGlobPattern(_0x599904['name'],_0x36cc78)));const _0x1f6730=_0x23eb43[_0x2f10a0(0x1f6)];if(isStructuredFormat(_0x23eb43))await handleSDKOutput(_0x6d5c01,_0x23eb43);else for(const _0x271c1e of _0x6d5c01){const _0x497491=getWorkspaceUrl(_0x1f6730,_0x271c1e['id']),_0x297dc8=hyperlink(_0x271c1e['name'],_0x497491);console[_0x2f10a0(0x217)](_0x2f10a0(0x194)+_0x297dc8);}return 0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a22_0x24a660(0x1eb)]='engage:workspace:show';[a22_0x24a660(0x1d4)]=a22_0x24a660(0x1d1);async[a22_0x24a660(0x14d)](_0x197142){const _0x55d051=a22_0x24a660,{options:_0x7070c2,args:_0x23b046,tdx:_0xd8fc24}=_0x197142;if(_0x23b046['length']===0x0)return console[_0x55d051(0x1f0)](_0x55d051(0x1fb)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0xc69a9b=_0x23b046[0x0],_0x4870a9=_0x7070c2,_0x5aabec=_0x4870a9['full'];if(_0x5aabec){const _0x299d22=await withSpinner(_0x55d051(0x154)+_0xc69a9b+_0x55d051(0x1f9),()=>_0xd8fc24[_0x55d051(0x1ff)]['getWorkspaceFull'](_0xc69a9b),{'verbose':_0x7070c2[_0x55d051(0x166)]});await handleSDKOutput([_0x299d22],_0x7070c2);}else{const _0x9107b0=await withSpinner('Fetching\x20workspace\x20\x27'+_0xc69a9b+_0x55d051(0x1f9),()=>_0xd8fc24[_0x55d051(0x1ff)][_0x55d051(0x1e7)](_0xc69a9b),{'verbose':_0x7070c2[_0x55d051(0x166)]});await handleSDKOutput([_0x9107b0],_0x7070c2);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x160);[a22_0x24a660(0x1d4)]=a22_0x24a660(0x21d);async[a22_0x24a660(0x14d)](_0x5a1332){const _0x29c306=a22_0x24a660,{options:_0x7549e6,tdx:_0x1a3c51}=_0x5a1332,_0x49504e=_0x7549e6,_0x37244b=_0x49504e[_0x29c306(0x1eb)];if(!_0x37244b)return console[_0x29c306(0x1f0)](_0x29c306(0x1bc)),console[_0x29c306(0x1f0)](_0x29c306(0x1f2)),0x1;const _0x133159={'name':_0x37244b,'description':_0x49504e['description']},_0x35f198=await withSpinner(_0x29c306(0x20c)+_0x37244b+_0x29c306(0x1f9),()=>_0x1a3c51[_0x29c306(0x1ff)][_0x29c306(0x150)](_0x133159));return await handleSDKOutput([_0x35f198[_0x29c306(0x1e6)]],_0x7549e6),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x1e9);['description']=a22_0x24a660(0x1a2);async['execute'](_0x5a40a9){const _0x371141=a22_0x24a660,{options:_0x3e45db,args:_0x241fa9,tdx:_0x381e75}=_0x5a40a9;if(_0x241fa9[_0x371141(0x1ef)]===0x0)return console[_0x371141(0x1f0)](_0x371141(0x1fb)),console['error'](_0x371141(0x181)),0x1;const _0x3b06c9=_0x241fa9[0x0],_0x38e5e2=_0x3e45db,_0x48352f={'name':_0x38e5e2['name'],'description':_0x38e5e2['description']},_0xc40dd5=Object['fromEntries'](Object['entries'](_0x48352f)[_0x371141(0x1b9)](([,_0x4243ed])=>_0x4243ed!==undefined));if(Object[_0x371141(0x213)](_0xc40dd5)[_0x371141(0x1ef)]===0x0)return console[_0x371141(0x1f0)](_0x371141(0x159)),console['error'](_0x371141(0x1ec)),0x1;const _0x2ecf3d=await withSpinner('Updating\x20workspace\x20\x27'+_0x3b06c9+_0x371141(0x1f9),()=>_0x381e75['engage'][_0x371141(0x199)](_0x3b06c9,_0xc40dd5),{'verbose':_0x3e45db[_0x371141(0x166)]});return await handleSDKOutput([_0x2ecf3d[_0x371141(0x1e6)]],_0x3e45db),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{['name']='engage:workspace:delete';[a22_0x24a660(0x1d4)]=a22_0x24a660(0x1bb);async[a22_0x24a660(0x14d)](_0x2c1d8c){const _0x17bf3e=a22_0x24a660,{options:_0x31db0a,args:_0x2aadde,tdx:_0x4a53cb}=_0x2c1d8c;if(_0x2aadde['length']===0x0)return console['error']('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console[_0x17bf3e(0x1f0)]('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x17cdb5=_0x2aadde[0x0];if(!_0x31db0a[_0x17bf3e(0x21a)]){const _0x2beaa0=await confirm(_0x17bf3e(0x188)+_0x17cdb5+_0x17bf3e(0x156));if(!_0x2beaa0)return console[_0x17bf3e(0x217)](_0x17bf3e(0x1fa)),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x17cdb5+_0x17bf3e(0x1f9),()=>_0x4a53cb['engage'][_0x17bf3e(0x19a)](_0x17cdb5),{'verbose':_0x31db0a[_0x17bf3e(0x166)]}),console['log']('Workspace\x20\x27'+_0x17cdb5+_0x17bf3e(0x17d)),0x0;}}export class EngageAlwaysOnCampaignsCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x15d);['description']='List\x20always-on\x20campaigns';async[a22_0x24a660(0x14d)](_0x5b3f98){const _0x59333c=a22_0x24a660,{options:_0x4d3106,args:_0x4573f4,tdx:_0x355b19}=_0x5b3f98,_0x1b9628=_0x4573f4[0x0],_0x107c76=resolveLimit(_0x4d3106[_0x59333c(0x1a9)],DEFAULT_LLM_LIMIT),_0x429a63=_0x4d3106,_0xfce56a=_0x429a63[_0x59333c(0x1e4)],_0xbfe884=[_0x59333c(0x21f),'LIVE',_0x59333c(0x200),_0x59333c(0x1fd)],_0xd58ea5=_0x429a63[_0x59333c(0x14e)],_0x3717a1=_0xd58ea5?.[_0x59333c(0x16e)]();if(_0x3717a1&&!_0xbfe884[_0x59333c(0x168)](_0x3717a1))return console['error']('Error:\x20Invalid\x20status\x20\x22'+_0xd58ea5+_0x59333c(0x1cb)+_0xbfe884[_0x59333c(0x17a)](',\x20')),0x1;const _0x508227=await resolveWorkspaceIdFromOptions(_0x429a63,_0x355b19,!![]),_0x587e47=await withSpinner(_0x59333c(0x1fc),()=>_0x355b19[_0x59333c(0x1ff)][_0x59333c(0x18a)]({'workspaceId':_0x508227,'type':_0xfce56a,'status':_0x3717a1,'limit':_0x107c76}),{'verbose':_0x4d3106[_0x59333c(0x166)]});let _0x3be363=_0x587e47[_0x59333c(0x1e6)];_0x3717a1&&(_0x3be363=_0x3be363['filter'](_0x5e5582=>_0x5e5582[_0x59333c(0x14e)][_0x59333c(0x16e)]()===_0x3717a1));_0x1b9628&&(_0x3be363=_0x3be363['filter'](_0x5b41c5=>matchGlobPattern(_0x5b41c5['name'],_0x1b9628)));const _0x157ac8=_0x4d3106['site'];if(isStructuredFormat(_0x4d3106)){const _0x45768b=_0x3be363[_0x59333c(0x172)](_0x301fec=>({..._0x301fec,'url':getCampaignUrl(_0x157ac8,_0x301fec[_0x59333c(0x20a)],_0x301fec['id'])}));await handleSDKOutput(_0x45768b,_0x4d3106);}else for(const _0x314dcf of _0x3be363){const _0x4a61d7=a22_0x55b1ba[_0x59333c(0x17f)]('\x20('+_0x314dcf[_0x59333c(0x14e)][_0x59333c(0x1cc)]()+')'),_0x4adc08=getCampaignUrl(_0x157ac8,_0x314dcf[_0x59333c(0x20a)],_0x314dcf['id']),_0xd8a385=hyperlink(_0x314dcf[_0x59333c(0x1eb)],_0x4adc08);console[_0x59333c(0x217)](_0x59333c(0x222)+_0xd8a385+_0x4a61d7);}return 0x0;}}export class EngageAlwaysOnCampaignShowCommand extends BaseCommand{[a22_0x24a660(0x1eb)]='engage:always-on-campaign:show';[a22_0x24a660(0x1d4)]=a22_0x24a660(0x1a0);async[a22_0x24a660(0x14d)](_0x39566c){const _0x33675f=a22_0x24a660,{options:_0x4c8e49,args:_0x20f5a0,tdx:_0x14e32d}=_0x39566c;if(_0x20f5a0[_0x33675f(0x1ef)]===0x0)return console['error'](_0x33675f(0x14f)),console[_0x33675f(0x1f0)](_0x33675f(0x16f)),0x1;const _0x5622fc=_0x20f5a0[0x0],_0x2b06fa=_0x4c8e49,_0x12922c=await resolveWorkspaceIdFromOptions(_0x2b06fa,_0x14e32d,!![]),_0x4b98d1=_0x2b06fa['full'],_0xa56431=_0x4c8e49[_0x33675f(0x1f6)];if(_0x4b98d1){const _0x1ac899=await withSpinner('Fetching\x20always-on\x20campaign\x20\x27'+_0x5622fc+'\x27...',()=>_0x14e32d[_0x33675f(0x1ff)][_0x33675f(0x180)](_0x12922c,_0x5622fc),{'verbose':_0x4c8e49[_0x33675f(0x166)]}),_0xf5e02c=_0x1ac899[_0x33675f(0x1e6)],_0x14fb25=getCampaignUrl(_0xa56431,_0xf5e02c[_0x33675f(0x1e2)][_0x33675f(0x20a)],_0xf5e02c['id']);await handleSDKOutput([{..._0xf5e02c,'url':_0x14fb25}],_0x4c8e49);}else{const _0xf6e8b5=await withSpinner(_0x33675f(0x192)+_0x5622fc+_0x33675f(0x1f9),()=>_0x14e32d[_0x33675f(0x1ff)][_0x33675f(0x1c2)](_0x12922c,_0x5622fc),{'verbose':_0x4c8e49[_0x33675f(0x166)]}),_0x3bdec5=_0xf6e8b5[_0x33675f(0x1e6)],_0x1cc938=getCampaignUrl(_0xa56431,_0x3bdec5[_0x33675f(0x20a)],_0x3bdec5['id']);await handleSingleObjectOutput({..._0x3bdec5,'url':_0x1cc938},_0x4c8e49);}return 0x0;}}export class EngageAlwaysOnCampaignCreateCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x162);['description']='Create\x20a\x20new\x20always-on\x20campaign';async[a22_0x24a660(0x14d)](_0x4dfa44){const _0x37ba43=a22_0x24a660,{options:_0x4fd7b7,tdx:_0xefe111}=_0x4dfa44,_0x5a8d0=_0x4fd7b7,_0x1a206b=_0x5a8d0[_0x37ba43(0x1eb)],_0x5e7321=_0x5a8d0['type'];if(!_0x1a206b)return console[_0x37ba43(0x1f0)](_0x37ba43(0x1bc)),console['error']('Usage:\x20tdx\x20engage\x20always-on-campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>'),0x1;if(!_0x5e7321)return console[_0x37ba43(0x1f0)](_0x37ba43(0x19e)),console['error'](_0x37ba43(0x19b)),0x1;const _0x4b375b=await resolveWorkspaceIdFromOptions(_0x5a8d0,_0xefe111,!![]),_0x3813f2=await resolveSegmentFromOptions(_0x5a8d0,_0xefe111),_0x10a121={'name':_0x1a206b,'campaignType':_0x5e7321,'workspaceId':_0x4b375b,'description':_0x5a8d0[_0x37ba43(0x1d4)],'audienceId':_0x3813f2[_0x37ba43(0x1a1)],'audienceName':_0x3813f2[_0x37ba43(0x216)],'enableUtmTracking':_0x5a8d0[_0x37ba43(0x1d5)]},_0x4574d4=await withSpinner(_0x37ba43(0x153)+_0x1a206b+'\x27...',()=>_0xefe111['engage']['createAlwaysOnCampaign'](_0x4b375b,_0x10a121));return await handleSDKOutput([_0x4574d4[_0x37ba43(0x1e6)]],_0x4fd7b7),0x0;}}export class EngageAlwaysOnCampaignUpdateCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x1a6);['description']=a22_0x24a660(0x1fe);async[a22_0x24a660(0x14d)](_0x4ce9c2){const _0x579182=a22_0x24a660,{options:_0x54ae3e,args:_0x49b992,tdx:_0x511968}=_0x4ce9c2;if(_0x49b992[_0x579182(0x1ef)]===0x0)return console[_0x579182(0x1f0)](_0x579182(0x14f)),console[_0x579182(0x1f0)]('Usage:\x20tdx\x20engage\x20always-on-campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x1dc27a=_0x49b992[0x0],_0x1889ef=_0x54ae3e,_0xafb058=await resolveWorkspaceIdFromOptions(_0x1889ef,_0x511968,!![]),_0x51d1dc=await resolveSegmentFromOptions(_0x1889ef,_0x511968),_0x229a4e={'name':_0x1889ef[_0x579182(0x1eb)],'description':_0x1889ef['description'],'audienceId':_0x51d1dc[_0x579182(0x1a1)],'audienceName':_0x51d1dc[_0x579182(0x216)],'enableUtmTracking':_0x1889ef[_0x579182(0x1d5)]},_0x23a6a5=Object[_0x579182(0x1c5)](Object['entries'](_0x229a4e)[_0x579182(0x1b9)](([,_0x3ffe12])=>_0x3ffe12!==undefined));if(Object[_0x579182(0x213)](_0x23a6a5)[_0x579182(0x1ef)]===0x0)return console['error'](_0x579182(0x159)),console[_0x579182(0x1f0)](_0x579182(0x16c)),0x1;const _0x1d626e=await withSpinner('Updating\x20always-on\x20campaign\x20\x27'+_0x1dc27a+_0x579182(0x1f9),()=>_0x511968[_0x579182(0x1ff)][_0x579182(0x1b3)](_0xafb058,_0x1dc27a,_0x23a6a5),{'verbose':_0x54ae3e[_0x579182(0x166)]});return await handleSDKOutput([_0x1d626e[_0x579182(0x1e6)]],_0x54ae3e),0x0;}}export class EngageAlwaysOnCampaignDeleteCommand extends BaseCommand{['name']=a22_0x24a660(0x175);['description']=a22_0x24a660(0x1a3);async['execute'](_0xabdd3d){const _0xbea555=a22_0x24a660,{options:_0x5624d1,args:_0x3b6b6f,tdx:_0x3c526a}=_0xabdd3d;if(_0x3b6b6f[_0xbea555(0x1ef)]===0x0)return console[_0xbea555(0x1f0)](_0xbea555(0x14f)),console['error'](_0xbea555(0x158)),0x1;const _0x3fe803=_0x3b6b6f[0x0],_0x30175d=_0x5624d1,_0x313146=await resolveWorkspaceIdFromOptions(_0x30175d,_0x3c526a,!![]);if(!_0x5624d1[_0xbea555(0x21a)]){const _0xd368ea=await confirm(_0xbea555(0x202)+_0x3fe803+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0xd368ea)return console[_0xbea555(0x217)](_0xbea555(0x1fa)),0x0;}return await withSpinner(_0xbea555(0x210)+_0x3fe803+_0xbea555(0x1f9),()=>_0x3c526a[_0xbea555(0x1ff)][_0xbea555(0x1f3)](_0x313146,_0x3fe803),{'verbose':_0x5624d1[_0xbea555(0x166)]}),console[_0xbea555(0x217)]('Always-on\x20campaign\x20\x27'+_0x3fe803+_0xbea555(0x17d)),0x0;}}export class EngageAlwaysOnCampaignLaunchCommand extends BaseCommand{[a22_0x24a660(0x1eb)]='engage:always-on-campaign:launch';['description']=a22_0x24a660(0x1ab);async[a22_0x24a660(0x14d)](_0x4b6e12){const _0x4f38cf=a22_0x24a660,{options:_0x31364d,args:_0x5cbad6,tdx:_0x126d73}=_0x4b6e12;if(_0x5cbad6[_0x4f38cf(0x1ef)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x4f38cf(0x1f0)](_0x4f38cf(0x1ca)),0x1;const _0x4f8cf0=_0x5cbad6[0x0],_0x119b69=_0x31364d,_0x55814c=await resolveWorkspaceIdFromOptions(_0x119b69,_0x126d73,!![]);return await withSpinner(_0x4f38cf(0x215)+_0x4f8cf0+_0x4f38cf(0x1f9),()=>_0x126d73['engage'][_0x4f38cf(0x1b6)](_0x55814c,_0x4f8cf0),{'verbose':_0x31364d['verbose']}),console['log'](_0x4f38cf(0x205)+_0x4f8cf0+_0x4f38cf(0x1b7)),0x0;}}export class EngageAlwaysOnCampaignPauseCommand extends BaseCommand{['name']=a22_0x24a660(0x161);[a22_0x24a660(0x1d4)]=a22_0x24a660(0x1f7);async[a22_0x24a660(0x14d)](_0x58bcad){const _0x49478f=a22_0x24a660,{options:_0x324f64,args:_0x4f2862,tdx:_0x5f1e25}=_0x58bcad;if(_0x4f2862['length']===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x49478f(0x20b)),0x1;const _0x3e6a8e=_0x4f2862[0x0],_0x468cd9=_0x324f64,_0x27d834=await resolveWorkspaceIdFromOptions(_0x468cd9,_0x5f1e25,!![]);return await withSpinner(_0x49478f(0x1b5)+_0x3e6a8e+'\x27...',()=>_0x5f1e25[_0x49478f(0x1ff)][_0x49478f(0x1a7)](_0x27d834,_0x3e6a8e),{'verbose':_0x324f64[_0x49478f(0x166)]}),console['log']('Always-on\x20campaign\x20\x27'+_0x3e6a8e+'\x27\x20paused\x20successfully'),0x0;}}export class EngageAlwaysOnCampaignResumeCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x1c8);[a22_0x24a660(0x1d4)]='Resume\x20a\x20paused\x20always-on\x20campaign';async[a22_0x24a660(0x14d)](_0x41911b){const _0x2a6981=a22_0x24a660,{options:_0x45ecd4,args:_0x50a4b9,tdx:_0x979072}=_0x41911b;if(_0x50a4b9[_0x2a6981(0x1ef)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x2a6981(0x1f0)](_0x2a6981(0x1cd)),0x1;const _0x1ee2a6=_0x50a4b9[0x0],_0x6e7810=_0x45ecd4,_0xbba5d=await resolveWorkspaceIdFromOptions(_0x6e7810,_0x979072,!![]);return await withSpinner(_0x2a6981(0x173)+_0x1ee2a6+_0x2a6981(0x1f9),()=>_0x979072[_0x2a6981(0x1ff)][_0x2a6981(0x163)](_0xbba5d,_0x1ee2a6),{'verbose':_0x45ecd4['verbose']}),console[_0x2a6981(0x217)](_0x2a6981(0x205)+_0x1ee2a6+_0x2a6981(0x164)),0x0;}}export class EngageAlwaysOnCampaignFinishCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x212);[a22_0x24a660(0x1d4)]=a22_0x24a660(0x16d);async[a22_0x24a660(0x14d)](_0x4db095){const _0x4d1f9c=a22_0x24a660,{options:_0x5d500e,args:_0x21dd54,tdx:_0xa0cf12}=_0x4db095;if(_0x21dd54[_0x4d1f9c(0x1ef)]===0x0)return console['error'](_0x4d1f9c(0x14f)),console[_0x4d1f9c(0x1f0)](_0x4d1f9c(0x21b)),0x1;const _0x13fbee=_0x21dd54[0x0],_0x293c70=_0x5d500e,_0x2f16fb=await resolveWorkspaceIdFromOptions(_0x293c70,_0xa0cf12,!![]);if(!_0x5d500e['yes']){const _0x18a476=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20finish\x20campaign\x20\x27'+_0x13fbee+_0x4d1f9c(0x156));if(!_0x18a476)return console['log'](_0x4d1f9c(0x1fa)),0x0;}return await withSpinner(_0x4d1f9c(0x1c4)+_0x13fbee+_0x4d1f9c(0x1f9),()=>_0xa0cf12[_0x4d1f9c(0x1ff)]['finishAlwaysOnCampaign'](_0x2f16fb,_0x13fbee),{'verbose':_0x5d500e[_0x4d1f9c(0x166)]}),console['log'](_0x4d1f9c(0x205)+_0x13fbee+'\x27\x20finished\x20successfully'),0x0;}}export class EngageAlwaysOnCampaignDuplicateCommand extends BaseCommand{[a22_0x24a660(0x1eb)]=a22_0x24a660(0x151);['description']=a22_0x24a660(0x20f);async[a22_0x24a660(0x14d)](_0x1aa227){const _0x2b199c=a22_0x24a660,{options:_0x37e15f,args:_0x3fbd88,tdx:_0x3420f9}=_0x1aa227;if(_0x3fbd88[_0x2b199c(0x1ef)]===0x0)return console[_0x2b199c(0x1f0)](_0x2b199c(0x14f)),console[_0x2b199c(0x1f0)](_0x2b199c(0x1e1)),0x1;const _0x59f092=_0x3fbd88[0x0],_0x15e805=_0x37e15f,_0x5bde30=await resolveWorkspaceIdFromOptions(_0x15e805,_0x3420f9,!![]),_0x1852b0=_0x15e805[_0x2b199c(0x1eb)],_0x2aa496=await withSpinner('Duplicating\x20always-on\x20campaign\x20\x27'+_0x59f092+_0x2b199c(0x1f9),()=>_0x3420f9[_0x2b199c(0x1ff)]['duplicateAlwaysOnCampaign'](_0x5bde30,_0x59f092,_0x1852b0),{'verbose':_0x37e15f['verbose']});return await handleSDKOutput([_0x2aa496['data']],_0x37e15f),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a22_0x24a660(0x1eb)]='engage:workspace:use';[a22_0x24a660(0x1d4)]=a22_0x24a660(0x1c0);async[a22_0x24a660(0x14d)](_0x3aa520){const _0x27ee8e=a22_0x24a660,{options:_0x5ed4fc,args:_0x32e3b9,tdx:_0xba6f8c}=_0x3aa520;if(_0x32e3b9[_0x27ee8e(0x1ef)]===0x0)return console[_0x27ee8e(0x1f0)](_0x27ee8e(0x1d0)),console[_0x27ee8e(0x1f0)]('Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>'),0x1;const _0x4b0822=_0x32e3b9[0x0];await withSpinner(_0x27ee8e(0x177)+_0x4b0822+_0x27ee8e(0x1f9),()=>_0xba6f8c['engage'][_0x27ee8e(0x1dd)](_0x4b0822));const _0x1aafda=_0x5ed4fc['session']||undefined;return saveSessionContext({'engage_workspace':_0x4b0822},_0x1aafda),console[_0x27ee8e(0x217)](_0x27ee8e(0x211)+_0x4b0822),console[_0x27ee8e(0x217)](_0x27ee8e(0x20d)),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a23_0x41ee1b=a23_0x2509;(function(_0x2fa608,_0x2ceefa){const _0x5805b0=a23_0x2509,_0x46dddc=_0x2fa608();while(!![]){try{const _0x2ea597=-parseInt(_0x5805b0(0x111))/0x1+-parseInt(_0x5805b0(0x127))/0x2*(-parseInt(_0x5805b0(0x138))/0x3)+-parseInt(_0x5805b0(0x123))/0x4+parseInt(_0x5805b0(0x11c))/0x5+parseInt(_0x5805b0(0x142))/0x6+-parseInt(_0x5805b0(0x13a))/0x7*(parseInt(_0x5805b0(0x13e))/0x8)+parseInt(_0x5805b0(0x129))/0x9;if(_0x2ea597===_0x2ceefa)break;else _0x46dddc['push'](_0x46dddc['shift']());}catch(_0x282586){_0x46dddc['push'](_0x46dddc['shift']());}}}(a23_0xf9c7,0x679e8));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';function a23_0x2509(_0x1b77b0,_0x2c4a3a){_0x1b77b0=_0x1b77b0-0x10e;const _0xf9c727=a23_0xf9c7();let _0x250982=_0xf9c727[_0x1b77b0];return _0x250982;}import a23_0x31d7bb from'chalk';import{existsSync,mkdirSync,writeFileSync}from'fs';import a23_0x1688b4 from'path';import{pullTemplates}from'../sdk/engage/template-pull.js';function a23_0xf9c7(){const _0x23d7ee=['green','filter','hasChanges','name','177NxunsG','✔\x20Context\x20set:\x20','1213723FHAxLC','setPhase','absolutePath','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','32kTSbpy','No\x20templates\x20found\x20in\x20workspace\x20\x27','engage_workspace','\x20changed\x20files','4438794AQODAY','yes','targetDir','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','verbose','utf-8','Aborted.','Pulling\x20templates\x20from\x20\x27','\x27...','647335JtnneQ','session','isNew','Workspace\x20is\x20required.','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','cyan','-\x20no\x20files\x20written','\x20\x20Target:\x20','Pull\x20templates\x20to\x20YAML\x20files','yellow','workspaceName','3061730DttsNm','dim','files','Write\x20','red','execute','\x20files\x20to\x20','821584otfuhp','\x0aChanges\x20to\x20\x27','✔\x20All\x20files\x20are\x20up\x20to\x20date','workspace','934fYvwVN','repeat','5319117mQEJRj','\x20templates','\x0aPull\x20summary\x20for\x20workspace\x20\x27','length','\x0aError:','error','description','\x20new\x20files','counts','diff','templates'];a23_0xf9c7=function(){return _0x23d7ee;};return a23_0xf9c7();}export class EngageTemplatePullCommand extends BaseCommand{[a23_0x41ee1b(0x137)]='engage:template:pull';[a23_0x41ee1b(0x12f)]=a23_0x41ee1b(0x119);async[a23_0x41ee1b(0x121)](_0x344a9a){const _0x413abf=a23_0x41ee1b,{options:_0x123666,args:_0x3f62d6,tdx:_0x5d8c2d}=_0x344a9a,_0x1d7113=_0x123666,_0xe634c9=await resolveWorkspaceName(_0x3f62d6[0x0],_0x1d7113);if(!_0xe634c9)return console[_0x413abf(0x12e)](a23_0x31d7bb[_0x413abf(0x11a)](_0x413abf(0x114))),console[_0x413abf(0x12e)]('\x0aUsage:\x20tdx\x20engage\x20template\x20pull\x20<workspace-name>'),console['error']('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20pull\x20--workspace\x20<name>'),console[_0x413abf(0x12e)](_0x413abf(0x146)),0x1;const _0x1b5290=await withProgressSpinner(_0x413abf(0x10f)+_0xe634c9+_0x413abf(0x110),_0x3b3ac1=>pullTemplates({'engage':_0x5d8c2d['engage']},_0xe634c9,{'templateName':_0x1d7113[_0x413abf(0x137)],'progress':{'update':_0x19e322=>{const _0x848ab1=_0x413abf;_0x3b3ac1[_0x848ab1(0x13b)](_0x19e322);}}}),{'verbose':_0x1d7113[_0x413abf(0x147)]}),_0x3885a9=_0x1b5290['data'];if(_0x3885a9[_0x413abf(0x131)][_0x413abf(0x133)]===0x0)return console[_0x413abf(0x12e)](a23_0x31d7bb['yellow'](_0x413abf(0x13f)+_0x3885a9[_0x413abf(0x11b)]+'\x27')),0x0;const _0x47a0eb=_0x3885a9['files'][_0x413abf(0x135)](_0x1021c2=>_0x1021c2[_0x413abf(0x113)]),_0x175f83=_0x3885a9['files'][_0x413abf(0x135)](_0x3826cd=>!_0x3826cd[_0x413abf(0x113)]&&_0x3826cd[_0x413abf(0x136)]),_0x42a700=_0x3885a9[_0x413abf(0x11e)][_0x413abf(0x135)](_0x346e65=>!_0x346e65[_0x413abf(0x113)]&&!_0x346e65[_0x413abf(0x136)]);console['error'](_0x413abf(0x12b)+_0x3885a9[_0x413abf(0x11b)]+'\x27:'),console['error']('\x20\x20'+a23_0x31d7bb[_0x413abf(0x116)](_0x3885a9[_0x413abf(0x131)][_0x413abf(0x133)]+_0x413abf(0x12a))),console[_0x413abf(0x12e)]('\x20\x20'+a23_0x31d7bb[_0x413abf(0x134)]('+\x20'+_0x47a0eb['length']+_0x413abf(0x130))),console[_0x413abf(0x12e)]('\x20\x20'+a23_0x31d7bb['yellow']('~\x20'+_0x175f83['length']+_0x413abf(0x141))),console[_0x413abf(0x12e)]('\x20\x20'+a23_0x31d7bb['dim']('=\x20'+_0x42a700['length']+'\x20unchanged\x20files')),console[_0x413abf(0x12e)](_0x413abf(0x118)+a23_0x31d7bb['cyan'](_0x3885a9[_0x413abf(0x144)])+'\x0a');if(_0x175f83[_0x413abf(0x12c)]>0x0)for(const _0x27ad21 of _0x175f83){console['error'](_0x413abf(0x124)+_0x27ad21['relativePath']+'\x27:'),console['error']('─'[_0x413abf(0x128)](0x3c)),console[_0x413abf(0x12e)](_0x27ad21[_0x413abf(0x132)]),console[_0x413abf(0x12e)]('─'['repeat'](0x3c));}if(_0x1d7113['dryRun'])return console[_0x413abf(0x12e)](a23_0x31d7bb[_0x413abf(0x11a)](_0x413abf(0x115))),0x0;if(_0x47a0eb[_0x413abf(0x12c)]===0x0&&_0x175f83[_0x413abf(0x12c)]===0x0)return console[_0x413abf(0x12e)](a23_0x31d7bb['green'](_0x413abf(0x125))),saveSessionContext({'engage_workspace':_0x3885a9[_0x413abf(0x11b)]},_0x1d7113[_0x413abf(0x112)]),0x0;if(!_0x1d7113[_0x413abf(0x143)]){if(!isInteractive())return console[_0x413abf(0x12e)](a23_0x31d7bb[_0x413abf(0x120)](_0x413abf(0x12d)),_0x413abf(0x13d)),console['error'](a23_0x31d7bb[_0x413abf(0x11d)](_0x413abf(0x145))),0x1;const _0x578fd8=await confirmKey(_0x413abf(0x11f)+(_0x47a0eb[_0x413abf(0x12c)]+_0x175f83[_0x413abf(0x12c)])+'\x20files?');if(!_0x578fd8)return console[_0x413abf(0x12e)](a23_0x31d7bb[_0x413abf(0x11a)](_0x413abf(0x10e)),_0x413abf(0x117)),0x1;}for(const _0x1b63be of _0x3885a9[_0x413abf(0x11e)]){if(_0x1b63be['isNew']||_0x1b63be[_0x413abf(0x136)]){const _0x44f6b4=a23_0x1688b4['dirname'](_0x1b63be[_0x413abf(0x13c)]);!existsSync(_0x44f6b4)&&mkdirSync(_0x44f6b4,{'recursive':!![]}),writeFileSync(_0x1b63be['absolutePath'],_0x1b63be['content'],_0x413abf(0x148));}}return console['error'](a23_0x31d7bb[_0x413abf(0x134)]('✔\x20Pulled\x20'+(_0x47a0eb[_0x413abf(0x12c)]+_0x175f83[_0x413abf(0x12c)])+_0x413abf(0x122)+_0x3885a9[_0x413abf(0x144)])),saveSessionContext({'engage_workspace':_0x3885a9[_0x413abf(0x11b)]},_0x1d7113['session']),console[_0x413abf(0x12e)](a23_0x31d7bb[_0x413abf(0x134)](_0x413abf(0x139)+a23_0x31d7bb[_0x413abf(0x11d)](_0x413abf(0x140))+'\x20=\x20'+a23_0x31d7bb['cyan'](_0x3885a9[_0x413abf(0x11b)]))),0x0;}}async function resolveWorkspaceName(_0x434d22,_0x77bae7){const _0x21d3ba=a23_0x41ee1b;if(_0x434d22)return _0x434d22;if(_0x77bae7[_0x21d3ba(0x126)])return _0x77bae7[_0x21d3ba(0x126)];const _0x9e8255=tryFindTdxConfig(process['cwd']());if(_0x9e8255?.['config'][_0x21d3ba(0x140)])return _0x9e8255['config'][_0x21d3ba(0x140)];const _0x42a5d8=loadSessionContext(_0x77bae7[_0x21d3ba(0x112)]);if(_0x42a5d8?.[_0x21d3ba(0x140)])return _0x42a5d8[_0x21d3ba(0x140)];return undefined;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a24_0x5f50c7=a24_0x56a2;function a24_0x4793(){const _0x2a1989=['red','configDir','path','Workspace\x20is\x20required.','33512940JZzead','7109176QeoHyO','error','458072OfyhRj','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','Pushing\x20templates...','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','resolveWorkspaceId','action','filter','message','length','\x0aPush\x20summary\x20for\x20workspace\x20\x27','create','session','workspace','yellow','dirname','\x20\x20\x20\x20','✔\x20All\x20templates\x20are\x20up\x20to\x20date','50508skimgd','\x0aError:','engage_workspace','-\x20no\x20changes\x20applied','green','def','Preparing\x20push\x20to\x20workspace\x20\x27','setPhase','\x27...','No\x20template\x20YAML\x20files\x20found\x20in\x20','warnings','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','7998192mhSwMk','config','\x20templates?','1752530YtwNzu','name','\x20template\x20files','14LzumeT','description','created','7smoYls','errors','engage','resolve','dryRun','updated','dim','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','4600206BjvJjc','cyan','data','Found\x20','1\x20template\x20file:\x20','Resolving\x20references...','\x20templates\x20to\x20update:','\x20templates','engage:template:push','64GgNXez','valid','execute','\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','\x0aValidation\x20errors\x20in\x20','\x20new\x20templates:'];a24_0x4793=function(){return _0x2a1989;};return a24_0x4793();}(function(_0x9286ee,_0x1f4616){const _0xec2e85=a24_0x56a2,_0x97d95=_0x9286ee();while(!![]){try{const _0x4ff3ba=-parseInt(_0xec2e85(0x1ad))/0x1*(parseInt(_0xec2e85(0x1cb))/0x2)+parseInt(_0xec2e85(0x1dc))/0x3*(-parseInt(_0xec2e85(0x1be))/0x4)+-parseInt(_0xec2e85(0x1eb))/0x5+-parseInt(_0xec2e85(0x1b5))/0x6*(-parseInt(_0xec2e85(0x1ee))/0x7)+-parseInt(_0xec2e85(0x1c9))/0x8+-parseInt(_0xec2e85(0x1e8))/0x9+parseInt(_0xec2e85(0x1c8))/0xa;if(_0x4ff3ba===_0x1f4616)break;else _0x97d95['push'](_0x97d95['shift']());}catch(_0x165089){_0x97d95['push'](_0x97d95['shift']());}}}(a24_0x4793,0xd7e03));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';function a24_0x56a2(_0x527d0c,_0x329499){_0x527d0c=_0x527d0c-0x1ad;const _0x479360=a24_0x4793();let _0x56a228=_0x479360[_0x527d0c];return _0x56a228;}import a24_0x2a6e19 from'chalk';import a24_0x58ffae from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x5f50c7(0x1ec)]=a24_0x5f50c7(0x1bd);[a24_0x5f50c7(0x1ef)]='Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates';async[a24_0x5f50c7(0x1c0)](_0x3de497){const _0x5d9b7b=a24_0x5f50c7,{options:_0x53dc1f,args:_0x4abd1a,tdx:_0x21eaf2}=_0x3de497,_0x4cb843=_0x53dc1f,_0x1a8b9f=_0x4abd1a[0x0],_0x56a1ec=_0x1a8b9f?a24_0x58ffae[_0x5d9b7b(0x1b0)](_0x1a8b9f):undefined,_0x4fbadf=_0x56a1ec?isYamlFile(_0x56a1ec):![];let _0xb13313;if(_0x4fbadf&&_0x56a1ec)_0xb13313=a24_0x58ffae[_0x5d9b7b(0x1d9)](_0x56a1ec);else _0x56a1ec?_0xb13313=_0x56a1ec:_0xb13313=process['cwd']();let _0x3fde1e;const _0x20e82b=tryFindTdxConfig(_0xb13313);_0x20e82b?.[_0x5d9b7b(0x1e9)]['engage_workspace']&&(_0x3fde1e=_0x20e82b['config'][_0x5d9b7b(0x1de)],!_0x4fbadf&&(_0xb13313=_0x20e82b[_0x5d9b7b(0x1c5)]));_0x4cb843[_0x5d9b7b(0x1d7)]&&(_0x3fde1e=_0x4cb843[_0x5d9b7b(0x1d7)]);if(!_0x3fde1e){const _0x1e8a04=loadSessionContext(_0x4cb843[_0x5d9b7b(0x1d6)]);_0x1e8a04?.[_0x5d9b7b(0x1de)]&&(_0x3fde1e=_0x1e8a04['engage_workspace']);}if(!_0x3fde1e)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow'](_0x5d9b7b(0x1c7))),console['error'](_0x5d9b7b(0x1cc)),console[_0x5d9b7b(0x1ca)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)'),console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1b4)),console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1c1)),0x1;let _0x4bad18;_0x4fbadf&&_0x56a1ec?_0x4bad18=[parseTemplateFile(_0x56a1ec,a24_0x58ffae[_0x5d9b7b(0x1d9)](_0x56a1ec))]:_0x4bad18=discoverAndParseTemplateFiles(_0xb13313);if(_0x4bad18[_0x5d9b7b(0x1d3)]===0x0)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow'](_0x5d9b7b(0x1e5)+_0xb13313)),console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1b3)](_0x5d9b7b(0x1ce))),0x1;const _0x470f16=_0x4bad18[_0x5d9b7b(0x1d3)]===0x1?_0x5d9b7b(0x1b9)+_0x4bad18[0x0][_0x5d9b7b(0x1e1)][_0x5d9b7b(0x1ec)]:_0x4bad18[_0x5d9b7b(0x1d3)]+_0x5d9b7b(0x1ed);console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1b8)+a24_0x2a6e19[_0x5d9b7b(0x1b6)](_0x470f16));let _0x48cf57=![];for(const _0xc1a588 of _0x4bad18){const _0x25b032=validateTemplateDef(_0xc1a588['def']);if(!_0x25b032[_0x5d9b7b(0x1bf)]){_0x48cf57=!![],console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)](_0x5d9b7b(0x1c2)+_0xc1a588['relativePath']+':'));for(const _0x5035f0 of _0x25b032[_0x5d9b7b(0x1ae)]){console['error']('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1c4)]('✗')+'\x20'+_0x5035f0['path']+':\x20'+_0x5035f0[_0x5d9b7b(0x1d2)]);}}for(const _0x1ef662 of _0x25b032[_0x5d9b7b(0x1e6)]){console['error']('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1d8)]('⚠')+'\x20'+_0x1ef662[_0x5d9b7b(0x1c6)]+':\x20'+_0x1ef662[_0x5d9b7b(0x1d2)]);}}if(_0x48cf57)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)]('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x435a61=await _0x21eaf2['engage'][_0x5d9b7b(0x1cf)](_0x3fde1e),_0x5e9ce5=await withProgressSpinner(_0x5d9b7b(0x1e2)+_0x3fde1e+_0x5d9b7b(0x1e4),_0x2f8fd1=>preparePush({'engage':_0x21eaf2[_0x5d9b7b(0x1af)]},_0x4bad18,_0x435a61,{'progress':{'update':_0x4786ed=>_0x2f8fd1[_0x5d9b7b(0x1e3)](_0x4786ed)}}),{'verbose':_0x4cb843['verbose']}),_0x1ac2c7=_0x5e9ce5[_0x5d9b7b(0x1b7)];await withProgressSpinner(_0x5d9b7b(0x1ba),_0x1a9e9e=>resolveAndBuildInputs({'engage':_0x21eaf2['engage']},_0x1ac2c7,_0x435a61,{'progress':{'update':_0x27461e=>_0x1a9e9e[_0x5d9b7b(0x1e3)](_0x27461e)}}),{'verbose':_0x4cb843['verbose']});const _0x4b6a86=_0x1ac2c7[_0x5d9b7b(0x1d1)](_0x405efb=>_0x405efb['action']===_0x5d9b7b(0x1d5)),_0x476dc5=_0x1ac2c7[_0x5d9b7b(0x1d1)](_0x2c85cb=>_0x2c85cb[_0x5d9b7b(0x1d0)]==='update');console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1d4)+_0x3fde1e+'\x27:');if(_0x4b6a86[_0x5d9b7b(0x1d3)]>0x0){console[_0x5d9b7b(0x1ca)]('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1e0)]('+\x20'+_0x4b6a86[_0x5d9b7b(0x1d3)]+_0x5d9b7b(0x1c3)));for(const _0x10af7d of _0x4b6a86){console['error']('\x20\x20\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1e0)]('+')+'\x20'+_0x10af7d[_0x5d9b7b(0x1e1)][_0x5d9b7b(0x1ec)]);}}if(_0x476dc5['length']>0x0){console[_0x5d9b7b(0x1ca)]('\x20\x20'+a24_0x2a6e19[_0x5d9b7b(0x1d8)]('~\x20'+_0x476dc5[_0x5d9b7b(0x1d3)]+_0x5d9b7b(0x1bb)));for(const _0x55e41a of _0x476dc5){console[_0x5d9b7b(0x1ca)](_0x5d9b7b(0x1da)+a24_0x2a6e19[_0x5d9b7b(0x1d8)]('~')+'\x20'+_0x55e41a[_0x5d9b7b(0x1e1)][_0x5d9b7b(0x1ec)]);}}if(_0x4b6a86[_0x5d9b7b(0x1d3)]===0x0&&_0x476dc5[_0x5d9b7b(0x1d3)]===0x0)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1e0)](_0x5d9b7b(0x1db))),0x0;if(_0x4cb843[_0x5d9b7b(0x1b1)])return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow'](_0x5d9b7b(0x1e7))),0x0;if(!_0x4cb843['yes']){if(!isInteractive())return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)](_0x5d9b7b(0x1dd)),'Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode'),console['error'](a24_0x2a6e19[_0x5d9b7b(0x1b3)]('Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation')),0x1;const _0x5387a7=await confirmKey('Push\x20'+(_0x4b6a86['length']+_0x476dc5['length'])+_0x5d9b7b(0x1ea));if(!_0x5387a7)return console[_0x5d9b7b(0x1ca)](a24_0x2a6e19['yellow']('Aborted.'),_0x5d9b7b(0x1df)),0x1;}const _0x1f2326=await withProgressSpinner(_0x5d9b7b(0x1cd),_0x194485=>executePush({'engage':_0x21eaf2[_0x5d9b7b(0x1af)]},_0x1ac2c7,{'progress':{'update':_0x49296f=>_0x194485['setPhase'](_0x49296f)}}),{'verbose':_0x4cb843['verbose']}),_0x170359=_0x1f2326[_0x5d9b7b(0x1b7)];for(const _0x4a9bcf of _0x170359['results']){if(_0x4a9bcf['templateId']&&(_0x4a9bcf['action']===_0x5d9b7b(0x1f0)||_0x4a9bcf[_0x5d9b7b(0x1d0)]===_0x5d9b7b(0x1b2))){const _0x1d1f9=getTemplateUrl(_0x4cb843['site'],_0x435a61,_0x4a9bcf['templateId']),_0x5cbbbb=_0x4a9bcf[_0x5d9b7b(0x1d0)]===_0x5d9b7b(0x1f0)?'+':'~',_0x4552ff=_0x4a9bcf[_0x5d9b7b(0x1d0)]===_0x5d9b7b(0x1f0)?a24_0x2a6e19[_0x5d9b7b(0x1e0)](_0x5cbbbb):a24_0x2a6e19[_0x5d9b7b(0x1d8)](_0x5cbbbb);console[_0x5d9b7b(0x1ca)]('\x20\x20'+_0x4552ff+'\x20'+hyperlink(_0x4a9bcf[_0x5d9b7b(0x1ec)],_0x1d1f9)+'\x20'+a24_0x2a6e19[_0x5d9b7b(0x1b3)](_0x1d1f9));}}_0x170359[_0x5d9b7b(0x1f0)]>0x0&&console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1e0)]('✔\x20Created\x20'+_0x170359[_0x5d9b7b(0x1f0)]+_0x5d9b7b(0x1bc)));_0x170359[_0x5d9b7b(0x1b2)]>0x0&&console['error'](a24_0x2a6e19[_0x5d9b7b(0x1e0)]('✔\x20Updated\x20'+_0x170359['updated']+_0x5d9b7b(0x1bc)));if(_0x170359[_0x5d9b7b(0x1ae)][_0x5d9b7b(0x1d3)]>0x0){console[_0x5d9b7b(0x1ca)](a24_0x2a6e19[_0x5d9b7b(0x1c4)]('✘\x20'+_0x170359[_0x5d9b7b(0x1ae)]['length']+'\x20errors:'));for(const _0x541832 of _0x170359[_0x5d9b7b(0x1ae)]){console[_0x5d9b7b(0x1ca)]('\x20\x20'+a24_0x2a6e19['red'](_0x541832['name'])+':\x20'+_0x541832['error']);}}return saveSessionContext({'engage_workspace':_0x3fde1e},_0x4cb843[_0x5d9b7b(0x1d6)]),_0x170359[_0x5d9b7b(0x1ae)][_0x5d9b7b(0x1d3)]>0x0?0x1:0x0;}}
|
|
1
|
+
const a24_0x38b870=a24_0x3155;function a24_0x3155(_0xf731e2,_0x16a28e){_0xf731e2=_0xf731e2-0xca;const _0xde8f85=a24_0xde8f();let _0x315528=_0xde8f85[_0xf731e2];return _0x315528;}(function(_0x59746d,_0x58e9c4){const _0xabd789=a24_0x3155,_0x281460=_0x59746d();while(!![]){try{const _0x1bc549=-parseInt(_0xabd789(0xef))/0x1*(-parseInt(_0xabd789(0xf0))/0x2)+parseInt(_0xabd789(0x109))/0x3+-parseInt(_0xabd789(0xd7))/0x4*(-parseInt(_0xabd789(0xda))/0x5)+-parseInt(_0xabd789(0xe6))/0x6*(parseInt(_0xabd789(0xe1))/0x7)+-parseInt(_0xabd789(0xf1))/0x8+-parseInt(_0xabd789(0xd0))/0x9+-parseInt(_0xabd789(0xcc))/0xa;if(_0x1bc549===_0x58e9c4)break;else _0x281460['push'](_0x281460['shift']());}catch(_0x530183){_0x281460['push'](_0x281460['shift']());}}}(a24_0xde8f,0xde414));import{BaseCommand}from'./command.js';import{withProgressSpinner}from'../utils/spinner.js';function a24_0xde8f(){const _0xef6f61=['\x0aOr\x20set\x20workspace\x20context\x20with:\x20tdx\x20use\x20engage_workspace\x20<name>','message','yellow','updated','✔\x20Updated\x20','\x20templates','session','templateId','length','filter','execute','cwd','config','action','✔\x20All\x20templates\x20are\x20up\x20to\x20date','red','verbose','engage','name','valid','5044473ujPjSL','No\x20template\x20YAML\x20files\x20found\x20in\x20','workspace','engage:template:push','error','dryRun','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20--workspace\x20<name>\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20with\x20explicit\x20workspace','\x0aPush\x20summary\x20for\x20workspace\x20\x27','\x20\x20\x20\x20\x20\x20\x20tdx\x20engage\x20template\x20push\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20all\x20(requires\x20tdx.json)','Pushing\x20templates...','results','dim','\x20templates?','\x0a[Dry\x20run]\x20No\x20changes\x20were\x20applied','5211680niCPbs','data','configDir','errors','14841405FNSehq','resolveWorkspaceId','setPhase','relativePath','engage_workspace','\x27...','Use\x20-y\x20or\x20--yes\x20flag\x20to\x20apply\x20changes\x20without\x20confirmation','4dJrMDy','Template\x20YAML\x20files\x20must\x20have\x20type:\x20template\x20in\x20their\x20definition.','description','6351575sWBuQI','dirname','\x0aUsage:\x20tdx\x20engage\x20template\x20push\x20<file.yaml>\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Push\x20single\x20file','\x20\x20\x20\x20','\x20new\x20templates:','Confirmation\x20required\x20but\x20running\x20in\x20non-interactive\x20mode','yes','21LYZByY','site','\x20template\x20files','Preparing\x20push\x20to\x20workspace\x20\x27','resolve','762618JDxEun','Push\x20','1\x20template\x20file:\x20','path','warnings','Push\x20YAML\x20files\x20to\x20Engage\x20API\x20as\x20templates','created','\x0aValidation\x20errors\x20in\x20','def','1JTwlZO','3036526yqJFxG','8065528OKyDNy','green','\x20errors:','\x0aError:'];a24_0xde8f=function(){return _0xef6f61;};return a24_0xde8f();}import{confirmKey,isInteractive}from'../utils/prompt.js';import{saveSessionContext,loadSessionContext}from'../core/session.js';import{tryFindTdxConfig}from'../sdk/segment/tdx-config.js';import{isYamlFile}from'../sdk/segment/file-discovery.js';import a24_0x19cb73 from'chalk';import a24_0x16cafe from'path';import{discoverAndParseTemplateFiles,parseTemplateFile,preparePush,resolveAndBuildInputs,executePush}from'../sdk/engage/template-push.js';import{validateTemplateDef}from'../sdk/engage/template-validator.js';import{getTemplateUrl}from'../sdk/client/endpoints.js';import{hyperlink}from'../sdk/util/formatters.js';export class EngageTemplatePushCommand extends BaseCommand{[a24_0x38b870(0x107)]=a24_0x38b870(0x10c);[a24_0x38b870(0xd9)]=a24_0x38b870(0xeb);async[a24_0x38b870(0xff)](_0x5e5e7d){const _0x33ad22=a24_0x38b870,{options:_0x8e3cd5,args:_0xefd813,tdx:_0x3b26a6}=_0x5e5e7d,_0x14227c=_0x8e3cd5,_0x99f93=_0xefd813[0x0],_0x2720b0=_0x99f93?a24_0x16cafe[_0x33ad22(0xe5)](_0x99f93):undefined,_0x4ba4e1=_0x2720b0?isYamlFile(_0x2720b0):![];let _0x186651;if(_0x4ba4e1&&_0x2720b0)_0x186651=a24_0x16cafe['dirname'](_0x2720b0);else _0x2720b0?_0x186651=_0x2720b0:_0x186651=process[_0x33ad22(0x100)]();let _0x160f6;const _0x2bd709=tryFindTdxConfig(_0x186651);_0x2bd709?.[_0x33ad22(0x101)][_0x33ad22(0xd4)]&&(_0x160f6=_0x2bd709[_0x33ad22(0x101)][_0x33ad22(0xd4)],!_0x4ba4e1&&(_0x186651=_0x2bd709[_0x33ad22(0xce)]));_0x14227c[_0x33ad22(0x10b)]&&(_0x160f6=_0x14227c[_0x33ad22(0x10b)]);if(!_0x160f6){const _0x58b05c=loadSessionContext(_0x14227c[_0x33ad22(0xfb)]);_0x58b05c?.[_0x33ad22(0xd4)]&&(_0x160f6=_0x58b05c['engage_workspace']);}if(!_0x160f6)return console[_0x33ad22(0x10d)](a24_0x19cb73[_0x33ad22(0xf7)]('Workspace\x20is\x20required.')),console[_0x33ad22(0x10d)](_0x33ad22(0xdc)),console[_0x33ad22(0x10d)](_0x33ad22(0x111)),console[_0x33ad22(0x10d)](_0x33ad22(0x10f)),console[_0x33ad22(0x10d)](_0x33ad22(0xf5)),0x1;let _0x1ab3a0;_0x4ba4e1&&_0x2720b0?_0x1ab3a0=[parseTemplateFile(_0x2720b0,a24_0x16cafe[_0x33ad22(0xdb)](_0x2720b0))]:_0x1ab3a0=discoverAndParseTemplateFiles(_0x186651);if(_0x1ab3a0['length']===0x0)return console[_0x33ad22(0x10d)](a24_0x19cb73[_0x33ad22(0xf7)](_0x33ad22(0x10a)+_0x186651)),console[_0x33ad22(0x10d)](a24_0x19cb73[_0x33ad22(0x114)](_0x33ad22(0xd8))),0x1;const _0x25bde4=_0x1ab3a0[_0x33ad22(0xfd)]===0x1?_0x33ad22(0xe8)+_0x1ab3a0[0x0][_0x33ad22(0xee)][_0x33ad22(0x107)]:_0x1ab3a0['length']+_0x33ad22(0xe3);console['error']('Found\x20'+a24_0x19cb73['cyan'](_0x25bde4));let _0x2a67dd=![];for(const _0x2b5c42 of _0x1ab3a0){const _0x138576=validateTemplateDef(_0x2b5c42[_0x33ad22(0xee)]);if(!_0x138576[_0x33ad22(0x108)]){_0x2a67dd=!![],console['error'](a24_0x19cb73[_0x33ad22(0x104)](_0x33ad22(0xed)+_0x2b5c42[_0x33ad22(0xd3)]+':'));for(const _0x18edc9 of _0x138576['errors']){console[_0x33ad22(0x10d)]('\x20\x20'+a24_0x19cb73[_0x33ad22(0x104)]('✗')+'\x20'+_0x18edc9[_0x33ad22(0xe9)]+':\x20'+_0x18edc9[_0x33ad22(0xf6)]);}}for(const _0xe286b3 of _0x138576[_0x33ad22(0xea)]){console['error']('\x20\x20'+a24_0x19cb73[_0x33ad22(0xf7)]('⚠')+'\x20'+_0xe286b3[_0x33ad22(0xe9)]+':\x20'+_0xe286b3['message']);}}if(_0x2a67dd)return console[_0x33ad22(0x10d)](a24_0x19cb73['red']('\x0aValidation\x20failed.\x20Fix\x20the\x20errors\x20above\x20before\x20pushing.')),0x1;const _0x2b4a9d=await _0x3b26a6['engage'][_0x33ad22(0xd1)](_0x160f6),_0x3c17fa=await withProgressSpinner(_0x33ad22(0xe4)+_0x160f6+_0x33ad22(0xd5),_0x3c3700=>preparePush({'engage':_0x3b26a6[_0x33ad22(0x106)]},_0x1ab3a0,_0x2b4a9d,{'progress':{'update':_0x2a0411=>_0x3c3700[_0x33ad22(0xd2)](_0x2a0411)}}),{'verbose':_0x14227c[_0x33ad22(0x105)]}),_0x54d4d8=_0x3c17fa[_0x33ad22(0xcd)];await withProgressSpinner('Resolving\x20references...',_0x81fae=>resolveAndBuildInputs({'engage':_0x3b26a6[_0x33ad22(0x106)]},_0x54d4d8,_0x2b4a9d,{'progress':{'update':_0x5f2b27=>_0x81fae[_0x33ad22(0xd2)](_0x5f2b27)}}),{'verbose':_0x14227c[_0x33ad22(0x105)]});const _0x46ff38=_0x54d4d8[_0x33ad22(0xfe)](_0x1125db=>_0x1125db[_0x33ad22(0x102)]==='create'),_0x16b26e=_0x54d4d8[_0x33ad22(0xfe)](_0x27c7c0=>_0x27c7c0[_0x33ad22(0x102)]==='update');console[_0x33ad22(0x10d)](_0x33ad22(0x110)+_0x160f6+'\x27:');if(_0x46ff38[_0x33ad22(0xfd)]>0x0){console[_0x33ad22(0x10d)]('\x20\x20'+a24_0x19cb73[_0x33ad22(0xf2)]('+\x20'+_0x46ff38[_0x33ad22(0xfd)]+_0x33ad22(0xde)));for(const _0x46ac1b of _0x46ff38){console[_0x33ad22(0x10d)](_0x33ad22(0xdd)+a24_0x19cb73[_0x33ad22(0xf2)]('+')+'\x20'+_0x46ac1b['def'][_0x33ad22(0x107)]);}}if(_0x16b26e['length']>0x0){console['error']('\x20\x20'+a24_0x19cb73[_0x33ad22(0xf7)]('~\x20'+_0x16b26e[_0x33ad22(0xfd)]+'\x20templates\x20to\x20update:'));for(const _0x1c5ee3 of _0x16b26e){console[_0x33ad22(0x10d)](_0x33ad22(0xdd)+a24_0x19cb73[_0x33ad22(0xf7)]('~')+'\x20'+_0x1c5ee3[_0x33ad22(0xee)][_0x33ad22(0x107)]);}}if(_0x46ff38[_0x33ad22(0xfd)]===0x0&&_0x16b26e['length']===0x0)return console[_0x33ad22(0x10d)](a24_0x19cb73['green'](_0x33ad22(0x103))),0x0;if(_0x14227c[_0x33ad22(0x10e)])return console[_0x33ad22(0x10d)](a24_0x19cb73[_0x33ad22(0xf7)](_0x33ad22(0xcb))),0x0;if(!_0x14227c[_0x33ad22(0xe0)]){if(!isInteractive())return console[_0x33ad22(0x10d)](a24_0x19cb73[_0x33ad22(0x104)](_0x33ad22(0xf4)),_0x33ad22(0xdf)),console[_0x33ad22(0x10d)](a24_0x19cb73[_0x33ad22(0x114)](_0x33ad22(0xd6))),0x1;const _0x2fa513=await confirmKey(_0x33ad22(0xe7)+(_0x46ff38[_0x33ad22(0xfd)]+_0x16b26e[_0x33ad22(0xfd)])+_0x33ad22(0xca));if(!_0x2fa513)return console['error'](a24_0x19cb73[_0x33ad22(0xf7)]('Aborted.'),'-\x20no\x20changes\x20applied'),0x1;}const _0x1f1847=await withProgressSpinner(_0x33ad22(0x112),_0x203c50=>executePush({'engage':_0x3b26a6[_0x33ad22(0x106)]},_0x54d4d8,{'progress':{'update':_0x1120e2=>_0x203c50[_0x33ad22(0xd2)](_0x1120e2)}}),{'verbose':_0x14227c['verbose']}),_0x3d8e3a=_0x1f1847[_0x33ad22(0xcd)];for(const _0x384999 of _0x3d8e3a[_0x33ad22(0x113)]){if(_0x384999[_0x33ad22(0xfc)]&&(_0x384999['action']==='created'||_0x384999[_0x33ad22(0x102)]===_0x33ad22(0xf8))){const _0x5ba426=getTemplateUrl(_0x14227c[_0x33ad22(0xe2)],_0x2b4a9d,_0x384999['templateId']),_0x3cc76c=_0x384999[_0x33ad22(0x102)]===_0x33ad22(0xec)?'+':'~',_0x11c103=_0x384999[_0x33ad22(0x102)]==='created'?a24_0x19cb73[_0x33ad22(0xf2)](_0x3cc76c):a24_0x19cb73[_0x33ad22(0xf7)](_0x3cc76c);console[_0x33ad22(0x10d)]('\x20\x20'+_0x11c103+'\x20'+hyperlink(_0x384999[_0x33ad22(0x107)],_0x5ba426)+'\x20'+a24_0x19cb73[_0x33ad22(0x114)](_0x5ba426));}}_0x3d8e3a[_0x33ad22(0xec)]>0x0&&console[_0x33ad22(0x10d)](a24_0x19cb73[_0x33ad22(0xf2)]('✔\x20Created\x20'+_0x3d8e3a[_0x33ad22(0xec)]+_0x33ad22(0xfa)));_0x3d8e3a[_0x33ad22(0xf8)]>0x0&&console[_0x33ad22(0x10d)](a24_0x19cb73[_0x33ad22(0xf2)](_0x33ad22(0xf9)+_0x3d8e3a[_0x33ad22(0xf8)]+_0x33ad22(0xfa)));if(_0x3d8e3a[_0x33ad22(0xcf)][_0x33ad22(0xfd)]>0x0){console[_0x33ad22(0x10d)](a24_0x19cb73[_0x33ad22(0x104)]('✘\x20'+_0x3d8e3a[_0x33ad22(0xcf)][_0x33ad22(0xfd)]+_0x33ad22(0xf3)));for(const _0x2a5e92 of _0x3d8e3a[_0x33ad22(0xcf)]){console[_0x33ad22(0x10d)]('\x20\x20'+a24_0x19cb73[_0x33ad22(0x104)](_0x2a5e92[_0x33ad22(0x107)])+':\x20'+_0x2a5e92[_0x33ad22(0x10d)]);}}return saveSessionContext({'engage_workspace':_0x160f6},_0x14227c[_0x33ad22(0xfb)]),_0x3d8e3a[_0x33ad22(0xcf)][_0x33ad22(0xfd)]>0x0?0x1:0x0;}}
|