@treasuredata/tdx 2026.3.45 → 2026.3.47
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/auth-login-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/builtin-schedules/builtin-schedules/execute-items/TASK.md +62 -0
- package/dist/sdk/workspace/builtin-schedules/builtin-schedules/execute-items/schedule.yaml +20 -0
- package/dist/sdk/workspace/builtin-schedules/builtin-schedules/item-triage/TASK.md +106 -0
- package/dist/sdk/workspace/builtin-schedules/builtin-schedules/item-triage/schedule.yaml +18 -0
- package/dist/sdk/workspace/builtin-schedules/builtin-schedules/stale-item-cleanup/TASK.md +26 -0
- package/dist/sdk/workspace/builtin-schedules/builtin-schedules/stale-item-cleanup/schedule.yaml +15 -0
- package/dist/sdk/workspace/builtin-schedules/builtin-schedules/synthesize-knowledge/TASK.md +26 -0
- package/dist/sdk/workspace/builtin-schedules/builtin-schedules/synthesize-knowledge/schedule.yaml +16 -0
- package/dist/sdk/workspace/builtin-schedules/builtin-schedules/weekly-review/TASK.md +21 -0
- package/dist/sdk/workspace/builtin-schedules/builtin-schedules/weekly-review/schedule.yaml +14 -0
- package/dist/sdk/workspace/builtin-schedules/execute-items/TASK.md +62 -0
- package/dist/sdk/workspace/builtin-schedules/execute-items/schedule.yaml +20 -0
- package/dist/sdk/workspace/builtin-schedules/item-triage/TASK.md +106 -0
- package/dist/sdk/workspace/builtin-schedules/item-triage/schedule.yaml +18 -0
- package/dist/sdk/workspace/builtin-schedules/stale-item-cleanup/TASK.md +26 -0
- package/dist/sdk/workspace/builtin-schedules/stale-item-cleanup/schedule.yaml +15 -0
- package/dist/sdk/workspace/builtin-schedules/synthesize-knowledge/TASK.md +26 -0
- package/dist/sdk/workspace/builtin-schedules/synthesize-knowledge/schedule.yaml +16 -0
- package/dist/sdk/workspace/builtin-schedules/weekly-review/TASK.md +21 -0
- package/dist/sdk/workspace/builtin-schedules/weekly-review/schedule.yaml +14 -0
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.d.ts +5 -1
- package/dist/sdk/workspace/index.d.ts.map +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/index.js.map +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x2fcabc,_0x536e43){const _0x1e88d8=a149_0x1618,_0x8479e9=_0x2fcabc();while(!![]){try{const _0xcc04b1=parseInt(_0x1e88d8(0x12a))/0x1+parseInt(_0x1e88d8(0x110))/0x2+-parseInt(_0x1e88d8(0x103))/0x3+-parseInt(_0x1e88d8(0x154))/0x4*(parseInt(_0x1e88d8(0x100))/0x5)+parseInt(_0x1e88d8(0x135))/0x6*(parseInt(_0x1e88d8(0x142))/0x7)+parseInt(_0x1e88d8(0x13a))/0x8+parseInt(_0x1e88d8(0x12e))/0x9*(parseInt(_0x1e88d8(0x11a))/0xa);if(_0xcc04b1===_0x536e43)break;else _0x8479e9['push'](_0x8479e9['shift']());}catch(_0x32745d){_0x8479e9['push'](_0x8479e9['shift']());}}}(a149_0x139b,0x38862));import*as a149_0x541ffb from'yaml';function formatScheduleTime(_0x35d37c){const _0x2ba23e=a149_0x1618;if(typeof _0x35d37c===_0x2ba23e(0x147)){const _0x2216fe=Math[_0x2ba23e(0x13c)](_0x35d37c);return String(_0x2216fe)[_0x2ba23e(0x102)](0x2,'0')+_0x2ba23e(0x125);}if(typeof _0x35d37c===_0x2ba23e(0xf5)){if(/^\d{2}:\d{2}:\d{2}$/['test'](_0x35d37c))return _0x35d37c;if(/^\d{1,2}:\d{2}$/[_0x2ba23e(0xf2)](_0x35d37c)){const [_0x11a3ee,_0x58c18f]=_0x35d37c[_0x2ba23e(0x10b)](':');return _0x11a3ee[_0x2ba23e(0x102)](0x2,'0')+':'+_0x58c18f+_0x2ba23e(0xfc);}const _0x1c9ebb=parseInt(_0x35d37c,0xa);if(!isNaN(_0x1c9ebb)&&_0x35d37c[_0x2ba23e(0x12d)](/^\d+$/))return String(_0x1c9ebb)[_0x2ba23e(0x102)](0x2,'0')+_0x2ba23e(0x125);return _0x35d37c;}return String(_0x35d37c);}export function apiToDef(_0x3f9cb9){const _0x17714b=a149_0x1618,_0xfe8868={'database':_0x3f9cb9['master']?.['parentDatabaseName']||'','table':_0x3f9cb9[_0x17714b(0x11f)]?.[_0x17714b(0x138)]||''};_0x3f9cb9[_0x17714b(0x107)]&&_0x3f9cb9[_0x17714b(0x107)][_0x17714b(0x104)]>0x0&&(_0xfe8868[_0x17714b(0xfe)]=_0x3f9cb9[_0x17714b(0x107)][_0x17714b(0x108)](_0x4675ef=>({'column':_0x4675ef[_0x17714b(0xfd)],'values':_0x4675ef['rightValues']})));let _0x19c587;_0x3f9cb9['scheduleType']&&_0x3f9cb9[_0x17714b(0x129)]!=='none'&&(_0x19c587={'type':_0x3f9cb9[_0x17714b(0x129)]},_0x3f9cb9[_0x17714b(0xfa)]&&(_0x19c587[_0x17714b(0x134)]=formatScheduleTime(_0x3f9cb9[_0x17714b(0xfa)])),_0x3f9cb9[_0x17714b(0x10e)]&&(_0x19c587[_0x17714b(0x10e)]=_0x3f9cb9['timezone']));let _0x391aad;(_0x3f9cb9['workflowHiveOnly']||_0x3f9cb9['hivePoolName']||_0x3f9cb9[_0x17714b(0x143)])&&(_0x391aad={},_0x3f9cb9[_0x17714b(0x130)]&&(_0x391aad[_0x17714b(0x12c)]=_0x3f9cb9[_0x17714b(0x130)]),_0x3f9cb9[_0x17714b(0x106)]&&(_0x391aad[_0x17714b(0xef)]=_0x3f9cb9[_0x17714b(0x106)]),_0x3f9cb9[_0x17714b(0x143)]&&(_0x391aad['trino_pool']=_0x3f9cb9[_0x17714b(0x143)]));const _0x38d114=_0x3f9cb9['attributes']&&_0x3f9cb9[_0x17714b(0x14c)]['length']>0x0?groupAttributesBySource(_0x3f9cb9['attributes']):undefined,_0x208d8e=_0x3f9cb9[_0x17714b(0x131)]&&_0x3f9cb9[_0x17714b(0x131)][_0x17714b(0x104)]>0x0?_0x3f9cb9[_0x17714b(0x131)][_0x17714b(0x108)](convertApiBehaviorToYaml):undefined;let _0x54cf94;_0x3f9cb9[_0x17714b(0x123)]&&(_0x54cf94={'name':_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x157)],'source':{'database':_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x11e)],'table':_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x138)]},'join':{'parent_key':_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0xf1)],'child_key':_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x12b)]}},_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x13b)]&&_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x13b)][_0x17714b(0x104)]>0x0&&(_0x54cf94['attributes']=groupAttributesBySource(_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0x13b)])),_0x3f9cb9['customerGroup'][_0x17714b(0xf8)]&&_0x3f9cb9['customerGroup'][_0x17714b(0xf8)]['length']>0x0&&(_0x54cf94[_0x17714b(0x131)]=_0x3f9cb9[_0x17714b(0x123)][_0x17714b(0xf8)]['map'](convertApiBehaviorToYaml)));const _0x2097bd={'name':_0x3f9cb9['name'],..._0x3f9cb9[_0x17714b(0x159)]&&{'description':_0x3f9cb9['description']},'master':_0xfe8868,..._0x19c587&&{'schedule':_0x19c587},..._0x391aad&&{'engine':_0x391aad},..._0x38d114&&{'attributes':_0x38d114},..._0x208d8e&&{'behaviors':_0x208d8e},..._0x54cf94&&{'customer_group':_0x54cf94}};return _0x2097bd;}function groupAttributesBySource(_0x2cc0b6){const _0x4d6149=a149_0x1618,_0x467bae=new Map();for(const _0x51a0c7 of _0x2cc0b6){const _0x33cd7a=_0x51a0c7[_0x4d6149(0x11e)]+'.'+_0x51a0c7[_0x4d6149(0x138)]+'.'+_0x51a0c7[_0x4d6149(0x12b)]+'.'+_0x51a0c7[_0x4d6149(0xf1)];!_0x467bae[_0x4d6149(0x10f)](_0x33cd7a)&&_0x467bae[_0x4d6149(0xf3)](_0x33cd7a,[]),_0x467bae[_0x4d6149(0x117)](_0x33cd7a)['push'](_0x51a0c7);}const _0x1ff301=[];for(const [,_0x298522]of _0x467bae){const _0x530cd4=_0x298522[0x0],_0x260e67=_0x530cd4[_0x4d6149(0xff)]||_0x530cd4[_0x4d6149(0x138)];_0x1ff301[_0x4d6149(0x139)]({'name':_0x260e67,'source':{'database':_0x530cd4['parentDatabaseName'],'table':_0x530cd4[_0x4d6149(0x138)]},'join':{'parent_key':_0x530cd4[_0x4d6149(0xf1)],'child_key':_0x530cd4['parentKey']},'columns':_0x298522['map'](_0x2e06af=>{const _0x578cc0=_0x4d6149,_0x305b1c={'column':_0x2e06af[_0x578cc0(0x149)],'type':_0x2e06af['type']};return _0x2e06af[_0x578cc0(0x157)]!==_0x2e06af[_0x578cc0(0x149)]&&(_0x305b1c[_0x578cc0(0x12f)]=_0x2e06af[_0x578cc0(0x157)]),_0x305b1c;})});}return _0x1ff301;}function convertApiBehaviorToYaml(_0x1ea523){const _0x145d6c=a149_0x1618,_0x24cbd1={'name':_0x1ea523[_0x145d6c(0x157)],'source':{'database':_0x1ea523[_0x145d6c(0x11e)],'table':_0x1ea523[_0x145d6c(0x138)]},'join':{'parent_key':_0x1ea523['foreignKey'],'child_key':_0x1ea523[_0x145d6c(0x12b)]}};if(_0x1ea523[_0x145d6c(0x113)])_0x24cbd1['all_columns']=!![];else _0x1ea523['schema']&&_0x1ea523[_0x145d6c(0x158)]['length']>0x0&&(_0x24cbd1['columns']=_0x1ea523[_0x145d6c(0x158)][_0x145d6c(0x108)](_0x440e31=>{const _0x536717=_0x145d6c,_0x8d1e39={'column':_0x440e31['parentColumn'],'type':_0x440e31[_0x536717(0x14b)]};return _0x440e31['name']!==_0x440e31[_0x536717(0x149)]&&(_0x8d1e39[_0x536717(0x12f)]=_0x440e31[_0x536717(0x157)]),_0x8d1e39;}));return _0x1ea523[_0x145d6c(0x116)]&&(_0x24cbd1['default_time_filter']=_0x1ea523[_0x145d6c(0x116)]),_0x1ea523[_0x145d6c(0x105)]&&(_0x24cbd1[_0x145d6c(0x152)]=_0x1ea523[_0x145d6c(0x105)]),_0x24cbd1;}function a149_0x139b(){const _0x3321c9=['number','Display\x20Name','parentColumn','isArray','type','attributes','schedule','includes','realtime.attributes[','all_columns','single','realtime','schedule:','4QknuQb','trino_pool','customer_id','name','schema','description','default_time_filter','personalization_services','customer_group','columns','values','hive_pool','personalization_services\x20must\x20be\x20an\x20array','foreignKey','test','set','engine','string','id_stitching','null','customerGroupBehaviors','attribute_table','scheduleOption','realtime:',':00','columnName','filters','groupingName','1460405MEiGVj','Example\x20Events','padStart','1281531yEfYGc','length','isRealtime','hivePoolName','audienceFilters','map','stringify','YAML\x20config\x20missing\x20required\x20field:\x20master','split','database','child_key','timezone','has','238546DQZXKn','03:00','UTC','allColumns','replace','parent_key','defaultTimeFilterEnabled','get','parse','column_name','10plpqaC','YAML\x20config\x20missing\x20required\x20field:\x20master.table','counter','events','parentDatabaseName','master','forEach','ordered_set','master:','customerGroup','primary_key',':00:00',']\x20(',']:\x20Missing\x20required\x20field\x20\x27name\x27','\x27.\x20Must\x20be\x20one\x20of:\x20','scheduleType','187491OiNnBi','parentKey','hive_only','match','868437VuoSSh','label','workflowHiveOnly','behaviors','join','column','time','488442AeEpgt','YAML\x20config\x20missing\x20required\x20field:\x20name','source','parentTableName','push','2426416fRMOXN','customerGroupAttributes','floor','imported_batch','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','Parent\x20segment\x20description','list','table','21qcunzC','prestoPoolName','attributes:','):\x20Invalid\x20type\x20\x27','customer_group:'];a149_0x139b=function(){return _0x3321c9;};return a149_0x139b();}export function defToApi(_0x566a52){const _0x404847=a149_0x1618,_0x3b939b={'name':_0x566a52[_0x404847(0x157)],'master':{'parentDatabaseName':_0x566a52[_0x404847(0x11f)][_0x404847(0x10c)],'parentTableName':_0x566a52[_0x404847(0x11f)][_0x404847(0x141)]}};_0x566a52[_0x404847(0x159)]&&(_0x3b939b[_0x404847(0x159)]=_0x566a52['description']);_0x566a52['master'][_0x404847(0xfe)]&&_0x566a52[_0x404847(0x11f)][_0x404847(0xfe)][_0x404847(0x104)]>0x0&&(_0x3b939b[_0x404847(0x107)]=_0x566a52['master'][_0x404847(0xfe)][_0x404847(0x108)](_0x24eeb4=>({'columnName':_0x24eeb4[_0x404847(0x133)],'rightValues':_0x24eeb4[_0x404847(0xee)]})));_0x566a52[_0x404847(0x14d)]&&(_0x3b939b[_0x404847(0x129)]=_0x566a52[_0x404847(0x14d)][_0x404847(0x14b)],_0x566a52[_0x404847(0x14d)]['time']&&(_0x3b939b[_0x404847(0xfa)]=_0x566a52[_0x404847(0x14d)][_0x404847(0x134)]),_0x566a52[_0x404847(0x14d)][_0x404847(0x10e)]&&(_0x3b939b['timezone']=_0x566a52[_0x404847(0x14d)]['timezone']));_0x566a52['engine']&&(_0x566a52[_0x404847(0xf4)][_0x404847(0x12c)]!==undefined&&(_0x3b939b[_0x404847(0x130)]=_0x566a52[_0x404847(0xf4)][_0x404847(0x12c)]),_0x566a52[_0x404847(0xf4)][_0x404847(0xef)]!==undefined&&(_0x3b939b[_0x404847(0x106)]=_0x566a52['engine'][_0x404847(0xef)]),_0x566a52[_0x404847(0xf4)][_0x404847(0x155)]!==undefined&&(_0x3b939b[_0x404847(0x143)]=_0x566a52[_0x404847(0xf4)]['trino_pool']));_0x566a52['attributes']&&_0x566a52[_0x404847(0x14c)][_0x404847(0x104)]>0x0&&(_0x3b939b[_0x404847(0x14c)]=flattenAttributeGroups(_0x566a52['attributes']));_0x566a52[_0x404847(0x131)]&&_0x566a52[_0x404847(0x131)][_0x404847(0x104)]>0x0&&(_0x3b939b[_0x404847(0x131)]=_0x566a52[_0x404847(0x131)][_0x404847(0x108)](convertDefBehaviorToApi));if(_0x566a52[_0x404847(0x15c)]){const _0x440f64=_0x566a52['customer_group'];_0x3b939b[_0x404847(0x123)]={'name':_0x440f64[_0x404847(0x157)],'parentDatabaseName':_0x440f64['source'][_0x404847(0x10c)],'parentTableName':_0x440f64['source'][_0x404847(0x141)],'parentKey':_0x440f64[_0x404847(0x132)][_0x404847(0x10d)],'foreignKey':_0x440f64['join'][_0x404847(0x115)]},_0x440f64[_0x404847(0x14c)]&&_0x440f64[_0x404847(0x14c)][_0x404847(0x104)]>0x0&&(_0x3b939b[_0x404847(0x123)]['customerGroupAttributes']=flattenAttributeGroups(_0x440f64[_0x404847(0x14c)])[_0x404847(0x108)](_0x16bcbd=>({'name':_0x16bcbd[_0x404847(0x157)],'type':_0x16bcbd[_0x404847(0x14b)],'parentDatabaseName':_0x16bcbd[_0x404847(0x11e)],'parentTableName':_0x16bcbd[_0x404847(0x138)],'parentColumn':_0x16bcbd['parentColumn'],'parentKey':_0x16bcbd[_0x404847(0x12b)],'foreignKey':_0x16bcbd[_0x404847(0xf1)]}))),_0x440f64[_0x404847(0x131)]&&_0x440f64[_0x404847(0x131)][_0x404847(0x104)]>0x0&&(_0x3b939b['customerGroup']['customerGroupBehaviors']=_0x440f64[_0x404847(0x131)][_0x404847(0x108)](_0x187b3e=>({'name':_0x187b3e['name'],'parentDatabaseName':_0x187b3e['source'][_0x404847(0x10c)],'parentTableName':_0x187b3e[_0x404847(0x137)][_0x404847(0x141)],'parentKey':_0x187b3e[_0x404847(0x132)][_0x404847(0x10d)],'foreignKey':_0x187b3e[_0x404847(0x132)]['parent_key'],'allColumns':_0x187b3e['all_columns'],'schema':_0x187b3e[_0x404847(0xed)]?.[_0x404847(0x108)](_0x1471f3=>({'name':_0x1471f3['label']||_0x1471f3[_0x404847(0x133)],'type':_0x1471f3[_0x404847(0x14b)],'parentColumn':_0x1471f3[_0x404847(0x133)]}))})));}return _0x3b939b;}function flattenAttributeGroups(_0x46b595){const _0x25320f=a149_0x1618,_0x153e8f=[];for(const _0xb5e205 of _0x46b595){for(const _0x1b2ebf of _0xb5e205[_0x25320f(0xed)]){_0x153e8f[_0x25320f(0x139)]({'name':_0x1b2ebf[_0x25320f(0x12f)]||_0x1b2ebf[_0x25320f(0x133)],'type':_0x1b2ebf[_0x25320f(0x14b)],'parentDatabaseName':_0xb5e205['source']['database'],'parentTableName':_0xb5e205[_0x25320f(0x137)][_0x25320f(0x141)],'parentColumn':_0x1b2ebf[_0x25320f(0x133)],'parentKey':_0xb5e205[_0x25320f(0x132)]['child_key'],'foreignKey':_0xb5e205[_0x25320f(0x132)]['parent_key'],'groupingName':_0xb5e205['name']});}}return _0x153e8f;}function a149_0x1618(_0x247cc5,_0x39cd41){_0x247cc5=_0x247cc5-0xed;const _0x139ba0=a149_0x139b();let _0x16184c=_0x139ba0[_0x247cc5];return _0x16184c;}function convertDefBehaviorToApi(_0x67c6ac){const _0xd60627=a149_0x1618,_0x2a1cfa={'name':_0x67c6ac[_0xd60627(0x157)],'parentDatabaseName':_0x67c6ac[_0xd60627(0x137)]['database'],'parentTableName':_0x67c6ac[_0xd60627(0x137)][_0xd60627(0x141)],'parentKey':_0x67c6ac[_0xd60627(0x132)][_0xd60627(0x10d)],'foreignKey':_0x67c6ac[_0xd60627(0x132)][_0xd60627(0x115)]};if(_0x67c6ac[_0xd60627(0x150)])_0x2a1cfa[_0xd60627(0x113)]=!![];else _0x67c6ac[_0xd60627(0xed)]&&_0x67c6ac[_0xd60627(0xed)][_0xd60627(0x104)]>0x0&&(_0x2a1cfa[_0xd60627(0x158)]=_0x67c6ac['columns'][_0xd60627(0x108)](_0x42d48e=>({'name':_0x42d48e[_0xd60627(0x12f)]||_0x42d48e[_0xd60627(0x133)],'type':_0x42d48e['type'],'parentColumn':_0x42d48e[_0xd60627(0x133)]})));return _0x67c6ac['default_time_filter']!==undefined&&(_0x2a1cfa[_0xd60627(0x116)]=_0x67c6ac[_0xd60627(0x15a)]),_0x67c6ac[_0xd60627(0x152)]!==undefined&&(_0x2a1cfa[_0xd60627(0x105)]=_0x67c6ac[_0xd60627(0x152)]),_0x2a1cfa;}export function serializeDef(_0x5b2af9){const _0x40d009=a149_0x1618,_0x4ce6bb=JSON[_0x40d009(0x118)](JSON[_0x40d009(0x109)](_0x5b2af9)),_0x462d4f=a149_0x541ffb[_0x40d009(0x109)](_0x4ce6bb,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x40d009(0xf7)}),_0x37b637=[_0x40d009(0x122),_0x40d009(0x153),'engine:',_0x40d009(0x144),'behaviors:',_0x40d009(0x146),_0x40d009(0xfb),'personalization_services:'];let _0x4e29b2=_0x462d4f;for(const _0x34c61a of _0x37b637){_0x4e29b2=_0x4e29b2[_0x40d009(0x114)](new RegExp('^('+_0x34c61a+')','m'),(_0x1df076,_0x54b725,_0x376bae)=>{if(_0x376bae===0x0||_0x4e29b2[_0x376bae-0x1]==='\x0a'&&_0x4e29b2[_0x376bae-0x2]==='\x0a')return _0x54b725;return'\x0a'+_0x54b725;});}return _0x4e29b2;}export function parseDef(_0x265d2a){const _0x435e5d=a149_0x1618,_0x191d99=a149_0x541ffb['parse'](_0x265d2a);if(!_0x191d99[_0x435e5d(0x157)])throw new Error(_0x435e5d(0x136));if(!_0x191d99[_0x435e5d(0x11f)])throw new Error(_0x435e5d(0x10a));if(!_0x191d99[_0x435e5d(0x11f)][_0x435e5d(0x10c)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x191d99['master'][_0x435e5d(0x141)])throw new Error(_0x435e5d(0x11b));return _0x191d99[_0x435e5d(0x152)]&&validateRealtimeSection(_0x191d99[_0x435e5d(0x152)]),_0x191d99['personalization_services']&&validatePersonalizationServices(_0x191d99[_0x435e5d(0x15b)]),_0x191d99;}function validateRealtimeSection(_0x2708ed){const _0x1a64aa=a149_0x1618,_0x4e7a14=[_0x1a64aa(0x151),_0x1a64aa(0x11c),_0x1a64aa(0xf3),_0x1a64aa(0x121),_0x1a64aa(0x140),_0x1a64aa(0x13d)];_0x2708ed[_0x1a64aa(0x11d)]&&Array['isArray'](_0x2708ed[_0x1a64aa(0x11d)])&&_0x2708ed[_0x1a64aa(0x11d)][_0x1a64aa(0x120)]((_0x3f93a5,_0x553367)=>{const _0x4d6c18=_0x1a64aa;if(!_0x3f93a5[_0x4d6c18(0x157)])throw new Error('realtime.events['+_0x553367+_0x4d6c18(0x127));});_0x2708ed['attributes']&&Array[_0x1a64aa(0x14a)](_0x2708ed[_0x1a64aa(0x14c)])&&_0x2708ed['attributes'][_0x1a64aa(0x120)]((_0x13ae7c,_0x2d9ea2)=>{const _0x5bd062=_0x1a64aa;if(!_0x13ae7c[_0x5bd062(0x157)])throw new Error(_0x5bd062(0x14f)+_0x2d9ea2+_0x5bd062(0x127));if(_0x13ae7c[_0x5bd062(0x14b)]&&!_0x4e7a14[_0x5bd062(0x14e)](_0x13ae7c['type']))throw new Error(_0x5bd062(0x14f)+_0x2d9ea2+_0x5bd062(0x126)+_0x13ae7c['name']+_0x5bd062(0x145)+_0x13ae7c[_0x5bd062(0x14b)]+_0x5bd062(0x128)+_0x4e7a14[_0x5bd062(0x132)](',\x20'));});if(_0x2708ed[_0x1a64aa(0xf6)]){if(!_0x2708ed[_0x1a64aa(0xf6)][_0x1a64aa(0x124)])throw new Error(_0x1a64aa(0x13e));}}function validatePersonalizationServices(_0x4083fa){const _0x3b332b=a149_0x1618;if(!Array[_0x3b332b(0x14a)](_0x4083fa))throw new Error(_0x3b332b(0xf0));_0x4083fa['forEach']((_0x2d37a5,_0x192ec5)=>{const _0x4270c9=_0x3b332b;if(!_0x2d37a5['name'])throw new Error('personalization_services['+_0x192ec5+_0x4270c9(0x127));});}export function generateTemplate(_0x2c7084,_0x49baf4,_0x5a800e){const _0x546957=a149_0x1618,_0x2d8a45={'name':_0x2c7084,'description':_0x546957(0x13f),'master':{'database':_0x49baf4,'table':_0x5a800e},'schedule':{'type':'daily','time':_0x546957(0x111),'timezone':_0x546957(0x112)},'attributes':[{'name':'Example\x20Attributes','source':{'database':_0x49baf4,'table':_0x546957(0xf9)},'join':{'parent_key':'id','child_key':_0x546957(0x156)},'columns':[{'column':_0x546957(0x119),'label':_0x546957(0x148),'type':'string'}]}],'behaviors':[{'name':_0x546957(0x101),'source':{'database':_0x49baf4,'table':'events_table'},'join':{'parent_key':'user_id','child_key':'customer_id'},'all_columns':!![]}]};return serializeDef(_0x2d8a45);}
|
|
1
|
+
(function(_0x163580,_0x571b59){const _0x3c84b8=a149_0x43d3,_0x46d005=_0x163580();while(!![]){try{const _0x3d90a5=parseInt(_0x3c84b8(0x1ca))/0x1+-parseInt(_0x3c84b8(0x1ac))/0x2+-parseInt(_0x3c84b8(0x1b5))/0x3*(parseInt(_0x3c84b8(0x198))/0x4)+parseInt(_0x3c84b8(0x184))/0x5+parseInt(_0x3c84b8(0x18a))/0x6*(parseInt(_0x3c84b8(0x17d))/0x7)+parseInt(_0x3c84b8(0x1c5))/0x8+parseInt(_0x3c84b8(0x179))/0x9*(-parseInt(_0x3c84b8(0x1b6))/0xa);if(_0x3d90a5===_0x571b59)break;else _0x46d005['push'](_0x46d005['shift']());}catch(_0x158f4e){_0x46d005['push'](_0x46d005['shift']());}}}(a149_0xdba4,0xac114));import*as a149_0x323b8c from'yaml';function formatScheduleTime(_0x10d7e5){const _0x1d68b8=a149_0x43d3;if(typeof _0x10d7e5===_0x1d68b8(0x189)){const _0x4dc591=Math[_0x1d68b8(0x171)](_0x10d7e5);return String(_0x4dc591)[_0x1d68b8(0x1cf)](0x2,'0')+_0x1d68b8(0x1c7);}if(typeof _0x10d7e5===_0x1d68b8(0x1c4)){if(/^\d{2}:\d{2}:\d{2}$/[_0x1d68b8(0x1c9)](_0x10d7e5))return _0x10d7e5;if(/^\d{1,2}:\d{2}$/[_0x1d68b8(0x1c9)](_0x10d7e5)){const [_0x48e9c3,_0x51e18c]=_0x10d7e5['split'](':');return _0x48e9c3[_0x1d68b8(0x1cf)](0x2,'0')+':'+_0x51e18c+':00';}const _0x27f594=parseInt(_0x10d7e5,0xa);if(!isNaN(_0x27f594)&&_0x10d7e5[_0x1d68b8(0x1b2)](/^\d+$/))return String(_0x27f594)[_0x1d68b8(0x1cf)](0x2,'0')+_0x1d68b8(0x1c7);return _0x10d7e5;}return String(_0x10d7e5);}export function apiToDef(_0x357439){const _0x3ecbf5=a149_0x43d3,_0x6f36b6={'database':_0x357439['master']?.[_0x3ecbf5(0x183)]||'','table':_0x357439[_0x3ecbf5(0x177)]?.[_0x3ecbf5(0x1a5)]||''};_0x357439[_0x3ecbf5(0x1ab)]&&_0x357439[_0x3ecbf5(0x1ab)][_0x3ecbf5(0x194)]>0x0&&(_0x6f36b6[_0x3ecbf5(0x16d)]=_0x357439[_0x3ecbf5(0x1ab)]['map'](_0x17842c=>({'column':_0x17842c[_0x3ecbf5(0x1c6)],'values':_0x17842c[_0x3ecbf5(0x17f)]})));let _0xc89465;_0x357439['scheduleType']&&_0x357439[_0x3ecbf5(0x192)]!=='none'&&(_0xc89465={'type':_0x357439[_0x3ecbf5(0x192)]},_0x357439['scheduleOption']&&(_0xc89465[_0x3ecbf5(0x18d)]=formatScheduleTime(_0x357439['scheduleOption'])),_0x357439[_0x3ecbf5(0x16f)]&&(_0xc89465['timezone']=_0x357439[_0x3ecbf5(0x16f)]));let _0x24891b;(_0x357439[_0x3ecbf5(0x1ce)]||_0x357439[_0x3ecbf5(0x1aa)]||_0x357439[_0x3ecbf5(0x19d)])&&(_0x24891b={},_0x357439[_0x3ecbf5(0x1ce)]&&(_0x24891b[_0x3ecbf5(0x18c)]=_0x357439[_0x3ecbf5(0x1ce)]),_0x357439['hivePoolName']&&(_0x24891b[_0x3ecbf5(0x1b0)]=_0x357439[_0x3ecbf5(0x1aa)]),_0x357439[_0x3ecbf5(0x19d)]&&(_0x24891b[_0x3ecbf5(0x176)]=_0x357439[_0x3ecbf5(0x19d)]));const _0x5f8acf=_0x357439[_0x3ecbf5(0x1d8)]&&_0x357439[_0x3ecbf5(0x1d8)][_0x3ecbf5(0x194)]>0x0?groupAttributesBySource(_0x357439[_0x3ecbf5(0x1d8)]):undefined,_0x1277f2=_0x357439[_0x3ecbf5(0x1a7)]&&_0x357439[_0x3ecbf5(0x1a7)][_0x3ecbf5(0x194)]>0x0?_0x357439[_0x3ecbf5(0x1a7)][_0x3ecbf5(0x191)](convertApiBehaviorToYaml):undefined;let _0x483a1d;_0x357439[_0x3ecbf5(0x19f)]&&(_0x483a1d={'name':_0x357439[_0x3ecbf5(0x19f)][_0x3ecbf5(0x1b4)],'source':{'database':_0x357439[_0x3ecbf5(0x19f)][_0x3ecbf5(0x183)],'table':_0x357439['customerGroup'][_0x3ecbf5(0x1a5)]},'join':{'parent_key':_0x357439['customerGroup']['foreignKey'],'child_key':_0x357439[_0x3ecbf5(0x19f)][_0x3ecbf5(0x199)]}},_0x357439[_0x3ecbf5(0x19f)][_0x3ecbf5(0x1d0)]&&_0x357439[_0x3ecbf5(0x19f)][_0x3ecbf5(0x1d0)][_0x3ecbf5(0x194)]>0x0&&(_0x483a1d[_0x3ecbf5(0x1d8)]=groupAttributesBySource(_0x357439[_0x3ecbf5(0x19f)][_0x3ecbf5(0x1d0)])),_0x357439['customerGroup']['customerGroupBehaviors']&&_0x357439[_0x3ecbf5(0x19f)]['customerGroupBehaviors'][_0x3ecbf5(0x194)]>0x0&&(_0x483a1d[_0x3ecbf5(0x1a7)]=_0x357439[_0x3ecbf5(0x19f)][_0x3ecbf5(0x182)][_0x3ecbf5(0x191)](convertApiBehaviorToYaml)));const _0x36084f={'name':_0x357439['name'],..._0x357439[_0x3ecbf5(0x1d4)]&&{'description':_0x357439['description']},'master':_0x6f36b6,..._0xc89465&&{'schedule':_0xc89465},..._0x24891b&&{'engine':_0x24891b},..._0x5f8acf&&{'attributes':_0x5f8acf},..._0x1277f2&&{'behaviors':_0x1277f2},..._0x483a1d&&{'customer_group':_0x483a1d}};return _0x36084f;}function groupAttributesBySource(_0x1691f8){const _0x8413dd=a149_0x43d3,_0x1c7462=new Map();for(const _0x383fb8 of _0x1691f8){const _0x3977bf=_0x383fb8[_0x8413dd(0x183)]+'.'+_0x383fb8[_0x8413dd(0x1a5)]+'.'+_0x383fb8[_0x8413dd(0x199)]+'.'+_0x383fb8[_0x8413dd(0x188)];!_0x1c7462[_0x8413dd(0x1cb)](_0x3977bf)&&_0x1c7462[_0x8413dd(0x1be)](_0x3977bf,[]),_0x1c7462[_0x8413dd(0x1d6)](_0x3977bf)[_0x8413dd(0x1bc)](_0x383fb8);}const _0x219963=[];for(const [,_0x83e6c7]of _0x1c7462){const _0x1742fa=_0x83e6c7[0x0],_0x4f9ef5=_0x1742fa['groupingName']||_0x1742fa[_0x8413dd(0x1a5)];_0x219963[_0x8413dd(0x1bc)]({'name':_0x4f9ef5,'source':{'database':_0x1742fa[_0x8413dd(0x183)],'table':_0x1742fa['parentTableName']},'join':{'parent_key':_0x1742fa['foreignKey'],'child_key':_0x1742fa[_0x8413dd(0x199)]},'columns':_0x83e6c7[_0x8413dd(0x191)](_0x2f5a9f=>{const _0x4c77c2=_0x8413dd,_0x5046b9={'column':_0x2f5a9f[_0x4c77c2(0x17a)],'type':_0x2f5a9f[_0x4c77c2(0x180)]};return _0x2f5a9f[_0x4c77c2(0x1b4)]!==_0x2f5a9f[_0x4c77c2(0x17a)]&&(_0x5046b9[_0x4c77c2(0x172)]=_0x2f5a9f[_0x4c77c2(0x1b4)]),_0x5046b9;})});}return _0x219963;}function convertApiBehaviorToYaml(_0x113401){const _0x37cfa9=a149_0x43d3,_0x30e8b2={'name':_0x113401['name'],'source':{'database':_0x113401[_0x37cfa9(0x183)],'table':_0x113401['parentTableName']},'join':{'parent_key':_0x113401[_0x37cfa9(0x188)],'child_key':_0x113401[_0x37cfa9(0x199)]}};if(_0x113401[_0x37cfa9(0x1cd)])_0x30e8b2[_0x37cfa9(0x1a1)]=!![];else _0x113401[_0x37cfa9(0x1b7)]&&_0x113401[_0x37cfa9(0x1b7)][_0x37cfa9(0x194)]>0x0&&(_0x30e8b2['columns']=_0x113401['schema'][_0x37cfa9(0x191)](_0x43a431=>{const _0x598d04=_0x37cfa9,_0x44bf56={'column':_0x43a431['parentColumn'],'type':_0x43a431[_0x598d04(0x180)]};return _0x43a431[_0x598d04(0x1b4)]!==_0x43a431[_0x598d04(0x17a)]&&(_0x44bf56[_0x598d04(0x172)]=_0x43a431[_0x598d04(0x1b4)]),_0x44bf56;}));return _0x113401[_0x37cfa9(0x190)]&&(_0x30e8b2[_0x37cfa9(0x17e)]=_0x113401[_0x37cfa9(0x190)]),_0x113401[_0x37cfa9(0x1a8)]&&(_0x30e8b2[_0x37cfa9(0x1d2)]=_0x113401[_0x37cfa9(0x1a8)]),_0x30e8b2;}export function defToApi(_0x4ff62c){const _0x265fc7=a149_0x43d3,_0x1dbbd4={'name':_0x4ff62c['name'],'master':{'parentDatabaseName':_0x4ff62c[_0x265fc7(0x177)][_0x265fc7(0x196)],'parentTableName':_0x4ff62c[_0x265fc7(0x177)][_0x265fc7(0x19a)]}};_0x4ff62c['description']&&(_0x1dbbd4[_0x265fc7(0x1d4)]=_0x4ff62c[_0x265fc7(0x1d4)]);_0x4ff62c[_0x265fc7(0x177)]['filters']&&_0x4ff62c[_0x265fc7(0x177)][_0x265fc7(0x16d)][_0x265fc7(0x194)]>0x0&&(_0x1dbbd4[_0x265fc7(0x1ab)]=_0x4ff62c[_0x265fc7(0x177)][_0x265fc7(0x16d)]['map'](_0x364cdb=>({'columnName':_0x364cdb['column'],'rightValues':_0x364cdb[_0x265fc7(0x1c2)]})));_0x4ff62c['schedule']&&(_0x1dbbd4['scheduleType']=_0x4ff62c['schedule']['type'],_0x4ff62c[_0x265fc7(0x18e)][_0x265fc7(0x18d)]&&(_0x1dbbd4[_0x265fc7(0x18f)]=_0x4ff62c['schedule'][_0x265fc7(0x18d)]),_0x4ff62c['schedule'][_0x265fc7(0x16f)]&&(_0x1dbbd4[_0x265fc7(0x16f)]=_0x4ff62c[_0x265fc7(0x18e)][_0x265fc7(0x16f)]));_0x4ff62c['engine']&&(_0x4ff62c['engine'][_0x265fc7(0x18c)]!==undefined&&(_0x1dbbd4[_0x265fc7(0x1ce)]=_0x4ff62c[_0x265fc7(0x186)]['hive_only']),_0x4ff62c[_0x265fc7(0x186)][_0x265fc7(0x1b0)]!==undefined&&(_0x1dbbd4[_0x265fc7(0x1aa)]=_0x4ff62c[_0x265fc7(0x186)]['hive_pool']),_0x4ff62c[_0x265fc7(0x186)]['trino_pool']!==undefined&&(_0x1dbbd4[_0x265fc7(0x19d)]=_0x4ff62c[_0x265fc7(0x186)][_0x265fc7(0x176)]));_0x4ff62c[_0x265fc7(0x1d8)]&&_0x4ff62c[_0x265fc7(0x1d8)][_0x265fc7(0x194)]>0x0&&(_0x1dbbd4[_0x265fc7(0x1d8)]=flattenAttributeGroups(_0x4ff62c[_0x265fc7(0x1d8)]));_0x4ff62c[_0x265fc7(0x1a7)]&&_0x4ff62c[_0x265fc7(0x1a7)][_0x265fc7(0x194)]>0x0&&(_0x1dbbd4[_0x265fc7(0x1a7)]=_0x4ff62c[_0x265fc7(0x1a7)]['map'](convertDefBehaviorToApi));if(_0x4ff62c[_0x265fc7(0x1a9)]){const _0x100ed0=_0x4ff62c['customer_group'];_0x1dbbd4['customerGroup']={'name':_0x100ed0[_0x265fc7(0x1b4)],'parentDatabaseName':_0x100ed0[_0x265fc7(0x1ba)]['database'],'parentTableName':_0x100ed0[_0x265fc7(0x1ba)][_0x265fc7(0x19a)],'parentKey':_0x100ed0[_0x265fc7(0x1d5)][_0x265fc7(0x1af)],'foreignKey':_0x100ed0[_0x265fc7(0x1d5)]['parent_key']},_0x100ed0[_0x265fc7(0x1d8)]&&_0x100ed0[_0x265fc7(0x1d8)][_0x265fc7(0x194)]>0x0&&(_0x1dbbd4[_0x265fc7(0x19f)][_0x265fc7(0x1d0)]=flattenAttributeGroups(_0x100ed0['attributes'])[_0x265fc7(0x191)](_0x5cfb22=>({'name':_0x5cfb22['name'],'type':_0x5cfb22[_0x265fc7(0x180)],'parentDatabaseName':_0x5cfb22[_0x265fc7(0x183)],'parentTableName':_0x5cfb22['parentTableName'],'parentColumn':_0x5cfb22[_0x265fc7(0x17a)],'parentKey':_0x5cfb22[_0x265fc7(0x199)],'foreignKey':_0x5cfb22[_0x265fc7(0x188)]}))),_0x100ed0[_0x265fc7(0x1a7)]&&_0x100ed0[_0x265fc7(0x1a7)]['length']>0x0&&(_0x1dbbd4['customerGroup']['customerGroupBehaviors']=_0x100ed0['behaviors'][_0x265fc7(0x191)](_0x2a4640=>({'name':_0x2a4640['name'],'parentDatabaseName':_0x2a4640[_0x265fc7(0x1ba)]['database'],'parentTableName':_0x2a4640[_0x265fc7(0x1ba)]['table'],'parentKey':_0x2a4640[_0x265fc7(0x1d5)][_0x265fc7(0x1af)],'foreignKey':_0x2a4640[_0x265fc7(0x1d5)]['parent_key'],'allColumns':_0x2a4640[_0x265fc7(0x1a1)],'schema':_0x2a4640[_0x265fc7(0x178)]?.['map'](_0x2dddbf=>({'name':_0x2dddbf[_0x265fc7(0x172)]||_0x2dddbf[_0x265fc7(0x1a4)],'type':_0x2dddbf[_0x265fc7(0x180)],'parentColumn':_0x2dddbf[_0x265fc7(0x1a4)]}))})));}return _0x1dbbd4;}function flattenAttributeGroups(_0x2cced9){const _0x4ebfd6=a149_0x43d3,_0x224773=[];for(const _0x30b555 of _0x2cced9){for(const _0x152a44 of _0x30b555[_0x4ebfd6(0x178)]){_0x224773[_0x4ebfd6(0x1bc)]({'name':_0x152a44[_0x4ebfd6(0x172)]||_0x152a44['column'],'type':_0x152a44[_0x4ebfd6(0x180)],'parentDatabaseName':_0x30b555[_0x4ebfd6(0x1ba)][_0x4ebfd6(0x196)],'parentTableName':_0x30b555[_0x4ebfd6(0x1ba)]['table'],'parentColumn':_0x152a44[_0x4ebfd6(0x1a4)],'parentKey':_0x30b555[_0x4ebfd6(0x1d5)][_0x4ebfd6(0x1af)],'foreignKey':_0x30b555['join'][_0x4ebfd6(0x19b)],'groupingName':_0x30b555[_0x4ebfd6(0x1b4)]});}}return _0x224773;}function a149_0x43d3(_0x3bf4fb,_0x5b5e1e){_0x3bf4fb=_0x3bf4fb-0x16c;const _0xdba43f=a149_0xdba4();let _0x43d390=_0xdba43f[_0x3bf4fb];return _0x43d390;}function convertDefBehaviorToApi(_0x5c4fd){const _0x2c6791=a149_0x43d3,_0x279ca2={'name':_0x5c4fd[_0x2c6791(0x1b4)],'parentDatabaseName':_0x5c4fd['source'][_0x2c6791(0x196)],'parentTableName':_0x5c4fd['source'][_0x2c6791(0x19a)],'parentKey':_0x5c4fd[_0x2c6791(0x1d5)][_0x2c6791(0x1af)],'foreignKey':_0x5c4fd[_0x2c6791(0x1d5)]['parent_key']};if(_0x5c4fd[_0x2c6791(0x1a1)])_0x279ca2[_0x2c6791(0x1cd)]=!![];else _0x5c4fd[_0x2c6791(0x178)]&&_0x5c4fd[_0x2c6791(0x178)]['length']>0x0&&(_0x279ca2[_0x2c6791(0x1b7)]=_0x5c4fd[_0x2c6791(0x178)]['map'](_0x10c971=>({'name':_0x10c971[_0x2c6791(0x172)]||_0x10c971['column'],'type':_0x10c971[_0x2c6791(0x180)],'parentColumn':_0x10c971[_0x2c6791(0x1a4)]})));return _0x5c4fd['default_time_filter']!==undefined&&(_0x279ca2[_0x2c6791(0x190)]=_0x5c4fd[_0x2c6791(0x17e)]),_0x5c4fd[_0x2c6791(0x1d2)]!==undefined&&(_0x279ca2[_0x2c6791(0x1a8)]=_0x5c4fd['realtime']),_0x279ca2;}export function serializeDef(_0x142a28){const _0xc74e6=a149_0x43d3,_0x29b7e3=JSON[_0xc74e6(0x1b8)](JSON[_0xc74e6(0x1d7)](_0x142a28)),_0x32d282=a149_0x323b8c['stringify'](_0x29b7e3,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x133deb=[_0xc74e6(0x1d9),_0xc74e6(0x17c),_0xc74e6(0x1a0),_0xc74e6(0x1c1),_0xc74e6(0x1c8),_0xc74e6(0x16e),_0xc74e6(0x187),'personalization_services:'];let _0x5b0b54=_0x32d282;for(const _0xc1bd2d of _0x133deb){_0x5b0b54=_0x5b0b54[_0xc74e6(0x1bb)](new RegExp('^('+_0xc1bd2d+')','m'),(_0x4a582e,_0x4c413e,_0x27c080)=>{if(_0x27c080===0x0||_0x5b0b54[_0x27c080-0x1]==='\x0a'&&_0x5b0b54[_0x27c080-0x2]==='\x0a')return _0x4c413e;return'\x0a'+_0x4c413e;});}return _0x5b0b54;}export function parseDef(_0x49bbd1){const _0x1772ee=a149_0x43d3,_0x3872af=a149_0x323b8c[_0x1772ee(0x1b8)](_0x49bbd1);if(!_0x3872af['name'])throw new Error(_0x1772ee(0x1b3));if(!_0x3872af[_0x1772ee(0x177)])throw new Error(_0x1772ee(0x18b));if(!_0x3872af['master'][_0x1772ee(0x196)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x3872af[_0x1772ee(0x177)][_0x1772ee(0x19a)])throw new Error(_0x1772ee(0x1bd));return _0x3872af[_0x1772ee(0x1d2)]&&validateRealtimeSection(_0x3872af[_0x1772ee(0x1d2)]),_0x3872af['personalization_services']&&validatePersonalizationServices(_0x3872af[_0x1772ee(0x1d1)]),_0x3872af;}function validateRealtimeSection(_0x2d6497){const _0x32b523=a149_0x43d3,_0x1984b0=[_0x32b523(0x195),'counter','set',_0x32b523(0x181),'list',_0x32b523(0x19e)];_0x2d6497[_0x32b523(0x1ae)]&&Array[_0x32b523(0x1ad)](_0x2d6497[_0x32b523(0x1ae)])&&_0x2d6497[_0x32b523(0x1ae)][_0x32b523(0x1c0)]((_0x35cac0,_0x588790)=>{const _0x8b2185=_0x32b523;if(!_0x35cac0[_0x8b2185(0x1b4)])throw new Error(_0x8b2185(0x170)+_0x588790+_0x8b2185(0x17b));});_0x2d6497['attributes']&&Array[_0x32b523(0x1ad)](_0x2d6497[_0x32b523(0x1d8)])&&_0x2d6497['attributes'][_0x32b523(0x1c0)]((_0x379e1a,_0x4908d0)=>{const _0x2eece5=_0x32b523;if(!_0x379e1a[_0x2eece5(0x1b4)])throw new Error(_0x2eece5(0x185)+_0x4908d0+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x379e1a['type']&&!_0x1984b0['includes'](_0x379e1a[_0x2eece5(0x180)]))throw new Error('realtime.attributes['+_0x4908d0+_0x2eece5(0x1c3)+_0x379e1a[_0x2eece5(0x1b4)]+_0x2eece5(0x16c)+_0x379e1a['type']+_0x2eece5(0x193)+_0x1984b0['join'](',\x20'));});if(_0x2d6497['id_stitching']){if(!_0x2d6497[_0x32b523(0x1b1)][_0x32b523(0x197)])throw new Error(_0x32b523(0x19c));}}function validatePersonalizationServices(_0x262023){const _0x50e390=a149_0x43d3;if(!Array[_0x50e390(0x1ad)](_0x262023))throw new Error(_0x50e390(0x1b9));_0x262023[_0x50e390(0x1c0)]((_0x35b30c,_0x3b68c4)=>{const _0x37a667=_0x50e390;if(!_0x35b30c['name'])throw new Error(_0x37a667(0x174)+_0x3b68c4+_0x37a667(0x17b));});}function a149_0xdba4(){const _0x5edd67=['match','YAML\x20config\x20missing\x20required\x20field:\x20name','name','3KvNgmz','2130pyCSqz','schema','parse','personalization_services\x20must\x20be\x20an\x20array','source','replace','push','YAML\x20config\x20missing\x20required\x20field:\x20master.table','set','daily','forEach','attributes:','values',']\x20(','string','4105432tqvwwp','columnName',':00:00','behaviors:','test','501824wSeVoj','has','Parent\x20segment\x20description','allColumns','workflowHiveOnly','padStart','customerGroupAttributes','personalization_services','realtime','03:00','description','join','get','stringify','attributes','master:','column_name','):\x20Invalid\x20type\x20\x27','filters','customer_group:','timezone','realtime.events[','floor','label','customer_id','personalization_services[','Display\x20Name','trino_pool','master','columns','19827VqrvoP','parentColumn',']:\x20Missing\x20required\x20field\x20\x27name\x27','schedule:','1533EQTTZu','default_time_filter','rightValues','type','ordered_set','customerGroupBehaviors','parentDatabaseName','5166315xvRauP','realtime.attributes[','engine','realtime:','foreignKey','number','22296AhnXek','YAML\x20config\x20missing\x20required\x20field:\x20master','hive_only','time','schedule','scheduleOption','defaultTimeFilterEnabled','map','scheduleType','\x27.\x20Must\x20be\x20one\x20of:\x20','length','single','database','primary_key','4017416khdPjV','parentKey','table','parent_key','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','prestoPoolName','imported_batch','customerGroup','engine:','all_columns','attribute_table','user_id','column','parentTableName','UTC','behaviors','isRealtime','customer_group','hivePoolName','audienceFilters','1367378UmWtri','isArray','events','child_key','hive_pool','id_stitching'];a149_0xdba4=function(){return _0x5edd67;};return a149_0xdba4();}export function generateTemplate(_0x11b4cf,_0x107e16,_0x392983){const _0x1a881b=a149_0x43d3,_0x10921c={'name':_0x11b4cf,'description':_0x1a881b(0x1cc),'master':{'database':_0x107e16,'table':_0x392983},'schedule':{'type':_0x1a881b(0x1bf),'time':_0x1a881b(0x1d3),'timezone':_0x1a881b(0x1a6)},'attributes':[{'name':'Example\x20Attributes','source':{'database':_0x107e16,'table':_0x1a881b(0x1a2)},'join':{'parent_key':'id','child_key':'customer_id'},'columns':[{'column':_0x1a881b(0x1da),'label':_0x1a881b(0x175),'type':_0x1a881b(0x1c4)}]}],'behaviors':[{'name':'Example\x20Events','source':{'database':_0x107e16,'table':'events_table'},'join':{'parent_key':_0x1a881b(0x1a3),'child_key':_0x1a881b(0x173)},'all_columns':!![]}]};return serializeDef(_0x10921c);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0xe8dc7d,_0xe92b8f){const _0x2c8f07=a150_0x4c53,_0x27d80e=_0xe8dc7d();while(!![]){try{const _0x5d04dd=parseInt(_0x2c8f07(0xc9))/0x1*(parseInt(_0x2c8f07(0xce))/0x2)+-parseInt(_0x2c8f07(0x9f))/0x3*(-parseInt(_0x2c8f07(0xc1))/0x4)+-parseInt(_0x2c8f07(0xe8))/0x5*(-parseInt(_0x2c8f07(0xeb))/0x6)+parseInt(_0x2c8f07(0xc4))/0x7+-parseInt(_0x2c8f07(0xdc))/0x8+-parseInt(_0x2c8f07(0xe5))/0x9*(-parseInt(_0x2c8f07(0xbe))/0xa)+parseInt(_0x2c8f07(0xcb))/0xb*(-parseInt(_0x2c8f07(0xe0))/0xc);if(_0x5d04dd===_0xe92b8f)break;else _0x27d80e['push'](_0x27d80e['shift']());}catch(_0x3deb45){_0x27d80e['push'](_0x27d80e['shift']());}}}(a150_0x329d,0x815bd));import a150_0x4a1493 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 a150_0x4c53(_0x4caff7,_0xd77f0e){_0x4caff7=_0x4caff7-0x9e;const _0x329d13=a150_0x329d();let _0x4c5368=_0x329d13[_0x4caff7];return _0x4c5368;}import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a150_0x41fdfd,normalizeJourneyDef,parseYamlString as a150_0x31f8e8}from'./journey-yaml.js';import{SEGMENT_KIND_JOURNEY,generateJourneyLocalName,sanitizeYamlKey,buildMergedJourneyDef,buildLocalRuleToNameMappingFromJourney,createJumpTargetCache,resolveJumpTarget}from'./journey-utils.js';function a150_0x329d(){const _0x2c5d1f=['user','parentFolder','state','reduce','join','targetResourceName','4910MGyTOH','connection','attributes','3423084JVvvdd','segment','kind','254506uKdRTS','getLatestJourneyId','relationships','map','listActivations','115429pQDEPX','utf-8','11KPfMlE','rule','activation_','14GYLDyH','has','clear','Processing\x20journey:\x20','Processing\x20journeys','Warning:\x20Journey\x20','slice','getParent','segments/','buildIdToEmailMap','buildIdToNameMap','values','get','push','3091552UmSgPG','activationParams','filter','length','21379356tOsaxP','Fetching\x20segments,\x20folders,\x20and\x20journeys','add','data','from','2214qvTrre','description','getSegment','1420JoaLlA','tdx.json','versionNumber','18528oioyqC','listFolders','3rUxJBy','set','.yml','relative','Resolving\x20parent\x20segment','all','name','folderId','update','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','journey','size','journeyBundleName','audienceId','createdAt','journeyBundleId','segmentFolderId','toLowerCase','getJourney','getActivation','hasChanges','Fetching\x20activations','Fetching\x20parent\x20segment\x20info','isNew','listSegments'];a150_0x329d=function(){return _0x2c5d1f;};return a150_0x329d();}import{createTdxConfigContent}from'./tdx-config.js';function prepareFile(_0x28d2e0,_0xfe4ca5,_0x3169f9){const _0x2fbe01=a150_0x4c53,_0x59349e=a150_0x4a1493[_0x2fbe01(0xa2)](_0x3169f9,_0x28d2e0);if(existsSync(_0x28d2e0)){const _0x17a700=readFileSync(_0x28d2e0,_0x2fbe01(0xca)),_0x4f0b8f=generateDiff(_0x17a700,_0xfe4ca5),_0x8d80d4=hasChanges(_0x4f0b8f);return{'relativePath':_0x59349e,'absolutePath':_0x28d2e0,'content':_0xfe4ca5,'isNew':![],'hasChanges':_0x8d80d4,'diff':_0x8d80d4?formatDiffWithColors(_0x4f0b8f):undefined};}return{'relativePath':_0x59349e,'absolutePath':_0x28d2e0,'content':_0xfe4ca5,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0xb7087a,_0x48e2a6,_0x263a4c){const _0x58e8c6=_0xb7087a+':'+_0x48e2a6,_0x5c7dcf=_0x263a4c['get'](_0x58e8c6)||0x0;_0x263a4c['set'](_0x58e8c6,_0x5c7dcf+0x1);if(_0x5c7dcf===0x0)return _0x48e2a6;return _0x48e2a6+'_'+(_0x5c7dcf+0x1);}export async function pullSegments(_0x36d70a,_0x41c4d2,_0x159e10={}){const _0x18017b=a150_0x4c53,{targetDir:_0x125004,progress:_0x8b8efc}=_0x159e10;_0x8b8efc?.[_0x18017b(0xa7)](_0x18017b(0xa3));const _0x49a2e8=await _0x36d70a[_0x18017b(0xc2)]['resolveParentId'](_0x41c4d2);_0x8b8efc?.[_0x18017b(0xa7)](_0x18017b(0xb5));const _0x35dda9=await _0x36d70a[_0x18017b(0xc2)][_0x18017b(0xd5)](_0x49a2e8),_0x2608a4=_0x35dda9[_0x18017b(0xc0)][_0x18017b(0xa5)];_0x8b8efc?.[_0x18017b(0xa7)](_0x18017b(0xe1));const [_0x25c79e,_0x5b291c,_0x498eee]=await Promise[_0x18017b(0xa4)]([_0x36d70a[_0x18017b(0xc2)][_0x18017b(0xb7)](_0x49a2e8),_0x36d70a[_0x18017b(0xc2)][_0x18017b(0x9e)](_0x49a2e8),_0x36d70a[_0x18017b(0xa9)]['listJourneysWithDetailsFromParentSegment'](_0x49a2e8,{'includeAllVersions':!![]})]),{journeys:_0x16ef17,activationStepsById:_0x225c1e}=_0x498eee,_0x21d5bd=new Map();for(const _0x2a24cf of _0x16ef17){_0x21d5bd[_0x18017b(0xa0)](_0x2a24cf['id'],_0x2a24cf);}const _0x14992b=_0x16ef17[_0x18017b(0xc7)](_0xc78e33=>({'id':_0xc78e33['id'],'name':_0xc78e33[_0x18017b(0xc0)][_0x18017b(0xa5)],'journeyBundleName':_0xc78e33[_0x18017b(0xc0)]['journeyBundleName']||'','journeyBundleId':_0xc78e33['attributes']['journeyBundleId']||'','versionNumber':_0xc78e33[_0x18017b(0xc0)]['versionNumber'],'description':_0xc78e33[_0x18017b(0xc0)]['description'],'state':_0xc78e33[_0x18017b(0xc0)][_0x18017b(0xba)],'paused':_0xc78e33[_0x18017b(0xc0)]['paused'],'audienceId':_0xc78e33[_0x18017b(0xc0)][_0x18017b(0xac)],'folderId':_0xc78e33[_0x18017b(0xc6)]?.[_0x18017b(0xb9)]?.[_0x18017b(0xe3)]?.['id'],'createdAt':_0xc78e33[_0x18017b(0xc0)][_0x18017b(0xad)],'updatedAt':_0xc78e33['attributes']['updatedAt']})),_0x52bc62=buildFolderIdToPathMap(_0x5b291c),_0x582a93=_0x125004||_0x18017b(0xd6)+sanitizeFileName(_0x2608a4);_0x8b8efc?.[_0x18017b(0xa7)](_0x18017b(0xb4));const _0x3345be=new Map();await batchAsync(_0x25c79e,async _0x558f52=>{const _0x3fc1e5=_0x18017b,_0x47eef8=await _0x36d70a[_0x3fc1e5(0xc2)][_0x3fc1e5(0xc8)](_0x49a2e8,_0x558f52['id']);_0x3345be[_0x3fc1e5(0xa0)](_0x558f52['id'],_0x47eef8);}),_0x8b8efc?.[_0x18017b(0xa7)]('Fetching\x20users\x20and\x20connections');const [_0x1130d3,_0x4c1ede]=await Promise['all']([_0x36d70a[_0x18017b(0xb8)][_0x18017b(0xd7)](),_0x36d70a[_0x18017b(0xbf)][_0x18017b(0xd8)]()]),_0x371fc1=[],_0x28f764=new Map(),_0x229f6e=a150_0x4a1493['join'](_0x582a93,_0x18017b(0xe9)),_0x4fbc14=createTdxConfigContent(_0x2608a4);_0x371fc1[_0x18017b(0xdb)](prepareFile(_0x229f6e,_0x4fbc14,_0x582a93));const _0x245ab7=new Map();for(const _0x11a488 of _0x25c79e){_0x245ab7[_0x18017b(0xa0)](_0x11a488['id'],_0x11a488);}let _0x171606=_0x25c79e;if(_0x159e10['targetResourceName']){const _0x434eef=_0x25c79e[_0x18017b(0xde)](_0x394800=>_0x394800[_0x18017b(0xa5)][_0x18017b(0xb0)]()===_0x159e10[_0x18017b(0xbd)][_0x18017b(0xb0)]());_0x434eef[_0x18017b(0xdf)]>0x0&&(_0x171606=_0x434eef);}_0x8b8efc?.[_0x18017b(0xa7)]('Processing\x20segments');for(const _0x526b66 of _0x171606){if(_0x526b66['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x5a6f77=_0x526b66[_0x18017b(0xaf)]?_0x52bc62[_0x18017b(0xda)](_0x526b66[_0x18017b(0xaf)])||'':'',_0x3ddb79=_0x3345be[_0x18017b(0xda)](_0x526b66['id'])||[],_0x170d85=segmentWithActivationsToYaml(_0x526b66,_0x3ddb79,undefined,_0x1130d3,_0x4c1ede),_0x4eadff=_0x5a6f77?a150_0x4a1493['join'](_0x582a93,_0x5a6f77):_0x582a93,_0x1f0086=sanitizeFileName(_0x526b66[_0x18017b(0xa5)]),_0x5de712=getUniqueFileName(_0x4eadff,_0x1f0086,_0x28f764),_0x6ac0e0=a150_0x4a1493[_0x18017b(0xbc)](_0x4eadff,_0x5de712+_0x18017b(0xa1)),_0x154882=segmentToYamlString(_0x170d85);_0x371fc1[_0x18017b(0xdb)](prepareFile(_0x6ac0e0,_0x154882,_0x582a93));}const _0x2f0e26=new Map();for(const _0x2f94e1 of _0x14992b){const _0x4f15fe=_0x2f94e1[_0x18017b(0xae)];!_0x2f0e26[_0x18017b(0xcf)](_0x4f15fe)&&_0x2f0e26['set'](_0x4f15fe,[]),_0x2f0e26['get'](_0x4f15fe)['push'](_0x2f94e1);}for(const _0x50d5e9 of _0x2f0e26[_0x18017b(0xd9)]()){_0x50d5e9['sort']((_0x3fe92e,_0x5b9daa)=>(_0x3fe92e[_0x18017b(0xea)]||0x0)-(_0x5b9daa[_0x18017b(0xea)]||0x0));}if(_0x159e10['targetResourceName']){const _0x209f15=new Map();for(const [_0x24cfe9,_0x3b3ccd]of _0x2f0e26){const _0x2bcc4e=_0x3b3ccd[0x0][_0x18017b(0xab)];if(_0x2bcc4e['toLowerCase']()===_0x159e10[_0x18017b(0xbd)][_0x18017b(0xb0)]()){_0x209f15[_0x18017b(0xa0)](_0x24cfe9,_0x3b3ccd);break;}}_0x2f0e26[_0x18017b(0xd0)]();for(const [_0x4aa66f,_0x621924]of _0x209f15){_0x2f0e26[_0x18017b(0xa0)](_0x4aa66f,_0x621924);}}if(_0x2f0e26['size']>0x0){_0x8b8efc?.[_0x18017b(0xa7)](_0x18017b(0xd2));const _0x5a7166=Array['from'](_0x2f0e26[_0x18017b(0xd9)]()),_0x32dbc1=0x5,{createYamlContext:_0x204d73}=createYamlContextForBundle(_0x36d70a,_0x245ab7,_0x1130d3,_0x4c1ede,_0x225c1e,_0x21d5bd);for(let _0x2672c2=0x0;_0x2672c2<_0x5a7166[_0x18017b(0xdf)];_0x2672c2+=_0x32dbc1){const _0x174257=_0x5a7166[_0x18017b(0xd4)](_0x2672c2,_0x2672c2+_0x32dbc1),_0x2d4d37=await Promise[_0x18017b(0xa4)](_0x174257[_0x18017b(0xc7)](async _0x271280=>{const _0x78edc9=_0x18017b,_0x59602a=_0x271280[0x0],_0x1ec257=_0x59602a[_0x78edc9(0xab)];_0x8b8efc?.['update'](_0x78edc9(0xd1)+_0x1ec257);const _0x396c25=_0x59602a['folderId']?_0x52bc62[_0x78edc9(0xda)](_0x59602a[_0x78edc9(0xa6)])||'':'',_0x469f27=_0x396c25?a150_0x4a1493[_0x78edc9(0xbc)](_0x582a93,_0x396c25):_0x582a93,_0x1aee77=sanitizeFileName(_0x1ec257),_0x5e4f74=a150_0x4a1493[_0x78edc9(0xbc)](_0x469f27,_0x1aee77+_0x78edc9(0xa1));let _0x2a47e1;if(existsSync(_0x5e4f74))try{const _0xfc9a0f=readFileSync(_0x5e4f74,'utf-8'),_0x1ae3e0=a150_0x31f8e8(_0xfc9a0f);_0x2a47e1=buildLocalRuleToNameMappingFromJourney(_0x1ae3e0);}catch{}const _0x4e6820=[];for(const _0x2b8579 of _0x271280){const _0x316f6e=_0x21d5bd[_0x78edc9(0xda)](_0x2b8579['id']);if(!_0x316f6e){_0x8b8efc?.[_0x78edc9(0xa7)](_0x78edc9(0xd3)+_0x2b8579['id']+_0x78edc9(0xa8));continue;}const _0x2efbc0=_0x316f6e[_0x78edc9(0xc0)]?.['audienceId'],_0x128c60=_0x204d73(_0x2b8579['id'],_0x2efbc0),_0x113611=await journeyResponseToDef(_0x316f6e,_0x128c60);_0x4e6820[_0x78edc9(0xdb)]({'item':_0x2b8579,'yaml':_0x113611});}const _0x3fe751=await _0x36d70a[_0x78edc9(0xa9)][_0x78edc9(0xc5)](_0x59602a[_0x78edc9(0xae)]),_0x22067f=buildMergedJourneyDef(_0x4e6820,_0x2a47e1,_0x3fe751);return{'bundleName':_0x1ec257,'folderPath':_0x396c25,'finalYaml':_0x22067f};}));for(const {bundleName:_0x2e6ce8,folderPath:_0x4360af,finalYaml:_0x2efdaf}of _0x2d4d37){const _0x561244=normalizeJourneyDef(_0x2efdaf),_0x446f86=a150_0x41fdfd(_0x561244),_0x2c3606=_0x4360af?a150_0x4a1493[_0x18017b(0xbc)](_0x582a93,_0x4360af):_0x582a93,_0x4211a9=sanitizeFileName(_0x2e6ce8),_0xdd849=getUniqueFileName(_0x2c3606,_0x4211a9,_0x28f764),_0x3fabf6=a150_0x4a1493[_0x18017b(0xbc)](_0x2c3606,_0xdd849+_0x18017b(0xa1));_0x371fc1[_0x18017b(0xdb)](prepareFile(_0x3fabf6,_0x446f86,_0x582a93));}}}const _0x4f6486=Array['from'](_0x3345be[_0x18017b(0xd9)]())['reduce']((_0x42adaf,_0x33eac5)=>_0x42adaf+_0x33eac5[_0x18017b(0xdf)],0x0),_0x519567=_0x171606[_0x18017b(0xde)](_0x7a79af=>_0x7a79af[_0x18017b(0xc3)]!==SEGMENT_KIND_JOURNEY),_0x43fe6d=_0x371fc1[_0x18017b(0xde)](_0x2a7b41=>_0x2a7b41['isNew'])[_0x18017b(0xdf)],_0x37fffb=_0x371fc1[_0x18017b(0xde)](_0x5568c7=>!_0x5568c7[_0x18017b(0xb6)]&&_0x5568c7[_0x18017b(0xb3)])['length'],_0x6960e7=_0x371fc1[_0x18017b(0xde)](_0x5c3392=>!_0x5c3392[_0x18017b(0xb6)]&&!_0x5c3392[_0x18017b(0xb3)])[_0x18017b(0xdf)],_0x1f2693=Array[_0x18017b(0xe4)](_0x2f0e26[_0x18017b(0xd9)]())[_0x18017b(0xbb)]((_0xd1e340,_0x4e9b20)=>_0xd1e340+_0x4e9b20[_0x18017b(0xdf)],0x0);return{'parentName':_0x2608a4,'parentId':_0x49a2e8,'targetDir':_0x582a93,'files':_0x371fc1,'counts':{'segments':_0x519567[_0x18017b(0xdf)],'journeys':_0x2f0e26[_0x18017b(0xaa)],'journeyVersions':_0x1f2693,'activations':_0x4f6486},'newFiles':_0x43fe6d,'changedFiles':_0x37fffb,'unchangedFiles':_0x6960e7};}function createYamlContextForBundle(_0x3fe9f3,_0x4c68eb,_0x2fe6d5,_0x344373,_0xb8913d,_0x3e9c9c){const _0x56d73b=new Set(),_0x367309=new Map(),_0x5596b8=new Map(),_0x162b29=createJumpTargetCache(),_0x345afa=async(_0x2aab56,_0x2714f5)=>{const _0x20a951=a150_0x4c53,_0x3b9892=_0x367309[_0x20a951(0xda)](_0x2aab56);if(_0x3b9892!==undefined)return _0x3b9892;if(!_0x2714f5)return _0x2aab56;try{let _0x4dfd65=_0x4c68eb[_0x20a951(0xda)](_0x2aab56);!_0x4dfd65&&(_0x4dfd65=await _0x3fe9f3[_0x20a951(0xc2)][_0x20a951(0xe7)](_0x2714f5,_0x2aab56),_0x4c68eb['set'](_0x2aab56,_0x4dfd65));const _0x5e4195=generateJourneyLocalName(_0x4dfd65['name']),_0x3fe0ea=_0x4dfd65['kind']===SEGMENT_KIND_JOURNEY&&_0x5e4195!==undefined;if(_0x3fe0ea&&_0x5e4195){let _0x47e34e=_0x5e4195,_0x119e4a=0x2;while(_0x56d73b[_0x20a951(0xcf)](_0x47e34e)){_0x47e34e=_0x5e4195+'_'+_0x119e4a,_0x119e4a++;}return _0x56d73b[_0x20a951(0xe2)](_0x47e34e),_0x367309['set'](_0x2aab56,_0x47e34e),_0x47e34e;}return _0x4dfd65[_0x20a951(0xa5)];}catch{return _0x2aab56;}},_0x515726=(_0x267c07,_0x3aa603)=>({'resolveSegment':async _0x540c10=>{const _0x5aeeb0=a150_0x4c53,_0x476640=_0x367309[_0x5aeeb0(0xda)](_0x540c10);if(_0x476640!==undefined)return{'name':_0x476640,'isJourneyLocal':!![]};if(!_0x3aa603)return{'name':_0x540c10,'isJourneyLocal':![]};try{let _0x56e4b3=_0x4c68eb['get'](_0x540c10);!_0x56e4b3&&(_0x56e4b3=await _0x3fe9f3[_0x5aeeb0(0xc2)][_0x5aeeb0(0xe7)](_0x3aa603,_0x540c10),_0x4c68eb[_0x5aeeb0(0xa0)](_0x540c10,_0x56e4b3));const _0x129f79=generateJourneyLocalName(_0x56e4b3[_0x5aeeb0(0xa5)]),_0x371069=_0x56e4b3[_0x5aeeb0(0xc3)]===SEGMENT_KIND_JOURNEY&&_0x129f79!==undefined;if(_0x371069&&!_0x56e4b3[_0x5aeeb0(0xcc)]&&_0x3aa603)try{const _0x255f58=await _0x3fe9f3[_0x5aeeb0(0xc2)][_0x5aeeb0(0xe7)](_0x3aa603,_0x540c10);_0x4c68eb[_0x5aeeb0(0xa0)](_0x540c10,_0x255f58),_0x56e4b3=_0x255f58;}catch{}const _0x558363=await _0x345afa(_0x540c10,_0x3aa603);let _0x3b9264;if(_0x371069&&_0x56e4b3['rule']){const _0x3d37ea=await segmentResponseToDef(_0x56e4b3,{'resolveSegmentName':_0x2cb4c5=>_0x345afa(_0x2cb4c5,_0x3aa603)});_0x3b9264={'description':_0x56e4b3[_0x5aeeb0(0xe6)],'rule':_0x3d37ea['rule']};}return{'name':_0x558363,'isJourneyLocal':_0x371069,'definition':_0x3b9264};}catch{return{'name':_0x540c10,'isJourneyLocal':![]};}},'resolveActivation':async _0x37a24f=>{const _0x1f97f0=a150_0x4c53,_0x460e86=_0x5596b8[_0x1f97f0(0xda)](_0x37a24f);if(_0x460e86!==undefined)return{'name':_0x460e86,'isJourneyLocal':!![]};try{let _0x210069=_0xb8913d[_0x1f97f0(0xda)](_0x37a24f);!_0x210069&&(_0x210069=await _0x3fe9f3[_0x1f97f0(0xa9)][_0x1f97f0(0xb2)](_0x267c07,_0x37a24f));const _0x519695=_0x210069[_0x1f97f0(0xc0)][_0x1f97f0(0xdd)][_0x1f97f0(0xa5)]||_0x37a24f,_0x164677=sanitizeYamlKey(_0x519695)||_0x1f97f0(0xcd)+_0x37a24f,_0x99be1c=_0x164677;_0x5596b8['set'](_0x37a24f,_0x99be1c);const _0xbffcfb=journeyActivationStepToYaml(_0x210069,_0x2fe6d5,_0x344373);return{'name':_0x99be1c,'isJourneyLocal':!![],'definition':_0xbffcfb};}catch{return{'name':_0x37a24f,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x5cfa08,_0x12fc64)=>resolveJumpTarget(_0x5cfa08,_0x12fc64,_0x162b29,async _0x52dc19=>{const _0x1a39b=a150_0x4c53,_0x330320=_0x3e9c9c[_0x1a39b(0xda)](_0x52dc19);if(_0x330320)return _0x330320;return _0x3fe9f3[_0x1a39b(0xa9)][_0x1a39b(0xb1)](_0x52dc19);})});return{'createYamlContext':_0x515726};}
|
|
1
|
+
(function(_0x559994,_0x30ae77){const _0x3247f0=a150_0x2475,_0x270ed3=_0x559994();while(!![]){try{const _0x40f283=-parseInt(_0x3247f0(0x14b))/0x1*(parseInt(_0x3247f0(0x11b))/0x2)+-parseInt(_0x3247f0(0x14e))/0x3*(parseInt(_0x3247f0(0x122))/0x4)+-parseInt(_0x3247f0(0x120))/0x5*(-parseInt(_0x3247f0(0x151))/0x6)+-parseInt(_0x3247f0(0x138))/0x7*(parseInt(_0x3247f0(0x135))/0x8)+parseInt(_0x3247f0(0x117))/0x9+parseInt(_0x3247f0(0x11d))/0xa+-parseInt(_0x3247f0(0x116))/0xb;if(_0x40f283===_0x30ae77)break;else _0x270ed3['push'](_0x270ed3['shift']());}catch(_0x52a52f){_0x270ed3['push'](_0x270ed3['shift']());}}}(a150_0x5e55,0x51488));import a150_0x32b596 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';function a150_0x2475(_0x4fad79,_0x2dbcd7){_0x4fad79=_0x4fad79-0x116;const _0x5e55f9=a150_0x5e55();let _0x24755a=_0x5e55f9[_0x4fad79];return _0x24755a;}function a150_0x5e55(){const _0x54e976=['createdAt','rule','journeyBundleName','getParent','getSegment','name','Resolving\x20parent\x20segment','all','has','update','audienceId','from','buildIdToNameMap','6NQQlUz','isNew','connection','3939CfDjkl','reduce','kind','609498WIkWub','values','slice','listActivations','listJourneysWithDetailsFromParentSegment','size','join','Fetching\x20segments,\x20folders,\x20and\x20journeys','Warning:\x20Journey\x20','activationParams','targetResourceName','description','utf-8','segments/','set','4923831vJwmAW','4733748VXjnTQ','paused','activation_','segment','9794AEwNcn','Fetching\x20parent\x20segment\x20info','752130RSEgla','.yml','Fetching\x20users\x20and\x20connections','30QeeWco','get','952GipcqQ','journey','Fetching\x20activations','length','getActivation','toLowerCase','buildIdToEmailMap','state','resolveParentId','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','relationships','segmentFolderId','push','attributes','relative','folderId','filter','versionNumber','map','706000mmGalF','Processing\x20journeys','listSegments','7uoADyw','Processing\x20segments','hasChanges','tdx.json','Processing\x20journey:\x20','journeyBundleId'];a150_0x5e55=function(){return _0x54e976;};return a150_0x5e55();}import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a150_0x5a1929,normalizeJourneyDef,parseYamlString as a150_0x65010e}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(_0x36b51b,_0x55e90d,_0x36d478){const _0x3cd4a6=a150_0x2475,_0x407053=a150_0x32b596[_0x3cd4a6(0x130)](_0x36d478,_0x36b51b);if(existsSync(_0x36b51b)){const _0x3ddbb1=readFileSync(_0x36b51b,_0x3cd4a6(0x15d)),_0x31633a=generateDiff(_0x3ddbb1,_0x55e90d),_0x53098e=hasChanges(_0x31633a);return{'relativePath':_0x407053,'absolutePath':_0x36b51b,'content':_0x55e90d,'isNew':![],'hasChanges':_0x53098e,'diff':_0x53098e?formatDiffWithColors(_0x31633a):undefined};}return{'relativePath':_0x407053,'absolutePath':_0x36b51b,'content':_0x55e90d,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x5d80fd,_0x349652,_0x59242d){const _0x513652=a150_0x2475,_0x452de5=_0x5d80fd+':'+_0x349652,_0x367a3b=_0x59242d['get'](_0x452de5)||0x0;_0x59242d[_0x513652(0x15f)](_0x452de5,_0x367a3b+0x1);if(_0x367a3b===0x0)return _0x349652;return _0x349652+'_'+(_0x367a3b+0x1);}export async function pullSegments(_0x639b9d,_0x402b2b,_0x5c4630={}){const _0x4fd825=a150_0x2475,{targetDir:_0x4fb6f6,progress:_0x26f3b6}=_0x5c4630;_0x26f3b6?.['update'](_0x4fd825(0x144));const _0x360c29=await _0x639b9d[_0x4fd825(0x11a)][_0x4fd825(0x12a)](_0x402b2b);_0x26f3b6?.['update'](_0x4fd825(0x11c));const _0x1fa388=await _0x639b9d[_0x4fd825(0x11a)][_0x4fd825(0x141)](_0x360c29),_0x2f2a3f=_0x1fa388['attributes'][_0x4fd825(0x143)];_0x26f3b6?.[_0x4fd825(0x147)](_0x4fd825(0x158));const [_0x293cf6,_0x3897f6,_0x17d5f1]=await Promise[_0x4fd825(0x145)]([_0x639b9d[_0x4fd825(0x11a)][_0x4fd825(0x137)](_0x360c29),_0x639b9d[_0x4fd825(0x11a)]['listFolders'](_0x360c29),_0x639b9d[_0x4fd825(0x123)][_0x4fd825(0x155)](_0x360c29,{'includeAllVersions':!![]})]),{journeys:_0x94fb21,activationStepsById:_0x214f29}=_0x17d5f1,_0x1366fd=new Map();for(const _0xaf12ff of _0x94fb21){_0x1366fd[_0x4fd825(0x15f)](_0xaf12ff['id'],_0xaf12ff);}const _0x175c4f=_0x94fb21[_0x4fd825(0x134)](_0x13e1f2=>({'id':_0x13e1f2['id'],'name':_0x13e1f2[_0x4fd825(0x12f)][_0x4fd825(0x143)],'journeyBundleName':_0x13e1f2['attributes'][_0x4fd825(0x140)]||'','journeyBundleId':_0x13e1f2['attributes'][_0x4fd825(0x13d)]||'','versionNumber':_0x13e1f2['attributes']['versionNumber'],'description':_0x13e1f2[_0x4fd825(0x12f)][_0x4fd825(0x15c)],'state':_0x13e1f2[_0x4fd825(0x12f)][_0x4fd825(0x129)],'paused':_0x13e1f2[_0x4fd825(0x12f)][_0x4fd825(0x118)],'audienceId':_0x13e1f2[_0x4fd825(0x12f)][_0x4fd825(0x148)],'folderId':_0x13e1f2[_0x4fd825(0x12c)]?.['parentFolder']?.['data']?.['id'],'createdAt':_0x13e1f2['attributes'][_0x4fd825(0x13e)],'updatedAt':_0x13e1f2[_0x4fd825(0x12f)]['updatedAt']})),_0x188097=buildFolderIdToPathMap(_0x3897f6),_0x5eb7af=_0x4fb6f6||_0x4fd825(0x15e)+sanitizeFileName(_0x2f2a3f);_0x26f3b6?.[_0x4fd825(0x147)](_0x4fd825(0x124));const _0x297987=new Map();await batchAsync(_0x293cf6,async _0x17a07b=>{const _0x5ae8e1=_0x4fd825,_0x2c99c2=await _0x639b9d[_0x5ae8e1(0x11a)][_0x5ae8e1(0x154)](_0x360c29,_0x17a07b['id']);_0x297987['set'](_0x17a07b['id'],_0x2c99c2);}),_0x26f3b6?.[_0x4fd825(0x147)](_0x4fd825(0x11f));const [_0x1cd433,_0x2715c3]=await Promise['all']([_0x639b9d['user'][_0x4fd825(0x128)](),_0x639b9d[_0x4fd825(0x14d)][_0x4fd825(0x14a)]()]),_0x50c762=[],_0x3d1c27=new Map(),_0x208ce9=a150_0x32b596[_0x4fd825(0x157)](_0x5eb7af,_0x4fd825(0x13b)),_0x297d2a=createTdxConfigContent(_0x2f2a3f);_0x50c762[_0x4fd825(0x12e)](prepareFile(_0x208ce9,_0x297d2a,_0x5eb7af));const _0x6d9ec=new Map();for(const _0x331794 of _0x293cf6){_0x6d9ec[_0x4fd825(0x15f)](_0x331794['id'],_0x331794);}let _0x348555=_0x293cf6;if(_0x5c4630['targetResourceName']){const _0x59a767=_0x293cf6[_0x4fd825(0x132)](_0x15ba2b=>_0x15ba2b[_0x4fd825(0x143)][_0x4fd825(0x127)]()===_0x5c4630[_0x4fd825(0x15b)][_0x4fd825(0x127)]());_0x59a767[_0x4fd825(0x125)]>0x0&&(_0x348555=_0x59a767);}_0x26f3b6?.[_0x4fd825(0x147)](_0x4fd825(0x139));for(const _0x1fb313 of _0x348555){if(_0x1fb313[_0x4fd825(0x150)]===SEGMENT_KIND_JOURNEY)continue;const _0x11549c=_0x1fb313[_0x4fd825(0x12d)]?_0x188097[_0x4fd825(0x121)](_0x1fb313['segmentFolderId'])||'':'',_0x1ab820=_0x297987[_0x4fd825(0x121)](_0x1fb313['id'])||[],_0x2e0bbc=segmentWithActivationsToYaml(_0x1fb313,_0x1ab820,undefined,_0x1cd433,_0x2715c3),_0x5404be=_0x11549c?a150_0x32b596[_0x4fd825(0x157)](_0x5eb7af,_0x11549c):_0x5eb7af,_0x5d6ff2=sanitizeFileName(_0x1fb313[_0x4fd825(0x143)]),_0x363253=getUniqueFileName(_0x5404be,_0x5d6ff2,_0x3d1c27),_0x2d51dc=a150_0x32b596['join'](_0x5404be,_0x363253+_0x4fd825(0x11e)),_0x5c701f=segmentToYamlString(_0x2e0bbc);_0x50c762['push'](prepareFile(_0x2d51dc,_0x5c701f,_0x5eb7af));}const _0x40a923=new Map();for(const _0x5b849d of _0x175c4f){const _0x5d38f3=_0x5b849d[_0x4fd825(0x13d)];!_0x40a923[_0x4fd825(0x146)](_0x5d38f3)&&_0x40a923[_0x4fd825(0x15f)](_0x5d38f3,[]),_0x40a923[_0x4fd825(0x121)](_0x5d38f3)[_0x4fd825(0x12e)](_0x5b849d);}for(const _0x6eea8a of _0x40a923[_0x4fd825(0x152)]()){_0x6eea8a['sort']((_0x3256df,_0x13bdf1)=>(_0x3256df[_0x4fd825(0x133)]||0x0)-(_0x13bdf1[_0x4fd825(0x133)]||0x0));}if(_0x5c4630['targetResourceName']){const _0x371f90=new Map();for(const [_0x1587e5,_0x1d397e]of _0x40a923){const _0x247f0a=_0x1d397e[0x0][_0x4fd825(0x140)];if(_0x247f0a['toLowerCase']()===_0x5c4630[_0x4fd825(0x15b)][_0x4fd825(0x127)]()){_0x371f90[_0x4fd825(0x15f)](_0x1587e5,_0x1d397e);break;}}_0x40a923['clear']();for(const [_0x55703f,_0x4a2dae]of _0x371f90){_0x40a923['set'](_0x55703f,_0x4a2dae);}}if(_0x40a923[_0x4fd825(0x156)]>0x0){_0x26f3b6?.[_0x4fd825(0x147)](_0x4fd825(0x136));const _0x2bea36=Array[_0x4fd825(0x149)](_0x40a923[_0x4fd825(0x152)]()),_0x5bbb03=0x5,{createYamlContext:_0x14767c}=createYamlContextForBundle(_0x639b9d,_0x6d9ec,_0x1cd433,_0x2715c3,_0x214f29,_0x1366fd);for(let _0x4feeb2=0x0;_0x4feeb2<_0x2bea36[_0x4fd825(0x125)];_0x4feeb2+=_0x5bbb03){const _0x4e908e=_0x2bea36[_0x4fd825(0x153)](_0x4feeb2,_0x4feeb2+_0x5bbb03),_0x42e9fd=await Promise[_0x4fd825(0x145)](_0x4e908e['map'](async _0x12b5fb=>{const _0x2c79c4=_0x4fd825,_0x4bc328=_0x12b5fb[0x0],_0x4dfd47=_0x4bc328[_0x2c79c4(0x140)];_0x26f3b6?.[_0x2c79c4(0x147)](_0x2c79c4(0x13c)+_0x4dfd47);const _0x58b5b0=_0x4bc328[_0x2c79c4(0x131)]?_0x188097[_0x2c79c4(0x121)](_0x4bc328[_0x2c79c4(0x131)])||'':'',_0x152ab1=_0x58b5b0?a150_0x32b596[_0x2c79c4(0x157)](_0x5eb7af,_0x58b5b0):_0x5eb7af,_0x4207a1=sanitizeFileName(_0x4dfd47),_0x281d3b=a150_0x32b596[_0x2c79c4(0x157)](_0x152ab1,_0x4207a1+'.yml');let _0xb40c24;if(existsSync(_0x281d3b))try{const _0x2c62bb=readFileSync(_0x281d3b,_0x2c79c4(0x15d)),_0x2af6aa=a150_0x65010e(_0x2c62bb);_0xb40c24=buildLocalRuleToNameMappingFromJourney(_0x2af6aa);}catch{}const _0x88fd41=[];for(const _0x26b4a9 of _0x12b5fb){const _0x930392=_0x1366fd[_0x2c79c4(0x121)](_0x26b4a9['id']);if(!_0x930392){_0x26f3b6?.[_0x2c79c4(0x147)](_0x2c79c4(0x159)+_0x26b4a9['id']+_0x2c79c4(0x12b));continue;}const _0x45cf00=_0x930392['attributes']?.[_0x2c79c4(0x148)],_0x133061=_0x14767c(_0x26b4a9['id'],_0x45cf00),_0x4d473b=await journeyResponseToDef(_0x930392,_0x133061);_0x88fd41[_0x2c79c4(0x12e)]({'item':_0x26b4a9,'yaml':_0x4d473b});}const _0x16f96a=await _0x639b9d[_0x2c79c4(0x123)]['getLatestJourneyId'](_0x4bc328['journeyBundleId']),_0x535454=buildMergedJourneyDef(_0x88fd41,_0xb40c24,_0x16f96a);return{'bundleName':_0x4dfd47,'folderPath':_0x58b5b0,'finalYaml':_0x535454};}));for(const {bundleName:_0x5de8b9,folderPath:_0xb85025,finalYaml:_0xe3fa2c}of _0x42e9fd){const _0x4498ad=normalizeJourneyDef(_0xe3fa2c),_0x5c850d=a150_0x5a1929(_0x4498ad),_0x406fab=_0xb85025?a150_0x32b596[_0x4fd825(0x157)](_0x5eb7af,_0xb85025):_0x5eb7af,_0x5d74f6=sanitizeFileName(_0x5de8b9),_0x13083d=getUniqueFileName(_0x406fab,_0x5d74f6,_0x3d1c27),_0x3c0ad9=a150_0x32b596[_0x4fd825(0x157)](_0x406fab,_0x13083d+'.yml');_0x50c762['push'](prepareFile(_0x3c0ad9,_0x5c850d,_0x5eb7af));}}}const _0x3c6610=Array[_0x4fd825(0x149)](_0x297987['values']())['reduce']((_0x15902c,_0x524848)=>_0x15902c+_0x524848[_0x4fd825(0x125)],0x0),_0x30360c=_0x348555[_0x4fd825(0x132)](_0x125b27=>_0x125b27[_0x4fd825(0x150)]!==SEGMENT_KIND_JOURNEY),_0x36ce53=_0x50c762[_0x4fd825(0x132)](_0x1276d9=>_0x1276d9[_0x4fd825(0x14c)])['length'],_0x2c7765=_0x50c762[_0x4fd825(0x132)](_0x3dd7cf=>!_0x3dd7cf[_0x4fd825(0x14c)]&&_0x3dd7cf[_0x4fd825(0x13a)])['length'],_0x5176a4=_0x50c762[_0x4fd825(0x132)](_0x49d078=>!_0x49d078['isNew']&&!_0x49d078['hasChanges'])[_0x4fd825(0x125)],_0x186dd5=Array[_0x4fd825(0x149)](_0x40a923[_0x4fd825(0x152)]())[_0x4fd825(0x14f)]((_0x3d97e5,_0x56d765)=>_0x3d97e5+_0x56d765['length'],0x0);return{'parentName':_0x2f2a3f,'parentId':_0x360c29,'targetDir':_0x5eb7af,'files':_0x50c762,'counts':{'segments':_0x30360c[_0x4fd825(0x125)],'journeys':_0x40a923['size'],'journeyVersions':_0x186dd5,'activations':_0x3c6610},'newFiles':_0x36ce53,'changedFiles':_0x2c7765,'unchangedFiles':_0x5176a4};}function createYamlContextForBundle(_0x251cbc,_0x277b35,_0x97c990,_0x4b4b72,_0x140ae3,_0x416789){const _0x1d72a8=new Set(),_0x51609d=new Map(),_0x5c3511=new Map(),_0x14c242=createJumpTargetCache(),_0x1ca58f=async(_0x3a348c,_0x40dfea)=>{const _0x36be68=a150_0x2475,_0x28122f=_0x51609d['get'](_0x3a348c);if(_0x28122f!==undefined)return _0x28122f;if(!_0x40dfea)return _0x3a348c;try{let _0x3a8378=_0x277b35['get'](_0x3a348c);!_0x3a8378&&(_0x3a8378=await _0x251cbc['segment'][_0x36be68(0x142)](_0x40dfea,_0x3a348c),_0x277b35['set'](_0x3a348c,_0x3a8378));const _0xb85d6c=generateJourneyLocalName(_0x3a8378[_0x36be68(0x143)]),_0x18f71c=_0x3a8378['kind']===SEGMENT_KIND_JOURNEY&&_0xb85d6c!==undefined;if(_0x18f71c&&_0xb85d6c){let _0x8e22f7=_0xb85d6c,_0x19b82a=0x2;while(_0x1d72a8[_0x36be68(0x146)](_0x8e22f7)){_0x8e22f7=_0xb85d6c+'_'+_0x19b82a,_0x19b82a++;}return _0x1d72a8['add'](_0x8e22f7),_0x51609d[_0x36be68(0x15f)](_0x3a348c,_0x8e22f7),_0x8e22f7;}return _0x3a8378['name'];}catch{return _0x3a348c;}},_0x46714f=(_0x26c62b,_0x29989a)=>({'resolveSegment':async _0x4c9e66=>{const _0x187198=a150_0x2475,_0x417970=_0x51609d[_0x187198(0x121)](_0x4c9e66);if(_0x417970!==undefined)return{'name':_0x417970,'isJourneyLocal':!![]};if(!_0x29989a)return{'name':_0x4c9e66,'isJourneyLocal':![]};try{let _0x332ca8=_0x277b35['get'](_0x4c9e66);!_0x332ca8&&(_0x332ca8=await _0x251cbc[_0x187198(0x11a)][_0x187198(0x142)](_0x29989a,_0x4c9e66),_0x277b35[_0x187198(0x15f)](_0x4c9e66,_0x332ca8));const _0x175770=generateJourneyLocalName(_0x332ca8['name']),_0x4b212b=_0x332ca8[_0x187198(0x150)]===SEGMENT_KIND_JOURNEY&&_0x175770!==undefined;if(_0x4b212b&&!_0x332ca8[_0x187198(0x13f)]&&_0x29989a)try{const _0x5e3904=await _0x251cbc[_0x187198(0x11a)][_0x187198(0x142)](_0x29989a,_0x4c9e66);_0x277b35[_0x187198(0x15f)](_0x4c9e66,_0x5e3904),_0x332ca8=_0x5e3904;}catch{}const _0x260d75=await _0x1ca58f(_0x4c9e66,_0x29989a);let _0xb2eb85;if(_0x4b212b&&_0x332ca8[_0x187198(0x13f)]){const _0x5bf9e4=await segmentResponseToDef(_0x332ca8,{'resolveSegmentName':_0x1dde1e=>_0x1ca58f(_0x1dde1e,_0x29989a)});_0xb2eb85={'description':_0x332ca8[_0x187198(0x15c)],'rule':_0x5bf9e4['rule']};}return{'name':_0x260d75,'isJourneyLocal':_0x4b212b,'definition':_0xb2eb85};}catch{return{'name':_0x4c9e66,'isJourneyLocal':![]};}},'resolveActivation':async _0xe294a9=>{const _0x3541ce=a150_0x2475,_0x1df8f3=_0x5c3511['get'](_0xe294a9);if(_0x1df8f3!==undefined)return{'name':_0x1df8f3,'isJourneyLocal':!![]};try{let _0x49efaf=_0x140ae3[_0x3541ce(0x121)](_0xe294a9);!_0x49efaf&&(_0x49efaf=await _0x251cbc[_0x3541ce(0x123)][_0x3541ce(0x126)](_0x26c62b,_0xe294a9));const _0x449bad=_0x49efaf[_0x3541ce(0x12f)][_0x3541ce(0x15a)][_0x3541ce(0x143)]||_0xe294a9,_0x8d4cc6=sanitizeYamlKey(_0x449bad)||_0x3541ce(0x119)+_0xe294a9,_0xe8d3db=_0x8d4cc6;_0x5c3511[_0x3541ce(0x15f)](_0xe294a9,_0xe8d3db);const _0x2ab3cd=journeyActivationStepToYaml(_0x49efaf,_0x97c990,_0x4b4b72);return{'name':_0xe8d3db,'isJourneyLocal':!![],'definition':_0x2ab3cd};}catch{return{'name':_0xe294a9,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x44a33c,_0x38bd4c)=>resolveJumpTarget(_0x44a33c,_0x38bd4c,_0x14c242,async _0x34ad09=>{const _0x43c894=a150_0x2475,_0x230f2f=_0x416789[_0x43c894(0x121)](_0x34ad09);if(_0x230f2f)return _0x230f2f;return _0x251cbc['journey']['getJourney'](_0x34ad09);})});return{'createYamlContext':_0x46714f};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a151_0x3b94dc=a151_0x54d7;function a151_0x54d7(_0x5b7e5c,_0x4e8836){_0x5b7e5c=_0x5b7e5c-0xe5;const _0xb1a692=a151_0xb1a6();let _0x54d789=_0xb1a692[_0x5b7e5c];return _0x54d789;}(function(_0x11bc9b,_0x3abac7){const _0x30be2b=a151_0x54d7,_0x4a7a74=_0x11bc9b();while(!![]){try{const _0x89310b=parseInt(_0x30be2b(0xe5))/0x1*(-parseInt(_0x30be2b(0xf7))/0x2)+parseInt(_0x30be2b(0xfb))/0x3+parseInt(_0x30be2b(0xf2))/0x4+-parseInt(_0x30be2b(0xfe))/0x5*(-parseInt(_0x30be2b(0xe9))/0x6)+-parseInt(_0x30be2b(0xf0))/0x7*(parseInt(_0x30be2b(0xf4))/0x8)+-parseInt(_0x30be2b(0xee))/0x9*(parseInt(_0x30be2b(0xf5))/0xa)+parseInt(_0x30be2b(0xe8))/0xb;if(_0x89310b===_0x3abac7)break;else _0x4a7a74['push'](_0x4a7a74['shift']());}catch(_0x333a34){_0x4a7a74['push'](_0x4a7a74['shift']());}}}(a151_0xb1a6,0x72046));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a151_0x3f304c from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a151_0x3b94dc(0xf9));export function getPushRecoveryPath(_0x1940a6){const _0x4094e9=a151_0x3b94dc,_0x141a6e=a151_0x3f304c[_0x4094e9(0xfd)](_0x1940a6),_0x50bd45=a151_0x3f304c[_0x4094e9(0xeb)](_0x1940a6);return a151_0x3f304c[_0x4094e9(0xf8)](_0x141a6e,'.'+_0x50bd45+'.push-recovery.json');}export function readPushRecovery(_0x31c0d5){const _0x46f86d=a151_0x3b94dc,_0x5c76d4=getPushRecoveryPath(_0x31c0d5);if(!existsSync(_0x5c76d4))return undefined;try{const _0xe576df=readFileSync(_0x5c76d4,_0x46f86d(0xfa)),_0xfc1599=JSON[_0x46f86d(0xed)](_0xe576df);if(_0xfc1599?.[_0x46f86d(0xea)]!==0x1||typeof _0xfc1599['journeyName']!==_0x46f86d(0xe7))return undefined;return _0xfc1599;}catch(_0x2936fb){return _0x2936fb instanceof SyntaxError?logger[_0x46f86d(0xf1)]('Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20'+_0x2936fb):logger[_0x46f86d(0xe6)](_0x46f86d(0xf3)+_0x2936fb),undefined;}}function a151_0xb1a6(){const _0x3b7ad1=['17276HqQYXq','debug','2644548XhfwuQ','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','2280oGqbmr','259020VCdyTm','.tmp','3634WzjIwr','join','tdx.sdk.push-recovery','utf-8','952542JQzACI','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','dirname','20PtIoBl','segments','356WKDlDX','warn','string','8876637MgUyUk','746796MEoBwE','version','basename','stringify','parse','162FzkWoH','code'];a151_0xb1a6=function(){return _0x3b7ad1;};return a151_0xb1a6();}export function writePushRecovery(_0x20ef14,_0x42bf22){const _0x160b97=a151_0x3b94dc,_0x4f3c71=getPushRecoveryPath(_0x20ef14),_0x5012bd=_0x4f3c71+_0x160b97(0xf6);writeFileSync(_0x5012bd,JSON[_0x160b97(0xec)](_0x42bf22,null,0x2)+'\x0a',_0x160b97(0xfa)),renameSync(_0x5012bd,_0x4f3c71);}export function deletePushRecovery(_0x353038){const _0x33747a=a151_0x3b94dc,_0x24802e=getPushRecoveryPath(_0x353038);try{unlinkSync(_0x24802e);}catch(_0x2ef1c3){_0x2ef1c3[_0x33747a(0xef)]!=='ENOENT'&&logger['debug'](_0x33747a(0xfc)+_0x2ef1c3);}}export function saveSegmentToPushRecovery(_0x26fc51,_0x2eedbc,_0x1ea5af,_0x1bc014){const _0x104262=a151_0x3b94dc,_0x3f454a=readPushRecovery(_0x26fc51),_0x43b633=_0x3f454a?.['journeyName']===_0x2eedbc?{..._0x3f454a,'updatedAt':new Date()['toISOString']()}:{'version':0x1,'journeyName':_0x2eedbc,'updatedAt':new Date()['toISOString'](),'segments':{}};_0x43b633[_0x104262(0xff)][_0x1ea5af]=_0x1bc014,writePushRecovery(_0x26fc51,_0x43b633);}
|