@treasuredata/tdx 2026.4.7 → 2026.4.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.d.ts +2 -0
- package/dist/sdk/workspace/access-tracker.d.ts.map +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/access-tracker.js.map +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts +2 -0
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.d.ts +3 -0
- package/dist/utils/process.d.ts.map +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/process.js.map +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.d.ts +10 -2
- package/dist/utils/version-check.d.ts.map +1 -1
- package/dist/utils/version-check.js +1 -1
- package/dist/utils/version-check.js.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x3f5906,_0x5bc40b){const _0x3a61d3=a149_0x3e13,_0x4491be=_0x3f5906();while(!![]){try{const _0x95ba38=parseInt(_0x3a61d3(0x14c))/0x1+-parseInt(_0x3a61d3(0x152))/0x2+parseInt(_0x3a61d3(0x17d))/0x3+-parseInt(_0x3a61d3(0x128))/0x4*(parseInt(_0x3a61d3(0x11c))/0x5)+-parseInt(_0x3a61d3(0x184))/0x6+parseInt(_0x3a61d3(0x11d))/0x7*(-parseInt(_0x3a61d3(0x136))/0x8)+-parseInt(_0x3a61d3(0x124))/0x9*(-parseInt(_0x3a61d3(0x11f))/0xa);if(_0x95ba38===_0x5bc40b)break;else _0x4491be['push'](_0x4491be['shift']());}catch(_0x3054cd){_0x4491be['push'](_0x4491be['shift']());}}}(a149_0x7898,0x284f2));import*as a149_0x3e6100 from'yaml';function formatScheduleTime(_0x23444a){const _0x189621=a149_0x3e13;if(typeof _0x23444a==='number'){const _0x4b0f79=Math[_0x189621(0x11b)](_0x23444a);return String(_0x4b0f79)[_0x189621(0x178)](0x2,'0')+_0x189621(0x177);}if(typeof _0x23444a===_0x189621(0x138)){if(/^\d{2}:\d{2}:\d{2}$/[_0x189621(0x157)](_0x23444a))return _0x23444a;if(/^\d{1,2}:\d{2}$/[_0x189621(0x157)](_0x23444a)){const [_0x2f9d58,_0x4a58e7]=_0x23444a[_0x189621(0x151)](':');return _0x2f9d58[_0x189621(0x178)](0x2,'0')+':'+_0x4a58e7+_0x189621(0x14e);}const _0x318308=parseInt(_0x23444a,0xa);if(!isNaN(_0x318308)&&_0x23444a[_0x189621(0x156)](/^\d+$/))return String(_0x318308)['padStart'](0x2,'0')+':00:00';return _0x23444a;}return String(_0x23444a);}export function apiToDef(_0x5f5db4){const _0xc19854=a149_0x3e13,_0x3bea13={'database':_0x5f5db4['master']?.[_0xc19854(0x167)]||'','table':_0x5f5db4['master']?.[_0xc19854(0x182)]||''};_0x5f5db4[_0xc19854(0x176)]&&_0x5f5db4[_0xc19854(0x176)][_0xc19854(0x16c)]>0x0&&(_0x3bea13[_0xc19854(0x162)]=_0x5f5db4[_0xc19854(0x176)][_0xc19854(0x17b)](_0x40c6d1=>({'column':_0x40c6d1[_0xc19854(0x186)],'values':_0x40c6d1[_0xc19854(0x175)]})));let _0x43ec0f;_0x5f5db4[_0xc19854(0x161)]&&_0x5f5db4[_0xc19854(0x161)]!==_0xc19854(0x126)&&(_0x43ec0f={'type':_0x5f5db4['scheduleType']},_0x5f5db4[_0xc19854(0x143)]&&(_0x43ec0f[_0xc19854(0x13e)]=formatScheduleTime(_0x5f5db4[_0xc19854(0x143)])),_0x5f5db4[_0xc19854(0x179)]&&(_0x43ec0f['timezone']=_0x5f5db4[_0xc19854(0x179)]));let _0x330205;(_0x5f5db4['workflowHiveOnly']||_0x5f5db4[_0xc19854(0x12a)]||_0x5f5db4[_0xc19854(0x120)])&&(_0x330205={},_0x5f5db4[_0xc19854(0x13c)]&&(_0x330205['hive_only']=_0x5f5db4[_0xc19854(0x13c)]),_0x5f5db4[_0xc19854(0x12a)]&&(_0x330205['hive_pool']=_0x5f5db4[_0xc19854(0x12a)]),_0x5f5db4[_0xc19854(0x120)]&&(_0x330205[_0xc19854(0x121)]=_0x5f5db4[_0xc19854(0x120)]));const _0x114e61=_0x5f5db4['attributes']&&_0x5f5db4[_0xc19854(0x169)][_0xc19854(0x16c)]>0x0?groupAttributesBySource(_0x5f5db4[_0xc19854(0x169)]):undefined,_0x1bf3b3=_0x5f5db4[_0xc19854(0x165)]&&_0x5f5db4['behaviors'][_0xc19854(0x16c)]>0x0?_0x5f5db4[_0xc19854(0x165)][_0xc19854(0x17b)](convertApiBehaviorToYaml):undefined;let _0x1876b5;_0x5f5db4['customerGroup']&&(_0x1876b5={'name':_0x5f5db4['customerGroup']['name'],'source':{'database':_0x5f5db4['customerGroup'][_0xc19854(0x167)],'table':_0x5f5db4[_0xc19854(0x11a)][_0xc19854(0x182)]},'join':{'parent_key':_0x5f5db4[_0xc19854(0x11a)][_0xc19854(0x15e)],'child_key':_0x5f5db4[_0xc19854(0x11a)][_0xc19854(0x17f)]}},_0x5f5db4[_0xc19854(0x11a)]['customerGroupAttributes']&&_0x5f5db4['customerGroup'][_0xc19854(0x168)]['length']>0x0&&(_0x1876b5[_0xc19854(0x169)]=groupAttributesBySource(_0x5f5db4[_0xc19854(0x11a)][_0xc19854(0x168)])),_0x5f5db4[_0xc19854(0x11a)][_0xc19854(0x153)]&&_0x5f5db4[_0xc19854(0x11a)]['customerGroupBehaviors'][_0xc19854(0x16c)]>0x0&&(_0x1876b5[_0xc19854(0x165)]=_0x5f5db4[_0xc19854(0x11a)]['customerGroupBehaviors'][_0xc19854(0x17b)](convertApiBehaviorToYaml)));const _0x3c784d={'name':_0x5f5db4[_0xc19854(0x122)],..._0x5f5db4['description']&&{'description':_0x5f5db4['description']},'master':_0x3bea13,..._0x43ec0f&&{'schedule':_0x43ec0f},..._0x330205&&{'engine':_0x330205},..._0x114e61&&{'attributes':_0x114e61},..._0x1bf3b3&&{'behaviors':_0x1bf3b3},..._0x1876b5&&{'customer_group':_0x1876b5}};return _0x3c784d;}function groupAttributesBySource(_0x289565){const _0x2b8ba6=a149_0x3e13,_0x353a6c=new Map();for(const _0x2a4be2 of _0x289565){const _0x5d1ce7=_0x2a4be2[_0x2b8ba6(0x167)]+'.'+_0x2a4be2[_0x2b8ba6(0x182)]+'.'+_0x2a4be2[_0x2b8ba6(0x17f)]+'.'+_0x2a4be2[_0x2b8ba6(0x15e)];!_0x353a6c[_0x2b8ba6(0x129)](_0x5d1ce7)&&_0x353a6c[_0x2b8ba6(0x187)](_0x5d1ce7,[]),_0x353a6c[_0x2b8ba6(0x166)](_0x5d1ce7)[_0x2b8ba6(0x180)](_0x2a4be2);}const _0x524d5a=[];for(const [,_0x28dfef]of _0x353a6c){const _0x5a77a1=_0x28dfef[0x0],_0x3bab87=_0x5a77a1[_0x2b8ba6(0x147)]||_0x5a77a1[_0x2b8ba6(0x182)];_0x524d5a['push']({'name':_0x3bab87,'source':{'database':_0x5a77a1[_0x2b8ba6(0x167)],'table':_0x5a77a1['parentTableName']},'join':{'parent_key':_0x5a77a1[_0x2b8ba6(0x15e)],'child_key':_0x5a77a1[_0x2b8ba6(0x17f)]},'columns':_0x28dfef['map'](_0x14d224=>{const _0x4572c7=_0x2b8ba6,_0x54f846={'column':_0x14d224[_0x4572c7(0x119)],'type':_0x14d224[_0x4572c7(0x164)]};return _0x14d224[_0x4572c7(0x122)]!==_0x14d224[_0x4572c7(0x119)]&&(_0x54f846[_0x4572c7(0x13b)]=_0x14d224[_0x4572c7(0x122)]),_0x54f846;})});}return _0x524d5a;}function convertApiBehaviorToYaml(_0x5ef200){const _0x2f3a04=a149_0x3e13,_0x16c9cf={'name':_0x5ef200['name'],'source':{'database':_0x5ef200[_0x2f3a04(0x167)],'table':_0x5ef200['parentTableName']},'join':{'parent_key':_0x5ef200[_0x2f3a04(0x15e)],'child_key':_0x5ef200[_0x2f3a04(0x17f)]}};if(_0x5ef200[_0x2f3a04(0x12b)])_0x16c9cf['all_columns']=!![];else _0x5ef200['schema']&&_0x5ef200['schema'][_0x2f3a04(0x16c)]>0x0&&(_0x16c9cf[_0x2f3a04(0x154)]=_0x5ef200[_0x2f3a04(0x17e)]['map'](_0x269355=>{const _0xb98126=_0x2f3a04,_0x2d6c85={'column':_0x269355[_0xb98126(0x119)],'type':_0x269355[_0xb98126(0x164)]};return _0x269355[_0xb98126(0x122)]!==_0x269355[_0xb98126(0x119)]&&(_0x2d6c85['label']=_0x269355[_0xb98126(0x122)]),_0x2d6c85;}));return _0x5ef200['defaultTimeFilterEnabled']&&(_0x16c9cf[_0x2f3a04(0x15c)]=_0x5ef200[_0x2f3a04(0x132)]),_0x5ef200[_0x2f3a04(0x12c)]&&(_0x16c9cf[_0x2f3a04(0x12e)]=_0x5ef200[_0x2f3a04(0x12c)]),_0x16c9cf;}export function defToApi(_0xf533e4){const _0x1d56aa=a149_0x3e13,_0xe78806={'name':_0xf533e4['name'],'master':{'parentDatabaseName':_0xf533e4[_0x1d56aa(0x144)][_0x1d56aa(0x16a)],'parentTableName':_0xf533e4['master'][_0x1d56aa(0x16b)]}};_0xf533e4['description']&&(_0xe78806['description']=_0xf533e4[_0x1d56aa(0x118)]);_0xf533e4[_0x1d56aa(0x144)][_0x1d56aa(0x162)]&&_0xf533e4[_0x1d56aa(0x144)][_0x1d56aa(0x162)]['length']>0x0&&(_0xe78806[_0x1d56aa(0x176)]=_0xf533e4['master'][_0x1d56aa(0x162)][_0x1d56aa(0x17b)](_0x32ed2b=>({'columnName':_0x32ed2b['column'],'rightValues':_0x32ed2b[_0x1d56aa(0x145)]})));_0xf533e4[_0x1d56aa(0x12f)]&&(_0xe78806['scheduleType']=_0xf533e4[_0x1d56aa(0x12f)][_0x1d56aa(0x164)],_0xf533e4[_0x1d56aa(0x12f)][_0x1d56aa(0x13e)]&&(_0xe78806['scheduleOption']=_0xf533e4['schedule']['time']),_0xf533e4[_0x1d56aa(0x12f)][_0x1d56aa(0x179)]&&(_0xe78806[_0x1d56aa(0x179)]=_0xf533e4[_0x1d56aa(0x12f)][_0x1d56aa(0x179)]));_0xf533e4['engine']&&(_0xf533e4[_0x1d56aa(0x172)]['hive_only']!==undefined&&(_0xe78806[_0x1d56aa(0x13c)]=_0xf533e4[_0x1d56aa(0x172)]['hive_only']),_0xf533e4[_0x1d56aa(0x172)][_0x1d56aa(0x14f)]!==undefined&&(_0xe78806[_0x1d56aa(0x12a)]=_0xf533e4[_0x1d56aa(0x172)][_0x1d56aa(0x14f)]),_0xf533e4[_0x1d56aa(0x172)][_0x1d56aa(0x121)]!==undefined&&(_0xe78806[_0x1d56aa(0x120)]=_0xf533e4[_0x1d56aa(0x172)][_0x1d56aa(0x121)]));_0xf533e4[_0x1d56aa(0x169)]&&_0xf533e4['attributes'][_0x1d56aa(0x16c)]>0x0&&(_0xe78806[_0x1d56aa(0x169)]=flattenAttributeGroups(_0xf533e4[_0x1d56aa(0x169)]));_0xf533e4[_0x1d56aa(0x165)]&&_0xf533e4[_0x1d56aa(0x165)]['length']>0x0&&(_0xe78806[_0x1d56aa(0x165)]=_0xf533e4[_0x1d56aa(0x165)][_0x1d56aa(0x17b)](convertDefBehaviorToApi));if(_0xf533e4[_0x1d56aa(0x134)]){const _0xa1f12e=_0xf533e4['customer_group'];_0xe78806[_0x1d56aa(0x11a)]={'name':_0xa1f12e[_0x1d56aa(0x122)],'parentDatabaseName':_0xa1f12e[_0x1d56aa(0x170)][_0x1d56aa(0x16a)],'parentTableName':_0xa1f12e['source'][_0x1d56aa(0x16b)],'parentKey':_0xa1f12e[_0x1d56aa(0x16e)]['child_key'],'foreignKey':_0xa1f12e['join'][_0x1d56aa(0x15d)]},_0xa1f12e['attributes']&&_0xa1f12e[_0x1d56aa(0x169)][_0x1d56aa(0x16c)]>0x0&&(_0xe78806[_0x1d56aa(0x11a)][_0x1d56aa(0x168)]=flattenAttributeGroups(_0xa1f12e[_0x1d56aa(0x169)])[_0x1d56aa(0x17b)](_0x456837=>({'name':_0x456837[_0x1d56aa(0x122)],'type':_0x456837[_0x1d56aa(0x164)],'parentDatabaseName':_0x456837[_0x1d56aa(0x167)],'parentTableName':_0x456837[_0x1d56aa(0x182)],'parentColumn':_0x456837[_0x1d56aa(0x119)],'parentKey':_0x456837[_0x1d56aa(0x17f)],'foreignKey':_0x456837['foreignKey']}))),_0xa1f12e[_0x1d56aa(0x165)]&&_0xa1f12e[_0x1d56aa(0x165)]['length']>0x0&&(_0xe78806['customerGroup'][_0x1d56aa(0x153)]=_0xa1f12e[_0x1d56aa(0x165)][_0x1d56aa(0x17b)](_0x3fb17d=>({'name':_0x3fb17d[_0x1d56aa(0x122)],'parentDatabaseName':_0x3fb17d[_0x1d56aa(0x170)][_0x1d56aa(0x16a)],'parentTableName':_0x3fb17d[_0x1d56aa(0x170)][_0x1d56aa(0x16b)],'parentKey':_0x3fb17d[_0x1d56aa(0x16e)][_0x1d56aa(0x159)],'foreignKey':_0x3fb17d[_0x1d56aa(0x16e)][_0x1d56aa(0x15d)],'allColumns':_0x3fb17d['all_columns'],'schema':_0x3fb17d[_0x1d56aa(0x154)]?.[_0x1d56aa(0x17b)](_0x4ccfec=>({'name':_0x4ccfec[_0x1d56aa(0x13b)]||_0x4ccfec[_0x1d56aa(0x130)],'type':_0x4ccfec[_0x1d56aa(0x164)],'parentColumn':_0x4ccfec['column']}))})));}return _0xe78806;}function flattenAttributeGroups(_0x16c619){const _0x1b7eae=a149_0x3e13,_0x5e4a90=[];for(const _0x4704a5 of _0x16c619){for(const _0x4c7205 of _0x4704a5[_0x1b7eae(0x154)]){_0x5e4a90[_0x1b7eae(0x180)]({'name':_0x4c7205[_0x1b7eae(0x13b)]||_0x4c7205[_0x1b7eae(0x130)],'type':_0x4c7205[_0x1b7eae(0x164)],'parentDatabaseName':_0x4704a5[_0x1b7eae(0x170)][_0x1b7eae(0x16a)],'parentTableName':_0x4704a5[_0x1b7eae(0x170)]['table'],'parentColumn':_0x4c7205[_0x1b7eae(0x130)],'parentKey':_0x4704a5[_0x1b7eae(0x16e)][_0x1b7eae(0x159)],'foreignKey':_0x4704a5[_0x1b7eae(0x16e)][_0x1b7eae(0x15d)],'groupingName':_0x4704a5['name']});}}return _0x5e4a90;}function a149_0x7898(){const _0x4eba57=['behaviors','get','parentDatabaseName','customerGroupAttributes','attributes','database','table','length','attributes:','join','user_id','source','forEach','engine','realtime.attributes[','parse','rightValues','audienceFilters',':00:00','padStart','timezone','YAML\x20config\x20missing\x20required\x20field:\x20master.table','map','single','283920IxqVBU','schema','parentKey','push','):\x20Invalid\x20type\x20\x27','parentTableName','id_stitching','1965936BDfRab',']\x20(','columnName','set','master:','description','parentColumn','customerGroup','floor','86745OUoRZd','1862svCxwJ','personalization_services[','920BBSXDG','prestoPoolName','trino_pool','name','YAML\x20config\x20missing\x20required\x20field:\x20master.database','63774LnsLuj','attribute_table','none','imported_batch','52UHZwlU','has','hivePoolName','allColumns','isRealtime','Example\x20Events','realtime','schedule','column','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','defaultTimeFilterEnabled','events','customer_group','\x27.\x20Must\x20be\x20one\x20of:\x20','1896TFCTbS','isArray','string','personalization_services:','Parent\x20segment\x20description','label','workflowHiveOnly','engine:','time','customer_id','personalization_services\x20must\x20be\x20an\x20array','events_table','primary_key','scheduleOption','master','values','personalization_services','groupingName','customer_group:',']:\x20Missing\x20required\x20field\x20\x27name\x27','Display\x20Name','stringify','73877Koxsbs','includes',':00','hive_pool','behaviors:','split','78176XtekNP','customerGroupBehaviors','columns','all_columns','match','test','list','child_key','counter','column_name','default_time_filter','parent_key','foreignKey','03:00','realtime:','scheduleType','filters','Example\x20Attributes','type'];a149_0x7898=function(){return _0x4eba57;};return a149_0x7898();}function convertDefBehaviorToApi(_0xe1b839){const _0x3f9006=a149_0x3e13,_0x5a56af={'name':_0xe1b839[_0x3f9006(0x122)],'parentDatabaseName':_0xe1b839[_0x3f9006(0x170)][_0x3f9006(0x16a)],'parentTableName':_0xe1b839[_0x3f9006(0x170)][_0x3f9006(0x16b)],'parentKey':_0xe1b839[_0x3f9006(0x16e)][_0x3f9006(0x159)],'foreignKey':_0xe1b839[_0x3f9006(0x16e)][_0x3f9006(0x15d)]};if(_0xe1b839[_0x3f9006(0x155)])_0x5a56af[_0x3f9006(0x12b)]=!![];else _0xe1b839[_0x3f9006(0x154)]&&_0xe1b839[_0x3f9006(0x154)][_0x3f9006(0x16c)]>0x0&&(_0x5a56af[_0x3f9006(0x17e)]=_0xe1b839['columns'][_0x3f9006(0x17b)](_0x54aeb6=>({'name':_0x54aeb6[_0x3f9006(0x13b)]||_0x54aeb6[_0x3f9006(0x130)],'type':_0x54aeb6['type'],'parentColumn':_0x54aeb6['column']})));return _0xe1b839['default_time_filter']!==undefined&&(_0x5a56af[_0x3f9006(0x132)]=_0xe1b839[_0x3f9006(0x15c)]),_0xe1b839[_0x3f9006(0x12e)]!==undefined&&(_0x5a56af[_0x3f9006(0x12c)]=_0xe1b839['realtime']),_0x5a56af;}export function serializeDef(_0x12a31e){const _0x3fba00=a149_0x3e13,_0x3cd50a=JSON[_0x3fba00(0x174)](JSON[_0x3fba00(0x14b)](_0x12a31e)),_0x36817c=a149_0x3e6100[_0x3fba00(0x14b)](_0x3cd50a,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x5e1f41=[_0x3fba00(0x188),'schedule:',_0x3fba00(0x13d),_0x3fba00(0x16d),_0x3fba00(0x150),_0x3fba00(0x148),_0x3fba00(0x160),_0x3fba00(0x139)];let _0x15d4b2=_0x36817c;for(const _0x3383aa of _0x5e1f41){_0x15d4b2=_0x15d4b2['replace'](new RegExp('^('+_0x3383aa+')','m'),(_0x599f4f,_0x44352d,_0x44ef38)=>{if(_0x44ef38===0x0||_0x15d4b2[_0x44ef38-0x1]==='\x0a'&&_0x15d4b2[_0x44ef38-0x2]==='\x0a')return _0x44352d;return'\x0a'+_0x44352d;});}return _0x15d4b2;}export function parseDef(_0x22fc47){const _0x4dc778=a149_0x3e13,_0x63aeb=a149_0x3e6100['parse'](_0x22fc47);if(!_0x63aeb[_0x4dc778(0x122)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x63aeb['master'])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master');if(!_0x63aeb[_0x4dc778(0x144)]['database'])throw new Error(_0x4dc778(0x123));if(!_0x63aeb[_0x4dc778(0x144)][_0x4dc778(0x16b)])throw new Error(_0x4dc778(0x17a));return _0x63aeb['realtime']&&validateRealtimeSection(_0x63aeb[_0x4dc778(0x12e)]),_0x63aeb[_0x4dc778(0x146)]&&validatePersonalizationServices(_0x63aeb[_0x4dc778(0x146)]),_0x63aeb;}function validateRealtimeSection(_0x41046d){const _0x5064ac=a149_0x3e13,_0x20b284=[_0x5064ac(0x17c),_0x5064ac(0x15a),_0x5064ac(0x187),'ordered_set',_0x5064ac(0x158),_0x5064ac(0x127)];_0x41046d[_0x5064ac(0x133)]&&Array[_0x5064ac(0x137)](_0x41046d[_0x5064ac(0x133)])&&_0x41046d[_0x5064ac(0x133)][_0x5064ac(0x171)]((_0x4287fb,_0x38352b)=>{const _0xc388b5=_0x5064ac;if(!_0x4287fb[_0xc388b5(0x122)])throw new Error('realtime.events['+_0x38352b+_0xc388b5(0x149));});_0x41046d[_0x5064ac(0x169)]&&Array[_0x5064ac(0x137)](_0x41046d[_0x5064ac(0x169)])&&_0x41046d['attributes']['forEach']((_0x23d26e,_0x5076aa)=>{const _0x466221=_0x5064ac;if(!_0x23d26e[_0x466221(0x122)])throw new Error(_0x466221(0x173)+_0x5076aa+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x23d26e[_0x466221(0x164)]&&!_0x20b284[_0x466221(0x14d)](_0x23d26e['type']))throw new Error('realtime.attributes['+_0x5076aa+_0x466221(0x185)+_0x23d26e[_0x466221(0x122)]+_0x466221(0x181)+_0x23d26e[_0x466221(0x164)]+_0x466221(0x135)+_0x20b284[_0x466221(0x16e)](',\x20'));});if(_0x41046d[_0x5064ac(0x183)]){if(!_0x41046d[_0x5064ac(0x183)][_0x5064ac(0x142)])throw new Error(_0x5064ac(0x131));}}function a149_0x3e13(_0x3785db,_0x297e58){_0x3785db=_0x3785db-0x118;const _0x78986c=a149_0x7898();let _0x3e130d=_0x78986c[_0x3785db];return _0x3e130d;}function validatePersonalizationServices(_0x405877){const _0x29da14=a149_0x3e13;if(!Array['isArray'](_0x405877))throw new Error(_0x29da14(0x140));_0x405877[_0x29da14(0x171)]((_0x367551,_0x4e5d00)=>{const _0xed2395=_0x29da14;if(!_0x367551[_0xed2395(0x122)])throw new Error(_0xed2395(0x11e)+_0x4e5d00+_0xed2395(0x149));});}export function generateTemplate(_0x8fda2f,_0x48d804,_0x3f9555){const _0x47e377=a149_0x3e13,_0x47f389={'name':_0x8fda2f,'description':_0x47e377(0x13a),'master':{'database':_0x48d804,'table':_0x3f9555},'schedule':{'type':'daily','time':_0x47e377(0x15f),'timezone':'UTC'},'attributes':[{'name':_0x47e377(0x163),'source':{'database':_0x48d804,'table':_0x47e377(0x125)},'join':{'parent_key':'id','child_key':_0x47e377(0x13f)},'columns':[{'column':_0x47e377(0x15b),'label':_0x47e377(0x14a),'type':_0x47e377(0x138)}]}],'behaviors':[{'name':_0x47e377(0x12d),'source':{'database':_0x48d804,'table':_0x47e377(0x141)},'join':{'parent_key':_0x47e377(0x16f),'child_key':_0x47e377(0x13f)},'all_columns':!![]}]};return serializeDef(_0x47f389);}
|
|
1
|
+
(function(_0x1573ce,_0x308d4a){const _0x5f2cee=a149_0x498f,_0x5bc55c=_0x1573ce();while(!![]){try{const _0x52b532=-parseInt(_0x5f2cee(0xf0))/0x1+-parseInt(_0x5f2cee(0xfd))/0x2+-parseInt(_0x5f2cee(0x100))/0x3*(-parseInt(_0x5f2cee(0x108))/0x4)+parseInt(_0x5f2cee(0xd3))/0x5*(parseInt(_0x5f2cee(0xe3))/0x6)+-parseInt(_0x5f2cee(0xfb))/0x7*(-parseInt(_0x5f2cee(0xd2))/0x8)+parseInt(_0x5f2cee(0xc7))/0x9+parseInt(_0x5f2cee(0x10e))/0xa*(-parseInt(_0x5f2cee(0xe1))/0xb);if(_0x52b532===_0x308d4a)break;else _0x5bc55c['push'](_0x5bc55c['shift']());}catch(_0x90e21d){_0x5bc55c['push'](_0x5bc55c['shift']());}}}(a149_0x3138,0xefc7a));function a149_0x3138(){const _0x488d2b=['behaviors','schema','scheduleOption','test','engine:','events','YAML\x20config\x20missing\x20required\x20field:\x20name','realtime.attributes[','isArray','711221mxiYsR',']:\x20Missing\x20required\x20field\x20\x27name\x27','1496202UAEFZJ','parentTableName','parent_key','5417835sXZyjq','scheduleType','customer_id','customerGroupAttributes','join','Example\x20Attributes','type','user_id','4xbzqyC','parentDatabaseName','attributes','UTC','imported_batch','child_key','1762890unsldw','attribute_table','none','):\x20Invalid\x20type\x20\x27','personalization_services:','hive_only','stringify','groupingName','parentKey','parse','realtime.events[','number','realtime','padStart','label','split','schedule','set','values','personalization_services','customerGroup','default_time_filter','source','includes','filters','id_stitching','columns','workflowHiveOnly','allColumns',':00','03:00','name','forEach','isRealtime',':00:00','timezone','ordered_set','12306609iOQMTM','audienceFilters','database','master:','parentColumn','column','foreignKey','replace','YAML\x20config\x20missing\x20required\x20field:\x20master.table','primary_key','time','40oNOucW','5kZSztf','customer_group','string','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','Display\x20Name','description','counter','all_columns','behaviors:','table','engine','daily','single','realtime:','66vbNwEv','null','151638KNYyvV','trino_pool','map','column_name','personalization_services[','push','columnName','prestoPoolName','master','hivePoolName','customerGroupBehaviors','events_table',']\x20(','918661byFaZN','length'];a149_0x3138=function(){return _0x488d2b;};return a149_0x3138();}import*as a149_0x46f24f from'yaml';function formatScheduleTime(_0x2a31c7){const _0x4f0ac3=a149_0x498f;if(typeof _0x2a31c7===_0x4f0ac3(0x119)){const _0x1dfd04=Math['floor'](_0x2a31c7);return String(_0x1dfd04)[_0x4f0ac3(0x11b)](0x2,'0')+_0x4f0ac3(0xc4);}if(typeof _0x2a31c7===_0x4f0ac3(0xd5)){if(/^\d{2}:\d{2}:\d{2}$/['test'](_0x2a31c7))return _0x2a31c7;if(/^\d{1,2}:\d{2}$/[_0x4f0ac3(0xf5)](_0x2a31c7)){const [_0x31788f,_0x3cbcde]=_0x2a31c7[_0x4f0ac3(0xb1)](':');return _0x31788f[_0x4f0ac3(0x11b)](0x2,'0')+':'+_0x3cbcde+_0x4f0ac3(0xbf);}const _0xa52377=parseInt(_0x2a31c7,0xa);if(!isNaN(_0xa52377)&&_0x2a31c7['match'](/^\d+$/))return String(_0xa52377)['padStart'](0x2,'0')+_0x4f0ac3(0xc4);return _0x2a31c7;}return String(_0x2a31c7);}export function apiToDef(_0x41e519){const _0x3f6e42=a149_0x498f,_0x33e2d7={'database':_0x41e519[_0x3f6e42(0xeb)]?.[_0x3f6e42(0x109)]||'','table':_0x41e519['master']?.[_0x3f6e42(0xfe)]||''};_0x41e519['audienceFilters']&&_0x41e519[_0x3f6e42(0xc8)]['length']>0x0&&(_0x33e2d7[_0x3f6e42(0xba)]=_0x41e519[_0x3f6e42(0xc8)][_0x3f6e42(0xe5)](_0x188c40=>({'column':_0x188c40[_0x3f6e42(0xe9)],'values':_0x188c40['rightValues']})));let _0x1075b2;_0x41e519[_0x3f6e42(0x101)]&&_0x41e519[_0x3f6e42(0x101)]!==_0x3f6e42(0x110)&&(_0x1075b2={'type':_0x41e519[_0x3f6e42(0x101)]},_0x41e519['scheduleOption']&&(_0x1075b2[_0x3f6e42(0xd1)]=formatScheduleTime(_0x41e519[_0x3f6e42(0xf4)])),_0x41e519[_0x3f6e42(0xc5)]&&(_0x1075b2[_0x3f6e42(0xc5)]=_0x41e519[_0x3f6e42(0xc5)]));let _0x5af7c3;(_0x41e519['workflowHiveOnly']||_0x41e519[_0x3f6e42(0xec)]||_0x41e519['prestoPoolName'])&&(_0x5af7c3={},_0x41e519[_0x3f6e42(0xbd)]&&(_0x5af7c3[_0x3f6e42(0x113)]=_0x41e519[_0x3f6e42(0xbd)]),_0x41e519['hivePoolName']&&(_0x5af7c3['hive_pool']=_0x41e519[_0x3f6e42(0xec)]),_0x41e519[_0x3f6e42(0xea)]&&(_0x5af7c3[_0x3f6e42(0xe4)]=_0x41e519[_0x3f6e42(0xea)]));const _0x17e8e8=_0x41e519[_0x3f6e42(0x10a)]&&_0x41e519[_0x3f6e42(0x10a)][_0x3f6e42(0xf1)]>0x0?groupAttributesBySource(_0x41e519[_0x3f6e42(0x10a)]):undefined,_0x26b3c9=_0x41e519[_0x3f6e42(0xf2)]&&_0x41e519[_0x3f6e42(0xf2)][_0x3f6e42(0xf1)]>0x0?_0x41e519['behaviors'][_0x3f6e42(0xe5)](convertApiBehaviorToYaml):undefined;let _0x699249;_0x41e519['customerGroup']&&(_0x699249={'name':_0x41e519['customerGroup']['name'],'source':{'database':_0x41e519[_0x3f6e42(0xb6)][_0x3f6e42(0x109)],'table':_0x41e519[_0x3f6e42(0xb6)][_0x3f6e42(0xfe)]},'join':{'parent_key':_0x41e519[_0x3f6e42(0xb6)][_0x3f6e42(0xcd)],'child_key':_0x41e519[_0x3f6e42(0xb6)][_0x3f6e42(0x116)]}},_0x41e519[_0x3f6e42(0xb6)][_0x3f6e42(0x103)]&&_0x41e519[_0x3f6e42(0xb6)][_0x3f6e42(0x103)][_0x3f6e42(0xf1)]>0x0&&(_0x699249[_0x3f6e42(0x10a)]=groupAttributesBySource(_0x41e519[_0x3f6e42(0xb6)][_0x3f6e42(0x103)])),_0x41e519[_0x3f6e42(0xb6)][_0x3f6e42(0xed)]&&_0x41e519[_0x3f6e42(0xb6)][_0x3f6e42(0xed)][_0x3f6e42(0xf1)]>0x0&&(_0x699249[_0x3f6e42(0xf2)]=_0x41e519['customerGroup']['customerGroupBehaviors'][_0x3f6e42(0xe5)](convertApiBehaviorToYaml)));const _0x493566={'name':_0x41e519[_0x3f6e42(0xc1)],..._0x41e519[_0x3f6e42(0xd8)]&&{'description':_0x41e519['description']},'master':_0x33e2d7,..._0x1075b2&&{'schedule':_0x1075b2},..._0x5af7c3&&{'engine':_0x5af7c3},..._0x17e8e8&&{'attributes':_0x17e8e8},..._0x26b3c9&&{'behaviors':_0x26b3c9},..._0x699249&&{'customer_group':_0x699249}};return _0x493566;}function groupAttributesBySource(_0x4c4d29){const _0x5681e6=a149_0x498f,_0x46b0dc=new Map();for(const _0x10b7fd of _0x4c4d29){const _0x5dad96=_0x10b7fd[_0x5681e6(0x109)]+'.'+_0x10b7fd['parentTableName']+'.'+_0x10b7fd[_0x5681e6(0x116)]+'.'+_0x10b7fd['foreignKey'];!_0x46b0dc['has'](_0x5dad96)&&_0x46b0dc[_0x5681e6(0xb3)](_0x5dad96,[]),_0x46b0dc['get'](_0x5dad96)['push'](_0x10b7fd);}const _0x33ebe3=[];for(const [,_0x314647]of _0x46b0dc){const _0x5cf0af=_0x314647[0x0],_0x5254e0=_0x5cf0af[_0x5681e6(0x115)]||_0x5cf0af[_0x5681e6(0xfe)];_0x33ebe3[_0x5681e6(0xe8)]({'name':_0x5254e0,'source':{'database':_0x5cf0af['parentDatabaseName'],'table':_0x5cf0af[_0x5681e6(0xfe)]},'join':{'parent_key':_0x5cf0af[_0x5681e6(0xcd)],'child_key':_0x5cf0af[_0x5681e6(0x116)]},'columns':_0x314647[_0x5681e6(0xe5)](_0x26e8c0=>{const _0x34d218=_0x5681e6,_0x59f1e2={'column':_0x26e8c0[_0x34d218(0xcb)],'type':_0x26e8c0[_0x34d218(0x106)]};return _0x26e8c0[_0x34d218(0xc1)]!==_0x26e8c0[_0x34d218(0xcb)]&&(_0x59f1e2['label']=_0x26e8c0[_0x34d218(0xc1)]),_0x59f1e2;})});}return _0x33ebe3;}function convertApiBehaviorToYaml(_0x4b165c){const _0xc4c08e=a149_0x498f,_0x3ef7a2={'name':_0x4b165c['name'],'source':{'database':_0x4b165c[_0xc4c08e(0x109)],'table':_0x4b165c[_0xc4c08e(0xfe)]},'join':{'parent_key':_0x4b165c['foreignKey'],'child_key':_0x4b165c[_0xc4c08e(0x116)]}};if(_0x4b165c[_0xc4c08e(0xbe)])_0x3ef7a2[_0xc4c08e(0xda)]=!![];else _0x4b165c[_0xc4c08e(0xf3)]&&_0x4b165c[_0xc4c08e(0xf3)][_0xc4c08e(0xf1)]>0x0&&(_0x3ef7a2['columns']=_0x4b165c[_0xc4c08e(0xf3)]['map'](_0xcf6082=>{const _0x467778=_0xc4c08e,_0x430a99={'column':_0xcf6082[_0x467778(0xcb)],'type':_0xcf6082[_0x467778(0x106)]};return _0xcf6082['name']!==_0xcf6082[_0x467778(0xcb)]&&(_0x430a99[_0x467778(0x11c)]=_0xcf6082['name']),_0x430a99;}));return _0x4b165c['defaultTimeFilterEnabled']&&(_0x3ef7a2[_0xc4c08e(0xb7)]=_0x4b165c['defaultTimeFilterEnabled']),_0x4b165c['isRealtime']&&(_0x3ef7a2['realtime']=_0x4b165c[_0xc4c08e(0xc3)]),_0x3ef7a2;}export function defToApi(_0xdb8d72){const _0x1c4f9f=a149_0x498f,_0x42a57d={'name':_0xdb8d72[_0x1c4f9f(0xc1)],'master':{'parentDatabaseName':_0xdb8d72[_0x1c4f9f(0xeb)]['database'],'parentTableName':_0xdb8d72['master'][_0x1c4f9f(0xdc)]}};_0xdb8d72['description']&&(_0x42a57d[_0x1c4f9f(0xd8)]=_0xdb8d72[_0x1c4f9f(0xd8)]);_0xdb8d72[_0x1c4f9f(0xeb)]['filters']&&_0xdb8d72[_0x1c4f9f(0xeb)][_0x1c4f9f(0xba)]['length']>0x0&&(_0x42a57d[_0x1c4f9f(0xc8)]=_0xdb8d72[_0x1c4f9f(0xeb)]['filters']['map'](_0x20a0ff=>({'columnName':_0x20a0ff[_0x1c4f9f(0xcc)],'rightValues':_0x20a0ff[_0x1c4f9f(0xb4)]})));_0xdb8d72[_0x1c4f9f(0xb2)]&&(_0x42a57d[_0x1c4f9f(0x101)]=_0xdb8d72[_0x1c4f9f(0xb2)]['type'],_0xdb8d72[_0x1c4f9f(0xb2)][_0x1c4f9f(0xd1)]&&(_0x42a57d[_0x1c4f9f(0xf4)]=_0xdb8d72[_0x1c4f9f(0xb2)][_0x1c4f9f(0xd1)]),_0xdb8d72[_0x1c4f9f(0xb2)][_0x1c4f9f(0xc5)]&&(_0x42a57d[_0x1c4f9f(0xc5)]=_0xdb8d72[_0x1c4f9f(0xb2)][_0x1c4f9f(0xc5)]));_0xdb8d72[_0x1c4f9f(0xdd)]&&(_0xdb8d72[_0x1c4f9f(0xdd)][_0x1c4f9f(0x113)]!==undefined&&(_0x42a57d['workflowHiveOnly']=_0xdb8d72['engine']['hive_only']),_0xdb8d72['engine']['hive_pool']!==undefined&&(_0x42a57d[_0x1c4f9f(0xec)]=_0xdb8d72['engine']['hive_pool']),_0xdb8d72['engine']['trino_pool']!==undefined&&(_0x42a57d['prestoPoolName']=_0xdb8d72[_0x1c4f9f(0xdd)][_0x1c4f9f(0xe4)]));_0xdb8d72['attributes']&&_0xdb8d72[_0x1c4f9f(0x10a)][_0x1c4f9f(0xf1)]>0x0&&(_0x42a57d['attributes']=flattenAttributeGroups(_0xdb8d72[_0x1c4f9f(0x10a)]));_0xdb8d72[_0x1c4f9f(0xf2)]&&_0xdb8d72[_0x1c4f9f(0xf2)][_0x1c4f9f(0xf1)]>0x0&&(_0x42a57d[_0x1c4f9f(0xf2)]=_0xdb8d72[_0x1c4f9f(0xf2)]['map'](convertDefBehaviorToApi));if(_0xdb8d72[_0x1c4f9f(0xd4)]){const _0x10bbd3=_0xdb8d72['customer_group'];_0x42a57d[_0x1c4f9f(0xb6)]={'name':_0x10bbd3['name'],'parentDatabaseName':_0x10bbd3['source'][_0x1c4f9f(0xc9)],'parentTableName':_0x10bbd3[_0x1c4f9f(0xb8)][_0x1c4f9f(0xdc)],'parentKey':_0x10bbd3[_0x1c4f9f(0x104)]['child_key'],'foreignKey':_0x10bbd3['join']['parent_key']},_0x10bbd3[_0x1c4f9f(0x10a)]&&_0x10bbd3[_0x1c4f9f(0x10a)][_0x1c4f9f(0xf1)]>0x0&&(_0x42a57d['customerGroup'][_0x1c4f9f(0x103)]=flattenAttributeGroups(_0x10bbd3[_0x1c4f9f(0x10a)])[_0x1c4f9f(0xe5)](_0x219d68=>({'name':_0x219d68[_0x1c4f9f(0xc1)],'type':_0x219d68[_0x1c4f9f(0x106)],'parentDatabaseName':_0x219d68['parentDatabaseName'],'parentTableName':_0x219d68[_0x1c4f9f(0xfe)],'parentColumn':_0x219d68[_0x1c4f9f(0xcb)],'parentKey':_0x219d68[_0x1c4f9f(0x116)],'foreignKey':_0x219d68[_0x1c4f9f(0xcd)]}))),_0x10bbd3[_0x1c4f9f(0xf2)]&&_0x10bbd3[_0x1c4f9f(0xf2)][_0x1c4f9f(0xf1)]>0x0&&(_0x42a57d[_0x1c4f9f(0xb6)][_0x1c4f9f(0xed)]=_0x10bbd3['behaviors'][_0x1c4f9f(0xe5)](_0x5a8f29=>({'name':_0x5a8f29[_0x1c4f9f(0xc1)],'parentDatabaseName':_0x5a8f29[_0x1c4f9f(0xb8)][_0x1c4f9f(0xc9)],'parentTableName':_0x5a8f29[_0x1c4f9f(0xb8)][_0x1c4f9f(0xdc)],'parentKey':_0x5a8f29[_0x1c4f9f(0x104)][_0x1c4f9f(0x10d)],'foreignKey':_0x5a8f29[_0x1c4f9f(0x104)][_0x1c4f9f(0xff)],'allColumns':_0x5a8f29[_0x1c4f9f(0xda)],'schema':_0x5a8f29['columns']?.[_0x1c4f9f(0xe5)](_0x3491fa=>({'name':_0x3491fa['label']||_0x3491fa[_0x1c4f9f(0xcc)],'type':_0x3491fa[_0x1c4f9f(0x106)],'parentColumn':_0x3491fa[_0x1c4f9f(0xcc)]}))})));}return _0x42a57d;}function flattenAttributeGroups(_0x35fc43){const _0x1bf5e8=a149_0x498f,_0x5ae8c5=[];for(const _0x57893a of _0x35fc43){for(const _0x2037b7 of _0x57893a[_0x1bf5e8(0xbc)]){_0x5ae8c5[_0x1bf5e8(0xe8)]({'name':_0x2037b7[_0x1bf5e8(0x11c)]||_0x2037b7['column'],'type':_0x2037b7[_0x1bf5e8(0x106)],'parentDatabaseName':_0x57893a[_0x1bf5e8(0xb8)][_0x1bf5e8(0xc9)],'parentTableName':_0x57893a[_0x1bf5e8(0xb8)]['table'],'parentColumn':_0x2037b7[_0x1bf5e8(0xcc)],'parentKey':_0x57893a[_0x1bf5e8(0x104)][_0x1bf5e8(0x10d)],'foreignKey':_0x57893a[_0x1bf5e8(0x104)][_0x1bf5e8(0xff)],'groupingName':_0x57893a[_0x1bf5e8(0xc1)]});}}return _0x5ae8c5;}function a149_0x498f(_0x53a6be,_0x3eab7c){_0x53a6be=_0x53a6be-0xb1;const _0x313894=a149_0x3138();let _0x498f00=_0x313894[_0x53a6be];return _0x498f00;}function convertDefBehaviorToApi(_0x3c3718){const _0x57700c=a149_0x498f,_0x4de3b6={'name':_0x3c3718[_0x57700c(0xc1)],'parentDatabaseName':_0x3c3718[_0x57700c(0xb8)][_0x57700c(0xc9)],'parentTableName':_0x3c3718[_0x57700c(0xb8)]['table'],'parentKey':_0x3c3718[_0x57700c(0x104)][_0x57700c(0x10d)],'foreignKey':_0x3c3718['join']['parent_key']};if(_0x3c3718[_0x57700c(0xda)])_0x4de3b6[_0x57700c(0xbe)]=!![];else _0x3c3718['columns']&&_0x3c3718['columns'][_0x57700c(0xf1)]>0x0&&(_0x4de3b6[_0x57700c(0xf3)]=_0x3c3718[_0x57700c(0xbc)][_0x57700c(0xe5)](_0x5a5b1e=>({'name':_0x5a5b1e['label']||_0x5a5b1e[_0x57700c(0xcc)],'type':_0x5a5b1e[_0x57700c(0x106)],'parentColumn':_0x5a5b1e[_0x57700c(0xcc)]})));return _0x3c3718[_0x57700c(0xb7)]!==undefined&&(_0x4de3b6['defaultTimeFilterEnabled']=_0x3c3718[_0x57700c(0xb7)]),_0x3c3718['realtime']!==undefined&&(_0x4de3b6[_0x57700c(0xc3)]=_0x3c3718['realtime']),_0x4de3b6;}export function serializeDef(_0x2a7402){const _0x581e13=a149_0x498f,_0x1200a2=JSON[_0x581e13(0x117)](JSON[_0x581e13(0x114)](_0x2a7402)),_0x43e84d=a149_0x46f24f['stringify'](_0x1200a2,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x581e13(0xe2)}),_0x216acb=[_0x581e13(0xca),'schedule:',_0x581e13(0xf6),'attributes:',_0x581e13(0xdb),'customer_group:',_0x581e13(0xe0),_0x581e13(0x112)];let _0xfc5c9b=_0x43e84d;for(const _0x5d09d4 of _0x216acb){_0xfc5c9b=_0xfc5c9b[_0x581e13(0xce)](new RegExp('^('+_0x5d09d4+')','m'),(_0x435dcf,_0x18c12d,_0x494dda)=>{if(_0x494dda===0x0||_0xfc5c9b[_0x494dda-0x1]==='\x0a'&&_0xfc5c9b[_0x494dda-0x2]==='\x0a')return _0x18c12d;return'\x0a'+_0x18c12d;});}return _0xfc5c9b;}export function parseDef(_0x1094ed){const _0x345013=a149_0x498f,_0x41570f=a149_0x46f24f['parse'](_0x1094ed);if(!_0x41570f['name'])throw new Error(_0x345013(0xf8));if(!_0x41570f[_0x345013(0xeb)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master');if(!_0x41570f[_0x345013(0xeb)]['database'])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x41570f['master']['table'])throw new Error(_0x345013(0xcf));return _0x41570f[_0x345013(0x11a)]&&validateRealtimeSection(_0x41570f[_0x345013(0x11a)]),_0x41570f[_0x345013(0xb5)]&&validatePersonalizationServices(_0x41570f[_0x345013(0xb5)]),_0x41570f;}function validateRealtimeSection(_0x98f500){const _0x240ef3=a149_0x498f,_0x451d3f=[_0x240ef3(0xdf),_0x240ef3(0xd9),_0x240ef3(0xb3),_0x240ef3(0xc6),'list',_0x240ef3(0x10c)];_0x98f500[_0x240ef3(0xf7)]&&Array['isArray'](_0x98f500[_0x240ef3(0xf7)])&&_0x98f500['events']['forEach']((_0x23740f,_0xaf0035)=>{const _0x4e57f3=_0x240ef3;if(!_0x23740f[_0x4e57f3(0xc1)])throw new Error(_0x4e57f3(0x118)+_0xaf0035+_0x4e57f3(0xfc));});_0x98f500[_0x240ef3(0x10a)]&&Array[_0x240ef3(0xfa)](_0x98f500[_0x240ef3(0x10a)])&&_0x98f500[_0x240ef3(0x10a)][_0x240ef3(0xc2)]((_0x4594cb,_0x535245)=>{const _0x44b928=_0x240ef3;if(!_0x4594cb[_0x44b928(0xc1)])throw new Error(_0x44b928(0xf9)+_0x535245+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x4594cb[_0x44b928(0x106)]&&!_0x451d3f[_0x44b928(0xb9)](_0x4594cb[_0x44b928(0x106)]))throw new Error(_0x44b928(0xf9)+_0x535245+_0x44b928(0xef)+_0x4594cb[_0x44b928(0xc1)]+_0x44b928(0x111)+_0x4594cb[_0x44b928(0x106)]+'\x27.\x20Must\x20be\x20one\x20of:\x20'+_0x451d3f[_0x44b928(0x104)](',\x20'));});if(_0x98f500[_0x240ef3(0xbb)]){if(!_0x98f500[_0x240ef3(0xbb)][_0x240ef3(0xd0)])throw new Error(_0x240ef3(0xd6));}}function validatePersonalizationServices(_0x1df934){const _0x3b0b7a=a149_0x498f;if(!Array[_0x3b0b7a(0xfa)](_0x1df934))throw new Error('personalization_services\x20must\x20be\x20an\x20array');_0x1df934[_0x3b0b7a(0xc2)]((_0x1e9294,_0x166b47)=>{const _0x4e1a56=_0x3b0b7a;if(!_0x1e9294['name'])throw new Error(_0x4e1a56(0xe7)+_0x166b47+_0x4e1a56(0xfc));});}export function generateTemplate(_0x4a86a9,_0x30c802,_0x58e566){const _0x44f08d=a149_0x498f,_0x2fc697={'name':_0x4a86a9,'description':'Parent\x20segment\x20description','master':{'database':_0x30c802,'table':_0x58e566},'schedule':{'type':_0x44f08d(0xde),'time':_0x44f08d(0xc0),'timezone':_0x44f08d(0x10b)},'attributes':[{'name':_0x44f08d(0x105),'source':{'database':_0x30c802,'table':_0x44f08d(0x10f)},'join':{'parent_key':'id','child_key':_0x44f08d(0x102)},'columns':[{'column':_0x44f08d(0xe6),'label':_0x44f08d(0xd7),'type':_0x44f08d(0xd5)}]}],'behaviors':[{'name':'Example\x20Events','source':{'database':_0x30c802,'table':_0x44f08d(0xee)},'join':{'parent_key':_0x44f08d(0x107),'child_key':_0x44f08d(0x102)},'all_columns':!![]}]};return serializeDef(_0x2fc697);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a150_0x13d0(_0x2ff5be,_0x51171e){_0x2ff5be=_0x2ff5be-0xcf;const _0x20eb10=a150_0x20eb();let _0x13d079=_0x20eb10[_0x2ff5be];return _0x13d079;}(function(_0x36d688,_0x3cbe0c){const _0x561286=a150_0x13d0,_0x178f36=_0x36d688();while(!![]){try{const _0x3266d8=parseInt(_0x561286(0xfe))/0x1*(-parseInt(_0x561286(0xd8))/0x2)+-parseInt(_0x561286(0x117))/0x3+-parseInt(_0x561286(0xed))/0x4*(-parseInt(_0x561286(0xf4))/0x5)+parseInt(_0x561286(0x106))/0x6+-parseInt(_0x561286(0x112))/0x7*(-parseInt(_0x561286(0xe9))/0x8)+parseInt(_0x561286(0xeb))/0x9*(-parseInt(_0x561286(0xf8))/0xa)+parseInt(_0x561286(0x107))/0xb*(parseInt(_0x561286(0xd3))/0xc);if(_0x3266d8===_0x3cbe0c)break;else _0x178f36['push'](_0x178f36['shift']());}catch(_0x51ae72){_0x178f36['push'](_0x178f36['shift']());}}}(a150_0x20eb,0x891c2));import a150_0x4cf585 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';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a150_0x43da1e,normalizeJourneyDef,parseYamlString as a150_0x59603f}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';function a150_0x20eb(){const _0x27ce76=['buildIdToEmailMap','slice','210GWtSyT','Fetching\x20segments,\x20folders,\x20and\x20journeys','connection','get','1810kBZQCK','journeyBundleName','size','Processing\x20journey:\x20','set','hasChanges','797734xBMUml','listSegments','journey','Resolving\x20parent\x20segment','filter','listFolders','from','activationParams','3679542bmBNmY','22MRkPOK','utf-8','audienceId','has','segmentFolderId','relative','toLowerCase','segment','getParent','getActivation','name','152649LnobMn','all','resolveParentId','values','map','2170212RXLDwI','buildIdToNameMap','update','segments/','attributes','7640688RlKbzx','user','rule','join','updatedAt','2hLdIGB','data','createdAt','versionNumber','isNew','parentFolder','getJourney','folderId','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','description','journeyBundleId','reduce','kind','add','targetResourceName','.yml','getSegment','176NbXjDm','push','53217zjTNYY','Fetching\x20parent\x20segment\x20info','74908JqPzcE','sort','activation_','length','Fetching\x20activations'];a150_0x20eb=function(){return _0x27ce76;};return a150_0x20eb();}import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x2f196f,_0xae6db9,_0x3d81f9){const _0x450326=a150_0x13d0,_0x762bef=a150_0x4cf585[_0x450326(0x10c)](_0x3d81f9,_0x2f196f);if(existsSync(_0x2f196f)){const _0x29f9b6=readFileSync(_0x2f196f,'utf-8'),_0x1e20d7=generateDiff(_0x29f9b6,_0xae6db9),_0x2b72c5=hasChanges(_0x1e20d7);return{'relativePath':_0x762bef,'absolutePath':_0x2f196f,'content':_0xae6db9,'isNew':![],'hasChanges':_0x2b72c5,'diff':_0x2b72c5?formatDiffWithColors(_0x1e20d7):undefined};}return{'relativePath':_0x762bef,'absolutePath':_0x2f196f,'content':_0xae6db9,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x268b1d,_0x5dbb7b,_0x3d9fa2){const _0x4b39db=a150_0x13d0,_0x10fb95=_0x268b1d+':'+_0x5dbb7b,_0x5d03c3=_0x3d9fa2[_0x4b39db(0xf7)](_0x10fb95)||0x0;_0x3d9fa2['set'](_0x10fb95,_0x5d03c3+0x1);if(_0x5d03c3===0x0)return _0x5dbb7b;return _0x5dbb7b+'_'+(_0x5d03c3+0x1);}export async function pullSegments(_0x359221,_0x2cb6c8,_0x251746={}){const _0x44cdac=a150_0x13d0,{targetDir:_0x56b603,progress:_0xc9e887}=_0x251746;_0xc9e887?.[_0x44cdac(0xd0)](_0x44cdac(0x101));const _0x34fbd3=await _0x359221[_0x44cdac(0x10e)][_0x44cdac(0x114)](_0x2cb6c8);_0xc9e887?.[_0x44cdac(0xd0)](_0x44cdac(0xec));const _0x29cffe=await _0x359221[_0x44cdac(0x10e)][_0x44cdac(0x10f)](_0x34fbd3),_0x61c020=_0x29cffe[_0x44cdac(0xd2)][_0x44cdac(0x111)];_0xc9e887?.[_0x44cdac(0xd0)](_0x44cdac(0xf5));const [_0x52ffc3,_0x25e550,_0x2dd62c]=await Promise[_0x44cdac(0x113)]([_0x359221[_0x44cdac(0x10e)][_0x44cdac(0xff)](_0x34fbd3),_0x359221['segment'][_0x44cdac(0x103)](_0x34fbd3),_0x359221[_0x44cdac(0x100)]['listJourneysWithDetailsFromParentSegment'](_0x34fbd3,{'includeAllVersions':!![]})]),{journeys:_0x4c52d3,activationStepsById:_0x660cb2}=_0x2dd62c,_0x2ac052=new Map();for(const _0x305635 of _0x4c52d3){_0x2ac052[_0x44cdac(0xfc)](_0x305635['id'],_0x305635);}const _0x5ed065=_0x4c52d3[_0x44cdac(0x116)](_0x1b4398=>({'id':_0x1b4398['id'],'name':_0x1b4398[_0x44cdac(0xd2)]['name'],'journeyBundleName':_0x1b4398['attributes'][_0x44cdac(0xf9)]||'','journeyBundleId':_0x1b4398['attributes'][_0x44cdac(0xe2)]||'','versionNumber':_0x1b4398['attributes'][_0x44cdac(0xdb)],'description':_0x1b4398['attributes'][_0x44cdac(0xe1)],'state':_0x1b4398['attributes']['state'],'paused':_0x1b4398[_0x44cdac(0xd2)]['paused'],'audienceId':_0x1b4398[_0x44cdac(0xd2)][_0x44cdac(0x109)],'folderId':_0x1b4398['relationships']?.[_0x44cdac(0xdd)]?.[_0x44cdac(0xd9)]?.['id'],'createdAt':_0x1b4398[_0x44cdac(0xd2)][_0x44cdac(0xda)],'updatedAt':_0x1b4398['attributes'][_0x44cdac(0xd7)]})),_0x5291a2=buildFolderIdToPathMap(_0x25e550),_0x456abd=_0x56b603||_0x44cdac(0xd1)+sanitizeFileName(_0x61c020);_0xc9e887?.[_0x44cdac(0xd0)](_0x44cdac(0xf1));const _0x41bef5=new Map();await batchAsync(_0x52ffc3,async _0xcf5d8d=>{const _0x303d91=await _0x359221['segment']['listActivations'](_0x34fbd3,_0xcf5d8d['id']);_0x41bef5['set'](_0xcf5d8d['id'],_0x303d91);}),_0xc9e887?.[_0x44cdac(0xd0)]('Fetching\x20users\x20and\x20connections');const [_0x262e81,_0x5cf64c]=await Promise[_0x44cdac(0x113)]([_0x359221[_0x44cdac(0xd4)][_0x44cdac(0xf2)](),_0x359221[_0x44cdac(0xf6)][_0x44cdac(0xcf)]()]),_0x44ebc8=[],_0x46e3b7=new Map(),_0x3c9560=a150_0x4cf585[_0x44cdac(0xd6)](_0x456abd,'tdx.json'),_0x1d09d5=createTdxConfigContent(_0x61c020);_0x44ebc8[_0x44cdac(0xea)](prepareFile(_0x3c9560,_0x1d09d5,_0x456abd));const _0x245b04=new Map();for(const _0x5d5490 of _0x52ffc3){_0x245b04['set'](_0x5d5490['id'],_0x5d5490);}let _0xbc0463=_0x52ffc3;if(_0x251746[_0x44cdac(0xe6)]){const _0x47c9de=_0x52ffc3[_0x44cdac(0x102)](_0x455fcb=>_0x455fcb[_0x44cdac(0x111)][_0x44cdac(0x10d)]()===_0x251746[_0x44cdac(0xe6)][_0x44cdac(0x10d)]());_0x47c9de[_0x44cdac(0xf0)]>0x0&&(_0xbc0463=_0x47c9de);}_0xc9e887?.[_0x44cdac(0xd0)]('Processing\x20segments');for(const _0x30ac5a of _0xbc0463){if(_0x30ac5a[_0x44cdac(0xe4)]===SEGMENT_KIND_JOURNEY)continue;const _0x59047e=_0x30ac5a[_0x44cdac(0x10b)]?_0x5291a2[_0x44cdac(0xf7)](_0x30ac5a[_0x44cdac(0x10b)])||'':'',_0x3b8f57=_0x41bef5[_0x44cdac(0xf7)](_0x30ac5a['id'])||[],_0x3f1306=segmentWithActivationsToYaml(_0x30ac5a,_0x3b8f57,undefined,_0x262e81,_0x5cf64c),_0xb72beb=_0x59047e?a150_0x4cf585[_0x44cdac(0xd6)](_0x456abd,_0x59047e):_0x456abd,_0x2db0f4=sanitizeFileName(_0x30ac5a['name']),_0x5cfe56=getUniqueFileName(_0xb72beb,_0x2db0f4,_0x46e3b7),_0x1bdbe4=a150_0x4cf585[_0x44cdac(0xd6)](_0xb72beb,_0x5cfe56+'.yml'),_0x518834=segmentToYamlString(_0x3f1306);_0x44ebc8['push'](prepareFile(_0x1bdbe4,_0x518834,_0x456abd));}const _0x51b023=new Map();for(const _0x25d424 of _0x5ed065){const _0x50d897=_0x25d424[_0x44cdac(0xe2)];!_0x51b023['has'](_0x50d897)&&_0x51b023['set'](_0x50d897,[]),_0x51b023[_0x44cdac(0xf7)](_0x50d897)['push'](_0x25d424);}for(const _0x4e904f of _0x51b023['values']()){_0x4e904f[_0x44cdac(0xee)]((_0x27e6ba,_0xbcc5d7)=>(_0x27e6ba[_0x44cdac(0xdb)]||0x0)-(_0xbcc5d7[_0x44cdac(0xdb)]||0x0));}if(_0x251746[_0x44cdac(0xe6)]){const _0x158eac=new Map();for(const [_0x5651fe,_0x899cf8]of _0x51b023){const _0x428156=_0x899cf8[0x0]['journeyBundleName'];if(_0x428156[_0x44cdac(0x10d)]()===_0x251746[_0x44cdac(0xe6)][_0x44cdac(0x10d)]()){_0x158eac['set'](_0x5651fe,_0x899cf8);break;}}_0x51b023['clear']();for(const [_0x5e2538,_0x2f4462]of _0x158eac){_0x51b023['set'](_0x5e2538,_0x2f4462);}}if(_0x51b023[_0x44cdac(0xfa)]>0x0){_0xc9e887?.[_0x44cdac(0xd0)]('Processing\x20journeys');const _0x1cfd9e=Array[_0x44cdac(0x104)](_0x51b023['values']()),_0x14cdb5=0x5,{createYamlContext:_0x41288b}=createYamlContextForBundle(_0x359221,_0x245b04,_0x262e81,_0x5cf64c,_0x660cb2,_0x2ac052);for(let _0x507b91=0x0;_0x507b91<_0x1cfd9e[_0x44cdac(0xf0)];_0x507b91+=_0x14cdb5){const _0xbf1c62=_0x1cfd9e[_0x44cdac(0xf3)](_0x507b91,_0x507b91+_0x14cdb5),_0x37a670=await Promise[_0x44cdac(0x113)](_0xbf1c62[_0x44cdac(0x116)](async _0x378ae3=>{const _0x199b78=_0x44cdac,_0x8b532c=_0x378ae3[0x0],_0x25f267=_0x8b532c[_0x199b78(0xf9)];_0xc9e887?.['update'](_0x199b78(0xfb)+_0x25f267);const _0x23b725=_0x8b532c[_0x199b78(0xdf)]?_0x5291a2[_0x199b78(0xf7)](_0x8b532c['folderId'])||'':'',_0x4d6d16=_0x23b725?a150_0x4cf585[_0x199b78(0xd6)](_0x456abd,_0x23b725):_0x456abd,_0x486889=sanitizeFileName(_0x25f267),_0x40c29f=a150_0x4cf585[_0x199b78(0xd6)](_0x4d6d16,_0x486889+_0x199b78(0xe7));let _0x38ce84;if(existsSync(_0x40c29f))try{const _0x48eab4=readFileSync(_0x40c29f,_0x199b78(0x108)),_0x39b323=a150_0x59603f(_0x48eab4);_0x38ce84=buildLocalRuleToNameMappingFromJourney(_0x39b323);}catch{}const _0xaf48eb=[];for(const _0xc45c07 of _0x378ae3){const _0x2564c3=_0x2ac052[_0x199b78(0xf7)](_0xc45c07['id']);if(!_0x2564c3){_0xc9e887?.[_0x199b78(0xd0)]('Warning:\x20Journey\x20'+_0xc45c07['id']+_0x199b78(0xe0));continue;}const _0x225289=_0x2564c3[_0x199b78(0xd2)]?.[_0x199b78(0x109)],_0x9a673e=_0x41288b(_0xc45c07['id'],_0x225289),_0xdf6fd2=await journeyResponseToDef(_0x2564c3,_0x9a673e);_0xaf48eb[_0x199b78(0xea)]({'item':_0xc45c07,'yaml':_0xdf6fd2});}const _0x144eb5=await _0x359221[_0x199b78(0x100)]['getLatestJourneyId'](_0x8b532c[_0x199b78(0xe2)]),_0x12f26c=buildMergedJourneyDef(_0xaf48eb,_0x38ce84,_0x144eb5);return{'bundleName':_0x25f267,'folderPath':_0x23b725,'finalYaml':_0x12f26c};}));for(const {bundleName:_0x451292,folderPath:_0x48e2a8,finalYaml:_0x43e166}of _0x37a670){const _0x4dbb57=normalizeJourneyDef(_0x43e166),_0x103d23=a150_0x43da1e(_0x4dbb57),_0x56f57d=_0x48e2a8?a150_0x4cf585[_0x44cdac(0xd6)](_0x456abd,_0x48e2a8):_0x456abd,_0x3bca43=sanitizeFileName(_0x451292),_0x551983=getUniqueFileName(_0x56f57d,_0x3bca43,_0x46e3b7),_0x24c923=a150_0x4cf585[_0x44cdac(0xd6)](_0x56f57d,_0x551983+'.yml');_0x44ebc8[_0x44cdac(0xea)](prepareFile(_0x24c923,_0x103d23,_0x456abd));}}}const _0x572b94=Array[_0x44cdac(0x104)](_0x41bef5['values']())[_0x44cdac(0xe3)]((_0x392f1c,_0x40cee6)=>_0x392f1c+_0x40cee6[_0x44cdac(0xf0)],0x0),_0x39cb85=_0xbc0463[_0x44cdac(0x102)](_0x3c829c=>_0x3c829c[_0x44cdac(0xe4)]!==SEGMENT_KIND_JOURNEY),_0x5de181=_0x44ebc8[_0x44cdac(0x102)](_0x549813=>_0x549813[_0x44cdac(0xdc)])[_0x44cdac(0xf0)],_0x1accb0=_0x44ebc8[_0x44cdac(0x102)](_0x56e8b9=>!_0x56e8b9[_0x44cdac(0xdc)]&&_0x56e8b9[_0x44cdac(0xfd)])[_0x44cdac(0xf0)],_0x5b4169=_0x44ebc8['filter'](_0x5a8df0=>!_0x5a8df0['isNew']&&!_0x5a8df0['hasChanges'])[_0x44cdac(0xf0)],_0x12585f=Array[_0x44cdac(0x104)](_0x51b023[_0x44cdac(0x115)]())[_0x44cdac(0xe3)]((_0x3b59f2,_0x32c35d)=>_0x3b59f2+_0x32c35d[_0x44cdac(0xf0)],0x0);return{'parentName':_0x61c020,'parentId':_0x34fbd3,'targetDir':_0x456abd,'files':_0x44ebc8,'counts':{'segments':_0x39cb85[_0x44cdac(0xf0)],'journeys':_0x51b023['size'],'journeyVersions':_0x12585f,'activations':_0x572b94},'newFiles':_0x5de181,'changedFiles':_0x1accb0,'unchangedFiles':_0x5b4169};}function createYamlContextForBundle(_0x2093dc,_0x4ddc64,_0x47cc21,_0x21f0b9,_0x51e61e,_0xee91b){const _0x335e9b=new Set(),_0x2ffa69=new Map(),_0x65d112=new Map(),_0x467729=createJumpTargetCache(),_0x525abc=async(_0x45cc67,_0x54eb9f)=>{const _0x5db212=a150_0x13d0,_0x2091c2=_0x2ffa69[_0x5db212(0xf7)](_0x45cc67);if(_0x2091c2!==undefined)return _0x2091c2;if(!_0x54eb9f)return _0x45cc67;try{let _0x1fa08=_0x4ddc64[_0x5db212(0xf7)](_0x45cc67);!_0x1fa08&&(_0x1fa08=await _0x2093dc[_0x5db212(0x10e)][_0x5db212(0xe8)](_0x54eb9f,_0x45cc67),_0x4ddc64['set'](_0x45cc67,_0x1fa08));const _0xdd882f=generateJourneyLocalName(_0x1fa08['name']),_0x139825=_0x1fa08[_0x5db212(0xe4)]===SEGMENT_KIND_JOURNEY&&_0xdd882f!==undefined;if(_0x139825&&_0xdd882f){let _0x42d4de=_0xdd882f,_0x49f500=0x2;while(_0x335e9b[_0x5db212(0x10a)](_0x42d4de)){_0x42d4de=_0xdd882f+'_'+_0x49f500,_0x49f500++;}return _0x335e9b[_0x5db212(0xe5)](_0x42d4de),_0x2ffa69[_0x5db212(0xfc)](_0x45cc67,_0x42d4de),_0x42d4de;}return _0x1fa08['name'];}catch{return _0x45cc67;}},_0x2b5cec=(_0x5a132f,_0x16c3b4)=>({'resolveSegment':async _0x5085ab=>{const _0x34b9e6=a150_0x13d0,_0x349674=_0x2ffa69['get'](_0x5085ab);if(_0x349674!==undefined)return{'name':_0x349674,'isJourneyLocal':!![]};if(!_0x16c3b4)return{'name':_0x5085ab,'isJourneyLocal':![]};try{let _0x519d79=_0x4ddc64['get'](_0x5085ab);!_0x519d79&&(_0x519d79=await _0x2093dc[_0x34b9e6(0x10e)]['getSegment'](_0x16c3b4,_0x5085ab),_0x4ddc64[_0x34b9e6(0xfc)](_0x5085ab,_0x519d79));const _0x1c38e6=generateJourneyLocalName(_0x519d79['name']),_0x4dbbce=_0x519d79[_0x34b9e6(0xe4)]===SEGMENT_KIND_JOURNEY&&_0x1c38e6!==undefined;if(_0x4dbbce&&!_0x519d79[_0x34b9e6(0xd5)]&&_0x16c3b4)try{const _0x314c2a=await _0x2093dc[_0x34b9e6(0x10e)][_0x34b9e6(0xe8)](_0x16c3b4,_0x5085ab);_0x4ddc64[_0x34b9e6(0xfc)](_0x5085ab,_0x314c2a),_0x519d79=_0x314c2a;}catch{}const _0x3f81d2=await _0x525abc(_0x5085ab,_0x16c3b4);let _0x48e225;if(_0x4dbbce&&_0x519d79['rule']){const _0x4461ab=await segmentResponseToDef(_0x519d79,{'resolveSegmentName':_0x573f75=>_0x525abc(_0x573f75,_0x16c3b4)});_0x48e225={'description':_0x519d79['description'],'rule':_0x4461ab[_0x34b9e6(0xd5)]};}return{'name':_0x3f81d2,'isJourneyLocal':_0x4dbbce,'definition':_0x48e225};}catch{return{'name':_0x5085ab,'isJourneyLocal':![]};}},'resolveActivation':async _0x49de15=>{const _0x3e8a2d=a150_0x13d0,_0x653eb4=_0x65d112[_0x3e8a2d(0xf7)](_0x49de15);if(_0x653eb4!==undefined)return{'name':_0x653eb4,'isJourneyLocal':!![]};try{let _0x1ed793=_0x51e61e['get'](_0x49de15);!_0x1ed793&&(_0x1ed793=await _0x2093dc[_0x3e8a2d(0x100)][_0x3e8a2d(0x110)](_0x5a132f,_0x49de15));const _0x45996b=_0x1ed793['attributes'][_0x3e8a2d(0x105)][_0x3e8a2d(0x111)]||_0x49de15,_0x477f76=sanitizeYamlKey(_0x45996b)||_0x3e8a2d(0xef)+_0x49de15,_0x341bd7=_0x477f76;_0x65d112['set'](_0x49de15,_0x341bd7);const _0x476f66=journeyActivationStepToYaml(_0x1ed793,_0x47cc21,_0x21f0b9);return{'name':_0x341bd7,'isJourneyLocal':!![],'definition':_0x476f66};}catch{return{'name':_0x49de15,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x24da03,_0x2bd939)=>resolveJumpTarget(_0x24da03,_0x2bd939,_0x467729,async _0x35a982=>{const _0x221011=a150_0x13d0,_0x218823=_0xee91b[_0x221011(0xf7)](_0x35a982);if(_0x218823)return _0x218823;return _0x2093dc['journey'][_0x221011(0xde)](_0x35a982);})});return{'createYamlContext':_0x2b5cec};}
|
|
1
|
+
(function(_0x5ebfe2,_0x9c0079){const _0x1a0981=a150_0x4ffd,_0x2057e6=_0x5ebfe2();while(!![]){try{const _0x459da4=parseInt(_0x1a0981(0x15c))/0x1+-parseInt(_0x1a0981(0x137))/0x2*(-parseInt(_0x1a0981(0x13f))/0x3)+parseInt(_0x1a0981(0x166))/0x4+parseInt(_0x1a0981(0x124))/0x5*(parseInt(_0x1a0981(0x14b))/0x6)+-parseInt(_0x1a0981(0x13b))/0x7*(-parseInt(_0x1a0981(0x13a))/0x8)+-parseInt(_0x1a0981(0x163))/0x9+-parseInt(_0x1a0981(0x156))/0xa*(parseInt(_0x1a0981(0x140))/0xb);if(_0x459da4===_0x9c0079)break;else _0x2057e6['push'](_0x2057e6['shift']());}catch(_0x17153a){_0x2057e6['push'](_0x2057e6['shift']());}}}(a150_0x4584,0x4ce13));import a150_0x5c8906 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';function a150_0x4ffd(_0x1d1999,_0x72721c){_0x1d1999=_0x1d1999-0x120;const _0x45846a=a150_0x4584();let _0x4ffde1=_0x45846a[_0x1d1999];return _0x4ffde1;}function a150_0x4584(){const _0x43fc7e=['11869KvpuLL','rule','listActivations','createdAt','parentFolder','reduce','filter','utf-8','getParent','map','listSegments','6RKqHPv','push','data','segmentFolderId','relationships','kind','listJourneysWithDetailsFromParentSegment','Fetching\x20segments,\x20folders,\x20and\x20journeys','journeyBundleId','Warning:\x20Journey\x20','state','12110GyujeI','toLowerCase','relative','Processing\x20journeys','from','buildIdToNameMap','85092hIAAKl','getLatestJourneyId','name','connection','size','activation_','getActivation','587502ZNBRzx','targetResourceName','paused','2195212rkpEtS','segment','listFolders','activationParams','set','segments/','isNew','journeyBundleName','update','1174370QAZYGh','versionNumber','clear','tdx.json','audienceId','Processing\x20journey:\x20','getJourney','all','hasChanges','journey','get','join','values','.yml','Processing\x20segments','Fetching\x20users\x20and\x20connections','description','folderId','length','181974cjgVpy','buildIdToEmailMap','attributes','8216StELuy','1855mYPAwp','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','Fetching\x20parent\x20segment\x20info','getSegment','18JaXESE'];a150_0x4584=function(){return _0x43fc7e;};return a150_0x4584();}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_0x24fa9c,normalizeJourneyDef,parseYamlString as a150_0x1f8bda}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(_0x2119bc,_0x1e515c,_0x1d4e17){const _0x470547=a150_0x4ffd,_0x25faf5=a150_0x5c8906[_0x470547(0x158)](_0x1d4e17,_0x2119bc);if(existsSync(_0x2119bc)){const _0x3bcbb5=readFileSync(_0x2119bc,_0x470547(0x147)),_0x5f0b5b=generateDiff(_0x3bcbb5,_0x1e515c),_0x3ce38a=hasChanges(_0x5f0b5b);return{'relativePath':_0x25faf5,'absolutePath':_0x2119bc,'content':_0x1e515c,'isNew':![],'hasChanges':_0x3ce38a,'diff':_0x3ce38a?formatDiffWithColors(_0x5f0b5b):undefined};}return{'relativePath':_0x25faf5,'absolutePath':_0x2119bc,'content':_0x1e515c,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x1bd406,_0x2d321f,_0xbdc490){const _0x2df5c3=a150_0x4ffd,_0x397e37=_0x1bd406+':'+_0x2d321f,_0x3dfc9e=_0xbdc490[_0x2df5c3(0x12e)](_0x397e37)||0x0;_0xbdc490[_0x2df5c3(0x16a)](_0x397e37,_0x3dfc9e+0x1);if(_0x3dfc9e===0x0)return _0x2d321f;return _0x2d321f+'_'+(_0x3dfc9e+0x1);}export async function pullSegments(_0x35c397,_0x3cd258,_0xa03f92={}){const _0x2d04a8=a150_0x4ffd,{targetDir:_0x58fb00,progress:_0x156534}=_0xa03f92;_0x156534?.[_0x2d04a8(0x123)]('Resolving\x20parent\x20segment');const _0x1e55b4=await _0x35c397[_0x2d04a8(0x167)]['resolveParentId'](_0x3cd258);_0x156534?.[_0x2d04a8(0x123)](_0x2d04a8(0x13d));const _0x529b6b=await _0x35c397[_0x2d04a8(0x167)][_0x2d04a8(0x148)](_0x1e55b4),_0xdf8e42=_0x529b6b[_0x2d04a8(0x139)]['name'];_0x156534?.['update'](_0x2d04a8(0x152));const [_0x2da4c0,_0xe86fd3,_0x16d5d8]=await Promise['all']([_0x35c397['segment'][_0x2d04a8(0x14a)](_0x1e55b4),_0x35c397['segment'][_0x2d04a8(0x168)](_0x1e55b4),_0x35c397[_0x2d04a8(0x12d)][_0x2d04a8(0x151)](_0x1e55b4,{'includeAllVersions':!![]})]),{journeys:_0x2fdf3d,activationStepsById:_0xb20175}=_0x16d5d8,_0x441850=new Map();for(const _0x989b40 of _0x2fdf3d){_0x441850[_0x2d04a8(0x16a)](_0x989b40['id'],_0x989b40);}const _0x253c87=_0x2fdf3d[_0x2d04a8(0x149)](_0x52229f=>({'id':_0x52229f['id'],'name':_0x52229f[_0x2d04a8(0x139)]['name'],'journeyBundleName':_0x52229f[_0x2d04a8(0x139)][_0x2d04a8(0x122)]||'','journeyBundleId':_0x52229f['attributes'][_0x2d04a8(0x153)]||'','versionNumber':_0x52229f[_0x2d04a8(0x139)][_0x2d04a8(0x125)],'description':_0x52229f[_0x2d04a8(0x139)]['description'],'state':_0x52229f[_0x2d04a8(0x139)][_0x2d04a8(0x155)],'paused':_0x52229f[_0x2d04a8(0x139)][_0x2d04a8(0x165)],'audienceId':_0x52229f[_0x2d04a8(0x139)][_0x2d04a8(0x128)],'folderId':_0x52229f[_0x2d04a8(0x14f)]?.[_0x2d04a8(0x144)]?.[_0x2d04a8(0x14d)]?.['id'],'createdAt':_0x52229f['attributes'][_0x2d04a8(0x143)],'updatedAt':_0x52229f[_0x2d04a8(0x139)]['updatedAt']})),_0x5a3a3c=buildFolderIdToPathMap(_0xe86fd3),_0x540c19=_0x58fb00||_0x2d04a8(0x120)+sanitizeFileName(_0xdf8e42);_0x156534?.[_0x2d04a8(0x123)]('Fetching\x20activations');const _0x222864=new Map();await batchAsync(_0x2da4c0,async _0x33cf01=>{const _0xd76113=_0x2d04a8,_0x27aab1=await _0x35c397[_0xd76113(0x167)][_0xd76113(0x142)](_0x1e55b4,_0x33cf01['id']);_0x222864[_0xd76113(0x16a)](_0x33cf01['id'],_0x27aab1);}),_0x156534?.[_0x2d04a8(0x123)](_0x2d04a8(0x133));const [_0x52ee7e,_0x5d1864]=await Promise['all']([_0x35c397['user'][_0x2d04a8(0x138)](),_0x35c397[_0x2d04a8(0x15f)][_0x2d04a8(0x15b)]()]),_0x1bb12b=[],_0x529bb3=new Map(),_0x234cc2=a150_0x5c8906['join'](_0x540c19,_0x2d04a8(0x127)),_0x13813a=createTdxConfigContent(_0xdf8e42);_0x1bb12b[_0x2d04a8(0x14c)](prepareFile(_0x234cc2,_0x13813a,_0x540c19));const _0x3233cd=new Map();for(const _0x391288 of _0x2da4c0){_0x3233cd[_0x2d04a8(0x16a)](_0x391288['id'],_0x391288);}let _0x289c78=_0x2da4c0;if(_0xa03f92[_0x2d04a8(0x164)]){const _0x2a9749=_0x2da4c0[_0x2d04a8(0x146)](_0x13cf20=>_0x13cf20[_0x2d04a8(0x15e)]['toLowerCase']()===_0xa03f92[_0x2d04a8(0x164)][_0x2d04a8(0x157)]());_0x2a9749[_0x2d04a8(0x136)]>0x0&&(_0x289c78=_0x2a9749);}_0x156534?.[_0x2d04a8(0x123)](_0x2d04a8(0x132));for(const _0x35d32c of _0x289c78){if(_0x35d32c['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x5a9faf=_0x35d32c['segmentFolderId']?_0x5a3a3c[_0x2d04a8(0x12e)](_0x35d32c[_0x2d04a8(0x14e)])||'':'',_0x51426e=_0x222864[_0x2d04a8(0x12e)](_0x35d32c['id'])||[],_0x37340b=segmentWithActivationsToYaml(_0x35d32c,_0x51426e,undefined,_0x52ee7e,_0x5d1864),_0x6614aa=_0x5a9faf?a150_0x5c8906[_0x2d04a8(0x12f)](_0x540c19,_0x5a9faf):_0x540c19,_0x5b5a62=sanitizeFileName(_0x35d32c[_0x2d04a8(0x15e)]),_0x38055a=getUniqueFileName(_0x6614aa,_0x5b5a62,_0x529bb3),_0x36a425=a150_0x5c8906[_0x2d04a8(0x12f)](_0x6614aa,_0x38055a+_0x2d04a8(0x131)),_0x4b471d=segmentToYamlString(_0x37340b);_0x1bb12b[_0x2d04a8(0x14c)](prepareFile(_0x36a425,_0x4b471d,_0x540c19));}const _0x689e33=new Map();for(const _0x9dc359 of _0x253c87){const _0x101657=_0x9dc359[_0x2d04a8(0x153)];!_0x689e33['has'](_0x101657)&&_0x689e33[_0x2d04a8(0x16a)](_0x101657,[]),_0x689e33['get'](_0x101657)['push'](_0x9dc359);}for(const _0x279ced of _0x689e33['values']()){_0x279ced['sort']((_0x46d813,_0x3aa753)=>(_0x46d813[_0x2d04a8(0x125)]||0x0)-(_0x3aa753[_0x2d04a8(0x125)]||0x0));}if(_0xa03f92[_0x2d04a8(0x164)]){const _0xf93a27=new Map();for(const [_0x46d601,_0x1bffd8]of _0x689e33){const _0x42bea4=_0x1bffd8[0x0][_0x2d04a8(0x122)];if(_0x42bea4[_0x2d04a8(0x157)]()===_0xa03f92[_0x2d04a8(0x164)][_0x2d04a8(0x157)]()){_0xf93a27[_0x2d04a8(0x16a)](_0x46d601,_0x1bffd8);break;}}_0x689e33[_0x2d04a8(0x126)]();for(const [_0x417fdc,_0x62e49a]of _0xf93a27){_0x689e33['set'](_0x417fdc,_0x62e49a);}}if(_0x689e33[_0x2d04a8(0x160)]>0x0){_0x156534?.['update'](_0x2d04a8(0x159));const _0x4cd3d0=Array[_0x2d04a8(0x15a)](_0x689e33[_0x2d04a8(0x130)]()),_0x260129=0x5,{createYamlContext:_0x14df7}=createYamlContextForBundle(_0x35c397,_0x3233cd,_0x52ee7e,_0x5d1864,_0xb20175,_0x441850);for(let _0x1dee47=0x0;_0x1dee47<_0x4cd3d0[_0x2d04a8(0x136)];_0x1dee47+=_0x260129){const _0x5e5941=_0x4cd3d0['slice'](_0x1dee47,_0x1dee47+_0x260129),_0x1b76c9=await Promise[_0x2d04a8(0x12b)](_0x5e5941['map'](async _0x30aa90=>{const _0x2a8d93=_0x2d04a8,_0x3bdb81=_0x30aa90[0x0],_0x40e999=_0x3bdb81[_0x2a8d93(0x122)];_0x156534?.[_0x2a8d93(0x123)](_0x2a8d93(0x129)+_0x40e999);const _0x4a2308=_0x3bdb81[_0x2a8d93(0x135)]?_0x5a3a3c[_0x2a8d93(0x12e)](_0x3bdb81[_0x2a8d93(0x135)])||'':'',_0x5cc3c4=_0x4a2308?a150_0x5c8906[_0x2a8d93(0x12f)](_0x540c19,_0x4a2308):_0x540c19,_0x18ec6c=sanitizeFileName(_0x40e999),_0x18a2f7=a150_0x5c8906[_0x2a8d93(0x12f)](_0x5cc3c4,_0x18ec6c+'.yml');let _0x4cd29e;if(existsSync(_0x18a2f7))try{const _0x26a962=readFileSync(_0x18a2f7,'utf-8'),_0x291173=a150_0x1f8bda(_0x26a962);_0x4cd29e=buildLocalRuleToNameMappingFromJourney(_0x291173);}catch{}const _0x476933=[];for(const _0x19f461 of _0x30aa90){const _0x464d99=_0x441850[_0x2a8d93(0x12e)](_0x19f461['id']);if(!_0x464d99){_0x156534?.[_0x2a8d93(0x123)](_0x2a8d93(0x154)+_0x19f461['id']+_0x2a8d93(0x13c));continue;}const _0xa77b5a=_0x464d99[_0x2a8d93(0x139)]?.[_0x2a8d93(0x128)],_0x4b84f1=_0x14df7(_0x19f461['id'],_0xa77b5a),_0x3b8b2d=await journeyResponseToDef(_0x464d99,_0x4b84f1);_0x476933[_0x2a8d93(0x14c)]({'item':_0x19f461,'yaml':_0x3b8b2d});}const _0x542518=await _0x35c397['journey'][_0x2a8d93(0x15d)](_0x3bdb81['journeyBundleId']),_0x37c150=buildMergedJourneyDef(_0x476933,_0x4cd29e,_0x542518);return{'bundleName':_0x40e999,'folderPath':_0x4a2308,'finalYaml':_0x37c150};}));for(const {bundleName:_0x224d2e,folderPath:_0x284dd6,finalYaml:_0x432ba2}of _0x1b76c9){const _0x4b7dea=normalizeJourneyDef(_0x432ba2),_0x2bda4d=a150_0x24fa9c(_0x4b7dea),_0x1301ce=_0x284dd6?a150_0x5c8906[_0x2d04a8(0x12f)](_0x540c19,_0x284dd6):_0x540c19,_0x1fc5b5=sanitizeFileName(_0x224d2e),_0x303104=getUniqueFileName(_0x1301ce,_0x1fc5b5,_0x529bb3),_0x45a9f0=a150_0x5c8906[_0x2d04a8(0x12f)](_0x1301ce,_0x303104+'.yml');_0x1bb12b['push'](prepareFile(_0x45a9f0,_0x2bda4d,_0x540c19));}}}const _0x3429a1=Array[_0x2d04a8(0x15a)](_0x222864[_0x2d04a8(0x130)]())[_0x2d04a8(0x145)]((_0x34fa41,_0x5325b)=>_0x34fa41+_0x5325b[_0x2d04a8(0x136)],0x0),_0x4cac92=_0x289c78['filter'](_0x14b138=>_0x14b138['kind']!==SEGMENT_KIND_JOURNEY),_0x5f165b=_0x1bb12b[_0x2d04a8(0x146)](_0x3d6a4c=>_0x3d6a4c[_0x2d04a8(0x121)])[_0x2d04a8(0x136)],_0x52864f=_0x1bb12b[_0x2d04a8(0x146)](_0x1d1097=>!_0x1d1097[_0x2d04a8(0x121)]&&_0x1d1097[_0x2d04a8(0x12c)])[_0x2d04a8(0x136)],_0x351ec3=_0x1bb12b[_0x2d04a8(0x146)](_0x54523a=>!_0x54523a['isNew']&&!_0x54523a['hasChanges'])[_0x2d04a8(0x136)],_0x2d170f=Array[_0x2d04a8(0x15a)](_0x689e33[_0x2d04a8(0x130)]())['reduce']((_0x2fa2eb,_0x4d8d8a)=>_0x2fa2eb+_0x4d8d8a['length'],0x0);return{'parentName':_0xdf8e42,'parentId':_0x1e55b4,'targetDir':_0x540c19,'files':_0x1bb12b,'counts':{'segments':_0x4cac92[_0x2d04a8(0x136)],'journeys':_0x689e33[_0x2d04a8(0x160)],'journeyVersions':_0x2d170f,'activations':_0x3429a1},'newFiles':_0x5f165b,'changedFiles':_0x52864f,'unchangedFiles':_0x351ec3};}function createYamlContextForBundle(_0x564562,_0x55defb,_0x2dbd97,_0x2449f9,_0x2e07c8,_0x27ec8d){const _0x5286ab=new Set(),_0x21cd9e=new Map(),_0x1f816e=new Map(),_0x4b9e04=createJumpTargetCache(),_0x23ecfe=async(_0x405792,_0x30afc0)=>{const _0x468120=a150_0x4ffd,_0x5395f1=_0x21cd9e[_0x468120(0x12e)](_0x405792);if(_0x5395f1!==undefined)return _0x5395f1;if(!_0x30afc0)return _0x405792;try{let _0x1d332a=_0x55defb['get'](_0x405792);!_0x1d332a&&(_0x1d332a=await _0x564562[_0x468120(0x167)][_0x468120(0x13e)](_0x30afc0,_0x405792),_0x55defb['set'](_0x405792,_0x1d332a));const _0x29631d=generateJourneyLocalName(_0x1d332a[_0x468120(0x15e)]),_0x1b678d=_0x1d332a[_0x468120(0x150)]===SEGMENT_KIND_JOURNEY&&_0x29631d!==undefined;if(_0x1b678d&&_0x29631d){let _0x5eb99b=_0x29631d,_0x3bcbc6=0x2;while(_0x5286ab['has'](_0x5eb99b)){_0x5eb99b=_0x29631d+'_'+_0x3bcbc6,_0x3bcbc6++;}return _0x5286ab['add'](_0x5eb99b),_0x21cd9e[_0x468120(0x16a)](_0x405792,_0x5eb99b),_0x5eb99b;}return _0x1d332a[_0x468120(0x15e)];}catch{return _0x405792;}},_0x5ead15=(_0x25926a,_0x219714)=>({'resolveSegment':async _0x89223f=>{const _0x262506=a150_0x4ffd,_0x585fcb=_0x21cd9e[_0x262506(0x12e)](_0x89223f);if(_0x585fcb!==undefined)return{'name':_0x585fcb,'isJourneyLocal':!![]};if(!_0x219714)return{'name':_0x89223f,'isJourneyLocal':![]};try{let _0x134ec7=_0x55defb[_0x262506(0x12e)](_0x89223f);!_0x134ec7&&(_0x134ec7=await _0x564562[_0x262506(0x167)][_0x262506(0x13e)](_0x219714,_0x89223f),_0x55defb[_0x262506(0x16a)](_0x89223f,_0x134ec7));const _0x7e2ce5=generateJourneyLocalName(_0x134ec7['name']),_0x11f51b=_0x134ec7[_0x262506(0x150)]===SEGMENT_KIND_JOURNEY&&_0x7e2ce5!==undefined;if(_0x11f51b&&!_0x134ec7[_0x262506(0x141)]&&_0x219714)try{const _0x25c8b5=await _0x564562[_0x262506(0x167)][_0x262506(0x13e)](_0x219714,_0x89223f);_0x55defb[_0x262506(0x16a)](_0x89223f,_0x25c8b5),_0x134ec7=_0x25c8b5;}catch{}const _0x3d7c31=await _0x23ecfe(_0x89223f,_0x219714);let _0x359273;if(_0x11f51b&&_0x134ec7['rule']){const _0x3f25b3=await segmentResponseToDef(_0x134ec7,{'resolveSegmentName':_0x3c1296=>_0x23ecfe(_0x3c1296,_0x219714)});_0x359273={'description':_0x134ec7[_0x262506(0x134)],'rule':_0x3f25b3[_0x262506(0x141)]};}return{'name':_0x3d7c31,'isJourneyLocal':_0x11f51b,'definition':_0x359273};}catch{return{'name':_0x89223f,'isJourneyLocal':![]};}},'resolveActivation':async _0x25906d=>{const _0x4bf9d4=a150_0x4ffd,_0x35915a=_0x1f816e[_0x4bf9d4(0x12e)](_0x25906d);if(_0x35915a!==undefined)return{'name':_0x35915a,'isJourneyLocal':!![]};try{let _0x202512=_0x2e07c8[_0x4bf9d4(0x12e)](_0x25906d);!_0x202512&&(_0x202512=await _0x564562[_0x4bf9d4(0x12d)][_0x4bf9d4(0x162)](_0x25926a,_0x25906d));const _0x4b4d4b=_0x202512[_0x4bf9d4(0x139)][_0x4bf9d4(0x169)][_0x4bf9d4(0x15e)]||_0x25906d,_0x251323=sanitizeYamlKey(_0x4b4d4b)||_0x4bf9d4(0x161)+_0x25906d,_0x314b1d=_0x251323;_0x1f816e[_0x4bf9d4(0x16a)](_0x25906d,_0x314b1d);const _0x50ba59=journeyActivationStepToYaml(_0x202512,_0x2dbd97,_0x2449f9);return{'name':_0x314b1d,'isJourneyLocal':!![],'definition':_0x50ba59};}catch{return{'name':_0x25906d,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3827ec,_0xfb1dc9)=>resolveJumpTarget(_0x3827ec,_0xfb1dc9,_0x4b9e04,async _0x1db243=>{const _0x13fefc=a150_0x4ffd,_0xdbd8a9=_0x27ec8d[_0x13fefc(0x12e)](_0x1db243);if(_0xdbd8a9)return _0xdbd8a9;return _0x564562[_0x13fefc(0x12d)][_0x13fefc(0x12a)](_0x1db243);})});return{'createYamlContext':_0x5ead15};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a151_0x57ff1f=a151_0x13de;(function(_0x57ecdf,_0x8f7339){const _0x24ddc6=a151_0x13de,_0x4b7f71=_0x57ecdf();while(!![]){try{const _0x4b9e9b=parseInt(_0x24ddc6(0x140))/0x1*(parseInt(_0x24ddc6(0x135))/0x2)+-parseInt(_0x24ddc6(0x129))/0x3*(parseInt(_0x24ddc6(0x134))/0x4)+parseInt(_0x24ddc6(0x12e))/0x5*(parseInt(_0x24ddc6(0x141))/0x6)+-parseInt(_0x24ddc6(0x132))/0x7+-parseInt(_0x24ddc6(0x143))/0x8*(-parseInt(_0x24ddc6(0x12d))/0x9)+parseInt(_0x24ddc6(0x130))/0xa+-parseInt(_0x24ddc6(0x136))/0xb;if(_0x4b9e9b===_0x8f7339)break;else _0x4b7f71['push'](_0x4b7f71['shift']());}catch(_0x303d7e){_0x4b7f71['push'](_0x4b7f71['shift']());}}}(a151_0x11b2,0x49462));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a151_0x6bd0bc from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a151_0x57ff1f(0x137));function a151_0x11b2(){const _0x3b36e9=['ENOENT','debug','journeyName','parse','.push-recovery.json','utf-8','stringify','join','3ktZIqt','324XjwfEy','segments','176808fFVVet','string','262329yRkMEa','version','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','toISOString','153XYDQBj','47210LQaDkj','dirname','1157420slDEPV','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','3925117nvJcfI','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','16WNmIfp','311748hlcyau','2841476dKUHke','tdx.sdk.push-recovery'];a151_0x11b2=function(){return _0x3b36e9;};return a151_0x11b2();}export function getPushRecoveryPath(_0x3fb64d){const _0x33a319=a151_0x57ff1f,_0x1b231b=a151_0x6bd0bc[_0x33a319(0x12f)](_0x3fb64d),_0x7f2281=a151_0x6bd0bc['basename'](_0x3fb64d);return a151_0x6bd0bc[_0x33a319(0x13f)](_0x1b231b,'.'+_0x7f2281+_0x33a319(0x13c));}function a151_0x13de(_0x51b6fc,_0x267ab3){_0x51b6fc=_0x51b6fc-0x128;const _0x11b2ca=a151_0x11b2();let _0x13de45=_0x11b2ca[_0x51b6fc];return _0x13de45;}export function readPushRecovery(_0xc9bc5a){const _0x58ad27=a151_0x57ff1f,_0x5d1272=getPushRecoveryPath(_0xc9bc5a);if(!existsSync(_0x5d1272))return undefined;try{const _0x244b69=readFileSync(_0x5d1272,_0x58ad27(0x13d)),_0x484f15=JSON[_0x58ad27(0x13b)](_0x244b69);if(_0x484f15?.[_0x58ad27(0x12a)]!==0x1||typeof _0x484f15['journeyName']!==_0x58ad27(0x128))return undefined;return _0x484f15;}catch(_0x15e017){return _0x15e017 instanceof SyntaxError?logger[_0x58ad27(0x139)](_0x58ad27(0x131)+_0x15e017):logger['warn'](_0x58ad27(0x12b)+_0x15e017),undefined;}}export function writePushRecovery(_0x2d434e,_0x4a7597){const _0x2bce56=a151_0x57ff1f,_0xd1fb53=getPushRecoveryPath(_0x2d434e),_0x18e92e=_0xd1fb53+'.tmp';writeFileSync(_0x18e92e,JSON[_0x2bce56(0x13e)](_0x4a7597,null,0x2)+'\x0a',_0x2bce56(0x13d)),renameSync(_0x18e92e,_0xd1fb53);}export function deletePushRecovery(_0x53e06c){const _0x22b7f4=a151_0x57ff1f,_0x50e37a=getPushRecoveryPath(_0x53e06c);try{unlinkSync(_0x50e37a);}catch(_0x12f44a){_0x12f44a['code']!==_0x22b7f4(0x138)&&logger[_0x22b7f4(0x139)](_0x22b7f4(0x133)+_0x12f44a);}}export function saveSegmentToPushRecovery(_0x5700ec,_0x174298,_0x2f14ae,_0x44dd1d){const _0x3f36d9=a151_0x57ff1f,_0x21ce96=readPushRecovery(_0x5700ec),_0x449ddf=_0x21ce96?.[_0x3f36d9(0x13a)]===_0x174298?{..._0x21ce96,'updatedAt':new Date()[_0x3f36d9(0x12c)]()}:{'version':0x1,'journeyName':_0x174298,'updatedAt':new Date()[_0x3f36d9(0x12c)](),'segments':{}};_0x449ddf[_0x3f36d9(0x142)][_0x2f14ae]=_0x44dd1d,writePushRecovery(_0x5700ec,_0x449ddf);}
|