@treasuredata/tdx 2026.3.50 → 2026.3.52
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.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +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.d.ts.map +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/global-context.js.map +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.d.ts +1 -0
- package/dist/core/oauth.d.ts.map +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/oauth.js.map +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.d.ts +21 -4
- package/dist/proxy/passthrough-server.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +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(_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
|
+
function a148_0x21a6(){const _0x17a1ca=['1pHdbPi','column_name','realtime.events[','foreignKey','311262wqckoc','71972MwFKIg','schema','hivePoolName','schedule:','realtime:','personalization_services:','length','forEach','timezone','2331544qtSCQY','type','parentKey','isArray','number','realtime.attributes[','prestoPoolName','Example\x20Attributes','18Ywgtru','match','trino_pool','YAML\x20config\x20missing\x20required\x20field:\x20master.database','default_time_filter','columns',']\x20(','Example\x20Events',':00:00','03:00','master:',':00','events','ordered_set','personalization_services','scheduleType','padStart','none','\x27.\x20Must\x20be\x20one\x20of:\x20','engine','schedule','includes','filters','audienceFilters','column','30mzIneH','parent_key','set','parentDatabaseName','database','5540370iYAHGn','behaviors','customerGroup','1175529YOOXoU','customer_group','customer_id','scheduleOption','Parent\x20segment\x20description','isRealtime','allColumns','id_stitching','test','YAML\x20config\x20missing\x20required\x20field:\x20master','join','table','customer_group:','workflowHiveOnly','description','engine:','list','floor','parentColumn','parse','child_key','master','realtime','time','groupingName','customerGroupBehaviors','name','rightValues','77aRsLxv','stringify','split','personalization_services\x20must\x20be\x20an\x20array','423214cneNlV','has','hive_only','replace','all_columns',']:\x20Missing\x20required\x20field\x20\x27name\x27','620068kPpwIV','parentTableName','values','single','):\x20Invalid\x20type\x20\x27','push','attributes:','null','string','label','source','daily','attributes','personalization_services[','defaultTimeFilterEnabled','customerGroupAttributes','map','hive_pool','primary_key','columnName'];a148_0x21a6=function(){return _0x17a1ca;};return a148_0x21a6();}(function(_0xd21e96,_0x215e79){const _0x596cb5=a148_0x3683,_0x278c74=_0xd21e96();while(!![]){try{const _0x5755aa=-parseInt(_0x596cb5(0x156))/0x1*(-parseInt(_0x596cb5(0x142))/0x2)+-parseInt(_0x596cb5(0x11c))/0x3+-parseInt(_0x596cb5(0x15b))/0x4*(parseInt(_0x596cb5(0x114))/0x5)+parseInt(_0x596cb5(0x15a))/0x6*(-parseInt(_0x596cb5(0x138))/0x7)+parseInt(_0x596cb5(0x164))/0x8*(parseInt(_0x596cb5(0x16c))/0x9)+parseInt(_0x596cb5(0x119))/0xa+-parseInt(_0x596cb5(0x13c))/0xb;if(_0x5755aa===_0x215e79)break;else _0x278c74['push'](_0x278c74['shift']());}catch(_0x35c494){_0x278c74['push'](_0x278c74['shift']());}}}(a148_0x21a6,0x52873));import*as a148_0x1f57b8 from'yaml';function formatScheduleTime(_0x4cce69){const _0x427a80=a148_0x3683;if(typeof _0x4cce69===_0x427a80(0x168)){const _0x220f2a=Math[_0x427a80(0x12d)](_0x4cce69);return String(_0x220f2a)['padStart'](0x2,'0')+_0x427a80(0x174);}if(typeof _0x4cce69===_0x427a80(0x14a)){if(/^\d{2}:\d{2}:\d{2}$/[_0x427a80(0x124)](_0x4cce69))return _0x4cce69;if(/^\d{1,2}:\d{2}$/['test'](_0x4cce69)){const [_0x44e37d,_0x2fc1ff]=_0x4cce69[_0x427a80(0x13a)](':');return _0x44e37d[_0x427a80(0x17c)](0x2,'0')+':'+_0x2fc1ff+_0x427a80(0x177);}const _0xe1424c=parseInt(_0x4cce69,0xa);if(!isNaN(_0xe1424c)&&_0x4cce69[_0x427a80(0x16d)](/^\d+$/))return String(_0xe1424c)[_0x427a80(0x17c)](0x2,'0')+_0x427a80(0x174);return _0x4cce69;}return String(_0x4cce69);}export function apiToDef(_0x1e6d5f){const _0xa19b49=a148_0x3683,_0x284f0a={'database':_0x1e6d5f[_0xa19b49(0x131)]?.[_0xa19b49(0x117)]||'','table':_0x1e6d5f['master']?.[_0xa19b49(0x143)]||''};_0x1e6d5f['audienceFilters']&&_0x1e6d5f[_0xa19b49(0x112)][_0xa19b49(0x161)]>0x0&&(_0x284f0a['filters']=_0x1e6d5f[_0xa19b49(0x112)]['map'](_0x1ed4f1=>({'column':_0x1ed4f1[_0xa19b49(0x155)],'values':_0x1ed4f1[_0xa19b49(0x137)]})));let _0x277281;_0x1e6d5f['scheduleType']&&_0x1e6d5f['scheduleType']!==_0xa19b49(0x17d)&&(_0x277281={'type':_0x1e6d5f['scheduleType']},_0x1e6d5f[_0xa19b49(0x11f)]&&(_0x277281[_0xa19b49(0x133)]=formatScheduleTime(_0x1e6d5f[_0xa19b49(0x11f)])),_0x1e6d5f[_0xa19b49(0x163)]&&(_0x277281[_0xa19b49(0x163)]=_0x1e6d5f[_0xa19b49(0x163)]));let _0x142768;(_0x1e6d5f['workflowHiveOnly']||_0x1e6d5f[_0xa19b49(0x15d)]||_0x1e6d5f[_0xa19b49(0x16a)])&&(_0x142768={},_0x1e6d5f[_0xa19b49(0x129)]&&(_0x142768[_0xa19b49(0x13e)]=_0x1e6d5f[_0xa19b49(0x129)]),_0x1e6d5f[_0xa19b49(0x15d)]&&(_0x142768[_0xa19b49(0x153)]=_0x1e6d5f[_0xa19b49(0x15d)]),_0x1e6d5f[_0xa19b49(0x16a)]&&(_0x142768[_0xa19b49(0x16e)]=_0x1e6d5f[_0xa19b49(0x16a)]));const _0x19021a=_0x1e6d5f[_0xa19b49(0x14e)]&&_0x1e6d5f[_0xa19b49(0x14e)][_0xa19b49(0x161)]>0x0?groupAttributesBySource(_0x1e6d5f['attributes']):undefined,_0x440a3d=_0x1e6d5f['behaviors']&&_0x1e6d5f[_0xa19b49(0x11a)][_0xa19b49(0x161)]>0x0?_0x1e6d5f[_0xa19b49(0x11a)][_0xa19b49(0x152)](convertApiBehaviorToYaml):undefined;let _0x2c5f50;_0x1e6d5f['customerGroup']&&(_0x2c5f50={'name':_0x1e6d5f[_0xa19b49(0x11b)]['name'],'source':{'database':_0x1e6d5f['customerGroup'][_0xa19b49(0x117)],'table':_0x1e6d5f[_0xa19b49(0x11b)][_0xa19b49(0x143)]},'join':{'parent_key':_0x1e6d5f[_0xa19b49(0x11b)]['foreignKey'],'child_key':_0x1e6d5f['customerGroup']['parentKey']}},_0x1e6d5f[_0xa19b49(0x11b)][_0xa19b49(0x151)]&&_0x1e6d5f[_0xa19b49(0x11b)][_0xa19b49(0x151)]['length']>0x0&&(_0x2c5f50['attributes']=groupAttributesBySource(_0x1e6d5f[_0xa19b49(0x11b)]['customerGroupAttributes'])),_0x1e6d5f[_0xa19b49(0x11b)]['customerGroupBehaviors']&&_0x1e6d5f[_0xa19b49(0x11b)][_0xa19b49(0x135)][_0xa19b49(0x161)]>0x0&&(_0x2c5f50[_0xa19b49(0x11a)]=_0x1e6d5f['customerGroup']['customerGroupBehaviors'][_0xa19b49(0x152)](convertApiBehaviorToYaml)));const _0x18ec26={'name':_0x1e6d5f[_0xa19b49(0x136)],..._0x1e6d5f[_0xa19b49(0x12a)]&&{'description':_0x1e6d5f[_0xa19b49(0x12a)]},'master':_0x284f0a,..._0x277281&&{'schedule':_0x277281},..._0x142768&&{'engine':_0x142768},..._0x19021a&&{'attributes':_0x19021a},..._0x440a3d&&{'behaviors':_0x440a3d},..._0x2c5f50&&{'customer_group':_0x2c5f50}};return _0x18ec26;}function groupAttributesBySource(_0x1e649c){const _0x3c0fe8=a148_0x3683,_0x5b4a0f=new Map();for(const _0x55122b of _0x1e649c){const _0x2e8be8=_0x55122b[_0x3c0fe8(0x117)]+'.'+_0x55122b[_0x3c0fe8(0x143)]+'.'+_0x55122b[_0x3c0fe8(0x166)]+'.'+_0x55122b[_0x3c0fe8(0x159)];!_0x5b4a0f[_0x3c0fe8(0x13d)](_0x2e8be8)&&_0x5b4a0f[_0x3c0fe8(0x116)](_0x2e8be8,[]),_0x5b4a0f['get'](_0x2e8be8)[_0x3c0fe8(0x147)](_0x55122b);}const _0x553d2b=[];for(const [,_0x3b62f1]of _0x5b4a0f){const _0x249023=_0x3b62f1[0x0],_0x45b037=_0x249023[_0x3c0fe8(0x134)]||_0x249023[_0x3c0fe8(0x143)];_0x553d2b['push']({'name':_0x45b037,'source':{'database':_0x249023[_0x3c0fe8(0x117)],'table':_0x249023[_0x3c0fe8(0x143)]},'join':{'parent_key':_0x249023[_0x3c0fe8(0x159)],'child_key':_0x249023[_0x3c0fe8(0x166)]},'columns':_0x3b62f1[_0x3c0fe8(0x152)](_0x473892=>{const _0x573114=_0x3c0fe8,_0x229513={'column':_0x473892['parentColumn'],'type':_0x473892['type']};return _0x473892['name']!==_0x473892[_0x573114(0x12e)]&&(_0x229513['label']=_0x473892[_0x573114(0x136)]),_0x229513;})});}return _0x553d2b;}function convertApiBehaviorToYaml(_0x8659f){const _0x41c0c6=a148_0x3683,_0x349d6a={'name':_0x8659f[_0x41c0c6(0x136)],'source':{'database':_0x8659f[_0x41c0c6(0x117)],'table':_0x8659f[_0x41c0c6(0x143)]},'join':{'parent_key':_0x8659f[_0x41c0c6(0x159)],'child_key':_0x8659f[_0x41c0c6(0x166)]}};if(_0x8659f[_0x41c0c6(0x122)])_0x349d6a[_0x41c0c6(0x140)]=!![];else _0x8659f[_0x41c0c6(0x15c)]&&_0x8659f['schema'][_0x41c0c6(0x161)]>0x0&&(_0x349d6a[_0x41c0c6(0x171)]=_0x8659f[_0x41c0c6(0x15c)]['map'](_0x2f5fd2=>{const _0x467d48=_0x41c0c6,_0x37c6ad={'column':_0x2f5fd2[_0x467d48(0x12e)],'type':_0x2f5fd2[_0x467d48(0x165)]};return _0x2f5fd2[_0x467d48(0x136)]!==_0x2f5fd2[_0x467d48(0x12e)]&&(_0x37c6ad[_0x467d48(0x14b)]=_0x2f5fd2[_0x467d48(0x136)]),_0x37c6ad;}));return _0x8659f[_0x41c0c6(0x150)]&&(_0x349d6a['default_time_filter']=_0x8659f[_0x41c0c6(0x150)]),_0x8659f[_0x41c0c6(0x121)]&&(_0x349d6a[_0x41c0c6(0x132)]=_0x8659f[_0x41c0c6(0x121)]),_0x349d6a;}export function defToApi(_0x6321ce){const _0x4a3fc6=a148_0x3683,_0x43396d={'name':_0x6321ce['name'],'master':{'parentDatabaseName':_0x6321ce[_0x4a3fc6(0x131)][_0x4a3fc6(0x118)],'parentTableName':_0x6321ce[_0x4a3fc6(0x131)][_0x4a3fc6(0x127)]}};_0x6321ce[_0x4a3fc6(0x12a)]&&(_0x43396d[_0x4a3fc6(0x12a)]=_0x6321ce[_0x4a3fc6(0x12a)]);_0x6321ce[_0x4a3fc6(0x131)][_0x4a3fc6(0x111)]&&_0x6321ce[_0x4a3fc6(0x131)][_0x4a3fc6(0x111)][_0x4a3fc6(0x161)]>0x0&&(_0x43396d['audienceFilters']=_0x6321ce['master']['filters'][_0x4a3fc6(0x152)](_0x187eb6=>({'columnName':_0x187eb6[_0x4a3fc6(0x113)],'rightValues':_0x187eb6[_0x4a3fc6(0x144)]})));_0x6321ce[_0x4a3fc6(0x10f)]&&(_0x43396d[_0x4a3fc6(0x17b)]=_0x6321ce[_0x4a3fc6(0x10f)]['type'],_0x6321ce[_0x4a3fc6(0x10f)][_0x4a3fc6(0x133)]&&(_0x43396d['scheduleOption']=_0x6321ce[_0x4a3fc6(0x10f)]['time']),_0x6321ce[_0x4a3fc6(0x10f)][_0x4a3fc6(0x163)]&&(_0x43396d[_0x4a3fc6(0x163)]=_0x6321ce['schedule']['timezone']));_0x6321ce[_0x4a3fc6(0x17f)]&&(_0x6321ce['engine'][_0x4a3fc6(0x13e)]!==undefined&&(_0x43396d[_0x4a3fc6(0x129)]=_0x6321ce[_0x4a3fc6(0x17f)][_0x4a3fc6(0x13e)]),_0x6321ce[_0x4a3fc6(0x17f)][_0x4a3fc6(0x153)]!==undefined&&(_0x43396d[_0x4a3fc6(0x15d)]=_0x6321ce[_0x4a3fc6(0x17f)][_0x4a3fc6(0x153)]),_0x6321ce[_0x4a3fc6(0x17f)][_0x4a3fc6(0x16e)]!==undefined&&(_0x43396d[_0x4a3fc6(0x16a)]=_0x6321ce[_0x4a3fc6(0x17f)][_0x4a3fc6(0x16e)]));_0x6321ce['attributes']&&_0x6321ce[_0x4a3fc6(0x14e)][_0x4a3fc6(0x161)]>0x0&&(_0x43396d['attributes']=flattenAttributeGroups(_0x6321ce[_0x4a3fc6(0x14e)]));_0x6321ce[_0x4a3fc6(0x11a)]&&_0x6321ce[_0x4a3fc6(0x11a)][_0x4a3fc6(0x161)]>0x0&&(_0x43396d['behaviors']=_0x6321ce[_0x4a3fc6(0x11a)][_0x4a3fc6(0x152)](convertDefBehaviorToApi));if(_0x6321ce['customer_group']){const _0x133725=_0x6321ce[_0x4a3fc6(0x11d)];_0x43396d['customerGroup']={'name':_0x133725[_0x4a3fc6(0x136)],'parentDatabaseName':_0x133725[_0x4a3fc6(0x14c)]['database'],'parentTableName':_0x133725[_0x4a3fc6(0x14c)][_0x4a3fc6(0x127)],'parentKey':_0x133725['join'][_0x4a3fc6(0x130)],'foreignKey':_0x133725[_0x4a3fc6(0x126)][_0x4a3fc6(0x115)]},_0x133725[_0x4a3fc6(0x14e)]&&_0x133725['attributes']['length']>0x0&&(_0x43396d[_0x4a3fc6(0x11b)]['customerGroupAttributes']=flattenAttributeGroups(_0x133725[_0x4a3fc6(0x14e)])['map'](_0x304939=>({'name':_0x304939[_0x4a3fc6(0x136)],'type':_0x304939['type'],'parentDatabaseName':_0x304939[_0x4a3fc6(0x117)],'parentTableName':_0x304939[_0x4a3fc6(0x143)],'parentColumn':_0x304939['parentColumn'],'parentKey':_0x304939[_0x4a3fc6(0x166)],'foreignKey':_0x304939[_0x4a3fc6(0x159)]}))),_0x133725[_0x4a3fc6(0x11a)]&&_0x133725['behaviors'][_0x4a3fc6(0x161)]>0x0&&(_0x43396d['customerGroup']['customerGroupBehaviors']=_0x133725['behaviors']['map'](_0x9d34c6=>({'name':_0x9d34c6[_0x4a3fc6(0x136)],'parentDatabaseName':_0x9d34c6[_0x4a3fc6(0x14c)][_0x4a3fc6(0x118)],'parentTableName':_0x9d34c6[_0x4a3fc6(0x14c)][_0x4a3fc6(0x127)],'parentKey':_0x9d34c6[_0x4a3fc6(0x126)]['child_key'],'foreignKey':_0x9d34c6[_0x4a3fc6(0x126)]['parent_key'],'allColumns':_0x9d34c6[_0x4a3fc6(0x140)],'schema':_0x9d34c6[_0x4a3fc6(0x171)]?.[_0x4a3fc6(0x152)](_0x2e426a=>({'name':_0x2e426a[_0x4a3fc6(0x14b)]||_0x2e426a[_0x4a3fc6(0x113)],'type':_0x2e426a[_0x4a3fc6(0x165)],'parentColumn':_0x2e426a[_0x4a3fc6(0x113)]}))})));}return _0x43396d;}function flattenAttributeGroups(_0x4d6bdf){const _0x54dae8=a148_0x3683,_0x45e258=[];for(const _0x1abf11 of _0x4d6bdf){for(const _0x143153 of _0x1abf11[_0x54dae8(0x171)]){_0x45e258[_0x54dae8(0x147)]({'name':_0x143153[_0x54dae8(0x14b)]||_0x143153['column'],'type':_0x143153[_0x54dae8(0x165)],'parentDatabaseName':_0x1abf11[_0x54dae8(0x14c)][_0x54dae8(0x118)],'parentTableName':_0x1abf11['source'][_0x54dae8(0x127)],'parentColumn':_0x143153['column'],'parentKey':_0x1abf11[_0x54dae8(0x126)][_0x54dae8(0x130)],'foreignKey':_0x1abf11['join']['parent_key'],'groupingName':_0x1abf11[_0x54dae8(0x136)]});}}return _0x45e258;}function convertDefBehaviorToApi(_0x4b7499){const _0xc7ebfd=a148_0x3683,_0xd68e70={'name':_0x4b7499[_0xc7ebfd(0x136)],'parentDatabaseName':_0x4b7499[_0xc7ebfd(0x14c)][_0xc7ebfd(0x118)],'parentTableName':_0x4b7499[_0xc7ebfd(0x14c)][_0xc7ebfd(0x127)],'parentKey':_0x4b7499['join'][_0xc7ebfd(0x130)],'foreignKey':_0x4b7499[_0xc7ebfd(0x126)]['parent_key']};if(_0x4b7499[_0xc7ebfd(0x140)])_0xd68e70[_0xc7ebfd(0x122)]=!![];else _0x4b7499[_0xc7ebfd(0x171)]&&_0x4b7499[_0xc7ebfd(0x171)][_0xc7ebfd(0x161)]>0x0&&(_0xd68e70[_0xc7ebfd(0x15c)]=_0x4b7499[_0xc7ebfd(0x171)][_0xc7ebfd(0x152)](_0x4af16f=>({'name':_0x4af16f[_0xc7ebfd(0x14b)]||_0x4af16f[_0xc7ebfd(0x113)],'type':_0x4af16f[_0xc7ebfd(0x165)],'parentColumn':_0x4af16f[_0xc7ebfd(0x113)]})));return _0x4b7499[_0xc7ebfd(0x170)]!==undefined&&(_0xd68e70[_0xc7ebfd(0x150)]=_0x4b7499[_0xc7ebfd(0x170)]),_0x4b7499[_0xc7ebfd(0x132)]!==undefined&&(_0xd68e70[_0xc7ebfd(0x121)]=_0x4b7499['realtime']),_0xd68e70;}export function serializeDef(_0x1afb92){const _0x351629=a148_0x3683,_0x31dcaf=JSON[_0x351629(0x12f)](JSON[_0x351629(0x139)](_0x1afb92)),_0x55ec1b=a148_0x1f57b8[_0x351629(0x139)](_0x31dcaf,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x351629(0x149)}),_0x10f9d0=[_0x351629(0x176),_0x351629(0x15e),_0x351629(0x12b),_0x351629(0x148),'behaviors:',_0x351629(0x128),_0x351629(0x15f),_0x351629(0x160)];let _0x2b08e=_0x55ec1b;for(const _0x172891 of _0x10f9d0){_0x2b08e=_0x2b08e[_0x351629(0x13f)](new RegExp('^('+_0x172891+')','m'),(_0x1a293b,_0x28fa10,_0x5dd9e5)=>{if(_0x5dd9e5===0x0||_0x2b08e[_0x5dd9e5-0x1]==='\x0a'&&_0x2b08e[_0x5dd9e5-0x2]==='\x0a')return _0x28fa10;return'\x0a'+_0x28fa10;});}return _0x2b08e;}export function parseDef(_0x36ce5c){const _0x277e79=a148_0x3683,_0x54f1e6=a148_0x1f57b8['parse'](_0x36ce5c);if(!_0x54f1e6[_0x277e79(0x136)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x54f1e6['master'])throw new Error(_0x277e79(0x125));if(!_0x54f1e6['master']['database'])throw new Error(_0x277e79(0x16f));if(!_0x54f1e6[_0x277e79(0x131)][_0x277e79(0x127)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.table');return _0x54f1e6[_0x277e79(0x132)]&&validateRealtimeSection(_0x54f1e6[_0x277e79(0x132)]),_0x54f1e6[_0x277e79(0x17a)]&&validatePersonalizationServices(_0x54f1e6['personalization_services']),_0x54f1e6;}function validateRealtimeSection(_0x26223e){const _0x431441=a148_0x3683,_0x1711e8=[_0x431441(0x145),'counter','set',_0x431441(0x179),_0x431441(0x12c),'imported_batch'];_0x26223e[_0x431441(0x178)]&&Array[_0x431441(0x167)](_0x26223e[_0x431441(0x178)])&&_0x26223e[_0x431441(0x178)][_0x431441(0x162)]((_0x3276b8,_0x7d3e4d)=>{const _0x15fa26=_0x431441;if(!_0x3276b8[_0x15fa26(0x136)])throw new Error(_0x15fa26(0x158)+_0x7d3e4d+_0x15fa26(0x141));});_0x26223e[_0x431441(0x14e)]&&Array[_0x431441(0x167)](_0x26223e['attributes'])&&_0x26223e['attributes'][_0x431441(0x162)]((_0x959ebd,_0x39e7b1)=>{const _0x4e83f0=_0x431441;if(!_0x959ebd[_0x4e83f0(0x136)])throw new Error(_0x4e83f0(0x169)+_0x39e7b1+_0x4e83f0(0x141));if(_0x959ebd[_0x4e83f0(0x165)]&&!_0x1711e8[_0x4e83f0(0x110)](_0x959ebd['type']))throw new Error(_0x4e83f0(0x169)+_0x39e7b1+_0x4e83f0(0x172)+_0x959ebd['name']+_0x4e83f0(0x146)+_0x959ebd[_0x4e83f0(0x165)]+_0x4e83f0(0x17e)+_0x1711e8[_0x4e83f0(0x126)](',\x20'));});if(_0x26223e[_0x431441(0x123)]){if(!_0x26223e[_0x431441(0x123)][_0x431441(0x154)])throw new Error('realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27');}}function a148_0x3683(_0x1210c4,_0x36e185){_0x1210c4=_0x1210c4-0x10f;const _0x21a683=a148_0x21a6();let _0x36836c=_0x21a683[_0x1210c4];return _0x36836c;}function validatePersonalizationServices(_0xe13bd9){const _0x2a60e7=a148_0x3683;if(!Array['isArray'](_0xe13bd9))throw new Error(_0x2a60e7(0x13b));_0xe13bd9['forEach']((_0x556bed,_0x71a574)=>{const _0x4a64ee=_0x2a60e7;if(!_0x556bed[_0x4a64ee(0x136)])throw new Error(_0x4a64ee(0x14f)+_0x71a574+_0x4a64ee(0x141));});}export function generateTemplate(_0x5cedd2,_0x4f47f2,_0xf3e6cf){const _0xac6b90=a148_0x3683,_0x51741d={'name':_0x5cedd2,'description':_0xac6b90(0x120),'master':{'database':_0x4f47f2,'table':_0xf3e6cf},'schedule':{'type':_0xac6b90(0x14d),'time':_0xac6b90(0x175),'timezone':'UTC'},'attributes':[{'name':_0xac6b90(0x16b),'source':{'database':_0x4f47f2,'table':'attribute_table'},'join':{'parent_key':'id','child_key':'customer_id'},'columns':[{'column':_0xac6b90(0x157),'label':'Display\x20Name','type':_0xac6b90(0x14a)}]}],'behaviors':[{'name':_0xac6b90(0x173),'source':{'database':_0x4f47f2,'table':'events_table'},'join':{'parent_key':'user_id','child_key':_0xac6b90(0x11e)},'all_columns':!![]}]};return serializeDef(_0x51741d);}
|
|
@@ -1 +1 @@
|
|
|
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
|
+
(function(_0x16a2d6,_0xe5ceba){const _0x5efe43=a149_0x54f7,_0x12ee9e=_0x16a2d6();while(!![]){try{const _0x2c2bf4=parseInt(_0x5efe43(0x18d))/0x1+-parseInt(_0x5efe43(0x193))/0x2*(-parseInt(_0x5efe43(0x180))/0x3)+parseInt(_0x5efe43(0x19b))/0x4*(-parseInt(_0x5efe43(0x172))/0x5)+parseInt(_0x5efe43(0x1af))/0x6+-parseInt(_0x5efe43(0x1a6))/0x7+parseInt(_0x5efe43(0x18e))/0x8+-parseInt(_0x5efe43(0x185))/0x9;if(_0x2c2bf4===_0xe5ceba)break;else _0x12ee9e['push'](_0x12ee9e['shift']());}catch(_0xfc5d82){_0x12ee9e['push'](_0x12ee9e['shift']());}}}(a149_0x22c2,0x888f0));import a149_0x4501fa from'path';function a149_0x54f7(_0x11ddab,_0x563731){_0x11ddab=_0x11ddab-0x171;const _0x22c2ac=a149_0x22c2();let _0x54f773=_0x22c2ac[_0x11ddab];return _0x54f773;}import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a149_0x52c31f,normalizeJourneyDef,parseYamlString as a149_0x446224}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 a149_0x22c2(){const _0x8d4d99=['getActivation','tdx.json','toLowerCase','from','set','kind','push','rule','journeyBundleId','3OLvMvd','segments/','update','listFolders','folderId','19468350MIyyXM','getSegment','createdAt','updatedAt','data','.yml','relative','clear','1076661vXHxor','2703152KjoDlT','state','name','get','journeyBundleName','1703038fySHrL','description','buildIdToNameMap','versionNumber','utf-8','size','journey','getLatestJourneyId','9936znhDhL','user','paused','hasChanges','values','Fetching\x20segments,\x20folders,\x20and\x20journeys','Fetching\x20activations','audienceId','Warning:\x20Journey\x20','join','Fetching\x20parent\x20segment\x20info','982863cwTtfJ','isNew','activation_','slice','resolveParentId','length','Processing\x20journeys','sort','has','4788198SMbpLy','Processing\x20segments','attributes','all','Processing\x20journey:\x20','listJourneysWithDetailsFromParentSegment','map','listActivations','add','405MxakwZ','filter','segmentFolderId','segment','targetResourceName'];a149_0x22c2=function(){return _0x8d4d99;};return a149_0x22c2();}function prepareFile(_0x5b59ad,_0x139bcb,_0x167107){const _0x28a2b9=a149_0x54f7,_0xb7f634=a149_0x4501fa[_0x28a2b9(0x18b)](_0x167107,_0x5b59ad);if(existsSync(_0x5b59ad)){const _0x55444e=readFileSync(_0x5b59ad,'utf-8'),_0x52be26=generateDiff(_0x55444e,_0x139bcb),_0x58ee1d=hasChanges(_0x52be26);return{'relativePath':_0xb7f634,'absolutePath':_0x5b59ad,'content':_0x139bcb,'isNew':![],'hasChanges':_0x58ee1d,'diff':_0x58ee1d?formatDiffWithColors(_0x52be26):undefined};}return{'relativePath':_0xb7f634,'absolutePath':_0x5b59ad,'content':_0x139bcb,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x33b339,_0x3c0c0b,_0x322a1f){const _0x4f1860=a149_0x54f7,_0x61ba68=_0x33b339+':'+_0x3c0c0b,_0x494112=_0x322a1f['get'](_0x61ba68)||0x0;_0x322a1f[_0x4f1860(0x17b)](_0x61ba68,_0x494112+0x1);if(_0x494112===0x0)return _0x3c0c0b;return _0x3c0c0b+'_'+(_0x494112+0x1);}export async function pullSegments(_0x2aa2d5,_0x174cf7,_0x33bc55={}){const _0x285d36=a149_0x54f7,{targetDir:_0x4e9221,progress:_0x1e9310}=_0x33bc55;_0x1e9310?.[_0x285d36(0x182)]('Resolving\x20parent\x20segment');const _0x547078=await _0x2aa2d5[_0x285d36(0x175)][_0x285d36(0x1aa)](_0x174cf7);_0x1e9310?.[_0x285d36(0x182)](_0x285d36(0x1a5));const _0x506663=await _0x2aa2d5['segment']['getParent'](_0x547078),_0x5834e4=_0x506663[_0x285d36(0x1b1)][_0x285d36(0x190)];_0x1e9310?.['update'](_0x285d36(0x1a0));const [_0x5b9dc9,_0x36678b,_0x479860]=await Promise[_0x285d36(0x1b2)]([_0x2aa2d5[_0x285d36(0x175)]['listSegments'](_0x547078),_0x2aa2d5[_0x285d36(0x175)][_0x285d36(0x183)](_0x547078),_0x2aa2d5['journey'][_0x285d36(0x1b4)](_0x547078,{'includeAllVersions':!![]})]),{journeys:_0x34cf0d,activationStepsById:_0x17d9cd}=_0x479860,_0x29af03=new Map();for(const _0x5f24a1 of _0x34cf0d){_0x29af03['set'](_0x5f24a1['id'],_0x5f24a1);}const _0x3efb73=_0x34cf0d[_0x285d36(0x1b5)](_0x2d64fe=>({'id':_0x2d64fe['id'],'name':_0x2d64fe[_0x285d36(0x1b1)]['name'],'journeyBundleName':_0x2d64fe[_0x285d36(0x1b1)]['journeyBundleName']||'','journeyBundleId':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x17f)]||'','versionNumber':_0x2d64fe[_0x285d36(0x1b1)]['versionNumber'],'description':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x194)],'state':_0x2d64fe['attributes'][_0x285d36(0x18f)],'paused':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x19d)],'audienceId':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x1a2)],'folderId':_0x2d64fe['relationships']?.['parentFolder']?.[_0x285d36(0x189)]?.['id'],'createdAt':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x187)],'updatedAt':_0x2d64fe[_0x285d36(0x1b1)][_0x285d36(0x188)]})),_0x595ee3=buildFolderIdToPathMap(_0x36678b),_0x369660=_0x4e9221||_0x285d36(0x181)+sanitizeFileName(_0x5834e4);_0x1e9310?.['update'](_0x285d36(0x1a1));const _0x30489b=new Map();await batchAsync(_0x5b9dc9,async _0x30ff89=>{const _0x145216=_0x285d36,_0x15a4ae=await _0x2aa2d5[_0x145216(0x175)][_0x145216(0x1b6)](_0x547078,_0x30ff89['id']);_0x30489b[_0x145216(0x17b)](_0x30ff89['id'],_0x15a4ae);}),_0x1e9310?.[_0x285d36(0x182)]('Fetching\x20users\x20and\x20connections');const [_0x4f0cd6,_0x38ed7a]=await Promise[_0x285d36(0x1b2)]([_0x2aa2d5[_0x285d36(0x19c)]['buildIdToEmailMap'](),_0x2aa2d5['connection'][_0x285d36(0x195)]()]),_0x4bb726=[],_0x2e7163=new Map(),_0x2b2a4f=a149_0x4501fa[_0x285d36(0x1a4)](_0x369660,_0x285d36(0x178)),_0x3dfd1f=createTdxConfigContent(_0x5834e4);_0x4bb726['push'](prepareFile(_0x2b2a4f,_0x3dfd1f,_0x369660));const _0x1af509=new Map();for(const _0x29b288 of _0x5b9dc9){_0x1af509['set'](_0x29b288['id'],_0x29b288);}let _0x3dd718=_0x5b9dc9;if(_0x33bc55['targetResourceName']){const _0x4a2610=_0x5b9dc9[_0x285d36(0x173)](_0xdb573f=>_0xdb573f[_0x285d36(0x190)]['toLowerCase']()===_0x33bc55[_0x285d36(0x176)][_0x285d36(0x179)]());_0x4a2610[_0x285d36(0x1ab)]>0x0&&(_0x3dd718=_0x4a2610);}_0x1e9310?.['update'](_0x285d36(0x1b0));for(const _0x372cac of _0x3dd718){if(_0x372cac[_0x285d36(0x17c)]===SEGMENT_KIND_JOURNEY)continue;const _0x1ffaec=_0x372cac[_0x285d36(0x174)]?_0x595ee3[_0x285d36(0x191)](_0x372cac[_0x285d36(0x174)])||'':'',_0x2aacf2=_0x30489b[_0x285d36(0x191)](_0x372cac['id'])||[],_0x5683d1=segmentWithActivationsToYaml(_0x372cac,_0x2aacf2,undefined,_0x4f0cd6,_0x38ed7a),_0x56d92a=_0x1ffaec?a149_0x4501fa[_0x285d36(0x1a4)](_0x369660,_0x1ffaec):_0x369660,_0x51cc9b=sanitizeFileName(_0x372cac[_0x285d36(0x190)]),_0x1bc872=getUniqueFileName(_0x56d92a,_0x51cc9b,_0x2e7163),_0x17e0f0=a149_0x4501fa[_0x285d36(0x1a4)](_0x56d92a,_0x1bc872+_0x285d36(0x18a)),_0x3087a9=segmentToYamlString(_0x5683d1);_0x4bb726[_0x285d36(0x17d)](prepareFile(_0x17e0f0,_0x3087a9,_0x369660));}const _0x48ca67=new Map();for(const _0x4e012a of _0x3efb73){const _0x1fc498=_0x4e012a['journeyBundleId'];!_0x48ca67[_0x285d36(0x1ae)](_0x1fc498)&&_0x48ca67[_0x285d36(0x17b)](_0x1fc498,[]),_0x48ca67[_0x285d36(0x191)](_0x1fc498)[_0x285d36(0x17d)](_0x4e012a);}for(const _0x1d1476 of _0x48ca67[_0x285d36(0x19f)]()){_0x1d1476[_0x285d36(0x1ad)]((_0x26f18c,_0x396dc0)=>(_0x26f18c[_0x285d36(0x196)]||0x0)-(_0x396dc0['versionNumber']||0x0));}if(_0x33bc55[_0x285d36(0x176)]){const _0x2285eb=new Map();for(const [_0x1cda6f,_0x5861ce]of _0x48ca67){const _0x223a89=_0x5861ce[0x0][_0x285d36(0x192)];if(_0x223a89[_0x285d36(0x179)]()===_0x33bc55[_0x285d36(0x176)]['toLowerCase']()){_0x2285eb[_0x285d36(0x17b)](_0x1cda6f,_0x5861ce);break;}}_0x48ca67[_0x285d36(0x18c)]();for(const [_0xdd67b7,_0x26f6ee]of _0x2285eb){_0x48ca67[_0x285d36(0x17b)](_0xdd67b7,_0x26f6ee);}}if(_0x48ca67['size']>0x0){_0x1e9310?.[_0x285d36(0x182)](_0x285d36(0x1ac));const _0x444772=Array[_0x285d36(0x17a)](_0x48ca67[_0x285d36(0x19f)]()),_0xf91dfe=0x5,{createYamlContext:_0x112ce5}=createYamlContextForBundle(_0x2aa2d5,_0x1af509,_0x4f0cd6,_0x38ed7a,_0x17d9cd,_0x29af03);for(let _0x295e79=0x0;_0x295e79<_0x444772[_0x285d36(0x1ab)];_0x295e79+=_0xf91dfe){const _0x50647e=_0x444772[_0x285d36(0x1a9)](_0x295e79,_0x295e79+_0xf91dfe),_0x11fda1=await Promise[_0x285d36(0x1b2)](_0x50647e[_0x285d36(0x1b5)](async _0x1193d8=>{const _0x4d3549=_0x285d36,_0x479185=_0x1193d8[0x0],_0x48e7db=_0x479185[_0x4d3549(0x192)];_0x1e9310?.[_0x4d3549(0x182)](_0x4d3549(0x1b3)+_0x48e7db);const _0x41e167=_0x479185[_0x4d3549(0x184)]?_0x595ee3[_0x4d3549(0x191)](_0x479185[_0x4d3549(0x184)])||'':'',_0x137f2b=_0x41e167?a149_0x4501fa[_0x4d3549(0x1a4)](_0x369660,_0x41e167):_0x369660,_0x5b719e=sanitizeFileName(_0x48e7db),_0x13dfc7=a149_0x4501fa['join'](_0x137f2b,_0x5b719e+_0x4d3549(0x18a));let _0x5c7051;if(existsSync(_0x13dfc7))try{const _0x44bdc1=readFileSync(_0x13dfc7,_0x4d3549(0x197)),_0x74a001=a149_0x446224(_0x44bdc1);_0x5c7051=buildLocalRuleToNameMappingFromJourney(_0x74a001);}catch{}const _0x465ea0=[];for(const _0x2cdb03 of _0x1193d8){const _0x551309=_0x29af03['get'](_0x2cdb03['id']);if(!_0x551309){_0x1e9310?.[_0x4d3549(0x182)](_0x4d3549(0x1a3)+_0x2cdb03['id']+'\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping');continue;}const _0x2f308f=_0x551309[_0x4d3549(0x1b1)]?.[_0x4d3549(0x1a2)],_0xa7a2e5=_0x112ce5(_0x2cdb03['id'],_0x2f308f),_0x1c14dc=await journeyResponseToDef(_0x551309,_0xa7a2e5);_0x465ea0[_0x4d3549(0x17d)]({'item':_0x2cdb03,'yaml':_0x1c14dc});}const _0x1ded43=await _0x2aa2d5['journey'][_0x4d3549(0x19a)](_0x479185[_0x4d3549(0x17f)]),_0x201c81=buildMergedJourneyDef(_0x465ea0,_0x5c7051,_0x1ded43);return{'bundleName':_0x48e7db,'folderPath':_0x41e167,'finalYaml':_0x201c81};}));for(const {bundleName:_0x429fda,folderPath:_0x5f3a49,finalYaml:_0x3aba80}of _0x11fda1){const _0x5e8425=normalizeJourneyDef(_0x3aba80),_0x5a97df=a149_0x52c31f(_0x5e8425),_0x5dfe0a=_0x5f3a49?a149_0x4501fa['join'](_0x369660,_0x5f3a49):_0x369660,_0x24e871=sanitizeFileName(_0x429fda),_0x220c61=getUniqueFileName(_0x5dfe0a,_0x24e871,_0x2e7163),_0x11b41e=a149_0x4501fa[_0x285d36(0x1a4)](_0x5dfe0a,_0x220c61+_0x285d36(0x18a));_0x4bb726[_0x285d36(0x17d)](prepareFile(_0x11b41e,_0x5a97df,_0x369660));}}}const _0x23924a=Array['from'](_0x30489b['values']())['reduce']((_0x39e954,_0x112d0c)=>_0x39e954+_0x112d0c[_0x285d36(0x1ab)],0x0),_0x37639d=_0x3dd718[_0x285d36(0x173)](_0x4265cd=>_0x4265cd[_0x285d36(0x17c)]!==SEGMENT_KIND_JOURNEY),_0x5d3df6=_0x4bb726[_0x285d36(0x173)](_0x8393c9=>_0x8393c9[_0x285d36(0x1a7)])[_0x285d36(0x1ab)],_0x31b04d=_0x4bb726[_0x285d36(0x173)](_0x27b308=>!_0x27b308['isNew']&&_0x27b308['hasChanges'])['length'],_0x4651f1=_0x4bb726[_0x285d36(0x173)](_0x56d497=>!_0x56d497[_0x285d36(0x1a7)]&&!_0x56d497[_0x285d36(0x19e)])['length'],_0x4f4615=Array[_0x285d36(0x17a)](_0x48ca67[_0x285d36(0x19f)]())['reduce']((_0x1c7745,_0x343e5a)=>_0x1c7745+_0x343e5a['length'],0x0);return{'parentName':_0x5834e4,'parentId':_0x547078,'targetDir':_0x369660,'files':_0x4bb726,'counts':{'segments':_0x37639d[_0x285d36(0x1ab)],'journeys':_0x48ca67[_0x285d36(0x198)],'journeyVersions':_0x4f4615,'activations':_0x23924a},'newFiles':_0x5d3df6,'changedFiles':_0x31b04d,'unchangedFiles':_0x4651f1};}function createYamlContextForBundle(_0x22d8aa,_0x498c04,_0x16ff3c,_0x522767,_0x40248f,_0x5e48c7){const _0x168952=new Set(),_0x57a3c0=new Map(),_0x1b96e0=new Map(),_0x2c3a28=createJumpTargetCache(),_0x144c26=async(_0x2ffdc6,_0x5d79e2)=>{const _0x3cad76=a149_0x54f7,_0x4dd701=_0x57a3c0[_0x3cad76(0x191)](_0x2ffdc6);if(_0x4dd701!==undefined)return _0x4dd701;if(!_0x5d79e2)return _0x2ffdc6;try{let _0x123861=_0x498c04[_0x3cad76(0x191)](_0x2ffdc6);!_0x123861&&(_0x123861=await _0x22d8aa[_0x3cad76(0x175)][_0x3cad76(0x186)](_0x5d79e2,_0x2ffdc6),_0x498c04[_0x3cad76(0x17b)](_0x2ffdc6,_0x123861));const _0x2e453f=generateJourneyLocalName(_0x123861[_0x3cad76(0x190)]),_0x460619=_0x123861['kind']===SEGMENT_KIND_JOURNEY&&_0x2e453f!==undefined;if(_0x460619&&_0x2e453f){let _0x506a7a=_0x2e453f,_0x3b5be7=0x2;while(_0x168952['has'](_0x506a7a)){_0x506a7a=_0x2e453f+'_'+_0x3b5be7,_0x3b5be7++;}return _0x168952[_0x3cad76(0x171)](_0x506a7a),_0x57a3c0[_0x3cad76(0x17b)](_0x2ffdc6,_0x506a7a),_0x506a7a;}return _0x123861[_0x3cad76(0x190)];}catch{return _0x2ffdc6;}},_0x125a04=(_0x558140,_0x4c40e6)=>({'resolveSegment':async _0x474d46=>{const _0x15fab6=a149_0x54f7,_0x3bcd4d=_0x57a3c0['get'](_0x474d46);if(_0x3bcd4d!==undefined)return{'name':_0x3bcd4d,'isJourneyLocal':!![]};if(!_0x4c40e6)return{'name':_0x474d46,'isJourneyLocal':![]};try{let _0x52ef95=_0x498c04['get'](_0x474d46);!_0x52ef95&&(_0x52ef95=await _0x22d8aa['segment'][_0x15fab6(0x186)](_0x4c40e6,_0x474d46),_0x498c04[_0x15fab6(0x17b)](_0x474d46,_0x52ef95));const _0x63f5fa=generateJourneyLocalName(_0x52ef95[_0x15fab6(0x190)]),_0x3510ef=_0x52ef95[_0x15fab6(0x17c)]===SEGMENT_KIND_JOURNEY&&_0x63f5fa!==undefined;if(_0x3510ef&&!_0x52ef95[_0x15fab6(0x17e)]&&_0x4c40e6)try{const _0x4b1ff2=await _0x22d8aa[_0x15fab6(0x175)][_0x15fab6(0x186)](_0x4c40e6,_0x474d46);_0x498c04[_0x15fab6(0x17b)](_0x474d46,_0x4b1ff2),_0x52ef95=_0x4b1ff2;}catch{}const _0x55a5b8=await _0x144c26(_0x474d46,_0x4c40e6);let _0xaba9b5;if(_0x3510ef&&_0x52ef95[_0x15fab6(0x17e)]){const _0x1ac97e=await segmentResponseToDef(_0x52ef95,{'resolveSegmentName':_0x1f89b7=>_0x144c26(_0x1f89b7,_0x4c40e6)});_0xaba9b5={'description':_0x52ef95[_0x15fab6(0x194)],'rule':_0x1ac97e[_0x15fab6(0x17e)]};}return{'name':_0x55a5b8,'isJourneyLocal':_0x3510ef,'definition':_0xaba9b5};}catch{return{'name':_0x474d46,'isJourneyLocal':![]};}},'resolveActivation':async _0x305a8c=>{const _0xc372aa=a149_0x54f7,_0x3751ed=_0x1b96e0[_0xc372aa(0x191)](_0x305a8c);if(_0x3751ed!==undefined)return{'name':_0x3751ed,'isJourneyLocal':!![]};try{let _0x57f878=_0x40248f[_0xc372aa(0x191)](_0x305a8c);!_0x57f878&&(_0x57f878=await _0x22d8aa['journey'][_0xc372aa(0x177)](_0x558140,_0x305a8c));const _0x2bac9b=_0x57f878['attributes']['activationParams']['name']||_0x305a8c,_0x58a93c=sanitizeYamlKey(_0x2bac9b)||_0xc372aa(0x1a8)+_0x305a8c,_0x475a6a=_0x58a93c;_0x1b96e0[_0xc372aa(0x17b)](_0x305a8c,_0x475a6a);const _0x38eb30=journeyActivationStepToYaml(_0x57f878,_0x16ff3c,_0x522767);return{'name':_0x475a6a,'isJourneyLocal':!![],'definition':_0x38eb30};}catch{return{'name':_0x305a8c,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4e6c6f,_0xa6e4b2)=>resolveJumpTarget(_0x4e6c6f,_0xa6e4b2,_0x2c3a28,async _0xb183b2=>{const _0x316afe=a149_0x54f7,_0x7bd2a2=_0x5e48c7['get'](_0xb183b2);if(_0x7bd2a2)return _0x7bd2a2;return _0x22d8aa[_0x316afe(0x199)]['getJourney'](_0xb183b2);})});return{'createYamlContext':_0x125a04};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
const a150_0x595e7f=a150_0x2041;(function(_0x4eaede,_0x38296f){const _0x2f7b6f=a150_0x2041,_0x16ebfe=_0x4eaede();while(!![]){try{const _0x16d5d1=-parseInt(_0x2f7b6f(0x119))/0x1+parseInt(_0x2f7b6f(0x106))/0x2*(-parseInt(_0x2f7b6f(0x114))/0x3)+parseInt(_0x2f7b6f(0x113))/0x4+-parseInt(_0x2f7b6f(0x10e))/0x5*(-parseInt(_0x2f7b6f(0x10a))/0x6)+-parseInt(_0x2f7b6f(0x109))/0x7*(-parseInt(_0x2f7b6f(0x110))/0x8)+parseInt(_0x2f7b6f(0x10c))/0x9*(parseInt(_0x2f7b6f(0x11d))/0xa)+parseInt(_0x2f7b6f(0x118))/0xb;if(_0x16d5d1===_0x38296f)break;else _0x16ebfe['push'](_0x16ebfe['shift']());}catch(_0x5246d8){_0x16ebfe['push'](_0x16ebfe['shift']());}}}(a150_0x435c,0x665dd));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a150_0x11ea79 from'path';function a150_0x435c(){const _0x9a2798=['join','dirname','14yqjfTZ','13722bbcNgy','journeyName','1633779YOvWob','ENOENT','85TUiKUg','.push-recovery.json','108232OIrioG','toISOString','segments','1729404PuYWEn','3hzPUhb','string','debug','warn','1946890bvwgUU','421266kthDfL','utf-8','stringify','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','40rFMMht','version','basename','code','tdx.sdk.push-recovery','1121686STRYSd'];a150_0x435c=function(){return _0x9a2798;};return a150_0x435c();}import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a150_0x595e7f(0x105));export function getPushRecoveryPath(_0x3aa4f4){const _0x377926=a150_0x595e7f,_0x87f830=a150_0x11ea79[_0x377926(0x108)](_0x3aa4f4),_0x5c7304=a150_0x11ea79[_0x377926(0x103)](_0x3aa4f4);return a150_0x11ea79[_0x377926(0x107)](_0x87f830,'.'+_0x5c7304+_0x377926(0x10f));}export function readPushRecovery(_0x5a2c3f){const _0x3622c2=a150_0x595e7f,_0x1f72cd=getPushRecoveryPath(_0x5a2c3f);if(!existsSync(_0x1f72cd))return undefined;try{const _0x46d306=readFileSync(_0x1f72cd,_0x3622c2(0x11a)),_0x18f759=JSON['parse'](_0x46d306);if(_0x18f759?.[_0x3622c2(0x102)]!==0x1||typeof _0x18f759[_0x3622c2(0x10b)]!==_0x3622c2(0x115))return undefined;return _0x18f759;}catch(_0x3d0e27){return _0x3d0e27 instanceof SyntaxError?logger[_0x3622c2(0x116)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x3d0e27):logger[_0x3622c2(0x117)](_0x3622c2(0x11c)+_0x3d0e27),undefined;}}export function writePushRecovery(_0x3a55e7,_0x423305){const _0x146f20=a150_0x595e7f,_0x3c6e69=getPushRecoveryPath(_0x3a55e7),_0x3bd842=_0x3c6e69+'.tmp';writeFileSync(_0x3bd842,JSON[_0x146f20(0x11b)](_0x423305,null,0x2)+'\x0a',_0x146f20(0x11a)),renameSync(_0x3bd842,_0x3c6e69);}export function deletePushRecovery(_0xb8f8fe){const _0x3f8652=a150_0x595e7f,_0xec21aa=getPushRecoveryPath(_0xb8f8fe);try{unlinkSync(_0xec21aa);}catch(_0x172694){_0x172694[_0x3f8652(0x104)]!==_0x3f8652(0x10d)&&logger['debug']('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x172694);}}function a150_0x2041(_0x5e9d07,_0x5dc5be){_0x5e9d07=_0x5e9d07-0x102;const _0x435ccb=a150_0x435c();let _0x204168=_0x435ccb[_0x5e9d07];return _0x204168;}export function saveSegmentToPushRecovery(_0x20530e,_0xbe48cf,_0xe60124,_0x1a12ec){const _0x525842=a150_0x595e7f,_0x43dfd0=readPushRecovery(_0x20530e),_0x21c354=_0x43dfd0?.['journeyName']===_0xbe48cf?{..._0x43dfd0,'updatedAt':new Date()[_0x525842(0x111)]()}:{'version':0x1,'journeyName':_0xbe48cf,'updatedAt':new Date()[_0x525842(0x111)](),'segments':{}};_0x21c354[_0x525842(0x112)][_0xe60124]=_0x1a12ec,writePushRecovery(_0x20530e,_0x21c354);}
|