@treasuredata/tdx 2026.3.44 → 2026.3.45
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js.map +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x196de1,_0x3d7c09){const _0x1fc580=a148_0xb0c9,_0x1ae3a0=_0x196de1();while(!![]){try{const _0xfea0ae=parseInt(_0x1fc580(0x165))/0x1+-parseInt(_0x1fc580(0x161))/0x2*(parseInt(_0x1fc580(0x16d))/0x3)+parseInt(_0x1fc580(0x166))/0x4*(parseInt(_0x1fc580(0x168))/0x5)+-parseInt(_0x1fc580(0x172))/0x6+parseInt(_0x1fc580(0x151))/0x7+-parseInt(_0x1fc580(0x14e))/0x8*(-parseInt(_0x1fc580(0x173))/0x9)+-parseInt(_0x1fc580(0x14a))/0xa;if(_0xfea0ae===_0x3d7c09)break;else _0x1ae3a0['push'](_0x1ae3a0['shift']());}catch(_0x1a03ae){_0x1ae3a0['push'](_0x1ae3a0['shift']());}}}(a148_0xb73b,0x5107b));export const DEFAULT_TIME_RANGE='-1d';export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0xad4c41,_0x31c03c,_0x120151){const _0x39c417=a148_0xb0c9,_0x179639=_0x120151&&_0x120151[_0x39c417(0x142)]>0x0?_0x120151[_0x39c417(0x16e)](',\x20'):'*';return _0x39c417(0x145)+_0x179639+_0x39c417(0x164)+_0xad4c41+'.'+_0x31c03c+'\x20LIMIT\x200';}export function generateMasterCountSQL(_0x8c9224){const {database:_0x437384,table:_0x266382}=_0x8c9224['master'];return'SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20'+_0x437384+'.'+_0x266382;}export function generateMasterSampleSQL(_0x525c32,_0x738144=0x5){const _0x18698b=a148_0xb0c9,{database:_0xf75ccb,table:_0x10795b}=_0x525c32[_0x18698b(0x146)];return _0x18698b(0x148)+_0xf75ccb+'.'+_0x10795b+_0x18698b(0x144)+_0x738144;}function a148_0xb0c9(_0x1f50e1,_0x4d873){_0x1f50e1=_0x1f50e1-0x13f;const _0xb73bd=a148_0xb73b();let _0xb0c987=_0xb73bd[_0x1f50e1];return _0xb0c987;}export function generateAttributeCoverageSQL(_0x3cc980,_0x8a7741){const _0x35b716=a148_0xb0c9,_0x395e23=_0x3cc980[_0x35b716(0x146)];return(_0x35b716(0x154)+_0x395e23['database']+'.'+_0x395e23['table']+_0x35b716(0x155)+_0x8a7741['source'][_0x35b716(0x16a)]+'.'+_0x8a7741[_0x35b716(0x14d)][_0x35b716(0x167)]+'\x20a\x0a\x20\x20ON\x20m.'+_0x8a7741['join'][_0x35b716(0x143)]+_0x35b716(0x140)+_0x8a7741[_0x35b716(0x16e)][_0x35b716(0x160)]+_0x35b716(0x152)+_0x8a7741['join'][_0x35b716(0x160)]+'\x20IS\x20NOT\x20NULL\x0a')[_0x35b716(0x149)]();}export function generateBehaviorStatsSQL(_0x4df963,_0x361814,_0xf8e2f3=DEFAULT_TIME_RANGE){const _0x10ad8d=a148_0xb0c9,_0x502676=_0x4df963[_0x10ad8d(0x146)];return('\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.'+_0x361814['join'][_0x10ad8d(0x143)]+')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20'+_0x502676[_0x10ad8d(0x16a)]+'.'+_0x502676[_0x10ad8d(0x167)]+'\x20m\x0aJOIN\x20'+_0x361814[_0x10ad8d(0x14d)][_0x10ad8d(0x16a)]+'.'+_0x361814[_0x10ad8d(0x14d)][_0x10ad8d(0x167)]+_0x10ad8d(0x153)+_0x361814[_0x10ad8d(0x16e)][_0x10ad8d(0x143)]+_0x10ad8d(0x15c)+_0x361814[_0x10ad8d(0x16e)][_0x10ad8d(0x160)]+_0x10ad8d(0x157)+_0xf8e2f3+_0x10ad8d(0x16f))[_0x10ad8d(0x149)]();}export function generateAttributeSampleSQL(_0x215548,_0x4d8f12,_0x21077a=0x5){const _0x425392=a148_0xb0c9,_0x5ca39e=_0x215548[_0x425392(0x146)],_0x51d86c=_0x4d8f12['join'][_0x425392(0x143)],_0x23ba29=_0x4d8f12['columns'][_0x425392(0x15a)](_0x1a2736=>'a.'+_0x1a2736['column'])[_0x425392(0x16e)](',\x20');return(_0x425392(0x150)+_0x51d86c+',\x20'+_0x23ba29+_0x425392(0x176)+_0x5ca39e[_0x425392(0x16a)]+'.'+_0x5ca39e[_0x425392(0x167)]+'\x20m\x0aJOIN\x20'+_0x4d8f12[_0x425392(0x14d)][_0x425392(0x16a)]+'.'+_0x4d8f12[_0x425392(0x14d)][_0x425392(0x167)]+_0x425392(0x156)+_0x4d8f12[_0x425392(0x16e)][_0x425392(0x143)]+_0x425392(0x140)+_0x4d8f12['join'][_0x425392(0x160)]+_0x425392(0x175)+_0x21077a+'\x0a')[_0x425392(0x149)]();}export function generateBehaviorSampleSQL(_0x5b59f7,_0x5b76bf,_0x5b161c=0x5,_0x30bd50=DEFAULT_TIME_RANGE){const _0x2c68cd=a148_0xb0c9,_0x1c84ff=_0x5b59f7[_0x2c68cd(0x146)],_0x357c43=_0x5b76bf[_0x2c68cd(0x16e)][_0x2c68cd(0x143)];let _0x339a01;if(_0x5b76bf[_0x2c68cd(0x14f)])_0x339a01='b.*';else _0x5b76bf[_0x2c68cd(0x141)]&&_0x5b76bf[_0x2c68cd(0x141)]['length']>0x0?_0x339a01=_0x5b76bf[_0x2c68cd(0x141)][_0x2c68cd(0x15a)](_0x10fd47=>'b.'+_0x10fd47['column'])['join'](',\x20'):_0x339a01='b.*';return(_0x2c68cd(0x150)+_0x357c43+',\x20'+_0x339a01+_0x2c68cd(0x176)+_0x1c84ff[_0x2c68cd(0x16a)]+'.'+_0x1c84ff[_0x2c68cd(0x167)]+'\x20m\x0aJOIN\x20'+_0x5b76bf[_0x2c68cd(0x14d)]['database']+'.'+_0x5b76bf[_0x2c68cd(0x14d)]['table']+_0x2c68cd(0x153)+_0x5b76bf[_0x2c68cd(0x16e)]['parent_key']+_0x2c68cd(0x15c)+_0x5b76bf[_0x2c68cd(0x16e)][_0x2c68cd(0x160)]+_0x2c68cd(0x157)+_0x30bd50+'\x27)\x0aLIMIT\x20'+_0x5b161c+'\x0a')[_0x2c68cd(0x149)]();}function quoteIdentifier(_0x47c778){const _0x665194=a148_0xb0c9;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x665194(0x16c)](_0x47c778))return'\x22'+_0x47c778[_0x665194(0x13f)](/"/g,'\x22\x22')+'\x22';return _0x47c778;}export function generateEnrichedSQL(_0x51f6b1,_0x2f597f=0x5){const _0x52f76a=a148_0xb0c9,_0x2d454f=_0x51f6b1[_0x52f76a(0x146)],_0x5cfff8=_0x51f6b1['attributes']||[];if(_0x5cfff8[_0x52f76a(0x142)]===0x0)return _0x52f76a(0x148)+_0x2d454f[_0x52f76a(0x16a)]+'.'+_0x2d454f['table']+'\x20LIMIT\x20'+_0x2f597f;const _0x581d77=['m.*'],_0x366afa=[];return _0x5cfff8['forEach']((_0x17e0c0,_0x297b7d)=>{const _0x657a13=_0x52f76a,_0x264333='a'+_0x297b7d;_0x17e0c0['columns']['forEach'](_0x3f89de=>{const _0x5b8759=a148_0xb0c9,_0x159a54=quoteIdentifier(_0x3f89de[_0x5b8759(0x14c)]||_0x3f89de[_0x5b8759(0x158)]);_0x581d77[_0x5b8759(0x15f)](_0x264333+'.'+_0x3f89de['column']+_0x5b8759(0x170)+_0x159a54);}),_0x366afa[_0x657a13(0x15f)](_0x657a13(0x16b)+_0x17e0c0['source'][_0x657a13(0x16a)]+'.'+_0x17e0c0[_0x657a13(0x14d)]['table']+'\x20'+_0x264333+_0x657a13(0x15d)+_0x17e0c0['join'][_0x657a13(0x143)]+_0x657a13(0x15e)+_0x264333+'.'+_0x17e0c0['join']['child_key']);}),(_0x52f76a(0x147)+_0x581d77[_0x52f76a(0x16e)](',\x20')+_0x52f76a(0x176)+_0x2d454f[_0x52f76a(0x16a)]+'.'+_0x2d454f[_0x52f76a(0x167)]+_0x52f76a(0x159)+_0x366afa[_0x52f76a(0x16e)]('\x0a')+_0x52f76a(0x175)+_0x2f597f+'\x0a')['trim']();}export function generateAttributeSchemaSQL(_0x397ec8,_0x15ef6b){const _0x5aec25=a148_0xb0c9,_0x22290c=_0x397ec8[_0x5aec25(0x146)],_0x58cdd2=_0x15ef6b[_0x5aec25(0x16e)][_0x5aec25(0x143)],_0x3c7c97=_0x15ef6b[_0x5aec25(0x141)]['map'](_0x5980fb=>'a.'+_0x5980fb[_0x5aec25(0x158)])[_0x5aec25(0x16e)](',\x20');return('\x0aSELECT\x20m.'+_0x58cdd2+',\x20'+_0x3c7c97+_0x5aec25(0x176)+_0x22290c[_0x5aec25(0x16a)]+'.'+_0x22290c[_0x5aec25(0x167)]+_0x5aec25(0x163)+_0x15ef6b[_0x5aec25(0x14d)][_0x5aec25(0x16a)]+'.'+_0x15ef6b[_0x5aec25(0x14d)]['table']+_0x5aec25(0x156)+_0x15ef6b[_0x5aec25(0x16e)]['parent_key']+_0x5aec25(0x140)+_0x15ef6b['join'][_0x5aec25(0x160)]+'\x0aLIMIT\x200\x0a')[_0x5aec25(0x149)]();}export function generateBehaviorSchemaSQL(_0x56add7,_0xac11d){const _0x360a47=a148_0xb0c9,_0xb0f9f8=_0x56add7[_0x360a47(0x146)],_0x4d8845=_0xac11d[_0x360a47(0x16e)]['parent_key'];let _0x23707e;if(_0xac11d[_0x360a47(0x14f)])_0x23707e=_0x360a47(0x169);else _0xac11d['columns']&&_0xac11d['columns'][_0x360a47(0x142)]>0x0?_0x23707e=_0xac11d[_0x360a47(0x141)]['map'](_0x2031e7=>'b.'+_0x2031e7[_0x360a47(0x158)])[_0x360a47(0x16e)](',\x20'):_0x23707e=_0x360a47(0x169);return('\x0aSELECT\x20m.'+_0x4d8845+',\x20'+_0x23707e+_0x360a47(0x176)+_0xb0f9f8[_0x360a47(0x16a)]+'.'+_0xb0f9f8[_0x360a47(0x167)]+'\x20m\x0aJOIN\x20'+_0xac11d[_0x360a47(0x14d)][_0x360a47(0x16a)]+'.'+_0xac11d['source'][_0x360a47(0x167)]+_0x360a47(0x153)+_0xac11d[_0x360a47(0x16e)][_0x360a47(0x143)]+_0x360a47(0x15c)+_0xac11d[_0x360a47(0x16e)][_0x360a47(0x160)]+'\x0aLIMIT\x200\x0a')[_0x360a47(0x149)]();}export function getAttributeColumns(_0x3c17a7){const _0x467e02=a148_0xb0c9;return _0x3c17a7[_0x467e02(0x141)]['map'](_0xae3df8=>({'label':_0xae3df8[_0x467e02(0x14c)]||_0xae3df8[_0x467e02(0x158)],'column':_0xae3df8[_0x467e02(0x158)]}));}export function getBehaviorColumns(_0x1838dd){const _0x48880c=a148_0xb0c9;if(_0x1838dd['all_columns'])return[{'label':'(all\x20columns)','column':'*'}];if(_0x1838dd['columns']&&_0x1838dd[_0x48880c(0x141)]['length']>0x0)return _0x1838dd[_0x48880c(0x141)][_0x48880c(0x15a)](_0x220be0=>({'label':_0x220be0[_0x48880c(0x14c)]||_0x220be0[_0x48880c(0x158)],'column':_0x220be0[_0x48880c(0x158)]}));return[{'label':_0x48880c(0x15b),'column':'*'}];}function a148_0xb73b(){const _0x5a5058=['2313192arxXLU','1665OSChHJ','behaviors','\x0aLIMIT\x20','\x0aFROM\x20','replace','\x20=\x20a.','columns','length','parent_key','\x20LIMIT\x20','SELECT\x20','master','\x0aSELECT\x20','SELECT\x20*\x20FROM\x20','trim','2626320CyxZjO','name','label','source','13360qDHXqb','all_columns','\x0aSELECT\x20m.','1544830kkfiao','\x0aWHERE\x20a.','\x20b\x0a\x20\x20ON\x20m.','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','\x20m\x0aLEFT\x20JOIN\x20','\x20a\x0a\x20\x20ON\x20m.','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','column','\x20m\x0a','map','(all\x20columns)','\x20=\x20b.','\x0a\x20\x20ON\x20m.','\x20=\x20','push','child_key','6DuOcZT','toLowerCase','\x20m\x0aJOIN\x20','\x20FROM\x20','280104MzdRAa','454352UQnpTY','table','15shXnhz','b.*','database','LEFT\x20JOIN\x20','test','170445tOgHUt','join','\x27)\x0a','\x20AS\x20','attributes'];a148_0xb73b=function(){return _0x5a5058;};return a148_0xb73b();}export function findAttributeByName(_0x1a6d50,_0x1563a6){const _0x1e9828=a148_0xb0c9;return _0x1a6d50[_0x1e9828(0x171)]?.['find'](_0x2b0943=>_0x2b0943['name'][_0x1e9828(0x162)]()===_0x1563a6[_0x1e9828(0x162)]());}export function findBehaviorByName(_0x5f5720,_0x376234){const _0x38f68b=a148_0xb0c9;return _0x5f5720[_0x38f68b(0x174)]?.['find'](_0x4a317a=>_0x4a317a[_0x38f68b(0x14b)][_0x38f68b(0x162)]()===_0x376234[_0x38f68b(0x162)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2bc85c,_0x4c55ba){const _0x3ba1a9=a149_0x5bc7,_0x25cce3=_0x2bc85c();while(!![]){try{const _0x4a6597=-parseInt(_0x3ba1a9(0x150))/0x1+parseInt(_0x3ba1a9(0x120))/0x2+-parseInt(_0x3ba1a9(0x107))/0x3*(-parseInt(_0x3ba1a9(0x14a))/0x4)+parseInt(_0x3ba1a9(0x152))/0x5*(parseInt(_0x3ba1a9(0x153))/0x6)+parseInt(_0x3ba1a9(0x104))/0x7*(-parseInt(_0x3ba1a9(0x145))/0x8)+-parseInt(_0x3ba1a9(0xf4))/0x9+-parseInt(_0x3ba1a9(0x129))/0xa*(parseInt(_0x3ba1a9(0x140))/0xb);if(_0x4a6597===_0x4c55ba)break;else _0x25cce3['push'](_0x25cce3['shift']());}catch(_0x497c3f){_0x25cce3['push'](_0x25cce3['shift']());}}}(a149_0x3197,0x3b6c1));import*as a149_0x3cc259 from'yaml';function formatScheduleTime(_0x129f92){const _0x1c2fb0=a149_0x5bc7;if(typeof _0x129f92===_0x1c2fb0(0x12c)){const _0x3f2416=Math[_0x1c2fb0(0x13b)](_0x129f92);return String(_0x3f2416)['padStart'](0x2,'0')+_0x1c2fb0(0xf9);}if(typeof _0x129f92===_0x1c2fb0(0xee)){if(/^\d{2}:\d{2}:\d{2}$/[_0x1c2fb0(0xf0)](_0x129f92))return _0x129f92;if(/^\d{1,2}:\d{2}$/[_0x1c2fb0(0xf0)](_0x129f92)){const [_0x432dc8,_0x1ee374]=_0x129f92['split'](':');return _0x432dc8[_0x1c2fb0(0x15a)](0x2,'0')+':'+_0x1ee374+_0x1c2fb0(0x159);}const _0x5bd73c=parseInt(_0x129f92,0xa);if(!isNaN(_0x5bd73c)&&_0x129f92['match'](/^\d+$/))return String(_0x5bd73c)['padStart'](0x2,'0')+_0x1c2fb0(0xf9);return _0x129f92;}return String(_0x129f92);}export function apiToDef(_0x2c9824){const _0x6c2226=a149_0x5bc7,_0x7d25ab={'database':_0x2c9824[_0x6c2226(0x147)]?.[_0x6c2226(0x154)]||'','table':_0x2c9824[_0x6c2226(0x147)]?.[_0x6c2226(0x133)]||''};_0x2c9824[_0x6c2226(0x127)]&&_0x2c9824['audienceFilters'][_0x6c2226(0x13a)]>0x0&&(_0x7d25ab[_0x6c2226(0x12d)]=_0x2c9824['audienceFilters'][_0x6c2226(0x139)](_0x4d6187=>({'column':_0x4d6187[_0x6c2226(0x135)],'values':_0x4d6187[_0x6c2226(0xec)]})));let _0x44ee4d;_0x2c9824[_0x6c2226(0x14d)]&&_0x2c9824[_0x6c2226(0x14d)]!==_0x6c2226(0x149)&&(_0x44ee4d={'type':_0x2c9824['scheduleType']},_0x2c9824[_0x6c2226(0xf2)]&&(_0x44ee4d[_0x6c2226(0x13c)]=formatScheduleTime(_0x2c9824[_0x6c2226(0xf2)])),_0x2c9824[_0x6c2226(0x11e)]&&(_0x44ee4d[_0x6c2226(0x11e)]=_0x2c9824[_0x6c2226(0x11e)]));let _0x3320f1;(_0x2c9824[_0x6c2226(0xed)]||_0x2c9824[_0x6c2226(0x117)]||_0x2c9824[_0x6c2226(0x11d)])&&(_0x3320f1={},_0x2c9824[_0x6c2226(0xed)]&&(_0x3320f1['hive_only']=_0x2c9824['workflowHiveOnly']),_0x2c9824[_0x6c2226(0x117)]&&(_0x3320f1[_0x6c2226(0x112)]=_0x2c9824['hivePoolName']),_0x2c9824['prestoPoolName']&&(_0x3320f1[_0x6c2226(0x10f)]=_0x2c9824['prestoPoolName']));const _0xfc72df=_0x2c9824[_0x6c2226(0x12e)]&&_0x2c9824[_0x6c2226(0x12e)]['length']>0x0?groupAttributesBySource(_0x2c9824[_0x6c2226(0x12e)]):undefined,_0x542d1d=_0x2c9824[_0x6c2226(0x14f)]&&_0x2c9824[_0x6c2226(0x14f)][_0x6c2226(0x13a)]>0x0?_0x2c9824[_0x6c2226(0x14f)][_0x6c2226(0x139)](convertApiBehaviorToYaml):undefined;let _0x4835ac;_0x2c9824[_0x6c2226(0x136)]&&(_0x4835ac={'name':_0x2c9824[_0x6c2226(0x136)][_0x6c2226(0x151)],'source':{'database':_0x2c9824[_0x6c2226(0x136)][_0x6c2226(0x154)],'table':_0x2c9824[_0x6c2226(0x136)][_0x6c2226(0x133)]},'join':{'parent_key':_0x2c9824[_0x6c2226(0x136)][_0x6c2226(0x14e)],'child_key':_0x2c9824[_0x6c2226(0x136)][_0x6c2226(0x125)]}},_0x2c9824[_0x6c2226(0x136)][_0x6c2226(0x11c)]&&_0x2c9824[_0x6c2226(0x136)][_0x6c2226(0x11c)][_0x6c2226(0x13a)]>0x0&&(_0x4835ac['attributes']=groupAttributesBySource(_0x2c9824['customerGroup'][_0x6c2226(0x11c)])),_0x2c9824[_0x6c2226(0x136)][_0x6c2226(0x14c)]&&_0x2c9824['customerGroup']['customerGroupBehaviors'][_0x6c2226(0x13a)]>0x0&&(_0x4835ac['behaviors']=_0x2c9824['customerGroup']['customerGroupBehaviors'][_0x6c2226(0x139)](convertApiBehaviorToYaml)));const _0x25bba1={'name':_0x2c9824['name'],..._0x2c9824[_0x6c2226(0x114)]&&{'description':_0x2c9824['description']},'master':_0x7d25ab,..._0x44ee4d&&{'schedule':_0x44ee4d},..._0x3320f1&&{'engine':_0x3320f1},..._0xfc72df&&{'attributes':_0xfc72df},..._0x542d1d&&{'behaviors':_0x542d1d},..._0x4835ac&&{'customer_group':_0x4835ac}};return _0x25bba1;}function groupAttributesBySource(_0x1aa1e){const _0x56ff1f=a149_0x5bc7,_0x2ff357=new Map();for(const _0x54e222 of _0x1aa1e){const _0x411a4d=_0x54e222[_0x56ff1f(0x154)]+'.'+_0x54e222[_0x56ff1f(0x133)]+'.'+_0x54e222[_0x56ff1f(0x125)]+'.'+_0x54e222['foreignKey'];!_0x2ff357[_0x56ff1f(0x158)](_0x411a4d)&&_0x2ff357[_0x56ff1f(0x15d)](_0x411a4d,[]),_0x2ff357[_0x56ff1f(0xfa)](_0x411a4d)[_0x56ff1f(0x138)](_0x54e222);}const _0x36ee1d=[];for(const [,_0x192854]of _0x2ff357){const _0x28ce0d=_0x192854[0x0],_0xbfb3d8=_0x28ce0d[_0x56ff1f(0x10c)]||_0x28ce0d['parentTableName'];_0x36ee1d[_0x56ff1f(0x138)]({'name':_0xbfb3d8,'source':{'database':_0x28ce0d['parentDatabaseName'],'table':_0x28ce0d['parentTableName']},'join':{'parent_key':_0x28ce0d[_0x56ff1f(0x14e)],'child_key':_0x28ce0d[_0x56ff1f(0x125)]},'columns':_0x192854[_0x56ff1f(0x139)](_0x2339d2=>{const _0x31c5a0=_0x56ff1f,_0x33eb9a={'column':_0x2339d2['parentColumn'],'type':_0x2339d2[_0x31c5a0(0x146)]};return _0x2339d2[_0x31c5a0(0x151)]!==_0x2339d2['parentColumn']&&(_0x33eb9a[_0x31c5a0(0xef)]=_0x2339d2[_0x31c5a0(0x151)]),_0x33eb9a;})});}return _0x36ee1d;}function convertApiBehaviorToYaml(_0x12ee95){const _0x20d131=a149_0x5bc7,_0x28da50={'name':_0x12ee95[_0x20d131(0x151)],'source':{'database':_0x12ee95[_0x20d131(0x154)],'table':_0x12ee95[_0x20d131(0x133)]},'join':{'parent_key':_0x12ee95[_0x20d131(0x14e)],'child_key':_0x12ee95[_0x20d131(0x125)]}};if(_0x12ee95[_0x20d131(0xea)])_0x28da50['all_columns']=!![];else _0x12ee95[_0x20d131(0x105)]&&_0x12ee95[_0x20d131(0x105)][_0x20d131(0x13a)]>0x0&&(_0x28da50[_0x20d131(0x11a)]=_0x12ee95[_0x20d131(0x105)][_0x20d131(0x139)](_0x17f6ad=>{const _0x12d63a=_0x20d131,_0x3a65ed={'column':_0x17f6ad['parentColumn'],'type':_0x17f6ad[_0x12d63a(0x146)]};return _0x17f6ad[_0x12d63a(0x151)]!==_0x17f6ad[_0x12d63a(0x128)]&&(_0x3a65ed['label']=_0x17f6ad['name']),_0x3a65ed;}));return _0x12ee95[_0x20d131(0x15e)]&&(_0x28da50[_0x20d131(0x122)]=_0x12ee95[_0x20d131(0x15e)]),_0x12ee95[_0x20d131(0x10a)]&&(_0x28da50[_0x20d131(0x102)]=_0x12ee95['isRealtime']),_0x28da50;}export function defToApi(_0x5d3431){const _0x24b454=a149_0x5bc7,_0x3054da={'name':_0x5d3431[_0x24b454(0x151)],'master':{'parentDatabaseName':_0x5d3431[_0x24b454(0x147)][_0x24b454(0x116)],'parentTableName':_0x5d3431['master'][_0x24b454(0x132)]}};_0x5d3431['description']&&(_0x3054da[_0x24b454(0x114)]=_0x5d3431[_0x24b454(0x114)]);_0x5d3431[_0x24b454(0x147)][_0x24b454(0x12d)]&&_0x5d3431[_0x24b454(0x147)][_0x24b454(0x12d)][_0x24b454(0x13a)]>0x0&&(_0x3054da[_0x24b454(0x127)]=_0x5d3431['master'][_0x24b454(0x12d)][_0x24b454(0x139)](_0x104271=>({'columnName':_0x104271[_0x24b454(0x111)],'rightValues':_0x104271[_0x24b454(0xf8)]})));_0x5d3431[_0x24b454(0x109)]&&(_0x3054da[_0x24b454(0x14d)]=_0x5d3431['schedule'][_0x24b454(0x146)],_0x5d3431['schedule']['time']&&(_0x3054da[_0x24b454(0xf2)]=_0x5d3431[_0x24b454(0x109)][_0x24b454(0x13c)]),_0x5d3431[_0x24b454(0x109)][_0x24b454(0x11e)]&&(_0x3054da[_0x24b454(0x11e)]=_0x5d3431['schedule'][_0x24b454(0x11e)]));_0x5d3431[_0x24b454(0x13d)]&&(_0x5d3431['engine'][_0x24b454(0x137)]!==undefined&&(_0x3054da[_0x24b454(0xed)]=_0x5d3431[_0x24b454(0x13d)][_0x24b454(0x137)]),_0x5d3431[_0x24b454(0x13d)][_0x24b454(0x112)]!==undefined&&(_0x3054da[_0x24b454(0x117)]=_0x5d3431['engine'][_0x24b454(0x112)]),_0x5d3431['engine']['trino_pool']!==undefined&&(_0x3054da[_0x24b454(0x11d)]=_0x5d3431[_0x24b454(0x13d)][_0x24b454(0x10f)]));_0x5d3431['attributes']&&_0x5d3431[_0x24b454(0x12e)][_0x24b454(0x13a)]>0x0&&(_0x3054da[_0x24b454(0x12e)]=flattenAttributeGroups(_0x5d3431[_0x24b454(0x12e)]));_0x5d3431[_0x24b454(0x14f)]&&_0x5d3431['behaviors'][_0x24b454(0x13a)]>0x0&&(_0x3054da[_0x24b454(0x14f)]=_0x5d3431['behaviors'][_0x24b454(0x139)](convertDefBehaviorToApi));if(_0x5d3431[_0x24b454(0x15b)]){const _0xc73b5e=_0x5d3431['customer_group'];_0x3054da[_0x24b454(0x136)]={'name':_0xc73b5e['name'],'parentDatabaseName':_0xc73b5e[_0x24b454(0xf7)][_0x24b454(0x116)],'parentTableName':_0xc73b5e[_0x24b454(0xf7)][_0x24b454(0x132)],'parentKey':_0xc73b5e[_0x24b454(0x118)][_0x24b454(0x15c)],'foreignKey':_0xc73b5e['join'][_0x24b454(0x126)]},_0xc73b5e[_0x24b454(0x12e)]&&_0xc73b5e[_0x24b454(0x12e)]['length']>0x0&&(_0x3054da[_0x24b454(0x136)][_0x24b454(0x11c)]=flattenAttributeGroups(_0xc73b5e[_0x24b454(0x12e)])[_0x24b454(0x139)](_0x5c4bd2=>({'name':_0x5c4bd2[_0x24b454(0x151)],'type':_0x5c4bd2['type'],'parentDatabaseName':_0x5c4bd2['parentDatabaseName'],'parentTableName':_0x5c4bd2['parentTableName'],'parentColumn':_0x5c4bd2['parentColumn'],'parentKey':_0x5c4bd2[_0x24b454(0x125)],'foreignKey':_0x5c4bd2[_0x24b454(0x14e)]}))),_0xc73b5e[_0x24b454(0x14f)]&&_0xc73b5e[_0x24b454(0x14f)][_0x24b454(0x13a)]>0x0&&(_0x3054da[_0x24b454(0x136)][_0x24b454(0x14c)]=_0xc73b5e[_0x24b454(0x14f)]['map'](_0x4af47d=>({'name':_0x4af47d[_0x24b454(0x151)],'parentDatabaseName':_0x4af47d[_0x24b454(0xf7)][_0x24b454(0x116)],'parentTableName':_0x4af47d['source'][_0x24b454(0x132)],'parentKey':_0x4af47d[_0x24b454(0x118)][_0x24b454(0x15c)],'foreignKey':_0x4af47d[_0x24b454(0x118)][_0x24b454(0x126)],'allColumns':_0x4af47d[_0x24b454(0x141)],'schema':_0x4af47d[_0x24b454(0x11a)]?.[_0x24b454(0x139)](_0x2680f0=>({'name':_0x2680f0[_0x24b454(0xef)]||_0x2680f0[_0x24b454(0x111)],'type':_0x2680f0[_0x24b454(0x146)],'parentColumn':_0x2680f0['column']}))})));}return _0x3054da;}function flattenAttributeGroups(_0x41fa87){const _0x131436=a149_0x5bc7,_0x50c8e2=[];for(const _0x101591 of _0x41fa87){for(const _0x385039 of _0x101591['columns']){_0x50c8e2[_0x131436(0x138)]({'name':_0x385039[_0x131436(0xef)]||_0x385039[_0x131436(0x111)],'type':_0x385039[_0x131436(0x146)],'parentDatabaseName':_0x101591[_0x131436(0xf7)][_0x131436(0x116)],'parentTableName':_0x101591['source']['table'],'parentColumn':_0x385039['column'],'parentKey':_0x101591[_0x131436(0x118)][_0x131436(0x15c)],'foreignKey':_0x101591[_0x131436(0x118)][_0x131436(0x126)],'groupingName':_0x101591['name']});}}return _0x50c8e2;}function convertDefBehaviorToApi(_0x65e24b){const _0x20cdb6=a149_0x5bc7,_0x48ab3b={'name':_0x65e24b[_0x20cdb6(0x151)],'parentDatabaseName':_0x65e24b[_0x20cdb6(0xf7)][_0x20cdb6(0x116)],'parentTableName':_0x65e24b['source'][_0x20cdb6(0x132)],'parentKey':_0x65e24b[_0x20cdb6(0x118)][_0x20cdb6(0x15c)],'foreignKey':_0x65e24b['join'][_0x20cdb6(0x126)]};if(_0x65e24b[_0x20cdb6(0x141)])_0x48ab3b[_0x20cdb6(0xea)]=!![];else _0x65e24b['columns']&&_0x65e24b['columns'][_0x20cdb6(0x13a)]>0x0&&(_0x48ab3b['schema']=_0x65e24b[_0x20cdb6(0x11a)][_0x20cdb6(0x139)](_0x5e53ce=>({'name':_0x5e53ce[_0x20cdb6(0xef)]||_0x5e53ce['column'],'type':_0x5e53ce[_0x20cdb6(0x146)],'parentColumn':_0x5e53ce['column']})));return _0x65e24b[_0x20cdb6(0x122)]!==undefined&&(_0x48ab3b[_0x20cdb6(0x15e)]=_0x65e24b[_0x20cdb6(0x122)]),_0x65e24b[_0x20cdb6(0x102)]!==undefined&&(_0x48ab3b[_0x20cdb6(0x10a)]=_0x65e24b['realtime']),_0x48ab3b;}export function serializeDef(_0x499e44){const _0x26cbfa=a149_0x5bc7,_0x48a5ff=JSON[_0x26cbfa(0x12b)](JSON['stringify'](_0x499e44)),_0x52e8c0=a149_0x3cc259[_0x26cbfa(0x157)](_0x48a5ff,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x26cbfa(0x134)}),_0x38395a=[_0x26cbfa(0x113),_0x26cbfa(0x144),_0x26cbfa(0xf1),_0x26cbfa(0xf5),_0x26cbfa(0x119),_0x26cbfa(0x10d),_0x26cbfa(0x103),_0x26cbfa(0x121)];let _0x17d6ad=_0x52e8c0;for(const _0xf9b218 of _0x38395a){_0x17d6ad=_0x17d6ad[_0x26cbfa(0x12f)](new RegExp('^('+_0xf9b218+')','m'),(_0x158dcc,_0x42170d,_0x4fcdd2)=>{if(_0x4fcdd2===0x0||_0x17d6ad[_0x4fcdd2-0x1]==='\x0a'&&_0x17d6ad[_0x4fcdd2-0x2]==='\x0a')return _0x42170d;return'\x0a'+_0x42170d;});}return _0x17d6ad;}function a149_0x5bc7(_0x223d25,_0x4fe4bd){_0x223d25=_0x223d25-0xea;const _0x319760=a149_0x3197();let _0x5bc72a=_0x319760[_0x223d25];return _0x5bc72a;}export function parseDef(_0x36c91d){const _0x447063=a149_0x5bc7,_0x442755=a149_0x3cc259['parse'](_0x36c91d);if(!_0x442755['name'])throw new Error(_0x447063(0xff));if(!_0x442755[_0x447063(0x147)])throw new Error(_0x447063(0x106));if(!_0x442755[_0x447063(0x147)][_0x447063(0x116)])throw new Error(_0x447063(0x10e));if(!_0x442755['master'][_0x447063(0x132)])throw new Error(_0x447063(0xf6));return _0x442755[_0x447063(0x102)]&&validateRealtimeSection(_0x442755['realtime']),_0x442755[_0x447063(0x143)]&&validatePersonalizationServices(_0x442755[_0x447063(0x143)]),_0x442755;}function validateRealtimeSection(_0x5d8d3a){const _0x3b6391=a149_0x5bc7,_0x4ff12a=['single',_0x3b6391(0x11f),_0x3b6391(0x15d),_0x3b6391(0x13f),_0x3b6391(0x101),'imported_batch'];_0x5d8d3a[_0x3b6391(0x115)]&&Array['isArray'](_0x5d8d3a[_0x3b6391(0x115)])&&_0x5d8d3a['events'][_0x3b6391(0x124)]((_0x41a5dc,_0x34dc92)=>{const _0x3f1de3=_0x3b6391;if(!_0x41a5dc[_0x3f1de3(0x151)])throw new Error('realtime.events['+_0x34dc92+_0x3f1de3(0xfc));});_0x5d8d3a['attributes']&&Array[_0x3b6391(0x13e)](_0x5d8d3a[_0x3b6391(0x12e)])&&_0x5d8d3a[_0x3b6391(0x12e)][_0x3b6391(0x124)]((_0x154aff,_0x3f95ed)=>{const _0xc2b9af=_0x3b6391;if(!_0x154aff[_0xc2b9af(0x151)])throw new Error(_0xc2b9af(0xfd)+_0x3f95ed+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x154aff['type']&&!_0x4ff12a[_0xc2b9af(0x100)](_0x154aff[_0xc2b9af(0x146)]))throw new Error('realtime.attributes['+_0x3f95ed+_0xc2b9af(0x156)+_0x154aff[_0xc2b9af(0x151)]+_0xc2b9af(0xf3)+_0x154aff['type']+'\x27.\x20Must\x20be\x20one\x20of:\x20'+_0x4ff12a[_0xc2b9af(0x118)](',\x20'));});if(_0x5d8d3a['id_stitching']){if(!_0x5d8d3a[_0x3b6391(0x110)][_0x3b6391(0x10b)])throw new Error(_0x3b6391(0xfb));}}function a149_0x3197(){const _0x417f42=['test','engine:','scheduleOption','):\x20Invalid\x20type\x20\x27','2431386xxCFHO','attributes:','YAML\x20config\x20missing\x20required\x20field:\x20master.table','source','values',':00:00','get','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27',']:\x20Missing\x20required\x20field\x20\x27name\x27','realtime.attributes[','Example\x20Events','YAML\x20config\x20missing\x20required\x20field:\x20name','includes','list','realtime','realtime:','1113826rZiQQC','schema','YAML\x20config\x20missing\x20required\x20field:\x20master','9QbMeQC','personalization_services[','schedule','isRealtime','primary_key','groupingName','customer_group:','YAML\x20config\x20missing\x20required\x20field:\x20master.database','trino_pool','id_stitching','column','hive_pool','master:','description','events','database','hivePoolName','join','behaviors:','columns','attribute_table','customerGroupAttributes','prestoPoolName','timezone','counter','946146nHhUma','personalization_services:','default_time_filter','Parent\x20segment\x20description','forEach','parentKey','parent_key','audienceFilters','parentColumn','1310zwZhFA','Example\x20Attributes','parse','number','filters','attributes','replace','user_id','03:00','table','parentTableName','null','columnName','customerGroup','hive_only','push','map','length','floor','time','engine','isArray','ordered_set','6776KKtWcl','all_columns','events_table','personalization_services','schedule:','24SITNPq','type','master','personalization_services\x20must\x20be\x20an\x20array','none','381244uzXcwj','customer_id','customerGroupBehaviors','scheduleType','foreignKey','behaviors','139442mVwHAK','name','2260165BtZCEC','6bICRrO','parentDatabaseName','daily',']\x20(','stringify','has',':00','padStart','customer_group','child_key','set','defaultTimeFilterEnabled','allColumns','column_name','rightValues','workflowHiveOnly','string','label'];a149_0x3197=function(){return _0x417f42;};return a149_0x3197();}function validatePersonalizationServices(_0xbb755f){const _0x19dfd3=a149_0x5bc7;if(!Array[_0x19dfd3(0x13e)](_0xbb755f))throw new Error(_0x19dfd3(0x148));_0xbb755f[_0x19dfd3(0x124)]((_0x48d6d1,_0x399641)=>{const _0x1ef987=_0x19dfd3;if(!_0x48d6d1[_0x1ef987(0x151)])throw new Error(_0x1ef987(0x108)+_0x399641+_0x1ef987(0xfc));});}export function generateTemplate(_0x17de5d,_0x2e9959,_0x14fde5){const _0x2a2b5d=a149_0x5bc7,_0x7faaec={'name':_0x17de5d,'description':_0x2a2b5d(0x123),'master':{'database':_0x2e9959,'table':_0x14fde5},'schedule':{'type':_0x2a2b5d(0x155),'time':_0x2a2b5d(0x131),'timezone':'UTC'},'attributes':[{'name':_0x2a2b5d(0x12a),'source':{'database':_0x2e9959,'table':_0x2a2b5d(0x11b)},'join':{'parent_key':'id','child_key':'customer_id'},'columns':[{'column':_0x2a2b5d(0xeb),'label':'Display\x20Name','type':_0x2a2b5d(0xee)}]}],'behaviors':[{'name':_0x2a2b5d(0xfe),'source':{'database':_0x2e9959,'table':_0x2a2b5d(0x142)},'join':{'parent_key':_0x2a2b5d(0x130),'child_key':_0x2a2b5d(0x14b)},'all_columns':!![]}]};return serializeDef(_0x7faaec);}
|
|
1
|
+
(function(_0x2fcabc,_0x536e43){const _0x1e88d8=a149_0x1618,_0x8479e9=_0x2fcabc();while(!![]){try{const _0xcc04b1=parseInt(_0x1e88d8(0x12a))/0x1+parseInt(_0x1e88d8(0x110))/0x2+-parseInt(_0x1e88d8(0x103))/0x3+-parseInt(_0x1e88d8(0x154))/0x4*(parseInt(_0x1e88d8(0x100))/0x5)+parseInt(_0x1e88d8(0x135))/0x6*(parseInt(_0x1e88d8(0x142))/0x7)+parseInt(_0x1e88d8(0x13a))/0x8+parseInt(_0x1e88d8(0x12e))/0x9*(parseInt(_0x1e88d8(0x11a))/0xa);if(_0xcc04b1===_0x536e43)break;else _0x8479e9['push'](_0x8479e9['shift']());}catch(_0x32745d){_0x8479e9['push'](_0x8479e9['shift']());}}}(a149_0x139b,0x38862));import*as a149_0x541ffb from'yaml';function formatScheduleTime(_0x35d37c){const _0x2ba23e=a149_0x1618;if(typeof _0x35d37c===_0x2ba23e(0x147)){const _0x2216fe=Math[_0x2ba23e(0x13c)](_0x35d37c);return String(_0x2216fe)[_0x2ba23e(0x102)](0x2,'0')+_0x2ba23e(0x125);}if(typeof _0x35d37c===_0x2ba23e(0xf5)){if(/^\d{2}:\d{2}:\d{2}$/['test'](_0x35d37c))return _0x35d37c;if(/^\d{1,2}:\d{2}$/[_0x2ba23e(0xf2)](_0x35d37c)){const [_0x11a3ee,_0x58c18f]=_0x35d37c[_0x2ba23e(0x10b)](':');return _0x11a3ee[_0x2ba23e(0x102)](0x2,'0')+':'+_0x58c18f+_0x2ba23e(0xfc);}const _0x1c9ebb=parseInt(_0x35d37c,0xa);if(!isNaN(_0x1c9ebb)&&_0x35d37c[_0x2ba23e(0x12d)](/^\d+$/))return String(_0x1c9ebb)[_0x2ba23e(0x102)](0x2,'0')+_0x2ba23e(0x125);return _0x35d37c;}return String(_0x35d37c);}export function apiToDef(_0x3f9cb9){const _0x17714b=a149_0x1618,_0xfe8868={'database':_0x3f9cb9['master']?.['parentDatabaseName']||'','table':_0x3f9cb9[_0x17714b(0x11f)]?.[_0x17714b(0x138)]||''};_0x3f9cb9[_0x17714b(0x107)]&&_0x3f9cb9[_0x17714b(0x107)][_0x17714b(0x104)]>0x0&&(_0xfe8868[_0x17714b(0xfe)]=_0x3f9cb9[_0x17714b(0x107)][_0x17714b(0x108)](_0x4675ef=>({'column':_0x4675ef[_0x17714b(0xfd)],'values':_0x4675ef['rightValues']})));let _0x19c587;_0x3f9cb9['scheduleType']&&_0x3f9cb9[_0x17714b(0x129)]!=='none'&&(_0x19c587={'type':_0x3f9cb9[_0x17714b(0x129)]},_0x3f9cb9[_0x17714b(0xfa)]&&(_0x19c587[_0x17714b(0x134)]=formatScheduleTime(_0x3f9cb9[_0x17714b(0xfa)])),_0x3f9cb9[_0x17714b(0x10e)]&&(_0x19c587[_0x17714b(0x10e)]=_0x3f9cb9['timezone']));let _0x391aad;(_0x3f9cb9['workflowHiveOnly']||_0x3f9cb9['hivePoolName']||_0x3f9cb9[_0x17714b(0x143)])&&(_0x391aad={},_0x3f9cb9[_0x17714b(0x130)]&&(_0x391aad[_0x17714b(0x12c)]=_0x3f9cb9[_0x17714b(0x130)]),_0x3f9cb9[_0x17714b(0x106)]&&(_0x391aad[_0x17714b(0xef)]=_0x3f9cb9[_0x17714b(0x106)]),_0x3f9cb9[_0x17714b(0x143)]&&(_0x391aad['trino_pool']=_0x3f9cb9[_0x17714b(0x143)]));const _0x38d114=_0x3f9cb9['attributes']&&_0x3f9cb9[_0x17714b(0x14c)]['length']>0x0?groupAttributesBySource(_0x3f9cb9['attributes']):undefined,_0x208d8e=_0x3f9cb9[_0x17714b(0x131)]&&_0x3f9cb9[_0x17714b(0x131)][_0x17714b(0x104)]>0x0?_0x3f9cb9[_0x17714b(0x131)][_0x17714b(0x108)](convertApiBehaviorToYaml):undefined;let _0x54cf94;_0x3f9cb9[_0x17714b(0x123)]&&(_0x54cf94={'name':_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x157)],'source':{'database':_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x11e)],'table':_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x138)]},'join':{'parent_key':_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0xf1)],'child_key':_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x12b)]}},_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x13b)]&&_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x13b)][_0x17714b(0x104)]>0x0&&(_0x54cf94['attributes']=groupAttributesBySource(_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x13b)])),_0x3f9cb9['customerGroup'][_0x17714b(0xf8)]&&_0x3f9cb9['customerGroup'][_0x17714b(0xf8)]['length']>0x0&&(_0x54cf94[_0x17714b(0x131)]=_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0xf8)]['map'](convertApiBehaviorToYaml)));const _0x2097bd={'name':_0x3f9cb9['name'],..._0x3f9cb9[_0x17714b(0x159)]&&{'description':_0x3f9cb9['description']},'master':_0xfe8868,..._0x19c587&&{'schedule':_0x19c587},..._0x391aad&&{'engine':_0x391aad},..._0x38d114&&{'attributes':_0x38d114},..._0x208d8e&&{'behaviors':_0x208d8e},..._0x54cf94&&{'customer_group':_0x54cf94}};return _0x2097bd;}function groupAttributesBySource(_0x2cc0b6){const _0x4d6149=a149_0x1618,_0x467bae=new Map();for(const _0x51a0c7 of _0x2cc0b6){const _0x33cd7a=_0x51a0c7[_0x4d6149(0x11e)]+'.'+_0x51a0c7[_0x4d6149(0x138)]+'.'+_0x51a0c7[_0x4d6149(0x12b)]+'.'+_0x51a0c7[_0x4d6149(0xf1)];!_0x467bae[_0x4d6149(0x10f)](_0x33cd7a)&&_0x467bae[_0x4d6149(0xf3)](_0x33cd7a,[]),_0x467bae[_0x4d6149(0x117)](_0x33cd7a)['push'](_0x51a0c7);}const _0x1ff301=[];for(const [,_0x298522]of _0x467bae){const _0x530cd4=_0x298522[0x0],_0x260e67=_0x530cd4[_0x4d6149(0xff)]||_0x530cd4[_0x4d6149(0x138)];_0x1ff301[_0x4d6149(0x139)]({'name':_0x260e67,'source':{'database':_0x530cd4['parentDatabaseName'],'table':_0x530cd4[_0x4d6149(0x138)]},'join':{'parent_key':_0x530cd4[_0x4d6149(0xf1)],'child_key':_0x530cd4['parentKey']},'columns':_0x298522['map'](_0x2e06af=>{const _0x578cc0=_0x4d6149,_0x305b1c={'column':_0x2e06af[_0x578cc0(0x149)],'type':_0x2e06af['type']};return _0x2e06af[_0x578cc0(0x157)]!==_0x2e06af[_0x578cc0(0x149)]&&(_0x305b1c[_0x578cc0(0x12f)]=_0x2e06af[_0x578cc0(0x157)]),_0x305b1c;})});}return _0x1ff301;}function convertApiBehaviorToYaml(_0x1ea523){const _0x145d6c=a149_0x1618,_0x24cbd1={'name':_0x1ea523[_0x145d6c(0x157)],'source':{'database':_0x1ea523[_0x145d6c(0x11e)],'table':_0x1ea523[_0x145d6c(0x138)]},'join':{'parent_key':_0x1ea523['foreignKey'],'child_key':_0x1ea523[_0x145d6c(0x12b)]}};if(_0x1ea523[_0x145d6c(0x113)])_0x24cbd1['all_columns']=!![];else _0x1ea523['schema']&&_0x1ea523[_0x145d6c(0x158)]['length']>0x0&&(_0x24cbd1['columns']=_0x1ea523[_0x145d6c(0x158)][_0x145d6c(0x108)](_0x440e31=>{const _0x536717=_0x145d6c,_0x8d1e39={'column':_0x440e31['parentColumn'],'type':_0x440e31[_0x536717(0x14b)]};return _0x440e31['name']!==_0x440e31[_0x536717(0x149)]&&(_0x8d1e39[_0x536717(0x12f)]=_0x440e31[_0x536717(0x157)]),_0x8d1e39;}));return _0x1ea523[_0x145d6c(0x116)]&&(_0x24cbd1['default_time_filter']=_0x1ea523[_0x145d6c(0x116)]),_0x1ea523[_0x145d6c(0x105)]&&(_0x24cbd1[_0x145d6c(0x152)]=_0x1ea523[_0x145d6c(0x105)]),_0x24cbd1;}function a149_0x139b(){const _0x3321c9=['number','Display\x20Name','parentColumn','isArray','type','attributes','schedule','includes','realtime.attributes[','all_columns','single','realtime','schedule:','4QknuQb','trino_pool','customer_id','name','schema','description','default_time_filter','personalization_services','customer_group','columns','values','hive_pool','personalization_services\x20must\x20be\x20an\x20array','foreignKey','test','set','engine','string','id_stitching','null','customerGroupBehaviors','attribute_table','scheduleOption','realtime:',':00','columnName','filters','groupingName','1460405MEiGVj','Example\x20Events','padStart','1281531yEfYGc','length','isRealtime','hivePoolName','audienceFilters','map','stringify','YAML\x20config\x20missing\x20required\x20field:\x20master','split','database','child_key','timezone','has','238546DQZXKn','03:00','UTC','allColumns','replace','parent_key','defaultTimeFilterEnabled','get','parse','column_name','10plpqaC','YAML\x20config\x20missing\x20required\x20field:\x20master.table','counter','events','parentDatabaseName','master','forEach','ordered_set','master:','customerGroup','primary_key',':00:00',']\x20(',']:\x20Missing\x20required\x20field\x20\x27name\x27','\x27.\x20Must\x20be\x20one\x20of:\x20','scheduleType','187491OiNnBi','parentKey','hive_only','match','868437VuoSSh','label','workflowHiveOnly','behaviors','join','column','time','488442AeEpgt','YAML\x20config\x20missing\x20required\x20field:\x20name','source','parentTableName','push','2426416fRMOXN','customerGroupAttributes','floor','imported_batch','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','Parent\x20segment\x20description','list','table','21qcunzC','prestoPoolName','attributes:','):\x20Invalid\x20type\x20\x27','customer_group:'];a149_0x139b=function(){return _0x3321c9;};return a149_0x139b();}export function defToApi(_0x566a52){const _0x404847=a149_0x1618,_0x3b939b={'name':_0x566a52[_0x404847(0x157)],'master':{'parentDatabaseName':_0x566a52[_0x404847(0x11f)][_0x404847(0x10c)],'parentTableName':_0x566a52[_0x404847(0x11f)][_0x404847(0x141)]}};_0x566a52[_0x404847(0x159)]&&(_0x3b939b[_0x404847(0x159)]=_0x566a52['description']);_0x566a52['master'][_0x404847(0xfe)]&&_0x566a52[_0x404847(0x11f)][_0x404847(0xfe)][_0x404847(0x104)]>0x0&&(_0x3b939b[_0x404847(0x107)]=_0x566a52['master'][_0x404847(0xfe)][_0x404847(0x108)](_0x24eeb4=>({'columnName':_0x24eeb4[_0x404847(0x133)],'rightValues':_0x24eeb4[_0x404847(0xee)]})));_0x566a52[_0x404847(0x14d)]&&(_0x3b939b[_0x404847(0x129)]=_0x566a52[_0x404847(0x14d)][_0x404847(0x14b)],_0x566a52[_0x404847(0x14d)]['time']&&(_0x3b939b[_0x404847(0xfa)]=_0x566a52[_0x404847(0x14d)][_0x404847(0x134)]),_0x566a52[_0x404847(0x14d)][_0x404847(0x10e)]&&(_0x3b939b['timezone']=_0x566a52[_0x404847(0x14d)]['timezone']));_0x566a52['engine']&&(_0x566a52[_0x404847(0xf4)][_0x404847(0x12c)]!==undefined&&(_0x3b939b[_0x404847(0x130)]=_0x566a52[_0x404847(0xf4)][_0x404847(0x12c)]),_0x566a52[_0x404847(0xf4)][_0x404847(0xef)]!==undefined&&(_0x3b939b[_0x404847(0x106)]=_0x566a52['engine'][_0x404847(0xef)]),_0x566a52[_0x404847(0xf4)][_0x404847(0x155)]!==undefined&&(_0x3b939b[_0x404847(0x143)]=_0x566a52[_0x404847(0xf4)]['trino_pool']));_0x566a52['attributes']&&_0x566a52[_0x404847(0x14c)][_0x404847(0x104)]>0x0&&(_0x3b939b[_0x404847(0x14c)]=flattenAttributeGroups(_0x566a52['attributes']));_0x566a52[_0x404847(0x131)]&&_0x566a52[_0x404847(0x131)][_0x404847(0x104)]>0x0&&(_0x3b939b[_0x404847(0x131)]=_0x566a52[_0x404847(0x131)][_0x404847(0x108)](convertDefBehaviorToApi));if(_0x566a52[_0x404847(0x15c)]){const _0x440f64=_0x566a52['customer_group'];_0x3b939b[_0x404847(0x123)]={'name':_0x440f64[_0x404847(0x157)],'parentDatabaseName':_0x440f64['source'][_0x404847(0x10c)],'parentTableName':_0x440f64['source'][_0x404847(0x141)],'parentKey':_0x440f64[_0x404847(0x132)][_0x404847(0x10d)],'foreignKey':_0x440f64['join'][_0x404847(0x115)]},_0x440f64[_0x404847(0x14c)]&&_0x440f64[_0x404847(0x14c)][_0x404847(0x104)]>0x0&&(_0x3b939b[_0x404847(0x123)]['customerGroupAttributes']=flattenAttributeGroups(_0x440f64[_0x404847(0x14c)])[_0x404847(0x108)](_0x16bcbd=>({'name':_0x16bcbd[_0x404847(0x157)],'type':_0x16bcbd[_0x404847(0x14b)],'parentDatabaseName':_0x16bcbd[_0x404847(0x11e)],'parentTableName':_0x16bcbd[_0x404847(0x138)],'parentColumn':_0x16bcbd['parentColumn'],'parentKey':_0x16bcbd[_0x404847(0x12b)],'foreignKey':_0x16bcbd[_0x404847(0xf1)]}))),_0x440f64[_0x404847(0x131)]&&_0x440f64[_0x404847(0x131)][_0x404847(0x104)]>0x0&&(_0x3b939b['customerGroup']['customerGroupBehaviors']=_0x440f64[_0x404847(0x131)][_0x404847(0x108)](_0x187b3e=>({'name':_0x187b3e['name'],'parentDatabaseName':_0x187b3e['source'][_0x404847(0x10c)],'parentTableName':_0x187b3e[_0x404847(0x137)][_0x404847(0x141)],'parentKey':_0x187b3e[_0x404847(0x132)][_0x404847(0x10d)],'foreignKey':_0x187b3e[_0x404847(0x132)]['parent_key'],'allColumns':_0x187b3e['all_columns'],'schema':_0x187b3e[_0x404847(0xed)]?.[_0x404847(0x108)](_0x1471f3=>({'name':_0x1471f3['label']||_0x1471f3[_0x404847(0x133)],'type':_0x1471f3[_0x404847(0x14b)],'parentColumn':_0x1471f3[_0x404847(0x133)]}))})));}return _0x3b939b;}function flattenAttributeGroups(_0x46b595){const _0x25320f=a149_0x1618,_0x153e8f=[];for(const _0xb5e205 of _0x46b595){for(const _0x1b2ebf of _0xb5e205[_0x25320f(0xed)]){_0x153e8f[_0x25320f(0x139)]({'name':_0x1b2ebf[_0x25320f(0x12f)]||_0x1b2ebf[_0x25320f(0x133)],'type':_0x1b2ebf[_0x25320f(0x14b)],'parentDatabaseName':_0xb5e205['source']['database'],'parentTableName':_0xb5e205[_0x25320f(0x137)][_0x25320f(0x141)],'parentColumn':_0x1b2ebf[_0x25320f(0x133)],'parentKey':_0xb5e205[_0x25320f(0x132)]['child_key'],'foreignKey':_0xb5e205[_0x25320f(0x132)]['parent_key'],'groupingName':_0xb5e205['name']});}}return _0x153e8f;}function a149_0x1618(_0x247cc5,_0x39cd41){_0x247cc5=_0x247cc5-0xed;const _0x139ba0=a149_0x139b();let _0x16184c=_0x139ba0[_0x247cc5];return _0x16184c;}function convertDefBehaviorToApi(_0x67c6ac){const _0xd60627=a149_0x1618,_0x2a1cfa={'name':_0x67c6ac[_0xd60627(0x157)],'parentDatabaseName':_0x67c6ac[_0xd60627(0x137)]['database'],'parentTableName':_0x67c6ac[_0xd60627(0x137)][_0xd60627(0x141)],'parentKey':_0x67c6ac[_0xd60627(0x132)][_0xd60627(0x10d)],'foreignKey':_0x67c6ac[_0xd60627(0x132)][_0xd60627(0x115)]};if(_0x67c6ac[_0xd60627(0x150)])_0x2a1cfa[_0xd60627(0x113)]=!![];else _0x67c6ac[_0xd60627(0xed)]&&_0x67c6ac[_0xd60627(0xed)][_0xd60627(0x104)]>0x0&&(_0x2a1cfa[_0xd60627(0x158)]=_0x67c6ac['columns'][_0xd60627(0x108)](_0x42d48e=>({'name':_0x42d48e[_0xd60627(0x12f)]||_0x42d48e[_0xd60627(0x133)],'type':_0x42d48e['type'],'parentColumn':_0x42d48e[_0xd60627(0x133)]})));return _0x67c6ac['default_time_filter']!==undefined&&(_0x2a1cfa[_0xd60627(0x116)]=_0x67c6ac[_0xd60627(0x15a)]),_0x67c6ac[_0xd60627(0x152)]!==undefined&&(_0x2a1cfa[_0xd60627(0x105)]=_0x67c6ac[_0xd60627(0x152)]),_0x2a1cfa;}export function serializeDef(_0x5b2af9){const _0x40d009=a149_0x1618,_0x4ce6bb=JSON[_0x40d009(0x118)](JSON[_0x40d009(0x109)](_0x5b2af9)),_0x462d4f=a149_0x541ffb[_0x40d009(0x109)](_0x4ce6bb,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x40d009(0xf7)}),_0x37b637=[_0x40d009(0x122),_0x40d009(0x153),'engine:',_0x40d009(0x144),'behaviors:',_0x40d009(0x146),_0x40d009(0xfb),'personalization_services:'];let _0x4e29b2=_0x462d4f;for(const _0x34c61a of _0x37b637){_0x4e29b2=_0x4e29b2[_0x40d009(0x114)](new RegExp('^('+_0x34c61a+')','m'),(_0x1df076,_0x54b725,_0x376bae)=>{if(_0x376bae===0x0||_0x4e29b2[_0x376bae-0x1]==='\x0a'&&_0x4e29b2[_0x376bae-0x2]==='\x0a')return _0x54b725;return'\x0a'+_0x54b725;});}return _0x4e29b2;}export function parseDef(_0x265d2a){const _0x435e5d=a149_0x1618,_0x191d99=a149_0x541ffb['parse'](_0x265d2a);if(!_0x191d99[_0x435e5d(0x157)])throw new Error(_0x435e5d(0x136));if(!_0x191d99[_0x435e5d(0x11f)])throw new Error(_0x435e5d(0x10a));if(!_0x191d99[_0x435e5d(0x11f)][_0x435e5d(0x10c)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x191d99['master'][_0x435e5d(0x141)])throw new Error(_0x435e5d(0x11b));return _0x191d99[_0x435e5d(0x152)]&&validateRealtimeSection(_0x191d99[_0x435e5d(0x152)]),_0x191d99['personalization_services']&&validatePersonalizationServices(_0x191d99[_0x435e5d(0x15b)]),_0x191d99;}function validateRealtimeSection(_0x2708ed){const _0x1a64aa=a149_0x1618,_0x4e7a14=[_0x1a64aa(0x151),_0x1a64aa(0x11c),_0x1a64aa(0xf3),_0x1a64aa(0x121),_0x1a64aa(0x140),_0x1a64aa(0x13d)];_0x2708ed[_0x1a64aa(0x11d)]&&Array['isArray'](_0x2708ed[_0x1a64aa(0x11d)])&&_0x2708ed[_0x1a64aa(0x11d)][_0x1a64aa(0x120)]((_0x3f93a5,_0x553367)=>{const _0x4d6c18=_0x1a64aa;if(!_0x3f93a5[_0x4d6c18(0x157)])throw new Error('realtime.events['+_0x553367+_0x4d6c18(0x127));});_0x2708ed['attributes']&&Array[_0x1a64aa(0x14a)](_0x2708ed[_0x1a64aa(0x14c)])&&_0x2708ed['attributes'][_0x1a64aa(0x120)]((_0x13ae7c,_0x2d9ea2)=>{const _0x5bd062=_0x1a64aa;if(!_0x13ae7c[_0x5bd062(0x157)])throw new Error(_0x5bd062(0x14f)+_0x2d9ea2+_0x5bd062(0x127));if(_0x13ae7c[_0x5bd062(0x14b)]&&!_0x4e7a14[_0x5bd062(0x14e)](_0x13ae7c['type']))throw new Error(_0x5bd062(0x14f)+_0x2d9ea2+_0x5bd062(0x126)+_0x13ae7c['name']+_0x5bd062(0x145)+_0x13ae7c[_0x5bd062(0x14b)]+_0x5bd062(0x128)+_0x4e7a14[_0x5bd062(0x132)](',\x20'));});if(_0x2708ed[_0x1a64aa(0xf6)]){if(!_0x2708ed[_0x1a64aa(0xf6)][_0x1a64aa(0x124)])throw new Error(_0x1a64aa(0x13e));}}function validatePersonalizationServices(_0x4083fa){const _0x3b332b=a149_0x1618;if(!Array[_0x3b332b(0x14a)](_0x4083fa))throw new Error(_0x3b332b(0xf0));_0x4083fa['forEach']((_0x2d37a5,_0x192ec5)=>{const _0x4270c9=_0x3b332b;if(!_0x2d37a5['name'])throw new Error('personalization_services['+_0x192ec5+_0x4270c9(0x127));});}export function generateTemplate(_0x2c7084,_0x49baf4,_0x5a800e){const _0x546957=a149_0x1618,_0x2d8a45={'name':_0x2c7084,'description':_0x546957(0x13f),'master':{'database':_0x49baf4,'table':_0x5a800e},'schedule':{'type':'daily','time':_0x546957(0x111),'timezone':_0x546957(0x112)},'attributes':[{'name':'Example\x20Attributes','source':{'database':_0x49baf4,'table':_0x546957(0xf9)},'join':{'parent_key':'id','child_key':_0x546957(0x156)},'columns':[{'column':_0x546957(0x119),'label':_0x546957(0x148),'type':'string'}]}],'behaviors':[{'name':_0x546957(0x101),'source':{'database':_0x49baf4,'table':'events_table'},'join':{'parent_key':'user_id','child_key':'customer_id'},'all_columns':!![]}]};return serializeDef(_0x2d8a45);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x25cd2b,_0x1d6af7){const _0x3f2de9=a150_0x5815,_0x927abb=_0x25cd2b();while(!![]){try{const _0x19357c=-parseInt(_0x3f2de9(0xd1))/0x1*(parseInt(_0x3f2de9(0xcf))/0x2)+-parseInt(_0x3f2de9(0xb3))/0x3*(parseInt(_0x3f2de9(0xdb))/0x4)+parseInt(_0x3f2de9(0xcc))/0x5+parseInt(_0x3f2de9(0xbd))/0x6+parseInt(_0x3f2de9(0xe9))/0x7*(parseInt(_0x3f2de9(0xcd))/0x8)+-parseInt(_0x3f2de9(0xe6))/0x9+parseInt(_0x3f2de9(0xd2))/0xa*(-parseInt(_0x3f2de9(0xe4))/0xb);if(_0x19357c===_0x1d6af7)break;else _0x927abb['push'](_0x927abb['shift']());}catch(_0x46d2ab){_0x927abb['push'](_0x927abb['shift']());}}}(a150_0x3e28,0x3c814));import a150_0x1978c7 from'path';import{existsSync,readFileSync}from'fs';function a150_0x5815(_0xa5faf8,_0x500b75){_0xa5faf8=_0xa5faf8-0xb0;const _0x3e285c=a150_0x3e28();let _0x5815f9=_0x3e285c[_0xa5faf8];return _0x5815f9;}import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a150_0x3e28(){const _0x37f855=['get','559108PTdplQ','all','3259791UEwUgZ','description','push','889DKuDBF','folderId','from','Processing\x20journeys','journeyBundleName','Fetching\x20parent\x20segment\x20info','add','values','listFolders','length','Warning:\x20Journey\x20','paused','buildIdToEmailMap','segment','getJourney','Resolving\x20parent\x20segment','set','reduce','1085697ahHsqt','name','getLatestJourneyId','isNew','audienceId','createdAt','.yml','listSegments','join','kind','1563924UGjVsq','getActivation','getParent','filter','rule','resolveParentId','state','targetResourceName','segmentFolderId','toLowerCase','hasChanges','buildIdToNameMap','update','listActivations','journey','2008775uhLdTJ','24496CnwVFx','Processing\x20segments','57058wrzNpT','user','1qZRXcf','10XhajmX','utf-8','size','versionNumber','clear','sort','slice','listJourneysWithDetailsFromParentSegment','getSegment','4EdOKwH','connection','tdx.json','attributes','journeyBundleId','segments/','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','map'];a150_0x3e28=function(){return _0x37f855;};return a150_0x3e28();}import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a150_0x2956e0,normalizeJourneyDef,parseYamlString as a150_0x9fcda2}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x128d09,_0x8efb4e,_0x188215){const _0x463e1c=a150_0x1978c7['relative'](_0x188215,_0x128d09);if(existsSync(_0x128d09)){const _0x15ee4c=readFileSync(_0x128d09,'utf-8'),_0x2bce6e=generateDiff(_0x15ee4c,_0x8efb4e),_0x4c8770=hasChanges(_0x2bce6e);return{'relativePath':_0x463e1c,'absolutePath':_0x128d09,'content':_0x8efb4e,'isNew':![],'hasChanges':_0x4c8770,'diff':_0x4c8770?formatDiffWithColors(_0x2bce6e):undefined};}return{'relativePath':_0x463e1c,'absolutePath':_0x128d09,'content':_0x8efb4e,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x2d714b,_0x5a9f5c,_0x274ad6){const _0x1a9f98=a150_0x5815,_0x8ecc90=_0x2d714b+':'+_0x5a9f5c,_0x597917=_0x274ad6[_0x1a9f98(0xe3)](_0x8ecc90)||0x0;_0x274ad6['set'](_0x8ecc90,_0x597917+0x1);if(_0x597917===0x0)return _0x5a9f5c;return _0x5a9f5c+'_'+(_0x597917+0x1);}export async function pullSegments(_0xfbb5ef,_0x55ba30,_0x29a1e6={}){const _0x5ebfc3=a150_0x5815,{targetDir:_0x47e7b8,progress:_0x4879e4}=_0x29a1e6;_0x4879e4?.[_0x5ebfc3(0xc9)](_0x5ebfc3(0xb0));const _0x3b323f=await _0xfbb5ef[_0x5ebfc3(0xf6)][_0x5ebfc3(0xc2)](_0x55ba30);_0x4879e4?.[_0x5ebfc3(0xc9)](_0x5ebfc3(0xee));const _0x25c266=await _0xfbb5ef[_0x5ebfc3(0xf6)][_0x5ebfc3(0xbf)](_0x3b323f),_0x50d4a8=_0x25c266['attributes'][_0x5ebfc3(0xb4)];_0x4879e4?.['update']('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0xa839ad,_0xcfcb39,_0xaf8ad2]=await Promise[_0x5ebfc3(0xe5)]([_0xfbb5ef[_0x5ebfc3(0xf6)][_0x5ebfc3(0xba)](_0x3b323f),_0xfbb5ef['segment'][_0x5ebfc3(0xf1)](_0x3b323f),_0xfbb5ef[_0x5ebfc3(0xcb)][_0x5ebfc3(0xd9)](_0x3b323f,{'includeAllVersions':!![]})]),{journeys:_0x5a1ab9,activationStepsById:_0x4d1fc9}=_0xaf8ad2,_0x57fca6=new Map();for(const _0x2927cb of _0x5a1ab9){_0x57fca6[_0x5ebfc3(0xb1)](_0x2927cb['id'],_0x2927cb);}const _0x5acb42=_0x5a1ab9[_0x5ebfc3(0xe2)](_0x22a876=>({'id':_0x22a876['id'],'name':_0x22a876[_0x5ebfc3(0xde)][_0x5ebfc3(0xb4)],'journeyBundleName':_0x22a876['attributes']['journeyBundleName']||'','journeyBundleId':_0x22a876[_0x5ebfc3(0xde)][_0x5ebfc3(0xdf)]||'','versionNumber':_0x22a876['attributes'][_0x5ebfc3(0xd5)],'description':_0x22a876[_0x5ebfc3(0xde)][_0x5ebfc3(0xe7)],'state':_0x22a876[_0x5ebfc3(0xde)][_0x5ebfc3(0xc3)],'paused':_0x22a876['attributes'][_0x5ebfc3(0xf4)],'audienceId':_0x22a876[_0x5ebfc3(0xde)][_0x5ebfc3(0xb7)],'folderId':_0x22a876['relationships']?.['parentFolder']?.['data']?.['id'],'createdAt':_0x22a876['attributes'][_0x5ebfc3(0xb8)],'updatedAt':_0x22a876[_0x5ebfc3(0xde)]['updatedAt']})),_0x1ef7cc=buildFolderIdToPathMap(_0xcfcb39),_0x46ae1f=_0x47e7b8||_0x5ebfc3(0xe0)+sanitizeFileName(_0x50d4a8);_0x4879e4?.[_0x5ebfc3(0xc9)]('Fetching\x20activations');const _0x79c651=new Map();await batchAsync(_0xa839ad,async _0x3d7573=>{const _0x498717=_0x5ebfc3,_0x2fcdbb=await _0xfbb5ef[_0x498717(0xf6)][_0x498717(0xca)](_0x3b323f,_0x3d7573['id']);_0x79c651[_0x498717(0xb1)](_0x3d7573['id'],_0x2fcdbb);}),_0x4879e4?.['update']('Fetching\x20users\x20and\x20connections');const [_0x5dae3e,_0x197305]=await Promise['all']([_0xfbb5ef[_0x5ebfc3(0xd0)][_0x5ebfc3(0xf5)](),_0xfbb5ef[_0x5ebfc3(0xdc)][_0x5ebfc3(0xc8)]()]),_0x4936d5=[],_0x2eb50b=new Map(),_0xf29371=a150_0x1978c7[_0x5ebfc3(0xbb)](_0x46ae1f,_0x5ebfc3(0xdd)),_0x48761a=createTdxConfigContent(_0x50d4a8);_0x4936d5[_0x5ebfc3(0xe8)](prepareFile(_0xf29371,_0x48761a,_0x46ae1f));const _0x19c1a1=new Map();for(const _0x97aafc of _0xa839ad){_0x19c1a1['set'](_0x97aafc['id'],_0x97aafc);}let _0x1e337e=_0xa839ad;if(_0x29a1e6['targetResourceName']){const _0x42767c=_0xa839ad[_0x5ebfc3(0xc0)](_0x2f1df0=>_0x2f1df0[_0x5ebfc3(0xb4)][_0x5ebfc3(0xc6)]()===_0x29a1e6[_0x5ebfc3(0xc4)]['toLowerCase']());_0x42767c[_0x5ebfc3(0xf2)]>0x0&&(_0x1e337e=_0x42767c);}_0x4879e4?.[_0x5ebfc3(0xc9)](_0x5ebfc3(0xce));for(const _0x5d3815 of _0x1e337e){if(_0x5d3815[_0x5ebfc3(0xbc)]===SEGMENT_KIND_JOURNEY)continue;const _0x4e89ae=_0x5d3815[_0x5ebfc3(0xc5)]?_0x1ef7cc['get'](_0x5d3815[_0x5ebfc3(0xc5)])||'':'',_0x13dbe1=_0x79c651[_0x5ebfc3(0xe3)](_0x5d3815['id'])||[],_0x11d744=segmentWithActivationsToYaml(_0x5d3815,_0x13dbe1,undefined,_0x5dae3e,_0x197305),_0x2f5699=_0x4e89ae?a150_0x1978c7[_0x5ebfc3(0xbb)](_0x46ae1f,_0x4e89ae):_0x46ae1f,_0x3410cd=sanitizeFileName(_0x5d3815['name']),_0x25bbcf=getUniqueFileName(_0x2f5699,_0x3410cd,_0x2eb50b),_0x505f66=a150_0x1978c7['join'](_0x2f5699,_0x25bbcf+_0x5ebfc3(0xb9)),_0x27aa94=segmentToYamlString(_0x11d744);_0x4936d5[_0x5ebfc3(0xe8)](prepareFile(_0x505f66,_0x27aa94,_0x46ae1f));}const _0x27fe45=new Map();for(const _0x16ede9 of _0x5acb42){const _0x47de98=_0x16ede9[_0x5ebfc3(0xdf)];!_0x27fe45['has'](_0x47de98)&&_0x27fe45[_0x5ebfc3(0xb1)](_0x47de98,[]),_0x27fe45[_0x5ebfc3(0xe3)](_0x47de98)[_0x5ebfc3(0xe8)](_0x16ede9);}for(const _0x2ea995 of _0x27fe45[_0x5ebfc3(0xf0)]()){_0x2ea995[_0x5ebfc3(0xd7)]((_0x3982eb,_0x4d0c95)=>(_0x3982eb[_0x5ebfc3(0xd5)]||0x0)-(_0x4d0c95[_0x5ebfc3(0xd5)]||0x0));}if(_0x29a1e6[_0x5ebfc3(0xc4)]){const _0x1757e1=new Map();for(const [_0xb4751f,_0x4eb835]of _0x27fe45){const _0x22c09c=_0x4eb835[0x0][_0x5ebfc3(0xed)];if(_0x22c09c[_0x5ebfc3(0xc6)]()===_0x29a1e6[_0x5ebfc3(0xc4)][_0x5ebfc3(0xc6)]()){_0x1757e1[_0x5ebfc3(0xb1)](_0xb4751f,_0x4eb835);break;}}_0x27fe45[_0x5ebfc3(0xd6)]();for(const [_0x4246c9,_0x3593db]of _0x1757e1){_0x27fe45[_0x5ebfc3(0xb1)](_0x4246c9,_0x3593db);}}if(_0x27fe45[_0x5ebfc3(0xd4)]>0x0){_0x4879e4?.[_0x5ebfc3(0xc9)](_0x5ebfc3(0xec));const _0x59ebd8=Array[_0x5ebfc3(0xeb)](_0x27fe45['values']()),_0x49aa0a=0x5,{createYamlContext:_0x16e173}=createYamlContextForBundle(_0xfbb5ef,_0x19c1a1,_0x5dae3e,_0x197305,_0x4d1fc9,_0x57fca6);for(let _0x5097fd=0x0;_0x5097fd<_0x59ebd8[_0x5ebfc3(0xf2)];_0x5097fd+=_0x49aa0a){const _0x4e033b=_0x59ebd8[_0x5ebfc3(0xd8)](_0x5097fd,_0x5097fd+_0x49aa0a),_0xa1aab5=await Promise[_0x5ebfc3(0xe5)](_0x4e033b['map'](async _0x9062e=>{const _0x276c82=_0x5ebfc3,_0x4f84c1=_0x9062e[0x0],_0x4d02b6=_0x4f84c1['journeyBundleName'];_0x4879e4?.['update']('Processing\x20journey:\x20'+_0x4d02b6);const _0xd17ac8=_0x4f84c1[_0x276c82(0xea)]?_0x1ef7cc['get'](_0x4f84c1['folderId'])||'':'',_0x4fe098=_0xd17ac8?a150_0x1978c7[_0x276c82(0xbb)](_0x46ae1f,_0xd17ac8):_0x46ae1f,_0x551e4f=sanitizeFileName(_0x4d02b6),_0x1d16e1=a150_0x1978c7[_0x276c82(0xbb)](_0x4fe098,_0x551e4f+_0x276c82(0xb9));let _0x2ad99b;if(existsSync(_0x1d16e1))try{const _0x488c31=readFileSync(_0x1d16e1,_0x276c82(0xd3)),_0x98c380=a150_0x9fcda2(_0x488c31);_0x2ad99b=buildLocalRuleToNameMappingFromJourney(_0x98c380);}catch{}const _0x5873c0=[];for(const _0xb32361 of _0x9062e){const _0x6d9c6=_0x57fca6[_0x276c82(0xe3)](_0xb32361['id']);if(!_0x6d9c6){_0x4879e4?.[_0x276c82(0xc9)](_0x276c82(0xf3)+_0xb32361['id']+_0x276c82(0xe1));continue;}const _0x4d03fd=_0x6d9c6['attributes']?.[_0x276c82(0xb7)],_0x341364=_0x16e173(_0xb32361['id'],_0x4d03fd),_0x39cf8d=await journeyResponseToDef(_0x6d9c6,_0x341364);_0x5873c0[_0x276c82(0xe8)]({'item':_0xb32361,'yaml':_0x39cf8d});}const _0x3bdca3=await _0xfbb5ef['journey'][_0x276c82(0xb5)](_0x4f84c1['journeyBundleId']),_0xa355e9=buildMergedJourneyDef(_0x5873c0,_0x2ad99b,_0x3bdca3);return{'bundleName':_0x4d02b6,'folderPath':_0xd17ac8,'finalYaml':_0xa355e9};}));for(const {bundleName:_0x3d759d,folderPath:_0x473f61,finalYaml:_0x2df3f1}of _0xa1aab5){const _0x3071a7=normalizeJourneyDef(_0x2df3f1),_0x16382d=a150_0x2956e0(_0x3071a7),_0xb71925=_0x473f61?a150_0x1978c7['join'](_0x46ae1f,_0x473f61):_0x46ae1f,_0x36c183=sanitizeFileName(_0x3d759d),_0x51a4e6=getUniqueFileName(_0xb71925,_0x36c183,_0x2eb50b),_0x16c0d7=a150_0x1978c7[_0x5ebfc3(0xbb)](_0xb71925,_0x51a4e6+'.yml');_0x4936d5[_0x5ebfc3(0xe8)](prepareFile(_0x16c0d7,_0x16382d,_0x46ae1f));}}}const _0x37f4ee=Array[_0x5ebfc3(0xeb)](_0x79c651[_0x5ebfc3(0xf0)]())['reduce']((_0x3116de,_0x1a10af)=>_0x3116de+_0x1a10af[_0x5ebfc3(0xf2)],0x0),_0x25fec9=_0x1e337e[_0x5ebfc3(0xc0)](_0x1ad7f1=>_0x1ad7f1[_0x5ebfc3(0xbc)]!==SEGMENT_KIND_JOURNEY),_0x1cdca9=_0x4936d5[_0x5ebfc3(0xc0)](_0x5195da=>_0x5195da[_0x5ebfc3(0xb6)])[_0x5ebfc3(0xf2)],_0x3eaf14=_0x4936d5['filter'](_0xd1c7cf=>!_0xd1c7cf['isNew']&&_0xd1c7cf[_0x5ebfc3(0xc7)])[_0x5ebfc3(0xf2)],_0x136c00=_0x4936d5[_0x5ebfc3(0xc0)](_0x492146=>!_0x492146[_0x5ebfc3(0xb6)]&&!_0x492146['hasChanges'])[_0x5ebfc3(0xf2)],_0x55132e=Array['from'](_0x27fe45[_0x5ebfc3(0xf0)]())[_0x5ebfc3(0xb2)]((_0x13ef63,_0x34991a)=>_0x13ef63+_0x34991a[_0x5ebfc3(0xf2)],0x0);return{'parentName':_0x50d4a8,'parentId':_0x3b323f,'targetDir':_0x46ae1f,'files':_0x4936d5,'counts':{'segments':_0x25fec9[_0x5ebfc3(0xf2)],'journeys':_0x27fe45['size'],'journeyVersions':_0x55132e,'activations':_0x37f4ee},'newFiles':_0x1cdca9,'changedFiles':_0x3eaf14,'unchangedFiles':_0x136c00};}function createYamlContextForBundle(_0x3be487,_0x2f2864,_0x2f313a,_0x5538a4,_0x3c313f,_0x150d37){const _0x248bb8=new Set(),_0x2f794c=new Map(),_0x120e6d=new Map(),_0x5d272b=createJumpTargetCache(),_0x57f9a8=async(_0x37594c,_0xd22161)=>{const _0x4e6b36=a150_0x5815,_0x3b49d2=_0x2f794c[_0x4e6b36(0xe3)](_0x37594c);if(_0x3b49d2!==undefined)return _0x3b49d2;if(!_0xd22161)return _0x37594c;try{let _0x3fd709=_0x2f2864[_0x4e6b36(0xe3)](_0x37594c);!_0x3fd709&&(_0x3fd709=await _0x3be487[_0x4e6b36(0xf6)]['getSegment'](_0xd22161,_0x37594c),_0x2f2864[_0x4e6b36(0xb1)](_0x37594c,_0x3fd709));const _0x3b8075=generateJourneyLocalName(_0x3fd709[_0x4e6b36(0xb4)]),_0x2ae977=_0x3fd709[_0x4e6b36(0xbc)]===SEGMENT_KIND_JOURNEY&&_0x3b8075!==undefined;if(_0x2ae977&&_0x3b8075){let _0x1cd01d=_0x3b8075,_0x3cc78e=0x2;while(_0x248bb8['has'](_0x1cd01d)){_0x1cd01d=_0x3b8075+'_'+_0x3cc78e,_0x3cc78e++;}return _0x248bb8[_0x4e6b36(0xef)](_0x1cd01d),_0x2f794c[_0x4e6b36(0xb1)](_0x37594c,_0x1cd01d),_0x1cd01d;}return _0x3fd709[_0x4e6b36(0xb4)];}catch{return _0x37594c;}},_0x403dd3=(_0x1b4d9b,_0xd70d0e)=>({'resolveSegment':async _0xfe9266=>{const _0x24c7d8=a150_0x5815,_0x352a3f=_0x2f794c[_0x24c7d8(0xe3)](_0xfe9266);if(_0x352a3f!==undefined)return{'name':_0x352a3f,'isJourneyLocal':!![]};if(!_0xd70d0e)return{'name':_0xfe9266,'isJourneyLocal':![]};try{let _0x3c5102=_0x2f2864['get'](_0xfe9266);!_0x3c5102&&(_0x3c5102=await _0x3be487[_0x24c7d8(0xf6)][_0x24c7d8(0xda)](_0xd70d0e,_0xfe9266),_0x2f2864[_0x24c7d8(0xb1)](_0xfe9266,_0x3c5102));const _0x2d0fe4=generateJourneyLocalName(_0x3c5102['name']),_0x1dfedc=_0x3c5102['kind']===SEGMENT_KIND_JOURNEY&&_0x2d0fe4!==undefined;if(_0x1dfedc&&!_0x3c5102[_0x24c7d8(0xc1)]&&_0xd70d0e)try{const _0x2aea02=await _0x3be487[_0x24c7d8(0xf6)][_0x24c7d8(0xda)](_0xd70d0e,_0xfe9266);_0x2f2864[_0x24c7d8(0xb1)](_0xfe9266,_0x2aea02),_0x3c5102=_0x2aea02;}catch{}const _0x2dfc0c=await _0x57f9a8(_0xfe9266,_0xd70d0e);let _0x57f90c;if(_0x1dfedc&&_0x3c5102['rule']){const _0x4f1e49=await segmentResponseToDef(_0x3c5102,{'resolveSegmentName':_0x35b50e=>_0x57f9a8(_0x35b50e,_0xd70d0e)});_0x57f90c={'description':_0x3c5102[_0x24c7d8(0xe7)],'rule':_0x4f1e49[_0x24c7d8(0xc1)]};}return{'name':_0x2dfc0c,'isJourneyLocal':_0x1dfedc,'definition':_0x57f90c};}catch{return{'name':_0xfe9266,'isJourneyLocal':![]};}},'resolveActivation':async _0x59108f=>{const _0x20b8b1=a150_0x5815,_0xcf7dbd=_0x120e6d['get'](_0x59108f);if(_0xcf7dbd!==undefined)return{'name':_0xcf7dbd,'isJourneyLocal':!![]};try{let _0xaa187d=_0x3c313f[_0x20b8b1(0xe3)](_0x59108f);!_0xaa187d&&(_0xaa187d=await _0x3be487[_0x20b8b1(0xcb)][_0x20b8b1(0xbe)](_0x1b4d9b,_0x59108f));const _0x563c2b=_0xaa187d[_0x20b8b1(0xde)]['activationParams'][_0x20b8b1(0xb4)]||_0x59108f,_0x2736ad=sanitizeYamlKey(_0x563c2b)||'activation_'+_0x59108f,_0x134fbc=_0x2736ad;_0x120e6d[_0x20b8b1(0xb1)](_0x59108f,_0x134fbc);const _0x167d8b=journeyActivationStepToYaml(_0xaa187d,_0x2f313a,_0x5538a4);return{'name':_0x134fbc,'isJourneyLocal':!![],'definition':_0x167d8b};}catch{return{'name':_0x59108f,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xd60db8,_0x152b4b)=>resolveJumpTarget(_0xd60db8,_0x152b4b,_0x5d272b,async _0x27041a=>{const _0x4e0fa7=a150_0x5815,_0x1421e4=_0x150d37['get'](_0x27041a);if(_0x1421e4)return _0x1421e4;return _0x3be487[_0x4e0fa7(0xcb)][_0x4e0fa7(0xf7)](_0x27041a);})});return{'createYamlContext':_0x403dd3};}
|
|
1
|
+
(function(_0xe8dc7d,_0xe92b8f){const _0x2c8f07=a150_0x4c53,_0x27d80e=_0xe8dc7d();while(!![]){try{const _0x5d04dd=parseInt(_0x2c8f07(0xc9))/0x1*(parseInt(_0x2c8f07(0xce))/0x2)+-parseInt(_0x2c8f07(0x9f))/0x3*(-parseInt(_0x2c8f07(0xc1))/0x4)+-parseInt(_0x2c8f07(0xe8))/0x5*(-parseInt(_0x2c8f07(0xeb))/0x6)+parseInt(_0x2c8f07(0xc4))/0x7+-parseInt(_0x2c8f07(0xdc))/0x8+-parseInt(_0x2c8f07(0xe5))/0x9*(-parseInt(_0x2c8f07(0xbe))/0xa)+parseInt(_0x2c8f07(0xcb))/0xb*(-parseInt(_0x2c8f07(0xe0))/0xc);if(_0x5d04dd===_0xe92b8f)break;else _0x27d80e['push'](_0x27d80e['shift']());}catch(_0x3deb45){_0x27d80e['push'](_0x27d80e['shift']());}}}(a150_0x329d,0x815bd));import a150_0x4a1493 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';function a150_0x4c53(_0x4caff7,_0xd77f0e){_0x4caff7=_0x4caff7-0x9e;const _0x329d13=a150_0x329d();let _0x4c5368=_0x329d13[_0x4caff7];return _0x4c5368;}import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a150_0x41fdfd,normalizeJourneyDef,parseYamlString as a150_0x31f8e8}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';function a150_0x329d(){const _0x2c5d1f=['user','parentFolder','state','reduce','join','targetResourceName','4910MGyTOH','connection','attributes','3423084JVvvdd','segment','kind','254506uKdRTS','getLatestJourneyId','relationships','map','listActivations','115429pQDEPX','utf-8','11KPfMlE','rule','activation_','14GYLDyH','has','clear','Processing\x20journey:\x20','Processing\x20journeys','Warning:\x20Journey\x20','slice','getParent','segments/','buildIdToEmailMap','buildIdToNameMap','values','get','push','3091552UmSgPG','activationParams','filter','length','21379356tOsaxP','Fetching\x20segments,\x20folders,\x20and\x20journeys','add','data','from','2214qvTrre','description','getSegment','1420JoaLlA','tdx.json','versionNumber','18528oioyqC','listFolders','3rUxJBy','set','.yml','relative','Resolving\x20parent\x20segment','all','name','folderId','update','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','journey','size','journeyBundleName','audienceId','createdAt','journeyBundleId','segmentFolderId','toLowerCase','getJourney','getActivation','hasChanges','Fetching\x20activations','Fetching\x20parent\x20segment\x20info','isNew','listSegments'];a150_0x329d=function(){return _0x2c5d1f;};return a150_0x329d();}import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x28d2e0,_0xfe4ca5,_0x3169f9){const _0x2fbe01=a150_0x4c53,_0x59349e=a150_0x4a1493[_0x2fbe01(0xa2)](_0x3169f9,_0x28d2e0);if(existsSync(_0x28d2e0)){const _0x17a700=readFileSync(_0x28d2e0,_0x2fbe01(0xca)),_0x4f0b8f=generateDiff(_0x17a700,_0xfe4ca5),_0x8d80d4=hasChanges(_0x4f0b8f);return{'relativePath':_0x59349e,'absolutePath':_0x28d2e0,'content':_0xfe4ca5,'isNew':![],'hasChanges':_0x8d80d4,'diff':_0x8d80d4?formatDiffWithColors(_0x4f0b8f):undefined};}return{'relativePath':_0x59349e,'absolutePath':_0x28d2e0,'content':_0xfe4ca5,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0xb7087a,_0x48e2a6,_0x263a4c){const _0x58e8c6=_0xb7087a+':'+_0x48e2a6,_0x5c7dcf=_0x263a4c['get'](_0x58e8c6)||0x0;_0x263a4c['set'](_0x58e8c6,_0x5c7dcf+0x1);if(_0x5c7dcf===0x0)return _0x48e2a6;return _0x48e2a6+'_'+(_0x5c7dcf+0x1);}export async function pullSegments(_0x36d70a,_0x41c4d2,_0x159e10={}){const _0x18017b=a150_0x4c53,{targetDir:_0x125004,progress:_0x8b8efc}=_0x159e10;_0x8b8efc?.[_0x18017b(0xa7)](_0x18017b(0xa3));const _0x49a2e8=await _0x36d70a[_0x18017b(0xc2)]['resolveParentId'](_0x41c4d2);_0x8b8efc?.[_0x18017b(0xa7)](_0x18017b(0xb5));const _0x35dda9=await _0x36d70a[_0x18017b(0xc2)][_0x18017b(0xd5)](_0x49a2e8),_0x2608a4=_0x35dda9[_0x18017b(0xc0)][_0x18017b(0xa5)];_0x8b8efc?.[_0x18017b(0xa7)](_0x18017b(0xe1));const [_0x25c79e,_0x5b291c,_0x498eee]=await Promise[_0x18017b(0xa4)]([_0x36d70a[_0x18017b(0xc2)][_0x18017b(0xb7)](_0x49a2e8),_0x36d70a[_0x18017b(0xc2)][_0x18017b(0x9e)](_0x49a2e8),_0x36d70a[_0x18017b(0xa9)]['listJourneysWithDetailsFromParentSegment'](_0x49a2e8,{'includeAllVersions':!![]})]),{journeys:_0x16ef17,activationStepsById:_0x225c1e}=_0x498eee,_0x21d5bd=new Map();for(const _0x2a24cf of _0x16ef17){_0x21d5bd[_0x18017b(0xa0)](_0x2a24cf['id'],_0x2a24cf);}const _0x14992b=_0x16ef17[_0x18017b(0xc7)](_0xc78e33=>({'id':_0xc78e33['id'],'name':_0xc78e33[_0x18017b(0xc0)][_0x18017b(0xa5)],'journeyBundleName':_0xc78e33[_0x18017b(0xc0)]['journeyBundleName']||'','journeyBundleId':_0xc78e33['attributes']['journeyBundleId']||'','versionNumber':_0xc78e33[_0x18017b(0xc0)]['versionNumber'],'description':_0xc78e33[_0x18017b(0xc0)]['description'],'state':_0xc78e33[_0x18017b(0xc0)][_0x18017b(0xba)],'paused':_0xc78e33[_0x18017b(0xc0)]['paused'],'audienceId':_0xc78e33[_0x18017b(0xc0)][_0x18017b(0xac)],'folderId':_0xc78e33[_0x18017b(0xc6)]?.[_0x18017b(0xb9)]?.[_0x18017b(0xe3)]?.['id'],'createdAt':_0xc78e33[_0x18017b(0xc0)][_0x18017b(0xad)],'updatedAt':_0xc78e33['attributes']['updatedAt']})),_0x52bc62=buildFolderIdToPathMap(_0x5b291c),_0x582a93=_0x125004||_0x18017b(0xd6)+sanitizeFileName(_0x2608a4);_0x8b8efc?.[_0x18017b(0xa7)](_0x18017b(0xb4));const _0x3345be=new Map();await batchAsync(_0x25c79e,async _0x558f52=>{const _0x3fc1e5=_0x18017b,_0x47eef8=await _0x36d70a[_0x3fc1e5(0xc2)][_0x3fc1e5(0xc8)](_0x49a2e8,_0x558f52['id']);_0x3345be[_0x3fc1e5(0xa0)](_0x558f52['id'],_0x47eef8);}),_0x8b8efc?.[_0x18017b(0xa7)]('Fetching\x20users\x20and\x20connections');const [_0x1130d3,_0x4c1ede]=await Promise['all']([_0x36d70a[_0x18017b(0xb8)][_0x18017b(0xd7)](),_0x36d70a[_0x18017b(0xbf)][_0x18017b(0xd8)]()]),_0x371fc1=[],_0x28f764=new Map(),_0x229f6e=a150_0x4a1493['join'](_0x582a93,_0x18017b(0xe9)),_0x4fbc14=createTdxConfigContent(_0x2608a4);_0x371fc1[_0x18017b(0xdb)](prepareFile(_0x229f6e,_0x4fbc14,_0x582a93));const _0x245ab7=new Map();for(const _0x11a488 of _0x25c79e){_0x245ab7[_0x18017b(0xa0)](_0x11a488['id'],_0x11a488);}let _0x171606=_0x25c79e;if(_0x159e10['targetResourceName']){const _0x434eef=_0x25c79e[_0x18017b(0xde)](_0x394800=>_0x394800[_0x18017b(0xa5)][_0x18017b(0xb0)]()===_0x159e10[_0x18017b(0xbd)][_0x18017b(0xb0)]());_0x434eef[_0x18017b(0xdf)]>0x0&&(_0x171606=_0x434eef);}_0x8b8efc?.[_0x18017b(0xa7)]('Processing\x20segments');for(const _0x526b66 of _0x171606){if(_0x526b66['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x5a6f77=_0x526b66[_0x18017b(0xaf)]?_0x52bc62[_0x18017b(0xda)](_0x526b66[_0x18017b(0xaf)])||'':'',_0x3ddb79=_0x3345be[_0x18017b(0xda)](_0x526b66['id'])||[],_0x170d85=segmentWithActivationsToYaml(_0x526b66,_0x3ddb79,undefined,_0x1130d3,_0x4c1ede),_0x4eadff=_0x5a6f77?a150_0x4a1493['join'](_0x582a93,_0x5a6f77):_0x582a93,_0x1f0086=sanitizeFileName(_0x526b66[_0x18017b(0xa5)]),_0x5de712=getUniqueFileName(_0x4eadff,_0x1f0086,_0x28f764),_0x6ac0e0=a150_0x4a1493[_0x18017b(0xbc)](_0x4eadff,_0x5de712+_0x18017b(0xa1)),_0x154882=segmentToYamlString(_0x170d85);_0x371fc1[_0x18017b(0xdb)](prepareFile(_0x6ac0e0,_0x154882,_0x582a93));}const _0x2f0e26=new Map();for(const _0x2f94e1 of _0x14992b){const _0x4f15fe=_0x2f94e1[_0x18017b(0xae)];!_0x2f0e26[_0x18017b(0xcf)](_0x4f15fe)&&_0x2f0e26['set'](_0x4f15fe,[]),_0x2f0e26['get'](_0x4f15fe)['push'](_0x2f94e1);}for(const _0x50d5e9 of _0x2f0e26[_0x18017b(0xd9)]()){_0x50d5e9['sort']((_0x3fe92e,_0x5b9daa)=>(_0x3fe92e[_0x18017b(0xea)]||0x0)-(_0x5b9daa[_0x18017b(0xea)]||0x0));}if(_0x159e10['targetResourceName']){const _0x209f15=new Map();for(const [_0x24cfe9,_0x3b3ccd]of _0x2f0e26){const _0x2bcc4e=_0x3b3ccd[0x0][_0x18017b(0xab)];if(_0x2bcc4e['toLowerCase']()===_0x159e10[_0x18017b(0xbd)][_0x18017b(0xb0)]()){_0x209f15[_0x18017b(0xa0)](_0x24cfe9,_0x3b3ccd);break;}}_0x2f0e26[_0x18017b(0xd0)]();for(const [_0x4aa66f,_0x621924]of _0x209f15){_0x2f0e26[_0x18017b(0xa0)](_0x4aa66f,_0x621924);}}if(_0x2f0e26['size']>0x0){_0x8b8efc?.[_0x18017b(0xa7)](_0x18017b(0xd2));const _0x5a7166=Array['from'](_0x2f0e26[_0x18017b(0xd9)]()),_0x32dbc1=0x5,{createYamlContext:_0x204d73}=createYamlContextForBundle(_0x36d70a,_0x245ab7,_0x1130d3,_0x4c1ede,_0x225c1e,_0x21d5bd);for(let _0x2672c2=0x0;_0x2672c2<_0x5a7166[_0x18017b(0xdf)];_0x2672c2+=_0x32dbc1){const _0x174257=_0x5a7166[_0x18017b(0xd4)](_0x2672c2,_0x2672c2+_0x32dbc1),_0x2d4d37=await Promise[_0x18017b(0xa4)](_0x174257[_0x18017b(0xc7)](async _0x271280=>{const _0x78edc9=_0x18017b,_0x59602a=_0x271280[0x0],_0x1ec257=_0x59602a[_0x78edc9(0xab)];_0x8b8efc?.['update'](_0x78edc9(0xd1)+_0x1ec257);const _0x396c25=_0x59602a['folderId']?_0x52bc62[_0x78edc9(0xda)](_0x59602a[_0x78edc9(0xa6)])||'':'',_0x469f27=_0x396c25?a150_0x4a1493[_0x78edc9(0xbc)](_0x582a93,_0x396c25):_0x582a93,_0x1aee77=sanitizeFileName(_0x1ec257),_0x5e4f74=a150_0x4a1493[_0x78edc9(0xbc)](_0x469f27,_0x1aee77+_0x78edc9(0xa1));let _0x2a47e1;if(existsSync(_0x5e4f74))try{const _0xfc9a0f=readFileSync(_0x5e4f74,'utf-8'),_0x1ae3e0=a150_0x31f8e8(_0xfc9a0f);_0x2a47e1=buildLocalRuleToNameMappingFromJourney(_0x1ae3e0);}catch{}const _0x4e6820=[];for(const _0x2b8579 of _0x271280){const _0x316f6e=_0x21d5bd[_0x78edc9(0xda)](_0x2b8579['id']);if(!_0x316f6e){_0x8b8efc?.[_0x78edc9(0xa7)](_0x78edc9(0xd3)+_0x2b8579['id']+_0x78edc9(0xa8));continue;}const _0x2efbc0=_0x316f6e[_0x78edc9(0xc0)]?.['audienceId'],_0x128c60=_0x204d73(_0x2b8579['id'],_0x2efbc0),_0x113611=await journeyResponseToDef(_0x316f6e,_0x128c60);_0x4e6820[_0x78edc9(0xdb)]({'item':_0x2b8579,'yaml':_0x113611});}const _0x3fe751=await _0x36d70a[_0x78edc9(0xa9)][_0x78edc9(0xc5)](_0x59602a[_0x78edc9(0xae)]),_0x22067f=buildMergedJourneyDef(_0x4e6820,_0x2a47e1,_0x3fe751);return{'bundleName':_0x1ec257,'folderPath':_0x396c25,'finalYaml':_0x22067f};}));for(const {bundleName:_0x2e6ce8,folderPath:_0x4360af,finalYaml:_0x2efdaf}of _0x2d4d37){const _0x561244=normalizeJourneyDef(_0x2efdaf),_0x446f86=a150_0x41fdfd(_0x561244),_0x2c3606=_0x4360af?a150_0x4a1493[_0x18017b(0xbc)](_0x582a93,_0x4360af):_0x582a93,_0x4211a9=sanitizeFileName(_0x2e6ce8),_0xdd849=getUniqueFileName(_0x2c3606,_0x4211a9,_0x28f764),_0x3fabf6=a150_0x4a1493[_0x18017b(0xbc)](_0x2c3606,_0xdd849+_0x18017b(0xa1));_0x371fc1[_0x18017b(0xdb)](prepareFile(_0x3fabf6,_0x446f86,_0x582a93));}}}const _0x4f6486=Array['from'](_0x3345be[_0x18017b(0xd9)]())['reduce']((_0x42adaf,_0x33eac5)=>_0x42adaf+_0x33eac5[_0x18017b(0xdf)],0x0),_0x519567=_0x171606[_0x18017b(0xde)](_0x7a79af=>_0x7a79af[_0x18017b(0xc3)]!==SEGMENT_KIND_JOURNEY),_0x43fe6d=_0x371fc1[_0x18017b(0xde)](_0x2a7b41=>_0x2a7b41['isNew'])[_0x18017b(0xdf)],_0x37fffb=_0x371fc1[_0x18017b(0xde)](_0x5568c7=>!_0x5568c7[_0x18017b(0xb6)]&&_0x5568c7[_0x18017b(0xb3)])['length'],_0x6960e7=_0x371fc1[_0x18017b(0xde)](_0x5c3392=>!_0x5c3392[_0x18017b(0xb6)]&&!_0x5c3392[_0x18017b(0xb3)])[_0x18017b(0xdf)],_0x1f2693=Array[_0x18017b(0xe4)](_0x2f0e26[_0x18017b(0xd9)]())[_0x18017b(0xbb)]((_0xd1e340,_0x4e9b20)=>_0xd1e340+_0x4e9b20[_0x18017b(0xdf)],0x0);return{'parentName':_0x2608a4,'parentId':_0x49a2e8,'targetDir':_0x582a93,'files':_0x371fc1,'counts':{'segments':_0x519567[_0x18017b(0xdf)],'journeys':_0x2f0e26[_0x18017b(0xaa)],'journeyVersions':_0x1f2693,'activations':_0x4f6486},'newFiles':_0x43fe6d,'changedFiles':_0x37fffb,'unchangedFiles':_0x6960e7};}function createYamlContextForBundle(_0x3fe9f3,_0x4c68eb,_0x2fe6d5,_0x344373,_0xb8913d,_0x3e9c9c){const _0x56d73b=new Set(),_0x367309=new Map(),_0x5596b8=new Map(),_0x162b29=createJumpTargetCache(),_0x345afa=async(_0x2aab56,_0x2714f5)=>{const _0x20a951=a150_0x4c53,_0x3b9892=_0x367309[_0x20a951(0xda)](_0x2aab56);if(_0x3b9892!==undefined)return _0x3b9892;if(!_0x2714f5)return _0x2aab56;try{let _0x4dfd65=_0x4c68eb[_0x20a951(0xda)](_0x2aab56);!_0x4dfd65&&(_0x4dfd65=await _0x3fe9f3[_0x20a951(0xc2)][_0x20a951(0xe7)](_0x2714f5,_0x2aab56),_0x4c68eb['set'](_0x2aab56,_0x4dfd65));const _0x5e4195=generateJourneyLocalName(_0x4dfd65['name']),_0x3fe0ea=_0x4dfd65['kind']===SEGMENT_KIND_JOURNEY&&_0x5e4195!==undefined;if(_0x3fe0ea&&_0x5e4195){let _0x47e34e=_0x5e4195,_0x119e4a=0x2;while(_0x56d73b[_0x20a951(0xcf)](_0x47e34e)){_0x47e34e=_0x5e4195+'_'+_0x119e4a,_0x119e4a++;}return _0x56d73b[_0x20a951(0xe2)](_0x47e34e),_0x367309['set'](_0x2aab56,_0x47e34e),_0x47e34e;}return _0x4dfd65[_0x20a951(0xa5)];}catch{return _0x2aab56;}},_0x515726=(_0x267c07,_0x3aa603)=>({'resolveSegment':async _0x540c10=>{const _0x5aeeb0=a150_0x4c53,_0x476640=_0x367309[_0x5aeeb0(0xda)](_0x540c10);if(_0x476640!==undefined)return{'name':_0x476640,'isJourneyLocal':!![]};if(!_0x3aa603)return{'name':_0x540c10,'isJourneyLocal':![]};try{let _0x56e4b3=_0x4c68eb['get'](_0x540c10);!_0x56e4b3&&(_0x56e4b3=await _0x3fe9f3[_0x5aeeb0(0xc2)][_0x5aeeb0(0xe7)](_0x3aa603,_0x540c10),_0x4c68eb[_0x5aeeb0(0xa0)](_0x540c10,_0x56e4b3));const _0x129f79=generateJourneyLocalName(_0x56e4b3[_0x5aeeb0(0xa5)]),_0x371069=_0x56e4b3[_0x5aeeb0(0xc3)]===SEGMENT_KIND_JOURNEY&&_0x129f79!==undefined;if(_0x371069&&!_0x56e4b3[_0x5aeeb0(0xcc)]&&_0x3aa603)try{const _0x255f58=await _0x3fe9f3[_0x5aeeb0(0xc2)][_0x5aeeb0(0xe7)](_0x3aa603,_0x540c10);_0x4c68eb[_0x5aeeb0(0xa0)](_0x540c10,_0x255f58),_0x56e4b3=_0x255f58;}catch{}const _0x558363=await _0x345afa(_0x540c10,_0x3aa603);let _0x3b9264;if(_0x371069&&_0x56e4b3['rule']){const _0x3d37ea=await segmentResponseToDef(_0x56e4b3,{'resolveSegmentName':_0x2cb4c5=>_0x345afa(_0x2cb4c5,_0x3aa603)});_0x3b9264={'description':_0x56e4b3[_0x5aeeb0(0xe6)],'rule':_0x3d37ea['rule']};}return{'name':_0x558363,'isJourneyLocal':_0x371069,'definition':_0x3b9264};}catch{return{'name':_0x540c10,'isJourneyLocal':![]};}},'resolveActivation':async _0x37a24f=>{const _0x1f97f0=a150_0x4c53,_0x460e86=_0x5596b8[_0x1f97f0(0xda)](_0x37a24f);if(_0x460e86!==undefined)return{'name':_0x460e86,'isJourneyLocal':!![]};try{let _0x210069=_0xb8913d[_0x1f97f0(0xda)](_0x37a24f);!_0x210069&&(_0x210069=await _0x3fe9f3[_0x1f97f0(0xa9)][_0x1f97f0(0xb2)](_0x267c07,_0x37a24f));const _0x519695=_0x210069[_0x1f97f0(0xc0)][_0x1f97f0(0xdd)][_0x1f97f0(0xa5)]||_0x37a24f,_0x164677=sanitizeYamlKey(_0x519695)||_0x1f97f0(0xcd)+_0x37a24f,_0x99be1c=_0x164677;_0x5596b8['set'](_0x37a24f,_0x99be1c);const _0xbffcfb=journeyActivationStepToYaml(_0x210069,_0x2fe6d5,_0x344373);return{'name':_0x99be1c,'isJourneyLocal':!![],'definition':_0xbffcfb};}catch{return{'name':_0x37a24f,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5cfa08,_0x12fc64)=>resolveJumpTarget(_0x5cfa08,_0x12fc64,_0x162b29,async _0x52dc19=>{const _0x1a39b=a150_0x4c53,_0x330320=_0x3e9c9c[_0x1a39b(0xda)](_0x52dc19);if(_0x330320)return _0x330320;return _0x3fe9f3[_0x1a39b(0xa9)][_0x1a39b(0xb1)](_0x52dc19);})});return{'createYamlContext':_0x515726};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a151_0x31fa2e=a151_0xcc2a;(function(_0x261136,_0x9f0666){const _0xe4437d=a151_0xcc2a,_0x422c53=_0x261136();while(!![]){try{const _0x1de986=parseInt(_0xe4437d(0x1c7))/0x1+-parseInt(_0xe4437d(0x1cd))/0x2+-parseInt(_0xe4437d(0x1c5))/0x3+parseInt(_0xe4437d(0x1c3))/0x4*(-parseInt(_0xe4437d(0x1d0))/0x5)+parseInt(_0xe4437d(0x1be))/0x6*(parseInt(_0xe4437d(0x1bd))/0x7)+-parseInt(_0xe4437d(0x1c1))/0x8+-parseInt(_0xe4437d(0x1cf))/0x9*(-parseInt(_0xe4437d(0x1bf))/0xa);if(_0x1de986===_0x9f0666)break;else _0x422c53['push'](_0x422c53['shift']());}catch(_0x4a32fb){_0x422c53['push'](_0x422c53['shift']());}}}(a151_0xa54a,0x36e69));function a151_0xcc2a(_0x1daaa2,_0x2e2f9c){_0x1daaa2=_0x1daaa2-0x1b9;const _0xa54af0=a151_0xa54a();let _0xcc2a34=_0xa54af0[_0x1daaa2];return _0xcc2a34;}import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a151_0x406d34 from'path';import{Logger}from'../../utils/logger/index.js';function a151_0xa54a(){const _0x1e893e=['code','118818ZoSukg','78bTUSbT','230yvQXyy','stringify','2277048mrLggV','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','436flYKKs','utf-8','108165qxBqOh','toISOString','281027bywEnE','journeyName','basename','ENOENT','.tmp','parse','799460XecBme','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','188127FJpubG','1705ErkPBi','debug','segments','join','dirname','version','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','tdx.sdk.push-recovery','.push-recovery.json'];a151_0xa54a=function(){return _0x1e893e;};return a151_0xa54a();}const logger=Logger['of'](a151_0x31fa2e(0x1ba));export function getPushRecoveryPath(_0x2d9da1){const _0x32d47d=a151_0x31fa2e,_0x17b22a=a151_0x406d34[_0x32d47d(0x1d4)](_0x2d9da1),_0x4b41f0=a151_0x406d34[_0x32d47d(0x1c9)](_0x2d9da1);return a151_0x406d34[_0x32d47d(0x1d3)](_0x17b22a,'.'+_0x4b41f0+_0x32d47d(0x1bb));}export function readPushRecovery(_0x1d7d3d){const _0x53bdc5=a151_0x31fa2e,_0xccb4b3=getPushRecoveryPath(_0x1d7d3d);if(!existsSync(_0xccb4b3))return undefined;try{const _0x2b29ea=readFileSync(_0xccb4b3,'utf-8'),_0x2f5d53=JSON[_0x53bdc5(0x1cc)](_0x2b29ea);if(_0x2f5d53?.[_0x53bdc5(0x1d5)]!==0x1||typeof _0x2f5d53['journeyName']!=='string')return undefined;return _0x2f5d53;}catch(_0xb7945c){return _0xb7945c instanceof SyntaxError?logger[_0x53bdc5(0x1d1)](_0x53bdc5(0x1ce)+_0xb7945c):logger['warn'](_0x53bdc5(0x1c2)+_0xb7945c),undefined;}}export function writePushRecovery(_0x49399c,_0x4399e4){const _0x2c0456=a151_0x31fa2e,_0x3020eb=getPushRecoveryPath(_0x49399c),_0x162080=_0x3020eb+_0x2c0456(0x1cb);writeFileSync(_0x162080,JSON[_0x2c0456(0x1c0)](_0x4399e4,null,0x2)+'\x0a',_0x2c0456(0x1c4)),renameSync(_0x162080,_0x3020eb);}export function deletePushRecovery(_0x49d6ca){const _0x30e5ae=a151_0x31fa2e,_0x1590d7=getPushRecoveryPath(_0x49d6ca);try{unlinkSync(_0x1590d7);}catch(_0x2cea40){_0x2cea40[_0x30e5ae(0x1bc)]!==_0x30e5ae(0x1ca)&&logger['debug'](_0x30e5ae(0x1b9)+_0x2cea40);}}export function saveSegmentToPushRecovery(_0x106d37,_0x1edbc1,_0x26d497,_0x2dcd05){const _0x5a0e41=a151_0x31fa2e,_0x275095=readPushRecovery(_0x106d37),_0x2c5586=_0x275095?.[_0x5a0e41(0x1c8)]===_0x1edbc1?{..._0x275095,'updatedAt':new Date()[_0x5a0e41(0x1c6)]()}:{'version':0x1,'journeyName':_0x1edbc1,'updatedAt':new Date()[_0x5a0e41(0x1c6)](),'segments':{}};_0x2c5586[_0x5a0e41(0x1d2)][_0x26d497]=_0x2dcd05,writePushRecovery(_0x106d37,_0x2c5586);}
|