@treasuredata/tdx 2026.6.1 → 2026.6.2
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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/table-deleted.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.d.ts +2 -2
- package/dist/commands/workflow-command.d.ts.map +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/commands/workflow-command.js.map +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.d.ts +23 -1
- package/dist/sdk/client/workflow-client.d.ts.map +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/client/workflow-client.js.map +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/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.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/workflow.d.ts +1 -1
- package/dist/sdk/types/workflow.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.d.ts +23 -2
- package/dist/sdk/workflow/index.d.ts.map +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/index.js.map +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.d.ts +4 -0
- package/dist/sdk/workflow/push-workflow.d.ts.map +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js.map +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.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
|
-
(function(_0x7fcd9b,_0x341f3d){const _0x5a0604=a152_0x3ff8,_0x436663=_0x7fcd9b();while(!![]){try{const _0x2e6114=parseInt(_0x5a0604(0x131))/0x1+-parseInt(_0x5a0604(0x173))/0x2+-parseInt(_0x5a0604(0x124))/0x3+parseInt(_0x5a0604(0x129))/0x4+parseInt(_0x5a0604(0x16a))/0x5*(-parseInt(_0x5a0604(0x136))/0x6)+parseInt(_0x5a0604(0x14c))/0x7*(-parseInt(_0x5a0604(0x11d))/0x8)+parseInt(_0x5a0604(0x10a))/0x9;if(_0x2e6114===_0x341f3d)break;else _0x436663['push'](_0x436663['shift']());}catch(_0x492655){_0x436663['push'](_0x436663['shift']());}}}(a152_0x19cb,0x2a2b8));import*as a152_0x4243df from'yaml';function formatScheduleTime(_0x202e0a){const _0x42ce99=a152_0x3ff8;if(typeof _0x202e0a===_0x42ce99(0x12f)){const _0x1a15d2=Math[_0x42ce99(0x171)](_0x202e0a);return String(_0x1a15d2)['padStart'](0x2,'0')+_0x42ce99(0x170);}if(typeof _0x202e0a==='string'){if(/^\d{2}:\d{2}:\d{2}$/[_0x42ce99(0x10b)](_0x202e0a))return _0x202e0a;if(/^\d{1,2}:\d{2}$/[_0x42ce99(0x10b)](_0x202e0a)){const [_0x3660bf,_0x18ecb9]=_0x202e0a[_0x42ce99(0x133)](':');return _0x3660bf[_0x42ce99(0x14a)](0x2,'0')+':'+_0x18ecb9+_0x42ce99(0x148);}const _0x3f4335=parseInt(_0x202e0a,0xa);if(!isNaN(_0x3f4335)&&_0x202e0a[_0x42ce99(0x11f)](/^\d+$/))return String(_0x3f4335)['padStart'](0x2,'0')+_0x42ce99(0x170);return _0x202e0a;}return String(_0x202e0a);}export function apiToDef(_0x200dbb){const _0x5c8db1=a152_0x3ff8,_0x43e915={'database':_0x200dbb['master']?.[_0x5c8db1(0x117)]||'','table':_0x200dbb[_0x5c8db1(0x15a)]?.['parentTableName']||''};_0x200dbb[_0x5c8db1(0x16e)]&&_0x200dbb[_0x5c8db1(0x16e)][_0x5c8db1(0x137)]>0x0&&(_0x43e915[_0x5c8db1(0x116)]=_0x200dbb[_0x5c8db1(0x16e)][_0x5c8db1(0x144)](_0x13b6a7=>({'column':_0x13b6a7[_0x5c8db1(0x149)],'values':_0x13b6a7['rightValues']})));let _0x171e94;_0x200dbb[_0x5c8db1(0x14d)]&&_0x200dbb['scheduleType']!==_0x5c8db1(0x16b)&&(_0x171e94={'type':_0x200dbb[_0x5c8db1(0x14d)]},_0x200dbb[_0x5c8db1(0x126)]&&(_0x171e94['time']=formatScheduleTime(_0x200dbb['scheduleOption'])),_0x200dbb[_0x5c8db1(0x169)]&&(_0x171e94[_0x5c8db1(0x169)]=_0x200dbb[_0x5c8db1(0x169)]));let _0x34db37;(_0x200dbb[_0x5c8db1(0x115)]||_0x200dbb['hivePoolName']||_0x200dbb[_0x5c8db1(0x123)])&&(_0x34db37={},_0x200dbb['workflowHiveOnly']&&(_0x34db37[_0x5c8db1(0x111)]=_0x200dbb[_0x5c8db1(0x115)]),_0x200dbb[_0x5c8db1(0x161)]&&(_0x34db37[_0x5c8db1(0x142)]=_0x200dbb[_0x5c8db1(0x161)]),_0x200dbb[_0x5c8db1(0x123)]&&(_0x34db37['trino_pool']=_0x200dbb[_0x5c8db1(0x123)]));const _0x2b5446=_0x200dbb[_0x5c8db1(0x128)]&&_0x200dbb['attributes']['length']>0x0?groupAttributesBySource(_0x200dbb[_0x5c8db1(0x128)]):undefined,_0x4e2c77=_0x200dbb[_0x5c8db1(0x151)]&&_0x200dbb[_0x5c8db1(0x151)][_0x5c8db1(0x137)]>0x0?_0x200dbb[_0x5c8db1(0x151)][_0x5c8db1(0x144)](convertApiBehaviorToYaml):undefined;let _0xd96f98;_0x200dbb[_0x5c8db1(0x166)]&&(_0xd96f98={'name':_0x200dbb[_0x5c8db1(0x166)][_0x5c8db1(0x10c)],'source':{'database':_0x200dbb[_0x5c8db1(0x166)][_0x5c8db1(0x117)],'table':_0x200dbb[_0x5c8db1(0x166)][_0x5c8db1(0x153)]},'join':{'parent_key':_0x200dbb[_0x5c8db1(0x166)][_0x5c8db1(0x119)],'child_key':_0x200dbb['customerGroup']['parentKey']}},_0x200dbb[_0x5c8db1(0x166)][_0x5c8db1(0x134)]&&_0x200dbb[_0x5c8db1(0x166)]['customerGroupAttributes']['length']>0x0&&(_0xd96f98[_0x5c8db1(0x128)]=groupAttributesBySource(_0x200dbb[_0x5c8db1(0x166)][_0x5c8db1(0x134)])),_0x200dbb['customerGroup'][_0x5c8db1(0x152)]&&_0x200dbb[_0x5c8db1(0x166)]['customerGroupBehaviors'][_0x5c8db1(0x137)]>0x0&&(_0xd96f98[_0x5c8db1(0x151)]=_0x200dbb[_0x5c8db1(0x166)][_0x5c8db1(0x152)][_0x5c8db1(0x144)](convertApiBehaviorToYaml)));const _0x34cca5={'name':_0x200dbb[_0x5c8db1(0x10c)],..._0x200dbb[_0x5c8db1(0x130)]&&{'description':_0x200dbb[_0x5c8db1(0x130)]},'master':_0x43e915,..._0x171e94&&{'schedule':_0x171e94},..._0x34db37&&{'engine':_0x34db37},..._0x2b5446&&{'attributes':_0x2b5446},..._0x4e2c77&&{'behaviors':_0x4e2c77},..._0xd96f98&&{'customer_group':_0xd96f98}};return _0x34cca5;}function groupAttributesBySource(_0x291424){const _0x2ac662=a152_0x3ff8,_0x173f9e=new Map();for(const _0x553daf of _0x291424){const _0x325743=_0x553daf[_0x2ac662(0x117)]+'.'+_0x553daf[_0x2ac662(0x153)]+'.'+_0x553daf[_0x2ac662(0x13c)]+'.'+_0x553daf[_0x2ac662(0x119)];!_0x173f9e[_0x2ac662(0x163)](_0x325743)&&_0x173f9e['set'](_0x325743,[]),_0x173f9e[_0x2ac662(0x11b)](_0x325743)['push'](_0x553daf);}const _0x563615=[];for(const [,_0x2107d9]of _0x173f9e){const _0x1035be=_0x2107d9[0x0],_0x15bc6a=_0x1035be[_0x2ac662(0x15b)]||_0x1035be['parentTableName'];_0x563615['push']({'name':_0x15bc6a,'source':{'database':_0x1035be[_0x2ac662(0x117)],'table':_0x1035be[_0x2ac662(0x153)]},'join':{'parent_key':_0x1035be[_0x2ac662(0x119)],'child_key':_0x1035be['parentKey']},'columns':_0x2107d9[_0x2ac662(0x144)](_0x2cc9aa=>{const _0x2f969e=_0x2ac662,_0x231560={'column':_0x2cc9aa[_0x2f969e(0x112)],'type':_0x2cc9aa[_0x2f969e(0x147)]};return _0x2cc9aa[_0x2f969e(0x10c)]!==_0x2cc9aa['parentColumn']&&(_0x231560[_0x2f969e(0x12d)]=_0x2cc9aa['name']),_0x231560;})});}return _0x563615;}function convertApiBehaviorToYaml(_0x167247){const _0x4a8e0f=a152_0x3ff8,_0x3701e8={'name':_0x167247[_0x4a8e0f(0x10c)],'source':{'database':_0x167247[_0x4a8e0f(0x117)],'table':_0x167247[_0x4a8e0f(0x153)]},'join':{'parent_key':_0x167247[_0x4a8e0f(0x119)],'child_key':_0x167247[_0x4a8e0f(0x13c)]}};if(_0x167247[_0x4a8e0f(0x172)])_0x3701e8[_0x4a8e0f(0x145)]=!![];else _0x167247['schema']&&_0x167247[_0x4a8e0f(0x159)]['length']>0x0&&(_0x3701e8[_0x4a8e0f(0x158)]=_0x167247[_0x4a8e0f(0x159)][_0x4a8e0f(0x144)](_0x4316d5=>{const _0x3570b1=_0x4a8e0f,_0x4e847f={'column':_0x4316d5[_0x3570b1(0x112)],'type':_0x4316d5[_0x3570b1(0x147)]};return _0x4316d5[_0x3570b1(0x10c)]!==_0x4316d5[_0x3570b1(0x112)]&&(_0x4e847f[_0x3570b1(0x12d)]=_0x4316d5[_0x3570b1(0x10c)]),_0x4e847f;}));return _0x167247[_0x4a8e0f(0x13d)]&&(_0x3701e8[_0x4a8e0f(0x110)]=_0x167247[_0x4a8e0f(0x13d)]),_0x167247[_0x4a8e0f(0x154)]&&(_0x3701e8[_0x4a8e0f(0x113)]=_0x167247[_0x4a8e0f(0x154)]),_0x3701e8;}function a152_0x19cb(){const _0x3313d5=['source','columns','schema','master','groupingName','trino_pool','YAML\x20config\x20missing\x20required\x20field:\x20master.database','Parent\x20segment\x20description','parse','YAML\x20config\x20missing\x20required\x20field:\x20master.table','hivePoolName','id_stitching','has','Example\x20Attributes','string','customerGroup','schedule:','behaviors:','timezone','10sUYncP','none','table','YAML\x20config\x20missing\x20required\x20field:\x20master','audienceFilters','realtime.events[',':00:00','floor','allColumns','609018XIKiRu','list','database','customer_group','\x27.\x20Must\x20be\x20one\x20of:\x20','column_name','primary_key','4031127xofTas','test','name','user_id','child_key','schedule','default_time_filter','hive_only','parentColumn','realtime','attribute_table','workflowHiveOnly','filters','parentDatabaseName','realtime:','foreignKey','attributes:','get',']:\x20Missing\x20required\x20field\x20\x27name\x27','32WTelTq','forEach','match','YAML\x20config\x20missing\x20required\x20field:\x20name','realtime.attributes[','personalization_services','prestoPoolName','240054rRKEIm','events_table','scheduleOption','time','attributes','1074016BMRIQG','ordered_set','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','events','label','UTC','number','description','263718RHKTVt','isArray','split','customerGroupAttributes','replace','824430PrnaQb','length','parent_key','single','column','customer_group:','parentKey','defaultTimeFilterEnabled','join','):\x20Invalid\x20type\x20\x27',']\x20(','engine:','hive_pool','personalization_services\x20must\x20be\x20an\x20array','map','all_columns','master:','type',':00','columnName','padStart','customer_id','259105kEeFvK','scheduleType','engine','stringify','null','behaviors','customerGroupBehaviors','parentTableName','isRealtime','push','personalization_services['];a152_0x19cb=function(){return _0x3313d5;};return a152_0x19cb();}export function defToApi(_0x13ecf7){const _0x516d5f=a152_0x3ff8,_0x425f32={'name':_0x13ecf7[_0x516d5f(0x10c)],'master':{'parentDatabaseName':_0x13ecf7[_0x516d5f(0x15a)][_0x516d5f(0x175)],'parentTableName':_0x13ecf7[_0x516d5f(0x15a)]['table']}};_0x13ecf7[_0x516d5f(0x130)]&&(_0x425f32[_0x516d5f(0x130)]=_0x13ecf7['description']);_0x13ecf7[_0x516d5f(0x15a)][_0x516d5f(0x116)]&&_0x13ecf7[_0x516d5f(0x15a)][_0x516d5f(0x116)][_0x516d5f(0x137)]>0x0&&(_0x425f32[_0x516d5f(0x16e)]=_0x13ecf7['master']['filters'][_0x516d5f(0x144)](_0x1256a8=>({'columnName':_0x1256a8[_0x516d5f(0x13a)],'rightValues':_0x1256a8['values']})));_0x13ecf7['schedule']&&(_0x425f32[_0x516d5f(0x14d)]=_0x13ecf7[_0x516d5f(0x10f)][_0x516d5f(0x147)],_0x13ecf7[_0x516d5f(0x10f)][_0x516d5f(0x127)]&&(_0x425f32[_0x516d5f(0x126)]=_0x13ecf7[_0x516d5f(0x10f)]['time']),_0x13ecf7['schedule'][_0x516d5f(0x169)]&&(_0x425f32[_0x516d5f(0x169)]=_0x13ecf7[_0x516d5f(0x10f)][_0x516d5f(0x169)]));_0x13ecf7[_0x516d5f(0x14e)]&&(_0x13ecf7[_0x516d5f(0x14e)][_0x516d5f(0x111)]!==undefined&&(_0x425f32[_0x516d5f(0x115)]=_0x13ecf7[_0x516d5f(0x14e)][_0x516d5f(0x111)]),_0x13ecf7[_0x516d5f(0x14e)][_0x516d5f(0x142)]!==undefined&&(_0x425f32[_0x516d5f(0x161)]=_0x13ecf7[_0x516d5f(0x14e)]['hive_pool']),_0x13ecf7[_0x516d5f(0x14e)][_0x516d5f(0x15c)]!==undefined&&(_0x425f32[_0x516d5f(0x123)]=_0x13ecf7['engine'][_0x516d5f(0x15c)]));_0x13ecf7['attributes']&&_0x13ecf7['attributes'][_0x516d5f(0x137)]>0x0&&(_0x425f32['attributes']=flattenAttributeGroups(_0x13ecf7[_0x516d5f(0x128)]));_0x13ecf7[_0x516d5f(0x151)]&&_0x13ecf7[_0x516d5f(0x151)][_0x516d5f(0x137)]>0x0&&(_0x425f32[_0x516d5f(0x151)]=_0x13ecf7[_0x516d5f(0x151)][_0x516d5f(0x144)](convertDefBehaviorToApi));if(_0x13ecf7['customer_group']){const _0x226670=_0x13ecf7[_0x516d5f(0x176)];_0x425f32['customerGroup']={'name':_0x226670[_0x516d5f(0x10c)],'parentDatabaseName':_0x226670[_0x516d5f(0x157)][_0x516d5f(0x175)],'parentTableName':_0x226670[_0x516d5f(0x157)][_0x516d5f(0x16c)],'parentKey':_0x226670[_0x516d5f(0x13e)]['child_key'],'foreignKey':_0x226670[_0x516d5f(0x13e)][_0x516d5f(0x138)]},_0x226670['attributes']&&_0x226670['attributes'][_0x516d5f(0x137)]>0x0&&(_0x425f32[_0x516d5f(0x166)][_0x516d5f(0x134)]=flattenAttributeGroups(_0x226670[_0x516d5f(0x128)])['map'](_0x419062=>({'name':_0x419062[_0x516d5f(0x10c)],'type':_0x419062[_0x516d5f(0x147)],'parentDatabaseName':_0x419062[_0x516d5f(0x117)],'parentTableName':_0x419062[_0x516d5f(0x153)],'parentColumn':_0x419062['parentColumn'],'parentKey':_0x419062[_0x516d5f(0x13c)],'foreignKey':_0x419062[_0x516d5f(0x119)]}))),_0x226670['behaviors']&&_0x226670[_0x516d5f(0x151)]['length']>0x0&&(_0x425f32['customerGroup'][_0x516d5f(0x152)]=_0x226670['behaviors'][_0x516d5f(0x144)](_0x2ade6a=>({'name':_0x2ade6a['name'],'parentDatabaseName':_0x2ade6a[_0x516d5f(0x157)]['database'],'parentTableName':_0x2ade6a[_0x516d5f(0x157)][_0x516d5f(0x16c)],'parentKey':_0x2ade6a[_0x516d5f(0x13e)][_0x516d5f(0x10e)],'foreignKey':_0x2ade6a[_0x516d5f(0x13e)][_0x516d5f(0x138)],'allColumns':_0x2ade6a[_0x516d5f(0x145)],'schema':_0x2ade6a[_0x516d5f(0x158)]?.[_0x516d5f(0x144)](_0x5868cc=>({'name':_0x5868cc[_0x516d5f(0x12d)]||_0x5868cc[_0x516d5f(0x13a)],'type':_0x5868cc[_0x516d5f(0x147)],'parentColumn':_0x5868cc[_0x516d5f(0x13a)]}))})));}return _0x425f32;}function flattenAttributeGroups(_0x3177ae){const _0x3d5b9a=a152_0x3ff8,_0x2558ac=[];for(const _0x3b3617 of _0x3177ae){for(const _0x2666c9 of _0x3b3617[_0x3d5b9a(0x158)]){_0x2558ac[_0x3d5b9a(0x155)]({'name':_0x2666c9[_0x3d5b9a(0x12d)]||_0x2666c9['column'],'type':_0x2666c9[_0x3d5b9a(0x147)],'parentDatabaseName':_0x3b3617['source'][_0x3d5b9a(0x175)],'parentTableName':_0x3b3617['source'][_0x3d5b9a(0x16c)],'parentColumn':_0x2666c9[_0x3d5b9a(0x13a)],'parentKey':_0x3b3617['join'][_0x3d5b9a(0x10e)],'foreignKey':_0x3b3617[_0x3d5b9a(0x13e)][_0x3d5b9a(0x138)],'groupingName':_0x3b3617['name']});}}return _0x2558ac;}function convertDefBehaviorToApi(_0x8e830e){const _0x41437f=a152_0x3ff8,_0x5439b4={'name':_0x8e830e[_0x41437f(0x10c)],'parentDatabaseName':_0x8e830e[_0x41437f(0x157)]['database'],'parentTableName':_0x8e830e[_0x41437f(0x157)][_0x41437f(0x16c)],'parentKey':_0x8e830e['join'][_0x41437f(0x10e)],'foreignKey':_0x8e830e[_0x41437f(0x13e)][_0x41437f(0x138)]};if(_0x8e830e[_0x41437f(0x145)])_0x5439b4[_0x41437f(0x172)]=!![];else _0x8e830e['columns']&&_0x8e830e[_0x41437f(0x158)]['length']>0x0&&(_0x5439b4[_0x41437f(0x159)]=_0x8e830e['columns'][_0x41437f(0x144)](_0x40b458=>({'name':_0x40b458[_0x41437f(0x12d)]||_0x40b458[_0x41437f(0x13a)],'type':_0x40b458[_0x41437f(0x147)],'parentColumn':_0x40b458['column']})));return _0x8e830e[_0x41437f(0x110)]!==undefined&&(_0x5439b4[_0x41437f(0x13d)]=_0x8e830e[_0x41437f(0x110)]),_0x8e830e['realtime']!==undefined&&(_0x5439b4[_0x41437f(0x154)]=_0x8e830e[_0x41437f(0x113)]),_0x5439b4;}export function serializeDef(_0x195749){const _0x46c729=a152_0x3ff8,_0x2ef900=JSON[_0x46c729(0x15f)](JSON['stringify'](_0x195749)),_0x49f537=a152_0x4243df[_0x46c729(0x14f)](_0x2ef900,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x46c729(0x150)}),_0x6461eb=[_0x46c729(0x146),_0x46c729(0x167),_0x46c729(0x141),_0x46c729(0x11a),_0x46c729(0x168),_0x46c729(0x13b),_0x46c729(0x118),'personalization_services:'];let _0xb37099=_0x49f537;for(const _0x712618 of _0x6461eb){_0xb37099=_0xb37099[_0x46c729(0x135)](new RegExp('^('+_0x712618+')','m'),(_0x2d03b6,_0x179a81,_0xe31ea7)=>{if(_0xe31ea7===0x0||_0xb37099[_0xe31ea7-0x1]==='\x0a'&&_0xb37099[_0xe31ea7-0x2]==='\x0a')return _0x179a81;return'\x0a'+_0x179a81;});}return _0xb37099;}export function parseDef(_0x2ae4e2){const _0x1ecffd=a152_0x3ff8,_0x633886=a152_0x4243df[_0x1ecffd(0x15f)](_0x2ae4e2);if(!_0x633886[_0x1ecffd(0x10c)])throw new Error(_0x1ecffd(0x120));if(!_0x633886[_0x1ecffd(0x15a)])throw new Error(_0x1ecffd(0x16d));if(!_0x633886[_0x1ecffd(0x15a)][_0x1ecffd(0x175)])throw new Error(_0x1ecffd(0x15d));if(!_0x633886['master'][_0x1ecffd(0x16c)])throw new Error(_0x1ecffd(0x160));return _0x633886[_0x1ecffd(0x113)]&&validateRealtimeSection(_0x633886['realtime']),_0x633886[_0x1ecffd(0x122)]&&validatePersonalizationServices(_0x633886[_0x1ecffd(0x122)]),_0x633886;}function validateRealtimeSection(_0xefbd2b){const _0x212370=a152_0x3ff8,_0x58822b=[_0x212370(0x139),'counter','set',_0x212370(0x12a),_0x212370(0x174),'imported_batch'];_0xefbd2b[_0x212370(0x12c)]&&Array[_0x212370(0x132)](_0xefbd2b[_0x212370(0x12c)])&&_0xefbd2b[_0x212370(0x12c)][_0x212370(0x11e)]((_0x5196a2,_0xd994d1)=>{const _0x270461=_0x212370;if(!_0x5196a2[_0x270461(0x10c)])throw new Error(_0x270461(0x16f)+_0xd994d1+_0x270461(0x11c));});_0xefbd2b['attributes']&&Array['isArray'](_0xefbd2b[_0x212370(0x128)])&&_0xefbd2b[_0x212370(0x128)][_0x212370(0x11e)]((_0x1ed9db,_0x2eaa23)=>{const _0xe7a630=_0x212370;if(!_0x1ed9db[_0xe7a630(0x10c)])throw new Error(_0xe7a630(0x121)+_0x2eaa23+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x1ed9db[_0xe7a630(0x147)]&&!_0x58822b['includes'](_0x1ed9db[_0xe7a630(0x147)]))throw new Error(_0xe7a630(0x121)+_0x2eaa23+_0xe7a630(0x140)+_0x1ed9db[_0xe7a630(0x10c)]+_0xe7a630(0x13f)+_0x1ed9db[_0xe7a630(0x147)]+_0xe7a630(0x177)+_0x58822b[_0xe7a630(0x13e)](',\x20'));});if(_0xefbd2b[_0x212370(0x162)]){if(!_0xefbd2b[_0x212370(0x162)][_0x212370(0x109)])throw new Error(_0x212370(0x12b));}}function a152_0x3ff8(_0x580b95,_0x20c759){_0x580b95=_0x580b95-0x109;const _0x19cbf8=a152_0x19cb();let _0x3ff824=_0x19cbf8[_0x580b95];return _0x3ff824;}function validatePersonalizationServices(_0x4e7052){const _0x4d0501=a152_0x3ff8;if(!Array[_0x4d0501(0x132)](_0x4e7052))throw new Error(_0x4d0501(0x143));_0x4e7052[_0x4d0501(0x11e)]((_0x4ff371,_0x3b35c8)=>{const _0x55c9cf=_0x4d0501;if(!_0x4ff371['name'])throw new Error(_0x55c9cf(0x156)+_0x3b35c8+_0x55c9cf(0x11c));});}export function generateTemplate(_0x2f3857,_0x1ad129,_0x107e02){const _0x306e06=a152_0x3ff8,_0x5c4f24={'name':_0x2f3857,'description':_0x306e06(0x15e),'master':{'database':_0x1ad129,'table':_0x107e02},'schedule':{'type':'daily','time':'03:00','timezone':_0x306e06(0x12e)},'attributes':[{'name':_0x306e06(0x164),'source':{'database':_0x1ad129,'table':_0x306e06(0x114)},'join':{'parent_key':'id','child_key':'customer_id'},'columns':[{'column':_0x306e06(0x178),'label':'Display\x20Name','type':_0x306e06(0x165)}]}],'behaviors':[{'name':'Example\x20Events','source':{'database':_0x1ad129,'table':_0x306e06(0x125)},'join':{'parent_key':_0x306e06(0x10d),'child_key':_0x306e06(0x14b)},'all_columns':!![]}]};return serializeDef(_0x5c4f24);}
|
|
1
|
+
(function(_0x128613,_0x592124){const _0x5b6c29=a152_0x1d1d,_0x2adb5a=_0x128613();while(!![]){try{const _0x2907e7=parseInt(_0x5b6c29(0xf5))/0x1*(-parseInt(_0x5b6c29(0xdb))/0x2)+-parseInt(_0x5b6c29(0x102))/0x3*(-parseInt(_0x5b6c29(0x126))/0x4)+-parseInt(_0x5b6c29(0xf8))/0x5*(-parseInt(_0x5b6c29(0x132))/0x6)+-parseInt(_0x5b6c29(0xe6))/0x7+parseInt(_0x5b6c29(0xf6))/0x8*(-parseInt(_0x5b6c29(0x117))/0x9)+-parseInt(_0x5b6c29(0xe0))/0xa+parseInt(_0x5b6c29(0x12e))/0xb;if(_0x2907e7===_0x592124)break;else _0x2adb5a['push'](_0x2adb5a['shift']());}catch(_0x1f8b86){_0x2adb5a['push'](_0x2adb5a['shift']());}}}(a152_0xf0cb,0xa7db6));import*as a152_0x5c15f5 from'yaml';function formatScheduleTime(_0x2b39e0){const _0x215547=a152_0x1d1d;if(typeof _0x2b39e0==='number'){const _0x45163f=Math['floor'](_0x2b39e0);return String(_0x45163f)[_0x215547(0x11f)](0x2,'0')+_0x215547(0x105);}if(typeof _0x2b39e0===_0x215547(0x130)){if(/^\d{2}:\d{2}:\d{2}$/[_0x215547(0x112)](_0x2b39e0))return _0x2b39e0;if(/^\d{1,2}:\d{2}$/[_0x215547(0x112)](_0x2b39e0)){const [_0x4709ca,_0x538ef7]=_0x2b39e0['split'](':');return _0x4709ca['padStart'](0x2,'0')+':'+_0x538ef7+':00';}const _0xc842c=parseInt(_0x2b39e0,0xa);if(!isNaN(_0xc842c)&&_0x2b39e0[_0x215547(0x123)](/^\d+$/))return String(_0xc842c)[_0x215547(0x11f)](0x2,'0')+_0x215547(0x105);return _0x2b39e0;}return String(_0x2b39e0);}export function apiToDef(_0x2df526){const _0x35e02e=a152_0x1d1d,_0x9e36b7={'database':_0x2df526['master']?.[_0x35e02e(0x10a)]||'','table':_0x2df526[_0x35e02e(0xfb)]?.[_0x35e02e(0x119)]||''};_0x2df526[_0x35e02e(0xc4)]&&_0x2df526[_0x35e02e(0xc4)][_0x35e02e(0x110)]>0x0&&(_0x9e36b7['filters']=_0x2df526[_0x35e02e(0xc4)][_0x35e02e(0x11c)](_0x53629a=>({'column':_0x53629a[_0x35e02e(0xd4)],'values':_0x53629a[_0x35e02e(0x127)]})));let _0x34bfa6;_0x2df526[_0x35e02e(0x101)]&&_0x2df526['scheduleType']!==_0x35e02e(0xf0)&&(_0x34bfa6={'type':_0x2df526[_0x35e02e(0x101)]},_0x2df526['scheduleOption']&&(_0x34bfa6[_0x35e02e(0x11d)]=formatScheduleTime(_0x2df526['scheduleOption'])),_0x2df526[_0x35e02e(0xcd)]&&(_0x34bfa6[_0x35e02e(0xcd)]=_0x2df526[_0x35e02e(0xcd)]));let _0x48b03a;(_0x2df526[_0x35e02e(0x116)]||_0x2df526[_0x35e02e(0xf4)]||_0x2df526[_0x35e02e(0xe4)])&&(_0x48b03a={},_0x2df526[_0x35e02e(0x116)]&&(_0x48b03a[_0x35e02e(0x131)]=_0x2df526[_0x35e02e(0x116)]),_0x2df526[_0x35e02e(0xf4)]&&(_0x48b03a[_0x35e02e(0x11a)]=_0x2df526[_0x35e02e(0xf4)]),_0x2df526[_0x35e02e(0xe4)]&&(_0x48b03a[_0x35e02e(0xe3)]=_0x2df526[_0x35e02e(0xe4)]));const _0x16f4aa=_0x2df526['attributes']&&_0x2df526[_0x35e02e(0x113)][_0x35e02e(0x110)]>0x0?groupAttributesBySource(_0x2df526[_0x35e02e(0x113)]):undefined,_0x19da53=_0x2df526[_0x35e02e(0x100)]&&_0x2df526['behaviors'][_0x35e02e(0x110)]>0x0?_0x2df526[_0x35e02e(0x100)][_0x35e02e(0x11c)](convertApiBehaviorToYaml):undefined;let _0x1a27a9;_0x2df526[_0x35e02e(0xfa)]&&(_0x1a27a9={'name':_0x2df526['customerGroup'][_0x35e02e(0xf3)],'source':{'database':_0x2df526[_0x35e02e(0xfa)][_0x35e02e(0x10a)],'table':_0x2df526[_0x35e02e(0xfa)][_0x35e02e(0x119)]},'join':{'parent_key':_0x2df526[_0x35e02e(0xfa)][_0x35e02e(0xc8)],'child_key':_0x2df526[_0x35e02e(0xfa)][_0x35e02e(0x125)]}},_0x2df526[_0x35e02e(0xfa)][_0x35e02e(0x12a)]&&_0x2df526['customerGroup']['customerGroupAttributes'][_0x35e02e(0x110)]>0x0&&(_0x1a27a9[_0x35e02e(0x113)]=groupAttributesBySource(_0x2df526['customerGroup']['customerGroupAttributes'])),_0x2df526[_0x35e02e(0xfa)]['customerGroupBehaviors']&&_0x2df526[_0x35e02e(0xfa)][_0x35e02e(0x12d)]['length']>0x0&&(_0x1a27a9[_0x35e02e(0x100)]=_0x2df526['customerGroup'][_0x35e02e(0x12d)][_0x35e02e(0x11c)](convertApiBehaviorToYaml)));const _0x5740d2={'name':_0x2df526[_0x35e02e(0xf3)],..._0x2df526[_0x35e02e(0xce)]&&{'description':_0x2df526[_0x35e02e(0xce)]},'master':_0x9e36b7,..._0x34bfa6&&{'schedule':_0x34bfa6},..._0x48b03a&&{'engine':_0x48b03a},..._0x16f4aa&&{'attributes':_0x16f4aa},..._0x19da53&&{'behaviors':_0x19da53},..._0x1a27a9&&{'customer_group':_0x1a27a9}};return _0x5740d2;}function groupAttributesBySource(_0x496c36){const _0x49ae22=a152_0x1d1d,_0x23a708=new Map();for(const _0x383d17 of _0x496c36){const _0x1dbdf1=_0x383d17[_0x49ae22(0x10a)]+'.'+_0x383d17[_0x49ae22(0x119)]+'.'+_0x383d17[_0x49ae22(0x125)]+'.'+_0x383d17[_0x49ae22(0xc8)];!_0x23a708[_0x49ae22(0x11b)](_0x1dbdf1)&&_0x23a708[_0x49ae22(0x118)](_0x1dbdf1,[]),_0x23a708['get'](_0x1dbdf1)[_0x49ae22(0xd8)](_0x383d17);}const _0x5f49a0=[];for(const [,_0x53413f]of _0x23a708){const _0x3f4e4f=_0x53413f[0x0],_0x4d09ac=_0x3f4e4f[_0x49ae22(0x109)]||_0x3f4e4f['parentTableName'];_0x5f49a0['push']({'name':_0x4d09ac,'source':{'database':_0x3f4e4f['parentDatabaseName'],'table':_0x3f4e4f[_0x49ae22(0x119)]},'join':{'parent_key':_0x3f4e4f[_0x49ae22(0xc8)],'child_key':_0x3f4e4f[_0x49ae22(0x125)]},'columns':_0x53413f[_0x49ae22(0x11c)](_0x478bd4=>{const _0x1f3b70=_0x49ae22,_0xc17beb={'column':_0x478bd4['parentColumn'],'type':_0x478bd4[_0x1f3b70(0xc5)]};return _0x478bd4[_0x1f3b70(0xf3)]!==_0x478bd4[_0x1f3b70(0xdd)]&&(_0xc17beb['label']=_0x478bd4[_0x1f3b70(0xf3)]),_0xc17beb;})});}return _0x5f49a0;}function a152_0xf0cb(){const _0x4bb57a=['forEach','database','workflowHiveOnly','1057842YeUaCJ','set','parentTableName','hive_pool','has','map','time','YAML\x20config\x20missing\x20required\x20field:\x20master','padStart','events','events_table','realtime:','match','parent_key','parentKey','12NntODO','rightValues','attribute_table','personalization_services','customerGroupAttributes','daily','null','customerGroupBehaviors','36799444qSeaNb','isRealtime','string','hive_only','6CSOlvf','):\x20Invalid\x20type\x20\x27','\x27.\x20Must\x20be\x20one\x20of:\x20','audienceFilters','type','YAML\x20config\x20missing\x20required\x20field:\x20name','filters','foreignKey','Parent\x20segment\x20description','UTC','list','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','timezone','description','defaultTimeFilterEnabled','customer_group','parse','realtime.events[',']:\x20Missing\x20required\x20field\x20\x27name\x27','columnName','ordered_set','Example\x20Events','default_time_filter','push','personalization_services\x20must\x20be\x20an\x20array','realtime.attributes[','37362NSvKss','isArray','parentColumn','single','stringify','13124180LaeEsS','user_id','allColumns','trino_pool','prestoPoolName','child_key','9391088XiATOp','column','personalization_services:','master:','primary_key','table','imported_batch','03:00','Example\x20Attributes','source','none','replace','YAML\x20config\x20missing\x20required\x20field:\x20master.database','name','hivePoolName','35PIEvDD','8gscbKs','includes','196720gbpgiW','schedule','customerGroup','master','join','schedule:','values','realtime','behaviors','scheduleType','728169bsJZZo',']\x20(','counter',':00:00','label','engine','behaviors:','groupingName','parentDatabaseName','attributes:','columns','customer_id','all_columns','schema','length','id_stitching','test','attributes'];a152_0xf0cb=function(){return _0x4bb57a;};return a152_0xf0cb();}function convertApiBehaviorToYaml(_0x472025){const _0x100a4a=a152_0x1d1d,_0x3006fb={'name':_0x472025[_0x100a4a(0xf3)],'source':{'database':_0x472025[_0x100a4a(0x10a)],'table':_0x472025[_0x100a4a(0x119)]},'join':{'parent_key':_0x472025[_0x100a4a(0xc8)],'child_key':_0x472025[_0x100a4a(0x125)]}};if(_0x472025[_0x100a4a(0xe2)])_0x3006fb[_0x100a4a(0x10e)]=!![];else _0x472025[_0x100a4a(0x10f)]&&_0x472025[_0x100a4a(0x10f)][_0x100a4a(0x110)]>0x0&&(_0x3006fb['columns']=_0x472025[_0x100a4a(0x10f)][_0x100a4a(0x11c)](_0x1cf68b=>{const _0x18a079=_0x100a4a,_0x296811={'column':_0x1cf68b[_0x18a079(0xdd)],'type':_0x1cf68b['type']};return _0x1cf68b['name']!==_0x1cf68b[_0x18a079(0xdd)]&&(_0x296811['label']=_0x1cf68b[_0x18a079(0xf3)]),_0x296811;}));return _0x472025[_0x100a4a(0xcf)]&&(_0x3006fb[_0x100a4a(0xd7)]=_0x472025[_0x100a4a(0xcf)]),_0x472025['isRealtime']&&(_0x3006fb[_0x100a4a(0xff)]=_0x472025['isRealtime']),_0x3006fb;}export function defToApi(_0x1e72bd){const _0x122d6a=a152_0x1d1d,_0x2542f0={'name':_0x1e72bd[_0x122d6a(0xf3)],'master':{'parentDatabaseName':_0x1e72bd[_0x122d6a(0xfb)][_0x122d6a(0x115)],'parentTableName':_0x1e72bd[_0x122d6a(0xfb)][_0x122d6a(0xeb)]}};_0x1e72bd['description']&&(_0x2542f0[_0x122d6a(0xce)]=_0x1e72bd[_0x122d6a(0xce)]);_0x1e72bd[_0x122d6a(0xfb)][_0x122d6a(0xc7)]&&_0x1e72bd[_0x122d6a(0xfb)][_0x122d6a(0xc7)]['length']>0x0&&(_0x2542f0[_0x122d6a(0xc4)]=_0x1e72bd['master'][_0x122d6a(0xc7)][_0x122d6a(0x11c)](_0x2b9eed=>({'columnName':_0x2b9eed[_0x122d6a(0xe7)],'rightValues':_0x2b9eed[_0x122d6a(0xfe)]})));_0x1e72bd[_0x122d6a(0xf9)]&&(_0x2542f0['scheduleType']=_0x1e72bd[_0x122d6a(0xf9)]['type'],_0x1e72bd[_0x122d6a(0xf9)][_0x122d6a(0x11d)]&&(_0x2542f0['scheduleOption']=_0x1e72bd[_0x122d6a(0xf9)][_0x122d6a(0x11d)]),_0x1e72bd[_0x122d6a(0xf9)][_0x122d6a(0xcd)]&&(_0x2542f0[_0x122d6a(0xcd)]=_0x1e72bd[_0x122d6a(0xf9)][_0x122d6a(0xcd)]));_0x1e72bd['engine']&&(_0x1e72bd[_0x122d6a(0x107)][_0x122d6a(0x131)]!==undefined&&(_0x2542f0[_0x122d6a(0x116)]=_0x1e72bd[_0x122d6a(0x107)]['hive_only']),_0x1e72bd['engine'][_0x122d6a(0x11a)]!==undefined&&(_0x2542f0[_0x122d6a(0xf4)]=_0x1e72bd[_0x122d6a(0x107)][_0x122d6a(0x11a)]),_0x1e72bd[_0x122d6a(0x107)][_0x122d6a(0xe3)]!==undefined&&(_0x2542f0[_0x122d6a(0xe4)]=_0x1e72bd[_0x122d6a(0x107)][_0x122d6a(0xe3)]));_0x1e72bd['attributes']&&_0x1e72bd[_0x122d6a(0x113)][_0x122d6a(0x110)]>0x0&&(_0x2542f0[_0x122d6a(0x113)]=flattenAttributeGroups(_0x1e72bd[_0x122d6a(0x113)]));_0x1e72bd[_0x122d6a(0x100)]&&_0x1e72bd['behaviors'][_0x122d6a(0x110)]>0x0&&(_0x2542f0[_0x122d6a(0x100)]=_0x1e72bd[_0x122d6a(0x100)]['map'](convertDefBehaviorToApi));if(_0x1e72bd['customer_group']){const _0x17216c=_0x1e72bd[_0x122d6a(0xd0)];_0x2542f0[_0x122d6a(0xfa)]={'name':_0x17216c[_0x122d6a(0xf3)],'parentDatabaseName':_0x17216c[_0x122d6a(0xef)][_0x122d6a(0x115)],'parentTableName':_0x17216c[_0x122d6a(0xef)][_0x122d6a(0xeb)],'parentKey':_0x17216c['join'][_0x122d6a(0xe5)],'foreignKey':_0x17216c[_0x122d6a(0xfc)][_0x122d6a(0x124)]},_0x17216c[_0x122d6a(0x113)]&&_0x17216c[_0x122d6a(0x113)][_0x122d6a(0x110)]>0x0&&(_0x2542f0[_0x122d6a(0xfa)][_0x122d6a(0x12a)]=flattenAttributeGroups(_0x17216c['attributes'])[_0x122d6a(0x11c)](_0x3dffb=>({'name':_0x3dffb[_0x122d6a(0xf3)],'type':_0x3dffb[_0x122d6a(0xc5)],'parentDatabaseName':_0x3dffb[_0x122d6a(0x10a)],'parentTableName':_0x3dffb[_0x122d6a(0x119)],'parentColumn':_0x3dffb[_0x122d6a(0xdd)],'parentKey':_0x3dffb['parentKey'],'foreignKey':_0x3dffb[_0x122d6a(0xc8)]}))),_0x17216c[_0x122d6a(0x100)]&&_0x17216c['behaviors'][_0x122d6a(0x110)]>0x0&&(_0x2542f0['customerGroup'][_0x122d6a(0x12d)]=_0x17216c['behaviors'][_0x122d6a(0x11c)](_0x2a61a6=>({'name':_0x2a61a6[_0x122d6a(0xf3)],'parentDatabaseName':_0x2a61a6['source']['database'],'parentTableName':_0x2a61a6[_0x122d6a(0xef)][_0x122d6a(0xeb)],'parentKey':_0x2a61a6[_0x122d6a(0xfc)][_0x122d6a(0xe5)],'foreignKey':_0x2a61a6['join'][_0x122d6a(0x124)],'allColumns':_0x2a61a6[_0x122d6a(0x10e)],'schema':_0x2a61a6['columns']?.[_0x122d6a(0x11c)](_0x1cd4cd=>({'name':_0x1cd4cd[_0x122d6a(0x106)]||_0x1cd4cd[_0x122d6a(0xe7)],'type':_0x1cd4cd[_0x122d6a(0xc5)],'parentColumn':_0x1cd4cd[_0x122d6a(0xe7)]}))})));}return _0x2542f0;}function flattenAttributeGroups(_0x2fcf76){const _0x34f3b5=a152_0x1d1d,_0x46555e=[];for(const _0x16c197 of _0x2fcf76){for(const _0x3851a8 of _0x16c197[_0x34f3b5(0x10c)]){_0x46555e[_0x34f3b5(0xd8)]({'name':_0x3851a8['label']||_0x3851a8[_0x34f3b5(0xe7)],'type':_0x3851a8[_0x34f3b5(0xc5)],'parentDatabaseName':_0x16c197[_0x34f3b5(0xef)][_0x34f3b5(0x115)],'parentTableName':_0x16c197[_0x34f3b5(0xef)]['table'],'parentColumn':_0x3851a8[_0x34f3b5(0xe7)],'parentKey':_0x16c197[_0x34f3b5(0xfc)][_0x34f3b5(0xe5)],'foreignKey':_0x16c197[_0x34f3b5(0xfc)][_0x34f3b5(0x124)],'groupingName':_0x16c197[_0x34f3b5(0xf3)]});}}return _0x46555e;}function convertDefBehaviorToApi(_0x1a4053){const _0x15fece=a152_0x1d1d,_0x9924c={'name':_0x1a4053[_0x15fece(0xf3)],'parentDatabaseName':_0x1a4053[_0x15fece(0xef)]['database'],'parentTableName':_0x1a4053[_0x15fece(0xef)][_0x15fece(0xeb)],'parentKey':_0x1a4053[_0x15fece(0xfc)]['child_key'],'foreignKey':_0x1a4053[_0x15fece(0xfc)][_0x15fece(0x124)]};if(_0x1a4053[_0x15fece(0x10e)])_0x9924c[_0x15fece(0xe2)]=!![];else _0x1a4053[_0x15fece(0x10c)]&&_0x1a4053['columns'][_0x15fece(0x110)]>0x0&&(_0x9924c['schema']=_0x1a4053['columns'][_0x15fece(0x11c)](_0x52db23=>({'name':_0x52db23[_0x15fece(0x106)]||_0x52db23[_0x15fece(0xe7)],'type':_0x52db23[_0x15fece(0xc5)],'parentColumn':_0x52db23[_0x15fece(0xe7)]})));return _0x1a4053['default_time_filter']!==undefined&&(_0x9924c[_0x15fece(0xcf)]=_0x1a4053[_0x15fece(0xd7)]),_0x1a4053[_0x15fece(0xff)]!==undefined&&(_0x9924c[_0x15fece(0x12f)]=_0x1a4053[_0x15fece(0xff)]),_0x9924c;}export function serializeDef(_0x2d9fdd){const _0x22447b=a152_0x1d1d,_0x2ca8a8=JSON[_0x22447b(0xd1)](JSON[_0x22447b(0xdf)](_0x2d9fdd)),_0x934481=a152_0x5c15f5['stringify'](_0x2ca8a8,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x22447b(0x12c)}),_0x13e6b6=[_0x22447b(0xe9),_0x22447b(0xfd),'engine:',_0x22447b(0x10b),_0x22447b(0x108),'customer_group:',_0x22447b(0x122),_0x22447b(0xe8)];let _0x5ad8b2=_0x934481;for(const _0x476259 of _0x13e6b6){_0x5ad8b2=_0x5ad8b2[_0x22447b(0xf1)](new RegExp('^('+_0x476259+')','m'),(_0x454612,_0x3fff8d,_0x27644d)=>{if(_0x27644d===0x0||_0x5ad8b2[_0x27644d-0x1]==='\x0a'&&_0x5ad8b2[_0x27644d-0x2]==='\x0a')return _0x3fff8d;return'\x0a'+_0x3fff8d;});}return _0x5ad8b2;}export function parseDef(_0x4409b9){const _0x3b40a3=a152_0x1d1d,_0x1f103b=a152_0x5c15f5[_0x3b40a3(0xd1)](_0x4409b9);if(!_0x1f103b[_0x3b40a3(0xf3)])throw new Error(_0x3b40a3(0xc6));if(!_0x1f103b[_0x3b40a3(0xfb)])throw new Error(_0x3b40a3(0x11e));if(!_0x1f103b['master'][_0x3b40a3(0x115)])throw new Error(_0x3b40a3(0xf2));if(!_0x1f103b['master'][_0x3b40a3(0xeb)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.table');return _0x1f103b[_0x3b40a3(0xff)]&&validateRealtimeSection(_0x1f103b[_0x3b40a3(0xff)]),_0x1f103b[_0x3b40a3(0x129)]&&validatePersonalizationServices(_0x1f103b['personalization_services']),_0x1f103b;}function validateRealtimeSection(_0x482ddc){const _0x5eb6fa=a152_0x1d1d,_0xd69001=[_0x5eb6fa(0xde),_0x5eb6fa(0x104),_0x5eb6fa(0x118),_0x5eb6fa(0xd5),_0x5eb6fa(0xcb),_0x5eb6fa(0xec)];_0x482ddc['events']&&Array['isArray'](_0x482ddc[_0x5eb6fa(0x120)])&&_0x482ddc[_0x5eb6fa(0x120)]['forEach']((_0xd4e09b,_0x559fe9)=>{const _0x2086ba=_0x5eb6fa;if(!_0xd4e09b['name'])throw new Error(_0x2086ba(0xd2)+_0x559fe9+']:\x20Missing\x20required\x20field\x20\x27name\x27');});_0x482ddc[_0x5eb6fa(0x113)]&&Array['isArray'](_0x482ddc['attributes'])&&_0x482ddc[_0x5eb6fa(0x113)][_0x5eb6fa(0x114)]((_0x372061,_0x5c94a4)=>{const _0x18ce74=_0x5eb6fa;if(!_0x372061[_0x18ce74(0xf3)])throw new Error(_0x18ce74(0xda)+_0x5c94a4+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x372061[_0x18ce74(0xc5)]&&!_0xd69001[_0x18ce74(0xf7)](_0x372061[_0x18ce74(0xc5)]))throw new Error('realtime.attributes['+_0x5c94a4+_0x18ce74(0x103)+_0x372061[_0x18ce74(0xf3)]+_0x18ce74(0x133)+_0x372061[_0x18ce74(0xc5)]+_0x18ce74(0x134)+_0xd69001[_0x18ce74(0xfc)](',\x20'));});if(_0x482ddc[_0x5eb6fa(0x111)]){if(!_0x482ddc[_0x5eb6fa(0x111)][_0x5eb6fa(0xea)])throw new Error(_0x5eb6fa(0xcc));}}function a152_0x1d1d(_0x854db4,_0x72ee6c){_0x854db4=_0x854db4-0xc4;const _0xf0cb03=a152_0xf0cb();let _0x1d1d34=_0xf0cb03[_0x854db4];return _0x1d1d34;}function validatePersonalizationServices(_0x2f8302){const _0xf50aae=a152_0x1d1d;if(!Array[_0xf50aae(0xdc)](_0x2f8302))throw new Error(_0xf50aae(0xd9));_0x2f8302[_0xf50aae(0x114)]((_0x9018ab,_0x36cb8a)=>{const _0x52bf1f=_0xf50aae;if(!_0x9018ab[_0x52bf1f(0xf3)])throw new Error('personalization_services['+_0x36cb8a+_0x52bf1f(0xd3));});}export function generateTemplate(_0x413e16,_0x535e5e,_0x5cd41b){const _0x45ef8d=a152_0x1d1d,_0x220d00={'name':_0x413e16,'description':_0x45ef8d(0xc9),'master':{'database':_0x535e5e,'table':_0x5cd41b},'schedule':{'type':_0x45ef8d(0x12b),'time':_0x45ef8d(0xed),'timezone':_0x45ef8d(0xca)},'attributes':[{'name':_0x45ef8d(0xee),'source':{'database':_0x535e5e,'table':_0x45ef8d(0x128)},'join':{'parent_key':'id','child_key':_0x45ef8d(0x10d)},'columns':[{'column':'column_name','label':'Display\x20Name','type':_0x45ef8d(0x130)}]}],'behaviors':[{'name':_0x45ef8d(0xd6),'source':{'database':_0x535e5e,'table':_0x45ef8d(0x121)},'join':{'parent_key':_0x45ef8d(0xe1),'child_key':_0x45ef8d(0x10d)},'all_columns':!![]}]};return serializeDef(_0x220d00);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a153_0x3a5c(_0x540f2a,_0x124038){_0x540f2a=_0x540f2a-0x1b7;const _0x27759f=a153_0x2775();let _0x3a5ca4=_0x27759f[_0x540f2a];return _0x3a5ca4;}(function(_0x18f59e,_0x24a3b7){const _0x30ef36=a153_0x3a5c,_0x1e0261=_0x18f59e();while(!![]){try{const _0x353edc=-parseInt(_0x30ef36(0x1d7))/0x1*(-parseInt(_0x30ef36(0x1e3))/0x2)+-parseInt(_0x30ef36(0x1c5))/0x3+parseInt(_0x30ef36(0x1d9))/0x4*(-parseInt(_0x30ef36(0x1e9))/0x5)+parseInt(_0x30ef36(0x1ef))/0x6+parseInt(_0x30ef36(0x1e5))/0x7+parseInt(_0x30ef36(0x1f1))/0x8+-parseInt(_0x30ef36(0x200))/0x9*(-parseInt(_0x30ef36(0x1fb))/0xa);if(_0x353edc===_0x24a3b7)break;else _0x1e0261['push'](_0x1e0261['shift']());}catch(_0x15302a){_0x1e0261['push'](_0x1e0261['shift']());}}}(a153_0x2775,0xc5325));function a153_0x2775(){const _0x4bf47f=['clear','11158280OsujJO','set','Processing\x20journey:\x20','relationships','buildIdToNameMap','listJourneysWithDetailsFromParentSegment','listFolders','versionNumber','getJourney','Processing\x20segments','4038020hewgTV','segments/','state','kind','getSegment','18tLFTOJ','description','folderId','Fetching\x20segments,\x20folders,\x20and\x20journeys','get','attributes','has','targetResourceName','paused','Resolving\x20parent\x20segment','toLowerCase','buildIdToEmailMap','update','journey','Fetching\x20users\x20and\x20connections','4421328DsoMFM','all','user','createdAt','parentFolder','tdx.json','listActivations','slice','from','segment','audienceId','push','journeyBundleId','name','getLatestJourneyId','filter','length','reduce','30203uKLMnT','rule','16ijPfGM','journeyBundleName','listSegments','getParent','.yml','activation_','isNew','add','Processing\x20journeys','values','16KFfKGc','Fetching\x20activations','6998054akanzy','relative','utf-8','join','1627475NZzcaP','data','segmentFolderId','map','resolveParentId','hasChanges','838428hGHYsm'];a153_0x2775=function(){return _0x4bf47f;};return a153_0x2775();}import a153_0x478539 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 a153_0x3162b7,normalizeJourneyDef,parseYamlString as a153_0x19c33b}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(_0x4c089a,_0x1c0826,_0x2dd344){const _0x1125e5=a153_0x3a5c,_0x42ca86=a153_0x478539[_0x1125e5(0x1e6)](_0x2dd344,_0x4c089a);if(existsSync(_0x4c089a)){const _0x3e5910=readFileSync(_0x4c089a,_0x1125e5(0x1e7)),_0x5161a5=generateDiff(_0x3e5910,_0x1c0826),_0x456f1a=hasChanges(_0x5161a5);return{'relativePath':_0x42ca86,'absolutePath':_0x4c089a,'content':_0x1c0826,'isNew':![],'hasChanges':_0x456f1a,'diff':_0x456f1a?formatDiffWithColors(_0x5161a5):undefined};}return{'relativePath':_0x42ca86,'absolutePath':_0x4c089a,'content':_0x1c0826,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x282794,_0x46c83b,_0xc3bbd1){const _0x4957a1=a153_0x3a5c,_0x68f68d=_0x282794+':'+_0x46c83b,_0x256f9b=_0xc3bbd1[_0x4957a1(0x1ba)](_0x68f68d)||0x0;_0xc3bbd1[_0x4957a1(0x1f2)](_0x68f68d,_0x256f9b+0x1);if(_0x256f9b===0x0)return _0x46c83b;return _0x46c83b+'_'+(_0x256f9b+0x1);}export async function pullSegments(_0x4e9961,_0x19cb8a,_0x33f045={}){const _0x5713c9=a153_0x3a5c,{targetDir:_0x6340f,progress:_0x844dd9}=_0x33f045;_0x844dd9?.[_0x5713c9(0x1c2)](_0x5713c9(0x1bf));const _0x5243c3=await _0x4e9961['segment'][_0x5713c9(0x1ed)](_0x19cb8a);_0x844dd9?.[_0x5713c9(0x1c2)]('Fetching\x20parent\x20segment\x20info');const _0x5ad236=await _0x4e9961[_0x5713c9(0x1ce)][_0x5713c9(0x1dc)](_0x5243c3),_0x16eb46=_0x5ad236[_0x5713c9(0x1bb)][_0x5713c9(0x1d2)];_0x844dd9?.['update'](_0x5713c9(0x1b9));const [_0x4fc50b,_0x371f65,_0x55cc07]=await Promise[_0x5713c9(0x1c6)]([_0x4e9961[_0x5713c9(0x1ce)][_0x5713c9(0x1db)](_0x5243c3),_0x4e9961['segment'][_0x5713c9(0x1f7)](_0x5243c3),_0x4e9961[_0x5713c9(0x1c3)][_0x5713c9(0x1f6)](_0x5243c3,{'includeAllVersions':!![]})]),{journeys:_0x45f0ae,activationStepsById:_0x1a92eb}=_0x55cc07,_0x25e7d2=new Map();for(const _0x3308ca of _0x45f0ae){_0x25e7d2[_0x5713c9(0x1f2)](_0x3308ca['id'],_0x3308ca);}const _0x4f74d5=_0x45f0ae[_0x5713c9(0x1ec)](_0x855c0b=>({'id':_0x855c0b['id'],'name':_0x855c0b[_0x5713c9(0x1bb)][_0x5713c9(0x1d2)],'journeyBundleName':_0x855c0b[_0x5713c9(0x1bb)][_0x5713c9(0x1da)]||'','journeyBundleId':_0x855c0b[_0x5713c9(0x1bb)]['journeyBundleId']||'','versionNumber':_0x855c0b[_0x5713c9(0x1bb)][_0x5713c9(0x1f8)],'description':_0x855c0b[_0x5713c9(0x1bb)][_0x5713c9(0x1b7)],'state':_0x855c0b[_0x5713c9(0x1bb)][_0x5713c9(0x1fd)],'paused':_0x855c0b[_0x5713c9(0x1bb)][_0x5713c9(0x1be)],'audienceId':_0x855c0b[_0x5713c9(0x1bb)][_0x5713c9(0x1cf)],'folderId':_0x855c0b[_0x5713c9(0x1f4)]?.[_0x5713c9(0x1c9)]?.[_0x5713c9(0x1ea)]?.['id'],'createdAt':_0x855c0b[_0x5713c9(0x1bb)][_0x5713c9(0x1c8)],'updatedAt':_0x855c0b['attributes']['updatedAt']})),_0x24158d=buildFolderIdToPathMap(_0x371f65),_0x539cc3=_0x6340f||_0x5713c9(0x1fc)+sanitizeFileName(_0x16eb46);_0x844dd9?.[_0x5713c9(0x1c2)](_0x5713c9(0x1e4));const _0x30ffb9=new Map();await batchAsync(_0x4fc50b,async _0x5940df=>{const _0x5e10ad=_0x5713c9,_0x3d19c9=await _0x4e9961[_0x5e10ad(0x1ce)][_0x5e10ad(0x1cb)](_0x5243c3,_0x5940df['id']);_0x30ffb9[_0x5e10ad(0x1f2)](_0x5940df['id'],_0x3d19c9);}),_0x844dd9?.['update'](_0x5713c9(0x1c4));const [_0x4752cd,_0x44bc52]=await Promise[_0x5713c9(0x1c6)]([_0x4e9961[_0x5713c9(0x1c7)][_0x5713c9(0x1c1)](),_0x4e9961['connection'][_0x5713c9(0x1f5)]()]),_0x219e0f=[],_0x3fbe45=new Map(),_0x4e5eba=a153_0x478539['join'](_0x539cc3,_0x5713c9(0x1ca)),_0x506e1d=createTdxConfigContent(_0x16eb46);_0x219e0f[_0x5713c9(0x1d0)](prepareFile(_0x4e5eba,_0x506e1d,_0x539cc3));const _0x1d029b=new Map();for(const _0x1cb202 of _0x4fc50b){_0x1d029b[_0x5713c9(0x1f2)](_0x1cb202['id'],_0x1cb202);}let _0x558b3f=_0x4fc50b;if(_0x33f045[_0x5713c9(0x1bd)]){const _0x5048a9=_0x4fc50b[_0x5713c9(0x1d4)](_0x2a947c=>_0x2a947c['name'][_0x5713c9(0x1c0)]()===_0x33f045[_0x5713c9(0x1bd)][_0x5713c9(0x1c0)]());_0x5048a9[_0x5713c9(0x1d5)]>0x0&&(_0x558b3f=_0x5048a9);}_0x844dd9?.[_0x5713c9(0x1c2)](_0x5713c9(0x1fa));for(const _0x478ca1 of _0x558b3f){if(_0x478ca1['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x314e62=_0x478ca1['segmentFolderId']?_0x24158d['get'](_0x478ca1[_0x5713c9(0x1eb)])||'':'',_0x5d906b=_0x30ffb9['get'](_0x478ca1['id'])||[],_0x5651ef=segmentWithActivationsToYaml(_0x478ca1,_0x5d906b,undefined,_0x4752cd,_0x44bc52),_0x48be1c=_0x314e62?a153_0x478539[_0x5713c9(0x1e8)](_0x539cc3,_0x314e62):_0x539cc3,_0x407a4e=sanitizeFileName(_0x478ca1[_0x5713c9(0x1d2)]),_0x2fb177=getUniqueFileName(_0x48be1c,_0x407a4e,_0x3fbe45),_0x5c9021=a153_0x478539[_0x5713c9(0x1e8)](_0x48be1c,_0x2fb177+_0x5713c9(0x1dd)),_0x4ea698=segmentToYamlString(_0x5651ef);_0x219e0f[_0x5713c9(0x1d0)](prepareFile(_0x5c9021,_0x4ea698,_0x539cc3));}const _0x45b294=new Map();for(const _0x5ab94f of _0x4f74d5){const _0x31b406=_0x5ab94f[_0x5713c9(0x1d1)];!_0x45b294['has'](_0x31b406)&&_0x45b294[_0x5713c9(0x1f2)](_0x31b406,[]),_0x45b294[_0x5713c9(0x1ba)](_0x31b406)[_0x5713c9(0x1d0)](_0x5ab94f);}for(const _0x4351a6 of _0x45b294[_0x5713c9(0x1e2)]()){_0x4351a6['sort']((_0x170582,_0x5a660a)=>(_0x170582[_0x5713c9(0x1f8)]||0x0)-(_0x5a660a[_0x5713c9(0x1f8)]||0x0));}if(_0x33f045[_0x5713c9(0x1bd)]){const _0x2ee49e=new Map();for(const [_0x411025,_0x5a4683]of _0x45b294){const _0x341f51=_0x5a4683[0x0][_0x5713c9(0x1da)];if(_0x341f51[_0x5713c9(0x1c0)]()===_0x33f045[_0x5713c9(0x1bd)][_0x5713c9(0x1c0)]()){_0x2ee49e[_0x5713c9(0x1f2)](_0x411025,_0x5a4683);break;}}_0x45b294[_0x5713c9(0x1f0)]();for(const [_0x44d752,_0x554549]of _0x2ee49e){_0x45b294['set'](_0x44d752,_0x554549);}}if(_0x45b294['size']>0x0){_0x844dd9?.[_0x5713c9(0x1c2)](_0x5713c9(0x1e1));const _0x188a1b=Array[_0x5713c9(0x1cd)](_0x45b294[_0x5713c9(0x1e2)]()),_0x5adf5d=0x5,{createYamlContext:_0x1f8ca0}=createYamlContextForBundle(_0x4e9961,_0x1d029b,_0x4752cd,_0x44bc52,_0x1a92eb,_0x25e7d2);for(let _0x2f837c=0x0;_0x2f837c<_0x188a1b[_0x5713c9(0x1d5)];_0x2f837c+=_0x5adf5d){const _0xadc166=_0x188a1b[_0x5713c9(0x1cc)](_0x2f837c,_0x2f837c+_0x5adf5d),_0x46ff59=await Promise[_0x5713c9(0x1c6)](_0xadc166[_0x5713c9(0x1ec)](async _0x1629d2=>{const _0x599a26=_0x5713c9,_0x434fb4=_0x1629d2[0x0],_0xf269a1=_0x434fb4[_0x599a26(0x1da)];_0x844dd9?.[_0x599a26(0x1c2)](_0x599a26(0x1f3)+_0xf269a1);const _0x285983=_0x434fb4[_0x599a26(0x1b8)]?_0x24158d[_0x599a26(0x1ba)](_0x434fb4[_0x599a26(0x1b8)])||'':'',_0x1d3caf=_0x285983?a153_0x478539[_0x599a26(0x1e8)](_0x539cc3,_0x285983):_0x539cc3,_0x3bdbba=sanitizeFileName(_0xf269a1),_0x3420b7=a153_0x478539['join'](_0x1d3caf,_0x3bdbba+_0x599a26(0x1dd));let _0x214255;if(existsSync(_0x3420b7))try{const _0x4f4443=readFileSync(_0x3420b7,_0x599a26(0x1e7)),_0xa3fb50=a153_0x19c33b(_0x4f4443);_0x214255=buildLocalRuleToNameMappingFromJourney(_0xa3fb50);}catch{}const _0x4dbcfb=[];for(const _0x51637d of _0x1629d2){const _0x12ea4a=_0x25e7d2['get'](_0x51637d['id']);if(!_0x12ea4a){_0x844dd9?.['update']('Warning:\x20Journey\x20'+_0x51637d['id']+'\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping');continue;}const _0x1725ea=_0x12ea4a[_0x599a26(0x1bb)]?.['audienceId'],_0x1bb0b3=_0x1f8ca0(_0x51637d['id'],_0x1725ea),_0x261b15=await journeyResponseToDef(_0x12ea4a,_0x1bb0b3);_0x4dbcfb[_0x599a26(0x1d0)]({'item':_0x51637d,'yaml':_0x261b15});}const _0x6a5ed5=await _0x4e9961['journey'][_0x599a26(0x1d3)](_0x434fb4[_0x599a26(0x1d1)]),_0x5e5034=buildMergedJourneyDef(_0x4dbcfb,_0x214255,_0x6a5ed5);return{'bundleName':_0xf269a1,'folderPath':_0x285983,'finalYaml':_0x5e5034};}));for(const {bundleName:_0x47e5b5,folderPath:_0x328f6a,finalYaml:_0x1a00a0}of _0x46ff59){const _0x508e61=normalizeJourneyDef(_0x1a00a0),_0xc4dbb0=a153_0x3162b7(_0x508e61),_0xe8e9cf=_0x328f6a?a153_0x478539[_0x5713c9(0x1e8)](_0x539cc3,_0x328f6a):_0x539cc3,_0x477e6f=sanitizeFileName(_0x47e5b5),_0x5b037a=getUniqueFileName(_0xe8e9cf,_0x477e6f,_0x3fbe45),_0x471ae0=a153_0x478539[_0x5713c9(0x1e8)](_0xe8e9cf,_0x5b037a+'.yml');_0x219e0f[_0x5713c9(0x1d0)](prepareFile(_0x471ae0,_0xc4dbb0,_0x539cc3));}}}const _0x2893e8=Array[_0x5713c9(0x1cd)](_0x30ffb9[_0x5713c9(0x1e2)]())[_0x5713c9(0x1d6)]((_0xc8f3f1,_0x1924af)=>_0xc8f3f1+_0x1924af[_0x5713c9(0x1d5)],0x0),_0x34a313=_0x558b3f[_0x5713c9(0x1d4)](_0xe74dd9=>_0xe74dd9[_0x5713c9(0x1fe)]!==SEGMENT_KIND_JOURNEY),_0x326e74=_0x219e0f[_0x5713c9(0x1d4)](_0x384c17=>_0x384c17[_0x5713c9(0x1df)])[_0x5713c9(0x1d5)],_0x1b63af=_0x219e0f['filter'](_0x11beac=>!_0x11beac[_0x5713c9(0x1df)]&&_0x11beac['hasChanges'])[_0x5713c9(0x1d5)],_0x5aeeff=_0x219e0f['filter'](_0x4fbb4b=>!_0x4fbb4b['isNew']&&!_0x4fbb4b[_0x5713c9(0x1ee)])[_0x5713c9(0x1d5)],_0x3bf80d=Array[_0x5713c9(0x1cd)](_0x45b294[_0x5713c9(0x1e2)]())[_0x5713c9(0x1d6)]((_0x8605f2,_0x5ba70c)=>_0x8605f2+_0x5ba70c[_0x5713c9(0x1d5)],0x0);return{'parentName':_0x16eb46,'parentId':_0x5243c3,'targetDir':_0x539cc3,'files':_0x219e0f,'counts':{'segments':_0x34a313[_0x5713c9(0x1d5)],'journeys':_0x45b294['size'],'journeyVersions':_0x3bf80d,'activations':_0x2893e8},'newFiles':_0x326e74,'changedFiles':_0x1b63af,'unchangedFiles':_0x5aeeff};}function createYamlContextForBundle(_0x392a70,_0x34ba09,_0x140928,_0x21f284,_0xbe317f,_0x53daeb){const _0x39dc49=new Set(),_0x282392=new Map(),_0x1fcf11=new Map(),_0x2014c6=createJumpTargetCache(),_0x250266=async(_0x5c3dd1,_0x1ec239)=>{const _0x20f93e=a153_0x3a5c,_0x8ef1d1=_0x282392[_0x20f93e(0x1ba)](_0x5c3dd1);if(_0x8ef1d1!==undefined)return _0x8ef1d1;if(!_0x1ec239)return _0x5c3dd1;try{let _0x1a956f=_0x34ba09[_0x20f93e(0x1ba)](_0x5c3dd1);!_0x1a956f&&(_0x1a956f=await _0x392a70['segment'][_0x20f93e(0x1ff)](_0x1ec239,_0x5c3dd1),_0x34ba09[_0x20f93e(0x1f2)](_0x5c3dd1,_0x1a956f));const _0x1f2233=generateJourneyLocalName(_0x1a956f['name']),_0x4b500a=_0x1a956f[_0x20f93e(0x1fe)]===SEGMENT_KIND_JOURNEY&&_0x1f2233!==undefined;if(_0x4b500a&&_0x1f2233){let _0x2ab842=_0x1f2233,_0x2ba457=0x2;while(_0x39dc49[_0x20f93e(0x1bc)](_0x2ab842)){_0x2ab842=_0x1f2233+'_'+_0x2ba457,_0x2ba457++;}return _0x39dc49[_0x20f93e(0x1e0)](_0x2ab842),_0x282392[_0x20f93e(0x1f2)](_0x5c3dd1,_0x2ab842),_0x2ab842;}return _0x1a956f['name'];}catch{return _0x5c3dd1;}},_0x48637e=(_0x5260ab,_0x192ad7)=>({'resolveSegment':async _0x4855fa=>{const _0x4f0907=a153_0x3a5c,_0x207b49=_0x282392[_0x4f0907(0x1ba)](_0x4855fa);if(_0x207b49!==undefined)return{'name':_0x207b49,'isJourneyLocal':!![]};if(!_0x192ad7)return{'name':_0x4855fa,'isJourneyLocal':![]};try{let _0xda2e24=_0x34ba09[_0x4f0907(0x1ba)](_0x4855fa);!_0xda2e24&&(_0xda2e24=await _0x392a70['segment'][_0x4f0907(0x1ff)](_0x192ad7,_0x4855fa),_0x34ba09[_0x4f0907(0x1f2)](_0x4855fa,_0xda2e24));const _0x501dee=generateJourneyLocalName(_0xda2e24[_0x4f0907(0x1d2)]),_0x312e1f=_0xda2e24[_0x4f0907(0x1fe)]===SEGMENT_KIND_JOURNEY&&_0x501dee!==undefined;if(_0x312e1f&&!_0xda2e24['rule']&&_0x192ad7)try{const _0x3f2af8=await _0x392a70[_0x4f0907(0x1ce)][_0x4f0907(0x1ff)](_0x192ad7,_0x4855fa);_0x34ba09[_0x4f0907(0x1f2)](_0x4855fa,_0x3f2af8),_0xda2e24=_0x3f2af8;}catch{}const _0x4c7e43=await _0x250266(_0x4855fa,_0x192ad7);let _0x3a09d8;if(_0x312e1f&&_0xda2e24[_0x4f0907(0x1d8)]){const _0x2b0d02=await segmentResponseToDef(_0xda2e24,{'resolveSegmentName':_0x24a7ab=>_0x250266(_0x24a7ab,_0x192ad7)});_0x3a09d8={'description':_0xda2e24[_0x4f0907(0x1b7)],'rule':_0x2b0d02['rule']};}return{'name':_0x4c7e43,'isJourneyLocal':_0x312e1f,'definition':_0x3a09d8};}catch{return{'name':_0x4855fa,'isJourneyLocal':![]};}},'resolveActivation':async _0x4ff907=>{const _0x178075=a153_0x3a5c,_0x45b88c=_0x1fcf11['get'](_0x4ff907);if(_0x45b88c!==undefined)return{'name':_0x45b88c,'isJourneyLocal':!![]};try{let _0x166df3=_0xbe317f[_0x178075(0x1ba)](_0x4ff907);!_0x166df3&&(_0x166df3=await _0x392a70[_0x178075(0x1c3)]['getActivation'](_0x5260ab,_0x4ff907));const _0x551548=_0x166df3[_0x178075(0x1bb)]['activationParams'][_0x178075(0x1d2)]||_0x4ff907,_0x1d04b9=sanitizeYamlKey(_0x551548)||_0x178075(0x1de)+_0x4ff907,_0x322a93=_0x1d04b9;_0x1fcf11[_0x178075(0x1f2)](_0x4ff907,_0x322a93);const _0x9c4e73=journeyActivationStepToYaml(_0x166df3,_0x140928,_0x21f284);return{'name':_0x322a93,'isJourneyLocal':!![],'definition':_0x9c4e73};}catch{return{'name':_0x4ff907,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x40e363,_0x4826ed)=>resolveJumpTarget(_0x40e363,_0x4826ed,_0x2014c6,async _0x174407=>{const _0x51e1d0=a153_0x3a5c,_0xd9df5c=_0x53daeb['get'](_0x174407);if(_0xd9df5c)return _0xd9df5c;return _0x392a70[_0x51e1d0(0x1c3)][_0x51e1d0(0x1f9)](_0x174407);})});return{'createYamlContext':_0x48637e};}
|
|
1
|
+
(function(_0x1c80a6,_0xa733be){const _0x21a680=a153_0x5e56,_0x25ff51=_0x1c80a6();while(!![]){try{const _0x4f3dad=parseInt(_0x21a680(0x1b4))/0x1+-parseInt(_0x21a680(0x17e))/0x2+-parseInt(_0x21a680(0x1bf))/0x3+-parseInt(_0x21a680(0x184))/0x4+-parseInt(_0x21a680(0x18e))/0x5+-parseInt(_0x21a680(0x17b))/0x6+-parseInt(_0x21a680(0x1be))/0x7*(-parseInt(_0x21a680(0x1ac))/0x8);if(_0x4f3dad===_0xa733be)break;else _0x25ff51['push'](_0x25ff51['shift']());}catch(_0x3166dc){_0x25ff51['push'](_0x25ff51['shift']());}}}(a153_0x43ff,0xecd61));function a153_0x5e56(_0x11e13c,_0x55340e){_0x11e13c=_0x11e13c-0x17b;const _0x43ff78=a153_0x43ff();let _0x5e567d=_0x43ff78[_0x11e13c];return _0x5e567d;}import a153_0x11488e 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';function a153_0x43ff(){const _0x21418b=['length','slice','map','activationParams','activation_','Fetching\x20users\x20and\x20connections','values','rule','21GTPkBu','4093662ISCNwq','versionNumber','relationships','segmentFolderId','9093810QcJPWM','set','push','2175530EECGJl','relative','Fetching\x20activations','resolveParentId','journeyBundleId','buildIdToEmailMap','544556tvUBtH','journey','.yml','utf-8','name','state','kind','all','getLatestJourneyId','has','354740HPMkId','updatedAt','sort','join','toLowerCase','description','targetResourceName','hasChanges','Warning:\x20Journey\x20','isNew','listJourneysWithDetailsFromParentSegment','segments/','attributes','from','tdx.json','parentFolder','add','Processing\x20segments','getJourney','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','paused','filter','folderId','listActivations','get','getActivation','getParent','Processing\x20journeys','connection','reduce','11288744BDsgKP','Fetching\x20parent\x20segment\x20info','update','segment','data','getSegment','journeyBundleName','buildIdToNameMap','911843BSUYmx','clear'];a153_0x43ff=function(){return _0x21418b;};return a153_0x43ff();}import{journeyResponseToDef,toYamlString as a153_0x4ab890,normalizeJourneyDef,parseYamlString as a153_0x2c1129}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(_0x328494,_0x423cd7,_0x4d8354){const _0xf57380=a153_0x5e56,_0x362df4=a153_0x11488e[_0xf57380(0x17f)](_0x4d8354,_0x328494);if(existsSync(_0x328494)){const _0x4867ff=readFileSync(_0x328494,_0xf57380(0x187)),_0x30628d=generateDiff(_0x4867ff,_0x423cd7),_0x49c9dc=hasChanges(_0x30628d);return{'relativePath':_0x362df4,'absolutePath':_0x328494,'content':_0x423cd7,'isNew':![],'hasChanges':_0x49c9dc,'diff':_0x49c9dc?formatDiffWithColors(_0x30628d):undefined};}return{'relativePath':_0x362df4,'absolutePath':_0x328494,'content':_0x423cd7,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x12de16,_0x4207b3,_0x174828){const _0x554d5c=a153_0x5e56,_0x3966a1=_0x12de16+':'+_0x4207b3,_0x41095c=_0x174828['get'](_0x3966a1)||0x0;_0x174828[_0x554d5c(0x17c)](_0x3966a1,_0x41095c+0x1);if(_0x41095c===0x0)return _0x4207b3;return _0x4207b3+'_'+(_0x41095c+0x1);}export async function pullSegments(_0x2dc9a0,_0x127f47,_0x5732ae={}){const _0x524466=a153_0x5e56,{targetDir:_0x3e5a65,progress:_0x4625e7}=_0x5732ae;_0x4625e7?.[_0x524466(0x1ae)]('Resolving\x20parent\x20segment');const _0x5601a9=await _0x2dc9a0[_0x524466(0x1af)][_0x524466(0x181)](_0x127f47);_0x4625e7?.[_0x524466(0x1ae)](_0x524466(0x1ad));const _0x5389dd=await _0x2dc9a0[_0x524466(0x1af)][_0x524466(0x1a8)](_0x5601a9),_0x548cf9=_0x5389dd[_0x524466(0x19a)][_0x524466(0x188)];_0x4625e7?.['update']('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x538338,_0x316ea2,_0x249562]=await Promise[_0x524466(0x18b)]([_0x2dc9a0[_0x524466(0x1af)]['listSegments'](_0x5601a9),_0x2dc9a0[_0x524466(0x1af)]['listFolders'](_0x5601a9),_0x2dc9a0[_0x524466(0x185)][_0x524466(0x198)](_0x5601a9,{'includeAllVersions':!![]})]),{journeys:_0x48be14,activationStepsById:_0x3bd9e7}=_0x249562,_0x51d442=new Map();for(const _0x5d64cd of _0x48be14){_0x51d442[_0x524466(0x17c)](_0x5d64cd['id'],_0x5d64cd);}const _0xe9d0cc=_0x48be14[_0x524466(0x1b8)](_0x5533b8=>({'id':_0x5533b8['id'],'name':_0x5533b8[_0x524466(0x19a)]['name'],'journeyBundleName':_0x5533b8[_0x524466(0x19a)][_0x524466(0x1b2)]||'','journeyBundleId':_0x5533b8[_0x524466(0x19a)]['journeyBundleId']||'','versionNumber':_0x5533b8[_0x524466(0x19a)][_0x524466(0x1c0)],'description':_0x5533b8[_0x524466(0x19a)][_0x524466(0x193)],'state':_0x5533b8[_0x524466(0x19a)][_0x524466(0x189)],'paused':_0x5533b8[_0x524466(0x19a)][_0x524466(0x1a2)],'audienceId':_0x5533b8['attributes']['audienceId'],'folderId':_0x5533b8[_0x524466(0x1c1)]?.[_0x524466(0x19d)]?.[_0x524466(0x1b0)]?.['id'],'createdAt':_0x5533b8[_0x524466(0x19a)]['createdAt'],'updatedAt':_0x5533b8[_0x524466(0x19a)][_0x524466(0x18f)]})),_0x154e56=buildFolderIdToPathMap(_0x316ea2),_0x247b02=_0x3e5a65||_0x524466(0x199)+sanitizeFileName(_0x548cf9);_0x4625e7?.[_0x524466(0x1ae)](_0x524466(0x180));const _0x33d87f=new Map();await batchAsync(_0x538338,async _0x3aad9c=>{const _0x471c7a=_0x524466,_0x2d8ba7=await _0x2dc9a0['segment'][_0x471c7a(0x1a5)](_0x5601a9,_0x3aad9c['id']);_0x33d87f[_0x471c7a(0x17c)](_0x3aad9c['id'],_0x2d8ba7);}),_0x4625e7?.[_0x524466(0x1ae)](_0x524466(0x1bb));const [_0x467db8,_0x445ad0]=await Promise['all']([_0x2dc9a0['user'][_0x524466(0x183)](),_0x2dc9a0[_0x524466(0x1aa)][_0x524466(0x1b3)]()]),_0x189def=[],_0x421eaa=new Map(),_0x2968e1=a153_0x11488e[_0x524466(0x191)](_0x247b02,_0x524466(0x19c)),_0x4e26d9=createTdxConfigContent(_0x548cf9);_0x189def[_0x524466(0x17d)](prepareFile(_0x2968e1,_0x4e26d9,_0x247b02));const _0x18e717=new Map();for(const _0x4da531 of _0x538338){_0x18e717[_0x524466(0x17c)](_0x4da531['id'],_0x4da531);}let _0x59c96b=_0x538338;if(_0x5732ae[_0x524466(0x194)]){const _0x476394=_0x538338['filter'](_0x22f922=>_0x22f922['name'][_0x524466(0x192)]()===_0x5732ae[_0x524466(0x194)][_0x524466(0x192)]());_0x476394[_0x524466(0x1b6)]>0x0&&(_0x59c96b=_0x476394);}_0x4625e7?.[_0x524466(0x1ae)](_0x524466(0x19f));for(const _0x391300 of _0x59c96b){if(_0x391300[_0x524466(0x18a)]===SEGMENT_KIND_JOURNEY)continue;const _0x1653ec=_0x391300[_0x524466(0x1c2)]?_0x154e56[_0x524466(0x1a6)](_0x391300[_0x524466(0x1c2)])||'':'',_0x34a8a1=_0x33d87f[_0x524466(0x1a6)](_0x391300['id'])||[],_0x234a22=segmentWithActivationsToYaml(_0x391300,_0x34a8a1,undefined,_0x467db8,_0x445ad0),_0x3d4a70=_0x1653ec?a153_0x11488e[_0x524466(0x191)](_0x247b02,_0x1653ec):_0x247b02,_0x217cf5=sanitizeFileName(_0x391300[_0x524466(0x188)]),_0x3c8c2e=getUniqueFileName(_0x3d4a70,_0x217cf5,_0x421eaa),_0xf48359=a153_0x11488e[_0x524466(0x191)](_0x3d4a70,_0x3c8c2e+_0x524466(0x186)),_0x2bd927=segmentToYamlString(_0x234a22);_0x189def[_0x524466(0x17d)](prepareFile(_0xf48359,_0x2bd927,_0x247b02));}const _0x1f6b7a=new Map();for(const _0x2dc152 of _0xe9d0cc){const _0x32543c=_0x2dc152[_0x524466(0x182)];!_0x1f6b7a[_0x524466(0x18d)](_0x32543c)&&_0x1f6b7a[_0x524466(0x17c)](_0x32543c,[]),_0x1f6b7a[_0x524466(0x1a6)](_0x32543c)[_0x524466(0x17d)](_0x2dc152);}for(const _0x470079 of _0x1f6b7a[_0x524466(0x1bc)]()){_0x470079[_0x524466(0x190)]((_0x36ea8b,_0x2fc327)=>(_0x36ea8b[_0x524466(0x1c0)]||0x0)-(_0x2fc327[_0x524466(0x1c0)]||0x0));}if(_0x5732ae[_0x524466(0x194)]){const _0x42371d=new Map();for(const [_0x273908,_0x342e95]of _0x1f6b7a){const _0x3560f4=_0x342e95[0x0][_0x524466(0x1b2)];if(_0x3560f4[_0x524466(0x192)]()===_0x5732ae['targetResourceName'][_0x524466(0x192)]()){_0x42371d[_0x524466(0x17c)](_0x273908,_0x342e95);break;}}_0x1f6b7a[_0x524466(0x1b5)]();for(const [_0x4ade4e,_0x47aa19]of _0x42371d){_0x1f6b7a[_0x524466(0x17c)](_0x4ade4e,_0x47aa19);}}if(_0x1f6b7a['size']>0x0){_0x4625e7?.['update'](_0x524466(0x1a9));const _0x30b971=Array[_0x524466(0x19b)](_0x1f6b7a[_0x524466(0x1bc)]()),_0x1db822=0x5,{createYamlContext:_0x3c8cec}=createYamlContextForBundle(_0x2dc9a0,_0x18e717,_0x467db8,_0x445ad0,_0x3bd9e7,_0x51d442);for(let _0x1c0083=0x0;_0x1c0083<_0x30b971[_0x524466(0x1b6)];_0x1c0083+=_0x1db822){const _0xe07ec2=_0x30b971[_0x524466(0x1b7)](_0x1c0083,_0x1c0083+_0x1db822),_0x4c95d0=await Promise['all'](_0xe07ec2[_0x524466(0x1b8)](async _0x4dbee5=>{const _0x34c88e=_0x524466,_0x53d39f=_0x4dbee5[0x0],_0xa0d3cd=_0x53d39f[_0x34c88e(0x1b2)];_0x4625e7?.[_0x34c88e(0x1ae)]('Processing\x20journey:\x20'+_0xa0d3cd);const _0x40ff39=_0x53d39f['folderId']?_0x154e56[_0x34c88e(0x1a6)](_0x53d39f[_0x34c88e(0x1a4)])||'':'',_0x13474d=_0x40ff39?a153_0x11488e[_0x34c88e(0x191)](_0x247b02,_0x40ff39):_0x247b02,_0x434a34=sanitizeFileName(_0xa0d3cd),_0x17c88b=a153_0x11488e[_0x34c88e(0x191)](_0x13474d,_0x434a34+'.yml');let _0x5e9068;if(existsSync(_0x17c88b))try{const _0x389860=readFileSync(_0x17c88b,_0x34c88e(0x187)),_0x4978ca=a153_0x2c1129(_0x389860);_0x5e9068=buildLocalRuleToNameMappingFromJourney(_0x4978ca);}catch{}const _0x3f66df=[];for(const _0x17150e of _0x4dbee5){const _0x1fc5a2=_0x51d442[_0x34c88e(0x1a6)](_0x17150e['id']);if(!_0x1fc5a2){_0x4625e7?.['update'](_0x34c88e(0x196)+_0x17150e['id']+_0x34c88e(0x1a1));continue;}const _0x1375e4=_0x1fc5a2[_0x34c88e(0x19a)]?.['audienceId'],_0x1303d8=_0x3c8cec(_0x17150e['id'],_0x1375e4),_0x210f6e=await journeyResponseToDef(_0x1fc5a2,_0x1303d8);_0x3f66df[_0x34c88e(0x17d)]({'item':_0x17150e,'yaml':_0x210f6e});}const _0xbeb92f=await _0x2dc9a0[_0x34c88e(0x185)][_0x34c88e(0x18c)](_0x53d39f[_0x34c88e(0x182)]),_0x5090ba=buildMergedJourneyDef(_0x3f66df,_0x5e9068,_0xbeb92f);return{'bundleName':_0xa0d3cd,'folderPath':_0x40ff39,'finalYaml':_0x5090ba};}));for(const {bundleName:_0x23f0ca,folderPath:_0x19fdc0,finalYaml:_0x53805a}of _0x4c95d0){const _0x49a73d=normalizeJourneyDef(_0x53805a),_0x24b72=a153_0x4ab890(_0x49a73d),_0x33a6a7=_0x19fdc0?a153_0x11488e[_0x524466(0x191)](_0x247b02,_0x19fdc0):_0x247b02,_0x36ebd3=sanitizeFileName(_0x23f0ca),_0x34c926=getUniqueFileName(_0x33a6a7,_0x36ebd3,_0x421eaa),_0x55665a=a153_0x11488e[_0x524466(0x191)](_0x33a6a7,_0x34c926+'.yml');_0x189def[_0x524466(0x17d)](prepareFile(_0x55665a,_0x24b72,_0x247b02));}}}const _0x2735df=Array[_0x524466(0x19b)](_0x33d87f['values']())[_0x524466(0x1ab)]((_0x1bee70,_0xa78b63)=>_0x1bee70+_0xa78b63[_0x524466(0x1b6)],0x0),_0x39ada4=_0x59c96b[_0x524466(0x1a3)](_0x1dcaab=>_0x1dcaab[_0x524466(0x18a)]!==SEGMENT_KIND_JOURNEY),_0x2c8ef0=_0x189def[_0x524466(0x1a3)](_0x278487=>_0x278487[_0x524466(0x197)])[_0x524466(0x1b6)],_0x3484db=_0x189def['filter'](_0x901746=>!_0x901746[_0x524466(0x197)]&&_0x901746[_0x524466(0x195)])[_0x524466(0x1b6)],_0x4cc484=_0x189def[_0x524466(0x1a3)](_0x491c26=>!_0x491c26[_0x524466(0x197)]&&!_0x491c26[_0x524466(0x195)])['length'],_0x362af9=Array[_0x524466(0x19b)](_0x1f6b7a['values']())[_0x524466(0x1ab)]((_0x494e01,_0x5d6291)=>_0x494e01+_0x5d6291[_0x524466(0x1b6)],0x0);return{'parentName':_0x548cf9,'parentId':_0x5601a9,'targetDir':_0x247b02,'files':_0x189def,'counts':{'segments':_0x39ada4['length'],'journeys':_0x1f6b7a['size'],'journeyVersions':_0x362af9,'activations':_0x2735df},'newFiles':_0x2c8ef0,'changedFiles':_0x3484db,'unchangedFiles':_0x4cc484};}function createYamlContextForBundle(_0x364a59,_0x5b6a37,_0x3207bc,_0x51f1d9,_0xa99b29,_0x50aae4){const _0xcfbfd2=new Set(),_0x3d211e=new Map(),_0x46d654=new Map(),_0x2f9ca0=createJumpTargetCache(),_0x26368c=async(_0x2fb375,_0x63b55e)=>{const _0x1eec5c=a153_0x5e56,_0x228b1d=_0x3d211e[_0x1eec5c(0x1a6)](_0x2fb375);if(_0x228b1d!==undefined)return _0x228b1d;if(!_0x63b55e)return _0x2fb375;try{let _0x2fada1=_0x5b6a37[_0x1eec5c(0x1a6)](_0x2fb375);!_0x2fada1&&(_0x2fada1=await _0x364a59['segment'][_0x1eec5c(0x1b1)](_0x63b55e,_0x2fb375),_0x5b6a37[_0x1eec5c(0x17c)](_0x2fb375,_0x2fada1));const _0x188d08=generateJourneyLocalName(_0x2fada1[_0x1eec5c(0x188)]),_0x1d50e2=_0x2fada1[_0x1eec5c(0x18a)]===SEGMENT_KIND_JOURNEY&&_0x188d08!==undefined;if(_0x1d50e2&&_0x188d08){let _0x387255=_0x188d08,_0x4bd9c5=0x2;while(_0xcfbfd2[_0x1eec5c(0x18d)](_0x387255)){_0x387255=_0x188d08+'_'+_0x4bd9c5,_0x4bd9c5++;}return _0xcfbfd2[_0x1eec5c(0x19e)](_0x387255),_0x3d211e[_0x1eec5c(0x17c)](_0x2fb375,_0x387255),_0x387255;}return _0x2fada1[_0x1eec5c(0x188)];}catch{return _0x2fb375;}},_0x9f91f6=(_0x12bdba,_0x4fa81c)=>({'resolveSegment':async _0x306ee5=>{const _0x43e32c=a153_0x5e56,_0x410b3f=_0x3d211e[_0x43e32c(0x1a6)](_0x306ee5);if(_0x410b3f!==undefined)return{'name':_0x410b3f,'isJourneyLocal':!![]};if(!_0x4fa81c)return{'name':_0x306ee5,'isJourneyLocal':![]};try{let _0x31b85e=_0x5b6a37['get'](_0x306ee5);!_0x31b85e&&(_0x31b85e=await _0x364a59['segment']['getSegment'](_0x4fa81c,_0x306ee5),_0x5b6a37[_0x43e32c(0x17c)](_0x306ee5,_0x31b85e));const _0xf724dc=generateJourneyLocalName(_0x31b85e[_0x43e32c(0x188)]),_0x5df3ab=_0x31b85e[_0x43e32c(0x18a)]===SEGMENT_KIND_JOURNEY&&_0xf724dc!==undefined;if(_0x5df3ab&&!_0x31b85e[_0x43e32c(0x1bd)]&&_0x4fa81c)try{const _0x35f34f=await _0x364a59['segment'][_0x43e32c(0x1b1)](_0x4fa81c,_0x306ee5);_0x5b6a37[_0x43e32c(0x17c)](_0x306ee5,_0x35f34f),_0x31b85e=_0x35f34f;}catch{}const _0x548800=await _0x26368c(_0x306ee5,_0x4fa81c);let _0x1dcf16;if(_0x5df3ab&&_0x31b85e['rule']){const _0x44b62a=await segmentResponseToDef(_0x31b85e,{'resolveSegmentName':_0x460050=>_0x26368c(_0x460050,_0x4fa81c)});_0x1dcf16={'description':_0x31b85e[_0x43e32c(0x193)],'rule':_0x44b62a[_0x43e32c(0x1bd)]};}return{'name':_0x548800,'isJourneyLocal':_0x5df3ab,'definition':_0x1dcf16};}catch{return{'name':_0x306ee5,'isJourneyLocal':![]};}},'resolveActivation':async _0x219436=>{const _0x473d3c=a153_0x5e56,_0x24f65e=_0x46d654['get'](_0x219436);if(_0x24f65e!==undefined)return{'name':_0x24f65e,'isJourneyLocal':!![]};try{let _0x36ca27=_0xa99b29['get'](_0x219436);!_0x36ca27&&(_0x36ca27=await _0x364a59[_0x473d3c(0x185)][_0x473d3c(0x1a7)](_0x12bdba,_0x219436));const _0x4c9663=_0x36ca27[_0x473d3c(0x19a)][_0x473d3c(0x1b9)][_0x473d3c(0x188)]||_0x219436,_0x149324=sanitizeYamlKey(_0x4c9663)||_0x473d3c(0x1ba)+_0x219436,_0x155317=_0x149324;_0x46d654[_0x473d3c(0x17c)](_0x219436,_0x155317);const _0x8f708=journeyActivationStepToYaml(_0x36ca27,_0x3207bc,_0x51f1d9);return{'name':_0x155317,'isJourneyLocal':!![],'definition':_0x8f708};}catch{return{'name':_0x219436,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xfc7e95,_0x2d2dad)=>resolveJumpTarget(_0xfc7e95,_0x2d2dad,_0x2f9ca0,async _0x4da995=>{const _0x438ae7=a153_0x5e56,_0x4d031f=_0x50aae4['get'](_0x4da995);if(_0x4d031f)return _0x4d031f;return _0x364a59[_0x438ae7(0x185)][_0x438ae7(0x1a0)](_0x4da995);})});return{'createYamlContext':_0x9f91f6};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a154_0x2f2862=a154_0x56b5;function a154_0x56b5(_0x32c0a3,_0x19f783){_0x32c0a3=_0x32c0a3-0xc9;const _0x37b58e=a154_0x37b5();let _0x56b550=_0x37b58e[_0x32c0a3];return _0x56b550;}(function(_0x3db265,_0x47da35){const _0x5b4cda=a154_0x56b5,_0x18f5cb=_0x3db265();while(!![]){try{const _0x55378b=parseInt(_0x5b4cda(0xd9))/0x1+parseInt(_0x5b4cda(0xda))/0x2*(-parseInt(_0x5b4cda(0xd4))/0x3)+-parseInt(_0x5b4cda(0xd2))/0x4+-parseInt(_0x5b4cda(0xcd))/0x5+-parseInt(_0x5b4cda(0xd6))/0x6*(-parseInt(_0x5b4cda(0xd0))/0x7)+-parseInt(_0x5b4cda(0xcf))/0x8+parseInt(_0x5b4cda(0xe0))/0x9*(parseInt(_0x5b4cda(0xd8))/0xa);if(_0x55378b===_0x47da35)break;else _0x18f5cb['push'](_0x18f5cb['shift']());}catch(_0x2e81fe){_0x18f5cb['push'](_0x18f5cb['shift']());}}}(a154_0x37b5,0xbea27));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';function a154_0x37b5(){const _0x3d7f43=['basename','6AyCRqV','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','60090UBAqao','851372IjSZcU','6dlUtlc','segments','utf-8','journeyName','stringify','dirname','4338tfWLeX','.tmp','tdx.sdk.push-recovery','debug','toISOString','ENOENT','4239275BVEIUz','warn','5841376DBCOWz','5937827lKWITV','.push-recovery.json','4023596YlboAZ','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','1231206NpKkdi'];a154_0x37b5=function(){return _0x3d7f43;};return a154_0x37b5();}import a154_0x3659ee from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a154_0x2f2862(0xc9));export function getPushRecoveryPath(_0x2cb906){const _0x2fad43=a154_0x2f2862,_0x185e00=a154_0x3659ee[_0x2fad43(0xdf)](_0x2cb906),_0x2847ae=a154_0x3659ee[_0x2fad43(0xd5)](_0x2cb906);return a154_0x3659ee['join'](_0x185e00,'.'+_0x2847ae+_0x2fad43(0xd1));}export function readPushRecovery(_0x3083eb){const _0x5dc174=a154_0x2f2862,_0x3fd9b1=getPushRecoveryPath(_0x3083eb);if(!existsSync(_0x3fd9b1))return undefined;try{const _0x2e6935=readFileSync(_0x3fd9b1,_0x5dc174(0xdc)),_0x1c414f=JSON['parse'](_0x2e6935);if(_0x1c414f?.['version']!==0x1||typeof _0x1c414f[_0x5dc174(0xdd)]!=='string')return undefined;return _0x1c414f;}catch(_0x555f4e){return _0x555f4e instanceof SyntaxError?logger[_0x5dc174(0xca)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x555f4e):logger[_0x5dc174(0xce)](_0x5dc174(0xd3)+_0x555f4e),undefined;}}export function writePushRecovery(_0x2c898e,_0x2a8fb8){const _0x1d2063=a154_0x2f2862,_0x5b7e04=getPushRecoveryPath(_0x2c898e),_0x13f380=_0x5b7e04+_0x1d2063(0xe1);writeFileSync(_0x13f380,JSON[_0x1d2063(0xde)](_0x2a8fb8,null,0x2)+'\x0a',_0x1d2063(0xdc)),renameSync(_0x13f380,_0x5b7e04);}export function deletePushRecovery(_0x2a9f66){const _0xd007df=a154_0x2f2862,_0x11f582=getPushRecoveryPath(_0x2a9f66);try{unlinkSync(_0x11f582);}catch(_0x4b0677){_0x4b0677['code']!==_0xd007df(0xcc)&&logger[_0xd007df(0xca)](_0xd007df(0xd7)+_0x4b0677);}}export function saveSegmentToPushRecovery(_0x1b1fab,_0x43c7f9,_0x42c1aa,_0x2f6fab){const _0x1add09=a154_0x2f2862,_0x40917a=readPushRecovery(_0x1b1fab),_0x5b7c49=_0x40917a?.['journeyName']===_0x43c7f9?{..._0x40917a,'updatedAt':new Date()[_0x1add09(0xcb)]()}:{'version':0x1,'journeyName':_0x43c7f9,'updatedAt':new Date()[_0x1add09(0xcb)](),'segments':{}};_0x5b7c49[_0x1add09(0xdb)][_0x42c1aa]=_0x2f6fab,writePushRecovery(_0x1b1fab,_0x5b7c49);}
|