@treasuredata/tdx 0.16.12 → 0.16.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/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.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/llm-proxy.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/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/passthrough-server.js +1 -1
- package/dist/proxy/server.js +1 -1
- package/dist/proxy/session-cache.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-aliases.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/port.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a124_0x4e6040=a124_0x3462;(function(_0x507cbd,_0x2f2bd6){const _0x222b1e=a124_0x3462,_0x27478d=_0x507cbd();while(!![]){try{const _0x599023=-parseInt(_0x222b1e(0x1f9))/0x1+-parseInt(_0x222b1e(0x1fb))/0x2*(-parseInt(_0x222b1e(0x1f4))/0x3)+-parseInt(_0x222b1e(0x204))/0x4*(parseInt(_0x222b1e(0x1ff))/0x5)+parseInt(_0x222b1e(0x207))/0x6*(parseInt(_0x222b1e(0x1f3))/0x7)+parseInt(_0x222b1e(0x1f8))/0x8*(parseInt(_0x222b1e(0x208))/0x9)+-parseInt(_0x222b1e(0x1f0))/0xa+parseInt(_0x222b1e(0x1f2))/0xb*(parseInt(_0x222b1e(0x206))/0xc);if(_0x599023===_0x2f2bd6)break;else _0x27478d['push'](_0x27478d['shift']());}catch(_0x4ae904){_0x27478d['push'](_0x27478d['shift']());}}}(a124_0x4749,0xeebf6));import{readFileSync}from'fs';import*as a124_0x16ea63 from'path';import*as a124_0x1462b9 from'yaml';import{validateSegmentDef,validateJourneyDef}from'./yaml-validator.js';function a124_0x3462(_0x242ea9,_0x32590c){_0x242ea9=_0x242ea9-0x1f0;const _0x474985=a124_0x4749();let _0x3462c6=_0x474985[_0x242ea9];return _0x3462c6;}export function isJourneyDef(_0x4e0da8){const _0x52fc5a=a124_0x3462;return typeof _0x4e0da8===_0x52fc5a(0x1f5)&&_0x4e0da8!==null&&_0x52fc5a(0x202)in _0x4e0da8&&_0x4e0da8['type']===_0x52fc5a(0x20c);}export function isValidationResult(_0x23212e){const _0x434271=a124_0x3462;return!(_0x434271(0x20a)in _0x23212e);}function a124_0x4749(){const _0x48a3d6=['object','filterType','parseDocument','2600696PTNxea','853967ZFGdgx','error','244tUzeAg','result','segment','Failed\x20to\x20parse\x20YAML\x20file\x20(empty\x20or\x20invalid)','58560hbiuzy','YAML_PARSE_ERROR','map','type','message','632iACFqH','utf-8','12obvrNz','6vddglc','18MNSHwR','warnings','skipped','not\x20a\x20','journey','7857500Lzrhjh','relative','22948728zItDPr','11478845hdpIiK','2259CQBWrO'];a124_0x4749=function(){return _0x48a3d6;};return a124_0x4749();}export function createParseErrorResult(_0x330070,_0x51e6db,_0x12838b,_0x16f955,_0x4e5aac=a124_0x4e6040(0x1fd)){const _0x45154d=a124_0x4e6040;return{'filePath':_0x330070,'relativePath':_0x51e6db,'source':_0x12838b,'result':{'valid':![],'errors':[{'level':_0x45154d(0x1fa),'path':'','code':_0x45154d(0x200),'message':_0x16f955}],'warnings':[]},'fileType':_0x4e5aac};}export function validateYamlFile(_0x5f581b,_0x3b2b34,_0x39a724={}){const _0x529e4f=a124_0x4e6040,_0x6abfdc=a124_0x16ea63[_0x529e4f(0x1f1)](_0x3b2b34,_0x5f581b)||a124_0x16ea63['basename'](_0x5f581b);try{const _0x33b689=readFileSync(_0x5f581b,_0x529e4f(0x205)),_0xe7a10b=a124_0x1462b9[_0x529e4f(0x1f7)](_0x33b689),_0x1508e9=_0xe7a10b['toJSON']();if(!_0x1508e9)return createParseErrorResult(_0x5f581b,_0x6abfdc,_0x33b689,_0x529e4f(0x1fe));const _0x1327f4=isJourneyDef(_0x1508e9)?_0x529e4f(0x20c):_0x529e4f(0x1fd);if(_0x39a724[_0x529e4f(0x1f6)]&&_0x1327f4!==_0x39a724[_0x529e4f(0x1f6)])return{'filePath':_0x5f581b,'relativePath':_0x6abfdc,'skipped':!![],'reason':_0x529e4f(0x20b)+_0x39a724['filterType']};const _0x16a3dc={'source':_0x33b689,'document':_0xe7a10b},_0x53a5b6=_0x1327f4===_0x529e4f(0x20c)?validateJourneyDef(_0x1508e9,_0x16a3dc):validateSegmentDef(_0x1508e9,_0x16a3dc);return{'filePath':_0x5f581b,'relativePath':_0x6abfdc,'source':_0x33b689,'result':_0x53a5b6,'fileType':_0x1327f4};}catch(_0x3f75d9){const _0x202e32=_0x3f75d9 instanceof Error?_0x3f75d9[_0x529e4f(0x203)]:String(_0x3f75d9);return createParseErrorResult(_0x5f581b,_0x6abfdc,'','YAML\x20parse\x20error:\x20'+_0x202e32);}}export function validateYamlFiles(_0x39b66b,_0x3236a7,_0x494103={}){const _0x4c623a=a124_0x4e6040;return _0x39b66b[_0x4c623a(0x201)](_0x271460=>validateYamlFile(_0x271460,_0x3236a7,_0x494103));}export function calculateSummary(_0x450219){const _0x1ede85=a124_0x4e6040;let _0x31d0a6=0x0,_0x1116a3=0x0,_0x297d13=0x0,_0x2a3f86=0x0;for(const _0x1355af of _0x450219){if(!isValidationResult(_0x1355af)){_0x2a3f86++;continue;}_0x1355af[_0x1ede85(0x1fc)]['valid']?_0x31d0a6++:_0x1116a3++,_0x297d13+=_0x1355af['result'][_0x1ede85(0x209)]['length'];}return{'validCount':_0x31d0a6,'invalidCount':_0x1116a3,'warningCount':_0x297d13,'skippedCount':_0x2a3f86,'hasErrors':_0x1116a3>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a125_0x37f070=a125_0x2584;(function(_0x123ff5,_0x518498){const _0x2fb137=a125_0x2584,_0x2f681b=_0x123ff5();while(!![]){try{const _0x3d6773=parseInt(_0x2fb137(0x121))/0x1+-parseInt(_0x2fb137(0x16d))/0x2+-parseInt(_0x2fb137(0xfd))/0x3*(-parseInt(_0x2fb137(0x186))/0x4)+-parseInt(_0x2fb137(0x134))/0x5*(parseInt(_0x2fb137(0xe5))/0x6)+parseInt(_0x2fb137(0x11f))/0x7*(-parseInt(_0x2fb137(0x147))/0x8)+parseInt(_0x2fb137(0x13f))/0x9*(-parseInt(_0x2fb137(0x166))/0xa)+-parseInt(_0x2fb137(0x16f))/0xb*(-parseInt(_0x2fb137(0x136))/0xc);if(_0x3d6773===_0x518498)break;else _0x2f681b['push'](_0x2f681b['shift']());}catch(_0x30f5f1){_0x2f681b['push'](_0x2f681b['shift']());}}}(a125_0x4174,0x8bd1c));import a125_0x43e021 from'chalk';const VALID_OPERATOR_TYPES=new Set([a125_0x37f070(0x18f),a125_0x37f070(0x17c),a125_0x37f070(0x13a),a125_0x37f070(0x10b),'Less',a125_0x37f070(0x12c),'In',a125_0x37f070(0x125),a125_0x37f070(0xe9),a125_0x37f070(0x113),a125_0x37f070(0xf1),'Regexp',a125_0x37f070(0x163),'TimeWithinPast',a125_0x37f070(0x183),'TimeRange',a125_0x37f070(0x12a),a125_0x37f070(0x181)]),OPERATORS_REQUIRING_VALUE=new Set([a125_0x37f070(0x18f),a125_0x37f070(0x17c),'Greater',a125_0x37f070(0x10b),a125_0x37f070(0x188),a125_0x37f070(0x12c),'In',a125_0x37f070(0x125),a125_0x37f070(0xe9),a125_0x37f070(0x113),'EndWith',a125_0x37f070(0x106),a125_0x37f070(0xeb),a125_0x37f070(0x183)]),OPERATORS_REQUIRING_UNIT=new Set([a125_0x37f070(0xeb),a125_0x37f070(0x183)]);function a125_0x2584(_0x3a2f14,_0x41253f){_0x3a2f14=_0x3a2f14-0xd7;const _0x417420=a125_0x4174();let _0x25846e=_0x417420[_0x3a2f14];return _0x25846e;}export function getLocationFromPath(_0x139151,_0x4d210e,_0x5bcaf8){const _0x4f0283=a125_0x37f070;if(!_0x139151||!_0x4d210e)return undefined;try{let _0x5cd03c=_0x139151[_0x4f0283(0x109)](_0x5bcaf8,!![]),_0x13836f=[..._0x5bcaf8];while((!_0x5cd03c||typeof _0x5cd03c!==_0x4f0283(0xd7)||!('range'in _0x5cd03c)||!_0x5cd03c['range'])&&_0x13836f[_0x4f0283(0x122)]>0x0){_0x13836f[_0x4f0283(0x18e)](),_0x5cd03c=_0x13836f['length']>0x0?_0x139151[_0x4f0283(0x109)](_0x13836f,!![]):_0x139151[_0x4f0283(0x119)];}if(!_0x5cd03c||typeof _0x5cd03c!==_0x4f0283(0xd7)||!(_0x4f0283(0xe8)in _0x5cd03c)||!_0x5cd03c[_0x4f0283(0xe8)])return undefined;const [_0x338bf9]=_0x5cd03c[_0x4f0283(0xe8)];return offsetToLocation(_0x4d210e,_0x338bf9);}catch{return undefined;}}export function offsetToLocation(_0x438fdf,_0x5e61c2){const _0x3557e3=a125_0x37f070;let _0x138492=0x1,_0x1116a2=0x1;for(let _0x40507c=0x0;_0x40507c<_0x5e61c2&&_0x40507c<_0x438fdf[_0x3557e3(0x122)];_0x40507c++){_0x438fdf[_0x40507c]==='\x0a'?(_0x138492++,_0x1116a2=0x1):_0x1116a2++;}return{'line':_0x138492,'column':_0x1116a2,'offset':_0x5e61c2};}function pathToArray(_0x515d4e){const _0x4e08d2=a125_0x37f070;if(!_0x515d4e)return[];return _0x515d4e[_0x4e08d2(0x10d)]('.')[_0x4e08d2(0x132)](_0x14caa2=>{const _0x53308d=_0x4e08d2,_0x36d07d=_0x14caa2[_0x53308d(0xfe)](/^(\w+)\[(\d+)\]$/);if(_0x36d07d)return[_0x36d07d[0x1],parseInt(_0x36d07d[0x2],0xa)];return[_0x14caa2];});}export function validateRuleDef(_0x1bdda4,_0x1d25b7,_0x3cdce5){const _0x21def9=a125_0x37f070,_0x47c04e=[];if(!_0x1bdda4)return _0x47c04e;_0x1bdda4[_0x21def9(0xf6)]!==_0x21def9(0x11c)&&_0x1bdda4[_0x21def9(0xf6)]!=='Or'&&_0x47c04e[_0x21def9(0xe2)]({'level':_0x21def9(0x140),'path':_0x1d25b7+_0x21def9(0x173),'code':_0x21def9(0x171),'message':_0x21def9(0x12f)+_0x1bdda4['type']+'\x27','location':getLocationFromPath(_0x3cdce5[_0x21def9(0x100)],_0x3cdce5['source'],pathToArray(_0x1d25b7+_0x21def9(0x173)))});if(!_0x1bdda4[_0x21def9(0x152)]||!Array[_0x21def9(0x13c)](_0x1bdda4[_0x21def9(0x152)]))return _0x47c04e[_0x21def9(0xe2)]({'level':'error','path':_0x1d25b7+_0x21def9(0x156),'code':'MISSING_CONDITIONS','message':_0x21def9(0x17a),'location':getLocationFromPath(_0x3cdce5[_0x21def9(0x100)],_0x3cdce5['source'],pathToArray(_0x1d25b7))}),_0x47c04e;for(let _0x3794a2=0x0;_0x3794a2<_0x1bdda4[_0x21def9(0x152)]['length'];_0x3794a2++){const _0x231f48=_0x1bdda4[_0x21def9(0x152)][_0x3794a2],_0x2bf7eb=_0x1d25b7+_0x21def9(0x175)+_0x3794a2+']';_0x47c04e[_0x21def9(0xe2)](...validateCondition(_0x231f48,_0x2bf7eb,_0x3cdce5));}return _0x47c04e;}function validateCondition(_0x44487d,_0x564324,_0x20a4eb){const _0x36f0b6=a125_0x37f070,_0x322c6b=[];if(!_0x44487d||typeof _0x44487d!==_0x36f0b6(0xd7))return _0x322c6b;if(_0x44487d[_0x36f0b6(0xf6)]==='And'||_0x44487d[_0x36f0b6(0xf6)]==='Or'){if(!_0x44487d[_0x36f0b6(0x152)]||!Array['isArray'](_0x44487d[_0x36f0b6(0x152)]))_0x322c6b[_0x36f0b6(0xe2)]({'level':_0x36f0b6(0x140),'path':_0x564324+'.conditions','code':_0x36f0b6(0x101),'message':_0x44487d[_0x36f0b6(0xf6)]+'\x20condition\x20must\x20have\x20a\x20conditions\x20array','location':getLocationFromPath(_0x20a4eb[_0x36f0b6(0x100)],_0x20a4eb[_0x36f0b6(0x164)],pathToArray(_0x564324))});else for(let _0x3f6984=0x0;_0x3f6984<_0x44487d[_0x36f0b6(0x152)]['length'];_0x3f6984++){_0x322c6b[_0x36f0b6(0xe2)](...validateCondition(_0x44487d[_0x36f0b6(0x152)][_0x3f6984],_0x564324+'.conditions['+_0x3f6984+']',_0x20a4eb));}return _0x322c6b;}if(_0x44487d[_0x36f0b6(0xf6)]===_0x36f0b6(0x18a)||_0x44487d['type']===_0x36f0b6(0xd8))return!_0x44487d['segment']&&_0x322c6b[_0x36f0b6(0xe2)]({'level':_0x36f0b6(0x140),'path':_0x564324+_0x36f0b6(0x124),'code':'MISSING_SEGMENT_REFERENCE','message':_0x44487d[_0x36f0b6(0xf6)]+_0x36f0b6(0xef),'location':getLocationFromPath(_0x20a4eb[_0x36f0b6(0x100)],_0x20a4eb[_0x36f0b6(0x164)],pathToArray(_0x564324))}),_0x322c6b;if(_0x44487d[_0x36f0b6(0xf6)]===_0x36f0b6(0xf5)||_0x44487d[_0x36f0b6(0xf6)]===_0x36f0b6(0x155)){const _0x23a553=_0x44487d,_0x3c15bc=_0x23a553[_0x36f0b6(0x164)],_0x407759=_0x23a553[_0x36f0b6(0x172)],_0xe7f76f=_0x3c15bc||_0x407759;(!_0x23a553['attribute']||_0x23a553[_0x36f0b6(0x146)]==='')&&!_0xe7f76f&&_0x322c6b[_0x36f0b6(0xe2)]({'level':'error','path':_0x564324+_0x36f0b6(0x12e),'code':_0x36f0b6(0xfb),'message':'Attribute\x20name\x20cannot\x20be\x20empty','location':getLocationFromPath(_0x20a4eb[_0x36f0b6(0x100)],_0x20a4eb[_0x36f0b6(0x164)],pathToArray(_0x564324+_0x36f0b6(0x12e)))}),_0x23a553[_0x36f0b6(0x16b)]&&_0x322c6b[_0x36f0b6(0xe2)](...validateOperator(_0x23a553[_0x36f0b6(0x16b)],_0x564324+_0x36f0b6(0xf2),_0x20a4eb)),_0x23a553[_0x36f0b6(0x159)]!==undefined&&_0x322c6b[_0x36f0b6(0xe2)](...validateArrayMatching(_0x23a553[_0x36f0b6(0x159)],_0x564324+'.arrayMatching',_0x20a4eb)),_0x23a553[_0x36f0b6(0x107)]&&_0x322c6b[_0x36f0b6(0xe2)](...validateRuleDef(_0x23a553[_0x36f0b6(0x107)],_0x564324+_0x36f0b6(0x15f),_0x20a4eb));}return _0x322c6b;}function validateOperator(_0x443fc5,_0x5295d9,_0x1cb951){const _0x193ab5=a125_0x37f070,_0x46cae9=[];if(!VALID_OPERATOR_TYPES[_0x193ab5(0x15d)](_0x443fc5['type']))return _0x46cae9[_0x193ab5(0xe2)]({'level':_0x193ab5(0x140),'path':_0x5295d9+_0x193ab5(0x173),'code':'INVALID_OPERATOR_TYPE','message':_0x193ab5(0x115)+_0x443fc5[_0x193ab5(0xf6)]+_0x193ab5(0x169)+[...VALID_OPERATOR_TYPES]['join'](',\x20'),'location':getLocationFromPath(_0x1cb951[_0x193ab5(0x100)],_0x1cb951[_0x193ab5(0x164)],pathToArray(_0x5295d9+_0x193ab5(0x173)))}),_0x46cae9;return OPERATORS_REQUIRING_VALUE[_0x193ab5(0x15d)](_0x443fc5[_0x193ab5(0xf6)])&&((_0x443fc5[_0x193ab5(0xfc)]===undefined||_0x443fc5['value']===null)&&_0x46cae9[_0x193ab5(0xe2)]({'level':_0x193ab5(0x140),'path':_0x5295d9+'.value','code':_0x193ab5(0x139),'message':_0x193ab5(0xf0)+_0x443fc5['type']+_0x193ab5(0x133),'location':getLocationFromPath(_0x1cb951[_0x193ab5(0x100)],_0x1cb951[_0x193ab5(0x164)],pathToArray(_0x5295d9))})),_0x443fc5[_0x193ab5(0xf6)]==='Between'&&(_0x443fc5[_0x193ab5(0xf8)]===undefined&&_0x443fc5[_0x193ab5(0x111)]===undefined&&_0x46cae9['push']({'level':_0x193ab5(0x140),'path':_0x5295d9,'code':_0x193ab5(0x126),'message':_0x193ab5(0x11e),'location':getLocationFromPath(_0x1cb951[_0x193ab5(0x100)],_0x1cb951['source'],pathToArray(_0x5295d9))})),OPERATORS_REQUIRING_UNIT[_0x193ab5(0x15d)](_0x443fc5[_0x193ab5(0xf6)])&&(!_0x443fc5['unit']&&_0x443fc5[_0x193ab5(0xfc)]!==undefined&&_0x46cae9[_0x193ab5(0xe2)]({'level':_0x193ab5(0x140),'path':_0x5295d9+'.unit','code':_0x193ab5(0x143),'message':_0x193ab5(0xf0)+_0x443fc5[_0x193ab5(0xf6)]+_0x193ab5(0xde),'location':getLocationFromPath(_0x1cb951[_0x193ab5(0x100)],_0x1cb951[_0x193ab5(0x164)],pathToArray(_0x5295d9))})),_0x46cae9;}function validateArrayMatching(_0x39702c,_0x54a87a,_0x31123c){const _0x5611e6=a125_0x37f070,_0x2ed4f8=[];if(_0x39702c===_0x5611e6(0x187)||_0x39702c===_0x5611e6(0x142))return _0x2ed4f8;if(typeof _0x39702c===_0x5611e6(0xd7)){const _0x153348=Object[_0x5611e6(0x108)](_0x39702c),_0x485aa6=[_0x5611e6(0x162),'atMost',_0x5611e6(0xf7)],_0x231fb7=_0x153348['some'](_0x20f5d5=>_0x485aa6[_0x5611e6(0x144)](_0x20f5d5));!_0x231fb7&&_0x2ed4f8['push']({'level':_0x5611e6(0x140),'path':_0x54a87a,'code':_0x5611e6(0x112),'message':_0x5611e6(0x145)+_0x485aa6[_0x5611e6(0x103)]('/')+'.','location':getLocationFromPath(_0x31123c['document'],_0x31123c['source'],pathToArray(_0x54a87a))});}else _0x2ed4f8['push']({'level':_0x5611e6(0x140),'path':_0x54a87a,'code':'INVALID_ARRAY_MATCHING','message':_0x5611e6(0x12d),'location':getLocationFromPath(_0x31123c[_0x5611e6(0x100)],_0x31123c[_0x5611e6(0x164)],pathToArray(_0x54a87a))});return _0x2ed4f8;}export function validateSegmentDef(_0x2fa13a,_0x318bff={}){const _0x73201=a125_0x37f070,_0x13cc49=[],_0x30fa1d=[];(!_0x2fa13a[_0x73201(0x138)]||_0x2fa13a['name']['trim']()==='')&&_0x13cc49[_0x73201(0xe2)]({'level':_0x73201(0x140),'path':_0x73201(0x138),'code':_0x73201(0x141),'message':'Segment\x20name\x20is\x20required','location':getLocationFromPath(_0x318bff[_0x73201(0x100)],_0x318bff['source'],[_0x73201(0x138)])});if(_0x2fa13a[_0x73201(0x123)]){const _0x389e4a=validateRuleDef(_0x2fa13a[_0x73201(0x123)],_0x73201(0x123),_0x318bff);for(const _0x552f89 of _0x389e4a){_0x552f89[_0x73201(0x157)]===_0x73201(0x140)?_0x13cc49[_0x73201(0xe2)](_0x552f89):_0x30fa1d[_0x73201(0xe2)](_0x552f89);}}return{'valid':_0x13cc49[_0x73201(0x122)]===0x0,'errors':_0x13cc49,'warnings':_0x30fa1d};}export function validateJourneyDef(_0x31e81a,_0x5503b4={}){const _0xb600e7=a125_0x37f070,_0x334f7f=[],_0x1f85a3=[];(!_0x31e81a['name']||_0x31e81a[_0xb600e7(0x138)][_0xb600e7(0x18d)]()==='')&&_0x334f7f[_0xb600e7(0xe2)]({'level':_0xb600e7(0x140),'path':_0xb600e7(0x138),'code':_0xb600e7(0x141),'message':_0xb600e7(0x110),'location':getLocationFromPath(_0x5503b4[_0xb600e7(0x100)],_0x5503b4[_0xb600e7(0x164)],[_0xb600e7(0x138)])});const _0x4005c5=new Set();if(_0x31e81a[_0xb600e7(0xdd)])for(const _0x3d6f56 of Object[_0xb600e7(0x108)](_0x31e81a['segments'])){_0x4005c5[_0xb600e7(0xdb)](_0x3d6f56);}const _0x3c7a06=new Set(),_0x36662d={..._0x5503b4,'embeddedSegments':_0x4005c5,'referencedSegments':_0x3c7a06};if(_0x31e81a['segments'])for(const [_0x4376d0,_0xcde72a]of Object[_0xb600e7(0x137)](_0x31e81a[_0xb600e7(0xdd)])){const _0x27bf1c=validateEmbeddedSegment(_0xcde72a,_0xb600e7(0x129)+_0x4376d0,_0x36662d);for(const _0x13df50 of _0x27bf1c){if(_0x13df50[_0xb600e7(0x157)]==='error')_0x334f7f['push'](_0x13df50);else _0x1f85a3[_0xb600e7(0xe2)](_0x13df50);}}const _0x227cdc=getJourneyStages(_0x31e81a);_0x227cdc[_0xb600e7(0x122)]===0x0&&_0x334f7f[_0xb600e7(0xe2)]({'level':_0xb600e7(0x140),'path':_0xb600e7(0x14f),'code':_0xb600e7(0x13e),'message':_0xb600e7(0xe7),'location':getLocationFromPath(_0x5503b4[_0xb600e7(0x100)],_0x5503b4[_0xb600e7(0x164)],['stages'])});const _0x3ffc9d=new Set();for(const _0x298981 of _0x227cdc){if(_0x298981[_0xb600e7(0x165)])for(const _0x1eaba5 of _0x298981['steps']){_0x1eaba5[_0xb600e7(0x138)]&&_0x3ffc9d[_0xb600e7(0xdb)](_0x1eaba5[_0xb600e7(0x138)]);}}_0x36662d['stepNames']=_0x3ffc9d;for(let _0x141b7a=0x0;_0x141b7a<_0x227cdc[_0xb600e7(0x122)];_0x141b7a++){const _0x5b2fc8=_0x227cdc[_0x141b7a],_0x4089d9='stages['+_0x141b7a+']',_0x29050b=validateStage(_0x5b2fc8,_0x4089d9,_0x36662d);for(const _0x5c9baf of _0x29050b){if(_0x5c9baf['level']===_0xb600e7(0x140))_0x334f7f['push'](_0x5c9baf);else _0x1f85a3['push'](_0x5c9baf);}}if(_0x31e81a[_0xb600e7(0xec)]){const _0x180ea6=validateCriteria(_0x31e81a[_0xb600e7(0xec)],_0xb600e7(0xec),_0x36662d);for(const _0x379b54 of _0x180ea6){if(_0x379b54[_0xb600e7(0x157)]===_0xb600e7(0x140))_0x334f7f[_0xb600e7(0xe2)](_0x379b54);else _0x1f85a3[_0xb600e7(0xe2)](_0x379b54);}}for(const _0x8962e9 of _0x4005c5){!_0x3c7a06[_0xb600e7(0x15d)](_0x8962e9)&&!_0x8962e9[_0xb600e7(0x120)](_0xb600e7(0x10e))&&_0x1f85a3[_0xb600e7(0xe2)]({'level':'warning','path':_0xb600e7(0x129)+_0x8962e9,'code':'UNUSED_EMBEDDED_SEGMENT','message':_0xb600e7(0x158)+_0x8962e9+_0xb600e7(0x14b),'location':getLocationFromPath(_0x5503b4[_0xb600e7(0x100)],_0x5503b4['source'],['segments',_0x8962e9])});}return{'valid':_0x334f7f[_0xb600e7(0x122)]===0x0,'errors':_0x334f7f,'warnings':_0x1f85a3};}function a125_0x4174(){const _0x1166b7=['referencedSegments','12rrhQKY','entries','name','MISSING_OPERATOR_VALUE','Greater','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','isArray','milestone','MISSING_STAGES','27bfLaOG','error','MISSING_NAME','all','MISSING_TIME_UNIT','includes','Invalid\x20arrayMatching.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20','attribute','197392ACVfvA','ref:','.with','.with.target','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','warnings','branches','stages','toString','.name','conditions','journeys','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','Behavior','.conditions','level','Embedded\x20segment\x20\x27','arrayMatching','INVALID_AB_TEST_PERCENTAGES','MISSING_ACTIVATION_REF','end','has','jump','.filter','target','red','atLeast','IsNull','source','steps','1692570NFLzhr','dim','message','\x27.\x20Valid\x20types:\x20','MISSING_SEGMENT_REFERENCE','operator','percentage','124884mkZtJI','reduce','11782276ZEYABm','abs','INVALID_RULE_TYPE','aggregation','.type','segment','.conditions[','activation','.milestone','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','.with.condition.timeout.next','Rule\x20must\x20have\x20a\x20conditions\x20array','Criteria\x20references\x20undefined\x20segment\x20\x27','NotEqual','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','.entry_criteria','.with.condition.segment','next','Between','Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','TimeWithinNext','INVALID_JUMP_TARGET','repeat','668540eWmcQw','any','Less','entry_criteria','include','column','.rule','trim','pop','Equal','object','exclude','.exit_criteria[','get','add','condition','segments','\x27\x20requires\x20a\x20time\x20unit','].next','timeout','versions','push','ab_test','\x27\x20(first\x20defined\x20at\x20steps[','301998deHkvI','INVALID_NEXT_REFERENCE','Journey\x20must\x20have\x20at\x20least\x20one\x20stage','range','Contain','.with.variants','TimeWithinPast','goal','Duplicate\x20step\x20name\x20\x27','path','\x20condition\x20must\x20have\x20a\x20segment\x20reference','Operator\x20\x27','EndWith','.operator','journey','variants','Value','type','exactly','min','.with.branches[','Wait\x20condition\x20references\x20non-existent\x20step\x20\x27','EMPTY_ATTRIBUTE','value','3xWlfUj','match','.next','document','MISSING_CONDITIONS','.with.condition.next','join','exit_criteria','set','Regexp','filter','keys','getIn','yellow','GreaterEqual','Jump\x20step\x20requires\x20a\x20target','split','excluded_','MISSING_WAIT_PARAMS','Journey\x20name\x20is\x20required','max','INVALID_ARRAY_MATCHING','StartWith','with','Invalid\x20operator\x20type\x20\x27','stepNames','cyan','DUPLICATE_STEP_NAME','contents','decision_point','excluded','And','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','Between\x20operator\x20requires\x20\x27min\x27\x20and/or\x20\x27max\x27\x20values','7KyxcNu','startsWith','734664kESGfc','length','rule','.segment','NotIn','MISSING_BETWEEN_BOUNDS','embeddedSegments','.with.variants[','segments.','TimeToday','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','LessEqual','Invalid\x20arrayMatching\x20value.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20atLeast/atMost/exactly.','.attribute','Rule\x20type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','location','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','flatMap','\x27\x20requires\x20a\x20value','80zYalAi'];a125_0x4174=function(){return _0x1166b7;};return a125_0x4174();}function getJourneyStages(_0x447066){const _0x10d7d3=a125_0x37f070;if(_0x447066[_0x10d7d3(0x14f)]&&_0x447066[_0x10d7d3(0x14f)][_0x10d7d3(0x122)]>0x0)return _0x447066[_0x10d7d3(0x14f)];if(_0x447066['journeys']&&_0x447066[_0x10d7d3(0x153)][_0x10d7d3(0x122)]>0x0)return _0x447066[_0x10d7d3(0x153)][_0x10d7d3(0x132)](_0x2c4b3f=>_0x2c4b3f[_0x10d7d3(0x14f)]||[]);if(_0x447066['versions']&&_0x447066[_0x10d7d3(0xe1)][_0x10d7d3(0x122)]>0x0)return _0x447066[_0x10d7d3(0xe1)][_0x10d7d3(0x132)](_0x21e133=>_0x21e133[_0x10d7d3(0x14f)]||[]);return[];}function validateEmbeddedSegment(_0x2ce675,_0x1759d5,_0x4a9ccf){const _0x3d4c62=a125_0x37f070,_0x202275=[];return _0x2ce675['rule']&&_0x202275[_0x3d4c62(0xe2)](...validateRuleDef(_0x2ce675[_0x3d4c62(0x123)],_0x1759d5+_0x3d4c62(0x18c),_0x4a9ccf)),_0x202275;}function validateStage(_0x2e4066,_0x18d1bc,_0x2b75e6){const _0x792415=a125_0x37f070,_0x90d405=[],_0x402f13=new Map();if(_0x2e4066[_0x792415(0x165)])for(let _0xcfc4cd=0x0;_0xcfc4cd<_0x2e4066[_0x792415(0x165)][_0x792415(0x122)];_0xcfc4cd++){const _0x51984a=_0x2e4066[_0x792415(0x165)][_0xcfc4cd],_0x1d514d=_0x18d1bc+'.steps['+_0xcfc4cd+']';if(_0x51984a[_0x792415(0x138)]){if(_0x402f13['has'](_0x51984a[_0x792415(0x138)])){const _0x2724a1=_0x402f13[_0x792415(0xda)](_0x51984a[_0x792415(0x138)]);_0x90d405[_0x792415(0xe2)]({'level':_0x792415(0x140),'path':_0x1d514d+_0x792415(0x151),'code':_0x792415(0x118),'message':_0x792415(0xed)+_0x51984a['name']+_0x792415(0xe4)+_0x2724a1+'])','location':getLocationFromPath(_0x2b75e6[_0x792415(0x100)],_0x2b75e6['source'],pathToArray(_0x1d514d+_0x792415(0x151)))});}else _0x402f13[_0x792415(0x105)](_0x51984a['name'],_0xcfc4cd);}_0x90d405[_0x792415(0xe2)](...validateStep(_0x51984a,_0x1d514d,_0x2b75e6));}_0x2e4066[_0x792415(0x189)]&&_0x90d405[_0x792415(0xe2)](...validateCriteria(_0x2e4066[_0x792415(0x189)],_0x18d1bc+_0x792415(0x17e),_0x2b75e6));if(_0x2e4066['exit_criteria'])for(let _0x255b83=0x0;_0x255b83<_0x2e4066[_0x792415(0x104)][_0x792415(0x122)];_0x255b83++){_0x90d405[_0x792415(0xe2)](...validateCriteria(_0x2e4066[_0x792415(0x104)][_0x255b83],_0x18d1bc+_0x792415(0xd9)+_0x255b83+']',_0x2b75e6));}return _0x2e4066['milestone']&&_0x90d405[_0x792415(0xe2)](...validateCriteria(_0x2e4066[_0x792415(0x13d)],_0x18d1bc+_0x792415(0x177),_0x2b75e6)),_0x90d405;}function validateStep(_0xdd1aa2,_0x28554d,_0x201e2e){const _0x1a9c52=a125_0x37f070,_0x455ae5=[];_0xdd1aa2['next']&&_0xdd1aa2[_0x1a9c52(0xf6)]!==_0x1a9c52(0x15c)&&(_0x201e2e['stepNames']&&!_0x201e2e[_0x1a9c52(0x116)][_0x1a9c52(0x15d)](_0xdd1aa2[_0x1a9c52(0x180)])&&_0x455ae5[_0x1a9c52(0xe2)]({'level':'error','path':_0x28554d+_0x1a9c52(0xff),'code':_0x1a9c52(0xe6),'message':'Step\x20references\x20non-existent\x20step\x20\x27'+_0xdd1aa2[_0x1a9c52(0x180)]+'\x27','location':getLocationFromPath(_0x201e2e[_0x1a9c52(0x100)],_0x201e2e[_0x1a9c52(0x164)],pathToArray(_0x28554d+_0x1a9c52(0xff)))}));switch(_0xdd1aa2[_0x1a9c52(0xf6)]){case'wait':_0x455ae5[_0x1a9c52(0xe2)](...validateWaitStep(_0xdd1aa2,_0x28554d,_0x201e2e));break;case'activation':_0x455ae5[_0x1a9c52(0xe2)](...validateActivationStep(_0xdd1aa2,_0x28554d,_0x201e2e));break;case _0x1a9c52(0x11a):_0x455ae5['push'](...validateDecisionPointStep(_0xdd1aa2,_0x28554d,_0x201e2e));break;case _0x1a9c52(0xe3):_0x455ae5[_0x1a9c52(0xe2)](...validateAbTestStep(_0xdd1aa2,_0x28554d,_0x201e2e));break;case _0x1a9c52(0x15e):_0x455ae5[_0x1a9c52(0xe2)](...validateJumpStep(_0xdd1aa2,_0x28554d,_0x201e2e));break;}return _0x455ae5;}function validateWaitStep(_0x4caad1,_0x404e6f,_0x4852a8){const _0xcca3c6=a125_0x37f070,_0x3513b1=[];if(!_0x4caad1[_0xcca3c6(0x114)])return _0x3513b1[_0xcca3c6(0xe2)]({'level':_0xcca3c6(0x140),'path':_0x404e6f+_0xcca3c6(0x149),'code':_0xcca3c6(0x10f),'message':_0xcca3c6(0x17d),'location':getLocationFromPath(_0x4852a8[_0xcca3c6(0x100)],_0x4852a8['source'],pathToArray(_0x404e6f))}),_0x3513b1;if(_0x4caad1[_0xcca3c6(0x114)][_0xcca3c6(0xdc)]){const _0x2e323c=_0x4caad1[_0xcca3c6(0x114)][_0xcca3c6(0xdc)];_0x2e323c[_0xcca3c6(0x174)]&&(_0x4852a8[_0xcca3c6(0x135)]?.[_0xcca3c6(0xdb)](_0x2e323c[_0xcca3c6(0x174)]),!_0x2e323c['segment']['startsWith'](_0xcca3c6(0x148))&&(_0x4852a8[_0xcca3c6(0x127)]&&!_0x4852a8[_0xcca3c6(0x127)]['has'](_0x2e323c['segment'])&&_0x3513b1[_0xcca3c6(0xe2)]({'level':_0xcca3c6(0x140),'path':_0x404e6f+_0xcca3c6(0x17f),'code':_0xcca3c6(0x16a),'message':'Wait\x20condition\x20references\x20undefined\x20segment\x20\x27'+_0x2e323c[_0xcca3c6(0x174)]+'\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','location':getLocationFromPath(_0x4852a8[_0xcca3c6(0x100)],_0x4852a8['source'],pathToArray(_0x404e6f+_0xcca3c6(0x17f)))})),_0x2e323c[_0xcca3c6(0x180)]&&_0x4852a8['stepNames']&&!_0x4852a8[_0xcca3c6(0x116)]['has'](_0x2e323c['next'])&&_0x3513b1[_0xcca3c6(0xe2)]({'level':_0xcca3c6(0x140),'path':_0x404e6f+_0xcca3c6(0x102),'code':_0xcca3c6(0xe6),'message':_0xcca3c6(0xfa)+_0x2e323c[_0xcca3c6(0x180)]+'\x27','location':getLocationFromPath(_0x4852a8[_0xcca3c6(0x100)],_0x4852a8['source'],pathToArray(_0x404e6f+_0xcca3c6(0x102)))}),_0x2e323c['timeout']?.[_0xcca3c6(0x180)]&&_0x4852a8[_0xcca3c6(0x116)]&&!_0x4852a8[_0xcca3c6(0x116)]['has'](_0x2e323c[_0xcca3c6(0xe0)][_0xcca3c6(0x180)])&&_0x3513b1[_0xcca3c6(0xe2)]({'level':_0xcca3c6(0x140),'path':_0x404e6f+_0xcca3c6(0x179),'code':_0xcca3c6(0xe6),'message':_0xcca3c6(0x12b)+_0x2e323c[_0xcca3c6(0xe0)][_0xcca3c6(0x180)]+'\x27','location':getLocationFromPath(_0x4852a8[_0xcca3c6(0x100)],_0x4852a8[_0xcca3c6(0x164)],pathToArray(_0x404e6f+_0xcca3c6(0x179)))}));}return _0x3513b1;}function validateActivationStep(_0x5c5714,_0x1aee3c,_0xf35d47){const _0x8369c1=a125_0x37f070,_0x3591e0=[];return!_0x5c5714[_0x8369c1(0x114)]?.[_0x8369c1(0x176)]&&_0x3591e0[_0x8369c1(0xe2)]({'level':'error','path':_0x1aee3c+'.with.activation','code':_0x8369c1(0x15b),'message':'Activation\x20step\x20requires\x20an\x20activation\x20reference','location':getLocationFromPath(_0xf35d47[_0x8369c1(0x100)],_0xf35d47['source'],pathToArray(_0x1aee3c))}),_0x3591e0;}function validateDecisionPointStep(_0x34953d,_0x3db2d1,_0x3a97b6){const _0x4b4663=a125_0x37f070,_0x13751f=[];if(!_0x34953d[_0x4b4663(0x114)]?.[_0x4b4663(0x14e)]||_0x34953d['with']['branches'][_0x4b4663(0x122)]===0x0)return _0x13751f['push']({'level':_0x4b4663(0x140),'path':_0x3db2d1+'.with.branches','code':_0x4b4663(0x101),'message':_0x4b4663(0x13b),'location':getLocationFromPath(_0x3a97b6[_0x4b4663(0x100)],_0x3a97b6['source'],pathToArray(_0x3db2d1))}),_0x13751f;for(let _0x319398=0x0;_0x319398<_0x34953d[_0x4b4663(0x114)][_0x4b4663(0x14e)]['length'];_0x319398++){const _0x599c1a=_0x34953d[_0x4b4663(0x114)]['branches'][_0x319398],_0x1da47b=_0x3db2d1+_0x4b4663(0xf9)+_0x319398+']';_0x599c1a[_0x4b4663(0x174)]&&!_0x599c1a[_0x4b4663(0x11b)]&&(_0x3a97b6['referencedSegments']?.[_0x4b4663(0xdb)](_0x599c1a[_0x4b4663(0x174)]),!_0x599c1a['segment'][_0x4b4663(0x120)]('ref:')&&(_0x3a97b6[_0x4b4663(0x127)]&&!_0x3a97b6[_0x4b4663(0x127)]['has'](_0x599c1a[_0x4b4663(0x174)])&&_0x13751f[_0x4b4663(0xe2)]({'level':'error','path':_0x1da47b+_0x4b4663(0x124),'code':_0x4b4663(0x16a),'message':_0x4b4663(0x11d)+_0x599c1a[_0x4b4663(0x174)]+'\x27','location':getLocationFromPath(_0x3a97b6['document'],_0x3a97b6[_0x4b4663(0x164)],pathToArray(_0x1da47b+_0x4b4663(0x124)))}))),_0x599c1a[_0x4b4663(0x180)]&&_0x3a97b6[_0x4b4663(0x116)]&&!_0x3a97b6[_0x4b4663(0x116)][_0x4b4663(0x15d)](_0x599c1a[_0x4b4663(0x180)])&&_0x13751f[_0x4b4663(0xe2)]({'level':'error','path':_0x1da47b+'.next','code':_0x4b4663(0xe6),'message':_0x4b4663(0x131)+_0x599c1a['next']+'\x27','location':getLocationFromPath(_0x3a97b6[_0x4b4663(0x100)],_0x3a97b6[_0x4b4663(0x164)],pathToArray(_0x1da47b+_0x4b4663(0xff)))});}return _0x13751f;}function validateAbTestStep(_0x231e58,_0x41ae7c,_0x48fd44){const _0x56e161=a125_0x37f070,_0x40799b=[];if(!_0x231e58['with']?.[_0x56e161(0xf4)]||_0x231e58['with'][_0x56e161(0xf4)]['length']===0x0)return _0x40799b[_0x56e161(0xe2)]({'level':'error','path':_0x41ae7c+_0x56e161(0xea),'code':_0x56e161(0x101),'message':_0x56e161(0x154),'location':getLocationFromPath(_0x48fd44[_0x56e161(0x100)],_0x48fd44[_0x56e161(0x164)],pathToArray(_0x41ae7c))}),_0x40799b;const _0x29aa5e=_0x231e58[_0x56e161(0x114)]['variants'][_0x56e161(0x16e)]((_0xe3c3e2,_0x4ea813)=>_0xe3c3e2+(_0x4ea813[_0x56e161(0x16c)]||0x0),0x0);Math[_0x56e161(0x170)](_0x29aa5e-0x64)>0.01&&_0x40799b[_0x56e161(0xe2)]({'level':_0x56e161(0x140),'path':_0x41ae7c+'.with.variants','code':_0x56e161(0x15a),'message':_0x56e161(0x14c)+_0x29aa5e+'%)','location':getLocationFromPath(_0x48fd44['document'],_0x48fd44[_0x56e161(0x164)],pathToArray(_0x41ae7c+_0x56e161(0xea)))});for(let _0x19fa7b=0x0;_0x19fa7b<_0x231e58['with'][_0x56e161(0xf4)][_0x56e161(0x122)];_0x19fa7b++){const _0x4a8bed=_0x231e58[_0x56e161(0x114)][_0x56e161(0xf4)][_0x19fa7b];_0x4a8bed[_0x56e161(0x180)]&&_0x48fd44[_0x56e161(0x116)]&&!_0x48fd44[_0x56e161(0x116)][_0x56e161(0x15d)](_0x4a8bed[_0x56e161(0x180)])&&_0x40799b['push']({'level':_0x56e161(0x140),'path':_0x41ae7c+_0x56e161(0x128)+_0x19fa7b+_0x56e161(0xdf),'code':_0x56e161(0xe6),'message':_0x56e161(0x178)+_0x4a8bed[_0x56e161(0x180)]+'\x27','location':getLocationFromPath(_0x48fd44[_0x56e161(0x100)],_0x48fd44['source'],pathToArray(_0x41ae7c+'.with.variants['+_0x19fa7b+_0x56e161(0xdf)))});}return _0x40799b;}function validateJumpStep(_0x5964ee,_0xf6dc80,_0x172b5e){const _0x4772c7=a125_0x37f070,_0x66e7f3=[];if(!_0x5964ee[_0x4772c7(0x114)]?.[_0x4772c7(0x160)])return _0x66e7f3[_0x4772c7(0xe2)]({'level':_0x4772c7(0x140),'path':_0xf6dc80+_0x4772c7(0x14a),'code':_0x4772c7(0x184),'message':_0x4772c7(0x10c),'location':getLocationFromPath(_0x172b5e[_0x4772c7(0x100)],_0x172b5e[_0x4772c7(0x164)],pathToArray(_0xf6dc80))}),_0x66e7f3;return(!_0x5964ee[_0x4772c7(0x114)]['target'][_0x4772c7(0xf3)]||!_0x5964ee['with'][_0x4772c7(0x160)]['stage'])&&_0x66e7f3[_0x4772c7(0xe2)]({'level':'error','path':_0xf6dc80+_0x4772c7(0x14a),'code':_0x4772c7(0x184),'message':_0x4772c7(0x182),'location':getLocationFromPath(_0x172b5e['document'],_0x172b5e[_0x4772c7(0x164)],pathToArray(_0xf6dc80+'.with.target'))}),_0x66e7f3;}function validateCriteria(_0x7fd6ad,_0x37aaa6,_0x32c24a){const _0x47cca2=a125_0x37f070,_0x8842d7=[];return _0x7fd6ad['segment']&&(_0x32c24a[_0x47cca2(0x135)]?.[_0x47cca2(0xdb)](_0x7fd6ad['segment']),!_0x7fd6ad[_0x47cca2(0x174)][_0x47cca2(0x120)](_0x47cca2(0x148))&&(_0x32c24a[_0x47cca2(0x127)]&&!_0x32c24a[_0x47cca2(0x127)]['has'](_0x7fd6ad[_0x47cca2(0x174)])&&_0x8842d7[_0x47cca2(0xe2)]({'level':_0x47cca2(0x140),'path':_0x37aaa6+_0x47cca2(0x124),'code':_0x47cca2(0x16a),'message':_0x47cca2(0x17b)+_0x7fd6ad[_0x47cca2(0x174)]+'\x27','location':getLocationFromPath(_0x32c24a[_0x47cca2(0x100)],_0x32c24a[_0x47cca2(0x164)],pathToArray(_0x37aaa6+_0x47cca2(0x124)))}))),_0x8842d7;}export function formatIssueWithContext(_0x2262f4,_0x4cef38,_0x1a25ab){const _0x119c5a=a125_0x37f070,_0x5c99e0=[],_0x2f202a=_0x2262f4[_0x119c5a(0x157)]===_0x119c5a(0x140),_0xa7d57e=_0x2f202a?a125_0x43e021[_0x119c5a(0x161)]:a125_0x43e021[_0x119c5a(0x10a)],_0x5d08f3=_0x2f202a?a125_0x43e021['red']:a125_0x43e021['yellow'],_0x59cb3f=_0x1a25ab?a125_0x43e021[_0x119c5a(0x117)](_0x1a25ab+':'):'';if(_0x2262f4[_0x119c5a(0x130)]){const _0x407974=a125_0x43e021[_0x119c5a(0x117)](_0x2262f4[_0x119c5a(0x130)]['line']+':'+_0x2262f4[_0x119c5a(0x130)][_0x119c5a(0x18b)]);_0x5c99e0[_0x119c5a(0xe2)](''+_0x59cb3f+_0x407974+':\x20'+_0xa7d57e(_0x2262f4['level'])+'\x20'+_0x5d08f3('['+_0x2262f4['code']+']'));}else _0x5c99e0[_0x119c5a(0xe2)](''+_0x59cb3f+a125_0x43e021['dim'](_0x2262f4[_0x119c5a(0xee)])+':\x20'+_0xa7d57e(_0x2262f4[_0x119c5a(0x157)])+'\x20'+_0x5d08f3('['+_0x2262f4['code']+']'));_0x5c99e0[_0x119c5a(0xe2)](_0x2262f4[_0x119c5a(0x168)]);if(_0x2262f4[_0x119c5a(0x130)]&&_0x4cef38){const _0xf2bef8=_0x4cef38[_0x119c5a(0x10d)]('\x0a'),{line:_0x109dfb,column:_0x294c0e}=_0x2262f4[_0x119c5a(0x130)],_0x3e6b76=Math[_0x119c5a(0x111)](0x1,_0x109dfb-0x1),_0x50552e=Math[_0x119c5a(0xf8)](_0xf2bef8[_0x119c5a(0x122)],_0x109dfb+0x1);_0x5c99e0[_0x119c5a(0xe2)]('');for(let _0x344c3a=_0x3e6b76;_0x344c3a<=_0x50552e;_0x344c3a++){const _0x17cdc3=_0xf2bef8[_0x344c3a-0x1]||'',_0x1eb498=a125_0x43e021[_0x119c5a(0x167)](_0x344c3a[_0x119c5a(0x150)]()['padStart'](0x4)),_0x5a069f=a125_0x43e021[_0x119c5a(0x167)]('\x20|\x20');if(_0x344c3a===_0x109dfb){_0x5c99e0[_0x119c5a(0xe2)]('\x20\x20'+_0x1eb498+_0x5a069f+_0xa7d57e(_0x17cdc3));const _0x40f5c0='\x20'[_0x119c5a(0x185)](0x4+0x3+_0x294c0e-0x1);_0x5c99e0['push']('\x20\x20'+_0x40f5c0+_0xa7d57e('^'));}else _0x5c99e0[_0x119c5a(0xe2)]('\x20\x20'+_0x1eb498+_0x5a069f+a125_0x43e021['dim'](_0x17cdc3));}}return _0x5c99e0[_0x119c5a(0x103)]('\x0a');}export function formatValidationResult(_0x179a71,_0x422f43,_0x8ea37d){const _0x421cce=a125_0x37f070,_0x25829c=[];for(const _0x8e315b of _0x179a71['errors']){_0x25829c[_0x421cce(0xe2)](formatIssueWithContext(_0x8e315b,_0x422f43,_0x8ea37d)),_0x25829c['push']('');}for(const _0x438e9b of _0x179a71[_0x421cce(0x14d)]){_0x25829c[_0x421cce(0xe2)](formatIssueWithContext(_0x438e9b,_0x422f43,_0x8ea37d)),_0x25829c[_0x421cce(0xe2)]('');}return _0x25829c['join']('\x0a');}
|
|
1
|
+
const a125_0x33d555=a125_0x3403;function a125_0x4290(){const _0x3cd604=['journeys','MISSING_OPERATOR_VALUE','LessEqual','yellow','A/B\x20test\x20requires\x20at\x20least\x20one\x20variant','Invalid\x20arrayMatching.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20','filter','startsWith','.with.condition.segment','.conditions[','Invalid\x20arrayMatching\x20value.\x20Expected\x20\x27any\x27,\x20\x27all\x27,\x20or\x20object\x20with\x20atLeast/atMost/exactly.','INVALID_AB_TEST_PERCENTAGES','MISSING_TIME_UNIT','MISSING_STAGES','\x20condition\x20must\x20have\x20a\x20segment\x20reference','Regexp','operator','location','.next','source','.exit_criteria[','.with.branches[','min','INVALID_ARRAY_MATCHING','.entry_criteria','atMost','Embedded\x20segment\x20\x27','push','stages','document','4vOLXHY','\x27\x20requires\x20a\x20value','type','rule','Decision\x20point\x20requires\x20at\x20least\x20one\x20branch','Decision\x20branch\x20references\x20undefined\x20segment\x20\x27','\x20condition\x20must\x20have\x20a\x20conditions\x20array','TimeWithinNext','activation','.name','abs','steps','Step\x20references\x20non-existent\x20step\x20\x27','Greater','includes','pop','Decision\x20branch\x20references\x20non-existent\x20step\x20\x27','Wait\x20step\x20requires\x20parameters\x20in\x20\x22with\x22\x20field','MISSING_BETWEEN_BOUNDS','condition','28wNulYl','.conditions','warning','Journey\x20name\x20is\x20required','include','error','set','timeout','entry_criteria','column','repeat','MISSING_ACTIVATION_REF','ref:','Rule\x20type\x20must\x20be\x20\x27And\x27\x20or\x20\x27Or\x27,\x20got\x20\x27','segments','cyan','A/B\x20test\x20variant\x20percentages\x20must\x20sum\x20to\x20100%\x20(got\x20','red','stages[','attribute','conditions','journey','get','\x27\x20is\x20defined\x20but\x20not\x20referenced\x20in\x20the\x20journey','match','2498800libKTm','Invalid\x20operator\x20type\x20\x27','padStart','.with.condition.timeout.next','\x27\x20requires\x20a\x20time\x20unit','code','join','\x27.\x20Valid\x20types:\x20','.type','Operator\x20\x27','.with.condition.next','isArray','path','.rule','NotEqual','NotIn','branches','].next','MISSING_NAME','entries','325044lDLZUP','has','IsNull','.with.target','keys','A/B\x20test\x20variant\x20references\x20non-existent\x20step\x20\x27','flatMap','variants','contents','message','segment','referencedSegments','Attribute\x20name\x20cannot\x20be\x20empty','range','.steps[','target','exit_criteria','value','with','1589814Ozfhfo','Equal','excluded_','arrayMatching','milestone','reduce','GreaterEqual','INVALID_RULE_TYPE','line','Activation\x20step\x20requires\x20an\x20activation\x20reference','.with.branches','143730RwcLHr','all','next','.with.variants[','ab_test','object','Wait\x20timeout\x20references\x20non-existent\x20step\x20\x27','trim','And','Between','110eqassX','max','versions','UNUSED_EMBEDDED_SEGMENT','split','length','EndWith','83664ulURyd','DUPLICATE_STEP_NAME','Wait\x20condition\x20references\x20undefined\x20segment\x20\x27','level','atLeast','INVALID_JUMP_TARGET','stage','embeddedSegments','MISSING_SEGMENT_REFERENCE','.value','goal','Criteria\x20references\x20undefined\x20segment\x20\x27','.segment','MISSING_CONDITIONS','EMPTY_ATTRIBUTE','\x27\x20(first\x20defined\x20at\x20steps[','.attribute','1905069xPBdYH','percentage','warnings','Contain','dim','name','.milestone','excluded','stepNames','Jump\x20step\x20requires\x20a\x20target','TimeWithinPast','add','INVALID_NEXT_REFERENCE','764348KKAYWd','getIn'];a125_0x4290=function(){return _0x3cd604;};return a125_0x4290();}(function(_0x3e631c,_0x542c2c){const _0x67028f=a125_0x3403,_0x3c2e65=_0x3e631c();while(!![]){try{const _0x2a01a4=-parseInt(_0x67028f(0xfd))/0x1+parseInt(_0x67028f(0x7e))/0x2+-parseInt(_0x67028f(0x11f))/0x3+-parseInt(_0x67028f(0x9e))/0x4*(parseInt(_0x67028f(0xcb))/0x5)+-parseInt(_0x67028f(0xf2))/0x6*(-parseInt(_0x67028f(0xb2))/0x7)+parseInt(_0x67028f(0x10e))/0x8+parseInt(_0x67028f(0xdf))/0x9*(parseInt(_0x67028f(0x107))/0xa);if(_0x2a01a4===_0x542c2c)break;else _0x3c2e65['push'](_0x3c2e65['shift']());}catch(_0x27f438){_0x3c2e65['push'](_0x3c2e65['shift']());}}}(a125_0x4290,0x8b787));import a125_0x864d20 from'chalk';const VALID_OPERATOR_TYPES=new Set([a125_0x33d555(0xf3),a125_0x33d555(0xd9),'Greater',a125_0x33d555(0xf8),'Less','LessEqual','In',a125_0x33d555(0xda),a125_0x33d555(0x122),'StartWith',a125_0x33d555(0x10d),a125_0x33d555(0x8f),a125_0x33d555(0xe1),'TimeWithinPast','TimeWithinNext','TimeRange','TimeToday',a125_0x33d555(0x106)]),OPERATORS_REQUIRING_VALUE=new Set([a125_0x33d555(0xf3),'NotEqual',a125_0x33d555(0xab),a125_0x33d555(0xf8),'Less',a125_0x33d555(0x82),'In',a125_0x33d555(0xda),a125_0x33d555(0x122),'StartWith',a125_0x33d555(0x10d),'Regexp',a125_0x33d555(0x129),'TimeWithinNext']),OPERATORS_REQUIRING_UNIT=new Set(['TimeWithinPast',a125_0x33d555(0xa5)]);export function getLocationFromPath(_0x3489e3,_0x56c3ff,_0x594b79){const _0x3d9ec7=a125_0x33d555;if(!_0x3489e3||!_0x56c3ff)return undefined;try{let _0x2dd8b7=_0x3489e3['getIn'](_0x594b79,!![]),_0x4467a2=[..._0x594b79];while((!_0x2dd8b7||typeof _0x2dd8b7!=='object'||!(_0x3d9ec7(0xec)in _0x2dd8b7)||!_0x2dd8b7[_0x3d9ec7(0xec)])&&_0x4467a2[_0x3d9ec7(0x10c)]>0x0){_0x4467a2[_0x3d9ec7(0xad)](),_0x2dd8b7=_0x4467a2['length']>0x0?_0x3489e3[_0x3d9ec7(0x7f)](_0x4467a2,!![]):_0x3489e3[_0x3d9ec7(0xe7)];}if(!_0x2dd8b7||typeof _0x2dd8b7!=='object'||!(_0x3d9ec7(0xec)in _0x2dd8b7)||!_0x2dd8b7['range'])return undefined;const [_0x4004a2]=_0x2dd8b7['range'];return offsetToLocation(_0x56c3ff,_0x4004a2);}catch{return undefined;}}export function offsetToLocation(_0x5b0a0e,_0x41abd0){let _0x40e036=0x1,_0x1212d7=0x1;for(let _0x45f356=0x0;_0x45f356<_0x41abd0&&_0x45f356<_0x5b0a0e['length'];_0x45f356++){_0x5b0a0e[_0x45f356]==='\x0a'?(_0x40e036++,_0x1212d7=0x1):_0x1212d7++;}return{'line':_0x40e036,'column':_0x1212d7,'offset':_0x41abd0};}function pathToArray(_0x31a1f9){const _0x448c64=a125_0x33d555;if(!_0x31a1f9)return[];return _0x31a1f9['split']('.')[_0x448c64(0xe5)](_0x2b8512=>{const _0x13e21d=_0x448c64,_0x30ff69=_0x2b8512[_0x13e21d(0xca)](/^(\w+)\[(\d+)\]$/);if(_0x30ff69)return[_0x30ff69[0x1],parseInt(_0x30ff69[0x2],0xa)];return[_0x2b8512];});}export function validateRuleDef(_0x3b1525,_0x54c3ec,_0x195630){const _0x4e15d1=a125_0x33d555,_0x4473c0=[];if(!_0x3b1525)return _0x4473c0;_0x3b1525[_0x4e15d1(0xa0)]!=='And'&&_0x3b1525[_0x4e15d1(0xa0)]!=='Or'&&_0x4473c0['push']({'level':'error','path':_0x54c3ec+'.type','code':_0x4e15d1(0xf9),'message':_0x4e15d1(0xbf)+_0x3b1525[_0x4e15d1(0xa0)]+'\x27','location':getLocationFromPath(_0x195630['document'],_0x195630[_0x4e15d1(0x93)],pathToArray(_0x54c3ec+'.type'))});if(!_0x3b1525['conditions']||!Array[_0x4e15d1(0xd6)](_0x3b1525[_0x4e15d1(0xc6)]))return _0x4473c0['push']({'level':_0x4e15d1(0xb7),'path':_0x54c3ec+_0x4e15d1(0xb3),'code':_0x4e15d1(0x11b),'message':'Rule\x20must\x20have\x20a\x20conditions\x20array','location':getLocationFromPath(_0x195630['document'],_0x195630[_0x4e15d1(0x93)],pathToArray(_0x54c3ec))}),_0x4473c0;for(let _0x53f737=0x0;_0x53f737<_0x3b1525[_0x4e15d1(0xc6)]['length'];_0x53f737++){const _0xde16aa=_0x3b1525[_0x4e15d1(0xc6)][_0x53f737],_0x106ca5=_0x54c3ec+'.conditions['+_0x53f737+']';_0x4473c0[_0x4e15d1(0x9b)](...validateCondition(_0xde16aa,_0x106ca5,_0x195630));}return _0x4473c0;}function validateCondition(_0x53c821,_0x375147,_0x4d4043){const _0x2238bc=a125_0x33d555,_0x3195dc=[];if(!_0x53c821||typeof _0x53c821!==_0x2238bc(0x102))return _0x3195dc;if(_0x53c821[_0x2238bc(0xa0)]===_0x2238bc(0x105)||_0x53c821['type']==='Or'){if(!_0x53c821[_0x2238bc(0xc6)]||!Array[_0x2238bc(0xd6)](_0x53c821[_0x2238bc(0xc6)]))_0x3195dc[_0x2238bc(0x9b)]({'level':_0x2238bc(0xb7),'path':_0x375147+_0x2238bc(0xb3),'code':'MISSING_CONDITIONS','message':_0x53c821[_0x2238bc(0xa0)]+_0x2238bc(0xa4),'location':getLocationFromPath(_0x4d4043[_0x2238bc(0x9d)],_0x4d4043['source'],pathToArray(_0x375147))});else for(let _0x49a7a2=0x0;_0x49a7a2<_0x53c821['conditions'][_0x2238bc(0x10c)];_0x49a7a2++){_0x3195dc[_0x2238bc(0x9b)](...validateCondition(_0x53c821[_0x2238bc(0xc6)][_0x49a7a2],_0x375147+_0x2238bc(0x89)+_0x49a7a2+']',_0x4d4043));}return _0x3195dc;}if(_0x53c821[_0x2238bc(0xa0)]===_0x2238bc(0xb6)||_0x53c821['type']==='exclude')return!_0x53c821[_0x2238bc(0xe9)]&&_0x3195dc[_0x2238bc(0x9b)]({'level':_0x2238bc(0xb7),'path':_0x375147+_0x2238bc(0x11a),'code':'MISSING_SEGMENT_REFERENCE','message':_0x53c821[_0x2238bc(0xa0)]+_0x2238bc(0x8e),'location':getLocationFromPath(_0x4d4043[_0x2238bc(0x9d)],_0x4d4043[_0x2238bc(0x93)],pathToArray(_0x375147))}),_0x3195dc;if(_0x53c821[_0x2238bc(0xa0)]==='Value'||_0x53c821['type']==='Behavior'){const _0x48ab7e=_0x53c821,_0x5ad903=_0x48ab7e[_0x2238bc(0x93)],_0x3738f9=_0x48ab7e['aggregation'],_0x246a4d=_0x5ad903||_0x3738f9;(!_0x48ab7e[_0x2238bc(0xc5)]||_0x48ab7e[_0x2238bc(0xc5)]==='')&&!_0x246a4d&&_0x3195dc[_0x2238bc(0x9b)]({'level':_0x2238bc(0xb7),'path':_0x375147+'.attribute','code':_0x2238bc(0x11c),'message':_0x2238bc(0xeb),'location':getLocationFromPath(_0x4d4043[_0x2238bc(0x9d)],_0x4d4043['source'],pathToArray(_0x375147+_0x2238bc(0x11e)))}),_0x48ab7e[_0x2238bc(0x90)]&&_0x3195dc[_0x2238bc(0x9b)](...validateOperator(_0x48ab7e[_0x2238bc(0x90)],_0x375147+'.operator',_0x4d4043)),_0x48ab7e[_0x2238bc(0xf5)]!==undefined&&_0x3195dc[_0x2238bc(0x9b)](...validateArrayMatching(_0x48ab7e[_0x2238bc(0xf5)],_0x375147+'.arrayMatching',_0x4d4043)),_0x48ab7e[_0x2238bc(0x86)]&&_0x3195dc['push'](...validateRuleDef(_0x48ab7e[_0x2238bc(0x86)],_0x375147+'.filter',_0x4d4043));}return _0x3195dc;}function validateOperator(_0x28fe7a,_0x44f2c6,_0x4c1ce9){const _0x594c63=a125_0x33d555,_0x453470=[];if(!VALID_OPERATOR_TYPES[_0x594c63(0xe0)](_0x28fe7a['type']))return _0x453470[_0x594c63(0x9b)]({'level':'error','path':_0x44f2c6+_0x594c63(0xd3),'code':'INVALID_OPERATOR_TYPE','message':_0x594c63(0xcc)+_0x28fe7a['type']+_0x594c63(0xd2)+[...VALID_OPERATOR_TYPES][_0x594c63(0xd1)](',\x20'),'location':getLocationFromPath(_0x4c1ce9['document'],_0x4c1ce9[_0x594c63(0x93)],pathToArray(_0x44f2c6+_0x594c63(0xd3)))}),_0x453470;return OPERATORS_REQUIRING_VALUE[_0x594c63(0xe0)](_0x28fe7a[_0x594c63(0xa0)])&&((_0x28fe7a['value']===undefined||_0x28fe7a[_0x594c63(0xf0)]===null)&&_0x453470[_0x594c63(0x9b)]({'level':_0x594c63(0xb7),'path':_0x44f2c6+_0x594c63(0x117),'code':_0x594c63(0x81),'message':_0x594c63(0xd4)+_0x28fe7a[_0x594c63(0xa0)]+_0x594c63(0x9f),'location':getLocationFromPath(_0x4c1ce9[_0x594c63(0x9d)],_0x4c1ce9[_0x594c63(0x93)],pathToArray(_0x44f2c6))})),_0x28fe7a[_0x594c63(0xa0)]===_0x594c63(0x106)&&(_0x28fe7a[_0x594c63(0x96)]===undefined&&_0x28fe7a[_0x594c63(0x108)]===undefined&&_0x453470[_0x594c63(0x9b)]({'level':_0x594c63(0xb7),'path':_0x44f2c6,'code':_0x594c63(0xb0),'message':'Between\x20operator\x20requires\x20\x27min\x27\x20and/or\x20\x27max\x27\x20values','location':getLocationFromPath(_0x4c1ce9[_0x594c63(0x9d)],_0x4c1ce9['source'],pathToArray(_0x44f2c6))})),OPERATORS_REQUIRING_UNIT[_0x594c63(0xe0)](_0x28fe7a[_0x594c63(0xa0)])&&(!_0x28fe7a['unit']&&_0x28fe7a[_0x594c63(0xf0)]!==undefined&&_0x453470[_0x594c63(0x9b)]({'level':_0x594c63(0xb7),'path':_0x44f2c6+'.unit','code':_0x594c63(0x8c),'message':_0x594c63(0xd4)+_0x28fe7a[_0x594c63(0xa0)]+_0x594c63(0xcf),'location':getLocationFromPath(_0x4c1ce9[_0x594c63(0x9d)],_0x4c1ce9[_0x594c63(0x93)],pathToArray(_0x44f2c6))})),_0x453470;}function validateArrayMatching(_0x379556,_0x205fa6,_0x27da27){const _0xb271cb=a125_0x33d555,_0x58e93f=[];if(_0x379556==='any'||_0x379556===_0xb271cb(0xfe))return _0x58e93f;if(typeof _0x379556==='object'){const _0x2e94f3=Object[_0xb271cb(0xe3)](_0x379556),_0xf09d84=[_0xb271cb(0x112),_0xb271cb(0x99),'exactly'],_0x2f0c12=_0x2e94f3['some'](_0x5b6c24=>_0xf09d84[_0xb271cb(0xac)](_0x5b6c24));!_0x2f0c12&&_0x58e93f[_0xb271cb(0x9b)]({'level':_0xb271cb(0xb7),'path':_0x205fa6,'code':_0xb271cb(0x97),'message':_0xb271cb(0x85)+_0xf09d84[_0xb271cb(0xd1)]('/')+'.','location':getLocationFromPath(_0x27da27['document'],_0x27da27[_0xb271cb(0x93)],pathToArray(_0x205fa6))});}else _0x58e93f[_0xb271cb(0x9b)]({'level':_0xb271cb(0xb7),'path':_0x205fa6,'code':_0xb271cb(0x97),'message':_0xb271cb(0x8a),'location':getLocationFromPath(_0x27da27[_0xb271cb(0x9d)],_0x27da27['source'],pathToArray(_0x205fa6))});return _0x58e93f;}export function validateSegmentDef(_0x36e062,_0x5137fe={}){const _0x4d2028=a125_0x33d555,_0x147d1a=[],_0x2d5616=[];(!_0x36e062[_0x4d2028(0x124)]||_0x36e062[_0x4d2028(0x124)]['trim']()==='')&&_0x147d1a['push']({'level':_0x4d2028(0xb7),'path':_0x4d2028(0x124),'code':'MISSING_NAME','message':'Segment\x20name\x20is\x20required','location':getLocationFromPath(_0x5137fe[_0x4d2028(0x9d)],_0x5137fe[_0x4d2028(0x93)],['name'])});if(_0x36e062[_0x4d2028(0xa1)]){const _0x544300=validateRuleDef(_0x36e062['rule'],_0x4d2028(0xa1),_0x5137fe);for(const _0x4fcd28 of _0x544300){_0x4fcd28[_0x4d2028(0x111)]==='error'?_0x147d1a['push'](_0x4fcd28):_0x2d5616[_0x4d2028(0x9b)](_0x4fcd28);}}return{'valid':_0x147d1a[_0x4d2028(0x10c)]===0x0,'errors':_0x147d1a,'warnings':_0x2d5616};}export function validateJourneyDef(_0x3a91f3,_0x532b31={}){const _0x46023b=a125_0x33d555,_0x4cc842=[],_0x2fe899=[];(!_0x3a91f3[_0x46023b(0x124)]||_0x3a91f3[_0x46023b(0x124)][_0x46023b(0x104)]()==='')&&_0x4cc842[_0x46023b(0x9b)]({'level':_0x46023b(0xb7),'path':_0x46023b(0x124),'code':_0x46023b(0xdd),'message':_0x46023b(0xb5),'location':getLocationFromPath(_0x532b31['document'],_0x532b31['source'],[_0x46023b(0x124)])});const _0x39b87b=new Set();if(_0x3a91f3[_0x46023b(0xc0)])for(const _0x3de4c9 of Object[_0x46023b(0xe3)](_0x3a91f3['segments'])){_0x39b87b['add'](_0x3de4c9);}const _0x569322=new Set(),_0x314138={..._0x532b31,'embeddedSegments':_0x39b87b,'referencedSegments':_0x569322};if(_0x3a91f3['segments'])for(const [_0x245319,_0x45af50]of Object[_0x46023b(0xde)](_0x3a91f3[_0x46023b(0xc0)])){const _0x5d854d=validateEmbeddedSegment(_0x45af50,'segments.'+_0x245319,_0x314138);for(const _0x5b41d8 of _0x5d854d){if(_0x5b41d8[_0x46023b(0x111)]==='error')_0x4cc842[_0x46023b(0x9b)](_0x5b41d8);else _0x2fe899['push'](_0x5b41d8);}}const _0x4e64f4=getJourneyStages(_0x3a91f3);_0x4e64f4[_0x46023b(0x10c)]===0x0&&_0x4cc842[_0x46023b(0x9b)]({'level':_0x46023b(0xb7),'path':_0x46023b(0x9c),'code':_0x46023b(0x8d),'message':'Journey\x20must\x20have\x20at\x20least\x20one\x20stage','location':getLocationFromPath(_0x532b31['document'],_0x532b31[_0x46023b(0x93)],[_0x46023b(0x9c)])});const _0x3191be=new Set();for(const _0x3a2590 of _0x4e64f4){if(_0x3a2590['steps'])for(const _0x19a68a of _0x3a2590[_0x46023b(0xa9)]){_0x19a68a[_0x46023b(0x124)]&&_0x3191be['add'](_0x19a68a[_0x46023b(0x124)]);}}_0x314138[_0x46023b(0x127)]=_0x3191be;for(let _0x3ad8fc=0x0;_0x3ad8fc<_0x4e64f4[_0x46023b(0x10c)];_0x3ad8fc++){const _0x16b041=_0x4e64f4[_0x3ad8fc],_0x531421=_0x46023b(0xc4)+_0x3ad8fc+']',_0x26e6b6=validateStage(_0x16b041,_0x531421,_0x314138);for(const _0x449045 of _0x26e6b6){if(_0x449045[_0x46023b(0x111)]===_0x46023b(0xb7))_0x4cc842[_0x46023b(0x9b)](_0x449045);else _0x2fe899[_0x46023b(0x9b)](_0x449045);}}if(_0x3a91f3[_0x46023b(0x118)]){const _0x475e55=validateCriteria(_0x3a91f3[_0x46023b(0x118)],_0x46023b(0x118),_0x314138);for(const _0x4b6190 of _0x475e55){if(_0x4b6190[_0x46023b(0x111)]==='error')_0x4cc842[_0x46023b(0x9b)](_0x4b6190);else _0x2fe899[_0x46023b(0x9b)](_0x4b6190);}}for(const _0x340ced of _0x39b87b){!_0x569322[_0x46023b(0xe0)](_0x340ced)&&!_0x340ced[_0x46023b(0x87)](_0x46023b(0xf4))&&_0x2fe899['push']({'level':_0x46023b(0xb4),'path':'segments.'+_0x340ced,'code':_0x46023b(0x10a),'message':_0x46023b(0x9a)+_0x340ced+_0x46023b(0xc9),'location':getLocationFromPath(_0x532b31['document'],_0x532b31[_0x46023b(0x93)],['segments',_0x340ced])});}return{'valid':_0x4cc842[_0x46023b(0x10c)]===0x0,'errors':_0x4cc842,'warnings':_0x2fe899};}function getJourneyStages(_0x2478bd){const _0x3f5780=a125_0x33d555;if(_0x2478bd[_0x3f5780(0x9c)]&&_0x2478bd['stages'][_0x3f5780(0x10c)]>0x0)return _0x2478bd[_0x3f5780(0x9c)];if(_0x2478bd[_0x3f5780(0x80)]&&_0x2478bd['journeys'][_0x3f5780(0x10c)]>0x0)return _0x2478bd['journeys'][_0x3f5780(0xe5)](_0x3a75a4=>_0x3a75a4[_0x3f5780(0x9c)]||[]);if(_0x2478bd[_0x3f5780(0x109)]&&_0x2478bd[_0x3f5780(0x109)][_0x3f5780(0x10c)]>0x0)return _0x2478bd['versions'][_0x3f5780(0xe5)](_0x528f14=>_0x528f14['stages']||[]);return[];}function validateEmbeddedSegment(_0x3285c2,_0x17a7d6,_0x5d10b0){const _0x838bd6=a125_0x33d555,_0x1858b4=[];return _0x3285c2[_0x838bd6(0xa1)]&&_0x1858b4['push'](...validateRuleDef(_0x3285c2['rule'],_0x17a7d6+_0x838bd6(0xd8),_0x5d10b0)),_0x1858b4;}function validateStage(_0x2a6acd,_0x43213f,_0x16cfd1){const _0xcf3b0c=a125_0x33d555,_0x700fd0=[],_0x40aafb=new Map();if(_0x2a6acd[_0xcf3b0c(0xa9)])for(let _0x3cf4da=0x0;_0x3cf4da<_0x2a6acd[_0xcf3b0c(0xa9)]['length'];_0x3cf4da++){const _0x5d8a0e=_0x2a6acd[_0xcf3b0c(0xa9)][_0x3cf4da],_0x469ddb=_0x43213f+_0xcf3b0c(0xed)+_0x3cf4da+']';if(_0x5d8a0e['name']){if(_0x40aafb[_0xcf3b0c(0xe0)](_0x5d8a0e['name'])){const _0x2d1890=_0x40aafb[_0xcf3b0c(0xc8)](_0x5d8a0e[_0xcf3b0c(0x124)]);_0x700fd0[_0xcf3b0c(0x9b)]({'level':_0xcf3b0c(0xb7),'path':_0x469ddb+'.name','code':_0xcf3b0c(0x10f),'message':'Duplicate\x20step\x20name\x20\x27'+_0x5d8a0e[_0xcf3b0c(0x124)]+_0xcf3b0c(0x11d)+_0x2d1890+'])','location':getLocationFromPath(_0x16cfd1[_0xcf3b0c(0x9d)],_0x16cfd1[_0xcf3b0c(0x93)],pathToArray(_0x469ddb+_0xcf3b0c(0xa7)))});}else _0x40aafb[_0xcf3b0c(0xb8)](_0x5d8a0e['name'],_0x3cf4da);}_0x700fd0[_0xcf3b0c(0x9b)](...validateStep(_0x5d8a0e,_0x469ddb,_0x16cfd1));}_0x2a6acd[_0xcf3b0c(0xba)]&&_0x700fd0['push'](...validateCriteria(_0x2a6acd[_0xcf3b0c(0xba)],_0x43213f+_0xcf3b0c(0x98),_0x16cfd1));if(_0x2a6acd[_0xcf3b0c(0xef)])for(let _0x3b6852=0x0;_0x3b6852<_0x2a6acd[_0xcf3b0c(0xef)][_0xcf3b0c(0x10c)];_0x3b6852++){_0x700fd0[_0xcf3b0c(0x9b)](...validateCriteria(_0x2a6acd[_0xcf3b0c(0xef)][_0x3b6852],_0x43213f+_0xcf3b0c(0x94)+_0x3b6852+']',_0x16cfd1));}return _0x2a6acd['milestone']&&_0x700fd0[_0xcf3b0c(0x9b)](...validateCriteria(_0x2a6acd[_0xcf3b0c(0xf6)],_0x43213f+_0xcf3b0c(0x125),_0x16cfd1)),_0x700fd0;}function validateStep(_0xabf1c3,_0xf65d12,_0xa6654c){const _0x490433=a125_0x33d555,_0x1f8d75=[];_0xabf1c3[_0x490433(0xff)]&&_0xabf1c3[_0x490433(0xa0)]!=='end'&&(_0xa6654c[_0x490433(0x127)]&&!_0xa6654c[_0x490433(0x127)]['has'](_0xabf1c3[_0x490433(0xff)])&&_0x1f8d75[_0x490433(0x9b)]({'level':'error','path':_0xf65d12+'.next','code':_0x490433(0x12b),'message':_0x490433(0xaa)+_0xabf1c3[_0x490433(0xff)]+'\x27','location':getLocationFromPath(_0xa6654c['document'],_0xa6654c[_0x490433(0x93)],pathToArray(_0xf65d12+_0x490433(0x92)))}));switch(_0xabf1c3[_0x490433(0xa0)]){case'wait':_0x1f8d75[_0x490433(0x9b)](...validateWaitStep(_0xabf1c3,_0xf65d12,_0xa6654c));break;case _0x490433(0xa6):_0x1f8d75['push'](...validateActivationStep(_0xabf1c3,_0xf65d12,_0xa6654c));break;case'decision_point':_0x1f8d75['push'](...validateDecisionPointStep(_0xabf1c3,_0xf65d12,_0xa6654c));break;case _0x490433(0x101):_0x1f8d75[_0x490433(0x9b)](...validateAbTestStep(_0xabf1c3,_0xf65d12,_0xa6654c));break;case'jump':_0x1f8d75[_0x490433(0x9b)](...validateJumpStep(_0xabf1c3,_0xf65d12,_0xa6654c));break;}return _0x1f8d75;}function validateWaitStep(_0x5da469,_0x57fdec,_0x29a4bc){const _0x4a4d30=a125_0x33d555,_0x769d86=[];if(!_0x5da469[_0x4a4d30(0xf1)])return _0x769d86['push']({'level':_0x4a4d30(0xb7),'path':_0x57fdec+'.with','code':'MISSING_WAIT_PARAMS','message':_0x4a4d30(0xaf),'location':getLocationFromPath(_0x29a4bc['document'],_0x29a4bc[_0x4a4d30(0x93)],pathToArray(_0x57fdec))}),_0x769d86;if(_0x5da469['with'][_0x4a4d30(0xb1)]){const _0x42d217=_0x5da469['with']['condition'];_0x42d217[_0x4a4d30(0xe9)]&&(_0x29a4bc[_0x4a4d30(0xea)]?.['add'](_0x42d217[_0x4a4d30(0xe9)]),!_0x42d217[_0x4a4d30(0xe9)]['startsWith'](_0x4a4d30(0xbe))&&(_0x29a4bc[_0x4a4d30(0x115)]&&!_0x29a4bc[_0x4a4d30(0x115)][_0x4a4d30(0xe0)](_0x42d217[_0x4a4d30(0xe9)])&&_0x769d86[_0x4a4d30(0x9b)]({'level':_0x4a4d30(0xb7),'path':_0x57fdec+_0x4a4d30(0x88),'code':_0x4a4d30(0x116),'message':_0x4a4d30(0x110)+_0x42d217[_0x4a4d30(0xe9)]+'\x27.\x20Define\x20it\x20in\x20the\x20\x27segments\x27\x20section\x20or\x20use\x20\x27ref:Segment\x20Name\x27\x20for\x20external\x20segments.','location':getLocationFromPath(_0x29a4bc[_0x4a4d30(0x9d)],_0x29a4bc[_0x4a4d30(0x93)],pathToArray(_0x57fdec+_0x4a4d30(0x88)))})),_0x42d217[_0x4a4d30(0xff)]&&_0x29a4bc[_0x4a4d30(0x127)]&&!_0x29a4bc[_0x4a4d30(0x127)][_0x4a4d30(0xe0)](_0x42d217[_0x4a4d30(0xff)])&&_0x769d86[_0x4a4d30(0x9b)]({'level':_0x4a4d30(0xb7),'path':_0x57fdec+_0x4a4d30(0xd5),'code':'INVALID_NEXT_REFERENCE','message':'Wait\x20condition\x20references\x20non-existent\x20step\x20\x27'+_0x42d217[_0x4a4d30(0xff)]+'\x27','location':getLocationFromPath(_0x29a4bc[_0x4a4d30(0x9d)],_0x29a4bc[_0x4a4d30(0x93)],pathToArray(_0x57fdec+_0x4a4d30(0xd5)))}),_0x42d217[_0x4a4d30(0xb9)]?.['next']&&_0x29a4bc[_0x4a4d30(0x127)]&&!_0x29a4bc[_0x4a4d30(0x127)][_0x4a4d30(0xe0)](_0x42d217[_0x4a4d30(0xb9)]['next'])&&_0x769d86['push']({'level':_0x4a4d30(0xb7),'path':_0x57fdec+_0x4a4d30(0xce),'code':_0x4a4d30(0x12b),'message':_0x4a4d30(0x103)+_0x42d217[_0x4a4d30(0xb9)][_0x4a4d30(0xff)]+'\x27','location':getLocationFromPath(_0x29a4bc[_0x4a4d30(0x9d)],_0x29a4bc[_0x4a4d30(0x93)],pathToArray(_0x57fdec+_0x4a4d30(0xce)))}));}return _0x769d86;}function validateActivationStep(_0x44586e,_0x5ce454,_0x465990){const _0x3a8001=a125_0x33d555,_0x24831c=[];return!_0x44586e[_0x3a8001(0xf1)]?.[_0x3a8001(0xa6)]&&_0x24831c[_0x3a8001(0x9b)]({'level':'error','path':_0x5ce454+'.with.activation','code':_0x3a8001(0xbd),'message':_0x3a8001(0xfb),'location':getLocationFromPath(_0x465990[_0x3a8001(0x9d)],_0x465990[_0x3a8001(0x93)],pathToArray(_0x5ce454))}),_0x24831c;}function validateDecisionPointStep(_0x510082,_0x174b59,_0x25e83f){const _0x3e61ae=a125_0x33d555,_0x4962fa=[];if(!_0x510082[_0x3e61ae(0xf1)]?.[_0x3e61ae(0xdb)]||_0x510082[_0x3e61ae(0xf1)][_0x3e61ae(0xdb)][_0x3e61ae(0x10c)]===0x0)return _0x4962fa[_0x3e61ae(0x9b)]({'level':_0x3e61ae(0xb7),'path':_0x174b59+_0x3e61ae(0xfc),'code':_0x3e61ae(0x11b),'message':_0x3e61ae(0xa2),'location':getLocationFromPath(_0x25e83f['document'],_0x25e83f[_0x3e61ae(0x93)],pathToArray(_0x174b59))}),_0x4962fa;for(let _0x568605=0x0;_0x568605<_0x510082[_0x3e61ae(0xf1)][_0x3e61ae(0xdb)]['length'];_0x568605++){const _0x596855=_0x510082[_0x3e61ae(0xf1)][_0x3e61ae(0xdb)][_0x568605],_0x256c59=_0x174b59+_0x3e61ae(0x95)+_0x568605+']';_0x596855[_0x3e61ae(0xe9)]&&!_0x596855[_0x3e61ae(0x126)]&&(_0x25e83f[_0x3e61ae(0xea)]?.[_0x3e61ae(0x12a)](_0x596855['segment']),!_0x596855[_0x3e61ae(0xe9)]['startsWith'](_0x3e61ae(0xbe))&&(_0x25e83f[_0x3e61ae(0x115)]&&!_0x25e83f['embeddedSegments']['has'](_0x596855[_0x3e61ae(0xe9)])&&_0x4962fa['push']({'level':_0x3e61ae(0xb7),'path':_0x256c59+_0x3e61ae(0x11a),'code':'MISSING_SEGMENT_REFERENCE','message':_0x3e61ae(0xa3)+_0x596855[_0x3e61ae(0xe9)]+'\x27','location':getLocationFromPath(_0x25e83f['document'],_0x25e83f[_0x3e61ae(0x93)],pathToArray(_0x256c59+_0x3e61ae(0x11a)))}))),_0x596855[_0x3e61ae(0xff)]&&_0x25e83f[_0x3e61ae(0x127)]&&!_0x25e83f[_0x3e61ae(0x127)]['has'](_0x596855[_0x3e61ae(0xff)])&&_0x4962fa[_0x3e61ae(0x9b)]({'level':_0x3e61ae(0xb7),'path':_0x256c59+_0x3e61ae(0x92),'code':_0x3e61ae(0x12b),'message':_0x3e61ae(0xae)+_0x596855[_0x3e61ae(0xff)]+'\x27','location':getLocationFromPath(_0x25e83f[_0x3e61ae(0x9d)],_0x25e83f[_0x3e61ae(0x93)],pathToArray(_0x256c59+'.next'))});}return _0x4962fa;}function validateAbTestStep(_0x2c0394,_0xaebc6d,_0x68c67c){const _0x55d926=a125_0x33d555,_0x4770b6=[];if(!_0x2c0394[_0x55d926(0xf1)]?.[_0x55d926(0xe6)]||_0x2c0394['with'][_0x55d926(0xe6)][_0x55d926(0x10c)]===0x0)return _0x4770b6[_0x55d926(0x9b)]({'level':_0x55d926(0xb7),'path':_0xaebc6d+'.with.variants','code':_0x55d926(0x11b),'message':_0x55d926(0x84),'location':getLocationFromPath(_0x68c67c[_0x55d926(0x9d)],_0x68c67c['source'],pathToArray(_0xaebc6d))}),_0x4770b6;const _0x79bb1=_0x2c0394[_0x55d926(0xf1)][_0x55d926(0xe6)][_0x55d926(0xf7)]((_0x5b04f9,_0x2fdf18)=>_0x5b04f9+(_0x2fdf18[_0x55d926(0x120)]||0x0),0x0);Math[_0x55d926(0xa8)](_0x79bb1-0x64)>0.01&&_0x4770b6[_0x55d926(0x9b)]({'level':_0x55d926(0xb7),'path':_0xaebc6d+'.with.variants','code':_0x55d926(0x8b),'message':_0x55d926(0xc2)+_0x79bb1+'%)','location':getLocationFromPath(_0x68c67c[_0x55d926(0x9d)],_0x68c67c[_0x55d926(0x93)],pathToArray(_0xaebc6d+'.with.variants'))});for(let _0x5be828=0x0;_0x5be828<_0x2c0394['with'][_0x55d926(0xe6)][_0x55d926(0x10c)];_0x5be828++){const _0x41e672=_0x2c0394['with'][_0x55d926(0xe6)][_0x5be828];_0x41e672['next']&&_0x68c67c[_0x55d926(0x127)]&&!_0x68c67c[_0x55d926(0x127)][_0x55d926(0xe0)](_0x41e672[_0x55d926(0xff)])&&_0x4770b6[_0x55d926(0x9b)]({'level':_0x55d926(0xb7),'path':_0xaebc6d+_0x55d926(0x100)+_0x5be828+_0x55d926(0xdc),'code':_0x55d926(0x12b),'message':_0x55d926(0xe4)+_0x41e672['next']+'\x27','location':getLocationFromPath(_0x68c67c[_0x55d926(0x9d)],_0x68c67c['source'],pathToArray(_0xaebc6d+_0x55d926(0x100)+_0x5be828+_0x55d926(0xdc)))});}return _0x4770b6;}function validateJumpStep(_0x5a822a,_0x16ecde,_0x4a540b){const _0x145cd7=a125_0x33d555,_0x378ea4=[];if(!_0x5a822a[_0x145cd7(0xf1)]?.[_0x145cd7(0xee)])return _0x378ea4[_0x145cd7(0x9b)]({'level':_0x145cd7(0xb7),'path':_0x16ecde+_0x145cd7(0xe2),'code':_0x145cd7(0x113),'message':_0x145cd7(0x128),'location':getLocationFromPath(_0x4a540b['document'],_0x4a540b[_0x145cd7(0x93)],pathToArray(_0x16ecde))}),_0x378ea4;return(!_0x5a822a[_0x145cd7(0xf1)]['target'][_0x145cd7(0xc7)]||!_0x5a822a[_0x145cd7(0xf1)][_0x145cd7(0xee)][_0x145cd7(0x114)])&&_0x378ea4[_0x145cd7(0x9b)]({'level':_0x145cd7(0xb7),'path':_0x16ecde+_0x145cd7(0xe2),'code':_0x145cd7(0x113),'message':'Jump\x20target\x20requires\x20both\x20journey\x20and\x20stage\x20names','location':getLocationFromPath(_0x4a540b[_0x145cd7(0x9d)],_0x4a540b[_0x145cd7(0x93)],pathToArray(_0x16ecde+_0x145cd7(0xe2)))}),_0x378ea4;}function a125_0x3403(_0x4068e8,_0x5869b8){_0x4068e8=_0x4068e8-0x7e;const _0x429004=a125_0x4290();let _0x340383=_0x429004[_0x4068e8];return _0x340383;}function validateCriteria(_0x591d71,_0x51ce26,_0x22259e){const _0x57516a=a125_0x33d555,_0x3ed2de=[];return _0x591d71[_0x57516a(0xe9)]&&(_0x22259e[_0x57516a(0xea)]?.['add'](_0x591d71[_0x57516a(0xe9)]),!_0x591d71[_0x57516a(0xe9)][_0x57516a(0x87)](_0x57516a(0xbe))&&(_0x22259e[_0x57516a(0x115)]&&!_0x22259e[_0x57516a(0x115)]['has'](_0x591d71['segment'])&&_0x3ed2de['push']({'level':_0x57516a(0xb7),'path':_0x51ce26+_0x57516a(0x11a),'code':_0x57516a(0x116),'message':_0x57516a(0x119)+_0x591d71[_0x57516a(0xe9)]+'\x27','location':getLocationFromPath(_0x22259e[_0x57516a(0x9d)],_0x22259e[_0x57516a(0x93)],pathToArray(_0x51ce26+'.segment'))}))),_0x3ed2de;}export function formatIssueWithContext(_0x132c4d,_0x582517,_0x513aa2){const _0x17d8ba=a125_0x33d555,_0x535090=[],_0x29436d=_0x132c4d[_0x17d8ba(0x111)]===_0x17d8ba(0xb7),_0x12fc79=_0x29436d?a125_0x864d20[_0x17d8ba(0xc3)]:a125_0x864d20[_0x17d8ba(0x83)],_0x3103c8=_0x29436d?a125_0x864d20['red']:a125_0x864d20['yellow'],_0x3f1df8=_0x513aa2?a125_0x864d20[_0x17d8ba(0xc1)](_0x513aa2+':'):'';if(_0x132c4d[_0x17d8ba(0x91)]){const _0xb623db=a125_0x864d20[_0x17d8ba(0xc1)](_0x132c4d['location'][_0x17d8ba(0xfa)]+':'+_0x132c4d['location'][_0x17d8ba(0xbb)]);_0x535090[_0x17d8ba(0x9b)](''+_0x3f1df8+_0xb623db+':\x20'+_0x12fc79(_0x132c4d[_0x17d8ba(0x111)])+'\x20'+_0x3103c8('['+_0x132c4d['code']+']'));}else _0x535090[_0x17d8ba(0x9b)](''+_0x3f1df8+a125_0x864d20[_0x17d8ba(0x123)](_0x132c4d[_0x17d8ba(0xd7)])+':\x20'+_0x12fc79(_0x132c4d[_0x17d8ba(0x111)])+'\x20'+_0x3103c8('['+_0x132c4d[_0x17d8ba(0xd0)]+']'));_0x535090[_0x17d8ba(0x9b)](_0x132c4d[_0x17d8ba(0xe8)]);if(_0x132c4d[_0x17d8ba(0x91)]&&_0x582517){const _0x5cea2a=_0x582517[_0x17d8ba(0x10b)]('\x0a'),{line:_0x1dc293,column:_0x521bf6}=_0x132c4d[_0x17d8ba(0x91)],_0x105a93=Math[_0x17d8ba(0x108)](0x1,_0x1dc293-0x1),_0x595ea1=Math[_0x17d8ba(0x96)](_0x5cea2a[_0x17d8ba(0x10c)],_0x1dc293+0x1);_0x535090[_0x17d8ba(0x9b)]('');for(let _0x5e06e3=_0x105a93;_0x5e06e3<=_0x595ea1;_0x5e06e3++){const _0x519f35=_0x5cea2a[_0x5e06e3-0x1]||'',_0x4d1bd1=a125_0x864d20['dim'](_0x5e06e3['toString']()[_0x17d8ba(0xcd)](0x4)),_0x3e31ce=a125_0x864d20[_0x17d8ba(0x123)]('\x20|\x20');if(_0x5e06e3===_0x1dc293){_0x535090['push']('\x20\x20'+_0x4d1bd1+_0x3e31ce+_0x12fc79(_0x519f35));const _0x4e6545='\x20'[_0x17d8ba(0xbc)](0x4+0x3+_0x521bf6-0x1);_0x535090[_0x17d8ba(0x9b)]('\x20\x20'+_0x4e6545+_0x12fc79('^'));}else _0x535090[_0x17d8ba(0x9b)]('\x20\x20'+_0x4d1bd1+_0x3e31ce+a125_0x864d20[_0x17d8ba(0x123)](_0x519f35));}}return _0x535090[_0x17d8ba(0xd1)]('\x0a');}export function formatValidationResult(_0x507364,_0x1992c4,_0x7e4e21){const _0x527005=a125_0x33d555,_0x20cad9=[];for(const _0x55782e of _0x507364['errors']){_0x20cad9['push'](formatIssueWithContext(_0x55782e,_0x1992c4,_0x7e4e21)),_0x20cad9['push']('');}for(const _0x51d604 of _0x507364[_0x527005(0x121)]){_0x20cad9[_0x527005(0x9b)](formatIssueWithContext(_0x51d604,_0x1992c4,_0x7e4e21)),_0x20cad9[_0x527005(0x9b)]('');}return _0x20cad9['join']('\x0a');}
|
package/dist/sdk/segment.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a126_0x1c05e4=a126_0x40a2;(function(_0x47c036,_0x296045){const _0x4f1eab=a126_0x40a2,_0x4b9c25=_0x47c036();while(!![]){try{const _0x3320d6=parseInt(_0x4f1eab(0x182))/0x1*(-parseInt(_0x4f1eab(0x125))/0x2)+parseInt(_0x4f1eab(0x189))/0x3*(parseInt(_0x4f1eab(0x13e))/0x4)+parseInt(_0x4f1eab(0x150))/0x5*(parseInt(_0x4f1eab(0x1ab))/0x6)+parseInt(_0x4f1eab(0x147))/0x7*(parseInt(_0x4f1eab(0x19c))/0x8)+-parseInt(_0x4f1eab(0x18d))/0x9+parseInt(_0x4f1eab(0x18c))/0xa*(parseInt(_0x4f1eab(0x1b5))/0xb)+-parseInt(_0x4f1eab(0x130))/0xc;if(_0x3320d6===_0x296045)break;else _0x4b9c25['push'](_0x4b9c25['shift']());}catch(_0x2439b1){_0x4b9c25['push'](_0x4b9c25['shift']());}}}(a126_0x1e69,0x34c0e));import{CDPApiClient}from'./client/cdp-api-client.js';import{TrinoApiClient}from'./client/trino-api-client.js';import{SDKError,ErrorCode}from'./errors.js';function a126_0x40a2(_0x2fafb1,_0x604b07){_0x2fafb1=_0x2fafb1-0x115;const _0x1e692e=a126_0x1e69();let _0x40a226=_0x1e692e[_0x2fafb1];return _0x40a226;}import{deduplicateJourneysByBundle,entityToJourneyListItem,parseJourneyState}from'./journey.js';import{parsePath}from'./segment/segment-path-parser.js';function a126_0x1e69(){const _0x3f2e77=['22yucpdM','createParentSegment','Folder\x20not\x20found:\x20','parentFolder','listFields','client','parentFolderId','rowCount','createSegment','getAudienceBehaviors','parentTableName','Validating\x20behavior:\x20','Folder\x20\x27','set','versionNumber','previewParentYaml','Master\x20table:\x20','updateParentSegment','executeQuery','catch','Calculating\x20statistics\x20for:\x20','get','customerPercent','196246FLguqc','\x20in\x20parent\x20','allValid','attributes','listFolders','trinoClient','population','\x27\x20not\x20found\x20in\x20path','updatedAt','Fetching\x20master\x20sample\x20data...','row_count','4611924xBjCmV','behaviors','getParentSQL','ambiguous','schemaError','description','parentColumn','rootFolderId','has','parent\x20segment','listSegments','getParent','sampleData','child_key','4utDYCS','createdAt','Validating\x20master\x20table:\x20','name','Enriched\x20query:\x20','table','\x27\x20not\x20found\x20in\x20parent\x20segment','relationships','Path\x20cannot\x20be\x20empty','7qKeIwA','find','getAudienceAttributes','buildTreeNodesForFolder','customers_with_events','coveragePercent','detectResourceTypeInFolder','message','journey','131555LOhOOB','type','segment-batch','validateParentYaml','then','deleteSegment','deleteActivation','createParent','getSegmentFolder','getActivation','enriched','listRecursive','updateParent','\x27:\x20','resolvePathToResource','getSegment','data','listActivations','journeyBundleId','detectResourceType','entityToSegment','getParentSegment','Calculating\x20coverage\x20for:\x20','state','string','onProgress','listEntitiesByFolder','database','parent','schemaValid','all','buildTreeFromEntities','totalEvents','getParentSegmentFull','pushParentYaml','Counting\x20master\x20table\x20rows...','push','runParent','join','interval','segmentFolderId','getFolder','length','getSegmentSQL','master','resolveParentId','createFolder','schema','entityToFolder','connection','2nPRMOf','INVALID_ARGUMENT','segment','createActivation','\x27\x20not\x20found\x20in\x20','SEGMENT_NOT_FOUND','updateActivation','751686etvIuw','filter','resolveFolderId','1150700cXliPv','1101267hzpqDe','Attribute\x20\x27','isArray','listUnifiedWithJourneys','folder-segment','parentDatabaseName','traversePath','source','Validating\x20all\x20attributes\x20in\x20parallel...','getParentFull','updateSegmentById','attribute','_tdxInstance','folder','matchedCount','1191128hjJUqR','groupingName','createJourneySegment','total_events','behavior','\x27\x20not\x20found','journeyBundleName','map','error','Validating\x20all\x20behaviors\x20in\x20parallel...','entity','Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)','customersWithEvents','Fetching\x20sample\x20data\x20for:\x20','test','66aWooXO','Resource\x20\x27','Behavior\x20\x27','some','listParents','segment-realtime','resolveParentIdOrName','getEntityParentFolderId','Segment\x20\x27','parent_key'];a126_0x1e69=function(){return _0x3f2e77;};return a126_0x1e69();}import{pullSegments as a126_0xb9c067}from'./segment/pull-workflow.js';import{apiToDef,defToApi,serializeDef,parseDef}from'./segment/parent-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{DEFAULT_TIME_RANGE,DEFAULT_SAMPLE_LIMIT,generateSchemaValidationSQL,generateMasterCountSQL,generateMasterSampleSQL,generateAttributeCoverageSQL,generateBehaviorStatsSQL,generateAttributeSampleSQL,generateBehaviorSampleSQL,generateEnrichedSQL,generateAttributeSchemaSQL,generateBehaviorSchemaSQL,findAttributeByName,findBehaviorByName,getAttributeColumns,getBehaviorColumns}from'./segment/parent-segment-preview.js';export class SegmentSDK{[a126_0x1c05e4(0x1ba)];[a126_0x1c05e4(0x12a)];constructor(_0x1d7e89){const _0x2b5fd4=a126_0x1c05e4;this[_0x2b5fd4(0x1ba)]=new CDPApiClient(_0x1d7e89),this[_0x2b5fd4(0x12a)]=new TrinoApiClient(_0x1d7e89);}async[a126_0x1c05e4(0x1af)](){const _0x5249fe=a126_0x1c05e4;return await this[_0x5249fe(0x1ba)]['listParentSegments']();}async[a126_0x1c05e4(0x13b)](_0x1ab7d8){const _0xd7009c=a126_0x1c05e4;return await this['client'][_0xd7009c(0x165)](_0x1ab7d8);}async[a126_0x1c05e4(0x13a)](_0x1f4e2c){const _0x5ba905=a126_0x1c05e4;return await this[_0x5ba905(0x1ba)][_0x5ba905(0x13a)](_0x1f4e2c);}async['getSegment'](_0x44dd14,_0x162afc){const _0x2100aa=a126_0x1c05e4;return await this[_0x2100aa(0x1ba)][_0x2100aa(0x15f)](_0x44dd14,_0x162afc);}async[a126_0x1c05e4(0x129)](_0x245c33){return await this['client']['listSegmentFolders'](_0x245c33);}async[a126_0x1c05e4(0x179)](_0x26076c){const _0x1bf20f=a126_0x1c05e4;return await this[_0x1bf20f(0x1ba)][_0x1bf20f(0x158)](_0x26076c);}async['listActivations'](_0x587679,_0x4066a5){const _0x574b96=a126_0x1c05e4;return await this[_0x574b96(0x1ba)][_0x574b96(0x161)](_0x587679,_0x4066a5);}async[a126_0x1c05e4(0x159)](_0x18e2d8,_0x38f38b,_0x33d32e){const _0x4d6d13=a126_0x1c05e4;return await this[_0x4d6d13(0x1ba)][_0x4d6d13(0x159)](_0x18e2d8,_0x38f38b,_0x33d32e);}async[a126_0x1c05e4(0x185)](_0x17c988,_0x37f2fb,_0x2b945a){return await this['client']['createActivation'](_0x17c988,_0x37f2fb,_0x2b945a);}async[a126_0x1c05e4(0x188)](_0x594a9c,_0x5837ed,_0xc6501b,_0x4c83d7){const _0x144bc7=a126_0x1c05e4;return await this[_0x144bc7(0x1ba)][_0x144bc7(0x188)](_0x594a9c,_0x5837ed,_0xc6501b,_0x4c83d7);}async[a126_0x1c05e4(0x156)](_0x52284a,_0x407e95,_0x525d7b){const _0x29555a=a126_0x1c05e4;return await this[_0x29555a(0x1ba)][_0x29555a(0x156)](_0x52284a,_0x407e95,_0x525d7b);}async[a126_0x1c05e4(0x132)](_0x2f3569){const _0x11dfb8=a126_0x1c05e4;return await this[_0x11dfb8(0x1ba)]['getParentSegmentSQL'](_0x2f3569);}async[a126_0x1c05e4(0x17b)](_0x5db679,_0x46ebae){const _0x108553=a126_0x1c05e4;return await this[_0x108553(0x1ba)][_0x108553(0x17b)](_0x5db679,_0x46ebae);}async[a126_0x1c05e4(0x17d)](_0x4c6ff4){const _0x1e8955=a126_0x1c05e4,_0x4d2c43=await this[_0x1e8955(0x1af)](),_0x37e14c=_0x4d2c43[_0x1e8955(0x148)](_0x73a25f=>_0x73a25f[_0x1e8955(0x128)]['name']===_0x4c6ff4);if(!_0x37e14c)throw new SDKError(ErrorCode[_0x1e8955(0x187)],'Parent\x20segment\x20not\x20found:\x20'+_0x4c6ff4);return _0x37e14c['id'];}async[a126_0x1c05e4(0x175)](_0x13cf3e){const _0x5a932b=a126_0x1c05e4;let _0x4c5eca=_0x13cf3e;return!/^\d+$/[_0x5a932b(0x1aa)](_0x13cf3e)&&(_0x4c5eca=await this[_0x5a932b(0x17d)](_0x13cf3e)),await this[_0x5a932b(0x1ba)]['runParentSegment'](_0x4c5eca);}async['resolveSegmentId'](_0x580325,_0x487cad){const _0x370424=a126_0x1c05e4,_0x150b66=await this[_0x370424(0x13a)](_0x580325),_0x24fbb4=_0x150b66[_0x370424(0x148)](_0x3dcc93=>_0x3dcc93['name']===_0x487cad);if(!_0x24fbb4)throw new SDKError(ErrorCode[_0x370424(0x187)],'Child\x20segment\x20not\x20found:\x20'+_0x487cad+_0x370424(0x126)+_0x580325);return _0x24fbb4['id'];}async[a126_0x1c05e4(0x18b)](_0xc453db,_0x42c856){const _0x40ce9c=a126_0x1c05e4,_0x49f11a=await this[_0x40ce9c(0x129)](_0xc453db),_0x214de8=_0x49f11a[_0x40ce9c(0x148)](_0x226d39=>_0x226d39[_0x40ce9c(0x141)]===_0x42c856);if(!_0x214de8)throw new SDKError(ErrorCode[_0x40ce9c(0x187)],_0x40ce9c(0x1b7)+_0x42c856+_0x40ce9c(0x126)+_0xc453db);return _0x214de8['id'];}async[a126_0x1c05e4(0x1b9)](_0xc59f52){const _0x2d47f5=a126_0x1c05e4,_0x4798bd=await this[_0x2d47f5(0x1b1)](_0xc59f52),[_0x429b7a,_0x160da2]=await Promise[_0x2d47f5(0x16e)]([this[_0x2d47f5(0x1ba)][_0x2d47f5(0x149)](_0x4798bd),this[_0x2d47f5(0x1ba)][_0x2d47f5(0x117)](_0x4798bd)]),_0xcb5cde=[];for(const _0x389acd of _0x429b7a){_0xcb5cde[_0x2d47f5(0x174)]({'name':_0x389acd[_0x2d47f5(0x141)],'type':_0x389acd[_0x2d47f5(0x151)],'source':_0x2d47f5(0x198),'parentDatabaseName':_0x389acd[_0x2d47f5(0x192)],'parentTableName':_0x389acd[_0x2d47f5(0x118)],'parentColumn':_0x389acd[_0x2d47f5(0x136)],'groupingName':_0x389acd[_0x2d47f5(0x19d)]??undefined});}for(const _0x10a850 of _0x160da2){const _0x371fc1=_0x10a850[_0x2d47f5(0x141)];if(_0x10a850[_0x2d47f5(0x17f)]&&Array[_0x2d47f5(0x18f)](_0x10a850[_0x2d47f5(0x17f)]))for(const _0x3c742b of _0x10a850[_0x2d47f5(0x17f)]){_0x3c742b['name']&&_0x3c742b[_0x2d47f5(0x151)]&&_0xcb5cde[_0x2d47f5(0x174)]({'name':_0x371fc1+'.'+_0x3c742b[_0x2d47f5(0x141)],'type':_0x3c742b['type'],'source':_0x2d47f5(0x1a0),'behaviorName':_0x371fc1,'parentDatabaseName':_0x10a850['parentDatabaseName'],'parentTableName':_0x10a850[_0x2d47f5(0x118)],'parentColumn':_0x3c742b[_0x2d47f5(0x136)]});}}return _0xcb5cde;}async[a126_0x1c05e4(0x157)](_0x191ff9){const _0x47b98a=a126_0x1c05e4;return await this[_0x47b98a(0x1ba)][_0x47b98a(0x1b6)](_0x191ff9);}async['updateParent'](_0x2ba68b,_0xc738cf){const _0x1c08e5=a126_0x1c05e4,_0x1a4a61=await this[_0x1c08e5(0x1b1)](_0x2ba68b);return await this[_0x1c08e5(0x1ba)][_0x1c08e5(0x11f)](_0x1a4a61,_0xc738cf);}async[a126_0x1c05e4(0x196)](_0x23b0fe){const _0x2fb674=a126_0x1c05e4,_0xae27f0=await this[_0x2fb674(0x1b1)](_0x23b0fe);return await this[_0x2fb674(0x1ba)][_0x2fb674(0x171)](_0xae27f0);}async['pullParentYaml'](_0x4d1d23){const _0x19e0dd=await this['getParentFull'](_0x4d1d23),_0x270553=apiToDef(_0x19e0dd);return serializeDef(_0x270553);}async[a126_0x1c05e4(0x172)](_0x32b0f8){const _0x275e25=a126_0x1c05e4,_0x4c9b18=typeof _0x32b0f8==='string'?parseDef(_0x32b0f8):_0x32b0f8,_0x2fc4ca=defToApi(_0x4c9b18);let _0x4d96fa=null,_0xee1f89='';try{_0x4d96fa=await this[_0x275e25(0x196)](_0x4c9b18[_0x275e25(0x141)]);const _0x49a4bc=apiToDef(_0x4d96fa);_0xee1f89=serializeDef(_0x49a4bc);}catch{}const _0x79f8c8=serializeDef(_0x4c9b18),_0x3a6226=generateDiff(_0xee1f89,_0x79f8c8),_0x180415=formatDiffWithColors(_0x3a6226),_0xe0f638=_0x4d96fa===null,_0x5699ef=hasChanges(_0x3a6226),_0x4faa50={'isNew':_0xe0f638,'id':_0x4d96fa?.['id']||'','name':_0x4c9b18[_0x275e25(0x141)],'diff':_0x3a6226,'diffFormatted':_0x180415,'hasChanges':_0x5699ef},_0x56c317=async()=>{const _0x4d837a=_0x275e25;return _0xe0f638?await this[_0x4d837a(0x157)](_0x2fc4ca):await this[_0x4d837a(0x15c)](_0x4d96fa['id'],_0x2fc4ca);};return{..._0x4faa50,'apply':_0x56c317};}async[a126_0x1c05e4(0x153)](_0x4f87c1,_0x11e831={}){const _0x415e50=a126_0x1c05e4,_0x40fdae=typeof _0x4f87c1===_0x415e50(0x168)?parseDef(_0x4f87c1):_0x4f87c1,_0x579937=[];let _0x7eb162=!![];const _0x57a997=_0x1d14d6=>_0x11e831[_0x415e50(0x169)]?.(_0x1d14d6),_0x1940c5={'name':_0x40fdae[_0x415e50(0x141)],'master':{'database':_0x40fdae[_0x415e50(0x17c)][_0x415e50(0x16b)],'table':_0x40fdae[_0x415e50(0x17c)][_0x415e50(0x143)],'schemaValid':![]},'attributes':[],'behaviors':[],'errors':_0x579937,'allValid':!![]},_0x4174c5=async _0x1b1566=>{const _0x2abdfc=_0x415e50;try{const _0x512702=await this[_0x2abdfc(0x12a)]['executeQuery'](_0x1b1566);return{'data':_0x512702['data']};}catch(_0x5ecd92){const _0x51642c=_0x5ecd92 instanceof Error?_0x5ecd92[_0x2abdfc(0x14e)]:String(_0x5ecd92);return{'data':[],'error':_0x51642c};}};_0x57a997(_0x415e50(0x140)+_0x40fdae[_0x415e50(0x17c)][_0x415e50(0x16b)]+'.'+_0x40fdae['master'][_0x415e50(0x143)]);const _0x3841c5=generateSchemaValidationSQL(_0x40fdae[_0x415e50(0x17c)]['database'],_0x40fdae[_0x415e50(0x17c)][_0x415e50(0x143)]),_0x3d9ca6=await _0x4174c5(_0x3841c5);if(_0x3d9ca6[_0x415e50(0x1a4)])_0x1940c5['master']['schemaValid']=![],_0x1940c5[_0x415e50(0x17c)][_0x415e50(0x134)]=_0x3d9ca6['error'],_0x579937[_0x415e50(0x174)]('Master\x20table:\x20'+_0x3d9ca6['error']),_0x7eb162=![];else{_0x1940c5[_0x415e50(0x17c)][_0x415e50(0x16d)]=!![],_0x57a997(_0x415e50(0x173));const _0x3dc647=await _0x4174c5(generateMasterCountSQL(_0x40fdae));!_0x3dc647[_0x415e50(0x1a4)]&&_0x3dc647[_0x415e50(0x160)][_0x415e50(0x17a)]>0x0&&(_0x1940c5[_0x415e50(0x17c)]['rowCount']=_0x3dc647[_0x415e50(0x160)][0x0][_0x415e50(0x12f)]);}if(_0x11e831[_0x415e50(0x17c)])return _0x1940c5[_0x415e50(0x127)]=_0x7eb162,_0x1940c5;const _0x82204d=async _0x5a8599=>{const _0x5a4248=_0x415e50,_0x46ff9c={'name':_0x5a8599['name'],'database':_0x5a8599['source']['database'],'table':_0x5a8599[_0x5a4248(0x194)][_0x5a4248(0x143)],'joinKey':_0x5a8599[_0x5a4248(0x176)][_0x5a4248(0x13d)],'foreignKey':_0x5a8599['join'][_0x5a4248(0x1b4)],'columns':getAttributeColumns(_0x5a8599),'schemaValid':![]};_0x57a997('Validating\x20attribute:\x20'+_0x5a8599[_0x5a4248(0x141)]);const _0x2a581c=await _0x4174c5(generateAttributeSchemaSQL(_0x40fdae,_0x5a8599));if(_0x2a581c[_0x5a4248(0x1a4)])_0x46ff9c[_0x5a4248(0x134)]=_0x2a581c['error'];else{_0x46ff9c['schemaValid']=!![],_0x57a997(_0x5a4248(0x166)+_0x5a8599[_0x5a4248(0x141)]);const _0x27cb0d=await _0x4174c5(generateAttributeCoverageSQL(_0x40fdae,_0x5a8599));!_0x27cb0d[_0x5a4248(0x1a4)]&&_0x27cb0d['data']['length']>0x0&&(_0x46ff9c[_0x5a4248(0x19b)]=_0x27cb0d['data'][0x0]['matched_count'],_0x1940c5['master'][_0x5a4248(0x115)]&&_0x1940c5['master'][_0x5a4248(0x115)]>0x0&&(_0x46ff9c[_0x5a4248(0x14c)]=_0x46ff9c[_0x5a4248(0x19b)]/_0x1940c5[_0x5a4248(0x17c)][_0x5a4248(0x115)]*0x64));}return _0x46ff9c;},_0x2dc36f=async(_0x31e2a7,_0x2ad08d)=>{const _0x4db91c=_0x415e50,_0x4c7c9f={'name':_0x31e2a7[_0x4db91c(0x141)],'database':_0x31e2a7[_0x4db91c(0x194)]['database'],'table':_0x31e2a7[_0x4db91c(0x194)][_0x4db91c(0x143)],'joinKey':_0x31e2a7[_0x4db91c(0x176)][_0x4db91c(0x13d)],'foreignKey':_0x31e2a7[_0x4db91c(0x176)]['parent_key'],'columns':getBehaviorColumns(_0x31e2a7),'schemaValid':![]};_0x57a997(_0x4db91c(0x119)+_0x31e2a7['name']);const _0x13237b=await _0x4174c5(generateBehaviorSchemaSQL(_0x40fdae,_0x31e2a7));if(_0x13237b['error'])_0x4c7c9f[_0x4db91c(0x134)]=_0x13237b['error'];else{_0x4c7c9f['schemaValid']=!![],_0x57a997(_0x4db91c(0x122)+_0x31e2a7[_0x4db91c(0x141)]+'\x20('+_0x2ad08d+')');const _0x252a6e=await _0x4174c5(generateBehaviorStatsSQL(_0x40fdae,_0x31e2a7,_0x2ad08d));!_0x252a6e['error']&&_0x252a6e[_0x4db91c(0x160)][_0x4db91c(0x17a)]>0x0&&(_0x4c7c9f[_0x4db91c(0x1a8)]=_0x252a6e[_0x4db91c(0x160)][0x0][_0x4db91c(0x14b)],_0x4c7c9f[_0x4db91c(0x170)]=_0x252a6e[_0x4db91c(0x160)][0x0][_0x4db91c(0x19f)],_0x1940c5[_0x4db91c(0x17c)][_0x4db91c(0x115)]&&_0x1940c5[_0x4db91c(0x17c)]['rowCount']>0x0&&(_0x4c7c9f[_0x4db91c(0x124)]=_0x4c7c9f[_0x4db91c(0x1a8)]/_0x1940c5[_0x4db91c(0x17c)][_0x4db91c(0x115)]*0x64));}return _0x4c7c9f;},_0xfc0c8=(_0x273c87,_0x33d92d)=>{const _0x2fd8cf=_0x415e50;_0x1940c5[_0x2fd8cf(0x128)]=_0x273c87,_0x1940c5[_0x2fd8cf(0x131)]=_0x33d92d;for(const _0x401e7e of _0x273c87){!_0x401e7e[_0x2fd8cf(0x16d)]&&(_0x579937[_0x2fd8cf(0x174)]('Attribute\x20\x27'+_0x401e7e['name']+_0x2fd8cf(0x15d)+_0x401e7e['schemaError']),_0x7eb162=![]);}for(const _0x3dbb1c of _0x33d92d){!_0x3dbb1c[_0x2fd8cf(0x16d)]&&(_0x579937['push']('Behavior\x20\x27'+_0x3dbb1c[_0x2fd8cf(0x141)]+_0x2fd8cf(0x15d)+_0x3dbb1c['schemaError']),_0x7eb162=![]);}},_0x996766=_0x11e831[_0x415e50(0x177)]||DEFAULT_TIME_RANGE;if(typeof _0x11e831['attribute']===_0x415e50(0x168)){const _0xa7ea=findAttributeByName(_0x40fdae,_0x11e831[_0x415e50(0x198)]);if(!_0xa7ea)throw new SDKError(ErrorCode[_0x415e50(0x187)],_0x415e50(0x18e)+_0x11e831['attribute']+_0x415e50(0x1a1));const _0xe1d2fc=await _0x82204d(_0xa7ea);return _0xfc0c8([_0xe1d2fc],[]),_0x1940c5[_0x415e50(0x127)]=_0x7eb162,_0x1940c5;}if(_0x11e831['attribute']===!![]){_0x57a997('Validating\x20all\x20attributes\x20in\x20parallel...');const _0x4b6ad9=await Promise[_0x415e50(0x16e)]((_0x40fdae[_0x415e50(0x128)]||[])[_0x415e50(0x1a3)](_0x5e112b=>_0x82204d(_0x5e112b)));return _0xfc0c8(_0x4b6ad9,[]),_0x1940c5[_0x415e50(0x127)]=_0x7eb162,_0x1940c5;}if(typeof _0x11e831[_0x415e50(0x1a0)]===_0x415e50(0x168)){const _0x303633=findBehaviorByName(_0x40fdae,_0x11e831[_0x415e50(0x1a0)]);if(!_0x303633)throw new SDKError(ErrorCode[_0x415e50(0x187)],_0x415e50(0x1ad)+_0x11e831[_0x415e50(0x1a0)]+_0x415e50(0x1a1));const _0x152645=await _0x2dc36f(_0x303633,_0x996766);return _0xfc0c8([],[_0x152645]),_0x1940c5[_0x415e50(0x127)]=_0x7eb162,_0x1940c5;}if(_0x11e831[_0x415e50(0x1a0)]===!![]){_0x57a997(_0x415e50(0x1a5));const _0x6645d8=await Promise[_0x415e50(0x16e)]((_0x40fdae[_0x415e50(0x131)]||[])[_0x415e50(0x1a3)](_0x4ab8b4=>_0x2dc36f(_0x4ab8b4,_0x996766)));return _0xfc0c8([],_0x6645d8),_0x1940c5['allValid']=_0x7eb162,_0x1940c5;}if(_0x11e831[_0x415e50(0x15a)]){_0x57a997(_0x415e50(0x195));const _0x3d264d=await Promise['all']((_0x40fdae[_0x415e50(0x128)]||[])[_0x415e50(0x1a3)](_0xe0e562=>_0x82204d(_0xe0e562)));return _0xfc0c8(_0x3d264d,[]),_0x1940c5[_0x415e50(0x127)]=_0x7eb162,_0x1940c5;}_0x57a997('Validating\x20all\x20attributes\x20and\x20behaviors\x20in\x20parallel...');const [_0x2213e4,_0x25bac9]=await Promise[_0x415e50(0x16e)]([Promise[_0x415e50(0x16e)]((_0x40fdae[_0x415e50(0x128)]||[])[_0x415e50(0x1a3)](_0x5ef54a=>_0x82204d(_0x5ef54a))),Promise['all']((_0x40fdae['behaviors']||[])[_0x415e50(0x1a3)](_0x24c62e=>_0x2dc36f(_0x24c62e,_0x996766)))]);return _0xfc0c8(_0x2213e4,_0x25bac9),_0x1940c5[_0x415e50(0x127)]=_0x7eb162,_0x1940c5;}async[a126_0x1c05e4(0x11d)](_0x129b24,_0x3acdb5={}){const _0x32c3cb=a126_0x1c05e4,_0x3ec2a7=typeof _0x129b24===_0x32c3cb(0x168)?parseDef(_0x129b24):_0x129b24,_0x4d44e3=[];let _0x69e032=!![];const _0x28a589=_0x175658=>_0x3acdb5[_0x32c3cb(0x169)]?.(_0x175658),_0x39ca46={'name':_0x3ec2a7['name'],'master':{'database':_0x3ec2a7[_0x32c3cb(0x17c)][_0x32c3cb(0x16b)],'table':_0x3ec2a7['master'][_0x32c3cb(0x143)],'schemaValid':!![]},'attributes':[],'behaviors':[],'errors':_0x4d44e3,'allValid':!![]},_0x137de0=async _0x420d06=>{const _0x4fd818=_0x32c3cb;try{const _0x2ae7b6=await this[_0x4fd818(0x12a)][_0x4fd818(0x120)](_0x420d06);return{'data':_0x2ae7b6[_0x4fd818(0x160)]};}catch(_0x25c826){const _0x18e6a6=_0x25c826 instanceof Error?_0x25c826['message']:String(_0x25c826);return{'data':[],'error':_0x18e6a6};}};if(_0x3acdb5['master']){_0x28a589(_0x32c3cb(0x12e));const _0xca140b=generateMasterSampleSQL(_0x3ec2a7,DEFAULT_SAMPLE_LIMIT),_0xaad841=await _0x137de0(_0xca140b);return!_0xaad841[_0x32c3cb(0x1a4)]?_0x39ca46[_0x32c3cb(0x13c)]=_0xaad841[_0x32c3cb(0x160)]:(_0x4d44e3[_0x32c3cb(0x174)](_0x32c3cb(0x11e)+_0xaad841[_0x32c3cb(0x1a4)]),_0x69e032=![]),_0x39ca46['allValid']=_0x69e032,_0x39ca46;}if(_0x3acdb5['attribute']){const _0x520673=findAttributeByName(_0x3ec2a7,_0x3acdb5[_0x32c3cb(0x198)]);if(!_0x520673)throw new SDKError(ErrorCode[_0x32c3cb(0x187)],_0x32c3cb(0x18e)+_0x3acdb5[_0x32c3cb(0x198)]+_0x32c3cb(0x1a1));_0x28a589('Fetching\x20sample\x20data\x20for:\x20'+_0x520673[_0x32c3cb(0x141)]);const _0x101a38=generateAttributeSampleSQL(_0x3ec2a7,_0x520673,DEFAULT_SAMPLE_LIMIT),_0x1e07a2=await _0x137de0(_0x101a38);return!_0x1e07a2[_0x32c3cb(0x1a4)]?_0x39ca46['sampleData']=_0x1e07a2[_0x32c3cb(0x160)]:(_0x4d44e3['push'](_0x32c3cb(0x18e)+_0x520673[_0x32c3cb(0x141)]+_0x32c3cb(0x15d)+_0x1e07a2['error']),_0x69e032=![]),_0x39ca46[_0x32c3cb(0x127)]=_0x69e032,_0x39ca46;}if(_0x3acdb5[_0x32c3cb(0x1a0)]){const _0x5ddbd7=findBehaviorByName(_0x3ec2a7,_0x3acdb5[_0x32c3cb(0x1a0)]);if(!_0x5ddbd7)throw new SDKError(ErrorCode[_0x32c3cb(0x187)],_0x32c3cb(0x1ad)+_0x3acdb5[_0x32c3cb(0x1a0)]+_0x32c3cb(0x1a1));const _0x501213=_0x3acdb5['interval']||DEFAULT_TIME_RANGE;_0x28a589(_0x32c3cb(0x1a9)+_0x5ddbd7[_0x32c3cb(0x141)]+'\x20('+_0x501213+')');const _0x2d1f7c=generateBehaviorSampleSQL(_0x3ec2a7,_0x5ddbd7,DEFAULT_SAMPLE_LIMIT,_0x501213),_0x451558=await _0x137de0(_0x2d1f7c);return!_0x451558[_0x32c3cb(0x1a4)]?_0x39ca46[_0x32c3cb(0x13c)]=_0x451558['data']:(_0x4d44e3[_0x32c3cb(0x174)](_0x32c3cb(0x1ad)+_0x5ddbd7[_0x32c3cb(0x141)]+'\x27:\x20'+_0x451558[_0x32c3cb(0x1a4)]),_0x69e032=![]),_0x39ca46['allValid']=_0x69e032,_0x39ca46;}if(_0x3acdb5['enriched']){_0x28a589('Fetching\x20enriched\x20master\x20data...');const _0x23e919=generateEnrichedSQL(_0x3ec2a7,DEFAULT_SAMPLE_LIMIT),_0x16aef9=await _0x137de0(_0x23e919);return!_0x16aef9[_0x32c3cb(0x1a4)]?_0x39ca46[_0x32c3cb(0x13c)]=_0x16aef9['data']:(_0x4d44e3[_0x32c3cb(0x174)](_0x32c3cb(0x142)+_0x16aef9[_0x32c3cb(0x1a4)]),_0x69e032=![]),_0x39ca46[_0x32c3cb(0x127)]=_0x69e032,_0x39ca46;}return _0x39ca46[_0x32c3cb(0x127)]=_0x69e032,_0x39ca46;}async[a126_0x1c05e4(0x116)](_0x3228ac,_0x2baeae){const _0x3981c0=a126_0x1c05e4;return await this[_0x3981c0(0x1ba)][_0x3981c0(0x116)](_0x3228ac,_0x2baeae);}async[a126_0x1c05e4(0x19e)](_0x5ecbb7){const _0x4f2c86=a126_0x1c05e4;return await this[_0x4f2c86(0x1ba)][_0x4f2c86(0x19e)](_0x5ecbb7);}async[a126_0x1c05e4(0x197)](_0x117227,_0x174563,_0x48c92b){const _0x765ede=a126_0x1c05e4;return await this[_0x765ede(0x1ba)]['updateSegment'](_0x117227,_0x174563,_0x48c92b);}async[a126_0x1c05e4(0x155)](_0x46e1a4){return await this['client']['deleteSegment'](_0x46e1a4);}async[a126_0x1c05e4(0x17e)](_0xf5283a,_0x27cf32){const _0x264787=a126_0x1c05e4,_0xaf40f=await this['resolveParentIdOrName'](_0xf5283a);return await this[_0x264787(0x1ba)]['createSegmentFolder'](_0xaf40f,_0x27cf32);}async[a126_0x1c05e4(0x1b1)](_0x62e44a){const _0x415ed6=a126_0x1c05e4;if(/^\d+$/[_0x415ed6(0x1aa)](_0x62e44a))return _0x62e44a;return await this[_0x415ed6(0x17d)](_0x62e44a);}async[a126_0x1c05e4(0x163)](_0x713dfc,_0x221c9f){const _0x1384bd=a126_0x1c05e4,[_0x121869,_0x27f10c]=await Promise[_0x1384bd(0x16e)]([this[_0x1384bd(0x18b)](_0x713dfc,_0x221c9f)[_0x1384bd(0x154)](()=>!![])[_0x1384bd(0x121)](()=>![]),this['resolveSegmentId'](_0x713dfc,_0x221c9f)[_0x1384bd(0x154)](()=>!![])[_0x1384bd(0x121)](()=>![])]);if(_0x121869&&_0x27f10c)return _0x1384bd(0x133);else{if(_0x121869)return _0x1384bd(0x19a);else{if(_0x27f10c)return _0x1384bd(0x184);}}throw new SDKError(ErrorCode[_0x1384bd(0x187)],'Resource\x20\x27'+_0x221c9f+_0x1384bd(0x144));}async[a126_0x1c05e4(0x14d)](_0x10f3a0,_0x40bee2,_0x410bd5){const _0x48acc8=a126_0x1c05e4,[_0x625954,_0x5b60ac]=await Promise[_0x48acc8(0x16e)]([this[_0x48acc8(0x129)](_0x10f3a0),this[_0x48acc8(0x13a)](_0x10f3a0)]),_0x5929a8=_0x410bd5?_0x625954[_0x48acc8(0x18a)](_0x3717fc=>_0x3717fc['parentFolderId']===_0x410bd5):_0x625954[_0x48acc8(0x18a)](_0x3cdefd=>!_0x3cdefd['parentFolderId']),_0x19cb83=_0x410bd5?_0x5b60ac[_0x48acc8(0x18a)](_0x5e4402=>_0x5e4402[_0x48acc8(0x178)]===_0x410bd5):_0x5b60ac[_0x48acc8(0x18a)](_0x720dbd=>!_0x720dbd[_0x48acc8(0x178)]),_0x1f02a0=_0x5929a8[_0x48acc8(0x1ae)](_0xf1676c=>_0xf1676c[_0x48acc8(0x141)]===_0x40bee2),_0x8ad7c6=_0x19cb83[_0x48acc8(0x1ae)](_0x30cb12=>_0x30cb12[_0x48acc8(0x141)]===_0x40bee2);if(_0x1f02a0&&_0x8ad7c6)return _0x48acc8(0x133);else{if(_0x1f02a0)return'folder';else{if(_0x8ad7c6)return _0x48acc8(0x184);}}throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x48acc8(0x1ac)+_0x40bee2+_0x48acc8(0x186)+(_0x410bd5?_0x48acc8(0x19a):_0x48acc8(0x139)));}async[a126_0x1c05e4(0x193)](_0x52255e){const _0x506f1d=a126_0x1c05e4;if(_0x52255e[_0x506f1d(0x17a)]===0x0)throw new SDKError(ErrorCode[_0x506f1d(0x183)],_0x506f1d(0x146));const _0x218e2f=_0x52255e[0x0],_0x20fd78=await this[_0x506f1d(0x17d)](_0x218e2f);if(_0x52255e['length']===0x1)return{'parentId':_0x20fd78,'parentName':_0x218e2f,'type':_0x506f1d(0x16c),'fullPath':_0x218e2f};const _0x4dd6d1=await this['getParentFull'](_0x20fd78),_0x1285ea=_0x4dd6d1[_0x506f1d(0x137)],_0xdfeb92=[];let _0x43db72=_0x1285ea;for(let _0x2e4500=0x1;_0x2e4500<_0x52255e[_0x506f1d(0x17a)]-0x1;_0x2e4500++){const _0x533633=_0x52255e[_0x2e4500],_0x582e9e=await this[_0x506f1d(0x129)](_0x20fd78),_0x572462=_0x43db72?_0x582e9e['find'](_0x5c096e=>_0x5c096e[_0x506f1d(0x141)]===_0x533633&&_0x5c096e[_0x506f1d(0x1bb)]===_0x43db72):_0x582e9e[_0x506f1d(0x148)](_0x5f47d0=>_0x5f47d0['name']===_0x533633&&!_0x5f47d0[_0x506f1d(0x1bb)]);if(!_0x572462)throw new SDKError(ErrorCode[_0x506f1d(0x187)],'Folder\x20\x27'+_0x533633+_0x506f1d(0x12c));_0xdfeb92[_0x506f1d(0x174)](_0x533633),_0x43db72=_0x572462['id'];}const _0x4240b6=_0x52255e[_0x52255e[_0x506f1d(0x17a)]-0x1],_0x397c75=await this['detectResourceTypeInFolder'](_0x20fd78,_0x4240b6,_0x43db72);if(_0x397c75===_0x506f1d(0x133)||_0x397c75===_0x506f1d(0x19a)){const _0x17bb47=await this[_0x506f1d(0x129)](_0x20fd78),_0x329a5f=_0x43db72?_0x17bb47[_0x506f1d(0x148)](_0x31dc8f=>_0x31dc8f[_0x506f1d(0x141)]===_0x4240b6&&_0x31dc8f[_0x506f1d(0x1bb)]===_0x43db72):_0x17bb47[_0x506f1d(0x148)](_0x3fd69c=>_0x3fd69c[_0x506f1d(0x141)]===_0x4240b6&&!_0x3fd69c[_0x506f1d(0x1bb)]);if(!_0x329a5f)throw new SDKError(ErrorCode[_0x506f1d(0x187)],_0x506f1d(0x11a)+_0x4240b6+_0x506f1d(0x1a1));return _0xdfeb92['push'](_0x4240b6),{'parentId':_0x20fd78,'parentName':_0x218e2f,'folderId':_0x329a5f['id'],'folderPath':_0xdfeb92,'type':_0x506f1d(0x19a),'fullPath':_0x52255e[_0x506f1d(0x176)]('/')};}else{const _0x4fbf1a=await this['listSegments'](_0x20fd78),_0x9b1b59=_0x43db72?_0x4fbf1a[_0x506f1d(0x148)](_0x540be3=>_0x540be3[_0x506f1d(0x141)]===_0x4240b6&&_0x540be3[_0x506f1d(0x178)]===_0x43db72):_0x4fbf1a[_0x506f1d(0x148)](_0x131731=>_0x131731['name']===_0x4240b6&&!_0x131731[_0x506f1d(0x178)]);if(!_0x9b1b59)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x506f1d(0x1b3)+_0x4240b6+_0x506f1d(0x1a1));return{'parentId':_0x20fd78,'parentName':_0x218e2f,'folderId':_0x43db72,'folderPath':_0xdfeb92['length']>0x0?_0xdfeb92:undefined,'segmentId':_0x9b1b59['id'],'segmentName':_0x4240b6,'type':_0x506f1d(0x184),'fullPath':_0x52255e[_0x506f1d(0x176)]('/')};}}async[a126_0x1c05e4(0x15e)](_0xf43d74){const _0x530ad5=a126_0x1c05e4,_0x5b34f6=parsePath(_0xf43d74);if(!_0x5b34f6['isAbsolute'])throw new SDKError(ErrorCode[_0x530ad5(0x183)],_0x530ad5(0x1a7));return await this[_0x530ad5(0x193)](_0x5b34f6['segments']);}async[a126_0x1c05e4(0x190)](_0x439f60,_0xee7b40){const _0x419119=a126_0x1c05e4;let _0x2e3ba1=_0xee7b40;if(!_0x2e3ba1){const _0x4b606d=await this[_0x419119(0x196)](_0x439f60);_0x2e3ba1=_0x4b606d[_0x419119(0x137)];}if(!_0x2e3ba1)return{'folders':[],'segments':[],'journeys':[]};const _0x5f5c61=await this['client'][_0x419119(0x16a)](_0x2e3ba1,0x1,![]),_0x42a942=_0x5f5c61[_0x419119(0x160)],_0x3eae70=_0x42a942[_0x419119(0x18a)](_0x13df44=>{if(_0x13df44['id']===_0x2e3ba1)return![];const _0x49d44e=this['getEntityParentFolderId'](_0x13df44);return _0x49d44e===_0x2e3ba1||!_0x49d44e;}),_0x47ab39=_0x3eae70[_0x419119(0x18a)](_0x583080=>_0x583080['type']===_0x419119(0x191))[_0x419119(0x1a3)](_0x18a3fd=>this[_0x419119(0x180)](_0x18a3fd,_0x439f60)),_0x44ea55=_0x3eae70[_0x419119(0x18a)](_0x4a6faf=>_0x4a6faf['type']===_0x419119(0x152)||_0x4a6faf[_0x419119(0x151)]===_0x419119(0x1b0))['map'](_0x50a3a1=>this[_0x419119(0x164)](_0x50a3a1,_0x439f60)),_0x2db2e6=_0x3eae70[_0x419119(0x18a)](_0x38de4f=>_0x38de4f[_0x419119(0x151)]===_0x419119(0x14f)),_0x101038=_0x2db2e6[_0x419119(0x1a3)](_0x3e6bc0=>({'journeyBundleId':_0x3e6bc0[_0x419119(0x128)][_0x419119(0x162)],'versionNumber':_0x3e6bc0[_0x419119(0x128)][_0x419119(0x11c)],'id':_0x3e6bc0['id'],'entity':_0x3e6bc0})),_0x546b6e=deduplicateJourneysByBundle(_0x101038),_0x55a5d9=_0x546b6e[_0x419119(0x1a3)](_0x13bc69=>entityToJourneyListItem(_0x13bc69[_0x419119(0x1a6)],_0x439f60));return{'folders':_0x47ab39,'segments':_0x44ea55,'journeys':_0x55a5d9};}[a126_0x1c05e4(0x180)](_0x35b9ea,_0x24e0bb){const _0xe55e02=a126_0x1c05e4;return{'audienceId':_0x24e0bb,'id':_0x35b9ea['id'],'name':_0x35b9ea['attributes'][_0xe55e02(0x141)],'parentFolderId':_0x35b9ea[_0xe55e02(0x128)][_0xe55e02(0x1bb)]??_0x35b9ea[_0xe55e02(0x145)]?.[_0xe55e02(0x1b8)]?.['data']?.['id']??null,'description':_0x35b9ea[_0xe55e02(0x128)][_0xe55e02(0x135)]??null,'createdAt':_0x35b9ea[_0xe55e02(0x128)][_0xe55e02(0x13f)],'updatedAt':_0x35b9ea['attributes'][_0xe55e02(0x12d)]};}[a126_0x1c05e4(0x164)](_0x5b02f1,_0x481428){const _0x42671e=a126_0x1c05e4;return{'audienceId':_0x481428,'id':_0x5b02f1['id'],'name':_0x5b02f1[_0x42671e(0x128)][_0x42671e(0x141)],'description':_0x5b02f1[_0x42671e(0x128)][_0x42671e(0x135)]??undefined,'realtime':_0x5b02f1['type']===_0x42671e(0x1b0),'segmentFolderId':_0x5b02f1[_0x42671e(0x128)]['segmentFolderId']??_0x5b02f1[_0x42671e(0x145)]?.[_0x42671e(0x1b8)]?.[_0x42671e(0x160)]?.['id']??undefined,'population':_0x5b02f1[_0x42671e(0x128)][_0x42671e(0x12b)],'createdAt':_0x5b02f1[_0x42671e(0x128)]['createdAt'],'updatedAt':_0x5b02f1['attributes'][_0x42671e(0x12d)]};}async[a126_0x1c05e4(0x15b)](_0x5cfd28,_0x797692,_0x4245ea,_0x2d7027=0xa){const _0x4e2bc2=a126_0x1c05e4;let _0x2d10aa=_0x797692;if(!_0x2d10aa){const _0x4d16ec=await this['getParentFull'](_0x5cfd28);_0x2d10aa=_0x4d16ec[_0x4e2bc2(0x137)];}if(!_0x2d10aa)return[];const _0x50360f=await this[_0x4e2bc2(0x1ba)]['listEntitiesByFolder'](_0x2d10aa,_0x2d7027,![]),_0x48f923=_0x50360f[_0x4e2bc2(0x160)];return this[_0x4e2bc2(0x16f)](_0x48f923,_0x2d10aa);}['buildTreeFromEntities'](_0x486a1,_0x2d68cb){const _0x4fceba=a126_0x1c05e4,_0x3e1e15=new Map();for(const _0x5b646d of _0x486a1){if(_0x5b646d['type']==='folder-segment'&&_0x5b646d['id']===_0x2d68cb)continue;const _0x1e1c2c=this[_0x4fceba(0x1b2)](_0x5b646d)??_0x2d68cb;!_0x3e1e15[_0x4fceba(0x138)](_0x1e1c2c)&&_0x3e1e15[_0x4fceba(0x11b)](_0x1e1c2c,[]),_0x3e1e15[_0x4fceba(0x123)](_0x1e1c2c)[_0x4fceba(0x174)](_0x5b646d);}return this[_0x4fceba(0x14a)](_0x2d68cb,_0x3e1e15);}[a126_0x1c05e4(0x1b2)](_0x28becb){const _0x145013=a126_0x1c05e4;if(_0x28becb['relationships']?.[_0x145013(0x1b8)]?.[_0x145013(0x160)]?.['id'])return _0x28becb[_0x145013(0x145)][_0x145013(0x1b8)][_0x145013(0x160)]['id'];return _0x28becb[_0x145013(0x128)][_0x145013(0x1bb)]??_0x28becb['attributes'][_0x145013(0x178)]??undefined;}['buildTreeNodesForFolder'](_0x54ce72,_0xbf5297){const _0x903a64=a126_0x1c05e4,_0x28ef53=_0xbf5297[_0x903a64(0x123)](_0x54ce72)??[],_0x433303=[],_0x25af61=_0x28ef53[_0x903a64(0x18a)](_0x455247=>_0x455247['type']===_0x903a64(0x191)),_0xb6455e=_0x28ef53[_0x903a64(0x18a)](_0xea82b1=>_0xea82b1[_0x903a64(0x151)]===_0x903a64(0x152)||_0xea82b1[_0x903a64(0x151)]===_0x903a64(0x1b0)),_0x2249a6=_0x28ef53[_0x903a64(0x18a)](_0x26021c=>_0x26021c[_0x903a64(0x151)]==='journey'),_0x1c2f43=_0x2249a6[_0x903a64(0x1a3)](_0x4d9464=>({'journeyBundleId':_0x4d9464[_0x903a64(0x128)][_0x903a64(0x162)],'versionNumber':_0x4d9464[_0x903a64(0x128)][_0x903a64(0x11c)],'id':_0x4d9464['id'],'entity':_0x4d9464})),_0x34688f=deduplicateJourneysByBundle(_0x1c2f43);for(const _0x5a8fea of _0x25af61){const _0x336683=this[_0x903a64(0x14a)](_0x5a8fea['id'],_0xbf5297);_0x433303[_0x903a64(0x174)]({'type':_0x903a64(0x19a),'id':_0x5a8fea['id'],'name':_0x5a8fea[_0x903a64(0x128)][_0x903a64(0x141)],'children':_0x336683['length']>0x0?_0x336683:undefined,'metadata':{'description':_0x5a8fea['attributes']['description']??undefined,'folderCount':_0x336683[_0x903a64(0x18a)](_0x3ce8f2=>_0x3ce8f2['type']===_0x903a64(0x19a))[_0x903a64(0x17a)],'segmentCount':_0x336683[_0x903a64(0x18a)](_0x111a74=>_0x111a74[_0x903a64(0x151)]===_0x903a64(0x184))['length'],'journeyCount':_0x336683['filter'](_0x5ee7c0=>_0x5ee7c0[_0x903a64(0x151)]===_0x903a64(0x14f))[_0x903a64(0x17a)],'createdAt':_0x5a8fea[_0x903a64(0x128)][_0x903a64(0x13f)],'updatedAt':_0x5a8fea[_0x903a64(0x128)]['updatedAt']}});}for(const _0x13c879 of _0xb6455e){_0x433303[_0x903a64(0x174)]({'type':_0x903a64(0x184),'id':_0x13c879['id'],'name':_0x13c879[_0x903a64(0x128)]['name'],'population':_0x13c879[_0x903a64(0x128)][_0x903a64(0x12b)],'metadata':{'description':_0x13c879[_0x903a64(0x128)][_0x903a64(0x135)]??undefined,'createdAt':_0x13c879['attributes'][_0x903a64(0x13f)],'updatedAt':_0x13c879[_0x903a64(0x128)][_0x903a64(0x12d)]}});}for(const _0x5835bf of _0x34688f){const _0xbcc5b=_0x5835bf[_0x903a64(0x1a6)];_0x433303[_0x903a64(0x174)]({'type':_0x903a64(0x14f),'id':_0xbcc5b['id'],'name':_0xbcc5b['attributes'][_0x903a64(0x1a2)]??_0xbcc5b['attributes']['name']??'','state':parseJourneyState(_0xbcc5b[_0x903a64(0x128)][_0x903a64(0x167)]),'metadata':{}});}return _0x433303;}async['pullSegments'](_0x1fbd23,_0x1d1a05={}){const _0x327e09=a126_0x1c05e4,_0x4cfe63=this['getTdxInstance'](),_0x38eee0={'segment':_0x4cfe63[_0x327e09(0x184)],'journey':_0x4cfe63['journey'],'user':_0x4cfe63['user'],'connection':_0x4cfe63[_0x327e09(0x181)]};return a126_0xb9c067(_0x38eee0,_0x1fbd23,_0x1d1a05);}['getTdxInstance'](){const _0x15118f=a126_0x1c05e4;return this[_0x15118f(0x199)];}}
|
|
1
|
+
const a126_0x2b96c3=a126_0x436f;(function(_0x501064,_0x463bd8){const _0x24a130=a126_0x436f,_0x13daf2=_0x501064();while(!![]){try{const _0x2b6e46=parseInt(_0x24a130(0x1b4))/0x1*(-parseInt(_0x24a130(0x127))/0x2)+-parseInt(_0x24a130(0x156))/0x3*(-parseInt(_0x24a130(0x1a5))/0x4)+-parseInt(_0x24a130(0x182))/0x5*(-parseInt(_0x24a130(0x18e))/0x6)+parseInt(_0x24a130(0x151))/0x7*(parseInt(_0x24a130(0x19c))/0x8)+-parseInt(_0x24a130(0x14e))/0x9+-parseInt(_0x24a130(0x1c1))/0xa*(parseInt(_0x24a130(0x17a))/0xb)+parseInt(_0x24a130(0x16c))/0xc;if(_0x2b6e46===_0x463bd8)break;else _0x13daf2['push'](_0x13daf2['shift']());}catch(_0x288cb0){_0x13daf2['push'](_0x13daf2['shift']());}}}(a126_0x15d8,0xae798));import{CDPApiClient}from'./client/cdp-api-client.js';import{TrinoApiClient}from'./client/trino-api-client.js';function a126_0x436f(_0x3002f7,_0x3948ac){_0x3002f7=_0x3002f7-0x123;const _0x15d8e8=a126_0x15d8();let _0x436f60=_0x15d8e8[_0x3002f7];return _0x436f60;}import{SDKError,ErrorCode}from'./errors.js';function a126_0x15d8(){const _0xe3aa40=['schemaValid','segment-batch','segment-realtime','journeyBundleName','Attribute\x20\x27','Counting\x20master\x20table\x20rows...','4330165DpcEUy','behaviors','onProgress','groupingName','getEntityParentFolderId','executeQuery','getSegmentFolder','getParentSegmentSQL','createFolder','parentFolderId','isArray','matched_count','6FKazuE','Path\x20cannot\x20be\x20empty','join','relationships','folder-segment','filter','resolveFolderId','journeyBundleId','behavior','INVALID_ARGUMENT','has','detectResourceType','buildTreeNodesForFolder','createParent','104sHXMCE','then','enriched','parent','parent\x20segment','trinoClient','detectResourceTypeInFolder','getParentSQL','entity','5700052GEhulR','message','source','all','catch','Behavior\x20\x27','push','rowCount','sampleData','interval','segment','pullSegments','resolveSegmentId','parentColumn','length','1185244FplCzi','deleteActivation','createJourneySegment','journey','Parent\x20segment\x20not\x20found:\x20','createSegment','row_count','totalEvents','buildTreeFromEntities','resolveParentIdOrName','error','updatedAt','runParent','1207330kJgUyP','population','getParentSegment','type','pushParentYaml','entityToFolder','getActivation','parentFolder','resolveParentId','get','database','Validating\x20all\x20attributes\x20and\x20behaviors\x20in\x20parallel...','updateParent','pullParentYaml','2Cwapkn','data','Fetching\x20enriched\x20master\x20data...','versionNumber','Validating\x20all\x20attributes\x20in\x20parallel...','customers_with_events','test','Fetching\x20master\x20sample\x20data...','\x27\x20not\x20found\x20in\x20','updateActivation','Calculating\x20coverage\x20for:\x20','Validating\x20master\x20table:\x20','ambiguous','getParentFull','getFolder','parentTableName','segmentFolderId','getParentSegmentFull','state','Enriched\x20query:\x20','connection','\x27\x20not\x20found\x20in\x20path','Fetching\x20sample\x20data\x20for:\x20','child_key','createParentSegment','listEntitiesByFolder','customersWithEvents','\x27\x20not\x20found\x20in\x20parent\x20segment','string','listActivations','entityToSegment','listRecursive','folder','client','map','schema','some','matchedCount','parentDatabaseName','10935630kvlLlw','Validating\x20behavior:\x20','getAudienceBehaviors','180313wyzNPa','listFolders','segments','master','listSegmentFolders','3McmpnZ','table','allValid','isAbsolute','getSegment','schemaError','attribute','createActivation','updateParentSegment','attributes','getSegmentSQL','traversePath','listUnifiedWithJourneys','parent_key','\x20in\x20parent\x20','\x27\x20not\x20found','resolvePathToResource','find','SEGMENT_NOT_FOUND','Resource\x20\x27','createdAt','Master\x20table:\x20','7317384vtQcjm','validateParentYaml','description','updateSegment','Folder\x20\x27','updateSegmentById','deleteSegment','listSegments','set','listParents','Path\x20must\x20be\x20absolute\x20(cannot\x20start\x20with\x20.\x20or\x20..)','\x27:\x20','customerPercent','rootFolderId','11XzufsJ','name'];a126_0x15d8=function(){return _0xe3aa40;};return a126_0x15d8();}import{deduplicateJourneysByBundle,entityToJourneyListItem,parseJourneyState}from'./journey.js';import{parsePath}from'./segment/segment-path-parser.js';import{pullSegments as a126_0x13f71c}from'./segment/pull-workflow.js';import{apiToDef,defToApi,serializeDef,parseDef}from'./segment/parent-segment-yaml.js';import{generateDiff,formatDiffWithColors,hasChanges}from'../utils/diff.js';import{DEFAULT_TIME_RANGE,DEFAULT_SAMPLE_LIMIT,generateSchemaValidationSQL,generateMasterCountSQL,generateMasterSampleSQL,generateAttributeCoverageSQL,generateBehaviorStatsSQL,generateAttributeSampleSQL,generateBehaviorSampleSQL,generateEnrichedSQL,generateAttributeSchemaSQL,generateBehaviorSchemaSQL,findAttributeByName,findBehaviorByName,getAttributeColumns,getBehaviorColumns}from'./segment/parent-segment-preview.js';export class SegmentSDK{[a126_0x2b96c3(0x148)];['trinoClient'];constructor(_0x3c2620){const _0x41eb7d=a126_0x2b96c3;this[_0x41eb7d(0x148)]=new CDPApiClient(_0x3c2620),this[_0x41eb7d(0x1a1)]=new TrinoApiClient(_0x3c2620);}async[a126_0x2b96c3(0x175)](){const _0x23d28f=a126_0x2b96c3;return await this[_0x23d28f(0x148)]['listParentSegments']();}async['getParent'](_0x50d55a){const _0xf1756e=a126_0x2b96c3;return await this[_0xf1756e(0x148)][_0xf1756e(0x1c3)](_0x50d55a);}async[a126_0x2b96c3(0x173)](_0x5be163){const _0x5ce250=a126_0x2b96c3;return await this[_0x5ce250(0x148)][_0x5ce250(0x173)](_0x5be163);}async[a126_0x2b96c3(0x15a)](_0x35bdb8,_0xca6e61){const _0xf70ad9=a126_0x2b96c3;return await this[_0xf70ad9(0x148)]['getSegment'](_0x35bdb8,_0xca6e61);}async[a126_0x2b96c3(0x152)](_0x8f238f){const _0x29fe48=a126_0x2b96c3;return await this[_0x29fe48(0x148)][_0x29fe48(0x155)](_0x8f238f);}async[a126_0x2b96c3(0x135)](_0x29b8df){const _0x89cb96=a126_0x2b96c3;return await this[_0x89cb96(0x148)][_0x89cb96(0x188)](_0x29b8df);}async['listActivations'](_0x21f43d,_0x45e67e){const _0xd4e5bf=a126_0x2b96c3;return await this[_0xd4e5bf(0x148)][_0xd4e5bf(0x144)](_0x21f43d,_0x45e67e);}async['getActivation'](_0x4046ab,_0x107c24,_0x1e3a93){const _0x533377=a126_0x2b96c3;return await this[_0x533377(0x148)][_0x533377(0x1c7)](_0x4046ab,_0x107c24,_0x1e3a93);}async[a126_0x2b96c3(0x15d)](_0x3babeb,_0x5c977c,_0x577f3a){const _0x3873d4=a126_0x2b96c3;return await this[_0x3873d4(0x148)]['createActivation'](_0x3babeb,_0x5c977c,_0x577f3a);}async[a126_0x2b96c3(0x130)](_0x6d143d,_0x635a94,_0x45b7f0,_0x50a18a){const _0x321c55=a126_0x2b96c3;return await this[_0x321c55(0x148)]['updateActivation'](_0x6d143d,_0x635a94,_0x45b7f0,_0x50a18a);}async[a126_0x2b96c3(0x1b5)](_0x1256b6,_0xd38489,_0x40d52c){const _0x59a691=a126_0x2b96c3;return await this[_0x59a691(0x148)]['deleteActivation'](_0x1256b6,_0xd38489,_0x40d52c);}async[a126_0x2b96c3(0x1a3)](_0x357fc5){const _0x4656b8=a126_0x2b96c3;return await this['client'][_0x4656b8(0x189)](_0x357fc5);}async[a126_0x2b96c3(0x160)](_0x1ca9ad,_0x4d825e){const _0x6557f5=a126_0x2b96c3;return await this['client'][_0x6557f5(0x160)](_0x1ca9ad,_0x4d825e);}async[a126_0x2b96c3(0x1c9)](_0xe6fd26){const _0x445409=a126_0x2b96c3,_0x50beaf=await this[_0x445409(0x175)](),_0x389867=_0x50beaf[_0x445409(0x167)](_0x609348=>_0x609348[_0x445409(0x15f)][_0x445409(0x17b)]===_0xe6fd26);if(!_0x389867)throw new SDKError(ErrorCode[_0x445409(0x168)],_0x445409(0x1b8)+_0xe6fd26);return _0x389867['id'];}async[a126_0x2b96c3(0x1c0)](_0x325c58){const _0x1c9626=a126_0x2b96c3;let _0x3a0153=_0x325c58;return!/^\d+$/['test'](_0x325c58)&&(_0x3a0153=await this[_0x1c9626(0x1c9)](_0x325c58)),await this[_0x1c9626(0x148)]['runParentSegment'](_0x3a0153);}async[a126_0x2b96c3(0x1b1)](_0x35ee6c,_0x5d07c7){const _0xc5c26c=a126_0x2b96c3,_0x13f8ca=await this[_0xc5c26c(0x173)](_0x35ee6c),_0x2b3ade=_0x13f8ca[_0xc5c26c(0x167)](_0xe14b6c=>_0xe14b6c[_0xc5c26c(0x17b)]===_0x5d07c7);if(!_0x2b3ade)throw new SDKError(ErrorCode[_0xc5c26c(0x168)],'Child\x20segment\x20not\x20found:\x20'+_0x5d07c7+_0xc5c26c(0x164)+_0x35ee6c);return _0x2b3ade['id'];}async['resolveFolderId'](_0x1b6fa3,_0x15351a){const _0x5665c1=a126_0x2b96c3,_0x107285=await this[_0x5665c1(0x152)](_0x1b6fa3),_0x267584=_0x107285[_0x5665c1(0x167)](_0x4e77db=>_0x4e77db[_0x5665c1(0x17b)]===_0x15351a);if(!_0x267584)throw new SDKError(ErrorCode[_0x5665c1(0x168)],'Folder\x20not\x20found:\x20'+_0x15351a+_0x5665c1(0x164)+_0x1b6fa3);return _0x267584['id'];}async['listFields'](_0x4ad8cc){const _0x1ee9b8=a126_0x2b96c3,_0x2c0780=await this[_0x1ee9b8(0x1bd)](_0x4ad8cc),[_0x382f93,_0x5b0fd5]=await Promise[_0x1ee9b8(0x1a8)]([this[_0x1ee9b8(0x148)]['getAudienceAttributes'](_0x2c0780),this[_0x1ee9b8(0x148)][_0x1ee9b8(0x150)](_0x2c0780)]),_0x403160=[];for(const _0xc180d of _0x382f93){_0x403160[_0x1ee9b8(0x1ab)]({'name':_0xc180d[_0x1ee9b8(0x17b)],'type':_0xc180d['type'],'source':_0x1ee9b8(0x15c),'parentDatabaseName':_0xc180d['parentDatabaseName'],'parentTableName':_0xc180d[_0x1ee9b8(0x136)],'parentColumn':_0xc180d[_0x1ee9b8(0x1b2)],'groupingName':_0xc180d[_0x1ee9b8(0x185)]??undefined});}for(const _0x3f731d of _0x5b0fd5){const _0x54468e=_0x3f731d[_0x1ee9b8(0x17b)];if(_0x3f731d['schema']&&Array[_0x1ee9b8(0x18c)](_0x3f731d[_0x1ee9b8(0x14a)]))for(const _0x5a721d of _0x3f731d[_0x1ee9b8(0x14a)]){_0x5a721d['name']&&_0x5a721d[_0x1ee9b8(0x1c4)]&&_0x403160[_0x1ee9b8(0x1ab)]({'name':_0x54468e+'.'+_0x5a721d['name'],'type':_0x5a721d[_0x1ee9b8(0x1c4)],'source':_0x1ee9b8(0x196),'behaviorName':_0x54468e,'parentDatabaseName':_0x3f731d[_0x1ee9b8(0x14d)],'parentTableName':_0x3f731d[_0x1ee9b8(0x136)],'parentColumn':_0x5a721d[_0x1ee9b8(0x1b2)]});}}return _0x403160;}async[a126_0x2b96c3(0x19b)](_0xe2eda7){const _0x1b218f=a126_0x2b96c3;return await this[_0x1b218f(0x148)][_0x1b218f(0x13f)](_0xe2eda7);}async[a126_0x2b96c3(0x125)](_0x44fd50,_0x135d4e){const _0x489383=a126_0x2b96c3,_0x40950c=await this[_0x489383(0x1bd)](_0x44fd50);return await this[_0x489383(0x148)][_0x489383(0x15e)](_0x40950c,_0x135d4e);}async[a126_0x2b96c3(0x134)](_0x440b60){const _0x555d45=a126_0x2b96c3,_0x205e6a=await this[_0x555d45(0x1bd)](_0x440b60);return await this[_0x555d45(0x148)][_0x555d45(0x138)](_0x205e6a);}async[a126_0x2b96c3(0x126)](_0x4185dc){const _0x552f74=await this['getParentFull'](_0x4185dc),_0x1a4dd8=apiToDef(_0x552f74);return serializeDef(_0x1a4dd8);}async[a126_0x2b96c3(0x1c5)](_0xf42e4){const _0x1ac79c=a126_0x2b96c3,_0x5053ee=typeof _0xf42e4===_0x1ac79c(0x143)?parseDef(_0xf42e4):_0xf42e4,_0x2ec89c=defToApi(_0x5053ee);let _0x565e15=null,_0x4fa031='';try{_0x565e15=await this[_0x1ac79c(0x134)](_0x5053ee[_0x1ac79c(0x17b)]);const _0x455a61=apiToDef(_0x565e15);_0x4fa031=serializeDef(_0x455a61);}catch{}const _0x5a8df7=serializeDef(_0x5053ee),_0x3d7be7=generateDiff(_0x4fa031,_0x5a8df7),_0x157a0e=formatDiffWithColors(_0x3d7be7),_0x427779=_0x565e15===null,_0x14b772=hasChanges(_0x3d7be7),_0x5ea520={'isNew':_0x427779,'id':_0x565e15?.['id']||'','name':_0x5053ee[_0x1ac79c(0x17b)],'diff':_0x3d7be7,'diffFormatted':_0x157a0e,'hasChanges':_0x14b772},_0x19360b=async()=>{const _0x496493=_0x1ac79c;return _0x427779?await this['createParent'](_0x2ec89c):await this[_0x496493(0x125)](_0x565e15['id'],_0x2ec89c);};return{..._0x5ea520,'apply':_0x19360b};}async[a126_0x2b96c3(0x16d)](_0x2dc7c3,_0x155b7a={}){const _0x7f773d=a126_0x2b96c3,_0x13cf8a=typeof _0x2dc7c3===_0x7f773d(0x143)?parseDef(_0x2dc7c3):_0x2dc7c3,_0x35fb5d=[];let _0x6f45d=!![];const _0x51f006=_0xdadb02=>_0x155b7a[_0x7f773d(0x184)]?.(_0xdadb02),_0x4a9cec={'name':_0x13cf8a['name'],'master':{'database':_0x13cf8a[_0x7f773d(0x154)][_0x7f773d(0x123)],'table':_0x13cf8a['master'][_0x7f773d(0x157)],'schemaValid':![]},'attributes':[],'behaviors':[],'errors':_0x35fb5d,'allValid':!![]},_0x14d436=async _0xe6c1cc=>{const _0x4510e2=_0x7f773d;try{const _0x47b6a8=await this[_0x4510e2(0x1a1)]['executeQuery'](_0xe6c1cc);return{'data':_0x47b6a8[_0x4510e2(0x128)]};}catch(_0x186f91){const _0x198b1b=_0x186f91 instanceof Error?_0x186f91[_0x4510e2(0x1a6)]:String(_0x186f91);return{'data':[],'error':_0x198b1b};}};_0x51f006(_0x7f773d(0x132)+_0x13cf8a[_0x7f773d(0x154)]['database']+'.'+_0x13cf8a[_0x7f773d(0x154)][_0x7f773d(0x157)]);const _0x1f3fca=generateSchemaValidationSQL(_0x13cf8a[_0x7f773d(0x154)][_0x7f773d(0x123)],_0x13cf8a['master']['table']),_0x1efa80=await _0x14d436(_0x1f3fca);if(_0x1efa80[_0x7f773d(0x1be)])_0x4a9cec[_0x7f773d(0x154)][_0x7f773d(0x17c)]=![],_0x4a9cec[_0x7f773d(0x154)][_0x7f773d(0x15b)]=_0x1efa80['error'],_0x35fb5d['push'](_0x7f773d(0x16b)+_0x1efa80[_0x7f773d(0x1be)]),_0x6f45d=![];else{_0x4a9cec[_0x7f773d(0x154)][_0x7f773d(0x17c)]=!![],_0x51f006(_0x7f773d(0x181));const _0x5d4e42=await _0x14d436(generateMasterCountSQL(_0x13cf8a));!_0x5d4e42[_0x7f773d(0x1be)]&&_0x5d4e42[_0x7f773d(0x128)][_0x7f773d(0x1b3)]>0x0&&(_0x4a9cec[_0x7f773d(0x154)][_0x7f773d(0x1ac)]=_0x5d4e42[_0x7f773d(0x128)][0x0][_0x7f773d(0x1ba)]);}if(_0x155b7a['master'])return _0x4a9cec['allValid']=_0x6f45d,_0x4a9cec;const _0x412a3d=async _0x588749=>{const _0x199555=_0x7f773d,_0x74acd5={'name':_0x588749['name'],'database':_0x588749['source']['database'],'table':_0x588749['source'][_0x199555(0x157)],'joinKey':_0x588749[_0x199555(0x190)][_0x199555(0x13e)],'foreignKey':_0x588749[_0x199555(0x190)][_0x199555(0x163)],'columns':getAttributeColumns(_0x588749),'schemaValid':![]};_0x51f006('Validating\x20attribute:\x20'+_0x588749['name']);const _0x43e3f8=await _0x14d436(generateAttributeSchemaSQL(_0x13cf8a,_0x588749));if(_0x43e3f8[_0x199555(0x1be)])_0x74acd5['schemaError']=_0x43e3f8['error'];else{_0x74acd5[_0x199555(0x17c)]=!![],_0x51f006(_0x199555(0x131)+_0x588749['name']);const _0x1c3704=await _0x14d436(generateAttributeCoverageSQL(_0x13cf8a,_0x588749));!_0x1c3704[_0x199555(0x1be)]&&_0x1c3704[_0x199555(0x128)][_0x199555(0x1b3)]>0x0&&(_0x74acd5[_0x199555(0x14c)]=_0x1c3704[_0x199555(0x128)][0x0][_0x199555(0x18d)],_0x4a9cec[_0x199555(0x154)][_0x199555(0x1ac)]&&_0x4a9cec[_0x199555(0x154)][_0x199555(0x1ac)]>0x0&&(_0x74acd5['coveragePercent']=_0x74acd5[_0x199555(0x14c)]/_0x4a9cec[_0x199555(0x154)][_0x199555(0x1ac)]*0x64));}return _0x74acd5;},_0x13cc36=async(_0xba8d52,_0x4b4f1c)=>{const _0x1d9a68=_0x7f773d,_0xcdc0d8={'name':_0xba8d52['name'],'database':_0xba8d52[_0x1d9a68(0x1a7)]['database'],'table':_0xba8d52['source'][_0x1d9a68(0x157)],'joinKey':_0xba8d52['join'][_0x1d9a68(0x13e)],'foreignKey':_0xba8d52[_0x1d9a68(0x190)][_0x1d9a68(0x163)],'columns':getBehaviorColumns(_0xba8d52),'schemaValid':![]};_0x51f006(_0x1d9a68(0x14f)+_0xba8d52[_0x1d9a68(0x17b)]);const _0x4c2c5e=await _0x14d436(generateBehaviorSchemaSQL(_0x13cf8a,_0xba8d52));if(_0x4c2c5e[_0x1d9a68(0x1be)])_0xcdc0d8[_0x1d9a68(0x15b)]=_0x4c2c5e[_0x1d9a68(0x1be)];else{_0xcdc0d8[_0x1d9a68(0x17c)]=!![],_0x51f006('Calculating\x20statistics\x20for:\x20'+_0xba8d52['name']+'\x20('+_0x4b4f1c+')');const _0x1727b5=await _0x14d436(generateBehaviorStatsSQL(_0x13cf8a,_0xba8d52,_0x4b4f1c));!_0x1727b5[_0x1d9a68(0x1be)]&&_0x1727b5[_0x1d9a68(0x128)]['length']>0x0&&(_0xcdc0d8[_0x1d9a68(0x141)]=_0x1727b5['data'][0x0][_0x1d9a68(0x12c)],_0xcdc0d8[_0x1d9a68(0x1bb)]=_0x1727b5[_0x1d9a68(0x128)][0x0]['total_events'],_0x4a9cec['master']['rowCount']&&_0x4a9cec[_0x1d9a68(0x154)][_0x1d9a68(0x1ac)]>0x0&&(_0xcdc0d8[_0x1d9a68(0x178)]=_0xcdc0d8[_0x1d9a68(0x141)]/_0x4a9cec['master'][_0x1d9a68(0x1ac)]*0x64));}return _0xcdc0d8;},_0x1ed0f9=(_0x549529,_0x3eb1a4)=>{const _0x53d2c2=_0x7f773d;_0x4a9cec[_0x53d2c2(0x15f)]=_0x549529,_0x4a9cec[_0x53d2c2(0x183)]=_0x3eb1a4;for(const _0x58d156 of _0x549529){!_0x58d156[_0x53d2c2(0x17c)]&&(_0x35fb5d[_0x53d2c2(0x1ab)]('Attribute\x20\x27'+_0x58d156[_0x53d2c2(0x17b)]+'\x27:\x20'+_0x58d156[_0x53d2c2(0x15b)]),_0x6f45d=![]);}for(const _0x5b368e of _0x3eb1a4){!_0x5b368e['schemaValid']&&(_0x35fb5d[_0x53d2c2(0x1ab)](_0x53d2c2(0x1aa)+_0x5b368e[_0x53d2c2(0x17b)]+_0x53d2c2(0x177)+_0x5b368e[_0x53d2c2(0x15b)]),_0x6f45d=![]);}},_0x17e072=_0x155b7a[_0x7f773d(0x1ae)]||DEFAULT_TIME_RANGE;if(typeof _0x155b7a[_0x7f773d(0x15c)]===_0x7f773d(0x143)){const _0x37043a=findAttributeByName(_0x13cf8a,_0x155b7a[_0x7f773d(0x15c)]);if(!_0x37043a)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x7f773d(0x180)+_0x155b7a[_0x7f773d(0x15c)]+'\x27\x20not\x20found');const _0x244bde=await _0x412a3d(_0x37043a);return _0x1ed0f9([_0x244bde],[]),_0x4a9cec['allValid']=_0x6f45d,_0x4a9cec;}if(_0x155b7a[_0x7f773d(0x15c)]===!![]){_0x51f006(_0x7f773d(0x12b));const _0x4e35f4=await Promise['all']((_0x13cf8a[_0x7f773d(0x15f)]||[])[_0x7f773d(0x149)](_0x19dc3a=>_0x412a3d(_0x19dc3a)));return _0x1ed0f9(_0x4e35f4,[]),_0x4a9cec[_0x7f773d(0x158)]=_0x6f45d,_0x4a9cec;}if(typeof _0x155b7a['behavior']===_0x7f773d(0x143)){const _0x4f2423=findBehaviorByName(_0x13cf8a,_0x155b7a[_0x7f773d(0x196)]);if(!_0x4f2423)throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x7f773d(0x1aa)+_0x155b7a[_0x7f773d(0x196)]+_0x7f773d(0x165));const _0x489b66=await _0x13cc36(_0x4f2423,_0x17e072);return _0x1ed0f9([],[_0x489b66]),_0x4a9cec[_0x7f773d(0x158)]=_0x6f45d,_0x4a9cec;}if(_0x155b7a[_0x7f773d(0x196)]===!![]){_0x51f006('Validating\x20all\x20behaviors\x20in\x20parallel...');const _0x5cb931=await Promise['all']((_0x13cf8a[_0x7f773d(0x183)]||[])[_0x7f773d(0x149)](_0x3e6168=>_0x13cc36(_0x3e6168,_0x17e072)));return _0x1ed0f9([],_0x5cb931),_0x4a9cec[_0x7f773d(0x158)]=_0x6f45d,_0x4a9cec;}if(_0x155b7a[_0x7f773d(0x19e)]){_0x51f006(_0x7f773d(0x12b));const _0x559cc8=await Promise[_0x7f773d(0x1a8)]((_0x13cf8a[_0x7f773d(0x15f)]||[])[_0x7f773d(0x149)](_0x3c8117=>_0x412a3d(_0x3c8117)));return _0x1ed0f9(_0x559cc8,[]),_0x4a9cec[_0x7f773d(0x158)]=_0x6f45d,_0x4a9cec;}_0x51f006(_0x7f773d(0x124));const [_0x4237b7,_0x5e0c87]=await Promise[_0x7f773d(0x1a8)]([Promise[_0x7f773d(0x1a8)]((_0x13cf8a[_0x7f773d(0x15f)]||[])[_0x7f773d(0x149)](_0x5b5227=>_0x412a3d(_0x5b5227))),Promise[_0x7f773d(0x1a8)]((_0x13cf8a[_0x7f773d(0x183)]||[])[_0x7f773d(0x149)](_0x126fa9=>_0x13cc36(_0x126fa9,_0x17e072)))]);return _0x1ed0f9(_0x4237b7,_0x5e0c87),_0x4a9cec[_0x7f773d(0x158)]=_0x6f45d,_0x4a9cec;}async['previewParentYaml'](_0x2803bf,_0x3ef640={}){const _0x10cc95=a126_0x2b96c3,_0x630bbb=typeof _0x2803bf===_0x10cc95(0x143)?parseDef(_0x2803bf):_0x2803bf,_0x4fb614=[];let _0x5c936d=!![];const _0x2d859c=_0x41dbe1=>_0x3ef640[_0x10cc95(0x184)]?.(_0x41dbe1),_0x37efa3={'name':_0x630bbb[_0x10cc95(0x17b)],'master':{'database':_0x630bbb[_0x10cc95(0x154)][_0x10cc95(0x123)],'table':_0x630bbb[_0x10cc95(0x154)][_0x10cc95(0x157)],'schemaValid':!![]},'attributes':[],'behaviors':[],'errors':_0x4fb614,'allValid':!![]},_0x2dc1ac=async _0x26cedd=>{const _0x2a7a60=_0x10cc95;try{const _0x435d5d=await this[_0x2a7a60(0x1a1)][_0x2a7a60(0x187)](_0x26cedd);return{'data':_0x435d5d[_0x2a7a60(0x128)]};}catch(_0x10ffed){const _0x2661c4=_0x10ffed instanceof Error?_0x10ffed[_0x2a7a60(0x1a6)]:String(_0x10ffed);return{'data':[],'error':_0x2661c4};}};if(_0x3ef640[_0x10cc95(0x154)]){_0x2d859c(_0x10cc95(0x12e));const _0x47aff7=generateMasterSampleSQL(_0x630bbb,DEFAULT_SAMPLE_LIMIT),_0x4d3b3f=await _0x2dc1ac(_0x47aff7);return!_0x4d3b3f['error']?_0x37efa3['sampleData']=_0x4d3b3f[_0x10cc95(0x128)]:(_0x4fb614['push'](_0x10cc95(0x16b)+_0x4d3b3f[_0x10cc95(0x1be)]),_0x5c936d=![]),_0x37efa3['allValid']=_0x5c936d,_0x37efa3;}if(_0x3ef640['attribute']){const _0x1f91dc=findAttributeByName(_0x630bbb,_0x3ef640['attribute']);if(!_0x1f91dc)throw new SDKError(ErrorCode[_0x10cc95(0x168)],_0x10cc95(0x180)+_0x3ef640['attribute']+'\x27\x20not\x20found');_0x2d859c('Fetching\x20sample\x20data\x20for:\x20'+_0x1f91dc[_0x10cc95(0x17b)]);const _0xcc1220=generateAttributeSampleSQL(_0x630bbb,_0x1f91dc,DEFAULT_SAMPLE_LIMIT),_0x506cbb=await _0x2dc1ac(_0xcc1220);return!_0x506cbb[_0x10cc95(0x1be)]?_0x37efa3[_0x10cc95(0x1ad)]=_0x506cbb['data']:(_0x4fb614[_0x10cc95(0x1ab)]('Attribute\x20\x27'+_0x1f91dc[_0x10cc95(0x17b)]+_0x10cc95(0x177)+_0x506cbb[_0x10cc95(0x1be)]),_0x5c936d=![]),_0x37efa3[_0x10cc95(0x158)]=_0x5c936d,_0x37efa3;}if(_0x3ef640[_0x10cc95(0x196)]){const _0x1f99e2=findBehaviorByName(_0x630bbb,_0x3ef640[_0x10cc95(0x196)]);if(!_0x1f99e2)throw new SDKError(ErrorCode[_0x10cc95(0x168)],'Behavior\x20\x27'+_0x3ef640[_0x10cc95(0x196)]+_0x10cc95(0x165));const _0x10d5e2=_0x3ef640[_0x10cc95(0x1ae)]||DEFAULT_TIME_RANGE;_0x2d859c(_0x10cc95(0x13d)+_0x1f99e2[_0x10cc95(0x17b)]+'\x20('+_0x10d5e2+')');const _0x3cc336=generateBehaviorSampleSQL(_0x630bbb,_0x1f99e2,DEFAULT_SAMPLE_LIMIT,_0x10d5e2),_0x424ad1=await _0x2dc1ac(_0x3cc336);return!_0x424ad1[_0x10cc95(0x1be)]?_0x37efa3[_0x10cc95(0x1ad)]=_0x424ad1['data']:(_0x4fb614[_0x10cc95(0x1ab)]('Behavior\x20\x27'+_0x1f99e2[_0x10cc95(0x17b)]+_0x10cc95(0x177)+_0x424ad1[_0x10cc95(0x1be)]),_0x5c936d=![]),_0x37efa3[_0x10cc95(0x158)]=_0x5c936d,_0x37efa3;}if(_0x3ef640[_0x10cc95(0x19e)]){_0x2d859c(_0x10cc95(0x129));const _0x3d2b95=generateEnrichedSQL(_0x630bbb,DEFAULT_SAMPLE_LIMIT),_0x1bd708=await _0x2dc1ac(_0x3d2b95);return!_0x1bd708[_0x10cc95(0x1be)]?_0x37efa3[_0x10cc95(0x1ad)]=_0x1bd708[_0x10cc95(0x128)]:(_0x4fb614[_0x10cc95(0x1ab)](_0x10cc95(0x13a)+_0x1bd708['error']),_0x5c936d=![]),_0x37efa3[_0x10cc95(0x158)]=_0x5c936d,_0x37efa3;}return _0x37efa3[_0x10cc95(0x158)]=_0x5c936d,_0x37efa3;}async[a126_0x2b96c3(0x1b9)](_0x1ccf17,_0x85bec3){const _0x54aab0=a126_0x2b96c3;return await this[_0x54aab0(0x148)]['createSegment'](_0x1ccf17,_0x85bec3);}async['createJourneySegment'](_0x1a6c24){const _0x5a75a2=a126_0x2b96c3;return await this[_0x5a75a2(0x148)][_0x5a75a2(0x1b6)](_0x1a6c24);}async[a126_0x2b96c3(0x171)](_0x5e59dd,_0x4eb828,_0x5d1cf5){const _0x2c748f=a126_0x2b96c3;return await this['client'][_0x2c748f(0x16f)](_0x5e59dd,_0x4eb828,_0x5d1cf5);}async[a126_0x2b96c3(0x172)](_0x20de7d){const _0x1e4112=a126_0x2b96c3;return await this[_0x1e4112(0x148)]['deleteSegment'](_0x20de7d);}async[a126_0x2b96c3(0x18a)](_0x466586,_0x1df777){const _0x34b2dc=a126_0x2b96c3,_0xcf4ee8=await this[_0x34b2dc(0x1bd)](_0x466586);return await this[_0x34b2dc(0x148)]['createSegmentFolder'](_0xcf4ee8,_0x1df777);}async[a126_0x2b96c3(0x1bd)](_0x1af1c7){const _0x3f8cb4=a126_0x2b96c3;if(/^\d+$/[_0x3f8cb4(0x12d)](_0x1af1c7))return _0x1af1c7;return await this['resolveParentId'](_0x1af1c7);}async[a126_0x2b96c3(0x199)](_0x288b39,_0x16cca2){const _0x5f4441=a126_0x2b96c3,[_0x5b1fff,_0x221a6e]=await Promise[_0x5f4441(0x1a8)]([this[_0x5f4441(0x194)](_0x288b39,_0x16cca2)['then'](()=>!![])[_0x5f4441(0x1a9)](()=>![]),this[_0x5f4441(0x1b1)](_0x288b39,_0x16cca2)[_0x5f4441(0x19d)](()=>!![])[_0x5f4441(0x1a9)](()=>![])]);if(_0x5b1fff&&_0x221a6e)return _0x5f4441(0x133);else{if(_0x5b1fff)return'folder';else{if(_0x221a6e)return _0x5f4441(0x1af);}}throw new SDKError(ErrorCode['SEGMENT_NOT_FOUND'],_0x5f4441(0x169)+_0x16cca2+_0x5f4441(0x142));}async[a126_0x2b96c3(0x1a2)](_0x28199e,_0x20d70b,_0x36261f){const _0x12da33=a126_0x2b96c3,[_0x59deb9,_0x127fa0]=await Promise['all']([this['listFolders'](_0x28199e),this[_0x12da33(0x173)](_0x28199e)]),_0x3a940d=_0x36261f?_0x59deb9['filter'](_0xa0f434=>_0xa0f434[_0x12da33(0x18b)]===_0x36261f):_0x59deb9[_0x12da33(0x193)](_0xc92b05=>!_0xc92b05[_0x12da33(0x18b)]),_0x4dcf0b=_0x36261f?_0x127fa0[_0x12da33(0x193)](_0x101e0d=>_0x101e0d[_0x12da33(0x137)]===_0x36261f):_0x127fa0[_0x12da33(0x193)](_0x4d2cd6=>!_0x4d2cd6[_0x12da33(0x137)]),_0x55530c=_0x3a940d[_0x12da33(0x14b)](_0x5c68be=>_0x5c68be[_0x12da33(0x17b)]===_0x20d70b),_0x3d33e7=_0x4dcf0b[_0x12da33(0x14b)](_0x105133=>_0x105133[_0x12da33(0x17b)]===_0x20d70b);if(_0x55530c&&_0x3d33e7)return _0x12da33(0x133);else{if(_0x55530c)return _0x12da33(0x147);else{if(_0x3d33e7)return'segment';}}throw new SDKError(ErrorCode[_0x12da33(0x168)],_0x12da33(0x169)+_0x20d70b+_0x12da33(0x12f)+(_0x36261f?_0x12da33(0x147):_0x12da33(0x1a0)));}async[a126_0x2b96c3(0x161)](_0x503080){const _0x2667c0=a126_0x2b96c3;if(_0x503080['length']===0x0)throw new SDKError(ErrorCode[_0x2667c0(0x197)],_0x2667c0(0x18f));const _0x9e1a16=_0x503080[0x0],_0x50ee2b=await this[_0x2667c0(0x1c9)](_0x9e1a16);if(_0x503080[_0x2667c0(0x1b3)]===0x1)return{'parentId':_0x50ee2b,'parentName':_0x9e1a16,'type':_0x2667c0(0x19f),'fullPath':_0x9e1a16};const _0x69b8b0=await this[_0x2667c0(0x134)](_0x50ee2b),_0x4fb5b0=_0x69b8b0['rootFolderId'],_0x45b71e=[];let _0x35338=_0x4fb5b0;for(let _0x29b5e1=0x1;_0x29b5e1<_0x503080[_0x2667c0(0x1b3)]-0x1;_0x29b5e1++){const _0x4f7499=_0x503080[_0x29b5e1],_0x39bb3=await this[_0x2667c0(0x152)](_0x50ee2b),_0x2e9102=_0x35338?_0x39bb3[_0x2667c0(0x167)](_0x40b267=>_0x40b267[_0x2667c0(0x17b)]===_0x4f7499&&_0x40b267[_0x2667c0(0x18b)]===_0x35338):_0x39bb3[_0x2667c0(0x167)](_0x2362d5=>_0x2362d5[_0x2667c0(0x17b)]===_0x4f7499&&!_0x2362d5[_0x2667c0(0x18b)]);if(!_0x2e9102)throw new SDKError(ErrorCode[_0x2667c0(0x168)],_0x2667c0(0x170)+_0x4f7499+_0x2667c0(0x13c));_0x45b71e[_0x2667c0(0x1ab)](_0x4f7499),_0x35338=_0x2e9102['id'];}const _0x7d819=_0x503080[_0x503080[_0x2667c0(0x1b3)]-0x1],_0x2c93e6=await this[_0x2667c0(0x1a2)](_0x50ee2b,_0x7d819,_0x35338);if(_0x2c93e6==='ambiguous'||_0x2c93e6===_0x2667c0(0x147)){const _0x541146=await this['listFolders'](_0x50ee2b),_0x1ef998=_0x35338?_0x541146['find'](_0x497e27=>_0x497e27[_0x2667c0(0x17b)]===_0x7d819&&_0x497e27[_0x2667c0(0x18b)]===_0x35338):_0x541146[_0x2667c0(0x167)](_0x5b8d78=>_0x5b8d78['name']===_0x7d819&&!_0x5b8d78[_0x2667c0(0x18b)]);if(!_0x1ef998)throw new SDKError(ErrorCode[_0x2667c0(0x168)],_0x2667c0(0x170)+_0x7d819+'\x27\x20not\x20found');return _0x45b71e[_0x2667c0(0x1ab)](_0x7d819),{'parentId':_0x50ee2b,'parentName':_0x9e1a16,'folderId':_0x1ef998['id'],'folderPath':_0x45b71e,'type':_0x2667c0(0x147),'fullPath':_0x503080[_0x2667c0(0x190)]('/')};}else{const _0x5b6e2c=await this[_0x2667c0(0x173)](_0x50ee2b),_0x33560f=_0x35338?_0x5b6e2c[_0x2667c0(0x167)](_0x5cc543=>_0x5cc543['name']===_0x7d819&&_0x5cc543[_0x2667c0(0x137)]===_0x35338):_0x5b6e2c['find'](_0x486738=>_0x486738[_0x2667c0(0x17b)]===_0x7d819&&!_0x486738[_0x2667c0(0x137)]);if(!_0x33560f)throw new SDKError(ErrorCode[_0x2667c0(0x168)],'Segment\x20\x27'+_0x7d819+'\x27\x20not\x20found');return{'parentId':_0x50ee2b,'parentName':_0x9e1a16,'folderId':_0x35338,'folderPath':_0x45b71e['length']>0x0?_0x45b71e:undefined,'segmentId':_0x33560f['id'],'segmentName':_0x7d819,'type':_0x2667c0(0x1af),'fullPath':_0x503080[_0x2667c0(0x190)]('/')};}}async[a126_0x2b96c3(0x166)](_0x2e4066){const _0x2bb74e=a126_0x2b96c3,_0x2e15f3=parsePath(_0x2e4066);if(!_0x2e15f3[_0x2bb74e(0x159)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x2bb74e(0x176));return await this[_0x2bb74e(0x161)](_0x2e15f3[_0x2bb74e(0x153)]);}async[a126_0x2b96c3(0x162)](_0x3e6bc0,_0x26512f){const _0x2275ff=a126_0x2b96c3;let _0x5f10a2=_0x26512f;if(!_0x5f10a2){const _0x2701a7=await this[_0x2275ff(0x134)](_0x3e6bc0);_0x5f10a2=_0x2701a7[_0x2275ff(0x179)];}if(!_0x5f10a2)return{'folders':[],'segments':[],'journeys':[]};const _0x479457=await this[_0x2275ff(0x148)]['listEntitiesByFolder'](_0x5f10a2,0x1,![]),_0x233f30=_0x479457[_0x2275ff(0x128)],_0x5d6aa9=_0x233f30[_0x2275ff(0x193)](_0x3fa0cf=>{const _0x5a9f37=_0x2275ff;if(_0x3fa0cf['id']===_0x5f10a2)return![];const _0x2de104=this[_0x5a9f37(0x186)](_0x3fa0cf);return _0x2de104===_0x5f10a2||!_0x2de104;}),_0x3294b3=_0x5d6aa9['filter'](_0x648244=>_0x648244[_0x2275ff(0x1c4)]===_0x2275ff(0x192))['map'](_0x4fd2ed=>this[_0x2275ff(0x1c6)](_0x4fd2ed,_0x3e6bc0)),_0xd2d160=_0x5d6aa9[_0x2275ff(0x193)](_0x5b87aa=>_0x5b87aa[_0x2275ff(0x1c4)]===_0x2275ff(0x17d)||_0x5b87aa[_0x2275ff(0x1c4)]===_0x2275ff(0x17e))[_0x2275ff(0x149)](_0x1c527d=>this['entityToSegment'](_0x1c527d,_0x3e6bc0)),_0x5e9859=_0x5d6aa9[_0x2275ff(0x193)](_0x4a8384=>_0x4a8384['type']==='journey'),_0x41fa36=_0x5e9859[_0x2275ff(0x149)](_0x24a2fc=>({'journeyBundleId':_0x24a2fc[_0x2275ff(0x15f)][_0x2275ff(0x195)],'versionNumber':_0x24a2fc[_0x2275ff(0x15f)][_0x2275ff(0x12a)],'id':_0x24a2fc['id'],'entity':_0x24a2fc})),_0x56d205=deduplicateJourneysByBundle(_0x41fa36),_0x2c0276=_0x56d205[_0x2275ff(0x149)](_0x431507=>entityToJourneyListItem(_0x431507[_0x2275ff(0x1a4)],_0x3e6bc0));return{'folders':_0x3294b3,'segments':_0xd2d160,'journeys':_0x2c0276};}[a126_0x2b96c3(0x1c6)](_0x2cd8b2,_0x1b941e){const _0x2f2db3=a126_0x2b96c3;return{'audienceId':_0x1b941e,'id':_0x2cd8b2['id'],'name':_0x2cd8b2[_0x2f2db3(0x15f)]['name'],'parentFolderId':_0x2cd8b2[_0x2f2db3(0x15f)][_0x2f2db3(0x18b)]??_0x2cd8b2[_0x2f2db3(0x191)]?.[_0x2f2db3(0x1c8)]?.[_0x2f2db3(0x128)]?.['id']??null,'description':_0x2cd8b2[_0x2f2db3(0x15f)][_0x2f2db3(0x16e)]??null,'createdAt':_0x2cd8b2[_0x2f2db3(0x15f)][_0x2f2db3(0x16a)],'updatedAt':_0x2cd8b2[_0x2f2db3(0x15f)]['updatedAt']};}[a126_0x2b96c3(0x145)](_0x439870,_0x35f4e0){const _0x5a9584=a126_0x2b96c3;return{'audienceId':_0x35f4e0,'id':_0x439870['id'],'name':_0x439870['attributes'][_0x5a9584(0x17b)],'description':_0x439870[_0x5a9584(0x15f)][_0x5a9584(0x16e)]??undefined,'realtime':_0x439870[_0x5a9584(0x1c4)]==='segment-realtime','segmentFolderId':_0x439870[_0x5a9584(0x15f)]['segmentFolderId']??_0x439870[_0x5a9584(0x191)]?.[_0x5a9584(0x1c8)]?.[_0x5a9584(0x128)]?.['id']??undefined,'population':_0x439870[_0x5a9584(0x15f)][_0x5a9584(0x1c2)],'createdAt':_0x439870[_0x5a9584(0x15f)][_0x5a9584(0x16a)],'updatedAt':_0x439870[_0x5a9584(0x15f)]['updatedAt']};}async[a126_0x2b96c3(0x146)](_0x8033af,_0x4aac6c,_0x256f8d,_0x50d118=0xa){const _0x515056=a126_0x2b96c3;let _0x59ae74=_0x4aac6c;if(!_0x59ae74){const _0x1f0e64=await this[_0x515056(0x134)](_0x8033af);_0x59ae74=_0x1f0e64[_0x515056(0x179)];}if(!_0x59ae74)return[];const _0x1db56c=await this['client'][_0x515056(0x140)](_0x59ae74,_0x50d118,![]),_0x56ed35=_0x1db56c[_0x515056(0x128)];return this[_0x515056(0x1bc)](_0x56ed35,_0x59ae74);}[a126_0x2b96c3(0x1bc)](_0x1eab58,_0x269fd4){const _0x2fad45=a126_0x2b96c3,_0x5d82b4=new Map();for(const _0x1efbb8 of _0x1eab58){if(_0x1efbb8[_0x2fad45(0x1c4)]==='folder-segment'&&_0x1efbb8['id']===_0x269fd4)continue;const _0x117d18=this[_0x2fad45(0x186)](_0x1efbb8)??_0x269fd4;!_0x5d82b4[_0x2fad45(0x198)](_0x117d18)&&_0x5d82b4[_0x2fad45(0x174)](_0x117d18,[]),_0x5d82b4['get'](_0x117d18)[_0x2fad45(0x1ab)](_0x1efbb8);}return this[_0x2fad45(0x19a)](_0x269fd4,_0x5d82b4);}['getEntityParentFolderId'](_0x200bce){const _0x532031=a126_0x2b96c3;if(_0x200bce['relationships']?.[_0x532031(0x1c8)]?.[_0x532031(0x128)]?.['id'])return _0x200bce['relationships'][_0x532031(0x1c8)][_0x532031(0x128)]['id'];return _0x200bce['attributes'][_0x532031(0x18b)]??_0x200bce[_0x532031(0x15f)][_0x532031(0x137)]??undefined;}[a126_0x2b96c3(0x19a)](_0x3a6319,_0x19f2d8){const _0x509239=a126_0x2b96c3,_0x19acfb=_0x19f2d8[_0x509239(0x1ca)](_0x3a6319)??[],_0x368841=[],_0x41d486=_0x19acfb['filter'](_0x377d56=>_0x377d56[_0x509239(0x1c4)]===_0x509239(0x192)),_0x2da991=_0x19acfb[_0x509239(0x193)](_0xf421c9=>_0xf421c9['type']===_0x509239(0x17d)||_0xf421c9[_0x509239(0x1c4)]===_0x509239(0x17e)),_0x558915=_0x19acfb['filter'](_0x47db79=>_0x47db79[_0x509239(0x1c4)]==='journey'),_0x536946=_0x558915['map'](_0x413f14=>({'journeyBundleId':_0x413f14[_0x509239(0x15f)][_0x509239(0x195)],'versionNumber':_0x413f14[_0x509239(0x15f)][_0x509239(0x12a)],'id':_0x413f14['id'],'entity':_0x413f14})),_0xc315ed=deduplicateJourneysByBundle(_0x536946);for(const _0x57f3cc of _0x41d486){const _0x52ea18=this[_0x509239(0x19a)](_0x57f3cc['id'],_0x19f2d8);_0x368841[_0x509239(0x1ab)]({'type':_0x509239(0x147),'id':_0x57f3cc['id'],'name':_0x57f3cc[_0x509239(0x15f)]['name'],'children':_0x52ea18['length']>0x0?_0x52ea18:undefined,'metadata':{'description':_0x57f3cc[_0x509239(0x15f)][_0x509239(0x16e)]??undefined,'folderCount':_0x52ea18[_0x509239(0x193)](_0x1c0fb3=>_0x1c0fb3[_0x509239(0x1c4)]==='folder')[_0x509239(0x1b3)],'segmentCount':_0x52ea18[_0x509239(0x193)](_0x3aa934=>_0x3aa934[_0x509239(0x1c4)]===_0x509239(0x1af))['length'],'journeyCount':_0x52ea18[_0x509239(0x193)](_0x5decfd=>_0x5decfd[_0x509239(0x1c4)]===_0x509239(0x1b7))[_0x509239(0x1b3)],'createdAt':_0x57f3cc[_0x509239(0x15f)][_0x509239(0x16a)],'updatedAt':_0x57f3cc[_0x509239(0x15f)][_0x509239(0x1bf)]}});}for(const _0x3df238 of _0x2da991){_0x368841[_0x509239(0x1ab)]({'type':_0x509239(0x1af),'id':_0x3df238['id'],'name':_0x3df238[_0x509239(0x15f)][_0x509239(0x17b)],'population':_0x3df238[_0x509239(0x15f)][_0x509239(0x1c2)],'metadata':{'description':_0x3df238[_0x509239(0x15f)]['description']??undefined,'createdAt':_0x3df238[_0x509239(0x15f)]['createdAt'],'updatedAt':_0x3df238[_0x509239(0x15f)][_0x509239(0x1bf)]}});}for(const _0x1c4a0e of _0xc315ed){const _0x3a9536=_0x1c4a0e[_0x509239(0x1a4)];_0x368841[_0x509239(0x1ab)]({'type':_0x509239(0x1b7),'id':_0x3a9536['id'],'name':_0x3a9536['attributes'][_0x509239(0x17f)]??_0x3a9536[_0x509239(0x15f)][_0x509239(0x17b)]??'','state':parseJourneyState(_0x3a9536['attributes'][_0x509239(0x139)]),'metadata':{}});}return _0x368841;}async[a126_0x2b96c3(0x1b0)](_0x5c21e7,_0x2ce7d6={}){const _0xc4ee52=a126_0x2b96c3,_0x549377=this['getTdxInstance'](),_0x4c740c={'segment':_0x549377[_0xc4ee52(0x1af)],'journey':_0x549377[_0xc4ee52(0x1b7)],'user':_0x549377['user'],'connection':_0x549377[_0xc4ee52(0x13b)]};return a126_0x13f71c(_0x4c740c,_0x5c21e7,_0x2ce7d6);}['getTdxInstance'](){return this['_tdxInstance'];}}
|
package/dist/sdk/types/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a133_0x388bc3=a133_0x1769;(function(_0x227a2f,_0x471490){const _0x4f1a6d=a133_0x1769,_0x3d9540=_0x227a2f();while(!![]){try{const _0x2d0978=parseInt(_0x4f1a6d(0x7c))/0x1+parseInt(_0x4f1a6d(0x7f))/0x2*(-parseInt(_0x4f1a6d(0x78))/0x3)+parseInt(_0x4f1a6d(0x77))/0x4*(parseInt(_0x4f1a6d(0x7b))/0x5)+-parseInt(_0x4f1a6d(0x7e))/0x6+-parseInt(_0x4f1a6d(0x80))/0x7+parseInt(_0x4f1a6d(0x81))/0x8+-parseInt(_0x4f1a6d(0x76))/0x9*(-parseInt(_0x4f1a6d(0x79))/0xa);if(_0x2d0978===_0x471490)break;else _0x3d9540['push'](_0x3d9540['shift']());}catch(_0x99885f){_0x3d9540['push'](_0x3d9540['shift']());}}}(a133_0x28b5,0xa680a));function a133_0x28b5(){const _0x4129b1=['stg-us01','455zYlbrg','145297bADDle','us01','4238454DErMiP','65564cGolfp','1819461fqDbvR','360864WdwNOy','jp01','15580701wRBHof','41304IjesGc','111WQkodV','10pjHhRg'];a133_0x28b5=function(){return _0x4129b1;};return a133_0x28b5();}export const SITE_ALIASES={'us':a133_0x388bc3(0x7d),'aws':a133_0x388bc3(0x7d),'jp':a133_0x388bc3(0x75),'aws-tokyo':'jp01','dev':'dev-us01','stg':a133_0x388bc3(0x7a)};export{getEndpoint,API_ENDPOINTS}from'../client/endpoints.js';function a133_0x1769(_0x14951d,_0x27c400){_0x14951d=_0x14951d-0x75;const _0x28b520=a133_0x28b5();let _0x176961=_0x28b520[_0x14951d];return _0x176961;}export{noopReporter}from'./progress.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
function a136_0x4e25(_0x1320c7,_0x272b2e){_0x1320c7=_0x1320c7-0x141;const _0x1b4614=a136_0x1b46();let _0x4e2568=_0x1b4614[_0x1320c7];return _0x4e2568;}(function(_0x1cb48c,_0x276bf5){const _0x4177fc=a136_0x4e25,_0x403d3d=_0x1cb48c();while(!![]){try{const _0x1860b7=parseInt(_0x4177fc(0x149))/0x1+parseInt(_0x4177fc(0x143))/0x2+parseInt(_0x4177fc(0x148))/0x3*(-parseInt(_0x4177fc(0x145))/0x4)+parseInt(_0x4177fc(0x146))/0x5+parseInt(_0x4177fc(0x141))/0x6*(parseInt(_0x4177fc(0x144))/0x7)+parseInt(_0x4177fc(0x147))/0x8+-parseInt(_0x4177fc(0x142))/0x9;if(_0x1860b7===_0x276bf5)break;else _0x403d3d['push'](_0x403d3d['shift']());}catch(_0x381783){_0x403d3d['push'](_0x403d3d['shift']());}}}(a136_0x1b46,0x65949));function a136_0x1b46(){const _0x4cb465=['1073228GSYKDk','126hYkZoO','30364dShkvu','2779320cKuwvX','2670744monniS','33XHNzEV','605497vhWSVo','5652ntRvum','13942800rdoEOZ'];a136_0x1b46=function(){return _0x4cb465;};return a136_0x1b46();}export const noopReporter={'update':()=>{}};
|
package/dist/sdk/user.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a140_0x524f(_0x18459e,_0x1f5076){_0x18459e=_0x18459e-0x16d;const _0x281e77=a140_0x281e();let _0x524f51=_0x281e77[_0x18459e];return _0x524f51;}const a140_0x4b8714=a140_0x524f;(function(_0x187b1d,_0x17ab6a){const _0x5a35c1=a140_0x524f,_0x5863c7=_0x187b1d();while(!![]){try{const _0x364f61=parseInt(_0x5a35c1(0x16e))/0x1*(-parseInt(_0x5a35c1(0x170))/0x2)+-parseInt(_0x5a35c1(0x180))/0x3+-parseInt(_0x5a35c1(0x17e))/0x4*(-parseInt(_0x5a35c1(0x174))/0x5)+parseInt(_0x5a35c1(0x171))/0x6*(-parseInt(_0x5a35c1(0x173))/0x7)+parseInt(_0x5a35c1(0x16d))/0x8*(parseInt(_0x5a35c1(0x183))/0x9)+parseInt(_0x5a35c1(0x17f))/0xa+parseInt(_0x5a35c1(0x17b))/0xb;if(_0x364f61===_0x17ab6a)break;else _0x5863c7['push'](_0x5863c7['shift']());}catch(_0x1a68c1){_0x5863c7['push'](_0x5863c7['shift']());}}}(a140_0x281e,0x3916f));function a140_0x281e(){const _0x43052e=['client','profile','find','list','534930XTKoKb','map','buildUserMaps','44PMjEHY','2846480llVXGY','442866eCCkMq','buildEmailToIdMap','email','4266YOqrrI','getCurrent','2632vDfTdN','4158QSxyrM','toLowerCase','76OjVPjW','276vYBqLL','clearCache','39256XXVorG','140095oRbQQt','getUserInfo','default'];a140_0x281e=function(){return _0x43052e;};return a140_0x281e();}import{TDApiClient}from'./client/td-api-client.js';import{loadCachedUsers,saveCachedUsers,clearUserCache}from'../core/user-cache.js';export class UserSDK{['client'];[a140_0x4b8714(0x178)];constructor(_0x5afdea){const _0x169ae7=a140_0x4b8714;this[_0x169ae7(0x177)]=new TDApiClient(_0x5afdea),this[_0x169ae7(0x178)]=_0x5afdea[_0x169ae7(0x178)]||_0x169ae7(0x176);}async[a140_0x4b8714(0x184)](){const _0x4d2de8=a140_0x4b8714;return await this[_0x4d2de8(0x177)][_0x4d2de8(0x175)]();}async['list'](_0x183469=![]){const _0x201d5c=a140_0x4b8714;if(!_0x183469){const _0x4204d3=loadCachedUsers(this[_0x201d5c(0x178)]);if(_0x4204d3)return _0x4204d3;}const _0x574ced=await this['client']['listUsers']();return saveCachedUsers(this[_0x201d5c(0x178)],_0x574ced),_0x574ced;}[a140_0x4b8714(0x172)](){const _0x3f2689=a140_0x4b8714;clearUserCache(this[_0x3f2689(0x178)]);}async['findByEmail'](_0x50a2de){const _0x2dae0c=a140_0x4b8714,_0x2b394a=await this[_0x2dae0c(0x17a)]();return _0x2b394a['find'](_0x1a78fe=>_0x1a78fe[_0x2dae0c(0x182)][_0x2dae0c(0x16f)]()===_0x50a2de['toLowerCase']());}async['findById'](_0x15c6b5){const _0x38a98c=a140_0x4b8714,_0x3c854d=await this['list']();return _0x3c854d[_0x38a98c(0x179)](_0x1792ef=>_0x1792ef['id']===_0x15c6b5);}async[a140_0x4b8714(0x181)](){const _0x40ca88=a140_0x4b8714,_0x1c3f88=await this[_0x40ca88(0x17a)]();return new Map(_0x1c3f88[_0x40ca88(0x17c)](_0x3bf48b=>[_0x3bf48b[_0x40ca88(0x182)][_0x40ca88(0x16f)](),_0x3bf48b['id']]));}async['buildIdToEmailMap'](){const _0x28d8d5=a140_0x4b8714,_0x5949fc=await this['list']();return new Map(_0x5949fc['map'](_0x5b56ae=>[_0x5b56ae['id'],_0x5b56ae[_0x28d8d5(0x182)]]));}async[a140_0x4b8714(0x17d)](){const _0xd80858=a140_0x4b8714,_0x454ed8=await this[_0xd80858(0x17a)]();return{'emailToId':new Map(_0x454ed8['map'](_0x9267fc=>[_0x9267fc['email'][_0xd80858(0x16f)](),_0x9267fc['id']])),'idToEmail':new Map(_0x454ed8[_0xd80858(0x17c)](_0x4006c0=>[_0x4006c0['id'],_0x4006c0[_0xd80858(0x182)]]))};}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x2c674f,_0x8f7960){const _0x17c70c=a141_0x37e9,_0x4c1072=_0x2c674f();while(!![]){try{const _0x1c1a4a=-parseInt(_0x17c70c(0xc1))/0x1+parseInt(_0x17c70c(0xbe))/0x2*(parseInt(_0x17c70c(0xba))/0x3)+parseInt(_0x17c70c(0xbc))/0x4+-parseInt(_0x17c70c(0xc4))/0x5+parseInt(_0x17c70c(0xc5))/0x6+parseInt(_0x17c70c(0xbd))/0x7+parseInt(_0x17c70c(0xc0))/0x8*(-parseInt(_0x17c70c(0xc3))/0x9);if(_0x1c1a4a===_0x8f7960)break;else _0x4c1072['push'](_0x4c1072['shift']());}catch(_0x3d37c1){_0x4c1072['push'](_0x4c1072['shift']());}}}(a141_0x3b4b,0x266c8));function a141_0x3b4b(){const _0x3ac55f=['121428wlowlH','69170KXeBjR','1250334bwfDGs','pop','txt','jsonl','text','split','json','6OqoMaE','tab','843264NYhcTN','2121518mIDaBO','236036snVvCs','tsv','368NKjZrY','166465jyyekB','toLowerCase'];a141_0x3b4b=function(){return _0x3ac55f;};return a141_0x3b4b();}function a141_0x37e9(_0x593753,_0x1455cc){_0x593753=_0x593753-0xb8;const _0x3b4b0d=a141_0x3b4b();let _0x37e9c3=_0x3b4b0d[_0x593753];return _0x37e9c3;}export function detectFormatFromExtension(_0x28fc70){const _0x1cb19e=a141_0x37e9,_0x38d652=_0x28fc70[_0x1cb19e(0xc2)]()[_0x1cb19e(0xb8)]('.')[_0x1cb19e(0xc6)]();switch(_0x38d652){case _0x1cb19e(0xb9):return _0x1cb19e(0xb9);case'jsonl':return _0x1cb19e(0xc8);case _0x1cb19e(0xbf):case _0x1cb19e(0xbb):return _0x1cb19e(0xbf);case _0x1cb19e(0xc7):case _0x1cb19e(0xc9):return'table';default:return undefined;}}export function resolveOutputFormat(_0x1364eb,_0xf61f32,_0x3b4266){if(_0x1364eb)return _0x1364eb;if(_0xf61f32){const _0x40de3d=detectFormatFromExtension(_0xf61f32);if(_0x40de3d)return _0x40de3d;}return _0x3b4266;}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x43df76,_0x2f9d1e){const _0x537f51=a142_0x308a,_0x17856c=_0x43df76();while(!![]){try{const _0xa6f924=parseInt(_0x537f51(0x1d3))/0x1*(-parseInt(_0x537f51(0x1a6))/0x2)+parseInt(_0x537f51(0x1aa))/0x3*(parseInt(_0x537f51(0x1bb))/0x4)+parseInt(_0x537f51(0x1b9))/0x5*(parseInt(_0x537f51(0x1a7))/0x6)+-parseInt(_0x537f51(0x1d5))/0x7*(-parseInt(_0x537f51(0x1c9))/0x8)+-parseInt(_0x537f51(0x1a2))/0x9*(-parseInt(_0x537f51(0x1b2))/0xa)+-parseInt(_0x537f51(0x1a3))/0xb*(-parseInt(_0x537f51(0x1a9))/0xc)+-parseInt(_0x537f51(0x1c1))/0xd;if(_0xa6f924===_0x2f9d1e)break;else _0x17856c['push'](_0x17856c['shift']());}catch(_0x15582b){_0x17856c['push'](_0x17856c['shift']());}}}(a142_0x1a44,0x2c02f));import{centerAlign,stringWidth,padEnd,padStart}from'../../utils/string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../../utils/colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function a142_0x1a44(){const _0x3cf888=['pow','object','forEach','number','push','bool','572744SwLdyF','true','min','columns','string','reduce','\x20shown)','toFixed','\x1b]8;;\x07','substring','197655UYczhM','max','21cTOXtf','repeat','data','row','test','join','9pdYgzD','1132351bYgPAB','floor','entries','2npHeJi','1398AJMvhI','toISOString','12kJwREL','132JBrjGG','slice','isTTY','toLowerCase','false','map','stdout','length','1887400NBecyI','toString','long','array','stringify','\x20rows\x20(','boolean','5435FhHOpe','int','21932LBWesE','type','replace','padEnd','tsv','name','8099741bbIdnl','double'];a142_0x1a44=function(){return _0x3cf888;};return a142_0x1a44();}function getTerminalWidth(){const _0x3d692b=a142_0x308a;return process[_0x3d692b(0x1b0)][_0x3d692b(0x1cc)]||Infinity;}export function formatAsTable(_0x28680a,_0x5646e9=DEFAULT_MAX_DISPLAY_ROWS,_0x1bd149=![],_0x333032={}){const _0x3c7ea2=a142_0x308a;if(_0x28680a[_0x3c7ea2(0x1d7)][_0x3c7ea2(0x1b1)]===0x0)return'No\x20rows\x20returned';const _0x3039b7=_0x28680a[_0x3c7ea2(0x1cc)][_0x3c7ea2(0x1af)](_0x15900f=>_0x15900f['name']),_0x456e56=_0x28680a[_0x3c7ea2(0x1cc)][_0x3c7ea2(0x1af)](_0x481fc1=>simplifyType(_0x481fc1[_0x3c7ea2(0x1bc)])),_0xd6b928=_0x28680a[_0x3c7ea2(0x1d7)][_0x3c7ea2(0x1ab)](0x0,_0x5646e9),_0x1e6e04=_0x28680a[_0x3c7ea2(0x1d7)]['length'],_0x2dc646=_0x1e6e04>_0x5646e9,_0x22c2d8=[],_0x3f0347=getTerminalWidth(),_0x2be2bd=_0x3f0347!==Infinity,_0x222cd9=0x32;let _0x53f6a5=_0x3039b7[_0x3c7ea2(0x1af)]((_0x487980,_0x37d1e3)=>{const _0x4feb28=_0x3c7ea2,_0x4a8be7=stringWidth(_0x456e56[_0x37d1e3]),_0x212e50=Math[_0x4feb28(0x1d4)](..._0xd6b928[_0x4feb28(0x1af)](_0x989c06=>{const _0x1f4888=_0x989c06[_0x487980];return stringWidth(formatValue(_0x1f4888));})),_0x5d2db4=Math[_0x4feb28(0x1d4)](stringWidth(_0x487980),_0x4a8be7,_0x212e50);return _0x1bd149?_0x5d2db4:Math[_0x4feb28(0x1cb)](_0x5d2db4,_0x222cd9);});if(_0x2be2bd&&!_0x1bd149&&_0x3039b7[_0x3c7ea2(0x1b1)]>0x0){const _0x17f3e2=_0x418038=>{let _0x56c854=0x1;for(const _0x2d8094 of _0x418038){_0x56c854+=_0x2d8094+0x3;}return _0x56c854+0x1;};let _0x19988c=_0x17f3e2(_0x53f6a5);if(_0x19988c>_0x3f0347){const _0x56ca3f=0x3;for(let _0x22b8e1=_0x53f6a5['length']-0x1;_0x22b8e1>=0x0;_0x22b8e1--){_0x19988c=_0x17f3e2(_0x53f6a5);if(_0x19988c<=_0x3f0347)break;const _0xc50048=_0x53f6a5[_0x22b8e1],_0x2de619=_0x19988c-_0x3f0347,_0x53dc6a=_0xc50048-_0x56ca3f,_0x3b69cd=Math[_0x3c7ea2(0x1cb)](_0x2de619,_0x53dc6a);_0x3b69cd>0x0&&(_0x53f6a5[_0x22b8e1]=_0xc50048-_0x3b69cd);}}}const _0x3f4565=_0x3039b7,_0x5c0aa1=_0x456e56,_0x2f9d4e=_0x53f6a5,_0x2492d6=_0x53f6a5;_0x22c2d8[_0x3c7ea2(0x1c7)](colorBorder('┌'+_0x2492d6['map'](_0x49e49b=>'─'[_0x3c7ea2(0x1d6)](_0x49e49b+0x2))[_0x3c7ea2(0x1a1)]('┬')+'┐',_0x333032));const _0x11b01e=_0x3f4565[_0x3c7ea2(0x1af)]((_0x3dca3d,_0x57c4ee)=>centerAlign(_0x3dca3d,_0x2f9d4e[_0x57c4ee]));_0x22c2d8[_0x3c7ea2(0x1c7)](colorBorder('│',_0x333032)+'\x20'+_0x11b01e[_0x3c7ea2(0x1a1)]('\x20'+colorBorder('│',_0x333032)+'\x20')+'\x20'+colorBorder('│',_0x333032));const _0x18f6b1=_0x5c0aa1[_0x3c7ea2(0x1af)]((_0x35f430,_0x242efc)=>colorType(centerAlign(_0x35f430,_0x2f9d4e[_0x242efc]),_0x333032));_0x22c2d8['push'](colorBorder('│',_0x333032)+'\x20'+_0x18f6b1[_0x3c7ea2(0x1a1)]('\x20'+colorBorder('│',_0x333032)+'\x20')+'\x20'+colorBorder('│',_0x333032)),_0x22c2d8[_0x3c7ea2(0x1c7)](colorBorder('├'+_0x2492d6[_0x3c7ea2(0x1af)](_0x2d4887=>'─'[_0x3c7ea2(0x1d6)](_0x2d4887+0x2))[_0x3c7ea2(0x1a1)]('┼')+'┤',_0x333032));const _0x7c22c8=(_0x10d934,_0x18f03d)=>{const _0x53e564=_0x3c7ea2,_0x19e2c7=stringWidth(_0x10d934);if(_0x19e2c7<=_0x18f03d)return _0x10d934;let _0x3a7ba2=_0x10d934;while(stringWidth(_0x3a7ba2+'…')>_0x18f03d&&_0x3a7ba2[_0x53e564(0x1b1)]>0x0){_0x3a7ba2=_0x3a7ba2[_0x53e564(0x1ab)](0x0,-0x1);}return _0x3a7ba2+'…';};_0xd6b928[_0x3c7ea2(0x1c5)](_0x217c29=>{const _0x2f0e9b=_0x3c7ea2,_0x3a6ba5=_0x3039b7[_0x2f0e9b(0x1af)]((_0x111bbd,_0xafc361)=>{const _0x21af9c=_0x2f0e9b,_0x5494ea=_0x217c29[_0x111bbd],_0x53b712=formatValue(_0x5494ea),_0x2725cb=_0x2f9d4e[_0xafc361],_0x50ddb8=_0x7c22c8(_0x53b712,_0x2725cb),_0x29e87f=typeof _0x5494ea==='number'||typeof _0x5494ea===_0x21af9c(0x1cd)&&/^-?\d+$/[_0x21af9c(0x1a0)](_0x5494ea);return _0x29e87f?padStart(_0x50ddb8,_0x2725cb):padEnd(_0x50ddb8,_0x2725cb);});_0x22c2d8['push'](colorBorder('│',_0x333032)+'\x20'+_0x3a6ba5[_0x2f0e9b(0x1a1)]('\x20'+colorBorder('│',_0x333032)+'\x20')+'\x20'+colorBorder('│',_0x333032));});const _0x2a786d=_0x2492d6[_0x3c7ea2(0x1ce)]((_0x40bb4f,_0x19265a)=>_0x40bb4f+_0x19265a+0x3,-0x1);_0x22c2d8[_0x3c7ea2(0x1c7)](colorBorder('├'+_0x2492d6[_0x3c7ea2(0x1af)](_0x1cdbf4=>'─'[_0x3c7ea2(0x1d6)](_0x1cdbf4+0x2))['join']('┴')+'┤',_0x333032));let _0xb083fe;_0x2dc646?_0xb083fe=_0x1e6e04+_0x3c7ea2(0x1b7)+_0x5646e9+_0x3c7ea2(0x1cf):_0xb083fe=_0x1e6e04+'\x20row'+(_0x1e6e04===0x1?'':'s');const _0x10425b=_0xb083fe[_0x3c7ea2(0x1be)](_0x2a786d-0x2);return _0x22c2d8['push'](colorBorder('│',_0x333032)+'\x20'+_0x10425b+'\x20'+colorBorder('│',_0x333032)),_0x22c2d8['push'](colorBorder('└'+'─'[_0x3c7ea2(0x1d6)](_0x2a786d)+'┘',_0x333032)),_0x22c2d8[_0x3c7ea2(0x1a1)]('\x0a');}function simplifyType(_0x53b9e9){const _0x1746a2=a142_0x308a,_0x115035={'varchar':_0x1746a2(0x1cd),'bigint':_0x1746a2(0x1b4),'integer':_0x1746a2(0x1ba),'double':_0x1746a2(0x1c2),'boolean':_0x1746a2(0x1c8),'date':'date','timestamp':'timestamp','array':_0x1746a2(0x1b5),'map':_0x1746a2(0x1af),'row':_0x1746a2(0x1d8)},_0x1c785b=_0x53b9e9[_0x1746a2(0x1ad)]();for(const [_0x39203d,_0x567f7a]of Object[_0x1746a2(0x1a5)](_0x115035)){if(_0x1c785b['startsWith'](_0x39203d))return _0x567f7a;}return _0x53b9e9[_0x1746a2(0x1b1)]>0xa?_0x53b9e9[_0x1746a2(0x1d2)](0x0,0xa):_0x53b9e9;}export function formatAsJSON(_0x5c843d,_0x8eeaaa={}){const _0x2dd6b9=a142_0x308a;if(_0x5c843d[_0x2dd6b9(0x1d7)][_0x2dd6b9(0x1b1)]===0x0)return'[]';if(shouldUseColor(_0x8eeaaa))return colorizeJSON(_0x5c843d['data'],_0x8eeaaa);const _0x3c2856=_0x5c843d[_0x2dd6b9(0x1d7)][_0x2dd6b9(0x1af)](_0x34da70=>'\x20\x20'+JSON[_0x2dd6b9(0x1b6)](_0x34da70));return'[\x0a'+_0x3c2856[_0x2dd6b9(0x1a1)](',\x0a')+'\x0a]';}export function formatAsJSONL(_0x47ab9e,_0x45760c={}){const _0x439a20=a142_0x308a;if(_0x47ab9e[_0x439a20(0x1d7)][_0x439a20(0x1b1)]===0x0)return'';if(shouldUseColor(_0x45760c))return _0x47ab9e['data'][_0x439a20(0x1af)](_0x4cfb6a=>colorizeJSONCompact(_0x4cfb6a,_0x45760c))['join']('\x0a');return _0x47ab9e['data'][_0x439a20(0x1af)](_0x481637=>JSON['stringify'](_0x481637))[_0x439a20(0x1a1)]('\x0a');}export function formatAsTSV(_0x5ddebd){const _0x33e190=a142_0x308a;if(_0x5ddebd[_0x33e190(0x1d7)][_0x33e190(0x1b1)]===0x0)return'';const _0x295b38=[],_0x49d349=_0x5ddebd[_0x33e190(0x1cc)][_0x33e190(0x1af)](_0x359a7c=>_0x359a7c[_0x33e190(0x1c0)]);return _0x295b38[_0x33e190(0x1c7)](_0x49d349[_0x33e190(0x1a1)]('\x09')),_0x5ddebd['data'][_0x33e190(0x1c5)](_0x61a0f9=>{const _0x41f288=_0x33e190,_0x4b2e93=_0x49d349[_0x41f288(0x1af)](_0xe400a6=>{const _0x2d49aa=_0x61a0f9[_0xe400a6];return formatValueForTSV(_0x2d49aa);});_0x295b38['push'](_0x4b2e93['join']('\x09'));}),_0x295b38['join']('\x0a');}function formatValue(_0x276c74){const _0xb43a4f=a142_0x308a;if(_0x276c74===null||_0x276c74===undefined)return'';if(typeof _0x276c74==='string'){const _0x5c1543=_0x276c74[_0xb43a4f(0x1bd)](/\n/g,'\x5cn')[_0xb43a4f(0x1bd)](/\r/g,'\x5cr')[_0xb43a4f(0x1bd)](/\t/g,'\x5ct');return _0x5c1543;}if(typeof _0x276c74===_0xb43a4f(0x1c6))return String(_0x276c74);if(typeof _0x276c74===_0xb43a4f(0x1b8))return _0x276c74?_0xb43a4f(0x1ca):_0xb43a4f(0x1ae);if(_0x276c74 instanceof Date)return _0x276c74['toISOString']();if(typeof _0x276c74===_0xb43a4f(0x1c4))return JSON[_0xb43a4f(0x1b6)](_0x276c74);return String(_0x276c74);}function formatValueForTSV(_0x3042db){const _0xce200=a142_0x308a;if(_0x3042db===null||_0x3042db===undefined)return'';if(typeof _0x3042db===_0xce200(0x1cd))return _0x3042db['replace'](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x3042db===_0xce200(0x1c6)||typeof _0x3042db==='boolean')return String(_0x3042db);if(_0x3042db instanceof Date)return _0x3042db[_0xce200(0x1a8)]();if(typeof _0x3042db===_0xce200(0x1c4))return JSON['stringify'](_0x3042db);return String(_0x3042db);}export function formatQueryResult(_0x1541d8,_0x4c44a6){const _0x98e822=a142_0x308a;switch(_0x4c44a6){case'table':return formatAsTable(_0x1541d8);case'json':return formatAsJSON(_0x1541d8);case'jsonl':return formatAsJSONL(_0x1541d8);case _0x98e822(0x1bf):return formatAsTSV(_0x1541d8);default:return formatAsJSON(_0x1541d8);}}export function formatBytes(_0x4281db){const _0x3b2a6a=a142_0x308a;if(_0x4281db===0x0)return'0\x20B';const _0x1ef185=['B','KB','MB','GB','TB'],_0x2511da=0x400,_0x97dba6=Math[_0x3b2a6a(0x1a4)](Math['log'](_0x4281db)/Math['log'](_0x2511da)),_0x3ca477=_0x4281db/Math[_0x3b2a6a(0x1c3)](_0x2511da,_0x97dba6),_0x3a604c=_0x3ca477>=0xa?0x1:0x2;return _0x3ca477[_0x3b2a6a(0x1d0)](_0x3a604c)+'\x20'+_0x1ef185[_0x97dba6];}export function formatRows(_0x3bea2e){const _0x5b5061=a142_0x308a;if(_0x3bea2e==null)return'-';if(_0x3bea2e===0x0)return'0';if(_0x3bea2e<0x3e8)return _0x3bea2e[_0x5b5061(0x1b3)]();const _0x2a51e4=['','K','M','B','T'],_0x2468bc=0x3e8,_0x2a4508=Math[_0x5b5061(0x1a4)](Math['log'](_0x3bea2e)/Math['log'](_0x2468bc)),_0x56d2ae=_0x3bea2e/Math[_0x5b5061(0x1c3)](_0x2468bc,_0x2a4508),_0x45519f=_0x56d2ae>=0xa?0x1:0x2;return''+_0x56d2ae[_0x5b5061(0x1d0)](_0x45519f)+_0x2a51e4[_0x2a4508];}function a142_0x308a(_0xf688f7,_0x127ebf){_0xf688f7=_0xf688f7-0x1a0;const _0x1a4406=a142_0x1a44();let _0x308a17=_0x1a4406[_0xf688f7];return _0x308a17;}export function hyperlink(_0x36f5e5,_0x304463){const _0x351ad3=a142_0x308a;if(!process[_0x351ad3(0x1b0)][_0x351ad3(0x1ac)])return _0x36f5e5;return'\x1b]8;;'+_0x304463+'\x07'+_0x36f5e5+_0x351ad3(0x1d1);}
|
|
1
|
+
function a142_0x4554(_0x46103f,_0x554629){_0x46103f=_0x46103f-0x1e5;const _0x52ca6f=a142_0x52ca();let _0x45544a=_0x52ca6f[_0x46103f];return _0x45544a;}(function(_0x211ebf,_0x147808){const _0x3ca3e9=a142_0x4554,_0x151705=_0x211ebf();while(!![]){try{const _0x37a713=parseInt(_0x3ca3e9(0x20c))/0x1+-parseInt(_0x3ca3e9(0x21d))/0x2*(-parseInt(_0x3ca3e9(0x1ff))/0x3)+-parseInt(_0x3ca3e9(0x209))/0x4*(-parseInt(_0x3ca3e9(0x211))/0x5)+-parseInt(_0x3ca3e9(0x214))/0x6*(-parseInt(_0x3ca3e9(0x21a))/0x7)+parseInt(_0x3ca3e9(0x1f0))/0x8*(parseInt(_0x3ca3e9(0x201))/0x9)+parseInt(_0x3ca3e9(0x20d))/0xa+parseInt(_0x3ca3e9(0x20b))/0xb*(-parseInt(_0x3ca3e9(0x219))/0xc);if(_0x37a713===_0x147808)break;else _0x151705['push'](_0x151705['shift']());}catch(_0x936087){_0x151705['push'](_0x151705['shift']());}}}(a142_0x52ca,0x70e2b));import{centerAlign,stringWidth,padEnd,padStart}from'../../utils/string-utils.js';import{colorBorder,colorType,colorizeJSON,colorizeJSONCompact,shouldUseColor}from'../../utils/colors.js';const DEFAULT_MAX_DISPLAY_ROWS=0x28;function getTerminalWidth(){const _0x52b176=a142_0x4554;return process[_0x52b176(0x1ed)][_0x52b176(0x1ee)]||Infinity;}export function formatAsTable(_0x28c465,_0x47b7c6=DEFAULT_MAX_DISPLAY_ROWS,_0x54e2e2=![],_0x52e762={}){const _0x35d27e=a142_0x4554;if(_0x28c465['data'][_0x35d27e(0x207)]===0x0)return _0x35d27e(0x1ef);const _0x4dd182=_0x28c465['columns'][_0x35d27e(0x1f7)](_0x1390d7=>_0x1390d7[_0x35d27e(0x1ea)]),_0x4d0d4d=_0x28c465[_0x35d27e(0x1ee)][_0x35d27e(0x1f7)](_0x3bfdb4=>simplifyType(_0x3bfdb4[_0x35d27e(0x212)])),_0x49b3d6=_0x28c465[_0x35d27e(0x1fa)][_0x35d27e(0x1e9)](0x0,_0x47b7c6),_0x7a38eb=_0x28c465['data'][_0x35d27e(0x207)],_0x4dae8f=_0x7a38eb>_0x47b7c6,_0x6c1c9d=[],_0x3bd4cf=getTerminalWidth(),_0x114d57=_0x3bd4cf!==Infinity,_0x28f7e8=0x32;let _0x5379e9=_0x4dd182['map']((_0x35ec13,_0x18e61b)=>{const _0x475b55=_0x35d27e,_0x5ed0f8=stringWidth(_0x4d0d4d[_0x18e61b]),_0x534781=Math['max'](..._0x49b3d6[_0x475b55(0x1f7)](_0x403cad=>{const _0x123682=_0x403cad[_0x35ec13];return stringWidth(formatValue(_0x123682));})),_0x5b9736=Math['max'](stringWidth(_0x35ec13),_0x5ed0f8,_0x534781);return _0x54e2e2?_0x5b9736:Math[_0x475b55(0x1fc)](_0x5b9736,_0x28f7e8);});if(_0x114d57&&!_0x54e2e2&&_0x4dd182[_0x35d27e(0x207)]>0x0){const _0x26979a=_0x3b1136=>{let _0x256c20=0x1;for(const _0x8f1c91 of _0x3b1136){_0x256c20+=_0x8f1c91+0x3;}return _0x256c20+0x1;};let _0x1bf138=_0x26979a(_0x5379e9);if(_0x1bf138>_0x3bd4cf){const _0x2b8604=0x3;for(let _0xb72182=_0x5379e9[_0x35d27e(0x207)]-0x1;_0xb72182>=0x0;_0xb72182--){_0x1bf138=_0x26979a(_0x5379e9);if(_0x1bf138<=_0x3bd4cf)break;const _0x34b9c3=_0x5379e9[_0xb72182],_0x5190ba=_0x1bf138-_0x3bd4cf,_0xed70d4=_0x34b9c3-_0x2b8604,_0x343b53=Math[_0x35d27e(0x1fc)](_0x5190ba,_0xed70d4);_0x343b53>0x0&&(_0x5379e9[_0xb72182]=_0x34b9c3-_0x343b53);}}}const _0x24c1f7=_0x4dd182,_0x1b9df0=_0x4d0d4d,_0x106026=_0x5379e9,_0x11d0c7=_0x5379e9;_0x6c1c9d[_0x35d27e(0x1f6)](colorBorder('┌'+_0x11d0c7['map'](_0x21a6ab=>'─'[_0x35d27e(0x200)](_0x21a6ab+0x2))['join']('┬')+'┐',_0x52e762));const _0x7e4829=_0x24c1f7[_0x35d27e(0x1f7)]((_0x3a4109,_0x539919)=>centerAlign(_0x3a4109,_0x106026[_0x539919]));_0x6c1c9d[_0x35d27e(0x1f6)](colorBorder('│',_0x52e762)+'\x20'+_0x7e4829[_0x35d27e(0x204)]('\x20'+colorBorder('│',_0x52e762)+'\x20')+'\x20'+colorBorder('│',_0x52e762));const _0x13f7d3=_0x1b9df0['map']((_0x4bb9f5,_0x4a1ac0)=>colorType(centerAlign(_0x4bb9f5,_0x106026[_0x4a1ac0]),_0x52e762));_0x6c1c9d[_0x35d27e(0x1f6)](colorBorder('│',_0x52e762)+'\x20'+_0x13f7d3[_0x35d27e(0x204)]('\x20'+colorBorder('│',_0x52e762)+'\x20')+'\x20'+colorBorder('│',_0x52e762)),_0x6c1c9d['push'](colorBorder('├'+_0x11d0c7[_0x35d27e(0x1f7)](_0x6084b1=>'─'[_0x35d27e(0x200)](_0x6084b1+0x2))[_0x35d27e(0x204)]('┼')+'┤',_0x52e762));const _0x75f94d=(_0xbaeb10,_0x6b1495)=>{const _0x477554=_0x35d27e,_0x26a0d0=stringWidth(_0xbaeb10);if(_0x26a0d0<=_0x6b1495)return _0xbaeb10;let _0x4d0e9d=_0xbaeb10;while(stringWidth(_0x4d0e9d+'…')>_0x6b1495&&_0x4d0e9d[_0x477554(0x207)]>0x0){_0x4d0e9d=_0x4d0e9d[_0x477554(0x1e9)](0x0,-0x1);}return _0x4d0e9d+'…';};_0x49b3d6[_0x35d27e(0x1e8)](_0x2b9812=>{const _0x95e5be=_0x35d27e,_0x4031d8=_0x4dd182['map']((_0x50925f,_0x1de23c)=>{const _0x13d6d2=a142_0x4554,_0x2ef0be=_0x2b9812[_0x50925f],_0x48dc50=formatValue(_0x2ef0be),_0x4ad564=_0x106026[_0x1de23c],_0x44b0d2=_0x75f94d(_0x48dc50,_0x4ad564),_0x1f880b=typeof _0x2ef0be===_0x13d6d2(0x1e5)||typeof _0x2ef0be===_0x13d6d2(0x21c)&&/^-?\d+$/['test'](_0x2ef0be);return _0x1f880b?padStart(_0x44b0d2,_0x4ad564):padEnd(_0x44b0d2,_0x4ad564);});_0x6c1c9d[_0x95e5be(0x1f6)](colorBorder('│',_0x52e762)+'\x20'+_0x4031d8[_0x95e5be(0x204)]('\x20'+colorBorder('│',_0x52e762)+'\x20')+'\x20'+colorBorder('│',_0x52e762));});const _0x301e37=_0x11d0c7[_0x35d27e(0x218)]((_0x18a15d,_0x504f45)=>_0x18a15d+_0x504f45+0x3,-0x1);_0x6c1c9d['push'](colorBorder('├'+_0x11d0c7[_0x35d27e(0x1f7)](_0x56741d=>'─'[_0x35d27e(0x200)](_0x56741d+0x2))[_0x35d27e(0x204)]('┴')+'┤',_0x52e762));let _0x304bdb;_0x4dae8f?_0x304bdb=_0x7a38eb+'\x20rows\x20('+_0x47b7c6+_0x35d27e(0x1ec):_0x304bdb=_0x7a38eb+_0x35d27e(0x1f1)+(_0x7a38eb===0x1?'':'s');const _0x1c72d7=_0x304bdb['padEnd'](_0x301e37-0x2);return _0x6c1c9d[_0x35d27e(0x1f6)](colorBorder('│',_0x52e762)+'\x20'+_0x1c72d7+'\x20'+colorBorder('│',_0x52e762)),_0x6c1c9d['push'](colorBorder('└'+'─'[_0x35d27e(0x200)](_0x301e37)+'┘',_0x52e762)),_0x6c1c9d['join']('\x0a');}function simplifyType(_0xa48815){const _0x507007=a142_0x4554,_0x385c41={'varchar':'string','bigint':_0x507007(0x205),'integer':_0x507007(0x1f4),'double':_0x507007(0x206),'boolean':_0x507007(0x213),'date':_0x507007(0x1fd),'timestamp':'timestamp','array':_0x507007(0x1e6),'map':_0x507007(0x1f7),'row':'row'},_0xb66df7=_0xa48815[_0x507007(0x1e7)]();for(const [_0x22228e,_0x2d7f7a]of Object[_0x507007(0x1eb)](_0x385c41)){if(_0xb66df7[_0x507007(0x203)](_0x22228e))return _0x2d7f7a;}return _0xa48815['length']>0xa?_0xa48815[_0x507007(0x1f3)](0x0,0xa):_0xa48815;}export function formatAsJSON(_0x4c8bad,_0x40bc8b={}){const _0x2070e4=a142_0x4554;if(_0x4c8bad['data'][_0x2070e4(0x207)]===0x0)return'[]';if(shouldUseColor(_0x40bc8b))return colorizeJSON(_0x4c8bad[_0x2070e4(0x1fa)],_0x40bc8b);const _0x309bf1=_0x4c8bad[_0x2070e4(0x1fa)][_0x2070e4(0x1f7)](_0x463e60=>'\x20\x20'+JSON[_0x2070e4(0x1f9)](_0x463e60));return'[\x0a'+_0x309bf1[_0x2070e4(0x204)](',\x0a')+'\x0a]';}function a142_0x52ca(){const _0x6014df=['data','toISOString','min','date','\x1b]8;;\x07','3hcOMRG','repeat','126bpTFJc','log','startsWith','join','long','double','length','pow','6572AREbKx','isTTY','44OslqOb','185959PUjwRc','9155370dPmIdg','true','jsonl','tsv','1775CjmPaU','type','bool','2697594jAWKIB','toFixed','false','boolean','reduce','6736116CQCbXS','7uRLkhZ','toString','string','630574IYgLBn','floor','number','array','toLowerCase','forEach','slice','name','entries','\x20shown)','stdout','columns','No\x20rows\x20returned','147488JsYSHl','\x20row','0\x20B','substring','int','object','push','map','replace','stringify'];a142_0x52ca=function(){return _0x6014df;};return a142_0x52ca();}export function formatAsJSONL(_0x23eb56,_0x4c9b7c={}){const _0x31b602=a142_0x4554;if(_0x23eb56[_0x31b602(0x1fa)][_0x31b602(0x207)]===0x0)return'';if(shouldUseColor(_0x4c9b7c))return _0x23eb56[_0x31b602(0x1fa)][_0x31b602(0x1f7)](_0x35767f=>colorizeJSONCompact(_0x35767f,_0x4c9b7c))[_0x31b602(0x204)]('\x0a');return _0x23eb56[_0x31b602(0x1fa)][_0x31b602(0x1f7)](_0x31f2d8=>JSON[_0x31b602(0x1f9)](_0x31f2d8))[_0x31b602(0x204)]('\x0a');}export function formatAsTSV(_0x1fd894){const _0x3e0ddc=a142_0x4554;if(_0x1fd894[_0x3e0ddc(0x1fa)][_0x3e0ddc(0x207)]===0x0)return'';const _0x31698d=[],_0x33ca50=_0x1fd894['columns'][_0x3e0ddc(0x1f7)](_0x5c6021=>_0x5c6021[_0x3e0ddc(0x1ea)]);return _0x31698d[_0x3e0ddc(0x1f6)](_0x33ca50[_0x3e0ddc(0x204)]('\x09')),_0x1fd894[_0x3e0ddc(0x1fa)]['forEach'](_0x38298f=>{const _0x3faafd=_0x3e0ddc,_0x1a8c2a=_0x33ca50[_0x3faafd(0x1f7)](_0x1c69fc=>{const _0x4725a6=_0x38298f[_0x1c69fc];return formatValueForTSV(_0x4725a6);});_0x31698d['push'](_0x1a8c2a[_0x3faafd(0x204)]('\x09'));}),_0x31698d['join']('\x0a');}function formatValue(_0x2f576){const _0x23b972=a142_0x4554;if(_0x2f576===null||_0x2f576===undefined)return'';if(typeof _0x2f576==='string'){const _0xa8d79f=_0x2f576[_0x23b972(0x1f8)](/\n/g,'\x5cn')[_0x23b972(0x1f8)](/\r/g,'\x5cr')[_0x23b972(0x1f8)](/\t/g,'\x5ct');return _0xa8d79f;}if(typeof _0x2f576===_0x23b972(0x1e5))return String(_0x2f576);if(typeof _0x2f576===_0x23b972(0x217))return _0x2f576?_0x23b972(0x20e):_0x23b972(0x216);if(_0x2f576 instanceof Date)return _0x2f576['toISOString']();if(typeof _0x2f576===_0x23b972(0x1f5))return JSON['stringify'](_0x2f576);return String(_0x2f576);}function formatValueForTSV(_0x570f37){const _0x12c019=a142_0x4554;if(_0x570f37===null||_0x570f37===undefined)return'';if(typeof _0x570f37===_0x12c019(0x21c))return _0x570f37[_0x12c019(0x1f8)](/\t/g,'\x5ct')['replace'](/\n/g,'\x5cn');if(typeof _0x570f37===_0x12c019(0x1e5)||typeof _0x570f37===_0x12c019(0x217))return String(_0x570f37);if(_0x570f37 instanceof Date)return _0x570f37[_0x12c019(0x1fb)]();if(typeof _0x570f37===_0x12c019(0x1f5))return JSON[_0x12c019(0x1f9)](_0x570f37);return String(_0x570f37);}export function formatQueryResult(_0x4785bc,_0x5cf1b4){const _0x144071=a142_0x4554;switch(_0x5cf1b4){case'table':return formatAsTable(_0x4785bc);case'json':return formatAsJSON(_0x4785bc);case _0x144071(0x20f):return formatAsJSONL(_0x4785bc);case _0x144071(0x210):return formatAsTSV(_0x4785bc);default:return formatAsJSON(_0x4785bc);}}export function formatBytes(_0x44bae4){const _0xd8c777=a142_0x4554;if(_0x44bae4===0x0)return _0xd8c777(0x1f2);const _0xed5a26=['B','KB','MB','GB','TB'],_0x2b839e=0x400,_0x388494=Math[_0xd8c777(0x21e)](Math[_0xd8c777(0x202)](_0x44bae4)/Math['log'](_0x2b839e)),_0x191afe=_0x44bae4/Math[_0xd8c777(0x208)](_0x2b839e,_0x388494),_0x1c2728=_0x191afe>=0xa?0x1:0x2;return _0x191afe[_0xd8c777(0x215)](_0x1c2728)+'\x20'+_0xed5a26[_0x388494];}export function formatRows(_0x6ae73f){const _0x3ef3fc=a142_0x4554;if(_0x6ae73f==null)return'-';if(_0x6ae73f===0x0)return'0';if(_0x6ae73f<0x3e8)return _0x6ae73f[_0x3ef3fc(0x21b)]();const _0x45cb02=['','K','M','B','T'],_0x1acc14=0x3e8,_0x1fb467=Math['floor'](Math[_0x3ef3fc(0x202)](_0x6ae73f)/Math[_0x3ef3fc(0x202)](_0x1acc14)),_0x562023=_0x6ae73f/Math[_0x3ef3fc(0x208)](_0x1acc14,_0x1fb467),_0x50e9bc=_0x562023>=0xa?0x1:0x2;return''+_0x562023[_0x3ef3fc(0x215)](_0x50e9bc)+_0x45cb02[_0x1fb467];}export function hyperlink(_0x440641,_0x2ff1a5){const _0x126a37=a142_0x4554;if(!process['stdout'][_0x126a37(0x20a)])return _0x440641;return'\x1b]8;;'+_0x2ff1a5+'\x07'+_0x440641+_0x126a37(0x1fe);}
|
package/dist/sdk/util/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x1ddc28,_0x1fa615){var _0x3eac37=a143_0x18ee,_0x50fc70=_0x1ddc28();while(!![]){try{var _0xb34d17=-parseInt(_0x3eac37(0xc5))/0x1+-parseInt(_0x3eac37(0xbf))/0x2+-parseInt(_0x3eac37(0xc1))/0x3*(parseInt(_0x3eac37(0xc6))/0x4)+-parseInt(_0x3eac37(0xc2))/0x5*(parseInt(_0x3eac37(0xbe))/0x6)+parseInt(_0x3eac37(0xc8))/0x7+parseInt(_0x3eac37(0xc3))/0x8*(parseInt(_0x3eac37(0xc7))/0x9)+-parseInt(_0x3eac37(0xc0))/0xa*(-parseInt(_0x3eac37(0xc4))/0xb);if(_0xb34d17===_0x1fa615)break;else _0x50fc70['push'](_0x50fc70['shift']());}catch(_0x5b81f9){_0x50fc70['push'](_0x50fc70['shift']());}}}(a143_0x2518,0x53689));export*from'./formatters.js';export*from'./format-detector.js';export*from'./tree-formatter.js';function a143_0x18ee(_0x34afc8,_0x1b6669){_0x34afc8=_0x34afc8-0xbe;var _0x2518b6=a143_0x2518();var _0x18eef3=_0x2518b6[_0x34afc8];return _0x18eef3;}function a143_0x2518(){var _0x3bb90f=['20kTHDCq','774XckPzZ','816410ZepyVg','402MGdxJj','1088148nFeHAd','10KMBtyz','137271gNinrx','18395QZkbKA','57600VSiDet','10368798dQUiqF','317455BApCkB'];a143_0x2518=function(){return _0x3bb90f;};return a143_0x2518();}
|