@treasuredata/tdx 2026.9.2 → 2026.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/ai-usage-command-base.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.d.ts +11 -0
- 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.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/codex-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-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.js +1 -1
- package/dist/commands/opencode-usage-command.js +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.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-move-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/table-deleted.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/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 +1 -0
- 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.d.ts.map +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/passthrough-server.js.map +1 -1
- package/dist/proxy/sse-usage-parser.d.ts +2 -0
- package/dist/proxy/sse-usage-parser.d.ts.map +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/proxy/sse-usage-parser.js.map +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/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/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.d.ts +5 -3
- package/dist/sdk/llm/model-factors.d.ts.map +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/llm/model-factors.js.map +1 -1
- package/dist/sdk/llm/user-settings.js +1 -1
- 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/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a199_0x18825c=a199_0x2f51;(function(_0x2092d2,_0x52e429){const _0x134c8d=a199_0x2f51,_0x1e8e05=_0x2092d2();while(!![]){try{const _0x564313=-parseInt(_0x134c8d(0xcd))/0x1*(parseInt(_0x134c8d(0xa1))/0x2)+-parseInt(_0x134c8d(0x9d))/0x3*(parseInt(_0x134c8d(0xa7))/0x4)+parseInt(_0x134c8d(0xa5))/0x5*(parseInt(_0x134c8d(0xba))/0x6)+-parseInt(_0x134c8d(0xcc))/0x7*(parseInt(_0x134c8d(0x9e))/0x8)+-parseInt(_0x134c8d(0x9c))/0x9*(parseInt(_0x134c8d(0xd3))/0xa)+-parseInt(_0x134c8d(0xa0))/0xb*(-parseInt(_0x134c8d(0xa4))/0xc)+parseInt(_0x134c8d(0xb5))/0xd;if(_0x564313===_0x52e429)break;else _0x1e8e05['push'](_0x1e8e05['shift']());}catch(_0xf1ac7f){_0x1e8e05['push'](_0x1e8e05['shift']());}}}(a199_0x2352,0x8721f));function a199_0x2f51(_0x5c2866,_0x4a04c2){_0x5c2866=_0x5c2866-0x94;const _0x2352b9=a199_0x2352();let _0x2f511d=_0x2352b9[_0x5c2866];return _0x2f511d;}export const DEFAULT_TIME_RANGE=a199_0x18825c(0xc3);export const DEFAULT_SAMPLE_LIMIT=0x28;export function generateSchemaValidationSQL(_0x16873a,_0x12229a,_0x18d55e){const _0x409159=a199_0x18825c,_0x3175cd=_0x18d55e&&_0x18d55e[_0x409159(0xb4)]>0x0?_0x18d55e[_0x409159(0xd2)](',\x20'):'*';return _0x409159(0xa3)+_0x3175cd+'\x20FROM\x20'+_0x16873a+'.'+_0x12229a+'\x20LIMIT\x200';}export function generateMasterCountSQL(_0x28e608){const _0xa2c984=a199_0x18825c,{database:_0x146ffb,table:_0x30766b}=_0x28e608[_0xa2c984(0xce)];return _0xa2c984(0xb9)+_0x146ffb+'.'+_0x30766b;}export function generateMasterSampleSQL(_0x3b3d28,_0x5cb4dd=0x5){const _0x20e662=a199_0x18825c,{database:_0x5d6a9f,table:_0x283f47}=_0x3b3d28[_0x20e662(0xce)];return'SELECT\x20*\x20FROM\x20'+_0x5d6a9f+'.'+_0x283f47+_0x20e662(0xcf)+_0x5cb4dd;}export function generateAttributeCoverageSQL(_0x58324f,_0x185e3c){const _0x1549f7=a199_0x18825c,_0x547a41=_0x58324f[_0x1549f7(0xce)];return('\x0aSELECT\x20COUNT(*)\x20AS\x20matched_count\x0aFROM\x20'+_0x547a41[_0x1549f7(0xbf)]+'.'+_0x547a41['table']+'\x20m\x0aLEFT\x20JOIN\x20'+_0x185e3c[_0x1549f7(0xc8)][_0x1549f7(0xbf)]+'.'+_0x185e3c[_0x1549f7(0xc8)][_0x1549f7(0xb1)]+_0x1549f7(0xc7)+_0x185e3c[_0x1549f7(0xd2)][_0x1549f7(0x95)]+_0x1549f7(0xb3)+_0x185e3c['join'][_0x1549f7(0xaf)]+_0x1549f7(0xcb)+_0x185e3c[_0x1549f7(0xd2)][_0x1549f7(0xaf)]+_0x1549f7(0x9b))['trim']();}export function generateBehaviorStatsSQL(_0x1e4ac7,_0x2121dc,_0x1dd12c=DEFAULT_TIME_RANGE){const _0x4f0072=a199_0x18825c,_0x24cd20=_0x1e4ac7[_0x4f0072(0xce)];return(_0x4f0072(0xd0)+_0x2121dc[_0x4f0072(0xd2)][_0x4f0072(0x95)]+_0x4f0072(0xad)+_0x24cd20[_0x4f0072(0xbf)]+'.'+_0x24cd20[_0x4f0072(0xb1)]+_0x4f0072(0xca)+_0x2121dc['source'][_0x4f0072(0xbf)]+'.'+_0x2121dc['source'][_0x4f0072(0xb1)]+_0x4f0072(0xd1)+_0x2121dc[_0x4f0072(0xd2)][_0x4f0072(0x95)]+_0x4f0072(0xc2)+_0x2121dc[_0x4f0072(0xd2)][_0x4f0072(0xaf)]+_0x4f0072(0xac)+_0x1dd12c+_0x4f0072(0xab))[_0x4f0072(0xa6)]();}export function generateAttributeSampleSQL(_0x5f4a75,_0x516ee1,_0xe8fe51=0x5){const _0x4af759=a199_0x18825c,_0x41db26=_0x5f4a75[_0x4af759(0xce)],_0x3faa70=_0x516ee1[_0x4af759(0xd2)][_0x4af759(0x95)],_0x5609bf=_0x516ee1[_0x4af759(0xbb)][_0x4af759(0xa2)](_0x1179e7=>'a.'+_0x1179e7[_0x4af759(0x94)])['join'](',\x20');return(_0x4af759(0xc9)+_0x3faa70+',\x20'+_0x5609bf+_0x4af759(0x9a)+_0x41db26[_0x4af759(0xbf)]+'.'+_0x41db26[_0x4af759(0xb1)]+'\x20m\x0aJOIN\x20'+_0x516ee1[_0x4af759(0xc8)][_0x4af759(0xbf)]+'.'+_0x516ee1[_0x4af759(0xc8)]['table']+_0x4af759(0xc7)+_0x516ee1[_0x4af759(0xd2)]['parent_key']+_0x4af759(0xb3)+_0x516ee1['join']['child_key']+_0x4af759(0xae)+_0xe8fe51+'\x0a')[_0x4af759(0xa6)]();}export function generateBehaviorSampleSQL(_0x3e65dd,_0x199e21,_0x1775cb=0x5,_0x14188c=DEFAULT_TIME_RANGE){const _0x48a499=a199_0x18825c,_0x4a2e29=_0x3e65dd[_0x48a499(0xce)],_0xfdbe89=_0x199e21[_0x48a499(0xd2)][_0x48a499(0x95)];let _0x5cf711;if(_0x199e21[_0x48a499(0x99)])_0x5cf711=_0x48a499(0xb6);else _0x199e21[_0x48a499(0xbb)]&&_0x199e21['columns']['length']>0x0?_0x5cf711=_0x199e21['columns'][_0x48a499(0xa2)](_0x358212=>'b.'+_0x358212['column'])[_0x48a499(0xd2)](',\x20'):_0x5cf711='b.*';return(_0x48a499(0xc9)+_0xfdbe89+',\x20'+_0x5cf711+'\x0aFROM\x20'+_0x4a2e29['database']+'.'+_0x4a2e29[_0x48a499(0xb1)]+'\x20m\x0aJOIN\x20'+_0x199e21[_0x48a499(0xc8)][_0x48a499(0xbf)]+'.'+_0x199e21[_0x48a499(0xc8)]['table']+_0x48a499(0xd1)+_0x199e21['join']['parent_key']+'\x20=\x20b.'+_0x199e21[_0x48a499(0xd2)][_0x48a499(0xaf)]+_0x48a499(0xac)+_0x14188c+_0x48a499(0xb7)+_0x1775cb+'\x0a')[_0x48a499(0xa6)]();}function quoteIdentifier(_0x3af8f2){const _0x12c7db=a199_0x18825c;if(/[\s\-\.\#\[\]\(\)]|^[0-9]/[_0x12c7db(0xc1)](_0x3af8f2))return'\x22'+_0x3af8f2[_0x12c7db(0xbc)](/"/g,'\x22\x22')+'\x22';return _0x3af8f2;}export function generateEnrichedSQL(_0x5404c2,_0x2818ea=0x5){const _0x8d73bd=a199_0x18825c,_0x1d61fd=_0x5404c2[_0x8d73bd(0xce)],_0x26647f=_0x5404c2[_0x8d73bd(0xb2)]||[];if(_0x26647f[_0x8d73bd(0xb4)]===0x0)return _0x8d73bd(0xa9)+_0x1d61fd[_0x8d73bd(0xbf)]+'.'+_0x1d61fd[_0x8d73bd(0xb1)]+_0x8d73bd(0xcf)+_0x2818ea;const _0x101661=[_0x8d73bd(0x98)],_0x199bf2=[];return _0x26647f[_0x8d73bd(0xaa)]((_0x112cdc,_0x56d62b)=>{const _0x5c522e=_0x8d73bd,_0x1798d3='a'+_0x56d62b;_0x112cdc['columns']['forEach'](_0x445a05=>{const _0x4b6d84=a199_0x2f51,_0xdb2253=quoteIdentifier(_0x445a05[_0x4b6d84(0xb0)]||_0x445a05[_0x4b6d84(0x94)]);_0x101661['push'](_0x1798d3+'.'+_0x445a05[_0x4b6d84(0x94)]+_0x4b6d84(0xbd)+_0xdb2253);}),_0x199bf2['push'](_0x5c522e(0xc5)+_0x112cdc[_0x5c522e(0xc8)][_0x5c522e(0xbf)]+'.'+_0x112cdc[_0x5c522e(0xc8)]['table']+'\x20'+_0x1798d3+_0x5c522e(0xa8)+_0x112cdc[_0x5c522e(0xd2)]['parent_key']+_0x5c522e(0x97)+_0x1798d3+'.'+_0x112cdc[_0x5c522e(0xd2)][_0x5c522e(0xaf)]);}),(_0x8d73bd(0xc6)+_0x101661[_0x8d73bd(0xd2)](',\x20')+'\x0aFROM\x20'+_0x1d61fd[_0x8d73bd(0xbf)]+'.'+_0x1d61fd['table']+'\x20m\x0a'+_0x199bf2[_0x8d73bd(0xd2)]('\x0a')+'\x0aLIMIT\x20'+_0x2818ea+'\x0a')['trim']();}function a199_0x2352(){const _0x2ddab5=['table','attributes','\x20=\x20a.','length','29935022SMxYJX','b.*','\x27)\x0aLIMIT\x20','\x0aLIMIT\x200\x0a','SELECT\x20COUNT(*)\x20AS\x20row_count\x20FROM\x20','875058IjGwYr','columns','replace','\x20AS\x20','toLowerCase','database','name','test','\x20=\x20b.','-1d','(all\x20columns)','LEFT\x20JOIN\x20','\x0aSELECT\x20','\x20a\x0a\x20\x20ON\x20m.','source','\x0aSELECT\x20m.','\x20m\x0aJOIN\x20','\x0aWHERE\x20a.','16233VpalFV','1Mhugzj','master','\x20LIMIT\x20','\x0aSELECT\x0a\x20\x20COUNT(DISTINCT\x20m.','\x20b\x0a\x20\x20ON\x20m.','join','9954960fhndMn','column','parent_key','find','\x20=\x20','m.*','all_columns','\x0aFROM\x20','\x20IS\x20NOT\x20NULL\x0a','9IhXdAQ','5784nbunQR','40Ipsvns','behaviors','287067XgonSI','1500596kJAVjR','map','SELECT\x20','36mLjRsM','5gzpxZg','trim','448kIUKaG','\x0a\x20\x20ON\x20m.','SELECT\x20*\x20FROM\x20','forEach','\x27)\x0a','\x0aWHERE\x20TD_INTERVAL(b.time,\x20\x27',')\x20AS\x20customers_with_events,\x0a\x20\x20COUNT(*)\x20AS\x20total_events\x0aFROM\x20','\x0aLIMIT\x20','child_key','label'];a199_0x2352=function(){return _0x2ddab5;};return a199_0x2352();}export function generateAttributeSchemaSQL(_0x3e8476,_0x13e619){const _0x4b8482=a199_0x18825c,_0x251482=_0x3e8476['master'],_0x492592=_0x13e619[_0x4b8482(0xd2)][_0x4b8482(0x95)],_0x57fd7c=_0x13e619[_0x4b8482(0xbb)][_0x4b8482(0xa2)](_0x304523=>'a.'+_0x304523['column'])[_0x4b8482(0xd2)](',\x20');return(_0x4b8482(0xc9)+_0x492592+',\x20'+_0x57fd7c+_0x4b8482(0x9a)+_0x251482[_0x4b8482(0xbf)]+'.'+_0x251482['table']+_0x4b8482(0xca)+_0x13e619[_0x4b8482(0xc8)][_0x4b8482(0xbf)]+'.'+_0x13e619['source']['table']+_0x4b8482(0xc7)+_0x13e619[_0x4b8482(0xd2)][_0x4b8482(0x95)]+_0x4b8482(0xb3)+_0x13e619[_0x4b8482(0xd2)][_0x4b8482(0xaf)]+_0x4b8482(0xb8))['trim']();}export function generateBehaviorSchemaSQL(_0x3e0c3a,_0x734222){const _0x4c6f6c=a199_0x18825c,_0x19938e=_0x3e0c3a[_0x4c6f6c(0xce)],_0x2f41c5=_0x734222['join'][_0x4c6f6c(0x95)];let _0x5acd6f;if(_0x734222[_0x4c6f6c(0x99)])_0x5acd6f=_0x4c6f6c(0xb6);else _0x734222['columns']&&_0x734222[_0x4c6f6c(0xbb)][_0x4c6f6c(0xb4)]>0x0?_0x5acd6f=_0x734222[_0x4c6f6c(0xbb)][_0x4c6f6c(0xa2)](_0x182a9c=>'b.'+_0x182a9c[_0x4c6f6c(0x94)])[_0x4c6f6c(0xd2)](',\x20'):_0x5acd6f=_0x4c6f6c(0xb6);return(_0x4c6f6c(0xc9)+_0x2f41c5+',\x20'+_0x5acd6f+_0x4c6f6c(0x9a)+_0x19938e[_0x4c6f6c(0xbf)]+'.'+_0x19938e[_0x4c6f6c(0xb1)]+_0x4c6f6c(0xca)+_0x734222['source'][_0x4c6f6c(0xbf)]+'.'+_0x734222[_0x4c6f6c(0xc8)][_0x4c6f6c(0xb1)]+'\x20b\x0a\x20\x20ON\x20m.'+_0x734222['join']['parent_key']+'\x20=\x20b.'+_0x734222['join'][_0x4c6f6c(0xaf)]+_0x4c6f6c(0xb8))['trim']();}export function getAttributeColumns(_0x47aac7){const _0x1a2488=a199_0x18825c;return _0x47aac7['columns'][_0x1a2488(0xa2)](_0x55870e=>({'label':_0x55870e[_0x1a2488(0xb0)]||_0x55870e[_0x1a2488(0x94)],'column':_0x55870e['column']}));}export function getBehaviorColumns(_0x26b06e){const _0x449433=a199_0x18825c;if(_0x26b06e[_0x449433(0x99)])return[{'label':_0x449433(0xc4),'column':'*'}];if(_0x26b06e[_0x449433(0xbb)]&&_0x26b06e['columns'][_0x449433(0xb4)]>0x0)return _0x26b06e[_0x449433(0xbb)]['map'](_0x21fc22=>({'label':_0x21fc22[_0x449433(0xb0)]||_0x21fc22[_0x449433(0x94)],'column':_0x21fc22[_0x449433(0x94)]}));return[{'label':_0x449433(0xc4),'column':'*'}];}export function findAttributeByName(_0xb28cbb,_0xe9342f){const _0x2c3503=a199_0x18825c;return _0xb28cbb[_0x2c3503(0xb2)]?.[_0x2c3503(0x96)](_0x1039e9=>_0x1039e9[_0x2c3503(0xc0)][_0x2c3503(0xbe)]()===_0xe9342f['toLowerCase']());}export function findBehaviorByName(_0x3b39fb,_0x15b45a){const _0x5852d1=a199_0x18825c;return _0x3b39fb[_0x5852d1(0x9f)]?.['find'](_0x13cbbc=>_0x13cbbc[_0x5852d1(0xc0)][_0x5852d1(0xbe)]()===_0x15b45a[_0x5852d1(0xbe)]());}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x5a8b5b,_0x4cf6b1){const _0x40c3fe=a200_0x20c8,_0xfc54be=_0x5a8b5b();while(!![]){try{const _0x4f6fc6=parseInt(_0x40c3fe(0x123))/0x1*(-parseInt(_0x40c3fe(0x10e))/0x2)+-parseInt(_0x40c3fe(0xf0))/0x3+-parseInt(_0x40c3fe(0x10d))/0x4+-parseInt(_0x40c3fe(0xc4))/0x5+-parseInt(_0x40c3fe(0x10b))/0x6+parseInt(_0x40c3fe(0xcf))/0x7*(-parseInt(_0x40c3fe(0xca))/0x8)+parseInt(_0x40c3fe(0xd4))/0x9*(parseInt(_0x40c3fe(0xe8))/0xa);if(_0x4f6fc6===_0x4cf6b1)break;else _0xfc54be['push'](_0xfc54be['shift']());}catch(_0x305fd4){_0xfc54be['push'](_0xfc54be['shift']());}}}(a200_0x3fc1,0x2233d));import*as a200_0x41a283 from'yaml';function formatScheduleTime(_0x716619){const _0x2df7f1=a200_0x20c8;if(typeof _0x716619===_0x2df7f1(0x100)){const _0x1f9c34=Math['floor'](_0x716619);return String(_0x1f9c34)[_0x2df7f1(0xc8)](0x2,'0')+_0x2df7f1(0xf1);}if(typeof _0x716619==='string'){if(/^\d{2}:\d{2}:\d{2}$/['test'](_0x716619))return _0x716619;if(/^\d{1,2}:\d{2}$/['test'](_0x716619)){const [_0x55e6db,_0x446fc1]=_0x716619[_0x2df7f1(0xd6)](':');return _0x55e6db[_0x2df7f1(0xc8)](0x2,'0')+':'+_0x446fc1+':00';}const _0x22b36e=parseInt(_0x716619,0xa);if(!isNaN(_0x22b36e)&&_0x716619[_0x2df7f1(0xf6)](/^\d+$/))return String(_0x22b36e)[_0x2df7f1(0xc8)](0x2,'0')+_0x2df7f1(0xf1);return _0x716619;}return String(_0x716619);}export function apiToDef(_0x5cd930){const _0x4606c6=a200_0x20c8,_0x5481b3={'database':_0x5cd930[_0x4606c6(0x103)]?.[_0x4606c6(0x11b)]||'','table':_0x5cd930[_0x4606c6(0x103)]?.[_0x4606c6(0x114)]||''};_0x5cd930[_0x4606c6(0xea)]&&_0x5cd930['audienceFilters'][_0x4606c6(0x11c)]>0x0&&(_0x5481b3['filters']=_0x5cd930[_0x4606c6(0xea)]['map'](_0x4bb5ed=>({'column':_0x4bb5ed[_0x4606c6(0xcb)],'values':_0x4bb5ed[_0x4606c6(0xd8)]})));let _0x1dc6fd;_0x5cd930[_0x4606c6(0xcd)]&&_0x5cd930[_0x4606c6(0xcd)]!=='none'&&(_0x1dc6fd={'type':_0x5cd930[_0x4606c6(0xcd)]},_0x5cd930[_0x4606c6(0x107)]&&(_0x1dc6fd[_0x4606c6(0x105)]=formatScheduleTime(_0x5cd930[_0x4606c6(0x107)])),_0x5cd930[_0x4606c6(0xf7)]&&(_0x1dc6fd[_0x4606c6(0xf7)]=_0x5cd930['timezone']));let _0x1d39c4;(_0x5cd930[_0x4606c6(0x116)]||_0x5cd930[_0x4606c6(0xfc)]||_0x5cd930['prestoPoolName'])&&(_0x1d39c4={},_0x5cd930[_0x4606c6(0x116)]&&(_0x1d39c4[_0x4606c6(0xf4)]=_0x5cd930[_0x4606c6(0x116)]),_0x5cd930[_0x4606c6(0xfc)]&&(_0x1d39c4['hive_pool']=_0x5cd930[_0x4606c6(0xfc)]),_0x5cd930[_0x4606c6(0xe9)]&&(_0x1d39c4[_0x4606c6(0xda)]=_0x5cd930[_0x4606c6(0xe9)]));const _0x27e41c=_0x5cd930[_0x4606c6(0xcc)]&&_0x5cd930[_0x4606c6(0xcc)][_0x4606c6(0x11c)]>0x0?groupAttributesBySource(_0x5cd930[_0x4606c6(0xcc)]):undefined,_0x15b863=_0x5cd930[_0x4606c6(0xec)]&&_0x5cd930[_0x4606c6(0xec)][_0x4606c6(0x11c)]>0x0?_0x5cd930[_0x4606c6(0xec)][_0x4606c6(0xe6)](convertApiBehaviorToYaml):undefined;let _0x4d5104;_0x5cd930[_0x4606c6(0xdb)]&&(_0x4d5104={'name':_0x5cd930[_0x4606c6(0xdb)]['name'],'source':{'database':_0x5cd930[_0x4606c6(0xdb)][_0x4606c6(0x11b)],'table':_0x5cd930[_0x4606c6(0xdb)][_0x4606c6(0x114)]},'join':{'parent_key':_0x5cd930[_0x4606c6(0xdb)][_0x4606c6(0xe4)],'child_key':_0x5cd930[_0x4606c6(0xdb)]['parentKey']}},_0x5cd930[_0x4606c6(0xdb)][_0x4606c6(0x121)]&&_0x5cd930[_0x4606c6(0xdb)][_0x4606c6(0x121)][_0x4606c6(0x11c)]>0x0&&(_0x4d5104[_0x4606c6(0xcc)]=groupAttributesBySource(_0x5cd930[_0x4606c6(0xdb)][_0x4606c6(0x121)])),_0x5cd930[_0x4606c6(0xdb)][_0x4606c6(0x111)]&&_0x5cd930['customerGroup'][_0x4606c6(0x111)][_0x4606c6(0x11c)]>0x0&&(_0x4d5104[_0x4606c6(0xec)]=_0x5cd930[_0x4606c6(0xdb)]['customerGroupBehaviors']['map'](convertApiBehaviorToYaml)));const _0x217ca2={'name':_0x5cd930['name'],..._0x5cd930[_0x4606c6(0xc2)]&&{'description':_0x5cd930[_0x4606c6(0xc2)]},'master':_0x5481b3,..._0x1dc6fd&&{'schedule':_0x1dc6fd},..._0x1d39c4&&{'engine':_0x1d39c4},..._0x27e41c&&{'attributes':_0x27e41c},..._0x15b863&&{'behaviors':_0x15b863},..._0x4d5104&&{'customer_group':_0x4d5104}};return _0x217ca2;}function groupAttributesBySource(_0x3e5a17){const _0x4bb3f7=a200_0x20c8,_0x425f13=new Map();for(const _0x318a58 of _0x3e5a17){const _0x303932=_0x318a58[_0x4bb3f7(0x11b)]+'.'+_0x318a58[_0x4bb3f7(0x114)]+'.'+_0x318a58['parentKey']+'.'+_0x318a58[_0x4bb3f7(0xe4)];!_0x425f13[_0x4bb3f7(0xeb)](_0x303932)&&_0x425f13['set'](_0x303932,[]),_0x425f13[_0x4bb3f7(0xff)](_0x303932)['push'](_0x318a58);}const _0x206413=[];for(const [,_0x535f6e]of _0x425f13){const _0x82f89=_0x535f6e[0x0],_0xcc651d=_0x82f89[_0x4bb3f7(0x112)]||_0x82f89[_0x4bb3f7(0x114)];_0x206413['push']({'name':_0xcc651d,'source':{'database':_0x82f89[_0x4bb3f7(0x11b)],'table':_0x82f89[_0x4bb3f7(0x114)]},'join':{'parent_key':_0x82f89[_0x4bb3f7(0xe4)],'child_key':_0x82f89[_0x4bb3f7(0xde)]},'columns':_0x535f6e['map'](_0x533f99=>{const _0x3cb284=_0x4bb3f7,_0x415836={'column':_0x533f99[_0x3cb284(0xd9)],'type':_0x533f99[_0x3cb284(0xc0)]};return _0x533f99['name']!==_0x533f99[_0x3cb284(0xd9)]&&(_0x415836[_0x3cb284(0xee)]=_0x533f99[_0x3cb284(0xc7)]),_0x415836;})});}return _0x206413;}function convertApiBehaviorToYaml(_0x272ee7){const _0x544107=a200_0x20c8,_0x348ac0={'name':_0x272ee7[_0x544107(0xc7)],'source':{'database':_0x272ee7[_0x544107(0x11b)],'table':_0x272ee7[_0x544107(0x114)]},'join':{'parent_key':_0x272ee7[_0x544107(0xe4)],'child_key':_0x272ee7[_0x544107(0xde)]}};if(_0x272ee7['allColumns'])_0x348ac0[_0x544107(0x104)]=!![];else _0x272ee7[_0x544107(0x117)]&&_0x272ee7[_0x544107(0x117)][_0x544107(0x11c)]>0x0&&(_0x348ac0[_0x544107(0x11a)]=_0x272ee7['schema']['map'](_0x13a2e1=>{const _0x1eb8c2=_0x544107,_0x1a9f4a={'column':_0x13a2e1['parentColumn'],'type':_0x13a2e1['type']};return _0x13a2e1[_0x1eb8c2(0xc7)]!==_0x13a2e1[_0x1eb8c2(0xd9)]&&(_0x1a9f4a[_0x1eb8c2(0xee)]=_0x13a2e1['name']),_0x1a9f4a;}));return _0x272ee7['defaultTimeFilterEnabled']&&(_0x348ac0[_0x544107(0x10c)]=_0x272ee7['defaultTimeFilterEnabled']),_0x272ee7[_0x544107(0xc5)]&&(_0x348ac0[_0x544107(0xe0)]=_0x272ee7['isRealtime']),_0x348ac0;}export function defToApi(_0x35045d){const _0x3eb052=a200_0x20c8,_0x33e641={'name':_0x35045d['name'],'master':{'parentDatabaseName':_0x35045d['master'][_0x3eb052(0x110)],'parentTableName':_0x35045d['master'][_0x3eb052(0xc9)]}};_0x35045d[_0x3eb052(0xc2)]&&(_0x33e641[_0x3eb052(0xc2)]=_0x35045d[_0x3eb052(0xc2)]);_0x35045d['master']['filters']&&_0x35045d[_0x3eb052(0x103)][_0x3eb052(0xfe)][_0x3eb052(0x11c)]>0x0&&(_0x33e641[_0x3eb052(0xea)]=_0x35045d[_0x3eb052(0x103)][_0x3eb052(0xfe)]['map'](_0x34b1ed=>({'columnName':_0x34b1ed[_0x3eb052(0x124)],'rightValues':_0x34b1ed['values']})));_0x35045d[_0x3eb052(0xe2)]&&(_0x33e641[_0x3eb052(0xcd)]=_0x35045d[_0x3eb052(0xe2)][_0x3eb052(0xc0)],_0x35045d[_0x3eb052(0xe2)][_0x3eb052(0x105)]&&(_0x33e641[_0x3eb052(0x107)]=_0x35045d[_0x3eb052(0xe2)]['time']),_0x35045d[_0x3eb052(0xe2)][_0x3eb052(0xf7)]&&(_0x33e641[_0x3eb052(0xf7)]=_0x35045d['schedule'][_0x3eb052(0xf7)]));_0x35045d[_0x3eb052(0xd7)]&&(_0x35045d['engine'][_0x3eb052(0xf4)]!==undefined&&(_0x33e641['workflowHiveOnly']=_0x35045d[_0x3eb052(0xd7)]['hive_only']),_0x35045d['engine'][_0x3eb052(0xc1)]!==undefined&&(_0x33e641[_0x3eb052(0xfc)]=_0x35045d[_0x3eb052(0xd7)][_0x3eb052(0xc1)]),_0x35045d[_0x3eb052(0xd7)][_0x3eb052(0xda)]!==undefined&&(_0x33e641[_0x3eb052(0xe9)]=_0x35045d['engine']['trino_pool']));_0x35045d[_0x3eb052(0xcc)]&&_0x35045d['attributes'][_0x3eb052(0x11c)]>0x0&&(_0x33e641[_0x3eb052(0xcc)]=flattenAttributeGroups(_0x35045d[_0x3eb052(0xcc)]));_0x35045d[_0x3eb052(0xec)]&&_0x35045d[_0x3eb052(0xec)][_0x3eb052(0x11c)]>0x0&&(_0x33e641[_0x3eb052(0xec)]=_0x35045d['behaviors'][_0x3eb052(0xe6)](convertDefBehaviorToApi));if(_0x35045d[_0x3eb052(0xbf)]){const _0x4af00a=_0x35045d[_0x3eb052(0xbf)];_0x33e641[_0x3eb052(0xdb)]={'name':_0x4af00a['name'],'parentDatabaseName':_0x4af00a[_0x3eb052(0xc6)][_0x3eb052(0x110)],'parentTableName':_0x4af00a[_0x3eb052(0xc6)][_0x3eb052(0xc9)],'parentKey':_0x4af00a[_0x3eb052(0x115)][_0x3eb052(0xfa)],'foreignKey':_0x4af00a[_0x3eb052(0x115)][_0x3eb052(0x109)]},_0x4af00a[_0x3eb052(0xcc)]&&_0x4af00a['attributes'][_0x3eb052(0x11c)]>0x0&&(_0x33e641[_0x3eb052(0xdb)][_0x3eb052(0x121)]=flattenAttributeGroups(_0x4af00a[_0x3eb052(0xcc)])[_0x3eb052(0xe6)](_0x40706d=>({'name':_0x40706d[_0x3eb052(0xc7)],'type':_0x40706d[_0x3eb052(0xc0)],'parentDatabaseName':_0x40706d[_0x3eb052(0x11b)],'parentTableName':_0x40706d['parentTableName'],'parentColumn':_0x40706d['parentColumn'],'parentKey':_0x40706d['parentKey'],'foreignKey':_0x40706d[_0x3eb052(0xe4)]}))),_0x4af00a['behaviors']&&_0x4af00a[_0x3eb052(0xec)][_0x3eb052(0x11c)]>0x0&&(_0x33e641['customerGroup'][_0x3eb052(0x111)]=_0x4af00a[_0x3eb052(0xec)][_0x3eb052(0xe6)](_0x3c6835=>({'name':_0x3c6835[_0x3eb052(0xc7)],'parentDatabaseName':_0x3c6835[_0x3eb052(0xc6)][_0x3eb052(0x110)],'parentTableName':_0x3c6835[_0x3eb052(0xc6)][_0x3eb052(0xc9)],'parentKey':_0x3c6835['join'][_0x3eb052(0xfa)],'foreignKey':_0x3c6835[_0x3eb052(0x115)][_0x3eb052(0x109)],'allColumns':_0x3c6835[_0x3eb052(0x104)],'schema':_0x3c6835[_0x3eb052(0x11a)]?.['map'](_0x2b69bd=>({'name':_0x2b69bd[_0x3eb052(0xee)]||_0x2b69bd[_0x3eb052(0x124)],'type':_0x2b69bd['type'],'parentColumn':_0x2b69bd[_0x3eb052(0x124)]}))})));}return _0x33e641;}function flattenAttributeGroups(_0x589529){const _0x50f096=a200_0x20c8,_0x533e1a=[];for(const _0xc56074 of _0x589529){for(const _0x44d135 of _0xc56074[_0x50f096(0x11a)]){_0x533e1a['push']({'name':_0x44d135[_0x50f096(0xee)]||_0x44d135['column'],'type':_0x44d135[_0x50f096(0xc0)],'parentDatabaseName':_0xc56074[_0x50f096(0xc6)][_0x50f096(0x110)],'parentTableName':_0xc56074[_0x50f096(0xc6)][_0x50f096(0xc9)],'parentColumn':_0x44d135[_0x50f096(0x124)],'parentKey':_0xc56074[_0x50f096(0x115)][_0x50f096(0xfa)],'foreignKey':_0xc56074[_0x50f096(0x115)][_0x50f096(0x109)],'groupingName':_0xc56074['name']});}}return _0x533e1a;}function convertDefBehaviorToApi(_0x3a3ef2){const _0x2742be=a200_0x20c8,_0x27c09d={'name':_0x3a3ef2[_0x2742be(0xc7)],'parentDatabaseName':_0x3a3ef2[_0x2742be(0xc6)]['database'],'parentTableName':_0x3a3ef2[_0x2742be(0xc6)][_0x2742be(0xc9)],'parentKey':_0x3a3ef2['join'][_0x2742be(0xfa)],'foreignKey':_0x3a3ef2[_0x2742be(0x115)][_0x2742be(0x109)]};if(_0x3a3ef2[_0x2742be(0x104)])_0x27c09d[_0x2742be(0x108)]=!![];else _0x3a3ef2[_0x2742be(0x11a)]&&_0x3a3ef2[_0x2742be(0x11a)][_0x2742be(0x11c)]>0x0&&(_0x27c09d[_0x2742be(0x117)]=_0x3a3ef2[_0x2742be(0x11a)][_0x2742be(0xe6)](_0x5ce7d6=>({'name':_0x5ce7d6['label']||_0x5ce7d6[_0x2742be(0x124)],'type':_0x5ce7d6['type'],'parentColumn':_0x5ce7d6[_0x2742be(0x124)]})));return _0x3a3ef2[_0x2742be(0x10c)]!==undefined&&(_0x27c09d[_0x2742be(0xfd)]=_0x3a3ef2['default_time_filter']),_0x3a3ef2[_0x2742be(0xe0)]!==undefined&&(_0x27c09d['isRealtime']=_0x3a3ef2[_0x2742be(0xe0)]),_0x27c09d;}export function serializeDef(_0x266b93){const _0xc51255=a200_0x20c8,_0x2cae0f=JSON[_0xc51255(0xf5)](JSON[_0xc51255(0xe3)](_0x266b93)),_0x1c84fb=a200_0x41a283[_0xc51255(0xe3)](_0x2cae0f,{'indent':0x2,'lineWidth':0x0,'nullStr':'null'}),_0x53a32a=[_0xc51255(0x10f),_0xc51255(0x101),_0xc51255(0x102),_0xc51255(0xbe),_0xc51255(0x10a),'customer_group:','realtime:',_0xc51255(0x122)];let _0x9540c8=_0x1c84fb;for(const _0x337810 of _0x53a32a){_0x9540c8=_0x9540c8['replace'](new RegExp('^('+_0x337810+')','m'),(_0x20dc33,_0xa04cbf,_0x71eacc)=>{if(_0x71eacc===0x0||_0x9540c8[_0x71eacc-0x1]==='\x0a'&&_0x9540c8[_0x71eacc-0x2]==='\x0a')return _0xa04cbf;return'\x0a'+_0xa04cbf;});}return _0x9540c8;}export function parseDef(_0x461bc5){const _0x2fae15=a200_0x20c8,_0x465132=a200_0x41a283['parse'](_0x461bc5);if(!_0x465132[_0x2fae15(0xc7)])throw new Error(_0x2fae15(0xf2));if(!_0x465132[_0x2fae15(0x103)])throw new Error('YAML\x20config\x20missing\x20required\x20field:\x20master');if(!_0x465132['master']['database'])throw new Error(_0x2fae15(0xdd));if(!_0x465132[_0x2fae15(0x103)][_0x2fae15(0xc9)])throw new Error(_0x2fae15(0xc3));return _0x465132[_0x2fae15(0xe0)]&&validateRealtimeSection(_0x465132[_0x2fae15(0xe0)]),_0x465132[_0x2fae15(0xd5)]&&validatePersonalizationServices(_0x465132[_0x2fae15(0xd5)]),_0x465132;}function validateRealtimeSection(_0x36d88c){const _0x12bf77=a200_0x20c8,_0x17fd7c=[_0x12bf77(0x106),_0x12bf77(0xed),'set',_0x12bf77(0xdf),_0x12bf77(0xe1),_0x12bf77(0x118)];_0x36d88c['events']&&Array[_0x12bf77(0xf8)](_0x36d88c['events'])&&_0x36d88c['events']['forEach']((_0x52bb5f,_0x3c4f6f)=>{const _0x5e6243=_0x12bf77;if(!_0x52bb5f[_0x5e6243(0xc7)])throw new Error('realtime.events['+_0x3c4f6f+_0x5e6243(0xdc));});_0x36d88c[_0x12bf77(0xcc)]&&Array[_0x12bf77(0xf8)](_0x36d88c[_0x12bf77(0xcc)])&&_0x36d88c[_0x12bf77(0xcc)][_0x12bf77(0xfb)]((_0x35d16b,_0x5a6e9d)=>{const _0x3d55f8=_0x12bf77;if(!_0x35d16b[_0x3d55f8(0xc7)])throw new Error(_0x3d55f8(0x11d)+_0x5a6e9d+_0x3d55f8(0xdc));if(_0x35d16b['type']&&!_0x17fd7c[_0x3d55f8(0xd1)](_0x35d16b[_0x3d55f8(0xc0)]))throw new Error(_0x3d55f8(0x11d)+_0x5a6e9d+_0x3d55f8(0xef)+_0x35d16b[_0x3d55f8(0xc7)]+'):\x20Invalid\x20type\x20\x27'+_0x35d16b['type']+_0x3d55f8(0xce)+_0x17fd7c[_0x3d55f8(0x115)](',\x20'));});if(_0x36d88c['id_stitching']){if(!_0x36d88c['id_stitching']['primary_key'])throw new Error(_0x12bf77(0xf3));}}function validatePersonalizationServices(_0x1f5e82){const _0x45b494=a200_0x20c8;if(!Array['isArray'](_0x1f5e82))throw new Error(_0x45b494(0xd3));_0x1f5e82[_0x45b494(0xfb)]((_0x4a11ed,_0x20bc2d)=>{const _0x512907=_0x45b494;if(!_0x4a11ed[_0x512907(0xc7)])throw new Error('personalization_services['+_0x20bc2d+_0x512907(0xdc));});}function a200_0x20c8(_0x200eb5,_0x4ee6dd){_0x200eb5=_0x200eb5-0xbe;const _0x3fc1b8=a200_0x3fc1();let _0x20c883=_0x3fc1b8[_0x200eb5];return _0x20c883;}export function generateTemplate(_0x1a1f3b,_0x502d78,_0x58ef58){const _0x593544=a200_0x20c8,_0x51fd8d={'name':_0x1a1f3b,'description':'Parent\x20segment\x20description','master':{'database':_0x502d78,'table':_0x58ef58},'schedule':{'type':_0x593544(0xd0),'time':_0x593544(0x119),'timezone':'UTC'},'attributes':[{'name':_0x593544(0x113),'source':{'database':_0x502d78,'table':_0x593544(0x11f)},'join':{'parent_key':'id','child_key':_0x593544(0x120)},'columns':[{'column':'column_name','label':_0x593544(0xd2),'type':_0x593544(0xe7)}]}],'behaviors':[{'name':_0x593544(0xf9),'source':{'database':_0x502d78,'table':_0x593544(0xe5)},'join':{'parent_key':_0x593544(0x11e),'child_key':'customer_id'},'all_columns':!![]}]};return serializeDef(_0x51fd8d);}function a200_0x3fc1(){const _0x387fd7=['workflowHiveOnly','schema','imported_batch','03:00','columns','parentDatabaseName','length','realtime.attributes[','user_id','attribute_table','customer_id','customerGroupAttributes','personalization_services:','50290tyOskt','column','attributes:','customer_group','type','hive_pool','description','YAML\x20config\x20missing\x20required\x20field:\x20master.table','524035VslstE','isRealtime','source','name','padStart','table','1192anJCiF','columnName','attributes','scheduleType','\x27.\x20Must\x20be\x20one\x20of:\x20','7469LaelzH','daily','includes','Display\x20Name','personalization_services\x20must\x20be\x20an\x20array','44865NqiONv','personalization_services','split','engine','rightValues','parentColumn','trino_pool','customerGroup',']:\x20Missing\x20required\x20field\x20\x27name\x27','YAML\x20config\x20missing\x20required\x20field:\x20master.database','parentKey','ordered_set','realtime','list','schedule','stringify','foreignKey','events_table','map','string','1820BoeYLQ','prestoPoolName','audienceFilters','has','behaviors','counter','label',']\x20(','195564VGiDAD',':00:00','YAML\x20config\x20missing\x20required\x20field:\x20name','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','hive_only','parse','match','timezone','isArray','Example\x20Events','child_key','forEach','hivePoolName','defaultTimeFilterEnabled','filters','get','number','schedule:','engine:','master','all_columns','time','single','scheduleOption','allColumns','parent_key','behaviors:','1532664UcUqFb','default_time_filter','529860ZCvegZ','2opakDZ','master:','database','customerGroupBehaviors','groupingName','Example\x20Attributes','parentTableName','join'];a200_0x3fc1=function(){return _0x387fd7;};return a200_0x3fc1();}
|
|
1
|
+
(function(_0x5bce90,_0x51aa5d){const _0xa349cf=a200_0x30bb,_0x34682d=_0x5bce90();while(!![]){try{const _0x18f2b0=parseInt(_0xa349cf(0xe1))/0x1*(-parseInt(_0xa349cf(0x106))/0x2)+-parseInt(_0xa349cf(0x105))/0x3*(-parseInt(_0xa349cf(0xf1))/0x4)+-parseInt(_0xa349cf(0xfc))/0x5*(parseInt(_0xa349cf(0xb6))/0x6)+parseInt(_0xa349cf(0xce))/0x7+-parseInt(_0xa349cf(0x114))/0x8*(parseInt(_0xa349cf(0x118))/0x9)+parseInt(_0xa349cf(0xca))/0xa+-parseInt(_0xa349cf(0xe2))/0xb;if(_0x18f2b0===_0x51aa5d)break;else _0x34682d['push'](_0x34682d['shift']());}catch(_0x228bf2){_0x34682d['push'](_0x34682d['shift']());}}}(a200_0x5abe,0x4fde8));import*as a200_0x17b39b from'yaml';function formatScheduleTime(_0x1da6c0){const _0x3d73cc=a200_0x30bb;if(typeof _0x1da6c0==='number'){const _0x199ffc=Math[_0x3d73cc(0x11b)](_0x1da6c0);return String(_0x199ffc)['padStart'](0x2,'0')+':00:00';}if(typeof _0x1da6c0===_0x3d73cc(0xe4)){if(/^\d{2}:\d{2}:\d{2}$/[_0x3d73cc(0x10c)](_0x1da6c0))return _0x1da6c0;if(/^\d{1,2}:\d{2}$/[_0x3d73cc(0x10c)](_0x1da6c0)){const [_0x2a8882,_0x55bca7]=_0x1da6c0['split'](':');return _0x2a8882[_0x3d73cc(0xf4)](0x2,'0')+':'+_0x55bca7+':00';}const _0x56d49d=parseInt(_0x1da6c0,0xa);if(!isNaN(_0x56d49d)&&_0x1da6c0[_0x3d73cc(0xbf)](/^\d+$/))return String(_0x56d49d)[_0x3d73cc(0xf4)](0x2,'0')+_0x3d73cc(0xc9);return _0x1da6c0;}return String(_0x1da6c0);}export function apiToDef(_0x5a04e6){const _0xb71d21=a200_0x30bb,_0x4bf9fb={'database':_0x5a04e6[_0xb71d21(0xd2)]?.[_0xb71d21(0x112)]||'','table':_0x5a04e6[_0xb71d21(0xd2)]?.['parentTableName']||''};_0x5a04e6[_0xb71d21(0xd4)]&&_0x5a04e6[_0xb71d21(0xd4)][_0xb71d21(0x113)]>0x0&&(_0x4bf9fb[_0xb71d21(0xbe)]=_0x5a04e6[_0xb71d21(0xd4)][_0xb71d21(0xc2)](_0x207483=>({'column':_0x207483[_0xb71d21(0xee)],'values':_0x207483['rightValues']})));let _0x1a26a0;_0x5a04e6[_0xb71d21(0xed)]&&_0x5a04e6[_0xb71d21(0xed)]!=='none'&&(_0x1a26a0={'type':_0x5a04e6[_0xb71d21(0xed)]},_0x5a04e6[_0xb71d21(0xdc)]&&(_0x1a26a0[_0xb71d21(0x115)]=formatScheduleTime(_0x5a04e6[_0xb71d21(0xdc)])),_0x5a04e6[_0xb71d21(0xbc)]&&(_0x1a26a0[_0xb71d21(0xbc)]=_0x5a04e6[_0xb71d21(0xbc)]));let _0x58cd0a;(_0x5a04e6[_0xb71d21(0xf7)]||_0x5a04e6[_0xb71d21(0x10d)]||_0x5a04e6[_0xb71d21(0xe3)])&&(_0x58cd0a={},_0x5a04e6[_0xb71d21(0xf7)]&&(_0x58cd0a[_0xb71d21(0xc8)]=_0x5a04e6['workflowHiveOnly']),_0x5a04e6['hivePoolName']&&(_0x58cd0a[_0xb71d21(0xfd)]=_0x5a04e6[_0xb71d21(0x10d)]),_0x5a04e6[_0xb71d21(0xe3)]&&(_0x58cd0a[_0xb71d21(0xd7)]=_0x5a04e6[_0xb71d21(0xe3)]));const _0x49c804=_0x5a04e6[_0xb71d21(0xb9)]&&_0x5a04e6[_0xb71d21(0xb9)][_0xb71d21(0x113)]>0x0?groupAttributesBySource(_0x5a04e6[_0xb71d21(0xb9)]):undefined,_0x367c05=_0x5a04e6[_0xb71d21(0xd5)]&&_0x5a04e6['behaviors']['length']>0x0?_0x5a04e6[_0xb71d21(0xd5)]['map'](convertApiBehaviorToYaml):undefined;let _0x3e9665;_0x5a04e6[_0xb71d21(0x10e)]&&(_0x3e9665={'name':_0x5a04e6[_0xb71d21(0x10e)][_0xb71d21(0xcc)],'source':{'database':_0x5a04e6[_0xb71d21(0x10e)][_0xb71d21(0x112)],'table':_0x5a04e6[_0xb71d21(0x10e)]['parentTableName']},'join':{'parent_key':_0x5a04e6['customerGroup'][_0xb71d21(0xcb)],'child_key':_0x5a04e6['customerGroup'][_0xb71d21(0xf9)]}},_0x5a04e6[_0xb71d21(0x10e)][_0xb71d21(0xaf)]&&_0x5a04e6[_0xb71d21(0x10e)][_0xb71d21(0xaf)][_0xb71d21(0x113)]>0x0&&(_0x3e9665['attributes']=groupAttributesBySource(_0x5a04e6[_0xb71d21(0x10e)][_0xb71d21(0xaf)])),_0x5a04e6['customerGroup'][_0xb71d21(0xe7)]&&_0x5a04e6[_0xb71d21(0x10e)]['customerGroupBehaviors'][_0xb71d21(0x113)]>0x0&&(_0x3e9665[_0xb71d21(0xd5)]=_0x5a04e6[_0xb71d21(0x10e)][_0xb71d21(0xe7)]['map'](convertApiBehaviorToYaml)));const _0x5e9d15={'name':_0x5a04e6[_0xb71d21(0xcc)],..._0x5a04e6[_0xb71d21(0x10a)]&&{'description':_0x5a04e6[_0xb71d21(0x10a)]},'master':_0x4bf9fb,..._0x1a26a0&&{'schedule':_0x1a26a0},..._0x58cd0a&&{'engine':_0x58cd0a},..._0x49c804&&{'attributes':_0x49c804},..._0x367c05&&{'behaviors':_0x367c05},..._0x3e9665&&{'customer_group':_0x3e9665}};return _0x5e9d15;}function groupAttributesBySource(_0x22d66a){const _0x585ec9=a200_0x30bb,_0x1d04c1=new Map();for(const _0x3724eb of _0x22d66a){const _0x27352e=_0x3724eb[_0x585ec9(0x112)]+'.'+_0x3724eb[_0x585ec9(0xec)]+'.'+_0x3724eb[_0x585ec9(0xf9)]+'.'+_0x3724eb[_0x585ec9(0xcb)];!_0x1d04c1[_0x585ec9(0x109)](_0x27352e)&&_0x1d04c1[_0x585ec9(0xfb)](_0x27352e,[]),_0x1d04c1[_0x585ec9(0xe8)](_0x27352e)[_0x585ec9(0xde)](_0x3724eb);}const _0x3d96ec=[];for(const [,_0xcc16cf]of _0x1d04c1){const _0x307d5e=_0xcc16cf[0x0],_0x454ba1=_0x307d5e[_0x585ec9(0x10f)]||_0x307d5e['parentTableName'];_0x3d96ec[_0x585ec9(0xde)]({'name':_0x454ba1,'source':{'database':_0x307d5e[_0x585ec9(0x112)],'table':_0x307d5e[_0x585ec9(0xec)]},'join':{'parent_key':_0x307d5e[_0x585ec9(0xcb)],'child_key':_0x307d5e[_0x585ec9(0xf9)]},'columns':_0xcc16cf[_0x585ec9(0xc2)](_0x2dbda8=>{const _0x49a1c4=_0x585ec9,_0xa4b53a={'column':_0x2dbda8['parentColumn'],'type':_0x2dbda8[_0x49a1c4(0xc7)]};return _0x2dbda8[_0x49a1c4(0xcc)]!==_0x2dbda8[_0x49a1c4(0x111)]&&(_0xa4b53a[_0x49a1c4(0x116)]=_0x2dbda8[_0x49a1c4(0xcc)]),_0xa4b53a;})});}return _0x3d96ec;}function convertApiBehaviorToYaml(_0x4eba9f){const _0x3aeb73=a200_0x30bb,_0xc62513={'name':_0x4eba9f[_0x3aeb73(0xcc)],'source':{'database':_0x4eba9f[_0x3aeb73(0x112)],'table':_0x4eba9f[_0x3aeb73(0xec)]},'join':{'parent_key':_0x4eba9f[_0x3aeb73(0xcb)],'child_key':_0x4eba9f[_0x3aeb73(0xf9)]}};if(_0x4eba9f[_0x3aeb73(0xfa)])_0xc62513[_0x3aeb73(0xcd)]=!![];else _0x4eba9f[_0x3aeb73(0xbd)]&&_0x4eba9f[_0x3aeb73(0xbd)]['length']>0x0&&(_0xc62513[_0x3aeb73(0x100)]=_0x4eba9f[_0x3aeb73(0xbd)][_0x3aeb73(0xc2)](_0x315b7c=>{const _0x4644f8=_0x3aeb73,_0x15ea1f={'column':_0x315b7c['parentColumn'],'type':_0x315b7c[_0x4644f8(0xc7)]};return _0x315b7c[_0x4644f8(0xcc)]!==_0x315b7c['parentColumn']&&(_0x15ea1f[_0x4644f8(0x116)]=_0x315b7c[_0x4644f8(0xcc)]),_0x15ea1f;}));return _0x4eba9f[_0x3aeb73(0xb2)]&&(_0xc62513[_0x3aeb73(0xc0)]=_0x4eba9f[_0x3aeb73(0xb2)]),_0x4eba9f[_0x3aeb73(0x10b)]&&(_0xc62513[_0x3aeb73(0xae)]=_0x4eba9f[_0x3aeb73(0x10b)]),_0xc62513;}export function defToApi(_0x4e9044){const _0x65a76f=a200_0x30bb,_0x529e5b={'name':_0x4e9044[_0x65a76f(0xcc)],'master':{'parentDatabaseName':_0x4e9044[_0x65a76f(0xd2)][_0x65a76f(0x107)],'parentTableName':_0x4e9044[_0x65a76f(0xd2)][_0x65a76f(0xdf)]}};_0x4e9044[_0x65a76f(0x10a)]&&(_0x529e5b[_0x65a76f(0x10a)]=_0x4e9044[_0x65a76f(0x10a)]);_0x4e9044[_0x65a76f(0xd2)][_0x65a76f(0xbe)]&&_0x4e9044[_0x65a76f(0xd2)]['filters'][_0x65a76f(0x113)]>0x0&&(_0x529e5b[_0x65a76f(0xd4)]=_0x4e9044[_0x65a76f(0xd2)][_0x65a76f(0xbe)][_0x65a76f(0xc2)](_0x2baed2=>({'columnName':_0x2baed2[_0x65a76f(0xdb)],'rightValues':_0x2baed2['values']})));_0x4e9044[_0x65a76f(0x108)]&&(_0x529e5b[_0x65a76f(0xed)]=_0x4e9044[_0x65a76f(0x108)][_0x65a76f(0xc7)],_0x4e9044[_0x65a76f(0x108)]['time']&&(_0x529e5b['scheduleOption']=_0x4e9044[_0x65a76f(0x108)][_0x65a76f(0x115)]),_0x4e9044[_0x65a76f(0x108)][_0x65a76f(0xbc)]&&(_0x529e5b[_0x65a76f(0xbc)]=_0x4e9044[_0x65a76f(0x108)]['timezone']));_0x4e9044[_0x65a76f(0xb1)]&&(_0x4e9044[_0x65a76f(0xb1)][_0x65a76f(0xc8)]!==undefined&&(_0x529e5b['workflowHiveOnly']=_0x4e9044[_0x65a76f(0xb1)][_0x65a76f(0xc8)]),_0x4e9044['engine'][_0x65a76f(0xfd)]!==undefined&&(_0x529e5b['hivePoolName']=_0x4e9044['engine'][_0x65a76f(0xfd)]),_0x4e9044[_0x65a76f(0xb1)][_0x65a76f(0xd7)]!==undefined&&(_0x529e5b['prestoPoolName']=_0x4e9044[_0x65a76f(0xb1)][_0x65a76f(0xd7)]));_0x4e9044[_0x65a76f(0xb9)]&&_0x4e9044[_0x65a76f(0xb9)][_0x65a76f(0x113)]>0x0&&(_0x529e5b[_0x65a76f(0xb9)]=flattenAttributeGroups(_0x4e9044[_0x65a76f(0xb9)]));_0x4e9044[_0x65a76f(0xd5)]&&_0x4e9044[_0x65a76f(0xd5)][_0x65a76f(0x113)]>0x0&&(_0x529e5b[_0x65a76f(0xd5)]=_0x4e9044['behaviors'][_0x65a76f(0xc2)](convertDefBehaviorToApi));if(_0x4e9044[_0x65a76f(0xd1)]){const _0x2d79f2=_0x4e9044['customer_group'];_0x529e5b[_0x65a76f(0x10e)]={'name':_0x2d79f2['name'],'parentDatabaseName':_0x2d79f2['source'][_0x65a76f(0x107)],'parentTableName':_0x2d79f2[_0x65a76f(0xd0)][_0x65a76f(0xdf)],'parentKey':_0x2d79f2[_0x65a76f(0xc3)][_0x65a76f(0xc5)],'foreignKey':_0x2d79f2[_0x65a76f(0xc3)][_0x65a76f(0xcf)]},_0x2d79f2[_0x65a76f(0xb9)]&&_0x2d79f2[_0x65a76f(0xb9)][_0x65a76f(0x113)]>0x0&&(_0x529e5b[_0x65a76f(0x10e)][_0x65a76f(0xaf)]=flattenAttributeGroups(_0x2d79f2['attributes'])['map'](_0x4ee761=>({'name':_0x4ee761['name'],'type':_0x4ee761['type'],'parentDatabaseName':_0x4ee761['parentDatabaseName'],'parentTableName':_0x4ee761[_0x65a76f(0xec)],'parentColumn':_0x4ee761[_0x65a76f(0x111)],'parentKey':_0x4ee761['parentKey'],'foreignKey':_0x4ee761[_0x65a76f(0xcb)]}))),_0x2d79f2[_0x65a76f(0xd5)]&&_0x2d79f2['behaviors'][_0x65a76f(0x113)]>0x0&&(_0x529e5b['customerGroup'][_0x65a76f(0xe7)]=_0x2d79f2['behaviors']['map'](_0x16755b=>({'name':_0x16755b[_0x65a76f(0xcc)],'parentDatabaseName':_0x16755b['source'][_0x65a76f(0x107)],'parentTableName':_0x16755b[_0x65a76f(0xd0)][_0x65a76f(0xdf)],'parentKey':_0x16755b['join']['child_key'],'foreignKey':_0x16755b[_0x65a76f(0xc3)][_0x65a76f(0xcf)],'allColumns':_0x16755b[_0x65a76f(0xcd)],'schema':_0x16755b['columns']?.[_0x65a76f(0xc2)](_0x2f1867=>({'name':_0x2f1867[_0x65a76f(0x116)]||_0x2f1867[_0x65a76f(0xdb)],'type':_0x2f1867[_0x65a76f(0xc7)],'parentColumn':_0x2f1867[_0x65a76f(0xdb)]}))})));}return _0x529e5b;}function flattenAttributeGroups(_0x391c29){const _0xada64f=a200_0x30bb,_0x5eac55=[];for(const _0x2bf9e2 of _0x391c29){for(const _0x3dbe19 of _0x2bf9e2[_0xada64f(0x100)]){_0x5eac55['push']({'name':_0x3dbe19[_0xada64f(0x116)]||_0x3dbe19[_0xada64f(0xdb)],'type':_0x3dbe19[_0xada64f(0xc7)],'parentDatabaseName':_0x2bf9e2[_0xada64f(0xd0)][_0xada64f(0x107)],'parentTableName':_0x2bf9e2[_0xada64f(0xd0)][_0xada64f(0xdf)],'parentColumn':_0x3dbe19[_0xada64f(0xdb)],'parentKey':_0x2bf9e2['join'][_0xada64f(0xc5)],'foreignKey':_0x2bf9e2[_0xada64f(0xc3)][_0xada64f(0xcf)],'groupingName':_0x2bf9e2[_0xada64f(0xcc)]});}}return _0x5eac55;}function a200_0x30bb(_0x514fbb,_0x2775dc){_0x514fbb=_0x514fbb-0xae;const _0x5abef8=a200_0x5abe();let _0x30bb13=_0x5abef8[_0x514fbb];return _0x30bb13;}function a200_0x5abe(){const _0x2a85e2=['YAML\x20config\x20missing\x20required\x20field:\x20master.table','forEach','master:','930bAVNRH','03:00','single','attributes','engine:',']\x20(','timezone','schema','filters','match','default_time_filter','personalization_services\x20must\x20be\x20an\x20array','map','join','list','child_key','):\x20Invalid\x20type\x20\x27','type','hive_only',':00:00','381470AFHSPN','foreignKey','name','all_columns','3470845yWDHwn','parent_key','source','customer_group','master','\x27.\x20Must\x20be\x20one\x20of:\x20','audienceFilters','behaviors','YAML\x20config\x20missing\x20required\x20field:\x20master.database','trino_pool','stringify','events','customer_group:','column','scheduleOption','personalization_services[','push','table','daily','237018kmMUgc','2863124fdHlCY','prestoPoolName','string','counter','Parent\x20segment\x20description','customerGroupBehaviors','get','customer_id','Example\x20Attributes','includes','parentTableName','scheduleType','columnName','id_stitching','attribute_table','178748fsCkmP','column_name','Display\x20Name','padStart','realtime.attributes[','personalization_services:','workflowHiveOnly','YAML\x20config\x20missing\x20required\x20field:\x20master','parentKey','allColumns','set','1730KTiwem','hive_pool','YAML\x20config\x20missing\x20required\x20field:\x20name','realtime:','columns',']:\x20Missing\x20required\x20field\x20\x27name\x27','user_id','imported_batch','isArray','39AuInMn','2sylZvC','database','schedule','has','description','isRealtime','test','hivePoolName','customerGroup','groupingName','null','parentColumn','parentDatabaseName','length','1384BvrKKG','time','label','realtime.id_stitching:\x20Missing\x20required\x20field\x20\x27primary_key\x27','12321uJPIru','replace','primary_key','floor','ordered_set','realtime','customerGroupAttributes','realtime.events[','engine','defaultTimeFilterEnabled'];a200_0x5abe=function(){return _0x2a85e2;};return a200_0x5abe();}function convertDefBehaviorToApi(_0x36d30e){const _0x422238=a200_0x30bb,_0x137c4c={'name':_0x36d30e['name'],'parentDatabaseName':_0x36d30e[_0x422238(0xd0)][_0x422238(0x107)],'parentTableName':_0x36d30e[_0x422238(0xd0)]['table'],'parentKey':_0x36d30e[_0x422238(0xc3)]['child_key'],'foreignKey':_0x36d30e[_0x422238(0xc3)][_0x422238(0xcf)]};if(_0x36d30e[_0x422238(0xcd)])_0x137c4c[_0x422238(0xfa)]=!![];else _0x36d30e[_0x422238(0x100)]&&_0x36d30e[_0x422238(0x100)][_0x422238(0x113)]>0x0&&(_0x137c4c['schema']=_0x36d30e[_0x422238(0x100)][_0x422238(0xc2)](_0x5c7aa7=>({'name':_0x5c7aa7[_0x422238(0x116)]||_0x5c7aa7['column'],'type':_0x5c7aa7[_0x422238(0xc7)],'parentColumn':_0x5c7aa7[_0x422238(0xdb)]})));return _0x36d30e[_0x422238(0xc0)]!==undefined&&(_0x137c4c[_0x422238(0xb2)]=_0x36d30e[_0x422238(0xc0)]),_0x36d30e[_0x422238(0xae)]!==undefined&&(_0x137c4c[_0x422238(0x10b)]=_0x36d30e[_0x422238(0xae)]),_0x137c4c;}export function serializeDef(_0x69c80c){const _0x5b0830=a200_0x30bb,_0x5523f1=JSON['parse'](JSON['stringify'](_0x69c80c)),_0x584764=a200_0x17b39b[_0x5b0830(0xd8)](_0x5523f1,{'indent':0x2,'lineWidth':0x0,'nullStr':_0x5b0830(0x110)}),_0x33e98b=[_0x5b0830(0xb5),'schedule:',_0x5b0830(0xba),'attributes:','behaviors:',_0x5b0830(0xda),_0x5b0830(0xff),_0x5b0830(0xf6)];let _0x202467=_0x584764;for(const _0x395b54 of _0x33e98b){_0x202467=_0x202467[_0x5b0830(0x119)](new RegExp('^('+_0x395b54+')','m'),(_0x241f1b,_0x2dadac,_0x5a3740)=>{if(_0x5a3740===0x0||_0x202467[_0x5a3740-0x1]==='\x0a'&&_0x202467[_0x5a3740-0x2]==='\x0a')return _0x2dadac;return'\x0a'+_0x2dadac;});}return _0x202467;}export function parseDef(_0x426b3f){const _0x22525c=a200_0x30bb,_0xe7c340=a200_0x17b39b['parse'](_0x426b3f);if(!_0xe7c340['name'])throw new Error(_0x22525c(0xfe));if(!_0xe7c340[_0x22525c(0xd2)])throw new Error(_0x22525c(0xf8));if(!_0xe7c340[_0x22525c(0xd2)]['database'])throw new Error(_0x22525c(0xd6));if(!_0xe7c340[_0x22525c(0xd2)]['table'])throw new Error(_0x22525c(0xb3));return _0xe7c340[_0x22525c(0xae)]&&validateRealtimeSection(_0xe7c340[_0x22525c(0xae)]),_0xe7c340['personalization_services']&&validatePersonalizationServices(_0xe7c340['personalization_services']),_0xe7c340;}function validateRealtimeSection(_0x1c584b){const _0x3b630d=a200_0x30bb,_0x3e763f=[_0x3b630d(0xb8),_0x3b630d(0xe5),_0x3b630d(0xfb),_0x3b630d(0x11c),_0x3b630d(0xc4),_0x3b630d(0x103)];_0x1c584b['events']&&Array[_0x3b630d(0x104)](_0x1c584b[_0x3b630d(0xd9)])&&_0x1c584b[_0x3b630d(0xd9)][_0x3b630d(0xb4)]((_0x114004,_0x39adcf)=>{const _0x21a349=_0x3b630d;if(!_0x114004[_0x21a349(0xcc)])throw new Error(_0x21a349(0xb0)+_0x39adcf+_0x21a349(0x101));});_0x1c584b[_0x3b630d(0xb9)]&&Array[_0x3b630d(0x104)](_0x1c584b[_0x3b630d(0xb9)])&&_0x1c584b[_0x3b630d(0xb9)][_0x3b630d(0xb4)]((_0x5ee864,_0x194a4d)=>{const _0x4a333f=_0x3b630d;if(!_0x5ee864[_0x4a333f(0xcc)])throw new Error(_0x4a333f(0xf5)+_0x194a4d+']:\x20Missing\x20required\x20field\x20\x27name\x27');if(_0x5ee864[_0x4a333f(0xc7)]&&!_0x3e763f[_0x4a333f(0xeb)](_0x5ee864[_0x4a333f(0xc7)]))throw new Error(_0x4a333f(0xf5)+_0x194a4d+_0x4a333f(0xbb)+_0x5ee864[_0x4a333f(0xcc)]+_0x4a333f(0xc6)+_0x5ee864['type']+_0x4a333f(0xd3)+_0x3e763f[_0x4a333f(0xc3)](',\x20'));});if(_0x1c584b[_0x3b630d(0xef)]){if(!_0x1c584b[_0x3b630d(0xef)][_0x3b630d(0x11a)])throw new Error(_0x3b630d(0x117));}}function validatePersonalizationServices(_0x4e83aa){const _0x1fa861=a200_0x30bb;if(!Array[_0x1fa861(0x104)](_0x4e83aa))throw new Error(_0x1fa861(0xc1));_0x4e83aa[_0x1fa861(0xb4)]((_0xce4b0e,_0x51e00c)=>{const _0x1426ae=_0x1fa861;if(!_0xce4b0e[_0x1426ae(0xcc)])throw new Error(_0x1426ae(0xdd)+_0x51e00c+_0x1426ae(0x101));});}export function generateTemplate(_0x3dd1ce,_0x402fa8,_0x31e392){const _0x2fb4b1=a200_0x30bb,_0x272a13={'name':_0x3dd1ce,'description':_0x2fb4b1(0xe6),'master':{'database':_0x402fa8,'table':_0x31e392},'schedule':{'type':_0x2fb4b1(0xe0),'time':_0x2fb4b1(0xb7),'timezone':'UTC'},'attributes':[{'name':_0x2fb4b1(0xea),'source':{'database':_0x402fa8,'table':_0x2fb4b1(0xf0)},'join':{'parent_key':'id','child_key':_0x2fb4b1(0xe9)},'columns':[{'column':_0x2fb4b1(0xf2),'label':_0x2fb4b1(0xf3),'type':_0x2fb4b1(0xe4)}]}],'behaviors':[{'name':'Example\x20Events','source':{'database':_0x402fa8,'table':'events_table'},'join':{'parent_key':_0x2fb4b1(0x102),'child_key':'customer_id'},'all_columns':!![]}]};return serializeDef(_0x272a13);}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(_0x464edc,_0x3ca705){const _0x503b06=a201_0x3731,_0x2f18e1=_0x464edc();while(!![]){try{const _0x505174=-parseInt(_0x503b06(0x1a6))/0x1*(-parseInt(_0x503b06(0x198))/0x2)+parseInt(_0x503b06(0x1cc))/0x3+parseInt(_0x503b06(0x1ae))/0x4+-parseInt(_0x503b06(0x1b8))/0x5*(parseInt(_0x503b06(0x1a5))/0x6)+-parseInt(_0x503b06(0x19b))/0x7+-parseInt(_0x503b06(0x1ad))/0x8*(parseInt(_0x503b06(0x1da))/0x9)+-parseInt(_0x503b06(0x1d7))/0xa*(parseInt(_0x503b06(0x1d0))/0xb);if(_0x505174===_0x3ca705)break;else _0x2f18e1['push'](_0x2f18e1['shift']());}catch(_0x25e59e){_0x2f18e1['push'](_0x2f18e1['shift']());}}}(a201_0x9ddb,0x8376d));import a201_0x2ceaf5 from'path';import{existsSync,readFileSync}from'fs';import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';function a201_0x9ddb(){const _0x53be06=['audienceId','size','reduce','getParent','length','relative','1932582EffWrc','clear','update','createdAt','1098394KkkAJQ','Fetching\x20parent\x20segment\x20info','toLowerCase','Fetching\x20activations','versionNumber','journeyBundleName','attributes','70ZTBTnO','filter','sort','348741ufECpV','journeyBundleId','getSegment','hasChanges','folderId','rule','106584NFsCNt','all','map','1212463ZlzUZr','slice','has','buildIdToEmailMap','name','.yml','resolveParentId','targetResourceName','listJourneysWithDetailsFromParentSegment','Warning:\x20Journey\x20','246FwCtOH','8AeFxqI','getLatestJourneyId','Resolving\x20parent\x20segment','user','join','listSegments','state','56UOzKJb','3053784MSDrwv','segment','kind','add','set','Processing\x20segments','Processing\x20journeys','push','data','from','18545bxZhHn','getJourney','listActivations','updatedAt','Fetching\x20users\x20and\x20connections','isNew','parentFolder','utf-8','get','description','values','journey','segments/','connection'];a201_0x9ddb=function(){return _0x53be06;};return a201_0x9ddb();}import{sanitizeFileName}from'../../utils/string-utils.js';function a201_0x3731(_0x36d0ca,_0x231429){_0x36d0ca=_0x36d0ca-0x196;const _0x9ddb90=a201_0x9ddb();let _0x373104=_0x9ddb90[_0x36d0ca];return _0x373104;}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 a201_0x261f19,normalizeJourneyDef,parseYamlString as a201_0xb68a64}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(_0x13c43b,_0x24186b,_0x461d47){const _0x2c5b0b=a201_0x3731,_0x3a069f=a201_0x2ceaf5[_0x2c5b0b(0x1cb)](_0x461d47,_0x13c43b);if(existsSync(_0x13c43b)){const _0x421115=readFileSync(_0x13c43b,_0x2c5b0b(0x1bf)),_0x24618d=generateDiff(_0x421115,_0x24186b),_0x3da35f=hasChanges(_0x24618d);return{'relativePath':_0x3a069f,'absolutePath':_0x13c43b,'content':_0x24186b,'isNew':![],'hasChanges':_0x3da35f,'diff':_0x3da35f?formatDiffWithColors(_0x24618d):undefined};}return{'relativePath':_0x3a069f,'absolutePath':_0x13c43b,'content':_0x24186b,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x5b6114,_0x158287,_0x56351c){const _0x259150=a201_0x3731,_0x54db73=_0x5b6114+':'+_0x158287,_0x26b347=_0x56351c[_0x259150(0x1c0)](_0x54db73)||0x0;_0x56351c[_0x259150(0x1b2)](_0x54db73,_0x26b347+0x1);if(_0x26b347===0x0)return _0x158287;return _0x158287+'_'+(_0x26b347+0x1);}export async function pullSegments(_0x2e92f8,_0x324adf,_0x31180c={}){const _0x463e3f=a201_0x3731,{targetDir:_0x57124d,progress:_0x26d5cc}=_0x31180c;_0x26d5cc?.[_0x463e3f(0x1ce)](_0x463e3f(0x1a8));const _0x5bc1b2=await _0x2e92f8[_0x463e3f(0x1af)][_0x463e3f(0x1a1)](_0x324adf);_0x26d5cc?.[_0x463e3f(0x1ce)](_0x463e3f(0x1d1));const _0x5c62ae=await _0x2e92f8[_0x463e3f(0x1af)][_0x463e3f(0x1c9)](_0x5bc1b2),_0x5728dc=_0x5c62ae[_0x463e3f(0x1d6)][_0x463e3f(0x19f)];_0x26d5cc?.[_0x463e3f(0x1ce)]('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0xc0f41b,_0x2c563e,_0x5e738f]=await Promise['all']([_0x2e92f8[_0x463e3f(0x1af)][_0x463e3f(0x1ab)](_0x5bc1b2),_0x2e92f8[_0x463e3f(0x1af)]['listFolders'](_0x5bc1b2),_0x2e92f8[_0x463e3f(0x1c3)][_0x463e3f(0x1a3)](_0x5bc1b2,{'includeAllVersions':!![]})]),{journeys:_0x29d433,activationStepsById:_0x4b2f4b}=_0x5e738f,_0x3ccbe5=new Map();for(const _0x36bd4e of _0x29d433){_0x3ccbe5[_0x463e3f(0x1b2)](_0x36bd4e['id'],_0x36bd4e);}const _0x452063=_0x29d433[_0x463e3f(0x19a)](_0x275d30=>({'id':_0x275d30['id'],'name':_0x275d30['attributes']['name'],'journeyBundleName':_0x275d30[_0x463e3f(0x1d6)][_0x463e3f(0x1d5)]||'','journeyBundleId':_0x275d30['attributes'][_0x463e3f(0x1db)]||'','versionNumber':_0x275d30['attributes'][_0x463e3f(0x1d4)],'description':_0x275d30[_0x463e3f(0x1d6)][_0x463e3f(0x1c1)],'state':_0x275d30[_0x463e3f(0x1d6)][_0x463e3f(0x1ac)],'paused':_0x275d30[_0x463e3f(0x1d6)]['paused'],'audienceId':_0x275d30[_0x463e3f(0x1d6)]['audienceId'],'folderId':_0x275d30['relationships']?.[_0x463e3f(0x1be)]?.[_0x463e3f(0x1b6)]?.['id'],'createdAt':_0x275d30[_0x463e3f(0x1d6)][_0x463e3f(0x1cf)],'updatedAt':_0x275d30['attributes'][_0x463e3f(0x1bb)]})),_0x3013b1=buildFolderIdToPathMap(_0x2c563e),_0x569d89=_0x57124d||_0x463e3f(0x1c4)+sanitizeFileName(_0x5728dc);_0x26d5cc?.[_0x463e3f(0x1ce)](_0x463e3f(0x1d3));const _0xab4be1=new Map();await batchAsync(_0xc0f41b,async _0x58454a=>{const _0x231a65=_0x463e3f,_0x4c066b=await _0x2e92f8[_0x231a65(0x1af)][_0x231a65(0x1ba)](_0x5bc1b2,_0x58454a['id']);_0xab4be1[_0x231a65(0x1b2)](_0x58454a['id'],_0x4c066b);}),_0x26d5cc?.[_0x463e3f(0x1ce)](_0x463e3f(0x1bc));const [_0x329382,_0x451e99]=await Promise['all']([_0x2e92f8[_0x463e3f(0x1a9)][_0x463e3f(0x19e)](),_0x2e92f8[_0x463e3f(0x1c5)]['buildIdToNameMap']()]),_0x23f958=[],_0x344ea5=new Map(),_0x51bc84=a201_0x2ceaf5[_0x463e3f(0x1aa)](_0x569d89,'tdx.json'),_0x559e3d=createTdxConfigContent(_0x5728dc);_0x23f958[_0x463e3f(0x1b5)](prepareFile(_0x51bc84,_0x559e3d,_0x569d89));const _0x505f3a=new Map();for(const _0x8b0fba of _0xc0f41b){_0x505f3a[_0x463e3f(0x1b2)](_0x8b0fba['id'],_0x8b0fba);}let _0x57a6dc=_0xc0f41b;if(_0x31180c[_0x463e3f(0x1a2)]){const _0x8b4a09=_0xc0f41b[_0x463e3f(0x1d8)](_0x1cf70e=>_0x1cf70e[_0x463e3f(0x19f)][_0x463e3f(0x1d2)]()===_0x31180c[_0x463e3f(0x1a2)][_0x463e3f(0x1d2)]());_0x8b4a09[_0x463e3f(0x1ca)]>0x0&&(_0x57a6dc=_0x8b4a09);}_0x26d5cc?.[_0x463e3f(0x1ce)](_0x463e3f(0x1b3));for(const _0x4ca0f1 of _0x57a6dc){if(_0x4ca0f1['kind']===SEGMENT_KIND_JOURNEY)continue;const _0x5c42bb=_0x4ca0f1['segmentFolderId']?_0x3013b1[_0x463e3f(0x1c0)](_0x4ca0f1['segmentFolderId'])||'':'',_0x549fe7=_0xab4be1[_0x463e3f(0x1c0)](_0x4ca0f1['id'])||[],_0x5226ab=segmentWithActivationsToYaml(_0x4ca0f1,_0x549fe7,undefined,_0x329382,_0x451e99),_0x28dae2=_0x5c42bb?a201_0x2ceaf5['join'](_0x569d89,_0x5c42bb):_0x569d89,_0x4e22d3=sanitizeFileName(_0x4ca0f1[_0x463e3f(0x19f)]),_0x13e088=getUniqueFileName(_0x28dae2,_0x4e22d3,_0x344ea5),_0x905ade=a201_0x2ceaf5[_0x463e3f(0x1aa)](_0x28dae2,_0x13e088+'.yml'),_0x7bacf8=segmentToYamlString(_0x5226ab);_0x23f958['push'](prepareFile(_0x905ade,_0x7bacf8,_0x569d89));}const _0x5dffc4=new Map();for(const _0x2d85a7 of _0x452063){const _0xa3f2be=_0x2d85a7[_0x463e3f(0x1db)];!_0x5dffc4[_0x463e3f(0x19d)](_0xa3f2be)&&_0x5dffc4['set'](_0xa3f2be,[]),_0x5dffc4[_0x463e3f(0x1c0)](_0xa3f2be)[_0x463e3f(0x1b5)](_0x2d85a7);}for(const _0x44fede of _0x5dffc4[_0x463e3f(0x1c2)]()){_0x44fede[_0x463e3f(0x1d9)]((_0xcebc6d,_0x1bdb9f)=>(_0xcebc6d[_0x463e3f(0x1d4)]||0x0)-(_0x1bdb9f[_0x463e3f(0x1d4)]||0x0));}if(_0x31180c[_0x463e3f(0x1a2)]){const _0x1d1d33=new Map();for(const [_0x2cea0a,_0x37ec3d]of _0x5dffc4){const _0x4e99ac=_0x37ec3d[0x0]['journeyBundleName'];if(_0x4e99ac[_0x463e3f(0x1d2)]()===_0x31180c[_0x463e3f(0x1a2)][_0x463e3f(0x1d2)]()){_0x1d1d33[_0x463e3f(0x1b2)](_0x2cea0a,_0x37ec3d);break;}}_0x5dffc4[_0x463e3f(0x1cd)]();for(const [_0x3f3f66,_0x3887c4]of _0x1d1d33){_0x5dffc4[_0x463e3f(0x1b2)](_0x3f3f66,_0x3887c4);}}if(_0x5dffc4[_0x463e3f(0x1c7)]>0x0){_0x26d5cc?.[_0x463e3f(0x1ce)](_0x463e3f(0x1b4));const _0x329457=Array[_0x463e3f(0x1b7)](_0x5dffc4[_0x463e3f(0x1c2)]()),_0x183ed3=0x5,{createYamlContext:_0x580e52}=createYamlContextForBundle(_0x2e92f8,_0x505f3a,_0x329382,_0x451e99,_0x4b2f4b,_0x3ccbe5);for(let _0xa3c033=0x0;_0xa3c033<_0x329457['length'];_0xa3c033+=_0x183ed3){const _0x169185=_0x329457[_0x463e3f(0x19c)](_0xa3c033,_0xa3c033+_0x183ed3),_0x1c7d29=await Promise[_0x463e3f(0x199)](_0x169185[_0x463e3f(0x19a)](async _0x28ea72=>{const _0x15a94c=_0x463e3f,_0x24aa34=_0x28ea72[0x0],_0x4f09c3=_0x24aa34[_0x15a94c(0x1d5)];_0x26d5cc?.[_0x15a94c(0x1ce)]('Processing\x20journey:\x20'+_0x4f09c3);const _0x8dc311=_0x24aa34[_0x15a94c(0x196)]?_0x3013b1['get'](_0x24aa34[_0x15a94c(0x196)])||'':'',_0x58f9d0=_0x8dc311?a201_0x2ceaf5['join'](_0x569d89,_0x8dc311):_0x569d89,_0x3576df=sanitizeFileName(_0x4f09c3),_0x173764=a201_0x2ceaf5[_0x15a94c(0x1aa)](_0x58f9d0,_0x3576df+_0x15a94c(0x1a0));let _0x438369;if(existsSync(_0x173764))try{const _0x19d68a=readFileSync(_0x173764,_0x15a94c(0x1bf)),_0x457b95=a201_0xb68a64(_0x19d68a);_0x438369=buildLocalRuleToNameMappingFromJourney(_0x457b95);}catch{}const _0x4a091f=[];for(const _0x4c57a2 of _0x28ea72){const _0x398d3=_0x3ccbe5[_0x15a94c(0x1c0)](_0x4c57a2['id']);if(!_0x398d3){_0x26d5cc?.[_0x15a94c(0x1ce)](_0x15a94c(0x1a4)+_0x4c57a2['id']+'\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping');continue;}const _0x429970=_0x398d3[_0x15a94c(0x1d6)]?.[_0x15a94c(0x1c6)],_0x335c95=_0x580e52(_0x4c57a2['id'],_0x429970),_0x4b54e0=await journeyResponseToDef(_0x398d3,_0x335c95);_0x4a091f['push']({'item':_0x4c57a2,'yaml':_0x4b54e0});}const _0x2eedfa=await _0x2e92f8[_0x15a94c(0x1c3)][_0x15a94c(0x1a7)](_0x24aa34[_0x15a94c(0x1db)]),_0x1eec1e=buildMergedJourneyDef(_0x4a091f,_0x438369,_0x2eedfa);return{'bundleName':_0x4f09c3,'folderPath':_0x8dc311,'finalYaml':_0x1eec1e};}));for(const {bundleName:_0x17df84,folderPath:_0x5a91b5,finalYaml:_0x428323}of _0x1c7d29){const _0x1391af=normalizeJourneyDef(_0x428323),_0xf4fa2c=a201_0x261f19(_0x1391af),_0x1a6b25=_0x5a91b5?a201_0x2ceaf5[_0x463e3f(0x1aa)](_0x569d89,_0x5a91b5):_0x569d89,_0x142fbf=sanitizeFileName(_0x17df84),_0x4e6fad=getUniqueFileName(_0x1a6b25,_0x142fbf,_0x344ea5),_0x1a45d6=a201_0x2ceaf5[_0x463e3f(0x1aa)](_0x1a6b25,_0x4e6fad+_0x463e3f(0x1a0));_0x23f958[_0x463e3f(0x1b5)](prepareFile(_0x1a45d6,_0xf4fa2c,_0x569d89));}}}const _0x20e8ff=Array['from'](_0xab4be1['values']())[_0x463e3f(0x1c8)]((_0x2c3ab9,_0xe0f8f5)=>_0x2c3ab9+_0xe0f8f5[_0x463e3f(0x1ca)],0x0),_0x342de9=_0x57a6dc[_0x463e3f(0x1d8)](_0x3e78ae=>_0x3e78ae[_0x463e3f(0x1b0)]!==SEGMENT_KIND_JOURNEY),_0x51b869=_0x23f958[_0x463e3f(0x1d8)](_0x11dc76=>_0x11dc76[_0x463e3f(0x1bd)])[_0x463e3f(0x1ca)],_0x2ceb4c=_0x23f958[_0x463e3f(0x1d8)](_0x54be06=>!_0x54be06['isNew']&&_0x54be06['hasChanges'])[_0x463e3f(0x1ca)],_0x298ce1=_0x23f958[_0x463e3f(0x1d8)](_0x126be3=>!_0x126be3[_0x463e3f(0x1bd)]&&!_0x126be3[_0x463e3f(0x1dd)])[_0x463e3f(0x1ca)],_0x2810ca=Array[_0x463e3f(0x1b7)](_0x5dffc4[_0x463e3f(0x1c2)]())[_0x463e3f(0x1c8)]((_0x5b5359,_0x284875)=>_0x5b5359+_0x284875['length'],0x0);return{'parentName':_0x5728dc,'parentId':_0x5bc1b2,'targetDir':_0x569d89,'files':_0x23f958,'counts':{'segments':_0x342de9[_0x463e3f(0x1ca)],'journeys':_0x5dffc4[_0x463e3f(0x1c7)],'journeyVersions':_0x2810ca,'activations':_0x20e8ff},'newFiles':_0x51b869,'changedFiles':_0x2ceb4c,'unchangedFiles':_0x298ce1};}function createYamlContextForBundle(_0x3f91e9,_0x1cb772,_0x4f7455,_0x116254,_0x2344c9,_0x17fed4){const _0x4ce730=new Set(),_0x5b572a=new Map(),_0x51ec9f=new Map(),_0xe8f821=createJumpTargetCache(),_0x4b2611=async(_0x47e9eb,_0x1a40a8)=>{const _0x2387db=a201_0x3731,_0x24d8c5=_0x5b572a[_0x2387db(0x1c0)](_0x47e9eb);if(_0x24d8c5!==undefined)return _0x24d8c5;if(!_0x1a40a8)return _0x47e9eb;try{let _0x4e12be=_0x1cb772[_0x2387db(0x1c0)](_0x47e9eb);!_0x4e12be&&(_0x4e12be=await _0x3f91e9[_0x2387db(0x1af)][_0x2387db(0x1dc)](_0x1a40a8,_0x47e9eb),_0x1cb772[_0x2387db(0x1b2)](_0x47e9eb,_0x4e12be));const _0x124676=generateJourneyLocalName(_0x4e12be[_0x2387db(0x19f)]),_0xb3894e=_0x4e12be[_0x2387db(0x1b0)]===SEGMENT_KIND_JOURNEY&&_0x124676!==undefined;if(_0xb3894e&&_0x124676){let _0x135190=_0x124676,_0x2caa4d=0x2;while(_0x4ce730[_0x2387db(0x19d)](_0x135190)){_0x135190=_0x124676+'_'+_0x2caa4d,_0x2caa4d++;}return _0x4ce730[_0x2387db(0x1b1)](_0x135190),_0x5b572a[_0x2387db(0x1b2)](_0x47e9eb,_0x135190),_0x135190;}return _0x4e12be[_0x2387db(0x19f)];}catch{return _0x47e9eb;}},_0xa773f0=(_0x56998d,_0x248efc)=>({'resolveSegment':async _0x852d9f=>{const _0x2c16ce=a201_0x3731,_0x1b1ac0=_0x5b572a[_0x2c16ce(0x1c0)](_0x852d9f);if(_0x1b1ac0!==undefined)return{'name':_0x1b1ac0,'isJourneyLocal':!![]};if(!_0x248efc)return{'name':_0x852d9f,'isJourneyLocal':![]};try{let _0x4c6500=_0x1cb772[_0x2c16ce(0x1c0)](_0x852d9f);!_0x4c6500&&(_0x4c6500=await _0x3f91e9[_0x2c16ce(0x1af)]['getSegment'](_0x248efc,_0x852d9f),_0x1cb772[_0x2c16ce(0x1b2)](_0x852d9f,_0x4c6500));const _0x721fc8=generateJourneyLocalName(_0x4c6500[_0x2c16ce(0x19f)]),_0x1fb918=_0x4c6500[_0x2c16ce(0x1b0)]===SEGMENT_KIND_JOURNEY&&_0x721fc8!==undefined;if(_0x1fb918&&!_0x4c6500[_0x2c16ce(0x197)]&&_0x248efc)try{const _0x4f0675=await _0x3f91e9[_0x2c16ce(0x1af)]['getSegment'](_0x248efc,_0x852d9f);_0x1cb772[_0x2c16ce(0x1b2)](_0x852d9f,_0x4f0675),_0x4c6500=_0x4f0675;}catch{}const _0x3bc0af=await _0x4b2611(_0x852d9f,_0x248efc);let _0x4d8a43;if(_0x1fb918&&_0x4c6500[_0x2c16ce(0x197)]){const _0x17eeb6=await segmentResponseToDef(_0x4c6500,{'resolveSegmentName':_0x58b0bc=>_0x4b2611(_0x58b0bc,_0x248efc)});_0x4d8a43={'description':_0x4c6500[_0x2c16ce(0x1c1)],'rule':_0x17eeb6[_0x2c16ce(0x197)]};}return{'name':_0x3bc0af,'isJourneyLocal':_0x1fb918,'definition':_0x4d8a43};}catch{return{'name':_0x852d9f,'isJourneyLocal':![]};}},'resolveActivation':async _0x4a5cb3=>{const _0x57235d=a201_0x3731,_0x387fd5=_0x51ec9f[_0x57235d(0x1c0)](_0x4a5cb3);if(_0x387fd5!==undefined)return{'name':_0x387fd5,'isJourneyLocal':!![]};try{let _0xf64ac2=_0x2344c9['get'](_0x4a5cb3);!_0xf64ac2&&(_0xf64ac2=await _0x3f91e9[_0x57235d(0x1c3)]['getActivation'](_0x56998d,_0x4a5cb3));const _0x5bfa59=_0xf64ac2[_0x57235d(0x1d6)]['activationParams']['name']||_0x4a5cb3,_0x4c7c40=sanitizeYamlKey(_0x5bfa59)||'activation_'+_0x4a5cb3,_0x51ba4f=_0x4c7c40;_0x51ec9f[_0x57235d(0x1b2)](_0x4a5cb3,_0x51ba4f);const _0xd2d2c5=journeyActivationStepToYaml(_0xf64ac2,_0x4f7455,_0x116254);return{'name':_0x51ba4f,'isJourneyLocal':!![],'definition':_0xd2d2c5};}catch{return{'name':_0x4a5cb3,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x52d384,_0x326bb7)=>resolveJumpTarget(_0x52d384,_0x326bb7,_0xe8f821,async _0x1b3c02=>{const _0x13bd63=a201_0x3731,_0x546c96=_0x17fed4[_0x13bd63(0x1c0)](_0x1b3c02);if(_0x546c96)return _0x546c96;return _0x3f91e9[_0x13bd63(0x1c3)][_0x13bd63(0x1b9)](_0x1b3c02);})});return{'createYamlContext':_0xa773f0};}
|
|
1
|
+
(function(_0x3f0ba0,_0xfffe03){const _0x38eceb=a201_0x2b06,_0x46c3cb=_0x3f0ba0();while(!![]){try{const _0x2ef1d6=-parseInt(_0x38eceb(0xd1))/0x1+-parseInt(_0x38eceb(0xcd))/0x2*(-parseInt(_0x38eceb(0xe1))/0x3)+-parseInt(_0x38eceb(0xea))/0x4*(-parseInt(_0x38eceb(0xd7))/0x5)+parseInt(_0x38eceb(0xee))/0x6+parseInt(_0x38eceb(0xd0))/0x7*(-parseInt(_0x38eceb(0xcb))/0x8)+parseInt(_0x38eceb(0x108))/0x9+-parseInt(_0x38eceb(0xd8))/0xa;if(_0x2ef1d6===_0xfffe03)break;else _0x46c3cb['push'](_0x46c3cb['shift']());}catch(_0x4f949f){_0x46c3cb['push'](_0x46c3cb['shift']());}}}(a201_0x434b,0x672e9));import a201_0x294e97 from'path';import{existsSync,readFileSync}from'fs';function a201_0x2b06(_0x305c27,_0x1d8169){_0x305c27=_0x305c27-0xc6;const _0x434b7e=a201_0x434b();let _0x2b068b=_0x434b7e[_0x305c27];return _0x2b068b;}import{generateDiff,formatDiffWithColors,hasChanges}from'../../utils/diff.js';import{sanitizeFileName}from'../../utils/string-utils.js';import{batchAsync}from'../../utils/async.js';function a201_0x434b(){const _0x5d2c04=['Fetching\x20activations','hasChanges','1015216RBInsl','kind','2bBXyIn','\x20not\x20found\x20in\x20pre-fetched\x20data,\x20skipping','versionNumber','7scVZbq','99210oQSfoq','update','Fetching\x20users\x20and\x20connections','has','map','user','115dwntYp','9713520tGhYwZ','segment','attributes','journey','Processing\x20journeys','segmentFolderId','Processing\x20journey:\x20','.yml','size','1129539UbvFbq','audienceId','state','targetResourceName','description','isNew','getActivation','segments/','journeyBundleName','90196wPowmd','utf-8','name','activation_','3276282rYtOhE','length','buildIdToEmailMap','set','Resolving\x20parent\x20segment','resolveParentId','get','getParent','listJourneysWithDetailsFromParentSegment','push','connection','tdx.json','paused','Fetching\x20parent\x20segment\x20info','data','from','values','getLatestJourneyId','activationParams','journeyBundleId','parentFolder','relative','getSegment','add','toLowerCase','join','1610190EIVSKb','listSegments','clear','folderId','filter','Warning:\x20Journey\x20','all','reduce'];a201_0x434b=function(){return _0x5d2c04;};return a201_0x434b();}import{buildFolderIdToPathMap}from'./resolution-context.js';import{segmentWithActivationsToYaml,segmentToYamlString,segmentResponseToDef,journeyActivationStepToYaml}from'./child-segment-yaml.js';import{journeyResponseToDef,toYamlString as a201_0x66d2e4,normalizeJourneyDef,parseYamlString as a201_0x4af3ca}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(_0x33f21d,_0x2f8dfc,_0x3850bc){const _0xd555cf=a201_0x2b06,_0x400d9d=a201_0x294e97[_0xd555cf(0x103)](_0x3850bc,_0x33f21d);if(existsSync(_0x33f21d)){const _0x1406fd=readFileSync(_0x33f21d,_0xd555cf(0xeb)),_0x2d2ff9=generateDiff(_0x1406fd,_0x2f8dfc),_0x2a1480=hasChanges(_0x2d2ff9);return{'relativePath':_0x400d9d,'absolutePath':_0x33f21d,'content':_0x2f8dfc,'isNew':![],'hasChanges':_0x2a1480,'diff':_0x2a1480?formatDiffWithColors(_0x2d2ff9):undefined};}return{'relativePath':_0x400d9d,'absolutePath':_0x33f21d,'content':_0x2f8dfc,'isNew':!![],'hasChanges':![]};}function getUniqueFileName(_0x2f4c16,_0x2c0757,_0x1ecb8d){const _0x51bba9=a201_0x2b06,_0x3782bc=_0x2f4c16+':'+_0x2c0757,_0x156f92=_0x1ecb8d[_0x51bba9(0xf4)](_0x3782bc)||0x0;_0x1ecb8d[_0x51bba9(0xf1)](_0x3782bc,_0x156f92+0x1);if(_0x156f92===0x0)return _0x2c0757;return _0x2c0757+'_'+(_0x156f92+0x1);}export async function pullSegments(_0x2b6209,_0x315835,_0x4fdc31={}){const _0xa10945=a201_0x2b06,{targetDir:_0x3c2d19,progress:_0x5817a5}=_0x4fdc31;_0x5817a5?.[_0xa10945(0xd2)](_0xa10945(0xf2));const _0x56f7ca=await _0x2b6209['segment'][_0xa10945(0xf3)](_0x315835);_0x5817a5?.[_0xa10945(0xd2)](_0xa10945(0xfb));const _0x5efd67=await _0x2b6209[_0xa10945(0xd9)][_0xa10945(0xf5)](_0x56f7ca),_0x2af03e=_0x5efd67['attributes'][_0xa10945(0xec)];_0x5817a5?.[_0xa10945(0xd2)]('Fetching\x20segments,\x20folders,\x20and\x20journeys');const [_0x1dbb98,_0x2a7aea,_0x58d218]=await Promise[_0xa10945(0xc7)]([_0x2b6209[_0xa10945(0xd9)][_0xa10945(0x109)](_0x56f7ca),_0x2b6209[_0xa10945(0xd9)]['listFolders'](_0x56f7ca),_0x2b6209['journey'][_0xa10945(0xf6)](_0x56f7ca,{'includeAllVersions':!![]})]),{journeys:_0x3eb298,activationStepsById:_0x1c1c3a}=_0x58d218,_0x78df67=new Map();for(const _0x21604a of _0x3eb298){_0x78df67['set'](_0x21604a['id'],_0x21604a);}const _0x14e926=_0x3eb298[_0xa10945(0xd5)](_0x3154ac=>({'id':_0x3154ac['id'],'name':_0x3154ac[_0xa10945(0xda)][_0xa10945(0xec)],'journeyBundleName':_0x3154ac['attributes'][_0xa10945(0xe9)]||'','journeyBundleId':_0x3154ac[_0xa10945(0xda)][_0xa10945(0x101)]||'','versionNumber':_0x3154ac[_0xa10945(0xda)][_0xa10945(0xcf)],'description':_0x3154ac[_0xa10945(0xda)]['description'],'state':_0x3154ac[_0xa10945(0xda)][_0xa10945(0xe3)],'paused':_0x3154ac['attributes'][_0xa10945(0xfa)],'audienceId':_0x3154ac[_0xa10945(0xda)]['audienceId'],'folderId':_0x3154ac['relationships']?.[_0xa10945(0x102)]?.[_0xa10945(0xfc)]?.['id'],'createdAt':_0x3154ac[_0xa10945(0xda)]['createdAt'],'updatedAt':_0x3154ac[_0xa10945(0xda)]['updatedAt']})),_0x304809=buildFolderIdToPathMap(_0x2a7aea),_0x2dffb6=_0x3c2d19||_0xa10945(0xe8)+sanitizeFileName(_0x2af03e);_0x5817a5?.[_0xa10945(0xd2)](_0xa10945(0xc9));const _0x4a0602=new Map();await batchAsync(_0x1dbb98,async _0x50d9dd=>{const _0x4cb194=_0xa10945,_0xf51d2f=await _0x2b6209['segment']['listActivations'](_0x56f7ca,_0x50d9dd['id']);_0x4a0602[_0x4cb194(0xf1)](_0x50d9dd['id'],_0xf51d2f);}),_0x5817a5?.['update'](_0xa10945(0xd3));const [_0x19572d,_0x3f82fa]=await Promise['all']([_0x2b6209[_0xa10945(0xd6)][_0xa10945(0xf0)](),_0x2b6209[_0xa10945(0xf8)]['buildIdToNameMap']()]),_0x5c2b06=[],_0xb65e77=new Map(),_0x11b0ed=a201_0x294e97['join'](_0x2dffb6,_0xa10945(0xf9)),_0x2b9302=createTdxConfigContent(_0x2af03e);_0x5c2b06['push'](prepareFile(_0x11b0ed,_0x2b9302,_0x2dffb6));const _0x57ada3=new Map();for(const _0x17ad1e of _0x1dbb98){_0x57ada3[_0xa10945(0xf1)](_0x17ad1e['id'],_0x17ad1e);}let _0x5d3bba=_0x1dbb98;if(_0x4fdc31[_0xa10945(0xe4)]){const _0x327201=_0x1dbb98[_0xa10945(0x10c)](_0x35def8=>_0x35def8['name'][_0xa10945(0x106)]()===_0x4fdc31['targetResourceName']['toLowerCase']());_0x327201[_0xa10945(0xef)]>0x0&&(_0x5d3bba=_0x327201);}_0x5817a5?.[_0xa10945(0xd2)]('Processing\x20segments');for(const _0x3a010a of _0x5d3bba){if(_0x3a010a[_0xa10945(0xcc)]===SEGMENT_KIND_JOURNEY)continue;const _0x11d7f0=_0x3a010a[_0xa10945(0xdd)]?_0x304809[_0xa10945(0xf4)](_0x3a010a[_0xa10945(0xdd)])||'':'',_0x3763d5=_0x4a0602['get'](_0x3a010a['id'])||[],_0x21bbc1=segmentWithActivationsToYaml(_0x3a010a,_0x3763d5,undefined,_0x19572d,_0x3f82fa),_0x5f1c91=_0x11d7f0?a201_0x294e97[_0xa10945(0x107)](_0x2dffb6,_0x11d7f0):_0x2dffb6,_0x35d628=sanitizeFileName(_0x3a010a[_0xa10945(0xec)]),_0x33152b=getUniqueFileName(_0x5f1c91,_0x35d628,_0xb65e77),_0x41aa84=a201_0x294e97[_0xa10945(0x107)](_0x5f1c91,_0x33152b+_0xa10945(0xdf)),_0x380a88=segmentToYamlString(_0x21bbc1);_0x5c2b06[_0xa10945(0xf7)](prepareFile(_0x41aa84,_0x380a88,_0x2dffb6));}const _0x3afb36=new Map();for(const _0x47586e of _0x14e926){const _0x2ac80b=_0x47586e[_0xa10945(0x101)];!_0x3afb36[_0xa10945(0xd4)](_0x2ac80b)&&_0x3afb36['set'](_0x2ac80b,[]),_0x3afb36[_0xa10945(0xf4)](_0x2ac80b)[_0xa10945(0xf7)](_0x47586e);}for(const _0x274ba2 of _0x3afb36[_0xa10945(0xfe)]()){_0x274ba2['sort']((_0xd47718,_0x312d69)=>(_0xd47718[_0xa10945(0xcf)]||0x0)-(_0x312d69[_0xa10945(0xcf)]||0x0));}if(_0x4fdc31[_0xa10945(0xe4)]){const _0x484ec2=new Map();for(const [_0x286e96,_0x4561cc]of _0x3afb36){const _0x45805f=_0x4561cc[0x0][_0xa10945(0xe9)];if(_0x45805f[_0xa10945(0x106)]()===_0x4fdc31[_0xa10945(0xe4)][_0xa10945(0x106)]()){_0x484ec2['set'](_0x286e96,_0x4561cc);break;}}_0x3afb36[_0xa10945(0x10a)]();for(const [_0x580aa7,_0x5d4c09]of _0x484ec2){_0x3afb36[_0xa10945(0xf1)](_0x580aa7,_0x5d4c09);}}if(_0x3afb36[_0xa10945(0xe0)]>0x0){_0x5817a5?.[_0xa10945(0xd2)](_0xa10945(0xdc));const _0x1b0bfa=Array[_0xa10945(0xfd)](_0x3afb36['values']()),_0xbef3dc=0x5,{createYamlContext:_0x2a4336}=createYamlContextForBundle(_0x2b6209,_0x57ada3,_0x19572d,_0x3f82fa,_0x1c1c3a,_0x78df67);for(let _0x1c4ed0=0x0;_0x1c4ed0<_0x1b0bfa['length'];_0x1c4ed0+=_0xbef3dc){const _0x4457f0=_0x1b0bfa['slice'](_0x1c4ed0,_0x1c4ed0+_0xbef3dc),_0x335e7a=await Promise[_0xa10945(0xc7)](_0x4457f0[_0xa10945(0xd5)](async _0x47ba47=>{const _0x3ad591=_0xa10945,_0xcac018=_0x47ba47[0x0],_0x26bc4e=_0xcac018[_0x3ad591(0xe9)];_0x5817a5?.[_0x3ad591(0xd2)](_0x3ad591(0xde)+_0x26bc4e);const _0x194ae5=_0xcac018[_0x3ad591(0x10b)]?_0x304809[_0x3ad591(0xf4)](_0xcac018['folderId'])||'':'',_0x260b43=_0x194ae5?a201_0x294e97[_0x3ad591(0x107)](_0x2dffb6,_0x194ae5):_0x2dffb6,_0x224272=sanitizeFileName(_0x26bc4e),_0x40922b=a201_0x294e97[_0x3ad591(0x107)](_0x260b43,_0x224272+_0x3ad591(0xdf));let _0x10c787;if(existsSync(_0x40922b))try{const _0x4684ef=readFileSync(_0x40922b,_0x3ad591(0xeb)),_0x37cb12=a201_0x4af3ca(_0x4684ef);_0x10c787=buildLocalRuleToNameMappingFromJourney(_0x37cb12);}catch{}const _0x898b15=[];for(const _0x3fa31f of _0x47ba47){const _0xce5a25=_0x78df67[_0x3ad591(0xf4)](_0x3fa31f['id']);if(!_0xce5a25){_0x5817a5?.[_0x3ad591(0xd2)](_0x3ad591(0xc6)+_0x3fa31f['id']+_0x3ad591(0xce));continue;}const _0x4c1edb=_0xce5a25['attributes']?.[_0x3ad591(0xe2)],_0x484772=_0x2a4336(_0x3fa31f['id'],_0x4c1edb),_0x5902ae=await journeyResponseToDef(_0xce5a25,_0x484772);_0x898b15[_0x3ad591(0xf7)]({'item':_0x3fa31f,'yaml':_0x5902ae});}const _0x5c23b0=await _0x2b6209[_0x3ad591(0xdb)][_0x3ad591(0xff)](_0xcac018[_0x3ad591(0x101)]),_0x1e3648=buildMergedJourneyDef(_0x898b15,_0x10c787,_0x5c23b0);return{'bundleName':_0x26bc4e,'folderPath':_0x194ae5,'finalYaml':_0x1e3648};}));for(const {bundleName:_0x29364a,folderPath:_0x26c42c,finalYaml:_0x4f655e}of _0x335e7a){const _0xf1eaaa=normalizeJourneyDef(_0x4f655e),_0x1c3d63=a201_0x66d2e4(_0xf1eaaa),_0x3a8a8c=_0x26c42c?a201_0x294e97[_0xa10945(0x107)](_0x2dffb6,_0x26c42c):_0x2dffb6,_0x590a49=sanitizeFileName(_0x29364a),_0x135f20=getUniqueFileName(_0x3a8a8c,_0x590a49,_0xb65e77),_0x597720=a201_0x294e97['join'](_0x3a8a8c,_0x135f20+'.yml');_0x5c2b06[_0xa10945(0xf7)](prepareFile(_0x597720,_0x1c3d63,_0x2dffb6));}}}const _0x8a3431=Array[_0xa10945(0xfd)](_0x4a0602[_0xa10945(0xfe)]())[_0xa10945(0xc8)]((_0x3bb85d,_0x397edd)=>_0x3bb85d+_0x397edd['length'],0x0),_0x4d43f9=_0x5d3bba[_0xa10945(0x10c)](_0x1368ad=>_0x1368ad['kind']!==SEGMENT_KIND_JOURNEY),_0x47e5ac=_0x5c2b06[_0xa10945(0x10c)](_0xa3864e=>_0xa3864e[_0xa10945(0xe6)])[_0xa10945(0xef)],_0x3cf1a5=_0x5c2b06[_0xa10945(0x10c)](_0x51a8ac=>!_0x51a8ac[_0xa10945(0xe6)]&&_0x51a8ac[_0xa10945(0xca)])[_0xa10945(0xef)],_0x3a2131=_0x5c2b06[_0xa10945(0x10c)](_0x35590b=>!_0x35590b[_0xa10945(0xe6)]&&!_0x35590b['hasChanges'])[_0xa10945(0xef)],_0x145e46=Array['from'](_0x3afb36[_0xa10945(0xfe)]())['reduce']((_0x4934d0,_0xe52069)=>_0x4934d0+_0xe52069[_0xa10945(0xef)],0x0);return{'parentName':_0x2af03e,'parentId':_0x56f7ca,'targetDir':_0x2dffb6,'files':_0x5c2b06,'counts':{'segments':_0x4d43f9[_0xa10945(0xef)],'journeys':_0x3afb36[_0xa10945(0xe0)],'journeyVersions':_0x145e46,'activations':_0x8a3431},'newFiles':_0x47e5ac,'changedFiles':_0x3cf1a5,'unchangedFiles':_0x3a2131};}function createYamlContextForBundle(_0x9a93ef,_0x45413c,_0xcaa91e,_0x14ab98,_0x3c3237,_0x5cf520){const _0x471ebc=new Set(),_0x49a74c=new Map(),_0x5603ea=new Map(),_0x42d2f1=createJumpTargetCache(),_0x28d6a8=async(_0x4a79c4,_0x26c06f)=>{const _0x45a1ed=a201_0x2b06,_0x3df63e=_0x49a74c[_0x45a1ed(0xf4)](_0x4a79c4);if(_0x3df63e!==undefined)return _0x3df63e;if(!_0x26c06f)return _0x4a79c4;try{let _0xedb9cf=_0x45413c[_0x45a1ed(0xf4)](_0x4a79c4);!_0xedb9cf&&(_0xedb9cf=await _0x9a93ef[_0x45a1ed(0xd9)][_0x45a1ed(0x104)](_0x26c06f,_0x4a79c4),_0x45413c['set'](_0x4a79c4,_0xedb9cf));const _0x3f9449=generateJourneyLocalName(_0xedb9cf[_0x45a1ed(0xec)]),_0x3119d6=_0xedb9cf[_0x45a1ed(0xcc)]===SEGMENT_KIND_JOURNEY&&_0x3f9449!==undefined;if(_0x3119d6&&_0x3f9449){let _0x1f712d=_0x3f9449,_0x1cb676=0x2;while(_0x471ebc[_0x45a1ed(0xd4)](_0x1f712d)){_0x1f712d=_0x3f9449+'_'+_0x1cb676,_0x1cb676++;}return _0x471ebc[_0x45a1ed(0x105)](_0x1f712d),_0x49a74c[_0x45a1ed(0xf1)](_0x4a79c4,_0x1f712d),_0x1f712d;}return _0xedb9cf[_0x45a1ed(0xec)];}catch{return _0x4a79c4;}},_0x402128=(_0x541fec,_0x5e680b)=>({'resolveSegment':async _0x4a5022=>{const _0x93ae11=a201_0x2b06,_0x1102d4=_0x49a74c[_0x93ae11(0xf4)](_0x4a5022);if(_0x1102d4!==undefined)return{'name':_0x1102d4,'isJourneyLocal':!![]};if(!_0x5e680b)return{'name':_0x4a5022,'isJourneyLocal':![]};try{let _0x365efc=_0x45413c[_0x93ae11(0xf4)](_0x4a5022);!_0x365efc&&(_0x365efc=await _0x9a93ef['segment']['getSegment'](_0x5e680b,_0x4a5022),_0x45413c[_0x93ae11(0xf1)](_0x4a5022,_0x365efc));const _0x19b85c=generateJourneyLocalName(_0x365efc[_0x93ae11(0xec)]),_0x2f6c36=_0x365efc[_0x93ae11(0xcc)]===SEGMENT_KIND_JOURNEY&&_0x19b85c!==undefined;if(_0x2f6c36&&!_0x365efc['rule']&&_0x5e680b)try{const _0x4336a5=await _0x9a93ef[_0x93ae11(0xd9)][_0x93ae11(0x104)](_0x5e680b,_0x4a5022);_0x45413c[_0x93ae11(0xf1)](_0x4a5022,_0x4336a5),_0x365efc=_0x4336a5;}catch{}const _0x17efd2=await _0x28d6a8(_0x4a5022,_0x5e680b);let _0x28f792;if(_0x2f6c36&&_0x365efc['rule']){const _0x15e9f0=await segmentResponseToDef(_0x365efc,{'resolveSegmentName':_0x2ccd07=>_0x28d6a8(_0x2ccd07,_0x5e680b)});_0x28f792={'description':_0x365efc[_0x93ae11(0xe5)],'rule':_0x15e9f0['rule']};}return{'name':_0x17efd2,'isJourneyLocal':_0x2f6c36,'definition':_0x28f792};}catch{return{'name':_0x4a5022,'isJourneyLocal':![]};}},'resolveActivation':async _0x9a091=>{const _0x2d7f7f=a201_0x2b06,_0x430ac8=_0x5603ea[_0x2d7f7f(0xf4)](_0x9a091);if(_0x430ac8!==undefined)return{'name':_0x430ac8,'isJourneyLocal':!![]};try{let _0x2436f5=_0x3c3237['get'](_0x9a091);!_0x2436f5&&(_0x2436f5=await _0x9a93ef['journey'][_0x2d7f7f(0xe7)](_0x541fec,_0x9a091));const _0x307d5a=_0x2436f5[_0x2d7f7f(0xda)][_0x2d7f7f(0x100)][_0x2d7f7f(0xec)]||_0x9a091,_0x148128=sanitizeYamlKey(_0x307d5a)||_0x2d7f7f(0xed)+_0x9a091,_0x1afc68=_0x148128;_0x5603ea[_0x2d7f7f(0xf1)](_0x9a091,_0x1afc68);const _0x32a83e=journeyActivationStepToYaml(_0x2436f5,_0xcaa91e,_0x14ab98);return{'name':_0x1afc68,'isJourneyLocal':!![],'definition':_0x32a83e};}catch{return{'name':_0x9a091,'isJourneyLocal':![]};}},'resolveJumpTarget':(_0x2ebd69,_0x592621)=>resolveJumpTarget(_0x2ebd69,_0x592621,_0x42d2f1,async _0x57e18a=>{const _0x2faa77=a201_0x2b06,_0x4efc3c=_0x5cf520[_0x2faa77(0xf4)](_0x57e18a);if(_0x4efc3c)return _0x4efc3c;return _0x9a93ef[_0x2faa77(0xdb)]['getJourney'](_0x57e18a);})});return{'createYamlContext':_0x402128};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
const a202_0x4aac06=a202_0x1cfd;(function(_0x4a58ea,_0x329c64){const _0x101cd8=a202_0x1cfd,_0xf44df7=_0x4a58ea();while(!![]){try{const _0x1ffbf8=-parseInt(_0x101cd8(0xe2))/0x1*(parseInt(_0x101cd8(0xde))/0x2)+-parseInt(_0x101cd8(0xe8))/0x3+parseInt(_0x101cd8(0xe1))/0x4*(parseInt(_0x101cd8(0xeb))/0x5)+-parseInt(_0x101cd8(0xdb))/0x6*(parseInt(_0x101cd8(0xe6))/0x7)+-parseInt(_0x101cd8(0xdf))/0x8+parseInt(_0x101cd8(0xd7))/0x9*(parseInt(_0x101cd8(0xe4))/0xa)+-parseInt(_0x101cd8(0xe5))/0xb*(-parseInt(_0x101cd8(0xef))/0xc);if(_0x1ffbf8===_0x329c64)break;else _0xf44df7['push'](_0xf44df7['shift']());}catch(_0x14d65e){_0xf44df7['push'](_0xf44df7['shift']());}}}(a202_0x524b,0x6b35f));function a202_0x1cfd(_0x5965e9,_0x9a3f9b){_0x5965e9=_0x5965e9-0xd7;const _0x524b75=a202_0x524b();let _0x1cfdec=_0x524b75[_0x5965e9];return _0x1cfdec;}import{readFileSync,writeFileSync,unlinkSync,existsSync,renameSync}from'fs';import a202_0xfbdf04 from'path';import{Logger}from'../../utils/logger/index.js';const logger=Logger['of'](a202_0x4aac06(0xf1));export function getPushRecoveryPath(_0x29aa85){const _0x11e35e=a202_0x4aac06,_0x165cf0=a202_0xfbdf04[_0x11e35e(0xe3)](_0x29aa85),_0x19fe71=a202_0xfbdf04['basename'](_0x29aa85);return a202_0xfbdf04['join'](_0x165cf0,'.'+_0x19fe71+_0x11e35e(0xea));}export function readPushRecovery(_0x239e3c){const _0x52815e=a202_0x4aac06,_0xb88ac6=getPushRecoveryPath(_0x239e3c);if(!existsSync(_0xb88ac6))return undefined;try{const _0x4b8be2=readFileSync(_0xb88ac6,_0x52815e(0xec)),_0x532b3e=JSON[_0x52815e(0xed)](_0x4b8be2);if(_0x532b3e?.['version']!==0x1||typeof _0x532b3e['journeyName']!==_0x52815e(0xe7))return undefined;return _0x532b3e;}catch(_0x4c051b){return _0x4c051b instanceof SyntaxError?logger[_0x52815e(0xd8)](_0x52815e(0xe0)+_0x4c051b):logger[_0x52815e(0xee)](_0x52815e(0xf0)+_0x4c051b),undefined;}}export function writePushRecovery(_0x52b1c0,_0x486d36){const _0x3d4afb=a202_0x4aac06,_0x1115de=getPushRecoveryPath(_0x52b1c0),_0x5d1a80=_0x1115de+_0x3d4afb(0xdd);writeFileSync(_0x5d1a80,JSON[_0x3d4afb(0xe9)](_0x486d36,null,0x2)+'\x0a','utf-8'),renameSync(_0x5d1a80,_0x1115de);}export function deletePushRecovery(_0x4dc05a){const _0x122fbb=a202_0x4aac06,_0x49cec6=getPushRecoveryPath(_0x4dc05a);try{unlinkSync(_0x49cec6);}catch(_0x562455){_0x562455[_0x122fbb(0xdc)]!=='ENOENT'&&logger[_0x122fbb(0xd8)]('Failed\x20to\x20delete\x20push\x20recovery\x20file:\x20'+_0x562455);}}function a202_0x524b(){const _0xe1f921=['5870488zBdAeW','Failed\x20to\x20parse\x20push\x20recovery\x20file:\x20','16vFIGmR','9lkXbaA','dirname','4574330zlfmoh','1159037vBnwHl','11816tfGkOK','string','1068768AIhBji','stringify','.push-recovery.json','38495TuQTzF','utf-8','parse','warn','204smVWlN','Failed\x20to\x20read\x20push\x20recovery\x20file:\x20','tdx.sdk.push-recovery','9zFnhZq','debug','journeyName','toISOString','744fAvXRA','code','.tmp','120212Ghuvxw'];a202_0x524b=function(){return _0xe1f921;};return a202_0x524b();}export function saveSegmentToPushRecovery(_0x362954,_0x59c342,_0x19528d,_0x4a2716){const _0x258537=a202_0x4aac06,_0x2d88cc=readPushRecovery(_0x362954),_0x25937a=_0x2d88cc?.[_0x258537(0xd9)]===_0x59c342?{..._0x2d88cc,'updatedAt':new Date()[_0x258537(0xda)]()}:{'version':0x1,'journeyName':_0x59c342,'updatedAt':new Date()[_0x258537(0xda)](),'segments':{}};_0x25937a['segments'][_0x19528d]=_0x4a2716,writePushRecovery(_0x362954,_0x25937a);}
|