@treasuredata/tdx 2026.7.1 → 2026.7.2
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.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +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 +20 -0
- 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.d.ts +24 -0
- package/dist/commands/cas-segment-command.d.ts.map +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/cas-segment-command.js.map +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.d.ts +83 -3
- package/dist/sdk/cas/cas-api-client.d.ts.map +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-api-client.js.map +1 -1
- package/dist/sdk/cas/cas-audience-schema.d.ts +149 -0
- package/dist/sdk/cas/cas-audience-schema.d.ts.map +1 -0
- package/dist/sdk/cas/cas-audience-schema.js +1 -0
- package/dist/sdk/cas/cas-audience-schema.js.map +1 -0
- package/dist/sdk/cas/cas-audience-validator.d.ts +57 -0
- package/dist/sdk/cas/cas-audience-validator.d.ts.map +1 -0
- package/dist/sdk/cas/cas-audience-validator.js +1 -0
- package/dist/sdk/cas/cas-audience-validator.js.map +1 -0
- package/dist/sdk/cas/cas-audience-yaml.d.ts +32 -1
- 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.d.ts +30 -2
- package/dist/sdk/cas/cas-segment-yaml.d.ts.map +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js.map +1 -1
- package/dist/sdk/cas/index.d.ts +21 -0
- package/dist/sdk/cas/index.d.ts.map +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/index.js.map +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.d.ts +131 -0
- 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/types.d.ts +33 -4
- package/dist/sdk/cas/types.d.ts.map +1 -1
- package/dist/sdk/cas/validate-files.d.ts +64 -0
- package/dist/sdk/cas/validate-files.d.ts.map +1 -0
- package/dist/sdk/cas/validate-files.js +1 -0
- package/dist/sdk/cas/validate-files.js.map +1 -0
- 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.d.ts +11 -1
- package/dist/sdk/client/endpoints.d.ts.map +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/endpoints.js.map +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.d.ts +20 -0
- package/dist/sdk/errors.d.ts.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/errors.js.map +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.d.ts +16 -7
- package/dist/sdk/segment/resolution-context.d.ts.map +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/resolution-context.js.map +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.d.ts +1 -1
- package/dist/sdk/segment/yaml-validator.d.ts.map +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment/yaml-validator.js.map +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/cas.d.ts +99 -26
- package/dist/sdk/types/cas.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +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/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(_0x8abb97,_0x5e8816){const _0x48972f=a153_0x51db,_0x45dd20=_0x8abb97();while(!![]){try{const _0x2ab31c=parseInt(_0x48972f(0x1f8))/0x1*(-parseInt(_0x48972f(0x21e))/0x2)+-parseInt(_0x48972f(0x1fc))/0x3*(parseInt(_0x48972f(0x205))/0x4)+-parseInt(_0x48972f(0x202))/0x5*(-parseInt(_0x48972f(0x21b))/0x6)+parseInt(_0x48972f(0x1e5))/0x7*(parseInt(_0x48972f(0x22b))/0x8)+-parseInt(_0x48972f(0x1f2))/0x9+parseInt(_0x48972f(0x24c))/0xa+parseInt(_0x48972f(0x207))/0xb;if(_0x2ab31c===_0x5e8816)break;else _0x45dd20['push'](_0x45dd20['shift']());}catch(_0x2da7fa){_0x45dd20['push'](_0x45dd20['shift']());}}}(a153_0x1d35,0x68487));import*as a153_0x3d1c35 from'yaml';function formatScheduleTime(_0x394563){const _0x594042=a153_0x51db;if(typeof _0x394563===_0x594042(0x20f)){const _0x1db4b9=Math[_0x594042(0x244)](_0x394563);return String(_0x1db4b9)['padStart'](0x2,'0')+_0x594042(0x23a);}if(typeof _0x394563===_0x594042(0x1fb)){if(/^\d{2}:\d{2}:\d{2}$/[_0x594042(0x210)](_0x394563))return _0x394563;if(/^\d{1,2}:\d{2}$/[_0x594042(0x210)](_0x394563)){const [_0x361f88,_0x439e2e]=_0x394563[_0x594042(0x24b)](':');return _0x361f88['padStart'](0x2,'0')+':'+_0x439e2e+_0x594042(0x239);}const _0xa97723=parseInt(_0x394563,0xa);if(!isNaN(_0xa97723)&&_0x394563[_0x594042(0x211)](/^\d+$/))return String(_0xa97723)['padStart'](0x2,'0')+_0x594042(0x23a);return _0x394563;}return String(_0x394563);}export function apiToDef(_0x792c75){const _0x457d62=a153_0x51db,_0x440188={'database':_0x792c75[_0x457d62(0x22a)]?.[_0x457d62(0x242)]||'','table':_0x792c75['master']?.['parentTableName']||''};_0x792c75[_0x457d62(0x235)]&&_0x792c75['audienceFilters'][_0x457d62(0x238)]>0x0&&(_0x440188['filters']=_0x792c75[_0x457d62(0x235)][_0x457d62(0x1e8)](_0x399831=>({'column':_0x399831[_0x457d62(0x248)],'values':_0x399831[_0x457d62(0x221)]})));let _0x9c5639;_0x792c75[_0x457d62(0x20b)]&&_0x792c75['scheduleType']!==_0x457d62(0x22c)&&(_0x9c5639={'type':_0x792c75[_0x457d62(0x20b)]},_0x792c75[_0x457d62(0x1e6)]&&(_0x9c5639[_0x457d62(0x223)]=formatScheduleTime(_0x792c75[_0x457d62(0x1e6)])),_0x792c75[_0x457d62(0x240)]&&(_0x9c5639['timezone']=_0x792c75[_0x457d62(0x240)]));let _0x24ef84;(_0x792c75[_0x457d62(0x216)]||_0x792c75[_0x457d62(0x206)]||_0x792c75['prestoPoolName'])&&(_0x24ef84={},_0x792c75[_0x457d62(0x216)]&&(_0x24ef84[_0x457d62(0x1ff)]=_0x792c75[_0x457d62(0x216)]),_0x792c75['hivePoolName']&&(_0x24ef84['hive_pool']=_0x792c75[_0x457d62(0x206)]),_0x792c75[_0x457d62(0x1ef)]&&(_0x24ef84['trino_pool']=_0x792c75['prestoPoolName']));const _0x13418f=_0x792c75[_0x457d62(0x234)]&&_0x792c75[_0x457d62(0x234)][_0x457d62(0x238)]>0x0?groupAttributesBySource(_0x792c75['attributes']):undefined,_0xe6beb8=_0x792c75[_0x457d62(0x227)]&&_0x792c75[_0x457d62(0x227)][_0x457d62(0x238)]>0x0?_0x792c75[_0x457d62(0x227)]['map'](convertApiBehaviorToYaml):undefined;let _0x2f6513;_0x792c75[_0x457d62(0x1fe)]&&(_0x2f6513={'name':_0x792c75['customerGroup']['name'],'source':{'database':_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x242)],'table':_0x792c75[_0x457d62(0x1fe)]['parentTableName']},'join':{'parent_key':_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x1f0)],'child_key':_0x792c75[_0x457d62(0x1fe)]['parentKey']}},_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x219)]&&_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x219)]['length']>0x0&&(_0x2f6513[_0x457d62(0x234)]=groupAttributesBySource(_0x792c75['customerGroup'][_0x457d62(0x219)])),_0x792c75['customerGroup']['customerGroupBehaviors']&&_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x1e2)][_0x457d62(0x238)]>0x0&&(_0x2f6513[_0x457d62(0x227)]=_0x792c75[_0x457d62(0x1fe)][_0x457d62(0x1e2)]['map'](convertApiBehaviorToYaml)));const _0x2434b0={'name':_0x792c75['name'],..._0x792c75['description']&&{'description':_0x792c75['description']},'master':_0x440188,..._0x9c5639&&{'schedule':_0x9c5639},..._0x24ef84&&{'engine':_0x24ef84},..._0x13418f&&{'attributes':_0x13418f},..._0xe6beb8&&{'behaviors':_0xe6beb8},..._0x2f6513&&{'customer_group':_0x2f6513}};return _0x2434b0;}function groupAttributesBySource(_0x154c2f){const _0x4d7d4c=a153_0x51db,_0x388f4b=new Map();for(const _0x2587a9 of _0x154c2f){const _0x3ecbbe=_0x2587a9['parentDatabaseName']+'.'+_0x2587a9['parentTableName']+'.'+_0x2587a9[_0x4d7d4c(0x20e)]+'.'+_0x2587a9[_0x4d7d4c(0x1f0)];!_0x388f4b[_0x4d7d4c(0x1e3)](_0x3ecbbe)&&_0x388f4b[_0x4d7d4c(0x23c)](_0x3ecbbe,[]),_0x388f4b[_0x4d7d4c(0x1ee)](_0x3ecbbe)[_0x4d7d4c(0x200)](_0x2587a9);}const _0x4bb1c3=[];for(const [,_0x48e004]of _0x388f4b){const _0x2fff96=_0x48e004[0x0],_0xc0bcb5=_0x2fff96[_0x4d7d4c(0x218)]||_0x2fff96[_0x4d7d4c(0x1ec)];_0x4bb1c3[_0x4d7d4c(0x200)]({'name':_0xc0bcb5,'source':{'database':_0x2fff96[_0x4d7d4c(0x242)],'table':_0x2fff96[_0x4d7d4c(0x1ec)]},'join':{'parent_key':_0x2fff96[_0x4d7d4c(0x1f0)],'child_key':_0x2fff96[_0x4d7d4c(0x20e)]},'columns':_0x48e004[_0x4d7d4c(0x1e8)](_0xfe1eb1=>{const _0x550084=_0x4d7d4c,_0x2b64ad={'column':_0xfe1eb1[_0x550084(0x20a)],'type':_0xfe1eb1[_0x550084(0x236)]};return _0xfe1eb1[_0x550084(0x228)]!==_0xfe1eb1[_0x550084(0x20a)]&&(_0x2b64ad[_0x550084(0x220)]=_0xfe1eb1[_0x550084(0x228)]),_0x2b64ad;})});}return _0x4bb1c3;}function convertApiBehaviorToYaml(_0x4754a6){const _0x2f035f=a153_0x51db,_0x2de2f3={'name':_0x4754a6['name'],'source':{'database':_0x4754a6[_0x2f035f(0x242)],'table':_0x4754a6[_0x2f035f(0x1ec)]},'join':{'parent_key':_0x4754a6[_0x2f035f(0x1f0)],'child_key':_0x4754a6[_0x2f035f(0x20e)]}};if(_0x4754a6['allColumns'])_0x2de2f3[_0x2f035f(0x230)]=!![];else _0x4754a6[_0x2f035f(0x1fd)]&&_0x4754a6[_0x2f035f(0x1fd)][_0x2f035f(0x238)]>0x0&&(_0x2de2f3[_0x2f035f(0x21d)]=_0x4754a6[_0x2f035f(0x1fd)][_0x2f035f(0x1e8)](_0x3cb408=>{const _0x49f3ae=_0x2f035f,_0x515a3e={'column':_0x3cb408['parentColumn'],'type':_0x3cb408[_0x49f3ae(0x236)]};return _0x3cb408['name']!==_0x3cb408[_0x49f3ae(0x20a)]&&(_0x515a3e[_0x49f3ae(0x220)]=_0x3cb408['name']),_0x515a3e;}));return _0x4754a6[_0x2f035f(0x20d)]&&(_0x2de2f3[_0x2f035f(0x215)]=_0x4754a6['defaultTimeFilterEnabled']),_0x4754a6[_0x2f035f(0x1fa)]&&(_0x2de2f3[_0x2f035f(0x22e)]=_0x4754a6[_0x2f035f(0x1fa)]),_0x2de2f3;}function a153_0x1d35(){const _0x158872=['column_name',']:\x20Missing\x20required\x20field\x20\x27name\x27','child_key','behaviors','name','YAML\x20config\x20missing\x20required\x20field:\x20name','master','8uPmrKv','none','parse','realtime','forEach','all_columns','values','customer_id','attributes:','attributes','audienceFilters','type','03:00','length',':00',':00:00','column','set','UTC','realtime.attributes[','id_stitching','timezone','engine:','parentDatabaseName','\x27.\x20Must\x20be\x20one\x20of:\x20','floor','includes','description','hive_pool','columnName','filters','events','split','6948020usihgF','customerGroupBehaviors','has','isArray','1903643jnvKOR','scheduleOption','trino_pool','map','YAML\x20config\x20missing\x20required\x20field:\x20master','Example\x20Events','parent_key','parentTableName','stringify','get','prestoPoolName','foreignKey',']\x20(','6565311leumUK','attribute_table','primary_key','source','personalization_services','table','80147RTLiRs','engine','isRealtime','string','288dTfccB','schema','customerGroup','hive_only','push','list','610XcFHUP','imported_batch','Parent\x20segment\x20description','8144fcZObB','hivePoolName','1542211cPSbws','schedule','daily','parentColumn','scheduleType','customer_group','defaultTimeFilterEnabled','parentKey','number','test','match','join','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','realtime.events[','default_time_filter','workflowHiveOnly','allColumns','groupingName','customerGroupAttributes','customer_group:','27822GuQvcd','Display\x20Name','columns','8lCsShL','Example\x20Attributes','label','rightValues','database','time'];a153_0x1d35=function(){return _0x158872;};return a153_0x1d35();}export function defToApi(_0x392cbd){const _0x2972a5=a153_0x51db,_0x18f966={'name':_0x392cbd[_0x2972a5(0x228)],'master':{'parentDatabaseName':_0x392cbd[_0x2972a5(0x22a)]['database'],'parentTableName':_0x392cbd[_0x2972a5(0x22a)][_0x2972a5(0x1f7)]}};_0x392cbd[_0x2972a5(0x246)]&&(_0x18f966[_0x2972a5(0x246)]=_0x392cbd[_0x2972a5(0x246)]);_0x392cbd[_0x2972a5(0x22a)]['filters']&&_0x392cbd['master'][_0x2972a5(0x249)][_0x2972a5(0x238)]>0x0&&(_0x18f966[_0x2972a5(0x235)]=_0x392cbd[_0x2972a5(0x22a)]['filters'][_0x2972a5(0x1e8)](_0x9d0e83=>({'columnName':_0x9d0e83[_0x2972a5(0x23b)],'rightValues':_0x9d0e83[_0x2972a5(0x231)]})));_0x392cbd[_0x2972a5(0x208)]&&(_0x18f966[_0x2972a5(0x20b)]=_0x392cbd[_0x2972a5(0x208)][_0x2972a5(0x236)],_0x392cbd[_0x2972a5(0x208)][_0x2972a5(0x223)]&&(_0x18f966[_0x2972a5(0x1e6)]=_0x392cbd[_0x2972a5(0x208)][_0x2972a5(0x223)]),_0x392cbd['schedule']['timezone']&&(_0x18f966[_0x2972a5(0x240)]=_0x392cbd['schedule']['timezone']));_0x392cbd[_0x2972a5(0x1f9)]&&(_0x392cbd['engine'][_0x2972a5(0x1ff)]!==undefined&&(_0x18f966[_0x2972a5(0x216)]=_0x392cbd['engine'][_0x2972a5(0x1ff)]),_0x392cbd[_0x2972a5(0x1f9)][_0x2972a5(0x247)]!==undefined&&(_0x18f966[_0x2972a5(0x206)]=_0x392cbd['engine'][_0x2972a5(0x247)]),_0x392cbd[_0x2972a5(0x1f9)][_0x2972a5(0x1e7)]!==undefined&&(_0x18f966[_0x2972a5(0x1ef)]=_0x392cbd[_0x2972a5(0x1f9)][_0x2972a5(0x1e7)]));_0x392cbd['attributes']&&_0x392cbd['attributes'][_0x2972a5(0x238)]>0x0&&(_0x18f966[_0x2972a5(0x234)]=flattenAttributeGroups(_0x392cbd[_0x2972a5(0x234)]));_0x392cbd[_0x2972a5(0x227)]&&_0x392cbd[_0x2972a5(0x227)]['length']>0x0&&(_0x18f966['behaviors']=_0x392cbd[_0x2972a5(0x227)][_0x2972a5(0x1e8)](convertDefBehaviorToApi));if(_0x392cbd[_0x2972a5(0x20c)]){const _0x256c18=_0x392cbd[_0x2972a5(0x20c)];_0x18f966[_0x2972a5(0x1fe)]={'name':_0x256c18[_0x2972a5(0x228)],'parentDatabaseName':_0x256c18[_0x2972a5(0x1f5)][_0x2972a5(0x222)],'parentTableName':_0x256c18['source']['table'],'parentKey':_0x256c18[_0x2972a5(0x212)][_0x2972a5(0x226)],'foreignKey':_0x256c18[_0x2972a5(0x212)][_0x2972a5(0x1eb)]},_0x256c18[_0x2972a5(0x234)]&&_0x256c18['attributes']['length']>0x0&&(_0x18f966[_0x2972a5(0x1fe)]['customerGroupAttributes']=flattenAttributeGroups(_0x256c18[_0x2972a5(0x234)])[_0x2972a5(0x1e8)](_0x6f73b5=>({'name':_0x6f73b5[_0x2972a5(0x228)],'type':_0x6f73b5[_0x2972a5(0x236)],'parentDatabaseName':_0x6f73b5[_0x2972a5(0x242)],'parentTableName':_0x6f73b5['parentTableName'],'parentColumn':_0x6f73b5[_0x2972a5(0x20a)],'parentKey':_0x6f73b5[_0x2972a5(0x20e)],'foreignKey':_0x6f73b5[_0x2972a5(0x1f0)]}))),_0x256c18[_0x2972a5(0x227)]&&_0x256c18['behaviors']['length']>0x0&&(_0x18f966[_0x2972a5(0x1fe)][_0x2972a5(0x1e2)]=_0x256c18[_0x2972a5(0x227)][_0x2972a5(0x1e8)](_0x8417dc=>({'name':_0x8417dc[_0x2972a5(0x228)],'parentDatabaseName':_0x8417dc[_0x2972a5(0x1f5)]['database'],'parentTableName':_0x8417dc[_0x2972a5(0x1f5)][_0x2972a5(0x1f7)],'parentKey':_0x8417dc['join'][_0x2972a5(0x226)],'foreignKey':_0x8417dc['join'][_0x2972a5(0x1eb)],'allColumns':_0x8417dc[_0x2972a5(0x230)],'schema':_0x8417dc[_0x2972a5(0x21d)]?.[_0x2972a5(0x1e8)](_0xe75f73=>({'name':_0xe75f73['label']||_0xe75f73[_0x2972a5(0x23b)],'type':_0xe75f73[_0x2972a5(0x236)],'parentColumn':_0xe75f73[_0x2972a5(0x23b)]}))})));}return _0x18f966;}function flattenAttributeGroups(_0x439b6a){const _0x206d6e=a153_0x51db,_0xf4acd7=[];for(const _0x24536c of _0x439b6a){for(const _0x4720e7 of _0x24536c[_0x206d6e(0x21d)]){_0xf4acd7[_0x206d6e(0x200)]({'name':_0x4720e7[_0x206d6e(0x220)]||_0x4720e7[_0x206d6e(0x23b)],'type':_0x4720e7[_0x206d6e(0x236)],'parentDatabaseName':_0x24536c[_0x206d6e(0x1f5)]['database'],'parentTableName':_0x24536c[_0x206d6e(0x1f5)][_0x206d6e(0x1f7)],'parentColumn':_0x4720e7[_0x206d6e(0x23b)],'parentKey':_0x24536c[_0x206d6e(0x212)][_0x206d6e(0x226)],'foreignKey':_0x24536c[_0x206d6e(0x212)]['parent_key'],'groupingName':_0x24536c['name']});}}return _0xf4acd7;}function convertDefBehaviorToApi(_0x44fb41){const _0x383479=a153_0x51db,_0x45cb14={'name':_0x44fb41[_0x383479(0x228)],'parentDatabaseName':_0x44fb41['source'][_0x383479(0x222)],'parentTableName':_0x44fb41[_0x383479(0x1f5)]['table'],'parentKey':_0x44fb41[_0x383479(0x212)][_0x383479(0x226)],'foreignKey':_0x44fb41['join'][_0x383479(0x1eb)]};if(_0x44fb41['all_columns'])_0x45cb14[_0x383479(0x217)]=!![];else _0x44fb41['columns']&&_0x44fb41[_0x383479(0x21d)][_0x383479(0x238)]>0x0&&(_0x45cb14[_0x383479(0x1fd)]=_0x44fb41['columns'][_0x383479(0x1e8)](_0x516f75=>({'name':_0x516f75[_0x383479(0x220)]||_0x516f75[_0x383479(0x23b)],'type':_0x516f75[_0x383479(0x236)],'parentColumn':_0x516f75[_0x383479(0x23b)]})));return _0x44fb41[_0x383479(0x215)]!==undefined&&(_0x45cb14[_0x383479(0x20d)]=_0x44fb41[_0x383479(0x215)]),_0x44fb41['realtime']!==undefined&&(_0x45cb14[_0x383479(0x1fa)]=_0x44fb41[_0x383479(0x22e)]),_0x45cb14;}export function serializeDef(_0x2aa2fe){const _0x1d2c81=a153_0x51db,_0x24d14b=JSON[_0x1d2c81(0x22d)](JSON['stringify'](_0x2aa2fe)),_0x3bca7f=a153_0x3d1c35[_0x1d2c81(0x1ed)](_0x24d14b,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x29fa25=['master:','schedule:',_0x1d2c81(0x241),_0x1d2c81(0x233),'behaviors:',_0x1d2c81(0x21a),'realtime:','personalization_services:'];let _0x464026=_0x3bca7f;for(const _0x46fed9 of _0x29fa25){_0x464026=_0x464026['replace'](new RegExp('^('+_0x46fed9+')','m'),(_0x5b2dfa,_0x338d70,_0x27eb98)=>{if(_0x27eb98===0x0||_0x464026[_0x27eb98-0x1]==='\x0a'&&_0x464026[_0x27eb98-0x2]==='\x0a')return _0x338d70;return'\x0a'+_0x338d70;});}return _0x464026;}export function parseDef(_0x216684){const _0x28580f=a153_0x51db,_0x126ce0=a153_0x3d1c35[_0x28580f(0x22d)](_0x216684);if(!_0x126ce0[_0x28580f(0x228)])throw new Error(_0x28580f(0x229));if(!_0x126ce0[_0x28580f(0x22a)])throw new Error(_0x28580f(0x1e9));if(!_0x126ce0[_0x28580f(0x22a)][_0x28580f(0x222)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x126ce0[_0x28580f(0x22a)][_0x28580f(0x1f7)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.table');return _0x126ce0[_0x28580f(0x22e)]&&validateRealtimeSection(_0x126ce0['realtime']),_0x126ce0[_0x28580f(0x1f6)]&&validatePersonalizationServices(_0x126ce0[_0x28580f(0x1f6)]),_0x126ce0;}function validateRealtimeSection(_0x138a0f){const _0x4f23f1=a153_0x51db,_0x4fe3fd=['single','counter',_0x4f23f1(0x23c),'ordered_set',_0x4f23f1(0x201),_0x4f23f1(0x203)];_0x138a0f[_0x4f23f1(0x24a)]&&Array[_0x4f23f1(0x1e4)](_0x138a0f['events'])&&_0x138a0f[_0x4f23f1(0x24a)][_0x4f23f1(0x22f)]((_0x1c6ce3,_0x11b81f)=>{const _0x44f838=_0x4f23f1;if(!_0x1c6ce3[_0x44f838(0x228)])throw new Error(_0x44f838(0x214)+_0x11b81f+']:\x20Missing\x20required\x20field\x20\x27name\x27');});_0x138a0f[_0x4f23f1(0x234)]&&Array[_0x4f23f1(0x1e4)](_0x138a0f[_0x4f23f1(0x234)])&&_0x138a0f[_0x4f23f1(0x234)][_0x4f23f1(0x22f)]((_0x37f2d3,_0x577538)=>{const _0x44ff08=_0x4f23f1;if(!_0x37f2d3['name'])throw new Error(_0x44ff08(0x23e)+_0x577538+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x37f2d3[_0x44ff08(0x236)]&&!_0x4fe3fd[_0x44ff08(0x245)](_0x37f2d3[_0x44ff08(0x236)]))throw new Error('realtime.attributes['+_0x577538+_0x44ff08(0x1f1)+_0x37f2d3['name']+'):\x20Invalid\x20type\x20\x27'+_0x37f2d3[_0x44ff08(0x236)]+_0x44ff08(0x243)+_0x4fe3fd['join'](',\x20'));});if(_0x138a0f[_0x4f23f1(0x23f)]){if(!_0x138a0f[_0x4f23f1(0x23f)][_0x4f23f1(0x1f4)])throw new Error(_0x4f23f1(0x213));}}function validatePersonalizationServices(_0x2e6aff){const _0x25015a=a153_0x51db;if(!Array[_0x25015a(0x1e4)](_0x2e6aff))throw new Error('personalization_services\x20must\x20be\x20an\x20array');_0x2e6aff[_0x25015a(0x22f)]((_0x2cceda,_0x25dafb)=>{const _0x5698ee=_0x25015a;if(!_0x2cceda[_0x5698ee(0x228)])throw new Error('personalization_services['+_0x25dafb+_0x5698ee(0x225));});}function a153_0x51db(_0x594b9f,_0x37f990){_0x594b9f=_0x594b9f-0x1e2;const _0x1d358e=a153_0x1d35();let _0x51db1a=_0x1d358e[_0x594b9f];return _0x51db1a;}export function generateTemplate(_0x327fe7,_0x5a4b36,_0x5d045b){const _0x5c633f=a153_0x51db,_0x281557={'name':_0x327fe7,'description':_0x5c633f(0x204),'master':{'database':_0x5a4b36,'table':_0x5d045b},'schedule':{'type':_0x5c633f(0x209),'time':_0x5c633f(0x237),'timezone':_0x5c633f(0x23d)},'attributes':[{'name':_0x5c633f(0x21f),'source':{'database':_0x5a4b36,'table':_0x5c633f(0x1f3)},'join':{'parent_key':'id','child_key':_0x5c633f(0x232)},'columns':[{'column':_0x5c633f(0x224),'label':_0x5c633f(0x21c),'type':'string'}]}],'behaviors':[{'name':_0x5c633f(0x1ea),'source':{'database':_0x5a4b36,'table':'events_table'},'join':{'parent_key':'user_id','child_key':_0x5c633f(0x232)},'all_columns':!![]}]};return serializeDef(_0x281557);}
|
|
1
|
+
(function(_0x4a1e57,_0x2fa970){const _0x2309ec=a156_0x5da0,_0x6a9c2d=_0x4a1e57();while(!![]){try{const _0x46f8b4=-parseInt(_0x2309ec(0x207))/0x1+parseInt(_0x2309ec(0x219))/0x2*(-parseInt(_0x2309ec(0x1dc))/0x3)+parseInt(_0x2309ec(0x20f))/0x4*(-parseInt(_0x2309ec(0x1ed))/0x5)+parseInt(_0x2309ec(0x1d7))/0x6+-parseInt(_0x2309ec(0x1f9))/0x7*(-parseInt(_0x2309ec(0x226))/0x8)+parseInt(_0x2309ec(0x23c))/0x9+parseInt(_0x2309ec(0x1ff))/0xa;if(_0x46f8b4===_0x2fa970)break;else _0x6a9c2d['push'](_0x6a9c2d['shift']());}catch(_0x4412da){_0x6a9c2d['push'](_0x6a9c2d['shift']());}}}(a156_0x44f0,0x4d767));import*as a156_0x31703e from'yaml';function formatScheduleTime(_0x42fe29){const _0x58541d=a156_0x5da0;if(typeof _0x42fe29===_0x58541d(0x21f)){const _0x388637=Math[_0x58541d(0x1f1)](_0x42fe29);return String(_0x388637)['padStart'](0x2,'0')+':00:00';}if(typeof _0x42fe29===_0x58541d(0x223)){if(/^\d{2}:\d{2}:\d{2}$/[_0x58541d(0x225)](_0x42fe29))return _0x42fe29;if(/^\d{1,2}:\d{2}$/[_0x58541d(0x225)](_0x42fe29)){const [_0x2720a2,_0x403ea2]=_0x42fe29[_0x58541d(0x210)](':');return _0x2720a2[_0x58541d(0x216)](0x2,'0')+':'+_0x403ea2+_0x58541d(0x20d);}const _0x5cc884=parseInt(_0x42fe29,0xa);if(!isNaN(_0x5cc884)&&_0x42fe29[_0x58541d(0x1e9)](/^\d+$/))return String(_0x5cc884)[_0x58541d(0x216)](0x2,'0')+':00:00';return _0x42fe29;}return String(_0x42fe29);}export function apiToDef(_0x327aaa){const _0x5e2243=a156_0x5da0,_0x2751b5={'database':_0x327aaa[_0x5e2243(0x1d8)]?.[_0x5e2243(0x1ea)]||'','table':_0x327aaa[_0x5e2243(0x1d8)]?.[_0x5e2243(0x1fd)]||''};_0x327aaa[_0x5e2243(0x240)]&&_0x327aaa[_0x5e2243(0x240)][_0x5e2243(0x1e0)]>0x0&&(_0x2751b5[_0x5e2243(0x214)]=_0x327aaa[_0x5e2243(0x240)][_0x5e2243(0x22f)](_0x197a6d=>({'column':_0x197a6d['columnName'],'values':_0x197a6d['rightValues']})));let _0x3215ca;_0x327aaa['scheduleType']&&_0x327aaa[_0x5e2243(0x235)]!=='none'&&(_0x3215ca={'type':_0x327aaa['scheduleType']},_0x327aaa[_0x5e2243(0x20a)]&&(_0x3215ca[_0x5e2243(0x20b)]=formatScheduleTime(_0x327aaa[_0x5e2243(0x20a)])),_0x327aaa[_0x5e2243(0x23d)]&&(_0x3215ca[_0x5e2243(0x23d)]=_0x327aaa[_0x5e2243(0x23d)]));let _0x40793;(_0x327aaa[_0x5e2243(0x204)]||_0x327aaa[_0x5e2243(0x1e2)]||_0x327aaa[_0x5e2243(0x1fa)])&&(_0x40793={},_0x327aaa[_0x5e2243(0x204)]&&(_0x40793[_0x5e2243(0x1db)]=_0x327aaa[_0x5e2243(0x204)]),_0x327aaa['hivePoolName']&&(_0x40793['hive_pool']=_0x327aaa[_0x5e2243(0x1e2)]),_0x327aaa[_0x5e2243(0x1fa)]&&(_0x40793['trino_pool']=_0x327aaa['prestoPoolName']));const _0x42210a=_0x327aaa[_0x5e2243(0x22b)]&&_0x327aaa[_0x5e2243(0x22b)][_0x5e2243(0x1e0)]>0x0?groupAttributesBySource(_0x327aaa[_0x5e2243(0x22b)]):undefined,_0x2979c7=_0x327aaa[_0x5e2243(0x1f4)]&&_0x327aaa[_0x5e2243(0x1f4)][_0x5e2243(0x1e0)]>0x0?_0x327aaa[_0x5e2243(0x1f4)]['map'](convertApiBehaviorToYaml):undefined;let _0x1bc038;_0x327aaa['customerGroup']&&(_0x1bc038={'name':_0x327aaa[_0x5e2243(0x222)]['name'],'source':{'database':_0x327aaa['customerGroup']['parentDatabaseName'],'table':_0x327aaa[_0x5e2243(0x222)][_0x5e2243(0x1fd)]},'join':{'parent_key':_0x327aaa[_0x5e2243(0x222)][_0x5e2243(0x202)],'child_key':_0x327aaa['customerGroup'][_0x5e2243(0x1de)]}},_0x327aaa[_0x5e2243(0x222)][_0x5e2243(0x218)]&&_0x327aaa['customerGroup']['customerGroupAttributes']['length']>0x0&&(_0x1bc038[_0x5e2243(0x22b)]=groupAttributesBySource(_0x327aaa['customerGroup']['customerGroupAttributes'])),_0x327aaa[_0x5e2243(0x222)][_0x5e2243(0x209)]&&_0x327aaa[_0x5e2243(0x222)][_0x5e2243(0x209)]['length']>0x0&&(_0x1bc038[_0x5e2243(0x1f4)]=_0x327aaa[_0x5e2243(0x222)][_0x5e2243(0x209)][_0x5e2243(0x22f)](convertApiBehaviorToYaml)));const _0x24258c={'name':_0x327aaa[_0x5e2243(0x22d)],..._0x327aaa['description']&&{'description':_0x327aaa[_0x5e2243(0x1f2)]},'master':_0x2751b5,..._0x3215ca&&{'schedule':_0x3215ca},..._0x40793&&{'engine':_0x40793},..._0x42210a&&{'attributes':_0x42210a},..._0x2979c7&&{'behaviors':_0x2979c7},..._0x1bc038&&{'customer_group':_0x1bc038}};return _0x24258c;}function groupAttributesBySource(_0x315f10){const _0x5a4572=a156_0x5da0,_0x2f1856=new Map();for(const _0x1716c0 of _0x315f10){const _0xa55bbe=_0x1716c0[_0x5a4572(0x1ea)]+'.'+_0x1716c0[_0x5a4572(0x1fd)]+'.'+_0x1716c0[_0x5a4572(0x1de)]+'.'+_0x1716c0['foreignKey'];!_0x2f1856[_0x5a4572(0x239)](_0xa55bbe)&&_0x2f1856[_0x5a4572(0x21b)](_0xa55bbe,[]),_0x2f1856[_0x5a4572(0x23b)](_0xa55bbe)[_0x5a4572(0x1fb)](_0x1716c0);}const _0xb205ea=[];for(const [,_0x105385]of _0x2f1856){const _0x592c1b=_0x105385[0x0],_0x43d906=_0x592c1b['groupingName']||_0x592c1b[_0x5a4572(0x1fd)];_0xb205ea[_0x5a4572(0x1fb)]({'name':_0x43d906,'source':{'database':_0x592c1b[_0x5a4572(0x1ea)],'table':_0x592c1b[_0x5a4572(0x1fd)]},'join':{'parent_key':_0x592c1b['foreignKey'],'child_key':_0x592c1b[_0x5a4572(0x1de)]},'columns':_0x105385[_0x5a4572(0x22f)](_0x572059=>{const _0x26b7d0=_0x5a4572,_0xad6b51={'column':_0x572059[_0x26b7d0(0x211)],'type':_0x572059['type']};return _0x572059[_0x26b7d0(0x22d)]!==_0x572059['parentColumn']&&(_0xad6b51[_0x26b7d0(0x232)]=_0x572059[_0x26b7d0(0x22d)]),_0xad6b51;})});}return _0xb205ea;}function convertApiBehaviorToYaml(_0x338d11){const _0x2bca55=a156_0x5da0,_0x2834df={'name':_0x338d11[_0x2bca55(0x22d)],'source':{'database':_0x338d11['parentDatabaseName'],'table':_0x338d11['parentTableName']},'join':{'parent_key':_0x338d11[_0x2bca55(0x202)],'child_key':_0x338d11[_0x2bca55(0x1de)]}};if(_0x338d11[_0x2bca55(0x236)])_0x2834df[_0x2bca55(0x1ee)]=!![];else _0x338d11[_0x2bca55(0x1e3)]&&_0x338d11[_0x2bca55(0x1e3)]['length']>0x0&&(_0x2834df[_0x2bca55(0x1f3)]=_0x338d11[_0x2bca55(0x1e3)]['map'](_0x2da134=>{const _0x53a1b7=_0x2bca55,_0x1dacb9={'column':_0x2da134[_0x53a1b7(0x211)],'type':_0x2da134['type']};return _0x2da134[_0x53a1b7(0x22d)]!==_0x2da134[_0x53a1b7(0x211)]&&(_0x1dacb9[_0x53a1b7(0x232)]=_0x2da134[_0x53a1b7(0x22d)]),_0x1dacb9;}));return _0x338d11[_0x2bca55(0x1da)]&&(_0x2834df[_0x2bca55(0x22e)]=_0x338d11[_0x2bca55(0x1da)]),_0x338d11[_0x2bca55(0x205)]&&(_0x2834df[_0x2bca55(0x221)]=_0x338d11[_0x2bca55(0x205)]),_0x2834df;}export function defToApi(_0x4dc569){const _0x174fc7=a156_0x5da0,_0x51ff8d={'name':_0x4dc569[_0x174fc7(0x22d)],'master':{'parentDatabaseName':_0x4dc569[_0x174fc7(0x1d8)][_0x174fc7(0x1e1)],'parentTableName':_0x4dc569[_0x174fc7(0x1d8)][_0x174fc7(0x23a)]}};_0x4dc569[_0x174fc7(0x1f2)]&&(_0x51ff8d[_0x174fc7(0x1f2)]=_0x4dc569[_0x174fc7(0x1f2)]);_0x4dc569[_0x174fc7(0x1d8)][_0x174fc7(0x214)]&&_0x4dc569[_0x174fc7(0x1d8)][_0x174fc7(0x214)][_0x174fc7(0x1e0)]>0x0&&(_0x51ff8d[_0x174fc7(0x240)]=_0x4dc569['master'][_0x174fc7(0x214)][_0x174fc7(0x22f)](_0x265805=>({'columnName':_0x265805['column'],'rightValues':_0x265805['values']})));_0x4dc569[_0x174fc7(0x213)]&&(_0x51ff8d[_0x174fc7(0x235)]=_0x4dc569[_0x174fc7(0x213)]['type'],_0x4dc569[_0x174fc7(0x213)][_0x174fc7(0x20b)]&&(_0x51ff8d[_0x174fc7(0x20a)]=_0x4dc569[_0x174fc7(0x213)][_0x174fc7(0x20b)]),_0x4dc569[_0x174fc7(0x213)][_0x174fc7(0x23d)]&&(_0x51ff8d['timezone']=_0x4dc569[_0x174fc7(0x213)][_0x174fc7(0x23d)]));_0x4dc569[_0x174fc7(0x1e8)]&&(_0x4dc569[_0x174fc7(0x1e8)]['hive_only']!==undefined&&(_0x51ff8d[_0x174fc7(0x204)]=_0x4dc569[_0x174fc7(0x1e8)]['hive_only']),_0x4dc569['engine'][_0x174fc7(0x1fc)]!==undefined&&(_0x51ff8d[_0x174fc7(0x1e2)]=_0x4dc569[_0x174fc7(0x1e8)][_0x174fc7(0x1fc)]),_0x4dc569[_0x174fc7(0x1e8)][_0x174fc7(0x1eb)]!==undefined&&(_0x51ff8d[_0x174fc7(0x1fa)]=_0x4dc569[_0x174fc7(0x1e8)][_0x174fc7(0x1eb)]));_0x4dc569[_0x174fc7(0x22b)]&&_0x4dc569[_0x174fc7(0x22b)][_0x174fc7(0x1e0)]>0x0&&(_0x51ff8d[_0x174fc7(0x22b)]=flattenAttributeGroups(_0x4dc569[_0x174fc7(0x22b)]));_0x4dc569[_0x174fc7(0x1f4)]&&_0x4dc569[_0x174fc7(0x1f4)][_0x174fc7(0x1e0)]>0x0&&(_0x51ff8d['behaviors']=_0x4dc569['behaviors'][_0x174fc7(0x22f)](convertDefBehaviorToApi));if(_0x4dc569[_0x174fc7(0x220)]){const _0x3cf88c=_0x4dc569[_0x174fc7(0x220)];_0x51ff8d[_0x174fc7(0x222)]={'name':_0x3cf88c['name'],'parentDatabaseName':_0x3cf88c[_0x174fc7(0x1ef)]['database'],'parentTableName':_0x3cf88c[_0x174fc7(0x1ef)]['table'],'parentKey':_0x3cf88c[_0x174fc7(0x237)]['child_key'],'foreignKey':_0x3cf88c['join']['parent_key']},_0x3cf88c[_0x174fc7(0x22b)]&&_0x3cf88c[_0x174fc7(0x22b)]['length']>0x0&&(_0x51ff8d[_0x174fc7(0x222)][_0x174fc7(0x218)]=flattenAttributeGroups(_0x3cf88c[_0x174fc7(0x22b)])[_0x174fc7(0x22f)](_0x14a405=>({'name':_0x14a405[_0x174fc7(0x22d)],'type':_0x14a405[_0x174fc7(0x1f0)],'parentDatabaseName':_0x14a405[_0x174fc7(0x1ea)],'parentTableName':_0x14a405['parentTableName'],'parentColumn':_0x14a405['parentColumn'],'parentKey':_0x14a405['parentKey'],'foreignKey':_0x14a405[_0x174fc7(0x202)]}))),_0x3cf88c['behaviors']&&_0x3cf88c['behaviors']['length']>0x0&&(_0x51ff8d[_0x174fc7(0x222)][_0x174fc7(0x209)]=_0x3cf88c[_0x174fc7(0x1f4)][_0x174fc7(0x22f)](_0x526517=>({'name':_0x526517[_0x174fc7(0x22d)],'parentDatabaseName':_0x526517[_0x174fc7(0x1ef)]['database'],'parentTableName':_0x526517['source'][_0x174fc7(0x23a)],'parentKey':_0x526517['join']['child_key'],'foreignKey':_0x526517[_0x174fc7(0x237)][_0x174fc7(0x201)],'allColumns':_0x526517[_0x174fc7(0x1ee)],'schema':_0x526517['columns']?.[_0x174fc7(0x22f)](_0x4ff505=>({'name':_0x4ff505[_0x174fc7(0x232)]||_0x4ff505[_0x174fc7(0x21e)],'type':_0x4ff505[_0x174fc7(0x1f0)],'parentColumn':_0x4ff505[_0x174fc7(0x21e)]}))})));}return _0x51ff8d;}function flattenAttributeGroups(_0x453bd9){const _0x55ec6a=a156_0x5da0,_0x28d25d=[];for(const _0x3e456b of _0x453bd9){for(const _0x4c484d of _0x3e456b[_0x55ec6a(0x1f3)]){_0x28d25d['push']({'name':_0x4c484d[_0x55ec6a(0x232)]||_0x4c484d['column'],'type':_0x4c484d[_0x55ec6a(0x1f0)],'parentDatabaseName':_0x3e456b['source'][_0x55ec6a(0x1e1)],'parentTableName':_0x3e456b[_0x55ec6a(0x1ef)][_0x55ec6a(0x23a)],'parentColumn':_0x4c484d[_0x55ec6a(0x21e)],'parentKey':_0x3e456b[_0x55ec6a(0x237)][_0x55ec6a(0x1dd)],'foreignKey':_0x3e456b['join'][_0x55ec6a(0x201)],'groupingName':_0x3e456b[_0x55ec6a(0x22d)]});}}return _0x28d25d;}function a156_0x5da0(_0xf8235a,_0x54b3e1){_0xf8235a=_0xf8235a-0x1d6;const _0x44f0df=a156_0x44f0();let _0x5da04f=_0x44f0df[_0xf8235a];return _0x5da04f;}function convertDefBehaviorToApi(_0x10992b){const _0x38ebfd=a156_0x5da0,_0x13bc54={'name':_0x10992b[_0x38ebfd(0x22d)],'parentDatabaseName':_0x10992b[_0x38ebfd(0x1ef)]['database'],'parentTableName':_0x10992b[_0x38ebfd(0x1ef)][_0x38ebfd(0x23a)],'parentKey':_0x10992b[_0x38ebfd(0x237)][_0x38ebfd(0x1dd)],'foreignKey':_0x10992b[_0x38ebfd(0x237)][_0x38ebfd(0x201)]};if(_0x10992b[_0x38ebfd(0x1ee)])_0x13bc54[_0x38ebfd(0x236)]=!![];else _0x10992b[_0x38ebfd(0x1f3)]&&_0x10992b['columns']['length']>0x0&&(_0x13bc54[_0x38ebfd(0x1e3)]=_0x10992b[_0x38ebfd(0x1f3)][_0x38ebfd(0x22f)](_0x159595=>({'name':_0x159595[_0x38ebfd(0x232)]||_0x159595[_0x38ebfd(0x21e)],'type':_0x159595[_0x38ebfd(0x1f0)],'parentColumn':_0x159595[_0x38ebfd(0x21e)]})));return _0x10992b[_0x38ebfd(0x22e)]!==undefined&&(_0x13bc54[_0x38ebfd(0x1da)]=_0x10992b[_0x38ebfd(0x22e)]),_0x10992b[_0x38ebfd(0x221)]!==undefined&&(_0x13bc54['isRealtime']=_0x10992b[_0x38ebfd(0x221)]),_0x13bc54;}export function serializeDef(_0x102303){const _0x1cd1a1=a156_0x5da0,_0x648ea7=JSON[_0x1cd1a1(0x233)](JSON[_0x1cd1a1(0x238)](_0x102303)),_0x118b9a=a156_0x31703e['stringify'](_0x648ea7,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0xcc075b=[_0x1cd1a1(0x22c),_0x1cd1a1(0x1f5),_0x1cd1a1(0x215),_0x1cd1a1(0x203),_0x1cd1a1(0x228),_0x1cd1a1(0x229),'realtime:',_0x1cd1a1(0x23f)];let _0x26f7a3=_0x118b9a;for(const _0x64fb61 of _0xcc075b){_0x26f7a3=_0x26f7a3[_0x1cd1a1(0x1f8)](new RegExp('^('+_0x64fb61+')','m'),(_0x25e4d5,_0x3e0dfa,_0x4d3429)=>{if(_0x4d3429===0x0||_0x26f7a3[_0x4d3429-0x1]==='\x0a'&&_0x26f7a3[_0x4d3429-0x2]==='\x0a')return _0x3e0dfa;return'\x0a'+_0x3e0dfa;});}return _0x26f7a3;}export function parseDef(_0x84e1fa){const _0x5392dd=a156_0x5da0,_0x3ab4ea=a156_0x31703e[_0x5392dd(0x233)](_0x84e1fa);if(!_0x3ab4ea['name'])throw new Error(_0x5392dd(0x21d));if(!_0x3ab4ea[_0x5392dd(0x1d8)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master');if(!_0x3ab4ea[_0x5392dd(0x1d8)]['database'])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x3ab4ea[_0x5392dd(0x1d8)][_0x5392dd(0x23a)])throw new Error(_0x5392dd(0x212));return _0x3ab4ea[_0x5392dd(0x221)]&&validateRealtimeSection(_0x3ab4ea['realtime']),_0x3ab4ea['personalization_services']&&validatePersonalizationServices(_0x3ab4ea[_0x5392dd(0x1f6)]),_0x3ab4ea;}function validateRealtimeSection(_0x44fafd){const _0x2fb8c0=a156_0x5da0,_0x34185f=[_0x2fb8c0(0x20c),_0x2fb8c0(0x200),_0x2fb8c0(0x21b),_0x2fb8c0(0x208),'list',_0x2fb8c0(0x20e)];_0x44fafd[_0x2fb8c0(0x1e4)]&&Array['isArray'](_0x44fafd[_0x2fb8c0(0x1e4)])&&_0x44fafd[_0x2fb8c0(0x1e4)][_0x2fb8c0(0x1e7)]((_0x1d0198,_0x32aec0)=>{const _0x4fac4e=_0x2fb8c0;if(!_0x1d0198[_0x4fac4e(0x22d)])throw new Error('realtime.events['+_0x32aec0+']:\x20Missing\x20required\x20field\x20\x27name\x27');});_0x44fafd[_0x2fb8c0(0x22b)]&&Array[_0x2fb8c0(0x1d9)](_0x44fafd[_0x2fb8c0(0x22b)])&&_0x44fafd[_0x2fb8c0(0x22b)][_0x2fb8c0(0x1e7)]((_0x408639,_0x47f991)=>{const _0x2c33c6=_0x2fb8c0;if(!_0x408639['name'])throw new Error(_0x2c33c6(0x217)+_0x47f991+_0x2c33c6(0x22a));if(_0x408639['type']&&!_0x34185f[_0x2c33c6(0x23e)](_0x408639['type']))throw new Error(_0x2c33c6(0x217)+_0x47f991+_0x2c33c6(0x1e6)+_0x408639[_0x2c33c6(0x22d)]+_0x2c33c6(0x21c)+_0x408639[_0x2c33c6(0x1f0)]+_0x2c33c6(0x1ec)+_0x34185f['join'](',\x20'));});if(_0x44fafd[_0x2fb8c0(0x1df)]){if(!_0x44fafd['id_stitching'][_0x2fb8c0(0x1f7)])throw new Error(_0x2fb8c0(0x231));}}function a156_0x44f0(){const _0x569127=['parent_key','foreignKey','attributes:','workflowHiveOnly','isRealtime','attribute_table','198053TeREcb','ordered_set','customerGroupBehaviors','scheduleOption','time','single',':00','imported_batch','3548gXVTtV','split','parentColumn','YAML\x20config\x20missing\x20required\x20field:\x20master.table','schedule','filters','engine:','padStart','realtime.attributes[','customerGroupAttributes','64582cbrQCY','Example\x20Attributes','set','):\x20Invalid\x20type\x20\x27','YAML\x20config\x20missing\x20required\x20field:\x20name','column','number','customer_group','realtime','customerGroup','string','Parent\x20segment\x20description','test','8YQWUbp','column_name','behaviors:','customer_group:',']:\x20Missing\x20required\x20field\x20\x27name\x27','attributes','master:','name','default_time_filter','map','daily','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','label','parse','customer_id','scheduleType','allColumns','join','stringify','has','table','get','2822121FnxUxw','timezone','includes','personalization_services:','audienceFilters','personalization_services\x20must\x20be\x20an\x20array','1984788rUotoS','master','isArray','defaultTimeFilterEnabled','hive_only','24BBWuRu','child_key','parentKey','id_stitching','length','database','hivePoolName','schema','events','Display\x20Name',']\x20(','forEach','engine','match','parentDatabaseName','trino_pool','\x27.\x20Must\x20be\x20one\x20of:\x20','1615AKsPwV','all_columns','source','type','floor','description','columns','behaviors','schedule:','personalization_services','primary_key','replace','2038687jCTQKG','prestoPoolName','push','hive_pool','parentTableName','03:00','1245610cRPIJb','counter'];a156_0x44f0=function(){return _0x569127;};return a156_0x44f0();}function validatePersonalizationServices(_0x255e7f){const _0x2b159d=a156_0x5da0;if(!Array[_0x2b159d(0x1d9)](_0x255e7f))throw new Error(_0x2b159d(0x1d6));_0x255e7f[_0x2b159d(0x1e7)]((_0x496c70,_0x54cdf5)=>{const _0x2b55c7=_0x2b159d;if(!_0x496c70[_0x2b55c7(0x22d)])throw new Error('personalization_services['+_0x54cdf5+_0x2b55c7(0x22a));});}export function generateTemplate(_0x4eb470,_0x448b68,_0x4122b5){const _0x10c96d=a156_0x5da0,_0x11b483={'name':_0x4eb470,'description':_0x10c96d(0x224),'master':{'database':_0x448b68,'table':_0x4122b5},'schedule':{'type':_0x10c96d(0x230),'time':_0x10c96d(0x1fe),'timezone':'UTC'},'attributes':[{'name':_0x10c96d(0x21a),'source':{'database':_0x448b68,'table':_0x10c96d(0x206)},'join':{'parent_key':'id','child_key':_0x10c96d(0x234)},'columns':[{'column':_0x10c96d(0x227),'label':_0x10c96d(0x1e5),'type':_0x10c96d(0x223)}]}],'behaviors':[{'name':'Example\x20Events','source':{'database':_0x448b68,'table':'events_table'},'join':{'parent_key':'user_id','child_key':_0x10c96d(0x234)},'all_columns':!![]}]};return serializeDef(_0x11b483);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function a154_0x1367(_0x98c526,_0x86bc2e){_0x98c526=_0x98c526-0x121;const _0x54ce20=a154_0x54ce();let _0x13675c=_0x54ce20[_0x98c526];return _0x13675c;}(function(_0x1bb168,_0x53c157){const _0x1c85bb=a154_0x1367,_0x174856=_0x1bb168();while(!![]){try{const _0x488b8b=parseInt(_0x1c85bb(0x137))/0x1+parseInt(_0x1c85bb(0x122))/0x2*(-parseInt(_0x1c85bb(0x128))/0x3)+-parseInt(_0x1c85bb(0x13f))/0x4+-parseInt(_0x1c85bb(0x12f))/0x5*(parseInt(_0x1c85bb(0x153))/0x6)+-parseInt(_0x1c85bb(0x15b))/0x7+-parseInt(_0x1c85bb(0x132))/0x8*(-parseInt(_0x1c85bb(0x13d))/0x9)+parseInt(_0x1c85bb(0x144))/0xa;if(_0x488b8b===_0x53c157)break;else _0x174856['push'](_0x174856['shift']());}catch(_0x2653df){_0x174856['push'](_0x174856['shift']());}}}(a154_0x54ce,0x3bc7c));import a154_0x173018 from'path';function a154_0x54ce(){const _0x43dfe2=['update','all','activationParams','isNew','Warning:\x20Journey\x20','3220VFCpjI','user','journey','968AIRdRC','from','listActivations','state','utf-8','153541iSXsHd','slice','length','versionNumber','join','buildIdToEmailMap','5301JCEUjD','toLowerCase','1414716QCsEQH','sort','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','.yml','buildIdToNameMap','11762690XXvvWT','paused','attributes','audienceId','Resolving\x20parent\x20segment','Fetching\x20activations','Processing\x20journey:\x20','rule','hasChanges','segment','relative','filter','kind','add','Processing\x20segments','3342kaHPST','Processing\x20journeys','getActivation','journeyBundleId','tdx.json','values','Fetching\x20parent\x20segment\x20info','name','202643dYzXIa','journeyBundleName','has','folderId','get','set','segmentFolderId','connection','Fetching\x20users\x20and\x20connections','reduce','getSegment','description','getParent','14uGwDhk','relationships','size','push','updatedAt','listFolders','177807KPNcVc','targetResourceName'];a154_0x54ce=function(){return _0x43dfe2;};return a154_0x54ce();}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 a154_0x104b82,normalizeJourneyDef,parseYamlString as a154_0x3091c9}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(_0x9daa8b,_0x333605,_0x111b24){const _0x749674=a154_0x1367,_0x43c024=a154_0x173018[_0x749674(0x14e)](_0x111b24,_0x9daa8b);if(existsSync(_0x9daa8b)){const _0x4a9e2a=readFileSync(_0x9daa8b,_0x749674(0x136)),_0x4f6373=generateDiff(_0x4a9e2a,_0x333605),_0x44cc86=hasChanges(_0x4f6373);return{'relativePath':_0x43c024,'absolutePath':_0x9daa8b,'content':_0x333605,'isNew':![],'hasChanges':_0x44cc86,'diff':_0x44cc86?formatDiffWithColors(_0x4f6373):undefined};}return{'relativePath':_0x43c024,'absolutePath':_0x9daa8b,'content':_0x333605,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x5387b4,_0x5612ff,_0x4bb4cd){const _0x2b2797=a154_0x1367,_0x96cecc=_0x5387b4+':'+_0x5612ff,_0x2d60b2=_0x4bb4cd[_0x2b2797(0x15f)](_0x96cecc)||0x0;_0x4bb4cd[_0x2b2797(0x160)](_0x96cecc,_0x2d60b2+0x1);if(_0x2d60b2===0x0)return _0x5612ff;return _0x5612ff+'_'+(_0x2d60b2+0x1);}export async function pullSegments(_0x26fba7,_0x8e00d0,_0x4469b1={}){const _0x2c24c2=a154_0x1367,{targetDir:_0x222120,progress:_0x56f6b2}=_0x4469b1;_0x56f6b2?.['update'](_0x2c24c2(0x148));const _0x178687=await _0x26fba7[_0x2c24c2(0x14d)]['resolveParentId'](_0x8e00d0);_0x56f6b2?.[_0x2c24c2(0x12a)](_0x2c24c2(0x159));const _0x46a1f2=await _0x26fba7[_0x2c24c2(0x14d)][_0x2c24c2(0x121)](_0x178687),_0x215ee2=_0x46a1f2[_0x2c24c2(0x146)][_0x2c24c2(0x15a)];_0x56f6b2?.[_0x2c24c2(0x12a)]('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x4529e1,_0xe4780e,_0x294d04]=await Promise[_0x2c24c2(0x12b)]([_0x26fba7[_0x2c24c2(0x14d)]['listSegments'](_0x178687),_0x26fba7['segment'][_0x2c24c2(0x127)](_0x178687),_0x26fba7[_0x2c24c2(0x131)]['listJourneysWithDetailsFromParentSegment'](_0x178687,{'includeAllVersions':!![]})]),{journeys:_0x391522,activationStepsById:_0x39b82f}=_0x294d04,_0x15130a=new Map();for(const _0x4c8cd1 of _0x391522){_0x15130a[_0x2c24c2(0x160)](_0x4c8cd1['id'],_0x4c8cd1);}const _0x1a0df9=_0x391522['map'](_0x3783bd=>({'id':_0x3783bd['id'],'name':_0x3783bd['attributes']['name'],'journeyBundleName':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x15c)]||'','journeyBundleId':_0x3783bd['attributes']['journeyBundleId']||'','versionNumber':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x13a)],'description':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x166)],'state':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x135)],'paused':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x145)],'audienceId':_0x3783bd['attributes'][_0x2c24c2(0x147)],'folderId':_0x3783bd[_0x2c24c2(0x123)]?.['parentFolder']?.['data']?.['id'],'createdAt':_0x3783bd[_0x2c24c2(0x146)]['createdAt'],'updatedAt':_0x3783bd[_0x2c24c2(0x146)][_0x2c24c2(0x126)]})),_0x144977=buildFolderIdToPathMap(_0xe4780e),_0x5320bf=_0x222120||'segments/'+sanitizeFileName(_0x215ee2);_0x56f6b2?.[_0x2c24c2(0x12a)](_0x2c24c2(0x149));const _0x2e443e=new Map();await batchAsync(_0x4529e1,async _0x4c96a8=>{const _0x59278f=_0x2c24c2,_0x55193e=await _0x26fba7['segment'][_0x59278f(0x134)](_0x178687,_0x4c96a8['id']);_0x2e443e['set'](_0x4c96a8['id'],_0x55193e);}),_0x56f6b2?.[_0x2c24c2(0x12a)](_0x2c24c2(0x163));const [_0x18babb,_0x11b6fb]=await Promise['all']([_0x26fba7[_0x2c24c2(0x130)][_0x2c24c2(0x13c)](),_0x26fba7[_0x2c24c2(0x162)][_0x2c24c2(0x143)]()]),_0x264b4e=[],_0x38cfd4=new Map(),_0x439c54=a154_0x173018[_0x2c24c2(0x13b)](_0x5320bf,_0x2c24c2(0x157)),_0x175db9=createTdxConfigContent(_0x215ee2);_0x264b4e['push'](prepareFile(_0x439c54,_0x175db9,_0x5320bf));const _0x5789ab=new Map();for(const _0x4073ba of _0x4529e1){_0x5789ab[_0x2c24c2(0x160)](_0x4073ba['id'],_0x4073ba);}let _0xd51648=_0x4529e1;if(_0x4469b1[_0x2c24c2(0x129)]){const _0x111f54=_0x4529e1['filter'](_0x428e23=>_0x428e23[_0x2c24c2(0x15a)][_0x2c24c2(0x13e)]()===_0x4469b1[_0x2c24c2(0x129)][_0x2c24c2(0x13e)]());_0x111f54['length']>0x0&&(_0xd51648=_0x111f54);}_0x56f6b2?.['update'](_0x2c24c2(0x152));for(const _0x4a36e1 of _0xd51648){if(_0x4a36e1[_0x2c24c2(0x150)]===SEGMENT_KIND_JOURNEY)continue;const _0xe9f810=_0x4a36e1[_0x2c24c2(0x161)]?_0x144977[_0x2c24c2(0x15f)](_0x4a36e1[_0x2c24c2(0x161)])||'':'',_0x2d3dae=_0x2e443e[_0x2c24c2(0x15f)](_0x4a36e1['id'])||[],_0x12de83=segmentWithActivationsToYaml(_0x4a36e1,_0x2d3dae,undefined,_0x18babb,_0x11b6fb),_0x50855a=_0xe9f810?a154_0x173018[_0x2c24c2(0x13b)](_0x5320bf,_0xe9f810):_0x5320bf,_0x9b004=sanitizeFileName(_0x4a36e1[_0x2c24c2(0x15a)]),_0x3f3891=getUniqueFileName(_0x50855a,_0x9b004,_0x38cfd4),_0x3af1a1=a154_0x173018[_0x2c24c2(0x13b)](_0x50855a,_0x3f3891+_0x2c24c2(0x142)),_0x536a1d=segmentToYamlString(_0x12de83);_0x264b4e['push'](prepareFile(_0x3af1a1,_0x536a1d,_0x5320bf));}const _0x405e94=new Map();for(const _0x4e9b01 of _0x1a0df9){const _0x52f95c=_0x4e9b01[_0x2c24c2(0x156)];!_0x405e94[_0x2c24c2(0x15d)](_0x52f95c)&&_0x405e94['set'](_0x52f95c,[]),_0x405e94[_0x2c24c2(0x15f)](_0x52f95c)['push'](_0x4e9b01);}for(const _0x6972d of _0x405e94[_0x2c24c2(0x158)]()){_0x6972d[_0x2c24c2(0x140)]((_0x2f8662,_0x1fec11)=>(_0x2f8662[_0x2c24c2(0x13a)]||0x0)-(_0x1fec11[_0x2c24c2(0x13a)]||0x0));}if(_0x4469b1[_0x2c24c2(0x129)]){const _0x4174ca=new Map();for(const [_0x1eb6c0,_0x339ac6]of _0x405e94){const _0x552c6b=_0x339ac6[0x0][_0x2c24c2(0x15c)];if(_0x552c6b[_0x2c24c2(0x13e)]()===_0x4469b1['targetResourceName']['toLowerCase']()){_0x4174ca['set'](_0x1eb6c0,_0x339ac6);break;}}_0x405e94['clear']();for(const [_0x571dcc,_0xceaf99]of _0x4174ca){_0x405e94[_0x2c24c2(0x160)](_0x571dcc,_0xceaf99);}}if(_0x405e94['size']>0x0){_0x56f6b2?.[_0x2c24c2(0x12a)](_0x2c24c2(0x154));const _0x5717a7=Array[_0x2c24c2(0x133)](_0x405e94['values']()),_0x416688=0x5,{createYamlContext:_0x3fc92b}=createYamlContextForBundle(_0x26fba7,_0x5789ab,_0x18babb,_0x11b6fb,_0x39b82f,_0x15130a);for(let _0x3d7642=0x0;_0x3d7642<_0x5717a7[_0x2c24c2(0x139)];_0x3d7642+=_0x416688){const _0x235029=_0x5717a7[_0x2c24c2(0x138)](_0x3d7642,_0x3d7642+_0x416688),_0x5de17d=await Promise['all'](_0x235029['map'](async _0x3b5fd2=>{const _0x48a910=_0x2c24c2,_0x17f252=_0x3b5fd2[0x0],_0x25b17b=_0x17f252[_0x48a910(0x15c)];_0x56f6b2?.[_0x48a910(0x12a)](_0x48a910(0x14a)+_0x25b17b);const _0x41088a=_0x17f252[_0x48a910(0x15e)]?_0x144977[_0x48a910(0x15f)](_0x17f252['folderId'])||'':'',_0xf88759=_0x41088a?a154_0x173018[_0x48a910(0x13b)](_0x5320bf,_0x41088a):_0x5320bf,_0x18e7aa=sanitizeFileName(_0x25b17b),_0x2ab21f=a154_0x173018[_0x48a910(0x13b)](_0xf88759,_0x18e7aa+'.yml');let _0x89ac91;if(existsSync(_0x2ab21f))try{const _0x123e53=readFileSync(_0x2ab21f,_0x48a910(0x136)),_0x3a30fb=a154_0x3091c9(_0x123e53);_0x89ac91=buildLocalRuleToNameMappingFromJourney(_0x3a30fb);}catch{}const _0x89d792=[];for(const _0x74e89d of _0x3b5fd2){const _0x357c9d=_0x15130a[_0x48a910(0x15f)](_0x74e89d['id']);if(!_0x357c9d){_0x56f6b2?.[_0x48a910(0x12a)](_0x48a910(0x12e)+_0x74e89d['id']+_0x48a910(0x141));continue;}const _0x203a21=_0x357c9d[_0x48a910(0x146)]?.[_0x48a910(0x147)],_0x26cef8=_0x3fc92b(_0x74e89d['id'],_0x203a21),_0x16df37=await journeyResponseToDef(_0x357c9d,_0x26cef8);_0x89d792[_0x48a910(0x125)]({'item':_0x74e89d,'yaml':_0x16df37});}const _0x1b8b66=await _0x26fba7[_0x48a910(0x131)]['getLatestJourneyId'](_0x17f252[_0x48a910(0x156)]),_0x295b5b=buildMergedJourneyDef(_0x89d792,_0x89ac91,_0x1b8b66);return{'bundleName':_0x25b17b,'folderPath':_0x41088a,'finalYaml':_0x295b5b};}));for(const {bundleName:_0x595bda,folderPath:_0x3e9e1f,finalYaml:_0x18a7a3}of _0x5de17d){const _0x16868b=normalizeJourneyDef(_0x18a7a3),_0x16393e=a154_0x104b82(_0x16868b),_0x193aa1=_0x3e9e1f?a154_0x173018[_0x2c24c2(0x13b)](_0x5320bf,_0x3e9e1f):_0x5320bf,_0x45b50f=sanitizeFileName(_0x595bda),_0x336421=getUniqueFileName(_0x193aa1,_0x45b50f,_0x38cfd4),_0x2941f9=a154_0x173018[_0x2c24c2(0x13b)](_0x193aa1,_0x336421+_0x2c24c2(0x142));_0x264b4e[_0x2c24c2(0x125)](prepareFile(_0x2941f9,_0x16393e,_0x5320bf));}}}const _0x49e8ec=Array[_0x2c24c2(0x133)](_0x2e443e[_0x2c24c2(0x158)]())[_0x2c24c2(0x164)]((_0xecccf0,_0x413fff)=>_0xecccf0+_0x413fff['length'],0x0),_0x3527b5=_0xd51648[_0x2c24c2(0x14f)](_0x3cd66e=>_0x3cd66e[_0x2c24c2(0x150)]!==SEGMENT_KIND_JOURNEY),_0x93fd11=_0x264b4e[_0x2c24c2(0x14f)](_0x37a767=>_0x37a767[_0x2c24c2(0x12d)])[_0x2c24c2(0x139)],_0x46d5ca=_0x264b4e[_0x2c24c2(0x14f)](_0x154cd1=>!_0x154cd1['isNew']&&_0x154cd1['hasChanges'])['length'],_0xceab46=_0x264b4e[_0x2c24c2(0x14f)](_0x438036=>!_0x438036[_0x2c24c2(0x12d)]&&!_0x438036[_0x2c24c2(0x14c)])[_0x2c24c2(0x139)],_0x206a6f=Array[_0x2c24c2(0x133)](_0x405e94['values']())[_0x2c24c2(0x164)]((_0x311837,_0x38efe5)=>_0x311837+_0x38efe5[_0x2c24c2(0x139)],0x0);return{'parentName':_0x215ee2,'parentId':_0x178687,'targetDir':_0x5320bf,'files':_0x264b4e,'counts':{'segments':_0x3527b5[_0x2c24c2(0x139)],'journeys':_0x405e94[_0x2c24c2(0x124)],'journeyVersions':_0x206a6f,'activations':_0x49e8ec},'newFiles':_0x93fd11,'changedFiles':_0x46d5ca,'unchangedFiles':_0xceab46};}function createYamlContextForBundle(_0x20461d,_0x2d8069,_0x13169c,_0x4f4f07,_0x139eb9,_0x117914){const _0x4670b9=new Set(),_0x3592e5=new Map(),_0x300d93=new Map(),_0x3c9e8d=createJumpTargetCache(),_0x182053=async(_0x52f396,_0x3ea63b)=>{const _0x17a652=a154_0x1367,_0x580b8e=_0x3592e5[_0x17a652(0x15f)](_0x52f396);if(_0x580b8e!==undefined)return _0x580b8e;if(!_0x3ea63b)return _0x52f396;try{let _0x4b2369=_0x2d8069[_0x17a652(0x15f)](_0x52f396);!_0x4b2369&&(_0x4b2369=await _0x20461d[_0x17a652(0x14d)][_0x17a652(0x165)](_0x3ea63b,_0x52f396),_0x2d8069['set'](_0x52f396,_0x4b2369));const _0x1f6ea9=generateJourneyLocalName(_0x4b2369[_0x17a652(0x15a)]),_0x3e89c1=_0x4b2369[_0x17a652(0x150)]===SEGMENT_KIND_JOURNEY&&_0x1f6ea9!==undefined;if(_0x3e89c1&&_0x1f6ea9){let _0x2d1307=_0x1f6ea9,_0x482fb6=0x2;while(_0x4670b9[_0x17a652(0x15d)](_0x2d1307)){_0x2d1307=_0x1f6ea9+'_'+_0x482fb6,_0x482fb6++;}return _0x4670b9[_0x17a652(0x151)](_0x2d1307),_0x3592e5[_0x17a652(0x160)](_0x52f396,_0x2d1307),_0x2d1307;}return _0x4b2369['name'];}catch{return _0x52f396;}},_0x851b69=(_0x1538e1,_0x2f1f8c)=>({'resolveSegment':async _0x4768d3=>{const _0x177f88=a154_0x1367,_0x49328e=_0x3592e5[_0x177f88(0x15f)](_0x4768d3);if(_0x49328e!==undefined)return{'name':_0x49328e,'isJourneyLocal':!![]};if(!_0x2f1f8c)return{'name':_0x4768d3,'isJourneyLocal':![]};try{let _0x55fc5b=_0x2d8069[_0x177f88(0x15f)](_0x4768d3);!_0x55fc5b&&(_0x55fc5b=await _0x20461d['segment'][_0x177f88(0x165)](_0x2f1f8c,_0x4768d3),_0x2d8069[_0x177f88(0x160)](_0x4768d3,_0x55fc5b));const _0x40be57=generateJourneyLocalName(_0x55fc5b[_0x177f88(0x15a)]),_0x990463=_0x55fc5b[_0x177f88(0x150)]===SEGMENT_KIND_JOURNEY&&_0x40be57!==undefined;if(_0x990463&&!_0x55fc5b[_0x177f88(0x14b)]&&_0x2f1f8c)try{const _0x5e0052=await _0x20461d[_0x177f88(0x14d)][_0x177f88(0x165)](_0x2f1f8c,_0x4768d3);_0x2d8069['set'](_0x4768d3,_0x5e0052),_0x55fc5b=_0x5e0052;}catch{}const _0x2778cf=await _0x182053(_0x4768d3,_0x2f1f8c);let _0x58af9d;if(_0x990463&&_0x55fc5b[_0x177f88(0x14b)]){const _0xef57f5=await segmentResponseToDef(_0x55fc5b,{'resolveSegmentName':_0x39800a=>_0x182053(_0x39800a,_0x2f1f8c)});_0x58af9d={'description':_0x55fc5b[_0x177f88(0x166)],'rule':_0xef57f5['rule']};}return{'name':_0x2778cf,'isJourneyLocal':_0x990463,'definition':_0x58af9d};}catch{return{'name':_0x4768d3,'isJourneyLocal':![]};}},'resolveActivation':async _0x4bf325=>{const _0x1314ed=a154_0x1367,_0x5c6dfb=_0x300d93[_0x1314ed(0x15f)](_0x4bf325);if(_0x5c6dfb!==undefined)return{'name':_0x5c6dfb,'isJourneyLocal':!![]};try{let _0x19c2d3=_0x139eb9[_0x1314ed(0x15f)](_0x4bf325);!_0x19c2d3&&(_0x19c2d3=await _0x20461d['journey'][_0x1314ed(0x155)](_0x1538e1,_0x4bf325));const _0x248700=_0x19c2d3['attributes'][_0x1314ed(0x12c)][_0x1314ed(0x15a)]||_0x4bf325,_0x371424=sanitizeYamlKey(_0x248700)||'activation_'+_0x4bf325,_0x35b653=_0x371424;_0x300d93[_0x1314ed(0x160)](_0x4bf325,_0x35b653);const _0x330eb9=journeyActivationStepToYaml(_0x19c2d3,_0x13169c,_0x4f4f07);return{'name':_0x35b653,'isJourneyLocal':!![],'definition':_0x330eb9};}catch{return{'name':_0x4bf325,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x45c516,_0x24582f)=>resolveJumpTarget(_0x45c516,_0x24582f,_0x3c9e8d,async _0x275017=>{const _0x4f0ff3=_0x117914['get'](_0x275017);if(_0x4f0ff3)return _0x4f0ff3;return _0x20461d['journey']['getJourney'](_0x275017);})});return{'createYamlContext':_0x851b69};}
|
|
1
|
+
(function(_0x3f7f1f,_0x2ccfb8){const _0x1abb39=a157_0x34d1,_0x71f5de=_0x3f7f1f();while(!![]){try{const _0x1e4d6f=parseInt(_0x1abb39(0x22e))/0x1*(parseInt(_0x1abb39(0x21c))/0x2)+-parseInt(_0x1abb39(0x235))/0x3+-parseInt(_0x1abb39(0x200))/0x4*(-parseInt(_0x1abb39(0x20d))/0x5)+parseInt(_0x1abb39(0x1fe))/0x6*(-parseInt(_0x1abb39(0x233))/0x7)+-parseInt(_0x1abb39(0x209))/0x8+-parseInt(_0x1abb39(0x207))/0x9*(parseInt(_0x1abb39(0x22d))/0xa)+parseInt(_0x1abb39(0x230))/0xb;if(_0x1e4d6f===_0x2ccfb8)break;else _0x71f5de['push'](_0x71f5de['shift']());}catch(_0x3eb904){_0x71f5de['push'](_0x71f5de['shift']());}}}(a157_0x645f,0x3561c));import a157_0x2ad32a 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 a157_0x645f(){const _0x33f3ab=['getParent','.yml','state','getJourney','kind','updatedAt','has','get','description','Warning:\x20Journey\x20','22bcgikP','activation_','rule','Fetching\x20users\x20and\x20connections','reduce','join','name','buildIdToNameMap','segment','from','size','paused','audienceId','all','journeyBundleId','values','resolveParentId','324770idISSr','21523MyKwQh','Resolving\x20parent\x20segment','4639811uobJhx','listJourneysWithDetailsFromParentSegment','Fetching\x20parent\x20segment\x20info','9884qmmIat','clear','324237sqpjWy','segmentFolderId','versionNumber','utf-8','isNew','set','createdAt','length','getActivation','push','listSegments','attributes','Processing\x20journey:\x20','Processing\x20segments','journeyBundleName','activationParams','update','tdx.json','slice','toLowerCase','168cuVPjj','getSegment','25236EIGWXr','Fetching\x20segments,\x20folders,\x20and\x20journeys','journey','Processing\x20journeys','hasChanges','folderId','filter','18JEFnVL','listActivations','3181408MXxaUh','map','Fetching\x20activations','targetResourceName','135KWtCqq','parentFolder','connection','listFolders','segments/'];a157_0x645f=function(){return _0x33f3ab;};return a157_0x645f();}import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a157_0x56b6c5,normalizeJourneyDef,parseYamlString as a157_0x134821}from'./journey-yaml.js';function a157_0x34d1(_0x34cad4,_0x3a36b7){_0x34cad4=_0x34cad4-0x1f2;const _0x645ff0=a157_0x645f();let _0x34d19d=_0x645ff0[_0x34cad4];return _0x34d19d;}import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x4903b7,_0x40b070,_0x182754){const _0x38274c=a157_0x34d1,_0x2a8571=a157_0x2ad32a['relative'](_0x182754,_0x4903b7);if(existsSync(_0x4903b7)){const _0x451e5d=readFileSync(_0x4903b7,_0x38274c(0x238)),_0x2809ff=generateDiff(_0x451e5d,_0x40b070),_0x24a15a=hasChanges(_0x2809ff);return{'relativePath':_0x2a8571,'absolutePath':_0x4903b7,'content':_0x40b070,'isNew':![],'hasChanges':_0x24a15a,'diff':_0x24a15a?formatDiffWithColors(_0x2809ff):undefined};}return{'relativePath':_0x2a8571,'absolutePath':_0x4903b7,'content':_0x40b070,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x3fd6c3,_0x49eac0,_0xb125f8){const _0x144c9c=a157_0x34d1,_0x3cbd12=_0x3fd6c3+':'+_0x49eac0,_0x1fe1ea=_0xb125f8[_0x144c9c(0x219)](_0x3cbd12)||0x0;_0xb125f8[_0x144c9c(0x23a)](_0x3cbd12,_0x1fe1ea+0x1);if(_0x1fe1ea===0x0)return _0x49eac0;return _0x49eac0+'_'+(_0x1fe1ea+0x1);}export async function pullSegments(_0x3e29dd,_0xdb109a,_0x5b8e9f={}){const _0x37c9c5=a157_0x34d1,{targetDir:_0x2544cb,progress:_0xbb73b2}=_0x5b8e9f;_0xbb73b2?.[_0x37c9c5(0x1fa)](_0x37c9c5(0x22f));const _0x399925=await _0x3e29dd['segment'][_0x37c9c5(0x22c)](_0xdb109a);_0xbb73b2?.[_0x37c9c5(0x1fa)](_0x37c9c5(0x232));const _0x224e94=await _0x3e29dd[_0x37c9c5(0x224)][_0x37c9c5(0x212)](_0x399925),_0xbdc460=_0x224e94['attributes'][_0x37c9c5(0x222)];_0xbb73b2?.[_0x37c9c5(0x1fa)](_0x37c9c5(0x201));const [_0x585aa4,_0x3f76bf,_0x526307]=await Promise[_0x37c9c5(0x229)]([_0x3e29dd[_0x37c9c5(0x224)][_0x37c9c5(0x1f4)](_0x399925),_0x3e29dd[_0x37c9c5(0x224)][_0x37c9c5(0x210)](_0x399925),_0x3e29dd['journey'][_0x37c9c5(0x231)](_0x399925,{'includeAllVersions':!![]})]),{journeys:_0x32ba4f,activationStepsById:_0x3909d4}=_0x526307,_0xb409ee=new Map();for(const _0x277594 of _0x32ba4f){_0xb409ee[_0x37c9c5(0x23a)](_0x277594['id'],_0x277594);}const _0x1115a1=_0x32ba4f['map'](_0x6ed9e9=>({'id':_0x6ed9e9['id'],'name':_0x6ed9e9[_0x37c9c5(0x1f5)][_0x37c9c5(0x222)],'journeyBundleName':_0x6ed9e9[_0x37c9c5(0x1f5)][_0x37c9c5(0x1f8)]||'','journeyBundleId':_0x6ed9e9['attributes']['journeyBundleId']||'','versionNumber':_0x6ed9e9[_0x37c9c5(0x1f5)][_0x37c9c5(0x237)],'description':_0x6ed9e9[_0x37c9c5(0x1f5)][_0x37c9c5(0x21a)],'state':_0x6ed9e9['attributes'][_0x37c9c5(0x214)],'paused':_0x6ed9e9['attributes'][_0x37c9c5(0x227)],'audienceId':_0x6ed9e9[_0x37c9c5(0x1f5)]['audienceId'],'folderId':_0x6ed9e9['relationships']?.[_0x37c9c5(0x20e)]?.['data']?.['id'],'createdAt':_0x6ed9e9[_0x37c9c5(0x1f5)][_0x37c9c5(0x23b)],'updatedAt':_0x6ed9e9[_0x37c9c5(0x1f5)][_0x37c9c5(0x217)]})),_0x5a574c=buildFolderIdToPathMap(_0x3f76bf),_0x5335fc=_0x2544cb||_0x37c9c5(0x211)+sanitizeFileName(_0xbdc460);_0xbb73b2?.[_0x37c9c5(0x1fa)](_0x37c9c5(0x20b));const _0x4e1397=new Map();await batchAsync(_0x585aa4,async _0x382c68=>{const _0x412858=_0x37c9c5,_0x4c3d5d=await _0x3e29dd[_0x412858(0x224)][_0x412858(0x208)](_0x399925,_0x382c68['id']);_0x4e1397[_0x412858(0x23a)](_0x382c68['id'],_0x4c3d5d);}),_0xbb73b2?.[_0x37c9c5(0x1fa)](_0x37c9c5(0x21f));const [_0x225e0c,_0x494f78]=await Promise[_0x37c9c5(0x229)]([_0x3e29dd['user']['buildIdToEmailMap'](),_0x3e29dd[_0x37c9c5(0x20f)][_0x37c9c5(0x223)]()]),_0x422d71=[],_0x3a690d=new Map(),_0x5c351f=a157_0x2ad32a[_0x37c9c5(0x221)](_0x5335fc,_0x37c9c5(0x1fb)),_0x366650=createTdxConfigContent(_0xbdc460);_0x422d71['push'](prepareFile(_0x5c351f,_0x366650,_0x5335fc));const _0x309270=new Map();for(const _0x139427 of _0x585aa4){_0x309270['set'](_0x139427['id'],_0x139427);}let _0x5e0bf7=_0x585aa4;if(_0x5b8e9f[_0x37c9c5(0x20c)]){const _0x568190=_0x585aa4[_0x37c9c5(0x206)](_0x5dc698=>_0x5dc698[_0x37c9c5(0x222)][_0x37c9c5(0x1fd)]()===_0x5b8e9f[_0x37c9c5(0x20c)][_0x37c9c5(0x1fd)]());_0x568190['length']>0x0&&(_0x5e0bf7=_0x568190);}_0xbb73b2?.[_0x37c9c5(0x1fa)](_0x37c9c5(0x1f7));for(const _0x538a0d of _0x5e0bf7){if(_0x538a0d['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x47bfc6=_0x538a0d[_0x37c9c5(0x236)]?_0x5a574c['get'](_0x538a0d['segmentFolderId'])||'':'',_0x2914b9=_0x4e1397[_0x37c9c5(0x219)](_0x538a0d['id'])||[],_0x2d2414=segmentWithActivationsToYaml(_0x538a0d,_0x2914b9,undefined,_0x225e0c,_0x494f78),_0x3d7650=_0x47bfc6?a157_0x2ad32a[_0x37c9c5(0x221)](_0x5335fc,_0x47bfc6):_0x5335fc,_0x30dedc=sanitizeFileName(_0x538a0d[_0x37c9c5(0x222)]),_0x16a1da=getUniqueFileName(_0x3d7650,_0x30dedc,_0x3a690d),_0x165b0a=a157_0x2ad32a[_0x37c9c5(0x221)](_0x3d7650,_0x16a1da+_0x37c9c5(0x213)),_0x828f6f=segmentToYamlString(_0x2d2414);_0x422d71[_0x37c9c5(0x1f3)](prepareFile(_0x165b0a,_0x828f6f,_0x5335fc));}const _0xa2bcff=new Map();for(const _0x2142cf of _0x1115a1){const _0x2b389b=_0x2142cf['journeyBundleId'];!_0xa2bcff[_0x37c9c5(0x218)](_0x2b389b)&&_0xa2bcff['set'](_0x2b389b,[]),_0xa2bcff[_0x37c9c5(0x219)](_0x2b389b)[_0x37c9c5(0x1f3)](_0x2142cf);}for(const _0xf5e8c0 of _0xa2bcff[_0x37c9c5(0x22b)]()){_0xf5e8c0['sort']((_0x5504d5,_0x4bf78e)=>(_0x5504d5[_0x37c9c5(0x237)]||0x0)-(_0x4bf78e[_0x37c9c5(0x237)]||0x0));}if(_0x5b8e9f[_0x37c9c5(0x20c)]){const _0x166189=new Map();for(const [_0xec743,_0x2ee4f7]of _0xa2bcff){const _0x49cb4d=_0x2ee4f7[0x0][_0x37c9c5(0x1f8)];if(_0x49cb4d[_0x37c9c5(0x1fd)]()===_0x5b8e9f[_0x37c9c5(0x20c)][_0x37c9c5(0x1fd)]()){_0x166189[_0x37c9c5(0x23a)](_0xec743,_0x2ee4f7);break;}}_0xa2bcff[_0x37c9c5(0x234)]();for(const [_0x358252,_0x380c12]of _0x166189){_0xa2bcff['set'](_0x358252,_0x380c12);}}if(_0xa2bcff[_0x37c9c5(0x226)]>0x0){_0xbb73b2?.[_0x37c9c5(0x1fa)](_0x37c9c5(0x203));const _0x1a2161=Array[_0x37c9c5(0x225)](_0xa2bcff[_0x37c9c5(0x22b)]()),_0x2b2cd7=0x5,{createYamlContext:_0x2ab712}=createYamlContextForBundle(_0x3e29dd,_0x309270,_0x225e0c,_0x494f78,_0x3909d4,_0xb409ee);for(let _0x936a75=0x0;_0x936a75<_0x1a2161['length'];_0x936a75+=_0x2b2cd7){const _0x3e19b7=_0x1a2161[_0x37c9c5(0x1fc)](_0x936a75,_0x936a75+_0x2b2cd7),_0x350214=await Promise[_0x37c9c5(0x229)](_0x3e19b7[_0x37c9c5(0x20a)](async _0x4f5a0c=>{const _0x3485c0=_0x37c9c5,_0x2e64f4=_0x4f5a0c[0x0],_0x5e8fee=_0x2e64f4['journeyBundleName'];_0xbb73b2?.['update'](_0x3485c0(0x1f6)+_0x5e8fee);const _0x12f0f8=_0x2e64f4[_0x3485c0(0x205)]?_0x5a574c[_0x3485c0(0x219)](_0x2e64f4[_0x3485c0(0x205)])||'':'',_0x2ece9d=_0x12f0f8?a157_0x2ad32a['join'](_0x5335fc,_0x12f0f8):_0x5335fc,_0xeca82d=sanitizeFileName(_0x5e8fee),_0x324f3b=a157_0x2ad32a[_0x3485c0(0x221)](_0x2ece9d,_0xeca82d+_0x3485c0(0x213));let _0x13efdd;if(existsSync(_0x324f3b))try{const _0x43216d=readFileSync(_0x324f3b,_0x3485c0(0x238)),_0x3968df=a157_0x134821(_0x43216d);_0x13efdd=buildLocalRuleToNameMappingFromJourney(_0x3968df);}catch{}const _0xfccda9=[];for(const _0x22ff34 of _0x4f5a0c){const _0xc352d5=_0xb409ee['get'](_0x22ff34['id']);if(!_0xc352d5){_0xbb73b2?.[_0x3485c0(0x1fa)](_0x3485c0(0x21b)+_0x22ff34['id']+'\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping');continue;}const _0xf74818=_0xc352d5['attributes']?.[_0x3485c0(0x228)],_0x4c29ad=_0x2ab712(_0x22ff34['id'],_0xf74818),_0x49a7d5=await journeyResponseToDef(_0xc352d5,_0x4c29ad);_0xfccda9[_0x3485c0(0x1f3)]({'item':_0x22ff34,'yaml':_0x49a7d5});}const _0x1238f7=await _0x3e29dd[_0x3485c0(0x202)]['getLatestJourneyId'](_0x2e64f4[_0x3485c0(0x22a)]),_0x1670ca=buildMergedJourneyDef(_0xfccda9,_0x13efdd,_0x1238f7);return{'bundleName':_0x5e8fee,'folderPath':_0x12f0f8,'finalYaml':_0x1670ca};}));for(const {bundleName:_0x4dc791,folderPath:_0x27f65a,finalYaml:_0x3ce736}of _0x350214){const _0xc1e9d1=normalizeJourneyDef(_0x3ce736),_0x9fad07=a157_0x56b6c5(_0xc1e9d1),_0x47ed86=_0x27f65a?a157_0x2ad32a[_0x37c9c5(0x221)](_0x5335fc,_0x27f65a):_0x5335fc,_0xb4f66e=sanitizeFileName(_0x4dc791),_0x3fc996=getUniqueFileName(_0x47ed86,_0xb4f66e,_0x3a690d),_0x6e7f02=a157_0x2ad32a['join'](_0x47ed86,_0x3fc996+_0x37c9c5(0x213));_0x422d71['push'](prepareFile(_0x6e7f02,_0x9fad07,_0x5335fc));}}}const _0x479194=Array[_0x37c9c5(0x225)](_0x4e1397[_0x37c9c5(0x22b)]())['reduce']((_0x413311,_0x6b5b2)=>_0x413311+_0x6b5b2[_0x37c9c5(0x23c)],0x0),_0x42da79=_0x5e0bf7[_0x37c9c5(0x206)](_0x370391=>_0x370391['kind']!==SEGMENT_KIND_JOURNEY),_0x45f8ab=_0x422d71[_0x37c9c5(0x206)](_0x1efda7=>_0x1efda7[_0x37c9c5(0x239)])['length'],_0x3c0d69=_0x422d71[_0x37c9c5(0x206)](_0xdc77a=>!_0xdc77a[_0x37c9c5(0x239)]&&_0xdc77a['hasChanges'])['length'],_0x150cf1=_0x422d71[_0x37c9c5(0x206)](_0x3cae64=>!_0x3cae64['isNew']&&!_0x3cae64[_0x37c9c5(0x204)])[_0x37c9c5(0x23c)],_0x47ee57=Array[_0x37c9c5(0x225)](_0xa2bcff[_0x37c9c5(0x22b)]())[_0x37c9c5(0x220)]((_0x35209a,_0x468d21)=>_0x35209a+_0x468d21[_0x37c9c5(0x23c)],0x0);return{'parentName':_0xbdc460,'parentId':_0x399925,'targetDir':_0x5335fc,'files':_0x422d71,'counts':{'segments':_0x42da79['length'],'journeys':_0xa2bcff[_0x37c9c5(0x226)],'journeyVersions':_0x47ee57,'activations':_0x479194},'newFiles':_0x45f8ab,'changedFiles':_0x3c0d69,'unchangedFiles':_0x150cf1};}function createYamlContextForBundle(_0xdb9f0f,_0x35034d,_0xb41df9,_0x5a2496,_0x58f95a,_0x456e64){const _0x35ee80=new Set(),_0x283a5e=new Map(),_0x2cf6a1=new Map(),_0x1b6e97=createJumpTargetCache(),_0xab400f=async(_0x466ccb,_0x42fc88)=>{const _0xe3eb28=a157_0x34d1,_0x100a2a=_0x283a5e[_0xe3eb28(0x219)](_0x466ccb);if(_0x100a2a!==undefined)return _0x100a2a;if(!_0x42fc88)return _0x466ccb;try{let _0x4f2c18=_0x35034d[_0xe3eb28(0x219)](_0x466ccb);!_0x4f2c18&&(_0x4f2c18=await _0xdb9f0f[_0xe3eb28(0x224)][_0xe3eb28(0x1ff)](_0x42fc88,_0x466ccb),_0x35034d['set'](_0x466ccb,_0x4f2c18));const _0xba84ca=generateJourneyLocalName(_0x4f2c18[_0xe3eb28(0x222)]),_0x5a5176=_0x4f2c18[_0xe3eb28(0x216)]===SEGMENT_KIND_JOURNEY&&_0xba84ca!==undefined;if(_0x5a5176&&_0xba84ca){let _0x289ffa=_0xba84ca,_0x4d70b3=0x2;while(_0x35ee80[_0xe3eb28(0x218)](_0x289ffa)){_0x289ffa=_0xba84ca+'_'+_0x4d70b3,_0x4d70b3++;}return _0x35ee80['add'](_0x289ffa),_0x283a5e[_0xe3eb28(0x23a)](_0x466ccb,_0x289ffa),_0x289ffa;}return _0x4f2c18[_0xe3eb28(0x222)];}catch{return _0x466ccb;}},_0xc30843=(_0x53c248,_0x5460ab)=>({'resolveSegment':async _0x508a13=>{const _0x2a81d6=a157_0x34d1,_0x336447=_0x283a5e['get'](_0x508a13);if(_0x336447!==undefined)return{'name':_0x336447,'isJourneyLocal':!![]};if(!_0x5460ab)return{'name':_0x508a13,'isJourneyLocal':![]};try{let _0x5ac6ef=_0x35034d['get'](_0x508a13);!_0x5ac6ef&&(_0x5ac6ef=await _0xdb9f0f['segment'][_0x2a81d6(0x1ff)](_0x5460ab,_0x508a13),_0x35034d[_0x2a81d6(0x23a)](_0x508a13,_0x5ac6ef));const _0x16d8cc=generateJourneyLocalName(_0x5ac6ef[_0x2a81d6(0x222)]),_0x1dad03=_0x5ac6ef[_0x2a81d6(0x216)]===SEGMENT_KIND_JOURNEY&&_0x16d8cc!==undefined;if(_0x1dad03&&!_0x5ac6ef[_0x2a81d6(0x21e)]&&_0x5460ab)try{const _0x281bd5=await _0xdb9f0f[_0x2a81d6(0x224)][_0x2a81d6(0x1ff)](_0x5460ab,_0x508a13);_0x35034d['set'](_0x508a13,_0x281bd5),_0x5ac6ef=_0x281bd5;}catch{}const _0x26e759=await _0xab400f(_0x508a13,_0x5460ab);let _0x52c0b2;if(_0x1dad03&&_0x5ac6ef['rule']){const _0x3fb1a3=await segmentResponseToDef(_0x5ac6ef,{'resolveSegmentName':_0x1c0a6d=>_0xab400f(_0x1c0a6d,_0x5460ab)});_0x52c0b2={'description':_0x5ac6ef[_0x2a81d6(0x21a)],'rule':_0x3fb1a3[_0x2a81d6(0x21e)]};}return{'name':_0x26e759,'isJourneyLocal':_0x1dad03,'definition':_0x52c0b2};}catch{return{'name':_0x508a13,'isJourneyLocal':![]};}},'resolveActivation':async _0x361ca8=>{const _0x5896ca=a157_0x34d1,_0x222082=_0x2cf6a1[_0x5896ca(0x219)](_0x361ca8);if(_0x222082!==undefined)return{'name':_0x222082,'isJourneyLocal':!![]};try{let _0x3da8c8=_0x58f95a[_0x5896ca(0x219)](_0x361ca8);!_0x3da8c8&&(_0x3da8c8=await _0xdb9f0f[_0x5896ca(0x202)][_0x5896ca(0x1f2)](_0x53c248,_0x361ca8));const _0x5bc7e0=_0x3da8c8[_0x5896ca(0x1f5)][_0x5896ca(0x1f9)][_0x5896ca(0x222)]||_0x361ca8,_0x5b8e37=sanitizeYamlKey(_0x5bc7e0)||_0x5896ca(0x21d)+_0x361ca8,_0x2d2c80=_0x5b8e37;_0x2cf6a1[_0x5896ca(0x23a)](_0x361ca8,_0x2d2c80);const _0x55d494=journeyActivationStepToYaml(_0x3da8c8,_0xb41df9,_0x5a2496);return{'name':_0x2d2c80,'isJourneyLocal':!![],'definition':_0x55d494};}catch{return{'name':_0x361ca8,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2cb573,_0x4ea2bb)=>resolveJumpTarget(_0x2cb573,_0x4ea2bb,_0x1b6e97,async _0x205e48=>{const _0x1271a2=a157_0x34d1,_0x2f0441=_0x456e64['get'](_0x205e48);if(_0x2f0441)return _0x2f0441;return _0xdb9f0f[_0x1271a2(0x202)][_0x1271a2(0x215)](_0x205e48);})});return{'createYamlContext':_0xc30843};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a158_0x20d4(){const _0x436b98=['warn','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','journeyName','join','debug','stringify','1822288xzuTZq','dirname','tdx.sdk.push-recovery','181061KVBRUM','9RbeXXY','version','5ABkceG','.push-recovery.json','10199540vSkKiX','parse','4942164qwRRnt','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','utf-8','string','2tIrKvI','6607335xoabrj','2640451EEfyIp','basename','code','toISOString','60epjqpg','.tmp','ENOENT','23832fIEdnh','56aAiMVj','segments'];a158_0x20d4=function(){return _0x436b98;};return a158_0x20d4();}function a158_0x5852(_0x15a96f,_0x44192a){_0x15a96f=_0x15a96f-0x13e;const _0x20d454=a158_0x20d4();let _0x58523a=_0x20d454[_0x15a96f];return _0x58523a;}const a158_0x2a6e82=a158_0x5852;(function(_0x4e4858,_0x22fd27){const _0x3e9c42=a158_0x5852,_0x523e4f=_0x4e4858();while(!![]){try{const _0x447430=-parseInt(_0x3e9c42(0x13f))/0x1*(-parseInt(_0x3e9c42(0x14a))/0x2)+parseInt(_0x3e9c42(0x153))/0x3*(-parseInt(_0x3e9c42(0x154))/0x4)+-parseInt(_0x3e9c42(0x142))/0x5*(parseInt(_0x3e9c42(0x146))/0x6)+-parseInt(_0x3e9c42(0x14b))/0x7+parseInt(_0x3e9c42(0x15c))/0x8*(parseInt(_0x3e9c42(0x140))/0x9)+parseInt(_0x3e9c42(0x144))/0xa+parseInt(_0x3e9c42(0x14c))/0xb*(parseInt(_0x3e9c42(0x150))/0xc);if(_0x447430===_0x22fd27)break;else _0x523e4f['push'](_0x523e4f['shift']());}catch(_0xcdee34){_0x523e4f['push'](_0x523e4f['shift']());}}}(a158_0x20d4,0xb726f));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a158_0x426488 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a158_0x2a6e82(0x13e));export function getPushRecoveryPath(_0x41943e){const _0x5351f2=a158_0x2a6e82,_0x4402bf=a158_0x426488[_0x5351f2(0x15d)](_0x41943e),_0x2456d=a158_0x426488[_0x5351f2(0x14d)](_0x41943e);return a158_0x426488[_0x5351f2(0x159)](_0x4402bf,'.'+_0x2456d+_0x5351f2(0x143));}export function readPushRecovery(_0x47a138){const _0x226553=a158_0x2a6e82,_0x29fec7=getPushRecoveryPath(_0x47a138);if(!existsSync(_0x29fec7))return undefined;try{const _0x3b6b62=readFileSync(_0x29fec7,_0x226553(0x148)),_0x12754c=JSON[_0x226553(0x145)](_0x3b6b62);if(_0x12754c?.[_0x226553(0x141)]!==0x1||typeof _0x12754c[_0x226553(0x158)]!==_0x226553(0x149))return undefined;return _0x12754c;}catch(_0x55a546){return _0x55a546 instanceof SyntaxError?logger[_0x226553(0x15a)](_0x226553(0x147)+_0x55a546):logger[_0x226553(0x156)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x55a546),undefined;}}export function writePushRecovery(_0x537fe8,_0x491ce9){const _0x556180=a158_0x2a6e82,_0x59323b=getPushRecoveryPath(_0x537fe8),_0x44b879=_0x59323b+_0x556180(0x151);writeFileSync(_0x44b879,JSON[_0x556180(0x15b)](_0x491ce9,null,0x2)+'\x0a',_0x556180(0x148)),renameSync(_0x44b879,_0x59323b);}export function deletePushRecovery(_0x3caf99){const _0x44af8b=a158_0x2a6e82,_0x3f4ce5=getPushRecoveryPath(_0x3caf99);try{unlinkSync(_0x3f4ce5);}catch(_0x5f5510){_0x5f5510[_0x44af8b(0x14e)]!==_0x44af8b(0x152)&&logger['debug'](_0x44af8b(0x157)+_0x5f5510);}}export function saveSegmentToPushRecovery(_0x212ea8,_0x131d56,_0x39abca,_0x4b79cb){const _0x55cdc7=a158_0x2a6e82,_0x334492=readPushRecovery(_0x212ea8),_0x4fb0d8=_0x334492?.[_0x55cdc7(0x158)]===_0x131d56?{..._0x334492,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x131d56,'updatedAt':new Date()[_0x55cdc7(0x14f)](),'segments':{}};_0x4fb0d8[_0x55cdc7(0x155)][_0x39abca]=_0x4b79cb,writePushRecovery(_0x212ea8,_0x4fb0d8);}
|