@treasuredata/tdx 2026.3.51 → 2026.3.53
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.d.ts.map +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tools/index.d.ts +2 -0
- package/dist/mcp/tools/index.d.ts.map +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/index.js.map +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.d.ts +50 -0
- package/dist/mcp/tools/work-create-item.d.ts.map +1 -0
- package/dist/mcp/tools/work-create-item.js +1 -0
- package/dist/mcp/tools/work-create-item.js.map +1 -0
- 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.d.ts +15 -0
- package/dist/sdk/types/workspace.d.ts.map +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.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.d.ts +14 -2
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.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(_0x7b9800,_0x4980fd){const _0x4e9392=a148_0x326f,_0x1fadef=_0x7b9800();while(!![]){try{const _0x357272=-parseInt(_0x4e9392(0xe5))/0x1+parseInt(_0x4e9392(0xfa))/0x2+-parseInt(_0x4e9392(0x131))/0x3*(-parseInt(_0x4e9392(0xf2))/0x4)+-parseInt(_0x4e9392(0xfd))/0x5+-parseInt(_0x4e9392(0x112))/0x6+-parseInt(_0x4e9392(0xee))/0x7+parseInt(_0x4e9392(0x101))/0x8;if(_0x357272===_0x4980fd)break;else _0x1fadef['push'](_0x1fadef['shift']());}catch(_0x222e36){_0x1fadef['push'](_0x1fadef['shift']());}}}(a148_0xd3ac,0x45974));function a148_0x326f(_0xd7eada,_0x15739d){_0xd7eada=_0xd7eada-0xc8;const _0xd3ac7=a148_0xd3ac();let _0x326f8=_0xd3ac7[_0xd7eada];return _0x326f8;}import*as a148_0x3ddf14 from'yaml';function a148_0xd3ac(){const _0x5b7520=['id_stitching','YAML\x20config\x20missing\x20required\x20field:\x20master.table','1729847cDZvwj','database','match','number','4jhYLkm','source','string','column','padStart','realtime:','attribute_table','columnName','506134DIXOTM',':00','customerGroupAttributes','677645CUROcQ','prestoPoolName','name','hivePoolName','7463056iShgVL','includes','null','schedule','columns','defaultTimeFilterEnabled','trino_pool','filters','foreignKey','YAML\x20config\x20missing\x20required\x20field:\x20master','imported_batch','realtime.events[','Example\x20Events','personalization_services','split',':00:00','hive_pool','2090874ncubJD','parentDatabaseName','floor','scheduleOption','workflowHiveOnly','replace','behaviors','engine','scheduleType','isRealtime','isArray','personalization_services\x20must\x20be\x20an\x20array','customerGroup','timezone','user_id','customerGroupBehaviors','length','table','default_time_filter','groupingName','daily','engine:','master:','allColumns','stringify','push','parentKey','Example\x20Attributes','Display\x20Name','join','rightValues','137388hZkAqb','customer_group:','):\x20Invalid\x20type\x20\x27','map','set','customer_id','list','\x27.\x20Must\x20be\x20one\x20of:\x20','parentTableName','parent_key','personalization_services:','audienceFilters','Parent\x20segment\x20description','realtime','label','child_key','time','realtime.attributes[','events_table','attributes','attributes:','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','counter','YAML\x20config\x20missing\x20required\x20field:\x20master.database','hive_only','type','has','none','values','schema','behaviors:','test','parentColumn','forEach',']:\x20Missing\x20required\x20field\x20\x27name\x27','215572PihNgk','all_columns','events','master','primary_key','single','description'];a148_0xd3ac=function(){return _0x5b7520;};return a148_0xd3ac();}function formatScheduleTime(_0x1fc2b7){const _0x9e8e3a=a148_0x326f;if(typeof _0x1fc2b7===_0x9e8e3a(0xf1)){const _0xb02b7a=Math[_0x9e8e3a(0x114)](_0x1fc2b7);return String(_0xb02b7a)[_0x9e8e3a(0xf6)](0x2,'0')+_0x9e8e3a(0x110);}if(typeof _0x1fc2b7===_0x9e8e3a(0xf4)){if(/^\d{2}:\d{2}:\d{2}$/[_0x9e8e3a(0xe1)](_0x1fc2b7))return _0x1fc2b7;if(/^\d{1,2}:\d{2}$/[_0x9e8e3a(0xe1)](_0x1fc2b7)){const [_0x168795,_0x552d9b]=_0x1fc2b7[_0x9e8e3a(0x10f)](':');return _0x168795[_0x9e8e3a(0xf6)](0x2,'0')+':'+_0x552d9b+_0x9e8e3a(0xfb);}const _0x2b5fa0=parseInt(_0x1fc2b7,0xa);if(!isNaN(_0x2b5fa0)&&_0x1fc2b7[_0x9e8e3a(0xf0)](/^\d+$/))return String(_0x2b5fa0)[_0x9e8e3a(0xf6)](0x2,'0')+_0x9e8e3a(0x110);return _0x1fc2b7;}return String(_0x1fc2b7);}export function apiToDef(_0x4abe1e){const _0x4f57d9=a148_0x326f,_0x392c07={'database':_0x4abe1e[_0x4f57d9(0xe8)]?.[_0x4f57d9(0x113)]||'','table':_0x4abe1e[_0x4f57d9(0xe8)]?.[_0x4f57d9(0xca)]||''};_0x4abe1e[_0x4f57d9(0xcd)]&&_0x4abe1e['audienceFilters'][_0x4f57d9(0x122)]>0x0&&(_0x392c07[_0x4f57d9(0x108)]=_0x4abe1e[_0x4f57d9(0xcd)][_0x4f57d9(0x134)](_0x573390=>({'column':_0x573390[_0x4f57d9(0xf9)],'values':_0x573390[_0x4f57d9(0x130)]})));let _0x5077a4;_0x4abe1e['scheduleType']&&_0x4abe1e[_0x4f57d9(0x11a)]!==_0x4f57d9(0xdd)&&(_0x5077a4={'type':_0x4abe1e[_0x4f57d9(0x11a)]},_0x4abe1e[_0x4f57d9(0x115)]&&(_0x5077a4['time']=formatScheduleTime(_0x4abe1e['scheduleOption'])),_0x4abe1e[_0x4f57d9(0x11f)]&&(_0x5077a4[_0x4f57d9(0x11f)]=_0x4abe1e[_0x4f57d9(0x11f)]));let _0x245443;(_0x4abe1e[_0x4f57d9(0x116)]||_0x4abe1e['hivePoolName']||_0x4abe1e[_0x4f57d9(0xfe)])&&(_0x245443={},_0x4abe1e[_0x4f57d9(0x116)]&&(_0x245443['hive_only']=_0x4abe1e[_0x4f57d9(0x116)]),_0x4abe1e[_0x4f57d9(0x100)]&&(_0x245443[_0x4f57d9(0x111)]=_0x4abe1e[_0x4f57d9(0x100)]),_0x4abe1e[_0x4f57d9(0xfe)]&&(_0x245443['trino_pool']=_0x4abe1e[_0x4f57d9(0xfe)]));const _0x2f1a7a=_0x4abe1e[_0x4f57d9(0xd5)]&&_0x4abe1e['attributes'][_0x4f57d9(0x122)]>0x0?groupAttributesBySource(_0x4abe1e['attributes']):undefined,_0x4d7748=_0x4abe1e[_0x4f57d9(0x118)]&&_0x4abe1e[_0x4f57d9(0x118)]['length']>0x0?_0x4abe1e['behaviors']['map'](convertApiBehaviorToYaml):undefined;let _0x586d6b;_0x4abe1e[_0x4f57d9(0x11e)]&&(_0x586d6b={'name':_0x4abe1e['customerGroup'][_0x4f57d9(0xff)],'source':{'database':_0x4abe1e[_0x4f57d9(0x11e)]['parentDatabaseName'],'table':_0x4abe1e[_0x4f57d9(0x11e)]['parentTableName']},'join':{'parent_key':_0x4abe1e['customerGroup']['foreignKey'],'child_key':_0x4abe1e[_0x4f57d9(0x11e)][_0x4f57d9(0x12c)]}},_0x4abe1e[_0x4f57d9(0x11e)][_0x4f57d9(0xfc)]&&_0x4abe1e[_0x4f57d9(0x11e)][_0x4f57d9(0xfc)][_0x4f57d9(0x122)]>0x0&&(_0x586d6b[_0x4f57d9(0xd5)]=groupAttributesBySource(_0x4abe1e['customerGroup'][_0x4f57d9(0xfc)])),_0x4abe1e[_0x4f57d9(0x11e)][_0x4f57d9(0x121)]&&_0x4abe1e['customerGroup'][_0x4f57d9(0x121)][_0x4f57d9(0x122)]>0x0&&(_0x586d6b[_0x4f57d9(0x118)]=_0x4abe1e[_0x4f57d9(0x11e)][_0x4f57d9(0x121)]['map'](convertApiBehaviorToYaml)));const _0x25db97={'name':_0x4abe1e[_0x4f57d9(0xff)],..._0x4abe1e['description']&&{'description':_0x4abe1e[_0x4f57d9(0xeb)]},'master':_0x392c07,..._0x5077a4&&{'schedule':_0x5077a4},..._0x245443&&{'engine':_0x245443},..._0x2f1a7a&&{'attributes':_0x2f1a7a},..._0x4d7748&&{'behaviors':_0x4d7748},..._0x586d6b&&{'customer_group':_0x586d6b}};return _0x25db97;}function groupAttributesBySource(_0x41062){const _0xcd5b2e=a148_0x326f,_0x259779=new Map();for(const _0x1c37f9 of _0x41062){const _0x2dae9d=_0x1c37f9[_0xcd5b2e(0x113)]+'.'+_0x1c37f9[_0xcd5b2e(0xca)]+'.'+_0x1c37f9[_0xcd5b2e(0x12c)]+'.'+_0x1c37f9[_0xcd5b2e(0x109)];!_0x259779[_0xcd5b2e(0xdc)](_0x2dae9d)&&_0x259779[_0xcd5b2e(0x135)](_0x2dae9d,[]),_0x259779['get'](_0x2dae9d)['push'](_0x1c37f9);}const _0x2577cf=[];for(const [,_0x45496f]of _0x259779){const _0x4ec836=_0x45496f[0x0],_0x148441=_0x4ec836[_0xcd5b2e(0x125)]||_0x4ec836[_0xcd5b2e(0xca)];_0x2577cf[_0xcd5b2e(0x12b)]({'name':_0x148441,'source':{'database':_0x4ec836[_0xcd5b2e(0x113)],'table':_0x4ec836['parentTableName']},'join':{'parent_key':_0x4ec836[_0xcd5b2e(0x109)],'child_key':_0x4ec836[_0xcd5b2e(0x12c)]},'columns':_0x45496f[_0xcd5b2e(0x134)](_0x500bea=>{const _0x2b7871=_0xcd5b2e,_0x4d27da={'column':_0x500bea[_0x2b7871(0xe2)],'type':_0x500bea[_0x2b7871(0xdb)]};return _0x500bea[_0x2b7871(0xff)]!==_0x500bea[_0x2b7871(0xe2)]&&(_0x4d27da['label']=_0x500bea[_0x2b7871(0xff)]),_0x4d27da;})});}return _0x2577cf;}function convertApiBehaviorToYaml(_0x361beb){const _0xafcefe=a148_0x326f,_0x2377b5={'name':_0x361beb[_0xafcefe(0xff)],'source':{'database':_0x361beb[_0xafcefe(0x113)],'table':_0x361beb['parentTableName']},'join':{'parent_key':_0x361beb[_0xafcefe(0x109)],'child_key':_0x361beb['parentKey']}};if(_0x361beb[_0xafcefe(0x129)])_0x2377b5[_0xafcefe(0xe6)]=!![];else _0x361beb[_0xafcefe(0xdf)]&&_0x361beb[_0xafcefe(0xdf)][_0xafcefe(0x122)]>0x0&&(_0x2377b5[_0xafcefe(0x105)]=_0x361beb[_0xafcefe(0xdf)][_0xafcefe(0x134)](_0x790714=>{const _0x39b065=_0xafcefe,_0x86716={'column':_0x790714['parentColumn'],'type':_0x790714[_0x39b065(0xdb)]};return _0x790714[_0x39b065(0xff)]!==_0x790714[_0x39b065(0xe2)]&&(_0x86716[_0x39b065(0xd0)]=_0x790714[_0x39b065(0xff)]),_0x86716;}));return _0x361beb['defaultTimeFilterEnabled']&&(_0x2377b5[_0xafcefe(0x124)]=_0x361beb[_0xafcefe(0x106)]),_0x361beb[_0xafcefe(0x11b)]&&(_0x2377b5['realtime']=_0x361beb[_0xafcefe(0x11b)]),_0x2377b5;}export function defToApi(_0x102296){const _0x46d50a=a148_0x326f,_0x414a2e={'name':_0x102296['name'],'master':{'parentDatabaseName':_0x102296['master'][_0x46d50a(0xef)],'parentTableName':_0x102296[_0x46d50a(0xe8)]['table']}};_0x102296[_0x46d50a(0xeb)]&&(_0x414a2e[_0x46d50a(0xeb)]=_0x102296[_0x46d50a(0xeb)]);_0x102296[_0x46d50a(0xe8)][_0x46d50a(0x108)]&&_0x102296[_0x46d50a(0xe8)][_0x46d50a(0x108)][_0x46d50a(0x122)]>0x0&&(_0x414a2e[_0x46d50a(0xcd)]=_0x102296[_0x46d50a(0xe8)][_0x46d50a(0x108)][_0x46d50a(0x134)](_0x435f79=>({'columnName':_0x435f79[_0x46d50a(0xf5)],'rightValues':_0x435f79[_0x46d50a(0xde)]})));_0x102296['schedule']&&(_0x414a2e['scheduleType']=_0x102296[_0x46d50a(0x104)]['type'],_0x102296['schedule']['time']&&(_0x414a2e[_0x46d50a(0x115)]=_0x102296[_0x46d50a(0x104)][_0x46d50a(0xd2)]),_0x102296[_0x46d50a(0x104)]['timezone']&&(_0x414a2e[_0x46d50a(0x11f)]=_0x102296[_0x46d50a(0x104)][_0x46d50a(0x11f)]));_0x102296[_0x46d50a(0x119)]&&(_0x102296[_0x46d50a(0x119)][_0x46d50a(0xda)]!==undefined&&(_0x414a2e[_0x46d50a(0x116)]=_0x102296[_0x46d50a(0x119)][_0x46d50a(0xda)]),_0x102296[_0x46d50a(0x119)][_0x46d50a(0x111)]!==undefined&&(_0x414a2e[_0x46d50a(0x100)]=_0x102296[_0x46d50a(0x119)][_0x46d50a(0x111)]),_0x102296[_0x46d50a(0x119)][_0x46d50a(0x107)]!==undefined&&(_0x414a2e[_0x46d50a(0xfe)]=_0x102296[_0x46d50a(0x119)][_0x46d50a(0x107)]));_0x102296[_0x46d50a(0xd5)]&&_0x102296[_0x46d50a(0xd5)][_0x46d50a(0x122)]>0x0&&(_0x414a2e['attributes']=flattenAttributeGroups(_0x102296[_0x46d50a(0xd5)]));_0x102296[_0x46d50a(0x118)]&&_0x102296[_0x46d50a(0x118)][_0x46d50a(0x122)]>0x0&&(_0x414a2e[_0x46d50a(0x118)]=_0x102296[_0x46d50a(0x118)][_0x46d50a(0x134)](convertDefBehaviorToApi));if(_0x102296['customer_group']){const _0x2662b7=_0x102296['customer_group'];_0x414a2e[_0x46d50a(0x11e)]={'name':_0x2662b7['name'],'parentDatabaseName':_0x2662b7[_0x46d50a(0xf3)][_0x46d50a(0xef)],'parentTableName':_0x2662b7[_0x46d50a(0xf3)][_0x46d50a(0x123)],'parentKey':_0x2662b7[_0x46d50a(0x12f)][_0x46d50a(0xd1)],'foreignKey':_0x2662b7[_0x46d50a(0x12f)][_0x46d50a(0xcb)]},_0x2662b7[_0x46d50a(0xd5)]&&_0x2662b7[_0x46d50a(0xd5)]['length']>0x0&&(_0x414a2e[_0x46d50a(0x11e)][_0x46d50a(0xfc)]=flattenAttributeGroups(_0x2662b7[_0x46d50a(0xd5)])[_0x46d50a(0x134)](_0x1b884b=>({'name':_0x1b884b[_0x46d50a(0xff)],'type':_0x1b884b['type'],'parentDatabaseName':_0x1b884b[_0x46d50a(0x113)],'parentTableName':_0x1b884b['parentTableName'],'parentColumn':_0x1b884b[_0x46d50a(0xe2)],'parentKey':_0x1b884b[_0x46d50a(0x12c)],'foreignKey':_0x1b884b[_0x46d50a(0x109)]}))),_0x2662b7[_0x46d50a(0x118)]&&_0x2662b7['behaviors']['length']>0x0&&(_0x414a2e[_0x46d50a(0x11e)][_0x46d50a(0x121)]=_0x2662b7[_0x46d50a(0x118)]['map'](_0x4f6438=>({'name':_0x4f6438['name'],'parentDatabaseName':_0x4f6438[_0x46d50a(0xf3)][_0x46d50a(0xef)],'parentTableName':_0x4f6438[_0x46d50a(0xf3)][_0x46d50a(0x123)],'parentKey':_0x4f6438[_0x46d50a(0x12f)][_0x46d50a(0xd1)],'foreignKey':_0x4f6438[_0x46d50a(0x12f)][_0x46d50a(0xcb)],'allColumns':_0x4f6438[_0x46d50a(0xe6)],'schema':_0x4f6438[_0x46d50a(0x105)]?.[_0x46d50a(0x134)](_0x5bbc1b=>({'name':_0x5bbc1b[_0x46d50a(0xd0)]||_0x5bbc1b[_0x46d50a(0xf5)],'type':_0x5bbc1b[_0x46d50a(0xdb)],'parentColumn':_0x5bbc1b[_0x46d50a(0xf5)]}))})));}return _0x414a2e;}function flattenAttributeGroups(_0x157094){const _0x9ee792=a148_0x326f,_0x526674=[];for(const _0x378180 of _0x157094){for(const _0x4a0ec2 of _0x378180[_0x9ee792(0x105)]){_0x526674[_0x9ee792(0x12b)]({'name':_0x4a0ec2[_0x9ee792(0xd0)]||_0x4a0ec2[_0x9ee792(0xf5)],'type':_0x4a0ec2[_0x9ee792(0xdb)],'parentDatabaseName':_0x378180[_0x9ee792(0xf3)][_0x9ee792(0xef)],'parentTableName':_0x378180[_0x9ee792(0xf3)][_0x9ee792(0x123)],'parentColumn':_0x4a0ec2['column'],'parentKey':_0x378180[_0x9ee792(0x12f)][_0x9ee792(0xd1)],'foreignKey':_0x378180[_0x9ee792(0x12f)][_0x9ee792(0xcb)],'groupingName':_0x378180[_0x9ee792(0xff)]});}}return _0x526674;}function convertDefBehaviorToApi(_0x38d2ba){const _0x16a8e6=a148_0x326f,_0x55304c={'name':_0x38d2ba[_0x16a8e6(0xff)],'parentDatabaseName':_0x38d2ba[_0x16a8e6(0xf3)][_0x16a8e6(0xef)],'parentTableName':_0x38d2ba[_0x16a8e6(0xf3)][_0x16a8e6(0x123)],'parentKey':_0x38d2ba[_0x16a8e6(0x12f)]['child_key'],'foreignKey':_0x38d2ba['join'][_0x16a8e6(0xcb)]};if(_0x38d2ba[_0x16a8e6(0xe6)])_0x55304c[_0x16a8e6(0x129)]=!![];else _0x38d2ba[_0x16a8e6(0x105)]&&_0x38d2ba['columns'][_0x16a8e6(0x122)]>0x0&&(_0x55304c[_0x16a8e6(0xdf)]=_0x38d2ba[_0x16a8e6(0x105)][_0x16a8e6(0x134)](_0x340647=>({'name':_0x340647[_0x16a8e6(0xd0)]||_0x340647[_0x16a8e6(0xf5)],'type':_0x340647[_0x16a8e6(0xdb)],'parentColumn':_0x340647[_0x16a8e6(0xf5)]})));return _0x38d2ba[_0x16a8e6(0x124)]!==undefined&&(_0x55304c[_0x16a8e6(0x106)]=_0x38d2ba[_0x16a8e6(0x124)]),_0x38d2ba[_0x16a8e6(0xcf)]!==undefined&&(_0x55304c[_0x16a8e6(0x11b)]=_0x38d2ba[_0x16a8e6(0xcf)]),_0x55304c;}export function serializeDef(_0xfdd2ce){const _0x5bc531=a148_0x326f,_0x56ff5b=JSON['parse'](JSON[_0x5bc531(0x12a)](_0xfdd2ce)),_0x1450e1=a148_0x3ddf14[_0x5bc531(0x12a)](_0x56ff5b,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x5bc531(0x103)}),_0x52b3ed=[_0x5bc531(0x128),'schedule:',_0x5bc531(0x127),_0x5bc531(0xd6),_0x5bc531(0xe0),_0x5bc531(0x132),_0x5bc531(0xf7),_0x5bc531(0xcc)];let _0x167d73=_0x1450e1;for(const _0x5550a5 of _0x52b3ed){_0x167d73=_0x167d73[_0x5bc531(0x117)](new RegExp('^('+_0x5550a5+')','m'),(_0xe9756f,_0x3b6295,_0x3734b)=>{if(_0x3734b===0x0||_0x167d73[_0x3734b-0x1]==='\x0a'&&_0x167d73[_0x3734b-0x2]==='\x0a')return _0x3b6295;return'\x0a'+_0x3b6295;});}return _0x167d73;}export function parseDef(_0x42f806){const _0x476194=a148_0x326f,_0x1f9f42=a148_0x3ddf14['parse'](_0x42f806);if(!_0x1f9f42[_0x476194(0xff)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x1f9f42[_0x476194(0xe8)])throw new Error(_0x476194(0x10a));if(!_0x1f9f42[_0x476194(0xe8)][_0x476194(0xef)])throw new Error(_0x476194(0xd9));if(!_0x1f9f42['master'][_0x476194(0x123)])throw new Error(_0x476194(0xed));return _0x1f9f42[_0x476194(0xcf)]&&validateRealtimeSection(_0x1f9f42[_0x476194(0xcf)]),_0x1f9f42[_0x476194(0x10e)]&&validatePersonalizationServices(_0x1f9f42['personalization_services']),_0x1f9f42;}function validateRealtimeSection(_0x48dec0){const _0x554d2f=a148_0x326f,_0x1041bf=[_0x554d2f(0xea),_0x554d2f(0xd8),_0x554d2f(0x135),'ordered_set',_0x554d2f(0xc8),_0x554d2f(0x10b)];_0x48dec0['events']&&Array[_0x554d2f(0x11c)](_0x48dec0[_0x554d2f(0xe7)])&&_0x48dec0[_0x554d2f(0xe7)][_0x554d2f(0xe3)]((_0xb6128f,_0x45d09d)=>{const _0x2151c1=_0x554d2f;if(!_0xb6128f[_0x2151c1(0xff)])throw new Error(_0x2151c1(0x10c)+_0x45d09d+']:\x20Missing\x20required\x20field\x20\x27name\x27');});_0x48dec0[_0x554d2f(0xd5)]&&Array[_0x554d2f(0x11c)](_0x48dec0[_0x554d2f(0xd5)])&&_0x48dec0[_0x554d2f(0xd5)][_0x554d2f(0xe3)]((_0x836b20,_0x19507)=>{const _0x5b2288=_0x554d2f;if(!_0x836b20[_0x5b2288(0xff)])throw new Error(_0x5b2288(0xd3)+_0x19507+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x836b20[_0x5b2288(0xdb)]&&!_0x1041bf[_0x5b2288(0x102)](_0x836b20[_0x5b2288(0xdb)]))throw new Error(_0x5b2288(0xd3)+_0x19507+']\x20('+_0x836b20[_0x5b2288(0xff)]+_0x5b2288(0x133)+_0x836b20['type']+_0x5b2288(0xc9)+_0x1041bf[_0x5b2288(0x12f)](',\x20'));});if(_0x48dec0['id_stitching']){if(!_0x48dec0[_0x554d2f(0xec)][_0x554d2f(0xe9)])throw new Error(_0x554d2f(0xd7));}}function validatePersonalizationServices(_0x4d436a){const _0x3180be=a148_0x326f;if(!Array[_0x3180be(0x11c)](_0x4d436a))throw new Error(_0x3180be(0x11d));_0x4d436a[_0x3180be(0xe3)]((_0x12efbf,_0x8f2a01)=>{const _0x503e10=_0x3180be;if(!_0x12efbf['name'])throw new Error('personalization_services['+_0x8f2a01+_0x503e10(0xe4));});}export function generateTemplate(_0x1ea01,_0x319591,_0x69e66e){const _0x47975f=a148_0x326f,_0x282035={'name':_0x1ea01,'description':_0x47975f(0xce),'master':{'database':_0x319591,'table':_0x69e66e},'schedule':{'type':_0x47975f(0x126),'time':'03:00','timezone':'UTC'},'attributes':[{'name':_0x47975f(0x12d),'source':{'database':_0x319591,'table':_0x47975f(0xf8)},'join':{'parent_key':'id','child_key':_0x47975f(0x136)},'columns':[{'column':'column_name','label':_0x47975f(0x12e),'type':_0x47975f(0xf4)}]}],'behaviors':[{'name':_0x47975f(0x10d),'source':{'database':_0x319591,'table':_0x47975f(0xd4)},'join':{'parent_key':_0x47975f(0x120),'child_key':_0x47975f(0x136)},'all_columns':!![]}]};return serializeDef(_0x282035);}
|
|
1
|
+
(function(_0x5c9f49,_0x328a67){const _0x501ec2=a149_0x1346,_0x5886cc=_0x5c9f49();while(!![]){try{const _0x227861=-parseInt(_0x501ec2(0xc0))/0x1*(parseInt(_0x501ec2(0xcc))/0x2)+parseInt(_0x501ec2(0xa1))/0x3+-parseInt(_0x501ec2(0xd2))/0x4+parseInt(_0x501ec2(0xd6))/0x5*(-parseInt(_0x501ec2(0xa4))/0x6)+parseInt(_0x501ec2(0x89))/0x7+parseInt(_0x501ec2(0x77))/0x8+-parseInt(_0x501ec2(0xb3))/0x9*(parseInt(_0x501ec2(0x7a))/0xa);if(_0x227861===_0x328a67)break;else _0x5886cc['push'](_0x5886cc['shift']());}catch(_0x342547){_0x5886cc['push'](_0x5886cc['shift']());}}}(a149_0x3d10,0x98b33));import*as a149_0x4eef95 from'yaml';function formatScheduleTime(_0x238810){const _0x2889cc=a149_0x1346;if(typeof _0x238810===_0x2889cc(0x7e)){const _0x2a3328=Math[_0x2889cc(0xb5)](_0x238810);return String(_0x2a3328)[_0x2889cc(0x96)](0x2,'0')+_0x2889cc(0x6c);}if(typeof _0x238810==='string'){if(/^\d{2}:\d{2}:\d{2}$/['test'](_0x238810))return _0x238810;if(/^\d{1,2}:\d{2}$/['test'](_0x238810)){const [_0x2dbf58,_0x59ae10]=_0x238810[_0x2889cc(0x97)](':');return _0x2dbf58[_0x2889cc(0x96)](0x2,'0')+':'+_0x59ae10+':00';}const _0x52b554=parseInt(_0x238810,0xa);if(!isNaN(_0x52b554)&&_0x238810[_0x2889cc(0x7f)](/^\d+$/))return String(_0x52b554)[_0x2889cc(0x96)](0x2,'0')+_0x2889cc(0x6c);return _0x238810;}return String(_0x238810);}export function apiToDef(_0x245712){const _0x3fcee7=a149_0x1346,_0x558525={'database':_0x245712[_0x3fcee7(0xbc)]?.[_0x3fcee7(0x8d)]||'','table':_0x245712[_0x3fcee7(0xbc)]?.[_0x3fcee7(0x9d)]||''};_0x245712[_0x3fcee7(0xa0)]&&_0x245712[_0x3fcee7(0xa0)][_0x3fcee7(0xcf)]>0x0&&(_0x558525['filters']=_0x245712[_0x3fcee7(0xa0)][_0x3fcee7(0xc7)](_0x57eec3=>({'column':_0x57eec3[_0x3fcee7(0xbb)],'values':_0x57eec3[_0x3fcee7(0xb9)]})));let _0x59c7b1;_0x245712['scheduleType']&&_0x245712[_0x3fcee7(0xa2)]!==_0x3fcee7(0x8a)&&(_0x59c7b1={'type':_0x245712[_0x3fcee7(0xa2)]},_0x245712[_0x3fcee7(0x67)]&&(_0x59c7b1[_0x3fcee7(0xb4)]=formatScheduleTime(_0x245712['scheduleOption'])),_0x245712['timezone']&&(_0x59c7b1[_0x3fcee7(0x88)]=_0x245712[_0x3fcee7(0x88)]));let _0x18beb9;(_0x245712[_0x3fcee7(0x9e)]||_0x245712[_0x3fcee7(0xd5)]||_0x245712[_0x3fcee7(0x75)])&&(_0x18beb9={},_0x245712[_0x3fcee7(0x9e)]&&(_0x18beb9[_0x3fcee7(0xa7)]=_0x245712[_0x3fcee7(0x9e)]),_0x245712[_0x3fcee7(0xd5)]&&(_0x18beb9['hive_pool']=_0x245712[_0x3fcee7(0xd5)]),_0x245712[_0x3fcee7(0x75)]&&(_0x18beb9[_0x3fcee7(0xc8)]=_0x245712[_0x3fcee7(0x75)]));const _0x69b6d0=_0x245712[_0x3fcee7(0xab)]&&_0x245712[_0x3fcee7(0xab)][_0x3fcee7(0xcf)]>0x0?groupAttributesBySource(_0x245712[_0x3fcee7(0xab)]):undefined,_0x5680f2=_0x245712[_0x3fcee7(0x9a)]&&_0x245712[_0x3fcee7(0x9a)][_0x3fcee7(0xcf)]>0x0?_0x245712[_0x3fcee7(0x9a)][_0x3fcee7(0xc7)](convertApiBehaviorToYaml):undefined;let _0x53b513;_0x245712[_0x3fcee7(0x98)]&&(_0x53b513={'name':_0x245712[_0x3fcee7(0x98)][_0x3fcee7(0xb6)],'source':{'database':_0x245712[_0x3fcee7(0x98)][_0x3fcee7(0x8d)],'table':_0x245712[_0x3fcee7(0x98)][_0x3fcee7(0x9d)]},'join':{'parent_key':_0x245712['customerGroup'][_0x3fcee7(0xac)],'child_key':_0x245712['customerGroup'][_0x3fcee7(0x7b)]}},_0x245712[_0x3fcee7(0x98)][_0x3fcee7(0x84)]&&_0x245712[_0x3fcee7(0x98)][_0x3fcee7(0x84)][_0x3fcee7(0xcf)]>0x0&&(_0x53b513[_0x3fcee7(0xab)]=groupAttributesBySource(_0x245712[_0x3fcee7(0x98)]['customerGroupAttributes'])),_0x245712[_0x3fcee7(0x98)][_0x3fcee7(0x74)]&&_0x245712[_0x3fcee7(0x98)][_0x3fcee7(0x74)][_0x3fcee7(0xcf)]>0x0&&(_0x53b513[_0x3fcee7(0x9a)]=_0x245712[_0x3fcee7(0x98)][_0x3fcee7(0x74)][_0x3fcee7(0xc7)](convertApiBehaviorToYaml)));const _0x296946={'name':_0x245712['name'],..._0x245712[_0x3fcee7(0x68)]&&{'description':_0x245712[_0x3fcee7(0x68)]},'master':_0x558525,..._0x59c7b1&&{'schedule':_0x59c7b1},..._0x18beb9&&{'engine':_0x18beb9},..._0x69b6d0&&{'attributes':_0x69b6d0},..._0x5680f2&&{'behaviors':_0x5680f2},..._0x53b513&&{'customer_group':_0x53b513}};return _0x296946;}function groupAttributesBySource(_0x564e5b){const _0xc2b090=a149_0x1346,_0x37f20e=new Map();for(const _0x51c955 of _0x564e5b){const _0x573a39=_0x51c955[_0xc2b090(0x8d)]+'.'+_0x51c955[_0xc2b090(0x9d)]+'.'+_0x51c955[_0xc2b090(0x7b)]+'.'+_0x51c955[_0xc2b090(0xac)];!_0x37f20e[_0xc2b090(0x7c)](_0x573a39)&&_0x37f20e['set'](_0x573a39,[]),_0x37f20e[_0xc2b090(0xb7)](_0x573a39)[_0xc2b090(0x95)](_0x51c955);}const _0x56ccc4=[];for(const [,_0x3f7986]of _0x37f20e){const _0x140c63=_0x3f7986[0x0],_0x11cfcb=_0x140c63[_0xc2b090(0xc6)]||_0x140c63[_0xc2b090(0x9d)];_0x56ccc4[_0xc2b090(0x95)]({'name':_0x11cfcb,'source':{'database':_0x140c63[_0xc2b090(0x8d)],'table':_0x140c63['parentTableName']},'join':{'parent_key':_0x140c63[_0xc2b090(0xac)],'child_key':_0x140c63[_0xc2b090(0x7b)]},'columns':_0x3f7986[_0xc2b090(0xc7)](_0x555b75=>{const _0x125955=_0xc2b090,_0x2e988c={'column':_0x555b75[_0x125955(0xaf)],'type':_0x555b75['type']};return _0x555b75[_0x125955(0xb6)]!==_0x555b75[_0x125955(0xaf)]&&(_0x2e988c[_0x125955(0x6d)]=_0x555b75[_0x125955(0xb6)]),_0x2e988c;})});}return _0x56ccc4;}function convertApiBehaviorToYaml(_0x383125){const _0x5e90f0=a149_0x1346,_0x39c43f={'name':_0x383125['name'],'source':{'database':_0x383125['parentDatabaseName'],'table':_0x383125['parentTableName']},'join':{'parent_key':_0x383125[_0x5e90f0(0xac)],'child_key':_0x383125[_0x5e90f0(0x7b)]}};if(_0x383125['allColumns'])_0x39c43f['all_columns']=!![];else _0x383125[_0x5e90f0(0x76)]&&_0x383125['schema'][_0x5e90f0(0xcf)]>0x0&&(_0x39c43f['columns']=_0x383125[_0x5e90f0(0x76)][_0x5e90f0(0xc7)](_0x2448d3=>{const _0x5a1ada=_0x5e90f0,_0x8cf57f={'column':_0x2448d3[_0x5a1ada(0xaf)],'type':_0x2448d3[_0x5a1ada(0xc3)]};return _0x2448d3[_0x5a1ada(0xb6)]!==_0x2448d3['parentColumn']&&(_0x8cf57f[_0x5a1ada(0x6d)]=_0x2448d3[_0x5a1ada(0xb6)]),_0x8cf57f;}));return _0x383125[_0x5e90f0(0xb0)]&&(_0x39c43f[_0x5e90f0(0x82)]=_0x383125[_0x5e90f0(0xb0)]),_0x383125[_0x5e90f0(0x72)]&&(_0x39c43f[_0x5e90f0(0xc5)]=_0x383125[_0x5e90f0(0x72)]),_0x39c43f;}export function defToApi(_0xdf21ca){const _0x836081=a149_0x1346,_0x31ad0c={'name':_0xdf21ca['name'],'master':{'parentDatabaseName':_0xdf21ca[_0x836081(0xbc)][_0x836081(0x99)],'parentTableName':_0xdf21ca[_0x836081(0xbc)]['table']}};_0xdf21ca[_0x836081(0x68)]&&(_0x31ad0c['description']=_0xdf21ca[_0x836081(0x68)]);_0xdf21ca[_0x836081(0xbc)]['filters']&&_0xdf21ca[_0x836081(0xbc)][_0x836081(0xb1)][_0x836081(0xcf)]>0x0&&(_0x31ad0c[_0x836081(0xa0)]=_0xdf21ca[_0x836081(0xbc)][_0x836081(0xb1)][_0x836081(0xc7)](_0x421f29=>({'columnName':_0x421f29[_0x836081(0x81)],'rightValues':_0x421f29[_0x836081(0xd4)]})));_0xdf21ca[_0x836081(0xae)]&&(_0x31ad0c[_0x836081(0xa2)]=_0xdf21ca[_0x836081(0xae)][_0x836081(0xc3)],_0xdf21ca['schedule'][_0x836081(0xb4)]&&(_0x31ad0c[_0x836081(0x67)]=_0xdf21ca[_0x836081(0xae)][_0x836081(0xb4)]),_0xdf21ca['schedule'][_0x836081(0x88)]&&(_0x31ad0c[_0x836081(0x88)]=_0xdf21ca[_0x836081(0xae)][_0x836081(0x88)]));_0xdf21ca[_0x836081(0x94)]&&(_0xdf21ca[_0x836081(0x94)]['hive_only']!==undefined&&(_0x31ad0c[_0x836081(0x9e)]=_0xdf21ca[_0x836081(0x94)][_0x836081(0xa7)]),_0xdf21ca[_0x836081(0x94)]['hive_pool']!==undefined&&(_0x31ad0c['hivePoolName']=_0xdf21ca[_0x836081(0x94)][_0x836081(0xd0)]),_0xdf21ca[_0x836081(0x94)][_0x836081(0xc8)]!==undefined&&(_0x31ad0c['prestoPoolName']=_0xdf21ca['engine'][_0x836081(0xc8)]));_0xdf21ca[_0x836081(0xab)]&&_0xdf21ca['attributes'][_0x836081(0xcf)]>0x0&&(_0x31ad0c[_0x836081(0xab)]=flattenAttributeGroups(_0xdf21ca[_0x836081(0xab)]));_0xdf21ca[_0x836081(0x9a)]&&_0xdf21ca[_0x836081(0x9a)][_0x836081(0xcf)]>0x0&&(_0x31ad0c[_0x836081(0x9a)]=_0xdf21ca['behaviors'][_0x836081(0xc7)](convertDefBehaviorToApi));if(_0xdf21ca[_0x836081(0x7d)]){const _0x569f89=_0xdf21ca[_0x836081(0x7d)];_0x31ad0c[_0x836081(0x98)]={'name':_0x569f89[_0x836081(0xb6)],'parentDatabaseName':_0x569f89[_0x836081(0xaa)][_0x836081(0x99)],'parentTableName':_0x569f89[_0x836081(0xaa)][_0x836081(0xc9)],'parentKey':_0x569f89[_0x836081(0xa9)][_0x836081(0x93)],'foreignKey':_0x569f89[_0x836081(0xa9)][_0x836081(0x8e)]},_0x569f89[_0x836081(0xab)]&&_0x569f89['attributes']['length']>0x0&&(_0x31ad0c[_0x836081(0x98)]['customerGroupAttributes']=flattenAttributeGroups(_0x569f89[_0x836081(0xab)])[_0x836081(0xc7)](_0x4fcc33=>({'name':_0x4fcc33[_0x836081(0xb6)],'type':_0x4fcc33['type'],'parentDatabaseName':_0x4fcc33[_0x836081(0x8d)],'parentTableName':_0x4fcc33[_0x836081(0x9d)],'parentColumn':_0x4fcc33[_0x836081(0xaf)],'parentKey':_0x4fcc33[_0x836081(0x7b)],'foreignKey':_0x4fcc33['foreignKey']}))),_0x569f89['behaviors']&&_0x569f89['behaviors']['length']>0x0&&(_0x31ad0c[_0x836081(0x98)]['customerGroupBehaviors']=_0x569f89[_0x836081(0x9a)][_0x836081(0xc7)](_0x4fb218=>({'name':_0x4fb218[_0x836081(0xb6)],'parentDatabaseName':_0x4fb218['source'][_0x836081(0x99)],'parentTableName':_0x4fb218['source'][_0x836081(0xc9)],'parentKey':_0x4fb218['join']['child_key'],'foreignKey':_0x4fb218['join']['parent_key'],'allColumns':_0x4fb218[_0x836081(0x9f)],'schema':_0x4fb218[_0x836081(0x71)]?.[_0x836081(0xc7)](_0x2ad830=>({'name':_0x2ad830[_0x836081(0x6d)]||_0x2ad830[_0x836081(0x81)],'type':_0x2ad830['type'],'parentColumn':_0x2ad830['column']}))})));}return _0x31ad0c;}function flattenAttributeGroups(_0x2eb6c4){const _0x3333cd=a149_0x1346,_0x1ceb4d=[];for(const _0x1f2680 of _0x2eb6c4){for(const _0x54a038 of _0x1f2680['columns']){_0x1ceb4d['push']({'name':_0x54a038[_0x3333cd(0x6d)]||_0x54a038['column'],'type':_0x54a038[_0x3333cd(0xc3)],'parentDatabaseName':_0x1f2680['source'][_0x3333cd(0x99)],'parentTableName':_0x1f2680['source'][_0x3333cd(0xc9)],'parentColumn':_0x54a038[_0x3333cd(0x81)],'parentKey':_0x1f2680[_0x3333cd(0xa9)][_0x3333cd(0x93)],'foreignKey':_0x1f2680[_0x3333cd(0xa9)][_0x3333cd(0x8e)],'groupingName':_0x1f2680[_0x3333cd(0xb6)]});}}return _0x1ceb4d;}function convertDefBehaviorToApi(_0x341f02){const _0x545ed9=a149_0x1346,_0xe3ea0d={'name':_0x341f02['name'],'parentDatabaseName':_0x341f02['source'][_0x545ed9(0x99)],'parentTableName':_0x341f02[_0x545ed9(0xaa)][_0x545ed9(0xc9)],'parentKey':_0x341f02[_0x545ed9(0xa9)]['child_key'],'foreignKey':_0x341f02['join'][_0x545ed9(0x8e)]};if(_0x341f02[_0x545ed9(0x9f)])_0xe3ea0d[_0x545ed9(0xd1)]=!![];else _0x341f02[_0x545ed9(0x71)]&&_0x341f02[_0x545ed9(0x71)]['length']>0x0&&(_0xe3ea0d['schema']=_0x341f02[_0x545ed9(0x71)][_0x545ed9(0xc7)](_0x32bd7a=>({'name':_0x32bd7a[_0x545ed9(0x6d)]||_0x32bd7a['column'],'type':_0x32bd7a[_0x545ed9(0xc3)],'parentColumn':_0x32bd7a[_0x545ed9(0x81)]})));return _0x341f02[_0x545ed9(0x82)]!==undefined&&(_0xe3ea0d[_0x545ed9(0xb0)]=_0x341f02[_0x545ed9(0x82)]),_0x341f02['realtime']!==undefined&&(_0xe3ea0d['isRealtime']=_0x341f02[_0x545ed9(0xc5)]),_0xe3ea0d;}function a149_0x3d10(){const _0x2ef6dc=['attributes','foreignKey',']:\x20Missing\x20required\x20field\x20\x27name\x27','schedule','parentColumn','defaultTimeFilterEnabled','filters','attributes:','63dzYIRA','time','floor','name','get','customer_group:','rightValues','engine:','columnName','master','behaviors:','personalization_services','personalization_services:','19769Jlfyhi','master:','set','type','id_stitching','realtime','groupingName','map','trino_pool','table','isArray','customer_id','62zEspSH','counter','ordered_set','length','hive_pool','allColumns','1529388zAfzHg','YAML\x20config\x20missing\x20required\x20field:\x20master','values','hivePoolName','5hoZYnZ','schedule:','stringify','scheduleOption','description','column_name','string','events',':00:00','label','realtime.events[','YAML\x20config\x20missing\x20required\x20field:\x20master.database','UTC','columns','isRealtime','):\x20Invalid\x20type\x20\x27','customerGroupBehaviors','prestoPoolName','schema','7096632nIvrtF','realtime.attributes[','list','622190StHFEv','parentKey','has','customer_group','number','match','Parent\x20segment\x20description','column','default_time_filter','includes','customerGroupAttributes','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','personalization_services\x20must\x20be\x20an\x20array','attribute_table','timezone','7965734QNPMkU','none','\x27.\x20Must\x20be\x20one\x20of:\x20','events_table','parentDatabaseName','parent_key','single','Example\x20Events','03:00','realtime:','child_key','engine','push','padStart','split','customerGroup','database','behaviors','daily','Display\x20Name','parentTableName','workflowHiveOnly','all_columns','audienceFilters','1631172hPhjhO','scheduleType',']\x20(','3075522VxdJVi','user_id','forEach','hive_only','YAML\x20config\x20missing\x20required\x20field:\x20master.table','join','source'];a149_0x3d10=function(){return _0x2ef6dc;};return a149_0x3d10();}export function serializeDef(_0x164a02){const _0x2b54f9=a149_0x1346,_0x205783=JSON['parse'](JSON['stringify'](_0x164a02)),_0x31bc6a=a149_0x4eef95[_0x2b54f9(0x66)](_0x205783,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x2b3527=[_0x2b54f9(0xc1),_0x2b54f9(0x65),_0x2b54f9(0xba),_0x2b54f9(0xb2),_0x2b54f9(0xbd),_0x2b54f9(0xb8),_0x2b54f9(0x92),_0x2b54f9(0xbf)];let _0x4c1de8=_0x31bc6a;for(const _0x12b0ac of _0x2b3527){_0x4c1de8=_0x4c1de8['replace'](new RegExp('^('+_0x12b0ac+')','m'),(_0x59db1a,_0x45fed8,_0xb03b07)=>{if(_0xb03b07===0x0||_0x4c1de8[_0xb03b07-0x1]==='\x0a'&&_0x4c1de8[_0xb03b07-0x2]==='\x0a')return _0x45fed8;return'\x0a'+_0x45fed8;});}return _0x4c1de8;}export function parseDef(_0xa153c){const _0x2e2689=a149_0x1346,_0x17bba6=a149_0x4eef95['parse'](_0xa153c);if(!_0x17bba6['name'])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x17bba6[_0x2e2689(0xbc)])throw new Error(_0x2e2689(0xd3));if(!_0x17bba6[_0x2e2689(0xbc)]['database'])throw new Error(_0x2e2689(0x6f));if(!_0x17bba6[_0x2e2689(0xbc)]['table'])throw new Error(_0x2e2689(0xa8));return _0x17bba6['realtime']&&validateRealtimeSection(_0x17bba6[_0x2e2689(0xc5)]),_0x17bba6[_0x2e2689(0xbe)]&&validatePersonalizationServices(_0x17bba6[_0x2e2689(0xbe)]),_0x17bba6;}function validateRealtimeSection(_0x4c3cfd){const _0x296c5f=a149_0x1346,_0x4c05c5=[_0x296c5f(0x8f),_0x296c5f(0xcd),_0x296c5f(0xc2),_0x296c5f(0xce),_0x296c5f(0x79),'imported_batch'];_0x4c3cfd[_0x296c5f(0x6b)]&&Array[_0x296c5f(0xca)](_0x4c3cfd['events'])&&_0x4c3cfd[_0x296c5f(0x6b)][_0x296c5f(0xa6)]((_0x3e5da3,_0x5addef)=>{const _0xea0808=_0x296c5f;if(!_0x3e5da3[_0xea0808(0xb6)])throw new Error(_0xea0808(0x6e)+_0x5addef+_0xea0808(0xad));});_0x4c3cfd[_0x296c5f(0xab)]&&Array[_0x296c5f(0xca)](_0x4c3cfd[_0x296c5f(0xab)])&&_0x4c3cfd[_0x296c5f(0xab)][_0x296c5f(0xa6)]((_0xd212ce,_0x2f8dbe)=>{const _0x2e6311=_0x296c5f;if(!_0xd212ce[_0x2e6311(0xb6)])throw new Error(_0x2e6311(0x78)+_0x2f8dbe+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0xd212ce['type']&&!_0x4c05c5[_0x2e6311(0x83)](_0xd212ce['type']))throw new Error(_0x2e6311(0x78)+_0x2f8dbe+_0x2e6311(0xa3)+_0xd212ce[_0x2e6311(0xb6)]+_0x2e6311(0x73)+_0xd212ce[_0x2e6311(0xc3)]+_0x2e6311(0x8b)+_0x4c05c5[_0x2e6311(0xa9)](',\x20'));});if(_0x4c3cfd[_0x296c5f(0xc4)]){if(!_0x4c3cfd[_0x296c5f(0xc4)]['primary_key'])throw new Error(_0x296c5f(0x85));}}function validatePersonalizationServices(_0x4b51c9){const _0x451314=a149_0x1346;if(!Array[_0x451314(0xca)](_0x4b51c9))throw new Error(_0x451314(0x86));_0x4b51c9[_0x451314(0xa6)]((_0x28972e,_0x5fe42)=>{const _0x3ba117=_0x451314;if(!_0x28972e[_0x3ba117(0xb6)])throw new Error('personalization_services['+_0x5fe42+_0x3ba117(0xad));});}function a149_0x1346(_0x2466ae,_0x236bf3){_0x2466ae=_0x2466ae-0x65;const _0x3d10c5=a149_0x3d10();let _0x134622=_0x3d10c5[_0x2466ae];return _0x134622;}export function generateTemplate(_0x45ff1f,_0x1928b2,_0x2a7762){const _0x4a6015=a149_0x1346,_0x32b868={'name':_0x45ff1f,'description':_0x4a6015(0x80),'master':{'database':_0x1928b2,'table':_0x2a7762},'schedule':{'type':_0x4a6015(0x9b),'time':_0x4a6015(0x91),'timezone':_0x4a6015(0x70)},'attributes':[{'name':'Example\x20Attributes','source':{'database':_0x1928b2,'table':_0x4a6015(0x87)},'join':{'parent_key':'id','child_key':_0x4a6015(0xcb)},'columns':[{'column':_0x4a6015(0x69),'label':_0x4a6015(0x9c),'type':_0x4a6015(0x6a)}]}],'behaviors':[{'name':_0x4a6015(0x90),'source':{'database':_0x1928b2,'table':_0x4a6015(0x8c)},'join':{'parent_key':_0x4a6015(0xa5),'child_key':_0x4a6015(0xcb)},'all_columns':!![]}]};return serializeDef(_0x32b868);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xbd8a94,_0x6ab621){const _0x100b5e=a149_0x4f78,_0x4274d0=_0xbd8a94();while(!![]){try{const _0x380299=parseInt(_0x100b5e(0x13f))/0x1*(parseInt(_0x100b5e(0x108))/0x2)+parseInt(_0x100b5e(0x134))/0x3+parseInt(_0x100b5e(0x104))/0x4*(-parseInt(_0x100b5e(0x13c))/0x5)+-parseInt(_0x100b5e(0xfe))/0x6+-parseInt(_0x100b5e(0x144))/0x7*(parseInt(_0x100b5e(0x11b))/0x8)+-parseInt(_0x100b5e(0x131))/0x9+parseInt(_0x100b5e(0x127))/0xa*(parseInt(_0x100b5e(0x114))/0xb);if(_0x380299===_0x6ab621)break;else _0x4274d0['push'](_0x4274d0['shift']());}catch(_0x3fbb8f){_0x4274d0['push'](_0x4274d0['shift']());}}}(a149_0xaeb9,0x8cf69));import a149_0x5bb147 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';function a149_0xaeb9(){const _0x5b64d1=['Resolving\x20parent\x20segment','journeyBundleId','size','.yml','paused','20wKJBGQ','relationships','segmentFolderId','167SOuoLn','resolveParentId','parentFolder','journeyBundleName','filter','5878159OCoVIw','listJourneysWithDetailsFromParentSegment','from','description','779562ABlrTJ','activation_','sort','Processing\x20segments','toLowerCase','Processing\x20journeys','479664YfWEMb','listActivations','buildIdToNameMap','getLatestJourneyId','302WHNITY','Fetching\x20users\x20and\x20connections','utf-8','push','targetResourceName','versionNumber','activationParams','data','attributes','getActivation','all','listSegments','22JDEjTZ','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','getJourney','folderId','has','getSegment','update','8fDJTLF','join','getParent','values','slice','add','Fetching\x20activations','createdAt','set','isNew','kind','reduce','8692990EoVXxo','user','journey','rule','get','segment','Fetching\x20parent\x20segment\x20info','listFolders','hasChanges','map','2207340gFXTzi','length','audienceId','1524474LbsGNG','relative','name'];a149_0xaeb9=function(){return _0x5b64d1;};return a149_0xaeb9();}import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a149_0x184806,normalizeJourneyDef,parseYamlString as a149_0x2fcd61}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';function a149_0x4f78(_0x3e46fd,_0x34e4ba){_0x3e46fd=_0x3e46fd-0xfe;const _0xaeb91a=a149_0xaeb9();let _0x4f78ed=_0xaeb91a[_0x3e46fd];return _0x4f78ed;}import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x1fd281,_0x8524b0,_0x425d77){const _0x4e2b10=a149_0x4f78,_0x492c76=a149_0x5bb147[_0x4e2b10(0x135)](_0x425d77,_0x1fd281);if(existsSync(_0x1fd281)){const _0xd9335=readFileSync(_0x1fd281,_0x4e2b10(0x10a)),_0x27de66=generateDiff(_0xd9335,_0x8524b0),_0x522aac=hasChanges(_0x27de66);return{'relativePath':_0x492c76,'absolutePath':_0x1fd281,'content':_0x8524b0,'isNew':![],'hasChanges':_0x522aac,'diff':_0x522aac?formatDiffWithColors(_0x27de66):undefined};}return{'relativePath':_0x492c76,'absolutePath':_0x1fd281,'content':_0x8524b0,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x118907,_0x1e3475,_0x42630a){const _0x528a5a=a149_0x4f78,_0x2c3b24=_0x118907+':'+_0x1e3475,_0x2d1cf4=_0x42630a['get'](_0x2c3b24)||0x0;_0x42630a[_0x528a5a(0x123)](_0x2c3b24,_0x2d1cf4+0x1);if(_0x2d1cf4===0x0)return _0x1e3475;return _0x1e3475+'_'+(_0x2d1cf4+0x1);}export async function pullSegments(_0x21d8cf,_0x2c25fd,_0x50f846={}){const _0x172181=a149_0x4f78,{targetDir:_0xc27a51,progress:_0xe8468d}=_0x50f846;_0xe8468d?.[_0x172181(0x11a)](_0x172181(0x137));const _0x53adfb=await _0x21d8cf['segment'][_0x172181(0x140)](_0x2c25fd);_0xe8468d?.[_0x172181(0x11a)](_0x172181(0x12d));const _0x27b408=await _0x21d8cf[_0x172181(0x12c)][_0x172181(0x11d)](_0x53adfb),_0x26651c=_0x27b408['attributes'][_0x172181(0x136)];_0xe8468d?.['update']('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x526c29,_0x35cfa0,_0x42c4cb]=await Promise[_0x172181(0x112)]([_0x21d8cf[_0x172181(0x12c)][_0x172181(0x113)](_0x53adfb),_0x21d8cf[_0x172181(0x12c)][_0x172181(0x12e)](_0x53adfb),_0x21d8cf[_0x172181(0x129)][_0x172181(0x145)](_0x53adfb,{'includeAllVersions':!![]})]),{journeys:_0x50975d,activationStepsById:_0x38f702}=_0x42c4cb,_0x2d6ced=new Map();for(const _0x65718f of _0x50975d){_0x2d6ced[_0x172181(0x123)](_0x65718f['id'],_0x65718f);}const _0x2b311f=_0x50975d[_0x172181(0x130)](_0x2930f0=>({'id':_0x2930f0['id'],'name':_0x2930f0[_0x172181(0x110)][_0x172181(0x136)],'journeyBundleName':_0x2930f0[_0x172181(0x110)][_0x172181(0x142)]||'','journeyBundleId':_0x2930f0[_0x172181(0x110)][_0x172181(0x138)]||'','versionNumber':_0x2930f0[_0x172181(0x110)]['versionNumber'],'description':_0x2930f0[_0x172181(0x110)]['description'],'state':_0x2930f0[_0x172181(0x110)]['state'],'paused':_0x2930f0[_0x172181(0x110)][_0x172181(0x13b)],'audienceId':_0x2930f0['attributes'][_0x172181(0x133)],'folderId':_0x2930f0[_0x172181(0x13d)]?.[_0x172181(0x141)]?.[_0x172181(0x10f)]?.['id'],'createdAt':_0x2930f0[_0x172181(0x110)][_0x172181(0x122)],'updatedAt':_0x2930f0[_0x172181(0x110)]['updatedAt']})),_0x486591=buildFolderIdToPathMap(_0x35cfa0),_0x28428c=_0xc27a51||'segments/'+sanitizeFileName(_0x26651c);_0xe8468d?.[_0x172181(0x11a)](_0x172181(0x121));const _0x44a6e0=new Map();await batchAsync(_0x526c29,async _0x38c42d=>{const _0x4662de=_0x172181,_0x4d5c19=await _0x21d8cf['segment'][_0x4662de(0x105)](_0x53adfb,_0x38c42d['id']);_0x44a6e0['set'](_0x38c42d['id'],_0x4d5c19);}),_0xe8468d?.['update'](_0x172181(0x109));const [_0x53608a,_0x2ec108]=await Promise[_0x172181(0x112)]([_0x21d8cf[_0x172181(0x128)]['buildIdToEmailMap'](),_0x21d8cf['connection'][_0x172181(0x106)]()]),_0x12ea92=[],_0x1d93e6=new Map(),_0xf01f5d=a149_0x5bb147['join'](_0x28428c,'tdx.json'),_0x1d1602=createTdxConfigContent(_0x26651c);_0x12ea92[_0x172181(0x10b)](prepareFile(_0xf01f5d,_0x1d1602,_0x28428c));const _0x59fc07=new Map();for(const _0x4ae1ea of _0x526c29){_0x59fc07['set'](_0x4ae1ea['id'],_0x4ae1ea);}let _0xb5230b=_0x526c29;if(_0x50f846[_0x172181(0x10c)]){const _0x188a72=_0x526c29['filter'](_0x152fcc=>_0x152fcc[_0x172181(0x136)][_0x172181(0x102)]()===_0x50f846['targetResourceName'][_0x172181(0x102)]());_0x188a72['length']>0x0&&(_0xb5230b=_0x188a72);}_0xe8468d?.[_0x172181(0x11a)](_0x172181(0x101));for(const _0x413ddd of _0xb5230b){if(_0x413ddd[_0x172181(0x125)]===SEGMENT_KIND_JOURNEY)continue;const _0x1d46b5=_0x413ddd[_0x172181(0x13e)]?_0x486591[_0x172181(0x12b)](_0x413ddd[_0x172181(0x13e)])||'':'',_0x24aa93=_0x44a6e0[_0x172181(0x12b)](_0x413ddd['id'])||[],_0x284b4f=segmentWithActivationsToYaml(_0x413ddd,_0x24aa93,undefined,_0x53608a,_0x2ec108),_0x2f57bc=_0x1d46b5?a149_0x5bb147[_0x172181(0x11c)](_0x28428c,_0x1d46b5):_0x28428c,_0x19bd53=sanitizeFileName(_0x413ddd[_0x172181(0x136)]),_0x2103b7=getUniqueFileName(_0x2f57bc,_0x19bd53,_0x1d93e6),_0x1d1edf=a149_0x5bb147[_0x172181(0x11c)](_0x2f57bc,_0x2103b7+_0x172181(0x13a)),_0x4057ee=segmentToYamlString(_0x284b4f);_0x12ea92['push'](prepareFile(_0x1d1edf,_0x4057ee,_0x28428c));}const _0x2dc865=new Map();for(const _0x3e179b of _0x2b311f){const _0x4c8162=_0x3e179b['journeyBundleId'];!_0x2dc865[_0x172181(0x118)](_0x4c8162)&&_0x2dc865['set'](_0x4c8162,[]),_0x2dc865[_0x172181(0x12b)](_0x4c8162)['push'](_0x3e179b);}for(const _0x438fba of _0x2dc865[_0x172181(0x11e)]()){_0x438fba[_0x172181(0x100)]((_0x6293bf,_0x67b14d)=>(_0x6293bf[_0x172181(0x10d)]||0x0)-(_0x67b14d[_0x172181(0x10d)]||0x0));}if(_0x50f846[_0x172181(0x10c)]){const _0xd5eff1=new Map();for(const [_0x2281a6,_0x192dba]of _0x2dc865){const _0x3b57dd=_0x192dba[0x0][_0x172181(0x142)];if(_0x3b57dd[_0x172181(0x102)]()===_0x50f846['targetResourceName']['toLowerCase']()){_0xd5eff1['set'](_0x2281a6,_0x192dba);break;}}_0x2dc865['clear']();for(const [_0x239e36,_0x146598]of _0xd5eff1){_0x2dc865[_0x172181(0x123)](_0x239e36,_0x146598);}}if(_0x2dc865[_0x172181(0x139)]>0x0){_0xe8468d?.[_0x172181(0x11a)](_0x172181(0x103));const _0x266e04=Array[_0x172181(0x146)](_0x2dc865[_0x172181(0x11e)]()),_0x435820=0x5,{createYamlContext:_0x4aba77}=createYamlContextForBundle(_0x21d8cf,_0x59fc07,_0x53608a,_0x2ec108,_0x38f702,_0x2d6ced);for(let _0x118d39=0x0;_0x118d39<_0x266e04['length'];_0x118d39+=_0x435820){const _0x59e6a5=_0x266e04[_0x172181(0x11f)](_0x118d39,_0x118d39+_0x435820),_0x59efea=await Promise[_0x172181(0x112)](_0x59e6a5[_0x172181(0x130)](async _0xf4d1f7=>{const _0xb57545=_0x172181,_0x134a2d=_0xf4d1f7[0x0],_0x35f132=_0x134a2d[_0xb57545(0x142)];_0xe8468d?.['update']('Processing\x20journey:\x20'+_0x35f132);const _0x3b083a=_0x134a2d['folderId']?_0x486591[_0xb57545(0x12b)](_0x134a2d[_0xb57545(0x117)])||'':'',_0x2e02d2=_0x3b083a?a149_0x5bb147[_0xb57545(0x11c)](_0x28428c,_0x3b083a):_0x28428c,_0x48023a=sanitizeFileName(_0x35f132),_0x1353b2=a149_0x5bb147[_0xb57545(0x11c)](_0x2e02d2,_0x48023a+'.yml');let _0x25bbdf;if(existsSync(_0x1353b2))try{const _0x20707b=readFileSync(_0x1353b2,'utf-8'),_0x13be9a=a149_0x2fcd61(_0x20707b);_0x25bbdf=buildLocalRuleToNameMappingFromJourney(_0x13be9a);}catch{}const _0x3ab78b=[];for(const _0x39b383 of _0xf4d1f7){const _0x44b631=_0x2d6ced[_0xb57545(0x12b)](_0x39b383['id']);if(!_0x44b631){_0xe8468d?.[_0xb57545(0x11a)]('Warning:\x20Journey\x20'+_0x39b383['id']+_0xb57545(0x115));continue;}const _0x3b804c=_0x44b631[_0xb57545(0x110)]?.[_0xb57545(0x133)],_0x2448d5=_0x4aba77(_0x39b383['id'],_0x3b804c),_0x2eb45e=await journeyResponseToDef(_0x44b631,_0x2448d5);_0x3ab78b[_0xb57545(0x10b)]({'item':_0x39b383,'yaml':_0x2eb45e});}const _0x2206d4=await _0x21d8cf[_0xb57545(0x129)][_0xb57545(0x107)](_0x134a2d[_0xb57545(0x138)]),_0x2ac086=buildMergedJourneyDef(_0x3ab78b,_0x25bbdf,_0x2206d4);return{'bundleName':_0x35f132,'folderPath':_0x3b083a,'finalYaml':_0x2ac086};}));for(const {bundleName:_0x4c2870,folderPath:_0x4bf347,finalYaml:_0x2ae51a}of _0x59efea){const _0x4ccca2=normalizeJourneyDef(_0x2ae51a),_0x500cab=a149_0x184806(_0x4ccca2),_0x46ccde=_0x4bf347?a149_0x5bb147['join'](_0x28428c,_0x4bf347):_0x28428c,_0x4abc86=sanitizeFileName(_0x4c2870),_0x36bb35=getUniqueFileName(_0x46ccde,_0x4abc86,_0x1d93e6),_0x5e6b87=a149_0x5bb147[_0x172181(0x11c)](_0x46ccde,_0x36bb35+'.yml');_0x12ea92['push'](prepareFile(_0x5e6b87,_0x500cab,_0x28428c));}}}const _0x4263a0=Array[_0x172181(0x146)](_0x44a6e0[_0x172181(0x11e)]())[_0x172181(0x126)]((_0x2d6864,_0x1a875c)=>_0x2d6864+_0x1a875c[_0x172181(0x132)],0x0),_0x49ed6d=_0xb5230b[_0x172181(0x143)](_0x107e56=>_0x107e56[_0x172181(0x125)]!==SEGMENT_KIND_JOURNEY),_0x4b3964=_0x12ea92[_0x172181(0x143)](_0x184e4a=>_0x184e4a[_0x172181(0x124)])[_0x172181(0x132)],_0x23f24c=_0x12ea92[_0x172181(0x143)](_0x5b8bb9=>!_0x5b8bb9['isNew']&&_0x5b8bb9[_0x172181(0x12f)])[_0x172181(0x132)],_0x2b579a=_0x12ea92[_0x172181(0x143)](_0x37e2e5=>!_0x37e2e5[_0x172181(0x124)]&&!_0x37e2e5['hasChanges'])[_0x172181(0x132)],_0x5231ff=Array[_0x172181(0x146)](_0x2dc865[_0x172181(0x11e)]())['reduce']((_0x21c875,_0x5dc115)=>_0x21c875+_0x5dc115[_0x172181(0x132)],0x0);return{'parentName':_0x26651c,'parentId':_0x53adfb,'targetDir':_0x28428c,'files':_0x12ea92,'counts':{'segments':_0x49ed6d[_0x172181(0x132)],'journeys':_0x2dc865[_0x172181(0x139)],'journeyVersions':_0x5231ff,'activations':_0x4263a0},'newFiles':_0x4b3964,'changedFiles':_0x23f24c,'unchangedFiles':_0x2b579a};}function createYamlContextForBundle(_0x3d20be,_0x3ccd59,_0x13589c,_0x1c3bc3,_0x43bc26,_0x1eb997){const _0x4b6b9f=new Set(),_0x4c3736=new Map(),_0x591a35=new Map(),_0x5d6cc9=createJumpTargetCache(),_0xd8d3cc=async(_0x3a8645,_0x5e4407)=>{const _0x4a3faf=a149_0x4f78,_0x4a3be6=_0x4c3736[_0x4a3faf(0x12b)](_0x3a8645);if(_0x4a3be6!==undefined)return _0x4a3be6;if(!_0x5e4407)return _0x3a8645;try{let _0x4774b8=_0x3ccd59[_0x4a3faf(0x12b)](_0x3a8645);!_0x4774b8&&(_0x4774b8=await _0x3d20be[_0x4a3faf(0x12c)]['getSegment'](_0x5e4407,_0x3a8645),_0x3ccd59[_0x4a3faf(0x123)](_0x3a8645,_0x4774b8));const _0x3b856f=generateJourneyLocalName(_0x4774b8[_0x4a3faf(0x136)]),_0x110cd5=_0x4774b8[_0x4a3faf(0x125)]===SEGMENT_KIND_JOURNEY&&_0x3b856f!==undefined;if(_0x110cd5&&_0x3b856f){let _0x245596=_0x3b856f,_0x1165a8=0x2;while(_0x4b6b9f[_0x4a3faf(0x118)](_0x245596)){_0x245596=_0x3b856f+'_'+_0x1165a8,_0x1165a8++;}return _0x4b6b9f[_0x4a3faf(0x120)](_0x245596),_0x4c3736[_0x4a3faf(0x123)](_0x3a8645,_0x245596),_0x245596;}return _0x4774b8['name'];}catch{return _0x3a8645;}},_0x148019=(_0x76f8e0,_0x21d89c)=>({'resolveSegment':async _0x3fedd5=>{const _0xd0b4e5=a149_0x4f78,_0x2603ed=_0x4c3736[_0xd0b4e5(0x12b)](_0x3fedd5);if(_0x2603ed!==undefined)return{'name':_0x2603ed,'isJourneyLocal':!![]};if(!_0x21d89c)return{'name':_0x3fedd5,'isJourneyLocal':![]};try{let _0x2b3d73=_0x3ccd59['get'](_0x3fedd5);!_0x2b3d73&&(_0x2b3d73=await _0x3d20be[_0xd0b4e5(0x12c)][_0xd0b4e5(0x119)](_0x21d89c,_0x3fedd5),_0x3ccd59[_0xd0b4e5(0x123)](_0x3fedd5,_0x2b3d73));const _0x3cccd9=generateJourneyLocalName(_0x2b3d73['name']),_0x4c74f7=_0x2b3d73[_0xd0b4e5(0x125)]===SEGMENT_KIND_JOURNEY&&_0x3cccd9!==undefined;if(_0x4c74f7&&!_0x2b3d73[_0xd0b4e5(0x12a)]&&_0x21d89c)try{const _0x5c091f=await _0x3d20be[_0xd0b4e5(0x12c)]['getSegment'](_0x21d89c,_0x3fedd5);_0x3ccd59[_0xd0b4e5(0x123)](_0x3fedd5,_0x5c091f),_0x2b3d73=_0x5c091f;}catch{}const _0x33422a=await _0xd8d3cc(_0x3fedd5,_0x21d89c);let _0x516600;if(_0x4c74f7&&_0x2b3d73['rule']){const _0x41f64d=await segmentResponseToDef(_0x2b3d73,{'resolveSegmentName':_0x22b4a8=>_0xd8d3cc(_0x22b4a8,_0x21d89c)});_0x516600={'description':_0x2b3d73[_0xd0b4e5(0x147)],'rule':_0x41f64d['rule']};}return{'name':_0x33422a,'isJourneyLocal':_0x4c74f7,'definition':_0x516600};}catch{return{'name':_0x3fedd5,'isJourneyLocal':![]};}},'resolveActivation':async _0x3c3c0b=>{const _0x409cab=a149_0x4f78,_0x5afc0f=_0x591a35[_0x409cab(0x12b)](_0x3c3c0b);if(_0x5afc0f!==undefined)return{'name':_0x5afc0f,'isJourneyLocal':!![]};try{let _0x40c4e1=_0x43bc26[_0x409cab(0x12b)](_0x3c3c0b);!_0x40c4e1&&(_0x40c4e1=await _0x3d20be[_0x409cab(0x129)][_0x409cab(0x111)](_0x76f8e0,_0x3c3c0b));const _0x2c946f=_0x40c4e1[_0x409cab(0x110)][_0x409cab(0x10e)]['name']||_0x3c3c0b,_0x8d77f8=sanitizeYamlKey(_0x2c946f)||_0x409cab(0xff)+_0x3c3c0b,_0x2c0560=_0x8d77f8;_0x591a35[_0x409cab(0x123)](_0x3c3c0b,_0x2c0560);const _0x5d1cd5=journeyActivationStepToYaml(_0x40c4e1,_0x13589c,_0x1c3bc3);return{'name':_0x2c0560,'isJourneyLocal':!![],'definition':_0x5d1cd5};}catch{return{'name':_0x3c3c0b,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1d0eb0,_0x1e70b6)=>resolveJumpTarget(_0x1d0eb0,_0x1e70b6,_0x5d6cc9,async _0x3b1f70=>{const _0x45ca77=a149_0x4f78,_0x4f82d6=_0x1eb997['get'](_0x3b1f70);if(_0x4f82d6)return _0x4f82d6;return _0x3d20be['journey'][_0x45ca77(0x116)](_0x3b1f70);})});return{'createYamlContext':_0x148019};}
|
|
1
|
+
(function(_0x12d7ef,_0xc1dafa){const _0xbe7ae1=a150_0x859b,_0x4b5873=_0x12d7ef();while(!![]){try{const _0x212feb=-parseInt(_0xbe7ae1(0x1e6))/0x1*(parseInt(_0xbe7ae1(0x203))/0x2)+-parseInt(_0xbe7ae1(0x207))/0x3*(parseInt(_0xbe7ae1(0x206))/0x4)+parseInt(_0xbe7ae1(0x1d5))/0x5*(parseInt(_0xbe7ae1(0x1da))/0x6)+-parseInt(_0xbe7ae1(0x1ce))/0x7+parseInt(_0xbe7ae1(0x1e5))/0x8+-parseInt(_0xbe7ae1(0x1e2))/0x9*(parseInt(_0xbe7ae1(0x20e))/0xa)+parseInt(_0xbe7ae1(0x1ff))/0xb*(parseInt(_0xbe7ae1(0x1dd))/0xc);if(_0x212feb===_0xc1dafa)break;else _0x4b5873['push'](_0x4b5873['shift']());}catch(_0x270723){_0x4b5873['push'](_0x4b5873['shift']());}}}(a150_0x2c8a,0xc50f6));import a150_0x4a64a5 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a150_0x859b(_0xbab5f6,_0x5e73f3){_0xbab5f6=_0xbab5f6-0x1c6;const _0x2c8aa6=a150_0x2c8a();let _0x859b21=_0x2c8aa6[_0xbab5f6];return _0x859b21;}import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';function a150_0x2c8a(){const _0x4200df=['from','values','Processing\x20journeys','hasChanges','add','update','set','paused','relative','all','utf-8','map','connection','segmentFolderId','getParent','has','2351569oASxyi','parentFolder','user','Processing\x20journey:\x20','100388riAuUW','versionNumber','sort','648cYWaxh','27747BxJoke','slice','getSegment','buildIdToEmailMap','targetResourceName','journeyBundleId','buildIdToNameMap','2013810Znobna','listJourneysWithDetailsFromParentSegment','toLowerCase','rule','kind','folderId','name','listSegments','Warning:\x20Journey\x20','6494152GhqhNt','segments/','listFolders','length','reduce','push','journey','7640RzySJX','segment','Fetching\x20users\x20and\x20connections','Fetching\x20parent\x20segment\x20info','size','3792tafvkz','getLatestJourneyId','description','144CMcOce','activation_','.yml','activationParams','filter','54qmukdp','isNew','relationships','8086896nUKqoD','2hwbffR','join','journeyBundleName','getActivation','get','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','createdAt','data','attributes'];a150_0x2c8a=function(){return _0x4200df;};return a150_0x2c8a();}import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a150_0x477dea,normalizeJourneyDef,parseYamlString as a150_0x1c2718}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(_0x948010,_0x5c0427,_0x2d74af){const _0x6cb319=a150_0x859b,_0x26ce4b=a150_0x4a64a5[_0x6cb319(0x1f7)](_0x2d74af,_0x948010);if(existsSync(_0x948010)){const _0x5d5da2=readFileSync(_0x948010,_0x6cb319(0x1f9)),_0x50c70a=generateDiff(_0x5d5da2,_0x5c0427),_0x975621=hasChanges(_0x50c70a);return{'relativePath':_0x26ce4b,'absolutePath':_0x948010,'content':_0x5c0427,'isNew':![],'hasChanges':_0x975621,'diff':_0x975621?formatDiffWithColors(_0x50c70a):undefined};}return{'relativePath':_0x26ce4b,'absolutePath':_0x948010,'content':_0x5c0427,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x2d5ba9,_0x466247,_0x56074a){const _0x5974a2=a150_0x859b,_0x194a10=_0x2d5ba9+':'+_0x466247,_0x51c3c8=_0x56074a['get'](_0x194a10)||0x0;_0x56074a[_0x5974a2(0x1f5)](_0x194a10,_0x51c3c8+0x1);if(_0x51c3c8===0x0)return _0x466247;return _0x466247+'_'+(_0x51c3c8+0x1);}export async function pullSegments(_0x460129,_0x4ec4a6,_0x507298={}){const _0x14c01c=a150_0x859b,{targetDir:_0x3728ea,progress:_0x336d46}=_0x507298;_0x336d46?.[_0x14c01c(0x1f4)]('Resolving\x20parent\x20segment');const _0x4c40cc=await _0x460129[_0x14c01c(0x1d6)]['resolveParentId'](_0x4ec4a6);_0x336d46?.[_0x14c01c(0x1f4)](_0x14c01c(0x1d8));const _0x20b5dd=await _0x460129[_0x14c01c(0x1d6)][_0x14c01c(0x1fd)](_0x4c40cc),_0x33a9fe=_0x20b5dd[_0x14c01c(0x1ee)][_0x14c01c(0x1cb)];_0x336d46?.['update']('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x3a88f2,_0x201705,_0x253a21]=await Promise[_0x14c01c(0x1f8)]([_0x460129['segment'][_0x14c01c(0x1cc)](_0x4c40cc),_0x460129[_0x14c01c(0x1d6)][_0x14c01c(0x1d0)](_0x4c40cc),_0x460129[_0x14c01c(0x1d4)][_0x14c01c(0x1c6)](_0x4c40cc,{'includeAllVersions':!![]})]),{journeys:_0xa9bea9,activationStepsById:_0x37c557}=_0x253a21,_0xd3ca46=new Map();for(const _0x53da3a of _0xa9bea9){_0xd3ca46['set'](_0x53da3a['id'],_0x53da3a);}const _0x58daec=_0xa9bea9['map'](_0x3c098c=>({'id':_0x3c098c['id'],'name':_0x3c098c[_0x14c01c(0x1ee)][_0x14c01c(0x1cb)],'journeyBundleName':_0x3c098c[_0x14c01c(0x1ee)][_0x14c01c(0x1e8)]||'','journeyBundleId':_0x3c098c[_0x14c01c(0x1ee)]['journeyBundleId']||'','versionNumber':_0x3c098c[_0x14c01c(0x1ee)][_0x14c01c(0x204)],'description':_0x3c098c['attributes'][_0x14c01c(0x1dc)],'state':_0x3c098c[_0x14c01c(0x1ee)]['state'],'paused':_0x3c098c[_0x14c01c(0x1ee)][_0x14c01c(0x1f6)],'audienceId':_0x3c098c[_0x14c01c(0x1ee)]['audienceId'],'folderId':_0x3c098c[_0x14c01c(0x1e4)]?.[_0x14c01c(0x200)]?.[_0x14c01c(0x1ed)]?.['id'],'createdAt':_0x3c098c[_0x14c01c(0x1ee)][_0x14c01c(0x1ec)],'updatedAt':_0x3c098c[_0x14c01c(0x1ee)]['updatedAt']})),_0x4e50b4=buildFolderIdToPathMap(_0x201705),_0x1f4af2=_0x3728ea||_0x14c01c(0x1cf)+sanitizeFileName(_0x33a9fe);_0x336d46?.['update']('Fetching\x20activations');const _0x2fdad3=new Map();await batchAsync(_0x3a88f2,async _0x4d600d=>{const _0x4290af=_0x14c01c,_0x40b9fa=await _0x460129[_0x4290af(0x1d6)]['listActivations'](_0x4c40cc,_0x4d600d['id']);_0x2fdad3[_0x4290af(0x1f5)](_0x4d600d['id'],_0x40b9fa);}),_0x336d46?.[_0x14c01c(0x1f4)](_0x14c01c(0x1d7));const [_0x339198,_0x4c7507]=await Promise[_0x14c01c(0x1f8)]([_0x460129[_0x14c01c(0x201)][_0x14c01c(0x20a)](),_0x460129[_0x14c01c(0x1fb)][_0x14c01c(0x20d)]()]),_0x26dd7d=[],_0x100b8f=new Map(),_0x4783af=a150_0x4a64a5['join'](_0x1f4af2,'tdx.json'),_0x500b66=createTdxConfigContent(_0x33a9fe);_0x26dd7d[_0x14c01c(0x1d3)](prepareFile(_0x4783af,_0x500b66,_0x1f4af2));const _0x3157b7=new Map();for(const _0x5c7bbc of _0x3a88f2){_0x3157b7[_0x14c01c(0x1f5)](_0x5c7bbc['id'],_0x5c7bbc);}let _0x3fc831=_0x3a88f2;if(_0x507298[_0x14c01c(0x20b)]){const _0x247e82=_0x3a88f2[_0x14c01c(0x1e1)](_0x6ead44=>_0x6ead44[_0x14c01c(0x1cb)]['toLowerCase']()===_0x507298[_0x14c01c(0x20b)]['toLowerCase']());_0x247e82[_0x14c01c(0x1d1)]>0x0&&(_0x3fc831=_0x247e82);}_0x336d46?.[_0x14c01c(0x1f4)]('Processing\x20segments');for(const _0x5e3417 of _0x3fc831){if(_0x5e3417[_0x14c01c(0x1c9)]===SEGMENT_KIND_JOURNEY)continue;const _0x492876=_0x5e3417['segmentFolderId']?_0x4e50b4[_0x14c01c(0x1ea)](_0x5e3417[_0x14c01c(0x1fc)])||'':'',_0x55a2ee=_0x2fdad3[_0x14c01c(0x1ea)](_0x5e3417['id'])||[],_0x3f04eb=segmentWithActivationsToYaml(_0x5e3417,_0x55a2ee,undefined,_0x339198,_0x4c7507),_0x58f7f0=_0x492876?a150_0x4a64a5[_0x14c01c(0x1e7)](_0x1f4af2,_0x492876):_0x1f4af2,_0x269481=sanitizeFileName(_0x5e3417['name']),_0x108e0b=getUniqueFileName(_0x58f7f0,_0x269481,_0x100b8f),_0x133ee2=a150_0x4a64a5[_0x14c01c(0x1e7)](_0x58f7f0,_0x108e0b+_0x14c01c(0x1df)),_0xc76b75=segmentToYamlString(_0x3f04eb);_0x26dd7d[_0x14c01c(0x1d3)](prepareFile(_0x133ee2,_0xc76b75,_0x1f4af2));}const _0x269034=new Map();for(const _0x5484b6 of _0x58daec){const _0x34fb39=_0x5484b6['journeyBundleId'];!_0x269034['has'](_0x34fb39)&&_0x269034[_0x14c01c(0x1f5)](_0x34fb39,[]),_0x269034[_0x14c01c(0x1ea)](_0x34fb39)[_0x14c01c(0x1d3)](_0x5484b6);}for(const _0x4c1596 of _0x269034[_0x14c01c(0x1f0)]()){_0x4c1596[_0x14c01c(0x205)]((_0x3facc1,_0x52da1b)=>(_0x3facc1['versionNumber']||0x0)-(_0x52da1b['versionNumber']||0x0));}if(_0x507298[_0x14c01c(0x20b)]){const _0x5c168e=new Map();for(const [_0x5ce4b6,_0x170c87]of _0x269034){const _0x2dbf7b=_0x170c87[0x0]['journeyBundleName'];if(_0x2dbf7b['toLowerCase']()===_0x507298[_0x14c01c(0x20b)][_0x14c01c(0x1c7)]()){_0x5c168e[_0x14c01c(0x1f5)](_0x5ce4b6,_0x170c87);break;}}_0x269034['clear']();for(const [_0x4ea4be,_0x92d606]of _0x5c168e){_0x269034['set'](_0x4ea4be,_0x92d606);}}if(_0x269034[_0x14c01c(0x1d9)]>0x0){_0x336d46?.[_0x14c01c(0x1f4)](_0x14c01c(0x1f1));const _0x121246=Array[_0x14c01c(0x1ef)](_0x269034['values']()),_0x46772c=0x5,{createYamlContext:_0x3d88be}=createYamlContextForBundle(_0x460129,_0x3157b7,_0x339198,_0x4c7507,_0x37c557,_0xd3ca46);for(let _0x4af8e2=0x0;_0x4af8e2<_0x121246[_0x14c01c(0x1d1)];_0x4af8e2+=_0x46772c){const _0x1a8a17=_0x121246[_0x14c01c(0x208)](_0x4af8e2,_0x4af8e2+_0x46772c),_0x43eea2=await Promise[_0x14c01c(0x1f8)](_0x1a8a17[_0x14c01c(0x1fa)](async _0x1294f7=>{const _0x49df86=_0x14c01c,_0xfea350=_0x1294f7[0x0],_0x3bc5d7=_0xfea350[_0x49df86(0x1e8)];_0x336d46?.[_0x49df86(0x1f4)](_0x49df86(0x202)+_0x3bc5d7);const _0x374cef=_0xfea350[_0x49df86(0x1ca)]?_0x4e50b4['get'](_0xfea350[_0x49df86(0x1ca)])||'':'',_0x13e909=_0x374cef?a150_0x4a64a5[_0x49df86(0x1e7)](_0x1f4af2,_0x374cef):_0x1f4af2,_0x35330b=sanitizeFileName(_0x3bc5d7),_0x2e4181=a150_0x4a64a5[_0x49df86(0x1e7)](_0x13e909,_0x35330b+'.yml');let _0x23a198;if(existsSync(_0x2e4181))try{const _0x23d7e8=readFileSync(_0x2e4181,'utf-8'),_0xaad5b0=a150_0x1c2718(_0x23d7e8);_0x23a198=buildLocalRuleToNameMappingFromJourney(_0xaad5b0);}catch{}const _0x4873b6=[];for(const _0x21c2af of _0x1294f7){const _0x4d88a1=_0xd3ca46['get'](_0x21c2af['id']);if(!_0x4d88a1){_0x336d46?.[_0x49df86(0x1f4)](_0x49df86(0x1cd)+_0x21c2af['id']+_0x49df86(0x1eb));continue;}const _0x37c666=_0x4d88a1[_0x49df86(0x1ee)]?.['audienceId'],_0x155ba7=_0x3d88be(_0x21c2af['id'],_0x37c666),_0x19ea4b=await journeyResponseToDef(_0x4d88a1,_0x155ba7);_0x4873b6[_0x49df86(0x1d3)]({'item':_0x21c2af,'yaml':_0x19ea4b});}const _0x4564ba=await _0x460129['journey'][_0x49df86(0x1db)](_0xfea350[_0x49df86(0x20c)]),_0x3bcf76=buildMergedJourneyDef(_0x4873b6,_0x23a198,_0x4564ba);return{'bundleName':_0x3bc5d7,'folderPath':_0x374cef,'finalYaml':_0x3bcf76};}));for(const {bundleName:_0x1f5e5d,folderPath:_0x19f031,finalYaml:_0x43769d}of _0x43eea2){const _0x4e1d95=normalizeJourneyDef(_0x43769d),_0x337d4a=a150_0x477dea(_0x4e1d95),_0x55fe08=_0x19f031?a150_0x4a64a5[_0x14c01c(0x1e7)](_0x1f4af2,_0x19f031):_0x1f4af2,_0x4aa4b2=sanitizeFileName(_0x1f5e5d),_0x40daf8=getUniqueFileName(_0x55fe08,_0x4aa4b2,_0x100b8f),_0x1c7752=a150_0x4a64a5[_0x14c01c(0x1e7)](_0x55fe08,_0x40daf8+'.yml');_0x26dd7d[_0x14c01c(0x1d3)](prepareFile(_0x1c7752,_0x337d4a,_0x1f4af2));}}}const _0x19b6f8=Array[_0x14c01c(0x1ef)](_0x2fdad3[_0x14c01c(0x1f0)]())[_0x14c01c(0x1d2)]((_0x2c2d8c,_0x483055)=>_0x2c2d8c+_0x483055['length'],0x0),_0x5c5813=_0x3fc831[_0x14c01c(0x1e1)](_0x1ec4bb=>_0x1ec4bb[_0x14c01c(0x1c9)]!==SEGMENT_KIND_JOURNEY),_0x46b1d2=_0x26dd7d[_0x14c01c(0x1e1)](_0x4c0997=>_0x4c0997[_0x14c01c(0x1e3)])['length'],_0x760491=_0x26dd7d['filter'](_0x1ea29d=>!_0x1ea29d[_0x14c01c(0x1e3)]&&_0x1ea29d[_0x14c01c(0x1f2)])[_0x14c01c(0x1d1)],_0x39ec55=_0x26dd7d['filter'](_0x426bcc=>!_0x426bcc['isNew']&&!_0x426bcc['hasChanges'])[_0x14c01c(0x1d1)],_0x57ea44=Array[_0x14c01c(0x1ef)](_0x269034[_0x14c01c(0x1f0)]())['reduce']((_0x49dd93,_0x233dee)=>_0x49dd93+_0x233dee['length'],0x0);return{'parentName':_0x33a9fe,'parentId':_0x4c40cc,'targetDir':_0x1f4af2,'files':_0x26dd7d,'counts':{'segments':_0x5c5813[_0x14c01c(0x1d1)],'journeys':_0x269034[_0x14c01c(0x1d9)],'journeyVersions':_0x57ea44,'activations':_0x19b6f8},'newFiles':_0x46b1d2,'changedFiles':_0x760491,'unchangedFiles':_0x39ec55};}function createYamlContextForBundle(_0x5e1805,_0x2516a5,_0x3c7c7d,_0x1aa759,_0x1e5fd7,_0x7af58d){const _0x1f69b9=new Set(),_0x2782e4=new Map(),_0x515dce=new Map(),_0x3615bc=createJumpTargetCache(),_0x8eecf3=async(_0x2b0ec9,_0x140f30)=>{const _0x452a6c=a150_0x859b,_0x44dac3=_0x2782e4[_0x452a6c(0x1ea)](_0x2b0ec9);if(_0x44dac3!==undefined)return _0x44dac3;if(!_0x140f30)return _0x2b0ec9;try{let _0xba98ef=_0x2516a5[_0x452a6c(0x1ea)](_0x2b0ec9);!_0xba98ef&&(_0xba98ef=await _0x5e1805[_0x452a6c(0x1d6)][_0x452a6c(0x209)](_0x140f30,_0x2b0ec9),_0x2516a5[_0x452a6c(0x1f5)](_0x2b0ec9,_0xba98ef));const _0x19e268=generateJourneyLocalName(_0xba98ef['name']),_0x33b5fd=_0xba98ef['kind']===SEGMENT_KIND_JOURNEY&&_0x19e268!==undefined;if(_0x33b5fd&&_0x19e268){let _0x2dafc5=_0x19e268,_0x3aa3ed=0x2;while(_0x1f69b9[_0x452a6c(0x1fe)](_0x2dafc5)){_0x2dafc5=_0x19e268+'_'+_0x3aa3ed,_0x3aa3ed++;}return _0x1f69b9[_0x452a6c(0x1f3)](_0x2dafc5),_0x2782e4[_0x452a6c(0x1f5)](_0x2b0ec9,_0x2dafc5),_0x2dafc5;}return _0xba98ef['name'];}catch{return _0x2b0ec9;}},_0x5246e9=(_0x50d49c,_0x77833f)=>({'resolveSegment':async _0x54097d=>{const _0xbf59d9=a150_0x859b,_0x2a3b5a=_0x2782e4['get'](_0x54097d);if(_0x2a3b5a!==undefined)return{'name':_0x2a3b5a,'isJourneyLocal':!![]};if(!_0x77833f)return{'name':_0x54097d,'isJourneyLocal':![]};try{let _0xb99f85=_0x2516a5[_0xbf59d9(0x1ea)](_0x54097d);!_0xb99f85&&(_0xb99f85=await _0x5e1805['segment'][_0xbf59d9(0x209)](_0x77833f,_0x54097d),_0x2516a5[_0xbf59d9(0x1f5)](_0x54097d,_0xb99f85));const _0x3c0c1d=generateJourneyLocalName(_0xb99f85[_0xbf59d9(0x1cb)]),_0x4e1c1f=_0xb99f85[_0xbf59d9(0x1c9)]===SEGMENT_KIND_JOURNEY&&_0x3c0c1d!==undefined;if(_0x4e1c1f&&!_0xb99f85['rule']&&_0x77833f)try{const _0x44d1ff=await _0x5e1805['segment'][_0xbf59d9(0x209)](_0x77833f,_0x54097d);_0x2516a5[_0xbf59d9(0x1f5)](_0x54097d,_0x44d1ff),_0xb99f85=_0x44d1ff;}catch{}const _0x3ab3a0=await _0x8eecf3(_0x54097d,_0x77833f);let _0x21698e;if(_0x4e1c1f&&_0xb99f85[_0xbf59d9(0x1c8)]){const _0x3a0a65=await segmentResponseToDef(_0xb99f85,{'resolveSegmentName':_0x40e413=>_0x8eecf3(_0x40e413,_0x77833f)});_0x21698e={'description':_0xb99f85['description'],'rule':_0x3a0a65['rule']};}return{'name':_0x3ab3a0,'isJourneyLocal':_0x4e1c1f,'definition':_0x21698e};}catch{return{'name':_0x54097d,'isJourneyLocal':![]};}},'resolveActivation':async _0x4ca2c1=>{const _0x1019ef=a150_0x859b,_0x3cd83f=_0x515dce[_0x1019ef(0x1ea)](_0x4ca2c1);if(_0x3cd83f!==undefined)return{'name':_0x3cd83f,'isJourneyLocal':!![]};try{let _0x1bd989=_0x1e5fd7[_0x1019ef(0x1ea)](_0x4ca2c1);!_0x1bd989&&(_0x1bd989=await _0x5e1805['journey'][_0x1019ef(0x1e9)](_0x50d49c,_0x4ca2c1));const _0x4e92d6=_0x1bd989[_0x1019ef(0x1ee)][_0x1019ef(0x1e0)][_0x1019ef(0x1cb)]||_0x4ca2c1,_0x3053fc=sanitizeYamlKey(_0x4e92d6)||_0x1019ef(0x1de)+_0x4ca2c1,_0x438658=_0x3053fc;_0x515dce[_0x1019ef(0x1f5)](_0x4ca2c1,_0x438658);const _0x29efda=journeyActivationStepToYaml(_0x1bd989,_0x3c7c7d,_0x1aa759);return{'name':_0x438658,'isJourneyLocal':!![],'definition':_0x29efda};}catch{return{'name':_0x4ca2c1,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x1a1c81,_0x56e83)=>resolveJumpTarget(_0x1a1c81,_0x56e83,_0x3615bc,async _0x344616=>{const _0x29d293=a150_0x859b,_0x4ed4cc=_0x7af58d['get'](_0x344616);if(_0x4ed4cc)return _0x4ed4cc;return _0x5e1805[_0x29d293(0x1d4)]['getJourney'](_0x344616);})});return{'createYamlContext':_0x5246e9};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x563984,_0x4105d3){const _0x456582=a151_0x36f4,_0x3afb2a=_0x563984();while(!![]){try{const _0x2bac9f=-parseInt(_0x456582(0x17c))/0x1*(parseInt(_0x456582(0x16f))/0x2)+parseInt(_0x456582(0x16a))/0x3+parseInt(_0x456582(0x17a))/0x4*(-parseInt(_0x456582(0x178))/0x5)+-parseInt(_0x456582(0x181))/0x6+-parseInt(_0x456582(0x172))/0x7+-parseInt(_0x456582(0x173))/0x8*(parseInt(_0x456582(0x16e))/0x9)+parseInt(_0x456582(0x175))/0xa;if(_0x2bac9f===_0x4105d3)break;else _0x3afb2a['push'](_0x3afb2a['shift']());}catch(_0x4e98ad){_0x3afb2a['push'](_0x3afb2a['shift']());}}}(a151_0x3f4d,0x3198c));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a151_0x45f8c0 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x57da1c){const _0x3ab319=a151_0x36f4,_0x96df5=a151_0x45f8c0[_0x3ab319(0x17f)](_0x57da1c),_0x13c6d0=a151_0x45f8c0[_0x3ab319(0x16c)](_0x57da1c);return a151_0x45f8c0[_0x3ab319(0x170)](_0x96df5,'.'+_0x13c6d0+'.push-recovery.json');}export function readPushRecovery(_0x1258dc){const _0x43e7d4=a151_0x36f4,_0x1cfd21=getPushRecoveryPath(_0x1258dc);if(!existsSync(_0x1cfd21))return undefined;try{const _0x5d96c8=readFileSync(_0x1cfd21,_0x43e7d4(0x171)),_0x379865=JSON['parse'](_0x5d96c8);if(_0x379865?.[_0x43e7d4(0x169)]!==0x1||typeof _0x379865[_0x43e7d4(0x17d)]!==_0x43e7d4(0x179))return undefined;return _0x379865;}catch(_0x341e3b){return _0x341e3b instanceof SyntaxError?logger['debug'](_0x43e7d4(0x174)+_0x341e3b):logger[_0x43e7d4(0x16d)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x341e3b),undefined;}}function a151_0x36f4(_0x3c458d,_0x53f2ec){_0x3c458d=_0x3c458d-0x169;const _0x3f4d14=a151_0x3f4d();let _0x36f488=_0x3f4d14[_0x3c458d];return _0x36f488;}export function writePushRecovery(_0x5622bb,_0x56df5d){const _0x3daabc=a151_0x36f4,_0x2d43f0=getPushRecoveryPath(_0x5622bb),_0x55a00a=_0x2d43f0+_0x3daabc(0x17e);writeFileSync(_0x55a00a,JSON[_0x3daabc(0x17b)](_0x56df5d,null,0x2)+'\x0a',_0x3daabc(0x171)),renameSync(_0x55a00a,_0x2d43f0);}export function deletePushRecovery(_0x20dafc){const _0x31814d=a151_0x36f4,_0x17b931=getPushRecoveryPath(_0x20dafc);try{unlinkSync(_0x17b931);}catch(_0x3ef003){_0x3ef003[_0x31814d(0x16b)]!==_0x31814d(0x180)&&logger[_0x31814d(0x177)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x3ef003);}}export function saveSegmentToPushRecovery(_0x47cdc5,_0x4e28a5,_0x18457b,_0x52e6bc){const _0x33218e=a151_0x36f4,_0xaa27b4=readPushRecovery(_0x47cdc5),_0x19bc6e=_0xaa27b4?.[_0x33218e(0x17d)]===_0x4e28a5?{..._0xaa27b4,'updatedAt':new Date()[_0x33218e(0x182)]()}:{'version':0x1,'journeyName':_0x4e28a5,'updatedAt':new Date()[_0x33218e(0x182)](),'segments':{}};_0x19bc6e[_0x33218e(0x176)][_0x18457b]=_0x52e6bc,writePushRecovery(_0x47cdc5,_0x19bc6e);}function a151_0x3f4d(){const _0x2077a2=['208dkCYTN','journeyName','.tmp','dirname','ENOENT','1428768iephYf','toISOString','version','188406prvGCx','code','basename','warn','10107cYoWlx','2462xrIeaO','join','utf-8','275226OmYaqp','2720JXnmAV','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','10841070Sozdno','segments','debug','5pCddyw','string','113788NwMOTv','stringify'];a151_0x3f4d=function(){return _0x2077a2;};return a151_0x3f4d();}
|