@treasuredata/tdx 0.8.7 β 0.8.9
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 +2 -2
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/client/cdp-api-client.d.ts +16 -1
- package/dist/client/cdp-api-client.d.ts.map +1 -1
- package/dist/client/cdp-api-client.js +1 -1
- package/dist/client/cdp-api-client.js.map +1 -1
- package/dist/client/engage-api-client.js +1 -1
- package/dist/client/http-client.js +1 -1
- package/dist/client/llm-api-client.js +1 -1
- package/dist/client/rate-limiter.js +1 -1
- package/dist/client/td-api-client.js +1 -1
- package/dist/client/trino-api-client.js +1 -1
- package/dist/client/workflow-client.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +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/context-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.d.ts.map +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-command.js.map +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.d.ts +6 -6
- package/dist/commands/segment-pull-command.d.ts.map +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-pull-command.js.map +1 -1
- package/dist/commands/segment-push-command.d.ts +6 -6
- package/dist/commands/segment-push-command.d.ts.map +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-push-command.js.map +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segments.d.ts +2 -2
- package/dist/commands/segments.d.ts.map +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/segments.js.map +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/index.js +1 -1
- package/dist/proxy/anthropic-adapter.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/context-signature.js +1 -1
- package/dist/proxy/conversation-utils.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.d.ts +2 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.d.ts +16 -1
- 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.js +1 -1
- package/dist/sdk/query.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts +11 -2
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/journey-yaml.d.ts +218 -46
- package/dist/sdk/segment/journey-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/journey-yaml.js.map +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/workflow.js +1 -1
- package/dist/types/cdp.d.ts +46 -0
- package/dist/types/cdp.d.ts.map +1 -1
- package/dist/types/endpoints.js +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/agent-ref-parser.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/chat-cache.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/command-output.js +1 -1
- package/dist/utils/constants.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/fields-display.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/format-detector.js +1 -1
- package/dist/utils/formatters.js +1 -1
- package/dist/utils/journey-utils.d.ts +110 -0
- package/dist/utils/journey-utils.d.ts.map +1 -0
- package/dist/utils/journey-utils.js +1 -0
- package/dist/utils/journey-utils.js.map +1 -0
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/llm-backup-utils.js +1 -1
- package/dist/utils/model-aliases.js +1 -1
- package/dist/utils/model-factors.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/segment-path-parser.js +1 -1
- package/dist/utils/segment-ref-parser.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sql-parser.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-config.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/tree-formatter.d.ts +9 -8
- package/dist/utils/tree-formatter.d.ts.map +1 -1
- package/dist/utils/tree-formatter.js +1 -1
- package/dist/utils/tree-formatter.js.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/workflow-utils.js +1 -1
- package/package.json +1 -1
package/dist/commands/command.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a18_0x45c824=a18_0x57fb;(function(_0x53d1e4,_0x40c8b1){const _0xd88a62=a18_0x57fb,_0xa99427=_0x53d1e4();while(!![]){try{const _0x5061ea=-parseInt(_0xd88a62(0x18b))/0x1+parseInt(_0xd88a62(0x1a1))/0x2+-parseInt(_0xd88a62(0x1ab))/0x3*(parseInt(_0xd88a62(0x18c))/0x4)+parseInt(_0xd88a62(0x1a9))/0x5+parseInt(_0xd88a62(0x1a0))/0x6+-parseInt(_0xd88a62(0x19f))/0x7+-parseInt(_0xd88a62(0x190))/0x8;if(_0x5061ea===_0x40c8b1)break;else _0xa99427['push'](_0xa99427['shift']());}catch(_0x41e73f){_0xa99427['push'](_0xa99427['shift']());}}}(a18_0x4ab6,0x2c057));import{validateLimitOption}from'../utils/option-validation.js';import{HTTPClientError}from'../client/http-client.js';import{SDKError,ErrorCategory}from'../sdk/errors.js';import a18_0x60a2e8 from'chalk';function a18_0x57fb(_0x14c9cf,_0x5dae12){_0x14c9cf=_0x14c9cf-0x183;const _0x4ab6ab=a18_0x4ab6();let _0x57fb87=_0x4ab6ab[_0x14c9cf];return _0x57fb87;}export function printAuthError(_0x29eb51,_0x40350e=![],_0x321b90){const _0x4785a2=a18_0x57fb,_0xb1c8cd=_0x29eb51['problemDetails']?.[_0x4785a2(0x1a2)]||_0x29eb51[_0x4785a2(0x186)];console[_0x4785a2(0x183)](a18_0x60a2e8['red'](_0x4785a2(0x184))),console['error'](a18_0x60a2e8[_0x4785a2(0x185)](_0x4785a2(0x189)+_0xb1c8cd));if(_0x40350e){const _0x3bb2e2=_0x321b90?_0x4785a2(0x19c)+_0x321b90:'';console[_0x4785a2(0x183)](_0x4785a2(0x197)),console['error'](_0x4785a2(0x192)+_0x3bb2e2+'\x0a'),console[_0x4785a2(0x183)](_0x4785a2(0x198)),console['error']('\x20\x20tdx\x20auth'+_0x3bb2e2);}}export class BaseCommand{[a18_0x45c824(0x1a5)](_0x520944){const _0x5ea5e3=a18_0x45c824,{options:_0x4bdec6}=_0x520944,_0x237263=_0x4bdec6[_0x5ea5e3(0x195)];if(_0x237263!==undefined){const _0x34b56f=typeof _0x237263===_0x5ea5e3(0x188)?_0x237263:parseInt(_0x237263,0xa);if(isNaN(_0x34b56f))return _0x5ea5e3(0x1aa)+_0x237263+'.\x20Must\x20be\x20a\x20number.';const _0x5d9d29=validateLimitOption(_0x34b56f);if(!_0x5d9d29['isValid'])return _0x5d9d29['error'];_0x520944['options'][_0x5ea5e3(0x195)]=_0x5d9d29['value'];}return undefined;}[a18_0x45c824(0x19b)](_0x5f183f){return undefined;}async[a18_0x45c824(0x18a)](_0x80d2a8){const _0xa750f=a18_0x45c824;try{const _0x2fe838=this[_0xa750f(0x1a5)](_0x80d2a8);if(_0x2fe838)return console[_0xa750f(0x183)](_0xa750f(0x1a7)+_0x2fe838),0x1;const _0xc61d06=this['validate'](_0x80d2a8);if(_0xc61d06){const _0xb000ae=/^\s*(Usage|Note|Warning|Error):/i['test'](_0xc61d06);return _0xb000ae?console['error'](_0xc61d06):console[_0xa750f(0x183)](_0xa750f(0x1a7)+_0xc61d06),0x1;}const _0x5eef11=await this[_0xa750f(0x18d)](_0x80d2a8);return _0x5eef11??0x0;}catch(_0x421eed){if(_0x421eed instanceof Error){if(_0x421eed instanceof HTTPClientError&&_0x421eed[_0xa750f(0x18f)]===0x191){const _0x134739=_0x80d2a8['options'][_0xa750f(0x1a4)];return printAuthError(_0x421eed,!![],_0x134739),_0x421eed['stack']&&_0x80d2a8[_0xa750f(0x19d)]&&(_0x80d2a8[_0xa750f(0x19d)][_0xa750f(0x19a)][_0xa750f(0x18e)]('Authentication\x20error\x20stack\x20trace:'),_0x80d2a8[_0xa750f(0x19d)]['logger']['debug'](_0x421eed[_0xa750f(0x1a8)])),0x1;}console[_0xa750f(0x183)](a18_0x60a2e8['red'](_0xa750f(0x1a7)+_0x421eed[_0xa750f(0x186)]));_0x421eed instanceof SDKError&&_0x421eed[_0xa750f(0x19e)]&&console['error'](a18_0x60a2e8['yellow'](_0x421eed['helpText']));const _0x348218=_0x421eed instanceof SDKError&&_0x421eed['category']===ErrorCategory['USER_ERROR'];_0x421eed[_0xa750f(0x1a8)]&&!_0x348218&&console[_0xa750f(0x183)]('\x0aStack\x20trace:\x0a'+_0x421eed[_0xa750f(0x1a8)]);}else console['error'](_0xa750f(0x1a7)+String(_0x421eed));return 0x1;}}}export class CommandRegistry{['commands']=new Map();[a18_0x45c824(0x1ac)](_0x4e42a9){const _0x5f42a7=a18_0x45c824;if(this[_0x5f42a7(0x199)][_0x5f42a7(0x1a3)](_0x4e42a9[_0x5f42a7(0x187)]))throw new Error(_0x5f42a7(0x196)+_0x4e42a9['name']+_0x5f42a7(0x193));this[_0x5f42a7(0x199)]['set'](_0x4e42a9[_0x5f42a7(0x187)],_0x4e42a9);}[a18_0x45c824(0x191)](_0x4a1d63){const _0x3cc604=a18_0x45c824;return this[_0x3cc604(0x199)][_0x3cc604(0x191)](_0x4a1d63);}['getAll'](){const _0x57a195=a18_0x45c824;return Array[_0x57a195(0x1a6)](this[_0x57a195(0x199)][_0x57a195(0x194)]());}[a18_0x45c824(0x1a3)](_0x448dab){const _0x2f4521=a18_0x45c824;return this[_0x2f4521(0x199)][_0x2f4521(0x1a3)](_0x448dab);}}function a18_0x4ab6(){const _0xea0039=['Reason:\x20','run','131525lbzRuO','11384nfuBRL','execute','debug','status','329624UMCQnh','get','\x20\x20tdx\x20auth\x20setup','\x27\x20is\x20already\x20registered','values','limit','Command\x20\x27','\x0aTo\x20set\x20up\x20authentication:','To\x20check\x20your\x20current\x20auth\x20status:','commands','logger','validate','\x20--profile\x20','tdx','helpText','365757wwTjOa','1454124HLnxvf','4812ycvcRZ','detail','has','profile','validateGlobalOptions','from','Error:\x20','stack','1528380RJLWcG','Invalid\x20limit\x20value:\x20','153sGPnPl','register','error','Authentication\x20failed','red','message','name','number'];a18_0x4ab6=function(){return _0xea0039;};return a18_0x4ab6();}export const registry=new CommandRegistry();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a19_0x4ad2ff=a19_0x1ce6;(function(_0x2f3550,_0x1af4c1){const _0x19a3c4=a19_0x1ce6,_0xd5f557=_0x2f3550();while(!![]){try{const _0x42bf53=parseInt(_0x19a3c4(0xb2))/0x1+parseInt(_0x19a3c4(0xb1))/0x2+-parseInt(_0x19a3c4(0x96))/0x3+-parseInt(_0x19a3c4(0x9e))/0x4+parseInt(_0x19a3c4(0xbc))/0x5*(parseInt(_0x19a3c4(0x98))/0x6)+parseInt(_0x19a3c4(0x9f))/0x7*(parseInt(_0x19a3c4(0xb8))/0x8)+parseInt(_0x19a3c4(0xb9))/0x9*(-parseInt(_0x19a3c4(0xc1))/0xa);if(_0x42bf53===_0x1af4c1)break;else _0xd5f557['push'](_0xd5f557['shift']());}catch(_0x44bdec){_0xd5f557['push'](_0xd5f557['shift']());}}}(a19_0x4131,0xdaf34));import{BaseCommand}from'./command.js';import{handleSDKOutput,handleSingleObjectOutput,isStructuredFormat,writeOutput}from'../utils/command-output.js';function a19_0x4131(){const _0xb42d8=['max','\x27...','length','cyan','verbose','3403696nUdAdj','14lHAyKy','limit','\x20connection','owner','name','Fetching\x20connection\x20\x27','map','Looking\x20up\x20connection:\x20','\x20-\x20','Site:\x20','Show\x20connection\x20details','Listing\x20connections...','push','connection:list','Usage:\x20tdx\x20connection\x20show\x20<name>\x0a\x0aArguments:\x0a\x20\x20<name>\x20\x20\x20\x20Connection\x20name\x0a\x0aExamples:\x0a\x20\x20tdx\x20connection\x20show\x20my-s3-connection\x0a\x20\x20tdx\x20connection\x20show\x20\x22My\x20Salesforce\x20Connection\x22','data','join','table','2274356xasdsW','832054oVMqFv','description','site','type','padStart','connection','6483320spFFdc','172620coEplx','List\x20all\x20result\x20output\x20connections','resolve','2495gqdPzK','error','connection:show','validate','execute','1000ulyiJu','1891209ctFlVj','output','8490zViLQj'];a19_0x4131=function(){return _0xb42d8;};return a19_0x4131();}function a19_0x1ce6(_0x137ffc,_0x5da522){_0x137ffc=_0x137ffc-0x96;const _0x41316f=a19_0x4131();let _0x1ce6e6=_0x41316f[_0x137ffc];return _0x1ce6e6;}import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';import a19_0x249db0 from'chalk';export class ConnectionListCommand extends BaseCommand{[a19_0x4ad2ff(0xa3)]=a19_0x4ad2ff(0xac);[a19_0x4ad2ff(0xb3)]=a19_0x4ad2ff(0xba);async[a19_0x4ad2ff(0xc0)](_0x51c6fe){const _0x3388dd=a19_0x4ad2ff,{options:_0x21591e,tdx:_0xa18f87}=_0x51c6fe;_0x21591e[_0x3388dd(0x9d)]&&console['error'](_0x3388dd(0xa8)+_0x21591e[_0x3388dd(0xb4)]);const _0x15b66b=resolveLimit(_0x21591e[_0x3388dd(0xa0)],DEFAULT_LISTING_LIMIT),_0x8727a9=await withSpinner(_0x3388dd(0xaa),()=>_0xa18f87[_0x3388dd(0xb7)]['list'](),{'verbose':_0x21591e['verbose']}),_0xfa40f8=_0x8727a9[_0x3388dd(0xae)];console[_0x3388dd(0xbd)]('β\x20Found\x20'+_0xfa40f8['length']+_0x3388dd(0xa1)+(_0xfa40f8[_0x3388dd(0x9b)]!==0x1?'s':''));if(isStructuredFormat(_0x21591e)){const _0x4dfc50=_0xfa40f8['slice'](0x0,_0x15b66b);await handleSDKOutput(_0x4dfc50,{..._0x21591e,'limit':_0x15b66b});}else{const _0x30d151=_0xfa40f8[_0x3388dd(0x9b)]>0x0?Math[_0x3388dd(0x99)](..._0xfa40f8[_0x3388dd(0xa5)](_0x4104b2=>_0x4104b2[_0x3388dd(0xb5)][_0x3388dd(0x9b)])):0x0,_0x517fef=[];for(const _0x3f30ee of _0xfa40f8){const _0x46c0b0=a19_0x249db0[_0x3388dd(0x9c)](_0x3f30ee[_0x3388dd(0xb5)][_0x3388dd(0xb6)](_0x30d151)),_0x4b060a=_0x3f30ee[_0x3388dd(0xa2)]?.['name']?_0x3388dd(0xa7)+a19_0x249db0['dim'](_0x3f30ee[_0x3388dd(0xa2)]['name']):'';_0x517fef[_0x3388dd(0xab)](_0x46c0b0+'\x20\x20'+_0x3f30ee[_0x3388dd(0xa3)]+_0x4b060a);}await writeOutput(_0x517fef[_0x3388dd(0xaf)]('\x0a'),_0x21591e[_0x3388dd(0x97)],_0x3388dd(0xb0));}return 0x0;}}export class ConnectionShowCommand extends BaseCommand{[a19_0x4ad2ff(0xa3)]=a19_0x4ad2ff(0xbe);['description']=a19_0x4ad2ff(0xa9);[a19_0x4ad2ff(0xbf)](_0x5d27bb){const _0x41c47a=a19_0x4ad2ff,{args:_0x8103f9}=_0x5d27bb;if(!_0x8103f9[0x0])return _0x41c47a(0xad);return undefined;}async[a19_0x4ad2ff(0xc0)](_0x67fa25){const _0x94c1b0=a19_0x4ad2ff,{options:_0x5a9d8e,args:_0x434713,tdx:_0x1f983a}=_0x67fa25,_0x2fb924=_0x434713[0x0];_0x5a9d8e['verbose']&&(console['error']('Site:\x20'+_0x5a9d8e[_0x94c1b0(0xb4)]),console['error'](_0x94c1b0(0xa6)+_0x2fb924));const _0x3b9ecd=await withSpinner(_0x94c1b0(0xa4)+_0x2fb924+_0x94c1b0(0x9a),()=>_0x1f983a[_0x94c1b0(0xb7)][_0x94c1b0(0xbb)](_0x2fb924),{'verbose':_0x5a9d8e['verbose']}),_0x5e94c8=_0x3b9ecd[_0x94c1b0(0xae)];return console[_0x94c1b0(0xbd)]('β\x20Found\x20connection:\x20'+_0x5e94c8[_0x94c1b0(0xa3)]),await handleSingleObjectOutput(_0x5e94c8,_0x5a9d8e),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
function a20_0x2262(_0x46709a,_0x1db6c6){_0x46709a=_0x46709a-0x1a9;const _0x428400=a20_0x4284();let _0x2262a1=_0x428400[_0x46709a];return _0x2262a1;}const a20_0x1421f9=a20_0x2262;(function(_0x207b60,_0x4d6d5c){const _0x58dcd0=a20_0x2262,_0x117bed=_0x207b60();while(!![]){try{const _0x4affd9=-parseInt(_0x58dcd0(0x1ba))/0x1*(parseInt(_0x58dcd0(0x1b0))/0x2)+parseInt(_0x58dcd0(0x1ab))/0x3+-parseInt(_0x58dcd0(0x1b7))/0x4+-parseInt(_0x58dcd0(0x1bd))/0x5+parseInt(_0x58dcd0(0x1bf))/0x6*(-parseInt(_0x58dcd0(0x1b4))/0x7)+parseInt(_0x58dcd0(0x1b1))/0x8+parseInt(_0x58dcd0(0x1be))/0x9;if(_0x4affd9===_0x4d6d5c)break;else _0x117bed['push'](_0x117bed['shift']());}catch(_0x2941a1){_0x117bed['push'](_0x117bed['shift']());}}}(a20_0x4284,0x61719));import{BaseCommand}from'./command.js';import{GlobalContext}from'../core/global-context.js';import{cleanExpiredSessions,clearSessionContext,getCurrentSessionPID}from'../core/session.js';import a20_0x11cc8a from'chalk';export class ContextCommand extends BaseCommand{[a20_0x1421f9(0x1b5)]=a20_0x1421f9(0x1bb);['description']='Show\x20current\x20resolved\x20context';async[a20_0x1421f9(0x1b2)](_0x4e004f){const _0x4793cb=a20_0x1421f9,{options:_0xb04b6b}=_0x4e004f,_0xeef48f=_0xb04b6b[_0x4793cb(0x1ad)],_0x1eacd1=_0xb04b6b['clear'];console[_0x4793cb(0x1a9)](a20_0x11cc8a[_0x4793cb(0x1aa)]('Warning:\x20\x27tdx\x20context\x27\x20is\x20deprecated.\x20Use\x20\x27tdx\x20use\x27\x20instead.')),console[_0x4793cb(0x1a9)](a20_0x11cc8a[_0x4793cb(0x1aa)](_0x4793cb(0x1b8))),console['warn'](a20_0x11cc8a['yellow']('\x20\x20tdx\x20use\x20--clear\x20\x20\x20#\x20Clear\x20session\x20context\x0a')),cleanExpiredSessions();try{if(_0x1eacd1){clearSessionContext(_0xb04b6b[_0x4793cb(0x1bc)]);const _0x5c81b1=_0xb04b6b[_0x4793cb(0x1bc)]||getCurrentSessionPID()[_0x4793cb(0x1b6)]();return console[_0x4793cb(0x1ac)](_0x4793cb(0x1b9)+_0x5c81b1+')'),0x0;}const _0x204a0c=new GlobalContext(_0xb04b6b);return _0xeef48f?_0x204a0c[_0x4793cb(0x1b3)]():_0x204a0c[_0x4793cb(0x1af)](),0x0;}catch(_0x3c88c0){return _0x3c88c0 instanceof Error&&console['error'](_0x4793cb(0x1ae)+_0x3c88c0[_0x4793cb(0x1c0)]),0x1;}}}function a20_0x4284(){const _0x12cc8d=['\x20\x20tdx\x20use\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Show\x20current\x20context','Session\x20context\x20cleared\x20(session:\x20','38OHpcEx','context','session','3101740jwGISi','4160736uritJA','2010jdVVmn','message','warn','yellow','675879WPOcnJ','log','debug','Error:\x20','display','6178qZUxkK','6059784CKRhbf','execute','displayWithSources','1127nAYPRZ','name','toString','1017104rjaxxm'];a20_0x4284=function(){return _0x12cc8d;};return a20_0x4284();}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a21_0x50f282=a21_0x432e;(function(_0x3c8b3e,_0x1c102b){const _0x132af4=a21_0x432e,_0x55227c=_0x3c8b3e();while(!![]){try{const _0x57453f=-parseInt(_0x132af4(0x11b))/0x1+parseInt(_0x132af4(0x111))/0x2*(parseInt(_0x132af4(0x11f))/0x3)+-parseInt(_0x132af4(0x11e))/0x4+parseInt(_0x132af4(0x113))/0x5+parseInt(_0x132af4(0x118))/0x6*(-parseInt(_0x132af4(0x121))/0x7)+parseInt(_0x132af4(0x11d))/0x8+parseInt(_0x132af4(0x114))/0x9*(parseInt(_0x132af4(0x12a))/0xa);if(_0x57453f===_0x1c102b)break;else _0x55227c['push'](_0x55227c['shift']());}catch(_0x11f145){_0x55227c['push'](_0x55227c['shift']());}}}(a21_0x5442,0x97877));function a21_0x432e(_0x57059f,_0x16daea){_0x57059f=_0x57059f-0x110;const _0x5442c6=a21_0x5442();let _0x432eec=_0x5442c6[_0x57059f];return _0x432eec;}function a21_0x5442(){const _0x326c23=['Listing\x20databases...','description','name','site','databases','3080XcATfp','β\x20Found\x20','14vSEwpZ','data','30815FkczNA','79209urfnSZ','execute','Site:\x20','query','6tgwsdm','\x20database','error','969572VLMfid','verbose','3898488hbJOXx','4910084rHeQnz','14793EoTxsh','Pattern:\x20','2946601BuDPqk','limit','Error:\x20','message'];a21_0x5442=function(){return _0x326c23;};return a21_0x5442();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{DEFAULT_LISTING_LIMIT,resolveLimit}from'../utils/constants.js';export class DatabasesCommand extends BaseCommand{[a21_0x50f282(0x127)]=a21_0x50f282(0x129);[a21_0x50f282(0x126)]='List\x20all\x20databases';async[a21_0x50f282(0x115)](_0x29f44a){const _0x3405a2=a21_0x50f282,{options:_0x1894c2,args:_0x33a148,tdx:_0x2eb09e}=_0x29f44a,_0x1b5dc8=_0x33a148[0x0];try{_0x1894c2['verbose']&&(console[_0x3405a2(0x11a)](_0x3405a2(0x116)+_0x1894c2[_0x3405a2(0x128)]),_0x1b5dc8&&console[_0x3405a2(0x11a)](_0x3405a2(0x120)+_0x1b5dc8));const _0x187f1c=resolveLimit(_0x1894c2[_0x3405a2(0x122)],DEFAULT_LISTING_LIMIT),_0x5dabd0=await withSpinner(_0x3405a2(0x125),()=>_0x2eb09e[_0x3405a2(0x117)]['listDatabases'](_0x1b5dc8,_0x187f1c),{'verbose':_0x1894c2[_0x3405a2(0x11c)]}),_0x543e10=_0x5dabd0[_0x3405a2(0x112)];return console[_0x3405a2(0x11a)](_0x3405a2(0x110)+_0x543e10['length']+_0x3405a2(0x119)+(_0x543e10['length']!==0x1?'s':'')),await handleSDKOutput(_0x543e10,{..._0x1894c2,'limit':_0x187f1c}),0x0;}catch(_0x142fba){if(_0x142fba instanceof SDKError)return console[_0x3405a2(0x11a)](_0x3405a2(0x123)+_0x142fba[_0x3405a2(0x124)]),_0x142fba['cause']&&console[_0x3405a2(0x11a)]('\x20\x20Cause:\x20'+_0x142fba['cause']),0x1;throw _0x142fba;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a22_0x29fe53=a22_0x39e2;(function(_0x26ab1f,_0x14b648){const _0x57c235=a22_0x39e2,_0x53be3d=_0x26ab1f();while(!![]){try{const _0x2278f7=-parseInt(_0x57c235(0xd1))/0x1+-parseInt(_0x57c235(0xd3))/0x2*(parseInt(_0x57c235(0xbd))/0x3)+-parseInt(_0x57c235(0xc2))/0x4+-parseInt(_0x57c235(0xc7))/0x5+parseInt(_0x57c235(0xc0))/0x6+parseInt(_0x57c235(0xb9))/0x7+parseInt(_0x57c235(0xc1))/0x8;if(_0x2278f7===_0x14b648)break;else _0x53be3d['push'](_0x53be3d['shift']());}catch(_0x3d436b){_0x53be3d['push'](_0x53be3d['shift']());}}}(a22_0x39cf,0x5dce4));function a22_0x39cf(){const _0x2ba434=['database','922560oQFDOt','description','\x20\x20Cause:\x20','describe','length','error','Table\x20\x27','query','site','β\x20Table\x20not\x20found','77480VJgPCH','β\x20Found\x20','552718wvfMnq','execute','Describing\x20table\x20','Table:\x20','Describe\x20table\x20schema','\x20column','args','verbose','cause','name','Database:\x20','Site:\x20','1106000DSRLTU','validate','\x27\x20does\x20not\x20exist','message','6MuKUpU','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','describeTable','1032168WGcfzi','8146624NvvooF','597672LwEukg','data','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','Error:\x20'];a22_0x39cf=function(){return _0x2ba434;};return a22_0x39cf();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput}from'../utils/command-output.js';import{parseTableReference,validateTableDescribeReference}from'../utils/table-ref-parser.js';function a22_0x39e2(_0x5c9a86,_0x38a7d1){_0x5c9a86=_0x5c9a86-0xae;const _0x39cf25=a22_0x39cf();let _0x39e2a3=_0x39cf25[_0x5c9a86];return _0x39e2a3;}import{withSpinner}from'../utils/spinner.js';export class DescribeCommand extends BaseCommand{[a22_0x29fe53(0xb6)]=a22_0x29fe53(0xca);[a22_0x29fe53(0xc8)]=a22_0x29fe53(0xb1);async[a22_0x29fe53(0xae)](_0x15f2b0){return this['describeTable'](_0x15f2b0);}async[a22_0x29fe53(0xbf)](_0x37b11f){const _0x354a27=a22_0x29fe53,{options:_0x542975,args:_0x56b5f0,tdx:_0x582645}=_0x37b11f;let _0x514e0e;try{_0x514e0e=parseTableReference(_0x56b5f0[0x0]);const _0x2fd746=_0x542975[_0x354a27(0xc6)];!_0x514e0e[_0x354a27(0xc6)]&&_0x2fd746&&(_0x514e0e['database']=_0x2fd746);const _0x5023cd=validateTableDescribeReference(_0x514e0e);if(_0x5023cd)return console[_0x354a27(0xcc)](_0x354a27(0xc5)+_0x5023cd),0x1;}catch(_0x52dbbe){return console['error'](_0x354a27(0xc5)+_0x52dbbe[_0x354a27(0xbc)]),0x1;}const _0x351ff2=_0x514e0e[_0x354a27(0xc6)],_0x53bab7=_0x514e0e['table'];try{_0x542975['verbose']&&(console[_0x354a27(0xcc)](_0x354a27(0xb8)+_0x542975[_0x354a27(0xcf)]),console[_0x354a27(0xcc)](_0x354a27(0xb7)+_0x351ff2),console[_0x354a27(0xcc)](_0x354a27(0xb0)+_0x53bab7));const _0x2f70f0=await withSpinner(_0x354a27(0xaf)+_0x351ff2+'.'+_0x53bab7+'...',()=>_0x582645[_0x354a27(0xce)][_0x354a27(0xbf)](_0x351ff2,_0x53bab7),{'verbose':_0x542975[_0x354a27(0xb4)]}),_0x58284a=_0x2f70f0[_0x354a27(0xc3)];if(_0x58284a[_0x354a27(0xcb)]===0x0)return console[_0x354a27(0xcc)](_0x354a27(0xd0)),console[_0x354a27(0xcc)](_0x354a27(0xcd)+_0x351ff2+'.'+_0x53bab7+_0x354a27(0xbb)),0x1;return console[_0x354a27(0xcc)](_0x354a27(0xd2)+_0x58284a[_0x354a27(0xcb)]+_0x354a27(0xb2)+(_0x58284a['length']!==0x1?'s':'')+'\x20in\x20'+_0x351ff2+'.'+_0x53bab7),await handleSDKOutput(_0x58284a,_0x542975),0x0;}catch(_0x4f61e3){if(_0x4f61e3 instanceof SDKError)return console[_0x354a27(0xcc)](_0x354a27(0xc5)+_0x4f61e3[_0x354a27(0xbc)]),_0x4f61e3[_0x354a27(0xb5)]&&console[_0x354a27(0xcc)](_0x354a27(0xc9)+_0x4f61e3[_0x354a27(0xb5)]),0x1;throw _0x4f61e3;}}[a22_0x29fe53(0xba)](_0x7efa08){const _0x14813e=a22_0x29fe53;if(_0x7efa08[_0x14813e(0xb3)][_0x14813e(0xcb)]===0x0)return _0x14813e(0xc4);if(_0x7efa08[_0x14813e(0xb3)]['length']>0x1)return _0x14813e(0xbe);return undefined;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a23_0x4b9761=a23_0x216e;(function(_0x3e1061,_0x1f1e8f){const _0x13753b=a23_0x216e,_0x3f5fda=_0x3e1061();while(!![]){try{const _0x41ece5=parseInt(_0x13753b(0xa7))/0x1*(-parseInt(_0x13753b(0xa2))/0x2)+parseInt(_0x13753b(0xb3))/0x3*(-parseInt(_0x13753b(0xbb))/0x4)+-parseInt(_0x13753b(0xc8))/0x5+parseInt(_0x13753b(0xb1))/0x6*(-parseInt(_0x13753b(0x8a))/0x7)+-parseInt(_0x13753b(0xc4))/0x8*(-parseInt(_0x13753b(0x92))/0x9)+-parseInt(_0x13753b(0xb9))/0xa*(-parseInt(_0x13753b(0xf0))/0xb)+parseInt(_0x13753b(0x7b))/0xc;if(_0x41ece5===_0x1f1e8f)break;else _0x3f5fda['push'](_0x3f5fda['shift']());}catch(_0x377541){_0x3f5fda['push'](_0x3f5fda['shift']());}}}(a23_0x1b34,0x82e34));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/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{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x4523a2,_0x190e78,_0x216155=![]){const _0x480232=a23_0x216e;if(_0x4523a2[_0x480232(0xcf)])return await _0x190e78[_0x480232(0x75)]['resolveWorkspaceId'](_0x4523a2[_0x480232(0xcf)]);const _0x3d009c=loadSessionContext(_0x4523a2[_0x480232(0x84)]);if(_0x3d009c?.[_0x480232(0x7d)])return await _0x190e78['engage']['resolveWorkspaceId'](_0x3d009c[_0x480232(0x7d)]);if(_0x216155)throw new SDKError(ErrorCode[_0x480232(0x93)],_0x480232(0x7e),undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x184080,_0xa772fd){const _0x5a15ce=a23_0x216e;if(!_0x184080[_0x5a15ce(0xce)])return{};const _0x3a10cd=_0x184080[_0x5a15ce(0xce)],_0x484c4a=await _0xa772fd[_0x5a15ce(0xce)][_0x5a15ce(0xab)](_0x3a10cd);return{'audienceId':_0x484c4a[_0x5a15ce(0xac)],'audienceName':_0x484c4a['parentName'],..._0x484c4a[_0x5a15ce(0xbd)]&&{'segmentId':_0x484c4a[_0x5a15ce(0xbd)],'segmentName':_0x484c4a['segmentName']}};}function buildConnectorConfig(_0x2e0f9f){const _0x2b089d=a23_0x216e,_0x188d09=_0x2e0f9f[_0x2b089d(0x7f)],_0x25959a=_0x2e0f9f[_0x2b089d(0xe0)];if(!_0x188d09&&!_0x25959a)return undefined;return{..._0x188d09&&{'emailSenderId':_0x188d09},..._0x25959a&&{'jsonColumns':_0x25959a}};}export class EngageCampaignsCommand extends BaseCommand{[a23_0x4b9761(0xdc)]='engage:campaigns';[a23_0x4b9761(0xdf)]=a23_0x4b9761(0xb5);async['execute'](_0x1850e3){const _0x5def16=a23_0x4b9761,{options:_0x2547e6,args:_0x57a5f8,tdx:_0x51a84f}=_0x1850e3,_0x34d4c5=_0x57a5f8[0x0],_0x1e3558=resolveLimit(_0x2547e6['limit'],DEFAULT_LLM_LIMIT),_0x101c9c=_0x2547e6,_0x31dae4=_0x101c9c[_0x5def16(0xde)],_0x218431=_0x101c9c['status'],_0x2414a4=await resolveWorkspaceIdFromOptions(_0x101c9c,_0x51a84f),_0x22264e=await withSpinner(_0x5def16(0xa6),()=>_0x51a84f[_0x5def16(0x75)][_0x5def16(0xa1)]({'type':_0x31dae4,'status':_0x218431,'workspaceId':_0x2414a4,'limit':_0x1e3558}),{'verbose':_0x2547e6[_0x5def16(0xb4)]});let _0x5b7a13=_0x22264e[_0x5def16(0x94)];return _0x34d4c5&&(_0x5b7a13=_0x22264e[_0x5def16(0x94)][_0x5def16(0xaa)](_0x392318=>matchGlobPattern(_0x392318['name'],_0x34d4c5))),await handleSDKOutput(_0x5b7a13,_0x2547e6),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{['name']=a23_0x4b9761(0xcb);[a23_0x4b9761(0xdf)]=a23_0x4b9761(0xd5);async[a23_0x4b9761(0xd3)](_0x38f3e1){const _0x5a684e=a23_0x4b9761,{options:_0x22d1d1,args:_0x2691d6,tdx:_0x31bc14}=_0x38f3e1;if(_0x2691d6[_0x5a684e(0xe9)]===0x0)return console[_0x5a684e(0xef)](_0x5a684e(0x77)),console[_0x5a684e(0xef)](_0x5a684e(0xc5)),0x1;const _0x3f4fde=_0x2691d6[0x0],_0x20daf6=_0x22d1d1,_0x57c38c=await resolveWorkspaceIdFromOptions(_0x20daf6,_0x31bc14),_0x8ade2c=_0x20daf6['full'];if(_0x8ade2c){const _0x329827=await withSpinner(_0x5a684e(0x71)+_0x3f4fde+_0x5a684e(0x8e),()=>_0x31bc14['engage'][_0x5a684e(0x82)](_0x3f4fde,_0x57c38c),{'verbose':_0x22d1d1[_0x5a684e(0xb4)]});await handleSDKOutput([_0x329827],_0x22d1d1);}else{const _0x319bab=await withSpinner(_0x5a684e(0x71)+_0x3f4fde+_0x5a684e(0x8e),()=>_0x31bc14['engage'][_0x5a684e(0x8b)](_0x3f4fde,_0x57c38c),{'verbose':_0x22d1d1[_0x5a684e(0xb4)]});await handleSDKOutput([_0x319bab],_0x22d1d1);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{[a23_0x4b9761(0xdc)]='engage:campaign:create';['description']='Create\x20a\x20new\x20campaign';async['execute'](_0x2ee593){const _0x3fcacd=a23_0x4b9761,{options:_0x50fe9e,tdx:_0x4287df}=_0x2ee593,_0x22a6bc=_0x50fe9e,_0x58cec1=_0x22a6bc[_0x3fcacd(0xdc)],_0x16cf7b=_0x22a6bc[_0x3fcacd(0xde)];if(!_0x58cec1)return console[_0x3fcacd(0xef)](_0x3fcacd(0x89)),console['error'](_0x3fcacd(0xae)),0x1;if(!_0x16cf7b)return console[_0x3fcacd(0xef)](_0x3fcacd(0xd0)),console['error'](_0x3fcacd(0xae)),0x1;const _0x48bc7f=await resolveWorkspaceIdFromOptions(_0x22a6bc,_0x4287df,!![]),_0x16ef7b=await resolveSegmentFromOptions(_0x22a6bc,_0x4287df),_0x2a9807=buildConnectorConfig(_0x22a6bc),_0x2c531e={'name':_0x58cec1,'campaignType':_0x16cf7b,'workspaceId':_0x48bc7f,'description':_0x22a6bc[_0x3fcacd(0xdf)],..._0x16ef7b,'connectorConfig':_0x2a9807,'startAt':_0x22a6bc[_0x3fcacd(0x8c)],'timezone':_0x22a6bc[_0x3fcacd(0xe6)]},_0x30d801=await withSpinner('Creating\x20campaign\x20\x27'+_0x58cec1+_0x3fcacd(0x8e),()=>_0x4287df[_0x3fcacd(0x75)][_0x3fcacd(0xd6)](_0x2c531e));return await handleSDKOutput([_0x30d801[_0x3fcacd(0x94)]],_0x50fe9e),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a23_0x4b9761(0xdc)]='engage:campaign:update';[a23_0x4b9761(0xdf)]=a23_0x4b9761(0xeb);async[a23_0x4b9761(0xd3)](_0xc2d18e){const _0x491f59=a23_0x4b9761,{options:_0xadb56e,args:_0x252eae,tdx:_0x4457ca}=_0xc2d18e;if(_0x252eae[_0x491f59(0xe9)]===0x0)return console['error']('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x491f59(0xef)](_0x491f59(0xf2)),0x1;const _0x356b7b=_0x252eae[0x0],_0x3b9554=_0xadb56e,_0x31cd45=await resolveWorkspaceIdFromOptions(_0x3b9554,_0x4457ca),_0x4a2ae4=await resolveSegmentFromOptions(_0x3b9554,_0x4457ca),_0x5061ba=buildConnectorConfig(_0x3b9554),_0x2404a1={'name':_0x3b9554['name'],'description':_0x3b9554[_0x491f59(0xdf)],..._0x4a2ae4,'connectorConfig':_0x5061ba,'startAt':_0x3b9554[_0x491f59(0x8c)],'timezone':_0x3b9554[_0x491f59(0xe6)]},_0x1e3103=Object[_0x491f59(0xbc)](Object[_0x491f59(0xa0)](_0x2404a1)[_0x491f59(0xaa)](([,_0xa412f8])=>_0xa412f8!==undefined));if(Object['keys'](_0x1e3103)[_0x491f59(0xe9)]===0x0)return console['error'](_0x491f59(0x6d)),console['error']('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0x450e5b=await withSpinner('Updating\x20campaign\x20\x27'+_0x356b7b+'\x27...',()=>_0x4457ca['engage'][_0x491f59(0xbf)](_0x356b7b,_0x1e3103,_0x31cd45),{'verbose':_0xadb56e[_0x491f59(0xb4)]});return await handleSDKOutput([_0x450e5b[_0x491f59(0x94)]],_0xadb56e),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a23_0x4b9761(0xdc)]='engage:campaign:delete';['description']='Delete\x20a\x20campaign';async[a23_0x4b9761(0xd3)](_0x131c31){const _0x4ef8dd=a23_0x4b9761,{options:_0x30c061,args:_0x1a83a9,tdx:_0x578381}=_0x131c31;if(_0x1a83a9['length']===0x0)return console[_0x4ef8dd(0xef)](_0x4ef8dd(0x77)),console[_0x4ef8dd(0xef)](_0x4ef8dd(0xdd)),0x1;const _0x44f845=_0x1a83a9[0x0],_0x3cbde5=_0x30c061,_0x2e6237=await resolveWorkspaceIdFromOptions(_0x3cbde5,_0x578381);if(!_0x30c061[_0x4ef8dd(0x90)]){const _0x22d634=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27'+_0x44f845+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x22d634)return console[_0x4ef8dd(0xe1)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x4ef8dd(0xda)+_0x44f845+_0x4ef8dd(0x8e),()=>_0x578381[_0x4ef8dd(0x75)][_0x4ef8dd(0xc9)](_0x44f845,_0x2e6237),{'verbose':_0x30c061[_0x4ef8dd(0xb4)]}),console[_0x4ef8dd(0xe1)](_0x4ef8dd(0xb7)+_0x44f845+_0x4ef8dd(0x9d)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a23_0x4b9761(0xdc)]=a23_0x4b9761(0x83);[a23_0x4b9761(0xdf)]=a23_0x4b9761(0xf3);async[a23_0x4b9761(0xd3)](_0x59c68f){const _0x24e11b=a23_0x4b9761,{options:_0x5a8353,args:_0x2a1ef0,tdx:_0x162b76}=_0x59c68f;if(_0x2a1ef0['length']===0x0)return console[_0x24e11b(0xef)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x24e11b(0xef)](_0x24e11b(0xf4)),0x1;const _0x394c19=_0x2a1ef0[0x0],_0x4b24ad=_0x5a8353,_0x3d458f=await resolveWorkspaceIdFromOptions(_0x4b24ad,_0x162b76);return await withSpinner(_0x24e11b(0xa8)+_0x394c19+'\x27...',()=>_0x162b76[_0x24e11b(0x75)]['launchCampaign'](_0x394c19,_0x3d458f),{'verbose':_0x5a8353['verbose']}),console[_0x24e11b(0xe1)](_0x24e11b(0xb7)+_0x394c19+_0x24e11b(0xe8)),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a23_0x4b9761(0xdc)]=a23_0x4b9761(0x9e);['description']=a23_0x4b9761(0xc2);async[a23_0x4b9761(0xd3)](_0x56d769){const _0x10a6f6=a23_0x4b9761,{options:_0x1fb272,args:_0x41f1e7,tdx:_0x5aaf60}=_0x56d769;if(_0x41f1e7['length']===0x0)return console['error'](_0x10a6f6(0x77)),console[_0x10a6f6(0xef)]('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x38830d=_0x41f1e7[0x0],_0x308d9c=_0x1fb272,_0x41e5e4=await resolveWorkspaceIdFromOptions(_0x308d9c,_0x5aaf60);return await withSpinner(_0x10a6f6(0xe7)+_0x38830d+_0x10a6f6(0x8e),()=>_0x5aaf60[_0x10a6f6(0x75)][_0x10a6f6(0x8d)](_0x38830d,_0x41e5e4),{'verbose':_0x1fb272[_0x10a6f6(0xb4)]}),console[_0x10a6f6(0xe1)](_0x10a6f6(0xb7)+_0x38830d+_0x10a6f6(0x91)),0x0;}}function a23_0x1b34(){const _0x16e206=['Deleting\x20campaign\x20\x27','subject','name','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','type','description','jsonColumns','log','plaintext','updateWorkspace','engage:template:delete','engage:template:show','timezone','Pausing\x20campaign\x20\x27','\x27\x20launched\x20successfully','length','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','Update\x20a\x20campaign','Fetching\x20template\x20\x27','createTemplate','html','error','22DpMbJg','engage:template:update','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Launch\x20a\x20campaign','Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>','updateTemplate','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Fetching\x20workspace\x20\x27','Delete\x20an\x20email\x20template','Error:\x20--subject\x20is\x20required','Fetching\x20campaign\x20\x27','listWorkspaces','editorType','Deleting\x20template\x20\x27','engage','Delete\x20a\x20workspace','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Workspace\x20\x27','engage:campaign:duplicate','engage:workspace:delete','23055936xAYpVS','getTemplateFull','engage_workspace','Workspace\x20is\x20required\x20for\x20this\x20operation','emailSenderId','\x27\x20resumed\x20successfully','Show\x20workspace\x20details','getCampaignFull','engage:campaign:launch','session','engage:workspace:show','Operation\x20cancelled','List\x20workspaces','Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','Error:\x20--name\x20is\x20required','97160xGYVwA','getCampaign','startAt','pauseCampaign','\x27...','getWorkspace','yes','\x27\x20paused\x20successfully','8057871VRAxeD','MISSING_ARGUMENT','data','engage:template:create','Template\x20\x27','limit','Updating\x20workspace\x20\x27','\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides','Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27','resolveWorkspaceId','Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>','\x27\x20deleted\x20successfully','engage:campaign:pause','Resuming\x20campaign\x20\x27','entries','listCampaigns','2438NrgbOv','engage:workspaces','Duplicate\x20a\x20campaign','Update\x20an\x20email\x20template','Fetching\x20campaigns...','827BnEoCb','Launching\x20campaign\x20\x27','deleteWorkspace','filter','resolvePathToResource','parentId','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','Set\x20workspace\x20context\x20for\x20Engage\x20commands','getTemplate','78DmUgam','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','2454RPRHDu','verbose','List\x20campaigns','Create\x20an\x20email\x20template','Campaign\x20\x27','resumeCampaign','354280TqWsOF','Fetching\x20templates...','4868kFJxQT','fromEntries','segmentId','Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]','updateCampaign','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','keys','Pause\x20a\x20campaign','engage:templates','8RgTBPl','Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>','Error:\x20--html\x20is\x20required','Duplicating\x20campaign\x20\x27','836640auMEiP','deleteCampaign','\x27?\x20This\x20cannot\x20be\x20undone.','engage:campaign:show','Options:\x20--name,\x20--description','engage:workspace:update','segment','workspace','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','Fetching\x20workspaces...','execute','engage:workspace:create','Show\x20campaign\x20details','createCampaign','createWorkspace','Updating\x20template\x20\x27','Show\x20email\x20template\x20details'];a23_0x1b34=function(){return _0x16e206;};return a23_0x1b34();}export class EngageCampaignResumeCommand extends BaseCommand{[a23_0x4b9761(0xdc)]='engage:campaign:resume';['description']='Resume\x20a\x20paused\x20campaign';async[a23_0x4b9761(0xd3)](_0x40f7a8){const _0x3c5535=a23_0x4b9761,{options:_0x419b99,args:_0x5c9fae,tdx:_0x4a2a15}=_0x40f7a8;if(_0x5c9fae[_0x3c5535(0xe9)]===0x0)return console['error'](_0x3c5535(0x77)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>'),0x1;const _0xe72e8a=_0x5c9fae[0x0],_0x328d2c=_0x419b99,_0x8319fa=await resolveWorkspaceIdFromOptions(_0x328d2c,_0x4a2a15);return await withSpinner(_0x3c5535(0x9f)+_0xe72e8a+_0x3c5535(0x8e),()=>_0x4a2a15[_0x3c5535(0x75)][_0x3c5535(0xb8)](_0xe72e8a,_0x8319fa),{'verbose':_0x419b99[_0x3c5535(0xb4)]}),console['log'](_0x3c5535(0xb7)+_0xe72e8a+_0x3c5535(0x80)),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']=a23_0x4b9761(0x79);[a23_0x4b9761(0xdf)]=a23_0x4b9761(0xa4);async['execute'](_0x20c286){const _0x2b1af2=a23_0x4b9761,{options:_0x4ec933,args:_0x38e22a,tdx:_0x3e6079}=_0x20c286;if(_0x38e22a['length']===0x0)return console[_0x2b1af2(0xef)]('Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required'),console[_0x2b1af2(0xef)](_0x2b1af2(0xad)),0x1;const _0x492322=_0x38e22a[0x0],_0x130df5=_0x4ec933,_0x23b22a=await resolveWorkspaceIdFromOptions(_0x130df5,_0x3e6079),_0x512200=await withSpinner(_0x2b1af2(0xc7)+_0x492322+'\x27...',()=>_0x3e6079[_0x2b1af2(0x75)]['duplicateCampaign'](_0x492322,_0x23b22a),{'verbose':_0x4ec933['verbose']});return await handleSDKOutput([_0x512200['data']],_0x4ec933),0x0;}}export class EngageTemplatesCommand extends BaseCommand{[a23_0x4b9761(0xdc)]=a23_0x4b9761(0xc3);[a23_0x4b9761(0xdf)]='List\x20email\x20templates';async[a23_0x4b9761(0xd3)](_0x7c0545){const _0x299748=a23_0x4b9761,{options:_0x31f353,args:_0xa4f339,tdx:_0x2720da}=_0x7c0545,_0x3ea0f9=_0xa4f339[0x0],_0x68796a=resolveLimit(_0x31f353['limit'],DEFAULT_LLM_LIMIT),_0x5f234c=_0x31f353,_0x149595=await resolveWorkspaceIdFromOptions(_0x5f234c,_0x2720da),_0x1f7bf0=await withSpinner(_0x299748(0xba),()=>_0x2720da[_0x299748(0x75)]['listTemplates']({'workspaceId':_0x149595,'limit':_0x68796a}),{'verbose':_0x31f353[_0x299748(0xb4)]});let _0x41ba16=_0x1f7bf0[_0x299748(0x94)];return _0x3ea0f9&&(_0x41ba16=_0x1f7bf0[_0x299748(0x94)][_0x299748(0xaa)](_0x4235f=>matchGlobPattern(_0x4235f[_0x299748(0xdc)],_0x3ea0f9))),await handleSDKOutput(_0x41ba16,_0x31f353),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a23_0x4b9761(0xdc)]=a23_0x4b9761(0xe5);[a23_0x4b9761(0xdf)]=a23_0x4b9761(0xd9);async[a23_0x4b9761(0xd3)](_0x1bd3da){const _0xdc3dd9=a23_0x4b9761,{options:_0x1ab1ee,args:_0x3f3606,tdx:_0x48b573}=_0x1bd3da;if(_0x3f3606['length']===0x0)return console[_0xdc3dd9(0xef)](_0xdc3dd9(0xb2)),console[_0xdc3dd9(0xef)]('Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>'),0x1;const _0x1c6774=_0x3f3606[0x0],_0x5eabf7=_0x1ab1ee,_0x28aace=await resolveWorkspaceIdFromOptions(_0x5eabf7,_0x48b573),_0x2b5e3c=_0x5eabf7['full'];if(_0x2b5e3c){const _0x18f760=await withSpinner(_0xdc3dd9(0xec)+_0x1c6774+_0xdc3dd9(0x8e),()=>_0x48b573['engage'][_0xdc3dd9(0x7c)](_0x1c6774,_0x28aace),{'verbose':_0x1ab1ee[_0xdc3dd9(0xb4)]});await handleSDKOutput([_0x18f760],_0x1ab1ee);}else{const _0x4e958c=await withSpinner(_0xdc3dd9(0xec)+_0x1c6774+_0xdc3dd9(0x8e),()=>_0x48b573['engage'][_0xdc3dd9(0xb0)](_0x1c6774,_0x28aace),{'verbose':_0x1ab1ee[_0xdc3dd9(0xb4)]});await handleSDKOutput([_0x4e958c],_0x1ab1ee);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a23_0x4b9761(0xdc)]=a23_0x4b9761(0x95);[a23_0x4b9761(0xdf)]=a23_0x4b9761(0xb6);async['execute'](_0x429c76){const _0x5a9c42=a23_0x4b9761,{options:_0x184af8,tdx:_0x2a59a2}=_0x429c76,_0x4ca37f=_0x184af8,_0x3e68b4=_0x4ca37f[_0x5a9c42(0xdc)],_0x3e89a2=_0x4ca37f[_0x5a9c42(0xdb)],_0x46116d=_0x4ca37f[_0x5a9c42(0xee)];if(!_0x3e68b4)return console[_0x5a9c42(0xef)](_0x5a9c42(0x89)),console[_0x5a9c42(0xef)]('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x3e89a2)return console['error'](_0x5a9c42(0x70)),0x1;if(!_0x46116d)return console[_0x5a9c42(0xef)](_0x5a9c42(0xc6)),0x1;const _0x4ccaa0=await resolveWorkspaceIdFromOptions(_0x4ca37f,_0x2a59a2,!![]),_0x14f26c={'name':_0x3e68b4,'subjectTemplate':_0x3e89a2,'htmlTemplate':_0x46116d,'workspaceId':_0x4ccaa0,'plaintextTemplate':_0x4ca37f[_0x5a9c42(0xe2)],'editorType':_0x4ca37f[_0x5a9c42(0x73)]},_0x2465cf=await withSpinner('Creating\x20template\x20\x27'+_0x3e68b4+_0x5a9c42(0x8e),()=>_0x2a59a2[_0x5a9c42(0x75)][_0x5a9c42(0xed)](_0x14f26c));return await handleSDKOutput([_0x2465cf[_0x5a9c42(0x94)]],_0x184af8),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{['name']=a23_0x4b9761(0xf1);[a23_0x4b9761(0xdf)]=a23_0x4b9761(0xa5);async[a23_0x4b9761(0xd3)](_0x445b7a){const _0x173b17=a23_0x4b9761,{options:_0x2103ba,args:_0x308c59,tdx:_0x14a297}=_0x445b7a;if(_0x308c59[_0x173b17(0xe9)]===0x0)return console[_0x173b17(0xef)](_0x173b17(0xb2)),console[_0x173b17(0xef)](_0x173b17(0x88)),0x1;const _0x4a0a3b=_0x308c59[0x0],_0xbd8b01=_0x2103ba,_0x141d23=await resolveWorkspaceIdFromOptions(_0xbd8b01,_0x14a297),_0x320726={'name':_0xbd8b01[_0x173b17(0xdc)],'subjectTemplate':_0xbd8b01[_0x173b17(0xdb)],'htmlTemplate':_0xbd8b01[_0x173b17(0xee)],'plaintextTemplate':_0xbd8b01[_0x173b17(0xe2)]},_0x30f66c=Object[_0x173b17(0xbc)](Object[_0x173b17(0xa0)](_0x320726)[_0x173b17(0xaa)](([,_0x1e41bc])=>_0x1e41bc!==undefined));if(Object[_0x173b17(0xc1)](_0x30f66c)[_0x173b17(0xe9)]===0x0)return console[_0x173b17(0xef)](_0x173b17(0x6d)),console[_0x173b17(0xef)](_0x173b17(0xea)),0x1;const _0x3d87d8=await withSpinner(_0x173b17(0xd8)+_0x4a0a3b+_0x173b17(0x8e),()=>_0x14a297['engage'][_0x173b17(0xf5)](_0x4a0a3b,_0x30f66c,_0x141d23),{'verbose':_0x2103ba[_0x173b17(0xb4)]});return await handleSDKOutput([_0x3d87d8[_0x173b17(0x94)]],_0x2103ba),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a23_0x4b9761(0xdc)]=a23_0x4b9761(0xe4);[a23_0x4b9761(0xdf)]=a23_0x4b9761(0x6f);async[a23_0x4b9761(0xd3)](_0x29859b){const _0x286547=a23_0x4b9761,{options:_0x5c4f18,args:_0x2acac9,tdx:_0x543720}=_0x29859b;if(_0x2acac9['length']===0x0)return console[_0x286547(0xef)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0x286547(0xef)](_0x286547(0x9c)),0x1;const _0x25192c=_0x2acac9[0x0],_0x4762bb=_0x5c4f18,_0x374a8f=await resolveWorkspaceIdFromOptions(_0x4762bb,_0x543720);if(!_0x5c4f18['yes']){const _0x5ecd59=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x25192c+'\x27?\x20This\x20cannot\x20be\x20undone.');if(!_0x5ecd59)return console[_0x286547(0xe1)](_0x286547(0x86)),0x0;}return await withSpinner(_0x286547(0x74)+_0x25192c+_0x286547(0x8e),()=>_0x543720[_0x286547(0x75)]['deleteTemplate'](_0x25192c,_0x374a8f),{'verbose':_0x5c4f18[_0x286547(0xb4)]}),console['log'](_0x286547(0x96)+_0x25192c+_0x286547(0x9d)),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a23_0x4b9761(0xdc)]=a23_0x4b9761(0xa3);['description']=a23_0x4b9761(0x87);async['execute'](_0xc6662a){const _0x592eb2=a23_0x4b9761,{options:_0x3755d0,args:_0x81f16f,tdx:_0x138a5d}=_0xc6662a,_0x3e0da4=_0x81f16f[0x0],_0x25486d=resolveLimit(_0x3755d0[_0x592eb2(0x97)],DEFAULT_LLM_LIMIT),_0x4c9469=await withSpinner(_0x592eb2(0xd2),()=>_0x138a5d[_0x592eb2(0x75)][_0x592eb2(0x72)]({'limit':_0x25486d}),{'verbose':_0x3755d0[_0x592eb2(0xb4)]});let _0x44f936=_0x4c9469[_0x592eb2(0x94)];return _0x3e0da4&&(_0x44f936=_0x4c9469['data'][_0x592eb2(0xaa)](_0x46469e=>matchGlobPattern(_0x46469e[_0x592eb2(0xdc)],_0x3e0da4))),await handleSDKOutput(_0x44f936,_0x3755d0),0x0;}}function a23_0x216e(_0x2bafbe,_0x121bc9){_0x2bafbe=_0x2bafbe-0x6d;const _0x1b34c6=a23_0x1b34();let _0x216e68=_0x1b34c6[_0x2bafbe];return _0x216e68;}export class EngageWorkspaceShowCommand extends BaseCommand{[a23_0x4b9761(0xdc)]=a23_0x4b9761(0x85);[a23_0x4b9761(0xdf)]=a23_0x4b9761(0x81);async['execute'](_0x3e32b7){const _0x3a936b=a23_0x4b9761,{options:_0x7b0d93,args:_0x5c250d,tdx:_0x54a07a}=_0x3e32b7;if(_0x5c250d['length']===0x0)return console[_0x3a936b(0xef)](_0x3a936b(0xd1)),console[_0x3a936b(0xef)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x522059=_0x5c250d[0x0],_0x25941b=_0x7b0d93,_0xe8cfef=_0x25941b['full'];if(_0xe8cfef){const _0x2c80c0=await withSpinner(_0x3a936b(0x6e)+_0x522059+'\x27...',()=>_0x54a07a[_0x3a936b(0x75)]['getWorkspaceFull'](_0x522059),{'verbose':_0x7b0d93['verbose']});await handleSDKOutput([_0x2c80c0],_0x7b0d93);}else{const _0xcb0a59=await withSpinner(_0x3a936b(0x6e)+_0x522059+_0x3a936b(0x8e),()=>_0x54a07a['engage'][_0x3a936b(0x8f)](_0x522059),{'verbose':_0x7b0d93[_0x3a936b(0xb4)]});await handleSDKOutput([_0xcb0a59],_0x7b0d93);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{['name']=a23_0x4b9761(0xd4);[a23_0x4b9761(0xdf)]='Create\x20a\x20workspace';async[a23_0x4b9761(0xd3)](_0x2f38ba){const _0x3e4007=a23_0x4b9761,{options:_0x301e5c,tdx:_0x16d2bc}=_0x2f38ba,_0x28abe7=_0x301e5c,_0x5e0929=_0x28abe7[_0x3e4007(0xdc)];if(!_0x5e0929)return console[_0x3e4007(0xef)](_0x3e4007(0x89)),console[_0x3e4007(0xef)](_0x3e4007(0xbe)),0x1;const _0xb71e00={'name':_0x5e0929,'description':_0x28abe7[_0x3e4007(0xdf)]},_0x316cdc=await withSpinner('Creating\x20workspace\x20\x27'+_0x5e0929+'\x27...',()=>_0x16d2bc[_0x3e4007(0x75)][_0x3e4007(0xd7)](_0xb71e00));return await handleSDKOutput([_0x316cdc[_0x3e4007(0x94)]],_0x301e5c),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{[a23_0x4b9761(0xdc)]=a23_0x4b9761(0xcd);['description']='Update\x20a\x20workspace';async[a23_0x4b9761(0xd3)](_0x2763a3){const _0x5602fb=a23_0x4b9761,{options:_0x51ccf8,args:_0x26f31c,tdx:_0x4bee55}=_0x2763a3;if(_0x26f31c['length']===0x0)return console['error']('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x57df61=_0x26f31c[0x0],_0x84ccb7=_0x51ccf8,_0x48dbfc={'name':_0x84ccb7[_0x5602fb(0xdc)],'description':_0x84ccb7[_0x5602fb(0xdf)]},_0x183b39=Object['fromEntries'](Object['entries'](_0x48dbfc)[_0x5602fb(0xaa)](([,_0xf0eb27])=>_0xf0eb27!==undefined));if(Object[_0x5602fb(0xc1)](_0x183b39)['length']===0x0)return console[_0x5602fb(0xef)](_0x5602fb(0x6d)),console[_0x5602fb(0xef)](_0x5602fb(0xcc)),0x1;const _0x82f4f2=await withSpinner(_0x5602fb(0x98)+_0x57df61+_0x5602fb(0x8e),()=>_0x4bee55[_0x5602fb(0x75)][_0x5602fb(0xe3)](_0x57df61,_0x183b39),{'verbose':_0x51ccf8['verbose']});return await handleSDKOutput([_0x82f4f2[_0x5602fb(0x94)]],_0x51ccf8),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a23_0x4b9761(0xdc)]=a23_0x4b9761(0x7a);[a23_0x4b9761(0xdf)]=a23_0x4b9761(0x76);async[a23_0x4b9761(0xd3)](_0x465692){const _0x386316=a23_0x4b9761,{options:_0x4287d6,args:_0x5f46da,tdx:_0x2f8db5}=_0x465692;if(_0x5f46da['length']===0x0)return console[_0x386316(0xef)](_0x386316(0xd1)),console['error']('Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>'),0x1;const _0x20c897=_0x5f46da[0x0];if(!_0x4287d6[_0x386316(0x90)]){const _0x38ee97=await confirm(_0x386316(0x9a)+_0x20c897+_0x386316(0xca));if(!_0x38ee97)return console[_0x386316(0xe1)]('Operation\x20cancelled'),0x0;}return await withSpinner('Deleting\x20workspace\x20\x27'+_0x20c897+_0x386316(0x8e),()=>_0x2f8db5[_0x386316(0x75)][_0x386316(0xa9)](_0x20c897),{'verbose':_0x4287d6['verbose']}),console[_0x386316(0xe1)](_0x386316(0x78)+_0x20c897+_0x386316(0x9d)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a23_0x4b9761(0xdc)]='engage:workspace:use';['description']=a23_0x4b9761(0xaf);async[a23_0x4b9761(0xd3)](_0x3da6d5){const _0xd9254a=a23_0x4b9761,{options:_0x3d3e58,args:_0x1a47ce,tdx:_0x555660}=_0x3da6d5;if(_0x1a47ce[_0xd9254a(0xe9)]===0x0)return console[_0xd9254a(0xef)]('Error:\x20Workspace\x20name\x20is\x20required'),console[_0xd9254a(0xef)](_0xd9254a(0xc0)),0x1;const _0x3e6d6a=_0x1a47ce[0x0];await withSpinner('Verifying\x20workspace\x20\x27'+_0x3e6d6a+_0xd9254a(0x8e),()=>_0x555660[_0xd9254a(0x75)][_0xd9254a(0x9b)](_0x3e6d6a));const _0x27f985=_0x3d3e58[_0xd9254a(0x84)]||undefined;return saveSessionContext({'engage_workspace':_0x3e6d6a},_0x27f985),console[_0xd9254a(0xe1)]('Engage\x20workspace\x20set\x20to:\x20'+_0x3e6d6a),console[_0xd9254a(0xe1)](_0xd9254a(0x99)),0x0;}}
|
|
1
|
+
const a23_0x1f4098=a23_0x4f5f;(function(_0x6fddf3,_0x28b676){const _0x2a71a1=a23_0x4f5f,_0x350d6f=_0x6fddf3();while(!![]){try{const _0x275601=parseInt(_0x2a71a1(0x1db))/0x1+parseInt(_0x2a71a1(0x1ae))/0x2*(parseInt(_0x2a71a1(0x1e7))/0x3)+-parseInt(_0x2a71a1(0x1c3))/0x4+-parseInt(_0x2a71a1(0x224))/0x5*(parseInt(_0x2a71a1(0x200))/0x6)+-parseInt(_0x2a71a1(0x213))/0x7+parseInt(_0x2a71a1(0x1af))/0x8*(-parseInt(_0x2a71a1(0x1da))/0x9)+-parseInt(_0x2a71a1(0x1b8))/0xa*(-parseInt(_0x2a71a1(0x219))/0xb);if(_0x275601===_0x28b676)break;else _0x350d6f['push'](_0x350d6f['shift']());}catch(_0x2696e3){_0x350d6f['push'](_0x350d6f['shift']());}}}(a23_0x5cf8,0xd10c1));import{BaseCommand}from'./command.js';import{handleSDKOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{matchGlobPattern}from'../utils/string-utils.js';import{confirm}from'../utils/prompt.js';function a23_0x5cf8(){const _0x3cf84d=['Set\x20workspace\x20context\x20for\x20Engage\x20commands','Workspace\x20\x27','engage:workspaces','Usage:\x20tdx\x20engage\x20campaign\x20resume\x20<name-or-id>','type','Usage:\x20tdx\x20engage\x20template\x20show\x20<name-or-id>','Error:\x20Workspace\x20name\x20is\x20required','Options:\x20--name,\x20--subject,\x20--html,\x20--plaintext','getTemplateFull','Deleting\x20template\x20\x27','Resume\x20a\x20paused\x20campaign','Template\x20\x27','Launching\x20campaign\x20\x27','listWorkspaces','2AybNWE','344JUbGYV','resolveWorkspaceId','updateTemplate','Usage:\x20tdx\x20engage\x20campaign\x20duplicate\x20<name-or-id>','getCampaign','fromEntries','Creating\x20template\x20\x27','data','Usage:\x20tdx\x20engage\x20campaign\x20delete\x20<name-or-id>','30010gWOgYo','engage_workspace','Deleting\x20workspace\x20\x27','Duplicate\x20a\x20campaign','resumeCampaign','Pause\x20a\x20campaign','listTemplates','Operation\x20cancelled','engage:workspace:use','engage','Error:\x20Template\x20name\x20or\x20ID\x20is\x20required','5619880HCVAlU','log','List\x20campaigns','engage:campaigns','Usage:\x20tdx\x20engage\x20campaign\x20create\x20--name\x20<name>\x20--type\x20<email|push>','segmentName','segmentId','Fetching\x20template\x20\x27','limit','error','Create\x20a\x20workspace','engage:campaign:update','engage:workspace:show','description','Usage:\x20tdx\x20engage\x20campaign\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','MISSING_ARGUMENT','Pausing\x20campaign\x20\x27','engage:workspace:update','updateWorkspace','\x27\x20paused\x20successfully','deleteWorkspace','Options:\x20--name,\x20--description','Updating\x20campaign\x20\x27','83115bXPHcy','954571ZUFyBz','keys','resolvePathToResource','engage:template:delete','plaintext','Error:\x20--type\x20is\x20required\x20(email\x20or\x20push)','Fetching\x20campaigns...','launchCampaign','getWorkspace','parentId','Delete\x20an\x20email\x20template','updateCampaign','2900814LXmjIT','execute','Deleting\x20campaign\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20use\x20<name>','listCampaigns','session','yes','Show\x20email\x20template\x20details','engage:template:update','Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required','Error:\x20Campaign\x20name\x20or\x20ID\x20is\x20required','Fetching\x20templates...','full','entries','pauseCampaign','filter','length','getWorkspaceFull','Show\x20workspace\x20details','parentName','Create\x20a\x20new\x20campaign','html','workspace','Verifying\x20workspace\x20\x27','Usage:\x20tdx\x20engage\x20workspace\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...','258lEWXBC','duplicateCampaign','subject','\x27...','engage:campaign:show','engage:campaign:pause','verbose','Workspace\x20is\x20required\x20for\x20this\x20operation','engage:template:show','startAt','Update\x20a\x20workspace','Create\x20an\x20email\x20template','Engage\x20workspace\x20set\x20to:\x20','createCampaign','name','Usage:\x20tdx\x20engage\x20workspace\x20delete\x20<name-or-id>','engage:campaign:create','createTemplate','Resuming\x20campaign\x20\x27','7407022xuAXwb','emailSenderId','List\x20email\x20templates','Fetching\x20workspace\x20\x27','engage:workspace:delete','Error:\x20--name\x20is\x20required','12221axDUaY','editorType','\x27\x20deleted\x20successfully','engage:campaign:resume','status','deleteTemplate','Creating\x20campaign\x20\x27','segment','Fetching\x20campaign\x20\x27','Campaign\x20\x27','Delete\x20a\x20workspace','178970lVJbPB','\x27?\x20This\x20cannot\x20be\x20undone.','Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required','timezone','Creating\x20workspace\x20\x27','jsonColumns','Show\x20campaign\x20details','engage:templates'];a23_0x5cf8=function(){return _0x3cf84d;};return a23_0x5cf8();}import{loadSessionContext,saveSessionContext}from'../core/session.js';import{DEFAULT_LLM_LIMIT,resolveLimit}from'../utils/constants.js';import{SDKError,ErrorCode}from'../sdk/errors.js';async function resolveWorkspaceIdFromOptions(_0x1cc136,_0xaf554f,_0xe77f59=![]){const _0xb6b5f6=a23_0x4f5f;if(_0x1cc136[_0xb6b5f6(0x1fd)])return await _0xaf554f[_0xb6b5f6(0x1c1)][_0xb6b5f6(0x1b0)](_0x1cc136[_0xb6b5f6(0x1fd)]);const _0x38754e=loadSessionContext(_0x1cc136[_0xb6b5f6(0x1ec)]);if(_0x38754e?.['engage_workspace'])return await _0xaf554f[_0xb6b5f6(0x1c1)]['resolveWorkspaceId'](_0x38754e[_0xb6b5f6(0x1b9)]);if(_0xe77f59)throw new SDKError(ErrorCode[_0xb6b5f6(0x1d2)],_0xb6b5f6(0x207),undefined,{'helpText':'Use\x20--workspace\x20<name>\x20or\x20set\x20with\x20\x22tdx\x20use\x20engage_workspace\x20<name>\x22'});return undefined;}async function resolveSegmentFromOptions(_0x444258,_0x1c8922){const _0x54d666=a23_0x4f5f;if(!_0x444258[_0x54d666(0x220)])return{};const _0x54fe60=_0x444258[_0x54d666(0x220)],_0x28c729=await _0x1c8922['segment'][_0x54d666(0x1dd)](_0x54fe60);return{'audienceId':_0x28c729[_0x54d666(0x1e4)],'audienceName':_0x28c729[_0x54d666(0x1fa)],..._0x28c729['segmentId']&&{'segmentId':_0x28c729[_0x54d666(0x1c9)],'segmentName':_0x28c729[_0x54d666(0x1c8)]}};}function buildConnectorConfig(_0x20856c){const _0x38fda9=a23_0x4f5f,_0x444fef=_0x20856c[_0x38fda9(0x214)],_0x457c04=_0x20856c[_0x38fda9(0x229)];if(!_0x444fef&&!_0x457c04)return undefined;return{..._0x444fef&&{'emailSenderId':_0x444fef},..._0x457c04&&{'jsonColumns':_0x457c04}};}export class EngageCampaignsCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1c6);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x1c5);async[a23_0x1f4098(0x1e8)](_0x4a61de){const _0x18b2d9=a23_0x1f4098,{options:_0x1c5ab5,args:_0x46c222,tdx:_0x3d74b2}=_0x4a61de,_0x44c04f=_0x46c222[0x0],_0x57cf95=resolveLimit(_0x1c5ab5[_0x18b2d9(0x1cb)],DEFAULT_LLM_LIMIT),_0x27c413=_0x1c5ab5,_0x58d5ea=_0x27c413[_0x18b2d9(0x1a4)],_0x340095=_0x27c413[_0x18b2d9(0x21d)],_0x1f4443=await resolveWorkspaceIdFromOptions(_0x27c413,_0x3d74b2),_0x296fe2=await withSpinner(_0x18b2d9(0x1e1),()=>_0x3d74b2[_0x18b2d9(0x1c1)][_0x18b2d9(0x1eb)]({'type':_0x58d5ea,'status':_0x340095,'workspaceId':_0x1f4443,'limit':_0x57cf95}),{'verbose':_0x1c5ab5[_0x18b2d9(0x206)]});let _0x25fe0d=_0x296fe2[_0x18b2d9(0x1b6)];return _0x44c04f&&(_0x25fe0d=_0x296fe2[_0x18b2d9(0x1b6)][_0x18b2d9(0x1f6)](_0x78a42e=>matchGlobPattern(_0x78a42e[_0x18b2d9(0x20e)],_0x44c04f))),await handleSDKOutput(_0x25fe0d,_0x1c5ab5),0x0;}}export class EngageCampaignShowCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x204);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x19e);async[a23_0x1f4098(0x1e8)](_0x446a3d){const _0x10c633=a23_0x1f4098,{options:_0x5785f5,args:_0x12186f,tdx:_0x3682da}=_0x446a3d;if(_0x12186f[_0x10c633(0x1f7)]===0x0)return console[_0x10c633(0x1cc)](_0x10c633(0x1f1)),console[_0x10c633(0x1cc)]('Usage:\x20tdx\x20engage\x20campaign\x20show\x20<name-or-id>'),0x1;const _0x1aac02=_0x12186f[0x0],_0xb9c003=_0x5785f5,_0x65d937=await resolveWorkspaceIdFromOptions(_0xb9c003,_0x3682da),_0x2fb3a0=_0xb9c003[_0x10c633(0x1f3)];if(_0x2fb3a0){const _0x41cec9=await withSpinner(_0x10c633(0x221)+_0x1aac02+_0x10c633(0x203),()=>_0x3682da[_0x10c633(0x1c1)]['getCampaignFull'](_0x1aac02,_0x65d937),{'verbose':_0x5785f5[_0x10c633(0x206)]});await handleSDKOutput([_0x41cec9],_0x5785f5);}else{const _0x2295d5=await withSpinner(_0x10c633(0x221)+_0x1aac02+_0x10c633(0x203),()=>_0x3682da[_0x10c633(0x1c1)][_0x10c633(0x1b3)](_0x1aac02,_0x65d937),{'verbose':_0x5785f5[_0x10c633(0x206)]});await handleSDKOutput([_0x2295d5],_0x5785f5);}return 0x0;}}export class EngageCampaignCreateCommand extends BaseCommand{['name']=a23_0x1f4098(0x210);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x1fb);async[a23_0x1f4098(0x1e8)](_0x2fbacd){const _0xe6ac4d=a23_0x1f4098,{options:_0x20328c,tdx:_0x2a550b}=_0x2fbacd,_0x150d65=_0x20328c,_0x2fbe44=_0x150d65['name'],_0x54d419=_0x150d65[_0xe6ac4d(0x1a4)];if(!_0x2fbe44)return console[_0xe6ac4d(0x1cc)]('Error:\x20--name\x20is\x20required'),console['error'](_0xe6ac4d(0x1c7)),0x1;if(!_0x54d419)return console[_0xe6ac4d(0x1cc)](_0xe6ac4d(0x1e0)),console['error'](_0xe6ac4d(0x1c7)),0x1;const _0x34712c=await resolveWorkspaceIdFromOptions(_0x150d65,_0x2a550b,!![]),_0x52bdc2=await resolveSegmentFromOptions(_0x150d65,_0x2a550b),_0x123f4e=buildConnectorConfig(_0x150d65),_0x527178={'name':_0x2fbe44,'campaignType':_0x54d419,'workspaceId':_0x34712c,'description':_0x150d65[_0xe6ac4d(0x1d0)],..._0x52bdc2,'connectorConfig':_0x123f4e,'startAt':_0x150d65[_0xe6ac4d(0x209)],'timezone':_0x150d65['timezone']},_0x4141a0=await withSpinner(_0xe6ac4d(0x21f)+_0x2fbe44+_0xe6ac4d(0x203),()=>_0x2a550b[_0xe6ac4d(0x1c1)][_0xe6ac4d(0x20d)](_0x527178));return await handleSDKOutput([_0x4141a0[_0xe6ac4d(0x1b6)]],_0x20328c),0x0;}}export class EngageCampaignUpdateCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1ce);[a23_0x1f4098(0x1d0)]='Update\x20a\x20campaign';async[a23_0x1f4098(0x1e8)](_0x52c22d){const _0x3de4bf=a23_0x1f4098,{options:_0x25dcbb,args:_0x397402,tdx:_0x5939b1}=_0x52c22d;if(_0x397402[_0x3de4bf(0x1f7)]===0x0)return console['error'](_0x3de4bf(0x1f1)),console[_0x3de4bf(0x1cc)](_0x3de4bf(0x1d1)),0x1;const _0x427073=_0x397402[0x0],_0x13af2d=_0x25dcbb,_0x5b9791=await resolveWorkspaceIdFromOptions(_0x13af2d,_0x5939b1),_0x40eb03=await resolveSegmentFromOptions(_0x13af2d,_0x5939b1),_0x2ea8b9=buildConnectorConfig(_0x13af2d),_0x34be0e={'name':_0x13af2d[_0x3de4bf(0x20e)],'description':_0x13af2d[_0x3de4bf(0x1d0)],..._0x40eb03,'connectorConfig':_0x2ea8b9,'startAt':_0x13af2d[_0x3de4bf(0x209)],'timezone':_0x13af2d[_0x3de4bf(0x227)]},_0x41ca66=Object[_0x3de4bf(0x1b4)](Object[_0x3de4bf(0x1f4)](_0x34be0e)[_0x3de4bf(0x1f6)](([,_0x94de60])=>_0x94de60!==undefined));if(Object['keys'](_0x41ca66)['length']===0x0)return console['error'](_0x3de4bf(0x1f0)),console['error']('Options:\x20--name,\x20--description,\x20--segment,\x20--email-sender-id,\x20--json-columns,\x20--start-at,\x20--timezone'),0x1;const _0xd9cc12=await withSpinner(_0x3de4bf(0x1d9)+_0x427073+_0x3de4bf(0x203),()=>_0x5939b1[_0x3de4bf(0x1c1)][_0x3de4bf(0x1e6)](_0x427073,_0x41ca66,_0x5b9791),{'verbose':_0x25dcbb[_0x3de4bf(0x206)]});return await handleSDKOutput([_0xd9cc12[_0x3de4bf(0x1b6)]],_0x25dcbb),0x0;}}export class EngageCampaignDeleteCommand extends BaseCommand{[a23_0x1f4098(0x20e)]='engage:campaign:delete';['description']='Delete\x20a\x20campaign';async[a23_0x1f4098(0x1e8)](_0x3d0ff1){const _0x3f38b5=a23_0x1f4098,{options:_0x3f9908,args:_0x2d6d67,tdx:_0x400bca}=_0x3d0ff1;if(_0x2d6d67[_0x3f38b5(0x1f7)]===0x0)return console[_0x3f38b5(0x1cc)](_0x3f38b5(0x1f1)),console[_0x3f38b5(0x1cc)](_0x3f38b5(0x1b7)),0x1;const _0x5770eb=_0x2d6d67[0x0],_0x6b3bbe=_0x3f9908,_0x2ec830=await resolveWorkspaceIdFromOptions(_0x6b3bbe,_0x400bca);if(!_0x3f9908['yes']){const _0xd58779=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20campaign\x20\x27'+_0x5770eb+_0x3f38b5(0x225));if(!_0xd58779)return console[_0x3f38b5(0x1c4)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x3f38b5(0x1e9)+_0x5770eb+_0x3f38b5(0x203),()=>_0x400bca['engage']['deleteCampaign'](_0x5770eb,_0x2ec830),{'verbose':_0x3f9908[_0x3f38b5(0x206)]}),console[_0x3f38b5(0x1c4)](_0x3f38b5(0x222)+_0x5770eb+_0x3f38b5(0x21b)),0x0;}}export class EngageCampaignLaunchCommand extends BaseCommand{[a23_0x1f4098(0x20e)]='engage:campaign:launch';[a23_0x1f4098(0x1d0)]='Launch\x20a\x20campaign';async['execute'](_0x20d549){const _0x1243f4=a23_0x1f4098,{options:_0x30b0d4,args:_0x4e0506,tdx:_0x5bbe1c}=_0x20d549;if(_0x4e0506[_0x1243f4(0x1f7)]===0x0)return console[_0x1243f4(0x1cc)](_0x1243f4(0x1f1)),console[_0x1243f4(0x1cc)]('Usage:\x20tdx\x20engage\x20campaign\x20launch\x20<name-or-id>'),0x1;const _0xfb150=_0x4e0506[0x0],_0x1a81a1=_0x30b0d4,_0x142e00=await resolveWorkspaceIdFromOptions(_0x1a81a1,_0x5bbe1c);return await withSpinner(_0x1243f4(0x1ac)+_0xfb150+_0x1243f4(0x203),()=>_0x5bbe1c['engage'][_0x1243f4(0x1e2)](_0xfb150,_0x142e00),{'verbose':_0x30b0d4[_0x1243f4(0x206)]}),console[_0x1243f4(0x1c4)]('Campaign\x20\x27'+_0xfb150+'\x27\x20launched\x20successfully'),0x0;}}export class EngageCampaignPauseCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x205);['description']=a23_0x1f4098(0x1bd);async[a23_0x1f4098(0x1e8)](_0x4d508c){const _0x289ee6=a23_0x1f4098,{options:_0xfa6a4,args:_0x1e3449,tdx:_0x4c2feb}=_0x4d508c;if(_0x1e3449['length']===0x0)return console['error'](_0x289ee6(0x1f1)),console['error']('Usage:\x20tdx\x20engage\x20campaign\x20pause\x20<name-or-id>'),0x1;const _0x52c2ff=_0x1e3449[0x0],_0x1d30e3=_0xfa6a4,_0x21a89d=await resolveWorkspaceIdFromOptions(_0x1d30e3,_0x4c2feb);return await withSpinner(_0x289ee6(0x1d3)+_0x52c2ff+_0x289ee6(0x203),()=>_0x4c2feb[_0x289ee6(0x1c1)][_0x289ee6(0x1f5)](_0x52c2ff,_0x21a89d),{'verbose':_0xfa6a4[_0x289ee6(0x206)]}),console[_0x289ee6(0x1c4)](_0x289ee6(0x222)+_0x52c2ff+_0x289ee6(0x1d6)),0x0;}}function a23_0x4f5f(_0x1d80bb,_0x3e61b0){_0x1d80bb=_0x1d80bb-0x19e;const _0x5cf884=a23_0x5cf8();let _0x4f5f4a=_0x5cf884[_0x1d80bb];return _0x4f5f4a;}export class EngageCampaignResumeCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x21c);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x1aa);async[a23_0x1f4098(0x1e8)](_0x127b01){const _0x40a730=a23_0x1f4098,{options:_0x4e69e6,args:_0x55da76,tdx:_0x1b79b2}=_0x127b01;if(_0x55da76[_0x40a730(0x1f7)]===0x0)return console[_0x40a730(0x1cc)](_0x40a730(0x1f1)),console[_0x40a730(0x1cc)](_0x40a730(0x1a3)),0x1;const _0x2b4a03=_0x55da76[0x0],_0x5825c3=_0x4e69e6,_0x4cc41f=await resolveWorkspaceIdFromOptions(_0x5825c3,_0x1b79b2);return await withSpinner(_0x40a730(0x212)+_0x2b4a03+_0x40a730(0x203),()=>_0x1b79b2[_0x40a730(0x1c1)][_0x40a730(0x1bc)](_0x2b4a03,_0x4cc41f),{'verbose':_0x4e69e6[_0x40a730(0x206)]}),console[_0x40a730(0x1c4)](_0x40a730(0x222)+_0x2b4a03+'\x27\x20resumed\x20successfully'),0x0;}}export class EngageCampaignDuplicateCommand extends BaseCommand{['name']='engage:campaign:duplicate';['description']=a23_0x1f4098(0x1bb);async[a23_0x1f4098(0x1e8)](_0x87e594){const _0x3a41d9=a23_0x1f4098,{options:_0x2c2bb6,args:_0x52548e,tdx:_0x183f8b}=_0x87e594;if(_0x52548e[_0x3a41d9(0x1f7)]===0x0)return console[_0x3a41d9(0x1cc)](_0x3a41d9(0x1f1)),console[_0x3a41d9(0x1cc)](_0x3a41d9(0x1b2)),0x1;const _0x36e326=_0x52548e[0x0],_0x43a17e=_0x2c2bb6,_0x4ec7d7=await resolveWorkspaceIdFromOptions(_0x43a17e,_0x183f8b),_0x1d0fd3=await withSpinner('Duplicating\x20campaign\x20\x27'+_0x36e326+_0x3a41d9(0x203),()=>_0x183f8b[_0x3a41d9(0x1c1)][_0x3a41d9(0x201)](_0x36e326,_0x4ec7d7),{'verbose':_0x2c2bb6[_0x3a41d9(0x206)]});return await handleSDKOutput([_0x1d0fd3['data']],_0x2c2bb6),0x0;}}export class EngageTemplatesCommand extends BaseCommand{['name']=a23_0x1f4098(0x19f);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x215);async[a23_0x1f4098(0x1e8)](_0x18e1b2){const _0x53b23e=a23_0x1f4098,{options:_0x1aec83,args:_0x24855a,tdx:_0xac177a}=_0x18e1b2,_0x5d317a=_0x24855a[0x0],_0x3235b9=resolveLimit(_0x1aec83[_0x53b23e(0x1cb)],DEFAULT_LLM_LIMIT),_0x1ffa42=_0x1aec83,_0x12f06b=await resolveWorkspaceIdFromOptions(_0x1ffa42,_0xac177a),_0x24fd69=await withSpinner(_0x53b23e(0x1f2),()=>_0xac177a[_0x53b23e(0x1c1)][_0x53b23e(0x1be)]({'workspaceId':_0x12f06b,'limit':_0x3235b9}),{'verbose':_0x1aec83[_0x53b23e(0x206)]});let _0x32973f=_0x24fd69[_0x53b23e(0x1b6)];return _0x5d317a&&(_0x32973f=_0x24fd69['data']['filter'](_0x331bb6=>matchGlobPattern(_0x331bb6[_0x53b23e(0x20e)],_0x5d317a))),await handleSDKOutput(_0x32973f,_0x1aec83),0x0;}}export class EngageTemplateShowCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x208);['description']=a23_0x1f4098(0x1ee);async[a23_0x1f4098(0x1e8)](_0x1e4802){const _0x223b79=a23_0x1f4098,{options:_0x919a81,args:_0x4a8c32,tdx:_0x2556cc}=_0x1e4802;if(_0x4a8c32[_0x223b79(0x1f7)]===0x0)return console[_0x223b79(0x1cc)](_0x223b79(0x1c2)),console[_0x223b79(0x1cc)](_0x223b79(0x1a5)),0x1;const _0x341ca5=_0x4a8c32[0x0],_0x5ad968=_0x919a81,_0x2d1e1b=await resolveWorkspaceIdFromOptions(_0x5ad968,_0x2556cc),_0x3c66a8=_0x5ad968[_0x223b79(0x1f3)];if(_0x3c66a8){const _0x28e432=await withSpinner(_0x223b79(0x1ca)+_0x341ca5+_0x223b79(0x203),()=>_0x2556cc[_0x223b79(0x1c1)][_0x223b79(0x1a8)](_0x341ca5,_0x2d1e1b),{'verbose':_0x919a81[_0x223b79(0x206)]});await handleSDKOutput([_0x28e432],_0x919a81);}else{const _0x512ad0=await withSpinner(_0x223b79(0x1ca)+_0x341ca5+_0x223b79(0x203),()=>_0x2556cc['engage']['getTemplate'](_0x341ca5,_0x2d1e1b),{'verbose':_0x919a81[_0x223b79(0x206)]});await handleSDKOutput([_0x512ad0],_0x919a81);}return 0x0;}}export class EngageTemplateCreateCommand extends BaseCommand{[a23_0x1f4098(0x20e)]='engage:template:create';['description']=a23_0x1f4098(0x20b);async['execute'](_0xf2e07f){const _0x2e3ba6=a23_0x1f4098,{options:_0x1f87ca,tdx:_0x4e1a69}=_0xf2e07f,_0x437703=_0x1f87ca,_0x3646cd=_0x437703[_0x2e3ba6(0x20e)],_0x251d67=_0x437703[_0x2e3ba6(0x202)],_0x378690=_0x437703['html'];if(!_0x3646cd)return console[_0x2e3ba6(0x1cc)](_0x2e3ba6(0x218)),console['error']('Usage:\x20tdx\x20engage\x20template\x20create\x20--name\x20<name>\x20--subject\x20<subject>\x20--html\x20<html>'),0x1;if(!_0x251d67)return console[_0x2e3ba6(0x1cc)]('Error:\x20--subject\x20is\x20required'),0x1;if(!_0x378690)return console[_0x2e3ba6(0x1cc)]('Error:\x20--html\x20is\x20required'),0x1;const _0x4812e9=await resolveWorkspaceIdFromOptions(_0x437703,_0x4e1a69,!![]),_0x2b1319={'name':_0x3646cd,'subjectTemplate':_0x251d67,'htmlTemplate':_0x378690,'workspaceId':_0x4812e9,'plaintextTemplate':_0x437703['plaintext'],'editorType':_0x437703[_0x2e3ba6(0x21a)]},_0x47332a=await withSpinner(_0x2e3ba6(0x1b5)+_0x3646cd+_0x2e3ba6(0x203),()=>_0x4e1a69[_0x2e3ba6(0x1c1)][_0x2e3ba6(0x211)](_0x2b1319));return await handleSDKOutput([_0x47332a[_0x2e3ba6(0x1b6)]],_0x1f87ca),0x0;}}export class EngageTemplateUpdateCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1ef);[a23_0x1f4098(0x1d0)]='Update\x20an\x20email\x20template';async[a23_0x1f4098(0x1e8)](_0x54918e){const _0xe32298=a23_0x1f4098,{options:_0x3de851,args:_0x4df99f,tdx:_0x3cffeb}=_0x54918e;if(_0x4df99f['length']===0x0)return console[_0xe32298(0x1cc)]('Error:\x20Template\x20name\x20or\x20ID\x20is\x20required'),console[_0xe32298(0x1cc)]('Usage:\x20tdx\x20engage\x20template\x20update\x20<name-or-id>\x20[--name\x20<new-name>]\x20...'),0x1;const _0x43db6a=_0x4df99f[0x0],_0x4b8ab6=_0x3de851,_0x53aa18=await resolveWorkspaceIdFromOptions(_0x4b8ab6,_0x3cffeb),_0x12ed89={'name':_0x4b8ab6[_0xe32298(0x20e)],'subjectTemplate':_0x4b8ab6[_0xe32298(0x202)],'htmlTemplate':_0x4b8ab6[_0xe32298(0x1fc)],'plaintextTemplate':_0x4b8ab6[_0xe32298(0x1df)]},_0x55ceff=Object[_0xe32298(0x1b4)](Object['entries'](_0x12ed89)[_0xe32298(0x1f6)](([,_0x1ddbe0])=>_0x1ddbe0!==undefined));if(Object[_0xe32298(0x1dc)](_0x55ceff)[_0xe32298(0x1f7)]===0x0)return console[_0xe32298(0x1cc)]('Error:\x20At\x20least\x20one\x20field\x20to\x20update\x20is\x20required'),console['error'](_0xe32298(0x1a7)),0x1;const _0x23f056=await withSpinner('Updating\x20template\x20\x27'+_0x43db6a+_0xe32298(0x203),()=>_0x3cffeb[_0xe32298(0x1c1)][_0xe32298(0x1b1)](_0x43db6a,_0x55ceff,_0x53aa18),{'verbose':_0x3de851['verbose']});return await handleSDKOutput([_0x23f056[_0xe32298(0x1b6)]],_0x3de851),0x0;}}export class EngageTemplateDeleteCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1de);['description']=a23_0x1f4098(0x1e5);async['execute'](_0x18ab5b){const _0x4fec77=a23_0x1f4098,{options:_0x56db1a,args:_0x43197a,tdx:_0x573fba}=_0x18ab5b;if(_0x43197a[_0x4fec77(0x1f7)]===0x0)return console['error'](_0x4fec77(0x1c2)),console[_0x4fec77(0x1cc)]('Usage:\x20tdx\x20engage\x20template\x20delete\x20<name-or-id>'),0x1;const _0x1d4f01=_0x43197a[0x0],_0x50510d=_0x56db1a,_0x3a8d84=await resolveWorkspaceIdFromOptions(_0x50510d,_0x573fba);if(!_0x56db1a[_0x4fec77(0x1ed)]){const _0x43eed2=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20template\x20\x27'+_0x1d4f01+_0x4fec77(0x225));if(!_0x43eed2)return console[_0x4fec77(0x1c4)](_0x4fec77(0x1bf)),0x0;}return await withSpinner(_0x4fec77(0x1a9)+_0x1d4f01+_0x4fec77(0x203),()=>_0x573fba[_0x4fec77(0x1c1)][_0x4fec77(0x21e)](_0x1d4f01,_0x3a8d84),{'verbose':_0x56db1a[_0x4fec77(0x206)]}),console['log'](_0x4fec77(0x1ab)+_0x1d4f01+'\x27\x20deleted\x20successfully'),0x0;}}export class EngageWorkspacesCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1a2);['description']='List\x20workspaces';async[a23_0x1f4098(0x1e8)](_0x195ded){const _0x1e0b66=a23_0x1f4098,{options:_0x55795f,args:_0x491d0d,tdx:_0x180982}=_0x195ded,_0x1677b6=_0x491d0d[0x0],_0x2278de=resolveLimit(_0x55795f[_0x1e0b66(0x1cb)],DEFAULT_LLM_LIMIT),_0x10d70f=await withSpinner('Fetching\x20workspaces...',()=>_0x180982[_0x1e0b66(0x1c1)][_0x1e0b66(0x1ad)]({'limit':_0x2278de}),{'verbose':_0x55795f[_0x1e0b66(0x206)]});let _0x79afdd=_0x10d70f[_0x1e0b66(0x1b6)];return _0x1677b6&&(_0x79afdd=_0x10d70f[_0x1e0b66(0x1b6)][_0x1e0b66(0x1f6)](_0x2554f2=>matchGlobPattern(_0x2554f2[_0x1e0b66(0x20e)],_0x1677b6))),await handleSDKOutput(_0x79afdd,_0x55795f),0x0;}}export class EngageWorkspaceShowCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1cf);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x1f9);async[a23_0x1f4098(0x1e8)](_0x33a0a3){const _0x31167e=a23_0x1f4098,{options:_0x4a85e9,args:_0x4a0ebc,tdx:_0x4b1c96}=_0x33a0a3;if(_0x4a0ebc['length']===0x0)return console[_0x31167e(0x1cc)](_0x31167e(0x226)),console[_0x31167e(0x1cc)]('Usage:\x20tdx\x20engage\x20workspace\x20show\x20<name-or-id>'),0x1;const _0x5877bc=_0x4a0ebc[0x0],_0x3a1554=_0x4a85e9,_0x44d86a=_0x3a1554['full'];if(_0x44d86a){const _0x4654ac=await withSpinner(_0x31167e(0x216)+_0x5877bc+_0x31167e(0x203),()=>_0x4b1c96[_0x31167e(0x1c1)][_0x31167e(0x1f8)](_0x5877bc),{'verbose':_0x4a85e9[_0x31167e(0x206)]});await handleSDKOutput([_0x4654ac],_0x4a85e9);}else{const _0x58ce07=await withSpinner(_0x31167e(0x216)+_0x5877bc+_0x31167e(0x203),()=>_0x4b1c96['engage'][_0x31167e(0x1e3)](_0x5877bc),{'verbose':_0x4a85e9[_0x31167e(0x206)]});await handleSDKOutput([_0x58ce07],_0x4a85e9);}return 0x0;}}export class EngageWorkspaceCreateCommand extends BaseCommand{[a23_0x1f4098(0x20e)]='engage:workspace:create';['description']=a23_0x1f4098(0x1cd);async[a23_0x1f4098(0x1e8)](_0x31d992){const _0x17f9aa=a23_0x1f4098,{options:_0x229271,tdx:_0x17c821}=_0x31d992,_0x31e037=_0x229271,_0x2d6558=_0x31e037['name'];if(!_0x2d6558)return console[_0x17f9aa(0x1cc)](_0x17f9aa(0x218)),console[_0x17f9aa(0x1cc)]('Usage:\x20tdx\x20engage\x20workspace\x20create\x20--name\x20<name>\x20[--description\x20<desc>]'),0x1;const _0x273de2={'name':_0x2d6558,'description':_0x31e037['description']},_0x9ffc57=await withSpinner(_0x17f9aa(0x228)+_0x2d6558+_0x17f9aa(0x203),()=>_0x17c821[_0x17f9aa(0x1c1)]['createWorkspace'](_0x273de2));return await handleSDKOutput([_0x9ffc57['data']],_0x229271),0x0;}}export class EngageWorkspaceUpdateCommand extends BaseCommand{['name']=a23_0x1f4098(0x1d4);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x20a);async[a23_0x1f4098(0x1e8)](_0xc8f6a){const _0xb235d6=a23_0x1f4098,{options:_0x34119f,args:_0x251414,tdx:_0xb0ca9c}=_0xc8f6a;if(_0x251414['length']===0x0)return console[_0xb235d6(0x1cc)](_0xb235d6(0x226)),console[_0xb235d6(0x1cc)](_0xb235d6(0x1ff)),0x1;const _0x93626a=_0x251414[0x0],_0x34cb00=_0x34119f,_0x42cd1a={'name':_0x34cb00[_0xb235d6(0x20e)],'description':_0x34cb00[_0xb235d6(0x1d0)]},_0x1728b0=Object[_0xb235d6(0x1b4)](Object[_0xb235d6(0x1f4)](_0x42cd1a)[_0xb235d6(0x1f6)](([,_0x42f266])=>_0x42f266!==undefined));if(Object['keys'](_0x1728b0)[_0xb235d6(0x1f7)]===0x0)return console[_0xb235d6(0x1cc)](_0xb235d6(0x1f0)),console[_0xb235d6(0x1cc)](_0xb235d6(0x1d8)),0x1;const _0x1abd1a=await withSpinner('Updating\x20workspace\x20\x27'+_0x93626a+_0xb235d6(0x203),()=>_0xb0ca9c[_0xb235d6(0x1c1)][_0xb235d6(0x1d5)](_0x93626a,_0x1728b0),{'verbose':_0x34119f[_0xb235d6(0x206)]});return await handleSDKOutput([_0x1abd1a[_0xb235d6(0x1b6)]],_0x34119f),0x0;}}export class EngageWorkspaceDeleteCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x217);['description']=a23_0x1f4098(0x223);async['execute'](_0x4a9235){const _0x1eafb3=a23_0x1f4098,{options:_0x3a5190,args:_0x3a5d29,tdx:_0x28e57}=_0x4a9235;if(_0x3a5d29['length']===0x0)return console[_0x1eafb3(0x1cc)]('Error:\x20Workspace\x20name\x20or\x20ID\x20is\x20required'),console['error'](_0x1eafb3(0x20f)),0x1;const _0xcac4b=_0x3a5d29[0x0];if(!_0x3a5190[_0x1eafb3(0x1ed)]){const _0x35775f=await confirm('Are\x20you\x20sure\x20you\x20want\x20to\x20delete\x20workspace\x20\x27'+_0xcac4b+_0x1eafb3(0x225));if(!_0x35775f)return console[_0x1eafb3(0x1c4)]('Operation\x20cancelled'),0x0;}return await withSpinner(_0x1eafb3(0x1ba)+_0xcac4b+_0x1eafb3(0x203),()=>_0x28e57[_0x1eafb3(0x1c1)][_0x1eafb3(0x1d7)](_0xcac4b),{'verbose':_0x3a5190['verbose']}),console[_0x1eafb3(0x1c4)](_0x1eafb3(0x1a1)+_0xcac4b+_0x1eafb3(0x21b)),0x0;}}export class EngageWorkspaceUseCommand extends BaseCommand{[a23_0x1f4098(0x20e)]=a23_0x1f4098(0x1c0);[a23_0x1f4098(0x1d0)]=a23_0x1f4098(0x1a0);async[a23_0x1f4098(0x1e8)](_0x2df5c5){const _0x38af9d=a23_0x1f4098,{options:_0x58318f,args:_0x4ecffc,tdx:_0x5c1d30}=_0x2df5c5;if(_0x4ecffc[_0x38af9d(0x1f7)]===0x0)return console[_0x38af9d(0x1cc)](_0x38af9d(0x1a6)),console['error'](_0x38af9d(0x1ea)),0x1;const _0x2f6ec0=_0x4ecffc[0x0];await withSpinner(_0x38af9d(0x1fe)+_0x2f6ec0+_0x38af9d(0x203),()=>_0x5c1d30[_0x38af9d(0x1c1)][_0x38af9d(0x1b0)](_0x2f6ec0));const _0x2800d9=_0x58318f[_0x38af9d(0x1ec)]||undefined;return saveSessionContext({'engage_workspace':_0x2f6ec0},_0x2800d9),console[_0x38af9d(0x1c4)](_0x38af9d(0x20c)+_0x2f6ec0),console[_0x38af9d(0x1c4)]('\x0aTip:\x20Use\x20\x27tdx\x20context\x20--clear\x27\x20to\x20clear\x20session\x20overrides'),0x0;}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a24_0x4527(_0x4df4fc,_0x6ff18){_0x4df4fc=_0x4df4fc-0x6e;const _0x2e7173=a24_0x2e71();let _0x4527d7=_0x2e7173[_0x4df4fc];return _0x4527d7;}const a24_0x10b94f=a24_0x4527;(function(_0x3c51b0,_0x3d58e9){const _0x381417=a24_0x4527,_0x423a7a=_0x3c51b0();while(!![]){try{const _0x30cf23=-parseInt(_0x381417(0xa5))/0x1+parseInt(_0x381417(0x74))/0x2*(-parseInt(_0x381417(0x8c))/0x3)+-parseInt(_0x381417(0x7e))/0x4*(-parseInt(_0x381417(0xb6))/0x5)+-parseInt(_0x381417(0x6f))/0x6*(-parseInt(_0x381417(0x71))/0x7)+-parseInt(_0x381417(0xb5))/0x8+-parseInt(_0x381417(0x7b))/0x9+-parseInt(_0x381417(0x9d))/0xa*(-parseInt(_0x381417(0x9f))/0xb);if(_0x30cf23===_0x3d58e9)break;else _0x423a7a['push'](_0x423a7a['shift']());}catch(_0x3cfa2b){_0x423a7a['push'](_0x423a7a['shift']());}}}(a24_0x2e71,0xb0e8c));import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';function a24_0x2e71(){const _0x774da4=['Getting\x20job\x20results...','round','\x20job','query','\x20\x20Job\x20ID:\x20','cause','information_schema','type','Show\x20job\x20details','job:show','1134021gluOaj','Query:\x20','yes','debug','Database:\x20','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','job_id','\x20jobs','created_at','getTime','Error:\x20Job\x20ID\x20is\x20required','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','name','...','jobs','result','Error:\x20Query\x20is\x20required','1480YQRRiR','\x20\x20Cause:\x20','132847ZHNaal','data','List\x20jobs','Usage:\x20job\x20show\x20<job-id>','Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option','Cancelled','599369TaLVRL','job:kill','Submit\x20a\x20job','url','Listing\x20jobs...','jobType','hive','error','trino','substring','length','\x27\x20to\x20verify\x20the\x20job\x20status','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','Usage:\x20job\x20kill\x20<job-id>','database','show','1208272UUkktD','305HCONIL','file','status','job:submit','Error:\x20','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','user_name','Kill\x20a\x20job','execute','3378viHGHb','priority','1421nfnFjI','job:result','message','2RIvrai','verbose','β\x20Job\x20submitted','β\x20Retrieved\x20','start_at','end_at','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','3555666gQDqSl','description','Getting\x20job\x20details...','22716nHjUXX','kill','Status\x20filter:\x20','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.'];a24_0x2e71=function(){return _0x774da4;};return a24_0x2e71();}import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a24_0x10b94f(0x98)]='jobs';[a24_0x10b94f(0x7c)]=a24_0x10b94f(0xa1);async[a24_0x10b94f(0x6e)](_0x566b3e){const _0x3b293b=a24_0x10b94f,{options:_0x251657,tdx:_0x598905}=_0x566b3e;try{const _0x7c853c=resolveLimit(_0x251657['limit'],DEFAULT_DISPLAY_LIMIT),_0x47a7f7=_0x251657[_0x3b293b(0xb8)];_0x251657[_0x3b293b(0x75)]&&(console[_0x3b293b(0xac)]('Limit:\x20'+_0x7c853c+_0x3b293b(0x93)),_0x47a7f7&&console[_0x3b293b(0xac)](_0x3b293b(0x80)+_0x47a7f7));const _0x58ec2e=await withSpinner(_0x3b293b(0xa9),()=>_0x598905[_0x3b293b(0x9a)]['list']({'from':0x0,'to':_0x7c853c-0x1,'status':_0x47a7f7}),{'verbose':_0x251657[_0x3b293b(0x75)]}),_0x5dbfe9=_0x58ec2e[_0x3b293b(0xa0)];console['error']('β\x20Found\x20'+_0x5dbfe9[_0x3b293b(0xaf)]+_0x3b293b(0x84)+(_0x5dbfe9[_0x3b293b(0xaf)]!==0x1?'s':''));const _0x2e6b81=_0x5dbfe9['map'](_0x2a95da=>{const _0x4ebe92=_0x3b293b;let _0x52477f;if(_0x2a95da[_0x4ebe92(0x78)]&&_0x2a95da[_0x4ebe92(0x79)]){const _0x4d5224=new Date(_0x2a95da['start_at'])[_0x4ebe92(0x95)](),_0x343db2=new Date(_0x2a95da[_0x4ebe92(0x79)])['getTime']();_0x52477f=Math[_0x4ebe92(0x83)]((_0x343db2-_0x4d5224)/0x3e8);}return{'job_id':_0x2a95da[_0x4ebe92(0x92)],'type':_0x2a95da[_0x4ebe92(0x89)],'status':_0x2a95da[_0x4ebe92(0xb8)],'user_name':_0x2a95da[_0x4ebe92(0xbc)],'duration_sec':_0x52477f,'created_at':_0x2a95da['created_at'],'started_at':_0x2a95da[_0x4ebe92(0x78)],'end_at':_0x2a95da[_0x4ebe92(0x79)]};});return await handleSDKOutput(_0x2e6b81,_0x251657),0x0;}catch(_0x2667b7){if(_0x2667b7 instanceof SDKError)return console[_0x3b293b(0xac)]('Error:\x20'+_0x2667b7[_0x3b293b(0x73)]),_0x2667b7[_0x3b293b(0x87)]&&console[_0x3b293b(0xac)](_0x3b293b(0x9e)+_0x2667b7[_0x3b293b(0x87)]),0x1;throw _0x2667b7;}}}export class JobShowCommand extends BaseCommand{[a24_0x10b94f(0x98)]=a24_0x10b94f(0x8b);['description']=a24_0x10b94f(0x8a);async[a24_0x10b94f(0x6e)](_0x1ec3d8){const _0x4693f2=a24_0x10b94f,{options:_0x41df76,args:_0x30ddd6,tdx:_0x4300a7}=_0x1ec3d8,_0x6c9bca=_0x30ddd6[0x0];if(!_0x6c9bca)return console['error'](_0x4693f2(0x96)),console['error'](_0x4693f2(0xa2)),0x1;try{const _0x3ba9e3=await withSpinner(_0x4693f2(0x7d),()=>_0x4300a7[_0x4693f2(0x9a)][_0x4693f2(0xb4)](_0x6c9bca),{'verbose':_0x41df76[_0x4693f2(0x75)]}),_0x3be2e1=_0x3ba9e3[_0x4693f2(0xa0)];let _0xf8bbab;if(_0x3be2e1['start_at']&&_0x3be2e1[_0x4693f2(0x79)]){const _0x50b007=new Date(_0x3be2e1[_0x4693f2(0x78)])[_0x4693f2(0x95)](),_0x18b653=new Date(_0x3be2e1[_0x4693f2(0x79)])[_0x4693f2(0x95)]();_0xf8bbab=Math[_0x4693f2(0x83)]((_0x18b653-_0x50b007)/0x3e8);}const _0x49238e={'job_id':_0x3be2e1[_0x4693f2(0x92)],'type':_0x3be2e1['type'],'status':_0x3be2e1['status'],..._0x3be2e1[_0x4693f2(0xbc)]&&{'user_name':_0x3be2e1[_0x4693f2(0xbc)]},..._0xf8bbab!==undefined&&{'duration_sec':_0xf8bbab},..._0x3be2e1[_0x4693f2(0x94)]&&{'created_at':_0x3be2e1['created_at']},..._0x3be2e1['start_at']&&{'started_at':_0x3be2e1[_0x4693f2(0x78)]},..._0x3be2e1[_0x4693f2(0x79)]&&{'end_at':_0x3be2e1['end_at']},..._0x3be2e1[_0x4693f2(0xb3)]&&{'database':_0x3be2e1[_0x4693f2(0xb3)]},..._0x3be2e1['priority']!==undefined&&{'priority':_0x3be2e1[_0x4693f2(0x70)]},..._0x3be2e1['url']&&{'url':_0x3be2e1[_0x4693f2(0xa8)]},..._0x3be2e1[_0x4693f2(0x85)]&&{'query':_0x3be2e1[_0x4693f2(0x85)]},..._0x3be2e1[_0x4693f2(0x8f)]&&{'debug':_0x3be2e1[_0x4693f2(0x8f)]}};return await handleSingleObjectOutput(_0x49238e,_0x41df76),0x0;}catch(_0x54956d){if(_0x54956d instanceof SDKError)return console[_0x4693f2(0xac)](_0x4693f2(0xba)+_0x54956d[_0x4693f2(0x73)]),_0x54956d['cause']&&console[_0x4693f2(0xac)](_0x4693f2(0x9e)+_0x54956d[_0x4693f2(0x87)]),0x1;throw _0x54956d;}}}export class JobKillCommand extends BaseCommand{['name']=a24_0x10b94f(0xa6);['description']=a24_0x10b94f(0xbd);async['execute'](_0x37227d){const _0x52aa35=a24_0x10b94f,{options:_0x21ac37,args:_0x579407,tdx:_0x157ea1}=_0x37227d,_0x589815=_0x579407[0x0];if(!_0x589815)return console[_0x52aa35(0xac)](_0x52aa35(0x96)),console[_0x52aa35(0xac)](_0x52aa35(0xb2)),0x1;try{if(!_0x21ac37[_0x52aa35(0x8e)]){const _0x5b29c8=await confirm(_0x52aa35(0x91)+_0x589815+'?');if(!_0x5b29c8)return console['error'](_0x52aa35(0xa4)),0x0;}return await withSpinner('Submitting\x20kill\x20request...',()=>_0x157ea1[_0x52aa35(0x9a)][_0x52aa35(0x7f)](_0x589815),{'verbose':_0x21ac37[_0x52aa35(0x75)]}),console[_0x52aa35(0xac)](_0x52aa35(0x97)+_0x589815),console[_0x52aa35(0xac)](_0x52aa35(0xbb)+_0x589815+_0x52aa35(0xb0)),0x0;}catch(_0x3bc4b7){if(_0x3bc4b7 instanceof SDKError)return console[_0x52aa35(0xac)]('Error:\x20'+_0x3bc4b7[_0x52aa35(0x73)]),_0x3bc4b7[_0x52aa35(0x87)]&&console[_0x52aa35(0xac)](_0x52aa35(0x9e)+_0x3bc4b7[_0x52aa35(0x87)]),0x1;throw _0x3bc4b7;}}}export class JobSubmitCommand extends BaseCommand{[a24_0x10b94f(0x98)]=a24_0x10b94f(0xb9);['description']=a24_0x10b94f(0xa7);async['execute'](_0xc41ce5){const _0x43ca0d=a24_0x10b94f,{options:_0x5d04f8,args:_0x78b68c,tdx:_0x4d288e}=_0xc41ce5;try{const _0x2bd7fc=_0x5d04f8[_0x43ca0d(0xaa)]||'trino',_0x2b0717=_0x5d04f8[_0x43ca0d(0xb7)],_0x17df24=_0x5d04f8['database']||_0x43ca0d(0x88);if(_0x2bd7fc!==_0x43ca0d(0xad)&&_0x2bd7fc!==_0x43ca0d(0xab))return console[_0x43ca0d(0xac)](_0x43ca0d(0x7a)),0x1;let _0x43be03;if(_0x2b0717){if(_0x78b68c[0x0])return console[_0x43ca0d(0xac)](_0x43ca0d(0xa3)),0x1;const _0x13e6d7=readSqlStatementsFromFile(_0x2b0717);if(_0x13e6d7[_0x43ca0d(0xaf)]===0x0)return console[_0x43ca0d(0xac)](_0x43ca0d(0xb1)),0x1;if(_0x13e6d7[_0x43ca0d(0xaf)]>0x1)return console[_0x43ca0d(0xac)](_0x43ca0d(0x81)),0x1;_0x43be03=_0x13e6d7[0x0];}else{if(!_0x78b68c[0x0])return console[_0x43ca0d(0xac)](_0x43ca0d(0x9c)),console[_0x43ca0d(0xac)]('Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>'),0x1;_0x43be03=_0x78b68c[0x0];}_0x5d04f8[_0x43ca0d(0x75)]&&(console[_0x43ca0d(0xac)]('Job\x20type:\x20'+_0x2bd7fc),console['error'](_0x43ca0d(0x90)+_0x17df24),console[_0x43ca0d(0xac)](_0x43ca0d(0x8d)+_0x43be03[_0x43ca0d(0xae)](0x0,0x64)+(_0x43be03[_0x43ca0d(0xaf)]>0x64?_0x43ca0d(0x99):'')));const _0x2d505c=await withSpinner('Submitting\x20job...',()=>_0x4d288e[_0x43ca0d(0x9a)]['submit'](_0x17df24,_0x43be03,_0x2bd7fc),{'verbose':_0x5d04f8[_0x43ca0d(0x75)]}),_0x3e8fd0=_0x2d505c[_0x43ca0d(0xa0)];return console[_0x43ca0d(0xac)](_0x43ca0d(0x76)),console['error'](_0x43ca0d(0x86)+_0x3e8fd0[_0x43ca0d(0x92)]),await handleSDKOutput([_0x3e8fd0],_0x5d04f8),0x0;}catch(_0x41b621){if(_0x41b621 instanceof SDKError)return console[_0x43ca0d(0xac)]('Error:\x20'+_0x41b621[_0x43ca0d(0x73)]),_0x41b621['cause']&&console['error'](_0x43ca0d(0x9e)+_0x41b621[_0x43ca0d(0x87)]),0x1;throw _0x41b621;}}}export class JobResultCommand extends BaseCommand{[a24_0x10b94f(0x98)]=a24_0x10b94f(0x72);['description']='Get\x20job\x20results';async['execute'](_0x359ed8){const _0x18f29a=a24_0x10b94f,{options:_0x37e964,args:_0x3d3252,tdx:_0x1a2cde}=_0x359ed8,_0x1f6ca6=_0x3d3252[0x0];if(!_0x1f6ca6)return console['error'](_0x18f29a(0x96)),console[_0x18f29a(0xac)]('Usage:\x20job\x20result\x20<job-id>'),0x1;try{const _0xf849ca=await withSpinner(_0x18f29a(0x82),()=>_0x1a2cde[_0x18f29a(0x9a)][_0x18f29a(0x9b)](_0x1f6ca6),{'verbose':_0x37e964[_0x18f29a(0x75)]}),_0x25262e=_0xf849ca['data'];return console[_0x18f29a(0xac)](_0x18f29a(0x77)+_0x25262e[_0x18f29a(0xaf)]+'\x20row'+(_0x25262e['length']!==0x1?'s':'')),await handleSDKOutput(_0x25262e,_0x37e964),0x0;}catch(_0x5d0ee0){if(_0x5d0ee0 instanceof SDKError)return console[_0x18f29a(0xac)](_0x18f29a(0xba)+_0x5d0ee0[_0x18f29a(0x73)]),_0x5d0ee0[_0x18f29a(0x87)]&&console[_0x18f29a(0xac)](_0x18f29a(0x9e)+_0x5d0ee0[_0x18f29a(0x87)]),0x1;throw _0x5d0ee0;}}}
|
|
1
|
+
function a24_0x21db(_0x5b01f2,_0x179a14){_0x5b01f2=_0x5b01f2-0x189;const _0x13b6b5=a24_0x13b6();let _0x21dbda=_0x13b6b5[_0x5b01f2];return _0x21dbda;}const a24_0x23bd53=a24_0x21db;(function(_0x9a1eb,_0x3b3e92){const _0x882f99=a24_0x21db,_0x2621f8=_0x9a1eb();while(!![]){try{const _0x1a1622=parseInt(_0x882f99(0x1cd))/0x1+-parseInt(_0x882f99(0x194))/0x2+parseInt(_0x882f99(0x19b))/0x3+parseInt(_0x882f99(0x1c7))/0x4*(parseInt(_0x882f99(0x1aa))/0x5)+-parseInt(_0x882f99(0x1b4))/0x6*(parseInt(_0x882f99(0x18a))/0x7)+-parseInt(_0x882f99(0x1ac))/0x8+-parseInt(_0x882f99(0x1b3))/0x9*(parseInt(_0x882f99(0x1cb))/0xa);if(_0x1a1622===_0x3b3e92)break;else _0x2621f8['push'](_0x2621f8['shift']());}catch(_0x29dacf){_0x2621f8['push'](_0x2621f8['shift']());}}}(a24_0x13b6,0x93189));function a24_0x13b6(){const _0x24146d=['\x20row','55512hRwlnt','6mjGulg','Error:\x20Multiple\x20SQL\x20statements\x20found\x20in\x20file.\x20Only\x20one\x20statement\x20is\x20allowed\x20for\x20job\x20submission.','job:submit','Are\x20you\x20sure\x20you\x20want\x20to\x20kill\x20job\x20','Cancelled','cause','hive','query','Error:\x20Job\x20ID\x20is\x20required','Error:\x20Query\x20is\x20required','jobType','\x20\x20Note:\x20Use\x20\x27tdx\x20job\x20show\x20','status','Database:\x20','round','Submit\x20a\x20job','\x20\x20Cause:\x20','yes','β\x20Found\x20','28312ArEJCf','Kill\x20a\x20job','Submitting\x20kill\x20request...','database','260jRgOaA','Error:\x20No\x20SQL\x20statements\x20found\x20in\x20file','956039DwJRKK','getTime','url','job:kill','created_at','length','\x20jobs','error','Query:\x20','debug','76027rNLhqT','file','kill','end_at','map','Get\x20job\x20results','Error:\x20','result','Getting\x20job\x20results...','job_id','442842iWoKsS','verbose','Submitting\x20job...','β\x20Job\x20submitted','trino','start_at','execute','2594685gkNURB','Usage:\x20job\x20show\x20<job-id>','user_name','type','data','Error:\x20--job-type\x20must\x20be\x20either\x20\x22trino\x22\x20or\x20\x22hive\x22','Limit:\x20','...','limit','Status\x20filter:\x20','description','priority','list','β\x20Kill\x20request\x20submitted\x20for\x20job\x20','jobs','145xyRiaI','name','8248328WfXpSK','Job\x20type:\x20','message','\x27\x20to\x20verify\x20the\x20job\x20status','Listing\x20jobs...','\x20\x20Job\x20ID:\x20'];a24_0x13b6=function(){return _0x24146d;};return a24_0x13b6();}import{BaseCommand}from'./command.js';import{SDKError}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{readSqlStatementsFromFile}from'../utils/sql-parser.js';import{confirm}from'../utils/prompt.js';import{DEFAULT_DISPLAY_LIMIT,resolveLimit}from'../utils/constants.js';export class JobListCommand extends BaseCommand{[a24_0x23bd53(0x1ab)]=a24_0x23bd53(0x1a9);[a24_0x23bd53(0x1a5)]='List\x20jobs';async[a24_0x23bd53(0x19a)](_0x11c25c){const _0x3156f2=a24_0x23bd53,{options:_0x2e59e3,tdx:_0x339a13}=_0x11c25c;try{const _0x2eeae1=resolveLimit(_0x2e59e3[_0x3156f2(0x1a3)],DEFAULT_DISPLAY_LIMIT),_0x6ec49e=_0x2e59e3['status'];_0x2e59e3[_0x3156f2(0x195)]&&(console[_0x3156f2(0x1d4)](_0x3156f2(0x1a1)+_0x2eeae1+_0x3156f2(0x1d3)),_0x6ec49e&&console['error'](_0x3156f2(0x1a4)+_0x6ec49e));const _0x52803c=await withSpinner(_0x3156f2(0x1b0),()=>_0x339a13[_0x3156f2(0x1a9)][_0x3156f2(0x1a7)]({'from':0x0,'to':_0x2eeae1-0x1,'status':_0x6ec49e}),{'verbose':_0x2e59e3[_0x3156f2(0x195)]}),_0x35c43a=_0x52803c[_0x3156f2(0x19f)];console[_0x3156f2(0x1d4)](_0x3156f2(0x1c6)+_0x35c43a['length']+'\x20job'+(_0x35c43a[_0x3156f2(0x1d2)]!==0x1?'s':''));const _0x1c6f9c=_0x35c43a[_0x3156f2(0x18e)](_0x54715d=>{const _0x37c351=_0x3156f2;let _0x90bb10;if(_0x54715d[_0x37c351(0x199)]&&_0x54715d[_0x37c351(0x18d)]){const _0x56d416=new Date(_0x54715d[_0x37c351(0x199)])[_0x37c351(0x1ce)](),_0x413bc2=new Date(_0x54715d[_0x37c351(0x18d)])['getTime']();_0x90bb10=Math['round']((_0x413bc2-_0x56d416)/0x3e8);}return{'job_id':_0x54715d[_0x37c351(0x193)],'type':_0x54715d['type'],'status':_0x54715d['status'],'user_name':_0x54715d[_0x37c351(0x19d)],'duration_sec':_0x90bb10,'created_at':_0x54715d[_0x37c351(0x1d1)],'started_at':_0x54715d[_0x37c351(0x199)],'end_at':_0x54715d[_0x37c351(0x18d)]};});return await handleSDKOutput(_0x1c6f9c,_0x2e59e3),0x0;}catch(_0x311daa){if(_0x311daa instanceof SDKError)return console[_0x3156f2(0x1d4)](_0x3156f2(0x190)+_0x311daa[_0x3156f2(0x1ae)]),_0x311daa[_0x3156f2(0x1b9)]&&console[_0x3156f2(0x1d4)](_0x3156f2(0x1c4)+_0x311daa[_0x3156f2(0x1b9)]),0x1;throw _0x311daa;}}}export class JobShowCommand extends BaseCommand{[a24_0x23bd53(0x1ab)]='job:show';[a24_0x23bd53(0x1a5)]='Show\x20job\x20details';async['execute'](_0x3cee69){const _0x5362a4=a24_0x23bd53,{options:_0x13bd74,args:_0x1ef47e,tdx:_0x4934ab}=_0x3cee69,_0x19dd33=_0x1ef47e[0x0];if(!_0x19dd33)return console[_0x5362a4(0x1d4)](_0x5362a4(0x1bc)),console['error'](_0x5362a4(0x19c)),0x1;try{const _0x2a0c8f=await withSpinner('Getting\x20job\x20details...',()=>_0x4934ab['jobs']['show'](_0x19dd33),{'verbose':_0x13bd74[_0x5362a4(0x195)]}),_0xc961c3=_0x2a0c8f[_0x5362a4(0x19f)];let _0x392552;if(_0xc961c3[_0x5362a4(0x199)]&&_0xc961c3[_0x5362a4(0x18d)]){const _0x59c918=new Date(_0xc961c3[_0x5362a4(0x199)])['getTime'](),_0x4964d3=new Date(_0xc961c3[_0x5362a4(0x18d)])[_0x5362a4(0x1ce)]();_0x392552=Math[_0x5362a4(0x1c2)]((_0x4964d3-_0x59c918)/0x3e8);}const _0x387411={'job_id':_0xc961c3[_0x5362a4(0x193)],'type':_0xc961c3[_0x5362a4(0x19e)],'status':_0xc961c3[_0x5362a4(0x1c0)],..._0xc961c3[_0x5362a4(0x19d)]&&{'user_name':_0xc961c3[_0x5362a4(0x19d)]},..._0x392552!==undefined&&{'duration_sec':_0x392552},..._0xc961c3[_0x5362a4(0x1d1)]&&{'created_at':_0xc961c3[_0x5362a4(0x1d1)]},..._0xc961c3[_0x5362a4(0x199)]&&{'started_at':_0xc961c3[_0x5362a4(0x199)]},..._0xc961c3[_0x5362a4(0x18d)]&&{'end_at':_0xc961c3['end_at']},..._0xc961c3[_0x5362a4(0x1ca)]&&{'database':_0xc961c3[_0x5362a4(0x1ca)]},..._0xc961c3[_0x5362a4(0x1a6)]!==undefined&&{'priority':_0xc961c3[_0x5362a4(0x1a6)]},..._0xc961c3[_0x5362a4(0x1cf)]&&{'url':_0xc961c3[_0x5362a4(0x1cf)]},..._0xc961c3[_0x5362a4(0x1bb)]&&{'query':_0xc961c3[_0x5362a4(0x1bb)]},..._0xc961c3[_0x5362a4(0x189)]&&{'debug':_0xc961c3[_0x5362a4(0x189)]}};return await handleSingleObjectOutput(_0x387411,_0x13bd74),0x0;}catch(_0x583ccb){if(_0x583ccb instanceof SDKError)return console[_0x5362a4(0x1d4)]('Error:\x20'+_0x583ccb[_0x5362a4(0x1ae)]),_0x583ccb['cause']&&console['error'](_0x5362a4(0x1c4)+_0x583ccb[_0x5362a4(0x1b9)]),0x1;throw _0x583ccb;}}}export class JobKillCommand extends BaseCommand{[a24_0x23bd53(0x1ab)]=a24_0x23bd53(0x1d0);['description']=a24_0x23bd53(0x1c8);async[a24_0x23bd53(0x19a)](_0x1ce50a){const _0x59344f=a24_0x23bd53,{options:_0x2f3a0c,args:_0x11694a,tdx:_0x377919}=_0x1ce50a,_0x5c7b10=_0x11694a[0x0];if(!_0x5c7b10)return console[_0x59344f(0x1d4)]('Error:\x20Job\x20ID\x20is\x20required'),console[_0x59344f(0x1d4)]('Usage:\x20job\x20kill\x20<job-id>'),0x1;try{if(!_0x2f3a0c[_0x59344f(0x1c5)]){const _0x29b37c=await confirm(_0x59344f(0x1b7)+_0x5c7b10+'?');if(!_0x29b37c)return console[_0x59344f(0x1d4)](_0x59344f(0x1b8)),0x0;}return await withSpinner(_0x59344f(0x1c9),()=>_0x377919['jobs'][_0x59344f(0x18c)](_0x5c7b10),{'verbose':_0x2f3a0c[_0x59344f(0x195)]}),console['error'](_0x59344f(0x1a8)+_0x5c7b10),console[_0x59344f(0x1d4)](_0x59344f(0x1bf)+_0x5c7b10+_0x59344f(0x1af)),0x0;}catch(_0x168a48){if(_0x168a48 instanceof SDKError)return console[_0x59344f(0x1d4)]('Error:\x20'+_0x168a48[_0x59344f(0x1ae)]),_0x168a48[_0x59344f(0x1b9)]&&console[_0x59344f(0x1d4)]('\x20\x20Cause:\x20'+_0x168a48['cause']),0x1;throw _0x168a48;}}}export class JobSubmitCommand extends BaseCommand{['name']=a24_0x23bd53(0x1b6);[a24_0x23bd53(0x1a5)]=a24_0x23bd53(0x1c3);async[a24_0x23bd53(0x19a)](_0x538365){const _0x3dce40=a24_0x23bd53,{options:_0x3a707d,args:_0x20a131,tdx:_0xcc9578}=_0x538365;try{const _0x364af5=_0x3a707d[_0x3dce40(0x1be)]||_0x3dce40(0x198),_0x17ead8=_0x3a707d[_0x3dce40(0x18b)],_0x10457e=_0x3a707d['database']||'information_schema';if(_0x364af5!=='trino'&&_0x364af5!==_0x3dce40(0x1ba))return console[_0x3dce40(0x1d4)](_0x3dce40(0x1a0)),0x1;let _0x4dbf3a;if(_0x17ead8){if(_0x20a131[0x0])return console[_0x3dce40(0x1d4)]('Error:\x20Cannot\x20specify\x20both\x20query\x20argument\x20and\x20--file\x20option'),0x1;const _0x52ae4a=readSqlStatementsFromFile(_0x17ead8);if(_0x52ae4a[_0x3dce40(0x1d2)]===0x0)return console['error'](_0x3dce40(0x1cc)),0x1;if(_0x52ae4a[_0x3dce40(0x1d2)]>0x1)return console[_0x3dce40(0x1d4)](_0x3dce40(0x1b5)),0x1;_0x4dbf3a=_0x52ae4a[0x0];}else{if(!_0x20a131[0x0])return console[_0x3dce40(0x1d4)](_0x3dce40(0x1bd)),console['error']('Usage:\x20job\x20submit\x20<query>\x20or\x20job\x20submit\x20--file\x20<path>'),0x1;_0x4dbf3a=_0x20a131[0x0];}_0x3a707d[_0x3dce40(0x195)]&&(console[_0x3dce40(0x1d4)](_0x3dce40(0x1ad)+_0x364af5),console['error'](_0x3dce40(0x1c1)+_0x10457e),console[_0x3dce40(0x1d4)](_0x3dce40(0x1d5)+_0x4dbf3a['substring'](0x0,0x64)+(_0x4dbf3a[_0x3dce40(0x1d2)]>0x64?_0x3dce40(0x1a2):'')));const _0x25e43b=await withSpinner(_0x3dce40(0x196),()=>_0xcc9578['jobs']['submit'](_0x10457e,_0x4dbf3a,_0x364af5),{'verbose':_0x3a707d['verbose']}),_0x530c78=_0x25e43b['data'];return console[_0x3dce40(0x1d4)](_0x3dce40(0x197)),console[_0x3dce40(0x1d4)](_0x3dce40(0x1b1)+_0x530c78['job_id']),await handleSDKOutput([_0x530c78],_0x3a707d),0x0;}catch(_0x29a8d7){if(_0x29a8d7 instanceof SDKError)return console[_0x3dce40(0x1d4)](_0x3dce40(0x190)+_0x29a8d7[_0x3dce40(0x1ae)]),_0x29a8d7[_0x3dce40(0x1b9)]&&console[_0x3dce40(0x1d4)](_0x3dce40(0x1c4)+_0x29a8d7[_0x3dce40(0x1b9)]),0x1;throw _0x29a8d7;}}}export class JobResultCommand extends BaseCommand{[a24_0x23bd53(0x1ab)]='job:result';[a24_0x23bd53(0x1a5)]=a24_0x23bd53(0x18f);async[a24_0x23bd53(0x19a)](_0x2e335e){const _0x366368=a24_0x23bd53,{options:_0x54a84b,args:_0x2e81f7,tdx:_0x33c031}=_0x2e335e,_0x3b3b4f=_0x2e81f7[0x0];if(!_0x3b3b4f)return console['error'](_0x366368(0x1bc)),console['error']('Usage:\x20job\x20result\x20<job-id>'),0x1;try{const _0x356c17=await withSpinner(_0x366368(0x192),()=>_0x33c031[_0x366368(0x1a9)][_0x366368(0x191)](_0x3b3b4f),{'verbose':_0x54a84b[_0x366368(0x195)]}),_0x5275fb=_0x356c17[_0x366368(0x19f)];return console['error']('β\x20Retrieved\x20'+_0x5275fb['length']+_0x366368(0x1b2)+(_0x5275fb[_0x366368(0x1d2)]!==0x1?'s':'')),await handleSDKOutput(_0x5275fb,_0x54a84b),0x0;}catch(_0x3db591){if(_0x3db591 instanceof SDKError)return console['error']('Error:\x20'+_0x3db591[_0x366368(0x1ae)]),_0x3db591['cause']&&console[_0x366368(0x1d4)]('\x20\x20Cause:\x20'+_0x3db591[_0x366368(0x1b9)]),0x1;throw _0x3db591;}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"journey-command.d.ts","sourceRoot":"","sources":["../../src/commands/journey-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"journey-command.d.ts","sourceRoot":"","sources":["../../src/commands/journey-command.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,EAAE,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAmIhE;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,sCAAsC;IAEpD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CA0GxD;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,0BAA0B;IAExC,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAqFxD;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,6BAA6B;IAE3C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAuFxD;AAED;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,WAAW;IAClD,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,WAAW,6BAA6B;IAE3C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAoDxD;AAED;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,WAAW;IACnD,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,WAAW,6BAA6B;IAE3C,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAoDxD;AAED;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,WAAW;IACjD,QAAQ,CAAC,IAAI,kBAAkB;IAC/B,QAAQ,CAAC,WAAW,qCAAqC;IAEnD,OAAO,CAAC,OAAO,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC;CAwTxD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a25_0x29815f=a25_0x5e0b;(function(_0x7c520a,_0x230db0){const _0x32abd5=a25_0x5e0b,_0x39be2e=_0x7c520a();while(!![]){try{const _0x409e49=-parseInt(_0x32abd5(0x71))/0x1+-parseInt(_0x32abd5(0xc3))/0x2*(parseInt(_0x32abd5(0xd8))/0x3)+-parseInt(_0x32abd5(0x7a))/0x4*(parseInt(_0x32abd5(0xc7))/0x5)+-parseInt(_0x32abd5(0xda))/0x6+-parseInt(_0x32abd5(0xf2))/0x7*(-parseInt(_0x32abd5(0xe3))/0x8)+-parseInt(_0x32abd5(0xdb))/0x9+parseInt(_0x32abd5(0x9f))/0xa*(parseInt(_0x32abd5(0x8a))/0xb);if(_0x409e49===_0x230db0)break;else _0x39be2e['push'](_0x39be2e['shift']());}catch(_0x52fbd2){_0x39be2e['push'](_0x39be2e['shift']());}}}(a25_0x513f,0x40f3d));import a25_0x3e565e from'chalk';import a25_0x720d5a from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';function a25_0x5e0b(_0x31301e,_0xd2dc92){_0x31301e=_0x31301e-0x6e;const _0x513f28=a25_0x513f();let _0x5e0b53=_0x513f28[_0x31301e];return _0x5e0b53;}import{confirm,confirmKey}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{apiToYamlAsync,toYamlString}from'../sdk/segment/journey-yaml.js';import{apiRuleToYaml}from'../sdk/segment/child-segment-yaml.js';import{getSegmentRootDir,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';import{sanitizeFileName}from'../utils/string-utils.js';const SEGMENT_KIND_JOURNEY=0x3;function formatJourneyState(_0x400df4){const _0x1d6f5a=a25_0x5e0b;switch(_0x400df4){case _0x1d6f5a(0xfb):return a25_0x3e565e[_0x1d6f5a(0xcb)](_0x400df4);case _0x1d6f5a(0x92):return a25_0x3e565e[_0x1d6f5a(0xa8)](_0x400df4);case'archived':return a25_0x3e565e[_0x1d6f5a(0x9c)](_0x400df4);default:return _0x400df4;}}function formatJourneyItem(_0x65df57,_0x545828=''){const _0x2608b8=a25_0x5e0b,_0x39b35f=formatJourneyState(_0x65df57[_0x2608b8(0xcd)]),_0x1ffed9=_0x65df57['paused']?a25_0x3e565e[_0x2608b8(0xf4)](_0x2608b8(0xc2)):'';return _0x545828+'πΊοΈ\x20'+_0x65df57[_0x2608b8(0x8e)]+'\x20('+_0x39b35f+')'+_0x1ffed9;}function escapeRegex(_0x2a87d5){const _0x495909=a25_0x5e0b;return _0x2a87d5[_0x495909(0x85)](/[.*+?^${}()|[\]\\]/g,_0x495909(0x7c));}function globToRegex(_0x2967ba){const _0x42c2ea=a25_0x5e0b,_0x5a1456=_0x2967ba[_0x42c2ea(0xf6)]('*')[_0x42c2ea(0xf9)](escapeRegex);return new RegExp(_0x5a1456[_0x42c2ea(0x83)]('.*'),'i');}function resolveJourneyTarget(_0x7e189a,_0x25428b,_0xc95f95){const _0x110dd9=a25_0x5e0b;if(isYamlFilePath(_0x7e189a))try{const _0x131d6f=resolveYamlFilePath(_0x7e189a);return _0xc95f95&&(console[_0x110dd9(0xab)](_0x110dd9(0xb7)+_0x7e189a),console[_0x110dd9(0xab)](_0x110dd9(0x100)+_0x131d6f[_0x110dd9(0xc9)]),console[_0x110dd9(0xab)](_0x110dd9(0x7b)+_0x131d6f[_0x110dd9(0xc6)]),console['error'](_0x110dd9(0xe6)+(_0x131d6f['folderPath']||_0x110dd9(0xee)))),{'journeyName':_0x131d6f[_0x110dd9(0xc6)],'parentSegment':_0x131d6f['parentSegment'],'resolved':_0x131d6f};}catch(_0x10a1ce){throw new SDKError(ErrorCode[_0x110dd9(0xb3)],_0x110dd9(0xa3)+_0x10a1ce[_0x110dd9(0xc8)]);}if(!_0x25428b)throw new SDKError(ErrorCode[_0x110dd9(0xb3)],_0x110dd9(0xc5));return{'journeyName':_0x7e189a,'parentSegment':_0x25428b};}export class JourneyListCommand extends BaseCommand{['name']=a25_0x29815f(0xff);[a25_0x29815f(0x76)]=a25_0x29815f(0xec);async[a25_0x29815f(0xd4)](_0x545d5a){const _0x4728cf=a25_0x29815f,{options:_0x34a621,args:_0x4aa698,tdx:_0xf703ec}=_0x545d5a,_0x12b0c6=_0x4aa698[0x0],_0x473333=_0x34a621['parentSegment'];if(!_0x473333)return console[_0x4728cf(0xab)](_0x4728cf(0x103)),console['error']('Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22'),0x1;const _0x2e82af=await withSpinner(_0x4728cf(0x7f),()=>_0xf703ec[_0x4728cf(0x72)][_0x4728cf(0x8b)](_0x473333),{'verbose':_0x34a621['verbose']}),_0x15ca74=_0x2e82af[_0x4728cf(0xe7)];_0x34a621['verbose']&&(console[_0x4728cf(0xab)](_0x4728cf(0x8c)+_0x473333+_0x4728cf(0xb6)+_0x15ca74+')'),_0x12b0c6&&console[_0x4728cf(0xab)]('Pattern:\x20'+_0x12b0c6));const [_0x1bcb48,_0x597764,_0x96cff0]=await Promise['all']([withSpinner('Fetching\x20parent\x20segment...',()=>_0xf703ec[_0x4728cf(0x72)]['getParentFull'](_0x15ca74),{'verbose':_0x34a621['verbose']}),withSpinner(_0x4728cf(0xd9),()=>_0xf703ec['segment']['listFolders'](_0x15ca74),{'verbose':_0x34a621[_0x4728cf(0x95)]}),withSpinner(_0x4728cf(0xfa),()=>_0xf703ec[_0x4728cf(0x73)][_0x4728cf(0xd7)](_0x15ca74),{'verbose':_0x34a621[_0x4728cf(0x95)]})]),_0x3aa19e=_0x1bcb48[_0x4728cf(0xe7)],_0x473643=_0x597764['data'];let _0x22f777=_0x96cff0['data'];const _0x4bb5e1=_0x3aa19e[_0x4728cf(0x89)],_0x2a6e04=new Map();for(const _0x49d0e3 of _0x473643){_0x2a6e04[_0x4728cf(0xac)](_0x49d0e3['id'],_0x49d0e3[_0x4728cf(0xba)]);}if(_0x12b0c6){const _0x2b77e6=globToRegex(_0x12b0c6);_0x22f777=_0x22f777['filter'](_0x3c24b5=>_0x2b77e6['test'](_0x3c24b5[_0x4728cf(0x8e)]));}console['error']('β\x20Found\x20'+_0x22f777['length']+'\x20journey'+(_0x22f777[_0x4728cf(0xbb)]!==0x1?'s':''));if(_0x34a621['format']===_0x4728cf(0xe9))await handleSDKOutput(_0x22f777,_0x34a621);else{if(_0x34a621['format']===_0x4728cf(0x84))await handleSDKOutput(_0x22f777,_0x34a621);else{console[_0x4728cf(0x88)]('['+_0x473333+']');const _0x1f550c=new Map(),_0x4f3fd8=[];for(const _0x4dcb88 of _0x22f777){if(!_0x4dcb88['folderId']||_0x4dcb88['folderId']===_0x4bb5e1)_0x4f3fd8['push'](_0x4dcb88);else{const _0xd7ccf6=_0x1f550c[_0x4728cf(0xce)](_0x4dcb88[_0x4728cf(0xfe)])||[];_0xd7ccf6['push'](_0x4dcb88),_0x1f550c[_0x4728cf(0xac)](_0x4dcb88[_0x4728cf(0xfe)],_0xd7ccf6);}}for(const _0x484eff of _0x4f3fd8){console[_0x4728cf(0x88)](formatJourneyItem(_0x484eff));}for(const [_0x471bfb,_0x218851]of _0x1f550c){const _0x1ba974=_0x2a6e04[_0x4728cf(0xce)](_0x471bfb)||_0x471bfb;console[_0x4728cf(0x88)](_0x4728cf(0xc4)+_0x1ba974);for(const _0x1e8385 of _0x218851){console['log'](formatJourneyItem(_0x1e8385,'\x20\x20'));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{[a25_0x29815f(0xba)]='journey:view';[a25_0x29815f(0x76)]=a25_0x29815f(0xbf);async['execute'](_0x206488){const _0x2517d6=a25_0x29815f,{options:_0x29ee3b,args:_0x21b823,tdx:_0x8db2e0}=_0x206488,_0x2953ad=_0x21b823[0x0];if(!_0x2953ad)return console[_0x2517d6(0xab)](_0x2517d6(0x97)),console[_0x2517d6(0xab)](_0x2517d6(0xa7)),0x1;_0x29ee3b[_0x2517d6(0x95)]&&console[_0x2517d6(0xab)](_0x2517d6(0x6e)+_0x2953ad);const _0x2790ee=resolveJourneyTarget(_0x2953ad,_0x29ee3b[_0x2517d6(0xc9)],_0x29ee3b[_0x2517d6(0x95)]),_0x293fca=await withSpinner(_0x2517d6(0x7f),()=>_0x8db2e0[_0x2517d6(0x72)][_0x2517d6(0x8b)](_0x2790ee[_0x2517d6(0xc9)]),{'verbose':_0x29ee3b[_0x2517d6(0x95)]}),_0x20e1e7=_0x293fca['data'],_0x409907=await withSpinner(_0x2517d6(0xfc),()=>_0x8db2e0[_0x2517d6(0x73)][_0x2517d6(0xaf)](_0x20e1e7,_0x2790ee[_0x2517d6(0x82)]),{'verbose':_0x29ee3b[_0x2517d6(0x95)]}),_0x1b083f=_0x409907[_0x2517d6(0xe7)],_0x35b506=await withSpinner(_0x2517d6(0xa6),()=>_0x8db2e0[_0x2517d6(0x73)]['getJourney'](_0x1b083f),{'verbose':_0x29ee3b[_0x2517d6(0x95)]}),_0x307dd3=_0x35b506[_0x2517d6(0xe7)],_0x5a5979=_0x29ee3b['includeStats'];let _0x4d0654;if(_0x5a5979)try{const _0x2cab2a=await withSpinner(_0x2517d6(0x93),()=>_0x8db2e0['journey'][_0x2517d6(0xb2)](_0x1b083f),{'verbose':_0x29ee3b[_0x2517d6(0x95)]});_0x4d0654=_0x2cab2a['data'];}catch{_0x29ee3b[_0x2517d6(0x95)]&&console[_0x2517d6(0xab)](_0x2517d6(0xd0));}const _0xb94414={'id':_0x307dd3['id'],'name':_0x307dd3[_0x2517d6(0x81)]['name'],'description':_0x307dd3[_0x2517d6(0x81)][_0x2517d6(0x76)],'state':_0x307dd3[_0x2517d6(0x81)][_0x2517d6(0xcd)],'paused':_0x307dd3[_0x2517d6(0x81)]['paused'],'reentry_mode':_0x307dd3[_0x2517d6(0x81)]['reentryMode'],'stages':_0x307dd3[_0x2517d6(0x81)][_0x2517d6(0xa9)]?.[_0x2517d6(0xbb)]||0x0,..._0x307dd3[_0x2517d6(0x81)]['goal']&&{'goal':_0x307dd3['attributes'][_0x2517d6(0x9d)]['name']},..._0x4d0654&&{'statistics':{'total_entered':_0x4d0654[_0x2517d6(0x87)],'goal_achieved':_0x4d0654[_0x2517d6(0x8d)],'goal_rate':_0x4d0654['goalRate'],'stages':_0x4d0654[_0x2517d6(0xed)]}}};return await handleSingleObjectOutput(_0xb94414,_0x29ee3b),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']='journey:stats';['description']=a25_0x29815f(0x8f);async[a25_0x29815f(0xd4)](_0x46e484){const _0x115020=a25_0x29815f,{options:_0x2de9df,args:_0xe2842e,tdx:_0x32dce2}=_0x46e484,_0xdfc9c5=_0xe2842e[0x0];if(!_0xdfc9c5)return console[_0x115020(0xab)](_0x115020(0x97)),console[_0x115020(0xab)](_0x115020(0xb4)),0x1;_0x2de9df['verbose']&&console[_0x115020(0xab)]('Input:\x20'+_0xdfc9c5);const _0x15be20=resolveJourneyTarget(_0xdfc9c5,_0x2de9df['parentSegment'],_0x2de9df['verbose']),_0x246ae0=await withSpinner(_0x115020(0x7f),()=>_0x32dce2[_0x115020(0x72)]['resolveParentId'](_0x15be20[_0x115020(0xc9)]),{'verbose':_0x2de9df[_0x115020(0x95)]}),_0x52694e=_0x246ae0[_0x115020(0xe7)],_0x4102d1=await withSpinner(_0x115020(0xfc),()=>_0x32dce2[_0x115020(0x73)]['resolveJourneyId'](_0x52694e,_0x15be20[_0x115020(0x82)]),{'verbose':_0x2de9df[_0x115020(0x95)]}),_0x5e9fa4=_0x4102d1[_0x115020(0xe7)],_0x4bc8e1=await withSpinner(_0x115020(0x93),()=>_0x32dce2[_0x115020(0x73)][_0x115020(0xb2)](_0x5e9fa4),{'verbose':_0x2de9df['verbose']}),_0x49a2b2=_0x4bc8e1['data'];if(!_0x49a2b2||_0x49a2b2[_0x115020(0x98)]===null)return console['error'](_0x115020(0xe5)+_0x15be20[_0x115020(0x82)]),console['error']('Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.'),0x0;const _0x7a6652={'journey_id':_0x49a2b2[_0x115020(0x98)],'total_entered':_0x49a2b2[_0x115020(0x87)],'goal_achieved':_0x49a2b2[_0x115020(0x8d)],'goal_rate':_0x49a2b2[_0x115020(0xdc)],'stages':_0x49a2b2[_0x115020(0xed)]?.['map'](_0x5340ba=>({'name':_0x5340ba[_0x115020(0x102)],'population':_0x5340ba[_0x115020(0xe2)],'entered':_0x5340ba[_0x115020(0x99)],'exited':_0x5340ba[_0x115020(0xb1)],'conversion_rate':_0x5340ba[_0x115020(0x7d)]}))},_0x56acd0=_0x2de9df[_0x115020(0xcc)];if(_0x56acd0&&_0x49a2b2[_0x115020(0xed)]){const _0x47f707=_0x49a2b2[_0x115020(0xed)][_0x115020(0x80)](_0x455279=>_0x455279['stageName'][_0x115020(0xbc)]()===_0x56acd0[_0x115020(0xbc)]());if(_0x47f707)return await handleSingleObjectOutput({'stage_name':_0x47f707[_0x115020(0x102)],'population':_0x47f707[_0x115020(0xe2)],'entered':_0x47f707[_0x115020(0x99)],'exited':_0x47f707[_0x115020(0xb1)],'conversion_rate':_0x47f707[_0x115020(0x7d)]},_0x2de9df),0x0;console['error'](_0x115020(0xd2)+_0x56acd0+'\x22\x20not\x20found');}return await handleSingleObjectOutput(_0x7a6652,_0x2de9df),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a25_0x29815f(0xba)]=a25_0x29815f(0xbd);[a25_0x29815f(0x76)]=a25_0x29815f(0xdf);async[a25_0x29815f(0xd4)](_0x22bec4){const _0x3ebfef=a25_0x29815f,{options:_0x326ff6,args:_0xbb1971,tdx:_0x5baf6f}=_0x22bec4,_0x2d9496=_0xbb1971[0x0];if(!_0x2d9496)return console[_0x3ebfef(0xab)](_0x3ebfef(0x97)),console[_0x3ebfef(0xab)](_0x3ebfef(0xe0)),0x1;_0x326ff6[_0x3ebfef(0x95)]&&console[_0x3ebfef(0xab)](_0x3ebfef(0x6e)+_0x2d9496);const _0x3a7ed8=resolveJourneyTarget(_0x2d9496,_0x326ff6[_0x3ebfef(0xc9)],_0x326ff6[_0x3ebfef(0x95)]),_0xb20f35=await withSpinner(_0x3ebfef(0x7f),()=>_0x5baf6f['segment'][_0x3ebfef(0x8b)](_0x3a7ed8[_0x3ebfef(0xc9)]),{'verbose':_0x326ff6['verbose']}),_0x41c0d3=_0xb20f35[_0x3ebfef(0xe7)],_0x1b2ad7=await withSpinner('Resolving\x20journey...',()=>_0x5baf6f[_0x3ebfef(0x73)][_0x3ebfef(0xaf)](_0x41c0d3,_0x3a7ed8['journeyName']),{'verbose':_0x326ff6[_0x3ebfef(0x95)]}),_0x3e143f=_0x1b2ad7[_0x3ebfef(0xe7)];if(!_0x326ff6[_0x3ebfef(0xcf)]){const _0x399f59=await confirm(_0x3ebfef(0x9a)+_0x3a7ed8[_0x3ebfef(0x82)]+'\x22?');if(!_0x399f59)return console[_0x3ebfef(0xab)](_0x3ebfef(0x78)),0x0;}const _0x4403aa=await withSpinner(_0x3ebfef(0x75),()=>_0x5baf6f['journey'][_0x3ebfef(0xf1)](_0x3e143f),{'verbose':_0x326ff6[_0x3ebfef(0x95)]}),_0x4e0718=_0x4403aa['data'];return console['error'](_0x3ebfef(0xf8)+_0x4e0718[_0x3ebfef(0x81)][_0x3ebfef(0xba)]+_0x3ebfef(0xd5)),0x0;}}function a25_0x513f(){const _0x104418=['set','\x22\x20resumed','\x20unchanged\x20files','resolveJourneyId','\x20\x20Target:\x20','exited','getStatistics','INVALID_ARGUMENT','Usage:\x20journey\x20stats\x20<name-or-path>','Found\x20existing\x20tdx.json\x20at:\x20','\x20(ID:\x20','Resolved\x20YAML\x20file:\x20','cyan','journey:resume','name','length','toLowerCase','journey:pause','β\x20Pulled\x20','Show\x20journey\x20details','\x20journey\x20files\x20to\x20','audienceId','\x20(paused)','359702bkbvLg','π\x20','No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22','segmentName','83795DfFBPD','message','parentSegment','isNew','green','stage','state','get','yes','\x20\x20Statistics\x20not\x20available','filter','Warning:\x20Stage\x20\x22','utf-8','execute','\x22\x20paused','\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment','listJourneysFromParentSegment','3bMYstm','Fetching\x20folders...','468192QBAZRK','3169872qOgoio','goalRate','Parent\x20segment\x20context\x20not\x20set.\x0a','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','Pause\x20a\x20running\x20journey','Usage:\x20journey\x20pause\x20<name-or-path>','Usage:\x20journey\x20resume\x20<name-or-path>','population','1903016dcGxLr','Resuming\x20journey...','No\x20statistics\x20available\x20for\x20journey:\x20','\x20\x20Folder\x20path:\x20','data','relativePath','table','\x20changed\x20files','push','List\x20journeys\x20in\x20current\x20context','stages','(root)','β\x20All\x20files\x20are\x20up\x20to\x20date','dryRun','pause','7WwhbTd','Aborted.','yellow','Fetching\x20','split','getJourney','β\x20Journey\x20\x22','map','Listing\x20journeys...','launched','Resolving\x20journey...','Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)','folderId','journey:list','\x20\x20Parent\x20segment:\x20','hasChanges','stageName','Error:\x20Parent\x20segment\x20context\x20required','Input:\x20','dirname','\x20journeys','479867vvCDUg','segment','journey','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','Pausing\x20journey...','description','\x0aPull\x20summary:','Cancelled','resume','116NdOXYk','\x20\x20Name:\x20','\x5c$&','conversionRate','rule','Resolving\x20parent\x20segment...','find','attributes','journeyName','join','json','replace','relative','totalEntered','log','rootFolderId','1037971QVkWnM','resolveParentId','Parent\x20segment:\x20','totalGoalAchieved','journeyBundleName','Show\x20journey\x20statistics','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','diff','draft','Getting\x20journey\x20statistics...','repeat','verbose','No\x20journeys\x20found','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','journeyId','entered','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','cwd','dim','goal','Resume\x20a\x20paused\x20journey','170MdKhER','kind','Warning:\x20Could\x20not\x20resolve\x20segment\x20','Error:\x20Journey\x20not\x20found:\x20','Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20','Write\x20','\x20new\x20files','Getting\x20journey\x20details...','Usage:\x20journey\x20view\x20<name-or-path>','gray','journeyStages','content','error'];a25_0x513f=function(){return _0x104418;};return a25_0x513f();}export class JourneyResumeCommand extends BaseCommand{['name']=a25_0x29815f(0xb9);[a25_0x29815f(0x76)]=a25_0x29815f(0x9e);async['execute'](_0x28278d){const _0x170fa8=a25_0x29815f,{options:_0x108338,args:_0xda7ebd,tdx:_0x4a5540}=_0x28278d,_0x1578ef=_0xda7ebd[0x0];if(!_0x1578ef)return console[_0x170fa8(0xab)](_0x170fa8(0x97)),console['error'](_0x170fa8(0xe1)),0x1;_0x108338[_0x170fa8(0x95)]&&console[_0x170fa8(0xab)]('Input:\x20'+_0x1578ef);const _0x256d09=resolveJourneyTarget(_0x1578ef,_0x108338[_0x170fa8(0xc9)],_0x108338[_0x170fa8(0x95)]),_0x5e87b9=await withSpinner(_0x170fa8(0x7f),()=>_0x4a5540[_0x170fa8(0x72)][_0x170fa8(0x8b)](_0x256d09['parentSegment']),{'verbose':_0x108338['verbose']}),_0x2ff8d2=_0x5e87b9['data'],_0x115fd1=await withSpinner(_0x170fa8(0xfc),()=>_0x4a5540[_0x170fa8(0x73)][_0x170fa8(0xaf)](_0x2ff8d2,_0x256d09[_0x170fa8(0x82)]),{'verbose':_0x108338[_0x170fa8(0x95)]}),_0x21671a=_0x115fd1[_0x170fa8(0xe7)];if(!_0x108338['yes']){const _0x56592b=await confirm(_0x170fa8(0x90)+_0x256d09[_0x170fa8(0x82)]+'\x22?');if(!_0x56592b)return console[_0x170fa8(0xab)](_0x170fa8(0x78)),0x0;}const _0x2d148e=await withSpinner(_0x170fa8(0xe4),()=>_0x4a5540[_0x170fa8(0x73)][_0x170fa8(0x79)](_0x21671a),{'verbose':_0x108338['verbose']}),_0x4d4b6b=_0x2d148e['data'];return console[_0x170fa8(0xab)]('β\x20Journey\x20\x22'+_0x4d4b6b[_0x170fa8(0x81)]['name']+_0x170fa8(0xad)),0x0;}}export class JourneyPullCommand extends BaseCommand{['name']='journey:pull';[a25_0x29815f(0x76)]='Export\x20journey(s)\x20as\x20YAML\x20files';async[a25_0x29815f(0xd4)](_0x564f36){const _0x147d50=a25_0x29815f,{options:_0x578e90,args:_0x2e25ce,tdx:_0x47a6b0}=_0x564f36,_0xf9d98c=_0x578e90,_0x59741e=_0x2e25ce[0x0],_0xe908a0=findTdxConfigPath();let _0x3af4d8,_0x3241bc;if(_0xe908a0){const _0x127dfb=loadTdxConfig(_0xe908a0);_0x3af4d8=_0x127dfb['parent_segment'],_0x3241bc=a25_0x720d5a[_0x147d50(0x83)](a25_0x720d5a[_0x147d50(0x6f)](_0xe908a0),'journeys'),_0xf9d98c[_0x147d50(0x95)]&&(console['error'](_0x147d50(0xb5)+_0xe908a0),console[_0x147d50(0xab)]('Using\x20parent\x20segment:\x20'+_0x3af4d8));}else{_0x3af4d8=_0x578e90[_0x147d50(0xc9)];if(!_0x3af4d8)return console['error'](a25_0x3e565e[_0x147d50(0xf4)](_0x147d50(0xdd))),console['error'](_0x147d50(0xfd)),console[_0x147d50(0xab)](_0x147d50(0xd6)),console[_0x147d50(0xab)]('\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure'),0x1;_0x3241bc=a25_0x720d5a[_0x147d50(0x83)](getSegmentRootDir(sanitizeFileName(_0x3af4d8)),'journeys');}const _0x3819f0=await withSpinner(_0x147d50(0x7f),()=>_0x47a6b0[_0x147d50(0x72)]['resolveParentId'](_0x3af4d8),{'verbose':_0x578e90[_0x147d50(0x95)]}),_0x5a7b0e=_0x3819f0[_0x147d50(0xe7)],_0x16d7b9=await withSpinner(_0x147d50(0xfa),()=>_0x47a6b0[_0x147d50(0x73)][_0x147d50(0xd7)](_0x5a7b0e),{'verbose':_0x578e90[_0x147d50(0x95)]});let _0xd5f211=_0x16d7b9[_0x147d50(0xe7)];if(_0x59741e){const _0x551e52=_0xd5f211[_0x147d50(0xd1)](_0x4f9617=>_0x4f9617[_0x147d50(0x8e)]['toLowerCase']()===_0x59741e['toLowerCase']());if(_0x551e52[_0x147d50(0xbb)]===0x0)return console[_0x147d50(0xab)](_0x147d50(0xa2)+_0x59741e),console[_0x147d50(0xab)](_0x147d50(0x74)),0x1;_0xd5f211=_0x551e52;}if(_0xd5f211['length']===0x0)return console[_0x147d50(0xab)](_0x147d50(0x96)),0x0;const _0x6de1fe=[];for(const _0xd2186f of _0xd5f211){const _0x17cd12=await withSpinner(_0x147d50(0xf5)+_0xd2186f[_0x147d50(0x8e)]+'...',()=>_0x47a6b0['journey'][_0x147d50(0xf7)](_0xd2186f['id']),{'verbose':_0x578e90[_0x147d50(0x95)]}),_0x31c7f0=_0x17cd12[_0x147d50(0xe7)],_0x33dae4=_0x31c7f0[_0x147d50(0x81)]?.[_0x147d50(0xc1)],_0xc107f8={'resolveSegment':async _0x191c31=>{const _0x107308=_0x147d50;if(!_0x33dae4)return{'name':_0x191c31,'isJourneyLocal':![]};try{const _0x40d7b1=await _0x47a6b0['segment']['getSegment'](_0x33dae4,_0x191c31),_0x121ed2=_0x40d7b1[_0x107308(0xa0)]===SEGMENT_KIND_JOURNEY;let _0x1889a8;return _0x121ed2&&_0x40d7b1[_0x107308(0x7e)]&&(_0x1889a8={'description':_0x40d7b1[_0x107308(0x76)],'rule':apiRuleToYaml(_0x40d7b1[_0x107308(0x7e)])}),{'name':_0x40d7b1[_0x107308(0xba)],'isJourneyLocal':_0x121ed2,'definition':_0x1889a8};}catch(_0x5af7d3){return _0x578e90['verbose']&&console[_0x107308(0xab)](_0x107308(0xa1)+_0x191c31+':\x20'+_0x5af7d3[_0x107308(0xc8)]),{'name':_0x191c31,'isJourneyLocal':![]};}}},_0x3fda34=await apiToYamlAsync(_0x31c7f0,_0xc107f8),_0x11cd7e=toYamlString(_0x3fda34),_0x1e08b7=sanitizeFileName(_0xd2186f[_0x147d50(0x8e)]),_0x18eb0b=a25_0x720d5a[_0x147d50(0x83)](_0x3241bc,_0x1e08b7+'.yml'),_0x569ba2=a25_0x720d5a[_0x147d50(0x86)](process[_0x147d50(0x9b)](),_0x18eb0b);if(existsSync(_0x18eb0b)){const _0x24f95f=readFileSync(_0x18eb0b,_0x147d50(0xd3)),_0x119c51=generateDiff(_0x24f95f,_0x11cd7e),_0x1d4b71=hasChanges(_0x119c51);_0x6de1fe[_0x147d50(0xeb)]({'relativePath':_0x569ba2,'absolutePath':_0x18eb0b,'content':_0x11cd7e,'isNew':![],'hasChanges':_0x1d4b71,'diff':_0x1d4b71?formatDiffWithColors(_0x119c51):undefined});}else _0x6de1fe[_0x147d50(0xeb)]({'relativePath':_0x569ba2,'absolutePath':_0x18eb0b,'content':_0x11cd7e,'isNew':!![],'hasChanges':![]});}const _0x441ac9=_0x6de1fe[_0x147d50(0xd1)](_0x46eb6d=>_0x46eb6d['isNew']),_0x27870e=_0x6de1fe[_0x147d50(0xd1)](_0x274ad0=>!_0x274ad0[_0x147d50(0xca)]&&_0x274ad0['hasChanges']),_0x58a42e=_0x6de1fe['filter'](_0x44ef17=>!_0x44ef17['isNew']&&!_0x44ef17['hasChanges']);console['error'](_0x147d50(0x77)),console[_0x147d50(0xab)]('\x20\x20'+a25_0x3e565e[_0x147d50(0xb8)](_0xd5f211['length']+_0x147d50(0x70))),console[_0x147d50(0xab)]('\x20\x20'+a25_0x3e565e['green']('+\x20'+_0x441ac9[_0x147d50(0xbb)]+_0x147d50(0xa5))),console[_0x147d50(0xab)]('\x20\x20'+a25_0x3e565e['yellow']('~\x20'+_0x27870e[_0x147d50(0xbb)]+_0x147d50(0xea))),console[_0x147d50(0xab)]('\x20\x20'+a25_0x3e565e[_0x147d50(0x9c)]('=\x20'+_0x58a42e[_0x147d50(0xbb)]+_0x147d50(0xae))),console['error'](_0x147d50(0xb0)+a25_0x3e565e['cyan'](_0x3241bc)+'\x0a');if(_0x27870e[_0x147d50(0xbb)]>0x0)for(const _0x6056ef of _0x27870e){console[_0x147d50(0xab)]('\x0aChanges\x20to\x20\x27'+_0x6056ef[_0x147d50(0xe8)]+'\x27:'),console['error']('β'[_0x147d50(0x94)](0x3c)),console['error'](_0x6056ef[_0x147d50(0x91)]),console['error']('β'[_0x147d50(0x94)](0x3c));}if(_0xf9d98c[_0x147d50(0xf0)])return console['error'](a25_0x3e565e[_0x147d50(0xf4)](_0x147d50(0xde))),0x0;if(_0x441ac9[_0x147d50(0xbb)]===0x0&&_0x27870e[_0x147d50(0xbb)]===0x0)return console['error'](a25_0x3e565e['green'](_0x147d50(0xef))),0x0;if(!_0xf9d98c['yes']&&(_0x441ac9['length']>0x0||_0x27870e[_0x147d50(0xbb)]>0x0)){const _0x4f895f=await confirmKey(_0x147d50(0xa4)+(_0x441ac9['length']+_0x27870e[_0x147d50(0xbb)])+'\x20files?');if(!_0x4f895f)return console['error'](_0x147d50(0xf3)),0x1;}!existsSync(_0x3241bc)&&mkdirSync(_0x3241bc,{'recursive':!![]});for(const _0x1ee5b7 of _0x6de1fe){(_0x1ee5b7[_0x147d50(0xca)]||_0x1ee5b7[_0x147d50(0x101)])&&writeFileSync(_0x1ee5b7['absolutePath'],_0x1ee5b7[_0x147d50(0xaa)],_0x147d50(0xd3));}return console[_0x147d50(0xab)](a25_0x3e565e[_0x147d50(0xcb)](_0x147d50(0xbe)+(_0x441ac9[_0x147d50(0xbb)]+_0x27870e[_0x147d50(0xbb)])+_0x147d50(0xc0)+_0x3241bc)),0x0;}}
|
|
1
|
+
const a25_0x175ab7=a25_0x10d4;(function(_0x4af31f,_0x53ce1a){const _0xd06bfb=a25_0x10d4,_0x183759=_0x4af31f();while(!![]){try{const _0x2d8993=-parseInt(_0xd06bfb(0x213))/0x1+parseInt(_0xd06bfb(0x1e9))/0x2+parseInt(_0xd06bfb(0x1f5))/0x3+parseInt(_0xd06bfb(0x1c4))/0x4*(-parseInt(_0xd06bfb(0x1f9))/0x5)+parseInt(_0xd06bfb(0x192))/0x6*(parseInt(_0xd06bfb(0x1fd))/0x7)+-parseInt(_0xd06bfb(0x1c3))/0x8*(parseInt(_0xd06bfb(0x1bf))/0x9)+parseInt(_0xd06bfb(0x1d7))/0xa*(parseInt(_0xd06bfb(0x1e3))/0xb);if(_0x2d8993===_0x53ce1a)break;else _0x183759['push'](_0x183759['shift']());}catch(_0x5b12cb){_0x183759['push'](_0x183759['shift']());}}}(a25_0x5800,0x7631d));import a25_0x3058f5 from'chalk';import a25_0x102f81 from'path';import{existsSync,mkdirSync,readFileSync,writeFileSync}from'fs';import{BaseCommand}from'./command.js';import{SDKError,ErrorCode}from'../sdk/index.js';import{handleSDKOutput,handleSingleObjectOutput}from'../utils/command-output.js';import{withSpinner}from'../utils/spinner.js';import{confirm,confirmKey}from'../utils/prompt.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{isYamlFilePath,resolveYamlFilePath}from'../utils/segment-path-parser.js';import{apiToYamlAsync,toYamlString}from'../sdk/segment/journey-yaml.js';import{apiRuleToYaml}from'../sdk/segment/child-segment-yaml.js';import{getSegmentRootDir,findTdxConfigPath,loadTdxConfig}from'../utils/tdx-config.js';function a25_0x10d4(_0x5ed995,_0x10a211){_0x5ed995=_0x5ed995-0x186;const _0x580072=a25_0x5800();let _0x10d4c3=_0x580072[_0x5ed995];return _0x10d4c3;}import{sanitizeFileName}from'../utils/string-utils.js';const SEGMENT_KIND_JOURNEY=0x3;function formatJourneyState(_0x490e05){const _0x119127=a25_0x10d4;switch(_0x490e05){case'launched':return a25_0x3058f5[_0x119127(0x1ba)](_0x490e05);case'draft':return a25_0x3058f5['gray'](_0x490e05);case'archived':return a25_0x3058f5[_0x119127(0x219)](_0x490e05);default:return _0x490e05;}}function formatJourneyItem(_0x33a0aa,_0x55a8bb=''){const _0x32a72c=a25_0x10d4,_0x3925af=formatJourneyState(_0x33a0aa[_0x32a72c(0x1a9)]),_0x279bec=_0x33a0aa[_0x32a72c(0x1f6)]?a25_0x3058f5['yellow']('\x20(paused)'):'';return _0x55a8bb+_0x32a72c(0x18b)+_0x33a0aa[_0x32a72c(0x212)]+'\x20('+_0x3925af+')'+_0x279bec;}function escapeRegex(_0x2cb926){const _0x425906=a25_0x10d4;return _0x2cb926[_0x425906(0x210)](/[.*+?^${}()|[\]\\]/g,_0x425906(0x1f0));}function globToRegex(_0x582e04){const _0x37b743=a25_0x10d4,_0x1af6e2=_0x582e04[_0x37b743(0x1e0)]('*')[_0x37b743(0x201)](escapeRegex);return new RegExp(_0x1af6e2[_0x37b743(0x1a1)]('.*'),'i');}function resolveJourneyTarget(_0x4f5c6a,_0x375d0a,_0x532754){const _0x366624=a25_0x10d4;if(isYamlFilePath(_0x4f5c6a))try{const _0x3c76e2=resolveYamlFilePath(_0x4f5c6a);return _0x532754&&(console[_0x366624(0x19a)](_0x366624(0x1b5)+_0x4f5c6a),console['error'](_0x366624(0x1cd)+_0x3c76e2[_0x366624(0x1fa)]),console[_0x366624(0x19a)](_0x366624(0x21b)+_0x3c76e2[_0x366624(0x1aa)]),console['error']('\x20\x20Folder\x20path:\x20'+(_0x3c76e2[_0x366624(0x190)]||_0x366624(0x1e5)))),{'journeyName':_0x3c76e2['segmentName'],'parentSegment':_0x3c76e2[_0x366624(0x1fa)],'resolved':_0x3c76e2};}catch(_0x5eda09){throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Failed\x20to\x20resolve\x20YAML\x20file\x20path:\x20'+_0x5eda09[_0x366624(0x1a0)]);}if(!_0x375d0a)throw new SDKError(ErrorCode[_0x366624(0x1c6)],'No\x20parent\x20segment\x20context\x20set.\x20Set\x20context\x20with:\x20tdx\x20sg\x20use\x20\x22Name\x22\x20or\x20tdx\x20sg\x20pull\x20\x22Name\x22');return{'journeyName':_0x4f5c6a,'parentSegment':_0x375d0a};}function a25_0x5800(){const _0x9dd462=['resolveParentId','split','β\x20Found\x20','\x20journey','33zongiX','Are\x20you\x20sure\x20you\x20want\x20to\x20resume\x20journey\x20\x22','(root)','yaml','cyan','toLowerCase','451556bmjYQe','yes','Export\x20journey(s)\x20as\x20YAML\x20files','getParentFull','β\x20Pulled\x20','totalEntered','\x22\x20resumed','\x5c$&','length','stages','audienceId','cwd','956106GeqVwq','paused','goal','Input:\x20','190yYDxeX','parentSegment','getJourney','log','180649wxzJKz','\x20\x20Statistics\x20not\x20available','listFolders','Fetching\x20folders...','map','isNew','\x20new\x20files','Found\x20existing\x20tdx.json\x20at:\x20','Usage:\x20journey\x20view\x20<name-or-path>','format','getSegment','\x20(ID:\x20','launched','Fetching\x20','journey:pause','Resume\x20a\x20paused\x20journey','draft','name','\x22\x20paused','replace','push','journeyBundleName','314415CNNDWZ','absolutePath','table','kind','β\x20Journey\x20\x22','latest','dim','Pattern:\x20','\x20\x20Name:\x20','.yml','totalGoalAchieved','Show\x20journey\x20details','\x22\x20not\x20found','π\x20','Resuming\x20journey...','Resolving\x20parent\x20segment...','hasChanges','values','find','data','Warning:\x20Could\x20not\x20resolve\x20segment\x20','includeStats','\x20journey\x20files\x20to\x20','journeyStages','content','Usage:\x20journey\x20stats\x20<name-or-path>','Error:\x20Journey\x20name,\x20path,\x20or\x20YAML\x20file\x20is\x20required','item','resolveJourneyId','...','πΊοΈ\x20','diff','Using\x20parent\x20segment:\x20','population','yellow','folderPath','Usage:\x20journey\x20resume\x20<name-or-path>','18DOswuo','filter','\x20\x20Target:\x20','get','verbose','goalRate','version_number','Getting\x20journey\x20details...','error','Parent\x20segment:\x20','Listing\x20journeys...','Are\x20you\x20sure\x20you\x20want\x20to\x20pause\x20journey\x20\x22','versionNumber','journey','message','join','size','Warning:\x20Stage\x20\x22','\x0a[Dry\x20run]\x20No\x20files\x20were\x20written','resume','Resolving\x20journey...','journeyName','\x20changed\x20files','state','segmentName','\x20files?','segments','No\x20journeys\x20found','bundle_id','Error:\x20Journey\x20not\x20found:\x20','folderId','rule','exited','stage','version','Resolved\x20YAML\x20file:\x20','Cancelled','No\x20statistics\x20available\x20for\x20journey:\x20','journeyBundleId','repeat','green','journey:resume','attributes','Pausing\x20journey...','Fetching\x20parent\x20segment...','3750291RbCENm','bundle_name','conversionRate','journeyId','8mXUsDL','82588WibrBJ','Statistics\x20may\x20not\x20be\x20available\x20for\x20draft\x20or\x20newly\x20created\x20journeys.','INVALID_ARGUMENT','journey:list','entered','has','description','Aborted.','stageName','\x20\x20Parent\x20segment:\x20','\x0aTip:\x20Run\x20`tdx\x20sg\x20pull\x20<parent_name>`\x20first\x20to\x20create\x20the\x20folder\x20structure','all','Use\x20--parent-segment\x20or\x20set\x20context\x20with\x20\x22tdx\x20sg\x20use\x22','max','segment','set','Getting\x20journey\x20statistics...','Write\x20','utf-8','4593080OOCNJN','journey:pull','Usage:\x20journey\x20pause\x20<name-or-path>','dirname','test','reentryMode','\x20unchanged\x20files','execute'];a25_0x5800=function(){return _0x9dd462;};return a25_0x5800();}export class JourneyListCommand extends BaseCommand{['name']=a25_0x175ab7(0x1c7);[a25_0x175ab7(0x1ca)]='List\x20journeys\x20in\x20current\x20context';async[a25_0x175ab7(0x1de)](_0x318cae){const _0x5cc63e=a25_0x175ab7,{options:_0x30fd6b,args:_0x130090,tdx:_0x3109b2}=_0x318cae,_0xfb5520=_0x130090[0x0],_0x5d45df=_0x30fd6b[_0x5cc63e(0x1fa)];if(!_0x5d45df)return console[_0x5cc63e(0x19a)]('Error:\x20Parent\x20segment\x20context\x20required'),console[_0x5cc63e(0x19a)](_0x5cc63e(0x1d0)),0x1;const _0x2be339=await withSpinner(_0x5cc63e(0x222),()=>_0x3109b2[_0x5cc63e(0x1d2)][_0x5cc63e(0x1df)](_0x5d45df),{'verbose':_0x30fd6b[_0x5cc63e(0x196)]}),_0x33230f=_0x2be339[_0x5cc63e(0x226)];_0x30fd6b['verbose']&&(console[_0x5cc63e(0x19a)](_0x5cc63e(0x19b)+_0x5d45df+_0x5cc63e(0x208)+_0x33230f+')'),_0xfb5520&&console[_0x5cc63e(0x19a)](_0x5cc63e(0x21a)+_0xfb5520));const [_0x404c48,_0x173f8c,_0x68ee]=await Promise[_0x5cc63e(0x1cf)]([withSpinner(_0x5cc63e(0x1be),()=>_0x3109b2[_0x5cc63e(0x1d2)][_0x5cc63e(0x1ec)](_0x33230f),{'verbose':_0x30fd6b[_0x5cc63e(0x196)]}),withSpinner(_0x5cc63e(0x200),()=>_0x3109b2[_0x5cc63e(0x1d2)][_0x5cc63e(0x1ff)](_0x33230f),{'verbose':_0x30fd6b[_0x5cc63e(0x196)]}),withSpinner(_0x5cc63e(0x19c),()=>_0x3109b2[_0x5cc63e(0x19f)]['listJourneysFromParentSegment'](_0x33230f),{'verbose':_0x30fd6b[_0x5cc63e(0x196)]})]),_0x586b8c=_0x404c48[_0x5cc63e(0x226)],_0x8d8a62=_0x173f8c['data'];let _0x2171d2=_0x68ee[_0x5cc63e(0x226)];const _0x2142df=_0x586b8c['rootFolderId'],_0x45e936=new Map();for(const _0x405c0a of _0x8d8a62){_0x45e936[_0x5cc63e(0x1d3)](_0x405c0a['id'],_0x405c0a['name']);}if(_0xfb5520){const _0x50a1b0=globToRegex(_0xfb5520);_0x2171d2=_0x2171d2[_0x5cc63e(0x193)](_0xbb4636=>_0x50a1b0[_0x5cc63e(0x1db)](_0xbb4636[_0x5cc63e(0x212)]));}console[_0x5cc63e(0x19a)](_0x5cc63e(0x1e1)+_0x2171d2['length']+_0x5cc63e(0x1e2)+(_0x2171d2['length']!==0x1?'s':''));if(_0x30fd6b['format']===_0x5cc63e(0x215))await handleSDKOutput(_0x2171d2,_0x30fd6b);else{if(_0x30fd6b[_0x5cc63e(0x206)]==='json')await handleSDKOutput(_0x2171d2,_0x30fd6b);else{console[_0x5cc63e(0x1fc)]('['+_0x5d45df+']');const _0x1ec4ce=new Map(),_0x1725ed=[];for(const _0x4a0035 of _0x2171d2){if(!_0x4a0035[_0x5cc63e(0x1b0)]||_0x4a0035[_0x5cc63e(0x1b0)]===_0x2142df)_0x1725ed['push'](_0x4a0035);else{const _0x5c9d9e=_0x1ec4ce[_0x5cc63e(0x195)](_0x4a0035[_0x5cc63e(0x1b0)])||[];_0x5c9d9e[_0x5cc63e(0x211)](_0x4a0035),_0x1ec4ce[_0x5cc63e(0x1d3)](_0x4a0035[_0x5cc63e(0x1b0)],_0x5c9d9e);}}for(const _0x1a65d6 of _0x1725ed){console[_0x5cc63e(0x1fc)](formatJourneyItem(_0x1a65d6));}for(const [_0x80a39c,_0xde2eda]of _0x1ec4ce){const _0xc2e127=_0x45e936[_0x5cc63e(0x195)](_0x80a39c)||_0x80a39c;console[_0x5cc63e(0x1fc)](_0x5cc63e(0x220)+_0xc2e127);for(const _0x57c01 of _0xde2eda){console[_0x5cc63e(0x1fc)](formatJourneyItem(_0x57c01,'\x20\x20'));}}}}return 0x0;}}export class JourneyViewCommand extends BaseCommand{['name']='journey:view';[a25_0x175ab7(0x1ca)]=a25_0x175ab7(0x21e);async['execute'](_0x3d0c62){const _0x10413e=a25_0x175ab7,{options:_0x57cb16,args:_0x2b8046,tdx:_0x6b9b26}=_0x3d0c62,_0x4f1df8=_0x2b8046[0x0];if(!_0x4f1df8)return console[_0x10413e(0x19a)](_0x10413e(0x187)),console[_0x10413e(0x19a)](_0x10413e(0x205)),0x1;_0x57cb16[_0x10413e(0x196)]&&console['error'](_0x10413e(0x1f8)+_0x4f1df8);const _0x23a1dc=resolveJourneyTarget(_0x4f1df8,_0x57cb16[_0x10413e(0x1fa)],_0x57cb16[_0x10413e(0x196)]),_0x493a9f=await withSpinner(_0x10413e(0x222),()=>_0x6b9b26['segment'][_0x10413e(0x1df)](_0x23a1dc[_0x10413e(0x1fa)]),{'verbose':_0x57cb16['verbose']}),_0x138f94=_0x493a9f[_0x10413e(0x226)],_0x4cb669=await withSpinner(_0x10413e(0x1a6),()=>_0x6b9b26[_0x10413e(0x19f)]['resolveJourneyId'](_0x138f94,_0x23a1dc[_0x10413e(0x1a7)]),{'verbose':_0x57cb16[_0x10413e(0x196)]}),_0xd59793=_0x4cb669[_0x10413e(0x226)],_0x112405=await withSpinner(_0x10413e(0x199),()=>_0x6b9b26['journey'][_0x10413e(0x1fb)](_0xd59793),{'verbose':_0x57cb16[_0x10413e(0x196)]}),_0x3896d3=_0x112405[_0x10413e(0x226)],_0x541eba=_0x57cb16[_0x10413e(0x228)];let _0x5c7a8c;if(_0x541eba)try{const _0x214ec1=await withSpinner(_0x10413e(0x1d4),()=>_0x6b9b26[_0x10413e(0x19f)]['getStatistics'](_0xd59793),{'verbose':_0x57cb16[_0x10413e(0x196)]});_0x5c7a8c=_0x214ec1[_0x10413e(0x226)];}catch{_0x57cb16[_0x10413e(0x196)]&&console[_0x10413e(0x19a)](_0x10413e(0x1fe));}const _0x35f2be={'id':_0x3896d3['id'],'name':_0x3896d3[_0x10413e(0x1bc)][_0x10413e(0x20e)],'description':_0x3896d3[_0x10413e(0x1bc)]['description'],'state':_0x3896d3[_0x10413e(0x1bc)][_0x10413e(0x1a9)],'paused':_0x3896d3[_0x10413e(0x1bc)]['paused'],'reentry_mode':_0x3896d3[_0x10413e(0x1bc)][_0x10413e(0x1dc)],'stages':_0x3896d3['attributes'][_0x10413e(0x22a)]?.[_0x10413e(0x1f1)]||0x0,..._0x3896d3[_0x10413e(0x1bc)][_0x10413e(0x1f7)]&&{'goal':_0x3896d3[_0x10413e(0x1bc)][_0x10413e(0x1f7)][_0x10413e(0x20e)]},..._0x5c7a8c&&{'statistics':{'total_entered':_0x5c7a8c['totalEntered'],'goal_achieved':_0x5c7a8c[_0x10413e(0x21d)],'goal_rate':_0x5c7a8c['goalRate'],'stages':_0x5c7a8c['stages']}}};return await handleSingleObjectOutput(_0x35f2be,_0x57cb16),0x0;}}export class JourneyStatsCommand extends BaseCommand{['name']='journey:stats';[a25_0x175ab7(0x1ca)]='Show\x20journey\x20statistics';async[a25_0x175ab7(0x1de)](_0x536ebf){const _0x8f7866=a25_0x175ab7,{options:_0x454a8f,args:_0x11defc,tdx:_0x527f48}=_0x536ebf,_0xae6838=_0x11defc[0x0];if(!_0xae6838)return console['error'](_0x8f7866(0x187)),console[_0x8f7866(0x19a)](_0x8f7866(0x186)),0x1;_0x454a8f[_0x8f7866(0x196)]&&console['error'](_0x8f7866(0x1f8)+_0xae6838);const _0x34a047=resolveJourneyTarget(_0xae6838,_0x454a8f[_0x8f7866(0x1fa)],_0x454a8f[_0x8f7866(0x196)]),_0x30cfd6=await withSpinner(_0x8f7866(0x222),()=>_0x527f48[_0x8f7866(0x1d2)]['resolveParentId'](_0x34a047[_0x8f7866(0x1fa)]),{'verbose':_0x454a8f[_0x8f7866(0x196)]}),_0x443e07=_0x30cfd6[_0x8f7866(0x226)],_0x5aaac0=await withSpinner(_0x8f7866(0x1a6),()=>_0x527f48[_0x8f7866(0x19f)][_0x8f7866(0x189)](_0x443e07,_0x34a047[_0x8f7866(0x1a7)]),{'verbose':_0x454a8f[_0x8f7866(0x196)]}),_0x54871a=_0x5aaac0[_0x8f7866(0x226)],_0x5e65a0=await withSpinner(_0x8f7866(0x1d4),()=>_0x527f48[_0x8f7866(0x19f)]['getStatistics'](_0x54871a),{'verbose':_0x454a8f[_0x8f7866(0x196)]}),_0x1f8237=_0x5e65a0[_0x8f7866(0x226)];if(!_0x1f8237||_0x1f8237['journeyId']===null)return console[_0x8f7866(0x19a)](_0x8f7866(0x1b7)+_0x34a047[_0x8f7866(0x1a7)]),console[_0x8f7866(0x19a)](_0x8f7866(0x1c5)),0x0;const _0xa186b5={'journey_id':_0x1f8237[_0x8f7866(0x1c2)],'total_entered':_0x1f8237[_0x8f7866(0x1ee)],'goal_achieved':_0x1f8237[_0x8f7866(0x21d)],'goal_rate':_0x1f8237[_0x8f7866(0x197)],'stages':_0x1f8237[_0x8f7866(0x1f2)]?.['map'](_0x44f3ea=>({'name':_0x44f3ea[_0x8f7866(0x1cc)],'population':_0x44f3ea[_0x8f7866(0x18e)],'entered':_0x44f3ea[_0x8f7866(0x1c8)],'exited':_0x44f3ea[_0x8f7866(0x1b2)],'conversion_rate':_0x44f3ea[_0x8f7866(0x1c1)]}))},_0x51a835=_0x454a8f[_0x8f7866(0x1b3)];if(_0x51a835&&_0x1f8237[_0x8f7866(0x1f2)]){const _0x286a36=_0x1f8237[_0x8f7866(0x1f2)][_0x8f7866(0x225)](_0x29a9f2=>_0x29a9f2[_0x8f7866(0x1cc)][_0x8f7866(0x1e8)]()===_0x51a835[_0x8f7866(0x1e8)]());if(_0x286a36)return await handleSingleObjectOutput({'stage_name':_0x286a36['stageName'],'population':_0x286a36[_0x8f7866(0x18e)],'entered':_0x286a36[_0x8f7866(0x1c8)],'exited':_0x286a36[_0x8f7866(0x1b2)],'conversion_rate':_0x286a36[_0x8f7866(0x1c1)]},_0x454a8f),0x0;console[_0x8f7866(0x19a)](_0x8f7866(0x1a3)+_0x51a835+_0x8f7866(0x21f));}return await handleSingleObjectOutput(_0xa186b5,_0x454a8f),0x0;}}export class JourneyPauseCommand extends BaseCommand{[a25_0x175ab7(0x20e)]=a25_0x175ab7(0x20b);[a25_0x175ab7(0x1ca)]='Pause\x20a\x20running\x20journey';async['execute'](_0x3c31d9){const _0x4f8827=a25_0x175ab7,{options:_0x41a617,args:_0x1ac390,tdx:_0x18a3ce}=_0x3c31d9,_0x56e747=_0x1ac390[0x0];if(!_0x56e747)return console['error'](_0x4f8827(0x187)),console[_0x4f8827(0x19a)](_0x4f8827(0x1d9)),0x1;_0x41a617['verbose']&&console[_0x4f8827(0x19a)](_0x4f8827(0x1f8)+_0x56e747);const _0x36e966=resolveJourneyTarget(_0x56e747,_0x41a617['parentSegment'],_0x41a617[_0x4f8827(0x196)]),_0x3dd961=await withSpinner('Resolving\x20parent\x20segment...',()=>_0x18a3ce['segment'][_0x4f8827(0x1df)](_0x36e966[_0x4f8827(0x1fa)]),{'verbose':_0x41a617[_0x4f8827(0x196)]}),_0x8eb344=_0x3dd961[_0x4f8827(0x226)],_0x3ab48e=await withSpinner('Resolving\x20journey...',()=>_0x18a3ce[_0x4f8827(0x19f)]['resolveJourneyId'](_0x8eb344,_0x36e966[_0x4f8827(0x1a7)]),{'verbose':_0x41a617[_0x4f8827(0x196)]}),_0x5d9b30=_0x3ab48e[_0x4f8827(0x226)];if(!_0x41a617[_0x4f8827(0x1ea)]){const _0x47a693=await confirm(_0x4f8827(0x19d)+_0x36e966['journeyName']+'\x22?');if(!_0x47a693)return console['error'](_0x4f8827(0x1b6)),0x0;}const _0x5ae42d=await withSpinner(_0x4f8827(0x1bd),()=>_0x18a3ce[_0x4f8827(0x19f)]['pause'](_0x5d9b30),{'verbose':_0x41a617[_0x4f8827(0x196)]}),_0x2a884b=_0x5ae42d[_0x4f8827(0x226)];return console[_0x4f8827(0x19a)](_0x4f8827(0x217)+_0x2a884b[_0x4f8827(0x1bc)][_0x4f8827(0x20e)]+_0x4f8827(0x20f)),0x0;}}export class JourneyResumeCommand extends BaseCommand{[a25_0x175ab7(0x20e)]=a25_0x175ab7(0x1bb);[a25_0x175ab7(0x1ca)]=a25_0x175ab7(0x20c);async[a25_0x175ab7(0x1de)](_0x14ac99){const _0x5be7ad=a25_0x175ab7,{options:_0x28c96c,args:_0x58d390,tdx:_0x1725b0}=_0x14ac99,_0x3b3e6c=_0x58d390[0x0];if(!_0x3b3e6c)return console['error'](_0x5be7ad(0x187)),console['error'](_0x5be7ad(0x191)),0x1;_0x28c96c[_0x5be7ad(0x196)]&&console[_0x5be7ad(0x19a)]('Input:\x20'+_0x3b3e6c);const _0x3f5260=resolveJourneyTarget(_0x3b3e6c,_0x28c96c['parentSegment'],_0x28c96c[_0x5be7ad(0x196)]),_0x573987=await withSpinner(_0x5be7ad(0x222),()=>_0x1725b0[_0x5be7ad(0x1d2)][_0x5be7ad(0x1df)](_0x3f5260[_0x5be7ad(0x1fa)]),{'verbose':_0x28c96c['verbose']}),_0x56e748=_0x573987[_0x5be7ad(0x226)],_0x315eb5=await withSpinner(_0x5be7ad(0x1a6),()=>_0x1725b0[_0x5be7ad(0x19f)][_0x5be7ad(0x189)](_0x56e748,_0x3f5260['journeyName']),{'verbose':_0x28c96c[_0x5be7ad(0x196)]}),_0x22a4f3=_0x315eb5[_0x5be7ad(0x226)];if(!_0x28c96c[_0x5be7ad(0x1ea)]){const _0x4f3a69=await confirm(_0x5be7ad(0x1e4)+_0x3f5260[_0x5be7ad(0x1a7)]+'\x22?');if(!_0x4f3a69)return console[_0x5be7ad(0x19a)](_0x5be7ad(0x1b6)),0x0;}const _0x15edef=await withSpinner(_0x5be7ad(0x221),()=>_0x1725b0[_0x5be7ad(0x19f)][_0x5be7ad(0x1a5)](_0x22a4f3),{'verbose':_0x28c96c[_0x5be7ad(0x196)]}),_0x3dca1d=_0x15edef['data'];return console[_0x5be7ad(0x19a)](_0x5be7ad(0x217)+_0x3dca1d[_0x5be7ad(0x1bc)][_0x5be7ad(0x20e)]+_0x5be7ad(0x1ef)),0x0;}}export class JourneyPullCommand extends BaseCommand{[a25_0x175ab7(0x20e)]=a25_0x175ab7(0x1d8);['description']=a25_0x175ab7(0x1eb);async[a25_0x175ab7(0x1de)](_0x2c0fee){const _0x2c5895=a25_0x175ab7,{options:_0x1575ad,args:_0x3aedfb,tdx:_0x1e82ec}=_0x2c0fee,_0x2521e2=_0x1575ad,_0xac4b83=_0x3aedfb[0x0],_0x5de7f9=findTdxConfigPath();let _0x2798de,_0x3e5b94;if(_0x5de7f9){const _0x55246c=loadTdxConfig(_0x5de7f9);_0x2798de=_0x55246c['parent_segment'],_0x3e5b94=a25_0x102f81[_0x2c5895(0x1da)](_0x5de7f9),_0x2521e2[_0x2c5895(0x196)]&&(console[_0x2c5895(0x19a)](_0x2c5895(0x204)+_0x5de7f9),console[_0x2c5895(0x19a)](_0x2c5895(0x18d)+_0x2798de));}else{_0x2798de=_0x1575ad[_0x2c5895(0x1fa)];if(!_0x2798de)return console[_0x2c5895(0x19a)](a25_0x3058f5[_0x2c5895(0x18f)]('Parent\x20segment\x20context\x20not\x20set.\x0a')),console[_0x2c5895(0x19a)]('Usage:\x20tdx\x20journey\x20pull\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20#\x20Inside\x20a\x20segment\x20folder\x20(with\x20tdx.json)'),console[_0x2c5895(0x19a)]('\x20\x20\x20\x20\x20\x20\x20tdx\x20journey\x20pull\x20--parent-segment\x20<name>\x20\x20#\x20Specify\x20parent\x20segment'),console['error'](_0x2c5895(0x1ce)),0x1;_0x3e5b94=getSegmentRootDir(sanitizeFileName(_0x2798de));}const _0x59d879=await withSpinner(_0x2c5895(0x222),()=>_0x1e82ec[_0x2c5895(0x1d2)][_0x2c5895(0x1df)](_0x2798de),{'verbose':_0x1575ad[_0x2c5895(0x196)]}),_0x13d461=_0x59d879[_0x2c5895(0x226)],_0x21c885=await withSpinner(_0x2c5895(0x19c),()=>_0x1e82ec[_0x2c5895(0x19f)]['listJourneysFromParentSegment'](_0x13d461),{'verbose':_0x1575ad[_0x2c5895(0x196)]});let _0x32ed1f=_0x21c885['data'];if(_0xac4b83){const _0x5a258c=_0x32ed1f['filter'](_0x1189d9=>_0x1189d9[_0x2c5895(0x212)][_0x2c5895(0x1e8)]()===_0xac4b83[_0x2c5895(0x1e8)]());if(_0x5a258c[_0x2c5895(0x1f1)]===0x0)return console[_0x2c5895(0x19a)](_0x2c5895(0x1af)+_0xac4b83),console['error']('Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'),0x1;_0x32ed1f=_0x5a258c;}if(_0x32ed1f['length']===0x0)return console[_0x2c5895(0x19a)](_0x2c5895(0x1ad)),0x0;const _0x3269b2=new Map();for(const _0x2487fa of _0x32ed1f){const _0xb2d4c1=_0x2487fa[_0x2c5895(0x1b8)];!_0x3269b2[_0x2c5895(0x1c9)](_0xb2d4c1)&&_0x3269b2[_0x2c5895(0x1d3)](_0xb2d4c1,[]),_0x3269b2[_0x2c5895(0x195)](_0xb2d4c1)['push'](_0x2487fa);}for(const _0x1e04f0 of _0x3269b2[_0x2c5895(0x224)]()){_0x1e04f0['sort']((_0x166853,_0x5dffed)=>(_0x166853[_0x2c5895(0x19e)]||0x0)-(_0x5dffed[_0x2c5895(0x19e)]||0x0));}const _0x519287=[];for(const _0x2b0278 of _0x3269b2['values']()){const _0x25bfdb=_0x2b0278[0x0][_0x2c5895(0x212)],_0x17187d=[];for(const _0x2b5e1a of _0x2b0278){const _0x4fb066=await withSpinner(_0x2c5895(0x20a)+_0x2b5e1a['journeyBundleName']+'\x20v'+(_0x2b5e1a['versionNumber']||0x1)+_0x2c5895(0x18a),()=>_0x1e82ec[_0x2c5895(0x19f)][_0x2c5895(0x1fb)](_0x2b5e1a['id']),{'verbose':_0x1575ad[_0x2c5895(0x196)]}),_0x50e558=_0x4fb066['data'],_0x307d6f=_0x50e558[_0x2c5895(0x1bc)]?.[_0x2c5895(0x1f3)],_0x14e51c={'resolveSegment':async _0x3d871e=>{const _0x24cf6d=_0x2c5895;if(!_0x307d6f)return{'name':_0x3d871e,'isJourneyLocal':![]};try{const _0x4c83e6=await _0x1e82ec['segment'][_0x24cf6d(0x207)](_0x307d6f,_0x3d871e),_0x272742=_0x4c83e6[_0x24cf6d(0x216)]===SEGMENT_KIND_JOURNEY;let _0x53e653;return _0x272742&&_0x4c83e6[_0x24cf6d(0x1b1)]&&(_0x53e653={'description':_0x4c83e6[_0x24cf6d(0x1ca)],'rule':apiRuleToYaml(_0x4c83e6[_0x24cf6d(0x1b1)])}),{'name':_0x4c83e6[_0x24cf6d(0x20e)],'isJourneyLocal':_0x272742,'definition':_0x53e653};}catch(_0xb7d48a){return _0x1575ad[_0x24cf6d(0x196)]&&console[_0x24cf6d(0x19a)](_0x24cf6d(0x227)+_0x3d871e+':\x20'+_0xb7d48a[_0x24cf6d(0x1a0)]),{'name':_0x3d871e,'isJourneyLocal':![]};}}},_0x337737=await apiToYamlAsync(_0x50e558,_0x14e51c);_0x17187d[_0x2c5895(0x211)]({'item':_0x2b5e1a,'yaml':_0x337737});}const _0x301f30=_0x17187d[0x0][_0x2c5895(0x1e6)],_0x51e90b=Math[_0x2c5895(0x1d1)](..._0x17187d['map'](_0x10904a=>_0x10904a[_0x2c5895(0x188)][_0x2c5895(0x19e)]||0x0));let _0x5a6fa9;if(_0x17187d[_0x2c5895(0x1f1)]===0x1)_0x5a6fa9=_0x301f30;else{const _0x140465=_0x17187d['map'](_0x30871b=>{const _0x32b6fb=_0x2c5895,_0x702a0e=(_0x30871b[_0x32b6fb(0x188)]['versionNumber']||0x0)===_0x51e90b,_0x36f4cd={'name':_0x30871b[_0x32b6fb(0x1e6)][_0x32b6fb(0x1b4)]||_0x30871b[_0x32b6fb(0x188)][_0x32b6fb(0x20e)],'state':_0x30871b[_0x32b6fb(0x188)][_0x32b6fb(0x1a9)]==='launched'?_0x32b6fb(0x209):_0x32b6fb(0x20d),'stages':_0x30871b[_0x32b6fb(0x1e6)][_0x32b6fb(0x1f2)]||[],'id':_0x30871b['yaml']['id'],'version_number':_0x30871b['yaml'][_0x32b6fb(0x198)]};return _0x702a0e&&(_0x36f4cd[_0x32b6fb(0x218)]=!![]),_0x36f4cd;});_0x5a6fa9={'type':_0x2c5895(0x19f),'name':_0x301f30[_0x2c5895(0x20e)],'description':_0x301f30[_0x2c5895(0x1ca)],'segments':_0x301f30[_0x2c5895(0x1ac)],'goal':_0x301f30[_0x2c5895(0x1f7)],'reentry':_0x301f30['reentry'],'versions':_0x140465,'bundle_id':_0x301f30[_0x2c5895(0x1ae)],'bundle_name':_0x301f30[_0x2c5895(0x1c0)]};}const _0x45cf2f=toYamlString(_0x5a6fa9),_0x403422=sanitizeFileName(_0x25bfdb),_0x129ae1=a25_0x102f81[_0x2c5895(0x1a1)](_0x3e5b94,_0x403422+_0x2c5895(0x21c)),_0x3f4efe=a25_0x102f81['relative'](process[_0x2c5895(0x1f4)](),_0x129ae1);if(existsSync(_0x129ae1)){const _0x1403b6=readFileSync(_0x129ae1,_0x2c5895(0x1d6)),_0x4c810e=generateDiff(_0x1403b6,_0x45cf2f),_0x24a09f=hasChanges(_0x4c810e);_0x519287[_0x2c5895(0x211)]({'relativePath':_0x3f4efe,'absolutePath':_0x129ae1,'content':_0x45cf2f,'isNew':![],'hasChanges':_0x24a09f,'diff':_0x24a09f?formatDiffWithColors(_0x4c810e):undefined});}else _0x519287[_0x2c5895(0x211)]({'relativePath':_0x3f4efe,'absolutePath':_0x129ae1,'content':_0x45cf2f,'isNew':!![],'hasChanges':![]});}const _0x3dcab9=_0x519287[_0x2c5895(0x193)](_0x24494b=>_0x24494b['isNew']),_0x59c338=_0x519287[_0x2c5895(0x193)](_0x5db6e9=>!_0x5db6e9['isNew']&&_0x5db6e9['hasChanges']),_0x57cf32=_0x519287['filter'](_0x353ee1=>!_0x353ee1[_0x2c5895(0x202)]&&!_0x353ee1[_0x2c5895(0x223)]),_0x5542cc=_0x32ed1f[_0x2c5895(0x1f1)],_0x3dbe69=_0x3269b2[_0x2c5895(0x1a2)],_0x535912=_0x5542cc>_0x3dbe69?'\x20('+_0x5542cc+'\x20versions)':'';console[_0x2c5895(0x19a)]('\x0aPull\x20summary:'),console[_0x2c5895(0x19a)]('\x20\x20'+a25_0x3058f5[_0x2c5895(0x1e7)](_0x3dbe69+'\x20journeys')+a25_0x3058f5[_0x2c5895(0x219)](_0x535912)),console[_0x2c5895(0x19a)]('\x20\x20'+a25_0x3058f5[_0x2c5895(0x1ba)]('+\x20'+_0x3dcab9[_0x2c5895(0x1f1)]+_0x2c5895(0x203))),console['error']('\x20\x20'+a25_0x3058f5[_0x2c5895(0x18f)]('~\x20'+_0x59c338[_0x2c5895(0x1f1)]+_0x2c5895(0x1a8))),console[_0x2c5895(0x19a)]('\x20\x20'+a25_0x3058f5[_0x2c5895(0x219)]('=\x20'+_0x57cf32[_0x2c5895(0x1f1)]+_0x2c5895(0x1dd))),console[_0x2c5895(0x19a)](_0x2c5895(0x194)+a25_0x3058f5[_0x2c5895(0x1e7)](_0x3e5b94)+'\x0a');if(_0x59c338['length']>0x0)for(const _0x5f2b03 of _0x59c338){console['error']('\x0aChanges\x20to\x20\x27'+_0x5f2b03['relativePath']+'\x27:'),console[_0x2c5895(0x19a)]('β'[_0x2c5895(0x1b9)](0x3c)),console['error'](_0x5f2b03[_0x2c5895(0x18c)]),console[_0x2c5895(0x19a)]('β'[_0x2c5895(0x1b9)](0x3c));}if(_0x2521e2['dryRun'])return console[_0x2c5895(0x19a)](a25_0x3058f5[_0x2c5895(0x18f)](_0x2c5895(0x1a4))),0x0;if(_0x3dcab9['length']===0x0&&_0x59c338[_0x2c5895(0x1f1)]===0x0)return console[_0x2c5895(0x19a)](a25_0x3058f5[_0x2c5895(0x1ba)]('β\x20All\x20files\x20are\x20up\x20to\x20date')),0x0;if(!_0x2521e2[_0x2c5895(0x1ea)]&&(_0x3dcab9[_0x2c5895(0x1f1)]>0x0||_0x59c338[_0x2c5895(0x1f1)]>0x0)){const _0xdb4810=await confirmKey(_0x2c5895(0x1d5)+(_0x3dcab9[_0x2c5895(0x1f1)]+_0x59c338[_0x2c5895(0x1f1)])+_0x2c5895(0x1ab));if(!_0xdb4810)return console[_0x2c5895(0x19a)](_0x2c5895(0x1cb)),0x1;}!existsSync(_0x3e5b94)&&mkdirSync(_0x3e5b94,{'recursive':!![]});for(const _0x169267 of _0x519287){(_0x169267[_0x2c5895(0x202)]||_0x169267[_0x2c5895(0x223)])&&writeFileSync(_0x169267[_0x2c5895(0x214)],_0x169267[_0x2c5895(0x22b)],_0x2c5895(0x1d6));}return console[_0x2c5895(0x19a)](a25_0x3058f5['green'](_0x2c5895(0x1ed)+(_0x3dcab9[_0x2c5895(0x1f1)]+_0x59c338[_0x2c5895(0x1f1)])+_0x2c5895(0x229)+_0x3e5b94)),0x0;}}
|