@treasuredata/tdx 2026.7.4 → 2026.7.5
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.d.ts.map +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-command.js.map +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-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.d.ts +15 -3
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.d.ts +8 -0
- package/dist/sdk/cas/cas-audience-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js.map +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.d.ts +47 -1
- package/dist/sdk/cas/push-workflow.d.ts.map +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js.map +1 -1
- package/dist/sdk/cas/validate-files.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.d.ts +6 -6
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +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/llm/user-settings.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/deleted-table-validation.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cas.d.ts +5 -0
- package/dist/sdk/types/cas.d.ts.map +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/util/tree-search.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/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.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/proxy-fetch.js +1 -1
- package/dist/utils/proxy-fetch.js.map +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(_0x29f4bb,_0x24114f){const _0x139649=a156_0x1e5b,_0x3aed63=_0x29f4bb();while(!![]){try{const _0x23fda0=-parseInt(_0x139649(0xa0))/0x1+parseInt(_0x139649(0xd4))/0x2*(-parseInt(_0x139649(0x86))/0x3)+-parseInt(_0x139649(0x9c))/0x4*(parseInt(_0x139649(0xcd))/0x5)+-parseInt(_0x139649(0xb1))/0x6*(-parseInt(_0x139649(0xdd))/0x7)+-parseInt(_0x139649(0xc0))/0x8*(parseInt(_0x139649(0xe3))/0x9)+parseInt(_0x139649(0xb9))/0xa+parseInt(_0x139649(0xc9))/0xb;if(_0x23fda0===_0x24114f)break;else _0x3aed63['push'](_0x3aed63['shift']());}catch(_0x5cd8f7){_0x3aed63['push'](_0x3aed63['shift']());}}}(a156_0x52ac,0x945a6));import*as a156_0x66429 from'yaml';function formatScheduleTime(_0x5843c4){const _0xd24098=a156_0x1e5b;if(typeof _0x5843c4===_0xd24098(0xda)){const _0x416d59=Math[_0xd24098(0x9b)](_0x5843c4);return String(_0x416d59)[_0xd24098(0xad)](0x2,'0')+':00:00';}if(typeof _0x5843c4===_0xd24098(0xb3)){if(/^\d{2}:\d{2}:\d{2}$/[_0xd24098(0x8f)](_0x5843c4))return _0x5843c4;if(/^\d{1,2}:\d{2}$/[_0xd24098(0x8f)](_0x5843c4)){const [_0x5d72d4,_0x983667]=_0x5843c4[_0xd24098(0x8e)](':');return _0x5d72d4[_0xd24098(0xad)](0x2,'0')+':'+_0x983667+_0xd24098(0x93);}const _0x475ce6=parseInt(_0x5843c4,0xa);if(!isNaN(_0x475ce6)&&_0x5843c4[_0xd24098(0xeb)](/^\d+$/))return String(_0x475ce6)['padStart'](0x2,'0')+':00:00';return _0x5843c4;}return String(_0x5843c4);}export function apiToDef(_0x1401ed){const _0x41260a=a156_0x1e5b,_0x338564={'database':_0x1401ed[_0x41260a(0xbe)]?.[_0x41260a(0x8b)]||'','table':_0x1401ed['master']?.['parentTableName']||''};_0x1401ed[_0x41260a(0x85)]&&_0x1401ed[_0x41260a(0x85)][_0x41260a(0x84)]>0x0&&(_0x338564[_0x41260a(0xe5)]=_0x1401ed[_0x41260a(0x85)][_0x41260a(0xb4)](_0x581d76=>({'column':_0x581d76[_0x41260a(0xc2)],'values':_0x581d76[_0x41260a(0x92)]})));let _0x844a65;_0x1401ed[_0x41260a(0xd5)]&&_0x1401ed[_0x41260a(0xd5)]!=='none'&&(_0x844a65={'type':_0x1401ed[_0x41260a(0xd5)]},_0x1401ed[_0x41260a(0x91)]&&(_0x844a65['time']=formatScheduleTime(_0x1401ed[_0x41260a(0x91)])),_0x1401ed['timezone']&&(_0x844a65['timezone']=_0x1401ed[_0x41260a(0xc3)]));let _0x343b6f;(_0x1401ed[_0x41260a(0xce)]||_0x1401ed[_0x41260a(0x94)]||_0x1401ed[_0x41260a(0xe6)])&&(_0x343b6f={},_0x1401ed[_0x41260a(0xce)]&&(_0x343b6f[_0x41260a(0x8d)]=_0x1401ed[_0x41260a(0xce)]),_0x1401ed[_0x41260a(0x94)]&&(_0x343b6f[_0x41260a(0xae)]=_0x1401ed['hivePoolName']),_0x1401ed[_0x41260a(0xe6)]&&(_0x343b6f[_0x41260a(0x9e)]=_0x1401ed[_0x41260a(0xe6)]));const _0x116e79=_0x1401ed[_0x41260a(0x90)]&&_0x1401ed[_0x41260a(0x90)]['length']>0x0?groupAttributesBySource(_0x1401ed[_0x41260a(0x90)]):undefined,_0x2a3f3b=_0x1401ed[_0x41260a(0xb5)]&&_0x1401ed['behaviors'][_0x41260a(0x84)]>0x0?_0x1401ed['behaviors'][_0x41260a(0xb4)](convertApiBehaviorToYaml):undefined;let _0x3cfc90;_0x1401ed[_0x41260a(0xd3)]&&(_0x3cfc90={'name':_0x1401ed[_0x41260a(0xd3)][_0x41260a(0xb0)],'source':{'database':_0x1401ed['customerGroup'][_0x41260a(0x8b)],'table':_0x1401ed[_0x41260a(0xd3)][_0x41260a(0x97)]},'join':{'parent_key':_0x1401ed[_0x41260a(0xd3)]['foreignKey'],'child_key':_0x1401ed['customerGroup'][_0x41260a(0xd1)]}},_0x1401ed[_0x41260a(0xd3)][_0x41260a(0xc1)]&&_0x1401ed['customerGroup'][_0x41260a(0xc1)]['length']>0x0&&(_0x3cfc90[_0x41260a(0x90)]=groupAttributesBySource(_0x1401ed[_0x41260a(0xd3)]['customerGroupAttributes'])),_0x1401ed[_0x41260a(0xd3)]['customerGroupBehaviors']&&_0x1401ed[_0x41260a(0xd3)]['customerGroupBehaviors'][_0x41260a(0x84)]>0x0&&(_0x3cfc90[_0x41260a(0xb5)]=_0x1401ed[_0x41260a(0xd3)]['customerGroupBehaviors']['map'](convertApiBehaviorToYaml)));const _0x502789={'name':_0x1401ed[_0x41260a(0xb0)],..._0x1401ed[_0x41260a(0xef)]&&{'description':_0x1401ed['description']},'master':_0x338564,..._0x844a65&&{'schedule':_0x844a65},..._0x343b6f&&{'engine':_0x343b6f},..._0x116e79&&{'attributes':_0x116e79},..._0x2a3f3b&&{'behaviors':_0x2a3f3b},..._0x3cfc90&&{'customer_group':_0x3cfc90}};return _0x502789;}function groupAttributesBySource(_0x34ee0f){const _0x20ff5f=a156_0x1e5b,_0x3b38b6=new Map();for(const _0x134fd1 of _0x34ee0f){const _0x1243ad=_0x134fd1[_0x20ff5f(0x8b)]+'.'+_0x134fd1[_0x20ff5f(0x97)]+'.'+_0x134fd1[_0x20ff5f(0xd1)]+'.'+_0x134fd1[_0x20ff5f(0xea)];!_0x3b38b6[_0x20ff5f(0x9a)](_0x1243ad)&&_0x3b38b6[_0x20ff5f(0xec)](_0x1243ad,[]),_0x3b38b6[_0x20ff5f(0xa2)](_0x1243ad)[_0x20ff5f(0xa3)](_0x134fd1);}const _0x319add=[];for(const [,_0x50fb22]of _0x3b38b6){const _0x18a3e7=_0x50fb22[0x0],_0x21c8ae=_0x18a3e7[_0x20ff5f(0xe9)]||_0x18a3e7[_0x20ff5f(0x97)];_0x319add[_0x20ff5f(0xa3)]({'name':_0x21c8ae,'source':{'database':_0x18a3e7['parentDatabaseName'],'table':_0x18a3e7[_0x20ff5f(0x97)]},'join':{'parent_key':_0x18a3e7[_0x20ff5f(0xea)],'child_key':_0x18a3e7[_0x20ff5f(0xd1)]},'columns':_0x50fb22[_0x20ff5f(0xb4)](_0x4c4803=>{const _0xc8040f=_0x20ff5f,_0x1acfb0={'column':_0x4c4803[_0xc8040f(0xd6)],'type':_0x4c4803[_0xc8040f(0xe7)]};return _0x4c4803[_0xc8040f(0xb0)]!==_0x4c4803[_0xc8040f(0xd6)]&&(_0x1acfb0[_0xc8040f(0x9d)]=_0x4c4803['name']),_0x1acfb0;})});}return _0x319add;}function a156_0x1e5b(_0x2a96bf,_0x911a06){_0x2a96bf=_0x2a96bf-0x82;const _0x52ac9b=a156_0x52ac();let _0x1e5b9c=_0x52ac9b[_0x2a96bf];return _0x1e5b9c;}function convertApiBehaviorToYaml(_0xaf2ea9){const _0x3dafa5=a156_0x1e5b,_0x16385f={'name':_0xaf2ea9[_0x3dafa5(0xb0)],'source':{'database':_0xaf2ea9[_0x3dafa5(0x8b)],'table':_0xaf2ea9[_0x3dafa5(0x97)]},'join':{'parent_key':_0xaf2ea9['foreignKey'],'child_key':_0xaf2ea9[_0x3dafa5(0xd1)]}};if(_0xaf2ea9[_0x3dafa5(0xd2)])_0x16385f[_0x3dafa5(0xe4)]=!![];else _0xaf2ea9['schema']&&_0xaf2ea9['schema']['length']>0x0&&(_0x16385f[_0x3dafa5(0xbb)]=_0xaf2ea9[_0x3dafa5(0xbc)][_0x3dafa5(0xb4)](_0xe7c622=>{const _0x4ea2a0=_0x3dafa5,_0x102df9={'column':_0xe7c622['parentColumn'],'type':_0xe7c622[_0x4ea2a0(0xe7)]};return _0xe7c622[_0x4ea2a0(0xb0)]!==_0xe7c622[_0x4ea2a0(0xd6)]&&(_0x102df9['label']=_0xe7c622[_0x4ea2a0(0xb0)]),_0x102df9;}));return _0xaf2ea9[_0x3dafa5(0xbf)]&&(_0x16385f[_0x3dafa5(0xa1)]=_0xaf2ea9['defaultTimeFilterEnabled']),_0xaf2ea9[_0x3dafa5(0xee)]&&(_0x16385f[_0x3dafa5(0xd7)]=_0xaf2ea9['isRealtime']),_0x16385f;}export function defToApi(_0x4b7554){const _0x6b8d0c=a156_0x1e5b,_0x47a51a={'name':_0x4b7554['name'],'master':{'parentDatabaseName':_0x4b7554[_0x6b8d0c(0xbe)][_0x6b8d0c(0xaf)],'parentTableName':_0x4b7554['master'][_0x6b8d0c(0x89)]}};_0x4b7554['description']&&(_0x47a51a['description']=_0x4b7554[_0x6b8d0c(0xef)]);_0x4b7554['master']['filters']&&_0x4b7554['master']['filters'][_0x6b8d0c(0x84)]>0x0&&(_0x47a51a['audienceFilters']=_0x4b7554[_0x6b8d0c(0xbe)][_0x6b8d0c(0xe5)][_0x6b8d0c(0xb4)](_0x4f6b50=>({'columnName':_0x4f6b50['column'],'rightValues':_0x4f6b50[_0x6b8d0c(0xe2)]})));_0x4b7554[_0x6b8d0c(0xb2)]&&(_0x47a51a[_0x6b8d0c(0xd5)]=_0x4b7554[_0x6b8d0c(0xb2)][_0x6b8d0c(0xe7)],_0x4b7554[_0x6b8d0c(0xb2)][_0x6b8d0c(0xb7)]&&(_0x47a51a['scheduleOption']=_0x4b7554[_0x6b8d0c(0xb2)][_0x6b8d0c(0xb7)]),_0x4b7554['schedule'][_0x6b8d0c(0xc3)]&&(_0x47a51a[_0x6b8d0c(0xc3)]=_0x4b7554['schedule'][_0x6b8d0c(0xc3)]));_0x4b7554['engine']&&(_0x4b7554[_0x6b8d0c(0xde)]['hive_only']!==undefined&&(_0x47a51a[_0x6b8d0c(0xce)]=_0x4b7554[_0x6b8d0c(0xde)][_0x6b8d0c(0x8d)]),_0x4b7554[_0x6b8d0c(0xde)]['hive_pool']!==undefined&&(_0x47a51a[_0x6b8d0c(0x94)]=_0x4b7554['engine'][_0x6b8d0c(0xae)]),_0x4b7554[_0x6b8d0c(0xde)][_0x6b8d0c(0x9e)]!==undefined&&(_0x47a51a['prestoPoolName']=_0x4b7554[_0x6b8d0c(0xde)]['trino_pool']));_0x4b7554[_0x6b8d0c(0x90)]&&_0x4b7554[_0x6b8d0c(0x90)]['length']>0x0&&(_0x47a51a[_0x6b8d0c(0x90)]=flattenAttributeGroups(_0x4b7554[_0x6b8d0c(0x90)]));_0x4b7554['behaviors']&&_0x4b7554[_0x6b8d0c(0xb5)][_0x6b8d0c(0x84)]>0x0&&(_0x47a51a[_0x6b8d0c(0xb5)]=_0x4b7554['behaviors'][_0x6b8d0c(0xb4)](convertDefBehaviorToApi));if(_0x4b7554[_0x6b8d0c(0xaa)]){const _0x29b29f=_0x4b7554[_0x6b8d0c(0xaa)];_0x47a51a[_0x6b8d0c(0xd3)]={'name':_0x29b29f['name'],'parentDatabaseName':_0x29b29f[_0x6b8d0c(0x83)]['database'],'parentTableName':_0x29b29f['source'][_0x6b8d0c(0x89)],'parentKey':_0x29b29f['join'][_0x6b8d0c(0xe8)],'foreignKey':_0x29b29f['join']['parent_key']},_0x29b29f[_0x6b8d0c(0x90)]&&_0x29b29f[_0x6b8d0c(0x90)]['length']>0x0&&(_0x47a51a[_0x6b8d0c(0xd3)][_0x6b8d0c(0xc1)]=flattenAttributeGroups(_0x29b29f[_0x6b8d0c(0x90)])[_0x6b8d0c(0xb4)](_0x51003a=>({'name':_0x51003a['name'],'type':_0x51003a['type'],'parentDatabaseName':_0x51003a[_0x6b8d0c(0x8b)],'parentTableName':_0x51003a[_0x6b8d0c(0x97)],'parentColumn':_0x51003a[_0x6b8d0c(0xd6)],'parentKey':_0x51003a[_0x6b8d0c(0xd1)],'foreignKey':_0x51003a[_0x6b8d0c(0xea)]}))),_0x29b29f['behaviors']&&_0x29b29f['behaviors'][_0x6b8d0c(0x84)]>0x0&&(_0x47a51a['customerGroup'][_0x6b8d0c(0x82)]=_0x29b29f[_0x6b8d0c(0xb5)][_0x6b8d0c(0xb4)](_0x5d4c11=>({'name':_0x5d4c11[_0x6b8d0c(0xb0)],'parentDatabaseName':_0x5d4c11[_0x6b8d0c(0x83)]['database'],'parentTableName':_0x5d4c11[_0x6b8d0c(0x83)][_0x6b8d0c(0x89)],'parentKey':_0x5d4c11['join']['child_key'],'foreignKey':_0x5d4c11[_0x6b8d0c(0xb6)][_0x6b8d0c(0xc8)],'allColumns':_0x5d4c11[_0x6b8d0c(0xe4)],'schema':_0x5d4c11[_0x6b8d0c(0xbb)]?.[_0x6b8d0c(0xb4)](_0xdad517=>({'name':_0xdad517['label']||_0xdad517[_0x6b8d0c(0xa4)],'type':_0xdad517[_0x6b8d0c(0xe7)],'parentColumn':_0xdad517['column']}))})));}return _0x47a51a;}function flattenAttributeGroups(_0x28d8b7){const _0x33f4e1=a156_0x1e5b,_0x3dc223=[];for(const _0x3d3df2 of _0x28d8b7){for(const _0x49c598 of _0x3d3df2[_0x33f4e1(0xbb)]){_0x3dc223[_0x33f4e1(0xa3)]({'name':_0x49c598['label']||_0x49c598['column'],'type':_0x49c598[_0x33f4e1(0xe7)],'parentDatabaseName':_0x3d3df2[_0x33f4e1(0x83)]['database'],'parentTableName':_0x3d3df2[_0x33f4e1(0x83)][_0x33f4e1(0x89)],'parentColumn':_0x49c598[_0x33f4e1(0xa4)],'parentKey':_0x3d3df2[_0x33f4e1(0xb6)][_0x33f4e1(0xe8)],'foreignKey':_0x3d3df2['join'][_0x33f4e1(0xc8)],'groupingName':_0x3d3df2['name']});}}return _0x3dc223;}function convertDefBehaviorToApi(_0x5a112f){const _0x5bf2f9=a156_0x1e5b,_0x4bea8f={'name':_0x5a112f[_0x5bf2f9(0xb0)],'parentDatabaseName':_0x5a112f[_0x5bf2f9(0x83)][_0x5bf2f9(0xaf)],'parentTableName':_0x5a112f[_0x5bf2f9(0x83)][_0x5bf2f9(0x89)],'parentKey':_0x5a112f[_0x5bf2f9(0xb6)][_0x5bf2f9(0xe8)],'foreignKey':_0x5a112f[_0x5bf2f9(0xb6)][_0x5bf2f9(0xc8)]};if(_0x5a112f['all_columns'])_0x4bea8f[_0x5bf2f9(0xd2)]=!![];else _0x5a112f[_0x5bf2f9(0xbb)]&&_0x5a112f[_0x5bf2f9(0xbb)][_0x5bf2f9(0x84)]>0x0&&(_0x4bea8f[_0x5bf2f9(0xbc)]=_0x5a112f['columns'][_0x5bf2f9(0xb4)](_0x1b0e5e=>({'name':_0x1b0e5e[_0x5bf2f9(0x9d)]||_0x1b0e5e[_0x5bf2f9(0xa4)],'type':_0x1b0e5e[_0x5bf2f9(0xe7)],'parentColumn':_0x1b0e5e[_0x5bf2f9(0xa4)]})));return _0x5a112f[_0x5bf2f9(0xa1)]!==undefined&&(_0x4bea8f[_0x5bf2f9(0xbf)]=_0x5a112f[_0x5bf2f9(0xa1)]),_0x5a112f['realtime']!==undefined&&(_0x4bea8f[_0x5bf2f9(0xee)]=_0x5a112f['realtime']),_0x4bea8f;}function a156_0x52ac(){const _0x2b3f81=['workflowHiveOnly','personalization_services[','personalization_services:','parentKey','allColumns','customerGroup','437002ZESmUI','scheduleType','parentColumn','realtime','master:','imported_batch','number','column_name','single','56LrHDRa','engine','UTC','YAML\x20config\x20missing\x20required\x20field:\x20name','schedule:','values','3916629ZGRFYB','all_columns','filters','prestoPoolName','type','child_key','groupingName','foreignKey','match','set','realtime:','isRealtime','description','customerGroupBehaviors','source','length','audienceFilters','3GrsfdV','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','list','table','attributes:','parentDatabaseName','counter','hive_only','split','test','attributes','scheduleOption','rightValues',':00','hivePoolName','forEach','YAML\x20config\x20missing\x20required\x20field:\x20master','parentTableName','id_stitching','events','has','floor','1288oLPzlp','label','trino_pool','stringify','771490kuUhjG','default_time_filter','get','push','column','daily','null','primary_key','personalization_services','realtime.attributes[','customer_group','YAML\x20config\x20missing\x20required\x20field:\x20master.table','engine:','padStart','hive_pool','database','name','686838YVITAq','schedule','string','map','behaviors','join','time','includes','10554700NXvkZI','isArray','columns','schema',']:\x20Missing\x20required\x20field\x20\x27name\x27','master','defaultTimeFilterEnabled','8plpuiY','customerGroupAttributes','columnName','timezone','customer_id','events_table','ordered_set','parse','parent_key','5009158UvWetr','replace','):\x20Invalid\x20type\x20\x27','attribute_table','6115AqBgvt'];a156_0x52ac=function(){return _0x2b3f81;};return a156_0x52ac();}export function serializeDef(_0x1787c3){const _0x2eb406=a156_0x1e5b,_0x5da8ef=JSON[_0x2eb406(0xc7)](JSON[_0x2eb406(0x9f)](_0x1787c3)),_0x2b6eaf=a156_0x66429[_0x2eb406(0x9f)](_0x5da8ef,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x2eb406(0xa6)}),_0x1f7e11=[_0x2eb406(0xd8),_0x2eb406(0xe1),_0x2eb406(0xac),_0x2eb406(0x8a),'behaviors:','customer_group:',_0x2eb406(0xed),_0x2eb406(0xd0)];let _0x3277e4=_0x2b6eaf;for(const _0x3466af of _0x1f7e11){_0x3277e4=_0x3277e4[_0x2eb406(0xca)](new RegExp('^('+_0x3466af+')','m'),(_0x12f4b2,_0x5a9efa,_0x2693c3)=>{if(_0x2693c3===0x0||_0x3277e4[_0x2693c3-0x1]==='\x0a'&&_0x3277e4[_0x2693c3-0x2]==='\x0a')return _0x5a9efa;return'\x0a'+_0x5a9efa;});}return _0x3277e4;}export function parseDef(_0x381216){const _0x2f1fcf=a156_0x1e5b,_0x49984a=a156_0x66429[_0x2f1fcf(0xc7)](_0x381216);if(!_0x49984a[_0x2f1fcf(0xb0)])throw new Error(_0x2f1fcf(0xe0));if(!_0x49984a[_0x2f1fcf(0xbe)])throw new Error(_0x2f1fcf(0x96));if(!_0x49984a[_0x2f1fcf(0xbe)][_0x2f1fcf(0xaf)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x49984a[_0x2f1fcf(0xbe)][_0x2f1fcf(0x89)])throw new Error(_0x2f1fcf(0xab));return _0x49984a[_0x2f1fcf(0xd7)]&&validateRealtimeSection(_0x49984a[_0x2f1fcf(0xd7)]),_0x49984a[_0x2f1fcf(0xa8)]&&validatePersonalizationServices(_0x49984a['personalization_services']),_0x49984a;}function validateRealtimeSection(_0x1dea65){const _0x56ac84=a156_0x1e5b,_0x2b7465=[_0x56ac84(0xdc),_0x56ac84(0x8c),'set',_0x56ac84(0xc6),_0x56ac84(0x88),_0x56ac84(0xd9)];_0x1dea65[_0x56ac84(0x99)]&&Array[_0x56ac84(0xba)](_0x1dea65[_0x56ac84(0x99)])&&_0x1dea65[_0x56ac84(0x99)][_0x56ac84(0x95)]((_0x228290,_0x516808)=>{const _0x5b15db=_0x56ac84;if(!_0x228290[_0x5b15db(0xb0)])throw new Error('realtime.events['+_0x516808+_0x5b15db(0xbd));});_0x1dea65[_0x56ac84(0x90)]&&Array[_0x56ac84(0xba)](_0x1dea65[_0x56ac84(0x90)])&&_0x1dea65[_0x56ac84(0x90)][_0x56ac84(0x95)]((_0xab3ffd,_0x7e7fdf)=>{const _0x3d5137=_0x56ac84;if(!_0xab3ffd[_0x3d5137(0xb0)])throw new Error(_0x3d5137(0xa9)+_0x7e7fdf+_0x3d5137(0xbd));if(_0xab3ffd[_0x3d5137(0xe7)]&&!_0x2b7465[_0x3d5137(0xb8)](_0xab3ffd[_0x3d5137(0xe7)]))throw new Error(_0x3d5137(0xa9)+_0x7e7fdf+']\x20('+_0xab3ffd[_0x3d5137(0xb0)]+_0x3d5137(0xcb)+_0xab3ffd[_0x3d5137(0xe7)]+'\x27.\x20Must\x20be\x20one\x20of:\x20'+_0x2b7465[_0x3d5137(0xb6)](',\x20'));});if(_0x1dea65[_0x56ac84(0x98)]){if(!_0x1dea65[_0x56ac84(0x98)][_0x56ac84(0xa7)])throw new Error(_0x56ac84(0x87));}}function validatePersonalizationServices(_0x22abab){const _0xa5581a=a156_0x1e5b;if(!Array[_0xa5581a(0xba)](_0x22abab))throw new Error('personalization_services\x20must\x20be\x20an\x20array');_0x22abab[_0xa5581a(0x95)]((_0xecf7a6,_0x4b4035)=>{const _0x581dd3=_0xa5581a;if(!_0xecf7a6[_0x581dd3(0xb0)])throw new Error(_0x581dd3(0xcf)+_0x4b4035+_0x581dd3(0xbd));});}export function generateTemplate(_0xdd4c84,_0x1129e2,_0x3afe4e){const _0xd96bb1=a156_0x1e5b,_0xca991c={'name':_0xdd4c84,'description':'Parent\x20segment\x20description','master':{'database':_0x1129e2,'table':_0x3afe4e},'schedule':{'type':_0xd96bb1(0xa5),'time':'03:00','timezone':_0xd96bb1(0xdf)},'attributes':[{'name':'Example\x20Attributes','source':{'database':_0x1129e2,'table':_0xd96bb1(0xcc)},'join':{'parent_key':'id','child_key':_0xd96bb1(0xc4)},'columns':[{'column':_0xd96bb1(0xdb),'label':'Display\x20Name','type':_0xd96bb1(0xb3)}]}],'behaviors':[{'name':'Example\x20Events','source':{'database':_0x1129e2,'table':_0xd96bb1(0xc5)},'join':{'parent_key':'user_id','child_key':_0xd96bb1(0xc4)},'all_columns':!![]}]};return serializeDef(_0xca991c);}
|
|
1
|
+
function a156_0x567a(_0x42a3c7,_0x36aaab){_0x42a3c7=_0x42a3c7-0xa5;const _0x44b653=a156_0x44b6();let _0x567aae=_0x44b653[_0x42a3c7];return _0x567aae;}(function(_0x537734,_0x14e1f6){const _0x60a04e=a156_0x567a,_0x185e7b=_0x537734();while(!![]){try{const _0x108814=-parseInt(_0x60a04e(0xc8))/0x1+parseInt(_0x60a04e(0xfc))/0x2*(-parseInt(_0x60a04e(0xf7))/0x3)+parseInt(_0x60a04e(0xd2))/0x4*(parseInt(_0x60a04e(0xdf))/0x5)+parseInt(_0x60a04e(0xf0))/0x6+-parseInt(_0x60a04e(0xdb))/0x7+parseInt(_0x60a04e(0xf2))/0x8+parseInt(_0x60a04e(0x109))/0x9*(parseInt(_0x60a04e(0xfa))/0xa);if(_0x108814===_0x14e1f6)break;else _0x185e7b['push'](_0x185e7b['shift']());}catch(_0x5e1032){_0x185e7b['push'](_0x185e7b['shift']());}}}(a156_0x44b6,0x5941e));import*as a156_0x36cfba from'yaml';function formatScheduleTime(_0xaa9e2d){const _0x37b31d=a156_0x567a;if(typeof _0xaa9e2d===_0x37b31d(0xc0)){const _0x54f95f=Math['floor'](_0xaa9e2d);return String(_0x54f95f)[_0x37b31d(0xcf)](0x2,'0')+_0x37b31d(0xe5);}if(typeof _0xaa9e2d===_0x37b31d(0xad)){if(/^\d{2}:\d{2}:\d{2}$/[_0x37b31d(0xe0)](_0xaa9e2d))return _0xaa9e2d;if(/^\d{1,2}:\d{2}$/[_0x37b31d(0xe0)](_0xaa9e2d)){const [_0x2f2e28,_0x3b7f82]=_0xaa9e2d['split'](':');return _0x2f2e28['padStart'](0x2,'0')+':'+_0x3b7f82+_0x37b31d(0xe1);}const _0x42e301=parseInt(_0xaa9e2d,0xa);if(!isNaN(_0x42e301)&&_0xaa9e2d[_0x37b31d(0xb5)](/^\d+$/))return String(_0x42e301)[_0x37b31d(0xcf)](0x2,'0')+_0x37b31d(0xe5);return _0xaa9e2d;}return String(_0xaa9e2d);}export function apiToDef(_0x24af4d){const _0x44f97c=a156_0x567a,_0x5ce925={'database':_0x24af4d[_0x44f97c(0xd5)]?.['parentDatabaseName']||'','table':_0x24af4d[_0x44f97c(0xd5)]?.['parentTableName']||''};_0x24af4d[_0x44f97c(0xb8)]&&_0x24af4d[_0x44f97c(0xb8)][_0x44f97c(0xae)]>0x0&&(_0x5ce925['filters']=_0x24af4d[_0x44f97c(0xb8)][_0x44f97c(0xb2)](_0x1bca55=>({'column':_0x1bca55['columnName'],'values':_0x1bca55['rightValues']})));let _0x40fe7b;_0x24af4d[_0x44f97c(0xb9)]&&_0x24af4d[_0x44f97c(0xb9)]!==_0x44f97c(0xd7)&&(_0x40fe7b={'type':_0x24af4d[_0x44f97c(0xb9)]},_0x24af4d[_0x44f97c(0xd3)]&&(_0x40fe7b['time']=formatScheduleTime(_0x24af4d[_0x44f97c(0xd3)])),_0x24af4d[_0x44f97c(0xef)]&&(_0x40fe7b['timezone']=_0x24af4d['timezone']));let _0x469558;(_0x24af4d[_0x44f97c(0xec)]||_0x24af4d['hivePoolName']||_0x24af4d[_0x44f97c(0xee)])&&(_0x469558={},_0x24af4d[_0x44f97c(0xec)]&&(_0x469558[_0x44f97c(0xaf)]=_0x24af4d[_0x44f97c(0xec)]),_0x24af4d[_0x44f97c(0xfb)]&&(_0x469558[_0x44f97c(0xdd)]=_0x24af4d[_0x44f97c(0xfb)]),_0x24af4d[_0x44f97c(0xee)]&&(_0x469558['trino_pool']=_0x24af4d[_0x44f97c(0xee)]));const _0x3238e3=_0x24af4d[_0x44f97c(0xc3)]&&_0x24af4d[_0x44f97c(0xc3)][_0x44f97c(0xae)]>0x0?groupAttributesBySource(_0x24af4d[_0x44f97c(0xc3)]):undefined,_0x53fc17=_0x24af4d[_0x44f97c(0x106)]&&_0x24af4d['behaviors'][_0x44f97c(0xae)]>0x0?_0x24af4d[_0x44f97c(0x106)][_0x44f97c(0xb2)](convertApiBehaviorToYaml):undefined;let _0x2a9124;_0x24af4d[_0x44f97c(0xc7)]&&(_0x2a9124={'name':_0x24af4d[_0x44f97c(0xc7)][_0x44f97c(0xc2)],'source':{'database':_0x24af4d[_0x44f97c(0xc7)][_0x44f97c(0xa7)],'table':_0x24af4d[_0x44f97c(0xc7)][_0x44f97c(0x100)]},'join':{'parent_key':_0x24af4d['customerGroup']['foreignKey'],'child_key':_0x24af4d[_0x44f97c(0xc7)][_0x44f97c(0x10a)]}},_0x24af4d[_0x44f97c(0xc7)][_0x44f97c(0xd1)]&&_0x24af4d[_0x44f97c(0xc7)][_0x44f97c(0xd1)][_0x44f97c(0xae)]>0x0&&(_0x2a9124[_0x44f97c(0xc3)]=groupAttributesBySource(_0x24af4d['customerGroup'][_0x44f97c(0xd1)])),_0x24af4d[_0x44f97c(0xc7)][_0x44f97c(0xd6)]&&_0x24af4d[_0x44f97c(0xc7)]['customerGroupBehaviors']['length']>0x0&&(_0x2a9124[_0x44f97c(0x106)]=_0x24af4d['customerGroup'][_0x44f97c(0xd6)]['map'](convertApiBehaviorToYaml)));const _0x235884={'name':_0x24af4d[_0x44f97c(0xc2)],..._0x24af4d['description']&&{'description':_0x24af4d[_0x44f97c(0x10b)]},'master':_0x5ce925,..._0x40fe7b&&{'schedule':_0x40fe7b},..._0x469558&&{'engine':_0x469558},..._0x3238e3&&{'attributes':_0x3238e3},..._0x53fc17&&{'behaviors':_0x53fc17},..._0x2a9124&&{'customer_group':_0x2a9124}};return _0x235884;}function groupAttributesBySource(_0xe275bb){const _0x51dab5=a156_0x567a,_0x306659=new Map();for(const _0x13e4df of _0xe275bb){const _0x26c7cb=_0x13e4df[_0x51dab5(0xa7)]+'.'+_0x13e4df['parentTableName']+'.'+_0x13e4df['parentKey']+'.'+_0x13e4df['foreignKey'];!_0x306659[_0x51dab5(0xc9)](_0x26c7cb)&&_0x306659[_0x51dab5(0xab)](_0x26c7cb,[]),_0x306659[_0x51dab5(0x101)](_0x26c7cb)[_0x51dab5(0xe9)](_0x13e4df);}const _0x34585b=[];for(const [,_0x110254]of _0x306659){const _0x477bee=_0x110254[0x0],_0x5a712f=_0x477bee[_0x51dab5(0x107)]||_0x477bee['parentTableName'];_0x34585b[_0x51dab5(0xe9)]({'name':_0x5a712f,'source':{'database':_0x477bee[_0x51dab5(0xa7)],'table':_0x477bee[_0x51dab5(0x100)]},'join':{'parent_key':_0x477bee['foreignKey'],'child_key':_0x477bee['parentKey']},'columns':_0x110254['map'](_0x15f3a4=>{const _0x140520=_0x51dab5,_0x2efd76={'column':_0x15f3a4[_0x140520(0xb6)],'type':_0x15f3a4[_0x140520(0xb1)]};return _0x15f3a4[_0x140520(0xc2)]!==_0x15f3a4[_0x140520(0xb6)]&&(_0x2efd76[_0x140520(0xbb)]=_0x15f3a4[_0x140520(0xc2)]),_0x2efd76;})});}return _0x34585b;}function convertApiBehaviorToYaml(_0x423a9d){const _0x344f68=a156_0x567a,_0x132459={'name':_0x423a9d[_0x344f68(0xc2)],'source':{'database':_0x423a9d[_0x344f68(0xa7)],'table':_0x423a9d[_0x344f68(0x100)]},'join':{'parent_key':_0x423a9d[_0x344f68(0xca)],'child_key':_0x423a9d[_0x344f68(0x10a)]}};if(_0x423a9d[_0x344f68(0xc5)])_0x132459[_0x344f68(0xb7)]=!![];else _0x423a9d[_0x344f68(0xea)]&&_0x423a9d[_0x344f68(0xea)][_0x344f68(0xae)]>0x0&&(_0x132459['columns']=_0x423a9d['schema']['map'](_0xbe7224=>{const _0x10def4=_0x344f68,_0xa1ec9d={'column':_0xbe7224[_0x10def4(0xb6)],'type':_0xbe7224['type']};return _0xbe7224['name']!==_0xbe7224[_0x10def4(0xb6)]&&(_0xa1ec9d['label']=_0xbe7224[_0x10def4(0xc2)]),_0xa1ec9d;}));return _0x423a9d[_0x344f68(0xed)]&&(_0x132459['default_time_filter']=_0x423a9d['defaultTimeFilterEnabled']),_0x423a9d[_0x344f68(0xaa)]&&(_0x132459[_0x344f68(0xeb)]=_0x423a9d['isRealtime']),_0x132459;}export function defToApi(_0x421909){const _0x3dada1=a156_0x567a,_0x15f855={'name':_0x421909[_0x3dada1(0xc2)],'master':{'parentDatabaseName':_0x421909[_0x3dada1(0xd5)][_0x3dada1(0x102)],'parentTableName':_0x421909[_0x3dada1(0xd5)]['table']}};_0x421909['description']&&(_0x15f855[_0x3dada1(0x10b)]=_0x421909['description']);_0x421909[_0x3dada1(0xd5)]['filters']&&_0x421909['master'][_0x3dada1(0xc1)]['length']>0x0&&(_0x15f855[_0x3dada1(0xb8)]=_0x421909[_0x3dada1(0xd5)][_0x3dada1(0xc1)][_0x3dada1(0xb2)](_0x288f6d=>({'columnName':_0x288f6d[_0x3dada1(0xc6)],'rightValues':_0x288f6d[_0x3dada1(0xe7)]})));_0x421909[_0x3dada1(0xde)]&&(_0x15f855[_0x3dada1(0xb9)]=_0x421909[_0x3dada1(0xde)][_0x3dada1(0xb1)],_0x421909[_0x3dada1(0xde)][_0x3dada1(0xac)]&&(_0x15f855['scheduleOption']=_0x421909['schedule']['time']),_0x421909[_0x3dada1(0xde)][_0x3dada1(0xef)]&&(_0x15f855[_0x3dada1(0xef)]=_0x421909[_0x3dada1(0xde)]['timezone']));_0x421909[_0x3dada1(0xbe)]&&(_0x421909[_0x3dada1(0xbe)][_0x3dada1(0xaf)]!==undefined&&(_0x15f855['workflowHiveOnly']=_0x421909[_0x3dada1(0xbe)][_0x3dada1(0xaf)]),_0x421909[_0x3dada1(0xbe)]['hive_pool']!==undefined&&(_0x15f855[_0x3dada1(0xfb)]=_0x421909[_0x3dada1(0xbe)][_0x3dada1(0xdd)]),_0x421909[_0x3dada1(0xbe)]['trino_pool']!==undefined&&(_0x15f855[_0x3dada1(0xee)]=_0x421909[_0x3dada1(0xbe)][_0x3dada1(0xf5)]));_0x421909['attributes']&&_0x421909[_0x3dada1(0xc3)]['length']>0x0&&(_0x15f855['attributes']=flattenAttributeGroups(_0x421909[_0x3dada1(0xc3)]));_0x421909[_0x3dada1(0x106)]&&_0x421909[_0x3dada1(0x106)]['length']>0x0&&(_0x15f855[_0x3dada1(0x106)]=_0x421909[_0x3dada1(0x106)][_0x3dada1(0xb2)](convertDefBehaviorToApi));if(_0x421909['customer_group']){const _0x465894=_0x421909[_0x3dada1(0xff)];_0x15f855[_0x3dada1(0xc7)]={'name':_0x465894[_0x3dada1(0xc2)],'parentDatabaseName':_0x465894[_0x3dada1(0xf4)][_0x3dada1(0x102)],'parentTableName':_0x465894[_0x3dada1(0xf4)]['table'],'parentKey':_0x465894[_0x3dada1(0xcd)][_0x3dada1(0xf6)],'foreignKey':_0x465894['join']['parent_key']},_0x465894[_0x3dada1(0xc3)]&&_0x465894[_0x3dada1(0xc3)]['length']>0x0&&(_0x15f855[_0x3dada1(0xc7)][_0x3dada1(0xd1)]=flattenAttributeGroups(_0x465894['attributes'])[_0x3dada1(0xb2)](_0xb89127=>({'name':_0xb89127[_0x3dada1(0xc2)],'type':_0xb89127[_0x3dada1(0xb1)],'parentDatabaseName':_0xb89127['parentDatabaseName'],'parentTableName':_0xb89127[_0x3dada1(0x100)],'parentColumn':_0xb89127['parentColumn'],'parentKey':_0xb89127[_0x3dada1(0x10a)],'foreignKey':_0xb89127[_0x3dada1(0xca)]}))),_0x465894['behaviors']&&_0x465894[_0x3dada1(0x106)][_0x3dada1(0xae)]>0x0&&(_0x15f855[_0x3dada1(0xc7)]['customerGroupBehaviors']=_0x465894[_0x3dada1(0x106)][_0x3dada1(0xb2)](_0x22435c=>({'name':_0x22435c[_0x3dada1(0xc2)],'parentDatabaseName':_0x22435c[_0x3dada1(0xf4)][_0x3dada1(0x102)],'parentTableName':_0x22435c['source']['table'],'parentKey':_0x22435c['join'][_0x3dada1(0xf6)],'foreignKey':_0x22435c['join'][_0x3dada1(0xcb)],'allColumns':_0x22435c[_0x3dada1(0xb7)],'schema':_0x22435c[_0x3dada1(0xfe)]?.['map'](_0x3f414a=>({'name':_0x3f414a[_0x3dada1(0xbb)]||_0x3f414a[_0x3dada1(0xc6)],'type':_0x3f414a['type'],'parentColumn':_0x3f414a[_0x3dada1(0xc6)]}))})));}return _0x15f855;}function flattenAttributeGroups(_0x260959){const _0x33eb3d=a156_0x567a,_0x562c58=[];for(const _0x52c94b of _0x260959){for(const _0x33834d of _0x52c94b[_0x33eb3d(0xfe)]){_0x562c58[_0x33eb3d(0xe9)]({'name':_0x33834d[_0x33eb3d(0xbb)]||_0x33834d[_0x33eb3d(0xc6)],'type':_0x33834d[_0x33eb3d(0xb1)],'parentDatabaseName':_0x52c94b['source'][_0x33eb3d(0x102)],'parentTableName':_0x52c94b[_0x33eb3d(0xf4)]['table'],'parentColumn':_0x33834d[_0x33eb3d(0xc6)],'parentKey':_0x52c94b['join'][_0x33eb3d(0xf6)],'foreignKey':_0x52c94b[_0x33eb3d(0xcd)][_0x33eb3d(0xcb)],'groupingName':_0x52c94b[_0x33eb3d(0xc2)]});}}return _0x562c58;}function convertDefBehaviorToApi(_0x54fff5){const _0x3b99ba=a156_0x567a,_0x58e98d={'name':_0x54fff5[_0x3b99ba(0xc2)],'parentDatabaseName':_0x54fff5[_0x3b99ba(0xf4)][_0x3b99ba(0x102)],'parentTableName':_0x54fff5[_0x3b99ba(0xf4)]['table'],'parentKey':_0x54fff5[_0x3b99ba(0xcd)]['child_key'],'foreignKey':_0x54fff5['join']['parent_key']};if(_0x54fff5['all_columns'])_0x58e98d[_0x3b99ba(0xc5)]=!![];else _0x54fff5[_0x3b99ba(0xfe)]&&_0x54fff5[_0x3b99ba(0xfe)][_0x3b99ba(0xae)]>0x0&&(_0x58e98d['schema']=_0x54fff5['columns'][_0x3b99ba(0xb2)](_0x473234=>({'name':_0x473234[_0x3b99ba(0xbb)]||_0x473234[_0x3b99ba(0xc6)],'type':_0x473234[_0x3b99ba(0xb1)],'parentColumn':_0x473234[_0x3b99ba(0xc6)]})));return _0x54fff5[_0x3b99ba(0xe3)]!==undefined&&(_0x58e98d['defaultTimeFilterEnabled']=_0x54fff5[_0x3b99ba(0xe3)]),_0x54fff5[_0x3b99ba(0xeb)]!==undefined&&(_0x58e98d[_0x3b99ba(0xaa)]=_0x54fff5['realtime']),_0x58e98d;}export function serializeDef(_0x28de22){const _0x7721da=a156_0x567a,_0x31fdb5=JSON[_0x7721da(0x105)](JSON[_0x7721da(0xa5)](_0x28de22)),_0x43875b=a156_0x36cfba[_0x7721da(0xa5)](_0x31fdb5,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x7721da(0xbd)}),_0x2d455c=['master:','schedule:',_0x7721da(0xcc),'attributes:','behaviors:','customer_group:','realtime:',_0x7721da(0xc4)];let _0x217607=_0x43875b;for(const _0x4cd906 of _0x2d455c){_0x217607=_0x217607[_0x7721da(0xe8)](new RegExp('^('+_0x4cd906+')','m'),(_0x24096a,_0xe43c6c,_0x19788c)=>{if(_0x19788c===0x0||_0x217607[_0x19788c-0x1]==='\x0a'&&_0x217607[_0x19788c-0x2]==='\x0a')return _0xe43c6c;return'\x0a'+_0xe43c6c;});}return _0x217607;}export function parseDef(_0x4832cd){const _0x68a609=a156_0x567a,_0x420a4d=a156_0x36cfba[_0x68a609(0x105)](_0x4832cd);if(!_0x420a4d[_0x68a609(0xc2)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x420a4d[_0x68a609(0xd5)])throw new Error(_0x68a609(0xfd));if(!_0x420a4d[_0x68a609(0xd5)][_0x68a609(0x102)])throw new Error(_0x68a609(0xbf));if(!_0x420a4d[_0x68a609(0xd5)]['table'])throw new Error(_0x68a609(0xba));return _0x420a4d[_0x68a609(0xeb)]&&validateRealtimeSection(_0x420a4d['realtime']),_0x420a4d[_0x68a609(0x10c)]&&validatePersonalizationServices(_0x420a4d['personalization_services']),_0x420a4d;}function validateRealtimeSection(_0x15d046){const _0x9aae5=a156_0x567a,_0x9a3ed3=[_0x9aae5(0xf3),_0x9aae5(0xa6),'set',_0x9aae5(0xf9),'list',_0x9aae5(0xa9)];_0x15d046['events']&&Array[_0x9aae5(0xe2)](_0x15d046[_0x9aae5(0xd9)])&&_0x15d046[_0x9aae5(0xd9)]['forEach']((_0xd01e7d,_0x3ad3cf)=>{const _0x571d49=_0x9aae5;if(!_0xd01e7d[_0x571d49(0xc2)])throw new Error(_0x571d49(0xb0)+_0x3ad3cf+']:\x20Missing\x20required\x20field\x20\x27name\x27');});_0x15d046[_0x9aae5(0xc3)]&&Array[_0x9aae5(0xe2)](_0x15d046[_0x9aae5(0xc3)])&&_0x15d046[_0x9aae5(0xc3)][_0x9aae5(0xf8)]((_0x3edaac,_0x320ec5)=>{const _0x5c34f8=_0x9aae5;if(!_0x3edaac['name'])throw new Error(_0x5c34f8(0xa8)+_0x320ec5+_0x5c34f8(0xb4));if(_0x3edaac['type']&&!_0x9a3ed3[_0x5c34f8(0xb3)](_0x3edaac[_0x5c34f8(0xb1)]))throw new Error('realtime.attributes['+_0x320ec5+_0x5c34f8(0xe4)+_0x3edaac[_0x5c34f8(0xc2)]+'):\x20Invalid\x20type\x20\x27'+_0x3edaac[_0x5c34f8(0xb1)]+'\x27.\x20Must\x20be\x20one\x20of:\x20'+_0x9a3ed3['join'](',\x20'));});if(_0x15d046[_0x9aae5(0xd0)]){if(!_0x15d046[_0x9aae5(0xd0)][_0x9aae5(0xe6)])throw new Error(_0x9aae5(0x108));}}function a156_0x44b6(){const _0xdbbee9=['column','customerGroup','9348hTnhys','has','foreignKey','parent_key','engine:','join','Example\x20Events','padStart','id_stitching','customerGroupAttributes','11924BbxYTC','scheduleOption','Example\x20Attributes','master','customerGroupBehaviors','none','events_table','events','attribute_table','5071710YkAXlb','column_name','hive_pool','schedule','295muqRSz','test',':00','isArray','default_time_filter',']\x20(',':00:00','primary_key','values','replace','push','schema','realtime','workflowHiveOnly','defaultTimeFilterEnabled','prestoPoolName','timezone','1101522FPTLzI','personalization_services[','2433240HENorm','single','source','trino_pool','child_key','33tsVXWO','forEach','ordered_set','430YNIjHK','hivePoolName','129804DjsRfF','YAML\x20config\x20missing\x20required\x20field:\x20master','columns','customer_group','parentTableName','get','database','Display\x20Name','customer_id','parse','behaviors','groupingName','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','240651KfefPl','parentKey','description','personalization_services','stringify','counter','parentDatabaseName','realtime.attributes[','imported_batch','isRealtime','set','time','string','length','hive_only','realtime.events[','type','map','includes',']:\x20Missing\x20required\x20field\x20\x27name\x27','match','parentColumn','all_columns','audienceFilters','scheduleType','YAML\x20config\x20missing\x20required\x20field:\x20master.table','label','Parent\x20segment\x20description','null','engine','YAML\x20config\x20missing\x20required\x20field:\x20master.database','number','filters','name','attributes','personalization_services:','allColumns'];a156_0x44b6=function(){return _0xdbbee9;};return a156_0x44b6();}function validatePersonalizationServices(_0x4d3a57){const _0x1aec8b=a156_0x567a;if(!Array[_0x1aec8b(0xe2)](_0x4d3a57))throw new Error('personalization_services\x20must\x20be\x20an\x20array');_0x4d3a57[_0x1aec8b(0xf8)]((_0x1e5817,_0x204f99)=>{const _0x45ac74=_0x1aec8b;if(!_0x1e5817[_0x45ac74(0xc2)])throw new Error(_0x45ac74(0xf1)+_0x204f99+_0x45ac74(0xb4));});}export function generateTemplate(_0x340cfc,_0x31fc80,_0x420412){const _0x522bca=a156_0x567a,_0x38ed23={'name':_0x340cfc,'description':_0x522bca(0xbc),'master':{'database':_0x31fc80,'table':_0x420412},'schedule':{'type':'daily','time':'03:00','timezone':'UTC'},'attributes':[{'name':_0x522bca(0xd4),'source':{'database':_0x31fc80,'table':_0x522bca(0xda)},'join':{'parent_key':'id','child_key':_0x522bca(0x104)},'columns':[{'column':_0x522bca(0xdc),'label':_0x522bca(0x103),'type':_0x522bca(0xad)}]}],'behaviors':[{'name':_0x522bca(0xce),'source':{'database':_0x31fc80,'table':_0x522bca(0xd8)},'join':{'parent_key':'user_id','child_key':_0x522bca(0x104)},'all_columns':!![]}]};return serializeDef(_0x38ed23);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a157_0x5b7c(){const _0x4735ba=['reduce','join','Fetching\x20segments,\x20folders,\x20and\x20journeys','update','journeyBundleId','slice','33664JdJLzD','segments/','add','3565688olSyVS','Warning:\x20Journey\x20','27568QoQLbv','createdAt','get','values','segmentFolderId','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','835865fLWuRU','1408524LPhLKh','rule','getSegment','push','paused','map','827486mzxrhD','buildIdToNameMap','listSegments','hasChanges','journeyBundleName','filter','listJourneysWithDetailsFromParentSegment','size','Processing\x20journeys','connection','set','versionNumber','listFolders','name','Fetching\x20activations','from','description','segment','isNew','attributes','buildIdToEmailMap','state','.yml','audienceId','parentFolder','Fetching\x20users\x20and\x20connections','tdx.json','targetResourceName','relative','getJourney','folderId','user','utf-8','Processing\x20segments','getParent','activationParams','all','kind','866205XYOvZV','getActivation','has','51KTDzBU','Fetching\x20parent\x20segment\x20info','journey','length','30GRaFIb','toLowerCase','250eWEnBx','getLatestJourneyId'];a157_0x5b7c=function(){return _0x4735ba;};return a157_0x5b7c();}(function(_0x45cff1,_0x290f0b){const _0x1da2f2=a157_0x11ac,_0x5cc356=_0x45cff1();while(!![]){try{const _0x17d8fb=-parseInt(_0x1da2f2(0x1e9))/0x1+-parseInt(_0x1da2f2(0x1e3))/0x2+-parseInt(_0x1da2f2(0x1c9))/0x3*(parseInt(_0x1da2f2(0x1dc))/0x4)+parseInt(_0x1da2f2(0x1e2))/0x5*(-parseInt(_0x1da2f2(0x1cd))/0x6)+parseInt(_0x1da2f2(0x1da))/0x7+parseInt(_0x1da2f2(0x1d7))/0x8+-parseInt(_0x1da2f2(0x1c6))/0x9*(-parseInt(_0x1da2f2(0x1cf))/0xa);if(_0x17d8fb===_0x290f0b)break;else _0x5cc356['push'](_0x5cc356['shift']());}catch(_0x364a7e){_0x5cc356['push'](_0x5cc356['shift']());}}}(a157_0x5b7c,0x6a2fc));import a157_0x2a8a52 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a157_0x3cb878,normalizeJourneyDef,parseYamlString as a157_0xb99287}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 a157_0x11ac(_0x33bf30,_0x4318a5){_0x33bf30=_0x33bf30-0x1b6;const _0x5b7c57=a157_0x5b7c();let _0x11ac24=_0x5b7c57[_0x33bf30];return _0x11ac24;}function prepareFile(_0x1fc4e0,_0x32f9d9,_0x1678ca){const _0x109b5e=a157_0x11ac,_0x38cea5=a157_0x2a8a52[_0x109b5e(0x1bc)](_0x1678ca,_0x1fc4e0);if(existsSync(_0x1fc4e0)){const _0x5cf05c=readFileSync(_0x1fc4e0,_0x109b5e(0x1c0)),_0x3975bd=generateDiff(_0x5cf05c,_0x32f9d9),_0x5d6a9f=hasChanges(_0x3975bd);return{'relativePath':_0x38cea5,'absolutePath':_0x1fc4e0,'content':_0x32f9d9,'isNew':![],'hasChanges':_0x5d6a9f,'diff':_0x5d6a9f?formatDiffWithColors(_0x3975bd):undefined};}return{'relativePath':_0x38cea5,'absolutePath':_0x1fc4e0,'content':_0x32f9d9,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x5d0589,_0x1225da,_0x8c9bf1){const _0x3c5cd=a157_0x11ac,_0x564e37=_0x5d0589+':'+_0x1225da,_0x993c6=_0x8c9bf1[_0x3c5cd(0x1de)](_0x564e37)||0x0;_0x8c9bf1[_0x3c5cd(0x1f3)](_0x564e37,_0x993c6+0x1);if(_0x993c6===0x0)return _0x1225da;return _0x1225da+'_'+(_0x993c6+0x1);}export async function pullSegments(_0x2cccfb,_0x378ddc,_0x2efcdc={}){const _0x593e17=a157_0x11ac,{targetDir:_0x5b67da,progress:_0x214c96}=_0x2efcdc;_0x214c96?.[_0x593e17(0x1d4)]('Resolving\x20parent\x20segment');const _0x978d7e=await _0x2cccfb[_0x593e17(0x1fa)]['resolveParentId'](_0x378ddc);_0x214c96?.['update'](_0x593e17(0x1ca));const _0x49190b=await _0x2cccfb[_0x593e17(0x1fa)][_0x593e17(0x1c2)](_0x978d7e),_0x4ac99b=_0x49190b[_0x593e17(0x1fc)]['name'];_0x214c96?.[_0x593e17(0x1d4)](_0x593e17(0x1d3));const [_0x3d305c,_0x37b61a,_0x7b1b3c]=await Promise[_0x593e17(0x1c4)]([_0x2cccfb[_0x593e17(0x1fa)][_0x593e17(0x1eb)](_0x978d7e),_0x2cccfb['segment'][_0x593e17(0x1f5)](_0x978d7e),_0x2cccfb[_0x593e17(0x1cb)][_0x593e17(0x1ef)](_0x978d7e,{'includeAllVersions':!![]})]),{journeys:_0x5f31e5,activationStepsById:_0xc58456}=_0x7b1b3c,_0x377409=new Map();for(const _0x1fbb5a of _0x5f31e5){_0x377409[_0x593e17(0x1f3)](_0x1fbb5a['id'],_0x1fbb5a);}const _0x2839c1=_0x5f31e5[_0x593e17(0x1e8)](_0x5dbdbc=>({'id':_0x5dbdbc['id'],'name':_0x5dbdbc['attributes']['name'],'journeyBundleName':_0x5dbdbc[_0x593e17(0x1fc)][_0x593e17(0x1ed)]||'','journeyBundleId':_0x5dbdbc[_0x593e17(0x1fc)]['journeyBundleId']||'','versionNumber':_0x5dbdbc[_0x593e17(0x1fc)][_0x593e17(0x1f4)],'description':_0x5dbdbc[_0x593e17(0x1fc)]['description'],'state':_0x5dbdbc[_0x593e17(0x1fc)][_0x593e17(0x1fe)],'paused':_0x5dbdbc[_0x593e17(0x1fc)][_0x593e17(0x1e7)],'audienceId':_0x5dbdbc[_0x593e17(0x1fc)][_0x593e17(0x1b7)],'folderId':_0x5dbdbc['relationships']?.[_0x593e17(0x1b8)]?.['data']?.['id'],'createdAt':_0x5dbdbc[_0x593e17(0x1fc)][_0x593e17(0x1dd)],'updatedAt':_0x5dbdbc[_0x593e17(0x1fc)]['updatedAt']})),_0x53a626=buildFolderIdToPathMap(_0x37b61a),_0x1b8b04=_0x5b67da||_0x593e17(0x1d8)+sanitizeFileName(_0x4ac99b);_0x214c96?.[_0x593e17(0x1d4)](_0x593e17(0x1f7));const _0x5ab24a=new Map();await batchAsync(_0x3d305c,async _0x1dc7c3=>{const _0xd09d36=_0x593e17,_0x5524b4=await _0x2cccfb[_0xd09d36(0x1fa)]['listActivations'](_0x978d7e,_0x1dc7c3['id']);_0x5ab24a[_0xd09d36(0x1f3)](_0x1dc7c3['id'],_0x5524b4);}),_0x214c96?.['update'](_0x593e17(0x1b9));const [_0xa14b4b,_0x1c3f1d]=await Promise[_0x593e17(0x1c4)]([_0x2cccfb[_0x593e17(0x1bf)][_0x593e17(0x1fd)](),_0x2cccfb[_0x593e17(0x1f2)][_0x593e17(0x1ea)]()]),_0x2dfe91=[],_0x26e3e8=new Map(),_0x31130c=a157_0x2a8a52[_0x593e17(0x1d2)](_0x1b8b04,_0x593e17(0x1ba)),_0x34b3e4=createTdxConfigContent(_0x4ac99b);_0x2dfe91['push'](prepareFile(_0x31130c,_0x34b3e4,_0x1b8b04));const _0x2d42fb=new Map();for(const _0x536ad5 of _0x3d305c){_0x2d42fb['set'](_0x536ad5['id'],_0x536ad5);}let _0x6c2a13=_0x3d305c;if(_0x2efcdc[_0x593e17(0x1bb)]){const _0x526c1d=_0x3d305c['filter'](_0x18a3e1=>_0x18a3e1[_0x593e17(0x1f6)]['toLowerCase']()===_0x2efcdc['targetResourceName'][_0x593e17(0x1ce)]());_0x526c1d[_0x593e17(0x1cc)]>0x0&&(_0x6c2a13=_0x526c1d);}_0x214c96?.[_0x593e17(0x1d4)](_0x593e17(0x1c1));for(const _0x360139 of _0x6c2a13){if(_0x360139['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x271d44=_0x360139[_0x593e17(0x1e0)]?_0x53a626[_0x593e17(0x1de)](_0x360139['segmentFolderId'])||'':'',_0xeea7cc=_0x5ab24a[_0x593e17(0x1de)](_0x360139['id'])||[],_0x2de964=segmentWithActivationsToYaml(_0x360139,_0xeea7cc,undefined,_0xa14b4b,_0x1c3f1d),_0x2e3cb2=_0x271d44?a157_0x2a8a52[_0x593e17(0x1d2)](_0x1b8b04,_0x271d44):_0x1b8b04,_0x2cde30=sanitizeFileName(_0x360139[_0x593e17(0x1f6)]),_0x34c186=getUniqueFileName(_0x2e3cb2,_0x2cde30,_0x26e3e8),_0x53a24c=a157_0x2a8a52['join'](_0x2e3cb2,_0x34c186+'.yml'),_0x1b8d15=segmentToYamlString(_0x2de964);_0x2dfe91[_0x593e17(0x1e6)](prepareFile(_0x53a24c,_0x1b8d15,_0x1b8b04));}const _0xa67427=new Map();for(const _0x571f2d of _0x2839c1){const _0x286f89=_0x571f2d[_0x593e17(0x1d5)];!_0xa67427[_0x593e17(0x1c8)](_0x286f89)&&_0xa67427[_0x593e17(0x1f3)](_0x286f89,[]),_0xa67427[_0x593e17(0x1de)](_0x286f89)['push'](_0x571f2d);}for(const _0x3abe70 of _0xa67427[_0x593e17(0x1df)]()){_0x3abe70['sort']((_0x43497f,_0x2e4281)=>(_0x43497f[_0x593e17(0x1f4)]||0x0)-(_0x2e4281['versionNumber']||0x0));}if(_0x2efcdc['targetResourceName']){const _0x261cfb=new Map();for(const [_0x54c1c4,_0x33d17e]of _0xa67427){const _0x18c006=_0x33d17e[0x0]['journeyBundleName'];if(_0x18c006['toLowerCase']()===_0x2efcdc[_0x593e17(0x1bb)][_0x593e17(0x1ce)]()){_0x261cfb['set'](_0x54c1c4,_0x33d17e);break;}}_0xa67427['clear']();for(const [_0x180907,_0x2df248]of _0x261cfb){_0xa67427['set'](_0x180907,_0x2df248);}}if(_0xa67427[_0x593e17(0x1f0)]>0x0){_0x214c96?.[_0x593e17(0x1d4)](_0x593e17(0x1f1));const _0x469430=Array[_0x593e17(0x1f8)](_0xa67427['values']()),_0x130551=0x5,{createYamlContext:_0x176699}=createYamlContextForBundle(_0x2cccfb,_0x2d42fb,_0xa14b4b,_0x1c3f1d,_0xc58456,_0x377409);for(let _0x184dc5=0x0;_0x184dc5<_0x469430[_0x593e17(0x1cc)];_0x184dc5+=_0x130551){const _0x30522c=_0x469430[_0x593e17(0x1d6)](_0x184dc5,_0x184dc5+_0x130551),_0x387004=await Promise[_0x593e17(0x1c4)](_0x30522c['map'](async _0x565b31=>{const _0x40d42f=_0x593e17,_0x322505=_0x565b31[0x0],_0xe1e9a7=_0x322505[_0x40d42f(0x1ed)];_0x214c96?.[_0x40d42f(0x1d4)]('Processing\x20journey:\x20'+_0xe1e9a7);const _0x3df44d=_0x322505[_0x40d42f(0x1be)]?_0x53a626[_0x40d42f(0x1de)](_0x322505[_0x40d42f(0x1be)])||'':'',_0xc9cbcc=_0x3df44d?a157_0x2a8a52[_0x40d42f(0x1d2)](_0x1b8b04,_0x3df44d):_0x1b8b04,_0x3c0d5b=sanitizeFileName(_0xe1e9a7),_0x14c75b=a157_0x2a8a52[_0x40d42f(0x1d2)](_0xc9cbcc,_0x3c0d5b+_0x40d42f(0x1b6));let _0x41682;if(existsSync(_0x14c75b))try{const _0x2826bb=readFileSync(_0x14c75b,'utf-8'),_0x186b31=a157_0xb99287(_0x2826bb);_0x41682=buildLocalRuleToNameMappingFromJourney(_0x186b31);}catch{}const _0x58767a=[];for(const _0x568afe of _0x565b31){const _0x11ac4b=_0x377409['get'](_0x568afe['id']);if(!_0x11ac4b){_0x214c96?.[_0x40d42f(0x1d4)](_0x40d42f(0x1db)+_0x568afe['id']+_0x40d42f(0x1e1));continue;}const _0x26948e=_0x11ac4b['attributes']?.[_0x40d42f(0x1b7)],_0x4c15b4=_0x176699(_0x568afe['id'],_0x26948e),_0x45bb16=await journeyResponseToDef(_0x11ac4b,_0x4c15b4);_0x58767a[_0x40d42f(0x1e6)]({'item':_0x568afe,'yaml':_0x45bb16});}const _0xa34cf=await _0x2cccfb[_0x40d42f(0x1cb)][_0x40d42f(0x1d0)](_0x322505[_0x40d42f(0x1d5)]),_0x26e180=buildMergedJourneyDef(_0x58767a,_0x41682,_0xa34cf);return{'bundleName':_0xe1e9a7,'folderPath':_0x3df44d,'finalYaml':_0x26e180};}));for(const {bundleName:_0x47c629,folderPath:_0x4b5502,finalYaml:_0x160087}of _0x387004){const _0x526cd7=normalizeJourneyDef(_0x160087),_0x2805ed=a157_0x3cb878(_0x526cd7),_0x3ee793=_0x4b5502?a157_0x2a8a52[_0x593e17(0x1d2)](_0x1b8b04,_0x4b5502):_0x1b8b04,_0x4be149=sanitizeFileName(_0x47c629),_0x5c6f4f=getUniqueFileName(_0x3ee793,_0x4be149,_0x26e3e8),_0x152fc7=a157_0x2a8a52[_0x593e17(0x1d2)](_0x3ee793,_0x5c6f4f+_0x593e17(0x1b6));_0x2dfe91[_0x593e17(0x1e6)](prepareFile(_0x152fc7,_0x2805ed,_0x1b8b04));}}}const _0x39b782=Array[_0x593e17(0x1f8)](_0x5ab24a[_0x593e17(0x1df)]())[_0x593e17(0x1d1)]((_0x59924e,_0x363c50)=>_0x59924e+_0x363c50[_0x593e17(0x1cc)],0x0),_0x951c8d=_0x6c2a13[_0x593e17(0x1ee)](_0x3332f2=>_0x3332f2[_0x593e17(0x1c5)]!==SEGMENT_KIND_JOURNEY),_0x2094d2=_0x2dfe91[_0x593e17(0x1ee)](_0x4d0182=>_0x4d0182['isNew'])[_0x593e17(0x1cc)],_0x4140fa=_0x2dfe91[_0x593e17(0x1ee)](_0x1419b9=>!_0x1419b9[_0x593e17(0x1fb)]&&_0x1419b9['hasChanges'])['length'],_0xe8447d=_0x2dfe91[_0x593e17(0x1ee)](_0x56bf6a=>!_0x56bf6a[_0x593e17(0x1fb)]&&!_0x56bf6a[_0x593e17(0x1ec)])[_0x593e17(0x1cc)],_0x2556c1=Array[_0x593e17(0x1f8)](_0xa67427[_0x593e17(0x1df)]())[_0x593e17(0x1d1)]((_0x4ef8b6,_0x13d16b)=>_0x4ef8b6+_0x13d16b[_0x593e17(0x1cc)],0x0);return{'parentName':_0x4ac99b,'parentId':_0x978d7e,'targetDir':_0x1b8b04,'files':_0x2dfe91,'counts':{'segments':_0x951c8d[_0x593e17(0x1cc)],'journeys':_0xa67427['size'],'journeyVersions':_0x2556c1,'activations':_0x39b782},'newFiles':_0x2094d2,'changedFiles':_0x4140fa,'unchangedFiles':_0xe8447d};}function createYamlContextForBundle(_0x5ec1df,_0x217fa4,_0x3b721e,_0x1294ab,_0x5f596e,_0x54ecc6){const _0x2fcf72=new Set(),_0x4b7791=new Map(),_0x37fedd=new Map(),_0x510677=createJumpTargetCache(),_0x4b65cf=async(_0x4019c0,_0x549318)=>{const _0x20d23f=a157_0x11ac,_0x87083c=_0x4b7791[_0x20d23f(0x1de)](_0x4019c0);if(_0x87083c!==undefined)return _0x87083c;if(!_0x549318)return _0x4019c0;try{let _0x14f30d=_0x217fa4[_0x20d23f(0x1de)](_0x4019c0);!_0x14f30d&&(_0x14f30d=await _0x5ec1df[_0x20d23f(0x1fa)][_0x20d23f(0x1e5)](_0x549318,_0x4019c0),_0x217fa4[_0x20d23f(0x1f3)](_0x4019c0,_0x14f30d));const _0x3c0c10=generateJourneyLocalName(_0x14f30d[_0x20d23f(0x1f6)]),_0x88f5a1=_0x14f30d['kind']===SEGMENT_KIND_JOURNEY&&_0x3c0c10!==undefined;if(_0x88f5a1&&_0x3c0c10){let _0x292fb3=_0x3c0c10,_0x533509=0x2;while(_0x2fcf72[_0x20d23f(0x1c8)](_0x292fb3)){_0x292fb3=_0x3c0c10+'_'+_0x533509,_0x533509++;}return _0x2fcf72[_0x20d23f(0x1d9)](_0x292fb3),_0x4b7791[_0x20d23f(0x1f3)](_0x4019c0,_0x292fb3),_0x292fb3;}return _0x14f30d[_0x20d23f(0x1f6)];}catch{return _0x4019c0;}},_0x499e3b=(_0x79d3d2,_0x23c90e)=>({'resolveSegment':async _0x2e1b0c=>{const _0x2796f5=a157_0x11ac,_0x74f2be=_0x4b7791['get'](_0x2e1b0c);if(_0x74f2be!==undefined)return{'name':_0x74f2be,'isJourneyLocal':!![]};if(!_0x23c90e)return{'name':_0x2e1b0c,'isJourneyLocal':![]};try{let _0x28ef2c=_0x217fa4[_0x2796f5(0x1de)](_0x2e1b0c);!_0x28ef2c&&(_0x28ef2c=await _0x5ec1df[_0x2796f5(0x1fa)][_0x2796f5(0x1e5)](_0x23c90e,_0x2e1b0c),_0x217fa4[_0x2796f5(0x1f3)](_0x2e1b0c,_0x28ef2c));const _0x43e736=generateJourneyLocalName(_0x28ef2c['name']),_0x44ced8=_0x28ef2c[_0x2796f5(0x1c5)]===SEGMENT_KIND_JOURNEY&&_0x43e736!==undefined;if(_0x44ced8&&!_0x28ef2c[_0x2796f5(0x1e4)]&&_0x23c90e)try{const _0x485aee=await _0x5ec1df[_0x2796f5(0x1fa)][_0x2796f5(0x1e5)](_0x23c90e,_0x2e1b0c);_0x217fa4[_0x2796f5(0x1f3)](_0x2e1b0c,_0x485aee),_0x28ef2c=_0x485aee;}catch{}const _0x65ca13=await _0x4b65cf(_0x2e1b0c,_0x23c90e);let _0x4fd2bd;if(_0x44ced8&&_0x28ef2c[_0x2796f5(0x1e4)]){const _0x21cfe0=await segmentResponseToDef(_0x28ef2c,{'resolveSegmentName':_0x5b15b1=>_0x4b65cf(_0x5b15b1,_0x23c90e)});_0x4fd2bd={'description':_0x28ef2c[_0x2796f5(0x1f9)],'rule':_0x21cfe0[_0x2796f5(0x1e4)]};}return{'name':_0x65ca13,'isJourneyLocal':_0x44ced8,'definition':_0x4fd2bd};}catch{return{'name':_0x2e1b0c,'isJourneyLocal':![]};}},'resolveActivation':async _0x3b5719=>{const _0x2fe1b2=a157_0x11ac,_0x557ad3=_0x37fedd[_0x2fe1b2(0x1de)](_0x3b5719);if(_0x557ad3!==undefined)return{'name':_0x557ad3,'isJourneyLocal':!![]};try{let _0x465e54=_0x5f596e[_0x2fe1b2(0x1de)](_0x3b5719);!_0x465e54&&(_0x465e54=await _0x5ec1df['journey'][_0x2fe1b2(0x1c7)](_0x79d3d2,_0x3b5719));const _0x4a44e4=_0x465e54['attributes'][_0x2fe1b2(0x1c3)]['name']||_0x3b5719,_0x4d8397=sanitizeYamlKey(_0x4a44e4)||'activation_'+_0x3b5719,_0x328143=_0x4d8397;_0x37fedd['set'](_0x3b5719,_0x328143);const _0x63e54d=journeyActivationStepToYaml(_0x465e54,_0x3b721e,_0x1294ab);return{'name':_0x328143,'isJourneyLocal':!![],'definition':_0x63e54d};}catch{return{'name':_0x3b5719,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xf14a9c,_0x3943c2)=>resolveJumpTarget(_0xf14a9c,_0x3943c2,_0x510677,async _0x1ae01d=>{const _0x10fc82=a157_0x11ac,_0x367df1=_0x54ecc6[_0x10fc82(0x1de)](_0x1ae01d);if(_0x367df1)return _0x367df1;return _0x5ec1df[_0x10fc82(0x1cb)][_0x10fc82(0x1bd)](_0x1ae01d);})});return{'createYamlContext':_0x499e3b};}
|
|
1
|
+
(function(_0x55f14b,_0x5ecc6b){const _0x273254=a157_0x4690,_0x120efa=_0x55f14b();while(!![]){try{const _0x3ebc7d=parseInt(_0x273254(0x1ea))/0x1*(parseInt(_0x273254(0x21d))/0x2)+-parseInt(_0x273254(0x209))/0x3+parseInt(_0x273254(0x225))/0x4+parseInt(_0x273254(0x1ef))/0x5+-parseInt(_0x273254(0x1e1))/0x6*(parseInt(_0x273254(0x1fa))/0x7)+-parseInt(_0x273254(0x20b))/0x8+parseInt(_0x273254(0x1e3))/0x9;if(_0x3ebc7d===_0x5ecc6b)break;else _0x120efa['push'](_0x120efa['shift']());}catch(_0x1ff9ae){_0x120efa['push'](_0x120efa['shift']());}}}(a157_0x4b83,0x9c2dd));import a157_0x28743c from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a157_0x4b83(){const _0x3302b2=['getLatestJourneyId','journeyBundleId','filter','Processing\x20segments','Fetching\x20users\x20and\x20connections','parentFolder','size','relationships','paused','folderId','journey','33294ZUVHYc','name','6383264blSLSF','data','getJourney','getSegment','length','utf-8','getParent','audienceId','listFolders','getActivation','update','Warning:\x20Journey\x20','map','versionNumber','.yml','from','all','has','4eWhiaM','join','Fetching\x20parent\x20segment\x20info','attributes','toLowerCase','description','Processing\x20journey:\x20','add','4400848abUEaQ','relative','buildIdToNameMap','createdAt','Fetching\x20activations','rule','reduce','888RBjhEW','values','6257376YEqAKu','journeyBundleName','activation_','slice','tdx.json','Processing\x20journeys','set','172662ZnSCje','segmentFolderId','segment','segments/','clear','2868055DbNNrB','kind','state','listJourneysWithDetailsFromParentSegment','Resolving\x20parent\x20segment','targetResourceName','push','isNew','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','listActivations','buildIdToEmailMap','59864hejOtE','activationParams','get','listSegments'];a157_0x4b83=function(){return _0x3302b2;};return a157_0x4b83();}import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';function a157_0x4690(_0x4f051f,_0x5434a0){_0x4f051f=_0x4f051f-0x1e0;const _0x4b8303=a157_0x4b83();let _0x469099=_0x4b8303[_0x4f051f];return _0x469099;}import{journeyResponseToDef,toYamlString as a157_0xc21078,normalizeJourneyDef,parseYamlString as a157_0x939490}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(_0x185701,_0x420632,_0x198024){const _0x55410c=a157_0x4690,_0x4e77bf=a157_0x28743c[_0x55410c(0x226)](_0x198024,_0x185701);if(existsSync(_0x185701)){const _0x143d1c=readFileSync(_0x185701,_0x55410c(0x210)),_0x57ebb4=generateDiff(_0x143d1c,_0x420632),_0xa5277c=hasChanges(_0x57ebb4);return{'relativePath':_0x4e77bf,'absolutePath':_0x185701,'content':_0x420632,'isNew':![],'hasChanges':_0xa5277c,'diff':_0xa5277c?formatDiffWithColors(_0x57ebb4):undefined};}return{'relativePath':_0x4e77bf,'absolutePath':_0x185701,'content':_0x420632,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x37deb7,_0x4e0951,_0x2dbefe){const _0x4e2154=a157_0x4690,_0x4f0cdc=_0x37deb7+':'+_0x4e0951,_0x45ae71=_0x2dbefe[_0x4e2154(0x1fc)](_0x4f0cdc)||0x0;_0x2dbefe[_0x4e2154(0x1e9)](_0x4f0cdc,_0x45ae71+0x1);if(_0x45ae71===0x0)return _0x4e0951;return _0x4e0951+'_'+(_0x45ae71+0x1);}export async function pullSegments(_0x37ecb3,_0x47e83f,_0x4e9e5a={}){const _0xb6515c=a157_0x4690,{targetDir:_0x161aa0,progress:_0x2de60f}=_0x4e9e5a;_0x2de60f?.[_0xb6515c(0x215)](_0xb6515c(0x1f3));const _0xd7369c=await _0x37ecb3['segment']['resolveParentId'](_0x47e83f);_0x2de60f?.[_0xb6515c(0x215)](_0xb6515c(0x21f));const _0xfc477e=await _0x37ecb3[_0xb6515c(0x1ec)][_0xb6515c(0x211)](_0xd7369c),_0x3394b4=_0xfc477e[_0xb6515c(0x220)][_0xb6515c(0x20a)];_0x2de60f?.['update']('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x49d53a,_0x5bf6d1,_0x4412b9]=await Promise[_0xb6515c(0x21b)]([_0x37ecb3[_0xb6515c(0x1ec)][_0xb6515c(0x1fd)](_0xd7369c),_0x37ecb3[_0xb6515c(0x1ec)][_0xb6515c(0x213)](_0xd7369c),_0x37ecb3[_0xb6515c(0x208)][_0xb6515c(0x1f2)](_0xd7369c,{'includeAllVersions':!![]})]),{journeys:_0x25908d,activationStepsById:_0x2fb869}=_0x4412b9,_0xb63a12=new Map();for(const _0x173ec8 of _0x25908d){_0xb63a12[_0xb6515c(0x1e9)](_0x173ec8['id'],_0x173ec8);}const _0x2a3210=_0x25908d[_0xb6515c(0x217)](_0x5a725e=>({'id':_0x5a725e['id'],'name':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x20a)],'journeyBundleName':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x1e4)]||'','journeyBundleId':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x1ff)]||'','versionNumber':_0x5a725e['attributes']['versionNumber'],'description':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x222)],'state':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x1f1)],'paused':_0x5a725e[_0xb6515c(0x220)][_0xb6515c(0x206)],'audienceId':_0x5a725e['attributes'][_0xb6515c(0x212)],'folderId':_0x5a725e[_0xb6515c(0x205)]?.[_0xb6515c(0x203)]?.[_0xb6515c(0x20c)]?.['id'],'createdAt':_0x5a725e['attributes'][_0xb6515c(0x228)],'updatedAt':_0x5a725e['attributes']['updatedAt']})),_0x9c1bdc=buildFolderIdToPathMap(_0x5bf6d1),_0x19c83d=_0x161aa0||_0xb6515c(0x1ed)+sanitizeFileName(_0x3394b4);_0x2de60f?.['update'](_0xb6515c(0x229));const _0x16b58b=new Map();await batchAsync(_0x49d53a,async _0x30fcdc=>{const _0x563132=_0xb6515c,_0x4014c5=await _0x37ecb3[_0x563132(0x1ec)][_0x563132(0x1f8)](_0xd7369c,_0x30fcdc['id']);_0x16b58b[_0x563132(0x1e9)](_0x30fcdc['id'],_0x4014c5);}),_0x2de60f?.[_0xb6515c(0x215)](_0xb6515c(0x202));const [_0x5bbebf,_0x3d4945]=await Promise[_0xb6515c(0x21b)]([_0x37ecb3['user'][_0xb6515c(0x1f9)](),_0x37ecb3['connection'][_0xb6515c(0x227)]()]),_0x1c7bcd=[],_0xe11d0f=new Map(),_0x1e0d22=a157_0x28743c[_0xb6515c(0x21e)](_0x19c83d,_0xb6515c(0x1e7)),_0xe303dc=createTdxConfigContent(_0x3394b4);_0x1c7bcd[_0xb6515c(0x1f5)](prepareFile(_0x1e0d22,_0xe303dc,_0x19c83d));const _0x4f5803=new Map();for(const _0x1f1d89 of _0x49d53a){_0x4f5803[_0xb6515c(0x1e9)](_0x1f1d89['id'],_0x1f1d89);}let _0x50aa36=_0x49d53a;if(_0x4e9e5a['targetResourceName']){const _0x4d657d=_0x49d53a[_0xb6515c(0x200)](_0x38d19d=>_0x38d19d[_0xb6515c(0x20a)][_0xb6515c(0x221)]()===_0x4e9e5a[_0xb6515c(0x1f4)][_0xb6515c(0x221)]());_0x4d657d[_0xb6515c(0x20f)]>0x0&&(_0x50aa36=_0x4d657d);}_0x2de60f?.[_0xb6515c(0x215)](_0xb6515c(0x201));for(const _0x25099f of _0x50aa36){if(_0x25099f['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x649e0a=_0x25099f[_0xb6515c(0x1eb)]?_0x9c1bdc[_0xb6515c(0x1fc)](_0x25099f['segmentFolderId'])||'':'',_0x382516=_0x16b58b['get'](_0x25099f['id'])||[],_0x41b262=segmentWithActivationsToYaml(_0x25099f,_0x382516,undefined,_0x5bbebf,_0x3d4945),_0x39be70=_0x649e0a?a157_0x28743c['join'](_0x19c83d,_0x649e0a):_0x19c83d,_0x480718=sanitizeFileName(_0x25099f[_0xb6515c(0x20a)]),_0x26918d=getUniqueFileName(_0x39be70,_0x480718,_0xe11d0f),_0x23a7b1=a157_0x28743c[_0xb6515c(0x21e)](_0x39be70,_0x26918d+_0xb6515c(0x219)),_0x3ec52a=segmentToYamlString(_0x41b262);_0x1c7bcd[_0xb6515c(0x1f5)](prepareFile(_0x23a7b1,_0x3ec52a,_0x19c83d));}const _0x4e9f4c=new Map();for(const _0x36839e of _0x2a3210){const _0x124a9a=_0x36839e[_0xb6515c(0x1ff)];!_0x4e9f4c[_0xb6515c(0x21c)](_0x124a9a)&&_0x4e9f4c[_0xb6515c(0x1e9)](_0x124a9a,[]),_0x4e9f4c[_0xb6515c(0x1fc)](_0x124a9a)[_0xb6515c(0x1f5)](_0x36839e);}for(const _0x4da12c of _0x4e9f4c[_0xb6515c(0x1e2)]()){_0x4da12c['sort']((_0x7cd6fb,_0x4134ba)=>(_0x7cd6fb[_0xb6515c(0x218)]||0x0)-(_0x4134ba[_0xb6515c(0x218)]||0x0));}if(_0x4e9e5a['targetResourceName']){const _0x252c5f=new Map();for(const [_0x4a8819,_0x3773b2]of _0x4e9f4c){const _0x207061=_0x3773b2[0x0][_0xb6515c(0x1e4)];if(_0x207061[_0xb6515c(0x221)]()===_0x4e9e5a['targetResourceName'][_0xb6515c(0x221)]()){_0x252c5f['set'](_0x4a8819,_0x3773b2);break;}}_0x4e9f4c[_0xb6515c(0x1ee)]();for(const [_0x1301c6,_0x4dd9f7]of _0x252c5f){_0x4e9f4c['set'](_0x1301c6,_0x4dd9f7);}}if(_0x4e9f4c[_0xb6515c(0x204)]>0x0){_0x2de60f?.[_0xb6515c(0x215)](_0xb6515c(0x1e8));const _0x14ea09=Array[_0xb6515c(0x21a)](_0x4e9f4c[_0xb6515c(0x1e2)]()),_0x1ef9f4=0x5,{createYamlContext:_0x41ae7b}=createYamlContextForBundle(_0x37ecb3,_0x4f5803,_0x5bbebf,_0x3d4945,_0x2fb869,_0xb63a12);for(let _0x15ecc4=0x0;_0x15ecc4<_0x14ea09['length'];_0x15ecc4+=_0x1ef9f4){const _0x73af19=_0x14ea09[_0xb6515c(0x1e6)](_0x15ecc4,_0x15ecc4+_0x1ef9f4),_0x286dc5=await Promise[_0xb6515c(0x21b)](_0x73af19[_0xb6515c(0x217)](async _0x4d48d5=>{const _0x33f3e9=_0xb6515c,_0x19f916=_0x4d48d5[0x0],_0x361a39=_0x19f916[_0x33f3e9(0x1e4)];_0x2de60f?.[_0x33f3e9(0x215)](_0x33f3e9(0x223)+_0x361a39);const _0x265216=_0x19f916[_0x33f3e9(0x207)]?_0x9c1bdc['get'](_0x19f916[_0x33f3e9(0x207)])||'':'',_0x340c81=_0x265216?a157_0x28743c[_0x33f3e9(0x21e)](_0x19c83d,_0x265216):_0x19c83d,_0x11ec5b=sanitizeFileName(_0x361a39),_0x99c2e8=a157_0x28743c[_0x33f3e9(0x21e)](_0x340c81,_0x11ec5b+_0x33f3e9(0x219));let _0xb95227;if(existsSync(_0x99c2e8))try{const _0x478024=readFileSync(_0x99c2e8,'utf-8'),_0xe699e9=a157_0x939490(_0x478024);_0xb95227=buildLocalRuleToNameMappingFromJourney(_0xe699e9);}catch{}const _0x32467=[];for(const _0x12aa3f of _0x4d48d5){const _0x42a74d=_0xb63a12[_0x33f3e9(0x1fc)](_0x12aa3f['id']);if(!_0x42a74d){_0x2de60f?.[_0x33f3e9(0x215)](_0x33f3e9(0x216)+_0x12aa3f['id']+_0x33f3e9(0x1f7));continue;}const _0x3fe0d0=_0x42a74d['attributes']?.[_0x33f3e9(0x212)],_0x5af789=_0x41ae7b(_0x12aa3f['id'],_0x3fe0d0),_0x240632=await journeyResponseToDef(_0x42a74d,_0x5af789);_0x32467[_0x33f3e9(0x1f5)]({'item':_0x12aa3f,'yaml':_0x240632});}const _0x5c7dba=await _0x37ecb3[_0x33f3e9(0x208)][_0x33f3e9(0x1fe)](_0x19f916[_0x33f3e9(0x1ff)]),_0x567560=buildMergedJourneyDef(_0x32467,_0xb95227,_0x5c7dba);return{'bundleName':_0x361a39,'folderPath':_0x265216,'finalYaml':_0x567560};}));for(const {bundleName:_0x258001,folderPath:_0x122153,finalYaml:_0x5eed8f}of _0x286dc5){const _0xb28395=normalizeJourneyDef(_0x5eed8f),_0x168178=a157_0xc21078(_0xb28395),_0x8e0378=_0x122153?a157_0x28743c[_0xb6515c(0x21e)](_0x19c83d,_0x122153):_0x19c83d,_0x3ee72f=sanitizeFileName(_0x258001),_0x44e1f2=getUniqueFileName(_0x8e0378,_0x3ee72f,_0xe11d0f),_0x61178=a157_0x28743c[_0xb6515c(0x21e)](_0x8e0378,_0x44e1f2+_0xb6515c(0x219));_0x1c7bcd[_0xb6515c(0x1f5)](prepareFile(_0x61178,_0x168178,_0x19c83d));}}}const _0x153f91=Array[_0xb6515c(0x21a)](_0x16b58b[_0xb6515c(0x1e2)]())[_0xb6515c(0x1e0)]((_0x2b633f,_0x19d0a4)=>_0x2b633f+_0x19d0a4[_0xb6515c(0x20f)],0x0),_0x3e0c0f=_0x50aa36[_0xb6515c(0x200)](_0x4cf0=>_0x4cf0[_0xb6515c(0x1f0)]!==SEGMENT_KIND_JOURNEY),_0x49d8c9=_0x1c7bcd[_0xb6515c(0x200)](_0x68aec6=>_0x68aec6[_0xb6515c(0x1f6)])[_0xb6515c(0x20f)],_0x208df6=_0x1c7bcd[_0xb6515c(0x200)](_0x5769ec=>!_0x5769ec[_0xb6515c(0x1f6)]&&_0x5769ec['hasChanges'])['length'],_0x81b01c=_0x1c7bcd['filter'](_0x12be8a=>!_0x12be8a['isNew']&&!_0x12be8a['hasChanges'])[_0xb6515c(0x20f)],_0x21113d=Array[_0xb6515c(0x21a)](_0x4e9f4c[_0xb6515c(0x1e2)]())[_0xb6515c(0x1e0)]((_0x59f235,_0x56f093)=>_0x59f235+_0x56f093[_0xb6515c(0x20f)],0x0);return{'parentName':_0x3394b4,'parentId':_0xd7369c,'targetDir':_0x19c83d,'files':_0x1c7bcd,'counts':{'segments':_0x3e0c0f[_0xb6515c(0x20f)],'journeys':_0x4e9f4c[_0xb6515c(0x204)],'journeyVersions':_0x21113d,'activations':_0x153f91},'newFiles':_0x49d8c9,'changedFiles':_0x208df6,'unchangedFiles':_0x81b01c};}function createYamlContextForBundle(_0xf33e26,_0x4a22a4,_0x3cac39,_0xd4384b,_0x44a3ef,_0x2c8bd7){const _0xb48cf2=new Set(),_0x35b1d7=new Map(),_0x965b4b=new Map(),_0x1be49b=createJumpTargetCache(),_0x39bcc7=async(_0x2e3bbc,_0x3879f1)=>{const _0x4f37e7=a157_0x4690,_0x3666d1=_0x35b1d7[_0x4f37e7(0x1fc)](_0x2e3bbc);if(_0x3666d1!==undefined)return _0x3666d1;if(!_0x3879f1)return _0x2e3bbc;try{let _0x4a3412=_0x4a22a4[_0x4f37e7(0x1fc)](_0x2e3bbc);!_0x4a3412&&(_0x4a3412=await _0xf33e26[_0x4f37e7(0x1ec)][_0x4f37e7(0x20e)](_0x3879f1,_0x2e3bbc),_0x4a22a4['set'](_0x2e3bbc,_0x4a3412));const _0x5cb690=generateJourneyLocalName(_0x4a3412[_0x4f37e7(0x20a)]),_0x5c8614=_0x4a3412[_0x4f37e7(0x1f0)]===SEGMENT_KIND_JOURNEY&&_0x5cb690!==undefined;if(_0x5c8614&&_0x5cb690){let _0x4cf0d9=_0x5cb690,_0x10eb74=0x2;while(_0xb48cf2[_0x4f37e7(0x21c)](_0x4cf0d9)){_0x4cf0d9=_0x5cb690+'_'+_0x10eb74,_0x10eb74++;}return _0xb48cf2[_0x4f37e7(0x224)](_0x4cf0d9),_0x35b1d7[_0x4f37e7(0x1e9)](_0x2e3bbc,_0x4cf0d9),_0x4cf0d9;}return _0x4a3412[_0x4f37e7(0x20a)];}catch{return _0x2e3bbc;}},_0x6d30b6=(_0x34526a,_0x449b9d)=>({'resolveSegment':async _0x1e94a9=>{const _0x3dabe2=a157_0x4690,_0x994eff=_0x35b1d7[_0x3dabe2(0x1fc)](_0x1e94a9);if(_0x994eff!==undefined)return{'name':_0x994eff,'isJourneyLocal':!![]};if(!_0x449b9d)return{'name':_0x1e94a9,'isJourneyLocal':![]};try{let _0x5a43af=_0x4a22a4[_0x3dabe2(0x1fc)](_0x1e94a9);!_0x5a43af&&(_0x5a43af=await _0xf33e26['segment'][_0x3dabe2(0x20e)](_0x449b9d,_0x1e94a9),_0x4a22a4['set'](_0x1e94a9,_0x5a43af));const _0x4fbe76=generateJourneyLocalName(_0x5a43af[_0x3dabe2(0x20a)]),_0x2825b4=_0x5a43af[_0x3dabe2(0x1f0)]===SEGMENT_KIND_JOURNEY&&_0x4fbe76!==undefined;if(_0x2825b4&&!_0x5a43af['rule']&&_0x449b9d)try{const _0x4f70d4=await _0xf33e26[_0x3dabe2(0x1ec)][_0x3dabe2(0x20e)](_0x449b9d,_0x1e94a9);_0x4a22a4['set'](_0x1e94a9,_0x4f70d4),_0x5a43af=_0x4f70d4;}catch{}const _0x3d1d99=await _0x39bcc7(_0x1e94a9,_0x449b9d);let _0x37af71;if(_0x2825b4&&_0x5a43af[_0x3dabe2(0x22a)]){const _0xc81c87=await segmentResponseToDef(_0x5a43af,{'resolveSegmentName':_0x39c158=>_0x39bcc7(_0x39c158,_0x449b9d)});_0x37af71={'description':_0x5a43af['description'],'rule':_0xc81c87['rule']};}return{'name':_0x3d1d99,'isJourneyLocal':_0x2825b4,'definition':_0x37af71};}catch{return{'name':_0x1e94a9,'isJourneyLocal':![]};}},'resolveActivation':async _0x5f1474=>{const _0x28e4fd=a157_0x4690,_0x11f36e=_0x965b4b['get'](_0x5f1474);if(_0x11f36e!==undefined)return{'name':_0x11f36e,'isJourneyLocal':!![]};try{let _0x2e15bc=_0x44a3ef[_0x28e4fd(0x1fc)](_0x5f1474);!_0x2e15bc&&(_0x2e15bc=await _0xf33e26[_0x28e4fd(0x208)][_0x28e4fd(0x214)](_0x34526a,_0x5f1474));const _0x53077b=_0x2e15bc[_0x28e4fd(0x220)][_0x28e4fd(0x1fb)][_0x28e4fd(0x20a)]||_0x5f1474,_0x102c5d=sanitizeYamlKey(_0x53077b)||_0x28e4fd(0x1e5)+_0x5f1474,_0x161380=_0x102c5d;_0x965b4b['set'](_0x5f1474,_0x161380);const _0x4ffa4d=journeyActivationStepToYaml(_0x2e15bc,_0x3cac39,_0xd4384b);return{'name':_0x161380,'isJourneyLocal':!![],'definition':_0x4ffa4d};}catch{return{'name':_0x5f1474,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x4eaf53,_0x33edd0)=>resolveJumpTarget(_0x4eaf53,_0x33edd0,_0x1be49b,async _0x2ca1e9=>{const _0x49d1f9=a157_0x4690,_0x5bf0a7=_0x2c8bd7[_0x49d1f9(0x1fc)](_0x2ca1e9);if(_0x5bf0a7)return _0x5bf0a7;return _0xf33e26[_0x49d1f9(0x208)][_0x49d1f9(0x20d)](_0x2ca1e9);})});return{'createYamlContext':_0x6d30b6};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a158_0x39f4(){const _0xb42c56=['4848864Hfcwyk','stringify','join','debug','dirname','403707DxOSYP','277gAeqXV','1426OlWkPI','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','tdx.sdk.push-recovery','4bxeRjj','ENOENT','2088639GGCKyP','23710VLgcvQ','code','segments','77eWTzZa','1016057QKASLB','utf-8','journeyName','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','18185XMHDWJ','toISOString','parse','30aBAMsg','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','8XFaWhB'];a158_0x39f4=function(){return _0xb42c56;};return a158_0x39f4();}const a158_0x51d3e7=a158_0x1092;(function(_0x203831,_0x477da4){const _0x4d8cc3=a158_0x1092,_0x1d0f9f=_0x203831();while(!![]){try{const _0x160ccb=-parseInt(_0x4d8cc3(0x1fb))/0x1*(-parseInt(_0x4d8cc3(0x1fc))/0x2)+-parseInt(_0x4d8cc3(0x1fa))/0x3*(parseInt(_0x4d8cc3(0x1ff))/0x4)+parseInt(_0x4d8cc3(0x20a))/0x5*(parseInt(_0x4d8cc3(0x20d))/0x6)+-parseInt(_0x4d8cc3(0x206))/0x7*(parseInt(_0x4d8cc3(0x1f4))/0x8)+-parseInt(_0x4d8cc3(0x201))/0x9+-parseInt(_0x4d8cc3(0x202))/0xa*(-parseInt(_0x4d8cc3(0x205))/0xb)+parseInt(_0x4d8cc3(0x1f5))/0xc;if(_0x160ccb===_0x477da4)break;else _0x1d0f9f['push'](_0x1d0f9f['shift']());}catch(_0x1773ab){_0x1d0f9f['push'](_0x1d0f9f['shift']());}}}(a158_0x39f4,0x1e694));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a158_0x136f94 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a158_0x51d3e7(0x1fe));export function getPushRecoveryPath(_0x5aecd6){const _0x813915=a158_0x51d3e7,_0x509921=a158_0x136f94[_0x813915(0x1f9)](_0x5aecd6),_0x47b8e1=a158_0x136f94['basename'](_0x5aecd6);return a158_0x136f94[_0x813915(0x1f7)](_0x509921,'.'+_0x47b8e1+'.push-recovery.json');}export function readPushRecovery(_0x2696b7){const _0x20da7e=a158_0x51d3e7,_0x16c815=getPushRecoveryPath(_0x2696b7);if(!existsSync(_0x16c815))return undefined;try{const _0x15f251=readFileSync(_0x16c815,_0x20da7e(0x207)),_0x2f1285=JSON[_0x20da7e(0x20c)](_0x15f251);if(_0x2f1285?.['version']!==0x1||typeof _0x2f1285[_0x20da7e(0x208)]!=='string')return undefined;return _0x2f1285;}catch(_0x43acf1){return _0x43acf1 instanceof SyntaxError?logger['debug'](_0x20da7e(0x1f3)+_0x43acf1):logger['warn'](_0x20da7e(0x209)+_0x43acf1),undefined;}}export function writePushRecovery(_0x1a8b8f,_0x23dd94){const _0x4ed597=a158_0x51d3e7,_0x3c0921=getPushRecoveryPath(_0x1a8b8f),_0x32b394=_0x3c0921+'.tmp';writeFileSync(_0x32b394,JSON[_0x4ed597(0x1f6)](_0x23dd94,null,0x2)+'\x0a',_0x4ed597(0x207)),renameSync(_0x32b394,_0x3c0921);}function a158_0x1092(_0x2575d9,_0x5350db){_0x2575d9=_0x2575d9-0x1f3;const _0x39f481=a158_0x39f4();let _0x1092d3=_0x39f481[_0x2575d9];return _0x1092d3;}export function deletePushRecovery(_0x26802a){const _0x322348=a158_0x51d3e7,_0x165ba3=getPushRecoveryPath(_0x26802a);try{unlinkSync(_0x165ba3);}catch(_0x46be68){_0x46be68[_0x322348(0x203)]!==_0x322348(0x200)&&logger[_0x322348(0x1f8)](_0x322348(0x1fd)+_0x46be68);}}export function saveSegmentToPushRecovery(_0x2181a8,_0x2535b6,_0x21d0d6,_0x251fa3){const _0x1b0c3c=a158_0x51d3e7,_0x134501=readPushRecovery(_0x2181a8),_0x9a9781=_0x134501?.['journeyName']===_0x2535b6?{..._0x134501,'updatedAt':new Date()[_0x1b0c3c(0x20b)]()}:{'version':0x1,'journeyName':_0x2535b6,'updatedAt':new Date()[_0x1b0c3c(0x20b)](),'segments':{}};_0x9a9781[_0x1b0c3c(0x204)][_0x21d0d6]=_0x251fa3,writePushRecovery(_0x2181a8,_0x9a9781);}
|