@treasuredata/tdx 2026.4.0 → 2026.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.js +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/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(_0xbe8d6,_0x171ccc){const _0x26d136=a149_0x5795,_0x1ad8a2=_0xbe8d6();while(!![]){try{const _0x53a564=parseInt(_0x26d136(0x149))/0x1*(parseInt(_0x26d136(0xdd))/0x2)+-parseInt(_0x26d136(0xf2))/0x3+-parseInt(_0x26d136(0x11d))/0x4*(parseInt(_0x26d136(0x112))/0x5)+parseInt(_0x26d136(0x108))/0x6*(-parseInt(_0x26d136(0xfc))/0x7)+parseInt(_0x26d136(0x10d))/0x8+-parseInt(_0x26d136(0x123))/0x9+parseInt(_0x26d136(0x135))/0xa*(parseInt(_0x26d136(0x140))/0xb);if(_0x53a564===_0x171ccc)break;else _0x1ad8a2['push'](_0x1ad8a2['shift']());}catch(_0x47d2b3){_0x1ad8a2['push'](_0x1ad8a2['shift']());}}}(a149_0x35bf,0x2fecd));function a149_0x5795(_0x1dc139,_0x28d582){_0x1dc139=_0x1dc139-0xdd;const _0x35bf9f=a149_0x35bf();let _0x579547=_0x35bf9f[_0x1dc139];return _0x579547;}import*as a149_0x25deda from'yaml';function formatScheduleTime(_0x5368fc){const _0x48e62a=a149_0x5795;if(typeof _0x5368fc==='number'){const _0x35fb46=Math[_0x48e62a(0x127)](_0x5368fc);return String(_0x35fb46)[_0x48e62a(0x12c)](0x2,'0')+_0x48e62a(0x132);}if(typeof _0x5368fc===_0x48e62a(0x11e)){if(/^\d{2}:\d{2}:\d{2}$/['test'](_0x5368fc))return _0x5368fc;if(/^\d{1,2}:\d{2}$/[_0x48e62a(0x13a)](_0x5368fc)){const [_0x473a05,_0x247d2d]=_0x5368fc[_0x48e62a(0x116)](':');return _0x473a05[_0x48e62a(0x12c)](0x2,'0')+':'+_0x247d2d+_0x48e62a(0xff);}const _0x43a8bb=parseInt(_0x5368fc,0xa);if(!isNaN(_0x43a8bb)&&_0x5368fc[_0x48e62a(0x13f)](/^\d+$/))return String(_0x43a8bb)[_0x48e62a(0x12c)](0x2,'0')+':00:00';return _0x5368fc;}return String(_0x5368fc);}export function apiToDef(_0x5765c7){const _0x94794b=a149_0x5795,_0x2b7382={'database':_0x5765c7[_0x94794b(0x145)]?.[_0x94794b(0xe1)]||'','table':_0x5765c7[_0x94794b(0x145)]?.['parentTableName']||''};_0x5765c7[_0x94794b(0x131)]&&_0x5765c7[_0x94794b(0x131)][_0x94794b(0x120)]>0x0&&(_0x2b7382[_0x94794b(0x12f)]=_0x5765c7[_0x94794b(0x131)][_0x94794b(0x110)](_0x2f67d4=>({'column':_0x2f67d4[_0x94794b(0x104)],'values':_0x2f67d4[_0x94794b(0xf7)]})));let _0x339d5c;_0x5765c7[_0x94794b(0x124)]&&_0x5765c7[_0x94794b(0x124)]!==_0x94794b(0x12a)&&(_0x339d5c={'type':_0x5765c7['scheduleType']},_0x5765c7[_0x94794b(0xfd)]&&(_0x339d5c[_0x94794b(0x134)]=formatScheduleTime(_0x5765c7[_0x94794b(0xfd)])),_0x5765c7['timezone']&&(_0x339d5c[_0x94794b(0x12b)]=_0x5765c7[_0x94794b(0x12b)]));let _0xa9cb41;(_0x5765c7[_0x94794b(0x11f)]||_0x5765c7[_0x94794b(0xec)]||_0x5765c7['prestoPoolName'])&&(_0xa9cb41={},_0x5765c7[_0x94794b(0x11f)]&&(_0xa9cb41[_0x94794b(0x10a)]=_0x5765c7['workflowHiveOnly']),_0x5765c7[_0x94794b(0xec)]&&(_0xa9cb41[_0x94794b(0x102)]=_0x5765c7[_0x94794b(0xec)]),_0x5765c7[_0x94794b(0x118)]&&(_0xa9cb41['trino_pool']=_0x5765c7['prestoPoolName']));const _0x4ceb3=_0x5765c7['attributes']&&_0x5765c7[_0x94794b(0x103)]['length']>0x0?groupAttributesBySource(_0x5765c7[_0x94794b(0x103)]):undefined,_0x5565a3=_0x5765c7[_0x94794b(0x13e)]&&_0x5765c7[_0x94794b(0x13e)]['length']>0x0?_0x5765c7['behaviors'][_0x94794b(0x110)](convertApiBehaviorToYaml):undefined;let _0x1ce73f;_0x5765c7[_0x94794b(0xf8)]&&(_0x1ce73f={'name':_0x5765c7[_0x94794b(0xf8)]['name'],'source':{'database':_0x5765c7[_0x94794b(0xf8)][_0x94794b(0xe1)],'table':_0x5765c7[_0x94794b(0xf8)][_0x94794b(0xf5)]},'join':{'parent_key':_0x5765c7[_0x94794b(0xf8)]['foreignKey'],'child_key':_0x5765c7[_0x94794b(0xf8)][_0x94794b(0xee)]}},_0x5765c7[_0x94794b(0xf8)]['customerGroupAttributes']&&_0x5765c7[_0x94794b(0xf8)][_0x94794b(0x139)][_0x94794b(0x120)]>0x0&&(_0x1ce73f[_0x94794b(0x103)]=groupAttributesBySource(_0x5765c7[_0x94794b(0xf8)]['customerGroupAttributes'])),_0x5765c7[_0x94794b(0xf8)][_0x94794b(0x101)]&&_0x5765c7['customerGroup']['customerGroupBehaviors'][_0x94794b(0x120)]>0x0&&(_0x1ce73f[_0x94794b(0x13e)]=_0x5765c7[_0x94794b(0xf8)][_0x94794b(0x101)][_0x94794b(0x110)](convertApiBehaviorToYaml)));const _0x7673e2={'name':_0x5765c7[_0x94794b(0x126)],..._0x5765c7['description']&&{'description':_0x5765c7['description']},'master':_0x2b7382,..._0x339d5c&&{'schedule':_0x339d5c},..._0xa9cb41&&{'engine':_0xa9cb41},..._0x4ceb3&&{'attributes':_0x4ceb3},..._0x5565a3&&{'behaviors':_0x5565a3},..._0x1ce73f&&{'customer_group':_0x1ce73f}};return _0x7673e2;}function groupAttributesBySource(_0x18b168){const _0x192e19=a149_0x5795,_0x48e5e8=new Map();for(const _0x42278e of _0x18b168){const _0x74a967=_0x42278e[_0x192e19(0xe1)]+'.'+_0x42278e['parentTableName']+'.'+_0x42278e[_0x192e19(0xee)]+'.'+_0x42278e['foreignKey'];!_0x48e5e8['has'](_0x74a967)&&_0x48e5e8[_0x192e19(0x107)](_0x74a967,[]),_0x48e5e8[_0x192e19(0xfe)](_0x74a967)['push'](_0x42278e);}const _0x115137=[];for(const [,_0x380580]of _0x48e5e8){const _0x58048b=_0x380580[0x0],_0x4fb71f=_0x58048b[_0x192e19(0x12d)]||_0x58048b[_0x192e19(0xf5)];_0x115137[_0x192e19(0x11c)]({'name':_0x4fb71f,'source':{'database':_0x58048b[_0x192e19(0xe1)],'table':_0x58048b[_0x192e19(0xf5)]},'join':{'parent_key':_0x58048b[_0x192e19(0x13b)],'child_key':_0x58048b[_0x192e19(0xee)]},'columns':_0x380580['map'](_0x566b6d=>{const _0x3d63bd=_0x192e19,_0xf0ddea={'column':_0x566b6d[_0x3d63bd(0x117)],'type':_0x566b6d[_0x3d63bd(0x138)]};return _0x566b6d[_0x3d63bd(0x126)]!==_0x566b6d['parentColumn']&&(_0xf0ddea[_0x3d63bd(0x14a)]=_0x566b6d[_0x3d63bd(0x126)]),_0xf0ddea;})});}return _0x115137;}function convertApiBehaviorToYaml(_0x1f86b6){const _0x5414f1=a149_0x5795,_0x113e35={'name':_0x1f86b6[_0x5414f1(0x126)],'source':{'database':_0x1f86b6[_0x5414f1(0xe1)],'table':_0x1f86b6[_0x5414f1(0xf5)]},'join':{'parent_key':_0x1f86b6[_0x5414f1(0x13b)],'child_key':_0x1f86b6[_0x5414f1(0xee)]}};if(_0x1f86b6[_0x5414f1(0xe5)])_0x113e35[_0x5414f1(0x125)]=!![];else _0x1f86b6[_0x5414f1(0x136)]&&_0x1f86b6[_0x5414f1(0x136)][_0x5414f1(0x120)]>0x0&&(_0x113e35['columns']=_0x1f86b6['schema'][_0x5414f1(0x110)](_0xb0b34a=>{const _0x172231=_0x5414f1,_0x114f91={'column':_0xb0b34a[_0x172231(0x117)],'type':_0xb0b34a[_0x172231(0x138)]};return _0xb0b34a[_0x172231(0x126)]!==_0xb0b34a['parentColumn']&&(_0x114f91[_0x172231(0x14a)]=_0xb0b34a[_0x172231(0x126)]),_0x114f91;}));return _0x1f86b6[_0x5414f1(0x133)]&&(_0x113e35[_0x5414f1(0x128)]=_0x1f86b6[_0x5414f1(0x133)]),_0x1f86b6[_0x5414f1(0x115)]&&(_0x113e35['realtime']=_0x1f86b6[_0x5414f1(0x115)]),_0x113e35;}export function defToApi(_0xb3b20){const _0x66f03c=a149_0x5795,_0x3fc2a6={'name':_0xb3b20[_0x66f03c(0x126)],'master':{'parentDatabaseName':_0xb3b20[_0x66f03c(0x145)][_0x66f03c(0xe3)],'parentTableName':_0xb3b20['master'][_0x66f03c(0x121)]}};_0xb3b20[_0x66f03c(0xf3)]&&(_0x3fc2a6[_0x66f03c(0xf3)]=_0xb3b20[_0x66f03c(0xf3)]);_0xb3b20[_0x66f03c(0x145)][_0x66f03c(0x12f)]&&_0xb3b20['master'][_0x66f03c(0x12f)][_0x66f03c(0x120)]>0x0&&(_0x3fc2a6[_0x66f03c(0x131)]=_0xb3b20[_0x66f03c(0x145)][_0x66f03c(0x12f)][_0x66f03c(0x110)](_0xf4f4f3=>({'columnName':_0xf4f4f3['column'],'rightValues':_0xf4f4f3[_0x66f03c(0x129)]})));_0xb3b20[_0x66f03c(0x130)]&&(_0x3fc2a6[_0x66f03c(0x124)]=_0xb3b20['schedule']['type'],_0xb3b20['schedule']['time']&&(_0x3fc2a6['scheduleOption']=_0xb3b20[_0x66f03c(0x130)][_0x66f03c(0x134)]),_0xb3b20['schedule'][_0x66f03c(0x12b)]&&(_0x3fc2a6[_0x66f03c(0x12b)]=_0xb3b20['schedule'][_0x66f03c(0x12b)]));_0xb3b20[_0x66f03c(0x106)]&&(_0xb3b20[_0x66f03c(0x106)][_0x66f03c(0x10a)]!==undefined&&(_0x3fc2a6[_0x66f03c(0x11f)]=_0xb3b20[_0x66f03c(0x106)][_0x66f03c(0x10a)]),_0xb3b20[_0x66f03c(0x106)][_0x66f03c(0x102)]!==undefined&&(_0x3fc2a6[_0x66f03c(0xec)]=_0xb3b20[_0x66f03c(0x106)][_0x66f03c(0x102)]),_0xb3b20['engine'][_0x66f03c(0xe2)]!==undefined&&(_0x3fc2a6[_0x66f03c(0x118)]=_0xb3b20[_0x66f03c(0x106)][_0x66f03c(0xe2)]));_0xb3b20['attributes']&&_0xb3b20[_0x66f03c(0x103)][_0x66f03c(0x120)]>0x0&&(_0x3fc2a6[_0x66f03c(0x103)]=flattenAttributeGroups(_0xb3b20[_0x66f03c(0x103)]));_0xb3b20[_0x66f03c(0x13e)]&&_0xb3b20[_0x66f03c(0x13e)]['length']>0x0&&(_0x3fc2a6[_0x66f03c(0x13e)]=_0xb3b20['behaviors']['map'](convertDefBehaviorToApi));if(_0xb3b20[_0x66f03c(0xf6)]){const _0x40756d=_0xb3b20[_0x66f03c(0xf6)];_0x3fc2a6[_0x66f03c(0xf8)]={'name':_0x40756d[_0x66f03c(0x126)],'parentDatabaseName':_0x40756d[_0x66f03c(0x13c)][_0x66f03c(0xe3)],'parentTableName':_0x40756d[_0x66f03c(0x13c)][_0x66f03c(0x121)],'parentKey':_0x40756d['join'][_0x66f03c(0xfb)],'foreignKey':_0x40756d[_0x66f03c(0x111)][_0x66f03c(0xf4)]},_0x40756d[_0x66f03c(0x103)]&&_0x40756d[_0x66f03c(0x103)]['length']>0x0&&(_0x3fc2a6[_0x66f03c(0xf8)][_0x66f03c(0x139)]=flattenAttributeGroups(_0x40756d[_0x66f03c(0x103)])[_0x66f03c(0x110)](_0x168096=>({'name':_0x168096[_0x66f03c(0x126)],'type':_0x168096[_0x66f03c(0x138)],'parentDatabaseName':_0x168096[_0x66f03c(0xe1)],'parentTableName':_0x168096[_0x66f03c(0xf5)],'parentColumn':_0x168096[_0x66f03c(0x117)],'parentKey':_0x168096['parentKey'],'foreignKey':_0x168096[_0x66f03c(0x13b)]}))),_0x40756d[_0x66f03c(0x13e)]&&_0x40756d[_0x66f03c(0x13e)]['length']>0x0&&(_0x3fc2a6[_0x66f03c(0xf8)][_0x66f03c(0x101)]=_0x40756d['behaviors']['map'](_0x246aaf=>({'name':_0x246aaf[_0x66f03c(0x126)],'parentDatabaseName':_0x246aaf[_0x66f03c(0x13c)][_0x66f03c(0xe3)],'parentTableName':_0x246aaf['source']['table'],'parentKey':_0x246aaf[_0x66f03c(0x111)][_0x66f03c(0xfb)],'foreignKey':_0x246aaf['join']['parent_key'],'allColumns':_0x246aaf[_0x66f03c(0x125)],'schema':_0x246aaf[_0x66f03c(0x13d)]?.[_0x66f03c(0x110)](_0x41149e=>({'name':_0x41149e[_0x66f03c(0x14a)]||_0x41149e[_0x66f03c(0xde)],'type':_0x41149e[_0x66f03c(0x138)],'parentColumn':_0x41149e[_0x66f03c(0xde)]}))})));}return _0x3fc2a6;}function flattenAttributeGroups(_0xa8f0dc){const _0x1ed61c=a149_0x5795,_0x379dab=[];for(const _0x479970 of _0xa8f0dc){for(const _0x61a705 of _0x479970[_0x1ed61c(0x13d)]){_0x379dab['push']({'name':_0x61a705[_0x1ed61c(0x14a)]||_0x61a705[_0x1ed61c(0xde)],'type':_0x61a705[_0x1ed61c(0x138)],'parentDatabaseName':_0x479970[_0x1ed61c(0x13c)][_0x1ed61c(0xe3)],'parentTableName':_0x479970[_0x1ed61c(0x13c)][_0x1ed61c(0x121)],'parentColumn':_0x61a705[_0x1ed61c(0xde)],'parentKey':_0x479970['join'][_0x1ed61c(0xfb)],'foreignKey':_0x479970[_0x1ed61c(0x111)][_0x1ed61c(0xf4)],'groupingName':_0x479970[_0x1ed61c(0x126)]});}}return _0x379dab;}function convertDefBehaviorToApi(_0x2500e6){const _0x498f7e=a149_0x5795,_0xd56b29={'name':_0x2500e6[_0x498f7e(0x126)],'parentDatabaseName':_0x2500e6[_0x498f7e(0x13c)][_0x498f7e(0xe3)],'parentTableName':_0x2500e6[_0x498f7e(0x13c)][_0x498f7e(0x121)],'parentKey':_0x2500e6['join'][_0x498f7e(0xfb)],'foreignKey':_0x2500e6[_0x498f7e(0x111)]['parent_key']};if(_0x2500e6[_0x498f7e(0x125)])_0xd56b29[_0x498f7e(0xe5)]=!![];else _0x2500e6['columns']&&_0x2500e6[_0x498f7e(0x13d)][_0x498f7e(0x120)]>0x0&&(_0xd56b29[_0x498f7e(0x136)]=_0x2500e6[_0x498f7e(0x13d)][_0x498f7e(0x110)](_0xbbe237=>({'name':_0xbbe237[_0x498f7e(0x14a)]||_0xbbe237[_0x498f7e(0xde)],'type':_0xbbe237[_0x498f7e(0x138)],'parentColumn':_0xbbe237['column']})));return _0x2500e6['default_time_filter']!==undefined&&(_0xd56b29[_0x498f7e(0x133)]=_0x2500e6['default_time_filter']),_0x2500e6[_0x498f7e(0xe0)]!==undefined&&(_0xd56b29[_0x498f7e(0x115)]=_0x2500e6['realtime']),_0xd56b29;}export function serializeDef(_0x46882b){const _0x35e3d8=a149_0x5795,_0x4d20a5=JSON[_0x35e3d8(0x10c)](JSON[_0x35e3d8(0xf1)](_0x46882b)),_0x58afed=a149_0x25deda[_0x35e3d8(0xf1)](_0x4d20a5,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x35e3d8(0x105)}),_0x3454e7=['master:','schedule:',_0x35e3d8(0x113),_0x35e3d8(0xea),'behaviors:',_0x35e3d8(0x143),_0x35e3d8(0xe9),_0x35e3d8(0xed)];let _0x44dc77=_0x58afed;for(const _0x271413 of _0x3454e7){_0x44dc77=_0x44dc77[_0x35e3d8(0x11a)](new RegExp('^('+_0x271413+')','m'),(_0x5aba26,_0x30da18,_0x507d0e)=>{if(_0x507d0e===0x0||_0x44dc77[_0x507d0e-0x1]==='\x0a'&&_0x44dc77[_0x507d0e-0x2]==='\x0a')return _0x30da18;return'\x0a'+_0x30da18;});}return _0x44dc77;}export function parseDef(_0x440293){const _0x353343=a149_0x5795,_0x186ccd=a149_0x25deda[_0x353343(0x10c)](_0x440293);if(!_0x186ccd[_0x353343(0x126)])throw new Error(_0x353343(0xeb));if(!_0x186ccd['master'])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master');if(!_0x186ccd['master'][_0x353343(0xe3)])throw new Error(_0x353343(0x10f));if(!_0x186ccd[_0x353343(0x145)][_0x353343(0x121)])throw new Error(_0x353343(0x11b));return _0x186ccd['realtime']&&validateRealtimeSection(_0x186ccd[_0x353343(0xe0)]),_0x186ccd[_0x353343(0xfa)]&&validatePersonalizationServices(_0x186ccd[_0x353343(0xfa)]),_0x186ccd;}function validateRealtimeSection(_0x444469){const _0x37a3fb=a149_0x5795,_0x24b719=['single',_0x37a3fb(0xe7),_0x37a3fb(0x107),_0x37a3fb(0x119),_0x37a3fb(0xe6),'imported_batch'];_0x444469[_0x37a3fb(0x10e)]&&Array[_0x37a3fb(0x122)](_0x444469[_0x37a3fb(0x10e)])&&_0x444469[_0x37a3fb(0x10e)][_0x37a3fb(0x12e)]((_0x364209,_0x50d694)=>{const _0x55285f=_0x37a3fb;if(!_0x364209[_0x55285f(0x126)])throw new Error('realtime.events['+_0x50d694+_0x55285f(0x10b));});_0x444469[_0x37a3fb(0x103)]&&Array[_0x37a3fb(0x122)](_0x444469[_0x37a3fb(0x103)])&&_0x444469[_0x37a3fb(0x103)]['forEach']((_0x5f0982,_0xe96eae)=>{const _0x2e146c=_0x37a3fb;if(!_0x5f0982['name'])throw new Error(_0x2e146c(0x146)+_0xe96eae+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x5f0982[_0x2e146c(0x138)]&&!_0x24b719[_0x2e146c(0x147)](_0x5f0982[_0x2e146c(0x138)]))throw new Error(_0x2e146c(0x146)+_0xe96eae+_0x2e146c(0x142)+_0x5f0982[_0x2e146c(0x126)]+'):\x20Invalid\x20type\x20\x27'+_0x5f0982[_0x2e146c(0x138)]+_0x2e146c(0x100)+_0x24b719[_0x2e146c(0x111)](',\x20'));});if(_0x444469['id_stitching']){if(!_0x444469[_0x37a3fb(0x148)][_0x37a3fb(0xdf)])throw new Error(_0x37a3fb(0xe8));}}function a149_0x35bf(){const _0x3a4d08=['split','parentColumn','prestoPoolName','ordered_set','replace','YAML\x20config\x20missing\x20required\x20field:\x20master.table','push','48IIvKft','string','workflowHiveOnly','length','table','isArray','3270105fTYUkL','scheduleType','all_columns','name','floor','default_time_filter','values','none','timezone','padStart','groupingName','forEach','filters','schedule','audienceFilters',':00:00','defaultTimeFilterEnabled','time','470irnyVD','schema','personalization_services[','type','customerGroupAttributes','test','foreignKey','source','columns','behaviors','match','70774QltWSh','daily',']\x20(','customer_group:','Example\x20Attributes','master','realtime.attributes[','includes','id_stitching','76639efdbWy','label','10jzEwMg','column','primary_key','realtime','parentDatabaseName','trino_pool','database','Parent\x20segment\x20description','allColumns','list','counter','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','realtime:','attributes:','YAML\x20config\x20missing\x20required\x20field:\x20name','hivePoolName','personalization_services:','parentKey','column_name','attribute_table','stringify','409020saSgrf','description','parent_key','parentTableName','customer_group','rightValues','customerGroup','personalization_services\x20must\x20be\x20an\x20array','personalization_services','child_key','7enzGZi','scheduleOption','get',':00','\x27.\x20Must\x20be\x20one\x20of:\x20','customerGroupBehaviors','hive_pool','attributes','columnName','null','engine','set','524838priowk','customer_id','hive_only',']:\x20Missing\x20required\x20field\x20\x27name\x27','parse','2037456EUwNte','events','YAML\x20config\x20missing\x20required\x20field:\x20master.database','map','join','65340oEscoG','engine:','events_table','isRealtime'];a149_0x35bf=function(){return _0x3a4d08;};return a149_0x35bf();}function validatePersonalizationServices(_0x2d3bab){const _0x45b587=a149_0x5795;if(!Array[_0x45b587(0x122)](_0x2d3bab))throw new Error(_0x45b587(0xf9));_0x2d3bab[_0x45b587(0x12e)]((_0x1f0d9e,_0x41516a)=>{const _0x3121bd=_0x45b587;if(!_0x1f0d9e['name'])throw new Error(_0x3121bd(0x137)+_0x41516a+_0x3121bd(0x10b));});}export function generateTemplate(_0x54170f,_0x36cb9c,_0x1283b8){const _0x5c8d77=a149_0x5795,_0x3a1456={'name':_0x54170f,'description':_0x5c8d77(0xe4),'master':{'database':_0x36cb9c,'table':_0x1283b8},'schedule':{'type':_0x5c8d77(0x141),'time':'03:00','timezone':'UTC'},'attributes':[{'name':_0x5c8d77(0x144),'source':{'database':_0x36cb9c,'table':_0x5c8d77(0xf0)},'join':{'parent_key':'id','child_key':_0x5c8d77(0x109)},'columns':[{'column':_0x5c8d77(0xef),'label':'Display\x20Name','type':_0x5c8d77(0x11e)}]}],'behaviors':[{'name':'Example\x20Events','source':{'database':_0x36cb9c,'table':_0x5c8d77(0x114)},'join':{'parent_key':'user_id','child_key':'customer_id'},'all_columns':!![]}]};return serializeDef(_0x3a1456);}
|
|
1
|
+
(function(_0x1fbc85,_0x1e0f9c){const _0x4a671f=a149_0x1aa4,_0x299c17=_0x1fbc85();while(!![]){try{const _0xf3f443=-parseInt(_0x4a671f(0x226))/0x1+parseInt(_0x4a671f(0x25e))/0x2*(parseInt(_0x4a671f(0x24f))/0x3)+-parseInt(_0x4a671f(0x221))/0x4*(-parseInt(_0x4a671f(0x1ff))/0x5)+parseInt(_0x4a671f(0x1f0))/0x6*(-parseInt(_0x4a671f(0x259))/0x7)+parseInt(_0x4a671f(0x206))/0x8*(-parseInt(_0x4a671f(0x20f))/0x9)+-parseInt(_0x4a671f(0x234))/0xa*(parseInt(_0x4a671f(0x20a))/0xb)+parseInt(_0x4a671f(0x233))/0xc;if(_0xf3f443===_0x1e0f9c)break;else _0x299c17['push'](_0x299c17['shift']());}catch(_0x45bde9){_0x299c17['push'](_0x299c17['shift']());}}}(a149_0x44ca,0x57412));import*as a149_0xb8df62 from'yaml';function a149_0x44ca(){const _0x366ec5=['list','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','daily','split','column','includes','set','master','):\x20Invalid\x20type\x20\x27','parentColumn','number','primary_key','counter','2534620vmRvoB','Example\x20Events','parent_key','hive_only','table','573945nLzzoS','customerGroup','behaviors','user_id','length','events_table','map','hivePoolName','description','source','foreignKey','realtime.attributes[','time','10315380ZwbUzf','37490GSEUYP','forEach','workflowHiveOnly','child_key','test','single','YAML\x20config\x20missing\x20required\x20field:\x20master.table','imported_batch','floor','customer_id','label','attribute_table',']:\x20Missing\x20required\x20field\x20\x27name\x27','allColumns','scheduleOption','UTC','rightValues','stringify','parentTableName','all_columns','join','customer_group','scheduleType','personalization_services\x20must\x20be\x20an\x20array','id_stitching','attributes','schedule','5133CNiaIm','database','audienceFilters','trino_pool','attributes:','name','padStart','column_name','ordered_set','Example\x20Attributes','14tlSyEr','events','realtime:','filters','push','86PDioXK','Parent\x20segment\x20description','match','null','parentDatabaseName','default_time_filter','467616wAOThz',':00:00','values','parentKey','type',']\x20(','schema','replace','columns','realtime','parse','columnName','personalization_services','behaviors:','timezone','5VTqOqa','engine','\x27.\x20Must\x20be\x20one\x20of:\x20','customerGroupAttributes','hive_pool','customerGroupBehaviors','prestoPoolName','112PRDFOM','isRealtime','schedule:','defaultTimeFilterEnabled','902MQXORJ','string','get','master:','Display\x20Name','110709PnzgTT','groupingName',':00','isArray','has'];a149_0x44ca=function(){return _0x366ec5;};return a149_0x44ca();}function formatScheduleTime(_0x38247b){const _0x4010fc=a149_0x1aa4;if(typeof _0x38247b===_0x4010fc(0x21e)){const _0x2a61bd=Math[_0x4010fc(0x23c)](_0x38247b);return String(_0x2a61bd)[_0x4010fc(0x255)](0x2,'0')+_0x4010fc(0x1f1);}if(typeof _0x38247b===_0x4010fc(0x20b)){if(/^\d{2}:\d{2}:\d{2}$/[_0x4010fc(0x238)](_0x38247b))return _0x38247b;if(/^\d{1,2}:\d{2}$/[_0x4010fc(0x238)](_0x38247b)){const [_0x1da38e,_0x2c6f9b]=_0x38247b[_0x4010fc(0x217)](':');return _0x1da38e['padStart'](0x2,'0')+':'+_0x2c6f9b+_0x4010fc(0x211);}const _0x4f962b=parseInt(_0x38247b,0xa);if(!isNaN(_0x4f962b)&&_0x38247b[_0x4010fc(0x260)](/^\d+$/))return String(_0x4f962b)[_0x4010fc(0x255)](0x2,'0')+_0x4010fc(0x1f1);return _0x38247b;}return String(_0x38247b);}export function apiToDef(_0x5be345){const _0x57e3cd=a149_0x1aa4,_0x1338f1={'database':_0x5be345[_0x57e3cd(0x21b)]?.[_0x57e3cd(0x1ee)]||'','table':_0x5be345['master']?.[_0x57e3cd(0x246)]||''};_0x5be345[_0x57e3cd(0x251)]&&_0x5be345[_0x57e3cd(0x251)]['length']>0x0&&(_0x1338f1['filters']=_0x5be345[_0x57e3cd(0x251)][_0x57e3cd(0x22c)](_0x36dc05=>({'column':_0x36dc05[_0x57e3cd(0x1fb)],'values':_0x36dc05[_0x57e3cd(0x244)]})));let _0x32527b;_0x5be345[_0x57e3cd(0x24a)]&&_0x5be345['scheduleType']!=='none'&&(_0x32527b={'type':_0x5be345['scheduleType']},_0x5be345[_0x57e3cd(0x242)]&&(_0x32527b[_0x57e3cd(0x232)]=formatScheduleTime(_0x5be345[_0x57e3cd(0x242)])),_0x5be345[_0x57e3cd(0x1fe)]&&(_0x32527b['timezone']=_0x5be345[_0x57e3cd(0x1fe)]));let _0x5acf8c;(_0x5be345[_0x57e3cd(0x236)]||_0x5be345[_0x57e3cd(0x22d)]||_0x5be345['prestoPoolName'])&&(_0x5acf8c={},_0x5be345[_0x57e3cd(0x236)]&&(_0x5acf8c[_0x57e3cd(0x224)]=_0x5be345[_0x57e3cd(0x236)]),_0x5be345[_0x57e3cd(0x22d)]&&(_0x5acf8c[_0x57e3cd(0x203)]=_0x5be345[_0x57e3cd(0x22d)]),_0x5be345['prestoPoolName']&&(_0x5acf8c[_0x57e3cd(0x252)]=_0x5be345[_0x57e3cd(0x205)]));const _0x277333=_0x5be345['attributes']&&_0x5be345[_0x57e3cd(0x24d)]['length']>0x0?groupAttributesBySource(_0x5be345[_0x57e3cd(0x24d)]):undefined,_0x55e6da=_0x5be345['behaviors']&&_0x5be345[_0x57e3cd(0x228)][_0x57e3cd(0x22a)]>0x0?_0x5be345[_0x57e3cd(0x228)][_0x57e3cd(0x22c)](convertApiBehaviorToYaml):undefined;let _0x10f394;_0x5be345['customerGroup']&&(_0x10f394={'name':_0x5be345[_0x57e3cd(0x227)][_0x57e3cd(0x254)],'source':{'database':_0x5be345[_0x57e3cd(0x227)]['parentDatabaseName'],'table':_0x5be345[_0x57e3cd(0x227)]['parentTableName']},'join':{'parent_key':_0x5be345[_0x57e3cd(0x227)][_0x57e3cd(0x230)],'child_key':_0x5be345['customerGroup'][_0x57e3cd(0x1f3)]}},_0x5be345['customerGroup']['customerGroupAttributes']&&_0x5be345['customerGroup'][_0x57e3cd(0x202)][_0x57e3cd(0x22a)]>0x0&&(_0x10f394[_0x57e3cd(0x24d)]=groupAttributesBySource(_0x5be345['customerGroup'][_0x57e3cd(0x202)])),_0x5be345[_0x57e3cd(0x227)][_0x57e3cd(0x204)]&&_0x5be345[_0x57e3cd(0x227)][_0x57e3cd(0x204)]['length']>0x0&&(_0x10f394[_0x57e3cd(0x228)]=_0x5be345[_0x57e3cd(0x227)][_0x57e3cd(0x204)][_0x57e3cd(0x22c)](convertApiBehaviorToYaml)));const _0x150b2a={'name':_0x5be345[_0x57e3cd(0x254)],..._0x5be345[_0x57e3cd(0x22e)]&&{'description':_0x5be345['description']},'master':_0x1338f1,..._0x32527b&&{'schedule':_0x32527b},..._0x5acf8c&&{'engine':_0x5acf8c},..._0x277333&&{'attributes':_0x277333},..._0x55e6da&&{'behaviors':_0x55e6da},..._0x10f394&&{'customer_group':_0x10f394}};return _0x150b2a;}function groupAttributesBySource(_0x281d92){const _0xfcfdc2=a149_0x1aa4,_0xb5abe5=new Map();for(const _0x1d359b of _0x281d92){const _0x1c282b=_0x1d359b[_0xfcfdc2(0x1ee)]+'.'+_0x1d359b[_0xfcfdc2(0x246)]+'.'+_0x1d359b[_0xfcfdc2(0x1f3)]+'.'+_0x1d359b[_0xfcfdc2(0x230)];!_0xb5abe5[_0xfcfdc2(0x213)](_0x1c282b)&&_0xb5abe5[_0xfcfdc2(0x21a)](_0x1c282b,[]),_0xb5abe5[_0xfcfdc2(0x20c)](_0x1c282b)[_0xfcfdc2(0x25d)](_0x1d359b);}const _0x490f70=[];for(const [,_0x3f6595]of _0xb5abe5){const _0x5546e4=_0x3f6595[0x0],_0x16d3dc=_0x5546e4[_0xfcfdc2(0x210)]||_0x5546e4[_0xfcfdc2(0x246)];_0x490f70[_0xfcfdc2(0x25d)]({'name':_0x16d3dc,'source':{'database':_0x5546e4[_0xfcfdc2(0x1ee)],'table':_0x5546e4[_0xfcfdc2(0x246)]},'join':{'parent_key':_0x5546e4[_0xfcfdc2(0x230)],'child_key':_0x5546e4['parentKey']},'columns':_0x3f6595[_0xfcfdc2(0x22c)](_0x44a414=>{const _0x125642=_0xfcfdc2,_0xc15095={'column':_0x44a414['parentColumn'],'type':_0x44a414[_0x125642(0x1f4)]};return _0x44a414[_0x125642(0x254)]!==_0x44a414[_0x125642(0x21d)]&&(_0xc15095[_0x125642(0x23e)]=_0x44a414[_0x125642(0x254)]),_0xc15095;})});}return _0x490f70;}function convertApiBehaviorToYaml(_0x241408){const _0x155ba8=a149_0x1aa4,_0x1ef255={'name':_0x241408[_0x155ba8(0x254)],'source':{'database':_0x241408['parentDatabaseName'],'table':_0x241408['parentTableName']},'join':{'parent_key':_0x241408[_0x155ba8(0x230)],'child_key':_0x241408[_0x155ba8(0x1f3)]}};if(_0x241408[_0x155ba8(0x241)])_0x1ef255[_0x155ba8(0x247)]=!![];else _0x241408['schema']&&_0x241408['schema'][_0x155ba8(0x22a)]>0x0&&(_0x1ef255['columns']=_0x241408[_0x155ba8(0x1f6)][_0x155ba8(0x22c)](_0x327dd5=>{const _0x1949e2=_0x155ba8,_0x5084ee={'column':_0x327dd5[_0x1949e2(0x21d)],'type':_0x327dd5[_0x1949e2(0x1f4)]};return _0x327dd5[_0x1949e2(0x254)]!==_0x327dd5[_0x1949e2(0x21d)]&&(_0x5084ee[_0x1949e2(0x23e)]=_0x327dd5['name']),_0x5084ee;}));return _0x241408[_0x155ba8(0x209)]&&(_0x1ef255['default_time_filter']=_0x241408[_0x155ba8(0x209)]),_0x241408['isRealtime']&&(_0x1ef255[_0x155ba8(0x1f9)]=_0x241408[_0x155ba8(0x207)]),_0x1ef255;}export function defToApi(_0x27acc0){const _0xf49918=a149_0x1aa4,_0x2bf3e6={'name':_0x27acc0['name'],'master':{'parentDatabaseName':_0x27acc0[_0xf49918(0x21b)]['database'],'parentTableName':_0x27acc0[_0xf49918(0x21b)][_0xf49918(0x225)]}};_0x27acc0[_0xf49918(0x22e)]&&(_0x2bf3e6['description']=_0x27acc0[_0xf49918(0x22e)]);_0x27acc0[_0xf49918(0x21b)]['filters']&&_0x27acc0[_0xf49918(0x21b)][_0xf49918(0x25c)][_0xf49918(0x22a)]>0x0&&(_0x2bf3e6['audienceFilters']=_0x27acc0[_0xf49918(0x21b)][_0xf49918(0x25c)][_0xf49918(0x22c)](_0x209ede=>({'columnName':_0x209ede[_0xf49918(0x218)],'rightValues':_0x209ede[_0xf49918(0x1f2)]})));_0x27acc0[_0xf49918(0x24e)]&&(_0x2bf3e6[_0xf49918(0x24a)]=_0x27acc0[_0xf49918(0x24e)][_0xf49918(0x1f4)],_0x27acc0[_0xf49918(0x24e)]['time']&&(_0x2bf3e6[_0xf49918(0x242)]=_0x27acc0['schedule']['time']),_0x27acc0[_0xf49918(0x24e)]['timezone']&&(_0x2bf3e6[_0xf49918(0x1fe)]=_0x27acc0['schedule']['timezone']));_0x27acc0[_0xf49918(0x200)]&&(_0x27acc0['engine']['hive_only']!==undefined&&(_0x2bf3e6[_0xf49918(0x236)]=_0x27acc0[_0xf49918(0x200)][_0xf49918(0x224)]),_0x27acc0[_0xf49918(0x200)][_0xf49918(0x203)]!==undefined&&(_0x2bf3e6[_0xf49918(0x22d)]=_0x27acc0['engine'][_0xf49918(0x203)]),_0x27acc0['engine'][_0xf49918(0x252)]!==undefined&&(_0x2bf3e6[_0xf49918(0x205)]=_0x27acc0[_0xf49918(0x200)][_0xf49918(0x252)]));_0x27acc0[_0xf49918(0x24d)]&&_0x27acc0[_0xf49918(0x24d)][_0xf49918(0x22a)]>0x0&&(_0x2bf3e6[_0xf49918(0x24d)]=flattenAttributeGroups(_0x27acc0['attributes']));_0x27acc0[_0xf49918(0x228)]&&_0x27acc0[_0xf49918(0x228)][_0xf49918(0x22a)]>0x0&&(_0x2bf3e6[_0xf49918(0x228)]=_0x27acc0[_0xf49918(0x228)]['map'](convertDefBehaviorToApi));if(_0x27acc0[_0xf49918(0x249)]){const _0x5bcb3f=_0x27acc0['customer_group'];_0x2bf3e6[_0xf49918(0x227)]={'name':_0x5bcb3f[_0xf49918(0x254)],'parentDatabaseName':_0x5bcb3f[_0xf49918(0x22f)]['database'],'parentTableName':_0x5bcb3f[_0xf49918(0x22f)][_0xf49918(0x225)],'parentKey':_0x5bcb3f['join'][_0xf49918(0x237)],'foreignKey':_0x5bcb3f[_0xf49918(0x248)]['parent_key']},_0x5bcb3f['attributes']&&_0x5bcb3f[_0xf49918(0x24d)][_0xf49918(0x22a)]>0x0&&(_0x2bf3e6['customerGroup'][_0xf49918(0x202)]=flattenAttributeGroups(_0x5bcb3f[_0xf49918(0x24d)])[_0xf49918(0x22c)](_0x1b79ad=>({'name':_0x1b79ad[_0xf49918(0x254)],'type':_0x1b79ad[_0xf49918(0x1f4)],'parentDatabaseName':_0x1b79ad[_0xf49918(0x1ee)],'parentTableName':_0x1b79ad['parentTableName'],'parentColumn':_0x1b79ad[_0xf49918(0x21d)],'parentKey':_0x1b79ad[_0xf49918(0x1f3)],'foreignKey':_0x1b79ad[_0xf49918(0x230)]}))),_0x5bcb3f['behaviors']&&_0x5bcb3f[_0xf49918(0x228)]['length']>0x0&&(_0x2bf3e6[_0xf49918(0x227)][_0xf49918(0x204)]=_0x5bcb3f['behaviors'][_0xf49918(0x22c)](_0x163655=>({'name':_0x163655[_0xf49918(0x254)],'parentDatabaseName':_0x163655[_0xf49918(0x22f)][_0xf49918(0x250)],'parentTableName':_0x163655[_0xf49918(0x22f)][_0xf49918(0x225)],'parentKey':_0x163655[_0xf49918(0x248)]['child_key'],'foreignKey':_0x163655['join']['parent_key'],'allColumns':_0x163655['all_columns'],'schema':_0x163655['columns']?.[_0xf49918(0x22c)](_0x27019e=>({'name':_0x27019e[_0xf49918(0x23e)]||_0x27019e[_0xf49918(0x218)],'type':_0x27019e[_0xf49918(0x1f4)],'parentColumn':_0x27019e[_0xf49918(0x218)]}))})));}return _0x2bf3e6;}function flattenAttributeGroups(_0x54ba36){const _0x41e1bf=a149_0x1aa4,_0x27ff4c=[];for(const _0x3a2af7 of _0x54ba36){for(const _0x3326b6 of _0x3a2af7[_0x41e1bf(0x1f8)]){_0x27ff4c[_0x41e1bf(0x25d)]({'name':_0x3326b6[_0x41e1bf(0x23e)]||_0x3326b6[_0x41e1bf(0x218)],'type':_0x3326b6[_0x41e1bf(0x1f4)],'parentDatabaseName':_0x3a2af7[_0x41e1bf(0x22f)][_0x41e1bf(0x250)],'parentTableName':_0x3a2af7['source'][_0x41e1bf(0x225)],'parentColumn':_0x3326b6[_0x41e1bf(0x218)],'parentKey':_0x3a2af7['join'][_0x41e1bf(0x237)],'foreignKey':_0x3a2af7[_0x41e1bf(0x248)][_0x41e1bf(0x223)],'groupingName':_0x3a2af7[_0x41e1bf(0x254)]});}}return _0x27ff4c;}function convertDefBehaviorToApi(_0x2deb4c){const _0x40f426=a149_0x1aa4,_0x35da4e={'name':_0x2deb4c[_0x40f426(0x254)],'parentDatabaseName':_0x2deb4c[_0x40f426(0x22f)][_0x40f426(0x250)],'parentTableName':_0x2deb4c[_0x40f426(0x22f)]['table'],'parentKey':_0x2deb4c[_0x40f426(0x248)][_0x40f426(0x237)],'foreignKey':_0x2deb4c[_0x40f426(0x248)][_0x40f426(0x223)]};if(_0x2deb4c[_0x40f426(0x247)])_0x35da4e['allColumns']=!![];else _0x2deb4c[_0x40f426(0x1f8)]&&_0x2deb4c['columns']['length']>0x0&&(_0x35da4e[_0x40f426(0x1f6)]=_0x2deb4c[_0x40f426(0x1f8)][_0x40f426(0x22c)](_0x222770=>({'name':_0x222770[_0x40f426(0x23e)]||_0x222770[_0x40f426(0x218)],'type':_0x222770['type'],'parentColumn':_0x222770['column']})));return _0x2deb4c['default_time_filter']!==undefined&&(_0x35da4e[_0x40f426(0x209)]=_0x2deb4c[_0x40f426(0x1ef)]),_0x2deb4c[_0x40f426(0x1f9)]!==undefined&&(_0x35da4e[_0x40f426(0x207)]=_0x2deb4c[_0x40f426(0x1f9)]),_0x35da4e;}export function serializeDef(_0x25373e){const _0x5ce2b6=a149_0x1aa4,_0x4914d6=JSON[_0x5ce2b6(0x1fa)](JSON[_0x5ce2b6(0x245)](_0x25373e)),_0x4e9cb2=a149_0xb8df62[_0x5ce2b6(0x245)](_0x4914d6,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x5ce2b6(0x1ed)}),_0x5e720a=[_0x5ce2b6(0x20d),_0x5ce2b6(0x208),'engine:',_0x5ce2b6(0x253),_0x5ce2b6(0x1fd),'customer_group:',_0x5ce2b6(0x25b),'personalization_services:'];let _0x2e221b=_0x4e9cb2;for(const _0xffe755 of _0x5e720a){_0x2e221b=_0x2e221b[_0x5ce2b6(0x1f7)](new RegExp('^('+_0xffe755+')','m'),(_0x993d2d,_0x1f872d,_0x1254ea)=>{if(_0x1254ea===0x0||_0x2e221b[_0x1254ea-0x1]==='\x0a'&&_0x2e221b[_0x1254ea-0x2]==='\x0a')return _0x1f872d;return'\x0a'+_0x1f872d;});}return _0x2e221b;}export function parseDef(_0x52cabc){const _0x58b1dc=a149_0x1aa4,_0x25bc9a=a149_0xb8df62['parse'](_0x52cabc);if(!_0x25bc9a[_0x58b1dc(0x254)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x25bc9a['master'])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master');if(!_0x25bc9a[_0x58b1dc(0x21b)][_0x58b1dc(0x250)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x25bc9a[_0x58b1dc(0x21b)][_0x58b1dc(0x225)])throw new Error(_0x58b1dc(0x23a));return _0x25bc9a[_0x58b1dc(0x1f9)]&&validateRealtimeSection(_0x25bc9a[_0x58b1dc(0x1f9)]),_0x25bc9a[_0x58b1dc(0x1fc)]&&validatePersonalizationServices(_0x25bc9a[_0x58b1dc(0x1fc)]),_0x25bc9a;}function validateRealtimeSection(_0x4f6bdb){const _0x152d20=a149_0x1aa4,_0x4921ec=[_0x152d20(0x239),_0x152d20(0x220),_0x152d20(0x21a),_0x152d20(0x257),_0x152d20(0x214),_0x152d20(0x23b)];_0x4f6bdb['events']&&Array[_0x152d20(0x212)](_0x4f6bdb[_0x152d20(0x25a)])&&_0x4f6bdb[_0x152d20(0x25a)][_0x152d20(0x235)]((_0x466eb9,_0x1d3609)=>{const _0x1adc98=_0x152d20;if(!_0x466eb9[_0x1adc98(0x254)])throw new Error('realtime.events['+_0x1d3609+_0x1adc98(0x240));});_0x4f6bdb[_0x152d20(0x24d)]&&Array[_0x152d20(0x212)](_0x4f6bdb[_0x152d20(0x24d)])&&_0x4f6bdb[_0x152d20(0x24d)][_0x152d20(0x235)]((_0xb30e8a,_0x1a294b)=>{const _0x2ff094=_0x152d20;if(!_0xb30e8a[_0x2ff094(0x254)])throw new Error('realtime.attributes['+_0x1a294b+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0xb30e8a[_0x2ff094(0x1f4)]&&!_0x4921ec[_0x2ff094(0x219)](_0xb30e8a[_0x2ff094(0x1f4)]))throw new Error(_0x2ff094(0x231)+_0x1a294b+_0x2ff094(0x1f5)+_0xb30e8a[_0x2ff094(0x254)]+_0x2ff094(0x21c)+_0xb30e8a[_0x2ff094(0x1f4)]+_0x2ff094(0x201)+_0x4921ec[_0x2ff094(0x248)](',\x20'));});if(_0x4f6bdb[_0x152d20(0x24c)]){if(!_0x4f6bdb['id_stitching'][_0x152d20(0x21f)])throw new Error(_0x152d20(0x215));}}function validatePersonalizationServices(_0xa8e445){const _0x95e2b7=a149_0x1aa4;if(!Array['isArray'](_0xa8e445))throw new Error(_0x95e2b7(0x24b));_0xa8e445[_0x95e2b7(0x235)]((_0x15b6ef,_0x5c131a)=>{const _0x123eca=_0x95e2b7;if(!_0x15b6ef['name'])throw new Error('personalization_services['+_0x5c131a+_0x123eca(0x240));});}function a149_0x1aa4(_0x2045d3,_0x506043){_0x2045d3=_0x2045d3-0x1ed;const _0x44ca75=a149_0x44ca();let _0x1aa424=_0x44ca75[_0x2045d3];return _0x1aa424;}export function generateTemplate(_0x43aa8a,_0x513881,_0x32958e){const _0x3889f5=a149_0x1aa4,_0x1d463b={'name':_0x43aa8a,'description':_0x3889f5(0x25f),'master':{'database':_0x513881,'table':_0x32958e},'schedule':{'type':_0x3889f5(0x216),'time':'03:00','timezone':_0x3889f5(0x243)},'attributes':[{'name':_0x3889f5(0x258),'source':{'database':_0x513881,'table':_0x3889f5(0x23f)},'join':{'parent_key':'id','child_key':_0x3889f5(0x23d)},'columns':[{'column':_0x3889f5(0x256),'label':_0x3889f5(0x20e),'type':_0x3889f5(0x20b)}]}],'behaviors':[{'name':_0x3889f5(0x222),'source':{'database':_0x513881,'table':_0x3889f5(0x22b)},'join':{'parent_key':_0x3889f5(0x229),'child_key':_0x3889f5(0x23d)},'all_columns':!![]}]};return serializeDef(_0x1d463b);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a150_0x148d(_0x2aecb3,_0x3d3045){_0x2aecb3=_0x2aecb3-0x11a;const _0x348ae7=a150_0x348a();let _0x148d25=_0x348ae7[_0x2aecb3];return _0x148d25;}(function(_0x47d5fd,_0x1a4135){const _0x30c6cd=a150_0x148d,_0x588f56=_0x47d5fd();while(!![]){try{const _0x26176e=-parseInt(_0x30c6cd(0x132))/0x1*(-parseInt(_0x30c6cd(0x15b))/0x2)+parseInt(_0x30c6cd(0x134))/0x3+-parseInt(_0x30c6cd(0x140))/0x4*(-parseInt(_0x30c6cd(0x153))/0x5)+parseInt(_0x30c6cd(0x133))/0x6+-parseInt(_0x30c6cd(0x15a))/0x7+-parseInt(_0x30c6cd(0x126))/0x8+parseInt(_0x30c6cd(0x13c))/0x9;if(_0x26176e===_0x1a4135)break;else _0x588f56['push'](_0x588f56['shift']());}catch(_0x2dc372){_0x588f56['push'](_0x588f56['shift']());}}}(a150_0x348a,0x80489));import a150_0x239e99 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 a150_0x348a(){const _0xacba77=['values','getJourney','Resolving\x20parent\x20segment','join','createdAt','user','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','updatedAt','length','Warning:\x20Journey\x20','kind','rule','toLowerCase','push','7879832pRGdEs','segmentFolderId','isNew','Fetching\x20activations','set','activationParams','getParent','data','attributes','targetResourceName','map','reduce','136451nFvJZK','1057230xxlhcX','449109cFvLxG','folderId','versionNumber','all','listJourneysWithDetailsFromParentSegment','connection','Fetching\x20users\x20and\x20connections','journeyBundleId','5750523YSeMPg','segments/','journeyBundleName','buildIdToEmailMap','8sIcuEP','hasChanges','Processing\x20journey:\x20','relative','listSegments','clear','buildIdToNameMap','get','tdx.json','getActivation','listFolders','segment','getSegment','activation_','.yml','state','slice','from','has','1956655GYQEYr','audienceId','getLatestJourneyId','filter','Fetching\x20parent\x20segment\x20info','size','update','6435408AJfBUs','10ZcoJYB','paused','description','utf-8','journey','name'];a150_0x348a=function(){return _0xacba77;};return a150_0x348a();}import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a150_0x2b189e,normalizeJourneyDef,parseYamlString as a150_0x5a1286}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(_0x1bf106,_0x463224,_0x55232e){const _0x506613=a150_0x148d,_0x3e88a3=a150_0x239e99[_0x506613(0x143)](_0x55232e,_0x1bf106);if(existsSync(_0x1bf106)){const _0x50ed29=readFileSync(_0x1bf106,_0x506613(0x15e)),_0x5ca120=generateDiff(_0x50ed29,_0x463224),_0x3a9429=hasChanges(_0x5ca120);return{'relativePath':_0x3e88a3,'absolutePath':_0x1bf106,'content':_0x463224,'isNew':![],'hasChanges':_0x3a9429,'diff':_0x3a9429?formatDiffWithColors(_0x5ca120):undefined};}return{'relativePath':_0x3e88a3,'absolutePath':_0x1bf106,'content':_0x463224,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x2d7133,_0x50cfe9,_0x1aabb9){const _0x4fd6cd=a150_0x148d,_0x5f4a9f=_0x2d7133+':'+_0x50cfe9,_0x5efe24=_0x1aabb9[_0x4fd6cd(0x147)](_0x5f4a9f)||0x0;_0x1aabb9[_0x4fd6cd(0x12a)](_0x5f4a9f,_0x5efe24+0x1);if(_0x5efe24===0x0)return _0x50cfe9;return _0x50cfe9+'_'+(_0x5efe24+0x1);}export async function pullSegments(_0x49213a,_0x576eac,_0x415736={}){const _0x9171b1=a150_0x148d,{targetDir:_0x5e35ef,progress:_0x3f755}=_0x415736;_0x3f755?.[_0x9171b1(0x159)](_0x9171b1(0x11a));const _0x22661c=await _0x49213a[_0x9171b1(0x14b)]['resolveParentId'](_0x576eac);_0x3f755?.[_0x9171b1(0x159)](_0x9171b1(0x157));const _0x5b5464=await _0x49213a[_0x9171b1(0x14b)][_0x9171b1(0x12c)](_0x22661c),_0x27457=_0x5b5464['attributes'][_0x9171b1(0x160)];_0x3f755?.[_0x9171b1(0x159)]('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x508d57,_0x44b12c,_0x2fd152]=await Promise[_0x9171b1(0x137)]([_0x49213a['segment'][_0x9171b1(0x144)](_0x22661c),_0x49213a[_0x9171b1(0x14b)][_0x9171b1(0x14a)](_0x22661c),_0x49213a[_0x9171b1(0x15f)][_0x9171b1(0x138)](_0x22661c,{'includeAllVersions':!![]})]),{journeys:_0x3249a7,activationStepsById:_0x255938}=_0x2fd152,_0x57f258=new Map();for(const _0x103665 of _0x3249a7){_0x57f258[_0x9171b1(0x12a)](_0x103665['id'],_0x103665);}const _0x56be15=_0x3249a7[_0x9171b1(0x130)](_0x51d169=>({'id':_0x51d169['id'],'name':_0x51d169[_0x9171b1(0x12e)]['name'],'journeyBundleName':_0x51d169[_0x9171b1(0x12e)][_0x9171b1(0x13e)]||'','journeyBundleId':_0x51d169[_0x9171b1(0x12e)][_0x9171b1(0x13b)]||'','versionNumber':_0x51d169[_0x9171b1(0x12e)]['versionNumber'],'description':_0x51d169['attributes']['description'],'state':_0x51d169[_0x9171b1(0x12e)][_0x9171b1(0x14f)],'paused':_0x51d169[_0x9171b1(0x12e)][_0x9171b1(0x15c)],'audienceId':_0x51d169[_0x9171b1(0x12e)][_0x9171b1(0x154)],'folderId':_0x51d169['relationships']?.['parentFolder']?.[_0x9171b1(0x12d)]?.['id'],'createdAt':_0x51d169['attributes'][_0x9171b1(0x11c)],'updatedAt':_0x51d169[_0x9171b1(0x12e)][_0x9171b1(0x11f)]})),_0x318d2c=buildFolderIdToPathMap(_0x44b12c),_0x2cf307=_0x5e35ef||_0x9171b1(0x13d)+sanitizeFileName(_0x27457);_0x3f755?.[_0x9171b1(0x159)](_0x9171b1(0x129));const _0x5b0d26=new Map();await batchAsync(_0x508d57,async _0x246b4b=>{const _0x4f5aac=_0x9171b1,_0xd8588a=await _0x49213a[_0x4f5aac(0x14b)]['listActivations'](_0x22661c,_0x246b4b['id']);_0x5b0d26[_0x4f5aac(0x12a)](_0x246b4b['id'],_0xd8588a);}),_0x3f755?.[_0x9171b1(0x159)](_0x9171b1(0x13a));const [_0x5a9978,_0x62b08]=await Promise[_0x9171b1(0x137)]([_0x49213a[_0x9171b1(0x11d)][_0x9171b1(0x13f)](),_0x49213a[_0x9171b1(0x139)][_0x9171b1(0x146)]()]),_0x52c2ca=[],_0x131172=new Map(),_0x23a929=a150_0x239e99[_0x9171b1(0x11b)](_0x2cf307,_0x9171b1(0x148)),_0x5b6bb9=createTdxConfigContent(_0x27457);_0x52c2ca['push'](prepareFile(_0x23a929,_0x5b6bb9,_0x2cf307));const _0x50bd9c=new Map();for(const _0x2303c7 of _0x508d57){_0x50bd9c['set'](_0x2303c7['id'],_0x2303c7);}let _0x264895=_0x508d57;if(_0x415736[_0x9171b1(0x12f)]){const _0x355b74=_0x508d57[_0x9171b1(0x156)](_0x52d233=>_0x52d233[_0x9171b1(0x160)][_0x9171b1(0x124)]()===_0x415736[_0x9171b1(0x12f)][_0x9171b1(0x124)]());_0x355b74[_0x9171b1(0x120)]>0x0&&(_0x264895=_0x355b74);}_0x3f755?.[_0x9171b1(0x159)]('Processing\x20segments');for(const _0x255edc of _0x264895){if(_0x255edc[_0x9171b1(0x122)]===SEGMENT_KIND_JOURNEY)continue;const _0x41e7ed=_0x255edc[_0x9171b1(0x127)]?_0x318d2c[_0x9171b1(0x147)](_0x255edc[_0x9171b1(0x127)])||'':'',_0x499338=_0x5b0d26[_0x9171b1(0x147)](_0x255edc['id'])||[],_0x348f47=segmentWithActivationsToYaml(_0x255edc,_0x499338,undefined,_0x5a9978,_0x62b08),_0x5e0b3c=_0x41e7ed?a150_0x239e99[_0x9171b1(0x11b)](_0x2cf307,_0x41e7ed):_0x2cf307,_0x9cc394=sanitizeFileName(_0x255edc[_0x9171b1(0x160)]),_0x32f802=getUniqueFileName(_0x5e0b3c,_0x9cc394,_0x131172),_0x4a1b76=a150_0x239e99[_0x9171b1(0x11b)](_0x5e0b3c,_0x32f802+_0x9171b1(0x14e)),_0x19a6cb=segmentToYamlString(_0x348f47);_0x52c2ca[_0x9171b1(0x125)](prepareFile(_0x4a1b76,_0x19a6cb,_0x2cf307));}const _0x370635=new Map();for(const _0xe70123 of _0x56be15){const _0x5481fc=_0xe70123['journeyBundleId'];!_0x370635[_0x9171b1(0x152)](_0x5481fc)&&_0x370635[_0x9171b1(0x12a)](_0x5481fc,[]),_0x370635[_0x9171b1(0x147)](_0x5481fc)[_0x9171b1(0x125)](_0xe70123);}for(const _0x69ce02 of _0x370635[_0x9171b1(0x161)]()){_0x69ce02['sort']((_0x257a5d,_0x3d08b0)=>(_0x257a5d['versionNumber']||0x0)-(_0x3d08b0[_0x9171b1(0x136)]||0x0));}if(_0x415736['targetResourceName']){const _0x1b13c8=new Map();for(const [_0x447495,_0x249f46]of _0x370635){const _0xdcd859=_0x249f46[0x0]['journeyBundleName'];if(_0xdcd859[_0x9171b1(0x124)]()===_0x415736['targetResourceName'][_0x9171b1(0x124)]()){_0x1b13c8[_0x9171b1(0x12a)](_0x447495,_0x249f46);break;}}_0x370635[_0x9171b1(0x145)]();for(const [_0x2b0edb,_0x177224]of _0x1b13c8){_0x370635['set'](_0x2b0edb,_0x177224);}}if(_0x370635[_0x9171b1(0x158)]>0x0){_0x3f755?.[_0x9171b1(0x159)]('Processing\x20journeys');const _0x3a5b95=Array[_0x9171b1(0x151)](_0x370635['values']()),_0xf8d5d9=0x5,{createYamlContext:_0x28b6c2}=createYamlContextForBundle(_0x49213a,_0x50bd9c,_0x5a9978,_0x62b08,_0x255938,_0x57f258);for(let _0xe3d7b=0x0;_0xe3d7b<_0x3a5b95['length'];_0xe3d7b+=_0xf8d5d9){const _0x5d9688=_0x3a5b95[_0x9171b1(0x150)](_0xe3d7b,_0xe3d7b+_0xf8d5d9),_0x3a8d1c=await Promise['all'](_0x5d9688[_0x9171b1(0x130)](async _0x56c794=>{const _0x3b8cdc=_0x9171b1,_0x322d0e=_0x56c794[0x0],_0x438234=_0x322d0e[_0x3b8cdc(0x13e)];_0x3f755?.[_0x3b8cdc(0x159)](_0x3b8cdc(0x142)+_0x438234);const _0x2a080c=_0x322d0e[_0x3b8cdc(0x135)]?_0x318d2c[_0x3b8cdc(0x147)](_0x322d0e['folderId'])||'':'',_0x28966e=_0x2a080c?a150_0x239e99[_0x3b8cdc(0x11b)](_0x2cf307,_0x2a080c):_0x2cf307,_0x2b173b=sanitizeFileName(_0x438234),_0x260262=a150_0x239e99[_0x3b8cdc(0x11b)](_0x28966e,_0x2b173b+_0x3b8cdc(0x14e));let _0x463d96;if(existsSync(_0x260262))try{const _0x165ff1=readFileSync(_0x260262,_0x3b8cdc(0x15e)),_0x460f03=a150_0x5a1286(_0x165ff1);_0x463d96=buildLocalRuleToNameMappingFromJourney(_0x460f03);}catch{}const _0x452051=[];for(const _0x4eceaa of _0x56c794){const _0x503b7d=_0x57f258[_0x3b8cdc(0x147)](_0x4eceaa['id']);if(!_0x503b7d){_0x3f755?.[_0x3b8cdc(0x159)](_0x3b8cdc(0x121)+_0x4eceaa['id']+_0x3b8cdc(0x11e));continue;}const _0x11c6a6=_0x503b7d[_0x3b8cdc(0x12e)]?.[_0x3b8cdc(0x154)],_0x5307e7=_0x28b6c2(_0x4eceaa['id'],_0x11c6a6),_0x2f662f=await journeyResponseToDef(_0x503b7d,_0x5307e7);_0x452051['push']({'item':_0x4eceaa,'yaml':_0x2f662f});}const _0x16497d=await _0x49213a[_0x3b8cdc(0x15f)][_0x3b8cdc(0x155)](_0x322d0e[_0x3b8cdc(0x13b)]),_0x4e4018=buildMergedJourneyDef(_0x452051,_0x463d96,_0x16497d);return{'bundleName':_0x438234,'folderPath':_0x2a080c,'finalYaml':_0x4e4018};}));for(const {bundleName:_0x48c834,folderPath:_0x3cac0a,finalYaml:_0x1ea9d1}of _0x3a8d1c){const _0xa8d9cc=normalizeJourneyDef(_0x1ea9d1),_0x3005b8=a150_0x2b189e(_0xa8d9cc),_0x133eff=_0x3cac0a?a150_0x239e99[_0x9171b1(0x11b)](_0x2cf307,_0x3cac0a):_0x2cf307,_0x138208=sanitizeFileName(_0x48c834),_0x33c482=getUniqueFileName(_0x133eff,_0x138208,_0x131172),_0x27dcb1=a150_0x239e99[_0x9171b1(0x11b)](_0x133eff,_0x33c482+'.yml');_0x52c2ca['push'](prepareFile(_0x27dcb1,_0x3005b8,_0x2cf307));}}}const _0x11dc9e=Array[_0x9171b1(0x151)](_0x5b0d26[_0x9171b1(0x161)]())[_0x9171b1(0x131)]((_0x3deedb,_0x402d5e)=>_0x3deedb+_0x402d5e[_0x9171b1(0x120)],0x0),_0x5e7684=_0x264895[_0x9171b1(0x156)](_0x39bc0a=>_0x39bc0a['kind']!==SEGMENT_KIND_JOURNEY),_0x4e7e53=_0x52c2ca[_0x9171b1(0x156)](_0x57b504=>_0x57b504[_0x9171b1(0x128)])['length'],_0x3a2bd0=_0x52c2ca[_0x9171b1(0x156)](_0x55bf8c=>!_0x55bf8c[_0x9171b1(0x128)]&&_0x55bf8c[_0x9171b1(0x141)])['length'],_0x39d1a2=_0x52c2ca[_0x9171b1(0x156)](_0x2cc072=>!_0x2cc072['isNew']&&!_0x2cc072[_0x9171b1(0x141)])[_0x9171b1(0x120)],_0x53da4a=Array['from'](_0x370635[_0x9171b1(0x161)]())[_0x9171b1(0x131)]((_0x4d3568,_0x5e8f69)=>_0x4d3568+_0x5e8f69[_0x9171b1(0x120)],0x0);return{'parentName':_0x27457,'parentId':_0x22661c,'targetDir':_0x2cf307,'files':_0x52c2ca,'counts':{'segments':_0x5e7684[_0x9171b1(0x120)],'journeys':_0x370635[_0x9171b1(0x158)],'journeyVersions':_0x53da4a,'activations':_0x11dc9e},'newFiles':_0x4e7e53,'changedFiles':_0x3a2bd0,'unchangedFiles':_0x39d1a2};}function createYamlContextForBundle(_0x110faa,_0x3fe10b,_0x12d61e,_0x197bc1,_0x5baff1,_0x20e405){const _0x33037b=new Set(),_0x2963cc=new Map(),_0x399f5e=new Map(),_0x40f55a=createJumpTargetCache(),_0x2b00e3=async(_0x44b0b7,_0x5e2f6e)=>{const _0x37843d=a150_0x148d,_0x43099d=_0x2963cc[_0x37843d(0x147)](_0x44b0b7);if(_0x43099d!==undefined)return _0x43099d;if(!_0x5e2f6e)return _0x44b0b7;try{let _0x23522c=_0x3fe10b[_0x37843d(0x147)](_0x44b0b7);!_0x23522c&&(_0x23522c=await _0x110faa[_0x37843d(0x14b)]['getSegment'](_0x5e2f6e,_0x44b0b7),_0x3fe10b[_0x37843d(0x12a)](_0x44b0b7,_0x23522c));const _0x56902a=generateJourneyLocalName(_0x23522c[_0x37843d(0x160)]),_0x2941c3=_0x23522c[_0x37843d(0x122)]===SEGMENT_KIND_JOURNEY&&_0x56902a!==undefined;if(_0x2941c3&&_0x56902a){let _0x526bbd=_0x56902a,_0x581703=0x2;while(_0x33037b[_0x37843d(0x152)](_0x526bbd)){_0x526bbd=_0x56902a+'_'+_0x581703,_0x581703++;}return _0x33037b['add'](_0x526bbd),_0x2963cc[_0x37843d(0x12a)](_0x44b0b7,_0x526bbd),_0x526bbd;}return _0x23522c['name'];}catch{return _0x44b0b7;}},_0x356c5f=(_0x585982,_0x4ab163)=>({'resolveSegment':async _0x586ffd=>{const _0x14c9ac=a150_0x148d,_0x1a5a49=_0x2963cc[_0x14c9ac(0x147)](_0x586ffd);if(_0x1a5a49!==undefined)return{'name':_0x1a5a49,'isJourneyLocal':!![]};if(!_0x4ab163)return{'name':_0x586ffd,'isJourneyLocal':![]};try{let _0x16314e=_0x3fe10b[_0x14c9ac(0x147)](_0x586ffd);!_0x16314e&&(_0x16314e=await _0x110faa[_0x14c9ac(0x14b)]['getSegment'](_0x4ab163,_0x586ffd),_0x3fe10b[_0x14c9ac(0x12a)](_0x586ffd,_0x16314e));const _0x2ec1a8=generateJourneyLocalName(_0x16314e[_0x14c9ac(0x160)]),_0x26008a=_0x16314e[_0x14c9ac(0x122)]===SEGMENT_KIND_JOURNEY&&_0x2ec1a8!==undefined;if(_0x26008a&&!_0x16314e[_0x14c9ac(0x123)]&&_0x4ab163)try{const _0x53f054=await _0x110faa[_0x14c9ac(0x14b)][_0x14c9ac(0x14c)](_0x4ab163,_0x586ffd);_0x3fe10b[_0x14c9ac(0x12a)](_0x586ffd,_0x53f054),_0x16314e=_0x53f054;}catch{}const _0x16ac51=await _0x2b00e3(_0x586ffd,_0x4ab163);let _0xa2365c;if(_0x26008a&&_0x16314e[_0x14c9ac(0x123)]){const _0x1abda9=await segmentResponseToDef(_0x16314e,{'resolveSegmentName':_0x1a6db3=>_0x2b00e3(_0x1a6db3,_0x4ab163)});_0xa2365c={'description':_0x16314e[_0x14c9ac(0x15d)],'rule':_0x1abda9[_0x14c9ac(0x123)]};}return{'name':_0x16ac51,'isJourneyLocal':_0x26008a,'definition':_0xa2365c};}catch{return{'name':_0x586ffd,'isJourneyLocal':![]};}},'resolveActivation':async _0x471e2b=>{const _0x101511=a150_0x148d,_0x33d911=_0x399f5e['get'](_0x471e2b);if(_0x33d911!==undefined)return{'name':_0x33d911,'isJourneyLocal':!![]};try{let _0x341139=_0x5baff1[_0x101511(0x147)](_0x471e2b);!_0x341139&&(_0x341139=await _0x110faa['journey'][_0x101511(0x149)](_0x585982,_0x471e2b));const _0x26f8dc=_0x341139['attributes'][_0x101511(0x12b)][_0x101511(0x160)]||_0x471e2b,_0x483509=sanitizeYamlKey(_0x26f8dc)||_0x101511(0x14d)+_0x471e2b,_0x17ce31=_0x483509;_0x399f5e[_0x101511(0x12a)](_0x471e2b,_0x17ce31);const _0x20517b=journeyActivationStepToYaml(_0x341139,_0x12d61e,_0x197bc1);return{'name':_0x17ce31,'isJourneyLocal':!![],'definition':_0x20517b};}catch{return{'name':_0x471e2b,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x61d1c6,_0x3cfb95)=>resolveJumpTarget(_0x61d1c6,_0x3cfb95,_0x40f55a,async _0x229315=>{const _0x530367=a150_0x148d,_0x136db6=_0x20e405[_0x530367(0x147)](_0x229315);if(_0x136db6)return _0x136db6;return _0x110faa[_0x530367(0x15f)][_0x530367(0x162)](_0x229315);})});return{'createYamlContext':_0x356c5f};}
|
|
1
|
+
(function(_0x1f46d9,_0x4b6953){const _0x26f73a=a150_0x5d3d,_0x4938a6=_0x1f46d9();while(!![]){try{const _0x4154dd=parseInt(_0x26f73a(0x9f))/0x1+-parseInt(_0x26f73a(0xad))/0x2*(-parseInt(_0x26f73a(0xa3))/0x3)+parseInt(_0x26f73a(0xbe))/0x4*(parseInt(_0x26f73a(0xd0))/0x5)+parseInt(_0x26f73a(0xd6))/0x6*(parseInt(_0x26f73a(0xa2))/0x7)+-parseInt(_0x26f73a(0xab))/0x8*(-parseInt(_0x26f73a(0xc6))/0x9)+-parseInt(_0x26f73a(0xdc))/0xa*(-parseInt(_0x26f73a(0xc0))/0xb)+-parseInt(_0x26f73a(0xa7))/0xc;if(_0x4154dd===_0x4b6953)break;else _0x4938a6['push'](_0x4938a6['shift']());}catch(_0x7f7363){_0x4938a6['push'](_0x4938a6['shift']());}}}(a150_0x42a6,0xb520a));import a150_0x4b20a5 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a150_0x5d3d(_0x26e3ac,_0x2f5246){_0x26e3ac=_0x26e3ac-0x96;const _0x42a6c7=a150_0x42a6();let _0x5d3dfe=_0x42a6c7[_0x26e3ac];return _0x5d3dfe;}import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a150_0x50d2f7,normalizeJourneyDef,parseYamlString as a150_0x121e07}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(_0x59542c,_0x1d1f7f,_0x3a5259){const _0x463933=a150_0x5d3d,_0x9f6f3=a150_0x4b20a5[_0x463933(0xcb)](_0x3a5259,_0x59542c);if(existsSync(_0x59542c)){const _0x1fbf02=readFileSync(_0x59542c,_0x463933(0xd4)),_0x4f0a11=generateDiff(_0x1fbf02,_0x1d1f7f),_0x4632dd=hasChanges(_0x4f0a11);return{'relativePath':_0x9f6f3,'absolutePath':_0x59542c,'content':_0x1d1f7f,'isNew':![],'hasChanges':_0x4632dd,'diff':_0x4632dd?formatDiffWithColors(_0x4f0a11):undefined};}return{'relativePath':_0x9f6f3,'absolutePath':_0x59542c,'content':_0x1d1f7f,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x11a762,_0x21d411,_0x5bf199){const _0x829c35=a150_0x5d3d,_0x41cdcb=_0x11a762+':'+_0x21d411,_0x149152=_0x5bf199[_0x829c35(0xba)](_0x41cdcb)||0x0;_0x5bf199[_0x829c35(0xd2)](_0x41cdcb,_0x149152+0x1);if(_0x149152===0x0)return _0x21d411;return _0x21d411+'_'+(_0x149152+0x1);}function a150_0x42a6(){const _0x2b68d5=['isNew','state','Processing\x20journeys','Fetching\x20users\x20and\x20connections','versionNumber','journeyBundleName','get','slice','getLatestJourneyId','folderId','160jNSzys','all','855888smmdcl','toLowerCase','getJourney','from','Fetching\x20activations','reduce','18TgEtMv','listFolders','clear','filter','sort','relative','updatedAt','.yml','segmentFolderId','audienceId','66815mbvkPR','relationships','set','getParent','utf-8','push','73026sBhvPc','Processing\x20journey:\x20','Warning:\x20Journey\x20','size','segment','data','20AIBklz','length','journeyBundleId','activationParams','values','map','journey','update','add','has','connection','join','823555kKryma','listActivations','hasChanges','371YYcVvF','969oZdUKk','Fetching\x20segments,\x20folders,\x20and\x20journeys','rule','listJourneysWithDetailsFromParentSegment','37412868TaFoaM','targetResourceName','name','getSegment','2786704cXWFdk','activation_','6218XtLbJH','kind','description','tdx.json','resolveParentId','attributes','paused'];a150_0x42a6=function(){return _0x2b68d5;};return a150_0x42a6();}export async function pullSegments(_0x3f97a6,_0x3f48bc,_0xe5ca3f={}){const _0x2abe7c=a150_0x5d3d,{targetDir:_0x20e89b,progress:_0x3f5d67}=_0xe5ca3f;_0x3f5d67?.[_0x2abe7c(0x9a)]('Resolving\x20parent\x20segment');const _0x49f773=await _0x3f97a6[_0x2abe7c(0xda)][_0x2abe7c(0xb1)](_0x3f48bc);_0x3f5d67?.['update']('Fetching\x20parent\x20segment\x20info');const _0x41df16=await _0x3f97a6['segment'][_0x2abe7c(0xd3)](_0x49f773),_0x1c4fe6=_0x41df16[_0x2abe7c(0xb2)][_0x2abe7c(0xa9)];_0x3f5d67?.[_0x2abe7c(0x9a)](_0x2abe7c(0xa4));const [_0x32c716,_0x5b3cc1,_0x982d2e]=await Promise[_0x2abe7c(0xbf)]([_0x3f97a6['segment']['listSegments'](_0x49f773),_0x3f97a6[_0x2abe7c(0xda)][_0x2abe7c(0xc7)](_0x49f773),_0x3f97a6['journey'][_0x2abe7c(0xa6)](_0x49f773,{'includeAllVersions':!![]})]),{journeys:_0x48f93d,activationStepsById:_0x3f4bf1}=_0x982d2e,_0x10a650=new Map();for(const _0x20d308 of _0x48f93d){_0x10a650[_0x2abe7c(0xd2)](_0x20d308['id'],_0x20d308);}const _0x46d89f=_0x48f93d[_0x2abe7c(0x98)](_0x4cca4b=>({'id':_0x4cca4b['id'],'name':_0x4cca4b[_0x2abe7c(0xb2)][_0x2abe7c(0xa9)],'journeyBundleName':_0x4cca4b['attributes']['journeyBundleName']||'','journeyBundleId':_0x4cca4b[_0x2abe7c(0xb2)][_0x2abe7c(0xde)]||'','versionNumber':_0x4cca4b[_0x2abe7c(0xb2)][_0x2abe7c(0xb8)],'description':_0x4cca4b[_0x2abe7c(0xb2)]['description'],'state':_0x4cca4b[_0x2abe7c(0xb2)][_0x2abe7c(0xb5)],'paused':_0x4cca4b[_0x2abe7c(0xb2)][_0x2abe7c(0xb3)],'audienceId':_0x4cca4b[_0x2abe7c(0xb2)][_0x2abe7c(0xcf)],'folderId':_0x4cca4b[_0x2abe7c(0xd1)]?.['parentFolder']?.[_0x2abe7c(0xdb)]?.['id'],'createdAt':_0x4cca4b[_0x2abe7c(0xb2)]['createdAt'],'updatedAt':_0x4cca4b['attributes'][_0x2abe7c(0xcc)]})),_0x429caa=buildFolderIdToPathMap(_0x5b3cc1),_0x1a1b4e=_0x20e89b||'segments/'+sanitizeFileName(_0x1c4fe6);_0x3f5d67?.['update'](_0x2abe7c(0xc4));const _0x69391e=new Map();await batchAsync(_0x32c716,async _0x972e7c=>{const _0x4378ad=_0x2abe7c,_0x375c69=await _0x3f97a6['segment'][_0x4378ad(0xa0)](_0x49f773,_0x972e7c['id']);_0x69391e[_0x4378ad(0xd2)](_0x972e7c['id'],_0x375c69);}),_0x3f5d67?.[_0x2abe7c(0x9a)](_0x2abe7c(0xb7));const [_0x3c9903,_0x453b26]=await Promise['all']([_0x3f97a6['user']['buildIdToEmailMap'](),_0x3f97a6[_0x2abe7c(0x9d)]['buildIdToNameMap']()]),_0x5d2b45=[],_0x15243f=new Map(),_0x13b5f9=a150_0x4b20a5[_0x2abe7c(0x9e)](_0x1a1b4e,_0x2abe7c(0xb0)),_0x58f91f=createTdxConfigContent(_0x1c4fe6);_0x5d2b45[_0x2abe7c(0xd5)](prepareFile(_0x13b5f9,_0x58f91f,_0x1a1b4e));const _0x586b2d=new Map();for(const _0x1487a2 of _0x32c716){_0x586b2d[_0x2abe7c(0xd2)](_0x1487a2['id'],_0x1487a2);}let _0x771d5=_0x32c716;if(_0xe5ca3f[_0x2abe7c(0xa8)]){const _0x344fdf=_0x32c716[_0x2abe7c(0xc9)](_0xf2ff4a=>_0xf2ff4a[_0x2abe7c(0xa9)][_0x2abe7c(0xc1)]()===_0xe5ca3f['targetResourceName']['toLowerCase']());_0x344fdf[_0x2abe7c(0xdd)]>0x0&&(_0x771d5=_0x344fdf);}_0x3f5d67?.[_0x2abe7c(0x9a)]('Processing\x20segments');for(const _0x170280 of _0x771d5){if(_0x170280[_0x2abe7c(0xae)]===SEGMENT_KIND_JOURNEY)continue;const _0x4a8040=_0x170280['segmentFolderId']?_0x429caa['get'](_0x170280[_0x2abe7c(0xce)])||'':'',_0x45342f=_0x69391e[_0x2abe7c(0xba)](_0x170280['id'])||[],_0x34303b=segmentWithActivationsToYaml(_0x170280,_0x45342f,undefined,_0x3c9903,_0x453b26),_0x56dcef=_0x4a8040?a150_0x4b20a5[_0x2abe7c(0x9e)](_0x1a1b4e,_0x4a8040):_0x1a1b4e,_0x459c35=sanitizeFileName(_0x170280['name']),_0x555ea3=getUniqueFileName(_0x56dcef,_0x459c35,_0x15243f),_0x4716ac=a150_0x4b20a5[_0x2abe7c(0x9e)](_0x56dcef,_0x555ea3+_0x2abe7c(0xcd)),_0xce69d2=segmentToYamlString(_0x34303b);_0x5d2b45[_0x2abe7c(0xd5)](prepareFile(_0x4716ac,_0xce69d2,_0x1a1b4e));}const _0x3a1fc5=new Map();for(const _0x106617 of _0x46d89f){const _0x3e669e=_0x106617['journeyBundleId'];!_0x3a1fc5[_0x2abe7c(0x9c)](_0x3e669e)&&_0x3a1fc5[_0x2abe7c(0xd2)](_0x3e669e,[]),_0x3a1fc5['get'](_0x3e669e)[_0x2abe7c(0xd5)](_0x106617);}for(const _0x5d88ca of _0x3a1fc5['values']()){_0x5d88ca[_0x2abe7c(0xca)]((_0x5bceab,_0x26a754)=>(_0x5bceab[_0x2abe7c(0xb8)]||0x0)-(_0x26a754[_0x2abe7c(0xb8)]||0x0));}if(_0xe5ca3f[_0x2abe7c(0xa8)]){const _0x3caeb8=new Map();for(const [_0x2410f4,_0x448b6c]of _0x3a1fc5){const _0x9b8b4b=_0x448b6c[0x0][_0x2abe7c(0xb9)];if(_0x9b8b4b[_0x2abe7c(0xc1)]()===_0xe5ca3f[_0x2abe7c(0xa8)][_0x2abe7c(0xc1)]()){_0x3caeb8['set'](_0x2410f4,_0x448b6c);break;}}_0x3a1fc5[_0x2abe7c(0xc8)]();for(const [_0x1cad78,_0x374f2a]of _0x3caeb8){_0x3a1fc5[_0x2abe7c(0xd2)](_0x1cad78,_0x374f2a);}}if(_0x3a1fc5[_0x2abe7c(0xd9)]>0x0){_0x3f5d67?.[_0x2abe7c(0x9a)](_0x2abe7c(0xb6));const _0x529efc=Array['from'](_0x3a1fc5['values']()),_0x20d5bc=0x5,{createYamlContext:_0x49f6ce}=createYamlContextForBundle(_0x3f97a6,_0x586b2d,_0x3c9903,_0x453b26,_0x3f4bf1,_0x10a650);for(let _0xd7ac69=0x0;_0xd7ac69<_0x529efc[_0x2abe7c(0xdd)];_0xd7ac69+=_0x20d5bc){const _0x2e509b=_0x529efc[_0x2abe7c(0xbb)](_0xd7ac69,_0xd7ac69+_0x20d5bc),_0x7b6c28=await Promise[_0x2abe7c(0xbf)](_0x2e509b[_0x2abe7c(0x98)](async _0x1255ce=>{const _0xdd5cf9=_0x2abe7c,_0x2b3ec6=_0x1255ce[0x0],_0x35891e=_0x2b3ec6[_0xdd5cf9(0xb9)];_0x3f5d67?.[_0xdd5cf9(0x9a)](_0xdd5cf9(0xd7)+_0x35891e);const _0x2450a4=_0x2b3ec6['folderId']?_0x429caa[_0xdd5cf9(0xba)](_0x2b3ec6[_0xdd5cf9(0xbd)])||'':'',_0x49c9fc=_0x2450a4?a150_0x4b20a5['join'](_0x1a1b4e,_0x2450a4):_0x1a1b4e,_0x23a239=sanitizeFileName(_0x35891e),_0x396b24=a150_0x4b20a5[_0xdd5cf9(0x9e)](_0x49c9fc,_0x23a239+'.yml');let _0xcc0093;if(existsSync(_0x396b24))try{const _0x6281a8=readFileSync(_0x396b24,_0xdd5cf9(0xd4)),_0xf36224=a150_0x121e07(_0x6281a8);_0xcc0093=buildLocalRuleToNameMappingFromJourney(_0xf36224);}catch{}const _0x5a5479=[];for(const _0x495714 of _0x1255ce){const _0x608b44=_0x10a650[_0xdd5cf9(0xba)](_0x495714['id']);if(!_0x608b44){_0x3f5d67?.[_0xdd5cf9(0x9a)](_0xdd5cf9(0xd8)+_0x495714['id']+'\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping');continue;}const _0x151e77=_0x608b44[_0xdd5cf9(0xb2)]?.[_0xdd5cf9(0xcf)],_0x5c8143=_0x49f6ce(_0x495714['id'],_0x151e77),_0x2e1278=await journeyResponseToDef(_0x608b44,_0x5c8143);_0x5a5479[_0xdd5cf9(0xd5)]({'item':_0x495714,'yaml':_0x2e1278});}const _0x20a671=await _0x3f97a6['journey'][_0xdd5cf9(0xbc)](_0x2b3ec6[_0xdd5cf9(0xde)]),_0x414e7f=buildMergedJourneyDef(_0x5a5479,_0xcc0093,_0x20a671);return{'bundleName':_0x35891e,'folderPath':_0x2450a4,'finalYaml':_0x414e7f};}));for(const {bundleName:_0x513f62,folderPath:_0x390832,finalYaml:_0x45b738}of _0x7b6c28){const _0x3056c6=normalizeJourneyDef(_0x45b738),_0x4835a0=a150_0x50d2f7(_0x3056c6),_0x4d1021=_0x390832?a150_0x4b20a5['join'](_0x1a1b4e,_0x390832):_0x1a1b4e,_0x3a55b7=sanitizeFileName(_0x513f62),_0x4cb142=getUniqueFileName(_0x4d1021,_0x3a55b7,_0x15243f),_0x39ece4=a150_0x4b20a5['join'](_0x4d1021,_0x4cb142+'.yml');_0x5d2b45[_0x2abe7c(0xd5)](prepareFile(_0x39ece4,_0x4835a0,_0x1a1b4e));}}}const _0x13e241=Array[_0x2abe7c(0xc3)](_0x69391e[_0x2abe7c(0x97)]())['reduce']((_0x14cc95,_0x27d42c)=>_0x14cc95+_0x27d42c[_0x2abe7c(0xdd)],0x0),_0xbd6fb2=_0x771d5[_0x2abe7c(0xc9)](_0x4fe100=>_0x4fe100[_0x2abe7c(0xae)]!==SEGMENT_KIND_JOURNEY),_0xa7d40a=_0x5d2b45[_0x2abe7c(0xc9)](_0x4884f0=>_0x4884f0['isNew'])['length'],_0x2ca2c5=_0x5d2b45['filter'](_0x1015b6=>!_0x1015b6[_0x2abe7c(0xb4)]&&_0x1015b6[_0x2abe7c(0xa1)])[_0x2abe7c(0xdd)],_0x8cad47=_0x5d2b45[_0x2abe7c(0xc9)](_0x204b53=>!_0x204b53[_0x2abe7c(0xb4)]&&!_0x204b53[_0x2abe7c(0xa1)])[_0x2abe7c(0xdd)],_0x3130e9=Array[_0x2abe7c(0xc3)](_0x3a1fc5['values']())[_0x2abe7c(0xc5)]((_0x4ced22,_0x2879a2)=>_0x4ced22+_0x2879a2[_0x2abe7c(0xdd)],0x0);return{'parentName':_0x1c4fe6,'parentId':_0x49f773,'targetDir':_0x1a1b4e,'files':_0x5d2b45,'counts':{'segments':_0xbd6fb2[_0x2abe7c(0xdd)],'journeys':_0x3a1fc5[_0x2abe7c(0xd9)],'journeyVersions':_0x3130e9,'activations':_0x13e241},'newFiles':_0xa7d40a,'changedFiles':_0x2ca2c5,'unchangedFiles':_0x8cad47};}function createYamlContextForBundle(_0x537e23,_0x1f9a6b,_0x2b7a65,_0x1a8934,_0x20a423,_0x476574){const _0x4740e5=new Set(),_0x3d5f45=new Map(),_0x3a29f2=new Map(),_0x12f351=createJumpTargetCache(),_0x2a15aa=async(_0x5aa82f,_0x228d2b)=>{const _0x5bf9a9=a150_0x5d3d,_0x4e0f0a=_0x3d5f45[_0x5bf9a9(0xba)](_0x5aa82f);if(_0x4e0f0a!==undefined)return _0x4e0f0a;if(!_0x228d2b)return _0x5aa82f;try{let _0x1d44f5=_0x1f9a6b[_0x5bf9a9(0xba)](_0x5aa82f);!_0x1d44f5&&(_0x1d44f5=await _0x537e23['segment']['getSegment'](_0x228d2b,_0x5aa82f),_0x1f9a6b[_0x5bf9a9(0xd2)](_0x5aa82f,_0x1d44f5));const _0x456ff4=generateJourneyLocalName(_0x1d44f5[_0x5bf9a9(0xa9)]),_0x40df2f=_0x1d44f5[_0x5bf9a9(0xae)]===SEGMENT_KIND_JOURNEY&&_0x456ff4!==undefined;if(_0x40df2f&&_0x456ff4){let _0x5778c6=_0x456ff4,_0x509d02=0x2;while(_0x4740e5[_0x5bf9a9(0x9c)](_0x5778c6)){_0x5778c6=_0x456ff4+'_'+_0x509d02,_0x509d02++;}return _0x4740e5[_0x5bf9a9(0x9b)](_0x5778c6),_0x3d5f45['set'](_0x5aa82f,_0x5778c6),_0x5778c6;}return _0x1d44f5[_0x5bf9a9(0xa9)];}catch{return _0x5aa82f;}},_0x509f27=(_0x21e4f6,_0x579280)=>({'resolveSegment':async _0x321ed3=>{const _0x5905b5=a150_0x5d3d,_0x28a16b=_0x3d5f45[_0x5905b5(0xba)](_0x321ed3);if(_0x28a16b!==undefined)return{'name':_0x28a16b,'isJourneyLocal':!![]};if(!_0x579280)return{'name':_0x321ed3,'isJourneyLocal':![]};try{let _0x47cbdd=_0x1f9a6b['get'](_0x321ed3);!_0x47cbdd&&(_0x47cbdd=await _0x537e23[_0x5905b5(0xda)][_0x5905b5(0xaa)](_0x579280,_0x321ed3),_0x1f9a6b[_0x5905b5(0xd2)](_0x321ed3,_0x47cbdd));const _0x38b817=generateJourneyLocalName(_0x47cbdd[_0x5905b5(0xa9)]),_0x2192b4=_0x47cbdd[_0x5905b5(0xae)]===SEGMENT_KIND_JOURNEY&&_0x38b817!==undefined;if(_0x2192b4&&!_0x47cbdd[_0x5905b5(0xa5)]&&_0x579280)try{const _0x33d716=await _0x537e23[_0x5905b5(0xda)][_0x5905b5(0xaa)](_0x579280,_0x321ed3);_0x1f9a6b[_0x5905b5(0xd2)](_0x321ed3,_0x33d716),_0x47cbdd=_0x33d716;}catch{}const _0x263f6b=await _0x2a15aa(_0x321ed3,_0x579280);let _0x2e4d90;if(_0x2192b4&&_0x47cbdd[_0x5905b5(0xa5)]){const _0x2d6bc6=await segmentResponseToDef(_0x47cbdd,{'resolveSegmentName':_0xde8755=>_0x2a15aa(_0xde8755,_0x579280)});_0x2e4d90={'description':_0x47cbdd[_0x5905b5(0xaf)],'rule':_0x2d6bc6[_0x5905b5(0xa5)]};}return{'name':_0x263f6b,'isJourneyLocal':_0x2192b4,'definition':_0x2e4d90};}catch{return{'name':_0x321ed3,'isJourneyLocal':![]};}},'resolveActivation':async _0xc5b40d=>{const _0x58e8e4=a150_0x5d3d,_0x30a844=_0x3a29f2['get'](_0xc5b40d);if(_0x30a844!==undefined)return{'name':_0x30a844,'isJourneyLocal':!![]};try{let _0x47ac05=_0x20a423['get'](_0xc5b40d);!_0x47ac05&&(_0x47ac05=await _0x537e23['journey']['getActivation'](_0x21e4f6,_0xc5b40d));const _0x4aec8a=_0x47ac05[_0x58e8e4(0xb2)][_0x58e8e4(0x96)][_0x58e8e4(0xa9)]||_0xc5b40d,_0x42c7ab=sanitizeYamlKey(_0x4aec8a)||_0x58e8e4(0xac)+_0xc5b40d,_0x23b481=_0x42c7ab;_0x3a29f2[_0x58e8e4(0xd2)](_0xc5b40d,_0x23b481);const _0x5c34ce=journeyActivationStepToYaml(_0x47ac05,_0x2b7a65,_0x1a8934);return{'name':_0x23b481,'isJourneyLocal':!![],'definition':_0x5c34ce};}catch{return{'name':_0xc5b40d,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x51007c,_0x3243e7)=>resolveJumpTarget(_0x51007c,_0x3243e7,_0x12f351,async _0x5005c9=>{const _0x312f84=a150_0x5d3d,_0x2d2e88=_0x476574[_0x312f84(0xba)](_0x5005c9);if(_0x2d2e88)return _0x2d2e88;return _0x537e23[_0x312f84(0x99)][_0x312f84(0xc2)](_0x5005c9);})});return{'createYamlContext':_0x509f27};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x386d8f,_0x4a8c44){const _0x40758=a151_0x1f40,_0x1222a5=_0x386d8f();while(!![]){try{const _0x1544a5=parseInt(_0x40758(0x1a9))/0x1*(parseInt(_0x40758(0x1b2))/0x2)+-parseInt(_0x40758(0x1b7))/0x3+-parseInt(_0x40758(0x1af))/0x4+parseInt(_0x40758(0x1bb))/0x5+-parseInt(_0x40758(0x1b1))/0x6*(parseInt(_0x40758(0x1a6))/0x7)+parseInt(_0x40758(0x1ad))/0x8+parseInt(_0x40758(0x1b0))/0x9;if(_0x1544a5===_0x4a8c44)break;else _0x1222a5['push'](_0x1222a5['shift']());}catch(_0x2adcd1){_0x1222a5['push'](_0x1222a5['shift']());}}}(a151_0x230c,0x79c88));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a151_0x127a8a from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x594383){const _0x5a1a8a=a151_0x1f40,_0x18a090=a151_0x127a8a[_0x5a1a8a(0x1ae)](_0x594383),_0x14438d=a151_0x127a8a[_0x5a1a8a(0x1ba)](_0x594383);return a151_0x127a8a[_0x5a1a8a(0x1b3)](_0x18a090,'.'+_0x14438d+_0x5a1a8a(0x1b4));}export function readPushRecovery(_0x54df03){const _0x563dd8=a151_0x1f40,_0x511a9e=getPushRecoveryPath(_0x54df03);if(!existsSync(_0x511a9e))return undefined;try{const _0x2bb444=readFileSync(_0x511a9e,_0x563dd8(0x1bc)),_0x169c82=JSON[_0x563dd8(0x1b6)](_0x2bb444);if(_0x169c82?.['version']!==0x1||typeof _0x169c82[_0x563dd8(0x1ac)]!==_0x563dd8(0x1a8))return undefined;return _0x169c82;}catch(_0x511c7){return _0x511c7 instanceof SyntaxError?logger[_0x563dd8(0x1ab)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x511c7):logger[_0x563dd8(0x1aa)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x511c7),undefined;}}export function writePushRecovery(_0x3077e8,_0x7f2d49){const _0x56467c=a151_0x1f40,_0x7cbb5c=getPushRecoveryPath(_0x3077e8),_0x1abb36=_0x7cbb5c+'.tmp';writeFileSync(_0x1abb36,JSON[_0x56467c(0x1b8)](_0x7f2d49,null,0x2)+'\x0a','utf-8'),renameSync(_0x1abb36,_0x7cbb5c);}function a151_0x1f40(_0x181f4a,_0x50c397){_0x181f4a=_0x181f4a-0x1a6;const _0x230c9f=a151_0x230c();let _0x1f402c=_0x230c9f[_0x181f4a];return _0x1f402c;}function a151_0x230c(){const _0x1c832f=['debug','journeyName','1002936ZfEFqc','dirname','2966112iWHdMA','14514156LUlPkk','2040XVqKAs','642622MIcICA','join','.push-recovery.json','segments','parse','2368827aqjikS','stringify','code','basename','1534185zFMbnl','utf-8','20153gLkvMW','toISOString','string','3cLYIUi','warn'];a151_0x230c=function(){return _0x1c832f;};return a151_0x230c();}export function deletePushRecovery(_0x5f03f3){const _0x537d98=a151_0x1f40,_0x5d8bd8=getPushRecoveryPath(_0x5f03f3);try{unlinkSync(_0x5d8bd8);}catch(_0x2cdacf){_0x2cdacf[_0x537d98(0x1b9)]!=='ENOENT'&&logger[_0x537d98(0x1ab)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x2cdacf);}}export function saveSegmentToPushRecovery(_0x4aba3c,_0x5867cb,_0x1e7688,_0x30dd01){const _0xb3605f=a151_0x1f40,_0x32fdff=readPushRecovery(_0x4aba3c),_0x2d5ba0=_0x32fdff?.[_0xb3605f(0x1ac)]===_0x5867cb?{..._0x32fdff,'updatedAt':new Date()[_0xb3605f(0x1a7)]()}:{'version':0x1,'journeyName':_0x5867cb,'updatedAt':new Date()[_0xb3605f(0x1a7)](),'segments':{}};_0x2d5ba0[_0xb3605f(0x1b5)][_0x1e7688]=_0x30dd01,writePushRecovery(_0x4aba3c,_0x2d5ba0);}
|