@treasuredata/tdx 2026.3.49 → 2026.3.50
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.d.ts +6 -4
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.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/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(_0x11326c,_0x3f0df2){const _0x989415=a148_0x1483,_0x228ec2=_0x11326c();while(!![]){try{const _0x56468f=parseInt(_0x989415(0x21b))/0x1*(-parseInt(_0x989415(0x242))/0x2)+-parseInt(_0x989415(0x1dc))/0x3+-parseInt(_0x989415(0x1e5))/0x4*(parseInt(_0x989415(0x21a))/0x5)+-parseInt(_0x989415(0x245))/0x6*(parseInt(_0x989415(0x214))/0x7)+parseInt(_0x989415(0x23f))/0x8*(parseInt(_0x989415(0x22f))/0x9)+-parseInt(_0x989415(0x1f0))/0xa+parseInt(_0x989415(0x230))/0xb;if(_0x56468f===_0x3f0df2)break;else _0x228ec2['push'](_0x228ec2['shift']());}catch(_0x14dc8a){_0x228ec2['push'](_0x228ec2['shift']());}}}(a148_0x4f11,0x614bd));import*as a148_0x3dad1e from'yaml';function a148_0x1483(_0x5621fd,_0x293c67){_0x5621fd=_0x5621fd-0x1d9;const _0x4f1199=a148_0x4f11();let _0x14836b=_0x4f1199[_0x5621fd];return _0x14836b;}function formatScheduleTime(_0x34d31f){const _0xfea0fb=a148_0x1483;if(typeof _0x34d31f===_0xfea0fb(0x20d)){const _0x40554a=Math[_0xfea0fb(0x224)](_0x34d31f);return String(_0x40554a)[_0xfea0fb(0x1f9)](0x2,'0')+_0xfea0fb(0x211);}if(typeof _0x34d31f===_0xfea0fb(0x220)){if(/^\d{2}:\d{2}:\d{2}$/['test'](_0x34d31f))return _0x34d31f;if(/^\d{1,2}:\d{2}$/[_0xfea0fb(0x1fd)](_0x34d31f)){const [_0x54c162,_0x4bdd97]=_0x34d31f[_0xfea0fb(0x200)](':');return _0x54c162['padStart'](0x2,'0')+':'+_0x4bdd97+_0xfea0fb(0x1e0);}const _0x21ced0=parseInt(_0x34d31f,0xa);if(!isNaN(_0x21ced0)&&_0x34d31f['match'](/^\d+$/))return String(_0x21ced0)['padStart'](0x2,'0')+_0xfea0fb(0x211);return _0x34d31f;}return String(_0x34d31f);}export function apiToDef(_0xe74a57){const _0x1ee3cc=a148_0x1483,_0x4713dc={'database':_0xe74a57['master']?.['parentDatabaseName']||'','table':_0xe74a57[_0x1ee3cc(0x1df)]?.[_0x1ee3cc(0x216)]||''};_0xe74a57[_0x1ee3cc(0x1ed)]&&_0xe74a57[_0x1ee3cc(0x1ed)][_0x1ee3cc(0x215)]>0x0&&(_0x4713dc[_0x1ee3cc(0x1ef)]=_0xe74a57['audienceFilters'][_0x1ee3cc(0x21d)](_0x3c1144=>({'column':_0x3c1144[_0x1ee3cc(0x229)],'values':_0x3c1144['rightValues']})));let _0x4be8b8;_0xe74a57[_0x1ee3cc(0x21f)]&&_0xe74a57['scheduleType']!==_0x1ee3cc(0x206)&&(_0x4be8b8={'type':_0xe74a57['scheduleType']},_0xe74a57[_0x1ee3cc(0x243)]&&(_0x4be8b8[_0x1ee3cc(0x227)]=formatScheduleTime(_0xe74a57[_0x1ee3cc(0x243)])),_0xe74a57['timezone']&&(_0x4be8b8[_0x1ee3cc(0x246)]=_0xe74a57[_0x1ee3cc(0x246)]));let _0x347503;(_0xe74a57[_0x1ee3cc(0x233)]||_0xe74a57[_0x1ee3cc(0x1fe)]||_0xe74a57[_0x1ee3cc(0x1d9)])&&(_0x347503={},_0xe74a57[_0x1ee3cc(0x233)]&&(_0x347503[_0x1ee3cc(0x1e8)]=_0xe74a57[_0x1ee3cc(0x233)]),_0xe74a57[_0x1ee3cc(0x1fe)]&&(_0x347503[_0x1ee3cc(0x24b)]=_0xe74a57[_0x1ee3cc(0x1fe)]),_0xe74a57[_0x1ee3cc(0x1d9)]&&(_0x347503[_0x1ee3cc(0x1eb)]=_0xe74a57[_0x1ee3cc(0x1d9)]));const _0x1d9db6=_0xe74a57['attributes']&&_0xe74a57[_0x1ee3cc(0x232)][_0x1ee3cc(0x215)]>0x0?groupAttributesBySource(_0xe74a57['attributes']):undefined,_0x58b21b=_0xe74a57[_0x1ee3cc(0x1fb)]&&_0xe74a57[_0x1ee3cc(0x1fb)][_0x1ee3cc(0x215)]>0x0?_0xe74a57['behaviors'][_0x1ee3cc(0x21d)](convertApiBehaviorToYaml):undefined;let _0x1a9840;_0xe74a57[_0x1ee3cc(0x234)]&&(_0x1a9840={'name':_0xe74a57[_0x1ee3cc(0x234)][_0x1ee3cc(0x218)],'source':{'database':_0xe74a57[_0x1ee3cc(0x234)]['parentDatabaseName'],'table':_0xe74a57[_0x1ee3cc(0x234)][_0x1ee3cc(0x216)]},'join':{'parent_key':_0xe74a57[_0x1ee3cc(0x234)][_0x1ee3cc(0x236)],'child_key':_0xe74a57['customerGroup']['parentKey']}},_0xe74a57[_0x1ee3cc(0x234)][_0x1ee3cc(0x217)]&&_0xe74a57[_0x1ee3cc(0x234)][_0x1ee3cc(0x217)][_0x1ee3cc(0x215)]>0x0&&(_0x1a9840[_0x1ee3cc(0x232)]=groupAttributesBySource(_0xe74a57[_0x1ee3cc(0x234)][_0x1ee3cc(0x217)])),_0xe74a57[_0x1ee3cc(0x234)][_0x1ee3cc(0x23b)]&&_0xe74a57[_0x1ee3cc(0x234)][_0x1ee3cc(0x23b)][_0x1ee3cc(0x215)]>0x0&&(_0x1a9840[_0x1ee3cc(0x1fb)]=_0xe74a57[_0x1ee3cc(0x234)][_0x1ee3cc(0x23b)][_0x1ee3cc(0x21d)](convertApiBehaviorToYaml)));const _0x5eb3fc={'name':_0xe74a57['name'],..._0xe74a57[_0x1ee3cc(0x1e3)]&&{'description':_0xe74a57['description']},'master':_0x4713dc,..._0x4be8b8&&{'schedule':_0x4be8b8},..._0x347503&&{'engine':_0x347503},..._0x1d9db6&&{'attributes':_0x1d9db6},..._0x58b21b&&{'behaviors':_0x58b21b},..._0x1a9840&&{'customer_group':_0x1a9840}};return _0x5eb3fc;}function groupAttributesBySource(_0x48ae8e){const _0x4e2af3=a148_0x1483,_0x170ab8=new Map();for(const _0x29ecb1 of _0x48ae8e){const _0x52d48b=_0x29ecb1[_0x4e2af3(0x1ec)]+'.'+_0x29ecb1['parentTableName']+'.'+_0x29ecb1[_0x4e2af3(0x20f)]+'.'+_0x29ecb1[_0x4e2af3(0x236)];!_0x170ab8[_0x4e2af3(0x23d)](_0x52d48b)&&_0x170ab8[_0x4e2af3(0x221)](_0x52d48b,[]),_0x170ab8[_0x4e2af3(0x1e7)](_0x52d48b)[_0x4e2af3(0x1de)](_0x29ecb1);}const _0x350e95=[];for(const [,_0x43bbb3]of _0x170ab8){const _0x4688b0=_0x43bbb3[0x0],_0x65c6c9=_0x4688b0[_0x4e2af3(0x240)]||_0x4688b0[_0x4e2af3(0x216)];_0x350e95[_0x4e2af3(0x1de)]({'name':_0x65c6c9,'source':{'database':_0x4688b0[_0x4e2af3(0x1ec)],'table':_0x4688b0[_0x4e2af3(0x216)]},'join':{'parent_key':_0x4688b0['foreignKey'],'child_key':_0x4688b0['parentKey']},'columns':_0x43bbb3[_0x4e2af3(0x21d)](_0x4a65da=>{const _0x5a9275=_0x4e2af3,_0x418c2e={'column':_0x4a65da[_0x5a9275(0x219)],'type':_0x4a65da['type']};return _0x4a65da['name']!==_0x4a65da[_0x5a9275(0x219)]&&(_0x418c2e[_0x5a9275(0x1f7)]=_0x4a65da[_0x5a9275(0x218)]),_0x418c2e;})});}return _0x350e95;}function convertApiBehaviorToYaml(_0xdc30a3){const _0x45cc4e=a148_0x1483,_0xd0200d={'name':_0xdc30a3[_0x45cc4e(0x218)],'source':{'database':_0xdc30a3['parentDatabaseName'],'table':_0xdc30a3[_0x45cc4e(0x216)]},'join':{'parent_key':_0xdc30a3[_0x45cc4e(0x236)],'child_key':_0xdc30a3[_0x45cc4e(0x20f)]}};if(_0xdc30a3[_0x45cc4e(0x20e)])_0xd0200d[_0x45cc4e(0x209)]=!![];else _0xdc30a3[_0x45cc4e(0x1f2)]&&_0xdc30a3[_0x45cc4e(0x1f2)][_0x45cc4e(0x215)]>0x0&&(_0xd0200d[_0x45cc4e(0x248)]=_0xdc30a3[_0x45cc4e(0x1f2)][_0x45cc4e(0x21d)](_0x1b554d=>{const _0x17d417=_0x45cc4e,_0x56820a={'column':_0x1b554d[_0x17d417(0x219)],'type':_0x1b554d[_0x17d417(0x204)]};return _0x1b554d[_0x17d417(0x218)]!==_0x1b554d[_0x17d417(0x219)]&&(_0x56820a[_0x17d417(0x1f7)]=_0x1b554d[_0x17d417(0x218)]),_0x56820a;}));return _0xdc30a3[_0x45cc4e(0x1ff)]&&(_0xd0200d[_0x45cc4e(0x205)]=_0xdc30a3['defaultTimeFilterEnabled']),_0xdc30a3[_0x45cc4e(0x1f5)]&&(_0xd0200d[_0x45cc4e(0x208)]=_0xdc30a3[_0x45cc4e(0x1f5)]),_0xd0200d;}export function defToApi(_0x5e03f7){const _0x332b88=a148_0x1483,_0x41ed57={'name':_0x5e03f7[_0x332b88(0x218)],'master':{'parentDatabaseName':_0x5e03f7[_0x332b88(0x1df)][_0x332b88(0x20a)],'parentTableName':_0x5e03f7[_0x332b88(0x1df)][_0x332b88(0x223)]}};_0x5e03f7[_0x332b88(0x1e3)]&&(_0x41ed57['description']=_0x5e03f7[_0x332b88(0x1e3)]);_0x5e03f7[_0x332b88(0x1df)]['filters']&&_0x5e03f7[_0x332b88(0x1df)][_0x332b88(0x1ef)][_0x332b88(0x215)]>0x0&&(_0x41ed57['audienceFilters']=_0x5e03f7[_0x332b88(0x1df)][_0x332b88(0x1ef)][_0x332b88(0x21d)](_0x50fc60=>({'columnName':_0x50fc60[_0x332b88(0x1db)],'rightValues':_0x50fc60[_0x332b88(0x247)]})));_0x5e03f7[_0x332b88(0x1f4)]&&(_0x41ed57[_0x332b88(0x21f)]=_0x5e03f7[_0x332b88(0x1f4)][_0x332b88(0x204)],_0x5e03f7['schedule']['time']&&(_0x41ed57[_0x332b88(0x243)]=_0x5e03f7[_0x332b88(0x1f4)][_0x332b88(0x227)]),_0x5e03f7[_0x332b88(0x1f4)]['timezone']&&(_0x41ed57['timezone']=_0x5e03f7[_0x332b88(0x1f4)][_0x332b88(0x246)]));_0x5e03f7[_0x332b88(0x1ee)]&&(_0x5e03f7['engine'][_0x332b88(0x1e8)]!==undefined&&(_0x41ed57['workflowHiveOnly']=_0x5e03f7[_0x332b88(0x1ee)][_0x332b88(0x1e8)]),_0x5e03f7['engine'][_0x332b88(0x24b)]!==undefined&&(_0x41ed57[_0x332b88(0x1fe)]=_0x5e03f7[_0x332b88(0x1ee)][_0x332b88(0x24b)]),_0x5e03f7['engine']['trino_pool']!==undefined&&(_0x41ed57['prestoPoolName']=_0x5e03f7[_0x332b88(0x1ee)]['trino_pool']));_0x5e03f7[_0x332b88(0x232)]&&_0x5e03f7[_0x332b88(0x232)][_0x332b88(0x215)]>0x0&&(_0x41ed57[_0x332b88(0x232)]=flattenAttributeGroups(_0x5e03f7[_0x332b88(0x232)]));_0x5e03f7[_0x332b88(0x1fb)]&&_0x5e03f7['behaviors'][_0x332b88(0x215)]>0x0&&(_0x41ed57[_0x332b88(0x1fb)]=_0x5e03f7['behaviors'][_0x332b88(0x21d)](convertDefBehaviorToApi));if(_0x5e03f7[_0x332b88(0x226)]){const _0x2ef805=_0x5e03f7[_0x332b88(0x226)];_0x41ed57['customerGroup']={'name':_0x2ef805[_0x332b88(0x218)],'parentDatabaseName':_0x2ef805[_0x332b88(0x23e)][_0x332b88(0x20a)],'parentTableName':_0x2ef805[_0x332b88(0x23e)]['table'],'parentKey':_0x2ef805['join'][_0x332b88(0x1e9)],'foreignKey':_0x2ef805[_0x332b88(0x1fc)][_0x332b88(0x222)]},_0x2ef805[_0x332b88(0x232)]&&_0x2ef805[_0x332b88(0x232)]['length']>0x0&&(_0x41ed57[_0x332b88(0x234)][_0x332b88(0x217)]=flattenAttributeGroups(_0x2ef805[_0x332b88(0x232)])[_0x332b88(0x21d)](_0x3a8ce2=>({'name':_0x3a8ce2[_0x332b88(0x218)],'type':_0x3a8ce2[_0x332b88(0x204)],'parentDatabaseName':_0x3a8ce2[_0x332b88(0x1ec)],'parentTableName':_0x3a8ce2['parentTableName'],'parentColumn':_0x3a8ce2[_0x332b88(0x219)],'parentKey':_0x3a8ce2[_0x332b88(0x20f)],'foreignKey':_0x3a8ce2[_0x332b88(0x236)]}))),_0x2ef805[_0x332b88(0x1fb)]&&_0x2ef805[_0x332b88(0x1fb)][_0x332b88(0x215)]>0x0&&(_0x41ed57['customerGroup'][_0x332b88(0x23b)]=_0x2ef805[_0x332b88(0x1fb)][_0x332b88(0x21d)](_0x350c31=>({'name':_0x350c31[_0x332b88(0x218)],'parentDatabaseName':_0x350c31['source'][_0x332b88(0x20a)],'parentTableName':_0x350c31[_0x332b88(0x23e)][_0x332b88(0x223)],'parentKey':_0x350c31[_0x332b88(0x1fc)]['child_key'],'foreignKey':_0x350c31[_0x332b88(0x1fc)]['parent_key'],'allColumns':_0x350c31[_0x332b88(0x209)],'schema':_0x350c31[_0x332b88(0x248)]?.[_0x332b88(0x21d)](_0x3fa621=>({'name':_0x3fa621[_0x332b88(0x1f7)]||_0x3fa621[_0x332b88(0x1db)],'type':_0x3fa621[_0x332b88(0x204)],'parentColumn':_0x3fa621[_0x332b88(0x1db)]}))})));}return _0x41ed57;}function flattenAttributeGroups(_0x2fb917){const _0x320684=a148_0x1483,_0x4c99c7=[];for(const _0x5744cd of _0x2fb917){for(const _0x4f6958 of _0x5744cd[_0x320684(0x248)]){_0x4c99c7[_0x320684(0x1de)]({'name':_0x4f6958[_0x320684(0x1f7)]||_0x4f6958[_0x320684(0x1db)],'type':_0x4f6958['type'],'parentDatabaseName':_0x5744cd[_0x320684(0x23e)]['database'],'parentTableName':_0x5744cd[_0x320684(0x23e)][_0x320684(0x223)],'parentColumn':_0x4f6958[_0x320684(0x1db)],'parentKey':_0x5744cd[_0x320684(0x1fc)][_0x320684(0x1e9)],'foreignKey':_0x5744cd[_0x320684(0x1fc)][_0x320684(0x222)],'groupingName':_0x5744cd['name']});}}return _0x4c99c7;}function convertDefBehaviorToApi(_0x466aa3){const _0x417c5b=a148_0x1483,_0x57c34b={'name':_0x466aa3['name'],'parentDatabaseName':_0x466aa3[_0x417c5b(0x23e)]['database'],'parentTableName':_0x466aa3[_0x417c5b(0x23e)]['table'],'parentKey':_0x466aa3['join']['child_key'],'foreignKey':_0x466aa3[_0x417c5b(0x1fc)]['parent_key']};if(_0x466aa3[_0x417c5b(0x209)])_0x57c34b[_0x417c5b(0x20e)]=!![];else _0x466aa3[_0x417c5b(0x248)]&&_0x466aa3['columns'][_0x417c5b(0x215)]>0x0&&(_0x57c34b[_0x417c5b(0x1f2)]=_0x466aa3[_0x417c5b(0x248)][_0x417c5b(0x21d)](_0x30de16=>({'name':_0x30de16[_0x417c5b(0x1f7)]||_0x30de16[_0x417c5b(0x1db)],'type':_0x30de16['type'],'parentColumn':_0x30de16[_0x417c5b(0x1db)]})));return _0x466aa3['default_time_filter']!==undefined&&(_0x57c34b['defaultTimeFilterEnabled']=_0x466aa3[_0x417c5b(0x205)]),_0x466aa3[_0x417c5b(0x208)]!==undefined&&(_0x57c34b[_0x417c5b(0x1f5)]=_0x466aa3[_0x417c5b(0x208)]),_0x57c34b;}export function serializeDef(_0x293ad7){const _0x302fd8=a148_0x1483,_0x24c796=JSON['parse'](JSON[_0x302fd8(0x244)](_0x293ad7)),_0x2d7fe0=a148_0x3dad1e[_0x302fd8(0x244)](_0x24c796,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x302fd8(0x1da)}),_0x8501fb=[_0x302fd8(0x239),_0x302fd8(0x24a),_0x302fd8(0x21e),_0x302fd8(0x249),_0x302fd8(0x1e1),_0x302fd8(0x225),_0x302fd8(0x213),'personalization_services:'];let _0x26a09b=_0x2d7fe0;for(const _0x9930b5 of _0x8501fb){_0x26a09b=_0x26a09b[_0x302fd8(0x228)](new RegExp('^('+_0x9930b5+')','m'),(_0x5417a2,_0x1a93b0,_0xb17d3b)=>{if(_0xb17d3b===0x0||_0x26a09b[_0xb17d3b-0x1]==='\x0a'&&_0x26a09b[_0xb17d3b-0x2]==='\x0a')return _0x1a93b0;return'\x0a'+_0x1a93b0;});}return _0x26a09b;}export function parseDef(_0x1b6533){const _0x26c53f=a148_0x1483,_0x3f6753=a148_0x3dad1e[_0x26c53f(0x202)](_0x1b6533);if(!_0x3f6753[_0x26c53f(0x218)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x3f6753['master'])throw new Error(_0x26c53f(0x22e));if(!_0x3f6753['master'][_0x26c53f(0x20a)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x3f6753[_0x26c53f(0x1df)][_0x26c53f(0x223)])throw new Error(_0x26c53f(0x207));return _0x3f6753[_0x26c53f(0x208)]&&validateRealtimeSection(_0x3f6753[_0x26c53f(0x208)]),_0x3f6753['personalization_services']&&validatePersonalizationServices(_0x3f6753[_0x26c53f(0x1e6)]),_0x3f6753;}function a148_0x4f11(){const _0x3cd82b=['schema','daily','schedule','isRealtime','user_id','label','realtime.events[','padStart','ordered_set','behaviors','join','test','hivePoolName','defaultTimeFilterEnabled','split','isArray','parse','attribute_table','type','default_time_filter','none','YAML\x20config\x20missing\x20required\x20field:\x20master.table','realtime','all_columns','database','Example\x20Events','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','number','allColumns','parentKey','realtime.attributes[',':00:00','id_stitching','realtime:','49RkESJF','length','parentTableName','customerGroupAttributes','name','parentColumn','10NatenU','1082OoQCit','personalization_services\x20must\x20be\x20an\x20array','map','engine:','scheduleType','string','set','parent_key','table','floor','customer_group:','customer_group','time','replace','columnName','personalization_services[','events_table','\x27.\x20Must\x20be\x20one\x20of:\x20','03:00','YAML\x20config\x20missing\x20required\x20field:\x20master','194211jUqgal','25974003owxZCV','events','attributes','workflowHiveOnly','customerGroup','counter','foreignKey','single','):\x20Invalid\x20type\x20\x27','master:','forEach','customerGroupBehaviors','customer_id','has','source','72iUxkcv','groupingName','Display\x20Name','944BZCMLy','scheduleOption','stringify','470004hfvDTp','timezone','values','columns','attributes:','schedule:','hive_pool','prestoPoolName','null','column','813801ADIrbY','Parent\x20segment\x20description','push','master',':00','behaviors:','Example\x20Attributes','description','imported_batch','1238096DykdRd','personalization_services','get','hive_only','child_key','column_name','trino_pool','parentDatabaseName','audienceFilters','engine','filters','2076020dOrXdv',']:\x20Missing\x20required\x20field\x20\x27name\x27'];a148_0x4f11=function(){return _0x3cd82b;};return a148_0x4f11();}function validateRealtimeSection(_0xc895c1){const _0x29b158=a148_0x1483,_0x1a106e=[_0x29b158(0x237),_0x29b158(0x235),_0x29b158(0x221),_0x29b158(0x1fa),'list',_0x29b158(0x1e4)];_0xc895c1[_0x29b158(0x231)]&&Array[_0x29b158(0x201)](_0xc895c1[_0x29b158(0x231)])&&_0xc895c1['events']['forEach']((_0x58a20b,_0x453409)=>{const _0x25c2e0=_0x29b158;if(!_0x58a20b[_0x25c2e0(0x218)])throw new Error(_0x25c2e0(0x1f8)+_0x453409+_0x25c2e0(0x1f1));});_0xc895c1[_0x29b158(0x232)]&&Array['isArray'](_0xc895c1[_0x29b158(0x232)])&&_0xc895c1[_0x29b158(0x232)][_0x29b158(0x23a)]((_0x1adf09,_0x2dd333)=>{const _0x3f86c8=_0x29b158;if(!_0x1adf09[_0x3f86c8(0x218)])throw new Error('realtime.attributes['+_0x2dd333+_0x3f86c8(0x1f1));if(_0x1adf09[_0x3f86c8(0x204)]&&!_0x1a106e['includes'](_0x1adf09[_0x3f86c8(0x204)]))throw new Error(_0x3f86c8(0x210)+_0x2dd333+']\x20('+_0x1adf09['name']+_0x3f86c8(0x238)+_0x1adf09['type']+_0x3f86c8(0x22c)+_0x1a106e[_0x3f86c8(0x1fc)](',\x20'));});if(_0xc895c1['id_stitching']){if(!_0xc895c1[_0x29b158(0x212)]['primary_key'])throw new Error(_0x29b158(0x20c));}}function validatePersonalizationServices(_0x54652f){const _0xcfb4fc=a148_0x1483;if(!Array[_0xcfb4fc(0x201)](_0x54652f))throw new Error(_0xcfb4fc(0x21c));_0x54652f[_0xcfb4fc(0x23a)]((_0x213132,_0x1f30e2)=>{const _0x3097fe=_0xcfb4fc;if(!_0x213132[_0x3097fe(0x218)])throw new Error(_0x3097fe(0x22a)+_0x1f30e2+_0x3097fe(0x1f1));});}export function generateTemplate(_0x40767d,_0x3fba06,_0x5b3139){const _0x2b6bf1=a148_0x1483,_0x1b2c89={'name':_0x40767d,'description':_0x2b6bf1(0x1dd),'master':{'database':_0x3fba06,'table':_0x5b3139},'schedule':{'type':_0x2b6bf1(0x1f3),'time':_0x2b6bf1(0x22d),'timezone':'UTC'},'attributes':[{'name':_0x2b6bf1(0x1e2),'source':{'database':_0x3fba06,'table':_0x2b6bf1(0x203)},'join':{'parent_key':'id','child_key':_0x2b6bf1(0x23c)},'columns':[{'column':_0x2b6bf1(0x1ea),'label':_0x2b6bf1(0x241),'type':_0x2b6bf1(0x220)}]}],'behaviors':[{'name':_0x2b6bf1(0x20b),'source':{'database':_0x3fba06,'table':_0x2b6bf1(0x22b)},'join':{'parent_key':_0x2b6bf1(0x1f6),'child_key':_0x2b6bf1(0x23c)},'all_columns':!![]}]};return serializeDef(_0x1b2c89);}
|
|
1
|
+
(function(_0x14e7c0,_0x500fe1){const _0x537fdc=a148_0x4c27,_0x594b4f=_0x14e7c0();while(!![]){try{const _0x4c1a3d=parseInt(_0x537fdc(0x88))/0x1+-parseInt(_0x537fdc(0x6d))/0x2*(parseInt(_0x537fdc(0xa6))/0x3)+parseInt(_0x537fdc(0xbc))/0x4*(-parseInt(_0x537fdc(0xd2))/0x5)+parseInt(_0x537fdc(0x79))/0x6*(parseInt(_0x537fdc(0xd3))/0x7)+parseInt(_0x537fdc(0xd5))/0x8*(parseInt(_0x537fdc(0x7f))/0x9)+parseInt(_0x537fdc(0xca))/0xa+-parseInt(_0x537fdc(0x94))/0xb*(parseInt(_0x537fdc(0x93))/0xc);if(_0x4c1a3d===_0x500fe1)break;else _0x594b4f['push'](_0x594b4f['shift']());}catch(_0x568beb){_0x594b4f['push'](_0x594b4f['shift']());}}}(a148_0x36aa,0x94ea1));import*as a148_0x4763cf from'yaml';function formatScheduleTime(_0x4fb58d){const _0x3f28fb=a148_0x4c27;if(typeof _0x4fb58d===_0x3f28fb(0x83)){const _0xfe8962=Math[_0x3f28fb(0xa5)](_0x4fb58d);return String(_0xfe8962)[_0x3f28fb(0x78)](0x2,'0')+':00:00';}if(typeof _0x4fb58d===_0x3f28fb(0xbf)){if(/^\d{2}:\d{2}:\d{2}$/[_0x3f28fb(0x70)](_0x4fb58d))return _0x4fb58d;if(/^\d{1,2}:\d{2}$/[_0x3f28fb(0x70)](_0x4fb58d)){const [_0x21b301,_0x373d01]=_0x4fb58d['split'](':');return _0x21b301[_0x3f28fb(0x78)](0x2,'0')+':'+_0x373d01+':00';}const _0x1ae1ad=parseInt(_0x4fb58d,0xa);if(!isNaN(_0x1ae1ad)&&_0x4fb58d[_0x3f28fb(0x87)](/^\d+$/))return String(_0x1ae1ad)['padStart'](0x2,'0')+_0x3f28fb(0xba);return _0x4fb58d;}return String(_0x4fb58d);}function a148_0x36aa(){const _0x30e47a=['length','realtime','string','schedule:','foreignKey','master:','set','includes','personalization_services[','Example\x20Attributes','push','master','rightValues','799350MTQTUj','personalization_services','has','null','schedule','counter',']\x20(','personalization_services:','22450RNBHsW','1050182aTlsmd','ordered_set','78808hdFDJj','scheduleOption','YAML\x20config\x20missing\x20required\x20field:\x20name','columns','hivePoolName','isRealtime','2sLeLAf','database','list','test','isArray','customerGroup','child_key','parent_key','user_id','attribute_table','customer_group:','padStart','24tzGIIy','realtime.attributes[','parentTableName','schema','source','groupingName','9opOTIh','forEach','03:00','Parent\x20segment\x20description','number','scheduleType','trino_pool','primary_key','match','1137327OFoOSG','single','YAML\x20config\x20missing\x20required\x20field:\x20master','behaviors','default_time_filter','parentColumn','column','values','attributes','stringify','time','1810716yFnBfY','22gIAhju','events_table','customer_group','name','defaultTimeFilterEnabled','all_columns','join','filters','attributes:','description','hive_pool','parentKey','engine','workflowHiveOnly','):\x20Invalid\x20type\x20\x27','prestoPoolName','hive_only','floor','2248044KRRVAj','label','map','personalization_services\x20must\x20be\x20an\x20array','timezone','Display\x20Name','type','allColumns','customer_id','realtime.events[','customerGroupBehaviors','events','table','UTC','audienceFilters',']:\x20Missing\x20required\x20field\x20\x27name\x27','customerGroupAttributes','imported_batch','realtime:','YAML\x20config\x20missing\x20required\x20field:\x20master.table',':00:00','parentDatabaseName','148KFidEw'];a148_0x36aa=function(){return _0x30e47a;};return a148_0x36aa();}function a148_0x4c27(_0x2f960f,_0x4bc9bf){_0x2f960f=_0x2f960f-0x6a;const _0x36aa4b=a148_0x36aa();let _0x4c27bb=_0x36aa4b[_0x2f960f];return _0x4c27bb;}export function apiToDef(_0x238333){const _0x292ee5=a148_0x4c27,_0x3f67b0={'database':_0x238333[_0x292ee5(0xc8)]?.[_0x292ee5(0xbb)]||'','table':_0x238333[_0x292ee5(0xc8)]?.[_0x292ee5(0x7b)]||''};_0x238333['audienceFilters']&&_0x238333['audienceFilters']['length']>0x0&&(_0x3f67b0[_0x292ee5(0x9b)]=_0x238333[_0x292ee5(0xb4)]['map'](_0x3b3472=>({'column':_0x3b3472['columnName'],'values':_0x3b3472[_0x292ee5(0xc9)]})));let _0x5628dd;_0x238333[_0x292ee5(0x84)]&&_0x238333[_0x292ee5(0x84)]!=='none'&&(_0x5628dd={'type':_0x238333[_0x292ee5(0x84)]},_0x238333[_0x292ee5(0xd6)]&&(_0x5628dd['time']=formatScheduleTime(_0x238333[_0x292ee5(0xd6)])),_0x238333[_0x292ee5(0xaa)]&&(_0x5628dd[_0x292ee5(0xaa)]=_0x238333[_0x292ee5(0xaa)]));let _0x41596;(_0x238333['workflowHiveOnly']||_0x238333['hivePoolName']||_0x238333[_0x292ee5(0xa3)])&&(_0x41596={},_0x238333[_0x292ee5(0xa1)]&&(_0x41596[_0x292ee5(0xa4)]=_0x238333[_0x292ee5(0xa1)]),_0x238333[_0x292ee5(0x6b)]&&(_0x41596['hive_pool']=_0x238333[_0x292ee5(0x6b)]),_0x238333[_0x292ee5(0xa3)]&&(_0x41596[_0x292ee5(0x85)]=_0x238333['prestoPoolName']));const _0x3603dd=_0x238333[_0x292ee5(0x90)]&&_0x238333['attributes'][_0x292ee5(0xbd)]>0x0?groupAttributesBySource(_0x238333[_0x292ee5(0x90)]):undefined,_0x32be3e=_0x238333['behaviors']&&_0x238333['behaviors'][_0x292ee5(0xbd)]>0x0?_0x238333[_0x292ee5(0x8b)][_0x292ee5(0xa8)](convertApiBehaviorToYaml):undefined;let _0xcb1963;_0x238333[_0x292ee5(0x72)]&&(_0xcb1963={'name':_0x238333['customerGroup'][_0x292ee5(0x97)],'source':{'database':_0x238333[_0x292ee5(0x72)]['parentDatabaseName'],'table':_0x238333[_0x292ee5(0x72)][_0x292ee5(0x7b)]},'join':{'parent_key':_0x238333[_0x292ee5(0x72)][_0x292ee5(0xc1)],'child_key':_0x238333[_0x292ee5(0x72)][_0x292ee5(0x9f)]}},_0x238333[_0x292ee5(0x72)][_0x292ee5(0xb6)]&&_0x238333[_0x292ee5(0x72)][_0x292ee5(0xb6)]['length']>0x0&&(_0xcb1963[_0x292ee5(0x90)]=groupAttributesBySource(_0x238333['customerGroup'][_0x292ee5(0xb6)])),_0x238333[_0x292ee5(0x72)]['customerGroupBehaviors']&&_0x238333[_0x292ee5(0x72)][_0x292ee5(0xb0)][_0x292ee5(0xbd)]>0x0&&(_0xcb1963[_0x292ee5(0x8b)]=_0x238333[_0x292ee5(0x72)][_0x292ee5(0xb0)][_0x292ee5(0xa8)](convertApiBehaviorToYaml)));const _0xae4064={'name':_0x238333[_0x292ee5(0x97)],..._0x238333[_0x292ee5(0x9d)]&&{'description':_0x238333[_0x292ee5(0x9d)]},'master':_0x3f67b0,..._0x5628dd&&{'schedule':_0x5628dd},..._0x41596&&{'engine':_0x41596},..._0x3603dd&&{'attributes':_0x3603dd},..._0x32be3e&&{'behaviors':_0x32be3e},..._0xcb1963&&{'customer_group':_0xcb1963}};return _0xae4064;}function groupAttributesBySource(_0x6efd72){const _0x4df7a3=a148_0x4c27,_0x145dd0=new Map();for(const _0x214168 of _0x6efd72){const _0x5bde9a=_0x214168[_0x4df7a3(0xbb)]+'.'+_0x214168[_0x4df7a3(0x7b)]+'.'+_0x214168[_0x4df7a3(0x9f)]+'.'+_0x214168[_0x4df7a3(0xc1)];!_0x145dd0[_0x4df7a3(0xcc)](_0x5bde9a)&&_0x145dd0[_0x4df7a3(0xc3)](_0x5bde9a,[]),_0x145dd0['get'](_0x5bde9a)['push'](_0x214168);}const _0x565a40=[];for(const [,_0x434e42]of _0x145dd0){const _0x158959=_0x434e42[0x0],_0x170b2=_0x158959[_0x4df7a3(0x7e)]||_0x158959[_0x4df7a3(0x7b)];_0x565a40['push']({'name':_0x170b2,'source':{'database':_0x158959['parentDatabaseName'],'table':_0x158959[_0x4df7a3(0x7b)]},'join':{'parent_key':_0x158959[_0x4df7a3(0xc1)],'child_key':_0x158959[_0x4df7a3(0x9f)]},'columns':_0x434e42[_0x4df7a3(0xa8)](_0x33b3f7=>{const _0x597fa8=_0x4df7a3,_0x5d9005={'column':_0x33b3f7[_0x597fa8(0x8d)],'type':_0x33b3f7[_0x597fa8(0xac)]};return _0x33b3f7[_0x597fa8(0x97)]!==_0x33b3f7['parentColumn']&&(_0x5d9005[_0x597fa8(0xa7)]=_0x33b3f7[_0x597fa8(0x97)]),_0x5d9005;})});}return _0x565a40;}function convertApiBehaviorToYaml(_0x399a29){const _0x884ffc=a148_0x4c27,_0x357add={'name':_0x399a29['name'],'source':{'database':_0x399a29[_0x884ffc(0xbb)],'table':_0x399a29[_0x884ffc(0x7b)]},'join':{'parent_key':_0x399a29[_0x884ffc(0xc1)],'child_key':_0x399a29['parentKey']}};if(_0x399a29[_0x884ffc(0xad)])_0x357add[_0x884ffc(0x99)]=!![];else _0x399a29['schema']&&_0x399a29[_0x884ffc(0x7c)]['length']>0x0&&(_0x357add[_0x884ffc(0x6a)]=_0x399a29[_0x884ffc(0x7c)][_0x884ffc(0xa8)](_0x1479e1=>{const _0x40cb8b=_0x884ffc,_0x583e23={'column':_0x1479e1[_0x40cb8b(0x8d)],'type':_0x1479e1[_0x40cb8b(0xac)]};return _0x1479e1['name']!==_0x1479e1['parentColumn']&&(_0x583e23[_0x40cb8b(0xa7)]=_0x1479e1[_0x40cb8b(0x97)]),_0x583e23;}));return _0x399a29[_0x884ffc(0x98)]&&(_0x357add[_0x884ffc(0x8c)]=_0x399a29[_0x884ffc(0x98)]),_0x399a29[_0x884ffc(0x6c)]&&(_0x357add['realtime']=_0x399a29['isRealtime']),_0x357add;}export function defToApi(_0x226daa){const _0x46b40c=a148_0x4c27,_0x24ae8b={'name':_0x226daa['name'],'master':{'parentDatabaseName':_0x226daa[_0x46b40c(0xc8)][_0x46b40c(0x6e)],'parentTableName':_0x226daa[_0x46b40c(0xc8)][_0x46b40c(0xb2)]}};_0x226daa[_0x46b40c(0x9d)]&&(_0x24ae8b['description']=_0x226daa[_0x46b40c(0x9d)]);_0x226daa[_0x46b40c(0xc8)]['filters']&&_0x226daa[_0x46b40c(0xc8)][_0x46b40c(0x9b)][_0x46b40c(0xbd)]>0x0&&(_0x24ae8b['audienceFilters']=_0x226daa['master']['filters'][_0x46b40c(0xa8)](_0x6af82f=>({'columnName':_0x6af82f[_0x46b40c(0x8e)],'rightValues':_0x6af82f[_0x46b40c(0x8f)]})));_0x226daa['schedule']&&(_0x24ae8b[_0x46b40c(0x84)]=_0x226daa['schedule']['type'],_0x226daa[_0x46b40c(0xce)][_0x46b40c(0x92)]&&(_0x24ae8b[_0x46b40c(0xd6)]=_0x226daa['schedule'][_0x46b40c(0x92)]),_0x226daa['schedule'][_0x46b40c(0xaa)]&&(_0x24ae8b[_0x46b40c(0xaa)]=_0x226daa['schedule'][_0x46b40c(0xaa)]));_0x226daa[_0x46b40c(0xa0)]&&(_0x226daa['engine'][_0x46b40c(0xa4)]!==undefined&&(_0x24ae8b[_0x46b40c(0xa1)]=_0x226daa[_0x46b40c(0xa0)]['hive_only']),_0x226daa[_0x46b40c(0xa0)][_0x46b40c(0x9e)]!==undefined&&(_0x24ae8b[_0x46b40c(0x6b)]=_0x226daa[_0x46b40c(0xa0)][_0x46b40c(0x9e)]),_0x226daa[_0x46b40c(0xa0)][_0x46b40c(0x85)]!==undefined&&(_0x24ae8b[_0x46b40c(0xa3)]=_0x226daa[_0x46b40c(0xa0)][_0x46b40c(0x85)]));_0x226daa[_0x46b40c(0x90)]&&_0x226daa[_0x46b40c(0x90)][_0x46b40c(0xbd)]>0x0&&(_0x24ae8b[_0x46b40c(0x90)]=flattenAttributeGroups(_0x226daa[_0x46b40c(0x90)]));_0x226daa['behaviors']&&_0x226daa[_0x46b40c(0x8b)][_0x46b40c(0xbd)]>0x0&&(_0x24ae8b[_0x46b40c(0x8b)]=_0x226daa[_0x46b40c(0x8b)][_0x46b40c(0xa8)](convertDefBehaviorToApi));if(_0x226daa['customer_group']){const _0x22a201=_0x226daa[_0x46b40c(0x96)];_0x24ae8b['customerGroup']={'name':_0x22a201[_0x46b40c(0x97)],'parentDatabaseName':_0x22a201[_0x46b40c(0x7d)][_0x46b40c(0x6e)],'parentTableName':_0x22a201[_0x46b40c(0x7d)][_0x46b40c(0xb2)],'parentKey':_0x22a201[_0x46b40c(0x9a)][_0x46b40c(0x73)],'foreignKey':_0x22a201['join']['parent_key']},_0x22a201['attributes']&&_0x22a201[_0x46b40c(0x90)][_0x46b40c(0xbd)]>0x0&&(_0x24ae8b['customerGroup']['customerGroupAttributes']=flattenAttributeGroups(_0x22a201[_0x46b40c(0x90)])[_0x46b40c(0xa8)](_0x5d2f56=>({'name':_0x5d2f56[_0x46b40c(0x97)],'type':_0x5d2f56['type'],'parentDatabaseName':_0x5d2f56[_0x46b40c(0xbb)],'parentTableName':_0x5d2f56[_0x46b40c(0x7b)],'parentColumn':_0x5d2f56[_0x46b40c(0x8d)],'parentKey':_0x5d2f56['parentKey'],'foreignKey':_0x5d2f56[_0x46b40c(0xc1)]}))),_0x22a201[_0x46b40c(0x8b)]&&_0x22a201[_0x46b40c(0x8b)][_0x46b40c(0xbd)]>0x0&&(_0x24ae8b[_0x46b40c(0x72)][_0x46b40c(0xb0)]=_0x22a201[_0x46b40c(0x8b)]['map'](_0x2e985a=>({'name':_0x2e985a[_0x46b40c(0x97)],'parentDatabaseName':_0x2e985a[_0x46b40c(0x7d)]['database'],'parentTableName':_0x2e985a[_0x46b40c(0x7d)][_0x46b40c(0xb2)],'parentKey':_0x2e985a[_0x46b40c(0x9a)][_0x46b40c(0x73)],'foreignKey':_0x2e985a[_0x46b40c(0x9a)][_0x46b40c(0x74)],'allColumns':_0x2e985a['all_columns'],'schema':_0x2e985a[_0x46b40c(0x6a)]?.[_0x46b40c(0xa8)](_0x3ea54e=>({'name':_0x3ea54e[_0x46b40c(0xa7)]||_0x3ea54e[_0x46b40c(0x8e)],'type':_0x3ea54e[_0x46b40c(0xac)],'parentColumn':_0x3ea54e[_0x46b40c(0x8e)]}))})));}return _0x24ae8b;}function flattenAttributeGroups(_0x18a7d7){const _0x1ec34d=a148_0x4c27,_0x566fb9=[];for(const _0x22f367 of _0x18a7d7){for(const _0x524b04 of _0x22f367['columns']){_0x566fb9[_0x1ec34d(0xc7)]({'name':_0x524b04[_0x1ec34d(0xa7)]||_0x524b04[_0x1ec34d(0x8e)],'type':_0x524b04[_0x1ec34d(0xac)],'parentDatabaseName':_0x22f367[_0x1ec34d(0x7d)][_0x1ec34d(0x6e)],'parentTableName':_0x22f367[_0x1ec34d(0x7d)][_0x1ec34d(0xb2)],'parentColumn':_0x524b04[_0x1ec34d(0x8e)],'parentKey':_0x22f367[_0x1ec34d(0x9a)][_0x1ec34d(0x73)],'foreignKey':_0x22f367[_0x1ec34d(0x9a)][_0x1ec34d(0x74)],'groupingName':_0x22f367[_0x1ec34d(0x97)]});}}return _0x566fb9;}function convertDefBehaviorToApi(_0x88df48){const _0x314f94=a148_0x4c27,_0x3f023d={'name':_0x88df48[_0x314f94(0x97)],'parentDatabaseName':_0x88df48[_0x314f94(0x7d)][_0x314f94(0x6e)],'parentTableName':_0x88df48[_0x314f94(0x7d)]['table'],'parentKey':_0x88df48[_0x314f94(0x9a)][_0x314f94(0x73)],'foreignKey':_0x88df48[_0x314f94(0x9a)][_0x314f94(0x74)]};if(_0x88df48[_0x314f94(0x99)])_0x3f023d[_0x314f94(0xad)]=!![];else _0x88df48[_0x314f94(0x6a)]&&_0x88df48[_0x314f94(0x6a)][_0x314f94(0xbd)]>0x0&&(_0x3f023d[_0x314f94(0x7c)]=_0x88df48[_0x314f94(0x6a)][_0x314f94(0xa8)](_0x1a03a4=>({'name':_0x1a03a4[_0x314f94(0xa7)]||_0x1a03a4[_0x314f94(0x8e)],'type':_0x1a03a4['type'],'parentColumn':_0x1a03a4[_0x314f94(0x8e)]})));return _0x88df48[_0x314f94(0x8c)]!==undefined&&(_0x3f023d[_0x314f94(0x98)]=_0x88df48[_0x314f94(0x8c)]),_0x88df48[_0x314f94(0xbe)]!==undefined&&(_0x3f023d[_0x314f94(0x6c)]=_0x88df48[_0x314f94(0xbe)]),_0x3f023d;}export function serializeDef(_0x147dcd){const _0x33315e=a148_0x4c27,_0x3eca0b=JSON['parse'](JSON['stringify'](_0x147dcd)),_0x4d695c=a148_0x4763cf[_0x33315e(0x91)](_0x3eca0b,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x33315e(0xcd)}),_0x23b119=[_0x33315e(0xc2),_0x33315e(0xc0),'engine:',_0x33315e(0x9c),'behaviors:',_0x33315e(0x77),_0x33315e(0xb8),_0x33315e(0xd1)];let _0x50dad7=_0x4d695c;for(const _0x25a434 of _0x23b119){_0x50dad7=_0x50dad7['replace'](new RegExp('^('+_0x25a434+')','m'),(_0x356bd0,_0x4c7cd7,_0x5915cd)=>{if(_0x5915cd===0x0||_0x50dad7[_0x5915cd-0x1]==='\x0a'&&_0x50dad7[_0x5915cd-0x2]==='\x0a')return _0x4c7cd7;return'\x0a'+_0x4c7cd7;});}return _0x50dad7;}export function parseDef(_0x44fb2f){const _0x592b15=a148_0x4c27,_0x58782f=a148_0x4763cf['parse'](_0x44fb2f);if(!_0x58782f[_0x592b15(0x97)])throw new Error(_0x592b15(0xd7));if(!_0x58782f['master'])throw new Error(_0x592b15(0x8a));if(!_0x58782f[_0x592b15(0xc8)]['database'])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x58782f[_0x592b15(0xc8)][_0x592b15(0xb2)])throw new Error(_0x592b15(0xb9));return _0x58782f[_0x592b15(0xbe)]&&validateRealtimeSection(_0x58782f[_0x592b15(0xbe)]),_0x58782f[_0x592b15(0xcb)]&&validatePersonalizationServices(_0x58782f[_0x592b15(0xcb)]),_0x58782f;}function validateRealtimeSection(_0x17fb35){const _0x4e466b=a148_0x4c27,_0x426095=[_0x4e466b(0x89),_0x4e466b(0xcf),_0x4e466b(0xc3),_0x4e466b(0xd4),_0x4e466b(0x6f),_0x4e466b(0xb7)];_0x17fb35[_0x4e466b(0xb1)]&&Array[_0x4e466b(0x71)](_0x17fb35['events'])&&_0x17fb35[_0x4e466b(0xb1)][_0x4e466b(0x80)]((_0x835b4a,_0x5711d)=>{const _0x219992=_0x4e466b;if(!_0x835b4a[_0x219992(0x97)])throw new Error(_0x219992(0xaf)+_0x5711d+_0x219992(0xb5));});_0x17fb35[_0x4e466b(0x90)]&&Array[_0x4e466b(0x71)](_0x17fb35[_0x4e466b(0x90)])&&_0x17fb35['attributes']['forEach']((_0x171806,_0x1b13ee)=>{const _0x11b537=_0x4e466b;if(!_0x171806['name'])throw new Error(_0x11b537(0x7a)+_0x1b13ee+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x171806[_0x11b537(0xac)]&&!_0x426095[_0x11b537(0xc4)](_0x171806[_0x11b537(0xac)]))throw new Error(_0x11b537(0x7a)+_0x1b13ee+_0x11b537(0xd0)+_0x171806[_0x11b537(0x97)]+_0x11b537(0xa2)+_0x171806[_0x11b537(0xac)]+'\x27.\x20Must\x20be\x20one\x20of:\x20'+_0x426095['join'](',\x20'));});if(_0x17fb35['id_stitching']){if(!_0x17fb35['id_stitching'][_0x4e466b(0x86)])throw new Error('realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27');}}function validatePersonalizationServices(_0x30097f){const _0x4fa7be=a148_0x4c27;if(!Array[_0x4fa7be(0x71)](_0x30097f))throw new Error(_0x4fa7be(0xa9));_0x30097f[_0x4fa7be(0x80)]((_0xaf5c90,_0x228263)=>{const _0x1c0cc3=_0x4fa7be;if(!_0xaf5c90[_0x1c0cc3(0x97)])throw new Error(_0x1c0cc3(0xc5)+_0x228263+_0x1c0cc3(0xb5));});}export function generateTemplate(_0x37ddaa,_0x26144f,_0x32bbb4){const _0x1f1814=a148_0x4c27,_0x3d0089={'name':_0x37ddaa,'description':_0x1f1814(0x82),'master':{'database':_0x26144f,'table':_0x32bbb4},'schedule':{'type':'daily','time':_0x1f1814(0x81),'timezone':_0x1f1814(0xb3)},'attributes':[{'name':_0x1f1814(0xc6),'source':{'database':_0x26144f,'table':_0x1f1814(0x76)},'join':{'parent_key':'id','child_key':_0x1f1814(0xae)},'columns':[{'column':'column_name','label':_0x1f1814(0xab),'type':_0x1f1814(0xbf)}]}],'behaviors':[{'name':'Example\x20Events','source':{'database':_0x26144f,'table':_0x1f1814(0x95)},'join':{'parent_key':_0x1f1814(0x75),'child_key':_0x1f1814(0xae)},'all_columns':!![]}]};return serializeDef(_0x3d0089);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4072c5,_0x5e29dc){const _0x558ad8=a149_0x26c1,_0x16f234=_0x4072c5();while(!![]){try{const _0x324215=parseInt(_0x558ad8(0x102))/0x1*(parseInt(_0x558ad8(0xdf))/0x2)+parseInt(_0x558ad8(0xfa))/0x3*(-parseInt(_0x558ad8(0xe3))/0x4)+parseInt(_0x558ad8(0xce))/0x5+parseInt(_0x558ad8(0xd4))/0x6+parseInt(_0x558ad8(0xf6))/0x7+parseInt(_0x558ad8(0x10c))/0x8+-parseInt(_0x558ad8(0xeb))/0x9;if(_0x324215===_0x5e29dc)break;else _0x16f234['push'](_0x16f234['shift']());}catch(_0x5db45f){_0x16f234['push'](_0x16f234['shift']());}}}(a149_0x5888,0x8f2b2));import a149_0xff4bac 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 a149_0x5888(){const _0x33ecf7=['join','values','from','resolveParentId','targetResourceName','journey','has','getLatestJourneyId','listActivations','3142135yewOBZ','Fetching\x20segments,\x20folders,\x20and\x20journeys','set','update','isNew','hasChanges','7033752lnojhX','listSegments','size','Processing\x20journeys','paused','attributes','buildIdToNameMap','segment','Resolving\x20parent\x20segment','activationParams','state','8234BoPZns','push','segmentFolderId','map','25332zMxXzT','tdx.json','Warning:\x20Journey\x20','segments/','get','sort','all','updatedAt','31777614GlTOYF','length','folderId','kind','reduce','.yml','Processing\x20segments','Fetching\x20users\x20and\x20connections','user','utf-8','name','7708134VSRFoM','Fetching\x20parent\x20segment\x20info','clear','journeyBundleName','27JdFyQD','toLowerCase','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','relationships','filter','data','activation_','createdAt','136MCwsvb','journeyBundleId','getSegment','parentFolder','listFolders','getActivation','add','rule','versionNumber','description','5699744kOpFKf'];a149_0x5888=function(){return _0x33ecf7;};return a149_0x5888();}import{journeyResponseToDef,toYamlString as a149_0xb88a45,normalizeJourneyDef,parseYamlString as a149_0x1aa5d9}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(_0x1cf8c3,_0x22442a,_0x2b2cc5){const _0x2e0b5e=a149_0xff4bac['relative'](_0x2b2cc5,_0x1cf8c3);if(existsSync(_0x1cf8c3)){const _0x4afc5f=readFileSync(_0x1cf8c3,'utf-8'),_0x29b628=generateDiff(_0x4afc5f,_0x22442a),_0x1f8753=hasChanges(_0x29b628);return{'relativePath':_0x2e0b5e,'absolutePath':_0x1cf8c3,'content':_0x22442a,'isNew':![],'hasChanges':_0x1f8753,'diff':_0x1f8753?formatDiffWithColors(_0x29b628):undefined};}return{'relativePath':_0x2e0b5e,'absolutePath':_0x1cf8c3,'content':_0x22442a,'isNew':!![],'hasChanges':![]};}function a149_0x26c1(_0xbfcc7e,_0x42db87){_0xbfcc7e=_0xbfcc7e-0xca;const _0x588873=a149_0x5888();let _0x26c119=_0x588873[_0xbfcc7e];return _0x26c119;}function getUniqueFileName(_0x9be126,_0x218ab6,_0x3da9e6){const _0x449e1e=a149_0x26c1,_0x8e0ed=_0x9be126+':'+_0x218ab6,_0x4ffa37=_0x3da9e6[_0x449e1e(0xe7)](_0x8e0ed)||0x0;_0x3da9e6[_0x449e1e(0xd0)](_0x8e0ed,_0x4ffa37+0x1);if(_0x4ffa37===0x0)return _0x218ab6;return _0x218ab6+'_'+(_0x4ffa37+0x1);}export async function pullSegments(_0x11cd56,_0x151821,_0x300f3d={}){const _0x47fd8f=a149_0x26c1,{targetDir:_0x43cb05,progress:_0x4fe457}=_0x300f3d;_0x4fe457?.[_0x47fd8f(0xd1)](_0x47fd8f(0xdc));const _0x2307c4=await _0x11cd56[_0x47fd8f(0xdb)][_0x47fd8f(0x110)](_0x151821);_0x4fe457?.[_0x47fd8f(0xd1)](_0x47fd8f(0xf7));const _0xd59a05=await _0x11cd56[_0x47fd8f(0xdb)]['getParent'](_0x2307c4),_0x2e3b88=_0xd59a05[_0x47fd8f(0xd9)][_0x47fd8f(0xf5)];_0x4fe457?.[_0x47fd8f(0xd1)](_0x47fd8f(0xcf));const [_0x4e910f,_0x351f51,_0x3024b8]=await Promise[_0x47fd8f(0xe9)]([_0x11cd56['segment'][_0x47fd8f(0xd5)](_0x2307c4),_0x11cd56['segment'][_0x47fd8f(0x106)](_0x2307c4),_0x11cd56['journey']['listJourneysWithDetailsFromParentSegment'](_0x2307c4,{'includeAllVersions':!![]})]),{journeys:_0x7e10de,activationStepsById:_0x3f9ad1}=_0x3024b8,_0x39fc10=new Map();for(const _0x995267 of _0x7e10de){_0x39fc10[_0x47fd8f(0xd0)](_0x995267['id'],_0x995267);}const _0x4a1d4e=_0x7e10de['map'](_0x20dc46=>({'id':_0x20dc46['id'],'name':_0x20dc46[_0x47fd8f(0xd9)][_0x47fd8f(0xf5)],'journeyBundleName':_0x20dc46['attributes'][_0x47fd8f(0xf9)]||'','journeyBundleId':_0x20dc46[_0x47fd8f(0xd9)][_0x47fd8f(0x103)]||'','versionNumber':_0x20dc46[_0x47fd8f(0xd9)][_0x47fd8f(0x10a)],'description':_0x20dc46[_0x47fd8f(0xd9)][_0x47fd8f(0x10b)],'state':_0x20dc46[_0x47fd8f(0xd9)][_0x47fd8f(0xde)],'paused':_0x20dc46[_0x47fd8f(0xd9)][_0x47fd8f(0xd8)],'audienceId':_0x20dc46[_0x47fd8f(0xd9)]['audienceId'],'folderId':_0x20dc46[_0x47fd8f(0xfd)]?.[_0x47fd8f(0x105)]?.[_0x47fd8f(0xff)]?.['id'],'createdAt':_0x20dc46[_0x47fd8f(0xd9)][_0x47fd8f(0x101)],'updatedAt':_0x20dc46[_0x47fd8f(0xd9)][_0x47fd8f(0xea)]})),_0x3b2bed=buildFolderIdToPathMap(_0x351f51),_0x5238e0=_0x43cb05||_0x47fd8f(0xe6)+sanitizeFileName(_0x2e3b88);_0x4fe457?.[_0x47fd8f(0xd1)]('Fetching\x20activations');const _0x20e8d8=new Map();await batchAsync(_0x4e910f,async _0xec347=>{const _0x37b009=_0x47fd8f,_0x20850a=await _0x11cd56[_0x37b009(0xdb)][_0x37b009(0xcd)](_0x2307c4,_0xec347['id']);_0x20e8d8[_0x37b009(0xd0)](_0xec347['id'],_0x20850a);}),_0x4fe457?.['update'](_0x47fd8f(0xf2));const [_0x3a250e,_0x440aae]=await Promise[_0x47fd8f(0xe9)]([_0x11cd56[_0x47fd8f(0xf3)]['buildIdToEmailMap'](),_0x11cd56['connection'][_0x47fd8f(0xda)]()]),_0x2c5bcc=[],_0x1988f8=new Map(),_0x392f7b=a149_0xff4bac[_0x47fd8f(0x10d)](_0x5238e0,_0x47fd8f(0xe4)),_0xf59157=createTdxConfigContent(_0x2e3b88);_0x2c5bcc[_0x47fd8f(0xe0)](prepareFile(_0x392f7b,_0xf59157,_0x5238e0));const _0x485f41=new Map();for(const _0x17377f of _0x4e910f){_0x485f41[_0x47fd8f(0xd0)](_0x17377f['id'],_0x17377f);}let _0x2a98f5=_0x4e910f;if(_0x300f3d[_0x47fd8f(0x111)]){const _0x57d97a=_0x4e910f[_0x47fd8f(0xfe)](_0x386d3c=>_0x386d3c['name'][_0x47fd8f(0xfb)]()===_0x300f3d['targetResourceName']['toLowerCase']());_0x57d97a[_0x47fd8f(0xec)]>0x0&&(_0x2a98f5=_0x57d97a);}_0x4fe457?.[_0x47fd8f(0xd1)](_0x47fd8f(0xf1));for(const _0x4f5778 of _0x2a98f5){if(_0x4f5778[_0x47fd8f(0xee)]===SEGMENT_KIND_JOURNEY)continue;const _0x2e3235=_0x4f5778['segmentFolderId']?_0x3b2bed[_0x47fd8f(0xe7)](_0x4f5778[_0x47fd8f(0xe1)])||'':'',_0x4fa64b=_0x20e8d8['get'](_0x4f5778['id'])||[],_0x471906=segmentWithActivationsToYaml(_0x4f5778,_0x4fa64b,undefined,_0x3a250e,_0x440aae),_0x928c1d=_0x2e3235?a149_0xff4bac['join'](_0x5238e0,_0x2e3235):_0x5238e0,_0x26d2ab=sanitizeFileName(_0x4f5778[_0x47fd8f(0xf5)]),_0x5f260d=getUniqueFileName(_0x928c1d,_0x26d2ab,_0x1988f8),_0x3a1b40=a149_0xff4bac[_0x47fd8f(0x10d)](_0x928c1d,_0x5f260d+'.yml'),_0x484adf=segmentToYamlString(_0x471906);_0x2c5bcc[_0x47fd8f(0xe0)](prepareFile(_0x3a1b40,_0x484adf,_0x5238e0));}const _0x316129=new Map();for(const _0x1caf79 of _0x4a1d4e){const _0x685393=_0x1caf79[_0x47fd8f(0x103)];!_0x316129[_0x47fd8f(0xcb)](_0x685393)&&_0x316129[_0x47fd8f(0xd0)](_0x685393,[]),_0x316129['get'](_0x685393)[_0x47fd8f(0xe0)](_0x1caf79);}for(const _0x3db8e6 of _0x316129[_0x47fd8f(0x10e)]()){_0x3db8e6[_0x47fd8f(0xe8)]((_0x3d3993,_0x399bc2)=>(_0x3d3993[_0x47fd8f(0x10a)]||0x0)-(_0x399bc2[_0x47fd8f(0x10a)]||0x0));}if(_0x300f3d['targetResourceName']){const _0x3dbf13=new Map();for(const [_0x33231e,_0x837cb3]of _0x316129){const _0x282506=_0x837cb3[0x0][_0x47fd8f(0xf9)];if(_0x282506[_0x47fd8f(0xfb)]()===_0x300f3d[_0x47fd8f(0x111)][_0x47fd8f(0xfb)]()){_0x3dbf13['set'](_0x33231e,_0x837cb3);break;}}_0x316129[_0x47fd8f(0xf8)]();for(const [_0x25fb89,_0x53cb95]of _0x3dbf13){_0x316129['set'](_0x25fb89,_0x53cb95);}}if(_0x316129[_0x47fd8f(0xd6)]>0x0){_0x4fe457?.[_0x47fd8f(0xd1)](_0x47fd8f(0xd7));const _0x352847=Array[_0x47fd8f(0x10f)](_0x316129['values']()),_0x4b3476=0x5,{createYamlContext:_0x89ec8a}=createYamlContextForBundle(_0x11cd56,_0x485f41,_0x3a250e,_0x440aae,_0x3f9ad1,_0x39fc10);for(let _0x2aa306=0x0;_0x2aa306<_0x352847[_0x47fd8f(0xec)];_0x2aa306+=_0x4b3476){const _0x2b40cb=_0x352847['slice'](_0x2aa306,_0x2aa306+_0x4b3476),_0x3fa674=await Promise[_0x47fd8f(0xe9)](_0x2b40cb[_0x47fd8f(0xe2)](async _0x526826=>{const _0x41b1e8=_0x47fd8f,_0x1928b7=_0x526826[0x0],_0x1d3a92=_0x1928b7[_0x41b1e8(0xf9)];_0x4fe457?.['update']('Processing\x20journey:\x20'+_0x1d3a92);const _0x459530=_0x1928b7[_0x41b1e8(0xed)]?_0x3b2bed['get'](_0x1928b7[_0x41b1e8(0xed)])||'':'',_0x572532=_0x459530?a149_0xff4bac['join'](_0x5238e0,_0x459530):_0x5238e0,_0x1cdb46=sanitizeFileName(_0x1d3a92),_0x244d3a=a149_0xff4bac[_0x41b1e8(0x10d)](_0x572532,_0x1cdb46+'.yml');let _0x6d329e;if(existsSync(_0x244d3a))try{const _0xaf2f6=readFileSync(_0x244d3a,_0x41b1e8(0xf4)),_0x1d2146=a149_0x1aa5d9(_0xaf2f6);_0x6d329e=buildLocalRuleToNameMappingFromJourney(_0x1d2146);}catch{}const _0x49468c=[];for(const _0x5703a0 of _0x526826){const _0xf8bad0=_0x39fc10[_0x41b1e8(0xe7)](_0x5703a0['id']);if(!_0xf8bad0){_0x4fe457?.[_0x41b1e8(0xd1)](_0x41b1e8(0xe5)+_0x5703a0['id']+_0x41b1e8(0xfc));continue;}const _0x3e72df=_0xf8bad0['attributes']?.['audienceId'],_0x4a12aa=_0x89ec8a(_0x5703a0['id'],_0x3e72df),_0x3302a6=await journeyResponseToDef(_0xf8bad0,_0x4a12aa);_0x49468c['push']({'item':_0x5703a0,'yaml':_0x3302a6});}const _0x59c3b4=await _0x11cd56['journey'][_0x41b1e8(0xcc)](_0x1928b7[_0x41b1e8(0x103)]),_0x42a74b=buildMergedJourneyDef(_0x49468c,_0x6d329e,_0x59c3b4);return{'bundleName':_0x1d3a92,'folderPath':_0x459530,'finalYaml':_0x42a74b};}));for(const {bundleName:_0x5683ef,folderPath:_0x154def,finalYaml:_0xa2548b}of _0x3fa674){const _0x3f393e=normalizeJourneyDef(_0xa2548b),_0x228b78=a149_0xb88a45(_0x3f393e),_0xb184e3=_0x154def?a149_0xff4bac[_0x47fd8f(0x10d)](_0x5238e0,_0x154def):_0x5238e0,_0x59f874=sanitizeFileName(_0x5683ef),_0x58ffc0=getUniqueFileName(_0xb184e3,_0x59f874,_0x1988f8),_0x33d1d9=a149_0xff4bac[_0x47fd8f(0x10d)](_0xb184e3,_0x58ffc0+_0x47fd8f(0xf0));_0x2c5bcc[_0x47fd8f(0xe0)](prepareFile(_0x33d1d9,_0x228b78,_0x5238e0));}}}const _0x3369d3=Array['from'](_0x20e8d8[_0x47fd8f(0x10e)]())['reduce']((_0x411ce7,_0x1313d4)=>_0x411ce7+_0x1313d4[_0x47fd8f(0xec)],0x0),_0x3f579e=_0x2a98f5[_0x47fd8f(0xfe)](_0x2b92cc=>_0x2b92cc['kind']!==SEGMENT_KIND_JOURNEY),_0xc0ae19=_0x2c5bcc['filter'](_0x5c43b7=>_0x5c43b7[_0x47fd8f(0xd2)])['length'],_0x35c966=_0x2c5bcc[_0x47fd8f(0xfe)](_0x4127b8=>!_0x4127b8[_0x47fd8f(0xd2)]&&_0x4127b8[_0x47fd8f(0xd3)])['length'],_0x369756=_0x2c5bcc[_0x47fd8f(0xfe)](_0x3da0ee=>!_0x3da0ee['isNew']&&!_0x3da0ee['hasChanges'])[_0x47fd8f(0xec)],_0x4b241e=Array[_0x47fd8f(0x10f)](_0x316129[_0x47fd8f(0x10e)]())[_0x47fd8f(0xef)]((_0xcac451,_0x1df04d)=>_0xcac451+_0x1df04d[_0x47fd8f(0xec)],0x0);return{'parentName':_0x2e3b88,'parentId':_0x2307c4,'targetDir':_0x5238e0,'files':_0x2c5bcc,'counts':{'segments':_0x3f579e['length'],'journeys':_0x316129[_0x47fd8f(0xd6)],'journeyVersions':_0x4b241e,'activations':_0x3369d3},'newFiles':_0xc0ae19,'changedFiles':_0x35c966,'unchangedFiles':_0x369756};}function createYamlContextForBundle(_0xb6aa6b,_0x3d94bd,_0x381630,_0x3ac5c2,_0x5e0030,_0x47d9c5){const _0x5c5802=new Set(),_0x50ae6f=new Map(),_0x28694c=new Map(),_0x56dc33=createJumpTargetCache(),_0x249d9a=async(_0x1f965f,_0x31ba11)=>{const _0x21f4a4=a149_0x26c1,_0x80aa80=_0x50ae6f['get'](_0x1f965f);if(_0x80aa80!==undefined)return _0x80aa80;if(!_0x31ba11)return _0x1f965f;try{let _0x4c3004=_0x3d94bd[_0x21f4a4(0xe7)](_0x1f965f);!_0x4c3004&&(_0x4c3004=await _0xb6aa6b[_0x21f4a4(0xdb)][_0x21f4a4(0x104)](_0x31ba11,_0x1f965f),_0x3d94bd[_0x21f4a4(0xd0)](_0x1f965f,_0x4c3004));const _0x4fdef5=generateJourneyLocalName(_0x4c3004[_0x21f4a4(0xf5)]),_0x30cd85=_0x4c3004[_0x21f4a4(0xee)]===SEGMENT_KIND_JOURNEY&&_0x4fdef5!==undefined;if(_0x30cd85&&_0x4fdef5){let _0x2cc5a4=_0x4fdef5,_0x49422b=0x2;while(_0x5c5802[_0x21f4a4(0xcb)](_0x2cc5a4)){_0x2cc5a4=_0x4fdef5+'_'+_0x49422b,_0x49422b++;}return _0x5c5802[_0x21f4a4(0x108)](_0x2cc5a4),_0x50ae6f['set'](_0x1f965f,_0x2cc5a4),_0x2cc5a4;}return _0x4c3004['name'];}catch{return _0x1f965f;}},_0x5670aa=(_0x375d15,_0x140849)=>({'resolveSegment':async _0x2ee967=>{const _0x419885=a149_0x26c1,_0x4dc026=_0x50ae6f[_0x419885(0xe7)](_0x2ee967);if(_0x4dc026!==undefined)return{'name':_0x4dc026,'isJourneyLocal':!![]};if(!_0x140849)return{'name':_0x2ee967,'isJourneyLocal':![]};try{let _0x5e824c=_0x3d94bd[_0x419885(0xe7)](_0x2ee967);!_0x5e824c&&(_0x5e824c=await _0xb6aa6b[_0x419885(0xdb)]['getSegment'](_0x140849,_0x2ee967),_0x3d94bd[_0x419885(0xd0)](_0x2ee967,_0x5e824c));const _0x4d5f98=generateJourneyLocalName(_0x5e824c['name']),_0x15ebd5=_0x5e824c[_0x419885(0xee)]===SEGMENT_KIND_JOURNEY&&_0x4d5f98!==undefined;if(_0x15ebd5&&!_0x5e824c[_0x419885(0x109)]&&_0x140849)try{const _0xc1b3f0=await _0xb6aa6b[_0x419885(0xdb)][_0x419885(0x104)](_0x140849,_0x2ee967);_0x3d94bd[_0x419885(0xd0)](_0x2ee967,_0xc1b3f0),_0x5e824c=_0xc1b3f0;}catch{}const _0x5c2714=await _0x249d9a(_0x2ee967,_0x140849);let _0xc37920;if(_0x15ebd5&&_0x5e824c[_0x419885(0x109)]){const _0x1c7227=await segmentResponseToDef(_0x5e824c,{'resolveSegmentName':_0x47fd06=>_0x249d9a(_0x47fd06,_0x140849)});_0xc37920={'description':_0x5e824c['description'],'rule':_0x1c7227[_0x419885(0x109)]};}return{'name':_0x5c2714,'isJourneyLocal':_0x15ebd5,'definition':_0xc37920};}catch{return{'name':_0x2ee967,'isJourneyLocal':![]};}},'resolveActivation':async _0x109bf0=>{const _0x11f376=a149_0x26c1,_0x2bf2dc=_0x28694c[_0x11f376(0xe7)](_0x109bf0);if(_0x2bf2dc!==undefined)return{'name':_0x2bf2dc,'isJourneyLocal':!![]};try{let _0x40caca=_0x5e0030[_0x11f376(0xe7)](_0x109bf0);!_0x40caca&&(_0x40caca=await _0xb6aa6b[_0x11f376(0xca)][_0x11f376(0x107)](_0x375d15,_0x109bf0));const _0x57c73f=_0x40caca[_0x11f376(0xd9)][_0x11f376(0xdd)]['name']||_0x109bf0,_0xe74952=sanitizeYamlKey(_0x57c73f)||_0x11f376(0x100)+_0x109bf0,_0x28be1f=_0xe74952;_0x28694c[_0x11f376(0xd0)](_0x109bf0,_0x28be1f);const _0x1cf798=journeyActivationStepToYaml(_0x40caca,_0x381630,_0x3ac5c2);return{'name':_0x28be1f,'isJourneyLocal':!![],'definition':_0x1cf798};}catch{return{'name':_0x109bf0,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x44ec73,_0xedabe1)=>resolveJumpTarget(_0x44ec73,_0xedabe1,_0x56dc33,async _0x26aad7=>{const _0x31ada0=a149_0x26c1,_0x302eb7=_0x47d9c5[_0x31ada0(0xe7)](_0x26aad7);if(_0x302eb7)return _0x302eb7;return _0xb6aa6b['journey']['getJourney'](_0x26aad7);})});return{'createYamlContext':_0x5670aa};}
|
|
1
|
+
(function(_0x36a3b5,_0x30fb25){const _0x5853f8=a149_0x39c2,_0x4acd2d=_0x36a3b5();while(!![]){try{const _0x1fd125=parseInt(_0x5853f8(0xfa))/0x1+parseInt(_0x5853f8(0xf2))/0x2+-parseInt(_0x5853f8(0xe9))/0x3*(-parseInt(_0x5853f8(0x119))/0x4)+-parseInt(_0x5853f8(0xef))/0x5*(parseInt(_0x5853f8(0x10c))/0x6)+parseInt(_0x5853f8(0xfd))/0x7+-parseInt(_0x5853f8(0x11c))/0x8+-parseInt(_0x5853f8(0x11d))/0x9;if(_0x1fd125===_0x30fb25)break;else _0x4acd2d['push'](_0x4acd2d['shift']());}catch(_0x32af35){_0x4acd2d['push'](_0x4acd2d['shift']());}}}(a149_0x22c1,0x4e754));import a149_0x3b22ca 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';function a149_0x39c2(_0x4ff5ca,_0x4e9728){_0x4ff5ca=_0x4ff5ca-0xe2;const _0x22c159=a149_0x22c1();let _0x39c255=_0x22c159[_0x4ff5ca];return _0x39c255;}import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a149_0x314429,normalizeJourneyDef,parseYamlString as a149_0x47cd19}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';function a149_0x22c1(){const _0x3838b2=['update','user','listSegments','113260IiNsxj','listFolders','join','4192958acaBYh','.yml','description','reduce','getJourney','segment','Warning:\x20Journey\x20','filter','rule','listJourneysWithDetailsFromParentSegment','segmentFolderId','Fetching\x20parent\x20segment\x20info','attributes','journeyBundleName','journeyBundleId','762wkpLva','slice','all','buildIdToEmailMap','folderId','paused','getActivation','versionNumber','getLatestJourneyId','createdAt','connection','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','relative','4DuHVIV','audienceId','from','738344fzghzx','3501765FrfkoT','parentFolder','journey','map','clear','push','Processing\x20segments','name','size','Processing\x20journeys','activationParams','values','tdx.json','updatedAt','hasChanges','toLowerCase','isNew','targetResourceName','getParent','get','has','kind','buildIdToNameMap','1326957DPWDVE','listActivations','sort','state','resolveParentId','getSegment','22385vrdghv','Processing\x20journey:\x20','relationships','433496AKPtEl','utf-8','set','Fetching\x20users\x20and\x20connections','length'];a149_0x22c1=function(){return _0x3838b2;};return a149_0x22c1();}import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x58e918,_0x5a5b2e,_0x5c00cd){const _0x1e68e8=a149_0x39c2,_0x48b099=a149_0x3b22ca[_0x1e68e8(0x118)](_0x5c00cd,_0x58e918);if(existsSync(_0x58e918)){const _0x408e65=readFileSync(_0x58e918,_0x1e68e8(0xf3)),_0x3e6fc2=generateDiff(_0x408e65,_0x5a5b2e),_0x51f096=hasChanges(_0x3e6fc2);return{'relativePath':_0x48b099,'absolutePath':_0x58e918,'content':_0x5a5b2e,'isNew':![],'hasChanges':_0x51f096,'diff':_0x51f096?formatDiffWithColors(_0x3e6fc2):undefined};}return{'relativePath':_0x48b099,'absolutePath':_0x58e918,'content':_0x5a5b2e,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x517517,_0x2eec14,_0x199982){const _0x529e85=a149_0x39c2,_0x25c601=_0x517517+':'+_0x2eec14,_0x55fcf6=_0x199982['get'](_0x25c601)||0x0;_0x199982[_0x529e85(0xf4)](_0x25c601,_0x55fcf6+0x1);if(_0x55fcf6===0x0)return _0x2eec14;return _0x2eec14+'_'+(_0x55fcf6+0x1);}export async function pullSegments(_0x4a5938,_0x134879,_0x4c14b4={}){const _0x3814f9=a149_0x39c2,{targetDir:_0x519994,progress:_0x4c80d6}=_0x4c14b4;_0x4c80d6?.['update']('Resolving\x20parent\x20segment');const _0x19039e=await _0x4a5938['segment'][_0x3814f9(0xed)](_0x134879);_0x4c80d6?.[_0x3814f9(0xf7)](_0x3814f9(0x108));const _0x4adf19=await _0x4a5938[_0x3814f9(0x102)][_0x3814f9(0xe4)](_0x19039e),_0x5cbe3c=_0x4adf19[_0x3814f9(0x109)][_0x3814f9(0x124)];_0x4c80d6?.[_0x3814f9(0xf7)]('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x13a17e,_0x36245c,_0x428178]=await Promise['all']([_0x4a5938[_0x3814f9(0x102)][_0x3814f9(0xf9)](_0x19039e),_0x4a5938[_0x3814f9(0x102)][_0x3814f9(0xfb)](_0x19039e),_0x4a5938[_0x3814f9(0x11f)][_0x3814f9(0x106)](_0x19039e,{'includeAllVersions':!![]})]),{journeys:_0x12fab0,activationStepsById:_0x34f701}=_0x428178,_0x138120=new Map();for(const _0x3fe1cb of _0x12fab0){_0x138120[_0x3814f9(0xf4)](_0x3fe1cb['id'],_0x3fe1cb);}const _0x16b4e3=_0x12fab0['map'](_0x1d6e10=>({'id':_0x1d6e10['id'],'name':_0x1d6e10[_0x3814f9(0x109)]['name'],'journeyBundleName':_0x1d6e10[_0x3814f9(0x109)][_0x3814f9(0x10a)]||'','journeyBundleId':_0x1d6e10[_0x3814f9(0x109)][_0x3814f9(0x10b)]||'','versionNumber':_0x1d6e10['attributes'][_0x3814f9(0x113)],'description':_0x1d6e10[_0x3814f9(0x109)][_0x3814f9(0xff)],'state':_0x1d6e10[_0x3814f9(0x109)][_0x3814f9(0xec)],'paused':_0x1d6e10[_0x3814f9(0x109)][_0x3814f9(0x111)],'audienceId':_0x1d6e10[_0x3814f9(0x109)][_0x3814f9(0x11a)],'folderId':_0x1d6e10[_0x3814f9(0xf1)]?.[_0x3814f9(0x11e)]?.['data']?.['id'],'createdAt':_0x1d6e10[_0x3814f9(0x109)][_0x3814f9(0x115)],'updatedAt':_0x1d6e10['attributes'][_0x3814f9(0x12a)]})),_0x334920=buildFolderIdToPathMap(_0x36245c),_0x3e6290=_0x519994||'segments/'+sanitizeFileName(_0x5cbe3c);_0x4c80d6?.[_0x3814f9(0xf7)]('Fetching\x20activations');const _0x1d4f16=new Map();await batchAsync(_0x13a17e,async _0x33db6e=>{const _0x194340=_0x3814f9,_0x32f4a0=await _0x4a5938[_0x194340(0x102)][_0x194340(0xea)](_0x19039e,_0x33db6e['id']);_0x1d4f16[_0x194340(0xf4)](_0x33db6e['id'],_0x32f4a0);}),_0x4c80d6?.['update'](_0x3814f9(0xf5));const [_0x2ce18b,_0x1bb8fc]=await Promise[_0x3814f9(0x10e)]([_0x4a5938[_0x3814f9(0xf8)][_0x3814f9(0x10f)](),_0x4a5938[_0x3814f9(0x116)][_0x3814f9(0xe8)]()]),_0x32990f=[],_0xe77796=new Map(),_0x14586f=a149_0x3b22ca[_0x3814f9(0xfc)](_0x3e6290,_0x3814f9(0x129)),_0x143028=createTdxConfigContent(_0x5cbe3c);_0x32990f[_0x3814f9(0x122)](prepareFile(_0x14586f,_0x143028,_0x3e6290));const _0x44bbf1=new Map();for(const _0x83230f of _0x13a17e){_0x44bbf1[_0x3814f9(0xf4)](_0x83230f['id'],_0x83230f);}let _0x42e083=_0x13a17e;if(_0x4c14b4[_0x3814f9(0xe3)]){const _0x3cbf05=_0x13a17e[_0x3814f9(0x104)](_0x599791=>_0x599791[_0x3814f9(0x124)]['toLowerCase']()===_0x4c14b4[_0x3814f9(0xe3)]['toLowerCase']());_0x3cbf05[_0x3814f9(0xf6)]>0x0&&(_0x42e083=_0x3cbf05);}_0x4c80d6?.[_0x3814f9(0xf7)](_0x3814f9(0x123));for(const _0x5b19ea of _0x42e083){if(_0x5b19ea[_0x3814f9(0xe7)]===SEGMENT_KIND_JOURNEY)continue;const _0x3878f4=_0x5b19ea[_0x3814f9(0x107)]?_0x334920[_0x3814f9(0xe5)](_0x5b19ea[_0x3814f9(0x107)])||'':'',_0x5a4376=_0x1d4f16[_0x3814f9(0xe5)](_0x5b19ea['id'])||[],_0x41cd7d=segmentWithActivationsToYaml(_0x5b19ea,_0x5a4376,undefined,_0x2ce18b,_0x1bb8fc),_0x47e206=_0x3878f4?a149_0x3b22ca['join'](_0x3e6290,_0x3878f4):_0x3e6290,_0x596c0f=sanitizeFileName(_0x5b19ea['name']),_0x2e3239=getUniqueFileName(_0x47e206,_0x596c0f,_0xe77796),_0x2ccbd8=a149_0x3b22ca[_0x3814f9(0xfc)](_0x47e206,_0x2e3239+_0x3814f9(0xfe)),_0x456d97=segmentToYamlString(_0x41cd7d);_0x32990f[_0x3814f9(0x122)](prepareFile(_0x2ccbd8,_0x456d97,_0x3e6290));}const _0x4f8ec5=new Map();for(const _0x1d448c of _0x16b4e3){const _0x17824c=_0x1d448c[_0x3814f9(0x10b)];!_0x4f8ec5['has'](_0x17824c)&&_0x4f8ec5[_0x3814f9(0xf4)](_0x17824c,[]),_0x4f8ec5[_0x3814f9(0xe5)](_0x17824c)[_0x3814f9(0x122)](_0x1d448c);}for(const _0x21970e of _0x4f8ec5['values']()){_0x21970e[_0x3814f9(0xeb)]((_0xf3de35,_0x4c04ca)=>(_0xf3de35[_0x3814f9(0x113)]||0x0)-(_0x4c04ca[_0x3814f9(0x113)]||0x0));}if(_0x4c14b4[_0x3814f9(0xe3)]){const _0x4a27ae=new Map();for(const [_0x348878,_0x5815ed]of _0x4f8ec5){const _0xbe2893=_0x5815ed[0x0][_0x3814f9(0x10a)];if(_0xbe2893[_0x3814f9(0x12c)]()===_0x4c14b4[_0x3814f9(0xe3)]['toLowerCase']()){_0x4a27ae['set'](_0x348878,_0x5815ed);break;}}_0x4f8ec5[_0x3814f9(0x121)]();for(const [_0x163088,_0x2a9a7e]of _0x4a27ae){_0x4f8ec5['set'](_0x163088,_0x2a9a7e);}}if(_0x4f8ec5['size']>0x0){_0x4c80d6?.[_0x3814f9(0xf7)](_0x3814f9(0x126));const _0x153bd2=Array[_0x3814f9(0x11b)](_0x4f8ec5[_0x3814f9(0x128)]()),_0x4e43c9=0x5,{createYamlContext:_0x9fe851}=createYamlContextForBundle(_0x4a5938,_0x44bbf1,_0x2ce18b,_0x1bb8fc,_0x34f701,_0x138120);for(let _0x2f9781=0x0;_0x2f9781<_0x153bd2[_0x3814f9(0xf6)];_0x2f9781+=_0x4e43c9){const _0x2202c5=_0x153bd2[_0x3814f9(0x10d)](_0x2f9781,_0x2f9781+_0x4e43c9),_0x507be6=await Promise[_0x3814f9(0x10e)](_0x2202c5[_0x3814f9(0x120)](async _0x53f6d2=>{const _0xf3902c=_0x3814f9,_0x175da6=_0x53f6d2[0x0],_0x28effb=_0x175da6[_0xf3902c(0x10a)];_0x4c80d6?.[_0xf3902c(0xf7)](_0xf3902c(0xf0)+_0x28effb);const _0x587b85=_0x175da6['folderId']?_0x334920['get'](_0x175da6[_0xf3902c(0x110)])||'':'',_0x2ab47a=_0x587b85?a149_0x3b22ca[_0xf3902c(0xfc)](_0x3e6290,_0x587b85):_0x3e6290,_0x5a7703=sanitizeFileName(_0x28effb),_0x54fdd1=a149_0x3b22ca[_0xf3902c(0xfc)](_0x2ab47a,_0x5a7703+_0xf3902c(0xfe));let _0x3387d1;if(existsSync(_0x54fdd1))try{const _0x3ee181=readFileSync(_0x54fdd1,'utf-8'),_0x38d43d=a149_0x47cd19(_0x3ee181);_0x3387d1=buildLocalRuleToNameMappingFromJourney(_0x38d43d);}catch{}const _0x497ce9=[];for(const _0x315be3 of _0x53f6d2){const _0x4c27e2=_0x138120[_0xf3902c(0xe5)](_0x315be3['id']);if(!_0x4c27e2){_0x4c80d6?.[_0xf3902c(0xf7)](_0xf3902c(0x103)+_0x315be3['id']+_0xf3902c(0x117));continue;}const _0x10b14f=_0x4c27e2[_0xf3902c(0x109)]?.[_0xf3902c(0x11a)],_0x1f7cc8=_0x9fe851(_0x315be3['id'],_0x10b14f),_0x5d9e37=await journeyResponseToDef(_0x4c27e2,_0x1f7cc8);_0x497ce9[_0xf3902c(0x122)]({'item':_0x315be3,'yaml':_0x5d9e37});}const _0x5bb21b=await _0x4a5938[_0xf3902c(0x11f)][_0xf3902c(0x114)](_0x175da6['journeyBundleId']),_0x35a4ec=buildMergedJourneyDef(_0x497ce9,_0x3387d1,_0x5bb21b);return{'bundleName':_0x28effb,'folderPath':_0x587b85,'finalYaml':_0x35a4ec};}));for(const {bundleName:_0x4949c3,folderPath:_0x3873f0,finalYaml:_0x59dc72}of _0x507be6){const _0x539bcd=normalizeJourneyDef(_0x59dc72),_0x1fca12=a149_0x314429(_0x539bcd),_0x1a78c7=_0x3873f0?a149_0x3b22ca[_0x3814f9(0xfc)](_0x3e6290,_0x3873f0):_0x3e6290,_0x54fd3c=sanitizeFileName(_0x4949c3),_0xf48da9=getUniqueFileName(_0x1a78c7,_0x54fd3c,_0xe77796),_0x88982e=a149_0x3b22ca[_0x3814f9(0xfc)](_0x1a78c7,_0xf48da9+'.yml');_0x32990f[_0x3814f9(0x122)](prepareFile(_0x88982e,_0x1fca12,_0x3e6290));}}}const _0x29f01d=Array['from'](_0x1d4f16[_0x3814f9(0x128)]())[_0x3814f9(0x100)]((_0x27ba97,_0x59a35f)=>_0x27ba97+_0x59a35f[_0x3814f9(0xf6)],0x0),_0x2b3530=_0x42e083[_0x3814f9(0x104)](_0x4627d9=>_0x4627d9['kind']!==SEGMENT_KIND_JOURNEY),_0x1a0506=_0x32990f['filter'](_0x2e4b9e=>_0x2e4b9e['isNew'])[_0x3814f9(0xf6)],_0x3c1ab7=_0x32990f[_0x3814f9(0x104)](_0x6d1b48=>!_0x6d1b48[_0x3814f9(0xe2)]&&_0x6d1b48[_0x3814f9(0x12b)])['length'],_0x31c601=_0x32990f[_0x3814f9(0x104)](_0x19cd78=>!_0x19cd78['isNew']&&!_0x19cd78[_0x3814f9(0x12b)])[_0x3814f9(0xf6)],_0x37f7bf=Array[_0x3814f9(0x11b)](_0x4f8ec5[_0x3814f9(0x128)]())['reduce']((_0x4068bd,_0x169c1d)=>_0x4068bd+_0x169c1d[_0x3814f9(0xf6)],0x0);return{'parentName':_0x5cbe3c,'parentId':_0x19039e,'targetDir':_0x3e6290,'files':_0x32990f,'counts':{'segments':_0x2b3530[_0x3814f9(0xf6)],'journeys':_0x4f8ec5[_0x3814f9(0x125)],'journeyVersions':_0x37f7bf,'activations':_0x29f01d},'newFiles':_0x1a0506,'changedFiles':_0x3c1ab7,'unchangedFiles':_0x31c601};}function createYamlContextForBundle(_0xcd81cd,_0x3d404a,_0x25839f,_0x41c81c,_0x3becaf,_0x4cbe44){const _0x5259e9=new Set(),_0x2e9b7d=new Map(),_0x459911=new Map(),_0x545dc3=createJumpTargetCache(),_0x2cbc2c=async(_0x5abed8,_0x4bd490)=>{const _0x52eb3c=a149_0x39c2,_0x37ddcd=_0x2e9b7d[_0x52eb3c(0xe5)](_0x5abed8);if(_0x37ddcd!==undefined)return _0x37ddcd;if(!_0x4bd490)return _0x5abed8;try{let _0x109f71=_0x3d404a['get'](_0x5abed8);!_0x109f71&&(_0x109f71=await _0xcd81cd[_0x52eb3c(0x102)][_0x52eb3c(0xee)](_0x4bd490,_0x5abed8),_0x3d404a[_0x52eb3c(0xf4)](_0x5abed8,_0x109f71));const _0x198744=generateJourneyLocalName(_0x109f71[_0x52eb3c(0x124)]),_0x552886=_0x109f71[_0x52eb3c(0xe7)]===SEGMENT_KIND_JOURNEY&&_0x198744!==undefined;if(_0x552886&&_0x198744){let _0x34780a=_0x198744,_0x4d830a=0x2;while(_0x5259e9[_0x52eb3c(0xe6)](_0x34780a)){_0x34780a=_0x198744+'_'+_0x4d830a,_0x4d830a++;}return _0x5259e9['add'](_0x34780a),_0x2e9b7d[_0x52eb3c(0xf4)](_0x5abed8,_0x34780a),_0x34780a;}return _0x109f71[_0x52eb3c(0x124)];}catch{return _0x5abed8;}},_0x1c09c5=(_0x5cc5f5,_0x2fc1f1)=>({'resolveSegment':async _0x565e08=>{const _0x4a9403=a149_0x39c2,_0x10704a=_0x2e9b7d[_0x4a9403(0xe5)](_0x565e08);if(_0x10704a!==undefined)return{'name':_0x10704a,'isJourneyLocal':!![]};if(!_0x2fc1f1)return{'name':_0x565e08,'isJourneyLocal':![]};try{let _0x589713=_0x3d404a[_0x4a9403(0xe5)](_0x565e08);!_0x589713&&(_0x589713=await _0xcd81cd['segment'][_0x4a9403(0xee)](_0x2fc1f1,_0x565e08),_0x3d404a[_0x4a9403(0xf4)](_0x565e08,_0x589713));const _0x1b1cf9=generateJourneyLocalName(_0x589713[_0x4a9403(0x124)]),_0x4b3678=_0x589713[_0x4a9403(0xe7)]===SEGMENT_KIND_JOURNEY&&_0x1b1cf9!==undefined;if(_0x4b3678&&!_0x589713[_0x4a9403(0x105)]&&_0x2fc1f1)try{const _0x888102=await _0xcd81cd['segment']['getSegment'](_0x2fc1f1,_0x565e08);_0x3d404a[_0x4a9403(0xf4)](_0x565e08,_0x888102),_0x589713=_0x888102;}catch{}const _0x20571f=await _0x2cbc2c(_0x565e08,_0x2fc1f1);let _0x11885d;if(_0x4b3678&&_0x589713[_0x4a9403(0x105)]){const _0xd09249=await segmentResponseToDef(_0x589713,{'resolveSegmentName':_0x256fb9=>_0x2cbc2c(_0x256fb9,_0x2fc1f1)});_0x11885d={'description':_0x589713[_0x4a9403(0xff)],'rule':_0xd09249[_0x4a9403(0x105)]};}return{'name':_0x20571f,'isJourneyLocal':_0x4b3678,'definition':_0x11885d};}catch{return{'name':_0x565e08,'isJourneyLocal':![]};}},'resolveActivation':async _0x3f3526=>{const _0x42457c=a149_0x39c2,_0x394afa=_0x459911['get'](_0x3f3526);if(_0x394afa!==undefined)return{'name':_0x394afa,'isJourneyLocal':!![]};try{let _0x36f9cb=_0x3becaf[_0x42457c(0xe5)](_0x3f3526);!_0x36f9cb&&(_0x36f9cb=await _0xcd81cd[_0x42457c(0x11f)][_0x42457c(0x112)](_0x5cc5f5,_0x3f3526));const _0x3ee344=_0x36f9cb[_0x42457c(0x109)][_0x42457c(0x127)][_0x42457c(0x124)]||_0x3f3526,_0x2b5532=sanitizeYamlKey(_0x3ee344)||'activation_'+_0x3f3526,_0x5d4f8a=_0x2b5532;_0x459911['set'](_0x3f3526,_0x5d4f8a);const _0xad3e8e=journeyActivationStepToYaml(_0x36f9cb,_0x25839f,_0x41c81c);return{'name':_0x5d4f8a,'isJourneyLocal':!![],'definition':_0xad3e8e};}catch{return{'name':_0x3f3526,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x46760a,_0x2dbe90)=>resolveJumpTarget(_0x46760a,_0x2dbe90,_0x545dc3,async _0xfd18d2=>{const _0x5bd222=a149_0x39c2,_0x10a340=_0x4cbe44['get'](_0xfd18d2);if(_0x10a340)return _0x10a340;return _0xcd81cd['journey'][_0x5bd222(0x101)](_0xfd18d2);})});return{'createYamlContext':_0x1c09c5};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0xcafed7,_0x58a4c8){const _0x1483f1=a150_0x3e3b,_0x5060c5=_0xcafed7();while(!![]){try{const _0x2ca6d2=-parseInt(_0x1483f1(0x156))/0x1*(parseInt(_0x1483f1(0x152))/0x2)+-parseInt(_0x1483f1(0x15f))/0x3*(-parseInt(_0x1483f1(0x150))/0x4)+-parseInt(_0x1483f1(0x162))/0x5*(parseInt(_0x1483f1(0x15b))/0x6)+-parseInt(_0x1483f1(0x155))/0x7*(-parseInt(_0x1483f1(0x166))/0x8)+parseInt(_0x1483f1(0x15a))/0x9*(-parseInt(_0x1483f1(0x158))/0xa)+parseInt(_0x1483f1(0x157))/0xb*(parseInt(_0x1483f1(0x161))/0xc)+-parseInt(_0x1483f1(0x164))/0xd*(-parseInt(_0x1483f1(0x15e))/0xe);if(_0x2ca6d2===_0x58a4c8)break;else _0x5060c5['push'](_0x5060c5['shift']());}catch(_0x3600e6){_0x5060c5['push'](_0x5060c5['shift']());}}}(a150_0x4a24,0x25f09));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';function a150_0x3e3b(_0x4b9f89,_0x2ec101){_0x4b9f89=_0x4b9f89-0x150;const _0x4a24f7=a150_0x4a24();let _0x3e3bb6=_0x4a24f7[_0x4b9f89];return _0x3e3bb6;}import a150_0x2037a2 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x32eab4){const _0x1acf5c=a150_0x3e3b,_0x161dc4=a150_0x2037a2[_0x1acf5c(0x15d)](_0x32eab4),_0x684dbe=a150_0x2037a2['basename'](_0x32eab4);return a150_0x2037a2[_0x1acf5c(0x15c)](_0x161dc4,'.'+_0x684dbe+'.push-recovery.json');}export function readPushRecovery(_0x4f660c){const _0x58d918=a150_0x3e3b,_0xdd8b07=getPushRecoveryPath(_0x4f660c);if(!existsSync(_0xdd8b07))return undefined;try{const _0x474023=readFileSync(_0xdd8b07,_0x58d918(0x167)),_0x2dfced=JSON['parse'](_0x474023);if(_0x2dfced?.[_0x58d918(0x165)]!==0x1||typeof _0x2dfced[_0x58d918(0x160)]!=='string')return undefined;return _0x2dfced;}catch(_0x2b0e52){return _0x2b0e52 instanceof SyntaxError?logger[_0x58d918(0x163)](_0x58d918(0x151)+_0x2b0e52):logger[_0x58d918(0x154)](_0x58d918(0x159)+_0x2b0e52),undefined;}}export function writePushRecovery(_0x5e7685,_0x4d640c){const _0x99df36=a150_0x3e3b,_0x5ba9db=getPushRecoveryPath(_0x5e7685),_0xb2a7fe=_0x5ba9db+'.tmp';writeFileSync(_0xb2a7fe,JSON[_0x99df36(0x168)](_0x4d640c,null,0x2)+'\x0a',_0x99df36(0x167)),renameSync(_0xb2a7fe,_0x5ba9db);}export function deletePushRecovery(_0x4befe1){const _0x4fd5bc=a150_0x3e3b,_0x481556=getPushRecoveryPath(_0x4befe1);try{unlinkSync(_0x481556);}catch(_0xb78bef){_0xb78bef['code']!=='ENOENT'&&logger[_0x4fd5bc(0x163)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0xb78bef);}}function a150_0x4a24(){const _0x3f9d2d=['warn','1463196NloAgh','23hJFLOg','556127uKlWRd','10bGWsHB','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','1735317EvCFuc','806634qyqBzm','join','dirname','14mEpUdL','6JUgSGS','journeyName','12bTwcJY','10AJlNCh','debug','3306693YFNuVV','version','8sLWWdt','utf-8','stringify','469136AnsSNH','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','11428bjtwfS','toISOString'];a150_0x4a24=function(){return _0x3f9d2d;};return a150_0x4a24();}export function saveSegmentToPushRecovery(_0x121287,_0x59f16c,_0x2a5780,_0xe3c79f){const _0x57760c=a150_0x3e3b,_0x532b80=readPushRecovery(_0x121287),_0xbd4e39=_0x532b80?.[_0x57760c(0x160)]===_0x59f16c?{..._0x532b80,'updatedAt':new Date()[_0x57760c(0x153)]()}:{'version':0x1,'journeyName':_0x59f16c,'updatedAt':new Date()[_0x57760c(0x153)](),'segments':{}};_0xbd4e39['segments'][_0x2a5780]=_0xe3c79f,writePushRecovery(_0x121287,_0xbd4e39);}
|