@treasuredata/tdx 2026.4.20 → 2026.4.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli-categories.js +1 -1
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +1 -1
- package/dist/cli.js.map +1 -1
- package/dist/commands/activations.js +1 -1
- package/dist/commands/agent-command.js +1 -1
- package/dist/commands/agent-test-command.js +1 -1
- package/dist/commands/api-command.js +1 -1
- package/dist/commands/auth-command.js +1 -1
- package/dist/commands/cas-command.js +1 -1
- package/dist/commands/cas-segment-command.js +1 -1
- package/dist/commands/chat-command.js +1 -1
- package/dist/commands/claude-command.js +1 -1
- package/dist/commands/claude-statusline-command.js +1 -1
- package/dist/commands/claude-usage-command.js +1 -1
- package/dist/commands/command.js +1 -1
- package/dist/commands/connection-command.js +1 -1
- package/dist/commands/databases.js +1 -1
- package/dist/commands/delivery-command.js +1 -1
- package/dist/commands/describe.js +1 -1
- package/dist/commands/engage-campaign-pull-command.js +1 -1
- package/dist/commands/engage-campaign-push-command.js +1 -1
- package/dist/commands/engage-campaign-validate-command.js +1 -1
- package/dist/commands/engage-command.d.ts +47 -0
- package/dist/commands/engage-command.d.ts.map +1 -1
- package/dist/commands/engage-command.js +1 -1
- package/dist/commands/engage-command.js.map +1 -1
- package/dist/commands/engage-template-pull-command.js +1 -1
- package/dist/commands/engage-template-push-command.js +1 -1
- package/dist/commands/engage-template-validate-command.js +1 -1
- package/dist/commands/job-command.js +1 -1
- package/dist/commands/journey-command.js +1 -1
- package/dist/commands/journey-validate-command.js +1 -1
- package/dist/commands/llm-command.js +1 -1
- package/dist/commands/mcp-command.js +1 -1
- package/dist/commands/parent-segment-command.js +1 -1
- package/dist/commands/policy-command.js +1 -1
- package/dist/commands/profile-command.js +1 -1
- package/dist/commands/profiles-command.js +1 -1
- package/dist/commands/query-command.js +1 -1
- package/dist/commands/schedule-command.js +1 -1
- package/dist/commands/segment-command.js +1 -1
- package/dist/commands/segment-create-command.js +1 -1
- package/dist/commands/segment-fields-command.js +1 -1
- package/dist/commands/segment-pull-command.js +1 -1
- package/dist/commands/segment-push-command.js +1 -1
- package/dist/commands/segment-update-command.js +1 -1
- package/dist/commands/segment-use-command.js +1 -1
- package/dist/commands/segment-validate-command.js +1 -1
- package/dist/commands/segments.js +1 -1
- package/dist/commands/show.js +1 -1
- package/dist/commands/status-command.js +1 -1
- package/dist/commands/tables.js +1 -1
- package/dist/commands/unset-command.js +1 -1
- package/dist/commands/upgrade-command.js +1 -1
- package/dist/commands/use-command.js +1 -1
- package/dist/commands/user-command.js +1 -1
- package/dist/commands/work-command.js +1 -1
- package/dist/commands/workflow-command.js +1 -1
- package/dist/core/auth.js +1 -1
- package/dist/core/command-output.js +1 -1
- package/dist/core/config.js +1 -1
- package/dist/core/connection-cache.js +1 -1
- package/dist/core/constants.js +1 -1
- package/dist/core/credential-cache.js +1 -1
- package/dist/core/global-context.js +1 -1
- package/dist/core/keychain.js +1 -1
- package/dist/core/oauth-keychain.js +1 -1
- package/dist/core/oauth.js +1 -1
- package/dist/core/profile.js +1 -1
- package/dist/core/project-config.js +1 -1
- package/dist/core/session.js +1 -1
- package/dist/core/user-cache.js +1 -1
- package/dist/core/version.js +1 -1
- package/dist/index.js +1 -1
- package/dist/mcp/server.js +1 -1
- package/dist/mcp/tools/index.js +1 -1
- package/dist/mcp/tools/tdx-run.js +1 -1
- package/dist/mcp/tools/tdx-search.js +1 -1
- package/dist/mcp/tools/work-create-item.js +1 -1
- package/dist/mcp/utils.js +1 -1
- package/dist/proxy/claude-usage-tracker.js +1 -1
- package/dist/proxy/passthrough-server.js +1 -1
- package/dist/proxy/sse-usage-parser.js +1 -1
- package/dist/sdk/agent/agent-config.js +1 -1
- package/dist/sdk/agent/agent-ref-parser.js +1 -1
- package/dist/sdk/agent/agent-yaml.js +1 -1
- package/dist/sdk/agent/test/evaluator.js +1 -1
- package/dist/sdk/agent/test/executor.js +1 -1
- package/dist/sdk/agent/test/index.js +1 -1
- package/dist/sdk/agent/test/output.js +1 -1
- package/dist/sdk/agent/test/parser.js +1 -1
- package/dist/sdk/agent/tool-target-registry.js +1 -1
- package/dist/sdk/api.js +1 -1
- package/dist/sdk/cas/cas-api-client.js +1 -1
- package/dist/sdk/cas/cas-audience-yaml.js +1 -1
- package/dist/sdk/cas/cas-segment-yaml.js +1 -1
- package/dist/sdk/cas/index.js +1 -1
- package/dist/sdk/cas/pull-workflow.js +1 -1
- package/dist/sdk/cas/push-workflow.js +1 -1
- package/dist/sdk/client/cdp-api-client.js +1 -1
- package/dist/sdk/client/delivery-api-client.js +1 -1
- package/dist/sdk/client/endpoints.js +1 -1
- package/dist/sdk/client/engage-api-client.d.ts +50 -1
- package/dist/sdk/client/engage-api-client.d.ts.map +1 -1
- package/dist/sdk/client/engage-api-client.js +1 -1
- package/dist/sdk/client/engage-api-client.js.map +1 -1
- package/dist/sdk/client/http-client.js +1 -1
- package/dist/sdk/client/llm-api-client.js +1 -1
- package/dist/sdk/client/oauth-refresh.js +1 -1
- package/dist/sdk/client/rate-limiter.js +1 -1
- package/dist/sdk/client/td-api-client.js +1 -1
- package/dist/sdk/client/trino-api-client.js +1 -1
- package/dist/sdk/client/workflow-client.js +1 -1
- package/dist/sdk/connection-validator.js +1 -1
- package/dist/sdk/connection.js +1 -1
- package/dist/sdk/delivery.js +1 -1
- package/dist/sdk/engage/campaign-pull.js +1 -1
- package/dist/sdk/engage/campaign-push.js +1 -1
- package/dist/sdk/engage/campaign-validator.js +1 -1
- package/dist/sdk/engage/campaign-yaml.js +1 -1
- package/dist/sdk/engage/template-pull.js +1 -1
- package/dist/sdk/engage/template-push.js +1 -1
- package/dist/sdk/engage/template-validator.js +1 -1
- package/dist/sdk/engage/template-yaml.js +1 -1
- package/dist/sdk/engage/types/campaign-def.js +1 -1
- package/dist/sdk/engage/types/campaign-schema.js +1 -1
- package/dist/sdk/engage/types/template-schema.js +1 -1
- package/dist/sdk/engage.d.ts +35 -1
- package/dist/sdk/engage.d.ts.map +1 -1
- package/dist/sdk/engage.js +1 -1
- package/dist/sdk/engage.js.map +1 -1
- package/dist/sdk/errors.js +1 -1
- package/dist/sdk/index.js +1 -1
- package/dist/sdk/io/index.js +1 -1
- package/dist/sdk/io/node-filesystem.js +1 -1
- package/dist/sdk/job.js +1 -1
- package/dist/sdk/journey.js +1 -1
- package/dist/sdk/llm/chat-cache.js +1 -1
- package/dist/sdk/llm/index.js +1 -1
- package/dist/sdk/llm/llm-backup-utils.js +1 -1
- package/dist/sdk/llm/model-factors.js +1 -1
- package/dist/sdk/personalization.js +1 -1
- package/dist/sdk/policy.js +1 -1
- package/dist/sdk/query/index.js +1 -1
- package/dist/sdk/query/sql-parser.js +1 -1
- package/dist/sdk/realtime.js +1 -1
- package/dist/sdk/schedule.js +1 -1
- package/dist/sdk/segment/child-segment-yaml.js +1 -1
- package/dist/sdk/segment/fields-display.js +1 -1
- package/dist/sdk/segment/file-discovery.js +1 -1
- package/dist/sdk/segment/journey-utils.js +1 -1
- package/dist/sdk/segment/journey-validator.js +1 -1
- package/dist/sdk/segment/journey-yaml.js +1 -1
- package/dist/sdk/segment/parent-segment-preview.js +1 -1
- package/dist/sdk/segment/parent-segment-yaml.js +1 -1
- package/dist/sdk/segment/pull-workflow.js +1 -1
- package/dist/sdk/segment/push-recovery.js +1 -1
- package/dist/sdk/segment/push-workflow.js +1 -1
- package/dist/sdk/segment/resolution-context.js +1 -1
- package/dist/sdk/segment/segment-path-parser.js +1 -1
- package/dist/sdk/segment/segment-ref-parser.js +1 -1
- package/dist/sdk/segment/segment-validator.js +1 -1
- package/dist/sdk/segment/target-resolution.js +1 -1
- package/dist/sdk/segment/tdx-config.js +1 -1
- package/dist/sdk/segment/types/activation-schema.js +1 -1
- package/dist/sdk/segment/types/journey-def.js +1 -1
- package/dist/sdk/segment/types/journey-schema.js +1 -1
- package/dist/sdk/segment/types/segment-def.js +1 -1
- package/dist/sdk/segment/types/segment-schema.js +1 -1
- package/dist/sdk/segment/validate-files.js +1 -1
- package/dist/sdk/segment/yaml-validator.js +1 -1
- package/dist/sdk/segment.js +1 -1
- package/dist/sdk/types/engage.d.ts +53 -0
- package/dist/sdk/types/engage.d.ts.map +1 -1
- package/dist/sdk/types/index.d.ts +1 -1
- package/dist/sdk/types/index.d.ts.map +1 -1
- package/dist/sdk/types/index.js +1 -1
- package/dist/sdk/types/index.js.map +1 -1
- package/dist/sdk/types/progress.js +1 -1
- package/dist/sdk/types/workspace.js +1 -1
- package/dist/sdk/user.js +1 -1
- package/dist/sdk/util/format-detector.js +1 -1
- package/dist/sdk/util/formatters.js +1 -1
- package/dist/sdk/util/index.js +1 -1
- package/dist/sdk/util/paginate.js +1 -1
- package/dist/sdk/util/tree-formatter.js +1 -1
- package/dist/sdk/workflow/archive-validation.js +1 -1
- package/dist/sdk/workflow/clone-workflow.js +1 -1
- package/dist/sdk/workflow/index.js +1 -1
- package/dist/sdk/workflow/pull-workflow.js +1 -1
- package/dist/sdk/workflow/push-workflow.js +1 -1
- package/dist/sdk/workflow/task-graph.js +1 -1
- package/dist/sdk/workflow/tdx-config.js +1 -1
- package/dist/sdk/workflow/workflow-utils.js +1 -1
- package/dist/sdk/workspace/access-tracker.js +1 -1
- package/dist/sdk/workspace/frontmatter.js +1 -1
- package/dist/sdk/workspace/git.js +1 -1
- package/dist/sdk/workspace/index.js +1 -1
- package/dist/sdk/workspace/templates.js +1 -1
- package/dist/sdk/workspace/weekly.js +1 -1
- package/dist/sdk/workspace/wikilinks.js +1 -1
- package/dist/test-utils/command-runner.js +1 -1
- package/dist/test-utils/factories.js +1 -1
- package/dist/test-utils/fixtures.js +1 -1
- package/dist/test-utils/http-mock.js +1 -1
- package/dist/test-utils/index.js +1 -1
- package/dist/utils/async.js +1 -1
- package/dist/utils/colors.js +1 -1
- package/dist/utils/diff.js +1 -1
- package/dist/utils/file-permissions.js +1 -1
- package/dist/utils/file-reader.js +1 -1
- package/dist/utils/github-releases.js +1 -1
- package/dist/utils/global-cache.js +1 -1
- package/dist/utils/json-loader.js +1 -1
- package/dist/utils/local-cache.js +1 -1
- package/dist/utils/logger/formatters/default-formatter.js +1 -1
- package/dist/utils/logger/formatters/index.js +1 -1
- package/dist/utils/logger/handlers/console-handler.js +1 -1
- package/dist/utils/logger/handlers/file-handler.js +1 -1
- package/dist/utils/logger/handlers/index.js +1 -1
- package/dist/utils/logger/handlers/null-handler.js +1 -1
- package/dist/utils/logger/index.js +1 -1
- package/dist/utils/logger/logger.js +1 -1
- package/dist/utils/logger/types.js +1 -1
- package/dist/utils/option-validation.js +1 -1
- package/dist/utils/process.js +1 -1
- package/dist/utils/prompt.js +1 -1
- package/dist/utils/spinner.js +1 -1
- package/dist/utils/sse-parser.js +1 -1
- package/dist/utils/string-utils.js +1 -1
- package/dist/utils/table-ref-parser.js +1 -1
- package/dist/utils/tdx-logger.js +1 -1
- package/dist/utils/version-check.js +1 -1
- package/package.json +1 -1
package/dist/sdk/journey.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const a131_0x395ca7=a131_0x1e8b;(function(_0x9bac46,_0x32fd96){const _0xae4cc5=a131_0x1e8b,_0x3f4d7e=_0x9bac46();while(!![]){try{const _0x2a5954=parseInt(_0xae4cc5(0x128))/0x1+parseInt(_0xae4cc5(0x11a))/0x2*(parseInt(_0xae4cc5(0xf7))/0x3)+parseInt(_0xae4cc5(0x140))/0x4*(-parseInt(_0xae4cc5(0x13d))/0x5)+-parseInt(_0xae4cc5(0x12f))/0x6*(-parseInt(_0xae4cc5(0x11d))/0x7)+parseInt(_0xae4cc5(0x11c))/0x8*(-parseInt(_0xae4cc5(0x114))/0x9)+-parseInt(_0xae4cc5(0xe4))/0xa*(parseInt(_0xae4cc5(0xd8))/0xb)+parseInt(_0xae4cc5(0x136))/0xc*(parseInt(_0xae4cc5(0x122))/0xd);if(_0x2a5954===_0x32fd96)break;else _0x3f4d7e['push'](_0x3f4d7e['shift']());}catch(_0x2c17f6){_0x3f4d7e['push'](_0x3f4d7e['shift']());}}}(a131_0x3b19,0xd8092));import{CDPApiClient}from'./client/cdp-api-client.js';import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x5efc85){const _0x520ac7=a131_0x1e8b;return _0x5efc85[_0x520ac7(0x12d)]??_0x5efc85[_0x520ac7(0xb8)]?.[_0x520ac7(0x12d)]??undefined;}function getVersionNumber(_0x3fa234){const _0x325a0a=a131_0x1e8b;return _0x3fa234['versionNumber']??_0x3fa234[_0x325a0a(0xb8)]?.[_0x325a0a(0xbc)]??0x0;}function getState(_0x232f36){const _0x200eaa=a131_0x1e8b;return _0x232f36['state']??_0x232f36['attributes']?.[_0x200eaa(0x107)];}export function deduplicateJourneysByBundle(_0x3ad755){const _0x4facc2=a131_0x1e8b,_0x5a5b53=new Map();let _0x3e5050=0x0;for(const _0x141925 of _0x3ad755){const _0x3de4b5=getBundleId(_0x141925);if(!_0x3de4b5){const _0x27f069=_0x4facc2(0xd4)+(_0x141925['id']??_0x4facc2(0x123)+_0x3e5050++);_0x5a5b53[_0x4facc2(0xd5)](_0x27f069,_0x141925);continue;}const _0x1811dc=_0x5a5b53['get'](_0x3de4b5);if(!_0x1811dc)_0x5a5b53[_0x4facc2(0xd5)](_0x3de4b5,_0x141925);else{const _0x474e4e=getState(_0x1811dc)===_0x4facc2(0xf6),_0x4d6a97=getState(_0x141925)===_0x4facc2(0xf6);if(_0x4d6a97&&!_0x474e4e)_0x5a5b53[_0x4facc2(0xd5)](_0x3de4b5,_0x141925);else{if(!_0x4d6a97&&_0x474e4e){}else{const _0x11e445=getVersionNumber(_0x1811dc),_0x57a5bf=getVersionNumber(_0x141925);_0x57a5bf>_0x11e445&&_0x5a5b53[_0x4facc2(0xd5)](_0x3de4b5,_0x141925);}}}}return Array[_0x4facc2(0xe8)](_0x5a5b53['values']());}const VALID_JOURNEY_STATES=new Set([a131_0x395ca7(0xca),a131_0x395ca7(0x139),a131_0x395ca7(0xf6)]);export function parseJourneyState(_0x386283){const _0x4d735f=a131_0x395ca7;if(typeof _0x386283===_0x4d735f(0xc1)&&VALID_JOURNEY_STATES[_0x4d735f(0xc3)](_0x386283))return _0x386283;return _0x4d735f(0xca);}export function entityToJourneyListItem(_0x89aede,_0x4bcd0e){const _0x408313=a131_0x395ca7,_0x3c0229=_0x89aede[_0x408313(0xb8)];return{'id':_0x89aede['id'],'name':_0x3c0229[_0x408313(0x104)]??'','journeyBundleName':_0x3c0229[_0x408313(0x127)]??_0x3c0229[_0x408313(0x104)]??'','journeyBundleId':_0x3c0229[_0x408313(0x12d)]??'','versionNumber':_0x3c0229[_0x408313(0xbc)],'description':_0x3c0229[_0x408313(0xbd)]??null,'state':parseJourneyState(_0x3c0229[_0x408313(0x107)]),'paused':_0x3c0229[_0x408313(0xfb)]??![],'audienceId':_0x4bcd0e,'folderId':_0x3c0229[_0x408313(0x126)]??_0x89aede[_0x408313(0x13c)]?.[_0x408313(0xfa)]?.[_0x408313(0x10c)]?.['id']??null,'createdAt':_0x3c0229[_0x408313(0x13b)]??'','updatedAt':_0x3c0229[_0x408313(0x10e)]??''};}function convertToColumnId(_0xcc33a0){const _0x679268=a131_0x395ca7;return _0xcc33a0[_0x679268(0xb5)](/-/g,'_');}function a131_0x3b19(){const _0x35f2ae=['getJourneyActivation','steps','data','length','updatedAt','map','stage','entryCriteria','createVersion','branches','9BAPPYE','limit','WaitStep','step','listVersions','enteredSize','5378muTEBX','_exit_','9981904PtzUyW','1035587AkksfL','journeyStageId','getParentSegmentFull','getJourneyBundle','listEntitiesByFolder','676njSjOt','idx-','time','Journey\x20activation\x20step\x20not\x20found:\x20','segmentFolderId','journeyBundleName','718126uBFRXn','resolveJourneyId','listActivationsFlat','getActivation','entries','journeyBundleId','resolveRootFolderId','6cUJOVq','createJourneyVersion','exitCriterias','jumpInflux','milestone','getStatistics','type','173304gmXWBZ','updateJourney','latestJourneyId','simulation','getJourneyStatistics','createdAt','relationships','5nIfAtn','exit_criteria','intime_journey','3805124RlEuEl','folder-segment','exitOrJumpSize','history','toLowerCase','fetchTrafficRaw','journeys','getActivationSankeyChart','replace','listJourneysWithDetails','pause','attributes','createActivation','AbTest','get','versionNumber','description','fixed','createJourney','audienceId','string','getJourney','has','intime_stage_','listJourneysWithDetailsFromParentSegment','conversion','pauseJourney','getColumnMapping','goalSize','draft','getBundle','create','branch','applyVersionDeduplication','filter','reduce','exitCriteria','excluded','push','no-bundle-','set','outtime_stage_','ABTest','754259rZpDwC','getTrafficData','intime_goal','listJourneyActivations','includeAllVersions','size','journey','sort','listActivations','cdp_customer_id','client','\x20in\x20journey\x20','10hHMyqD','out','DecisionPoint','entryInflux','from','Journey\x20not\x20found:\x20','milestoneInflux','update','goalInflux','journeyId','conditionSegmentId','waitCondition','getConversionSankeyChart','JOURNEY_NOT_FOUND','activationStepsById','exitInflux','Excluded\x20profiles','createJourneyActivation','launched','1713vjJUbv','includeHistory','lastVersionNumber','parentFolder','paused','variant','INVALID_ARGUMENT','listJourneysWithFolders','timedOutPath','isArray','NOT_FOUND','segmentId','Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys','name','conditions','goal','state','activation','variants'];a131_0x3b19=function(){return _0x35f2ae;};return a131_0x3b19();}function getStepEntries(_0x234035){const _0xdfd65d=a131_0x395ca7;if(!_0x234035)return[];if(Array['isArray'](_0x234035))return _0x234035[_0xdfd65d(0x10f)](_0x21fe22=>[_0x21fe22['id'],_0x21fe22]);return Object[_0xdfd65d(0x12c)](_0x234035);}export function flattenJourneyActivation(_0x1ae755){const {activationParams:_0x388ebf,activationId:_0x312406,runAfterJourneyRefresh:_0x43f894}=_0x1ae755['attributes'];return{'id':_0x1ae755['id'],'activationId':_0x312406,'runAfterJourneyRefresh':_0x43f894,..._0x388ebf};}function a131_0x1e8b(_0x2d8c39,_0x2f9f33){_0x2d8c39=_0x2d8c39-0xb5;const _0x3b19fe=a131_0x3b19();let _0x1e8bb3=_0x3b19fe[_0x2d8c39];return _0x1e8bb3;}function col(_0x917d6d,_0x51a2ef={}){const _0x43ebc9=a131_0x395ca7;return{'column':_0x917d6d,'direction':null,'stageIndex':null,'stageName':null,'category':_0x43ebc9(0xbe),'stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x51a2ef};}export function generateColumnMapping(_0xec923a){const _0x1ccf48=a131_0x395ca7,_0x340e25=[];_0x340e25[_0x1ccf48(0xd3)](col(_0x1ccf48(0xe1))),_0x340e25[_0x1ccf48(0xd3)](col(_0x1ccf48(0x13f),{'direction':'in','category':_0x1ccf48(0xde)})),_0x340e25[_0x1ccf48(0xd3)](col('outtime_journey',{'direction':_0x1ccf48(0xe5),'category':_0x1ccf48(0xde)}));_0xec923a['attributes'][_0x1ccf48(0x106)]&&_0x340e25[_0x1ccf48(0xd3)](col(_0x1ccf48(0xda),{'direction':'in','category':_0x1ccf48(0x106),'detail':_0xec923a[_0x1ccf48(0xb8)][_0x1ccf48(0x106)][_0x1ccf48(0x104)]||null}));const _0x3d6ee2=_0xec923a[_0x1ccf48(0xb8)]['journeyStages']||[];for(let _0x1e51c1=0x0;_0x1e51c1<_0x3d6ee2[_0x1ccf48(0x10d)];_0x1e51c1++){const _0x3fd017=_0x3d6ee2[_0x1e51c1],_0x31db26=_0x3fd017[_0x1ccf48(0x104)],_0x1466d5={'stageIndex':_0x1e51c1,'stageName':_0x31db26},_0x18a9bc=_0x3fd017[_0x1ccf48(0x111)]?.[_0x1ccf48(0x104)]||null;_0x340e25[_0x1ccf48(0xd3)](col(_0x1ccf48(0xc4)+_0x1e51c1,{..._0x1466d5,'direction':'in','category':'stage','detail':_0x18a9bc})),_0x340e25['push'](col(_0x1ccf48(0xd6)+_0x1e51c1,{..._0x1466d5,'direction':'out','category':_0x1ccf48(0x110),'detail':_0x18a9bc}));_0x3fd017[_0x1ccf48(0x133)]&&_0x340e25[_0x1ccf48(0xd3)](col(_0x1ccf48(0xc4)+_0x1e51c1+'_milestone',{..._0x1466d5,'direction':'in','category':_0x1ccf48(0x133),'detail':_0x3fd017[_0x1ccf48(0x133)][_0x1ccf48(0x104)]||null}));const _0x2a545f=_0x3fd017[_0x1ccf48(0x131)]||_0x3fd017[_0x1ccf48(0xd1)]||[];for(let _0x34ab48=0x0;_0x34ab48<_0x2a545f['length'];_0x34ab48++){_0x340e25['push'](col(_0x1ccf48(0xc4)+_0x1e51c1+_0x1ccf48(0x11b)+_0x34ab48,{..._0x1466d5,'direction':'in','category':_0x1ccf48(0x13e),'detail':_0x2a545f[_0x34ab48][_0x1ccf48(0x104)]||null}));}const _0x23d727=getStepEntries(_0x3fd017[_0x1ccf48(0x10b)]);for(const [_0xfc99db,_0x550cc3]of _0x23d727){const _0x4fb3df=convertToColumnId(_0xfc99db),_0x32c50f=_0x550cc3['type']||null,_0x2d7ca2=_0x550cc3[_0x1ccf48(0x104)]||null,_0x80b1c9={..._0x1466d5,'stepType':_0x32c50f,'stepName':_0x2d7ca2,'stepId':_0xfc99db};_0x340e25['push'](col(_0x1ccf48(0xc4)+_0x1e51c1+'_'+_0x4fb3df,{..._0x80b1c9,'direction':'in','category':'step'})),_0x340e25[_0x1ccf48(0xd3)](col('outtime_stage_'+_0x1e51c1+'_'+_0x4fb3df,{..._0x80b1c9,'direction':_0x1ccf48(0xe5),'category':_0x1ccf48(0x117)}));if(_0x550cc3['type']===_0x1ccf48(0xe6)&&_0x550cc3[_0x1ccf48(0x113)])for(const _0x342226 of _0x550cc3['branches']){_0x342226['segmentId']&&_0x340e25[_0x1ccf48(0xd3)](col(_0x1ccf48(0xc4)+_0x1e51c1+'_'+_0x4fb3df+'_'+_0x342226[_0x1ccf48(0x102)],{..._0x80b1c9,'direction':'in','category':_0x1ccf48(0xcd),'detail':_0x342226[_0x1ccf48(0x104)]||(_0x342226[_0x1ccf48(0xd2)]?_0x1ccf48(0xf4):null)}));}if((_0x550cc3[_0x1ccf48(0x135)]===_0x1ccf48(0xba)||_0x550cc3['type']===_0x1ccf48(0xd7))&&_0x550cc3[_0x1ccf48(0x109)])for(const _0x26abc4 of _0x550cc3['variants']){_0x26abc4['id']&&_0x340e25[_0x1ccf48(0xd3)](col(_0x1ccf48(0xc4)+_0x1e51c1+'_'+_0x4fb3df+'_variant_'+convertToColumnId(_0x26abc4['id']),{..._0x80b1c9,'direction':'in','category':_0x1ccf48(0xfc),'detail':_0x26abc4[_0x1ccf48(0x104)]||null}));}if(_0x550cc3['type']===_0x1ccf48(0x116)||_0x550cc3[_0x1ccf48(0x135)]==='Wait'){const _0xef61d4=[];if(_0x550cc3['conditionSegmentId'])_0xef61d4['push'](_0x550cc3[_0x1ccf48(0xee)]);else{if(Array[_0x1ccf48(0x100)](_0x550cc3[_0x1ccf48(0x105)]))for(const _0x2f6cbf of _0x550cc3['conditions']){_0x2f6cbf[_0x1ccf48(0x102)]&&!_0x2f6cbf[_0x1ccf48(0xff)]&&_0xef61d4[_0x1ccf48(0xd3)](_0x2f6cbf[_0x1ccf48(0x102)]);}else _0x550cc3[_0x1ccf48(0xef)]?.[_0x1ccf48(0x102)]&&_0xef61d4[_0x1ccf48(0xd3)](_0x550cc3[_0x1ccf48(0xef)][_0x1ccf48(0x102)]);}for(const _0x168f79 of _0xef61d4){_0x340e25[_0x1ccf48(0xd3)](col(_0x1ccf48(0xc4)+_0x1e51c1+'_'+_0x4fb3df+'_'+_0x168f79,{..._0x80b1c9,'direction':'in','category':_0x1ccf48(0xcd)}));}}}}return _0x340e25[_0x1ccf48(0xd3)](col(_0x1ccf48(0x124))),_0x340e25;}export function aggregateJourneyHistory(_0x202d18){const _0x344602=a131_0x395ca7,_0xb38860=_0x202d18[_0x344602(0xd0)]((_0x524486,_0x44cdc3)=>_0x524486+(_0x44cdc3['entryInflux']??0x0),0x0),_0x416187=_0x202d18[_0x344602(0xd0)]((_0x227c16,_0x131f48)=>_0x227c16+(_0x131f48[_0x344602(0xec)]??0x0),0x0),_0x5c808e=_0x202d18[_0x344602(0xd0)]((_0x5ce7d8,_0x344ae9)=>_0x5ce7d8+((_0x344ae9[_0x344602(0xf3)]??0x0)+(_0x344ae9[_0x344602(0x132)]??0x0)),0x0),_0x3ec91d=_0x202d18[_0x202d18[_0x344602(0x10d)]-0x1];return{'size':_0x3ec91d?.['size']??0x0,'entered':_0xb38860,'goal_achieved':_0x416187,'completion_rate':_0x416187&&_0xb38860?_0x416187/_0xb38860*0x64:0x0,'exit_or_jump':_0x5c808e,'exit_or_jump_rate':_0x5c808e&&_0xb38860?_0x5c808e/_0xb38860*0x64:0x0};}export function aggregateStageHistory(_0x17940d){const _0x2ce097=a131_0x395ca7,_0x9a3fe0=_0x17940d[_0x2ce097(0xd0)]((_0x1ac9a4,_0x23622c)=>_0x1ac9a4+(_0x23622c[_0x2ce097(0xe7)]??0x0),0x0),_0x4e88e5=_0x17940d['reduce']((_0x385512,_0x2803f9)=>_0x385512+(_0x2803f9[_0x2ce097(0xea)]??0x0),0x0),_0x2134a5=_0x17940d[_0x2ce097(0xd0)]((_0x59e3ff,_0x33fcb4)=>_0x59e3ff+((_0x33fcb4[_0x2ce097(0xf3)]??0x0)+(_0x33fcb4['jumpInflux']??0x0)),0x0),_0x3b5549=_0x17940d[_0x17940d[_0x2ce097(0x10d)]-0x1];return{'size':_0x3b5549?.[_0x2ce097(0xdd)]??0x0,'entered':_0x9a3fe0,'milestone':_0x4e88e5,'milestone_rate':_0x4e88e5&&_0x9a3fe0?_0x4e88e5/_0x9a3fe0*0x64:0x0,'exit_or_jump':_0x2134a5,'exit_or_jump_rate':_0x2134a5&&_0x9a3fe0?_0x2134a5/_0x9a3fe0*0x64:0x0};}export function assembleJourneyStats(_0x252a62,_0x784ca3){const _0x30a3c2=a131_0x395ca7,_0x5bb506=!!(_0x784ca3?.[_0x30a3c2(0xe8)]||_0x784ca3?.['to'])&&!!_0x252a62[_0x30a3c2(0x143)]?.[_0x30a3c2(0x10d)];if(_0x5bb506){const _0x288f88=aggregateJourneyHistory(_0x252a62[_0x30a3c2(0x143)]),_0x385ab8={'journey_id':_0x252a62[_0x30a3c2(0xed)],..._0x784ca3?.[_0x30a3c2(0xe8)]&&{'from':_0x784ca3['from']},..._0x784ca3?.['to']&&{'to':_0x784ca3['to']},..._0x288f88};return _0x784ca3?.[_0x30a3c2(0xf8)]&&(_0x385ab8[_0x30a3c2(0x143)]=_0x252a62['history']),_0x385ab8;}return{'journey_id':_0x252a62[_0x30a3c2(0xed)],'size':_0x252a62[_0x30a3c2(0xdd)],'entered':_0x252a62[_0x30a3c2(0x119)],'goal_achieved':_0x252a62[_0x30a3c2(0xc9)],'completion_rate':_0x252a62['completionRate'],'exit_or_jump':_0x252a62[_0x30a3c2(0x142)],'exit_or_jump_rate':_0x252a62['exitOrJumpRate']};}export function formatVersionsFromBundle(_0x13492f){const _0x567e48=a131_0x395ca7,_0x531298=_0x13492f[_0x567e48(0x146)][_0x567e48(0x10f)](_0x3161a0=>({'journeyId':_0x3161a0['id'],'versionNumber':_0x3161a0[_0x567e48(0xb8)][_0x567e48(0xbc)]??0x0,'name':_0x3161a0[_0x567e48(0xb8)][_0x567e48(0x104)],'state':_0x3161a0[_0x567e48(0xb8)][_0x567e48(0x107)],'paused':_0x3161a0['attributes'][_0x567e48(0xfb)],'createdAt':_0x3161a0[_0x567e48(0xb8)][_0x567e48(0x13b)],'updatedAt':_0x3161a0['attributes'][_0x567e48(0x10e)]}));return _0x531298[_0x567e48(0xdf)]((_0x120d94,_0x411d51)=>_0x120d94[_0x567e48(0xbc)]-_0x411d51[_0x567e48(0xbc)]),_0x531298;}export function synthesizePreBundleVersion(_0x9f1b6b){const _0x45cd33=a131_0x395ca7;return{'journeyId':_0x9f1b6b['id'],'versionNumber':0x1,'name':_0x9f1b6b['attributes'][_0x45cd33(0x104)],'state':_0x9f1b6b['attributes'][_0x45cd33(0x107)],'paused':_0x9f1b6b[_0x45cd33(0xb8)][_0x45cd33(0xfb)],'createdAt':_0x9f1b6b[_0x45cd33(0xb8)]['createdAt'],'updatedAt':_0x9f1b6b[_0x45cd33(0xb8)][_0x45cd33(0x10e)]};}export function buildStageNameMap(_0x270258){const _0x35c37e=a131_0x395ca7;return new Map(_0x270258['attributes']['journeyStages']?.[_0x35c37e(0x10f)](_0x286273=>[_0x286273['id'],_0x286273[_0x35c37e(0x104)]])??[]);}export class JourneySDK{[a131_0x395ca7(0xe2)];constructor(_0x38c3bb){const _0x5cf805=a131_0x395ca7;this[_0x5cf805(0xe2)]=new CDPApiClient(_0x38c3bb);}['applyVersionDeduplication'](_0x8b13b4,_0x3866a8){return _0x3866a8?_0x8b13b4:deduplicateJourneysByBundle(_0x8b13b4);}async['resolveRootFolderId'](_0xabffac){const _0x1a4f10=a131_0x395ca7,_0x295ca4=await this['client'][_0x1a4f10(0x11f)](_0xabffac);return _0x295ca4['rootFolderId']??undefined;}async[a131_0x395ca7(0xb6)](_0x395c03,_0xf34a01){const _0x5b73e7=a131_0x395ca7;try{const _0x34eb6f=await this[_0x5b73e7(0xe2)][_0x5b73e7(0xb6)](_0x395c03);return{'journeys':this['applyVersionDeduplication'](_0x34eb6f[_0x5b73e7(0x146)],_0xf34a01),'activationStepsById':_0x34eb6f[_0x5b73e7(0xf2)]};}catch(_0x2d445f){if(isHttp404Error(_0x2d445f))return{'journeys':[],'activationStepsById':new Map()};throw _0x2d445f;}}async['listJourneysFromParentSegment'](_0x55ddc4,_0x364400,_0x49497b){const _0x377245=a131_0x395ca7;let _0x504b3f=_0x364400;if(!_0x504b3f)try{_0x504b3f=await this['resolveRootFolderId'](_0x55ddc4);}catch(_0x26f9c4){if(isHttp404Error(_0x26f9c4))return[];throw _0x26f9c4;}if(!_0x504b3f)return[];let _0x4037ab;if(_0x49497b?.[_0x377245(0xdc)])_0x4037ab=await this[_0x377245(0xe2)]['listJourneys'](_0x504b3f);else{const _0x36b60a=await this[_0x377245(0xe2)][_0x377245(0x121)](_0x504b3f,0x20,![]),_0x5ed36f=_0x36b60a[_0x377245(0x10c)],_0x37aa19=_0x5ed36f['filter'](_0x2d0a80=>_0x2d0a80[_0x377245(0x135)]===_0x377245(0xde));_0x4037ab=_0x37aa19[_0x377245(0x10f)](_0x156b2f=>entityToJourneyListItem(_0x156b2f,_0x55ddc4));}return this[_0x377245(0xce)](_0x4037ab,_0x49497b?.[_0x377245(0xdc)]);}async[a131_0x395ca7(0xfe)](_0x55eb2b,_0x589473,_0x5423ca){const _0x9a1789=a131_0x395ca7;if(!_0x589473)return{'journeys':[],'folders':[]};const _0x266c72=await this[_0x9a1789(0xe2)]['listEntitiesByFolder'](_0x589473,0x20,![]),_0x1c0bfd=_0x266c72[_0x9a1789(0x10c)],_0x30c582=_0x1c0bfd[_0x9a1789(0xcf)](_0x1d3f63=>_0x1d3f63[_0x9a1789(0x135)]===_0x9a1789(0x141)&&_0x1d3f63['id']!==_0x589473),_0x523852=_0x30c582[_0x9a1789(0x10f)](_0x55aec6=>({'id':_0x55aec6['id'],'name':_0x55aec6[_0x9a1789(0xb8)][_0x9a1789(0x104)]})),_0x23012f=_0x1c0bfd[_0x9a1789(0xcf)](_0x569e00=>_0x569e00[_0x9a1789(0x135)]===_0x9a1789(0xde)),_0x31da6d=_0x23012f[_0x9a1789(0x10f)](_0x1261a0=>entityToJourneyListItem(_0x1261a0,_0x55eb2b));return{'journeys':this[_0x9a1789(0xce)](_0x31da6d,_0x5423ca?.[_0x9a1789(0xdc)]),'folders':_0x523852};}async[a131_0x395ca7(0xc5)](_0x2c4046,_0x2a0cec){const _0x364b7d=a131_0x395ca7;let _0x3d2bfe;try{_0x3d2bfe=await this[_0x364b7d(0x12e)](_0x2c4046);}catch(_0x321c57){if(isHttp404Error(_0x321c57))return{'journeys':[],'activationStepsById':new Map()};throw _0x321c57;}if(!_0x3d2bfe)return{'journeys':[],'activationStepsById':new Map()};const _0x46f13f=await this[_0x364b7d(0xb6)](_0x3d2bfe,_0x2a0cec?.[_0x364b7d(0xdc)]);return{'journeys':this['applyVersionDeduplication'](_0x46f13f[_0x364b7d(0x146)],_0x2a0cec?.['includeAllVersions']),'activationStepsById':_0x46f13f[_0x364b7d(0xf2)]};}async['getJourney'](_0x1bbb6d){const _0x18e673=a131_0x395ca7;try{return await this['client'][_0x18e673(0xc2)](_0x1bbb6d);}catch(_0x25d1b9){if(isHttp404Error(_0x25d1b9))throw new SDKError(ErrorCode[_0x18e673(0xf1)],_0x18e673(0xe9)+_0x1bbb6d,_0x25d1b9);throw _0x25d1b9;}}async[a131_0x395ca7(0x129)](_0x1b187e,_0x53e115){const _0x5c9866=a131_0x395ca7,_0xd66e7d=await this['listJourneysFromParentSegment'](_0x1b187e),_0x197d28=_0xd66e7d['find'](_0x4c1770=>_0x4c1770[_0x5c9866(0x127)][_0x5c9866(0x144)]()===_0x53e115[_0x5c9866(0x144)]());if(!_0x197d28)throw new SDKError(ErrorCode[_0x5c9866(0xf1)],_0x5c9866(0xe9)+_0x53e115,undefined,{'helpText':_0x5c9866(0x103)});return _0x197d28['id'];}async[a131_0x395ca7(0x134)](_0x1922d4,_0x17e7f0){const _0x37409c=a131_0x395ca7;try{return await this['client'][_0x37409c(0x13a)](_0x1922d4,_0x17e7f0);}catch(_0x2cb571){if(isHttp404Error(_0x2cb571))throw new SDKError(ErrorCode[_0x37409c(0xf1)],'Journey\x20not\x20found:\x20'+_0x1922d4,_0x2cb571);throw _0x2cb571;}}async[a131_0x395ca7(0xd9)](_0x16c21b,_0x227ff7){const _0x21a627=a131_0x395ca7,_0x124280={'from':_0x227ff7?.[_0x21a627(0xe8)],'to':_0x227ff7?.['to'],'limit':_0x227ff7?.[_0x21a627(0x115)]},_0x38f0dd=_0x227ff7?.[_0x21a627(0x135)]!==_0x21a627(0xc6);try{const [_0x590eea,_0x5cff41]=await Promise['all']([this[_0x21a627(0x145)](_0x16c21b,_0x227ff7?.[_0x21a627(0x135)],_0x124280),_0x38f0dd?this[_0x21a627(0xc2)](_0x16c21b):undefined]);if(_0x590eea[_0x21a627(0x108)]&&_0x5cff41){const _0x4f8ad4=buildStageNameMap(_0x5cff41);_0x590eea[_0x21a627(0x108)]=_0x590eea['activation'][_0x21a627(0x10f)](_0x23d0e2=>({..._0x23d0e2,'journeyStageName':_0x4f8ad4[_0x21a627(0xbb)](_0x23d0e2['journeyStageId'])??_0x23d0e2[_0x21a627(0x11e)]}));}return _0x590eea;}catch(_0x17b218){if(isHttp404Error(_0x17b218))throw new SDKError(ErrorCode[_0x21a627(0xf1)],_0x21a627(0xe9)+_0x16c21b,_0x17b218);throw _0x17b218;}}async['fetchTrafficRaw'](_0x34f5c8,_0x287820,_0x292ef3){const _0x47bde3=a131_0x395ca7;if(_0x287820===_0x47bde3(0xc6)){const _0x269562=await this[_0x47bde3(0xe2)][_0x47bde3(0xf0)](_0x34f5c8,_0x292ef3);return{'conversion':_0x269562};}if(_0x287820===_0x47bde3(0x108)){const _0x4cb731=await this[_0x47bde3(0xe2)][_0x47bde3(0x147)](_0x34f5c8,_0x292ef3);return{'activation':_0x4cb731};}const [_0x47c8aa,_0x24d8d4]=await Promise['all']([this[_0x47bde3(0xe2)][_0x47bde3(0xf0)](_0x34f5c8,_0x292ef3),this['client'][_0x47bde3(0x147)](_0x34f5c8,_0x292ef3)]);return{'conversion':_0x47c8aa,'activation':_0x24d8d4};}async[a131_0x395ca7(0xb7)](_0x398735){const _0x17d458=a131_0x395ca7;try{return await this[_0x17d458(0xe2)][_0x17d458(0xc7)](_0x398735);}catch(_0x2ab7a0){if(isHttp404Error(_0x2ab7a0))throw new SDKError(ErrorCode[_0x17d458(0xf1)],_0x17d458(0xe9)+_0x398735,_0x2ab7a0);throw _0x2ab7a0;}}async['resume'](_0xc9847a){const _0x4a549f=a131_0x395ca7;try{return await this['client']['resumeJourney'](_0xc9847a);}catch(_0x139d93){if(isHttp404Error(_0x139d93))throw new SDKError(ErrorCode[_0x4a549f(0xf1)],_0x4a549f(0xe9)+_0xc9847a,_0x139d93);throw _0x139d93;}}async[a131_0x395ca7(0xcc)](_0x633269){const _0x238c44=a131_0x395ca7;return await this[_0x238c44(0xe2)][_0x238c44(0xbf)](_0x633269);}async[a131_0x395ca7(0xeb)](_0x46d1dd,_0x277d63){const _0x69940e=a131_0x395ca7;try{return await this[_0x69940e(0xe2)][_0x69940e(0x137)](_0x46d1dd,_0x277d63);}catch(_0x145739){if(isHttp404Error(_0x145739))throw new SDKError(ErrorCode[_0x69940e(0xf1)],'Journey\x20not\x20found:\x20'+_0x46d1dd,_0x145739);throw _0x145739;}}async[a131_0x395ca7(0x12b)](_0x593202,_0x5f2c88){const _0x2bca40=a131_0x395ca7;try{return await this['client'][_0x2bca40(0x10a)](_0x593202,_0x5f2c88);}catch(_0x4808b2){if(isHttp404Error(_0x4808b2))throw new SDKError(ErrorCode[_0x2bca40(0x101)],_0x2bca40(0x125)+_0x5f2c88+_0x2bca40(0xe3)+_0x593202,_0x4808b2);throw _0x4808b2;}}async[a131_0x395ca7(0xe0)](_0xa80ab1){const _0x42351a=a131_0x395ca7;try{return await this['client'][_0x42351a(0xdb)](_0xa80ab1);}catch(_0xe20117){if(isHttp404Error(_0xe20117))return[];throw _0xe20117;}}async[a131_0x395ca7(0x12a)](_0x146c6c){const _0x3b1ca8=a131_0x395ca7,_0xaed095=await this['listActivations'](_0x146c6c);return _0xaed095[_0x3b1ca8(0x10f)](flattenJourneyActivation);}async[a131_0x395ca7(0xb9)](_0x41ca4a,_0x2b38a2){const _0x495961=a131_0x395ca7;return await this['client'][_0x495961(0xf5)](_0x41ca4a,_0x2b38a2);}async[a131_0x395ca7(0xc8)](_0x5d3f4d){const _0x12d452=a131_0x395ca7,_0x3607a9=await this['getJourney'](_0x5d3f4d),_0xe2ecc4=generateColumnMapping(_0x3607a9);return{'journeyId':_0x3607a9['id'],'journeyName':_0x3607a9[_0x12d452(0xb8)][_0x12d452(0x104)],'database':'cdp_audience_'+_0x3607a9[_0x12d452(0xb8)][_0x12d452(0xc0)],'table':'journey_'+_0x3607a9['id'],'columns':_0xe2ecc4};}async[a131_0x395ca7(0xcb)](_0x22814b){const _0x5c3464=a131_0x395ca7;return this['client'][_0x5c3464(0x120)](_0x22814b);}async['getLatestJourneyId'](_0x30de7f){const _0x568264=a131_0x395ca7;if(!_0x30de7f)return undefined;try{const _0x52ee50=await this[_0x568264(0xcb)](_0x30de7f);return _0x52ee50[_0x568264(0x138)];}catch{return undefined;}}async[a131_0x395ca7(0x118)](_0x3f1561){const _0x4dfba0=a131_0x395ca7,_0x20b9bc=await this[_0x4dfba0(0xc2)](_0x3f1561),_0x30df31=_0x20b9bc['attributes'][_0x4dfba0(0x12d)];if(!_0x30df31)return{'bundleId':'','bundleName':_0x20b9bc[_0x4dfba0(0xb8)][_0x4dfba0(0x104)],'bundleDescription':_0x20b9bc[_0x4dfba0(0xb8)][_0x4dfba0(0xbd)]??null,'latestJourneyId':_0x20b9bc['id'],'versions':[synthesizePreBundleVersion(_0x20b9bc)]};const _0x80dbb0=await this[_0x4dfba0(0xcb)](_0x30df31);return{'bundleId':_0x30df31,'bundleName':_0x80dbb0[_0x4dfba0(0x104)],'bundleDescription':_0x80dbb0[_0x4dfba0(0xbd)]??null,'latestJourneyId':_0x80dbb0[_0x4dfba0(0x138)],'versions':formatVersionsFromBundle(_0x80dbb0)};}async[a131_0x395ca7(0x112)](_0x4e1931){const _0x43bca0=a131_0x395ca7,_0x6bc1c=await this[_0x43bca0(0xc2)](_0x4e1931),_0x1f18c7=_0x6bc1c[_0x43bca0(0xb8)][_0x43bca0(0x12d)];if(!_0x1f18c7)throw new SDKError(ErrorCode[_0x43bca0(0xfd)],'Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle');await this[_0x43bca0(0xe2)]['checkJourneyAppendable'](_0x1f18c7);const _0x5973b2=await this[_0x43bca0(0xe2)][_0x43bca0(0x120)](_0x1f18c7),_0x431fa8=_0x5973b2[_0x43bca0(0x104)]+'\x20v'+(_0x5973b2[_0x43bca0(0xf9)]+0x1);return this[_0x43bca0(0xe2)][_0x43bca0(0x130)](_0x1f18c7,{'sourceId':_0x4e1931,'attributes':{'name':_0x431fa8}});}}
|
|
1
|
+
const a131_0x94ad40=a131_0x5823;(function(_0x25b5f2,_0x32b990){const _0x5befca=a131_0x5823,_0x1a3b2f=_0x25b5f2();while(!![]){try{const _0x42072f=parseInt(_0x5befca(0x106))/0x1+-parseInt(_0x5befca(0x156))/0x2+parseInt(_0x5befca(0x110))/0x3+parseInt(_0x5befca(0x116))/0x4+parseInt(_0x5befca(0x13e))/0x5*(parseInt(_0x5befca(0x151))/0x6)+parseInt(_0x5befca(0xe5))/0x7*(parseInt(_0x5befca(0x126))/0x8)+parseInt(_0x5befca(0x15c))/0x9*(-parseInt(_0x5befca(0xeb))/0xa);if(_0x42072f===_0x32b990)break;else _0x1a3b2f['push'](_0x1a3b2f['shift']());}catch(_0x165b04){_0x1a3b2f['push'](_0x1a3b2f['shift']());}}}(a131_0x1fc5,0xc5e05));import{CDPApiClient}from'./client/cdp-api-client.js';function a131_0x5823(_0x23350f,_0x153e6e){_0x23350f=_0x23350f-0xd6;const _0x1fc547=a131_0x1fc5();let _0x5823d4=_0x1fc547[_0x23350f];return _0x5823d4;}import{SDKError,ErrorCode,isHttp404Error}from'./errors.js';function getBundleId(_0x40edee){const _0x307bd1=a131_0x5823;return _0x40edee['journeyBundleId']??_0x40edee[_0x307bd1(0x163)]?.['journeyBundleId']??undefined;}function getVersionNumber(_0x5d2975){const _0x314a6c=a131_0x5823;return _0x5d2975[_0x314a6c(0x120)]??_0x5d2975[_0x314a6c(0x163)]?.[_0x314a6c(0x120)]??0x0;}function getState(_0xb98731){const _0x47ecc9=a131_0x5823;return _0xb98731[_0x47ecc9(0x13f)]??_0xb98731[_0x47ecc9(0x163)]?.[_0x47ecc9(0x13f)];}export function deduplicateJourneysByBundle(_0x2fabd1){const _0x49747b=a131_0x5823,_0x18398d=new Map();let _0x5ae7b9=0x0;for(const _0xf50d38 of _0x2fabd1){const _0x3599d6=getBundleId(_0xf50d38);if(!_0x3599d6){const _0x15c691=_0x49747b(0x129)+(_0xf50d38['id']??_0x49747b(0x150)+_0x5ae7b9++);_0x18398d['set'](_0x15c691,_0xf50d38);continue;}const _0x499149=_0x18398d[_0x49747b(0xe7)](_0x3599d6);if(!_0x499149)_0x18398d[_0x49747b(0x12b)](_0x3599d6,_0xf50d38);else{const _0x57251a=getState(_0x499149)==='launched',_0x1eafa8=getState(_0xf50d38)===_0x49747b(0x15e);if(_0x1eafa8&&!_0x57251a)_0x18398d[_0x49747b(0x12b)](_0x3599d6,_0xf50d38);else{if(!_0x1eafa8&&_0x57251a){}else{const _0x4790e1=getVersionNumber(_0x499149),_0x436e3c=getVersionNumber(_0xf50d38);_0x436e3c>_0x4790e1&&_0x18398d['set'](_0x3599d6,_0xf50d38);}}}}return Array[_0x49747b(0x13d)](_0x18398d[_0x49747b(0x123)]());}const VALID_JOURNEY_STATES=new Set([a131_0x94ad40(0xfb),'simulation',a131_0x94ad40(0x15e)]);export function parseJourneyState(_0x38b9db){const _0xeb2fe8=a131_0x94ad40;if(typeof _0x38b9db===_0xeb2fe8(0x105)&&VALID_JOURNEY_STATES[_0xeb2fe8(0x149)](_0x38b9db))return _0x38b9db;return'draft';}export function entityToJourneyListItem(_0xb6352a,_0x45c65e){const _0x39e166=a131_0x94ad40,_0x48418f=_0xb6352a[_0x39e166(0x163)];return{'id':_0xb6352a['id'],'name':_0x48418f[_0x39e166(0xe8)]??'','journeyBundleName':_0x48418f['journeyBundleName']??_0x48418f[_0x39e166(0xe8)]??'','journeyBundleId':_0x48418f[_0x39e166(0x13b)]??'','versionNumber':_0x48418f[_0x39e166(0x120)],'description':_0x48418f[_0x39e166(0xed)]??null,'state':parseJourneyState(_0x48418f[_0x39e166(0x13f)]),'paused':_0x48418f[_0x39e166(0xf5)]??![],'audienceId':_0x45c65e,'folderId':_0x48418f[_0x39e166(0x12d)]??_0xb6352a['relationships']?.['parentFolder']?.[_0x39e166(0x152)]?.['id']??null,'createdAt':_0x48418f[_0x39e166(0xf0)]??'','updatedAt':_0x48418f[_0x39e166(0x158)]??''};}function convertToColumnId(_0x5ba56d){const _0x2080fe=a131_0x94ad40;return _0x5ba56d[_0x2080fe(0x102)](/-/g,'_');}function getStepEntries(_0x36eba7){const _0x51b503=a131_0x94ad40;if(!_0x36eba7)return[];if(Array[_0x51b503(0x15a)](_0x36eba7))return _0x36eba7[_0x51b503(0x142)](_0x6879d4=>[_0x6879d4['id'],_0x6879d4]);return Object[_0x51b503(0x11e)](_0x36eba7);}export function flattenJourneyActivation(_0x56b51a){const {activationParams:_0x29d1be,activationId:_0x32ca7f,runAfterJourneyRefresh:_0x3fcf2e}=_0x56b51a['attributes'];return{'id':_0x56b51a['id'],'activationId':_0x32ca7f,'runAfterJourneyRefresh':_0x3fcf2e,..._0x29d1be};}function col(_0x16185f,_0x4ea76d={}){const _0x324f1f=a131_0x94ad40;return{'column':_0x16185f,'direction':null,'stageIndex':null,'stageName':null,'category':_0x324f1f(0xd9),'stepType':null,'stepName':null,'stepId':null,'detail':null,..._0x4ea76d};}function a131_0x1fc5(){const _0x1f2feb=['_exit_','has','folder-segment','createActivation','history','DecisionPoint','NOT_FOUND','journeyId','idx-','4865730UXQorE','data','branch','listJourneysWithFolders','resolveRootFolderId','2643554BrWGJD','entryInflux','updatedAt','stage','isArray','conditions','15656445czMFyJ','includeAllVersions','launched','completionRate','applyVersionDeduplication','listActivationsFlat','waitCondition','attributes','getActivationSankeyChart','resume','getActivation','limit','fixed','resolveJourneyId','activation','intime_goal','getBundle','variants','getParentSegmentFull','length','getConversionSankeyChart','journey_','listJourneysFromParentSegment','journey','1673wjestq','journeys','get','name','journeyStageId','client','10OGvdtM','segmentId','description','getJourney','JOURNEY_NOT_FOUND','createdAt','resumeJourney','goalInflux','getJourneyStatistics','excluded','paused','latestJourneyId','journeyStages','reduce','createJourney','listEntitiesByFolder','draft','audienceId','journeyBundleName','listJourneysWithDetails','size','filter','Journey\x20not\x20found:\x20','replace','exitInflux','exit_criteria','string','726232DbyVbV','enteredSize','createVersion','intime_stage_','exitOrJumpRate','time','createJourneyVersion','conditionSegmentId','cdp_customer_id','update','1411227YqrceJ','Excluded\x20profiles','type','milestoneInflux','step','Cannot\x20create\x20a\x20new\x20version:\x20this\x20journey\x20does\x20not\x20belong\x20to\x20a\x20bundle','3196256dJbDzX','fetchTrafficRaw','branches','conversion','timedOutPath','lastVersionNumber','WaitStep','Wait','entries','push','versionNumber','out','getColumnMapping','values','goal','createJourneyActivation','35656mFRKll','cdp_audience_','listActivations','no-bundle-','includeHistory','set','Journey\x20activation\x20step\x20not\x20found:\x20','segmentFolderId','rootFolderId','listVersions','AbTest','getTrafficData','activationStepsById','milestone','exitCriteria','find','getJourneyBundle','outtime_stage_','sort','listJourneysWithDetailsFromParentSegment','getLatestJourneyId','journeyBundleId','toLowerCase','from','5ZCnBmo','state','steps','outtime_journey','map','checkJourneyAppendable','getJourneyActivation','pauseJourney','pause','variant'];a131_0x1fc5=function(){return _0x1f2feb;};return a131_0x1fc5();}export function generateColumnMapping(_0xe23ac6){const _0x30736a=a131_0x94ad40,_0x312a74=[];_0x312a74[_0x30736a(0x11f)](col(_0x30736a(0x10e))),_0x312a74[_0x30736a(0x11f)](col('intime_journey',{'direction':'in','category':_0x30736a(0xe4)})),_0x312a74['push'](col(_0x30736a(0x141),{'direction':'out','category':_0x30736a(0xe4)}));_0xe23ac6[_0x30736a(0x163)][_0x30736a(0x124)]&&_0x312a74[_0x30736a(0x11f)](col(_0x30736a(0xdc),{'direction':'in','category':_0x30736a(0x124),'detail':_0xe23ac6['attributes'][_0x30736a(0x124)][_0x30736a(0xe8)]||null}));const _0x3ee7d9=_0xe23ac6['attributes'][_0x30736a(0xf7)]||[];for(let _0x177529=0x0;_0x177529<_0x3ee7d9[_0x30736a(0xe0)];_0x177529++){const _0x4e21d1=_0x3ee7d9[_0x177529],_0x577037=_0x4e21d1[_0x30736a(0xe8)],_0x16d733={'stageIndex':_0x177529,'stageName':_0x577037},_0x119d2f=_0x4e21d1['entryCriteria']?.[_0x30736a(0xe8)]||null;_0x312a74['push'](col(_0x30736a(0x109)+_0x177529,{..._0x16d733,'direction':'in','category':_0x30736a(0x159),'detail':_0x119d2f})),_0x312a74[_0x30736a(0x11f)](col('outtime_stage_'+_0x177529,{..._0x16d733,'direction':'out','category':'stage','detail':_0x119d2f}));_0x4e21d1[_0x30736a(0x133)]&&_0x312a74['push'](col('intime_stage_'+_0x177529+'_milestone',{..._0x16d733,'direction':'in','category':_0x30736a(0x133),'detail':_0x4e21d1[_0x30736a(0x133)][_0x30736a(0xe8)]||null}));const _0x58c90a=_0x4e21d1['exitCriterias']||_0x4e21d1[_0x30736a(0x134)]||[];for(let _0x4de4da=0x0;_0x4de4da<_0x58c90a[_0x30736a(0xe0)];_0x4de4da++){_0x312a74[_0x30736a(0x11f)](col(_0x30736a(0x109)+_0x177529+_0x30736a(0x148)+_0x4de4da,{..._0x16d733,'direction':'in','category':_0x30736a(0x104),'detail':_0x58c90a[_0x4de4da][_0x30736a(0xe8)]||null}));}const _0x5c028c=getStepEntries(_0x4e21d1[_0x30736a(0x140)]);for(const [_0x2e9681,_0x52aff8]of _0x5c028c){const _0x154722=convertToColumnId(_0x2e9681),_0x528928=_0x52aff8[_0x30736a(0x112)]||null,_0x137fa5=_0x52aff8[_0x30736a(0xe8)]||null,_0x1cf5cd={..._0x16d733,'stepType':_0x528928,'stepName':_0x137fa5,'stepId':_0x2e9681};_0x312a74[_0x30736a(0x11f)](col(_0x30736a(0x109)+_0x177529+'_'+_0x154722,{..._0x1cf5cd,'direction':'in','category':'step'})),_0x312a74['push'](col(_0x30736a(0x137)+_0x177529+'_'+_0x154722,{..._0x1cf5cd,'direction':_0x30736a(0x121),'category':_0x30736a(0x114)}));if(_0x52aff8[_0x30736a(0x112)]===_0x30736a(0x14d)&&_0x52aff8[_0x30736a(0x118)])for(const _0x12ee47 of _0x52aff8['branches']){_0x12ee47[_0x30736a(0xec)]&&_0x312a74[_0x30736a(0x11f)](col('intime_stage_'+_0x177529+'_'+_0x154722+'_'+_0x12ee47[_0x30736a(0xec)],{..._0x1cf5cd,'direction':'in','category':_0x30736a(0x153),'detail':_0x12ee47[_0x30736a(0xe8)]||(_0x12ee47[_0x30736a(0xf4)]?_0x30736a(0x111):null)}));}if((_0x52aff8[_0x30736a(0x112)]===_0x30736a(0x130)||_0x52aff8[_0x30736a(0x112)]==='ABTest')&&_0x52aff8[_0x30736a(0xde)])for(const _0x45df7f of _0x52aff8['variants']){_0x45df7f['id']&&_0x312a74['push'](col(_0x30736a(0x109)+_0x177529+'_'+_0x154722+'_variant_'+convertToColumnId(_0x45df7f['id']),{..._0x1cf5cd,'direction':'in','category':_0x30736a(0x147),'detail':_0x45df7f[_0x30736a(0xe8)]||null}));}if(_0x52aff8[_0x30736a(0x112)]===_0x30736a(0x11c)||_0x52aff8[_0x30736a(0x112)]===_0x30736a(0x11d)){const _0x1d77c7=[];if(_0x52aff8[_0x30736a(0x10d)])_0x1d77c7[_0x30736a(0x11f)](_0x52aff8[_0x30736a(0x10d)]);else{if(Array[_0x30736a(0x15a)](_0x52aff8[_0x30736a(0x15b)]))for(const _0x2bd8ed of _0x52aff8['conditions']){_0x2bd8ed[_0x30736a(0xec)]&&!_0x2bd8ed[_0x30736a(0x11a)]&&_0x1d77c7['push'](_0x2bd8ed[_0x30736a(0xec)]);}else _0x52aff8['waitCondition']?.[_0x30736a(0xec)]&&_0x1d77c7[_0x30736a(0x11f)](_0x52aff8[_0x30736a(0x162)][_0x30736a(0xec)]);}for(const _0x5768cd of _0x1d77c7){_0x312a74['push'](col(_0x30736a(0x109)+_0x177529+'_'+_0x154722+'_'+_0x5768cd,{..._0x1cf5cd,'direction':'in','category':_0x30736a(0x153)}));}}}}return _0x312a74[_0x30736a(0x11f)](col(_0x30736a(0x10b))),_0x312a74;}export function aggregateJourneyHistory(_0x4eb9dd){const _0x6ec22e=a131_0x94ad40,_0x5d2f47=_0x4eb9dd[_0x6ec22e(0xf8)]((_0x56e3e5,_0x2f4c0c)=>_0x56e3e5+(_0x2f4c0c[_0x6ec22e(0x157)]??0x0),0x0),_0x10ad32=_0x4eb9dd[_0x6ec22e(0xf8)]((_0x209f3d,_0x4af925)=>_0x209f3d+(_0x4af925[_0x6ec22e(0xf2)]??0x0),0x0),_0x219048=_0x4eb9dd[_0x6ec22e(0xf8)]((_0x19c92a,_0x19924c)=>_0x19c92a+((_0x19924c[_0x6ec22e(0x103)]??0x0)+(_0x19924c['jumpInflux']??0x0)),0x0),_0x4e8700=_0x4eb9dd[_0x4eb9dd[_0x6ec22e(0xe0)]-0x1];return{'size':_0x4e8700?.['size']??0x0,'entered':_0x5d2f47,'goal_achieved':_0x10ad32,'completion_rate':_0x10ad32&&_0x5d2f47?_0x10ad32/_0x5d2f47*0x64:0x0,'exit_or_jump':_0x219048,'exit_or_jump_rate':_0x219048&&_0x5d2f47?_0x219048/_0x5d2f47*0x64:0x0};}export function aggregateStageHistory(_0x5e3054){const _0xfe6964=a131_0x94ad40,_0x462110=_0x5e3054[_0xfe6964(0xf8)]((_0x86bc06,_0x1aa0f8)=>_0x86bc06+(_0x1aa0f8[_0xfe6964(0x157)]??0x0),0x0),_0x51b5d4=_0x5e3054['reduce']((_0x2d6e2f,_0x4947cd)=>_0x2d6e2f+(_0x4947cd[_0xfe6964(0x113)]??0x0),0x0),_0x5f7e99=_0x5e3054[_0xfe6964(0xf8)]((_0x4eb6ca,_0x37420a)=>_0x4eb6ca+((_0x37420a['exitInflux']??0x0)+(_0x37420a['jumpInflux']??0x0)),0x0),_0x22755f=_0x5e3054[_0x5e3054[_0xfe6964(0xe0)]-0x1];return{'size':_0x22755f?.[_0xfe6964(0xff)]??0x0,'entered':_0x462110,'milestone':_0x51b5d4,'milestone_rate':_0x51b5d4&&_0x462110?_0x51b5d4/_0x462110*0x64:0x0,'exit_or_jump':_0x5f7e99,'exit_or_jump_rate':_0x5f7e99&&_0x462110?_0x5f7e99/_0x462110*0x64:0x0};}export function assembleJourneyStats(_0x3c7b01,_0x5cd35e){const _0x419adb=a131_0x94ad40,_0x3d5a4b=!!(_0x5cd35e?.[_0x419adb(0x13d)]||_0x5cd35e?.['to'])&&!!_0x3c7b01[_0x419adb(0x14c)]?.[_0x419adb(0xe0)];if(_0x3d5a4b){const _0x41cf55=aggregateJourneyHistory(_0x3c7b01['history']),_0x39fe44={'journey_id':_0x3c7b01[_0x419adb(0x14f)],..._0x5cd35e?.[_0x419adb(0x13d)]&&{'from':_0x5cd35e[_0x419adb(0x13d)]},..._0x5cd35e?.['to']&&{'to':_0x5cd35e['to']},..._0x41cf55};return _0x5cd35e?.[_0x419adb(0x12a)]&&(_0x39fe44[_0x419adb(0x14c)]=_0x3c7b01[_0x419adb(0x14c)]),_0x39fe44;}return{'journey_id':_0x3c7b01[_0x419adb(0x14f)],'size':_0x3c7b01[_0x419adb(0xff)],'entered':_0x3c7b01[_0x419adb(0x107)],'goal_achieved':_0x3c7b01['goalSize'],'completion_rate':_0x3c7b01[_0x419adb(0x15f)],'exit_or_jump':_0x3c7b01['exitOrJumpSize'],'exit_or_jump_rate':_0x3c7b01[_0x419adb(0x10a)]};}export function formatVersionsFromBundle(_0x4c1374){const _0x327ab5=a131_0x94ad40,_0x55ccf9=_0x4c1374['journeys'][_0x327ab5(0x142)](_0x59b272=>({'journeyId':_0x59b272['id'],'versionNumber':_0x59b272[_0x327ab5(0x163)]['versionNumber']??0x0,'name':_0x59b272[_0x327ab5(0x163)][_0x327ab5(0xe8)],'state':_0x59b272[_0x327ab5(0x163)][_0x327ab5(0x13f)],'paused':_0x59b272['attributes'][_0x327ab5(0xf5)],'createdAt':_0x59b272[_0x327ab5(0x163)][_0x327ab5(0xf0)],'updatedAt':_0x59b272[_0x327ab5(0x163)][_0x327ab5(0x158)]}));return _0x55ccf9[_0x327ab5(0x138)]((_0x4c782e,_0x572d7b)=>_0x4c782e['versionNumber']-_0x572d7b['versionNumber']),_0x55ccf9;}export function synthesizePreBundleVersion(_0x3ba46f){const _0x5960e9=a131_0x94ad40;return{'journeyId':_0x3ba46f['id'],'versionNumber':0x1,'name':_0x3ba46f[_0x5960e9(0x163)][_0x5960e9(0xe8)],'state':_0x3ba46f[_0x5960e9(0x163)][_0x5960e9(0x13f)],'paused':_0x3ba46f[_0x5960e9(0x163)][_0x5960e9(0xf5)],'createdAt':_0x3ba46f['attributes'][_0x5960e9(0xf0)],'updatedAt':_0x3ba46f[_0x5960e9(0x163)][_0x5960e9(0x158)]};}export function buildStageNameMap(_0x370554){const _0x33c8c8=a131_0x94ad40;return new Map(_0x370554[_0x33c8c8(0x163)][_0x33c8c8(0xf7)]?.[_0x33c8c8(0x142)](_0x33c67b=>[_0x33c67b['id'],_0x33c67b[_0x33c8c8(0xe8)]])??[]);}export class JourneySDK{[a131_0x94ad40(0xea)];constructor(_0x44e8e6){const _0x1630d4=a131_0x94ad40;this[_0x1630d4(0xea)]=new CDPApiClient(_0x44e8e6);}[a131_0x94ad40(0x160)](_0x4bfabb,_0x4058b7){return _0x4058b7?_0x4bfabb:deduplicateJourneysByBundle(_0x4bfabb);}async[a131_0x94ad40(0x155)](_0x36acf7){const _0x2f01a5=a131_0x94ad40,_0x3c0daf=await this['client'][_0x2f01a5(0xdf)](_0x36acf7);return _0x3c0daf[_0x2f01a5(0x12e)]??undefined;}async[a131_0x94ad40(0xfe)](_0x209ad4,_0x3a0129){const _0x23c5d5=a131_0x94ad40;try{const _0x24eecc=await this[_0x23c5d5(0xea)]['listJourneysWithDetails'](_0x209ad4);return{'journeys':this[_0x23c5d5(0x160)](_0x24eecc[_0x23c5d5(0xe6)],_0x3a0129),'activationStepsById':_0x24eecc['activationStepsById']};}catch(_0x4ecebc){if(isHttp404Error(_0x4ecebc))return{'journeys':[],'activationStepsById':new Map()};throw _0x4ecebc;}}async[a131_0x94ad40(0xe3)](_0x57a1f5,_0x35dcb9,_0x3baf80){const _0x21c8d8=a131_0x94ad40;let _0xa9006a=_0x35dcb9;if(!_0xa9006a)try{_0xa9006a=await this[_0x21c8d8(0x155)](_0x57a1f5);}catch(_0x57e192){if(isHttp404Error(_0x57e192))return[];throw _0x57e192;}if(!_0xa9006a)return[];let _0x5cca95;if(_0x3baf80?.[_0x21c8d8(0x15d)])_0x5cca95=await this[_0x21c8d8(0xea)]['listJourneys'](_0xa9006a);else{const _0x58c89b=await this[_0x21c8d8(0xea)][_0x21c8d8(0xfa)](_0xa9006a,0x20,![]),_0x2f4d40=_0x58c89b['data'],_0x1b2277=_0x2f4d40['filter'](_0x55a4f5=>_0x55a4f5['type']===_0x21c8d8(0xe4));_0x5cca95=_0x1b2277[_0x21c8d8(0x142)](_0x3bfefb=>entityToJourneyListItem(_0x3bfefb,_0x57a1f5));}return this['applyVersionDeduplication'](_0x5cca95,_0x3baf80?.[_0x21c8d8(0x15d)]);}async[a131_0x94ad40(0x154)](_0x497620,_0x26967c,_0x31e863){const _0x102497=a131_0x94ad40;if(!_0x26967c)return{'journeys':[],'folders':[]};const _0xc67f7d=await this['client'][_0x102497(0xfa)](_0x26967c,0x20,![]),_0xdf9a7=_0xc67f7d[_0x102497(0x152)],_0x2cfd22=_0xdf9a7[_0x102497(0x100)](_0x5ae354=>_0x5ae354[_0x102497(0x112)]===_0x102497(0x14a)&&_0x5ae354['id']!==_0x26967c),_0x34642b=_0x2cfd22['map'](_0x1dbea5=>({'id':_0x1dbea5['id'],'name':_0x1dbea5[_0x102497(0x163)][_0x102497(0xe8)]})),_0x2b862a=_0xdf9a7['filter'](_0x3ff5b5=>_0x3ff5b5[_0x102497(0x112)]==='journey'),_0x6de54e=_0x2b862a['map'](_0x22795d=>entityToJourneyListItem(_0x22795d,_0x497620));return{'journeys':this[_0x102497(0x160)](_0x6de54e,_0x31e863?.['includeAllVersions']),'folders':_0x34642b};}async[a131_0x94ad40(0x139)](_0x1b17da,_0x4a8ebc){const _0x52bb0b=a131_0x94ad40;let _0x47fb5d;try{_0x47fb5d=await this['resolveRootFolderId'](_0x1b17da);}catch(_0x3741cb){if(isHttp404Error(_0x3741cb))return{'journeys':[],'activationStepsById':new Map()};throw _0x3741cb;}if(!_0x47fb5d)return{'journeys':[],'activationStepsById':new Map()};const _0x520837=await this[_0x52bb0b(0xfe)](_0x47fb5d,_0x4a8ebc?.['includeAllVersions']);return{'journeys':this['applyVersionDeduplication'](_0x520837[_0x52bb0b(0xe6)],_0x4a8ebc?.[_0x52bb0b(0x15d)]),'activationStepsById':_0x520837[_0x52bb0b(0x132)]};}async[a131_0x94ad40(0xee)](_0x10ef03){const _0x514126=a131_0x94ad40;try{return await this[_0x514126(0xea)][_0x514126(0xee)](_0x10ef03);}catch(_0x33c555){if(isHttp404Error(_0x33c555))throw new SDKError(ErrorCode[_0x514126(0xef)],_0x514126(0x101)+_0x10ef03,_0x33c555);throw _0x33c555;}}async[a131_0x94ad40(0xda)](_0x2ca57a,_0x1ae92c){const _0x5ee946=a131_0x94ad40,_0x142799=await this[_0x5ee946(0xe3)](_0x2ca57a),_0x31f890=_0x142799[_0x5ee946(0x135)](_0x2c02c7=>_0x2c02c7[_0x5ee946(0xfd)][_0x5ee946(0x13c)]()===_0x1ae92c[_0x5ee946(0x13c)]());if(!_0x31f890)throw new SDKError(ErrorCode[_0x5ee946(0xef)],_0x5ee946(0x101)+_0x1ae92c,undefined,{'helpText':'Use\x20\x22tdx\x20journey\x20list\x22\x20to\x20see\x20available\x20journeys'});return _0x31f890['id'];}async['getStatistics'](_0x8a3530,_0x487a82){const _0x56ff72=a131_0x94ad40;try{return await this[_0x56ff72(0xea)][_0x56ff72(0xf3)](_0x8a3530,_0x487a82);}catch(_0x21c177){if(isHttp404Error(_0x21c177))throw new SDKError(ErrorCode[_0x56ff72(0xef)],_0x56ff72(0x101)+_0x8a3530,_0x21c177);throw _0x21c177;}}async[a131_0x94ad40(0x131)](_0x3401a5,_0x283e8d){const _0x14e6de=a131_0x94ad40,_0x5550f9={'from':_0x283e8d?.['from'],'to':_0x283e8d?.['to'],'limit':_0x283e8d?.[_0x14e6de(0xd8)]},_0x444284=_0x283e8d?.['type']!=='conversion';try{const [_0x3e7580,_0x494d9a]=await Promise['all']([this[_0x14e6de(0x117)](_0x3401a5,_0x283e8d?.[_0x14e6de(0x112)],_0x5550f9),_0x444284?this[_0x14e6de(0xee)](_0x3401a5):undefined]);if(_0x3e7580[_0x14e6de(0xdb)]&&_0x494d9a){const _0x366872=buildStageNameMap(_0x494d9a);_0x3e7580[_0x14e6de(0xdb)]=_0x3e7580[_0x14e6de(0xdb)][_0x14e6de(0x142)](_0x2e5af5=>({..._0x2e5af5,'journeyStageName':_0x366872[_0x14e6de(0xe7)](_0x2e5af5[_0x14e6de(0xe9)])??_0x2e5af5['journeyStageId']}));}return _0x3e7580;}catch(_0xd73210){if(isHttp404Error(_0xd73210))throw new SDKError(ErrorCode[_0x14e6de(0xef)],_0x14e6de(0x101)+_0x3401a5,_0xd73210);throw _0xd73210;}}async[a131_0x94ad40(0x117)](_0x1a8efa,_0x4f108f,_0x291df8){const _0x59c369=a131_0x94ad40;if(_0x4f108f===_0x59c369(0x119)){const _0x19ad53=await this[_0x59c369(0xea)][_0x59c369(0xe1)](_0x1a8efa,_0x291df8);return{'conversion':_0x19ad53};}if(_0x4f108f===_0x59c369(0xdb)){const _0x252695=await this[_0x59c369(0xea)][_0x59c369(0x164)](_0x1a8efa,_0x291df8);return{'activation':_0x252695};}const [_0x3f85bb,_0x40cd86]=await Promise['all']([this[_0x59c369(0xea)][_0x59c369(0xe1)](_0x1a8efa,_0x291df8),this[_0x59c369(0xea)][_0x59c369(0x164)](_0x1a8efa,_0x291df8)]);return{'conversion':_0x3f85bb,'activation':_0x40cd86};}async[a131_0x94ad40(0x146)](_0x5943c3){const _0x49077e=a131_0x94ad40;try{return await this['client'][_0x49077e(0x145)](_0x5943c3);}catch(_0x52f08e){if(isHttp404Error(_0x52f08e))throw new SDKError(ErrorCode[_0x49077e(0xef)],'Journey\x20not\x20found:\x20'+_0x5943c3,_0x52f08e);throw _0x52f08e;}}async[a131_0x94ad40(0xd6)](_0x54d29d){const _0x19d9e0=a131_0x94ad40;try{return await this[_0x19d9e0(0xea)][_0x19d9e0(0xf1)](_0x54d29d);}catch(_0x505857){if(isHttp404Error(_0x505857))throw new SDKError(ErrorCode[_0x19d9e0(0xef)],_0x19d9e0(0x101)+_0x54d29d,_0x505857);throw _0x505857;}}async['create'](_0x42a200){const _0x12d427=a131_0x94ad40;return await this[_0x12d427(0xea)][_0x12d427(0xf9)](_0x42a200);}async[a131_0x94ad40(0x10f)](_0x4a5da3,_0x462f92){const _0x5dd475=a131_0x94ad40;try{return await this[_0x5dd475(0xea)]['updateJourney'](_0x4a5da3,_0x462f92);}catch(_0x108343){if(isHttp404Error(_0x108343))throw new SDKError(ErrorCode[_0x5dd475(0xef)],_0x5dd475(0x101)+_0x4a5da3,_0x108343);throw _0x108343;}}async[a131_0x94ad40(0xd7)](_0x1c2f54,_0x7d3607){const _0x4e272b=a131_0x94ad40;try{return await this[_0x4e272b(0xea)][_0x4e272b(0x144)](_0x1c2f54,_0x7d3607);}catch(_0x193cca){if(isHttp404Error(_0x193cca))throw new SDKError(ErrorCode[_0x4e272b(0x14e)],_0x4e272b(0x12c)+_0x7d3607+'\x20in\x20journey\x20'+_0x1c2f54,_0x193cca);throw _0x193cca;}}async['listActivations'](_0x5d1f2c){const _0x99bdb9=a131_0x94ad40;try{return await this[_0x99bdb9(0xea)]['listJourneyActivations'](_0x5d1f2c);}catch(_0x228827){if(isHttp404Error(_0x228827))return[];throw _0x228827;}}async[a131_0x94ad40(0x161)](_0x51da27){const _0x3b681c=a131_0x94ad40,_0x4755c1=await this[_0x3b681c(0x128)](_0x51da27);return _0x4755c1[_0x3b681c(0x142)](flattenJourneyActivation);}async[a131_0x94ad40(0x14b)](_0x8e4be1,_0xea1f69){const _0x1a9a45=a131_0x94ad40;return await this[_0x1a9a45(0xea)][_0x1a9a45(0x125)](_0x8e4be1,_0xea1f69);}async[a131_0x94ad40(0x122)](_0x1016fa){const _0x552f82=a131_0x94ad40,_0x5e112a=await this[_0x552f82(0xee)](_0x1016fa),_0x27475d=generateColumnMapping(_0x5e112a);return{'journeyId':_0x5e112a['id'],'journeyName':_0x5e112a['attributes']['name'],'database':_0x552f82(0x127)+_0x5e112a[_0x552f82(0x163)][_0x552f82(0xfc)],'table':_0x552f82(0xe2)+_0x5e112a['id'],'columns':_0x27475d};}async[a131_0x94ad40(0xdd)](_0x4d36ec){const _0x414392=a131_0x94ad40;return this[_0x414392(0xea)]['getJourneyBundle'](_0x4d36ec);}async[a131_0x94ad40(0x13a)](_0x796fdb){const _0x145101=a131_0x94ad40;if(!_0x796fdb)return undefined;try{const _0xd6f97e=await this['getBundle'](_0x796fdb);return _0xd6f97e[_0x145101(0xf6)];}catch{return undefined;}}async[a131_0x94ad40(0x12f)](_0x4605a7){const _0x195836=a131_0x94ad40,_0x5ec5f8=await this['getJourney'](_0x4605a7),_0x204dd7=_0x5ec5f8[_0x195836(0x163)][_0x195836(0x13b)];if(!_0x204dd7)return{'bundleId':'','bundleName':_0x5ec5f8[_0x195836(0x163)][_0x195836(0xe8)],'bundleDescription':_0x5ec5f8['attributes'][_0x195836(0xed)]??null,'latestJourneyId':_0x5ec5f8['id'],'versions':[synthesizePreBundleVersion(_0x5ec5f8)]};const _0x271e4d=await this[_0x195836(0xdd)](_0x204dd7);return{'bundleId':_0x204dd7,'bundleName':_0x271e4d['name'],'bundleDescription':_0x271e4d[_0x195836(0xed)]??null,'latestJourneyId':_0x271e4d[_0x195836(0xf6)],'versions':formatVersionsFromBundle(_0x271e4d)};}async[a131_0x94ad40(0x108)](_0x1d0332){const _0x3e6af5=a131_0x94ad40,_0x2b3e44=await this[_0x3e6af5(0xee)](_0x1d0332),_0x4a79d1=_0x2b3e44['attributes'][_0x3e6af5(0x13b)];if(!_0x4a79d1)throw new SDKError(ErrorCode['INVALID_ARGUMENT'],_0x3e6af5(0x115));await this[_0x3e6af5(0xea)][_0x3e6af5(0x143)](_0x4a79d1);const _0x229e41=await this[_0x3e6af5(0xea)][_0x3e6af5(0x136)](_0x4a79d1),_0x17b957=_0x229e41[_0x3e6af5(0xe8)]+'\x20v'+(_0x229e41[_0x3e6af5(0x11b)]+0x1);return this[_0x3e6af5(0xea)][_0x3e6af5(0x10c)](_0x4a79d1,{'sourceId':_0x1d0332,'attributes':{'name':_0x17b957}});}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const a132_0xc6e998=a132_0x2d1b;(function(_0x3539fe,_0x5acb6e){const _0x1068be=a132_0x2d1b,_0x48f27b=_0x3539fe();while(!![]){try{const _0x2cfff7=parseInt(_0x1068be(0x129))/0x1+parseInt(_0x1068be(0x12d))/0x2+parseInt(_0x1068be(0x126))/0x3*(-parseInt(_0x1068be(0x128))/0x4)+-parseInt(_0x1068be(0x12e))/0x5*(parseInt(_0x1068be(0x12f))/0x6)+parseInt(_0x1068be(0x124))/0x7+-parseInt(_0x1068be(0x130))/0x8*(parseInt(_0x1068be(0x12b))/0x9)+-parseInt(_0x1068be(0x12a))/0xa;if(_0x2cfff7===_0x5acb6e)break;else _0x48f27b['push'](_0x48f27b['shift']());}catch(_0x124732){_0x48f27b['push'](_0x48f27b['shift']());}}}(a132_0x3157,0xb344a));function a132_0x2d1b(_0x1fb107,_0x27609a){_0x1fb107=_0x1fb107-0x124;const _0x3157b6=a132_0x3157();let _0x2d1b92=_0x3157b6[_0x1fb107];return _0x2d1b92;}import{createTextCache}from'../../utils/local-cache.js';const chatIdCache=createTextCache(a132_0xc6e998(0x127),'llm/chat');export function saveLastChatId(_0x57b13e){const _0xe22fec=a132_0xc6e998;chatIdCache[_0xe22fec(0x125)](_0x57b13e);}export function loadLastChatId(){const _0x18711a=a132_0xc6e998;return chatIdCache[_0x18711a(0x12c)]();}function a132_0x3157(){const _0x4bd3aa=['387360sdebhv','read','1123058SJWbUh','75WLFiHy','538782mGEAIq','8TOGAKY','9792573OWlnQh','write','8607VKeHym','last_chat_id','100nQjGCe','801280uZYpbt','5657460keDlvj'];a132_0x3157=function(){return _0x4bd3aa;};return a132_0x3157();}export function clearLastChatId(){chatIdCache['clear']();}
|