@treasuredata/tdx 2026.10.0 → 2026.10.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.d.ts +1 -1
- package/dist/cli-categories.js +1 -1
- package/dist/cli-categories.js.map +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.js +1 -1
- package/dist/commands/cas-journey-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts.map +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-command.js.map +1 -1
- package/dist/commands/claude-statusline-command.d.ts.map +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-statusline-command.js.map +1 -1
- package/dist/commands/codex-command.d.ts.map +1 -1
- package/dist/commands/codex-command.js +1 -1
- package/dist/commands/codex-command.js.map +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-always-on-campaign-pull-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-push-command.js +1 -1
- package/dist/commands/engage-always-on-campaign-validate-command.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-readiness-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-in-browser-message-command.js +1 -1
- package/dist/commands/engage-landing-page-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/engage-workspace-assignment-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/opencode-command.d.ts +10 -3
- package/dist/commands/opencode-command.d.ts.map +1 -1
- package/dist/commands/opencode-command.js +1 -1
- package/dist/commands/opencode-command.js.map +1 -1
- package/dist/commands/p13n-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.d.ts.map +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/profiles-command.js.map +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.d.ts +8 -0
- package/dist/commands/upgrade-command.d.ts.map +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/upgrade-command.js.map +1 -1
- package/dist/commands/usage-command.d.ts +10 -0
- package/dist/commands/usage-command.d.ts.map +1 -0
- package/dist/commands/usage-command.js +1 -0
- package/dist/commands/usage-command.js.map +1 -0
- 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.d.ts +2 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/config.js.map +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.d.ts +1 -0
- package/dist/core/profile.d.ts.map +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/profile.js.map +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/site-mismatch.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.d.ts +5 -4
- package/dist/proxy/claude-usage-tracker.d.ts.map +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/claude-usage-tracker.js.map +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/auth-token.js +1 -1
- package/dist/sdk/cas/audience-context.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-schema.js +1 -1
- package/dist/sdk/cas/cas-audience-validator.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-schema.js +1 -1
- package/dist/sdk/cas/cas-segment-validator.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/cas/validate-files.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.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/p13n-studio-api-client.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/always-on-campaign-pull.js +1 -1
- package/dist/sdk/engage/always-on-campaign-push.js +1 -1
- package/dist/sdk/engage/always-on-campaign-validator.js +1 -1
- package/dist/sdk/engage/always-on-campaign-yaml.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-readiness-workflow.js +1 -1
- package/dist/sdk/engage/campaign-readiness.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/in-browser-message-pull.js +1 -1
- package/dist/sdk/engage/in-browser-message-push.js +1 -1
- package/dist/sdk/engage/in-browser-message-validator.js +1 -1
- package/dist/sdk/engage/in-browser-message-yaml.js +1 -1
- package/dist/sdk/engage/landing-page-init.js +1 -1
- package/dist/sdk/engage/landing-page-public-asset.js +1 -1
- package/dist/sdk/engage/landing-page-pull.js +1 -1
- package/dist/sdk/engage/landing-page-push.js +1 -1
- package/dist/sdk/engage/landing-page-static-site.js +1 -1
- package/dist/sdk/engage/landing-page-validator.js +1 -1
- package/dist/sdk/engage/landing-page-workspace.js +1 -1
- package/dist/sdk/engage/landing-page-yaml.js +1 -1
- package/dist/sdk/engage/list-campaign-schema.js +1 -1
- package/dist/sdk/engage/list-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/always-on-campaign-schema.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/in-browser-message-schema.js +1 -1
- package/dist/sdk/engage/types/landing-page-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage/workspace-assignments.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/codex-usage.d.ts +13 -0
- package/dist/sdk/llm/codex-usage.d.ts.map +1 -0
- package/dist/sdk/llm/codex-usage.js +1 -0
- package/dist/sdk/llm/codex-usage.js.map +1 -0
- 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/llm/work-models.d.ts +52 -0
- package/dist/sdk/llm/work-models.d.ts.map +1 -0
- package/dist/sdk/llm/work-models.js +1 -0
- package/dist/sdk/llm/work-models.js.map +1 -0
- package/dist/sdk/p13n-studio-errors.js +1 -1
- package/dist/sdk/p13n-studio.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/audience-context.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/util/tree-search.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/claude-code-state.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/proxy-fetch.js +1 -1
- package/dist/utils/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/td-user.d.ts +3 -0
- package/dist/utils/td-user.d.ts.map +1 -0
- package/dist/utils/td-user.js +1 -0
- package/dist/utils/td-user.js.map +1 -0
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
- package/dist/commands/ai-usage-command-base.d.ts +0 -26
- package/dist/commands/ai-usage-command-base.d.ts.map +0 -1
- package/dist/commands/ai-usage-command-base.js +0 -1
- package/dist/commands/ai-usage-command-base.js.map +0 -1
- package/dist/commands/claude-usage-command.d.ts +0 -19
- package/dist/commands/claude-usage-command.d.ts.map +0 -1
- package/dist/commands/claude-usage-command.js +0 -1
- package/dist/commands/claude-usage-command.js.map +0 -1
- package/dist/commands/opencode-usage-command.d.ts +0 -19
- package/dist/commands/opencode-usage-command.d.ts.map +0 -1
- package/dist/commands/opencode-usage-command.js +0 -1
- package/dist/commands/opencode-usage-command.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
function a201_0x5187(_0x13f76e,_0x14c962){_0x13f76e=_0x13f76e-0x69;const _0x42cf40=a201_0x42cf();let _0x51876b=_0x42cf40[_0x13f76e];return _0x51876b;}const a201_0x68a9d5=a201_0x5187;(function(_0x7947fa,_0x50443c){const _0x952dfa=a201_0x5187,_0x3550d6=_0x7947fa();while(!![]){try{const _0x48d10a=parseInt(_0x952dfa(0xa2))/0x1*(parseInt(_0x952dfa(0x7f))/0x2)+parseInt(_0x952dfa(0x99))/0x3+-parseInt(_0x952dfa(0x7e))/0x4*(-parseInt(_0x952dfa(0x6a))/0x5)+-parseInt(_0x952dfa(0x9b))/0x6+parseInt(_0x952dfa(0x91))/0x7+parseInt(_0x952dfa(0x79))/0x8+parseInt(_0x952dfa(0x6c))/0x9*(-parseInt(_0x952dfa(0x7c))/0xa);if(_0x48d10a===_0x50443c)break;else _0x3550d6['push'](_0x3550d6['shift']());}catch(_0x37994d){_0x3550d6['push'](_0x3550d6['shift']());}}}(a201_0x42cf,0x45d29));export const DEFAULT_TIME_RANGE=a201_0x68a9d5(0x9c);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x1ed426,_0x1fce47,_0xc93b47){const _0x584764=a201_0x68a9d5,_0x2f3cee=_0xc93b47&&_0xc93b47[_0x584764(0x84)]>0x0?_0xc93b47[_0x584764(0x89)](',\x20'):'*';return _0x584764(0x75)+_0x2f3cee+_0x584764(0xa5)+_0x1ed426+'.'+_0x1fce47+_0x584764(0x72);}export function generateMasterCountSQL(_0x315888){const _0x51b404=a201_0x68a9d5,{database:_0x5bc418,table:_0x46c2e2}=_0x315888[_0x51b404(0x9a)];return _0x51b404(0xa0)+_0x5bc418+'.'+_0x46c2e2;}export function generateMasterSampleSQL(_0x375c90,_0x115f23=0x5){const _0x34049c=a201_0x68a9d5,{database:_0x45db97,table:_0x1a994b}=_0x375c90[_0x34049c(0x9a)];return _0x34049c(0x95)+_0x45db97+'.'+_0x1a994b+_0x34049c(0x8b)+_0x115f23;}export function generateAttributeCoverageSQL(_0x1ddef8,_0x4bb488){const _0x2847be=a201_0x68a9d5,_0x1d49a1=_0x1ddef8['master'];return(_0x2847be(0x96)+_0x1d49a1[_0x2847be(0xa3)]+'.'+_0x1d49a1[_0x2847be(0x94)]+_0x2847be(0x8d)+_0x4bb488[_0x2847be(0x92)][_0x2847be(0xa3)]+'.'+_0x4bb488[_0x2847be(0x92)]['table']+_0x2847be(0x6b)+_0x4bb488[_0x2847be(0x89)][_0x2847be(0x81)]+_0x2847be(0x7a)+_0x4bb488[_0x2847be(0x89)][_0x2847be(0xa8)]+_0x2847be(0x74)+_0x4bb488[_0x2847be(0x89)]['child_key']+_0x2847be(0x85))[_0x2847be(0x9f)]();}export function generateBehaviorStatsSQL(_0x64e2c3,_0x22f368,_0x38b7b3=DEFAULT_TIME_RANGE){const _0x443d15=a201_0x68a9d5,_0x50e6fd=_0x64e2c3[_0x443d15(0x9a)];return(_0x443d15(0x8a)+_0x22f368[_0x443d15(0x89)][_0x443d15(0x81)]+_0x443d15(0x82)+_0x50e6fd[_0x443d15(0xa3)]+'.'+_0x50e6fd[_0x443d15(0x94)]+_0x443d15(0x8c)+_0x22f368['source']['database']+'.'+_0x22f368[_0x443d15(0x92)]['table']+_0x443d15(0x88)+_0x22f368['join'][_0x443d15(0x81)]+_0x443d15(0x83)+_0x22f368['join'][_0x443d15(0xa8)]+_0x443d15(0xa6)+_0x38b7b3+'\x27)\x0a')[_0x443d15(0x9f)]();}export function generateAttributeSampleSQL(_0x64f3d3,_0x7b5569,_0x1f0ae4=0x5){const _0x1b7648=a201_0x68a9d5,_0x23ccd5=_0x64f3d3[_0x1b7648(0x9a)],_0x389a6f=_0x7b5569['join'][_0x1b7648(0x81)],_0x2e56c8=_0x7b5569[_0x1b7648(0x71)][_0x1b7648(0x97)](_0x26c7b5=>'a.'+_0x26c7b5[_0x1b7648(0x9d)])[_0x1b7648(0x89)](',\x20');return(_0x1b7648(0x8e)+_0x389a6f+',\x20'+_0x2e56c8+_0x1b7648(0x6d)+_0x23ccd5[_0x1b7648(0xa3)]+'.'+_0x23ccd5[_0x1b7648(0x94)]+'\x20m\x0aJOIN\x20'+_0x7b5569[_0x1b7648(0x92)]['database']+'.'+_0x7b5569['source'][_0x1b7648(0x94)]+'\x20a\x0a\x20\x20ON\x20m.'+_0x7b5569[_0x1b7648(0x89)][_0x1b7648(0x81)]+_0x1b7648(0x7a)+_0x7b5569[_0x1b7648(0x89)][_0x1b7648(0xa8)]+'\x0aLIMIT\x20'+_0x1f0ae4+'\x0a')[_0x1b7648(0x9f)]();}export function generateBehaviorSampleSQL(_0xdd6400,_0x5d09e1,_0xdebab4=0x5,_0x1b8d47=DEFAULT_TIME_RANGE){const _0x4055d4=a201_0x68a9d5,_0x3debad=_0xdd6400[_0x4055d4(0x9a)],_0x4b35f6=_0x5d09e1[_0x4055d4(0x89)][_0x4055d4(0x81)];let _0x247366;if(_0x5d09e1[_0x4055d4(0x77)])_0x247366=_0x4055d4(0xa7);else _0x5d09e1[_0x4055d4(0x71)]&&_0x5d09e1[_0x4055d4(0x71)][_0x4055d4(0x84)]>0x0?_0x247366=_0x5d09e1[_0x4055d4(0x71)]['map'](_0x56ec20=>'b.'+_0x56ec20['column'])['join'](',\x20'):_0x247366=_0x4055d4(0xa7);return('\x0aSELECT\x20m.'+_0x4b35f6+',\x20'+_0x247366+'\x0aFROM\x20'+_0x3debad[_0x4055d4(0xa3)]+'.'+_0x3debad['table']+_0x4055d4(0x8c)+_0x5d09e1[_0x4055d4(0x92)][_0x4055d4(0xa3)]+'.'+_0x5d09e1['source']['table']+_0x4055d4(0x88)+_0x5d09e1[_0x4055d4(0x89)][_0x4055d4(0x81)]+_0x4055d4(0x83)+_0x5d09e1['join'][_0x4055d4(0xa8)]+_0x4055d4(0xa6)+_0x1b8d47+_0x4055d4(0x69)+_0xdebab4+'\x0a')['trim']();}function quoteIdentifier(_0xdd636a){const _0x35dc5f=a201_0x68a9d5;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x35dc5f(0x6e)](_0xdd636a))return'\x22'+_0xdd636a[_0x35dc5f(0x6f)](/"/g,'\x22\x22')+'\x22';return _0xdd636a;}export function generateEnrichedSQL(_0x5618d3,_0x3ae5c=0x5){const _0x46d60f=a201_0x68a9d5,_0x8b51c9=_0x5618d3[_0x46d60f(0x9a)],_0x5d91c2=_0x5618d3[_0x46d60f(0x73)]||[];if(_0x5d91c2[_0x46d60f(0x84)]===0x0)return _0x46d60f(0x95)+_0x8b51c9[_0x46d60f(0xa3)]+'.'+_0x8b51c9['table']+_0x46d60f(0x8b)+_0x3ae5c;const _0xb6718c=[_0x46d60f(0x7b)],_0x2c4bea=[];return _0x5d91c2['forEach']((_0x35897a,_0x667543)=>{const _0x43fc3a=_0x46d60f,_0x84964a='a'+_0x667543;_0x35897a[_0x43fc3a(0x71)][_0x43fc3a(0x78)](_0x4f5152=>{const _0x80c8f=_0x43fc3a,_0x5ec059=quoteIdentifier(_0x4f5152[_0x80c8f(0x9e)]||_0x4f5152[_0x80c8f(0x9d)]);_0xb6718c[_0x80c8f(0x98)](_0x84964a+'.'+_0x4f5152['column']+_0x80c8f(0xa4)+_0x5ec059);}),_0x2c4bea[_0x43fc3a(0x98)](_0x43fc3a(0x80)+_0x35897a['source']['database']+'.'+_0x35897a['source'][_0x43fc3a(0x94)]+'\x20'+_0x84964a+_0x43fc3a(0x87)+_0x35897a['join'][_0x43fc3a(0x81)]+_0x43fc3a(0xa1)+_0x84964a+'.'+_0x35897a[_0x43fc3a(0x89)][_0x43fc3a(0xa8)]);}),(_0x46d60f(0x8f)+_0xb6718c['join'](',\x20')+_0x46d60f(0x6d)+_0x8b51c9[_0x46d60f(0xa3)]+'.'+_0x8b51c9[_0x46d60f(0x94)]+_0x46d60f(0x90)+_0x2c4bea[_0x46d60f(0x89)]('\x0a')+'\x0aLIMIT\x20'+_0x3ae5c+'\x0a')['trim']();}export function generateAttributeSchemaSQL(_0x307822,_0x41ee95){const _0x20ac07=a201_0x68a9d5,_0x4e8328=_0x307822[_0x20ac07(0x9a)],_0x2706be=_0x41ee95[_0x20ac07(0x89)][_0x20ac07(0x81)],_0x46f791=_0x41ee95['columns'][_0x20ac07(0x97)](_0x4c86a8=>'a.'+_0x4c86a8[_0x20ac07(0x9d)])['join'](',\x20');return(_0x20ac07(0x8e)+_0x2706be+',\x20'+_0x46f791+_0x20ac07(0x6d)+_0x4e8328['database']+'.'+_0x4e8328[_0x20ac07(0x94)]+_0x20ac07(0x8c)+_0x41ee95[_0x20ac07(0x92)][_0x20ac07(0xa3)]+'.'+_0x41ee95[_0x20ac07(0x92)][_0x20ac07(0x94)]+_0x20ac07(0x6b)+_0x41ee95['join'][_0x20ac07(0x81)]+_0x20ac07(0x7a)+_0x41ee95['join'][_0x20ac07(0xa8)]+_0x20ac07(0x93))[_0x20ac07(0x9f)]();}export function generateBehaviorSchemaSQL(_0x5e0c3b,_0x4bd7d1){const _0x15379a=a201_0x68a9d5,_0x5b6ef7=_0x5e0c3b[_0x15379a(0x9a)],_0x571f4e=_0x4bd7d1[_0x15379a(0x89)][_0x15379a(0x81)];let _0x2931a0;if(_0x4bd7d1[_0x15379a(0x77)])_0x2931a0=_0x15379a(0xa7);else _0x4bd7d1['columns']&&_0x4bd7d1[_0x15379a(0x71)][_0x15379a(0x84)]>0x0?_0x2931a0=_0x4bd7d1[_0x15379a(0x71)][_0x15379a(0x97)](_0x46eb98=>'b.'+_0x46eb98[_0x15379a(0x9d)])[_0x15379a(0x89)](',\x20'):_0x2931a0='b.*';return(_0x15379a(0x8e)+_0x571f4e+',\x20'+_0x2931a0+_0x15379a(0x6d)+_0x5b6ef7[_0x15379a(0xa3)]+'.'+_0x5b6ef7[_0x15379a(0x94)]+'\x20m\x0aJOIN\x20'+_0x4bd7d1[_0x15379a(0x92)][_0x15379a(0xa3)]+'.'+_0x4bd7d1['source'][_0x15379a(0x94)]+'\x20b\x0a\x20\x20ON\x20m.'+_0x4bd7d1[_0x15379a(0x89)]['parent_key']+_0x15379a(0x83)+_0x4bd7d1[_0x15379a(0x89)][_0x15379a(0xa8)]+_0x15379a(0x93))[_0x15379a(0x9f)]();}export function getAttributeColumns(_0x4ad8fb){const _0x11f66a=a201_0x68a9d5;return _0x4ad8fb[_0x11f66a(0x71)][_0x11f66a(0x97)](_0x5f1a4a=>({'label':_0x5f1a4a[_0x11f66a(0x9e)]||_0x5f1a4a[_0x11f66a(0x9d)],'column':_0x5f1a4a[_0x11f66a(0x9d)]}));}export function getBehaviorColumns(_0x226b8c){const _0x4b6536=a201_0x68a9d5;if(_0x226b8c[_0x4b6536(0x77)])return[{'label':_0x4b6536(0x7d),'column':'*'}];if(_0x226b8c[_0x4b6536(0x71)]&&_0x226b8c[_0x4b6536(0x71)][_0x4b6536(0x84)]>0x0)return _0x226b8c[_0x4b6536(0x71)][_0x4b6536(0x97)](_0x4135e8=>({'label':_0x4135e8[_0x4b6536(0x9e)]||_0x4135e8[_0x4b6536(0x9d)],'column':_0x4135e8['column']}));return[{'label':_0x4b6536(0x7d),'column':'*'}];}function a201_0x42cf(){const _0xff0fc6=['(all\x20columns)','465968mkoEHg','4EtmyUX','LEFT\x20JOIN\x20','parent_key',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','\x20=\x20b.','length','\x20IS\x20NOT\x20NULL\x0a','toLowerCase','\x0a\x20\x20ON\x20m.','\x20b\x0a\x20\x20ON\x20m.','join','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','\x20LIMIT\x20','\x20m\x0aJOIN\x20','\x20m\x0aLEFT\x20JOIN\x20','\x0aSELECT\x20m.','\x0aSELECT\x20','\x20m\x0a','701211iBowxK','source','\x0aLIMIT\x200\x0a','table','SELECT\x20*\x20FROM\x20','\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20','map','push','1532124FxVpCj','master','1199238TAXIbZ','-1d','column','label','trim','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','\x20=\x20','212582iTCmoJ','database','\x20AS\x20','\x20FROM\x20','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27','b.*','child_key','\x27)\x0aLIMIT\x20','10XKMZmW','\x20a\x0a\x20\x20ON\x20m.','6291kFMgRW','\x0aFROM\x20','test','replace','find','columns','\x20LIMIT\x200','attributes','\x0aWHERE\x20a.','SELECT\x20','name','all_columns','forEach','4432192KuUjkS','\x20=\x20a.','m.*','19130AzNKTW'];a201_0x42cf=function(){return _0xff0fc6;};return a201_0x42cf();}export function findAttributeByName(_0x4a03f9,_0x48b18c){const _0x6dad9=a201_0x68a9d5;return _0x4a03f9[_0x6dad9(0x73)]?.[_0x6dad9(0x70)](_0x257cd3=>_0x257cd3['name'][_0x6dad9(0x86)]()===_0x48b18c[_0x6dad9(0x86)]());}export function findBehaviorByName(_0x4c6528,_0x42692c){const _0x99ad11=a201_0x68a9d5;return _0x4c6528['behaviors']?.[_0x99ad11(0x70)](_0x4c78c1=>_0x4c78c1[_0x99ad11(0x76)][_0x99ad11(0x86)]()===_0x42692c[_0x99ad11(0x86)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x1d4052,_0x4ae8c6){const _0x3dd877=a202_0x12a7,_0x19f87d=_0x1d4052();while(!![]){try{const _0x12d5a6=-parseInt(_0x3dd877(0xa9))/0x1*(parseInt(_0x3dd877(0x10e))/0x2)+-parseInt(_0x3dd877(0xe6))/0x3*(parseInt(_0x3dd877(0x10c))/0x4)+-parseInt(_0x3dd877(0x10a))/0x5+-parseInt(_0x3dd877(0x9f))/0x6*(parseInt(_0x3dd877(0xec))/0x7)+-parseInt(_0x3dd877(0xf9))/0x8*(parseInt(_0x3dd877(0xe0))/0x9)+parseInt(_0x3dd877(0xe2))/0xa*(-parseInt(_0x3dd877(0x107))/0xb)+-parseInt(_0x3dd877(0x10f))/0xc*(-parseInt(_0x3dd877(0xce))/0xd);if(_0x12d5a6===_0x4ae8c6)break;else _0x19f87d['push'](_0x19f87d['shift']());}catch(_0x561ee5){_0x19f87d['push'](_0x19f87d['shift']());}}}(a202_0x4488,0xec24d));import*as a202_0x20eba4 from'yaml';function formatScheduleTime(_0x91057f){const _0x58417a=a202_0x12a7;if(typeof _0x91057f===_0x58417a(0xb3)){const _0x5686eb=Math[_0x58417a(0xef)](_0x91057f);return String(_0x5686eb)[_0x58417a(0xf5)](0x2,'0')+_0x58417a(0x109);}if(typeof _0x91057f==='string'){if(/^\d{2}:\d{2}:\d{2}$/[_0x58417a(0xf2)](_0x91057f))return _0x91057f;if(/^\d{1,2}:\d{2}$/[_0x58417a(0xf2)](_0x91057f)){const [_0x360781,_0x37924a]=_0x91057f[_0x58417a(0xca)](':');return _0x360781['padStart'](0x2,'0')+':'+_0x37924a+_0x58417a(0xba);}const _0x3880ed=parseInt(_0x91057f,0xa);if(!isNaN(_0x3880ed)&&_0x91057f[_0x58417a(0xd4)](/^\d+$/))return String(_0x3880ed)['padStart'](0x2,'0')+_0x58417a(0x109);return _0x91057f;}return String(_0x91057f);}function a202_0x4488(){const _0x48a7fd=['realtime.attributes[','realtime','number','timezone','engine','defaultTimeFilterEnabled','user_id','all_columns','workflowHiveOnly',':00','forEach','groupingName','stringify','source','isRealtime','set','counter','Example\x20Attributes',']:\x20Missing\x20required\x20field\x20\x27name\x27','length','filters','database','null','map','label','split','parentKey','customerGroupBehaviors','hive_pool','62065939qnmFlj','none','personalization_services:','behaviors','03:00','primary_key','match','behaviors:','):\x20Invalid\x20type\x20\x27','columnName','parentDatabaseName','master','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','default_time_filter','YAML\x20config\x20missing\x20required\x20field:\x20master.table','column','attributes:','customer_group','1525833anvZHR','prestoPoolName','9010WuZsDb','rightValues','allColumns','customerGroup','69loFftZ','engine:','values','type','string','trino_pool','98QOXnlD','parse','schedule:','floor','attributes','push','test','schema','customer_group:','padStart','id_stitching','scheduleOption','replace','72PsHeMi','child_key','master:','personalization_services','customerGroupAttributes','YAML\x20config\x20missing\x20required\x20field:\x20master','list','audienceFilters','scheduleType','hive_only','events','Display\x20Name','columns','join','22583TSKeez','imported_batch',':00:00','6704305tieiMw','description','80236xTVLfM','name','32902Usqnps','24EEYnAL','table','time','746574pruJOc','ordered_set','get','column_name','hivePoolName','realtime:','schedule','parentColumn',']\x20(','parentTableName','101UseNqj','events_table','isArray','foreignKey','attribute_table','daily','has','parent_key'];a202_0x4488=function(){return _0x48a7fd;};return a202_0x4488();}export function apiToDef(_0x803165){const _0x17ff7c=a202_0x12a7,_0x4544df={'database':_0x803165[_0x17ff7c(0xd9)]?.[_0x17ff7c(0xd8)]||'','table':_0x803165[_0x17ff7c(0xd9)]?.['parentTableName']||''};_0x803165[_0x17ff7c(0x100)]&&_0x803165[_0x17ff7c(0x100)][_0x17ff7c(0xc4)]>0x0&&(_0x4544df[_0x17ff7c(0xc5)]=_0x803165[_0x17ff7c(0x100)]['map'](_0x15dcb9=>({'column':_0x15dcb9[_0x17ff7c(0xd7)],'values':_0x15dcb9[_0x17ff7c(0xe3)]})));let _0x138e22;_0x803165[_0x17ff7c(0x101)]&&_0x803165[_0x17ff7c(0x101)]!==_0x17ff7c(0xcf)&&(_0x138e22={'type':_0x803165[_0x17ff7c(0x101)]},_0x803165['scheduleOption']&&(_0x138e22[_0x17ff7c(0x9e)]=formatScheduleTime(_0x803165[_0x17ff7c(0xf7)])),_0x803165[_0x17ff7c(0xb4)]&&(_0x138e22[_0x17ff7c(0xb4)]=_0x803165['timezone']));let _0x3214ea;(_0x803165['workflowHiveOnly']||_0x803165[_0x17ff7c(0xa3)]||_0x803165['prestoPoolName'])&&(_0x3214ea={},_0x803165[_0x17ff7c(0xb9)]&&(_0x3214ea[_0x17ff7c(0x102)]=_0x803165[_0x17ff7c(0xb9)]),_0x803165[_0x17ff7c(0xa3)]&&(_0x3214ea[_0x17ff7c(0xcd)]=_0x803165['hivePoolName']),_0x803165[_0x17ff7c(0xe1)]&&(_0x3214ea['trino_pool']=_0x803165[_0x17ff7c(0xe1)]));const _0x463e54=_0x803165[_0x17ff7c(0xf0)]&&_0x803165[_0x17ff7c(0xf0)][_0x17ff7c(0xc4)]>0x0?groupAttributesBySource(_0x803165[_0x17ff7c(0xf0)]):undefined,_0x743a9f=_0x803165[_0x17ff7c(0xd1)]&&_0x803165['behaviors'][_0x17ff7c(0xc4)]>0x0?_0x803165[_0x17ff7c(0xd1)]['map'](convertApiBehaviorToYaml):undefined;let _0x3f733a;_0x803165['customerGroup']&&(_0x3f733a={'name':_0x803165[_0x17ff7c(0xe5)][_0x17ff7c(0x10d)],'source':{'database':_0x803165[_0x17ff7c(0xe5)][_0x17ff7c(0xd8)],'table':_0x803165[_0x17ff7c(0xe5)][_0x17ff7c(0xa8)]},'join':{'parent_key':_0x803165[_0x17ff7c(0xe5)]['foreignKey'],'child_key':_0x803165[_0x17ff7c(0xe5)][_0x17ff7c(0xcb)]}},_0x803165[_0x17ff7c(0xe5)][_0x17ff7c(0xfd)]&&_0x803165[_0x17ff7c(0xe5)]['customerGroupAttributes'][_0x17ff7c(0xc4)]>0x0&&(_0x3f733a[_0x17ff7c(0xf0)]=groupAttributesBySource(_0x803165[_0x17ff7c(0xe5)][_0x17ff7c(0xfd)])),_0x803165['customerGroup'][_0x17ff7c(0xcc)]&&_0x803165[_0x17ff7c(0xe5)][_0x17ff7c(0xcc)][_0x17ff7c(0xc4)]>0x0&&(_0x3f733a[_0x17ff7c(0xd1)]=_0x803165['customerGroup'][_0x17ff7c(0xcc)][_0x17ff7c(0xc8)](convertApiBehaviorToYaml)));const _0xd0be03={'name':_0x803165['name'],..._0x803165[_0x17ff7c(0x10b)]&&{'description':_0x803165[_0x17ff7c(0x10b)]},'master':_0x4544df,..._0x138e22&&{'schedule':_0x138e22},..._0x3214ea&&{'engine':_0x3214ea},..._0x463e54&&{'attributes':_0x463e54},..._0x743a9f&&{'behaviors':_0x743a9f},..._0x3f733a&&{'customer_group':_0x3f733a}};return _0xd0be03;}function groupAttributesBySource(_0x4595bd){const _0xb28101=a202_0x12a7,_0x1334ed=new Map();for(const _0x24e1a7 of _0x4595bd){const _0x33adea=_0x24e1a7['parentDatabaseName']+'.'+_0x24e1a7[_0xb28101(0xa8)]+'.'+_0x24e1a7[_0xb28101(0xcb)]+'.'+_0x24e1a7[_0xb28101(0xac)];!_0x1334ed[_0xb28101(0xaf)](_0x33adea)&&_0x1334ed[_0xb28101(0xc0)](_0x33adea,[]),_0x1334ed[_0xb28101(0xa1)](_0x33adea)[_0xb28101(0xf1)](_0x24e1a7);}const _0xe32a4b=[];for(const [,_0x4e1a59]of _0x1334ed){const _0x7b5f8d=_0x4e1a59[0x0],_0x5ba786=_0x7b5f8d[_0xb28101(0xbc)]||_0x7b5f8d[_0xb28101(0xa8)];_0xe32a4b['push']({'name':_0x5ba786,'source':{'database':_0x7b5f8d[_0xb28101(0xd8)],'table':_0x7b5f8d['parentTableName']},'join':{'parent_key':_0x7b5f8d[_0xb28101(0xac)],'child_key':_0x7b5f8d['parentKey']},'columns':_0x4e1a59[_0xb28101(0xc8)](_0x2804ba=>{const _0x1dade4=_0xb28101,_0x493598={'column':_0x2804ba['parentColumn'],'type':_0x2804ba[_0x1dade4(0xe9)]};return _0x2804ba[_0x1dade4(0x10d)]!==_0x2804ba[_0x1dade4(0xa6)]&&(_0x493598[_0x1dade4(0xc9)]=_0x2804ba['name']),_0x493598;})});}return _0xe32a4b;}function convertApiBehaviorToYaml(_0x40846a){const _0x22a8a9=a202_0x12a7,_0x5d791b={'name':_0x40846a[_0x22a8a9(0x10d)],'source':{'database':_0x40846a[_0x22a8a9(0xd8)],'table':_0x40846a[_0x22a8a9(0xa8)]},'join':{'parent_key':_0x40846a[_0x22a8a9(0xac)],'child_key':_0x40846a['parentKey']}};if(_0x40846a[_0x22a8a9(0xe4)])_0x5d791b[_0x22a8a9(0xb8)]=!![];else _0x40846a['schema']&&_0x40846a['schema']['length']>0x0&&(_0x5d791b[_0x22a8a9(0x105)]=_0x40846a[_0x22a8a9(0xf3)]['map'](_0x128526=>{const _0x261905=_0x22a8a9,_0x23156c={'column':_0x128526[_0x261905(0xa6)],'type':_0x128526['type']};return _0x128526[_0x261905(0x10d)]!==_0x128526[_0x261905(0xa6)]&&(_0x23156c[_0x261905(0xc9)]=_0x128526['name']),_0x23156c;}));return _0x40846a['defaultTimeFilterEnabled']&&(_0x5d791b[_0x22a8a9(0xdb)]=_0x40846a[_0x22a8a9(0xb6)]),_0x40846a[_0x22a8a9(0xbf)]&&(_0x5d791b['realtime']=_0x40846a['isRealtime']),_0x5d791b;}export function defToApi(_0x5b4e47){const _0x258086=a202_0x12a7,_0xd7254b={'name':_0x5b4e47[_0x258086(0x10d)],'master':{'parentDatabaseName':_0x5b4e47[_0x258086(0xd9)][_0x258086(0xc6)],'parentTableName':_0x5b4e47[_0x258086(0xd9)][_0x258086(0x110)]}};_0x5b4e47[_0x258086(0x10b)]&&(_0xd7254b['description']=_0x5b4e47[_0x258086(0x10b)]);_0x5b4e47[_0x258086(0xd9)][_0x258086(0xc5)]&&_0x5b4e47['master'][_0x258086(0xc5)][_0x258086(0xc4)]>0x0&&(_0xd7254b[_0x258086(0x100)]=_0x5b4e47[_0x258086(0xd9)][_0x258086(0xc5)]['map'](_0x53ac73=>({'columnName':_0x53ac73[_0x258086(0xdd)],'rightValues':_0x53ac73[_0x258086(0xe8)]})));_0x5b4e47[_0x258086(0xa5)]&&(_0xd7254b['scheduleType']=_0x5b4e47[_0x258086(0xa5)][_0x258086(0xe9)],_0x5b4e47['schedule'][_0x258086(0x9e)]&&(_0xd7254b[_0x258086(0xf7)]=_0x5b4e47['schedule'][_0x258086(0x9e)]),_0x5b4e47['schedule'][_0x258086(0xb4)]&&(_0xd7254b[_0x258086(0xb4)]=_0x5b4e47[_0x258086(0xa5)][_0x258086(0xb4)]));_0x5b4e47[_0x258086(0xb5)]&&(_0x5b4e47[_0x258086(0xb5)][_0x258086(0x102)]!==undefined&&(_0xd7254b['workflowHiveOnly']=_0x5b4e47[_0x258086(0xb5)][_0x258086(0x102)]),_0x5b4e47[_0x258086(0xb5)]['hive_pool']!==undefined&&(_0xd7254b[_0x258086(0xa3)]=_0x5b4e47[_0x258086(0xb5)][_0x258086(0xcd)]),_0x5b4e47[_0x258086(0xb5)][_0x258086(0xeb)]!==undefined&&(_0xd7254b[_0x258086(0xe1)]=_0x5b4e47[_0x258086(0xb5)][_0x258086(0xeb)]));_0x5b4e47[_0x258086(0xf0)]&&_0x5b4e47[_0x258086(0xf0)][_0x258086(0xc4)]>0x0&&(_0xd7254b[_0x258086(0xf0)]=flattenAttributeGroups(_0x5b4e47[_0x258086(0xf0)]));_0x5b4e47['behaviors']&&_0x5b4e47[_0x258086(0xd1)][_0x258086(0xc4)]>0x0&&(_0xd7254b[_0x258086(0xd1)]=_0x5b4e47[_0x258086(0xd1)]['map'](convertDefBehaviorToApi));if(_0x5b4e47['customer_group']){const _0x3f5775=_0x5b4e47[_0x258086(0xdf)];_0xd7254b[_0x258086(0xe5)]={'name':_0x3f5775[_0x258086(0x10d)],'parentDatabaseName':_0x3f5775[_0x258086(0xbe)][_0x258086(0xc6)],'parentTableName':_0x3f5775[_0x258086(0xbe)][_0x258086(0x110)],'parentKey':_0x3f5775['join'][_0x258086(0xfa)],'foreignKey':_0x3f5775['join']['parent_key']},_0x3f5775[_0x258086(0xf0)]&&_0x3f5775['attributes'][_0x258086(0xc4)]>0x0&&(_0xd7254b['customerGroup'][_0x258086(0xfd)]=flattenAttributeGroups(_0x3f5775[_0x258086(0xf0)])[_0x258086(0xc8)](_0x3ccd66=>({'name':_0x3ccd66[_0x258086(0x10d)],'type':_0x3ccd66['type'],'parentDatabaseName':_0x3ccd66['parentDatabaseName'],'parentTableName':_0x3ccd66[_0x258086(0xa8)],'parentColumn':_0x3ccd66[_0x258086(0xa6)],'parentKey':_0x3ccd66[_0x258086(0xcb)],'foreignKey':_0x3ccd66['foreignKey']}))),_0x3f5775['behaviors']&&_0x3f5775[_0x258086(0xd1)][_0x258086(0xc4)]>0x0&&(_0xd7254b[_0x258086(0xe5)][_0x258086(0xcc)]=_0x3f5775[_0x258086(0xd1)][_0x258086(0xc8)](_0x5cfad8=>({'name':_0x5cfad8[_0x258086(0x10d)],'parentDatabaseName':_0x5cfad8[_0x258086(0xbe)][_0x258086(0xc6)],'parentTableName':_0x5cfad8['source']['table'],'parentKey':_0x5cfad8[_0x258086(0x106)]['child_key'],'foreignKey':_0x5cfad8[_0x258086(0x106)][_0x258086(0xb0)],'allColumns':_0x5cfad8[_0x258086(0xb8)],'schema':_0x5cfad8[_0x258086(0x105)]?.[_0x258086(0xc8)](_0x3aaa3e=>({'name':_0x3aaa3e[_0x258086(0xc9)]||_0x3aaa3e[_0x258086(0xdd)],'type':_0x3aaa3e[_0x258086(0xe9)],'parentColumn':_0x3aaa3e[_0x258086(0xdd)]}))})));}return _0xd7254b;}function flattenAttributeGroups(_0x2730ce){const _0x19a0fe=a202_0x12a7,_0x3c7017=[];for(const _0x1c9717 of _0x2730ce){for(const _0x83ac37 of _0x1c9717[_0x19a0fe(0x105)]){_0x3c7017['push']({'name':_0x83ac37['label']||_0x83ac37[_0x19a0fe(0xdd)],'type':_0x83ac37[_0x19a0fe(0xe9)],'parentDatabaseName':_0x1c9717[_0x19a0fe(0xbe)][_0x19a0fe(0xc6)],'parentTableName':_0x1c9717[_0x19a0fe(0xbe)][_0x19a0fe(0x110)],'parentColumn':_0x83ac37[_0x19a0fe(0xdd)],'parentKey':_0x1c9717[_0x19a0fe(0x106)][_0x19a0fe(0xfa)],'foreignKey':_0x1c9717['join'][_0x19a0fe(0xb0)],'groupingName':_0x1c9717[_0x19a0fe(0x10d)]});}}return _0x3c7017;}function convertDefBehaviorToApi(_0x52983b){const _0x1a38e1=a202_0x12a7,_0x36f1f2={'name':_0x52983b[_0x1a38e1(0x10d)],'parentDatabaseName':_0x52983b[_0x1a38e1(0xbe)]['database'],'parentTableName':_0x52983b['source'][_0x1a38e1(0x110)],'parentKey':_0x52983b[_0x1a38e1(0x106)][_0x1a38e1(0xfa)],'foreignKey':_0x52983b['join'][_0x1a38e1(0xb0)]};if(_0x52983b[_0x1a38e1(0xb8)])_0x36f1f2[_0x1a38e1(0xe4)]=!![];else _0x52983b[_0x1a38e1(0x105)]&&_0x52983b[_0x1a38e1(0x105)][_0x1a38e1(0xc4)]>0x0&&(_0x36f1f2[_0x1a38e1(0xf3)]=_0x52983b['columns'][_0x1a38e1(0xc8)](_0xee9d61=>({'name':_0xee9d61[_0x1a38e1(0xc9)]||_0xee9d61[_0x1a38e1(0xdd)],'type':_0xee9d61[_0x1a38e1(0xe9)],'parentColumn':_0xee9d61[_0x1a38e1(0xdd)]})));return _0x52983b[_0x1a38e1(0xdb)]!==undefined&&(_0x36f1f2[_0x1a38e1(0xb6)]=_0x52983b['default_time_filter']),_0x52983b[_0x1a38e1(0xb2)]!==undefined&&(_0x36f1f2[_0x1a38e1(0xbf)]=_0x52983b['realtime']),_0x36f1f2;}export function serializeDef(_0x596260){const _0xdde2a7=a202_0x12a7,_0x5a402a=JSON[_0xdde2a7(0xed)](JSON[_0xdde2a7(0xbd)](_0x596260)),_0x3b1390=a202_0x20eba4['stringify'](_0x5a402a,{'indent':0x2,'lineWidth':0x0,'nullStr':_0xdde2a7(0xc7)}),_0x4390b9=[_0xdde2a7(0xfb),_0xdde2a7(0xee),_0xdde2a7(0xe7),_0xdde2a7(0xde),_0xdde2a7(0xd5),_0xdde2a7(0xf4),_0xdde2a7(0xa4),_0xdde2a7(0xd0)];let _0x507925=_0x3b1390;for(const _0x3606b8 of _0x4390b9){_0x507925=_0x507925[_0xdde2a7(0xf8)](new RegExp('^('+_0x3606b8+')','m'),(_0x60780f,_0x3e5322,_0x2c2239)=>{if(_0x2c2239===0x0||_0x507925[_0x2c2239-0x1]==='\x0a'&&_0x507925[_0x2c2239-0x2]==='\x0a')return _0x3e5322;return'\x0a'+_0x3e5322;});}return _0x507925;}export function parseDef(_0x4952d8){const _0x3080aa=a202_0x12a7,_0x303d5b=a202_0x20eba4[_0x3080aa(0xed)](_0x4952d8);if(!_0x303d5b[_0x3080aa(0x10d)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20name');if(!_0x303d5b[_0x3080aa(0xd9)])throw new Error(_0x3080aa(0xfe));if(!_0x303d5b['master'][_0x3080aa(0xc6)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master.database');if(!_0x303d5b['master']['table'])throw new Error(_0x3080aa(0xdc));return _0x303d5b['realtime']&&validateRealtimeSection(_0x303d5b[_0x3080aa(0xb2)]),_0x303d5b[_0x3080aa(0xfc)]&&validatePersonalizationServices(_0x303d5b[_0x3080aa(0xfc)]),_0x303d5b;}function validateRealtimeSection(_0x9dcf76){const _0x5c1231=a202_0x12a7,_0x1208e2=['single',_0x5c1231(0xc1),_0x5c1231(0xc0),_0x5c1231(0xa0),_0x5c1231(0xff),_0x5c1231(0x108)];_0x9dcf76[_0x5c1231(0x103)]&&Array[_0x5c1231(0xab)](_0x9dcf76[_0x5c1231(0x103)])&&_0x9dcf76['events'][_0x5c1231(0xbb)]((_0x10c672,_0x502ccb)=>{const _0x2ecb50=_0x5c1231;if(!_0x10c672[_0x2ecb50(0x10d)])throw new Error('realtime.events['+_0x502ccb+_0x2ecb50(0xc3));});_0x9dcf76[_0x5c1231(0xf0)]&&Array['isArray'](_0x9dcf76[_0x5c1231(0xf0)])&&_0x9dcf76[_0x5c1231(0xf0)][_0x5c1231(0xbb)]((_0x14f736,_0x488a35)=>{const _0x49fd47=_0x5c1231;if(!_0x14f736[_0x49fd47(0x10d)])throw new Error(_0x49fd47(0xb1)+_0x488a35+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x14f736['type']&&!_0x1208e2['includes'](_0x14f736[_0x49fd47(0xe9)]))throw new Error(_0x49fd47(0xb1)+_0x488a35+_0x49fd47(0xa7)+_0x14f736['name']+_0x49fd47(0xd6)+_0x14f736['type']+'\x27.\x20Must\x20be\x20one\x20of:\x20'+_0x1208e2[_0x49fd47(0x106)](',\x20'));});if(_0x9dcf76[_0x5c1231(0xf6)]){if(!_0x9dcf76[_0x5c1231(0xf6)][_0x5c1231(0xd3)])throw new Error(_0x5c1231(0xda));}}function a202_0x12a7(_0x2c94e0,_0x236e3b){_0x2c94e0=_0x2c94e0-0x9e;const _0x448862=a202_0x4488();let _0x12a7c2=_0x448862[_0x2c94e0];return _0x12a7c2;}function validatePersonalizationServices(_0x14b8d7){const _0x3b83bf=a202_0x12a7;if(!Array[_0x3b83bf(0xab)](_0x14b8d7))throw new Error('personalization_services\x20must\x20be\x20an\x20array');_0x14b8d7[_0x3b83bf(0xbb)]((_0x773b73,_0x1c4e30)=>{const _0x5a2cb7=_0x3b83bf;if(!_0x773b73['name'])throw new Error('personalization_services['+_0x1c4e30+_0x5a2cb7(0xc3));});}export function generateTemplate(_0x3f48e9,_0x4194ae,_0x5b800d){const _0x153a38=a202_0x12a7,_0x184453={'name':_0x3f48e9,'description':'Parent\x20segment\x20description','master':{'database':_0x4194ae,'table':_0x5b800d},'schedule':{'type':_0x153a38(0xae),'time':_0x153a38(0xd2),'timezone':'UTC'},'attributes':[{'name':_0x153a38(0xc2),'source':{'database':_0x4194ae,'table':_0x153a38(0xad)},'join':{'parent_key':'id','child_key':'customer_id'},'columns':[{'column':_0x153a38(0xa2),'label':_0x153a38(0x104),'type':_0x153a38(0xea)}]}],'behaviors':[{'name':'Example\x20Events','source':{'database':_0x4194ae,'table':_0x153a38(0xaa)},'join':{'parent_key':_0x153a38(0xb7),'child_key':'customer_id'},'all_columns':!![]}]};return serializeDef(_0x184453);}
|
|
1
|
+
(function(_0x31c373,_0x2b0611){const _0x4a3803=a202_0xb235,_0x1fb723=_0x31c373();while(!![]){try{const _0x2984df=parseInt(_0x4a3803(0xb0))/0x1*(-parseInt(_0x4a3803(0x80))/0x2)+parseInt(_0x4a3803(0x81))/0x3+parseInt(_0x4a3803(0xcc))/0x4+parseInt(_0x4a3803(0xa7))/0x5*(parseInt(_0x4a3803(0x92))/0x6)+-parseInt(_0x4a3803(0x88))/0x7+-parseInt(_0x4a3803(0xd5))/0x8+-parseInt(_0x4a3803(0xcb))/0x9*(parseInt(_0x4a3803(0xa9))/0xa);if(_0x2984df===_0x2b0611)break;else _0x1fb723['push'](_0x1fb723['shift']());}catch(_0x348a0c){_0x1fb723['push'](_0x1fb723['shift']());}}}(a202_0x20b8,0x4d023));import*as a202_0xd6c124 from'yaml';function formatScheduleTime(_0x295a1e){const _0x35d872=a202_0xb235;if(typeof _0x295a1e===_0x35d872(0x6c)){const _0x1f6e49=Math[_0x35d872(0xbb)](_0x295a1e);return String(_0x1f6e49)[_0x35d872(0xa4)](0x2,'0')+_0x35d872(0x73);}if(typeof _0x295a1e===_0x35d872(0xbd)){if(/^\d{2}:\d{2}:\d{2}$/[_0x35d872(0x99)](_0x295a1e))return _0x295a1e;if(/^\d{1,2}:\d{2}$/[_0x35d872(0x99)](_0x295a1e)){const [_0x5f13b4,_0x165ef3]=_0x295a1e[_0x35d872(0x6f)](':');return _0x5f13b4['padStart'](0x2,'0')+':'+_0x165ef3+_0x35d872(0xb2);}const _0x55ab93=parseInt(_0x295a1e,0xa);if(!isNaN(_0x55ab93)&&_0x295a1e[_0x35d872(0xce)](/^\d+$/))return String(_0x55ab93)[_0x35d872(0xa4)](0x2,'0')+_0x35d872(0x73);return _0x295a1e;}return String(_0x295a1e);}export function apiToDef(_0x38cf2e){const _0x2985ec=a202_0xb235,_0x4f4c16={'database':_0x38cf2e[_0x2985ec(0x85)]?.[_0x2985ec(0x84)]||'','table':_0x38cf2e[_0x2985ec(0x85)]?.['parentTableName']||''};_0x38cf2e[_0x2985ec(0xa8)]&&_0x38cf2e[_0x2985ec(0xa8)]['length']>0x0&&(_0x4f4c16[_0x2985ec(0xb8)]=_0x38cf2e[_0x2985ec(0xa8)][_0x2985ec(0x7e)](_0x84a607=>({'column':_0x84a607[_0x2985ec(0xba)],'values':_0x84a607['rightValues']})));let _0x5a6d27;_0x38cf2e[_0x2985ec(0xca)]&&_0x38cf2e[_0x2985ec(0xca)]!==_0x2985ec(0x89)&&(_0x5a6d27={'type':_0x38cf2e[_0x2985ec(0xca)]},_0x38cf2e[_0x2985ec(0x7f)]&&(_0x5a6d27['time']=formatScheduleTime(_0x38cf2e['scheduleOption'])),_0x38cf2e[_0x2985ec(0xc5)]&&(_0x5a6d27[_0x2985ec(0xc5)]=_0x38cf2e['timezone']));let _0x3378f5;(_0x38cf2e[_0x2985ec(0x82)]||_0x38cf2e[_0x2985ec(0xd4)]||_0x38cf2e[_0x2985ec(0x74)])&&(_0x3378f5={},_0x38cf2e[_0x2985ec(0x82)]&&(_0x3378f5[_0x2985ec(0x96)]=_0x38cf2e[_0x2985ec(0x82)]),_0x38cf2e['hivePoolName']&&(_0x3378f5[_0x2985ec(0xb6)]=_0x38cf2e['hivePoolName']),_0x38cf2e[_0x2985ec(0x74)]&&(_0x3378f5[_0x2985ec(0x95)]=_0x38cf2e['prestoPoolName']));const _0x3986d8=_0x38cf2e['attributes']&&_0x38cf2e[_0x2985ec(0x9f)][_0x2985ec(0x93)]>0x0?groupAttributesBySource(_0x38cf2e[_0x2985ec(0x9f)]):undefined,_0x1da6f1=_0x38cf2e[_0x2985ec(0xaf)]&&_0x38cf2e[_0x2985ec(0xaf)]['length']>0x0?_0x38cf2e['behaviors'][_0x2985ec(0x7e)](convertApiBehaviorToYaml):undefined;let _0x2fdd9a;_0x38cf2e[_0x2985ec(0xa6)]&&(_0x2fdd9a={'name':_0x38cf2e[_0x2985ec(0xa6)]['name'],'source':{'database':_0x38cf2e[_0x2985ec(0xa6)][_0x2985ec(0x84)],'table':_0x38cf2e[_0x2985ec(0xa6)]['parentTableName']},'join':{'parent_key':_0x38cf2e[_0x2985ec(0xa6)][_0x2985ec(0xa1)],'child_key':_0x38cf2e[_0x2985ec(0xa6)][_0x2985ec(0xb4)]}},_0x38cf2e[_0x2985ec(0xa6)][_0x2985ec(0xcf)]&&_0x38cf2e[_0x2985ec(0xa6)][_0x2985ec(0xcf)][_0x2985ec(0x93)]>0x0&&(_0x2fdd9a[_0x2985ec(0x9f)]=groupAttributesBySource(_0x38cf2e[_0x2985ec(0xa6)][_0x2985ec(0xcf)])),_0x38cf2e[_0x2985ec(0xa6)][_0x2985ec(0x8d)]&&_0x38cf2e[_0x2985ec(0xa6)][_0x2985ec(0x8d)][_0x2985ec(0x93)]>0x0&&(_0x2fdd9a[_0x2985ec(0xaf)]=_0x38cf2e[_0x2985ec(0xa6)]['customerGroupBehaviors']['map'](convertApiBehaviorToYaml)));const _0x39bb18={'name':_0x38cf2e[_0x2985ec(0xa2)],..._0x38cf2e[_0x2985ec(0x91)]&&{'description':_0x38cf2e['description']},'master':_0x4f4c16,..._0x5a6d27&&{'schedule':_0x5a6d27},..._0x3378f5&&{'engine':_0x3378f5},..._0x3986d8&&{'attributes':_0x3986d8},..._0x1da6f1&&{'behaviors':_0x1da6f1},..._0x2fdd9a&&{'customer_group':_0x2fdd9a}};return _0x39bb18;}function a202_0x20b8(){const _0x4079ac=['floor','single','string','Parent\x20segment\x20description','time','YAML\x20config\x20missing\x20required\x20field:\x20master','replace','get','customer_id','personalization_services','timezone','YAML\x20config\x20missing\x20required\x20field:\x20name','set','isArray','type','scheduleType','2511GObLRE','1547152FcVNYY','forEach','match','customerGroupAttributes','stringify','allColumns','YAML\x20config\x20missing\x20required\x20field:\x20master.database','ordered_set','hivePoolName','167264ROKbhy','daily','has','groupingName','03:00','number','Display\x20Name','source','split','behaviors:','all_columns','column',':00:00','prestoPoolName','schema','engine:','values','events_table','label','child_key','master:','personalization_services:','YAML\x20config\x20missing\x20required\x20field:\x20master.table','map','scheduleOption','2NnnDkV','1046094chJRMi','workflowHiveOnly','database','parentDatabaseName','master','attributes:','):\x20Invalid\x20type\x20\x27','659771WdVyjL','none','Example\x20Attributes','table','engine','customerGroupBehaviors','attribute_table','join','parent_key','description','350454NyWlZb','length','null','trino_pool','hive_only','customer_group',']:\x20Missing\x20required\x20field\x20\x27name\x27','test','events','defaultTimeFilterEnabled','columns','\x27.\x20Must\x20be\x20one\x20of:\x20','realtime','attributes','schedule:','foreignKey','name','column_name','padStart','Example\x20Events','customerGroup','25abBNvN','audienceFilters','11420GIxmsd','schedule','id_stitching','parentColumn','parse','push','behaviors','278325ZSZDaL','personalization_services[',':00','customer_group:','parentKey','default_time_filter','hive_pool','parentTableName','filters','list','columnName'];a202_0x20b8=function(){return _0x4079ac;};return a202_0x20b8();}function groupAttributesBySource(_0x55de12){const _0x2b2ab3=a202_0xb235,_0x3cfac4=new Map();for(const _0x4cc40b of _0x55de12){const _0x4ecd98=_0x4cc40b[_0x2b2ab3(0x84)]+'.'+_0x4cc40b[_0x2b2ab3(0xb7)]+'.'+_0x4cc40b[_0x2b2ab3(0xb4)]+'.'+_0x4cc40b['foreignKey'];!_0x3cfac4[_0x2b2ab3(0xd7)](_0x4ecd98)&&_0x3cfac4[_0x2b2ab3(0xc7)](_0x4ecd98,[]),_0x3cfac4[_0x2b2ab3(0xc2)](_0x4ecd98)[_0x2b2ab3(0xae)](_0x4cc40b);}const _0x1b8d27=[];for(const [,_0x4f67f9]of _0x3cfac4){const _0x91df49=_0x4f67f9[0x0],_0x34915c=_0x91df49[_0x2b2ab3(0xd8)]||_0x91df49[_0x2b2ab3(0xb7)];_0x1b8d27['push']({'name':_0x34915c,'source':{'database':_0x91df49[_0x2b2ab3(0x84)],'table':_0x91df49[_0x2b2ab3(0xb7)]},'join':{'parent_key':_0x91df49[_0x2b2ab3(0xa1)],'child_key':_0x91df49['parentKey']},'columns':_0x4f67f9[_0x2b2ab3(0x7e)](_0xbddd8d=>{const _0x18b5b4=_0x2b2ab3,_0x8c047e={'column':_0xbddd8d[_0x18b5b4(0xac)],'type':_0xbddd8d[_0x18b5b4(0xc9)]};return _0xbddd8d[_0x18b5b4(0xa2)]!==_0xbddd8d[_0x18b5b4(0xac)]&&(_0x8c047e[_0x18b5b4(0x79)]=_0xbddd8d[_0x18b5b4(0xa2)]),_0x8c047e;})});}return _0x1b8d27;}function convertApiBehaviorToYaml(_0xdc362){const _0x525d51=a202_0xb235,_0x3d2337={'name':_0xdc362[_0x525d51(0xa2)],'source':{'database':_0xdc362[_0x525d51(0x84)],'table':_0xdc362[_0x525d51(0xb7)]},'join':{'parent_key':_0xdc362[_0x525d51(0xa1)],'child_key':_0xdc362[_0x525d51(0xb4)]}};if(_0xdc362[_0x525d51(0xd1)])_0x3d2337[_0x525d51(0x71)]=!![];else _0xdc362[_0x525d51(0x75)]&&_0xdc362['schema'][_0x525d51(0x93)]>0x0&&(_0x3d2337[_0x525d51(0x9c)]=_0xdc362[_0x525d51(0x75)]['map'](_0x530553=>{const _0x169ac2=_0x525d51,_0x2e930a={'column':_0x530553[_0x169ac2(0xac)],'type':_0x530553[_0x169ac2(0xc9)]};return _0x530553[_0x169ac2(0xa2)]!==_0x530553[_0x169ac2(0xac)]&&(_0x2e930a[_0x169ac2(0x79)]=_0x530553['name']),_0x2e930a;}));return _0xdc362[_0x525d51(0x9b)]&&(_0x3d2337['default_time_filter']=_0xdc362['defaultTimeFilterEnabled']),_0xdc362['isRealtime']&&(_0x3d2337[_0x525d51(0x9e)]=_0xdc362['isRealtime']),_0x3d2337;}export function defToApi(_0x3d1f32){const _0x4421a3=a202_0xb235,_0x33c41d={'name':_0x3d1f32[_0x4421a3(0xa2)],'master':{'parentDatabaseName':_0x3d1f32[_0x4421a3(0x85)][_0x4421a3(0x83)],'parentTableName':_0x3d1f32[_0x4421a3(0x85)][_0x4421a3(0x8b)]}};_0x3d1f32[_0x4421a3(0x91)]&&(_0x33c41d[_0x4421a3(0x91)]=_0x3d1f32[_0x4421a3(0x91)]);_0x3d1f32[_0x4421a3(0x85)][_0x4421a3(0xb8)]&&_0x3d1f32[_0x4421a3(0x85)][_0x4421a3(0xb8)][_0x4421a3(0x93)]>0x0&&(_0x33c41d['audienceFilters']=_0x3d1f32[_0x4421a3(0x85)][_0x4421a3(0xb8)][_0x4421a3(0x7e)](_0x157047=>({'columnName':_0x157047[_0x4421a3(0x72)],'rightValues':_0x157047[_0x4421a3(0x77)]})));_0x3d1f32[_0x4421a3(0xaa)]&&(_0x33c41d[_0x4421a3(0xca)]=_0x3d1f32[_0x4421a3(0xaa)]['type'],_0x3d1f32['schedule'][_0x4421a3(0xbf)]&&(_0x33c41d[_0x4421a3(0x7f)]=_0x3d1f32['schedule'][_0x4421a3(0xbf)]),_0x3d1f32[_0x4421a3(0xaa)][_0x4421a3(0xc5)]&&(_0x33c41d['timezone']=_0x3d1f32[_0x4421a3(0xaa)][_0x4421a3(0xc5)]));_0x3d1f32[_0x4421a3(0x8c)]&&(_0x3d1f32['engine'][_0x4421a3(0x96)]!==undefined&&(_0x33c41d['workflowHiveOnly']=_0x3d1f32[_0x4421a3(0x8c)][_0x4421a3(0x96)]),_0x3d1f32[_0x4421a3(0x8c)]['hive_pool']!==undefined&&(_0x33c41d['hivePoolName']=_0x3d1f32[_0x4421a3(0x8c)][_0x4421a3(0xb6)]),_0x3d1f32[_0x4421a3(0x8c)][_0x4421a3(0x95)]!==undefined&&(_0x33c41d['prestoPoolName']=_0x3d1f32[_0x4421a3(0x8c)][_0x4421a3(0x95)]));_0x3d1f32['attributes']&&_0x3d1f32[_0x4421a3(0x9f)][_0x4421a3(0x93)]>0x0&&(_0x33c41d[_0x4421a3(0x9f)]=flattenAttributeGroups(_0x3d1f32[_0x4421a3(0x9f)]));_0x3d1f32['behaviors']&&_0x3d1f32[_0x4421a3(0xaf)][_0x4421a3(0x93)]>0x0&&(_0x33c41d[_0x4421a3(0xaf)]=_0x3d1f32[_0x4421a3(0xaf)]['map'](convertDefBehaviorToApi));if(_0x3d1f32[_0x4421a3(0x97)]){const _0x86f540=_0x3d1f32[_0x4421a3(0x97)];_0x33c41d['customerGroup']={'name':_0x86f540[_0x4421a3(0xa2)],'parentDatabaseName':_0x86f540[_0x4421a3(0x6e)][_0x4421a3(0x83)],'parentTableName':_0x86f540[_0x4421a3(0x6e)][_0x4421a3(0x8b)],'parentKey':_0x86f540[_0x4421a3(0x8f)][_0x4421a3(0x7a)],'foreignKey':_0x86f540['join'][_0x4421a3(0x90)]},_0x86f540[_0x4421a3(0x9f)]&&_0x86f540[_0x4421a3(0x9f)]['length']>0x0&&(_0x33c41d[_0x4421a3(0xa6)][_0x4421a3(0xcf)]=flattenAttributeGroups(_0x86f540[_0x4421a3(0x9f)])[_0x4421a3(0x7e)](_0x20d45e=>({'name':_0x20d45e[_0x4421a3(0xa2)],'type':_0x20d45e['type'],'parentDatabaseName':_0x20d45e[_0x4421a3(0x84)],'parentTableName':_0x20d45e[_0x4421a3(0xb7)],'parentColumn':_0x20d45e[_0x4421a3(0xac)],'parentKey':_0x20d45e[_0x4421a3(0xb4)],'foreignKey':_0x20d45e['foreignKey']}))),_0x86f540['behaviors']&&_0x86f540[_0x4421a3(0xaf)][_0x4421a3(0x93)]>0x0&&(_0x33c41d[_0x4421a3(0xa6)]['customerGroupBehaviors']=_0x86f540[_0x4421a3(0xaf)][_0x4421a3(0x7e)](_0x4fc06f=>({'name':_0x4fc06f[_0x4421a3(0xa2)],'parentDatabaseName':_0x4fc06f[_0x4421a3(0x6e)][_0x4421a3(0x83)],'parentTableName':_0x4fc06f['source'][_0x4421a3(0x8b)],'parentKey':_0x4fc06f[_0x4421a3(0x8f)][_0x4421a3(0x7a)],'foreignKey':_0x4fc06f['join'][_0x4421a3(0x90)],'allColumns':_0x4fc06f[_0x4421a3(0x71)],'schema':_0x4fc06f[_0x4421a3(0x9c)]?.['map'](_0x5a6c72=>({'name':_0x5a6c72[_0x4421a3(0x79)]||_0x5a6c72[_0x4421a3(0x72)],'type':_0x5a6c72[_0x4421a3(0xc9)],'parentColumn':_0x5a6c72[_0x4421a3(0x72)]}))})));}return _0x33c41d;}function flattenAttributeGroups(_0x53426d){const _0x18644a=a202_0xb235,_0x1d2314=[];for(const _0x5ce07d of _0x53426d){for(const _0x3d6936 of _0x5ce07d[_0x18644a(0x9c)]){_0x1d2314[_0x18644a(0xae)]({'name':_0x3d6936['label']||_0x3d6936[_0x18644a(0x72)],'type':_0x3d6936[_0x18644a(0xc9)],'parentDatabaseName':_0x5ce07d[_0x18644a(0x6e)][_0x18644a(0x83)],'parentTableName':_0x5ce07d[_0x18644a(0x6e)][_0x18644a(0x8b)],'parentColumn':_0x3d6936['column'],'parentKey':_0x5ce07d[_0x18644a(0x8f)][_0x18644a(0x7a)],'foreignKey':_0x5ce07d['join'][_0x18644a(0x90)],'groupingName':_0x5ce07d[_0x18644a(0xa2)]});}}return _0x1d2314;}function convertDefBehaviorToApi(_0xca964e){const _0x20da81=a202_0xb235,_0x257c25={'name':_0xca964e['name'],'parentDatabaseName':_0xca964e[_0x20da81(0x6e)]['database'],'parentTableName':_0xca964e['source'][_0x20da81(0x8b)],'parentKey':_0xca964e[_0x20da81(0x8f)][_0x20da81(0x7a)],'foreignKey':_0xca964e[_0x20da81(0x8f)]['parent_key']};if(_0xca964e[_0x20da81(0x71)])_0x257c25[_0x20da81(0xd1)]=!![];else _0xca964e[_0x20da81(0x9c)]&&_0xca964e['columns'][_0x20da81(0x93)]>0x0&&(_0x257c25[_0x20da81(0x75)]=_0xca964e['columns'][_0x20da81(0x7e)](_0x12673a=>({'name':_0x12673a['label']||_0x12673a[_0x20da81(0x72)],'type':_0x12673a[_0x20da81(0xc9)],'parentColumn':_0x12673a[_0x20da81(0x72)]})));return _0xca964e[_0x20da81(0xb5)]!==undefined&&(_0x257c25[_0x20da81(0x9b)]=_0xca964e[_0x20da81(0xb5)]),_0xca964e[_0x20da81(0x9e)]!==undefined&&(_0x257c25['isRealtime']=_0xca964e[_0x20da81(0x9e)]),_0x257c25;}export function serializeDef(_0x3a60c3){const _0x53bdea=a202_0xb235,_0x28418f=JSON[_0x53bdea(0xad)](JSON[_0x53bdea(0xd0)](_0x3a60c3)),_0x549fb7=a202_0xd6c124[_0x53bdea(0xd0)](_0x28418f,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x53bdea(0x94)}),_0x3af65c=[_0x53bdea(0x7b),_0x53bdea(0xa0),_0x53bdea(0x76),_0x53bdea(0x86),_0x53bdea(0x70),_0x53bdea(0xb3),'realtime:',_0x53bdea(0x7c)];let _0xb195fe=_0x549fb7;for(const _0x39cfd7 of _0x3af65c){_0xb195fe=_0xb195fe[_0x53bdea(0xc1)](new RegExp('^('+_0x39cfd7+')','m'),(_0xc93355,_0x3520de,_0xa532ba)=>{if(_0xa532ba===0x0||_0xb195fe[_0xa532ba-0x1]==='\x0a'&&_0xb195fe[_0xa532ba-0x2]==='\x0a')return _0x3520de;return'\x0a'+_0x3520de;});}return _0xb195fe;}function a202_0xb235(_0x5d8bb1,_0x4c1fa9){_0x5d8bb1=_0x5d8bb1-0x6c;const _0x20b801=a202_0x20b8();let _0xb235fd=_0x20b801[_0x5d8bb1];return _0xb235fd;}export function parseDef(_0x2cbbd1){const _0x5c288e=a202_0xb235,_0x887d48=a202_0xd6c124[_0x5c288e(0xad)](_0x2cbbd1);if(!_0x887d48[_0x5c288e(0xa2)])throw new Error(_0x5c288e(0xc6));if(!_0x887d48['master'])throw new Error(_0x5c288e(0xc0));if(!_0x887d48[_0x5c288e(0x85)]['database'])throw new Error(_0x5c288e(0xd2));if(!_0x887d48[_0x5c288e(0x85)][_0x5c288e(0x8b)])throw new Error(_0x5c288e(0x7d));return _0x887d48[_0x5c288e(0x9e)]&&validateRealtimeSection(_0x887d48[_0x5c288e(0x9e)]),_0x887d48[_0x5c288e(0xc4)]&&validatePersonalizationServices(_0x887d48[_0x5c288e(0xc4)]),_0x887d48;}function validateRealtimeSection(_0x590f7e){const _0x13eb68=a202_0xb235,_0x401adc=[_0x13eb68(0xbc),'counter',_0x13eb68(0xc7),_0x13eb68(0xd3),_0x13eb68(0xb9),'imported_batch'];_0x590f7e[_0x13eb68(0x9a)]&&Array[_0x13eb68(0xc8)](_0x590f7e[_0x13eb68(0x9a)])&&_0x590f7e[_0x13eb68(0x9a)]['forEach']((_0x4ab80e,_0x2c2a6e)=>{const _0x3bb82a=_0x13eb68;if(!_0x4ab80e[_0x3bb82a(0xa2)])throw new Error('realtime.events['+_0x2c2a6e+_0x3bb82a(0x98));});_0x590f7e[_0x13eb68(0x9f)]&&Array['isArray'](_0x590f7e[_0x13eb68(0x9f)])&&_0x590f7e['attributes'][_0x13eb68(0xcd)]((_0x219a84,_0x2e2578)=>{const _0x9b229f=_0x13eb68;if(!_0x219a84['name'])throw new Error('realtime.attributes['+_0x2e2578+_0x9b229f(0x98));if(_0x219a84[_0x9b229f(0xc9)]&&!_0x401adc['includes'](_0x219a84[_0x9b229f(0xc9)]))throw new Error('realtime.attributes['+_0x2e2578+']\x20('+_0x219a84[_0x9b229f(0xa2)]+_0x9b229f(0x87)+_0x219a84['type']+_0x9b229f(0x9d)+_0x401adc[_0x9b229f(0x8f)](',\x20'));});if(_0x590f7e[_0x13eb68(0xab)]){if(!_0x590f7e[_0x13eb68(0xab)]['primary_key'])throw new Error('realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27');}}function validatePersonalizationServices(_0x411fa9){const _0x54989e=a202_0xb235;if(!Array[_0x54989e(0xc8)](_0x411fa9))throw new Error('personalization_services\x20must\x20be\x20an\x20array');_0x411fa9[_0x54989e(0xcd)]((_0x2a55a2,_0x5b1ae1)=>{const _0x399ea3=_0x54989e;if(!_0x2a55a2[_0x399ea3(0xa2)])throw new Error(_0x399ea3(0xb1)+_0x5b1ae1+_0x399ea3(0x98));});}export function generateTemplate(_0x4d61d6,_0x3830fa,_0xc042b3){const _0xa85720=a202_0xb235,_0x445848={'name':_0x4d61d6,'description':_0xa85720(0xbe),'master':{'database':_0x3830fa,'table':_0xc042b3},'schedule':{'type':_0xa85720(0xd6),'time':_0xa85720(0xd9),'timezone':'UTC'},'attributes':[{'name':_0xa85720(0x8a),'source':{'database':_0x3830fa,'table':_0xa85720(0x8e)},'join':{'parent_key':'id','child_key':'customer_id'},'columns':[{'column':_0xa85720(0xa3),'label':_0xa85720(0x6d),'type':'string'}]}],'behaviors':[{'name':_0xa85720(0xa5),'source':{'database':_0x3830fa,'table':_0xa85720(0x78)},'join':{'parent_key':'user_id','child_key':_0xa85720(0xc3)},'all_columns':!![]}]};return serializeDef(_0x445848);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x4792ae,_0x52c314){const _0x16cbef=a203_0x1014,_0x4636a3=_0x4792ae();while(!![]){try{const _0x5895c0=parseInt(_0x16cbef(0x1cf))/0x1*(parseInt(_0x16cbef(0x20b))/0x2)+parseInt(_0x16cbef(0x20d))/0x3*(parseInt(_0x16cbef(0x20c))/0x4)+-parseInt(_0x16cbef(0x1e6))/0x5+-parseInt(_0x16cbef(0x1dd))/0x6*(-parseInt(_0x16cbef(0x1d4))/0x7)+-parseInt(_0x16cbef(0x1fa))/0x8+parseInt(_0x16cbef(0x1da))/0x9+-parseInt(_0x16cbef(0x1f8))/0xa*(parseInt(_0x16cbef(0x20e))/0xb);if(_0x5895c0===_0x52c314)break;else _0x4636a3['push'](_0x4636a3['shift']());}catch(_0x19f939){_0x4636a3['push'](_0x4636a3['shift']());}}}(a203_0x22e8,0x863b1));import a203_0x4fd1f9 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';function a203_0x1014(_0xb08239,_0x12ddb9){_0xb08239=_0xb08239-0x1cc;const _0x22e89c=a203_0x22e8();let _0x1014d5=_0x22e89c[_0xb08239];return _0x1014d5;}import{journeyResponseToDef,toYamlString as a203_0x351ac0,normalizeJourneyDef,parseYamlString as a203_0x48f4ce}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(_0x4d68d2,_0x51450e,_0x525d94){const _0x37cd6c=a203_0x1014,_0x1f23da=a203_0x4fd1f9['relative'](_0x525d94,_0x4d68d2);if(existsSync(_0x4d68d2)){const _0x6e4785=readFileSync(_0x4d68d2,_0x37cd6c(0x204)),_0x524a90=generateDiff(_0x6e4785,_0x51450e),_0x462b0c=hasChanges(_0x524a90);return{'relativePath':_0x1f23da,'absolutePath':_0x4d68d2,'content':_0x51450e,'isNew':![],'hasChanges':_0x462b0c,'diff':_0x462b0c?formatDiffWithColors(_0x524a90):undefined};}return{'relativePath':_0x1f23da,'absolutePath':_0x4d68d2,'content':_0x51450e,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x704177,_0x384709,_0x604802){const _0x16dce8=a203_0x1014,_0x3f2717=_0x704177+':'+_0x384709,_0x3784f9=_0x604802[_0x16dce8(0x1e2)](_0x3f2717)||0x0;_0x604802[_0x16dce8(0x1e5)](_0x3f2717,_0x3784f9+0x1);if(_0x3784f9===0x0)return _0x384709;return _0x384709+'_'+(_0x3784f9+0x1);}export async function pullSegments(_0x2312cc,_0x17a335,_0x40cfde={}){const _0x229d07=a203_0x1014,{targetDir:_0x56414a,progress:_0x1fe5d9}=_0x40cfde;_0x1fe5d9?.[_0x229d07(0x1fd)](_0x229d07(0x1ef));const _0x456b29=await _0x2312cc['segment'][_0x229d07(0x201)](_0x17a335);_0x1fe5d9?.[_0x229d07(0x1fd)](_0x229d07(0x1d2));const _0x39f9d6=await _0x2312cc['segment']['getParent'](_0x456b29),_0x13106e=_0x39f9d6[_0x229d07(0x1e4)][_0x229d07(0x208)];_0x1fe5d9?.[_0x229d07(0x1fd)](_0x229d07(0x1ed));const [_0x338b7b,_0xed4e2a,_0x2ed9a5]=await Promise['all']([_0x2312cc[_0x229d07(0x1e0)][_0x229d07(0x1db)](_0x456b29),_0x2312cc[_0x229d07(0x1e0)][_0x229d07(0x1df)](_0x456b29),_0x2312cc[_0x229d07(0x217)][_0x229d07(0x1fc)](_0x456b29,{'includeAllVersions':!![]})]),{journeys:_0x462017,activationStepsById:_0x4db750}=_0x2ed9a5,_0x223329=new Map();for(const _0xee3a63 of _0x462017){_0x223329['set'](_0xee3a63['id'],_0xee3a63);}const _0xfce3a3=_0x462017['map'](_0x5de00b=>({'id':_0x5de00b['id'],'name':_0x5de00b[_0x229d07(0x1e4)]['name'],'journeyBundleName':_0x5de00b['attributes'][_0x229d07(0x1e1)]||'','journeyBundleId':_0x5de00b[_0x229d07(0x1e4)]['journeyBundleId']||'','versionNumber':_0x5de00b[_0x229d07(0x1e4)][_0x229d07(0x20a)],'description':_0x5de00b[_0x229d07(0x1e4)]['description'],'state':_0x5de00b[_0x229d07(0x1e4)]['state'],'paused':_0x5de00b['attributes']['paused'],'audienceId':_0x5de00b[_0x229d07(0x1e4)][_0x229d07(0x1d8)],'folderId':_0x5de00b[_0x229d07(0x1e3)]?.[_0x229d07(0x211)]?.[_0x229d07(0x1e7)]?.['id'],'createdAt':_0x5de00b[_0x229d07(0x1e4)][_0x229d07(0x1ce)],'updatedAt':_0x5de00b[_0x229d07(0x1e4)][_0x229d07(0x1ea)]})),_0x593959=buildFolderIdToPathMap(_0xed4e2a),_0x194221=_0x56414a||_0x229d07(0x1e8)+sanitizeFileName(_0x13106e);_0x1fe5d9?.[_0x229d07(0x1fd)](_0x229d07(0x1cd));const _0x80f6ef=new Map();await batchAsync(_0x338b7b,async _0x5d4523=>{const _0x52b519=_0x229d07,_0x1fe043=await _0x2312cc['segment'][_0x52b519(0x1f1)](_0x456b29,_0x5d4523['id']);_0x80f6ef['set'](_0x5d4523['id'],_0x1fe043);}),_0x1fe5d9?.[_0x229d07(0x1fd)](_0x229d07(0x1d9));const [_0x23d672,_0x23f996]=await Promise[_0x229d07(0x1d3)]([_0x2312cc[_0x229d07(0x1cc)]['buildIdToEmailMap'](),_0x2312cc[_0x229d07(0x1d6)][_0x229d07(0x212)]()]),_0x380a4f=[],_0x46c21f=new Map(),_0x417897=a203_0x4fd1f9['join'](_0x194221,_0x229d07(0x207)),_0x1f1288=createTdxConfigContent(_0x13106e);_0x380a4f[_0x229d07(0x1fe)](prepareFile(_0x417897,_0x1f1288,_0x194221));const _0x28eb47=new Map();for(const _0xd61074 of _0x338b7b){_0x28eb47[_0x229d07(0x1e5)](_0xd61074['id'],_0xd61074);}let _0x480c7b=_0x338b7b;if(_0x40cfde[_0x229d07(0x1f3)]){const _0xc4f1c=_0x338b7b[_0x229d07(0x1f9)](_0x1ab2c6=>_0x1ab2c6[_0x229d07(0x208)][_0x229d07(0x202)]()===_0x40cfde[_0x229d07(0x1f3)][_0x229d07(0x202)]());_0xc4f1c[_0x229d07(0x1f5)]>0x0&&(_0x480c7b=_0xc4f1c);}_0x1fe5d9?.[_0x229d07(0x1fd)](_0x229d07(0x210));for(const _0x105a5b of _0x480c7b){if(_0x105a5b[_0x229d07(0x1ec)]===SEGMENT_KIND_JOURNEY)continue;const _0x11188e=_0x105a5b[_0x229d07(0x214)]?_0x593959[_0x229d07(0x1e2)](_0x105a5b[_0x229d07(0x214)])||'':'',_0xf7099b=_0x80f6ef[_0x229d07(0x1e2)](_0x105a5b['id'])||[],_0x3d212a=segmentWithActivationsToYaml(_0x105a5b,_0xf7099b,undefined,_0x23d672,_0x23f996),_0x53f3bc=_0x11188e?a203_0x4fd1f9[_0x229d07(0x1f7)](_0x194221,_0x11188e):_0x194221,_0xeff035=sanitizeFileName(_0x105a5b[_0x229d07(0x208)]),_0x30cd27=getUniqueFileName(_0x53f3bc,_0xeff035,_0x46c21f),_0x286e9b=a203_0x4fd1f9['join'](_0x53f3bc,_0x30cd27+_0x229d07(0x1eb)),_0x10e095=segmentToYamlString(_0x3d212a);_0x380a4f['push'](prepareFile(_0x286e9b,_0x10e095,_0x194221));}const _0x1c0306=new Map();for(const _0x505a9e of _0xfce3a3){const _0x299634=_0x505a9e[_0x229d07(0x213)];!_0x1c0306['has'](_0x299634)&&_0x1c0306[_0x229d07(0x1e5)](_0x299634,[]),_0x1c0306[_0x229d07(0x1e2)](_0x299634)[_0x229d07(0x1fe)](_0x505a9e);}for(const _0x3bae54 of _0x1c0306[_0x229d07(0x205)]()){_0x3bae54[_0x229d07(0x216)]((_0x2e6bde,_0x2c3048)=>(_0x2e6bde[_0x229d07(0x20a)]||0x0)-(_0x2c3048[_0x229d07(0x20a)]||0x0));}if(_0x40cfde['targetResourceName']){const _0x4b055b=new Map();for(const [_0x322a15,_0x2e0b81]of _0x1c0306){const _0x3f16b5=_0x2e0b81[0x0][_0x229d07(0x1e1)];if(_0x3f16b5[_0x229d07(0x202)]()===_0x40cfde[_0x229d07(0x1f3)]['toLowerCase']()){_0x4b055b[_0x229d07(0x1e5)](_0x322a15,_0x2e0b81);break;}}_0x1c0306[_0x229d07(0x203)]();for(const [_0x3da46c,_0x19edd4]of _0x4b055b){_0x1c0306['set'](_0x3da46c,_0x19edd4);}}if(_0x1c0306[_0x229d07(0x1d0)]>0x0){_0x1fe5d9?.[_0x229d07(0x1fd)](_0x229d07(0x1ee));const _0x9be5e0=Array['from'](_0x1c0306[_0x229d07(0x205)]()),_0x4795e3=0x5,{createYamlContext:_0x33fe46}=createYamlContextForBundle(_0x2312cc,_0x28eb47,_0x23d672,_0x23f996,_0x4db750,_0x223329);for(let _0x383e6d=0x0;_0x383e6d<_0x9be5e0['length'];_0x383e6d+=_0x4795e3){const _0x430467=_0x9be5e0[_0x229d07(0x206)](_0x383e6d,_0x383e6d+_0x4795e3),_0x5c34c2=await Promise[_0x229d07(0x1d3)](_0x430467[_0x229d07(0x1f6)](async _0x332ee5=>{const _0x10d501=_0x229d07,_0x356c40=_0x332ee5[0x0],_0x3f486a=_0x356c40[_0x10d501(0x1e1)];_0x1fe5d9?.[_0x10d501(0x1fd)]('Processing\x20journey:\x20'+_0x3f486a);const _0x1ba559=_0x356c40[_0x10d501(0x209)]?_0x593959['get'](_0x356c40[_0x10d501(0x209)])||'':'',_0x529512=_0x1ba559?a203_0x4fd1f9[_0x10d501(0x1f7)](_0x194221,_0x1ba559):_0x194221,_0x34c695=sanitizeFileName(_0x3f486a),_0x156d3c=a203_0x4fd1f9[_0x10d501(0x1f7)](_0x529512,_0x34c695+_0x10d501(0x1eb));let _0x5271c0;if(existsSync(_0x156d3c))try{const _0xface75=readFileSync(_0x156d3c,'utf-8'),_0x2d8063=a203_0x48f4ce(_0xface75);_0x5271c0=buildLocalRuleToNameMappingFromJourney(_0x2d8063);}catch{}const _0x424007=[];for(const _0x8c860e of _0x332ee5){const _0xcae0ed=_0x223329['get'](_0x8c860e['id']);if(!_0xcae0ed){_0x1fe5d9?.['update'](_0x10d501(0x1e9)+_0x8c860e['id']+_0x10d501(0x1f4));continue;}const _0xb8a6c8=_0xcae0ed[_0x10d501(0x1e4)]?.[_0x10d501(0x1d8)],_0x1ebcb4=_0x33fe46(_0x8c860e['id'],_0xb8a6c8),_0x1b72b4=await journeyResponseToDef(_0xcae0ed,_0x1ebcb4);_0x424007[_0x10d501(0x1fe)]({'item':_0x8c860e,'yaml':_0x1b72b4});}const _0x24438b=await _0x2312cc['journey'][_0x10d501(0x215)](_0x356c40[_0x10d501(0x213)]),_0x3e9d9b=buildMergedJourneyDef(_0x424007,_0x5271c0,_0x24438b);return{'bundleName':_0x3f486a,'folderPath':_0x1ba559,'finalYaml':_0x3e9d9b};}));for(const {bundleName:_0x97b147,folderPath:_0x3a20dc,finalYaml:_0x2defe4}of _0x5c34c2){const _0x4135be=normalizeJourneyDef(_0x2defe4),_0x47c26a=a203_0x351ac0(_0x4135be),_0x221c52=_0x3a20dc?a203_0x4fd1f9[_0x229d07(0x1f7)](_0x194221,_0x3a20dc):_0x194221,_0x3d07a6=sanitizeFileName(_0x97b147),_0x46511a=getUniqueFileName(_0x221c52,_0x3d07a6,_0x46c21f),_0x480b54=a203_0x4fd1f9[_0x229d07(0x1f7)](_0x221c52,_0x46511a+_0x229d07(0x1eb));_0x380a4f['push'](prepareFile(_0x480b54,_0x47c26a,_0x194221));}}}const _0x487047=Array[_0x229d07(0x1dc)](_0x80f6ef[_0x229d07(0x205)]())[_0x229d07(0x200)]((_0x5d78e5,_0x3b87b4)=>_0x5d78e5+_0x3b87b4['length'],0x0),_0x253076=_0x480c7b[_0x229d07(0x1f9)](_0xe79f69=>_0xe79f69['kind']!==SEGMENT_KIND_JOURNEY),_0x36427e=_0x380a4f[_0x229d07(0x1f9)](_0x1e6d53=>_0x1e6d53[_0x229d07(0x1d7)])[_0x229d07(0x1f5)],_0x1551be=_0x380a4f[_0x229d07(0x1f9)](_0x572836=>!_0x572836[_0x229d07(0x1d7)]&&_0x572836[_0x229d07(0x1ff)])[_0x229d07(0x1f5)],_0x29ef2d=_0x380a4f[_0x229d07(0x1f9)](_0x586a7b=>!_0x586a7b['isNew']&&!_0x586a7b['hasChanges'])[_0x229d07(0x1f5)],_0x566d17=Array[_0x229d07(0x1dc)](_0x1c0306['values']())[_0x229d07(0x200)]((_0x520d7c,_0x39bc49)=>_0x520d7c+_0x39bc49[_0x229d07(0x1f5)],0x0);return{'parentName':_0x13106e,'parentId':_0x456b29,'targetDir':_0x194221,'files':_0x380a4f,'counts':{'segments':_0x253076[_0x229d07(0x1f5)],'journeys':_0x1c0306[_0x229d07(0x1d0)],'journeyVersions':_0x566d17,'activations':_0x487047},'newFiles':_0x36427e,'changedFiles':_0x1551be,'unchangedFiles':_0x29ef2d};}function createYamlContextForBundle(_0x1f2e59,_0x2c5c20,_0x36ba2c,_0x196a82,_0x70a69e,_0x4bdaac){const _0x56504f=new Set(),_0x36980c=new Map(),_0x3eccb4=new Map(),_0x126bb0=createJumpTargetCache(),_0x367312=async(_0x7a793,_0x3e6c76)=>{const _0x576734=a203_0x1014,_0x100027=_0x36980c[_0x576734(0x1e2)](_0x7a793);if(_0x100027!==undefined)return _0x100027;if(!_0x3e6c76)return _0x7a793;try{let _0x6ea2b0=_0x2c5c20[_0x576734(0x1e2)](_0x7a793);!_0x6ea2b0&&(_0x6ea2b0=await _0x1f2e59[_0x576734(0x1e0)][_0x576734(0x1d1)](_0x3e6c76,_0x7a793),_0x2c5c20[_0x576734(0x1e5)](_0x7a793,_0x6ea2b0));const _0x455fdb=generateJourneyLocalName(_0x6ea2b0[_0x576734(0x208)]),_0x9974a9=_0x6ea2b0[_0x576734(0x1ec)]===SEGMENT_KIND_JOURNEY&&_0x455fdb!==undefined;if(_0x9974a9&&_0x455fdb){let _0x44a526=_0x455fdb,_0x1e1ee5=0x2;while(_0x56504f[_0x576734(0x1de)](_0x44a526)){_0x44a526=_0x455fdb+'_'+_0x1e1ee5,_0x1e1ee5++;}return _0x56504f[_0x576734(0x1fb)](_0x44a526),_0x36980c[_0x576734(0x1e5)](_0x7a793,_0x44a526),_0x44a526;}return _0x6ea2b0[_0x576734(0x208)];}catch{return _0x7a793;}},_0xd7f340=(_0x1711e,_0x43768d)=>({'resolveSegment':async _0x15a050=>{const _0x123cbc=a203_0x1014,_0x47a23=_0x36980c['get'](_0x15a050);if(_0x47a23!==undefined)return{'name':_0x47a23,'isJourneyLocal':!![]};if(!_0x43768d)return{'name':_0x15a050,'isJourneyLocal':![]};try{let _0x2ebdd2=_0x2c5c20[_0x123cbc(0x1e2)](_0x15a050);!_0x2ebdd2&&(_0x2ebdd2=await _0x1f2e59[_0x123cbc(0x1e0)]['getSegment'](_0x43768d,_0x15a050),_0x2c5c20[_0x123cbc(0x1e5)](_0x15a050,_0x2ebdd2));const _0x22d4b=generateJourneyLocalName(_0x2ebdd2[_0x123cbc(0x208)]),_0x5d1399=_0x2ebdd2[_0x123cbc(0x1ec)]===SEGMENT_KIND_JOURNEY&&_0x22d4b!==undefined;if(_0x5d1399&&!_0x2ebdd2['rule']&&_0x43768d)try{const _0x49846a=await _0x1f2e59[_0x123cbc(0x1e0)][_0x123cbc(0x1d1)](_0x43768d,_0x15a050);_0x2c5c20[_0x123cbc(0x1e5)](_0x15a050,_0x49846a),_0x2ebdd2=_0x49846a;}catch{}const _0x267cd2=await _0x367312(_0x15a050,_0x43768d);let _0x3d9646;if(_0x5d1399&&_0x2ebdd2['rule']){const _0x1e331f=await segmentResponseToDef(_0x2ebdd2,{'resolveSegmentName':_0x26215d=>_0x367312(_0x26215d,_0x43768d)});_0x3d9646={'description':_0x2ebdd2['description'],'rule':_0x1e331f[_0x123cbc(0x1f2)]};}return{'name':_0x267cd2,'isJourneyLocal':_0x5d1399,'definition':_0x3d9646};}catch{return{'name':_0x15a050,'isJourneyLocal':![]};}},'resolveActivation':async _0x5316de=>{const _0x50e052=a203_0x1014,_0x3356f5=_0x3eccb4['get'](_0x5316de);if(_0x3356f5!==undefined)return{'name':_0x3356f5,'isJourneyLocal':!![]};try{let _0x1f9c85=_0x70a69e[_0x50e052(0x1e2)](_0x5316de);!_0x1f9c85&&(_0x1f9c85=await _0x1f2e59['journey'][_0x50e052(0x1f0)](_0x1711e,_0x5316de));const _0x38849f=_0x1f9c85[_0x50e052(0x1e4)][_0x50e052(0x20f)][_0x50e052(0x208)]||_0x5316de,_0x2c67e7=sanitizeYamlKey(_0x38849f)||_0x50e052(0x1d5)+_0x5316de,_0x1756e2=_0x2c67e7;_0x3eccb4[_0x50e052(0x1e5)](_0x5316de,_0x1756e2);const _0x1c7000=journeyActivationStepToYaml(_0x1f9c85,_0x36ba2c,_0x196a82);return{'name':_0x1756e2,'isJourneyLocal':!![],'definition':_0x1c7000};}catch{return{'name':_0x5316de,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x3d0fc6,_0xcc57e7)=>resolveJumpTarget(_0x3d0fc6,_0xcc57e7,_0x126bb0,async _0x2dbdb0=>{const _0x2242df=a203_0x1014,_0x172f5b=_0x4bdaac[_0x2242df(0x1e2)](_0x2dbdb0);if(_0x172f5b)return _0x172f5b;return _0x1f2e59['journey']['getJourney'](_0x2dbdb0);})});return{'createYamlContext':_0xd7f340};}function a203_0x22e8(){const _0xbcd8b2=['data','segments/','Warning:\x20Journey\x20','updatedAt','.yml','kind','Fetching\x20segments,\x20folders,\x20and\x20journeys','Processing\x20journeys','Resolving\x20parent\x20segment','getActivation','listActivations','rule','targetResourceName','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','length','map','join','6095410UrpmHn','filter','1696264JMVtPQ','add','listJourneysWithDetailsFromParentSegment','update','push','hasChanges','reduce','resolveParentId','toLowerCase','clear','utf-8','values','slice','tdx.json','name','folderId','versionNumber','922YRazvC','4kitJxZ','1827351SKnwJo','11QEwFDR','activationParams','Processing\x20segments','parentFolder','buildIdToNameMap','journeyBundleId','segmentFolderId','getLatestJourneyId','sort','journey','user','Fetching\x20activations','createdAt','859cWQrBX','size','getSegment','Fetching\x20parent\x20segment\x20info','all','634739TJxozY','activation_','connection','isNew','audienceId','Fetching\x20users\x20and\x20connections','4646016FFjGyD','listSegments','from','30nnPbIu','has','listFolders','segment','journeyBundleName','get','relationships','attributes','set','3016710GfxPVn'];a203_0x22e8=function(){return _0xbcd8b2;};return a203_0x22e8();}
|
|
1
|
+
(function(_0x875d50,_0x22ba96){const _0x1960fe=a203_0x273d,_0x1c7dff=_0x875d50();while(!![]){try{const _0x4bfe65=parseInt(_0x1960fe(0x160))/0x1*(-parseInt(_0x1960fe(0x164))/0x2)+-parseInt(_0x1960fe(0x1a5))/0x3+-parseInt(_0x1960fe(0x1a1))/0x4+parseInt(_0x1960fe(0x1a4))/0x5+parseInt(_0x1960fe(0x18a))/0x6*(-parseInt(_0x1960fe(0x197))/0x7)+parseInt(_0x1960fe(0x175))/0x8+-parseInt(_0x1960fe(0x183))/0x9*(-parseInt(_0x1960fe(0x176))/0xa);if(_0x4bfe65===_0x22ba96)break;else _0x1c7dff['push'](_0x1c7dff['shift']());}catch(_0x3beab5){_0x1c7dff['push'](_0x1c7dff['shift']());}}}(a203_0x4c2a,0xc8780));import a203_0x28fc27 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';function a203_0x4c2a(){const _0xfd671e=['set','Processing\x20journeys','journeyBundleName','reduce','from','hasChanges','45xVSgdx','push','relationships','Processing\x20journey:\x20','.yml','all','connection','6ydgqck','parentFolder','add','getJourney','description','getLatestJourneyId','slice','sort','activationParams','audienceId','utf-8','segment','join','5530931KymPbr','folderId','versionNumber','values','buildIdToNameMap','Fetching\x20parent\x20segment\x20info','getParent','get','toLowerCase','getActivation','1763888Jjdhrk','attributes','user','4757995TBbNCI','3590736RUOheT','length','Fetching\x20activations','clear','state','846243DlHTLo','update','data','activation_','2vvWhWN','Fetching\x20users\x20and\x20connections','filter','listFolders','resolveParentId','size','has','Warning:\x20Journey\x20','targetResourceName','rule','segmentFolderId','journey','tdx.json','Fetching\x20segments,\x20folders,\x20and\x20journeys','listActivations','isNew','kind','5618528KZAFiy','4882930owVDWQ','Resolving\x20parent\x20segment','map','journeyBundleId','name','getSegment','listJourneysWithDetailsFromParentSegment'];a203_0x4c2a=function(){return _0xfd671e;};return a203_0x4c2a();}import{batchAsync}from'../../utils/async.js';function a203_0x273d(_0x5eb611,_0x1814f8){_0x5eb611=_0x5eb611-0x15f;const _0x4c2a3e=a203_0x4c2a();let _0x273df1=_0x4c2a3e[_0x5eb611];return _0x273df1;}import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a203_0x53f81d,normalizeJourneyDef,parseYamlString as a203_0x1e714b}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(_0x3579e0,_0x12aa44,_0x2ef601){const _0x21dc66=a203_0x28fc27['relative'](_0x2ef601,_0x3579e0);if(existsSync(_0x3579e0)){const _0x145049=readFileSync(_0x3579e0,'utf-8'),_0x4168d6=generateDiff(_0x145049,_0x12aa44),_0x287337=hasChanges(_0x4168d6);return{'relativePath':_0x21dc66,'absolutePath':_0x3579e0,'content':_0x12aa44,'isNew':![],'hasChanges':_0x287337,'diff':_0x287337?formatDiffWithColors(_0x4168d6):undefined};}return{'relativePath':_0x21dc66,'absolutePath':_0x3579e0,'content':_0x12aa44,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x2706d0,_0xfc7b01,_0x1293de){const _0x195eb2=a203_0x273d,_0x236fb4=_0x2706d0+':'+_0xfc7b01,_0x538f34=_0x1293de['get'](_0x236fb4)||0x0;_0x1293de[_0x195eb2(0x17d)](_0x236fb4,_0x538f34+0x1);if(_0x538f34===0x0)return _0xfc7b01;return _0xfc7b01+'_'+(_0x538f34+0x1);}export async function pullSegments(_0x22bcca,_0x9ae90c,_0x2e8ab9={}){const _0x387682=a203_0x273d,{targetDir:_0x52877e,progress:_0x516353}=_0x2e8ab9;_0x516353?.[_0x387682(0x161)](_0x387682(0x177));const _0xede1f=await _0x22bcca[_0x387682(0x195)][_0x387682(0x168)](_0x9ae90c);_0x516353?.['update'](_0x387682(0x19c));const _0x546ae1=await _0x22bcca[_0x387682(0x195)][_0x387682(0x19d)](_0xede1f),_0x57187a=_0x546ae1['attributes'][_0x387682(0x17a)];_0x516353?.[_0x387682(0x161)](_0x387682(0x171));const [_0x49d08b,_0xdd6d0a,_0x207dfe]=await Promise['all']([_0x22bcca[_0x387682(0x195)]['listSegments'](_0xede1f),_0x22bcca[_0x387682(0x195)][_0x387682(0x167)](_0xede1f),_0x22bcca['journey'][_0x387682(0x17c)](_0xede1f,{'includeAllVersions':!![]})]),{journeys:_0x23207d,activationStepsById:_0x1ab82f}=_0x207dfe,_0x4648b2=new Map();for(const _0xb3b91 of _0x23207d){_0x4648b2[_0x387682(0x17d)](_0xb3b91['id'],_0xb3b91);}const _0x3b5a2c=_0x23207d[_0x387682(0x178)](_0x221156=>({'id':_0x221156['id'],'name':_0x221156[_0x387682(0x1a2)][_0x387682(0x17a)],'journeyBundleName':_0x221156[_0x387682(0x1a2)][_0x387682(0x17f)]||'','journeyBundleId':_0x221156['attributes'][_0x387682(0x179)]||'','versionNumber':_0x221156[_0x387682(0x1a2)][_0x387682(0x199)],'description':_0x221156[_0x387682(0x1a2)][_0x387682(0x18e)],'state':_0x221156[_0x387682(0x1a2)][_0x387682(0x15f)],'paused':_0x221156[_0x387682(0x1a2)]['paused'],'audienceId':_0x221156[_0x387682(0x1a2)]['audienceId'],'folderId':_0x221156[_0x387682(0x185)]?.[_0x387682(0x18b)]?.[_0x387682(0x162)]?.['id'],'createdAt':_0x221156['attributes']['createdAt'],'updatedAt':_0x221156['attributes']['updatedAt']})),_0x4ae38d=buildFolderIdToPathMap(_0xdd6d0a),_0x192879=_0x52877e||'segments/'+sanitizeFileName(_0x57187a);_0x516353?.[_0x387682(0x161)](_0x387682(0x1a7));const _0x3e8628=new Map();await batchAsync(_0x49d08b,async _0x17c491=>{const _0x51dcaa=_0x387682,_0x7fcae3=await _0x22bcca[_0x51dcaa(0x195)][_0x51dcaa(0x172)](_0xede1f,_0x17c491['id']);_0x3e8628[_0x51dcaa(0x17d)](_0x17c491['id'],_0x7fcae3);}),_0x516353?.[_0x387682(0x161)](_0x387682(0x165));const [_0x56927c,_0x13f9ba]=await Promise[_0x387682(0x188)]([_0x22bcca[_0x387682(0x1a3)]['buildIdToEmailMap'](),_0x22bcca[_0x387682(0x189)][_0x387682(0x19b)]()]),_0xbc472c=[],_0x190444=new Map(),_0x3dd092=a203_0x28fc27['join'](_0x192879,_0x387682(0x170)),_0x5be217=createTdxConfigContent(_0x57187a);_0xbc472c[_0x387682(0x184)](prepareFile(_0x3dd092,_0x5be217,_0x192879));const _0x6509a4=new Map();for(const _0x1d966b of _0x49d08b){_0x6509a4[_0x387682(0x17d)](_0x1d966b['id'],_0x1d966b);}let _0x555f60=_0x49d08b;if(_0x2e8ab9[_0x387682(0x16c)]){const _0x1406dd=_0x49d08b['filter'](_0x41d96a=>_0x41d96a[_0x387682(0x17a)][_0x387682(0x19f)]()===_0x2e8ab9[_0x387682(0x16c)][_0x387682(0x19f)]());_0x1406dd['length']>0x0&&(_0x555f60=_0x1406dd);}_0x516353?.[_0x387682(0x161)]('Processing\x20segments');for(const _0x4b7f77 of _0x555f60){if(_0x4b7f77[_0x387682(0x174)]===SEGMENT_KIND_JOURNEY)continue;const _0x442a9f=_0x4b7f77[_0x387682(0x16e)]?_0x4ae38d[_0x387682(0x19e)](_0x4b7f77[_0x387682(0x16e)])||'':'',_0xf42677=_0x3e8628[_0x387682(0x19e)](_0x4b7f77['id'])||[],_0x5a2213=segmentWithActivationsToYaml(_0x4b7f77,_0xf42677,undefined,_0x56927c,_0x13f9ba),_0x2f7758=_0x442a9f?a203_0x28fc27[_0x387682(0x196)](_0x192879,_0x442a9f):_0x192879,_0x1ead30=sanitizeFileName(_0x4b7f77[_0x387682(0x17a)]),_0x56aae2=getUniqueFileName(_0x2f7758,_0x1ead30,_0x190444),_0x313178=a203_0x28fc27[_0x387682(0x196)](_0x2f7758,_0x56aae2+_0x387682(0x187)),_0xef337=segmentToYamlString(_0x5a2213);_0xbc472c[_0x387682(0x184)](prepareFile(_0x313178,_0xef337,_0x192879));}const _0x1f1ae2=new Map();for(const _0x2b4669 of _0x3b5a2c){const _0x2240b7=_0x2b4669[_0x387682(0x179)];!_0x1f1ae2[_0x387682(0x16a)](_0x2240b7)&&_0x1f1ae2[_0x387682(0x17d)](_0x2240b7,[]),_0x1f1ae2['get'](_0x2240b7)[_0x387682(0x184)](_0x2b4669);}for(const _0x3bbe77 of _0x1f1ae2[_0x387682(0x19a)]()){_0x3bbe77[_0x387682(0x191)]((_0x24d6cf,_0x7d76e8)=>(_0x24d6cf[_0x387682(0x199)]||0x0)-(_0x7d76e8['versionNumber']||0x0));}if(_0x2e8ab9[_0x387682(0x16c)]){const _0x4ecb68=new Map();for(const [_0x47a5dc,_0x16c5ed]of _0x1f1ae2){const _0x10e3a8=_0x16c5ed[0x0]['journeyBundleName'];if(_0x10e3a8[_0x387682(0x19f)]()===_0x2e8ab9['targetResourceName'][_0x387682(0x19f)]()){_0x4ecb68[_0x387682(0x17d)](_0x47a5dc,_0x16c5ed);break;}}_0x1f1ae2[_0x387682(0x1a8)]();for(const [_0x41d739,_0x11c9b7]of _0x4ecb68){_0x1f1ae2[_0x387682(0x17d)](_0x41d739,_0x11c9b7);}}if(_0x1f1ae2[_0x387682(0x169)]>0x0){_0x516353?.[_0x387682(0x161)](_0x387682(0x17e));const _0xbc48f6=Array[_0x387682(0x181)](_0x1f1ae2[_0x387682(0x19a)]()),_0x3e3d70=0x5,{createYamlContext:_0x5164d3}=createYamlContextForBundle(_0x22bcca,_0x6509a4,_0x56927c,_0x13f9ba,_0x1ab82f,_0x4648b2);for(let _0x31c867=0x0;_0x31c867<_0xbc48f6[_0x387682(0x1a6)];_0x31c867+=_0x3e3d70){const _0x333927=_0xbc48f6[_0x387682(0x190)](_0x31c867,_0x31c867+_0x3e3d70),_0x41b507=await Promise['all'](_0x333927[_0x387682(0x178)](async _0x206c6b=>{const _0x24afe4=_0x387682,_0x4c9b22=_0x206c6b[0x0],_0x54a9ea=_0x4c9b22['journeyBundleName'];_0x516353?.[_0x24afe4(0x161)](_0x24afe4(0x186)+_0x54a9ea);const _0x36076b=_0x4c9b22['folderId']?_0x4ae38d[_0x24afe4(0x19e)](_0x4c9b22[_0x24afe4(0x198)])||'':'',_0x354e35=_0x36076b?a203_0x28fc27[_0x24afe4(0x196)](_0x192879,_0x36076b):_0x192879,_0x9c6bc8=sanitizeFileName(_0x54a9ea),_0x46886d=a203_0x28fc27[_0x24afe4(0x196)](_0x354e35,_0x9c6bc8+_0x24afe4(0x187));let _0x3c5e6b;if(existsSync(_0x46886d))try{const _0x195e7e=readFileSync(_0x46886d,_0x24afe4(0x194)),_0x1585e9=a203_0x1e714b(_0x195e7e);_0x3c5e6b=buildLocalRuleToNameMappingFromJourney(_0x1585e9);}catch{}const _0x1a9f30=[];for(const _0x4c2139 of _0x206c6b){const _0x75005c=_0x4648b2[_0x24afe4(0x19e)](_0x4c2139['id']);if(!_0x75005c){_0x516353?.[_0x24afe4(0x161)](_0x24afe4(0x16b)+_0x4c2139['id']+'\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping');continue;}const _0x142b65=_0x75005c['attributes']?.[_0x24afe4(0x193)],_0x1444b8=_0x5164d3(_0x4c2139['id'],_0x142b65),_0x3e14b7=await journeyResponseToDef(_0x75005c,_0x1444b8);_0x1a9f30[_0x24afe4(0x184)]({'item':_0x4c2139,'yaml':_0x3e14b7});}const _0x474301=await _0x22bcca['journey'][_0x24afe4(0x18f)](_0x4c9b22[_0x24afe4(0x179)]),_0x12576b=buildMergedJourneyDef(_0x1a9f30,_0x3c5e6b,_0x474301);return{'bundleName':_0x54a9ea,'folderPath':_0x36076b,'finalYaml':_0x12576b};}));for(const {bundleName:_0x317cef,folderPath:_0x11639c,finalYaml:_0x2ece6c}of _0x41b507){const _0x2ce18b=normalizeJourneyDef(_0x2ece6c),_0xd00225=a203_0x53f81d(_0x2ce18b),_0x56233a=_0x11639c?a203_0x28fc27['join'](_0x192879,_0x11639c):_0x192879,_0x12a435=sanitizeFileName(_0x317cef),_0x263b73=getUniqueFileName(_0x56233a,_0x12a435,_0x190444),_0x133928=a203_0x28fc27[_0x387682(0x196)](_0x56233a,_0x263b73+_0x387682(0x187));_0xbc472c[_0x387682(0x184)](prepareFile(_0x133928,_0xd00225,_0x192879));}}}const _0x31384e=Array[_0x387682(0x181)](_0x3e8628[_0x387682(0x19a)]())[_0x387682(0x180)]((_0x12dae3,_0x131976)=>_0x12dae3+_0x131976[_0x387682(0x1a6)],0x0),_0x4308a7=_0x555f60[_0x387682(0x166)](_0x124876=>_0x124876[_0x387682(0x174)]!==SEGMENT_KIND_JOURNEY),_0x2ce4b9=_0xbc472c[_0x387682(0x166)](_0x3d0c83=>_0x3d0c83[_0x387682(0x173)])[_0x387682(0x1a6)],_0x118696=_0xbc472c['filter'](_0x186961=>!_0x186961[_0x387682(0x173)]&&_0x186961[_0x387682(0x182)])[_0x387682(0x1a6)],_0x45579e=_0xbc472c[_0x387682(0x166)](_0x3a0769=>!_0x3a0769[_0x387682(0x173)]&&!_0x3a0769[_0x387682(0x182)])['length'],_0xe15d8e=Array[_0x387682(0x181)](_0x1f1ae2[_0x387682(0x19a)]())[_0x387682(0x180)]((_0x49536f,_0x35bdae)=>_0x49536f+_0x35bdae['length'],0x0);return{'parentName':_0x57187a,'parentId':_0xede1f,'targetDir':_0x192879,'files':_0xbc472c,'counts':{'segments':_0x4308a7[_0x387682(0x1a6)],'journeys':_0x1f1ae2['size'],'journeyVersions':_0xe15d8e,'activations':_0x31384e},'newFiles':_0x2ce4b9,'changedFiles':_0x118696,'unchangedFiles':_0x45579e};}function createYamlContextForBundle(_0x1e28cf,_0x219174,_0x13567a,_0x40159f,_0x343053,_0x4ba80b){const _0x2ac4e5=new Set(),_0x225b80=new Map(),_0x2d0f36=new Map(),_0x28f9d3=createJumpTargetCache(),_0x30c47c=async(_0x372357,_0x416c37)=>{const _0x13a556=a203_0x273d,_0x191236=_0x225b80['get'](_0x372357);if(_0x191236!==undefined)return _0x191236;if(!_0x416c37)return _0x372357;try{let _0x1d95e1=_0x219174[_0x13a556(0x19e)](_0x372357);!_0x1d95e1&&(_0x1d95e1=await _0x1e28cf[_0x13a556(0x195)][_0x13a556(0x17b)](_0x416c37,_0x372357),_0x219174['set'](_0x372357,_0x1d95e1));const _0x546149=generateJourneyLocalName(_0x1d95e1[_0x13a556(0x17a)]),_0x38e155=_0x1d95e1[_0x13a556(0x174)]===SEGMENT_KIND_JOURNEY&&_0x546149!==undefined;if(_0x38e155&&_0x546149){let _0x491918=_0x546149,_0x384fe5=0x2;while(_0x2ac4e5[_0x13a556(0x16a)](_0x491918)){_0x491918=_0x546149+'_'+_0x384fe5,_0x384fe5++;}return _0x2ac4e5[_0x13a556(0x18c)](_0x491918),_0x225b80[_0x13a556(0x17d)](_0x372357,_0x491918),_0x491918;}return _0x1d95e1[_0x13a556(0x17a)];}catch{return _0x372357;}},_0xfcef62=(_0x57db6a,_0x56b03d)=>({'resolveSegment':async _0x3cfcdf=>{const _0x4fc2d8=a203_0x273d,_0x5191a3=_0x225b80[_0x4fc2d8(0x19e)](_0x3cfcdf);if(_0x5191a3!==undefined)return{'name':_0x5191a3,'isJourneyLocal':!![]};if(!_0x56b03d)return{'name':_0x3cfcdf,'isJourneyLocal':![]};try{let _0x411a05=_0x219174[_0x4fc2d8(0x19e)](_0x3cfcdf);!_0x411a05&&(_0x411a05=await _0x1e28cf[_0x4fc2d8(0x195)]['getSegment'](_0x56b03d,_0x3cfcdf),_0x219174['set'](_0x3cfcdf,_0x411a05));const _0x3dcd0c=generateJourneyLocalName(_0x411a05[_0x4fc2d8(0x17a)]),_0x2ca3eb=_0x411a05[_0x4fc2d8(0x174)]===SEGMENT_KIND_JOURNEY&&_0x3dcd0c!==undefined;if(_0x2ca3eb&&!_0x411a05[_0x4fc2d8(0x16d)]&&_0x56b03d)try{const _0x494c57=await _0x1e28cf[_0x4fc2d8(0x195)]['getSegment'](_0x56b03d,_0x3cfcdf);_0x219174[_0x4fc2d8(0x17d)](_0x3cfcdf,_0x494c57),_0x411a05=_0x494c57;}catch{}const _0x43ac18=await _0x30c47c(_0x3cfcdf,_0x56b03d);let _0x3b2dcb;if(_0x2ca3eb&&_0x411a05[_0x4fc2d8(0x16d)]){const _0x1eb5cf=await segmentResponseToDef(_0x411a05,{'resolveSegmentName':_0x4896f1=>_0x30c47c(_0x4896f1,_0x56b03d)});_0x3b2dcb={'description':_0x411a05[_0x4fc2d8(0x18e)],'rule':_0x1eb5cf[_0x4fc2d8(0x16d)]};}return{'name':_0x43ac18,'isJourneyLocal':_0x2ca3eb,'definition':_0x3b2dcb};}catch{return{'name':_0x3cfcdf,'isJourneyLocal':![]};}},'resolveActivation':async _0x2dcccd=>{const _0x142bb2=a203_0x273d,_0x124d7d=_0x2d0f36['get'](_0x2dcccd);if(_0x124d7d!==undefined)return{'name':_0x124d7d,'isJourneyLocal':!![]};try{let _0x27df14=_0x343053[_0x142bb2(0x19e)](_0x2dcccd);!_0x27df14&&(_0x27df14=await _0x1e28cf[_0x142bb2(0x16f)][_0x142bb2(0x1a0)](_0x57db6a,_0x2dcccd));const _0x440e33=_0x27df14[_0x142bb2(0x1a2)][_0x142bb2(0x192)][_0x142bb2(0x17a)]||_0x2dcccd,_0x957ad7=sanitizeYamlKey(_0x440e33)||_0x142bb2(0x163)+_0x2dcccd,_0x5c7d2d=_0x957ad7;_0x2d0f36[_0x142bb2(0x17d)](_0x2dcccd,_0x5c7d2d);const _0x5e2066=journeyActivationStepToYaml(_0x27df14,_0x13567a,_0x40159f);return{'name':_0x5c7d2d,'isJourneyLocal':!![],'definition':_0x5e2066};}catch{return{'name':_0x2dcccd,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0xec99b3,_0x2c3019)=>resolveJumpTarget(_0xec99b3,_0x2c3019,_0x28f9d3,async _0x2cae80=>{const _0x136c08=a203_0x273d,_0x1a1a02=_0x4ba80b['get'](_0x2cae80);if(_0x1a1a02)return _0x1a1a02;return _0x1e28cf[_0x136c08(0x16f)][_0x136c08(0x18d)](_0x2cae80);})});return{'createYamlContext':_0xfcef62};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_0x3375ef,_0x5b8c37){const _0x56d04e=a204_0x180f,_0x3e7d68=_0x3375ef();while(!![]){try{const _0x36cdbc=-parseInt(_0x56d04e(0x11a))/0x1*(-parseInt(_0x56d04e(0x11b))/0x2)+-parseInt(_0x56d04e(0x11c))/0x3+-parseInt(_0x56d04e(0x115))/0x4+-parseInt(_0x56d04e(0x10a))/0x5*(-parseInt(_0x56d04e(0x10d))/0x6)+-parseInt(_0x56d04e(0x110))/0x7+-parseInt(_0x56d04e(0x10e))/0x8+parseInt(_0x56d04e(0x118))/0x9*(parseInt(_0x56d04e(0x119))/0xa);if(_0x36cdbc===_0x5b8c37)break;else _0x3e7d68['push'](_0x3e7d68['shift']());}catch(_0x4c8e1d){_0x3e7d68['push'](_0x3e7d68['shift']());}}}(a204_0x2eb6,0x5a603));import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a204_0x3311af from'path';function a204_0x2eb6(){const _0x455037=['.tmp','code','24TkzkUR','2114064bWubTf','ENOENT','1877253gQioTK','join','dirname','parse','debug','2543144UlIQOK','.push-recovery.json','Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20','72kEGQuu','1895650gnYmXs','54JPMcKF','10806nHnELi','1982904NmGdPW','toISOString','utf-8','stringify','warn','basename','journeyName','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','488860zkVofT'];a204_0x2eb6=function(){return _0x455037;};return a204_0x2eb6();}import{Logger}from'../../utils/logger/index.js';const logger=Logger['of']('tdx.sdk.push-recovery');export function getPushRecoveryPath(_0x24e050){const _0x4c55c0=a204_0x180f,_0x562fa5=a204_0x3311af[_0x4c55c0(0x112)](_0x24e050),_0x2f1f0f=a204_0x3311af[_0x4c55c0(0x121)](_0x24e050);return a204_0x3311af[_0x4c55c0(0x111)](_0x562fa5,'.'+_0x2f1f0f+_0x4c55c0(0x116));}export function readPushRecovery(_0x242ce6){const _0x4abd04=a204_0x180f,_0x43cd1b=getPushRecoveryPath(_0x242ce6);if(!existsSync(_0x43cd1b))return undefined;try{const _0x1fecc1=readFileSync(_0x43cd1b,_0x4abd04(0x11e)),_0xb70027=JSON[_0x4abd04(0x113)](_0x1fecc1);if(_0xb70027?.['version']!==0x1||typeof _0xb70027[_0x4abd04(0x122)]!=='string')return undefined;return _0xb70027;}catch(_0x4e27d6){return _0x4e27d6 instanceof SyntaxError?logger[_0x4abd04(0x114)](_0x4abd04(0x123)+_0x4e27d6):logger[_0x4abd04(0x120)]('Failed\x20to\x20read\x20push\x20recovery\x20file:\x20'+_0x4e27d6),undefined;}}export function writePushRecovery(_0x4fe4db,_0x5a0a13){const _0xc9d961=a204_0x180f,_0x594a40=getPushRecoveryPath(_0x4fe4db),_0x131c3b=_0x594a40+_0xc9d961(0x10b);writeFileSync(_0x131c3b,JSON[_0xc9d961(0x11f)](_0x5a0a13,null,0x2)+'\x0a',_0xc9d961(0x11e)),renameSync(_0x131c3b,_0x594a40);}function a204_0x180f(_0x3cd586,_0x3b6f7e){_0x3cd586=_0x3cd586-0x10a;const _0x2eb678=a204_0x2eb6();let _0x180fe4=_0x2eb678[_0x3cd586];return _0x180fe4;}export function deletePushRecovery(_0x1c4ee6){const _0xef6689=a204_0x180f,_0x24f4bd=getPushRecoveryPath(_0x1c4ee6);try{unlinkSync(_0x24f4bd);}catch(_0x5ebd1c){_0x5ebd1c[_0xef6689(0x10c)]!==_0xef6689(0x10f)&&logger['debug'](_0xef6689(0x117)+_0x5ebd1c);}}export function saveSegmentToPushRecovery(_0x25b30d,_0x5cff84,_0x58faf7,_0x4fab0c){const _0x2d9a1e=a204_0x180f,_0x272e8f=readPushRecovery(_0x25b30d),_0xdfbdf1=_0x272e8f?.[_0x2d9a1e(0x122)]===_0x5cff84?{..._0x272e8f,'updatedAt':new Date()[_0x2d9a1e(0x11d)]()}:{'version':0x1,'journeyName':_0x5cff84,'updatedAt':new Date()[_0x2d9a1e(0x11d)](),'segments':{}};_0xdfbdf1['segments'][_0x58faf7]=_0x4fab0c,writePushRecovery(_0x25b30d,_0xdfbdf1);}
|