@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
|
-
function a117_0xb8bc(){const _0x4a9290=['allow_activation_behavior','Couldn\x27t\x20find','allColumns','.\x20Check\x20the\x20segment\x20in\x20Console\x20before\x20pushing\x20again\x20—\x20nothing\x20further\x20was\x20changed\x20automatically.','removedAttributes','max_activation_behavior_row','CDW\x20connection\x20not\x20found\x20or\x20not\x20accessible\x20for\x20audience\x20\x22','schema','getComposableAudience','time_column','Pushing\x20audience:\x20','map','\x20was\x20pushed','unexpected','.\x20Use\x20an\x20explicit\x20\x22columns\x22\x20list\x20instead.','COMPOSABLE_ACTIVATION_SYNTAX_ERROR','\x20composable\x20audience\x20definitions\x20in\x20the\x20target,\x20but\x20a\x20push\x20can\x20only\x20target\x20one\x20at\x20a\x20time:\x20','Failed\x20to\x20','endsWith','33dvtnIL','82204mwFFzm','\x22,\x20expected\x20\x22','has','folders','behaviors','renamedAttributeIds','rule','created','unknown','all_columns','130NKWblS','find','\x22\x20not\x20found).','\x22\x20reported\x20success,\x20but\x20re-reading\x20it\x20shows\x20it\x20doesn\x27t\x20match\x20what\x20was\x20sent:\x20','COMPOSABLE_SEGMENT_NOT_FOUND','audiences','8sweobm','allowActivationBehavior','behavior\x20\x22','Failed\x20to\x20create\x20folder\x20\x22','.yml','def','master','13101210WhiGsf','\x22\x20would\x20remove\x20','Push\x20to\x20\x22','create','connectionMaps','5489rPZLyw','\x22\x20not\x20found\x20under\x20this\x20audience\x20—\x20nothing\x20to\x20delete.','renamedAttributes','createSegment','type','Resolving\x20connections...','missing','COMPOSABLE_SEGMENT_UPDATE_ERROR','\x20that\x20exist\x20on\x20the\x20server\x20but\x20aren\x27t\x20in\x20this\x20YAML\x20—\x20the\x20backend\x20replaces\x20the\x20full\x20set\x20on\x20update,\x20it\x20doesn\x27t\x20merge.\x20No\x20changes\x20were\x20made.\x20If\x20your\x20YAML\x20is\x20stale,\x20run\x20`tdx\x20cas\x20pull`\x20and\x20reconcile\x20it.\x20If\x20removing\x20them\x20is\x20intentional,\x20re-run\x20with\x20--delete.','maxActivationBehaviorRow','max_activation_behavior_row\x20came\x20back\x20','allow_activation_behavior\x20came\x20back\x20','attribute\x20\x22','updateComposableAudience','set','CONNECTION_NOT_FOUND','\x20composable\x20audience\x20\x22','renamedBehaviors','\x22.\x20Check\x20the\x20connection\x20name\x20in\x20your\x20YAML.',')\x20is\x20still\x20present\x20after\x20the\x20push\x20—\x20expected\x20it\x20to\x20be\x20gone\x20(renames\x20recreate\x20the\x20behavior\x20under\x20a\x20new\x20id).','isFile','COMPOSABLE_SEGMENT_SYNTAX_ERROR','length','INVALID_ARGUMENT','split','3647vORgaa','folder','timeColumn','name','updateActivation','updated',')\x20is\x20still\x20present\x20after\x20the\x20push\x20—\x20expected\x20it\x20to\x20be\x20gone\x20(renames\x20recreate\x20the\x20attribute\x20under\x20a\x20new\x20id).','Found\x20','attribute(s)\x20','listFolders','some','audienceId','stringify','resolvedAudienceId','join','listActivations','COMPOSABLE_SEGMENT_VERIFICATION_FAILED','\x22\x20sets\x20\x22all_columns:\x20true\x22,\x20but\x20the\x20backend\x20only\x20accepts\x20that\x20for\x20a\x20behavior\x20that\x20already\x20has\x20it\x20—\x20','attributes','not\x20found\x20or\x20not\x20accessible','basename','list','851839pviYDi','\x20and\x20','COMPOSABLE_AUDIENCE_UPDATE_ERROR','removedBehaviors','\x20than\x20what\x20was\x20pushed','isDirectory','unexpected\x20attribute(s):\x20','\x22\x20has\x20a\x20different\x20','connection','segment','push','COMPOSABLE_ACTIVATION_UPDATE_ERROR','\x22\x20reported\x20success,\x20but\x20re-reading\x20the\x20audience\x20shows\x20it\x20doesn\x27t\x20match\x20what\x20was\x20sent:\x20','createComposableAudience','107974hjCpWA','1956645vJyjNc','audience','this\x20is\x20a\x20new\x20behavior','7026ThqRGI','activations','COMPOSABLE_AUDIENCE_VERIFICATION_FAILED','get','\x22\x20(parent\x20path\x20\x22','segments','parse','name\x20is\x20\x22','\x22\x20renamed\x20to\x20\x22','audienceName','\x22:\x20its\x20old\x20id\x20(','\x20but\x20','filter','.yaml','column','rule\x20does\x20not\x20match\x20what\x20was\x20pushed','listSegments','update','failureMessage','table','audienceDrift','8196ECXDtj','.\x20Move\x20each\x20audience\x20to\x20its\x20own\x20folder\x20before\x20pushing.','missing\x20attribute(s):\x20','INTERNAL','createFolder','renamedBehaviorIds','Composable\x20segment\x20\x22','object','connectionNotFoundMessage','createActivation','listComposableAudiences','deleteDrift','Pushing\x20segment:\x20'];a117_0xb8bc=function(){return _0x4a9290;};return a117_0xb8bc();}(function(_0x28380a,_0x46adf0){const _0x3941c2=a117_0x5ef4,_0x21b238=_0x28380a();while(!![]){try{const _0x52a53f=parseInt(_0x3941c2(0x7c))/0x1+-parseInt(_0x3941c2(0x8a))/0x2*(-parseInt(_0x3941c2(0xc3))/0x3)+parseInt(_0x3941c2(0xc4))/0x4*(-parseInt(_0x3941c2(0xce))/0x5)+-parseInt(_0x3941c2(0x8e))/0x6*(-parseInt(_0x3941c2(0xf9))/0x7)+-parseInt(_0x3941c2(0xd4))/0x8*(-parseInt(_0x3941c2(0x8b))/0x9)+-parseInt(_0x3941c2(0xdb))/0xa+parseInt(_0x3941c2(0xe0))/0xb*(parseInt(_0x3941c2(0xa3))/0xc);if(_0x52a53f===_0x46adf0)break;else _0x21b238['push'](_0x21b238['shift']());}catch(_0x2b9a54){_0x21b238['push'](_0x21b238['shift']());}}}(a117_0xb8bc,0xbbe1a));import{existsSync,readFileSync,readdirSync,statSync}from'fs';import a117_0x7e74fe from'path';import{isDeepStrictEqual}from'node:util';import{parseDef,defToApi}from'./cas-audience-yaml.js';import{parseSegmentDef,isComposableSegmentDef,defToSegmentApi,activationDefToApi}from'./cas-segment-yaml.js';import{buildFolderPathToIdMap}from'../segment/resolution-context.js';import{addFoldersToCreate,sortFoldersByDepth}from'../segment/push-workflow.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage,errorContains}from'../errors.js';import*as a117_0xd629d from'yaml';export function findAudienceByName(_0xf740c3,_0x53b1f6){const _0x5a19ba=a117_0x5ef4;return _0xf740c3[_0x5a19ba(0xcf)](_0x1139c8=>_0x1139c8[_0x5a19ba(0xfc)]===_0x53b1f6);}export function computeAudienceDrift(_0x1d4ede,_0x1b3981){const _0x3a75a4=a117_0x5ef4,_0x100bf4=_0x1b3981[_0x3a75a4(0x78)]??[],_0x4fc6b1=_0x1b3981['behaviors']??[],_0x515980=new Set(_0x100bf4[_0x3a75a4(0xbb)](_0x31ff3e=>_0x31ff3e[_0x3a75a4(0xfc)])),_0x395f92=new Set(_0x4fc6b1[_0x3a75a4(0xbb)](_0x430e4e=>_0x430e4e['name'])),_0x14b103=[],_0x40a3af=[];for(const _0x3ae511 of _0x1d4ede['attributes']??[]){if(_0x515980['has'](_0x3ae511[_0x3a75a4(0xfc)]))continue;const _0x9321e3=_0x100bf4[_0x3a75a4(0xcf)](_0x276bd3=>_0x276bd3[_0x3a75a4(0xb7)]===_0x3ae511[_0x3a75a4(0xb7)]&&_0x276bd3['table']===_0x3ae511[_0x3a75a4(0xa1)]&&_0x276bd3['column']===_0x3ae511[_0x3a75a4(0x9c)]);_0x9321e3?_0x40a3af[_0x3a75a4(0x86)]({'from':_0x3ae511['name'],'to':_0x9321e3[_0x3a75a4(0xfc)]}):_0x14b103[_0x3a75a4(0x86)](_0x3ae511[_0x3a75a4(0xfc)]);}const _0x42f26c=[],_0x24e5a9=[];for(const _0x2f24c0 of _0x1d4ede['behaviors']??[]){if(_0x395f92[_0x3a75a4(0xc6)](_0x2f24c0[_0x3a75a4(0xfc)]))continue;const _0x640c21=_0x4fc6b1[_0x3a75a4(0xcf)](_0x154c7a=>_0x154c7a[_0x3a75a4(0xb7)]===_0x2f24c0['schema']&&_0x154c7a['table']===_0x2f24c0[_0x3a75a4(0xa1)]&&_0x154c7a['time_column']===_0x2f24c0[_0x3a75a4(0xfb)]);_0x640c21?_0x24e5a9[_0x3a75a4(0x86)]({'from':_0x2f24c0[_0x3a75a4(0xfc)],'to':_0x640c21[_0x3a75a4(0xfc)]}):_0x42f26c[_0x3a75a4(0x86)](_0x2f24c0[_0x3a75a4(0xfc)]);}return{'removedAttributes':_0x14b103,'removedBehaviors':_0x42f26c,'renamedAttributes':_0x40a3af,'renamedBehaviors':_0x24e5a9};}function diffNameSets(_0x3a9b48,_0x5e3d36){const _0x1420f4=a117_0x5ef4,_0x32c721=new Set(_0x3a9b48),_0x489080=new Set(_0x5e3d36);return{'missing':_0x3a9b48['filter'](_0x65c718=>!_0x489080[_0x1420f4(0xc6)](_0x65c718)),'unexpected':_0x5e3d36[_0x1420f4(0x9a)](_0xe9f431=>!_0x32c721[_0x1420f4(0xc6)](_0xe9f431))};}export function verifyAudienceWrite(_0x3f0554,_0x34a395,_0x537ffe){const _0x20ff11=a117_0x5ef4,_0x817e6e=(_0x3f0554[_0x20ff11(0x78)]??[])[_0x20ff11(0xbb)](_0xfec334=>_0xfec334[_0x20ff11(0xfc)]),_0x1744d9=(_0x3f0554[_0x20ff11(0xc8)]??[])[_0x20ff11(0xbb)](_0x391493=>_0x391493[_0x20ff11(0xfc)]),_0x588c2f=(_0x34a395[_0x20ff11(0x78)]??[])[_0x20ff11(0xbb)](_0x4d9146=>_0x4d9146[_0x20ff11(0xfc)]),_0x5dace5=(_0x34a395[_0x20ff11(0xc8)]??[])[_0x20ff11(0xbb)](_0x2fcaf0=>_0x2fcaf0[_0x20ff11(0xfc)]),_0x63ae42=diffNameSets(_0x817e6e,_0x588c2f),_0x17ffa0=diffNameSets(_0x1744d9,_0x5dace5),_0x3cf121=[];_0x63ae42['missing'][_0x20ff11(0xf6)]&&_0x3cf121[_0x20ff11(0x86)](_0x20ff11(0xa5)+_0x63ae42[_0x20ff11(0xe6)][_0x20ff11(0x74)](',\x20'));_0x63ae42[_0x20ff11(0xbd)][_0x20ff11(0xf6)]&&_0x3cf121[_0x20ff11(0x86)](_0x20ff11(0x82)+_0x63ae42[_0x20ff11(0xbd)]['join'](',\x20'));_0x17ffa0[_0x20ff11(0xe6)]['length']&&_0x3cf121[_0x20ff11(0x86)]('missing\x20behavior(s):\x20'+_0x17ffa0[_0x20ff11(0xe6)]['join'](',\x20'));_0x17ffa0[_0x20ff11(0xbd)][_0x20ff11(0xf6)]&&_0x3cf121[_0x20ff11(0x86)]('unexpected\x20behavior(s):\x20'+_0x17ffa0['unexpected'][_0x20ff11(0x74)](',\x20'));for(const _0x9d77b1 of _0x3f0554[_0x20ff11(0x78)]??[]){const _0x5e43af=_0x34a395[_0x20ff11(0x78)]?.['find'](_0x27875e=>_0x27875e[_0x20ff11(0xfc)]===_0x9d77b1[_0x20ff11(0xfc)]);if(!_0x5e43af)continue;const _0x524f4e=[];if(_0x5e43af[_0x20ff11(0xb7)]!==_0x9d77b1['schema'])_0x524f4e[_0x20ff11(0x86)](_0x20ff11(0xb7));if(_0x5e43af['table']!==_0x9d77b1['table'])_0x524f4e[_0x20ff11(0x86)](_0x20ff11(0xa1));if(_0x5e43af[_0x20ff11(0x9c)]!==_0x9d77b1[_0x20ff11(0x9c)])_0x524f4e[_0x20ff11(0x86)](_0x20ff11(0x9c));if(_0x5e43af['type']!==_0x9d77b1[_0x20ff11(0xe4)])_0x524f4e[_0x20ff11(0x86)]('type');_0x524f4e[_0x20ff11(0xf6)]&&_0x3cf121['push']('attribute\x20\x22'+_0x9d77b1[_0x20ff11(0xfc)]+_0x20ff11(0x83)+_0x524f4e['join']('/')+_0x20ff11(0x80));}for(const _0x5d4d73 of _0x3f0554[_0x20ff11(0xc8)]??[]){const _0x3033aa=_0x34a395[_0x20ff11(0xc8)]?.['find'](_0x14b087=>_0x14b087[_0x20ff11(0xfc)]===_0x5d4d73[_0x20ff11(0xfc)]);if(!_0x3033aa)continue;const _0x1ee763=[];if(_0x3033aa[_0x20ff11(0xb7)]!==_0x5d4d73['schema'])_0x1ee763['push'](_0x20ff11(0xb7));if(_0x3033aa['table']!==_0x5d4d73[_0x20ff11(0xa1)])_0x1ee763[_0x20ff11(0x86)](_0x20ff11(0xa1));if((_0x3033aa[_0x20ff11(0xfb)]??'')!==(_0x5d4d73[_0x20ff11(0xb9)]??''))_0x1ee763[_0x20ff11(0x86)](_0x20ff11(0xb9));_0x1ee763[_0x20ff11(0xf6)]&&_0x3cf121[_0x20ff11(0x86)]('behavior\x20\x22'+_0x5d4d73['name']+_0x20ff11(0x83)+_0x1ee763[_0x20ff11(0x74)]('/')+_0x20ff11(0x80));}_0x3f0554['allow_activation_behavior']!==undefined&&_0x34a395['allowActivationBehavior']!==_0x3f0554['allow_activation_behavior']&&_0x3cf121[_0x20ff11(0x86)](_0x20ff11(0xeb)+_0x34a395[_0x20ff11(0xd5)]+_0x20ff11(0x99)+_0x3f0554[_0x20ff11(0xb0)]+_0x20ff11(0xbc));_0x3f0554['max_activation_behavior_row']!==undefined&&_0x34a395[_0x20ff11(0xe9)]!==_0x3f0554[_0x20ff11(0xb5)]&&_0x3cf121[_0x20ff11(0x86)](_0x20ff11(0xea)+_0x34a395[_0x20ff11(0xe9)]+_0x20ff11(0x99)+_0x3f0554['max_activation_behavior_row']+_0x20ff11(0xbc));const _0x5aefc7=[],_0x1089eb=[];if(_0x537ffe){const _0x225185=computeAudienceDrift(_0x537ffe,_0x3f0554);for(const {from:_0x52f665,to:_0x5b62ec}of _0x225185[_0x20ff11(0xe2)]){const _0x40551b=_0x537ffe[_0x20ff11(0x78)]?.[_0x20ff11(0xcf)](_0x30ee01=>_0x30ee01[_0x20ff11(0xfc)]===_0x52f665),_0x4e2dff=_0x34a395[_0x20ff11(0x78)]?.[_0x20ff11(0xcf)](_0x1ec517=>_0x1ec517['name']===_0x5b62ec);_0x40551b?.['id']&&_0x34a395[_0x20ff11(0x78)]?.['some'](_0x1e45a9=>_0x1e45a9['id']===_0x40551b['id'])&&_0x3cf121[_0x20ff11(0x86)](_0x20ff11(0xec)+_0x52f665+_0x20ff11(0x96)+_0x5b62ec+'\x22:\x20its\x20old\x20id\x20('+_0x40551b['id']+_0x20ff11(0xff)),_0x5aefc7['push']({'from':_0x52f665,'to':_0x5b62ec,'fromId':_0x40551b?.['id'],'toId':_0x4e2dff?.['id']});}for(const {from:_0x53e08e,to:_0x4e4d62}of _0x225185[_0x20ff11(0xf1)]){const _0x8601fa=_0x537ffe['behaviors']?.[_0x20ff11(0xcf)](_0x48a06f=>_0x48a06f[_0x20ff11(0xfc)]===_0x53e08e),_0x9b25b=_0x34a395['behaviors']?.[_0x20ff11(0xcf)](_0x455738=>_0x455738['name']===_0x4e4d62);_0x8601fa?.['id']&&_0x34a395['behaviors']?.[_0x20ff11(0x70)](_0x3ad132=>_0x3ad132['id']===_0x8601fa['id'])&&_0x3cf121[_0x20ff11(0x86)](_0x20ff11(0xd6)+_0x53e08e+_0x20ff11(0x96)+_0x4e4d62+_0x20ff11(0x98)+_0x8601fa['id']+_0x20ff11(0xf3)),_0x1089eb[_0x20ff11(0x86)]({'from':_0x53e08e,'to':_0x4e4d62,'fromId':_0x8601fa?.['id'],'toId':_0x9b25b?.['id']});}}if(_0x3cf121[_0x20ff11(0xf6)]>0x0)throw new SDKError(ErrorCode[_0x20ff11(0x90)],_0x20ff11(0xdd)+_0x3f0554[_0x20ff11(0xfc)]+_0x20ff11(0x88)+_0x3cf121[_0x20ff11(0x74)](';\x20')+'.\x20Check\x20the\x20audience\x20in\x20Console\x20before\x20pushing\x20again\x20—\x20nothing\x20further\x20was\x20changed\x20automatically.');return{'renamedAttributes':_0x5aefc7,'renamedBehaviors':_0x1089eb};}function a117_0x5ef4(_0x2792b3,_0x1dde4e){_0x2792b3=_0x2792b3-0x70;const _0xb8bcaa=a117_0xb8bc();let _0x5ef44c=_0xb8bcaa[_0x2792b3];return _0x5ef44c;}export function verifySegmentWrite(_0x4330e4,_0x2d3c39){const _0x446980=a117_0x5ef4,_0x45122b=[];_0x2d3c39[_0x446980(0xfc)]!==_0x4330e4[_0x446980(0xfc)]&&_0x45122b[_0x446980(0x86)](_0x446980(0x95)+_0x2d3c39[_0x446980(0xfc)]+_0x446980(0xc5)+_0x4330e4[_0x446980(0xfc)]+'\x22');const _0x52ae18=_0x353d96=>_0x353d96===undefined?null:JSON[_0x446980(0x94)](JSON[_0x446980(0x72)](_0x353d96));!isDeepStrictEqual(_0x52ae18(_0x2d3c39['rule']),_0x52ae18(_0x4330e4[_0x446980(0xca)]))&&_0x45122b[_0x446980(0x86)](_0x446980(0x9d));if(_0x45122b[_0x446980(0xf6)]>0x0)throw new SDKError(ErrorCode[_0x446980(0x76)],'Push\x20to\x20segment\x20\x22'+_0x4330e4[_0x446980(0xfc)]+_0x446980(0xd1)+_0x45122b[_0x446980(0x74)](';\x20')+_0x446980(0xb3));}export function findSegmentByName(_0x4cb855,_0x1cdc19){const _0xf631ed=a117_0x5ef4;return _0x4cb855[_0xf631ed(0xcf)](_0x26dc72=>_0x26dc72['name']===_0x1cdc19);}export function findActivationByName(_0x1ed313,_0x157304){const _0xba5deb=a117_0x5ef4;return _0x1ed313[_0xba5deb(0xcf)](_0x23eaad=>_0x23eaad[_0xba5deb(0xfc)]===_0x157304);}export async function deleteComposableSegment(_0x464cdf,_0x45d483,_0x1ddff9){const _0x5a4ed9=a117_0x5ef4,_0x5578d1=await _0x464cdf[_0x5a4ed9(0x9e)](_0x45d483),_0x55f87f=findSegmentByName(_0x5578d1,_0x1ddff9);if(!_0x55f87f)throw new SDKError(ErrorCode[_0x5a4ed9(0xd2)],_0x5a4ed9(0xa9)+_0x1ddff9+_0x5a4ed9(0xe1));return await _0x464cdf['deleteSegment'](_0x55f87f['id']),{'id':_0x55f87f['id']};}function mapComposableError(_0x21dc4b,_0x11b5db){const _0x5f2a09=a117_0x5ef4;if(_0x11b5db[_0x5f2a09(0xab)]&&errorContains(_0x21dc4b,'not\x20found\x20or\x20not\x20accessible',_0x5f2a09(0xb1)))throw new SDKError(ErrorCode[_0x5f2a09(0xef)],_0x11b5db[_0x5f2a09(0xab)],_0x21dc4b);const _0x27386f=isHttp400Error(_0x21dc4b),_0x13702a=_0x27386f?_0x11b5db['syntaxCode']:_0x11b5db['updateCode'];throw new SDKError(_0x13702a,_0x11b5db[_0x5f2a09(0xa0)]+'\x0a\x20\x20'+getErrorMessage(_0x21dc4b),_0x21dc4b);}export async function buildConnectionMaps(_0x289fb4){const _0x3dede7=a117_0x5ef4,_0x401dd3=await _0x289fb4[_0x3dede7(0x7b)](),_0xb435c6=new Map(),_0x1ad781=new Map(),_0x40a163=new Map();for(const _0x39db55 of _0x401dd3){_0x39db55['id']&&(_0xb435c6[_0x3dede7(0xee)](_0x39db55[_0x3dede7(0xfc)],_0x39db55['id']),_0x40a163['set'](_0x39db55['id'],_0x39db55[_0x3dede7(0xe4)])),_0x1ad781['set'](_0x39db55[_0x3dede7(0xfc)],_0x39db55[_0x3dede7(0xe4)]);}return{'nameToId':_0xb435c6,'nameToType':_0x1ad781,'idToType':_0x40a163};}function parseAndClassify(_0x1c05f3){const _0x490c9d=a117_0x5ef4,_0xa4fb95=readFileSync(_0x1c05f3,'utf-8'),_0x187ebb=a117_0xd629d[_0x490c9d(0x94)](_0xa4fb95);if(!_0x187ebb||typeof _0x187ebb!==_0x490c9d(0xaa))return{'type':_0x490c9d(0xcc)};if(isComposableSegmentDef(_0x187ebb))return{'type':_0x490c9d(0x85),'def':parseSegmentDef(_0xa4fb95)};if(_0x490c9d(0xda)in _0x187ebb&&'name'in _0x187ebb)return{'type':_0x490c9d(0x8c),'def':parseDef(_0xa4fb95)};return{'type':_0x490c9d(0xcc)};}export function assertSingleAudience(_0x3472a9,_0x301b10){const _0x3fe7f3=a117_0x5ef4;if(_0x3472a9[_0x3fe7f3(0xf6)]<=0x1)return;const _0x250478=_0x3472a9[_0x3fe7f3(0xbb)]((_0x5406a8,_0x4e45cd)=>'\x22'+_0x5406a8['name']+'\x22\x20('+a117_0x7e74fe[_0x3fe7f3(0x7a)](_0x301b10[_0x4e45cd])+')')[_0x3fe7f3(0x74)](',\x20');throw new SDKError(ErrorCode[_0x3fe7f3(0xf7)],_0x3fe7f3(0x100)+_0x3472a9[_0x3fe7f3(0xf6)]+_0x3fe7f3(0xc0)+_0x250478+_0x3fe7f3(0xa4));}export async function pushComposableFiles(_0x58a8ec,_0x24bda6,_0x4e22f3){const _0x4c9ef8=a117_0x5ef4,{client:_0x34e914,connection:_0xb2fe33}=_0x24bda6,{dryRun:_0x1751d5,progress:_0x22abbc}=_0x4e22f3,_0x430df3={'created':{'segments':0x0,'activations':0x0,'audiences':0x0,'folders':0x0},'updated':{'segments':0x0,'activations':0x0,'audiences':0x0,'folders':0x0}},{nameToId:_0x49ba71,nameToType:_0x462607,idToType:_0xeb2a1}=await((async()=>{const _0xe6ed83=a117_0x5ef4;if(_0x4e22f3['connectionMaps'])return _0x4e22f3[_0xe6ed83(0xdf)];return _0x22abbc?.['update'](_0xe6ed83(0xe5)),buildConnectionMaps(_0xb2fe33);})()),_0x41099b=[],_0x21d0d9=[],_0x1cdddd=[];for(const _0x6e230f of _0x58a8ec){const _0x379f01=parseAndClassify(_0x6e230f);if(_0x379f01[_0x4c9ef8(0xe4)]===_0x4c9ef8(0x8c))_0x41099b['push'](_0x379f01[_0x4c9ef8(0xd9)]),_0x21d0d9['push'](_0x6e230f);else _0x379f01[_0x4c9ef8(0xe4)]==='segment'&&_0x1cdddd[_0x4c9ef8(0x86)](_0x379f01['def']);}assertSingleAudience(_0x41099b,_0x21d0d9);_0x41099b[_0x4c9ef8(0xf6)]===0x0&&_0x4e22f3['resolvedAudienceId']&&(_0x430df3[_0x4c9ef8(0x71)]=_0x4e22f3[_0x4c9ef8(0x73)]);let _0x3da8a2;for(const _0x1a4ca8 of _0x41099b){_0x22abbc?.['update'](_0x4c9ef8(0xba)+_0x1a4ca8[_0x4c9ef8(0xfc)]);if(_0x1751d5){_0x3da8a2??=await _0x34e914[_0x4c9ef8(0xad)]();const _0x48e7fa=findAudienceByName(_0x3da8a2,_0x1a4ca8[_0x4c9ef8(0xfc)]);_0x430df3[_0x4c9ef8(0x97)]=_0x1a4ca8[_0x4c9ef8(0xfc)],_0x430df3[_0x4c9ef8(0x71)]=_0x48e7fa?.['id'];if(_0x48e7fa){_0x430df3[_0x4c9ef8(0xfe)][_0x4c9ef8(0xd3)]++;const _0x49d96d=await _0x34e914[_0x4c9ef8(0xb8)](_0x48e7fa['id']),_0x141168=computeAudienceDrift(_0x49d96d,_0x1a4ca8);(_0x141168['removedAttributes']['length']||_0x141168[_0x4c9ef8(0x7f)][_0x4c9ef8(0xf6)]||_0x141168[_0x4c9ef8(0xe2)][_0x4c9ef8(0xf6)]||_0x141168[_0x4c9ef8(0xf1)][_0x4c9ef8(0xf6)])&&(_0x430df3[_0x4c9ef8(0xa2)]=_0x141168);}else _0x430df3[_0x4c9ef8(0xcb)][_0x4c9ef8(0xd3)]++;continue;}const {id:_0x5edf7b,isNew:_0x27481e,appliedDrift:_0x347569,renamedAttributeIds:_0x4ae834,renamedBehaviorIds:_0x4814c0}=await pushAudience(_0x1a4ca8,_0x34e914,_0x49ba71,_0x462607,_0xeb2a1,!!_0x4e22f3[_0x4c9ef8(0xae)]);_0x430df3[_0x4c9ef8(0x97)]=_0x1a4ca8[_0x4c9ef8(0xfc)],_0x430df3[_0x4c9ef8(0x71)]=_0x5edf7b;if(_0x347569)_0x430df3['audienceDrift']=_0x347569;if(_0x4ae834?.[_0x4c9ef8(0xf6)])_0x430df3[_0x4c9ef8(0xc9)]=_0x4ae834;if(_0x4814c0?.[_0x4c9ef8(0xf6)])_0x430df3[_0x4c9ef8(0xa8)]=_0x4814c0;if(_0x27481e)_0x430df3[_0x4c9ef8(0xcb)]['audiences']++;else _0x430df3[_0x4c9ef8(0xfe)][_0x4c9ef8(0xd3)]++;}if(_0x1cdddd[_0x4c9ef8(0xf6)]===0x0)return _0x430df3;const _0x1c5e89=_0x430df3['audienceId'];if(_0x1751d5){const _0x1055aa=_0x1c5e89?buildFolderPathToIdMap(await _0x34e914['listFolders'](_0x1c5e89)):new Map(),_0x4fda0e=new Set();for(const _0x5a2222 of _0x1cdddd){if(_0x5a2222[_0x4c9ef8(0xfa)])addFoldersToCreate(_0x5a2222[_0x4c9ef8(0xfa)],_0x1055aa,_0x4fda0e);}_0x430df3['created'][_0x4c9ef8(0xc7)]+=_0x4fda0e['size'];const _0x2f32d7=_0x1c5e89?await _0x34e914[_0x4c9ef8(0x9e)](_0x1c5e89):[];for(const _0x4c1280 of _0x1cdddd){const _0x85d04b=findSegmentByName(_0x2f32d7,_0x4c1280['name']);if(_0x85d04b)_0x430df3[_0x4c9ef8(0xfe)]['segments']++;else _0x430df3[_0x4c9ef8(0xcb)]['segments']++;if(_0x4c1280[_0x4c9ef8(0x8f)]){const _0x102cc2=_0x85d04b?await _0x34e914[_0x4c9ef8(0x75)](_0x85d04b['id']):[];for(const _0x16040c of _0x4c1280[_0x4c9ef8(0x8f)]){findActivationByName(_0x102cc2,_0x16040c[_0x4c9ef8(0xfc)])?_0x430df3[_0x4c9ef8(0xfe)][_0x4c9ef8(0x8f)]++:_0x430df3['created'][_0x4c9ef8(0x8f)]++;}}}return _0x430df3;}if(!_0x1c5e89)throw new SDKError(ErrorCode[_0x4c9ef8(0xf7)],'Cannot\x20push\x20segments:\x20no\x20audience\x20ID\x20available.\x20Push\x20the\x20audience\x20YAML\x20first.');let _0x3138c1=buildFolderPathToIdMap(await _0x34e914[_0x4c9ef8(0x102)](_0x1c5e89));const _0x1db6df=new Set();for(const _0x58307a of _0x1cdddd){if(_0x58307a[_0x4c9ef8(0xfa)])addFoldersToCreate(_0x58307a[_0x4c9ef8(0xfa)],_0x3138c1,_0x1db6df);}for(const _0x2379b6 of sortFoldersByDepth(_0x1db6df)){const _0x9569f9=_0x2379b6[_0x4c9ef8(0xf8)]('/'),_0x256e5e=_0x9569f9[_0x9569f9[_0x4c9ef8(0xf6)]-0x1],_0x352933=_0x9569f9['slice'](0x0,-0x1)[_0x4c9ef8(0x74)]('/'),_0x5b4973=_0x3138c1[_0x4c9ef8(0x91)](_0x352933);if(!_0x5b4973)throw new SDKError(ErrorCode[_0x4c9ef8(0xa6)],'Could\x20not\x20resolve\x20parent\x20folder\x20for\x20\x22'+_0x2379b6+_0x4c9ef8(0x92)+_0x352933+_0x4c9ef8(0xd0));_0x22abbc?.['update']('Creating\x20folder:\x20'+_0x2379b6);let _0x38facd;try{_0x38facd=await _0x34e914[_0x4c9ef8(0xa7)](_0x1c5e89,{'name':_0x256e5e,'parentFolderId':_0x5b4973});}catch(_0xac4895){mapComposableError(_0xac4895,{'syntaxCode':ErrorCode['COMPOSABLE_SEGMENT_SYNTAX_ERROR'],'updateCode':ErrorCode[_0x4c9ef8(0xe7)],'failureMessage':_0x4c9ef8(0xd7)+_0x2379b6+'\x22'});}_0x3138c1[_0x4c9ef8(0xee)](_0x2379b6,_0x38facd['id']),_0x430df3[_0x4c9ef8(0xcb)][_0x4c9ef8(0xc7)]++;}const _0x5227dc=await _0x34e914[_0x4c9ef8(0x9e)](_0x1c5e89);for(const _0x137a14 of _0x1cdddd){_0x22abbc?.[_0x4c9ef8(0x9f)](_0x4c9ef8(0xaf)+_0x137a14['name']);const _0x4e2631=defToSegmentApi(_0x137a14,_0x1c5e89,_0x3138c1),_0x37308e=findSegmentByName(_0x5227dc,_0x137a14['name']);let _0x2c2d06;try{if(_0x37308e)await _0x34e914['updateSegment'](_0x37308e['id'],_0x4e2631),_0x2c2d06=_0x37308e['id'],_0x430df3[_0x4c9ef8(0xfe)][_0x4c9ef8(0x93)]++;else{const _0x591805=await _0x34e914[_0x4c9ef8(0xe3)](_0x4e2631);_0x2c2d06=_0x591805['id'],_0x430df3[_0x4c9ef8(0xcb)]['segments']++;}}catch(_0x3d4f55){mapComposableError(_0x3d4f55,{'syntaxCode':ErrorCode[_0x4c9ef8(0xf5)],'updateCode':ErrorCode[_0x4c9ef8(0xe7)],'failureMessage':_0x4c9ef8(0xc1)+(_0x37308e?'update':_0x4c9ef8(0xde))+'\x20segment\x20\x22'+_0x137a14[_0x4c9ef8(0xfc)]+'\x22'});}const _0x3d7128=await _0x34e914['getSegment'](_0x2c2d06);verifySegmentWrite(_0x137a14,_0x3d7128);if(_0x137a14[_0x4c9ef8(0x8f)]){const _0x4884f2=_0x37308e?await _0x34e914[_0x4c9ef8(0x75)](_0x2c2d06):[];for(const _0x21512a of _0x137a14[_0x4c9ef8(0x8f)]){const _0x446282=_0x49ba71[_0x4c9ef8(0x91)](_0x21512a[_0x4c9ef8(0x84)])||_0x21512a[_0x4c9ef8(0x84)],_0x36eae0=activationDefToApi(_0x21512a,_0x446282,_0x137a14[_0x4c9ef8(0xfc)]),_0x41f8ee=findActivationByName(_0x4884f2,_0x21512a['name']);try{_0x41f8ee?(await _0x34e914[_0x4c9ef8(0xfd)](_0x2c2d06,_0x41f8ee['id'],_0x36eae0),_0x430df3[_0x4c9ef8(0xfe)][_0x4c9ef8(0x8f)]++):(await _0x34e914[_0x4c9ef8(0xac)](_0x2c2d06,_0x36eae0),_0x430df3['created'][_0x4c9ef8(0x8f)]++);}catch(_0x50dca6){mapComposableError(_0x50dca6,{'syntaxCode':ErrorCode[_0x4c9ef8(0xbf)],'updateCode':ErrorCode[_0x4c9ef8(0x87)],'failureMessage':_0x4c9ef8(0xc1)+(_0x41f8ee?'update':'create')+'\x20activation\x20\x22'+_0x21512a[_0x4c9ef8(0xfc)]+'\x22\x20under\x20segment\x20\x22'+_0x137a14['name']+'\x22','connectionNotFoundMessage':'CDW\x20connection\x20not\x20found\x20or\x20not\x20accessible\x20for\x20activation\x20\x22'+_0x21512a[_0x4c9ef8(0xfc)]+'\x22\x20under\x20segment\x20\x22'+_0x137a14[_0x4c9ef8(0xfc)]+'\x22.\x20Check\x20the\x20connection\x20name\x20in\x20your\x20YAML.'});}}}}return _0x430df3;}async function pushAudience(_0x280518,_0x149f30,_0x281ee4,_0x2aa94d,_0x5d1900,_0x125509){const _0x891e6f=a117_0x5ef4,_0x4a1b10=await _0x149f30['listComposableAudiences'](),_0x2341a9=findAudienceByName(_0x4a1b10,_0x280518[_0x891e6f(0xfc)]);let _0x29fca5,_0x568da4;if(_0x2341a9){_0x29fca5=await _0x149f30['getComposableAudience'](_0x2341a9['id']);const _0x477360=computeAudienceDrift(_0x29fca5,_0x280518),_0xfd596f=_0x477360[_0x891e6f(0xb4)][_0x891e6f(0xf6)]>0x0||_0x477360[_0x891e6f(0x7f)][_0x891e6f(0xf6)]>0x0;if(_0xfd596f&&!_0x125509){const _0x291bd5=[];_0x477360[_0x891e6f(0xb4)][_0x891e6f(0xf6)]&&_0x291bd5[_0x891e6f(0x86)](_0x891e6f(0x101)+_0x477360[_0x891e6f(0xb4)][_0x891e6f(0x74)](',\x20'));_0x477360['removedBehaviors'][_0x891e6f(0xf6)]&&_0x291bd5[_0x891e6f(0x86)]('behavior(s)\x20'+_0x477360[_0x891e6f(0x7f)][_0x891e6f(0x74)](',\x20'));throw new SDKError(ErrorCode['COMPOSABLE_AUDIENCE_DRIFT'],'Pushing\x20\x22'+_0x280518[_0x891e6f(0xfc)]+_0x891e6f(0xdc)+_0x291bd5[_0x891e6f(0x74)](_0x891e6f(0x7d))+_0x891e6f(0xe8));}(_0xfd596f||_0x477360['renamedAttributes']['length']||_0x477360[_0x891e6f(0xf1)][_0x891e6f(0xf6)])&&(_0x568da4=_0x477360);}for(const _0x189429 of _0x280518[_0x891e6f(0xc8)]??[]){if(!_0x189429[_0x891e6f(0xcd)])continue;const _0x284b5c=_0x29fca5?.[_0x891e6f(0xc8)]?.[_0x891e6f(0xcf)](_0x522f8e=>_0x522f8e[_0x891e6f(0xfc)]===_0x189429['name']);if(!_0x284b5c?.[_0x891e6f(0xb2)])throw new SDKError(ErrorCode['INVALID_ARGUMENT'],'Behavior\x20\x22'+_0x189429[_0x891e6f(0xfc)]+_0x891e6f(0x77)+(_0x284b5c?'this\x20behavior\x20currently\x20does\x20not':_0x891e6f(0x8d))+_0x891e6f(0xbe));}const _0x411a93=defToApi(_0x280518,_0x281ee4,_0x2aa94d,_0x5d1900);let _0x294d19,_0x28bddc;try{if(_0x2341a9)await _0x149f30[_0x891e6f(0xed)](_0x2341a9['id'],_0x411a93),_0x294d19=_0x2341a9['id'],_0x28bddc=![];else{const _0x22aa07=await _0x149f30[_0x891e6f(0x89)](_0x411a93);_0x294d19=_0x22aa07['id'],_0x28bddc=!![];}}catch(_0x5451dd){if(errorContains(_0x5451dd,_0x891e6f(0x79),'Couldn\x27t\x20find'))throw new SDKError(ErrorCode[_0x891e6f(0xef)],_0x891e6f(0xb6)+_0x280518['name']+_0x891e6f(0xf2),_0x5451dd);const _0x424a53=isHttp400Error(_0x5451dd),_0x1cf2fa=_0x424a53?ErrorCode['COMPOSABLE_AUDIENCE_SYNTAX_ERROR']:ErrorCode[_0x891e6f(0x7e)];throw new SDKError(_0x1cf2fa,_0x891e6f(0xc1)+(_0x2341a9?'update':_0x891e6f(0xde))+_0x891e6f(0xf0)+_0x280518['name']+'\x22:\x20'+getErrorMessage(_0x5451dd),_0x5451dd);}const _0xc8e113=await _0x149f30[_0x891e6f(0xb8)](_0x294d19),_0x3a69bb=verifyAudienceWrite(_0x280518,_0xc8e113,_0x29fca5);return{'id':_0x294d19,'isNew':_0x28bddc,'appliedDrift':_0x568da4,'renamedAttributeIds':_0x3a69bb['renamedAttributes'],'renamedBehaviorIds':_0x3a69bb[_0x891e6f(0xf1)]};}export function collectYamlFiles(_0x17d670){const _0x5974fb=a117_0x5ef4,_0x567d14=a117_0x7e74fe['resolve'](_0x17d670);if(!existsSync(_0x567d14))return[];const _0x4d6cc8=statSync(_0x567d14);if(_0x4d6cc8[_0x5974fb(0xf4)]())return _0x567d14['endsWith'](_0x5974fb(0xd8))||_0x567d14[_0x5974fb(0xc2)](_0x5974fb(0x9b))?[_0x567d14]:[];if(_0x4d6cc8[_0x5974fb(0x81)]()){const _0x1ab212=[];for(const _0x51b3e7 of readdirSync(_0x567d14)){const _0x3a8a24=a117_0x7e74fe[_0x5974fb(0x74)](_0x567d14,_0x51b3e7),_0x1a2bad=statSync(_0x3a8a24);if(_0x1a2bad[_0x5974fb(0xf4)]()&&(_0x51b3e7[_0x5974fb(0xc2)](_0x5974fb(0xd8))||_0x51b3e7['endsWith'](_0x5974fb(0x9b))))_0x1ab212['push'](_0x3a8a24);else _0x1a2bad[_0x5974fb(0x81)]()&&_0x1ab212[_0x5974fb(0x86)](...collectYamlFiles(_0x3a8a24));}return _0x1ab212;}return[];}
|
|
1
|
+
(function(_0x4f8ee8,_0x1640b2){const _0x33526c=a117_0x58b4,_0x4613f3=_0x4f8ee8();while(!![]){try{const _0x3457bc=parseInt(_0x33526c(0x127))/0x1*(parseInt(_0x33526c(0x11d))/0x2)+-parseInt(_0x33526c(0x15c))/0x3*(-parseInt(_0x33526c(0x14d))/0x4)+-parseInt(_0x33526c(0x177))/0x5+-parseInt(_0x33526c(0x137))/0x6+parseInt(_0x33526c(0x184))/0x7+parseInt(_0x33526c(0x139))/0x8*(-parseInt(_0x33526c(0x131))/0x9)+parseInt(_0x33526c(0x173))/0xa*(parseInt(_0x33526c(0x15a))/0xb);if(_0x3457bc===_0x1640b2)break;else _0x4613f3['push'](_0x4613f3['shift']());}catch(_0x561ed8){_0x4613f3['push'](_0x4613f3['shift']());}}}(a117_0x5c7b,0x5dfc5));import{existsSync,readFileSync,readdirSync,statSync}from'fs';import a117_0x14fa90 from'path';import{isDeepStrictEqual}from'node:util';import{parseDef,defToApi}from'./cas-audience-yaml.js';import{parseSegmentDef,isComposableSegmentDef,defToSegmentApi,activationDefToApi}from'./cas-segment-yaml.js';import{buildFolderPathToIdMap}from'../segment/resolution-context.js';import{addFoldersToCreate,sortFoldersByDepth}from'../segment/push-workflow.js';import{SDKError,ErrorCode,isHttp400Error,getErrorMessage,errorContains}from'../errors.js';import*as a117_0x462441 from'yaml';export function findAudienceByName(_0x38b94f,_0x206f84){const _0x3128c1=a117_0x58b4;return _0x38b94f[_0x3128c1(0x14c)](_0x3dea8d=>_0x3dea8d['name']===_0x206f84);}export function computeAudienceDrift(_0x11616f,_0x499d58){const _0x221b68=a117_0x58b4,_0x489e46=_0x499d58['attributes']??[],_0x4c6612=_0x499d58[_0x221b68(0x124)]??[],_0x53de2a=new Set(_0x489e46['map'](_0x597f8f=>_0x597f8f[_0x221b68(0x179)])),_0x23e11a=new Set(_0x4c6612[_0x221b68(0x180)](_0x5d2e8a=>_0x5d2e8a[_0x221b68(0x179)])),_0x543822=[],_0x3ee31d=[];for(const _0x2d964c of _0x11616f['attributes']??[]){if(_0x53de2a[_0x221b68(0x11f)](_0x2d964c[_0x221b68(0x179)]))continue;const _0x3eb019=_0x489e46[_0x221b68(0x14c)](_0x5c3710=>_0x5c3710['schema']===_0x2d964c['schema']&&_0x5c3710[_0x221b68(0x133)]===_0x2d964c[_0x221b68(0x133)]&&_0x5c3710[_0x221b68(0x14a)]===_0x2d964c['column']);_0x3eb019?_0x3ee31d[_0x221b68(0x114)]({'from':_0x2d964c[_0x221b68(0x179)],'to':_0x3eb019[_0x221b68(0x179)]}):_0x543822['push'](_0x2d964c[_0x221b68(0x179)]);}const _0x36f2fb=[],_0x1d6a30=[];for(const _0x571f67 of _0x11616f[_0x221b68(0x124)]??[]){if(_0x23e11a['has'](_0x571f67[_0x221b68(0x179)]))continue;const _0x33253e=_0x4c6612[_0x221b68(0x14c)](_0xd5d858=>_0xd5d858[_0x221b68(0x16a)]===_0x571f67[_0x221b68(0x16a)]&&_0xd5d858[_0x221b68(0x133)]===_0x571f67[_0x221b68(0x133)]&&_0xd5d858['time_column']===_0x571f67[_0x221b68(0x182)]);_0x33253e?_0x1d6a30['push']({'from':_0x571f67[_0x221b68(0x179)],'to':_0x33253e[_0x221b68(0x179)]}):_0x36f2fb[_0x221b68(0x114)](_0x571f67[_0x221b68(0x179)]);}return{'removedAttributes':_0x543822,'removedBehaviors':_0x36f2fb,'renamedAttributes':_0x3ee31d,'renamedBehaviors':_0x1d6a30};}function diffNameSets(_0x5cffc7,_0x14aae3){const _0x5ed56f=a117_0x58b4,_0x104140=new Set(_0x5cffc7),_0x3b61e0=new Set(_0x14aae3);return{'missing':_0x5cffc7[_0x5ed56f(0x183)](_0x3e0f4f=>!_0x3b61e0[_0x5ed56f(0x11f)](_0x3e0f4f)),'unexpected':_0x14aae3[_0x5ed56f(0x183)](_0x33419f=>!_0x104140[_0x5ed56f(0x11f)](_0x33419f))};}export function verifyAudienceWrite(_0x12c6f3,_0x4edf1d,_0x468c08){const _0x5e2290=a117_0x58b4,_0x2b8a14=(_0x12c6f3['attributes']??[])['map'](_0x4a9ba0=>_0x4a9ba0[_0x5e2290(0x179)]),_0x1f9f21=(_0x12c6f3[_0x5e2290(0x124)]??[])[_0x5e2290(0x180)](_0x44f93d=>_0x44f93d[_0x5e2290(0x179)]),_0xedb2b0=(_0x4edf1d['attributes']??[])[_0x5e2290(0x180)](_0x147cf8=>_0x147cf8[_0x5e2290(0x179)]),_0x3e9300=(_0x4edf1d[_0x5e2290(0x124)]??[])[_0x5e2290(0x180)](_0x55bb78=>_0x55bb78[_0x5e2290(0x179)]),_0x236287=diffNameSets(_0x2b8a14,_0xedb2b0),_0x4234f4=diffNameSets(_0x1f9f21,_0x3e9300),_0x211eba=[];_0x236287[_0x5e2290(0x109)][_0x5e2290(0x11e)]&&_0x211eba[_0x5e2290(0x114)](_0x5e2290(0x128)+_0x236287[_0x5e2290(0x109)][_0x5e2290(0x10c)](',\x20'));_0x236287['unexpected'][_0x5e2290(0x11e)]&&_0x211eba['push'](_0x5e2290(0x144)+_0x236287[_0x5e2290(0x157)][_0x5e2290(0x10c)](',\x20'));_0x4234f4[_0x5e2290(0x109)][_0x5e2290(0x11e)]&&_0x211eba[_0x5e2290(0x114)]('missing\x20behavior(s):\x20'+_0x4234f4[_0x5e2290(0x109)][_0x5e2290(0x10c)](',\x20'));_0x4234f4[_0x5e2290(0x157)][_0x5e2290(0x11e)]&&_0x211eba[_0x5e2290(0x114)]('unexpected\x20behavior(s):\x20'+_0x4234f4[_0x5e2290(0x157)][_0x5e2290(0x10c)](',\x20'));for(const _0x2e48c3 of _0x12c6f3[_0x5e2290(0x16d)]??[]){const _0xf22d8a=_0x4edf1d[_0x5e2290(0x16d)]?.[_0x5e2290(0x14c)](_0x42aae4=>_0x42aae4[_0x5e2290(0x179)]===_0x2e48c3[_0x5e2290(0x179)]);if(!_0xf22d8a)continue;const _0x1050ed=[];if(_0xf22d8a[_0x5e2290(0x16a)]!==_0x2e48c3[_0x5e2290(0x16a)])_0x1050ed[_0x5e2290(0x114)](_0x5e2290(0x16a));if(_0xf22d8a[_0x5e2290(0x133)]!==_0x2e48c3[_0x5e2290(0x133)])_0x1050ed[_0x5e2290(0x114)]('table');if(_0xf22d8a['column']!==_0x2e48c3[_0x5e2290(0x14a)])_0x1050ed[_0x5e2290(0x114)]('column');if(_0xf22d8a[_0x5e2290(0x12c)]!==_0x2e48c3[_0x5e2290(0x12c)])_0x1050ed[_0x5e2290(0x114)](_0x5e2290(0x12c));_0x1050ed['length']&&_0x211eba['push']('attribute\x20\x22'+_0x2e48c3[_0x5e2290(0x179)]+'\x22\x20has\x20a\x20different\x20'+_0x1050ed['join']('/')+_0x5e2290(0xfa));}for(const _0x29477b of _0x12c6f3['behaviors']??[]){const _0x5c8712=_0x4edf1d[_0x5e2290(0x124)]?.[_0x5e2290(0x14c)](_0x597d44=>_0x597d44[_0x5e2290(0x179)]===_0x29477b['name']);if(!_0x5c8712)continue;const _0x405540=[];if(_0x5c8712[_0x5e2290(0x16a)]!==_0x29477b[_0x5e2290(0x16a)])_0x405540[_0x5e2290(0x114)]('schema');if(_0x5c8712[_0x5e2290(0x133)]!==_0x29477b[_0x5e2290(0x133)])_0x405540[_0x5e2290(0x114)](_0x5e2290(0x133));if((_0x5c8712[_0x5e2290(0x182)]??'')!==(_0x29477b[_0x5e2290(0xf9)]??''))_0x405540['push'](_0x5e2290(0xf9));_0x405540['length']&&_0x211eba[_0x5e2290(0x114)]('behavior\x20\x22'+_0x29477b['name']+_0x5e2290(0x15f)+_0x405540[_0x5e2290(0x10c)]('/')+_0x5e2290(0xfa));}_0x12c6f3[_0x5e2290(0x12e)]!==undefined&&_0x4edf1d[_0x5e2290(0x136)]!==_0x12c6f3[_0x5e2290(0x12e)]&&_0x211eba[_0x5e2290(0x114)](_0x5e2290(0x135)+_0x4edf1d[_0x5e2290(0x136)]+_0x5e2290(0x13d)+_0x12c6f3[_0x5e2290(0x12e)]+'\x20was\x20pushed');_0x12c6f3['max_activation_behavior_row']!==undefined&&_0x4edf1d[_0x5e2290(0x10f)]!==_0x12c6f3[_0x5e2290(0x15d)]&&_0x211eba[_0x5e2290(0x114)](_0x5e2290(0x10b)+_0x4edf1d['maxActivationBehaviorRow']+_0x5e2290(0x13d)+_0x12c6f3[_0x5e2290(0x15d)]+_0x5e2290(0x168));const _0x57e096=[],_0x598a7f=[];if(_0x468c08){const _0x396d2d=computeAudienceDrift(_0x468c08,_0x12c6f3);for(const {from:_0xb89eb9,to:_0x5482}of _0x396d2d['renamedAttributes']){const _0xe54d7=_0x468c08[_0x5e2290(0x16d)]?.[_0x5e2290(0x14c)](_0x3a4f1a=>_0x3a4f1a['name']===_0xb89eb9),_0x22faaf=_0x4edf1d['attributes']?.[_0x5e2290(0x14c)](_0x2806e5=>_0x2806e5[_0x5e2290(0x179)]===_0x5482);_0xe54d7?.['id']&&_0x4edf1d['attributes']?.[_0x5e2290(0xf3)](_0x5dade4=>_0x5dade4['id']===_0xe54d7['id'])&&_0x211eba[_0x5e2290(0x114)](_0x5e2290(0x122)+_0xb89eb9+_0x5e2290(0x10e)+_0x5482+'\x22:\x20its\x20old\x20id\x20('+_0xe54d7['id']+_0x5e2290(0x14f)),_0x57e096['push']({'from':_0xb89eb9,'to':_0x5482,'fromId':_0xe54d7?.['id'],'toId':_0x22faaf?.['id']});}for(const {from:_0x13555a,to:_0x3ee2dc}of _0x396d2d['renamedBehaviors']){const _0x3ff04d=_0x468c08[_0x5e2290(0x124)]?.[_0x5e2290(0x14c)](_0x4b9eff=>_0x4b9eff[_0x5e2290(0x179)]===_0x13555a),_0x4b0a32=_0x4edf1d[_0x5e2290(0x124)]?.[_0x5e2290(0x14c)](_0x5ea4ab=>_0x5ea4ab[_0x5e2290(0x179)]===_0x3ee2dc);_0x3ff04d?.['id']&&_0x4edf1d[_0x5e2290(0x124)]?.[_0x5e2290(0xf3)](_0x445a6f=>_0x445a6f['id']===_0x3ff04d['id'])&&_0x211eba[_0x5e2290(0x114)](_0x5e2290(0x17b)+_0x13555a+'\x22\x20renamed\x20to\x20\x22'+_0x3ee2dc+_0x5e2290(0x18a)+_0x3ff04d['id']+')\x20is\x20still\x20present\x20after\x20the\x20push\x20—\x20expected\x20it\x20to\x20be\x20gone\x20(renames\x20recreate\x20the\x20behavior\x20under\x20a\x20new\x20id).'),_0x598a7f[_0x5e2290(0x114)]({'from':_0x13555a,'to':_0x3ee2dc,'fromId':_0x3ff04d?.['id'],'toId':_0x4b0a32?.['id']});}}if(_0x211eba[_0x5e2290(0x11e)]>0x0)throw new SDKError(ErrorCode[_0x5e2290(0x105)],_0x5e2290(0x145)+_0x12c6f3[_0x5e2290(0x179)]+_0x5e2290(0x148)+_0x211eba[_0x5e2290(0x10c)](';\x20')+'.\x20Check\x20the\x20audience\x20in\x20Console\x20before\x20pushing\x20again\x20—\x20nothing\x20further\x20was\x20changed\x20automatically.');return{'renamedAttributes':_0x57e096,'renamedBehaviors':_0x598a7f};}function a117_0x5c7b(){const _0x2c9103=['Pushing\x20\x22','time_column','\x20than\x20what\x20was\x20pushed','listSegments','all_columns','renamedBehaviors','listActivations','\x22\x20(parent\x20path\x20\x22','\x20and\x20','updateCode','syntaxCode','list','folder','COMPOSABLE_AUDIENCE_VERIFICATION_FAILED','Could\x20not\x20resolve\x20parent\x20folder\x20for\x20\x22','\x22.\x20Check\x20the\x20connection\x20name\x20in\x20your\x20YAML.','connectionMaps','missing','stringify','max_activation_behavior_row\x20came\x20back\x20','join','resolve','\x22\x20renamed\x20to\x20\x22','maxActivationBehaviorRow','Failed\x20to\x20','\x22,\x20expected\x20\x22','\x22\x20under\x20segment\x20\x22','renamedAttributes','push','Pushing\x20audience:\x20','\x22:\x20','updateComposableAudience','CONNECTION_NOT_FOUND','listFolders','Behavior\x20\x22','object','\x0a\x20\x20','14086hEOISD','length','has','endsWith','Couldn\x27t\x20find','attribute\x20\x22','connectionNotFoundMessage','behaviors','COMPOSABLE_SEGMENT_UPDATE_ERROR','update','109WKCGQk','missing\x20attribute(s):\x20','audiences','createSegment','updateActivation','type','not\x20found\x20or\x20not\x20accessible','allow_activation_behavior','parse','getSegment','9297CRWSFT','behavior(s)\x20','table','def','allow_activation_behavior\x20came\x20back\x20','allowActivationBehavior','4447110UeGGIn','\x20composable\x20audience\x20\x22','1832eskqxc','split','\x20segment\x20\x22','unknown','\x20but\x20','.yml','renamedAttributeIds','folders','INTERNAL','updateSegment','get','unexpected\x20attribute(s):\x20','Push\x20to\x20\x22','\x20that\x20exist\x20on\x20the\x20server\x20but\x20aren\x27t\x20in\x20this\x20YAML\x20—\x20the\x20backend\x20replaces\x20the\x20full\x20set\x20on\x20update,\x20it\x20doesn\x27t\x20merge.\x20No\x20changes\x20were\x20made.\x20If\x20your\x20YAML\x20is\x20stale,\x20run\x20`tdx\x20cas\x20pull`\x20and\x20reconcile\x20it.\x20If\x20removing\x20them\x20is\x20intentional,\x20re-run\x20with\x20--delete.','\x22\x20reported\x20success,\x20but\x20re-reading\x20it\x20shows\x20it\x20doesn\x27t\x20match\x20what\x20was\x20sent:\x20','\x22\x20reported\x20success,\x20but\x20re-reading\x20the\x20audience\x20shows\x20it\x20doesn\x27t\x20match\x20what\x20was\x20sent:\x20','\x22\x20not\x20found).','column','createFolder','find','164jPDiLX','created',')\x20is\x20still\x20present\x20after\x20the\x20push\x20—\x20expected\x20it\x20to\x20be\x20gone\x20(renames\x20recreate\x20the\x20attribute\x20under\x20a\x20new\x20id).','segments','size','activations','isFile','getComposableAudience','this\x20behavior\x20currently\x20does\x20not','isDirectory','unexpected','rule','.\x20Check\x20the\x20segment\x20in\x20Console\x20before\x20pushing\x20again\x20—\x20nothing\x20further\x20was\x20changed\x20automatically.','269038PWCVra','COMPOSABLE_ACTIVATION_UPDATE_ERROR','9441CeoDss','max_activation_behavior_row','.\x20Use\x20an\x20explicit\x20\x22columns\x22\x20list\x20instead.','\x22\x20has\x20a\x20different\x20','removedBehaviors','listComposableAudiences','CDW\x20connection\x20not\x20found\x20or\x20not\x20accessible\x20for\x20audience\x20\x22','resolvedAudienceId','attribute(s)\x20','slice','audienceId','audienceName','\x20was\x20pushed','this\x20is\x20a\x20new\x20behavior','schema','segment','Pushing\x20segment:\x20','attributes','deleteDrift','Failed\x20to\x20create\x20folder\x20\x22','set','createActivation','failureMessage','170OfdcNR','Creating\x20folder:\x20','removedAttributes','INVALID_ARGUMENT','2880565AfmuIw','allColumns','name','COMPOSABLE_SEGMENT_VERIFICATION_FAILED','behavior\x20\x22','Found\x20','\x22\x20not\x20found\x20under\x20this\x20audience\x20—\x20nothing\x20to\x20delete.','rule\x20does\x20not\x20match\x20what\x20was\x20pushed','renamedBehaviorIds','map','connection','timeColumn','filter','4384240ttdtfK','create','\x20composable\x20audience\x20definitions\x20in\x20the\x20target,\x20but\x20a\x20push\x20can\x20only\x20target\x20one\x20at\x20a\x20time:\x20','.yaml','deleteSegment','\x20activation\x20\x22','\x22:\x20its\x20old\x20id\x20(','some','basename','audience','updated','.\x20Move\x20each\x20audience\x20to\x20its\x20own\x20folder\x20before\x20pushing.'];a117_0x5c7b=function(){return _0x2c9103;};return a117_0x5c7b();}export function verifySegmentWrite(_0x37c52b,_0x115ec9){const _0x4ff4a8=a117_0x58b4,_0x3e25f0=[];_0x115ec9[_0x4ff4a8(0x179)]!==_0x37c52b[_0x4ff4a8(0x179)]&&_0x3e25f0[_0x4ff4a8(0x114)]('name\x20is\x20\x22'+_0x115ec9[_0x4ff4a8(0x179)]+_0x4ff4a8(0x111)+_0x37c52b[_0x4ff4a8(0x179)]+'\x22');const _0xead503=_0x55fc40=>_0x55fc40===undefined?null:JSON['parse'](JSON[_0x4ff4a8(0x10a)](_0x55fc40));!isDeepStrictEqual(_0xead503(_0x115ec9[_0x4ff4a8(0x158)]),_0xead503(_0x37c52b['rule']))&&_0x3e25f0[_0x4ff4a8(0x114)](_0x4ff4a8(0x17e));if(_0x3e25f0[_0x4ff4a8(0x11e)]>0x0)throw new SDKError(ErrorCode[_0x4ff4a8(0x17a)],'Push\x20to\x20segment\x20\x22'+_0x37c52b[_0x4ff4a8(0x179)]+_0x4ff4a8(0x147)+_0x3e25f0[_0x4ff4a8(0x10c)](';\x20')+_0x4ff4a8(0x159));}export function findSegmentByName(_0x1086e6,_0x60ae61){const _0x6ac2d5=a117_0x58b4;return _0x1086e6[_0x6ac2d5(0x14c)](_0x531268=>_0x531268[_0x6ac2d5(0x179)]===_0x60ae61);}function a117_0x58b4(_0x2ba6de,_0x4639da){_0x2ba6de=_0x2ba6de-0xf3;const _0x5c7b3f=a117_0x5c7b();let _0x58b415=_0x5c7b3f[_0x2ba6de];return _0x58b415;}export function findActivationByName(_0xd9c595,_0x12526c){const _0x1e623f=a117_0x58b4;return _0xd9c595[_0x1e623f(0x14c)](_0x51a5b7=>_0x51a5b7[_0x1e623f(0x179)]===_0x12526c);}export async function deleteComposableSegment(_0x101b18,_0x3ee0fc,_0x3e150b){const _0x2030d4=a117_0x58b4,_0x400f92=await _0x101b18[_0x2030d4(0xfb)](_0x3ee0fc),_0x577aa0=findSegmentByName(_0x400f92,_0x3e150b);if(!_0x577aa0)throw new SDKError(ErrorCode['COMPOSABLE_SEGMENT_NOT_FOUND'],'Composable\x20segment\x20\x22'+_0x3e150b+_0x2030d4(0x17d));return await _0x101b18[_0x2030d4(0x188)](_0x577aa0['id']),{'id':_0x577aa0['id']};}function mapComposableError(_0x2099c6,_0x95d2c9){const _0x4206d0=a117_0x58b4;if(_0x95d2c9['connectionNotFoundMessage']&&errorContains(_0x2099c6,_0x4206d0(0x12d),_0x4206d0(0x121)))throw new SDKError(ErrorCode['CONNECTION_NOT_FOUND'],_0x95d2c9[_0x4206d0(0x123)],_0x2099c6);const _0x2fbaa9=isHttp400Error(_0x2099c6),_0x3e71f9=_0x2fbaa9?_0x95d2c9[_0x4206d0(0x102)]:_0x95d2c9[_0x4206d0(0x101)];throw new SDKError(_0x3e71f9,_0x95d2c9[_0x4206d0(0x172)]+_0x4206d0(0x11c)+getErrorMessage(_0x2099c6),_0x2099c6);}export async function buildConnectionMaps(_0x5e45a2){const _0x136880=a117_0x58b4,_0x205d36=await _0x5e45a2[_0x136880(0x103)](),_0x3ef8d8=new Map(),_0xae3ca3=new Map(),_0x26ae24=new Map();for(const _0x472a09 of _0x205d36){_0x472a09['id']&&(_0x3ef8d8[_0x136880(0x170)](_0x472a09[_0x136880(0x179)],_0x472a09['id']),_0x26ae24[_0x136880(0x170)](_0x472a09['id'],_0x472a09[_0x136880(0x12c)])),_0xae3ca3['set'](_0x472a09[_0x136880(0x179)],_0x472a09[_0x136880(0x12c)]);}return{'nameToId':_0x3ef8d8,'nameToType':_0xae3ca3,'idToType':_0x26ae24};}function parseAndClassify(_0x300b8a){const _0x979d8b=a117_0x58b4,_0x3643db=readFileSync(_0x300b8a,'utf-8'),_0x220690=a117_0x462441[_0x979d8b(0x12f)](_0x3643db);if(!_0x220690||typeof _0x220690!==_0x979d8b(0x11b))return{'type':_0x979d8b(0x13c)};if(isComposableSegmentDef(_0x220690))return{'type':'segment','def':parseSegmentDef(_0x3643db)};if('master'in _0x220690&&_0x979d8b(0x179)in _0x220690)return{'type':'audience','def':parseDef(_0x3643db)};return{'type':_0x979d8b(0x13c)};}export function assertSingleAudience(_0x2589fd,_0x299d3d){const _0x4f0333=a117_0x58b4;if(_0x2589fd['length']<=0x1)return;const _0x5d66f1=_0x2589fd[_0x4f0333(0x180)]((_0x35550e,_0x51533e)=>'\x22'+_0x35550e[_0x4f0333(0x179)]+'\x22\x20('+a117_0x14fa90[_0x4f0333(0xf4)](_0x299d3d[_0x51533e])+')')[_0x4f0333(0x10c)](',\x20');throw new SDKError(ErrorCode[_0x4f0333(0x176)],_0x4f0333(0x17c)+_0x2589fd[_0x4f0333(0x11e)]+_0x4f0333(0x186)+_0x5d66f1+_0x4f0333(0xf7));}export async function pushComposableFiles(_0x5bc9a5,_0x374590,_0x29102e){const _0x32a74a=a117_0x58b4,{client:_0x3529db,connection:_0x1d3e73}=_0x374590,{dryRun:_0x384543,progress:_0x2031c4}=_0x29102e,_0x109c9c={'created':{'segments':0x0,'activations':0x0,'audiences':0x0,'folders':0x0},'updated':{'segments':0x0,'activations':0x0,'audiences':0x0,'folders':0x0}},{nameToId:_0x505adc,nameToType:_0x324d1a,idToType:_0x50c89f}=await((async()=>{const _0x2c9b8c=a117_0x58b4;if(_0x29102e[_0x2c9b8c(0x108)])return _0x29102e['connectionMaps'];return _0x2031c4?.[_0x2c9b8c(0x126)]('Resolving\x20connections...'),buildConnectionMaps(_0x1d3e73);})()),_0x37441e=[],_0x533313=[],_0xa9670c=[];for(const _0x3f914d of _0x5bc9a5){const _0x5d1450=parseAndClassify(_0x3f914d);if(_0x5d1450[_0x32a74a(0x12c)]===_0x32a74a(0xf5))_0x37441e[_0x32a74a(0x114)](_0x5d1450[_0x32a74a(0x134)]),_0x533313[_0x32a74a(0x114)](_0x3f914d);else _0x5d1450['type']===_0x32a74a(0x16b)&&_0xa9670c['push'](_0x5d1450[_0x32a74a(0x134)]);}assertSingleAudience(_0x37441e,_0x533313);_0x37441e[_0x32a74a(0x11e)]===0x0&&_0x29102e[_0x32a74a(0x163)]&&(_0x109c9c['audienceId']=_0x29102e['resolvedAudienceId']);let _0x220c00;for(const _0x26e2ad of _0x37441e){_0x2031c4?.[_0x32a74a(0x126)](_0x32a74a(0x115)+_0x26e2ad[_0x32a74a(0x179)]);if(_0x384543){_0x220c00??=await _0x3529db[_0x32a74a(0x161)]();const _0x423f4f=findAudienceByName(_0x220c00,_0x26e2ad[_0x32a74a(0x179)]);_0x109c9c[_0x32a74a(0x167)]=_0x26e2ad['name'],_0x109c9c[_0x32a74a(0x166)]=_0x423f4f?.['id'];if(_0x423f4f){_0x109c9c['updated'][_0x32a74a(0x129)]++;const _0x556077=await _0x3529db['getComposableAudience'](_0x423f4f['id']),_0x21600d=computeAudienceDrift(_0x556077,_0x26e2ad);(_0x21600d[_0x32a74a(0x175)]['length']||_0x21600d[_0x32a74a(0x160)][_0x32a74a(0x11e)]||_0x21600d[_0x32a74a(0x113)][_0x32a74a(0x11e)]||_0x21600d[_0x32a74a(0xfd)][_0x32a74a(0x11e)])&&(_0x109c9c['audienceDrift']=_0x21600d);}else _0x109c9c[_0x32a74a(0x14e)][_0x32a74a(0x129)]++;continue;}const {id:_0x4c41de,isNew:_0x535d4c,appliedDrift:_0x273424,renamedAttributeIds:_0x4fc0aa,renamedBehaviorIds:_0x235cea}=await pushAudience(_0x26e2ad,_0x3529db,_0x505adc,_0x324d1a,_0x50c89f,!!_0x29102e[_0x32a74a(0x16e)]);_0x109c9c[_0x32a74a(0x167)]=_0x26e2ad[_0x32a74a(0x179)],_0x109c9c[_0x32a74a(0x166)]=_0x4c41de;if(_0x273424)_0x109c9c['audienceDrift']=_0x273424;if(_0x4fc0aa?.['length'])_0x109c9c[_0x32a74a(0x13f)]=_0x4fc0aa;if(_0x235cea?.['length'])_0x109c9c[_0x32a74a(0x17f)]=_0x235cea;if(_0x535d4c)_0x109c9c[_0x32a74a(0x14e)][_0x32a74a(0x129)]++;else _0x109c9c[_0x32a74a(0xf6)]['audiences']++;}if(_0xa9670c['length']===0x0)return _0x109c9c;const _0x537167=_0x109c9c['audienceId'];if(_0x384543){const _0x31e821=_0x537167?buildFolderPathToIdMap(await _0x3529db[_0x32a74a(0x119)](_0x537167)):new Map(),_0x2aa0cb=new Set();for(const _0xe6d559 of _0xa9670c){if(_0xe6d559[_0x32a74a(0x104)])addFoldersToCreate(_0xe6d559[_0x32a74a(0x104)],_0x31e821,_0x2aa0cb);}_0x109c9c[_0x32a74a(0x14e)][_0x32a74a(0x140)]+=_0x2aa0cb[_0x32a74a(0x151)];const _0x31bea3=_0x537167?await _0x3529db['listSegments'](_0x537167):[];for(const _0x1212c2 of _0xa9670c){const _0x167757=findSegmentByName(_0x31bea3,_0x1212c2[_0x32a74a(0x179)]);if(_0x167757)_0x109c9c['updated'][_0x32a74a(0x150)]++;else _0x109c9c[_0x32a74a(0x14e)]['segments']++;if(_0x1212c2[_0x32a74a(0x152)]){const _0x3da6d6=_0x167757?await _0x3529db[_0x32a74a(0xfe)](_0x167757['id']):[];for(const _0x49d66a of _0x1212c2[_0x32a74a(0x152)]){findActivationByName(_0x3da6d6,_0x49d66a[_0x32a74a(0x179)])?_0x109c9c[_0x32a74a(0xf6)][_0x32a74a(0x152)]++:_0x109c9c['created'][_0x32a74a(0x152)]++;}}}return _0x109c9c;}if(!_0x537167)throw new SDKError(ErrorCode[_0x32a74a(0x176)],'Cannot\x20push\x20segments:\x20no\x20audience\x20ID\x20available.\x20Push\x20the\x20audience\x20YAML\x20first.');let _0x389fab=buildFolderPathToIdMap(await _0x3529db[_0x32a74a(0x119)](_0x537167));const _0x554369=new Set();for(const _0x145e56 of _0xa9670c){if(_0x145e56[_0x32a74a(0x104)])addFoldersToCreate(_0x145e56[_0x32a74a(0x104)],_0x389fab,_0x554369);}for(const _0x220aab of sortFoldersByDepth(_0x554369)){const _0x3e25cc=_0x220aab[_0x32a74a(0x13a)]('/'),_0x231a81=_0x3e25cc[_0x3e25cc[_0x32a74a(0x11e)]-0x1],_0x46aa34=_0x3e25cc[_0x32a74a(0x165)](0x0,-0x1)[_0x32a74a(0x10c)]('/'),_0x3084cf=_0x389fab[_0x32a74a(0x143)](_0x46aa34);if(!_0x3084cf)throw new SDKError(ErrorCode[_0x32a74a(0x141)],_0x32a74a(0x106)+_0x220aab+_0x32a74a(0xff)+_0x46aa34+_0x32a74a(0x149));_0x2031c4?.[_0x32a74a(0x126)](_0x32a74a(0x174)+_0x220aab);let _0x1c1cc6;try{_0x1c1cc6=await _0x3529db[_0x32a74a(0x14b)](_0x537167,{'name':_0x231a81,'parentFolderId':_0x3084cf});}catch(_0x4e8870){mapComposableError(_0x4e8870,{'syntaxCode':ErrorCode['COMPOSABLE_SEGMENT_SYNTAX_ERROR'],'updateCode':ErrorCode[_0x32a74a(0x125)],'failureMessage':_0x32a74a(0x16f)+_0x220aab+'\x22'});}_0x389fab[_0x32a74a(0x170)](_0x220aab,_0x1c1cc6['id']),_0x109c9c[_0x32a74a(0x14e)]['folders']++;}const _0x961432=await _0x3529db[_0x32a74a(0xfb)](_0x537167);for(const _0x2c3728 of _0xa9670c){_0x2031c4?.[_0x32a74a(0x126)](_0x32a74a(0x16c)+_0x2c3728['name']);const _0x2a2542=defToSegmentApi(_0x2c3728,_0x537167,_0x389fab),_0x43c286=findSegmentByName(_0x961432,_0x2c3728[_0x32a74a(0x179)]);let _0x171dca;try{if(_0x43c286)await _0x3529db[_0x32a74a(0x142)](_0x43c286['id'],_0x2a2542),_0x171dca=_0x43c286['id'],_0x109c9c[_0x32a74a(0xf6)][_0x32a74a(0x150)]++;else{const _0x2211c5=await _0x3529db[_0x32a74a(0x12a)](_0x2a2542);_0x171dca=_0x2211c5['id'],_0x109c9c[_0x32a74a(0x14e)][_0x32a74a(0x150)]++;}}catch(_0x2809a9){mapComposableError(_0x2809a9,{'syntaxCode':ErrorCode['COMPOSABLE_SEGMENT_SYNTAX_ERROR'],'updateCode':ErrorCode[_0x32a74a(0x125)],'failureMessage':'Failed\x20to\x20'+(_0x43c286?_0x32a74a(0x126):_0x32a74a(0x185))+_0x32a74a(0x13b)+_0x2c3728[_0x32a74a(0x179)]+'\x22'});}const _0x26af34=await _0x3529db[_0x32a74a(0x130)](_0x171dca);verifySegmentWrite(_0x2c3728,_0x26af34);if(_0x2c3728[_0x32a74a(0x152)]){const _0x47959f=_0x43c286?await _0x3529db[_0x32a74a(0xfe)](_0x171dca):[];for(const _0x1ea194 of _0x2c3728[_0x32a74a(0x152)]){const _0x2d5125=_0x505adc[_0x32a74a(0x143)](_0x1ea194[_0x32a74a(0x181)])||_0x1ea194[_0x32a74a(0x181)],_0x2149c6=activationDefToApi(_0x1ea194,_0x2d5125,_0x2c3728[_0x32a74a(0x179)]),_0x340e8c=findActivationByName(_0x47959f,_0x1ea194['name']);try{_0x340e8c?(await _0x3529db[_0x32a74a(0x12b)](_0x171dca,_0x340e8c['id'],_0x2149c6),_0x109c9c[_0x32a74a(0xf6)][_0x32a74a(0x152)]++):(await _0x3529db[_0x32a74a(0x171)](_0x171dca,_0x2149c6),_0x109c9c['created'][_0x32a74a(0x152)]++);}catch(_0x1149a9){mapComposableError(_0x1149a9,{'syntaxCode':ErrorCode['COMPOSABLE_ACTIVATION_SYNTAX_ERROR'],'updateCode':ErrorCode[_0x32a74a(0x15b)],'failureMessage':_0x32a74a(0x110)+(_0x340e8c?_0x32a74a(0x126):_0x32a74a(0x185))+_0x32a74a(0x189)+_0x1ea194[_0x32a74a(0x179)]+_0x32a74a(0x112)+_0x2c3728['name']+'\x22','connectionNotFoundMessage':'CDW\x20connection\x20not\x20found\x20or\x20not\x20accessible\x20for\x20activation\x20\x22'+_0x1ea194[_0x32a74a(0x179)]+_0x32a74a(0x112)+_0x2c3728[_0x32a74a(0x179)]+_0x32a74a(0x107)});}}}}return _0x109c9c;}async function pushAudience(_0x24a166,_0x22a664,_0x3a6470,_0x1e4c56,_0x3bc232,_0x3ea220){const _0x10bce2=a117_0x58b4,_0x52c5a1=await _0x22a664[_0x10bce2(0x161)](),_0x9f5d63=findAudienceByName(_0x52c5a1,_0x24a166[_0x10bce2(0x179)]);let _0x45d66d,_0x37fefa;if(_0x9f5d63){_0x45d66d=await _0x22a664[_0x10bce2(0x154)](_0x9f5d63['id']);const _0xd3d75c=computeAudienceDrift(_0x45d66d,_0x24a166),_0x491623=_0xd3d75c['removedAttributes']['length']>0x0||_0xd3d75c[_0x10bce2(0x160)]['length']>0x0;if(_0x491623&&!_0x3ea220){const _0xc637f0=[];_0xd3d75c[_0x10bce2(0x175)][_0x10bce2(0x11e)]&&_0xc637f0[_0x10bce2(0x114)](_0x10bce2(0x164)+_0xd3d75c[_0x10bce2(0x175)][_0x10bce2(0x10c)](',\x20'));_0xd3d75c[_0x10bce2(0x160)]['length']&&_0xc637f0[_0x10bce2(0x114)](_0x10bce2(0x132)+_0xd3d75c['removedBehaviors'][_0x10bce2(0x10c)](',\x20'));throw new SDKError(ErrorCode['COMPOSABLE_AUDIENCE_DRIFT'],_0x10bce2(0xf8)+_0x24a166['name']+'\x22\x20would\x20remove\x20'+_0xc637f0['join'](_0x10bce2(0x100))+_0x10bce2(0x146));}(_0x491623||_0xd3d75c['renamedAttributes']['length']||_0xd3d75c['renamedBehaviors'][_0x10bce2(0x11e)])&&(_0x37fefa=_0xd3d75c);}for(const _0x655ebb of _0x24a166[_0x10bce2(0x124)]??[]){if(!_0x655ebb[_0x10bce2(0xfc)])continue;const _0x5ab644=_0x45d66d?.['behaviors']?.[_0x10bce2(0x14c)](_0x5d3f50=>_0x5d3f50['name']===_0x655ebb['name']);if(!_0x5ab644?.[_0x10bce2(0x178)])throw new SDKError(ErrorCode[_0x10bce2(0x176)],_0x10bce2(0x11a)+_0x655ebb[_0x10bce2(0x179)]+'\x22\x20sets\x20\x22all_columns:\x20true\x22,\x20but\x20the\x20backend\x20only\x20accepts\x20that\x20for\x20a\x20behavior\x20that\x20already\x20has\x20it\x20—\x20'+(_0x5ab644?_0x10bce2(0x155):_0x10bce2(0x169))+_0x10bce2(0x15e));}const _0x22f9d8=defToApi(_0x24a166,_0x3a6470,_0x1e4c56,_0x3bc232);let _0x21c48b,_0x42338e;try{if(_0x9f5d63)await _0x22a664[_0x10bce2(0x117)](_0x9f5d63['id'],_0x22f9d8),_0x21c48b=_0x9f5d63['id'],_0x42338e=![];else{const _0x14c467=await _0x22a664['createComposableAudience'](_0x22f9d8);_0x21c48b=_0x14c467['id'],_0x42338e=!![];}}catch(_0x2a77c7){if(errorContains(_0x2a77c7,_0x10bce2(0x12d),_0x10bce2(0x121)))throw new SDKError(ErrorCode[_0x10bce2(0x118)],_0x10bce2(0x162)+_0x24a166[_0x10bce2(0x179)]+'\x22.\x20Check\x20the\x20connection\x20name\x20in\x20your\x20YAML.',_0x2a77c7);const _0x3b8baa=isHttp400Error(_0x2a77c7),_0x465d83=_0x3b8baa?ErrorCode['COMPOSABLE_AUDIENCE_SYNTAX_ERROR']:ErrorCode['COMPOSABLE_AUDIENCE_UPDATE_ERROR'];throw new SDKError(_0x465d83,_0x10bce2(0x110)+(_0x9f5d63?_0x10bce2(0x126):_0x10bce2(0x185))+_0x10bce2(0x138)+_0x24a166[_0x10bce2(0x179)]+_0x10bce2(0x116)+getErrorMessage(_0x2a77c7),_0x2a77c7);}const _0x4ac495=await _0x22a664[_0x10bce2(0x154)](_0x21c48b),_0x79d3e2=verifyAudienceWrite(_0x24a166,_0x4ac495,_0x45d66d);return{'id':_0x21c48b,'isNew':_0x42338e,'appliedDrift':_0x37fefa,'renamedAttributeIds':_0x79d3e2[_0x10bce2(0x113)],'renamedBehaviorIds':_0x79d3e2['renamedBehaviors']};}export function collectYamlFiles(_0x25a265){const _0x3df68a=a117_0x58b4,_0x432fff=a117_0x14fa90[_0x3df68a(0x10d)](_0x25a265);if(!existsSync(_0x432fff))return[];const _0x327705=statSync(_0x432fff);if(_0x327705[_0x3df68a(0x153)]())return _0x432fff[_0x3df68a(0x120)](_0x3df68a(0x13e))||_0x432fff[_0x3df68a(0x120)](_0x3df68a(0x187))?[_0x432fff]:[];if(_0x327705[_0x3df68a(0x156)]()){const _0x276f4c=[];for(const _0x15b701 of readdirSync(_0x432fff)){const _0xf6b7a1=a117_0x14fa90[_0x3df68a(0x10c)](_0x432fff,_0x15b701),_0x27ea2a=statSync(_0xf6b7a1);if(_0x27ea2a['isFile']()&&(_0x15b701[_0x3df68a(0x120)](_0x3df68a(0x13e))||_0x15b701[_0x3df68a(0x120)]('.yaml')))_0x276f4c[_0x3df68a(0x114)](_0xf6b7a1);else _0x27ea2a['isDirectory']()&&_0x276f4c[_0x3df68a(0x114)](...collectYamlFiles(_0xf6b7a1));}return _0x276f4c;}return[];}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
(function(_0x150412,_0xae81e9){const _0x3d002c=a119_0x3159,_0x5712a5=_0x150412();while(!![]){try{const _0x4eb634=parseInt(_0x3d002c(0xfe))/0x1*(-parseInt(_0x3d002c(0xea))/0x2)+parseInt(_0x3d002c(0xf7))/0x3*(parseInt(_0x3d002c(0xee))/0x4)+-parseInt(_0x3d002c(0xf4))/0x5+-parseInt(_0x3d002c(0xe2))/0x6+parseInt(_0x3d002c(0x102))/0x7*(parseInt(_0x3d002c(0xe5))/0x8)+parseInt(_0x3d002c(0xf6))/0x9+parseInt(_0x3d002c(0xe7))/0xa*(parseInt(_0x3d002c(0x100))/0xb);if(_0x4eb634===_0xae81e9)break;else _0x5712a5['push'](_0x5712a5['shift']());}catch(_0x545229){_0x5712a5['push'](_0x5712a5['shift']());}}}(a119_0x3fee,0x445c0));import{readFileSync}from'fs';import*as a119_0x1a6b23 from'path';import*as a119_0x530af7 from'yaml';import{validateComposableAudienceDef}from'./cas-audience-validator.js';import{ComposableAudienceDefSchema}from'./cas-audience-schema.js';function a119_0x3159(_0x44b2a8,_0x423616){_0x44b2a8=_0x44b2a8-0xe1;const _0x3feebc=a119_0x3fee();let _0x3159f0=_0x3feebc[_0x44b2a8];return _0x3159f0;}import{validateComposableSegmentRule,audienceFieldNamesFromDef}from'./cas-segment-validator.js';import{isComposableSegmentDef}from'./cas-segment-yaml.js';export function isCasValidationResult(_0xdaba5d){const _0x59ff96=a119_0x3159;return!(_0x59ff96(0xf9)in _0xdaba5d);}function a119_0x3fee(){const _0x3465dd=['result','message','1BPnsWu','audience','11niHjjh','object','2134314qpCDrg','parseDocument','1574286zKazSg','rule','Failed\x20to\x20parse\x20YAML\x20file\x20(empty\x20or\x20invalid)','8QEfgqU','length','7069060lBMGnl','toJSON','YAML\x20parse\x20error:\x20','834478sXiEKJ','warnings','connectionNameToType','success','16LFPlNq','basename','relative','parse','YAML_PARSE_ERROR','utf-8','2730255FOfjER','Failed\x20to\x20read\x20file:\x20','2682675pGHucL','146841ddyNET','data','skipped','valid','connectionIdToType'];a119_0x3fee=function(){return _0x3465dd;};return a119_0x3fee();}function createParseErrorResult(_0x35b902,_0x500d5c,_0x22a509,_0x3c9fe0){const _0x573136=a119_0x3159;return{'filePath':_0x35b902,'relativePath':_0x500d5c,'source':_0x22a509,'result':{'valid':![],'errors':[{'level':'error','path':'','code':_0x573136(0xf2),'message':_0x3c9fe0}],'warnings':[]},'fileType':_0x573136(0xff)};}export function validateCasYamlFile(_0x2df637,_0x556b94,_0x9b24af,_0x39d21c){const _0x19a70c=a119_0x3159,_0x50089c=a119_0x1a6b23[_0x19a70c(0xf0)](_0x556b94,_0x2df637)||a119_0x1a6b23[_0x19a70c(0xef)](_0x2df637);let _0xa6a62e;try{_0xa6a62e=readFileSync(_0x2df637,_0x19a70c(0xf3));}catch(_0x46dadb){return createParseErrorResult(_0x2df637,_0x50089c,'',_0x19a70c(0xf5)+(_0x46dadb instanceof Error?_0x46dadb[_0x19a70c(0xfd)]:String(_0x46dadb)));}let _0x3d209c,_0x86255b;try{_0x3d209c=a119_0x530af7[_0x19a70c(0xe1)](_0xa6a62e);if(_0x3d209c['errors'][_0x19a70c(0xe6)]>0x0)return createParseErrorResult(_0x2df637,_0x50089c,_0xa6a62e,_0x19a70c(0xe9)+_0x3d209c['errors'][0x0][_0x19a70c(0xfd)]);_0x86255b=_0x3d209c[_0x19a70c(0xe8)]();}catch(_0x49fb85){return createParseErrorResult(_0x2df637,_0x50089c,_0xa6a62e,_0x19a70c(0xe9)+(_0x49fb85 instanceof Error?_0x49fb85[_0x19a70c(0xfd)]:String(_0x49fb85)));}if(!_0x86255b||typeof _0x86255b!==_0x19a70c(0x101))return createParseErrorResult(_0x2df637,_0x50089c,_0xa6a62e,_0x19a70c(0xe4));if(isComposableSegmentDef(_0x86255b)){const _0x25e2dd=_0x86255b['rule']?validateComposableSegmentRule(_0x86255b[_0x19a70c(0xe3)],{'source':_0xa6a62e,'document':_0x3d209c},{'audienceFieldNames':_0x39d21c}):{'valid':!![],'errors':[],'warnings':[]};return{'filePath':_0x2df637,'relativePath':_0x50089c,'source':_0xa6a62e,'result':_0x25e2dd,'fileType':'segment'};}const _0x37ffbc=validateComposableAudienceDef(_0x86255b,{'source':_0xa6a62e,'document':_0x3d209c},{'connectionNameToType':_0x9b24af?.[_0x19a70c(0xec)],'connectionIdToType':_0x9b24af?.[_0x19a70c(0xfb)],'connectionNameToId':_0x9b24af?.['connectionNameToId']});return{'filePath':_0x2df637,'relativePath':_0x50089c,'source':_0xa6a62e,'result':_0x37ffbc,'fileType':'audience'};}export function validateCasYamlFiles(_0x442e82,_0x4f2354,_0x1b76e3){const _0x4a64cc=findAudienceFieldNamesInBatch(_0x442e82);return _0x442e82['map'](_0x45cd51=>validateCasYamlFile(_0x45cd51,_0x4f2354,_0x1b76e3,_0x4a64cc));}function findAudienceFieldNamesInBatch(_0xc22db9){const _0x1d3559=a119_0x3159;for(const _0x15848b of _0xc22db9){let _0x247398;try{_0x247398=a119_0x530af7[_0x1d3559(0xf1)](readFileSync(_0x15848b,_0x1d3559(0xf3)));}catch{continue;}if(!_0x247398||typeof _0x247398!==_0x1d3559(0x101)||isComposableSegmentDef(_0x247398))continue;const _0x4e6075=ComposableAudienceDefSchema['safeParse'](_0x247398);if(_0x4e6075[_0x1d3559(0xed)])return audienceFieldNamesFromDef(_0x4e6075[_0x1d3559(0xf8)]);}return undefined;}export function calculateCasValidationSummary(_0x443081){const _0x261215=a119_0x3159;let _0x24f63a=0x0,_0x4204b7=0x0,_0x53b2b7=0x0,_0x2c8f84=0x0;for(const _0xba735f of _0x443081){if(!isCasValidationResult(_0xba735f)){_0x2c8f84++;continue;}_0xba735f[_0x261215(0xfc)][_0x261215(0xfa)]?_0x24f63a++:_0x4204b7++,_0x53b2b7+=_0xba735f['result'][_0x261215(0xeb)]['length'];}return{'validCount':_0x24f63a,'invalidCount':_0x4204b7,'warningCount':_0x53b2b7,'skippedCount':_0x2c8f84,'hasErrors':_0x4204b7>0x0};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a120_0x12a140=a120_0x46c4;(function(_0x1b2f3f,_0x229379){const _0x4e54a5=a120_0x46c4,_0xec46f6=_0x1b2f3f();while(!![]){try{const _0x2ad063=-parseInt(_0x4e54a5(0x225))/0x1+parseInt(_0x4e54a5(0x228))/0x2*(-parseInt(_0x4e54a5(0x236))/0x3)+-parseInt(_0x4e54a5(0x1f4))/0x4*(-parseInt(_0x4e54a5(0x1eb))/0x5)+-parseInt(_0x4e54a5(0x1f5))/0x6+-parseInt(_0x4e54a5(0x1d1))/0x7+-parseInt(_0x4e54a5(0x1a7))/0x8*(parseInt(_0x4e54a5(0x203))/0x9)+-parseInt(_0x4e54a5(0x1ae))/0xa*(-parseInt(_0x4e54a5(0x1c1))/0xb);if(_0x2ad063===_0x229379)break;else _0xec46f6['push'](_0xec46f6['shift']());}catch(_0x2a007c){_0xec46f6['push'](_0xec46f6['shift']());}}}(a120_0x257d,0xc3b3c));import{HTTPClient}from'./http-client.js';import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';function a120_0x46c4(_0x4177dc,_0x10142f){_0x4177dc=_0x4177dc-0x19c;const _0x257d3b=a120_0x257d();let _0x46c446=_0x257d3b[_0x4177dc];return _0x46c446;}export class CDPApiClient{['httpClient'];['authHeaders'];constructor(_0x13d881){const _0x1cda19=a120_0x46c4,_0x1d5585=getEndpoint(_0x13d881[_0x1cda19(0x1ce)],_0x1cda19(0x1a4));this['authHeaders']=toHeaderRecord(getAuthHeaders(_0x13d881[_0x1cda19(0x1ce)],_0x13d881[_0x1cda19(0x1d9)],_0x13d881['accessToken'])),this[_0x1cda19(0x1bb)]=new HTTPClient(_0x1d5585,{...this['authHeaders'],'Accept':_0x1cda19(0x1bd),'Content-Type':_0x1cda19(0x202)},{'proxy':_0x13d881[_0x1cda19(0x1bf)],'defaultTimeout':_0x13d881[_0x1cda19(0x212)]});}async['listParentSegments'](){const _0x4782c4=a120_0x46c4,_0x41fa57=_0x4782c4(0x205),_0x22a121=await this[_0x4782c4(0x1bb)][_0x4782c4(0x1c9)](_0x4782c4(0x1dd),_0x41fa57);return Array[_0x4782c4(0x1b1)](_0x22a121)?_0x22a121:_0x22a121[_0x4782c4(0x1f7)];}async[a120_0x12a140(0x1db)](_0x13ddac){const _0x4fcb38=a120_0x12a140,_0x4fc28c=_0x4fcb38(0x1fb)+_0x13ddac,_0x187db9=await this[_0x4fcb38(0x1bb)][_0x4fcb38(0x1c9)](_0x4fcb38(0x1dd),_0x4fc28c);return _0x4fcb38(0x1f7)in _0x187db9?_0x187db9['data']:_0x187db9;}async[a120_0x12a140(0x1e5)](_0x254517){const _0x1a2f47=a120_0x12a140,_0xd1bba0=_0x1a2f47(0x1ec)+_0x254517+'/segments',_0xf19f9f=await this[_0x1a2f47(0x1bb)]['request']('GET',_0xd1bba0);return Array['isArray'](_0xf19f9f)?_0xf19f9f:_0xf19f9f[_0x1a2f47(0x1f7)];}async['getSegment'](_0x1c6095,_0x11a315){const _0x5dca6b=a120_0x12a140,_0x67286d='/audiences/'+_0x1c6095+_0x5dca6b(0x1ba)+_0x11a315,_0x1e59b9=await this[_0x5dca6b(0x1bb)]['request'](_0x5dca6b(0x1dd),_0x67286d);return'data'in _0x1e59b9?_0x1e59b9[_0x5dca6b(0x1f7)]:_0x1e59b9;}async['getSegmentEntity'](_0x461832){const _0x1d3273=a120_0x12a140,_0x318748=_0x1d3273(0x1bc)+_0x461832,_0x502558=await this[_0x1d3273(0x1bb)][_0x1d3273(0x1c9)](_0x1d3273(0x1dd),_0x318748);if('data'in _0x502558){const _0x2276f5=_0x502558[_0x1d3273(0x1f7)];if(_0x1d3273(0x1fe)in _0x2276f5&&_0x2276f5[_0x1d3273(0x1fe)]&&typeof _0x2276f5[_0x1d3273(0x1fe)]===_0x1d3273(0x1ed)){const _0x149aa0=_0x2276f5[_0x1d3273(0x1fe)];return{'id':_0x2276f5['id'],'name':_0x149aa0['name'],..._0x149aa0};}return _0x2276f5;}return _0x502558;}async['listSegmentFolders'](_0x5d72cd){const _0x725259=a120_0x12a140,_0x47e063='/audiences/'+_0x5d72cd+_0x725259(0x232),_0x2bcce0=await this[_0x725259(0x1bb)]['request']('GET',_0x47e063);return Array[_0x725259(0x1b1)](_0x2bcce0)?_0x2bcce0:_0x2bcce0[_0x725259(0x1f7)];}async['getSegmentFolder'](_0x1ae12b){const _0x2412f2=a120_0x12a140,_0x1e9329=_0x2412f2(0x22a)+_0x1ae12b,_0x5af04b=await this[_0x2412f2(0x1bb)]['request'](_0x2412f2(0x1dd),_0x1e9329);return _0x2412f2(0x1f7)in _0x5af04b?_0x5af04b[_0x2412f2(0x1f7)]:_0x5af04b;}async[a120_0x12a140(0x1ab)](_0x5afccf,_0x18be32=0x20,_0xc434d4=![]){const _0x3dd1da=a120_0x12a140,_0x2e0520=_0x3dd1da(0x204)+_0x5afccf+_0x3dd1da(0x214)+_0x18be32+_0x3dd1da(0x1ee)+_0xc434d4;return await this[_0x3dd1da(0x1bb)][_0x3dd1da(0x1c9)](_0x3dd1da(0x1dd),_0x2e0520);}async[a120_0x12a140(0x208)](_0x3dcf34,_0x3fd536){const _0x510f14=a120_0x12a140,_0x275e47=_0x510f14(0x1bc)+_0x3fd536+_0x510f14(0x1b0),_0x1246d3=await this[_0x510f14(0x1bb)][_0x510f14(0x1c9)]('GET',_0x275e47);return _0x1246d3[_0x510f14(0x1f7)][_0x510f14(0x20f)](_0x1043d9=>({'id':_0x1043d9['id'],..._0x1043d9['attributes']}));}async[a120_0x12a140(0x1da)](_0x516be9,_0x5e1b37,_0x5b68e7){const _0x3cad9f=a120_0x12a140,_0xb93288=_0x3cad9f(0x1bc)+_0x5e1b37+'/syndications/'+_0x5b68e7,_0x464675=await this[_0x3cad9f(0x1bb)][_0x3cad9f(0x1c9)]('GET',_0xb93288);return{'id':_0x464675[_0x3cad9f(0x1f7)]['id'],..._0x464675[_0x3cad9f(0x1f7)][_0x3cad9f(0x1fe)]};}async['createActivation'](_0x32a26b,_0x133ad8,_0x341c26){const _0x29d61d=a120_0x12a140,_0x2cdb97=_0x29d61d(0x1ec)+_0x32a26b+'/segments/'+_0x133ad8+_0x29d61d(0x1b0),_0x2af015=await this[_0x29d61d(0x1bb)][_0x29d61d(0x1c9)]('POST',_0x2cdb97,{'body':_0x341c26});return _0x2af015;}async[a120_0x12a140(0x19d)](_0x2bd6c0,_0x56e329,_0x27d0a7,_0xb66829){const _0x48867d=a120_0x12a140,_0x1d61e9=_0x48867d(0x1ec)+_0x2bd6c0+_0x48867d(0x1ba)+_0x56e329+'/syndications/'+_0x27d0a7,_0x570e03=await this['httpClient'][_0x48867d(0x1c9)](_0x48867d(0x1f9),_0x1d61e9,{'body':_0xb66829});return _0x570e03;}async[a120_0x12a140(0x22d)](_0x1d7f62,_0x369d95,_0x4ace15){const _0x51fa4e=a120_0x12a140,_0x14d683=_0x51fa4e(0x1ec)+_0x1d7f62+_0x51fa4e(0x1ba)+_0x369d95+'/syndications/'+_0x4ace15;await this[_0x51fa4e(0x1bb)][_0x51fa4e(0x1c9)](_0x51fa4e(0x21f),_0x14d683);}async['getParentSegmentSQL'](_0x55874d){const _0x1627eb=a120_0x12a140;return this[_0x1627eb(0x1f3)](_0x55874d);}async['getSegmentSQLFromRule'](_0x2113e6,_0x4b95b4){const _0x2a5601=a120_0x12a140;return this[_0x2a5601(0x1f3)](_0x2113e6,_0x4b95b4);}async[a120_0x12a140(0x1fd)](_0x32ea34,_0x2fc1f3){const _0x127378=a120_0x12a140,_0x13dea7=await this['getSegment'](_0x32ea34,_0x2fc1f3),_0x1263e1=_0x127378(0x1a0)in _0x13dea7&&_0x13dea7[_0x127378(0x1a0)]?_0x13dea7[_0x127378(0x1a0)]:undefined;return this[_0x127378(0x1f3)](_0x32ea34,_0x1263e1);}async[a120_0x12a140(0x1f3)](_0x182cd1,_0x2382f0){const _0x44ea2c=a120_0x12a140,_0xd182db='/audiences/'+_0x182cd1+_0x44ea2c(0x1e4),_0x23e405={'format':'sql'};_0x2382f0&&(_0x23e405['rule']=_0x2382f0);const _0x124fa0=await this['httpClient'][_0x44ea2c(0x1c9)](_0x44ea2c(0x1e8),_0xd182db,{'body':_0x23e405});return _0x124fa0[_0x44ea2c(0x1a3)]||_0x124fa0[_0x44ea2c(0x1ca)]||'';}async[a120_0x12a140(0x1d7)](_0xa31b3){const _0x35379f=a120_0x12a140,_0x264c0e=_0x35379f(0x1f1),_0x2f5403=await this['httpClient']['request'](_0x35379f(0x1e8),_0x264c0e,{'body':_0xa31b3,'headers':{'Content-Type':_0x35379f(0x1bd)}});return _0x2f5403;}async[a120_0x12a140(0x1e0)](_0x1c33c1,_0x24388e){const _0x2ce564=a120_0x12a140,_0x2bb03a=_0x2ce564(0x1ec)+_0x1c33c1,_0x423671=await this[_0x2ce564(0x1bb)][_0x2ce564(0x1c9)](_0x2ce564(0x1f9),_0x2bb03a,{'body':_0x24388e,'headers':{'Content-Type':_0x2ce564(0x1bd)}});return _0x423671;}async[a120_0x12a140(0x1ad)](_0x3dc10b){const _0x4e7b0b=a120_0x12a140,_0xc3f66c=_0x4e7b0b(0x1ec)+_0x3dc10b,_0x340d4d=await this[_0x4e7b0b(0x1bb)][_0x4e7b0b(0x1c9)]('GET',_0xc3f66c,{'headers':{'Accept':_0x4e7b0b(0x1bd)}});return _0x340d4d;}async[a120_0x12a140(0x22f)](_0x3e25f0){const _0x3053ec=a120_0x12a140,_0x977c6e=_0x3053ec(0x1ec)+_0x3e25f0+'/attributes',_0x36edca=await this['httpClient'][_0x3053ec(0x1c9)](_0x3053ec(0x1dd),_0x977c6e);return _0x36edca;}async[a120_0x12a140(0x1d6)](_0x51fd42,_0x31f0be){const _0x2128f8=a120_0x12a140;let _0x45012b=_0x2128f8(0x1ec)+_0x51fd42+_0x2128f8(0x210);_0x31f0be!==undefined&&(_0x45012b+='?realtime='+_0x31f0be);const _0xbe1042=await this[_0x2128f8(0x1bb)]['request']('GET',_0x45012b);return _0xbe1042;}async[a120_0x12a140(0x1c7)](_0x2bc3c8,_0x4cbae0){const _0x29eaf5=a120_0x12a140,_0x59fc78=_0x29eaf5(0x1ec)+_0x2bc3c8+_0x29eaf5(0x20e),_0x3b5aab=await this[_0x29eaf5(0x1bb)]['request']('POST',_0x59fc78,{'body':_0x4cbae0});return _0x3b5aab;}async[a120_0x12a140(0x1ea)](_0x388588){const _0x363a57=a120_0x12a140,_0x54b6aa=_0x363a57(0x1de),_0x4a9c4b={'type':_0x363a57(0x1f6),'attributes':{'name':_0x388588['name'],'description':_0x388588[_0x363a57(0x1af)]||'','journeyId':_0x388588[_0x363a57(0x217)],'rule':_0x388588[_0x363a57(0x1a0)],'countPopulation':_0x388588[_0x363a57(0x22e)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x388588['parentFolderId'],'type':'folder-segment'}}}},_0x33fad9=await this[_0x363a57(0x1bb)][_0x363a57(0x1c9)](_0x363a57(0x1e8),_0x54b6aa,{'body':_0x4a9c4b,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x33fad9[_0x363a57(0x1f7)]['id'];}async[a120_0x12a140(0x1b5)](_0x519d82,_0x277e06,_0x75b03){const _0x308257=a120_0x12a140,_0x20b115=_0x308257(0x1ec)+_0x519d82+'/segments/'+_0x277e06,_0x2773b4=await this[_0x308257(0x1bb)][_0x308257(0x1c9)](_0x308257(0x1f9),_0x20b115,{'body':_0x75b03});return _0x2773b4;}async[a120_0x12a140(0x1d4)](_0x26f933,_0x5ec73f){const _0x2b1a87=a120_0x12a140,_0x582240=_0x2b1a87(0x1bc)+_0x26f933,_0x175369={'type':_0x2b1a87(0x1f8),'id':_0x26f933,'attributes':{},'relationships':{'parentFolder':{'data':{'id':_0x5ec73f,'type':'folder-segment'}}}},_0x145f9d=await this[_0x2b1a87(0x1bb)][_0x2b1a87(0x1c9)](_0x2b1a87(0x213),_0x582240,{'body':_0x175369,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return{'id':_0x145f9d[_0x2b1a87(0x1f7)]['id'],'segmentFolderId':_0x145f9d['data'][_0x2b1a87(0x1b2)]?.[_0x2b1a87(0x20b)]?.[_0x2b1a87(0x1f7)]?.['id']??null};}async[a120_0x12a140(0x22b)](_0x49d913){const _0x1ff517=a120_0x12a140,_0x40de07=_0x1ff517(0x1bc)+_0x49d913;await this[_0x1ff517(0x1bb)][_0x1ff517(0x1c9)](_0x1ff517(0x21f),_0x40de07);}async['createSegmentFolder'](_0xa3b21a,_0x507a0b){const _0x1c8426=a120_0x12a140;if(_0x507a0b['parentFolderId']){const _0x3f19a1=_0x1c8426(0x224),_0x5efb45={'type':'folder-segment','attributes':{'name':_0x507a0b[_0x1c8426(0x1b7)],'description':_0x507a0b[_0x1c8426(0x1af)]||''},'relationships':{'parentFolder':{'data':{'id':_0x507a0b[_0x1c8426(0x1e9)],'type':_0x1c8426(0x1ff)}}}},_0x571c58=await this['httpClient'][_0x1c8426(0x1c9)](_0x1c8426(0x1e8),_0x3f19a1,{'body':_0x5efb45,'headers':{'Content-Type':_0x1c8426(0x1bd)}}),_0x295ee7=_0x571c58['data'];return{'id':_0x295ee7['id'],'name':_0x295ee7[_0x1c8426(0x1fe)][_0x1c8426(0x1b7)],'description':_0x295ee7[_0x1c8426(0x1fe)][_0x1c8426(0x1af)],'audienceId':_0x295ee7['attributes'][_0x1c8426(0x1df)]||String(_0xa3b21a),'parentFolderId':_0x295ee7[_0x1c8426(0x1b2)]?.[_0x1c8426(0x20b)]?.[_0x1c8426(0x1f7)]?.['id'],'createdAt':_0x295ee7['attributes'][_0x1c8426(0x207)],'updatedAt':_0x295ee7[_0x1c8426(0x1fe)][_0x1c8426(0x227)]};}const _0x4e0be6='/audiences/'+_0xa3b21a+_0x1c8426(0x232),_0x3c88e2=await this[_0x1c8426(0x1bb)][_0x1c8426(0x1c9)](_0x1c8426(0x1e8),_0x4e0be6,{'body':_0x507a0b});if('data'in _0x3c88e2&&_0x3c88e2['data']){const _0x17062a=_0x3c88e2['data'];return{'id':_0x17062a['id'],'name':_0x17062a[_0x1c8426(0x1b7)],'description':_0x17062a['description'],'audienceId':_0x17062a['audienceId']||String(_0xa3b21a),'parentFolderId':_0x17062a[_0x1c8426(0x1e9)],'createdAt':_0x17062a[_0x1c8426(0x207)],'updatedAt':_0x17062a[_0x1c8426(0x227)]};}return _0x3c88e2;}async[a120_0x12a140(0x1be)](_0x259dc6){const _0x3e78e4=a120_0x12a140,_0x3c7ba4='/audiences/'+_0x259dc6+_0x3e78e4(0x20a),_0x2a64c1=await this['httpClient'][_0x3e78e4(0x1c9)](_0x3e78e4(0x1e8),_0x3c7ba4);return _0x2a64c1;}async[a120_0x12a140(0x1cf)](_0x3b7f09){const _0xab6f44=a120_0x12a140,_0x29e629='/entities/journeys?folder_id='+_0x3b7f09,_0x198296=await this[_0xab6f44(0x1bb)][_0xab6f44(0x1c9)](_0xab6f44(0x1dd),_0x29e629);return _0x198296['data'][_0xab6f44(0x20f)](_0x23e324=>({'id':_0x23e324['id'],'name':_0x23e324[_0xab6f44(0x1fe)]['name'],'journeyBundleName':_0x23e324[_0xab6f44(0x1fe)][_0xab6f44(0x1ac)],'journeyBundleId':_0x23e324[_0xab6f44(0x1fe)][_0xab6f44(0x220)],'versionNumber':_0x23e324[_0xab6f44(0x1fe)][_0xab6f44(0x19e)],'description':_0x23e324[_0xab6f44(0x1fe)][_0xab6f44(0x1af)],'state':_0x23e324[_0xab6f44(0x1fe)][_0xab6f44(0x1b3)],'paused':_0x23e324[_0xab6f44(0x1fe)][_0xab6f44(0x230)],'audienceId':_0x23e324[_0xab6f44(0x1fe)]['audienceId'],'folderId':_0x23e324[_0xab6f44(0x1b2)]?.[_0xab6f44(0x20b)]?.[_0xab6f44(0x1f7)]?.['id'],'createdAt':_0x23e324[_0xab6f44(0x1fe)][_0xab6f44(0x207)],'updatedAt':_0x23e324[_0xab6f44(0x1fe)][_0xab6f44(0x227)]}));}async['listJourneysWithDetails'](_0x5b6c2b){const _0x3c858b=a120_0x12a140,_0x1ca143=_0x3c858b(0x223)+_0x5b6c2b,_0x3a9d2b=await this[_0x3c858b(0x1bb)][_0x3c858b(0x1c9)](_0x3c858b(0x1dd),_0x1ca143),_0x3ed646=new Map();if(_0x3a9d2b[_0x3c858b(0x1a6)])for(const _0x2b806a of _0x3a9d2b[_0x3c858b(0x1a6)]){_0x2b806a[_0x3c858b(0x1c5)]==='journeyActivationStep'&&_0x3ed646[_0x3c858b(0x1c4)](_0x2b806a['id'],_0x2b806a);}return{'journeys':_0x3a9d2b[_0x3c858b(0x1f7)],'activationStepsById':_0x3ed646};}async['getJourney'](_0x2d2260){const _0x49bef7=a120_0x12a140,_0x2a5847=_0x49bef7(0x201)+_0x2d2260,_0x31fbff=await this[_0x49bef7(0x1bb)][_0x49bef7(0x1c9)](_0x49bef7(0x1dd),_0x2a5847);return'data'in _0x31fbff?_0x31fbff[_0x49bef7(0x1f7)]:_0x31fbff;}async[a120_0x12a140(0x215)](_0x1dab66){const _0x6ea0f2=a120_0x12a140,_0x4265c9=_0x6ea0f2(0x1e6)+_0x1dab66,_0x40cf93=await this[_0x6ea0f2(0x1bb)][_0x6ea0f2(0x1c9)]('GET',_0x4265c9);return parseJourneyBundleResponse(_0x40cf93);}async[a120_0x12a140(0x226)](_0x493d29){const _0xcab40f=a120_0x12a140,_0x1c266c=_0xcab40f(0x1e6)+_0x493d29+_0xcab40f(0x1d5);await this[_0xcab40f(0x1bb)][_0xcab40f(0x1c9)](_0xcab40f(0x1dd),_0x1c266c);}async['createJourneyVersion'](_0xe9f636,_0x48b24a){const _0x15237a=a120_0x12a140,_0x111129='/entities/journey_bundles/'+_0xe9f636+_0x15237a(0x1cc),_0x151621=await this[_0x15237a(0x1bb)]['request'](_0x15237a(0x1e8),_0x111129,{'body':_0x48b24a});return _0x15237a(0x1f7)in _0x151621?_0x151621[_0x15237a(0x1f7)]:_0x151621;}async['createJourney'](_0x59a910){const _0x3d7cd4=a120_0x12a140,_0x2db430=_0x3d7cd4(0x218),_0x1b17d5=await this['httpClient'][_0x3d7cd4(0x1c9)](_0x3d7cd4(0x1e8),_0x2db430,{'body':_0x59a910,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return'data'in _0x1b17d5?_0x1b17d5[_0x3d7cd4(0x1f7)]:_0x1b17d5;}async[a120_0x12a140(0x1fa)](_0x33e98e,_0x13f51c){const _0x368827=a120_0x12a140,_0x341f96=_0x368827(0x201)+_0x33e98e,_0x10202f=await this['httpClient'][_0x368827(0x1c9)](_0x368827(0x213),_0x341f96,{'body':_0x13f51c,'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x368827(0x1f7)in _0x10202f?_0x10202f[_0x368827(0x1f7)]:_0x10202f;}async['updateJourneyDetail'](_0x75a110,_0x1e9e7a){const _0x3c78c8=a120_0x12a140,_0x4a5eae=_0x3c78c8(0x201)+_0x75a110+_0x3c78c8(0x209),_0x210006=await this[_0x3c78c8(0x1bb)]['request'](_0x3c78c8(0x1e8),_0x4a5eae,{'body':_0x1e9e7a,'headers':{'Content-Type':_0x3c78c8(0x1bd)}});return _0x3c78c8(0x1f7)in _0x210006?_0x210006[_0x3c78c8(0x1f7)]:_0x210006;}async['getJourneyStatistics'](_0x5baf54,_0x3865d0){const _0x5d58c2=a120_0x12a140,_0x49955b=buildJourneyEndpoint(_0x5baf54,_0x5d58c2(0x1c6),_0x3865d0),_0x457085=await this[_0x5d58c2(0x1bb)][_0x5d58c2(0x1c9)]('GET',_0x49955b);return parseJourneyStatisticsResponse(_0x457085);}async['getConversionSankeyChart'](_0xabdb7f,_0x5652eb){const _0x44cf75=a120_0x12a140,_0x344c6b=buildJourneyEndpoint(_0xabdb7f,_0x44cf75(0x1b8),_0x5652eb),_0x194533=await this[_0x44cf75(0x1bb)]['request']('GET',_0x344c6b);return parseConversionSankeyResponse(_0x194533);}async['getActivationSankeyChart'](_0x257cf9,_0x444b33){const _0x409dd7=a120_0x12a140,_0x127433=buildJourneyEndpoint(_0x257cf9,_0x409dd7(0x1c3),_0x444b33),_0x4992f9=await this['httpClient'][_0x409dd7(0x1c9)](_0x409dd7(0x1dd),_0x127433);return parseActivationSankeyResponse(_0x4992f9);}async[a120_0x12a140(0x22c)](_0x3f836e){const _0x4ff2af=a120_0x12a140,_0x18f502=_0x4ff2af(0x201)+_0x3f836e+'/pause',_0x473967=await this[_0x4ff2af(0x1bb)][_0x4ff2af(0x1c9)](_0x4ff2af(0x213),_0x18f502);return _0x4ff2af(0x1f7)in _0x473967?_0x473967[_0x4ff2af(0x1f7)]:_0x473967;}async[a120_0x12a140(0x1c2)](_0x1dd7f7){const _0x323ddb=a120_0x12a140,_0x5c1433=_0x323ddb(0x201)+_0x1dd7f7+'/resume',_0x16d648=await this[_0x323ddb(0x1bb)]['request']('PATCH',_0x5c1433);return _0x323ddb(0x1f7)in _0x16d648?_0x16d648[_0x323ddb(0x1f7)]:_0x16d648;}async[a120_0x12a140(0x1b4)](_0x5db480){const _0x565db8=a120_0x12a140,_0x3d59c8=_0x565db8(0x201)+_0x5db480+_0x565db8(0x20a),_0x2623b6=await this[_0x565db8(0x1bb)]['request'](_0x565db8(0x1e8),_0x3d59c8);return{'id':_0x2623b6[_0x565db8(0x1f7)]['id'],..._0x2623b6[_0x565db8(0x1f7)][_0x565db8(0x1fe)]};}async['getJourneyActivation'](_0x2540eb,_0x2c0a3d){const _0x2574d5=a120_0x12a140,_0x51df43=_0x2574d5(0x201)+_0x2540eb+_0x2574d5(0x1e2)+_0x2c0a3d,_0x2b990c=await this[_0x2574d5(0x1bb)][_0x2574d5(0x1c9)](_0x2574d5(0x1dd),_0x51df43);return _0x2574d5(0x1f7)in _0x2b990c?_0x2b990c[_0x2574d5(0x1f7)]:_0x2b990c;}async['listJourneyActivations'](_0x423c9f){const _0x2bd5f6=a120_0x12a140,_0x3e2209='/entities/journeys/'+_0x423c9f+_0x2bd5f6(0x1b6),_0x3f42f0=await this[_0x2bd5f6(0x1bb)][_0x2bd5f6(0x1c9)](_0x2bd5f6(0x1dd),_0x3e2209);return'data'in _0x3f42f0?_0x3f42f0['data']:_0x3f42f0;}async[a120_0x12a140(0x200)](_0x5c1ae9,_0x2adede){const _0x255f93=a120_0x12a140,_0x57efcc=_0x255f93(0x201)+_0x5c1ae9+_0x255f93(0x1b6),_0xfe9812={'name':_0x2adede[_0x255f93(0x1b7)],'scheduleType':_0x2adede[_0x255f93(0x237)]||_0x255f93(0x1e3),'connectionId':String(_0x2adede[_0x255f93(0x1d3)]),'columns':_0x2adede['columns']??[],'notifyOn':_0x2adede[_0x255f93(0x1fc)]??[],'connectorConfig':_0x2adede[_0x255f93(0x1cb)]??{},..._0x2adede[_0x255f93(0x1af)]!==undefined&&{'description':_0x2adede[_0x255f93(0x1af)]},..._0x2adede[_0x255f93(0x211)]!==undefined&&{'allColumns':_0x2adede['allColumns']},..._0x2adede['timezone']!==undefined&&{'timezone':_0x2adede[_0x255f93(0x21b)]},..._0x2adede[_0x255f93(0x1a8)]!==undefined&&{'emailRecipients':_0x2adede[_0x255f93(0x1a8)]},..._0x2adede[_0x255f93(0x1d8)]!==undefined&&{'activationTemplateId':_0x2adede[_0x255f93(0x1d8)]},..._0x2adede[_0x255f93(0x206)]!==undefined&&{'syndicationBehavior':_0x2adede[_0x255f93(0x206)]},..._0x2adede['syndicationBehaviors']!==undefined&&{'syndicationBehaviors':_0x2adede[_0x255f93(0x21d)]}},_0x587cca=await this[_0x255f93(0x1bb)]['request']('POST',_0x57efcc,{'body':{'type':'journeyActivationStep','attributes':{'runAfterJourneyRefresh':_0x2adede[_0x255f93(0x1e7)]??![],'activationParams':_0xfe9812}},'headers':{'Content-Type':_0x255f93(0x1bd)}});return _0x255f93(0x1f7)in _0x587cca?_0x587cca['data']:_0x587cca;}async[a120_0x12a140(0x219)](_0x4834ab){const _0x16f02c=a120_0x12a140,_0x1ed655=_0x16f02c(0x222)+_0x4834ab+_0x16f02c(0x234),_0x29847a=await this[_0x16f02c(0x1bb)][_0x16f02c(0x1c9)](_0x16f02c(0x213),_0x1ed655),_0x596682=_0x29847a[_0x16f02c(0x1f7)];return{'id':_0x596682['id'],'name':_0x596682[_0x16f02c(0x1fe)][_0x16f02c(0x1b7)],'description':_0x596682[_0x16f02c(0x1fe)][_0x16f02c(0x1af)],'audienceId':_0x596682[_0x16f02c(0x1fe)][_0x16f02c(0x1df)],'state':_0x596682[_0x16f02c(0x1fe)][_0x16f02c(0x1b3)],'paused':_0x596682[_0x16f02c(0x1fe)][_0x16f02c(0x230)],'stageCount':_0x596682[_0x16f02c(0x1fe)][_0x16f02c(0x231)]?.['length']||0x0,'createdAt':_0x596682[_0x16f02c(0x1fe)]['createdAt'],'updatedAt':_0x596682[_0x16f02c(0x1fe)][_0x16f02c(0x227)],'launchedAt':_0x596682[_0x16f02c(0x1fe)][_0x16f02c(0x1dc)]};}async[a120_0x12a140(0x1a1)](_0x51a082){const _0xd99f09=a120_0x12a140,_0x11646e=_0xd99f09(0x222)+_0x51a082+'/resume',_0x1153e9=await this[_0xd99f09(0x1bb)]['request'](_0xd99f09(0x213),_0x11646e),_0x5efe10=_0x1153e9[_0xd99f09(0x1f7)];return{'id':_0x5efe10['id'],'name':_0x5efe10[_0xd99f09(0x1fe)][_0xd99f09(0x1b7)],'description':_0x5efe10[_0xd99f09(0x1fe)][_0xd99f09(0x1af)],'audienceId':_0x5efe10[_0xd99f09(0x1fe)]['audienceId'],'state':_0x5efe10['attributes']['state'],'paused':_0x5efe10[_0xd99f09(0x1fe)]['paused'],'stageCount':_0x5efe10['attributes'][_0xd99f09(0x231)]?.['length']||0x0,'createdAt':_0x5efe10[_0xd99f09(0x1fe)]['createdAt'],'updatedAt':_0x5efe10[_0xd99f09(0x1fe)][_0xd99f09(0x227)],'launchedAt':_0x5efe10[_0xd99f09(0x1fe)][_0xd99f09(0x1dc)]};}async[a120_0x12a140(0x1f2)](_0x3bc4b0){const _0x26a468=a120_0x12a140,_0x109dcd=_0x26a468(0x1fb)+_0x3bc4b0+_0x26a468(0x221),_0x83e11=await this[_0x26a468(0x1bb)][_0x26a468(0x1c9)](_0x26a468(0x1dd),_0x109dcd);return _0x83e11[_0x26a468(0x1f7)]['map'](_0x2906f7=>({'id':_0x2906f7['id'],'name':_0x2906f7[_0x26a468(0x1fe)][_0x26a468(0x1b7)],'description':_0x2906f7['attributes'][_0x26a468(0x1af)],'audienceId':_0x2906f7[_0x26a468(0x1fe)][_0x26a468(0x1df)],'state':_0x2906f7['attributes'][_0x26a468(0x1b3)],'paused':_0x2906f7[_0x26a468(0x1fe)]['paused'],'stageCount':_0x2906f7['attributes'][_0x26a468(0x231)]?.['length']||0x0,'createdAt':_0x2906f7[_0x26a468(0x1fe)][_0x26a468(0x207)],'updatedAt':_0x2906f7[_0x26a468(0x1fe)][_0x26a468(0x227)],'launchedAt':_0x2906f7[_0x26a468(0x1fe)][_0x26a468(0x1dc)]}));}async[a120_0x12a140(0x1e1)](_0x598f44){const _0x246d07=a120_0x12a140,_0x40bf08=_0x246d07(0x1ec)+_0x598f44+_0x246d07(0x1d2);return await this[_0x246d07(0x1bb)][_0x246d07(0x1c9)](_0x246d07(0x1dd),_0x40bf08);}}export function buildJourneyEndpoint(_0x44896e,_0x481d73,_0x1bc22d){const _0x4ec934=a120_0x12a140,_0x2eebb5=_0x4ec934(0x201)+_0x44896e+'/'+_0x481d73,_0x44b1f1=new URLSearchParams();if(_0x1bc22d?.[_0x4ec934(0x1ef)])_0x44b1f1[_0x4ec934(0x1c4)](_0x4ec934(0x1ef),_0x1bc22d[_0x4ec934(0x1ef)]);if(_0x1bc22d?.['to'])_0x44b1f1[_0x4ec934(0x1c4)]('to',_0x1bc22d['to']);if(_0x1bc22d?.['limit']!=null)_0x44b1f1[_0x4ec934(0x1c4)]('limit',String(_0x1bc22d['limit']));const _0x23563c=_0x44b1f1['toString']();return _0x23563c?_0x2eebb5+'?'+_0x23563c:_0x2eebb5;}export function parseJourneyStatisticsResponse(_0x253bfa){const _0x472c87=a120_0x12a140;if(!(_0x472c87(0x1f7)in _0x253bfa))return _0x253bfa;const _0x2bb4fd=_0x253bfa[_0x472c87(0x1f7)];if(!(_0x472c87(0x1fe)in _0x2bb4fd)||!_0x2bb4fd[_0x472c87(0x1fe)]||typeof _0x2bb4fd[_0x472c87(0x1fe)]!==_0x472c87(0x1ed))return _0x2bb4fd;const _0x1c15ff=_0x2bb4fd[_0x472c87(0x1fe)],_0x23f145={'journeyId':_0x1c15ff[_0x472c87(0x217)],'size':_0x1c15ff[_0x472c87(0x235)],'goalSize':_0x1c15ff[_0x472c87(0x19c)],'enteredSize':_0x1c15ff[_0x472c87(0x20d)],'completionRate':_0x1c15ff[_0x472c87(0x1d0)],'exitOrJumpSize':_0x1c15ff[_0x472c87(0x1aa)],'exitOrJumpRate':_0x1c15ff['exitOrJumpRate'],'stages':(_0x1c15ff[_0x472c87(0x1a9)]??[])['map'](_0x103d45=>{const _0x41c49c=_0x472c87,_0x59c556={'id':_0x103d45['id'],'enteredSize':_0x103d45[_0x41c49c(0x20d)],'milestoneSize':_0x103d45[_0x41c49c(0x229)],'completeMilestoneRate':_0x103d45[_0x41c49c(0x216)],'exitOrJumpSize':_0x103d45[_0x41c49c(0x1aa)],'exitOrJumpRate':_0x103d45[_0x41c49c(0x21e)],'size':_0x103d45[_0x41c49c(0x235)]};if(_0x103d45[_0x41c49c(0x20c)])_0x59c556[_0x41c49c(0x20c)]=_0x103d45[_0x41c49c(0x20c)];if(_0x103d45[_0x41c49c(0x1c8)])_0x59c556[_0x41c49c(0x1c8)]=_0x103d45['stepSizes'];if(_0x103d45['stepInfluxes'])_0x59c556[_0x41c49c(0x21a)]=_0x103d45[_0x41c49c(0x21a)];if(_0x103d45[_0x41c49c(0x1a2)])_0x59c556['exitSizes']=_0x103d45[_0x41c49c(0x1a2)];return _0x59c556;})};return Array[_0x472c87(0x1b1)](_0x1c15ff[_0x472c87(0x20c)])&&(_0x23f145[_0x472c87(0x20c)]=_0x1c15ff['history']),_0x23f145;}function extractSankeyChart(_0x3c5285){const _0xd2900e=a120_0x12a140,_0x1fc21d=Array['isArray'](_0x3c5285['data'])?_0x3c5285['data']:[],_0x26f46e=_0x3c5285['metaData']&&typeof _0x3c5285[_0xd2900e(0x1f0)]===_0xd2900e(0x1ed)?_0x3c5285[_0xd2900e(0x1f0)]:{},_0x12fedf=Array['isArray'](_0x26f46e[_0xd2900e(0x1c0)])?_0x26f46e['links']:[];return{'nodes':_0x1fc21d,'links':_0x12fedf};}function extractJsonApiAttributes(_0x328eaa){const _0x4fde07=a120_0x12a140;if(!_0x328eaa||typeof _0x328eaa!==_0x4fde07(0x1ed))return[];const _0x1aea97=_0x328eaa;if(!Array['isArray'](_0x1aea97[_0x4fde07(0x1f7)]))return[];return _0x1aea97[_0x4fde07(0x1f7)][_0x4fde07(0x1b9)](_0x410059=>!!_0x410059&&typeof _0x410059==='object')[_0x4fde07(0x20f)](_0x6d72a3=>_0x6d72a3[_0x4fde07(0x1fe)])[_0x4fde07(0x1b9)](_0x420986=>!!_0x420986&&typeof _0x420986===_0x4fde07(0x1ed));}function a120_0x257d(){const _0x49c992=['data','segment-batch','PUT','updateJourney','/entities/parent_segments/','notifyOn','getSegmentSQL','attributes','folder-segment','createJourneyActivation','/entities/journeys/','application/json','7254081hJTtko','/entities/by-folder/','/entities/parent_segments','syndicationBehavior','createdAt','listActivations','/detail','/run','parentFolder','history','enteredSize','/segments','map','/behaviors','allColumns','timeout','PATCH','?depth=','getJourneyBundle','completeMilestoneRate','journeyId','/entities/journeys','pauseRealtimeJourney','stepInfluxes','timezone','length','syndicationBehaviors','exitOrJumpRate','DELETE','journeyBundleId','/realtime_journeys','/entities/realtime_journeys/','/entities/journeys?folder_id=','/entities/folders','832289imqnHa','checkJourneyAppendable','updatedAt','71782tGaMmg','milestoneSize','/entities/folders/','deleteSegment','pauseJourney','deleteActivation','countPopulation','getAudienceAttributes','paused','realtimeJourneyStages','/folders','chart','/pause','size','96ccdSyS','scheduleType','journeys','goalSize','updateActivation','versionNumber','lastVersionNumber','rule','resumeRealtimeJourney','exitSizes','sql','cdp','string','included','8bNlUQd','emailRecipients','journeyStageStatistics','exitOrJumpSize','listEntitiesByFolder','journeyBundleName','getParentSegmentFull','7570mTtwcJ','description','/syndications','isArray','relationships','state','runJourney','updateSegment','/activations','name','conversion_sankey_charts','filter','/segments/','httpClient','/entities/segments/','application/vnd.treasuredata.v1+json','runParentSegment','proxy','links','45705ckrBuH','resumeJourney','activation_sankey_charts','set','type','statistics','createSegment','stepSizes','request','query','connectorConfig','/journeys','journeyStageId','site','listJourneys','completionRate','3582376tVaKAI','/realtime_configuration_versions/current','connectionId','moveSegment','/journeys_appendable','getAudienceBehaviors','createParentSegment','activationTemplateId','apiKey','getActivation','getParentSegment','launchedAt','GET','/entities/segments','audienceId','updateParentSegment','getCurrentRealtimeConfigVersion','/activations/','none','/segments/query','listSegments','/entities/journey_bundles/','runAfterJourneyRefresh','POST','parentFolderId','createJourneySegment','5275AcPiRW','/audiences/','object','&with_rule=','from','metaData','/audiences','listRealtimeJourneys','requestSegmentSQL','4916QPDgnx','2050536WDbWJz','segment-journey'];a120_0x257d=function(){return _0x49c992;};return a120_0x257d();}export function parseConversionSankeyResponse(_0x30c54d){const _0x261fc5=a120_0x12a140,_0x52c373={'nodes':[],'links':[]},_0x516588=extractJsonApiAttributes(_0x30c54d);if(_0x516588['length']===0x0)return _0x52c373;const _0x551313=_0x516588[0x0],_0x10616e=_0x551313[_0x261fc5(0x233)];if(_0x10616e&&typeof _0x10616e===_0x261fc5(0x1ed)){const {nodes:_0x2fccf6,links:_0x1000e2}=extractSankeyChart(_0x10616e);return{'nodes':_0x2fccf6,'links':_0x1000e2,...typeof _0x551313[_0x261fc5(0x227)]===_0x261fc5(0x1a5)?{'updatedAt':_0x551313['updatedAt']}:{}};}return _0x52c373;}export function parseActivationSankeyResponse(_0x1abb98){const _0x4e43ae=a120_0x12a140,_0x575893=extractJsonApiAttributes(_0x1abb98);if(_0x575893[_0x4e43ae(0x21c)]>0x0)return _0x575893[_0x4e43ae(0x20f)](_0x156c4f=>{const _0x160292=_0x4e43ae,_0x4714d9=_0x156c4f[_0x160292(0x233)],{nodes:_0x4609a9,links:_0x210cd1}=_0x4714d9&&typeof _0x4714d9===_0x160292(0x1ed)?extractSankeyChart(_0x4714d9):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x156c4f[_0x160292(0x1cd)]===_0x160292(0x1a5)?_0x156c4f[_0x160292(0x1cd)]:'','nodes':_0x4609a9,'links':_0x210cd1,...typeof _0x156c4f[_0x160292(0x227)]===_0x160292(0x1a5)?{'updatedAt':_0x156c4f[_0x160292(0x227)]}:{}};});if(Array[_0x4e43ae(0x1b1)](_0x1abb98))return _0x1abb98;return[];}export function parseJourneyBundleResponse(_0x3b5265){const _0x55044a=a120_0x12a140;if(!_0x3b5265||typeof _0x3b5265!=='object')throw new Error('Invalid\x20journey\x20bundle\x20response');const _0x30c25c=_0x3b5265,_0x543062=_0x30c25c[_0x55044a(0x1f7)],_0x358aca=_0x543062?.[_0x55044a(0x1fe)]??_0x30c25c,_0x290c61=Array[_0x55044a(0x1b1)](_0x358aca[_0x55044a(0x238)])?_0x358aca['journeys']:[],_0x561101=_0x290c61[_0x55044a(0x20f)](_0x30ece7=>{const _0x182a17=_0x55044a;if(!_0x30ece7||typeof _0x30ece7!=='object')return _0x30ece7;const _0x1d4d67=_0x30ece7;if(_0x1d4d67['data']&&typeof _0x1d4d67['data']===_0x182a17(0x1ed))return _0x1d4d67['data'];return _0x1d4d67;});return{'name':_0x358aca[_0x55044a(0x1b7)],'description':_0x358aca[_0x55044a(0x1af)]??null,'latestJourneyId':_0x358aca['latestJourneyId'],'lastVersionNumber':_0x358aca[_0x55044a(0x19f)],'journeys':_0x561101};}
|
|
1
|
+
const a120_0x1bc691=a120_0xa208;(function(_0x5da0f8,_0xd20cb8){const _0x45911d=a120_0xa208,_0x5b1564=_0x5da0f8();while(!![]){try{const _0x3bed94=parseInt(_0x45911d(0xd9))/0x1*(-parseInt(_0x45911d(0x131))/0x2)+-parseInt(_0x45911d(0x13b))/0x3+parseInt(_0x45911d(0xc3))/0x4+parseInt(_0x45911d(0xeb))/0x5*(-parseInt(_0x45911d(0xe6))/0x6)+-parseInt(_0x45911d(0xee))/0x7*(-parseInt(_0x45911d(0x147))/0x8)+-parseInt(_0x45911d(0x12d))/0x9+-parseInt(_0x45911d(0xf3))/0xa*(-parseInt(_0x45911d(0xad))/0xb);if(_0x3bed94===_0xd20cb8)break;else _0x5b1564['push'](_0x5b1564['shift']());}catch(_0x3516d6){_0x5b1564['push'](_0x5b1564['shift']());}}}(a120_0x408a,0x33d71));import{HTTPClient}from'./http-client.js';function a120_0xa208(_0x2f43a5,_0x33a890){_0x2f43a5=_0x2f43a5-0xab;const _0x408af3=a120_0x408a();let _0xa2087b=_0x408af3[_0x2f43a5];return _0xa2087b;}import{getEndpoint}from'../types/index.js';import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class CDPApiClient{[a120_0x1bc691(0x124)];[a120_0x1bc691(0x101)];constructor(_0x40707e){const _0x202973=a120_0x1bc691,_0x29de8b=getEndpoint(_0x40707e[_0x202973(0xce)],'cdp');this[_0x202973(0x101)]=toHeaderRecord(getAuthHeaders(_0x40707e[_0x202973(0xce)],_0x40707e[_0x202973(0xe0)],_0x40707e[_0x202973(0x136)])),this[_0x202973(0x124)]=new HTTPClient(_0x29de8b,{...this[_0x202973(0x101)],'Accept':_0x202973(0xae),'Content-Type':_0x202973(0xd2)},{'proxy':_0x40707e[_0x202973(0x10b)],'defaultTimeout':_0x40707e[_0x202973(0x130)]});}async[a120_0x1bc691(0x111)](){const _0x48a3b5=a120_0x1bc691,_0xb6aefd=_0x48a3b5(0xcc),_0x1e632b=await this[_0x48a3b5(0x124)][_0x48a3b5(0x146)](_0x48a3b5(0xb3),_0xb6aefd);return Array[_0x48a3b5(0xcb)](_0x1e632b)?_0x1e632b:_0x1e632b['data'];}async[a120_0x1bc691(0x112)](_0x681425){const _0x345f44=a120_0x1bc691,_0x12b1da=_0x345f44(0x12b)+_0x681425,_0x23b49f=await this[_0x345f44(0x124)][_0x345f44(0x146)](_0x345f44(0xb3),_0x12b1da);return'data'in _0x23b49f?_0x23b49f[_0x345f44(0xbc)]:_0x23b49f;}async[a120_0x1bc691(0xc0)](_0x5a57dd){const _0x412cbe=a120_0x1bc691,_0x5038cb='/audiences/'+_0x5a57dd+_0x412cbe(0x14b),_0xf51379=await this[_0x412cbe(0x124)][_0x412cbe(0x146)]('GET',_0x5038cb);return Array['isArray'](_0xf51379)?_0xf51379:_0xf51379[_0x412cbe(0xbc)];}async['getSegment'](_0x3bc4ab,_0x31b769){const _0x5010f8=a120_0x1bc691,_0x570a59=_0x5010f8(0x13c)+_0x3bc4ab+_0x5010f8(0xc8)+_0x31b769,_0x165453=await this[_0x5010f8(0x124)][_0x5010f8(0x146)]('GET',_0x570a59);return _0x5010f8(0xbc)in _0x165453?_0x165453['data']:_0x165453;}async[a120_0x1bc691(0x114)](_0x577a4e){const _0xc8ae09=a120_0x1bc691,_0x313110='/entities/segments/'+_0x577a4e,_0xf259db=await this[_0xc8ae09(0x124)][_0xc8ae09(0x146)]('GET',_0x313110);if(_0xc8ae09(0xbc)in _0xf259db){const _0x9749c9=_0xf259db[_0xc8ae09(0xbc)];if(_0xc8ae09(0xe1)in _0x9749c9&&_0x9749c9[_0xc8ae09(0xe1)]&&typeof _0x9749c9['attributes']===_0xc8ae09(0xd8)){const _0x18a79f=_0x9749c9['attributes'];return{'id':_0x9749c9['id'],'name':_0x18a79f['name'],..._0x18a79f};}return _0x9749c9;}return _0xf259db;}async['listSegmentFolders'](_0xff1a1f){const _0x1562aa=a120_0x1bc691,_0x394dfd=_0x1562aa(0x13c)+_0xff1a1f+_0x1562aa(0xb2),_0x5c8120=await this[_0x1562aa(0x124)][_0x1562aa(0x146)](_0x1562aa(0xb3),_0x394dfd);return Array[_0x1562aa(0xcb)](_0x5c8120)?_0x5c8120:_0x5c8120[_0x1562aa(0xbc)];}async['getSegmentFolder'](_0x3d0699){const _0x2eae14=a120_0x1bc691,_0x48a20f='/entities/folders/'+_0x3d0699,_0x131cd6=await this[_0x2eae14(0x124)]['request'](_0x2eae14(0xb3),_0x48a20f);return _0x2eae14(0xbc)in _0x131cd6?_0x131cd6[_0x2eae14(0xbc)]:_0x131cd6;}async[a120_0x1bc691(0x11f)](_0x1d7ec6,_0x44ff38=0x20,_0x178ab1=![]){const _0x3d8c31=a120_0x1bc691,_0x504e38='/entities/by-folder/'+_0x1d7ec6+_0x3d8c31(0xfe)+_0x44ff38+'&with_rule='+_0x178ab1;return await this[_0x3d8c31(0x124)]['request'](_0x3d8c31(0xb3),_0x504e38);}async[a120_0x1bc691(0x11d)](_0x4a916e,_0xfbd46f){const _0x1f3e3d=a120_0x1bc691,_0x7d8dba=_0x1f3e3d(0x11c)+_0xfbd46f+_0x1f3e3d(0xb1),_0x5a5e70=await this[_0x1f3e3d(0x124)][_0x1f3e3d(0x146)]('GET',_0x7d8dba);return _0x5a5e70[_0x1f3e3d(0xbc)][_0x1f3e3d(0x145)](_0x4537cf=>({'id':_0x4537cf['id'],..._0x4537cf[_0x1f3e3d(0xe1)]}));}async[a120_0x1bc691(0x13f)](_0xa90732,_0x2c45e5,_0x356010){const _0x34b993=a120_0x1bc691,_0xe05bd5=_0x34b993(0x11c)+_0x2c45e5+_0x34b993(0xf2)+_0x356010,_0x55b4c7=await this[_0x34b993(0x124)][_0x34b993(0x146)]('GET',_0xe05bd5);return{'id':_0x55b4c7['data']['id'],..._0x55b4c7[_0x34b993(0xbc)]['attributes']};}async['createActivation'](_0x3eb44f,_0x577cd9,_0x2bb8a4){const _0x6cc6e0=a120_0x1bc691,_0x50e20b=_0x6cc6e0(0x13c)+_0x3eb44f+'/segments/'+_0x577cd9+_0x6cc6e0(0xb1),_0x5c020b=await this[_0x6cc6e0(0x124)][_0x6cc6e0(0x146)](_0x6cc6e0(0x132),_0x50e20b,{'body':_0x2bb8a4});return _0x5c020b;}async[a120_0x1bc691(0x115)](_0x4fb2e8,_0xcb5b46,_0x454628,_0x16d7b7){const _0x213e54=a120_0x1bc691,_0x1ca012=_0x213e54(0x13c)+_0x4fb2e8+_0x213e54(0xc8)+_0xcb5b46+_0x213e54(0xf2)+_0x454628,_0x5f22f7=await this[_0x213e54(0x124)][_0x213e54(0x146)](_0x213e54(0x105),_0x1ca012,{'body':_0x16d7b7});return _0x5f22f7;}async[a120_0x1bc691(0xb5)](_0x3759b0,_0x18115f,_0x1b19ba){const _0x239ad7=a120_0x1bc691,_0xbc3f2=_0x239ad7(0x13c)+_0x3759b0+'/segments/'+_0x18115f+_0x239ad7(0xf2)+_0x1b19ba;await this[_0x239ad7(0x124)][_0x239ad7(0x146)](_0x239ad7(0x128),_0xbc3f2);}async[a120_0x1bc691(0x139)](_0x53064a){const _0x1a3983=a120_0x1bc691;return this[_0x1a3983(0xb7)](_0x53064a);}async[a120_0x1bc691(0x10c)](_0x3f700d,_0x3f5207){const _0x3356d8=a120_0x1bc691;return this[_0x3356d8(0xb7)](_0x3f700d,_0x3f5207);}async['getSegmentSQL'](_0x23d4b4,_0x5b5c10){const _0x4a4a3d=a120_0x1bc691,_0x49aa4b=await this[_0x4a4a3d(0xbe)](_0x23d4b4,_0x5b5c10),_0x30a3b2='rule'in _0x49aa4b&&_0x49aa4b[_0x4a4a3d(0x11a)]?_0x49aa4b[_0x4a4a3d(0x11a)]:undefined;return this[_0x4a4a3d(0xb7)](_0x23d4b4,_0x30a3b2);}async[a120_0x1bc691(0xb7)](_0x562450,_0x5c3661){const _0x43e904=a120_0x1bc691,_0x1b4a6d='/audiences/'+_0x562450+_0x43e904(0xc1),_0x4b24e2={'format':_0x43e904(0x10d)};_0x5c3661&&(_0x4b24e2[_0x43e904(0x11a)]=_0x5c3661);const _0xf6d848=await this[_0x43e904(0x124)][_0x43e904(0x146)](_0x43e904(0x132),_0x1b4a6d,{'body':_0x4b24e2});return _0xf6d848['sql']||_0xf6d848[_0x43e904(0x137)]||'';}async[a120_0x1bc691(0x102)](_0x3510f6){const _0x1961c4=a120_0x1bc691,_0x2d95d8='/audiences',_0x3a8df1=await this[_0x1961c4(0x124)][_0x1961c4(0x146)](_0x1961c4(0x132),_0x2d95d8,{'body':_0x3510f6,'headers':{'Content-Type':_0x1961c4(0xae)}});return _0x3a8df1;}async['updateParentSegment'](_0x5660de,_0x5701c5){const _0x49a920=a120_0x1bc691,_0x2e1b36='/audiences/'+_0x5660de,_0x5068c7=await this[_0x49a920(0x124)][_0x49a920(0x146)]('PUT',_0x2e1b36,{'body':_0x5701c5,'headers':{'Content-Type':_0x49a920(0xae)}});return _0x5068c7;}async[a120_0x1bc691(0xd1)](_0x25839e){const _0x4a1c50=a120_0x1bc691,_0x35ccb1=_0x4a1c50(0x13c)+_0x25839e,_0x5f323d=await this[_0x4a1c50(0x124)]['request'](_0x4a1c50(0xb3),_0x35ccb1,{'headers':{'Accept':'application/vnd.treasuredata.v1+json'}});return _0x5f323d;}async[a120_0x1bc691(0x14c)](_0x306bbc){const _0x1994ce=a120_0x1bc691,_0xbc5e45=_0x1994ce(0x13c)+_0x306bbc+_0x1994ce(0xf7),_0x2c2638=await this[_0x1994ce(0x124)][_0x1994ce(0x146)](_0x1994ce(0xb3),_0xbc5e45);return _0x2c2638;}async[a120_0x1bc691(0x13d)](_0x26f674,_0x1627d1){const _0x5bef72=a120_0x1bc691;let _0x553860='/audiences/'+_0x26f674+'/behaviors';_0x1627d1!==undefined&&(_0x553860+='?realtime='+_0x1627d1);const _0x305172=await this[_0x5bef72(0x124)][_0x5bef72(0x146)]('GET',_0x553860);return _0x305172;}async['createSegment'](_0x38ae1d,_0x9aae0){const _0x1276cc=a120_0x1bc691,_0x4a34ca='/audiences/'+_0x38ae1d+'/segments',_0x4e4ba5=await this[_0x1276cc(0x124)]['request'](_0x1276cc(0x132),_0x4a34ca,{'body':_0x9aae0});return _0x4e4ba5;}async['createJourneySegment'](_0x598d4f){const _0x38c604=a120_0x1bc691,_0x1aed95=_0x38c604(0xd0),_0x2d84b6={'type':_0x38c604(0x104),'attributes':{'name':_0x598d4f['name'],'description':_0x598d4f[_0x38c604(0xd5)]||'','journeyId':_0x598d4f[_0x38c604(0xf9)],'rule':_0x598d4f['rule'],'countPopulation':_0x598d4f[_0x38c604(0x144)]??!![]},'relationships':{'parentFolder':{'data':{'id':_0x598d4f[_0x38c604(0xc7)],'type':_0x38c604(0x122)}}}},_0x1b8e3d=await this['httpClient']['request'](_0x38c604(0x132),_0x1aed95,{'body':_0x2d84b6,'headers':{'Content-Type':_0x38c604(0xae)}});return _0x1b8e3d[_0x38c604(0xbc)]['id'];}async[a120_0x1bc691(0xbf)](_0x362c2c,_0x2f0fc0,_0x2b2615){const _0x22f5ad=a120_0x1bc691,_0x58a629='/audiences/'+_0x362c2c+'/segments/'+_0x2f0fc0,_0x397ae5=await this['httpClient'][_0x22f5ad(0x146)](_0x22f5ad(0x105),_0x58a629,{'body':_0x2b2615});return _0x397ae5;}async['moveSegment'](_0x4b4a19,_0x1f483f){const _0x128524=a120_0x1bc691,_0x41eff4='/entities/segments/'+_0x4b4a19,_0x3cdab4={'type':_0x128524(0x123),'id':_0x4b4a19,'attributes':{},'relationships':{'parentFolder':{'data':{'id':_0x1f483f,'type':_0x128524(0x122)}}}},_0x1409d8=await this['httpClient'][_0x128524(0x146)](_0x128524(0x13a),_0x41eff4,{'body':_0x3cdab4,'headers':{'Content-Type':_0x128524(0xae)}});return{'id':_0x1409d8[_0x128524(0xbc)]['id'],'segmentFolderId':_0x1409d8[_0x128524(0xbc)][_0x128524(0x100)]?.[_0x128524(0xb8)]?.[_0x128524(0xbc)]?.['id']??null};}async[a120_0x1bc691(0xc9)](_0x5beed0){const _0x48ee65=a120_0x1bc691,_0xfedd1e=_0x48ee65(0x11c)+_0x5beed0;await this[_0x48ee65(0x124)][_0x48ee65(0x146)](_0x48ee65(0x128),_0xfedd1e);}async[a120_0x1bc691(0xf0)](_0x5b916e,_0x522726){const _0x3057cc=a120_0x1bc691;if(_0x522726[_0x3057cc(0xc7)]){const _0x102cb7=_0x3057cc(0xde),_0xfefa48={'type':_0x3057cc(0x122),'attributes':{'name':_0x522726[_0x3057cc(0x143)],'description':_0x522726[_0x3057cc(0xd5)]||''},'relationships':{'parentFolder':{'data':{'id':_0x522726[_0x3057cc(0xc7)],'type':_0x3057cc(0x122)}}}},_0xea6cce=await this[_0x3057cc(0x124)][_0x3057cc(0x146)](_0x3057cc(0x132),_0x102cb7,{'body':_0xfefa48,'headers':{'Content-Type':_0x3057cc(0xae)}}),_0x4c1e22=_0xea6cce[_0x3057cc(0xbc)];return{'id':_0x4c1e22['id'],'name':_0x4c1e22[_0x3057cc(0xe1)][_0x3057cc(0x143)],'description':_0x4c1e22[_0x3057cc(0xe1)]['description'],'audienceId':_0x4c1e22[_0x3057cc(0xe1)][_0x3057cc(0xc4)]||String(_0x5b916e),'parentFolderId':_0x4c1e22[_0x3057cc(0x100)]?.[_0x3057cc(0xb8)]?.[_0x3057cc(0xbc)]?.['id'],'createdAt':_0x4c1e22[_0x3057cc(0xe1)][_0x3057cc(0xd4)],'updatedAt':_0x4c1e22[_0x3057cc(0xe1)]['updatedAt']};}const _0x2196dc=_0x3057cc(0x13c)+_0x5b916e+_0x3057cc(0xb2),_0x88855f=await this[_0x3057cc(0x124)][_0x3057cc(0x146)]('POST',_0x2196dc,{'body':_0x522726});if(_0x3057cc(0xbc)in _0x88855f&&_0x88855f[_0x3057cc(0xbc)]){const _0x2551ef=_0x88855f[_0x3057cc(0xbc)];return{'id':_0x2551ef['id'],'name':_0x2551ef[_0x3057cc(0x143)],'description':_0x2551ef[_0x3057cc(0xd5)],'audienceId':_0x2551ef[_0x3057cc(0xc4)]||String(_0x5b916e),'parentFolderId':_0x2551ef['parentFolderId'],'createdAt':_0x2551ef[_0x3057cc(0xd4)],'updatedAt':_0x2551ef[_0x3057cc(0xe5)]};}return _0x88855f;}async[a120_0x1bc691(0xea)](_0x1c58cd){const _0x4bf584=a120_0x1bc691,_0x181928='/audiences/'+_0x1c58cd+_0x4bf584(0x10e),_0x3e3f75=await this[_0x4bf584(0x124)]['request']('POST',_0x181928);return _0x3e3f75;}async[a120_0x1bc691(0x103)](_0x3fe67e){const _0xcdcafe=a120_0x1bc691,_0x5c8b5c='/entities/journeys?folder_id='+_0x3fe67e,_0x30694b=await this[_0xcdcafe(0x124)][_0xcdcafe(0x146)](_0xcdcafe(0xb3),_0x5c8b5c);return _0x30694b['data'][_0xcdcafe(0x145)](_0x4b0285=>({'id':_0x4b0285['id'],'name':_0x4b0285['attributes'][_0xcdcafe(0x143)],'journeyBundleName':_0x4b0285[_0xcdcafe(0xe1)][_0xcdcafe(0x12c)],'journeyBundleId':_0x4b0285[_0xcdcafe(0xe1)][_0xcdcafe(0x134)],'versionNumber':_0x4b0285[_0xcdcafe(0xe1)]['versionNumber'],'description':_0x4b0285[_0xcdcafe(0xe1)][_0xcdcafe(0xd5)],'state':_0x4b0285[_0xcdcafe(0xe1)][_0xcdcafe(0x113)],'paused':_0x4b0285[_0xcdcafe(0xe1)][_0xcdcafe(0x13e)],'audienceId':_0x4b0285[_0xcdcafe(0xe1)][_0xcdcafe(0xc4)],'folderId':_0x4b0285['relationships']?.['parentFolder']?.[_0xcdcafe(0xbc)]?.['id'],'createdAt':_0x4b0285[_0xcdcafe(0xe1)]['createdAt'],'updatedAt':_0x4b0285[_0xcdcafe(0xe1)][_0xcdcafe(0xe5)]}));}async[a120_0x1bc691(0xb6)](_0x3ba855){const _0x173062=a120_0x1bc691,_0x58ef57=_0x173062(0x12a)+_0x3ba855,_0x589e71=await this[_0x173062(0x124)][_0x173062(0x146)]('GET',_0x58ef57),_0x13e19d=new Map();if(_0x589e71['included'])for(const _0x1b62fc of _0x589e71[_0x173062(0xf6)]){_0x1b62fc[_0x173062(0x14a)]===_0x173062(0xb0)&&_0x13e19d[_0x173062(0xec)](_0x1b62fc['id'],_0x1b62fc);}return{'journeys':_0x589e71['data'],'activationStepsById':_0x13e19d};}async[a120_0x1bc691(0xe2)](_0x2bc532){const _0xed5c5=a120_0x1bc691,_0x559847=_0xed5c5(0xab)+_0x2bc532,_0x228c08=await this['httpClient'][_0xed5c5(0x146)]('GET',_0x559847);return _0xed5c5(0xbc)in _0x228c08?_0x228c08[_0xed5c5(0xbc)]:_0x228c08;}async[a120_0x1bc691(0xdc)](_0xcfd95c){const _0x3369cc=a120_0x1bc691,_0x3d4268='/entities/journey_bundles/'+_0xcfd95c,_0x3fc8fb=await this[_0x3369cc(0x124)]['request']('GET',_0x3d4268);return parseJourneyBundleResponse(_0x3fc8fb);}async['checkJourneyAppendable'](_0x493845){const _0x3541ef=a120_0x1bc691,_0x1b9659=_0x3541ef(0xe9)+_0x493845+'/journeys_appendable';await this[_0x3541ef(0x124)]['request'](_0x3541ef(0xb3),_0x1b9659);}async[a120_0x1bc691(0xfa)](_0x216eb6,_0x438bf9){const _0x5d59dd=a120_0x1bc691,_0x52fa6f=_0x5d59dd(0xe9)+_0x216eb6+'/journeys',_0x40f415=await this[_0x5d59dd(0x124)][_0x5d59dd(0x146)](_0x5d59dd(0x132),_0x52fa6f,{'body':_0x438bf9});return _0x5d59dd(0xbc)in _0x40f415?_0x40f415['data']:_0x40f415;}async[a120_0x1bc691(0xe4)](_0x5da5a1){const _0x522f27=a120_0x1bc691,_0x1eb07d=_0x522f27(0xf5),_0x49fa25=await this[_0x522f27(0x124)][_0x522f27(0x146)](_0x522f27(0x132),_0x1eb07d,{'body':_0x5da5a1,'headers':{'Content-Type':_0x522f27(0xae)}});return _0x522f27(0xbc)in _0x49fa25?_0x49fa25[_0x522f27(0xbc)]:_0x49fa25;}async[a120_0x1bc691(0x107)](_0x29d446,_0xc60ab3){const _0x49b46e=a120_0x1bc691,_0x34f1ee=_0x49b46e(0xab)+_0x29d446,_0x4ec3c2=await this[_0x49b46e(0x124)][_0x49b46e(0x146)]('PATCH',_0x34f1ee,{'body':_0xc60ab3,'headers':{'Content-Type':_0x49b46e(0xae)}});return _0x49b46e(0xbc)in _0x4ec3c2?_0x4ec3c2['data']:_0x4ec3c2;}async[a120_0x1bc691(0x149)](_0x2d9d08,_0x341805){const _0x34f046=a120_0x1bc691,_0x7165dd=_0x34f046(0xab)+_0x2d9d08+'/detail',_0x3e9935=await this[_0x34f046(0x124)][_0x34f046(0x146)]('POST',_0x7165dd,{'body':_0x341805,'headers':{'Content-Type':_0x34f046(0xae)}});return'data'in _0x3e9935?_0x3e9935[_0x34f046(0xbc)]:_0x3e9935;}async[a120_0x1bc691(0x142)](_0x3aff63,_0x722a09){const _0x1e042d=a120_0x1bc691,_0xa10024=buildJourneyEndpoint(_0x3aff63,_0x1e042d(0x127),_0x722a09),_0x26962f=await this[_0x1e042d(0x124)][_0x1e042d(0x146)](_0x1e042d(0xb3),_0xa10024);return parseJourneyStatisticsResponse(_0x26962f);}async[a120_0x1bc691(0x120)](_0x4ac7ed,_0xa46c32){const _0x369e0f=a120_0x1bc691,_0x303af5=buildJourneyEndpoint(_0x4ac7ed,_0x369e0f(0x135),_0xa46c32),_0x48c544=await this[_0x369e0f(0x124)][_0x369e0f(0x146)](_0x369e0f(0xb3),_0x303af5);return parseConversionSankeyResponse(_0x48c544);}async['getActivationSankeyChart'](_0x3d1d65,_0x3446fe){const _0x2b6188=a120_0x1bc691,_0x464fed=buildJourneyEndpoint(_0x3d1d65,_0x2b6188(0x12e),_0x3446fe),_0x1fe4de=await this[_0x2b6188(0x124)]['request'](_0x2b6188(0xb3),_0x464fed);return parseActivationSankeyResponse(_0x1fe4de);}async[a120_0x1bc691(0xfb)](_0x4de95d){const _0x243854=a120_0x1bc691,_0x542d7d=_0x243854(0xab)+_0x4de95d+'/pause',_0x125631=await this[_0x243854(0x124)]['request']('PATCH',_0x542d7d);return'data'in _0x125631?_0x125631[_0x243854(0xbc)]:_0x125631;}async[a120_0x1bc691(0x10a)](_0x28f59d){const _0xac3e43=a120_0x1bc691,_0x140dab='/entities/journeys/'+_0x28f59d+_0xac3e43(0xc5),_0x2aafc8=await this[_0xac3e43(0x124)][_0xac3e43(0x146)](_0xac3e43(0x13a),_0x140dab);return _0xac3e43(0xbc)in _0x2aafc8?_0x2aafc8[_0xac3e43(0xbc)]:_0x2aafc8;}async[a120_0x1bc691(0xed)](_0x3efcf1){const _0x3aa2d1=a120_0x1bc691,_0x987b92=_0x3aa2d1(0xab)+_0x3efcf1+'/run',_0x24479f=await this[_0x3aa2d1(0x124)][_0x3aa2d1(0x146)](_0x3aa2d1(0x132),_0x987b92);return{'id':_0x24479f[_0x3aa2d1(0xbc)]['id'],..._0x24479f[_0x3aa2d1(0xbc)][_0x3aa2d1(0xe1)]};}async[a120_0x1bc691(0x118)](_0xbc3785,_0x5c6b3c){const _0xe1607a=a120_0x1bc691,_0x540933=_0xe1607a(0xab)+_0xbc3785+_0xe1607a(0xac)+_0x5c6b3c,_0x3393c4=await this['httpClient'][_0xe1607a(0x146)](_0xe1607a(0xb3),_0x540933);return _0xe1607a(0xbc)in _0x3393c4?_0x3393c4[_0xe1607a(0xbc)]:_0x3393c4;}async[a120_0x1bc691(0xd6)](_0x2f6aa0){const _0x2205e3=a120_0x1bc691,_0x89b5bd=_0x2205e3(0xab)+_0x2f6aa0+'/activations',_0x4d6163=await this[_0x2205e3(0x124)][_0x2205e3(0x146)](_0x2205e3(0xb3),_0x89b5bd);return _0x2205e3(0xbc)in _0x4d6163?_0x4d6163[_0x2205e3(0xbc)]:_0x4d6163;}async[a120_0x1bc691(0xf1)](_0x46213c,_0x1364f6){const _0x187b52=a120_0x1bc691,_0x2cee1f=_0x187b52(0xab)+_0x46213c+_0x187b52(0xdb),_0x48431d={'name':_0x1364f6[_0x187b52(0x143)],'scheduleType':_0x1364f6['scheduleType']||_0x187b52(0xef),'connectionId':String(_0x1364f6[_0x187b52(0xbb)]),'columns':_0x1364f6[_0x187b52(0xba)]??[],'notifyOn':_0x1364f6[_0x187b52(0x110)]??[],'connectorConfig':_0x1364f6[_0x187b52(0x116)]??{},..._0x1364f6[_0x187b52(0xd5)]!==undefined&&{'description':_0x1364f6['description']},..._0x1364f6[_0x187b52(0x117)]!==undefined&&{'allColumns':_0x1364f6[_0x187b52(0x117)]},..._0x1364f6[_0x187b52(0xfd)]!==undefined&&{'timezone':_0x1364f6['timezone']},..._0x1364f6[_0x187b52(0x108)]!==undefined&&{'emailRecipients':_0x1364f6[_0x187b52(0x108)]},..._0x1364f6[_0x187b52(0xcf)]!==undefined&&{'activationTemplateId':_0x1364f6[_0x187b52(0xcf)]},..._0x1364f6[_0x187b52(0xc2)]!==undefined&&{'syndicationBehavior':_0x1364f6[_0x187b52(0xc2)]},..._0x1364f6[_0x187b52(0xb9)]!==undefined&&{'syndicationBehaviors':_0x1364f6[_0x187b52(0xb9)]}},_0x194a27=await this[_0x187b52(0x124)][_0x187b52(0x146)](_0x187b52(0x132),_0x2cee1f,{'body':{'type':_0x187b52(0xb0),'attributes':{'runAfterJourneyRefresh':_0x1364f6[_0x187b52(0x109)]??![],'activationParams':_0x48431d}},'headers':{'Content-Type':'application/vnd.treasuredata.v1+json'}});return _0x187b52(0xbc)in _0x194a27?_0x194a27['data']:_0x194a27;}async[a120_0x1bc691(0xfc)](_0x81343){const _0x1b6c0b=a120_0x1bc691,_0x4a5ec0=_0x1b6c0b(0xe8)+_0x81343+_0x1b6c0b(0xaf),_0x3456e5=await this[_0x1b6c0b(0x124)]['request'](_0x1b6c0b(0x13a),_0x4a5ec0),_0x17f9f6=_0x3456e5[_0x1b6c0b(0xbc)];return{'id':_0x17f9f6['id'],'name':_0x17f9f6[_0x1b6c0b(0xe1)][_0x1b6c0b(0x143)],'description':_0x17f9f6[_0x1b6c0b(0xe1)][_0x1b6c0b(0xd5)],'audienceId':_0x17f9f6[_0x1b6c0b(0xe1)][_0x1b6c0b(0xc4)],'state':_0x17f9f6[_0x1b6c0b(0xe1)][_0x1b6c0b(0x113)],'paused':_0x17f9f6[_0x1b6c0b(0xe1)][_0x1b6c0b(0x13e)],'stageCount':_0x17f9f6[_0x1b6c0b(0xe1)][_0x1b6c0b(0xe3)]?.[_0x1b6c0b(0xda)]||0x0,'createdAt':_0x17f9f6['attributes'][_0x1b6c0b(0xd4)],'updatedAt':_0x17f9f6[_0x1b6c0b(0xe1)][_0x1b6c0b(0xe5)],'launchedAt':_0x17f9f6['attributes']['launchedAt']};}async[a120_0x1bc691(0x12f)](_0x52c10d){const _0x4cceae=a120_0x1bc691,_0x397b48=_0x4cceae(0xe8)+_0x52c10d+'/resume',_0x4cb761=await this[_0x4cceae(0x124)][_0x4cceae(0x146)](_0x4cceae(0x13a),_0x397b48),_0x5e9570=_0x4cb761[_0x4cceae(0xbc)];return{'id':_0x5e9570['id'],'name':_0x5e9570[_0x4cceae(0xe1)][_0x4cceae(0x143)],'description':_0x5e9570[_0x4cceae(0xe1)][_0x4cceae(0xd5)],'audienceId':_0x5e9570['attributes'][_0x4cceae(0xc4)],'state':_0x5e9570[_0x4cceae(0xe1)]['state'],'paused':_0x5e9570[_0x4cceae(0xe1)][_0x4cceae(0x13e)],'stageCount':_0x5e9570[_0x4cceae(0xe1)][_0x4cceae(0xe3)]?.[_0x4cceae(0xda)]||0x0,'createdAt':_0x5e9570[_0x4cceae(0xe1)][_0x4cceae(0xd4)],'updatedAt':_0x5e9570['attributes'][_0x4cceae(0xe5)],'launchedAt':_0x5e9570[_0x4cceae(0xe1)][_0x4cceae(0x133)]};}async[a120_0x1bc691(0xd7)](_0x4f7009){const _0x4b79f7=a120_0x1bc691,_0x5c9e0c=_0x4b79f7(0x12b)+_0x4f7009+'/realtime_journeys',_0x2bd9b4=await this[_0x4b79f7(0x124)][_0x4b79f7(0x146)]('GET',_0x5c9e0c);return _0x2bd9b4[_0x4b79f7(0xbc)][_0x4b79f7(0x145)](_0x174e22=>({'id':_0x174e22['id'],'name':_0x174e22[_0x4b79f7(0xe1)][_0x4b79f7(0x143)],'description':_0x174e22[_0x4b79f7(0xe1)][_0x4b79f7(0xd5)],'audienceId':_0x174e22[_0x4b79f7(0xe1)][_0x4b79f7(0xc4)],'state':_0x174e22[_0x4b79f7(0xe1)][_0x4b79f7(0x113)],'paused':_0x174e22['attributes'][_0x4b79f7(0x13e)],'stageCount':_0x174e22[_0x4b79f7(0xe1)][_0x4b79f7(0xe3)]?.['length']||0x0,'createdAt':_0x174e22[_0x4b79f7(0xe1)][_0x4b79f7(0xd4)],'updatedAt':_0x174e22[_0x4b79f7(0xe1)][_0x4b79f7(0xe5)],'launchedAt':_0x174e22[_0x4b79f7(0xe1)]['launchedAt']}));}async['getCurrentRealtimeConfigVersion'](_0x40534e){const _0x1e0961=a120_0x1bc691,_0x1690b3=_0x1e0961(0x13c)+_0x40534e+_0x1e0961(0x14d);return await this[_0x1e0961(0x124)][_0x1e0961(0x146)]('GET',_0x1690b3);}}export function buildJourneyEndpoint(_0x4579ca,_0x4e0f04,_0x505280){const _0x59eb04=a120_0x1bc691,_0x3e16a1=_0x59eb04(0xab)+_0x4579ca+'/'+_0x4e0f04,_0x2408cc=new URLSearchParams();if(_0x505280?.[_0x59eb04(0xff)])_0x2408cc[_0x59eb04(0xec)](_0x59eb04(0xff),_0x505280[_0x59eb04(0xff)]);if(_0x505280?.['to'])_0x2408cc[_0x59eb04(0xec)]('to',_0x505280['to']);if(_0x505280?.[_0x59eb04(0xf4)]!=null)_0x2408cc[_0x59eb04(0xec)](_0x59eb04(0xf4),String(_0x505280[_0x59eb04(0xf4)]));const _0x1ebb94=_0x2408cc[_0x59eb04(0x10f)]();return _0x1ebb94?_0x3e16a1+'?'+_0x1ebb94:_0x3e16a1;}export function parseJourneyStatisticsResponse(_0x3fbfa6){const _0x93e5b3=a120_0x1bc691;if(!(_0x93e5b3(0xbc)in _0x3fbfa6))return _0x3fbfa6;const _0xf2084=_0x3fbfa6[_0x93e5b3(0xbc)];if(!('attributes'in _0xf2084)||!_0xf2084[_0x93e5b3(0xe1)]||typeof _0xf2084[_0x93e5b3(0xe1)]!==_0x93e5b3(0xd8))return _0xf2084;const _0x1a9b6d=_0xf2084['attributes'],_0x2572fa={'journeyId':_0x1a9b6d[_0x93e5b3(0xf9)],'size':_0x1a9b6d[_0x93e5b3(0xdd)],'goalSize':_0x1a9b6d[_0x93e5b3(0xf8)],'enteredSize':_0x1a9b6d[_0x93e5b3(0xcd)],'completionRate':_0x1a9b6d[_0x93e5b3(0x119)],'exitOrJumpSize':_0x1a9b6d[_0x93e5b3(0x121)],'exitOrJumpRate':_0x1a9b6d[_0x93e5b3(0x140)],'stages':(_0x1a9b6d[_0x93e5b3(0x148)]??[])[_0x93e5b3(0x145)](_0x16f0f5=>{const _0x2f501d=_0x93e5b3,_0x3d7aea={'id':_0x16f0f5['id'],'enteredSize':_0x16f0f5[_0x2f501d(0xcd)],'milestoneSize':_0x16f0f5['milestoneSize'],'completeMilestoneRate':_0x16f0f5[_0x2f501d(0xdf)],'exitOrJumpSize':_0x16f0f5[_0x2f501d(0x121)],'exitOrJumpRate':_0x16f0f5[_0x2f501d(0x140)],'size':_0x16f0f5[_0x2f501d(0xdd)]};if(_0x16f0f5[_0x2f501d(0x138)])_0x3d7aea[_0x2f501d(0x138)]=_0x16f0f5['history'];if(_0x16f0f5[_0x2f501d(0x141)])_0x3d7aea[_0x2f501d(0x141)]=_0x16f0f5[_0x2f501d(0x141)];if(_0x16f0f5[_0x2f501d(0xd3)])_0x3d7aea[_0x2f501d(0xd3)]=_0x16f0f5['stepInfluxes'];if(_0x16f0f5['exitSizes'])_0x3d7aea[_0x2f501d(0xc6)]=_0x16f0f5[_0x2f501d(0xc6)];return _0x3d7aea;})};return Array[_0x93e5b3(0xcb)](_0x1a9b6d['history'])&&(_0x2572fa[_0x93e5b3(0x138)]=_0x1a9b6d[_0x93e5b3(0x138)]),_0x2572fa;}function extractSankeyChart(_0x49a5e4){const _0x29405a=a120_0x1bc691,_0x4e1f99=Array['isArray'](_0x49a5e4[_0x29405a(0xbc)])?_0x49a5e4[_0x29405a(0xbc)]:[],_0x11cf04=_0x49a5e4['metaData']&&typeof _0x49a5e4[_0x29405a(0xe7)]==='object'?_0x49a5e4['metaData']:{},_0x199ffd=Array['isArray'](_0x11cf04[_0x29405a(0x106)])?_0x11cf04['links']:[];return{'nodes':_0x4e1f99,'links':_0x199ffd};}function extractJsonApiAttributes(_0x256afc){const _0x2f351e=a120_0x1bc691;if(!_0x256afc||typeof _0x256afc!==_0x2f351e(0xd8))return[];const _0x3df992=_0x256afc;if(!Array[_0x2f351e(0xcb)](_0x3df992[_0x2f351e(0xbc)]))return[];return _0x3df992[_0x2f351e(0xbc)][_0x2f351e(0x129)](_0x6e47ef=>!!_0x6e47ef&&typeof _0x6e47ef===_0x2f351e(0xd8))['map'](_0xb9c96c=>_0xb9c96c['attributes'])[_0x2f351e(0x129)](_0x390e6c=>!!_0x390e6c&&typeof _0x390e6c===_0x2f351e(0xd8));}function a120_0x408a(){const _0x139739=['getJourneyBundle','size','/entities/folders','completeMilestoneRate','apiKey','attributes','getJourney','realtimeJourneyStages','createJourney','updatedAt','138zhTHxL','metaData','/entities/realtime_journeys/','/entities/journey_bundles/','runParentSegment','55495JEyHAr','set','runJourney','5348VAKOvh','none','createSegmentFolder','createJourneyActivation','/syndications/','9879830MVKZnz','limit','/entities/journeys','included','/attributes','goalSize','journeyId','createJourneyVersion','pauseJourney','pauseRealtimeJourney','timezone','?depth=','from','relationships','authHeaders','createParentSegment','listJourneys','segment-journey','PUT','links','updateJourney','emailRecipients','runAfterJourneyRefresh','resumeJourney','proxy','getSegmentSQLFromRule','sql','/run','toString','notifyOn','listParentSegments','getParentSegment','state','getSegmentEntity','updateActivation','connectorConfig','allColumns','getJourneyActivation','completionRate','rule','string','/entities/segments/','listActivations','latestJourneyId','listEntitiesByFolder','getConversionSankeyChart','exitOrJumpSize','folder-segment','segment-batch','httpClient','journeyStageId','Invalid\x20journey\x20bundle\x20response','statistics','DELETE','filter','/entities/journeys?folder_id=','/entities/parent_segments/','journeyBundleName','1646586IIHEWq','activation_sankey_charts','resumeRealtimeJourney','timeout','2LDLyPQ','POST','launchedAt','journeyBundleId','conversion_sankey_charts','accessToken','query','history','getParentSegmentSQL','PATCH','166887GbWBZX','/audiences/','getAudienceBehaviors','paused','getActivation','exitOrJumpRate','stepSizes','getJourneyStatistics','name','countPopulation','map','request','624PdSGNx','journeyStageStatistics','updateJourneyDetail','type','/segments','getAudienceAttributes','/realtime_configuration_versions/current','/entities/journeys/','/activations/','11EnoYRE','application/vnd.treasuredata.v1+json','/pause','journeyActivationStep','/syndications','/folders','GET','lastVersionNumber','deleteActivation','listJourneysWithDetails','requestSegmentSQL','parentFolder','syndicationBehaviors','columns','connectionId','data','chart','getSegment','updateSegment','listSegments','/segments/query','syndicationBehavior','120948icTcEd','audienceId','/resume','exitSizes','parentFolderId','/segments/','deleteSegment','journeys','isArray','/entities/parent_segments','enteredSize','site','activationTemplateId','/entities/segments','getParentSegmentFull','application/json','stepInfluxes','createdAt','description','listJourneyActivations','listRealtimeJourneys','object','371615JJKSzr','length','/activations'];a120_0x408a=function(){return _0x139739;};return a120_0x408a();}export function parseConversionSankeyResponse(_0x30859f){const _0x5b89cd=a120_0x1bc691,_0x12d54d={'nodes':[],'links':[]},_0x17a2e9=extractJsonApiAttributes(_0x30859f);if(_0x17a2e9[_0x5b89cd(0xda)]===0x0)return _0x12d54d;const _0x5e8fbe=_0x17a2e9[0x0],_0x4670d7=_0x5e8fbe['chart'];if(_0x4670d7&&typeof _0x4670d7===_0x5b89cd(0xd8)){const {nodes:_0x42ae24,links:_0x1accb2}=extractSankeyChart(_0x4670d7);return{'nodes':_0x42ae24,'links':_0x1accb2,...typeof _0x5e8fbe[_0x5b89cd(0xe5)]===_0x5b89cd(0x11b)?{'updatedAt':_0x5e8fbe['updatedAt']}:{}};}return _0x12d54d;}export function parseActivationSankeyResponse(_0x41d586){const _0x19f536=a120_0x1bc691,_0x43191b=extractJsonApiAttributes(_0x41d586);if(_0x43191b[_0x19f536(0xda)]>0x0)return _0x43191b['map'](_0x5cfc2c=>{const _0x3abbbc=_0x19f536,_0x316ede=_0x5cfc2c[_0x3abbbc(0xbd)],{nodes:_0x136b31,links:_0x458dc3}=_0x316ede&&typeof _0x316ede===_0x3abbbc(0xd8)?extractSankeyChart(_0x316ede):{'nodes':[],'links':[]};return{'journeyStageId':typeof _0x5cfc2c['journeyStageId']===_0x3abbbc(0x11b)?_0x5cfc2c[_0x3abbbc(0x125)]:'','nodes':_0x136b31,'links':_0x458dc3,...typeof _0x5cfc2c['updatedAt']==='string'?{'updatedAt':_0x5cfc2c['updatedAt']}:{}};});if(Array[_0x19f536(0xcb)](_0x41d586))return _0x41d586;return[];}export function parseJourneyBundleResponse(_0x490f9c){const _0x1fd79b=a120_0x1bc691;if(!_0x490f9c||typeof _0x490f9c!==_0x1fd79b(0xd8))throw new Error(_0x1fd79b(0x126));const _0x4fb286=_0x490f9c,_0x476b28=_0x4fb286['data'],_0x3fc853=_0x476b28?.[_0x1fd79b(0xe1)]??_0x4fb286,_0x4d5bf8=Array[_0x1fd79b(0xcb)](_0x3fc853['journeys'])?_0x3fc853[_0x1fd79b(0xca)]:[],_0x14d943=_0x4d5bf8[_0x1fd79b(0x145)](_0x5f4de2=>{const _0x3a10a3=_0x1fd79b;if(!_0x5f4de2||typeof _0x5f4de2!==_0x3a10a3(0xd8))return _0x5f4de2;const _0x29273b=_0x5f4de2;if(_0x29273b[_0x3a10a3(0xbc)]&&typeof _0x29273b[_0x3a10a3(0xbc)]==='object')return _0x29273b[_0x3a10a3(0xbc)];return _0x29273b;});return{'name':_0x3fc853['name'],'description':_0x3fc853[_0x1fd79b(0xd5)]??null,'latestJourneyId':_0x3fc853[_0x1fd79b(0x11e)],'lastVersionNumber':_0x3fc853[_0x1fd79b(0xb4)],'journeys':_0x14d943};}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a121_0x1a92f8=a121_0x53df;(function(_0x26bb52,_0x556d49){const _0x1e7ee1=a121_0x53df,_0x1c5204=_0x26bb52();while(!![]){try{const _0x4008de=parseInt(_0x1e7ee1(0x1b8))/0x1*(-parseInt(_0x1e7ee1(0x1b1))/0x2)+parseInt(_0x1e7ee1(0x1be))/0x3+-parseInt(_0x1e7ee1(0x1bf))/0x4+parseInt(_0x1e7ee1(0x1c6))/0x5+-parseInt(_0x1e7ee1(0x1c4))/0x6*(-parseInt(_0x1e7ee1(0x1c9))/0x7)+-parseInt(_0x1e7ee1(0x1ba))/0x8+parseInt(_0x1e7ee1(0x1bc))/0x9;if(_0x4008de===_0x556d49)break;else _0x1c5204['push'](_0x1c5204['shift']());}catch(_0x11282a){_0x1c5204['push'](_0x1c5204['shift']());}}}(a121_0x3e0a,0xc4cd6));import{HTTPClient}from'./http-client.js';import{getDeliveryEndpoint}from'./endpoints.js';function a121_0x3e0a(){const _0xfd9c6b=['/api/email_domains?','request','/api/email_senders?','6iYwbxr','toString','5542270OxRYfF','timeout','accessToken','3950149rbpTZc','workspaceId','limit','proxy','httpClient','append','768734xNHfVw','page[offset]','site','/api/email_domains','page[limit]','/api/email_senders','listEmailSenders','2wrbAze','filter[workspaceId]','2808376IRwdtx','offset','918207nYoWSI','application/vnd.api+json','3110199QvBpLC','3542536pFljkU','GET'];a121_0x3e0a=function(){return _0xfd9c6b;};return a121_0x3e0a();}function a121_0x53df(_0x46e458,_0x3769b8){_0x46e458=_0x46e458-0x1b1;const _0x3e0a40=a121_0x3e0a();let _0x53df7d=_0x3e0a40[_0x46e458];return _0x53df7d;}import{getAuthHeaders,toHeaderRecord}from'../../core/auth.js';export class DeliveryApiClient{[a121_0x1a92f8(0x1cd)];constructor(_0xc84ae1){const _0x1be51f=a121_0x1a92f8,_0x2b5965=getDeliveryEndpoint(_0xc84ae1[_0x1be51f(0x1b3)]),_0x1f3383=toHeaderRecord(getAuthHeaders(_0xc84ae1[_0x1be51f(0x1b3)],_0xc84ae1['apiKey'],_0xc84ae1[_0x1be51f(0x1c8)]));this[_0x1be51f(0x1cd)]=new HTTPClient(_0x2b5965,_0x1f3383,{'proxy':_0xc84ae1[_0x1be51f(0x1cc)],'defaultTimeout':_0xc84ae1[_0x1be51f(0x1c7)]});}async[a121_0x1a92f8(0x1b7)](_0x154f70={}){const _0x63feb4=a121_0x1a92f8,_0x501017=new URLSearchParams();_0x154f70[_0x63feb4(0x1ca)]&&_0x501017['append'](_0x63feb4(0x1b9),_0x154f70[_0x63feb4(0x1ca)]);_0x154f70[_0x63feb4(0x1cb)]!==undefined&&_0x501017['append'](_0x63feb4(0x1b5),_0x154f70[_0x63feb4(0x1cb)][_0x63feb4(0x1c5)]());_0x154f70[_0x63feb4(0x1bb)]!==undefined&&_0x501017[_0x63feb4(0x1ce)](_0x63feb4(0x1b2),_0x154f70['offset'][_0x63feb4(0x1c5)]());const _0x1fe139=_0x501017[_0x63feb4(0x1c5)](),_0x16158c=_0x1fe139?_0x63feb4(0x1c3)+_0x1fe139:_0x63feb4(0x1b6);return await this['httpClient'][_0x63feb4(0x1c2)](_0x63feb4(0x1c0),_0x16158c,{'headers':{'Accept':_0x63feb4(0x1bd)}});}async['listEmailDomains'](_0xb78388={}){const _0x1705f5=a121_0x1a92f8,_0xdd8315=new URLSearchParams();if(_0xb78388[_0x1705f5(0x1cb)]!==undefined)_0xdd8315['append'](_0x1705f5(0x1b5),_0xb78388[_0x1705f5(0x1cb)][_0x1705f5(0x1c5)]());if(_0xb78388['offset']!==undefined)_0xdd8315[_0x1705f5(0x1ce)](_0x1705f5(0x1b2),_0xb78388[_0x1705f5(0x1bb)][_0x1705f5(0x1c5)]());const _0x4f6890=_0xdd8315[_0x1705f5(0x1c5)](),_0x60c896=_0x4f6890?_0x1705f5(0x1c1)+_0x4f6890:_0x1705f5(0x1b4);return await this['httpClient']['request']('GET',_0x60c896,{'headers':{'Accept':'application/vnd.api+json'}});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const a122_0x195eb5=a122_0x3633;(function(_0x4b7183,_0x4f5c6c){const _0x224ae6=a122_0x3633,_0xec28e5=_0x4b7183();while(!![]){try{const _0x1128cc=parseInt(_0x224ae6(0x1d0))/0x1+-parseInt(_0x224ae6(0x16c))/0x2+parseInt(_0x224ae6(0x15a))/0x3+parseInt(_0x224ae6(0x17b))/0x4*(-parseInt(_0x224ae6(0x16e))/0x5)+-parseInt(_0x224ae6(0x1b0))/0x6*(-parseInt(_0x224ae6(0x171))/0x7)+parseInt(_0x224ae6(0x167))/0x8*(parseInt(_0x224ae6(0x192))/0x9)+-parseInt(_0x224ae6(0x15d))/0xa*(parseInt(_0x224ae6(0x1c8))/0xb);if(_0x1128cc===_0x4f5c6c)break;else _0xec28e5['push'](_0xec28e5['shift']());}catch(_0x2929df){_0xec28e5['push'](_0xec28e5['shift']());}}}(a122_0x3de5,0xee7d6));export const TD_ENDPOINTS={'us01':a122_0x195eb5(0x1a1),'ap01':a122_0x195eb5(0x181),'eu01':a122_0x195eb5(0x198),'ap02':a122_0x195eb5(0x169),'ap03':'https://api.ap03.treasuredata.com','dev-us01':a122_0x195eb5(0x16d),'dev-eu01':a122_0x195eb5(0x17c),'stg-us01':a122_0x195eb5(0x1d2),'stg-ap01':a122_0x195eb5(0x18f),'stg-ap03':a122_0x195eb5(0x1af)};export const CDP_ENDPOINTS={'us01':a122_0x195eb5(0x182),'ap01':a122_0x195eb5(0x1c6),'eu01':a122_0x195eb5(0x15e),'ap02':a122_0x195eb5(0x159),'ap03':a122_0x195eb5(0x1a9),'dev-us01':a122_0x195eb5(0x1a8),'dev-eu01':a122_0x195eb5(0x1bb),'stg-us01':a122_0x195eb5(0x195),'stg-ap01':'https://api-staging-cdp.treasuredata.co.jp','stg-ap03':a122_0x195eb5(0x166)};export const WORKFLOW_ENDPOINTS={'us01':a122_0x195eb5(0x196),'ap01':a122_0x195eb5(0x186),'eu01':a122_0x195eb5(0x178),'ap02':a122_0x195eb5(0x19f),'ap03':a122_0x195eb5(0x1b5),'dev-us01':a122_0x195eb5(0x1a0),'dev-eu01':a122_0x195eb5(0x1ca),'stg-us01':a122_0x195eb5(0x15b),'stg-ap01':'https://api-staging-workflow.treasuredata.co.jp','stg-ap03':'https://api-staging-workflow.ap03.treasuredata.com'};export const TRINO_ENDPOINTS={'us01':a122_0x195eb5(0x1b3),'ap01':a122_0x195eb5(0x19c),'eu01':a122_0x195eb5(0x19b),'ap02':a122_0x195eb5(0x1c7),'ap03':a122_0x195eb5(0x1bd),'dev-us01':a122_0x195eb5(0x1a3),'dev-eu01':a122_0x195eb5(0x1d8),'stg-us01':a122_0x195eb5(0x1b8),'stg-ap01':a122_0x195eb5(0x1ab),'stg-ap03':'https://api-staging-presto.ap03.treasuredata.com'};function a122_0x3de5(){const _0x71393=['https://api.eu01.treasuredata.com','https://console-next.','.treasuredata.com','https://api-presto.eu01.treasuredata.com','https://api-presto.treasuredata.co.jp','https://delivery-api-staging.ap03.treasuredata.com','https://console.eu01.treasuredata.com','https://api-workflow.ap02.treasuredata.com','https://api-development-workflow.us01.treasuredata.com','https://api.treasuredata.com','No\x20legacy\x20CAS\x20endpoint\x20defined\x20for\x20site\x20\x27','https://api-development-presto.treasuredata.com','https://engage-api-development.us01.treasuredata.com','https://delivery-api-staging.treasuredata.co.jp','/ibm/','https://personalization-studio-config-staging.treasuredata.co.jp','https://api-development-cdp.us01.treasuredata.com','https://api-cdp.ap03.treasuredata.com','https://llm-proxy-staging.us01.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://delivery-api.ap03.treasuredata.com','/app/es/','https://personalization-studio-config.us01.treasuredata.com','https://api-staging.ap03.treasuredata.com','709974oCyAep','cas','https://llm-api.treasuredata.com','https://api-presto.treasuredata.com','https://llm-api.eu01.treasuredata.com','https://api-workflow.ap03.treasuredata.com','https://llm-proxy.ap03.treasuredata.com','https://llm-proxy.us01.treasuredata.com','https://api-staging-presto.treasuredata.com','https://engage-api.ap03.treasuredata.com','https://console-development.us01.treasuredata.com','https://api-development-cdp.eu01.treasuredata.com','https://engage-api-development.eu01.treasuredata.com','https://api-presto.ap03.treasuredata.com','No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20','https://llm-proxy-staging.ap03.treasuredata.com','https://llm-proxy.treasuredata.co.jp','https://llm-proxy-staging.treasuredata.co.jp','https://delivery-api.ap02.treasuredata.com','https://engage-api-staging.treasuredata.co.jp','https://engage-api-staging.ap03.treasuredata.com','/ag/','https://api-cdp.treasuredata.co.jp','https://api-presto.ap02.treasuredata.com','33InvyAy','https://engage-api.treasuredata.com','https://api-development-workflow.eu01.treasuredata.com','https://api-staging-cas.ap03.treasuredata.com','/app/af/','https://delivery-api-staging.us01.treasuredata.com','/info','https://llm-api.treasuredata.co.jp','1638725wRNqWI','https://console.ap03.treasuredata.com','https://api-staging.treasuredata.com','https://console.treasuredata.co.jp','https://personalization-studio-config-staging.ap03.treasuredata.com','https://engage-api-staging.us01.treasuredata.com','https://personalization-studio-config.treasuredata.co.jp','https://console-staging.ap03.treasuredata.com','https://api-development-presto.eu01.treasuredata.com','https://console-staging.us01.treasuredata.com','https://api-cdp.ap02.treasuredata.com','1462860bYYCWZ','https://api-staging-workflow.us01.treasuredata.com','https://personalization-studio-config-development.us01.treasuredata.com','3948080pRSBAQ','https://api-cdp.eu01.treasuredata.com','https://llm-api-development.us01.treasuredata.com','https://api-cas.eu01.treasuredata.com','https://console-next.ap02.treasuredata.com','https://console-next.eu01.treasuredata.com','/ag','https://engage-api.treasuredata.co.jp','https://llm-api-staging.ap03.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','24TPiGzF','/tc/','https://api.ap02.treasuredata.com','/result','https://personalization-studio-config-development.eu01.treasuredata.com','2684534pFlVKE','https://api-development.treasuredata.com','3760iYPVsO','https://delivery-api-development.us01.treasuredata.com','/sessions/','21gWlCBW','https://delivery-api-development.eu01.treasuredata.com','No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20','https://llm-api-staging.treasuredata.co.jp','https://llm-proxy.ap02.treasuredata.com','/app/workflows/','https://console.','https://api-workflow.eu01.treasuredata.com','https://console-development-next.eu01.treasuredata.com','https://llm-proxy.eu01.treasuredata.com','3008dsigMU','https://api-development.eu01.treasuredata.com','https://console-staging-next.ap03.treasuredata.com','https://engage-api.ap02.treasuredata.com','https://console-development.eu01.treasuredata.com','https://personalization-studio-config.eu01.treasuredata.com','https://api.treasuredata.co.jp','https://api-cdp.treasuredata.com','/em/','https://console-staging-next.treasuredata.co.jp','https://llm-proxy-development.us01.treasuredata.com','https://api-workflow.treasuredata.co.jp','https://console-staging.treasuredata.co.jp','/ooc/','No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27','https://console-staging-next.us01.treasuredata.com','/ce','https://console-development-next.us01.treasuredata.com','https://api-development-cas.eu01.treasuredata.com','/attempt/','https://api-staging.treasuredata.co.jp','https://console-next.ap03.treasuredata.com','https://api-cas.treasuredata.com','4763151knDjrm','https://api-development-cas.us01.treasuredata.com','https://console.ap02.treasuredata.com','https://api-staging-cdp.us01.treasuredata.com','https://api-workflow.treasuredata.com','https://llm-proxy-development.eu01.treasuredata.com'];a122_0x3de5=function(){return _0x71393;};return a122_0x3de5();}export const LLM_ENDPOINTS={'us01':a122_0x195eb5(0x1b2),'ap01':a122_0x195eb5(0x1cf),'eu01':a122_0x195eb5(0x1b4),'ap02':'https://llm-api.ap02.treasuredata.com','ap03':'https://llm-api.ap03.treasuredata.com','dev-us01':a122_0x195eb5(0x15f),'dev-eu01':'https://llm-api-development.eu01.treasuredata.com','stg-us01':'https://llm-api-staging.us01.treasuredata.com','stg-ap01':a122_0x195eb5(0x174),'stg-ap03':a122_0x195eb5(0x165)};export const LLM_PROXY_ENDPOINTS={'us01':a122_0x195eb5(0x1b7),'ap01':a122_0x195eb5(0x1c0),'eu01':a122_0x195eb5(0x17a),'ap02':a122_0x195eb5(0x175),'ap03':a122_0x195eb5(0x1b6),'dev-us01':a122_0x195eb5(0x185),'dev-eu01':a122_0x195eb5(0x197),'stg-us01':a122_0x195eb5(0x1aa),'stg-ap01':a122_0x195eb5(0x1c1),'stg-ap03':a122_0x195eb5(0x1bf)};export const ENGAGE_ENDPOINTS={'us01':a122_0x195eb5(0x1c9),'ap01':a122_0x195eb5(0x164),'eu01':'https://engage-api.eu01.treasuredata.com','ap02':a122_0x195eb5(0x17e),'ap03':a122_0x195eb5(0x1b9),'dev-us01':a122_0x195eb5(0x1a4),'dev-eu01':a122_0x195eb5(0x1bc),'stg-us01':a122_0x195eb5(0x1d5),'stg-ap01':a122_0x195eb5(0x1c3),'stg-ap03':a122_0x195eb5(0x1c4)};export const P13N_STUDIO_ENDPOINTS={'us01':a122_0x195eb5(0x1ae),'ap01':a122_0x195eb5(0x1d6),'eu01':a122_0x195eb5(0x180),'dev-us01':a122_0x195eb5(0x15c),'dev-eu01':a122_0x195eb5(0x16b),'stg-us01':'https://personalization-studio-config-staging.us01.treasuredata.com','stg-ap01':a122_0x195eb5(0x1a7),'stg-ap03':a122_0x195eb5(0x1d4)};export const DELIVERY_ENDPOINTS={'us01':'https://delivery-api.us01.treasuredata.com','ap01':'https://delivery-api.treasuredata.co.jp','eu01':'https://delivery-api.eu01.treasuredata.com','ap02':a122_0x195eb5(0x1c2),'ap03':a122_0x195eb5(0x1ac),'dev-us01':a122_0x195eb5(0x16f),'dev-eu01':a122_0x195eb5(0x172),'stg-us01':a122_0x195eb5(0x1cd),'stg-ap01':a122_0x195eb5(0x1a5),'stg-ap03':a122_0x195eb5(0x19d)};export function getDeliveryEndpoint(_0x45759f){const _0x44fa6d=a122_0x195eb5,_0x17d52b=DELIVERY_ENDPOINTS[_0x45759f];if(!_0x17d52b)throw new Error(_0x44fa6d(0x1be)+_0x45759f);return _0x17d52b;}export const CAS_ENDPOINTS={'us01':a122_0x195eb5(0x191),'ap01':'https://api-cas.treasuredata.co.jp','eu01':a122_0x195eb5(0x160),'ap02':'https://api-cas.ap02.treasuredata.com','ap03':'https://api-cas.ap03.treasuredata.com','dev-us01':a122_0x195eb5(0x193),'dev-eu01':a122_0x195eb5(0x18d),'stg-us01':'https://api-staging-cas.us01.treasuredata.com','stg-ap01':'https://api-staging-cas.treasuredata.co.jp','stg-ap03':a122_0x195eb5(0x1cb)};export const CONSOLE_ENDPOINTS={'us01':'https://console.us01.treasuredata.com','ap01':a122_0x195eb5(0x1d3),'eu01':a122_0x195eb5(0x19e),'ap02':a122_0x195eb5(0x194),'ap03':a122_0x195eb5(0x1d1),'dev-us01':a122_0x195eb5(0x1ba),'dev-eu01':a122_0x195eb5(0x17f),'stg-us01':a122_0x195eb5(0x1d9),'stg-ap01':a122_0x195eb5(0x187),'stg-ap03':a122_0x195eb5(0x1d7)};export const CONSOLE_NEXT_ENDPOINTS={'us01':'https://console-next.us01.treasuredata.com','ap01':'https://console-next.treasuredata.co.jp','eu01':a122_0x195eb5(0x162),'ap02':a122_0x195eb5(0x161),'ap03':a122_0x195eb5(0x190),'dev-us01':a122_0x195eb5(0x18c),'dev-eu01':a122_0x195eb5(0x179),'stg-us01':a122_0x195eb5(0x18a),'stg-ap01':a122_0x195eb5(0x184),'stg-ap03':a122_0x195eb5(0x17d)};export function getConsoleUrl(_0x56ab36,_0x4c96a3){const _0x7e3511=a122_0x195eb5,_0x2e0999=CONSOLE_ENDPOINTS[_0x56ab36]||_0x7e3511(0x177)+_0x56ab36+'.treasuredata.com';return _0x4c96a3?''+_0x2e0999+_0x4c96a3:_0x2e0999;}export function getConsoleNextUrl(_0x26c46f,_0x43b794){const _0x83f246=a122_0x195eb5,_0x5d4e07=CONSOLE_NEXT_ENDPOINTS[_0x26c46f]||_0x83f246(0x199)+_0x26c46f+_0x83f246(0x19a);return _0x43b794?''+_0x5d4e07+_0x43b794:_0x5d4e07;}export function getLLMProjectUrl(_0x11663e,_0xc574bd){const _0x12dc1c=a122_0x195eb5;return getConsoleNextUrl(_0x11663e,_0x12dc1c(0x1cc)+_0xc574bd+_0x12dc1c(0x163));}export function getLLMAgentChatUrl(_0x352352,_0x4a9774,_0xf0de63){const _0x44c87b=a122_0x195eb5;return getConsoleNextUrl(_0x352352,_0x44c87b(0x1cc)+_0x4a9774+_0x44c87b(0x1c5)+_0xf0de63+'/tc');}export function getLLMConversationUrl(_0x5d2473,_0x3798c0,_0x34dcfc,_0x51bce4){const _0x5dad4f=a122_0x195eb5;return getConsoleNextUrl(_0x5d2473,_0x5dad4f(0x1cc)+_0x3798c0+'/ag/'+_0x34dcfc+_0x5dad4f(0x168)+_0x51bce4);}export function getWorkflowUrl(_0xa3a72a,_0xa5b305){const _0x50f2a6=a122_0x195eb5;return getConsoleUrl(_0xa3a72a,_0x50f2a6(0x176)+_0xa5b305+_0x50f2a6(0x1ce));}export function getWorkflowSessionUrl(_0x666e7e,_0x446b9b,_0x2648d6){const _0x312713=a122_0x195eb5;return getConsoleUrl(_0x666e7e,'/app/workflows/'+_0x446b9b+_0x312713(0x170)+_0x2648d6);}export function getWorkflowAttemptUrl(_0x5eec83,_0x52e0fb,_0x4aebc9,_0x333f68){const _0x4ffa7f=a122_0x195eb5;return getConsoleUrl(_0x5eec83,_0x4ffa7f(0x176)+_0x52e0fb+_0x4ffa7f(0x170)+_0x4aebc9+_0x4ffa7f(0x18e)+_0x333f68);}export function getCampaignUrl(_0x3f3a9c,_0x2e629c,_0x18ca9f){const _0x2c906a=a122_0x195eb5;return getConsoleNextUrl(_0x3f3a9c,_0x2c906a(0x1ad)+_0x2e629c+_0x2c906a(0x188)+_0x18ca9f);}export function getTemplateUrl(_0x36ccc2,_0x1d0afb,_0x29a75c){const _0x40375c=a122_0x195eb5;return getConsoleNextUrl(_0x36ccc2,_0x40375c(0x1ad)+_0x1d0afb+_0x40375c(0x183)+_0x29a75c+_0x40375c(0x18b));}export function getInBrowserMessageUrl(_0x585da2,_0x243fd2,_0x13ccfd){const _0x3847c2=a122_0x195eb5;return getConsoleNextUrl(_0x585da2,'/app/es/'+_0x243fd2+_0x3847c2(0x1a6)+_0x13ccfd);}export function getJobUrl(_0x34b4b2,_0x330a1f){const _0x4ccb5b=a122_0x195eb5;return getConsoleNextUrl(_0x34b4b2,'/app/jobs/'+_0x330a1f+_0x4ccb5b(0x16a));}export function getWorkspaceUrl(_0x31d1b4,_0x596ea4){return getConsoleNextUrl(_0x31d1b4,'/app/es/'+_0x596ea4);}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS,'llm-proxy':LLM_PROXY_ENDPOINTS,'cas':CDP_ENDPOINTS,'p13n-studio':P13N_STUDIO_ENDPOINTS};export function getLLMProxyEndpoint(_0xbfc942){const _0x3237ca=a122_0x195eb5,_0x19ed27=LLM_PROXY_ENDPOINTS[_0xbfc942];if(!_0x19ed27)throw new Error(_0x3237ca(0x173)+_0xbfc942);return _0x19ed27;}function a122_0x3633(_0x2cbd60,_0xd3bf8a){_0x2cbd60=_0x2cbd60-0x159;const _0x3de545=a122_0x3de5();let _0x3633ef=_0x3de545[_0x2cbd60];return _0x3633ef;}export function getEndpoint(_0x4e6dd0,_0x188878='td'){const _0x3afeed=a122_0x195eb5;if(_0x188878===_0x3afeed(0x1b1)&&process.env.TDX_CAS_LEGACY_ENDPOINT){const _0x5cbcb7=CAS_ENDPOINTS[_0x4e6dd0];if(!_0x5cbcb7)throw new Error(_0x3afeed(0x1a2)+_0x4e6dd0+'\x27');return _0x5cbcb7;}const _0x289efb=API_ENDPOINTS[_0x188878]?.[_0x4e6dd0];if(!_0x289efb)throw new Error(_0x3afeed(0x189)+_0x188878+'\x27\x20and\x20site\x20\x27'+_0x4e6dd0+'\x27');return _0x289efb;}
|
|
1
|
+
const a122_0x55f472=a122_0x2746;(function(_0x28b449,_0x410c99){const _0xe2a3e3=a122_0x2746,_0x4f7291=_0x28b449();while(!![]){try{const _0x4f90cb=-parseInt(_0xe2a3e3(0x1b7))/0x1*(-parseInt(_0xe2a3e3(0x185))/0x2)+-parseInt(_0xe2a3e3(0x195))/0x3*(parseInt(_0xe2a3e3(0x19f))/0x4)+-parseInt(_0xe2a3e3(0x1e8))/0x5+-parseInt(_0xe2a3e3(0x1d7))/0x6+-parseInt(_0xe2a3e3(0x1bd))/0x7+-parseInt(_0xe2a3e3(0x1ab))/0x8*(parseInt(_0xe2a3e3(0x1ca))/0x9)+-parseInt(_0xe2a3e3(0x1a4))/0xa*(-parseInt(_0xe2a3e3(0x187))/0xb);if(_0x4f90cb===_0x410c99)break;else _0x4f7291['push'](_0x4f7291['shift']());}catch(_0x3b0191){_0x4f7291['push'](_0x4f7291['shift']());}}}(a122_0x5c36,0x40a6f));export const TD_ENDPOINTS={'us01':a122_0x55f472(0x18c),'ap01':a122_0x55f472(0x18f),'eu01':'https://api.eu01.treasuredata.com','ap02':a122_0x55f472(0x1e1),'ap03':a122_0x55f472(0x1ad),'dev-us01':a122_0x55f472(0x1a7),'dev-eu01':'https://api-development.eu01.treasuredata.com','stg-us01':a122_0x55f472(0x1d6),'stg-ap01':a122_0x55f472(0x1d8),'stg-ap03':a122_0x55f472(0x1be)};export const CDP_ENDPOINTS={'us01':a122_0x55f472(0x1e4),'ap01':a122_0x55f472(0x1ce),'eu01':a122_0x55f472(0x1e5),'ap02':a122_0x55f472(0x1d2),'ap03':a122_0x55f472(0x1a3),'dev-us01':a122_0x55f472(0x1c0),'dev-eu01':'https://api-development-cdp.eu01.treasuredata.com','stg-us01':a122_0x55f472(0x1b9),'stg-ap01':a122_0x55f472(0x1b5),'stg-ap03':a122_0x55f472(0x181)};export const WORKFLOW_ENDPOINTS={'us01':a122_0x55f472(0x17f),'ap01':a122_0x55f472(0x1d4),'eu01':'https://api-workflow.eu01.treasuredata.com','ap02':a122_0x55f472(0x1dd),'ap03':'https://api-workflow.ap03.treasuredata.com','dev-us01':a122_0x55f472(0x1c3),'dev-eu01':a122_0x55f472(0x1a8),'stg-us01':'https://api-staging-workflow.us01.treasuredata.com','stg-ap01':a122_0x55f472(0x1ba),'stg-ap03':'https://api-staging-workflow.ap03.treasuredata.com'};export const TRINO_ENDPOINTS={'us01':a122_0x55f472(0x188),'ap01':'https://api-presto.treasuredata.co.jp','eu01':a122_0x55f472(0x1b1),'ap02':a122_0x55f472(0x18b),'ap03':a122_0x55f472(0x1d3),'dev-us01':a122_0x55f472(0x1aa),'dev-eu01':a122_0x55f472(0x1d5),'stg-us01':'https://api-staging-presto.treasuredata.com','stg-ap01':a122_0x55f472(0x183),'stg-ap03':a122_0x55f472(0x198)};export const LLM_ENDPOINTS={'us01':a122_0x55f472(0x182),'ap01':a122_0x55f472(0x1a5),'eu01':a122_0x55f472(0x1b6),'ap02':a122_0x55f472(0x1d1),'ap03':'https://llm-api.ap03.treasuredata.com','dev-us01':a122_0x55f472(0x1d9),'dev-eu01':a122_0x55f472(0x1c8),'stg-us01':a122_0x55f472(0x1b0),'stg-ap01':a122_0x55f472(0x18a),'stg-ap03':a122_0x55f472(0x191)};export const LLM_PROXY_ENDPOINTS={'us01':'https://llm-proxy.us01.treasuredata.com','ap01':'https://llm-proxy.treasuredata.co.jp','eu01':a122_0x55f472(0x1bf),'ap02':a122_0x55f472(0x19e),'ap03':'https://llm-proxy.ap03.treasuredata.com','dev-us01':'https://llm-proxy-development.us01.treasuredata.com','dev-eu01':'https://llm-proxy-development.eu01.treasuredata.com','stg-us01':a122_0x55f472(0x196),'stg-ap01':'https://llm-proxy-staging.treasuredata.co.jp','stg-ap03':'https://llm-proxy-staging.ap03.treasuredata.com'};export const ENGAGE_ENDPOINTS={'us01':'https://engage-api.treasuredata.com','ap01':a122_0x55f472(0x1ea),'eu01':a122_0x55f472(0x1e2),'ap02':a122_0x55f472(0x19a),'ap03':'https://engage-api.ap03.treasuredata.com','dev-us01':a122_0x55f472(0x19b),'dev-eu01':'https://engage-api-development.eu01.treasuredata.com','stg-us01':a122_0x55f472(0x184),'stg-ap01':a122_0x55f472(0x1e6),'stg-ap03':a122_0x55f472(0x1bb)};export const P13N_STUDIO_ENDPOINTS={'us01':a122_0x55f472(0x1a2),'ap01':a122_0x55f472(0x1c6),'eu01':a122_0x55f472(0x190),'dev-us01':a122_0x55f472(0x193),'dev-eu01':a122_0x55f472(0x1e7),'stg-us01':'https://personalization-studio-config-staging.us01.treasuredata.com','stg-ap01':'https://personalization-studio-config-staging.treasuredata.co.jp','stg-ap03':'https://personalization-studio-config-staging.ap03.treasuredata.com'};export const DELIVERY_ENDPOINTS={'us01':a122_0x55f472(0x1c1),'ap01':'https://delivery-api.treasuredata.co.jp','eu01':a122_0x55f472(0x1b3),'ap02':a122_0x55f472(0x1de),'ap03':'https://delivery-api.ap03.treasuredata.com','dev-us01':'https://delivery-api-development.us01.treasuredata.com','dev-eu01':'https://delivery-api-development.eu01.treasuredata.com','stg-us01':a122_0x55f472(0x199),'stg-ap01':'https://delivery-api-staging.treasuredata.co.jp','stg-ap03':'https://delivery-api-staging.ap03.treasuredata.com'};export function getDeliveryEndpoint(_0x4b21fd){const _0x4fc071=DELIVERY_ENDPOINTS[_0x4b21fd];if(!_0x4fc071)throw new Error('No\x20Delivery\x20API\x20endpoint\x20for\x20site:\x20'+_0x4b21fd);return _0x4fc071;}export const CAS_ENDPOINTS={'us01':a122_0x55f472(0x1c7),'ap01':'https://api-cas.treasuredata.co.jp','eu01':a122_0x55f472(0x1ac),'ap02':'https://api-cas.ap02.treasuredata.com','ap03':a122_0x55f472(0x19d),'dev-us01':a122_0x55f472(0x1b8),'dev-eu01':a122_0x55f472(0x180),'stg-us01':a122_0x55f472(0x1b4),'stg-ap01':a122_0x55f472(0x1b2),'stg-ap03':a122_0x55f472(0x189)};export const CONSOLE_ENDPOINTS={'us01':a122_0x55f472(0x1cb),'ap01':a122_0x55f472(0x1df),'eu01':'https://console.eu01.treasuredata.com','ap02':'https://console.ap02.treasuredata.com','ap03':a122_0x55f472(0x194),'dev-us01':a122_0x55f472(0x192),'dev-eu01':a122_0x55f472(0x1a9),'stg-us01':'https://console-staging.us01.treasuredata.com','stg-ap01':a122_0x55f472(0x1c2),'stg-ap03':'https://console-staging.ap03.treasuredata.com'};export const CONSOLE_NEXT_ENDPOINTS={'us01':'https://console-next.us01.treasuredata.com','ap01':a122_0x55f472(0x1eb),'eu01':a122_0x55f472(0x1dc),'ap02':a122_0x55f472(0x1ae),'ap03':'https://console-next.ap03.treasuredata.com','dev-us01':a122_0x55f472(0x1cc),'dev-eu01':a122_0x55f472(0x19c),'stg-us01':a122_0x55f472(0x1cd),'stg-ap01':'https://console-staging-next.treasuredata.co.jp','stg-ap03':a122_0x55f472(0x1d0)};export function getConsoleUrl(_0x501645,_0x4dc292){const _0x153168=CONSOLE_ENDPOINTS[_0x501645]||'https://console.'+_0x501645+'.treasuredata.com';return _0x4dc292?''+_0x153168+_0x4dc292:_0x153168;}export function getConsoleNextUrl(_0x3d3cd1,_0x360fb8){const _0x331d5e=a122_0x55f472,_0x3b1dd9=CONSOLE_NEXT_ENDPOINTS[_0x3d3cd1]||_0x331d5e(0x18e)+_0x3d3cd1+_0x331d5e(0x1a0);return _0x360fb8?''+_0x3b1dd9+_0x360fb8:_0x3b1dd9;}export function getLLMProjectUrl(_0x236f84,_0x443040){const _0x136e7c=a122_0x55f472;return getConsoleNextUrl(_0x236f84,_0x136e7c(0x1a6)+_0x443040+'/ag');}export function getLLMAgentChatUrl(_0x13f78d,_0x449a8c,_0x51a841){const _0x23f1ff=a122_0x55f472;return getConsoleNextUrl(_0x13f78d,'/app/af/'+_0x449a8c+_0x23f1ff(0x18d)+_0x51a841+_0x23f1ff(0x1c5));}function a122_0x2746(_0x4c384e,_0x1e7f73){_0x4c384e=_0x4c384e-0x17f;const _0x5c36dd=a122_0x5c36();let _0x27460f=_0x5c36dd[_0x4c384e];return _0x27460f;}export function getLLMConversationUrl(_0x8bec77,_0x5abf06,_0x489458,_0x229065){const _0x5c0460=a122_0x55f472;return getConsoleNextUrl(_0x8bec77,_0x5c0460(0x1a6)+_0x5abf06+_0x5c0460(0x18d)+_0x489458+_0x5c0460(0x1bc)+_0x229065);}export function getWorkflowUrl(_0x5a9376,_0x180130){const _0x17beee=a122_0x55f472;return getConsoleUrl(_0x5a9376,_0x17beee(0x197)+_0x180130+_0x17beee(0x186));}export function getWorkflowSessionUrl(_0x3cb9b7,_0x5c5dc5,_0x3f5bc4){const _0x35281b=a122_0x55f472;return getConsoleUrl(_0x3cb9b7,_0x35281b(0x197)+_0x5c5dc5+_0x35281b(0x1c9)+_0x3f5bc4);}export function getWorkflowAttemptUrl(_0x423855,_0x4a0447,_0x27f490,_0x5ec2b6){const _0x8ce77=a122_0x55f472;return getConsoleUrl(_0x423855,_0x8ce77(0x197)+_0x4a0447+'/sessions/'+_0x27f490+_0x8ce77(0x1e3)+_0x5ec2b6);}export function getCampaignUrl(_0x5e2f1f,_0x4ee7c4,_0x50d324){const _0x49db98=a122_0x55f472;return getConsoleNextUrl(_0x5e2f1f,_0x49db98(0x1af)+_0x4ee7c4+_0x49db98(0x1c4)+_0x50d324);}export function getTemplateUrl(_0x2ee596,_0x32e3d6,_0x388b35){const _0x426d10=a122_0x55f472;return getConsoleNextUrl(_0x2ee596,_0x426d10(0x1af)+_0x32e3d6+'/em/'+_0x388b35+_0x426d10(0x1cf));}export function getInBrowserMessageUrl(_0x400ce2,_0xee15e0,_0x43d023){const _0x307b65=a122_0x55f472;return getConsoleNextUrl(_0x400ce2,_0x307b65(0x1af)+_0xee15e0+_0x307b65(0x1e9)+_0x43d023);}export function getJobUrl(_0x11a2c2,_0x53db7c){return getConsoleNextUrl(_0x11a2c2,'/app/jobs/'+_0x53db7c+'/result');}export function getWorkspaceUrl(_0x8664e2,_0x2f3133){const _0x4a9017=a122_0x55f472;return getConsoleNextUrl(_0x8664e2,_0x4a9017(0x1af)+_0x2f3133);}export const API_ENDPOINTS={'td':TD_ENDPOINTS,'cdp':CDP_ENDPOINTS,'workflow':WORKFLOW_ENDPOINTS,'trino':TRINO_ENDPOINTS,'llm':LLM_ENDPOINTS,'engage':ENGAGE_ENDPOINTS,'llm-proxy':LLM_PROXY_ENDPOINTS,'cas':CDP_ENDPOINTS,'p13n-studio':P13N_STUDIO_ENDPOINTS};function a122_0x5c36(){const _0x2d0f53=['.treasuredata.com','\x27\x20and\x20site\x20\x27','https://personalization-studio-config.us01.treasuredata.com','https://api-cdp.ap03.treasuredata.com','1037530wDQcGJ','https://llm-api.treasuredata.co.jp','/app/af/','https://api-development.treasuredata.com','https://api-development-workflow.eu01.treasuredata.com','https://console-development.eu01.treasuredata.com','https://api-development-presto.treasuredata.com','12616VaNwJt','https://api-cas.eu01.treasuredata.com','https://api.ap03.treasuredata.com','https://console-next.ap02.treasuredata.com','/app/es/','https://llm-api-staging.us01.treasuredata.com','https://api-presto.eu01.treasuredata.com','https://api-staging-cas.treasuredata.co.jp','https://delivery-api.eu01.treasuredata.com','https://api-staging-cas.us01.treasuredata.com','https://api-staging-cdp.treasuredata.co.jp','https://llm-api.eu01.treasuredata.com','103DoyKnr','https://api-development-cas.us01.treasuredata.com','https://api-staging-cdp.us01.treasuredata.com','https://api-staging-workflow.treasuredata.co.jp','https://engage-api-staging.ap03.treasuredata.com','/tc/','852691qZTdHc','https://api-staging.ap03.treasuredata.com','https://llm-proxy.eu01.treasuredata.com','https://api-development-cdp.us01.treasuredata.com','https://delivery-api.us01.treasuredata.com','https://console-staging.treasuredata.co.jp','https://api-development-workflow.us01.treasuredata.com','/ooc/','/tc','https://personalization-studio-config.treasuredata.co.jp','https://api-cas.treasuredata.com','https://llm-api-development.eu01.treasuredata.com','/sessions/','1629MotoVk','https://console.us01.treasuredata.com','https://console-development-next.us01.treasuredata.com','https://console-staging-next.us01.treasuredata.com','https://api-cdp.treasuredata.co.jp','/ce','https://console-staging-next.ap03.treasuredata.com','https://llm-api.ap02.treasuredata.com','https://api-cdp.ap02.treasuredata.com','https://api-presto.ap03.treasuredata.com','https://api-workflow.treasuredata.co.jp','https://api-development-presto.eu01.treasuredata.com','https://api-staging.treasuredata.com','191190xSGGem','https://api-staging.treasuredata.co.jp','https://llm-api-development.us01.treasuredata.com','No\x20legacy\x20CAS\x20endpoint\x20defined\x20for\x20site\x20\x27','No\x20LLM\x20Proxy\x20endpoint\x20for\x20site:\x20','https://console-next.eu01.treasuredata.com','https://api-workflow.ap02.treasuredata.com','https://delivery-api.ap02.treasuredata.com','https://console.treasuredata.co.jp','cas','https://api.ap02.treasuredata.com','https://engage-api.eu01.treasuredata.com','/attempt/','https://api-cdp.treasuredata.com','https://api-cdp.eu01.treasuredata.com','https://engage-api-staging.treasuredata.co.jp','https://personalization-studio-config-development.eu01.treasuredata.com','1920155SsDLZt','/ibm/','https://engage-api.treasuredata.co.jp','https://console-next.treasuredata.co.jp','https://api-workflow.treasuredata.com','https://api-development-cas.eu01.treasuredata.com','https://api-staging-cdp.ap03.treasuredata.com','https://llm-api.treasuredata.com','https://api-staging-presto.treasuredata.co.jp','https://engage-api-staging.us01.treasuredata.com','9916fbhxrW','/info','66fpkHFX','https://api-presto.treasuredata.com','https://api-staging-cas.ap03.treasuredata.com','https://llm-api-staging.treasuredata.co.jp','https://api-presto.ap02.treasuredata.com','https://api.treasuredata.com','/ag/','https://console-next.','https://api.treasuredata.co.jp','https://personalization-studio-config.eu01.treasuredata.com','https://llm-api-staging.ap03.treasuredata.com','https://console-development.us01.treasuredata.com','https://personalization-studio-config-development.us01.treasuredata.com','https://console.ap03.treasuredata.com','45231jEZOcL','https://llm-proxy-staging.us01.treasuredata.com','/app/workflows/','https://api-staging-presto.ap03.treasuredata.com','https://delivery-api-staging.us01.treasuredata.com','https://engage-api.ap02.treasuredata.com','https://engage-api-development.us01.treasuredata.com','https://console-development-next.eu01.treasuredata.com','https://api-cas.ap03.treasuredata.com','https://llm-proxy.ap02.treasuredata.com','12RxkHBY'];a122_0x5c36=function(){return _0x2d0f53;};return a122_0x5c36();}export function getLLMProxyEndpoint(_0x5f38af){const _0x287fcc=a122_0x55f472,_0x423fe1=LLM_PROXY_ENDPOINTS[_0x5f38af];if(!_0x423fe1)throw new Error(_0x287fcc(0x1db)+_0x5f38af);return _0x423fe1;}export function getEndpoint(_0xf181a1,_0x1dc03a='td'){const _0x29cacb=a122_0x55f472;if(_0x1dc03a===_0x29cacb(0x1e0)&&process.env.TDX_CAS_LEGACY_ENDPOINT){const _0x5c083d=CAS_ENDPOINTS[_0xf181a1];if(!_0x5c083d)throw new Error(_0x29cacb(0x1da)+_0xf181a1+'\x27');return _0x5c083d;}const _0x35969e=API_ENDPOINTS[_0x1dc03a]?.[_0xf181a1];if(!_0x35969e)throw new Error('No\x20endpoint\x20defined\x20for\x20API\x20type\x20\x27'+_0x1dc03a+_0x29cacb(0x1a1)+_0xf181a1+'\x27');return _0x35969e;}
|